Comparing version 1.169.0 to 1.169.1
@@ -45,11 +45,11 @@ "use strict"; | ||
} | ||
else if (options.addGrpcMetadata) { | ||
const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js"); | ||
const q = options.addNestjsRestParameter ? "" : "?"; | ||
params.push((0, ts_poet_1.code) `metadata${q}: ${Metadata}`); | ||
} | ||
else if (options.metadataType) { | ||
// custom `metadataType` has precedence over `addGrpcMetadata` that injects Metadata from grpc-js | ||
const Metadata = (0, ts_poet_1.imp)(options.metadataType); | ||
params.push((0, ts_poet_1.code) `metadata?: ${Metadata}`); | ||
} | ||
else if (options.addGrpcMetadata) { | ||
const Metadata = (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js"); | ||
params.push((0, ts_poet_1.code) `metadata?: ${Metadata}`); | ||
} | ||
if (options.useAbortSignal) { | ||
@@ -84,8 +84,11 @@ params.push((0, ts_poet_1.code) `abortSignal?: AbortSignal`); | ||
const rawOutputType = (0, types_1.responseType)(ctx, methodDesc, { keepValueType: true }); | ||
const metadataType = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js"); | ||
const params = [ | ||
...(options.context ? [(0, ts_poet_1.code) `ctx: Context`] : []), | ||
(0, ts_poet_1.code) `request: ${inputType}`, | ||
...(options.metadataType || options.addGrpcMetadata ? [(0, ts_poet_1.code) `metadata?: ${metadataType}`] : []), | ||
...(options.useAbortSignal ? [(0, ts_poet_1.code) `abortSignal?: AbortSignal`] : []), | ||
]; | ||
const maybeCtx = options.context ? "ctx," : ""; | ||
const maybeMetadata = options.addGrpcMetadata ? "metadata," : ""; | ||
const maybeAbortSignal = options.useAbortSignal ? "abortSignal || undefined," : ""; | ||
@@ -161,2 +164,3 @@ let errorHandler; | ||
data, | ||
${maybeMetadata} | ||
${maybeAbortSignal} | ||
@@ -336,4 +340,7 @@ ); | ||
const { options } = ctx; | ||
const metadata = options.metadataType ? (0, ts_poet_1.imp)(options.metadataType) : (0, ts_poet_1.imp)("Metadata@@grpc/grpc-js"); | ||
const metadataType = metadata.symbol; | ||
const maybeContext = options.context ? "<Context>" : ""; | ||
const maybeContextParam = options.context ? "ctx: Context," : ""; | ||
const maybeMetadataParam = options.metadataType || options.addGrpcMetadata ? `metadata?: ${metadataType},` : ""; | ||
const maybeAbortSignalParam = options.useAbortSignal ? "abortSignal?: AbortSignal," : ""; | ||
@@ -370,2 +377,3 @@ const methods = [[(0, ts_poet_1.code) `request`, (0, ts_poet_1.code) `Uint8Array`, (0, ts_poet_1.code) `Promise<Uint8Array>`]]; | ||
data: ${method[1]}, | ||
${maybeMetadataParam} | ||
${maybeAbortSignalParam} | ||
@@ -372,0 +380,0 @@ ): ${method[2]};`); |
{ | ||
"name": "ts-proto", | ||
"version": "1.169.0", | ||
"version": "1.169.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/plugin.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
350134
6065