@ingram-tech/ingram-cloud-sdk 0.1.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 ADDED
@@ -0,0 +1,58 @@
1
+ # `@ingram-tech/ingram-cloud-sdk`
2
+
3
+ The Ingram Cloud `/v1` API wire contract in TypeScript: **Zod request/response
4
+ schemas + SSE/webhook event types + JSON response types**. The `schemas` map is
5
+ generated from the OpenAPI document — the source of truth for the wire — and the
6
+ event/response types are hand-authored. This package is the **source of truth for
7
+ the wire shapes**, not an HTTP client.
8
+
9
+ ```ts
10
+ import { schemas } from "@ingram-tech/ingram-cloud-sdk";
11
+
12
+ // Runtime-validate a request/response body against the contract.
13
+ const agent = schemas.AgentIn.parse(input);
14
+ ```
15
+
16
+ ```ts
17
+ import type { ICSmith, ICRun, ICAgent } from "@ingram-tech/ingram-cloud-sdk/responses";
18
+
19
+ // Type a /v1 JSON response — no zod is pulled in.
20
+ function render(smith: ICSmith) {
21
+ /* … */
22
+ }
23
+ ```
24
+
25
+ ## Exports
26
+
27
+ - `.` — the `schemas` Zod map plus the SSE/webhook event types (`EVENT_TYPES`,
28
+ `webhookEvent`, `streamFrame`, …).
29
+ - `./schemas` — just the generated Zod `schemas` map.
30
+ - `./responses` — the `IC*` TypeScript types for the JSON response bodies.
31
+ Zod-free; `import type` these to stay dependency-light.
32
+ - `./openapi.json` — the raw OpenAPI document.
33
+
34
+ This is **not** an HTTP client — there is no `createApiClient` and no
35
+ `@ai-sdk/*`-style provider here. Application code talks to the API over the
36
+ OpenAI-compatible surface; use `@ingram-tech/ai-sdk-adapter` and the standard
37
+ `@ai-sdk/*` types for that.
38
+
39
+ > Published as TypeScript source. Bun runs it directly; bundlers (Next, Vite,
40
+ > esbuild) compile it; type-only imports work in any `tsc` project. To consume the
41
+ > runtime Zod schemas from a plain (non-bundled) `tsc` Node build, transpile the
42
+ > package (e.g. Next `transpilePackages`).
43
+
44
+ ## Coverage
45
+
46
+ The contract is in two halves — generated + hand-authored:
47
+
48
+ - **Generated, from the OpenAPI document:** every path, method, param, **request
49
+ body**, and **non-streaming JSON response** is typed. ~28 of 124 operations
50
+ stay `unknown` by design — the **streaming/union** endpoints (`/runs`,
51
+ `/chat/completions`, `/responses` — a stream *or* JSON from one handler),
52
+ channel **webhook acks**, and the OAuth **redirect**. None are expressible as a
53
+ single response schema.
54
+ - **Hand-authored:** the `{v:1}` webhook/feed envelope and the SSE run-stream
55
+ frames, which OpenAPI can't describe, plus the `IC*` response types.
56
+
57
+ The OpenAI-compatible stream chunks themselves are standard — use the `@ai-sdk/*`
58
+ types rather than redefining them here.