{"id":21611278,"url":"https://github.com/runnerty/trigger-server","last_synced_at":"2025-03-18T16:04:42.380Z","repository":{"id":34999510,"uuid":"195216879","full_name":"runnerty/trigger-server","owner":"runnerty","description":"Default Runnerty Trigger Server ","archived":false,"fork":false,"pushed_at":"2023-07-18T22:55:12.000Z","size":131,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T19:17:58.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/runnerty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-04T10:00:20.000Z","updated_at":"2021-12-27T13:07:22.000Z","dependencies_parsed_at":"2024-11-24T21:12:01.177Z","dependency_job_id":"680937a6-4b7c-431c-8c81-4bac681db5cf","html_url":"https://github.com/runnerty/trigger-server","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Ftrigger-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Ftrigger-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Ftrigger-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runnerty%2Ftrigger-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runnerty","download_url":"https://codeload.github.com/runnerty/trigger-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257279,"owners_count":20424131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T21:11:49.502Z","updated_at":"2025-03-18T16:04:42.353Z","avatar_url":"https://github.com/runnerty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://runnerty.io\"\u003e\n    \u003cimg height=\"257\" src=\"https://runnerty.io/assets/header/logo-stroked.png\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003eSmart Processes Management\u003c/p\u003e\n\u003c/p\u003e\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]\n\u003ca href=\"#badge\"\u003e\n\u003cimg alt=\"code style: prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\"\u003e\n\u003c/a\u003e\n\n# Server Trigger for [Runnerty]\n\n### Configuration sample:\n\nAdd in [config.json]:\nThis is a special trigger, since by default runnerty imports it to prevent the use of servers from forcing us to import it (as a npm dependency) in our project. It can also be replaced by a custom tigger server, indicating the \"type\" of this, which allows us to implement our own logic of \"on_request\".\n\n```json\n{\n  \"general\": {\n    \"servers\": [\n      {\n        \"id\": \"my_srv_sample\",\n        \"port\": 8080,\n        \"endpoint\": \"/my_endpoint\"\n      }\n    ]\n  },\n  \"triggers\": [\n    {\n      \"id\": \"server_default\",\n      \"type\": \"@runnerty-trigger-server\"\n    }\n  ]\n}\n```\n\n#### You can use two different authentication strategies, basic auth or API Key.\n\nBasic Auth (standard):\n\n```json\n{\n  \"general\": {\n    \"servers\": [\n      {\n        \"id\": \"my_srv_sample\",\n        \"port\": 8080,\n        \"endpoint\": \"/my_endpoint\",\n        \"users\": [\n          { \"user\": \"user_one\", \"password\": \"pass_one\" },\n          { \"user\": \"user_two\", \"password\": \"pass_two\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\nAPI Key. You can send your API-Key in the endpoint call using the `api_key` query parameter or the `x-api-key` header.\n\n```json\n{\n  \"general\": {\n    \"servers\": [\n      {\n        \"id\": \"my_srv_sample\",\n        \"port\": 8080,\n        \"endpoint\": \"/my_endpoint\",\n        \"apikey\": \"_API_KEY_SAMPLE_\"\n      }\n    ]\n  }\n}\n```\n\n### Plan sample:\n\nAdd in [plan.json]:\n\n```json\n{\n  \"id\": \"...\",\n  \"name\": \"...\",\n  \"triggers\": [\n    {\n      \"id\": \"server_default\",\n      \"server\": {\n        \"id\": \"my_srv_sample\",\n        \"path\": \"/test\",\n        \"method\": \"post\"\n      }\n    }\n  ]\n}\n```\n\n#### Usage\n\nBoth the values that arrive by `query` and those that arrive in `body` will be available in the chain (via customValues).\nSo if for example we make a \"post\" like this:\n\n```\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"MY_VALUE_ONE\":\"ONE\",\"MY_VALUE_TWO\":\"2\"}' http://localhost:8080/my_endpoint/test\n```\n\nWe can make use of the values through the \"get values\" function:\n\n```\n @GV(MY_VALUE_ONE) / @GV(MY_VALUE_TWO) / @GV(my_query_value)\n```\n\nExamples of `api-key` authentication:\n\n```\ncurl -X POST -H \"Content-Type: application/json\" -H \"x-api-key: _API_KEY_SAMPLE_\" http://localhost:8080/my_endpoint/test\n```\n\n```\ncurl -X POST -H 'Content-Type: application/json' 'localhost:8080/my_endpoint/test?api_key=_API_KEY_SAMPLE_'\n```\n\n[runnerty]: http://www.runnerty.io\n[downloads-image]: https://img.shields.io/npm/dm/@runnerty/trigger-server.svg\n[npm-url]: https://www.npmjs.com/package/@runnerty/trigger-server\n[npm-image]: https://img.shields.io/npm/v/@runnerty/trigger-server.svg\n[config.json]: http://docs.runnerty.io/config/\n[plan.json]: http://docs.runnerty.io/plan/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnerty%2Ftrigger-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunnerty%2Ftrigger-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunnerty%2Ftrigger-server/lists"}