@creditkarma/thrift-server-core
Advanced tools
Comparing version 0.17.2 to 0.18.0-alpha.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const noAssert = true; | ||
exports.writeDoubleLE = exports.readDoubleLE = exports.writeDouble = exports.writeI32 = exports.writeI16 = exports.readDouble = exports.readI32 = exports.readI16 = exports.readByte = void 0; | ||
function readByte(byte) { | ||
@@ -9,15 +9,15 @@ return byte > 127 ? byte - 256 : byte; | ||
function readI16(bytes, offset = 0) { | ||
return bytes.readInt16BE(offset, noAssert); | ||
return bytes.readInt16BE(offset); | ||
} | ||
exports.readI16 = readI16; | ||
function readI32(bytes, offset = 0) { | ||
return bytes.readInt32BE(offset, noAssert); | ||
return bytes.readInt32BE(offset); | ||
} | ||
exports.readI32 = readI32; | ||
function readDouble(bytes, offset = 0) { | ||
return bytes.readDoubleBE(offset, noAssert); | ||
return bytes.readDoubleBE(offset); | ||
} | ||
exports.readDouble = readDouble; | ||
function writeI16(bytes, i16) { | ||
bytes.writeInt16BE(i16, 0, noAssert); | ||
bytes.writeInt16BE(i16, 0); | ||
return bytes; | ||
@@ -27,3 +27,3 @@ } | ||
function writeI32(bytes, i32) { | ||
bytes.writeInt32BE(i32, 0, noAssert); | ||
bytes.writeInt32BE(i32, 0); | ||
return bytes; | ||
@@ -33,3 +33,3 @@ } | ||
function writeDouble(bytes, dub) { | ||
bytes.writeDoubleBE(dub, 0, noAssert); | ||
bytes.writeDoubleBE(dub, 0); | ||
return bytes; | ||
@@ -39,7 +39,7 @@ } | ||
function readDoubleLE(bytes, offset = 0) { | ||
return bytes.readDoubleLE(offset, noAssert); | ||
return bytes.readDoubleLE(offset); | ||
} | ||
exports.readDoubleLE = readDoubleLE; | ||
function writeDoubleLE(bytes, dub) { | ||
bytes.writeDoubleLE(dub, 0, noAssert); | ||
bytes.writeDoubleLE(dub, 0); | ||
return bytes; | ||
@@ -46,0 +46,0 @@ } |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./InputBufferUnderrunError")); | ||
__export(require("./TApplicationException")); | ||
__export(require("./TProtocolException")); | ||
__exportStar(require("./InputBufferUnderrunError"), exports); | ||
__exportStar(require("./TApplicationException"), exports); | ||
__exportStar(require("./TProtocolException"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputBufferUnderrunError = void 0; | ||
class InputBufferUnderrunError extends Error { | ||
@@ -4,0 +5,0 @@ constructor(message) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TApplicationExceptionCodec = exports.TApplicationException = exports.TApplicationExceptionType = void 0; | ||
const types_1 = require("../types"); | ||
@@ -4,0 +5,0 @@ var TApplicationExceptionType; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TProtocolException = exports.TProtocolExceptionType = void 0; | ||
var TProtocolExceptionType; | ||
@@ -4,0 +5,0 @@ (function (TProtocolExceptionType) { |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.process = exports.makeLogger = void 0; | ||
const errors_1 = require("./errors"); | ||
__export(require("./types")); | ||
__export(require("./Int64")); | ||
__export(require("./protocols")); | ||
__export(require("./transports")); | ||
__export(require("./errors")); | ||
__export(require("./utils")); | ||
__export(require("./binary")); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./Int64"), exports); | ||
__exportStar(require("./protocols"), exports); | ||
__exportStar(require("./transports"), exports); | ||
__exportStar(require("./errors"), exports); | ||
__exportStar(require("./utils"), exports); | ||
__exportStar(require("./binary"), exports); | ||
var logger_1 = require("./logger"); | ||
exports.makeLogger = logger_1.makeLogger; | ||
Object.defineProperty(exports, "makeLogger", { enumerable: true, get: function () { return logger_1.makeLogger; } }); | ||
function process(args) { | ||
@@ -17,0 +29,0 @@ const transportWithData = args.Transport.receiver(args.buffer); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isInt64 = exports.Int64 = void 0; | ||
const POW2_31 = Math.pow(2, 31); | ||
@@ -246,5 +247,5 @@ const POW2_32 = Math.pow(2, 32); | ||
} | ||
exports.Int64 = Int64; | ||
Int64.MAX_INT = Math.pow(2, 53); | ||
Int64.MIN_INT = -Math.pow(2, 53); | ||
exports.Int64 = Int64; | ||
function isInt64(i64) { | ||
@@ -251,0 +252,0 @@ return (i64 instanceof Int64 || |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.makeLogger = (name) => { | ||
exports.defaultLogger = exports.makeLogger = void 0; | ||
const makeLogger = (name) => { | ||
return (tags, data) => { | ||
@@ -40,3 +41,4 @@ const allTags = Array.from(new Set([name, ...tags])); | ||
}; | ||
exports.defaultLogger = exports.makeLogger('thrift-server-core'); | ||
exports.makeLogger = makeLogger; | ||
exports.defaultLogger = (0, exports.makeLogger)('thrift-server-core'); | ||
//# sourceMappingURL=logger.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseJson = void 0; | ||
const Int64_1 = require("./Int64"); | ||
@@ -4,0 +5,0 @@ class JsonParser { |
@@ -26,3 +26,3 @@ /// <reference types="node" /> | ||
writeDouble(dub: number): void; | ||
writeStringOrBinary(name: string, encoding: string, data: string | Buffer): void; | ||
writeStringOrBinary(name: string, encoding: BufferEncoding, data: string | Buffer): void; | ||
writeString(data: string): void; | ||
@@ -29,0 +29,0 @@ writeBinary(data: string | Buffer): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BinaryProtocol = void 0; | ||
const binary = require("../binary"); | ||
@@ -102,3 +103,3 @@ const errors_1 = require("../errors"); | ||
} | ||
if (types_1.isInt64(i64)) { | ||
if ((0, types_1.isInt64)(i64)) { | ||
this.transport.write(i64.buffer); | ||
@@ -105,0 +106,0 @@ } |
@@ -47,3 +47,3 @@ /// <reference types="node" /> | ||
writeDouble(dub: number): void; | ||
writeStringOrBinary(name: string, encoding: string, data: string | Buffer): void; | ||
writeStringOrBinary(name: string, encoding: BufferEncoding, data: string | Buffer): void; | ||
writeString(data: string): void; | ||
@@ -50,0 +50,0 @@ writeBinary(data: string | Buffer): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CompactProtocol = exports.CompactType = void 0; | ||
const errors_1 = require("../errors"); | ||
@@ -180,3 +181,3 @@ const binary_1 = require("../binary"); | ||
const buff = Buffer.alloc(8); | ||
this.transport.write(binary_1.writeDoubleLE(buff, dub)); | ||
this.transport.write((0, binary_1.writeDoubleLE)(buff, dub)); | ||
} | ||
@@ -329,3 +330,3 @@ writeStringOrBinary(name, encoding, data) { | ||
const buff = this.transport.read(8); | ||
return binary_1.readDoubleLE(buff); | ||
return (0, binary_1.readDoubleLE)(buff); | ||
} | ||
@@ -426,5 +427,5 @@ readBinary() { | ||
zigzagToI64(i64) { | ||
let hi = i64.buffer.readUInt32BE(0, true); | ||
let lo = i64.buffer.readUInt32BE(4, true); | ||
const lowBit = i64.buffer.readUInt8(7, true) & 0x01; | ||
let hi = i64.buffer.readUInt32BE(0); | ||
let lo = i64.buffer.readUInt32BE(4); | ||
const lowBit = i64.buffer.readUInt8(7) & 0x01; | ||
const mask = lowBit ? 0xffffffff : 0; | ||
@@ -514,4 +515,4 @@ const hiLo = hi << 31; | ||
let wsize = 0; | ||
let hi = i64.buffer.readUInt32BE(0, true); | ||
let lo = i64.buffer.readUInt32BE(4, true); | ||
let hi = i64.buffer.readUInt32BE(0); | ||
let lo = i64.buffer.readUInt32BE(4); | ||
let mask = 0; | ||
@@ -543,8 +544,8 @@ while (true) { | ||
} | ||
if (!types_1.isInt64(i64)) { | ||
if (!(0, types_1.isInt64)(i64)) { | ||
throw new errors_1.TProtocolException(errors_1.TProtocolExceptionType.INVALID_DATA, `Expected Int64, number, or decimal string but found type ${typeof i64}`); | ||
} | ||
else { | ||
let hi = i64.buffer.readUInt32BE(0, true); | ||
let lo = i64.buffer.readUInt32BE(4, true); | ||
let hi = i64.buffer.readUInt32BE(0); | ||
let lo = i64.buffer.readUInt32BE(4); | ||
const sign = hi >>> 31; | ||
@@ -551,0 +552,0 @@ hi = ((hi << 1) | (lo >>> 31)) ^ (!!sign ? 0xffffffff : 0); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getProtocol = exports.isProtocolSupported = exports.supportedProtocols = void 0; | ||
const BinaryProtocol_1 = require("./BinaryProtocol"); | ||
const CompactProtocol_1 = require("./CompactProtocol"); | ||
const JSONProtocol_1 = require("./JSONProtocol"); | ||
__export(require("./BinaryProtocol")); | ||
__export(require("./CompactProtocol")); | ||
__export(require("./JSONProtocol")); | ||
__export(require("./TProtocol")); | ||
__exportStar(require("./BinaryProtocol"), exports); | ||
__exportStar(require("./CompactProtocol"), exports); | ||
__exportStar(require("./JSONProtocol"), exports); | ||
__exportStar(require("./TProtocol"), exports); | ||
const protocols = { | ||
@@ -14,0 +26,0 @@ binary: BinaryProtocol_1.BinaryProtocol, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JSONProtocol = void 0; | ||
const errors_1 = require("../errors"); | ||
@@ -159,3 +160,3 @@ const types_1 = require("../types"); | ||
} | ||
else if (types_1.isInt64(i64)) { | ||
else if ((0, types_1.isInt64)(i64)) { | ||
this.tstack.push(i64.toDecimalString()); | ||
@@ -225,3 +226,3 @@ } | ||
this.rpos = []; | ||
const robj = parseJson_1.parseJson(this.transport.readAll()); | ||
const robj = (0, parseJson_1.parseJson)(this.transport.readAll()); | ||
const version = robj.shift(); | ||
@@ -490,2 +491,3 @@ if (version !== JSONProtocol.version) { | ||
} | ||
exports.JSONProtocol = JSONProtocol; | ||
JSONProtocol.version = 1; | ||
@@ -505,3 +507,2 @@ JSONProtocol.rType = { | ||
}; | ||
exports.JSONProtocol = JSONProtocol; | ||
//# sourceMappingURL=JSONProtocol.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TProtocol = void 0; | ||
const logger_1 = require("../logger"); | ||
@@ -4,0 +5,0 @@ class TProtocol { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BufferedTransport = void 0; | ||
const binary = require("../binary"); | ||
@@ -8,7 +9,2 @@ const errors_1 = require("../errors"); | ||
class BufferedTransport extends TTransport_1.TTransport { | ||
static receiver(data) { | ||
const reader = new BufferedTransport(Buffer.alloc(data.length)); | ||
data.copy(reader.buffer, 0, 0); | ||
return reader; | ||
} | ||
constructor(buffer) { | ||
@@ -21,2 +17,7 @@ super(buffer || Buffer.alloc(DEFAULT_READ_BUFFER_SIDE)); | ||
} | ||
static receiver(data) { | ||
const reader = new BufferedTransport(Buffer.alloc(data.length)); | ||
data.copy(reader.buffer, 0, 0); | ||
return reader; | ||
} | ||
remaining() { | ||
@@ -23,0 +24,0 @@ const remainingSize = this.writeCursor - this.readCursor; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTransport = exports.isTransportSupported = exports.supportedTransports = void 0; | ||
const BufferedTransport_1 = require("./BufferedTransport"); | ||
__export(require("./BufferedTransport")); | ||
__export(require("./TTransport")); | ||
__export(require("./ThriftFrameCodec")); | ||
__exportStar(require("./BufferedTransport"), exports); | ||
__exportStar(require("./TTransport"), exports); | ||
__exportStar(require("./ThriftFrameCodec"), exports); | ||
const transports = { | ||
@@ -11,0 +23,0 @@ buffered: BufferedTransport_1.BufferedTransport, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ThriftFrameCodec = void 0; | ||
const binary = require("../binary"); | ||
@@ -4,0 +5,0 @@ const MAX_PACKETS = 10; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TTransport = void 0; | ||
class TTransport { | ||
static receiver(data) { | ||
throw new Error('Not implemented'); | ||
} | ||
constructor(buffer) { | ||
@@ -11,4 +9,7 @@ this.buffer = buffer; | ||
} | ||
static receiver(data) { | ||
throw new Error('Not implemented'); | ||
} | ||
} | ||
exports.TTransport = TTransport; | ||
//# sourceMappingURL=TTransport.js.map |
@@ -5,3 +5,3 @@ /// <reference types="node" /> | ||
export * from './Int64'; | ||
export declare type LogFunction = (tags: Array<string>, data?: string | object) => void; | ||
export declare type LogFunction = (tags: ReadonlyArray<string>, data?: string | object) => void; | ||
export interface IRequestHeaders { | ||
@@ -8,0 +8,0 @@ [name: string]: any; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./Int64")); | ||
exports.MessageType = exports.TType = exports.ThriftProcessor = exports.ThriftClient = exports.StructLike = exports.ThriftConnection = void 0; | ||
__exportStar(require("./Int64"), exports); | ||
class ThriftConnection { | ||
@@ -36,2 +48,3 @@ constructor(Transport, Protocol) { | ||
} | ||
exports.ThriftClient = ThriftClient; | ||
ThriftClient.serviceName = undefined; | ||
@@ -41,3 +54,2 @@ ThriftClient.annotations = {}; | ||
ThriftClient.methodNames = []; | ||
exports.ThriftClient = ThriftClient; | ||
class ThriftProcessor { | ||
@@ -51,2 +63,3 @@ constructor() { | ||
} | ||
exports.ThriftProcessor = ThriftProcessor; | ||
ThriftProcessor.serviceName = undefined; | ||
@@ -56,3 +69,2 @@ ThriftProcessor.annotations = {}; | ||
ThriftProcessor.methodNames = []; | ||
exports.ThriftProcessor = ThriftProcessor; | ||
var TType; | ||
@@ -59,0 +71,0 @@ (function (TType) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.appendThriftObject = exports.encode = void 0; | ||
const protocols_1 = require("../protocols"); | ||
@@ -16,4 +17,4 @@ const transports_1 = require("../transports"); | ||
function appendThriftObject(value, data, ThriftCodec, transportType = 'buffered', protocolType = 'binary') { | ||
const Transport = transports_1.getTransport(transportType); | ||
const Protocol = protocols_1.getProtocol(protocolType); | ||
const Transport = (0, transports_1.getTransport)(transportType); | ||
const Protocol = (0, protocols_1.getProtocol)(protocolType); | ||
return encode(value, ThriftCodec, Transport, Protocol).then((encoded) => { | ||
@@ -20,0 +21,0 @@ return Buffer.concat([encoded, data]); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatUrl = exports.overlayObjects = exports.deepMerge = void 0; | ||
const merge = require("lodash/merge"); | ||
const url = require("url"); | ||
__export(require("./appendThriftObject")); | ||
__export(require("./readThriftObject")); | ||
__export(require("./readThriftMetadata")); | ||
__export(require("./normalizePath")); | ||
__exportStar(require("./appendThriftObject"), exports); | ||
__exportStar(require("./readThriftObject"), exports); | ||
__exportStar(require("./readThriftMetadata"), exports); | ||
__exportStar(require("./normalizePath"), exports); | ||
function deepMerge(base, update) { | ||
@@ -13,0 +25,0 @@ return merge({}, base, update); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizePath = (path = '/') => { | ||
exports.normalizePath = void 0; | ||
const normalizePath = (path = '/') => { | ||
path = path.trim(); | ||
@@ -16,2 +17,3 @@ if (path === '/' || path === '') { | ||
}; | ||
exports.normalizePath = normalizePath; | ||
//# sourceMappingURL=normalizePath.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.readRequestId = exports.readThriftMethod = exports.readThriftMetadata = void 0; | ||
const logger_1 = require("../logger"); | ||
@@ -13,3 +14,3 @@ const protocols_1 = require("../protocols"); | ||
catch (err) { | ||
logger(['warn', 'readThriftMetadata'], `Unable to read Thrift message. ${err.message}`); | ||
logger(['warn', 'readThriftMetadata'], `Unable to read Thrift message. ${err instanceof Error ? err.message : 'Unexpected error thrown'}`); | ||
throw err; | ||
@@ -25,3 +26,3 @@ } | ||
catch (err) { | ||
logger(['warn', 'readThrfitMethod'], `Unable to read Thrift method name. ${err.message}`); | ||
logger(['warn', 'readThrfitMethod'], `Unable to read Thrift method name. ${err instanceof Error ? err.message : 'Unexpected error thrown'}`); | ||
return ''; | ||
@@ -37,3 +38,3 @@ } | ||
catch (err) { | ||
logger(['warn', 'readRequestId'], `Unable to read Thrift requestId. ${err.message}`); | ||
logger(['warn', 'readRequestId'], `Unable to read Thrift requestId. ${err instanceof Error ? err.message : 'Unexpected error thrown'}`); | ||
return 0; | ||
@@ -40,0 +41,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.stripStruct = exports.readThriftObject = void 0; | ||
const types_1 = require("../types"); | ||
@@ -8,4 +9,4 @@ const protocols_1 = require("../protocols"); | ||
return new Promise((resolve, reject) => { | ||
const Transport = transports_1.getTransport(transportType); | ||
const Protocol = protocols_1.getProtocol(protocolType); | ||
const Transport = (0, transports_1.getTransport)(transportType); | ||
const Protocol = (0, protocols_1.getProtocol)(protocolType); | ||
const receiver = new Transport(data); | ||
@@ -20,4 +21,4 @@ const input = new Protocol(receiver); | ||
try { | ||
const Transport = transports_1.getTransport(transportType); | ||
const Protocol = protocols_1.getProtocol(protocolType); | ||
const Transport = (0, transports_1.getTransport)(transportType); | ||
const Protocol = (0, protocols_1.getProtocol)(protocolType); | ||
const receiver = new Transport(data); | ||
@@ -24,0 +25,0 @@ const input = new Protocol(receiver); |
{ | ||
"name": "@creditkarma/thrift-server-core", | ||
"version": "0.17.2", | ||
"version": "0.18.0-alpha.0", | ||
"description": "Thrift core library in TypeScript", | ||
@@ -39,3 +39,3 @@ "main": "dist/main/index.js", | ||
"@types/hapi__lab": "^18.1.0", | ||
"@types/node": "^8.10.38", | ||
"@types/node": "^16.11.0", | ||
"@types/rimraf": "2.0.2", | ||
@@ -47,3 +47,3 @@ "prettier": "^1.18.2", | ||
"tslint-plugin-prettier": "^2.0.0", | ||
"typescript": "3.5.x" | ||
"typescript": "4.6.x" | ||
}, | ||
@@ -50,0 +50,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
208037
3279