@cratestack/ts-types 0.5.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stephane Segning
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @cratestack/ts-types
2
+
3
+ Shared TypeScript interfaces for CrateStack's generated TypeScript RPC client (`transport rpc`
4
+ schemas) and for the rest of the `@cratestack/*` npm family (`link-*`, `runtime-*`, `validator-*`,
5
+ `adapter-*`).
6
+
7
+ Pinned local copies of the wire/link contract generated into every CrateStack `transport rpc`
8
+ project by `crates/cratestack-client-typescript/templates/src/rpc-links.ts.j2` and
9
+ `rpc-runtime.ts.j2` ([issue #182](https://github.com/cratestack/cratestack/issues/182)). Kept as
10
+ plain interfaces/function types deliberately — a generated project's `CratestackRpcRuntime` is a
11
+ per-project class with no shared import path, so this package can't (and doesn't need to) import
12
+ it; TypeScript's structural typing means any object shaped like these types is assignable into a
13
+ generated client's `links` array, regardless of which project generated it.
14
+
15
+ This package has **no runtime code** — every export is an `interface` or `type`, so it compiles
16
+ away to (essentially) nothing. Everything else in the `@cratestack/*` family depends on it for
17
+ types only (`import type`), so pulling in `link-batch`, `validator-zod`, etc. never adds this
18
+ package's weight to your bundle.
19
+
20
+ ## Exports
21
+
22
+ - **`.`** — `RpcLink`, `RpcLinkRequest`, `RpcLinkResponse`, `RpcLinkNext`, `CratestackRpcCodec`,
23
+ `RpcRequest`, `RpcResponseFrame`, `RpcErrorBody`.
24
+ - **`./test-harness`** — `FakeRuntime`, a minimal in-memory runtime that mirrors
25
+ `CratestackRpcRuntime`'s chain construction exactly, for testing `RpcLink` implementations
26
+ against a real chain instead of a reimplementation of one. Not part of the public API surface —
27
+ used by this package's own tests and by every other `@cratestack/*` package's test suite.
28
+
29
+ ## Usage
30
+
31
+ ```ts
32
+ import type { RpcLink } from "@cratestack/ts-types";
33
+
34
+ export function createMyLink(): RpcLink {
35
+ return async (request, next) => {
36
+ // ...
37
+ return next(request);
38
+ };
39
+ }
40
+ ```
@@ -0,0 +1,65 @@
1
+ /** One request going through the chain — mirrors the generated
2
+ * `RpcLinkRequest`. */
3
+ export interface RpcLinkRequest {
4
+ readonly kind: "unary" | "batch";
5
+ readonly opId: string;
6
+ readonly input: unknown;
7
+ readonly headers: Headers;
8
+ readonly signal: AbortSignal | null;
9
+ readonly idempotencyKey?: string;
10
+ readonly codec: CratestackRpcCodec;
11
+ readonly fetchFn: typeof fetch;
12
+ readonly urls: {
13
+ unary(opId: string): string;
14
+ batch(): string;
15
+ };
16
+ }
17
+ /** Mirrors the generated `RpcLinkResponse`. */
18
+ export interface RpcLinkResponse {
19
+ readonly response: Response;
20
+ }
21
+ export type RpcLinkNext = (request: RpcLinkRequest) => Promise<RpcLinkResponse>;
22
+ /** Mirrors the generated `RpcLink`. */
23
+ export type RpcLink = (request: RpcLinkRequest, next: RpcLinkNext) => Promise<RpcLinkResponse>;
24
+ /** Mirrors the generated `CratestackRpcCodec`. */
25
+ export interface CratestackRpcCodec {
26
+ readonly contentType: string;
27
+ encode(value: unknown): BodyInit;
28
+ decode(bytes: Uint8Array): unknown;
29
+ }
30
+ /** Wire shape of a single `/rpc/batch` request frame — mirrors the
31
+ * generated `RpcRequest`. */
32
+ export interface RpcRequest<I = unknown> {
33
+ id: number;
34
+ op: string;
35
+ input: I;
36
+ idem?: string;
37
+ }
38
+ /** Wire shape of a single `/rpc/batch` response frame — mirrors the
39
+ * generated `RpcResponseFrame`. */
40
+ export interface RpcResponseFrame<O = unknown> {
41
+ id: number;
42
+ output?: O;
43
+ error?: RpcErrorBody;
44
+ }
45
+ /** Mirrors the generated `RpcErrorBody`. */
46
+ export interface RpcErrorBody {
47
+ code: string;
48
+ message: string;
49
+ details?: unknown;
50
+ }
51
+ /** Structural match for `CratestackRpcRuntime.call()` (see
52
+ * `crates/cratestack-client-typescript/templates/src/rpc-runtime.ts.j2`)
53
+ * — a generated client exposes this as its public `.runtime` field, so
54
+ * e.g. `rpcQueryOptions(client.runtime, opId, input)`
55
+ * (`@cratestack/adapter-tanstack-query`) or
56
+ * `createRpcBaseQuery(client.runtime)` (`@cratestack/adapter-rtk`) work
57
+ * against any generated project without either package importing its
58
+ * (per-project, unshared) class. Shared here rather than duplicated
59
+ * per adapter package, since both need the exact same contract. */
60
+ export interface RpcCaller {
61
+ call<I, O>(opId: string, input: I, options?: {
62
+ signal?: AbortSignal;
63
+ }): Promise<O>;
64
+ }
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA;wBACwB;AACxB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,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ACX,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;oEAQoE;AACpE,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACpF"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ // Pinned local copies of the wire/link contract generated into every
2
+ // CrateStack `transport rpc` project by
3
+ // `crates/cratestack-client-typescript/templates/src/rpc-links.ts.j2` and
4
+ // `rpc-runtime.ts.j2` (issue #182). Kept as plain interfaces/function
5
+ // types deliberately — a generated project's `CratestackRpcRuntime` is a
6
+ // per-project class with no shared import path, so this package can't
7
+ // (and doesn't need to) import it; TypeScript's structural typing means
8
+ // any object shaped like these types is assignable into a generated
9
+ // client's `links` array, regardless of which project generated it.
10
+ export {};
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,wCAAwC;AACxC,0EAA0E;AAC1E,sEAAsE;AACtE,yEAAyE;AACzE,sEAAsE;AACtE,wEAAwE;AACxE,oEAAoE;AACpE,oEAAoE"}
@@ -0,0 +1,25 @@
1
+ import type { RpcLink } from "./index.js";
2
+ export declare const jsonCodec: {
3
+ contentType: string;
4
+ encode(value: unknown): BodyInit;
5
+ decode(bytes: Uint8Array): unknown;
6
+ };
7
+ /** Mirrors `CratestackRpcRuntime`'s chain construction and `call()`/
8
+ * `batch()` request-building exactly (see
9
+ * `crates/cratestack-client-typescript/templates/src/rpc-runtime.ts.j2`),
10
+ * so these tests exercise the real generated contract rather than a
11
+ * reimplementation of it. Exported (as `@cratestack/ts-types/test-harness`,
12
+ * not part of the public `.` entry point) so every other `@cratestack/*`
13
+ * package's own test suite can exercise its `RpcLink` against a real
14
+ * chain instead of each maintaining its own copy. */
15
+ export declare class FakeRuntime {
16
+ private readonly chain;
17
+ private readonly fetchFn;
18
+ constructor(fetchFn: typeof fetch, links?: RpcLink[]);
19
+ call<O>(opId: string, input: unknown, opts?: {
20
+ signal?: AbortSignal;
21
+ idempotencyKey?: string;
22
+ }): Promise<O>;
23
+ batch(requests: unknown[]): Promise<unknown>;
24
+ }
25
+ //# sourceMappingURL=test-harness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-harness.d.ts","sourceRoot":"","sources":["../src/test-harness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA+B,MAAM,YAAY,CAAC;AAEvE,eAAO,MAAM,SAAS;;kBAEN,OAAO,GAAG,QAAQ;kBAGlB,UAAU,GAAG,OAAO;CAMnC,CAAC;AAaF;;;;;;;sDAOsD;AACtD,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE3B,OAAO,EAAE,OAAO,KAAK,EAAE,KAAK,GAAE,OAAO,EAAO;IAQlD,IAAI,CAAC,CAAC,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAO,GAC3D,OAAO,CAAC,CAAC,CAAC;IA2BP,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBnD"}
@@ -0,0 +1,83 @@
1
+ export const jsonCodec = {
2
+ contentType: "application/json",
3
+ encode(value) {
4
+ return JSON.stringify(value ?? null);
5
+ },
6
+ decode(bytes) {
7
+ if (bytes.length === 0) {
8
+ return undefined;
9
+ }
10
+ return JSON.parse(new TextDecoder().decode(bytes));
11
+ },
12
+ };
13
+ const terminalLink = async (request) => {
14
+ const url = request.kind === "batch" ? request.urls.batch() : request.urls.unary(request.opId);
15
+ const response = await request.fetchFn(url, {
16
+ method: "POST",
17
+ headers: request.headers,
18
+ body: request.codec.encode(request.input),
19
+ signal: request.signal,
20
+ });
21
+ return { response };
22
+ };
23
+ /** Mirrors `CratestackRpcRuntime`'s chain construction and `call()`/
24
+ * `batch()` request-building exactly (see
25
+ * `crates/cratestack-client-typescript/templates/src/rpc-runtime.ts.j2`),
26
+ * so these tests exercise the real generated contract rather than a
27
+ * reimplementation of it. Exported (as `@cratestack/ts-types/test-harness`,
28
+ * not part of the public `.` entry point) so every other `@cratestack/*`
29
+ * package's own test suite can exercise its `RpcLink` against a real
30
+ * chain instead of each maintaining its own copy. */
31
+ export class FakeRuntime {
32
+ chain;
33
+ fetchFn;
34
+ constructor(fetchFn, links = []) {
35
+ this.fetchFn = fetchFn;
36
+ this.chain = links.reduceRight((next, link) => (request) => link(request, next), terminalLink);
37
+ }
38
+ async call(opId, input, opts = {}) {
39
+ const request = {
40
+ kind: "unary",
41
+ opId,
42
+ input: input ?? null,
43
+ headers: new Headers(),
44
+ signal: opts.signal ?? null,
45
+ ...(opts.idempotencyKey !== undefined ? { idempotencyKey: opts.idempotencyKey } : {}),
46
+ codec: jsonCodec,
47
+ fetchFn: this.fetchFn,
48
+ urls: {
49
+ unary: (id) => `https://example.test/rpc/${id}`,
50
+ batch: () => "https://example.test/rpc/batch",
51
+ },
52
+ };
53
+ const { response } = await this.chain(request);
54
+ if (response.status === 204) {
55
+ return undefined;
56
+ }
57
+ const bytes = new Uint8Array(await response.arrayBuffer());
58
+ if (!response.ok) {
59
+ const body = jsonCodec.decode(bytes);
60
+ throw new Error(`rpc error ${body.code}: ${body.message}`);
61
+ }
62
+ return jsonCodec.decode(bytes);
63
+ }
64
+ async batch(requests) {
65
+ const request = {
66
+ kind: "batch",
67
+ opId: "batch",
68
+ input: requests,
69
+ headers: new Headers(),
70
+ signal: null,
71
+ codec: jsonCodec,
72
+ fetchFn: this.fetchFn,
73
+ urls: {
74
+ unary: (id) => `https://example.test/rpc/${id}`,
75
+ batch: () => "https://example.test/rpc/batch",
76
+ },
77
+ };
78
+ const { response } = await this.chain(request);
79
+ const bytes = new Uint8Array(await response.arrayBuffer());
80
+ return jsonCodec.decode(bytes);
81
+ }
82
+ }
83
+ //# sourceMappingURL=test-harness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-harness.js","sourceRoot":"","sources":["../src/test-harness.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,WAAW,EAAE,kBAAkB;IAC/B,MAAM,CAAC,KAAc;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,MAAM,CAAC,KAAiB;QACtB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;CACF,CAAC;AAEF,MAAM,YAAY,GAAgB,KAAK,EAAE,OAAO,EAAE,EAAE;IAClD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,MAAM;QAC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
4
+ "description": "Shared TypeScript interfaces for CrateStack's generated RPC client (RpcLink, RpcLinkRequest, wire frame shapes). Types only — compiles to near-empty JS.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/cratestack/cratestack.git",
9
+ "directory": "packages/cratestack-ts-types"
10
+ },
11
+ "homepage": "https://cratestack.dev",
12
+ "bugs": "https://github.com/cratestack/cratestack/issues",
13
+ "keywords": ["cratestack", "cstack", "rpc", "types", "trpc-links"],
14
+ "type": "module",
15
+ "sideEffects": false,
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ },
23
+ "./test-harness": {
24
+ "types": "./dist/test-harness.d.ts",
25
+ "import": "./dist/test-harness.js"
26
+ }
27
+ },
28
+ "files": ["dist", "README.md", "LICENSE"],
29
+ "scripts": {
30
+ "build": "tsc -p tsconfig.json",
31
+ "test": "vitest run",
32
+ "lint": "biome check ."
33
+ },
34
+ "devDependencies": {
35
+ "typescript": "^5.7.0",
36
+ "vitest": "^3.0.0"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ }
41
+ }