@leaflow/sdk 0.0.0-dev.457.g4544173 → 0.0.0-dev.459.gaa32320
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 +9 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Leaflow TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`src/<service>/v1/generated`. Module entry points stay outside that generated directory.
|
|
5
|
-
Root namespaces, versioned subpath imports and each module's `schemas`
|
|
6
|
-
export are preserved. `src/routes.ts` retains the static routing and authentication facts.
|
|
3
|
+
TypeScript SDK for the Leaflow platform, generated from the [leaflowapis](https://github.com/leaflowapis/leaflowapis) contracts.
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
```sh
|
|
6
|
+
npm install @leaflow/sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Clients, models, and request validation schemas live under `src/<service>/<version>/generated`. Validate requests with the generated schemas before calling an operation.
|
|
10
10
|
|
|
11
11
|
## Generate and build
|
|
12
12
|
|
|
@@ -18,15 +18,12 @@ npm run generate
|
|
|
18
18
|
npm run build
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
so JSON and SSE retain their respective response formats. No compatibility forwarding layer is used. For local generation, CONTRACTS_DIR
|
|
23
|
-
may point to an existing clean checkout of the exact CONTRACTS_REF commit. CI checks out that commit.
|
|
21
|
+
The contract version is recorded in `CONTRACTS_REF`. `CONTRACTS_DIR` may point to a clean checkout at that ref.
|
|
24
22
|
|
|
25
23
|
## Protocol messages
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
path and encode or decode with `@bufbuild/protobuf`; no gRPC or Connect transport is involved:
|
|
25
|
+
Protobuf messages from the contract are generated with protoc-gen-es under `src/proto`, preserving their
|
|
26
|
+
proto paths. Import them by path and encode or decode with `@bufbuild/protobuf`:
|
|
30
27
|
|
|
31
28
|
```ts
|
|
32
29
|
import { create, toBinary } from "@bufbuild/protobuf";
|
|
@@ -36,9 +33,3 @@ const bytes = toBinary(ClientMessageSchema, create(ClientMessageSchema, {}));
|
|
|
36
33
|
```
|
|
37
34
|
|
|
38
35
|
`npm run generate` runs Orval and then `buf generate` on the same contract checkout.
|
|
39
|
-
|
|
40
|
-
## Canopy migration
|
|
41
|
-
|
|
42
|
-
Project inference and management are exported from `canopy` and `@leaflow/sdk/canopy/v1`.
|
|
43
|
-
Replace `canopyInference` and `@leaflow/sdk/canopy/inference/v1` imports with the shared Canopy module.
|
|
44
|
-
The OpenAI-compatible `/v1` paths, management `/api/v1` paths and scoped-token authentication are unchanged.
|