{"_id":"@alexeftimie/scaffolder-backend-module-http-request","name":"@alexeftimie/scaffolder-backend-module-http-request","dist-tags":{"latest":"3.4.0"},"versions":{"3.4.0":{"name":"@alexeftimie/scaffolder-backend-module-http-request","version":"3.4.0","main":"src/index.ts","types":"src/index.ts","license":"Apache-2.0","publishConfig":{"access":"public","main":"dist/index.cjs.js","types":"dist/index.d.ts"},"backstage":{"role":"backend-plugin"},"repository":{"type":"git","url":"git+https://github.com/alexef/roadie-backstage-plugins.git","directory":"plugins/scaffolder-actions/scaffolder-backend-module-http-request"},"bugs":{"url":"https://github.com/alexef/roadie-backstage-plugins/issues"},"scripts":{"start":"backstage-cli package start","build":"backstage-cli package build","lint":"backstage-cli package lint","test":"backstage-cli package test","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack","clean":"backstage-cli clean"},"dependencies":{"@backstage/backend-common":"^0.18.1","@backstage/config":"^1.0.6","@backstage/plugin-scaffolder-backend":"^1.10.1","cross-fetch":"^3.1.4","winston":"^3.2.1"},"devDependencies":{"@types/jest":"^26.0.7","@backstage/cli":"^0.22.1"},"description":"Welcome to the `http` actions for the `scaffolder-backend`.","homepage":"https://github.com/alexef/roadie-backstage-plugins#readme","author":{"name":"roadie"},"gitHead":"1e0f61a8eff437951be7c90162a5d4e7e389c01f","_id":"@alexeftimie/scaffolder-backend-module-http-request@3.4.0","_nodeVersion":"14.19.1","_npmVersion":"7.24.2","dist":{"integrity":"sha512-DShnogHhwhUJkMtqIjpGbybwWBfChRKkhdLO2B7JWajxuV+iSJbElJ58hxJYic0kb+JA04DgALcpg12qB974Gg==","shasum":"7cfd4837d52da69fbcbbafa8d6875e379d5dbcad","tarball":"https://registry.npmjs.org/@alexeftimie/scaffolder-backend-module-http-request/-/scaffolder-backend-module-http-request-3.4.0.tgz","fileCount":5,"unpackedSize":25136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID7WxqkrzrmauHlwEDSf5HbDsUAwIf8kVCZiNIZekca7AiB7XPNRI3VMTvTvvrjmDlI5vwHZ/ePzK618UpjpW9OP6g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5LfXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg/Q//azFOy1X25gb42PjunGvUx71AssAYlXG+PJXE/Adc0pliiAiR\r\nyGIcIeTnoltO1ElN5raF0PtcOiGU3HQMjpEbfNvqFgAJ7WmB3nR3tUJIXQUm\r\npKpqRdhFTF4WS/E5Oej44MlV5pPqyjw3HPVENJ/QLmSg/VL569vzz0cGvu7P\r\nJh3Iph1/YeTk4hq+CXHYswhlJLhQclmNM/5EdYid5YxIdKnsp2BRnBbmUGpk\r\nt/GsCmDgyYEzTyTen79EwFZPIYZOKTTWY/RiZo9qD9u0Ku83zAFEERRwrWmF\r\nWl5Z7WqLzHwQjRt6vMCK/xKXXdaF9ldeQ1JlCSduWFumvsiXw3BCyOVzJR6s\r\nsxcRN+FTr1V4tLx8KUKLyKMGmhLv6Uza3uSlDsIw7t0QnSXZ+Z/Wy4i5Ml4t\r\nbllOjtDyScJF8qwxeMrDaDLNEZ8+hRYXkompY29FQdOy89z1+9kA52atsV+S\r\nJyb9XCTX9OroLR4GKH0O2ys6kmSm900x1/d5Rdk9YFd97D0deVuswzzd74ks\r\nweUjbeEbtedd+ibuebfo4aflDjYnZG+Xd3UNo0iFXLbqKzgwwLrsOnZOz2tj\r\nTFttgGFxb6eYV3L+EHG39ZBlIyPSI5HfMJIP7y5KJhUxbPzjZcDVnK0/yDn8\r\n6ZRW+OEey798y3/PTmz6V9O5g7uRgtFQ4LM=\r\n=FdUs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alexeftimie","email":"alexeftimie@gmail.com"},"directories":{},"maintainers":[{"name":"alexeftimie","email":"alexeftimie@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/scaffolder-backend-module-http-request_3.4.0_1675933655189_0.7169689198254423"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-09T09:07:35.135Z","3.4.0":"2023-02-09T09:07:35.389Z","modified":"2023-02-09T09:07:35.527Z"},"maintainers":[{"name":"alexeftimie","email":"alexeftimie@gmail.com"}],"description":"Welcome to the `http` actions for the `scaffolder-backend`.","homepage":"https://github.com/alexef/roadie-backstage-plugins#readme","repository":{"type":"git","url":"git+https://github.com/alexef/roadie-backstage-plugins.git","directory":"plugins/scaffolder-actions/scaffolder-backend-module-http-request"},"author":{"name":"roadie"},"bugs":{"url":"https://github.com/alexef/roadie-backstage-plugins/issues"},"license":"Apache-2.0","readme":"# scaffolder-backend-module-http-request\n\nWelcome to the `http` actions for the `scaffolder-backend`.\n\nThis contains one action: `http:backstage:request`.\n\nThe `http:backstage:request` action allows the task to call any of the backstage APIs available to the user that triggers it. The action takes care of passing the authentication token of the user to the task execution so that the action can perform actions on behalf of the user that triggers it.\n\n## Getting started\n\nCreate your Backstage application using the Backstage CLI as described here:\nhttps://backstage.io/docs/getting-started/create-an-app\n\n> Note: If you are using this plugin in a Backstage monorepo that contains the code for `@backstage/plugin-scaffolder-backend`, you need to modify your internal build processes to transpile files from the `node_modules` folder as well.\n\nYou need to configure the action in your backend:\n\n## From your Backstage root directory\n\n```\ncd packages/backend\nyarn add @roadiehq/scaffolder-backend-module-http-request\n```\n\nConfigure the action:\n(you can check the [docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions) to see all options):\n\n```typescript\n// packages/backend/src/plugins/scaffolder.ts\n\nconst actions = [\n  createHttpBackstageAction({ config }),\n  ...createBuiltinActions({\n    containerRunner,\n    integrations,\n    config,\n    catalogClient,\n    reader,\n  }),\n];\n\nreturn await createRouter({\n  containerRunner,\n  logger,\n  config,\n  database,\n  catalogClient,\n  reader,\n  actions,\n});\n```\n\n### Supported methods\n\nAction supports following HTTP methods: `GET`, `HEAD`, `OPTIONS`, `POST`, `UPDATE`, `DELETE`, `PUT`, `PATCH`\n\n### Example of using GET method\n\n```yaml\n---\napiVersion: scaffolder.backstage.io/v1beta3\nkind: Template\nmetadata:\n  name: HTTP-testing\n  title: Http testing for post/get\n  description: Testing get functionality with get\nspec:\n  owner: roadie\n  type: service\n\n  parameters:\n    - title: Fill in some params\n      properties:\n        httpGetPath:\n          title: Get Path\n          type: string\n          description: The path you want to get on your backstage instance\n          ui:autofocus: true\n          ui:options:\n            rows: 5\n\n  steps:\n    - id: backstage_request\n      name: backstage request\n      action: http:backstage:request\n      input:\n        method: 'GET'\n        path: '/api/proxy/snyk/org/org/project/project-id/aggregated-issues'\n        headers:\n          test: 'hello'\n          foo: 'bar'\n\n  output:\n    getResponse: '{{ steps.backstage_request.output.body }}'\n    getCode: '{{ steps.backstage_request.output.code }}'\n    getHeaders: '{{ steps.backstage_request.output.headers }}'\n```\n\n### Example of using POST method\n\nIf the request requires a body, it can be specified using the body parameter. There are two options here\n\n1. `content-type: application/json` header is specified. Everything under `body` hash will be converted into JSON string\n2. `content-type: application/json` header is not specified. `body` treated as a plain string\n\n```yaml\nsteps:\n  - id: backstage_request\n    name: backstage request\n    action: http:backstage:request\n    input:\n      method: 'POST'\n      path: '/api/proxy/snyk/org/org/project/project-id/aggregated-issues'\n      headers:\n        content-type: 'application/json'\n      body:\n        name: 'test'\n        bar: 'foo'\n\noutput:\n  getResponse: '{{ steps.backstage_request.output.body }}'\n  getCode: '{{ steps.backstage_request.output.code }}'\n  getHeaders: '{{ steps.backstage_request.output.headers }}'\n```\n\nSnippet above will send the following HTTP request:\n\n```sh\n--------  127.0.0.1:53321 | POST /\nHeaders\n\"Accept\" : [\"*/*\"]\n\"Content-Type\" : [\"application/json\"]\n\"Connection\" : [\"close\"]\n\"User-Agent\" : [\"node-fetch/1.0 (+https://github.com/bitinn/node-fetch)\"]\n\"Content-Length\" : [\"27\"]\n00000000  7b 22 6e 61 6d 65 22 3a  22 74 65 73 74 22 2c 22  |{\"name\":\"test\",\"|\n00000010  62 61 72 22 3a 22 66 6f  6f 22 7d                 |bar\":\"foo\"}|\n```\n\nYou can also visit the `/create/actions` route in your Backstage application to find out more about the parameters this action accepts when it's installed to configure how you like.\n\n## Configuration options\n\nBy default, the plugin will use `backend.baseUrl` as the Backstage backend address. \nThis can be overriden by setting `plugin.scaffolder-backend-module-http-request.baseUrl`.","readmeFilename":"README.md"}