@esri/arcgis-rest-places 1.2.1-alpha.1 → 4.9.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.
Files changed (35) hide show
  1. package/dist/bundled/places.esm.js +7 -7
  2. package/dist/bundled/places.esm.js.map +1 -1
  3. package/dist/bundled/places.esm.min.js +4 -4
  4. package/dist/bundled/places.esm.min.js.map +1 -1
  5. package/dist/bundled/places.umd.js +231 -233
  6. package/dist/bundled/places.umd.js.map +1 -1
  7. package/dist/bundled/places.umd.min.js +4 -4
  8. package/dist/bundled/places.umd.min.js.map +1 -1
  9. package/dist/cjs/findPlacesNearPoint.js +3 -4
  10. package/dist/cjs/findPlacesNearPoint.js.map +1 -1
  11. package/dist/cjs/findPlacesWithinExtent.js +3 -4
  12. package/dist/cjs/findPlacesWithinExtent.js.map +1 -1
  13. package/dist/cjs/getCategories.js +1 -2
  14. package/dist/cjs/getCategories.js.map +1 -1
  15. package/dist/cjs/getCategory.js +1 -2
  16. package/dist/cjs/getCategory.js.map +1 -1
  17. package/dist/cjs/getPlaceDetails.js +1 -2
  18. package/dist/cjs/getPlaceDetails.js.map +1 -1
  19. package/dist/cjs/iconOptions.js +1 -1
  20. package/dist/cjs/iconOptions.js.map +1 -1
  21. package/dist/cjs/index.js +6 -6
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/cjs/utils.js +3 -3
  24. package/dist/cjs/utils.js.map +1 -1
  25. package/dist/esm/findPlacesNearPoint.d.ts +4 -4
  26. package/dist/esm/findPlacesNearPoint.js +2 -2
  27. package/dist/esm/findPlacesNearPoint.js.map +1 -1
  28. package/dist/esm/findPlacesWithinExtent.d.ts +4 -4
  29. package/dist/esm/findPlacesWithinExtent.js +2 -2
  30. package/dist/esm/findPlacesWithinExtent.js.map +1 -1
  31. package/dist/esm/getCategories.d.ts +2 -2
  32. package/dist/esm/getCategory.d.ts +2 -2
  33. package/dist/esm/getPlaceDetails.d.ts +4 -4
  34. package/dist/esm/getPlaceDetails.js.map +1 -1
  35. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  /* @preserve
2
- * @esri/arcgis-rest-places - v1.2.0 - Apache-2.0
3
- * Copyright (c) 2017-2025 Esri, Inc.
4
- * Mon May 12 2025 21:29:23 GMT+0000 (Coordinated Universal Time)
2
+ * @esri/arcgis-rest-places - v4.9.0 - Apache-2.0
3
+ * Copyright (c) 2017-2026 Esri, Inc.
4
+ * Thu Feb 19 2026 01:08:46 GMT+0000 (Coordinated Universal Time)
5
5
  */
6
6
  import { appendCustomParams, request } from '@esri/arcgis-rest-request';
7
7
 
@@ -25,13 +25,13 @@ function getNextPageParams(currentOffset = 0, currentPageSize = 10) {
25
25
  * around a user's GPS position, or a location clicked on a map.
26
26
  *
27
27
  * The returned places contain basic data such as name, category and
28
- * location. You can use the {@linkcode getPlace} method to get additional
28
+ * location. You can use the {@linkcode getPlaceDetails} method to get additional
29
29
  * details for a given place.
30
30
  *
31
31
  * You can refine the results by supplying additional search parameters,
32
32
  * including:
33
33
  *
34
- * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.
34
+ * - A list of category Ids, see {@linkcode getCategory} or {@linkcode getCategories}.
35
35
  * - A partial name filter with `name` option
36
36
  *
37
37
  * As this request can return many results, pagination is supported.
@@ -83,13 +83,13 @@ function findPlacesNearPoint(requestOptions) {
83
83
  * for places in the visible extent of a user's screen.
84
84
  *
85
85
  * The returned places contain basic data such as name, category and
86
- * location. You can use the {@linkcode getPlace} method to get additional
86
+ * location. You can use the {@linkcode getPlaceDetails} method to get additional
87
87
  * details for a given place.
88
88
  *
89
89
  * You can also refine the results by supplying additional search parameters,
90
90
  * including:
91
91
  *
92
- * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.
92
+ * - A list of category Ids, see {@linkcode getCategory} or {@linkcode getCategories}.
93
93
  * - A partial name filter with `name` option
94
94
  *
95
95
  * As this request can return many results, pagination is supported.
@@ -1 +1 @@
1
- {"version":3,"file":"places.esm.js","sources":["../../src/utils.ts","../../src/findPlacesNearPoint.ts","../../src/findPlacesWithinExtent.ts","../../src/getPlaceDetails.ts","../../src/getCategories.ts","../../src/getCategory.ts","../../src/iconOptions.ts"],"sourcesContent":["export const baseUrl =\n \"https://places-api.arcgis.com/arcgis/rest/services/places-service/v1\";\n\nexport function hasNextPage(response: any) {\n return !!response?.links?.next || !!response?.pagination?.nextUrl;\n}\n\nexport function getNextPageParams(currentOffset = 0, currentPageSize = 10) {\n return {\n offset: currentOffset + currentPageSize,\n pageSize: currentPageSize\n };\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"nearPointGet\"][\"parameters\"][\"query\"],\n \"x\" | \"y\" | \"radius\" | \"categoryIds\" | \"pageSize\" | \"offset\" | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"nearPointGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesNearPoint};\n */\nexport interface IFindPlacesNearPointResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesNearPointResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlacesNearPointOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches places that are within a given radius of a geographic point.\n * You must supply the `x` and `y` coordinates of the point that you wish\n * to search from. You can either specify a search radius, or use the\n * default (500 meters). You could use this method to search for places\n * around a user's GPS position, or a location clicked on a map.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlace} method to get additional\n * details for a given place.\n *\n * You can refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```js\n * import { findPlacesNearPoint } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await findPlacesNearPoint({\n * x: -3.1883,\n * y: 55.9533,\n * radius: 100,\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(response);\n * ```\n */\nexport function findPlacesNearPoint(\n requestOptions: IFindPlacesNearPointOptions\n): Promise<IFindPlacesNearPointResponse> {\n const options = appendCustomParams<IFindPlacesNearPointOptions>(\n requestOptions,\n [\n \"x\",\n \"y\",\n \"radius\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/near-point`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesNearPointResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesNearPoint(nextOptions);\n };\n }\n\n return r;\n });\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"withinExtentGet\"][\"parameters\"][\"query\"],\n | \"xmin\"\n | \"ymin\"\n | \"xmax\"\n | \"ymax\"\n | \"categoryIds\"\n | \"pageSize\"\n | \"offset\"\n | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"withinExtentGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesWithinExtent};\n */\nexport interface IFindPlacesWithinExtentResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesWithinExtentResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlaceWithinExtentOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches the world-wide set of places for those that are within an\n * extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and\n * `ymax` coordinates of the extent. You could use this endpoint to search\n * for places in the visible extent of a user's screen.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlace} method to get additional\n * details for a given place.\n *\n * You can also refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```\n * import { findPlacesWithinExtent } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const results = await findPlacesWithinExtent({\n * xmin: -118.013334,\n * ymin: 33.78193,\n * xmax: -117.795753,\n * ymax: 33.873337,\n * categoryIds: [\"13002\"],\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(results)\n * ```\n */\nexport function findPlacesWithinExtent(\n requestOptions: IFindPlaceWithinExtentOptions\n): Promise<IFindPlacesWithinExtentResponse> {\n const options = appendCustomParams<IFindPlaceWithinExtentOptions>(\n requestOptions,\n [\n \"xmin\",\n \"ymin\",\n \"xmax\",\n \"ymax\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/within-extent`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesWithinExtentResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesWithinExtent(nextOptions);\n };\n }\n return r;\n });\n}\n","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","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[\"categoriesGet\"][\"parameters\"][\"query\"],\n \"filter\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategories};\n */\nexport interface IGetCategoriesResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategories}.\n */\nexport interface IGetCategoriesOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * The ArcGIS Places service has many categories (or types) of place, from\n * art museums to zoos. This endpoint returns all the categories including\n * their label and `categoryId`. The category Id can be used to search for\n * types of places with a `places/near-point` or `places/within-extent`\n * request.\n *\n * Categories also have information on their `parent`. This allows you to\n * search for specific categories such as \"French Restaurant\" - or to\n * look for more generic types such as \"Restaurant\".\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await getCategories({\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(response.categories);\n * ```\n */\nexport function getCategories(\n requestOptions: IGetCategoriesOptions\n): Promise<IGetCategoriesResponse> {\n const options = appendCustomParams<IGetCategoriesOptions>(\n requestOptions,\n [\"filter\", \"icon\"],\n {\n ...requestOptions\n }\n );\n\n return request(requestOptions.endpoint || `${baseUrl}/categories`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n","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","/*\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"],"names":[],"mappings":";;;;;;;AAAO,MAAM,OAAO,GAClB,sEAAsE,CAAC;SAEzD,WAAW,CAAC,QAAa;;IACvC,OAAO,CAAC,EAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,0CAAE,IAAI,CAAA,IAAI,CAAC,EAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,0CAAE,OAAO,CAAA,CAAC;AACpE,CAAC;SAEe,iBAAiB,CAAC,aAAa,GAAG,CAAC,EAAE,eAAe,GAAG,EAAE;IACvE,OAAO;QACL,MAAM,EAAE,aAAa,GAAG,eAAe;QACvC,QAAQ,EAAE,eAAe;KAC1B,CAAC;AACJ;;AC8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoCgB,mBAAmB,CACjC,cAA2C;IAE3C,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd;QACE,GAAG;QACH,GAAG;QACH,QAAQ;QACR,aAAa;QACb,UAAU;QACV,QAAQ;QACR,YAAY;QACZ,MAAM;KACP,oBAEI,cAAc,EAEpB,CAAC;IAEF,OACE,OAAO,CAAC,cAAc,CAAC,QAAQ,IAAI,GAAG,OAAO,oBAAoB,kCAC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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;;AC9CA;;;;;;;;;;;;;;;;;;;;;;SAsBgB,aAAa,CAC3B,cAAqC;IAErC,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,QAAQ,EAAE,MAAM,CAAC,oBAEb,cAAc,EAEpB,CAAC;IAEF,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,IAAI,GAAG,OAAO,aAAa,kCAC5D,OAAO,KACV,UAAU,EAAE,KAAK,IACjB,CAAC;AACL;;ACvCA;;;;;;;;;;;;;;;SAegB,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;;ACzEA;;;;;;;IAQY;AAAZ,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAJW,WAAW,KAAX,WAAW;;;;"}
1
+ {"version":3,"file":"places.esm.js","sources":["../../src/utils.ts","../../src/findPlacesNearPoint.ts","../../src/findPlacesWithinExtent.ts","../../src/getPlaceDetails.ts","../../src/getCategories.ts","../../src/getCategory.ts","../../src/iconOptions.ts"],"sourcesContent":["export const baseUrl =\n \"https://places-api.arcgis.com/arcgis/rest/services/places-service/v1\";\n\nexport function hasNextPage(response: any) {\n return !!response?.links?.next || !!response?.pagination?.nextUrl;\n}\n\nexport function getNextPageParams(currentOffset = 0, currentPageSize = 10) {\n return {\n offset: currentOffset + currentPageSize,\n pageSize: currentPageSize\n };\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"nearPointGet\"][\"parameters\"][\"query\"],\n \"x\" | \"y\" | \"radius\" | \"categoryIds\" | \"pageSize\" | \"offset\" | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"nearPointGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesNearPoint};\n */\nexport interface IFindPlacesNearPointResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesNearPointResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlacesNearPointOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches places that are within a given radius of a geographic point.\n * You must supply the `x` and `y` coordinates of the point that you wish\n * to search from. You can either specify a search radius, or use the\n * default (500 meters). You could use this method to search for places\n * around a user's GPS position, or a location clicked on a map.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlaceDetails} method to get additional\n * details for a given place.\n *\n * You can refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode getCategory} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```js\n * import { findPlacesNearPoint } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await findPlacesNearPoint({\n * x: -3.1883,\n * y: 55.9533,\n * radius: 100,\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(response);\n * ```\n */\nexport function findPlacesNearPoint(\n requestOptions: IFindPlacesNearPointOptions\n): Promise<IFindPlacesNearPointResponse> {\n const options = appendCustomParams<IFindPlacesNearPointOptions>(\n requestOptions,\n [\n \"x\",\n \"y\",\n \"radius\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/near-point`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesNearPointResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesNearPoint(nextOptions);\n };\n }\n\n return r;\n });\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"withinExtentGet\"][\"parameters\"][\"query\"],\n | \"xmin\"\n | \"ymin\"\n | \"xmax\"\n | \"ymax\"\n | \"categoryIds\"\n | \"pageSize\"\n | \"offset\"\n | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"withinExtentGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesWithinExtent};\n */\nexport interface IFindPlacesWithinExtentResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesWithinExtentResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlaceWithinExtentOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches the world-wide set of places for those that are within an\n * extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and\n * `ymax` coordinates of the extent. You could use this endpoint to search\n * for places in the visible extent of a user's screen.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlaceDetails} method to get additional\n * details for a given place.\n *\n * You can also refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode getCategory} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```\n * import { findPlacesWithinExtent } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const results = await findPlacesWithinExtent({\n * xmin: -118.013334,\n * ymin: 33.78193,\n * xmax: -117.795753,\n * ymax: 33.873337,\n * categoryIds: [\"13002\"],\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(results)\n * ```\n */\nexport function findPlacesWithinExtent(\n requestOptions: IFindPlaceWithinExtentOptions\n): Promise<IFindPlacesWithinExtentResponse> {\n const options = appendCustomParams<IFindPlaceWithinExtentOptions>(\n requestOptions,\n [\n \"xmin\",\n \"ymin\",\n \"xmax\",\n \"ymax\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/within-extent`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesWithinExtentResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesWithinExtent(nextOptions);\n };\n }\n return r;\n });\n}\n","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 getPlaceDetails}.\n */\nexport interface IGetPlaceResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getPlaceDetails}.\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","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[\"categoriesGet\"][\"parameters\"][\"query\"],\n \"filter\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategories};\n */\nexport interface IGetCategoriesResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategories}.\n */\nexport interface IGetCategoriesOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * The ArcGIS Places service has many categories (or types) of place, from\n * art museums to zoos. This endpoint returns all the categories including\n * their label and `categoryId`. The category Id can be used to search for\n * types of places with a `places/near-point` or `places/within-extent`\n * request.\n *\n * Categories also have information on their `parent`. This allows you to\n * search for specific categories such as \"French Restaurant\" - or to\n * look for more generic types such as \"Restaurant\".\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await getCategories({\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(response.categories);\n * ```\n */\nexport function getCategories(\n requestOptions: IGetCategoriesOptions\n): Promise<IGetCategoriesResponse> {\n const options = appendCustomParams<IGetCategoriesOptions>(\n requestOptions,\n [\"filter\", \"icon\"],\n {\n ...requestOptions\n }\n );\n\n return request(requestOptions.endpoint || `${baseUrl}/categories`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n","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","/*\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"],"names":[],"mappings":";;;;;;;AAAO,MAAM,OAAO,GAClB,sEAAsE;AAElE,SAAU,WAAW,CAAC,QAAa,EAAA;;AACvC,IAAA,OAAO,CAAC,EAAC,CAAA,EAAA,GAAA,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAA,MAAA,GAAR,QAAQ,CAAE,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,CAAA,IAAI,CAAC,EAAC,CAAA,EAAA,GAAA,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAA,MAAA,GAAR,QAAQ,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,CAAA;AACnE;AAEM,SAAU,iBAAiB,CAAC,aAAa,GAAG,CAAC,EAAE,eAAe,GAAG,EAAE,EAAA;IACvE,OAAO;QACL,MAAM,EAAE,aAAa,GAAG,eAAe;AACvC,QAAA,QAAQ,EAAE;KACX;AACH;;AC8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCG;AACG,SAAU,mBAAmB,CACjC,cAA2C,EAAA;AAE3C,IAAA,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd;QACE,GAAG;QACH,GAAG;QACH,QAAQ;QACR,aAAa;QACb,UAAU;QACV,QAAQ;QACR,YAAY;QACZ;KACD,EAAA,MAAA,CAAA,MAAA,CAAA,EA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AG,OAAO,CAAA,WAAA,CAAa,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC5D,OAAO,CAAA,EAAA,EACV,UAAU,EAAE,KAAK,IACjB;AACJ;;ACvCA;;;;;;;;;;;;;;AAcI;AACE,SAAU,WAAW,CACzB,cAAmC,EAAA;AAEnC,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc;AAErC,IAAA,MAAM,OAAO,GAAG,kBAAkB,CAChC,cAAc,EACd,CAAC,MAAM,CAAC,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAEH,cAAc,CAAA,CAEpB;AAED,IAAA,OAAO,OAAO,CACZ,cAAc,CAAC,QAAQ,IAAI,GAAG,OAAO,CAAA,YAAA,EAAe,UAAU,CAAA,CAAE,kCAE3D,OAAO,CAAA,EAAA,EACV,UAAU,EAAE,KAAK,IAEpB;AACH;;ACzEA;;;;;;AAME;IAEU;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACb,CAAC,EAJW,WAAW,KAAX,WAAW,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -1,7 +1,7 @@
1
1
  /* @preserve
2
- * @esri/arcgis-rest-places - v1.2.0 - Apache-2.0
3
- * Copyright (c) 2017-2025 Esri, Inc.
4
- * Mon May 12 2025 21:29:23 GMT+0000 (Coordinated Universal Time)
2
+ * @esri/arcgis-rest-places - v4.9.0 - Apache-2.0
3
+ * Copyright (c) 2017-2026 Esri, Inc.
4
+ * Thu Feb 19 2026 01:08:46 GMT+0000 (Coordinated Universal Time)
5
5
  */
6
- import{appendCustomParams as e,request as t}from"@esri/arcgis-rest-request";const n="https://places-api.arcgis.com/arcgis/rest/services/places-service/v1";function s(e){var t,n;return!!(null===(t=null==e?void 0:e.links)||void 0===t?void 0:t.next)||!!(null===(n=null==e?void 0:e.pagination)||void 0===n?void 0:n.nextUrl)}function i(e=0,t=10){return{offset:e+t,pageSize:t}}function c(a){const o=e(a,["x","y","radius","categoryIds","pageSize","offset","searchText","icon"],Object.assign({},a));return t(a.endpoint||`${n}/places/near-point`,Object.assign(Object.assign({},o),{httpMethod:"GET"})).then((e=>{const t=Object.assign({},e);return s(e)&&(t.nextPage=()=>c(Object.assign(Object.assign({},a),i(a.offset,a.pageSize)))),t}))}function a(c){const o=e(c,["xmin","ymin","xmax","ymax","categoryIds","pageSize","offset","searchText","icon"],Object.assign({},c));return t(c.endpoint||`${n}/places/within-extent`,Object.assign(Object.assign({},o),{httpMethod:"GET"})).then((e=>{const t=Object.assign({},e);return s(e)&&(t.nextPage=()=>a(Object.assign(Object.assign({},c),i(c.offset,c.pageSize)))),t}))}function o(s){const{placeId:i}=s,c=e(s,["requestedFields","icon"],Object.assign({},s));return t(s.endpoint||`${n}/places/${i}`,Object.assign(Object.assign({},c),{httpMethod:"GET"}))}function r(s){const i=e(s,["filter","icon"],Object.assign({},s));return t(s.endpoint||`${n}/categories`,Object.assign(Object.assign({},i),{httpMethod:"GET"}))}function g(s){const{categoryId:i}=s,c=e(s,["icon"],Object.assign({},s));return t(s.endpoint||`${n}/categories/${i}`,Object.assign(Object.assign({},c),{httpMethod:"GET"}))}var p;!function(e){e.PNG="png",e.SVG="svg",e.CIM="cim"}(p||(p={}));export{p as IconOptions,c as findPlacesNearPoint,a as findPlacesWithinExtent,r as getCategories,g as getCategory,o as getPlaceDetails};
6
+ import{appendCustomParams as e,request as t}from"@esri/arcgis-rest-request";const n="https://places-api.arcgis.com/arcgis/rest/services/places-service/v1";function s(e){var t,n;return!!(null===(t=null==e?void 0:e.links)||void 0===t?void 0:t.next)||!!(null===(n=null==e?void 0:e.pagination)||void 0===n?void 0:n.nextUrl)}function i(e=0,t=10){return{offset:e+t,pageSize:t}}function c(a){const o=e(a,["x","y","radius","categoryIds","pageSize","offset","searchText","icon"],Object.assign({},a));return t(a.endpoint||`${n}/places/near-point`,Object.assign(Object.assign({},o),{httpMethod:"GET"})).then(e=>{const t=Object.assign({},e);return s(e)&&(t.nextPage=()=>c(Object.assign(Object.assign({},a),i(a.offset,a.pageSize)))),t})}function a(c){const o=e(c,["xmin","ymin","xmax","ymax","categoryIds","pageSize","offset","searchText","icon"],Object.assign({},c));return t(c.endpoint||`${n}/places/within-extent`,Object.assign(Object.assign({},o),{httpMethod:"GET"})).then(e=>{const t=Object.assign({},e);return s(e)&&(t.nextPage=()=>a(Object.assign(Object.assign({},c),i(c.offset,c.pageSize)))),t})}function o(s){const{placeId:i}=s,c=e(s,["requestedFields","icon"],Object.assign({},s));return t(s.endpoint||`${n}/places/${i}`,Object.assign(Object.assign({},c),{httpMethod:"GET"}))}function r(s){const i=e(s,["filter","icon"],Object.assign({},s));return t(s.endpoint||`${n}/categories`,Object.assign(Object.assign({},i),{httpMethod:"GET"}))}function g(s){const{categoryId:i}=s,c=e(s,["icon"],Object.assign({},s));return t(s.endpoint||`${n}/categories/${i}`,Object.assign(Object.assign({},c),{httpMethod:"GET"}))}var p;!function(e){e.PNG="png",e.SVG="svg",e.CIM="cim"}(p||(p={}));export{p as IconOptions,c as findPlacesNearPoint,a as findPlacesWithinExtent,r as getCategories,g as getCategory,o as getPlaceDetails};
7
7
  //# sourceMappingURL=places.esm.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"places.esm.min.js","sources":["../../src/utils.ts","../../src/findPlacesNearPoint.ts","../../src/findPlacesWithinExtent.ts","../../src/getPlaceDetails.ts","../../src/getCategories.ts","../../src/getCategory.ts","../../src/iconOptions.ts"],"sourcesContent":["export const baseUrl =\n \"https://places-api.arcgis.com/arcgis/rest/services/places-service/v1\";\n\nexport function hasNextPage(response: any) {\n return !!response?.links?.next || !!response?.pagination?.nextUrl;\n}\n\nexport function getNextPageParams(currentOffset = 0, currentPageSize = 10) {\n return {\n offset: currentOffset + currentPageSize,\n pageSize: currentPageSize\n };\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"nearPointGet\"][\"parameters\"][\"query\"],\n \"x\" | \"y\" | \"radius\" | \"categoryIds\" | \"pageSize\" | \"offset\" | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"nearPointGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesNearPoint};\n */\nexport interface IFindPlacesNearPointResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesNearPointResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlacesNearPointOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches places that are within a given radius of a geographic point.\n * You must supply the `x` and `y` coordinates of the point that you wish\n * to search from. You can either specify a search radius, or use the\n * default (500 meters). You could use this method to search for places\n * around a user's GPS position, or a location clicked on a map.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlace} method to get additional\n * details for a given place.\n *\n * You can refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```js\n * import { findPlacesNearPoint } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await findPlacesNearPoint({\n * x: -3.1883,\n * y: 55.9533,\n * radius: 100,\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(response);\n * ```\n */\nexport function findPlacesNearPoint(\n requestOptions: IFindPlacesNearPointOptions\n): Promise<IFindPlacesNearPointResponse> {\n const options = appendCustomParams<IFindPlacesNearPointOptions>(\n requestOptions,\n [\n \"x\",\n \"y\",\n \"radius\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/near-point`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesNearPointResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesNearPoint(nextOptions);\n };\n }\n\n return r;\n });\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"withinExtentGet\"][\"parameters\"][\"query\"],\n | \"xmin\"\n | \"ymin\"\n | \"xmax\"\n | \"ymax\"\n | \"categoryIds\"\n | \"pageSize\"\n | \"offset\"\n | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"withinExtentGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesWithinExtent};\n */\nexport interface IFindPlacesWithinExtentResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesWithinExtentResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlaceWithinExtentOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches the world-wide set of places for those that are within an\n * extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and\n * `ymax` coordinates of the extent. You could use this endpoint to search\n * for places in the visible extent of a user's screen.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlace} method to get additional\n * details for a given place.\n *\n * You can also refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode searchCategories} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```\n * import { findPlacesWithinExtent } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const results = await findPlacesWithinExtent({\n * xmin: -118.013334,\n * ymin: 33.78193,\n * xmax: -117.795753,\n * ymax: 33.873337,\n * categoryIds: [\"13002\"],\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(results)\n * ```\n */\nexport function findPlacesWithinExtent(\n requestOptions: IFindPlaceWithinExtentOptions\n): Promise<IFindPlacesWithinExtentResponse> {\n const options = appendCustomParams<IFindPlaceWithinExtentOptions>(\n requestOptions,\n [\n \"xmin\",\n \"ymin\",\n \"xmax\",\n \"ymax\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/within-extent`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesWithinExtentResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesWithinExtent(nextOptions);\n };\n }\n return r;\n });\n}\n","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","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[\"categoriesGet\"][\"parameters\"][\"query\"],\n \"filter\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategories};\n */\nexport interface IGetCategoriesResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategories}.\n */\nexport interface IGetCategoriesOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * The ArcGIS Places service has many categories (or types) of place, from\n * art museums to zoos. This endpoint returns all the categories including\n * their label and `categoryId`. The category Id can be used to search for\n * types of places with a `places/near-point` or `places/within-extent`\n * request.\n *\n * Categories also have information on their `parent`. This allows you to\n * search for specific categories such as \"French Restaurant\" - or to\n * look for more generic types such as \"Restaurant\".\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await getCategories({\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(response.categories);\n * ```\n */\nexport function getCategories(\n requestOptions: IGetCategoriesOptions\n): Promise<IGetCategoriesResponse> {\n const options = appendCustomParams<IGetCategoriesOptions>(\n requestOptions,\n [\"filter\", \"icon\"],\n {\n ...requestOptions\n }\n );\n\n return request(requestOptions.endpoint || `${baseUrl}/categories`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n","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","/*\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"],"names":["baseUrl","hasNextPage","response","links","next","pagination","nextUrl","getNextPageParams","currentOffset","currentPageSize","offset","pageSize","findPlacesNearPoint","requestOptions","options","appendCustomParams","request","endpoint","httpMethod","then","r","nextPage","findPlacesWithinExtent","getPlaceDetails","placeId","getCategories","getCategory","categoryId","IconOptions"],"mappings":";;;;;4EAAO,MAAMA,EACX,gFAEcC,EAAYC,WAC1B,mBAASA,eAAAA,EAAUC,4BAAOC,oBAAUF,eAAAA,EAAUG,iCAAYC,QAC5D,UAEgBC,EAAkBC,EAAgB,EAAGC,EAAkB,IACrE,MAAO,CACLC,OAAQF,EAAgBC,EACxBE,SAAUF,EAEd,UCkEgBG,EACdC,GAEA,MAAMC,EAAUC,EACdF,EACA,CACE,IACA,IACA,SACA,cACA,WACA,SACA,aACA,yBAGGA,IAIP,OACEG,EAAQH,EAAeI,UAAY,GAAGjB,qDACjCc,IACHI,WAAY,SAEdC,MAAMjB,IACN,MAAMkB,mBACDlB,GAaL,OAVID,EAAYC,KACdkB,EAAEC,SAAW,IAKJT,iCAHFC,GACAN,EAAkBM,EAAeH,OAAQG,EAAeF,aAM1DS,CAAC,GAEZ,UClCgBE,EACdT,GAEA,MAAMC,EAAUC,EACdF,EACA,CACE,OACA,OACA,OACA,OACA,cACA,WACA,SACA,aACA,yBAGGA,IAIP,OACEG,EAAQH,EAAeI,UAAY,GAAGjB,wDACjCc,IACHI,WAAY,SAEdC,MAAMjB,IACN,MAAMkB,mBACDlB,GAYL,OATID,EAAYC,KACdkB,EAAEC,SAAW,IAKJC,iCAHFT,GACAN,EAAkBM,EAAeH,OAAQG,EAAeF,aAK1DS,CAAC,GAEZ,UC3DgBG,EACdV,GAEA,MAAMW,QAAEA,GAAYX,EAEdC,EAAUC,EACdF,EACA,CAAC,kBAAmB,yBAEfA,IAIP,OAAOG,EAAQH,EAAeI,UAAY,GAAGjB,YAAkBwB,mCAC1DV,IACHI,WAAY,QAEhB,UCxBgBO,EACdZ,GAEA,MAAMC,EAAUC,EACdF,EACA,CAAC,SAAU,yBAENA,IAIP,OAAOG,EAAQH,EAAeI,UAAY,GAAGjB,8CACxCc,IACHI,WAAY,QAEhB,UCxBgBQ,EACdb,GAEA,MAAMc,WAAEA,GAAed,EAEjBC,EAAUC,EACdF,EACA,CAAC,yBAEIA,IAIP,OAAOG,EACLH,EAAeI,UAAY,GAAGjB,gBAAsB2B,mCAE/Cb,IACHI,WAAY,QAGlB,KCjEYU,GAAZ,SAAYA,GACVA,YACAA,YACAA,WACD,CAJD,CAAYA,IAAAA"}
1
+ {"version":3,"file":"places.esm.min.js","sources":["../../src/utils.ts","../../src/findPlacesNearPoint.ts","../../src/findPlacesWithinExtent.ts","../../src/getPlaceDetails.ts","../../src/getCategories.ts","../../src/getCategory.ts","../../src/iconOptions.ts"],"sourcesContent":["export const baseUrl =\n \"https://places-api.arcgis.com/arcgis/rest/services/places-service/v1\";\n\nexport function hasNextPage(response: any) {\n return !!response?.links?.next || !!response?.pagination?.nextUrl;\n}\n\nexport function getNextPageParams(currentOffset = 0, currentPageSize = 10) {\n return {\n offset: currentOffset + currentPageSize,\n pageSize: currentPageSize\n };\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"nearPointGet\"][\"parameters\"][\"query\"],\n \"x\" | \"y\" | \"radius\" | \"categoryIds\" | \"pageSize\" | \"offset\" | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"nearPointGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesNearPoint};\n */\nexport interface IFindPlacesNearPointResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesNearPointResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlacesNearPointOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches places that are within a given radius of a geographic point.\n * You must supply the `x` and `y` coordinates of the point that you wish\n * to search from. You can either specify a search radius, or use the\n * default (500 meters). You could use this method to search for places\n * around a user's GPS position, or a location clicked on a map.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlaceDetails} method to get additional\n * details for a given place.\n *\n * You can refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode getCategory} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```js\n * import { findPlacesNearPoint } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await findPlacesNearPoint({\n * x: -3.1883,\n * y: 55.9533,\n * radius: 100,\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\");\n * });\n *\n * console.log(response);\n * ```\n */\nexport function findPlacesNearPoint(\n requestOptions: IFindPlacesNearPointOptions\n): Promise<IFindPlacesNearPointResponse> {\n const options = appendCustomParams<IFindPlacesNearPointOptions>(\n requestOptions,\n [\n \"x\",\n \"y\",\n \"radius\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/near-point`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesNearPointResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesNearPoint(nextOptions);\n };\n }\n\n return r;\n });\n}\n","import {\n request,\n appendCustomParams,\n IRequestOptions\n} from \"@esri/arcgis-rest-request\";\n\nimport { operations } from \"./openapi-types.js\";\nimport { baseUrl, hasNextPage, getNextPageParams } 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[\"withinExtentGet\"][\"parameters\"][\"query\"],\n | \"xmin\"\n | \"ymin\"\n | \"xmax\"\n | \"ymax\"\n | \"categoryIds\"\n | \"pageSize\"\n | \"offset\"\n | \"searchText\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"withinExtentGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode findPlacesWithinExtent};\n */\nexport interface IFindPlacesWithinExtentResponse extends successResponse {\n nextPage?: () => Promise<IFindPlacesWithinExtentResponse>;\n}\n\n/**\n * Options for {@linkcode findPlacesNearPoint}.\n */\nexport interface IFindPlaceWithinExtentOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * Searches the world-wide set of places for those that are within an\n * extent, or bounding box. You must supply the `xmin`, `ymin`, `xmax` and\n * `ymax` coordinates of the extent. You could use this endpoint to search\n * for places in the visible extent of a user's screen.\n *\n * The returned places contain basic data such as name, category and\n * location. You can use the {@linkcode getPlaceDetails} method to get additional\n * details for a given place.\n *\n * You can also refine the results by supplying additional search parameters,\n * including:\n *\n * - A list of category Ids, see {@linkcode getCategory} or {@linkcode getCategories}.\n * - A partial name filter with `name` option\n *\n * As this request can return many results, pagination is supported.\n * When a query results in more than [pageSize] places, the response will contain the property\n * `pagination` in addition to place results. If `pagination` exists, an additional method\n * `response.nextPage()` can be used to get the next page of results.\n *\n * ```\n * import { findPlacesWithinExtent } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const results = await findPlacesWithinExtent({\n * xmin: -118.013334,\n * ymin: 33.78193,\n * xmax: -117.795753,\n * ymax: 33.873337,\n * categoryIds: [\"13002\"],\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(results)\n * ```\n */\nexport function findPlacesWithinExtent(\n requestOptions: IFindPlaceWithinExtentOptions\n): Promise<IFindPlacesWithinExtentResponse> {\n const options = appendCustomParams<IFindPlaceWithinExtentOptions>(\n requestOptions,\n [\n \"xmin\",\n \"ymin\",\n \"xmax\",\n \"ymax\",\n \"categoryIds\",\n \"pageSize\",\n \"offset\",\n \"searchText\",\n \"icon\"\n ],\n {\n ...requestOptions\n }\n );\n\n return (\n request(requestOptions.endpoint || `${baseUrl}/places/within-extent`, {\n ...options,\n httpMethod: \"GET\"\n }) as Promise<successResponse>\n ).then((response) => {\n const r: IFindPlacesWithinExtentResponse = {\n ...response\n };\n\n if (hasNextPage(response)) {\n r.nextPage = () => {\n const nextOptions = {\n ...requestOptions,\n ...getNextPageParams(requestOptions.offset, requestOptions.pageSize)\n };\n return findPlacesWithinExtent(nextOptions);\n };\n }\n return r;\n });\n}\n","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 getPlaceDetails}.\n */\nexport interface IGetPlaceResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getPlaceDetails}.\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","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[\"categoriesGet\"][\"parameters\"][\"query\"],\n \"filter\"\n>;\n\n// get the correct type of the response format\ntype successResponse =\n operations[\"categoriesGet\"][\"responses\"][\"200\"][\"content\"][\"application/json\"];\n\n/**\n * The response format for {@linkcode getCategories};\n */\nexport interface IGetCategoriesResponse extends successResponse {}\n\n/**\n * Options for {@linkcode getCategories}.\n */\nexport interface IGetCategoriesOptions\n extends Omit<IRequestOptions, \"httpMethod\" | \"f\">,\n queryParams {\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 * The ArcGIS Places service has many categories (or types) of place, from\n * art museums to zoos. This endpoint returns all the categories including\n * their label and `categoryId`. The category Id can be used to search for\n * types of places with a `places/near-point` or `places/within-extent`\n * request.\n *\n * Categories also have information on their `parent`. This allows you to\n * search for specific categories such as \"French Restaurant\" - or to\n * look for more generic types such as \"Restaurant\".\n *\n * ```js\n * import { getCategories } from \"@esri/arcgis-rest-places\";\n * import { ApiKeyManager } from \"@esri/arcgis-rest-request\";\n *\n * const response = await getCategories({\n * authentication: ApiKeyManager.fromKey(\"YOUR_API_KEY\")\n * });\n *\n * console.log(response.categories);\n * ```\n */\nexport function getCategories(\n requestOptions: IGetCategoriesOptions\n): Promise<IGetCategoriesResponse> {\n const options = appendCustomParams<IGetCategoriesOptions>(\n requestOptions,\n [\"filter\", \"icon\"],\n {\n ...requestOptions\n }\n );\n\n return request(requestOptions.endpoint || `${baseUrl}/categories`, {\n ...options,\n httpMethod: \"GET\"\n });\n}\n","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","/*\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"],"names":["baseUrl","hasNextPage","response","_a","links","next","_b","pagination","nextUrl","getNextPageParams","currentOffset","currentPageSize","offset","pageSize","findPlacesNearPoint","requestOptions","options","appendCustomParams","Object","assign","request","endpoint","httpMethod","then","r","nextPage","findPlacesWithinExtent","getPlaceDetails","placeId","getCategories","getCategory","categoryId","IconOptions"],"mappings":";;;;;4EAAO,MAAMA,EACX,uEAEI,SAAUC,EAAYC,WAC1B,SAAwB,QA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