@scrawn/core 0.0.2 → 0.0.6
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 +40 -0
- package/dist/config.d.ts +17 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +9 -2
- package/dist/config.js.map +1 -1
- package/dist/core/auth/apiKeyAuth.d.ts +4 -13
- package/dist/core/auth/apiKeyAuth.d.ts.map +1 -1
- package/dist/core/auth/apiKeyAuth.js +12 -17
- package/dist/core/auth/apiKeyAuth.js.map +1 -1
- package/dist/core/auth/baseAuth.d.ts +14 -36
- package/dist/core/auth/baseAuth.d.ts.map +1 -1
- package/dist/core/auth/baseAuth.js +0 -6
- package/dist/core/auth/baseAuth.js.map +1 -1
- package/dist/core/errors/index.d.ts +192 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +280 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/grpc/callContext.d.ts +18 -0
- package/dist/core/grpc/callContext.d.ts.map +1 -0
- package/dist/core/grpc/callContext.js +35 -0
- package/dist/core/grpc/callContext.js.map +1 -0
- package/dist/core/grpc/client.d.ts +13 -123
- package/dist/core/grpc/client.d.ts.map +1 -1
- package/dist/core/grpc/client.js +23 -131
- package/dist/core/grpc/client.js.map +1 -1
- package/dist/core/grpc/index.d.ts +5 -3
- package/dist/core/grpc/index.d.ts.map +1 -1
- package/dist/core/grpc/index.js +4 -2
- package/dist/core/grpc/index.js.map +1 -1
- package/dist/core/grpc/requestBuilder.d.ts +12 -113
- package/dist/core/grpc/requestBuilder.d.ts.map +1 -1
- package/dist/core/grpc/requestBuilder.js +36 -126
- package/dist/core/grpc/requestBuilder.js.map +1 -1
- package/dist/core/grpc/streamRequestBuilder.d.ts +13 -0
- package/dist/core/grpc/streamRequestBuilder.d.ts.map +1 -0
- package/dist/core/grpc/streamRequestBuilder.js +60 -0
- package/dist/core/grpc/streamRequestBuilder.js.map +1 -0
- package/dist/core/grpc/types.d.ts +5 -52
- package/dist/core/grpc/types.d.ts.map +1 -1
- package/dist/core/grpc/types.js +0 -7
- package/dist/core/grpc/types.js.map +1 -1
- package/dist/core/pricing/builders.d.ts +157 -0
- package/dist/core/pricing/builders.d.ts.map +1 -0
- package/dist/core/pricing/builders.js +218 -0
- package/dist/core/pricing/builders.js.map +1 -0
- package/dist/core/pricing/index.d.ts +30 -0
- package/dist/core/pricing/index.d.ts.map +1 -0
- package/dist/core/pricing/index.js +32 -0
- package/dist/core/pricing/index.js.map +1 -0
- package/dist/core/pricing/resolve.d.ts +39 -0
- package/dist/core/pricing/resolve.d.ts.map +1 -0
- package/dist/core/pricing/resolve.js +50 -0
- package/dist/core/pricing/resolve.js.map +1 -0
- package/dist/core/pricing/serialize.d.ts +55 -0
- package/dist/core/pricing/serialize.d.ts.map +1 -0
- package/dist/core/pricing/serialize.js +127 -0
- package/dist/core/pricing/serialize.js.map +1 -0
- package/dist/core/pricing/types.d.ts +122 -0
- package/dist/core/pricing/types.d.ts.map +1 -0
- package/dist/core/pricing/types.js +17 -0
- package/dist/core/pricing/types.js.map +1 -0
- package/dist/core/pricing/validate.d.ts +56 -0
- package/dist/core/pricing/validate.d.ts.map +1 -0
- package/dist/core/pricing/validate.js +162 -0
- package/dist/core/pricing/validate.js.map +1 -0
- package/dist/core/scrawn.d.ts +218 -17
- package/dist/core/scrawn.d.ts.map +1 -1
- package/dist/core/scrawn.js +469 -71
- package/dist/core/scrawn.js.map +1 -1
- package/dist/core/types/auth.d.ts +1 -1
- package/dist/core/types/event.d.ts +182 -18
- package/dist/core/types/event.d.ts.map +1 -1
- package/dist/core/types/event.js +133 -5
- package/dist/core/types/event.js.map +1 -1
- package/dist/gen/auth/v1/auth_grpc_pb.d.ts +3 -0
- package/dist/gen/auth/v1/auth_grpc_pb.js +45 -0
- package/dist/gen/auth/v1/auth_pb.d.ts +63 -57
- package/dist/gen/auth/v1/auth_pb.js +471 -86
- package/dist/gen/data/v1/data_grpc_pb.d.ts +5 -0
- package/dist/gen/data/v1/data_grpc_pb.js +44 -0
- package/dist/gen/data/v1/data_pb.d.ts +254 -0
- package/dist/gen/data/v1/data_pb.js +1530 -0
- package/dist/gen/event/v1/event_grpc_pb.d.ts +3 -0
- package/dist/gen/event/v1/event_grpc_pb.js +79 -0
- package/dist/gen/event/v1/event_pb.d.ts +273 -100
- package/dist/gen/event/v1/event_pb.js +1862 -138
- package/dist/gen/package.json +3 -0
- package/dist/gen/payment/v1/payment_grpc_pb.d.ts +3 -0
- package/dist/gen/payment/v1/payment_grpc_pb.js +45 -0
- package/dist/gen/payment/v1/payment_pb.d.ts +43 -35
- package/dist/gen/payment/v1/payment_pb.js +321 -59
- package/dist/gen/query/v1/query_grpc_pb.d.ts +5 -0
- package/dist/gen/query/v1/query_grpc_pb.js +44 -0
- package/dist/gen/query/v1/query_pb.d.ts +359 -0
- package/dist/gen/query/v1/query_pb.js +2327 -0
- package/dist/index.d.ts +19 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -10
- package/dist/index.js.map +1 -1
- package/dist/utils/forkAsyncIterable.d.ts +13 -0
- package/dist/utils/forkAsyncIterable.d.ts.map +1 -0
- package/dist/utils/forkAsyncIterable.js +78 -0
- package/dist/utils/forkAsyncIterable.js.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +19 -19
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/pathMatcher.js +5 -5
- package/package.json +19 -15
- package/dist/gen/auth/v1/auth_connect.d.ts +0 -22
- package/dist/gen/auth/v1/auth_connect.d.ts.map +0 -1
- package/dist/gen/auth/v1/auth_connect.js +0 -26
- package/dist/gen/auth/v1/auth_connect.js.map +0 -1
- package/dist/gen/auth/v1/auth_pb.d.ts.map +0 -1
- package/dist/gen/auth/v1/auth_pb.js.map +0 -1
- package/dist/gen/event/v1/event_connect.d.ts +0 -22
- package/dist/gen/event/v1/event_connect.d.ts.map +0 -1
- package/dist/gen/event/v1/event_connect.js +0 -26
- package/dist/gen/event/v1/event_connect.js.map +0 -1
- package/dist/gen/event/v1/event_pb.d.ts.map +0 -1
- package/dist/gen/event/v1/event_pb.js.map +0 -1
- package/dist/gen/payment/v1/payment_connect.d.ts +0 -22
- package/dist/gen/payment/v1/payment_connect.d.ts.map +0 -1
- package/dist/gen/payment/v1/payment_connect.js +0 -26
- package/dist/gen/payment/v1/payment_connect.js.map +0 -1
- package/dist/gen/payment/v1/payment_pb.d.ts.map +0 -1
- package/dist/gen/payment/v1/payment_pb.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/core/grpc/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/core/grpc/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;AAO3C,MAAM,OAAO,UAAU;IAIrB,YAAY,MAAc,EAAE,OAA2B;QACrD,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACb,0BAA0B,MAAM,8BAA8B,CAC/D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW;YACd,OAAO,EAAE,WAAW;gBACpB,CAAC,OAAO,EAAE,MAAM;oBACd,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;oBAC9B,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;QAEzC,GAAG,CAAC,IAAI,CACN,+BAA+B,MAAM,KAAK,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,CACrF,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAS,EACT,MAAc;QAEd,OAAO,IAAI,cAAc,CACvB,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CACrF,CAAC;IACJ,CAAC;IAED,aAAa,CACX,MAAS,EACT,MAAc;QAEd,OAAO,IAAI,oBAAoB,CAC7B,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAC3F,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module grpc
|
|
8
8
|
*/
|
|
9
|
-
export { GrpcClient } from
|
|
10
|
-
export {
|
|
11
|
-
export
|
|
9
|
+
export { GrpcClient, type GrpcClientOptions } from "./client.js";
|
|
10
|
+
export { GrpcCallContext } from "./callContext.js";
|
|
11
|
+
export { RequestBuilder } from "./requestBuilder.js";
|
|
12
|
+
export { StreamRequestBuilder } from "./streamRequestBuilder.js";
|
|
13
|
+
export type { GrpcCallOptions, ServiceMethodName } from "./types.js";
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/core/grpc/index.js
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module grpc
|
|
8
8
|
*/
|
|
9
|
-
export { GrpcClient } from
|
|
10
|
-
export {
|
|
9
|
+
export { GrpcClient } from "./client.js";
|
|
10
|
+
export { GrpcCallContext } from "./callContext.js";
|
|
11
|
+
export { RequestBuilder } from "./requestBuilder.js";
|
|
12
|
+
export { StreamRequestBuilder } from "./streamRequestBuilder.js";
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/grpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/grpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAA0B,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,116 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* - Autocomplete for service methods and payload fields
|
|
7
|
-
* - Runtime validation of request state
|
|
8
|
-
* - Clean separation of concerns
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const response = await client
|
|
13
|
-
* .newCall(EventService, 'registerEvent')
|
|
14
|
-
* .addHeader('x-request-id', '123')
|
|
15
|
-
* .addPayload({
|
|
16
|
-
* type: EventType.SDK_CALL,
|
|
17
|
-
* userId: 'user_123',
|
|
18
|
-
* data: { case: 'sdkCall', value: { sdkCallType: SDKCallType.RAW, debitAmount: 10 } }
|
|
19
|
-
* })
|
|
20
|
-
* .request();
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
import type { Transport } from '@connectrpc/connect';
|
|
24
|
-
import type { ServiceType } from '@bufbuild/protobuf';
|
|
25
|
-
import type { ServiceMethodNames, MethodInput, MethodOutput } from './types.js';
|
|
26
|
-
/**
|
|
27
|
-
* Builder for constructing type-safe gRPC requests.
|
|
28
|
-
*
|
|
29
|
-
* This class implements a fluent interface where each method returns `this`,
|
|
30
|
-
* allowing for method chaining. Type parameters ensure that the payload type
|
|
31
|
-
* matches the selected service method at compile time.
|
|
32
|
-
*
|
|
33
|
-
* @template S - The gRPC service type
|
|
34
|
-
* @template M - The method name on the service (string literal)
|
|
35
|
-
*/
|
|
36
|
-
export declare class RequestBuilder<S extends ServiceType, M extends ServiceMethodNames<S>> {
|
|
37
|
-
private readonly client;
|
|
38
|
-
private readonly methodName;
|
|
39
|
-
private readonly headers;
|
|
1
|
+
import * as grpc from "@grpc/grpc-js";
|
|
2
|
+
import type { GrpcCallOptions } from "./types.js";
|
|
3
|
+
import type { GrpcCallContext } from "./callContext.js";
|
|
4
|
+
export declare class RequestBuilder<C extends grpc.ServiceClientConstructor> {
|
|
5
|
+
private readonly ctx;
|
|
40
6
|
private payload;
|
|
41
|
-
private
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* Add a header to the request.
|
|
49
|
-
*
|
|
50
|
-
* Headers are sent with the gRPC call and can be used for authentication,
|
|
51
|
-
* tracing, or custom metadata. This method can be called multiple times
|
|
52
|
-
* to add multiple headers.
|
|
53
|
-
*
|
|
54
|
-
* @param key - Header name (e.g., 'authorization', 'x-request-id')
|
|
55
|
-
* @param value - Header value
|
|
56
|
-
* @returns The builder instance for chaining
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* builder
|
|
61
|
-
* .addHeader('authorization', 'Bearer token123')
|
|
62
|
-
* .addHeader('x-request-id', 'abc-def-123')
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
addHeader(key: string, value: string): this;
|
|
66
|
-
/**
|
|
67
|
-
* Set the request payload.
|
|
68
|
-
*
|
|
69
|
-
* The payload type is automatically inferred from the service method,
|
|
70
|
-
* providing full autocomplete and type checking. This method can only
|
|
71
|
-
* be called once per request to prevent accidental overwrites.
|
|
72
|
-
*
|
|
73
|
-
* @param payload - The request payload (type-checked against the method's input type)
|
|
74
|
-
* @returns The builder instance for chaining
|
|
75
|
-
* @throws Error if payload has already been set
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* builder.addPayload({
|
|
80
|
-
* type: EventType.SDK_CALL,
|
|
81
|
-
* userId: 'user_123',
|
|
82
|
-
* data: {
|
|
83
|
-
* case: 'sdkCall',
|
|
84
|
-
* value: {
|
|
85
|
-
* sdkCallType: SDKCallType.RAW,
|
|
86
|
-
* debitAmount: 10
|
|
87
|
-
* }
|
|
88
|
-
* }
|
|
89
|
-
* })
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
addPayload(payload: MethodInput<S, M> extends infer T ? Partial<T> : never): this;
|
|
93
|
-
/**
|
|
94
|
-
* Execute the gRPC request.
|
|
95
|
-
*
|
|
96
|
-
* Validates that a payload has been set, then makes the actual gRPC call
|
|
97
|
-
* using the configured service, method, headers, and payload. The response
|
|
98
|
-
* type is automatically inferred from the service method.
|
|
99
|
-
*
|
|
100
|
-
* @returns A promise that resolves to the typed response
|
|
101
|
-
* @throws Error if no payload has been set
|
|
102
|
-
* @throws Error if the gRPC call fails
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```typescript
|
|
106
|
-
* const response = await builder
|
|
107
|
-
* .addPayload({ userId: 'user_123', ... })
|
|
108
|
-
* .request();
|
|
109
|
-
*
|
|
110
|
-
* // response is fully typed based on the method's output type
|
|
111
|
-
* console.log(response.random);
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
request(): Promise<MethodOutput<S, M>>;
|
|
7
|
+
private hasPayload;
|
|
8
|
+
private options;
|
|
9
|
+
constructor(ctx: GrpcCallContext<C>);
|
|
10
|
+
addMetadata(key: string, value: string): this;
|
|
11
|
+
addPayload(payload: unknown): this;
|
|
12
|
+
setOptions(options: GrpcCallOptions): this;
|
|
13
|
+
request<TResponse = unknown>(): Promise<TResponse>;
|
|
115
14
|
}
|
|
116
15
|
//# sourceMappingURL=requestBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/requestBuilder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"requestBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/requestBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,qBAAa,cAAc,CAAC,CAAC,SAAS,IAAI,CAAC,wBAAwB;IACjE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqB;IACzC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAuB;gBAE1B,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;IAKnC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAK7C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAWlC,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAMpC,OAAO,CAAC,SAAS,GAAG,OAAO,KAAK,OAAO,CAAC,SAAS,CAAC;CA8CzD"}
|
|
@@ -1,144 +1,54 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-safe fluent API for building and executing gRPC requests.
|
|
3
|
-
*
|
|
4
|
-
* This module provides a beautiful chain-able interface that ensures:
|
|
5
|
-
* - Compile-time type safety for all operations
|
|
6
|
-
* - Autocomplete for service methods and payload fields
|
|
7
|
-
* - Runtime validation of request state
|
|
8
|
-
* - Clean separation of concerns
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const response = await client
|
|
13
|
-
* .newCall(EventService, 'registerEvent')
|
|
14
|
-
* .addHeader('x-request-id', '123')
|
|
15
|
-
* .addPayload({
|
|
16
|
-
* type: EventType.SDK_CALL,
|
|
17
|
-
* userId: 'user_123',
|
|
18
|
-
* data: { case: 'sdkCall', value: { sdkCallType: SDKCallType.RAW, debitAmount: 10 } }
|
|
19
|
-
* })
|
|
20
|
-
* .request();
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
import { createClient } from '@connectrpc/connect';
|
|
24
|
-
import { ScrawnLogger } from '../../utils/logger.js';
|
|
25
|
-
const log = new ScrawnLogger('RequestBuilder');
|
|
26
|
-
/**
|
|
27
|
-
* Builder for constructing type-safe gRPC requests.
|
|
28
|
-
*
|
|
29
|
-
* This class implements a fluent interface where each method returns `this`,
|
|
30
|
-
* allowing for method chaining. Type parameters ensure that the payload type
|
|
31
|
-
* matches the selected service method at compile time.
|
|
32
|
-
*
|
|
33
|
-
* @template S - The gRPC service type
|
|
34
|
-
* @template M - The method name on the service (string literal)
|
|
35
|
-
*/
|
|
36
1
|
export class RequestBuilder {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
constructor(transport, service, methodName) {
|
|
42
|
-
this.headers = {};
|
|
43
|
-
this.payload = null;
|
|
44
|
-
this.state = { hasPayload: false };
|
|
45
|
-
// Create a typed client for this service
|
|
46
|
-
this.client = createClient(service, transport);
|
|
47
|
-
this.methodName = methodName;
|
|
2
|
+
constructor(ctx) {
|
|
3
|
+
this.hasPayload = false;
|
|
4
|
+
this.options = {};
|
|
5
|
+
this.ctx = ctx;
|
|
48
6
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* Headers are sent with the gRPC call and can be used for authentication,
|
|
53
|
-
* tracing, or custom metadata. This method can be called multiple times
|
|
54
|
-
* to add multiple headers.
|
|
55
|
-
*
|
|
56
|
-
* @param key - Header name (e.g., 'authorization', 'x-request-id')
|
|
57
|
-
* @param value - Header value
|
|
58
|
-
* @returns The builder instance for chaining
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* builder
|
|
63
|
-
* .addHeader('authorization', 'Bearer token123')
|
|
64
|
-
* .addHeader('x-request-id', 'abc-def-123')
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
addHeader(key, value) {
|
|
68
|
-
this.headers[key] = value;
|
|
7
|
+
// fallow-ignore-next-line unused-class-member
|
|
8
|
+
addMetadata(key, value) {
|
|
9
|
+
this.ctx.addMetadata(key, value);
|
|
69
10
|
return this;
|
|
70
11
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Set the request payload.
|
|
73
|
-
*
|
|
74
|
-
* The payload type is automatically inferred from the service method,
|
|
75
|
-
* providing full autocomplete and type checking. This method can only
|
|
76
|
-
* be called once per request to prevent accidental overwrites.
|
|
77
|
-
*
|
|
78
|
-
* @param payload - The request payload (type-checked against the method's input type)
|
|
79
|
-
* @returns The builder instance for chaining
|
|
80
|
-
* @throws Error if payload has already been set
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```typescript
|
|
84
|
-
* builder.addPayload({
|
|
85
|
-
* type: EventType.SDK_CALL,
|
|
86
|
-
* userId: 'user_123',
|
|
87
|
-
* data: {
|
|
88
|
-
* case: 'sdkCall',
|
|
89
|
-
* value: {
|
|
90
|
-
* sdkCallType: SDKCallType.RAW,
|
|
91
|
-
* debitAmount: 10
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
* })
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
12
|
addPayload(payload) {
|
|
98
|
-
if (this.
|
|
99
|
-
throw new Error(
|
|
100
|
-
'Create a new request builder if you need to make another call.');
|
|
13
|
+
if (this.hasPayload) {
|
|
14
|
+
throw new Error("Payload has already been set for this request");
|
|
101
15
|
}
|
|
102
16
|
this.payload = payload;
|
|
103
|
-
this.
|
|
17
|
+
this.hasPayload = true;
|
|
104
18
|
return this;
|
|
105
19
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
* @returns A promise that resolves to the typed response
|
|
114
|
-
* @throws Error if no payload has been set
|
|
115
|
-
* @throws Error if the gRPC call fails
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```typescript
|
|
119
|
-
* const response = await builder
|
|
120
|
-
* .addPayload({ userId: 'user_123', ... })
|
|
121
|
-
* .request();
|
|
122
|
-
*
|
|
123
|
-
* // response is fully typed based on the method's output type
|
|
124
|
-
* console.log(response.random);
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
20
|
+
// fallow-ignore-next-line unused-class-member
|
|
21
|
+
setOptions(options) {
|
|
22
|
+
this.options = { ...this.options, ...options };
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
// fallow-ignore-next-line unused-class-member
|
|
127
26
|
async request() {
|
|
128
|
-
if (!this.
|
|
129
|
-
throw new Error(
|
|
27
|
+
if (!this.hasPayload) {
|
|
28
|
+
throw new Error("Cannot make request without payload. Call addPayload() first.");
|
|
130
29
|
}
|
|
30
|
+
this.ctx.logCallStart();
|
|
131
31
|
try {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
32
|
+
const client = new this.ctx.ClientConstructor(this.ctx.target, this.ctx.credentials);
|
|
33
|
+
const method = client[this.ctx.methodName];
|
|
34
|
+
const callOptions = {};
|
|
35
|
+
if (this.options.deadline !== undefined) {
|
|
36
|
+
callOptions.deadline = this.options.deadline;
|
|
37
|
+
}
|
|
38
|
+
const response = await new Promise((resolve, reject) => {
|
|
39
|
+
method.call(client, this.payload, this.options.metadata ?? this.ctx.getMetadata(), callOptions, (error, response) => {
|
|
40
|
+
if (error) {
|
|
41
|
+
reject(error);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
resolve(response);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
this.ctx.logCallSuccess();
|
|
138
48
|
return response;
|
|
139
49
|
}
|
|
140
50
|
catch (error) {
|
|
141
|
-
|
|
51
|
+
this.ctx.logCallError(error);
|
|
142
52
|
throw error;
|
|
143
53
|
}
|
|
144
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../src/core/grpc/requestBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../src/core/grpc/requestBuilder.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,cAAc;IAMzB,YAAY,GAAuB;QAH3B,eAAU,GAAG,KAAK,CAAC;QACnB,YAAO,GAAoB,EAAE,CAAC;QAGpC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,8CAA8C;IAC9C,WAAW,CAAC,GAAW,EAAE,KAAa;QACpC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,UAAU,CAAC,OAAgB;QACzB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8CAA8C;IAC9C,UAAU,CAAC,OAAwB;QACjC,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8CAA8C;IAC9C,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAExB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAC3C,IAAI,CAAC,GAAG,CAAC,MAAM,EACf,IAAI,CAAC,GAAG,CAAC,WAAW,CACoB,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAKhC,CAAC;YAEV,MAAM,WAAW,GAAqB,EAAE,CAAC;YACzC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACxC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC/C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAChE,MAAM,CAAC,IAAI,CACT,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAC/C,WAAW,EACX,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;oBAClB,IAAI,KAAK,EAAE,CAAC;wBACV,MAAM,CAAC,KAAK,CAAC,CAAC;wBACd,OAAO;oBACT,CAAC;oBACD,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;YAC1B,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as grpc from "@grpc/grpc-js";
|
|
2
|
+
import type { GrpcCallOptions } from "./types.js";
|
|
3
|
+
import type { GrpcCallContext } from "./callContext.js";
|
|
4
|
+
export declare class StreamRequestBuilder<C extends grpc.ServiceClientConstructor> {
|
|
5
|
+
private readonly ctx;
|
|
6
|
+
private hasSent;
|
|
7
|
+
private options;
|
|
8
|
+
constructor(ctx: GrpcCallContext<C>);
|
|
9
|
+
addMetadata(key: string, value: string): this;
|
|
10
|
+
setOptions(options: GrpcCallOptions): this;
|
|
11
|
+
stream<TResponse = unknown>(items: AsyncIterable<unknown>): Promise<TResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=streamRequestBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamRequestBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/streamRequestBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,qBAAa,oBAAoB,CAAC,CAAC,SAAS,IAAI,CAAC,wBAAwB;IACvE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAqB;IACzC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAuB;gBAE1B,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;IAKnC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAM7C,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAMpC,MAAM,CAAC,SAAS,GAAG,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;CAyDrF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export class StreamRequestBuilder {
|
|
2
|
+
constructor(ctx) {
|
|
3
|
+
this.hasSent = false;
|
|
4
|
+
this.options = {};
|
|
5
|
+
this.ctx = ctx;
|
|
6
|
+
}
|
|
7
|
+
// fallow-ignore-next-line unused-class-member
|
|
8
|
+
addMetadata(key, value) {
|
|
9
|
+
this.ctx.addMetadata(key, value);
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
// fallow-ignore-next-line unused-class-member
|
|
13
|
+
setOptions(options) {
|
|
14
|
+
this.options = { ...this.options, ...options };
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
// fallow-ignore-next-line unused-class-member
|
|
18
|
+
async stream(items) {
|
|
19
|
+
if (this.hasSent) {
|
|
20
|
+
throw new Error("Stream has already been sent for this request");
|
|
21
|
+
}
|
|
22
|
+
this.hasSent = true;
|
|
23
|
+
this.ctx.logCallStart();
|
|
24
|
+
try {
|
|
25
|
+
const client = new this.ctx.ClientConstructor(this.ctx.target, this.ctx.credentials);
|
|
26
|
+
const method = client[this.ctx.methodName];
|
|
27
|
+
const callOptions = {};
|
|
28
|
+
if (this.options.deadline !== undefined) {
|
|
29
|
+
callOptions.deadline = this.options.deadline;
|
|
30
|
+
}
|
|
31
|
+
const response = await new Promise((resolve, reject) => {
|
|
32
|
+
const stream = method.call(client, this.options.metadata ?? this.ctx.getMetadata(), callOptions, (error, result) => {
|
|
33
|
+
if (error) {
|
|
34
|
+
reject(error);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
resolve(result);
|
|
38
|
+
});
|
|
39
|
+
(async () => {
|
|
40
|
+
try {
|
|
41
|
+
for await (const item of items) {
|
|
42
|
+
stream.write(item);
|
|
43
|
+
}
|
|
44
|
+
stream.end();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
stream.destroy(error);
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
});
|
|
51
|
+
this.ctx.logCallSuccess();
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
this.ctx.logCallError(error);
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=streamRequestBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamRequestBuilder.js","sourceRoot":"","sources":["../../../src/core/grpc/streamRequestBuilder.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,oBAAoB;IAK/B,YAAY,GAAuB;QAH3B,YAAO,GAAG,KAAK,CAAC;QAChB,YAAO,GAAoB,EAAE,CAAC;QAGpC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,8CAA8C;IAC9C,WAAW,CAAC,GAAW,EAAE,KAAa;QACpC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8CAA8C;IAC9C,UAAU,CAAC,OAAwB;QACjC,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8CAA8C;IAC9C,KAAK,CAAC,MAAM,CAAsB,KAA6B;QAC7D,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAExB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAC3C,IAAI,CAAC,GAAG,CAAC,MAAM,EACf,IAAI,CAAC,GAAG,CAAC,WAAW,CACoB,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAIF,CAAC;YAExC,MAAM,WAAW,GAAqB,EAAE,CAAC;YACzC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACxC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC/C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAChE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CACxB,MAAM,EACN,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAC/C,WAAW,EACX,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;oBAChB,IAAI,KAAK,EAAE,CAAC;wBACV,MAAM,CAAC,KAAK,CAAC,CAAC;wBACd,OAAO;oBACT,CAAC;oBACD,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC,CACF,CAAC;gBAEF,CAAC,KAAK,IAAI,EAAE;oBACV,IAAI,CAAC;wBACH,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;4BAC/B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;wBACrB,CAAC;wBACD,MAAM,CAAC,GAAG,EAAE,CAAC;oBACf,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,MAAM,CAAC,OAAO,CAAC,KAAc,CAAC,CAAC;oBACjC,CAAC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;YAC1B,OAAO,QAAQ,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YAC7B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,54 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* ensuring that payloads, headers, and responses are correctly typed based
|
|
6
|
-
* on the service and method being called.
|
|
7
|
-
*/
|
|
8
|
-
import type { ServiceType } from '@bufbuild/protobuf';
|
|
9
|
-
import type { MessageType } from '@bufbuild/protobuf';
|
|
10
|
-
/**
|
|
11
|
-
* Extract all method names from a service as a union of string literals.
|
|
12
|
-
* This provides autocomplete and compile-time validation of method names.
|
|
13
|
-
*/
|
|
14
|
-
export type ServiceMethodNames<S extends ServiceType> = keyof S['methods'] & string;
|
|
15
|
-
/**
|
|
16
|
-
* Get the input MessageType (constructor) for a specific method on a service.
|
|
17
|
-
*/
|
|
18
|
-
export type MethodInputType<S extends ServiceType, M extends ServiceMethodNames<S>> = S['methods'][M] extends {
|
|
19
|
-
I: infer I;
|
|
20
|
-
} ? I : never;
|
|
21
|
-
/**
|
|
22
|
-
* Get the output MessageType (constructor) for a specific method on a service.
|
|
23
|
-
*/
|
|
24
|
-
export type MethodOutputType<S extends ServiceType, M extends ServiceMethodNames<S>> = S['methods'][M] extends {
|
|
25
|
-
O: infer O;
|
|
26
|
-
} ? O : never;
|
|
27
|
-
/**
|
|
28
|
-
* Convert a MessageType to its Message instance type.
|
|
29
|
-
* This extracts the actual Message type from a MessageType constructor.
|
|
30
|
-
*/
|
|
31
|
-
export type MessageTypeToMessage<T> = T extends MessageType<infer M> ? M : never;
|
|
32
|
-
/**
|
|
33
|
-
* Get the input Message type for a specific method on a service.
|
|
34
|
-
* This is what you'll use for the payload type.
|
|
35
|
-
*/
|
|
36
|
-
export type MethodInput<S extends ServiceType, M extends ServiceMethodNames<S>> = MessageTypeToMessage<MethodInputType<S, M>>;
|
|
37
|
-
/**
|
|
38
|
-
* Get the output Message type for a specific method on a service.
|
|
39
|
-
* This is what you'll get back from the request.
|
|
40
|
-
*/
|
|
41
|
-
export type MethodOutput<S extends ServiceType, M extends ServiceMethodNames<S>> = MessageTypeToMessage<MethodOutputType<S, M>>;
|
|
42
|
-
/**
|
|
43
|
-
* HTTP headers as key-value pairs.
|
|
44
|
-
*/
|
|
45
|
-
export interface Headers {
|
|
46
|
-
[key: string]: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* State tracking for the request builder to prevent duplicate operations.
|
|
50
|
-
*/
|
|
51
|
-
export interface RequestState {
|
|
52
|
-
hasPayload: boolean;
|
|
1
|
+
import type * as grpc from "@grpc/grpc-js";
|
|
2
|
+
export interface GrpcCallOptions {
|
|
3
|
+
metadata?: grpc.Metadata;
|
|
4
|
+
deadline?: grpc.Deadline;
|
|
53
5
|
}
|
|
6
|
+
export type ServiceMethodName = string;
|
|
54
7
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/grpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,eAAe,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;IACzB,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC"}
|
package/dist/core/grpc/types.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core type system for the gRPC client abstraction layer.
|
|
3
|
-
*
|
|
4
|
-
* This module provides compile-time type safety for all gRPC operations,
|
|
5
|
-
* ensuring that payloads, headers, and responses are correctly typed based
|
|
6
|
-
* on the service and method being called.
|
|
7
|
-
*/
|
|
8
1
|
export {};
|
|
9
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/grpc/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/grpc/types.ts"],"names":[],"mappings":""}
|