{"_id":"@baatomaps/baato-js-client","_rev":"5-93762628f9f4a0c1ff8764f1d4ef3718","name":"@baatomaps/baato-js-client","dist-tags":{"latest":"1.5.0"},"versions":{"1.2.0":{"name":"@baatomaps/baato-js-client","version":"1.2.0","description":"js-client","main":"./dist/bundle.js","scripts":{"build":"rimraf ./dist && webpack --mode=production"},"author":{"name":"Kathmandu Living Labs Consult"},"license":"MIT","devDependencies":{"@isaac.frontend/eslint-config-es6":"^3.0.0","eslint":"^6.8.0","rimraf":"^3.0.2","webpack":"^4.44.1","webpack-cli":"^3.3.12"},"dependencies":{"axios":"^0.21.1"},"repository":{"type":"git","url":"git@code.kathmandulivinglabs.org:osm-search/js-client.git"},"directories":{"example":"examples"},"gitHead":"85be5e92126681acd77f41831ee4c4dd1dfab023","_id":"@baatomaps/baato-js-client@1.2.0","_nodeVersion":"16.13.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-KwBunaxVdTc63tAenfgHfN4sz+LCn4ISYIJG+aOBeRaUUFiqbmpXVjwN1UXDGWG7xFZMdXtQ/HFNPQHnvfNdvA==","shasum":"0878040dda32f48920fdb31043087007988fa17a","tarball":"https://registry.npmjs.org/@baatomaps/baato-js-client/-/baato-js-client-1.2.0.tgz","fileCount":52,"unpackedSize":869927,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/4FoCRA9TVsSAnZWagAApJIP/3rnVqnaOOuR6USTTCO2\nwAGKFffxEfK2wrkbFMNqg4gOWmxzPIXl67PKKoLSbCT1TkDsEHpMEUhGtFSN\nAjW4xzjpDaXf8us5/9BAfNgYfRwIKrBS4KadTO+m5oG4ay+r32ljUWhB9tfl\n3qFzWH2fliRBrj04yupNwg9+ZRIcsQHl8K6duAN9WOJiDSsRWIboDHFRGNK5\nC1vSYnHRktbkuOsGXtjQU25HncUzQhRg7j6D0PXfhdj8r2UgeoPd/igOkH3M\nX4V5elePWdI+atJpJLvs77bpasNKqh7f7rJTaHOkq6fzhGLf2yfMomsBFOLN\nZvwxB6Ev0woW+QzXhnYOKeBCGNWl2HzHnZMRjBIxIBN/zgxlG3UHWvyFJh1A\nbL1NYRntUqhV4BGQ37mWDAhU0hS1e4bdV5WlccWEehiwGeagqhXzJn9xQAw1\n9/Lx5RZMb3PQyrxqnXnMSFCeu6CTdAbx2ChT0DUy2O9QOayqd4yCux+N/121\nqX91B4J9DvC//GyXF2BD5KTWgDQBkJCtq/Tq0GIn42q6cnqSfrYjnzSNc68S\nOsxkvaOD8WwZTeMo4Z2+KGpI7Z0WMjyrIAKF7N7VJs8K8IbhBfYugZc5DJhT\nzmiewSo5ryKQlFCFRC+HaFze3HSdPoEFPHagADHWL5HS7AdatJ/BpI+imBYT\nIoe5\r\n=w1h+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDW6ecnvSEymVjLSjt645dTPQafAgMtX00p/VvNUeTvBAiB5NVHs4TxJh9S6rxkwBUjaMeE1VZTbNsQ75H5VGLgEGw=="}]},"_npmUser":{"name":"baatomaps","email":"baatomaps@gmail.com"},"maintainers":[{"name":"baatomaps","email":"baatomaps@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baato-js-client_1.2.0_1644134760443_0.2734884936450708"},"_hasShrinkwrap":false},"1.2.1":{"name":"@baatomaps/baato-js-client","version":"1.2.1","description":"js-client","main":"./dist/bundle.js","scripts":{"build":"rimraf ./dist && webpack --mode=production"},"author":{"name":"Kathmandu Living Labs Consult"},"license":"MIT","devDependencies":{"@isaac.frontend/eslint-config-es6":"^3.0.0","eslint":"^6.8.0","rimraf":"^3.0.2","webpack":"^4.41.5","webpack-cli":"^4.2.0"},"dependencies":{"axios":"^0.21.1"},"repository":{"type":"git","url":"git@code.kathmandulivinglabs.org:osm-search/js-client.git"},"gitHead":"10a676fbbbf193d46b4e21309ee61d2a0d647156","_id":"@baatomaps/baato-js-client@1.2.1","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-SqN4/mhDyWCOZ5MG/p5tlYJjb4a4J+RZiwYi6Cy/rpZGqI1EFN0vJ44CEG41N+dqXNIjJCz0YWTJHkxDi2EF9g==","shasum":"d29605c752355b12746d86d68c1db9723164e1a6","tarball":"https://registry.npmjs.org/@baatomaps/baato-js-client/-/baato-js-client-1.2.1.tgz","fileCount":52,"unpackedSize":870437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCylVCRA9TVsSAnZWagAAaPIQAJZJWoFfyRfW97wPBtx7\nFQZkzllljdPoiOBsRzDmnvN+D3koryYyEHeT80tG/qmVO4LNAAIi0k1hbvSt\nkdsUfnWpLYSQuPFfTfUDnGDjXO9KGCFeW0l3dAnF5eJUyn3rx0fFYm6C9Jq4\nKsFinaW22FdoAmqHqkMI/kmYTAr2iBSBNeDp/xBM/ppi92VF7mOqgJdil1uZ\n4n4Dd/a0LAcJAXHgZX/Tdda6RH0EtW7R2ncjsOVynfhyOVYh/IgJ5uc9253y\nuLQwfsNW7ZuI91R4pCOa1k+mHKdqJVdTyijf2aK8i9zbUHiiry+rKVTCdaaT\nlBPwlk9FS0ZvGMa7kVH8YPrAIn3F9qKM84hcNwZi7rK+sVeCTo+7uhPKXw9E\nfyar5rsNeeWS8Wf0Bzy5bTX7g8+DZWPEE444h9viJFn/UEp78BkXk1+3us1e\ndtBTIV6MsbjwuKsytm/Ea81yqfcKOVK+bHMeeb2u6Cq+kH4Gz/ie/qgqtPPO\nHHJxgujhMXdxMn1RSTv3lGEOort9O0znlxQ8EclnbnAzhIWzGF7Py9entd/m\ntf+NHGMdMHBVukcyRQ8zCRcJ/jnJ8pyPc0PWt6w402GQ0LvH47Z5MrPIWAV8\ncAiMaT+BtKMsPr8kBeszVTaaUjmCLvIEddIvEAwJ+2q77WUvwOxzgeSJ+LK8\nTlkY\r\n=0iIS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4MHNPcqC8MPCsY1S7PkHW2oDm2squEeMi/znSdHrcJQIgLiZaCoBkCGx/M/lK4bik9qo3YuDl2SvFkQaB9msAbAs="}]},"_npmUser":{"name":"baatomaps","email":"baatomaps@gmail.com"},"directories":{},"maintainers":[{"name":"baatomaps","email":"baatomaps@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baato-js-client_1.2.1_1644898645306_0.2613987304833343"},"_hasShrinkwrap":false},"1.2.2":{"name":"@baatomaps/baato-js-client","version":"1.2.2","description":"js-client","main":"./dist/bundle.js","types":"index.d.ts","scripts":{"build":"rimraf ./dist && webpack --mode=production"},"author":{"name":"Kathmandu Living Labs Consult"},"license":"MIT","devDependencies":{"@babel/core":"^7.17.7","@babel/preset-env":"^7.16.11","@isaac.frontend/eslint-config-es6":"^3.0.0","acorn":"^8.7.0","babel-loader":"^8.2.3","babel-polyfill":"^6.26.0","eslint":"^6.8.0","rimraf":"^3.0.2","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.46.0","webpack-cli":"^4.9.2"},"dependencies":{"axios":"^0.21.1"},"repository":{"type":"git","url":"git@code.kathmandulivinglabs.org:osm-search/js-client.git"},"gitHead":"4c11a63f0396ca48bd071b52a4b0a16eccea2f87","_id":"@baatomaps/baato-js-client@1.2.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-9UQHKQo1MIoW999b5saaY2vJGy1UacBow8SUcuh5GOUxpQgGw/H14NhV6jIO7LXWlhHkAK7XsI0TWn6PmW2iog==","shasum":"657e1c55bf7a996e3b4c40ebfbe0002398397465","tarball":"https://registry.npmjs.org/@baatomaps/baato-js-client/-/baato-js-client-1.2.2.tgz","fileCount":53,"unpackedSize":983965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNqy+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFmA//U6HrJPUZS6bW2IvrTNrJ7pog7aLLqR1p6n6+jmIf1WUx/Tky\r\nB3pHLxc2YbR9BThhGDzgdBFXV1Z11HmM++JppyvjQZbYlPowpsL0RDI/ir3E\r\nry5dSim1LGc7giNPLSxE9Nyi12j6qgw6XFxcSlo9LZ0DxvMqYKTdOBwQ5ALo\r\nG3/dRx3NwS8DuefAyDP6REMrmIrcA3tq6udhhNAqXWGHVkhHv1DlZJHyZCD7\r\nKOQiH6MP25zp9Wn5XdsBZ2wnyhhwB/wiS8azq+4UG8RzREIjScrw3UnGrMkj\r\nW9lJFCXm0ua8Kcv0NDTqwOKixb4VCqlsyJxgPDfEsTGEsr4c6jhQfhttHWrO\r\nlO+/OGvcIbgeoa5aDXmAf/9tbjaFI68yVRKeXlBjjRHvoAV0WsxEZqCCyPDj\r\ne5NV3VlexbS4Xoi5M1UlG5HiKsTvY+vYXTAHmT3EjMrH+IG4wNWnmKji1jjN\r\n3p5Rk+G8b/c1iLvxkW62KpXUkidYn3TNHo0Wes37NmT4y7YeYGGngSqrY+Eg\r\nbl4RsF2+CZujQiw1LMrVL3LTBw6tkpk3Jl6gEbf1YZSTIOwWMnPiQzXypMCI\r\npNW6tW4hdr7d85W1e18h64U1QpkAnDfr3A+zJGu9CMoWH1X/xFCfRxokwJS2\r\n1jFXP1gPwgmC/n0pCabkzfDEtex/c5OeVwk=\r\n=5jQM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrXKBLybOJmquJji7Q4zHB0StiVi3OvKYV/4md7RLlNgIgMR5gJ2itelYsRWoWdfjBTrSiR2I0mzxgo6tjWmZwcPI="}]},"_npmUser":{"name":"baatomaps","email":"baatomaps@gmail.com"},"directories":{},"maintainers":[{"name":"baatomaps","email":"baatomaps@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baato-js-client_1.2.2_1647750333984_0.12782851037218146"},"_hasShrinkwrap":false},"1.3.0":{"name":"@baatomaps/baato-js-client","version":"1.3.0","description":"js-client","main":"./dist/bundle.js","types":"index.d.ts","scripts":{"build":"rimraf ./dist && webpack --mode=production"},"author":{"name":"Kathmandu Living Labs Consult"},"license":"MIT","devDependencies":{"@babel/core":"^7.17.7","@babel/preset-env":"^7.16.11","@isaac.frontend/eslint-config-es6":"^3.0.0","acorn":"^8.7.0","babel-loader":"^8.2.3","babel-polyfill":"^6.26.0","eslint":"^6.8.0","rimraf":"^3.0.2","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.46.0","webpack-cli":"^4.9.2"},"dependencies":{"axios":"^0.21.1"},"repository":{"type":"git","url":"git@code.kathmandulivinglabs.org:osm-search/js-client.git"},"gitHead":"c79bb7bd1e6009adc9df5d36a106d110704106d6","_id":"@baatomaps/baato-js-client@1.3.0","_nodeVersion":"16.14.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-bCPfTjd11VHhLli4KdKwq6xVUtR+MrcAhOFweDunTaEpj25uZ2pIx4e8Fg62TYsYKxFh77JFCvbKxb96stJ+EA==","shasum":"5cae2606c7e23d5ed622938c9346fd68bc28fa2d","tarball":"https://registry.npmjs.org/@baatomaps/baato-js-client/-/baato-js-client-1.3.0.tgz","fileCount":53,"unpackedSize":983657,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBl4HCkkE6BSNqUTBZkBvQ6NsNl6UmWnZ8ispPS+TSZIAiAhnceWgUshTgmgh+b/dTdf2d2wdWNGDjyP5yGXTuw0og=="}]},"_npmUser":{"name":"baatomaps","email":"baatomaps@gmail.com"},"directories":{},"maintainers":[{"name":"baatomaps","email":"baatomaps@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baato-js-client_1.3.0_1692159718251_0.9298844363256578"},"_hasShrinkwrap":false},"1.5.0":{"name":"@baatomaps/baato-js-client","version":"1.5.0","description":"js-client","main":"./dist/bundle.js","types":"index.d.ts","scripts":{"build":"rimraf ./dist && webpack --mode=production"},"author":{"name":"Kathmandu Living Labs Consult"},"license":"MIT","devDependencies":{"@babel/core":"^7.17.7","@babel/preset-env":"^7.16.11","@isaac.frontend/eslint-config-es6":"^3.0.0","acorn":"^8.7.0","babel-loader":"^8.2.3","babel-polyfill":"^6.26.0","eslint":"^6.8.0","rimraf":"^3.0.2","uglifyjs-webpack-plugin":"^2.2.0","webpack":"^4.46.0","webpack-cli":"^4.9.2"},"dependencies":{"axios":"^0.21.1"},"repository":{"type":"git","url":"git@code.kathmandulivinglabs.org:osm-search/js-client.git"},"gitHead":"85364cc9106846b96aa5c2da0e0d1f0002d4634a","_id":"@baatomaps/baato-js-client@1.5.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-m8gP+qCXyJ8JSTMEufX8dy57oa3KHLTz72vJvw2Aqn/+W1KGAwcYf5KQqIFEX1sxDMAbJShwjdyDktBjGc6gBQ==","shasum":"75642e0ef984216bf40475d7b9bf97ec19ff6e1d","tarball":"https://registry.npmjs.org/@baatomaps/baato-js-client/-/baato-js-client-1.5.0.tgz","fileCount":53,"unpackedSize":984535,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+tNCvxlN4R0yh7vFeik5YAl4yS+M5Sbx7kLMSrhJblwIhANmRfI8MCzPX+dVS/u9MOgXUOdu2wR1z1jG2USxeUIEX"}]},"_npmUser":{"name":"baatomaps","email":"baatomaps@gmail.com"},"directories":{},"maintainers":[{"name":"baatomaps","email":"baatomaps@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baato-js-client_1.5.0_1713862755709_0.3722055379567837"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-06T08:06:00.391Z","1.2.0":"2022-02-06T08:06:00.668Z","modified":"2024-04-23T08:59:16.083Z","1.2.1":"2022-02-15T04:17:25.480Z","1.2.2":"2022-03-20T04:25:34.130Z","1.3.0":"2023-08-16T04:21:58.464Z","1.5.0":"2024-04-23T08:59:15.876Z"},"maintainers":[{"name":"baatomaps","email":"baatomaps@gmail.com"}],"description":"js-client","repository":{"type":"git","url":"git@code.kathmandulivinglabs.org:osm-search/js-client.git"},"author":{"name":"Kathmandu Living Labs Consult"},"license":"MIT","readme":"<h1>@baatomaps/baato-js-client</h1>\n\n<p>\n  <a href=\"https://www.npmjs.com/package/@baatomaps/baato-js-client\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/@baatomaps/baato-js-client.svg\">\n  </a>\n  <a href=\"#\" target=\"_blank\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-green.svg\" />\n  </a>\n</p>\n\n> Client library for easily integrating [Baato.io](http://baato.io/)'s services into your project\n\n## Installation\n\nUsing npm:\n\n```sh\n$ npm install --save @baatomaps/baato-js-client\n```\n\n## Features\n\nThe Baato JavaScript client library makes it easy to integrate the [Baato API](https://baato.io) into existing web-based front-end projects. This package acts as a wrapper for the following Baato services:\n\n- [Search API](https://docs.baato.io/#/v1/services/search)\n- [Reverse Search API](https://docs.baato.io/#/v1/services/reverse)\n- [Places API](https://docs.baato.io/#/v1/services/places)\n- [Directions API](https://docs.baato.io/#/v1/services/directions)\n\n## Usage\n\n### Search API\n\nThe `Baato.Search()` constructor can be used to make requests to the Search API.\n\n```js\nimport Baato from \"@baatomaps/baato-js-client\";\n\nconst search = new Baato.Search()\n  .setApiVersion(\"1.0\") // default\n  .setBaseUrl(`https://api.baato.io/api`) // detault Baato base URL\n  .setKey(\"YOUR_BAATO_ACCESS_TOKEN\")\n  .setQuery(\"kathmandu\") // string query to search for\n  .setLimit(5) // limit the number of responses\n  .doRequest()\n  .then((response) => {\n    console.log(response); // search response\n  });\n```\n\n### Reverse Search API\n\nThe `Baato.Reverse()` constructor can be used to make requests to the Reverse Search API.\n\n```js\nimport Baato from \"@baatomaps/baato-js-client\";\n\nconst reverse = new Baato.Reverse()\n  .setApiVersion(\"1.0\") // default\n  .setBaseUrl(`https://api.baato.io/api`) // detault Baato base URL\n  .setKey(\"YOUR_BAATO_ACCESS_TOKEN\")\n  .setCoordinates([latitude, longitude]) // coordinates to reverse geocode\n  .setLimit(5) // limit the number of responses\n  .doRequest()\n  .then((res) => {\n    console.log(res); // reverse-search response\n  });\n```\n\n### Places API\n\nThe `Baato.Places()` constructor can be used to make requests to the Places API.\n\n```js\nimport Baato from \"@baatomaps/baato-js-client\";\n\nconst search = new Baato.Places()\n  .setApiVersion(\"1.0\") // default\n  .setBaseUrl(`https://api.baato.io/api`) // detault Baato base URL\n  .setKey(\"YOUR_BAATO_ACCESS_TOKEN\")\n  .setPlaceId(\"110023\")\n  .doRequest()\n  .then((response) => {\n    console.log(response); // place response\n  });\n```\n\n### Directions API\n\nFor getting single best route.\n\n```js\nimport Baato from \"@baatomaps/baato-js-client\";\n\nconst points = [\"27.71772,85.32784\", \"27.73449,85.33714\"];\n\nconst bRouting = new Baato.Routing({\n  key: \"YOUR_BAATO_ACCESS_TOKEN\",\n})\n  .setApiVersion(\"1.0\") // default\n  .setBaseUrl(`https://api.baato.io/api`) // detault Baato base URL\n  .setKey(\"YOUR_BAATO_ACCESS_TOKEN\")\n  .addPoints(points) // points for which route is to be calculated\n  .setVehicle(\"car\") // one of car, bike, or foot\n  .getBest()\n  .doRequest()\n  .then((response) => {\n    console.log(response); // directions response\n  });\n```\n\nFor also including alternative routes. Only supports two points. Adding more than two points will return in an error response.\n\n```js\nimport Baato from \"@baatomaps/baato-js-client\";\n\nconst points = [\"27.71772,85.32784\", \"27.73449,85.33714\"];\n\nconst bRouting = new Baato.Routing({\n  key: \"YOUR_BAATO_ACCESS_TOKEN\",\n})\n  .setApiVersion(\"1.0\") // default\n  .setBaseUrl(`https://api.baato.io/api`) // detault Baato base URL\n  .setKey(\"YOUR_BAATO_ACCESS_TOKEN\")\n  .addPoints(points)\n  .setVehicle(\"car\") // one of car. bike, or foot\n  .getAlternatives()\n  .doRequest()\n  .then((response) => {\n    console.log(response); // directions response\n  });\n```\nFor elevation  add `getElevation()`.\n### Converting into GeoJSON\n\nTo get the results in GeoJSON format, use one of our utilities `Baato.Util().getGeoJsonFromSearchResults(res)` and pass the response as argument from one of the above features.\n\n```js\n// res is the response\nconst geojson = new Baato.Util().getGeoJsonFromSearchResults(res);\n```\n","readmeFilename":"README.md"}