@apibara/protocol 2.0.0-beta.9 → 2.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +53 -23
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +50 -25
- package/dist/shared/{protocol.8c2a685d.d.cts → protocol.4b1cfe2c.d.cts} +61 -17
- package/dist/shared/{protocol.8c2a685d.d.mts → protocol.4b1cfe2c.d.mts} +61 -17
- package/dist/shared/{protocol.8c2a685d.d.ts → protocol.4b1cfe2c.d.ts} +61 -17
- package/dist/shared/{protocol.d9596779.mjs → protocol.991ff9ad.mjs} +98 -5
- package/dist/shared/{protocol.e1dec68a.cjs → protocol.e39e40d6.cjs} +100 -4
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +5 -4
- package/dist/testing/index.d.mts +5 -4
- package/dist/testing/index.d.ts +5 -4
- package/dist/testing/index.mjs +1 -1
- package/package.json +1 -1
- package/src/client.ts +72 -28
- package/src/common.ts +28 -0
- package/src/proto/stream.ts +60 -1
- package/src/stream.test.ts +16 -0
- package/src/stream.ts +34 -3
- package/src/testing/client.test.ts +28 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from '@effect/schema';
|
|
2
|
-
import { DefaultCallOptions, NormalizedServiceDefinition } from 'nice-grpc';
|
|
2
|
+
import { DefaultCallOptions, NormalizedServiceDefinition, ChannelCredentials, ChannelOptions } from 'nice-grpc';
|
|
3
3
|
import { CallContext, CallOptions } from 'nice-grpc-common';
|
|
4
4
|
import _m0 from 'protobufjs/minimal.js';
|
|
5
5
|
import * as _effect_schema_AST from '@effect/schema/AST';
|
|
@@ -115,6 +115,17 @@ declare enum DataFinality$1 {
|
|
|
115
115
|
}
|
|
116
116
|
declare function dataFinalityFromJSON(object: any): DataFinality$1;
|
|
117
117
|
declare function dataFinalityToJSON(object: DataFinality$1): string;
|
|
118
|
+
/** Data production mode. */
|
|
119
|
+
declare enum DataProduction$1 {
|
|
120
|
+
UNKNOWN = 0,
|
|
121
|
+
/** BACKFILL - Data is for a backfilled block. */
|
|
122
|
+
BACKFILL = 1,
|
|
123
|
+
/** LIVE - Data is for a live block. */
|
|
124
|
+
LIVE = 2,
|
|
125
|
+
UNRECOGNIZED = -1
|
|
126
|
+
}
|
|
127
|
+
declare function dataProductionFromJSON(object: any): DataProduction$1;
|
|
128
|
+
declare function dataProductionToJSON(object: DataProduction$1): string;
|
|
118
129
|
/** A cursor over the stream content. */
|
|
119
130
|
interface Cursor$1 {
|
|
120
131
|
/**
|
|
@@ -286,6 +297,8 @@ interface Data$1 {
|
|
|
286
297
|
* This message contains chain-specific data serialized using protobuf.
|
|
287
298
|
*/
|
|
288
299
|
readonly data: readonly Uint8Array[];
|
|
300
|
+
/** The production mode of the block. */
|
|
301
|
+
readonly production: DataProduction$1;
|
|
289
302
|
}
|
|
290
303
|
declare const Data$1: {
|
|
291
304
|
encode(message: Data$1, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -410,9 +423,11 @@ type stream_DnaStreamServiceImplementation<CallContextExt = {}> = DnaStreamServi
|
|
|
410
423
|
type stream_ServerStreamingMethodResult<Response> = ServerStreamingMethodResult<Response>;
|
|
411
424
|
declare const stream_dataFinalityFromJSON: typeof dataFinalityFromJSON;
|
|
412
425
|
declare const stream_dataFinalityToJSON: typeof dataFinalityToJSON;
|
|
426
|
+
declare const stream_dataProductionFromJSON: typeof dataProductionFromJSON;
|
|
427
|
+
declare const stream_dataProductionToJSON: typeof dataProductionToJSON;
|
|
413
428
|
declare const stream_protobufPackage: typeof protobufPackage;
|
|
414
429
|
declare namespace stream {
|
|
415
|
-
export { Cursor$1 as Cursor, Data$1 as Data, DataFinality$1 as DataFinality, type stream_DeepPartial as DeepPartial, type stream_DnaStreamClient as DnaStreamClient, stream_DnaStreamDefinition as DnaStreamDefinition, type stream_DnaStreamServiceImplementation as DnaStreamServiceImplementation, Finalize$1 as Finalize, Heartbeat$1 as Heartbeat, Invalidate$1 as Invalidate, type stream_ServerStreamingMethodResult as ServerStreamingMethodResult, StatusRequest$1 as StatusRequest, StatusResponse$1 as StatusResponse, StreamDataRequest$1 as StreamDataRequest, StreamDataResponse$1 as StreamDataResponse, SystemMessage$1 as SystemMessage, stream_dataFinalityFromJSON as dataFinalityFromJSON, stream_dataFinalityToJSON as dataFinalityToJSON, stream_protobufPackage as protobufPackage };
|
|
430
|
+
export { Cursor$1 as Cursor, Data$1 as Data, DataFinality$1 as DataFinality, DataProduction$1 as DataProduction, type stream_DeepPartial as DeepPartial, type stream_DnaStreamClient as DnaStreamClient, stream_DnaStreamDefinition as DnaStreamDefinition, type stream_DnaStreamServiceImplementation as DnaStreamServiceImplementation, Finalize$1 as Finalize, Heartbeat$1 as Heartbeat, Invalidate$1 as Invalidate, type stream_ServerStreamingMethodResult as ServerStreamingMethodResult, StatusRequest$1 as StatusRequest, StatusResponse$1 as StatusResponse, StreamDataRequest$1 as StreamDataRequest, StreamDataResponse$1 as StreamDataResponse, SystemMessage$1 as SystemMessage, stream_dataFinalityFromJSON as dataFinalityFromJSON, stream_dataFinalityToJSON as dataFinalityToJSON, stream_dataProductionFromJSON as dataProductionFromJSON, stream_dataProductionToJSON as dataProductionToJSON, stream_protobufPackage as protobufPackage };
|
|
416
431
|
}
|
|
417
432
|
|
|
418
433
|
/** Bytes encoded as a 0x-prefixed hex string. */
|
|
@@ -438,6 +453,18 @@ declare const cursorFromProto: (i: CursorProto, overrideOptions?: _effect_schema
|
|
|
438
453
|
declare const CursorFromBytes: Schema.transform<Schema.Schema<Uint8Array, Uint8Array, never>, Schema.Schema<Cursor, CursorProto, never>>;
|
|
439
454
|
declare const cursorToBytes: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions) => Uint8Array;
|
|
440
455
|
declare const cursorFromBytes: (i: Uint8Array, overrideOptions?: _effect_schema_AST.ParseOptions) => Cursor;
|
|
456
|
+
declare function isCursor(value: unknown): value is Cursor;
|
|
457
|
+
/** Normalize a cursor.
|
|
458
|
+
*
|
|
459
|
+
* The challenge is that the `Cursor` validator expects `uniqueKey` to be either a `0x${string}`
|
|
460
|
+
* or not present at all. Setting the field to `undefined` will result in a validation error.
|
|
461
|
+
*
|
|
462
|
+
* @param cursor The cursor to normalize
|
|
463
|
+
*/
|
|
464
|
+
declare function normalizeCursor(cursor: {
|
|
465
|
+
orderKey: bigint;
|
|
466
|
+
uniqueKey: string | null;
|
|
467
|
+
}): Cursor;
|
|
441
468
|
|
|
442
469
|
/** The request to the `status` endpoint. */
|
|
443
470
|
declare const StatusRequest: Schema.Struct<{}>;
|
|
@@ -478,6 +505,9 @@ declare const statusResponseFromProto: (i: {
|
|
|
478
505
|
/** Data finality. */
|
|
479
506
|
declare const DataFinality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
480
507
|
type DataFinality = typeof DataFinality.Type;
|
|
508
|
+
/** Data production mode. */
|
|
509
|
+
declare const DataProduction: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
510
|
+
type DataProduction = typeof DataProduction.Type;
|
|
481
511
|
declare const Duration: Schema.Struct<{
|
|
482
512
|
seconds: typeof Schema.BigIntFromSelf;
|
|
483
513
|
nanos: typeof Schema.Number;
|
|
@@ -528,13 +558,13 @@ type StdErr = typeof StdErr.Type;
|
|
|
528
558
|
declare const SystemMessage: Schema.Struct<{
|
|
529
559
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
530
560
|
systemMessage: Schema.Struct<{
|
|
531
|
-
output: Schema.
|
|
561
|
+
output: Schema.Union<[Schema.Struct<{
|
|
532
562
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
533
563
|
stdout: typeof Schema.String;
|
|
534
564
|
}>, Schema.Struct<{
|
|
535
565
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
536
566
|
stderr: typeof Schema.String;
|
|
537
|
-
}>]
|
|
567
|
+
}>]>;
|
|
538
568
|
}>;
|
|
539
569
|
}>;
|
|
540
570
|
type SystemMessage = typeof SystemMessage.Type;
|
|
@@ -542,8 +572,9 @@ declare const Data: <TA, TR>(schema: Schema.Schema<TA | null, Uint8Array, TR>) =
|
|
|
542
572
|
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
543
573
|
data: Schema.Struct<{
|
|
544
574
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
545
|
-
endCursor: Schema.
|
|
575
|
+
endCursor: Schema.Schema<Cursor, CursorProto, never>;
|
|
546
576
|
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
577
|
+
production: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
547
578
|
data: Schema.Array$<Schema.Schema<TA | null, Uint8Array, TR>>;
|
|
548
579
|
}>;
|
|
549
580
|
}>;
|
|
@@ -562,13 +593,13 @@ declare const ResponseWithoutData: Schema.Union<[Schema.Struct<{
|
|
|
562
593
|
}>, Schema.Struct<{
|
|
563
594
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
564
595
|
systemMessage: Schema.Struct<{
|
|
565
|
-
output: Schema.
|
|
596
|
+
output: Schema.Union<[Schema.Struct<{
|
|
566
597
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
567
598
|
stdout: typeof Schema.String;
|
|
568
599
|
}>, Schema.Struct<{
|
|
569
600
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
570
601
|
stderr: typeof Schema.String;
|
|
571
|
-
}>]
|
|
602
|
+
}>]>;
|
|
572
603
|
}>;
|
|
573
604
|
}>]>;
|
|
574
605
|
type ResponseWithoutData = typeof ResponseWithoutData.Type;
|
|
@@ -576,8 +607,9 @@ declare const StreamDataResponse: <TA, TR>(data: Schema.Schema<TA | null, Uint8A
|
|
|
576
607
|
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
577
608
|
data: Schema.Struct<{
|
|
578
609
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
579
|
-
endCursor: Schema.
|
|
610
|
+
endCursor: Schema.Schema<Cursor, CursorProto, never>;
|
|
580
611
|
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
612
|
+
production: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
581
613
|
data: Schema.Array$<Schema.Schema<TA | null, Uint8Array, TR>>;
|
|
582
614
|
}>;
|
|
583
615
|
}>, Schema.Struct<{
|
|
@@ -595,21 +627,22 @@ declare const StreamDataResponse: <TA, TR>(data: Schema.Schema<TA | null, Uint8A
|
|
|
595
627
|
}>, Schema.Struct<{
|
|
596
628
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
597
629
|
systemMessage: Schema.Struct<{
|
|
598
|
-
output: Schema.
|
|
630
|
+
output: Schema.Union<[Schema.Struct<{
|
|
599
631
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
600
632
|
stdout: typeof Schema.String;
|
|
601
633
|
}>, Schema.Struct<{
|
|
602
634
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
603
635
|
stderr: typeof Schema.String;
|
|
604
|
-
}>]
|
|
636
|
+
}>]>;
|
|
605
637
|
}>;
|
|
606
638
|
}>]>;
|
|
607
639
|
type StreamDataResponse<TA> = ResponseWithoutData | {
|
|
608
640
|
_tag: "data";
|
|
609
641
|
data: {
|
|
610
642
|
cursor?: Cursor | undefined;
|
|
611
|
-
endCursor
|
|
643
|
+
endCursor: Cursor;
|
|
612
644
|
finality: DataFinality;
|
|
645
|
+
production: DataProduction;
|
|
613
646
|
data: readonly (TA | null)[];
|
|
614
647
|
};
|
|
615
648
|
};
|
|
@@ -641,8 +674,9 @@ declare class StreamConfig<TFilter, TBlock> {
|
|
|
641
674
|
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
642
675
|
data: Schema.Struct<{
|
|
643
676
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
644
|
-
endCursor: Schema.
|
|
677
|
+
endCursor: Schema.Schema<Cursor, CursorProto, never>;
|
|
645
678
|
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
679
|
+
production: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
646
680
|
data: Schema.Array$<Schema.Schema<TBlock | null, Uint8Array, never>>;
|
|
647
681
|
}>;
|
|
648
682
|
}>, Schema.Struct<{
|
|
@@ -660,24 +694,29 @@ declare class StreamConfig<TFilter, TBlock> {
|
|
|
660
694
|
}>, Schema.Struct<{
|
|
661
695
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
662
696
|
systemMessage: Schema.Struct<{
|
|
663
|
-
output: Schema.
|
|
697
|
+
output: Schema.Union<[Schema.Struct<{
|
|
664
698
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
665
699
|
stdout: typeof Schema.String;
|
|
666
700
|
}>, Schema.Struct<{
|
|
667
701
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
668
702
|
stderr: typeof Schema.String;
|
|
669
|
-
}>]
|
|
703
|
+
}>]>;
|
|
670
704
|
}>;
|
|
671
705
|
}>]>;
|
|
672
706
|
}
|
|
673
707
|
|
|
708
|
+
declare class TimeoutError extends Error {
|
|
709
|
+
constructor(timeout: number);
|
|
710
|
+
}
|
|
674
711
|
/** Client call options. */
|
|
675
712
|
interface ClientCallOptions {
|
|
676
713
|
signal?: AbortSignal;
|
|
677
714
|
}
|
|
678
715
|
interface StreamDataOptions extends ClientCallOptions {
|
|
679
|
-
/** Stop at the specified cursor (inclusive) */
|
|
716
|
+
/** Stop at the specified cursor (inclusive). */
|
|
680
717
|
endingCursor?: Cursor;
|
|
718
|
+
/** Timeout between messages, in milliseconds. */
|
|
719
|
+
timeout?: number;
|
|
681
720
|
}
|
|
682
721
|
/** DNA client. */
|
|
683
722
|
interface Client<TFilter, TBlock> {
|
|
@@ -686,8 +725,13 @@ interface Client<TFilter, TBlock> {
|
|
|
686
725
|
/** Start streaming data from the DNA server. */
|
|
687
726
|
streamData(request: StreamDataRequest<TFilter>, options?: StreamDataOptions): AsyncIterable<StreamDataResponse<TBlock>>;
|
|
688
727
|
}
|
|
728
|
+
type CreateClientOptions = {
|
|
729
|
+
defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<DnaStreamDefinition>>;
|
|
730
|
+
credentials?: ChannelCredentials;
|
|
731
|
+
channelOptions?: ChannelOptions;
|
|
732
|
+
};
|
|
689
733
|
/** Create a client connecting to the DNA grpc service. */
|
|
690
|
-
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string,
|
|
734
|
+
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string, options?: CreateClientOptions): GrpcClient<TFilter, TBlock>;
|
|
691
735
|
declare class GrpcClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
692
736
|
private config;
|
|
693
737
|
private client;
|
|
@@ -709,4 +753,4 @@ declare class StreamDataIterable<TBlock> {
|
|
|
709
753
|
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
710
754
|
}
|
|
711
755
|
|
|
712
|
-
export {
|
|
756
|
+
export { StreamConfig as A, Bytes as B, type CursorProto as C, type DnaStreamClient as D, type ClientCallOptions as E, Finalize as F, type StreamDataOptions as G, Heartbeat as H, Invalidate as I, type Client as J, type CreateClientOptions as K, createClient as L, GrpcClient as M, StreamDataIterable as N, DataFinality$1 as O, DataProduction$1 as P, StatusRequest as S, TimeoutError as T, _Cursor as _, DnaStreamDefinition as a, BytesFromUint8Array as b, Cursor as c, createCursor as d, cursorToProto as e, cursorFromProto as f, CursorFromBytes as g, cursorToBytes as h, cursorFromBytes as i, isCursor as j, statusRequestToProto as k, statusRequestFromProto as l, StatusResponse as m, normalizeCursor as n, statusResponseToProto as o, statusResponseFromProto as p, DataFinality as q, DataProduction as r, stream as s, Duration as t, StreamDataRequest as u, StdOut as v, StdErr as w, SystemMessage as x, Data as y, StreamDataResponse as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from '@effect/schema';
|
|
2
|
-
import { DefaultCallOptions, NormalizedServiceDefinition } from 'nice-grpc';
|
|
2
|
+
import { DefaultCallOptions, NormalizedServiceDefinition, ChannelCredentials, ChannelOptions } from 'nice-grpc';
|
|
3
3
|
import { CallContext, CallOptions } from 'nice-grpc-common';
|
|
4
4
|
import _m0 from 'protobufjs/minimal.js';
|
|
5
5
|
import * as _effect_schema_AST from '@effect/schema/AST';
|
|
@@ -115,6 +115,17 @@ declare enum DataFinality$1 {
|
|
|
115
115
|
}
|
|
116
116
|
declare function dataFinalityFromJSON(object: any): DataFinality$1;
|
|
117
117
|
declare function dataFinalityToJSON(object: DataFinality$1): string;
|
|
118
|
+
/** Data production mode. */
|
|
119
|
+
declare enum DataProduction$1 {
|
|
120
|
+
UNKNOWN = 0,
|
|
121
|
+
/** BACKFILL - Data is for a backfilled block. */
|
|
122
|
+
BACKFILL = 1,
|
|
123
|
+
/** LIVE - Data is for a live block. */
|
|
124
|
+
LIVE = 2,
|
|
125
|
+
UNRECOGNIZED = -1
|
|
126
|
+
}
|
|
127
|
+
declare function dataProductionFromJSON(object: any): DataProduction$1;
|
|
128
|
+
declare function dataProductionToJSON(object: DataProduction$1): string;
|
|
118
129
|
/** A cursor over the stream content. */
|
|
119
130
|
interface Cursor$1 {
|
|
120
131
|
/**
|
|
@@ -286,6 +297,8 @@ interface Data$1 {
|
|
|
286
297
|
* This message contains chain-specific data serialized using protobuf.
|
|
287
298
|
*/
|
|
288
299
|
readonly data: readonly Uint8Array[];
|
|
300
|
+
/** The production mode of the block. */
|
|
301
|
+
readonly production: DataProduction$1;
|
|
289
302
|
}
|
|
290
303
|
declare const Data$1: {
|
|
291
304
|
encode(message: Data$1, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -410,9 +423,11 @@ type stream_DnaStreamServiceImplementation<CallContextExt = {}> = DnaStreamServi
|
|
|
410
423
|
type stream_ServerStreamingMethodResult<Response> = ServerStreamingMethodResult<Response>;
|
|
411
424
|
declare const stream_dataFinalityFromJSON: typeof dataFinalityFromJSON;
|
|
412
425
|
declare const stream_dataFinalityToJSON: typeof dataFinalityToJSON;
|
|
426
|
+
declare const stream_dataProductionFromJSON: typeof dataProductionFromJSON;
|
|
427
|
+
declare const stream_dataProductionToJSON: typeof dataProductionToJSON;
|
|
413
428
|
declare const stream_protobufPackage: typeof protobufPackage;
|
|
414
429
|
declare namespace stream {
|
|
415
|
-
export { Cursor$1 as Cursor, Data$1 as Data, DataFinality$1 as DataFinality, type stream_DeepPartial as DeepPartial, type stream_DnaStreamClient as DnaStreamClient, stream_DnaStreamDefinition as DnaStreamDefinition, type stream_DnaStreamServiceImplementation as DnaStreamServiceImplementation, Finalize$1 as Finalize, Heartbeat$1 as Heartbeat, Invalidate$1 as Invalidate, type stream_ServerStreamingMethodResult as ServerStreamingMethodResult, StatusRequest$1 as StatusRequest, StatusResponse$1 as StatusResponse, StreamDataRequest$1 as StreamDataRequest, StreamDataResponse$1 as StreamDataResponse, SystemMessage$1 as SystemMessage, stream_dataFinalityFromJSON as dataFinalityFromJSON, stream_dataFinalityToJSON as dataFinalityToJSON, stream_protobufPackage as protobufPackage };
|
|
430
|
+
export { Cursor$1 as Cursor, Data$1 as Data, DataFinality$1 as DataFinality, DataProduction$1 as DataProduction, type stream_DeepPartial as DeepPartial, type stream_DnaStreamClient as DnaStreamClient, stream_DnaStreamDefinition as DnaStreamDefinition, type stream_DnaStreamServiceImplementation as DnaStreamServiceImplementation, Finalize$1 as Finalize, Heartbeat$1 as Heartbeat, Invalidate$1 as Invalidate, type stream_ServerStreamingMethodResult as ServerStreamingMethodResult, StatusRequest$1 as StatusRequest, StatusResponse$1 as StatusResponse, StreamDataRequest$1 as StreamDataRequest, StreamDataResponse$1 as StreamDataResponse, SystemMessage$1 as SystemMessage, stream_dataFinalityFromJSON as dataFinalityFromJSON, stream_dataFinalityToJSON as dataFinalityToJSON, stream_dataProductionFromJSON as dataProductionFromJSON, stream_dataProductionToJSON as dataProductionToJSON, stream_protobufPackage as protobufPackage };
|
|
416
431
|
}
|
|
417
432
|
|
|
418
433
|
/** Bytes encoded as a 0x-prefixed hex string. */
|
|
@@ -438,6 +453,18 @@ declare const cursorFromProto: (i: CursorProto, overrideOptions?: _effect_schema
|
|
|
438
453
|
declare const CursorFromBytes: Schema.transform<Schema.Schema<Uint8Array, Uint8Array, never>, Schema.Schema<Cursor, CursorProto, never>>;
|
|
439
454
|
declare const cursorToBytes: (a: Cursor, overrideOptions?: _effect_schema_AST.ParseOptions) => Uint8Array;
|
|
440
455
|
declare const cursorFromBytes: (i: Uint8Array, overrideOptions?: _effect_schema_AST.ParseOptions) => Cursor;
|
|
456
|
+
declare function isCursor(value: unknown): value is Cursor;
|
|
457
|
+
/** Normalize a cursor.
|
|
458
|
+
*
|
|
459
|
+
* The challenge is that the `Cursor` validator expects `uniqueKey` to be either a `0x${string}`
|
|
460
|
+
* or not present at all. Setting the field to `undefined` will result in a validation error.
|
|
461
|
+
*
|
|
462
|
+
* @param cursor The cursor to normalize
|
|
463
|
+
*/
|
|
464
|
+
declare function normalizeCursor(cursor: {
|
|
465
|
+
orderKey: bigint;
|
|
466
|
+
uniqueKey: string | null;
|
|
467
|
+
}): Cursor;
|
|
441
468
|
|
|
442
469
|
/** The request to the `status` endpoint. */
|
|
443
470
|
declare const StatusRequest: Schema.Struct<{}>;
|
|
@@ -478,6 +505,9 @@ declare const statusResponseFromProto: (i: {
|
|
|
478
505
|
/** Data finality. */
|
|
479
506
|
declare const DataFinality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
480
507
|
type DataFinality = typeof DataFinality.Type;
|
|
508
|
+
/** Data production mode. */
|
|
509
|
+
declare const DataProduction: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
510
|
+
type DataProduction = typeof DataProduction.Type;
|
|
481
511
|
declare const Duration: Schema.Struct<{
|
|
482
512
|
seconds: typeof Schema.BigIntFromSelf;
|
|
483
513
|
nanos: typeof Schema.Number;
|
|
@@ -528,13 +558,13 @@ type StdErr = typeof StdErr.Type;
|
|
|
528
558
|
declare const SystemMessage: Schema.Struct<{
|
|
529
559
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
530
560
|
systemMessage: Schema.Struct<{
|
|
531
|
-
output: Schema.
|
|
561
|
+
output: Schema.Union<[Schema.Struct<{
|
|
532
562
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
533
563
|
stdout: typeof Schema.String;
|
|
534
564
|
}>, Schema.Struct<{
|
|
535
565
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
536
566
|
stderr: typeof Schema.String;
|
|
537
|
-
}>]
|
|
567
|
+
}>]>;
|
|
538
568
|
}>;
|
|
539
569
|
}>;
|
|
540
570
|
type SystemMessage = typeof SystemMessage.Type;
|
|
@@ -542,8 +572,9 @@ declare const Data: <TA, TR>(schema: Schema.Schema<TA | null, Uint8Array, TR>) =
|
|
|
542
572
|
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
543
573
|
data: Schema.Struct<{
|
|
544
574
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
545
|
-
endCursor: Schema.
|
|
575
|
+
endCursor: Schema.Schema<Cursor, CursorProto, never>;
|
|
546
576
|
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
577
|
+
production: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
547
578
|
data: Schema.Array$<Schema.Schema<TA | null, Uint8Array, TR>>;
|
|
548
579
|
}>;
|
|
549
580
|
}>;
|
|
@@ -562,13 +593,13 @@ declare const ResponseWithoutData: Schema.Union<[Schema.Struct<{
|
|
|
562
593
|
}>, Schema.Struct<{
|
|
563
594
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
564
595
|
systemMessage: Schema.Struct<{
|
|
565
|
-
output: Schema.
|
|
596
|
+
output: Schema.Union<[Schema.Struct<{
|
|
566
597
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
567
598
|
stdout: typeof Schema.String;
|
|
568
599
|
}>, Schema.Struct<{
|
|
569
600
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
570
601
|
stderr: typeof Schema.String;
|
|
571
|
-
}>]
|
|
602
|
+
}>]>;
|
|
572
603
|
}>;
|
|
573
604
|
}>]>;
|
|
574
605
|
type ResponseWithoutData = typeof ResponseWithoutData.Type;
|
|
@@ -576,8 +607,9 @@ declare const StreamDataResponse: <TA, TR>(data: Schema.Schema<TA | null, Uint8A
|
|
|
576
607
|
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
577
608
|
data: Schema.Struct<{
|
|
578
609
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
579
|
-
endCursor: Schema.
|
|
610
|
+
endCursor: Schema.Schema<Cursor, CursorProto, never>;
|
|
580
611
|
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
612
|
+
production: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
581
613
|
data: Schema.Array$<Schema.Schema<TA | null, Uint8Array, TR>>;
|
|
582
614
|
}>;
|
|
583
615
|
}>, Schema.Struct<{
|
|
@@ -595,21 +627,22 @@ declare const StreamDataResponse: <TA, TR>(data: Schema.Schema<TA | null, Uint8A
|
|
|
595
627
|
}>, Schema.Struct<{
|
|
596
628
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
597
629
|
systemMessage: Schema.Struct<{
|
|
598
|
-
output: Schema.
|
|
630
|
+
output: Schema.Union<[Schema.Struct<{
|
|
599
631
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
600
632
|
stdout: typeof Schema.String;
|
|
601
633
|
}>, Schema.Struct<{
|
|
602
634
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
603
635
|
stderr: typeof Schema.String;
|
|
604
|
-
}>]
|
|
636
|
+
}>]>;
|
|
605
637
|
}>;
|
|
606
638
|
}>]>;
|
|
607
639
|
type StreamDataResponse<TA> = ResponseWithoutData | {
|
|
608
640
|
_tag: "data";
|
|
609
641
|
data: {
|
|
610
642
|
cursor?: Cursor | undefined;
|
|
611
|
-
endCursor
|
|
643
|
+
endCursor: Cursor;
|
|
612
644
|
finality: DataFinality;
|
|
645
|
+
production: DataProduction;
|
|
613
646
|
data: readonly (TA | null)[];
|
|
614
647
|
};
|
|
615
648
|
};
|
|
@@ -641,8 +674,9 @@ declare class StreamConfig<TFilter, TBlock> {
|
|
|
641
674
|
_tag: Schema.PropertySignature<":", "data", "$case", ":", "data", false, never>;
|
|
642
675
|
data: Schema.Struct<{
|
|
643
676
|
cursor: Schema.optional<Schema.Schema<Cursor, CursorProto, never>>;
|
|
644
|
-
endCursor: Schema.
|
|
677
|
+
endCursor: Schema.Schema<Cursor, CursorProto, never>;
|
|
645
678
|
finality: Schema.transform<Schema.Enums<typeof DataFinality$1>, Schema.Literal<["finalized", "accepted", "pending", "unknown"]>>;
|
|
679
|
+
production: Schema.transform<Schema.Enums<typeof DataProduction$1>, Schema.Literal<["backfill", "live", "unknown"]>>;
|
|
646
680
|
data: Schema.Array$<Schema.Schema<TBlock | null, Uint8Array, never>>;
|
|
647
681
|
}>;
|
|
648
682
|
}>, Schema.Struct<{
|
|
@@ -660,24 +694,29 @@ declare class StreamConfig<TFilter, TBlock> {
|
|
|
660
694
|
}>, Schema.Struct<{
|
|
661
695
|
_tag: Schema.PropertySignature<":", "systemMessage", "$case", ":", "systemMessage", false, never>;
|
|
662
696
|
systemMessage: Schema.Struct<{
|
|
663
|
-
output: Schema.
|
|
697
|
+
output: Schema.Union<[Schema.Struct<{
|
|
664
698
|
_tag: Schema.PropertySignature<":", "stdout", "$case", ":", "stdout", false, never>;
|
|
665
699
|
stdout: typeof Schema.String;
|
|
666
700
|
}>, Schema.Struct<{
|
|
667
701
|
_tag: Schema.PropertySignature<":", "stderr", "$case", ":", "stderr", false, never>;
|
|
668
702
|
stderr: typeof Schema.String;
|
|
669
|
-
}>]
|
|
703
|
+
}>]>;
|
|
670
704
|
}>;
|
|
671
705
|
}>]>;
|
|
672
706
|
}
|
|
673
707
|
|
|
708
|
+
declare class TimeoutError extends Error {
|
|
709
|
+
constructor(timeout: number);
|
|
710
|
+
}
|
|
674
711
|
/** Client call options. */
|
|
675
712
|
interface ClientCallOptions {
|
|
676
713
|
signal?: AbortSignal;
|
|
677
714
|
}
|
|
678
715
|
interface StreamDataOptions extends ClientCallOptions {
|
|
679
|
-
/** Stop at the specified cursor (inclusive) */
|
|
716
|
+
/** Stop at the specified cursor (inclusive). */
|
|
680
717
|
endingCursor?: Cursor;
|
|
718
|
+
/** Timeout between messages, in milliseconds. */
|
|
719
|
+
timeout?: number;
|
|
681
720
|
}
|
|
682
721
|
/** DNA client. */
|
|
683
722
|
interface Client<TFilter, TBlock> {
|
|
@@ -686,8 +725,13 @@ interface Client<TFilter, TBlock> {
|
|
|
686
725
|
/** Start streaming data from the DNA server. */
|
|
687
726
|
streamData(request: StreamDataRequest<TFilter>, options?: StreamDataOptions): AsyncIterable<StreamDataResponse<TBlock>>;
|
|
688
727
|
}
|
|
728
|
+
type CreateClientOptions = {
|
|
729
|
+
defaultCallOptions?: DefaultCallOptions<NormalizedServiceDefinition<DnaStreamDefinition>>;
|
|
730
|
+
credentials?: ChannelCredentials;
|
|
731
|
+
channelOptions?: ChannelOptions;
|
|
732
|
+
};
|
|
689
733
|
/** Create a client connecting to the DNA grpc service. */
|
|
690
|
-
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string,
|
|
734
|
+
declare function createClient<TFilter, TBlock>(config: StreamConfig<TFilter, TBlock>, streamUrl: string, options?: CreateClientOptions): GrpcClient<TFilter, TBlock>;
|
|
691
735
|
declare class GrpcClient<TFilter, TBlock> implements Client<TFilter, TBlock> {
|
|
692
736
|
private config;
|
|
693
737
|
private client;
|
|
@@ -709,4 +753,4 @@ declare class StreamDataIterable<TBlock> {
|
|
|
709
753
|
[Symbol.asyncIterator](): AsyncIterator<StreamDataResponse<TBlock>>;
|
|
710
754
|
}
|
|
711
755
|
|
|
712
|
-
export {
|
|
756
|
+
export { StreamConfig as A, Bytes as B, type CursorProto as C, type DnaStreamClient as D, type ClientCallOptions as E, Finalize as F, type StreamDataOptions as G, Heartbeat as H, Invalidate as I, type Client as J, type CreateClientOptions as K, createClient as L, GrpcClient as M, StreamDataIterable as N, DataFinality$1 as O, DataProduction$1 as P, StatusRequest as S, TimeoutError as T, _Cursor as _, DnaStreamDefinition as a, BytesFromUint8Array as b, Cursor as c, createCursor as d, cursorToProto as e, cursorFromProto as f, CursorFromBytes as g, cursorToBytes as h, cursorFromBytes as i, isCursor as j, statusRequestToProto as k, statusRequestFromProto as l, StatusResponse as m, normalizeCursor as n, statusResponseToProto as o, statusResponseFromProto as p, DataFinality as q, DataProduction as r, stream as s, Duration as t, StreamDataRequest as u, StdOut as v, StdErr as w, SystemMessage as x, Data as y, StreamDataResponse as z };
|
|
@@ -128,6 +128,43 @@ function dataFinalityToJSON(object) {
|
|
|
128
128
|
return "UNRECOGNIZED";
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
+
var DataProduction$1 = /* @__PURE__ */ ((DataProduction2) => {
|
|
132
|
+
DataProduction2[DataProduction2["UNKNOWN"] = 0] = "UNKNOWN";
|
|
133
|
+
DataProduction2[DataProduction2["BACKFILL"] = 1] = "BACKFILL";
|
|
134
|
+
DataProduction2[DataProduction2["LIVE"] = 2] = "LIVE";
|
|
135
|
+
DataProduction2[DataProduction2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
136
|
+
return DataProduction2;
|
|
137
|
+
})(DataProduction$1 || {});
|
|
138
|
+
function dataProductionFromJSON(object) {
|
|
139
|
+
switch (object) {
|
|
140
|
+
case 0:
|
|
141
|
+
case "DATA_PRODUCTION_UNKNOWN":
|
|
142
|
+
return 0 /* UNKNOWN */;
|
|
143
|
+
case 1:
|
|
144
|
+
case "DATA_PRODUCTION_BACKFILL":
|
|
145
|
+
return 1 /* BACKFILL */;
|
|
146
|
+
case 2:
|
|
147
|
+
case "DATA_PRODUCTION_LIVE":
|
|
148
|
+
return 2 /* LIVE */;
|
|
149
|
+
case -1:
|
|
150
|
+
case "UNRECOGNIZED":
|
|
151
|
+
default:
|
|
152
|
+
return -1 /* UNRECOGNIZED */;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function dataProductionToJSON(object) {
|
|
156
|
+
switch (object) {
|
|
157
|
+
case 0 /* UNKNOWN */:
|
|
158
|
+
return "DATA_PRODUCTION_UNKNOWN";
|
|
159
|
+
case 1 /* BACKFILL */:
|
|
160
|
+
return "DATA_PRODUCTION_BACKFILL";
|
|
161
|
+
case 2 /* LIVE */:
|
|
162
|
+
return "DATA_PRODUCTION_LIVE";
|
|
163
|
+
case -1 /* UNRECOGNIZED */:
|
|
164
|
+
default:
|
|
165
|
+
return "UNRECOGNIZED";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
131
168
|
function createBaseCursor() {
|
|
132
169
|
return { orderKey: BigInt("0"), uniqueKey: new Uint8Array(0) };
|
|
133
170
|
}
|
|
@@ -656,7 +693,7 @@ const Finalize$1 = {
|
|
|
656
693
|
}
|
|
657
694
|
};
|
|
658
695
|
function createBaseData() {
|
|
659
|
-
return { cursor: void 0, endCursor: void 0, finality: 0, data: [] };
|
|
696
|
+
return { cursor: void 0, endCursor: void 0, finality: 0, data: [], production: 0 };
|
|
660
697
|
}
|
|
661
698
|
const Data$1 = {
|
|
662
699
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -672,6 +709,9 @@ const Data$1 = {
|
|
|
672
709
|
for (const v of message.data) {
|
|
673
710
|
writer.uint32(34).bytes(v);
|
|
674
711
|
}
|
|
712
|
+
if (message.production !== 0) {
|
|
713
|
+
writer.uint32(40).int32(message.production);
|
|
714
|
+
}
|
|
675
715
|
return writer;
|
|
676
716
|
},
|
|
677
717
|
decode(input, length) {
|
|
@@ -705,6 +745,12 @@ const Data$1 = {
|
|
|
705
745
|
}
|
|
706
746
|
message.data.push(reader.bytes());
|
|
707
747
|
continue;
|
|
748
|
+
case 5:
|
|
749
|
+
if (tag !== 40) {
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
message.production = reader.int32();
|
|
753
|
+
continue;
|
|
708
754
|
}
|
|
709
755
|
if ((tag & 7) === 4 || tag === 0) {
|
|
710
756
|
break;
|
|
@@ -718,7 +764,8 @@ const Data$1 = {
|
|
|
718
764
|
cursor: isSet$1(object.cursor) ? Cursor$1.fromJSON(object.cursor) : void 0,
|
|
719
765
|
endCursor: isSet$1(object.endCursor) ? Cursor$1.fromJSON(object.endCursor) : void 0,
|
|
720
766
|
finality: isSet$1(object.finality) ? dataFinalityFromJSON(object.finality) : 0,
|
|
721
|
-
data: globalThis.Array.isArray(object?.data) ? object.data.map((e) => bytesFromBase64(e)) : []
|
|
767
|
+
data: globalThis.Array.isArray(object?.data) ? object.data.map((e) => bytesFromBase64(e)) : [],
|
|
768
|
+
production: isSet$1(object.production) ? dataProductionFromJSON(object.production) : 0
|
|
722
769
|
};
|
|
723
770
|
},
|
|
724
771
|
toJSON(message) {
|
|
@@ -735,6 +782,9 @@ const Data$1 = {
|
|
|
735
782
|
if (message.data?.length) {
|
|
736
783
|
obj.data = message.data.map((e) => base64FromBytes(e));
|
|
737
784
|
}
|
|
785
|
+
if (message.production !== 0) {
|
|
786
|
+
obj.production = dataProductionToJSON(message.production);
|
|
787
|
+
}
|
|
738
788
|
return obj;
|
|
739
789
|
},
|
|
740
790
|
create(base) {
|
|
@@ -746,6 +796,7 @@ const Data$1 = {
|
|
|
746
796
|
message.endCursor = object.endCursor !== void 0 && object.endCursor !== null ? Cursor$1.fromPartial(object.endCursor) : void 0;
|
|
747
797
|
message.finality = object.finality ?? 0;
|
|
748
798
|
message.data = object.data?.map((e) => e) || [];
|
|
799
|
+
message.production = object.production ?? 0;
|
|
749
800
|
return message;
|
|
750
801
|
}
|
|
751
802
|
};
|
|
@@ -918,6 +969,7 @@ const stream = {
|
|
|
918
969
|
Cursor: Cursor$1,
|
|
919
970
|
Data: Data$1,
|
|
920
971
|
DataFinality: DataFinality$1,
|
|
972
|
+
DataProduction: DataProduction$1,
|
|
921
973
|
DnaStreamDefinition: DnaStreamDefinition,
|
|
922
974
|
Finalize: Finalize$1,
|
|
923
975
|
Heartbeat: Heartbeat$1,
|
|
@@ -929,6 +981,8 @@ const stream = {
|
|
|
929
981
|
SystemMessage: SystemMessage$1,
|
|
930
982
|
dataFinalityFromJSON: dataFinalityFromJSON,
|
|
931
983
|
dataFinalityToJSON: dataFinalityToJSON,
|
|
984
|
+
dataProductionFromJSON: dataProductionFromJSON,
|
|
985
|
+
dataProductionToJSON: dataProductionToJSON,
|
|
932
986
|
protobufPackage: protobufPackage$1
|
|
933
987
|
};
|
|
934
988
|
|
|
@@ -1090,6 +1144,21 @@ const CursorFromBytes = Schema.transform(
|
|
|
1090
1144
|
);
|
|
1091
1145
|
const cursorToBytes = Schema.encodeSync(CursorFromBytes);
|
|
1092
1146
|
const cursorFromBytes = Schema.decodeSync(CursorFromBytes);
|
|
1147
|
+
function isCursor(value) {
|
|
1148
|
+
return Schema.is(Cursor)(value);
|
|
1149
|
+
}
|
|
1150
|
+
function normalizeCursor(cursor) {
|
|
1151
|
+
if (cursor.uniqueKey !== null && cursor.uniqueKey.length > 0) {
|
|
1152
|
+
const uniqueKey = cursor.uniqueKey;
|
|
1153
|
+
return {
|
|
1154
|
+
orderKey: BigInt(cursor.orderKey),
|
|
1155
|
+
uniqueKey
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
return {
|
|
1159
|
+
orderKey: BigInt(cursor.orderKey)
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1093
1162
|
|
|
1094
1163
|
const DataFinality = Schema.transform(
|
|
1095
1164
|
Schema.Enums(DataFinality$1),
|
|
@@ -1116,6 +1185,29 @@ const DataFinality = Schema.transform(
|
|
|
1116
1185
|
}
|
|
1117
1186
|
}
|
|
1118
1187
|
);
|
|
1188
|
+
const DataProduction = Schema.transform(
|
|
1189
|
+
Schema.Enums(DataProduction$1),
|
|
1190
|
+
Schema.Literal("backfill", "live", "unknown"),
|
|
1191
|
+
{
|
|
1192
|
+
decode(value) {
|
|
1193
|
+
const enumMap = {
|
|
1194
|
+
[DataProduction$1.BACKFILL]: "backfill",
|
|
1195
|
+
[DataProduction$1.LIVE]: "live",
|
|
1196
|
+
[DataProduction$1.UNKNOWN]: "unknown",
|
|
1197
|
+
[DataProduction$1.UNRECOGNIZED]: "unknown"
|
|
1198
|
+
};
|
|
1199
|
+
return enumMap[value] ?? "unknown";
|
|
1200
|
+
},
|
|
1201
|
+
encode(value) {
|
|
1202
|
+
const enumMap = {
|
|
1203
|
+
backfill: DataProduction$1.BACKFILL,
|
|
1204
|
+
live: DataProduction$1.LIVE,
|
|
1205
|
+
unknown: DataProduction$1.UNKNOWN
|
|
1206
|
+
};
|
|
1207
|
+
return enumMap[value] ?? DataProduction$1.UNKNOWN;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
);
|
|
1119
1211
|
const Duration = Schema.Struct({
|
|
1120
1212
|
seconds: Schema.BigIntFromSelf,
|
|
1121
1213
|
nanos: Schema.Number
|
|
@@ -1152,15 +1244,16 @@ const StdErr = Schema.Struct({
|
|
|
1152
1244
|
const SystemMessage = Schema.Struct({
|
|
1153
1245
|
_tag: tag("systemMessage"),
|
|
1154
1246
|
systemMessage: Schema.Struct({
|
|
1155
|
-
output: Schema.
|
|
1247
|
+
output: Schema.Union(StdOut, StdErr)
|
|
1156
1248
|
})
|
|
1157
1249
|
});
|
|
1158
1250
|
const Data = (schema) => Schema.Struct({
|
|
1159
1251
|
_tag: tag("data"),
|
|
1160
1252
|
data: Schema.Struct({
|
|
1161
1253
|
cursor: Schema.optional(Cursor),
|
|
1162
|
-
endCursor:
|
|
1254
|
+
endCursor: Cursor,
|
|
1163
1255
|
finality: DataFinality,
|
|
1256
|
+
production: DataProduction,
|
|
1164
1257
|
data: Schema.Array(schema)
|
|
1165
1258
|
})
|
|
1166
1259
|
});
|
|
@@ -1212,4 +1305,4 @@ class StreamConfig {
|
|
|
1212
1305
|
}
|
|
1213
1306
|
}
|
|
1214
1307
|
|
|
1215
|
-
export { Bytes as B, Cursor as C, DnaStreamDefinition as D, Finalize as F, Heartbeat as H, Invalidate as I, MockFilter as M, StreamDataResponse as S, _Cursor as _, BytesFromUint8Array as a, cursorToProto as b, createCursor as c, cursorFromProto as d, CursorFromBytes as e, cursorToBytes as f, cursorFromBytes as g, DataFinality as h,
|
|
1308
|
+
export { Bytes as B, Cursor as C, DnaStreamDefinition as D, Finalize as F, Heartbeat as H, Invalidate as I, MockFilter as M, StreamDataResponse as S, _Cursor as _, BytesFromUint8Array as a, cursorToProto as b, createCursor as c, cursorFromProto as d, CursorFromBytes as e, cursorToBytes as f, cursorFromBytes as g, DataFinality as h, isCursor as i, DataProduction as j, Duration as k, StreamDataRequest as l, StdOut as m, normalizeCursor as n, StdErr as o, SystemMessage as p, Data as q, StreamConfig as r, stream as s, testing as t, MockBlock as u };
|