@lancedb/arrow-flight-sql-client
Version:
A native typescript project for querying Flight SQL endpoints
1 lines • 1.79 MB
Source Map (JSON)
{"version":3,"sources":["../src/generated/flight.js","../src/generated/flightsql.js","../src/generated/any.js","../src/flight.ts","../src/async_util.ts","../src/grpc_util.ts","../src/arrow_util.ts","../src/flightsql.ts","../src/client.ts"],"sourcesContent":["/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs/minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\n\n$root.arrow = (function() {\n\n /**\n * Namespace arrow.\n * @exports arrow\n * @namespace\n */\n var arrow = {};\n\n arrow.flight = (function() {\n\n /**\n * Namespace flight.\n * @memberof arrow\n * @namespace\n */\n var flight = {};\n\n flight.protocol = (function() {\n\n /**\n * Namespace protocol.\n * @memberof arrow.flight\n * @namespace\n */\n var protocol = {};\n\n protocol.FlightService = (function() {\n\n /**\n * Constructs a new FlightService service.\n * @memberof arrow.flight.protocol\n * @classdesc Represents a FlightService\n * @extends $protobuf.rpc.Service\n * @constructor\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\n function FlightService(rpcImpl, requestDelimited, responseDelimited) {\n $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n }\n\n (FlightService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FlightService;\n\n /**\n * Creates new FlightService service using the specified rpc implementation.\n * @function create\n * @memberof arrow.flight.protocol.FlightService\n * @static\n * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {FlightService} RPC service. Useful where requests and/or responses are streamed.\n */\n FlightService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n return new this(rpcImpl, requestDelimited, responseDelimited);\n };\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#handshake}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef HandshakeCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.HandshakeResponse} [response] HandshakeResponse\n */\n\n /**\n * Calls Handshake.\n * @function handshake\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IHandshakeRequest} request HandshakeRequest message or plain object\n * @param {arrow.flight.protocol.FlightService.HandshakeCallback} callback Node-style callback called with the error, if any, and HandshakeResponse\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.handshake = function handshake(request, callback) {\n return this.rpcCall(handshake, $root.arrow.flight.protocol.HandshakeRequest, $root.arrow.flight.protocol.HandshakeResponse, request, callback);\n }, \"name\", { value: \"Handshake\" });\n\n /**\n * Calls Handshake.\n * @function handshake\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IHandshakeRequest} request HandshakeRequest message or plain object\n * @returns {Promise<arrow.flight.protocol.HandshakeResponse>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#listFlights}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef ListFlightsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.FlightInfo} [response] FlightInfo\n */\n\n /**\n * Calls ListFlights.\n * @function listFlights\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.ICriteria} request Criteria message or plain object\n * @param {arrow.flight.protocol.FlightService.ListFlightsCallback} callback Node-style callback called with the error, if any, and FlightInfo\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.listFlights = function listFlights(request, callback) {\n return this.rpcCall(listFlights, $root.arrow.flight.protocol.Criteria, $root.arrow.flight.protocol.FlightInfo, request, callback);\n }, \"name\", { value: \"ListFlights\" });\n\n /**\n * Calls ListFlights.\n * @function listFlights\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.ICriteria} request Criteria message or plain object\n * @returns {Promise<arrow.flight.protocol.FlightInfo>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#getFlightInfo}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef GetFlightInfoCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.FlightInfo} [response] FlightInfo\n */\n\n /**\n * Calls GetFlightInfo.\n * @function getFlightInfo\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightDescriptor} request FlightDescriptor message or plain object\n * @param {arrow.flight.protocol.FlightService.GetFlightInfoCallback} callback Node-style callback called with the error, if any, and FlightInfo\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.getFlightInfo = function getFlightInfo(request, callback) {\n return this.rpcCall(getFlightInfo, $root.arrow.flight.protocol.FlightDescriptor, $root.arrow.flight.protocol.FlightInfo, request, callback);\n }, \"name\", { value: \"GetFlightInfo\" });\n\n /**\n * Calls GetFlightInfo.\n * @function getFlightInfo\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightDescriptor} request FlightDescriptor message or plain object\n * @returns {Promise<arrow.flight.protocol.FlightInfo>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#pollFlightInfo}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef PollFlightInfoCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.PollInfo} [response] PollInfo\n */\n\n /**\n * Calls PollFlightInfo.\n * @function pollFlightInfo\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightDescriptor} request FlightDescriptor message or plain object\n * @param {arrow.flight.protocol.FlightService.PollFlightInfoCallback} callback Node-style callback called with the error, if any, and PollInfo\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.pollFlightInfo = function pollFlightInfo(request, callback) {\n return this.rpcCall(pollFlightInfo, $root.arrow.flight.protocol.FlightDescriptor, $root.arrow.flight.protocol.PollInfo, request, callback);\n }, \"name\", { value: \"PollFlightInfo\" });\n\n /**\n * Calls PollFlightInfo.\n * @function pollFlightInfo\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightDescriptor} request FlightDescriptor message or plain object\n * @returns {Promise<arrow.flight.protocol.PollInfo>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#getSchema}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef GetSchemaCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.SchemaResult} [response] SchemaResult\n */\n\n /**\n * Calls GetSchema.\n * @function getSchema\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightDescriptor} request FlightDescriptor message or plain object\n * @param {arrow.flight.protocol.FlightService.GetSchemaCallback} callback Node-style callback called with the error, if any, and SchemaResult\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.getSchema = function getSchema(request, callback) {\n return this.rpcCall(getSchema, $root.arrow.flight.protocol.FlightDescriptor, $root.arrow.flight.protocol.SchemaResult, request, callback);\n }, \"name\", { value: \"GetSchema\" });\n\n /**\n * Calls GetSchema.\n * @function getSchema\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightDescriptor} request FlightDescriptor message or plain object\n * @returns {Promise<arrow.flight.protocol.SchemaResult>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#doGet}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef DoGetCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.FlightData} [response] FlightData\n */\n\n /**\n * Calls DoGet.\n * @function doGet\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.ITicket} request Ticket message or plain object\n * @param {arrow.flight.protocol.FlightService.DoGetCallback} callback Node-style callback called with the error, if any, and FlightData\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.doGet = function doGet(request, callback) {\n return this.rpcCall(doGet, $root.arrow.flight.protocol.Ticket, $root.arrow.flight.protocol.FlightData, request, callback);\n }, \"name\", { value: \"DoGet\" });\n\n /**\n * Calls DoGet.\n * @function doGet\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.ITicket} request Ticket message or plain object\n * @returns {Promise<arrow.flight.protocol.FlightData>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#doPut}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef DoPutCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.PutResult} [response] PutResult\n */\n\n /**\n * Calls DoPut.\n * @function doPut\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightData} request FlightData message or plain object\n * @param {arrow.flight.protocol.FlightService.DoPutCallback} callback Node-style callback called with the error, if any, and PutResult\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.doPut = function doPut(request, callback) {\n return this.rpcCall(doPut, $root.arrow.flight.protocol.FlightData, $root.arrow.flight.protocol.PutResult, request, callback);\n }, \"name\", { value: \"DoPut\" });\n\n /**\n * Calls DoPut.\n * @function doPut\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightData} request FlightData message or plain object\n * @returns {Promise<arrow.flight.protocol.PutResult>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#doExchange}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef DoExchangeCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.FlightData} [response] FlightData\n */\n\n /**\n * Calls DoExchange.\n * @function doExchange\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightData} request FlightData message or plain object\n * @param {arrow.flight.protocol.FlightService.DoExchangeCallback} callback Node-style callback called with the error, if any, and FlightData\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.doExchange = function doExchange(request, callback) {\n return this.rpcCall(doExchange, $root.arrow.flight.protocol.FlightData, $root.arrow.flight.protocol.FlightData, request, callback);\n }, \"name\", { value: \"DoExchange\" });\n\n /**\n * Calls DoExchange.\n * @function doExchange\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IFlightData} request FlightData message or plain object\n * @returns {Promise<arrow.flight.protocol.FlightData>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#doAction}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef DoActionCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.Result} [response] Result\n */\n\n /**\n * Calls DoAction.\n * @function doAction\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IAction} request Action message or plain object\n * @param {arrow.flight.protocol.FlightService.DoActionCallback} callback Node-style callback called with the error, if any, and Result\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.doAction = function doAction(request, callback) {\n return this.rpcCall(doAction, $root.arrow.flight.protocol.Action, $root.arrow.flight.protocol.Result, request, callback);\n }, \"name\", { value: \"DoAction\" });\n\n /**\n * Calls DoAction.\n * @function doAction\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IAction} request Action message or plain object\n * @returns {Promise<arrow.flight.protocol.Result>} Promise\n * @variation 2\n */\n\n /**\n * Callback as used by {@link arrow.flight.protocol.FlightService#listActions}.\n * @memberof arrow.flight.protocol.FlightService\n * @typedef ListActionsCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {arrow.flight.protocol.ActionType} [response] ActionType\n */\n\n /**\n * Calls ListActions.\n * @function listActions\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IEmpty} request Empty message or plain object\n * @param {arrow.flight.protocol.FlightService.ListActionsCallback} callback Node-style callback called with the error, if any, and ActionType\n * @returns {undefined}\n * @variation 1\n */\n Object.defineProperty(FlightService.prototype.listActions = function listActions(request, callback) {\n return this.rpcCall(listActions, $root.arrow.flight.protocol.Empty, $root.arrow.flight.protocol.ActionType, request, callback);\n }, \"name\", { value: \"ListActions\" });\n\n /**\n * Calls ListActions.\n * @function listActions\n * @memberof arrow.flight.protocol.FlightService\n * @instance\n * @param {arrow.flight.protocol.IEmpty} request Empty message or plain object\n * @returns {Promise<arrow.flight.protocol.ActionType>} Promise\n * @variation 2\n */\n\n return FlightService;\n })();\n\n protocol.HandshakeRequest = (function() {\n\n /**\n * Properties of a HandshakeRequest.\n * @memberof arrow.flight.protocol\n * @interface IHandshakeRequest\n * @property {number|Long|null} [protocolVersion] HandshakeRequest protocolVersion\n * @property {Uint8Array|null} [payload] HandshakeRequest payload\n */\n\n /**\n * Constructs a new HandshakeRequest.\n * @memberof arrow.flight.protocol\n * @classdesc Represents a HandshakeRequest.\n * @implements IHandshakeRequest\n * @constructor\n * @param {arrow.flight.protocol.IHandshakeRequest=} [properties] Properties to set\n */\n function HandshakeRequest(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * HandshakeRequest protocolVersion.\n * @member {number|Long} protocolVersion\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @instance\n */\n HandshakeRequest.prototype.protocolVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n /**\n * HandshakeRequest payload.\n * @member {Uint8Array} payload\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @instance\n */\n HandshakeRequest.prototype.payload = $util.newBuffer([]);\n\n /**\n * Creates a new HandshakeRequest instance using the specified properties.\n * @function create\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {arrow.flight.protocol.IHandshakeRequest=} [properties] Properties to set\n * @returns {arrow.flight.protocol.HandshakeRequest} HandshakeRequest instance\n */\n HandshakeRequest.create = function create(properties) {\n return new HandshakeRequest(properties);\n };\n\n /**\n * Encodes the specified HandshakeRequest message. Does not implicitly {@link arrow.flight.protocol.HandshakeRequest.verify|verify} messages.\n * @function encode\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {arrow.flight.protocol.IHandshakeRequest} message HandshakeRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HandshakeRequest.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.protocolVersion != null && Object.hasOwnProperty.call(message, \"protocolVersion\"))\n writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocolVersion);\n if (message.payload != null && Object.hasOwnProperty.call(message, \"payload\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payload);\n return writer;\n };\n\n /**\n * Encodes the specified HandshakeRequest message, length delimited. Does not implicitly {@link arrow.flight.protocol.HandshakeRequest.verify|verify} messages.\n * @function encodeDelimited\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {arrow.flight.protocol.IHandshakeRequest} message HandshakeRequest message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HandshakeRequest.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a HandshakeRequest message from the specified reader or buffer.\n * @function decode\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {arrow.flight.protocol.HandshakeRequest} HandshakeRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HandshakeRequest.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.HandshakeRequest();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.protocolVersion = reader.uint64();\n break;\n }\n case 2: {\n message.payload = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a HandshakeRequest message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {arrow.flight.protocol.HandshakeRequest} HandshakeRequest\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HandshakeRequest.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a HandshakeRequest message.\n * @function verify\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {Object.<string,*>} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n HandshakeRequest.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.protocolVersion != null && message.hasOwnProperty(\"protocolVersion\"))\n if (!$util.isInteger(message.protocolVersion) && !(message.protocolVersion && $util.isInteger(message.protocolVersion.low) && $util.isInteger(message.protocolVersion.high)))\n return \"protocolVersion: integer|Long expected\";\n if (message.payload != null && message.hasOwnProperty(\"payload\"))\n if (!(message.payload && typeof message.payload.length === \"number\" || $util.isString(message.payload)))\n return \"payload: buffer expected\";\n return null;\n };\n\n /**\n * Creates a HandshakeRequest message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {Object.<string,*>} object Plain object\n * @returns {arrow.flight.protocol.HandshakeRequest} HandshakeRequest\n */\n HandshakeRequest.fromObject = function fromObject(object) {\n if (object instanceof $root.arrow.flight.protocol.HandshakeRequest)\n return object;\n var message = new $root.arrow.flight.protocol.HandshakeRequest();\n if (object.protocolVersion != null)\n if ($util.Long)\n (message.protocolVersion = $util.Long.fromValue(object.protocolVersion)).unsigned = true;\n else if (typeof object.protocolVersion === \"string\")\n message.protocolVersion = parseInt(object.protocolVersion, 10);\n else if (typeof object.protocolVersion === \"number\")\n message.protocolVersion = object.protocolVersion;\n else if (typeof object.protocolVersion === \"object\")\n message.protocolVersion = new $util.LongBits(object.protocolVersion.low >>> 0, object.protocolVersion.high >>> 0).toNumber(true);\n if (object.payload != null)\n if (typeof object.payload === \"string\")\n $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);\n else if (object.payload.length >= 0)\n message.payload = object.payload;\n return message;\n };\n\n /**\n * Creates a plain object from a HandshakeRequest message. Also converts values to other types if specified.\n * @function toObject\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {arrow.flight.protocol.HandshakeRequest} message HandshakeRequest\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.<string,*>} Plain object\n */\n HandshakeRequest.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n if ($util.Long) {\n var long = new $util.Long(0, 0, true);\n object.protocolVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.protocolVersion = options.longs === String ? \"0\" : 0;\n if (options.bytes === String)\n object.payload = \"\";\n else {\n object.payload = [];\n if (options.bytes !== Array)\n object.payload = $util.newBuffer(object.payload);\n }\n }\n if (message.protocolVersion != null && message.hasOwnProperty(\"protocolVersion\"))\n if (typeof message.protocolVersion === \"number\")\n object.protocolVersion = options.longs === String ? String(message.protocolVersion) : message.protocolVersion;\n else\n object.protocolVersion = options.longs === String ? $util.Long.prototype.toString.call(message.protocolVersion) : options.longs === Number ? new $util.LongBits(message.protocolVersion.low >>> 0, message.protocolVersion.high >>> 0).toNumber(true) : message.protocolVersion;\n if (message.payload != null && message.hasOwnProperty(\"payload\"))\n object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;\n return object;\n };\n\n /**\n * Converts this HandshakeRequest to JSON.\n * @function toJSON\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @instance\n * @returns {Object.<string,*>} JSON object\n */\n HandshakeRequest.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for HandshakeRequest\n * @function getTypeUrl\n * @memberof arrow.flight.protocol.HandshakeRequest\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n HandshakeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/arrow.flight.protocol.HandshakeRequest\";\n };\n\n return HandshakeRequest;\n })();\n\n protocol.HandshakeResponse = (function() {\n\n /**\n * Properties of a HandshakeResponse.\n * @memberof arrow.flight.protocol\n * @interface IHandshakeResponse\n * @property {number|Long|null} [protocolVersion] HandshakeResponse protocolVersion\n * @property {Uint8Array|null} [payload] HandshakeResponse payload\n */\n\n /**\n * Constructs a new HandshakeResponse.\n * @memberof arrow.flight.protocol\n * @classdesc Represents a HandshakeResponse.\n * @implements IHandshakeResponse\n * @constructor\n * @param {arrow.flight.protocol.IHandshakeResponse=} [properties] Properties to set\n */\n function HandshakeResponse(properties) {\n if (properties)\n for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n if (properties[keys[i]] != null)\n this[keys[i]] = properties[keys[i]];\n }\n\n /**\n * HandshakeResponse protocolVersion.\n * @member {number|Long} protocolVersion\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @instance\n */\n HandshakeResponse.prototype.protocolVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n /**\n * HandshakeResponse payload.\n * @member {Uint8Array} payload\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @instance\n */\n HandshakeResponse.prototype.payload = $util.newBuffer([]);\n\n /**\n * Creates a new HandshakeResponse instance using the specified properties.\n * @function create\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {arrow.flight.protocol.IHandshakeResponse=} [properties] Properties to set\n * @returns {arrow.flight.protocol.HandshakeResponse} HandshakeResponse instance\n */\n HandshakeResponse.create = function create(properties) {\n return new HandshakeResponse(properties);\n };\n\n /**\n * Encodes the specified HandshakeResponse message. Does not implicitly {@link arrow.flight.protocol.HandshakeResponse.verify|verify} messages.\n * @function encode\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {arrow.flight.protocol.IHandshakeResponse} message HandshakeResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HandshakeResponse.encode = function encode(message, writer) {\n if (!writer)\n writer = $Writer.create();\n if (message.protocolVersion != null && Object.hasOwnProperty.call(message, \"protocolVersion\"))\n writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.protocolVersion);\n if (message.payload != null && Object.hasOwnProperty.call(message, \"payload\"))\n writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payload);\n return writer;\n };\n\n /**\n * Encodes the specified HandshakeResponse message, length delimited. Does not implicitly {@link arrow.flight.protocol.HandshakeResponse.verify|verify} messages.\n * @function encodeDelimited\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {arrow.flight.protocol.IHandshakeResponse} message HandshakeResponse message or plain object to encode\n * @param {$protobuf.Writer} [writer] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n HandshakeResponse.encodeDelimited = function encodeDelimited(message, writer) {\n return this.encode(message, writer).ldelim();\n };\n\n /**\n * Decodes a HandshakeResponse message from the specified reader or buffer.\n * @function decode\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Message length if known beforehand\n * @returns {arrow.flight.protocol.HandshakeResponse} HandshakeResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HandshakeResponse.decode = function decode(reader, length) {\n if (!(reader instanceof $Reader))\n reader = $Reader.create(reader);\n var end = length === undefined ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.HandshakeResponse();\n while (reader.pos < end) {\n var tag = reader.uint32();\n switch (tag >>> 3) {\n case 1: {\n message.protocolVersion = reader.uint64();\n break;\n }\n case 2: {\n message.payload = reader.bytes();\n break;\n }\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return message;\n };\n\n /**\n * Decodes a HandshakeResponse message from the specified reader or buffer, length delimited.\n * @function decodeDelimited\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {arrow.flight.protocol.HandshakeResponse} HandshakeResponse\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n HandshakeResponse.decodeDelimited = function decodeDelimited(reader) {\n if (!(reader instanceof $Reader))\n reader = new $Reader(reader);\n return this.decode(reader, reader.uint32());\n };\n\n /**\n * Verifies a HandshakeResponse message.\n * @function verify\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {Object.<string,*>} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\n HandshakeResponse.verify = function verify(message) {\n if (typeof message !== \"object\" || message === null)\n return \"object expected\";\n if (message.protocolVersion != null && message.hasOwnProperty(\"protocolVersion\"))\n if (!$util.isInteger(message.protocolVersion) && !(message.protocolVersion && $util.isInteger(message.protocolVersion.low) && $util.isInteger(message.protocolVersion.high)))\n return \"protocolVersion: integer|Long expected\";\n if (message.payload != null && message.hasOwnProperty(\"payload\"))\n if (!(message.payload && typeof message.payload.length === \"number\" || $util.isString(message.payload)))\n return \"payload: buffer expected\";\n return null;\n };\n\n /**\n * Creates a HandshakeResponse message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {Object.<string,*>} object Plain object\n * @returns {arrow.flight.protocol.HandshakeResponse} HandshakeResponse\n */\n HandshakeResponse.fromObject = function fromObject(object) {\n if (object instanceof $root.arrow.flight.protocol.HandshakeResponse)\n return object;\n var message = new $root.arrow.flight.protocol.HandshakeResponse();\n if (object.protocolVersion != null)\n if ($util.Long)\n (message.protocolVersion = $util.Long.fromValue(object.protocolVersion)).unsigned = true;\n else if (typeof object.protocolVersion === \"string\")\n message.protocolVersion = parseInt(object.protocolVersion, 10);\n else if (typeof object.protocolVersion === \"number\")\n message.protocolVersion = object.protocolVersion;\n else if (typeof object.protocolVersion === \"object\")\n message.protocolVersion = new $util.LongBits(object.protocolVersion.low >>> 0, object.protocolVersion.high >>> 0).toNumber(true);\n if (object.payload != null)\n if (typeof object.payload === \"string\")\n $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);\n else if (object.payload.length >= 0)\n message.payload = object.payload;\n return message;\n };\n\n /**\n * Creates a plain object from a HandshakeResponse message. Also converts values to other types if specified.\n * @function toObject\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {arrow.flight.protocol.HandshakeResponse} message HandshakeResponse\n * @param {$protobuf.IConversionOptions} [options] Conversion options\n * @returns {Object.<string,*>} Plain object\n */\n HandshakeResponse.toObject = function toObject(message, options) {\n if (!options)\n options = {};\n var object = {};\n if (options.defaults) {\n if ($util.Long) {\n var long = new $util.Long(0, 0, true);\n object.protocolVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n } else\n object.protocolVersion = options.longs === String ? \"0\" : 0;\n if (options.bytes === String)\n object.payload = \"\";\n else {\n object.payload = [];\n if (options.bytes !== Array)\n object.payload = $util.newBuffer(object.payload);\n }\n }\n if (message.protocolVersion != null && message.hasOwnProperty(\"protocolVersion\"))\n if (typeof message.protocolVersion === \"number\")\n object.protocolVersion = options.longs === String ? String(message.protocolVersion) : message.protocolVersion;\n else\n object.protocolVersion = options.longs === String ? $util.Long.prototype.toString.call(message.protocolVersion) : options.longs === Number ? new $util.LongBits(message.protocolVersion.low >>> 0, message.protocolVersion.high >>> 0).toNumber(true) : message.protocolVersion;\n if (message.payload != null && message.hasOwnProperty(\"payload\"))\n object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;\n return object;\n };\n\n /**\n * Converts this HandshakeResponse to JSON.\n * @function toJSON\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @instance\n * @returns {Object.<string,*>} JSON object\n */\n HandshakeResponse.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n /**\n * Gets the default type url for HandshakeResponse\n * @function getTypeUrl\n * @memberof arrow.flight.protocol.HandshakeResponse\n * @static\n * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n * @returns {string} The default type url\n */\n HandshakeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n if (typeUrlPrefix === undefined) {\n typeUrlPrefix = \"type.googleapis.com\";\n }\n return typeUrlPrefix + \"/arrow.flight.protocol.HandshakeResponse\";\n };\n\n return HandshakeResponse;\n })();\n\n protocol.BasicAuth = (function() {\n\n /**\n * Properties of a BasicAuth.\n * @memberof arrow.flight.protocol\n * @interface IBasicAuth\n * @property {string|null} [username] BasicAuth username\n * @property {string|null} [password] BasicAuth password\n */\n\n