From 143a5e08a0f96d5562914203f5836b7bf7722181 Mon Sep 17 00:00:00 2001 From: Muthurathinam Date: Fri, 1 Feb 2019 11:20:31 +0530 Subject: [PATCH] Changes: 1. Added Linter 2. Added Prettier 3. Added pre-commit hook to run test, prettier and linter 4. Added badges like code style, downloads and license --- .github/ISSUE_TEMPLATE/bug_report.md | 25 +- .github/ISSUE_TEMPLATE/feature_request.md | 21 +- .../pull_request_template.md | 25 +- .huskyrc | 5 + .jshintrc | 2 +- .prettierignore | 9 + .prettierrc | 13 + .vscode/launch.json | 113 +- .vscode/tasks.json | 24 +- CHANGELOG.md | 56 +- CONTRIBUTING.md | 94 +- README.md | 98 +- browser-wrapper-dependency.js | 2 +- browser-wrapper.js | 6 +- browserify-with-dependencies.js | 2 +- browserify.js | 2 +- docs/Actions.md | 117 +- docs/CreatingClientInstance.md | 22 +- docs/CustomAuthenticationProvider.md | 17 +- docs/CustomMiddlewareChain.md | 126 +- docs/GettingRawResponse.md | 8 +- docs/OtherAPIs.md | 100 +- docs/QueryParameters.md | 129 +- docs/content/Batching.md | 375 +- docs/tasks/LargeFileUploadTask.md | 40 +- docs/tasks/PageIterator.md | 74 +- package-lock.json | 5191 +++++++++-------- package.json | 102 +- samples/browser/README.md | 2 +- samples/browser/package-lock.json | 2426 ++++---- samples/browser/package.json | 28 +- samples/browser/src/index.html | 89 +- samples/browser/src/main.css | 94 +- samples/browser/src/main.js | 114 +- samples/browser/src/request.js | 175 +- samples/browser/src/ui.js | 20 +- samples/node/README.md | 2 +- samples/node/main.js | 27 +- samples/node/package-lock.json | 110 +- samples/node/package.json | 24 +- samples/node/secrets.sample.json | 2 +- spec/DummyAuthenticationProvider.ts | 21 +- spec/DummyHTTPMessageHandler.ts | 23 +- spec/DummyHandlerOption.ts | 33 +- spec/content/BatchRequestContent.ts | 1250 ++-- spec/content/BatchResponseContent.ts | 223 +- spec/core/Client.ts | 127 +- spec/core/GraphErrorHandler.ts | 173 +- spec/core/GraphRequestUtil.ts | 107 +- spec/core/GraphResponseHandler.ts | 165 +- spec/core/HTTPClient.ts | 107 +- spec/core/HTTPClientFactory.ts | 39 +- spec/core/MSALAuthenticationProvider.ts | 143 +- .../MSALAuthenticationProviderForBrowser.ts | 145 +- spec/core/Range.ts | 48 +- spec/core/urlGeneration.ts | 120 +- spec/core/urlParsing.ts | 57 +- .../HardCodedAuthenticationProvider.ts | 20 +- spec/development/secrets.sample.ts | 6 +- spec/development/test-helper.ts | 21 +- spec/development/workload/OneNote.ts | 167 +- spec/development/workload/delta-query.ts | 51 +- spec/development/workload/excel.ts | 110 +- spec/development/workload/groups.ts | 74 +- spec/development/workload/insights.ts | 33 +- spec/development/workload/open-extensions.ts | 23 +- spec/development/workload/users.ts | 44 +- spec/middleware/AuthenticationHandler.ts | 23 +- spec/middleware/MiddlewareControl.ts | 61 +- spec/middleware/MiddlewareUtil.ts | 201 +- spec/package-lock.json | 1886 +++--- spec/package.json | 32 +- spec/sample_files/onenotepage.html | 15 +- .../onenotepage_fileattachment.html | 17 +- spec/tasks/LargeFileUploadTask.ts | 319 +- spec/tasks/OneDriveLargeFileUploadTask.ts | 71 +- spec/tasks/OneDriveLargeFileUploadTaskUtil.ts | 39 +- spec/tasks/PageIterator.ts | 215 +- spec/test-helper.ts | 21 +- spec/tsconfig.json | 22 +- src/Client.ts | 181 +- src/CustomAuthenticationProvider.ts | 65 +- src/GraphError.ts | 92 +- src/GraphErrorHandler.ts | 158 +- src/GraphRequest.ts | 1373 +++-- src/GraphRequestUtil.ts | 56 +- src/GraphResponseHandler.ts | 264 +- src/HTTPClient.ts | 71 +- src/HTTPClientFactory.ts | 51 +- src/IAuthProvider.ts | 4 +- src/IAuthProviderCallback.ts | 4 +- src/IAuthenticationProvider.ts | 3 +- src/IClientOptions.ts | 32 +- src/IContext.ts | 10 +- src/IFetchOptions.ts | 14 +- src/IGraphRequestCallback.ts | 4 +- src/IOptions.ts | 4 +- src/MSALAuthenticationProvider.ts | 177 +- src/PolyFill.ts | 14 +- src/Range.ts | 52 +- src/RequestMethod.ts | 12 +- src/ResponseType.ts | 16 +- src/ValidatePolyFilling.ts | 32 +- src/browser/MSALAuthenticationProvider.ts | 176 +- src/browser/index.ts | 2 +- src/content/BatchRequestContent.ts | 806 ++- src/content/BatchResponseContent.ts | 168 +- src/middleware/AuthenticationHandler.ts | 104 +- src/middleware/HTTPMessageHandler.ts | 34 +- src/middleware/IMiddleware.ts | 6 +- src/middleware/MiddlewareControl.ts | 59 +- src/middleware/MiddlewareUtil.ts | 78 +- src/middleware/option/IMiddlewareOption.ts | 5 +- src/tasks/LargeFileUploadTask.ts | 423 +- src/tasks/OneDriveLargeFileUploadTask.ts | 270 +- src/tasks/OneDriveLargeFileUploadTaskUtil.ts | 29 +- src/tasks/PageIterator.ts | 273 +- tsconfig.json | 38 +- tslint.json | 21 + 119 files changed, 11047 insertions(+), 10297 deletions(-) create mode 100644 .huskyrc create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 tslint.json diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0f3e3fb26..9d854707a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,22 +1,23 @@ --- name: Bug report about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- -### Prerequisites +# Bug Report + +## Prerequisites -* [ ] Can you reproduce the problem? -* [ ] Are you running the latest version? -* [ ] Are you reporting to the correct repository? -* [ ] Did you perform a cursory search? +- [ ] Can you reproduce the problem? +- [ ] Are you running the latest version? +- [ ] Are you reporting to the correct repository? +- [ ] Did you perform a cursory search? For more information, see the `CONTRIBUTING` guide. -### Description +## Description [Description of the bug or feature] @@ -24,7 +25,7 @@ For more information, see the `CONTRIBUTING` guide. **Screenshots:** [If applicable, add screenshots to help explain your problem] -### Steps to Reproduce +## Steps to Reproduce 1. [First Step] 2. [Second Step] @@ -34,6 +35,6 @@ For more information, see the `CONTRIBUTING` guide. **Actual behavior:** [What actually happened] -### Additional context +## Additional context Add any other context about the problem here.. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d6..9081c1404 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,25 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- -**Is your feature request related to a problem? Please describe.** +# Feature Request + +## Is your feature request related to a problem? Please describe + A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** +## Describe the solution you'd like + A clear and concise description of what you want to happen. -**Describe alternatives you've considered** +## Describe alternatives you've considered + A clear and concise description of any alternative solutions or features you've considered. -**Additional context** +## Additional context + Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index 506b19b53..cf06ec1a4 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -1,5 +1,4 @@ -A similar PR may already be submitted! -Please search among the [Pull request](https://github.com/microsoftgraph/msgraph-sdk-javascript/pulls) before creating one. +A similar PR may already be submitted! Please search among the [Pull request](https://github.com/microsoftgraph/msgraph-sdk-javascript/pulls) before creating one. Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. @@ -22,18 +21,22 @@ Demonstrate the code is solid. Example: The exact commands you ran and their out ## Closing issues + Fixes # ## Types of changes + -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist -- [ ] I have read the **CONTRIBUTING** document. -- [ ] My code follows the code style of this project. -- [ ] My change requires a change to the documentation. -- [ ] I have updated the documentation accordingly. -- [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. + +- [ ] I have read the **CONTRIBUTING** document. +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. diff --git a/.huskyrc b/.huskyrc new file mode 100644 index 000000000..363a58ba9 --- /dev/null +++ b/.huskyrc @@ -0,0 +1,5 @@ +{ + "hooks": { + "pre-commit": "npm run lint && npm run format && npm run build && npm run test" + } +} \ No newline at end of file diff --git a/.jshintrc b/.jshintrc index 73067b3e9..860c41f3c 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,3 +1,3 @@ { "esnext": "true" -} \ No newline at end of file +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..3585d941f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,9 @@ +lib/ + +src/**/*.js +src/**/*.js.map +src/**/*.d.ts + +spec/**/*.js +spec/**/*.js.map +spec/**/*.d.ts \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..822dd6ad2 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,13 @@ +{ + "arrowParens": "always", + "bracketSpacing": true, + "jsxBracketSameLine": true, + "jsxSingleQuote": false, + "printWidth": 5000, + "proseWrap": "never", + "semi": true, + "singleQuote": false, + "tabWidth": 4, + "trailingComma": "all", + "useTabs": true +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 57a18416a..ff2685fb6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,56 +1,61 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Run node samples", - "program": "${workspaceRoot}/samples/node/main.js", - "cwd": "${workspaceRoot}", - "outFiles": [], - "internalConsoleOptions": "openOnSessionStart" - }, - { - "type": "node", - "request": "launch", - "name": "Run core tests", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "args": [ - "${workspaceRoot}/lib/spec/core/*.js" - ], - "cwd": "${workspaceRoot}", - "preLaunchTask": "Run Build", - "outFiles": [], - "internalConsoleOptions": "openOnSessionStart" - }, - { - "type": "node", - "request": "launch", - "name": "Run workload tests", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "args": [ - "${workspaceRoot}/spec/development/workload/*.js" - ], - "cwd": "${workspaceRoot}", - "preLaunchTask": "Run Build", - "outFiles": [], - "internalConsoleOptions": "openOnSessionStart" - }, - { - "type": "node", - "request": "launch", - "name": "Run middleware tests", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "args": [ - "${workspaceRoot}/spec/middleware/*.js" - ], - "cwd": "${workspaceRoot}", - "preLaunchTask": "Run Build", - "outFiles": [], - "internalConsoleOptions": "openOnSessionStart" - } - ] + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Run node samples", + "program": "${workspaceRoot}/samples/node/main.js", + "cwd": "${workspaceRoot}", + "outFiles": [], + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "node", + "request": "launch", + "name": "Run core tests", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "args": ["${workspaceRoot}/lib/spec/core/*.js"], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Run Build", + "outFiles": [], + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "node", + "request": "launch", + "name": "Run workload tests", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "args": ["${workspaceRoot}/spec/development/workload/*.js"], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Run Build", + "outFiles": [], + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "node", + "request": "launch", + "name": "Run middleware tests", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "args": ["${workspaceRoot}/lib/spec/middleware/*.js"], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Run Build", + "outFiles": [], + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "node", + "request": "launch", + "name": "Run Content tests", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "args": ["${workspaceRoot}/lib/spec/content/*.js"], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Run Build", + "outFiles": [], + "internalConsoleOptions": "openOnSessionStart" + } + ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ff6f80ea0..73785a034 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,13 +1,13 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "Run Build", - "type": "npm", - "script": "build", - "group": "build" - } - ] -} \ No newline at end of file + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Run Build", + "type": "npm", + "script": "build", + "group": "build" + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 95e984250..e70412268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,79 +4,79 @@ New Features -* Added Search query param functionality +- Added Search query param functionality Bug Fixes -* https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/115 -* https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/107 +- https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/115 +- https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/107 ## 1.3.0 New Features -* Support for Large File upload [[#1](https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_createuploadsession), [#2](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/tasks/LargeFileUploadTask.md)] -* Batching made easy [[#1](https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching), [#2](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/content/Batching.md)] +- Support for Large File upload [[#1](https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_createuploadsession), [#2](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/tasks/LargeFileUploadTask.md)] +- Batching made easy [[#1](https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching), [#2](https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/content/Batching.md)] Bug Fixes -* https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/97 -* https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/110 -* https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/39 -* https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/111 +- https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/97 +- https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/110 +- https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/39 +- https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/111 ## 1.2.0 Updates -* Two output js files, one with polyfills for Fetch-API and ES6-Promises lib/graph-js-sdk-web.js and one without lib/graph-js-sdk-core.js [Refer [README.md](https://github.com/microsoftgraph/msgraph-sdk-javascript#browser) for usage] -* Enum for ResponseType, which lists down the available ResponseType options in autocomplete +- Two output js files, one with polyfills for Fetch-API and ES6-Promises lib/graph-js-sdk-web.js and one without lib/graph-js-sdk-core.js [Refer [README.md](https://github.com/microsoftgraph/msgraph-sdk-javascript#browser) for usage] +- Enum for ResponseType, which lists down the available ResponseType options in autocomplete Bug Fix -* Cannot access the property "request-id" of undefined in GraphError handling +- Cannot access the property "request-id" of undefined in GraphError handling ## 1.1.0 New Features -* Support for Multipart POST request +- Support for Multipart POST request Updates -* Light weight FetchAPI dependency (in replacement for SuperAgent) +- Light weight FetchAPI dependency (in replacement for SuperAgent) Bug Fixes -* Updated putStream and getStream to work for all sized files -* Added obfuscation for output js file (graph-js-sdk-web.js) -* Updated versions of mocha and chai to 5.2.0 and 4.1.2 to fix security vulnerability in growl (which is a dependency of mocha) -* Running unit test files under types directory -* Compiling ts files +- Updated putStream and getStream to work for all sized files +- Added obfuscation for output js file (graph-js-sdk-web.js) +- Updated versions of mocha and chai to 5.2.0 and 4.1.2 to fix security vulnerability in growl (which is a dependency of mocha) +- Running unit test files under types directory +- Compiling ts files ## 1.0.0 -* Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more. +- Added tests for new Graph functionality - Delta query, Extensibility, OneNote, and more. ## 0.4.0 -* Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps -* Removed iterator helper method. +- Add support for ES5. Make sure to use `graph-js-sdk-web.js` for web apps +- Removed iterator helper method. ## 0.3.1 -* Support for Node.js versions 4 and 5 +- Support for Node.js versions 4 and 5 ## 0.3.0 -* Migrated away from typings in client library core and TypeScript sample +- Migrated away from typings in client library core and TypeScript sample ## 0.2.2 -* Updated SuperAgent to version `3.3.0` +- Updated SuperAgent to version `3.3.0` ## 0.2.0 -* **Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples. -* Added response handling tests to simulate Graph calls -* Added type declarations file for core client library, which adds intellisense for chained methods. +- **Breaking change for existing apps** - Initialize the client library with `MicrosoftGraph.Client.init({...})`. See the updated usage section below for code samples. +- Added response handling tests to simulate Graph calls +- Added type declarations file for core client library, which adds intellisense for chained methods. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe5a0ec05..4673e5a6b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,20 +1,20 @@ # Contributing -* [Ways to contribute](#ways-to-contribute) -* [Contribute using GitHub](#contribute-using-github) -* [Contribute using Git](#contribute-using-git) -* [How to use Markdown to format your topic](#how-to-use-markdown-to-format-your-topic) -* [FAQ](#faq) -* [More resources](#more-resources) +- [Ways to contribute](#ways-to-contribute) +- [Contribute using GitHub](#contribute-using-github) +- [Contribute using Git](#contribute-using-git) +- [How to use Markdown to format your topic](#how-to-use-markdown-to-format-your-topic) +- [FAQ](#faq) +- [More resources](#more-resources) ## Ways to contribute Here are some ways you can contribute to this documentation: -* To make small changes to an article, [Contribute using GitHub](#contribute-using-github). -* To make large changes, or changes that involve code, [Contribute using Git](#contribute-using-git). -* Report documentation bugs via GitHub Issues -* Request new documentation at the [Office Developer Platform UserVoice](http://officespdev.uservoice.com) site. +- To make small changes to an article, [Contribute using GitHub](#contribute-using-github). +- To make large changes, or changes that involve code, [Contribute using Git](#contribute-using-git). +- Report documentation bugs via GitHub Issues +- Request new documentation at the [Office Developer Platform UserVoice](http://officespdev.uservoice.com) site. ## Contribute using GitHub @@ -27,6 +27,7 @@ Use GitHub to contribute to this documentation without having to clone the repos 1. Find the article you want to contribute to on GitHub. If the article is in MSDN, choose the **suggest and submit changes** link in the **Contribute to this content** section and you'll be taken to the same article on GitHub. + 2. Once you are on the article in GitHub, sign in to GitHub (get a free account [Join GitHub](https://github.com/join). 3. Choose the **pencil icon** (edit the file in your fork of this project) and make your changes in the **<>Edit file** window. 4. Scroll to the bottom and enter a description. @@ -38,10 +39,10 @@ You now have successfully submitted a pull request. Pull requests are typically Use Git to contribute substantive changes, such as: -* Contributing code. -* Contributing changes that affect meaning. -* Contributing large changes to text. -* Adding new topics. +- Contributing code. +- Contributing changes that affect meaning. +- Contributing large changes to text. +- Adding new topics. ### To Contribute using Git @@ -50,8 +51,8 @@ Use Git to contribute substantive changes, such as: 3. To submit a pull request using Git, follow the steps in [Use GitHub, Git, and this repository](#use-github-git-and-this-repository). 4. You will be asked to sign the Contributor's License Agreement if you are: - * A member of the Microsoft Open Technologies group. - * A contributors who doesn't work for Microsoft. + - A member of the Microsoft Open Technologies group. + - A contributors who doesn't work for Microsoft. As a community member, you must sign the Contribution License Agreement (CLA) before you can contribute large submissions to a project. You only need to complete and submit the documentation once. Carefully review the document. You may be required to have your employer sign the document. @@ -61,14 +62,14 @@ Pull requests are typically reviewed within 10 business days. ## Use GitHub, Git, and this repository -**Note:** Most of the information in this section can be found in [GitHub Help] articles. If you're familiar with Git and GitHub, skip to the **Contribute and edit content** section for the specifics of the code/content flow of this repository. +**Note:** Most of the information in this section can be found in [GitHub Help] articles. If you're familiar with Git and GitHub, skip to the **Contribute and edit content** section for the specifics of the code/content flow of this repository. ### To set up your fork of the repository -1. Set up a GitHub account so you can contribute to this project. If you haven't done this, go to [GitHub](https://github.com/join) and do it now. -2. Install Git on your computer. Follow the steps in the [Setting up Git Tutorial] [Set Up Git]. -3. Create your own fork of this repository. To do this, at the top of the page, choose the **Fork** button. -4. Copy your fork to your computer. To do this, open Git Bash. At the command prompt enter: +1. Set up a GitHub account so you can contribute to this project. If you haven't done this, go to [GitHub](https://github.com/join) and do it now. +2. Install Git on your computer. Follow the steps in the [Setting up Git Tutorial][set up git]. +3. Create your own fork of this repository. To do this, at the top of the page, choose the **Fork** button. +4. Copy your fork to your computer. To do this, open Git Bash. At the command prompt enter: git clone https://github.com//.git @@ -93,16 +94,13 @@ To make the contribution process as seamless as possible, follow these steps. **Important** Limit each branch to a single concept/article to streamline the work flow and reduce the chance of merge conflicts. Content appropriate for a new branch includes: -* A new article. -* Spelling and grammar edits. -* Applying a single formatting change across a large set of articles (for example, applying a new copyright footer). +- A new article. +- Spelling and grammar edits. +- Applying a single formatting change across a large set of articles (for example, applying a new copyright footer). #### To create a new branch -1.Open Git Bash. -2.At the Git Bash command prompt, type `git pull upstream master:`. This creates a new branch locally that is copied from the latest MicrosoftGraph master branch. -3.At the Git Bash command prompt, type `git push origin `. This alerts GitHub to the new branch. You should now see the new branch in your fork of the repository on GitHub. -4.At the Git Bash command prompt, type `git checkout ` to switch to your new branch. +1.Open Git Bash. 2.At the Git Bash command prompt, type `git pull upstream master:`. This creates a new branch locally that is copied from the latest MicrosoftGraph master branch. 3.At the Git Bash command prompt, type `git push origin `. This alerts GitHub to the new branch. You should now see the new branch in your fork of the repository on GitHub. 4.At the Git Bash command prompt, type `git checkout ` to switch to your new branch. #### Add new content or edit existing content @@ -127,13 +125,13 @@ When you're finished with your work and are ready to have it merged into the mai #### To submit a pull request to the main repository -1.In the Git Bash command prompt, type `git push origin `. In your local repository, `origin` refers to your GitHub repository that you cloned the local repository from. This command pushes the current state of your new branch, including all commits made in the previous steps, to your GitHub fork. -2.On the GitHub site, navigate in your fork to the new branch. -3.Choose the **Pull Request** button at the top of the page. -4.Verify the Base branch is `microsoftgraph/@master` and the Head branch is `/@`. -5.Choose the **Update Commit Range** button. -6.Add a title to your pull request, and describe all the changes you're making. -7.Submit the pull request. +1. In the Git Bash command prompt, type `git push origin `. In your local repository, `origin` refers to your GitHub repository that you cloned the local repository from. This command pushes the current state of your new branch, including all commits made in the previous steps, to your GitHub fork. +2. On the GitHub site, navigate in your fork to the new branch. +3. Choose the **Pull Request** button at the top of the page. +4. Verify the Base branch is `microsoftgraph/@master` and the Head branch is `/@`. +5. Choose the **Update Commit Range** button. +6. Add a title to your pull request, and describe all the changes you're making. +7. Submit the pull request. One of the site administrators will process your pull request. Your pull request will surface on the microsoftgraph/ site under Issues. When the pull request is accepted, the issue will be resolved. @@ -155,13 +153,13 @@ You now have local copies (in a new local branch) of the work that you submitted #### Delete a branch -Once your changes are successfully merged into the main repository, delete the branch you used because you no longer need it. Any additional work should be done in a new branch. +Once your changes are successfully merged into the main repository, delete the branch you used because you no longer need it. Any additional work should be done in a new branch. #### To delete a branch 1. In the Git Bash command prompt, type `git checkout master`. This ensures that you aren't in the branch to be deleted (which isn't allowed). 2. Next, at the command prompt, type `git branch -d `. This deletes the branch on your computer only if it has been successfully merged to the upstream repository. (You can override this behavior with the `–D` flag, but first be sure you want to do this.) -3. Finally, type `git push origin :` at the command prompt (a space before the colon and no space after it). This will delete the branch on your github fork. +3. Finally, type `git push origin :` at the command prompt (a space before the colon and no space after it). This will delete the branch on your github fork. Congratulations, you have successfully contributed to the project! @@ -169,21 +167,21 @@ Congratulations, you have successfully contributed to the project! ### Article template -The [markdown template](/articles/0-markdown-template-for-new-articles.md) contains the basic Markdown for a topic that includes a table of contents, sections with subheadings, links to other Office developer topics, links to other sites, bold text, italic text, numbered and bulleted lists, code snippets, and images. +The [markdown template](/articles/0-markdown-template-for-new-articles.md) contains the basic Markdown for a topic that includes a table of contents, sections with subheadings, links to other Office developer topics, links to other sites, bold text, italic text, numbered and bulleted lists, code snippets, and images. ### Standard Markdown -All of the articles in this repository use Markdown. A complete introduction (and listing of all the syntax) can be found at [Markdown Home] []. +All of the articles in this repository use Markdown. A complete introduction (and listing of all the syntax) can be found at [Markdown Home][]. ## FAQ ### How do I get a GitHub account? -Fill out the form at [Join GitHub](https://github.com/join) to open a free GitHub account. +Fill out the form at [Join GitHub](https://github.com/join) to open a free GitHub account. ### Where do I get a Contributor's License Agreement? -You will automatically be sent a notice that you need to sign the Contributor's License Agreement (CLA) if your pull request requires one. +You will automatically be sent a notice that you need to sign the Contributor's License Agreement (CLA) if your pull request requires one. As a community member, **you must sign the Contribution License Agreement (CLA) before you can contribute large submissions to this project**. You only need complete and submit the documentation once. Carefully review the document. You may be required to have your employer sign the document. @@ -201,11 +199,11 @@ We typically review pull requests and respond to issues within 10 business days. ## More resources -* To learn more about Markdown, go to the Git creator's site [Daring Fireball]. -* To learn more about using Git and GitHub, first check out the [GitHub Help section] [GitHub Help]. +- To learn more about Markdown, go to the Git creator's site [Daring Fireball]. +- To learn more about using Git and GitHub, first check out the [GitHub Help section][github help]. -[GitHub Home]: http://github.com -[GitHub Help]: http://help.github.com/ -[Set Up Git]: http://help.github.com/win-set-up-git/ -[Markdown Home]: http://daringfireball.net/projects/markdown/ -[Daring Fireball]: http://daringfireball.net/ \ No newline at end of file +[github home]: http://github.com +[github help]: http://help.github.com/ +[set up git]: http://help.github.com/win-set-up-git/ +[markdown home]: http://daringfireball.net/projects/markdown/ +[daring fireball]: http://daringfireball.net/ diff --git a/README.md b/README.md index ba96937d8..d3c6c6d1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Microsoft Graph JavaScript Client Library -[![npm version badge](https://img.shields.io/npm/v/@microsoft/microsoft-graph-client.svg?maxAge=86400)](https://www.npmjs.com/package/@microsoft/microsoft-graph-client) -[![Travis](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript.svg?branch=master&style=flat-square)](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript) +[![npm version badge](https://img.shields.io/npm/v/@microsoft/microsoft-graph-client.svg?maxAge=86400)](https://www.npmjs.com/package/@microsoft/microsoft-graph-client) [![Travis](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript.svg?branch=master)](https://travis-ci.org/microsoftgraph/msgraph-sdk-javascript) [![Licence](https://img.shields.io/github/license/microsoftgraph/msgraph-sdk-javascript.svg)](https://github.com/microsoftgraph/msgraph-sdk-javascript) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/microsoftgraph/msgraph-sdk-javascript) [![Downloads](https://img.shields.io/npm/dm/@microsoft/microsoft-graph-client.svg??maxAge=86400)](https://www.npmjs.com/package/@microsoft/microsoft-graph-client) The Microsoft Graph JavaScript client library is a lightweight wrapper around the Microsoft Graph API that can be used server-side and in the browser. @@ -26,7 +25,7 @@ import { Client } from "@microsoft/microsoft-graph-client"; In case your environment have support for or have polyfill for [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) [[support](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#Browser_compatibility)] and [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) [[support](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Browser_compatibility)], import `./node_modules/@microsoft/microsoft-graph-client/lib/src/core/index` into your module which doesn't have polyfills for these. ```typescript -import {Client} from "./node_modules/@microsoft/microsoft-graph-client/lib/src/core/index"; +import { Client } from "./node_modules/@microsoft/microsoft-graph-client/lib/src/core/index"; ``` ### Via Script Tag @@ -47,15 +46,10 @@ In case your browser doesn't have support for [Fetch](https://developer.mozilla. ### 1. Register your application -Register your application to use Microsoft Graph API using one of the following -supported authentication portals: +Register your application to use Microsoft Graph API using one of the following supported authentication portals: -* [Microsoft Application Registration Portal](https://apps.dev.microsoft.com): - Register a new application that works with Microsoft Accounts and/or - organizational accounts using the unified V2 Authentication Endpoint. -* [Microsoft Azure Active Directory](https://manage.windowsazure.com): Register - a new application in your tenant's Active Directory to support work or school - users for your tenant or multiple tenants. +- [Microsoft Application Registration Portal](https://apps.dev.microsoft.com): Register a new application that works with Microsoft Accounts and/or organizational accounts using the unified V2 Authentication Endpoint. +- [Microsoft Azure Active Directory](https://manage.windowsazure.com): Register a new application in your tenant's Active Directory to support work or school users for your tenant or multiple tenants. ### 2. Authenticate for the Microsoft Graph service @@ -72,10 +66,11 @@ Refer devDependencies in [package.json](./package.json) for the compatible msal ``` ```typescript -const clientID = 'your_client_id'; // Client Id of the registered application +const clientID = "your_client_id"; // Client Id of the registered application const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes -const options = { // An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options - redirectUri: "Your redirect URI" +const options = { + // An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options + redirectUri: "Your redirect URI", }; const authProvider = new MicrosoftGraph.MSALAuthenticationProvider(clientId, scopes, options); ``` @@ -91,10 +86,11 @@ npm install msal@ ```typescript import { MSALAuthenticationProvider } from "./node_modules/@microsoft/microsoft-graph-client/lib/src/MSALAuthenticationProvider"; -const clientID = 'your_client_id'; // Client Id of the registered application +const clientID = "your_client_id"; // Client Id of the registered application const graphScopes = ["user.read", "mail.send"]; // An array of graph scopes -const options = { // An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options - redirectUri: "Your redirect URI" +const options = { + // An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options + redirectUri: "Your redirect URI", }; const authProvider = new MSALAuthenticationProvider(clientId, scopes, options); ``` @@ -109,7 +105,7 @@ An instance of the **Client** class handles requests to Microsoft Graph API and ```typescript const options = { - authProvider // An instance created from previous step + authProvider, // An instance created from previous step }; const Client = MicrosoftGraph.Client; const client = Client.initWithMiddleware(options); @@ -121,7 +117,7 @@ const client = Client.initWithMiddleware(options); import { Client } from "@microsoft/microsoft-graph-client"; const options = { - authProvider // An instance created from previous step + authProvider, // An instance created from previous step }; const client = Client.initWithMiddleware(options); ``` @@ -136,10 +132,10 @@ Getting user details ```typescript try { - let userDetails = await client.api("/me").get(); - console.log(userDetails); -} catch(error) { - throw error; + let userDetails = await client.api("/me").get(); + console.log(userDetails); +} catch (error) { + throw error; } ``` @@ -148,22 +144,24 @@ Sending an email to the recipients ```typescript // Construct email object const mail = { - subject: "Microsoft Graph JavaScript Sample", - toRecipients: [{ - emailAddress: { - address: "example@example.com" - } - }], - body: { - content: "

MicrosoftGraph JavaScript Sample

Check out https://github.com/microsoftgraph/msgraph-sdk-javascript", - contentType: "html" - } + subject: "Microsoft Graph JavaScript Sample", + toRecipients: [ + { + emailAddress: { + address: "example@example.com", + }, + }, + ], + body: { + content: "

MicrosoftGraph JavaScript Sample

Check out https://github.com/microsoftgraph/msgraph-sdk-javascript", + contentType: "html", + }, }; try { - let response = await client.api("/me/sendMail").post({message: mail}); - console.log(response); -} catch(error) { - throw error; + let response = await client.api("/me/sendMail").post({ message: mail }); + console.log(response); +} catch (error) { + throw error; } ``` @@ -171,13 +169,13 @@ For more information, refer: [Calling Pattern](docs/CallingPattern.md), [Actions ## Documentation -* [Batching](docs/content/Batching.md) -* [Large File Upload Task](docs/tasks/LargeFileUploadTask.md) -* [Page Iterator](docs/tasks/PageIterator.md) -* [Actions](docs/Actions.md) -* [Query Parameters](docs/QueryParameters.md) -* [Other APIs](docs/OtherAPIs.md) -* [Getting Raw Response](docs/GettingRawResponse.md) +- [Batching](docs/content/Batching.md) +- [Large File Upload Task](docs/tasks/LargeFileUploadTask.md) +- [Page Iterator](docs/tasks/PageIterator.md) +- [Actions](docs/Actions.md) +- [Query Parameters](docs/QueryParameters.md) +- [Other APIs](docs/OtherAPIs.md) +- [Getting Raw Response](docs/GettingRawResponse.md) ## Questions and comments @@ -189,11 +187,11 @@ Please see the [contributing guidelines](CONTRIBUTING.md). ## Additional resources -* [Microsoft Graph website](https://graph.microsoft.io) -* [Microsoft Graph TypeScript types](https://github.com/microsoftgraph/msgraph-typescript-typings/) -* [Angular.js sample using the JavaScript client library](https://github.com/microsoftgraph/angular-connect-sample) -* [Node.js sample using the JavaScript client library](https://github.com/microsoftgraph/nodejs-connect-sample) -* [Office Dev Center](http://dev.office.com/) +- [Microsoft Graph website](https://graph.microsoft.io) +- [Microsoft Graph TypeScript types](https://github.com/microsoftgraph/msgraph-typescript-typings/) +- [Angular.js sample using the JavaScript client library](https://github.com/microsoftgraph/angular-connect-sample) +- [Node.js sample using the JavaScript client library](https://github.com/microsoftgraph/nodejs-connect-sample) +- [Office Dev Center](http://dev.office.com/) ## Third Party Notices @@ -205,7 +203,7 @@ If you find a security issue with our libraries or services please report it to ## License -Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "[License](./LICENSE)"); +Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "[License](./LICENSE)"); ## We Value and Adhere to the Microsoft Open Source Code of Conduct diff --git a/browser-wrapper-dependency.js b/browser-wrapper-dependency.js index b507ee799..b7c58bdd9 100644 --- a/browser-wrapper-dependency.js +++ b/browser-wrapper-dependency.js @@ -9,4 +9,4 @@ * Initializes PolyFilling */ const PolyFill = require("./lib/src/PolyFill"); -PolyFill.init(); \ No newline at end of file +PolyFill.init(); diff --git a/browser-wrapper.js b/browser-wrapper.js index d520dfe36..caf167d69 100644 --- a/browser-wrapper.js +++ b/browser-wrapper.js @@ -5,7 +5,7 @@ * ------------------------------------------------------------------------------------------- */ - /** - * Adds exports in index.js to the MicrosoftGraph property in window object - */ +/** + * Adds exports in index.js to the MicrosoftGraph property in window object + */ window.MicrosoftGraph = require("./lib/src/browser/index.js"); diff --git a/browserify-with-dependencies.js b/browserify-with-dependencies.js index 894ec8448..2270ce6d2 100644 --- a/browserify-with-dependencies.js +++ b/browserify-with-dependencies.js @@ -12,4 +12,4 @@ const Browserify = require("browserify"); const browserify = Browserify(); browserify.add("./browser-wrapper.js"); browserify.add("./browser-wrapper-dependency.js"); -browserify.bundle().pipe(process.stdout); \ No newline at end of file +browserify.bundle().pipe(process.stdout); diff --git a/browserify.js b/browserify.js index 07d61ec02..255387c40 100644 --- a/browserify.js +++ b/browserify.js @@ -11,4 +11,4 @@ const Browserify = require("browserify"); const browserify = Browserify(); browserify.add("./browser-wrapper.js"); -browserify.bundle().pipe(process.stdout); \ No newline at end of file +browserify.bundle().pipe(process.stdout); diff --git a/docs/Actions.md b/docs/Actions.md index 15ae3dc57..4f901b71b 100644 --- a/docs/Actions.md +++ b/docs/Actions.md @@ -8,10 +8,10 @@ Getting user details ```typescript try { - let res = await client.api("/me").get(); - console.log(res); -} catch(error) { - throw error; + let res = await client.api("/me").get(); + console.log(res); +} catch (error) { + throw error; } ``` @@ -21,25 +21,27 @@ You can download information from the graph using NodeJS streams with `.getStrea Downloading a file from OneDrive -````typescript -const fs = require('fs'); -client.api("/me/drive/root/children//content").getStream() //Eg: test.pdf -.then((stream) => { - let writeStream = fs.createWriteStream(`../`); // Eg: test.pdf - stream.pipe(writeStream).on('error', err => { - throw error; - }); - writeStream.on("finish", () => { - console.log("Downloaded"); - }); - writeStream.on("error", err => { - throw error; - }); -}) -.catch((error) => { - throw error; -}); -```` +```typescript +const fs = require("fs"); +client + .api("/me/drive/root/children//content") + .getStream() //Eg: test.pdf + .then((stream) => { + let writeStream = fs.createWriteStream(`../`); // Eg: test.pdf + stream.pipe(writeStream).on("error", (err) => { + throw error; + }); + writeStream.on("finish", () => { + console.log("Downloaded"); + }); + writeStream.on("error", (err) => { + throw error; + }); + }) + .catch((error) => { + throw error; + }); +``` ## POST @@ -49,22 +51,24 @@ Sending an email to the recipients ```typescript const mail = { - subject: "Microsoft Graph JavaScript Sample", - toRecipients: [{ - emailAddress: { - address: "example@example.com" - } - }], - body: { - content: "

MicrosoftGraph JavaScript

Check out https://github.com/microsoftgraph/msgraph-sdk-javascript", - contentType: "html" - } -} + subject: "Microsoft Graph JavaScript Sample", + toRecipients: [ + { + emailAddress: { + address: "example@example.com", + }, + }, + ], + body: { + content: "

MicrosoftGraph JavaScript

Check out https://github.com/microsoftgraph/msgraph-sdk-javascript", + contentType: "html", + }, +}; try { - let res = await client.api("/me/sendMail").post({message: mail}); - console.log(res); + let res = await client.api("/me/sendMail").post({ message: mail }); + console.log(res); } catch (error) { - console.error(error); + console.error(error); } ``` @@ -77,13 +81,13 @@ Updating the birthday information for a contact ```typescript let contactId = ""; let contactInfo = { - "birthday": "1991-07-22" + birthday: "1991-07-22", }; try { - let res = await client.api(`/me/contacts/${contactId}`).patch(contactInfo); - console.log(res); + let res = await client.api(`/me/contacts/${contactId}`).patch(contactInfo); + console.log(res); } catch (error) { - console.error(error); + console.error(error); } ``` @@ -93,14 +97,14 @@ You can delete a resource in graph using `.delete()`/`.del()`. Deleting the file in OneDrive -````typescript +```typescript try { - let res = await client.api(`/me/drive/items/${ONE_DRIVE_FILE_ID_TO_DELETE}`).delete(); - console.log(res); + let res = await client.api(`/me/drive/items/${ONE_DRIVE_FILE_ID_TO_DELETE}`).delete(); + console.log(res); } catch (error) { - console.error(error); + console.error(error); } -```` +``` ## PUT @@ -111,10 +115,10 @@ Updating profile picture from a HTML input form ```typescript let file; // FileObject retrieved from the HTML input type=file try { - let res = await client.api('/me/photo/$value').put(file); - console.log(res); + let res = await client.api("/me/photo/$value").put(file); + console.log(res); } catch (error) { - throw error; + throw error; } ``` @@ -124,14 +128,13 @@ You can replace resources in graph using NodeJS streams with `.putStream()`. Uploading a file to OneDrive -````typescript - -let fs = require('fs'); +```typescript +let fs = require("fs"); try { - let stream = fs.createReadStream(''); // Eg: "./test.jpg" - let res = await client.api(`/me/drive/root/children//content`); // Eg: /me/drive/root/children/test.jpg/content - console.log(res); + let stream = fs.createReadStream(""); // Eg: "./test.jpg" + let res = await client.api(`/me/drive/root/children//content`); // Eg: /me/drive/root/children/test.jpg/content + console.log(res); } catch (error) { - throw error; + throw error; } -```` \ No newline at end of file +``` diff --git a/docs/CreatingClientInstance.md b/docs/CreatingClientInstance.md index 546797f8c..7aa92f8f3 100644 --- a/docs/CreatingClientInstance.md +++ b/docs/CreatingClientInstance.md @@ -24,8 +24,8 @@ Want to use own preferred authentication library, for which one has to implement ```typescript let clientOptions: ClientOptions = { - // MyCustomAuthenticationProvider is the user's own authentication provider implementing AuthenticationProvider interface - authProvider: new MyCustomAuthenticationProvider() + // MyCustomAuthenticationProvider is the user's own authentication provider implementing AuthenticationProvider interface + authProvider: new MyCustomAuthenticationProvider(), }; const client = Client.initWithMiddleware(clientOptions); ``` @@ -34,13 +34,12 @@ Refer, [custom authentication provider](./CustomAuthenticationProvider.md) for m ### Option B. Custom Middleware chain -Want to have complete control over the request and the response objects, one can provide his own chain of middleware. -Have to pass first middleware in the chain as `middleware` in [ClientOptions](../src/IClientOptions.ts). +Want to have complete control over the request and the response objects, one can provide his own chain of middleware. Have to pass first middleware in the chain as `middleware` in [ClientOptions](../src/IClientOptions.ts). ```typescript let clientOptions: ClientOptions = { - // MyFirstMiddleware is the first middleware in my custom middleware chain - middleware: new MyFirstMiddleware() + // MyFirstMiddleware is the first middleware in my custom middleware chain + middleware: new MyFirstMiddleware(), }; const client = Client.initWithMiddleware(clientOptions); ``` @@ -54,15 +53,14 @@ Pass an [authProvider function](../src/IAuthProvider.ts) in [Options](../src/IOp ```typescript // Some callback function const authProvider: AuthProvider = (callback: AuthProviderCallback) => { + // Your logic for getting and refreshing accessToken - // Your logic for getting and refreshing accessToken - - // Error should be passed in case of error while authenticating - // accessToken should be passed upon successful authentication - callback(error, accessToken); + // Error should be passed in case of error while authenticating + // accessToken should be passed upon successful authentication + callback(error, accessToken); }; let options: Options = { - authProvider + authProvider, }; const client = Client.init(options); ``` diff --git a/docs/CustomAuthenticationProvider.md b/docs/CustomAuthenticationProvider.md index a30870bdd..08a77dc89 100644 --- a/docs/CustomAuthenticationProvider.md +++ b/docs/CustomAuthenticationProvider.md @@ -13,15 +13,12 @@ Create own implementation of Authentication provider which implements [Authentic import { AuthenticationProvider } from "@microsoft/microsoft-graph-client"; class MyAuthenticationProvider implements AuthenticationProvider { - - /** - * This method will get called before every request to the msgraph server - * This should return a Promise that resolves to an accessToken (in case of success) or rejects with error (in case of failure) - * Basically this method will contain the implementation for getting and refreshing accessTokens - */ - public async getAccessToken(): Promise { - - } + /** + * This method will get called before every request to the msgraph server + * This should return a Promise that resolves to an accessToken (in case of success) or rejects with error (in case of failure) + * Basically this method will contain the implementation for getting and refreshing accessTokens + */ + public async getAccessToken(): Promise {} } ``` @@ -33,7 +30,7 @@ Pass instance of MyAuthenticationProvider while initializing. import { MyAuthenticationProvider } from "./MyAuthenticationProvider"; let clientOptions: ClientOptions = { - authProvider: new MyCustomAuthenticationProvider() + authProvider: new MyCustomAuthenticationProvider(), }; const client = Client.initWithMiddleware(clientOptions); ``` diff --git a/docs/CustomMiddlewareChain.md b/docs/CustomMiddlewareChain.md index ec80c6261..e9241776c 100644 --- a/docs/CustomMiddlewareChain.md +++ b/docs/CustomMiddlewareChain.md @@ -18,27 +18,26 @@ import { Middleware } from "@microsoft/microsoft-graph-client"; import { Context } from "@microsoft/microsoft-graph-client"; export class MyLoggingHandler implements Middleware { - - private nextMiddleware: Middleware; - - public async execute(context: Context): Promise { - try { - let url: string; - if (typeof context.request === "string") { - url = context.request; - } else { - url = context.request.url; - } - console.log(url); - return await this.nextMiddleware.execute(context); - } catch(error) { - throw error; - } - } - - public setNext(next: Middleware): void { - this.nextMiddleware = next; - } + private nextMiddleware: Middleware; + + public async execute(context: Context): Promise { + try { + let url: string; + if (typeof context.request === "string") { + url = context.request; + } else { + url = context.request.url; + } + console.log(url); + return await this.nextMiddleware.execute(context); + } catch (error) { + throw error; + } + } + + public setNext(next: Middleware): void { + this.nextMiddleware = next; + } } ``` @@ -49,17 +48,17 @@ export class MyLoggingHandler implements Middleware { import { Middleware } from "@microsoft/microsoft-graph-client"; export class MyHttpMessageHandler implements Middleware { - public async execute(context: Context): Promise { - try { - // For more information about context object refer "Context" section below - let response = await fetch(context.request, context.options); - // Set the response back in the context - context.response = response; - return; - } catch (error) { - throw error; - } - } + public async execute(context: Context): Promise { + try { + // For more information about context object refer "Context" section below + let response = await fetch(context.request, context.options); + // Set the response back in the context + context.response = response; + return; + } catch (error) { + throw error; + } + } } ``` @@ -92,7 +91,7 @@ Pass first middleware in the chain for initializing the client. ```typescript let clientOptions: ClientOptions = { - middleware: authenticationHandler + middleware: authenticationHandler, }; const client = Client.initWithMiddleware(clientOptions); ``` @@ -103,11 +102,11 @@ One can pass any middleware specific options or data while initializing the clie ```typescript let clientOptions: ClientOptions = { - middleware: authenticationHandler, - middlewareOptions: { - loggingPrefix: "MSGraph-Client-Library" - } -} + middleware: authenticationHandler, + middlewareOptions: { + loggingPrefix: "MSGraph-Client-Library", + }, +}; ``` The above middlewareOptions object will be available in the context object that is being passed to the execute method of a middleware. @@ -118,32 +117,31 @@ import { Middleware } from "@microsoft/microsoft-graph-client"; import { Context } from "@microsoft/microsoft-graph-client"; export class MyLoggingHandler implements Middleware { - - private nextMiddleware: Middleware; - - public async execute(context: Context): Promise { - try { - let url: string; - if (typeof context.request === "string") { - url = context.request; - } else { - url = context.request.url; - } - if (context.middlewareOptions !== undefined && context.middlewareOptions.loggingPrefix !== undefined) { - console.log(`${context.middlewareOptions.loggingPrefix}: ${url}`); - } else { - console.log(url); - } - await this.nextMiddleware.execute(context); - } catch(error) { - throw error; - } - } - - public setNext(next: Middleware): void { - this.nextMiddleware = next; - } + private nextMiddleware: Middleware; + + public async execute(context: Context): Promise { + try { + let url: string; + if (typeof context.request === "string") { + url = context.request; + } else { + url = context.request.url; + } + if (context.middlewareOptions !== undefined && context.middlewareOptions.loggingPrefix !== undefined) { + console.log(`${context.middlewareOptions.loggingPrefix}: ${url}`); + } else { + console.log(url); + } + await this.nextMiddleware.execute(context); + } catch (error) { + throw error; + } + } + + public setNext(next: Middleware): void { + this.nextMiddleware = next; + } } ``` -Refer [MiddlewareOptions](../src/middleware/option/IMiddlewareOption.ts) interface to know its structure. +Refer [MiddlewareOption](../src/middleware/option/IMiddlewareOption.ts) interface to know its structure. diff --git a/docs/GettingRawResponse.md b/docs/GettingRawResponse.md index ebdec00f0..7b7b06212 100644 --- a/docs/GettingRawResponse.md +++ b/docs/GettingRawResponse.md @@ -11,6 +11,10 @@ Refer [this documentation](../CreatingClientInstance.md) for initializing the cl To get the raw response set the responseType of a request to ResponseType.RAW. ```typescript -const rawResponse = client.api("/me").select("displayName").responseType(ResponseType.RAW).get(); +const rawResponse = client + .api("/me") + .select("displayName") + .responseType(ResponseType.RAW) + .get(); console.log(rawResponse); -``` \ No newline at end of file +``` diff --git a/docs/OtherAPIs.md b/docs/OtherAPIs.md index b7e8ac169..99fd724ac 100644 --- a/docs/OtherAPIs.md +++ b/docs/OtherAPIs.md @@ -6,10 +6,13 @@ Passing in a version through `.version()` has the highest priority. It overrides ```typescript try { - let res = await client.api("/me/ownedDevices").version("beta").get(); - console.log(res); + let res = await client + .api("/me/ownedDevices") + .version("beta") + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } ``` @@ -19,12 +22,21 @@ You can pass in any URL query parameters through `.query()` as a dictionary or s ```typescript try { - // Below three statements are same - let res1 = await client.api("/me").query({ "$select": "displayName" }).get(); - let res2 = await client.api("/me").query("$select=displayName").get(); - let res3 = await client.api("/me").select("displayName").get(); + // Below three statements are same + let res1 = await client + .api("/me") + .query({ $select: "displayName" }) + .get(); + let res2 = await client + .api("/me") + .query("$select=displayName") + .get(); + let res3 = await client + .api("/me") + .select("displayName") + .get(); } catch (error) { - throw error; + throw error; } ``` @@ -32,29 +44,37 @@ try { You can pass in additional request headers through `.header()` or `.headers()` either individually or in a dictionary. -````typescript +```typescript try { - let messageBody = { - message: { - subject: "Meet for lunch?", - body: { - contentType: "Text", - content: "The new cafeteria is open." - }, - toRecipients: [{ - emailAddress: { - address: "garthf@contoso.com" - } - }] - } - }; - // Below two statements are same - let res1 = await client.api("/me/sendMail").header("content-type", "application/json").post(messageBody); - let res2 = await client.api("/me/sendMail").headers({"content-type": "application/json"}).post(messageBody); + let messageBody = { + message: { + subject: "Meet for lunch?", + body: { + contentType: "Text", + content: "The new cafeteria is open.", + }, + toRecipients: [ + { + emailAddress: { + address: "garthf@contoso.com", + }, + }, + ], + }, + }; + // Below two statements are same + let res1 = await client + .api("/me/sendMail") + .header("content-type", "application/json") + .post(messageBody); + let res2 = await client + .api("/me/sendMail") + .headers({ "content-type": "application/json" }) + .post(messageBody); } catch (error) { - throw error; + throw error; } -```` +``` ## OPTION AND OPTIONS @@ -80,12 +100,13 @@ You can pass in the middleware options for a request through `.middlewareOption( ```typescript try { - let res = await client.api("/me/messages").middlewareOption([ - new RetryHandlerOption(5000) - ]).get(); - console.log(res); + let res = await client + .api("/me/messages") + .middlewareOption([new RetryHandlerOption(5000)]) + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } ``` @@ -93,11 +114,14 @@ try { To set a custom response type, use the`.responseType()` method. Refer [ResponseType.ts](./src/ResponseType.ts) for available options. -````typescript +```typescript try { - let res = await client.api(`/me/drive/root/children/${fileName}/content`).responseType(MicrosoftGraph.ResponseType.BLOB).get(); - console.log(res); + let res = await client + .api(`/me/drive/root/children/${fileName}/content`) + .responseType(MicrosoftGraph.ResponseType.BLOB) + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } -```` +``` diff --git a/docs/QueryParameters.md b/docs/QueryParameters.md index fcb6f244a..0c08f6ebd 100644 --- a/docs/QueryParameters.md +++ b/docs/QueryParameters.md @@ -1,111 +1,156 @@ # Query Parameters -## $SELECT +## \$SELECT `.select()` can take a string property, an array of strings or you can pass in each value as a separate argument. ```typescript try { - // Below three statements are same - let res1 = await client.api("/me/people").select("displayName").select("department").get(); - let res2 = await client.api("/me/people").select("displayName", "department").get(); - let res3 = await client.api("/me/people").select(["displayName", "department"]).get(); + // Below three statements are same + let res1 = await client + .api("/me/people") + .select("displayName") + .select("department") + .get(); + let res2 = await client + .api("/me/people") + .select("displayName", "department") + .get(); + let res3 = await client + .api("/me/people") + .select(["displayName", "department"]) + .get(); } catch (error) { - throw error; + throw error; } ``` -## $EXPAND +## \$EXPAND `.expand()` can take a string property, an array of strings or you can pass in each value as a separate argument. ```typescript try { - // Below three statements are same - let res1 = await client.api("/me/people").expand("manager").expand("directReports").get(); - let res2 = await client.api("/me/people").expand("manager", "directReports").get(); - let res3 = await client.api("/me/people").expand(["manager", "directReports"]).get(); + // Below three statements are same + let res1 = await client + .api("/me/people") + .expand("manager") + .expand("directReports") + .get(); + let res2 = await client + .api("/me/people") + .expand("manager", "directReports") + .get(); + let res3 = await client + .api("/me/people") + .expand(["manager", "directReports"]) + .get(); } catch (error) { - throw error; + throw error; } ``` -## $ORDERBY +## \$ORDERBY `.orderby()` can take a string property, an array of strings or you can pass in each value as a separate argument. ```typescript try { - // Below three statements are same - let res1 = await client.api("/me/messages").orderby("name").orderby("subject").get(); - let res2 = await client.api("/me/messages").orderby("name", "subject").get(); - let res3 = await client.api("/me/messages").orderby(["name", "subject"]).get(); + // Below three statements are same + let res1 = await client + .api("/me/messages") + .orderby("name") + .orderby("subject") + .get(); + let res2 = await client + .api("/me/messages") + .orderby("name", "subject") + .get(); + let res3 = await client + .api("/me/messages") + .orderby(["name", "subject"]) + .get(); } catch (error) { - throw error; + throw error; } ``` -## $TOP +## \$TOP `.top()` can take only a number as a parameter. Calling it multiple times is not supported. ```typescript try { - let res = await client.api("/me/contacts").top(5).get(); - console.log(res); + let res = await client + .api("/me/contacts") + .top(5) + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } ``` -## $SKIP +## \$SKIP `.skip()` can take only a number as a parameter. Calling it multiple times is not supported. ```typescript try { - let res = await client.api("/me/events").skip(10).get(); - console.log(res); + let res = await client + .api("/me/events") + .skip(10) + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } ``` -## $COUNT +## \$COUNT Set `.count()` to true to additionally return the number of objects in the collection. -````typescript +```typescript try { - let res = await client.api("/me/calendars").count(true).get(); - console.log(res); + let res = await client + .api("/me/calendars") + .count(true) + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } -```` +``` -## $FILTER +## \$FILTER Pass a filter string to `.filter()` for filtering result collections. Calling filter multiple times will override previous filter strings. -````typescript +```typescript try { - let res = await client.api("/users").filter("startswith(displayName, 'dicaprio')").get(); - console.log(res); + let res = await client + .api("/users") + .filter("startswith(displayName, 'dicaprio')") + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } -```` +``` -## $SEARCH +## \$SEARCH Pass a search string to `.search()` to restrict the results of a request to match a search criterion. Calling search multiple times will override previous search strings. ```typescript try { - let res = await client.api("/me/people").search("dicaprio").get(); - console.log(res); + let res = await client + .api("/me/people") + .search("dicaprio") + .get(); + console.log(res); } catch (error) { - throw error; + throw error; } ``` diff --git a/docs/content/Batching.md b/docs/content/Batching.md index 3c7617e25..9c40b280d 100644 --- a/docs/content/Batching.md +++ b/docs/content/Batching.md @@ -1,6 +1,6 @@ # [Batching](https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching) -Batching is a way of combining multiple requests to resources in same/different workloads in a single HTTP request. This can be achieved by making a post call with those requests as a JSON payload to $batch endpoint. +Batching is a way of combining multiple requests to resources in same/different workloads in a single HTTP request. This can be achieved by making a post call with those requests as a JSON payload to \$batch endpoint. ## BatchRequestContent @@ -15,139 +15,138 @@ A Component to simplify the processing of batch responses by providing functiona ```typescript // elem here is the input HTML element of type file const serialBatching = async function(elem) { - try { - let file = elem.files[0]; - let uploadProfilePhotoRequest = new Request("/me/photo/$value", { - method: "PUT", - headers: { - "Content-type": file.type - }, - body: file - }); - - let uploadProfilePhotoStep: BatchRequestStep = { - id: "1", - request: uploadProfilePhotoRequest - }; - - let downloadProfilePhotoRequest = new Request("/me/photo/$value", { - method: "GET" - }); - - let downloadId = "2"; - let downloadProfilePhotoStep: BatchRequestStep = { - id: downloadId, - request: downloadProfilePhotoRequest, - // Adding dependsOn makes this request wait until the dependency finishes - // This download request waits until the upload request completes - dependsOn: ["1"] - }; - - //Create instance by passing a batch request step - let batchRequestContent = new MicrosoftGraph.BatchRequestContent([uploadProfilePhotoStep, downloadProfilePhotoStep]); - - //Extracting content from the instance - let content = await batchRequestContent.getContent(); - - //Making call to $batch end point with the extracted content - let response = await client.api("/$batch").post(content); - - //Create instance with response from the batch request - let batchResponseContent = new MicrosoftGraph.BatchResponseContent(response); - - //Getting response by id - console.log(batchResponse.getResponseById(downloadId)); - - //Getting all the responses - console.log(batchResponseContent.getResponses()); - } catch (error) { - console.error(error); - } + try { + let file = elem.files[0]; + let uploadProfilePhotoRequest = new Request("/me/photo/$value", { + method: "PUT", + headers: { + "Content-type": file.type, + }, + body: file, + }); + + let uploadProfilePhotoStep: BatchRequestStep = { + id: "1", + request: uploadProfilePhotoRequest, + }; + + let downloadProfilePhotoRequest = new Request("/me/photo/$value", { + method: "GET", + }); + + let downloadId = "2"; + let downloadProfilePhotoStep: BatchRequestStep = { + id: downloadId, + request: downloadProfilePhotoRequest, + // Adding dependsOn makes this request wait until the dependency finishes + // This download request waits until the upload request completes + dependsOn: ["1"], + }; + + //Create instance by passing a batch request step + let batchRequestContent = new MicrosoftGraph.BatchRequestContent([uploadProfilePhotoStep, downloadProfilePhotoStep]); + + //Extracting content from the instance + let content = await batchRequestContent.getContent(); + + //Making call to $batch end point with the extracted content + let response = await client.api("/$batch").post(content); + + //Create instance with response from the batch request + let batchResponseContent = new MicrosoftGraph.BatchResponseContent(response); + + //Getting response by id + console.log(batchResponse.getResponseById(downloadId)); + + //Getting all the responses + console.log(batchResponseContent.getResponses()); + } catch (error) { + console.error(error); + } }; - ``` ### GET and POST contents from and to different workloads - Making parallel requests ```typescript const parallelBatching = async function() { - try { - let fileName = "test.pdf"; - let oneDriveFileRequest = new Request(`/me/drive/root:/${fileName}:/content`, { - method: "GET" - }); - - let oneDriveFileStep: BatchRequestStep = { - id: "1", - request: oneDriveFileRequest - }; - - let folderDetails = { - "name": "Testing Batch", - "folder": {} - }; - let createFolder = new Request("/me/drive/root/children", { - method: "POST", - headers: { - "Content-type": "application/json" - }, - body: JSON.stringify(folderDetails) - }); - - let createFolderStep: BatchRequestStep = { - id: "2", - request: createFolder, - dependsOn: ["1"] - }; - - let mailsRequest = new Request("/me/messages", { - method: "GET" - }); - - let mailsRequestStep: BatchRequestStep = { - id: "3", - request: mailsRequest, - dependsOn: ["2"] - }; - - //Create instance by passing a batch request step - let batchRequestContent = new MicrosoftGraph.BatchRequestContent(); - - // Dynamically adding requests to the batch content - let fileDownloadId = batchRequestContent.addRequest(oneDriveFileStep); - - let createFolderId = batchRequestContent.addRequest(createFolderStep); - - let mailsId = batchRequestContent.addRequest(mailsRequestStep); - - // Dynamically removing unnecessary dependencies - // NOTE: Passing second param empty removes all the dependencies for that request - batchRequestContent.removeDependency("3", "2"); - - // Dynamically removing unnecessary request. Removing a request automatically removes the dependencies in relevant dependents - // Here download file dependency is removed from the onedrive create folder request - batchRequestContent.removeRequest(fileDownloadId); - - // Now no requests depends on anything so the request will be made parallel in the service end - // Extracting content from the instance - let content = await batchRequestContent.getContent(); - - //Making call to $batch end point with the extracted content - let response = await client.api("/$batch").post(content); - - //Create instance with response from the batch request - let batchResponse = new MicrosoftGraph.BatchResponseContent(response); - - //Getting iterator and looping through the responses iterator - let iterator = batchResponse.getResponsesIterator(); - let data = iterator.next(); - while (!data.done) { - console.log(data.value[0] + ":" + data.value[1]); - data = iterator.next(); - } - } catch (error) { - console.error(error); - } + try { + let fileName = "test.pdf"; + let oneDriveFileRequest = new Request(`/me/drive/root:/${fileName}:/content`, { + method: "GET", + }); + + let oneDriveFileStep: BatchRequestStep = { + id: "1", + request: oneDriveFileRequest, + }; + + let folderDetails = { + name: "Testing Batch", + folder: {}, + }; + let createFolder = new Request("/me/drive/root/children", { + method: "POST", + headers: { + "Content-type": "application/json", + }, + body: JSON.stringify(folderDetails), + }); + + let createFolderStep: BatchRequestStep = { + id: "2", + request: createFolder, + dependsOn: ["1"], + }; + + let mailsRequest = new Request("/me/messages", { + method: "GET", + }); + + let mailsRequestStep: BatchRequestStep = { + id: "3", + request: mailsRequest, + dependsOn: ["2"], + }; + + //Create instance by passing a batch request step + let batchRequestContent = new MicrosoftGraph.BatchRequestContent(); + + // Dynamically adding requests to the batch content + let fileDownloadId = batchRequestContent.addRequest(oneDriveFileStep); + + let createFolderId = batchRequestContent.addRequest(createFolderStep); + + let mailsId = batchRequestContent.addRequest(mailsRequestStep); + + // Dynamically removing unnecessary dependencies + // NOTE: Passing second param empty removes all the dependencies for that request + batchRequestContent.removeDependency("3", "2"); + + // Dynamically removing unnecessary request. Removing a request automatically removes the dependencies in relevant dependents + // Here download file dependency is removed from the onedrive create folder request + batchRequestContent.removeRequest(fileDownloadId); + + // Now no requests depends on anything so the request will be made parallel in the service end + // Extracting content from the instance + let content = await batchRequestContent.getContent(); + + //Making call to $batch end point with the extracted content + let response = await client.api("/$batch").post(content); + + //Create instance with response from the batch request + let batchResponse = new MicrosoftGraph.BatchResponseContent(response); + + //Getting iterator and looping through the responses iterator + let iterator = batchResponse.getResponsesIterator(); + let data = iterator.next(); + while (!data.done) { + console.log(data.value[0] + ":" + data.value[1]); + data = iterator.next(); + } + } catch (error) { + console.error(error); + } }; ``` @@ -155,69 +154,69 @@ const parallelBatching = async function() { ```typescript // elem here is the input HTML element of type file -const sameBatching = async function (elem) { - try { - let file1 = elem.files[0]; - let file2 = elem.files[1]; - - let folderDetails = { - "name": "MyFiles", - "folder": {} - }; - let createFolder = new Request("/me/drive/root/children", { - method: "POST", - headers: { - "Content-type": "application/json" - }, - body: JSON.stringify(folderDetails) - }); - - let createFolderStep: BatchRequestStep = { - id: "1", - request: createFolder - }; - - let uploadFileRequest1 = new Request(`/me/drive/root:/MyFiles/${file1.name}:/content`, { - method: "PUT", - headers: { - "Content-type": file1.type - }, - body: file1 - }); - - let uploadFileStep1: BatchRequestStep = { - id: "2", - request: uploadFileRequest1, - dependsOn: ["1"] - }; - - let uploadFileRequest2 = new Request(`/me/drive/root:/MyFiles/${file2.name}:/content`, { - method: "PUT", - headers: { - "Content-type": file2.type - }, - body: file2 - }); - - let uploadFileStep2: BatchRequestStep = { - id: "3", - request: uploadFileRequest2, - dependsOn: ["1"] - }; - - let batchRequestContent = new MicrosoftGraph.BatchRequestContent([createFolderStep, uploadFileStep1, uploadFileStep2]); - - let content = await batchRequestContent.getContent(); - - let response = await client.api("/$batch").post(content); - let batchResponseContent = new MicrosoftGraph.BatchResponseContent(response); - console.log(batchResponseContent.getResponses()); - } catch (error) { - console.error(error); - } +const sameBatching = async function(elem) { + try { + let file1 = elem.files[0]; + let file2 = elem.files[1]; + + let folderDetails = { + name: "MyFiles", + folder: {}, + }; + let createFolder = new Request("/me/drive/root/children", { + method: "POST", + headers: { + "Content-type": "application/json", + }, + body: JSON.stringify(folderDetails), + }); + + let createFolderStep: BatchRequestStep = { + id: "1", + request: createFolder, + }; + + let uploadFileRequest1 = new Request(`/me/drive/root:/MyFiles/${file1.name}:/content`, { + method: "PUT", + headers: { + "Content-type": file1.type, + }, + body: file1, + }); + + let uploadFileStep1: BatchRequestStep = { + id: "2", + request: uploadFileRequest1, + dependsOn: ["1"], + }; + + let uploadFileRequest2 = new Request(`/me/drive/root:/MyFiles/${file2.name}:/content`, { + method: "PUT", + headers: { + "Content-type": file2.type, + }, + body: file2, + }); + + let uploadFileStep2: BatchRequestStep = { + id: "3", + request: uploadFileRequest2, + dependsOn: ["1"], + }; + + let batchRequestContent = new MicrosoftGraph.BatchRequestContent([createFolderStep, uploadFileStep1, uploadFileStep2]); + + let content = await batchRequestContent.getContent(); + + let response = await client.api("/$batch").post(content); + let batchResponseContent = new MicrosoftGraph.BatchResponseContent(response); + console.log(batchResponseContent.getResponses()); + } catch (error) { + console.error(error); + } }; ``` ## Constraints -Refer, [JSON Batching](https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching), [Known Issues](https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching) documents for current constraints in the batching \ No newline at end of file +Refer, [JSON Batching](https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching), [Known Issues](https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching) documents for current constraints in the batching diff --git a/docs/tasks/LargeFileUploadTask.md b/docs/tasks/LargeFileUploadTask.md index 85682a253..a15e93670 100644 --- a/docs/tasks/LargeFileUploadTask.md +++ b/docs/tasks/LargeFileUploadTask.md @@ -18,12 +18,12 @@ Get files from the input element and start uploading. ```typescript async function fileUpload(elem) { - let file = elem.files[0]; - try { - let response = await largeFilUpload(client, file, file.name); - } catch (error) { - console.error(error); - } + let file = elem.files[0]; + try { + let response = await largeFilUpload(client, file, file.name); + } catch (error) { + console.error(error); + } } ``` @@ -51,19 +51,19 @@ function uploadFile() { ```typescript async function uploadFile(client, file) { - try { - let options = { - path: "/Documents", - fileName: file.name, - rangeSize: (1024 * 1024) - }; - const uploadTask = await MicrosoftGraph.OneDriveLargeFileUploadTask.create(client, file, options); - const response = await uploadTask.upload(); - console.log(response); - console.log("File Uploaded Successfully.!!"); - } catch (err) { - console.log(err); - } + try { + let options = { + path: "/Documents", + fileName: file.name, + rangeSize: 1024 * 1024, + }; + const uploadTask = await MicrosoftGraph.OneDriveLargeFileUploadTask.create(client, file, options); + const response = await uploadTask.upload(); + console.log(response); + console.log("File Uploaded Successfully.!!"); + } catch (err) { + console.log(err); + } } ``` @@ -83,4 +83,4 @@ _You can create the upload task, and play with it by using **sliceFile** and **u let range = uploadTask.getNextRange(); let slicedFile = uploadTask.sliceFile(range); uploadTask.uploadSlice(slicedFile, range, uploadTask.file.size); -``` \ No newline at end of file +``` diff --git a/docs/tasks/PageIterator.md b/docs/tasks/PageIterator.md index b7c41a01d..b0e3800e7 100644 --- a/docs/tasks/PageIterator.md +++ b/docs/tasks/PageIterator.md @@ -6,21 +6,21 @@ For a variety of reasons, collections of entities are often split into pages and ```typescript async function callingPattern() { - try { - // Makes request to fetch mails list. Which is expected to have multiple pages of data. - let response: PageCollection = await client.api("/me/messages").get(); - // A callback function to be called for every item in the collection. This call back should return boolean indicating whether not to continue the iteration process. - let callback: PageIteratorCallback = (data) => { - console.log(data); - return true; - }; - // Creating a new page iterator instance with client a graph client instance, page collection response from request and callback - let pageIterator = new PageIterator(client, response, callback); - // This iterates the collection until the nextLink is drained out. - pageIterator.iterate(); - } catch (e) { - throw e; - } + try { + // Makes request to fetch mails list. Which is expected to have multiple pages of data. + let response: PageCollection = await client.api("/me/messages").get(); + // A callback function to be called for every item in the collection. This call back should return boolean indicating whether not to continue the iteration process. + let callback: PageIteratorCallback = (data) => { + console.log(data); + return true; + }; + // Creating a new page iterator instance with client a graph client instance, page collection response from request and callback + let pageIterator = new PageIterator(client, response, callback); + // This iterates the collection until the nextLink is drained out. + pageIterator.iterate(); + } catch (e) { + throw e; + } } ``` @@ -29,28 +29,28 @@ async function callingPattern() { ```typescript // Populating custom size pages if the api restricts to some maximum size. Lazy loading more data on user prompt or something, stop and resume will do the trick. async function customSize() { - try { - let response: PageCollection = await client.api("/me/messages").get(); - let size = 1000; - let count = 0; - let callback: PageIteratorCallback = (data) => { - console.log(data); - count++; - if (count === size) { - count = 0; - return false; - } - return true; - }; - let pageIterator = new PageIterator(client, response, callback); - // This stops iterating over for 1000 entities. - pageIterator.iterate(); + try { + let response: PageCollection = await client.api("/me/messages").get(); + let size = 1000; + let count = 0; + let callback: PageIteratorCallback = (data) => { + console.log(data); + count++; + if (count === size) { + count = 0; + return false; + } + return true; + }; + let pageIterator = new PageIterator(client, response, callback); + // This stops iterating over for 1000 entities. + pageIterator.iterate(); - // Resuming will do start from where it left off and iterate for next 1000 entities. - // Resume is likely to be called in any user interaction requiring to load more data. - pageIterator.resume(); - } catch (e) { - throw e; - } + // Resuming will do start from where it left off and iterate for next 1000 entities. + // Resume is likely to be called in any user interaction requiring to load more data. + pageIterator.resume(); + } catch (e) { + throw e; + } } ``` diff --git a/package-lock.json b/package-lock.json index c29ef52e9..395deea8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,2286 +1,2909 @@ { - "name": "@microsoft/microsoft-graph-client", - "version": "1.4.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/isomorphic-fetch": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz", - "integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY=", - "dev": true - }, - "@types/mocha": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", - "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", - "dev": true - }, - "@types/node": { - "version": "10.12.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.19.tgz", - "integrity": "sha512-2NVovndCjJQj6fUUn9jCgpP4WSqr+u1SoUZMZyJkhGeBFsm6dE46l31S7lPUYt9uQ28XI+ibrJA1f5XyH5HNtA==", - "dev": true - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", - "dev": true - }, - "acorn": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.6.tgz", - "integrity": "sha512-5M3G/A4uBSMIlfJ+h9W125vJvPFH/zirISsW5qfxF5YzEvXJCtolLoQvM5yZft0DvMcUrPGKPOlgEu55I6iUtA==", - "dev": true - }, - "acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", - "dev": true - }, - "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - } - }, - "acorn-node": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.2.tgz", - "integrity": "sha512-rIhNEZuNI8ibQcL7ANm/mGyPukIaZsRNX9psFNQURyJW0nu6k8wjSDld20z6v2mDBWqX13pIEnk9gGZJHIlEXg==", - "dev": true, - "requires": { - "acorn": "^6.0.2", - "acorn-dynamic-import": "^4.0.0", - "acorn-walk": "^6.1.0", - "xtend": "^4.0.1" - } - }, - "acorn-walk": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", - "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", - "dev": true - }, - "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, - "array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", - "dev": true, - "requires": { - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "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-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "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 - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-pack": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", - "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "combine-source-map": "~0.8.0", - "defined": "^1.0.0", - "safe-buffer": "^5.1.1", - "through2": "^2.0.0", - "umd": "^3.0.0" - } - }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true - }, - "browser-resolve": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", - "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", - "dev": true, - "requires": { - "resolve": "1.1.7" - }, - "dependencies": { - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - } - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "browserify": { - "version": "16.2.3", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", - "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^1.11.0", - "browserify-zlib": "~0.2.0", - "buffer": "^5.0.2", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.0", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^2.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.0.0", - "labeled-stream-splicer": "^2.0.0", - "mkdirp": "^0.5.0", - "module-deps": "^6.0.0", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "~0.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^2.0.0", - "stream-http": "^2.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.10.1", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "cached-path-relative": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", - "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "requires": { - "convert-source-map": "~1.1.0", - "inline-source-map": "~0.6.0", - "lodash.memoize": "~3.0.3", - "source-map": "~0.5.3" - } - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "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 - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "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" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "content-type-parser": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", - "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", - "dev": true - }, - "convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, - "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=", - "dev": true - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "cssom": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", - "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", - "dev": true - }, - "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "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 - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "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 - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "deps-sort": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "shasum": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - } - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "detective": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", - "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", - "dev": true, - "requires": { - "acorn-node": "^1.6.1", - "defined": "^1.0.0", - "minimist": "^1.1.1" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "~0.4.13" - } - }, - "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" - }, - "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.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "events": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", - "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "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 - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "dev": true - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, - "htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "requires": { - "source-map": "~0.5.3" - } - }, - "insert-module-globals": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", - "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - } - }, - "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-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isomorphic-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", - "requires": { - "node-fetch": "^1.0.1", - "whatwg-fetch": ">=0.10.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdom": { - "version": "11.6.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", - "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", - "dev": true, - "requires": { - "abab": "^1.0.4", - "acorn": "^5.3.0", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "browser-process-hrtime": "^0.1.2", - "content-type-parser": "^1.0.2", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": ">= 0.2.37 < 0.3.0", - "domexception": "^1.0.0", - "escodegen": "^1.9.0", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.2.0", - "nwmatcher": "^1.4.3", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.83.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.3", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-url": "^6.4.0", - "ws": "^4.0.0", - "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - } - } - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", - "dev": true, - "requires": { - "jsonify": "~0.0.0" - } - }, - "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 - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "labeled-stream-splicer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", - "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "isarray": "^2.0.4", - "stream-splicer": "^2.0.0" - }, - "dependencies": { - "isarray": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", - "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", - "dev": true - } - } - }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", - "dev": 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" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, - "lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", - "dev": true - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "dev": true, - "requires": { - "mime-db": "~1.37.0" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "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.7" - } - }, - "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": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "module-deps": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.0.tgz", - "integrity": "sha512-hKPmO06so6bL/ZvqVNVqdTVO8UAYsi3tQWlCa+z9KuWhoN4KDQtb5hcqQQv58qYiDE21wIvnttZEPiDgEbpwbA==", - "dev": true, - "requires": { - "JSONStream": "^1.0.3", - "browser-resolve": "^1.7.0", - "cached-path-relative": "^1.0.0", - "concat-stream": "~1.6.0", - "defined": "^1.0.0", - "detective": "^5.0.2", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "msal": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/msal/-/msal-0.2.4.tgz", - "integrity": "sha512-/DPtEBL8M4gwSjEYZy4ep+j1ZaawA9XEKJi4nPxmQLT85rLNZLARrxhIRwzwXtkPNewoB+zdoNKzETW8ZrTOFQ==", - "dev": true, - "requires": { - "tslib": "1.7.1" - }, - "dependencies": { - "tslib": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", - "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=", - "dev": true - } - } - }, - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, - "nwmatcher": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", - "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "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" - } - }, - "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.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "pako": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", - "integrity": "sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==", - "dev": true - }, - "parents": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", - "dev": true, - "requires": { - "path-platform": "~0.11.15" - } - }, - "parse-asn1": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.3.tgz", - "integrity": "sha512-VrPoetlz7B/FqjBLD2f5wBVZvsZVLnRUrxVLfRYhGXCODa/NWE4p3Wp+6+aV3ZPL3KM7/OZmxDIwwijD7yuucg==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "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-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-platform": { - "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", - "dev": true - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "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": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "read-only-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", - "dev": true, - "requires": { - "readable-stream": "^2.0.2" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - } - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "dev": true, - "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "dev": true, - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shasum": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", - "dev": true, - "requires": { - "json-stable-stringify": "~0.0.0", - "sha.js": "~2.4.4" - } - }, - "shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", - "dev": true, - "requires": { - "array-filter": "~0.0.0", - "array-map": "~0.0.0", - "array-reduce": "~0.0.0", - "jsonify": "~0.0.0" - } - }, - "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", - "dev": true, - "requires": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-splicer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", - "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - } - }, - "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "subarg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", - "dev": true, - "requires": { - "minimist": "^1.1.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", - "dev": true - }, - "syntax-error": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", - "dev": true, - "requires": { - "acorn-node": "^1.2.0" - } - }, - "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.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", - "dev": true, - "requires": { - "process": "~0.11.0" - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" - }, - "tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "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": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "typescript": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz", - "integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==", - "dev": true - }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "~2.13.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "umd": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "dev": true - }, - "undeclared-identifiers": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", - "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", - "dev": true, - "requires": { - "acorn-node": "^1.3.0", - "get-assigned-identifiers": "^1.2.0", - "simple-concat": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vm-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", - "dev": true - }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "dev": true, - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" - }, - "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "window": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/window/-/window-4.2.5.tgz", - "integrity": "sha512-6srbDxYdfnxsw5ZwsggHLsgkuPpFb+3ja78FZSek7buVn/s19AlCMhb/WMO6hyJ8TP498kqELcRSpWg6hTpVDQ==", - "dev": true, - "requires": { - "jsdom": "11.6.2" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0" - } - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - } - } + "name": "@microsoft/microsoft-graph-client", + "version": "1.4.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/isomorphic-fetch": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz", + "integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY=", + "dev": true + }, + "@types/mocha": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "dev": true + }, + "@types/node": { + "version": "10.12.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.19.tgz", + "integrity": "sha512-2NVovndCjJQj6fUUn9jCgpP4WSqr+u1SoUZMZyJkhGeBFsm6dE46l31S7lPUYt9uQ28XI+ibrJA1f5XyH5HNtA==", + "dev": true + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "abab": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", + "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "dev": true + }, + "acorn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.6.tgz", + "integrity": "sha512-5M3G/A4uBSMIlfJ+h9W125vJvPFH/zirISsW5qfxF5YzEvXJCtolLoQvM5yZft0DvMcUrPGKPOlgEu55I6iUtA==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true + }, + "acorn-globals": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", + "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + } + }, + "acorn-node": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.2.tgz", + "integrity": "sha512-rIhNEZuNI8ibQcL7ANm/mGyPukIaZsRNX9psFNQURyJW0nu6k8wjSDld20z6v2mDBWqX13pIEnk9gGZJHIlEXg==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-dynamic-import": "^4.0.0", + "acorn-walk": "^6.1.0", + "xtend": "^4.0.1" + } + }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, + "ajv": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", + "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "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-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "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 + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + } + }, + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "dev": true + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserify": { + "version": "16.2.3", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", + "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "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 + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cached-path-relative": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", + "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", + "dev": true + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + } + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "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 + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "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" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "content-type-parser": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", + "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "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=", + "dev": true + }, + "cosmiconfig": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.7.tgz", + "integrity": "sha512-PcLqxTKiDmNT6pSpy4N6KtuPwb53W+2tzNvwOZw0WH9N6O0vLIBq0x8aj8Oj75ere4YcGi48bDFCL+3fRJdlNA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.9.0", + "parse-json": "^4.0.0" + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cssom": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", + "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", + "dev": true + }, + "cssstyle": { + "version": "0.2.37", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", + "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "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 + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "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 + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detective": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", + "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", + "dev": true, + "requires": { + "acorn-node": "^1.6.1", + "defined": "^1.0.0", + "minimist": "^1.1.1" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "elliptic": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es6-promise": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" + }, + "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.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "events": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", + "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "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": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "husky": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-1.3.1.tgz", + "integrity": "sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.7", + "execa": "^1.0.0", + "find-up": "^3.0.0", + "get-stdin": "^6.0.0", + "is-ci": "^2.0.0", + "pkg-dir": "^3.0.0", + "please-upgrade-node": "^3.1.1", + "read-pkg": "^4.0.1", + "run-node": "^1.0.0", + "slash": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "~0.5.3" + } + }, + "insert-module-globals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", + "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" + } + }, + "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": "3.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.0.0.tgz", + "integrity": "sha512-/93sDihsAD652hrMEbJGbMAVBf1qc96kyThHQ0CAOONHaE3aROLpTjDe4WQ5aoC5ITHFxEq1z8XqSU7km+8amw==", + "dev": true, + "requires": { + "builtin-modules": "^3.0.0" + }, + "dependencies": { + "builtin-modules": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", + "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", + "dev": true + } + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "requires": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", + "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdom": { + "version": "11.6.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", + "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", + "dev": true, + "requires": { + "abab": "^1.0.4", + "acorn": "^5.3.0", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "browser-process-hrtime": "^0.1.2", + "content-type-parser": "^1.0.2", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": ">= 0.2.37 < 0.3.0", + "domexception": "^1.0.0", + "escodegen": "^1.9.0", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.2.0", + "nwmatcher": "^1.4.3", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.83.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.3", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-url": "^6.4.0", + "ws": "^4.0.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + } + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "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 + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "labeled-stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", + "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" + }, + "dependencies": { + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", + "dev": true + } + } + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": 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" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "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.7" + } + }, + "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": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "module-deps": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.0.tgz", + "integrity": "sha512-hKPmO06so6bL/ZvqVNVqdTVO8UAYsi3tQWlCa+z9KuWhoN4KDQtb5hcqQQv58qYiDE21wIvnttZEPiDgEbpwbA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "msal": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/msal/-/msal-0.2.4.tgz", + "integrity": "sha512-/DPtEBL8M4gwSjEYZy4ep+j1ZaawA9XEKJi4nPxmQLT85rLNZLARrxhIRwzwXtkPNewoB+zdoNKzETW8ZrTOFQ==", + "dev": true, + "requires": { + "tslib": "1.7.1" + }, + "dependencies": { + "tslib": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", + "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=", + "dev": true + } + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-ZVuHxWJv1bopjv/SD5uPhgwUhLqxdJ+SsdUQbGR9HWlXrvnd/C08Cn9Bq48PbvX3y5V97GIpAHpL5Bk9BwChGg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^3.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nwmatcher": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", + "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "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" + } + }, + "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.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", + "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "pako": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", + "integrity": "sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "~0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.3.tgz", + "integrity": "sha512-VrPoetlz7B/FqjBLD2f5wBVZvsZVLnRUrxVLfRYhGXCODa/NWE4p3Wp+6+aV3ZPL3KM7/OZmxDIwwijD7yuucg==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "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-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "please-upgrade-node": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz", + "integrity": "sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "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 + }, + "prettier": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.2.tgz", + "integrity": "sha512-vBMdCn1LjrFi2CpBsiWVKOq+WP9poXDTIGPe2sG3eE33LQ3b6IUgmaMjLZKKY+frD/8FqPeEK1qAx9mOV8iruA==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "psl": { + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "read-pkg": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", + "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", + "dev": true, + "requires": { + "normalize-package-data": "^2.3.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz", + "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "^1.2.0" + } + }, + "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.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "~0.11.0" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, + "tslint": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.12.1.tgz", + "integrity": "sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.27.2" + } + }, + "tslint-config-prettier": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.17.0.tgz", + "integrity": "sha512-NKWNkThwqE4Snn4Cm6SZB7lV5RMDDFsBwz6fWUkTxOKGjMx8ycOHnjIbhn7dZd5XmssW3CwqUjlANR6EhP9YQw==", + "dev": true + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "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": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz", + "integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==", + "dev": true + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "dev": true, + "requires": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, + "undeclared-identifiers": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", + "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "window": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/window/-/window-4.2.5.tgz", + "integrity": "sha512-6srbDxYdfnxsw5ZwsggHLsgkuPpFb+3ja78FZSek7buVn/s19AlCMhb/WMO6hyJ8TP498kqELcRSpWg6hTpVDQ==", + "dev": true, + "requires": { + "jsdom": "11.6.2" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", + "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } } diff --git a/package.json b/package.json index e1f69da35..6c42f946a 100644 --- a/package.json +++ b/package.json @@ -1,47 +1,59 @@ { - "name": "@microsoft/microsoft-graph-client", - "//": "NOTE: The version here should match exactly the exported const PACKAGE_VERSION in Constants.ts. If you change it here, also change it there.", - "version": "1.4.0", - "description": "Microsoft Graph Client Library", - "main": "lib/src/index.js", - "typings": "lib/src/index", - "files": [ - "lib/" - ], - "types": "./lib/src/index.d.ts", - "dependencies": { - "es6-promise": "^4.2.5", - "isomorphic-fetch": "^2.2.1", - "tslib": "^1.9.3" - }, - "devDependencies": { - "@types/isomorphic-fetch": "0.0.34", - "@types/mocha": "^5.2.5", - "@types/node": "^10.12.10", - "browserify": "^16.2.3", - "chai": "^4.2.0", - "msal": "^0.2.4", - "mocha": "^5.2.0", - "typescript": "^3.1.6", - "uglify-es": "^3.3.9", - "window": "^4.2.5" - }, - "scripts": { - "compile": "tsc", - "web:js": "node browserify-with-dependencies.js > lib/graph-js-sdk-web.js && uglifyjs ./lib/graph-js-sdk-web.js --output ./lib/graph-js-sdk-web.js", - "core:js": "node browserify.js > lib/graph-js-sdk-core.js && uglifyjs ./lib/graph-js-sdk-core.js --output ./lib/graph-js-sdk-core.js", - "build": "npm run compile && npm run web:js && npm run core:js", - "test": "mocha lib/spec/content && mocha lib/spec/core && mocha lib/spec/middleware && mocha lib/spec/tasks", - "test:content": "tsc -p spec && mocha spec/content", - "test:core": "tsc -p spec && mocha spec/core", - "test:middleware": "tsc -p spec && mocha spec/middleware", - "test:tasks": "tsc -p spec && mocha spec/tasks", - "test:development": "tsc -p spec && mocha spec/development/workload", - "test:workload": "tsc -p spec && mocha spec/development/workload", - "prepack": "npm install && npm run build && npm run test" - }, - "repository": { - "type": "git", - "url": "https://github.com/microsoftgraph/msgraph-sdk-javascript.git" - } + "name": "@microsoft/microsoft-graph-client", + "//": "NOTE: The version here should match exactly the exported const PACKAGE_VERSION in Constants.ts. If you change it here, also change it there.", + "version": "1.4.0", + "description": "Microsoft Graph Client Library", + "main": "lib/src/index.js", + "typings": "lib/src/index", + "files": [ + "lib/" + ], + "types": "./lib/src/index.d.ts", + "dependencies": { + "es6-promise": "^4.2.5", + "isomorphic-fetch": "^2.2.1", + "tslib": "^1.9.3" + }, + "devDependencies": { + "@types/isomorphic-fetch": "0.0.34", + "@types/mocha": "^5.2.5", + "@types/node": "^10.12.10", + "browserify": "^16.2.3", + "chai": "^4.2.0", + "husky": "^1.3.1", + "mocha": "^5.2.0", + "msal": "^0.2.4", + "prettier": "^1.16.2", + "tslint": "^5.12.1", + "tslint-config-prettier": "^1.17.0", + "typescript": "^3.1.6", + "uglify-es": "^3.3.9", + "window": "^4.2.5" + }, + "scripts": { + "compile": "tsc", + "web:js": "node browserify-with-dependencies.js > lib/graph-js-sdk-web.js && uglifyjs ./lib/graph-js-sdk-web.js --output ./lib/graph-js-sdk-web.js", + "core:js": "node browserify.js > lib/graph-js-sdk-core.js && uglifyjs ./lib/graph-js-sdk-core.js --output ./lib/graph-js-sdk-core.js", + "build": "npm run compile && npm run web:js && npm run core:js", + "test": "mocha lib/spec/content && mocha lib/spec/core && mocha lib/spec/middleware && mocha lib/spec/tasks", + "test:content": "tsc -p spec && mocha spec/content", + "test:core": "tsc -p spec && mocha spec/core", + "test:middleware": "tsc -p spec && mocha spec/middleware", + "test:tasks": "tsc -p spec && mocha spec/tasks", + "test:development": "tsc -p spec && mocha spec/development/workload", + "test:workload": "tsc -p spec && mocha spec/development/workload", + "lint": "tslint --project ./tsconfig.json -c tslint.json", + "format:css": "prettier --write \"**/*.css\"", + "format:html": "prettier --write \"**/*.html\"", + "format:js": "prettier --write \"**/*.js\"", + "format:json": "prettier --write \"**/*.json\"", + "format:md": "prettier --write \"**/*.md\"", + "format:ts": "prettier --write \"**/*.ts\"", + "format": "npm run format:css && npm run format:html && npm run format:js && npm run format:json && npm run format:md && npm run format:ts", + "prepack": "npm install && npm run build && npm run test" + }, + "repository": { + "type": "git", + "url": "https://github.com/microsoftgraph/msgraph-sdk-javascript.git" + } } diff --git a/samples/browser/README.md b/samples/browser/README.md index 9f226d28d..3dfc5f470 100644 --- a/samples/browser/README.md +++ b/samples/browser/README.md @@ -22,4 +22,4 @@ Register the application as mentioned in the [Getting Started](../../README.md#1 8. Sign in with your account. -9. Click on the Options to view the result. \ No newline at end of file +9. Click on the Options to view the result. diff --git a/samples/browser/package-lock.json b/samples/browser/package-lock.json index f47257a30..9e78928d9 100644 --- a/samples/browser/package-lock.json +++ b/samples/browser/package-lock.json @@ -1,1215 +1,1215 @@ { - "name": "Browser-Sample", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "dev": true, - "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "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 - }, - "basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, - "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 - }, - "connect": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", - "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.0", - "parseurl": "~1.3.2", - "utils-merge": "1.0.1" - } - }, - "connect-history-api-fallback": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", - "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", - "dev": true - }, - "connect-injector": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/connect-injector/-/connect-injector-0.4.4.tgz", - "integrity": "sha1-qBlZwx7PXKoPPcwyXCjtkLgwqpA=", - "dev": true, - "requires": { - "debug": "^2.0.0", - "q": "^1.0.1", - "stream-buffers": "^0.2.3", - "uberproto": "^1.1.0" - } - }, - "copyfiles": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.1.0.tgz", - "integrity": "sha512-cAeDE0vL/koE9WSEGxqPpSyvU638Kgfu6wfrnj7kqp9FWa1CWsU54Coo6sdYZP4GstWa39tL/wIVJWfXcujgNA==", - "dev": true, - "requires": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^0.5.1", - "noms": "0.0.0", - "through2": "^2.0.1", - "yargs": "^11.0.0" - } - }, - "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=", - "dev": true - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "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 - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "detect-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", - "dev": true - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, - "eventemitter3": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", - "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", - "dev": true - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.1", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.3.1", - "unpipe": "~1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "follow-redirects": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz", - "integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==", - "dev": true, - "requires": { - "debug": "=3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "dev": true, - "requires": { - "globule": "^1.0.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "globule": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", - "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", - "dev": true, - "requires": { - "glob": "~7.1.1", - "lodash": "~4.17.10", - "minimatch": "~3.0.2" - } - }, - "handle-thing": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", - "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", - "dev": true - }, - "hpack.js": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", - "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "obuf": "^1.0.0", - "readable-stream": "^2.0.1", - "wbuf": "^1.1.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "http-deceiver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", - "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", - "dev": true - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - }, - "dependencies": { - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - } - } - }, - "http-proxy": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", - "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", - "dev": true, - "requires": { - "eventemitter3": "^3.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "light-server": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/light-server/-/light-server-2.6.0.tgz", - "integrity": "sha512-nJ4cEM1PmIA/p2apcpqx6ICkh7UYCtjg6/HJ6+1xqTdFuV0iIKUQs/I7oa1mtyYidvBqwz+0g7odvnzSOlaikQ==", - "dev": true, - "requires": { - "commander": "^2.19.0", - "connect": "^3.6.6", - "connect-history-api-fallback": "^1.5.0", - "connect-injector": "^0.4.4", - "gaze": "^1.1.3", - "http-proxy": "^1.17.0", - "morgan": "~1.9.1", - "opener": "^1.5.1", - "parseurl": "^1.3.2", - "serve-index": "^1.9.1", - "serve-static": "~1.13.2", - "spdy": "^3.4.7", - "strip-json-comments": "^2.0.1", - "ws": "^1.0.1" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", - "dev": true - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "dev": true, - "requires": { - "mime-db": "~1.37.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "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.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "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" - } - }, - "morgan": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", - "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", - "dev": true, - "requires": { - "basic-auth": "~2.0.0", - "debug": "2.6.9", - "depd": "~1.1.2", - "on-finished": "~2.3.0", - "on-headers": "~1.0.1" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", - "dev": true - }, - "noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "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 - }, - "obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", - "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" - } - }, - "opener": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", - "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", - "dev": true - }, - "options": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", - "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "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-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "select-hose": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", - "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", - "dev": true - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - }, - "dependencies": { - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true - } - } - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "dev": true, - "requires": { - "accepts": "~1.3.4", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "~1.0.3", - "http-errors": "~1.6.2", - "mime-types": "~2.1.17", - "parseurl": "~1.3.2" - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "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 - }, - "spdy": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-3.4.7.tgz", - "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", - "dev": true, - "requires": { - "debug": "^2.6.8", - "handle-thing": "^1.2.5", - "http-deceiver": "^1.2.7", - "safe-buffer": "^5.0.1", - "select-hose": "^2.0.0", - "spdy-transport": "^2.0.18" - } - }, - "spdy-transport": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-2.1.1.tgz", - "integrity": "sha512-q7D8c148escoB3Z7ySCASadkegMmUZW8Wb/Q1u0/XBgDKMO880rLQDj8Twiew/tYi7ghemKUi/whSYOwE17f5Q==", - "dev": true, - "requires": { - "debug": "^2.6.8", - "detect-node": "^2.0.3", - "hpack.js": "^2.1.6", - "obuf": "^1.1.1", - "readable-stream": "^2.2.9", - "safe-buffer": "^5.0.1", - "wbuf": "^1.7.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true - }, - "stream-buffers": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-0.2.6.tgz", - "integrity": "sha1-GBwI1bs2kARfaUAbmuanoM8zE/w=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "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 - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "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 - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "uberproto": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/uberproto/-/uberproto-1.2.0.tgz", - "integrity": "sha1-YdTqsCT5CcTm6lK+hnxIlKS+63Y=", - "dev": true - }, - "ultron": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", - "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "dev": true, - "requires": { - "minimalistic-assert": "^1.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "ws": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", - "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", - "dev": true, - "requires": { - "options": ">=0.0.5", - "ultron": "1.0.x" - } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yargs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } + "name": "Browser-Sample", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "dev": true, + "requires": { + "mime-types": "~2.1.18", + "negotiator": "0.6.1" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "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 + }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, + "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 + }, + "connect": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", + "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.0", + "parseurl": "~1.3.2", + "utils-merge": "1.0.1" + } + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", + "dev": true + }, + "connect-injector": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/connect-injector/-/connect-injector-0.4.4.tgz", + "integrity": "sha1-qBlZwx7PXKoPPcwyXCjtkLgwqpA=", + "dev": true, + "requires": { + "debug": "^2.0.0", + "q": "^1.0.1", + "stream-buffers": "^0.2.3", + "uberproto": "^1.1.0" + } + }, + "copyfiles": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.1.0.tgz", + "integrity": "sha512-cAeDE0vL/koE9WSEGxqPpSyvU638Kgfu6wfrnj7kqp9FWa1CWsU54Coo6sdYZP4GstWa39tL/wIVJWfXcujgNA==", + "dev": true, + "requires": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^0.5.1", + "noms": "0.0.0", + "through2": "^2.0.1", + "yargs": "^11.0.0" + } + }, + "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=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "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 + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-node": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", + "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", + "dev": true + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "dev": true + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "follow-redirects": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.1.tgz", + "integrity": "sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ==", + "dev": true, + "requires": { + "debug": "=3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globule": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", + "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", + "dev": true, + "requires": { + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" + } + }, + "handle-thing": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", + "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", + "dev": true + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", + "dev": true + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "dependencies": { + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + } + } + }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "dev": true, + "requires": { + "eventemitter3": "^3.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "light-server": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/light-server/-/light-server-2.6.0.tgz", + "integrity": "sha512-nJ4cEM1PmIA/p2apcpqx6ICkh7UYCtjg6/HJ6+1xqTdFuV0iIKUQs/I7oa1mtyYidvBqwz+0g7odvnzSOlaikQ==", + "dev": true, + "requires": { + "commander": "^2.19.0", + "connect": "^3.6.6", + "connect-history-api-fallback": "^1.5.0", + "connect-injector": "^0.4.4", + "gaze": "^1.1.3", + "http-proxy": "^1.17.0", + "morgan": "~1.9.1", + "opener": "^1.5.1", + "parseurl": "^1.3.2", + "serve-index": "^1.9.1", + "serve-static": "~1.13.2", + "spdy": "^3.4.7", + "strip-json-comments": "^2.0.1", + "ws": "^1.0.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "dev": true + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "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.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "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" + } + }, + "morgan": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", + "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", + "dev": true, + "requires": { + "basic-auth": "~2.0.0", + "debug": "2.6.9", + "depd": "~1.1.2", + "on-finished": "~2.3.0", + "on-headers": "~1.0.1" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "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 + }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "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" + } + }, + "opener": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", + "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", + "dev": true + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "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-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", + "dev": true + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + } + } + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "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 + }, + "spdy": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-3.4.7.tgz", + "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", + "dev": true, + "requires": { + "debug": "^2.6.8", + "handle-thing": "^1.2.5", + "http-deceiver": "^1.2.7", + "safe-buffer": "^5.0.1", + "select-hose": "^2.0.0", + "spdy-transport": "^2.0.18" + } + }, + "spdy-transport": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-2.1.1.tgz", + "integrity": "sha512-q7D8c148escoB3Z7ySCASadkegMmUZW8Wb/Q1u0/XBgDKMO880rLQDj8Twiew/tYi7ghemKUi/whSYOwE17f5Q==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "detect-node": "^2.0.3", + "hpack.js": "^2.1.6", + "obuf": "^1.1.1", + "readable-stream": "^2.2.9", + "safe-buffer": "^5.0.1", + "wbuf": "^1.7.2" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + }, + "stream-buffers": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-0.2.6.tgz", + "integrity": "sha1-GBwI1bs2kARfaUAbmuanoM8zE/w=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "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 + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "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 + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "uberproto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/uberproto/-/uberproto-1.2.0.tgz", + "integrity": "sha1-YdTqsCT5CcTm6lK+hnxIlKS+63Y=", + "dev": true + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "dev": true, + "requires": { + "options": ">=0.0.5", + "ultron": "1.0.x" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } } diff --git a/samples/browser/package.json b/samples/browser/package.json index 692fc1dc7..506f330ae 100644 --- a/samples/browser/package.json +++ b/samples/browser/package.json @@ -1,16 +1,16 @@ { - "name": "Browser-Sample", - "version": "1.0.0", - "description": "", - "main": "./src/main.js", - "scripts": { - "copy": "copyfiles -f ../../lib/graph-js-sdk-core.js ./src", - "start": "npm run copy && light-server --config .lightrc" - }, - "author": "", - "license": "ISC", - "devDependencies": { - "copyfiles": "^2.1.0", - "light-server": "^2.6.0" - } + "name": "Browser-Sample", + "version": "1.0.0", + "description": "", + "main": "./src/main.js", + "scripts": { + "copy": "copyfiles -f ../../lib/graph-js-sdk-core.js ./src", + "start": "npm run copy && light-server --config .lightrc" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "copyfiles": "^2.1.0", + "light-server": "^2.6.0" + } } diff --git a/samples/browser/src/index.html b/samples/browser/src/index.html index 154303fee..add345450 100644 --- a/samples/browser/src/index.html +++ b/samples/browser/src/index.html @@ -1,53 +1,50 @@ + + Sample For Browser + + + + + + + - - Sample For Browser - - - - - - - - - -
- profileImg - -
- -
-
-
-

- Hello - - ! -

-
-
-
-
- Get My Details + +
+ profileImg + +
+
-
- Get My Drive Files -
-
- Get My Mails +
+
+

+ Hello + + ! +

+
+
+
+
+ Get My Details +
+
+ Get My Drive Files +
+
+ Get My Mails +
+
+ Upload Large File To OneDrive + +
-
- Upload Large File To OneDrive - +
+
Result
+
-
-
Result
-
-
-
- - - - \ No newline at end of file + + diff --git a/samples/browser/src/main.css b/samples/browser/src/main.css index 1b8abde42..6615f7f26 100644 --- a/samples/browser/src/main.css +++ b/samples/browser/src/main.css @@ -1,72 +1,72 @@ .fileUploadParent { - position: relative; + position: relative; } .fileUpload { - position: absolute; - text-align: right; - opacity: 0; - z-index: 2; - top: 80px; - left: 80px; - width: 20px; + position: absolute; + text-align: right; + opacity: 0; + z-index: 2; + top: 80px; + left: 80px; + width: 20px; } .imageInput { - position: absolute; - top: 80px; - left: 80px; - z-index: 1; + position: absolute; + top: 80px; + left: 80px; + z-index: 1; } .main { - width: 100%; - float: left; + width: 100%; + float: left; } .grid { - text-align: center; - width: 13.99999%; - height: 250px; - min-width: 250px; - float: left; + text-align: center; + width: 13.99999%; + height: 250px; + min-width: 250px; + float: left; } .cell { - box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19) !important; - margin: 10px; - background-color: #f4f4f4; - width: 100px; - height: 100px; - float: left; - position: relative; - cursor: pointer; + box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19) !important; + margin: 10px; + background-color: #f4f4f4; + width: 100px; + height: 100px; + float: left; + position: relative; + cursor: pointer; } .cellText { - margin: 0; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - text-shadow: rgba(0, 0, 0, 0.19); + margin: 0; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + text-shadow: rgba(0, 0, 0, 0.19); } .outputParent { - float: left; - width: 79%; - height: 270px; - min-width: 250px; - margin: 10px; - border: grey; - float: right; - background: white; - box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19) !important; - overflow: scroll; + float: left; + width: 79%; + height: 270px; + min-width: 250px; + margin: 10px; + border: grey; + float: right; + background: white; + box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19) !important; + overflow: scroll; } .largeFileUpload { - width: 100px; - height: 100px; - opacity: 0; -} \ No newline at end of file + width: 100px; + height: 100px; + opacity: 0; +} diff --git a/samples/browser/src/main.js b/samples/browser/src/main.js index dd5d01353..7d0460543 100644 --- a/samples/browser/src/main.js +++ b/samples/browser/src/main.js @@ -1,70 +1,74 @@ -window.addEventListener('load', () => { - init(); -}, false); +window.addEventListener( + "load", + () => { + init(); + }, + false, +); const clientId = ""; let client, scopes; const init = async () => { + scopes = ["user.read", "profile", "User.ReadWrite", "User.Readwrite.All", "User.Invite.All", "contacts.read", "Notes.ReadWrite", "Notes.Read", "Notes.Create", "Files.Read", "Files.Read.All", "Files.ReadWrite", "Files.ReadWrite.All"]; - scopes = ["user.read", "profile", "User.ReadWrite", "User.Readwrite.All", "User.Invite.All", "contacts.read", "Notes.ReadWrite", "Notes.Read", "Notes.Create", "Files.Read", "Files.Read.All", "Files.ReadWrite", "Files.ReadWrite.All"]; + let msalProvider = new MicrosoftGraph.MSALAuthenticationProvider(clientId, scopes, { + redirectUri: "http://localhost:8080", + }); + client = new MicrosoftGraph.Client({ + debugLogging: true, + authProvider: msalProvider, + }); + bindEvents(); - let msalProvider = new MicrosoftGraph.MSALAuthenticationProvider(clientId, scopes, { - redirectUri: "http://localhost:8080" - }); - client = new MicrosoftGraph.Client({ - debugLogging: true, - authProvider: msalProvider - }); - - bindEvents(); - - let displayName = await request.getDisplayName(); - ui.setDisplayName(displayName); - - let profileImg = await request.getProfilePicture(); - ui.setProfilePicture(profileImg); + let displayName = await request.getDisplayName(); + ui.setDisplayName(displayName); + let profileImg = await request.getProfilePicture(); + ui.setProfilePicture(profileImg); }; const bindEvents = () => { - let requestsDOM = document.getElementById("requests"); - requestsDOM.addEventListener("click", (elem, event) => { - let id = elem.srcElement.getAttribute("cell"); - switch (id) { - case "1": - request.getUserDetails() - .then((res) => { - ui.updateOutput(res); - }) - .catch((error) => { - ui.updateOutput(error); - }); - break; + let requestsDOM = document.getElementById("requests"); + requestsDOM.addEventListener("click", (elem, event) => { + let id = elem.srcElement.getAttribute("cell"); + switch (id) { + case "1": + request + .getUserDetails() + .then((res) => { + ui.updateOutput(res); + }) + .catch((error) => { + ui.updateOutput(error); + }); + break; - case "2": - request.getMyDriveFiles() - .then((res) => { - ui.updateOutput(res); - }) - .catch((error) => { - ui.updateOutput(error); - }); - break; + case "2": + request + .getMyDriveFiles() + .then((res) => { + ui.updateOutput(res); + }) + .catch((error) => { + ui.updateOutput(error); + }); + break; - case "3": - request.getMyMails() - .then((res) => { - ui.updateOutput(res); - }) - .catch((error) => { - ui.updateOutput(error); - }); - break; + case "3": + request + .getMyMails() + .then((res) => { + ui.updateOutput(res); + }) + .catch((error) => { + ui.updateOutput(error); + }); + break; - case "4": - break; - } - }); -}; \ No newline at end of file + case "4": + break; + } + }); +}; diff --git a/samples/browser/src/request.js b/samples/browser/src/request.js index fb30c7a8c..2dd89c4f2 100644 --- a/samples/browser/src/request.js +++ b/samples/browser/src/request.js @@ -1,91 +1,102 @@ let request = { - getDisplayName: async () => { - try { - let response = await client.api("/me").select("displayName").get(); - return response.displayName; - } catch (error) { - console.error(error); - } - }, + getDisplayName: async () => { + try { + let response = await client + .api("/me") + .select("displayName") + .get(); + return response.displayName; + } catch (error) { + console.error(error); + } + }, - getProfilePicture: async () => { - try { - let response = await client.api("/me/photo/$value").responseType(MicrosoftGraph.ResponseType.BLOB).get(); - return response; - } catch (error) { - console.error(error); - } - }, + getProfilePicture: async () => { + try { + let response = await client + .api("/me/photo/$value") + .responseType(MicrosoftGraph.ResponseType.BLOB) + .get(); + return response; + } catch (error) { + console.error(error); + } + }, - updateProfilePicture: async () => { - let file = document.getElementById("uploadProfile").files[0], - reader = new FileReader(); + updateProfilePicture: async () => { + let file = document.getElementById("uploadProfile").files[0], + reader = new FileReader(); - reader.addEventListener("load", () => { - client - .api("/me/photo/$value") - .responseType(MicrosoftGraph.ResponseType.BLOB) - .put(file) - .then((res) => { - request.getProfilePicture() - .then((blob) => { - ui.setProfilePicture(blob); - }) - .catch((error) => { - console.error(error); - }); - }) - .catch((error) => { - console.error(error); - }); - }, false); + reader.addEventListener( + "load", + () => { + client + .api("/me/photo/$value") + .responseType(MicrosoftGraph.ResponseType.BLOB) + .put(file) + .then((res) => { + request + .getProfilePicture() + .then((blob) => { + ui.setProfilePicture(blob); + }) + .catch((error) => { + console.error(error); + }); + }) + .catch((error) => { + console.error(error); + }); + }, + false, + ); - if (file) { - reader.readAsDataURL(file); - } - }, + if (file) { + reader.readAsDataURL(file); + } + }, - getUserDetails: async () => { - try { - let res = await client.api("/me").get(); - return res; - } catch (error) { - throw (error); - } - }, + getUserDetails: async () => { + try { + let res = await client.api("/me").get(); + return res; + } catch (error) { + throw error; + } + }, - getMyDriveFiles: async () => { - try { - let res = await client.api("/me/drive/root/children").get(); - return res; - } catch (error) { - throw error; - } - }, + getMyDriveFiles: async () => { + try { + let res = await client.api("/me/drive/root/children").get(); + return res; + } catch (error) { + throw error; + } + }, - getMyMails: async () => { - try { - let res = await client.api("/me/messages").get(); - return res; - } catch (error) { - throw error; - } - }, + getMyMails: async () => { + try { + let res = await client.api("/me/messages").get(); + return res; + } catch (error) { + throw error; + } + }, - uploadLargeFile: async () => { - let file = document.getElementById("largeFileUpload").files[0]; - try { - let options = { - path: "/Documents", - fileName: file.name, - rangeSize: (5 * 1024 * 1024) - }; - const uploadTask = await MicrosoftGraph.OneDriveLargeFileUploadTask.create(client, file, options); - const response = await uploadTask.upload(); - ui.updateOutput(response); - return response; - } catch (error) { - throw error; - } - } -} \ No newline at end of file + uploadLargeFile: async () => { + let file = document.getElementById("largeFileUpload").files[0]; + try { + let options = { + path: "/Documents", + fileName: file.name, + rangeSize: 5 * 1024 * 1024, + }; + const uploadTask = await MicrosoftGraph.OneDriveLargeFileUploadTask.create(client, file, options); + const response = await uploadTask.upload(); + ui.updateOutput(response); + return response; + } catch (error) { + throw error; + } + }, +}; diff --git a/samples/browser/src/ui.js b/samples/browser/src/ui.js index 7d4376b3d..97c97a40e 100644 --- a/samples/browser/src/ui.js +++ b/samples/browser/src/ui.js @@ -1,13 +1,13 @@ let ui = { - setDisplayName: (name) => { - document.getElementById("displayName").innerHTML = name; - }, + setDisplayName: (name) => { + document.getElementById("displayName").innerHTML = name; + }, - setProfilePicture: (imgBlob) => { - document.getElementById("profileImg").setAttribute("src", URL.createObjectURL(imgBlob)); - }, + setProfilePicture: (imgBlob) => { + document.getElementById("profileImg").setAttribute("src", URL.createObjectURL(imgBlob)); + }, - updateOutput: (res) => { - document.getElementById("output").innerHTML = JSON.stringify(res); - } -}; \ No newline at end of file + updateOutput: (res) => { + document.getElementById("output").innerHTML = JSON.stringify(res); + }, +}; diff --git a/samples/node/README.md b/samples/node/README.md index fb71b8986..34ac9c84c 100644 --- a/samples/node/README.md +++ b/samples/node/README.md @@ -1,4 +1,4 @@ -# Node Sample Using Javascript Client Library +# Node Sample Using Javascript Client Library ## Update Access Token diff --git a/samples/node/main.js b/samples/node/main.js index 5c5dc6c0d..eddd2c1b9 100644 --- a/samples/node/main.js +++ b/samples/node/main.js @@ -12,23 +12,24 @@ const secrets = require("./secrets"); const fs = require("fs"); const client = MicrosoftGraph.Client.init({ - defaultVersion: 'v1.0', - debugLogging: true, - authProvider: (done) => { - done(null, secrets.accessToken); - } + defaultVersion: "v1.0", + debugLogging: true, + authProvider: (done) => { + done(null, secrets.accessToken); + }, }); // Get the name of the authenticated user with promises client - .api('/me') - .select("displayName") - .get() - .then((res) => { - console.log(res); - }).catch((err) => { - console.log(err); - }); + .api("/me") + .select("displayName") + .get() + .then((res) => { + console.log(res); + }) + .catch((err) => { + console.log(err); + }); /* diff --git a/samples/node/package-lock.json b/samples/node/package-lock.json index bceeff648..f5a72dd8f 100644 --- a/samples/node/package-lock.json +++ b/samples/node/package-lock.json @@ -1,57 +1,57 @@ { - "name": "Node-Sample", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "0.4.24" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": "2.1.2" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "isomorphic-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", - "requires": { - "node-fetch": "1.7.3", - "whatwg-fetch": "3.0.0" - } - }, - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "0.1.12", - "is-stream": "1.1.0" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" - } - } + "name": "Node-Sample", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "0.4.24" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": "2.1.2" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "3.0.0" + } + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" + } + } } diff --git a/samples/node/package.json b/samples/node/package.json index 7a3bd90d0..94a1baa9e 100644 --- a/samples/node/package.json +++ b/samples/node/package.json @@ -1,14 +1,14 @@ { - "name": "Node-Sample", - "version": "1.0.0", - "description": "You can get an access token by doing the following:", - "main": "main.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "isomorphic-fetch": "^2.2.1" - } + "name": "Node-Sample", + "version": "1.0.0", + "description": "You can get an access token by doing the following:", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "isomorphic-fetch": "^2.2.1" + } } diff --git a/samples/node/secrets.sample.json b/samples/node/secrets.sample.json index 587489b36..3dd6aa16c 100644 --- a/samples/node/secrets.sample.json +++ b/samples/node/secrets.sample.json @@ -1,3 +1,3 @@ { - "accessToken": "" + "accessToken": "" } diff --git a/spec/DummyAuthenticationProvider.ts b/spec/DummyAuthenticationProvider.ts index 4db654462..f751d37fe 100644 --- a/spec/DummyAuthenticationProvider.ts +++ b/spec/DummyAuthenticationProvider.ts @@ -17,15 +17,14 @@ import { AuthenticationProvider } from "../src/IAuthenticationProvider"; * Class representing DummyAuthenticationProvider */ export class DummyAuthenticationProvider implements AuthenticationProvider { - - /** - * @public - * @async - * To get the access token - * @returns The promise that resolves to an access token - */ - public async getAccessToken(): Promise { - const token = "DUMMY_TOKEN"; - return Promise.resolve(token); - } + /** + * @public + * @async + * To get the access token + * @returns The promise that resolves to an access token + */ + public async getAccessToken(): Promise { + const token = "DUMMY_TOKEN"; + return Promise.resolve(token); + } } diff --git a/spec/DummyHTTPMessageHandler.ts b/spec/DummyHTTPMessageHandler.ts index 3b61b5425..f07417a5f 100644 --- a/spec/DummyHTTPMessageHandler.ts +++ b/spec/DummyHTTPMessageHandler.ts @@ -18,15 +18,14 @@ import { Middleware } from "../src/middleware/IMiddleware"; * Class representing DummyHTTPMessageHandler */ export class DummyHTTPMessageHandler implements Middleware { - - /** - * @public - * @async - * To execute the current middleware - * @param {Context} context - The request context object - * @returns A promise that resolves to nothing - */ - public async execute(context: Context) { - return; - } -} \ No newline at end of file + /** + * @public + * @async + * To execute the current middleware + * @param {Context} context - The request context object + * @returns A promise that resolves to nothing + */ + public async execute(context: Context) { + return; + } +} diff --git a/spec/DummyHandlerOption.ts b/spec/DummyHandlerOption.ts index da951c4bb..7658aedf9 100644 --- a/spec/DummyHandlerOption.ts +++ b/spec/DummyHandlerOption.ts @@ -18,21 +18,20 @@ import { MiddlewareOption } from "../src/middleware/option/IMiddlewareOption"; */ export class DummyHandlerOption implements MiddlewareOption { + /** + * @public + * A member holding a dummy string + */ + public dummyString: string; - /** - * @public - * A member holding a dummy string - */ - public dummyString: string; - - /** - * @public - * @async - * To create an instance of DummyHandlerOption - * @param {string} dummyString - The dummy string - * @returns An instance of DummyHandlerOption - */ - public constructor(dummyString: string = "dummy") { - this.dummyString = dummyString; - } -} \ No newline at end of file + /** + * @public + * @async + * To create an instance of DummyHandlerOption + * @param {string} dummyString - The dummy string + * @returns An instance of DummyHandlerOption + */ + public constructor(dummyString: string = "dummy") { + this.dummyString = dummyString; + } +} diff --git a/spec/content/BatchRequestContent.ts b/spec/content/BatchRequestContent.ts index cd77c0f98..1dd138013 100644 --- a/spec/content/BatchRequestContent.ts +++ b/spec/content/BatchRequestContent.ts @@ -5,642 +5,646 @@ * ------------------------------------------------------------------------------------------- */ -import { BatchRequestContent, BatchRequestStep } from "../../src/content/BatchRequestContent"; import { assert } from "chai"; import * as fs from "fs"; import "isomorphic-fetch"; + +import { BatchRequestContent, BatchRequestStep } from "../../src/content/BatchRequestContent"; import { randomString } from "../test-helper"; -let folderName = randomString(); -let folderDetails = { - "name": folderName, - "folder": {} +const folderName = randomString(); +const folderDetails = { + name: folderName, + folder: {}, }; -let createFolderRequest = new Request("/me/drive/root/children", { - method: "POST", - headers: { - "Content-type": "application/json" - }, - body: JSON.stringify(folderDetails) +const createFolderRequest = new Request("/me/drive/root/children", { + method: "POST", + headers: { + "Content-type": "application/json", + }, + body: JSON.stringify(folderDetails), }); const getCreateFolderRequestCopy = () => { - return { - id: "1", - request: createFolderRequest - } + return { + id: "1", + request: createFolderRequest, + }; }; const getCreateFolderRequestWithDependsOnCopy = () => { - let data = { - id: "1", - request: createFolderRequest, - dependsOn: undefined - } - data.dependsOn = []; - return data; + const data = { + id: "1", + request: createFolderRequest, + dependsOn: undefined, + }; + data.dependsOn = []; + return data; }; -describe("BatchRequestContent.ts", function () { - describe('Create', function () { - this.timeout(20 * 1000); - it('Should Create BatchRequestContent instance with no requests', (done) => { - let batchReq = new BatchRequestContent(); - assert.equal(batchReq.constructor.name, "BatchRequestContent"); - done(); - }); - - it('Should create BatchRequestContent instance with empty array', (done) => { - let batchReq = new BatchRequestContent([]); - assert.equal(batchReq.constructor.name, "BatchRequestContent"); - done(); - }); - - it('Should create BatchRequestContent instance with requests', (done) => { - let createFolderDuplicate1 = getCreateFolderRequestCopy(); - let createFolderDuplicate2 = getCreateFolderRequestCopy(); - createFolderDuplicate2.id = "2"; - let batchReq = new BatchRequestContent([createFolderDuplicate1, createFolderDuplicate2]); - assert.equal(batchReq.requests.size, 2); - done(); - }); - - it('Should throw error for empty request id', (done) => { - let createFolderDuplicate1 = getCreateFolderRequestCopy(); - createFolderDuplicate1.id = ""; - try { - let batchReq = new BatchRequestContent([createFolderDuplicate1]); - throw new Error("Something wrong with the empty id check"); - } catch (error) { - assert.equal(error.name, "Empty Id For Request"); - } - done(); - }); - - it('Should return error incase of number of requests limit exceeding', (done) => { - let requests = []; - for (let i = 0; i < 25; i++) { - let req = getCreateFolderRequestCopy(); - req.id = "" + i; - requests.push(req); - } - try { - let batchReq = new BatchRequestContent(requests); - throw new Error('Something wrong with the limiting requests'); - } catch (error) { - assert.equal(error.name, "Limit Exceeded Error"); - done(); - } - }); - }); - - describe('addRequest', function () { - this.timeout(20 * 1000); - it('Should emit size exceed error', (done) => { - let requests = []; - for (let i = 0; i < 20; i++) { - let req = getCreateFolderRequestCopy(); - req.id = "" + i; - requests.push(req); - } - let req = getCreateFolderRequestCopy(); - req.id = "100"; - let batchReq = new BatchRequestContent(requests); - try { - batchReq.addRequest(req); - throw new Error("Something wrong with the limiting requests"); - } catch (error) { - assert.equal(error.name, "Limit Exceeded Error"); - done(); - } - }); - - it('Should add Request JSON to the BatchRequestContent instance', (done) => { - let req = getCreateFolderRequestCopy(); - req.id = "100"; - let batchReq = new BatchRequestContent(); - let id = batchReq.addRequest(req); - assert.equal(req.id, id); - done(); - }); - - it('Should throw duplicate id error', (done) => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req1]); - try { - batchReq.addRequest(req2); - throw new Error("Something wrong with duplicate id validation"); - } catch (error) { - assert.equal(error.name, "Duplicate RequestId Error"); - done(); - } - }); - - - it('Should throw duplicate id error', (done) => { - let req = getCreateFolderRequestCopy(); - req.id = ""; - let batchReq = new BatchRequestContent(); - try { - batchReq.addRequest(req); - throw new Error("Something wrong with empty id validation"); - } catch (error) { - assert.equal(error.name, "Empty Id For Request"); - done(); - } - }); - }); - - describe('removeRequest', function () { - it('Should delete the request present in the batch', (done) => { - let req = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req]); - assert.equal(true, batchReq.removeRequest(req.id)); - done(); - }); - - it('Should return false for the request that is not present in the batch', (done) => { - let req = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req]); - assert.equal(false, batchReq.removeRequest("1000")); - done(); - }); - - it('Should remove dependencies in case dependencies present', (done) => { - let req1 = getCreateFolderRequestCopy(), - req2 = getCreateFolderRequestCopy(), - req3 = getCreateFolderRequestCopy(), - req4 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - req3.id = "3"; - req4.id = "4"; - let batchReq = new BatchRequestContent([req1, req2, req3, req4]); - batchReq.addDependency("2", "1"); - batchReq.addDependency("3", "2"); - batchReq.addDependency("4", "1"); - batchReq.addDependency("4", "2"); - batchReq.addDependency("4", "3"); - batchReq.removeRequest("2"); - - assert.isUndefined(batchReq.requests.get("1").dependsOn); - assert.isUndefined(batchReq.requests.get("3").dependsOn); - assert.equal(batchReq.requests.get("4").dependsOn.length, 2); - done(); - }); - }); - - describe('addDependency', function () { - this.timeout(20 * 1000); - it('Should return error for request with dependent id not present', (done) => { - let req = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req]); - try { - batchReq.addDependency("1"); - throw new Error("Dependent validation is failing"); - } catch (err) { - assert.equal(err.name, "Invalid Dependency Addition"); - done(); - } - }); - - it('Should return error for the request with given dependency id is not present', (done) => { - let req = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req]); - try { - batchReq.addDependency("1", "100"); - throw new Error("Dependency validation is failing"); - } catch (err) { - assert.equal(err.name, "Invalid Dependency"); - done(); - } - }); - - it('Should add dependency for a given dependent', (done) => { - let req1 = getCreateFolderRequestCopy(), - req2 = getCreateFolderRequestCopy(), - req3 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - req3.id = "3"; - let batchReq = new BatchRequestContent([req1, req2, req3]); - batchReq.addDependency("2", "1"); - assert.isDefined(batchReq.requests.get("2").dependsOn); - batchReq.addDependency("2", "3"); - assert.equal(batchReq.requests.get("2").dependsOn.length, 2); - done(); - }); - - it('Should return error for adding duplicate dependency', (done) => { - let req1 = getCreateFolderRequestCopy(), - req2 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - batchReq.addDependency("2", "1"); - try { - batchReq.addDependency("2", "1"); - } catch (e) { - assert.equal(e.name, "Duplicate Dependency"); - done(); - } - }); - - it('Should add dependency for dependency id not given', (done) => { - let req1 = getCreateFolderRequestCopy(), - req2 = getCreateFolderRequestCopy(), - req3 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - req3.id = "3"; - let batchReq = new BatchRequestContent([req1, req2, req3]); - batchReq.addDependency("2"); - assert.isDefined(batchReq.requests.get("2").dependsOn); - batchReq.addDependency("3"); - assert.isDefined(batchReq.requests.get("3").dependsOn); - done(); - }); - - it('Should return error for adding duplicate dependency when dependency id not given', (done) => { - let req1 = getCreateFolderRequestCopy(), - req2 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - batchReq.addDependency("2"); - assert.isDefined(batchReq.requests.get("2").dependsOn); - try { - batchReq.addDependency("2"); - } catch (e) { - assert.equal(e.name, "Duplicate Dependency"); - done(); - } - }); - - it('Should return error for adding dependency when only one request is present and dependency id not given', (done) => { - let req1 = getCreateFolderRequestCopy(); - req1.id = "1"; - let batchReq = new BatchRequestContent([req1]); - try { - batchReq.addDependency("1"); - } catch (e) { - assert.equal(e.name, "Invalid Dependency Addition"); - done(); - } - }); - }); - - describe('getContent', function () { - it('Should return error for empty requests', async () => { - let batchReq = new BatchRequestContent(); - try { - let content = await batchReq.getContent(); - throw new Error("Something wrong with the empty requests validation"); - } catch (error) { - assert.equal(error.name, "Empty Payload"); - } - }); - - it('Should return json content', async () => { - let req = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req]); - try { - let content = await batchReq.getContent(); - assert.isDefined(content.requests[0].body); - assert.equal(typeof content.requests[0].body, "object"); - } catch (error) { - throw error; - } - }); - - it('Should return image\'s base64 string', async () => { - let fileName = "sample_image.jpg"; - fs.readFile(`./spec/sample_files/${fileName}`, {}, async (err, file) => { - if (err) { - throw err; - } - let uploadOneDriveFile = { - id: "1", - request: new Request(`/me/drive/root:/Documents/${fileName}:/content`, { - method: "PUT", - headers: { - "Content-type": "image/jpg" - }, - body: file - }) - }; - let batchReq = new BatchRequestContent([uploadOneDriveFile]); - try { - let content = await batchReq.getContent(); - assert.isDefined(content.requests[0].body); - } catch (error) { - throw error; - } - }); - }); - - it('Should throw error for request does not have content-type header if it does have a body', async () => { - let createFolderReqWithoutHeader = new Request("/me/drive/root/children", { - method: "POST", - body: JSON.stringify(folderDetails) - }); - - let batchReq = new BatchRequestContent([{ - id: "1", - request: createFolderReqWithoutHeader - }]); - try { - let content = await batchReq.getContent(); - throw new Error("Something wrong with the header checking"); - } catch (error) { - assert.equal(error.name, "Invalid Content-type header"); - } - }); - }); - - describe('removeDependency', function () { - this.timeout(20 * 1000); - - it('Should return false for dependent not present', (done) => { - let batchReq = new BatchRequestContent(); - assert.equal(false, batchReq.removeDependency("1")); - done(); - }); - - it('Should return false for dependency array not present in the request', (done) => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - assert.equal(false, batchReq.removeDependency("2")); - done(); - }); - - it('Should return false for given dependency id is not present in the dependent request', (done) => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - batchReq.addDependency("2"); - assert.equal(false, batchReq.removeDependency("2", "5")); - done(); - }); - - it('Should delete the given dependency and dependent', (done) => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - batchReq.addDependency("2"); - assert.equal(true, batchReq.removeDependency("2", "1")); - done(); - }); - - it('Should delete all dependencies for a given dependent', (done) => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestCopy(); - let req3 = getCreateFolderRequestCopy(); - req1.id = "1"; - req2.id = "2"; - req3.id = "3"; - let batchReq = new BatchRequestContent([req1, req2, req3]); - batchReq.addDependency("3", "1"); - batchReq.addDependency("3", "2"); - assert.equal(true, batchReq.removeDependency("3")); - done(); - }); - }); - - describe('validateDependencies', function () { - it('Should throw error for empty request object', (done) => { - try { - BatchRequestContent["validateDependencies"](>new Map()); - throw new Error("Something wrong with the empty requests check"); - } catch (error) { - assert.equal(error.name, "Empty Requests Error"); - done(); - } - }); - - it('isParallel - Should validate for single request', () => { - let req = getCreateFolderRequestCopy(); - let batchReq = new BatchRequestContent([req]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isParallel - Should validate for multiple requests', () => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestCopy(); - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isParallel - Should validate for requests with undefined dependsOn', () => { - let req1 = getCreateFolderRequestCopy(); - req1.id = "1"; - let req2 = getCreateFolderRequestCopy(); - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isParallel - Should validate for requests with empty dependsOn array', () => { - let req1 = getCreateFolderRequestCopy(); - req1.id = "1"; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - let batchReq = new BatchRequestContent([req1, req2]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should not validate for first request having dependsOn', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = ["2"]; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should validate for first request with undefined dependsOn', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = undefined; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let batchReq = new BatchRequestContent([req1, req2]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should validate for first request with empty dependsOn array', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let batchReq = new BatchRequestContent([req1, req2]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should not validate for a request does not depend on anything', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should not validate for a request does not depend on previous request', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["4"]; - let req4 = getCreateFolderRequestWithDependsOnCopy(); - req4.id = "4"; - let batchReq = new BatchRequestContent([req1, req2, req3, req4]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should not validate for requests having more than one dependencies', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["2"]; - let req4 = getCreateFolderRequestWithDependsOnCopy(); - req4.id = "4"; - req4.dependsOn = ["2", "3"]; - let batchReq = new BatchRequestContent([req1, req2, req3, req4]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSerial - Should validate for proper serial dependencies', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["2"]; - let req4 = getCreateFolderRequestWithDependsOnCopy(); - req4.id = "4"; - req4.dependsOn = ["3"]; - let batchReq = new BatchRequestContent([req1, req2, req3, req4]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should validate for first request with undefined dependsOn', () => { - let req1 = getCreateFolderRequestCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["1"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should validate for first request with empty dependsOn array', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.id = "1"; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["1"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should not validate for first request having dependency on itself', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = ["1"]; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["1"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["1"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should not validate for first request having dependency on non existing request', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = ["10"]; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["10"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["10"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should validate for requests dependsOn some middle order request', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = ["2"]; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["2"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should not validate for middle order request with empty dependsOn', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["1"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should not validate for middle order request dependency request has its own dependency', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = ["2"]; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - req2.dependsOn = ["2"]; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["2"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - - it('isSame - Should not validate for middle order request does depend on some other request other than dependency request', () => { - let req1 = getCreateFolderRequestWithDependsOnCopy(); - req1.dependsOn = ["2"]; - let req2 = getCreateFolderRequestWithDependsOnCopy(); - req2.id = "2"; - let req3 = getCreateFolderRequestWithDependsOnCopy(); - req3.id = "3"; - req3.dependsOn = ["3"]; - let batchReq = new BatchRequestContent([req1, req2, req3]); - assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); - }); - }); +describe("BatchRequestContent.ts", () => { + describe("Create", function() { + this.timeout(20 * 1000); + it("Should Create BatchRequestContent instance with no requests", (done) => { + const batchReq = new BatchRequestContent(); + assert.equal(batchReq.constructor.name, "BatchRequestContent"); + done(); + }); + + it("Should create BatchRequestContent instance with empty array", (done) => { + const batchReq = new BatchRequestContent([]); + assert.equal(batchReq.constructor.name, "BatchRequestContent"); + done(); + }); + + it("Should create BatchRequestContent instance with requests", (done) => { + const createFolderDuplicate1 = getCreateFolderRequestCopy(); + const createFolderDuplicate2 = getCreateFolderRequestCopy(); + createFolderDuplicate2.id = "2"; + const batchReq = new BatchRequestContent([createFolderDuplicate1, createFolderDuplicate2]); + assert.equal(batchReq.requests.size, 2); + done(); + }); + + it("Should throw error for empty request id", (done) => { + const createFolderDuplicate1 = getCreateFolderRequestCopy(); + createFolderDuplicate1.id = ""; + try { + const batchReq = new BatchRequestContent([createFolderDuplicate1]); + throw new Error("Something wrong with the empty id check"); + } catch (error) { + assert.equal(error.name, "Empty Id For Request"); + } + done(); + }); + + it("Should return error incase of number of requests limit exceeding", (done) => { + const requests = []; + for (let i = 0; i < 25; i++) { + const req = getCreateFolderRequestCopy(); + req.id = "" + i; + requests.push(req); + } + try { + const batchReq = new BatchRequestContent(requests); + throw new Error("Something wrong with the limiting requests"); + } catch (error) { + assert.equal(error.name, "Limit Exceeded Error"); + done(); + } + }); + }); + + describe("addRequest", function() { + this.timeout(20 * 1000); + it("Should emit size exceed error", (done) => { + const requests = []; + for (let i = 0; i < 20; i++) { + const r = getCreateFolderRequestCopy(); + r.id = "" + i; + requests.push(r); + } + const req = getCreateFolderRequestCopy(); + req.id = "100"; + const batchReq = new BatchRequestContent(requests); + try { + batchReq.addRequest(req); + throw new Error("Something wrong with the limiting requests"); + } catch (error) { + assert.equal(error.name, "Limit Exceeded Error"); + done(); + } + }); + + it("Should add Request JSON to the BatchRequestContent instance", (done) => { + const req = getCreateFolderRequestCopy(); + req.id = "100"; + const batchReq = new BatchRequestContent(); + const id = batchReq.addRequest(req); + assert.equal(req.id, id); + done(); + }); + + it("Should throw duplicate id error", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req1]); + try { + batchReq.addRequest(req2); + throw new Error("Something wrong with duplicate id validation"); + } catch (error) { + assert.equal(error.name, "Duplicate RequestId Error"); + done(); + } + }); + + it("Should throw duplicate id error", (done) => { + const req = getCreateFolderRequestCopy(); + req.id = ""; + const batchReq = new BatchRequestContent(); + try { + batchReq.addRequest(req); + throw new Error("Something wrong with empty id validation"); + } catch (error) { + assert.equal(error.name, "Empty Id For Request"); + done(); + } + }); + }); + + describe("removeRequest", () => { + it("Should delete the request present in the batch", (done) => { + const req = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req]); + assert.equal(true, batchReq.removeRequest(req.id)); + done(); + }); + + it("Should return false for the request that is not present in the batch", (done) => { + const req = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req]); + assert.equal(false, batchReq.removeRequest("1000")); + done(); + }); + + it("Should remove dependencies in case dependencies present", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + const req3 = getCreateFolderRequestCopy(); + const req4 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + req3.id = "3"; + req4.id = "4"; + const batchReq = new BatchRequestContent([req1, req2, req3, req4]); + batchReq.addDependency("2", "1"); + batchReq.addDependency("3", "2"); + batchReq.addDependency("4", "1"); + batchReq.addDependency("4", "2"); + batchReq.addDependency("4", "3"); + batchReq.removeRequest("2"); + + assert.isUndefined(batchReq.requests.get("1").dependsOn); + assert.isUndefined(batchReq.requests.get("3").dependsOn); + assert.equal(batchReq.requests.get("4").dependsOn.length, 2); + done(); + }); + }); + + describe("addDependency", function() { + this.timeout(20 * 1000); + it("Should return error for request with dependent id not present", (done) => { + const req = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req]); + try { + batchReq.addDependency("1"); + throw new Error("Dependent validation is failing"); + } catch (err) { + assert.equal(err.name, "Invalid Dependency Addition"); + done(); + } + }); + + it("Should return error for the request with given dependency id is not present", (done) => { + const req = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req]); + try { + batchReq.addDependency("1", "100"); + throw new Error("Dependency validation is failing"); + } catch (err) { + assert.equal(err.name, "Invalid Dependency"); + done(); + } + }); + + it("Should add dependency for a given dependent", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + const req3 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + req3.id = "3"; + const batchReq = new BatchRequestContent([req1, req2, req3]); + batchReq.addDependency("2", "1"); + assert.isDefined(batchReq.requests.get("2").dependsOn); + batchReq.addDependency("2", "3"); + assert.equal(batchReq.requests.get("2").dependsOn.length, 2); + done(); + }); + + it("Should return error for adding duplicate dependency", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + batchReq.addDependency("2", "1"); + try { + batchReq.addDependency("2", "1"); + } catch (e) { + assert.equal(e.name, "Duplicate Dependency"); + done(); + } + }); + + it("Should add dependency for dependency id not given", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + const req3 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + req3.id = "3"; + const batchReq = new BatchRequestContent([req1, req2, req3]); + batchReq.addDependency("2"); + assert.isDefined(batchReq.requests.get("2").dependsOn); + batchReq.addDependency("3"); + assert.isDefined(batchReq.requests.get("3").dependsOn); + done(); + }); + + it("Should return error for adding duplicate dependency when dependency id not given", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + batchReq.addDependency("2"); + assert.isDefined(batchReq.requests.get("2").dependsOn); + try { + batchReq.addDependency("2"); + } catch (e) { + assert.equal(e.name, "Duplicate Dependency"); + done(); + } + }); + + it("Should return error for adding dependency when only one request is present and dependency id not given", (done) => { + const req1 = getCreateFolderRequestCopy(); + req1.id = "1"; + const batchReq = new BatchRequestContent([req1]); + try { + batchReq.addDependency("1"); + } catch (e) { + assert.equal(e.name, "Invalid Dependency Addition"); + done(); + } + }); + }); + + describe("getContent", () => { + it("Should return error for empty requests", async () => { + const batchReq = new BatchRequestContent(); + try { + const content = await batchReq.getContent(); + throw new Error("Something wrong with the empty requests validation"); + } catch (error) { + assert.equal(error.name, "Empty Payload"); + } + }); + + it("Should return json content", async () => { + const req = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req]); + try { + const content = await batchReq.getContent(); + assert.isDefined(content.requests[0].body); + assert.equal(typeof content.requests[0].body, "object"); + } catch (error) { + throw error; + } + }); + + it("Should return image's base64 string", async () => { + const fileName = "sample_image.jpg"; + fs.readFile(`./spec/sample_files/${fileName}`, {}, async (err, file) => { + if (err) { + throw err; + } + const uploadOneDriveFile = { + id: "1", + request: new Request(`/me/drive/root:/Documents/${fileName}:/content`, { + method: "PUT", + headers: { + "Content-type": "image/jpg", + }, + body: file, + }), + }; + const batchReq = new BatchRequestContent([uploadOneDriveFile]); + try { + const content = await batchReq.getContent(); + assert.isDefined(content.requests[0].body); + } catch (error) { + throw error; + } + }); + }); + + it("Should throw error for request does not have content-type header if it does have a body", async () => { + const createFolderReqWithoutHeader = new Request("/me/drive/root/children", { + method: "POST", + body: JSON.stringify(folderDetails), + }); + + const batchReq = new BatchRequestContent([ + { + id: "1", + request: createFolderReqWithoutHeader, + }, + ]); + try { + const content = await batchReq.getContent(); + throw new Error("Something wrong with the header checking"); + } catch (error) { + assert.equal(error.name, "Invalid Content-type header"); + } + }); + }); + + describe("removeDependency", function() { + this.timeout(20 * 1000); + + it("Should return false for dependent not present", (done) => { + const batchReq = new BatchRequestContent(); + assert.equal(false, batchReq.removeDependency("1")); + done(); + }); + + it("Should return false for dependency array not present in the request", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + assert.equal(false, batchReq.removeDependency("2")); + done(); + }); + + it("Should return false for given dependency id is not present in the dependent request", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + batchReq.addDependency("2"); + assert.equal(false, batchReq.removeDependency("2", "5")); + done(); + }); + + it("Should delete the given dependency and dependent", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + batchReq.addDependency("2"); + assert.equal(true, batchReq.removeDependency("2", "1")); + done(); + }); + + it("Should delete all dependencies for a given dependent", (done) => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + const req3 = getCreateFolderRequestCopy(); + req1.id = "1"; + req2.id = "2"; + req3.id = "3"; + const batchReq = new BatchRequestContent([req1, req2, req3]); + batchReq.addDependency("3", "1"); + batchReq.addDependency("3", "2"); + assert.equal(true, batchReq.removeDependency("3")); + done(); + }); + }); + + describe("validateDependencies", () => { + /* tslint:disable: no-string-literal*/ + it("Should throw error for empty request object", (done) => { + try { + BatchRequestContent["validateDependencies"](new Map() as Map); + throw new Error("Something wrong with the empty requests check"); + } catch (error) { + assert.equal(error.name, "Empty Requests Error"); + done(); + } + }); + + it("isParallel - Should validate for single request", () => { + const req = getCreateFolderRequestCopy(); + const batchReq = new BatchRequestContent([req]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isParallel - Should validate for multiple requests", () => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestCopy(); + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isParallel - Should validate for requests with undefined dependsOn", () => { + const req1 = getCreateFolderRequestCopy(); + req1.id = "1"; + const req2 = getCreateFolderRequestCopy(); + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isParallel - Should validate for requests with empty dependsOn array", () => { + const req1 = getCreateFolderRequestCopy(); + req1.id = "1"; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + const batchReq = new BatchRequestContent([req1, req2]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should not validate for first request having dependsOn", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = ["2"]; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should validate for first request with undefined dependsOn", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = undefined; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const batchReq = new BatchRequestContent([req1, req2]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should validate for first request with empty dependsOn array", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const batchReq = new BatchRequestContent([req1, req2]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should not validate for a request does not depend on anything", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should not validate for a request does not depend on previous request", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["4"]; + const req4 = getCreateFolderRequestWithDependsOnCopy(); + req4.id = "4"; + const batchReq = new BatchRequestContent([req1, req2, req3, req4]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should not validate for requests having more than one dependencies", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["2"]; + const req4 = getCreateFolderRequestWithDependsOnCopy(); + req4.id = "4"; + req4.dependsOn = ["2", "3"]; + const batchReq = new BatchRequestContent([req1, req2, req3, req4]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSerial - Should validate for proper serial dependencies", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["2"]; + const req4 = getCreateFolderRequestWithDependsOnCopy(); + req4.id = "4"; + req4.dependsOn = ["3"]; + const batchReq = new BatchRequestContent([req1, req2, req3, req4]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should validate for first request with undefined dependsOn", () => { + const req1 = getCreateFolderRequestCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["1"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should validate for first request with empty dependsOn array", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.id = "1"; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["1"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should not validate for first request having dependency on itself", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = ["1"]; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["1"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["1"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should not validate for first request having dependency on non existing request", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = ["10"]; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["10"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["10"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should validate for requests dependsOn some middle order request", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = ["2"]; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["2"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(true, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should not validate for middle order request with empty dependsOn", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["1"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should not validate for middle order request dependency request has its own dependency", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = ["2"]; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + req2.dependsOn = ["2"]; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["2"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + + it("isSame - Should not validate for middle order request does depend on some other request other than dependency request", () => { + const req1 = getCreateFolderRequestWithDependsOnCopy(); + req1.dependsOn = ["2"]; + const req2 = getCreateFolderRequestWithDependsOnCopy(); + req2.id = "2"; + const req3 = getCreateFolderRequestWithDependsOnCopy(); + req3.id = "3"; + req3.dependsOn = ["3"]; + const batchReq = new BatchRequestContent([req1, req2, req3]); + assert.equal(false, BatchRequestContent["validateDependencies"](batchReq.requests)); + }); + /* tslint:enable: no-string-literal*/ + }); }); diff --git a/spec/content/BatchResponseContent.ts b/spec/content/BatchResponseContent.ts index 7520d0167..505420f40 100644 --- a/spec/content/BatchResponseContent.ts +++ b/spec/content/BatchResponseContent.ts @@ -5,122 +5,123 @@ * ------------------------------------------------------------------------------------------- */ -import { BatchResponseContent } from "../../src/content/BatchResponseContent"; import { assert } from "chai"; -let redirect = { - "id": "1", - "status": 302, - "headers": { - "location": "https://b0mpua-by3301.files.1drv.com/y23vmagahszhxzlcvhasdhasghasodfi" - } +import { BatchResponseContent } from "../../src/content/BatchResponseContent"; + +const redirect = { + id: "1", + status: 302, + headers: { + location: "https://b0mpua-by3301.files.1drv.com/y23vmagahszhxzlcvhasdhasghasodfi", + }, }; -let forbidden = { - "id": "3", - "status": 401, - "body": { - "error": { - "code": "Forbidden", - "message": "..." - } - } +const forbidden = { + id: "3", + status: 401, + body: { + error: { + code: "Forbidden", + message: "...", + }, + }, }; -let okWithBody = { - "id": "2", - "status": 200, - "body": { - "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.plannerTask)", - "value": [] - } +const okWithBody = { + id: "2", + status: 200, + body: { + "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.plannerTask)", + value: [], + }, }; -let okWithoutBody = { - "id": "4", - "status": 204, - "body": null +const okWithoutBody = { + id: "4", + status: 204, + body: null, }; -describe("BatchResponseContent.ts", function () { - describe('update', function () { - this.timeout(20 * 1000); - - it('Should update instance with nextLink responses', (done) => { - let responses = [redirect, forbidden]; - let batchRes = new BatchResponseContent({ - responses, - "@nextLink": "dummy nextlink" - }); - batchRes.update({ - responses: [okWithoutBody, okWithBody] - }) - assert.isDefined(batchRes.getResponseById("2")); - assert.isDefined(batchRes.getResponseById("4")); - done(); - }); - }); - - describe('createResponseObject', function () { - this.timeout(20 * 1000); - - it('Should create batch response content instance for 302, 402, 202, 204 responses', (done) => { - let batchRes = new BatchResponseContent({ - responses: [redirect, forbidden, okWithBody, okWithoutBody] - }); - assert.isDefined(batchRes.getResponseById("1")); - assert.isDefined(batchRes.getResponseById("2")); - assert.isDefined(batchRes.getResponseById("3")); - assert.isDefined(batchRes.getResponseById("4")); - done(); - }); - }); - - describe('getResponseById', function () { - this.timeout(20 * 1000); - - it('Should return response object for given id', (done) => { - let batchRes = new BatchResponseContent({ - responses: [redirect] - }); - assert.isDefined(batchRes.getResponseById("1")); - done(); - }); - - it('Should return undefined for given id for which the response is not present', (done) => { - let batchRes = new BatchResponseContent({ - responses: [redirect] - }); - assert.isUndefined(batchRes.getResponseById("100")); - done(); - }); - }); - - describe('getResponses', function () { - this.timeout(20 * 1000); - - it('Should return responses map', (done) => { - let batchRes = new BatchResponseContent({ - responses: [redirect] - }); - assert.isDefined(batchRes.getResponses()); - done(); - }); - }); - - describe('getResponsesIterator', function () { - this.timeout(20 * 1000); - - it('Should return iterator', (done) => { - let batchRes = new BatchResponseContent({ - responses: [redirect, forbidden, okWithBody, okWithoutBody] - }); - let count = 0; - let iterator = batchRes.getResponsesIterator(); - let data = iterator.next(); - while (!data.done) { - data = iterator.next(); - count++; - } - assert.equal(count, 4); - done(); - }); - }); +describe("BatchResponseContent.ts", () => { + describe("update", function() { + this.timeout(20 * 1000); + + it("Should update instance with nextLink responses", (done) => { + const responses = [redirect, forbidden]; + const batchRes = new BatchResponseContent({ + responses, + "@nextLink": "dummy nextlink", + }); + batchRes.update({ + responses: [okWithoutBody, okWithBody], + }); + assert.isDefined(batchRes.getResponseById("2")); + assert.isDefined(batchRes.getResponseById("4")); + done(); + }); + }); + + describe("createResponseObject", function() { + this.timeout(20 * 1000); + + it("Should create batch response content instance for 302, 402, 202, 204 responses", (done) => { + const batchRes = new BatchResponseContent({ + responses: [redirect, forbidden, okWithBody, okWithoutBody], + }); + assert.isDefined(batchRes.getResponseById("1")); + assert.isDefined(batchRes.getResponseById("2")); + assert.isDefined(batchRes.getResponseById("3")); + assert.isDefined(batchRes.getResponseById("4")); + done(); + }); + }); + + describe("getResponseById", function() { + this.timeout(20 * 1000); + + it("Should return response object for given id", (done) => { + const batchRes = new BatchResponseContent({ + responses: [redirect], + }); + assert.isDefined(batchRes.getResponseById("1")); + done(); + }); + + it("Should return undefined for given id for which the response is not present", (done) => { + const batchRes = new BatchResponseContent({ + responses: [redirect], + }); + assert.isUndefined(batchRes.getResponseById("100")); + done(); + }); + }); + + describe("getResponses", function() { + this.timeout(20 * 1000); + + it("Should return responses map", (done) => { + const batchRes = new BatchResponseContent({ + responses: [redirect], + }); + assert.isDefined(batchRes.getResponses()); + done(); + }); + }); + + describe("getResponsesIterator", function() { + this.timeout(20 * 1000); + + it("Should return iterator", (done) => { + const batchRes = new BatchResponseContent({ + responses: [redirect, forbidden, okWithBody, okWithoutBody], + }); + let count = 0; + const iterator = batchRes.getResponsesIterator(); + let data = iterator.next(); + while (!data.done) { + data = iterator.next(); + count++; + } + assert.equal(count, 4); + done(); + }); + }); }); diff --git a/spec/core/Client.ts b/spec/core/Client.ts index f801898d3..6a090680b 100644 --- a/spec/core/Client.ts +++ b/spec/core/Client.ts @@ -6,77 +6,80 @@ */ import { assert } from "chai"; + import { Client } from "../../src/Client"; -import { DummyHTTPMessageHandler } from "../DummyHTTPMessageHandler"; -import { DummyAuthenticationProvider } from "../DummyAuthenticationProvider"; import { AuthProvider } from "../../src/IAuthProvider"; import { ClientOptions } from "../../src/IClientOptions"; import { Options } from "../../src/IOptions"; import * as PolyFill from "../../src/PolyFill"; +import { DummyAuthenticationProvider } from "../DummyAuthenticationProvider"; +import { DummyHTTPMessageHandler } from "../DummyHTTPMessageHandler"; -describe("Client.ts", function () { - describe("initWithMiddleware", function () { - /** - * PolyFill fetch and promise before initializing client, otherwise error will be thrown - */ - before(() => { - PolyFill.init(); - }); - const dummyAuthProvider = new DummyAuthenticationProvider(), - dummyHTTPHandler = new DummyHTTPMessageHandler(); +describe("Client.ts", () => { + /* tslint:disable: no-string-literal*/ + describe("initWithMiddleware", () => { + /** + * PolyFill fetch and promise before initializing client, otherwise error will be thrown + */ + before(() => { + PolyFill.init(); + }); + const dummyAuthProvider = new DummyAuthenticationProvider(); + const dummyHTTPHandler = new DummyHTTPMessageHandler(); - it("Should throw an error in case if both auth provider and custom middleware is passed", () => { - try { - const options: ClientOptions = { - authProvider: dummyAuthProvider, - middleware: dummyHTTPHandler - }; - const client: Client = Client.initWithMiddleware(options); - throw new Error("Something wrong with the ambiguity check"); - } catch (error) { - assert.equal(error.name, "AmbiguityInInitialization"); - } - }); + it("Should throw an error in case if both auth provider and custom middleware is passed", () => { + try { + const options: ClientOptions = { + authProvider: dummyAuthProvider, + middleware: dummyHTTPHandler, + }; + const client: Client = Client.initWithMiddleware(options); + throw new Error("Something wrong with the ambiguity check"); + } catch (error) { + assert.equal(error.name, "AmbiguityInInitialization"); + } + }); - it("Should return client instance for an authentication provider", () => { - let options: ClientOptions = { - authProvider: dummyAuthProvider - }; - let client: Client = Client.initWithMiddleware(options); - assert.isTrue(client instanceof Client); - assert.isDefined(client["httpClient"]); - }); + it("Should return client instance for an authentication provider", () => { + const options: ClientOptions = { + authProvider: dummyAuthProvider, + }; + const client: Client = Client.initWithMiddleware(options); + assert.isTrue(client instanceof Client); + assert.isDefined(client["httpClient"]); + }); - it("Should return client instance for a custom middleware chain", () => { - let options: ClientOptions = { - middleware: dummyHTTPHandler - }; - let client: Client = Client.initWithMiddleware(options); - assert.isTrue(client instanceof Client); - assert.isDefined(client["httpClient"]); - }); + it("Should return client instance for a custom middleware chain", () => { + const options: ClientOptions = { + middleware: dummyHTTPHandler, + }; + const client: Client = Client.initWithMiddleware(options); + assert.isTrue(client instanceof Client); + assert.isDefined(client["httpClient"]); + }); - it("Should throw error in case of neither auth provider nor custom middleware is passed", () => { - try { - let options: ClientOptions = {}; - Client.initWithMiddleware(options); - throw new Error("Something wrong with the client initialization check"); - } catch (error) { - assert.equal(error.name, "InvalidMiddlewareChain"); - } - }); - }); + it("Should throw error in case of neither auth provider nor custom middleware is passed", () => { + try { + const options: ClientOptions = {}; + Client.initWithMiddleware(options); + throw new Error("Something wrong with the client initialization check"); + } catch (error) { + assert.equal(error.name, "InvalidMiddlewareChain"); + } + }); + }); - describe("init", () => { - it("Should return a client instance with default authentication provider and default middleware chain", () => { - const provider: AuthProvider = function (done) { - done(null, "dummy_token"); - }; - let options: Options = { - authProvider: provider - }; - let client: Client = Client.init(options); - assert.isDefined(client["httpClient"]); - }); - }); + describe("init", () => { + it("Should return a client instance with default authentication provider and default middleware chain", () => { + const provider: AuthProvider = (done) => { + done(null, "dummy_token"); + }; + const options: Options = { + authProvider: provider, + }; + const client: Client = Client.init(options); + assert.isDefined(client["httpClient"]); + }); + }); + /* tslint:enable: no-string-literal*/ }); diff --git a/spec/core/GraphErrorHandler.ts b/spec/core/GraphErrorHandler.ts index 99f1db7f2..bb8948f7d 100644 --- a/spec/core/GraphErrorHandler.ts +++ b/spec/core/GraphErrorHandler.ts @@ -6,99 +6,102 @@ */ import { assert } from "chai"; + import { GraphErrorHandler } from "../../src/GraphErrorHandler"; describe("GraphErrorHandler.ts", () => { - describe("constructError", () => { - it("Should return custom error without code", () => { - let message = "test", - error = new Error(message), - gError = GraphErrorHandler["constructError"](error); - assert.equal(gError.message, message); - }); + /* tslint:disable: no-string-literal*/ + describe("constructError", () => { + it("Should return custom error without code", () => { + const message = "test"; + const error = new Error(message); + const gError = GraphErrorHandler["constructError"](error); + assert.equal(gError.message, message); + }); - it("Should return custom error with code and message", () => { - let message = "test", - name = "test_name", - error = new Error(message); - error.name = name; - let gError = GraphErrorHandler["constructError"](error); - assert.equal(gError.message, message); - assert.equal(gError.code, name); - }); - }); + it("Should return custom error with code and message", () => { + const message = "test"; + const name = "test_name"; + const error = new Error(message); + error.name = name; + const gError = GraphErrorHandler["constructError"](error); + assert.equal(gError.message, message); + assert.equal(gError.code, name); + }); + }); - describe("constructErrorFromResponse", () => { - let statusCode = 400, - error: any = { - error: { - code: "DataNotAvailable", - message: "The data that is being requested is not present", - } - } + describe("constructErrorFromResponse", () => { + const statusCode = 400; + const error: any = { + error: { + code: "DataNotAvailable", + message: "The data that is being requested is not present", + }, + }; - it("Should construct error for error response without innerError property", () => { - let gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode); - assert.equal(gError.statusCode, statusCode); - assert.equal(gError.requestId, null); - }); + it("Should construct error for error response without innerError property", () => { + const gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode); + assert.equal(gError.statusCode, statusCode); + assert.equal(gError.requestId, null); + }); - it("Should construct error for the response missing one or more properties in innerError property", () => { - error.error.innerError = { - "request-id": "some random id" - }; - let gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode); - assert.equal(gError.statusCode, statusCode); - assert.equal(gError.requestId, "some random id"); - }); + it("Should construct error for the response missing one or more properties in innerError property", () => { + error.error.innerError = { + "request-id": "some random id", + }; + const gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode); + assert.equal(gError.statusCode, statusCode); + assert.equal(gError.requestId, "some random id"); + }); - it("Should construct error for the complete error response", () => { - let date = new Date(), - requestId = "some random id"; - error.error.innerError = { - "request-id": requestId, - date - } - let gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode); - assert.equal(gError.statusCode, statusCode); - assert.equal(gError.requestId, "some random id"); - assert.equal(gError.date.toUTCString(), date.toUTCString()); - }); - }); + it("Should construct error for the complete error response", () => { + const date = new Date(); + const requestId = "some random id"; + error.error.innerError = { + "request-id": requestId, + date, + }; + const gError = GraphErrorHandler["constructErrorFromResponse"](error, statusCode); + assert.equal(gError.statusCode, statusCode); + assert.equal(gError.requestId, "some random id"); + assert.equal(gError.date.toUTCString(), date.toUTCString()); + }); + }); + /* tslint:enable: no-string-literal*/ - describe("getError", () => { - it("Should construct error from response", () => { - let errorResponse = { - error: { - code: "500", - message: "Internal Server Error", - innerError: { - "request-id": "some random id" - } - } - }, - gError = GraphErrorHandler.getError(errorResponse); - assert.equal(gError.requestId, "some random id"); - assert.equal(gError.code, "500"); - assert.equal(gError.message, "Internal Server Error"); - }); + describe("getError", () => { + it("Should construct error from response", () => { + const errorResponse = { + error: { + code: "500", + message: "Internal Server Error", + innerError: { + "request-id": "some random id", + }, + }, + }; + const gError = GraphErrorHandler.getError(errorResponse); + assert.equal(gError.requestId, "some random id"); + assert.equal(gError.code, "500"); + assert.equal(gError.message, "Internal Server Error"); + }); - it("Should construct error from error object", () => { - let error = new Error("Some Error"); - error.name = "InvalidError"; - let gError = GraphErrorHandler.getError(error); - assert.equal(gError.requestId, null); - assert.equal(gError.message, "Some Error"); - assert.equal(gError.code, "InvalidError"); - }); + it("Should construct error from error object", () => { + const error = new Error("Some Error"); + error.name = "InvalidError"; + const gError = GraphErrorHandler.getError(error); + assert.equal(gError.requestId, null); + assert.equal(gError.message, "Some Error"); + assert.equal(gError.code, "InvalidError"); + }); - it("Should construct some default error", () => { - let gError = GraphErrorHandler.getError(); - assert.equal(gError.statusCode, -1); - assert.equal(gError.code, null); - assert.equal(gError.message, null); - assert.equal(gError.body, null); - assert.equal(gError.requestId, null); - }); - }); -}); \ No newline at end of file + it("Should construct some default error", () => { + const gError = GraphErrorHandler.getError(); + assert.equal(gError.statusCode, -1); + assert.equal(gError.code, null); + assert.equal(gError.message, null); + assert.equal(gError.body, null); + assert.equal(gError.requestId, null); + }); + }); +}); diff --git a/spec/core/GraphRequestUtil.ts b/spec/core/GraphRequestUtil.ts index 92d5c3336..6ce3dff82 100644 --- a/spec/core/GraphRequestUtil.ts +++ b/spec/core/GraphRequestUtil.ts @@ -6,64 +6,65 @@ */ import { assert } from "chai"; -import { urlJoin, serializeContent } from "../../src/GraphRequestUtil"; -describe("GraphRequestUtil.ts", function () { - describe("urlJoin", function () { - let output = "host/version/path"; +import { serializeContent, urlJoin } from "../../src/GraphRequestUtil"; - it("Should append parts with /", () => { - let joined = urlJoin(["host", "version", "path"]); - assert.equal(joined, output); - }); +describe("GraphRequestUtil.ts", () => { + describe("urlJoin", () => { + const output = "host/version/path"; - it("Should append parts with / by removing / from start", () => { - let joined = urlJoin(["host", "/version", "/path"]); - assert.equal(joined, output); - }); + it("Should append parts with /", () => { + const joined = urlJoin(["host", "version", "path"]); + assert.equal(joined, output); + }); - it("Should append parts with / by removing / from end", () => { - let joined = urlJoin(["host/", "version/", "path"]); - assert.equal(joined, output); - }); + it("Should append parts with / by removing / from start", () => { + const joined = urlJoin(["host", "/version", "/path"]); + assert.equal(joined, output); + }); - it("Should append parts with / by removing / from start and end", () => { - let joined = urlJoin(["host/", "/version/", "/path"]); - assert.equal(joined, output); - }); - }); + it("Should append parts with / by removing / from end", () => { + const joined = urlJoin(["host/", "version/", "path"]); + assert.equal(joined, output); + }); - describe("serializeContent", function () { - it("Should return Buffer/Blob/File/FormData/String as it is", () => { - let str = "Content"; - assert.equal(serializeContent(str), str); - let buffer = new Buffer("Buffer"); - assert.equal(serializeContent(buffer), buffer); - }); + it("Should append parts with / by removing / from start and end", () => { + const joined = urlJoin(["host/", "/version/", "/path"]); + assert.equal(joined, output); + }); + }); - it("Should convert it to string", () => { - let data = 123, - str = "123"; - assert.equal(serializeContent(data), str); - }); + describe("serializeContent", () => { + it("Should return Buffer/Blob/File/FormData/String as it is", () => { + const str = "Content"; + assert.equal(serializeContent(str), str); + const buffer = new Buffer("Buffer"); + assert.equal(serializeContent(buffer), buffer); + }); - it("Should throw error for objects that cannot be converted to string", () => { - let node1 = { - data: 1, - link: undefined - }; - let node2 = { - data: 2, - link: undefined - }; - node1.link = node2; - node2.link = node1; - try { - serializeContent(node1); - throw new Error("Something wrong with the serialize content, it should stringify cyclic referenced objects"); - } catch (error) { - assert.equal(error.message, "Unable to stringify the content"); - } - }); - }); -}); \ No newline at end of file + it("Should convert it to string", () => { + const data = 123; + const str = "123"; + assert.equal(serializeContent(data), str); + }); + + it("Should throw error for objects that cannot be converted to string", () => { + const node1 = { + data: 1, + link: undefined, + }; + const node2 = { + data: 2, + link: undefined, + }; + node1.link = node2; + node2.link = node1; + try { + serializeContent(node1); + throw new Error("Something wrong with the serialize content, it should stringify cyclic referenced objects"); + } catch (error) { + assert.equal(error.message, "Unable to stringify the content"); + } + }); + }); +}); diff --git a/spec/core/GraphResponseHandler.ts b/spec/core/GraphResponseHandler.ts index 0e6b91ef6..0d52d0262 100644 --- a/spec/core/GraphResponseHandler.ts +++ b/spec/core/GraphResponseHandler.ts @@ -6,11 +6,12 @@ */ import { assert } from "chai"; + import { GraphResponseHandler } from "../../src/GraphResponseHandler"; import { ResponseType } from "../../src/ResponseType"; describe("GraphResponseHandler.ts", () => { - const htmlString = ` + const htmlString = ` @@ -19,93 +20,93 @@ describe("GraphResponseHandler.ts", () => {

Testing

- `, - status200 = { - status: 200, - statusText: "OK" - }, - status204 = { - status: 204, - statusText: "OK" - }, - status500 = { - status: 500, - statusText: "Internal Server Error" - }; - - describe("parseDocumentResponse", () => { - it("Should return the html string", async () => { - const response = new Response(htmlString, status200); - const dom = await GraphResponseHandler["parseDocumentResponse"](response, GraphResponseHandler["DocumentTypes"]["TEXT_HTML"]); - assert.isDefined(dom); - assert.equal(typeof dom, "string"); - }); - }); + `; + const status200 = { + status: 200, + statusText: "OK", + }; + const status204 = { + status: 204, + statusText: "OK", + }; + const status500 = { + status: 500, + statusText: "Internal Server Error", + }; + /* tslint:disable: no-string-literal*/ + describe("parseDocumentResponse", () => { + it("Should return the html string", async () => { + const response = new Response(htmlString, status200); + const dom = await GraphResponseHandler["parseDocumentResponse"](response, GraphResponseHandler["DocumentTypes"]["TEXT_HTML"]); + assert.isDefined(dom); + assert.equal(typeof dom, "string"); + }); + }); - describe("convertResponse", () => { - it("Should return empty response for the NO CONTENT (204 response)", async () => { - const response = new Response(undefined, status204); - const responseValue = await GraphResponseHandler["convertResponse"](response); - assert.isUndefined(responseValue); - }); + describe("convertResponse", () => { + it("Should return empty response for the NO CONTENT (204 response)", async () => { + const response = new Response(undefined, status204); + const responseValue = await GraphResponseHandler["convertResponse"](response); + assert.isUndefined(responseValue); + }); - it("Should return response value as text", async () => { - const response = new Response(htmlString, status200); - const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.TEXT); - assert.isDefined(responseValue); - assert.equal(typeof responseValue, "string"); - assert.equal(responseValue, htmlString); - }); + it("Should return response value as text", async () => { + const response = new Response(htmlString, status200); + const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.TEXT); + assert.isDefined(responseValue); + assert.equal(typeof responseValue, "string"); + assert.equal(responseValue, htmlString); + }); - it("Should return a raw response", async () => { - const response = new Response(htmlString, status200); - const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.RAW); - assert.isDefined(responseValue); - assert.isTrue(responseValue instanceof Response); - }); + it("Should return a raw response", async () => { + const response = new Response(htmlString, status200); + const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.RAW); + assert.isDefined(responseValue); + assert.isTrue(responseValue instanceof Response); + }); - it("Should return response value as text for text/html return type", async () => { - const response = new Response(htmlString, status200); - const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.DOCUMENT); - assert.isDefined(responseValue); - assert.equal(typeof responseValue, "string"); - assert.equal(responseValue, htmlString); - }); + it("Should return response value as text for text/html return type", async () => { + const response = new Response(htmlString, status200); + const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.DOCUMENT); + assert.isDefined(responseValue); + assert.equal(typeof responseValue, "string"); + assert.equal(responseValue, htmlString); + }); - it("Should return response value as json", async () => { - let json = { test: "test" }, - response = new Response(JSON.stringify(json), status200); - const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.JSON); - assert.isDefined(responseValue); - assert.equal(responseValue.test, "test"); - }); + it("Should return response value as json", async () => { + const json = { test: "test" }; + const response = new Response(JSON.stringify(json), status200); + const responseValue = await GraphResponseHandler["convertResponse"](response, ResponseType.JSON); + assert.isDefined(responseValue); + assert.equal(responseValue.test, "test"); + }); - it("Should return response value as text for default response type", async () => { - let response = new Response(htmlString, status200); - let responseValue = await GraphResponseHandler["convertResponse"](response); - assert.isDefined(responseValue); - assert.equal(typeof responseValue, "string"); - assert.equal(responseValue, htmlString); - }); - }); + it("Should return response value as text for default response type", async () => { + const response = new Response(htmlString, status200); + const responseValue = await GraphResponseHandler["convertResponse"](response); + assert.isDefined(responseValue); + assert.equal(typeof responseValue, "string"); + assert.equal(responseValue, htmlString); + }); + }); + /* tslint:enable: no-string-literal*/ - describe("getResponse", () => { - it("Should return valid 200 OK response", async () => { - const response = new Response(htmlString, status200); - const responseValue = await GraphResponseHandler.getResponse(response, ResponseType.TEXT); - assert.isDefined(responseValue); - }); + describe("getResponse", () => { + it("Should return valid 200 OK response", async () => { + const response = new Response(htmlString, status200); + const responseValue = await GraphResponseHandler.getResponse(response, ResponseType.TEXT); + assert.isDefined(responseValue); + }); - it("Should throw error for NOT OK response", async () => { - try { - const response = new Response("NOT OK", status500); - const responseValue = await GraphResponseHandler.getResponse(response, ResponseType.TEXT); - throw new Error("Something wrong with validating OK response"); - } catch (error) { - assert.isDefined(error); - assert.equal(error, "NOT OK"); - } - }); - }); + it("Should throw error for NOT OK response", async () => { + try { + const response = new Response("NOT OK", status500); + const responseValue = await GraphResponseHandler.getResponse(response, ResponseType.TEXT); + throw new Error("Something wrong with validating OK response"); + } catch (error) { + assert.isDefined(error); + assert.equal(error, "NOT OK"); + } + }); + }); }); - diff --git a/spec/core/HTTPClient.ts b/spec/core/HTTPClient.ts index 10658454e..bb1a7a859 100644 --- a/spec/core/HTTPClient.ts +++ b/spec/core/HTTPClient.ts @@ -6,63 +6,66 @@ */ import { assert } from "chai"; -import { DummyHTTPMessageHandler } from "../DummyHTTPMessageHandler"; + import { HTTPClient } from "../../src/HTTPClient"; import { Context } from "../../src/IContext"; import { FetchOptions } from "../../src/IFetchOptions"; +import { DummyHTTPMessageHandler } from "../DummyHTTPMessageHandler"; describe("HTTPClient.ts", () => { - const httpMessageHandler: DummyHTTPMessageHandler = new DummyHTTPMessageHandler(); - const httpClient: HTTPClient = new HTTPClient(httpMessageHandler); - describe("constructor", () => { - it("Should create an instance and populate middleware member", () => { - assert.isDefined(httpClient["middleware"]); - assert.equal(httpClient["middleware"], httpMessageHandler); - }); - }); + const httpMessageHandler: DummyHTTPMessageHandler = new DummyHTTPMessageHandler(); + const httpClient: HTTPClient = new HTTPClient(httpMessageHandler); + /* tslint:disable: no-string-literal*/ + describe("constructor", () => { + it("Should create an instance and populate middleware member", () => { + assert.isDefined(httpClient["middleware"]); + assert.equal(httpClient["middleware"], httpMessageHandler); + }); + }); + /* tslint:enable: no-string-literal*/ - describe("sendRequest", async () => { - it("Should throw error for invalid request options incase if the url and options are passed", async () => { - try { - const url = "dummy_url"; - const context: Context = { - request: url - }; - await httpClient.sendRequest(context); - throw new Error("Something wrong with the context validation"); - } catch (error) { - assert.equal(error.name, "InvalidRequestOptions"); - } - }); + describe("sendRequest", async () => { + it("Should throw error for invalid request options incase if the url and options are passed", async () => { + try { + const url = "dummy_url"; + const context: Context = { + request: url, + }; + await httpClient.sendRequest(context); + throw new Error("Something wrong with the context validation"); + } catch (error) { + assert.equal(error.name, "InvalidRequestOptions"); + } + }); - it("Should execute for context object with Request instance", async () => { - try { - const request: Request = new Request("dummy_url", { - method: "GET" - }); - const context: Context = { - request - }; - await httpClient.sendRequest(context); - } catch (error) { - throw error; - } - }); + it("Should execute for context object with Request instance", async () => { + try { + const request: Request = new Request("dummy_url", { + method: "GET", + }); + const context: Context = { + request, + }; + await httpClient.sendRequest(context); + } catch (error) { + throw error; + } + }); - it("Should execute for context object with request uri and options", async () => { - try { - const url = "dummy_url"; - const options: FetchOptions = { - method: "GET" - } - const context: Context = { - request: url, - options - }; - await httpClient.sendRequest(context); - } catch (error) { - throw error; - } - }); - }); -}); \ No newline at end of file + it("Should execute for context object with request uri and options", async () => { + try { + const url = "dummy_url"; + const options: FetchOptions = { + method: "GET", + }; + const context: Context = { + request: url, + options, + }; + await httpClient.sendRequest(context); + } catch (error) { + throw error; + } + }); + }); +}); diff --git a/spec/core/HTTPClientFactory.ts b/spec/core/HTTPClientFactory.ts index 8b1266b86..3493ad01a 100644 --- a/spec/core/HTTPClientFactory.ts +++ b/spec/core/HTTPClientFactory.ts @@ -6,27 +6,28 @@ */ import { assert } from "chai"; -import { DummyHTTPMessageHandler } from "../DummyHTTPMessageHandler"; -import { DummyAuthenticationProvider } from "../DummyAuthenticationProvider"; + import { HTTPClient } from "../../src/HTTPClient"; import { HTTPClientFactory } from "../../src/HTTPClientFactory"; +import { DummyAuthenticationProvider } from "../DummyAuthenticationProvider"; +import { DummyHTTPMessageHandler } from "../DummyHTTPMessageHandler"; -describe("HTTPClientFactory.ts", function () { - describe("createWithAuthenticationProvider", () => { - - const dummyAuthProvider = new DummyAuthenticationProvider(), - dummyHTTPHandler = new DummyHTTPMessageHandler(); - - it("Should create an HTTPClient instance with default middleware chain", () => { - let client: HTTPClient = HTTPClientFactory.createWithAuthenticationProvider(dummyAuthProvider); - assert.isTrue(client instanceof HTTPClient); - assert.isDefined(client["middleware"]); - }); +describe("HTTPClientFactory.ts", () => { + /* tslint:disable: no-string-literal*/ + describe("createWithAuthenticationProvider", () => { + const dummyAuthProvider = new DummyAuthenticationProvider(); + const dummyHTTPHandler = new DummyHTTPMessageHandler(); + it("Should create an HTTPClient instance with default middleware chain", () => { + const client: HTTPClient = HTTPClientFactory.createWithAuthenticationProvider(dummyAuthProvider); + assert.isTrue(client instanceof HTTPClient); + assert.isDefined(client["middleware"]); + }); - it("Should create an HTTPClient with given middleware chain", () => { - let client: HTTPClient = HTTPClientFactory.createWithMiddleware(dummyHTTPHandler); - assert.isTrue(client instanceof HTTPClient); - assert.isDefined(client["middleware"]); - }); - }); + it("Should create an HTTPClient with given middleware chain", () => { + const client: HTTPClient = HTTPClientFactory.createWithMiddleware(dummyHTTPHandler); + assert.isTrue(client instanceof HTTPClient); + assert.isDefined(client["middleware"]); + }); + }); + /* tslint:enable: no-string-literal*/ }); diff --git a/spec/core/MSALAuthenticationProvider.ts b/spec/core/MSALAuthenticationProvider.ts index 8a1c1cf1f..0e6e21967 100644 --- a/spec/core/MSALAuthenticationProvider.ts +++ b/spec/core/MSALAuthenticationProvider.ts @@ -6,85 +6,88 @@ */ import { assert } from "chai"; -import { MSALAuthenticationProvider } from "../../src/MSALAuthenticationProvider"; import * as Window from "window"; -describe("MSALAuthenticationProvider.ts", () => { - let clientId = "dummy_client_id"; - let globalWindow; - before(() => { - globalWindow = global["window"]; - global["window"] = new Window(); - try { - let authProvider = new MSALAuthenticationProvider(clientId, []); - } catch (error) { +import { MSALAuthenticationProvider } from "../../src/MSALAuthenticationProvider"; - } - }); +describe("MSALAuthenticationProvider.ts", () => { + /* tslint:disable: no-string-literal*/ + const clientId = "dummy_client_id"; + let globalWindow; + before(() => { + globalWindow = global["window"]; + global["window"] = new Window(); + try { + const authProvider = new MSALAuthenticationProvider(clientId, []); + } catch (error) { + // tslint:disable-line: no-empty + } + }); - after(() => { - global["window"] = globalWindow; - }); + after(() => { + global["window"] = globalWindow; + }); - describe("constructor", () => { - it("Should return an instance of MSALAuthenticationProvider", () => { - let authProvider = new MSALAuthenticationProvider(clientId, []); - assert.isDefined(authProvider["scopes"]); - assert.isDefined(authProvider["clientId"]); - assert.isDefined(authProvider["userAgentApplication"]); - }); - }); + describe("constructor", () => { + it("Should return an instance of MSALAuthenticationProvider", () => { + const authProvider = new MSALAuthenticationProvider(clientId, []); + assert.isDefined(authProvider["scopes"]); + assert.isDefined(authProvider["clientId"]); + assert.isDefined(authProvider["userAgentApplication"]); + }); + }); - describe("getAccessToken", () => { - it("Should throw an error for getting access token with empty scopes", async () => { - let authProvider = new MSALAuthenticationProvider(clientId, []); - try { - let token = await authProvider.getAccessToken(); - throw new Error("Something went wrong, Should not provide access token for empty scopes"); - } catch (error) { - assert.equal(error.name, "EmptyScopes"); - } - }); - }); + describe("getAccessToken", () => { + it("Should throw an error for getting access token with empty scopes", async () => { + const authProvider = new MSALAuthenticationProvider(clientId, []); + try { + const token = await authProvider.getAccessToken(); + throw new Error("Something went wrong, Should not provide access token for empty scopes"); + } catch (error) { + assert.equal(error.name, "EmptyScopes"); + } + }); + }); - describe("addScopes", () => { - let user_read = "user.read", - user_readWrite = "user.readWrite"; - it("Should throw an error for empty scopes array", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - try { - authProvider.addScopes([]); - throw new Error("Something wrong with the empty array validation, Should not be allowed to add empty array"); - } catch (error) { - assert.equal(error.name, "EmptyScopes"); - } - }); + describe("addScopes", () => { + const userRead = "user.read"; + const userReadWrite = "user.readWrite"; + it("Should throw an error for empty scopes array", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + try { + authProvider.addScopes([]); + throw new Error("Something wrong with the empty array validation, Should not be allowed to add empty array"); + } catch (error) { + assert.equal(error.name, "EmptyScopes"); + } + }); - it("Should add scopes to empty scopes", () => { - let authProvider = new MSALAuthenticationProvider(clientId, []); - authProvider.addScopes([user_read]); - assert.equal(authProvider["scopes"][0], user_read); - }); + it("Should add scopes to empty scopes", () => { + const authProvider = new MSALAuthenticationProvider(clientId, []); + authProvider.addScopes([userRead]); + assert.equal(authProvider["scopes"][0], userRead); + }); - it("Should add scopes to non-empty scopes", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - authProvider.addScopes([user_readWrite]); - assert.equal(authProvider["scopes"].length, 2); - }); + it("Should add scopes to non-empty scopes", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + authProvider.addScopes([userReadWrite]); + assert.equal(authProvider["scopes"].length, 2); + }); - it("Should not add duplicate scopes", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - authProvider.addScopes([user_read]); - assert.equal(authProvider["scopes"].length, 1); - }); - }); + it("Should not add duplicate scopes", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + authProvider.addScopes([userRead]); + assert.equal(authProvider["scopes"].length, 1); + }); + }); - describe("clearScopes", () => { - let user_read = "user.read"; - it("Should clear the scopes array", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - authProvider.clearScopes(); - assert.equal(authProvider["scopes"].length, 0); - }); - }); + describe("clearScopes", () => { + const userRead = "user.read"; + it("Should clear the scopes array", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + authProvider.clearScopes(); + assert.equal(authProvider["scopes"].length, 0); + }); + }); + /* tslint:enable: no-string-literal*/ }); diff --git a/spec/core/MSALAuthenticationProviderForBrowser.ts b/spec/core/MSALAuthenticationProviderForBrowser.ts index fcb496a0c..a0bbfdb21 100644 --- a/spec/core/MSALAuthenticationProviderForBrowser.ts +++ b/spec/core/MSALAuthenticationProviderForBrowser.ts @@ -6,87 +6,90 @@ */ import { assert } from "chai"; -import { MSALAuthenticationProvider } from "../../src/browser/MSALAuthenticationProvider"; import * as Msal from "msal"; import * as Window from "window"; +import { MSALAuthenticationProvider } from "../../src/browser/MSALAuthenticationProvider"; + describe("MSALAuthenticationProvider.ts", () => { - let clientId = "dummy_client_id"; - let globalWindow; - before(() => { - globalWindow = global["window"]; - global["window"] = new Window(); - global["Msal"] = Msal; - try { - let authProvider = new MSALAuthenticationProvider(clientId, []); - } catch(error) { - - } - }); + /* tslint:disable: no-string-literal*/ + const clientId = "dummy_client_id"; + let globalWindow; + before(() => { + globalWindow = global["window"]; + global["window"] = new Window(); + global["Msal"] = Msal; + try { + const authProvider = new MSALAuthenticationProvider(clientId, []); + } catch (error) { + // tslint:disable-line: no-empty + } + }); - after(() => { - global["window"] = globalWindow; - }); + after(() => { + global["window"] = globalWindow; + }); - describe("constructor", () => { - it("Should return an instance of MSALAuthenticationProvider", () => { - let authProvider = new MSALAuthenticationProvider(clientId, []); - assert.isDefined(authProvider["scopes"]); - assert.isDefined(authProvider["clientId"]); - assert.isDefined(authProvider["userAgentApplication"]); - }); - }); + describe("constructor", () => { + it("Should return an instance of MSALAuthenticationProvider", () => { + const authProvider = new MSALAuthenticationProvider(clientId, []); + assert.isDefined(authProvider["scopes"]); + assert.isDefined(authProvider["clientId"]); + assert.isDefined(authProvider["userAgentApplication"]); + }); + }); - describe("getAccessToken", () => { - it("Should throw an error for getting access token with empty scopes", async () => { - let authProvider = new MSALAuthenticationProvider(clientId, []); - try { - let token = await authProvider.getAccessToken(); - throw new Error("Something went wrong, Should not provide access token for empty scopes"); - } catch (error) { - assert.equal(error.name, "EmptyScopes"); - } - }); - }); + describe("getAccessToken", () => { + it("Should throw an error for getting access token with empty scopes", async () => { + const authProvider = new MSALAuthenticationProvider(clientId, []); + try { + const token = await authProvider.getAccessToken(); + throw new Error("Something went wrong, Should not provide access token for empty scopes"); + } catch (error) { + assert.equal(error.name, "EmptyScopes"); + } + }); + }); - describe("addScopes", () => { - let user_read = "user.read", - user_readWrite = "user.readWrite"; - it("Should throw an error for empty scopes array", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - try { - authProvider.addScopes([]); - throw new Error("Something wrong with the empty array validation, Should not be allowed to add empty array"); - } catch (error) { - assert.equal(error.name, "EmptyScopes"); - } - }); + describe("addScopes", () => { + const userRead = "user.read"; + const userReadWrite = "user.readWrite"; + it("Should throw an error for empty scopes array", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + try { + authProvider.addScopes([]); + throw new Error("Something wrong with the empty array validation, Should not be allowed to add empty array"); + } catch (error) { + assert.equal(error.name, "EmptyScopes"); + } + }); - it("Should add scopes to empty scopes", () => { - let authProvider = new MSALAuthenticationProvider(clientId, []); - authProvider.addScopes([user_read]); - assert.equal(authProvider["scopes"][0], user_read); - }); + it("Should add scopes to empty scopes", () => { + const authProvider = new MSALAuthenticationProvider(clientId, []); + authProvider.addScopes([userRead]); + assert.equal(authProvider["scopes"][0], userRead); + }); - it("Should add scopes to non-empty scopes", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - authProvider.addScopes([user_readWrite]); - assert.equal(authProvider["scopes"].length, 2); - }); + it("Should add scopes to non-empty scopes", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + authProvider.addScopes([userReadWrite]); + assert.equal(authProvider["scopes"].length, 2); + }); - it("Should not add duplicate scopes", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - authProvider.addScopes([user_read]); - assert.equal(authProvider["scopes"].length, 1); - }); - }); + it("Should not add duplicate scopes", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + authProvider.addScopes([userRead]); + assert.equal(authProvider["scopes"].length, 1); + }); + }); - describe("clearScopes", () => { - let user_read = "user.read"; - it("Should clear the scopes array", () => { - let authProvider = new MSALAuthenticationProvider(clientId, [user_read]); - authProvider.clearScopes(); - assert.equal(authProvider["scopes"].length, 0); - }); - }); + describe("clearScopes", () => { + const userRead = "user.read"; + it("Should clear the scopes array", () => { + const authProvider = new MSALAuthenticationProvider(clientId, [userRead]); + authProvider.clearScopes(); + assert.equal(authProvider["scopes"].length, 0); + }); + }); + /* tslint:enable: no-string-literal*/ }); diff --git a/spec/core/Range.ts b/spec/core/Range.ts index 75c0114b3..e25a6d8ef 100644 --- a/spec/core/Range.ts +++ b/spec/core/Range.ts @@ -6,32 +6,32 @@ */ import { assert } from "chai"; -import { Range } from "../../src/Range"; -describe("Range.ts", function () { - describe("Constructor", function () { +import { Range } from "../../src/Range"; - let defaultValue = -1; +describe("Range.ts", () => { + describe("Constructor", () => { + const defaultValue = -1; - it("Should create a Range instance with given min and max values", () => { - let min = 1, - max = 10, - range = new Range(min, max); - assert.equal(range.minValue, min); - assert.equal(range.maxValue, max); - }); + it("Should create a Range instance with given min and max values", () => { + const min = 1; + const max = 10; + const range = new Range(min, max); + assert.equal(range.minValue, min); + assert.equal(range.maxValue, max); + }); - it("Should create a range instance with default values", () => { - let range = new Range(); - assert.equal(range.minValue, defaultValue); - assert.equal(range.maxValue, defaultValue); - }); + it("Should create a range instance with default values", () => { + const range = new Range(); + assert.equal(range.minValue, defaultValue); + assert.equal(range.maxValue, defaultValue); + }); - it("Should create a range instance with default max value", () => { - let min = 1, - range = new Range(min); - assert.equal(range.minValue, min); - assert.equal(range.maxValue, defaultValue); - }); - }); -}); \ No newline at end of file + it("Should create a range instance with default max value", () => { + const min = 1; + const range = new Range(min); + assert.equal(range.minValue, min); + assert.equal(range.maxValue, defaultValue); + }); + }); +}); diff --git a/spec/core/urlGeneration.ts b/spec/core/urlGeneration.ts index bbaaddea0..2cefe6dd0 100644 --- a/spec/core/urlGeneration.ts +++ b/spec/core/urlGeneration.ts @@ -6,54 +6,53 @@ */ import { assert } from "chai"; + import { getClient } from "../test-helper"; const client = getClient(); - -let cases = []; +const cases = []; cases.push({ - url: "https://graph.microsoft.com/v1.0/me?$select=displayName", - request: client.api("/me") - .select("displayName") + url: "https://graph.microsoft.com/v1.0/me?$select=displayName", + request: client.api("/me").select("displayName"), }); cases.push({ - url: "https://graph.microsoft.com/v1.0/me?$select=displayName", - request: client.api("/me") - .select(["displayName"]) + url: "https://graph.microsoft.com/v1.0/me?$select=displayName", + request: client.api("/me").select(["displayName"]), }); cases.push({ - url: "https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle", - request: client.api("me") - .select(["displayName", "jobTitle"]) + url: "https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle", + request: client.api("me").select(["displayName", "jobTitle"]), }); cases.push({ - url: "https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle", - request: client.api("/me") - .select(["displayName"]) - .select("jobTitle") + url: "https://graph.microsoft.com/v1.0/me?$select=displayName,jobTitle", + request: client + .api("/me") + .select(["displayName"]) + .select("jobTitle"), }); cases.push({ - url: "https://graph.microsoft.com/beta/me?$select=displayName,jobTitle", - request: client.api("/me") - .version("beta") - .select(["displayName"]) - .select("jobTitle") + url: "https://graph.microsoft.com/beta/me?$select=displayName,jobTitle", + request: client + .api("/me") + .version("beta") + .select(["displayName"]) + .select("jobTitle"), }); cases.push({ - url: "https://graph.microsoft.com/beta/me?$select=displayName,jobTitle", - request: client.api("/me") - .version("beta") - .select(["displayName"]) - .select("jobTitle") + url: "https://graph.microsoft.com/beta/me?$select=displayName,jobTitle", + request: client + .api("/me") + .version("beta") + .select(["displayName"]) + .select("jobTitle"), }); - // Need to figure out type signature of select() to allow string, array of strings, and unlimited string parameters // cases.push({ // url: "https://graph.microsoft.com/beta/me?$select=displayName,jobTitle,mailNickname", @@ -63,46 +62,51 @@ cases.push({ // }) cases.push({ - url: "https://graph.microsoft.com/beta/me/people?$select=displayName,title&$count=true", - request: client.api("/me/people") - .version("beta") - .select(["displayName"]) - .select("title") - .count(true) + url: "https://graph.microsoft.com/beta/me/people?$select=displayName,title&$count=true", + request: client + .api("/me/people") + .version("beta") + .select(["displayName"]) + .select("title") + .count(true), }); cases.push({ - url: "https://graph.microsoft.com/beta/me/people?$select=displayName,title&$count=true&$search=senior", - request: client.api("/me/people") - .version("beta") - .select(['displayName', 'title']) - .count(true) - .query({ "$search": "senior" }) + url: "https://graph.microsoft.com/beta/me/people?$select=displayName,title&$count=true&$search=senior", + request: client + .api("/me/people") + .version("beta") + .select(["displayName", "title"]) + .count(true) + .query({ $search: "senior" }), }); cases.push({ - url: "https://graph.microsoft.com/beta/me/people?$select=displayName,title&$count=true&$search=senior", - request: client.api("/me/people") - .version("beta") - .select(['displayName', 'title']) - .count(true) - .query("$search=senior") + url: "https://graph.microsoft.com/beta/me/people?$select=displayName,title&$count=true&$search=senior", + request: client + .api("/me/people") + .version("beta") + .select(["displayName", "title"]) + .count(true) + .query("$search=senior"), }); cases.push({ - url: "https://graph.microsoft.com/v1.0/me/drive/root?$expand=children($select=name),permissions", - request: client.api("me/drive/root") - .expand("children($select=name)") - .expand("permissions") + url: "https://graph.microsoft.com/v1.0/me/drive/root?$expand=children($select=name),permissions", + request: client + .api("me/drive/root") + .expand("children($select=name)") + .expand("permissions"), }); -describe("urlGeneration.ts", function () { - describe('buildFullUrl', function () { - for (let i = 0; i < cases.length; i++) { - let testCase = cases[i]; - it('should correctly build ' + testCase.url, () => { - assert.equal(testCase.url, testCase.request["buildFullUrl"]()); - }) - } - }); -}); \ No newline at end of file +describe("urlGeneration.ts", () => { + /* tslint:disable: no-string-literal*/ + describe("buildFullUrl", () => { + for (const testCase of cases) { + it("should correctly build " + testCase.url, () => { + assert.equal(testCase.url, testCase.request["buildFullUrl"]()); + }); + } + }); + /* tslint:enable: no-string-literal*/ +}); diff --git a/spec/core/urlParsing.ts b/spec/core/urlParsing.ts index efbc1ec9b..51a02da59 100644 --- a/spec/core/urlParsing.ts +++ b/spec/core/urlParsing.ts @@ -6,36 +6,41 @@ */ import { assert } from "chai"; + import { getClient } from "../test-helper"; const client = getClient(); -let testCases = { - "/me": "https://graph.microsoft.com/v1.0/me", - "/me/": "https://graph.microsoft.com/v1.0/me/", - "me": "https://graph.microsoft.com/v1.0/me", - "me/events": "https://graph.microsoft.com/v1.0/me/events", - "/me/events": "https://graph.microsoft.com/v1.0/me/events", - "https://graph.microsoft.com/v1.0/me/events": "https://graph.microsoft.com/v1.0/me/events", - "https://graph.microsoft.com/beta/me/events?$filter=startswith(subject, 'update')": "https://graph.microsoft.com/beta/me/events?$filter=startswith(subject, 'update')", - "me/events?$filter=startswith(subject, 'update')": "https://graph.microsoft.com/v1.0/me/events?$filter=startswith(subject, 'update')", - "/me?a=b": "https://graph.microsoft.com/v1.0/me?a=b", - "/me?$filter=b&c=d": "https://graph.microsoft.com/v1.0/me?$filter=b&c=d", - "me?$filter=b&c=d": "https://graph.microsoft.com/v1.0/me?$filter=b&c=d", +const testCases = { + "/me": "https://graph.microsoft.com/v1.0/me", + "/me/": "https://graph.microsoft.com/v1.0/me/", + me: "https://graph.microsoft.com/v1.0/me", + "me/events": "https://graph.microsoft.com/v1.0/me/events", + "/me/events": "https://graph.microsoft.com/v1.0/me/events", + "https://graph.microsoft.com/v1.0/me/events": "https://graph.microsoft.com/v1.0/me/events", + "https://graph.microsoft.com/beta/me/events?$filter=startswith(subject, 'update')": "https://graph.microsoft.com/beta/me/events?$filter=startswith(subject, 'update')", + "me/events?$filter=startswith(subject, 'update')": "https://graph.microsoft.com/v1.0/me/events?$filter=startswith(subject, 'update')", + "/me?a=b": "https://graph.microsoft.com/v1.0/me?a=b", + "/me?$filter=b&c=d": "https://graph.microsoft.com/v1.0/me?$filter=b&c=d", + "me?$filter=b&c=d": "https://graph.microsoft.com/v1.0/me?$filter=b&c=d", - // oData params should work with and without $ - "me?$select=displayName": "https://graph.microsoft.com/v1.0/me?$select=displayName", - "me?select=displayName": "https://graph.microsoft.com/v1.0/me?select=displayName", - "https://graph.microsoft.com/beta/me?select=displayName": "https://graph.microsoft.com/beta/me?select=displayName" -} + // oData params should work with and without $ + "me?$select=displayName": "https://graph.microsoft.com/v1.0/me?$select=displayName", + "me?select=displayName": "https://graph.microsoft.com/v1.0/me?select=displayName", + "https://graph.microsoft.com/beta/me?select=displayName": "https://graph.microsoft.com/beta/me?select=displayName", +}; -describe("urlParsing.ts", function () { - describe('parsePath', function () { - for (let path in testCases) { - it('should correctly parse ' + path, () => { - var request = client.api(path); - assert.equal(request["buildFullUrl"](), testCases[path]); - }); - } - }); +describe("urlParsing.ts", () => { + /* tslint:disable: no-string-literal*/ + describe("parsePath", () => { + for (const path in testCases) { + if (testCases.hasOwnProperty(path)) { + it("should correctly parse " + path, () => { + const request = client.api(path); + assert.equal(request["buildFullUrl"](), testCases[path]); + }); + } + } + }); + /* tslint:enable: no-string-literal*/ }); diff --git a/spec/development/HardCodedAuthenticationProvider.ts b/spec/development/HardCodedAuthenticationProvider.ts index 482499839..97adf73a2 100644 --- a/spec/development/HardCodedAuthenticationProvider.ts +++ b/spec/development/HardCodedAuthenticationProvider.ts @@ -10,6 +10,7 @@ */ import { AuthenticationProvider } from "../../src/IAuthenticationProvider"; + import { AccessToken } from "./secrets"; /** @@ -18,14 +19,13 @@ import { AccessToken } from "./secrets"; * Class representing HardCodedAuthenticationProvider */ export class HardCodedAuthenticationProvider implements AuthenticationProvider { - - /** - * @public - * @async - * To get the access token - * @returns The promise that resolves to an access token - */ - public async getAccessToken(): Promise { - return Promise.resolve(AccessToken); - } + /** + * @public + * @async + * To get the access token + * @returns The promise that resolves to an access token + */ + public async getAccessToken(): Promise { + return Promise.resolve(AccessToken); + } } diff --git a/spec/development/secrets.sample.ts b/spec/development/secrets.sample.ts index 7010f2e87..304c647cd 100644 --- a/spec/development/secrets.sample.ts +++ b/spec/development/secrets.sample.ts @@ -1,7 +1,7 @@ /** * @file * Defines access token exporting structure - * - * To use authentication based(making real requests to the graph service) testing populate this access token's value and rename this file as secrets.ts + * + * To use authentication based(making real requests to the graph service) testing populate this access token's value and rename this file as secrets.ts */ -export const AccessToken = ""; \ No newline at end of file +export const AccessToken = ""; diff --git a/spec/development/test-helper.ts b/spec/development/test-helper.ts index a3d8c207b..7a74659d6 100644 --- a/spec/development/test-helper.ts +++ b/spec/development/test-helper.ts @@ -5,20 +5,23 @@ * ------------------------------------------------------------------------------------------- */ -import { HardCodedAuthenticationProvider } from "./HardCodedAuthenticationProvider"; import { Client } from "../../src/index"; import * as PolyFill from "../../src/PolyFill"; +import { HardCodedAuthenticationProvider } from "./HardCodedAuthenticationProvider"; + export function getClient(): Client { - /** - * PolyFill fetch and promise before initializing client, otherwise error will be thrown - */ - PolyFill.init(); - return Client.initWithMiddleware({ - authProvider: new HardCodedAuthenticationProvider() - }); + /** + * PolyFill fetch and promise before initializing client, otherwise error will be thrown + */ + PolyFill.init(); + return Client.initWithMiddleware({ + authProvider: new HardCodedAuthenticationProvider(), + }); } export function randomString() { - return Math.random().toString(36).substring(7); + return Math.random() + .toString(36) + .substring(7); } diff --git a/spec/development/workload/OneNote.ts b/spec/development/workload/OneNote.ts index 9aec46800..039d7f6cf 100644 --- a/spec/development/workload/OneNote.ts +++ b/spec/development/workload/OneNote.ts @@ -5,104 +5,99 @@ * ------------------------------------------------------------------------------------------- */ +import { Notebook, OnenotePage, OnenoteSection } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; import * as FormData from "form-data"; import * as fs from "fs"; + import { getClient, randomString } from "../test-helper"; -import { Notebook, OnenoteSection, OnenotePage } from '@microsoft/microsoft-graph-types'; const client = getClient(); -describe('OneNote', function () { - this.timeout(20 * 1000); - let notebook = { - displayName: "Sample notebook - " + randomString() - }; - - let section = { - displayName: "Sample section - " + randomString() - } - - let createdPage: OnenotePage; - const PageContent = "Sample page content - " + randomString(); +describe("OneNote", function() { + this.timeout(20 * 1000); + let notebook: Notebook = { + displayName: "Sample notebook - " + randomString(), + }; - it('Create a OneNote notebook', async () => { - try { - let json = await client.api("/me/onenote/notebooks").post(notebook); - const createdNotebook = json as Notebook; - assert.isDefined(createdNotebook.id); - assert.equal(notebook.displayName, createdNotebook.displayName); - assert.isUndefined(createdNotebook['invalidPropertyName']); + let section: OnenoteSection = { + displayName: "Sample section - " + randomString(), + }; - // if this passes, use this notebook in the following tests - notebook = createdNotebook; - } catch (error) { - throw error; - } - }); + let createdPage: OnenotePage; + const PageContent = "Sample page content - " + randomString(); - it('Create a OneNote section in a Notebook', async () => { - try { - let json = await client.api(`/me/onenote/notebooks/${notebook.id}/sections`).post(section); - const createdSection = json as OnenoteSection; - assert.isDefined(createdSection.id); - assert.equal(section.displayName, createdSection.displayName); - assert.isUndefined(createdSection["invalidPropertyName"]); + it("Create a OneNote notebook", async () => { + try { + const json = await client.api("/me/onenote/notebooks").post(notebook); + const createdNotebook = json as Notebook; + assert.isDefined(createdNotebook.id); + assert.equal(notebook.displayName, createdNotebook.displayName); + assert.isUndefined(createdNotebook["random fake property that should be null"]); + // if this passes, use this notebook in the following tests + notebook = createdNotebook; + } catch (error) { + throw error; + } + }); - // if this passes, use this notebook in the following tests - section = createdSection; - } catch (error) { - throw error; - } - }); + it("Create a OneNote section in a Notebook", async () => { + try { + const json = await client.api(`/me/onenote/notebooks/${notebook.id}/sections`).post(section); + const createdSection = json as OnenoteSection; + assert.isDefined(createdSection.id); + assert.equal(section.displayName, createdSection.displayName); + assert.isUndefined(createdSection["random fake property that should be null"]); + // if this passes, use this notebook in the following tests + section = createdSection; + } catch (error) { + throw error; + } + }); - it('Create a OneNote page in a section with basic text content', async () => { - try { - let json = await client - .api(`/me/onenote/sections/${section.id}/pages`) - .header("Content-Type", "text/html") - .post(PageContent); - createdPage = json as OnenotePage; - assert.isDefined(createdPage.id); - assert.isDefined(createdPage.contentUrl); - assert.isUndefined(createdPage['invalidPropertyName']); - } catch (error) { - throw error; - } - }); - it("Create a OneNote page with html page content", async () => { - try { - let formData = new FormData(); - formData.append('Presentation', fs.createReadStream('./spec/sample_files/onenotepage.html')); - let json = await client - .api(`/me/onenote/sections/${section.id}/pages`) - .post(formData); - let createdPageFromHTML = json as OnenotePage; + it("Create a OneNote page in a section with basic text content", async () => { + try { + const json = await client + .api(`/me/onenote/sections/${section.id}/pages`) + .header("Content-Type", "text/html") + .post(PageContent); + createdPage = json as OnenotePage; + assert.isDefined(createdPage.id); + assert.isDefined(createdPage.contentUrl); + assert.isUndefined(createdPage["random fake property that should be null"]); + } catch (error) { + throw error; + } + }); + it("Create a OneNote page with html page content", async () => { + try { + const formData = new FormData(); + formData.append("Presentation", fs.createReadStream("./spec/sample_files/onenotepage.html")); + const json = await client.api(`/me/onenote/sections/${section.id}/pages`).post(formData); + const createdPageFromHTML = json as OnenotePage; - assert.isDefined(createdPage.id); - assert.isDefined(createdPage.contentUrl); - assert.equal("New Page", createdPageFromHTML.title); - assert.isUndefined(createdPage['invalidPropertyName']); - } catch (error) { - throw error; - } - }); + assert.isDefined(createdPage.id); + assert.isDefined(createdPage.contentUrl); + assert.equal("New Page", createdPageFromHTML.title); + assert.isUndefined(createdPage["random fake property that should be null"]); + } catch (error) { + throw error; + } + }); - it("create a OneNote page with html page content and file attachment", async () => { - try { - let formData = new FormData(); - formData.append('Presentation', fs.createReadStream('./spec/sample_files/onenotepage_fileattachment.html')); - formData.append("fileBlock1", fs.createReadStream("./sample.png")); - let json = await client - .api(`/me/onenote/sections/${section.id}/pages`) - .post(formData); - let createdPageFromHTML = json as OnenotePage; - assert.isDefined(createdPage.id); - assert.isDefined(createdPage.contentUrl); - assert.equal("A page with rendered file attachment", createdPageFromHTML.title); - assert.isUndefined(createdPage['invalidPropertyName']); - } catch (error) { - throw error; - } - }); + it("create a OneNote page with html page content and file attachment", async () => { + try { + const formData = new FormData(); + formData.append("Presentation", fs.createReadStream("./spec/sample_files/onenotepage_fileattachment.html")); + formData.append("fileBlock1", fs.createReadStream("./sample.png")); + const json = await client.api(`/me/onenote/sections/${section.id}/pages`).post(formData); + const createdPageFromHTML = json as OnenotePage; + assert.isDefined(createdPage.id); + assert.isDefined(createdPage.contentUrl); + assert.equal("A page with rendered file attachment", createdPageFromHTML.title); + assert.isUndefined(createdPage["random fake property that should be null"]); + } catch (error) { + throw error; + } + }); }); diff --git a/spec/development/workload/delta-query.ts b/spec/development/workload/delta-query.ts index 87f21da6b..80ff5c93d 100644 --- a/spec/development/workload/delta-query.ts +++ b/spec/development/workload/delta-query.ts @@ -5,38 +5,39 @@ * ------------------------------------------------------------------------------------------- */ +import { Event } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; import "isomorphic-fetch"; + import { getClient, randomString } from "../test-helper"; -import { Event } from "@microsoft/microsoft-graph-types"; const client = getClient(); -describe('Delta Query', function () { +describe("Delta Query", function() { this.timeout(10 * 1000); - let today = new Date(); - let tomorrow = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000); - let nextWeek = new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000); + const today = new Date(); + const tomorrow = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000); + const nextWeek = new Date(today.getTime() + 7 * 24 * 60 * 60 * 1000); let deltaLink: string; - let subject: string = randomString(); - - let mockEvent: Event = { - "originalStartTimeZone": tomorrow.toISOString(), - "originalEndTimeZone": tomorrow.toISOString(), - "reminderMinutesBeforeStart": 99, - "isReminderOn": true, - "subject": subject - } + const subject: string = randomString(); + const mockEvent: Event = { + originalStartTimeZone: tomorrow.toISOString(), + originalEndTimeZone: tomorrow.toISOString(), + reminderMinutesBeforeStart: 99, + isReminderOn: true, + subject, + }; - it('Gets the delta link for the initial calendar view list', async () => { + it("Gets the delta link for the initial calendar view list", async () => { try { - let res = await client.api("/me/calendarview/delta") + let res = await client + .api("/me/calendarview/delta") .query({ - "startdatetime": today.toISOString(), - "enddatetime": nextWeek.toISOString() + startdatetime: today.toISOString(), + enddatetime: nextWeek.toISOString(), }) .get(); while (res["@odata.nextLink"] !== undefined) { @@ -49,9 +50,9 @@ describe('Delta Query', function () { } }); - it('Creates a calendar event to see changes in the delta response', async () => { + it("Creates a calendar event to see changes in the delta response", async () => { try { - let response = await client.api('/me/events').post(mockEvent); + const response = await client.api("/me/events").post(mockEvent); assert.isDefined(response.id); assert.equal(response.subject, subject); } catch (error) { @@ -59,14 +60,14 @@ describe('Delta Query', function () { } }); - it('Uses delta token to see changed calendar view', async () => { + it("Uses delta token to see changed calendar view", async () => { try { let found = false; if (typeof deltaLink !== "undefined") { - let res = await client.api(deltaLink).get(); - let events: Event[] = res.value; - for (let event of events) { - if (event.subject == mockEvent.subject) { + const res = await client.api(deltaLink).get(); + const events: Event[] = res.value; + for (const event of events) { + if (event.subject === mockEvent.subject) { found = true; } } diff --git a/spec/development/workload/excel.ts b/spec/development/workload/excel.ts index 51089c8ae..0e068a17f 100644 --- a/spec/development/workload/excel.ts +++ b/spec/development/workload/excel.ts @@ -5,70 +5,68 @@ * ------------------------------------------------------------------------------------------- */ +import { WorkbookRange, WorkbookWorksheet } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; -import * as fs from 'fs'; +import * as fs from "fs"; + import { getClient, randomString } from "../test-helper"; -import { WorkbookWorksheet, WorkbookRange } from '@microsoft/microsoft-graph-types'; const client = getClient(); const ExcelFilename = `empty-spreadsheet-${randomString()}.xlsx`; -describe('Excel', function () { - this.timeout(10 * 1000); - beforeEach((done) => { - setTimeout(function () { - done(); - }, 1000); - }); - it('Uploads an Excel file to OneDrive', async () => { - try { - let file = fs.readFileSync('./spec/sample_files/empty-spreadsheet.xlsx'); - let res = await client.api(`/me/drive/root/children/${ExcelFilename}/content`).put(file); - assert.isDefined(res.id); - } catch (error) { - throw error; - } - }); +describe("Excel", function() { + this.timeout(10 * 1000); + beforeEach((done) => { + setTimeout(() => { + done(); + }, 1000); + }); + it("Uploads an Excel file to OneDrive", async () => { + try { + const file = fs.readFileSync("./spec/sample_files/empty-spreadsheet.xlsx"); + const res = await client.api(`/me/drive/root/children/${ExcelFilename}/content`).put(file); + assert.isDefined(res.id); + } catch (error) { + throw error; + } + }); - it('Lists the worksheets in an excel file', async () => { - try { - let res = await client.api(`/me/drive/root:/${ExcelFilename}:/workbook/worksheets`).get(); - let worksheets = res.value as WorkbookWorksheet[]; - let sheet1 = worksheets[0]; - assert.isNumber(sheet1.position); - assert.isString(sheet1.visibility); - assert.isString(sheet1.id); - assert.isUndefined(sheet1['random fake property that should be null']); - } catch (error) { - throw error; - } - }) + it("Lists the worksheets in an excel file", async () => { + try { + const res = await client.api(`/me/drive/root:/${ExcelFilename}:/workbook/worksheets`).get(); + const worksheets = res.value as WorkbookWorksheet[]; + const sheet1 = worksheets[0]; + assert.isNumber(sheet1.position); + assert.isString(sheet1.visibility); + assert.isString(sheet1.id); + assert.isUndefined(sheet1["random fake property that should be null"]); + } catch (error) { + throw error; + } + }); - it('Updates workbook worksheet range', async () => { - let sampleData: WorkbookRange = { - values: [ - ['cell a1', 'cell a2'], - ['cell b1', 'cell b2'] - ] - }; - try { - let response = await client.api(`/me/drive/root:/${ExcelFilename}:/workbook/worksheets/Sheet1/range(address='A1:B2')`).patch(sampleData); - assert.isDefined(response["@odata.id"]); - assert.isDefined(response.values); - } catch (error) { - throw error; - } - }) + it("Updates workbook worksheet range", async () => { + const sampleData: WorkbookRange = { + values: [["cell a1", "cell a2"], ["cell b1", "cell b2"]], + }; + try { + const response = await client.api(`/me/drive/root:/${ExcelFilename}:/workbook/worksheets/Sheet1/range(address='A1:B2')`).patch(sampleData); + assert.isDefined(response["@odata.id"]); + assert.isDefined(response.values); + } catch (error) { + throw error; + } + }); - it('GETs the used range of the worksheet', async () => { - try { - let res: WorkbookRange = await client.api(`/me/drive/root:/${ExcelFilename}:/workbook/worksheets/Sheet1/range/usedrange`).get(); - assert.isNumber(res.cellCount); - assert.isString(res.address); - assert.isUndefined(res['other prop']); - } catch (error) { - throw error; - } - }) + it("GETs the used range of the worksheet", async () => { + try { + const res: WorkbookRange = await client.api(`/me/drive/root:/${ExcelFilename}:/workbook/worksheets/Sheet1/range/usedrange`).get(); + assert.isNumber(res.cellCount); + assert.isString(res.address); + assert.isUndefined(res["random fake property that should be null"]); + } catch (error) { + throw error; + } + }); }); diff --git a/spec/development/workload/groups.ts b/spec/development/workload/groups.ts index 1ce6f19d8..24c0fdb72 100644 --- a/spec/development/workload/groups.ts +++ b/spec/development/workload/groups.ts @@ -5,48 +5,46 @@ * ------------------------------------------------------------------------------------------- */ +import { Group } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; + import { getClient, randomString } from "../test-helper"; -import { Group } from '@microsoft/microsoft-graph-types'; const client = getClient(); -describe('Groups', function () { - this.timeout(10 * 1000); - it('Fetch a list of groups and access properties on a collection item', async () => { - try { - let res = await client.api("/groups").get(); - const group = res.value[0] as Group; - assert.isDefined(group.displayName); - assert.isDefined(group.mail); - assert.isDefined(group.id); - - assert.isUndefined(group['invalidPropertyName']); - } catch (error) { - throw error; - } - }); +describe("Groups", function() { + this.timeout(10 * 1000); + it("Fetch a list of groups and access properties on a collection item", async () => { + try { + const res = await client.api("/groups").get(); + const group = res.value[0] as Group; + assert.isDefined(group.displayName); + assert.isDefined(group.mail); + assert.isDefined(group.id); + assert.isUndefined(group["random fake property that should be null"]); + } catch (error) { + throw error; + } + }); - it('Create a group and validate properties were set', async () => { - const group: Group = { - displayName: randomString(), - description: randomString(), - groupTypes: [ - "Unified" - ], - mailEnabled: true, - mailNickname: randomString(), - securityEnabled: true - }; - try { - let res = await client.api("/groups").post(group); - let createdGroup = res as Group; - assert.equal(createdGroup.displayName, group.displayName); - assert.equal(createdGroup.description, group.description); - assert.equal(createdGroup.mailEnabled, group.mailEnabled); - assert.isString(createdGroup.id); - } catch (error) { - throw error; - } - }); + it("Create a group and validate properties were set", async () => { + const group: Group = { + displayName: randomString(), + description: randomString(), + groupTypes: ["Unified"], + mailEnabled: true, + mailNickname: randomString(), + securityEnabled: true, + }; + try { + const res = await client.api("/groups").post(group); + const createdGroup = res as Group; + assert.equal(createdGroup.displayName, group.displayName); + assert.equal(createdGroup.description, group.description); + assert.equal(createdGroup.mailEnabled, group.mailEnabled); + assert.isString(createdGroup.id); + } catch (error) { + throw error; + } + }); }); diff --git a/spec/development/workload/insights.ts b/spec/development/workload/insights.ts index f0214b4c1..6cc765b71 100644 --- a/spec/development/workload/insights.ts +++ b/spec/development/workload/insights.ts @@ -5,47 +5,56 @@ * ------------------------------------------------------------------------------------------- */ +import { Person } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; + import { getClient } from "../test-helper"; -import { Person } from '@microsoft/microsoft-graph-types'; const client = getClient(); -describe('Social and Insights', function () { +describe("Social and Insights", function() { this.timeout(10 * 1000); - it('Fetch a list of people', async () => { + it("Fetch a list of people", async () => { try { - let res = await client.api("/me/people").get(); + const res = await client.api("/me/people").get(); const person = res.value[0] as Person; assert.isDefined(person.displayName); assert.isDefined(person.surname); assert.isDefined(person.id); - - assert.isUndefined(person['invalidPropertyName']); + assert.isUndefined(person["random fake property that should be null"]); } catch (error) { throw error; } }); - it('Searches the people list', async () => { + it("Searches the people list", async () => { try { - await client.api("/me/people").query("$search=j").get(); + await client + .api("/me/people") + .query("$search=j") + .get(); } catch (error) { throw error; } }); - it('Searches the people list with a topic', async () => { + it("Searches the people list with a topic", async () => { try { - await client.api("/me/people").query(`$search="topic: planning"`).get(); + await client + .api("/me/people") + .query(`$search="topic: planning"`) + .get(); } catch (error) { throw error; } }); - it('Finds items trending around me', async () => { + it("Finds items trending around me", async () => { try { - await client.api("/me/insights/trending").version("beta").get(); + await client + .api("/me/insights/trending") + .version("beta") + .get(); } catch (error) { throw error; } diff --git a/spec/development/workload/open-extensions.ts b/spec/development/workload/open-extensions.ts index eaca3d62b..72da48b2f 100644 --- a/spec/development/workload/open-extensions.ts +++ b/spec/development/workload/open-extensions.ts @@ -5,34 +5,33 @@ * ------------------------------------------------------------------------------------------- */ +import { OpenTypeExtension } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; + import { getClient, randomString } from "../test-helper"; -import { OpenTypeExtension } from '@microsoft/microsoft-graph-types'; -declare const describe, it; const client = getClient(); interface ColorOpenExtension extends OpenTypeExtension { - color: string + color: string; } -let extension = { +let extension: ColorOpenExtension = { extensionName: `com.javascript.extension-${randomString()}`, - color: randomString() -} - -describe('Open Extensions', function () { + color: randomString(), +}; +describe("Open Extensions", function() { this.timeout(10 * 1000); - it('Use open extensions to add a field to users', async () => { + it("Use open extensions to add a field to users", async () => { try { - let response = await client.api("/me/extensions").post(extension); + const response = await client.api("/me/extensions").post(extension); const createdExtension = response as ColorOpenExtension; assert.isDefined(createdExtension.id); assert.equal(createdExtension.color, extension.color); assert.equal(createdExtension.extensionName, extension.extensionName); - assert.isUndefined(createdExtension['invalidPropertyName']); + assert.isUndefined(createdExtension["random fake property that should be null"]); // save this createdExtension for later tests (id) extension = createdExtension; } catch (error) { @@ -40,7 +39,7 @@ describe('Open Extensions', function () { } }); - it('Deletes the created open extension', async () => { + it("Deletes the created open extension", async () => { try { await client.api(`/me/extensions/${extension.id}`).delete(); } catch (error) { diff --git a/spec/development/workload/users.ts b/spec/development/workload/users.ts index 390351ebb..9ac45c78f 100644 --- a/spec/development/workload/users.ts +++ b/spec/development/workload/users.ts @@ -5,20 +5,20 @@ * ------------------------------------------------------------------------------------------- */ +import { User } from "@microsoft/microsoft-graph-types"; import { assert } from "chai"; import "isomorphic-fetch"; + import { getClient, randomString } from "../test-helper"; -import { User } from '@microsoft/microsoft-graph-types'; const client = getClient(); -describe('Users', function () { - +describe("Users", function() { this.timeout(10 * 1000); - it('Fetch the authenticated user and access entity properties', async () => { + it("Fetch the authenticated user and access entity properties", async () => { try { - let res = await client.api("/me").get(); + const res = await client.api("/me").get(); const user = res as User; assert.isDefined(user.displayName); assert.isDefined(user.mail); @@ -28,16 +28,15 @@ describe('Users', function () { assert.isDefined(user.userPrincipalName); assert.isArray(user.businessPhones); - - assert.isUndefined(user['invalidPropertyName']); + assert.isUndefined(user["random fake property that should be null"]); } catch (error) { throw error; } }); - it('Fetch the authenticated user and access entity properties', async () => { + it("Fetch the authenticated user and access entity properties", async () => { try { - let res = await client.api("/me").get(); + const res = await client.api("/me").get(); const user = res as User; assert.isDefined(user.displayName); assert.isDefined(user.mail); @@ -47,19 +46,17 @@ describe('Users', function () { assert.isDefined(user.userPrincipalName); assert.isArray(user.businessPhones); - - assert.isUndefined(user['invalidPropertyName']); + assert.isUndefined(user["random fake property that should be null"]); } catch (error) { throw error; } }); - - it('Modify and verify officeLocation property', async () => { + it("Modify and verify officeLocation property", async () => { try { const officeLocation = randomString(); await client.api("/me").patch({ officeLocation }); - let res = await client.api("/me").get(); + const res = await client.api("/me").get(); const user = res as User; assert.equal(user.officeLocation, officeLocation); } catch (error) { @@ -67,12 +64,11 @@ describe('Users', function () { } }); - - it('Modify and verify givenName property', async () => { + it("Modify and verify givenName property", async () => { try { const givenName = randomString(); await client.api("/me").patch({ givenName }); - let res = await client.api("/me").get(); + const res = await client.api("/me").get(); const user = res as User; assert.equal(user.givenName, givenName); } catch (error) { @@ -80,9 +76,9 @@ describe('Users', function () { } }); - it('Fetch a list of users and access properties on a collection item', async () => { + it("Fetch a list of users and access properties on a collection item", async () => { try { - let collection = await client.api("/users").get(); + const collection = await client.api("/users").get(); const users: User[] = collection.value; assert.isDefined(users[0].displayName); assert.isDefined(users[0].id); @@ -92,12 +88,14 @@ describe('Users', function () { } }); - - it('Filters on users list', async () => { + it("Filters on users list", async () => { try { - await client.api("/users").filter("Department eq 'Finance'").get(); + await client + .api("/users") + .filter("Department eq 'Finance'") + .get(); } catch (error) { throw error; } }); -}); \ No newline at end of file +}); diff --git a/spec/middleware/AuthenticationHandler.ts b/spec/middleware/AuthenticationHandler.ts index c3668aadb..12055c22c 100644 --- a/spec/middleware/AuthenticationHandler.ts +++ b/spec/middleware/AuthenticationHandler.ts @@ -5,18 +5,21 @@ * ------------------------------------------------------------------------------------------- */ -import { AuthenticationHandler } from "../../src/middleware/AuthenticationHandler"; import { assert } from "chai"; + +import { AuthenticationHandler } from "../../src/middleware/AuthenticationHandler"; import { DummyAuthenticationProvider } from "../DummyAuthenticationProvider"; -const dummyAuthProvider = new DummyAuthenticationProvider(), - authHandler = new AuthenticationHandler(dummyAuthProvider); +const dummyAuthProvider = new DummyAuthenticationProvider(); +const authHandler = new AuthenticationHandler(dummyAuthProvider); describe("AuthenticationHandler.ts", async () => { - describe("Constructor", () => { - it("Should return an AuthenticationHandler for given AuthenticationProvider", () => { - assert.isTrue(authHandler instanceof AuthenticationHandler); - assert.equal(authHandler["authProvider"], dummyAuthProvider); - }); - }); -}); \ No newline at end of file + /* tslint:disable: no-string-literal*/ + describe("Constructor", () => { + it("Should return an AuthenticationHandler for given AuthenticationProvider", () => { + assert.isTrue(authHandler instanceof AuthenticationHandler); + assert.equal(authHandler["authProvider"], dummyAuthProvider); + }); + }); + /* tslint:enable: no-string-literal*/ +}); diff --git a/spec/middleware/MiddlewareControl.ts b/spec/middleware/MiddlewareControl.ts index 5529fc72e..8853d8ad2 100644 --- a/spec/middleware/MiddlewareControl.ts +++ b/spec/middleware/MiddlewareControl.ts @@ -10,38 +10,41 @@ */ import { assert } from "chai"; -import { DummyHandlerOption} from "../DummyHandlerOption"; import "isomorphic-fetch"; -import {MiddlewareControl} from "../../src/middleware/MiddlewareControl"; + +import { MiddlewareControl } from "../../src/middleware/MiddlewareControl"; +import { DummyHandlerOption } from "../DummyHandlerOption"; describe("MiddlewareControl.ts", () => { - const dummyHandlerOption = new DummyHandlerOption(); - describe("constructor", () => { - it("Should populate its middleware options map", () => { - const middlewareControl = new MiddlewareControl([dummyHandlerOption]); - assert.isDefined(middlewareControl["middlewareOptions"]); - assert.equal(middlewareControl["middlewareOptions"].size, 1); - }); + const dummyHandlerOption = new DummyHandlerOption(); + /* tslint:disable: no-string-literal*/ + describe("constructor", () => { + it("Should populate its middleware options map", () => { + const middlewareControl = new MiddlewareControl([dummyHandlerOption]); + assert.isDefined(middlewareControl["middlewareOptions"]); + assert.equal(middlewareControl["middlewareOptions"].size, 1); + }); - it("Should create empty middleware options map for empty middleware options array", () => { - const middlewareControl = new MiddlewareControl([]); - assert.isDefined(middlewareControl["middlewareOptions"]); - assert.equal(middlewareControl["middlewareOptions"].size, 0); - }); - }); + it("Should create empty middleware options map for empty middleware options array", () => { + const middlewareControl = new MiddlewareControl([]); + assert.isDefined(middlewareControl["middlewareOptions"]); + assert.equal(middlewareControl["middlewareOptions"].size, 0); + }); + }); + /* tslint:enable: no-string-literal*/ - describe("getMiddlewareOption", () => { - it("Should return the middleware option for a given class name", () => { - const middlewareControl = new MiddlewareControl([dummyHandlerOption]); - const retryOption: DummyHandlerOption = (middlewareControl.getMiddlewareOption(dummyHandlerOption.constructor.name) as DummyHandlerOption); - assert.isDefined(retryOption); - assert.equal(dummyHandlerOption, retryOption); - }); + describe("getMiddlewareOption", () => { + it("Should return the middleware option for a given class name", () => { + const middlewareControl = new MiddlewareControl([dummyHandlerOption]); + const retryOption: DummyHandlerOption = middlewareControl.getMiddlewareOption(dummyHandlerOption.constructor.name) as DummyHandlerOption; + assert.isDefined(retryOption); + assert.equal(dummyHandlerOption, retryOption); + }); - it("Should return undefined for unknown class name", () => { - const middlewareControl = new MiddlewareControl([dummyHandlerOption]); - const retryOption = middlewareControl.getMiddlewareOption("NotAvailableHandlerOption"); - assert.isUndefined(retryOption); - }) - }); -}); \ No newline at end of file + it("Should return undefined for unknown class name", () => { + const middlewareControl = new MiddlewareControl([dummyHandlerOption]); + const retryOption = middlewareControl.getMiddlewareOption("NotAvailableHandlerOption"); + assert.isUndefined(retryOption); + }); + }); +}); diff --git a/spec/middleware/MiddlewareUtil.ts b/spec/middleware/MiddlewareUtil.ts index 6159f5ee1..2d2e1d003 100644 --- a/spec/middleware/MiddlewareUtil.ts +++ b/spec/middleware/MiddlewareUtil.ts @@ -6,114 +6,115 @@ */ import { assert } from "chai"; + import { FetchOptions } from "../../src/IFetchOptions"; -import { setRequestHeader, getRequestHeader } from "../../src/middleware/MiddlewareUtil"; +import { getRequestHeader, setRequestHeader } from "../../src/middleware/MiddlewareUtil"; describe("MiddlewareUtil.ts", () => { - describe("setRequestHeader", () => { - const key: string = "Content-Type"; - const value: string = "application/json"; - const url = "dummy_url"; - it("Should set header in request object", () => { - const request: Request = new Request(url, { - method: "test", - headers: { - version: "version", - [key]: value - } - }); - setRequestHeader(request, undefined, key, value); - assert.equal(request.headers.get(key), value); - }); + describe("setRequestHeader", () => { + const key: string = "Content-Type"; + const value: string = "application/json"; + const url = "dummy_url"; + it("Should set header in request object", () => { + const request: Request = new Request(url, { + method: "test", + headers: { + version: "version", + [key]: value, + }, + }); + setRequestHeader(request, undefined, key, value); + assert.equal(request.headers.get(key), value); + }); - it("Should set header for empty headers", () => { - let options: FetchOptions = { - method: "test" - }; - setRequestHeader(url, options, key, value); - assert.isDefined(options.headers); - assert.equal(options.headers[key], value); - }); + it("Should set header for empty headers", () => { + const options: FetchOptions = { + method: "test", + }; + setRequestHeader(url, options, key, value); + assert.isDefined(options.headers); + assert.equal(options.headers[key], value); + }); - it("Should set header in headers object", () => { - let options: FetchOptions = { - method: "test", - headers: { - version: "version" - } - }; - setRequestHeader(url, options, key, value); - assert.equal(options.headers[key], value); - }); + it("Should set header in headers object", () => { + const options: FetchOptions = { + method: "test", + headers: { + version: "version", + }, + }; + setRequestHeader(url, options, key, value); + assert.equal(options.headers[key], value); + }); - it("Should set header in Headers instance", () => { - let options: FetchOptions = { - method: "test", - headers: new Headers({ version: "version" }) - }; - setRequestHeader(url, options, key, value); - assert.isDefined(options.headers); - assert.equal((options.headers as Headers).get(key), value); - }); + it("Should set header in Headers instance", () => { + const options: FetchOptions = { + method: "test", + headers: new Headers({ version: "version" }), + }; + setRequestHeader(url, options, key, value); + assert.isDefined(options.headers); + assert.equal((options.headers as Headers).get(key), value); + }); - it("Should set header in array of headers", () => { - let options: FetchOptions = { - method: "test", - headers: [["version", "version"]] - }; - setRequestHeader(url, options, key, value); - assert.isDefined(options.headers); - assert.equal(options.headers[1][1], value); - }); - }); + it("Should set header in array of headers", () => { + const options: FetchOptions = { + method: "test", + headers: [["version", "version"]], + }; + setRequestHeader(url, options, key, value); + assert.isDefined(options.headers); + assert.equal(options.headers[1][1], value); + }); + }); - describe("getRequestHeader", () => { - const key: string = "Content-Type"; - const value: string = "application/json"; - const url = "dummy_url"; - it("Should get header from request object", () => { - const request: Request = new Request(url, { - method: "test", - headers: { - version: "version", - [key]: value - } - }); - const headerValue: string = getRequestHeader(request, undefined, key); - assert.equal(headerValue, value); - }); + describe("getRequestHeader", () => { + const key: string = "Content-Type"; + const value: string = "application/json"; + const url = "dummy_url"; + it("Should get header from request object", () => { + const request: Request = new Request(url, { + method: "test", + headers: { + version: "version", + [key]: value, + }, + }); + const headerValue: string = getRequestHeader(request, undefined, key); + assert.equal(headerValue, value); + }); - it("Should get header from headers object", () => { - let options: FetchOptions = { - method: "test", - headers: { - version: "version", - [key]: value - } - }; - const headerValue: string = getRequestHeader(url, options, key); - assert.equal(headerValue, value); - }); + it("Should get header from headers object", () => { + const options: FetchOptions = { + method: "test", + headers: { + version: "version", + [key]: value, + }, + }; + const headerValue: string = getRequestHeader(url, options, key); + assert.equal(headerValue, value); + }); - it("Should get header from Headers instance", () => { - let options: FetchOptions = { - method: "test", - headers: new Headers({ - version: "version", - [key]: value - }) - }; - const headerValue: string = getRequestHeader(url, options, key); - assert.equal(headerValue, value); - }); + it("Should get header from Headers instance", () => { + const options: FetchOptions = { + method: "test", + headers: new Headers({ + version: "version", + [key]: value, + }), + }; + const headerValue: string = getRequestHeader(url, options, key); + assert.equal(headerValue, value); + }); - it("Should get header from array of headers", () => { - let options: FetchOptions = { - method: "test", - headers: [["version", "version"], [key, value]] - }; - const headerValue: string = getRequestHeader(url, options, key); - assert.equal(headerValue, value); - }); - }); -}); \ No newline at end of file + it("Should get header from array of headers", () => { + const options: FetchOptions = { + method: "test", + headers: [["version", "version"], [key, value]], + }; + const headerValue: string = getRequestHeader(url, options, key); + assert.equal(headerValue, value); + }); + }); +}); diff --git a/spec/package-lock.json b/spec/package-lock.json index 7d885ba6f..1e2a855a7 100644 --- a/spec/package-lock.json +++ b/spec/package-lock.json @@ -1,945 +1,945 @@ { - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@microsoft/microsoft-graph-client": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-client/-/microsoft-graph-client-1.4.0.tgz", - "integrity": "sha512-dX7053APLpIaGMGqJrDjBVX7ZO+vntKTvyB1WIy4WpC8qE3qdE68MDOq5Vv6JPG879KygPiCH2ex5RCAK+OR0Q==", - "dev": true, - "requires": { - "es6-promise": "^4.1.0", - "isomorphic-fetch": "^2.2.1" - } - }, - "@microsoft/microsoft-graph-types": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-1.6.0.tgz", - "integrity": "sha512-NAkRxtKQWj+ju0Ra36ZQDjVAoJDYvP2eHq27Fn0yAkSa7CN7EaYy7YuuSdo73Wgu2p3XJp3CYze08ub31DXbEA==", - "dev": true - }, - "@microsoft/microsoft-graph-types-beta": { - "version": "github:microsoftgraph/msgraph-typescript-typings#edccfbeb74596d2c79a54e3ba898cf0c6a8b8348", - "from": "github:microsoftgraph/msgraph-typescript-typings#beta", - "dev": true - }, - "@types/chai": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", - "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", - "dev": true - }, - "@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/isomorphic-fetch": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz", - "integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY=", - "dev": true - }, - "@types/mocha": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", - "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", - "dev": true - }, - "@types/node": { - "version": "10.12.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.19.tgz", - "integrity": "sha512-2NVovndCjJQj6fUUn9jCgpP4WSqr+u1SoUZMZyJkhGeBFsm6dE46l31S7lPUYt9uQ28XI+ibrJA1f5XyH5HNtA==", - "dev": true - }, - "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", - "dev": true - }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - }, - "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.6.tgz", - "integrity": "sha512-5M3G/A4uBSMIlfJ+h9W125vJvPFH/zirISsW5qfxF5YzEvXJCtolLoQvM5yZft0DvMcUrPGKPOlgEu55I6iUtA==", - "dev": true - } - } - }, - "acorn-walk": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", - "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", - "dev": true - }, - "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "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-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "content-type-parser": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", - "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", - "dev": true - }, - "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=", - "dev": true - }, - "cssom": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", - "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", - "dev": true - }, - "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "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 - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "dev": true, - "requires": { - "iconv-lite": "~0.4.13" - } - }, - "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", - "dev": true - }, - "escodegen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "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 - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "isomorphic-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", - "dev": true, - "requires": { - "node-fetch": "^1.0.1", - "whatwg-fetch": ">=0.10.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdom": { - "version": "11.6.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", - "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", - "dev": true, - "requires": { - "abab": "^1.0.4", - "acorn": "^5.3.0", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "browser-process-hrtime": "^0.1.2", - "content-type-parser": "^1.0.2", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": ">= 0.2.37 < 0.3.0", - "domexception": "^1.0.0", - "escodegen": "^1.9.0", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.2.0", - "nwmatcher": "^1.4.3", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.83.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.3", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-url": "^6.4.0", - "ws": "^4.0.0", - "xml-name-validator": "^3.0.0" - } - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "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 - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", - "dev": 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" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", - "dev": true - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "dev": true, - "requires": { - "mime-db": "~1.37.0" - } - }, - "msal": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/msal/-/msal-0.2.4.tgz", - "integrity": "sha512-/DPtEBL8M4gwSjEYZy4ep+j1ZaawA9XEKJi4nPxmQLT85rLNZLARrxhIRwzwXtkPNewoB+zdoNKzETW8ZrTOFQ==", - "dev": true, - "requires": { - "tslib": "1.7.1" - } - }, - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, - "nwmatcher": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", - "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "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.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "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 - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - } - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "dev": true, - "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "dev": true, - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", - "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "tslib": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", - "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "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": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "dev": true, - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", - "dev": true - }, - "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "window": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/window/-/window-4.2.5.tgz", - "integrity": "sha512-6srbDxYdfnxsw5ZwsggHLsgkuPpFb+3ja78FZSek7buVn/s19AlCMhb/WMO6hyJ8TP498kqELcRSpWg6hTpVDQ==", - "dev": true, - "requires": { - "jsdom": "11.6.2" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "ws": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0" - } - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - } - } + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@microsoft/microsoft-graph-client": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-client/-/microsoft-graph-client-1.4.0.tgz", + "integrity": "sha512-dX7053APLpIaGMGqJrDjBVX7ZO+vntKTvyB1WIy4WpC8qE3qdE68MDOq5Vv6JPG879KygPiCH2ex5RCAK+OR0Q==", + "dev": true, + "requires": { + "es6-promise": "^4.1.0", + "isomorphic-fetch": "^2.2.1" + } + }, + "@microsoft/microsoft-graph-types": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-types/-/microsoft-graph-types-1.6.0.tgz", + "integrity": "sha512-NAkRxtKQWj+ju0Ra36ZQDjVAoJDYvP2eHq27Fn0yAkSa7CN7EaYy7YuuSdo73Wgu2p3XJp3CYze08ub31DXbEA==", + "dev": true + }, + "@microsoft/microsoft-graph-types-beta": { + "version": "github:microsoftgraph/msgraph-typescript-typings#edccfbeb74596d2c79a54e3ba898cf0c6a8b8348", + "from": "github:microsoftgraph/msgraph-typescript-typings#beta", + "dev": true + }, + "@types/chai": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", + "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", + "dev": true + }, + "@types/form-data": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", + "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/isomorphic-fetch": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz", + "integrity": "sha1-PDSD5gbAQTeEOOlRRk8A5OYHBtY=", + "dev": true + }, + "@types/mocha": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "dev": true + }, + "@types/node": { + "version": "10.12.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.19.tgz", + "integrity": "sha512-2NVovndCjJQj6fUUn9jCgpP4WSqr+u1SoUZMZyJkhGeBFsm6dE46l31S7lPUYt9uQ28XI+ibrJA1f5XyH5HNtA==", + "dev": true + }, + "abab": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", + "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "dev": true + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "acorn-globals": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", + "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.6.tgz", + "integrity": "sha512-5M3G/A4uBSMIlfJ+h9W125vJvPFH/zirISsW5qfxF5YzEvXJCtolLoQvM5yZft0DvMcUrPGKPOlgEu55I6iUtA==", + "dev": true + } + } + }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, + "ajv": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", + "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "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-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "content-type-parser": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", + "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", + "dev": true + }, + "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=", + "dev": true + }, + "cssom": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", + "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", + "dev": true + }, + "cssstyle": { + "version": "0.2.37", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", + "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "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 + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "es6-promise": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", + "dev": true + }, + "escodegen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "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 + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "dev": true, + "requires": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdom": { + "version": "11.6.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", + "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", + "dev": true, + "requires": { + "abab": "^1.0.4", + "acorn": "^5.3.0", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "browser-process-hrtime": "^0.1.2", + "content-type-parser": "^1.0.2", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": ">= 0.2.37 < 0.3.0", + "domexception": "^1.0.0", + "escodegen": "^1.9.0", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.2.0", + "nwmatcher": "^1.4.3", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.83.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.3", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-url": "^6.4.0", + "ws": "^4.0.0", + "xml-name-validator": "^3.0.0" + } + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "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 + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": 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" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, + "msal": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/msal/-/msal-0.2.4.tgz", + "integrity": "sha512-/DPtEBL8M4gwSjEYZy4ep+j1ZaawA9XEKJi4nPxmQLT85rLNZLARrxhIRwzwXtkPNewoB+zdoNKzETW8ZrTOFQ==", + "dev": true, + "requires": { + "tslib": "1.7.1" + } + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "nwmatcher": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", + "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "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.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "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 + }, + "psl": { + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "tslib": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", + "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "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": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", + "dev": true + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "window": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/window/-/window-4.2.5.tgz", + "integrity": "sha512-6srbDxYdfnxsw5ZwsggHLsgkuPpFb+3ja78FZSek7buVn/s19AlCMhb/WMO6hyJ8TP498kqELcRSpWg6hTpVDQ==", + "dev": true, + "requires": { + "jsdom": "11.6.2" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "ws": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", + "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + } + } } diff --git a/spec/package.json b/spec/package.json index c90b46322..bb305ae69 100644 --- a/spec/package.json +++ b/spec/package.json @@ -1,18 +1,18 @@ { - "devDependencies": { - "@microsoft/microsoft-graph-client": "^1.3.0", - "@microsoft/microsoft-graph-types": "^1.5.0", - "@microsoft/microsoft-graph-types-beta": "microsoftgraph/msgraph-typescript-typings#beta", - "@types/chai": "^4.1.7", - "@types/form-data": "^2.2.1", - "@types/isomorphic-fetch": "0.0.34", - "@types/mocha": "^5.2.5", - "@types/node": "^10.12.19", - "chai": "^4.2.0", - "es6-promise": "^4.2.5", - "form-data": "^2.3.3", - "isomorphic-fetch": "^2.2.1", - "msal": "^0.2.3", - "window": "^4.2.5" - } + "devDependencies": { + "@microsoft/microsoft-graph-client": "^1.3.0", + "@microsoft/microsoft-graph-types": "^1.5.0", + "@microsoft/microsoft-graph-types-beta": "microsoftgraph/msgraph-typescript-typings#beta", + "@types/chai": "^4.1.7", + "@types/form-data": "^2.2.1", + "@types/isomorphic-fetch": "0.0.34", + "@types/mocha": "^5.2.5", + "@types/node": "^10.12.19", + "chai": "^4.2.0", + "es6-promise": "^4.2.5", + "form-data": "^2.3.3", + "isomorphic-fetch": "^2.2.1", + "msal": "^0.2.3", + "window": "^4.2.5" + } } diff --git a/spec/sample_files/onenotepage.html b/spec/sample_files/onenotepage.html index ba34ff547..6108a2db6 100644 --- a/spec/sample_files/onenotepage.html +++ b/spec/sample_files/onenotepage.html @@ -1,9 +1,10 @@ - - New Page - - -

Created a OneNote page from HTML

- - \ No newline at end of file + + New Page + + + +

Created a OneNote page from HTML

+ + diff --git a/spec/sample_files/onenotepage_fileattachment.html b/spec/sample_files/onenotepage_fileattachment.html index 685a7d595..38478f98c 100644 --- a/spec/sample_files/onenotepage_fileattachment.html +++ b/spec/sample_files/onenotepage_fileattachment.html @@ -1,10 +1,11 @@ - - A page with rendered file attachment - - -

Here is an attached file:

- - - \ No newline at end of file + + A page with rendered file attachment + + + +

Here is an attached file:

+ + + diff --git a/spec/tasks/LargeFileUploadTask.ts b/spec/tasks/LargeFileUploadTask.ts index 41e355228..5fd9e9a2b 100644 --- a/spec/tasks/LargeFileUploadTask.ts +++ b/spec/tasks/LargeFileUploadTask.ts @@ -6,173 +6,176 @@ */ import { assert } from "chai"; + import { LargeFileUploadTask } from "../../src/tasks/LargeFileUploadTask"; import { getClient } from "../test-helper"; -describe("LargeFileUploadTask.ts", function () { - describe('Parsing Range', () => { - let name = "sample_image.jpg", - arrayBuffer = new ArrayBuffer(80000), - size = 100000; - let fileObj = { - content: arrayBuffer, - name, - size - }; - let uploadSession = { - url: "test url", - expiry: new Date() - }; - let options = {}; - let uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); - it('Should return default range for given undefined range', (done) => { - let range = uploadTask.parseRange([]); - assert.equal(range.minValue, -1); - assert.equal(range.maxValue, -1); - done(); - }); - - it('Should return default range for given empty range', (done) => { - let range = uploadTask.parseRange([""]); - assert.equal(range.minValue, -1); - assert.equal(range.maxValue, -1); - done(); - }); +describe("LargeFileUploadTask.ts", () => { + describe("Parsing Range", () => { + const name = "sample_image.jpg"; + const arrayBuffer = new ArrayBuffer(80000); + const size = 100000; + const fileObj = { + content: arrayBuffer, + name, + size, + }; + const uploadSession = { + url: "test url", + expiry: new Date(), + }; + const options = {}; + const uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); + it("Should return default range for given undefined range", (done) => { + const range = uploadTask.parseRange([]); + assert.equal(range.minValue, -1); + assert.equal(range.maxValue, -1); + done(); + }); - it('Should return valid range for given range with from and to values', (done) => { - let range = uploadTask.parseRange(["100-200"]); - assert.equal(range.minValue, 100); - assert.equal(range.maxValue, 200); - done(); - }); + it("Should return default range for given empty range", (done) => { + const range = uploadTask.parseRange([""]); + assert.equal(range.minValue, -1); + assert.equal(range.maxValue, -1); + done(); + }); - it('Should return valid range for given range without to value', (done) => { - let range = uploadTask.parseRange(["0-"]); - assert.equal(range.minValue, 0); - assert.equal(range.maxValue, 99999); - done(); - }); - }); + it("Should return valid range for given range with from and to values", (done) => { + const range = uploadTask.parseRange(["100-200"]); + assert.equal(range.minValue, 100); + assert.equal(range.maxValue, 200); + done(); + }); - describe('Update Task Status', () => { - let name = "sample_image.jpg", - arrayBuffer = new ArrayBuffer(80000), - size = 100000; - let fileObj = { - content: arrayBuffer, - name, - size - }; - let uploadSession = { - url: "test url", - expiry: new Date() - }; - let options = {}; - let uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); - it('Should update status with expiration date and next expected ranges as given', (done) => { - let statusResponse = { - expirationDateTime: "2018-08-06T09:05:45.195Z", - nextExpectedRanges: ["100-2000"] - } - uploadTask.updateTaskStatus(statusResponse); - assert.equal(uploadTask["nextRange"].minValue, 100); - assert.equal(uploadTask["nextRange"].maxValue, 2000); - done(); - }); - it('Should update status with given expiration date and (fileSize - 1) for next expected range maxValue', (done) => { - let statusResponse = { - expirationDateTime: "2018-08-06T09:05:45.195Z", - nextExpectedRanges: ["100-"] - } - uploadTask.updateTaskStatus(statusResponse); - assert.equal(uploadTask["nextRange"].minValue, 100); - assert.equal(uploadTask["nextRange"].maxValue, 99999); - done(); - }); - }); + it("Should return valid range for given range without to value", (done) => { + const range = uploadTask.parseRange(["0-"]); + assert.equal(range.minValue, 0); + assert.equal(range.maxValue, 99999); + done(); + }); + }); + /* tslint:disable: no-string-literal*/ + describe("Update Task Status", () => { + const name = "sample_image.jpg"; + const arrayBuffer = new ArrayBuffer(80000); + const size = 100000; + const fileObj = { + content: arrayBuffer, + name, + size, + }; + const uploadSession = { + url: "test url", + expiry: new Date(), + }; + const options = {}; + const uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); + it("Should update status with expiration date and next expected ranges as given", (done) => { + const statusResponse = { + expirationDateTime: "2018-08-06T09:05:45.195Z", + nextExpectedRanges: ["100-2000"], + }; + uploadTask.updateTaskStatus(statusResponse); + assert.equal(uploadTask["nextRange"].minValue, 100); + assert.equal(uploadTask["nextRange"].maxValue, 2000); + done(); + }); + it("Should update status with given expiration date and (fileSize - 1) for next expected range maxValue", (done) => { + const statusResponse = { + expirationDateTime: "2018-08-06T09:05:45.195Z", + nextExpectedRanges: ["100-"], + }; + uploadTask.updateTaskStatus(statusResponse); + assert.equal(uploadTask["nextRange"].minValue, 100); + assert.equal(uploadTask["nextRange"].maxValue, 99999); + done(); + }); + }); + /* tslint:enable: no-string-literal*/ - describe('GetNextRange', () => { - let name = "sample_image.jpg", - arrayBuffer = new ArrayBuffer(80000), - size = 328680; - let fileObj = { - content: arrayBuffer, - name, - size - }; - let uploadSession = { - url: "test url", - expiry: new Date() - }; - let options = { - rangeSize: 327680 - }; - let uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); + describe("GetNextRange", () => { + const name = "sample_image.jpg"; + const arrayBuffer = new ArrayBuffer(80000); + const size = 328680; + const fileObj = { + content: arrayBuffer, + name, + size, + }; + const uploadSession = { + url: "test url", + expiry: new Date(), + }; + const options = { + rangeSize: 327680, + }; + const uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); - it('Should return proper next range well within the file size', (done) => { - let nextRange = uploadTask.getNextRange(); - assert.equal(nextRange.minValue, 0); - assert.equal(nextRange.maxValue, 327679); - done(); - }); + it("Should return proper next range well within the file size", (done) => { + const nextRange = uploadTask.getNextRange(); + assert.equal(nextRange.minValue, 0); + assert.equal(nextRange.maxValue, 327679); + done(); + }); - it('Should return next range maxValue equal to the file size', (done) => { - let statusResponse = { - expirationDateTime: "2018-08-06T09:05:45.195Z", - nextExpectedRanges: ["327680-"] - }; - uploadTask.updateTaskStatus(statusResponse); - let nextRange = uploadTask.getNextRange(); - assert.equal(nextRange.minValue, 327680); - assert.equal(nextRange.maxValue, 328679); - done(); - }); + it("Should return next range maxValue equal to the file size", (done) => { + const statusResponse = { + expirationDateTime: "2018-08-06T09:05:45.195Z", + nextExpectedRanges: ["327680-"], + }; + uploadTask.updateTaskStatus(statusResponse); + const nextRange = uploadTask.getNextRange(); + assert.equal(nextRange.minValue, 327680); + assert.equal(nextRange.maxValue, 328679); + done(); + }); - it('Should return next range as default(empty) range, this is for the upload task completed', (done) => { - let statusResponse = { - expirationDateTime: "2018-08-06T09:05:45.195Z", - nextExpectedRanges: [] - }; - uploadTask.updateTaskStatus(statusResponse); - let nextRange = uploadTask.getNextRange(); - assert.equal(nextRange.minValue, -1); - assert.equal(nextRange.maxValue, -1); - done(); - }); - }); + it("Should return next range as default(empty) range, this is for the upload task completed", (done) => { + const statusResponse = { + expirationDateTime: "2018-08-06T09:05:45.195Z", + nextExpectedRanges: [], + }; + uploadTask.updateTaskStatus(statusResponse); + const nextRange = uploadTask.getNextRange(); + assert.equal(nextRange.minValue, -1); + assert.equal(nextRange.maxValue, -1); + done(); + }); + }); - describe('Upload File', () => { - let name = "sample_image.jpg", - arrayBuffer = new ArrayBuffer(80000), - size = 328680; - let fileObj = { - content: arrayBuffer, - name, - size - }; - let uploadSession = { - url: "test url", - expiry: new Date() - }; - let options = { - rangeSize: 327680 - }; - let uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); - it('Should return an exception while trying to upload the file upload completed task', (done) => { - let statusResponse = { - expirationDateTime: "2018-08-06T09:05:45.195Z", - nextExpectedRanges: [] - }; - uploadTask.updateTaskStatus(statusResponse); - uploadTask.upload() - .then((res) => { - throw new Error("Upload is working for upload completed task"); - }) - .catch((err) => { - assert.equal(err.name, "Invalid Session"); - assert.equal(err.message, "Task with which you are trying to upload is already completed, Please check for your uploaded file"); - done(); - }); - }); - }); + describe("Upload File", () => { + const name = "sample_image.jpg"; + const arrayBuffer = new ArrayBuffer(80000); + const size = 328680; + const fileObj = { + content: arrayBuffer, + name, + size, + }; + const uploadSession = { + url: "test url", + expiry: new Date(), + }; + const options = { + rangeSize: 327680, + }; + const uploadTask = new LargeFileUploadTask(getClient(), fileObj, uploadSession, options); + it("Should return an exception while trying to upload the file upload completed task", (done) => { + const statusResponse = { + expirationDateTime: "2018-08-06T09:05:45.195Z", + nextExpectedRanges: [], + }; + uploadTask.updateTaskStatus(statusResponse); + uploadTask + .upload() + .then((res) => { + throw new Error("Upload is working for upload completed task"); + }) + .catch((err) => { + assert.equal(err.name, "Invalid Session"); + assert.equal(err.message, "Task with which you are trying to upload is already completed, Please check for your uploaded file"); + done(); + }); + }); + }); }); diff --git a/spec/tasks/OneDriveLargeFileUploadTask.ts b/spec/tasks/OneDriveLargeFileUploadTask.ts index 716786cad..57f1cee42 100644 --- a/spec/tasks/OneDriveLargeFileUploadTask.ts +++ b/spec/tasks/OneDriveLargeFileUploadTask.ts @@ -6,41 +6,42 @@ */ import { assert } from "chai"; + import { OneDriveLargeFileUploadTask } from "../../src/tasks/OneDriveLargeFileUploadTask"; -describe("OneDriveLargeFileUploadTask.ts", function () { - describe('constructCreateSessionUrl', () => { - let spaceFileName = " test.png "; - let fileName = "test.png"; - let specialFileName = "test file.png"; - let encodedFileName = "test%20file.png"; - - it('Should trim the extra spaces in the filename', () => { - assert.equal(`/me/drive/root:/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(spaceFileName)); - }); - - it('Should encode space in the filename', () => { - assert.equal(`/me/drive/root:/${encodedFileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(specialFileName)); - }); - - it('Should return url with default root value', () => { - assert.equal(`/me/drive/root:/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName)); - }); - - it('Should return url with default root value for an empty path string', () => { - assert.equal(`/me/drive/root:/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, "")); - }); - - it('Should add / in front of the path', () => { - assert.equal(`/me/drive/root:/Documents/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, "Documents/")); - }); - - it('Should add / in back of the path', () => { - assert.equal(`/me/drive/root:/Documents/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, "/Documents")); - }); - - it('Should trim the extra spaces in the path', () => { - assert.equal(`/me/drive/root:/Documents/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, " /Documents/ ")); - }); - }); +describe("OneDriveLargeFileUploadTask.ts", () => { + describe("constructCreateSessionUrl", () => { + const spaceFileName = " test.png "; + const fileName = "test.png"; + const specialFileName = "test file.png"; + const encodedFileName = "test%20file.png"; + + it("Should trim the extra spaces in the filename", () => { + assert.equal(`/me/drive/root:/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(spaceFileName)); + }); + + it("Should encode space in the filename", () => { + assert.equal(`/me/drive/root:/${encodedFileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(specialFileName)); + }); + + it("Should return url with default root value", () => { + assert.equal(`/me/drive/root:/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName)); + }); + + it("Should return url with default root value for an empty path string", () => { + assert.equal(`/me/drive/root:/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, "")); + }); + + it("Should add / in front of the path", () => { + assert.equal(`/me/drive/root:/Documents/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, "Documents/")); + }); + + it("Should add / in back of the path", () => { + assert.equal(`/me/drive/root:/Documents/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, "/Documents")); + }); + + it("Should trim the extra spaces in the path", () => { + assert.equal(`/me/drive/root:/Documents/${fileName}:/createUploadSession`, OneDriveLargeFileUploadTask.constructCreateSessionUrl(fileName, " /Documents/ ")); + }); + }); }); diff --git a/spec/tasks/OneDriveLargeFileUploadTaskUtil.ts b/spec/tasks/OneDriveLargeFileUploadTaskUtil.ts index be78ddb8d..09f8b92c2 100644 --- a/spec/tasks/OneDriveLargeFileUploadTaskUtil.ts +++ b/spec/tasks/OneDriveLargeFileUploadTaskUtil.ts @@ -6,25 +6,26 @@ */ import { assert } from "chai"; + import * as OneDriveLargeFileUploadTaskUtil from "../../src/tasks/OneDriveLargeFileUploadTaskUtil"; -describe("OneDriveLargeFileUploadTaskUtil", function () { - describe('getValidRangeSize', () => { - it('Should return size in multiple of 320KB for the size not a multiple of 320KB', (done) => { - assert.equal(327680, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(327685)); - done(); - }); - it('Should return same size for the size less than 320 KB', (done) => { - assert.equal(100, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(100)); - done(); - }); - it('Should return size in multiple of 320KB with max range of 60 MB for file size more than 60 MB', (done) => { - assert.equal(62914560, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(104857600)); - done(); - }); - it('Should return size in multiple of 320KB for the size multiple of 320 KB', (done) => { - assert.equal(1638400, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(1638400)); - done(); - }) - }); +describe("OneDriveLargeFileUploadTaskUtil", () => { + describe("getValidRangeSize", () => { + it("Should return size in multiple of 320KB for the size not a multiple of 320KB", (done) => { + assert.equal(327680, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(327685)); + done(); + }); + it("Should return same size for the size less than 320 KB", (done) => { + assert.equal(100, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(100)); + done(); + }); + it("Should return size in multiple of 320KB with max range of 60 MB for file size more than 60 MB", (done) => { + assert.equal(62914560, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(104857600)); + done(); + }); + it("Should return size in multiple of 320KB for the size multiple of 320 KB", (done) => { + assert.equal(1638400, OneDriveLargeFileUploadTaskUtil.getValidRangeSize(1638400)); + done(); + }); + }); }); diff --git a/spec/tasks/PageIterator.ts b/spec/tasks/PageIterator.ts index 1dbe710ed..55a80c7e7 100644 --- a/spec/tasks/PageIterator.ts +++ b/spec/tasks/PageIterator.ts @@ -6,135 +6,138 @@ */ import { assert } from "chai"; + import { Client } from "../../src/index"; import { PageIterator, PageIteratorCallback } from "../../src/tasks/PageIterator"; import { getClient } from "../test-helper"; -let client: Client = getClient(); +const client: Client = getClient(); -let value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const getPageCollection = () => { - return { - value: Object.assign([], value), - additionalContent: "additional content" - } + return { + value: [...value], + additionalContent: "additional content", + }; }; const getPageCollectionWithNext = () => { - return { - value: Object.assign([], value), - "@odata.nextLink": "nextURL", - additionalContent: "additional content" - } + return { + value: [...value], + "@odata.nextLink": "nextURL", + additionalContent: "additional content", + }; }; const getEmptyPageCollection = () => { - return { - value: [] - } + return { + value: [], + }; }; const getEmptyPageCollectionWithNext = () => { - return { - value: [], - "@odata.nextLink": "nextURL" - } + return { + value: [], + "@odata.nextLink": "nextURL", + }; }; -let truthyCallback: PageIteratorCallback = (data) => { - return true; +const truthyCallback: PageIteratorCallback = (data) => { + return true; }; let truthyCallbackCounter = 5; -let truthyCallbackWithCounter: PageIteratorCallback = (data) => { - truthyCallbackCounter--; - return true; +const truthyCallbackWithCounter: PageIteratorCallback = (data) => { + truthyCallbackCounter--; + return true; }; let halfWayCallbackCounter = 5; -let halfWayCallback: PageIteratorCallback = (data) => { - halfWayCallbackCounter--; - if (halfWayCallbackCounter === 0) { - return false; - } else { - return true; - } +const halfWayCallback: PageIteratorCallback = (data) => { + halfWayCallbackCounter--; + if (halfWayCallbackCounter === 0) { + return false; + } else { + return true; + } }; -describe("PageIterator.ts", function () { - describe("Constructor", function () { - it("Should create instance without nextLink", () => { - let pageIterator = new PageIterator(client, getPageCollection(), truthyCallback); - assert.equal(pageIterator.constructor.name, "PageIterator"); - }); - - it("Should create instance with nextLink", () => { - let pageIterator = new PageIterator(client, getPageCollectionWithNext(), truthyCallback); - assert.equal(pageIterator.constructor.name, "PageIterator"); - }); - }); - - describe("iterate", function () { - it("Should iterate over a complete collection without nextLink", async () => { - truthyCallbackCounter = 10; - let pageIterator = new PageIterator(client, getPageCollection(), truthyCallbackWithCounter); - try { - await pageIterator.iterate(); - assert.equal(truthyCallbackCounter, 0); - } catch (error) { - throw error; - } - }); - - it("Should not iterate over an empty collection", async () => { - let pageIterator = new PageIterator(client, getEmptyPageCollection(), truthyCallback); - halfWayCallbackCounter = 1; - try { - await pageIterator.iterate(); - assert.equal(halfWayCallbackCounter, 1); - } catch (error) { - throw error; - } - }); - - it("Should break in the middle way", async () => { - let pageIterator = new PageIterator(client, getPageCollection(), halfWayCallback); - halfWayCallbackCounter = 5; - try { - await pageIterator.iterate(); - assert.equal(halfWayCallbackCounter, 0); - } catch (error) { - throw error; - } - }); - }); - - describe("iterationHelper", () => { - it("Should return true for empty collection with next link", () => { - const pageIterator = new PageIterator(client, getEmptyPageCollectionWithNext(), truthyCallback); - try { - let advance = pageIterator["iterationHelper"](); - assert.isTrue(advance); - } catch(error) { - throw error; - } - }); - }); - - describe("resume", function () { - it("Should start from the place where it left the iteration", async () => { - let pageIterator = new PageIterator(client, getPageCollection(), halfWayCallback); - halfWayCallbackCounter = 5; - try { - await pageIterator.iterate(); - assert.equal(halfWayCallbackCounter, 0); - halfWayCallbackCounter = 5; - await pageIterator.resume(); - assert.equal(halfWayCallbackCounter, 0) - } catch (error) { - throw error; - } - }); - }); -}); \ No newline at end of file +describe("PageIterator.ts", () => { + describe("Constructor", () => { + it("Should create instance without nextLink", () => { + const pageIterator = new PageIterator(client, getPageCollection(), truthyCallback); + assert.equal(pageIterator.constructor.name, "PageIterator"); + }); + + it("Should create instance with nextLink", () => { + const pageIterator = new PageIterator(client, getPageCollectionWithNext(), truthyCallback); + assert.equal(pageIterator.constructor.name, "PageIterator"); + }); + }); + + describe("iterate", () => { + it("Should iterate over a complete collection without nextLink", async () => { + truthyCallbackCounter = 10; + const pageIterator = new PageIterator(client, getPageCollection(), truthyCallbackWithCounter); + try { + await pageIterator.iterate(); + assert.equal(truthyCallbackCounter, 0); + } catch (error) { + throw error; + } + }); + + it("Should not iterate over an empty collection", async () => { + const pageIterator = new PageIterator(client, getEmptyPageCollection(), truthyCallback); + halfWayCallbackCounter = 1; + try { + await pageIterator.iterate(); + assert.equal(halfWayCallbackCounter, 1); + } catch (error) { + throw error; + } + }); + + it("Should break in the middle way", async () => { + const pageIterator = new PageIterator(client, getPageCollection(), halfWayCallback); + halfWayCallbackCounter = 5; + try { + await pageIterator.iterate(); + assert.equal(halfWayCallbackCounter, 0); + } catch (error) { + throw error; + } + }); + }); + + /* tslint:disable: no-string-literal*/ + describe("iterationHelper", () => { + it("Should return true for empty collection with next link", () => { + const pageIterator = new PageIterator(client, getEmptyPageCollectionWithNext(), truthyCallback); + try { + const advance = pageIterator["iterationHelper"](); + assert.isTrue(advance); + } catch (error) { + throw error; + } + }); + }); + /* tslint:enable: no-string-literal*/ + + describe("resume", () => { + it("Should start from the place where it left the iteration", async () => { + const pageIterator = new PageIterator(client, getPageCollection(), halfWayCallback); + halfWayCallbackCounter = 5; + try { + await pageIterator.iterate(); + assert.equal(halfWayCallbackCounter, 0); + halfWayCallbackCounter = 5; + await pageIterator.resume(); + assert.equal(halfWayCallbackCounter, 0); + } catch (error) { + throw error; + } + }); + }); +}); diff --git a/spec/test-helper.ts b/spec/test-helper.ts index e3e20b36b..5f7fc23bf 100644 --- a/spec/test-helper.ts +++ b/spec/test-helper.ts @@ -5,20 +5,23 @@ * ------------------------------------------------------------------------------------------- */ -import { DummyAuthenticationProvider } from "./DummyAuthenticationProvider"; import { Client } from "../src/index"; import * as PolyFill from "../src/PolyFill"; +import { DummyAuthenticationProvider } from "./DummyAuthenticationProvider"; + export function getClient(): Client { - /** - * PolyFill fetch and promise before initializing client, otherwise error will be thrown - */ - PolyFill.init(); - return Client.initWithMiddleware({ - authProvider: new DummyAuthenticationProvider() - }); + /** + * PolyFill fetch and promise before initializing client, otherwise error will be thrown + */ + PolyFill.init(); + return Client.initWithMiddleware({ + authProvider: new DummyAuthenticationProvider(), + }); } export function randomString() { - return Math.random().toString(36).substring(7); + return Math.random() + .toString(36) + .substring(7); } diff --git a/spec/tsconfig.json b/spec/tsconfig.json index 70f0cc5fa..108666559 100644 --- a/spec/tsconfig.json +++ b/spec/tsconfig.json @@ -1,13 +1,13 @@ { - "compilerOptions": { - "module": "commonjs", - "noEmitOnError": true, - "noImplicitAny": false, - "moduleResolution": "node", - "removeComments": true, - "sourceMap": true, - "target": "es6", - "lib": ["es7", "dom"], - "declaration": true - } + "compilerOptions": { + "module": "commonjs", + "noEmitOnError": true, + "noImplicitAny": false, + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "target": "es6", + "lib": ["es7", "dom"], + "declaration": true + } } diff --git a/src/Client.ts b/src/Client.ts index 6aa7f8252..0cd9b04c8 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -12,107 +12,104 @@ import { GRAPH_API_VERSION, GRAPH_BASE_URL } from "./Constants"; import { CustomAuthenticationProvider } from "./CustomAuthenticationProvider"; import { GraphRequest } from "./GraphRequest"; -import { HTTPClientFactory } from "./HTTPClientFactory"; import { HTTPClient } from "./HTTPClient"; +import { HTTPClientFactory } from "./HTTPClientFactory"; import { ClientOptions } from "./IClientOptions"; import { Options } from "./IOptions"; import { validatePolyFilling } from "./ValidatePolyFilling"; export class Client { + /** + * @private + * A member which stores the Client instance options + */ + private config: ClientOptions = { + baseUrl: GRAPH_BASE_URL, + debugLogging: false, + defaultVersion: GRAPH_API_VERSION, + }; - /** - * @private - * A member which stores the Client instance options - */ - private config: ClientOptions = { - baseUrl: GRAPH_BASE_URL, - debugLogging: false, - defaultVersion: GRAPH_API_VERSION - }; - - /** - * @private - * A member which holds the HTTPClient instance - */ - private httpClient: HTTPClient; + /** + * @private + * A member which holds the HTTPClient instance + */ + private httpClient: HTTPClient; - /** - * @private - * @constructor - * Creates an instance of Client - * @param {ClientOptions} clientOptions - The options to instantiate the client object - */ - private constructor(clientOptions: ClientOptions) { - try { - validatePolyFilling(); - } catch (error) { - throw error; - } - let self = this; - for (const key in clientOptions) { - self.config[key] = clientOptions[key]; - } - let httpClient: HTTPClient; - if(clientOptions.authProvider !== undefined && clientOptions.middleware !== undefined) { - const error = new Error(); - error.name = "AmbiguityInInitialization"; - error.message = "Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain not both"; - throw error; - } else if (clientOptions.authProvider !== undefined) { - httpClient = HTTPClientFactory.createWithAuthenticationProvider(clientOptions.authProvider); - } else if (clientOptions.middleware !== undefined) { - httpClient = new HTTPClient(clientOptions.middleware); - } else { - let error = new Error(); - error.name = "InvalidMiddlewareChain"; - error.message = "Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain"; - throw error; - } - self.httpClient = httpClient; - } + /** + * @public + * @static + * To create a client instance with options and initializes the default middleware chain + * @param {Options} options - The options for client instance + * @returns The Client instance + */ + public static init(options: Options): Client { + const clientOptions: ClientOptions = {}; + for (const i in options) { + if (options.hasOwnProperty(i)) { + clientOptions[i] = i === "authProvider" ? new CustomAuthenticationProvider(options[i]) : options[i]; + } + } + return Client.initWithMiddleware(clientOptions); + } - /** - * @public - * @static - * To create a client instance with options and initializes the default middleware chain - * @param {Options} options - The options for client instance - * @returns The Client instance - */ - public static init(options: Options): Client { - let clientOptions: ClientOptions = {}; - for (const i in options) { - if (i === "authProvider") { - clientOptions[i] = new CustomAuthenticationProvider(options[i]); - } else { - clientOptions[i] = options[i]; - } - } - return Client.initWithMiddleware(clientOptions); - } + /** + * @public + * @static + * To create a client instance with the Client Options + * @param {ClientOptions} clientOptions - The options object for initializing the client + * @returns The Client instance + */ + public static initWithMiddleware(clientOptions: ClientOptions): Client { + try { + return new Client(clientOptions); + } catch (error) { + throw error; + } + } - /** - * @public - * @static - * To create a client instance with the Client Options - * @param {ClientOptions} clientOptions - The options object for initializing the client - * @returns The Client instance - */ - public static initWithMiddleware(clientOptions: ClientOptions): Client { - try { - return new Client(clientOptions); - } catch (error) { - throw error; - } - } + /** + * @private + * @constructor + * Creates an instance of Client + * @param {ClientOptions} clientOptions - The options to instantiate the client object + */ + private constructor(clientOptions: ClientOptions) { + try { + validatePolyFilling(); + } catch (error) { + throw error; + } + for (const key in clientOptions) { + if (clientOptions.hasOwnProperty(key)) { + this.config[key] = clientOptions[key]; + } + } + let httpClient: HTTPClient; + if (clientOptions.authProvider !== undefined && clientOptions.middleware !== undefined) { + const error = new Error(); + error.name = "AmbiguityInInitialization"; + error.message = "Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain not both"; + throw error; + } else if (clientOptions.authProvider !== undefined) { + httpClient = HTTPClientFactory.createWithAuthenticationProvider(clientOptions.authProvider); + } else if (clientOptions.middleware !== undefined) { + httpClient = new HTTPClient(clientOptions.middleware); + } else { + const error = new Error(); + error.name = "InvalidMiddlewareChain"; + error.message = "Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain"; + throw error; + } + this.httpClient = httpClient; + } - /** - * @public - * Entry point to make requests - * @param {string} path - The path string value - * @returns The graph request instance - */ - public api(path: string): GraphRequest { - let self = this; - return new GraphRequest(self.httpClient, self.config, path); - } + /** + * @public + * Entry point to make requests + * @param {string} path - The path string value + * @returns The graph request instance + */ + public api(path: string): GraphRequest { + return new GraphRequest(this.httpClient, this.config, path); + } } diff --git a/src/CustomAuthenticationProvider.ts b/src/CustomAuthenticationProvider.ts index 4dbf68eed..58b7eb9f1 100644 --- a/src/CustomAuthenticationProvider.ts +++ b/src/CustomAuthenticationProvider.ts @@ -18,39 +18,38 @@ import { AuthProvider } from "./IAuthProvider"; * @extends AuthenticationProvider */ export class CustomAuthenticationProvider implements AuthenticationProvider { + /** + * @private + * A member to hold authProvider callback + */ + private provider: AuthProvider; - /** - * @private - * A member to hold authProvider callback - */ - private provider: AuthProvider; + /** + * @public + * @constructor + * Creates an instance of CustomAuthenticationProvider + * @param {AuthProviderCallback} provider - An authProvider function + * @returns An instance of CustomAuthenticationProvider + */ + public constructor(provider: AuthProvider) { + this.provider = provider; + } - /** - * @public - * @constructor - * Creates an instance of CustomAuthenticationProvider - * @param {AuthProviderCallback} provider - An authProvider function - * @returns An instance of CustomAuthenticationProvider - */ - public constructor(provider: AuthProvider) { - this.provider = provider; - } - - /** - * @public - * @async - * To get the access token - * @returns The promise that resolves to an access token - */ - public async getAccessToken(): Promise { - return new Promise((resolve: Function, reject: Function) => { - this.provider((error: any, accessToken: string | null) => { - if (accessToken) { - resolve(accessToken); - } else { - reject(error); - } - }); - }); - } + /** + * @public + * @async + * To get the access token + * @returns The promise that resolves to an access token + */ + public async getAccessToken(): Promise { + return new Promise((resolve: (accessToken: string) => void, reject: (error: any) => void) => { + this.provider((error: any, accessToken: string | null) => { + if (accessToken) { + resolve(accessToken); + } else { + reject(error); + } + }); + }); + } } diff --git a/src/GraphError.ts b/src/GraphError.ts index e4506f353..08dc7bde2 100644 --- a/src/GraphError.ts +++ b/src/GraphError.ts @@ -18,57 +18,55 @@ */ export class GraphError { + /** + * @public + * A member holding status code of the error + */ + public statusCode: number; - /** - * @public - * A member holding status code of the error - */ - public statusCode: number; + /** + * @public + * A member holding code i.e name of the error + */ + public code: string | null; - /** - * @public - * A member holding code i.e name of the error - */ - public code: string | null; + /** + * @public + * A member holding error message + */ + public message: string | null; - /** - * @public - * A member holding error message - */ - public message: string | null; + /** + * @public + * A member holding request-id i.e identifier of the request + */ + public requestId: string | null; - /** - * @public - * A member holding request-id i.e identifier of the request - */ - public requestId: string | null; + /** + * @public + * A member holding processed date and time of the request + */ + public date: Date; - /** - * @public - * A member holding processed date and time of the request - */ - public date: Date; + /** + * @public + * A member holding original error response by the graph service + */ + public body: any; - /** - * @public - * A member holding original error response by the graph service - */ - public body: any; - - /** - * @public - * @constructor - * Creates an instance of GraphError - * @param {number} [statusCode = -1] - The status code of the error - * @returns An instance of GraphError - */ - public constructor(statusCode: number = -1) { - let self = this; - self.statusCode = statusCode; - self.code = null; - self.message = null; - self.requestId = null; - self.date = new Date(); - self.body = null; - } + /** + * @public + * @constructor + * Creates an instance of GraphError + * @param {number} [statusCode = -1] - The status code of the error + * @returns An instance of GraphError + */ + public constructor(statusCode: number = -1) { + this.statusCode = statusCode; + this.code = null; + this.message = null; + this.requestId = null; + this.date = new Date(); + this.body = null; + } } diff --git a/src/GraphErrorHandler.ts b/src/GraphErrorHandler.ts index 67aabe95f..3795b5580 100644 --- a/src/GraphErrorHandler.ts +++ b/src/GraphErrorHandler.ts @@ -18,86 +18,84 @@ import { GraphRequestCallback } from "./IGraphRequestCallback"; */ export class GraphErrorHandler { + /** + * @private + * @static + * Populates the GraphError instance with Error instance values + * @param {Error} error - The error returned by graph service or some native error + * @param {number} [statusCode] - The status code of the response + * @returns The GraphError instance + */ + private static constructError(error: Error, statusCode?: number): GraphError { + const gError = new GraphError(statusCode); + if (error.name !== undefined) { + gError.code = error.name; + } + gError.body = error.toString(); + gError.message = error.message; + gError.date = new Date(); + return gError; + } - /** - * @private - * @static - * Populates the GraphError instance with Error instance values - * @param {Error} error - The error returned by graph service or some native error - * @param {number} [statusCode] - The status code of the response - * @returns The GraphError instance - */ - private static constructError(error: Error, statusCode?: number): GraphError { - let gError = new GraphError(statusCode); - if (error.name !== undefined) { - gError.code = error.name; - } - gError.body = error.toString(); - gError.message = error.message; - gError.date = new Date(); - return gError; - } + /** + * @private + * @static + * Populates the GraphError instance from the Error returned by graph service + * @param {any} error - The error returned by graph service or some native error + * @param {number} statusCode - The status code of the response + * @returns The GraphError instance + * + * Example error for https://graph.microsoft.com/v1.0/me/events?$top=3&$search=foo + * { + * "error": { + * "code": "SearchEvents", + * "message": "The parameter $search is not currently supported on the Events resource.", + * "innerError": { + * "request-id": "b31c83fd-944c-4663-aa50-5d9ceb367e19", + * "date": "2016-11-17T18:37:45" + * } + * } + * } + */ + private static constructErrorFromResponse(error: any, statusCode: number): GraphError { + error = error.error; + const gError = new GraphError(statusCode); + gError.code = error.code; + gError.message = error.message; + if (error.innerError !== undefined) { + gError.requestId = error.innerError["request-id"]; + gError.date = new Date(error.innerError.date); + } + try { + gError.body = JSON.stringify(error); + } catch (error) { + // tslint:disable-line: no-empty + } + return gError; + } - /** - * @private - * @static - * Populates the GraphError instance from the Error returned by graph service - * @param {any} error - The error returned by graph service or some native error - * @param {number} statusCode - The status code of the response - * @returns The GraphError instance - * - * Example error for https://graph.microsoft.com/v1.0/me/events?$top=3&$search=foo - * { - * "error": { - * "code": "SearchEvents", - * "message": "The parameter $search is not currently supported on the Events resource.", - * "innerError": { - * "request-id": "b31c83fd-944c-4663-aa50-5d9ceb367e19", - * "date": "2016-11-17T18:37:45" - * } - * } - * } - */ - private static constructErrorFromResponse(error: any, statusCode: number): GraphError { - error = error.error; - let gError = new GraphError(statusCode); - gError.code = error.code; - gError.message = error.message; - if (error.innerError !== undefined) { - gError.requestId = error.innerError["request-id"]; - gError.date = new Date(error.innerError.date); - } - try { - gError.body = JSON.stringify(error); - } catch (error) { - - } - return gError; - } - - /** - * @public - * @static - * To get the GraphError object - * @param {any} [error = null] - The error returned by graph service or some native error - * @param {number} [statusCode = -1] - The status code of the response - * @param {GraphRequestCallback} [callback] - The graph request callback function - * @returns The GraphError instance - */ - public static getError(error: any = null, statusCode: number = -1, callback?: GraphRequestCallback): GraphError { - let gError: GraphError; - if (error && error.error) { - gError = GraphErrorHandler.constructErrorFromResponse(error, statusCode); - } else if (error instanceof Error) { - gError = GraphErrorHandler.constructError(error, statusCode); - } else { - gError = new GraphError(statusCode); - } - if (typeof callback === "function") { - callback(gError, null); - } else { - return gError; - } - } + /** + * @public + * @static + * To get the GraphError object + * @param {any} [error = null] - The error returned by graph service or some native error + * @param {number} [statusCode = -1] - The status code of the response + * @param {GraphRequestCallback} [callback] - The graph request callback function + * @returns The GraphError instance + */ + public static getError(error: any = null, statusCode: number = -1, callback?: GraphRequestCallback): GraphError { + let gError: GraphError; + if (error && error.error) { + gError = GraphErrorHandler.constructErrorFromResponse(error, statusCode); + } else if (error instanceof Error) { + gError = GraphErrorHandler.constructError(error, statusCode); + } else { + gError = new GraphError(statusCode); + } + if (typeof callback === "function") { + callback(gError, null); + } else { + return gError; + } + } } - diff --git a/src/GraphRequest.ts b/src/GraphRequest.ts index 64f711f73..2258ab09a 100644 --- a/src/GraphRequest.ts +++ b/src/GraphRequest.ts @@ -10,17 +10,17 @@ */ import { PACKAGE_VERSION } from "./Constants"; -import { GraphErrorHandler } from "./GraphErrorHandler"; import { GraphError } from "./GraphError"; -import { oDataQueryNames, urlJoin, serializeContent } from "./GraphRequestUtil"; +import { GraphErrorHandler } from "./GraphErrorHandler"; +import { oDataQueryNames, serializeContent, urlJoin } from "./GraphRequestUtil"; import { GraphResponseHandler } from "./GraphResponseHandler"; import { HTTPClient } from "./HTTPClient"; import { ClientOptions } from "./IClientOptions"; import { Context } from "./IContext"; -import { GraphRequestCallback } from "./IGraphRequestCallback"; import { FetchOptions } from "./IFetchOptions"; -import { MiddlewareOption } from "./middleware/option/IMiddlewareOption"; +import { GraphRequestCallback } from "./IGraphRequestCallback"; import { MiddlewareControl } from "./middleware/MiddlewareControl"; +import { MiddlewareOption } from "./middleware/option/IMiddlewareOption"; import { RequestMethod } from "./RequestMethod"; import { ResponseType } from "./ResponseType"; @@ -30,14 +30,14 @@ import { ResponseType } from "./ResponseType"; * @property {[key: string] : string | number} - The Key value pair */ interface KeyValuePairObjectStringNumber { - [key: string]: string | number; + [key: string]: string | number; } /** * @interface * Signature to define URL components * @template http://graph.microsoft.com/VERSION/PATH?QUERYSTRING&OTHER_QUERY_PARAMS - * + * * @property {string} host - The host to which the request needs to be made * @property {string} version - Version of the graph endpoint * @property {string} [path] - The path of the resource request @@ -45,11 +45,11 @@ interface KeyValuePairObjectStringNumber { * @property {KeyValuePairObjectStringNumber} otherURLQueryParams - The other query params for a request */ export interface URLComponents { - host: string; - version: string; - path?: string; - oDataQueryParams: KeyValuePairObjectStringNumber; - otherURLQueryParams: KeyValuePairObjectStringNumber; + host: string; + version: string; + path?: string; + oDataQueryParams: KeyValuePairObjectStringNumber; + otherURLQueryParams: KeyValuePairObjectStringNumber; } /** @@ -57,683 +57,676 @@ export interface URLComponents { * A Class representing GraphRequest */ export class GraphRequest { - - /** - * @private - * A member variable to hold HTTPClient instance - */ - private httpClient: HTTPClient; - - /** - * @private - * A member variable to hold client options - */ - private config: ClientOptions; - - /** - * @private - * A member to hold URL Components data - */ - private urlComponents: URLComponents; - - /** - * @private - * A member to hold custom header options for a request - */ - private _headers: { - [key: string]: string; - }; - - /** - * @private - * A member to hold custom options for a request - */ - private _options: FetchOptions; - - /** - * @private - * A member to hold the array of middleware options for a request - */ - private _middlewareOptions: MiddlewareOption[]; - - /** - * @private - * A member to hold custom response type for a request - */ - private _responseType: ResponseType; - - /** - * @public - * @constructor - * Creates an instance of GraphRequest - * @param {HTTPClient} httpClient - The HTTPClient instance - * @param {ClientOptions} config - The options for making request - * @param {string} path - A path string - */ - public constructor(httpClient: HTTPClient, config: ClientOptions, path: string) { - let self = this; - self.httpClient = httpClient; - self.config = config; - self.urlComponents = { - host: self.config.baseUrl, - version: self.config.defaultVersion, - oDataQueryParams: {}, - otherURLQueryParams: {} - }; - self._headers = {}; - self._options = {}; - self._middlewareOptions = []; - self.parsePath(path); - } - - /** - * @private - * Parses the path string and creates URLComponents out of it - * @param {string} path - The request path string - * @returns Nothing - */ - private parsePath = (path: string): void => { - let self = this; - - //Strips out the base of the url if they passed in - if (path.indexOf("https://") !== -1) { - path = path.replace("https://", ""); - - // Find where the host ends - let endOfHostStrPos = path.indexOf("/"); - if (endOfHostStrPos !== -1) { - // Parse out the host - self.urlComponents.host = "https://" + path.substring(0, endOfHostStrPos); - // Strip the host from path - path = path.substring(endOfHostStrPos + 1, path.length); - } - - // Remove the following version - let endOfVersionStrPos = path.indexOf("/"); - if (endOfVersionStrPos !== -1) { - // Parse out the version - self.urlComponents.version = path.substring(0, endOfVersionStrPos); - // Strip version from path - path = path.substring(endOfVersionStrPos + 1, path.length); - } - } - - // Strip out any leading "/" - if (path.charAt(0) === "/") { - path = path.substr(1); - } - - let queryStrPos = path.indexOf("?"); - if (queryStrPos === -1) { - // No query string - self.urlComponents.path = path; - } else { - self.urlComponents.path = path.substr(0, queryStrPos); - - // Capture query string into oDataQueryParams and otherURLQueryParams - let queryParams = path.substring(queryStrPos + 1, path.length).split("&"); - for (let queryParam of queryParams) { - let queryParams = queryParam.split("="), - key = queryParams[0], - value = queryParams[1]; - if (oDataQueryNames.indexOf(key) !== -1) { - self.urlComponents.oDataQueryParams[key] = value; - } else { - self.urlComponents.otherURLQueryParams[key] = value; - } - } - } - } - - /** - * @public - * Sets the custom header for a request - * @param {string} headerKey - A header key - * @param {string} headerValue - A header value - * @returns The same GraphRequest instance that is being called with - */ - public header(headerKey: string, headerValue: string): GraphRequest { - let self = this; - self._headers[headerKey] = headerValue; - return self; - } - - /** - * @public - * Sets the custom headers for a request - * @param {KeyValuePairObjectStringNumber} headers - The headers key value pair object - * @returns The same GraphRequest instance that is being called with - */ - public headers(headers: KeyValuePairObjectStringNumber): GraphRequest { - let self = this; - for (let key in headers) { - self._headers[key] = headers[key]; - } - return self; - } - - /** - * @public - * Sets the option for making a request - * @param {string} key - The key value - * @param {any} value - The value - * @returns The same GraphRequest instance that is being called with - */ - public option(key: string, value: any): GraphRequest { - let self = this; - self._options[key] = value; - return self; - } - - /** - * @public - * Sets the options for making a request - * @param {{ [key: string]: any }} options - The options key value pair - * @returns The same GraphRequest instance that is being called with - */ - public options(options: { [key: string]: any }): GraphRequest { - let self = this; - for (let key in options) { - self._options[key] = options[key]; - } - return self; - } - - /** - * @public - * Sets the middleware options for a request - * @param {MiddlewareOption[]} options - The array of middleware options - * @returns The same GraphRequest instance that is being called with - */ - public middlewareOptions(options: MiddlewareOption[]): GraphRequest { - let self = this; - self._middlewareOptions = options; - return self; - } - - /** - * @public - * Sets the api endpoint version for a request - * @param {string} version - The version value - * @returns The same GraphRequest instance that is being called with - */ - public version(version: string): GraphRequest { - let self = this; - self.urlComponents.version = version; - return self; - } - - /** - * @public - * Sets the api endpoint version for a request - * @param {ResponseType} responseType - The response type value - * @returns The same GraphRequest instance that is being called with - */ - public responseType(responseType: ResponseType): GraphRequest { - let self = this; - self._responseType = responseType; - return self; - } - - /** - * @private - * Adds the query parameter as comma separated values - * @param {string} propertyName - The name of a property - * @param {string|string[]} propertyValue - The vale of a property - * @param {IArguments} additionalProperties - The additional properties - * @returns Nothing - */ - private addCsvQueryParameter(propertyName: string, propertyValue: string | string[], additionalProperties: IArguments): void { - // If there are already $propertyName value there, append a "," - this.urlComponents.oDataQueryParams[propertyName] = this.urlComponents.oDataQueryParams[propertyName] ? this.urlComponents.oDataQueryParams[propertyName] + "," : ""; - - let allValues: string[] = []; - - if (additionalProperties.length > 1 && typeof propertyValue === "string") { - allValues = Array.prototype.slice.call(additionalProperties); - } else if (typeof propertyValue === "string") { - allValues.push(propertyValue); - } else { - allValues = allValues.concat(propertyValue); - } - - this.urlComponents.oDataQueryParams[propertyName] += allValues.join(","); - } - - /** - * @public - * To add properties for select OData Query param - * @param {string|string[]} properties - The Properties value - * @returns The same GraphRequest instance that is being called with - */ - /* - * Accepts .select("displayName,birthday") - * and .select(["displayName", "birthday"]) - * and .select("displayName", "birthday") - * - */ - public select(properties: string | string[]): GraphRequest { - let self = this; - self.addCsvQueryParameter("$select", properties, arguments); - return self; - } - - /** - * @public - * To add properties for expand OData Query param - * @param {string|string[]} properties - The Properties value - * @returns The same GraphRequest instance that is being called with - */ - public expand(properties: string | string[]): GraphRequest { - let self = this; - self.addCsvQueryParameter("$expand", properties, arguments); - return self; - } - - /** - * @public - * To add properties for orderby OData Query param - * @param {string|string[]} properties - The Properties value - * @returns The same GraphRequest instance that is being called with - */ - public orderby(properties: string | string[]): GraphRequest { - let self = this; - self.addCsvQueryParameter("$orderby", properties, arguments); - return self; - } - - /** - * @public - * To add query string for filter OData Query param - * @param {string} filterStr - The filter query string - * @returns The same GraphRequest instance that is being called with - */ - public filter(filterStr: string): GraphRequest { - let self = this; - self.urlComponents.oDataQueryParams["$filter"] = filterStr; - return self; - } - - /** - * @public - * To add criterion for search OData Query param - * @param {string} searchStr - The search criterion string - * @returns The same GraphRequest instance that is being called with - */ - public search(searchStr: string): GraphRequest { - let self = this; - self.urlComponents.oDataQueryParams["$search"] = searchStr; - return self; - } - - /** - * @public - * To add number for top OData Query param - * @param {number} n - The number value - * @returns The same GraphRequest instance that is being called with - */ - public top(n: number): GraphRequest { - let self = this; - self.urlComponents.oDataQueryParams["$top"] = n; - return self; - } - - /** - * @public - * To add number for skip OData Query param - * @param {number} n - The number value - * @returns The same GraphRequest instance that is being called with - */ - public skip(n: number): GraphRequest { - let self = this; - self.urlComponents.oDataQueryParams["$skip"] = n; - return self; - } - - /** - * @public - * To add token string for skipToken OData Query param - * @param {string} token - The token value - * @returns The same GraphRequest instance that is being called with - */ - public skipToken(token: string): GraphRequest { - let self = this; - self.urlComponents.oDataQueryParams["$skipToken"] = token; - return self; - } - - /** - * @public - * To add boolean for count OData Query param - * @param {boolean} isCount - The count boolean - * @returns The same GraphRequest instance that is being called with - */ - public count(isCount: boolean): GraphRequest { - let self = this; - self.urlComponents.oDataQueryParams["$count"] = isCount.toString(); - return self; - } - - /** - * @public - * Appends query string to the urlComponent - * @param {string|KeyValuePairObjectStringNumber} queryDictionaryOrString - The query value - * @returns The same GraphRequest instance that is being called with - */ - public query(queryDictionaryOrString: string | KeyValuePairObjectStringNumber): GraphRequest { - let self = this, - otherURLQueryParams = self.urlComponents.otherURLQueryParams; - if (typeof queryDictionaryOrString === "string") { - let querySplit = queryDictionaryOrString.split("="), - queryKey = querySplit[0], - queryValue = querySplit[1]; - otherURLQueryParams[queryKey] = queryValue; - } else { - for (let key in queryDictionaryOrString) { - otherURLQueryParams[key] = queryDictionaryOrString[key]; - } - } - return self; - } - - /** - * @private - * Builds the full url from the URLComponents to make a request - * @returns The URL string that is qualified to make a request to graph endpoint - */ - private buildFullUrl(): string { - let self = this; - let url = urlJoin([self.urlComponents.host, - self.urlComponents.version, - self.urlComponents.path]) - + self.createQueryString() - - if (self.config.debugLogging) { - console.log(url) - } - return url; - } - - /** - * @private - * Builds the query string from the URLComponents - * @returns The Constructed query string - */ - private createQueryString(): string { - // Combining query params from oDataQueryParams and otherURLQueryParams - let urlComponents = this.urlComponents, - query: string[] = []; - if (Object.keys(urlComponents.oDataQueryParams).length !== 0) { - for (let property in urlComponents.oDataQueryParams) { - query.push(property + "=" + urlComponents.oDataQueryParams[property]); - } - } - if (Object.keys(urlComponents.otherURLQueryParams).length !== 0) { - for (let property in urlComponents.otherURLQueryParams) { - query.push(property + "=" + urlComponents.otherURLQueryParams[property]); - } - } - return (query.length > 0) ? "?" + query.join("&") : ""; - } - - /** - * @private - * Updates the custom headers and options for a request - * @param {FetchOptions} options - The request options object - * @returns Nothing - */ - private updateRequestOptions(options: FetchOptions): void { - let self = this, - defaultHeaders = { - SdkVersion: `graph-js-${PACKAGE_VERSION}` - }, - optionsHeaders: HeadersInit = Object.assign({}, options.headers); - if (self.config.fetchOptions !== undefined) { - let fetchOptions: FetchOptions = Object.assign({}, self.config.fetchOptions); - Object.assign(options, fetchOptions); - if (typeof self.config.fetchOptions.headers !== undefined) { - options.headers = Object.assign({}, self.config.fetchOptions.headers); - } - } - Object.assign(options, self._options); - Object.assign(optionsHeaders, defaultHeaders); - if (options.headers !== undefined) { - Object.assign(optionsHeaders, options.headers); - } - Object.assign(optionsHeaders, self._headers); - options.headers = optionsHeaders; - } - - /** - * @private - * @async - * Adds the custom headers and options to the request and makes the HTTPClient send request call - * @param {RequestInfo} request - The request url string or the Request object value - * @param {FetchOptions} options - The options to make a request - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the response content - */ - private async send(request: RequestInfo, options: FetchOptions, callback?: GraphRequestCallback): Promise { - let self = this, - rawResponse: Response, - middlewareControl = new MiddlewareControl(self._middlewareOptions); - self.updateRequestOptions(options); - try { - let context: Context = await self.httpClient.sendRequest({ - request, - options, - middlewareControl - }), - rawResponse = context.response; - let response: any = await GraphResponseHandler.getResponse(rawResponse, self._responseType, callback); - return response; - } catch (error) { - let statusCode: number; - if (typeof rawResponse !== "undefined") { - statusCode = rawResponse.status; - } - let gError: GraphError = GraphErrorHandler.getError(error, statusCode, callback); - throw gError; - } - } - - /** - * @public - * @async - * Makes a http request with GET method - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the get response - */ - public async get(callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options: FetchOptions = { - method: RequestMethod.GET - }; - try { - let response = await self.send(url, options, callback); - return response; - } catch (error) { - throw error; - } - } - - /** - * @public - * @async - * Makes a http request with POST method - * @param {any} content - The content that needs to be sent with the request - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the post response - */ - public async post(content: any, callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options: FetchOptions = { - method: RequestMethod.POST, - body: serializeContent(content), - headers: (content.constructor !== undefined && content.constructor.name === "FormData") ? {} : { - "Content-Type": "application/json" - } - }; - try { - let response = await self.send(url, options, callback); - return response; - } catch (error) { - throw error; - } - } - - /** - * @public - * @async - * Alias for Post request call - * @param {any} content - The content that needs to be sent with the request - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the post response - */ - public async create(content: any, callback?: GraphRequestCallback): Promise { - return await this.post(content, callback); - } - - /** - * @public - * @async - * Makes http request with PUT method - * @param {any} content - The content that needs to be sent with the request - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the put response - */ - public async put(content: any, callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options: FetchOptions = { - method: RequestMethod.PUT, - body: serializeContent(content) - }; - try { - let response = await self.send(url, options, callback); - return response; - } catch (error) { - throw error; - } - } - - /** - * @public - * @async - * Makes http request with PATCH method - * @param {any} content - The content that needs to be sent with the request - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the patch response - */ - public async patch(content: any, callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options: FetchOptions = { - method: RequestMethod.PATCH, - body: serializeContent(content), - headers: { - "Content-Type": "application/json" - } - }; - try { - let response = await self.send(url, options, callback); - return response; - } catch (error) { - throw error; - } - } - - /** - * @public - * @async - * Alias for PATCH request - * @param {any} content - The content that needs to be sent with the request - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the patch response - */ - public async update(content: any, callback?: GraphRequestCallback): Promise { - return await this.patch(content, callback); - } - - /** - * @public - * @async - * Makes http request with DELETE method - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the delete response - */ - public async delete(callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options: FetchOptions = { - method: RequestMethod.DELETE - }; - try { - let response = await self.send(url, options, callback); - return response; - } catch (error) { - throw error - } - } - - /** - * @public - * @async - * Alias for delete request call - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the delete response - */ - public async del(callback?: GraphRequestCallback): Promise { - return await this.delete(callback); - } - - /** - * @public - * @async - * Makes a http request with GET method to read response as a stream. - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the getStream response - */ - public async getStream(callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options = { - method: RequestMethod.GET - }; - self.responseType(ResponseType.STREAM); - try { - let stream = await self.send(url, options, callback); - return stream; - } catch (error) { - throw error; - } - } - - /** - * @public - * @async - * Makes a http request with GET method to read response as a stream. - * @param {any} stream - The stream instance - * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call - * @returns A promise that resolves to the putStream response - */ - public async putStream(stream: any, callback?: GraphRequestCallback): Promise { - let self = this, - url = self.buildFullUrl(), - options = { - method: RequestMethod.PUT, - headers: { - "Content-Type": "application/octet-stream", - }, - body: stream - }; - try { - let response = await self.send(url, options, callback); - return response; - } catch (error) { - throw error; - } - } + /** + * @private + * A member variable to hold HTTPClient instance + */ + private httpClient: HTTPClient; + + /** + * @private + * A member variable to hold client options + */ + private config: ClientOptions; + + /** + * @private + * A member to hold URL Components data + */ + private urlComponents: URLComponents; + + /* tslint:disable: variable-name */ + /** + * @private + * A member to hold custom header options for a request + */ + private _headers: { + [key: string]: string; + }; + + /** + * @private + * A member to hold custom options for a request + */ + private _options: FetchOptions; + + /** + * @private + * A member to hold the array of middleware options for a request + */ + private _middlewareOptions: MiddlewareOption[]; + + /** + * @private + * A member to hold custom response type for a request + */ + private _responseType: ResponseType; + /* tslint:enable: variable-name */ + + /** + * @public + * @constructor + * Creates an instance of GraphRequest + * @param {HTTPClient} httpClient - The HTTPClient instance + * @param {ClientOptions} config - The options for making request + * @param {string} path - A path string + */ + public constructor(httpClient: HTTPClient, config: ClientOptions, path: string) { + this.httpClient = httpClient; + this.config = config; + this.urlComponents = { + host: this.config.baseUrl, + version: this.config.defaultVersion, + oDataQueryParams: {}, + otherURLQueryParams: {}, + }; + this._headers = {}; + this._options = {}; + this._middlewareOptions = []; + this.parsePath(path); + } + + /** + * @private + * Parses the path string and creates URLComponents out of it + * @param {string} path - The request path string + * @returns Nothing + */ + private parsePath = (path: string): void => { + // Strips out the base of the url if they passed in + if (path.indexOf("https://") !== -1) { + path = path.replace("https://", ""); + + // Find where the host ends + const endOfHostStrPos = path.indexOf("/"); + if (endOfHostStrPos !== -1) { + // Parse out the host + this.urlComponents.host = "https://" + path.substring(0, endOfHostStrPos); + // Strip the host from path + path = path.substring(endOfHostStrPos + 1, path.length); + } + + // Remove the following version + const endOfVersionStrPos = path.indexOf("/"); + if (endOfVersionStrPos !== -1) { + // Parse out the version + this.urlComponents.version = path.substring(0, endOfVersionStrPos); + // Strip version from path + path = path.substring(endOfVersionStrPos + 1, path.length); + } + } + + // Strip out any leading "/" + if (path.charAt(0) === "/") { + path = path.substr(1); + } + + const queryStrPos = path.indexOf("?"); + if (queryStrPos === -1) { + // No query string + this.urlComponents.path = path; + } else { + this.urlComponents.path = path.substr(0, queryStrPos); + + // Capture query string into oDataQueryParams and otherURLQueryParams + const queryParams = path.substring(queryStrPos + 1, path.length).split("&"); + for (const queryParam of queryParams) { + const qParams = queryParam.split("="); + const key = qParams[0]; + const value = qParams[1]; + if (oDataQueryNames.indexOf(key) !== -1) { + this.urlComponents.oDataQueryParams[key] = value; + } else { + this.urlComponents.otherURLQueryParams[key] = value; + } + } + } + }; + + /** + * @private + * Adds the query parameter as comma separated values + * @param {string} propertyName - The name of a property + * @param {string|string[]} propertyValue - The vale of a property + * @param {IArguments} additionalProperties - The additional properties + * @returns Nothing + */ + private addCsvQueryParameter(propertyName: string, propertyValue: string | string[], additionalProperties: IArguments): void { + // If there are already $propertyName value there, append a "," + this.urlComponents.oDataQueryParams[propertyName] = this.urlComponents.oDataQueryParams[propertyName] ? this.urlComponents.oDataQueryParams[propertyName] + "," : ""; + + let allValues: string[] = []; + + if (additionalProperties.length > 1 && typeof propertyValue === "string") { + allValues = Array.prototype.slice.call(additionalProperties); + } else if (typeof propertyValue === "string") { + allValues.push(propertyValue); + } else { + allValues = allValues.concat(propertyValue); + } + + this.urlComponents.oDataQueryParams[propertyName] += allValues.join(","); + } + + /** + * @private + * Builds the full url from the URLComponents to make a request + * @returns The URL string that is qualified to make a request to graph endpoint + */ + private buildFullUrl(): string { + const url = urlJoin([this.urlComponents.host, this.urlComponents.version, this.urlComponents.path]) + this.createQueryString(); + + if (this.config.debugLogging) { + console.log(url); // tslint:disable-line: no-console + } + return url; + } + + /** + * @private + * Builds the query string from the URLComponents + * @returns The Constructed query string + */ + private createQueryString(): string { + // Combining query params from oDataQueryParams and otherURLQueryParams + const urlComponents = this.urlComponents; + const query: string[] = []; + if (Object.keys(urlComponents.oDataQueryParams).length !== 0) { + for (const property in urlComponents.oDataQueryParams) { + if (urlComponents.oDataQueryParams.hasOwnProperty(property)) { + query.push(property + "=" + urlComponents.oDataQueryParams[property]); + } + } + } + if (Object.keys(urlComponents.otherURLQueryParams).length !== 0) { + for (const property in urlComponents.otherURLQueryParams) { + if (urlComponents.otherURLQueryParams.hasOwnProperty(property)) { + query.push(property + "=" + urlComponents.otherURLQueryParams[property]); + } + } + } + return query.length > 0 ? "?" + query.join("&") : ""; + } + + /** + * @private + * Updates the custom headers and options for a request + * @param {FetchOptions} options - The request options object + * @returns Nothing + */ + private updateRequestOptions(options: FetchOptions): void { + const defaultHeaders = { + SdkVersion: `graph-js-${PACKAGE_VERSION}`, + }; + const optionsHeaders: HeadersInit = { ...options.headers }; + if (this.config.fetchOptions !== undefined) { + const fetchOptions: FetchOptions = { ...this.config.fetchOptions }; + Object.assign(options, fetchOptions); + if (typeof this.config.fetchOptions.headers !== undefined) { + options.headers = { ...this.config.fetchOptions.headers }; + } + } + Object.assign(options, this._options); + Object.assign(optionsHeaders, defaultHeaders); + if (options.headers !== undefined) { + Object.assign(optionsHeaders, options.headers); + } + Object.assign(optionsHeaders, this._headers); + options.headers = optionsHeaders; + } + + /** + * @private + * @async + * Adds the custom headers and options to the request and makes the HTTPClient send request call + * @param {RequestInfo} request - The request url string or the Request object value + * @param {FetchOptions} options - The options to make a request + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the response content + */ + private async send(request: RequestInfo, options: FetchOptions, callback?: GraphRequestCallback): Promise { + let rawResponse: Response; + const middlewareControl = new MiddlewareControl(this._middlewareOptions); + this.updateRequestOptions(options); + try { + const context: Context = await this.httpClient.sendRequest({ + request, + options, + middlewareControl, + }); + rawResponse = context.response; + const response: any = await GraphResponseHandler.getResponse(rawResponse, this._responseType, callback); + return response; + } catch (error) { + let statusCode: number; + if (typeof rawResponse !== "undefined") { + statusCode = rawResponse.status; + } + const gError: GraphError = GraphErrorHandler.getError(error, statusCode, callback); + throw gError; + } + } + + /** + * @public + * Sets the custom header for a request + * @param {string} headerKey - A header key + * @param {string} headerValue - A header value + * @returns The same GraphRequest instance that is being called with + */ + public header(headerKey: string, headerValue: string): GraphRequest { + this._headers[headerKey] = headerValue; + return this; + } + + /** + * @public + * Sets the custom headers for a request + * @param {KeyValuePairObjectStringNumber} headers - The headers key value pair object + * @returns The same GraphRequest instance that is being called with + */ + public headers(headers: KeyValuePairObjectStringNumber): GraphRequest { + for (const key in headers) { + if (headers.hasOwnProperty(key)) { + this._headers[key] = headers[key] as string; + } + } + return this; + } + + /** + * @public + * Sets the option for making a request + * @param {string} key - The key value + * @param {any} value - The value + * @returns The same GraphRequest instance that is being called with + */ + public option(key: string, value: any): GraphRequest { + this._options[key] = value; + return this; + } + + /** + * @public + * Sets the options for making a request + * @param {{ [key: string]: any }} options - The options key value pair + * @returns The same GraphRequest instance that is being called with + */ + public options(options: { [key: string]: any }): GraphRequest { + for (const key in options) { + if (options.hasOwnProperty(key)) { + this._options[key] = options[key]; + } + } + return this; + } + + /** + * @public + * Sets the middleware options for a request + * @param {MiddlewareOption[]} options - The array of middleware options + * @returns The same GraphRequest instance that is being called with + */ + public middlewareOptions(options: MiddlewareOption[]): GraphRequest { + this._middlewareOptions = options; + return this; + } + + /** + * @public + * Sets the api endpoint version for a request + * @param {string} version - The version value + * @returns The same GraphRequest instance that is being called with + */ + public version(version: string): GraphRequest { + this.urlComponents.version = version; + return this; + } + + /** + * @public + * Sets the api endpoint version for a request + * @param {ResponseType} responseType - The response type value + * @returns The same GraphRequest instance that is being called with + */ + public responseType(responseType: ResponseType): GraphRequest { + this._responseType = responseType; + return this; + } + + /** + * @public + * To add properties for select OData Query param + * @param {string|string[]} properties - The Properties value + * @returns The same GraphRequest instance that is being called with + */ + /* + * Accepts .select("displayName,birthday") + * and .select(["displayName", "birthday"]) + * and .select("displayName", "birthday") + * + */ + public select(properties: string | string[]): GraphRequest { + this.addCsvQueryParameter("$select", properties, arguments); + return this; + } + + /** + * @public + * To add properties for expand OData Query param + * @param {string|string[]} properties - The Properties value + * @returns The same GraphRequest instance that is being called with + */ + public expand(properties: string | string[]): GraphRequest { + this.addCsvQueryParameter("$expand", properties, arguments); + return this; + } + + /** + * @public + * To add properties for orderby OData Query param + * @param {string|string[]} properties - The Properties value + * @returns The same GraphRequest instance that is being called with + */ + public orderby(properties: string | string[]): GraphRequest { + this.addCsvQueryParameter("$orderby", properties, arguments); + return this; + } + + /** + * @public + * To add query string for filter OData Query param + * @param {string} filterStr - The filter query string + * @returns The same GraphRequest instance that is being called with + */ + public filter(filterStr: string): GraphRequest { + this.urlComponents.oDataQueryParams.$filter = filterStr; + return this; + } + + /** + * @public + * To add criterion for search OData Query param + * @param {string} searchStr - The search criterion string + * @returns The same GraphRequest instance that is being called with + */ + public search(searchStr: string): GraphRequest { + this.urlComponents.oDataQueryParams.$search = searchStr; + return this; + } + + /** + * @public + * To add number for top OData Query param + * @param {number} n - The number value + * @returns The same GraphRequest instance that is being called with + */ + public top(n: number): GraphRequest { + this.urlComponents.oDataQueryParams.$top = n; + return this; + } + + /** + * @public + * To add number for skip OData Query param + * @param {number} n - The number value + * @returns The same GraphRequest instance that is being called with + */ + public skip(n: number): GraphRequest { + this.urlComponents.oDataQueryParams.$skip = n; + return this; + } + + /** + * @public + * To add token string for skipToken OData Query param + * @param {string} token - The token value + * @returns The same GraphRequest instance that is being called with + */ + public skipToken(token: string): GraphRequest { + this.urlComponents.oDataQueryParams.$skipToken = token; + return this; + } + + /** + * @public + * To add boolean for count OData Query param + * @param {boolean} isCount - The count boolean + * @returns The same GraphRequest instance that is being called with + */ + public count(isCount: boolean): GraphRequest { + this.urlComponents.oDataQueryParams.$count = isCount.toString(); + return this; + } + + /** + * @public + * Appends query string to the urlComponent + * @param {string|KeyValuePairObjectStringNumber} queryDictionaryOrString - The query value + * @returns The same GraphRequest instance that is being called with + */ + public query(queryDictionaryOrString: string | KeyValuePairObjectStringNumber): GraphRequest { + const otherURLQueryParams = this.urlComponents.otherURLQueryParams; + if (typeof queryDictionaryOrString === "string") { + const querySplit = queryDictionaryOrString.split("="); + const queryKey = querySplit[0]; + const queryValue = querySplit[1]; + otherURLQueryParams[queryKey] = queryValue; + } else { + for (const key in queryDictionaryOrString) { + if (queryDictionaryOrString.hasOwnProperty(key)) { + otherURLQueryParams[key] = queryDictionaryOrString[key]; + } + } + } + return this; + } + + /** + * @public + * @async + * Makes a http request with GET method + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the get response + */ + public async get(callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options: FetchOptions = { + method: RequestMethod.GET, + }; + try { + const response = await this.send(url, options, callback); + return response; + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Makes a http request with POST method + * @param {any} content - The content that needs to be sent with the request + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the post response + */ + public async post(content: any, callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options: FetchOptions = { + method: RequestMethod.POST, + body: serializeContent(content), + headers: + content.constructor !== undefined && content.constructor.name === "FormData" + ? {} + : { + "Content-Type": "application/json", + }, + }; + try { + const response = await this.send(url, options, callback); + return response; + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Alias for Post request call + * @param {any} content - The content that needs to be sent with the request + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the post response + */ + public async create(content: any, callback?: GraphRequestCallback): Promise { + try { + return await this.post(content, callback); + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Makes http request with PUT method + * @param {any} content - The content that needs to be sent with the request + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the put response + */ + public async put(content: any, callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options: FetchOptions = { + method: RequestMethod.PUT, + body: serializeContent(content), + }; + try { + const response = await this.send(url, options, callback); + return response; + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Makes http request with PATCH method + * @param {any} content - The content that needs to be sent with the request + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the patch response + */ + public async patch(content: any, callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options: FetchOptions = { + method: RequestMethod.PATCH, + body: serializeContent(content), + headers: { + "Content-Type": "application/json", + }, + }; + try { + const response = await this.send(url, options, callback); + return response; + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Alias for PATCH request + * @param {any} content - The content that needs to be sent with the request + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the patch response + */ + public async update(content: any, callback?: GraphRequestCallback): Promise { + try { + return await this.patch(content, callback); + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Makes http request with DELETE method + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the delete response + */ + public async delete(callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options: FetchOptions = { + method: RequestMethod.DELETE, + }; + try { + const response = await this.send(url, options, callback); + return response; + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Alias for delete request call + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the delete response + */ + public async del(callback?: GraphRequestCallback): Promise { + try { + return await this.delete(callback); + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Makes a http request with GET method to read response as a stream. + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the getStream response + */ + public async getStream(callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options = { + method: RequestMethod.GET, + }; + this.responseType(ResponseType.STREAM); + try { + const stream = await this.send(url, options, callback); + return stream; + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * Makes a http request with GET method to read response as a stream. + * @param {any} stream - The stream instance + * @param {GraphRequestCallback} [callback] - The callback function to be called in response with async call + * @returns A promise that resolves to the putStream response + */ + public async putStream(stream: any, callback?: GraphRequestCallback): Promise { + const url = this.buildFullUrl(); + const options = { + method: RequestMethod.PUT, + headers: { + "Content-Type": "application/octet-stream", + }, + body: stream, + }; + try { + const response = await this.send(url, options, callback); + return response; + } catch (error) { + throw error; + } + } } diff --git a/src/GraphRequestUtil.ts b/src/GraphRequestUtil.ts index d8280207c..7518952d2 100644 --- a/src/GraphRequestUtil.ts +++ b/src/GraphRequestUtil.ts @@ -20,18 +20,19 @@ export const oDataQueryNames = ["$select", "$expand", "$orderby", "$filter", "$t * @returns The constructed URL string */ export const urlJoin = (urlSegments: string[]): string => { - const removePostSlash = (s) => s.replace(/\/+$/, ''), - removePreSlash = (s) => s.replace(/^\/+/, ''), - joiner = (pre, cur) => [removePostSlash(pre), removePreSlash(cur)].join('/'), - parts = Array.prototype.slice.call(urlSegments); - return parts.reduce(joiner); -} + const removePostSlash = (s) => s.replace(/\/+$/, ""); + const removePreSlash = (s) => s.replace(/^\/+/, ""); + const joiner = (pre, cur) => [removePostSlash(pre), removePreSlash(cur)].join("/"); + const parts = Array.prototype.slice.call(urlSegments); + return parts.reduce(joiner); +}; -/** +/* tslint:disable: max-line-length */ +/** * Serializes the content * @param {any} content - The content value that needs to be serialized * @returns The serialized content - * + * * Note: * This conversion is required due to the following reasons: * Body parameter of Request method of isomorphic-fetch only accepts Blob, ArrayBuffer, FormData, TypedArrays string. @@ -41,24 +42,21 @@ export const urlJoin = (urlSegments: string[]): string => { */ export const serializeContent = (content: any): any => { - let className: string = content.constructor.name; - if (className === 'Buffer' - || className === 'Blob' - || className === 'File' - || className === 'FormData' - || typeof content === 'string') { - return content; - } - if (className === 'ArrayBuffer') { - content = Buffer.from(content); - } else if (className === 'Int8Array' || className === 'Int16Array' || className === 'Int32Array' || className === 'Uint8Array' || className === 'Uint16Array' || className === 'Uint32Array' || className === 'Uint8ClampedArray' || className === 'Float32Array' || className === 'Float64Array' || className === 'DataView') { - content = Buffer.from(content.buffer); - } else { - try { - content = JSON.stringify(content); - } catch (error) { - throw new Error("Unable to stringify the content"); - } - } - return content; -} + const className: string = content.constructor.name; + if (className === "Buffer" || className === "Blob" || className === "File" || className === "FormData" || typeof content === "string") { + return content; + } + if (className === "ArrayBuffer") { + content = Buffer.from(content); + } else if (className === "Int8Array" || className === "Int16Array" || className === "Int32Array" || className === "Uint8Array" || className === "Uint16Array" || className === "Uint32Array" || className === "Uint8ClampedArray" || className === "Float32Array" || className === "Float64Array" || className === "DataView") { + content = Buffer.from(content.buffer); + } else { + try { + content = JSON.stringify(content); + } catch (error) { + throw new Error("Unable to stringify the content"); + } + } + return content; +}; +/* tslint:enable: max-line-length */ diff --git a/src/GraphResponseHandler.ts b/src/GraphResponseHandler.ts index 3ec510288..21646b179 100644 --- a/src/GraphResponseHandler.ts +++ b/src/GraphResponseHandler.ts @@ -21,10 +21,10 @@ import { ResponseType } from "./ResponseType"; * @property {string} APPLICATION_XHTML - The application/xhml+xml content type */ enum DocumentType { - TEXT_HTML = "text/html", - TEXT_XML = "text/xml", - APPLICATION_XML = "application/xml", - APPLICATION_XHTML = "application/xhtml+xml" + TEXT_HTML = "text/html", + TEXT_XML = "text/xml", + APPLICATION_XML = "application/xml", + APPLICATION_XHTML = "application/xhtml+xml", } /** @@ -33,136 +33,134 @@ enum DocumentType { */ export class GraphResponseHandler { + /** + * @private + * @static + * A member holding array of document types + */ + private static DocumentTypes: string[] = ["text/html", "text/xml", "application/xml", "application/xhtml+xml"]; - /** - * @private - * @static - * A member holding array of document types - */ - private static DocumentTypes: string[] = ["text/html", "text/xml", "application/xml", "application/xhtml+xml"]; + /** + * @private + * @static + * To parse Document response + * @param {Response} rawResponse - The response object + * @param {DocumentType} type - The type to which the document needs to be parsed + * @returns A promise that resolves to a document content + */ + private static parseDocumentResponse(rawResponse: Response, type: DocumentType): Promise { + if (typeof DOMParser !== "undefined") { + return new Promise((resolve, reject) => { + rawResponse.text().then((xmlString) => { + try { + const parser = new DOMParser(); + const xmlDoc = parser.parseFromString(xmlString, type); + resolve(xmlDoc); + } catch (error) { + reject(error); + } + }); + }); + } else { + return Promise.resolve(rawResponse.body); + } + } - /** - * @private - * @static - * To parse Document response - * @param {Response} rawResponse - The response object - * @param {DocumentType} type - The type to which the document needs to be parsed - * @returns A promise that resolves to a document content - */ - private static parseDocumentResponse(rawResponse: Response, type: DocumentType): Promise { - if (typeof DOMParser !== "undefined") { - return new Promise((resolve, reject) => { - rawResponse.text().then((xmlString) => { - try { - let parser = new DOMParser(), - xmlDoc = parser.parseFromString(xmlString, type); - resolve(xmlDoc); - } catch (error) { - reject(error); - } - }); - }); - } else { - return Promise.resolve(rawResponse.body); - } - } + /** + * @private + * @static + * @async + * To convert the native Response to response content + * @param {Response} rawResponse - The response object + * @param {ResponseType} [responseType] - The response type value + * @returns A promise that resolves to the converted response content + */ + private static async convertResponse(rawResponse: Response, responseType?: ResponseType): Promise { + if (responseType === ResponseType.RAW) { + return Promise.resolve(rawResponse); + } + if (rawResponse.status === 204) { + // NO CONTENT + return Promise.resolve(); + } + let responseValue: any; + try { + switch (responseType) { + case ResponseType.ARRAYBUFFER: + responseValue = await rawResponse.arrayBuffer(); + break; + case ResponseType.BLOB: + responseValue = await rawResponse.blob(); + break; + case ResponseType.DOCUMENT: + responseValue = await GraphResponseHandler.parseDocumentResponse(rawResponse, DocumentType.TEXT_XML); + break; + case ResponseType.JSON: + responseValue = await rawResponse.json(); + break; + case ResponseType.STREAM: + responseValue = await Promise.resolve(rawResponse.body); + break; + case ResponseType.TEXT: + responseValue = await rawResponse.text(); + break; + default: + const contentType = rawResponse.headers.get("Content-type"); + if (contentType !== null) { + const mimeType = contentType.split(";")[0]; + responseValue = GraphResponseHandler.DocumentTypes.includes(mimeType) ? await GraphResponseHandler.parseDocumentResponse(rawResponse, mimeType as DocumentType) : await rawResponse.json(); + } else { + /** + * RFC specification {@link https://tools.ietf.org/html/rfc7231#section-3.1.1.5} says: + * A sender that generates a message containing a payload body SHOULD + * generate a Content-Type header field in that message unless the + * intended media type of the enclosed representation is unknown to the + * sender. If a Content-Type header field is not present, the recipient + * MAY either assume a media type of "application/octet-stream" + * ([RFC2046], Section 4.5.1) or examine the data to determine its type. + * + * So assuming it as a stream type so returning the body. + */ + responseValue = Promise.resolve(rawResponse.body); + } + break; + } + } catch (error) { + if (typeof responseType !== "undefined" && responseType !== ResponseType.JSON) { + responseValue = await rawResponse.json(); + } else { + throw error; + } + } + return responseValue; + } - /** - * @private - * @static - * @async - * To convert the native Response to response content - * @param {Response} rawResponse - The response object - * @param {ResponseType} [responseType] - The response type value - * @returns A promise that resolves to the converted response content - */ - private static async convertResponse(rawResponse: Response, responseType?: ResponseType): Promise { - if (responseType === ResponseType.RAW) { - return Promise.resolve(rawResponse); - } - if (rawResponse.status === 204) { //NO CONTENT - return Promise.resolve(); - } - let responseValue: any; - try { - switch (responseType) { - case ResponseType.ARRAYBUFFER: - responseValue = await rawResponse.arrayBuffer(); - break; - case ResponseType.BLOB: - responseValue = await rawResponse.blob(); - break; - case ResponseType.DOCUMENT: - responseValue = await GraphResponseHandler.parseDocumentResponse(rawResponse, DocumentType.TEXT_XML); - break; - case ResponseType.JSON: - responseValue = await rawResponse.json(); - break; - case ResponseType.STREAM: - responseValue = await Promise.resolve(rawResponse.body); - break; - case ResponseType.TEXT: - responseValue = await rawResponse.text(); - break; - default: - let contentType = rawResponse.headers.get("Content-type"); - if (contentType !== null) { - let mimeType = contentType.split(";")[0]; - if (GraphResponseHandler.DocumentTypes.includes(mimeType)) { - responseValue = await GraphResponseHandler.parseDocumentResponse(rawResponse, mimeType as DocumentType); - } else { - responseValue = await rawResponse.json(); - } - } else { - /** - * RFC specification {@link https://tools.ietf.org/html/rfc7231#section-3.1.1.5} says: - * A sender that generates a message containing a payload body SHOULD - * generate a Content-Type header field in that message unless the - * intended media type of the enclosed representation is unknown to the - * sender. If a Content-Type header field is not present, the recipient - * MAY either assume a media type of "application/octet-stream" - * ([RFC2046], Section 4.5.1) or examine the data to determine its type. - * - * So assuming it as a stream type so returning the body. - */ - responseValue = Promise.resolve(rawResponse.body); - } - break; - } - } catch (error) { - if (typeof responseType !== "undefined" && responseType !== ResponseType.JSON) { - responseValue = await rawResponse.json(); - } else { - throw error; - } - } - return responseValue; - } - - /** - * @public - * @static - * @async - * To get the parsed response - * @param {Response} rawResponse - The response object - * @param {ResponseType} [responseType] - The response type value - * @param {GraphRequestCallback} [callback] - The graph request callback function - * @returns The parsed response - */ - public static async getResponse(rawResponse: Response, responseType?: ResponseType, callback?: GraphRequestCallback): Promise { - try { - let response = await GraphResponseHandler.convertResponse(rawResponse, responseType); - if (rawResponse.ok) { // Status Code 2XX - if (typeof callback === "function") { - callback(null, response, rawResponse); - } else { - return response; - } - } else { //NOT OK Response - throw response; - } - } catch (error) { - throw error; - } - } + /** + * @public + * @static + * @async + * To get the parsed response + * @param {Response} rawResponse - The response object + * @param {ResponseType} [responseType] - The response type value + * @param {GraphRequestCallback} [callback] - The graph request callback function + * @returns The parsed response + */ + public static async getResponse(rawResponse: Response, responseType?: ResponseType, callback?: GraphRequestCallback): Promise { + try { + const response = await GraphResponseHandler.convertResponse(rawResponse, responseType); + if (rawResponse.ok) { + // Status Code 2XX + if (typeof callback === "function") { + callback(null, response, rawResponse); + } else { + return response; + } + } else { + // NOT OK Response + throw response; + } + } catch (error) { + throw error; + } + } } diff --git a/src/HTTPClient.ts b/src/HTTPClient.ts index 4cf9dfa47..870325e71 100644 --- a/src/HTTPClient.ts +++ b/src/HTTPClient.ts @@ -17,42 +17,41 @@ import { Middleware } from "./middleware/IMiddleware"; * Class representing HTTPClient */ export class HTTPClient { + /** + * @private + * A member holding first middleware of the middleware chain + */ + private middleware: Middleware; - /** - * @private - * A member holding first middleware of the middleware chain - */ - private middleware: Middleware; + /** + * @public + * @constructor + * Creates an instance of a HTTPClient + * @param {Middleware} middleware - The first middleware of the middleware chain + */ + public constructor(middleware: Middleware) { + this.middleware = middleware; + } - /** - * @public - * @constructor - * Creates an instance of a HTTPClient - * @param {Middleware} middleware - The first middleware of the middleware chain - */ - public constructor(middleware: Middleware) { - this.middleware = middleware; - } - - /** - * @public - * @async - * To send the request through the middleware chain - * @param {Context} context - The context of a request - * @returns A promise that resolves to the Context - */ - public async sendRequest(context: Context): Promise { - try { - if (!(context.request instanceof Request) && context.options === undefined) { - const error = new Error(); - error.name = "InvalidRequestOptions"; - error.message = "Unable to execute the middleware, Please provide valid options for a request"; - throw error; - } - await this.middleware.execute(context); - return context; - } catch (error) { - throw error; - } - } + /** + * @public + * @async + * To send the request through the middleware chain + * @param {Context} context - The context of a request + * @returns A promise that resolves to the Context + */ + public async sendRequest(context: Context): Promise { + try { + if (!(context.request instanceof Request) && context.options === undefined) { + const error = new Error(); + error.name = "InvalidRequestOptions"; + error.message = "Unable to execute the middleware, Please provide valid options for a request"; + throw error; + } + await this.middleware.execute(context); + return context; + } catch (error) { + throw error; + } + } } diff --git a/src/HTTPClientFactory.ts b/src/HTTPClientFactory.ts index 401c74f2e..b21d2c3b8 100644 --- a/src/HTTPClientFactory.ts +++ b/src/HTTPClientFactory.ts @@ -9,10 +9,10 @@ * @module HTTPClientFactory */ -import { AuthenticationHandler } from "./middleware/AuthenticationHandler"; -import { HTTPMessageHandler } from "./middleware/HTTPMessageHandler"; import { HTTPClient } from "./HTTPClient"; import { AuthenticationProvider } from "./IAuthenticationProvider"; +import { AuthenticationHandler } from "./middleware/AuthenticationHandler"; +import { HTTPMessageHandler } from "./middleware/HTTPMessageHandler"; import { Middleware } from "./middleware/IMiddleware"; /** @@ -20,29 +20,28 @@ import { Middleware } from "./middleware/IMiddleware"; * Class representing HTTPClientFactory */ export class HTTPClientFactory { + /** + * @public + * @static + * Creates HTTPClient with default middleware chain + * @param {AuthenticationProvider} authProvider - The authentication provider instance + * @returns A HTTPClient instance + */ + public static createWithAuthenticationProvider(authProvider: AuthenticationProvider): HTTPClient { + const authenticationHandler = new AuthenticationHandler(authProvider); + const httpMessageHandler = new HTTPMessageHandler(); + authenticationHandler.setNext(httpMessageHandler); + return HTTPClientFactory.createWithMiddleware(authenticationHandler); + } - /** - * @public - * @static - * Creates HTTPClient with default middleware chain - * @param {AuthenticationProvider} authProvider - The authentication provider instance - * @returns A HTTPClient instance - */ - public static createWithAuthenticationProvider(authProvider: AuthenticationProvider): HTTPClient { - const authenticationHandler = new AuthenticationHandler(authProvider); - const httpMessageHandler = new HTTPMessageHandler(); - authenticationHandler.setNext(httpMessageHandler); - return HTTPClientFactory.createWithMiddleware(authenticationHandler); - } - - /** - * @public - * @static - * Creates a middleware chain with the given one - * @param {Middleware} middleware - The first middleware of the middleware chain - * @returns A HTTPClient instance - */ - static createWithMiddleware(middleware: Middleware): HTTPClient { - return new HTTPClient(middleware); - } + /** + * @public + * @static + * Creates a middleware chain with the given one + * @param {Middleware} middleware - The first middleware of the middleware chain + * @returns A HTTPClient instance + */ + public static createWithMiddleware(middleware: Middleware): HTTPClient { + return new HTTPClient(middleware); + } } diff --git a/src/IAuthProvider.ts b/src/IAuthProvider.ts index 8f466da52..452a978d8 100644 --- a/src/IAuthProvider.ts +++ b/src/IAuthProvider.ts @@ -12,6 +12,4 @@ import { AuthProviderCallback } from "./IAuthProviderCallback"; * Signature that holds authProvider * @callback - The anonymous callback function which takes a single param */ -export interface AuthProvider { - (done: AuthProviderCallback): void; -} \ No newline at end of file +export type AuthProvider = (done: AuthProviderCallback) => void; diff --git a/src/IAuthProviderCallback.ts b/src/IAuthProviderCallback.ts index 6ca1e70e9..9fc008493 100644 --- a/src/IAuthProviderCallback.ts +++ b/src/IAuthProviderCallback.ts @@ -10,6 +10,4 @@ * Signature that defines callback for an authentication provider * @callback - The anonymous callback function which takes two params */ -export interface AuthProviderCallback { - (error: any, accessToken: string | null): void; -} \ No newline at end of file +export type AuthProviderCallback = (error: any, accessToken: string | null) => void; diff --git a/src/IAuthenticationProvider.ts b/src/IAuthenticationProvider.ts index 5953cff6f..5208cac55 100644 --- a/src/IAuthenticationProvider.ts +++ b/src/IAuthenticationProvider.ts @@ -5,12 +5,11 @@ * ------------------------------------------------------------------------------------------- */ - /** * @interface * A signature representing Authentication provider * @property {Function} getAccessTokenWithCompletion - The function to get the access token from the authentication provider */ export interface AuthenticationProvider { - getAccessToken: () => Promise; + getAccessToken: () => Promise; } diff --git a/src/IClientOptions.ts b/src/IClientOptions.ts index c2b547918..f87c10454 100644 --- a/src/IClientOptions.ts +++ b/src/IClientOptions.ts @@ -10,20 +10,20 @@ import { FetchOptions } from "./IFetchOptions"; import { Middleware } from "./middleware/IMiddleware"; /** -* @interface -* Options for initializing the Graph Client -* @property {Function} [authProvider] - The authentication provider instance -* @property {string} [baseUrl] - Base url that needs to be appended to every request -* @property {boolean} [debugLogging] - The boolean to enable/disable debug logging -* @property {string} [defaultVersion] - The default version that needs to be used while making graph api request -* @property {FetchOptions} [fetchOptions] - The options for fetch request -* @property {Function} [middleware] - The first middleware of the middleware chain -*/ + * @interface + * Options for initializing the Graph Client + * @property {Function} [authProvider] - The authentication provider instance + * @property {string} [baseUrl] - Base url that needs to be appended to every request + * @property {boolean} [debugLogging] - The boolean to enable/disable debug logging + * @property {string} [defaultVersion] - The default version that needs to be used while making graph api request + * @property {FetchOptions} [fetchOptions] - The options for fetch request + * @property {Middleware} [middleware] - The first middleware of the middleware chain + */ export interface ClientOptions { - authProvider?: AuthenticationProvider; - baseUrl?: string; - debugLogging?: boolean; - defaultVersion?: string; - fetchOptions?: FetchOptions; - middleware?: Middleware; -} \ No newline at end of file + authProvider?: AuthenticationProvider; + baseUrl?: string; + debugLogging?: boolean; + defaultVersion?: string; + fetchOptions?: FetchOptions; + middleware?: Middleware; +} diff --git a/src/IContext.ts b/src/IContext.ts index 78e9aeffc..35695a257 100644 --- a/src/IContext.ts +++ b/src/IContext.ts @@ -17,8 +17,8 @@ import { MiddlewareControl } from "./middleware/MiddlewareControl"; */ export interface Context { - request: RequestInfo; - options?: FetchOptions; - response?: Response; - middlewareControl?: MiddlewareControl; -} \ No newline at end of file + request: RequestInfo; + options?: FetchOptions; + response?: Response; + middlewareControl?: MiddlewareControl; +} diff --git a/src/IFetchOptions.ts b/src/IFetchOptions.ts index acdbd9b45..cb17de0f8 100644 --- a/src/IFetchOptions.ts +++ b/src/IFetchOptions.ts @@ -15,11 +15,11 @@ * @property {any} [agent] - HTTP(S).Agent instance, allows custom proxy, certificate, lookup, family etc. */ export interface NodeFetchInit { - follow?: number; - timeout?: number; - compress?: boolean; - size?: number; - agent?: any; + follow?: number; + timeout?: number; + compress?: boolean; + size?: number; + agent?: any; } /** @@ -28,6 +28,4 @@ export interface NodeFetchInit { * @extends RequestInit @see {@link https://fetch.spec.whatwg.org/#requestinit} * @extends NodeFetchInit */ -export interface FetchOptions extends RequestInit, NodeFetchInit { - -} \ No newline at end of file +export interface FetchOptions extends RequestInit, NodeFetchInit {} diff --git a/src/IGraphRequestCallback.ts b/src/IGraphRequestCallback.ts index 0d8ae295d..ecfdc67d9 100644 --- a/src/IGraphRequestCallback.ts +++ b/src/IGraphRequestCallback.ts @@ -11,6 +11,4 @@ import { GraphError } from "./GraphError"; * Signature to define the GraphRequest callback * @callback - The anonymous callback function */ -export interface GraphRequestCallback { - (error: GraphError, response: any, rawResponse?: any): void -} \ No newline at end of file +export type GraphRequestCallback = (error: GraphError, response: any, rawResponse?: any) => void; diff --git a/src/IOptions.ts b/src/IOptions.ts index 0afdd021f..460a04301 100644 --- a/src/IOptions.ts +++ b/src/IOptions.ts @@ -21,6 +21,6 @@ export interface Options { authProvider: AuthProvider; baseUrl?: string; debugLogging?: boolean; - defaultVersion?: string, + defaultVersion?: string; fetchOptions?: FetchOptions; -} \ No newline at end of file +} diff --git a/src/MSALAuthenticationProvider.ts b/src/MSALAuthenticationProvider.ts index 89863fdc0..c1b37d02f 100644 --- a/src/MSALAuthenticationProvider.ts +++ b/src/MSALAuthenticationProvider.ts @@ -9,109 +9,104 @@ * @module MSALAuthenticationProvider */ -import { AuthenticationProvider } from "./IAuthenticationProvider"; import { UserAgentApplication } from "msal"; +import { AuthenticationProvider } from "./IAuthenticationProvider"; + /** * @class * Class representing MSALAuthenticationProvider * @extends AuthenticationProvider */ export class MSALAuthenticationProvider implements AuthenticationProvider { + /** + * @private + * A member holding the clientId of an application + */ + private clientId: string; - /** - * @private - * A member holding the clientId of an application - */ - private clientId: string; - - /** - * @private - * A member holding the list of graph scopes - */ - private scopes: string[]; - - /** - * @private - * A member holding an instance of UserAgentApplication returned from MSAL - */ - private userAgentApplication: UserAgentApplication; + /** + * @private + * A member holding the list of graph scopes + */ + private scopes: string[]; - /** - * @public - * @constructor - * Creates an instance of MSALAuthenticationProvider - * @param {string} clientId - The clientId value of an application - * @param {string[]} scopes - An array of graph scopes - * @param {any} [options] - An options object for MSAL initialization - * @returns An instance of MSALAuthenticationProvider - */ - public constructor(clientId: string, scopes: string[], options?: any) { - const callback = (errorDesc, token, error, tokenType) => { + /** + * @private + * A member holding an instance of UserAgentApplication returned from MSAL + */ + private userAgentApplication: UserAgentApplication; - }; - let self = this; - self.clientId = clientId; - self.scopes = scopes; - self.userAgentApplication = new UserAgentApplication(self.clientId, undefined, callback, options); - } + /** + * @public + * @constructor + * Creates an instance of MSALAuthenticationProvider + * @param {string} clientId - The clientId value of an application + * @param {string[]} scopes - An array of graph scopes + * @param {any} [options] - An options object for MSAL initialization + * @returns An instance of MSALAuthenticationProvider + */ + public constructor(clientId: string, scopes: string[], options?: any) { + const callback = (errorDesc, token, error, tokenType) => {}; // tslint:disable-line: no-empty + this.clientId = clientId; + this.scopes = scopes; + this.userAgentApplication = new UserAgentApplication(this.clientId, undefined, callback, options); + } - /** - * @public - * @async - * To get the access token - * @returns The promise that resolves to an access token - */ - public async getAccessToken(): Promise { - let self = this; - if (self.scopes.length === 0) { - let error = new Error(); - error.name = "EmptyScopes"; - error.message = "Scopes cannot be empty, Please provide a scope"; - throw error; - } - try { - let accessToken: string = await self.userAgentApplication.acquireTokenSilent(self.scopes); - return accessToken; - } catch (errorMsg) { - try { - let idToken: string = await self.userAgentApplication.loginPopup(self.scopes); - try { - let accessToken: string = await self.userAgentApplication.acquireTokenSilent(self.scopes); - return accessToken; - } catch (error) { - let accessToken: string = await self.userAgentApplication.acquireTokenPopup(self.scopes); - return accessToken; - } - } catch (errorMsg) { - throw new Error(errorMsg); - } - } - } + /** + * @public + * @async + * To get the access token + * @returns The promise that resolves to an access token + */ + public async getAccessToken(): Promise { + if (this.scopes.length === 0) { + const error = new Error(); + error.name = "EmptyScopes"; + error.message = "Scopes cannot be empty, Please provide a scope"; + throw error; + } + try { + const accessToken: string = await this.userAgentApplication.acquireTokenSilent(this.scopes); + return accessToken; + } catch (errorMsg) { + try { + const idToken: string = await this.userAgentApplication.loginPopup(this.scopes); + try { + const accessToken: string = await this.userAgentApplication.acquireTokenSilent(this.scopes); + return accessToken; + } catch (error) { + const accessToken: string = await this.userAgentApplication.acquireTokenPopup(this.scopes); + return accessToken; + } + } catch (errorMsg) { + throw new Error(errorMsg); + } + } + } - /** - * @public - * To add the scopes to the existing set of scopes - * @param {string[]} scopes - The array of graph scope values - * @returns Nothing - */ - public addScopes(scopes: string[]): void { - if (scopes.length === 0) { - let error = new Error(); - error.name = "EmptyScopes"; - error.message = "Scopes array cannot be empty"; - throw error; - } - let self = this; - self.scopes = Array.from(new Set(self.scopes.concat(scopes))); - } + /** + * @public + * To add the scopes to the existing set of scopes + * @param {string[]} scopes - The array of graph scope values + * @returns Nothing + */ + public addScopes(scopes: string[]): void { + if (scopes.length === 0) { + const error = new Error(); + error.name = "EmptyScopes"; + error.message = "Scopes array cannot be empty"; + throw error; + } + this.scopes = Array.from(new Set(this.scopes.concat(scopes))); + } - /** - * @public - * To clear the graph scopes - * @returns Nothing - */ - public clearScopes(): void { - this.scopes = []; - } + /** + * @public + * To clear the graph scopes + * @returns Nothing + */ + public clearScopes(): void { + this.scopes = []; + } } diff --git a/src/PolyFill.ts b/src/PolyFill.ts index a71dbab5d..016638e3e 100644 --- a/src/PolyFill.ts +++ b/src/PolyFill.ts @@ -14,10 +14,10 @@ import * as es6Promise from "es6-promise"; * @returns Nothing */ export const init = (): void => { - if (typeof Promise === "undefined") { - es6Promise.polyfill(); - } - if (typeof fetch === "undefined") { - require("isomorphic-fetch"); - } -} + if (typeof Promise === "undefined") { + es6Promise.polyfill(); + } + if (typeof fetch === "undefined") { + require("isomorphic-fetch"); + } +}; diff --git a/src/Range.ts b/src/Range.ts index 29612fd21..f637df4be 100644 --- a/src/Range.ts +++ b/src/Range.ts @@ -10,34 +10,32 @@ */ /** -* @class -* Class representing Range -*/ + * @class + * Class representing Range + */ export class Range { + /** + * @public + * The minimum value of the range + */ + public minValue: number; - /** - * @public - * The minimum value of the range - */ - public minValue: number - - /** - * @public - * The maximum value of the range - */ - public maxValue: number + /** + * @public + * The maximum value of the range + */ + public maxValue: number; - /** - * @public - * @constructor - * Creates a range for given min and max values - * @param {number} [minVal = -1] - The minimum value. - * @param {number} [maxVal = -1] - The maximum value. - * @returns An instance of a Range - */ - public constructor(minVal: number = -1, maxVal: number = -1) { - let self = this; - self.minValue = minVal; - self.maxValue = maxVal; - } + /** + * @public + * @constructor + * Creates a range for given min and max values + * @param {number} [minVal = -1] - The minimum value. + * @param {number} [maxVal = -1] - The maximum value. + * @returns An instance of a Range + */ + public constructor(minVal: number = -1, maxVal: number = -1) { + this.minValue = minVal; + this.maxValue = maxVal; + } } diff --git a/src/RequestMethod.ts b/src/RequestMethod.ts index 854be2542..ae6f00dcb 100644 --- a/src/RequestMethod.ts +++ b/src/RequestMethod.ts @@ -15,9 +15,9 @@ * @property {string} DELETE - The delete request type */ export enum RequestMethod { - GET = 'GET', - PATCH = 'PATCH', - POST = 'POST', - PUT = 'PUT', - DELETE = 'DELETE' -} \ No newline at end of file + GET = "GET", + PATCH = "PATCH", + POST = "POST", + PUT = "PUT", + DELETE = "DELETE", +} diff --git a/src/ResponseType.ts b/src/ResponseType.ts index 799077074..fda594072 100644 --- a/src/ResponseType.ts +++ b/src/ResponseType.ts @@ -17,11 +17,11 @@ */ export enum ResponseType { - ARRAYBUFFER = "arraybuffer", - BLOB = "blob", - DOCUMENT = "document", - JSON = "json", - RAW = "raw", - STREAM = "stream", - TEXT = "text" -} \ No newline at end of file + ARRAYBUFFER = "arraybuffer", + BLOB = "blob", + DOCUMENT = "document", + JSON = "json", + RAW = "raw", + STREAM = "stream", + TEXT = "text", +} diff --git a/src/ValidatePolyFilling.ts b/src/ValidatePolyFilling.ts index 356fc7485..53ec11823 100644 --- a/src/ValidatePolyFilling.ts +++ b/src/ValidatePolyFilling.ts @@ -12,19 +12,19 @@ * @returns The true in case the Promise and fetch available, otherwise throws error */ -export const validatePolyFilling = (): Boolean => { - if (typeof Promise === "undefined" && typeof fetch === "undefined") { - let error = new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them."); - error.name = "PolyFillNotAvailable"; - throw error; - } else if (typeof Promise === "undefined") { - let error = new Error("Library cannot function without Promise. So, please provide polyfill for it."); - error.name = "PolyFillNotAvailable"; - throw error; - } else if (typeof fetch === "undefined") { - let error = new Error("Library cannot function without fetch. So, please provide polyfill for it."); - error.name = "PolyFillNotAvailable"; - throw error; - } - return true; -} \ No newline at end of file +export const validatePolyFilling = (): boolean => { + if (typeof Promise === "undefined" && typeof fetch === "undefined") { + const error = new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them."); + error.name = "PolyFillNotAvailable"; + throw error; + } else if (typeof Promise === "undefined") { + const error = new Error("Library cannot function without Promise. So, please provide polyfill for it."); + error.name = "PolyFillNotAvailable"; + throw error; + } else if (typeof fetch === "undefined") { + const error = new Error("Library cannot function without fetch. So, please provide polyfill for it."); + error.name = "PolyFillNotAvailable"; + throw error; + } + return true; +}; diff --git a/src/browser/MSALAuthenticationProvider.ts b/src/browser/MSALAuthenticationProvider.ts index cc4e87d63..15b8f65a5 100644 --- a/src/browser/MSALAuthenticationProvider.ts +++ b/src/browser/MSALAuthenticationProvider.ts @@ -23,100 +23,96 @@ declare const Msal: any; * @extends AuthenticationProvider */ export class MSALAuthenticationProvider implements AuthenticationProvider { + /** + * @private + * A member holding the clientId of an application + */ + private clientId: string; - /** - * @private - * A member holding the clientId of an application - */ - private clientId: string; + /** + * @private + * A member holding the list of graph scopes + */ + private scopes: string[]; - /** - * @private - * A member holding the list of graph scopes - */ - private scopes: string[]; + /** + * @private + * A member holding an instance of UserAgentApplication returned from MSAL + */ + private userAgentApplication: any; - /** - * @private - * A member holding an instance of UserAgentApplication returned from MSAL - */ - private userAgentApplication: any; + /** + * @public + * @constructor + * Creates an instance of MSALAuthenticationProvider + * @param {string} clientId - The clientId value of an application + * @param {string[]} scopes - An array of graph scopes + * @param {any} [options] - An options object for MSAL initialization + * @returns An instance of MSALAuthenticationProvider + */ + public constructor(clientId: string, scopes: string[], options?: any) { + const callback = (errorDesc, token, error, tokenType) => { + // tslint:disable-line: no-empty + }; + this.clientId = clientId; + this.scopes = scopes; + this.userAgentApplication = new Msal.UserAgentApplication(this.clientId, undefined, callback, options); + } - /** - * @public - * @constructor - * Creates an instance of MSALAuthenticationProvider - * @param {string} clientId - The clientId value of an application - * @param {string[]} scopes - An array of graph scopes - * @param {any} [options] - An options object for MSAL initialization - * @returns An instance of MSALAuthenticationProvider - */ - public constructor(clientId: string, scopes: string[], options?: any) { - const callback = (errorDesc, token, error, tokenType) => { + /** + * @public + * @async + * To get the access token + * @returns The promise that resolves to an access token + */ + public async getAccessToken(): Promise { + if (this.scopes.length === 0) { + const error = new Error(); + error.name = "EmptyScopes"; + error.message = "Scopes cannot be empty, Please provide a scope"; + throw error; + } + try { + const accessToken: string = await this.userAgentApplication.acquireTokenSilent(this.scopes); + return accessToken; + } catch (errorMsg) { + try { + const idToken: string = await this.userAgentApplication.loginPopup(this.scopes); + try { + const accessToken: string = await this.userAgentApplication.acquireTokenSilent(this.scopes); + return accessToken; + } catch (error) { + const accessToken: string = await this.userAgentApplication.acquireTokenPopup(this.scopes); + return accessToken; + } + } catch (errorMsg) { + throw new Error(errorMsg); + } + } + } - }; - let self = this; - self.clientId = clientId; - self.scopes = scopes; - self.userAgentApplication = new Msal.UserAgentApplication(self.clientId, undefined, callback, options); - } + /** + * @public + * To add the scopes to the existing set of scopes + * @param {string[]} scopes - The array of graph scope values + * @returns Nothing + */ + public addScopes(scopes: string[]): void { + if (scopes.length === 0) { + const error = new Error(); + error.name = "EmptyScopes"; + error.message = "Scopes array cannot be empty"; + throw error; + } + this.scopes = Array.from(new Set(this.scopes.concat(scopes))); + } - /** - * @public - * @async - * To get the access token - * @returns The promise that resolves to an access token - */ - public async getAccessToken(): Promise { - let self = this; - if (self.scopes.length === 0) { - let error = new Error(); - error.name = "EmptyScopes"; - error.message = "Scopes cannot be empty, Please provide a scope"; - throw error; - } - try { - let accessToken: string = await self.userAgentApplication.acquireTokenSilent(self.scopes); - return accessToken; - } catch (errorMsg) { - try { - let idToken: string = await self.userAgentApplication.loginPopup(self.scopes); - try { - let accessToken: string = await self.userAgentApplication.acquireTokenSilent(self.scopes); - return accessToken; - } catch (error) { - let accessToken: string = await self.userAgentApplication.acquireTokenPopup(self.scopes); - return accessToken; - } - } catch (errorMsg) { - throw new Error(errorMsg); - } - } - } - - /** - * @public - * To add the scopes to the existing set of scopes - * @param {string[]} scopes - The array of graph scope values - * @returns Nothing - */ - public addScopes(scopes: string[]): void { - if (scopes.length === 0) { - let error = new Error(); - error.name = "EmptyScopes"; - error.message = "Scopes array cannot be empty"; - throw error; - } - let self = this; - self.scopes = Array.from(new Set(self.scopes.concat(scopes))); - } - - /** - * @public - * To clear the graph scopes - * @returns Nothing - */ - public clearScopes(): void { - this.scopes = []; - } + /** + * @public + * To clear the graph scopes + * @returns Nothing + */ + public clearScopes(): void { + this.scopes = []; + } } diff --git a/src/browser/index.ts b/src/browser/index.ts index 5373425cf..a3a4bd44d 100644 --- a/src/browser/index.ts +++ b/src/browser/index.ts @@ -29,4 +29,4 @@ export * from "../IFetchOptions"; export * from "../IGraphRequestCallback"; export * from "../IOptions"; export * from "./MSALAuthenticationProvider"; -export * from "../ResponseType"; \ No newline at end of file +export * from "../ResponseType"; diff --git a/src/content/BatchRequestContent.ts b/src/content/BatchRequestContent.ts index 3f2a0b35b..a767743df 100644 --- a/src/content/BatchRequestContent.ts +++ b/src/content/BatchRequestContent.ts @@ -8,7 +8,7 @@ /** * @module BatchRequestContent */ -import { RequestMethod } from '../RequestMethod'; +import { RequestMethod } from "../RequestMethod"; /** * @interface @@ -16,7 +16,7 @@ import { RequestMethod } from '../RequestMethod'; * @property {Function} buffer - Returns a promise that resolves to a buffer of the request body */ interface NodeBody { - buffer(): Promise; + buffer(): Promise; } /** @@ -25,9 +25,7 @@ interface NodeBody { * @extends Request * @extends NodeBody */ -interface IsomorphicRequest extends Request, NodeBody { - -} +interface IsomorphicRequest extends Request, NodeBody {} /** * @interface @@ -37,9 +35,9 @@ interface IsomorphicRequest extends Request, NodeBody { * @property {Request} request - The Request object */ export interface BatchRequestStep { - id: string; - dependsOn?: string[]; - request: Request; + id: string; + dependsOn?: string[]; + request: Request; } /** @@ -47,12 +45,12 @@ export interface BatchRequestStep { * Signature representing single request in a Batching * @extends RequestInit * @see {@link https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts#L1337} and {@link https://fetch.spec.whatwg.org/#requestinit} - * + * * @property {string} url - The url value of the request */ export interface RequestData extends RequestInit { - url: string; + url: string; } /** @@ -62,8 +60,8 @@ export interface RequestData extends RequestInit { * @property {string[]} [dependsOn] - Array of dependencies */ export interface BatchRequestData extends RequestData { - id: string; - dependsOn?: string[]; + id: string; + dependsOn?: string[]; } /** @@ -73,7 +71,7 @@ export interface BatchRequestData extends RequestData { */ export interface BatchRequestBody { - requests: BatchRequestData[] + requests: BatchRequestData[]; } /** @@ -81,406 +79,406 @@ export interface BatchRequestBody { * Class for handling BatchRequestContent */ export class BatchRequestContent { + /** + * @private + * @static + * Limit for number of requests {@link - https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching} + */ + private static requestLimit: number = 20; - /** - * @private - * @static - * Limit for number of requests {@link - https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching} - */ - private static requestLimit: number = 20; - - /** - * To keep track of requests, key will be id of the request and value will be the request json - */ - requests: Map; + /** + * @public + * To keep track of requests, key will be id of the request and value will be the request json + */ + public requests: Map; - /** - * @public - * @constructor - * Constructs a BatchRequestContent instance - * @param {BatchRequestStep[]} [requests] - Array of requests value - * @returns An instance of a BatchRequestContent - */ - public constructor(requests?: BatchRequestStep[]) { - let self = this; - self.requests = new Map(); - if (typeof requests !== "undefined") { - let limit = BatchRequestContent.requestLimit; - if (requests.length > limit) { - let error = new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${limit}`); - error.name = "Limit Exceeded Error"; - throw error; - } - for (const req of requests) { - self.addRequest(req); - } - } - } + /** + * @private + * @static + * Validates the dependency chain of the requests + * + * Note: + * Individual requests can depend on other individual requests. Currently, requests can only depend on a single other request, and must follow one of these three patterns: + * 1. Parallel - no individual request states a dependency in the dependsOn property. + * 2. Serial - all individual requests depend on the previous individual request. + * 3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency. + * As JSON batching matures, these limitations will be removed. + * @see {@link https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching} + * + * @param {Map} requests - The map of requests. + * @returns The boolean indicating the validation status + */ - /** - * @public - * Adds a request to the batch request content - * @param {BatchRequestStep} request - The request value - * @returns The id of the added request - */ - public addRequest(request: BatchRequestStep): string { - let self = this, - limit = BatchRequestContent.requestLimit; - if (request.id === "") { - let error = new Error(`Id for a request is empty, Please provide an unique id`); - error.name = "Empty Id For Request"; - throw error; - } - if (self.requests.size === limit) { - let error = new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${limit}`); - error.name = "Limit Exceeded Error"; - throw error; - } - if (self.requests.has(request.id)) { - let error = new Error(`Adding request with duplicate id ${request.id}, Make the id of the requests unique`); - error.name = "Duplicate RequestId Error"; - throw error; - } - self.requests.set(request.id, request); - return request.id; - } + private static validateDependencies(requests: Map): boolean { + const isParallel = (reqs: Map): boolean => { + const iterator = reqs.entries(); + let cur = iterator.next(); + while (!cur.done) { + const curReq = cur.value[1]; + if (curReq.dependsOn !== undefined && curReq.dependsOn.length > 0) { + return false; + } + cur = iterator.next(); + } + return true; + }; + const isSerial = (reqs: Map): boolean => { + const iterator = reqs.entries(); + let cur = iterator.next(); + const firstRequest: BatchRequestStep = cur.value[1]; + if (firstRequest.dependsOn !== undefined && firstRequest.dependsOn.length > 0) { + return false; + } + let prev = cur; + cur = iterator.next(); + while (!cur.done) { + const curReq: BatchRequestStep = cur.value[1]; + if (curReq.dependsOn === undefined || curReq.dependsOn.length !== 1 || curReq.dependsOn[0] !== prev.value[1].id) { + return false; + } + prev = cur; + cur = iterator.next(); + } + return true; + }; + const isSame = (reqs: Map): boolean => { + const iterator = reqs.entries(); + let cur = iterator.next(); + const firstRequest: BatchRequestStep = cur.value[1]; + let dependencyId: string; + if (firstRequest.dependsOn === undefined || firstRequest.dependsOn.length === 0) { + dependencyId = firstRequest.id; + } else { + if (firstRequest.dependsOn.length === 1) { + const fDependencyId = firstRequest.dependsOn[0]; + if (fDependencyId !== firstRequest.id && reqs.has(fDependencyId)) { + dependencyId = fDependencyId; + } else { + return false; + } + } else { + return false; + } + } + cur = iterator.next(); + while (!cur.done) { + const curReq = cur.value[1]; + if ((curReq.dependsOn === undefined || curReq.dependsOn.length === 0) && dependencyId !== curReq.id) { + return false; + } + if (curReq.dependsOn !== undefined && curReq.dependsOn.length !== 0) { + if (curReq.dependsOn.length === 1 && (curReq.id === dependencyId || curReq.dependsOn[0] !== dependencyId)) { + return false; + } + if (curReq.dependsOn.length > 1) { + return false; + } + } + cur = iterator.next(); + } + return true; + }; + if (requests.size === 0) { + const error = new Error("Empty requests map, Please provide at least one request."); + error.name = "Empty Requests Error"; + throw error; + } + return isParallel(requests) || isSerial(requests) || isSame(requests); + } - /** - * @public - * Removes request from the batch payload and its dependencies from all dependents - * @param {string} requestId - The id of a request that needs to be removed - * @returns The boolean indicating removed status - */ - public removeRequest(requestId: string): boolean { - let self = this, - deleteStatus = self.requests.delete(requestId), - iterator = self.requests.entries(), - cur = iterator.next(); - /** - * Removing dependencies where this request is present as a dependency - */ - while (!cur.done) { - let dependencies = cur.value[1].dependsOn; - if (typeof dependencies !== "undefined") { - let index = dependencies.indexOf(requestId); - if (index !== -1) { - dependencies.splice(index, 1); - } - if (dependencies.length === 0) { - delete cur.value[1].dependsOn; - } - } - cur = iterator.next(); - } - return deleteStatus; - } + /** + * @private + * @static + * @async + * Converts Request Object instance to a JSON + * @param {IsomorphicRequest} request - The IsomorphicRequest Object instance + * @returns A promise that resolves to JSON representation of a request + */ + private static async getRequestData(request: IsomorphicRequest): Promise { + const requestData: RequestData = { + url: "", + }; + const hasHttpRegex = new RegExp("^https?://"); + // Stripping off hostname, port and url scheme + requestData.url = hasHttpRegex.test(request.url) ? "/" + request.url.split(/.*?\/\/.*?\//)[1] : request.url; + requestData.method = request.method; + const headers = {}; + request.headers.forEach((value, key) => { + headers[key] = value; + }); + if (Object.keys(headers).length) { + requestData.headers = headers; + } + if (request.method === RequestMethod.PATCH || request.method === RequestMethod.POST || request.method === RequestMethod.PUT) { + requestData.body = await BatchRequestContent.getRequestBody(request); + } + /** + * TODO: Check any other property needs to be used from the Request object and add them + */ + return requestData; + } - /** - * @public - * @async - * Serialize content from BatchRequestContent instance - * @returns The body content to make batch request - */ - public async getContent(): Promise { - let self = this, - requestBody = {}, - requests = [], - iterator = self.requests.entries(), - cur = iterator.next(); - if (cur.done) { - let error = new Error("No requests added yet, Please add at least one request."); - error.name = "Empty Payload"; - throw error; - } - if (!BatchRequestContent.validateDependencies(self.requests)) { - let error = new Error(`Invalid dependency found, Dependency should be: -1. Parallel - no individual request states a dependency in the dependsOn property. -2. Serial - all individual requests depend on the previous individual request. -3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency.`); - error.name = "Invalid Dependency"; - throw error; - } - while (!cur.done) { - let requestStep = cur.value[1], - batchRequestData = await BatchRequestContent.getRequestData(requestStep.request); - /** - * @see {@link https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching#request-format} - */ - if (batchRequestData.body !== undefined && (batchRequestData.headers === undefined || batchRequestData.headers["content-type"] === undefined)) { - let error = new Error(`Content-type header is not mentioned for request #${requestStep.id}, For request having body, Content-type header should be mentioned`); - error.name = "Invalid Content-type header"; - throw error; - } - batchRequestData.id = requestStep.id; - if (requestStep.dependsOn !== undefined && requestStep.dependsOn.length > 0) { - batchRequestData.dependsOn = requestStep.dependsOn; - } - requests.push(batchRequestData); - cur = iterator.next(); - } - requestBody.requests = requests; - return requestBody; - } + /** + * @private + * @static + * @async + * Gets the body of a Request object instance + * @param {IsomorphicRequest} request - The IsomorphicRequest object instance + * @returns The Promise that resolves to a body value of a Request + */ + private static async getRequestBody(request: IsomorphicRequest): Promise { + let bodyParsed: boolean = false; + let body; + try { + const cloneReq = request.clone(); + body = await cloneReq.json(); + bodyParsed = true; + } catch (e) { + // tslint:disable-line: no-empty + } + if (!bodyParsed) { + try { + if (typeof Blob !== "undefined") { + const blob = await request.blob(); + const reader = new FileReader(); + body = await new Promise((resolve) => { + reader.addEventListener( + "load", + () => { + const dataURL = reader.result as string; + /** + * Some valid dataURL schemes: + * 1. data:text/vnd-example+xyz;foo=bar;base64,R0lGODdh + * 2. data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678 + * 3. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== + * 4. data:image/png,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== + * 5. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== + * @see Syntax {@link https://en.wikipedia.org/wiki/Data_URI_scheme} for more + */ + const regex = new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"); + const segments = regex.exec(dataURL); + resolve(segments[4]); + }, + false, + ); + reader.readAsDataURL(blob); + }); + } else if (typeof Buffer !== "undefined") { + const buffer = await request.buffer(); + body = buffer.toString("base64"); + } + bodyParsed = true; + } catch (e) { + // tslint:disable-line: no-empty + } + } + return body; + } - /** - * @private - * @static - * Validates the dependency chain of the requests - * - * Note: - * Individual requests can depend on other individual requests. Currently, requests can only depend on a single other request, and must follow one of these three patterns: - * 1. Parallel - no individual request states a dependency in the dependsOn property. - * 2. Serial - all individual requests depend on the previous individual request. - * 3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency. - * As JSON batching matures, these limitations will be removed. - * @see {@link https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching} - * - * @returns The boolean indicating the validation status - */ + /** + * @public + * @constructor + * Constructs a BatchRequestContent instance + * @param {BatchRequestStep[]} [requests] - Array of requests value + * @returns An instance of a BatchRequestContent + */ + public constructor(requests?: BatchRequestStep[]) { + this.requests = new Map(); + if (typeof requests !== "undefined") { + const limit = BatchRequestContent.requestLimit; + if (requests.length > limit) { + const error = new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${limit}`); + error.name = "Limit Exceeded Error"; + throw error; + } + for (const req of requests) { + this.addRequest(req); + } + } + } - private static validateDependencies(requests: Map): boolean { - const isParallel = (requests: Map): boolean => { - let iterator = requests.entries(), - cur = iterator.next(); - while (!cur.done) { - let curReq = cur.value[1]; - if (curReq.dependsOn !== undefined && curReq.dependsOn.length > 0) { - return false; - } - cur = iterator.next(); - } - return true; - }; - const isSerial = (requests: Map): boolean => { - let iterator = requests.entries(), - cur = iterator.next(); - let firstRequest: BatchRequestStep = cur.value[1]; - if (firstRequest.dependsOn !== undefined && firstRequest.dependsOn.length > 0) { - return false; - } - let prev = cur; - cur = iterator.next(); - while (!cur.done) { - let curReq: BatchRequestStep = cur.value[1]; - if (curReq.dependsOn === undefined || curReq.dependsOn.length !== 1 || curReq.dependsOn[0] !== prev.value[1].id) { - return false; - } - prev = cur; - cur = iterator.next(); - } - return true; - }; - const isSame = (requests: Map): boolean => { - let iterator = requests.entries(), - cur = iterator.next(); - let firstRequest: BatchRequestStep = cur.value[1], - dependencyId: string; - if (firstRequest.dependsOn === undefined || firstRequest.dependsOn.length === 0) { - dependencyId = firstRequest.id; - } else { - if (firstRequest.dependsOn.length === 1) { - let fDependencyId = firstRequest.dependsOn[0]; - if (fDependencyId !== firstRequest.id && requests.has(fDependencyId)) { - dependencyId = fDependencyId; - } else { - return false; - } - } else { - return false; - } - } - cur = iterator.next(); - while (!cur.done) { - let curReq = cur.value[1]; - if ((curReq.dependsOn === undefined || curReq.dependsOn.length === 0) && dependencyId !== curReq.id) { - return false; - } - if (curReq.dependsOn !== undefined && curReq.dependsOn.length !== 0) { - if (curReq.dependsOn.length === 1 && (curReq.id === dependencyId || curReq.dependsOn[0] !== dependencyId)) { - return false; - } - if (curReq.dependsOn.length > 1) { - return false; - } - } - cur = iterator.next(); - } - return true; - }; - if (requests.size === 0) { - let error = new Error("Empty requests map, Please provide at least one request."); - error.name = "Empty Requests Error"; - throw error; - } - return (isParallel(requests) || isSerial(requests) || isSame(requests)); - } + /** + * @public + * Adds a request to the batch request content + * @param {BatchRequestStep} request - The request value + * @returns The id of the added request + */ + public addRequest(request: BatchRequestStep): string { + const limit = BatchRequestContent.requestLimit; + if (request.id === "") { + const error = new Error(`Id for a request is empty, Please provide an unique id`); + error.name = "Empty Id For Request"; + throw error; + } + if (this.requests.size === limit) { + const error = new Error(`Maximum requests limit exceeded, Max allowed number of requests are ${limit}`); + error.name = "Limit Exceeded Error"; + throw error; + } + if (this.requests.has(request.id)) { + const error = new Error(`Adding request with duplicate id ${request.id}, Make the id of the requests unique`); + error.name = "Duplicate RequestId Error"; + throw error; + } + this.requests.set(request.id, request); + return request.id; + } - /** - * @private - * @static - * @async - * Converts Request Object instance to a JSON - * @param {IsomorphicRequest} request - The IsomorphicRequest Object instance - * @returns A promise that resolves to JSON representation of a request - */ - private static async getRequestData(request: IsomorphicRequest): Promise { - let requestData = {}; - let hasHttpRegex = new RegExp("^https?:\/\/"); - if (hasHttpRegex.test(request.url)) { - // Stripping off hostname, port and url scheme - requestData.url = "/" + request.url.split(/.*?\/\/.*?\//)[1]; - } else { - requestData.url = request.url; - } - requestData.method = request.method; - let headers = {}; - request.headers.forEach((value, key) => { - headers[key] = value; - }); - if (Object.keys(headers).length) { - requestData.headers = headers; - } - if (request.method === RequestMethod.PATCH || request.method === RequestMethod.POST || request.method === RequestMethod.PUT) { - requestData.body = await BatchRequestContent.getRequestBody(request); - } - /** - * TODO: Check any other property needs to be used from the Request object and add them - */ - return requestData; - } + /** + * @public + * Removes request from the batch payload and its dependencies from all dependents + * @param {string} requestId - The id of a request that needs to be removed + * @returns The boolean indicating removed status + */ + public removeRequest(requestId: string): boolean { + const deleteStatus = this.requests.delete(requestId); + const iterator = this.requests.entries(); + let cur = iterator.next(); + /** + * Removing dependencies where this request is present as a dependency + */ + while (!cur.done) { + const dependencies = cur.value[1].dependsOn; + if (typeof dependencies !== "undefined") { + const index = dependencies.indexOf(requestId); + if (index !== -1) { + dependencies.splice(index, 1); + } + if (dependencies.length === 0) { + delete cur.value[1].dependsOn; + } + } + cur = iterator.next(); + } + return deleteStatus; + } - /** - * @private - * @static - * @async - * Gets the body of a Request object instance - * @param {IsomorphicRequest} request - The IsomorphicRequest object instance - * @returns The Promise that resolves to a body value of a Request - */ - private static async getRequestBody(request: IsomorphicRequest): Promise { - let bodyParsed: boolean = false, - body; - try { - let cloneReq = request.clone(); - body = await cloneReq.json(); - bodyParsed = true; - } catch (e) { - - } - if (!bodyParsed) { - try { - if (typeof Blob !== "undefined") { - let blob = await request.blob(); - let reader = new FileReader(); - body = await new Promise(resolve => { - reader.addEventListener("load", function () { - let dataURL = reader.result, - /** - * Some valid dataURL schemes: - * 1. data:text/vnd-example+xyz;foo=bar;base64,R0lGODdh - * 2. data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678 - * 3. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== - * 4. data:image/png,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== - * 5. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg== - * @see Syntax {@link https://en.wikipedia.org/wiki/Data_URI_scheme} for more - */ - regex = new RegExp("^\s*data:(.+?\/.+?(;.+?\=.+?)*)?(;base64)?,(.*)\s*$"), - segments = regex.exec(dataURL); - resolve(segments[4]); - }, false); - reader.readAsDataURL(blob); - }); - } else if (typeof Buffer !== "undefined") { - let buffer = await request.buffer(); - body = buffer.toString("base64"); - } - bodyParsed = true; - } catch (e) { - - } - } - return body; - } + /** + * @public + * @async + * Serialize content from BatchRequestContent instance + * @returns The body content to make batch request + */ + public async getContent(): Promise { + const requests: BatchRequestData[] = []; + const requestBody: BatchRequestBody = { + requests, + }; + const iterator = this.requests.entries(); + let cur = iterator.next(); + if (cur.done) { + const error = new Error("No requests added yet, Please add at least one request."); + error.name = "Empty Payload"; + throw error; + } + if (!BatchRequestContent.validateDependencies(this.requests)) { + const error = new Error(`Invalid dependency found, Dependency should be: +1. Parallel - no individual request states a dependency in the dependsOn property. +2. Serial - all individual requests depend on the previous individual request. +3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency.`); + error.name = "Invalid Dependency"; + throw error; + } + while (!cur.done) { + const requestStep: BatchRequestStep = cur.value[1]; + const batchRequestData: BatchRequestData = (await BatchRequestContent.getRequestData(requestStep.request as IsomorphicRequest)) as BatchRequestData; + /** + * @see {@link https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching#request-format} + */ + if (batchRequestData.body !== undefined && (batchRequestData.headers === undefined || batchRequestData.headers["content-type"] === undefined)) { + const error = new Error(`Content-type header is not mentioned for request #${requestStep.id}, For request having body, Content-type header should be mentioned`); + error.name = "Invalid Content-type header"; + throw error; + } + batchRequestData.id = requestStep.id; + if (requestStep.dependsOn !== undefined && requestStep.dependsOn.length > 0) { + batchRequestData.dependsOn = requestStep.dependsOn; + } + requests.push(batchRequestData); + cur = iterator.next(); + } + requestBody.requests = requests; + return requestBody; + } - /** - * @public - * Adds a dependency for a given dependent request - * @param {string} dependentId - The id of the dependent request - * @param {string} [dependencyId] - The id of the dependency request, if not specified the preceding request will be considered as a dependency - * @returns Nothing - */ - public addDependency(dependentId: string, dependencyId?: string): void { - let self = this; - if (!self.requests.has(dependentId)) { - let error = new Error(`Dependent ${dependentId} does not exists, Please check the id`); - error.name = "Invalid Dependent"; - throw error; - } - if (typeof dependencyId !== "undefined" && !self.requests.has(dependencyId)) { - let error = new Error(`Dependency ${dependencyId} does not exists, Please check the id`); - error.name = "Invalid Dependency"; - throw error; - } - if (typeof dependencyId !== "undefined") { - let dependent = self.requests.get(dependentId); - if (dependent.dependsOn === undefined) { - dependent.dependsOn = []; - } - if (dependent.dependsOn.indexOf(dependencyId) !== -1) { - let error = new Error(`Dependency ${dependencyId} is already added for the request ${dependentId}`); - error.name = "Duplicate Dependency"; - throw error; - } - dependent.dependsOn.push(dependencyId); - } else { - let prev, - iterator = self.requests.entries(), - cur = iterator.next(); - while (!cur.done && cur.value[1].id !== dependentId) { - prev = cur; - cur = iterator.next(); - } - if (typeof prev !== "undefined") { - let dependencyId = prev.value[0]; - if (cur.value[1].dependsOn === undefined) { - cur.value[1].dependsOn = []; - } - if (cur.value[1].dependsOn.indexOf(dependencyId) !== -1) { - let error = new Error(`Dependency ${dependencyId} is already added for the request ${dependentId}`); - error.name = "Duplicate Dependency"; - throw error; - } - cur.value[1].dependsOn.push(dependencyId); - } else { - let error = new Error(`Can't add dependency ${dependencyId}, There is only a dependent request in the batch`); - error.name = "Invalid Dependency Addition"; - throw error; - } - } - } + /** + * @public + * Adds a dependency for a given dependent request + * @param {string} dependentId - The id of the dependent request + * @param {string} [dependencyId] - The id of the dependency request, if not specified the preceding request will be considered as a dependency + * @returns Nothing + */ + public addDependency(dependentId: string, dependencyId?: string): void { + if (!this.requests.has(dependentId)) { + const error = new Error(`Dependent ${dependentId} does not exists, Please check the id`); + error.name = "Invalid Dependent"; + throw error; + } + if (typeof dependencyId !== "undefined" && !this.requests.has(dependencyId)) { + const error = new Error(`Dependency ${dependencyId} does not exists, Please check the id`); + error.name = "Invalid Dependency"; + throw error; + } + if (typeof dependencyId !== "undefined") { + const dependent = this.requests.get(dependentId); + if (dependent.dependsOn === undefined) { + dependent.dependsOn = []; + } + if (dependent.dependsOn.indexOf(dependencyId) !== -1) { + const error = new Error(`Dependency ${dependencyId} is already added for the request ${dependentId}`); + error.name = "Duplicate Dependency"; + throw error; + } + dependent.dependsOn.push(dependencyId); + } else { + const iterator = this.requests.entries(); + let prev; + let cur = iterator.next(); + while (!cur.done && cur.value[1].id !== dependentId) { + prev = cur; + cur = iterator.next(); + } + if (typeof prev !== "undefined") { + const dId = prev.value[0]; + if (cur.value[1].dependsOn === undefined) { + cur.value[1].dependsOn = []; + } + if (cur.value[1].dependsOn.indexOf(dId) !== -1) { + const error = new Error(`Dependency ${dId} is already added for the request ${dependentId}`); + error.name = "Duplicate Dependency"; + throw error; + } + cur.value[1].dependsOn.push(dId); + } else { + const error = new Error(`Can't add dependency ${dependencyId}, There is only a dependent request in the batch`); + error.name = "Invalid Dependency Addition"; + throw error; + } + } + } - /** - * @public - * Removes a dependency for a given dependent request id - * @param {string} dependentId - The id of the dependent request - * @param {string} [dependencyId] - The id of the dependency request, if not specified will remove all the dependencies of that request - * @returns The boolean indicating removed status - */ - public removeDependency(dependentId: string, dependencyId?: string): boolean { - let request = this.requests.get(dependentId); - if (typeof request === "undefined" || request.dependsOn === undefined || request.dependsOn.length === 0) { - return false; - } - if (typeof dependencyId !== "undefined") { - let index = request.dependsOn.indexOf(dependencyId); - if (index === -1) { - return false; - } - request.dependsOn.splice(index, 1); - return true; - } else { - delete request.dependsOn; - return true; - } - } + /** + * @public + * Removes a dependency for a given dependent request id + * @param {string} dependentId - The id of the dependent request + * @param {string} [dependencyId] - The id of the dependency request, if not specified will remove all the dependencies of that request + * @returns The boolean indicating removed status + */ + public removeDependency(dependentId: string, dependencyId?: string): boolean { + const request = this.requests.get(dependentId); + if (typeof request === "undefined" || request.dependsOn === undefined || request.dependsOn.length === 0) { + return false; + } + if (typeof dependencyId !== "undefined") { + const index = request.dependsOn.indexOf(dependencyId); + if (index === -1) { + return false; + } + request.dependsOn.splice(index, 1); + return true; + } else { + delete request.dependsOn; + return true; + } + } } diff --git a/src/content/BatchResponseContent.ts b/src/content/BatchResponseContent.ts index 6199d1401..910b8ac54 100644 --- a/src/content/BatchResponseContent.ts +++ b/src/content/BatchResponseContent.ts @@ -14,7 +14,7 @@ * Signature represents key value pair object */ interface KeyValuePairObject { - [key: string]: any; + [key: string]: any; } /** @@ -24,104 +24,98 @@ interface KeyValuePairObject { * @property {string} [@nextLink] - The nextLink value to get next set of responses in case of asynchronous batch requests */ interface BatchResponseBody { - responses: KeyValuePairObject[], - "@nextLink"?: string + responses: KeyValuePairObject[]; + "@nextLink"?: string; } - /** * @class * Class that handles BatchResponseContent */ export class BatchResponseContent { + /** + * To hold the responses + */ + private responses: Map; - /** - * To hold the responses - */ - private responses: Map; - - /** - * Holds the next link url - */ - private nextLink: string; - + /** + * Holds the next link url + */ + private nextLink: string; - /** - * @public - * @constructor - * Creates the BatchResponseContent instance - * @param {BatchResponseBody} response - The response body returned for batch request from server - * @returns An instance of a BatchResponseContent - */ - public constructor(response: BatchResponseBody) { - let self = this; - self.responses = new Map(); - self.update(response); - } + /** + * @public + * @constructor + * Creates the BatchResponseContent instance + * @param {BatchResponseBody} response - The response body returned for batch request from server + * @returns An instance of a BatchResponseContent + */ + public constructor(response: BatchResponseBody) { + this.responses = new Map(); + this.update(response); + } - /** - * @public - * Updates the Batch response content instance with given responses. - * @param {BatchResponseBody} response - The response json representing batch response message - * @returns Nothing - */ - public update(response: BatchResponseBody): void { - let self = this; - self.nextLink = response["@nextLink"]; - let responses = response.responses; - for (let i = 0, l = responses.length; i < l; i++) { - self.responses.set(responses[i].id, self.createResponseObject(responses[i])); - } - } + /** + * @private + * Creates native Response object from the json representation of it. + * @param {KeyValuePairObject} responseJSON - The response json value + * @returns The Response Object instance + */ + private createResponseObject(responseJSON: KeyValuePairObject): Response { + const body = responseJSON.body; + const options: KeyValuePairObject = {}; + options.status = responseJSON.status; + if (responseJSON.statusText !== undefined) { + options.statusText = responseJSON.statusText; + } + options.headers = responseJSON.headers; + return new Response(body, options); + } - /** - * @private - * Creates native Response object from the json representation of it. - * @param {KeyValuePairObject} responseJSON - The response json value - * @returns The Response Object instance - */ - private createResponseObject(responseJSON: KeyValuePairObject): Response { - let body = responseJSON.body, - options: KeyValuePairObject = {}; - options.status = responseJSON.status; - if (responseJSON.statusText !== undefined) { - options.statusText = responseJSON.statusText; - } - options.headers = responseJSON.headers; - return new Response(body, options); - } + /** + * @public + * Updates the Batch response content instance with given responses. + * @param {BatchResponseBody} response - The response json representing batch response message + * @returns Nothing + */ + public update(response: BatchResponseBody): void { + this.nextLink = response["@nextLink"]; + const responses = response.responses; + for (let i = 0, l = responses.length; i < l; i++) { + this.responses.set(responses[i].id, this.createResponseObject(responses[i])); + } + } - /** - * @public - * To get the response of a request for a given request id - * @param {string} requestId - The request id value - * @returns The Response object instance for the particular request - */ - public getResponseById(requestId: string): Response { - return this.responses.get(requestId); - } + /** + * @public + * To get the response of a request for a given request id + * @param {string} requestId - The request id value + * @returns The Response object instance for the particular request + */ + public getResponseById(requestId: string): Response { + return this.responses.get(requestId); + } - /** - * @public - * To get all the responses of the batch request - * @returns The Map of id and Response objects - */ - public getResponses(): Map { - return this.responses; - } + /** + * @public + * To get all the responses of the batch request + * @returns The Map of id and Response objects + */ + public getResponses(): Map { + return this.responses; + } - /** - * @public - * To get the iterator for the responses - * @returns The Iterable generator for the response objects - */ - public *getResponsesIterator(): IterableIterator<[string, Response]> { - let self = this, - iterator = self.responses.entries(), - cur = iterator.next(); - while (!cur.done) { - yield cur.value; - cur = iterator.next(); - } - } + /** + * @public + * To get the iterator for the responses + * @returns The Iterable generator for the response objects + */ + public *getResponsesIterator(): IterableIterator<[string, Response]> { + const iterator = this.responses.entries(); + let cur = iterator.next(); + while (!cur.done) { + yield cur.value; + cur = iterator.next(); + } + } } diff --git a/src/middleware/AuthenticationHandler.ts b/src/middleware/AuthenticationHandler.ts index 0ea56f100..ecc7f1865 100644 --- a/src/middleware/AuthenticationHandler.ts +++ b/src/middleware/AuthenticationHandler.ts @@ -9,9 +9,10 @@ * @module AuthenticationHandler */ -import { Middleware } from "./IMiddleware"; import { AuthenticationProvider } from "../IAuthenticationProvider"; import { Context } from "../IContext"; + +import { Middleware } from "./IMiddleware"; import { setRequestHeader } from "./MiddlewareUtil"; /** @@ -20,60 +21,59 @@ import { setRequestHeader } from "./MiddlewareUtil"; * @implements Middleware */ export class AuthenticationHandler implements Middleware { + /** + * @private + * A member representing the authorization header name + */ + private static AUTHORIZATION_HEADER: string = "Authorization"; - /** - * @private - * A member representing the authorization header name - */ - private static AUTHORIZATION_HEADER: string = "Authorization"; - - /** - * @private - * A member to hold an AuthenticationProvider instance - */ - private authProvider: AuthenticationProvider; + /** + * @private + * A member to hold an AuthenticationProvider instance + */ + private authProvider: AuthenticationProvider; - /** - * @private - * A member to hold next middleware in the middleware chain - */ - private nextMiddleware: Middleware; + /** + * @private + * A member to hold next middleware in the middleware chain + */ + private nextMiddleware: Middleware; - /** - * @public - * @constructor - * Creates an instance of AuthenticationHandler - * @param {AuthenticationProvider} authProvider - The authentication provider for the authentication handler - */ - public constructor(authProvider: AuthenticationProvider) { - this.authProvider = authProvider; - } + /** + * @public + * @constructor + * Creates an instance of AuthenticationHandler + * @param {AuthenticationProvider} authProvider - The authentication provider for the authentication handler + */ + public constructor(authProvider: AuthenticationProvider) { + this.authProvider = authProvider; + } - /** - * @public - * @async - * To execute the current middleware - * @param {context} context - The context object of the request - * @returns A Promise that resolves to nothing - */ - public async execute(context: Context): Promise { - try { - const token = await this.authProvider.getAccessToken(); - const bearerKey = `Bearer ${token}`; - setRequestHeader(context.request, context.options, AuthenticationHandler.AUTHORIZATION_HEADER, bearerKey); - return await this.nextMiddleware.execute(context); - } catch (error) { - throw error; - } - } + /** + * @public + * @async + * To execute the current middleware + * @param {context} context - The context object of the request + * @returns A Promise that resolves to nothing + */ + public async execute(context: Context): Promise { + try { + const token = await this.authProvider.getAccessToken(); + const bearerKey = `Bearer ${token}`; + setRequestHeader(context.request, context.options, AuthenticationHandler.AUTHORIZATION_HEADER, bearerKey); + return await this.nextMiddleware.execute(context); + } catch (error) { + throw error; + } + } - /** - * @public - * To set the next middleware in the chain - * @param {Middleware} next - The middleware instance - * @returns Nothing - */ - public setNext(next: Middleware): void { - this.nextMiddleware = next; - } + /** + * @public + * To set the next middleware in the chain + * @param {Middleware} next - The middleware instance + * @returns Nothing + */ + public setNext(next: Middleware): void { + this.nextMiddleware = next; + } } diff --git a/src/middleware/HTTPMessageHandler.ts b/src/middleware/HTTPMessageHandler.ts index 91116307c..1e70cc9e1 100644 --- a/src/middleware/HTTPMessageHandler.ts +++ b/src/middleware/HTTPMessageHandler.ts @@ -10,6 +10,7 @@ */ import { Context } from "../IContext"; + import { Middleware } from "./IMiddleware"; /** @@ -18,20 +19,19 @@ import { Middleware } from "./IMiddleware"; * @implements Middleware */ export class HTTPMessageHandler implements Middleware { - - /** - * @public - * @async - * To execute the current middleware - * @param {Context} context - The request context object - * @returns A promise that resolves to nothing - */ - public async execute(context: Context): Promise { - try { - context.response = await fetch(context.request, context.options); - return; - } catch (error) { - throw error; - } - } -} \ No newline at end of file + /** + * @public + * @async + * To execute the current middleware + * @param {Context} context - The request context object + * @returns A promise that resolves to nothing + */ + public async execute(context: Context): Promise { + try { + context.response = await fetch(context.request, context.options); + return; + } catch (error) { + throw error; + } + } +} diff --git a/src/middleware/IMiddleware.ts b/src/middleware/IMiddleware.ts index fd739549c..70dacc703 100644 --- a/src/middleware/IMiddleware.ts +++ b/src/middleware/IMiddleware.ts @@ -13,6 +13,6 @@ import { Context } from "../IContext"; * @property {Function} [setNext] - A method to set the next middleware in the chain */ export interface Middleware { - execute: (context: Context) => Promise; - setNext?: (middleware: Middleware) => void; -} \ No newline at end of file + execute: (context: Context) => Promise; + setNext?: (middleware: Middleware) => void; +} diff --git a/src/middleware/MiddlewareControl.ts b/src/middleware/MiddlewareControl.ts index 8770d2e5b..60c237901 100644 --- a/src/middleware/MiddlewareControl.ts +++ b/src/middleware/MiddlewareControl.ts @@ -16,35 +16,34 @@ import { MiddlewareOption } from "./option/IMiddlewareOption"; * Class representing MiddlewareControl */ export class MiddlewareControl { + /** + * @private + * A member holding map of MiddlewareOption + */ + private middlewareOptions: Map; - /** - * @private - * A member holding map of MiddlewareOption - */ - private middlewareOptions: Map; + /** + * @public + * @constructor + * Creates an instance of MiddlewareControl + * @param {MiddlewareOption[]} middlewareOptions - The array of middlewareOptions + * @returns The instance of MiddlewareControl + */ + public constructor(middlewareOptions: MiddlewareOption[]) { + this.middlewareOptions = new Map(); + for (const option of middlewareOptions) { + const name = option.constructor.name; + this.middlewareOptions.set(name, option); + } + } - /** - * @public - * @constructor - * Creates an instance of MiddlewareControl - * @param {MiddlewareOption[]} middlewareOptions - The array of middlewareOptions - * @returns The instance of MiddlewareControl - */ - public constructor(middlewareOptions: MiddlewareOption[]) { - this.middlewareOptions = new Map(); - for (let option of middlewareOptions) { - let name = option.constructor.name; - this.middlewareOptions.set(name, option); - } - } - - /** - * @public - * To get the middleware option using the class name of the option - * @param {string} name - The class name of the strongly types option class - * @returns The middleware option - */ - public getMiddlewareOption(name: string): MiddlewareOption { - return this.middlewareOptions.get(name); - } -} \ No newline at end of file + /** + * @public + * To get the middleware option using the class name of the option + * @param {string} name - The class name of the strongly types option class + * @returns The middleware option + */ + public getMiddlewareOption(name: string): MiddlewareOption { + return this.middlewareOptions.get(name); + } +} diff --git a/src/middleware/MiddlewareUtil.ts b/src/middleware/MiddlewareUtil.ts index 671087817..dd47a9b9a 100644 --- a/src/middleware/MiddlewareUtil.ts +++ b/src/middleware/MiddlewareUtil.ts @@ -9,46 +9,46 @@ * @module MiddlewareUtil */ -import { FetchOptions } from '../IFetchOptions'; +import { FetchOptions } from "../IFetchOptions"; export const getRequestHeader = (request: RequestInfo, options: FetchOptions | undefined, key: string): string | null => { - let value: string = null; - if (request instanceof Request) { - value = (request as Request).headers.get(key); - } else if (typeof options !== "undefined" && options.headers !== undefined) { - if (options.headers instanceof Headers) { - value = (options.headers as Headers).get(key); - } else if (options.headers instanceof Array) { - const headers = (options.headers as string[][]); - for (let i = 0, l = headers.length; i < l; i++) { - if (headers[i][0] === key) { - value = headers[i][1]; - break; - } - } - } else if (options.headers[key] !== undefined) { - value = options.headers[key]; - } - } - return value; -} + let value: string = null; + if (request instanceof Request) { + value = (request as Request).headers.get(key); + } else if (typeof options !== "undefined" && options.headers !== undefined) { + if (options.headers instanceof Headers) { + value = (options.headers as Headers).get(key); + } else if (options.headers instanceof Array) { + const headers = options.headers as string[][]; + for (let i = 0, l = headers.length; i < l; i++) { + if (headers[i][0] === key) { + value = headers[i][1]; + break; + } + } + } else if (options.headers[key] !== undefined) { + value = options.headers[key]; + } + } + return value; +}; export const setRequestHeader = (request: RequestInfo, options: FetchOptions | undefined, key: string, value: string): void => { - if (request instanceof Request) { - (request as Request).headers.set(key, value); - } else if (typeof options !== "undefined") { - if (options.headers === undefined) { - options.headers = { - [key]: value - }; - } else { - if (options.headers instanceof Headers) { - (options.headers as Headers).set(key, value); - } else if (options.headers instanceof Array) { - (options.headers as string[][]).push([key, value]); - } else { - Object.assign(options.headers, { [key]: value }); - } - } - } -} \ No newline at end of file + if (request instanceof Request) { + (request as Request).headers.set(key, value); + } else if (typeof options !== "undefined") { + if (options.headers === undefined) { + options.headers = { + [key]: value, + }; + } else { + if (options.headers instanceof Headers) { + (options.headers as Headers).set(key, value); + } else if (options.headers instanceof Array) { + (options.headers as string[][]).push([key, value]); + } else { + Object.assign(options.headers, { [key]: value }); + } + } + } +}; diff --git a/src/middleware/option/IMiddlewareOption.ts b/src/middleware/option/IMiddlewareOption.ts index ed65b054b..e161c6342 100644 --- a/src/middleware/option/IMiddlewareOption.ts +++ b/src/middleware/option/IMiddlewareOption.ts @@ -10,6 +10,5 @@ * Signature representing the middleware options */ -export interface MiddlewareOption { - -} +/* tslint:disable: no-empty-interface */ +export interface MiddlewareOption {} diff --git a/src/tasks/LargeFileUploadTask.ts b/src/tasks/LargeFileUploadTask.ts index 85f87cc62..97b0abdeb 100644 --- a/src/tasks/LargeFileUploadTask.ts +++ b/src/tasks/LargeFileUploadTask.ts @@ -19,8 +19,8 @@ import { Range } from "../Range"; * @property {string[]} nextExpectedRanges - The ranges expected in next consecutive request in the upload */ interface UploadStatusResponse { - expirationDateTime: string; - nextExpectedRanges: string[]; + expirationDateTime: string; + nextExpectedRanges: string[]; } /** @@ -29,8 +29,8 @@ interface UploadStatusResponse { * @property {number} [rangeSize = LargeFileUploadTask.DEFAULT_FILE_SIZE] - Specifies the range chunk size */ export interface LargeFileUploadTaskOptions { - rangeSize?: number; -}; + rangeSize?: number; +} /** * @interface @@ -39,8 +39,8 @@ export interface LargeFileUploadTaskOptions { * @property {Date} expiry - The expiration of the time of the upload session */ export interface LargeFileUploadSession { - url: string; - expiry: Date; + url: string; + expiry: Date; } /** @@ -51,9 +51,9 @@ export interface LargeFileUploadSession { * @property {number} size - Specifies size of the file */ export interface FileObject { - content: ArrayBuffer | File; - name: string; - size: number; + content: ArrayBuffer | File; + name: string; + size: number; } /** @@ -61,228 +61,215 @@ export interface FileObject { * Class representing LargeFileUploadTask */ export class LargeFileUploadTask { + /** + * @private + * Default value for the rangeSize + */ + private DEFAULT_FILE_SIZE: number = 5 * 1024 * 1024; - /** - * @protected - * The GraphClient instance - */ - protected client: Client - - /** - * @protected - * The object holding file details - */ - protected file: FileObject + /** + * @protected + * The GraphClient instance + */ + protected client: Client; - /** - * @protected - * The object holding options for the task - */ - protected options: LargeFileUploadTaskOptions + /** + * @protected + * The object holding file details + */ + protected file: FileObject; - /** - * @protected - * The object for upload session - */ - protected uploadSession: LargeFileUploadSession + /** + * @protected + * The object holding options for the task + */ + protected options: LargeFileUploadTaskOptions; - /** - * @protected - * The next range needs to be uploaded - */ - protected nextRange: Range + /** + * @protected + * The object for upload session + */ + protected uploadSession: LargeFileUploadSession; - /** - * @private - * Default value for the rangeSize - */ - private DEFAULT_FILE_SIZE: number = 5 * 1024 * 1024; + /** + * @protected + * The next range needs to be uploaded + */ + protected nextRange: Range; - /** - * @public - * @constructor - * Constructs a LargeFileUploadTask - * @param {Client} client - The GraphClient instance - * @param {FileObject} file - The FileObject holding details of a file that needs to be uploaded - * @param {LargeFileUploadSession} uploadSession - The upload session to which the upload has to be done - * @param {LargeFileUploadTaskOptions} options - The upload task options - * @returns An instance of LargeFileUploadTask - */ - public constructor(client: Client, file: FileObject, uploadSession: LargeFileUploadSession, options: LargeFileUploadTaskOptions) { - let self = this; - self.client = client; - self.file = file; - if (options.rangeSize === undefined) { - options.rangeSize = self.DEFAULT_FILE_SIZE; - } - self.options = options; - self.uploadSession = uploadSession; - self.nextRange = new Range(0, self.options.rangeSize - 1); - } + /** + * @public + * @constructor + * Constructs a LargeFileUploadTask + * @param {Client} client - The GraphClient instance + * @param {FileObject} file - The FileObject holding details of a file that needs to be uploaded + * @param {LargeFileUploadSession} uploadSession - The upload session to which the upload has to be done + * @param {LargeFileUploadTaskOptions} options - The upload task options + * @returns An instance of LargeFileUploadTask + */ + public constructor(client: Client, file: FileObject, uploadSession: LargeFileUploadSession, options: LargeFileUploadTaskOptions) { + this.client = client; + this.file = file; + if (options.rangeSize === undefined) { + options.rangeSize = this.DEFAULT_FILE_SIZE; + } + this.options = options; + this.uploadSession = uploadSession; + this.nextRange = new Range(0, this.options.rangeSize - 1); + } - /** - * @public - * Parses given range string to the Range instance - * @param {string[]} ranges - The ranges value - * @returns The range instance - */ - public parseRange(ranges: string[]): Range { - let rangeStr = ranges[0]; - if (typeof rangeStr === "undefined" || rangeStr === "") { - return new Range(); - } - let firstRange = rangeStr.split("-"), - minVal = parseInt(firstRange[0]), - maxVal = parseInt(firstRange[1]); - if (Number.isNaN(maxVal)) { - maxVal = this.file.size - 1; - } - return new Range(minVal, maxVal); - } + /** + * @public + * Parses given range string to the Range instance + * @param {string[]} ranges - The ranges value + * @returns The range instance + */ + public parseRange(ranges: string[]): Range { + const rangeStr = ranges[0]; + if (typeof rangeStr === "undefined" || rangeStr === "") { + return new Range(); + } + const firstRange = rangeStr.split("-"); + const minVal = parseInt(firstRange[0], 10); + let maxVal = parseInt(firstRange[1], 10); + if (Number.isNaN(maxVal)) { + maxVal = this.file.size - 1; + } + return new Range(minVal, maxVal); + } - /** - * @public - * Updates the expiration date and the next range - * @param {UploadStatusResponse} response - The response of the upload status - * @returns Nothing - */ - public updateTaskStatus(response: UploadStatusResponse): void { - let self = this; - self.uploadSession.expiry = new Date(response.expirationDateTime); - self.nextRange = self.parseRange(response.nextExpectedRanges); - } + /** + * @public + * Updates the expiration date and the next range + * @param {UploadStatusResponse} response - The response of the upload status + * @returns Nothing + */ + public updateTaskStatus(response: UploadStatusResponse): void { + this.uploadSession.expiry = new Date(response.expirationDateTime); + this.nextRange = this.parseRange(response.nextExpectedRanges); + } - /** - * @public - * Gets next range that needs to be uploaded - * @returns The range instance - */ - public getNextRange(): Range { - let self = this; - if (self.nextRange.minValue === -1) { - return self.nextRange; - } - let minVal = self.nextRange.minValue, - maxValue = minVal + self.options.rangeSize - 1; - if (maxValue >= self.file.size) { - maxValue = self.file.size - 1; - } - return new Range(minVal, maxValue); - } + /** + * @public + * Gets next range that needs to be uploaded + * @returns The range instance + */ + public getNextRange(): Range { + if (this.nextRange.minValue === -1) { + return this.nextRange; + } + const minVal = this.nextRange.minValue; + let maxValue = minVal + this.options.rangeSize - 1; + if (maxValue >= this.file.size) { + maxValue = this.file.size - 1; + } + return new Range(minVal, maxValue); + } - /** - * @public - * Slices the file content to the given range - * @param {Range} range - The range value - * @returns The sliced ArrayBuffer or Blob - */ - public sliceFile(range: Range): ArrayBuffer | Blob { - let blob = this.file.content.slice(range.minValue, range.maxValue + 1); - return blob; - } + /** + * @public + * Slices the file content to the given range + * @param {Range} range - The range value + * @returns The sliced ArrayBuffer or Blob + */ + public sliceFile(range: Range): ArrayBuffer | Blob { + const blob = this.file.content.slice(range.minValue, range.maxValue + 1); + return blob; + } - /** - * @public - * @async - * Uploads file to the server in a sequential order by slicing the file - * @returns The promise resolves to uploaded response - */ - public async upload(): Promise { - let self = this; - try { - while (true) { - let nextRange = self.getNextRange(); - if (nextRange.maxValue === -1) { - let err = new Error("Task with which you are trying to upload is already completed, Please check for your uploaded file"); - err.name = "Invalid Session"; - throw err; - } - let fileSlice = self.sliceFile(nextRange), - response = await self.uploadSlice(fileSlice, nextRange, self.file.size); - // Upon completion of upload process incase of onedrive, driveItem is returned, which contains id - if (response.id !== undefined) { - return response; - } else { - self.updateTaskStatus(response); - } - } - } catch (err) { - throw err; - } - } + /** + * @public + * @async + * Uploads file to the server in a sequential order by slicing the file + * @returns The promise resolves to uploaded response + */ + public async upload(): Promise { + try { + while (true) { + const nextRange = this.getNextRange(); + if (nextRange.maxValue === -1) { + const err = new Error("Task with which you are trying to upload is already completed, Please check for your uploaded file"); + err.name = "Invalid Session"; + throw err; + } + const fileSlice = this.sliceFile(nextRange); + const response = await this.uploadSlice(fileSlice, nextRange, this.file.size); + // Upon completion of upload process incase of onedrive, driveItem is returned, which contains id + if (response.id !== undefined) { + return response; + } else { + this.updateTaskStatus(response); + } + } + } catch (err) { + throw err; + } + } - /** - * @public - * @async - * Uploads given slice to the server - * @param {ArrayBuffer | Blob | File} fileSlice - The file slice - * @param {Range} range - The range value - * @param {number} totalSize - The total size of a complete file - */ - public async uploadSlice(fileSlice: ArrayBuffer | Blob | File, range: Range, totalSize: number): Promise { - let self = this; - try { - return await self.client - .api(self.uploadSession.url) - .headers({ - "Content-Length": `${range.maxValue - range.minValue + 1}`, - "Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}` - }) - .put(fileSlice); - } catch (err) { - throw err; - } - } + /** + * @public + * @async + * Uploads given slice to the server + * @param {ArrayBuffer | Blob | File} fileSlice - The file slice + * @param {Range} range - The range value + * @param {number} totalSize - The total size of a complete file + */ + public async uploadSlice(fileSlice: ArrayBuffer | Blob | File, range: Range, totalSize: number): Promise { + try { + return await this.client + .api(this.uploadSession.url) + .headers({ + "Content-Length": `${range.maxValue - range.minValue + 1}`, + "Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`, + }) + .put(fileSlice); + } catch (err) { + throw err; + } + } - /** - * @public - * @async - * Deletes upload session in the server - * @returns The promise resolves to cancelled response - */ - public async cancel(): Promise { - let self = this; - try { - return await self.client - .api(self.uploadSession.url) - .delete(); - } catch (err) { - throw err; - } - } + /** + * @public + * @async + * Deletes upload session in the server + * @returns The promise resolves to cancelled response + */ + public async cancel(): Promise { + try { + return await this.client.api(this.uploadSession.url).delete(); + } catch (err) { + throw err; + } + } - /** - * @public - * @async - * Gets status for the upload session - * @returns The promise resolves to the status enquiry response - */ - public async getStatus(): Promise { - let self = this; - try { - let response = await self.client - .api(self.uploadSession.url) - .get(); - self.updateTaskStatus(response); - return response; - } catch (err) { - throw err; - } - } + /** + * @public + * @async + * Gets status for the upload session + * @returns The promise resolves to the status enquiry response + */ + public async getStatus(): Promise { + try { + const response = await this.client.api(this.uploadSession.url).get(); + this.updateTaskStatus(response); + return response; + } catch (err) { + throw err; + } + } - /** - * @public - * @async - * Resumes upload session and continue uploading the file from the last sent range - * @returns The promise resolves to the uploaded response - */ - public async resume(): Promise { - let self = this; - try { - await self.getStatus(); - return await self.upload(); - } catch (err) { - throw err; - } - } + /** + * @public + * @async + * Resumes upload session and continue uploading the file from the last sent range + * @returns The promise resolves to the uploaded response + */ + public async resume(): Promise { + try { + await this.getStatus(); + return await this.upload(); + } catch (err) { + throw err; + } + } } diff --git a/src/tasks/OneDriveLargeFileUploadTask.ts b/src/tasks/OneDriveLargeFileUploadTask.ts index 655978d6f..6188a254c 100644 --- a/src/tasks/OneDriveLargeFileUploadTask.ts +++ b/src/tasks/OneDriveLargeFileUploadTask.ts @@ -10,6 +10,7 @@ */ import { Client } from "../index"; + import { FileObject, LargeFileUploadSession, LargeFileUploadTask, LargeFileUploadTaskOptions } from "./LargeFileUploadTask"; import { getValidRangeSize } from "./OneDriveLargeFileUploadTaskUtil"; @@ -21,148 +22,151 @@ import { getValidRangeSize } from "./OneDriveLargeFileUploadTaskUtil"; * @property {number} [rangeSize] - Specifies the range chunk size */ interface OneDriveLargeFileUploadOptions { - fileName: string; - path?: string; - rangeSize?: number; -}; + fileName: string; + path?: string; + rangeSize?: number; +} /** * @class * Class representing OneDriveLargeFileUploadTask */ export class OneDriveLargeFileUploadTask extends LargeFileUploadTask { + /** + * @private + * @static + * Default path for the file being uploaded + */ + private static DEFAULT_UPLOAD_PATH: string = "/"; - /** - * @private - * @static - * Default path for the file being uploaded - */ - private static DEFAULT_UPLOAD_PATH: string = "/"; - - /** - * @public - * @constructor - * Constructs a OneDriveLargeFileUploadTask - * @param {Client} client - The GraphClient instance - * @param {FileObject} file - The FileObject holding details of a file that needs to be uploaded - * @param {LargeFileUploadSession} uploadSession - The upload session to which the upload has to be done - * @param {LargeFileUploadTaskOptions} options - The upload task options - * @returns An instance of OneDriveLargeFileUploadTask - */ - public constructor(client: Client, file: FileObject, uploadSession: LargeFileUploadSession, options: LargeFileUploadTaskOptions) { - super(client, file, uploadSession, options); - } + /** + * @public + * @static + * @async + * Creates a OneDriveLargeFileUploadTask + * @param {Client} client - The GraphClient instance + * @param {Blob | Buffer | File} file - File represented as Blob, Buffer or File + * @param {OneDriveLargeFileUploadOptions} options - The options for upload task + * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance + */ + public static async create(client: Client, file: Blob | Buffer | File, options: OneDriveLargeFileUploadOptions): Promise { + const name: string = options.fileName; + let content; + let size; + switch (file.constructor.name) { + case "Blob": + content = new File([file as Blob], name); + size = content.size; + break; + case "File": + content = file as File; + size = content.size; + break; + case "Buffer": + const b = file as Buffer; + size = b.byteLength - b.byteOffset; + content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); + break; + } + try { + const requestUrl = OneDriveLargeFileUploadTask.constructCreateSessionUrl(options.fileName, options.path); + const session = await OneDriveLargeFileUploadTask.createUploadSession(client, requestUrl, options.fileName); + const rangeSize = getValidRangeSize(options.rangeSize); + const fileObj: FileObject = { + name, + content, + size, + }; + return new OneDriveLargeFileUploadTask(client, fileObj, session, { + rangeSize, + }); + } catch (err) { + throw err; + } + } - /** - * @public - * @static - * @async - * Creates a OneDriveLargeFileUploadTask - * @param {Client} client - The GraphClient instance - * @param {Blob | Buffer | File} file - File represented as Blob, Buffer or File - * @param {OneDriveLargeFileUploadOptions} options - The options for upload task - * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance - */ - public static async create(client: Client, file: Blob | Buffer | File, options: OneDriveLargeFileUploadOptions): Promise { - let fileObj: FileObject = {}; - fileObj.name = options.fileName; - switch (file.constructor.name) { - case "Blob": - fileObj.content = new File([file as Blob], fileObj.name); - fileObj.size = fileObj.content.size; - break; - case "File": - let _file = file as File; - fileObj.content = _file; - fileObj.size = _file.size; - break; - case "Buffer": - let b = file as Buffer; - fileObj.size = b.byteLength - b.byteOffset; - fileObj.content = b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); - break; - } - try { - let requestUrl = OneDriveLargeFileUploadTask.constructCreateSessionUrl(options.fileName, options.path); - let session = await OneDriveLargeFileUploadTask.createUploadSession(client, requestUrl, options.fileName); - let rangeSize = getValidRangeSize(options.rangeSize); - return new OneDriveLargeFileUploadTask(client, fileObj, session, { rangeSize }); - } catch (err) { - throw err; - } - } + /** + * @public + * @static + * Constructs the create session url for Onedrive + * @param {string} fileName - The name of the file + * @param {path} [path = OneDriveLargeFileUploadTask.DEFAULT_UPLOAD_PATH] - The path for the upload + * @returns The constructed create session url + */ + public static constructCreateSessionUrl(fileName: string, path: string = OneDriveLargeFileUploadTask.DEFAULT_UPLOAD_PATH): string { + fileName = fileName.trim(); + path = path.trim(); + if (path === "") { + path = "/"; + } + if (path[0] !== "/") { + path = `/${path}`; + } + if (path[path.length - 1] !== "/") { + path = `${path}/`; + } + return encodeURI(`/me/drive/root:${path}${fileName}:/createUploadSession`); + } - /** - * @public - * @static - * Constructs the create session url for Onedrive - * @param {string} fileName - The name of the file - * @param {path} [path = OneDriveLargeFileUploadTask.DEFAULT_UPLOAD_PATH] - The path for the upload - * @returns The constructed create session url - */ - public static constructCreateSessionUrl(fileName: string, path: string = OneDriveLargeFileUploadTask.DEFAULT_UPLOAD_PATH): string { - fileName = fileName.trim(); - path = path.trim(); - if (path === "") { - path = "/"; - } - if (path[0] !== "/") { - path = `/${path}`; - } - if (path[path.length - 1] !== "/") { - path = `${path}/`; - } - return encodeURI(`/me/drive/root:${path}${fileName}:/createUploadSession`); - } + /** + * @public + * @static + * @async + * Makes request to the server to create an upload session + * @param {Client} client - The GraphClient instance + * @param {string} requestUrl - The URL to create the upload session + * @param {string} fileName - The name of a file to upload, (with extension) + * @returns The promise that resolves to LargeFileUploadSession + */ + public static async createUploadSession(client: Client, requestUrl: string, fileName: string): Promise { + const payload = { + item: { + "@microsoft.graph.conflictBehavior": "rename", + name: fileName, + }, + }; + try { + const session = await client.api(requestUrl).post(payload); + const largeFileUploadSession: LargeFileUploadSession = { + url: session.uploadUrl, + expiry: new Date(session.expirationDateTime), + }; + return largeFileUploadSession; + } catch (err) { + throw err; + } + } - /** - * @public - * @static - * @async - * Makes request to the server to create an upload session - * @param {Client} client - The GraphClient instance - * @param {string} requestUrl - The URL to create the upload session - * @param {string} fileName - The name of a file to upload, (with extension) - * @returns The promise that resolves to LargeFileUploadSession - */ - public static async createUploadSession(client: Client, requestUrl: string, fileName: string): Promise { - let payload = { - item: { - "@microsoft.graph.conflictBehavior": "rename", - name: fileName - } - }; - try { - let session = await client.api(requestUrl).post(payload), - largeFileUploadSession: LargeFileUploadSession = { - url: session.uploadUrl, - expiry: new Date(session.expirationDateTime) - }; - return largeFileUploadSession; - } catch (err) { - throw err; - } - } + /** + * @public + * @constructor + * Constructs a OneDriveLargeFileUploadTask + * @param {Client} client - The GraphClient instance + * @param {FileObject} file - The FileObject holding details of a file that needs to be uploaded + * @param {LargeFileUploadSession} uploadSession - The upload session to which the upload has to be done + * @param {LargeFileUploadTaskOptions} options - The upload task options + * @returns An instance of OneDriveLargeFileUploadTask + */ + public constructor(client: Client, file: FileObject, uploadSession: LargeFileUploadSession, options: LargeFileUploadTaskOptions) { + super(client, file, uploadSession, options); + } - /** - * @public - * Commits upload session to end uploading - * @param {string} requestUrl - The URL to commit the upload session - * @returns The promise resolves to committed response - */ - public async commit(requestUrl: string): Promise { - let self = this; - try { - let payload = { - name: self.file.name, - "@microsoft.graph.conflictBehavior": "rename", - "@microsoft.graph.sourceUrl": self.uploadSession.url - } - return await self.client - .api(requestUrl) - .put(payload) - } catch (err) { - throw err; - } - } + /** + * @public + * Commits upload session to end uploading + * @param {string} requestUrl - The URL to commit the upload session + * @returns The promise resolves to committed response + */ + public async commit(requestUrl: string): Promise { + try { + const payload = { + name: this.file.name, + "@microsoft.graph.conflictBehavior": "rename", + "@microsoft.graph.sourceUrl": this.uploadSession.url, + }; + return await this.client.api(requestUrl).put(payload); + } catch (err) { + throw err; + } + } } diff --git a/src/tasks/OneDriveLargeFileUploadTaskUtil.ts b/src/tasks/OneDriveLargeFileUploadTaskUtil.ts index 419cc3e3d..268399469 100644 --- a/src/tasks/OneDriveLargeFileUploadTaskUtil.ts +++ b/src/tasks/OneDriveLargeFileUploadTaskUtil.ts @@ -20,26 +20,27 @@ const DEFAULT_FILE_SIZE: number = 5 * 1024 * 1024; * @constant * Rounds off the given value to a multiple of 320 KB * @param {number} value - The value - * @returns The rounded off value + * @returns The rounded off value */ const roundTo320KB = (value: number): number => { - if (value > (320 * 1024)) { - value = Math.floor(value / (320 * 1024)) * 320 * 1024; - } - return value; -} + if (value > 320 * 1024) { + value = Math.floor(value / (320 * 1024)) * 320 * 1024; + } + return value; +}; /** * @constant - * Get the valid rangeSize for a file slicing (validity is based on the constrains mentioned in here {@link https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_createuploadsession#upload-bytes-to-the-upload-session}) - * + * Get the valid rangeSize for a file slicing (validity is based on the constrains mentioned in here + * {@link https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_createuploadsession#upload-bytes-to-the-upload-session}) + * * @param {number} [rangeSize = DEFAULT_FILE_SIZE] - The rangeSize value. * @returns The valid rangeSize */ export const getValidRangeSize = (rangeSize: number = DEFAULT_FILE_SIZE): number => { - const sixtyMB = 60 * 1024 * 1024; - if (rangeSize > sixtyMB) { - rangeSize = sixtyMB; - } - return roundTo320KB(rangeSize); -} + const sixtyMB = 60 * 1024 * 1024; + if (rangeSize > sixtyMB) { + rangeSize = sixtyMB; + } + return roundTo320KB(rangeSize); +}; diff --git a/src/tasks/PageIterator.ts b/src/tasks/PageIterator.ts index f92fb2b65..663bed7cd 100644 --- a/src/tasks/PageIterator.ts +++ b/src/tasks/PageIterator.ts @@ -18,155 +18,148 @@ import { Client } from "../index"; * @property {any} Additional - Any number of additional properties (This is to accept the any additional data returned by in the response to the nextLink request) */ export interface PageCollection { - value: any[]; - "@odata.nextLink"?: string; - "@odata.deltaLink"?: string; - [Key: string]: any; + value: any[]; + "@odata.nextLink"?: string; + "@odata.deltaLink"?: string; + [Key: string]: any; } /** * Signature representing callback for page iterator - * @property {Function} callback - The callback function which should return boolean to continue the continue/stop the iteration. + * @property {Function} callback - The callback function which should return boolean to continue the continue/stop the iteration. */ -export interface PageIteratorCallback { - (any): boolean; -} +export type PageIteratorCallback = (data: any) => boolean; /** * @class * Class for PageIterator */ export class PageIterator { - - /** - * @private - * Member holding the GraphClient instance - */ - private client: Client; - - /** - * @private - * Member holding the page collection - */ - private collection: any[]; - - /** - * @private - * Member variable referring to nextLink of the page collection - */ - private nextLink: string | undefined; - - /** - * @private - * Member variable referring to deltaLink of the request - */ - private deltaLink: string | undefined; - - /** - * @private - * Holding callback for Iteration. - */ - - private callback: PageIteratorCallback; - - /** - * @public - * @constructor - * Creates new instance for PageIterator - * @param {Client} client - The graph client instance - * @param {PageCollection} pageCollection - The page collection object - * @param {PageIteratorCallback} callBack - The callback function - * @returns An instance of a PageIterator - */ - public constructor(client: Client, pageCollection: PageCollection, callback: PageIteratorCallback) { - let self = this; - self.client = client; - self.collection = pageCollection.value; - self.nextLink = pageCollection["@odata.nextLink"]; - self.deltaLink = pageCollection["@odata.deltaLink"]; - self.callback = callback; - } - - /** - * @private - * Iterates over a collection by enqueuing entries one by one and kicking the callback with the enqueued entry - * @returns A boolean indicating the continue flag to process next page - */ - private iterationHelper(): boolean { - let self = this; - if (self.collection === undefined) { - return false; - } - let advance = true; - while (advance && self.collection.length !== 0) { - let item = self.collection.shift(); - advance = self.callback(item); - } - return advance; - } - - /** - * @private - * @async - * Helper to make a get request to fetch next page with nextLink url and update the page iterator instance with the returned response - * @returns A promise that resolves to a response data with next page collection - */ - private async fetchAndUpdateNextPageData(): Promise { - try { - let self = this, - response: PageCollection = await self.client.api(self.nextLink).get(); - self.collection = response.value; - self.nextLink = response["@odata.nextLink"]; - self.deltaLink = response["@odata.deltaLink"]; - } catch (error) { - throw error; - } - } - - /** - * @public - * Getter to get the deltaLink in the current response - * @returns A deltaLink which is being used to make delta requests in future - */ - public getDeltaLink(): string | undefined { - return this.deltaLink; - } - - /** - * @public - * @async - * Iterates over the collection and kicks callback for each item on iteration. Fetches next set of data through nextLink and iterates over again - * This happens until the nextLink is drained out or the user responds with a red flag to continue from callback - * @returns A Promise that resolves to nothing on completion and throws error incase of any discrepancy. - */ - public async iterate(): Promise { - try { - let self = this, - advance = self.iterationHelper(); - while (advance) { - if (self.nextLink !== undefined) { - await self.fetchAndUpdateNextPageData(); - advance = self.iterationHelper(); - } else { - advance = false; - } - } - } catch (error) { - throw error; - } - } - - /** - * @public - * @async - * This internally calls the iterate method, It's just for more readability. - * @returns A Promise that resolves to nothing on completion and throws error incase of any discrepancy - */ - public async resume(): Promise { - try { - return this.iterate(); - } catch (error) { - throw error; - } - } + /** + * @private + * Member holding the GraphClient instance + */ + private client: Client; + + /** + * @private + * Member holding the page collection + */ + private collection: any[]; + + /** + * @private + * Member variable referring to nextLink of the page collection + */ + private nextLink: string | undefined; + + /** + * @private + * Member variable referring to deltaLink of the request + */ + private deltaLink: string | undefined; + + /** + * @private + * Holding callback for Iteration. + */ + + private callback: PageIteratorCallback; + + /** + * @public + * @constructor + * Creates new instance for PageIterator + * @param {Client} client - The graph client instance + * @param {PageCollection} pageCollection - The page collection object + * @param {PageIteratorCallback} callBack - The callback function + * @returns An instance of a PageIterator + */ + public constructor(client: Client, pageCollection: PageCollection, callback: PageIteratorCallback) { + this.client = client; + this.collection = pageCollection.value; + this.nextLink = pageCollection["@odata.nextLink"]; + this.deltaLink = pageCollection["@odata.deltaLink"]; + this.callback = callback; + } + + /** + * @private + * Iterates over a collection by enqueuing entries one by one and kicking the callback with the enqueued entry + * @returns A boolean indicating the continue flag to process next page + */ + private iterationHelper(): boolean { + if (this.collection === undefined) { + return false; + } + let advance = true; + while (advance && this.collection.length !== 0) { + const item = this.collection.shift(); + advance = this.callback(item); + } + return advance; + } + + /** + * @private + * @async + * Helper to make a get request to fetch next page with nextLink url and update the page iterator instance with the returned response + * @returns A promise that resolves to a response data with next page collection + */ + private async fetchAndUpdateNextPageData(): Promise { + try { + const response: PageCollection = await this.client.api(this.nextLink).get(); + this.collection = response.value; + this.nextLink = response["@odata.nextLink"]; + this.deltaLink = response["@odata.deltaLink"]; + } catch (error) { + throw error; + } + } + + /** + * @public + * Getter to get the deltaLink in the current response + * @returns A deltaLink which is being used to make delta requests in future + */ + public getDeltaLink(): string | undefined { + return this.deltaLink; + } + + /** + * @public + * @async + * Iterates over the collection and kicks callback for each item on iteration. Fetches next set of data through nextLink and iterates over again + * This happens until the nextLink is drained out or the user responds with a red flag to continue from callback + * @returns A Promise that resolves to nothing on completion and throws error incase of any discrepancy. + */ + public async iterate(): Promise { + try { + let advance = this.iterationHelper(); + while (advance) { + if (this.nextLink !== undefined) { + await this.fetchAndUpdateNextPageData(); + advance = this.iterationHelper(); + } else { + advance = false; + } + } + } catch (error) { + throw error; + } + } + + /** + * @public + * @async + * This internally calls the iterate method, It's just for more readability. + * @returns A Promise that resolves to nothing on completion and throws error incase of any discrepancy + */ + public async resume(): Promise { + try { + return this.iterate(); + } catch (error) { + throw error; + } + } } diff --git a/tsconfig.json b/tsconfig.json index 71c148b85..e25dde68d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,25 +1,17 @@ { - "compilerOptions": { - "module": "commonjs", - "noEmitOnError": true, - "noImplicitAny": false, - "moduleResolution": "node", - "importHelpers": true, - "removeComments": false, - "sourceMap": true, - "target": "es5", - "lib": ["dom", "es7"], - "declaration": true, - "outDir": "lib" - }, - "exclude": [ - "node_modules", - "lib", - "samples", - "spec/development" - ], - "include": [ - "./src/**/*.ts", - "./spec/**/*.ts" - ] + "compilerOptions": { + "module": "commonjs", + "noEmitOnError": true, + "noImplicitAny": false, + "moduleResolution": "node", + "importHelpers": true, + "removeComments": false, + "sourceMap": true, + "target": "es5", + "lib": ["dom", "es7"], + "declaration": true, + "outDir": "lib" + }, + "exclude": ["node_modules", "lib", "samples", "spec/development"], + "include": ["./src/**/*.ts", "./spec/**/*.ts"] } diff --git a/tslint.json b/tslint.json new file mode 100644 index 000000000..fb83c4c12 --- /dev/null +++ b/tslint.json @@ -0,0 +1,21 @@ +{ + "extends": ["tslint:latest", "tslint-config-prettier"], + "rules": { + "interface-name": [true, "never-prefix"], + "max-line-length": [true, 200], + "no-implicit-dependencies": [true, "dev"], + "object-literal-sort-keys": false, + "ordered-imports": [ + true, + { + "grouped-imports": true + } + ], + "member-ordering": [ + true, + { + "order": ["private-static-field", "protected-static-field", "public-static-field", "private-instance-field", "protected-instance-field", "public-instance-field", "private-static-method", "protected-static-method", "public-static-method", "private-constructor", "protected-constructor", "public-constructor", "private-instance-method", "protected-instance-method", "public-instance-method"] + } + ] + } +}