delectusnon 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. package/.prettierignore +2 -0
  2. package/.travis.yml +33 -0
  3. package/.vscode/launch.json +24 -0
  4. package/.vscode/settings.json +3 -0
  5. package/demos/ago-node-cli/README.md +29 -0
  6. package/demos/ago-node-cli/ago.js +32 -0
  7. package/demos/ago-node-cli/index.js +11 -0
  8. package/demos/ago-node-cli/lib/item-export-command.js +48 -0
  9. package/demos/ago-node-cli/lib/item-search-command.js +35 -0
  10. package/demos/ago-node-cli/package-lock.json +172 -0
  11. package/demos/ago-node-cli/package.json +30 -0
  12. package/demos/attachments/README.md +5 -0
  13. package/demos/attachments/index.html +164 -0
  14. package/demos/attachments/package-lock.json +182 -0
  15. package/demos/attachments/package.json +18 -0
  16. package/demos/batch-geocoder-node/NYC_Restaurant_Inspection_Results.csv +100 -0
  17. package/demos/batch-geocoder-node/README.md +15 -0
  18. package/demos/batch-geocoder-node/batch-geocode.js +118 -0
  19. package/demos/batch-geocoder-node/config-template.js +18 -0
  20. package/demos/batch-geocoder-node/package-lock.json +116 -0
  21. package/demos/batch-geocoder-node/package.json +39 -0
  22. package/demos/express/README.md +10 -0
  23. package/demos/express/config.json.template +3 -0
  24. package/demos/express/package-lock.json +473 -0
  25. package/demos/express/package.json +18 -0
  26. package/demos/express/server.js +28 -0
  27. package/demos/feature-service-browser/README.md +6 -0
  28. package/demos/feature-service-browser/index.html +122 -0
  29. package/demos/feature-service-browser/package-lock.json +182 -0
  30. package/demos/feature-service-browser/package.json +18 -0
  31. package/demos/geocoder-browser/README.md +10 -0
  32. package/demos/geocoder-browser/config.js.template +1 -0
  33. package/demos/geocoder-browser/index.html +131 -0
  34. package/demos/geocoder-browser/package-lock.json +182 -0
  35. package/demos/geocoder-browser/package.json +19 -0
  36. package/demos/geocoder-browser/post-sign-in.html +25 -0
  37. package/demos/jsapi-integration/README.md +8 -0
  38. package/demos/jsapi-integration/config.js +6 -0
  39. package/demos/jsapi-integration/index.html +79 -0
  40. package/demos/jsapi-integration/package-lock.json +184 -0
  41. package/demos/jsapi-integration/package.json +19 -0
  42. package/demos/oauth2-browser/README.md +12 -0
  43. package/demos/oauth2-browser/authenticate.html +32 -0
  44. package/demos/oauth2-browser/config.js.template +6 -0
  45. package/demos/oauth2-browser/index.html +202 -0
  46. package/demos/oauth2-browser/logo.svg +4 -0
  47. package/demos/oauth2-browser/package-lock.json +163 -0
  48. package/demos/oauth2-browser/package.json +18 -0
  49. package/demos/oauth2-browser/style.css +36 -0
  50. package/demos/oauth2-browser-retry/README.md +25 -0
  51. package/demos/oauth2-browser-retry/authenticate.html +21 -0
  52. package/demos/oauth2-browser-retry/index.html +116 -0
  53. package/demos/oauth2-browser-retry/logo.svg +4 -0
  54. package/demos/vue/.env.example +11 -0
  55. package/demos/vue/.eslintrc.js +17 -0
  56. package/demos/vue/.postcssrc.js +5 -0
  57. package/demos/vue/README.md +17 -0
  58. package/demos/vue/babel.config.js +3 -0
  59. package/demos/vue/package-lock.json +11323 -0
  60. package/demos/vue/package.json +33 -0
  61. package/demos/vue/public/favicon.ico +0 -0
  62. package/demos/vue/public/index.html +24 -0
  63. package/demos/vue/src/assets/logo.svg +29 -0
  64. package/demos/vue/src/components/App.vue +308 -0
  65. package/demos/vue/src/components/Authenticate.vue +65 -0
  66. package/demos/vue/src/components/Loader.vue +230 -0
  67. package/demos/vue/src/main.js +92 -0
  68. package/docs/FAQ.md +28 -0
  69. package/docs/HISTORY.md +62 -0
  70. package/docs/acetate.config.js +223 -0
  71. package/docs/build-typedoc.js +301 -0
  72. package/docs/src/_layout.html +82 -0
  73. package/docs/src/api/_declaration.html +496 -0
  74. package/docs/src/api/_layout.html +127 -0
  75. package/docs/src/api/_package.html +13 -0
  76. package/docs/src/api/index.html +23 -0
  77. package/docs/src/guides/_layout.html +24 -0
  78. package/docs/src/guides/amd-requirejs-dojo.md +40 -0
  79. package/docs/src/guides/babel-and-rollup.md +30 -0
  80. package/docs/src/guides/babel-and-webpack.md +30 -0
  81. package/docs/src/guides/browser-authentication.md +31 -0
  82. package/docs/src/guides/browserify.md +9 -0
  83. package/docs/src/guides/cli-authentication.md +9 -0
  84. package/docs/src/guides/client-server-authentication.md +9 -0
  85. package/docs/src/guides/from-a-cdn.md +36 -0
  86. package/docs/src/guides/index.md +52 -0
  87. package/docs/src/guides/node.md +70 -0
  88. package/docs/src/guides/package-overview.md +8 -0
  89. package/docs/src/guides/server-authentication.md +9 -0
  90. package/docs/src/guides/typescript-and-webpack.md +9 -0
  91. package/docs/src/img/icons.png +0 -0
  92. package/docs/src/img/icons@2x.png +0 -0
  93. package/docs/src/index.html +12 -0
  94. package/docs/src/js/api-search.js +112 -0
  95. package/docs/src/js/nav-toggle.js +41 -0
  96. package/docs/src/sass/_highlight.scss +96 -0
  97. package/docs/src/sass/_icons.scss +157 -0
  98. package/docs/src/sass/style.scss +169 -0
  99. package/jasmine.json +7 -0
  100. package/karma.conf.js +100 -0
  101. package/lerna.json +8 -0
  102. package/notes/README.md +88 -0
  103. package/package.json +88 -0
  104. package/packages/arcgis-rest-auth/README.md +64 -0
  105. package/packages/arcgis-rest-auth/package-lock.json +11 -0
  106. package/packages/arcgis-rest-auth/package.json +51 -0
  107. package/packages/arcgis-rest-auth/src/ApplicationSession.ts +109 -0
  108. package/packages/arcgis-rest-auth/src/UserSession.ts +873 -0
  109. package/packages/arcgis-rest-auth/src/authenticated-request-options.ts +24 -0
  110. package/packages/arcgis-rest-auth/src/fetch-token.ts +52 -0
  111. package/packages/arcgis-rest-auth/src/generate-token.ts +39 -0
  112. package/packages/arcgis-rest-auth/src/index.ts +8 -0
  113. package/packages/arcgis-rest-auth/test/ApplicationSession.test.ts +124 -0
  114. package/packages/arcgis-rest-auth/test/UserSession.test.ts +995 -0
  115. package/packages/arcgis-rest-auth/test/fetchToken.test.ts +112 -0
  116. package/packages/arcgis-rest-auth/test/generateToken.test.ts +130 -0
  117. package/packages/arcgis-rest-auth/test/utils.ts +14 -0
  118. package/packages/arcgis-rest-auth/tsconfig.json +6 -0
  119. package/packages/arcgis-rest-common-types/README.md +61 -0
  120. package/packages/arcgis-rest-common-types/package.json +38 -0
  121. package/packages/arcgis-rest-common-types/src/group.ts +54 -0
  122. package/packages/arcgis-rest-common-types/src/index.ts +467 -0
  123. package/packages/arcgis-rest-common-types/src/item.ts +45 -0
  124. package/packages/arcgis-rest-common-types/src/webmap.ts +1232 -0
  125. package/packages/arcgis-rest-common-types/tsconfig.json +11 -0
  126. package/packages/arcgis-rest-feature-service/README.md +70 -0
  127. package/packages/arcgis-rest-feature-service/package-lock.json +11 -0
  128. package/packages/arcgis-rest-feature-service/package.json +50 -0
  129. package/packages/arcgis-rest-feature-service/src/add.ts +81 -0
  130. package/packages/arcgis-rest-feature-service/src/addAttachment.ts +65 -0
  131. package/packages/arcgis-rest-feature-service/src/delete.ts +85 -0
  132. package/packages/arcgis-rest-feature-service/src/deleteAttachments.ts +68 -0
  133. package/packages/arcgis-rest-feature-service/src/getAttachments.ts +64 -0
  134. package/packages/arcgis-rest-feature-service/src/helpers.ts +80 -0
  135. package/packages/arcgis-rest-feature-service/src/index.ts +12 -0
  136. package/packages/arcgis-rest-feature-service/src/query.ts +172 -0
  137. package/packages/arcgis-rest-feature-service/src/queryRelated.ts +91 -0
  138. package/packages/arcgis-rest-feature-service/src/update.ts +81 -0
  139. package/packages/arcgis-rest-feature-service/src/updateAttachment.ts +74 -0
  140. package/packages/arcgis-rest-feature-service/test/attachments.test.ts +203 -0
  141. package/packages/arcgis-rest-feature-service/test/features.test.ts +252 -0
  142. package/packages/arcgis-rest-feature-service/test/mocks/feature.ts +279 -0
  143. package/packages/arcgis-rest-feature-service/test/mocks/foo.txt +1 -0
  144. package/packages/arcgis-rest-feature-service/tsconfig.json +6 -0
  145. package/packages/arcgis-rest-feature-service-admin/README.md +66 -0
  146. package/packages/arcgis-rest-feature-service-admin/package-lock.json +11 -0
  147. package/packages/arcgis-rest-feature-service-admin/package.json +53 -0
  148. package/packages/arcgis-rest-feature-service-admin/src/addTo.ts +70 -0
  149. package/packages/arcgis-rest-feature-service-admin/src/create.ts +195 -0
  150. package/packages/arcgis-rest-feature-service-admin/src/index.ts +2 -0
  151. package/packages/arcgis-rest-feature-service-admin/test/addTo.test.ts +310 -0
  152. package/packages/arcgis-rest-feature-service-admin/test/create.test.ts +412 -0
  153. package/packages/arcgis-rest-feature-service-admin/test/mocks/move.ts +14 -0
  154. package/packages/arcgis-rest-feature-service-admin/test/mocks/service.ts +72 -0
  155. package/packages/arcgis-rest-feature-service-admin/tsconfig.json +6 -0
  156. package/packages/arcgis-rest-geocoder/README.md +79 -0
  157. package/packages/arcgis-rest-geocoder/package-lock.json +11 -0
  158. package/packages/arcgis-rest-geocoder/package.json +52 -0
  159. package/packages/arcgis-rest-geocoder/src/bulk.ts +102 -0
  160. package/packages/arcgis-rest-geocoder/src/geocode.ts +117 -0
  161. package/packages/arcgis-rest-geocoder/src/helpers.ts +79 -0
  162. package/packages/arcgis-rest-geocoder/src/index.ts +8 -0
  163. package/packages/arcgis-rest-geocoder/src/reverse.ts +84 -0
  164. package/packages/arcgis-rest-geocoder/src/suggest.ts +72 -0
  165. package/packages/arcgis-rest-geocoder/test/bulk.test.ts +113 -0
  166. package/packages/arcgis-rest-geocoder/test/geocode.test.ts +121 -0
  167. package/packages/arcgis-rest-geocoder/test/helpers.test.ts +113 -0
  168. package/packages/arcgis-rest-geocoder/test/mocks/responses.ts +591 -0
  169. package/packages/arcgis-rest-geocoder/test/reverse.test.ts +126 -0
  170. package/packages/arcgis-rest-geocoder/test/suggest.test.ts +77 -0
  171. package/packages/arcgis-rest-geocoder/tsconfig.json +6 -0
  172. package/packages/arcgis-rest-groups/README.md +64 -0
  173. package/packages/arcgis-rest-groups/package-lock.json +11 -0
  174. package/packages/arcgis-rest-groups/package.json +52 -0
  175. package/packages/arcgis-rest-groups/src/create.ts +34 -0
  176. package/packages/arcgis-rest-groups/src/get.ts +95 -0
  177. package/packages/arcgis-rest-groups/src/helpers.ts +26 -0
  178. package/packages/arcgis-rest-groups/src/index.ts +11 -0
  179. package/packages/arcgis-rest-groups/src/notification.ts +77 -0
  180. package/packages/arcgis-rest-groups/src/protect.ts +40 -0
  181. package/packages/arcgis-rest-groups/src/remove.ts +23 -0
  182. package/packages/arcgis-rest-groups/src/search.ts +64 -0
  183. package/packages/arcgis-rest-groups/src/update.ts +36 -0
  184. package/packages/arcgis-rest-groups/test/crud.test.ts +104 -0
  185. package/packages/arcgis-rest-groups/test/get.test.ts +101 -0
  186. package/packages/arcgis-rest-groups/test/mocks/responses.ts +141 -0
  187. package/packages/arcgis-rest-groups/test/notification.test.ts +102 -0
  188. package/packages/arcgis-rest-groups/test/protect.test.ts +64 -0
  189. package/packages/arcgis-rest-groups/test/search.test.ts +85 -0
  190. package/packages/arcgis-rest-groups/tsconfig.json +6 -0
  191. package/packages/arcgis-rest-items/README.md +66 -0
  192. package/packages/arcgis-rest-items/package-lock.json +11 -0
  193. package/packages/arcgis-rest-items/package.json +52 -0
  194. package/packages/arcgis-rest-items/src/add.ts +103 -0
  195. package/packages/arcgis-rest-items/src/create.ts +110 -0
  196. package/packages/arcgis-rest-items/src/get.ts +79 -0
  197. package/packages/arcgis-rest-items/src/helpers.ts +147 -0
  198. package/packages/arcgis-rest-items/src/index.ts +11 -0
  199. package/packages/arcgis-rest-items/src/protect.ts +38 -0
  200. package/packages/arcgis-rest-items/src/remove.ts +58 -0
  201. package/packages/arcgis-rest-items/src/search.ts +78 -0
  202. package/packages/arcgis-rest-items/src/update.ts +134 -0
  203. package/packages/arcgis-rest-items/test/add.test.ts +256 -0
  204. package/packages/arcgis-rest-items/test/create.test.ts +371 -0
  205. package/packages/arcgis-rest-items/test/get.test.ts +181 -0
  206. package/packages/arcgis-rest-items/test/mocks/foo.zip +0 -0
  207. package/packages/arcgis-rest-items/test/mocks/item.ts +33 -0
  208. package/packages/arcgis-rest-items/test/mocks/resources.ts +31 -0
  209. package/packages/arcgis-rest-items/test/mocks/search.ts +63 -0
  210. package/packages/arcgis-rest-items/test/protect.test.ts +122 -0
  211. package/packages/arcgis-rest-items/test/remove.test.ts +161 -0
  212. package/packages/arcgis-rest-items/test/search.test.ts +159 -0
  213. package/packages/arcgis-rest-items/test/update.test.ts +450 -0
  214. package/packages/arcgis-rest-items/tsconfig.json +6 -0
  215. package/packages/arcgis-rest-request/README.md +65 -0
  216. package/packages/arcgis-rest-request/package-lock.json +11 -0
  217. package/packages/arcgis-rest-request/package.json +42 -0
  218. package/packages/arcgis-rest-request/src/index.ts +13 -0
  219. package/packages/arcgis-rest-request/src/request.ts +293 -0
  220. package/packages/arcgis-rest-request/src/utils/ArcGISAuthError.ts +67 -0
  221. package/packages/arcgis-rest-request/src/utils/ArcGISRequestError.ts +76 -0
  222. package/packages/arcgis-rest-request/src/utils/ErrorTypes.ts +29 -0
  223. package/packages/arcgis-rest-request/src/utils/check-for-errors.ts +65 -0
  224. package/packages/arcgis-rest-request/src/utils/encode-form-data.ts +34 -0
  225. package/packages/arcgis-rest-request/src/utils/encode-query-string.ts +23 -0
  226. package/packages/arcgis-rest-request/src/utils/get-portal-url.ts +25 -0
  227. package/packages/arcgis-rest-request/src/utils/get-portal.ts +45 -0
  228. package/packages/arcgis-rest-request/src/utils/process-params.ts +99 -0
  229. package/packages/arcgis-rest-request/test/mocks/errors.ts +68 -0
  230. package/packages/arcgis-rest-request/test/mocks/geojson-feature-collection.ts +13 -0
  231. package/packages/arcgis-rest-request/test/mocks/portal.ts +112 -0
  232. package/packages/arcgis-rest-request/test/mocks/sharing-rest-info.ts +41 -0
  233. package/packages/arcgis-rest-request/test/mocks/webmap.ts +41 -0
  234. package/packages/arcgis-rest-request/test/request.test.ts +299 -0
  235. package/packages/arcgis-rest-request/test/utils/ArcGISAuthError.test.ts +170 -0
  236. package/packages/arcgis-rest-request/test/utils/ArcGISRequestError.test.ts +51 -0
  237. package/packages/arcgis-rest-request/test/utils/check-for-errors.test.ts +111 -0
  238. package/packages/arcgis-rest-request/test/utils/encode-form-data.test.ts +133 -0
  239. package/packages/arcgis-rest-request/test/utils/get-portal-url.test.ts +37 -0
  240. package/packages/arcgis-rest-request/test/utils/portal.test.ts +97 -0
  241. package/packages/arcgis-rest-request/test/utils/process-params.test.ts +193 -0
  242. package/packages/arcgis-rest-request/tsconfig.json +6 -0
  243. package/packages/arcgis-rest-sharing/README.md +67 -0
  244. package/packages/arcgis-rest-sharing/package-lock.json +11 -0
  245. package/packages/arcgis-rest-sharing/package.json +57 -0
  246. package/packages/arcgis-rest-sharing/src/access.ts +85 -0
  247. package/packages/arcgis-rest-sharing/src/group-sharing.ts +211 -0
  248. package/packages/arcgis-rest-sharing/src/helpers.ts +82 -0
  249. package/packages/arcgis-rest-sharing/src/index.ts +5 -0
  250. package/packages/arcgis-rest-sharing/test/access.test.ts +154 -0
  251. package/packages/arcgis-rest-sharing/test/group-sharing.test.ts +566 -0
  252. package/packages/arcgis-rest-sharing/test/helpers.test.ts +55 -0
  253. package/packages/arcgis-rest-sharing/test/mocks/sharing.ts +18 -0
  254. package/packages/arcgis-rest-sharing/tsconfig.json +6 -0
  255. package/packages/arcgis-rest-users/README.md +71 -0
  256. package/packages/arcgis-rest-users/package-lock.json +11 -0
  257. package/packages/arcgis-rest-users/package.json +51 -0
  258. package/packages/arcgis-rest-users/src/get.ts +69 -0
  259. package/packages/arcgis-rest-users/src/index.ts +6 -0
  260. package/packages/arcgis-rest-users/src/invitation.ts +166 -0
  261. package/packages/arcgis-rest-users/src/notification.ts +73 -0
  262. package/packages/arcgis-rest-users/test/get.test.ts +99 -0
  263. package/packages/arcgis-rest-users/test/invitation.test.ts +169 -0
  264. package/packages/arcgis-rest-users/test/mocks/invitation.ts +70 -0
  265. package/packages/arcgis-rest-users/test/mocks/notification.ts +34 -0
  266. package/packages/arcgis-rest-users/test/mocks/user.ts +173 -0
  267. package/packages/arcgis-rest-users/test/notification.test.ts +83 -0
  268. package/packages/arcgis-rest-users/tsconfig.json +6 -0
  269. package/support/changelog.js +394 -0
  270. package/support/deploy-doc-site.js +16 -0
  271. package/support/publish.sh +43 -0
  272. package/support/test-helpers.js +8 -0
  273. package/tsconfig.json +69 -0
  274. package/tslint.json +15 -0
  275. package/umd-base-profile.js +82 -0
  276. 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 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,31 @@
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
10
+
11
+ In the [Node.js](../node/) guide we explained how to instantiate an [`ApplicationSession`](/arcgis-rest-js/api/auth/ApplicationSession/) with hardcoded credentials. In the browser, you need to use [OAuth 2.0](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/signing-in-arcgis-online-users/) and have users can sign directly into [ArcGIS Online](https://www.arcgis.com) or ArcGIS Enterprise.
12
+
13
+ ![browser based login](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/images/authorization-screen.png)
14
+
15
+ ```js
16
+ // register your own app to create a unique clientId
17
+ const clientId = "abc123"
18
+
19
+ UserSession.beginOAuth2({
20
+ clientId,
21
+ redirectUri: 'https://yourapp.com/authenticate.html'
22
+ })
23
+ .then(session)
24
+ ```
25
+
26
+ After they've signed in the `session` will keep track of individual `trustedServers` that are known to be federated and pass tokens through automatically.
27
+
28
+ ### Demos
29
+
30
+ * [OAuth 2.0 Browser](https://github.com/Esri/arcgis-rest-js/tree/master/demos/oauth2-browser)
31
+ * [Retrying Requests](https://github.com/Esri/arcgis-rest-js/tree/master/demos/oauth2-browser-retry)
@@ -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,70 @@
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")
26
+ .then(response);
27
+ ```
28
+ Demo - [Express Application](https://github.com/Esri/arcgis-rest-js/tree/master/demos/express)
29
+
30
+ ## Authentication
31
+
32
+ To access premium content and services without asking for user credentials, using a [Proxy Service](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/working-with-proxies/) or [App Login](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/) is typically the best approach.
33
+
34
+ Proxy Service
35
+ ```js
36
+ // no auth required
37
+ request(`https://utility.arcgis.com/usrsvcs/appservices/{unique}/rest/services/World/Route/NAServer/Route_World/solve`)
38
+ ```
39
+ App Login
40
+ ```js
41
+ const authentication = new ApplicationSession({
42
+ clientId: "public",
43
+ clientSecret: "secret"
44
+ })
45
+
46
+ // url not accessible to anonymous users
47
+ const url = `https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World`
48
+
49
+ // token will be appended by rest-js
50
+ request(url, {
51
+ authentication
52
+ })
53
+ ```
54
+
55
+ Demo - [batch geocoding](https://github.com/Esri/arcgis-rest-js/tree/master/demos/batch-geocoder-node)
56
+
57
+ Applications cannot [create, update, share, modify of delete items](https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/limitations-of-application-authentication/) in ArcGIS Online or ArcGIS Enterprise. For this, a [`UserSession`](/arcgis-rest-js/api/auth/UserSession/) is more appropriate.
58
+
59
+ ```js
60
+ // hardcoded username / password
61
+ const authentication = new UserSession({
62
+ username: "jsmith",
63
+ password: "123456"
64
+ })
65
+ ```
66
+ See the [Browser Authenication](../browser-authentication/) for more information about implementing OAuth 2.0.
67
+
68
+
69
+
70
+
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Package Overview
3
+ description: Overview of packages provided by ArcGIS REST JS.
4
+ order: 10
5
+ group: 0-introduction
6
+ ---
7
+
8
+ # Package Overview
@@ -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 "./guides/", "Get Started", class="btn btn-large btn-clear-white" %}
8
+ {% link "./api/", "API Reference", class="btn btn-large btn-clear-white" %}
9
+ </div>
10
+ </div>
11
+ </header>
12
+ </div>
@@ -0,0 +1,112 @@
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
+ methods: {
35
+ highlightText: function(text, matches) {
36
+ return matches
37
+ .map(match => {
38
+ let characters = text.split("");
39
+
40
+ for (let i = match.indices.length - 1; i >= 0; i--) {
41
+ let start = match.indices[i][0];
42
+ let end = match.indices[i][1] + 1;
43
+ let foundMatch = characters.slice(start, end).join("");
44
+ characters.splice(
45
+ start,
46
+ end - start,
47
+ `<span style="text-decoration: underline; font-weight: 500;">${foundMatch}</span>`
48
+ );
49
+ }
50
+
51
+ return characters.join("");
52
+ })
53
+ .join();
54
+ },
55
+ onSubmit: function() {
56
+ if (this.results.length && this.results[this.selectedResultIndex]) {
57
+ window.location.href = this.results[this.selectedResultIndex].url;
58
+ }
59
+ },
60
+
61
+ search: function(text) {
62
+ return this.index.search(text).map(result => {
63
+ return {
64
+ title: this.highlightText(result.item.title, result.matches),
65
+ icon: result.item.icon,
66
+ url: result.item.url
67
+ };
68
+ });
69
+ },
70
+
71
+ onChange: function(e) {
72
+ this.results = this.search(e.target.value);
73
+
74
+ if (e.keyCode === 38 || e.keyCode === 40) {
75
+ e.preventDefault();
76
+ e.stopPropagation();
77
+ }
78
+ },
79
+
80
+ onSelectNext: function(e) {
81
+ this.selectedResultIndex =
82
+ this.selectedResultIndex === this.results.length - 1
83
+ ? 0
84
+ : this.selectedResultIndex + 1;
85
+ e.preventDefault();
86
+ e.stopPropagation();
87
+ },
88
+
89
+ onSelectPrevious: function(e) {
90
+ this.selectedResultIndex =
91
+ this.selectedResultIndex === 0
92
+ ? this.results.length - 1
93
+ : this.selectedResultIndex - 1;
94
+
95
+ e.preventDefault();
96
+ e.stopPropagation();
97
+ }
98
+ },
99
+ created: function() {
100
+ this.index = new Fuse(ESRI_REST_API_REF_INDEX, {
101
+ shouldSort: true,
102
+ threshold: 0.25,
103
+ location: 0,
104
+ distance: 200,
105
+ maxPatternLength: 32,
106
+ minMatchCharLength: 2,
107
+ findAllMatches: true,
108
+ includeMatches: true,
109
+ keys: ["title"]
110
+ });
111
+ }
112
+ });
@@ -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
+ }