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