@glubean/grpc 0.1.4 → 0.2.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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * gRPC contract surface for @glubean/grpc.
3
+ *
4
+ * This module used to register `contract.grpc` + gRPC matchers as side effects
5
+ * at import time. In the plugin-manifest era that responsibility moved to the
6
+ * default export of `@glubean/grpc/src/index.ts`, which projects install
7
+ * explicitly via `installPlugin(...)` / `bootstrap()`.
8
+ *
9
+ * This file is now **side-effect-free** — it only re-exports the adapter,
10
+ * factory, types, and matcher collection so the manifest in `../index.ts`
11
+ * can reference them.
12
+ */
13
+ export { grpcAdapter } from "./adapter.js";
14
+ export { createGrpcFactory, createGrpcRoot } from "./factory.js";
15
+ export { grpcMatchers } from "./matchers.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * gRPC custom matchers for `ctx.expect()`.
3
+ *
4
+ * Registered as a side effect of `import "@glubean/grpc"` (see `./index.ts`).
5
+ * No extra import or configure step required — the matchers become available
6
+ * on every `ctx.expect(res)` call and are fully typed via the
7
+ * `CustomMatchers<T>` declaration merging block below.
8
+ *
9
+ * Matchers work on any object that carries gRPC response shape, including:
10
+ * - `GrpcCallResult` from `@glubean/grpc` transport (direct client.call)
11
+ * - `GrpcCaseResult` from the contract adapter (verify callback / flow
12
+ * `out` lens input)
13
+ *
14
+ * The canonical shape both produce:
15
+ * {
16
+ * message: T,
17
+ * status: { code: number, details: string },
18
+ * responseMetadata: Record<string, string>,
19
+ * duration: number,
20
+ * }
21
+ *
22
+ * See `packages/sdk/src/expect.ts` for the underlying `MatcherResult` /
23
+ * `Expectation.extend` / `CustomMatchers<T>` contracts.
24
+ */
25
+ import { type MatcherResult } from "@glubean/sdk/expect";
26
+ declare module "@glubean/sdk/expect" {
27
+ interface CustomMatchers<T> {
28
+ /**
29
+ * Assert the gRPC status code on a `GrpcCallResult` / `GrpcCaseResult`.
30
+ *
31
+ * @param code Expected gRPC status code (`0` = OK, `5` = NOT_FOUND, etc.)
32
+ * @param message Optional context prepended to the assertion message
33
+ *
34
+ * @example ctx.expect(res).toHaveGrpcStatus(0);
35
+ * @example ctx.expect(res).toHaveGrpcStatus(5, "user lookup");
36
+ */
37
+ toHaveGrpcStatus(code: number, message?: string): Expectation<T>;
38
+ /**
39
+ * Convenience: assert status code is `0` (OK).
40
+ * Equivalent to `toHaveGrpcStatus(0)` but reads better in test bodies.
41
+ *
42
+ * @example ctx.expect(res).toHaveGrpcOk();
43
+ */
44
+ toHaveGrpcOk(message?: string): Expectation<T>;
45
+ /**
46
+ * Assert presence (and optionally value) of a key in response metadata.
47
+ *
48
+ * @param key Metadata key (case-insensitive per gRPC spec; compared as lowercased)
49
+ * @param value Optional exact expected value; when omitted, only presence is checked
50
+ * @param message Optional context prepended to the assertion message
51
+ *
52
+ * @example ctx.expect(res).toHaveGrpcMetadata("x-request-id");
53
+ * @example ctx.expect(res).toHaveGrpcMetadata("x-tenant", "acme");
54
+ */
55
+ toHaveGrpcMetadata(key: string, value?: string, message?: string): Expectation<T>;
56
+ }
57
+ }
58
+ /**
59
+ * Collection of gRPC custom matchers, keyed by matcher name.
60
+ *
61
+ * Consumed by the plugin manifest in `grpc/src/index.ts` as
62
+ * `manifest.matchers`. `installPlugin` drives the actual
63
+ * `Expectation.extend` call — plugin authors never need to touch it directly.
64
+ */
65
+ export declare const grpcMatchers: {
66
+ readonly toHaveGrpcStatus: (actual: unknown, ...args: unknown[]) => MatcherResult;
67
+ readonly toHaveGrpcOk: (actual: unknown) => MatcherResult;
68
+ readonly toHaveGrpcMetadata: (actual: unknown, ...args: unknown[]) => MatcherResult;
69
+ };
70
+ //# sourceMappingURL=matchers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../../src/contract/matchers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAM/E,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,cAAc,CAAC,CAAC;QACxB;;;;;;;;WAQG;QACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAEjE;;;;;WAKG;QACH,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAE/C;;;;;;;;;WASG;QACH,kBAAkB,CAChB,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,WAAW,CAAC,CAAC,CAAC,CAAC;KACnB;CACF;AAgJD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;wCA1Gf,OAAO,WACN,OAAO,EAAE,KACjB,aAAa;oCAyBc,OAAO,KAAG,aAAa;0CAwB3C,OAAO,WACN,OAAO,EAAE,KACjB,aAAa;CAyDN,CAAC"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * gRPC custom matchers for `ctx.expect()`.
3
+ *
4
+ * Registered as a side effect of `import "@glubean/grpc"` (see `./index.ts`).
5
+ * No extra import or configure step required — the matchers become available
6
+ * on every `ctx.expect(res)` call and are fully typed via the
7
+ * `CustomMatchers<T>` declaration merging block below.
8
+ *
9
+ * Matchers work on any object that carries gRPC response shape, including:
10
+ * - `GrpcCallResult` from `@glubean/grpc` transport (direct client.call)
11
+ * - `GrpcCaseResult` from the contract adapter (verify callback / flow
12
+ * `out` lens input)
13
+ *
14
+ * The canonical shape both produce:
15
+ * {
16
+ * message: T,
17
+ * status: { code: number, details: string },
18
+ * responseMetadata: Record<string, string>,
19
+ * duration: number,
20
+ * }
21
+ *
22
+ * See `packages/sdk/src/expect.ts` for the underlying `MatcherResult` /
23
+ * `Expectation.extend` / `CustomMatchers<T>` contracts.
24
+ */
25
+ import { inspect } from "@glubean/sdk/expect";
26
+ function readStatusCode(actual) {
27
+ const s = actual?.status;
28
+ return typeof s?.code === "number" ? s.code : undefined;
29
+ }
30
+ function readStatusDetails(actual) {
31
+ const s = actual?.status;
32
+ return typeof s?.details === "string" ? s.details : undefined;
33
+ }
34
+ function readMetadata(actual) {
35
+ const md = actual?.responseMetadata;
36
+ return md && typeof md === "object" ? md : undefined;
37
+ }
38
+ function findMetadataEntry(md, key) {
39
+ const lower = key.toLowerCase();
40
+ for (const [k, v] of Object.entries(md)) {
41
+ if (k.toLowerCase() === lower)
42
+ return [k, v];
43
+ }
44
+ return undefined;
45
+ }
46
+ // =============================================================================
47
+ // Matcher implementations
48
+ // =============================================================================
49
+ const toHaveGrpcStatus = (actual, ...args) => {
50
+ const code = args[0];
51
+ const actualCode = readStatusCode(actual);
52
+ const details = readStatusDetails(actual);
53
+ if (actualCode === undefined) {
54
+ return {
55
+ passed: false,
56
+ message: `to have gRPC status ${code} — actual has no \`.status.code\` (got ${inspect(actual)})`,
57
+ actual,
58
+ expected: code,
59
+ };
60
+ }
61
+ return {
62
+ passed: actualCode === code,
63
+ message: details
64
+ ? `to have gRPC status ${code} (got ${actualCode}: ${details})`
65
+ : `to have gRPC status ${code}`,
66
+ actual: actualCode,
67
+ expected: code,
68
+ };
69
+ };
70
+ const toHaveGrpcOk = (actual) => {
71
+ const actualCode = readStatusCode(actual);
72
+ const details = readStatusDetails(actual);
73
+ if (actualCode === undefined) {
74
+ return {
75
+ passed: false,
76
+ message: `to have gRPC status OK (0) — actual has no \`.status.code\``,
77
+ actual,
78
+ expected: 0,
79
+ };
80
+ }
81
+ return {
82
+ passed: actualCode === 0,
83
+ message: details
84
+ ? `to have gRPC status OK (0) (got ${actualCode}: ${details})`
85
+ : `to have gRPC status OK (0)`,
86
+ actual: actualCode,
87
+ expected: 0,
88
+ };
89
+ };
90
+ const toHaveGrpcMetadata = (actual, ...args) => {
91
+ const key = args[0];
92
+ const expectedValue = args[1];
93
+ const md = readMetadata(actual);
94
+ if (!md) {
95
+ return {
96
+ passed: false,
97
+ message: `to have gRPC metadata \`${key}\` — actual has no \`.responseMetadata\``,
98
+ actual,
99
+ expected: expectedValue !== undefined ? { [key]: expectedValue } : key,
100
+ };
101
+ }
102
+ const entry = findMetadataEntry(md, key);
103
+ if (!entry) {
104
+ return {
105
+ passed: false,
106
+ message: `to have gRPC metadata \`${key}\``,
107
+ actual: md,
108
+ expected: expectedValue !== undefined ? { [key]: expectedValue } : key,
109
+ };
110
+ }
111
+ if (expectedValue === undefined) {
112
+ return {
113
+ passed: true,
114
+ message: `to have gRPC metadata \`${key}\``,
115
+ actual: entry[1],
116
+ expected: key,
117
+ };
118
+ }
119
+ return {
120
+ passed: entry[1] === expectedValue,
121
+ message: `to have gRPC metadata \`${key}\` = ${inspect(expectedValue)}`,
122
+ actual: entry[1],
123
+ expected: expectedValue,
124
+ };
125
+ };
126
+ // =============================================================================
127
+ // Matcher collection — consumed by the plugin manifest
128
+ // =============================================================================
129
+ /**
130
+ * Collection of gRPC custom matchers, keyed by matcher name.
131
+ *
132
+ * Consumed by the plugin manifest in `grpc/src/index.ts` as
133
+ * `manifest.matchers`. `installPlugin` drives the actual
134
+ * `Expectation.extend` call — plugin authors never need to touch it directly.
135
+ */
136
+ export const grpcMatchers = {
137
+ toHaveGrpcStatus,
138
+ toHaveGrpcOk,
139
+ toHaveGrpcMetadata,
140
+ };
141
+ //# sourceMappingURL=matchers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchers.js","sourceRoot":"","sources":["../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AEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,YAAY;IACZ,kBAAkB;CACV,CAAC"}
@@ -0,0 +1,227 @@
1
+ /**
2
+ * gRPC contract types.
3
+ *
4
+ * User-facing authoring types + adapter-level payload types for the
5
+ * gRPC contract adapter (single-package model — see
6
+ * `internal/40-discovery/proposals/contract-grpc-graphql-expansion.md` §5.1).
7
+ *
8
+ * Structure mirrors `packages/sdk/src/contract-http/types.ts` where
9
+ * applicable, with gRPC-specific semantics:
10
+ * - Target is "Service/Method" (wire format); renderTarget → "Service.Method"
11
+ * - Status codes are gRPC 0-16 (not HTTP 4xx/5xx)
12
+ * - Metadata replaces HTTP headers (metadata carries both ingress + egress)
13
+ * - Deadlines replace HTTP timeouts (ms)
14
+ * - Phase 1 scope: unary RPCs only (no streaming)
15
+ */
16
+ import type { SchemaLike, TestContext } from "@glubean/sdk";
17
+ import type { BaseCaseSpec, Extensions } from "@glubean/sdk";
18
+ import type { GrpcClient } from "../index.js";
19
+ /**
20
+ * Defaults for a gRPC contract instance (contract.grpc.with("name", {...})).
21
+ *
22
+ * Note: connection-level settings (address, TLS, proto path) are owned by
23
+ * the transport plugin (configure({grpc: grpc({proto, address, ...})})).
24
+ * The contract-layer instance only captures content defaults that apply
25
+ * across contracts authored under this instance.
26
+ */
27
+ export interface GrpcContractDefaults {
28
+ /** Default gRPC client for all contracts in this instance. */
29
+ client?: GrpcClient;
30
+ /** Tags inherited by all contracts in this instance. */
31
+ tags?: string[];
32
+ /** Default feature grouping key. */
33
+ feature?: string;
34
+ /** Default metadata for all contracts (merged per-case). */
35
+ metadata?: Record<string, string>;
36
+ /** Default deadline in ms for all contracts in this instance. */
37
+ deadlineMs?: number;
38
+ /** OpenAPI-style extensions (x-* keys). Inherited by all contracts. */
39
+ extensions?: Extensions;
40
+ }
41
+ export interface GrpcContractExample<T = unknown> {
42
+ value: T;
43
+ summary?: string;
44
+ description?: string;
45
+ }
46
+ /**
47
+ * Response expectations for a gRPC case.
48
+ *
49
+ * `statusCode` is the gRPC canonical status (0 = OK, 3 = INVALID_ARGUMENT,
50
+ * 5 = NOT_FOUND, 7 = PERMISSION_DENIED, 14 = UNAVAILABLE, 16 = UNAUTHENTICATED,
51
+ * etc.). Phase 1 default: `0` (OK) when not specified.
52
+ */
53
+ export interface GrpcContractExpect<T = unknown> {
54
+ /** Expected gRPC status code (0 = OK). Default: 0 when omitted. */
55
+ statusCode?: number;
56
+ /** Zod/Valibot schema for response message (when statusCode === 0). */
57
+ schema?: SchemaLike<T>;
58
+ /** Partial expected message shape (object — `toMatchObject` semantics). */
59
+ message?: Partial<T>;
60
+ /** Schema for response metadata (trailing). */
61
+ metadata?: SchemaLike<Record<string, string>>;
62
+ /** Partial expected response metadata. */
63
+ metadataMatch?: Record<string, string>;
64
+ /** Single response example (for docs / projection). */
65
+ example?: T;
66
+ /** Named response examples. */
67
+ examples?: Record<string, GrpcContractExample<T>>;
68
+ }
69
+ /**
70
+ * One case on a gRPC contract.
71
+ *
72
+ * Function-valued fields (`request`, `metadata`) reference case-local setup
73
+ * state. In flow mode these are rejected by `validateCaseForFlow` (same
74
+ * discipline as HTTP's function-valued body/params/query/headers).
75
+ */
76
+ export interface GrpcContractCase<Req = unknown, Res = unknown, S = void> extends BaseCaseSpec {
77
+ /** Per-case gRPC client override. */
78
+ client?: GrpcClient;
79
+ /** Why this case exists — required. */
80
+ description: string;
81
+ /** Expected response. */
82
+ expect?: GrpcContractExpect<Res>;
83
+ /**
84
+ * Request message. Object shorthand or a function of setup state.
85
+ * Merged deep-style over contract `defaults.request`.
86
+ */
87
+ request?: Req | ((state: S) => Req);
88
+ /** Per-call metadata (merged with instance + contract defaults). */
89
+ metadata?: Record<string, string> | ((state: S) => Record<string, string>);
90
+ /** Per-call deadline in ms (overrides instance / contract defaults). */
91
+ deadlineMs?: number;
92
+ /** Setup runs before the call. Return value flows to request/metadata fn + teardown. */
93
+ setup?: (ctx: TestContext) => Promise<S>;
94
+ /** Teardown runs after verify, even on failure. */
95
+ teardown?: (ctx: TestContext, state: S) => Promise<void>;
96
+ /** Business-logic verify — runs after status + schema + message match. */
97
+ verify?: (ctx: TestContext, res: GrpcCaseResult<Res>) => void | Promise<void>;
98
+ }
99
+ /**
100
+ * Result of running a single case. This is also the `CaseOutput` shape that
101
+ * flow `step.out(state, res)` lens receives.
102
+ *
103
+ * Mirrors `@glubean/grpc`'s `GrpcCallResult<T>` but nested under a contract-
104
+ * layer shape so adapter-layer additions (e.g. assertion diagnostics) can
105
+ * grow independently.
106
+ */
107
+ export interface GrpcCaseResult<Res = unknown> {
108
+ /** Decoded response message. */
109
+ message: Res;
110
+ /** gRPC status. `code` is 0 for OK. */
111
+ status: {
112
+ code: number;
113
+ details: string;
114
+ };
115
+ /** Response (trailing) metadata. */
116
+ responseMetadata: Record<string, string>;
117
+ /** Duration in ms. */
118
+ duration: number;
119
+ }
120
+ /**
121
+ * User-facing gRPC contract specification.
122
+ *
123
+ * `target` is the wire-format "Service/Method" string (e.g. "PaymentService/
124
+ * Complete"). `renderTarget` will display as "PaymentService.Complete" in
125
+ * UI but wire format stays as source of truth.
126
+ *
127
+ * Contract identity = contract id (string) + case key. Target is a display
128
+ * hint, NOT an identity — proposal §5.3.
129
+ */
130
+ export interface GrpcContractSpec<Req = unknown, Res = unknown, Cases extends Record<string, GrpcContractCase<Req, Res, any>> = Record<string, GrpcContractCase<Req, Res>>> {
131
+ /** Wire-format target: "ServiceName/MethodName". */
132
+ target: string;
133
+ /** Default gRPC client for all cases. */
134
+ client?: GrpcClient;
135
+ description?: string;
136
+ feature?: string;
137
+ /** Contract-level request schema (OpenAPI-style docs + possible runtime validation). */
138
+ requestSchema?: SchemaLike<Req>;
139
+ /** Contract-level default request (merged under each case's request). */
140
+ defaultRequest?: Partial<Req>;
141
+ /** Contract-level default metadata (merged under each case's metadata). */
142
+ defaultMetadata?: Record<string, string>;
143
+ /** Contract-level default deadline (ms). */
144
+ deadlineMs?: number;
145
+ tags?: string[];
146
+ deprecated?: string;
147
+ extensions?: Extensions;
148
+ /** Named spec cases. */
149
+ cases: Cases;
150
+ }
151
+ /**
152
+ * Runtime (live) payload shape for the gRPC adapter. Contains SchemaLike
153
+ * references. Converted to GrpcSafeSchemas by adapter.normalize.
154
+ */
155
+ export interface GrpcPayloadSchemas {
156
+ request?: SchemaLike<unknown>;
157
+ response?: SchemaLike<unknown>;
158
+ metadata?: SchemaLike<Record<string, string>>;
159
+ /** Request examples (for docs / projection). */
160
+ requestExample?: unknown;
161
+ requestExamples?: Record<string, GrpcContractExample<unknown>>;
162
+ }
163
+ /**
164
+ * JSON-safe payload shape. Produced by adapter.normalize.
165
+ * SchemaLike references are converted to JSON Schema fragments.
166
+ */
167
+ export interface GrpcSafeSchemas {
168
+ request?: Record<string, unknown>;
169
+ response?: Record<string, unknown>;
170
+ metadata?: Record<string, unknown>;
171
+ requestExample?: unknown;
172
+ requestExamples?: Record<string, GrpcContractExample<unknown>>;
173
+ }
174
+ /**
175
+ * Runtime contract-level meta. Carried on the projection so scanner / MCP /
176
+ * Cloud can surface structural info without needing the live spec.
177
+ *
178
+ * Note: `.proto` file path is intentionally NOT stored here (execution log
179
+ * OQ-2 decision 2026-04-20). The proto path is a runtime transport concern
180
+ * owned by `configure({grpc: grpc({proto: ...})})`, not by the contract.
181
+ * Contract is protocol-idea-level, transport config is deployment-level.
182
+ */
183
+ export interface GrpcContractMeta {
184
+ /** Raw target "Service/Method". */
185
+ target: string;
186
+ /** Parsed service name ("PaymentService"). */
187
+ service: string;
188
+ /** Parsed method name ("Complete"). */
189
+ method: string;
190
+ /** Contract-level default metadata (for projection display). */
191
+ defaultMetadata?: Record<string, string>;
192
+ /** Contract-level deadline (for projection display). */
193
+ deadlineMs?: number;
194
+ /** Contract instance name (contract.grpc.with("name")). */
195
+ instanceName?: string;
196
+ }
197
+ /**
198
+ * JSON-safe meta. Same as runtime meta (no live references).
199
+ */
200
+ export type GrpcContractSafeMeta = GrpcContractMeta;
201
+ /**
202
+ * What `executeCaseInFlow` returns, and what flow `step.out(state, res)`
203
+ * receives in its `res` parameter. Mirrors `GrpcCaseResult` — kept as a
204
+ * distinct export to make the flow-output contract explicit (parallel to
205
+ * HTTP's `HttpFlowCaseOutput` convention).
206
+ */
207
+ export type GrpcFlowCaseOutput<Res = unknown> = GrpcCaseResult<Res>;
208
+ /**
209
+ * Signature of `contract.grpc.with("name", defaults)`. Returns a contract
210
+ * factory that creates contracts under this instance's defaults.
211
+ *
212
+ * Actual implementation in `./factory.ts` (CG-4).
213
+ */
214
+ export type GrpcContractRoot = {
215
+ with: (instanceName: string, defaults?: GrpcContractDefaults) => GrpcContractFactory;
216
+ };
217
+ export type GrpcContractFactory = <Req, Res, Cases extends Record<string, GrpcContractCase<Req, Res, any>>>(id: string, spec: GrpcContractSpec<Req, Res, Cases>) => unknown;
218
+ /**
219
+ * Infer request type from a GrpcContractCase. Placeholder for future
220
+ * ergonomic inference helpers parallel to HTTP's InferHttpInputs.
221
+ */
222
+ export type InferGrpcRequest<C> = C extends GrpcContractCase<infer Req, any, any> ? Req : never;
223
+ /**
224
+ * Infer response type from a GrpcContractCase.
225
+ */
226
+ export type InferGrpcResponse<C> = C extends GrpcContractCase<any, infer Res, any> ? Res : never;
227
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/contract/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAM9C;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,wDAAwD;IACxD,IAA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G,EAAE,KAAK,CAAC,KACpC,OAAO,CAAC;AAMb;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;AAEhG;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * gRPC contract types.
3
+ *
4
+ * User-facing authoring types + adapter-level payload types for the
5
+ * gRPC contract adapter (single-package model — see
6
+ * `internal/40-discovery/proposals/contract-grpc-graphql-expansion.md` §5.1).
7
+ *
8
+ * Structure mirrors `packages/sdk/src/contract-http/types.ts` where
9
+ * applicable, with gRPC-specific semantics:
10
+ * - Target is "Service/Method" (wire format); renderTarget → "Service.Method"
11
+ * - Status codes are gRPC 0-16 (not HTTP 4xx/5xx)
12
+ * - Metadata replaces HTTP headers (metadata carries both ingress + egress)
13
+ * - Deadlines replace HTTP timeouts (ms)
14
+ * - Phase 1 scope: unary RPCs only (no streaming)
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/contract/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,17 @@
1
1
  /**
2
- * gRPC plugin for Glubean tests.
2
+ * @glubean/grpc 0.2.0 single-package owner of both:
3
+ * - Transport / test-plugin layer (this file — unchanged from 0.1.x)
4
+ * - Contract adapter layer (`./contract/`, registered via side-effect import)
3
5
  *
4
- * Provides a thin wrapper over `@grpc/grpc-js` that simplifies
5
- * unary gRPC calls with auto-tracing via Glubean events.
6
+ * Importing this package (side-effect) registers the gRPC contract adapter:
7
+ * `contract.register("grpc", grpcAdapter)` `contract.grpc.with(...)` UX.
8
+ *
9
+ * See `./contract/index.ts` for the registration logic. See
10
+ * `internal/40-discovery/proposals/contract-grpc-graphql-expansion.md` §5.1
11
+ * for the single-package rationale ("contract is a first-class citizen").
12
+ *
13
+ * Transport (this file) — provides a thin wrapper over `@grpc/grpc-js` that
14
+ * simplifies unary gRPC calls with auto-tracing via Glubean events.
6
15
  *
7
16
  * ## Usage
8
17
  *
@@ -48,7 +57,7 @@
48
57
  * @module grpc
49
58
  */
50
59
  import type * as grpcTypes from "@grpc/grpc-js";
51
- import type { PluginFactory } from "@glubean/sdk";
60
+ import type { ClientFactory, PluginManifest } from "@glubean/sdk";
52
61
  /** Options for creating a gRPC client. */
53
62
  export interface GrpcClientOptions {
54
63
  /** Path to the .proto file */
@@ -165,7 +174,7 @@ export interface GrpcPluginOptions {
165
174
  * });
166
175
  * ```
167
176
  */
168
- export declare function grpc(options: GrpcPluginOptions): PluginFactory<GrpcClient>;
177
+ export declare function grpc(options: GrpcPluginOptions): ClientFactory<GrpcClient>;
169
178
  /**
170
179
  * Redaction scope declarations for gRPC traces.
171
180
  *
@@ -201,4 +210,29 @@ export declare const GRPC_REDACTION_SCOPES: ({
201
210
  handler: "json";
202
211
  rules?: undefined;
203
212
  })[];
213
+ /**
214
+ * Plugin manifest for `@glubean/grpc`. Declares:
215
+ *
216
+ * - `matchers` — `toHaveGrpcStatus`, `toHaveGrpcOk`, `toHaveGrpcMetadata`
217
+ * - `contracts` — `grpc` protocol adapter
218
+ * - `setup()` — wraps the auto-attached `contract.grpc` dispatcher with
219
+ * `createGrpcRoot` so `contract.grpc.with("name", { client })`
220
+ * UX works
221
+ *
222
+ * Install explicitly in your project's `glubean.setup.ts`:
223
+ *
224
+ * ```ts
225
+ * import { installPlugin } from "@glubean/sdk";
226
+ * import grpcPlugin from "@glubean/grpc";
227
+ * await installPlugin(grpcPlugin);
228
+ * ```
229
+ *
230
+ * **Note:** top-level `import "@glubean/grpc"` is **no longer** a side-effect
231
+ * registration. The manifest must be installed explicitly (directly or via
232
+ * `bootstrap(projectRoot)` which loads `glubean.setup.ts`).
233
+ */
234
+ declare const grpcPlugin: PluginManifest;
235
+ export default grpcPlugin;
236
+ export { grpcAdapter, createGrpcFactory, createGrpcRoot, grpcMatchers, } from "./contract/index.js";
237
+ export type { GrpcContractCase, GrpcContractDefaults, GrpcContractExample, GrpcContractExpect, GrpcContractFactory, GrpcContractMeta, GrpcContractRoot, GrpcContractSafeMeta, GrpcContractSpec, GrpcCaseResult, GrpcFlowCaseOutput, GrpcPayloadSchemas, GrpcSafeSchemas, InferGrpcRequest, InferGrpcResponse, } from "./contract/index.js";
204
238
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,KAAK,KAAK,SAAS,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,cAAc,CAAC;AAoBlE,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,qDAAqD;IACrD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAU;IACzB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,O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