@ignex/nova 0.1.1 → 0.1.5
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/README.md +136 -33
- package/docs/ai/LOCAL_DEV.md +81 -0
- package/docs/ai/TREE.md +292 -0
- package/docs/architecture.md +101 -28
- package/docs/events.md +252 -0
- package/docs/generic-bindings.md +207 -0
- package/docs/publishing.md +2 -2
- package/docs/wire-format.md +74 -20
- package/index.ts +75 -27
- package/package.json +13 -2
- package/prebuilds/linux-x64/libignex_ffi.so +0 -0
- package/public/bindings.ts +24 -0
- package/public/client.ts +5 -1
- package/public/events.ts +71 -0
- package/public/generate.ts +510 -0
- package/public/internal.ts +16 -0
- package/public/nats.ts +9 -5
- package/public/server.ts +52 -16
- package/rust/src/ffi.rs +10 -0
- package/rust/src/generated/backend.rs +503 -0
- package/rust/src/transcode/generated.rs +377 -17
- package/src/bindings/assemble.ts +73 -0
- package/src/bindings/default.ts +65 -0
- package/src/bindings/types.ts +113 -0
- package/src/bridge/nats/inbound.ts +46 -0
- package/src/bridge/nats/index.ts +131 -0
- package/src/bridge/nats/real-transport.ts +133 -0
- package/src/bridge/nats/types.ts +80 -0
- package/src/bridge/subjects.ts +3 -0
- package/src/codegen/constants.ts +28 -0
- package/src/codegen/direct-gen.ts +564 -0
- package/src/codegen/fingerprint.ts +44 -0
- package/src/codegen/hash.ts +25 -0
- package/src/codegen/registry-gen.ts +246 -0
- package/src/codegen/rust-glue-gen.ts +552 -0
- package/src/codegen/schema-model.ts +363 -0
- package/src/codegen/ts-ser-gen.ts +230 -0
- package/src/codegen/typebox-to-fbs.ts +60 -0
- package/src/core/auth.ts +67 -5
- package/src/core/client-heartbeat.ts +2 -1
- package/src/core/client-reconnect.ts +9 -2
- package/src/core/client-rpc.ts +75 -0
- package/src/core/client-state.ts +63 -8
- package/src/core/client-wire.ts +148 -15
- package/src/core/client.ts +105 -31
- package/src/core/groups.ts +8 -0
- package/src/core/metrics.ts +42 -21
- package/src/core/outbound.ts +62 -11
- package/src/core/rate-limit.ts +69 -0
- package/src/core/replay.ts +41 -1
- package/src/core/resume.ts +181 -0
- package/src/core/rooms.ts +10 -3
- package/src/core/routing.ts +144 -12
- package/src/core/server/client-info.ts +37 -0
- package/src/core/server/http-routes.ts +59 -0
- package/src/core/server/index.ts +360 -0
- package/src/core/server/metrics-view.ts +53 -0
- package/src/core/server/socket-lifecycle.ts +57 -0
- package/src/core/state.ts +124 -14
- package/src/core/topic-log.ts +86 -0
- package/src/events/clients.ts +174 -0
- package/src/events/cluster/dedupe.ts +43 -0
- package/src/events/cluster/envelope.ts +149 -0
- package/src/events/cluster/index.ts +50 -0
- package/src/events/cluster/keys.ts +33 -0
- package/src/events/cluster/kinds.ts +32 -0
- package/src/events/cluster/presence-table.ts +99 -0
- package/src/events/cluster/presence.ts +53 -0
- package/src/events/cluster/redis-client.ts +50 -0
- package/src/events/cluster/store-memory.ts +67 -0
- package/src/events/cluster/store-redis.ts +44 -0
- package/src/events/cluster/subjects.ts +30 -0
- package/src/events/cluster/sync.ts +476 -0
- package/src/events/cluster/transport-nats.ts +24 -0
- package/src/events/cluster/transport-redis.ts +120 -0
- package/src/events/cluster-rpc.ts +196 -0
- package/src/events/data.ts +38 -0
- package/src/events/delivery.ts +83 -0
- package/src/events/emit.ts +173 -0
- package/src/events/global.ts +117 -0
- package/src/events/groups.ts +118 -0
- package/src/events/hub/context-factory.ts +79 -0
- package/src/events/hub/dispatch.ts +86 -0
- package/src/events/hub/index.ts +536 -0
- package/src/events/hub/internal.ts +31 -0
- package/src/events/hub/metrics-snapshot.ts +84 -0
- package/src/events/hub/resolve-cluster.ts +49 -0
- package/src/events/index.ts +61 -0
- package/src/events/queue.ts +123 -0
- package/src/events/registry.ts +214 -0
- package/src/events/schedule.ts +73 -0
- package/src/events/trace.ts +283 -0
- package/src/events/types/client.ts +68 -0
- package/src/events/types/cluster.ts +40 -0
- package/src/events/types/context.ts +50 -0
- package/src/events/types/emit-target.ts +29 -0
- package/src/events/types/groups.ts +35 -0
- package/src/events/types/hub.ts +124 -0
- package/src/events/types/index.ts +30 -0
- package/src/events/types/metrics.ts +52 -0
- package/src/events/types/options.ts +62 -0
- package/src/generated/direct-ser.ts +148 -60
- package/src/generated/fbs/backend.fbs +24 -1
- package/src/generated/registry.ts +94 -33
- package/src/generated/rust/backend_generated.rs +503 -0
- package/src/generated/ts/backend.ts +4 -0
- package/src/generated/ts/resume.ts +74 -0
- package/src/generated/ts/resumed.ts +88 -0
- package/src/generated/ts/rpc-call.ts +112 -0
- package/src/generated/ts/rpc-result.ts +126 -0
- package/src/generated/ts/snapshot-request.ts +19 -5
- package/src/generated/ts-ser.ts +110 -17
- package/src/generated/wire-registry.json +7 -2
- package/src/native/ffi.ts +85 -28
- package/src/schema/index.ts +49 -2
- package/src/server.ts +7 -3
- package/src/transport/transport.ts +200 -79
- package/src/bridge/nats.ts +0 -269
- package/src/core/server.ts +0 -294
- package/src/transport/stats.ts +0 -44
|
@@ -2544,6 +2544,7 @@ impl<'a> ::flatbuffers::Follow<'a> for SnapshotRequest<'a> {
|
|
|
2544
2544
|
|
|
2545
2545
|
impl<'a> SnapshotRequest<'a> {
|
|
2546
2546
|
pub const VT_TOPIC: ::flatbuffers::VOffsetT = 4;
|
|
2547
|
+
pub const VT_FROM_SEQ: ::flatbuffers::VOffsetT = 6;
|
|
2547
2548
|
|
|
2548
2549
|
#[inline]
|
|
2549
2550
|
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
@@ -2555,6 +2556,7 @@ impl<'a> SnapshotRequest<'a> {
|
|
|
2555
2556
|
args: &'args SnapshotRequestArgs<'args>
|
|
2556
2557
|
) -> ::flatbuffers::WIPOffset<SnapshotRequest<'bldr>> {
|
|
2557
2558
|
let mut builder = SnapshotRequestBuilder::new(_fbb);
|
|
2559
|
+
builder.add_from_seq(args.from_seq);
|
|
2558
2560
|
if let Some(x) = args.topic { builder.add_topic(x); }
|
|
2559
2561
|
builder.finish()
|
|
2560
2562
|
}
|
|
@@ -2567,6 +2569,13 @@ impl<'a> SnapshotRequest<'a> {
|
|
|
2567
2569
|
// which contains a valid value in this slot
|
|
2568
2570
|
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(SnapshotRequest::VT_TOPIC, None)}
|
|
2569
2571
|
}
|
|
2572
|
+
#[inline]
|
|
2573
|
+
pub fn from_seq(&self) -> i64 {
|
|
2574
|
+
// Safety:
|
|
2575
|
+
// Created from valid Table for this object
|
|
2576
|
+
// which contains a valid value in this slot
|
|
2577
|
+
unsafe { self._tab.get::<i64>(SnapshotRequest::VT_FROM_SEQ, Some(0)).unwrap()}
|
|
2578
|
+
}
|
|
2570
2579
|
}
|
|
2571
2580
|
|
|
2572
2581
|
impl ::flatbuffers::Verifiable for SnapshotRequest<'_> {
|
|
@@ -2576,18 +2585,21 @@ impl ::flatbuffers::Verifiable for SnapshotRequest<'_> {
|
|
|
2576
2585
|
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2577
2586
|
v.visit_table(pos)?
|
|
2578
2587
|
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("topic", Self::VT_TOPIC, false)?
|
|
2588
|
+
.visit_field::<i64>("from_seq", Self::VT_FROM_SEQ, false)?
|
|
2579
2589
|
.finish();
|
|
2580
2590
|
Ok(())
|
|
2581
2591
|
}
|
|
2582
2592
|
}
|
|
2583
2593
|
pub struct SnapshotRequestArgs<'a> {
|
|
2584
2594
|
pub topic: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
2595
|
+
pub from_seq: i64,
|
|
2585
2596
|
}
|
|
2586
2597
|
impl<'a> Default for SnapshotRequestArgs<'a> {
|
|
2587
2598
|
#[inline]
|
|
2588
2599
|
fn default() -> Self {
|
|
2589
2600
|
SnapshotRequestArgs {
|
|
2590
2601
|
topic: None,
|
|
2602
|
+
from_seq: 0,
|
|
2591
2603
|
}
|
|
2592
2604
|
}
|
|
2593
2605
|
}
|
|
@@ -2602,6 +2614,10 @@ impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> SnapshotRequestBuilder<'a, 'b
|
|
|
2602
2614
|
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(SnapshotRequest::VT_TOPIC, topic);
|
|
2603
2615
|
}
|
|
2604
2616
|
#[inline]
|
|
2617
|
+
pub fn add_from_seq(&mut self, from_seq: i64) {
|
|
2618
|
+
self.fbb_.push_slot::<i64>(SnapshotRequest::VT_FROM_SEQ, from_seq, 0);
|
|
2619
|
+
}
|
|
2620
|
+
#[inline]
|
|
2605
2621
|
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> SnapshotRequestBuilder<'a, 'b, A> {
|
|
2606
2622
|
let start = _fbb.start_table();
|
|
2607
2623
|
SnapshotRequestBuilder {
|
|
@@ -2620,6 +2636,7 @@ impl ::core::fmt::Debug for SnapshotRequest<'_> {
|
|
|
2620
2636
|
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2621
2637
|
let mut ds = f.debug_struct("SnapshotRequest");
|
|
2622
2638
|
ds.field("topic", &self.topic());
|
|
2639
|
+
ds.field("from_seq", &self.from_seq());
|
|
2623
2640
|
ds.finish()
|
|
2624
2641
|
}
|
|
2625
2642
|
}
|
|
@@ -2815,3 +2832,489 @@ impl ::core::fmt::Debug for Pong<'_> {
|
|
|
2815
2832
|
ds.finish()
|
|
2816
2833
|
}
|
|
2817
2834
|
}
|
|
2835
|
+
pub enum ResumeOffset {}
|
|
2836
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2837
|
+
|
|
2838
|
+
pub struct Resume<'a> {
|
|
2839
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
impl<'a> ::flatbuffers::Follow<'a> for Resume<'a> {
|
|
2843
|
+
type Inner = Resume<'a>;
|
|
2844
|
+
#[inline]
|
|
2845
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2846
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
impl<'a> Resume<'a> {
|
|
2851
|
+
pub const VT_LAST_SEQ: ::flatbuffers::VOffsetT = 4;
|
|
2852
|
+
|
|
2853
|
+
#[inline]
|
|
2854
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2855
|
+
Resume { _tab: table }
|
|
2856
|
+
}
|
|
2857
|
+
#[allow(unused_mut)]
|
|
2858
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2859
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2860
|
+
args: &'args ResumeArgs
|
|
2861
|
+
) -> ::flatbuffers::WIPOffset<Resume<'bldr>> {
|
|
2862
|
+
let mut builder = ResumeBuilder::new(_fbb);
|
|
2863
|
+
builder.add_last_seq(args.last_seq);
|
|
2864
|
+
builder.finish()
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
|
|
2868
|
+
#[inline]
|
|
2869
|
+
pub fn last_seq(&self) -> i64 {
|
|
2870
|
+
// Safety:
|
|
2871
|
+
// Created from valid Table for this object
|
|
2872
|
+
// which contains a valid value in this slot
|
|
2873
|
+
unsafe { self._tab.get::<i64>(Resume::VT_LAST_SEQ, Some(0)).unwrap()}
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
impl ::flatbuffers::Verifiable for Resume<'_> {
|
|
2878
|
+
#[inline]
|
|
2879
|
+
fn run_verifier(
|
|
2880
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2881
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2882
|
+
v.visit_table(pos)?
|
|
2883
|
+
.visit_field::<i64>("last_seq", Self::VT_LAST_SEQ, false)?
|
|
2884
|
+
.finish();
|
|
2885
|
+
Ok(())
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
pub struct ResumeArgs {
|
|
2889
|
+
pub last_seq: i64,
|
|
2890
|
+
}
|
|
2891
|
+
impl<'a> Default for ResumeArgs {
|
|
2892
|
+
#[inline]
|
|
2893
|
+
fn default() -> Self {
|
|
2894
|
+
ResumeArgs {
|
|
2895
|
+
last_seq: 0,
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
pub struct ResumeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
2901
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
2902
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
2903
|
+
}
|
|
2904
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ResumeBuilder<'a, 'b, A> {
|
|
2905
|
+
#[inline]
|
|
2906
|
+
pub fn add_last_seq(&mut self, last_seq: i64) {
|
|
2907
|
+
self.fbb_.push_slot::<i64>(Resume::VT_LAST_SEQ, last_seq, 0);
|
|
2908
|
+
}
|
|
2909
|
+
#[inline]
|
|
2910
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ResumeBuilder<'a, 'b, A> {
|
|
2911
|
+
let start = _fbb.start_table();
|
|
2912
|
+
ResumeBuilder {
|
|
2913
|
+
fbb_: _fbb,
|
|
2914
|
+
start_: start,
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
#[inline]
|
|
2918
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Resume<'a>> {
|
|
2919
|
+
let o = self.fbb_.end_table(self.start_);
|
|
2920
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
impl ::core::fmt::Debug for Resume<'_> {
|
|
2925
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
2926
|
+
let mut ds = f.debug_struct("Resume");
|
|
2927
|
+
ds.field("last_seq", &self.last_seq());
|
|
2928
|
+
ds.finish()
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
pub enum ResumedOffset {}
|
|
2932
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
2933
|
+
|
|
2934
|
+
pub struct Resumed<'a> {
|
|
2935
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
impl<'a> ::flatbuffers::Follow<'a> for Resumed<'a> {
|
|
2939
|
+
type Inner = Resumed<'a>;
|
|
2940
|
+
#[inline]
|
|
2941
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
2942
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
impl<'a> Resumed<'a> {
|
|
2947
|
+
pub const VT_OK: ::flatbuffers::VOffsetT = 4;
|
|
2948
|
+
pub const VT_FROM: ::flatbuffers::VOffsetT = 6;
|
|
2949
|
+
|
|
2950
|
+
#[inline]
|
|
2951
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
2952
|
+
Resumed { _tab: table }
|
|
2953
|
+
}
|
|
2954
|
+
#[allow(unused_mut)]
|
|
2955
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
2956
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
2957
|
+
args: &'args ResumedArgs
|
|
2958
|
+
) -> ::flatbuffers::WIPOffset<Resumed<'bldr>> {
|
|
2959
|
+
let mut builder = ResumedBuilder::new(_fbb);
|
|
2960
|
+
builder.add_from(args.from);
|
|
2961
|
+
builder.add_ok(args.ok);
|
|
2962
|
+
builder.finish()
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
|
|
2966
|
+
#[inline]
|
|
2967
|
+
pub fn ok(&self) -> bool {
|
|
2968
|
+
// Safety:
|
|
2969
|
+
// Created from valid Table for this object
|
|
2970
|
+
// which contains a valid value in this slot
|
|
2971
|
+
unsafe { self._tab.get::<bool>(Resumed::VT_OK, Some(false)).unwrap()}
|
|
2972
|
+
}
|
|
2973
|
+
#[inline]
|
|
2974
|
+
pub fn from(&self) -> i64 {
|
|
2975
|
+
// Safety:
|
|
2976
|
+
// Created from valid Table for this object
|
|
2977
|
+
// which contains a valid value in this slot
|
|
2978
|
+
unsafe { self._tab.get::<i64>(Resumed::VT_FROM, Some(0)).unwrap()}
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
impl ::flatbuffers::Verifiable for Resumed<'_> {
|
|
2983
|
+
#[inline]
|
|
2984
|
+
fn run_verifier(
|
|
2985
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
2986
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
2987
|
+
v.visit_table(pos)?
|
|
2988
|
+
.visit_field::<bool>("ok", Self::VT_OK, false)?
|
|
2989
|
+
.visit_field::<i64>("from", Self::VT_FROM, false)?
|
|
2990
|
+
.finish();
|
|
2991
|
+
Ok(())
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
pub struct ResumedArgs {
|
|
2995
|
+
pub ok: bool,
|
|
2996
|
+
pub from: i64,
|
|
2997
|
+
}
|
|
2998
|
+
impl<'a> Default for ResumedArgs {
|
|
2999
|
+
#[inline]
|
|
3000
|
+
fn default() -> Self {
|
|
3001
|
+
ResumedArgs {
|
|
3002
|
+
ok: false,
|
|
3003
|
+
from: 0,
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
|
|
3008
|
+
pub struct ResumedBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
3009
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
3010
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
3011
|
+
}
|
|
3012
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ResumedBuilder<'a, 'b, A> {
|
|
3013
|
+
#[inline]
|
|
3014
|
+
pub fn add_ok(&mut self, ok: bool) {
|
|
3015
|
+
self.fbb_.push_slot::<bool>(Resumed::VT_OK, ok, false);
|
|
3016
|
+
}
|
|
3017
|
+
#[inline]
|
|
3018
|
+
pub fn add_from(&mut self, from: i64) {
|
|
3019
|
+
self.fbb_.push_slot::<i64>(Resumed::VT_FROM, from, 0);
|
|
3020
|
+
}
|
|
3021
|
+
#[inline]
|
|
3022
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ResumedBuilder<'a, 'b, A> {
|
|
3023
|
+
let start = _fbb.start_table();
|
|
3024
|
+
ResumedBuilder {
|
|
3025
|
+
fbb_: _fbb,
|
|
3026
|
+
start_: start,
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
#[inline]
|
|
3030
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<Resumed<'a>> {
|
|
3031
|
+
let o = self.fbb_.end_table(self.start_);
|
|
3032
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
impl ::core::fmt::Debug for Resumed<'_> {
|
|
3037
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
3038
|
+
let mut ds = f.debug_struct("Resumed");
|
|
3039
|
+
ds.field("ok", &self.ok());
|
|
3040
|
+
ds.field("from", &self.from());
|
|
3041
|
+
ds.finish()
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
pub enum RpcCallOffset {}
|
|
3045
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
3046
|
+
|
|
3047
|
+
pub struct RpcCall<'a> {
|
|
3048
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
impl<'a> ::flatbuffers::Follow<'a> for RpcCall<'a> {
|
|
3052
|
+
type Inner = RpcCall<'a>;
|
|
3053
|
+
#[inline]
|
|
3054
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
3055
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
impl<'a> RpcCall<'a> {
|
|
3060
|
+
pub const VT_ID: ::flatbuffers::VOffsetT = 4;
|
|
3061
|
+
pub const VT_NAME: ::flatbuffers::VOffsetT = 6;
|
|
3062
|
+
pub const VT_PAYLOAD_B64: ::flatbuffers::VOffsetT = 8;
|
|
3063
|
+
|
|
3064
|
+
#[inline]
|
|
3065
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
3066
|
+
RpcCall { _tab: table }
|
|
3067
|
+
}
|
|
3068
|
+
#[allow(unused_mut)]
|
|
3069
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
3070
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
3071
|
+
args: &'args RpcCallArgs<'args>
|
|
3072
|
+
) -> ::flatbuffers::WIPOffset<RpcCall<'bldr>> {
|
|
3073
|
+
let mut builder = RpcCallBuilder::new(_fbb);
|
|
3074
|
+
if let Some(x) = args.payload_b64 { builder.add_payload_b64(x); }
|
|
3075
|
+
if let Some(x) = args.name { builder.add_name(x); }
|
|
3076
|
+
if let Some(x) = args.id { builder.add_id(x); }
|
|
3077
|
+
builder.finish()
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
|
|
3081
|
+
#[inline]
|
|
3082
|
+
pub fn id(&self) -> Option<&'a str> {
|
|
3083
|
+
// Safety:
|
|
3084
|
+
// Created from valid Table for this object
|
|
3085
|
+
// which contains a valid value in this slot
|
|
3086
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(RpcCall::VT_ID, None)}
|
|
3087
|
+
}
|
|
3088
|
+
#[inline]
|
|
3089
|
+
pub fn name(&self) -> Option<&'a str> {
|
|
3090
|
+
// Safety:
|
|
3091
|
+
// Created from valid Table for this object
|
|
3092
|
+
// which contains a valid value in this slot
|
|
3093
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(RpcCall::VT_NAME, None)}
|
|
3094
|
+
}
|
|
3095
|
+
#[inline]
|
|
3096
|
+
pub fn payload_b64(&self) -> Option<&'a str> {
|
|
3097
|
+
// Safety:
|
|
3098
|
+
// Created from valid Table for this object
|
|
3099
|
+
// which contains a valid value in this slot
|
|
3100
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(RpcCall::VT_PAYLOAD_B64, None)}
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
impl ::flatbuffers::Verifiable for RpcCall<'_> {
|
|
3105
|
+
#[inline]
|
|
3106
|
+
fn run_verifier(
|
|
3107
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
3108
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
3109
|
+
v.visit_table(pos)?
|
|
3110
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
|
|
3111
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
|
|
3112
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("payload_b64", Self::VT_PAYLOAD_B64, false)?
|
|
3113
|
+
.finish();
|
|
3114
|
+
Ok(())
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
pub struct RpcCallArgs<'a> {
|
|
3118
|
+
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
3119
|
+
pub name: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
3120
|
+
pub payload_b64: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
3121
|
+
}
|
|
3122
|
+
impl<'a> Default for RpcCallArgs<'a> {
|
|
3123
|
+
#[inline]
|
|
3124
|
+
fn default() -> Self {
|
|
3125
|
+
RpcCallArgs {
|
|
3126
|
+
id: None,
|
|
3127
|
+
name: None,
|
|
3128
|
+
payload_b64: None,
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
pub struct RpcCallBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
3134
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
3135
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
3136
|
+
}
|
|
3137
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> RpcCallBuilder<'a, 'b, A> {
|
|
3138
|
+
#[inline]
|
|
3139
|
+
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
3140
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(RpcCall::VT_ID, id);
|
|
3141
|
+
}
|
|
3142
|
+
#[inline]
|
|
3143
|
+
pub fn add_name(&mut self, name: ::flatbuffers::WIPOffset<&'b str>) {
|
|
3144
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(RpcCall::VT_NAME, name);
|
|
3145
|
+
}
|
|
3146
|
+
#[inline]
|
|
3147
|
+
pub fn add_payload_b64(&mut self, payload_b64: ::flatbuffers::WIPOffset<&'b str>) {
|
|
3148
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(RpcCall::VT_PAYLOAD_B64, payload_b64);
|
|
3149
|
+
}
|
|
3150
|
+
#[inline]
|
|
3151
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> RpcCallBuilder<'a, 'b, A> {
|
|
3152
|
+
let start = _fbb.start_table();
|
|
3153
|
+
RpcCallBuilder {
|
|
3154
|
+
fbb_: _fbb,
|
|
3155
|
+
start_: start,
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
#[inline]
|
|
3159
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<RpcCall<'a>> {
|
|
3160
|
+
let o = self.fbb_.end_table(self.start_);
|
|
3161
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
impl ::core::fmt::Debug for RpcCall<'_> {
|
|
3166
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
3167
|
+
let mut ds = f.debug_struct("RpcCall");
|
|
3168
|
+
ds.field("id", &self.id());
|
|
3169
|
+
ds.field("name", &self.name());
|
|
3170
|
+
ds.field("payload_b64", &self.payload_b64());
|
|
3171
|
+
ds.finish()
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
pub enum RpcResultOffset {}
|
|
3175
|
+
#[derive(Copy, Clone, PartialEq)]
|
|
3176
|
+
|
|
3177
|
+
pub struct RpcResult<'a> {
|
|
3178
|
+
pub _tab: ::flatbuffers::Table<'a>,
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
impl<'a> ::flatbuffers::Follow<'a> for RpcResult<'a> {
|
|
3182
|
+
type Inner = RpcResult<'a>;
|
|
3183
|
+
#[inline]
|
|
3184
|
+
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
|
3185
|
+
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
impl<'a> RpcResult<'a> {
|
|
3190
|
+
pub const VT_ID: ::flatbuffers::VOffsetT = 4;
|
|
3191
|
+
pub const VT_OK: ::flatbuffers::VOffsetT = 6;
|
|
3192
|
+
pub const VT_ERR: ::flatbuffers::VOffsetT = 8;
|
|
3193
|
+
pub const VT_PAYLOAD_B64: ::flatbuffers::VOffsetT = 10;
|
|
3194
|
+
|
|
3195
|
+
#[inline]
|
|
3196
|
+
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
|
|
3197
|
+
RpcResult { _tab: table }
|
|
3198
|
+
}
|
|
3199
|
+
#[allow(unused_mut)]
|
|
3200
|
+
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
|
|
3201
|
+
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
|
|
3202
|
+
args: &'args RpcResultArgs<'args>
|
|
3203
|
+
) -> ::flatbuffers::WIPOffset<RpcResult<'bldr>> {
|
|
3204
|
+
let mut builder = RpcResultBuilder::new(_fbb);
|
|
3205
|
+
if let Some(x) = args.payload_b64 { builder.add_payload_b64(x); }
|
|
3206
|
+
if let Some(x) = args.err { builder.add_err(x); }
|
|
3207
|
+
if let Some(x) = args.id { builder.add_id(x); }
|
|
3208
|
+
builder.add_ok(args.ok);
|
|
3209
|
+
builder.finish()
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
|
|
3213
|
+
#[inline]
|
|
3214
|
+
pub fn id(&self) -> Option<&'a str> {
|
|
3215
|
+
// Safety:
|
|
3216
|
+
// Created from valid Table for this object
|
|
3217
|
+
// which contains a valid value in this slot
|
|
3218
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(RpcResult::VT_ID, None)}
|
|
3219
|
+
}
|
|
3220
|
+
#[inline]
|
|
3221
|
+
pub fn ok(&self) -> bool {
|
|
3222
|
+
// Safety:
|
|
3223
|
+
// Created from valid Table for this object
|
|
3224
|
+
// which contains a valid value in this slot
|
|
3225
|
+
unsafe { self._tab.get::<bool>(RpcResult::VT_OK, Some(false)).unwrap()}
|
|
3226
|
+
}
|
|
3227
|
+
#[inline]
|
|
3228
|
+
pub fn err(&self) -> Option<&'a str> {
|
|
3229
|
+
// Safety:
|
|
3230
|
+
// Created from valid Table for this object
|
|
3231
|
+
// which contains a valid value in this slot
|
|
3232
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(RpcResult::VT_ERR, None)}
|
|
3233
|
+
}
|
|
3234
|
+
#[inline]
|
|
3235
|
+
pub fn payload_b64(&self) -> Option<&'a str> {
|
|
3236
|
+
// Safety:
|
|
3237
|
+
// Created from valid Table for this object
|
|
3238
|
+
// which contains a valid value in this slot
|
|
3239
|
+
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(RpcResult::VT_PAYLOAD_B64, None)}
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
impl ::flatbuffers::Verifiable for RpcResult<'_> {
|
|
3244
|
+
#[inline]
|
|
3245
|
+
fn run_verifier(
|
|
3246
|
+
v: &mut ::flatbuffers::Verifier, pos: usize
|
|
3247
|
+
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
|
|
3248
|
+
v.visit_table(pos)?
|
|
3249
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
|
|
3250
|
+
.visit_field::<bool>("ok", Self::VT_OK, false)?
|
|
3251
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("err", Self::VT_ERR, false)?
|
|
3252
|
+
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("payload_b64", Self::VT_PAYLOAD_B64, false)?
|
|
3253
|
+
.finish();
|
|
3254
|
+
Ok(())
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
pub struct RpcResultArgs<'a> {
|
|
3258
|
+
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
3259
|
+
pub ok: bool,
|
|
3260
|
+
pub err: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
3261
|
+
pub payload_b64: Option<::flatbuffers::WIPOffset<&'a str>>,
|
|
3262
|
+
}
|
|
3263
|
+
impl<'a> Default for RpcResultArgs<'a> {
|
|
3264
|
+
#[inline]
|
|
3265
|
+
fn default() -> Self {
|
|
3266
|
+
RpcResultArgs {
|
|
3267
|
+
id: None,
|
|
3268
|
+
ok: false,
|
|
3269
|
+
err: None,
|
|
3270
|
+
payload_b64: None,
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
pub struct RpcResultBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
|
|
3276
|
+
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
|
|
3277
|
+
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
|
|
3278
|
+
}
|
|
3279
|
+
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> RpcResultBuilder<'a, 'b, A> {
|
|
3280
|
+
#[inline]
|
|
3281
|
+
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
|
|
3282
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(RpcResult::VT_ID, id);
|
|
3283
|
+
}
|
|
3284
|
+
#[inline]
|
|
3285
|
+
pub fn add_ok(&mut self, ok: bool) {
|
|
3286
|
+
self.fbb_.push_slot::<bool>(RpcResult::VT_OK, ok, false);
|
|
3287
|
+
}
|
|
3288
|
+
#[inline]
|
|
3289
|
+
pub fn add_err(&mut self, err: ::flatbuffers::WIPOffset<&'b str>) {
|
|
3290
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(RpcResult::VT_ERR, err);
|
|
3291
|
+
}
|
|
3292
|
+
#[inline]
|
|
3293
|
+
pub fn add_payload_b64(&mut self, payload_b64: ::flatbuffers::WIPOffset<&'b str>) {
|
|
3294
|
+
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(RpcResult::VT_PAYLOAD_B64, payload_b64);
|
|
3295
|
+
}
|
|
3296
|
+
#[inline]
|
|
3297
|
+
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> RpcResultBuilder<'a, 'b, A> {
|
|
3298
|
+
let start = _fbb.start_table();
|
|
3299
|
+
RpcResultBuilder {
|
|
3300
|
+
fbb_: _fbb,
|
|
3301
|
+
start_: start,
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
#[inline]
|
|
3305
|
+
pub fn finish(self) -> ::flatbuffers::WIPOffset<RpcResult<'a>> {
|
|
3306
|
+
let o = self.fbb_.end_table(self.start_);
|
|
3307
|
+
::flatbuffers::WIPOffset::new(o.value())
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
impl ::core::fmt::Debug for RpcResult<'_> {
|
|
3312
|
+
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
|
|
3313
|
+
let mut ds = f.debug_struct("RpcResult");
|
|
3314
|
+
ds.field("id", &self.id());
|
|
3315
|
+
ds.field("ok", &self.ok());
|
|
3316
|
+
ds.field("err", &self.err());
|
|
3317
|
+
ds.field("payload_b64", &self.payload_b64());
|
|
3318
|
+
ds.finish()
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
@@ -16,6 +16,10 @@ export { Pong, PongT } from './pong.js';
|
|
|
16
16
|
export { PortfolioPosition, PortfolioPositionT } from './portfolio-position.js';
|
|
17
17
|
export { PortfolioSnapshot, PortfolioSnapshotT } from './portfolio-snapshot.js';
|
|
18
18
|
export { Quote, QuoteT } from './quote.js';
|
|
19
|
+
export { Resume, ResumeT } from './resume.js';
|
|
20
|
+
export { Resumed, ResumedT } from './resumed.js';
|
|
21
|
+
export { RpcCall, RpcCallT } from './rpc-call.js';
|
|
22
|
+
export { RpcResult, RpcResultT } from './rpc-result.js';
|
|
19
23
|
export { Side } from './side.js';
|
|
20
24
|
export { SnapshotRequest, SnapshotRequestT } from './snapshot-request.js';
|
|
21
25
|
export { Subscribe, SubscribeT } from './subscribe.js';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
import * as flatbuffers from 'flatbuffers';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export class Resume implements flatbuffers.IUnpackableObject<ResumeT> {
|
|
10
|
+
bb: flatbuffers.ByteBuffer|null = null;
|
|
11
|
+
bb_pos = 0;
|
|
12
|
+
__init(i:number, bb:flatbuffers.ByteBuffer):Resume {
|
|
13
|
+
this.bb_pos = i;
|
|
14
|
+
this.bb = bb;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getRootAsResume(bb:flatbuffers.ByteBuffer, obj?:Resume):Resume {
|
|
19
|
+
return (obj || new Resume()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static getSizePrefixedRootAsResume(bb:flatbuffers.ByteBuffer, obj?:Resume):Resume {
|
|
23
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
24
|
+
return (obj || new Resume()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
lastSeq():bigint {
|
|
28
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
29
|
+
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static startResume(builder:flatbuffers.Builder) {
|
|
33
|
+
builder.startObject(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static addLastSeq(builder:flatbuffers.Builder, lastSeq:bigint) {
|
|
37
|
+
builder.addFieldInt64(0, lastSeq, BigInt('0'));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static endResume(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
41
|
+
const offset = builder.endObject();
|
|
42
|
+
return offset;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static createResume(builder:flatbuffers.Builder, lastSeq:bigint):flatbuffers.Offset {
|
|
46
|
+
Resume.startResume(builder);
|
|
47
|
+
Resume.addLastSeq(builder, lastSeq);
|
|
48
|
+
return Resume.endResume(builder);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
unpack(): ResumeT {
|
|
52
|
+
return new ResumeT(
|
|
53
|
+
this.lastSeq()
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
unpackTo(_o: ResumeT): void {
|
|
59
|
+
_o.lastSeq = this.lastSeq();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class ResumeT implements flatbuffers.IGeneratedObject {
|
|
64
|
+
constructor(
|
|
65
|
+
public lastSeq: bigint = BigInt('0')
|
|
66
|
+
){}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
|
70
|
+
return Resume.createResume(builder,
|
|
71
|
+
this.lastSeq
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|