+ * 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..7191303b
--- /dev/null
+++ b/src/assets/arrow.ts
@@ -0,0 +1,1700 @@
+/* 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..c7bc99cd
--- /dev/null
+++ b/src/assets/google/protobuf/timestamp.ts
@@ -0,0 +1,192 @@
+/* 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/Header/Dropdown.tsx b/src/components/Header/Dropdown.tsx
new file mode 100644
index 00000000..0dcaa733
--- /dev/null
+++ b/src/components/Header/Dropdown.tsx
@@ -0,0 +1,15 @@
+import { type FC } from 'react';
+import { Select } from '@mantine/core';
+
+type DropdownProps = {
+ data: string[];
+ onChange: (value: string) => void;
+};
+
+const Dropdown: FC = (props) => {
+ const { data, onChange } = props;
+
+ return ;
+};
+
+export default Dropdown;
diff --git a/src/components/Header/LiveTailFilter.tsx b/src/components/Header/LiveTailFilter.tsx
new file mode 100644
index 00000000..ee0b7dbc
--- /dev/null
+++ b/src/components/Header/LiveTailFilter.tsx
@@ -0,0 +1,71 @@
+import { Box, TextInput, px } from '@mantine/core';
+import { type FC, type ChangeEvent, useEffect } from 'react';
+import { useLogQueryStyles } from './styles';
+import useMountedState from '@/hooks/useMountedState';
+import { IconSearch } from '@tabler/icons-react';
+import Dropdown from './Dropdown';
+import { useHeaderContext } from '@/layouts/MainLayout/Context';
+import { LogStreamData } from '@/@types/parseable/api/stream';
+import { notifyError } from '@/utils/notification';
+
+const LiveTailFilter: FC = () => {
+ const {
+ state: { subLiveTailsData },
+ } = useHeaderContext();
+
+ const [searchField, setSearchField] = useMountedState('');
+ const [searchValue, setSearchValue] = useMountedState('');
+ const [schemaData, setSchemaData] = useMountedState([]);
+
+ const onSearchValueChange = (event: ChangeEvent) => {
+ if (!searchField) {
+ notifyError({
+ id: 'field-empty',
+ title: 'Column Field Empty',
+ message: 'Please select a column to search',
+ autoClose: 2000,
+ });
+ }
+ setSearchValue(event.currentTarget.value);
+ subLiveTailsData.set((state) => {
+ state.liveTailSearchValue = event.currentTarget.value;
+ state.liveTailSearchField = searchField;
+ });
+ };
+
+ const handleDropdownValue = (value: string) => {
+ setSearchField(value);
+ };
+
+ useEffect(() => {
+ const liveTailSchema = subLiveTailsData.subscribe((value) => {
+ setSchemaData(value.liveTailSchemaData);
+ });
+
+ return () => {
+ liveTailSchema();
+ };
+ }, [subLiveTailsData]);
+
+ const { classes } = useLogQueryStyles();
+ const { liveTailFilterContainer, searchInput } = classes;
+
+ return (
+
+ {schemaData.length > 0 && (
+ <>
+ item.name)} onChange={handleDropdownValue} />
+ }
+ />
+ >
+ )}
+
+ );
+};
+
+export default LiveTailFilter;
diff --git a/src/components/Header/SecondaryHeader.tsx b/src/components/Header/SecondaryHeader.tsx
index a0dc83cd..27577d83 100644
--- a/src/components/Header/SecondaryHeader.tsx
+++ b/src/components/Header/SecondaryHeader.tsx
@@ -2,8 +2,15 @@ import type { HeaderProps as MantineHeaderProps } from '@mantine/core';
import { FC } from 'react';
import { Route, Routes } from 'react-router-dom';
import HeaderLayout from './Layout';
-import { ConfigHeader, LogsHeader, QueryHeader, StatsHeader, UsersManagementHeader } from './SubHeader';
-import { CONFIG_ROUTE, LOGS_ROUTE, QUERY_ROUTE, STATS_ROUTE, USERS_MANAGEMENT_ROUTE } from '@/constants/routes';
+import { ConfigHeader, LiveTailHeader, LogsHeader, QueryHeader, StatsHeader, UsersManagementHeader } from './SubHeader';
+import {
+ CONFIG_ROUTE,
+ LIVE_TAIL_ROUTE,
+ LOGS_ROUTE,
+ QUERY_ROUTE,
+ STATS_ROUTE,
+ USERS_MANAGEMENT_ROUTE,
+} from '@/constants/routes';
type SecondaryHeaderProps = Omit;
@@ -12,6 +19,7 @@ const SecondaryHeader: FC = (props) => {
}>
} />
+ } />
} />
} />
} />
diff --git a/src/components/Header/StreamingButton.tsx b/src/components/Header/StreamingButton.tsx
new file mode 100644
index 00000000..3421e266
--- /dev/null
+++ b/src/components/Header/StreamingButton.tsx
@@ -0,0 +1,57 @@
+import { useHeaderContext } from '@/layouts/MainLayout/Context';
+import { Box, Button } from '@mantine/core';
+
+import { useEffect, type FC } from 'react';
+import { useLogQueryStyles } from './styles';
+import useMountedState from '@/hooks/useMountedState';
+
+const StreamingButton: FC = () => {
+ const {
+ state: { subLiveTailsData },
+ } = useHeaderContext();
+
+ const [liveTailStatus, setLiveTailStatus] = useMountedState('');
+ const [isClicked, setIsClicked] = useMountedState(false);
+
+ const handleStreaming = () => {
+ if (!isClicked) {
+ setIsClicked(true);
+ if (liveTailStatus === 'streaming') {
+ subLiveTailsData.set((state) => {
+ state.liveTailStatus = 'abort';
+ });
+ } else {
+ subLiveTailsData.set((state) => {
+ state.liveTailStatus = 'fetch';
+ });
+ }
+ setTimeout(() => {
+ setIsClicked(false);
+ }, 500);
+ }
+ };
+
+ useEffect(() => {
+ const liveTailStreaming = subLiveTailsData.subscribe((state) => {
+ setLiveTailStatus(state?.liveTailStatus);
+ });
+
+ return () => {
+ liveTailStreaming();
+ };
+ }, [subLiveTailsData]);
+
+ const { classes } = useLogQueryStyles();
+ const { refreshNowBtn } = classes;
+
+ return (
+ <>
+
+ >
+ );
+};
+
+export default StreamingButton;
diff --git a/src/components/Header/SubHeader.tsx b/src/components/Header/SubHeader.tsx
index 333bcf19..e7ec796b 100644
--- a/src/components/Header/SubHeader.tsx
+++ b/src/components/Header/SubHeader.tsx
@@ -8,7 +8,8 @@ import TimeRange from './TimeRange';
import { useLogQueryStyles } from './styles';
import ReloadUser from './ReloadUser';
import DocsUser from './UserDocs';
-
+import StreamingButton from './StreamingButton';
+import LiveTailFilter from './LiveTailFilter';
export const StatsHeader: FC = () => {
const { classes } = useLogQueryStyles();
@@ -53,6 +54,30 @@ export const QueryHeader: FC = () => {
);
};
+export const LiveTailHeader: FC = () => {
+ const { classes } = useLogQueryStyles();
+ const { container, innerContainer } = classes;
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ {/* */}
+ {/* */}
+
+
+
+ );
+};
+
export const LogsHeader: FC = () => {
const { classes } = useLogQueryStyles();
const { container, innerContainer } = classes;
@@ -115,7 +140,6 @@ export const UsersManagementHeader: FC = () => {
);
};
-
export const AllRouteHeader: FC = () => {
const { classes } = useLogQueryStyles();
const { container, innerContainer } = classes;
@@ -129,4 +153,4 @@ export const AllRouteHeader: FC = () => {
);
-}
\ No newline at end of file
+};
diff --git a/src/components/Header/styles.tsx b/src/components/Header/styles.tsx
index 00228cd3..96da4ce9 100644
--- a/src/components/Header/styles.tsx
+++ b/src/components/Header/styles.tsx
@@ -30,7 +30,7 @@ export const useHeaderStyles = createStyles((theme) => {
imageSty: {},
burgerIcon: {},
navContainer: {
- width: "calc(100% )",
+ width: 'calc(100% )',
justifyContent: 'space-between',
},
actionBtn: {
@@ -81,9 +81,9 @@ export const useLogQueryStyles = createStyles((theme) => {
},
refreshNowBtn: {
background: colors.white[0],
- padding: 0,
+ padding: '6px 12px',
marginRight: spacing.xs,
- width: '36px',
+ // width: '36px',
color: theme.colors.gray[6],
border: `${sizing.px} ${colors.gray[2]} solid`,
'&:hover': {
@@ -169,6 +169,12 @@ export const useLogQueryStyles = createStyles((theme) => {
paddingRight: spacing.sm,
},
+ liveTailFilterContainer: {
+ display: 'flex',
+ gap: '12px',
+ marginRight: '20px',
+ },
+
searchTypeBtn: {
border: `${sizing.px} ${colors.gray[1]} solid`,
borderTopRightRadius: 0,
diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx
index 0094a901..6fea123f 100644
--- a/src/components/Navbar/index.tsx
+++ b/src/components/Navbar/index.tsx
@@ -13,6 +13,7 @@ import {
IconTrash,
IconInfoCircle,
IconUserCog,
+ IconTimelineEvent,
} from '@tabler/icons-react';
import { FC, useEffect } from 'react';
import { useNavbarStyles } from './styles';
@@ -37,6 +38,7 @@ const baseURL = import.meta.env.VITE_PARSEABLE_URL ?? '/';
const links = [
{ icon: IconZoomCode, label: 'SQL', pathname: '/query', requiredAccess: ['Query', 'GetSchema'] },
{ icon: IconTableShortcut, label: 'Explore', pathname: '/logs', requiredAccess: ['Query', 'GetSchema'] },
+ { icon: IconTimelineEvent, label: 'Live tail', pathname: '/live-tail', requiredAccess: ['GetLiveTail'] },
{ icon: IconReportAnalytics, label: 'Stats', pathname: '/stats', requiredAccess: ['GetStats'] },
{ icon: IconSettings, label: 'Config', pathname: '/config', requiredAccess: ['PutAlert'] },
];
@@ -94,7 +96,7 @@ const Navbar: FC = (props) => {
setActiveStream('');
setSearchValue('');
setDisableLink(true);
- navigate("/");
+ navigate('/');
} else if (streamName) {
if (streamName === deleteStream && userSepecficStreams) {
setDeleteStream('');
@@ -115,7 +117,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 +277,7 @@ const Navbar: FC = (props) => {
label="Users"
icon={}
onClick={() => {
- navigate("/users");
+ navigate('/users');
setCurrentPage(USERS_MANAGEMENT_ROUTE);
}}
/>
diff --git a/src/components/Navbar/rolesHandler.ts b/src/components/Navbar/rolesHandler.ts
index 9f8af3de..e5c59e38 100644
--- a/src/components/Navbar/rolesHandler.ts
+++ b/src/components/Navbar/rolesHandler.ts
@@ -5,6 +5,7 @@ const adminAccess = [
'ListStream',
'GetSchema',
'GetStats',
+ 'GetLiveTail',
'DeleteStream',
'GetRetention',
'PutRetention',
@@ -28,8 +29,18 @@ const editorAccess = [
'PutAlert',
'GetAlert',
];
-const writerAccess = ['Ingest', 'Query', 'ListStream', 'GetSchema', 'GetStats', 'GetRetention', 'PutAlert', 'GetAlert'];
-const readerAccess = ['Query', 'ListStream', 'GetSchema', 'GetStats', 'GetRetention', 'GetAlert'];
+const writerAccess = [
+ 'Ingest',
+ 'Query',
+ 'ListStream',
+ 'GetSchema',
+ 'GetStats',
+ 'GetRetention',
+ 'PutAlert',
+ 'GetAlert',
+ 'GetLiveTail',
+];
+const readerAccess = ['Query', 'ListStream', 'GetSchema', 'GetStats', 'GetRetention', 'GetAlert', 'GetLiveTail'];
const ingesterAccess = ['Ingest'];
const getStreamsSepcificAccess = (rolesWithRoleName: object[], stream: string) => {
diff --git a/src/constants/routes.ts b/src/constants/routes.ts
index 148faaba..89e230d1 100644
--- a/src/constants/routes.ts
+++ b/src/constants/routes.ts
@@ -3,6 +3,7 @@ export const LOGS_ROUTE = '/:streamName/logs';
export const LOGIN_ROUTE = '/login';
export const ALL_ROUTE = '/*';
export const QUERY_ROUTE = '/:streamName/query';
+export const LIVE_TAIL_ROUTE = '/:streamName/live-tail';
export const STATS_ROUTE = '/:streamName/stats';
export const CONFIG_ROUTE = '/:streamName/config';
export const USERS_MANAGEMENT_ROUTE = '/users';
diff --git a/src/hooks/useDoGetLiveTail.tsx b/src/hooks/useDoGetLiveTail.tsx
new file mode 100644
index 00000000..075cc6b7
--- /dev/null
+++ b/src/hooks/useDoGetLiveTail.tsx
@@ -0,0 +1,147 @@
+import { FetchTransport, createChannel, createClient } from 'nice-grpc-web';
+import { AsyncRecordBatchStreamReader } from '@apache-arrow/ts';
+import { FlightServiceDefinition, FlightData } from '@/assets/arrow';
+import useMountedState from './useMountedState';
+import { useEffect, useRef } from 'react';
+import { useHeaderContext } from '@/layouts/MainLayout/Context';
+import { LogStreamData } from '@/@types/parseable/api/stream';
+
+const TOTAL_LOGS_TO_SHOW = 500;
+
+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]);
+}
+
+function createFlightDataReadableStream(dataIterable: AsyncIterable): ReadableStream {
+ return new ReadableStream({
+ async start(controller) {
+ for await (const flightData of dataIterable) {
+ controller.enqueue(flightDataToUint8Array(flightData));
+ }
+ controller.close();
+ },
+ });
+}
+
+export const useDoGetLiveTail = () => {
+ const {
+ state: { subLiveTailsData },
+ } = useHeaderContext();
+
+ const [data, setData] = useMountedState([]);
+ const [finalData, setFinalData] = useMountedState([]);
+ const [error, setError] = useMountedState(null);
+ const [loading, setLoading] = useMountedState(false);
+ const [schema, setSchema] = useMountedState([]);
+ const [field, setField] = useMountedState('');
+ const [search, setSearch] = useMountedState('');
+
+ const abortControllerRef = useRef(new AbortController());
+
+ // Handles initiating the live tail stream
+ const livetail = (currentStreamName: string, grpcPort: number | null, abortController: AbortController) => {
+ if (!currentStreamName || !grpcPort) return;
+
+ const grpcUrl = new URL(window.location.origin);
+ grpcUrl.port = String(grpcPort);
+
+ const transport = FetchTransport({ credentials: 'include' });
+ const channel = createChannel(grpcUrl.origin, transport);
+ const client = createClient(FlightServiceDefinition, channel);
+
+ const encoder = new TextEncoder();
+ const iter = client.doGet(
+ { ticket: encoder.encode(JSON.stringify({ stream: currentStreamName })) },
+ { signal: abortController.signal },
+ );
+
+ (async () => {
+ try {
+ const decoder = await AsyncRecordBatchStreamReader.from(createFlightDataReadableStream(iter));
+ setSchema((await decoder.open()).schema.fields);
+
+ let batchCount = 0;
+ for await (const resp of decoder) {
+ batchCount++;
+ if (batchCount == 1) {
+ setLoading(true);
+ }
+
+ await new Promise((resolve) => setTimeout(resolve, 600));
+
+ if (abortController.signal.aborted) {
+ break;
+ }
+
+ if (data.length > TOTAL_LOGS_TO_SHOW) {
+ data.pop();
+ }
+ if (resp.toArray()[0]?.toJSON()) {
+ setData((prevData) => [resp.toArray()[0]?.toJSON(), ...prevData.slice(0, TOTAL_LOGS_TO_SHOW)]);
+ }
+ }
+ setLoading(false);
+ } catch (e) {
+ setLoading(false);
+ setError('Failed to get data');
+ } finally {
+ setLoading(false);
+ }
+ setLoading(false);
+ })();
+ };
+
+ // Starts the live tail
+ const doGetLiveTail = (streamName: string, grpcPort: number | null) => {
+ if (abortControllerRef.current) {
+ abortControllerRef.current.abort();
+ }
+ abortControllerRef.current = new AbortController();
+ livetail(streamName, grpcPort, abortControllerRef.current);
+ };
+
+ const abort = () => {
+ abortControllerRef.current.abort();
+ };
+
+ const resetData = () => setData([]);
+
+ useEffect(() => {
+ const liveTailSchema = subLiveTailsData.subscribe((value) => {
+ setSearch(value.liveTailSearchValue);
+ setField(value.liveTailSearchField);
+ });
+
+ return () => {
+ liveTailSchema();
+ };
+ }, [subLiveTailsData]);
+
+ useEffect(() => {
+ if (field && search) {
+ setFinalData(
+ data.filter((item) => {
+ const fieldValue = item[field.toLowerCase()];
+ return typeof fieldValue === 'string' && fieldValue.toLowerCase().includes(search.toLowerCase());
+ }),
+ );
+ } else {
+ setFinalData(data);
+ }
+ }, [field, search, data]);
+
+ useEffect(() => {
+ subLiveTailsData.set((state) => {
+ state.liveTailSearchValue = '';
+ state.liveTailSearchField = '';
+ });
+
+ return () => {
+ abortControllerRef.current.abort();
+ };
+ }, []);
+
+ return { finalData, error, loading, doGetLiveTail, resetData, abort, schema };
+};
diff --git a/src/layouts/MainLayout/Context.tsx b/src/layouts/MainLayout/Context.tsx
index 2ef5cc3e..88abdea9 100644
--- a/src/layouts/MainLayout/Context.tsx
+++ b/src/layouts/MainLayout/Context.tsx
@@ -1,5 +1,6 @@
import { AboutData } from '@/@types/parseable/api/about';
import { SortOrder, type LogsQuery, type LogsSearch, type LogSelectedTimeRange } from '@/@types/parseable/api/query';
+import { LogStreamData } from '@/@types/parseable/api/stream';
import useSubscribeState, { SubData } from '@/hooks/useSubscribeState';
import dayjs from 'dayjs';
import type { FC } from 'react';
@@ -40,16 +41,45 @@ export const FIXED_DURATIONS = [
export const DEFAULT_FIXED_DURATIONS = FIXED_DURATIONS[0];
+type LiveTailData = {
+ liveTailStatus: 'streaming' | 'stopped' | 'abort' | 'fetch' | '';
+ liveTailSchemaData: LogStreamData;
+ liveTailSearchValue: string;
+ liveTailSearchField: string;
+};
+
interface HeaderContextState {
subLogQuery: SubData;
subLogSearch: SubData;
+ subLiveTailsData: SubData;
subRefreshInterval: SubData;
subLogSelectedTimeRange: SubData;
subNavbarTogle: SubData;
subCreateUserModalTogle: SubData;
- subInstanceConfig: SubData;
+ subInstanceConfig: SubData;
+ subAppContext: SubData;
}
+export type UserRoles = {
+ roleName: {
+ privilege: string;
+ resource?: {
+ stream: string;
+ tag: string;
+ };
+ }[];
+};
+
+export type PageOption = '/' | '/explore' | '/sql' | '/management' | '/team';
+
+export type AppContext = {
+ selectedStream: string | null;
+ activePage: PageOption | null;
+ action: string[] | null;
+ userSpecificStreams: string[] | null;
+ userRoles: UserRoles | null;
+};
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface HeaderContextMethods {}
@@ -63,6 +93,13 @@ interface HeaderProviderProps {
}
const MainLayoutPageProvider: FC = ({ children }) => {
+ const subAppContext = useSubscribeState({
+ selectedStream: null,
+ activePage: null,
+ action: null,
+ userSpecificStreams: null,
+ userRoles: null,
+ });
const subLogQuery = useSubscribeState({
startTime: now.subtract(DEFAULT_FIXED_DURATIONS.milliseconds, 'milliseconds').toDate(),
endTime: now.toDate(),
@@ -77,6 +114,12 @@ const MainLayoutPageProvider: FC = ({ children }) => {
order: SortOrder.DESCENDING,
},
});
+ const subLiveTailsData = useSubscribeState({
+ liveTailStatus: '',
+ liveTailSchemaData: [],
+ liveTailSearchValue: '',
+ liveTailSearchField: '',
+ });
const subLogSelectedTimeRange = useSubscribeState({
state: 'fixed',
value: DEFAULT_FIXED_DURATIONS.name,
@@ -84,7 +127,8 @@ const MainLayoutPageProvider: FC = ({ children }) => {
const subRefreshInterval = useSubscribeState(null);
const subNavbarTogle = useSubscribeState(false);
const subCreateUserModalTogle = useSubscribeState(false);
- const subInstanceConfig = useSubscribeState(null);
+ const subInstanceConfig = useSubscribeState(null);
+
const state: HeaderContextState = {
subLogQuery,
subLogSearch,
@@ -93,6 +137,8 @@ const MainLayoutPageProvider: FC = ({ children }) => {
subNavbarTogle,
subCreateUserModalTogle,
subInstanceConfig,
+ subAppContext,
+ subLiveTailsData,
};
const methods: HeaderContextMethods = {};
diff --git a/src/pages/LiveTail/Column.tsx b/src/pages/LiveTail/Column.tsx
new file mode 100644
index 00000000..b453445e
--- /dev/null
+++ b/src/pages/LiveTail/Column.tsx
@@ -0,0 +1,31 @@
+import { UnstyledButton } from '@mantine/core';
+import { type FC } from 'react';
+
+import { useTableColumnStyle } from './styles';
+import { capitalizeFirstLetter } from '@/utils/capitalizeFirstLetter';
+
+type Column = {
+ columnName: string;
+};
+
+const Column: FC = (props) => {
+ const { columnName } = props;
+
+ const { classes } = useTableColumnStyle();
+ const { labelBtn } = classes;
+
+ return (
+