ts-proto 2.7.4 → 2.7.5

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.
@@ -7,7 +7,7 @@ const types_1 = require("./types");
7
7
  const utils_1 = require("./utils");
8
8
  const encode_1 = require("./encode");
9
9
  const CallOptions = (0, ts_poet_1.imp)("t:CallOptions@@grpc/grpc-js");
10
- const ChannelCredentials = (0, ts_poet_1.imp)("ChannelCredentials@@grpc/grpc-js");
10
+ const ChannelCredentials = (0, ts_poet_1.imp)("t:ChannelCredentials@@grpc/grpc-js");
11
11
  const ClientOptions = (0, ts_poet_1.imp)("t:ClientOptions@@grpc/grpc-js");
12
12
  const Client = (0, ts_poet_1.imp)("Client@@grpc/grpc-js");
13
13
  const ClientDuplexStream = (0, ts_poet_1.imp)("t:ClientDuplexStream@@grpc/grpc-js");
@@ -20,7 +20,7 @@ const handleServerStreamingCall = (0, ts_poet_1.imp)("t:handleServerStreamingCal
20
20
  const handleUnaryCall = (0, ts_poet_1.imp)("t:handleUnaryCall@@grpc/grpc-js");
21
21
  const UntypedServiceImplementation = (0, ts_poet_1.imp)("t:UntypedServiceImplementation@@grpc/grpc-js");
22
22
  const makeGenericClientConstructor = (0, ts_poet_1.imp)("makeGenericClientConstructor@@grpc/grpc-js");
23
- const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
23
+ const Metadata = (0, ts_poet_1.imp)("t:Metadata@@grpc/grpc-js");
24
24
  const ServiceError = (0, ts_poet_1.imp)("t:ServiceError@@grpc/grpc-js");
25
25
  /**
26
26
  * Generates a service definition and server / client stubs for the
@@ -11,7 +11,7 @@ const utils_1 = require("./utils");
11
11
  function generateNestjsServiceController(ctx, fileDesc, sourceInfo, serviceDesc) {
12
12
  const { options } = ctx;
13
13
  const chunks = [];
14
- const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
14
+ const Metadata = (0, ts_poet_1.imp)("t:Metadata@@grpc/grpc-js");
15
15
  (0, utils_1.maybeAddComment)(options, sourceInfo, chunks, serviceDesc.options?.deprecated);
16
16
  const t = options.context ? `<${main_1.contextTypeVar}>` : "";
17
17
  chunks.push((0, ts_poet_1.code) `
@@ -72,7 +72,7 @@ function generateNestjsServiceController(ctx, fileDesc, sourceInfo, serviceDesc)
72
72
  function generateNestjsServiceClient(ctx, fileDesc, sourceInfo, serviceDesc) {
73
73
  const { options } = ctx;
74
74
  const chunks = [];
75
- const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
75
+ const Metadata = (0, ts_poet_1.imp)("t:Metadata@@grpc/grpc-js");
76
76
  (0, utils_1.maybeAddComment)(options, sourceInfo, chunks);
77
77
  const t = options.context ? `<${main_1.contextTypeVar}>` : ``;
78
78
  chunks.push((0, ts_poet_1.code) `
@@ -50,7 +50,7 @@ function generateService(ctx, fileDesc, sourceInfo, serviceDesc) {
50
50
  params.push((0, ts_poet_1.code) `metadata?: ${Metadata}`);
51
51
  }
52
52
  else if (options.addGrpcMetadata) {
53
- const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
53
+ const Metadata = (0, ts_poet_1.imp)("t:Metadata@@grpc/grpc-js");
54
54
  params.push((0, ts_poet_1.code) `metadata?: ${Metadata}`);
55
55
  }
56
56
  if (options.useAbortSignal) {
@@ -81,7 +81,7 @@ function generateRegularRpcMethod(ctx, methodDesc) {
81
81
  const rawInputType = (0, types_1.rawRequestType)(ctx, methodDesc, { keepValueType: true });
82
82
  const inputType = (0, types_1.requestType)(ctx, methodDesc);
83
83
  const rawOutputType = (0, types_1.responseType)(ctx, methodDesc, { keepValueType: true });
84
- const metadataType = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
84
+ const metadataType = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("t:Metadata@@grpc/grpc-js");
85
85
  const params = [
86
86
  ...(options.context ? [(0, ts_poet_1.code) `ctx: Context`] : []),
87
87
  (0, ts_poet_1.code) `request: ${inputType}`,
@@ -334,7 +334,7 @@ function generateCachingRpcMethod(ctx, fileDesc, serviceDesc, methodDesc) {
334
334
  */
335
335
  function generateRpcType(ctx, hasStreamingMethods) {
336
336
  const { options } = ctx;
337
- const metadata = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js");
337
+ const metadata = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("t:Metadata@@grpc/grpc-js");
338
338
  const metadataType = metadata.symbol;
339
339
  const maybeContext = options.context ? "<Context>" : "";
340
340
  const maybeContextParam = options.context ? "ctx: Context," : "";
@@ -32,8 +32,8 @@ function generateMessageType(ctx) {
32
32
  chunks.push((0, ts_poet_1.code) `$type: string;`);
33
33
  }
34
34
  if (ctx.options.outputEncodeMethods) {
35
- const BinaryReader = (0, ts_poet_1.imp)("BinaryReader@@bufbuild/protobuf/wire");
36
- const BinaryWriter = (0, ts_poet_1.imp)("BinaryWriter@@bufbuild/protobuf/wire");
35
+ const BinaryReader = (0, ts_poet_1.imp)("t:BinaryReader@@bufbuild/protobuf/wire");
36
+ const BinaryWriter = (0, ts_poet_1.imp)("t:BinaryWriter@@bufbuild/protobuf/wire");
37
37
  chunks.push((0, ts_poet_1.code) `encode(message: Message, writer?: ${BinaryWriter}): ${BinaryWriter};`);
38
38
  chunks.push((0, ts_poet_1.code) `decode(input: ${BinaryReader} | Uint8Array, length?: number): Message;`);
39
39
  }
package/build/src/main.js CHANGED
@@ -511,8 +511,8 @@ function makeDeepPartial(options, longs) {
511
511
  return { Builtin, DeepPartial, Exact };
512
512
  }
513
513
  function makeMessageFns(options, deepPartial, extension) {
514
- const BinaryWriter = (0, ts_poet_1.imp)("BinaryWriter@@bufbuild/protobuf/wire");
515
- const BinaryReader = (0, ts_poet_1.imp)("BinaryReader@@bufbuild/protobuf/wire");
514
+ const BinaryWriter = (0, ts_poet_1.imp)("t:BinaryWriter@@bufbuild/protobuf/wire");
515
+ const BinaryReader = (0, ts_poet_1.imp)("t:BinaryReader@@bufbuild/protobuf/wire");
516
516
  const { Exact, DeepPartial } = deepPartial;
517
517
  const { Extension } = extension;
518
518
  const commonStaticMembers = [];
@@ -1009,7 +1009,7 @@ function getDecodeReadSnippet(ctx, field) {
1009
1009
  return readSnippet;
1010
1010
  }
1011
1011
  function generateEmptyDecode(fullName) {
1012
- const BinaryReader = (0, ts_poet_1.imp)("BinaryReader@@bufbuild/protobuf/wire");
1012
+ const BinaryReader = (0, ts_poet_1.imp)("t:BinaryReader@@bufbuild/protobuf/wire");
1013
1013
  return (0, ts_poet_1.code) `
1014
1014
  decode(
1015
1015
  _: ${BinaryReader} | Uint8Array,
@@ -8,7 +8,7 @@ const utils_1 = require("./utils");
8
8
  const types_1 = require("./types");
9
9
  const wire_1 = require("@bufbuild/protobuf/wire");
10
10
  const options_1 = require("./options");
11
- const fileDescriptorProto = (0, ts_poet_1.imp)("FileDescriptorProto@ts-proto-descriptors");
11
+ const fileDescriptorProto = (0, ts_poet_1.imp)("t:FileDescriptorProto@ts-proto-descriptors");
12
12
  const extensionCache = {};
13
13
  function generateSchema(ctx, fileDesc, sourceInfo) {
14
14
  const { options } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "2.7.4",
3
+ "version": "2.7.5",
4
4
  "description": "",
5
5
  "main": "build/src/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",