diff --git a/build/lib/template/svc_tsd.hbs b/build/lib/template/svc_tsd.hbs index 6a975fd..b129f55 100644 --- a/build/lib/template/svc_tsd.hbs +++ b/build/lib/template/svc_tsd.hbs @@ -8,7 +8,7 @@ {{/each}} {{#each services}} -interface I{{{serviceName}}}Service extends grpc.ServiceDefinition { +interface I{{{serviceName}}}Service extends grpc.ServiceDefinition { {{#each methods}} {{lcFirst methodName}}: I{{{methodName}}}; {{/each}} @@ -35,15 +35,15 @@ export interface I{{{serviceName}}}Client { {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata: grpc.Metadata, callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientUnaryCall; {{/eq}} {{#eq type "ClientWritableStream"}} - {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; - {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; + {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; + {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientReadableStream"}} - {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream; + {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientDuplexStream"}} - {{lcFirst methodName}}(): grpc.ClientDuplexStream; - {{lcFirst methodName}}(metadata: grpc.Metadata): grpc.ClientDuplexStream; + {{lcFirst methodName}}(): grpc.ClientDuplexStream<{{{requestTypeName}}}, {{{responseTypeName}}}>; + {{lcFirst methodName}}(metadata: grpc.Metadata): grpc.ClientDuplexStream<{{{requestTypeName}}}, {{{responseTypeName}}}>; {{/eq}} {{/each}} } @@ -57,14 +57,14 @@ export class {{{serviceName}}}Client extends grpc.Client implements I{{{serviceN public {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata: grpc.Metadata, callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientUnaryCall; {{/eq}} {{#eq type "ClientWritableStream"}} - public {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; - public {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; + public {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; + public {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientReadableStream"}} - public {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream; + public {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientDuplexStream"}} - public {{lcFirst methodName}}(metadata?: grpc.Metadata): grpc.ClientDuplexStream; + public {{lcFirst methodName}}(metadata?: grpc.Metadata): grpc.ClientDuplexStream<{{{requestTypeName}}}, {{{responseTypeName}}}>; {{/eq}} {{/each}} } diff --git a/examples/build/proto/book_grpc_pb.d.ts b/examples/build/proto/book_grpc_pb.d.ts index eb0ae19..bc9ba87 100644 --- a/examples/build/proto/book_grpc_pb.d.ts +++ b/examples/build/proto/book_grpc_pb.d.ts @@ -6,7 +6,7 @@ import * as grpc from "grpc"; import * as book_pb from "./book_pb"; -interface IBookServiceService extends grpc.ServiceDefinition { +interface IBookServiceService extends grpc.ServiceDefinition { getBook: IGetBook; getBooksViaAuthor: IGetBooksViaAuthor; getGreatestBook: IGetGreatestBook; @@ -61,11 +61,11 @@ interface IGetBooks { export interface IBookServiceClient { getBook(request: book_pb.GetBookRequest, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; getBook(request: book_pb.GetBookRequest, metadata: grpc.Metadata, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; - getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; - getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; - getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; - getBooks(): grpc.ClientDuplexStream; - getBooks(metadata: grpc.Metadata): grpc.ClientDuplexStream; + getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; + getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; + getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; + getBooks(): grpc.ClientDuplexStream; + getBooks(metadata: grpc.Metadata): grpc.ClientDuplexStream; } export const BookServiceService: IBookServiceService; @@ -73,8 +73,8 @@ export class BookServiceClient extends grpc.Client implements IBookServiceClient constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); public getBook(request: book_pb.GetBookRequest, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; public getBook(request: book_pb.GetBookRequest, metadata: grpc.Metadata, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; - public getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; - public getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; - public getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; - public getBooks(metadata?: grpc.Metadata): grpc.ClientDuplexStream; + public getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; + public getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; + public getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; + public getBooks(metadata?: grpc.Metadata): grpc.ClientDuplexStream; } diff --git a/examples/package-lock.json b/examples/package-lock.json index e255ea2..1748c9c 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -27,11 +27,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, - "arguejs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/arguejs/-/arguejs-0.2.3.tgz", - "integrity": "sha1-tvk59f4OPNHz+T4qqSYkJL8xKvc=" - }, "ascli": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", @@ -130,11 +125,10 @@ "integrity": "sha1-uMxjx02DRXvYqakEUDyO+ya8ozk=" }, "grpc": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.8.4.tgz", - "integrity": "sha1-gdG0nM3SWnFJ8Ynzw2sSPKRsqpU=", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.9.0.tgz", + "integrity": "sha512-F4j7ireH/ssXcBNTGR3yFjRHTWdJmtg6Czm5tnQYwIuhZh4znx8KhA50dpAkjNqrrbzt97N6hd/TXOPTZGmvtQ==", "requires": { - "arguejs": "0.2.3", "lodash": "4.17.5", "nan": "2.8.0", "node-pre-gyp": "0.6.39", @@ -275,7 +269,7 @@ } }, "debug": { - "version": "2.6.8", + "version": "2.6.9", "bundled": true, "requires": { "ms": "2.0.0" @@ -548,10 +542,10 @@ "mkdirp": "0.5.1", "nopt": "4.0.1", "npmlog": "4.1.2", - "rc": "1.2.3", + "rc": "1.2.4", "request": "2.81.0", "rimraf": "2.6.2", - "semver": "5.4.1", + "semver": "5.5.0", "tar": "2.2.1", "tar-pack": "3.4.1" } @@ -630,7 +624,7 @@ "bundled": true }, "rc": { - "version": "1.2.3", + "version": "1.2.4", "bundled": true, "requires": { "deep-extend": "0.4.2", @@ -683,7 +677,7 @@ "stringstream": "0.0.5", "tough-cookie": "2.3.3", "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "uuid": "3.2.1" } }, "rimraf": { @@ -698,7 +692,7 @@ "bundled": true }, "semver": { - "version": "5.4.1", + "version": "5.5.0", "bundled": true }, "set-blocking": { @@ -736,13 +730,6 @@ } } }, - "string_decoder": { - "version": "1.0.3", - "bundled": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -752,6 +739,13 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true @@ -780,7 +774,7 @@ "version": "3.4.1", "bundled": true, "requires": { - "debug": "2.6.8", + "debug": "2.6.9", "fstream": "1.0.11", "fstream-ignore": "1.0.5", "once": "1.4.0", @@ -818,7 +812,7 @@ "bundled": true }, "uuid": { - "version": "3.1.0", + "version": "3.2.1", "bundled": true }, "verror": { diff --git a/examples/package.json b/examples/package.json index f7cdd1b..079cb63 100644 --- a/examples/package.json +++ b/examples/package.json @@ -14,7 +14,7 @@ "dependencies": { "debug": "^3.1.0", "google-protobuf": "^3.5.0", - "grpc": "^1.8.4" + "grpc": "^1.9.0" }, "devDependencies": { "@types/debug": "0.0.30", diff --git a/examples/src/client.ts b/examples/src/client.ts index a889420..274ec0b 100644 --- a/examples/src/client.ts +++ b/examples/src/client.ts @@ -30,7 +30,7 @@ const getBook = async (isbn: number) => { const getBooks = () => { return new Promise((resolve) => { - const stream: grpc.ClientDuplexStream = client.getBooks(); + const stream: grpc.ClientDuplexStream = client.getBooks(); stream.on("data", (data: Book) => { log(`[getBooks] Book: ${JSON.stringify(data.toObject())}`); diff --git a/examples/src/proto/book_grpc_pb.d.ts b/examples/src/proto/book_grpc_pb.d.ts index eb0ae19..bc9ba87 100644 --- a/examples/src/proto/book_grpc_pb.d.ts +++ b/examples/src/proto/book_grpc_pb.d.ts @@ -6,7 +6,7 @@ import * as grpc from "grpc"; import * as book_pb from "./book_pb"; -interface IBookServiceService extends grpc.ServiceDefinition { +interface IBookServiceService extends grpc.ServiceDefinition { getBook: IGetBook; getBooksViaAuthor: IGetBooksViaAuthor; getGreatestBook: IGetGreatestBook; @@ -61,11 +61,11 @@ interface IGetBooks { export interface IBookServiceClient { getBook(request: book_pb.GetBookRequest, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; getBook(request: book_pb.GetBookRequest, metadata: grpc.Metadata, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; - getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; - getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; - getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; - getBooks(): grpc.ClientDuplexStream; - getBooks(metadata: grpc.Metadata): grpc.ClientDuplexStream; + getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; + getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; + getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; + getBooks(): grpc.ClientDuplexStream; + getBooks(metadata: grpc.Metadata): grpc.ClientDuplexStream; } export const BookServiceService: IBookServiceService; @@ -73,8 +73,8 @@ export class BookServiceClient extends grpc.Client implements IBookServiceClient constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); public getBook(request: book_pb.GetBookRequest, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; public getBook(request: book_pb.GetBookRequest, metadata: grpc.Metadata, callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientUnaryCall; - public getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; - public getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; - public getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; - public getBooks(metadata?: grpc.Metadata): grpc.ClientDuplexStream; + public getBooksViaAuthor(request: book_pb.GetBookViaAuthor, metadata?: grpc.Metadata): grpc.ClientReadableStream; + public getGreatestBook(callback: (error: Error | null, response: book_pb.Book) => void): grpc.ClientWritableStream; + public getGreatestBook(callback: (error: Error | null, metadata: grpc.Metadata, response: book_pb.Book) => void): grpc.ClientWritableStream; + public getBooks(metadata?: grpc.Metadata): grpc.ClientDuplexStream; } diff --git a/examples/src/server.ts b/examples/src/server.ts index 92e6227..542d1e1 100644 --- a/examples/src/server.ts +++ b/examples/src/server.ts @@ -13,7 +13,7 @@ function startServer() { const server = new grpc.Server(); server.addService(BookServiceService, { - getBook: (call: grpc.ServerUnaryCall, callback: grpc.sendUnaryData) => { + getBook: (call: grpc.ServerUnaryCall, callback: grpc.sendUnaryData) => { const book = new Book(); book.setTitle("DefaultBook"); @@ -22,7 +22,7 @@ function startServer() { log(`[getBook] Done: ${JSON.stringify(book.toObject())}`); callback(null, book); }, - getBooks: (call: grpc.ServerDuplexStream) => { + getBooks: (call: grpc.ServerDuplexStream) => { call.on("data", (request: GetBookRequest) => { const reply = new Book(); reply.setTitle(`Book${request.getIsbn()}`); @@ -36,7 +36,7 @@ function startServer() { call.end(); }); }, - getBooksViaAuthor: (call: grpc.ServerWriteableStream) => { + getBooksViaAuthor: (call: grpc.ServerWriteableStream) => { const request = call.request as GetBookViaAuthor; log(`[getBooksViaAuthor] Request: ${JSON.stringify(request.toObject())}`); @@ -51,7 +51,7 @@ function startServer() { log("[getBooksViaAuthor] Done."); call.end(); }, - getGreatestBook: (call: grpc.ServerReadableStream, callback: grpc.sendUnaryData) => { + getGreatestBook: (call: grpc.ServerReadableStream, callback: grpc.sendUnaryData) => { let lastOne: GetBookRequest; call.on("data", (request: GetBookRequest) => { log(`[getGreatestBook] Request: ${JSON.stringify(request.toObject())}`); diff --git a/package-lock.json b/package-lock.json index 8d86e8b..abb1aab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,70 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=", - "dev": true - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "dev": true - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "dev": true - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=", - "dev": true - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", - "dev": true, - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/inquire": "1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=", - "dev": true - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=", - "dev": true - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=", - "dev": true - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=", - "dev": true - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=", - "dev": true - }, "@types/google-protobuf": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.2.7.tgz", @@ -80,27 +16,12 @@ "integrity": "sha512-LjNiTX7TY7wtuC6y3QwC93hKMuqYhgV9A1uXBKNvZtVC8ZvyWAjZkJ5BvT0K7RKqORRYRLMrqCxpw5RgS+MdrQ==", "dev": true }, - "@types/long": { - "version": "3.0.32", - "resolved": "https://registry.npmjs.org/@types/long/-/long-3.0.32.tgz", - "integrity": "sha512-ZXyOOm83p7X8p3s0IYM3VeueNmHpkk/yMlP8CLeOnEcu6hIwPH7YjZBvhQkR0ZFS2DqZAxKtJ/M5fcuv3OU5BA==", - "dev": true - }, "@types/node": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.2.tgz", - "integrity": "sha512-ubLY/uq8AQR+N1vUoa5Uf2zDg4yg/bysc3o4AAZzaMRS564R+vIRYqBxwfNlmRxRDJt/c5gn/X8O9mX8Oowugw==", + "version": "9.4.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.5.tgz", + "integrity": "sha512-DvC7bzO5797bkApgukxouHmkOdYN2D0yL5olw0RncDpXUa6n39qTVsUi/5g2QJjPgl8qn4zh+4h0sofNoWGLRg==", "dev": true }, - "@types/protobufjs": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@types/protobufjs/-/protobufjs-6.0.0.tgz", - "integrity": "sha512-A27RDExpAf3rdDjIrHKiJK6x8kqqJ4CmoChwtipfhVAn1p7+wviQFFP7dppn8FslSbHtQeVPvi8wNKkDjSYjHw==", - "dev": true, - "requires": { - "protobufjs": "6.8.4" - } - }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -135,11 +56,6 @@ "underscore.string": "2.4.0" } }, - "arguejs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/arguejs/-/arguejs-0.2.3.tgz", - "integrity": "sha1-tvk59f4OPNHz+T4qqSYkJL8xKvc=" - }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", @@ -212,6 +128,20 @@ "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.15.3.tgz", "integrity": "sha1-NCQX2PLzRhsUzwkIjV7fh5HcmDI=" }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, "braces": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", @@ -231,14 +161,15 @@ } }, "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" }, "center-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "optional": true, "requires": { "align-text": "0.1.4", "lazy-cache": "1.0.4" @@ -257,27 +188,30 @@ } }, "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" - } + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" } }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, "colour": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, "create-frame": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/create-frame/-/create-frame-1.0.0.tgz", @@ -452,6 +386,11 @@ "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=" }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, "get-object": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/get-object/-/get-object-0.2.0.tgz", @@ -481,6 +420,19 @@ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, "glob-base": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", @@ -534,12 +486,11 @@ "integrity": "sha1-uMxjx02DRXvYqakEUDyO+ya8ozk=" }, "grpc": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.8.4.tgz", - "integrity": "sha1-gdG0nM3SWnFJ8Ynzw2sSPKRsqpU=", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.9.0.tgz", + "integrity": "sha512-F4j7ireH/ssXcBNTGR3yFjRHTWdJmtg6Czm5tnQYwIuhZh4znx8KhA50dpAkjNqrrbzt97N6hd/TXOPTZGmvtQ==", "requires": { - "arguejs": "0.2.3", - "lodash": "4.17.4", + "lodash": "4.17.5", "nan": "2.8.0", "node-pre-gyp": "0.6.39", "protobufjs": "5.0.2" @@ -679,7 +630,7 @@ } }, "debug": { - "version": "2.6.8", + "version": "2.6.9", "bundled": true, "requires": { "ms": "2.0.0" @@ -952,10 +903,10 @@ "mkdirp": "0.5.1", "nopt": "4.0.1", "npmlog": "4.1.2", - "rc": "1.2.3", + "rc": "1.2.4", "request": "2.81.0", "rimraf": "2.6.2", - "semver": "5.4.1", + "semver": "5.5.0", "tar": "2.2.1", "tar-pack": "3.4.1" } @@ -1025,17 +976,6 @@ "version": "1.0.7", "bundled": true }, - "protobufjs": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.2.tgz", - "integrity": "sha1-WXSNfc8D0tsiwT2p/rAk4Wq4DJE=", - "requires": { - "ascli": "1.0.1", - "bytebuffer": "5.0.1", - "glob": "7.1.2", - "yargs": "3.10.0" - } - }, "punycode": { "version": "1.4.1", "bundled": true @@ -1045,7 +985,7 @@ "bundled": true }, "rc": { - "version": "1.2.3", + "version": "1.2.4", "bundled": true, "requires": { "deep-extend": "0.4.2", @@ -1098,7 +1038,7 @@ "stringstream": "0.0.5", "tough-cookie": "2.3.3", "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "uuid": "3.2.1" } }, "rimraf": { @@ -1113,7 +1053,7 @@ "bundled": true }, "semver": { - "version": "5.4.1", + "version": "5.5.0", "bundled": true }, "set-blocking": { @@ -1151,13 +1091,6 @@ } } }, - "string_decoder": { - "version": "1.0.3", - "bundled": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -1167,6 +1100,13 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.3", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true @@ -1195,7 +1135,7 @@ "version": "3.4.1", "bundled": true, "requires": { - "debug": "2.6.8", + "debug": "2.6.9", "fstream": "1.0.11", "fstream-ignore": "1.0.5", "once": "1.4.0", @@ -1233,7 +1173,7 @@ "bundled": true }, "uuid": { - "version": "3.1.0", + "version": "3.2.1", "bundled": true }, "verror": { @@ -1304,7 +1244,7 @@ "logging-helpers": "0.4.0", "make-iterator": "0.3.1", "micromatch": "2.3.11", - "mixin-deep": "1.3.0", + "mixin-deep": "1.3.1", "normalize-path": "2.1.1", "relative": "3.0.2", "striptags": "2.2.1", @@ -1346,7 +1286,7 @@ "integrity": "sha1-ONt/dxhJ4wrpXJL8AhuutT8uMEA=", "requires": { "isobject": "2.1.0", - "mixin-deep": "1.3.0", + "mixin-deep": "1.3.1", "remarkable": "1.7.1" }, "dependencies": { @@ -1385,6 +1325,25 @@ "resolved": "https://registry.npmjs.org/index-of/-/index-of-0.2.0.tgz", "integrity": "sha1-OMHiNn6lXf+tO261kuwcwwkNfWU=" }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -1394,9 +1353,9 @@ } }, "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-data-descriptor": { "version": "0.1.4", @@ -1454,6 +1413,14 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, "is-glob": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", @@ -1511,18 +1478,27 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } }, "lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" }, "logging-helpers": { "version": "0.4.0", @@ -1585,15 +1561,23 @@ } } }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, "minimist": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" }, "mixin-deep": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.0.tgz", - "integrity": "sha512-dgaCvoh6i1nosAUBKb0l0pfJ78K8+S9fluyIR2YvAeUD/QuMahnFnF3xYty5eYXMjhGSsB0DsW6A0uAZyetoAg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "requires": { "for-in": "1.0.2", "is-extendable": "1.0.1" @@ -1637,6 +1621,11 @@ "remove-trailing-separator": "1.1.0" } }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -1646,6 +1635,14 @@ "is-extendable": "0.1.1" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -1660,6 +1657,14 @@ "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "1.0.0" + } + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -1686,38 +1691,25 @@ } } }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" }, "protobufjs": { - "version": "6.8.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.4.tgz", - "integrity": "sha512-d+WZqUDXKM+oZhr8yprAtQW07q08p9/V35AJ2J1fds+r903S/aH9P8uO1gmTwozOKugt2XCjdrre3OxuPRGkGg==", - "dev": true, - "requires": { - "@protobufjs/aspromise": "1.1.2", - "@protobufjs/base64": "1.1.2", - "@protobufjs/codegen": "2.0.4", - "@protobufjs/eventemitter": "1.1.0", - "@protobufjs/fetch": "1.1.0", - "@protobufjs/float": "1.0.2", - "@protobufjs/inquire": "1.1.0", - "@protobufjs/path": "1.1.2", - "@protobufjs/pool": "1.1.0", - "@protobufjs/utf8": "1.1.0", - "@types/long": "3.0.32", - "@types/node": "8.5.9", - "long": "3.2.0" - }, - "dependencies": { - "@types/node": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.5.9.tgz", - "integrity": "sha512-s+c3AjymyAccTI4hcgNFK4mToH8l+hyPDhu4LIkn71lRy56FLijGu00fyLgldjM/846Pmk9N4KFUs2P8GDs0pA==", - "dev": true - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.2.tgz", + "integrity": "sha1-WXSNfc8D0tsiwT2p/rAk4Wq4DJE=", + "requires": { + "ascli": "1.0.1", + "bytebuffer": "5.0.1", + "glob": "7.1.2", + "yargs": "3.32.0" } }, "randomatic": { @@ -1734,7 +1726,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "requires": { - "is-buffer": "1.1.5" + "is-buffer": "1.1.6" } } } @@ -1793,6 +1785,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "optional": true, "requires": { "align-text": "0.1.4" } @@ -1813,6 +1806,16 @@ "amdefine": "1.0.1" } }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -1855,11 +1858,52 @@ "yargs": "3.10.0" }, "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "optional": true + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "optional": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } } } }, @@ -1885,24 +1929,46 @@ "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" }, "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", + "camelcase": "2.1.1", + "cliui": "3.2.0", "decamelize": "1.2.0", - "window-size": "0.1.0" + "os-locale": "1.4.0", + "string-width": "1.0.2", + "window-size": "0.1.4", + "y18n": "3.2.1" } } } diff --git a/package.json b/package.json index a1ca40a..cd053d0 100644 --- a/package.json +++ b/package.json @@ -28,15 +28,13 @@ "homepage": "https://github.com/agreatfool/grpc_tools_node_protoc_ts#readme", "dependencies": { "google-protobuf": "^3.5.0", - "grpc": "^1.8.4", + "grpc": "^1.9.0", "handlebars": "^4.0.11", "handlebars-helpers": "^0.8.4" }, "devDependencies": { "@types/google-protobuf": "^3.2.7", "@types/handlebars": "^4.0.36", - "@types/node": "^9.4.2", - "@types/protobufjs": "^6.0.0", - "protobufjs": "^6.8.4" + "@types/node": "^9.4.2" } } diff --git a/src/lib/template/svc_tsd.hbs b/src/lib/template/svc_tsd.hbs index 6a975fd..b129f55 100644 --- a/src/lib/template/svc_tsd.hbs +++ b/src/lib/template/svc_tsd.hbs @@ -8,7 +8,7 @@ {{/each}} {{#each services}} -interface I{{{serviceName}}}Service extends grpc.ServiceDefinition { +interface I{{{serviceName}}}Service extends grpc.ServiceDefinition { {{#each methods}} {{lcFirst methodName}}: I{{{methodName}}}; {{/each}} @@ -35,15 +35,15 @@ export interface I{{{serviceName}}}Client { {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata: grpc.Metadata, callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientUnaryCall; {{/eq}} {{#eq type "ClientWritableStream"}} - {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; - {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; + {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; + {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientReadableStream"}} - {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream; + {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientDuplexStream"}} - {{lcFirst methodName}}(): grpc.ClientDuplexStream; - {{lcFirst methodName}}(metadata: grpc.Metadata): grpc.ClientDuplexStream; + {{lcFirst methodName}}(): grpc.ClientDuplexStream<{{{requestTypeName}}}, {{{responseTypeName}}}>; + {{lcFirst methodName}}(metadata: grpc.Metadata): grpc.ClientDuplexStream<{{{requestTypeName}}}, {{{responseTypeName}}}>; {{/eq}} {{/each}} } @@ -57,14 +57,14 @@ export class {{{serviceName}}}Client extends grpc.Client implements I{{{serviceN public {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata: grpc.Metadata, callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientUnaryCall; {{/eq}} {{#eq type "ClientWritableStream"}} - public {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; - public {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream; + public {{lcFirst methodName}}(callback: (error: Error | null, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; + public {{lcFirst methodName}}(callback: (error: Error | null, metadata: grpc.Metadata, response: {{{responseTypeName}}}) => void): grpc.ClientWritableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientReadableStream"}} - public {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream; + public {{lcFirst methodName}}(request: {{{requestTypeName}}}, metadata?: grpc.Metadata): grpc.ClientReadableStream<{{{requestTypeName}}}>; {{/eq}} {{#eq type "ClientDuplexStream"}} - public {{lcFirst methodName}}(metadata?: grpc.Metadata): grpc.ClientDuplexStream; + public {{lcFirst methodName}}(metadata?: grpc.Metadata): grpc.ClientDuplexStream<{{{requestTypeName}}}, {{{responseTypeName}}}>; {{/eq}} {{/each}} }