bhole-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +74 -0
  2. package/dist/gen/proto/agency/v1/agency_pb.d.ts +1423 -0
  3. package/dist/gen/proto/agency/v1/agency_pb.js +153 -0
  4. package/dist/gen/proto/agency/v1/agency_pb.js.map +1 -0
  5. package/dist/gen/proto/astronaut/v1/astronaut_pb.d.ts +479 -0
  6. package/dist/gen/proto/astronaut/v1/astronaut_pb.js +93 -0
  7. package/dist/gen/proto/astronaut/v1/astronaut_pb.js.map +1 -0
  8. package/dist/gen/proto/celestial_body/v1/celestial_body_pb.d.ts +423 -0
  9. package/dist/gen/proto/celestial_body/v1/celestial_body_pb.js +73 -0
  10. package/dist/gen/proto/celestial_body/v1/celestial_body_pb.js.map +1 -0
  11. package/dist/gen/proto/docking_event/v1/docking_event_pb.d.ts +2495 -0
  12. package/dist/gen/proto/docking_event/v1/docking_event_pb.js +323 -0
  13. package/dist/gen/proto/docking_event/v1/docking_event_pb.js.map +1 -0
  14. package/dist/gen/proto/event/v1/event_pb.d.ts +1041 -0
  15. package/dist/gen/proto/event/v1/event_pb.js +168 -0
  16. package/dist/gen/proto/event/v1/event_pb.js.map +1 -0
  17. package/dist/gen/proto/expedition/v1/expedition_pb.d.ts +817 -0
  18. package/dist/gen/proto/expedition/v1/expedition_pb.js +138 -0
  19. package/dist/gen/proto/expedition/v1/expedition_pb.js.map +1 -0
  20. package/dist/gen/proto/landing/v1/landing_pb.d.ts +3163 -0
  21. package/dist/gen/proto/landing/v1/landing_pb.js +383 -0
  22. package/dist/gen/proto/landing/v1/landing_pb.js.map +1 -0
  23. package/dist/gen/proto/launch/v1/launch_pb.d.ts +3679 -0
  24. package/dist/gen/proto/launch/v1/launch_pb.js +423 -0
  25. package/dist/gen/proto/launch/v1/launch_pb.js.map +1 -0
  26. package/dist/gen/proto/launcher/v1/launcher_pb.d.ts +371 -0
  27. package/dist/gen/proto/launcher/v1/launcher_pb.js +73 -0
  28. package/dist/gen/proto/launcher/v1/launcher_pb.js.map +1 -0
  29. package/dist/gen/proto/launcher_configuration/v1/launcher_configuration_pb.d.ts +995 -0
  30. package/dist/gen/proto/launcher_configuration/v1/launcher_configuration_pb.js +123 -0
  31. package/dist/gen/proto/launcher_configuration/v1/launcher_configuration_pb.js.map +1 -0
  32. package/dist/gen/proto/location/v1/location_pb.d.ts +557 -0
  33. package/dist/gen/proto/location/v1/location_pb.js +88 -0
  34. package/dist/gen/proto/location/v1/location_pb.js.map +1 -0
  35. package/dist/gen/proto/pad/v1/pad_pb.d.ts +601 -0
  36. package/dist/gen/proto/pad/v1/pad_pb.js +88 -0
  37. package/dist/gen/proto/pad/v1/pad_pb.js.map +1 -0
  38. package/dist/gen/proto/payload/v1/payload_pb.d.ts +697 -0
  39. package/dist/gen/proto/payload/v1/payload_pb.js +108 -0
  40. package/dist/gen/proto/payload/v1/payload_pb.js.map +1 -0
  41. package/dist/gen/proto/program/v1/program_pb.d.ts +385 -0
  42. package/dist/gen/proto/program/v1/program_pb.js +78 -0
  43. package/dist/gen/proto/program/v1/program_pb.js.map +1 -0
  44. package/dist/gen/proto/space_station/v1/space_station_pb.d.ts +2849 -0
  45. package/dist/gen/proto/space_station/v1/space_station_pb.js +348 -0
  46. package/dist/gen/proto/space_station/v1/space_station_pb.js.map +1 -0
  47. package/dist/gen/proto/spacecraft/v1/spacecraft_pb.d.ts +2261 -0
  48. package/dist/gen/proto/spacecraft/v1/spacecraft_pb.js +268 -0
  49. package/dist/gen/proto/spacecraft/v1/spacecraft_pb.js.map +1 -0
  50. package/dist/gen/proto/spacewalk/v1/spacewalk_pb.d.ts +3059 -0
  51. package/dist/gen/proto/spacewalk/v1/spacewalk_pb.js +373 -0
  52. package/dist/gen/proto/spacewalk/v1/spacewalk_pb.js.map +1 -0
  53. package/dist/gen/proto/update/v1/update_pb.d.ts +145 -0
  54. package/dist/gen/proto/update/v1/update_pb.js +38 -0
  55. package/dist/gen/proto/update/v1/update_pb.js.map +1 -0
  56. package/dist/index.d.ts +22 -0
  57. package/dist/index.js +24 -0
  58. package/dist/index.js.map +1 -0
  59. package/package.json +31 -0
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # Bhole TypeScript ConnectRPC Client
2
+
3
+ This package contains the TypeScript/ES ConnectRPC client generated from the project's Protobuf definitions.
4
+
5
+ ## 🚀 How to Generate & Build the TS Client
6
+
7
+ If you modify the Protobuf files (`.proto`) and need to regenerate the TypeScript client, follow these steps:
8
+
9
+ ### 1. Install Node Dependencies
10
+ Ensure you have installed the code generator plugin and dependencies:
11
+ ```bash
12
+ cd client/ts
13
+ npm install
14
+ ```
15
+
16
+ ### 2. Generate the Client Code
17
+ From the **root directory** of the project, run the `buf` code generator:
18
+ ```bash
19
+ # Run from the repository root
20
+ buf generate
21
+ ```
22
+ This runs the local `@bufbuild/protoc-gen-es` plugin and outputs the generated files into `client/ts/src/gen`.
23
+
24
+ ### 3. Build the Package
25
+ Compile the TypeScript code to JavaScript and type definitions:
26
+ ```bash
27
+ cd client/ts
28
+ npm run build
29
+ ```
30
+ This outputs compiled JavaScript files, declaration maps, and typing files to `client/ts/dist/`.
31
+
32
+ ---
33
+
34
+ ## 📦 Usage in a Web App
35
+
36
+ You can integrate this client into any frontend web application (React, Vue, Svelte, Next.js, etc.).
37
+
38
+ ### 1. Initialize Transport & Client
39
+ ```typescript
40
+ import { createClient, createConnectTransport, Launch } from "bhole-client";
41
+
42
+ // Create the ConnectRPC web transport pointing to your API gateway/server
43
+ const transport = createConnectTransport({
44
+ baseUrl: "http://localhost:8080",
45
+ });
46
+
47
+ // Instantiate the service client
48
+ const client = createClient(Launch.LaunchService, transport);
49
+
50
+ // Call an endpoint
51
+ const response = await client.listLaunches({ limit: 10 });
52
+ console.log("Total Launches:", response.count);
53
+ ```
54
+
55
+ ### 2. Service Namespaces
56
+ All 18 service definitions and schemas are grouped under distinct namespaces to prevent naming clashes:
57
+ * `Agency`
58
+ * `Astronaut`
59
+ * `CelestialBody`
60
+ * `DockingEvent`
61
+ * `Event`
62
+ * `Expedition`
63
+ * `Landing`
64
+ * `Launcher`
65
+ * `LauncherConfiguration`
66
+ * `Launch`
67
+ * `Location`
68
+ * `Pad`
69
+ * `Payload`
70
+ * `Program`
71
+ * `SpaceStation`
72
+ * `Spacecraft`
73
+ * `Spacewalk`
74
+ * `Update`