+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+import "google/protobuf/timestamp.proto";
+
+option java_package = "org.apache.arrow.flight.impl";
+option go_package = "github.com/apache/arrow/go/arrow/flight/internal/flight";
+option csharp_namespace = "Apache.Arrow.Flight.Protocol";
+
+package arrow.flight.protocol;
+
+/*
+ * A flight service is an endpoint for retrieving or storing Arrow data. A
+ * flight service can expose one or more predefined endpoints that can be
+ * accessed using the Arrow Flight Protocol. Additionally, a flight service
+ * can expose a set of actions that are available.
+ */
+service FlightService {
+
+ /*
+ * Handshake between client and server. Depending on the server, the
+ * handshake may be required to determine the token that should be used for
+ * future operations. Both request and response are streams to allow multiple
+ * round-trips depending on auth mechanism.
+ */
+ rpc Handshake(stream HandshakeRequest) returns (stream HandshakeResponse) {}
+
+ /*
+ * Get a list of available streams given a particular criteria. Most flight
+ * services will expose one or more streams that are readily available for
+ * retrieval. This api allows listing the streams available for
+ * consumption. A user can also provide a criteria. The criteria can limit
+ * the subset of streams that can be listed via this interface. Each flight
+ * service allows its own definition of how to consume criteria.
+ */
+ rpc ListFlights(Criteria) returns (stream FlightInfo) {}
+
+ /*
+ * For a given FlightDescriptor, get information about how the flight can be
+ * consumed. This is a useful interface if the consumer of the interface
+ * already can identify the specific flight to consume. This interface can
+ * also allow a consumer to generate a flight stream through a specified
+ * descriptor. For example, a flight descriptor might be something that
+ * includes a SQL statement or a Pickled Python operation that will be
+ * executed. In those cases, the descriptor will not be previously available
+ * within the list of available streams provided by ListFlights but will be
+ * available for consumption for the duration defined by the specific flight
+ * service.
+ */
+ rpc GetFlightInfo(FlightDescriptor) returns (FlightInfo) {}
+
+ /*
+ * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
+ * This is used when a consumer needs the Schema of flight stream. Similar to
+ * GetFlightInfo this interface may generate a new flight that was not previously
+ * available in ListFlights.
+ */
+ rpc GetSchema(FlightDescriptor) returns (SchemaResult) {}
+
+ /*
+ * Retrieve a single stream associated with a particular descriptor
+ * associated with the referenced ticket. A Flight can be composed of one or
+ * more streams where each stream can be retrieved using a separate opaque
+ * ticket that the flight service uses for managing a collection of streams.
+ */
+ rpc DoGet(Ticket) returns (stream FlightData) {}
+
+ /*
+ * Push a stream to the flight service associated with a particular
+ * flight stream. This allows a client of a flight service to upload a stream
+ * of data. Depending on the particular flight service, a client consumer
+ * could be allowed to upload a single stream per descriptor or an unlimited
+ * number. In the latter, the service might implement a 'seal' action that
+ * can be applied to a descriptor once all streams are uploaded.
+ */
+ rpc DoPut(stream FlightData) returns (stream PutResult) {}
+
+ /*
+ * Open a bidirectional data channel for a given descriptor. This
+ * allows clients to send and receive arbitrary Arrow data and
+ * application-specific metadata in a single logical stream. In
+ * contrast to DoGet/DoPut, this is more suited for clients
+ * offloading computation (rather than storage) to a Flight service.
+ */
+ rpc DoExchange(stream FlightData) returns (stream FlightData) {}
+
+ /*
+ * Flight services can support an arbitrary number of simple actions in
+ * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
+ * operations that are potentially available. DoAction allows a flight client
+ * to do a specific action against a flight service. An action includes
+ * opaque request and response objects that are specific to the type action
+ * being undertaken.
+ */
+ rpc DoAction(Action) returns (stream Result) {}
+
+ /*
+ * A flight service exposes all of the available action types that it has
+ * along with descriptions. This allows different flight consumers to
+ * understand the capabilities of the flight service.
+ */
+ rpc ListActions(Empty) returns (stream ActionType) {}
+
+}
+
+/*
+ * The request that a client provides to a server on handshake.
+ */
+message HandshakeRequest {
+
+ /*
+ * A defined protocol version
+ */
+ uint64 protocol_version = 1;
+
+ /*
+ * Arbitrary auth/handshake info.
+ */
+ bytes payload = 2;
+}
+
+message HandshakeResponse {
+
+ /*
+ * A defined protocol version
+ */
+ uint64 protocol_version = 1;
+
+ /*
+ * Arbitrary auth/handshake info.
+ */
+ bytes payload = 2;
+}
+
+/*
+ * A message for doing simple auth.
+ */
+message BasicAuth {
+ string username = 2;
+ string password = 3;
+}
+
+message Empty {}
+
+/*
+ * Describes an available action, including both the name used for execution
+ * along with a short description of the purpose of the action.
+ */
+message ActionType {
+ string type = 1;
+ string description = 2;
+}
+
+/*
+ * A service specific expression that can be used to return a limited set
+ * of available Arrow Flight streams.
+ */
+message Criteria {
+ bytes expression = 1;
+}
+
+/*
+ * An opaque action specific for the service.
+ */
+message Action {
+ string type = 1;
+ bytes body = 2;
+}
+
+/*
+ * The request of the CancelFlightInfo action.
+ *
+ * The request should be stored in Action.body.
+ */
+message CancelFlightInfoRequest {
+ FlightInfo info = 1;
+}
+
+/*
+ * The request of the RenewFlightEndpoint action.
+ *
+ * The request should be stored in Action.body.
+ */
+message RenewFlightEndpointRequest {
+ FlightEndpoint endpoint = 1;
+}
+
+/*
+ * An opaque result returned after executing an action.
+ */
+message Result {
+ bytes body = 1;
+}
+
+/*
+ * The result of a cancel operation.
+ *
+ * This is used by CancelFlightInfoResult.status.
+ */
+enum CancelStatus {
+ // The cancellation status is unknown. Servers should avoid using
+ // this value (send a NOT_FOUND error if the requested query is
+ // not known). Clients can retry the request.
+ CANCEL_STATUS_UNSPECIFIED = 0;
+ // The cancellation request is complete. Subsequent requests with
+ // the same payload may return CANCELLED or a NOT_FOUND error.
+ CANCEL_STATUS_CANCELLED = 1;
+ // The cancellation request is in progress. The client may retry
+ // the cancellation request.
+ CANCEL_STATUS_CANCELLING = 2;
+ // The query is not cancellable. The client should not retry the
+ // cancellation request.
+ CANCEL_STATUS_NOT_CANCELLABLE = 3;
+}
+
+/*
+ * The result of the CancelFlightInfo action.
+ *
+ * The result should be stored in Result.body.
+ */
+message CancelFlightInfoResult {
+ CancelStatus status = 1;
+}
+
+/*
+ * Wrap the result of a getSchema call
+ */
+message SchemaResult {
+ // The schema of the dataset in its IPC form:
+ // 4 bytes - an optional IPC_CONTINUATION_TOKEN prefix
+ // 4 bytes - the byte length of the payload
+ // a flatbuffer Message whose header is the Schema
+ bytes schema = 1;
+}
+
+/*
+ * The name or tag for a Flight. May be used as a way to retrieve or generate
+ * a flight or be used to expose a set of previously defined flights.
+ */
+message FlightDescriptor {
+
+ /*
+ * Describes what type of descriptor is defined.
+ */
+ enum DescriptorType {
+
+ // Protobuf pattern, not used.
+ UNKNOWN = 0;
+
+ /*
+ * A named path that identifies a dataset. A path is composed of a string
+ * or list of strings describing a particular dataset. This is conceptually
+ * similar to a path inside a filesystem.
+ */
+ PATH = 1;
+
+ /*
+ * An opaque command to generate a dataset.
+ */
+ CMD = 2;
+ }
+
+ DescriptorType type = 1;
+
+ /*
+ * Opaque value used to express a command. Should only be defined when
+ * type = CMD.
+ */
+ bytes cmd = 2;
+
+ /*
+ * List of strings identifying a particular dataset. Should only be defined
+ * when type = PATH.
+ */
+ repeated string path = 3;
+}
+
+/*
+ * The access coordinates for retrieval of a dataset. With a FlightInfo, a
+ * consumer is able to determine how to retrieve a dataset.
+ */
+message FlightInfo {
+ // The schema of the dataset in its IPC form:
+ // 4 bytes - an optional IPC_CONTINUATION_TOKEN prefix
+ // 4 bytes - the byte length of the payload
+ // a flatbuffer Message whose header is the Schema
+ bytes schema = 1;
+
+ /*
+ * The descriptor associated with this info.
+ */
+ FlightDescriptor flight_descriptor = 2;
+
+ /*
+ * A list of endpoints associated with the flight. To consume the
+ * whole flight, all endpoints (and hence all Tickets) must be
+ * consumed. Endpoints can be consumed in any order.
+ *
+ * In other words, an application can use multiple endpoints to
+ * represent partitioned data.
+ *
+ * If the returned data has an ordering, an application can use
+ * "FlightInfo.ordered = true" or should return the all data in a
+ * single endpoint. Otherwise, there is no ordering defined on
+ * endpoints or the data within.
+ *
+ * A client can read ordered data by reading data from returned
+ * endpoints, in order, from front to back.
+ *
+ * Note that a client may ignore "FlightInfo.ordered = true". If an
+ * ordering is important for an application, an application must
+ * choose one of them:
+ *
+ * * An application requires that all clients must read data in
+ * returned endpoints order.
+ * * An application must return the all data in a single endpoint.
+ */
+ repeated FlightEndpoint endpoint = 3;
+
+ // Set these to -1 if unknown.
+ int64 total_records = 4;
+ int64 total_bytes = 5;
+
+ /*
+ * FlightEndpoints are in the same order as the data.
+ */
+ bool ordered = 6;
+}
+
+/*
+ * A particular stream or split associated with a flight.
+ */
+message FlightEndpoint {
+
+ /*
+ * Token used to retrieve this stream.
+ */
+ Ticket ticket = 1;
+
+ /*
+ * A list of URIs where this ticket can be redeemed via DoGet().
+ *
+ * If the list is empty, the expectation is that the ticket can only
+ * be redeemed on the current service where the ticket was
+ * generated.
+ *
+ * If the list is not empty, the expectation is that the ticket can
+ * be redeemed at any of the locations, and that the data returned
+ * will be equivalent. In this case, the ticket may only be redeemed
+ * at one of the given locations, and not (necessarily) on the
+ * current service.
+ *
+ * In other words, an application can use multiple locations to
+ * represent redundant and/or load balanced services.
+ */
+ repeated Location location = 2;
+
+ /*
+ * Expiration time of this stream. If present, clients may assume
+ * they can retry DoGet requests. Otherwise, it is
+ * application-defined whether DoGet requests may be retried.
+ */
+ google.protobuf.Timestamp expiration_time = 3;
+}
+
+/*
+ * A location where a Flight service will accept retrieval of a particular
+ * stream given a ticket.
+ */
+message Location {
+ string uri = 1;
+}
+
+/*
+ * An opaque identifier that the service can use to retrieve a particular
+ * portion of a stream.
+ *
+ * Tickets are meant to be single use. It is an error/application-defined
+ * behavior to reuse a ticket.
+ */
+message Ticket {
+ bytes ticket = 1;
+}
+
+/*
+ * A batch of Arrow data as part of a stream of batches.
+ */
+message FlightData {
+
+ /*
+ * The descriptor of the data. This is only relevant when a client is
+ * starting a new DoPut stream.
+ */
+ FlightDescriptor flight_descriptor = 1;
+
+ /*
+ * Header for message data as described in Message.fbs::Message.
+ */
+ bytes data_header = 2;
+
+ /*
+ * Application-defined metadata.
+ */
+ bytes app_metadata = 3;
+
+ /*
+ * The actual batch of Arrow data. Preferably handled with minimal-copies
+ * coming last in the definition to help with sidecar patterns (it is
+ * expected that some implementations will fetch this field off the wire
+ * with specialized code to avoid extra memory copies).
+ */
+ bytes data_body = 1000;
+}
+
+/**
+ * The response message associated with the submission of a DoPut.
+ */
+message PutResult {
+ bytes app_metadata = 1;
+}
\ No newline at end of file
diff --git a/src/assets/arrow.ts b/src/assets/arrow.ts
new file mode 100644
index 00000000..24107916
--- /dev/null
+++ b/src/assets/arrow.ts
@@ -0,0 +1,1703 @@
+/* eslint-disable */
+import type { CallContext, CallOptions } from "nice-grpc-common";
+import * as _m0 from "protobufjs/minimal";
+import { Timestamp } from "./google/protobuf/timestamp";
+import Long from "long";
+export const protobufPackage = "arrow.flight.protocol";
+
+/**
+ * The result of a cancel operation.
+ *
+ * This is used by CancelFlightInfoResult.status.
+ */
+export enum CancelStatus {
+ /**
+ * CANCEL_STATUS_UNSPECIFIED - The cancellation status is unknown. Servers should avoid using
+ * this value (send a NOT_FOUND error if the requested query is
+ * not known). Clients can retry the request.
+ */
+ CANCEL_STATUS_UNSPECIFIED = 0,
+ /**
+ * CANCEL_STATUS_CANCELLED - The cancellation request is complete. Subsequent requests with
+ * the same payload may return CANCELLED or a NOT_FOUND error.
+ */
+ CANCEL_STATUS_CANCELLED = 1,
+ /**
+ * CANCEL_STATUS_CANCELLING - The cancellation request is in progress. The client may retry
+ * the cancellation request.
+ */
+ CANCEL_STATUS_CANCELLING = 2,
+ /**
+ * CANCEL_STATUS_NOT_CANCELLABLE - The query is not cancellable. The client should not retry the
+ * cancellation request.
+ */
+ CANCEL_STATUS_NOT_CANCELLABLE = 3,
+ UNRECOGNIZED = -1,
+}
+
+/** The request that a client provides to a server on handshake. */
+export interface HandshakeRequest {
+ /** A defined protocol version */
+ protocolVersion: number;
+ /** Arbitrary auth/handshake info. */
+ payload: Uint8Array;
+}
+
+export interface HandshakeResponse {
+ /** A defined protocol version */
+ protocolVersion: number;
+ /** Arbitrary auth/handshake info. */
+ payload: Uint8Array;
+}
+
+/** A message for doing simple auth. */
+export interface BasicAuth {
+ username: string;
+ password: string;
+}
+
+export interface Empty {
+}
+
+/**
+ * Describes an available action, including both the name used for execution
+ * along with a short description of the purpose of the action.
+ */
+export interface ActionType {
+ type: string;
+ description: string;
+}
+
+/**
+ * A service specific expression that can be used to return a limited set
+ * of available Arrow Flight streams.
+ */
+export interface Criteria {
+ expression: Uint8Array;
+}
+
+/** An opaque action specific for the service. */
+export interface Action {
+ type: string;
+ body: Uint8Array;
+}
+
+/**
+ * The request of the CancelFlightInfo action.
+ *
+ * The request should be stored in Action.body.
+ */
+export interface CancelFlightInfoRequest {
+ info: FlightInfo | undefined;
+}
+
+/**
+ * The request of the RenewFlightEndpoint action.
+ *
+ * The request should be stored in Action.body.
+ */
+export interface RenewFlightEndpointRequest {
+ endpoint: FlightEndpoint | undefined;
+}
+
+/** An opaque result returned after executing an action. */
+export interface Result {
+ body: Uint8Array;
+}
+
+/**
+ * The result of the CancelFlightInfo action.
+ *
+ * The result should be stored in Result.body.
+ */
+export interface CancelFlightInfoResult {
+ status: CancelStatus;
+}
+
+/** Wrap the result of a getSchema call */
+export interface SchemaResult {
+ /**
+ * The schema of the dataset in its IPC form:
+ * 4 bytes - an optional IPC_CONTINUATION_TOKEN prefix
+ * 4 bytes - the byte length of the payload
+ * a flatbuffer Message whose header is the Schema
+ */
+ schema: Uint8Array;
+}
+
+/**
+ * The name or tag for a Flight. May be used as a way to retrieve or generate
+ * a flight or be used to expose a set of previously defined flights.
+ */
+export interface FlightDescriptor {
+ type: FlightDescriptor_DescriptorType;
+ /**
+ * Opaque value used to express a command. Should only be defined when
+ * type = CMD.
+ */
+ cmd: Uint8Array;
+ /**
+ * List of strings identifying a particular dataset. Should only be defined
+ * when type = PATH.
+ */
+ path: string[];
+}
+
+/** Describes what type of descriptor is defined. */
+export enum FlightDescriptor_DescriptorType {
+ /** UNKNOWN - Protobuf pattern, not used. */
+ UNKNOWN = 0,
+ /**
+ * PATH - A named path that identifies a dataset. A path is composed of a string
+ * or list of strings describing a particular dataset. This is conceptually
+ * similar to a path inside a filesystem.
+ */
+ PATH = 1,
+ /** CMD - An opaque command to generate a dataset. */
+ CMD = 2,
+ UNRECOGNIZED = -1,
+}
+
+/**
+ * The access coordinates for retrieval of a dataset. With a FlightInfo, a
+ * consumer is able to determine how to retrieve a dataset.
+ */
+export interface FlightInfo {
+ /**
+ * The schema of the dataset in its IPC form:
+ * 4 bytes - an optional IPC_CONTINUATION_TOKEN prefix
+ * 4 bytes - the byte length of the payload
+ * a flatbuffer Message whose header is the Schema
+ */
+ schema: Uint8Array;
+ /** The descriptor associated with this info. */
+ flightDescriptor:
+ | FlightDescriptor
+ | undefined;
+ /**
+ * A list of endpoints associated with the flight. To consume the
+ * whole flight, all endpoints (and hence all Tickets) must be
+ * consumed. Endpoints can be consumed in any order.
+ *
+ * In other words, an application can use multiple endpoints to
+ * represent partitioned data.
+ *
+ * If the returned data has an ordering, an application can use
+ * "FlightInfo.ordered = true" or should return the all data in a
+ * single endpoint. Otherwise, there is no ordering defined on
+ * endpoints or the data within.
+ *
+ * A client can read ordered data by reading data from returned
+ * endpoints, in order, from front to back.
+ *
+ * Note that a client may ignore "FlightInfo.ordered = true". If an
+ * ordering is important for an application, an application must
+ * choose one of them:
+ *
+ * * An application requires that all clients must read data in
+ * returned endpoints order.
+ * * An application must return the all data in a single endpoint.
+ */
+ endpoint: FlightEndpoint[];
+ /** Set these to -1 if unknown. */
+ totalRecords: number;
+ totalBytes: number;
+ /** FlightEndpoints are in the same order as the data. */
+ ordered: boolean;
+}
+
+/** A particular stream or split associated with a flight. */
+export interface FlightEndpoint {
+ /** Token used to retrieve this stream. */
+ ticket:
+ | Ticket
+ | undefined;
+ /**
+ * A list of URIs where this ticket can be redeemed via DoGet().
+ *
+ * If the list is empty, the expectation is that the ticket can only
+ * be redeemed on the current service where the ticket was
+ * generated.
+ *
+ * If the list is not empty, the expectation is that the ticket can
+ * be redeemed at any of the locations, and that the data returned
+ * will be equivalent. In this case, the ticket may only be redeemed
+ * at one of the given locations, and not (necessarily) on the
+ * current service.
+ *
+ * In other words, an application can use multiple locations to
+ * represent redundant and/or load balanced services.
+ */
+ location: Location[];
+ /**
+ * Expiration time of this stream. If present, clients may assume
+ * they can retry DoGet requests. Otherwise, it is
+ * application-defined whether DoGet requests may be retried.
+ */
+ expirationTime: Date | undefined;
+}
+
+/**
+ * A location where a Flight service will accept retrieval of a particular
+ * stream given a ticket.
+ */
+export interface Location {
+ uri: string;
+}
+
+/**
+ * An opaque identifier that the service can use to retrieve a particular
+ * portion of a stream.
+ *
+ * Tickets are meant to be single use. It is an error/application-defined
+ * behavior to reuse a ticket.
+ */
+export interface Ticket {
+ ticket: Uint8Array;
+}
+
+/** A batch of Arrow data as part of a stream of batches. */
+export interface FlightData {
+ /**
+ * The descriptor of the data. This is only relevant when a client is
+ * starting a new DoPut stream.
+ */
+ flightDescriptor:
+ | FlightDescriptor
+ | undefined;
+ /** Header for message data as described in Message.fbs::Message. */
+ dataHeader: Uint8Array;
+ /** Application-defined metadata. */
+ appMetadata: Uint8Array;
+ /**
+ * The actual batch of Arrow data. Preferably handled with minimal-copies
+ * coming last in the definition to help with sidecar patterns (it is
+ * expected that some implementations will fetch this field off the wire
+ * with specialized code to avoid extra memory copies).
+ */
+ dataBody: Uint8Array;
+}
+
+/** The response message associated with the submission of a DoPut. */
+export interface PutResult {
+ appMetadata: Uint8Array;
+}
+
+function createBaseHandshakeRequest(): HandshakeRequest {
+ return { protocolVersion: 0, payload: new Uint8Array(0) };
+}
+
+export const HandshakeRequest = {
+ encode(message: HandshakeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.protocolVersion !== 0) {
+ writer.uint32(8).uint64(message.protocolVersion);
+ }
+ if (message.payload.length !== 0) {
+ writer.uint32(18).bytes(message.payload);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): HandshakeRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseHandshakeRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.protocolVersion = longToNumber(reader.uint64() as Long);
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.payload = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): HandshakeRequest {
+ return HandshakeRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): HandshakeRequest {
+ const message = createBaseHandshakeRequest();
+ message.protocolVersion = object.protocolVersion ?? 0;
+ message.payload = object.payload ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseHandshakeResponse(): HandshakeResponse {
+ return { protocolVersion: 0, payload: new Uint8Array(0) };
+}
+
+export const HandshakeResponse = {
+ encode(message: HandshakeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.protocolVersion !== 0) {
+ writer.uint32(8).uint64(message.protocolVersion);
+ }
+ if (message.payload.length !== 0) {
+ writer.uint32(18).bytes(message.payload);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): HandshakeResponse {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseHandshakeResponse();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.protocolVersion = longToNumber(reader.uint64() as Long);
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.payload = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): HandshakeResponse {
+ return HandshakeResponse.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): HandshakeResponse {
+ const message = createBaseHandshakeResponse();
+ message.protocolVersion = object.protocolVersion ?? 0;
+ message.payload = object.payload ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseBasicAuth(): BasicAuth {
+ return { username: "", password: "" };
+}
+
+export const BasicAuth = {
+ encode(message: BasicAuth, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.username !== "") {
+ writer.uint32(18).string(message.username);
+ }
+ if (message.password !== "") {
+ writer.uint32(26).string(message.password);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): BasicAuth {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseBasicAuth();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.username = reader.string();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.password = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): BasicAuth {
+ return BasicAuth.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): BasicAuth {
+ const message = createBaseBasicAuth();
+ message.username = object.username ?? "";
+ message.password = object.password ?? "";
+ return message;
+ },
+};
+
+function createBaseEmpty(): Empty {
+ return {};
+}
+
+export const Empty = {
+ encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Empty {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseEmpty();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Empty {
+ return Empty.fromPartial(base ?? {});
+ },
+ fromPartial(_: DeepPartial): Empty {
+ const message = createBaseEmpty();
+ return message;
+ },
+};
+
+function createBaseActionType(): ActionType {
+ return { type: "", description: "" };
+}
+
+export const ActionType = {
+ encode(message: ActionType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.type !== "") {
+ writer.uint32(10).string(message.type);
+ }
+ if (message.description !== "") {
+ writer.uint32(18).string(message.description);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ActionType {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseActionType();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.type = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.description = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): ActionType {
+ return ActionType.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): ActionType {
+ const message = createBaseActionType();
+ message.type = object.type ?? "";
+ message.description = object.description ?? "";
+ return message;
+ },
+};
+
+function createBaseCriteria(): Criteria {
+ return { expression: new Uint8Array(0) };
+}
+
+export const Criteria = {
+ encode(message: Criteria, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.expression.length !== 0) {
+ writer.uint32(10).bytes(message.expression);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Criteria {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseCriteria();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.expression = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Criteria {
+ return Criteria.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): Criteria {
+ const message = createBaseCriteria();
+ message.expression = object.expression ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseAction(): Action {
+ return { type: "", body: new Uint8Array(0) };
+}
+
+export const Action = {
+ encode(message: Action, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.type !== "") {
+ writer.uint32(10).string(message.type);
+ }
+ if (message.body.length !== 0) {
+ writer.uint32(18).bytes(message.body);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Action {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseAction();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.type = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.body = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Action {
+ return Action.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): Action {
+ const message = createBaseAction();
+ message.type = object.type ?? "";
+ message.body = object.body ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseCancelFlightInfoRequest(): CancelFlightInfoRequest {
+ return { info: undefined };
+}
+
+export const CancelFlightInfoRequest = {
+ encode(message: CancelFlightInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.info !== undefined) {
+ FlightInfo.encode(message.info, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): CancelFlightInfoRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseCancelFlightInfoRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.info = FlightInfo.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): CancelFlightInfoRequest {
+ return CancelFlightInfoRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): CancelFlightInfoRequest {
+ const message = createBaseCancelFlightInfoRequest();
+ message.info = (object.info !== undefined && object.info !== null)
+ ? FlightInfo.fromPartial(object.info)
+ : undefined;
+ return message;
+ },
+};
+
+function createBaseRenewFlightEndpointRequest(): RenewFlightEndpointRequest {
+ return { endpoint: undefined };
+}
+
+export const RenewFlightEndpointRequest = {
+ encode(message: RenewFlightEndpointRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.endpoint !== undefined) {
+ FlightEndpoint.encode(message.endpoint, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): RenewFlightEndpointRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseRenewFlightEndpointRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.endpoint = FlightEndpoint.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): RenewFlightEndpointRequest {
+ return RenewFlightEndpointRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): RenewFlightEndpointRequest {
+ const message = createBaseRenewFlightEndpointRequest();
+ message.endpoint = (object.endpoint !== undefined && object.endpoint !== null)
+ ? FlightEndpoint.fromPartial(object.endpoint)
+ : undefined;
+ return message;
+ },
+};
+
+function createBaseResult(): Result {
+ return { body: new Uint8Array(0) };
+}
+
+export const Result = {
+ encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.body.length !== 0) {
+ writer.uint32(10).bytes(message.body);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Result {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseResult();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.body = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Result {
+ return Result.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): Result {
+ const message = createBaseResult();
+ message.body = object.body ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseCancelFlightInfoResult(): CancelFlightInfoResult {
+ return { status: 0 };
+}
+
+export const CancelFlightInfoResult = {
+ encode(message: CancelFlightInfoResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.status !== 0) {
+ writer.uint32(8).int32(message.status);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): CancelFlightInfoResult {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseCancelFlightInfoResult();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.status = reader.int32() as any;
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): CancelFlightInfoResult {
+ return CancelFlightInfoResult.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): CancelFlightInfoResult {
+ const message = createBaseCancelFlightInfoResult();
+ message.status = object.status ?? 0;
+ return message;
+ },
+};
+
+function createBaseSchemaResult(): SchemaResult {
+ return { schema: new Uint8Array(0) };
+}
+
+export const SchemaResult = {
+ encode(message: SchemaResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.schema.length !== 0) {
+ writer.uint32(10).bytes(message.schema);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SchemaResult {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSchemaResult();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.schema = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): SchemaResult {
+ return SchemaResult.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): SchemaResult {
+ const message = createBaseSchemaResult();
+ message.schema = object.schema ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseFlightDescriptor(): FlightDescriptor {
+ return { type: 0, cmd: new Uint8Array(0), path: [] };
+}
+
+export const FlightDescriptor = {
+ encode(message: FlightDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.type !== 0) {
+ writer.uint32(8).int32(message.type);
+ }
+ if (message.cmd.length !== 0) {
+ writer.uint32(18).bytes(message.cmd);
+ }
+ for (const v of message.path) {
+ writer.uint32(26).string(v!);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): FlightDescriptor {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFlightDescriptor();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.type = reader.int32() as any;
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.cmd = reader.bytes();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.path.push(reader.string());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): FlightDescriptor {
+ return FlightDescriptor.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): FlightDescriptor {
+ const message = createBaseFlightDescriptor();
+ message.type = object.type ?? 0;
+ message.cmd = object.cmd ?? new Uint8Array(0);
+ message.path = object.path?.map((e) => e) || [];
+ return message;
+ },
+};
+
+function createBaseFlightInfo(): FlightInfo {
+ return {
+ schema: new Uint8Array(0),
+ flightDescriptor: undefined,
+ endpoint: [],
+ totalRecords: 0,
+ totalBytes: 0,
+ ordered: false,
+ };
+}
+
+export const FlightInfo = {
+ encode(message: FlightInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.schema.length !== 0) {
+ writer.uint32(10).bytes(message.schema);
+ }
+ if (message.flightDescriptor !== undefined) {
+ FlightDescriptor.encode(message.flightDescriptor, writer.uint32(18).fork()).ldelim();
+ }
+ for (const v of message.endpoint) {
+ FlightEndpoint.encode(v!, writer.uint32(26).fork()).ldelim();
+ }
+ if (message.totalRecords !== 0) {
+ writer.uint32(32).int64(message.totalRecords);
+ }
+ if (message.totalBytes !== 0) {
+ writer.uint32(40).int64(message.totalBytes);
+ }
+ if (message.ordered === true) {
+ writer.uint32(48).bool(message.ordered);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): FlightInfo {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFlightInfo();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.schema = reader.bytes();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.flightDescriptor = FlightDescriptor.decode(reader, reader.uint32());
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.endpoint.push(FlightEndpoint.decode(reader, reader.uint32()));
+ continue;
+ case 4:
+ if (tag !== 32) {
+ break;
+ }
+
+ message.totalRecords = longToNumber(reader.int64() as Long);
+ continue;
+ case 5:
+ if (tag !== 40) {
+ break;
+ }
+
+ message.totalBytes = longToNumber(reader.int64() as Long);
+ continue;
+ case 6:
+ if (tag !== 48) {
+ break;
+ }
+
+ message.ordered = reader.bool();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): FlightInfo {
+ return FlightInfo.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): FlightInfo {
+ const message = createBaseFlightInfo();
+ message.schema = object.schema ?? new Uint8Array(0);
+ message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null)
+ ? FlightDescriptor.fromPartial(object.flightDescriptor)
+ : undefined;
+ message.endpoint = object.endpoint?.map((e) => FlightEndpoint.fromPartial(e)) || [];
+ message.totalRecords = object.totalRecords ?? 0;
+ message.totalBytes = object.totalBytes ?? 0;
+ message.ordered = object.ordered ?? false;
+ return message;
+ },
+};
+
+function createBaseFlightEndpoint(): FlightEndpoint {
+ return { ticket: undefined, location: [], expirationTime: undefined };
+}
+
+export const FlightEndpoint = {
+ encode(message: FlightEndpoint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.ticket !== undefined) {
+ Ticket.encode(message.ticket, writer.uint32(10).fork()).ldelim();
+ }
+ for (const v of message.location) {
+ Location.encode(v!, writer.uint32(18).fork()).ldelim();
+ }
+ if (message.expirationTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.expirationTime), writer.uint32(26).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): FlightEndpoint {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFlightEndpoint();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.ticket = Ticket.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.location.push(Location.decode(reader, reader.uint32()));
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.expirationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): FlightEndpoint {
+ return FlightEndpoint.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): FlightEndpoint {
+ const message = createBaseFlightEndpoint();
+ message.ticket = (object.ticket !== undefined && object.ticket !== null)
+ ? Ticket.fromPartial(object.ticket)
+ : undefined;
+ message.location = object.location?.map((e) => Location.fromPartial(e)) || [];
+ message.expirationTime = object.expirationTime ?? undefined;
+ return message;
+ },
+};
+
+function createBaseLocation(): Location {
+ return { uri: "" };
+}
+
+export const Location = {
+ encode(message: Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.uri !== "") {
+ writer.uint32(10).string(message.uri);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Location {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseLocation();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.uri = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Location {
+ return Location.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): Location {
+ const message = createBaseLocation();
+ message.uri = object.uri ?? "";
+ return message;
+ },
+};
+
+function createBaseTicket(): Ticket {
+ return { ticket: new Uint8Array(0) };
+}
+
+export const Ticket = {
+ encode(message: Ticket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.ticket.length !== 0) {
+ writer.uint32(10).bytes(message.ticket);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Ticket {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseTicket();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.ticket = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Ticket {
+ return Ticket.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): Ticket {
+ const message = createBaseTicket();
+ message.ticket = object.ticket ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBaseFlightData(): FlightData {
+ return {
+ flightDescriptor: undefined,
+ dataHeader: new Uint8Array(0),
+ appMetadata: new Uint8Array(0),
+ dataBody: new Uint8Array(0),
+ };
+}
+
+export const FlightData = {
+ encode(message: FlightData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.flightDescriptor !== undefined) {
+ FlightDescriptor.encode(message.flightDescriptor, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.dataHeader.length !== 0) {
+ writer.uint32(18).bytes(message.dataHeader);
+ }
+ if (message.appMetadata.length !== 0) {
+ writer.uint32(26).bytes(message.appMetadata);
+ }
+ if (message.dataBody.length !== 0) {
+ writer.uint32(8002).bytes(message.dataBody);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): FlightData {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseFlightData();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.flightDescriptor = FlightDescriptor.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.dataHeader = reader.bytes();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.appMetadata = reader.bytes();
+ continue;
+ case 1000:
+ if (tag !== 8002) {
+ break;
+ }
+
+ message.dataBody = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): FlightData {
+ return FlightData.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): FlightData {
+ const message = createBaseFlightData();
+ message.flightDescriptor = (object.flightDescriptor !== undefined && object.flightDescriptor !== null)
+ ? FlightDescriptor.fromPartial(object.flightDescriptor)
+ : undefined;
+ message.dataHeader = object.dataHeader ?? new Uint8Array(0);
+ message.appMetadata = object.appMetadata ?? new Uint8Array(0);
+ message.dataBody = object.dataBody ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+function createBasePutResult(): PutResult {
+ return { appMetadata: new Uint8Array(0) };
+}
+
+export const PutResult = {
+ encode(message: PutResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.appMetadata.length !== 0) {
+ writer.uint32(10).bytes(message.appMetadata);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): PutResult {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBasePutResult();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.appMetadata = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): PutResult {
+ return PutResult.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): PutResult {
+ const message = createBasePutResult();
+ message.appMetadata = object.appMetadata ?? new Uint8Array(0);
+ return message;
+ },
+};
+
+/**
+ * A flight service is an endpoint for retrieving or storing Arrow data. A
+ * flight service can expose one or more predefined endpoints that can be
+ * accessed using the Arrow Flight Protocol. Additionally, a flight service
+ * can expose a set of actions that are available.
+ */
+export type FlightServiceDefinition = typeof FlightServiceDefinition;
+export const FlightServiceDefinition = {
+ name: "FlightService",
+ fullName: "arrow.flight.protocol.FlightService",
+ methods: {
+ /**
+ * Handshake between client and server. Depending on the server, the
+ * handshake may be required to determine the token that should be used for
+ * future operations. Both request and response are streams to allow multiple
+ * round-trips depending on auth mechanism.
+ */
+ handshake: {
+ name: "Handshake",
+ requestType: HandshakeRequest,
+ requestStream: true,
+ responseType: HandshakeResponse,
+ responseStream: true,
+ options: {},
+ },
+ /**
+ * Get a list of available streams given a particular criteria. Most flight
+ * services will expose one or more streams that are readily available for
+ * retrieval. This api allows listing the streams available for
+ * consumption. A user can also provide a criteria. The criteria can limit
+ * the subset of streams that can be listed via this interface. Each flight
+ * service allows its own definition of how to consume criteria.
+ */
+ listFlights: {
+ name: "ListFlights",
+ requestType: Criteria,
+ requestStream: false,
+ responseType: FlightInfo,
+ responseStream: true,
+ options: {},
+ },
+ /**
+ * For a given FlightDescriptor, get information about how the flight can be
+ * consumed. This is a useful interface if the consumer of the interface
+ * already can identify the specific flight to consume. This interface can
+ * also allow a consumer to generate a flight stream through a specified
+ * descriptor. For example, a flight descriptor might be something that
+ * includes a SQL statement or a Pickled Python operation that will be
+ * executed. In those cases, the descriptor will not be previously available
+ * within the list of available streams provided by ListFlights but will be
+ * available for consumption for the duration defined by the specific flight
+ * service.
+ */
+ getFlightInfo: {
+ name: "GetFlightInfo",
+ requestType: FlightDescriptor,
+ requestStream: false,
+ responseType: FlightInfo,
+ responseStream: false,
+ options: {},
+ },
+ /**
+ * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
+ * This is used when a consumer needs the Schema of flight stream. Similar to
+ * GetFlightInfo this interface may generate a new flight that was not previously
+ * available in ListFlights.
+ */
+ getSchema: {
+ name: "GetSchema",
+ requestType: FlightDescriptor,
+ requestStream: false,
+ responseType: SchemaResult,
+ responseStream: false,
+ options: {},
+ },
+ /**
+ * Retrieve a single stream associated with a particular descriptor
+ * associated with the referenced ticket. A Flight can be composed of one or
+ * more streams where each stream can be retrieved using a separate opaque
+ * ticket that the flight service uses for managing a collection of streams.
+ */
+ doGet: {
+ name: "DoGet",
+ requestType: Ticket,
+ requestStream: false,
+ responseType: FlightData,
+ responseStream: true,
+ options: {},
+ },
+ /**
+ * Push a stream to the flight service associated with a particular
+ * flight stream. This allows a client of a flight service to upload a stream
+ * of data. Depending on the particular flight service, a client consumer
+ * could be allowed to upload a single stream per descriptor or an unlimited
+ * number. In the latter, the service might implement a 'seal' action that
+ * can be applied to a descriptor once all streams are uploaded.
+ */
+ doPut: {
+ name: "DoPut",
+ requestType: FlightData,
+ requestStream: true,
+ responseType: PutResult,
+ responseStream: true,
+ options: {},
+ },
+ /**
+ * Open a bidirectional data channel for a given descriptor. This
+ * allows clients to send and receive arbitrary Arrow data and
+ * application-specific metadata in a single logical stream. In
+ * contrast to DoGet/DoPut, this is more suited for clients
+ * offloading computation (rather than storage) to a Flight service.
+ */
+ doExchange: {
+ name: "DoExchange",
+ requestType: FlightData,
+ requestStream: true,
+ responseType: FlightData,
+ responseStream: true,
+ options: {},
+ },
+ /**
+ * Flight services can support an arbitrary number of simple actions in
+ * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
+ * operations that are potentially available. DoAction allows a flight client
+ * to do a specific action against a flight service. An action includes
+ * opaque request and response objects that are specific to the type action
+ * being undertaken.
+ */
+ doAction: {
+ name: "DoAction",
+ requestType: Action,
+ requestStream: false,
+ responseType: Result,
+ responseStream: true,
+ options: {},
+ },
+ /**
+ * A flight service exposes all of the available action types that it has
+ * along with descriptions. This allows different flight consumers to
+ * understand the capabilities of the flight service.
+ */
+ listActions: {
+ name: "ListActions",
+ requestType: Empty,
+ requestStream: false,
+ responseType: ActionType,
+ responseStream: true,
+ options: {},
+ },
+ },
+} as const;
+
+export interface FlightServiceImplementation {
+ /**
+ * Handshake between client and server. Depending on the server, the
+ * handshake may be required to determine the token that should be used for
+ * future operations. Both request and response are streams to allow multiple
+ * round-trips depending on auth mechanism.
+ */
+ handshake(
+ request: AsyncIterable,
+ context: CallContext & CallContextExt,
+ ): ServerStreamingMethodResult>;
+ /**
+ * Get a list of available streams given a particular criteria. Most flight
+ * services will expose one or more streams that are readily available for
+ * retrieval. This api allows listing the streams available for
+ * consumption. A user can also provide a criteria. The criteria can limit
+ * the subset of streams that can be listed via this interface. Each flight
+ * service allows its own definition of how to consume criteria.
+ */
+ listFlights(
+ request: Criteria,
+ context: CallContext & CallContextExt,
+ ): ServerStreamingMethodResult>;
+ /**
+ * For a given FlightDescriptor, get information about how the flight can be
+ * consumed. This is a useful interface if the consumer of the interface
+ * already can identify the specific flight to consume. This interface can
+ * also allow a consumer to generate a flight stream through a specified
+ * descriptor. For example, a flight descriptor might be something that
+ * includes a SQL statement or a Pickled Python operation that will be
+ * executed. In those cases, the descriptor will not be previously available
+ * within the list of available streams provided by ListFlights but will be
+ * available for consumption for the duration defined by the specific flight
+ * service.
+ */
+ getFlightInfo(request: FlightDescriptor, context: CallContext & CallContextExt): Promise>;
+ /**
+ * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
+ * This is used when a consumer needs the Schema of flight stream. Similar to
+ * GetFlightInfo this interface may generate a new flight that was not previously
+ * available in ListFlights.
+ */
+ getSchema(request: FlightDescriptor, context: CallContext & CallContextExt): Promise>;
+ /**
+ * Retrieve a single stream associated with a particular descriptor
+ * associated with the referenced ticket. A Flight can be composed of one or
+ * more streams where each stream can be retrieved using a separate opaque
+ * ticket that the flight service uses for managing a collection of streams.
+ */
+ doGet(request: Ticket, context: CallContext & CallContextExt): ServerStreamingMethodResult>;
+ /**
+ * Push a stream to the flight service associated with a particular
+ * flight stream. This allows a client of a flight service to upload a stream
+ * of data. Depending on the particular flight service, a client consumer
+ * could be allowed to upload a single stream per descriptor or an unlimited
+ * number. In the latter, the service might implement a 'seal' action that
+ * can be applied to a descriptor once all streams are uploaded.
+ */
+ doPut(
+ request: AsyncIterable,
+ context: CallContext & CallContextExt,
+ ): ServerStreamingMethodResult>;
+ /**
+ * Open a bidirectional data channel for a given descriptor. This
+ * allows clients to send and receive arbitrary Arrow data and
+ * application-specific metadata in a single logical stream. In
+ * contrast to DoGet/DoPut, this is more suited for clients
+ * offloading computation (rather than storage) to a Flight service.
+ */
+ doExchange(
+ request: AsyncIterable,
+ context: CallContext & CallContextExt,
+ ): ServerStreamingMethodResult>;
+ /**
+ * Flight services can support an arbitrary number of simple actions in
+ * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
+ * operations that are potentially available. DoAction allows a flight client
+ * to do a specific action against a flight service. An action includes
+ * opaque request and response objects that are specific to the type action
+ * being undertaken.
+ */
+ doAction(request: Action, context: CallContext & CallContextExt): ServerStreamingMethodResult>;
+ /**
+ * A flight service exposes all of the available action types that it has
+ * along with descriptions. This allows different flight consumers to
+ * understand the capabilities of the flight service.
+ */
+ listActions(
+ request: Empty,
+ context: CallContext & CallContextExt,
+ ): ServerStreamingMethodResult>;
+}
+
+export interface FlightServiceClient {
+ /**
+ * Handshake between client and server. Depending on the server, the
+ * handshake may be required to determine the token that should be used for
+ * future operations. Both request and response are streams to allow multiple
+ * round-trips depending on auth mechanism.
+ */
+ handshake(
+ request: AsyncIterable>,
+ options?: CallOptions & CallOptionsExt,
+ ): AsyncIterable;
+ /**
+ * Get a list of available streams given a particular criteria. Most flight
+ * services will expose one or more streams that are readily available for
+ * retrieval. This api allows listing the streams available for
+ * consumption. A user can also provide a criteria. The criteria can limit
+ * the subset of streams that can be listed via this interface. Each flight
+ * service allows its own definition of how to consume criteria.
+ */
+ listFlights(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable;
+ /**
+ * For a given FlightDescriptor, get information about how the flight can be
+ * consumed. This is a useful interface if the consumer of the interface
+ * already can identify the specific flight to consume. This interface can
+ * also allow a consumer to generate a flight stream through a specified
+ * descriptor. For example, a flight descriptor might be something that
+ * includes a SQL statement or a Pickled Python operation that will be
+ * executed. In those cases, the descriptor will not be previously available
+ * within the list of available streams provided by ListFlights but will be
+ * available for consumption for the duration defined by the specific flight
+ * service.
+ */
+ getFlightInfo(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise;
+ /**
+ * For a given FlightDescriptor, get the Schema as described in Schema.fbs::Schema
+ * This is used when a consumer needs the Schema of flight stream. Similar to
+ * GetFlightInfo this interface may generate a new flight that was not previously
+ * available in ListFlights.
+ */
+ getSchema(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise;
+ /**
+ * Retrieve a single stream associated with a particular descriptor
+ * associated with the referenced ticket. A Flight can be composed of one or
+ * more streams where each stream can be retrieved using a separate opaque
+ * ticket that the flight service uses for managing a collection of streams.
+ */
+ doGet(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable;
+ /**
+ * Push a stream to the flight service associated with a particular
+ * flight stream. This allows a client of a flight service to upload a stream
+ * of data. Depending on the particular flight service, a client consumer
+ * could be allowed to upload a single stream per descriptor or an unlimited
+ * number. In the latter, the service might implement a 'seal' action that
+ * can be applied to a descriptor once all streams are uploaded.
+ */
+ doPut(
+ request: AsyncIterable>,
+ options?: CallOptions & CallOptionsExt,
+ ): AsyncIterable;
+ /**
+ * Open a bidirectional data channel for a given descriptor. This
+ * allows clients to send and receive arbitrary Arrow data and
+ * application-specific metadata in a single logical stream. In
+ * contrast to DoGet/DoPut, this is more suited for clients
+ * offloading computation (rather than storage) to a Flight service.
+ */
+ doExchange(
+ request: AsyncIterable>,
+ options?: CallOptions & CallOptionsExt,
+ ): AsyncIterable;
+ /**
+ * Flight services can support an arbitrary number of simple actions in
+ * addition to the possible ListFlights, GetFlightInfo, DoGet, DoPut
+ * operations that are potentially available. DoAction allows a flight client
+ * to do a specific action against a flight service. An action includes
+ * opaque request and response objects that are specific to the type action
+ * being undertaken.
+ */
+ doAction(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable;
+ /**
+ * A flight service exposes all of the available action types that it has
+ * along with descriptions. This allows different flight consumers to
+ * understand the capabilities of the flight service.
+ */
+ listActions(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable;
+}
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial = T extends Builtin ? T
+ : T extends globalThis.Array ? globalThis.Array>
+ : T extends ReadonlyArray ? ReadonlyArray>
+ : T extends {} ? { [K in keyof T]?: DeepPartial }
+ : Partial;
+
+function toTimestamp(date: Date): Timestamp {
+ const seconds = date.getTime() / 1_000;
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
+ return { seconds, nanos };
+}
+
+function fromTimestamp(t: Timestamp): Date {
+ let millis = (t.seconds || 0) * 1_000;
+ millis += (t.nanos || 0) / 1_000_000;
+ return new globalThis.Date(millis);
+}
+
+function longToNumber(long: Long): number {
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
+ }
+ return long.toNumber();
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
+export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator };
diff --git a/src/assets/google/protobuf/timestamp.ts b/src/assets/google/protobuf/timestamp.ts
new file mode 100644
index 00000000..039f4ecb
--- /dev/null
+++ b/src/assets/google/protobuf/timestamp.ts
@@ -0,0 +1,188 @@
+/* eslint-disable */
+import * as _m0 from "protobufjs/minimal";
+import Long from "long";
+
+export const protobufPackage = "google.protobuf";
+
+/**
+ * A Timestamp represents a point in time independent of any time zone or local
+ * calendar, encoded as a count of seconds and fractions of seconds at
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
+ * Gregorian calendar backwards to year one.
+ *
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
+ * second table is needed for interpretation, using a [24-hour linear
+ * smear](https://developers.google.com/time/smear).
+ *
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
+ * restricting to that range, we ensure that we can convert to and from [RFC
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
+ *
+ * # Examples
+ *
+ * Example 1: Compute Timestamp from POSIX `time()`.
+ *
+ * Timestamp timestamp;
+ * timestamp.set_seconds(time(NULL));
+ * timestamp.set_nanos(0);
+ *
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
+ *
+ * struct timeval tv;
+ * gettimeofday(&tv, NULL);
+ *
+ * Timestamp timestamp;
+ * timestamp.set_seconds(tv.tv_sec);
+ * timestamp.set_nanos(tv.tv_usec * 1000);
+ *
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
+ *
+ * FILETIME ft;
+ * GetSystemTimeAsFileTime(&ft);
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
+ *
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
+ * Timestamp timestamp;
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
+ *
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
+ *
+ * long millis = System.currentTimeMillis();
+ *
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
+ *
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
+ *
+ * Instant now = Instant.now();
+ *
+ * Timestamp timestamp =
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
+ * .setNanos(now.getNano()).build();
+ *
+ * Example 6: Compute Timestamp from current time in Python.
+ *
+ * timestamp = Timestamp()
+ * timestamp.GetCurrentTime()
+ *
+ * # JSON Mapping
+ *
+ * In JSON format, the Timestamp type is encoded as a string in the
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
+ * where {year} is always expressed using four digits while {month}, {day},
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
+ * able to accept both UTC and other timezones (as indicated by an offset).
+ *
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
+ * 01:30 UTC on January 15, 2017.
+ *
+ * In JavaScript, one can convert a Date object to this format using the
+ * standard
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
+ * method. In Python, a standard `datetime.datetime` object can be converted
+ * to this format using
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
+ * ) to obtain a formatter capable of generating timestamps in this format.
+ */
+export interface Timestamp {
+ /**
+ * Represents seconds of UTC time since Unix epoch
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
+ * 9999-12-31T23:59:59Z inclusive.
+ */
+ seconds: number;
+ /**
+ * Non-negative fractions of a second at nanosecond resolution. Negative
+ * second values with fractions must still have non-negative nanos values
+ * that count forward in time. Must be from 0 to 999,999,999
+ * inclusive.
+ */
+ nanos: number;
+}
+
+function createBaseTimestamp(): Timestamp {
+ return { seconds: 0, nanos: 0 };
+}
+
+export const Timestamp = {
+ encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.seconds !== 0) {
+ writer.uint32(8).int64(message.seconds);
+ }
+ if (message.nanos !== 0) {
+ writer.uint32(16).int32(message.nanos);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseTimestamp();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.seconds = longToNumber(reader.int64() as Long);
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.nanos = reader.int32();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ create(base?: DeepPartial): Timestamp {
+ return Timestamp.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial): Timestamp {
+ const message = createBaseTimestamp();
+ message.seconds = object.seconds ?? 0;
+ message.nanos = object.nanos ?? 0;
+ return message;
+ },
+};
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial = T extends Builtin ? T
+ : T extends globalThis.Array ? globalThis.Array>
+ : T extends ReadonlyArray ? ReadonlyArray>
+ : T extends {} ? { [K in keyof T]?: DeepPartial }
+ : Partial;
+
+function longToNumber(long: Long): number {
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
+ }
+ return long.toNumber();
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx
index 4691be08..63efb617 100644
--- a/src/components/Navbar/index.tsx
+++ b/src/components/Navbar/index.tsx
@@ -13,6 +13,7 @@ import {
IconTrash,
IconInfoCircle,
IconUserCog,
+ IconServerBolt,
} from '@tabler/icons-react';
import { FC, useEffect } from 'react';
import { useNavbarStyles } from './styles';
@@ -34,9 +35,13 @@ import Cookies from 'js-cookie';
import { NAVBAR_WIDTH } from '@/constants/theme';
const baseURL = import.meta.env.VITE_PARSEABLE_URL ?? '/';
+const parseable_session = import.meta.env.VITE_PARSEABLE_SESSION ?? 'session';
+const parseable_user = import.meta.env.VITE_PARSEABLE_USER ?? 'username';
+
const links = [
{ icon: IconZoomCode, label: 'Query', pathname: '/query', requiredAccess: ['Query', 'GetSchema'] },
{ icon: IconTableShortcut, label: 'Logs', pathname: '/logs', requiredAccess: ['Query', 'GetSchema'] },
+ { icon: IconServerBolt, label: 'Live Tail', pathname: '/live-tail', requiredAccess: ['Query', 'GetSchema'] },
{ icon: IconReportAnalytics, label: 'Stats', pathname: '/stats', requiredAccess: ['GetStats'] },
{ icon: IconSettings, label: 'Config', pathname: '/config', requiredAccess: ['PutAlert'] },
];
@@ -48,7 +53,7 @@ const Navbar: FC = (props) => {
const { streamName } = useParams();
const location = useLocation();
- const username = Cookies.get('username');
+ const username = Cookies.get(parseable_user);
const {
state: { subNavbarTogle },
@@ -76,8 +81,8 @@ const Navbar: FC = (props) => {
}, [subNavbarTogle.get()]);
const onSignOut = () => {
- Cookies.remove('session');
- Cookies.remove('username');
+ Cookies.remove(parseable_session);
+ Cookies.remove(parseable_user);
window.location.href = `${baseURL}api/v1/o/logout?redirect=${window.location.origin}/login`;
};
@@ -94,7 +99,7 @@ const Navbar: FC = (props) => {
setActiveStream('');
setSearchValue('');
setDisableLink(true);
- navigate("/");
+ navigate('/');
} else if (streamName) {
if (streamName === deleteStream && userSepecficStreams) {
setDeleteStream('');
@@ -115,7 +120,7 @@ const Navbar: FC = (props) => {
} else if (userSepecficStreams && Boolean(userSepecficStreams.length)) {
if (location.pathname === USERS_MANAGEMENT_ROUTE) {
handleChangeWithoutRiderection(userSepecficStreams[0].name, location.pathname);
- navigate("/users");
+ navigate('/users');
} else {
handleChange(userSepecficStreams[0].name);
}
@@ -275,7 +280,7 @@ const Navbar: FC = (props) => {
label="Users"
icon={}
onClick={() => {
- navigate("/users");
+ navigate('/users');
setCurrentPage(USERS_MANAGEMENT_ROUTE);
}}
/>
diff --git a/src/components/Navbar/infoModal.tsx b/src/components/Navbar/infoModal.tsx
index 582b067b..14a1a4c5 100644
--- a/src/components/Navbar/infoModal.tsx
+++ b/src/components/Navbar/infoModal.tsx
@@ -59,7 +59,7 @@ type InfoModalProps = {
const InfoModal: FC = (props) => {
const { opened, close } = props;
const {
- state: { subLLMActive },
+ state: { subInstanceConfig },
} = useHeaderContext();
const { data, loading, error, getAbout, resetData } = useGetAbout();
@@ -83,9 +83,9 @@ const InfoModal: FC = (props) => {
useEffect(() => {
if (data) {
- subLLMActive.set(data.llmActive);
+ subInstanceConfig.set(data);
}
- }, [data?.llmActive]);
+ }, [data]);
const { classes } = useInfoModalStyles();
const {
diff --git a/src/constants/routes.ts b/src/constants/routes.ts
index 148faaba..5e678857 100644
--- a/src/constants/routes.ts
+++ b/src/constants/routes.ts
@@ -5,5 +5,6 @@ export const ALL_ROUTE = '/*';
export const QUERY_ROUTE = '/:streamName/query';
export const STATS_ROUTE = '/:streamName/stats';
export const CONFIG_ROUTE = '/:streamName/config';
+export const LIVE_TAIL_ROUTE = '/:streamName/live-tail';
export const USERS_MANAGEMENT_ROUTE = '/users';
export const OIDC_NOT_CONFIGURED_ROUTE = '/oidc-not-configured';
diff --git a/src/hooks/useDoGetLiveTail.tsx b/src/hooks/useDoGetLiveTail.tsx
new file mode 100644
index 00000000..70b6b040
--- /dev/null
+++ b/src/hooks/useDoGetLiveTail.tsx
@@ -0,0 +1,98 @@
+import { FetchTransport, Metadata, createChannel, createClient } from 'nice-grpc-web';
+import { AsyncRecordBatchStreamReader } from '@apache-arrow/ts';
+
+import { type FlightServiceClient, FlightServiceDefinition, FlightData } from '@/assets/arrow';
+import useMountedState from './useMountedState';
+import { useEffect } from 'react';
+import { parseLogData } from '@/utils';
+
+// Function to convert FlightData to a Uint8Array
+function flightDataToUint8Array(data: FlightData): Uint8Array {
+ const token = new Uint8Array([0xff, 0xff, 0xff, 0xff]);
+ const length = new Uint8Array(new Uint32Array([data.dataHeader.length]).buffer);
+ return new Uint8Array([...token, ...length, ...data.dataHeader, ...data.dataBody]);
+}
+
+// Create a ReadableStream from the async iterable
+function createFlightDataReadableStream(dataIterable: AsyncIterable): ReadableStream {
+ return new ReadableStream({
+ async start(controller) {
+ for await (const flightData of dataIterable) {
+ const uint8ArrayData = flightDataToUint8Array(flightData);
+ controller.enqueue(uint8ArrayData);
+ }
+ controller.close(); // Signal the end of the stream
+ },
+ });
+}
+
+export const useDoGetLiveTail = () => {
+ const [data, setData] = useMountedState([]);
+ const [error, setError] = useMountedState(null);
+ const [loading, setLoading] = useMountedState(false);
+ const [search, setSearch] = useMountedState('');
+ const [tailData, setTailData] = useMountedState([]);
+
+ function livetail(currentStreamName: string, grpcPort: number | null) {
+ if (currentStreamName && grpcPort) {
+ const grpcUrl = new URL(window.location.origin);
+ grpcUrl.port = String(grpcPort);
+
+ const transport = FetchTransport({credentials: 'include'})
+ const channel = createChannel(grpcUrl.origin, transport);
+ const client: FlightServiceClient = createClient(FlightServiceDefinition, channel, );
+
+ let encoder = new TextEncoder();
+ let iter = client.doGet(
+ { ticket: encoder.encode(JSON.stringify({ stream: currentStreamName })) }
+ );
+
+ let task = async function () {
+ let decoder = await AsyncRecordBatchStreamReader.from(createFlightDataReadableStream(iter));
+ for await (const resp of decoder) {
+ // setData((prevData) => [resp.toArray()[0].toJSON(), ...prevData.slice(0, 99)]);
+ setTailData((prevData) => [resp.toArray()[0].toJSON(), ...prevData.slice(0, 99)]);
+ }
+ return 'done';
+ };
+
+ task().then((x: any) => {
+ console.log(x);
+ });
+ }
+ }
+
+ const doGetLiveTail = async (streamName: string, grpcPort: number) => {
+ try {
+ setLoading(true);
+ setError(null);
+ livetail(streamName, grpcPort);
+ } catch {
+ setError('Failed to get ALert');
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ useEffect(() => {
+ if (search === '') {
+ setData(tailData);
+ } else {
+ const searchText = search.trim().toLowerCase();
+ tailData.map((log) => {
+ for (const key in log) {
+ const logValue = parseLogData(log[key], key);
+ if (logValue?.toString().toLowerCase().includes(searchText)) {
+ setData((prevData) => [log, ...prevData.slice(0, 99)]);
+ }
+ }
+ });
+ }
+ }, [search, tailData]);
+
+ const resetData = () => {
+ setData([]);
+ };
+
+ return { data, error, loading, doGetLiveTail, resetData, setSearch };
+};
diff --git a/src/hooks/useGetLogStreamList.tsx b/src/hooks/useGetLogStreamList.tsx
index e8b5b47e..50d3e248 100644
--- a/src/hooks/useGetLogStreamList.tsx
+++ b/src/hooks/useGetLogStreamList.tsx
@@ -11,6 +11,10 @@ import { useNavigate } from 'react-router-dom';
import { LOGIN_ROUTE } from '@/constants/routes';
import Cookies from 'js-cookie';
+
+const parseable_session = import.meta.env.VITE_PARSEABLE_SESSION ?? 'session';
+const parseable_user= import.meta.env.VITE_PARSEABLE_USER ?? 'username';
+
export const useGetLogStreamList = () => {
const [data, setData] = useMountedState(null);
const [error, setError] = useMountedState(null);
@@ -63,9 +67,9 @@ export const useGetLogStreamList = () => {
}
case StatusCodes.UNAUTHORIZED: {
setError('Unauthorized');
- Cookies.remove('session');
- Cookies.remove('username');
-
+ Cookies.remove(parseable_session);
+ Cookies.remove(parseable_user);
+
notifications.update({
id: 'load-data',
color: 'red',
diff --git a/src/hooks/useLoginForm.ts b/src/hooks/useLoginForm.ts
index be9da874..7558bc06 100644
--- a/src/hooks/useLoginForm.ts
+++ b/src/hooks/useLoginForm.ts
@@ -11,12 +11,14 @@ import { useEffect } from 'react';
import Cookies from 'js-cookie';
import { getQueryParam } from '@/utils';
+const parseable_session = import.meta.env.VITE_PARSEABLE_SESSION ?? 'session';
+
export const useLoginForm = () => {
const notificationId = useId();
const queryParams = getQueryParam();
const [loading, setLoading] = useMountedState(false);
const [error, setError] = useMountedState(null);
- const auth = Cookies.get('session');
+ const auth = Cookies.get(parseable_session);
const nav = useNavigate();
const location = useLocation();
diff --git a/src/hooks/usePutUserRole.tsx b/src/hooks/usePutUserRole.tsx
index 74f7132b..3376398d 100644
--- a/src/hooks/usePutUserRole.tsx
+++ b/src/hooks/usePutUserRole.tsx
@@ -5,6 +5,9 @@ import { notifications } from '@mantine/notifications';
import { IconCheck, IconFileAlert } from '@tabler/icons-react';
import Cookies from 'js-cookie';
+const parseable_session = import.meta.env.VITE_PARSEABLE_SESSION ?? 'session';
+const parseable_user= import.meta.env.VITE_PARSEABLE_USER ?? 'username';
+
export const usePutUserRole = () => {
const [data, setData] = useMountedState(null);
const [error, setError] = useMountedState(null);
@@ -41,8 +44,8 @@ export const usePutUserRole = () => {
default: {
setError(res.data);
console.error(res);
- Cookies.remove('session');
- Cookies.remove('username');
+ Cookies.remove(parseable_session);
+ Cookies.remove(parseable_user);
notifications.update({
id: 'load-data',
color: 'red',
diff --git a/src/layouts/MainLayout/Context.tsx b/src/layouts/MainLayout/Context.tsx
index fe53fd1b..2ef5cc3e 100644
--- a/src/layouts/MainLayout/Context.tsx
+++ b/src/layouts/MainLayout/Context.tsx
@@ -1,3 +1,4 @@
+import { AboutData } from '@/@types/parseable/api/about';
import { SortOrder, type LogsQuery, type LogsSearch, type LogSelectedTimeRange } from '@/@types/parseable/api/query';
import useSubscribeState, { SubData } from '@/hooks/useSubscribeState';
import dayjs from 'dayjs';
@@ -46,7 +47,7 @@ interface HeaderContextState {
subLogSelectedTimeRange: SubData;
subNavbarTogle: SubData;
subCreateUserModalTogle: SubData;
- subLLMActive: SubData;
+ subInstanceConfig: SubData;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -83,7 +84,7 @@ const MainLayoutPageProvider: FC = ({ children }) => {
const subRefreshInterval = useSubscribeState(null);
const subNavbarTogle = useSubscribeState(false);
const subCreateUserModalTogle = useSubscribeState(false);
- const subLLMActive = useSubscribeState(false);
+ const subInstanceConfig = useSubscribeState(null);
const state: HeaderContextState = {
subLogQuery,
subLogSearch,
@@ -91,7 +92,7 @@ const MainLayoutPageProvider: FC = ({ children }) => {
subLogSelectedTimeRange,
subNavbarTogle,
subCreateUserModalTogle,
- subLLMActive,
+ subInstanceConfig,
};
const methods: HeaderContextMethods = {};
diff --git a/src/pages/LiveTail/index.tsx b/src/pages/LiveTail/index.tsx
new file mode 100644
index 00000000..0d4c51ff
--- /dev/null
+++ b/src/pages/LiveTail/index.tsx
@@ -0,0 +1,122 @@
+import { Box, Button, ScrollArea, Table, Text, TextInput } from '@mantine/core';
+import { useDocumentTitle } from '@mantine/hooks';
+import { FC, useEffect } from 'react';
+import { useLiveTailStyles } from './styles';
+import { useHeaderContext } from '@/layouts/MainLayout/Context';
+import useMountedState from '@/hooks/useMountedState';
+import { useDoGetLiveTail } from '@/hooks/useDoGetLiveTail';
+import { useGetLogStreamSchema } from '@/hooks/useGetLogStreamSchema';
+import { HEADER_HEIGHT, NAVBAR_WIDTH } from '@/constants/theme';
+
+(BigInt.prototype as any).toJSON = function () {
+ return this.toString();
+};
+
+const LiveTail: FC = () => {
+ useDocumentTitle('Parseable | Live Tail');
+ const {
+ state: { subLogQuery, subInstanceConfig },
+ } = useHeaderContext();
+ const [currentStreamName, setCurrentStreamName] = useMountedState(subLogQuery.get().streamName);
+ const [grpcPort, setGrpcPort] = useMountedState(subInstanceConfig.get()?.grpcPort ?? null);
+ const { data, doGetLiveTail, error, loading, resetData, setSearch } = useDoGetLiveTail();
+ const { data: schema, loading: schemaLoading, getDataSchema, resetData: resetSchema } = useGetLogStreamSchema();
+ const [tablerData, setTablerData] = useMountedState([]);
+
+ useEffect(() => {
+ const Streamlistener = subLogQuery.subscribe((state) => {
+ if (state) {
+ console.log(grpcPort, currentStreamName);
+ setCurrentStreamName(state.streamName);
+ }
+ });
+ const portListener = subInstanceConfig.subscribe((state) => {
+ if (state) {
+ setGrpcPort(state.grpcPort);
+ }
+ });
+
+ return () => {
+ Streamlistener();
+ portListener();
+ };
+ }, [subLogQuery, subInstanceConfig]);
+
+ useEffect(() => {
+ if (currentStreamName && grpcPort) {
+ doGetLiveTail(currentStreamName, grpcPort);
+ getDataSchema(currentStreamName);
+ }
+ }, [currentStreamName, grpcPort]);
+
+ useEffect(() => {
+ return () => {
+ resetData();
+ resetSchema();
+ };
+ }, []);
+
+ const { classes } = useLiveTailStyles();
+ const { container } = classes;
+
+ const rows = tablerData.map((element: any, i) => (
+