@esri/arcgis-rest-demographics 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +74 -0
  2. package/dist/bundled/demographics.esm.js +232 -0
  3. package/dist/bundled/demographics.esm.js.map +1 -0
  4. package/dist/bundled/demographics.esm.min.js +7 -0
  5. package/dist/bundled/demographics.esm.min.js.map +1 -0
  6. package/dist/bundled/demographics.umd.js +244 -0
  7. package/dist/bundled/demographics.umd.js.map +1 -0
  8. package/dist/bundled/demographics.umd.min.js +7 -0
  9. package/dist/bundled/demographics.umd.min.js.map +1 -0
  10. package/dist/cjs/getAvailableCountries.js +41 -0
  11. package/dist/cjs/getAvailableCountries.js.map +1 -0
  12. package/dist/cjs/getAvailableDataCollections.js +56 -0
  13. package/dist/cjs/getAvailableDataCollections.js.map +1 -0
  14. package/dist/cjs/getAvailableGeographyLevels.js +40 -0
  15. package/dist/cjs/getAvailableGeographyLevels.js.map +1 -0
  16. package/dist/cjs/getGeography.js +60 -0
  17. package/dist/cjs/getGeography.js.map +1 -0
  18. package/dist/cjs/helpers.js +9 -0
  19. package/dist/cjs/helpers.js.map +1 -0
  20. package/dist/cjs/index.js +11 -0
  21. package/dist/cjs/index.js.map +1 -0
  22. package/dist/cjs/queryDemographicData.js +50 -0
  23. package/dist/cjs/queryDemographicData.js.map +1 -0
  24. package/dist/esm/getAvailableCountries.d.ts +72 -0
  25. package/dist/esm/getAvailableCountries.js +37 -0
  26. package/dist/esm/getAvailableCountries.js.map +1 -0
  27. package/dist/esm/getAvailableDataCollections.d.ts +110 -0
  28. package/dist/esm/getAvailableDataCollections.js +52 -0
  29. package/dist/esm/getAvailableDataCollections.js.map +1 -0
  30. package/dist/esm/getAvailableGeographyLevels.d.ts +52 -0
  31. package/dist/esm/getAvailableGeographyLevels.js +36 -0
  32. package/dist/esm/getAvailableGeographyLevels.js.map +1 -0
  33. package/dist/esm/getGeography.d.ts +88 -0
  34. package/dist/esm/getGeography.js +56 -0
  35. package/dist/esm/getGeography.js.map +1 -0
  36. package/dist/esm/helpers.d.ts +17 -0
  37. package/dist/esm/helpers.js +6 -0
  38. package/dist/esm/helpers.js.map +1 -0
  39. package/dist/esm/index.d.ts +6 -0
  40. package/dist/esm/index.js +8 -0
  41. package/dist/esm/index.js.map +1 -0
  42. package/dist/esm/queryDemographicData.d.ts +52 -0
  43. package/dist/esm/queryDemographicData.js +46 -0
  44. package/dist/esm/queryDemographicData.js.map +1 -0
  45. package/package.json +69 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGeography.js","sourceRoot":"","sources":["../../src/getGeography.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,OAAO,EACL,OAAO,EACP,QAAQ,EACR,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,0CAA0C,EAG3C,MAAM,cAAc,CAAC;AA0EtB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAC1B,cAAqC;IAErC,MAAM,QAAQ,GAAG,GACf,cAAc,CAAC,QAAQ,IAAI,0CAC7B,UAAU,CAAC;IAEX,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd;QACE,eAAe;QACf,wBAAwB;QACxB,iBAAiB;QACjB,cAAc;QACd,gBAAgB;QAChB,yBAAyB;QACzB,mBAAmB;QACnB,mBAAmB;QACnB,OAAO;QACP,gBAAgB;QAChB,iBAAiB;QACjB,qBAAqB;QACrB,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,UAAU;KACX,EACD,EAAE,MAAM,oBAAO,cAAc,CAAC,MAAM,CAAE,EAAE,CACzC,CAAC;IAEF,uDAAuD;IACvD,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;QAClC,OAAO,OAAO,CAAC,MAAM,CACnB,gEAAgE,CACjE,CAAC;KACH;IAED,qDAAqD;IACrD,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QACxD,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;SACvE;IACH,CAAC,CAAC,CAAC;IAEH,sDAAsD;IACtD,OAAO,OAAO,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,QAAa,EAAE,EAAE;QACtE,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport {\n request,\n cleanUrl,\n appendCustomParams\n} from \"@esri/arcgis-rest-request\";\n\nimport {\n ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL,\n IGeoenrichmentResult,\n IEndpointOptions\n} from \"./helpers.js\";\n\nexport interface IGetGeographyOptions extends IEndpointOptions {\n /**\n * Specify the source country for the search.\n */\n sourceCountry?: string;\n /**\n * Specify a specific dataset within a defined country.\n */\n optionalCountryDataset?: string;\n /**\n * Specify which standard geography layers are being queried or searched.\n */\n geographyLayers?: string[] | string;\n /**\n * Specify which IDs for the standard geography layers are being queried or searched.\n */\n geographyIDs?: string[];\n /**\n * Specify the text to query and search the standard geography layers specified.\n */\n geographyQuery?: string;\n /**\n * Return all the subgeographic areas that are within a parent geography.\n */\n returnSubGeographyLayer?: boolean;\n /**\n * Return all the subgeographic areas that are within a parent geography.\n */\n subGeographyLayer?: string;\n /**\n * Filter the results of the subgeography features that are returned by a search term.\n */\n subGeographyQuery?: string;\n /**\n * Request the output geometries in a specified spatial reference system.\n */\n outSR?: number;\n /**\n * Request the output geometries in the response.\n */\n returnGeometry?: boolean;\n /**\n * Request the output geometry to return the center point for each feature.\n */\n returnCentroids?: boolean;\n /**\n * Integer that specifies the level of generalization or detail in the area representations of the administrative boundary or standard geographic data layers.\n */\n generalizationLevel?: number;\n /**\n * Define if text provided in the geographyQuery parameter should utilize fuzzy search logic.\n */\n useFuzzySearch?: boolean;\n /**\n * Limits the number of features that are returned from the geographyQuery parameter.\n */\n featureLimit?: number;\n /**\n * Starts the results on the number of the records specified.\n */\n featureOffset?: number;\n /**\n * Specifies the language you wish to receive your GeoEnrichment results.\n */\n langCode?: string;\n}\n\nexport interface IGetGeographyResponse {\n results: IGeoenrichmentResult[] | null;\n messages: string[] | null;\n}\n\n/**\n * ```js\n * import { getGeography } from '@esri/arcgis-rest-demographics';\n * //\n * getGeography({\n * sourceCountry: \"CA\",\n * geographyIDs: [\"35\"]\n * })\n * .then((response) => {\n * response.; // => { results: [ ... ] }\n * });\n * ```\n * Used to get standard geography IDs and features for the supported geographic levels. See the [REST Documentation](https://developers.arcgis.com/rest/geoenrichment/api-reference/standard-geography-query.htm) and the [best practices post](https://www.esri.com/arcgis-blog/products/arcgis-online/uncategorized/best-practices-how-to-query-standard-geographies-branches) for more information.\n * @param requestOptions Options to pass through to the service. All properties are optional, but either `geographyIds` or `geographyQuery` must be sent at a minimum.\n * @returns A Promise that will resolve with return data defined and optionally geometry for the feature.\n */\nexport function getGeography(\n requestOptions?: IGetGeographyOptions\n): Promise<IGetGeographyResponse> {\n const endpoint = `${\n requestOptions.endpoint || ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL\n }/execute`;\n\n const options = appendCustomParams<IGetGeographyOptions>(\n requestOptions,\n [\n \"sourceCountry\",\n \"optionalCountryDataset\",\n \"geographyLayers\",\n \"geographyIDs\",\n \"geographyQuery\",\n \"returnSubGeographyLayer\",\n \"subGeographyLayer\",\n \"subGeographyQuery\",\n \"outSR\",\n \"returnGeometry\",\n \"returnCentroids\",\n \"generalizationLevel\",\n \"useFuzzySearch\",\n \"featureLimit\",\n \"featureOffset\",\n \"langCode\"\n ],\n { params: { ...requestOptions.params } }\n );\n\n // the SAAS service does not support anonymous requests\n if (!requestOptions.authentication) {\n return Promise.reject(\n \"Geoenrichment using the ArcGIS service requires authentication\"\n );\n }\n\n // These parameters are passed as JSON-style strings:\n [\"geographyLayers\", \"geographyIDs\"].forEach((parameter) => {\n if (options.params[parameter]) {\n options.params[parameter] = JSON.stringify(options.params[parameter]);\n }\n });\n\n // add spatialReference property to individual matches\n return request(`${cleanUrl(endpoint)}`, options).then((response: any) => {\n return response;\n });\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { IRequestOptions, IFeatureSet } from "@esri/arcgis-rest-request";
2
+ export declare const ARCGIS_ONLINE_GEOENRICHMENT_URL: string;
3
+ export declare const ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL: string;
4
+ export interface IEndpointOptions extends IRequestOptions {
5
+ /**
6
+ * Any ArcGIS Geoenrichment service (example: https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment )
7
+ */
8
+ endpoint?: string;
9
+ }
10
+ export interface IGeoenrichmentResult {
11
+ paramName: string;
12
+ dataType: string;
13
+ value: {
14
+ version: string;
15
+ FeatureSet: IFeatureSet[];
16
+ };
17
+ }
@@ -0,0 +1,6 @@
1
+ /* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
2
+ * Apache-2.0 */
3
+ const ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL = "https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver";
4
+ export const ARCGIS_ONLINE_GEOENRICHMENT_URL = `${ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL}/Geoenrichment`;
5
+ export const ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL = `${ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL}/StandardGeographyQuery`;
6
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA;gBACgB;AAOhB,MAAM,qCAAqC,GAAG,6EAA6E,CAAA;AAC3H,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,qCAAqC,gBAAgB,CAAC;AACxG,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAG,qCAAqC,yBAAyB,CAAC","sourcesContent":["/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport {\n IRequestOptions,\n IFeatureSet\n} from \"@esri/arcgis-rest-request\";\n\nconst ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL = \"https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver\"\nexport const ARCGIS_ONLINE_GEOENRICHMENT_URL = `${ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL}/Geoenrichment`;\nexport const ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL = `${ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL}/StandardGeographyQuery`;\n\nexport interface IEndpointOptions extends IRequestOptions {\n /**\n * Any ArcGIS Geoenrichment service (example: https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver/Geoenrichment )\n */\n endpoint?: string;\n}\n\nexport interface IGeoenrichmentResult {\n paramName: string;\n dataType: string;\n value: {\n version: string;\n FeatureSet: IFeatureSet[];\n };\n}"]}
@@ -0,0 +1,6 @@
1
+ export * from "./getAvailableCountries.js";
2
+ export * from "./getAvailableDataCollections.js";
3
+ export * from "./getAvailableGeographyLevels.js";
4
+ export * from "./getGeography.js";
5
+ export * from "./queryDemographicData.js";
6
+ export type { IRequestOptions, IFeatureSet, IExtent } from "@esri/arcgis-rest-request";
@@ -0,0 +1,8 @@
1
+ /* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
2
+ * Apache-2.0 */
3
+ export * from "./getAvailableCountries.js";
4
+ export * from "./getAvailableDataCollections.js";
5
+ export * from "./getAvailableGeographyLevels.js";
6
+ export * from "./getGeography.js";
7
+ export * from "./queryDemographicData.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC","sourcesContent":["/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nexport * from \"./getAvailableCountries.js\";\nexport * from \"./getAvailableDataCollections.js\";\nexport * from \"./getAvailableGeographyLevels.js\";\nexport * from \"./getGeography.js\";\nexport * from \"./queryDemographicData.js\";\n\n// Types that are used in this package are re-exported for convenience and \n// to make the links work correctly in the documentation pages.\nexport type {\n IRequestOptions,\n IFeatureSet,\n IExtent\n} from \"@esri/arcgis-rest-request\";\n"]}
@@ -0,0 +1,52 @@
1
+ import { IGeoenrichmentResult, IEndpointOptions } from "./helpers.js";
2
+ export interface IQueryDemographicDataOptions extends IEndpointOptions {
3
+ /**
4
+ * Defines the area on a map which is being analyzed
5
+ */
6
+ studyAreas: any[];
7
+ /**
8
+ * A Data Collection is a preassembled list of attributes that will be used to enrich the input features. Enrichment attributes can describe various types of information such as demographic characteristics and geographic context of the locations or areas submitted as input features in studyAreas.
9
+ */
10
+ dataCollections?: string[];
11
+ /**
12
+ * Specify a subset of variables to be returned from one or more Data Collections
13
+ */
14
+ analysisVariables?: string[];
15
+ /**
16
+ * Specify an array of string values that describe what derivative variables to include in the output
17
+ */
18
+ addDerivativeVariables?: boolean;
19
+ /**
20
+ * Request the output geometries in the response
21
+ */
22
+ returnGeometry?: boolean;
23
+ /**
24
+ * Define the input geometries in the studyAreas parameter in a specified spatial reference system
25
+ */
26
+ inSR?: number;
27
+ /**
28
+ * Request the output geometries in a specified spatial reference system
29
+ */
30
+ outSR?: number;
31
+ }
32
+ export interface IQueryDemographicDataResponse {
33
+ results: IGeoenrichmentResult[] | null;
34
+ messages: string[] | null;
35
+ }
36
+ /**
37
+ * ```js
38
+ * import { queryDemographicData } from '@esri/arcgis-rest-demographics';
39
+ * //
40
+ * queryDemographicData({
41
+ * studyAreas: [{"geometry":{"x":-117.1956,"y":34.0572}}],
42
+ * authentication
43
+ * })
44
+ * .then((response) => {
45
+ * response; // => { results: [ ... ] }
46
+ * });
47
+ * ```
48
+ * Used to get facts about a location or area. See the [REST Documentation](https://developers.arcgis.com/rest/geoenrichment/api-reference/enrich.htm) for more information.
49
+ * @param requestOptions Options to pass through to the service.
50
+ * @returns A Promise that will resolve with results for the request.
51
+ */
52
+ export declare function queryDemographicData(requestOptions?: IQueryDemographicDataOptions): Promise<IQueryDemographicDataResponse>;
@@ -0,0 +1,46 @@
1
+ /* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
2
+ * Apache-2.0 */
3
+ import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
4
+ import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers.js";
5
+ /**
6
+ * ```js
7
+ * import { queryDemographicData } from '@esri/arcgis-rest-demographics';
8
+ * //
9
+ * queryDemographicData({
10
+ * studyAreas: [{"geometry":{"x":-117.1956,"y":34.0572}}],
11
+ * authentication
12
+ * })
13
+ * .then((response) => {
14
+ * response; // => { results: [ ... ] }
15
+ * });
16
+ * ```
17
+ * Used to get facts about a location or area. See the [REST Documentation](https://developers.arcgis.com/rest/geoenrichment/api-reference/enrich.htm) for more information.
18
+ * @param requestOptions Options to pass through to the service.
19
+ * @returns A Promise that will resolve with results for the request.
20
+ */
21
+ export function queryDemographicData(requestOptions) {
22
+ const options = appendCustomParams(requestOptions, [
23
+ "studyAreas",
24
+ "dataCollections",
25
+ "analysisVariables",
26
+ "addDerivativeVariables",
27
+ "returnGeometry",
28
+ "inSR",
29
+ "outSR"
30
+ ], { params: Object.assign({}, requestOptions.params) });
31
+ // the SAAS service does not support anonymous requests
32
+ if (!requestOptions.authentication) {
33
+ return Promise.reject("Geoenrichment using the ArcGIS service requires authentication");
34
+ }
35
+ // These parameters are passed as JSON-style strings:
36
+ ["dataCollections", "analysisVariables"].forEach((parameter) => {
37
+ if (options.params[parameter]) {
38
+ options.params[parameter] = JSON.stringify(options.params[parameter]);
39
+ }
40
+ });
41
+ // add spatialReference property to individual matches
42
+ return request(`${cleanUrl(`${requestOptions.endpoint || ARCGIS_ONLINE_GEOENRICHMENT_URL}/enrich`)}`, options).then((response) => {
43
+ return response;
44
+ });
45
+ }
46
+ //# sourceMappingURL=queryDemographicData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryDemographicData.js","sourceRoot":"","sources":["../../src/queryDemographicData.ts"],"names":[],"mappings":"AAAA;gBACgB;AAEhB,OAAO,EACL,OAAO,EACP,QAAQ,EACR,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,+BAA+B,EAGhC,MAAM,cAAc,CAAC;AAsCtB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAClC,cAA6C;IAE7C,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd;QACE,YAAY;QACZ,iBAAiB;QACjB,mBAAmB;QACnB,wBAAwB;QACxB,gBAAgB;QAChB,MAAM;QACN,OAAO;KACR,EACD,EAAE,MAAM,oBAAO,cAAc,CAAC,MAAM,CAAE,EAAE,CACzC,CAAC;IAEF,uDAAuD;IACvD,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;QAClC,OAAO,OAAO,CAAC,MAAM,CACnB,gEAAgE,CACjE,CAAC;KACH;IAED,qDAAqD;IACrD,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QAC7D,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;SACvE;IACH,CAAC,CAAC,CAAC;IAEH,sDAAsD;IACtD,OAAO,OAAO,CACZ,GAAG,QAAQ,CACT,GAAG,cAAc,CAAC,QAAQ,IAAI,+BAA+B,SAAS,CACvE,EAAE,EACH,OAAO,CACR,CAAC,IAAI,CAAC,CAAC,QAAa,EAAE,EAAE;QACvB,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\n\nimport {\n request,\n cleanUrl,\n appendCustomParams\n} from \"@esri/arcgis-rest-request\";\n\nimport {\n ARCGIS_ONLINE_GEOENRICHMENT_URL,\n IGeoenrichmentResult,\n IEndpointOptions\n} from \"./helpers.js\";\n\nexport interface IQueryDemographicDataOptions extends IEndpointOptions {\n /**\n * Defines the area on a map which is being analyzed\n */\n studyAreas: any[];\n /**\n * A Data Collection is a preassembled list of attributes that will be used to enrich the input features. Enrichment attributes can describe various types of information such as demographic characteristics and geographic context of the locations or areas submitted as input features in studyAreas.\n */\n dataCollections?: string[];\n /**\n * Specify a subset of variables to be returned from one or more Data Collections\n */\n analysisVariables?: string[];\n /**\n * Specify an array of string values that describe what derivative variables to include in the output\n */\n addDerivativeVariables?: boolean;\n /**\n * Request the output geometries in the response\n */\n returnGeometry?: boolean;\n /**\n * Define the input geometries in the studyAreas parameter in a specified spatial reference system\n */\n inSR?: number;\n /**\n * Request the output geometries in a specified spatial reference system\n */\n outSR?: number;\n}\n\nexport interface IQueryDemographicDataResponse {\n results: IGeoenrichmentResult[] | null;\n messages: string[] | null;\n}\n\n/**\n * ```js\n * import { queryDemographicData } from '@esri/arcgis-rest-demographics';\n * //\n * queryDemographicData({\n * studyAreas: [{\"geometry\":{\"x\":-117.1956,\"y\":34.0572}}],\n * authentication\n * })\n * .then((response) => {\n * response; // => { results: [ ... ] }\n * });\n * ```\n * Used to get facts about a location or area. See the [REST Documentation](https://developers.arcgis.com/rest/geoenrichment/api-reference/enrich.htm) for more information.\n * @param requestOptions Options to pass through to the service.\n * @returns A Promise that will resolve with results for the request.\n */\nexport function queryDemographicData(\n requestOptions?: IQueryDemographicDataOptions\n): Promise<IQueryDemographicDataResponse> {\n const options = appendCustomParams<IQueryDemographicDataOptions>(\n requestOptions,\n [\n \"studyAreas\",\n \"dataCollections\",\n \"analysisVariables\",\n \"addDerivativeVariables\",\n \"returnGeometry\",\n \"inSR\",\n \"outSR\"\n ],\n { params: { ...requestOptions.params } }\n );\n\n // the SAAS service does not support anonymous requests\n if (!requestOptions.authentication) {\n return Promise.reject(\n \"Geoenrichment using the ArcGIS service requires authentication\"\n );\n }\n\n // These parameters are passed as JSON-style strings:\n [\"dataCollections\", \"analysisVariables\"].forEach((parameter) => {\n if (options.params[parameter]) {\n options.params[parameter] = JSON.stringify(options.params[parameter]);\n }\n });\n\n // add spatialReference property to individual matches\n return request(\n `${cleanUrl(\n `${requestOptions.endpoint || ARCGIS_ONLINE_GEOENRICHMENT_URL}/enrich`\n )}`,\n options\n ).then((response: any) => {\n return response;\n });\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@esri/arcgis-rest-demographics",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "Demographics data helpers for @esri/arcgis-rest-js",
5
+ "license": "Apache-2.0",
6
+ "keywords": [
7
+ "ES6",
8
+ "arcgis",
9
+ "esri",
10
+ "fetch",
11
+ "promise",
12
+ "typescript"
13
+ ],
14
+ "type": "module",
15
+ "main": "dist/cjs/index.js",
16
+ "module": "dist/esm/index.js",
17
+ "unpkg": "dist/bundled/demographics.umd.min.js",
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/esm/index.js",
21
+ "require": "./dist/cjs/index.js"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "types": "dist/esm/index.d.ts",
26
+ "sideEffects": false,
27
+ "files": [
28
+ "dist/**"
29
+ ],
30
+ "scripts": {
31
+ "build": "npm-run-all --parallel build:*",
32
+ "postbuild": "node ../../scripts/create-dist-package-jsons.js",
33
+ "build:bundled": "rollup -c ../../rollup.js",
34
+ "build:cjs": "tsc --outDir ./dist/cjs -m commonjs",
35
+ "build:esm": "tsc --outDir ./dist/esm --declaration",
36
+ "dev": "npm-run-all --parallel dev:*",
37
+ "dev:bundled": "rollup -w -c ../../rollup.js",
38
+ "dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs",
39
+ "dev:esm": "tsc -w --outDir ./dist/esm --declaration"
40
+ },
41
+ "engines": {
42
+ "node": ">=12.20.0"
43
+ },
44
+ "dependencies": {
45
+ "tslib": "^2.3.0"
46
+ },
47
+ "peerDependencies": {
48
+ "@esri/arcgis-rest-request": "1.0.0-beta.1"
49
+ },
50
+ "devDependencies": {
51
+ "@esri/arcgis-rest-request": "1.0.0-beta.1"
52
+ },
53
+ "contributors": [
54
+ "Gavin Rehkemper <grehkemper@esri.com> (http://gavinr.com/)",
55
+ "Patrick Arlt <parlt@esri.com> (http://patrickarlt.com/)"
56
+ ],
57
+ "homepage": "https://github.com/Esri/arcgis-rest-js#readme",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/Esri/arcgis-rest-js.git",
61
+ "directory": "packages/arcgis-rest-demographics"
62
+ },
63
+ "bugs": {
64
+ "url": "https://github.com/Esri/arcgis-rest-js/issues"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ }
69
+ }