From ed2e31cdb0105acc43cc7da285d7744db55262a0 Mon Sep 17 00:00:00 2001 From: Tom Wayson Date: Wed, 29 Sep 2021 17:42:59 -0700 Subject: [PATCH] refactor(hub-annotations): remove @esri/hub-annotations package ISSUES CLOSED: #627 --- README.md | 16 +- package-lock.json | 9 - packages/annotations/README.md | 87 - packages/annotations/package-lock.json | 1909 ----------------- packages/annotations/package.json | 78 - packages/annotations/src/add.ts | 73 - packages/annotations/src/create.ts | 160 -- packages/annotations/src/delete.ts | 30 - packages/annotations/src/index.ts | 13 - packages/annotations/src/layer-definition.ts | 252 --- packages/annotations/src/search.ts | 284 --- packages/annotations/src/update.ts | 43 - packages/annotations/src/util.ts | 101 - packages/annotations/src/vote.ts | 127 -- packages/annotations/test/create.test.ts | 254 --- packages/annotations/test/crud.test.ts | 278 --- packages/annotations/test/mocks/ago_search.ts | 78 - .../annotations/test/mocks/anno_search.ts | 612 ------ packages/annotations/test/mocks/portal.ts | 112 - packages/annotations/test/search.test.ts | 343 --- packages/annotations/test/util.test.ts | 103 - packages/annotations/test/vote.test.ts | 320 --- packages/annotations/tsconfig.json | 6 - 23 files changed, 11 insertions(+), 5277 deletions(-) delete mode 100644 packages/annotations/README.md delete mode 100644 packages/annotations/package-lock.json delete mode 100644 packages/annotations/package.json delete mode 100644 packages/annotations/src/add.ts delete mode 100644 packages/annotations/src/create.ts delete mode 100644 packages/annotations/src/delete.ts delete mode 100644 packages/annotations/src/index.ts delete mode 100644 packages/annotations/src/layer-definition.ts delete mode 100644 packages/annotations/src/search.ts delete mode 100644 packages/annotations/src/update.ts delete mode 100644 packages/annotations/src/util.ts delete mode 100644 packages/annotations/src/vote.ts delete mode 100644 packages/annotations/test/create.test.ts delete mode 100644 packages/annotations/test/crud.test.ts delete mode 100644 packages/annotations/test/mocks/ago_search.ts delete mode 100644 packages/annotations/test/mocks/anno_search.ts delete mode 100644 packages/annotations/test/mocks/portal.ts delete mode 100644 packages/annotations/test/search.test.ts delete mode 100644 packages/annotations/test/util.test.ts delete mode 100644 packages/annotations/test/vote.test.ts delete mode 100644 packages/annotations/tsconfig.json diff --git a/README.md b/README.md index 89375550746..a3dc4d19983 100644 --- a/README.md +++ b/README.md @@ -73,15 +73,21 @@ Some useful commands include: ### Packages - [`@esri/hub-common`](./packages/common) - Common TypeScript types and utility functions. -- [`@esri/hub-initiatives`](./packages/initiatives) - Helper functions for working with [Initiatives](http://doc.arcgis.com/en/hub/initiatives/initiatives-overview.htm). -- [`@esri/hub-annotations`](./packages/annotations) - Helper functions for working with Annotations. -- [`@esri/hub-sites`](./packages/sites) - Helper functions for working with [Sites](http://doc.arcgis.com/en/hub/sites/create-a-hub-site.htm), Pages and Domains. -- [`@esri/hub-auth`](./packages/auth) - Helper functions for authentication for external applications. +- [`@esri/hub-content`](./packages/content) - Helper functions for working with Hub Content. +- [`@esri/hub-discussions`](./packages/discussions) - Module to interact with ArcGIS Hub Discussions API +- [`@esri/hub-downloads`](./packages/downloads) - Helper functions for working with downloads. - [`@esri/hub-events`](./packages/events) - Helper functions for working with Events. +- [`@esri/hub-initiatives`](./packages/initiatives) - Helper functions for working with [Initiatives](http://doc.arcgis.com/en/hub/initiatives/initiatives-overview.htm). - [`@esri/hub-search`](./packages/search) - Helper functions for search on ArcGIS Online. +- [`@esri/hub-sites`](./packages/sites) - Helper functions for working with [Sites](http://doc.arcgis.com/en/hub/sites/create-a-hub-site.htm), Pages and Domains. - [`@esri/hub-surveys`](./packages/surveys) - Helper functions for working with Surveys. - [`@esri/hub-teams`](./packages/teams) - Helper functions for working with ArcGIS Online groups in a Hub context. -- [`@esri/hub-content`](./packages/content) - Helper functions for working with Hub Content. + +#### Deprecated Packages + +- [`@esri/hub-annotations`](https://github.com/Esri/hub.js/tree/cee44463c5cbf616abdb7786551d72a7792bb3c4/packages/annotations) - Hub Annotations have been replaced with Hub Discussions, see [`@esri/hub-discussions`](./packages/discussions) +- [`@esri/hub-auth`](https://github.com/Esri/hub.js/tree/v6.10.0/packages/auth) - moved to [`@esri/hub-common`](./packages/common) +- [`@esri/hub-types`](https://github.com/Esri/hub.js/tree/v6.10.0/packages/types) - moved to [`@esri/hub-common`](./packages/common) ### Design Philosophy diff --git a/package-lock.json b/package-lock.json index 11077e7ee45..43509f4e416 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5047,15 +5047,6 @@ "tslib": "^1.10.0" } }, - "@esri/arcgis-rest-service-admin": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-service-admin/-/arcgis-rest-service-admin-3.4.1.tgz", - "integrity": "sha512-6vbF6vJSZq2ShNSaYfWOd5z/tJvpjg18asT4f4CrQTj0LEkSq3/ZsDvJ+ubGThj8qkzqnOqLzOMNsGuUKIbeOw==", - "requires": { - "@esri/arcgis-rest-types": "^3.4.1", - "tslib": "^1.13.0" - } - }, "@esri/arcgis-rest-types": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-types/-/arcgis-rest-types-3.4.1.tgz", diff --git a/packages/annotations/README.md b/packages/annotations/README.md deleted file mode 100644 index 2cf2de3589a..00000000000 --- a/packages/annotations/README.md +++ /dev/null @@ -1,87 +0,0 @@ -[![npm version][npm-img]][npm-url] -[![build status][travis-img]][travis-url] -[![gzip bundle size][gzip-image]][npm-url] -[![Coverage Status][coverage-img]][coverage-url] -[![apache licensed](https://img.shields.io/badge/license-Apache-green.svg?style=flat-square)](https://github.com/raw/Esri/hub.js/master/LICENSE) - -[npm-img]: https://img.shields.io/npm/v/@esri/hub-annotations.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/@esri/hub-annotations -[travis-img]: https://img.shields.io/travis/Esri/hub.js/master.svg?style=flat-square -[travis-url]: https://travis-ci.org/Esri/hub.js -[gzip-image]: https://img.badgesize.io/https://unpkg.com/@esri/hub-annotations/dist/umd/annotations.umd.min.js?compression=gzip -[coverage-img]: https://codecov.io/gh/Esri/hub.js/branch/master/graph/badge.svg -[coverage-url]: https://codecov.io/gh/Esri/hub.js - -# @esri/hub-annotations - -**Hub Annotations have been replaced with Hub Discussions, see [`@esri/hub-discussions`](../discussions).** - -> Module to interact with ArcGIS Hub Annotations in Node.js and modern browsers. - -### Example - -```bash -npm install @esri/hub-annotations -``` -```js -import { getAnnotationServiceUrl, searchAnnotations } from "@esri/hub-annotations"; - - // pass in an organization id -getAnnotationServiceUrl("abc123") - .then(annotationsUrl => { - // https://services.arcgis.com/abc123/arcgis/rest/services/Hub Annotations/FeatureServer - searchAnnotations({ - url: annotationsUrl + "/0" - }) - .then( response => { - // { - // data: [{ - // id: "User1", - // type: "annotations", - // attributes: {description: "Great place!", ...} - // }], - // included: [{ - // id: "User1", - // type: "users", - // attributes: { firstName: "User", lastName: "Name", ...} - // }] - // } - }); - }); -``` - -## [API Reference](https://esri.github.io/hub.js/api/annotations/) - -### Issues - -If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/hub.js/issues) first. Have you found a new bug? Want to request a new feature? We'd [**love**](https://github.com/Esri/hub.js/issues/new) to hear from you. - -If you're looking for help you can also post issues on [GIS Stackexchange](http://gis.stackexchange.com/questions/ask?tags=esri-oss). - -### Versioning - -For transparency into the release cycle and in striving to maintain backward compatibility, @esri/hub.js is maintained under Semantic Versioning guidelines and will adhere to these rules whenever possible. - -For more information on SemVer, please visit . - -### Contributing - -Esri welcomes contributions from anyone and everyone. Please see our [guidelines for contributing](CONTRIBUTING.md). - -### License - -Copyright © 2018 Esri - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -> http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -A copy of the license is available in the repository's [LICENSE](../../LICENSE) file. diff --git a/packages/annotations/package-lock.json b/packages/annotations/package-lock.json deleted file mode 100644 index fe5668bf541..00000000000 --- a/packages/annotations/package-lock.json +++ /dev/null @@ -1,1909 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", - "requires": { - "@babel/highlight": "^7.14.5" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==" - }, - "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.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==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "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==", - "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=" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@babel/runtime": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", - "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@esri/arcgis-rest-auth": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-auth/-/arcgis-rest-auth-3.3.1.tgz", - "integrity": "sha512-1TMiqa5+14aZJ1v3VdotInDdOmKrw+A78AfsO2JOmgupklOw7vHL5c2VbfoA9DaCg3TSDTmKKEXkqqtqCEQGvw==", - "requires": { - "@esri/arcgis-rest-types": "^3.3.1", - "tslib": "^1.13.0" - } - }, - "@esri/arcgis-rest-feature-layer": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-feature-layer/-/arcgis-rest-feature-layer-3.3.1.tgz", - "integrity": "sha512-x6GZ6YsA22iC7d0B1H4Y0FT5BrZ7xGrOlrHNa6Wio90RdxgCv+lSWTzShmZtZB6dkIHQQaRdZ3NIrK9y7l4PtA==", - "requires": { - "@esri/arcgis-rest-types": "^3.3.1", - "tslib": "^1.13.0" - } - }, - "@esri/arcgis-rest-portal": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-portal/-/arcgis-rest-portal-3.3.1.tgz", - "integrity": "sha512-yIndjaPZOqy3RmGEXaTOpkGvzfi4aqCKt5hKcl0/JkdK9p5YsvXSlXFjT918ru+L7fZPFVeXUOQXqG3K8q3fKA==", - "requires": { - "@esri/arcgis-rest-types": "^3.3.1", - "tslib": "^1.13.0" - } - }, - "@esri/arcgis-rest-request": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-request/-/arcgis-rest-request-3.3.1.tgz", - "integrity": "sha512-96Tb/6c5mmN80a6pjnGBYaZ0fW6m56g1Z/8QKlYPyI75fr0Ddx8W1seAXWQfF4hGibUcyZ5SyNG2LG4ZGAeu+g==", - "requires": { - "tslib": "^1.10.0" - } - }, - "@esri/arcgis-rest-service-admin": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-service-admin/-/arcgis-rest-service-admin-3.3.1.tgz", - "integrity": "sha512-vLcN7DtNCtlrqXjEId3psAXNc4o58DxniTrvf8+IluAq316K/3f6OJKYwh1QRgVS7ZUtiH4VY973nqoQEX1qYA==", - "requires": { - "@esri/arcgis-rest-types": "^3.3.1", - "tslib": "^1.13.0" - } - }, - "@esri/arcgis-rest-types": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@esri/arcgis-rest-types/-/arcgis-rest-types-3.3.1.tgz", - "integrity": "sha512-cqLUTW1PfF8anbeSmFe7kDYlm3YQntNGsAdmVtFWu3rm9IfmojtniHPjNtDQF6Y0P34MBMaLmSh+xdhxRAp32g==" - }, - "@gar/promisify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz", - "integrity": "sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==" - }, - "@npmcli/fs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.0.0.tgz", - "integrity": "sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ==", - "requires": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "@npmcli/git": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.1.0.tgz", - "integrity": "sha512-/hBFX/QG1b+N7PZBFs0bi+evgRZcK9nWBxQKZkGoXUT5hJSwl5c4d7y8/hm+NQZRPhQ67RzFaj5UM9YeyKoryw==", - "requires": { - "@npmcli/promise-spawn": "^1.3.2", - "lru-cache": "^6.0.0", - "mkdirp": "^1.0.4", - "npm-pick-manifest": "^6.1.1", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^2.0.2" - } - }, - "@npmcli/installed-package-contents": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-1.0.7.tgz", - "integrity": "sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==", - "requires": { - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "@npmcli/move-file": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "requires": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - } - }, - "@npmcli/node-gyp": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-1.0.2.tgz", - "integrity": "sha512-yrJUe6reVMpktcvagumoqD9r08fH1iRo01gn1u0zoCApa9lnZGEigVKUd2hzsCId4gdtkZZIVscLhNxMECKgRg==" - }, - "@npmcli/promise-spawn": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz", - "integrity": "sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==", - "requires": { - "infer-owner": "^1.0.4" - } - }, - "@npmcli/run-script": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-1.8.6.tgz", - "integrity": "sha512-e42bVZnC6VluBZBAFEr3YrdqSspG3bgilyg4nSLBJ7TRGNCzxHa92XAHxQBLYg0BmgwO4b2mf3h/l5EkEWRn3g==", - "requires": { - "@npmcli/node-gyp": "^1.0.2", - "@npmcli/promise-spawn": "^1.3.2", - "node-gyp": "^7.1.0", - "read-package-json-fast": "^2.0.1" - } - }, - "@rollup/plugin-commonjs": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz", - "integrity": "sha512-xCQqz4z/o0h2syQ7d9LskIMvBSH4PX5PjYdpSSvgS+pQik3WahkQVNWg3D8XJeYjZoVWnIUQYDghuEMRGrmQYQ==", - "requires": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - } - }, - "@rollup/plugin-json": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", - "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", - "requires": { - "@rollup/pluginutils": "^3.0.8" - } - }, - "@rollup/plugin-node-resolve": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", - "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", - "requires": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.17.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "dependencies": { - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" - } - } - }, - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" - }, - "@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" - }, - "@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "requires": { - "@types/node": "*" - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - } - }, - "agentkeepalive": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.1.4.tgz", - "integrity": "sha512-+V/rGa3EuU74H6wR04plBb7Ks10FbtUQgRj/FQOG7uUIEuaINI+AiqJR1k6t3SVNs7o7ZjIdus6706qqzVq8jQ==", - "requires": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "requires": { - "string-width": "^3.0.0" - }, - "dependencies": { - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - } - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "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=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "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=" - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "boxen": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.1.tgz", - "integrity": "sha512-JtIQYts08AFAYGF4eSh3pUt3NQkYV/e75pRtQmAVTLNWR/1L7Bsswxlgzgk8nmLEM+gFszsIlA9BgD3XnSqp3g==", - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "brotli-size": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/brotli-size/-/brotli-size-4.0.0.tgz", - "integrity": "sha512-uA9fOtlTRC0iqKfzff1W34DXUA3GyVqbUaeo3Rw3d4gd1eavKVCETXrn3NzO74W+UVkG3UHu8WxUi+XvKI/huA==", - "requires": { - "duplexer": "0.1.1" - } - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" - }, - "builtin-modules": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", - "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==" - }, - "builtins": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=" - }, - "cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "requires": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - } - }, - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" - }, - "cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" - }, - "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=" - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "requires": { - "iconv-lite": "^0.6.2" - } - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" - }, - "err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" - }, - "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=" - }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "filesize": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.4.0.tgz", - "integrity": "sha512-mjFIpOHC4jbfcTfoh4rkWpI31mF7viw9ikj/JyLoKzqlwG/YsefKfvYlYhdYdg/9mtK2z1AzgN/0LvVQ3zdlSQ==" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "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==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "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=", - "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=", - "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=", - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "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" - } - }, - "graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" - }, - "gzip-size": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", - "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", - "requires": { - "duplexer": "^0.1.2" - }, - "dependencies": { - "duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "requires": { - "ajv": "^6.12.3", - "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==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", - "requires": { - "ms": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ignore-walk": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz", - "integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==", - "requires": { - "minimatch": "^3.0.4" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" - }, - "is-core-module": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", - "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", - "requires": { - "has": "^1.0.3" - } - }, - "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=" - }, - "is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=" - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=" - }, - "is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "requires": { - "@types/estree": "*" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jest-worker": { - "version": "24.9.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", - "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", - "requires": { - "merge-stream": "^2.0.0", - "supports-color": "^6.1.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "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==" - }, - "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=" - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "requires": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, - "mime-db": { - "version": "1.49.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", - "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==" - }, - "mime-types": { - "version": "2.1.32", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", - "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", - "requires": { - "mime-db": "1.49.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minipass": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", - "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-fetch": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "requires": { - "encoding": "^0.1.12", - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - } - }, - "minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-json-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", - "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", - "requires": { - "jsonparse": "^1.3.1", - "minipass": "^3.0.0" - } - }, - "minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "requires": { - "minipass": "^3.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" - }, - "node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.3", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", - "which": "^2.0.2" - } - }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "requires": { - "abbrev": "1" - } - }, - "npm-bundled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", - "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-install-checks": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", - "integrity": "sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w==", - "requires": { - "semver": "^7.1.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==" - }, - "npm-package-arg": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", - "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", - "requires": { - "hosted-git-info": "^4.0.1", - "semver": "^7.3.4", - "validate-npm-package-name": "^3.0.0" - } - }, - "npm-packlist": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.2.2.tgz", - "integrity": "sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg==", - "requires": { - "glob": "^7.1.6", - "ignore-walk": "^3.0.3", - "npm-bundled": "^1.1.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-pick-manifest": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-6.1.1.tgz", - "integrity": "sha512-dBsdBtORT84S8V8UTad1WlUyKIY9iMsAmqxHbLdeEeBNMLQDlDWWra3wYUx9EBEIiG/YwAy0XyNHDd2goAsfuA==", - "requires": { - "npm-install-checks": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1", - "npm-package-arg": "^8.1.2", - "semver": "^7.3.4" - } - }, - "npm-registry-fetch": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz", - "integrity": "sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA==", - "requires": { - "make-fetch-happen": "^9.0.1", - "minipass": "^3.1.3", - "minipass-fetch": "^1.3.0", - "minipass-json-stream": "^1.0.1", - "minizlib": "^2.0.0", - "npm-package-arg": "^8.0.0" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~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=" - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "pacote": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-11.3.5.tgz", - "integrity": "sha512-fT375Yczn4zi+6Hkk2TBe1x1sP8FgFsEIZ2/iWaXY2r/NkhDJfxbcn5paz1+RTFCyNf+dPnaoBDJoAxXSU8Bkg==", - "requires": { - "@npmcli/git": "^2.1.0", - "@npmcli/installed-package-contents": "^1.0.6", - "@npmcli/promise-spawn": "^1.2.0", - "@npmcli/run-script": "^1.8.2", - "cacache": "^15.0.5", - "chownr": "^2.0.0", - "fs-minipass": "^2.1.0", - "infer-owner": "^1.0.4", - "minipass": "^3.1.3", - "mkdirp": "^1.0.3", - "npm-package-arg": "^8.0.1", - "npm-packlist": "^2.1.4", - "npm-pick-manifest": "^6.0.0", - "npm-registry-fetch": "^11.0.0", - "promise-retry": "^2.0.1", - "read-package-json-fast": "^2.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.1.0" - } - }, - "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=" - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" - }, - "promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "requires": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - } - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "read-package-json-fast": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz", - "integrity": "sha512-W/BKtbL+dUjTuRL2vziuYhp76s5HZ9qQhd/dKfWIZveD0O40453QNyZhC0e63lqZrAQ4jiOapVoeJ7JrszenQQ==", - "requires": { - "json-parse-even-better-errors": "^2.3.0", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "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" - } - }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "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.3", - "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.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "rollup": { - "version": "2.56.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz", - "integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==", - "requires": { - "fsevents": "~2.3.2" - } - }, - "rollup-plugin-filesize": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-filesize/-/rollup-plugin-filesize-9.1.1.tgz", - "integrity": "sha512-x0r2A85TCEdRwF3rm+bcN4eAmbER8tt+YVf88gBQ6sLyH4oGcnNLPQqAUX+v7mIvHC/y59QwZvo6vxaC2ias6Q==", - "requires": { - "@babel/runtime": "^7.13.8", - "boxen": "^5.0.0", - "brotli-size": "4.0.0", - "colors": "^1.4.0", - "filesize": "^6.1.0", - "gzip-size": "^6.0.0", - "pacote": "^11.2.7", - "terser": "^5.6.0" - } - }, - "rollup-plugin-uglify": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.4.tgz", - "integrity": "sha512-ddgqkH02klveu34TF0JqygPwZnsbhHVI6t8+hGTcYHngPkQb5MIHI0XiztXIN/d6V9j+efwHAqEL7LspSxQXGw==", - "requires": { - "@babel/code-frame": "^7.0.0", - "jest-worker": "^24.0.0", - "serialize-javascript": "^2.1.2", - "uglify-js": "^3.4.9" - } - }, - "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==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "serialize-javascript": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", - "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" - }, - "smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" - }, - "socks": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", - "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", - "requires": { - "ip": "^1.1.5", - "smart-buffer": "^4.1.0" - } - }, - "socks-proxy-agent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.0.tgz", - "integrity": "sha512-57e7lwCN4Tzt3mXz25VxOErJKXlPfXmkMLnk310v/jwW20jWRVcgsOit+xNkN3eIEdB47GwnfAEBLacZ/wVIKg==", - "requires": { - "agent-base": "^6.0.2", - "debug": "^4.3.1", - "socks": "^2.6.1" - } - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" - }, - "source-map-support": { - "version": "0.5.20", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", - "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - } - } - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "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" - } - }, - "ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "requires": { - "minipass": "^3.1.1" - } - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, - "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==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, - "terser": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz", - "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==", - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.20" - } - }, - "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==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "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=" - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" - }, - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" - }, - "uglify-js": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", - "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==" - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - }, - "validate-npm-package-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", - "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", - "requires": { - "builtins": "^1.0.3" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "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=" - } - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "requires": { - "string-width": "^4.0.0" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - }, - "version": "8.24.0" -} diff --git a/packages/annotations/package.json b/packages/annotations/package.json deleted file mode 100644 index 13218a0449f..00000000000 --- a/packages/annotations/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "@esri/hub-annotations", - "version": "8.24.0", - "description": "Module to interact with ArcGIS Hub Annotations in Node.js and modern browsers.", - "main": "dist/node/index.js", - "unpkg": "dist/umd/annotations.umd.js", - "module": "dist/esm/index.js", - "es2017": "dist/es2017/index.js", - "sideEffects": false, - "types": "dist/types/index.d.ts", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^1.13.0" - }, - "peerDependencies": { - "@esri/arcgis-rest-auth": "^2.13.0 || 3", - "@esri/arcgis-rest-feature-layer": "^2.13.0 || 3", - "@esri/arcgis-rest-portal": "^2.13.0 || 3", - "@esri/arcgis-rest-request": "^2.13.0 || 3", - "@esri/arcgis-rest-service-admin": "^2.13.0 || 3", - "@esri/arcgis-rest-types": "^2.13.0 || 3" - }, - "devDependencies": { - "@esri/arcgis-rest-auth": "^3.1.1", - "@esri/arcgis-rest-feature-layer": "^3.2.1", - "@esri/arcgis-rest-portal": "^3.3.1", - "@esri/arcgis-rest-request": "^3.1.1", - "@esri/arcgis-rest-service-admin": "^3.1.1", - "@esri/arcgis-rest-types": "^3.1.1", - "@rollup/plugin-commonjs": "^15.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^9.0.0", - "rollup": "^2.26.5", - "rollup-plugin-filesize": "^9.0.2", - "rollup-plugin-uglify": "^6.0.4", - "typescript": "^3.8.1" - }, - "files": [ - "dist/**" - ], - "scripts": { - "prepare": "npm run build", - "build": "npm run build:node && npm run build:esm", - "build:esm": "tsc --outDir ./dist/es2017 --declaration --declarationDir ./dist/types", - "build:esm:es5": "tsc --module es2015 --target es5 --outDir ./dist/esm", - "build:node": "tsc --module commonjs --outDir ./dist/node", - "build:umd": "rollup -c ../../umd-base-profile.js && rollup -c ../../umd-production-profile.js", - "dev:esm": "npm run build:esm -- -w", - "dev:node": "npm run build:node -- -w", - "format": "prettier --write ./{src,test}/**/*.ts", - "format:check": "prettier --check ./{src,test}/**/*.ts" - }, - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Esri/hub.js.git" - }, - "contributors": [ - { - "name": "John Gravois", - "email": "john@esri.com" - }, - { - "name": "Tom Wayson", - "email": "twayson@esri.com" - } - ], - "bugs": { - "url": "https://github.com/Esri/hub.js/issues" - }, - "homepage": "https://github.com/Esri/hub.js#readme", - "gitHead": "5c3d6a4ddc88ce418b25bd1c8759ecc7aa561fd5", - "volta": { - "extends": "../../package.json" - } -} diff --git a/packages/annotations/src/add.ts b/packages/annotations/src/add.ts deleted file mode 100644 index 05837da9251..00000000000 --- a/packages/annotations/src/add.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { - addFeatures, - IAddFeaturesOptions -} from "@esri/arcgis-rest-feature-layer"; - -import { IFeature } from "@esri/arcgis-rest-types"; -import { IEditFeatureResult } from "@esri/arcgis-rest-feature-layer"; -import { checkResults, IEditFeatureErrorResponse } from "./util"; - -export interface IAnnoFeature extends IFeature { - attributes: { - target: string; - description: string; - [key: string]: any; - }; -} - -export interface IAddAnnotationsOptions extends IAddFeaturesOptions { - features: IAnnoFeature[]; -} - -/** - * ```js - * import { addAnnotations } from "@esri/hub-annotations"; - * // - * addAnnotations({ - * url: annotationsUrl + "/0", - * features: [{ - * attributes: { - * target: "http://...", // required, explains what is being commented on - * description: "A grand idea!" // also required. this is the actual comment - * } - * }] - * }) - * .then(response); - * ``` - * Add an annotation to ArcGIS Hub. Uses authentication to derive authorship, appends a timestamp and sets a default status of "pending" to new comments by default. - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with the response from the service after attempting to add one or more new annotations. - */ -export function addAnnotations( - requestOptions: IAddAnnotationsOptions -): Promise<{ - addResults?: Array; -}> { - /* istanbul ignore else */ - if (requestOptions.features && requestOptions.features.length) { - requestOptions.features.forEach(anno => enrichAnnotation(anno)); - } - - return addFeatures(requestOptions).then(response => { - return { - ...response, - addResults: checkResults(response.addResults) - }; - }); -} - -function enrichAnnotation(annotation: IAnnoFeature) { - const defaults = { - status: "pending", - source: "hub.js" - }; - - // mixin, giving precedence to what was passed to the method - annotation.attributes = { - ...defaults, - ...annotation.attributes - }; -} diff --git a/packages/annotations/src/create.ts b/packages/annotations/src/create.ts deleted file mode 100644 index ab7d325d53e..00000000000 --- a/packages/annotations/src/create.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { ArcGISRequestError } from "@esri/arcgis-rest-request"; -import { UserSession, IUserRequestOptions } from "@esri/arcgis-rest-auth"; -import { - setItemAccess, - getPortal, - searchItems, - updateItem, - protectItem -} from "@esri/arcgis-rest-portal"; -import { - createFeatureService, - addToServiceDefinition, - IAddToServiceDefinitionOptions -} from "@esri/arcgis-rest-service-admin"; -import { - defaultExtent, - editorTrackingInfo, - annotationServiceDefinition -} from "./layer-definition"; - -export interface ICreateAnnoOptions extends IUserRequestOptions { - /** - * The organization that will host the annotation service if it doesn't already exist. - */ - orgId?: string; -} - -/** - * ```js - * import { createAnnotationService } from "@esri/hub-annotations"; - * // - * createAnnotationService({ - * orgId: "yb9", - * authentication - * }) - * .then(response => // { success: true, itemId: "fe3" } ); - * ``` - * - * Create a new hosted annotation feature service for an organization if ArcGIS Hub hasn't already been enabled. - * @param requestOptions - request options that include authentication - * @returns A Promise that will resolve with the response from the service after attempting to create a new hosted annotation service. - */ -export function createAnnotationService( - requestOptions: ICreateAnnoOptions -): Promise { - const session = requestOptions.authentication as UserSession; - - // check to see if an annotation service has already been created in the organization - return searchItems({ - q: `typekeywords:hubAnnotationLayer AND orgid:${requestOptions.orgId}`, - authentication: session - }).then(searchResponse => { - if (searchResponse.results.length > 0) { - // if the org already has a hosted annotations service, dont create another one - return searchResponse.results[0]; - } else { - return getPortal(requestOptions.orgId, { - authentication: requestOptions.authentication - }).then(portalResponse => { - const clonedServiceDefinition = JSON.parse( - JSON.stringify(annotationServiceDefinition) - ); - // use the default extent of the organization for the new service - if (portalResponse.defaultExtent) { - clonedServiceDefinition.extent = portalResponse.defaultExtent; - } - - const description = `Feature service for Hub annotations. DO NOT DELETE THIS SERVICE. It stores the public annotations (comments) for all Hub items in your organization.`; - - // const options:ICreateServiceOptions (no workee) - const options = { - authentication: session, - item: { - // NOTE: this will also be the item title (until we update it in a few seconds) - name: "hub_annotations", - description, - serviceDescription: description, - copyrightText: "", - capabilities: clonedServiceDefinition.capabilities, - spatialReference: defaultExtent.spatialReference, - xssPreventionInfo: { - xssPreventionEnabled: true, - xssPreventionRule: "InputOutput", - xssInputRule: "sanitizeInvalid" - }, - maxRecordCount: 2000, - hasStaticData: false, - units: "esriMeters", - // anonymous users cant update or delete existing comments, only add new ones - editorTrackingInfo - } - }; - - // if one isnt yet present, create a new one - return createFeatureService(options).then(createResponse => { - if (!createResponse.success) { - throw new ArcGISRequestError( - `Failure to create service. One common cause is the presence of an existing service that shares the same name.` - ); - } - // next, update the layer definition (using a template) - return addToServiceDefinition(createResponse.serviceurl, { - authentication: session, - layers: [clonedServiceDefinition] - } as IAddToServiceDefinitionOptions).then(() => { - // sometimes TS likes session, sometimes it likes options.authentication - return updateItem({ - authentication: session, - item: { - id: createResponse.itemId, - typeKeywords: [ - "ArcGIS Server", - "Data", - "Feature Access", - "Feature Service", - "Service", - "Singlelayer", - "Hosted Service", - // set the typeKeyword for later searches - "hubAnnotationLayer" - ], - title: "Hub Annotations", - snippet: options.item.serviceDescription - } - }).then(() => { - // prevent the item from being accidentally deleted - return protectItem({ - id: createResponse.itemId, - authentication: session - }).then(() => { - // share the item publically - return setItemAccess({ - id: createResponse.itemId, - access: "public", - authentication: session - }).then(() => { - return new Promise(resolve => - resolve({ - success: true, - itemId: createResponse.itemId - }) - ); - }); - }); - }); - }); - }); - /* - firing off all the requests at once would be preferable, but in my own testing, - the sharing wasn't updated consistently - - return Promise.all([ ... ]) - */ - }); - } - }); -} diff --git a/packages/annotations/src/delete.ts b/packages/annotations/src/delete.ts deleted file mode 100644 index 0457bb89961..00000000000 --- a/packages/annotations/src/delete.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { - deleteFeatures, - IDeleteFeaturesOptions -} from "@esri/arcgis-rest-feature-layer"; -import { IEditFeatureResult } from "@esri/arcgis-rest-feature-layer"; -/** - * ```js - * import { deleteAnnotations } from "@esri/hub-annotations"; - * // - * deleteAnnotations({ - * url: annotationsUrl + "/0", - * // an array of featureIds - * objectIds: [ 1 ] - * }) - * .then(response); - * ``` - * - * Delete an annotation from ArcGIS Hub. - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with the response from the service after attempting to delete annotations. - */ - -export function deleteAnnotations( - requestOptions: IDeleteFeaturesOptions -): Promise<{ deleteResults?: IEditFeatureResult[] }> { - return deleteFeatures(requestOptions); -} diff --git a/packages/annotations/src/index.ts b/packages/annotations/src/index.ts deleted file mode 100644 index 3b9a7a013ab..00000000000 --- a/packages/annotations/src/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -export * from "./search"; -export * from "./util"; -export * from "./create"; -export * from "./add"; -export * from "./update"; -export * from "./delete"; -export * from "./vote"; - -// this is enough for the file to be omitted from the umd and esm, but it will still be in the cjs -// export * from "./layer-definition"; diff --git a/packages/annotations/src/layer-definition.ts b/packages/annotations/src/layer-definition.ts deleted file mode 100644 index 5ae5c9debf1..00000000000 --- a/packages/annotations/src/layer-definition.ts +++ /dev/null @@ -1,252 +0,0 @@ -import { ILayerDefinition, IExtent } from "@esri/arcgis-rest-types"; - -/** - * @private - */ -export const defaultExtent: IExtent = { - xmin: -180, - ymin: -90, - xmax: 180, - ymax: 90, - spatialReference: { - wkid: 4326 - } -}; - -/** - * @private - */ -export const editorTrackingInfo = { - enableEditorTracking: true, - enableOwnershipAccessControl: true, - allowOthersToQuery: true, - allowOthersToUpdate: false, - allowOthersToDelete: false, - allowAnonymousToQuery: true, - allowAnonymousToUpdate: false, - allowAnonymousToDelete: false -}; - -/** - * @private - */ -export const annotationServiceDefinition: ILayerDefinition = { - allowGeometryUpdates: true, - capabilities: "Query,Editing,Create,Update,Delete", - copyrightText: "", - defaultVisibility: true, - description: "", - drawingInfo: { - transparency: 0, - labelingInfo: null, - renderer: { - type: "simple", - symbol: { - color: [20, 158, 206, 70], - outline: { - color: [255, 255, 255, 229], - width: 2.25, - type: "esriSLS", - style: "esriSLSSolid" - }, - type: "esriSFS", - style: "esriSFSSolid" - } - } - }, - extent: defaultExtent, - fields: [ - { - name: "OBJECTID", - type: "esriFieldTypeOID", - alias: "OBJECTID", - nullable: false, - editable: false, - domain: null, - defaultValue: null - }, - { - name: "created_at", - type: "esriFieldTypeDate", - alias: "created_at", - length: 8, - nullable: true, - editable: false, - domain: null, - defaultValue: null - }, - { - name: "author", - type: "esriFieldTypeString", - alias: "author", - length: 128, - nullable: true, - editable: false, - domain: null, - defaultValue: null - }, - { - name: "updated_at", - type: "esriFieldTypeDate", - alias: "updated_at", - length: 8, - nullable: true, - editable: false, - domain: null, - defaultValue: null - }, - { - name: "updater", - type: "esriFieldTypeString", - alias: "updater", - length: 128, - nullable: true, - editable: false, - domain: null, - defaultValue: null - }, - { - name: "data", - type: "esriFieldTypeString", - alias: "data", - length: 4000, - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "description", - type: "esriFieldTypeString", - alias: "description", - length: 4000, - nullable: false, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "status", - type: "esriFieldTypeString", - alias: "status", - length: 256, - nullable: false, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "source", - type: "esriFieldTypeString", - alias: "source", - length: 2000, - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "target", - type: "esriFieldTypeString", - alias: "target", - length: 2000, - nullable: false, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "edits", - type: "esriFieldTypeString", - alias: "edits", - length: 4000, - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "parent_id", - type: "esriFieldTypeInteger", - alias: "parent_id", - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "dataset_id", - type: "esriFieldTypeString", - alias: "dataset_id", - length: 256, - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "feature_id", - type: "esriFieldTypeInteger", - alias: "feature_id", - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "attribute", - type: "esriFieldTypeString", - alias: "attribute", - length: 256, - nullable: true, - editable: true, - domain: null, - defaultValue: null - }, - { - name: "vote", - type: "esriFieldTypeInteger", - alias: "vote", - nullable: true, - editable: true, - domain: null, - defaultValue: null - } - ], - geometryType: "esriGeometryPolygon", - hasAttachments: true, - hasZ: false, - hasStaticData: false, - htmlPopupType: "esriServerHTMLPopupTypeNone", - isDataVersioned: false, - name: "hub_annotations", - objectIdField: "OBJECTID", - relationships: [], - supportsAdvancedQueries: true, - supportsRollbackOnFailureParameter: true, - supportsStatistics: true, - templates: [ - { - name: "New Feature", - description: "", - drawingTool: "esriFeatureEditToolPolygon", - prototype: { - attributes: { - description: "", - status: "", - target: "" - } - } - } - ], - type: "Feature Layer", - typeIdField: "", - types: [], - timeInfo: {}, - editFieldsInfo: { - creationDateField: "created_at", - creatorField: "author", - editDateField: "updated_at", - editorField: "updater" - } -}; diff --git a/packages/annotations/src/search.ts b/packages/annotations/src/search.ts deleted file mode 100644 index c25154f3688..00000000000 --- a/packages/annotations/src/search.ts +++ /dev/null @@ -1,284 +0,0 @@ -/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { - IQueryFeaturesOptions, - queryFeatures, - IQueryFeaturesResponse -} from "@esri/arcgis-rest-feature-layer"; -import { IStatisticDefinition } from "@esri/arcgis-rest-types"; - -import { getUser } from "@esri/arcgis-rest-portal"; -import { UserSession } from "@esri/arcgis-rest-auth"; -import { IGeometry, IFeature } from "@esri/arcgis-rest-types"; -import { IAnnoFeature } from "./add"; - -export interface IResourceObject { - id: number | string; - type: "annotations" | "users"; - attributes: { - [key: string]: any; - }; - geometry?: IGeometry; -} - -/** - * ```js - * import { searchAnnotations } from "@esri/hub-annotations"; - * // - * searchAnnotations({ url: annotationsUrl + "/0" }) - * .then(response => { - * // { - * // data: [{ - * // id: "User1", - * // type: "annotations", - * // attributes: {description: "Great place!", ...} - * // }], - * // included: [{ - * // id: "User1", - * // type: "users", - * // attributes: { firstName: "User", lastName: "Name", ...} - * // }] - * // } - * }); - * ``` - * Query for annotations from ArcGIS Hub. - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with decorated features from the annotation service for a Hub enabled ArcGIS Online organization. - */ -export function searchAnnotations( - requestOptions: IQueryFeaturesOptions -): Promise<{ data: IResourceObject[]; included: IResourceObject[] }> { - if (!requestOptions.outFields) { - requestOptions.outFields = [ - "OBJECTID", - "author", - "updater", - "created_at", - "updated_at", - "description", - "source", - "status", - "target", - "dataset_id" - ]; - } - - // upvotes and downvotes should not be returned - requestOptions.where += " AND parent_id IS NULL"; - - return queryFeatures(requestOptions).then(response => { - const users: string[] = []; - const data: IResourceObject[] = []; - - // use .reduce()? - (response as IQueryFeaturesResponse).features.forEach( - (comment: IFeature) => { - const attributes = comment.attributes; - const geometry = comment.geometry; - - const resource: IResourceObject = { - id: attributes.OBJECTID, - type: "annotations", - attributes - }; - - if (geometry) { - resource.geometry = geometry; - } - - data.push(resource); - - // ensure we only fetch metadata about each user once - if (users.indexOf(attributes.author) === -1) { - users.push(attributes.author); - } - } - ); - - const getUserInfo = users - .filter(name => name !== "") // filter out anonymous comments - .map(name => { - return getUser({ - username: name, - portal: requestOptions.portal, - authentication: requestOptions.authentication as UserSession - }).catch(() => null); - }); - - return Promise.all(getUserInfo).then(userInfo => { - const included: IResourceObject[] = []; - - userInfo.forEach(attributes => { - if (!attributes) { - return; - } - included.push({ id: attributes.username, type: `users`, attributes }); - }); - - return { included, data }; - }); - }); -} - -export interface ISearchAnnoOptions extends IQueryFeaturesOptions { - url: string; - annotation: IAnnoFeature; -} - -export interface IVoteResourceObject { - id: number; - type: "votes"; - attributes: { - upVotes: number; - downVotes: number; - }; -} - -/** - * ```js - * import { searchSingleAnnotationVotes } from "@esri/hub-annotations"; - * // - * searchSingleAnnotationVotes({ url: annotationsUrl + "/0", - * annotation: { - * id: "Annotation1", - * type: "annotations", - * attributes: { description: "Great place!", ... } - * }).then(response => { - * // data: [{ - * // id, - * // type: "votes", - * // attributes: { - * // upVotes: 3, - * // downVotes: 0 - * // } - * // }] - * }); - * ``` - * Query for up and down votes on a single annotation from ArcGIS Hub. - * @param requestOptions - request options that may include authentication - * @param annotation - the annotation for which votes need to be counted - * @returns A Promise that will resolve with summary statistics for the specified annotation from the annotation service for a Hub enabled ArcGIS Online organization. - */ -export function searchSingleAnnotationVotes( - requestOptions: ISearchAnnoOptions -): Promise<{ data: IVoteResourceObject[] }> { - const data: IVoteResourceObject[] = []; - const annotationId = requestOptions.annotation.attributes.OBJECTID; - if (!annotationId || annotationId < 0) { - return Promise.resolve({ data }); - } - requestOptions.groupByFieldsForStatistics = "vote"; - const outStat: IStatisticDefinition = { - statisticType: "count", - onStatisticField: "vote", - outStatisticFieldName: "vote_count" - }; - requestOptions.outStatistics = [outStat]; - // filtering for the comment - requestOptions.where = "parent_id=" + annotationId; - const queryRequestOptions = requestOptions as IQueryFeaturesOptions; - return queryFeatures(queryRequestOptions).then(response => { - const resource: IVoteResourceObject = { - id: annotationId, - type: "votes", - attributes: { - upVotes: 0, - downVotes: 0 - } - }; - - // use .reduce()? - (response as IQueryFeaturesResponse).features.forEach( - (statistic: IFeature) => { - if (statistic.attributes.vote > 0) { - resource.attributes.upVotes += statistic.attributes.vote_count; - } else if (statistic.attributes.vote < 0) { - resource.attributes.downVotes += statistic.attributes.vote_count; - } - } - ); - data.push(resource); - return { data }; - }); -} - -/** - * ```js - * import { searchAllAnnotationVotes } from "@esri/hub-annotations"; - * // - * searchAllAnnotationVotes({ url: annotationsUrl + "/0"}) - * .then(response => { - * // data: [{ - * // id, - * // type: "votes", - * // attributes: { - * // upVotes: 3, - * // downVotes: 0 - * // } - * // }] - * }); - * ``` - * Query for up and down votes on all annotations (with or without additional filters) from ArcGIS Hub. - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with summary statistics from the annotation service for a Hub enabled ArcGIS Online organization. - */ -export function searchAllAnnotationVotes( - requestOptions: IQueryFeaturesOptions -): Promise<{ data: IVoteResourceObject[] }> { - requestOptions.groupByFieldsForStatistics = "parent_id"; - const votesStat: IStatisticDefinition = { - statisticType: "count", - onStatisticField: "vote", - outStatisticFieldName: "count" - }; - requestOptions.outStatistics = [votesStat]; - // filtering for up votes - const upVoteClause = "vote > 0"; - requestOptions.where += requestOptions.where ? " AND " : ""; - requestOptions.where += upVoteClause; - - return queryFeatures(requestOptions).then(upVotesResponse => { - const data: IVoteResourceObject[] = []; - // use .reduce()? - (upVotesResponse as IQueryFeaturesResponse).features.forEach( - (statistic: IFeature) => { - const resource: IVoteResourceObject = { - id: statistic.attributes.parent_id, - type: "votes", - attributes: { - upVotes: statistic.attributes.count, - downVotes: 0 - } - }; - data.push(resource); - } - ); - // filtering for down Votes - requestOptions.where.replace("vote > 0", "vote < 0"); - return queryFeatures(requestOptions).then(downVotesResponse => { - // use .reduce()? - (downVotesResponse as IQueryFeaturesResponse).features.forEach( - (statistic: IFeature) => { - const existingResource = data.find( - voteR => voteR.id === statistic.attributes.parent_id - ); - if (existingResource) { - existingResource.attributes.downVotes = statistic.attributes.count; - } else { - const resource: IVoteResourceObject = { - id: statistic.attributes.parent_id, - type: "votes", - attributes: { - upVotes: 0, - downVotes: statistic.attributes.count - } - }; - data.push(resource); - } - } - ); - return { data }; - }); - }); -} diff --git a/packages/annotations/src/update.ts b/packages/annotations/src/update.ts deleted file mode 100644 index 70e4ec89fed..00000000000 --- a/packages/annotations/src/update.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { - updateFeatures, - IUpdateFeaturesOptions -} from "@esri/arcgis-rest-feature-layer"; -import { IEditFeatureResult } from "@esri/arcgis-rest-feature-layer"; -import { checkResults, IEditFeatureErrorResponse } from "./util"; - -/** - * ```js - * import { updateAnnotations } from "@esri/hub-annotations"; - * // - * updateAnnotations({ - * url: annotationsUrl + "/0", - * features: [{ - * attributes: { - * // an ID is necessary to determine which feature to update - * OBJECTID: 1, - * status: "approved" - * } - * }] - * }) - * .then(response); - * ``` - * Update an annotation in ArcGIS Hub. - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with the response from the service after attempting to update one or more annotations. - */ - -export function updateAnnotations( - requestOptions: IUpdateFeaturesOptions -): Promise<{ - updateResults?: Array; -}> { - return updateFeatures(requestOptions).then(response => { - return { - ...response, - updateResults: checkResults(response.updateResults) - }; - }); -} diff --git a/packages/annotations/src/util.ts b/packages/annotations/src/util.ts deleted file mode 100644 index b186e0c5d7b..00000000000 --- a/packages/annotations/src/util.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { IRequestOptions } from "@esri/arcgis-rest-request"; -import { searchItems, ISearchResult, IItem } from "@esri/arcgis-rest-portal"; -import { IEditFeatureResult } from "@esri/arcgis-rest-feature-layer"; - -export interface IAnnoSearchResult extends ISearchResult { - results: IAnnoItem[]; -} - -export interface IAnnoItem extends IItem { - // overrides url?: string - url: string; -} - -/** - * ```js - * import { request } from "@esri/arcgis-rest-request"; - * import { getAnnotationServiceUrl } from "@esri/hub-events"; - * // org ids can be retrieved via a call to portals/self - * request("http://custom.maps.arcgis.com/sharing/rest/portals/self") - * .then(response => { - * getAnnotationServiceUrl(response.id) - * .then(url) - * }) - * ``` - * Fetch the annotations associated with a Hub Site. - * @param orgId - Identifier of the ArcGIS Online Organization - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with an annotations url for a Hub enabled ArcGIS Online organization. - */ -export function getAnnotationServiceUrl( - orgId: string, - requestOptions?: IRequestOptions -): Promise { - return searchItems({ - q: `typekeywords:hubAnnotationLayer AND orgid:${orgId}`, - // mixin requestOptions (if present) - ...requestOptions - }).then((response: ISearchResult) => { - const annoResponse = response as IAnnoSearchResult; - if (annoResponse.results && annoResponse.results.length > 0) { - // this will need to be smarter if there is more than one service - let url = annoResponse.results[0].url; - // force https - url = url.replace(/^http:/gi, "https:"); - // it feels like we can/should += '/0' internally here - return url; - } else { - throw Error( - "No annotation service found. Commenting is likely not enabled." - ); - } - }); -} - -export interface IEditFeatureError { - code: string | number; - description: string; -} - -export interface IEditFeatureErrorResponse { - success: boolean; - error: IEditFeatureError; -} - -export class AllResultsError extends Error { - errors: IEditFeatureError[]; - - constructor(errors: IEditFeatureError[]) { - super("All attempted edits failed"); - this.errors = errors; - const message = errors[0].description; - if (errors.every(error => error.description === message)) { - // all errors have the same message, use that instead - this.message = message; - } - } -} - -/** - * If all results failed, throw an error - * otherwise return the results - * @param results - */ -export function checkResults( - results: Array -) { - const errors: IEditFeatureError[] = []; - results.reduce((acc, result) => { - if (!result.success) { - acc.push((result as IEditFeatureErrorResponse).error); - } - return acc; - }, errors); - if (errors.length === results.length) { - throw new AllResultsError(errors); - } - return results; -} diff --git a/packages/annotations/src/vote.ts b/packages/annotations/src/vote.ts deleted file mode 100644 index 5ebcc8bbbae..00000000000 --- a/packages/annotations/src/vote.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { - ArcGISRequestError, - ArcGISAuthError, - IRequestOptions -} from "@esri/arcgis-rest-request"; - -import { - addFeatures, - deleteFeatures, - queryFeatures, - IAddFeaturesOptions, - IDeleteFeaturesOptions -} from "@esri/arcgis-rest-feature-layer"; - -import { IAnnoFeature } from "./add"; -import { UserSession } from "@esri/arcgis-rest-auth"; -import { IEditFeatureResult } from "@esri/arcgis-rest-feature-layer"; - -export interface IVoteOptions extends IRequestOptions { - url: string; - annotation: IAnnoFeature; - /** - * Set to 'true' in order to vote another annotation down. - */ - downVote?: boolean; - authentication: UserSession; -} - -/** - * ```js - * import { vote } from "@esri/hub-annotations"; - * // - * voteOnAnnotation({ - * url, - * annotation: { attributes: {} }, - * authentication - * }) - * .then(response); - * ``` - * Upvote (or downvote) another annotation. - * @param requestOptions - request options that may include authentication - * @returns A Promise that will resolve with the response from the service after attempting to vote on an annotation. - */ -export function voteOnAnnotation( - requestOptions: IVoteOptions -): Promise< - | { addResults?: IEditFeatureResult[] } - | { deleteResults?: IEditFeatureResult[] } -> { - const annotation = requestOptions.annotation; - const auth = requestOptions.authentication as UserSession; - const url = requestOptions.url; - - if (!auth) { - return Promise.reject( - new ArcGISAuthError(`Voting by anonymous users is not supported.`) - ); - } - - if (annotation.attributes.author === auth.username) { - return Promise.reject( - new ArcGISRequestError(`Users may not vote on their own comment/idea.`) - ); - } - - // searchAnnotations() would make more xhrs for user metadata - return queryFeatures({ - url, - where: `parent_id = ${annotation.attributes.OBJECTID} AND author = '${ - auth.username - }'` - }).then((queryResponse: any) => { - if (queryResponse.features.length > 0) { - // if its a switch vote, call deleteFeatures() to remove the original - if ( - (!requestOptions.downVote && - queryResponse.features[0].attributes.vote === -1) || - (requestOptions.downVote && - queryResponse.features[0].attributes.vote === 1) - ) { - const deleteOptions: IDeleteFeaturesOptions = { - url, - authentication: requestOptions.authentication, - objectIds: [queryResponse.features[0].attributes.OBJECTID] - }; - return ( - deleteFeatures(deleteOptions) - // i have NO idea why the union return type is being ignored - .then(() => { - return { - addResults: [ - { - success: true, - objectId: queryResponse.features[0].attributes.OBJECTID - } - ] - }; - }) - ); - } else { - throw new ArcGISRequestError( - `Users may only vote on a comment/idea once.` - ); - } - } - const addOptions: IAddFeaturesOptions = { - url, - authentication: requestOptions.authentication, - features: [ - { - attributes: { - vote: requestOptions.downVote ? -1 : 1, - parent_id: annotation.attributes.OBJECTID, - target: annotation.attributes.target, - description: "this is a vote.", - status: "approved", - source: annotation.attributes.source - } - } - ] - }; - return addFeatures(addOptions); - }); -} diff --git a/packages/annotations/test/create.test.ts b/packages/annotations/test/create.test.ts deleted file mode 100644 index 2627d719e23..00000000000 --- a/packages/annotations/test/create.test.ts +++ /dev/null @@ -1,254 +0,0 @@ -import { createAnnotationService, ICreateAnnoOptions } from "../src/create"; -import { annotationServiceDefinition } from "../src/layer-definition"; -import { - annoSearchResponse, - emptyAnnoSearchResponse -} from "./mocks/ago_search"; -import { portalResponse } from "./mocks/portal"; -import { UserSession } from "@esri/arcgis-rest-auth"; -import * as request from "@esri/arcgis-rest-request"; -import * as portal from "@esri/arcgis-rest-portal"; -import * as featureServiceAdmin from "@esri/arcgis-rest-service-admin"; -import { IExtent } from "@esri/arcgis-rest-types"; -import { - ISearchOptions, - IUpdateItemOptions, - IUserItemOptions -} from "@esri/arcgis-rest-portal"; -import { ISetAccessOptions } from "@esri/arcgis-rest-portal"; -import { - ICreateServiceOptions, - IAddToServiceDefinitionOptions -} from "@esri/arcgis-rest-service-admin"; - -const TOMORROW = (function() { - const now = new Date(); - now.setDate(now.getDate() + 1); - return now; -})(); - -// no clue why, but i see errors when i import the same thing from MOCK_REQUEST_OPTIONS -const authentication = new UserSession({ - username: "vader", - password: "123456", - token: "fake-token", - tokenExpires: TOMORROW -}); - -const clonedServiceDefinition = JSON.parse( - JSON.stringify(annotationServiceDefinition) -); - -clonedServiceDefinition.extent = portalResponse.defaultExtent as IExtent; - -describe("createAnnotationService", () => { - it("should create a new annotation service if one doesnt already exist", done => { - const searchParamsSpy = spyOn(portal, "searchItems").and.returnValue( - new Promise(resolve => { - resolve(emptyAnnoSearchResponse); - }) - ); - - const portalParamsSpy = spyOn(portal, "getPortal").and.returnValue( - new Promise(resolve => { - resolve(portalResponse); - }) - ); - - const createParamsSpy = spyOn( - featureServiceAdmin, - "createFeatureService" - ).and.returnValue( - new Promise(resolve => { - resolve({ - encodedServiceURL: - "https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/hub_annotations/FeatureServer", - itemId: "41a", - name: "hub_annotations", - serviceItemId: "41a", - serviceurl: - "https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/hub_annotations/FeatureServer", - size: -1, - success: true, - type: "Feature Service", - isView: false - }); - }) - ); - - const protectParamsSpy = spyOn(portal, "protectItem").and.returnValue( - new Promise(resolve => { - resolve({ success: true }); - }) - ); - - const shareParamsSpy = spyOn(portal, "setItemAccess").and.returnValue( - new Promise(resolve => { - resolve({ - notSharedWith: [], - itemId: "41a" - }); - }) - ); - - const updateParamsSpy = spyOn(portal, "updateItem").and.returnValue( - new Promise(resolve => { - resolve({ - success: true, - id: "41a" - }); - }) - ); - - const addToParamsSpy = spyOn( - featureServiceAdmin, - "addToServiceDefinition" - ).and.returnValue( - new Promise(resolve => { - resolve({ - success: true, - layers: [{ name: "hub_annotations", id: 0 }] - }); - }) - ); - - // MOCK_REQUEST_OPTIONS from "../../initiatives/test/mocks/fake-session" didnt work; - const options = { - orgId: "h7c", - authentication - } as ICreateAnnoOptions; - - createAnnotationService(options) - .then(() => { - expect(searchParamsSpy.calls.count()).toEqual(1); - expect(portalParamsSpy.calls.count()).toEqual(1); - expect(createParamsSpy.calls.count()).toEqual(1); - expect(shareParamsSpy.calls.count()).toEqual(1); - expect(updateParamsSpy.calls.count()).toEqual(1); - expect(addToParamsSpy.calls.count()).toEqual(1); - expect(protectParamsSpy.calls.count()).toEqual(1); - - const searchOpts = searchParamsSpy.calls.argsFor( - 0 - )[0] as ISearchOptions; - expect(searchOpts.q).toEqual( - "typekeywords:hubAnnotationLayer AND orgid:h7c" - ); - - const createOpts = createParamsSpy.calls.argsFor( - 0 - )[0] as ICreateServiceOptions; - expect(createOpts.item.name).toEqual("hub_annotations"); - expect(createOpts.item.capabilities).toEqual( - annotationServiceDefinition.capabilities - ); - expect(createOpts.item.maxRecordCount).toEqual(2000); - expect(createOpts.item.hasStaticData).toEqual(false); - expect( - createOpts.item.editorTrackingInfo.allowAnonymousToUpdate - ).toEqual(false); - expect( - createOpts.item.editorTrackingInfo.allowAnonymousToDelete - ).toEqual(false); - expect(createOpts.item.xssPreventionInfo.xssPreventionEnabled).toEqual( - true - ); - expect(createOpts.authentication.token).toEqual("fake-token"); - - expect(addToParamsSpy.calls.argsFor(0)[0]).toEqual( - "https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/hub_annotations/FeatureServer" - ); - const addToOpts = addToParamsSpy.calls.argsFor( - 0 - )[1] as IAddToServiceDefinitionOptions; - expect(addToOpts.layers).toEqual([clonedServiceDefinition]); - expect(addToOpts.authentication.token).toEqual("fake-token"); - - const updateOpts = updateParamsSpy.calls.argsFor( - 0 - )[0] as IUpdateItemOptions; - expect(updateOpts.item.id).toEqual("41a"); - expect(updateOpts.item.title).toEqual("Hub Annotations"); - expect( - updateOpts.item.typeKeywords.includes("hubAnnotationLayer") - ).toEqual(true); - expect(updateOpts.item.snippet).toEqual( - `Feature service for Hub annotations. DO NOT DELETE THIS SERVICE. It stores the public annotations (comments) for all Hub items in your organization.` - ); - expect(updateOpts.authentication.token).toEqual("fake-token"); - - const protectOpts = protectParamsSpy.calls.argsFor( - 0 - )[0] as IUserItemOptions; - expect(protectOpts.id).toEqual("41a"); - expect(protectOpts.authentication.token).toEqual("fake-token"); - - const shareOpts = shareParamsSpy.calls.argsFor( - 0 - )[0] as ISetAccessOptions; - expect(shareOpts.id).toEqual("41a"); - expect(shareOpts.access).toEqual("public"); - expect(shareOpts.authentication.token).toEqual("fake-token"); - - done(); - }) - .catch(() => fail()); - }); - - it("should not create a new annotation service if one already exists", done => { - const searchParamsSpy = spyOn(portal, "searchItems").and.returnValue( - new Promise(resolve => { - resolve(annoSearchResponse); - }) - ); - - const options = { - orgId: "h7c", - authentication - } as ICreateAnnoOptions; - - createAnnotationService(options) - .then(() => { - expect(searchParamsSpy.calls.count()).toEqual(1); - const opts = searchParamsSpy.calls.argsFor(0)[0] as ISearchOptions; - expect(opts.q).toEqual("typekeywords:hubAnnotationLayer AND orgid:h7c"); - done(); - }) - .catch(() => fail()); - }); - - it("should fail gracefully if an error is encountered creating the feature service", done => { - const searchParamsSpy = spyOn(portal, "searchItems").and.returnValue( - new Promise(resolve => { - resolve(emptyAnnoSearchResponse); - }) - ); - - spyOn(portal, "getPortal").and.returnValue( - new Promise(resolve => { - resolve({ portalResponse }); - }) - ); - - spyOn(featureServiceAdmin, "createFeatureService").and.returnValue( - new Promise(resolve => { - resolve({ success: false }); - }) - ); - - const options = { - orgId: "h7c", - authentication - } as ICreateAnnoOptions; - - createAnnotationService(options).catch(err => { - expect(searchParamsSpy.calls.count()).toEqual(1); - const opts = searchParamsSpy.calls.argsFor(0)[0] as ISearchOptions; - expect(opts.q).toEqual("typekeywords:hubAnnotationLayer AND orgid:h7c"); - expect(err.message).toEqual( - "Failure to create service. One common cause is the presence of an existing service that shares the same name." - ); - done(); - }); - }); -}); diff --git a/packages/annotations/test/crud.test.ts b/packages/annotations/test/crud.test.ts deleted file mode 100644 index df39a2bcd12..00000000000 --- a/packages/annotations/test/crud.test.ts +++ /dev/null @@ -1,278 +0,0 @@ -import { - addAnnotations, - updateAnnotations, - deleteAnnotations -} from "../src/index"; - -import { UserSession, ApplicationSession } from "@esri/arcgis-rest-auth"; -import * as featureService from "@esri/arcgis-rest-feature-layer"; -import { - IAddFeaturesOptions, - IUpdateFeaturesOptions, - IDeleteFeaturesOptions -} from "@esri/arcgis-rest-feature-layer"; -import { IFeature } from "@esri/arcgis-rest-types"; - -export const addFeaturesResponse = { - addResults: [ - { - objectId: 1001, - success: true - } - ] -}; - -export const updateFeaturesResponse = { - updateResults: [ - { - objectId: 1001, - success: true - } - ] -}; - -export const deleteFeaturesResponse = { - deleteResults: [ - { - objectId: 1001, - success: true - } - ] -}; - -const TOMORROW = (function() { - const now = new Date(); - now.setDate(now.getDate() + 1); - return now; -})(); - -const MOCK_USER_SESSION = new UserSession({ - username: "casey", - password: "123456", - token: "fake-token", - tokenExpires: TOMORROW -}); - -const MOCK_APP_SESSION = new ApplicationSession({ - clientId: "casey", - clientSecret: "123456" -}); - -const annoUrl = - "https://services.arcgis.com/xyz/arcgis/rest/services/Hub%20Annotations/FeatureServer/0"; - -describe("addAnnotations", () => { - it("should add an annotation and append a few helpful default parameters", done => { - // stub add features - const paramsSpy = spyOn(featureService, "addFeatures").and.returnValue( - new Promise(resolve => { - resolve(addFeaturesResponse); - }) - ); - - addAnnotations({ - url: annoUrl, - authentication: MOCK_USER_SESSION, - features: [ - { - attributes: { - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0" - } - } - ] - }) - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as IAddFeaturesOptions; - expect(opts.url).toEqual(annoUrl); - const anno = opts.features[0] as IFeature; - expect(anno.attributes.description).toEqual( - "what do we want? bike lanes! when do we want them? now!" - ); - expect(anno.attributes.status).toEqual("pending"); - expect(anno.attributes.source).toEqual("hub.js"); - done(); - }) - .catch(() => fail()); - }); - - it("when application authentication is passed, behavior should be the same as if no authentication was passed at all", done => { - // stub add features - const paramsSpy = spyOn(featureService, "addFeatures").and.returnValue( - new Promise(resolve => { - resolve(addFeaturesResponse); - }) - ); - - addAnnotations({ - url: annoUrl, - features: [ - { - attributes: { - description: - "what do we want? bike lanes! when do we want them? now!", - author: "casey", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0" - } - } - ], - authentication: MOCK_APP_SESSION - }) - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as IAddFeaturesOptions; - - expect(opts.url).toEqual(annoUrl); - const anno = opts.features[0] as IFeature; - expect(anno.attributes.author).toEqual("casey"); - expect(anno.attributes.description).toEqual( - "what do we want? bike lanes! when do we want them? now!" - ); - expect(anno.attributes.status).toEqual("pending"); - expect(anno.attributes.source).toEqual("hub.js"); - done(); - }) - .catch(() => fail()); - }); - - it("should add an annotation when no authentication is passed", done => { - // stub add features - const paramsSpy = spyOn(featureService, "addFeatures").and.returnValue( - new Promise(resolve => { - resolve(addFeaturesResponse); - }) - ); - - addAnnotations({ - url: annoUrl, - features: [ - { - attributes: { - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0" - } - } - ] - }) - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as IAddFeaturesOptions; - - expect(opts.url).toEqual(annoUrl); - const anno = opts.features[0] as IFeature; - expect(anno.attributes.description).toEqual( - "what do we want? bike lanes! when do we want them? now!" - ); - expect(anno.attributes.status).toEqual("pending"); - expect(anno.attributes.source).toEqual("hub.js"); - done(); - }) - .catch(() => fail()); - }); - - it("should preserve developer supplied attributes when adding an annotation", done => { - // stub add features - const paramsSpy = spyOn(featureService, "addFeatures").and.returnValue( - new Promise(resolve => { - resolve(addFeaturesResponse); - }) - ); - - addAnnotations({ - url: annoUrl, - features: [ - { - attributes: { - description: - "what do we want? bike lanes! when do we want them? now!", - status: "URGENT!", - source: "somewhere else", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0" - } - } - ] - }) - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as IAddFeaturesOptions; - - expect(opts.url).toEqual(annoUrl); - const anno = opts.features[0] as IFeature; - - expect(anno.attributes.description).toEqual( - "what do we want? bike lanes! when do we want them? now!" - ); - expect(anno.attributes.status).toEqual("URGENT!"); - expect(anno.attributes.source).toEqual("somewhere else"); - done(); - }) - .catch(() => fail()); - }); -}); - -describe("updateAnnotations", () => { - it("should update an annotation", done => { - // stub add features - const paramsSpy = spyOn(featureService, "updateFeatures").and.returnValue( - new Promise(resolve => { - resolve(updateFeaturesResponse); - }) - ); - - updateAnnotations({ - url: annoUrl, - features: [ - { - attributes: { - OBJECTID: 1001, - description: "i changed my mind, we can wait a lil while." - } - } - ] - }) - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as IUpdateFeaturesOptions; - - expect(opts.url).toEqual(annoUrl); - const anno = opts.features[0] as IFeature; - expect(anno.attributes.description).toEqual( - "i changed my mind, we can wait a lil while." - ); - done(); - }) - .catch(() => fail()); - }); -}); - -describe("deleteAnnotations", () => { - it("should delete an annotation", done => { - const paramsSpy = spyOn(featureService, "deleteFeatures").and.returnValue( - new Promise(resolve => { - resolve(deleteFeaturesResponse); - }) - ); - - deleteAnnotations({ - url: annoUrl, - objectIds: [1001] - }) - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as IDeleteFeaturesOptions; - - expect(opts.url).toEqual(annoUrl); - const anno = opts.objectIds[0] as number; - expect(anno).toEqual(1001); - done(); - }) - .catch(() => fail()); - }); -}); diff --git a/packages/annotations/test/mocks/ago_search.ts b/packages/annotations/test/mocks/ago_search.ts deleted file mode 100644 index 33323d0ed56..00000000000 --- a/packages/annotations/test/mocks/ago_search.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { ISearchResult, IItem } from "@esri/arcgis-rest-portal"; - -export const annoSearchResponse: ISearchResult = { - query: "hubAnnotationLayer AND orgid:5bc", - total: 1, - start: 1, - num: 10, - nextStart: -1, - results: [ - { - id: "abc123", - owner: "c@sey", - created: 1526675011000, - modified: 1526675614000, - guid: null, - name: "Hub Annotations", - title: "Hub Annotations", - type: "Feature Service", - typeKeywords: [ - "ArcGIS Server", - "Data", - "Feature Access", - "Feature Service", - "hubAnnotationLayer", - "Service", - "Singlelayer", - "Hosted Service" - ], - description: - "Feature service for Hub annotations. DO NOT DELETE THIS SERVICE. It stores the public annotations (comments) for all Hub items in your organization.", - tags: [], - snippet: "Feature service for Hub annotations", - thumbnail: "thumbnail/ago_downloaded.png", - documentation: null, - extent: [ - [-8589300.590117617, 4692777.9712402625], - [-8562027.314873265, 4722244.554455302] - ], - categories: [], - spatialReference: null, - accessInformation: null, - licenseInfo: null, - culture: null, - properties: null, - url: - "https://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/Hub Annotations/FeatureServer", - proxyFilter: null, - access: "public", - size: -1, - appCategories: [], - industries: [], - languages: [], - largeThumbnail: null, - banner: null, - screenshots: [], - listed: false, - numComments: 0, - numRatings: 0, - avgRating: 0, - numViews: 2, - scoreCompleteness: 51, - groupDesignations: null, - protected: false - } - ] -}; - -export const emptyAnnoSearchResponse: ISearchResult = { - query: "hubAnnotationLayer AND orgid:h7c", - total: 1, - start: 1, - num: 10, - nextStart: -1, - results: [] -}; diff --git a/packages/annotations/test/mocks/anno_search.ts b/packages/annotations/test/mocks/anno_search.ts deleted file mode 100644 index b3ef47c3917..00000000000 --- a/packages/annotations/test/mocks/anno_search.ts +++ /dev/null @@ -1,612 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { IVoteResourceObject, IResourceObject } from "../../src/search"; -import { IGeometry, IFeature, IField } from "@esri/arcgis-rest-types"; - -export const annoQueryResponseEmpty = { - objectIdFieldName: "OBJECTID", - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4326, - latestWkid: 4326 - }, - features: [] as IFeature[] -}; - -export const annoQueryResponse = { - objectIdFieldName: "OBJECTID", - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4326, - latestWkid: 4326 - }, - // fields: [], - features: [ - { - attributes: { - OBJECTID: 1, - author: "casey", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200000, - updated_at: 1349395200000, - dataset_id: "sgj432" - }, - geometry: { - rings: [ - [ - [-12694713.8080383, 5934781.92803049], - [-12691159.4862231, 5936119.57602548], - [-12691159.4862231, 5932527.03569609], - [-12694713.8080383, 5934781.92803049] - ] - ] - } as IGeometry - }, - { - attributes: { - OBJECTID: 2, - author: "jones", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200001, - updated_at: 1349395200001, - dataset_id: "xds466" - } - }, - { - attributes: { - OBJECTID: 3, - author: "casey", - source: null as string, - status: "pending", - target: "something", - data: "i like to hear myself talk", - created_at: 1349395200002, - updated_at: 1349395200002, - dataset_id: "xds466" - } - }, - { - attributes: { - OBJECTID: 4, - author: "", - source: null as string, - status: "pending", - target: "something", - data: "i like to hear myself talk", - created_at: 1349395200002, - updated_at: 1349395200002, - dataset_id: "xds466" - } - }, - { - attributes: { - OBJECTID: 5, - author: "nolongerexists", - source: null as string, - status: "pending", - target: "something", - data: "somehow this user no longer exists", - created_at: 1349395200002, - updated_at: 1349395200002, - dataset_id: "xds466" - } - } - ] -}; - -// search is specifically for previous votes on an annotation by the same user, so only one feature returned -export const annoQueryVoteResponse = { - objectIdFieldName: "OBJECTID", - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4326, - latestWkid: 4326 - }, - features: [ - { - attributes: { - OBJECTID: 2, - author: "casey", - source: "hub.js", - status: "approved", - target: "something", - description: null as string, - created_at: 1349395200001, - updated_at: 1349395200001, - dataset_id: "xds466", - vote: -1 - } - } - ] -}; - -export const userResponseCasey = { - username: "casey", - fullName: "Casey Shaft", - firstName: "Casey", - lastName: "Shaft", - description: "Neogeographer and purveyor of personal storytelling.", - tags: [ - "websux", - "never", - "hubInitiativeId|d603b719ba9b4060baa6731b531abf08", - "hubEventGroupId|bkrWlSKcjUDFDtgw|a4647526b8ea44a38cada61210144a15" - ], - culture: "en", - cultureFormat: null as any, - region: "WO", - units: "english", - thumbnail: "Andrew_Turner_-_DC_Social_Meetup_-_Square.jpg", - created: 1346876642000, - modified: 1513802298000, - provider: "arcgis" -}; - -export const userResponseJones = { - username: "jones", - fullName: "Casey Shaft", - firstName: "Casey", - lastName: "Shaft", - description: "Neogeographer and purveyor of personal storytelling.", - tags: [ - "websux", - "never", - "hubInitiativeId|d603b719ba9b4060baa6731b531abf08", - "hubEventGroupId|bkrWlSKcjUDFDtgw|a4647526b8ea44a38cada61210144a15" - ], - culture: "en", - cultureFormat: null as any, - region: "WO", - units: "english", - thumbnail: "Andrew_Turner_-_DC_Social_Meetup_-_Square.jpg", - created: 1346876642000, - modified: 1513802298000, - provider: "arcgis" -}; - -const data = [ - { - id: 1, - type: "annotations", - attributes: { - OBJECTID: 1, - author: "casey", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200000, - updated_at: 1349395200000, - dataset_id: "sgj432" - }, - geometry: { - rings: [ - [ - [-12694713.8080383, 5934781.92803049], - [-12691159.4862231, 5936119.57602548], - [-12691159.4862231, 5932527.03569609], - [-12694713.8080383, 5934781.92803049] - ] - ] - } as IGeometry - }, - { - id: 2, - type: "annotations", - attributes: { - OBJECTID: 2, - author: "jones", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200001, - updated_at: 1349395200001, - dataset_id: "xds466" - } - }, - { - id: 3, - type: "annotations", - attributes: { - OBJECTID: 3, - author: "casey", - source: null as string, - status: "pending", - target: "something", - data: "i like to hear myself talk", - created_at: 1349395200002, - updated_at: 1349395200002, - dataset_id: "xds466" - } - }, - { - id: 4, - type: "annotations", - attributes: { - OBJECTID: 4, - author: "", - source: null as string, - status: "pending", - target: "something", - data: "i like to hear myself talk", - created_at: 1349395200002, - updated_at: 1349395200002, - dataset_id: "xds466" - } - }, - { - id: 5, - type: "annotations", - attributes: { - OBJECTID: 5, - author: "nolongerexists", - source: null as string, - status: "pending", - target: "something", - data: "somehow this user no longer exists", - created_at: 1349395200002, - updated_at: 1349395200002, - dataset_id: "xds466" - } - } -] as IResourceObject[]; - -export const annoResponseEmpty = { - // data: [] as Array, - // included: [] as Array - data: [] as IResourceObject[], - included: [] as IResourceObject[] -}; - -export const annoResponse = { - data, - included: [ - { - id: userResponseCasey.username, - type: "users", - attributes: userResponseCasey - }, - { - id: userResponseJones.username, - type: "users", - attributes: userResponseJones - } - ] as IResourceObject[] -}; - -export const annoVoteQueryResponseEmpty = { - objectIdFieldName: "OBJECTID", - uniqueIdField: { - name: "OBJECTID", - isSystemMaintained: true - }, - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4269, - latestWkid: 4269 - }, - fields: [ - { - name: "vote", - type: "esriFieldTypeDouble", - alias: "vote", - domain: null, - defaultValue: null - }, - { - name: "vote_count", - type: "esriFieldTypeInteger", - alias: "vote_count", - domain: null, - defaultValue: null - } - ] as IField[], - features: [] as IFeature[] -}; - -export const annoVoteQueryResponse = { - objectIdFieldName: "OBJECTID", - uniqueIdField: { - name: "OBJECTID", - isSystemMaintained: true - }, - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4269, - latestWkid: 4269 - }, - fields: [ - { - name: "vote", - type: "esriFieldTypeDouble", - alias: "vote", - domain: null, - defaultValue: null - }, - { - name: "vote_count", - type: "esriFieldTypeInteger", - alias: "vote_count", - domain: null, - defaultValue: null - } - ] as IField[], - features: [ - { - attributes: { - vote: 1, - vote_count: 6 - } - }, - { - attributes: { - vote: -1, - vote_count: 3 - } - }, - { - attributes: { - vote: 0, - vote_count: 1 - } - } - ] as IFeature[] -}; - -export const annoFeature = { - id: 1, - type: "annotations", - attributes: { - OBJECTID: 1, - author: "jones", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200000, - updated_at: 1349395200000, - dataset_id: "sgj432" - }, - geometry: { - rings: [ - [ - [-12694713.8080383, 5934781.92803049], - [-12691159.4862231, 5936119.57602548], - [-12691159.4862231, 5932527.03569609], - [-12694713.8080383, 5934781.92803049] - ] - ] - } as IGeometry -}; - -export const invalidIdAnnoFeature = { - id: -1, - type: "annotations", - attributes: { - OBJECTID: -1, - author: "jones", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200000, - updated_at: 1349395200000, - dataset_id: "sgj432" - }, - geometry: { - rings: [ - [ - [-12694713.8080383, 5934781.92803049], - [-12691159.4862231, 5936119.57602548], - [-12691159.4862231, 5932527.03569609], - [-12694713.8080383, 5934781.92803049] - ] - ] - } as IGeometry -}; - -export const missingIdAnnoFeature = { - id: -1, - type: "annotations", - attributes: { - author: "jones", - source: null as string, - status: "pending", - target: "something", - description: "this is where the comments go", - created_at: 1349395200000, - updated_at: 1349395200000, - dataset_id: "sgj432" - }, - geometry: { - rings: [ - [ - [-12694713.8080383, 5934781.92803049], - [-12691159.4862231, 5936119.57602548], - [-12691159.4862231, 5932527.03569609], - [-12694713.8080383, 5934781.92803049] - ] - ] - } as IGeometry -}; - -export const annoVoteResponseEmpty = { - data: [ - { - id: 1, - type: "votes", - attributes: { - upVotes: 0, - downVotes: 0 - } - } - ] as IVoteResourceObject[] -}; - -export const annoVoteResponseInvalid = { - data: [] as IVoteResourceObject[] -}; - -export const annoVoteResponse = { - data: [ - { - id: 1, - type: "votes", - attributes: { - upVotes: 6, - downVotes: 3 - } - } - ] as IVoteResourceObject[] -}; - -export const allAnnoVoteQueryResponseEmpty = { - objectIdFieldName: "OBJECTID", - uniqueIdField: { - name: "OBJECTID", - isSystemMaintained: true - }, - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4269, - latestWkid: 4269 - }, - fields: [ - { - name: "parent_id", - type: "esriFieldTypeDouble", - alias: "parent_id", - domain: null, - defaultValue: null - }, - { - name: "count", - type: "esriFieldTypeInteger", - alias: "count", - domain: null, - defaultValue: null - } - ] as IField[], - features: [] as IFeature[] -}; - -export const allAnnoUpVoteQueryResponse = { - objectIdFieldName: "OBJECTID", - uniqueIdField: { - name: "OBJECTID", - isSystemMaintained: true - }, - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4269, - latestWkid: 4269 - }, - fields: [ - { - name: "parent_id", - type: "esriFieldTypeDouble", - alias: "parent_id", - domain: null, - defaultValue: null - }, - { - name: "count", - type: "esriFieldTypeInteger", - alias: "count", - domain: null, - defaultValue: null - } - ] as IField[], - features: [ - { - attributes: { - parent_id: 1, - count: 6 - } - } - ] as IFeature[] -}; - -export const allAnnoDownVoteQueryResponse = { - objectIdFieldName: "OBJECTID", - uniqueIdField: { - name: "OBJECTID", - isSystemMaintained: true - }, - globalIdFieldName: "", - geometryType: "esriGeometryPolygon", - spatialReference: { - wkid: 4269, - latestWkid: 4269 - }, - fields: [ - { - name: "parent_id", - type: "esriFieldTypeDouble", - alias: "parent_id", - domain: null, - defaultValue: null - }, - { - name: "count", - type: "esriFieldTypeInteger", - alias: "count", - domain: null, - defaultValue: null - } - ] as IField[], - features: [ - { - attributes: { - parent_id: 1, - count: 3 - } - }, - { - attributes: { - parent_id: 2, - count: 1 - } - } - ] as IFeature[] -}; - -export const allAnnoVoteResponseEmpty = { - data: [] as IVoteResourceObject[] -}; - -export const allAnnoVoteResponse = { - data: [ - { - id: 1, - type: "votes", - attributes: { - upVotes: 6, - downVotes: 3 - } - }, - { - id: 2, - type: "votes", - attributes: { - upVotes: 0, - downVotes: 1 - } - } - ] as IVoteResourceObject[] -}; diff --git a/packages/annotations/test/mocks/portal.ts b/packages/annotations/test/mocks/portal.ts deleted file mode 100644 index 85e137abced..00000000000 --- a/packages/annotations/test/mocks/portal.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. - * Apache-2.0 */ - -import { IPortal } from "@esri/arcgis-rest-portal"; - -export const portalResponse: IPortal = { - access: "public", - allSSL: false, - allowedRedirectUris: [], - analysisLayersGroupQuery: - 'title:"Living Atlas Analysis Layers" AND owner:esri', - authorizedCrossOriginDomains: [], - availableCredits: 9584.193, - basemapGalleryGroupQuery: "id:06d589ea1fdb47768ee3870f497333c0", - canListApps: false, - canListData: false, - canListPreProvisionedItems: false, - canProvisionDirectPurchase: false, - canSearchPublic: true, - canShareBingPublic: false, - canSharePublic: true, - canSignInArcGIS: true, - canSignInIDP: true, - colorSetsGroupQuery: 'title:"Esri Colors" AND owner:esri_en', - commentsEnabled: true, - created: 1392336986000, - creditAssignments: "enabled", - culture: "en", - customBaseUrl: "mapsdevext.arcgis.com", - databaseQuota: -1, - databaseUsage: -1, - defaultBasemap: {}, - defaultExtent: { - type: "extent", - xmin: -8589300.590116454, - ymin: 4692777.971239516, - xmax: -8562027.314872108, - ymax: 4722244.554454538, - spatialReference: { - wkid: 102100 - } - }, - defaultUserCreditAssignment: 100, - defaultVectorBasemap: { - baseMapLayers: [], - title: "Topographic" - }, - description: "We're the DC R&D Center", - eueiEnabled: false, - featuredGroups: [], - featuredGroupsId: "", - featuredItemsGroupQuery: "", - galleryTemplatesGroupQuery: 'title:"Gallery Templates" AND owner:esri_en', - hasCategorySchema: false, - helpBase: "http://docdev.arcgis.com/en/arcgis-online/", - helpMap: {}, - helperServices: {}, - homePageFeaturedContent: "", - homePageFeaturedContentCount: 12, - id: "LjjARY1mkhxulWPq", - isPortal: false, - layerTemplatesGroupQuery: 'title:"Esri Layer Templates" AND owner:esri_en', - livingAtlasGroupQuery: 'title:"Featured Maps And Apps" AND owner:esri', - maxTokenExpirationMinutes: -1, - metadataEditable: true, - metadataFormats: ["iso19139"], - modified: 1511894763000, - name: "Washington, DC", - notificationsEnabled: false, - portalHostname: "devext.arcgis.com", - portalMode: "multitenant", - portalName: "ArcGIS Online", - portalProperties: {}, - portalThumbnail: null, - region: "WO", - rotatorPanels: [ - { - id: "banner-2", - innerHTML: - "
Washington, DCWashington, DC
" - } - ], - showHomePageDescription: false, - staticImagesUrl: "http://static.arcgis.com/images", - storageQuota: 2199023255552, - storageUsage: 17622609523, - stylesGroupQuery: 'title:"Esri Styles" AND owner:esri_en', - supportsHostedServices: true, - symbolSetsGroupQuery: 'title:"Esri Symbols" AND owner:esri_en', - templatesGroupQuery: "id:f233da8d297e4ff9ae992c21f8f4010f", - thumbnail: "thumbnail.png", - units: "english", - updateUserProfileDisabled: false, - urlKey: "dc", - useStandardizedQuery: true, - useVectorBasemaps: false, - vectorBasemapGalleryGroupQuery: - 'title:"ArcGIS Online Vector Basemaps" AND owner:esri_en', - subscriptionInfo: {}, - isHubEnabled: false, - ipCntryCode: "US", - httpPort: 80, - httpsPort: 443, - supportsOAuth: true, - currentVersion: "5.4", - allowedOrigins: [], - mfaAdmins: [], - contacts: ["dcadmin"], - mfaEnabled: false, - user: {}, - appInfo: {} -}; diff --git a/packages/annotations/test/search.test.ts b/packages/annotations/test/search.test.ts deleted file mode 100644 index fe219762784..00000000000 --- a/packages/annotations/test/search.test.ts +++ /dev/null @@ -1,343 +0,0 @@ -import { - searchAnnotations, - searchSingleAnnotationVotes, - searchAllAnnotationVotes -} from "../src/search"; - -import { annoSearchResponse } from "./mocks/ago_search"; - -import { - annoQueryResponse, - annoQueryResponseEmpty, - annoResponse, - annoResponseEmpty, - userResponseCasey, - userResponseJones, - annoVoteQueryResponseEmpty, - annoFeature, - annoVoteQueryResponse, - annoVoteResponseEmpty, - annoVoteResponseInvalid, - annoVoteResponse, - allAnnoVoteQueryResponseEmpty, - allAnnoUpVoteQueryResponse, - allAnnoDownVoteQueryResponse, - allAnnoVoteResponseEmpty, - allAnnoVoteResponse, - invalidIdAnnoFeature, - missingIdAnnoFeature -} from "./mocks/anno_search"; - -import * as featureService from "@esri/arcgis-rest-feature-layer"; -import * as user from "@esri/arcgis-rest-portal"; -import { IQueryFeaturesOptions } from "@esri/arcgis-rest-feature-layer"; - -const mockOutFields = [ - "OBJECTID", - "author", - "updater", - "created_at", - "updated_at", - "description", - "source", - "status", - "target", - "dataset_id" -]; - -describe("searchAnnotations", () => { - it("should query for annotations when no parameters are passed", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryResponse); - }) - ); - - const userParamsSpy = spyOn(user, "getUser").and.returnValues( - new Promise(resolve => { - resolve(userResponseCasey); - }), - new Promise(resolve => { - resolve(userResponseJones); - }), - new Promise((resolve, reject) => { - reject({ error: "not sure this matters" }); - }) - ); - - searchAnnotations({ - url: annoSearchResponse.results[0].url + "/0" - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(userParamsSpy.calls.count()).toEqual(3); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - const caseyOpts = userParamsSpy.calls.argsFor( - 0 - )[0] as user.IGetUserOptions; - const jonesOpts = userParamsSpy.calls.argsFor( - 1 - )[0] as user.IGetUserOptions; - - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(queryOpts.outFields).toEqual(mockOutFields); - expect(caseyOpts).toEqual({ - username: "casey", - authentication: undefined, - portal: undefined - }); - expect(jonesOpts).toEqual({ - username: "jones", - authentication: undefined, - portal: undefined - }); - expect(response).toEqual(annoResponse); - done(); - }) - .catch(() => fail()); - }); - - it("should not fetch user info if no features are returned from search", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryResponseEmpty); - }) - ); - - const userParamsSpy = spyOn(user, "getUser"); - - searchAnnotations({ - url: annoSearchResponse.results[0].url + "/0", - where: "1=0" - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(userParamsSpy.calls.count()).toEqual(0); - - const opts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - - expect(opts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(opts.where).toBe("1=0 AND parent_id IS NULL"); - expect(opts.outFields).toEqual(mockOutFields); - expect(response).toEqual(annoResponseEmpty); - done(); - }) - .catch(() => fail()); - }); - - it("should allow users to fetch whatever fields they want", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryResponse); - }) - ); - - const userParamsSpy = spyOn(user, "getUser").and.returnValues( - new Promise(resolve => { - resolve(userResponseCasey); - }), - new Promise(resolve => { - resolve(userResponseJones); - }), - new Promise((resolve, reject) => { - reject({ error: "not sure this matters" }); - }) - ); - - searchAnnotations({ - url: annoSearchResponse.results[0].url + "/0", - outFields: ["*"] - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(userParamsSpy.calls.count()).toEqual(3); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(queryOpts.outFields).toEqual(["*"]); - expect(response).toEqual(annoResponse); - done(); - }) - .catch(() => fail()); - }); -}); - -describe("searchSingleAnnotationVotes", () => { - it("should query for votes when comment has no votes", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoVoteQueryResponseEmpty); - }) - ); - - searchSingleAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0", - annotation: annoFeature - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(1); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(response).toEqual(annoVoteResponseEmpty); - done(); - }) - .catch(() => fail()); - }); - - it("should query for votes when comment has votes", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoVoteQueryResponse); - }) - ); - - searchSingleAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0", - annotation: annoFeature - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(1); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(response).toEqual(annoVoteResponse); - done(); - }) - .catch(() => fail()); - }); - - it("should query for votes when comment is not valid", done => { - searchSingleAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0", - annotation: invalidIdAnnoFeature - }) - .then(response => { - expect(response).toEqual(annoVoteResponseInvalid); - done(); - }) - .catch(() => fail()); - }); - - it("should query for votes when comment id is missing", done => { - searchSingleAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0", - annotation: missingIdAnnoFeature - }) - .then(response => { - expect(response).toEqual(annoVoteResponseInvalid); - done(); - }) - .catch(() => fail()); - }); -}); - -describe("searchAllAnnotationVotes", () => { - it("should query for votes when comment has no votes", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(allAnnoVoteQueryResponseEmpty); - }) - ); - - searchAllAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0" - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(2); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(response).toEqual(allAnnoVoteResponseEmpty); - done(); - }) - .catch(() => fail()); - }); - - it("should query for votes when comment has no votes", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValues( - new Promise(resolve => { - resolve(allAnnoUpVoteQueryResponse); - }), - new Promise(resolve => { - resolve(allAnnoDownVoteQueryResponse); - }) - ); - - searchAllAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0" - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(2); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(response).toEqual(allAnnoVoteResponse); - done(); - }) - .catch(() => fail()); - }); - - it("should query for votes when comment has no votes and initiative is set", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValues( - new Promise(resolve => { - resolve(allAnnoUpVoteQueryResponse); - }), - new Promise(resolve => { - resolve(allAnnoDownVoteQueryResponse); - }) - ); - - const initiativeWhereClause = "dataset_id=initiative123"; - searchAllAnnotationVotes({ - url: annoSearchResponse.results[0].url + "/0", - where: initiativeWhereClause - }) - .then(response => { - expect(queryParamsSpy.calls.count()).toEqual(2); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - expect(queryOpts.url).toBe(annoSearchResponse.results[0].url + "/0"); - expect(queryOpts.where).toContain(initiativeWhereClause + " AND vote"); - expect(response).toEqual(allAnnoVoteResponse); - done(); - }) - .catch(() => fail()); - }); -}); diff --git a/packages/annotations/test/util.test.ts b/packages/annotations/test/util.test.ts deleted file mode 100644 index ed3b7fe9bb8..00000000000 --- a/packages/annotations/test/util.test.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { getAnnotationServiceUrl, checkResults } from "../src/util"; -import { - annoSearchResponse, - emptyAnnoSearchResponse -} from "./mocks/ago_search"; - -import * as portal from "@esri/arcgis-rest-portal"; - -import { ISearchOptions } from "@esri/arcgis-rest-portal"; - -describe("getAnnotationServiceUrl", () => { - it("should return an annotation service url", done => { - // stub searchItems - const paramsSpy = spyOn(portal, "searchItems").and.returnValue( - new Promise(resolve => { - resolve(annoSearchResponse); - }) - ); - - getAnnotationServiceUrl("5bc") - .then(() => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as ISearchOptions; - expect(opts.q).toEqual("typekeywords:hubAnnotationLayer AND orgid:5bc"); - done(); - }) - .catch(() => fail()); - }); - - it("should throw if no annotation layer is found", done => { - // stub searchItems - const paramsSpy = spyOn(portal, "searchItems").and.returnValue( - new Promise(resolve => { - resolve(emptyAnnoSearchResponse); - }) - ); - - getAnnotationServiceUrl("v8b").catch(error => { - expect(paramsSpy.calls.count()).toEqual(1); - const opts = paramsSpy.calls.argsFor(0)[0] as ISearchOptions; - expect(opts.q).toEqual("typekeywords:hubAnnotationLayer AND orgid:v8b"); - expect(error.message).toBe( - "No annotation service found. Commenting is likely not enabled." - ); - done(); - }); - }); -}); - -describe("checkResults", () => { - it("should return original results when some are successful", () => { - const results = [ - { - objectId: 617, - success: true - }, - { - success: false, - error: { - code: -2147217395, - description: "Setting of Value for depth failed." - } - } - ]; - const acutal = checkResults(results); - expect(acutal).toBe(results); - }); - it("should throw specific error when all failed with same description", () => { - const description = "Setting of Value for depth failed."; - const results = [ - { - success: false, - error: { - code: -2147217395, - description - } - } - ]; - expect(() => checkResults(results)).toThrowError(description); - }); - it("should throw default error when all failed w/ different descriptions", () => { - const description = "Setting of Value for depth failed."; - const results = [ - { - success: false, - error: { - code: -2147217394, - description: "Another error." - } - }, - { - success: false, - error: { - code: -2147217395, - description: "Setting of Value for depth failed." - } - } - ]; - expect(() => checkResults(results)).toThrowError( - "All attempted edits failed" - ); - }); -}); diff --git a/packages/annotations/test/vote.test.ts b/packages/annotations/test/vote.test.ts deleted file mode 100644 index d577c3ed453..00000000000 --- a/packages/annotations/test/vote.test.ts +++ /dev/null @@ -1,320 +0,0 @@ -import { voteOnAnnotation } from "../src/vote"; -import { - annoQueryVoteResponse, - annoQueryResponseEmpty -} from "./mocks/anno_search"; -import { UserSession } from "@esri/arcgis-rest-auth"; -import { - IQueryFeaturesOptions, - IAddFeaturesOptions, - IDeleteFeaturesOptions -} from "@esri/arcgis-rest-feature-layer"; -import * as featureService from "@esri/arcgis-rest-feature-layer"; - -export const addFeaturesResponse = { - addResults: [ - { - objectId: 1001, - success: true - } - ] -}; - -export const deleteFeaturesResponse = { - deleteResults: [ - { - objectId: 2, - success: true - } - ] -}; - -const TOMORROW = (function() { - const now = new Date(); - now.setDate(now.getDate() + 1); - return now; -})(); - -const MOCK_USER_SESSION = new UserSession({ - username: "casey", - password: "123456", - token: "fake-token", - tokenExpires: TOMORROW -}); - -const annoUrl = - "https://services.arcgis.com/xyz/arcgis/rest/services/hub_annotations/FeatureServer/0"; - -describe("voteOnAnnotation", () => { - it("should do upvoting", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryResponseEmpty); - }) - ); - - // stub add features - const addParamsSpy = spyOn(featureService, "addFeatures").and.returnValue( - new Promise(resolve => { - resolve(addFeaturesResponse); - }) - ); - - const options = { - url: annoUrl, - annotation: { - attributes: { - OBJECTID: 123, - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - source: "hub.js", - author: "otherguy" - } - }, - authentication: MOCK_USER_SESSION - }; - - voteOnAnnotation(options) - .then(() => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(addParamsSpy.calls.count()).toEqual(1); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - const addOpts = addParamsSpy.calls.argsFor(0)[0] as IAddFeaturesOptions; - expect(queryOpts.url).toBe(annoUrl); - expect(queryOpts.where).toBe("parent_id = 123 AND author = 'casey'"); - expect(addOpts.url).toBe(annoUrl); - expect(addOpts.features).toEqual([ - { - attributes: { - vote: 1, - parent_id: 123, - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - description: "this is a vote.", - status: "approved", - source: "hub.js" - } - } - ]); - done(); - }) - .catch(() => { - fail(); - }); - }); - - it("should do downvoting", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryResponseEmpty); - }) - ); - - // stub add features - const addParamsSpy = spyOn(featureService, "addFeatures").and.returnValue( - new Promise(resolve => { - resolve(addFeaturesResponse); - }) - ); - - const options = { - url: annoUrl, - downVote: true, - annotation: { - attributes: { - OBJECTID: 123, - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - source: "hub.js", - author: "otherguy" - } - }, - authentication: MOCK_USER_SESSION - }; - - voteOnAnnotation(options) - .then(() => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(addParamsSpy.calls.count()).toEqual(1); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - const addOpts = addParamsSpy.calls.argsFor(0)[0] as IAddFeaturesOptions; - expect(queryOpts.url).toBe(annoUrl); - expect(queryOpts.where).toBe("parent_id = 123 AND author = 'casey'"); - expect(addOpts.url).toBe(annoUrl); - expect(addOpts.features).toEqual([ - { - attributes: { - vote: -1, - parent_id: 123, - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - description: "this is a vote.", - status: "approved", - source: "hub.js" - } - } - ]); - done(); - }) - .catch(() => { - fail(); - }); - }); - - it("should allow a user to switch their vote", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryVoteResponse); - }) - ); - - // stub add features - const deleteParamsSpy = spyOn( - featureService, - "deleteFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(deleteFeaturesResponse); - }) - ); - - const options = { - url: annoUrl, - annotation: { - attributes: { - OBJECTID: 123, - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - source: "hub.js", - author: "otherguy" - } - }, - authentication: MOCK_USER_SESSION - }; - - voteOnAnnotation(options) - .then(() => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(deleteParamsSpy.calls.count()).toEqual(1); - const queryOpts = queryParamsSpy.calls.argsFor( - 0 - )[0] as IQueryFeaturesOptions; - const deleteOpts = deleteParamsSpy.calls.argsFor( - 0 - )[0] as IDeleteFeaturesOptions; - expect(queryOpts.url).toBe(annoUrl); - expect(queryOpts.where).toBe("parent_id = 123 AND author = 'casey'"); - expect(deleteOpts.url).toBe(annoUrl); - expect(deleteOpts.objectIds).toEqual([2]); - done(); - }) - .catch(() => { - fail(); - }); - }); - - it("should throw an error if no auth is passed", done => { - const options = { - url: annoUrl, - annotation: { - attributes: { - OBJECTID: 123, - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - source: "hub.js", - author: "otherguy" - } - }, - authentication: null as any - }; - - voteOnAnnotation(options).catch(err => { - expect(err.message).toEqual( - "Voting by anonymous users is not supported." - ); - done(); - }); - }); - - it("throw an error instead of helping a user upvote their own idea", done => { - const options = { - url: annoUrl, - annotation: { - attributes: { - OBJECTID: 123, - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - source: "hub.js", - author: "casey" - } - }, - authentication: MOCK_USER_SESSION - }; - - voteOnAnnotation(options).catch(err => { - expect(err.message).toEqual( - "Users may not vote on their own comment/idea." - ); - done(); - }); - }); - - it("throw an error instead of logging duplicate votes for a user", done => { - const queryParamsSpy = spyOn( - featureService, - "queryFeatures" - ).and.returnValue( - new Promise(resolve => { - resolve(annoQueryVoteResponse); - }) - ); - - const options = { - url: annoUrl, - downVote: true, - annotation: { - attributes: { - OBJECTID: 123, - description: - "what do we want? bike lanes! when do we want them? now!", - target: - "https://services.arcgis.com/xyz/arcgis/rest/services/CityX_bikeshare_locations/FeatureServer/0", - source: "hub.js", - author: "jones" - } - }, - authentication: MOCK_USER_SESSION - }; - - voteOnAnnotation(options).catch(err => { - expect(queryParamsSpy.calls.count()).toEqual(1); - expect(err.message).toEqual( - "Users may only vote on a comment/idea once." - ); - done(); - }); - }); -}); diff --git a/packages/annotations/tsconfig.json b/packages/annotations/tsconfig.json deleted file mode 100644 index 90cbf37afa2..00000000000 --- a/packages/annotations/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "include": [ - "src/**/*.ts" - ] -} \ No newline at end of file