{"id":17347263,"url":"https://github.com/rodentman87/kwp-ts","last_synced_at":"2025-03-27T11:19:46.433Z","repository":{"id":120399152,"uuid":"610019263","full_name":"Rodentman87/kwp-ts","owner":"Rodentman87","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T22:42:58.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T15:45:02.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Rodentman87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-03-05T22:42:40.000Z","updated_at":"2023-03-05T22:43:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"33bdd612-01ae-4af0-bd37-1f13f6d3a330","html_url":"https://github.com/Rodentman87/kwp-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodentman87%2Fkwp-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodentman87%2Fkwp-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodentman87%2Fkwp-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rodentman87%2Fkwp-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rodentman87","download_url":"https://codeload.github.com/Rodentman87/kwp-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245832746,"owners_count":20679702,"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-10-15T16:48:09.706Z","updated_at":"2025-03-27T11:19:46.428Z","avatar_url":"https://github.com/Rodentman87.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KWP Client\n\nThis is a simple TypeScript client implementation for KerbalWebProgram, and provides a simple abstraction over the API's structure.\n\n## Usage\n\nA simple client using the HTTP transport:\n\n```ts\nimport { KerbalWebProgramClient, HTTPTransport } from \"kwp-ts\";\n\nconst transport = new HTTPTransport(\"http://localhost:8080\");\nconst client = new KerbalWebProgramClient(transport);\n\nconst kerbinData = await client.makeRequest(\"getCelestialBodyData\", {\n\tname: \"Kerbin\",\n});\n```\n\nAdding extra method types:\n\n```ts\nimport {\n\tKerbalWebProgramClient,\n\tHTTPTransport,\n\tBaseApiMethods,\n\tApiMethodData,\n} from \"kwp-ts\";\n\ninterface MyCustomMethod extends ApiMethodData {\n\tname: \"myCustomMethod\";\n\tparameters: {\n\t\tparam1: string;\n\t\tparam2: number;\n\t};\n\tresponse: {\n\t\tdata1: string;\n\t\tdata2: number;\n\t};\n}\n\nconst transport = new HTTPTransport(\"http://localhost:8080\");\nconst client = new KerbalWebProgramClient\u003cBaseApiMethods | MyCustomMethod\u003e(\n\ttransport\n);\n```\n\n## TODO\n\n- [ ] Add tests\n- [ ] Add WebSocket transport\n  - [ ] Types for WebSocket events\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodentman87%2Fkwp-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodentman87%2Fkwp-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodentman87%2Fkwp-ts/lists"}