@gravity-ui/gateway 3.1.3-alpha.0 → 3.2.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/build/components/grpc.js
CHANGED
|
@@ -526,7 +526,7 @@ function createGrpcAction({ root, credentials }, endpoints, config, serviceKey,
|
|
|
526
526
|
ctx.log('ServerStream error', {
|
|
527
527
|
debugHeaders: (0, common_2.sanitizeDebugHeaders)(debugHeaders),
|
|
528
528
|
});
|
|
529
|
-
processError(new parse_error_1.GrpcError('ClientReadableStream error', (0, parse_error_1.parseGrpcError)(error, root, lang,
|
|
529
|
+
processError(new parse_error_1.GrpcError('ClientReadableStream error', (0, parse_error_1.parseGrpcError)(error, root, lang, config.decodeAnyMessageProtoLoaderOptions), error));
|
|
530
530
|
});
|
|
531
531
|
stream.on('status', (status) => {
|
|
532
532
|
ctx.log('ServerStream status changed', status);
|
|
@@ -566,7 +566,7 @@ function createGrpcAction({ root, credentials }, endpoints, config, serviceKey,
|
|
|
566
566
|
ctx.log('BidiStream error', {
|
|
567
567
|
debugHeaders: (0, common_2.sanitizeDebugHeaders)(debugHeaders),
|
|
568
568
|
});
|
|
569
|
-
processError(new parse_error_1.GrpcError('BidiStream error', (0, parse_error_1.parseGrpcError)(error, root, lang,
|
|
569
|
+
processError(new parse_error_1.GrpcError('BidiStream error', (0, parse_error_1.parseGrpcError)(error, root, lang, config.decodeAnyMessageProtoLoaderOptions), error));
|
|
570
570
|
});
|
|
571
571
|
stream.on('status', (status) => {
|
|
572
572
|
ctx.log('BidiStream status changed', status);
|
|
@@ -618,7 +618,7 @@ function createGrpcAction({ root, credentials }, endpoints, config, serviceKey,
|
|
|
618
618
|
return;
|
|
619
619
|
}
|
|
620
620
|
if (error) {
|
|
621
|
-
reject(new parse_error_1.GrpcError('gRPC request error', (0, parse_error_1.parseGrpcError)(error, root, lang,
|
|
621
|
+
reject(new parse_error_1.GrpcError('gRPC request error', (0, parse_error_1.parseGrpcError)(error, root, lang, config.decodeAnyMessageProtoLoaderOptions), error));
|
|
622
622
|
return;
|
|
623
623
|
}
|
|
624
624
|
const responseData = await getResponseData({
|
|
@@ -628,7 +628,7 @@ function createGrpcAction({ root, credentials }, endpoints, config, serviceKey,
|
|
|
628
628
|
args,
|
|
629
629
|
packageRoot: root,
|
|
630
630
|
ErrorConstructor,
|
|
631
|
-
decodeAnyMessageProtoLoaderOptions:
|
|
631
|
+
decodeAnyMessageProtoLoaderOptions: config.decodeAnyMessageProtoLoaderOptions,
|
|
632
632
|
});
|
|
633
633
|
const responseHeaders = {};
|
|
634
634
|
if (config.proxyResponseHeaders) {
|
package/build/models/common.d.ts
CHANGED
|
@@ -31,7 +31,6 @@ export interface ApiActionConfig<Context extends GatewayContext, TRequestData, T
|
|
|
31
31
|
callback?: (response: TResponseData) => void;
|
|
32
32
|
authArgs?: Record<string, unknown>;
|
|
33
33
|
userId?: string;
|
|
34
|
-
decodeAnyMessageProtoLoaderOptions?: protobufjs.IConversionOptions;
|
|
35
34
|
}
|
|
36
35
|
export interface GRPCActionData {
|
|
37
36
|
[key: string]: unknown;
|
|
@@ -143,6 +142,7 @@ export interface ApiServiceBaseGrpcActionConfig<Context extends GatewayContext,
|
|
|
143
142
|
secureWithoutRootCert?: boolean;
|
|
144
143
|
encodedFields?: string[];
|
|
145
144
|
type?: HandlerType;
|
|
145
|
+
decodeAnyMessageProtoLoaderOptions?: protobufjs.IConversionOptions;
|
|
146
146
|
}
|
|
147
147
|
export interface ApiServiceFileGrpcActionConfig<Context extends GatewayContext, TOutput, TParams, TTransformed> extends ApiServiceBaseGrpcActionConfig<Context, TOutput, TParams, TTransformed> {
|
|
148
148
|
protoPath: string;
|