pgbeam 0.1.0 → 0.2.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 +56 -0
- package/dist/{index.d.ts → index.d.mts} +579 -208
- package/dist/{index.js → index.mjs} +71 -74
- package/dist/{operations.d.ts → operations.d.mts} +540 -245
- package/dist/{operations.js → operations.mjs} +70 -73
- package/package.json +22 -32
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# pgbeam
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for the [PgBeam](https://pgbeam.com) API — globally distributed
|
|
4
|
+
PostgreSQL proxy platform with connection pooling and query caching.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install pgbeam
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { PgBeamClient } from "pgbeam";
|
|
16
|
+
|
|
17
|
+
const client = new PgBeamClient({
|
|
18
|
+
token: "your-api-token",
|
|
19
|
+
baseUrl: "https://api.pgbeam.com",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Tag-based access
|
|
23
|
+
const projects = await client.api.projects.listProjects({
|
|
24
|
+
queryParams: { org_id: "org_123" },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Route-based access
|
|
28
|
+
const project = await client.api.request("GET /v1/projects/{project_id}", {
|
|
29
|
+
pathParams: { project_id: "proj_123" },
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Error handling
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { PgBeamClient, ApiError } from "pgbeam";
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
await client.api.projects.getProject({
|
|
40
|
+
pathParams: { project_id: "proj_123" },
|
|
41
|
+
});
|
|
42
|
+
} catch (err) {
|
|
43
|
+
if (err instanceof ApiError) {
|
|
44
|
+
console.error(err.status, err.message);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Operations map
|
|
50
|
+
|
|
51
|
+
The `pgbeam/operations` export provides route and tag metadata for building
|
|
52
|
+
tooling on top of the SDK:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { operationsByTag, operationsByPath } from "pgbeam/operations";
|
|
56
|
+
```
|