{"_id":"@api-blueprints/pathmaker","_rev":"6-35916d7840652db1de55c4d3c33749ad","name":"@api-blueprints/pathmaker","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@api-blueprints/pathmaker","version":"1.0.0","description":"Structure and send API calls with ease","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"type":"module","author":{"name":"YodaLightsabr"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/YodaLightsabr/api-pathmaker.git"},"keywords":["apis","tools"],"bugs":{"url":"https://github.com/YodaLightsabr/api-pathmaker/issues"},"homepage":"https://github.com/YodaLightsabr/api-pathmaker#readme","_id":"@api-blueprints/pathmaker@1.0.0","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-Fwhe4FkuqjbM+UNjhCsLQzlL18S+P+r7iw9PY2ve7i5tMQ6aSl3jyPYQwhd/dTltdr18RP8qZyUYQ78klY6AGQ==","shasum":"1730af1fccc6ca6ebd5f1afaf253cfe6fd06c069","tarball":"https://registry.npmjs.org/@api-blueprints/pathmaker/-/pathmaker-1.0.0.tgz","fileCount":3,"unpackedSize":10228,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC647KVKOQazBOHLRNVQULyeskGCRPM/61ClzKQwHln6gIhALrQ4mN+kRbWeK1HPZr1j1i9/Trqp5aE1KGSrEPBJpSh"}]},"_npmUser":{"name":"yodalightsabr","email":"ylsbr+npm@googlegroups.com"},"directories":{},"maintainers":[{"name":"yodalightsabr","email":"ylsbr+npm@googlegroups.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pathmaker_1.0.0_1635032572731_0.46153777905368343"},"_hasShrinkwrap":false},"1.1.0":{"name":"@api-blueprints/pathmaker","version":"1.1.0","description":"Structure and send API calls with ease","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"type":"module","author":{"name":"YodaLightsabr"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/YodaLightsabr/api-pathmaker.git"},"keywords":["apis","tools"],"bugs":{"url":"https://github.com/YodaLightsabr/api-pathmaker/issues"},"homepage":"https://github.com/YodaLightsabr/api-pathmaker#readme","dependencies":{"node-fetch":"^3.0.0"},"gitHead":"a9e20cf6b43aede0588f4549623ed622a0ebc4a5","_id":"@api-blueprints/pathmaker@1.1.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HFfU9xd7AxVUcNdStUxV6mFSTrfi1Yl72jmLddTkca/L5SpIhjNZ6lyTPXrE1fS/4pcWRUl1DKpIoUMJ2jctsQ==","shasum":"75eb429188eb1748d9c06d835878572a454dae4d","tarball":"https://registry.npmjs.org/@api-blueprints/pathmaker/-/pathmaker-1.1.0.tgz","fileCount":3,"unpackedSize":10473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwye7CRA9TVsSAnZWagAAshwP/3jN/Agovg2Ulf9kCrmW\ncAYK4np4CdOHWZ0XGzpUPvJAV6x9Iuof8payV5uzlEXaxzUIcU1BFHhHs/I+\nXjbbmA9wgERhLwNGtvmT56Wyl2dm8trxF/GS1SC6kjsstSgoAenLsJNT5u2v\nizW67m05PoKFjgTzcEc4WPL3pbpmEvSFGuOnWC0hBCtkMsoQwIy4/M/aAcIw\nifpBuz84EenVMRPonCI02kK8o6W4q8CElQrusiA7klhwXae/vDkPdQqLCzh2\nopWGhjjjaefYwDj90hF/vgsGa2Y1Zns6ZRfdh6ogZV/0XF6bv3VHVHR9Csl+\nAdLlkaN+Fx3ujOl+HGT/DiinlEc5FnloryuXFdofXhB8l2X047wP81GhQp+f\nD/wbZauaq9Oex93QeKn+Il/ScphFXaJXFE6Aj304ccGN4nZGIGrjpWR9XaEh\nziHXs06kcLdpMZhdXiWIqOrRwSLmF8OsD/2u5BRPRZiRLWXhrxisLEtGLbds\nmW2nNj5MkK1zGvy9l9aKTmkeK7oxUSnE7xEKKN+7r1/CxaWEQvypSx6WTGeK\n9oH1auK9CiCZnkjcVZGfU0cOfjEeQYbiVBI8IziBWD+sKz/97vOeN4hPfTep\n2lVfEKcoZE269hmZXzOy9o/gWmcnKQDdMSFSNqQlwEBjIfiXCKfl1G318+Zv\n1jkm\r\n=PAwH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8eKORYPwl/hsDQ4Pu6JAX3el8b1vqHpLNmr5WuCD2VAIhAOQBgXtrU9I8DlRuUX8kzLURmIj2sqwx8c7R0hbFb+A8"}]},"_npmUser":{"name":"yodalightsabr","email":"ylsbr+npm@googlegroups.com"},"directories":{},"maintainers":[{"name":"yodalightsabr","email":"ylsbr+npm@googlegroups.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pathmaker_1.1.0_1635261757202_0.7296652415774791"},"_hasShrinkwrap":false},"1.2.0":{"name":"@api-blueprints/pathmaker","version":"1.2.0","description":"Structure and send API calls with ease","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"type":"module","author":{"name":"YodaLightsabr"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/YodaLightsabr/api-pathmaker.git"},"keywords":["apis","tools"],"bugs":{"url":"https://github.com/YodaLightsabr/api-pathmaker/issues"},"homepage":"https://github.com/YodaLightsabr/api-pathmaker#readme","dependencies":{"node-fetch":"^3.0.0"},"gitHead":"a9e20cf6b43aede0588f4549623ed622a0ebc4a5","_id":"@api-blueprints/pathmaker@1.2.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Wjsq4Z/lrXAM0jnGBpMiwPHHA1wRteCShfqQpO6AjJUzmrXFSZF5nYQiMa9hNXZ3qZWvUsucb3Vm7q8TnfttnA==","shasum":"5cf05c6cc8a6ee01fbb03b1147bd2c0ec22c2863","tarball":"https://registry.npmjs.org/@api-blueprints/pathmaker/-/pathmaker-1.2.0.tgz","fileCount":3,"unpackedSize":11104,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7z3XZPHjnyLhVdTzjIoFMNAaLs3BrYtxtNbSLhFCXPgIgdGZ85+YQh/I/Tka1cH9l+7Oc+MIbwqwBAktKN64ef5A="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNJFBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDUQ//dKiZ4hABX+tDSYZy2RVnc33Ra15QiHipejI85g+oe6W/OHDK\r\n947rnvguAofd9MIrDetc2V8K3ySk9YnRrS1jqp6D4MybUW7SuvyQthPb3hv1\r\nMxJoCBSb9e3vSuHaaNFAWkz0ThW7Ruzf8nywLgySvMDZS9ZUFBqZsOYPTiNd\r\ng782vkWDZ1hB4KHk8vRrJYKsRxDcblbNGy/gKy9Utqv/OdtPjnpyL2VADNqn\r\nq6Uop55T6w76k2wz1/AbIwK11g4HECwsiMt8X0zSfDXRu/2s+2BeDZt5NVEi\r\nqHeRjeAoy25iJfnxoT8S9efPXk04eCFokcNKX3c649cpl+75gPTT/kXGGR8w\r\nPyr/8nTG8XuHeQgY6M8212KlJOWLrwvrn/LSapMeftrNBU3WHFuHPjuihYAq\r\nnhUCbOBAVWZuQb8JG6OsjQ4q/ALetaW23ASNXAqdaY6lClP0XGkSO+ay84Ay\r\nJ9yVzuI/Z1FnmMQj+12E1M32aafUXKwUsSAFf7YkgtoQVtiFTmLfJtpzggtO\r\nubgVh1QFTSTLVfpWfumRLneXv2QHvqclVo5f/SVqEvYqcJkvgsPIUyHo1jQF\r\nptWD8czmRyxyIOEXQi/H3BwpuRLIdg91rqlfH9UVcpIlkK7NlXs9/tC7lNKj\r\n4YQcUdD9YDy/vhSuG9c1++7eCFyvlhcdOGg=\r\n=xiJe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"yodalightsabr","email":"yoda@yodacode.xyz"},"directories":{},"maintainers":[{"name":"yodalightsabr","email":"yoda@yodacode.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pathmaker_1.2.0_1664389440911_0.10167877539561432"},"_hasShrinkwrap":false},"1.2.1":{"name":"@api-blueprints/pathmaker","version":"1.2.1","description":"Structure and send API calls with ease","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npx tsup src"},"author":{"name":"YodaLightsabr"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/YodaLightsabr/api-pathmaker.git"},"keywords":["apis","tools"],"bugs":{"url":"https://github.com/YodaLightsabr/api-pathmaker/issues"},"homepage":"https://github.com/YodaLightsabr/api-pathmaker#readme","dependencies":{"node-fetch":"^2.6.7"},"devDependencies":{"tsup":"^6.5.0"},"gitHead":"e7c4cf94e5ecd6e39e08d4e4a4b75accbf66af41","_id":"@api-blueprints/pathmaker@1.2.1","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-XifH3abSQX7N5bWXXJKj0cMdBcX9tUy7uX2GOZIns6zljsyPhhvcXqNoMTmBsquS7QndJUhMYMixqeePkBcXuw==","shasum":"b7dd24ae0db7c415f39c274b316849396e9beb74","tarball":"https://registry.npmjs.org/@api-blueprints/pathmaker/-/pathmaker-1.2.1.tgz","fileCount":5,"unpackedSize":25606,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAIB4ECycZyt7V8+tjjK1k8brH+ZVe2rXKZvK0kZ07KDAiEAxyTVCZ4ecrc5rx7OeznubyOB49spBNghBfnUexZPc30="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgUm/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrodhAAjElcSlyAstmtaCJp1bRVjXNJmrADd6OtaRpLINSAh52UtgIl\r\nxYSCrDbmvl4vo+FCRxR1yo1ItlAOQOK1kTjEDbNX1GnSuFTNu9BJTL7YTxpN\r\nb5RhCPb9F2KAgrAK8lRj9c/eHaeTN/kZv3AQIwPeFGbZcyhr9GBQ9FDPPXLF\r\nBCFHVvdwbLAzXOl2vBG8/MXk8Z1qn7jY+P8SpbczzWK/zCu/vq2ny4ufp+Ts\r\nfGPARu0ZLg9VWGGuPJnN5M6RPyjK7IeNw49wXcZ++U/7vhzvR/xhT9nKj60/\r\n48jtvrzrQAdKh86e+lloCQJ6RaJFJVPeJkoTAFSRmtn6936jNlSb3ilYMciH\r\n1u88LKBooBTxTOFxrF+kToUtmmjryE+oGl1nRz08ESakAYaoKYZuEFVm871p\r\nL78IZF/qv0hXHukm5v6ymCl7sFrQvBBSdoBAmP3ogWBXZuLzRR3J2KQvA8DP\r\nyy2wod4STjHDd0oroOe12kN8KO600wA1jHZHT8P8Lrhe/bAFIzLebWFS5F1D\r\ngbUwunE/ia/4YSTPa+vOKDDOdbI2ZQchrPGxxCDJJrUrCKOxrqFGflM9yjLH\r\nlFzMqLa6BSqEbCIvGwBR2iYZdVIFqh9XykBadkUKk4sWjhnfcziUMuBjd6nZ\r\nTTMZsO67ito8nBiHueCQneELaFLd5HSCoG0=\r\n=vWZ0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"yodalightsabr","email":"yoda@yodacode.xyz"},"directories":{},"maintainers":[{"name":"yodalightsabr","email":"yoda@yodacode.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pathmaker_1.2.1_1669417407539_0.3154776406040307"},"_hasShrinkwrap":false},"1.3.0":{"name":"@api-blueprints/pathmaker","version":"1.3.0","description":"Structure and send API calls with ease","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npx tsup src"},"author":{"name":"YodaLightsabr"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/YodaLightsabr/api-pathmaker.git"},"keywords":["apis","tools"],"bugs":{"url":"https://github.com/YodaLightsabr/api-pathmaker/issues"},"homepage":"https://github.com/YodaLightsabr/api-pathmaker#readme","dependencies":{"node-fetch":"^2.6.7"},"devDependencies":{"tsup":"^6.5.0"},"gitHead":"bdb1cbe2344c7d5e9cba716dff08e1a67bdbffdb","_id":"@api-blueprints/pathmaker@1.3.0","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-mClohFGKes4S5KlFr/KrD5PuGG8fROsxdbwLVSx21MMzjUEkUf6E/3DAR1mQboLFJdVtCBydIaJ7017CaN+rBw==","shasum":"e8983757831fdb3c1c315f7a757ae68eafbeee8a","tarball":"https://registry.npmjs.org/@api-blueprints/pathmaker/-/pathmaker-1.3.0.tgz","fileCount":5,"unpackedSize":28180,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx//ns2dvOmxBcS70Q/3IAi0Ynf6g1C1ArA62w2kdhMQIhAMtFsuWjG+OxtzlArVni6Tdu+vBg56xwgT2JtDFsWp6n"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgmTkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQvhAAi9S7C43B/ZbJKWLqsIFV5k9yDqHW4FbvVnk9L72Lpy8GajDK\r\nbM+ffif6iuZfNx1M+oGffAl3qB6Xu4VkVBpguLxxZ47A6o0s9rQAqaSmJNU/\r\n6v5xMUQ39x0zrIbVxH8C9paBNi5sNheWXKdBG2fFpfoo/YCYsJielHPu6gLs\r\nCUTLPub0IVt7gkaw2xubv7ACYaf71jZdAPYdd2tb8VpYOip3c/UXw8XWYke7\r\nrtc+j8bcmU5/NjS1yVPJX3xHLSyhgDqSSPfelU2nrdEmgdM9VgDSW0/SYr4O\r\nSA2QLpJ1vYJWE+Wg7ZKbt2931AiF96tWiaV14uMYlE1IHI4WXdSD8i7NAQem\r\ns5Ce8DxqkawZrQXM0iyNiogt+eoHghykkv81HUwgvzjKcnOC8CzkX2+MJLz6\r\n3/ZLAiXHfeRoGW4zdsvbtFn2dCYwB/bmGRAwqqPuMIFGwsawaW42YzWlvmT2\r\nk1+gApEa2M1272FoJQT9Rvpa3L6lbmgmLvEdvH9zT6V/Xm8gHrlGadqDOPWA\r\n0l6qhlx1Dk5Q4YvGm/QsydPO2Lu9klXNkzxvwkI8dy8WyMgEX0s+n+prAdRy\r\ni8OlBlGXXPJcPmeXx5zHTUWC1gRQFg6glN2oXLc3sO94Ob79WbVoZ++kQ0hd\r\nwRsdG2LVb/dZfGAaGdTN4B2WrEVCBLyZI2k=\r\n=Hzmw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"yodalightsabr","email":"yoda@yodacode.xyz"},"directories":{},"maintainers":[{"name":"yodalightsabr","email":"yoda@yodacode.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pathmaker_1.3.0_1669489892310_0.32093766857570816"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-23T23:42:52.680Z","1.0.0":"2021-10-23T23:42:52.871Z","modified":"2022-11-26T19:11:32.554Z","1.1.0":"2021-10-26T15:22:37.359Z","1.2.0":"2022-09-28T18:24:01.073Z","1.2.1":"2022-11-25T23:03:27.736Z","1.3.0":"2022-11-26T19:11:32.465Z"},"maintainers":[{"name":"yodalightsabr","email":"yoda@yodacode.xyz"}],"description":"Structure and send API calls with ease","homepage":"https://github.com/YodaLightsabr/api-pathmaker#readme","keywords":["apis","tools"],"repository":{"type":"git","url":"git+https://github.com/YodaLightsabr/api-pathmaker.git"},"author":{"name":"YodaLightsabr"},"bugs":{"url":"https://github.com/YodaLightsabr/api-pathmaker/issues"},"license":"MIT","readme":"# API Pathmaker\nStructure and send API calls that make sense in JS\n\n![NPM version](https://img.shields.io/npm/v/@api-blueprints/pathmaker)\n\n## Imagine a scenario...\nYou need to add an API into your app. There isn't a JS client for it, so you'll have to use messy HTTP requests instead of clean JavaScript code. You could...\n\nConstruct a messy fetch function to send your request\n```js\nimport fetch from 'node-fetch';\n\nfetch('https://cat-photos-api.xyz/find_cat_photo', {\n  method: 'POST',\n  headers: {\n    'Authorization': 'Bearer UwU-uwu-oWo-0W0',\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify({\n    limit: 100\n  })\n}).then(response => await response.json()).then(json => {\n  // now you can do something\n});\n\nfetch('https://cat-photos-api.xyz/upload_cat_photo', {\n  method: 'POST',\n  headers: {\n    'Authorization': 'Bearer UwU-uwu-oWo-0W0',\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify({\n    url: 'https://my-cat-photos.uwucdn.com/my-cat-photo-no-238'\n  })\n}).then(response => await response.json()).then(json => {\n  // now you can do something\n});\n```\n\nOR construct a clean API template that works with as many API calls as you need\n```js\nimport API from '@api-blueprints/pathmaker';\n\nconst api = new API({\n    headers: {\n        'Authorization': 'Bearer UwU-uwu-oWo-0W0',\n        'Content-Type': 'application/json'\n    },\n    baseUrl: 'https://cat-photos-api.xyz'\n});\n\napi.find_cat_photo.post({ limit: 100 }).then(data => { /* do something */ });\napi.upload_cat_photo.post({ url: 'https://my-cat-photos.uwucdn.com/my-cat-photo-no-238' }).then(data => { /* do something */ });\n```\n\n\n## Documentation\n### default class API ( object )\n - `object.headers`: Default headers. Common ones include Authorization and Content-Type\n - `object.baseUrl`: Base URL for this API. Should not have a `/` at the end\n - `object.inputParser`: A function to convert the input into a server-readable format. Defaults to JSON.stringify\n - `object.outputParser`: A function to parse the server output. Defaults to JSON.parse\n\n#### Constructing a URL\n\nTo construct a URL, start by accessing a property on the API instance. Each property acts as a path. To access `<baseURL>/boo/bar`, use `api.foo.bar`. To specify an unknown parameter, use the JavaScript `[]` syntax. For example, you can access `<baseURL>/documents/:documentNumber`, use `api.documents[documentNumber]`.\n\n#### Search params\nNew in version 1.2.0, you can use the `.searchParams()` method to attach query params to the end of a url. Just pass in an object of keys and values.\n\n#### Sending a request\n\nTo send a request that you've constructed, just run `.get()`, `.post()`, `.patch()`, etc. API Pathmaker works with GET, HEAD, POST, PUT, DELETE, PATCH, and OPTIONS requests. These are all async functions where you can pass in data to send to the API. You can also get the URL of the request without sending it by accessing the `._url` property.\n\n#### URLs containing HTTP method names\n\nYou might have noticed that if you try to access `<baseURL>/route/get` by using `api.route.get.get()`, it won't work. You can work around this by using `api.route._absolute('get')`.","readmeFilename":"README.md"}