@useairfoil/flight 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-Bp6m_JJh.js +13 -0
- package/dist/index.d.ts +81 -52
- package/dist/index.js +105 -93
- package/dist/index.js.map +1 -1
- package/dist/proto/Flight.proto +4 -11
- package/package.json +5 -12
- package/src/arrow-flight-client.ts +168 -0
- package/src/arrow-flight-sql-client.ts +147 -0
- package/src/arrow-utils.ts +2 -1
- package/src/flight-client-error.ts +27 -0
- package/src/index.ts +11 -3
- package/src/proto/Flight.ts +97 -215
- package/src/proto/FlightSql.ts +291 -537
- package/src/proto/any.ts +9 -16
- package/src/proto/google/protobuf/descriptor.ts +12 -1
- package/src/proto/google/protobuf/timestamp.ts +17 -25
- package/src/proto/typeRegistry.ts +7 -11
- package/src/record-batch-decoder.ts +15 -5
- package/src/record-batch-with-metadata.ts +6 -0
- package/src/arrow-flight-sql.ts +0 -98
- package/src/arrow-flight.ts +0 -126
package/src/proto/Flight.ts
CHANGED
|
@@ -215,9 +215,7 @@ export enum FlightDescriptor_DescriptorType {
|
|
|
215
215
|
UNRECOGNIZED = -1,
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
export function flightDescriptor_DescriptorTypeFromJSON(
|
|
219
|
-
object: any,
|
|
220
|
-
): FlightDescriptor_DescriptorType {
|
|
218
|
+
export function flightDescriptor_DescriptorTypeFromJSON(object: any): FlightDescriptor_DescriptorType {
|
|
221
219
|
switch (object) {
|
|
222
220
|
case 0:
|
|
223
221
|
case "UNKNOWN":
|
|
@@ -235,9 +233,7 @@ export function flightDescriptor_DescriptorTypeFromJSON(
|
|
|
235
233
|
}
|
|
236
234
|
}
|
|
237
235
|
|
|
238
|
-
export function flightDescriptor_DescriptorTypeToJSON(
|
|
239
|
-
object: FlightDescriptor_DescriptorType,
|
|
240
|
-
): string {
|
|
236
|
+
export function flightDescriptor_DescriptorTypeToJSON(object: FlightDescriptor_DescriptorType): string {
|
|
241
237
|
switch (object) {
|
|
242
238
|
case FlightDescriptor_DescriptorType.UNKNOWN:
|
|
243
239
|
return "UNKNOWN";
|
|
@@ -265,7 +261,9 @@ export interface FlightInfo {
|
|
|
265
261
|
*/
|
|
266
262
|
readonly schema: Uint8Array;
|
|
267
263
|
/** The descriptor associated with this info. */
|
|
268
|
-
readonly flightDescriptor:
|
|
264
|
+
readonly flightDescriptor:
|
|
265
|
+
| FlightDescriptor
|
|
266
|
+
| undefined;
|
|
269
267
|
/**
|
|
270
268
|
* A list of endpoints associated with the flight. To consume the
|
|
271
269
|
* whole flight, all endpoints (and hence all Tickets) must be
|
|
@@ -329,17 +327,23 @@ export interface PollInfo {
|
|
|
329
327
|
* ticket in the info before the query is
|
|
330
328
|
* completed. FlightInfo.ordered is also valid.
|
|
331
329
|
*/
|
|
332
|
-
readonly info:
|
|
330
|
+
readonly info:
|
|
331
|
+
| FlightInfo
|
|
332
|
+
| undefined;
|
|
333
333
|
/**
|
|
334
334
|
* The descriptor the client should use on the next try.
|
|
335
335
|
* If unset, the query is complete.
|
|
336
336
|
*/
|
|
337
|
-
readonly flightDescriptor:
|
|
337
|
+
readonly flightDescriptor:
|
|
338
|
+
| FlightDescriptor
|
|
339
|
+
| undefined;
|
|
338
340
|
/**
|
|
339
341
|
* Query progress. If known, must be in [0.0, 1.0] but need not be
|
|
340
342
|
* monotonic or nondecreasing. If unknown, do not set.
|
|
341
343
|
*/
|
|
342
|
-
readonly progress?:
|
|
344
|
+
readonly progress?:
|
|
345
|
+
| number
|
|
346
|
+
| undefined;
|
|
343
347
|
/**
|
|
344
348
|
* Expiration time for this request. After this passes, the server
|
|
345
349
|
* might not accept the retry descriptor anymore (and the query may
|
|
@@ -352,7 +356,9 @@ export interface PollInfo {
|
|
|
352
356
|
export interface FlightEndpoint {
|
|
353
357
|
$type: "arrow.flight.protocol.FlightEndpoint";
|
|
354
358
|
/** Token used to retrieve this stream. */
|
|
355
|
-
readonly ticket:
|
|
359
|
+
readonly ticket:
|
|
360
|
+
| Ticket
|
|
361
|
+
| undefined;
|
|
356
362
|
/**
|
|
357
363
|
* A list of URIs where this ticket can be redeemed via DoGet().
|
|
358
364
|
*
|
|
@@ -375,7 +381,9 @@ export interface FlightEndpoint {
|
|
|
375
381
|
* they can retry DoGet requests. Otherwise, it is
|
|
376
382
|
* application-defined whether DoGet requests may be retried.
|
|
377
383
|
*/
|
|
378
|
-
readonly expirationTime:
|
|
384
|
+
readonly expirationTime:
|
|
385
|
+
| Date
|
|
386
|
+
| undefined;
|
|
379
387
|
/**
|
|
380
388
|
* Application-defined metadata.
|
|
381
389
|
*
|
|
@@ -416,7 +424,9 @@ export interface FlightData {
|
|
|
416
424
|
* The descriptor of the data. This is only relevant when a client is
|
|
417
425
|
* starting a new DoPut stream.
|
|
418
426
|
*/
|
|
419
|
-
readonly flightDescriptor:
|
|
427
|
+
readonly flightDescriptor:
|
|
428
|
+
| FlightDescriptor
|
|
429
|
+
| undefined;
|
|
420
430
|
/** Header for message data as described in Message.fbs::Message. */
|
|
421
431
|
readonly dataHeader: Uint8Array;
|
|
422
432
|
/** Application-defined metadata. */
|
|
@@ -437,25 +447,16 @@ export interface PutResult {
|
|
|
437
447
|
}
|
|
438
448
|
|
|
439
449
|
function createBaseHandshakeRequest(): HandshakeRequest {
|
|
440
|
-
return {
|
|
441
|
-
$type: "arrow.flight.protocol.HandshakeRequest",
|
|
442
|
-
protocolVersion: 0n,
|
|
443
|
-
payload: new Uint8Array(0),
|
|
444
|
-
};
|
|
450
|
+
return { $type: "arrow.flight.protocol.HandshakeRequest", protocolVersion: 0n, payload: new Uint8Array(0) };
|
|
445
451
|
}
|
|
446
452
|
|
|
447
|
-
export const HandshakeRequest: MessageFns<
|
|
448
|
-
HandshakeRequest,
|
|
449
|
-
"arrow.flight.protocol.HandshakeRequest"
|
|
450
|
-
> = {
|
|
453
|
+
export const HandshakeRequest: MessageFns<HandshakeRequest, "arrow.flight.protocol.HandshakeRequest"> = {
|
|
451
454
|
$type: "arrow.flight.protocol.HandshakeRequest" as const,
|
|
452
455
|
|
|
453
456
|
encode(message: HandshakeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
454
457
|
if (message.protocolVersion !== 0n) {
|
|
455
458
|
if (BigInt.asUintN(64, message.protocolVersion) !== message.protocolVersion) {
|
|
456
|
-
throw new globalThis.Error(
|
|
457
|
-
"value provided for field message.protocolVersion of type uint64 too large",
|
|
458
|
-
);
|
|
459
|
+
throw new globalThis.Error("value provided for field message.protocolVersion of type uint64 too large");
|
|
459
460
|
}
|
|
460
461
|
writer.uint32(8).uint64(message.protocolVersion);
|
|
461
462
|
}
|
|
@@ -530,25 +531,16 @@ export const HandshakeRequest: MessageFns<
|
|
|
530
531
|
messageTypeRegistry.set(HandshakeRequest.$type, HandshakeRequest);
|
|
531
532
|
|
|
532
533
|
function createBaseHandshakeResponse(): HandshakeResponse {
|
|
533
|
-
return {
|
|
534
|
-
$type: "arrow.flight.protocol.HandshakeResponse",
|
|
535
|
-
protocolVersion: 0n,
|
|
536
|
-
payload: new Uint8Array(0),
|
|
537
|
-
};
|
|
534
|
+
return { $type: "arrow.flight.protocol.HandshakeResponse", protocolVersion: 0n, payload: new Uint8Array(0) };
|
|
538
535
|
}
|
|
539
536
|
|
|
540
|
-
export const HandshakeResponse: MessageFns<
|
|
541
|
-
HandshakeResponse,
|
|
542
|
-
"arrow.flight.protocol.HandshakeResponse"
|
|
543
|
-
> = {
|
|
537
|
+
export const HandshakeResponse: MessageFns<HandshakeResponse, "arrow.flight.protocol.HandshakeResponse"> = {
|
|
544
538
|
$type: "arrow.flight.protocol.HandshakeResponse" as const,
|
|
545
539
|
|
|
546
540
|
encode(message: HandshakeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
547
541
|
if (message.protocolVersion !== 0n) {
|
|
548
542
|
if (BigInt.asUintN(64, message.protocolVersion) !== message.protocolVersion) {
|
|
549
|
-
throw new globalThis.Error(
|
|
550
|
-
"value provided for field message.protocolVersion of type uint64 too large",
|
|
551
|
-
);
|
|
543
|
+
throw new globalThis.Error("value provided for field message.protocolVersion of type uint64 too large");
|
|
552
544
|
}
|
|
553
545
|
writer.uint32(8).uint64(message.protocolVersion);
|
|
554
546
|
}
|
|
@@ -987,10 +979,7 @@ export const CancelFlightInfoRequest: MessageFns<
|
|
|
987
979
|
> = {
|
|
988
980
|
$type: "arrow.flight.protocol.CancelFlightInfoRequest" as const,
|
|
989
981
|
|
|
990
|
-
encode(
|
|
991
|
-
message: CancelFlightInfoRequest,
|
|
992
|
-
writer: BinaryWriter = new BinaryWriter(),
|
|
993
|
-
): BinaryWriter {
|
|
982
|
+
encode(message: CancelFlightInfoRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
994
983
|
if (message.info !== undefined) {
|
|
995
984
|
FlightInfo.encode(message.info, writer.uint32(10).fork()).join();
|
|
996
985
|
}
|
|
@@ -1036,19 +1025,14 @@ export const CancelFlightInfoRequest: MessageFns<
|
|
|
1036
1025
|
return obj;
|
|
1037
1026
|
},
|
|
1038
1027
|
|
|
1039
|
-
create<I extends Exact<DeepPartial<CancelFlightInfoRequest>, I>>(
|
|
1040
|
-
base?: I,
|
|
1041
|
-
): CancelFlightInfoRequest {
|
|
1028
|
+
create<I extends Exact<DeepPartial<CancelFlightInfoRequest>, I>>(base?: I): CancelFlightInfoRequest {
|
|
1042
1029
|
return CancelFlightInfoRequest.fromPartial(base ?? ({} as any));
|
|
1043
1030
|
},
|
|
1044
|
-
fromPartial<I extends Exact<DeepPartial<CancelFlightInfoRequest>, I>>(
|
|
1045
|
-
object: I,
|
|
1046
|
-
): CancelFlightInfoRequest {
|
|
1031
|
+
fromPartial<I extends Exact<DeepPartial<CancelFlightInfoRequest>, I>>(object: I): CancelFlightInfoRequest {
|
|
1047
1032
|
const message = createBaseCancelFlightInfoRequest() as any;
|
|
1048
|
-
message.info =
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
: undefined;
|
|
1033
|
+
message.info = (object.info !== undefined && object.info !== null)
|
|
1034
|
+
? FlightInfo.fromPartial(object.info)
|
|
1035
|
+
: undefined;
|
|
1052
1036
|
return message;
|
|
1053
1037
|
},
|
|
1054
1038
|
};
|
|
@@ -1065,10 +1049,7 @@ export const RenewFlightEndpointRequest: MessageFns<
|
|
|
1065
1049
|
> = {
|
|
1066
1050
|
$type: "arrow.flight.protocol.RenewFlightEndpointRequest" as const,
|
|
1067
1051
|
|
|
1068
|
-
encode(
|
|
1069
|
-
message: RenewFlightEndpointRequest,
|
|
1070
|
-
writer: BinaryWriter = new BinaryWriter(),
|
|
1071
|
-
): BinaryWriter {
|
|
1052
|
+
encode(message: RenewFlightEndpointRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1072
1053
|
if (message.endpoint !== undefined) {
|
|
1073
1054
|
FlightEndpoint.encode(message.endpoint, writer.uint32(10).fork()).join();
|
|
1074
1055
|
}
|
|
@@ -1114,19 +1095,14 @@ export const RenewFlightEndpointRequest: MessageFns<
|
|
|
1114
1095
|
return obj;
|
|
1115
1096
|
},
|
|
1116
1097
|
|
|
1117
|
-
create<I extends Exact<DeepPartial<RenewFlightEndpointRequest>, I>>(
|
|
1118
|
-
base?: I,
|
|
1119
|
-
): RenewFlightEndpointRequest {
|
|
1098
|
+
create<I extends Exact<DeepPartial<RenewFlightEndpointRequest>, I>>(base?: I): RenewFlightEndpointRequest {
|
|
1120
1099
|
return RenewFlightEndpointRequest.fromPartial(base ?? ({} as any));
|
|
1121
1100
|
},
|
|
1122
|
-
fromPartial<I extends Exact<DeepPartial<RenewFlightEndpointRequest>, I>>(
|
|
1123
|
-
object: I,
|
|
1124
|
-
): RenewFlightEndpointRequest {
|
|
1101
|
+
fromPartial<I extends Exact<DeepPartial<RenewFlightEndpointRequest>, I>>(object: I): RenewFlightEndpointRequest {
|
|
1125
1102
|
const message = createBaseRenewFlightEndpointRequest() as any;
|
|
1126
|
-
message.endpoint =
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
: undefined;
|
|
1103
|
+
message.endpoint = (object.endpoint !== undefined && object.endpoint !== null)
|
|
1104
|
+
? FlightEndpoint.fromPartial(object.endpoint)
|
|
1105
|
+
: undefined;
|
|
1130
1106
|
return message;
|
|
1131
1107
|
},
|
|
1132
1108
|
};
|
|
@@ -1172,10 +1148,7 @@ export const Result: MessageFns<Result, "arrow.flight.protocol.Result"> = {
|
|
|
1172
1148
|
},
|
|
1173
1149
|
|
|
1174
1150
|
fromJSON(object: any): Result {
|
|
1175
|
-
return {
|
|
1176
|
-
$type: Result.$type,
|
|
1177
|
-
body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0),
|
|
1178
|
-
};
|
|
1151
|
+
return { $type: Result.$type, body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0) };
|
|
1179
1152
|
},
|
|
1180
1153
|
|
|
1181
1154
|
toJSON(message: Result): unknown {
|
|
@@ -1254,14 +1227,10 @@ export const CancelFlightInfoResult: MessageFns<
|
|
|
1254
1227
|
return obj;
|
|
1255
1228
|
},
|
|
1256
1229
|
|
|
1257
|
-
create<I extends Exact<DeepPartial<CancelFlightInfoResult>, I>>(
|
|
1258
|
-
base?: I,
|
|
1259
|
-
): CancelFlightInfoResult {
|
|
1230
|
+
create<I extends Exact<DeepPartial<CancelFlightInfoResult>, I>>(base?: I): CancelFlightInfoResult {
|
|
1260
1231
|
return CancelFlightInfoResult.fromPartial(base ?? ({} as any));
|
|
1261
1232
|
},
|
|
1262
|
-
fromPartial<I extends Exact<DeepPartial<CancelFlightInfoResult>, I>>(
|
|
1263
|
-
object: I,
|
|
1264
|
-
): CancelFlightInfoResult {
|
|
1233
|
+
fromPartial<I extends Exact<DeepPartial<CancelFlightInfoResult>, I>>(object: I): CancelFlightInfoResult {
|
|
1265
1234
|
const message = createBaseCancelFlightInfoResult() as any;
|
|
1266
1235
|
message.status = object.status ?? 0;
|
|
1267
1236
|
return message;
|
|
@@ -1336,18 +1305,10 @@ export const SchemaResult: MessageFns<SchemaResult, "arrow.flight.protocol.Schem
|
|
|
1336
1305
|
messageTypeRegistry.set(SchemaResult.$type, SchemaResult);
|
|
1337
1306
|
|
|
1338
1307
|
function createBaseFlightDescriptor(): FlightDescriptor {
|
|
1339
|
-
return {
|
|
1340
|
-
$type: "arrow.flight.protocol.FlightDescriptor",
|
|
1341
|
-
type: 0,
|
|
1342
|
-
cmd: new Uint8Array(0),
|
|
1343
|
-
path: [],
|
|
1344
|
-
};
|
|
1308
|
+
return { $type: "arrow.flight.protocol.FlightDescriptor", type: 0, cmd: new Uint8Array(0), path: [] };
|
|
1345
1309
|
}
|
|
1346
1310
|
|
|
1347
|
-
export const FlightDescriptor: MessageFns<
|
|
1348
|
-
FlightDescriptor,
|
|
1349
|
-
"arrow.flight.protocol.FlightDescriptor"
|
|
1350
|
-
> = {
|
|
1311
|
+
export const FlightDescriptor: MessageFns<FlightDescriptor, "arrow.flight.protocol.FlightDescriptor"> = {
|
|
1351
1312
|
$type: "arrow.flight.protocol.FlightDescriptor" as const,
|
|
1352
1313
|
|
|
1353
1314
|
encode(message: FlightDescriptor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
@@ -1408,9 +1369,7 @@ export const FlightDescriptor: MessageFns<
|
|
|
1408
1369
|
$type: FlightDescriptor.$type,
|
|
1409
1370
|
type: isSet(object.type) ? flightDescriptor_DescriptorTypeFromJSON(object.type) : 0,
|
|
1410
1371
|
cmd: isSet(object.cmd) ? bytesFromBase64(object.cmd) : new Uint8Array(0),
|
|
1411
|
-
path: globalThis.Array.isArray(object?.path)
|
|
1412
|
-
? object.path.map((e: any) => globalThis.String(e))
|
|
1413
|
-
: [],
|
|
1372
|
+
path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.String(e)) : [],
|
|
1414
1373
|
};
|
|
1415
1374
|
},
|
|
1416
1375
|
|
|
@@ -1470,17 +1429,13 @@ export const FlightInfo: MessageFns<FlightInfo, "arrow.flight.protocol.FlightInf
|
|
|
1470
1429
|
}
|
|
1471
1430
|
if (message.totalRecords !== 0n) {
|
|
1472
1431
|
if (BigInt.asIntN(64, message.totalRecords) !== message.totalRecords) {
|
|
1473
|
-
throw new globalThis.Error(
|
|
1474
|
-
"value provided for field message.totalRecords of type int64 too large",
|
|
1475
|
-
);
|
|
1432
|
+
throw new globalThis.Error("value provided for field message.totalRecords of type int64 too large");
|
|
1476
1433
|
}
|
|
1477
1434
|
writer.uint32(32).int64(message.totalRecords);
|
|
1478
1435
|
}
|
|
1479
1436
|
if (message.totalBytes !== 0n) {
|
|
1480
1437
|
if (BigInt.asIntN(64, message.totalBytes) !== message.totalBytes) {
|
|
1481
|
-
throw new globalThis.Error(
|
|
1482
|
-
"value provided for field message.totalBytes of type int64 too large",
|
|
1483
|
-
);
|
|
1438
|
+
throw new globalThis.Error("value provided for field message.totalBytes of type int64 too large");
|
|
1484
1439
|
}
|
|
1485
1440
|
writer.uint32(40).int64(message.totalBytes);
|
|
1486
1441
|
}
|
|
@@ -1569,18 +1524,14 @@ export const FlightInfo: MessageFns<FlightInfo, "arrow.flight.protocol.FlightInf
|
|
|
1569
1524
|
return {
|
|
1570
1525
|
$type: FlightInfo.$type,
|
|
1571
1526
|
schema: isSet(object.schema) ? bytesFromBase64(object.schema) : new Uint8Array(0),
|
|
1572
|
-
flightDescriptor: isSet(object.flightDescriptor)
|
|
1573
|
-
? FlightDescriptor.fromJSON(object.flightDescriptor)
|
|
1574
|
-
: undefined,
|
|
1527
|
+
flightDescriptor: isSet(object.flightDescriptor) ? FlightDescriptor.fromJSON(object.flightDescriptor) : undefined,
|
|
1575
1528
|
endpoint: globalThis.Array.isArray(object?.endpoint)
|
|
1576
1529
|
? object.endpoint.map((e: any) => FlightEndpoint.fromJSON(e))
|
|
1577
1530
|
: [],
|
|
1578
1531
|
totalRecords: isSet(object.totalRecords) ? BigInt(object.totalRecords) : 0n,
|
|
1579
1532
|
totalBytes: isSet(object.totalBytes) ? BigInt(object.totalBytes) : 0n,
|
|
1580
1533
|
ordered: isSet(object.ordered) ? globalThis.Boolean(object.ordered) : false,
|
|
1581
|
-
appMetadata: isSet(object.appMetadata)
|
|
1582
|
-
? bytesFromBase64(object.appMetadata)
|
|
1583
|
-
: new Uint8Array(0),
|
|
1534
|
+
appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0),
|
|
1584
1535
|
};
|
|
1585
1536
|
},
|
|
1586
1537
|
|
|
@@ -1616,10 +1567,9 @@ export const FlightInfo: MessageFns<FlightInfo, "arrow.flight.protocol.FlightInf
|
|
|
1616
1567
|
fromPartial<I extends Exact<DeepPartial<FlightInfo>, I>>(object: I): FlightInfo {
|
|
1617
1568
|
const message = createBaseFlightInfo() as any;
|
|
1618
1569
|
message.schema = object.schema ?? new Uint8Array(0);
|
|
1619
|
-
message.flightDescriptor =
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
: undefined;
|
|
1570
|
+
message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null)
|
|
1571
|
+
? FlightDescriptor.fromPartial(object.flightDescriptor)
|
|
1572
|
+
: undefined;
|
|
1623
1573
|
message.endpoint = object.endpoint?.map((e) => FlightEndpoint.fromPartial(e)) || [];
|
|
1624
1574
|
message.totalRecords = object.totalRecords ?? 0n;
|
|
1625
1575
|
message.totalBytes = object.totalBytes ?? 0n;
|
|
@@ -1712,13 +1662,9 @@ export const PollInfo: MessageFns<PollInfo, "arrow.flight.protocol.PollInfo"> =
|
|
|
1712
1662
|
return {
|
|
1713
1663
|
$type: PollInfo.$type,
|
|
1714
1664
|
info: isSet(object.info) ? FlightInfo.fromJSON(object.info) : undefined,
|
|
1715
|
-
flightDescriptor: isSet(object.flightDescriptor)
|
|
1716
|
-
? FlightDescriptor.fromJSON(object.flightDescriptor)
|
|
1717
|
-
: undefined,
|
|
1665
|
+
flightDescriptor: isSet(object.flightDescriptor) ? FlightDescriptor.fromJSON(object.flightDescriptor) : undefined,
|
|
1718
1666
|
progress: isSet(object.progress) ? globalThis.Number(object.progress) : undefined,
|
|
1719
|
-
expirationTime: isSet(object.expirationTime)
|
|
1720
|
-
? fromJsonTimestamp(object.expirationTime)
|
|
1721
|
-
: undefined,
|
|
1667
|
+
expirationTime: isSet(object.expirationTime) ? fromJsonTimestamp(object.expirationTime) : undefined,
|
|
1722
1668
|
};
|
|
1723
1669
|
},
|
|
1724
1670
|
|
|
@@ -1744,14 +1690,12 @@ export const PollInfo: MessageFns<PollInfo, "arrow.flight.protocol.PollInfo"> =
|
|
|
1744
1690
|
},
|
|
1745
1691
|
fromPartial<I extends Exact<DeepPartial<PollInfo>, I>>(object: I): PollInfo {
|
|
1746
1692
|
const message = createBasePollInfo() as any;
|
|
1747
|
-
message.info =
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
? FlightDescriptor.fromPartial(object.flightDescriptor)
|
|
1754
|
-
: undefined;
|
|
1693
|
+
message.info = (object.info !== undefined && object.info !== null)
|
|
1694
|
+
? FlightInfo.fromPartial(object.info)
|
|
1695
|
+
: undefined;
|
|
1696
|
+
message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null)
|
|
1697
|
+
? FlightDescriptor.fromPartial(object.flightDescriptor)
|
|
1698
|
+
: undefined;
|
|
1755
1699
|
message.progress = object.progress ?? undefined;
|
|
1756
1700
|
message.expirationTime = object.expirationTime ?? undefined;
|
|
1757
1701
|
return message;
|
|
@@ -1841,15 +1785,9 @@ export const FlightEndpoint: MessageFns<FlightEndpoint, "arrow.flight.protocol.F
|
|
|
1841
1785
|
return {
|
|
1842
1786
|
$type: FlightEndpoint.$type,
|
|
1843
1787
|
ticket: isSet(object.ticket) ? Ticket.fromJSON(object.ticket) : undefined,
|
|
1844
|
-
location: globalThis.Array.isArray(object?.location)
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
expirationTime: isSet(object.expirationTime)
|
|
1848
|
-
? fromJsonTimestamp(object.expirationTime)
|
|
1849
|
-
: undefined,
|
|
1850
|
-
appMetadata: isSet(object.appMetadata)
|
|
1851
|
-
? bytesFromBase64(object.appMetadata)
|
|
1852
|
-
: new Uint8Array(0),
|
|
1788
|
+
location: globalThis.Array.isArray(object?.location) ? object.location.map((e: any) => Location.fromJSON(e)) : [],
|
|
1789
|
+
expirationTime: isSet(object.expirationTime) ? fromJsonTimestamp(object.expirationTime) : undefined,
|
|
1790
|
+
appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0),
|
|
1853
1791
|
};
|
|
1854
1792
|
},
|
|
1855
1793
|
|
|
@@ -1875,10 +1813,9 @@ export const FlightEndpoint: MessageFns<FlightEndpoint, "arrow.flight.protocol.F
|
|
|
1875
1813
|
},
|
|
1876
1814
|
fromPartial<I extends Exact<DeepPartial<FlightEndpoint>, I>>(object: I): FlightEndpoint {
|
|
1877
1815
|
const message = createBaseFlightEndpoint() as any;
|
|
1878
|
-
message.ticket =
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
: undefined;
|
|
1816
|
+
message.ticket = (object.ticket !== undefined && object.ticket !== null)
|
|
1817
|
+
? Ticket.fromPartial(object.ticket)
|
|
1818
|
+
: undefined;
|
|
1882
1819
|
message.location = object.location?.map((e) => Location.fromPartial(e)) || [];
|
|
1883
1820
|
message.expirationTime = object.expirationTime ?? undefined;
|
|
1884
1821
|
message.appMetadata = object.appMetadata ?? new Uint8Array(0);
|
|
@@ -1989,10 +1926,7 @@ export const Ticket: MessageFns<Ticket, "arrow.flight.protocol.Ticket"> = {
|
|
|
1989
1926
|
},
|
|
1990
1927
|
|
|
1991
1928
|
fromJSON(object: any): Ticket {
|
|
1992
|
-
return {
|
|
1993
|
-
$type: Ticket.$type,
|
|
1994
|
-
ticket: isSet(object.ticket) ? bytesFromBase64(object.ticket) : new Uint8Array(0),
|
|
1995
|
-
};
|
|
1929
|
+
return { $type: Ticket.$type, ticket: isSet(object.ticket) ? bytesFromBase64(object.ticket) : new Uint8Array(0) };
|
|
1996
1930
|
},
|
|
1997
1931
|
|
|
1998
1932
|
toJSON(message: Ticket): unknown {
|
|
@@ -2095,13 +2029,9 @@ export const FlightData: MessageFns<FlightData, "arrow.flight.protocol.FlightDat
|
|
|
2095
2029
|
fromJSON(object: any): FlightData {
|
|
2096
2030
|
return {
|
|
2097
2031
|
$type: FlightData.$type,
|
|
2098
|
-
flightDescriptor: isSet(object.flightDescriptor)
|
|
2099
|
-
? FlightDescriptor.fromJSON(object.flightDescriptor)
|
|
2100
|
-
: undefined,
|
|
2032
|
+
flightDescriptor: isSet(object.flightDescriptor) ? FlightDescriptor.fromJSON(object.flightDescriptor) : undefined,
|
|
2101
2033
|
dataHeader: isSet(object.dataHeader) ? bytesFromBase64(object.dataHeader) : new Uint8Array(0),
|
|
2102
|
-
appMetadata: isSet(object.appMetadata)
|
|
2103
|
-
? bytesFromBase64(object.appMetadata)
|
|
2104
|
-
: new Uint8Array(0),
|
|
2034
|
+
appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0),
|
|
2105
2035
|
dataBody: isSet(object.dataBody) ? bytesFromBase64(object.dataBody) : new Uint8Array(0),
|
|
2106
2036
|
};
|
|
2107
2037
|
},
|
|
@@ -2128,10 +2058,9 @@ export const FlightData: MessageFns<FlightData, "arrow.flight.protocol.FlightDat
|
|
|
2128
2058
|
},
|
|
2129
2059
|
fromPartial<I extends Exact<DeepPartial<FlightData>, I>>(object: I): FlightData {
|
|
2130
2060
|
const message = createBaseFlightData() as any;
|
|
2131
|
-
message.flightDescriptor =
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
: undefined;
|
|
2061
|
+
message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null)
|
|
2062
|
+
? FlightDescriptor.fromPartial(object.flightDescriptor)
|
|
2063
|
+
: undefined;
|
|
2135
2064
|
message.dataHeader = object.dataHeader ?? new Uint8Array(0);
|
|
2136
2065
|
message.appMetadata = object.appMetadata ?? new Uint8Array(0);
|
|
2137
2066
|
message.dataBody = object.dataBody ?? new Uint8Array(0);
|
|
@@ -2182,9 +2111,7 @@ export const PutResult: MessageFns<PutResult, "arrow.flight.protocol.PutResult">
|
|
|
2182
2111
|
fromJSON(object: any): PutResult {
|
|
2183
2112
|
return {
|
|
2184
2113
|
$type: PutResult.$type,
|
|
2185
|
-
appMetadata: isSet(object.appMetadata)
|
|
2186
|
-
? bytesFromBase64(object.appMetadata)
|
|
2187
|
-
: new Uint8Array(0),
|
|
2114
|
+
appMetadata: isSet(object.appMetadata) ? bytesFromBase64(object.appMetadata) : new Uint8Array(0),
|
|
2188
2115
|
};
|
|
2189
2116
|
},
|
|
2190
2117
|
|
|
@@ -2427,10 +2354,7 @@ export interface FlightServiceImplementation<CallContextExt = {}> {
|
|
|
2427
2354
|
* available for consumption for the duration defined by the specific flight
|
|
2428
2355
|
* service.
|
|
2429
2356
|
*/
|
|
2430
|
-
getFlightInfo(
|
|
2431
|
-
request: FlightDescriptor,
|
|
2432
|
-
context: CallContext & CallContextExt,
|
|
2433
|
-
): Promise<DeepPartial<FlightInfo>>;
|
|
2357
|
+
getFlightInfo(request: FlightDescriptor, context: CallContext & CallContextExt): Promise<DeepPartial<FlightInfo>>;
|
|
2434
2358
|
/**
|
|
2435
2359
|
* For a given FlightDescriptor, start a query and get information
|
|
2436
2360
|
* to poll its execution status. This is a useful interface if the
|
|
@@ -2455,30 +2379,21 @@ export interface FlightServiceImplementation<CallContextExt = {}> {
|
|
|
2455
2379
|
* A client may use the CancelFlightInfo action with
|
|
2456
2380
|
* PollInfo.info to cancel the running query.
|
|
2457
2381
|
*/
|
|
2458
|
-
pollFlightInfo(
|
|
2459
|
-
request: FlightDescriptor,
|
|
2460
|
-
context: CallContext & CallContextExt,
|
|
2461
|
-
): Promise<DeepPartial<PollInfo>>;
|
|
2382
|
+
pollFlightInfo(request: FlightDescriptor, context: CallContext & CallContextExt): Promise<DeepPartial<PollInfo>>;
|
|
2462
2383
|
/**
|
|
2463
2384
|
* For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
|
|
2464
2385
|
* This is used when a consumer needs the Schema of flight stream. Similar to
|
|
2465
2386
|
* GetFlightInfo this interface may generate a new flight that was not previously
|
|
2466
2387
|
* available in ListFlights.
|
|
2467
2388
|
*/
|
|
2468
|
-
getSchema(
|
|
2469
|
-
request: FlightDescriptor,
|
|
2470
|
-
context: CallContext & CallContextExt,
|
|
2471
|
-
): Promise<DeepPartial<SchemaResult>>;
|
|
2389
|
+
getSchema(request: FlightDescriptor, context: CallContext & CallContextExt): Promise<DeepPartial<SchemaResult>>;
|
|
2472
2390
|
/**
|
|
2473
2391
|
* Retrieve a single stream associated with a particular descriptor
|
|
2474
2392
|
* associated with the referenced ticket. A Flight can be composed of one or
|
|
2475
2393
|
* more streams where each stream can be retrieved using a separate opaque
|
|
2476
2394
|
* ticket that the flight service uses for managing a collection of streams.
|
|
2477
2395
|
*/
|
|
2478
|
-
doGet(
|
|
2479
|
-
request: Ticket,
|
|
2480
|
-
context: CallContext & CallContextExt,
|
|
2481
|
-
): ServerStreamingMethodResult<DeepPartial<FlightData>>;
|
|
2396
|
+
doGet(request: Ticket, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<FlightData>>;
|
|
2482
2397
|
/**
|
|
2483
2398
|
* Push a stream to the flight service associated with a particular
|
|
2484
2399
|
* flight stream. This allows a client of a flight service to upload a stream
|
|
@@ -2510,10 +2425,7 @@ export interface FlightServiceImplementation<CallContextExt = {}> {
|
|
|
2510
2425
|
* opaque request and response objects that are specific to the type action
|
|
2511
2426
|
* being undertaken.
|
|
2512
2427
|
*/
|
|
2513
|
-
doAction(
|
|
2514
|
-
request: Action,
|
|
2515
|
-
context: CallContext & CallContextExt,
|
|
2516
|
-
): ServerStreamingMethodResult<DeepPartial<Result>>;
|
|
2428
|
+
doAction(request: Action, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<Result>>;
|
|
2517
2429
|
/**
|
|
2518
2430
|
* A flight service exposes all of the available action types that it has
|
|
2519
2431
|
* along with descriptions. This allows different flight consumers to
|
|
@@ -2544,10 +2456,7 @@ export interface FlightServiceClient<CallOptionsExt = {}> {
|
|
|
2544
2456
|
* the subset of streams that can be listed via this interface. Each flight
|
|
2545
2457
|
* service allows its own definition of how to consume criteria.
|
|
2546
2458
|
*/
|
|
2547
|
-
listFlights(
|
|
2548
|
-
request: DeepPartial<Criteria>,
|
|
2549
|
-
options?: CallOptions & CallOptionsExt,
|
|
2550
|
-
): AsyncIterable<FlightInfo>;
|
|
2459
|
+
listFlights(request: DeepPartial<Criteria>, options?: CallOptions & CallOptionsExt): AsyncIterable<FlightInfo>;
|
|
2551
2460
|
/**
|
|
2552
2461
|
* For a given FlightDescriptor, get information about how the flight can be
|
|
2553
2462
|
* consumed. This is a useful interface if the consumer of the interface
|
|
@@ -2560,10 +2469,7 @@ export interface FlightServiceClient<CallOptionsExt = {}> {
|
|
|
2560
2469
|
* available for consumption for the duration defined by the specific flight
|
|
2561
2470
|
* service.
|
|
2562
2471
|
*/
|
|
2563
|
-
getFlightInfo(
|
|
2564
|
-
request: DeepPartial<FlightDescriptor>,
|
|
2565
|
-
options?: CallOptions & CallOptionsExt,
|
|
2566
|
-
): Promise<FlightInfo>;
|
|
2472
|
+
getFlightInfo(request: DeepPartial<FlightDescriptor>, options?: CallOptions & CallOptionsExt): Promise<FlightInfo>;
|
|
2567
2473
|
/**
|
|
2568
2474
|
* For a given FlightDescriptor, start a query and get information
|
|
2569
2475
|
* to poll its execution status. This is a useful interface if the
|
|
@@ -2588,30 +2494,21 @@ export interface FlightServiceClient<CallOptionsExt = {}> {
|
|
|
2588
2494
|
* A client may use the CancelFlightInfo action with
|
|
2589
2495
|
* PollInfo.info to cancel the running query.
|
|
2590
2496
|
*/
|
|
2591
|
-
pollFlightInfo(
|
|
2592
|
-
request: DeepPartial<FlightDescriptor>,
|
|
2593
|
-
options?: CallOptions & CallOptionsExt,
|
|
2594
|
-
): Promise<PollInfo>;
|
|
2497
|
+
pollFlightInfo(request: DeepPartial<FlightDescriptor>, options?: CallOptions & CallOptionsExt): Promise<PollInfo>;
|
|
2595
2498
|
/**
|
|
2596
2499
|
* For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
|
|
2597
2500
|
* This is used when a consumer needs the Schema of flight stream. Similar to
|
|
2598
2501
|
* GetFlightInfo this interface may generate a new flight that was not previously
|
|
2599
2502
|
* available in ListFlights.
|
|
2600
2503
|
*/
|
|
2601
|
-
getSchema(
|
|
2602
|
-
request: DeepPartial<FlightDescriptor>,
|
|
2603
|
-
options?: CallOptions & CallOptionsExt,
|
|
2604
|
-
): Promise<SchemaResult>;
|
|
2504
|
+
getSchema(request: DeepPartial<FlightDescriptor>, options?: CallOptions & CallOptionsExt): Promise<SchemaResult>;
|
|
2605
2505
|
/**
|
|
2606
2506
|
* Retrieve a single stream associated with a particular descriptor
|
|
2607
2507
|
* associated with the referenced ticket. A Flight can be composed of one or
|
|
2608
2508
|
* more streams where each stream can be retrieved using a separate opaque
|
|
2609
2509
|
* ticket that the flight service uses for managing a collection of streams.
|
|
2610
2510
|
*/
|
|
2611
|
-
doGet(
|
|
2612
|
-
request: DeepPartial<Ticket>,
|
|
2613
|
-
options?: CallOptions & CallOptionsExt,
|
|
2614
|
-
): AsyncIterable<FlightData>;
|
|
2511
|
+
doGet(request: DeepPartial<Ticket>, options?: CallOptions & CallOptionsExt): AsyncIterable<FlightData>;
|
|
2615
2512
|
/**
|
|
2616
2513
|
* Push a stream to the flight service associated with a particular
|
|
2617
2514
|
* flight stream. This allows a client of a flight service to upload a stream
|
|
@@ -2643,19 +2540,13 @@ export interface FlightServiceClient<CallOptionsExt = {}> {
|
|
|
2643
2540
|
* opaque request and response objects that are specific to the type action
|
|
2644
2541
|
* being undertaken.
|
|
2645
2542
|
*/
|
|
2646
|
-
doAction(
|
|
2647
|
-
request: DeepPartial<Action>,
|
|
2648
|
-
options?: CallOptions & CallOptionsExt,
|
|
2649
|
-
): AsyncIterable<Result>;
|
|
2543
|
+
doAction(request: DeepPartial<Action>, options?: CallOptions & CallOptionsExt): AsyncIterable<Result>;
|
|
2650
2544
|
/**
|
|
2651
2545
|
* A flight service exposes all of the available action types that it has
|
|
2652
2546
|
* along with descriptions. This allows different flight consumers to
|
|
2653
2547
|
* understand the capabilities of the flight service.
|
|
2654
2548
|
*/
|
|
2655
|
-
listActions(
|
|
2656
|
-
request: DeepPartial<Empty>,
|
|
2657
|
-
options?: CallOptions & CallOptionsExt,
|
|
2658
|
-
): AsyncIterable<ActionType>;
|
|
2549
|
+
listActions(request: DeepPartial<Empty>, options?: CallOptions & CallOptionsExt): AsyncIterable<ActionType>;
|
|
2659
2550
|
}
|
|
2660
2551
|
|
|
2661
2552
|
function bytesFromBase64(b64: string): Uint8Array {
|
|
@@ -2685,24 +2576,17 @@ function base64FromBytes(arr: Uint8Array): string {
|
|
|
2685
2576
|
|
|
2686
2577
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
2687
2578
|
|
|
2688
|
-
export type DeepPartial<T> = T extends Builtin
|
|
2689
|
-
?
|
|
2690
|
-
: T extends
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { readonly $case: T["$case"] }
|
|
2696
|
-
: T extends {}
|
|
2697
|
-
? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
2698
|
-
: Partial<T>;
|
|
2579
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
2580
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
2581
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
2582
|
+
: T extends { readonly $case: string }
|
|
2583
|
+
? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { readonly $case: T["$case"] }
|
|
2584
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
2585
|
+
: Partial<T>;
|
|
2699
2586
|
|
|
2700
2587
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
2701
|
-
export type Exact<P, I extends P> = P extends Builtin
|
|
2702
|
-
|
|
2703
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
|
2704
|
-
[K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
|
|
2705
|
-
};
|
|
2588
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
2589
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
2706
2590
|
|
|
2707
2591
|
function toTimestamp(date: Date): Timestamp {
|
|
2708
2592
|
const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
|
|
@@ -2730,9 +2614,7 @@ function isSet(value: any): boolean {
|
|
|
2730
2614
|
return value !== null && value !== undefined;
|
|
2731
2615
|
}
|
|
2732
2616
|
|
|
2733
|
-
export type ServerStreamingMethodResult<Response> = {
|
|
2734
|
-
[Symbol.asyncIterator](): AsyncIterator<Response, void>;
|
|
2735
|
-
};
|
|
2617
|
+
export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };
|
|
2736
2618
|
|
|
2737
2619
|
export interface MessageFns<T, V extends string> {
|
|
2738
2620
|
readonly $type: V;
|