etincidunt 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 +29 -0
- package/.vscode/launch.json +24 -0
- package/.vscode/settings.json +3 -0
- package/demos/ago-node-cli/README.md +29 -0
- package/demos/ago-node-cli/ago.js +32 -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 +172 -0
- package/demos/ago-node-cli/package.json +30 -0
- package/demos/attachments/README.md +5 -0
- package/demos/attachments/index.html +164 -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 +14 -0
- package/demos/batch-geocoder-node/batch-geocode.js +112 -0
- package/demos/batch-geocoder-node/config-template.js +18 -0
- package/demos/batch-geocoder-node/package-lock.json +109 -0
- package/demos/batch-geocoder-node/package.json +37 -0
- package/demos/express/README.md +10 -0
- package/demos/express/config.json.template +3 -0
- package/demos/express/package-lock.json +388 -0
- package/demos/express/package.json +18 -0
- package/demos/express/server.js +28 -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 +163 -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 +8 -0
- package/demos/jsapi-integration/config.js +6 -0
- package/demos/jsapi-integration/index.html +79 -0
- package/demos/jsapi-integration/package-lock.json +184 -0
- package/demos/jsapi-integration/package.json +19 -0
- package/demos/oauth2-browser/README.md +12 -0
- package/demos/oauth2-browser/authenticate.html +32 -0
- package/demos/oauth2-browser/config.js.template +6 -0
- package/demos/oauth2-browser/index.html +202 -0
- package/demos/oauth2-browser/logo.svg +4 -0
- package/demos/oauth2-browser/package-lock.json +163 -0
- package/demos/oauth2-browser/package.json +18 -0
- package/demos/oauth2-browser/style.css +36 -0
- package/demos/vue/.babelrc +6 -0
- package/demos/vue/.env.example +8 -0
- package/demos/vue/README.md +17 -0
- package/demos/vue/index.html +21 -0
- package/demos/vue/package-lock.json +7236 -0
- package/demos/vue/package.json +39 -0
- package/demos/vue/src/assets/logo.svg +29 -0
- package/demos/vue/src/components/App.vue +302 -0
- package/demos/vue/src/components/Authenticate.vue +68 -0
- package/demos/vue/src/components/Loader.vue +216 -0
- package/demos/vue/src/main.js +75 -0
- package/demos/vue/webpack.config.js +84 -0
- package/docs/FAQ.md +28 -0
- package/docs/HISTORY.md +62 -0
- package/docs/acetate.config.js +214 -0
- package/docs/build-typedoc.js +301 -0
- package/docs/src/_layout.html +82 -0
- package/docs/src/api/_declaration.html +496 -0
- package/docs/src/api/_layout.html +127 -0
- package/docs/src/api/_package.html +13 -0
- package/docs/src/api/index.html +23 -0
- package/docs/src/guides/_layout.html +24 -0
- package/docs/src/guides/amd-requirejs-dojo.md +40 -0
- package/docs/src/guides/babel-and-rollup.md +30 -0
- package/docs/src/guides/babel-and-webpack.md +30 -0
- package/docs/src/guides/browser-authentication.md +9 -0
- package/docs/src/guides/browserify.md +9 -0
- package/docs/src/guides/cli-authentication.md +9 -0
- package/docs/src/guides/client-server-authentication.md +9 -0
- package/docs/src/guides/from-a-cdn.md +36 -0
- package/docs/src/guides/index.md +52 -0
- package/docs/src/guides/node.md +30 -0
- package/docs/src/guides/package-overview.md +8 -0
- package/docs/src/guides/server-authentication.md +9 -0
- package/docs/src/guides/typescript-and-webpack.md +9 -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 +113 -0
- package/docs/src/js/index.js +1 -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 +169 -0
- package/jasmine.json +7 -0
- package/karma.conf.js +100 -0
- package/lerna.json +8 -0
- package/notes/README.md +88 -0
- package/package.json +91 -0
- package/packages/arcgis-rest-auth/README.md +64 -0
- package/packages/arcgis-rest-auth/package-lock.json +11 -0
- package/packages/arcgis-rest-auth/package.json +51 -0
- package/packages/arcgis-rest-auth/src/ApplicationSession.ts +91 -0
- package/packages/arcgis-rest-auth/src/UserSession.ts +829 -0
- package/packages/arcgis-rest-auth/src/authenticated-request-options.ts +21 -0
- package/packages/arcgis-rest-auth/src/fetch-token.ts +55 -0
- package/packages/arcgis-rest-auth/src/generate-token.ts +36 -0
- package/packages/arcgis-rest-auth/src/index.ts +5 -0
- package/packages/arcgis-rest-auth/test/ApplicationSession.test.ts +121 -0
- package/packages/arcgis-rest-auth/test/UserSession.test.ts +883 -0
- package/packages/arcgis-rest-auth/test/fetchToken.test.ts +76 -0
- package/packages/arcgis-rest-auth/test/generateToken.test.ts +36 -0
- package/packages/arcgis-rest-auth/test/utils.ts +11 -0
- package/packages/arcgis-rest-auth/tsconfig.json +6 -0
- package/packages/arcgis-rest-common-types/README.md +61 -0
- package/packages/arcgis-rest-common-types/package.json +38 -0
- package/packages/arcgis-rest-common-types/src/group.ts +51 -0
- package/packages/arcgis-rest-common-types/src/index.ts +467 -0
- package/packages/arcgis-rest-common-types/src/item.ts +45 -0
- package/packages/arcgis-rest-common-types/src/webmap.ts +1225 -0
- package/packages/arcgis-rest-common-types/tsconfig.json +11 -0
- package/packages/arcgis-rest-feature-service/README.md +70 -0
- package/packages/arcgis-rest-feature-service/package-lock.json +11 -0
- package/packages/arcgis-rest-feature-service/package.json +50 -0
- package/packages/arcgis-rest-feature-service/src/add.ts +82 -0
- package/packages/arcgis-rest-feature-service/src/addAttachment.ts +65 -0
- package/packages/arcgis-rest-feature-service/src/delete.ts +85 -0
- package/packages/arcgis-rest-feature-service/src/deleteAttachments.ts +68 -0
- package/packages/arcgis-rest-feature-service/src/getAttachments.ts +64 -0
- package/packages/arcgis-rest-feature-service/src/helpers.ts +77 -0
- package/packages/arcgis-rest-feature-service/src/index.ts +8 -0
- package/packages/arcgis-rest-feature-service/src/query.ts +174 -0
- package/packages/arcgis-rest-feature-service/src/update.ts +81 -0
- package/packages/arcgis-rest-feature-service/src/updateAttachment.ts +74 -0
- package/packages/arcgis-rest-feature-service/test/attachments.test.ts +179 -0
- package/packages/arcgis-rest-feature-service/test/features.test.ts +172 -0
- package/packages/arcgis-rest-feature-service/test/mocks/feature.ts +220 -0
- package/packages/arcgis-rest-feature-service/test/mocks/foo.txt +1 -0
- package/packages/arcgis-rest-feature-service/tsconfig.json +6 -0
- package/packages/arcgis-rest-geocoder/README.md +73 -0
- package/packages/arcgis-rest-geocoder/package-lock.json +11 -0
- package/packages/arcgis-rest-geocoder/package.json +52 -0
- package/packages/arcgis-rest-geocoder/src/bulk.ts +102 -0
- package/packages/arcgis-rest-geocoder/src/geocode.ts +117 -0
- package/packages/arcgis-rest-geocoder/src/helpers.ts +81 -0
- package/packages/arcgis-rest-geocoder/src/index.ts +4 -0
- package/packages/arcgis-rest-geocoder/src/reverse.ts +84 -0
- package/packages/arcgis-rest-geocoder/src/suggest.ts +72 -0
- package/packages/arcgis-rest-geocoder/test/geocoder.test.ts +510 -0
- package/packages/arcgis-rest-geocoder/test/mocks/responses.ts +588 -0
- package/packages/arcgis-rest-geocoder/tsconfig.json +6 -0
- package/packages/arcgis-rest-groups/README.md +64 -0
- package/packages/arcgis-rest-groups/package-lock.json +11 -0
- package/packages/arcgis-rest-groups/package.json +52 -0
- package/packages/arcgis-rest-groups/src/groups.ts +272 -0
- package/packages/arcgis-rest-groups/src/index.ts +1 -0
- package/packages/arcgis-rest-groups/test/groups.test.ts +280 -0
- package/packages/arcgis-rest-groups/test/mocks/responses.ts +137 -0
- package/packages/arcgis-rest-groups/tsconfig.json +6 -0
- package/packages/arcgis-rest-items/README.md +66 -0
- package/packages/arcgis-rest-items/package-lock.json +11 -0
- package/packages/arcgis-rest-items/package.json +52 -0
- package/packages/arcgis-rest-items/src/index.ts +1 -0
- package/packages/arcgis-rest-items/src/items.ts +498 -0
- package/packages/arcgis-rest-items/test/items.test.ts +1153 -0
- package/packages/arcgis-rest-items/test/mocks/foo.zip +0 -0
- package/packages/arcgis-rest-items/test/mocks/item.ts +30 -0
- package/packages/arcgis-rest-items/test/mocks/resources.ts +28 -0
- package/packages/arcgis-rest-items/test/mocks/search.ts +60 -0
- package/packages/arcgis-rest-items/tsconfig.json +6 -0
- package/packages/arcgis-rest-request/README.md +65 -0
- package/packages/arcgis-rest-request/package-lock.json +11 -0
- package/packages/arcgis-rest-request/package.json +42 -0
- package/packages/arcgis-rest-request/src/index.ts +10 -0
- package/packages/arcgis-rest-request/src/request.ts +259 -0
- package/packages/arcgis-rest-request/src/utils/ArcGISAuthError.ts +67 -0
- package/packages/arcgis-rest-request/src/utils/ArcGISRequestError.ts +73 -0
- package/packages/arcgis-rest-request/src/utils/ErrorTypes.ts +29 -0
- package/packages/arcgis-rest-request/src/utils/check-for-errors.ts +65 -0
- package/packages/arcgis-rest-request/src/utils/encode-form-data.ts +29 -0
- package/packages/arcgis-rest-request/src/utils/encode-query-string.ts +23 -0
- package/packages/arcgis-rest-request/src/utils/get-portal-url.ts +25 -0
- package/packages/arcgis-rest-request/src/utils/get-portal.ts +45 -0
- package/packages/arcgis-rest-request/src/utils/process-params.ts +99 -0
- package/packages/arcgis-rest-request/test/mocks/errors.ts +59 -0
- package/packages/arcgis-rest-request/test/mocks/geojson-feature-collection.ts +10 -0
- package/packages/arcgis-rest-request/test/mocks/portal.ts +109 -0
- package/packages/arcgis-rest-request/test/mocks/sharing-rest-info.ts +38 -0
- package/packages/arcgis-rest-request/test/mocks/webmap.ts +38 -0
- package/packages/arcgis-rest-request/test/request.test.ts +296 -0
- package/packages/arcgis-rest-request/test/utils/ArcGISAuthError.test.ts +167 -0
- package/packages/arcgis-rest-request/test/utils/ArcGISRequestError.test.ts +40 -0
- package/packages/arcgis-rest-request/test/utils/check-for-errors.test.ts +101 -0
- package/packages/arcgis-rest-request/test/utils/encode-form-data.test.ts +112 -0
- package/packages/arcgis-rest-request/test/utils/get-portal-url.test.ts +34 -0
- package/packages/arcgis-rest-request/test/utils/portal.test.ts +94 -0
- package/packages/arcgis-rest-request/test/utils/process-params.test.ts +190 -0
- package/packages/arcgis-rest-request/tsconfig.json +6 -0
- package/packages/arcgis-rest-sharing/README.md +67 -0
- package/packages/arcgis-rest-sharing/package-lock.json +11 -0
- package/packages/arcgis-rest-sharing/package.json +55 -0
- package/packages/arcgis-rest-sharing/src/access.ts +91 -0
- package/packages/arcgis-rest-sharing/src/group-sharing.ts +212 -0
- package/packages/arcgis-rest-sharing/src/helpers.ts +92 -0
- package/packages/arcgis-rest-sharing/src/index.ts +2 -0
- package/packages/arcgis-rest-sharing/test/access.test.ts +153 -0
- package/packages/arcgis-rest-sharing/test/group-sharing.test.ts +436 -0
- package/packages/arcgis-rest-sharing/test/mocks/sharing.ts +15 -0
- package/packages/arcgis-rest-sharing/tsconfig.json +6 -0
- package/packages/arcgis-rest-users/README.md +71 -0
- package/packages/arcgis-rest-users/package-lock.json +11 -0
- package/packages/arcgis-rest-users/package.json +51 -0
- package/packages/arcgis-rest-users/src/index.ts +1 -0
- package/packages/arcgis-rest-users/src/users.ts +70 -0
- package/packages/arcgis-rest-users/test/mocks/responses.ts +170 -0
- package/packages/arcgis-rest-users/test/users.test.ts +97 -0
- package/packages/arcgis-rest-users/tsconfig.json +6 -0
- package/support/FormData.d.ts +1 -0
- package/support/changelog.js +388 -0
- package/support/commit-template.txt +19 -0
- package/support/deploy-doc-site.js +16 -0
- package/support/publish.sh +40 -0
- package/support/test-helpers.js +8 -0
- package/tsconfig.json +69 -0
- package/tslint.json +14 -0
- package/umd-base-profile.js +82 -0
- package/umd-production-profile.js +13 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
{% extends "_layout" %}
|
2
|
+
|
3
|
+
{% block main %}
|
4
|
+
<div class="grid-container trailer-1 leader-1">
|
5
|
+
<div class="column-6">
|
6
|
+
<ul class="list-plain">
|
7
|
+
{% for section in queries.guides %}
|
8
|
+
<li>{{section.name}}</li>
|
9
|
+
<ul class="list-plain margin-left-1">
|
10
|
+
{% for item in section.items %}
|
11
|
+
<li>{% link baseUrl + item.url, item.title %}</li>
|
12
|
+
{% endfor %}
|
13
|
+
</ul>
|
14
|
+
{% endfor %}
|
15
|
+
</ul>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="column-18">
|
19
|
+
<div class="panel">
|
20
|
+
{% block content %}{% endblock %}
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
{% endblock %}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS in AMD with Require.js or Dojo
|
3
|
+
navTitle: AMD (Require.js or Dojo)
|
4
|
+
description: Learn how to integrate the ArcGIS REST JS library into project using AMD with Require.js or Dojo.
|
5
|
+
order: 50
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started with ArcGIS REST JS and AMD
|
10
|
+
|
11
|
+
```html
|
12
|
+
<!DOCTYPE html>
|
13
|
+
<html>
|
14
|
+
<head>
|
15
|
+
<meta charset="utf-8">
|
16
|
+
<meta name="viewport" content="width=device-width">
|
17
|
+
<title>ArcGIS REST JS - AMD</title>
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
Open your console to see the demo.
|
21
|
+
</body>
|
22
|
+
<!-- require polyfills for fetch and Promise from https://polyfill.io -->
|
23
|
+
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=es5,Promise,fetch"></script>
|
24
|
+
<script>
|
25
|
+
dojoConfig = {
|
26
|
+
paths: {
|
27
|
+
"@esri/arcgis-rest-request": "{% cdnUrl data.typedoc | findPackage('@esri/arcgis-rest-request') %}"
|
28
|
+
}
|
29
|
+
};
|
30
|
+
</script>
|
31
|
+
<script src="https:////ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>
|
32
|
+
<script>
|
33
|
+
require(["@esri/arcgis-rest-request"], function(arcgis) {
|
34
|
+
arcgis.request("https://www.arcgis.com/sharing/rest/info").then(response => {
|
35
|
+
console.log(response);
|
36
|
+
});
|
37
|
+
});
|
38
|
+
</script>
|
39
|
+
</html>
|
40
|
+
```
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS with Babel and Rollup
|
3
|
+
navTitle: Babel + Rollup
|
4
|
+
description: Learn how to integrate the ArcGIS REST JS library into a Babel and Rollup based workflow.
|
5
|
+
order: 70
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started with Babel and Rollup
|
10
|
+
|
11
|
+
ArcGIS REST JS is ready-to-use with popular module bundlers like [webpack](https://webpack.js.org/) and [rollup](https://rollupjs.org/). Make sure you also install the polyfills for [`fetch`](https://github.com/matthew-andrews/isomorphic-fetch) and [`Promise`](https://github.com/stefanpenner/es6-promise). You can find `npm install` commands for all packages in the [API reference](../../api).
|
12
|
+
|
13
|
+
```bash
|
14
|
+
npm install @esri/arcgis-rest-request isomorphic-fetch es6-promise
|
15
|
+
```
|
16
|
+
|
17
|
+
Import the `isomorphic-fetch` and `es6-promise` polyfills before using ArcGIS REST JS.
|
18
|
+
|
19
|
+
```js
|
20
|
+
import "isomorphic-fetch";
|
21
|
+
import "es6-promise";
|
22
|
+
|
23
|
+
import { request } from "@esri/arcgis-rest-request";
|
24
|
+
|
25
|
+
request("https://www.arcgis.com/sharing/rest/info").then(response => {
|
26
|
+
console.log(response);
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
**Note**: many other libraries or tools (such as [Babel](https://babeljs.io/docs/usage/polyfill/)) require an ES6 `Promise` polyfill. Any `Promise` polyfill will work with ArcGIS REST JS, `es6-promise` is simply a lightweight standalone version.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS with Babel and Webpack
|
3
|
+
navTitle: Babel + WebPack
|
4
|
+
description: Learn how to integrate the ArcGIS REST JS library into a Babel and Webpack based workflow.
|
5
|
+
order: 30
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started with Babel and Webpack
|
10
|
+
|
11
|
+
ArcGIS REST JS is ready-to-use with popular module bundlers like [webpack](https://webpack.js.org/) and [rollup](https://rollupjs.org/). Make sure you also install the polyfills for [`fetch`](https://github.com/matthew-andrews/isomorphic-fetch) and [`Promise`](https://github.com/stefanpenner/es6-promise). You can find `npm install` commands for all packages in the [API reference](../../api).
|
12
|
+
|
13
|
+
```bash
|
14
|
+
npm install @esri/arcgis-rest-request isomorphic-fetch es6-promise
|
15
|
+
```
|
16
|
+
|
17
|
+
Import the `isomorphic-fetch` and `es6-promise` polyfills before using ArcGIS REST JS.
|
18
|
+
|
19
|
+
```js
|
20
|
+
import "isomorphic-fetch";
|
21
|
+
import "es6-promise";
|
22
|
+
|
23
|
+
import { request } from "@esri/arcgis-rest-request";
|
24
|
+
|
25
|
+
request("https://www.arcgis.com/sharing/rest/info").then(response => {
|
26
|
+
console.log(response);
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
**Note**: many other libraries or tools (such as [Babel](https://babeljs.io/docs/usage/polyfill/)) require an ES6 `Promise` polyfill. Any `Promise` polyfill will work with ArcGIS REST JS, `es6-promise` is simply a lightweight standalone version.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
title: Browser-based authentication with ArcGIS REST JS
|
3
|
+
navTitle: Browser-based OAuth 2.0
|
4
|
+
description: Learn how to authenticate users with ArcGIS REST JS and OAuth 2.0 in a browser.
|
5
|
+
order: 1
|
6
|
+
group: 2-authentication
|
7
|
+
---
|
8
|
+
|
9
|
+
# Authentication in Browser-based Apps
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS with Browserify
|
3
|
+
navTitle: Browserify
|
4
|
+
description: Learn how to integrate the ArcGIS REST JS library into a Browserify based workflow.
|
5
|
+
order: 80
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started with ArcGIS REST JS and Browserify
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
title: Authentication in CLI Applications
|
3
|
+
navTitle: Authentication for CLI Apps
|
4
|
+
description: Learn how to authenticate requests in Node.js based CLI applications.
|
5
|
+
order: 40
|
6
|
+
group: 2-authentication
|
7
|
+
---
|
8
|
+
|
9
|
+
# Authenticate Requests in a CLI Application
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
title: Server-client authentication with ArcGIS REST JS
|
3
|
+
navTitle: Shared client server authentication
|
4
|
+
description: Learn how to authenticate users and share authentication details between the client and server.
|
5
|
+
order: 30
|
6
|
+
group: 2-authentication
|
7
|
+
---
|
8
|
+
|
9
|
+
# Sharing Authentication Between Clients and Servers
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS from a CDN
|
3
|
+
navTitle: From a CDN
|
4
|
+
description: Learn how to use ArcGIS REST JS from a CDN.
|
5
|
+
order: 20
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started using a CDN
|
10
|
+
|
11
|
+
ArcGIS REST JS is hosted on [unpkg](https://unpkg.com/). You can find URLs for individual packages in the [API reference](../../api).
|
12
|
+
|
13
|
+
```html
|
14
|
+
<!DOCTYPE html>
|
15
|
+
<html>
|
16
|
+
<head>
|
17
|
+
<meta charset="utf-8">
|
18
|
+
<meta name="viewport" content="width=device-width">
|
19
|
+
<title>ArcGIS REST JS</title>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
Open your console to see the demo.
|
23
|
+
</body>
|
24
|
+
<!-- require polyfills for fetch and Promise from https://polyfill.io -->
|
25
|
+
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=es5,Promise,fetch"></script>
|
26
|
+
|
27
|
+
<!-- require ArcGIS REST JS libraries from https://unpkg.com -->
|
28
|
+
<script src="{% cdnUrl data.typedoc | findPackage('@esri/arcgis-rest-request') %}.js"></script>
|
29
|
+
|
30
|
+
<script>
|
31
|
+
// when including ArcGIS REST JS all exports are available from an arcgisRest global
|
32
|
+
arcgisRest.request("https://www.arcgis.com/sharing/rest/info").then(response => {
|
33
|
+
console.log(response);
|
34
|
+
});
|
35
|
+
</script>
|
36
|
+
</html>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
title: Get Started
|
3
|
+
description: Get started with ArcGIS REST JS.
|
4
|
+
---
|
5
|
+
|
6
|
+
# Get Started
|
7
|
+
|
8
|
+
ArcGIS REST JS can be deployed with a variety of build tools, including:
|
9
|
+
|
10
|
+
* [From a CDN](./from-a-cdn/)
|
11
|
+
* [Babel + Webpack](./babel-and-webpack/)
|
12
|
+
* [TypeScript + Webpack](./typescript-and-webpack/) (Coming soon)
|
13
|
+
* [AMD (Require.js or Dojo)](amd-requirejs-dojo/) (Coming soon)
|
14
|
+
* [Node.js](./node/)
|
15
|
+
* [Babel + Rollup](./babel-and-rollup/)
|
16
|
+
* [Browserify](./browserify/) (Coming soon)
|
17
|
+
|
18
|
+
## Requirements
|
19
|
+
|
20
|
+
ArcGIS REST JS takes advantage of web standards that are supported in all modern desktop browsers and most mobile browsers.
|
21
|
+
|
22
|
+
* [`Fetch` Support](https://caniuse.com/#feat=fetch)
|
23
|
+
* [`Promises` Support](https://caniuse.com/#feat=promises)
|
24
|
+
* [`FormData` Support](https://caniuse.com/#feat=xhr2)
|
25
|
+
* [`ECMAScript 5` Support](https://caniuse.com/#feat=es5)
|
26
|
+
|
27
|
+
## Browser Support
|
28
|
+
|
29
|
+
ArcGIS REST JS is supported in the same browsers as the [ArcGIS API for JavaScript](https://developers.arcgis.com/javascript/latest/guide/system-requirements/index.html#supported-browsers).
|
30
|
+
|
31
|
+
* Chrome
|
32
|
+
* Edge
|
33
|
+
* Firefox
|
34
|
+
* Safari 9 and later
|
35
|
+
* iOS Safari
|
36
|
+
* IE11
|
37
|
+
|
38
|
+
IE11 and older mobile browsers require polyfills.
|
39
|
+
|
40
|
+
* [`Promise` polyfill](https://github.com/stefanpenner/es6-promise)
|
41
|
+
* [`Fetch` polyfill](https://github.com/matthew-andrews/isomorphic-fetch)
|
42
|
+
|
43
|
+
## Node.js Support
|
44
|
+
|
45
|
+
ArcGIS REST JS is supported in Node.js 6.x and 8.x. It requires additional packages to polyfill `Fetch` and `FormData`.
|
46
|
+
|
47
|
+
We recommend the ones below:
|
48
|
+
|
49
|
+
* [`isomorphic-fetch`](https://www.npmjs.com/package/isomorphic-fetch) - to polyfill `Fetch`
|
50
|
+
* [`isomorphic-form-data`](https://github.com/form-data/isomorphic-form-data) - to polyfill `FormData`
|
51
|
+
|
52
|
+
Other versions of Node.js may also work with appropriate polyfills but we cannot guarantee support.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS in Node.js
|
3
|
+
navTitle: Node.js
|
4
|
+
description: Learn how to integrate the ArcGIS REST JS library into a Node.js app.
|
5
|
+
order: 60
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started with Node.js
|
10
|
+
|
11
|
+
Make sure you have polyfills for [`fetch`](https://github.com/matthew-andrews/isomorphic-fetch) and [`FormData`](https://github.com/form-data/isomorphic-form-data) installed before using any ArcGIS REST JS library. You can find `npm install` commands for all packages in the [API reference](../../api).
|
12
|
+
|
13
|
+
```bash
|
14
|
+
npm install @esri/arcgis-rest-request isomorphic-fetch isomorphic-form-data
|
15
|
+
```
|
16
|
+
|
17
|
+
Require the `isomorphic-fetch` and `isomorphic-form-data` modules before using any of the ArcGIS REST JS methods.
|
18
|
+
|
19
|
+
```js
|
20
|
+
require("isomorphic-fetch");
|
21
|
+
require("isomorphic-form-data");
|
22
|
+
|
23
|
+
const { request } = require("@esri/arcgis-rest-request");
|
24
|
+
|
25
|
+
request("https://www.arcgis.com/sharing/rest/info").then(response => {
|
26
|
+
console.log(response);
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
[Demo express application](https://github.com/Esri/arcgis-rest-js/tree/master/demos/express)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
title: Server-based authentication with ArcGIS REST JS
|
3
|
+
navTitle: Server-based OAuth 2.0
|
4
|
+
description: Learn how to authenticate users with ArcGIS REST JS and OAuth 2.0 in a Node.js server.
|
5
|
+
order: 10
|
6
|
+
group: 2-authentication
|
7
|
+
---
|
8
|
+
|
9
|
+
# Authentication in Server-based Apps
|
@@ -0,0 +1,9 @@
|
|
1
|
+
---
|
2
|
+
title: Using ArcGIS REST JS with TypeScript and Webpack
|
3
|
+
navTitle: TypeScript + WebPack
|
4
|
+
description: Learn how to integrate the ArcGIS REST JS library into a TypeScript and Webpack based workflow.
|
5
|
+
order: 40
|
6
|
+
group: 1-get-started
|
7
|
+
---
|
8
|
+
|
9
|
+
# Get Started with TypeScript and Webpack
|
Binary file
|
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
<header class="sub-nav" role="banner">
|
3
|
+
<div class="grid-container">
|
4
|
+
<div class="column-24 text-center leader-4 trailer-5">
|
5
|
+
<h1 class="font-size-7 text-white">ArcGIS REST JS</h1>
|
6
|
+
<p class="text-white font-size-2">Compact, modular JavaScript wrappers for the ArcGIS REST API</a>.</p>
|
7
|
+
{% link baseUrl + "/guides/", "Get Started", class="btn btn-large btn-clear-white" %}
|
8
|
+
{% link baseUrl + "/api/", "API Reference", class="btn btn-large btn-clear-white" %}
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</header>
|
12
|
+
</div>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
Vue.component("api-search", {
|
2
|
+
template: `
|
3
|
+
<div>
|
4
|
+
<form v-on:submit.prevent="onSubmit" class="input-group trailer-half leader-0 ">
|
5
|
+
<input ref="input" v-model="searchTerm" v-on:keyup.enter="onSubmit" v-on:keyup.up="onSelectPrevious" v-on:keyup.down="onSelectNext" v-on:keyup="onChange" class="input-group-input" type="text" placeholder="Search the API Reference">
|
6
|
+
<span class="input-group-button">
|
7
|
+
<button type="submit" class="btn"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" class="svg-icon"><path d="M31.607 27.838l-6.133-6.137a1.336 1.336 0 0 0-1.887 0l-.035.035-2.533-2.533-.014.014c3.652-4.556 3.422-11.195-.803-15.42-4.529-4.527-11.875-4.531-16.404 0-4.531 4.531-4.529 11.875 0 16.406 4.205 4.204 10.811 4.455 15.365.848l.004.003-.033.033 2.541 2.54a1.33 1.33 0 0 0 .025 1.848l6.135 6.133a1.33 1.33 0 0 0 1.887 0l1.885-1.883a1.332 1.332 0 0 0 0-1.887zM17.811 17.809a8.213 8.213 0 0 1-11.619 0 8.217 8.217 0 0 1 0-11.622 8.219 8.219 0 0 1 11.619.004 8.216 8.216 0 0 1 0 11.618z"/></svg></button>
|
8
|
+
</span>
|
9
|
+
</form>
|
10
|
+
|
11
|
+
<div class="panel" v-show="results.length <= 0 && searchTerm">
|
12
|
+
No Results.
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div v-show="results.length <= 0 && !searchTerm">
|
16
|
+
<slot></slot>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<ul v-show="results.length > 0" class="list-plain">
|
20
|
+
<li v-for="result, index in results" class="api-search-result" v-bind:class="[result.icon, {'is-selected': index === selectedResultIndex}]">
|
21
|
+
<a v-bind:href="result.url" class="tsd-kind-icon" v-html="result.title"></a>
|
22
|
+
</li>
|
23
|
+
</ul>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
`,
|
27
|
+
data: function() {
|
28
|
+
return {
|
29
|
+
results: [],
|
30
|
+
selectedResultIndex: 0,
|
31
|
+
searchTerm: ""
|
32
|
+
};
|
33
|
+
},
|
34
|
+
props: ['baseUrl'],
|
35
|
+
methods: {
|
36
|
+
highlightText: function(text, matches) {
|
37
|
+
return matches
|
38
|
+
.map(match => {
|
39
|
+
let characters = text.split("");
|
40
|
+
|
41
|
+
for (let i = match.indices.length - 1; i >= 0; i--) {
|
42
|
+
let start = match.indices[i][0];
|
43
|
+
let end = match.indices[i][1] + 1;
|
44
|
+
let foundMatch = characters.slice(start, end).join("");
|
45
|
+
characters.splice(
|
46
|
+
start,
|
47
|
+
end - start,
|
48
|
+
`<span style="text-decoration: underline; font-weight: 500;">${foundMatch}</span>`
|
49
|
+
);
|
50
|
+
}
|
51
|
+
|
52
|
+
return characters.join("");
|
53
|
+
})
|
54
|
+
.join();
|
55
|
+
},
|
56
|
+
onSubmit: function() {
|
57
|
+
if (this.results.length && this.results[this.selectedResultIndex]) {
|
58
|
+
window.location.href = this.results[this.selectedResultIndex].url;
|
59
|
+
}
|
60
|
+
},
|
61
|
+
|
62
|
+
search: function(text) {
|
63
|
+
return this.index.search(text).map(result => {
|
64
|
+
return {
|
65
|
+
title: this.highlightText(result.item.title, result.matches),
|
66
|
+
icon: result.item.icon,
|
67
|
+
url: this.baseUrl + result.item.url
|
68
|
+
};
|
69
|
+
});
|
70
|
+
},
|
71
|
+
|
72
|
+
onChange: function(e) {
|
73
|
+
this.results = this.search(e.target.value);
|
74
|
+
|
75
|
+
if (e.keyCode === 38 || e.keyCode === 40) {
|
76
|
+
e.preventDefault();
|
77
|
+
e.stopPropagation();
|
78
|
+
}
|
79
|
+
},
|
80
|
+
|
81
|
+
onSelectNext: function(e) {
|
82
|
+
this.selectedResultIndex =
|
83
|
+
this.selectedResultIndex === this.results.length - 1
|
84
|
+
? 0
|
85
|
+
: this.selectedResultIndex + 1;
|
86
|
+
e.preventDefault();
|
87
|
+
e.stopPropagation();
|
88
|
+
},
|
89
|
+
|
90
|
+
onSelectPrevious: function(e) {
|
91
|
+
this.selectedResultIndex =
|
92
|
+
this.selectedResultIndex === 0
|
93
|
+
? this.results.length - 1
|
94
|
+
: this.selectedResultIndex - 1;
|
95
|
+
|
96
|
+
e.preventDefault();
|
97
|
+
e.stopPropagation();
|
98
|
+
}
|
99
|
+
},
|
100
|
+
created: function() {
|
101
|
+
this.index = new Fuse(ESRI_REST_API_REF_INDEX, {
|
102
|
+
shouldSort: true,
|
103
|
+
threshold: 0.25,
|
104
|
+
location: 0,
|
105
|
+
distance: 200,
|
106
|
+
maxPatternLength: 32,
|
107
|
+
minMatchCharLength: 2,
|
108
|
+
findAllMatches: true,
|
109
|
+
includeMatches: true,
|
110
|
+
keys: ["title"]
|
111
|
+
});
|
112
|
+
}
|
113
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
const ESRI_REST_API_REF_INDEX = {{ data.typedoc.quickSearchIndex | dump | safe }};
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Vue.component("nav-toggle", {
|
2
|
+
props: ["index", "packageName"],
|
3
|
+
mounted: function() {
|
4
|
+
this.trigger = document.getElementById("trigger" + this.index);
|
5
|
+
this.list = document.getElementById("list" + this.index);
|
6
|
+
this.toggle = false;
|
7
|
+
|
8
|
+
const match = window.location.pathname.match(/\/api\/([^\/]+)\//);
|
9
|
+
const partialPath = match ? match[1] : null;
|
10
|
+
if (partialPath && this.packageName.indexOf(partialPath) > -1) {
|
11
|
+
this.show();
|
12
|
+
}
|
13
|
+
|
14
|
+
this.trigger.onclick = () => {
|
15
|
+
if (this.toggle) {
|
16
|
+
this.hide();
|
17
|
+
} else {
|
18
|
+
this.show();
|
19
|
+
}
|
20
|
+
};
|
21
|
+
},
|
22
|
+
methods: {
|
23
|
+
hide: function() {
|
24
|
+
for (var i = 0; i < this.list.children.length; i++) {
|
25
|
+
this.trigger.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" class="svg-icon"><path d="M7 4h5l12 12-12 12H7l12-12L7 4z"/></svg>`;
|
26
|
+
this.list.children[i].classList.add("visually-hidden");
|
27
|
+
}
|
28
|
+
this.toggle = false;
|
29
|
+
},
|
30
|
+
show: function() {
|
31
|
+
for (var i = 0; i < this.list.children.length; i++) {
|
32
|
+
this.trigger.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" class="svg-icon"><path d="M28 9v5L16 26 4 14V9l12 12L28 9z"/></svg>`;
|
33
|
+
this.list.children[i].classList.remove("visually-hidden");
|
34
|
+
if (this.list.children[i].children[0].classList.contains("is-active")) {
|
35
|
+
this.list.children[i].classList.add("list-item-active");
|
36
|
+
}
|
37
|
+
}
|
38
|
+
this.toggle = true;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
});
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Atom One Light by Daniel Gamage
|
4
|
+
Original One Light Syntax theme from https://github.com/atom/one-light-syntax
|
5
|
+
|
6
|
+
base: #fafafa
|
7
|
+
mono-1: #383a42
|
8
|
+
mono-2: #686b77
|
9
|
+
mono-3: #a0a1a7
|
10
|
+
hue-1: #0184bb
|
11
|
+
hue-2: #4078f2
|
12
|
+
hue-3: #a626a4
|
13
|
+
hue-4: #50a14f
|
14
|
+
hue-5: #e45649
|
15
|
+
hue-5-2: #c91243
|
16
|
+
hue-6: #986801
|
17
|
+
hue-6-2: #c18401
|
18
|
+
|
19
|
+
*/
|
20
|
+
|
21
|
+
.hljs {
|
22
|
+
display: block;
|
23
|
+
overflow-x: auto;
|
24
|
+
padding: 0.5em;
|
25
|
+
color: #383a42;
|
26
|
+
background: #fafafa;
|
27
|
+
}
|
28
|
+
|
29
|
+
.hljs-comment,
|
30
|
+
.hljs-quote {
|
31
|
+
color: #a0a1a7;
|
32
|
+
font-style: italic;
|
33
|
+
}
|
34
|
+
|
35
|
+
.hljs-doctag,
|
36
|
+
.hljs-keyword,
|
37
|
+
.hljs-formula {
|
38
|
+
color: #a626a4;
|
39
|
+
}
|
40
|
+
|
41
|
+
.hljs-section,
|
42
|
+
.hljs-name,
|
43
|
+
.hljs-selector-tag,
|
44
|
+
.hljs-deletion,
|
45
|
+
.hljs-subst {
|
46
|
+
color: #e45649;
|
47
|
+
}
|
48
|
+
|
49
|
+
.hljs-literal {
|
50
|
+
color: #0184bb;
|
51
|
+
}
|
52
|
+
|
53
|
+
.hljs-string,
|
54
|
+
.hljs-regexp,
|
55
|
+
.hljs-addition,
|
56
|
+
.hljs-attribute,
|
57
|
+
.hljs-meta-string {
|
58
|
+
color: #50a14f;
|
59
|
+
}
|
60
|
+
|
61
|
+
.hljs-built_in,
|
62
|
+
.hljs-class .hljs-title {
|
63
|
+
color: #c18401;
|
64
|
+
}
|
65
|
+
|
66
|
+
.hljs-attr,
|
67
|
+
.hljs-variable,
|
68
|
+
.hljs-template-variable,
|
69
|
+
.hljs-type,
|
70
|
+
.hljs-selector-class,
|
71
|
+
.hljs-selector-attr,
|
72
|
+
.hljs-selector-pseudo,
|
73
|
+
.hljs-number {
|
74
|
+
color: #986801;
|
75
|
+
}
|
76
|
+
|
77
|
+
.hljs-symbol,
|
78
|
+
.hljs-bullet,
|
79
|
+
.hljs-link,
|
80
|
+
.hljs-meta,
|
81
|
+
.hljs-selector-id,
|
82
|
+
.hljs-title {
|
83
|
+
color: #4078f2;
|
84
|
+
}
|
85
|
+
|
86
|
+
.hljs-emphasis {
|
87
|
+
font-style: italic;
|
88
|
+
}
|
89
|
+
|
90
|
+
.hljs-strong {
|
91
|
+
font-weight: bold;
|
92
|
+
}
|
93
|
+
|
94
|
+
.hljs-link {
|
95
|
+
text-decoration: underline;
|
96
|
+
}
|