@lancedb/arrow-flight-sql-client
Version:
A native typescript project for querying Flight SQL endpoints
1,012 lines (1,011 loc) • 680 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
// src/generated/flight.js
var require_flight = __commonJS({
"src/generated/flight.js"(exports, module) {
"use strict";
var $protobuf = __require("protobufjs/minimal");
var $Reader = $protobuf.Reader;
var $Writer = $protobuf.Writer;
var $util = $protobuf.util;
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.arrow = function() {
var arrow3 = {};
arrow3.flight = function() {
var flight = {};
flight.protocol = function() {
var protocol = {};
protocol.FlightService = function() {
function FlightService(rpcImpl, requestDelimited, responseDelimited) {
$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
}
(FlightService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FlightService;
FlightService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
return new this(rpcImpl, requestDelimited, responseDelimited);
};
Object.defineProperty(FlightService.prototype.handshake = function handshake(request, callback) {
return this.rpcCall(handshake, $root.arrow.flight.protocol.HandshakeRequest, $root.arrow.flight.protocol.HandshakeResponse, request, callback);
}, "name", { value: "Handshake" });
Object.defineProperty(FlightService.prototype.listFlights = function listFlights(request, callback) {
return this.rpcCall(listFlights, $root.arrow.flight.protocol.Criteria, $root.arrow.flight.protocol.FlightInfo, request, callback);
}, "name", { value: "ListFlights" });
Object.defineProperty(FlightService.prototype.getFlightInfo = function getFlightInfo(request, callback) {
return this.rpcCall(getFlightInfo, $root.arrow.flight.protocol.FlightDescriptor, $root.arrow.flight.protocol.FlightInfo, request, callback);
}, "name", { value: "GetFlightInfo" });
Object.defineProperty(FlightService.prototype.pollFlightInfo = function pollFlightInfo(request, callback) {
return this.rpcCall(pollFlightInfo, $root.arrow.flight.protocol.FlightDescriptor, $root.arrow.flight.protocol.PollInfo, request, callback);
}, "name", { value: "PollFlightInfo" });
Object.defineProperty(FlightService.prototype.getSchema = function getSchema(request, callback) {
return this.rpcCall(getSchema, $root.arrow.flight.protocol.FlightDescriptor, $root.arrow.flight.protocol.SchemaResult, request, callback);
}, "name", { value: "GetSchema" });
Object.defineProperty(FlightService.prototype.doGet = function doGet(request, callback) {
return this.rpcCall(doGet, $root.arrow.flight.protocol.Ticket, $root.arrow.flight.protocol.FlightData, request, callback);
}, "name", { value: "DoGet" });
Object.defineProperty(FlightService.prototype.doPut = function doPut(request, callback) {
return this.rpcCall(doPut, $root.arrow.flight.protocol.FlightData, $root.arrow.flight.protocol.PutResult, request, callback);
}, "name", { value: "DoPut" });
Object.defineProperty(FlightService.prototype.doExchange = function doExchange(request, callback) {
return this.rpcCall(doExchange, $root.arrow.flight.protocol.FlightData, $root.arrow.flight.protocol.FlightData, request, callback);
}, "name", { value: "DoExchange" });
Object.defineProperty(FlightService.prototype.doAction = function doAction(request, callback) {
return this.rpcCall(doAction, $root.arrow.flight.protocol.Action, $root.arrow.flight.protocol.Result, request, callback);
}, "name", { value: "DoAction" });
Object.defineProperty(FlightService.prototype.listActions = function listActions(request, callback) {
return this.rpcCall(listActions, $root.arrow.flight.protocol.Empty, $root.arrow.flight.protocol.ActionType, request, callback);
}, "name", { value: "ListActions" });
return FlightService;
}();
protocol.HandshakeRequest = function() {
function HandshakeRequest(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
HandshakeRequest.prototype.protocolVersion = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
HandshakeRequest.prototype.payload = $util.newBuffer([]);
HandshakeRequest.create = function create(properties) {
return new HandshakeRequest(properties);
};
HandshakeRequest.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion"))
writer.uint32(
/* id 1, wireType 0 =*/
8
).uint64(message.protocolVersion);
if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
writer.uint32(
/* id 2, wireType 2 =*/
18
).bytes(message.payload);
return writer;
};
HandshakeRequest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
HandshakeRequest.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.HandshakeRequest();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.protocolVersion = reader.uint64();
break;
}
case 2: {
message.payload = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
HandshakeRequest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
HandshakeRequest.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) {
if (!$util.isInteger(message.protocolVersion) && !(message.protocolVersion && $util.isInteger(message.protocolVersion.low) && $util.isInteger(message.protocolVersion.high)))
return "protocolVersion: integer|Long expected";
}
if (message.payload != null && message.hasOwnProperty("payload")) {
if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
return "payload: buffer expected";
}
return null;
};
HandshakeRequest.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.HandshakeRequest)
return object;
var message = new $root.arrow.flight.protocol.HandshakeRequest();
if (object.protocolVersion != null) {
if ($util.Long)
(message.protocolVersion = $util.Long.fromValue(object.protocolVersion)).unsigned = true;
else if (typeof object.protocolVersion === "string")
message.protocolVersion = parseInt(object.protocolVersion, 10);
else if (typeof object.protocolVersion === "number")
message.protocolVersion = object.protocolVersion;
else if (typeof object.protocolVersion === "object")
message.protocolVersion = new $util.LongBits(object.protocolVersion.low >>> 0, object.protocolVersion.high >>> 0).toNumber(true);
}
if (object.payload != null) {
if (typeof object.payload === "string")
$util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
else if (object.payload.length >= 0)
message.payload = object.payload;
}
return message;
};
HandshakeRequest.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.protocolVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.protocolVersion = options.longs === String ? "0" : 0;
if (options.bytes === String)
object.payload = "";
else {
object.payload = [];
if (options.bytes !== Array)
object.payload = $util.newBuffer(object.payload);
}
}
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion"))
if (typeof message.protocolVersion === "number")
object.protocolVersion = options.longs === String ? String(message.protocolVersion) : message.protocolVersion;
else
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;
if (message.payload != null && message.hasOwnProperty("payload"))
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;
return object;
};
HandshakeRequest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
HandshakeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.HandshakeRequest";
};
return HandshakeRequest;
}();
protocol.HandshakeResponse = function() {
function HandshakeResponse(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
HandshakeResponse.prototype.protocolVersion = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
HandshakeResponse.prototype.payload = $util.newBuffer([]);
HandshakeResponse.create = function create(properties) {
return new HandshakeResponse(properties);
};
HandshakeResponse.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion"))
writer.uint32(
/* id 1, wireType 0 =*/
8
).uint64(message.protocolVersion);
if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
writer.uint32(
/* id 2, wireType 2 =*/
18
).bytes(message.payload);
return writer;
};
HandshakeResponse.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
HandshakeResponse.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.HandshakeResponse();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.protocolVersion = reader.uint64();
break;
}
case 2: {
message.payload = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
HandshakeResponse.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
HandshakeResponse.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) {
if (!$util.isInteger(message.protocolVersion) && !(message.protocolVersion && $util.isInteger(message.protocolVersion.low) && $util.isInteger(message.protocolVersion.high)))
return "protocolVersion: integer|Long expected";
}
if (message.payload != null && message.hasOwnProperty("payload")) {
if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
return "payload: buffer expected";
}
return null;
};
HandshakeResponse.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.HandshakeResponse)
return object;
var message = new $root.arrow.flight.protocol.HandshakeResponse();
if (object.protocolVersion != null) {
if ($util.Long)
(message.protocolVersion = $util.Long.fromValue(object.protocolVersion)).unsigned = true;
else if (typeof object.protocolVersion === "string")
message.protocolVersion = parseInt(object.protocolVersion, 10);
else if (typeof object.protocolVersion === "number")
message.protocolVersion = object.protocolVersion;
else if (typeof object.protocolVersion === "object")
message.protocolVersion = new $util.LongBits(object.protocolVersion.low >>> 0, object.protocolVersion.high >>> 0).toNumber(true);
}
if (object.payload != null) {
if (typeof object.payload === "string")
$util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
else if (object.payload.length >= 0)
message.payload = object.payload;
}
return message;
};
HandshakeResponse.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
if ($util.Long) {
var long = new $util.Long(0, 0, true);
object.protocolVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.protocolVersion = options.longs === String ? "0" : 0;
if (options.bytes === String)
object.payload = "";
else {
object.payload = [];
if (options.bytes !== Array)
object.payload = $util.newBuffer(object.payload);
}
}
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion"))
if (typeof message.protocolVersion === "number")
object.protocolVersion = options.longs === String ? String(message.protocolVersion) : message.protocolVersion;
else
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;
if (message.payload != null && message.hasOwnProperty("payload"))
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;
return object;
};
HandshakeResponse.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
HandshakeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.HandshakeResponse";
};
return HandshakeResponse;
}();
protocol.BasicAuth = function() {
function BasicAuth(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
BasicAuth.prototype.username = "";
BasicAuth.prototype.password = "";
BasicAuth.create = function create(properties) {
return new BasicAuth(properties);
};
BasicAuth.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.username != null && Object.hasOwnProperty.call(message, "username"))
writer.uint32(
/* id 2, wireType 2 =*/
18
).string(message.username);
if (message.password != null && Object.hasOwnProperty.call(message, "password"))
writer.uint32(
/* id 3, wireType 2 =*/
26
).string(message.password);
return writer;
};
BasicAuth.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
BasicAuth.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.BasicAuth();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 2: {
message.username = reader.string();
break;
}
case 3: {
message.password = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
BasicAuth.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
BasicAuth.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.username != null && message.hasOwnProperty("username")) {
if (!$util.isString(message.username))
return "username: string expected";
}
if (message.password != null && message.hasOwnProperty("password")) {
if (!$util.isString(message.password))
return "password: string expected";
}
return null;
};
BasicAuth.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.BasicAuth)
return object;
var message = new $root.arrow.flight.protocol.BasicAuth();
if (object.username != null)
message.username = String(object.username);
if (object.password != null)
message.password = String(object.password);
return message;
};
BasicAuth.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.username = "";
object.password = "";
}
if (message.username != null && message.hasOwnProperty("username"))
object.username = message.username;
if (message.password != null && message.hasOwnProperty("password"))
object.password = message.password;
return object;
};
BasicAuth.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
BasicAuth.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.BasicAuth";
};
return BasicAuth;
}();
protocol.Empty = function() {
function Empty(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
Empty.create = function create(properties) {
return new Empty(properties);
};
Empty.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
return writer;
};
Empty.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
Empty.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.Empty();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
Empty.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
Empty.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
return null;
};
Empty.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.Empty)
return object;
return new $root.arrow.flight.protocol.Empty();
};
Empty.toObject = function toObject() {
return {};
};
Empty.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.Empty";
};
return Empty;
}();
protocol.ActionType = function() {
function ActionType(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
ActionType.prototype.type = "";
ActionType.prototype.description = "";
ActionType.create = function create(properties) {
return new ActionType(properties);
};
ActionType.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
writer.uint32(
/* id 1, wireType 2 =*/
10
).string(message.type);
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
writer.uint32(
/* id 2, wireType 2 =*/
18
).string(message.description);
return writer;
};
ActionType.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
ActionType.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.ActionType();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.type = reader.string();
break;
}
case 2: {
message.description = reader.string();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
ActionType.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
ActionType.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.type != null && message.hasOwnProperty("type")) {
if (!$util.isString(message.type))
return "type: string expected";
}
if (message.description != null && message.hasOwnProperty("description")) {
if (!$util.isString(message.description))
return "description: string expected";
}
return null;
};
ActionType.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.ActionType)
return object;
var message = new $root.arrow.flight.protocol.ActionType();
if (object.type != null)
message.type = String(object.type);
if (object.description != null)
message.description = String(object.description);
return message;
};
ActionType.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.type = "";
object.description = "";
}
if (message.type != null && message.hasOwnProperty("type"))
object.type = message.type;
if (message.description != null && message.hasOwnProperty("description"))
object.description = message.description;
return object;
};
ActionType.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
ActionType.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.ActionType";
};
return ActionType;
}();
protocol.Criteria = function() {
function Criteria(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
Criteria.prototype.expression = $util.newBuffer([]);
Criteria.create = function create(properties) {
return new Criteria(properties);
};
Criteria.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.expression != null && Object.hasOwnProperty.call(message, "expression"))
writer.uint32(
/* id 1, wireType 2 =*/
10
).bytes(message.expression);
return writer;
};
Criteria.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
Criteria.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.Criteria();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.expression = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
Criteria.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
Criteria.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.expression != null && message.hasOwnProperty("expression")) {
if (!(message.expression && typeof message.expression.length === "number" || $util.isString(message.expression)))
return "expression: buffer expected";
}
return null;
};
Criteria.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.Criteria)
return object;
var message = new $root.arrow.flight.protocol.Criteria();
if (object.expression != null) {
if (typeof object.expression === "string")
$util.base64.decode(object.expression, message.expression = $util.newBuffer($util.base64.length(object.expression)), 0);
else if (object.expression.length >= 0)
message.expression = object.expression;
}
return message;
};
Criteria.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
if (options.bytes === String)
object.expression = "";
else {
object.expression = [];
if (options.bytes !== Array)
object.expression = $util.newBuffer(object.expression);
}
if (message.expression != null && message.hasOwnProperty("expression"))
object.expression = options.bytes === String ? $util.base64.encode(message.expression, 0, message.expression.length) : options.bytes === Array ? Array.prototype.slice.call(message.expression) : message.expression;
return object;
};
Criteria.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
Criteria.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.Criteria";
};
return Criteria;
}();
protocol.Action = function() {
function Action(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
Action.prototype.type = "";
Action.prototype.body = $util.newBuffer([]);
Action.create = function create(properties) {
return new Action(properties);
};
Action.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.type != null && Object.hasOwnProperty.call(message, "type"))
writer.uint32(
/* id 1, wireType 2 =*/
10
).string(message.type);
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
writer.uint32(
/* id 2, wireType 2 =*/
18
).bytes(message.body);
return writer;
};
Action.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
Action.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.Action();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.type = reader.string();
break;
}
case 2: {
message.body = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
Action.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
Action.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.type != null && message.hasOwnProperty("type")) {
if (!$util.isString(message.type))
return "type: string expected";
}
if (message.body != null && message.hasOwnProperty("body")) {
if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body)))
return "body: buffer expected";
}
return null;
};
Action.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.Action)
return object;
var message = new $root.arrow.flight.protocol.Action();
if (object.type != null)
message.type = String(object.type);
if (object.body != null) {
if (typeof object.body === "string")
$util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0);
else if (object.body.length >= 0)
message.body = object.body;
}
return message;
};
Action.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.type = "";
if (options.bytes === String)
object.body = "";
else {
object.body = [];
if (options.bytes !== Array)
object.body = $util.newBuffer(object.body);
}
}
if (message.type != null && message.hasOwnProperty("type"))
object.type = message.type;
if (message.body != null && message.hasOwnProperty("body"))
object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body;
return object;
};
Action.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
Action.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.Action";
};
return Action;
}();
protocol.Result = function() {
function Result(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
Result.prototype.body = $util.newBuffer([]);
Result.create = function create(properties) {
return new Result(properties);
};
Result.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
writer.uint32(
/* id 1, wireType 2 =*/
10
).bytes(message.body);
return writer;
};
Result.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
Result.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.Result();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.body = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
Result.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
Result.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.body != null && message.hasOwnProperty("body")) {
if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body)))
return "body: buffer expected";
}
return null;
};
Result.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.protocol.Result)
return object;
var message = new $root.arrow.flight.protocol.Result();
if (object.body != null) {
if (typeof object.body === "string")
$util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0);
else if (object.body.length >= 0)
message.body = object.body;
}
return message;
};
Result.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
if (options.bytes === String)
object.body = "";
else {
object.body = [];
if (options.bytes !== Array)
object.body = $util.newBuffer(object.body);
}
if (message.body != null && message.hasOwnProperty("body"))
object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body;
return object;
};
Result.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
Result.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === void 0) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/arrow.flight.protocol.Result";
};
return Result;
}();
protocol.SchemaResult = function() {
function SchemaResult(properties) {
if (properties) {
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
}
SchemaResult.prototype.schema = $util.newBuffer([]);
SchemaResult.create = function create(properties) {
return new SchemaResult(properties);
};
SchemaResult.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.schema != null && Object.hasOwnProperty.call(message, "schema"))
writer.uint32(
/* id 1, wireType 2 =*/
10
).bytes(message.schema);
return writer;
};
SchemaResult.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
SchemaResult.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.arrow.flight.protocol.SchemaResult();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.schema = reader.bytes();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
SchemaResult.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
SchemaResult.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.schema != null && message.hasOwnProperty("schema")) {
if (!(message.schema && typeof message.schema.length === "number" || $util.isString(message.schema)))
return "schema: buffer expected";
}
return null;
};
SchemaResult.fromObject = function fromObject(object) {
if (object instanceof $root.arrow.flight.p