@esri/arcgis-rest-places 1.0.2 → 1.2.0
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.
- package/README.md +3 -2
- package/dist/bundled/places.esm.js +38 -14
- package/dist/bundled/places.esm.js.map +1 -1
- package/dist/bundled/places.esm.min.js +4 -4
- package/dist/bundled/places.esm.min.js.map +1 -1
- package/dist/bundled/places.umd.js +37 -13
- package/dist/bundled/places.umd.js.map +1 -1
- package/dist/bundled/places.umd.min.js +4 -4
- package/dist/bundled/places.umd.min.js.map +1 -1
- package/dist/cjs/findPlacesNearPoint.js +11 -2
- package/dist/cjs/findPlacesNearPoint.js.map +1 -1
- package/dist/cjs/findPlacesWithinExtent.js +3 -2
- package/dist/cjs/findPlacesWithinExtent.js.map +1 -1
- package/dist/cjs/getCategories.js +2 -2
- package/dist/cjs/getCategories.js.map +1 -1
- package/dist/cjs/getCategory.js +2 -2
- package/dist/cjs/getCategory.js.map +1 -1
- package/dist/cjs/getPlaceDetails.js +2 -2
- package/dist/cjs/getPlaceDetails.js.map +1 -1
- package/dist/cjs/iconOptions.js +17 -0
- package/dist/cjs/iconOptions.js.map +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/openapi-types.js.map +1 -1
- package/dist/esm/findPlacesNearPoint.d.ts +7 -0
- package/dist/esm/findPlacesNearPoint.js +11 -2
- package/dist/esm/findPlacesNearPoint.js.map +1 -1
- package/dist/esm/findPlacesWithinExtent.d.ts +7 -0
- package/dist/esm/findPlacesWithinExtent.js +3 -2
- package/dist/esm/findPlacesWithinExtent.js.map +1 -1
- package/dist/esm/getCategories.d.ts +7 -0
- package/dist/esm/getCategories.js +2 -2
- package/dist/esm/getCategories.js.map +1 -1
- package/dist/esm/getCategory.d.ts +7 -0
- package/dist/esm/getCategory.js +2 -2
- package/dist/esm/getCategory.js.map +1 -1
- package/dist/esm/getPlaceDetails.d.ts +7 -0
- package/dist/esm/getPlaceDetails.js +2 -2
- package/dist/esm/getPlaceDetails.js.map +1 -1
- package/dist/esm/iconOptions.d.ts +5 -0
- package/dist/esm/iconOptions.js +14 -0
- package/dist/esm/iconOptions.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/openapi-types.d.ts +311 -49
- package/dist/esm/openapi-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCategory.js","sourceRoot":"","sources":["../../src/getCategory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"getCategory.js","sourceRoot":"","sources":["../../src/getCategory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA+BrC;;;;;;;;;;;;;;IAcI;AACJ,MAAM,UAAU,WAAW,CACzB,cAAmC;IAEnC,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC;IAEtC,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,MAAM,CAAC,oBAEH,cAAc,EAEpB,CAAC;IAEF,OAAO,OAAO,CACZ,cAAc,CAAC,QAAQ,IAAI,GAAG,OAAO,eAAe,UAAU,EAAE,kCAE3D,OAAO,KACV,UAAU,EAAE,KAAK,IAEpB,CAAC;AACJ,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl } from \"./utils.js\";\nimport { IconOptions } from \"./iconOptions.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = operations[\"categoriesCategoryIdGet\"][\"parameters\"][\"query\"];\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesCategoryIdGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategory};\n */\nexport interface IGetCategoryResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategory}.\n */\nexport interface IGetCategoryOptions\n extends Omit<IRequestOptions, \"httpMethod\">,\n queryParams {\n categoryId: string;\n icon?: IconOptions;\n /**\n * Override the URL. This should be the full URL to the API endpoint you want to call. Used internally by Esri staff for testing.\n * @private\n */\n endpoint?: string;\n}\n\n/**\n * Returns details about a single category by Id.\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = getCategory({\n * categoryId: \"10000\",\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(response);\n * ```\n **/\nexport function getCategory(\n requestOptions: IGetCategoryOptions\n): Promise<IGetCategoryResponse> {\n const { categoryId } = requestOptions;\n\n const options = appendCustomParams<IGetCategoryOptions>(\n requestOptions,\n [\"icon\"],\n {\n ...requestOptions\n }\n );\n\n return request(\n requestOptions.endpoint || `${baseUrl}/categories/${categoryId}`,\n {\n ...options,\n httpMethod: \"GET\"\n }\n );\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
2
|
import { operations } from "./openapi-types.js";
|
|
3
|
+
import { IconOptions } from "./iconOptions.js";
|
|
3
4
|
declare type queryParams = Pick<operations["placeIdGet"]["parameters"]["query"], "requestedFields">;
|
|
4
5
|
declare type successResponse = operations["placeIdGet"]["responses"]["200"]["content"]["application/json"];
|
|
5
6
|
/**
|
|
@@ -12,6 +13,12 @@ export interface IGetPlaceResponse extends successResponse {
|
|
|
12
13
|
*/
|
|
13
14
|
export interface IGetPlaceOptions extends Omit<IRequestOptions, "httpMethod">, queryParams {
|
|
14
15
|
placeId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Override the URL. This should be the full URL to the API endpoint you want to call. Used internally by Esri staff for testing.
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
icon?: IconOptions;
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
17
24
|
* Returns a single place, including additional details, such as:
|
|
@@ -30,7 +30,7 @@ import { baseUrl } from "./utils.js";
|
|
|
30
30
|
*/
|
|
31
31
|
export function getPlaceDetails(requestOptions) {
|
|
32
32
|
const { placeId } = requestOptions;
|
|
33
|
-
const options = appendCustomParams(requestOptions, ["requestedFields"], Object.assign({}, requestOptions));
|
|
34
|
-
return request(`${baseUrl}/places/${placeId}`, Object.assign(Object.assign({}, options), { httpMethod: "GET" }));
|
|
33
|
+
const options = appendCustomParams(requestOptions, ["requestedFields", "icon"], Object.assign({}, requestOptions));
|
|
34
|
+
return request(requestOptions.endpoint || `${baseUrl}/places/${placeId}`, Object.assign(Object.assign({}, options), { httpMethod: "GET" }));
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=getPlaceDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPlaceDetails.js","sourceRoot":"","sources":["../../src/getPlaceDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"getPlaceDetails.js","sourceRoot":"","sources":["../../src/getPlaceDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAkCrC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,eAAe,CAC7B,cAAgC;IAEhC,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC;IAEnC,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,iBAAiB,EAAE,MAAM,CAAC,oBAEtB,cAAc,EAEpB,CAAC;IAEF,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,IAAI,GAAG,OAAO,WAAW,OAAO,EAAE,kCACnE,OAAO,KACV,UAAU,EAAE,KAAK,IACjB,CAAC;AACL,CAAC","sourcesContent":["import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl } from \"./utils.js\";\nimport { IconOptions } from \"./iconOptions.js\";\n\n// determine the list of allowed params we want to allow as options\n// this should match the array given to appendCustomParams below\ntype queryParams = Pick<\n operations[\"placeIdGet\"][\"parameters\"][\"query\"],\n \"requestedFields\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"placeIdGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getPlace};\n */\nexport interface IGetPlaceResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getPlace}.\n */\nexport interface IGetPlaceOptions\n extends Omit<IRequestOptions, \"httpMethod\">,\n queryParams {\n placeId: string;\n /**\n * Override the URL. This should be the full URL to the API endpoint you want to call. Used internally by Esri staff for testing.\n * @private\n */\n endpoint?: string;\n icon?: IconOptions;\n}\n\n/**\n * Returns a single place, including additional details, such as:\n *\n * - contact details\n * - address\n * - price information\n * - user rating\n * - opening hours\n *\n * This endpoint can be used to fetch additional details for a specific\n * place, returned from a places search request.\n *\n * Note that some fields, such as opening hours, are not available for\n * every place. Where a field is not available it will be omitted from the\n * response and you will not be charged for this data.\n *\n * ```js\n * import { getPlaceDetails } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const place = getPlaceDetails({\n * placeId: \"e78051acc722c55ab11ba930d8dd7772\",\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(place);\n * ```\n */\nexport function getPlaceDetails(\n requestOptions: IGetPlaceOptions\n): Promise<IGetPlaceResponse> {\n const { placeId } = requestOptions;\n\n const options = appendCustomParams<IGetPlaceOptions>(\n requestOptions,\n [\"requestedFields\", \"icon\"],\n {\n ...requestOptions\n }\n );\n\n return request(requestOptions.endpoint || `${baseUrl}/places/${placeId}`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Use this parameter to define the type of icon URL for a given place or category. Place icons are available in the following formats:
|
|
3
|
+
|
|
4
|
+
svg
|
|
5
|
+
cim (Cartographic Information Model)
|
|
6
|
+
png 48 x 48 pixels
|
|
7
|
+
*/
|
|
8
|
+
export var IconOptions;
|
|
9
|
+
(function (IconOptions) {
|
|
10
|
+
IconOptions["PNG"] = "png";
|
|
11
|
+
IconOptions["SVG"] = "svg";
|
|
12
|
+
IconOptions["CIM"] = "cim";
|
|
13
|
+
})(IconOptions || (IconOptions = {}));
|
|
14
|
+
//# sourceMappingURL=iconOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconOptions.js","sourceRoot":"","sources":["../../src/iconOptions.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAEF,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB","sourcesContent":["/*\nUse this parameter to define the type of icon URL for a given place or category. Place icons are available in the following formats:\n\n svg\n cim (Cartographic Information Model)\n png 48 x 48 pixels\n*/\n\nexport enum IconOptions {\n PNG = \"png\",\n SVG = \"svg\",\n CIM = \"cim\"\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAMhB,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC","sourcesContent":["/* Copyright (c) 2023 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\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 {} from \"@esri/arcgis-rest-request\";\n\nexport * from \"./findPlacesNearPoint.js\";\nexport * from \"./findPlacesWithinExtent.js\";\nexport * from \"./getPlaceDetails.js\";\nexport * from \"./getCategories.js\";\nexport * from \"./getCategory.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;gBACgB;AAMhB,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["/* Copyright (c) 2023 Environmental Systems Research Institute, Inc.\n * Apache-2.0 */\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 {} from \"@esri/arcgis-rest-request\";\n\nexport * from \"./findPlacesNearPoint.js\";\nexport * from \"./findPlacesWithinExtent.js\";\nexport * from \"./getPlaceDetails.js\";\nexport * from \"./getCategories.js\";\nexport * from \"./getCategory.js\";\nexport * from \"./iconOptions.js\";\n"]}
|