{"id":18517962,"url":"https://github.com/spacecloud-io/space-sdk-ts","last_synced_at":"2025-05-14T15:32:09.872Z","repository":{"id":174458258,"uuid":"647675920","full_name":"spacecloud-io/space-sdk-ts","owner":"spacecloud-io","description":"Typescript API for Space Cloud","archived":false,"fork":false,"pushed_at":"2023-09-24T03:20:51.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T04:41:24.210Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spacecloud-io.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":"2023-05-31T09:35:35.000Z","updated_at":"2023-06-11T16:33:10.000Z","dependencies_parsed_at":"2023-07-28T01:48:53.165Z","dependency_job_id":"73ddd687-b0ec-42a1-9108-3eeb215791cf","html_url":"https://github.com/spacecloud-io/space-sdk-ts","commit_stats":null,"previous_names":["spacecloud-io/space-sdk-ts"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecloud-io%2Fspace-sdk-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecloud-io%2Fspace-sdk-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecloud-io%2Fspace-sdk-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacecloud-io%2Fspace-sdk-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacecloud-io","download_url":"https://codeload.github.com/spacecloud-io/space-sdk-ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171757,"owners_count":22026507,"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-06T17:10:31.910Z","updated_at":"2025-05-14T15:32:09.639Z","avatar_url":"https://github.com/spacecloud-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Space SDK (Typescript)\nTypescript API for Space Cloud\n\n## Worker API\n\n### Sample usage\n```ts\nimport { Server } from \"@spacecloud-io/worker\";\nimport { z } from \"zod\";\n\n// We first create the server object\nconst server = Server.create({ \n  name: \"myServer\",\n  baseUrl: \"/v2\",     // Optional. Defaults to `/v1`.\n  port: 8080          // Optional. Defaults to `3000`.\n});\n\n// Create a router object. All operations are registered on this router.\nconst router = server.router();\n\n// Register a query object.\nrouter.query(\"operate\")                       // `opId` is the name of the operation\n  .method(\"GET\")                              // Defaults to `GET` for queries and `POST` for mutations\n  .url(\"/v1/operate\")                         // Defaults to `${baseUrl}/${opId}`                                                 \n  .input(z.object({ name: z.string() }))\n  .output(z.object({ greeting: z.string() }))\n  .fn(async (_ctx, req) =\u003e {\n    return { greeting: `Hi ${req.name}` };\n  });\n\n// Start the express http server.\nserver.start();\n```\n\nThe worker generates the some additional routes as shown below:\n\n```\n# Routes created to expose the OpenAPI specification generated\n[GET] `${baseUrl}/openapi.json`\n[GET] `${baseUrl}/openapi.yaml` \n```\n\n### Saving OpenAPI specification to disk\n\nSimply add the flag `--save-openapi` flag to save the autogenerated Open API specification in yaml format. Use the `-f, --file \u003cpath\u003e` flag to control the file path. The specification will be persisted at `${file}/openapi.yaml`.\n```\nnode index.js --save-openapi -f ./config\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacecloud-io%2Fspace-sdk-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacecloud-io%2Fspace-sdk-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacecloud-io%2Fspace-sdk-ts/lists"}