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.
- package/README.md +74 -0
- package/dist/gen/proto/agency/v1/agency_pb.d.ts +1423 -0
- package/dist/gen/proto/agency/v1/agency_pb.js +153 -0
- package/dist/gen/proto/agency/v1/agency_pb.js.map +1 -0
- package/dist/gen/proto/astronaut/v1/astronaut_pb.d.ts +479 -0
- package/dist/gen/proto/astronaut/v1/astronaut_pb.js +93 -0
- package/dist/gen/proto/astronaut/v1/astronaut_pb.js.map +1 -0
- package/dist/gen/proto/celestial_body/v1/celestial_body_pb.d.ts +423 -0
- package/dist/gen/proto/celestial_body/v1/celestial_body_pb.js +73 -0
- package/dist/gen/proto/celestial_body/v1/celestial_body_pb.js.map +1 -0
- package/dist/gen/proto/docking_event/v1/docking_event_pb.d.ts +2495 -0
- package/dist/gen/proto/docking_event/v1/docking_event_pb.js +323 -0
- package/dist/gen/proto/docking_event/v1/docking_event_pb.js.map +1 -0
- package/dist/gen/proto/event/v1/event_pb.d.ts +1041 -0
- package/dist/gen/proto/event/v1/event_pb.js +168 -0
- package/dist/gen/proto/event/v1/event_pb.js.map +1 -0
- package/dist/gen/proto/expedition/v1/expedition_pb.d.ts +817 -0
- package/dist/gen/proto/expedition/v1/expedition_pb.js +138 -0
- package/dist/gen/proto/expedition/v1/expedition_pb.js.map +1 -0
- package/dist/gen/proto/landing/v1/landing_pb.d.ts +3163 -0
- package/dist/gen/proto/landing/v1/landing_pb.js +383 -0
- package/dist/gen/proto/landing/v1/landing_pb.js.map +1 -0
- package/dist/gen/proto/launch/v1/launch_pb.d.ts +3679 -0
- package/dist/gen/proto/launch/v1/launch_pb.js +423 -0
- package/dist/gen/proto/launch/v1/launch_pb.js.map +1 -0
- package/dist/gen/proto/launcher/v1/launcher_pb.d.ts +371 -0
- package/dist/gen/proto/launcher/v1/launcher_pb.js +73 -0
- package/dist/gen/proto/launcher/v1/launcher_pb.js.map +1 -0
- package/dist/gen/proto/launcher_configuration/v1/launcher_configuration_pb.d.ts +995 -0
- package/dist/gen/proto/launcher_configuration/v1/launcher_configuration_pb.js +123 -0
- package/dist/gen/proto/launcher_configuration/v1/launcher_configuration_pb.js.map +1 -0
- package/dist/gen/proto/location/v1/location_pb.d.ts +557 -0
- package/dist/gen/proto/location/v1/location_pb.js +88 -0
- package/dist/gen/proto/location/v1/location_pb.js.map +1 -0
- package/dist/gen/proto/pad/v1/pad_pb.d.ts +601 -0
- package/dist/gen/proto/pad/v1/pad_pb.js +88 -0
- package/dist/gen/proto/pad/v1/pad_pb.js.map +1 -0
- package/dist/gen/proto/payload/v1/payload_pb.d.ts +697 -0
- package/dist/gen/proto/payload/v1/payload_pb.js +108 -0
- package/dist/gen/proto/payload/v1/payload_pb.js.map +1 -0
- package/dist/gen/proto/program/v1/program_pb.d.ts +385 -0
- package/dist/gen/proto/program/v1/program_pb.js +78 -0
- package/dist/gen/proto/program/v1/program_pb.js.map +1 -0
- package/dist/gen/proto/space_station/v1/space_station_pb.d.ts +2849 -0
- package/dist/gen/proto/space_station/v1/space_station_pb.js +348 -0
- package/dist/gen/proto/space_station/v1/space_station_pb.js.map +1 -0
- package/dist/gen/proto/spacecraft/v1/spacecraft_pb.d.ts +2261 -0
- package/dist/gen/proto/spacecraft/v1/spacecraft_pb.js +268 -0
- package/dist/gen/proto/spacecraft/v1/spacecraft_pb.js.map +1 -0
- package/dist/gen/proto/spacewalk/v1/spacewalk_pb.d.ts +3059 -0
- package/dist/gen/proto/spacewalk/v1/spacewalk_pb.js +373 -0
- package/dist/gen/proto/spacewalk/v1/spacewalk_pb.js.map +1 -0
- package/dist/gen/proto/update/v1/update_pb.d.ts +145 -0
- package/dist/gen/proto/update/v1/update_pb.js +38 -0
- package/dist/gen/proto/update/v1/update_pb.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- 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`
|