From 1f74c7d2b7a2486d85cbf703c2c1afd5330c521b Mon Sep 17 00:00:00 2001 From: Kevin Greene <30637378+kevin-greene-ck@users.noreply.github.com> Date: Fri, 24 May 2019 10:40:35 -0700 Subject: [PATCH] feat: include method parameters map (#159) * Include method parameters map (#158) * add method parameters Keep track of the number of arguments of services * update test fixtures * fix: only need methodParams on instances --- package-lock.json | 32 ++++----- src/main/render/shared/identifiers.ts | 2 + .../render/thrift-server/service/client.ts | 3 + .../render/thrift-server/service/index.ts | 2 + .../render/thrift-server/service/utils.ts | 67 ++++++++++++++++++- .../annotations_service.solution.ts | 10 +++ .../thrift-server/basic_service.solution.ts | 10 +++ .../basic_service.strict_union.solution.ts | 9 +++ .../generated-strict/SharedService.ts | 10 +++ .../com/test/calculator/Calculator.ts | 24 +++++++ .../thrift-server/generated/SharedService.ts | 10 +++ .../com/test/calculator/Calculator.ts | 24 +++++++ .../thrift-server/i64_service.solution.ts | 9 +++ .../resolved_field_service.solution.ts | 8 +++ .../throws_multi_service.solution.ts | 8 +++ .../thrift-server/throws_service.solution.ts | 9 +++ 16 files changed, 220 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4ace6124..e572add9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,9 +65,9 @@ "dev": true }, "@types/node": { - "version": "8.10.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.47.tgz", - "integrity": "sha512-HshJQ2myCc05qYuR99HvJRK5rWOPwKLumVDrpizY58OJUVEgRwd7RtxqDOOi350VGxFI8hrCtjR7IaDfo0S12Q==", + "version": "8.10.48", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.48.tgz", + "integrity": "sha512-c35YEBTkL4rzXY2ucpSKy+UYHjUBIIkuJbWYbsGIrKLEWU5dgJMmLkkIb3qeC3O3Tpb1ZQCwecscvJTDjDjkRw==", "dev": true }, "@types/node-int64": { @@ -295,9 +295,9 @@ "dev": true }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -463,9 +463,9 @@ "dev": true }, "prettier": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz", - "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz", + "integrity": "sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==", "dev": true }, "q": { @@ -475,9 +475,9 @@ "dev": true }, "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -610,12 +610,12 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.0.0.tgz", + "integrity": "sha512-cknCal4k0EAOrh1SHHPPWWh4qm93g1IuGGGwBjWkXmCG7LsDtL8w9w+YVfaF+KSVwiHQKDIMsSLBVftKf9d1pg==", "dev": true, "requires": { - "async-limiter": "~1.0.0" + "async-limiter": "^1.0.0" } } } diff --git a/src/main/render/shared/identifiers.ts b/src/main/render/shared/identifiers.ts index 7abf3f14..0bb8e2c8 100644 --- a/src/main/render/shared/identifiers.ts +++ b/src/main/render/shared/identifiers.ts @@ -10,6 +10,8 @@ export const COMMON_IDENTIFIERS = { thrift: ts.createIdentifier('thrift'), methodNames: ts.createIdentifier('methodNames'), _methodNames: ts.createIdentifier('_methodNames'), + methodParameters: ts.createIdentifier('methodParameters'), + _methodParameters: ts.createIdentifier('_methodParameters'), serviceName: ts.createIdentifier('serviceName'), fieldAnnotations: ts.createIdentifier('fieldAnnotations'), methodAnnotations: ts.createIdentifier('methodAnnotations'), diff --git a/src/main/render/thrift-server/service/client.ts b/src/main/render/thrift-server/service/client.ts index fbc65646..378b15c2 100644 --- a/src/main/render/thrift-server/service/client.ts +++ b/src/main/render/thrift-server/service/client.ts @@ -15,6 +15,7 @@ import { createStructResultName, renderMethodNamesProperty, renderMethodNamesStaticProperty, + renderMethodParametersProperty, renderServiceNameProperty, renderServiceNameStaticProperty, } from './utils' @@ -89,6 +90,7 @@ export function renderClient( const annotations: ts.PropertyDeclaration = renderServiceAnnotationsProperty() const methodAnnotations: ts.PropertyDeclaration = renderMethodAnnotationsProperty() const methodNames: ts.PropertyDeclaration = renderMethodNamesProperty() + const methodParameters: ts.PropertyDeclaration = renderMethodParametersProperty() const baseMethods: Array = service.functions.map( (func: FunctionDefinition) => { @@ -123,6 +125,7 @@ export function renderClient( annotations, methodAnnotations, methodNames, + methodParameters, ...createCtor(service), ...baseMethods, ], // body diff --git a/src/main/render/thrift-server/service/index.ts b/src/main/render/thrift-server/service/index.ts index ce5d817e..0ab6ce99 100644 --- a/src/main/render/thrift-server/service/index.ts +++ b/src/main/render/thrift-server/service/index.ts @@ -15,6 +15,7 @@ import { createStructArgsName, createStructResultName, renderMethodNames, + renderMethodParameters, renderServiceName, } from './utils' @@ -51,6 +52,7 @@ export function renderService( renderServiceAnnotations(collectAllAnnotations(service, state)), renderMethodAnnotations(collectAllMethods(service, state)), renderMethodNames(service, state), + renderMethodParameters(service, state), ...renderArgsStruct(service, state), ...renderResultStruct(service, state), renderClient(service, state), diff --git a/src/main/render/thrift-server/service/utils.ts b/src/main/render/thrift-server/service/utils.ts index ce827984..dc2353a0 100644 --- a/src/main/render/thrift-server/service/utils.ts +++ b/src/main/render/thrift-server/service/utils.ts @@ -14,7 +14,7 @@ import { DefinitionType, IRenderState } from '../../../types' import { COMMON_IDENTIFIERS } from '../identifiers' import { resolveIdentifierDefinition } from '../../../resolver' -import { createStringType } from '../../shared/types' +import { createNumberType, createStringType } from '../../shared/types' export function capitalize(str: string): string { return str.charAt(0).toUpperCase() + str.slice(1) @@ -165,6 +165,71 @@ export function renderMethodNamesStaticProperty(): ts.PropertyDeclaration { ) } +const methodParamMapType: ts.TypeLiteralNode = ts.createTypeLiteralNode([ + ts.createIndexSignature( + undefined, + undefined, + [ + ts.createParameter( + undefined, + undefined, + undefined, + COMMON_IDENTIFIERS.methodName, + undefined, + createStringType(), + ), + ], + createNumberType(), + ), +]) + +export function renderMethodParameters( + service: ServiceDefinition, + state: IRenderState, +): ts.VariableStatement { + return ts.createVariableStatement( + [ts.createToken(ts.SyntaxKind.ExportKeyword)], + ts.createVariableDeclarationList( + [ + ts.createVariableDeclaration( + COMMON_IDENTIFIERS.methodParameters, + methodParamMapType, + ts.createObjectLiteral( + [ + ...collectAllMethods(service, state).map( + (next: FunctionDefinition) => { + return ts.createPropertyAssignment( + next.name.value, + ts.createLiteral( + next.fields.length + 1, // including context + ), + ) + }, + ), + ], + true, + ), + ), + ], + ts.NodeFlags.Const, + ), + ) +} + +export function renderMethodParametersProperty(): ts.PropertyDeclaration { + return ts.createProperty( + undefined, + [ + ts.createToken(ts.SyntaxKind.PublicKeyword), + ts.createToken(ts.SyntaxKind.ReadonlyKeyword), + ], + COMMON_IDENTIFIERS._methodParameters, + undefined, + methodParamMapType, + COMMON_IDENTIFIERS.methodParameters, + ) +} + function getRawAnnotations( service: ServiceDefinition, state: IRenderState, diff --git a/src/tests/unit/fixtures/thrift-server/annotations_service.solution.ts b/src/tests/unit/fixtures/thrift-server/annotations_service.solution.ts index c3aeecb5..7bcafee0 100644 --- a/src/tests/unit/fixtures/thrift-server/annotations_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/annotations_service.solution.ts @@ -144,6 +144,13 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getUser", "saveUser", "ping"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getUser: 2, + saveUser: 2, + ping: 1 +}; export interface IGetUser__Args { __name: "GetUser__Args"; id: number; @@ -593,6 +600,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public getUser(id: number, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/basic_service.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_service.solution.ts index 1366c073..4cc77b21 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_service.solution.ts @@ -132,6 +132,13 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getUser", "saveUser", "ping"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getUser: 2, + saveUser: 2, + ping: 1 +}; export interface IGetUser__Args { __name: "GetUser__Args"; id: number; @@ -581,6 +588,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public getUser(id: number, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/basic_service.strict_union.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_service.strict_union.solution.ts index 4b580af8..918f141b 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_service.strict_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_service.strict_union.solution.ts @@ -172,6 +172,12 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getUser", "ping"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getUser: 2, + ping: 1 +}; export interface IGetUser__Args { __name: "GetUser__Args"; arg1: MyUnion; @@ -465,6 +471,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public getUser(arg1: MyUnionArgs, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedService.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedService.ts index 11a8b13e..19478b33 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedService.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedService.ts @@ -22,6 +22,13 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getStruct", "getUnion", "getEnum"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getStruct: 2, + getUnion: 2, + getEnum: 1 +}; export interface IGetStruct__Args { __name: "GetStruct__Args"; key: number; @@ -489,6 +496,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public getStruct(key: number, context?: Context): Promise<__NAMESPACE__.ISharedStruct> { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Calculator.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Calculator.ts index 7379e7ce..1b9d0cd3 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Calculator.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Calculator.ts @@ -81,6 +81,27 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getStruct", "getUnion", "getEnum", "ping", "add", "addInt64", "addWithContext", "calculate", "echoBinary", "echoString", "checkName", "checkOptional", "mapOneList", "mapValues", "listToMap", "fetchThing", "zip"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getStruct: 2, + getUnion: 2, + getEnum: 1, + ping: 1, + add: 3, + addInt64: 3, + addWithContext: 3, + calculate: 3, + echoBinary: 2, + echoString: 2, + checkName: 2, + checkOptional: 2, + mapOneList: 2, + mapValues: 2, + listToMap: 2, + fetchThing: 1, + zip: 1 +}; export interface IPing__Args { __name: "Ping__Args"; } @@ -2556,6 +2577,9 @@ export class Client extends __ROOT_NAMESPACE__.SharedService.Clie public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; constructor(connection: thrift.IThriftConnection) { super(connection); } diff --git a/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts b/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts index a28855bb..e37f374a 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts @@ -22,6 +22,13 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getStruct", "getUnion", "getEnum"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getStruct: 2, + getUnion: 2, + getEnum: 1 +}; export interface IGetStruct__Args { __name: "GetStruct__Args"; key: number; @@ -489,6 +496,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public getStruct(key: number, context?: Context): Promise<__NAMESPACE__.ISharedStruct> { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Calculator.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Calculator.ts index 0fbd1df5..b3870aa5 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Calculator.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Calculator.ts @@ -81,6 +81,27 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["getStruct", "getUnion", "getEnum", "ping", "add", "addInt64", "addWithContext", "calculate", "echoBinary", "echoString", "checkName", "checkOptional", "mapOneList", "mapValues", "listToMap", "fetchThing", "zip"]; +export const methodParameters: { + [methodName: string]: number; +} = { + getStruct: 2, + getUnion: 2, + getEnum: 1, + ping: 1, + add: 3, + addInt64: 3, + addWithContext: 3, + calculate: 3, + echoBinary: 2, + echoString: 2, + checkName: 2, + checkOptional: 2, + mapOneList: 2, + mapValues: 2, + listToMap: 2, + fetchThing: 1, + zip: 1 +}; export interface IPing__Args { __name: "Ping__Args"; } @@ -2556,6 +2577,9 @@ export class Client extends __ROOT_NAMESPACE__.SharedService.Clie public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; constructor(connection: thrift.IThriftConnection) { super(connection); } diff --git a/src/tests/unit/fixtures/thrift-server/i64_service.solution.ts b/src/tests/unit/fixtures/thrift-server/i64_service.solution.ts index 4cd6d1e8..730807cb 100644 --- a/src/tests/unit/fixtures/thrift-server/i64_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/i64_service.solution.ts @@ -88,6 +88,12 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["peg", "pong"]; +export const methodParameters: { + [methodName: string]: number; +} = { + peg: 2, + pong: 2 +}; export interface IPeg__Args { __name: "Peg__Args"; name: string; @@ -416,6 +422,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public peg(name: string, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/resolved_field_service.solution.ts b/src/tests/unit/fixtures/thrift-server/resolved_field_service.solution.ts index aa44ba52..361aa9eb 100644 --- a/src/tests/unit/fixtures/thrift-server/resolved_field_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/resolved_field_service.solution.ts @@ -8,6 +8,11 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["ping"]; +export const methodParameters: { + [methodName: string]: number; +} = { + ping: 2 +}; export interface IPing__Args { __name: "Ping__Args"; id: thrift.Int64; @@ -173,6 +178,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public ping(id: number | string | thrift.Int64, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/throws_multi_service.solution.ts b/src/tests/unit/fixtures/thrift-server/throws_multi_service.solution.ts index 605a5387..7fa03256 100644 --- a/src/tests/unit/fixtures/thrift-server/throws_multi_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/throws_multi_service.solution.ts @@ -261,6 +261,11 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["peg"]; +export const methodParameters: { + [methodName: string]: number; +} = { + peg: 2 +}; export interface IPeg__Args { __name: "Peg__Args"; name: string; @@ -504,6 +509,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public peg(name: string, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer); diff --git a/src/tests/unit/fixtures/thrift-server/throws_service.solution.ts b/src/tests/unit/fixtures/thrift-server/throws_service.solution.ts index 4e9b1ae7..fe7cdf37 100644 --- a/src/tests/unit/fixtures/thrift-server/throws_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/throws_service.solution.ts @@ -88,6 +88,12 @@ export const methodAnnotations: thrift.IMethodAnnotations = { } }; export const methodNames: Array = ["peg", "pong"]; +export const methodParameters: { + [methodName: string]: number; +} = { + peg: 2, + pong: 2 +}; export interface IPeg__Args { __name: "Peg__Args"; name: string; @@ -439,6 +445,9 @@ export class Client extends thrift.ThriftClient { public readonly _annotations: thrift.IThriftAnnotations = annotations; public readonly _methodAnnotations: thrift.IMethodAnnotations = methodAnnotations; public readonly _methodNames: Array = methodNames; + public readonly _methodParameters: { + [methodName: string]: number; + } = methodParameters; public peg(name: string, context?: Context): Promise { const writer: thrift.TTransport = new this.transport(); const output: thrift.TProtocol = new this.protocol(writer);