diff --git a/package-lock.json b/package-lock.json index 924494c6..0fb26984 100644 --- a/package-lock.json +++ b/package-lock.json @@ -840,9 +840,9 @@ } }, "@nodelib/fs.stat": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz", - "integrity": "sha512-KU/VDjC5RwtDUZiz3d+DHXJF2lp5hB9dn552TXIyptj8SH1vXmR40mG0JgGq03IlYsOgGfcv8xrLpSQ0YUMQdA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz", + "integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==", "dev": true }, "@types/code": { @@ -1252,9 +1252,9 @@ } }, "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", + "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", "dev": true }, "bossy": { @@ -1342,7 +1342,7 @@ "integrity": "sha512-IFWl6lfK6wSeYCHUXh+N1lY72UDrpyrYQJNIVQf48paDuWbv5RbAtJYf/4gUQFObTCHZwdZ5sI8Iw7nqwP6nlQ==", "dev": true, "requires": { - "bluebird": "3.5.1", + "bluebird": "3.5.2", "chownr": "1.0.1", "figgy-pudding": "3.5.1", "glob": "7.1.3", @@ -2225,7 +2225,7 @@ }, "eslint": { "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { @@ -2561,7 +2561,7 @@ "dev": true, "requires": { "@mrmlnc/readdir-enhanced": "2.2.1", - "@nodelib/fs.stat": "1.1.1", + "@nodelib/fs.stat": "1.1.2", "glob-parent": "3.1.0", "is-glob": "4.0.0", "merge2": "1.2.2", @@ -2897,7 +2897,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -3978,7 +3978,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -4067,7 +4067,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, @@ -4380,7 +4380,7 @@ "dev": true, "requires": { "JSONStream": "1.3.4", - "bluebird": "3.5.1", + "bluebird": "3.5.2", "figgy-pudding": "3.5.1", "lru-cache": "4.1.3", "make-fetch-happen": "4.0.1", @@ -4638,7 +4638,7 @@ "integrity": "sha512-AFXaSWhOtQf3jHqEvg+ZYH/dfT8TKq6TKspJ4qEFwVVuh5aGvMIk6SNF8vqfzz+cBceDIs9drOcpBbrPai7i+g==", "dev": true, "requires": { - "bluebird": "3.5.1", + "bluebird": "3.5.2", "cacache": "11.2.0", "figgy-pudding": "3.5.1", "get-stream": "3.0.0", @@ -5836,7 +5836,7 @@ "dependencies": { "minimist": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz", "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=", "dev": true } @@ -6361,7 +6361,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -6432,7 +6432,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { diff --git a/packages/thrift-client/package-lock.json b/packages/thrift-client/package-lock.json index 85078833..ddd046d9 100644 --- a/packages/thrift-client/package-lock.json +++ b/packages/thrift-client/package-lock.json @@ -4,6 +4,119 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@creditkarma/thrift-typescript": { + "version": "2.1.0-0", + "resolved": "https://registry.npmjs.org/@creditkarma/thrift-typescript/-/thrift-typescript-2.1.0-0.tgz", + "integrity": "sha512-elFJlga8vAQqbC1u8Jh3Mk2ZHwmDpyOKp3DTzuZ2oghqQH7wzd1pME/cli1TicXDMRBuOZKxJH+7wHVfDj2dcw==", + "dev": true, + "requires": { + "@creditkarma/thrift-parser": "1.1.4", + "glob": "7.1.3", + "typescript": "2.9.2" + }, + "dependencies": { + "@creditkarma/thrift-parser": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@creditkarma/thrift-parser/-/thrift-parser-1.1.4.tgz", + "integrity": "sha1-SSbZbEISrvjc5OrIc/arJ6pS9GQ=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "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" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "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=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "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=", + "dev": true + }, + "typescript": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", + "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } + }, "@types/express": { "version": "4.16.0", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz", @@ -529,7 +642,7 @@ }, "eslint": { "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { @@ -1097,7 +1210,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, diff --git a/packages/thrift-client/package.json b/packages/thrift-client/package.json index 25c7b524..d8c9b72f 100644 --- a/packages/thrift-client/package.json +++ b/packages/thrift-client/package.json @@ -55,7 +55,7 @@ "@creditkarma/thrift-server-core": "^0.8.2", "@creditkarma/thrift-server-express": "^0.8.2", "@creditkarma/thrift-server-hapi": "^0.8.2", - "@creditkarma/thrift-typescript": "^2.0.0", + "@creditkarma/thrift-typescript": "^2.1.0-0", "@types/body-parser": "^1.16.5", "@types/code": "^4.0.3", "@types/express": "^4.0.37", diff --git a/packages/thrift-client/src/ttwitter/com/creditkarma/finagle/thrift/index.ts b/packages/thrift-client/src/ttwitter/com/creditkarma/finagle/thrift/index.ts index c0f4cc22..7085d9b5 100644 --- a/packages/thrift-client/src/ttwitter/com/creditkarma/finagle/thrift/index.ts +++ b/packages/thrift-client/src/ttwitter/com/creditkarma/finagle/thrift/index.ts @@ -1,6 +1,6 @@ /* tslint:disable */ /* - * Autogenerated by @creditkarma/thrift-typescript v2.0.7 + * Autogenerated by @creditkarma/thrift-typescript v2.1.0-0 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ import * as thrift from "@creditkarma/thrift-server-core"; @@ -118,6 +118,8 @@ export class Endpoint extends thrift.StructLike implements IEndpoint { public ipv4?: number; public port?: number; public service_name?: string; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IEndpointArgs = {}) { super(); if (args.ipv4 != null) { @@ -236,6 +238,8 @@ export class Annotation extends thrift.StructLike implements IAnnotation { public timestamp?: thrift.Int64; public value?: string; public host?: IEndpoint; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IAnnotationArgs = {}) { super(); if (args.timestamp != null) { @@ -373,6 +377,8 @@ export class BinaryAnnotation extends thrift.StructLike implements IBinaryAnnota public value?: Buffer; public annotation_type?: AnnotationType; public host?: IEndpoint; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IBinaryAnnotationArgs = {}) { super(); if (args.key != null) { @@ -593,6 +599,8 @@ export class Span extends thrift.StructLike implements ISpan { public annotations?: Array; public binary_annotations?: Array; public debug?: boolean; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: ISpanArgs = {}) { super(); if (args.trace_id != null) { @@ -697,6 +705,8 @@ export const ClientIdCodec: thrift.IStructCodec = { }; export class ClientId extends thrift.StructLike implements IClientId { public name?: string; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IClientIdArgs = {}) { super(); if (args.name != null) { @@ -788,6 +798,8 @@ export const RequestContextCodec: thrift.IStructCodec export class Delegation extends thrift.StructLike implements IDelegation { public src?: string; public dst?: string; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IDelegationArgs = {}) { super(); if (args.src != null) { @@ -1133,6 +1147,8 @@ export class RequestHeader extends thrift.StructLike implements IRequestHeader { public contexts?: Array; public dest?: string; public delegations?: Array; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IRequestHeaderArgs = {}) { super(); if (args.trace_id != null) { @@ -1286,6 +1302,8 @@ export const ResponseHeaderCodec: thrift.IStructCodec; public contexts?: Array; + public readonly _annotations: thrift.IThriftAnnotations = {}; + public readonly _fieldAnnotations: thrift.IFieldAnnotations = {}; constructor(args: IResponseHeaderArgs = {}) { super(); if (args.spans != null) { @@ -1347,6 +1365,8 @@ export const ConnectionOptionsCodec: thrift.IStructCodec implements IThriftConnect public abstract send(dataToSend: Buffer, context?: Context): Promise } -export abstract class StructLike { +export interface IThriftAnnotations { + [name: string]: string +} + +export interface IFieldAnnotations { + [fieldName: string]: IThriftAnnotations +} + +export interface IMethodAnnotations { + [methodName: string]: { + annotations: IThriftAnnotations + fieldAnnotations: IFieldAnnotations, + } +} + +export interface IStructLike { + readonly _annotations: IThriftAnnotations + readonly _fieldAnnotations: IFieldAnnotations + write(output: TProtocol): void +} + +export abstract class StructLike implements IStructLike { + public readonly _annotations: IThriftAnnotations = {} + public readonly _fieldAnnotations: IFieldAnnotations = {} public abstract write(output: TProtocol): void } @@ -74,16 +97,21 @@ export interface ITransportConstructor { } export abstract class ThriftClient { + public readonly _annotations: IThriftAnnotations = {} + public readonly _fieldAnnotatons: IFieldAnnotations = {} + protected _requestId: number protected transport: ITransportConstructor protected protocol: IProtocolConstructor protected connection: IThriftConnection + constructor(connection: IThriftConnection) { this._requestId = 0 this.transport = connection.Transport this.protocol = connection.Protocol this.connection = connection } + protected incrementRequestId(): number { return this._requestId += 1 } @@ -94,9 +122,18 @@ export interface IClientConstructor { } export interface IThriftProcessor { + readonly _annotations: IThriftAnnotations + readonly _methodAnnotations: IMethodAnnotations process(input: TProtocol, output: TProtocol, context?: Context): Promise } +export abstract class ThriftProcessor implements IThriftProcessor { + public readonly _annotations: IThriftAnnotations = {} + public readonly _methodAnnotations: IMethodAnnotations = {} + + public abstract process(input: TProtocol, output: TProtocol, context?: Context): Promise +} + export interface IProcessorConstructor { new(handler: THandler): TProcessor } diff --git a/packages/thrift-server-express/package-lock.json b/packages/thrift-server-express/package-lock.json index 23d51caf..2ba752ba 100644 --- a/packages/thrift-server-express/package-lock.json +++ b/packages/thrift-server-express/package-lock.json @@ -875,7 +875,7 @@ }, "eslint": { "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { @@ -1443,7 +1443,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, diff --git a/packages/thrift-server-hapi/package-lock.json b/packages/thrift-server-hapi/package-lock.json index d29bc27c..95bc5a28 100644 --- a/packages/thrift-server-hapi/package-lock.json +++ b/packages/thrift-server-hapi/package-lock.json @@ -458,7 +458,7 @@ }, "eslint": { "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { @@ -1026,7 +1026,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, diff --git a/packages/thrift-server-hapi/src/main/observability/ZipkinTracingHapi.ts b/packages/thrift-server-hapi/src/main/observability/ZipkinTracingHapi.ts index ab838856..a7cc63ba 100644 --- a/packages/thrift-server-hapi/src/main/observability/ZipkinTracingHapi.ts +++ b/packages/thrift-server-hapi/src/main/observability/ZipkinTracingHapi.ts @@ -54,7 +54,7 @@ export function ZipkinTracingHapi({ const requestMethod: string = readThriftMethod( request.payload, getTransport(transport), - getProtocol(protocol) + getProtocol(protocol), ) const normalHeaders = normalizeHeaders(request.headers)