From c03430d4d5b93d983c9cab39117a5623113425e8 Mon Sep 17 00:00:00 2001 From: john gravois Date: Tue, 12 Jun 2018 17:32:05 -0700 Subject: [PATCH] feat(auth): add getCredential() method to UserSession for jsapi AFFECTS PACKAGES: @esri/arcgis-rest-auth ISSUES CLOSED: #208 --- demos/feature-service-browser/index.html | 6 +- demos/geocoder-browser/index.html | 6 +- demos/jsapi-integration/README.md | 8 + demos/jsapi-integration/index.html | 82 ++++++++ demos/jsapi-integration/package-lock.json | 184 ++++++++++++++++++ demos/jsapi-integration/package.json | 19 ++ docs/acetate.config.js | 3 +- docs/src/guides/amd-requirejs-dojo.md | 31 +++ docs/src/guides/from-a-cdn.md | 2 +- packages/arcgis-rest-auth/src/UserSession.ts | 23 ++- .../arcgis-rest-auth/test/UserSession.test.ts | 30 ++- 11 files changed, 384 insertions(+), 10 deletions(-) create mode 100644 demos/jsapi-integration/README.md create mode 100644 demos/jsapi-integration/index.html create mode 100644 demos/jsapi-integration/package-lock.json create mode 100644 demos/jsapi-integration/package.json diff --git a/demos/feature-service-browser/index.html b/demos/feature-service-browser/index.html index 6a761197bc..4bc03100d3 100644 --- a/demos/feature-service-browser/index.html +++ b/demos/feature-service-browser/index.html @@ -57,8 +57,8 @@

query features!

- - + + diff --git a/demos/geocoder-browser/index.html b/demos/geocoder-browser/index.html index 59217d4ec8..05c31169b1 100644 --- a/demos/geocoder-browser/index.html +++ b/demos/geocoder-browser/index.html @@ -43,9 +43,9 @@

get to geocodin!

- - - + + + + + + + + + +
+ + \ No newline at end of file diff --git a/demos/jsapi-integration/package-lock.json b/demos/jsapi-integration/package-lock.json new file mode 100644 index 0000000000..a24be9aad0 --- /dev/null +++ b/demos/jsapi-integration/package-lock.json @@ -0,0 +1,184 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" + }, + "corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=" + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "requires": { + "ms": "2.0.0" + } + }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" + }, + "follow-redirects": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.0.tgz", + "integrity": "sha512-fdrt472/9qQ6Kgjvb935ig6vJCuofpBUD14f9Vb+SLlm7xIe4Qva5gey8EKtv8lp7ahE1wilg3xL1znpVGtZIA==", + "requires": { + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "requires": { + "eventemitter3": "^3.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-server": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz", + "integrity": "sha512-6JeGDGoujJLmhjiRGlt8yK8Z9Kl0vnl/dQoQZlc4oeqaUoAKQg94NILLfrY3oWzSyFaQCVNTcKE5PZ3cH8VP9w==", + "requires": { + "colors": "1.0.3", + "corser": "~2.0.0", + "ecstatic": "^3.0.0", + "http-proxy": "^1.8.1", + "opener": "~1.4.0", + "optimist": "0.6.x", + "portfinder": "^1.0.13", + "union": "~0.4.3" + }, + "dependencies": { + "ecstatic": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.2.0.tgz", + "integrity": "sha512-Goilx/2cfU9vvfQjgtNgc2VmJAD8CasQ6rZDqCd2u4Hsyd/qFET6nBf60jiHodevR3nl3IGzNKtrzPXWP88utQ==", + "requires": { + "he": "^1.1.1", + "mime": "^1.4.1", + "minimist": "^1.1.0", + "url-join": "^2.0.2" + } + } + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "opener": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "integrity": "sha1-XG2ixdflgx6P+jlklQ+NZnSskLg=" + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + } + } + }, + "portfinder": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz", + "integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=", + "requires": { + "async": "^1.5.2", + "debug": "^2.2.0", + "mkdirp": "0.5.x" + } + }, + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=" + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "union": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", + "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=", + "requires": { + "qs": "~2.3.3" + } + }, + "url-join": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", + "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=" + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + } + } +} diff --git a/demos/jsapi-integration/package.json b/demos/jsapi-integration/package.json new file mode 100644 index 0000000000..89871229ad --- /dev/null +++ b/demos/jsapi-integration/package.json @@ -0,0 +1,19 @@ +{ + "name": "@esri/jsapi-integration", + "version": "1.4.0", + "private": true, + "description": "to do", + "author": "", + "license": "Apache-2.0", + "dependencies": { + "@esri/arcgis-rest-auth": "^1.4.0", + "@esri/arcgis-rest-request": "^1.4.0", + "@esri/arcgis-rest-items": "^1.4.0" + }, + "devDependencies": { + "http-server": "*" + }, + "scripts": { + "start": "http-server ." + } +} diff --git a/docs/acetate.config.js b/docs/acetate.config.js index 03456acc25..4d4c7fcabc 100644 --- a/docs/acetate.config.js +++ b/docs/acetate.config.js @@ -196,10 +196,11 @@ module.exports = function(acetate) { return inspect(obj, { depth: 3 }); }); + // without the '.js' on the end, for the benefit of the AMD sample acetate.helper("cdnUrl", function(context, package) { return `https://unpkg.com/${ package.name - }@${package.version}/dist/umd/${package.name.replace("@esri/arcgis-rest-", "")}.umd.js`; + }@${package.version}/dist/umd/${package.name.replace("@esri/arcgis-rest-", "")}.umd`; }); acetate.helper("npmInstallCmd", function(context, package) { diff --git a/docs/src/guides/amd-requirejs-dojo.md b/docs/src/guides/amd-requirejs-dojo.md index 109a7a24b8..c050e15b62 100644 --- a/docs/src/guides/amd-requirejs-dojo.md +++ b/docs/src/guides/amd-requirejs-dojo.md @@ -7,3 +7,34 @@ group: 1-get-started --- # Get Started with ArcGIS REST JS and AMD + +```html + + + + + + ArcGIS REST JS - AMD + + + Open your console to see the demo. + + + + + + + +``` \ No newline at end of file diff --git a/docs/src/guides/from-a-cdn.md b/docs/src/guides/from-a-cdn.md index 13dc0158cd..d23ac50c1f 100644 --- a/docs/src/guides/from-a-cdn.md +++ b/docs/src/guides/from-a-cdn.md @@ -25,7 +25,7 @@ ArcGIS REST JS is hosted on [unpkg](https://unpkg.com/). You can find URLs for i - +