{"_id":"@testlio/discovered-request","_rev":"40-d9f39d450b8fd4a68d94aaecbacd603d","name":"@testlio/discovered-request","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@testlio/discovered-request","version":"1.0.0","keywords":["http","request"],"author":{"name":"Testlio"},"license":"ISC","_id":"@testlio/discovered-request@1.0.0","maintainers":[{"name":"martr","email":"mart@testlio.com"}],"dist":{"shasum":"c3708a256eae5c26acd5ebbd93ef4a0f3442ac6f","tarball":"https://registry.npmjs.org/@testlio/discovered-request/-/discovered-request-1.0.0.tgz","integrity":"sha512-Mtk7uw6mAbIMbx0wFREtuRA7dgd6mB4OJKVlvrFxb3O7jbJtJUSJrgk/SafIkbrLe1SWwpKotY36ZgKPhNcMjg==","signatures":[{"sig":"MEQCIHI79r2lH7nm0wMc1Uo6OP0ZIt+e9ehN0ZM0S2DQX0/XAiBsSHEqgYdgRPyGI5H76+sa8v8LOjSbeit7bwoEJ5sNSA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/request.js","_from":".","_shasum":"c3708a256eae5c26acd5ebbd93ef4a0f3442ac6f","gitHead":"8bce57c911b81823b7ee30ae28878a3970c4f6ec","scripts":{"lint":"eslint .","test":"tape 'test/*-test.js' | tap-spec"},"_npmUser":{"name":"martr","email":"mart@testlio.com"},"repository":{"url":"github.com:Testlio/request-tools.git","type":"git"},"_npmVersion":"2.15.1","description":"Helper library for making http requests through discovery","directories":{},"_nodeVersion":"4.4.4","dependencies":{"lodash":"^4.12.0","request-promise":"^3.0.0"},"devDependencies":{"tape":"^4.5.1","eslint":"^2.9.0","tap-spec":"^4.1.1","proxyquire":"^1.7.7","@testlio/eslint-config-services":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/discovered-request-1.0.0.tgz_1464013354543_0.5026533431373537","host":"packages-16-east.internal.npmjs.com"},"deprecated":"Deprecated: discovery-based requests removed. Build the URL from your API base directly (BLUE-11626). No replacement."},"1.0.1":{"name":"@testlio/discovered-request","version":"1.0.1","keywords":["http","request"],"author":{"name":"Testlio"},"license":"ISC","_id":"@testlio/discovered-request@1.0.1","maintainers":[{"name":"batweasel","email":"virgo@testlio.com"},{"name":"escane","email":"escane@gmail.com"},{"name":"georgetestlio","email":"george@testlio.com"},{"name":"henri","email":"henri@testlio.com"},{"name":"jekaterina","email":"jekaterina@testlio.com"},{"name":"kaarelkk","email":"kaarelkk@gmail.com"},{"name":"kaarelp","email":"kaarel.purde@testlio.com"},{"name":"kirstein","email":"mikk@kolmas.org"},{"name":"kschotter","email":"kairi@testlio.com"},{"name":"martinraag","email":"martin@testlio.com"},{"name":"martr","email":"mart@testlio.com"},{"name":"mkruustu","email":"marko@testlio.com"},{"name":"rasmus-testlio","email":"rasmus@testlio.com"},{"name":"valdo","email":"valdo@testlio.com"}],"dist":{"shasum":"f9847d7034bb04e5b4e8a274e5fda7d9993a2432","tarball":"https://registry.npmjs.org/@testlio/discovered-request/-/discovered-request-1.0.1.tgz","integrity":"sha512-m3cLXRZY8HEPFfme/+HfLsam8VyRsQ1Xp0Z0FHf2soypBOjSmhK/PtP0K9ixo11Nh5i1xzmnk+ebi0sXlaXkDw==","signatures":[{"sig":"MEYCIQDzP/lXmZnxIeKj4sZ08tS966/IslJfV+XyIjtAODhqsQIhAKNwLc+DwZgO1z27KKJbPLJCrTfaHUDkNYnXukO221Xv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/request.js","_from":".","_shasum":"f9847d7034bb04e5b4e8a274e5fda7d9993a2432","gitHead":"b285e9f79f53713ee61f1daa27d4b4a1253ad066","scripts":{"lint":"eslint .","test":"tape 'test/*-test.js' | tap-spec"},"_npmUser":{"name":"kirstein","email":"mikk@kolmas.org"},"repository":{"url":"github.com:Testlio/request-tools.git","type":"git"},"_npmVersion":"2.15.1","description":"Helper library for making http requests through discovery","directories":{},"_nodeVersion":"4.4.4","dependencies":{"lodash":"^4.12.0","request-promise":"^3.0.0"},"devDependencies":{"tape":"^4.5.1","eslint":"^2.9.0","tap-spec":"^4.1.1","proxyquire":"^1.7.7","@testlio/eslint-config-services":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/discovered-request-1.0.1.tgz_1464015435089_0.650559097295627","host":"packages-12-west.internal.npmjs.com"},"deprecated":"Deprecated: discovery-based requests removed. Build the URL from your API base directly (BLUE-11626). No replacement."},"1.1.0":{"name":"@testlio/discovered-request","version":"1.1.0","keywords":["http","request"],"author":{"name":"Testlio"},"license":"ISC","_id":"@testlio/discovered-request@1.1.0","maintainers":[{"name":"batweasel","email":"virgo@testlio.com"},{"name":"dentuzhik","email":"dentuzhik@gmail.com"},{"name":"escane","email":"escane@gmail.com"},{"name":"georgetestlio","email":"george@testlio.com"},{"name":"henri","email":"henri@testlio.com"},{"name":"jekaterina","email":"jekaterina@testlio.com"},{"name":"kaarelkk","email":"kaarelkk@gmail.com"},{"name":"kirstein","email":"mikk@kolmas.org"},{"name":"kschotter","email":"kairi@testlio.com"},{"name":"martinraag","email":"martin@testlio.com"},{"name":"martr","email":"mart@testlio.com"},{"name":"mklopets","email":"mklopets@gmail.com"},{"name":"mkruustu","email":"marko@testlio.com"},{"name":"rasmus-testlio","email":"rasmus@testlio.com"},{"name":"testlio-ci","email":"martin+npmjs@testlio.com"},{"name":"valdo","email":"valdo@testlio.com"}],"dist":{"shasum":"00afbd25a68bf31e66d1b6db3b12d8063db66637","tarball":"https://registry.npmjs.org/@testlio/discovered-request/-/discovered-request-1.1.0.tgz","integrity":"sha512-CsV37NieRtSmuXgUr1+VittNsLd0IKghUqE+8k2nSIwPMbfQIV69DJdovH2uxD+ZDkDyYX7N3B4vZlPCUVhlKw==","signatures":[{"sig":"MEUCIQDzRDWw4BS0LvxpWHbvGKqqncFPCdTwU5L54qgOAgbwiwIgfJkU3sMpiqwxn6u6BlZrYd4r1CBohdNWlkRop9EtNS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/request.js","_from":".","_shasum":"00afbd25a68bf31e66d1b6db3b12d8063db66637","gitHead":"967720b4bfac0072b7d31233f2abead2c3aa6b81","scripts":{"lint":"eslint .","test":"tape 'test/*-test.js' | tap-spec"},"_npmUser":{"name":"georgetestlio","email":"george@testlio.com"},"repository":{"url":"github.com:Testlio/request-tools.git","type":"git"},"_npmVersion":"2.14.12","description":"Helper library for making http requests through discovery","directories":{},"_nodeVersion":"4.3.2","dependencies":{"lodash":"^4.12.0","request-promise":"^3.0.0"},"devDependencies":{"tape":"^4.5.1","eslint":"^2.9.0","tap-spec":"^4.1.1","proxyquire":"^1.7.7","@testlio/eslint-config-services":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/discovered-request-1.1.0.tgz_1482419589239_0.7787796785123646","host":"packages-18-east.internal.npmjs.com"},"deprecated":"Deprecated: discovery-based requests removed. Build the URL from your API base directly (BLUE-11626). No replacement."},"1.1.1":{"name":"@testlio/discovered-request","version":"1.1.1","keywords":["http","request"],"author":{"name":"Testlio"},"license":"ISC","_id":"@testlio/discovered-request@1.1.1","maintainers":[{"name":"testlio-ci","email":"dev-services@testlio.com"}],"dist":{"shasum":"6f8888fdef362ba743eb27a19db457aedb0096fd","tarball":"https://registry.npmjs.org/@testlio/discovered-request/-/discovered-request-1.1.1.tgz","fileCount":15,"integrity":"sha512-AAHfrXnLMPH+GTOPl/iCMZGLhxET1v1b8+xbgYAOFgUzWbtzUMnbQ2RwqFr9xUcCZRCmUdDZ+Ry5CKBLdvJrrQ==","signatures":[{"sig":"MEQCIFuaCMjJklQCNTZ6rlKbAQU013UDj4t/G2j3ublsGyCQAiAEUt6bnXGfa1oKsrQaCL5N8sp1Y3ugKfuDKR7bal6Riw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdibwCCRA9TVsSAnZWagAAI3UP/0wHMZB4tm5/w+vSANnc\nYQ8/VSaQyCy4KZAESz+AG4WrgNG0ymgBd9E8HfVcl0xpaQYmZ4sec1rALX0o\n+wp3XJ5ERv+J0d0CKG9Y5wsKylLZVqXp8SjXVGIFRA9JMDikhAW3N6NVWBPP\nnjorG5lBAHEjUl5GXwqeKNT5uV1pzZVWgSeUTmAhHTIfCqW4VqBKuCTO+/F+\nf6tFeLVifn5ZlPvUBlBN6nH/jwN92pnfUnhrzI/dIqXqHlCpRX5/6N59DSi7\nBYkuJjL6IunHOXSEDRCnhYrS0k7fbQn+R6wnjedFhnuOLBjYbicppPj140R3\nApm1XmSIA+8E0KJKuzCxOnQoCiqv91nLHf00m258HWrg8m3UfjJNQvPBstMM\niWxuNCk4slRsGnsYkztEllu3SuE60fUtmGQpegJxgl8NsZW47ENsK4gGKR/k\nYNHfhHnSD8L9O9qjhY0qj1+8DgARXdHTqFu8q4JzWtbKLzK5PL5CGFMsaXxm\nerW0Bt8CJ/GSgr90J9jSBAzeki6U9ZyaVHCibUWR0p+/rCHmFSfhjceGYkCS\nyRkHH+QVQYiaUVZpk24LCkqEL1KuAOsCneWjmEJOepUA83v8/J2NhbcAGOWF\nFnQuavjN7E+pFV3RjIeK+Nt3RGPu1AraSjUq9ihSpj6ZIILbaKAesOw1E4Pg\nZOGk\r\n=WyUH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/request.js","gitHead":"039ddf373cbb0d4d9c3bba0d50b2e39f8bfd23c8","scripts":{"lint":"eslint .","test":"tape 'test/*-test.js' | tap-spec"},"_npmUser":{"name":"testlio-ci","email":"dev-services@testlio.com"},"repository":{"url":"github.com:Testlio/request-tools.git","type":"git"},"_npmVersion":"6.4.1","description":"Helper library for making http requests through discovery","directories":{},"_nodeVersion":"8.16.1","dependencies":{"lodash":"^4.12.0","request-promise":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tape":"^4.5.1","eslint":"^2.9.0","tap-spec":"^4.1.1","proxyquire":"^1.7.7","@testlio/eslint-config-services":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/discovered-request_1.1.1_1569307650307_0.16001198796982585","host":"s3://npm-registry-packages"},"deprecated":"Deprecated: discovery-based requests removed. Build the URL from your API base directly (BLUE-11626). No replacement."}},"time":{"created":"2016-05-23T14:22:35.711Z","modified":"2026-09-30T14:03:05.744Z","1.0.0":"2016-05-23T14:22:35.711Z","1.0.1":"2016-05-23T14:57:17.523Z","1.1.0":"2016-12-22T15:13:09.816Z","1.1.1":"2019-09-24T06:47:30.420Z"},"author":{"name":"Testlio"},"license":"ISC","keywords":["http","request"],"repository":{"url":"github.com:Testlio/request-tools.git","type":"git"},"description":"Helper library for making http requests through discovery","maintainers":[{"name":"roopeshvs","email":"hello@roope.sh"},{"name":"testlio-ci","email":"dev-services@testlio.com"},{"name":"viraj.premaratne","email":"viraj.premaratne@testlio.com"}],"readme":"# Discovered-request\nHelper library for making requests through discovery.\n\nIt will make discovery request to get the location of the resource you want to call and then call it. Library uses request-promise to make actual http requests. All the request options (except 'servicePath' and 'api') are the same as in request-promise. For more information how to build your request look at [request-promise](https://github.com/request/request-promise).\n\n##Installation\n```\nnpm install @testlio/discovered-request\n```\n\n## Usage\n\nLets call resource `browsers` in service named `browser` and at version 1. ServicePath: `browser.v1.browsers`\n\n```\n'use strict';\n\nconst request = require('@testlio/discovered-request');\n\nconst options = {\n    servicePath: 'browser.v1.browsers',\n    headers: {\n        'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJtYXJ0QHRlc3RsaW8uY29tIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.tMRlQfy2e1I0kfqrSJraPbBqgGnmIVrXj8ks-WBEJLg'\n    },\n    json: true\n};\n\nrequest(options).then((result) => {\n    console.log(result);\n}).catch((err) => {\n    console.log('Request failed');\n    console.log(err);\n});\n```\n\n## Usage without discovery\n```\n'use strict';\n\nconst request = require('@testlio/discovered-request');\n\nconst options = {\n    url: 'http://testlio.com'\n};\n\nrequest(options).then((result) => {\n    console.log(result);\n}).catch((err) => {\n    console.log('Request failed');\n    console.log(err);\n});\n```\n\n## Request only discovery\n\nReturns the result of the resource discovery request of the specified service and version.\n\n```js\n'use strict';\n\nconst request = require('@testlio/discovered-request');\n\nconst options = {\n    servicePath: 'browser.v1',\n    json: true,\n    headers: {\n        Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJtYXJ0QHRlc3RsaW8uY29tIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.tMRlQfy2e1I0kfqrSJraPbBqgGnmIVrXj8ks-WBEJLg'\n    }\n};\n\n\nrequest(options).then((result) => {\n    console.log(result);\n}).catch((err) => {\n    console.log('Request failed');\n    console.log(err);\n});\n```\n\n## Changing API location\n\nUse the `api` option to change the base API location. If `api` is undefined then the default value is used instead (currently set to `https://api.testlio.com`\n\n```\n'use strict';\n\nconst request = require('@testlio/discovered-request');\n\nconst options = {\n    api: 'http://local.testlio',\n    servicePath: 'browser.v1.browsers',\n    headers: {\n        'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJtYXJ0QHRlc3RsaW8uY29tIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.tMRlQfy2e1I0kfqrSJraPbBqgGnmIVrXj8ks-WBEJLg'\n    },\n    json: true\n};\n\nrequest(options).then((result) => {\n    console.log(result);\n}).catch((err) => {\n    console.log('Request failed');\n    console.log(err);\n});\n```\n\n### Changing 'Promise' dependency\n\nIf your environment doesn't support `new Promise` you need to define promise dependency by yourself.\n\n```\nconst request = require('@testlio/discovered-request');\nrequest.setPromisesDependency(require('Bluebird'));\n```\n","readmeFilename":"README.md"}