diff --git a/src/main/render/thrift-server/struct/encode.ts b/src/main/render/thrift-server/struct/encode.ts index 0b1ec7dd..4dcfac73 100644 --- a/src/main/render/thrift-server/struct/encode.ts +++ b/src/main/render/thrift-server/struct/encode.ts @@ -30,6 +30,7 @@ import { } from '../utils' import { + createAnyType, createVoidType, thriftTypeForFieldType, typeNodeForFieldType, @@ -54,7 +55,7 @@ export function createTempVariables( return [ createConstStatement( COMMON_IDENTIFIERS.obj, - undefined, + createAnyType(), ts.createObjectLiteral( node.fields.map( ( diff --git a/src/tests/unit/fixtures/thrift-server/annotations_exception.solution.ts b/src/tests/unit/fixtures/thrift-server/annotations_exception.solution.ts index 3c1e9ee3..0e0dcc5c 100644 --- a/src/tests/unit/fixtures/thrift-server/annotations_exception.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/annotations_exception.solution.ts @@ -9,7 +9,7 @@ export interface IMyExceptionArgs { } export const MyExceptionCodec: thrift.IStructCodec = { encode(args: IMyExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, code: (args.code != null ? args.code : 200) }; 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 1acddf11..27c928d6 100644 --- a/src/tests/unit/fixtures/thrift-server/annotations_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/annotations_service.solution.ts @@ -9,7 +9,7 @@ export interface IUserArgs { } export const UserCodec: thrift.IStructCodec = { encode(args: IUserArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name, id: args.id }; @@ -160,7 +160,7 @@ export interface IGetUser__ArgsArgs { } export const GetUser__ArgsCodec: thrift.IStructCodec = { encode(args: IGetUser__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: args.id }; output.writeStructBegin("GetUser__Args"); @@ -248,7 +248,7 @@ export interface ISaveUser__ArgsArgs { } export const SaveUser__ArgsCodec: thrift.IStructCodec = { encode(args: ISaveUser__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { user: args.user }; output.writeStructBegin("SaveUser__Args"); @@ -387,7 +387,7 @@ export interface IGetUser__ResultArgs { } export const GetUser__ResultCodec: thrift.IStructCodec = { encode(args: IGetUser__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetUser__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/annotations_struct.solution.ts b/src/tests/unit/fixtures/thrift-server/annotations_struct.solution.ts index 20bdd5b8..b4b7be92 100644 --- a/src/tests/unit/fixtures/thrift-server/annotations_struct.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/annotations_struct.solution.ts @@ -9,7 +9,7 @@ export interface IMyStructArgs { } export const MyStructCodec: thrift.IStructCodec = { encode(args: IMyStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: (args.id != null ? args.id : 45), bigID: (args.bigID != null ? (typeof args.bigID === "number" ? new thrift.Int64(args.bigID) : typeof args.bigID === "string" ? thrift.Int64.fromDecimalString(args.bigID) : args.bigID) : thrift.Int64.fromDecimalString("23948234")) }; diff --git a/src/tests/unit/fixtures/thrift-server/annotations_union.solution.ts b/src/tests/unit/fixtures/thrift-server/annotations_union.solution.ts index 0357571d..2d5344e2 100644 --- a/src/tests/unit/fixtures/thrift-server/annotations_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/annotations_union.solution.ts @@ -10,7 +10,7 @@ export interface IMyUnionArgs { export const MyUnionCodec: thrift.IStructCodec = { encode(args: IMyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { field1: args.field1, field2: (typeof args.field2 === "number" ? new thrift.Int64(args.field2) : typeof args.field2 === "string" ? thrift.Int64.fromDecimalString(args.field2) : args.field2) }; diff --git a/src/tests/unit/fixtures/thrift-server/basic_exception.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_exception.solution.ts index 149aa2b6..e1a521b8 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_exception.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_exception.solution.ts @@ -9,7 +9,7 @@ export interface IMyExceptionArgs { } export const MyExceptionCodec: thrift.IStructCodec = { encode(args: IMyExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, code: (args.code != null ? args.code : 200) }; 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 d3bcb533..24b8d6a8 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_service.solution.ts @@ -9,7 +9,7 @@ export interface IUserArgs { } export const UserCodec: thrift.IStructCodec = { encode(args: IUserArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name, id: args.id }; @@ -148,7 +148,7 @@ export interface IGetUser__ArgsArgs { } export const GetUser__ArgsCodec: thrift.IStructCodec = { encode(args: IGetUser__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: args.id }; output.writeStructBegin("GetUser__Args"); @@ -236,7 +236,7 @@ export interface ISaveUser__ArgsArgs { } export const SaveUser__ArgsCodec: thrift.IStructCodec = { encode(args: ISaveUser__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { user: args.user }; output.writeStructBegin("SaveUser__Args"); @@ -375,7 +375,7 @@ export interface IGetUser__ResultArgs { } export const GetUser__ResultCodec: thrift.IStructCodec = { encode(args: IGetUser__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetUser__Result"); 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 931e0fd1..724abd64 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 @@ -66,7 +66,7 @@ export const MyUnionCodec: thrift.IStructToolkit = { }, encode(args: MyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { field1: args.field1, field2: (typeof args.field2 === "number" ? new thrift.Int64(args.field2) : typeof args.field2 === "string" ? thrift.Int64.fromDecimalString(args.field2) : args.field2) }; @@ -187,7 +187,7 @@ export interface IGetUser__ArgsArgs { } export const GetUser__ArgsCodec: thrift.IStructCodec = { encode(args: IGetUser__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg1: args.arg1 }; output.writeStructBegin("GetUser__Args"); @@ -326,7 +326,7 @@ export interface IGetUser__ResultArgs { } export const GetUser__ResultCodec: thrift.IStructCodec = { encode(args: IGetUser__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetUser__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/basic_struct.no_name.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_struct.no_name.solution.ts index 957ac8eb..a989a525 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_struct.no_name.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_struct.no_name.solution.ts @@ -6,7 +6,7 @@ export interface IMyStructArgs { } export const MyStructCodec: thrift.IStructCodec = { encode(args: IMyStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: args.id }; output.writeStructBegin("MyStruct"); diff --git a/src/tests/unit/fixtures/thrift-server/basic_struct.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_struct.solution.ts index f279c3ac..80a8011b 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_struct.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_struct.solution.ts @@ -15,7 +15,7 @@ export interface IMyStructArgs { } export const MyStructCodec: thrift.IStructCodec = { encode(args: IMyStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: (args.id != null ? args.id : 45), bigID: (args.bigID != null ? (typeof args.bigID === "number" ? new thrift.Int64(args.bigID) : typeof args.bigID === "string" ? thrift.Int64.fromDecimalString(args.bigID) : args.bigID) : thrift.Int64.fromDecimalString("23948234")), word: args.word, diff --git a/src/tests/unit/fixtures/thrift-server/basic_union.no_name.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_union.no_name.solution.ts index 37874485..6d5fc262 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_union.no_name.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_union.no_name.solution.ts @@ -9,7 +9,7 @@ export interface IMyUnionArgs { export const MyUnionCodec: thrift.IStructCodec = { encode(args: IMyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: args.option1, option2: (typeof args.option2 === "number" ? new thrift.Int64(args.option2) : typeof args.option2 === "string" ? thrift.Int64.fromDecimalString(args.option2) : args.option2) }; diff --git a/src/tests/unit/fixtures/thrift-server/basic_union.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_union.solution.ts index c7724cad..f0ec0050 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_union.solution.ts @@ -10,7 +10,7 @@ export interface IMyUnionArgs { export const MyUnionCodec: thrift.IStructCodec = { encode(args: IMyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: args.option1, option2: (typeof args.option2 === "number" ? new thrift.Int64(args.option2) : typeof args.option2 === "string" ? thrift.Int64.fromDecimalString(args.option2) : args.option2) }; diff --git a/src/tests/unit/fixtures/thrift-server/basic_union.strict_union.solution.ts b/src/tests/unit/fixtures/thrift-server/basic_union.strict_union.solution.ts index 709db809..1e8db67f 100644 --- a/src/tests/unit/fixtures/thrift-server/basic_union.strict_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/basic_union.strict_union.solution.ts @@ -66,7 +66,7 @@ export const MyUnionCodec: thrift.IStructToolkit = { }, encode(args: MyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { field1: args.field1, field2: (typeof args.field2 === "number" ? new thrift.Int64(args.field2) : typeof args.field2 === "string" ? thrift.Int64.fromDecimalString(args.field2) : args.field2) }; diff --git a/src/tests/unit/fixtures/thrift-server/complex_nested_struct.solution.ts b/src/tests/unit/fixtures/thrift-server/complex_nested_struct.solution.ts index ab393d41..c188fe03 100644 --- a/src/tests/unit/fixtures/thrift-server/complex_nested_struct.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/complex_nested_struct.solution.ts @@ -9,7 +9,7 @@ export interface IOtherStructArgs { } export const OtherStructCodec: thrift.IStructCodec = { encode(args: IOtherStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: (typeof args.id === "number" ? new thrift.Int64(args.id) : typeof args.id === "string" ? thrift.Int64.fromDecimalString(args.id) : args.id), name: (args.name != null ? (typeof args.name === "string" ? Buffer.from(args.name) : args.name) : Buffer.from("John")) }; @@ -132,7 +132,7 @@ export interface IMyStructArgs { } export const MyStructCodec: thrift.IStructCodec = { encode(args: IMyStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { idList: args.idList, idMap: args.idMap, idMapList: args.idMapList, diff --git a/src/tests/unit/fixtures/thrift-server/complex_typedef.strict_union.solution.ts b/src/tests/unit/fixtures/thrift-server/complex_typedef.strict_union.solution.ts index c5542dd8..f0a4984d 100644 --- a/src/tests/unit/fixtures/thrift-server/complex_typedef.strict_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/complex_typedef.strict_union.solution.ts @@ -70,7 +70,7 @@ export const MyUnionCodec: thrift.IStructToolkit = { }, encode(args: MyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: args.option1, option2: args.option2 }; diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/Code.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/Code.ts index 1ecddcb3..63f0fb31 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/Code.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/Code.ts @@ -14,7 +14,7 @@ export interface ICodeArgs { } export const CodeCodec: thrift.IStructCodec = { encode(args: ICodeArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { status: (typeof args.status === "number" ? new thrift.Int64(args.status) : typeof args.status === "string" ? thrift.Int64.fromDecimalString(args.status) : args.status) }; output.writeStructBegin("Code"); 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 0cb4b78a..cf35aca7 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedService.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedService.ts @@ -41,7 +41,7 @@ export interface IGetUnion__ArgsArgs { } export const GetUnion__ArgsCodec: thrift.IStructCodec = { encode(args: IGetUnion__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { index: args.index }; output.writeStructBegin("GetUnion__Args"); @@ -180,7 +180,7 @@ export interface IGetUnion__ResultArgs { } export const GetUnion__ResultCodec: thrift.IStructCodec = { encode(args: IGetUnion__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetUnion__Result"); @@ -257,7 +257,7 @@ export interface IGetEnum__ResultArgs { } export const GetEnum__ResultCodec: thrift.IStructCodec = { encode(args: IGetEnum__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetEnum__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedServiceBase.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedServiceBase.ts index 768f9209..d08fa011 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedServiceBase.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedServiceBase.ts @@ -29,7 +29,7 @@ export interface IGetStruct__ArgsArgs { } export const GetStruct__ArgsCodec: thrift.IStructCodec = { encode(args: IGetStruct__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { key: args.key }; output.writeStructBegin("GetStruct__Args"); @@ -117,7 +117,7 @@ export interface IGetStruct__ResultArgs { } export const GetStruct__ResultCodec: thrift.IStructCodec = { encode(args: IGetStruct__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetStruct__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedStruct.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedStruct.ts index 05e2f010..c0f539f9 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedStruct.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedStruct.ts @@ -17,7 +17,7 @@ export interface ISharedStructArgs { } export const SharedStructCodec: thrift.IStructCodec = { encode(args: ISharedStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { code: args.code, value: args.value }; diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedUnion.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedUnion.ts index 7d7c965f..9cef3846 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/SharedUnion.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/SharedUnion.ts @@ -73,7 +73,7 @@ export const SharedUnionCodec: thrift.IStructToolkit = { encode(args: IAdd__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: args.num1, num2: args.num2 }; @@ -291,7 +291,7 @@ export interface IAddInt64__ArgsArgs { } export const AddInt64__ArgsCodec: thrift.IStructCodec = { encode(args: IAddInt64__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: (typeof args.num1 === "number" ? new thrift.Int64(args.num1) : typeof args.num1 === "string" ? thrift.Int64.fromDecimalString(args.num1) : args.num1), num2: (typeof args.num2 === "number" ? new thrift.Int64(args.num2) : typeof args.num2 === "string" ? thrift.Int64.fromDecimalString(args.num2) : args.num2) }; @@ -408,7 +408,7 @@ export interface IAddWithContext__ArgsArgs { } export const AddWithContext__ArgsCodec: thrift.IStructCodec = { encode(args: IAddWithContext__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: args.num1, num2: args.num2 }; @@ -525,7 +525,7 @@ export interface ICalculate__ArgsArgs { } export const Calculate__ArgsCodec: thrift.IStructCodec = { encode(args: ICalculate__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { logid: args.logid, work: args.work }; @@ -640,7 +640,7 @@ export interface IEchoBinary__ArgsArgs { } export const EchoBinary__ArgsCodec: thrift.IStructCodec = { encode(args: IEchoBinary__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { word: (typeof args.word === "string" ? Buffer.from(args.word) : args.word) }; output.writeStructBegin("EchoBinary__Args"); @@ -728,7 +728,7 @@ export interface IEchoString__ArgsArgs { } export const EchoString__ArgsCodec: thrift.IStructCodec = { encode(args: IEchoString__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { word: args.word }; output.writeStructBegin("EchoString__Args"); @@ -816,7 +816,7 @@ export interface ICheckName__ArgsArgs { } export const CheckName__ArgsCodec: thrift.IStructCodec = { encode(args: ICheckName__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { choice: args.choice }; output.writeStructBegin("CheckName__Args"); @@ -904,7 +904,7 @@ export interface ICheckOptional__ArgsArgs { } export const CheckOptional__ArgsCodec: thrift.IStructCodec = { encode(args: ICheckOptional__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { type: args.type }; output.writeStructBegin("CheckOptional__Args"); @@ -981,7 +981,7 @@ export interface IMapOneList__ArgsArgs { } export const MapOneList__ArgsCodec: thrift.IStructCodec = { encode(args: IMapOneList__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg: args.arg }; output.writeStructBegin("MapOneList__Args"); @@ -1084,7 +1084,7 @@ export interface IMapValues__ArgsArgs { } export const MapValues__ArgsCodec: thrift.IStructCodec = { encode(args: IMapValues__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg: args.arg }; output.writeStructBegin("MapValues__Args"); @@ -1190,7 +1190,7 @@ export interface IListToMap__ArgsArgs { } export const ListToMap__ArgsCodec: thrift.IStructCodec = { encode(args: IListToMap__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg: args.arg }; output.writeStructBegin("ListToMap__Args"); @@ -1531,7 +1531,7 @@ export interface IAdd__ResultArgs { } export const Add__ResultCodec: thrift.IStructCodec = { encode(args: IAdd__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success, exp: args.exp }; @@ -1631,7 +1631,7 @@ export interface IAddInt64__ResultArgs { } export const AddInt64__ResultCodec: thrift.IStructCodec = { encode(args: IAddInt64__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: (typeof args.success === "number" ? new thrift.Int64(args.success) : typeof args.success === "string" ? thrift.Int64.fromDecimalString(args.success) : args.success), exp: args.exp }; @@ -1729,7 +1729,7 @@ export interface IAddWithContext__ResultArgs { } export const AddWithContext__ResultCodec: thrift.IStructCodec = { encode(args: IAddWithContext__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("AddWithContext__Result"); @@ -1808,7 +1808,7 @@ export interface ICalculate__ResultArgs { } export const Calculate__ResultCodec: thrift.IStructCodec = { encode(args: ICalculate__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success, ouch: args.ouch }; @@ -1906,7 +1906,7 @@ export interface IEchoBinary__ResultArgs { } export const EchoBinary__ResultCodec: thrift.IStructCodec = { encode(args: IEchoBinary__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("EchoBinary__Result"); @@ -1983,7 +1983,7 @@ export interface IEchoString__ResultArgs { } export const EchoString__ResultCodec: thrift.IStructCodec = { encode(args: IEchoString__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("EchoString__Result"); @@ -2060,7 +2060,7 @@ export interface ICheckName__ResultArgs { } export const CheckName__ResultCodec: thrift.IStructCodec = { encode(args: ICheckName__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("CheckName__Result"); @@ -2137,7 +2137,7 @@ export interface ICheckOptional__ResultArgs { } export const CheckOptional__ResultCodec: thrift.IStructCodec = { encode(args: ICheckOptional__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("CheckOptional__Result"); @@ -2214,7 +2214,7 @@ export interface IMapOneList__ResultArgs { } export const MapOneList__ResultCodec: thrift.IStructCodec = { encode(args: IMapOneList__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("MapOneList__Result"); @@ -2306,7 +2306,7 @@ export interface IMapValues__ResultArgs { } export const MapValues__ResultCodec: thrift.IStructCodec = { encode(args: IMapValues__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("MapValues__Result"); @@ -2398,7 +2398,7 @@ export interface IListToMap__ResultArgs { } export const ListToMap__ResultCodec: thrift.IStructCodec = { encode(args: IListToMap__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("ListToMap__Result"); @@ -2493,7 +2493,7 @@ export interface IFetchThing__ResultArgs { } export const FetchThing__ResultCodec: thrift.IStructCodec = { encode(args: IFetchThing__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("FetchThing__Result"); @@ -2570,7 +2570,7 @@ export interface IFetchMap__ResultArgs { } export const FetchMap__ResultCodec: thrift.IStructCodec = { encode(args: IFetchMap__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("FetchMap__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Choice.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Choice.ts index 2d4e4e59..76464494 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Choice.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Choice.ts @@ -75,7 +75,7 @@ export const ChoiceCodec: thrift.IStructToolkit = { }, encode(args: ChoiceArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { firstName: args.firstName, lastName: args.lastName }; diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/FirstName.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/FirstName.ts index e9614605..b3c9eb02 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/FirstName.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/FirstName.ts @@ -14,7 +14,7 @@ export interface IFirstNameArgs { } export const FirstNameCodec: thrift.IStructCodec = { encode(args: IFirstNameArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("FirstName"); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/LastName.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/LastName.ts index e023897c..24accb4d 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/LastName.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/LastName.ts @@ -14,7 +14,7 @@ export interface ILastNameArgs { } export const LastNameCodec: thrift.IStructCodec = { encode(args: ILastNameArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("LastName"); diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/NotAGoodIdea.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/NotAGoodIdea.ts index 822ad78f..bf3c20dd 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/NotAGoodIdea.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/NotAGoodIdea.ts @@ -18,7 +18,7 @@ export interface INotAGoodIdeaArgs { } export const NotAGoodIdeaCodec: thrift.IStructCodec = { encode(args: INotAGoodIdeaArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, data: args.data }; diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Work.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Work.ts index 5370f5f1..727cf11d 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Work.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/calculator/Work.ts @@ -21,7 +21,7 @@ export interface IWorkArgs { } export const WorkCodec: thrift.IStructCodec = { encode(args: IWorkArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: (args.num1 != null ? args.num1 : 0), num2: args.num2, op: (args.op != null ? args.op : Operation.Operation.ADD), diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/AuthException.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/AuthException.ts index 715b357d..eacfa3c8 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/AuthException.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/AuthException.ts @@ -16,7 +16,7 @@ export interface IAuthExceptionArgs { } export const AuthExceptionCodec: thrift.IStructCodec = { encode(args: IAuthExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { code: args.code, message: args.message }; diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/OtherCommonUnion.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/OtherCommonUnion.ts index 16d7eda1..5d13f36b 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/OtherCommonUnion.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/common/OtherCommonUnion.ts @@ -73,7 +73,7 @@ export const OtherCommonUnionCodec: thrift.IStructToolkit = { encode(args: IInvalidOperationArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { whatOp: args.whatOp, why: args.why }; diff --git a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/exceptions/InvalidResult.ts b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/exceptions/InvalidResult.ts index 399f58b6..3e96aeb1 100644 --- a/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/exceptions/InvalidResult.ts +++ b/src/tests/unit/fixtures/thrift-server/generated-strict/com/test/exceptions/InvalidResult.ts @@ -17,7 +17,7 @@ export interface IInvalidResultArgs { } export const InvalidResultCodec: thrift.IStructCodec = { encode(args: IInvalidResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, code: args.code }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/Code.ts b/src/tests/unit/fixtures/thrift-server/generated/Code.ts index 1ecddcb3..63f0fb31 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/Code.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/Code.ts @@ -14,7 +14,7 @@ export interface ICodeArgs { } export const CodeCodec: thrift.IStructCodec = { encode(args: ICodeArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { status: (typeof args.status === "number" ? new thrift.Int64(args.status) : typeof args.status === "string" ? thrift.Int64.fromDecimalString(args.status) : args.status) }; output.writeStructBegin("Code"); diff --git a/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts b/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts index 067b754e..6eff0d8e 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/SharedService.ts @@ -41,7 +41,7 @@ export interface IGetUnion__ArgsArgs { } export const GetUnion__ArgsCodec: thrift.IStructCodec = { encode(args: IGetUnion__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { index: args.index }; output.writeStructBegin("GetUnion__Args"); @@ -180,7 +180,7 @@ export interface IGetUnion__ResultArgs { } export const GetUnion__ResultCodec: thrift.IStructCodec = { encode(args: IGetUnion__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetUnion__Result"); @@ -257,7 +257,7 @@ export interface IGetEnum__ResultArgs { } export const GetEnum__ResultCodec: thrift.IStructCodec = { encode(args: IGetEnum__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetEnum__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/generated/SharedServiceBase.ts b/src/tests/unit/fixtures/thrift-server/generated/SharedServiceBase.ts index 768f9209..d08fa011 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/SharedServiceBase.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/SharedServiceBase.ts @@ -29,7 +29,7 @@ export interface IGetStruct__ArgsArgs { } export const GetStruct__ArgsCodec: thrift.IStructCodec = { encode(args: IGetStruct__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { key: args.key }; output.writeStructBegin("GetStruct__Args"); @@ -117,7 +117,7 @@ export interface IGetStruct__ResultArgs { } export const GetStruct__ResultCodec: thrift.IStructCodec = { encode(args: IGetStruct__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("GetStruct__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/generated/SharedStruct.ts b/src/tests/unit/fixtures/thrift-server/generated/SharedStruct.ts index 05e2f010..c0f539f9 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/SharedStruct.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/SharedStruct.ts @@ -17,7 +17,7 @@ export interface ISharedStructArgs { } export const SharedStructCodec: thrift.IStructCodec = { encode(args: ISharedStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { code: args.code, value: args.value }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/SharedUnion.ts b/src/tests/unit/fixtures/thrift-server/generated/SharedUnion.ts index b0796642..229adf66 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/SharedUnion.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/SharedUnion.ts @@ -17,7 +17,7 @@ export interface ISharedUnionArgs { export const SharedUnionCodec: thrift.IStructCodec = { encode(args: ISharedUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: args.option1, option2: args.option2 }; 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 ee893abb..138828e7 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 @@ -174,7 +174,7 @@ export interface IAdd__ArgsArgs { } export const Add__ArgsCodec: thrift.IStructCodec = { encode(args: IAdd__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: args.num1, num2: args.num2 }; @@ -291,7 +291,7 @@ export interface IAddInt64__ArgsArgs { } export const AddInt64__ArgsCodec: thrift.IStructCodec = { encode(args: IAddInt64__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: (typeof args.num1 === "number" ? new thrift.Int64(args.num1) : typeof args.num1 === "string" ? thrift.Int64.fromDecimalString(args.num1) : args.num1), num2: (typeof args.num2 === "number" ? new thrift.Int64(args.num2) : typeof args.num2 === "string" ? thrift.Int64.fromDecimalString(args.num2) : args.num2) }; @@ -408,7 +408,7 @@ export interface IAddWithContext__ArgsArgs { } export const AddWithContext__ArgsCodec: thrift.IStructCodec = { encode(args: IAddWithContext__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: args.num1, num2: args.num2 }; @@ -525,7 +525,7 @@ export interface ICalculate__ArgsArgs { } export const Calculate__ArgsCodec: thrift.IStructCodec = { encode(args: ICalculate__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { logid: args.logid, work: args.work }; @@ -640,7 +640,7 @@ export interface IEchoBinary__ArgsArgs { } export const EchoBinary__ArgsCodec: thrift.IStructCodec = { encode(args: IEchoBinary__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { word: (typeof args.word === "string" ? Buffer.from(args.word) : args.word) }; output.writeStructBegin("EchoBinary__Args"); @@ -728,7 +728,7 @@ export interface IEchoString__ArgsArgs { } export const EchoString__ArgsCodec: thrift.IStructCodec = { encode(args: IEchoString__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { word: args.word }; output.writeStructBegin("EchoString__Args"); @@ -816,7 +816,7 @@ export interface ICheckName__ArgsArgs { } export const CheckName__ArgsCodec: thrift.IStructCodec = { encode(args: ICheckName__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { choice: args.choice }; output.writeStructBegin("CheckName__Args"); @@ -904,7 +904,7 @@ export interface ICheckOptional__ArgsArgs { } export const CheckOptional__ArgsCodec: thrift.IStructCodec = { encode(args: ICheckOptional__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { type: args.type }; output.writeStructBegin("CheckOptional__Args"); @@ -981,7 +981,7 @@ export interface IMapOneList__ArgsArgs { } export const MapOneList__ArgsCodec: thrift.IStructCodec = { encode(args: IMapOneList__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg: args.arg }; output.writeStructBegin("MapOneList__Args"); @@ -1084,7 +1084,7 @@ export interface IMapValues__ArgsArgs { } export const MapValues__ArgsCodec: thrift.IStructCodec = { encode(args: IMapValues__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg: args.arg }; output.writeStructBegin("MapValues__Args"); @@ -1190,7 +1190,7 @@ export interface IListToMap__ArgsArgs { } export const ListToMap__ArgsCodec: thrift.IStructCodec = { encode(args: IListToMap__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { arg: args.arg }; output.writeStructBegin("ListToMap__Args"); @@ -1531,7 +1531,7 @@ export interface IAdd__ResultArgs { } export const Add__ResultCodec: thrift.IStructCodec = { encode(args: IAdd__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success, exp: args.exp }; @@ -1631,7 +1631,7 @@ export interface IAddInt64__ResultArgs { } export const AddInt64__ResultCodec: thrift.IStructCodec = { encode(args: IAddInt64__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: (typeof args.success === "number" ? new thrift.Int64(args.success) : typeof args.success === "string" ? thrift.Int64.fromDecimalString(args.success) : args.success), exp: args.exp }; @@ -1729,7 +1729,7 @@ export interface IAddWithContext__ResultArgs { } export const AddWithContext__ResultCodec: thrift.IStructCodec = { encode(args: IAddWithContext__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("AddWithContext__Result"); @@ -1808,7 +1808,7 @@ export interface ICalculate__ResultArgs { } export const Calculate__ResultCodec: thrift.IStructCodec = { encode(args: ICalculate__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success, ouch: args.ouch }; @@ -1906,7 +1906,7 @@ export interface IEchoBinary__ResultArgs { } export const EchoBinary__ResultCodec: thrift.IStructCodec = { encode(args: IEchoBinary__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("EchoBinary__Result"); @@ -1983,7 +1983,7 @@ export interface IEchoString__ResultArgs { } export const EchoString__ResultCodec: thrift.IStructCodec = { encode(args: IEchoString__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("EchoString__Result"); @@ -2060,7 +2060,7 @@ export interface ICheckName__ResultArgs { } export const CheckName__ResultCodec: thrift.IStructCodec = { encode(args: ICheckName__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("CheckName__Result"); @@ -2137,7 +2137,7 @@ export interface ICheckOptional__ResultArgs { } export const CheckOptional__ResultCodec: thrift.IStructCodec = { encode(args: ICheckOptional__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("CheckOptional__Result"); @@ -2214,7 +2214,7 @@ export interface IMapOneList__ResultArgs { } export const MapOneList__ResultCodec: thrift.IStructCodec = { encode(args: IMapOneList__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("MapOneList__Result"); @@ -2306,7 +2306,7 @@ export interface IMapValues__ResultArgs { } export const MapValues__ResultCodec: thrift.IStructCodec = { encode(args: IMapValues__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("MapValues__Result"); @@ -2398,7 +2398,7 @@ export interface IListToMap__ResultArgs { } export const ListToMap__ResultCodec: thrift.IStructCodec = { encode(args: IListToMap__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("ListToMap__Result"); @@ -2493,7 +2493,7 @@ export interface IFetchThing__ResultArgs { } export const FetchThing__ResultCodec: thrift.IStructCodec = { encode(args: IFetchThing__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("FetchThing__Result"); @@ -2570,7 +2570,7 @@ export interface IFetchMap__ResultArgs { } export const FetchMap__ResultCodec: thrift.IStructCodec = { encode(args: IFetchMap__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("FetchMap__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Choice.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Choice.ts index 85adfd29..2357adf8 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Choice.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Choice.ts @@ -19,7 +19,7 @@ export interface IChoiceArgs { export const ChoiceCodec: thrift.IStructCodec = { encode(args: IChoiceArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { firstName: args.firstName, lastName: args.lastName }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/FirstName.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/FirstName.ts index e9614605..b3c9eb02 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/FirstName.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/FirstName.ts @@ -14,7 +14,7 @@ export interface IFirstNameArgs { } export const FirstNameCodec: thrift.IStructCodec = { encode(args: IFirstNameArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("FirstName"); diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/LastName.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/LastName.ts index e023897c..24accb4d 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/LastName.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/LastName.ts @@ -14,7 +14,7 @@ export interface ILastNameArgs { } export const LastNameCodec: thrift.IStructCodec = { encode(args: ILastNameArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("LastName"); diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/NotAGoodIdea.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/NotAGoodIdea.ts index 822ad78f..bf3c20dd 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/NotAGoodIdea.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/NotAGoodIdea.ts @@ -18,7 +18,7 @@ export interface INotAGoodIdeaArgs { } export const NotAGoodIdeaCodec: thrift.IStructCodec = { encode(args: INotAGoodIdeaArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, data: args.data }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Work.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Work.ts index 5370f5f1..727cf11d 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Work.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/calculator/Work.ts @@ -21,7 +21,7 @@ export interface IWorkArgs { } export const WorkCodec: thrift.IStructCodec = { encode(args: IWorkArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { num1: (args.num1 != null ? args.num1 : 0), num2: args.num2, op: (args.op != null ? args.op : Operation.Operation.ADD), diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/common/AuthException.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/common/AuthException.ts index 715b357d..eacfa3c8 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/common/AuthException.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/common/AuthException.ts @@ -16,7 +16,7 @@ export interface IAuthExceptionArgs { } export const AuthExceptionCodec: thrift.IStructCodec = { encode(args: IAuthExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { code: args.code, message: args.message }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/common/OtherCommonUnion.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/common/OtherCommonUnion.ts index 56f9dc2e..3465283b 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/common/OtherCommonUnion.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/common/OtherCommonUnion.ts @@ -17,7 +17,7 @@ export interface IOtherCommonUnionArgs { export const OtherCommonUnionCodec: thrift.IStructCodec = { encode(args: IOtherCommonUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: args.option1, option2: args.option2 }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidOperation.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidOperation.ts index 2cdfcc6b..1c761bb6 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidOperation.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidOperation.ts @@ -16,7 +16,7 @@ export interface IInvalidOperationArgs { } export const InvalidOperationCodec: thrift.IStructCodec = { encode(args: IInvalidOperationArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { whatOp: args.whatOp, why: args.why }; diff --git a/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidResult.ts b/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidResult.ts index 399f58b6..3e96aeb1 100644 --- a/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidResult.ts +++ b/src/tests/unit/fixtures/thrift-server/generated/com/test/exceptions/InvalidResult.ts @@ -17,7 +17,7 @@ export interface IInvalidResultArgs { } export const InvalidResultCodec: thrift.IStructCodec = { encode(args: IInvalidResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, code: args.code }; 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 901992e8..27d28d5e 100644 --- a/src/tests/unit/fixtures/thrift-server/i64_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/i64_service.solution.ts @@ -7,7 +7,7 @@ export interface ICodeArgs { } export const CodeCodec: thrift.IStructCodec = { encode(args: ICodeArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { status: (typeof args.status === "number" ? new thrift.Int64(args.status) : typeof args.status === "string" ? thrift.Int64.fromDecimalString(args.status) : args.status) }; output.writeStructBegin("Code"); @@ -103,7 +103,7 @@ export interface IPeg__ArgsArgs { } export const Peg__ArgsCodec: thrift.IStructCodec = { encode(args: IPeg__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("Peg__Args"); @@ -191,7 +191,7 @@ export interface IPong__ArgsArgs { } export const Pong__ArgsCodec: thrift.IStructCodec = { encode(args: IPong__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { code: args.code }; output.writeStructBegin("Pong__Args"); @@ -268,7 +268,7 @@ export interface IPeg__ResultArgs { } export const Peg__ResultCodec: thrift.IStructCodec = { encode(args: IPeg__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("Peg__Result"); @@ -345,7 +345,7 @@ export interface IPong__ResultArgs { } export const Pong__ResultCodec: thrift.IStructCodec = { encode(args: IPong__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: (typeof args.success === "number" ? new thrift.Int64(args.success) : typeof args.success === "string" ? thrift.Int64.fromDecimalString(args.success) : args.success) }; output.writeStructBegin("Pong__Result"); diff --git a/src/tests/unit/fixtures/thrift-server/initialized_union.solution.ts b/src/tests/unit/fixtures/thrift-server/initialized_union.solution.ts index 237eef5e..f010329c 100644 --- a/src/tests/unit/fixtures/thrift-server/initialized_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/initialized_union.solution.ts @@ -9,7 +9,7 @@ export interface IMyUnionArgs { export const MyUnionCodec: thrift.IStructCodec = { encode(args: IMyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: args.option1, option2: (typeof args.option2 === "number" ? new thrift.Int64(args.option2) : typeof args.option2 === "string" ? thrift.Int64.fromDecimalString(args.option2) : args.option2) }; diff --git a/src/tests/unit/fixtures/thrift-server/initialized_union.strict_union.solution.ts b/src/tests/unit/fixtures/thrift-server/initialized_union.strict_union.solution.ts index 0b3a0e84..65ab4fdf 100644 --- a/src/tests/unit/fixtures/thrift-server/initialized_union.strict_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/initialized_union.strict_union.solution.ts @@ -66,7 +66,7 @@ export const MyUnionCodec: thrift.IStructToolkit = { }, encode(args: MyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { field1: args.field1, field2: (typeof args.field2 === "number" ? new thrift.Int64(args.field2) : typeof args.field2 === "string" ? thrift.Int64.fromDecimalString(args.field2) : args.field2) }; diff --git a/src/tests/unit/fixtures/thrift-server/multi_field_struct.solution.ts b/src/tests/unit/fixtures/thrift-server/multi_field_struct.solution.ts index f279c3ac..80a8011b 100644 --- a/src/tests/unit/fixtures/thrift-server/multi_field_struct.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/multi_field_struct.solution.ts @@ -15,7 +15,7 @@ export interface IMyStructArgs { } export const MyStructCodec: thrift.IStructCodec = { encode(args: IMyStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: (args.id != null ? args.id : 45), bigID: (args.bigID != null ? (typeof args.bigID === "number" ? new thrift.Int64(args.bigID) : typeof args.bigID === "string" ? thrift.Int64.fromDecimalString(args.bigID) : args.bigID) : thrift.Int64.fromDecimalString("23948234")), word: args.word, diff --git a/src/tests/unit/fixtures/thrift-server/nested_exception.solution.ts b/src/tests/unit/fixtures/thrift-server/nested_exception.solution.ts index 3db8ffa8..4967893d 100644 --- a/src/tests/unit/fixtures/thrift-server/nested_exception.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/nested_exception.solution.ts @@ -9,7 +9,7 @@ export interface ICodeArgs { } export const CodeCodec: thrift.IStructCodec = { encode(args: ICodeArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { status: (args.status != null ? (typeof args.status === "number" ? new thrift.Int64(args.status) : typeof args.status === "string" ? thrift.Int64.fromDecimalString(args.status) : args.status) : thrift.Int64.fromDecimalString("200")), data: (args.data != null ? (typeof args.data === "string" ? Buffer.from(args.data) : args.data) : Buffer.from("data")) }; @@ -109,7 +109,7 @@ export interface IMyExceptionArgs { } export const MyExceptionCodec: thrift.IStructCodec = { encode(args: IMyExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { description: args.description, code: args.code }; diff --git a/src/tests/unit/fixtures/thrift-server/nested_struct.solution.ts b/src/tests/unit/fixtures/thrift-server/nested_struct.solution.ts index 0fa076c9..30411710 100644 --- a/src/tests/unit/fixtures/thrift-server/nested_struct.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/nested_struct.solution.ts @@ -9,7 +9,7 @@ export interface IUserArgs { } export const UserCodec: thrift.IStructCodec = { encode(args: IUserArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name, age: (args.age != null ? (typeof args.age === "number" ? new thrift.Int64(args.age) : typeof args.age === "string" ? thrift.Int64.fromDecimalString(args.age) : args.age) : thrift.Int64.fromDecimalString("45")) }; @@ -120,7 +120,7 @@ export interface IMyStructArgs { } export const MyStructCodec: thrift.IStructCodec = { encode(args: IMyStructArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name, user: args.user }; diff --git a/src/tests/unit/fixtures/thrift-server/nested_union.solution.ts b/src/tests/unit/fixtures/thrift-server/nested_union.solution.ts index 51463039..58675d17 100644 --- a/src/tests/unit/fixtures/thrift-server/nested_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/nested_union.solution.ts @@ -10,7 +10,7 @@ export interface IOptionArgs { export const OptionCodec: thrift.IStructCodec = { encode(args: IOptionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { option1: (typeof args.option1 === "string" ? Buffer.from(args.option1) : args.option1), option2: (typeof args.option2 === "number" ? new thrift.Int64(args.option2) : typeof args.option2 === "string" ? thrift.Int64.fromDecimalString(args.option2) : args.option2) }; @@ -149,7 +149,7 @@ export interface IMyUnionArgs { export const MyUnionCodec: thrift.IStructCodec = { encode(args: IMyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { name: args.name, option: args.option }; diff --git a/src/tests/unit/fixtures/thrift-server/nested_union.strict_union.solution.ts b/src/tests/unit/fixtures/thrift-server/nested_union.strict_union.solution.ts index 4c65d2ce..46cb9158 100644 --- a/src/tests/unit/fixtures/thrift-server/nested_union.strict_union.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/nested_union.strict_union.solution.ts @@ -66,7 +66,7 @@ export const InnerUnionCodec: thrift.IStructToolkit }, encode(args: InnerUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { name: args.name, id: args.id }; @@ -227,7 +227,7 @@ export const MyUnionCodec: thrift.IStructToolkit = { }, encode(args: MyUnionArgs, output: thrift.TProtocol): void { let _fieldsSet: number = 0; - const obj = { + const obj: any = { user: args.user, field2: args.field2 }; diff --git a/src/tests/unit/fixtures/thrift-server/required_field_exception.solution.ts b/src/tests/unit/fixtures/thrift-server/required_field_exception.solution.ts index 257e618e..0e2fa7e2 100644 --- a/src/tests/unit/fixtures/thrift-server/required_field_exception.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/required_field_exception.solution.ts @@ -9,7 +9,7 @@ export interface IMyExceptionArgs { } export const MyExceptionCodec: thrift.IStructCodec = { encode(args: IMyExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { description: args.description, code: args.code }; 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 3e8c6279..d8a8e9f1 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 @@ -22,7 +22,7 @@ export interface IPing__ArgsArgs { } export const Ping__ArgsCodec: thrift.IStructCodec = { encode(args: IPing__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { id: (typeof args.id === "number" ? new thrift.Int64(args.id) : typeof args.id === "string" ? thrift.Int64.fromDecimalString(args.id) : args.id) }; output.writeStructBegin("Ping__Args"); 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 ed31e26d..2afb8254 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 @@ -7,7 +7,7 @@ export interface IServiceExceptionArgs { } export const ServiceExceptionCodec: thrift.IStructCodec = { encode(args: IServiceExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message }; output.writeStructBegin("ServiceException"); @@ -86,7 +86,7 @@ export interface IAuthExceptionArgs { } export const AuthExceptionCodec: thrift.IStructCodec = { encode(args: IAuthExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message, code: args.code }; @@ -184,7 +184,7 @@ export interface IUnknownExceptionArgs { } export const UnknownExceptionCodec: thrift.IStructCodec = { encode(args: IUnknownExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message }; output.writeStructBegin("UnknownException"); @@ -275,7 +275,7 @@ export interface IPeg__ArgsArgs { } export const Peg__ArgsCodec: thrift.IStructCodec = { encode(args: IPeg__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("Peg__Args"); @@ -369,7 +369,7 @@ export interface IPeg__ResultArgs { } export const Peg__ResultCodec: thrift.IStructCodec = { encode(args: IPeg__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success, exp: args.exp, authExp: args.authExp, 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 35ed3b42..eac00de7 100644 --- a/src/tests/unit/fixtures/thrift-server/throws_service.solution.ts +++ b/src/tests/unit/fixtures/thrift-server/throws_service.solution.ts @@ -7,7 +7,7 @@ export interface IServiceExceptionArgs { } export const ServiceExceptionCodec: thrift.IStructCodec = { encode(args: IServiceExceptionArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { message: args.message }; output.writeStructBegin("ServiceException"); @@ -103,7 +103,7 @@ export interface IPeg__ArgsArgs { } export const Peg__ArgsCodec: thrift.IStructCodec = { encode(args: IPeg__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("Peg__Args"); @@ -191,7 +191,7 @@ export interface IPong__ArgsArgs { } export const Pong__ArgsCodec: thrift.IStructCodec = { encode(args: IPong__ArgsArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { name: args.name }; output.writeStructBegin("Pong__Args"); @@ -270,7 +270,7 @@ export interface IPeg__ResultArgs { } export const Peg__ResultCodec: thrift.IStructCodec = { encode(args: IPeg__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success, exp: args.exp }; @@ -368,7 +368,7 @@ export interface IPong__ResultArgs { } export const Pong__ResultCodec: thrift.IStructCodec = { encode(args: IPong__ResultArgs, output: thrift.TProtocol): void { - const obj = { + const obj: any = { success: args.success }; output.writeStructBegin("Pong__Result");