impeditmaiores 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.prettierignore +2 -0
- package/.travis.yml +35 -0
- package/.vscode/launch.json +24 -0
- package/.vscode/settings.json +3 -0
- package/codecov.yml +7 -0
- package/demos/ago-node-cli/README.md +29 -0
- package/demos/ago-node-cli/ago.js +33 -0
- package/demos/ago-node-cli/index.js +11 -0
- package/demos/ago-node-cli/lib/item-export-command.js +48 -0
- package/demos/ago-node-cli/lib/item-search-command.js +35 -0
- package/demos/ago-node-cli/package-lock.json +152 -0
- package/demos/ago-node-cli/package.json +30 -0
- package/demos/attachments/README.md +5 -0
- package/demos/attachments/index.html +165 -0
- package/demos/attachments/package-lock.json +182 -0
- package/demos/attachments/package.json +18 -0
- package/demos/batch-geocoder-node/NYC_Restaurant_Inspection_Results.csv +100 -0
- package/demos/batch-geocoder-node/README.md +15 -0
- package/demos/batch-geocoder-node/batch-geocode.js +115 -0
- package/demos/batch-geocoder-node/config-template.js +18 -0
- package/demos/batch-geocoder-node/package-lock.json +81 -0
- package/demos/batch-geocoder-node/package.json +37 -0
- package/demos/express/README.md +15 -0
- package/demos/express/config.json.template +3 -0
- package/demos/express/package-lock.json +413 -0
- package/demos/express/package.json +18 -0
- package/demos/express/server.js +33 -0
- package/demos/feature-service-browser/README.md +6 -0
- package/demos/feature-service-browser/index.html +122 -0
- package/demos/feature-service-browser/package-lock.json +182 -0
- package/demos/feature-service-browser/package.json +18 -0
- package/demos/geocoder-browser/README.md +10 -0
- package/demos/geocoder-browser/config.js.template +1 -0
- package/demos/geocoder-browser/index.html +131 -0
- package/demos/geocoder-browser/package-lock.json +182 -0
- package/demos/geocoder-browser/package.json +19 -0
- package/demos/geocoder-browser/post-sign-in.html +25 -0
- package/demos/jsapi-integration/README.md +25 -0
- package/demos/jsapi-integration/config.js +6 -0
- package/demos/jsapi-integration/index.html +89 -0
- package/demos/jsapi-integration/package-lock.json +184 -0
- package/demos/jsapi-integration/package.json +19 -0
- package/demos/node-cli-item-management/README.md +10 -0
- package/demos/node-cli-item-management/index.js +238 -0
- package/demos/node-cli-item-management/package-lock.json +152 -0
- package/demos/node-cli-item-management/package.json +27 -0
- package/demos/node-cli-item-management/screenshot.png +0 -0
- package/demos/oauth2-browser/README.md +14 -0
- package/demos/oauth2-browser/authenticate.html +30 -0
- package/demos/oauth2-browser/config.js.template +6 -0
- package/demos/oauth2-browser/index.html +211 -0
- package/demos/oauth2-browser/logo.svg +4 -0
- package/demos/oauth2-browser/package-lock.json +224 -0
- package/demos/oauth2-browser/package.json +18 -0
- package/demos/oauth2-browser/style.css +36 -0
- package/demos/oauth2-browser-retry/README.md +25 -0
- package/demos/oauth2-browser-retry/authenticate.html +22 -0
- package/demos/oauth2-browser-retry/index.html +116 -0
- package/demos/oauth2-browser-retry/logo.svg +4 -0
- package/demos/stream-response-to-file/README.md +7 -0
- package/demos/stream-response-to-file/index.js +36 -0
- package/demos/stream-response-to-file/output/.gitkeep +0 -0
- package/demos/stream-response-to-file/package-lock.json +60 -0
- package/demos/stream-response-to-file/package.json +33 -0
- package/demos/tree-shaking-rollup/.babelrc +3 -0
- package/demos/tree-shaking-rollup/README.md +9 -0
- package/demos/tree-shaking-rollup/index.html +11 -0
- package/demos/tree-shaking-rollup/package-lock.json +2225 -0
- package/demos/tree-shaking-rollup/package.json +25 -0
- package/demos/tree-shaking-rollup/rollup.config.js +17 -0
- package/demos/tree-shaking-rollup/src/index.js +8 -0
- package/demos/tree-shaking-webpack/README.md +8 -0
- package/demos/tree-shaking-webpack/index.html +11 -0
- package/demos/tree-shaking-webpack/package-lock.json +4614 -0
- package/demos/tree-shaking-webpack/package.json +24 -0
- package/demos/tree-shaking-webpack/src/index.js +10 -0
- package/demos/tree-shaking-webpack/webpack.config.js +27 -0
- package/demos/vue/.env.example +11 -0
- package/demos/vue/.eslintrc.js +17 -0
- package/demos/vue/.postcssrc.js +5 -0
- package/demos/vue/README.md +17 -0
- package/demos/vue/babel.config.js +3 -0
- package/demos/vue/package-lock.json +11342 -0
- package/demos/vue/package.json +33 -0
- package/demos/vue/public/favicon.ico +0 -0
- package/demos/vue/public/index.html +24 -0
- package/demos/vue/src/assets/logo.svg +29 -0
- package/demos/vue/src/components/App.vue +305 -0
- package/demos/vue/src/components/Authenticate.vue +65 -0
- package/demos/vue/src/components/Loader.vue +230 -0
- package/demos/vue/src/main.js +92 -0
- package/demos/webmap-checker-sapper/.env.example +5 -0
- package/demos/webmap-checker-sapper/README.md +123 -0
- package/demos/webmap-checker-sapper/appveyor.yml +18 -0
- package/demos/webmap-checker-sapper/cypress/fixtures/example.json +5 -0
- package/demos/webmap-checker-sapper/cypress/integration/spec.js +19 -0
- package/demos/webmap-checker-sapper/cypress/plugins/index.js +17 -0
- package/demos/webmap-checker-sapper/cypress/support/commands.js +25 -0
- package/demos/webmap-checker-sapper/cypress/support/index.js +20 -0
- package/demos/webmap-checker-sapper/cypress.json +4 -0
- package/demos/webmap-checker-sapper/package-lock.json +3870 -0
- package/demos/webmap-checker-sapper/package.json +50 -0
- package/demos/webmap-checker-sapper/rollup.config.js +87 -0
- package/demos/webmap-checker-sapper/src/client.js +20 -0
- package/demos/webmap-checker-sapper/src/components/LayerStatus.html +108 -0
- package/demos/webmap-checker-sapper/src/components/Nav.html +21 -0
- package/demos/webmap-checker-sapper/src/components/WebMap.html +62 -0
- package/demos/webmap-checker-sapper/src/routes/_error.html +41 -0
- package/demos/webmap-checker-sapper/src/routes/_layout.html +21 -0
- package/demos/webmap-checker-sapper/src/routes/auth/authorize.js +18 -0
- package/demos/webmap-checker-sapper/src/routes/auth/exchange-token.js +20 -0
- package/demos/webmap-checker-sapper/src/routes/auth/post-sign-in.js +24 -0
- package/demos/webmap-checker-sapper/src/routes/auth/sign-out.js +10 -0
- package/demos/webmap-checker-sapper/src/routes/index.html +20 -0
- package/demos/webmap-checker-sapper/src/routes/webmaps/[webmapId].html +83 -0
- package/demos/webmap-checker-sapper/src/routes/webmaps/index.html +59 -0
- package/demos/webmap-checker-sapper/src/server.js +101 -0
- package/demos/webmap-checker-sapper/src/service-worker.js +82 -0
- package/demos/webmap-checker-sapper/src/template.html +33 -0
- package/demos/webmap-checker-sapper/src/userInfoMiddleware.js +21 -0
- package/demos/webmap-checker-sapper/src/utils.js +33 -0
- package/demos/webmap-checker-sapper/static/favicon.png +0 -0
- package/demos/webmap-checker-sapper/static/global.css +36 -0
- package/demos/webmap-checker-sapper/static/manifest.json +20 -0
- package/demos/webmap-checker-sapper/static/svelte-logo-192.png +0 -0
- package/demos/webmap-checker-sapper/static/svelte-logo-512.png +0 -0
- package/docs/FAQ.md +48 -0
- package/docs/HISTORY.md +62 -0
- package/docs/acetate.config.js +262 -0
- package/docs/build-typedoc.js +434 -0
- package/docs/generate-srihashes.js +53 -0
- package/docs/src/_layout.html +86 -0
- package/docs/src/api/_declaration.html +600 -0
- package/docs/src/api/_layout.html +204 -0
- package/docs/src/api/_package.html +38 -0
- package/docs/src/api/index.html +16 -0
- package/docs/src/guides/_layout.html +24 -0
- package/docs/src/guides/amd-requirejs-dojo.md +40 -0
- package/docs/src/guides/browser-authentication.md +41 -0
- package/docs/src/guides/bundlers.md +52 -0
- package/docs/src/guides/cli-authentication.md +9 -0
- package/docs/src/guides/client-server-authentication.md +9 -0
- package/docs/src/guides/embedded-apps.md +93 -0
- package/docs/src/guides/from-a-cdn.md +38 -0
- package/docs/src/guides/index.md +59 -0
- package/docs/src/guides/node.md +87 -0
- package/docs/src/guides/package-overview.md +111 -0
- package/docs/src/guides/server-authentication.md +9 -0
- package/docs/src/guides/whats-new-v2-0.md +305 -0
- package/docs/src/img/icons.png +0 -0
- package/docs/src/img/icons@2x.png +0 -0
- package/docs/src/index.html +12 -0
- package/docs/src/js/api-search.js +112 -0
- package/docs/src/js/nav-toggle.js +41 -0
- package/docs/src/sass/_highlight.scss +96 -0
- package/docs/src/sass/_icons.scss +157 -0
- package/docs/src/sass/style.scss +242 -0
- package/docs/src/srihashes.json +12 -0
- package/jasmine.json +7 -0
- package/karma.conf.js +106 -0
- package/lerna.json +8 -0
- package/notes/README.md +68 -0
- package/package.json +87 -0
- package/packages/arcgis-rest-auth/README.md +71 -0
- package/packages/arcgis-rest-auth/package-lock.json +11 -0
- package/packages/arcgis-rest-auth/package.json +69 -0
- package/packages/arcgis-rest-auth/src/ApplicationSession.ts +122 -0
- package/packages/arcgis-rest-auth/src/UserSession.ts +1206 -0
- package/packages/arcgis-rest-auth/src/app-tokens.ts +91 -0
- package/packages/arcgis-rest-auth/src/authenticated-request-options.ts +24 -0
- package/packages/arcgis-rest-auth/src/federation-utils.ts +85 -0
- package/packages/arcgis-rest-auth/src/fetch-token.ts +50 -0
- package/packages/arcgis-rest-auth/src/generate-token.ts +35 -0
- package/packages/arcgis-rest-auth/src/index.ts +9 -0
- package/packages/arcgis-rest-auth/src/validate-app-access.ts +68 -0
- package/packages/arcgis-rest-auth/test/ApplicationSession.test.ts +124 -0
- package/packages/arcgis-rest-auth/test/UserSession.test.ts +1807 -0
- package/packages/arcgis-rest-auth/test/app-tokens.test.ts +91 -0
- package/packages/arcgis-rest-auth/test/federation-utils.test.ts +323 -0
- package/packages/arcgis-rest-auth/test/fetchToken.test.ts +112 -0
- package/packages/arcgis-rest-auth/test/generateToken.test.ts +102 -0
- package/packages/arcgis-rest-auth/test/utils.ts +14 -0
- package/packages/arcgis-rest-auth/test/validate-app-access.test.ts +46 -0
- package/packages/arcgis-rest-auth/tsconfig.json +6 -0
- package/packages/arcgis-rest-feature-layer/README.md +77 -0
- package/packages/arcgis-rest-feature-layer/package-lock.json +11 -0
- package/packages/arcgis-rest-feature-layer/package.json +64 -0
- package/packages/arcgis-rest-feature-layer/src/add.ts +56 -0
- package/packages/arcgis-rest-feature-layer/src/addAttachment.ts +53 -0
- package/packages/arcgis-rest-feature-layer/src/applyEdits.ts +90 -0
- package/packages/arcgis-rest-feature-layer/src/decodeValues.ts +124 -0
- package/packages/arcgis-rest-feature-layer/src/delete.ts +61 -0
- package/packages/arcgis-rest-feature-layer/src/deleteAttachments.ts +52 -0
- package/packages/arcgis-rest-feature-layer/src/getAttachments.ts +55 -0
- package/packages/arcgis-rest-feature-layer/src/getLayer.ts +24 -0
- package/packages/arcgis-rest-feature-layer/src/getService.ts +26 -0
- package/packages/arcgis-rest-feature-layer/src/helpers.ts +79 -0
- package/packages/arcgis-rest-feature-layer/src/index.ts +31 -0
- package/packages/arcgis-rest-feature-layer/src/query.ts +204 -0
- package/packages/arcgis-rest-feature-layer/src/queryRelated.ts +89 -0
- package/packages/arcgis-rest-feature-layer/src/update.ts +56 -0
- package/packages/arcgis-rest-feature-layer/src/updateAttachment.ts +59 -0
- package/packages/arcgis-rest-feature-layer/test/attachments.test.ts +200 -0
- package/packages/arcgis-rest-feature-layer/test/crud.test.ts +195 -0
- package/packages/arcgis-rest-feature-layer/test/decodeValues.test.ts +67 -0
- package/packages/arcgis-rest-feature-layer/test/getLayer.test.ts +31 -0
- package/packages/arcgis-rest-feature-layer/test/getService.test.ts +31 -0
- package/packages/arcgis-rest-feature-layer/test/mocks/cvdQueryResponse.ts +225 -0
- package/packages/arcgis-rest-feature-layer/test/mocks/feature.ts +302 -0
- package/packages/arcgis-rest-feature-layer/test/mocks/fields.ts +779 -0
- package/packages/arcgis-rest-feature-layer/test/mocks/foo.txt +1 -0
- package/packages/arcgis-rest-feature-layer/test/mocks/service.ts +398 -0
- package/packages/arcgis-rest-feature-layer/test/query.test.ts +167 -0
- package/packages/arcgis-rest-feature-layer/tsconfig.json +6 -0
- package/packages/arcgis-rest-geocoding/README.md +86 -0
- package/packages/arcgis-rest-geocoding/package-lock.json +11 -0
- package/packages/arcgis-rest-geocoding/package.json +64 -0
- package/packages/arcgis-rest-geocoding/src/bulk.ts +104 -0
- package/packages/arcgis-rest-geocoding/src/geocode.ts +133 -0
- package/packages/arcgis-rest-geocoding/src/helpers.ts +54 -0
- package/packages/arcgis-rest-geocoding/src/index.ts +15 -0
- package/packages/arcgis-rest-geocoding/src/reverse.ts +84 -0
- package/packages/arcgis-rest-geocoding/src/suggest.ts +45 -0
- package/packages/arcgis-rest-geocoding/test/bulk.test.ts +194 -0
- package/packages/arcgis-rest-geocoding/test/geocode.test.ts +249 -0
- package/packages/arcgis-rest-geocoding/test/helpers.test.ts +85 -0
- package/packages/arcgis-rest-geocoding/test/mocks/responses.ts +637 -0
- package/packages/arcgis-rest-geocoding/test/reverse.test.ts +126 -0
- package/packages/arcgis-rest-geocoding/test/suggest.test.ts +53 -0
- package/packages/arcgis-rest-geocoding/tsconfig.json +6 -0
- package/packages/arcgis-rest-portal/README.md +73 -0
- package/packages/arcgis-rest-portal/package-lock.json +11 -0
- package/packages/arcgis-rest-portal/package.json +64 -0
- package/packages/arcgis-rest-portal/src/groups/add-users.ts +140 -0
- package/packages/arcgis-rest-portal/src/groups/create.ts +43 -0
- package/packages/arcgis-rest-portal/src/groups/get.ts +184 -0
- package/packages/arcgis-rest-portal/src/groups/helpers.ts +14 -0
- package/packages/arcgis-rest-portal/src/groups/invite-users.ts +127 -0
- package/packages/arcgis-rest-portal/src/groups/join.ts +57 -0
- package/packages/arcgis-rest-portal/src/groups/notification.ts +77 -0
- package/packages/arcgis-rest-portal/src/groups/protect.ts +56 -0
- package/packages/arcgis-rest-portal/src/groups/remove-users.ts +76 -0
- package/packages/arcgis-rest-portal/src/groups/remove.ts +32 -0
- package/packages/arcgis-rest-portal/src/groups/search.ts +47 -0
- package/packages/arcgis-rest-portal/src/groups/update-user-membership.ts +63 -0
- package/packages/arcgis-rest-portal/src/groups/update.ts +39 -0
- package/packages/arcgis-rest-portal/src/index.ts +66 -0
- package/packages/arcgis-rest-portal/src/items/add.ts +138 -0
- package/packages/arcgis-rest-portal/src/items/content.ts +67 -0
- package/packages/arcgis-rest-portal/src/items/create.ts +150 -0
- package/packages/arcgis-rest-portal/src/items/export.ts +80 -0
- package/packages/arcgis-rest-portal/src/items/get.ts +437 -0
- package/packages/arcgis-rest-portal/src/items/helpers.ts +275 -0
- package/packages/arcgis-rest-portal/src/items/protect.ts +41 -0
- package/packages/arcgis-rest-portal/src/items/reassign.ts +61 -0
- package/packages/arcgis-rest-portal/src/items/remove.ts +135 -0
- package/packages/arcgis-rest-portal/src/items/search.ts +25 -0
- package/packages/arcgis-rest-portal/src/items/update.ts +184 -0
- package/packages/arcgis-rest-portal/src/items/upload.ts +125 -0
- package/packages/arcgis-rest-portal/src/orgs/notification.ts +131 -0
- package/packages/arcgis-rest-portal/src/sharing/access.ts +84 -0
- package/packages/arcgis-rest-portal/src/sharing/helpers.ts +81 -0
- package/packages/arcgis-rest-portal/src/sharing/is-item-shared-with-group.ts +42 -0
- package/packages/arcgis-rest-portal/src/sharing/share-item-with-group.ts +319 -0
- package/packages/arcgis-rest-portal/src/sharing/unshare-item-with-group.ts +105 -0
- package/packages/arcgis-rest-portal/src/users/get-user-tags.ts +52 -0
- package/packages/arcgis-rest-portal/src/users/get-user-url.ts +18 -0
- package/packages/arcgis-rest-portal/src/users/get-user.ts +58 -0
- package/packages/arcgis-rest-portal/src/users/invitation.ts +156 -0
- package/packages/arcgis-rest-portal/src/users/notification.ts +68 -0
- package/packages/arcgis-rest-portal/src/users/search-users.ts +37 -0
- package/packages/arcgis-rest-portal/src/users/update.ts +66 -0
- package/packages/arcgis-rest-portal/src/util/SearchQueryBuilder.ts +374 -0
- package/packages/arcgis-rest-portal/src/util/array.ts +16 -0
- package/packages/arcgis-rest-portal/src/util/generic-search.ts +99 -0
- package/packages/arcgis-rest-portal/src/util/get-portal-settings.ts +45 -0
- package/packages/arcgis-rest-portal/src/util/get-portal-url.ts +27 -0
- package/packages/arcgis-rest-portal/src/util/get-portal.ts +52 -0
- package/packages/arcgis-rest-portal/src/util/get-subscription-info.ts +43 -0
- package/packages/arcgis-rest-portal/src/util/scrub-control-chars.ts +12 -0
- package/packages/arcgis-rest-portal/src/util/search.ts +42 -0
- package/packages/arcgis-rest-portal/test/groups/add-users.test.ts +239 -0
- package/packages/arcgis-rest-portal/test/groups/crud.test.ts +180 -0
- package/packages/arcgis-rest-portal/test/groups/get.test.ts +176 -0
- package/packages/arcgis-rest-portal/test/groups/invite-users.test.ts +149 -0
- package/packages/arcgis-rest-portal/test/groups/join.test.ts +72 -0
- package/packages/arcgis-rest-portal/test/groups/notification.test.ts +112 -0
- package/packages/arcgis-rest-portal/test/groups/protect.test.ts +72 -0
- package/packages/arcgis-rest-portal/test/groups/remove-users.test.ts +140 -0
- package/packages/arcgis-rest-portal/test/groups/search.test.ts +151 -0
- package/packages/arcgis-rest-portal/test/groups/update-user-membership.test.ts +62 -0
- package/packages/arcgis-rest-portal/test/items/add.test.ts +323 -0
- package/packages/arcgis-rest-portal/test/items/content.test.ts +156 -0
- package/packages/arcgis-rest-portal/test/items/create.test.ts +399 -0
- package/packages/arcgis-rest-portal/test/items/export.test.ts +122 -0
- package/packages/arcgis-rest-portal/test/items/get.test.ts +583 -0
- package/packages/arcgis-rest-portal/test/items/helpers.test.ts +60 -0
- package/packages/arcgis-rest-portal/test/items/protect.test.ts +122 -0
- package/packages/arcgis-rest-portal/test/items/reassign.test.ts +131 -0
- package/packages/arcgis-rest-portal/test/items/remove.test.ts +238 -0
- package/packages/arcgis-rest-portal/test/items/search.test.ts +272 -0
- package/packages/arcgis-rest-portal/test/items/update.test.ts +554 -0
- package/packages/arcgis-rest-portal/test/items/upload.test.ts +282 -0
- package/packages/arcgis-rest-portal/test/mocks/groups/responses.ts +208 -0
- package/packages/arcgis-rest-portal/test/mocks/items/foo.zip +0 -0
- package/packages/arcgis-rest-portal/test/mocks/items/item.ts +526 -0
- package/packages/arcgis-rest-portal/test/mocks/items/resources.ts +38 -0
- package/packages/arcgis-rest-portal/test/mocks/items/search.ts +121 -0
- package/packages/arcgis-rest-portal/test/mocks/portal/response.ts +126 -0
- package/packages/arcgis-rest-portal/test/mocks/portal/settings-response.ts +56 -0
- package/packages/arcgis-rest-portal/test/mocks/sharing/sharing.ts +18 -0
- package/packages/arcgis-rest-portal/test/mocks/users/invitation.ts +70 -0
- package/packages/arcgis-rest-portal/test/mocks/users/notification.ts +34 -0
- package/packages/arcgis-rest-portal/test/mocks/users/user-search.ts +388 -0
- package/packages/arcgis-rest-portal/test/mocks/users/user-tags.ts +5 -0
- package/packages/arcgis-rest-portal/test/mocks/users/user.ts +174 -0
- package/packages/arcgis-rest-portal/test/orgs/notification.test.ts +142 -0
- package/packages/arcgis-rest-portal/test/sharing/access.test.ts +162 -0
- package/packages/arcgis-rest-portal/test/sharing/helpers.test.ts +55 -0
- package/packages/arcgis-rest-portal/test/sharing/share-item-with-group.test.ts +1325 -0
- package/packages/arcgis-rest-portal/test/sharing/unshare-item-with-group.test.ts +288 -0
- package/packages/arcgis-rest-portal/test/users/get-user-tags.test.ts +71 -0
- package/packages/arcgis-rest-portal/test/users/get-user-url.test.ts +40 -0
- package/packages/arcgis-rest-portal/test/users/get-user.test.ts +90 -0
- package/packages/arcgis-rest-portal/test/users/invitation.test.ts +127 -0
- package/packages/arcgis-rest-portal/test/users/notification.test.ts +77 -0
- package/packages/arcgis-rest-portal/test/users/search.test.ts +42 -0
- package/packages/arcgis-rest-portal/test/users/update.test.ts +151 -0
- package/packages/arcgis-rest-portal/test/util/SearchQueryBuilder.test.ts +340 -0
- package/packages/arcgis-rest-portal/test/util/array.test.ts +30 -0
- package/packages/arcgis-rest-portal/test/util/get-portal-settings.test.ts +68 -0
- package/packages/arcgis-rest-portal/test/util/get-portal-url.test.ts +37 -0
- package/packages/arcgis-rest-portal/test/util/portal.test.ts +148 -0
- package/packages/arcgis-rest-portal/test/util/scrub-control-chars.test.ts +22 -0
- package/packages/arcgis-rest-portal/tsconfig.json +6 -0
- package/packages/arcgis-rest-request/README.md +72 -0
- package/packages/arcgis-rest-request/package-lock.json +11 -0
- package/packages/arcgis-rest-request/package.json +60 -0
- package/packages/arcgis-rest-request/src/index.ts +25 -0
- package/packages/arcgis-rest-request/src/request.ts +413 -0
- package/packages/arcgis-rest-request/src/utils/ArcGISRequestError.ts +76 -0
- package/packages/arcgis-rest-request/src/utils/ErrorTypes.ts +29 -0
- package/packages/arcgis-rest-request/src/utils/GrantTypes.ts +5 -0
- package/packages/arcgis-rest-request/src/utils/HTTPMethods.ts +6 -0
- package/packages/arcgis-rest-request/src/utils/IAuthenticationManager.ts +21 -0
- package/packages/arcgis-rest-request/src/utils/IFetchTokenParams.ts +11 -0
- package/packages/arcgis-rest-request/src/utils/IGenerateTokenParams.ts +9 -0
- package/packages/arcgis-rest-request/src/utils/IParamBuilder.ts +3 -0
- package/packages/arcgis-rest-request/src/utils/IParams.ts +6 -0
- package/packages/arcgis-rest-request/src/utils/IParamsBuilder.ts +5 -0
- package/packages/arcgis-rest-request/src/utils/IRequestOptions.ts +49 -0
- package/packages/arcgis-rest-request/src/utils/ITokenRequestOptions.ts +9 -0
- package/packages/arcgis-rest-request/src/utils/ResponseFormats.ts +10 -0
- package/packages/arcgis-rest-request/src/utils/append-custom-params.ts +49 -0
- package/packages/arcgis-rest-request/src/utils/clean-url.ts +20 -0
- package/packages/arcgis-rest-request/src/utils/decode-query-string.ts +27 -0
- package/packages/arcgis-rest-request/src/utils/encode-form-data.ts +38 -0
- package/packages/arcgis-rest-request/src/utils/encode-query-string.ts +35 -0
- package/packages/arcgis-rest-request/src/utils/process-params.ts +108 -0
- package/packages/arcgis-rest-request/src/utils/retryAuthError.ts +10 -0
- package/packages/arcgis-rest-request/src/utils/warn.ts +11 -0
- package/packages/arcgis-rest-request/src/utils/with-options.ts +48 -0
- package/packages/arcgis-rest-request/test/mocks/errors.ts +76 -0
- package/packages/arcgis-rest-request/test/mocks/geojson-feature-collection.ts +13 -0
- package/packages/arcgis-rest-request/test/mocks/param-builder.ts +7 -0
- package/packages/arcgis-rest-request/test/mocks/sharing-rest-info.ts +41 -0
- package/packages/arcgis-rest-request/test/mocks/webmap.ts +41 -0
- package/packages/arcgis-rest-request/test/request.test.ts +571 -0
- package/packages/arcgis-rest-request/test/utils/ArcGISAuthError.test.ts +191 -0
- package/packages/arcgis-rest-request/test/utils/ArcGISRequestError.test.ts +51 -0
- package/packages/arcgis-rest-request/test/utils/check-for-errors.test.ts +111 -0
- package/packages/arcgis-rest-request/test/utils/clean-url.test.ts +50 -0
- package/packages/arcgis-rest-request/test/utils/encode-form-data.test.ts +133 -0
- package/packages/arcgis-rest-request/test/utils/encode-query-string.test.ts +18 -0
- package/packages/arcgis-rest-request/test/utils/process-params.test.ts +205 -0
- package/packages/arcgis-rest-request/test/utils/with-options.test.ts +133 -0
- package/packages/arcgis-rest-request/tsconfig.json +4 -0
- package/packages/arcgis-rest-routing/README.md +75 -0
- package/packages/arcgis-rest-routing/package-lock.json +11 -0
- package/packages/arcgis-rest-routing/package.json +63 -0
- package/packages/arcgis-rest-routing/src/helpers.ts +16 -0
- package/packages/arcgis-rest-routing/src/index.ts +11 -0
- package/packages/arcgis-rest-routing/src/solveRoute.ts +124 -0
- package/packages/arcgis-rest-routing/test/mocks/responses.ts +825 -0
- package/packages/arcgis-rest-routing/test/solveRoute.test.ts +509 -0
- package/packages/arcgis-rest-routing/tsconfig.json +6 -0
- package/packages/arcgis-rest-service-admin/README.md +73 -0
- package/packages/arcgis-rest-service-admin/package-lock.json +11 -0
- package/packages/arcgis-rest-service-admin/package.json +65 -0
- package/packages/arcgis-rest-service-admin/src/addTo.ts +70 -0
- package/packages/arcgis-rest-service-admin/src/create.ts +189 -0
- package/packages/arcgis-rest-service-admin/src/index.ts +11 -0
- package/packages/arcgis-rest-service-admin/src/update.ts +50 -0
- package/packages/arcgis-rest-service-admin/test/addTo.test.ts +350 -0
- package/packages/arcgis-rest-service-admin/test/create.test.ts +294 -0
- package/packages/arcgis-rest-service-admin/test/mocks/layerDefinition.ts +79 -0
- package/packages/arcgis-rest-service-admin/test/mocks/service.ts +81 -0
- package/packages/arcgis-rest-service-admin/test/update.test.ts +115 -0
- package/packages/arcgis-rest-service-admin/tsconfig.json +6 -0
- package/packages/arcgis-rest-types/README.md +66 -0
- package/packages/arcgis-rest-types/package.json +54 -0
- package/packages/arcgis-rest-types/src/feature.ts +39 -0
- package/packages/arcgis-rest-types/src/geometry.ts +272 -0
- package/packages/arcgis-rest-types/src/group.ts +72 -0
- package/packages/arcgis-rest-types/src/index.ts +9 -0
- package/packages/arcgis-rest-types/src/item.ts +81 -0
- package/packages/arcgis-rest-types/src/service.ts +114 -0
- package/packages/arcgis-rest-types/src/statisticDefinition.ts +33 -0
- package/packages/arcgis-rest-types/src/symbol.ts +170 -0
- package/packages/arcgis-rest-types/src/user.ts +49 -0
- package/packages/arcgis-rest-types/src/webmap.ts +1367 -0
- package/packages/arcgis-rest-types/tsconfig.json +10 -0
- package/support/changelog.js +393 -0
- package/support/deploy-doc-site.js +16 -0
- package/support/dev.sh +6 -0
- package/support/publish.sh +47 -0
- package/support/test-helpers.js +9 -0
- package/tsconfig.json +63 -0
- package/tslint.json +16 -0
- package/umd-base-profile.js +81 -0
- package/umd-production-profile.js +13 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
# ArcGIS REST JS Express Demo
|
2
|
+
|
3
|
+
This demo explains how to trigger OAuth 2.0 via custom server-side code
|
4
|
+
|
5
|
+
## Setup
|
6
|
+
1. Make sure you run `npm run bootstrap` in the root folder to setup the dependencies
|
7
|
+
2. Create a new application on https://developers.arcgis.com
|
8
|
+
3. Add `http://localhost:3000/authenticate` as a redirect uri for your application.
|
9
|
+
4. Copy the `config.json.template` file, rename it to `config.json`
|
10
|
+
5. Copy your application's client id into your new `config.json` file.
|
11
|
+
|
12
|
+
## Running the demo
|
13
|
+
6. `npm start`
|
14
|
+
7. Visit http://localhost:3000/authorize to start the OAuth 2.0 process.
|
15
|
+
|
@@ -0,0 +1,413 @@
|
|
1
|
+
{
|
2
|
+
"requires": true,
|
3
|
+
"lockfileVersion": 1,
|
4
|
+
"dependencies": {
|
5
|
+
"accepts": {
|
6
|
+
"version": "1.3.5",
|
7
|
+
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
|
8
|
+
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
|
9
|
+
"requires": {
|
10
|
+
"mime-types": "~2.1.18",
|
11
|
+
"negotiator": "0.6.1"
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"array-flatten": {
|
15
|
+
"version": "1.1.1",
|
16
|
+
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
17
|
+
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
18
|
+
},
|
19
|
+
"asynckit": {
|
20
|
+
"version": "0.4.0",
|
21
|
+
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
22
|
+
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
23
|
+
},
|
24
|
+
"body-parser": {
|
25
|
+
"version": "1.18.3",
|
26
|
+
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
|
27
|
+
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
|
28
|
+
"requires": {
|
29
|
+
"bytes": "3.0.0",
|
30
|
+
"content-type": "~1.0.4",
|
31
|
+
"debug": "2.6.9",
|
32
|
+
"depd": "~1.1.2",
|
33
|
+
"http-errors": "~1.6.3",
|
34
|
+
"iconv-lite": "0.4.23",
|
35
|
+
"on-finished": "~2.3.0",
|
36
|
+
"qs": "6.5.2",
|
37
|
+
"raw-body": "2.3.3",
|
38
|
+
"type-is": "~1.6.16"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"bytes": {
|
42
|
+
"version": "3.0.0",
|
43
|
+
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
|
44
|
+
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
|
45
|
+
},
|
46
|
+
"combined-stream": {
|
47
|
+
"version": "1.0.7",
|
48
|
+
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
|
49
|
+
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
|
50
|
+
"requires": {
|
51
|
+
"delayed-stream": "~1.0.0"
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"content-disposition": {
|
55
|
+
"version": "0.5.2",
|
56
|
+
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
|
57
|
+
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
|
58
|
+
},
|
59
|
+
"content-type": {
|
60
|
+
"version": "1.0.4",
|
61
|
+
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
|
62
|
+
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
|
63
|
+
},
|
64
|
+
"cookie": {
|
65
|
+
"version": "0.3.1",
|
66
|
+
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
|
67
|
+
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
|
68
|
+
},
|
69
|
+
"cookie-signature": {
|
70
|
+
"version": "1.0.6",
|
71
|
+
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
72
|
+
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
|
73
|
+
},
|
74
|
+
"cross-fetch": {
|
75
|
+
"version": "3.0.2",
|
76
|
+
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.2.tgz",
|
77
|
+
"integrity": "sha512-a4Z0EJ5Nck6QtMy9ZqloLfpvu2uMV3sBfMCR+CgSBCZc6z5KR4bfEiD3dkepH8iZgJMXQpTqf8FjMmvu/GMFkg==",
|
78
|
+
"requires": {
|
79
|
+
"node-fetch": "2.3.0",
|
80
|
+
"whatwg-fetch": "3.0.0"
|
81
|
+
},
|
82
|
+
"dependencies": {
|
83
|
+
"node-fetch": {
|
84
|
+
"version": "2.3.0",
|
85
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz",
|
86
|
+
"integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA=="
|
87
|
+
}
|
88
|
+
}
|
89
|
+
},
|
90
|
+
"debug": {
|
91
|
+
"version": "2.6.9",
|
92
|
+
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
93
|
+
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
94
|
+
"requires": {
|
95
|
+
"ms": "2.0.0"
|
96
|
+
}
|
97
|
+
},
|
98
|
+
"delayed-stream": {
|
99
|
+
"version": "1.0.0",
|
100
|
+
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
101
|
+
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
102
|
+
},
|
103
|
+
"depd": {
|
104
|
+
"version": "1.1.2",
|
105
|
+
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
106
|
+
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
|
107
|
+
},
|
108
|
+
"destroy": {
|
109
|
+
"version": "1.0.4",
|
110
|
+
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
111
|
+
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
112
|
+
},
|
113
|
+
"ee-first": {
|
114
|
+
"version": "1.1.1",
|
115
|
+
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
116
|
+
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
117
|
+
},
|
118
|
+
"encodeurl": {
|
119
|
+
"version": "1.0.2",
|
120
|
+
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
121
|
+
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
122
|
+
},
|
123
|
+
"escape-html": {
|
124
|
+
"version": "1.0.3",
|
125
|
+
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
126
|
+
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
|
127
|
+
},
|
128
|
+
"etag": {
|
129
|
+
"version": "1.8.1",
|
130
|
+
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
131
|
+
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
132
|
+
},
|
133
|
+
"express": {
|
134
|
+
"version": "4.16.4",
|
135
|
+
"resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz",
|
136
|
+
"integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==",
|
137
|
+
"requires": {
|
138
|
+
"accepts": "~1.3.5",
|
139
|
+
"array-flatten": "1.1.1",
|
140
|
+
"body-parser": "1.18.3",
|
141
|
+
"content-disposition": "0.5.2",
|
142
|
+
"content-type": "~1.0.4",
|
143
|
+
"cookie": "0.3.1",
|
144
|
+
"cookie-signature": "1.0.6",
|
145
|
+
"debug": "2.6.9",
|
146
|
+
"depd": "~1.1.2",
|
147
|
+
"encodeurl": "~1.0.2",
|
148
|
+
"escape-html": "~1.0.3",
|
149
|
+
"etag": "~1.8.1",
|
150
|
+
"finalhandler": "1.1.1",
|
151
|
+
"fresh": "0.5.2",
|
152
|
+
"merge-descriptors": "1.0.1",
|
153
|
+
"methods": "~1.1.2",
|
154
|
+
"on-finished": "~2.3.0",
|
155
|
+
"parseurl": "~1.3.2",
|
156
|
+
"path-to-regexp": "0.1.7",
|
157
|
+
"proxy-addr": "~2.0.4",
|
158
|
+
"qs": "6.5.2",
|
159
|
+
"range-parser": "~1.2.0",
|
160
|
+
"safe-buffer": "5.1.2",
|
161
|
+
"send": "0.16.2",
|
162
|
+
"serve-static": "1.13.2",
|
163
|
+
"setprototypeof": "1.1.0",
|
164
|
+
"statuses": "~1.4.0",
|
165
|
+
"type-is": "~1.6.16",
|
166
|
+
"utils-merge": "1.0.1",
|
167
|
+
"vary": "~1.1.2"
|
168
|
+
}
|
169
|
+
},
|
170
|
+
"finalhandler": {
|
171
|
+
"version": "1.1.1",
|
172
|
+
"resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
|
173
|
+
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
|
174
|
+
"requires": {
|
175
|
+
"debug": "2.6.9",
|
176
|
+
"encodeurl": "~1.0.2",
|
177
|
+
"escape-html": "~1.0.3",
|
178
|
+
"on-finished": "~2.3.0",
|
179
|
+
"parseurl": "~1.3.2",
|
180
|
+
"statuses": "~1.4.0",
|
181
|
+
"unpipe": "~1.0.0"
|
182
|
+
}
|
183
|
+
},
|
184
|
+
"form-data": {
|
185
|
+
"version": "2.3.3",
|
186
|
+
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
|
187
|
+
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
|
188
|
+
"requires": {
|
189
|
+
"asynckit": "^0.4.0",
|
190
|
+
"combined-stream": "^1.0.6",
|
191
|
+
"mime-types": "^2.1.12"
|
192
|
+
}
|
193
|
+
},
|
194
|
+
"forwarded": {
|
195
|
+
"version": "0.1.2",
|
196
|
+
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
197
|
+
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
198
|
+
},
|
199
|
+
"fresh": {
|
200
|
+
"version": "0.5.2",
|
201
|
+
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
202
|
+
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
203
|
+
},
|
204
|
+
"http-errors": {
|
205
|
+
"version": "1.6.3",
|
206
|
+
"resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
|
207
|
+
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
|
208
|
+
"requires": {
|
209
|
+
"depd": "~1.1.2",
|
210
|
+
"inherits": "2.0.3",
|
211
|
+
"setprototypeof": "1.1.0",
|
212
|
+
"statuses": ">= 1.4.0 < 2"
|
213
|
+
}
|
214
|
+
},
|
215
|
+
"iconv-lite": {
|
216
|
+
"version": "0.4.23",
|
217
|
+
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
|
218
|
+
"integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
|
219
|
+
"requires": {
|
220
|
+
"safer-buffer": ">= 2.1.2 < 3"
|
221
|
+
}
|
222
|
+
},
|
223
|
+
"inherits": {
|
224
|
+
"version": "2.0.3",
|
225
|
+
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
226
|
+
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
227
|
+
},
|
228
|
+
"ipaddr.js": {
|
229
|
+
"version": "1.8.0",
|
230
|
+
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz",
|
231
|
+
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4="
|
232
|
+
},
|
233
|
+
"isomorphic-form-data": {
|
234
|
+
"version": "2.0.0",
|
235
|
+
"resolved": "https://registry.npmjs.org/isomorphic-form-data/-/isomorphic-form-data-2.0.0.tgz",
|
236
|
+
"integrity": "sha512-TYgVnXWeESVmQSg4GLVbalmQ+B4NPi/H4eWxqALKj63KsUrcu301YDjBqaOw3h+cbak7Na4Xyps3BiptHtxTfg==",
|
237
|
+
"requires": {
|
238
|
+
"form-data": "^2.3.2"
|
239
|
+
}
|
240
|
+
},
|
241
|
+
"media-typer": {
|
242
|
+
"version": "0.3.0",
|
243
|
+
"resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
244
|
+
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
245
|
+
},
|
246
|
+
"merge-descriptors": {
|
247
|
+
"version": "1.0.1",
|
248
|
+
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
249
|
+
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
|
250
|
+
},
|
251
|
+
"methods": {
|
252
|
+
"version": "1.1.2",
|
253
|
+
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
254
|
+
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
255
|
+
},
|
256
|
+
"mime": {
|
257
|
+
"version": "1.4.1",
|
258
|
+
"resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz",
|
259
|
+
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
|
260
|
+
},
|
261
|
+
"mime-db": {
|
262
|
+
"version": "1.37.0",
|
263
|
+
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
|
264
|
+
"integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg=="
|
265
|
+
},
|
266
|
+
"mime-types": {
|
267
|
+
"version": "2.1.21",
|
268
|
+
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
|
269
|
+
"integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
|
270
|
+
"requires": {
|
271
|
+
"mime-db": "~1.37.0"
|
272
|
+
}
|
273
|
+
},
|
274
|
+
"ms": {
|
275
|
+
"version": "2.0.0",
|
276
|
+
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
277
|
+
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
278
|
+
},
|
279
|
+
"negotiator": {
|
280
|
+
"version": "0.6.1",
|
281
|
+
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
|
282
|
+
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
|
283
|
+
},
|
284
|
+
"on-finished": {
|
285
|
+
"version": "2.3.0",
|
286
|
+
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
287
|
+
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
|
288
|
+
"requires": {
|
289
|
+
"ee-first": "1.1.1"
|
290
|
+
}
|
291
|
+
},
|
292
|
+
"parseurl": {
|
293
|
+
"version": "1.3.2",
|
294
|
+
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
|
295
|
+
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
|
296
|
+
},
|
297
|
+
"path-to-regexp": {
|
298
|
+
"version": "0.1.7",
|
299
|
+
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
300
|
+
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
301
|
+
},
|
302
|
+
"proxy-addr": {
|
303
|
+
"version": "2.0.4",
|
304
|
+
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz",
|
305
|
+
"integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==",
|
306
|
+
"requires": {
|
307
|
+
"forwarded": "~0.1.2",
|
308
|
+
"ipaddr.js": "1.8.0"
|
309
|
+
}
|
310
|
+
},
|
311
|
+
"qs": {
|
312
|
+
"version": "6.5.2",
|
313
|
+
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
314
|
+
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
|
315
|
+
},
|
316
|
+
"range-parser": {
|
317
|
+
"version": "1.2.0",
|
318
|
+
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz",
|
319
|
+
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4="
|
320
|
+
},
|
321
|
+
"raw-body": {
|
322
|
+
"version": "2.3.3",
|
323
|
+
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz",
|
324
|
+
"integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==",
|
325
|
+
"requires": {
|
326
|
+
"bytes": "3.0.0",
|
327
|
+
"http-errors": "1.6.3",
|
328
|
+
"iconv-lite": "0.4.23",
|
329
|
+
"unpipe": "1.0.0"
|
330
|
+
}
|
331
|
+
},
|
332
|
+
"safe-buffer": {
|
333
|
+
"version": "5.1.2",
|
334
|
+
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
335
|
+
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
336
|
+
},
|
337
|
+
"safer-buffer": {
|
338
|
+
"version": "2.1.2",
|
339
|
+
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
340
|
+
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
341
|
+
},
|
342
|
+
"send": {
|
343
|
+
"version": "0.16.2",
|
344
|
+
"resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz",
|
345
|
+
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
|
346
|
+
"requires": {
|
347
|
+
"debug": "2.6.9",
|
348
|
+
"depd": "~1.1.2",
|
349
|
+
"destroy": "~1.0.4",
|
350
|
+
"encodeurl": "~1.0.2",
|
351
|
+
"escape-html": "~1.0.3",
|
352
|
+
"etag": "~1.8.1",
|
353
|
+
"fresh": "0.5.2",
|
354
|
+
"http-errors": "~1.6.2",
|
355
|
+
"mime": "1.4.1",
|
356
|
+
"ms": "2.0.0",
|
357
|
+
"on-finished": "~2.3.0",
|
358
|
+
"range-parser": "~1.2.0",
|
359
|
+
"statuses": "~1.4.0"
|
360
|
+
}
|
361
|
+
},
|
362
|
+
"serve-static": {
|
363
|
+
"version": "1.13.2",
|
364
|
+
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
|
365
|
+
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
|
366
|
+
"requires": {
|
367
|
+
"encodeurl": "~1.0.2",
|
368
|
+
"escape-html": "~1.0.3",
|
369
|
+
"parseurl": "~1.3.2",
|
370
|
+
"send": "0.16.2"
|
371
|
+
}
|
372
|
+
},
|
373
|
+
"setprototypeof": {
|
374
|
+
"version": "1.1.0",
|
375
|
+
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
|
376
|
+
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
|
377
|
+
},
|
378
|
+
"statuses": {
|
379
|
+
"version": "1.4.0",
|
380
|
+
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
|
381
|
+
"integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
|
382
|
+
},
|
383
|
+
"type-is": {
|
384
|
+
"version": "1.6.16",
|
385
|
+
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
|
386
|
+
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
|
387
|
+
"requires": {
|
388
|
+
"media-typer": "0.3.0",
|
389
|
+
"mime-types": "~2.1.18"
|
390
|
+
}
|
391
|
+
},
|
392
|
+
"unpipe": {
|
393
|
+
"version": "1.0.0",
|
394
|
+
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
395
|
+
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
|
396
|
+
},
|
397
|
+
"utils-merge": {
|
398
|
+
"version": "1.0.1",
|
399
|
+
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
400
|
+
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
401
|
+
},
|
402
|
+
"vary": {
|
403
|
+
"version": "1.1.2",
|
404
|
+
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
405
|
+
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
406
|
+
},
|
407
|
+
"whatwg-fetch": {
|
408
|
+
"version": "3.0.0",
|
409
|
+
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz",
|
410
|
+
"integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q=="
|
411
|
+
}
|
412
|
+
}
|
413
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"name": "@esri/arcgis-rest-demo-express",
|
3
|
+
"version": "2.22.0",
|
4
|
+
"private": true,
|
5
|
+
"description": "Demo of @esri/arcgis-rest-* packages in an Express server",
|
6
|
+
"author": "",
|
7
|
+
"license": "Apache-2.0",
|
8
|
+
"dependencies": {
|
9
|
+
"@esri/arcgis-rest-auth": "^2.22.0",
|
10
|
+
"@esri/arcgis-rest-request": "^2.22.0",
|
11
|
+
"cross-fetch": "^3.0.0",
|
12
|
+
"express": "^4.16.3",
|
13
|
+
"isomorphic-form-data": "^2.0.0"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"start": "node server.js"
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require("cross-fetch/polyfill");
|
2
|
+
require("isomorphic-form-data");
|
3
|
+
const express = require("express");
|
4
|
+
const app = express();
|
5
|
+
const { UserSession } = require("@esri/arcgis-rest-auth");
|
6
|
+
const { clientId } = require("./config.json");
|
7
|
+
|
8
|
+
const credentials = {
|
9
|
+
clientId,
|
10
|
+
redirectUri: "http://localhost:3000/authenticate"
|
11
|
+
};
|
12
|
+
|
13
|
+
app.get("/authorize", function(req, res) {
|
14
|
+
UserSession.authorize(credentials, res);
|
15
|
+
});
|
16
|
+
|
17
|
+
app.get("/authenticate", function(req, res) {
|
18
|
+
if (credentials) {
|
19
|
+
UserSession.exchangeAuthorizationCode(
|
20
|
+
credentials,
|
21
|
+
req.query.code
|
22
|
+
).then(session => {
|
23
|
+
res.send(session.token);
|
24
|
+
});
|
25
|
+
} else {
|
26
|
+
res.send("please visit http://localhost:3000/authorize");
|
27
|
+
}
|
28
|
+
|
29
|
+
});
|
30
|
+
|
31
|
+
app.listen(3000, function() {
|
32
|
+
console.log("visit http://localhost:3000/authorize to test the application!");
|
33
|
+
});
|
@@ -0,0 +1,122 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
|
8
|
+
<div class="container-fluid">
|
9
|
+
<div class="row">
|
10
|
+
<div class="col-md-12">
|
11
|
+
<div class="jumbotron" >
|
12
|
+
<h1>query features!</h1>
|
13
|
+
<form id="queryForm" class="form-inline">
|
14
|
+
<div class="form-group">
|
15
|
+
<label for="resultRecordCount">Show up to</label>
|
16
|
+
<select id="resultRecordCount" class="form-control">
|
17
|
+
<option>5</option>
|
18
|
+
<option selected>10</option>
|
19
|
+
<option>25</option>
|
20
|
+
<option>50</option>
|
21
|
+
</select>
|
22
|
+
</div>
|
23
|
+
<div class="form-group">
|
24
|
+
<label for="queryField">records where</label>
|
25
|
+
<select id="queryField" class="form-control">
|
26
|
+
<option value="Cmn_Name">Type</option>
|
27
|
+
<option value="Condition">Condition</option>
|
28
|
+
</select>
|
29
|
+
</div>
|
30
|
+
<div class="form-group">
|
31
|
+
<label for="queryTerm">contains</label>
|
32
|
+
<input type="text" class="form-control" id="queryTerm" style="width: 200px" tabindex="0">
|
33
|
+
</div>
|
34
|
+
<button type="submit" class="btn btn-default">Go</button>
|
35
|
+
</form>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<div class="row">
|
40
|
+
<div class="col-md-12">
|
41
|
+
<table id="featureTable" class="table table-striped" style="display: none">
|
42
|
+
<thead>
|
43
|
+
<tr>
|
44
|
+
<th>Tree ID</th>
|
45
|
+
<th>Type</th>
|
46
|
+
<th>Condition</th>
|
47
|
+
</tr>
|
48
|
+
</thead>
|
49
|
+
<tbody id="tableBody">
|
50
|
+
</tbody>
|
51
|
+
</table>
|
52
|
+
<p id="suggestedTermsMessage">Try 'elm' or 'oak' for <strong>Type</strong>. Try 'fair' or 'good' for <strong>Condition</strong>.</p id="suggestedTermsMessage">
|
53
|
+
<p id="recordCountMessage"></p>
|
54
|
+
<p id="additionalRowsMessage" style="display: none" class="alert alert-warning">There are additional rows that meet your query criteria.</p>
|
55
|
+
</div>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<!-- load arcgis rest libraries -->
|
60
|
+
<script src="node_modules/@esri/arcgis-rest-request/dist/umd/request.umd.js"></script>
|
61
|
+
<script src="node_modules/@esri/arcgis-rest-feature-layer/dist/umd/feature-layer.umd.js"></script>
|
62
|
+
|
63
|
+
<script>
|
64
|
+
// respond when a user fills out the query form and
|
65
|
+
// either hits enter or clicks on the button
|
66
|
+
var queryForm = document.getElementById('queryForm');
|
67
|
+
queryForm.addEventListener('submit', function (e) {
|
68
|
+
// don't submit the form and reload the page (the default behavior)
|
69
|
+
e.preventDefault();
|
70
|
+
// get query params from form fields
|
71
|
+
var queryField = e.target.queryField.value;
|
72
|
+
var queryTerm = e.target.queryTerm.value;
|
73
|
+
var resultRecordCount = e.target.resultRecordCount.value;
|
74
|
+
// execute the query
|
75
|
+
queryTrees(queryField, queryTerm, resultRecordCount)
|
76
|
+
.then(function(response) {
|
77
|
+
// display the features in a table
|
78
|
+
refreshTable(response);
|
79
|
+
});
|
80
|
+
});
|
81
|
+
|
82
|
+
// perform query against the feature service and
|
83
|
+
// return a promise that will resolve with the response
|
84
|
+
function queryTrees(queryField, queryTerm, resultRecordCount) {
|
85
|
+
return arcgisRest.queryFeatures({
|
86
|
+
url: 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0',
|
87
|
+
// see: https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm
|
88
|
+
// for all possible query parameters
|
89
|
+
params: {
|
90
|
+
// NOTE: returnGeometry is set to false by default
|
91
|
+
where: queryField + ' LIKE \'%' + queryTerm + '%\'',
|
92
|
+
outFields: ['FID','Tree_ID','Cmn_Name','Condition'],
|
93
|
+
// limit to number of records that will show on the page
|
94
|
+
resultRecordCount: resultRecordCount
|
95
|
+
}
|
96
|
+
});
|
97
|
+
}
|
98
|
+
|
99
|
+
function refreshTable(response) {
|
100
|
+
var features = response.features;
|
101
|
+
// clear table
|
102
|
+
var tableBody = document.getElementById('tableBody');
|
103
|
+
tableBody.innerHTML = '';
|
104
|
+
// show returned features (if any)
|
105
|
+
var recordCount = features.length;
|
106
|
+
var featureTableDisplay = recordCount > 0 ? 'table' : 'none';
|
107
|
+
document.getElementById('featureTable').style.display = featureTableDisplay;
|
108
|
+
var rows = features.map(function (feature) {
|
109
|
+
return '<tr><td>' + feature.attributes.Tree_ID + '<td>' + feature.attributes.Cmn_Name + '</td><td>' + feature.attributes.Condition + '</td></tr>';
|
110
|
+
});
|
111
|
+
tableBody.innerHTML = rows.join('');
|
112
|
+
// show number of returned features
|
113
|
+
document.getElementById('recordCountMessage').innerHTML = recordCount + ' record(s) returned.';
|
114
|
+
// show/hide additional messages
|
115
|
+
var suggestedTermsMessageDisplay = recordCount > 0 ? 'none' : 'block';
|
116
|
+
var additionalRowsMessageDisplay = response.exceededTransferLimit ? 'block' : 'none';
|
117
|
+
document.getElementById('suggestedTermsMessage').style.display = suggestedTermsMessageDisplay;
|
118
|
+
document.getElementById('additionalRowsMessage').style.display = additionalRowsMessageDisplay;
|
119
|
+
}
|
120
|
+
</script>
|
121
|
+
</body>
|
122
|
+
</html>
|