Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@esri/arcgis-rest-demographics

Package Overview
Dependencies
Maintainers
45
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esri/arcgis-rest-demographics - npm Package Compare versions

Comparing version 3.4.3 to 4.0.0-beta.2

dist/bundled/demographics.esm.js

6

dist/esm/getAvailableCountries.d.ts

@@ -1,3 +0,3 @@

import { IEnvelope } from "@esri/arcgis-rest-types";
import { IEndpointOptions } from "./helpers";
import { IExtent } from "@esri/arcgis-rest-request";
import { IEndpointOptions } from "./helpers.js";
export interface IGetAvailableCountriesOptions extends IEndpointOptions {

@@ -22,3 +22,3 @@ /**

esriUnits: string;
defaultExtent: IEnvelope;
defaultExtent: IExtent;
defaultDatasetID: string;

@@ -25,0 +25,0 @@ datasets?: string[];

/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import { __assign } from "tslib";
import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers.js";
/**

@@ -20,4 +19,4 @@ * ```js

export function getAvailableCountries(requestOptions) {
var options = {};
var endpoint = ARCGIS_ONLINE_GEOENRICHMENT_URL + "/countries";
let options = {};
let endpoint = `${ARCGIS_ONLINE_GEOENRICHMENT_URL}/countries`;
if (!requestOptions) {

@@ -28,10 +27,10 @@ options.params = {};

if (requestOptions.endpoint) {
endpoint = requestOptions.endpoint + "/countries";
endpoint = `${requestOptions.endpoint}/countries`;
}
options = appendCustomParams(requestOptions, [], { params: __assign({}, requestOptions.params) });
options = appendCustomParams(requestOptions, [], { params: Object.assign({}, requestOptions.params) });
if (requestOptions.countryCode) {
endpoint = endpoint + "/" + requestOptions.countryCode;
endpoint = `${endpoint}/${requestOptions.countryCode}`;
}
}
return request(cleanUrl(endpoint), options).then(function (response) {
return request(cleanUrl(endpoint), options).then((response) => {
return response;

@@ -38,0 +37,0 @@ });

@@ -1,2 +0,2 @@

import { IEndpointOptions } from "./helpers";
import { IEndpointOptions } from "./helpers.js";
export interface IGetAvailableDataCollectionsOptions extends IEndpointOptions {

@@ -18,3 +18,3 @@ /**

export interface IGetAvailableDataCollectionsResponse {
DataCollections?: (IDataCollection)[] | null;
DataCollections?: IDataCollection[] | null;
}

@@ -24,3 +24,3 @@ export interface IDataCollection {

metadata: IMetadata;
data?: (IDataInfo)[] | null;
data?: IDataInfo[] | null;
}

@@ -41,3 +41,3 @@ export interface IMetadata {

categories?: ICategory[] | null;
filters?: (IFilter)[] | null;
filters?: IFilter[] | null;
datasets?: string | null;

@@ -44,0 +44,0 @@ hierarchies: string;

/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import { __assign } from "tslib";
import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers.js";
/**

@@ -28,4 +27,4 @@ * ```js

export function getAvailableDataCollections(requestOptions) {
var options = {};
var endpoint = ARCGIS_ONLINE_GEOENRICHMENT_URL + "/dataCollections";
let options = {};
let endpoint = `${ARCGIS_ONLINE_GEOENRICHMENT_URL}/dataCollections`;
if (!requestOptions) {

@@ -36,8 +35,5 @@ options.params = {};

if (requestOptions.endpoint) {
endpoint = requestOptions.endpoint + "/dataCollections";
endpoint = `${requestOptions.endpoint}/dataCollections`;
}
options = appendCustomParams(requestOptions, [
"addDerivativeVariables",
"suppressNullValues",
], { params: __assign({}, requestOptions.params) });
options = appendCustomParams(requestOptions, ["addDerivativeVariables", "suppressNullValues"], { params: Object.assign({}, requestOptions.params) });
if (options.params.addDerivativeVariables) {

@@ -47,5 +43,5 @@ options.params.addDerivativeVariables = JSON.stringify(options.params.addDerivativeVariables);

if (requestOptions.countryCode) {
endpoint = endpoint + "/" + requestOptions.countryCode;
endpoint = `${endpoint}/${requestOptions.countryCode}`;
if (requestOptions.dataCollection) {
endpoint = endpoint + "/" + requestOptions.dataCollection;
endpoint = `${endpoint}/${requestOptions.dataCollection}`;
}

@@ -55,3 +51,3 @@ }

// add spatialReference property to individual matches
return request("" + cleanUrl(endpoint), options).then(function (response) {
return request(`${cleanUrl(endpoint)}`, options).then((response) => {
return response;

@@ -58,0 +54,0 @@ });

@@ -1,2 +0,2 @@

import { IEndpointOptions } from "./helpers";
import { IEndpointOptions } from "./helpers.js";
export interface IGetAvailableGeographyLevelsResponse {

@@ -3,0 +3,0 @@ messages?: string[] | null;

/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import { __assign } from "tslib";
import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers.js";
/**

@@ -20,4 +19,4 @@ * ```js

export function getAvailableGeographyLevels(requestOptions) {
var options = {};
var endpoint = ARCGIS_ONLINE_GEOENRICHMENT_URL + "/StandardGeographyLevels";
let options = {};
let endpoint = `${ARCGIS_ONLINE_GEOENRICHMENT_URL}/StandardGeographyLevels`;
if (!requestOptions) {

@@ -28,7 +27,9 @@ options.params = {};

if (requestOptions.endpoint) {
endpoint = requestOptions.endpoint + "/StandardGeographyLevels";
endpoint = `${requestOptions.endpoint}/StandardGeographyLevels`;
}
options = appendCustomParams(requestOptions, [], { params: __assign({}, requestOptions.params) });
options = appendCustomParams(requestOptions, [], {
params: Object.assign({}, requestOptions.params)
});
}
return request("" + cleanUrl(endpoint), options).then(function (response) {
return request(`${cleanUrl(endpoint)}`, options).then((response) => {
return response;

@@ -35,0 +36,0 @@ });

@@ -1,2 +0,2 @@

import { IGeoenrichmentResult, IEndpointOptions } from "./helpers";
import { IGeoenrichmentResult, IEndpointOptions } from "./helpers.js";
export interface IGetGeographyOptions extends IEndpointOptions {

@@ -3,0 +3,0 @@ /**

/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import { __assign } from "tslib";
import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
import { ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL } from "./helpers";
import { ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL } from "./helpers.js";
/**

@@ -23,4 +22,4 @@ * ```js

export function getGeography(requestOptions) {
var endpoint = (requestOptions.endpoint || ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL) + "/execute";
var options = appendCustomParams(requestOptions, [
const endpoint = `${requestOptions.endpoint || ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL}/execute`;
const options = appendCustomParams(requestOptions, [
"sourceCountry",

@@ -41,4 +40,4 @@ "optionalCountryDataset",

"featureOffset",
"langCode",
], { params: __assign({}, requestOptions.params) });
"langCode"
], { params: Object.assign({}, requestOptions.params) });
// the SAAS service does not support anonymous requests

@@ -49,3 +48,3 @@ if (!requestOptions.authentication) {

// These parameters are passed as JSON-style strings:
["geographyLayers", "geographyIDs"].forEach(function (parameter) {
["geographyLayers", "geographyIDs"].forEach((parameter) => {
if (options.params[parameter]) {

@@ -56,3 +55,3 @@ options.params[parameter] = JSON.stringify(options.params[parameter]);

// add spatialReference property to individual matches
return request("" + cleanUrl(endpoint), options).then(function (response) {
return request(`${cleanUrl(endpoint)}`, options).then((response) => {
return response;

@@ -59,0 +58,0 @@ });

@@ -1,3 +0,2 @@

import { IRequestOptions } from "@esri/arcgis-rest-request";
import { IFeatureSet } from "@esri/arcgis-rest-types";
import { IRequestOptions, IFeatureSet } from "@esri/arcgis-rest-request";
export declare const ARCGIS_ONLINE_GEOENRICHMENT_URL: string;

@@ -4,0 +3,0 @@ export declare const ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL: string;

/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
var ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL = "https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver";
export var ARCGIS_ONLINE_GEOENRICHMENT_URL = ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL + "/Geoenrichment";
export var ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL = ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL + "/StandardGeographyQuery";
const ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL = "https://geoenrich.arcgis.com/arcgis/rest/services/World/geoenrichmentserver";
export const ARCGIS_ONLINE_GEOENRICHMENT_URL = `${ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL}/Geoenrichment`;
export const ARCGIS_ONLINE_STANDARD_GEOGRAPHY_QUERY_URL = `${ARCGIS_ONLINE_GEOENRICHMENTSERVER_URL}/StandardGeographyQuery`;
//# sourceMappingURL=helpers.js.map

@@ -1,5 +0,6 @@

export * from "./getAvailableCountries";
export * from "./getAvailableDataCollections";
export * from "./getAvailableGeographyLevels";
export * from "./getGeography";
export * from "./queryDemographicData";
export * from "./getAvailableCountries.js";
export * from "./getAvailableDataCollections.js";
export * from "./getAvailableGeographyLevels.js";
export * from "./getGeography.js";
export * from "./queryDemographicData.js";
export type { IRequestOptions, IFeatureSet, IExtent } from "@esri/arcgis-rest-request";
/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
export * from "./getAvailableCountries";
export * from "./getAvailableDataCollections";
export * from "./getAvailableGeographyLevels";
export * from "./getGeography";
export * from "./queryDemographicData";
export * from "./getAvailableCountries.js";
export * from "./getAvailableDataCollections.js";
export * from "./getAvailableGeographyLevels.js";
export * from "./getGeography.js";
export * from "./queryDemographicData.js";
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { IGeoenrichmentResult, IEndpointOptions } from "./helpers";
import { IGeoenrichmentResult, IEndpointOptions } from "./helpers.js";
export interface IQueryDemographicDataOptions extends IEndpointOptions {

@@ -3,0 +3,0 @@ /**

/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import { __assign } from "tslib";
import { request, cleanUrl, appendCustomParams } from "@esri/arcgis-rest-request";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers";
import { ARCGIS_ONLINE_GEOENRICHMENT_URL } from "./helpers.js";
/**

@@ -23,3 +22,3 @@ * ```js

export function queryDemographicData(requestOptions) {
var options = appendCustomParams(requestOptions, [
const options = appendCustomParams(requestOptions, [
"studyAreas",

@@ -31,4 +30,4 @@ "dataCollections",

"inSR",
"outSR",
], { params: __assign({}, requestOptions.params) });
"outSR"
], { params: Object.assign({}, requestOptions.params) });
// the SAAS service does not support anonymous requests

@@ -39,3 +38,3 @@ if (!requestOptions.authentication) {

// These parameters are passed as JSON-style strings:
["dataCollections", "analysisVariables"].forEach(function (parameter) {
["dataCollections", "analysisVariables"].forEach((parameter) => {
if (options.params[parameter]) {

@@ -46,3 +45,3 @@ options.params[parameter] = JSON.stringify(options.params[parameter]);

// add spatialReference property to individual matches
return request("" + cleanUrl((requestOptions.endpoint || ARCGIS_ONLINE_GEOENRICHMENT_URL) + "/enrich"), options).then(function (response) {
return request(`${cleanUrl(`${requestOptions.endpoint || ARCGIS_ONLINE_GEOENRICHMENT_URL}/enrich`)}`, options).then((response) => {
return response;

@@ -49,0 +48,0 @@ });

{
"name": "@esri/arcgis-rest-demographics",
"version": "3.4.3",
"version": "4.0.0-beta.2",
"description": "Demographics data helpers for @esri/arcgis-rest-js",
"main": "dist/node/index.js",
"unpkg": "dist/umd/geocoding.umd.js",
"license": "Apache-2.0",
"keywords": [
"ES6",
"arcgis",
"esri",
"fetch",
"promise",
"typescript"
],
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"js:next": "dist/esm/index.js",
"unpkg": "dist/bundled/demographics.umd.min.js",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
"types": "dist/esm/index.d.ts",
"sideEffects": false,
"types": "dist/esm/index.d.ts",
"license": "Apache-2.0",
"files": [
"dist/**"
],
"scripts": {
"build": "npm-run-all --parallel build:*",
"postbuild": "node ../../scripts/create-dist-package-jsons.js",
"build:bundled": "rollup -c ../../rollup.js",
"build:cjs": "tsc --outDir ./dist/cjs -m commonjs",
"build:esm": "tsc --outDir ./dist/esm --declaration",
"dev": "npm-run-all --parallel dev:*",
"dev:bundled": "rollup -w -c ../../rollup.js",
"dev:cjs": "tsc -w --outDir ./dist/cjs -m commonjs",
"dev:esm": "tsc -w --outDir ./dist/esm --declaration"
},
"engines": {
"node": ">=12.20.0"
},
"dependencies": {
"@esri/arcgis-rest-types": "^3.4.3",
"tslib": "^1.13.0"
"tslib": "^2.3.0"
},
"devDependencies": {
"@esri/arcgis-rest-auth": "^3.4.3",
"@esri/arcgis-rest-request": "^3.4.3"
},
"peerDependencies": {
"@esri/arcgis-rest-auth": "^3.0.0",
"@esri/arcgis-rest-request": "^3.0.0"
"@esri/arcgis-rest-request": "4.0.0-beta.2"
},
"scripts": {
"prepare": "npm run build",
"build": "npm run build:node && npm run build:umd && npm run build:esm",
"build:esm": "tsc --module es2015 --outDir ./dist/esm --declaration",
"build:umd": "rollup -c ../../umd-base-profile.js && rollup -c ../../umd-production-profile.js",
"build:node": "tsc --module commonjs --outDir ./dist/node",
"dev:esm": "tsc -w --module es2015 --outDir ./dist/esm --declaration",
"dev:umd": "rollup -w -c ../../umd-base-profile.js",
"dev:node": "tsc -w --module commonjs --outDir ./dist/node"
"devDependencies": {
"@esri/arcgis-rest-request": "4.0.0-beta.2"
},
"publishConfig": {
"access": "public"
},
"contributors": [
"Gavin Rehkemper <grehkemper@esri.com> (http://gavinr.com/)",
"Patrick Arlt <parlt@esri.com> (http://patrickarlt.com/)"
],
"homepage": "https://github.com/Esri/arcgis-rest-js#readme",
"repository": {

@@ -45,26 +63,8 @@ "type": "git",

},
"contributors": [
{
"name": "Patrick Arlt",
"email": "parlt@esri.com",
"url": "http://patrickarlt.com/"
},
{
"name": "Gavin Rehkemper",
"email": "grehkemper@esri.com",
"url": "http://gavinr.com/"
}
],
"bugs": {
"url": "https://github.com/Esri/arcgis-rest-js/issues"
},
"homepage": "https://github.com/Esri/arcgis-rest-js#readme",
"keywords": [
"typescript",
"promise",
"fetch",
"arcgis",
"esri",
"ES6"
]
"publishConfig": {
"access": "public"
}
}

@@ -11,3 +11,3 @@ [![npm version][npm-img]][npm-url]

[travis-url]: https://travis-ci.org/Esri/arcgis-rest-js
[gzip-image]: https://img.badgesize.io/https://unpkg.com/@esri/arcgis-rest-demographics/dist/umd/demographics.umd.min.js?compression=gzip
[gzip-image]: https://img.badgesize.io/https://unpkg.com/@esri/arcgis-rest-demographics/dist/bundled/demographics.umd.min.js?compression=gzip
[coverage-img]: https://codecov.io/gh/Esri/arcgis-rest-js/branch/master/graph/badge.svg

@@ -28,9 +28,8 @@ [coverage-url]: https://codecov.io/gh/Esri/arcgis-rest-js

```js
import { getAvailableDataCollections } from '@esri/arcgis-rest-demographics';
import { getAvailableDataCollections } from "@esri/arcgis-rest-demographics";
getAvailableDataCollections()
.then((response) => {
response.DataCollections;
// => [{ dataCollectionId: "KeyGlobalFacts", metadata: { ... }, data: [ ... ] }, ... ]
});
getAvailableDataCollections().then((response) => {
response.DataCollections;
// => [{ dataCollectionId: "KeyGlobalFacts", metadata: { ... }, data: [ ... ] }, ... ]
});
```

@@ -40,8 +39,8 @@

* [`getAvailableDataCollections({countryCode: 'us'})`](https://esri.github.io/arcgis-rest-js/api/demographics/getAvailableDataCollections/)
* [`queryDemographicData({studyAreas: [{"geometry":{"x":-117.1956,"y":34.0572}}], authentication})`](https://esri.github.io/arcgis-rest-js/api/demographics/queryDemographicData/)
- [`getAvailableDataCollections({countryCode: 'us'})`](https://esri.github.io/arcgis-rest-js/api/demographics/getAvailableDataCollections/)
- [`queryDemographicData({studyAreas: [{"geometry":{"x":-117.1956,"y":34.0572}}], authentication})`](https://esri.github.io/arcgis-rest-js/api/demographics/queryDemographicData/)
### Issues
If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-rest-js/issues) first. Have you found a new bug? Want to request a new feature? We'd [**love**](https://github.com/Esri/arcgis-rest-js/issues/new) to hear from you.
If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-rest-js/issues) first. Have you found a new bug? Want to request a new feature? We'd [**love**](https://github.com/Esri/arcgis-rest-js/issues/new) to hear from you.

@@ -48,0 +47,0 @@ If you're looking for help you can also post issues on [GIS Stackexchange](http://gis.stackexchange.com/questions/ask?tags=esri-oss).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc