@rivetkit/engine-envoy-protocol 2.3.12-rc.4 → 2.3.13
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.d.ts +85 -4
- package/dist/index.js +203 -47
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -573,11 +573,20 @@ declare function writeMessageId(bc: bare.ByteCursor, x: MessageId): void;
|
|
|
573
573
|
*/
|
|
574
574
|
type ToEnvoyRequestStart = {
|
|
575
575
|
readonly actorId: Id;
|
|
576
|
+
/**
|
|
577
|
+
* Exact actor generation selected by Gateway 3. Legacy Gateway 2 requests
|
|
578
|
+
* omit this and retain highest-live-generation routing.
|
|
579
|
+
*/
|
|
580
|
+
readonly actorGeneration: u32 | null;
|
|
576
581
|
readonly method: string;
|
|
577
582
|
readonly path: string;
|
|
578
583
|
readonly headers: ReadonlyMap<string, string>;
|
|
579
584
|
readonly body: ArrayBuffer | null;
|
|
580
585
|
readonly stream: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* Whether the gateway can accept a streamed response body.
|
|
588
|
+
*/
|
|
589
|
+
readonly responseStream: boolean;
|
|
581
590
|
};
|
|
582
591
|
declare function readToEnvoyRequestStart(bc: bare.ByteCursor): ToEnvoyRequestStart;
|
|
583
592
|
declare function writeToEnvoyRequestStart(bc: bare.ByteCursor, x: ToEnvoyRequestStart): void;
|
|
@@ -587,7 +596,49 @@ type ToEnvoyRequestChunk = {
|
|
|
587
596
|
};
|
|
588
597
|
declare function readToEnvoyRequestChunk(bc: bare.ByteCursor): ToEnvoyRequestChunk;
|
|
589
598
|
declare function writeToEnvoyRequestChunk(bc: bare.ByteCursor, x: ToEnvoyRequestChunk): void;
|
|
590
|
-
|
|
599
|
+
/**
|
|
600
|
+
* Cumulative request-body bytes consumed by the actor handler. This restores
|
|
601
|
+
* sender credit without requiring one acknowledgement per chunk.
|
|
602
|
+
*/
|
|
603
|
+
type ToRivetRequestBodyWindowUpdate = {
|
|
604
|
+
readonly consumedBytes: u64;
|
|
605
|
+
};
|
|
606
|
+
declare function readToRivetRequestBodyWindowUpdate(bc: bare.ByteCursor): ToRivetRequestBodyWindowUpdate;
|
|
607
|
+
declare function writeToRivetRequestBodyWindowUpdate(bc: bare.ByteCursor, x: ToRivetRequestBodyWindowUpdate): void;
|
|
608
|
+
/**
|
|
609
|
+
* The actor handler no longer wants request-body bytes. The HTTP response may
|
|
610
|
+
* still continue normally.
|
|
611
|
+
*/
|
|
612
|
+
type ToRivetRequestBodyCancel = null;
|
|
613
|
+
declare enum HttpStreamAbortReasonKind {
|
|
614
|
+
Unknown = "Unknown",
|
|
615
|
+
Cancelled = "Cancelled",
|
|
616
|
+
HandlerError = "HandlerError",
|
|
617
|
+
InternalError = "InternalError"
|
|
618
|
+
}
|
|
619
|
+
declare function readHttpStreamAbortReasonKind(bc: bare.ByteCursor): HttpStreamAbortReasonKind;
|
|
620
|
+
declare function writeHttpStreamAbortReasonKind(bc: bare.ByteCursor, x: HttpStreamAbortReasonKind): void;
|
|
621
|
+
type HttpStreamAbortReason = {
|
|
622
|
+
readonly kind: HttpStreamAbortReasonKind;
|
|
623
|
+
readonly detail: string | null;
|
|
624
|
+
};
|
|
625
|
+
declare function readHttpStreamAbortReason(bc: bare.ByteCursor): HttpStreamAbortReason;
|
|
626
|
+
declare function writeHttpStreamAbortReason(bc: bare.ByteCursor, x: HttpStreamAbortReason): void;
|
|
627
|
+
type ToEnvoyRequestAbort = {
|
|
628
|
+
/**
|
|
629
|
+
* Exact admission identity. Gateway 3 always sets both fields so Envoy can
|
|
630
|
+
* suppress a delayed RequestStart after an indeterminate handoff.
|
|
631
|
+
*/
|
|
632
|
+
readonly actorId: Id | null;
|
|
633
|
+
readonly actorGeneration: u32 | null;
|
|
634
|
+
readonly reason: HttpStreamAbortReason;
|
|
635
|
+
};
|
|
636
|
+
declare function readToEnvoyRequestAbort(bc: bare.ByteCursor): ToEnvoyRequestAbort;
|
|
637
|
+
declare function writeToEnvoyRequestAbort(bc: bare.ByteCursor, x: ToEnvoyRequestAbort): void;
|
|
638
|
+
/**
|
|
639
|
+
* Stop the actor-side request body without cancelling the HTTP response.
|
|
640
|
+
*/
|
|
641
|
+
type ToEnvoyRequestBodyCancel = null;
|
|
591
642
|
type ToRivetResponseStart = {
|
|
592
643
|
readonly status: u16;
|
|
593
644
|
readonly headers: ReadonlyMap<string, string>;
|
|
@@ -602,12 +653,30 @@ type ToRivetResponseChunk = {
|
|
|
602
653
|
};
|
|
603
654
|
declare function readToRivetResponseChunk(bc: bare.ByteCursor): ToRivetResponseChunk;
|
|
604
655
|
declare function writeToRivetResponseChunk(bc: bare.ByteCursor, x: ToRivetResponseChunk): void;
|
|
605
|
-
|
|
656
|
+
/**
|
|
657
|
+
* Cumulative response-body bytes consumed by the gateway client. This restores
|
|
658
|
+
* sender credit without requiring one acknowledgement per chunk.
|
|
659
|
+
*/
|
|
660
|
+
type ToEnvoyResponseBodyWindowUpdate = {
|
|
661
|
+
readonly consumedBytes: u64;
|
|
662
|
+
};
|
|
663
|
+
declare function readToEnvoyResponseBodyWindowUpdate(bc: bare.ByteCursor): ToEnvoyResponseBodyWindowUpdate;
|
|
664
|
+
declare function writeToEnvoyResponseBodyWindowUpdate(bc: bare.ByteCursor, x: ToEnvoyResponseBodyWindowUpdate): void;
|
|
665
|
+
type ToRivetResponseAbort = {
|
|
666
|
+
readonly reason: HttpStreamAbortReason;
|
|
667
|
+
};
|
|
668
|
+
declare function readToRivetResponseAbort(bc: bare.ByteCursor): ToRivetResponseAbort;
|
|
669
|
+
declare function writeToRivetResponseAbort(bc: bare.ByteCursor, x: ToRivetResponseAbort): void;
|
|
606
670
|
/**
|
|
607
671
|
* WebSocket
|
|
608
672
|
*/
|
|
609
673
|
type ToEnvoyWebSocketOpen = {
|
|
610
674
|
readonly actorId: Id;
|
|
675
|
+
/**
|
|
676
|
+
* Exact actor generation selected by Gateway 3. Legacy Gateway 2 requests
|
|
677
|
+
* omit this and retain highest-live-generation routing.
|
|
678
|
+
*/
|
|
679
|
+
readonly actorGeneration: u32 | null;
|
|
611
680
|
readonly path: string;
|
|
612
681
|
readonly headers: ReadonlyMap<string, string>;
|
|
613
682
|
};
|
|
@@ -664,6 +733,12 @@ type ToRivetTunnelMessageKind =
|
|
|
664
733
|
} | {
|
|
665
734
|
readonly tag: "ToRivetResponseAbort";
|
|
666
735
|
readonly val: ToRivetResponseAbort;
|
|
736
|
+
} | {
|
|
737
|
+
readonly tag: "ToRivetRequestBodyWindowUpdate";
|
|
738
|
+
readonly val: ToRivetRequestBodyWindowUpdate;
|
|
739
|
+
} | {
|
|
740
|
+
readonly tag: "ToRivetRequestBodyCancel";
|
|
741
|
+
readonly val: ToRivetRequestBodyCancel;
|
|
667
742
|
}
|
|
668
743
|
/**
|
|
669
744
|
* WebSocket
|
|
@@ -705,6 +780,12 @@ type ToEnvoyTunnelMessageKind =
|
|
|
705
780
|
} | {
|
|
706
781
|
readonly tag: "ToEnvoyRequestAbort";
|
|
707
782
|
readonly val: ToEnvoyRequestAbort;
|
|
783
|
+
} | {
|
|
784
|
+
readonly tag: "ToEnvoyRequestBodyCancel";
|
|
785
|
+
readonly val: ToEnvoyRequestBodyCancel;
|
|
786
|
+
} | {
|
|
787
|
+
readonly tag: "ToEnvoyResponseBodyWindowUpdate";
|
|
788
|
+
readonly val: ToEnvoyResponseBodyWindowUpdate;
|
|
708
789
|
}
|
|
709
790
|
/**
|
|
710
791
|
* WebSocket
|
|
@@ -1000,6 +1081,6 @@ declare function readToOutbound(bc: bare.ByteCursor): ToOutbound;
|
|
|
1000
1081
|
declare function writeToOutbound(bc: bare.ByteCursor, x: ToOutbound): void;
|
|
1001
1082
|
declare function encodeToOutbound(x: ToOutbound, config?: Partial<bare.Config>): Uint8Array;
|
|
1002
1083
|
declare function decodeToOutbound(bytes: Uint8Array): ToOutbound;
|
|
1003
|
-
declare const VERSION =
|
|
1084
|
+
declare const VERSION = 7;
|
|
1004
1085
|
|
|
1005
|
-
export { type ActorCheckpoint, type ActorCommandKeyData, type ActorConfig, type ActorIntent, type ActorIntentSleep, type ActorIntentStop, type ActorName, type ActorState, type ActorStateRunning, type ActorStateStopped, type Command, type CommandStartActor, type CommandStopActor, type CommandWrapper, type Event, type EventActorIntent, type EventActorSetAlarm, type EventActorStateUpdate, type EventWrapper, type GatewayId, type HibernatingRequest, type Id, type Json, type KvDeleteRangeRequest, type KvDeleteRequest, type KvDeleteResponse, type KvDropRequest, type KvDropResponse, type KvErrorResponse, type KvGetRequest, type KvGetResponse, type KvKey, type KvListAllQuery, type KvListPrefixQuery, type KvListQuery, type KvListRangeQuery, type KvListRequest, type KvListResponse, type KvMetadata, type KvPutRequest, type KvPutResponse, type KvRequestData, type KvResponseData, type KvValue, type MessageId, type MessageIndex, type PreloadedKv, type PreloadedKvEntry, type ProtocolMetadata, type RequestId, type SqliteBatchStatement, type SqliteBindParam, type SqliteColumnValue, type SqliteCommitOk, type SqliteCommitRequest, type SqliteCommitResponse, type SqliteDirtyPage, type SqliteErrorResponse, type SqliteExecOk, type SqliteExecRequest, type SqliteExecResponse, type SqliteExecuteBatchOk, type SqliteExecuteBatchRequest, type SqliteExecuteBatchResponse, type SqliteExecuteOk, type SqliteExecuteRequest, type SqliteExecuteResponse, type SqliteExecuteResult, type SqliteFetchedPage, type SqliteGeneration, type SqliteGetPagesOk, type SqliteGetPagesRequest, type SqliteGetPagesResponse, type SqlitePageBytes, type SqlitePgno, type SqliteQueryResult, type SqliteValueBlob, type SqliteValueFloat, type SqliteValueInteger, type SqliteValueNull, type SqliteValueText, StopActorReason, StopCode, type ToEnvoy, type ToEnvoyAckEvents, type ToEnvoyCommands, type ToEnvoyConn, type ToEnvoyConnClose, type ToEnvoyConnPing, type ToEnvoyInit, type ToEnvoyKvResponse, type ToEnvoyPing, type ToEnvoyRequestAbort, type ToEnvoyRequestChunk, type ToEnvoyRequestStart, type ToEnvoySqliteCommitResponse, type ToEnvoySqliteExecResponse, type ToEnvoySqliteExecuteBatchResponse, type ToEnvoySqliteExecuteResponse, type ToEnvoySqliteGetPagesResponse, type ToEnvoyTunnelMessage, type ToEnvoyTunnelMessageKind, type ToEnvoyWebSocketClose, type ToEnvoyWebSocketMessage, type ToEnvoyWebSocketOpen, type ToGateway, type ToGatewayPong, type ToOutbound, type ToOutboundActorStart, type ToRivet, type ToRivetAckCommands, type ToRivetEvents, type ToRivetKvRequest, type ToRivetMetadata, type ToRivetPong, type ToRivetResponseAbort, type ToRivetResponseChunk, type ToRivetResponseStart, type ToRivetSqliteCommitRequest, type ToRivetSqliteExecRequest, type ToRivetSqliteExecuteBatchRequest, type ToRivetSqliteExecuteRequest, type ToRivetSqliteGetPagesRequest, type ToRivetStopping, type ToRivetTunnelMessage, type ToRivetTunnelMessageKind, type ToRivetWebSocketClose, type ToRivetWebSocketMessage, type ToRivetWebSocketMessageAck, type ToRivetWebSocketOpen, VERSION, decodeActorCommandKeyData, decodeToEnvoy, decodeToEnvoyConn, decodeToGateway, decodeToOutbound, decodeToRivet, encodeActorCommandKeyData, encodeToEnvoy, encodeToEnvoyConn, encodeToGateway, encodeToOutbound, encodeToRivet, type i64, readActorCheckpoint, readActorCommandKeyData, readActorConfig, readActorIntent, readActorName, readActorState, readActorStateStopped, readCommand, readCommandStartActor, readCommandStopActor, readCommandWrapper, readEvent, readEventActorIntent, readEventActorSetAlarm, readEventActorStateUpdate, readEventWrapper, readGatewayId, readHibernatingRequest, readId, readJson, readKvDeleteRangeRequest, readKvDeleteRequest, readKvErrorResponse, readKvGetRequest, readKvGetResponse, readKvKey, readKvListPrefixQuery, readKvListQuery, readKvListRangeQuery, readKvListRequest, readKvListResponse, readKvMetadata, readKvPutRequest, readKvRequestData, readKvResponseData, readKvValue, readMessageId, readMessageIndex, readPreloadedKv, readPreloadedKvEntry, readProtocolMetadata, readRequestId, readSqliteBatchStatement, readSqliteBindParam, readSqliteColumnValue, readSqliteCommitOk, readSqliteCommitRequest, readSqliteCommitResponse, readSqliteDirtyPage, readSqliteErrorResponse, readSqliteExecOk, readSqliteExecRequest, readSqliteExecResponse, readSqliteExecuteBatchOk, readSqliteExecuteBatchRequest, readSqliteExecuteBatchResponse, readSqliteExecuteOk, readSqliteExecuteRequest, readSqliteExecuteResponse, readSqliteExecuteResult, readSqliteFetchedPage, readSqliteGeneration, readSqliteGetPagesOk, readSqliteGetPagesRequest, readSqliteGetPagesResponse, readSqlitePageBytes, readSqlitePgno, readSqliteQueryResult, readSqliteValueBlob, readSqliteValueFloat, readSqliteValueInteger, readSqliteValueText, readStopActorReason, readStopCode, readToEnvoy, readToEnvoyAckEvents, readToEnvoyCommands, readToEnvoyConn, readToEnvoyConnPing, readToEnvoyInit, readToEnvoyKvResponse, readToEnvoyPing, readToEnvoyRequestChunk, readToEnvoyRequestStart, readToEnvoySqliteCommitResponse, readToEnvoySqliteExecResponse, readToEnvoySqliteExecuteBatchResponse, readToEnvoySqliteExecuteResponse, readToEnvoySqliteGetPagesResponse, readToEnvoyTunnelMessage, readToEnvoyTunnelMessageKind, readToEnvoyWebSocketClose, readToEnvoyWebSocketMessage, readToEnvoyWebSocketOpen, readToGateway, readToGatewayPong, readToOutbound, readToOutboundActorStart, readToRivet, readToRivetAckCommands, readToRivetEvents, readToRivetKvRequest, readToRivetMetadata, readToRivetPong, readToRivetResponseChunk, readToRivetResponseStart, readToRivetSqliteCommitRequest, readToRivetSqliteExecRequest, readToRivetSqliteExecuteBatchRequest, readToRivetSqliteExecuteRequest, readToRivetSqliteGetPagesRequest, readToRivetTunnelMessage, readToRivetTunnelMessageKind, readToRivetWebSocketClose, readToRivetWebSocketMessage, readToRivetWebSocketMessageAck, readToRivetWebSocketOpen, type u16, type u32, type u64, writeActorCheckpoint, writeActorCommandKeyData, writeActorConfig, writeActorIntent, writeActorName, writeActorState, writeActorStateStopped, writeCommand, writeCommandStartActor, writeCommandStopActor, writeCommandWrapper, writeEvent, writeEventActorIntent, writeEventActorSetAlarm, writeEventActorStateUpdate, writeEventWrapper, writeGatewayId, writeHibernatingRequest, writeId, writeJson, writeKvDeleteRangeRequest, writeKvDeleteRequest, writeKvErrorResponse, writeKvGetRequest, writeKvGetResponse, writeKvKey, writeKvListPrefixQuery, writeKvListQuery, writeKvListRangeQuery, writeKvListRequest, writeKvListResponse, writeKvMetadata, writeKvPutRequest, writeKvRequestData, writeKvResponseData, writeKvValue, writeMessageId, writeMessageIndex, writePreloadedKv, writePreloadedKvEntry, writeProtocolMetadata, writeRequestId, writeSqliteBatchStatement, writeSqliteBindParam, writeSqliteColumnValue, writeSqliteCommitOk, writeSqliteCommitRequest, writeSqliteCommitResponse, writeSqliteDirtyPage, writeSqliteErrorResponse, writeSqliteExecOk, writeSqliteExecRequest, writeSqliteExecResponse, writeSqliteExecuteBatchOk, writeSqliteExecuteBatchRequest, writeSqliteExecuteBatchResponse, writeSqliteExecuteOk, writeSqliteExecuteRequest, writeSqliteExecuteResponse, writeSqliteExecuteResult, writeSqliteFetchedPage, writeSqliteGeneration, writeSqliteGetPagesOk, writeSqliteGetPagesRequest, writeSqliteGetPagesResponse, writeSqlitePageBytes, writeSqlitePgno, writeSqliteQueryResult, writeSqliteValueBlob, writeSqliteValueFloat, writeSqliteValueInteger, writeSqliteValueText, writeStopActorReason, writeStopCode, writeToEnvoy, writeToEnvoyAckEvents, writeToEnvoyCommands, writeToEnvoyConn, writeToEnvoyConnPing, writeToEnvoyInit, writeToEnvoyKvResponse, writeToEnvoyPing, writeToEnvoyRequestChunk, writeToEnvoyRequestStart, writeToEnvoySqliteCommitResponse, writeToEnvoySqliteExecResponse, writeToEnvoySqliteExecuteBatchResponse, writeToEnvoySqliteExecuteResponse, writeToEnvoySqliteGetPagesResponse, writeToEnvoyTunnelMessage, writeToEnvoyTunnelMessageKind, writeToEnvoyWebSocketClose, writeToEnvoyWebSocketMessage, writeToEnvoyWebSocketOpen, writeToGateway, writeToGatewayPong, writeToOutbound, writeToOutboundActorStart, writeToRivet, writeToRivetAckCommands, writeToRivetEvents, writeToRivetKvRequest, writeToRivetMetadata, writeToRivetPong, writeToRivetResponseChunk, writeToRivetResponseStart, writeToRivetSqliteCommitRequest, writeToRivetSqliteExecRequest, writeToRivetSqliteExecuteBatchRequest, writeToRivetSqliteExecuteRequest, writeToRivetSqliteGetPagesRequest, writeToRivetTunnelMessage, writeToRivetTunnelMessageKind, writeToRivetWebSocketClose, writeToRivetWebSocketMessage, writeToRivetWebSocketMessageAck, writeToRivetWebSocketOpen };
|
|
1086
|
+
export { type ActorCheckpoint, type ActorCommandKeyData, type ActorConfig, type ActorIntent, type ActorIntentSleep, type ActorIntentStop, type ActorName, type ActorState, type ActorStateRunning, type ActorStateStopped, type Command, type CommandStartActor, type CommandStopActor, type CommandWrapper, type Event, type EventActorIntent, type EventActorSetAlarm, type EventActorStateUpdate, type EventWrapper, type GatewayId, type HibernatingRequest, type HttpStreamAbortReason, HttpStreamAbortReasonKind, type Id, type Json, type KvDeleteRangeRequest, type KvDeleteRequest, type KvDeleteResponse, type KvDropRequest, type KvDropResponse, type KvErrorResponse, type KvGetRequest, type KvGetResponse, type KvKey, type KvListAllQuery, type KvListPrefixQuery, type KvListQuery, type KvListRangeQuery, type KvListRequest, type KvListResponse, type KvMetadata, type KvPutRequest, type KvPutResponse, type KvRequestData, type KvResponseData, type KvValue, type MessageId, type MessageIndex, type PreloadedKv, type PreloadedKvEntry, type ProtocolMetadata, type RequestId, type SqliteBatchStatement, type SqliteBindParam, type SqliteColumnValue, type SqliteCommitOk, type SqliteCommitRequest, type SqliteCommitResponse, type SqliteDirtyPage, type SqliteErrorResponse, type SqliteExecOk, type SqliteExecRequest, type SqliteExecResponse, type SqliteExecuteBatchOk, type SqliteExecuteBatchRequest, type SqliteExecuteBatchResponse, type SqliteExecuteOk, type SqliteExecuteRequest, type SqliteExecuteResponse, type SqliteExecuteResult, type SqliteFetchedPage, type SqliteGeneration, type SqliteGetPagesOk, type SqliteGetPagesRequest, type SqliteGetPagesResponse, type SqlitePageBytes, type SqlitePgno, type SqliteQueryResult, type SqliteValueBlob, type SqliteValueFloat, type SqliteValueInteger, type SqliteValueNull, type SqliteValueText, StopActorReason, StopCode, type ToEnvoy, type ToEnvoyAckEvents, type ToEnvoyCommands, type ToEnvoyConn, type ToEnvoyConnClose, type ToEnvoyConnPing, type ToEnvoyInit, type ToEnvoyKvResponse, type ToEnvoyPing, type ToEnvoyRequestAbort, type ToEnvoyRequestBodyCancel, type ToEnvoyRequestChunk, type ToEnvoyRequestStart, type ToEnvoyResponseBodyWindowUpdate, type ToEnvoySqliteCommitResponse, type ToEnvoySqliteExecResponse, type ToEnvoySqliteExecuteBatchResponse, type ToEnvoySqliteExecuteResponse, type ToEnvoySqliteGetPagesResponse, type ToEnvoyTunnelMessage, type ToEnvoyTunnelMessageKind, type ToEnvoyWebSocketClose, type ToEnvoyWebSocketMessage, type ToEnvoyWebSocketOpen, type ToGateway, type ToGatewayPong, type ToOutbound, type ToOutboundActorStart, type ToRivet, type ToRivetAckCommands, type ToRivetEvents, type ToRivetKvRequest, type ToRivetMetadata, type ToRivetPong, type ToRivetRequestBodyCancel, type ToRivetRequestBodyWindowUpdate, type ToRivetResponseAbort, type ToRivetResponseChunk, type ToRivetResponseStart, type ToRivetSqliteCommitRequest, type ToRivetSqliteExecRequest, type ToRivetSqliteExecuteBatchRequest, type ToRivetSqliteExecuteRequest, type ToRivetSqliteGetPagesRequest, type ToRivetStopping, type ToRivetTunnelMessage, type ToRivetTunnelMessageKind, type ToRivetWebSocketClose, type ToRivetWebSocketMessage, type ToRivetWebSocketMessageAck, type ToRivetWebSocketOpen, VERSION, decodeActorCommandKeyData, decodeToEnvoy, decodeToEnvoyConn, decodeToGateway, decodeToOutbound, decodeToRivet, encodeActorCommandKeyData, encodeToEnvoy, encodeToEnvoyConn, encodeToGateway, encodeToOutbound, encodeToRivet, type i64, readActorCheckpoint, readActorCommandKeyData, readActorConfig, readActorIntent, readActorName, readActorState, readActorStateStopped, readCommand, readCommandStartActor, readCommandStopActor, readCommandWrapper, readEvent, readEventActorIntent, readEventActorSetAlarm, readEventActorStateUpdate, readEventWrapper, readGatewayId, readHibernatingRequest, readHttpStreamAbortReason, readHttpStreamAbortReasonKind, readId, readJson, readKvDeleteRangeRequest, readKvDeleteRequest, readKvErrorResponse, readKvGetRequest, readKvGetResponse, readKvKey, readKvListPrefixQuery, readKvListQuery, readKvListRangeQuery, readKvListRequest, readKvListResponse, readKvMetadata, readKvPutRequest, readKvRequestData, readKvResponseData, readKvValue, readMessageId, readMessageIndex, readPreloadedKv, readPreloadedKvEntry, readProtocolMetadata, readRequestId, readSqliteBatchStatement, readSqliteBindParam, readSqliteColumnValue, readSqliteCommitOk, readSqliteCommitRequest, readSqliteCommitResponse, readSqliteDirtyPage, readSqliteErrorResponse, readSqliteExecOk, readSqliteExecRequest, readSqliteExecResponse, readSqliteExecuteBatchOk, readSqliteExecuteBatchRequest, readSqliteExecuteBatchResponse, readSqliteExecuteOk, readSqliteExecuteRequest, readSqliteExecuteResponse, readSqliteExecuteResult, readSqliteFetchedPage, readSqliteGeneration, readSqliteGetPagesOk, readSqliteGetPagesRequest, readSqliteGetPagesResponse, readSqlitePageBytes, readSqlitePgno, readSqliteQueryResult, readSqliteValueBlob, readSqliteValueFloat, readSqliteValueInteger, readSqliteValueText, readStopActorReason, readStopCode, readToEnvoy, readToEnvoyAckEvents, readToEnvoyCommands, readToEnvoyConn, readToEnvoyConnPing, readToEnvoyInit, readToEnvoyKvResponse, readToEnvoyPing, readToEnvoyRequestAbort, readToEnvoyRequestChunk, readToEnvoyRequestStart, readToEnvoyResponseBodyWindowUpdate, readToEnvoySqliteCommitResponse, readToEnvoySqliteExecResponse, readToEnvoySqliteExecuteBatchResponse, readToEnvoySqliteExecuteResponse, readToEnvoySqliteGetPagesResponse, readToEnvoyTunnelMessage, readToEnvoyTunnelMessageKind, readToEnvoyWebSocketClose, readToEnvoyWebSocketMessage, readToEnvoyWebSocketOpen, readToGateway, readToGatewayPong, readToOutbound, readToOutboundActorStart, readToRivet, readToRivetAckCommands, readToRivetEvents, readToRivetKvRequest, readToRivetMetadata, readToRivetPong, readToRivetRequestBodyWindowUpdate, readToRivetResponseAbort, readToRivetResponseChunk, readToRivetResponseStart, readToRivetSqliteCommitRequest, readToRivetSqliteExecRequest, readToRivetSqliteExecuteBatchRequest, readToRivetSqliteExecuteRequest, readToRivetSqliteGetPagesRequest, readToRivetTunnelMessage, readToRivetTunnelMessageKind, readToRivetWebSocketClose, readToRivetWebSocketMessage, readToRivetWebSocketMessageAck, readToRivetWebSocketOpen, type u16, type u32, type u64, writeActorCheckpoint, writeActorCommandKeyData, writeActorConfig, writeActorIntent, writeActorName, writeActorState, writeActorStateStopped, writeCommand, writeCommandStartActor, writeCommandStopActor, writeCommandWrapper, writeEvent, writeEventActorIntent, writeEventActorSetAlarm, writeEventActorStateUpdate, writeEventWrapper, writeGatewayId, writeHibernatingRequest, writeHttpStreamAbortReason, writeHttpStreamAbortReasonKind, writeId, writeJson, writeKvDeleteRangeRequest, writeKvDeleteRequest, writeKvErrorResponse, writeKvGetRequest, writeKvGetResponse, writeKvKey, writeKvListPrefixQuery, writeKvListQuery, writeKvListRangeQuery, writeKvListRequest, writeKvListResponse, writeKvMetadata, writeKvPutRequest, writeKvRequestData, writeKvResponseData, writeKvValue, writeMessageId, writeMessageIndex, writePreloadedKv, writePreloadedKvEntry, writeProtocolMetadata, writeRequestId, writeSqliteBatchStatement, writeSqliteBindParam, writeSqliteColumnValue, writeSqliteCommitOk, writeSqliteCommitRequest, writeSqliteCommitResponse, writeSqliteDirtyPage, writeSqliteErrorResponse, writeSqliteExecOk, writeSqliteExecRequest, writeSqliteExecResponse, writeSqliteExecuteBatchOk, writeSqliteExecuteBatchRequest, writeSqliteExecuteBatchResponse, writeSqliteExecuteOk, writeSqliteExecuteRequest, writeSqliteExecuteResponse, writeSqliteExecuteResult, writeSqliteFetchedPage, writeSqliteGeneration, writeSqliteGetPagesOk, writeSqliteGetPagesRequest, writeSqliteGetPagesResponse, writeSqlitePageBytes, writeSqlitePgno, writeSqliteQueryResult, writeSqliteValueBlob, writeSqliteValueFloat, writeSqliteValueInteger, writeSqliteValueText, writeStopActorReason, writeStopCode, writeToEnvoy, writeToEnvoyAckEvents, writeToEnvoyCommands, writeToEnvoyConn, writeToEnvoyConnPing, writeToEnvoyInit, writeToEnvoyKvResponse, writeToEnvoyPing, writeToEnvoyRequestAbort, writeToEnvoyRequestChunk, writeToEnvoyRequestStart, writeToEnvoyResponseBodyWindowUpdate, writeToEnvoySqliteCommitResponse, writeToEnvoySqliteExecResponse, writeToEnvoySqliteExecuteBatchResponse, writeToEnvoySqliteExecuteResponse, writeToEnvoySqliteGetPagesResponse, writeToEnvoyTunnelMessage, writeToEnvoyTunnelMessageKind, writeToEnvoyWebSocketClose, writeToEnvoyWebSocketMessage, writeToEnvoyWebSocketOpen, writeToGateway, writeToGatewayPong, writeToOutbound, writeToOutboundActorStart, writeToRivet, writeToRivetAckCommands, writeToRivetEvents, writeToRivetKvRequest, writeToRivetMetadata, writeToRivetPong, writeToRivetRequestBodyWindowUpdate, writeToRivetResponseAbort, writeToRivetResponseChunk, writeToRivetResponseStart, writeToRivetSqliteCommitRequest, writeToRivetSqliteExecRequest, writeToRivetSqliteExecuteBatchRequest, writeToRivetSqliteExecuteRequest, writeToRivetSqliteGetPagesRequest, writeToRivetTunnelMessage, writeToRivetTunnelMessageKind, writeToRivetWebSocketClose, writeToRivetWebSocketMessage, writeToRivetWebSocketMessageAck, writeToRivetWebSocketOpen };
|
package/dist/index.js
CHANGED
|
@@ -1479,6 +1479,15 @@ function writeMessageId(bc, x) {
|
|
|
1479
1479
|
writeMessageIndex(bc, x.messageIndex);
|
|
1480
1480
|
}
|
|
1481
1481
|
function read22(bc) {
|
|
1482
|
+
return bare.readBool(bc) ? bare.readU32(bc) : null;
|
|
1483
|
+
}
|
|
1484
|
+
function write22(bc, x) {
|
|
1485
|
+
bare.writeBool(bc, x != null);
|
|
1486
|
+
if (x != null) {
|
|
1487
|
+
bare.writeU32(bc, x);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
function read23(bc) {
|
|
1482
1491
|
const len = bare.readUintSafe(bc);
|
|
1483
1492
|
const result = /* @__PURE__ */ new Map();
|
|
1484
1493
|
for (let i = 0; i < len; i++) {
|
|
@@ -1492,7 +1501,7 @@ function read22(bc) {
|
|
|
1492
1501
|
}
|
|
1493
1502
|
return result;
|
|
1494
1503
|
}
|
|
1495
|
-
function
|
|
1504
|
+
function write23(bc, x) {
|
|
1496
1505
|
bare.writeUintSafe(bc, x.size);
|
|
1497
1506
|
for (const kv of x) {
|
|
1498
1507
|
bare.writeString(bc, kv[0]);
|
|
@@ -1502,20 +1511,24 @@ function write22(bc, x) {
|
|
|
1502
1511
|
function readToEnvoyRequestStart(bc) {
|
|
1503
1512
|
return {
|
|
1504
1513
|
actorId: readId(bc),
|
|
1514
|
+
actorGeneration: read22(bc),
|
|
1505
1515
|
method: bare.readString(bc),
|
|
1506
1516
|
path: bare.readString(bc),
|
|
1507
|
-
headers:
|
|
1517
|
+
headers: read23(bc),
|
|
1508
1518
|
body: read18(bc),
|
|
1509
|
-
stream: bare.readBool(bc)
|
|
1519
|
+
stream: bare.readBool(bc),
|
|
1520
|
+
responseStream: bare.readBool(bc)
|
|
1510
1521
|
};
|
|
1511
1522
|
}
|
|
1512
1523
|
function writeToEnvoyRequestStart(bc, x) {
|
|
1513
1524
|
writeId(bc, x.actorId);
|
|
1525
|
+
write22(bc, x.actorGeneration);
|
|
1514
1526
|
bare.writeString(bc, x.method);
|
|
1515
1527
|
bare.writeString(bc, x.path);
|
|
1516
|
-
|
|
1528
|
+
write23(bc, x.headers);
|
|
1517
1529
|
write18(bc, x.body);
|
|
1518
1530
|
bare.writeBool(bc, x.stream);
|
|
1531
|
+
bare.writeBool(bc, x.responseStream);
|
|
1519
1532
|
}
|
|
1520
1533
|
function readToEnvoyRequestChunk(bc) {
|
|
1521
1534
|
return {
|
|
@@ -1527,17 +1540,101 @@ function writeToEnvoyRequestChunk(bc, x) {
|
|
|
1527
1540
|
bare.writeData(bc, x.body);
|
|
1528
1541
|
bare.writeBool(bc, x.finish);
|
|
1529
1542
|
}
|
|
1543
|
+
function readToRivetRequestBodyWindowUpdate(bc) {
|
|
1544
|
+
return {
|
|
1545
|
+
consumedBytes: bare.readU64(bc)
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
function writeToRivetRequestBodyWindowUpdate(bc, x) {
|
|
1549
|
+
bare.writeU64(bc, x.consumedBytes);
|
|
1550
|
+
}
|
|
1551
|
+
var HttpStreamAbortReasonKind = /* @__PURE__ */ ((HttpStreamAbortReasonKind2) => {
|
|
1552
|
+
HttpStreamAbortReasonKind2["Unknown"] = "Unknown";
|
|
1553
|
+
HttpStreamAbortReasonKind2["Cancelled"] = "Cancelled";
|
|
1554
|
+
HttpStreamAbortReasonKind2["HandlerError"] = "HandlerError";
|
|
1555
|
+
HttpStreamAbortReasonKind2["InternalError"] = "InternalError";
|
|
1556
|
+
return HttpStreamAbortReasonKind2;
|
|
1557
|
+
})(HttpStreamAbortReasonKind || {});
|
|
1558
|
+
function readHttpStreamAbortReasonKind(bc) {
|
|
1559
|
+
const offset = bc.offset;
|
|
1560
|
+
const tag = bare.readU8(bc);
|
|
1561
|
+
switch (tag) {
|
|
1562
|
+
case 0:
|
|
1563
|
+
return "Unknown" /* Unknown */;
|
|
1564
|
+
case 1:
|
|
1565
|
+
return "Cancelled" /* Cancelled */;
|
|
1566
|
+
case 2:
|
|
1567
|
+
return "HandlerError" /* HandlerError */;
|
|
1568
|
+
case 3:
|
|
1569
|
+
return "InternalError" /* InternalError */;
|
|
1570
|
+
default: {
|
|
1571
|
+
bc.offset = offset;
|
|
1572
|
+
throw new bare.BareError(offset, "invalid tag");
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
function writeHttpStreamAbortReasonKind(bc, x) {
|
|
1577
|
+
switch (x) {
|
|
1578
|
+
case "Unknown" /* Unknown */: {
|
|
1579
|
+
bare.writeU8(bc, 0);
|
|
1580
|
+
break;
|
|
1581
|
+
}
|
|
1582
|
+
case "Cancelled" /* Cancelled */: {
|
|
1583
|
+
bare.writeU8(bc, 1);
|
|
1584
|
+
break;
|
|
1585
|
+
}
|
|
1586
|
+
case "HandlerError" /* HandlerError */: {
|
|
1587
|
+
bare.writeU8(bc, 2);
|
|
1588
|
+
break;
|
|
1589
|
+
}
|
|
1590
|
+
case "InternalError" /* InternalError */: {
|
|
1591
|
+
bare.writeU8(bc, 3);
|
|
1592
|
+
break;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
function readHttpStreamAbortReason(bc) {
|
|
1597
|
+
return {
|
|
1598
|
+
kind: readHttpStreamAbortReasonKind(bc),
|
|
1599
|
+
detail: read17(bc)
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
function writeHttpStreamAbortReason(bc, x) {
|
|
1603
|
+
writeHttpStreamAbortReasonKind(bc, x.kind);
|
|
1604
|
+
write17(bc, x.detail);
|
|
1605
|
+
}
|
|
1606
|
+
function read24(bc) {
|
|
1607
|
+
return bare.readBool(bc) ? readId(bc) : null;
|
|
1608
|
+
}
|
|
1609
|
+
function write24(bc, x) {
|
|
1610
|
+
bare.writeBool(bc, x != null);
|
|
1611
|
+
if (x != null) {
|
|
1612
|
+
writeId(bc, x);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
function readToEnvoyRequestAbort(bc) {
|
|
1616
|
+
return {
|
|
1617
|
+
actorId: read24(bc),
|
|
1618
|
+
actorGeneration: read22(bc),
|
|
1619
|
+
reason: readHttpStreamAbortReason(bc)
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
function writeToEnvoyRequestAbort(bc, x) {
|
|
1623
|
+
write24(bc, x.actorId);
|
|
1624
|
+
write22(bc, x.actorGeneration);
|
|
1625
|
+
writeHttpStreamAbortReason(bc, x.reason);
|
|
1626
|
+
}
|
|
1530
1627
|
function readToRivetResponseStart(bc) {
|
|
1531
1628
|
return {
|
|
1532
1629
|
status: bare.readU16(bc),
|
|
1533
|
-
headers:
|
|
1630
|
+
headers: read23(bc),
|
|
1534
1631
|
body: read18(bc),
|
|
1535
1632
|
stream: bare.readBool(bc)
|
|
1536
1633
|
};
|
|
1537
1634
|
}
|
|
1538
1635
|
function writeToRivetResponseStart(bc, x) {
|
|
1539
1636
|
bare.writeU16(bc, x.status);
|
|
1540
|
-
|
|
1637
|
+
write23(bc, x.headers);
|
|
1541
1638
|
write18(bc, x.body);
|
|
1542
1639
|
bare.writeBool(bc, x.stream);
|
|
1543
1640
|
}
|
|
@@ -1551,17 +1648,35 @@ function writeToRivetResponseChunk(bc, x) {
|
|
|
1551
1648
|
bare.writeData(bc, x.body);
|
|
1552
1649
|
bare.writeBool(bc, x.finish);
|
|
1553
1650
|
}
|
|
1651
|
+
function readToEnvoyResponseBodyWindowUpdate(bc) {
|
|
1652
|
+
return {
|
|
1653
|
+
consumedBytes: bare.readU64(bc)
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
function writeToEnvoyResponseBodyWindowUpdate(bc, x) {
|
|
1657
|
+
bare.writeU64(bc, x.consumedBytes);
|
|
1658
|
+
}
|
|
1659
|
+
function readToRivetResponseAbort(bc) {
|
|
1660
|
+
return {
|
|
1661
|
+
reason: readHttpStreamAbortReason(bc)
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
function writeToRivetResponseAbort(bc, x) {
|
|
1665
|
+
writeHttpStreamAbortReason(bc, x.reason);
|
|
1666
|
+
}
|
|
1554
1667
|
function readToEnvoyWebSocketOpen(bc) {
|
|
1555
1668
|
return {
|
|
1556
1669
|
actorId: readId(bc),
|
|
1670
|
+
actorGeneration: read22(bc),
|
|
1557
1671
|
path: bare.readString(bc),
|
|
1558
|
-
headers:
|
|
1672
|
+
headers: read23(bc)
|
|
1559
1673
|
};
|
|
1560
1674
|
}
|
|
1561
1675
|
function writeToEnvoyWebSocketOpen(bc, x) {
|
|
1562
1676
|
writeId(bc, x.actorId);
|
|
1677
|
+
write22(bc, x.actorGeneration);
|
|
1563
1678
|
bare.writeString(bc, x.path);
|
|
1564
|
-
|
|
1679
|
+
write23(bc, x.headers);
|
|
1565
1680
|
}
|
|
1566
1681
|
function readToEnvoyWebSocketMessage(bc) {
|
|
1567
1682
|
return {
|
|
@@ -1573,10 +1688,10 @@ function writeToEnvoyWebSocketMessage(bc, x) {
|
|
|
1573
1688
|
bare.writeData(bc, x.data);
|
|
1574
1689
|
bare.writeBool(bc, x.binary);
|
|
1575
1690
|
}
|
|
1576
|
-
function
|
|
1691
|
+
function read25(bc) {
|
|
1577
1692
|
return bare.readBool(bc) ? bare.readU16(bc) : null;
|
|
1578
1693
|
}
|
|
1579
|
-
function
|
|
1694
|
+
function write25(bc, x) {
|
|
1580
1695
|
bare.writeBool(bc, x != null);
|
|
1581
1696
|
if (x != null) {
|
|
1582
1697
|
bare.writeU16(bc, x);
|
|
@@ -1584,12 +1699,12 @@ function write23(bc, x) {
|
|
|
1584
1699
|
}
|
|
1585
1700
|
function readToEnvoyWebSocketClose(bc) {
|
|
1586
1701
|
return {
|
|
1587
|
-
code:
|
|
1702
|
+
code: read25(bc),
|
|
1588
1703
|
reason: read17(bc)
|
|
1589
1704
|
};
|
|
1590
1705
|
}
|
|
1591
1706
|
function writeToEnvoyWebSocketClose(bc, x) {
|
|
1592
|
-
|
|
1707
|
+
write25(bc, x.code);
|
|
1593
1708
|
write17(bc, x.reason);
|
|
1594
1709
|
}
|
|
1595
1710
|
function readToRivetWebSocketOpen(bc) {
|
|
@@ -1620,13 +1735,13 @@ function writeToRivetWebSocketMessageAck(bc, x) {
|
|
|
1620
1735
|
}
|
|
1621
1736
|
function readToRivetWebSocketClose(bc) {
|
|
1622
1737
|
return {
|
|
1623
|
-
code:
|
|
1738
|
+
code: read25(bc),
|
|
1624
1739
|
reason: read17(bc),
|
|
1625
1740
|
hibernate: bare.readBool(bc)
|
|
1626
1741
|
};
|
|
1627
1742
|
}
|
|
1628
1743
|
function writeToRivetWebSocketClose(bc, x) {
|
|
1629
|
-
|
|
1744
|
+
write25(bc, x.code);
|
|
1630
1745
|
write17(bc, x.reason);
|
|
1631
1746
|
bare.writeBool(bc, x.hibernate);
|
|
1632
1747
|
}
|
|
@@ -1639,14 +1754,18 @@ function readToRivetTunnelMessageKind(bc) {
|
|
|
1639
1754
|
case 1:
|
|
1640
1755
|
return { tag: "ToRivetResponseChunk", val: readToRivetResponseChunk(bc) };
|
|
1641
1756
|
case 2:
|
|
1642
|
-
return { tag: "ToRivetResponseAbort", val:
|
|
1757
|
+
return { tag: "ToRivetResponseAbort", val: readToRivetResponseAbort(bc) };
|
|
1643
1758
|
case 3:
|
|
1644
|
-
return { tag: "
|
|
1759
|
+
return { tag: "ToRivetRequestBodyWindowUpdate", val: readToRivetRequestBodyWindowUpdate(bc) };
|
|
1645
1760
|
case 4:
|
|
1646
|
-
return { tag: "
|
|
1761
|
+
return { tag: "ToRivetRequestBodyCancel", val: null };
|
|
1647
1762
|
case 5:
|
|
1648
|
-
return { tag: "
|
|
1763
|
+
return { tag: "ToRivetWebSocketOpen", val: readToRivetWebSocketOpen(bc) };
|
|
1649
1764
|
case 6:
|
|
1765
|
+
return { tag: "ToRivetWebSocketMessage", val: readToRivetWebSocketMessage(bc) };
|
|
1766
|
+
case 7:
|
|
1767
|
+
return { tag: "ToRivetWebSocketMessageAck", val: readToRivetWebSocketMessageAck(bc) };
|
|
1768
|
+
case 8:
|
|
1650
1769
|
return { tag: "ToRivetWebSocketClose", val: readToRivetWebSocketClose(bc) };
|
|
1651
1770
|
default: {
|
|
1652
1771
|
bc.offset = offset;
|
|
@@ -1668,25 +1787,35 @@ function writeToRivetTunnelMessageKind(bc, x) {
|
|
|
1668
1787
|
}
|
|
1669
1788
|
case "ToRivetResponseAbort": {
|
|
1670
1789
|
bare.writeU8(bc, 2);
|
|
1790
|
+
writeToRivetResponseAbort(bc, x.val);
|
|
1671
1791
|
break;
|
|
1672
1792
|
}
|
|
1673
|
-
case "
|
|
1793
|
+
case "ToRivetRequestBodyWindowUpdate": {
|
|
1674
1794
|
bare.writeU8(bc, 3);
|
|
1795
|
+
writeToRivetRequestBodyWindowUpdate(bc, x.val);
|
|
1796
|
+
break;
|
|
1797
|
+
}
|
|
1798
|
+
case "ToRivetRequestBodyCancel": {
|
|
1799
|
+
bare.writeU8(bc, 4);
|
|
1800
|
+
break;
|
|
1801
|
+
}
|
|
1802
|
+
case "ToRivetWebSocketOpen": {
|
|
1803
|
+
bare.writeU8(bc, 5);
|
|
1675
1804
|
writeToRivetWebSocketOpen(bc, x.val);
|
|
1676
1805
|
break;
|
|
1677
1806
|
}
|
|
1678
1807
|
case "ToRivetWebSocketMessage": {
|
|
1679
|
-
bare.writeU8(bc,
|
|
1808
|
+
bare.writeU8(bc, 6);
|
|
1680
1809
|
writeToRivetWebSocketMessage(bc, x.val);
|
|
1681
1810
|
break;
|
|
1682
1811
|
}
|
|
1683
1812
|
case "ToRivetWebSocketMessageAck": {
|
|
1684
|
-
bare.writeU8(bc,
|
|
1813
|
+
bare.writeU8(bc, 7);
|
|
1685
1814
|
writeToRivetWebSocketMessageAck(bc, x.val);
|
|
1686
1815
|
break;
|
|
1687
1816
|
}
|
|
1688
1817
|
case "ToRivetWebSocketClose": {
|
|
1689
|
-
bare.writeU8(bc,
|
|
1818
|
+
bare.writeU8(bc, 8);
|
|
1690
1819
|
writeToRivetWebSocketClose(bc, x.val);
|
|
1691
1820
|
break;
|
|
1692
1821
|
}
|
|
@@ -1711,12 +1840,16 @@ function readToEnvoyTunnelMessageKind(bc) {
|
|
|
1711
1840
|
case 1:
|
|
1712
1841
|
return { tag: "ToEnvoyRequestChunk", val: readToEnvoyRequestChunk(bc) };
|
|
1713
1842
|
case 2:
|
|
1714
|
-
return { tag: "ToEnvoyRequestAbort", val:
|
|
1843
|
+
return { tag: "ToEnvoyRequestAbort", val: readToEnvoyRequestAbort(bc) };
|
|
1715
1844
|
case 3:
|
|
1716
|
-
return { tag: "
|
|
1845
|
+
return { tag: "ToEnvoyRequestBodyCancel", val: null };
|
|
1717
1846
|
case 4:
|
|
1718
|
-
return { tag: "
|
|
1847
|
+
return { tag: "ToEnvoyResponseBodyWindowUpdate", val: readToEnvoyResponseBodyWindowUpdate(bc) };
|
|
1719
1848
|
case 5:
|
|
1849
|
+
return { tag: "ToEnvoyWebSocketOpen", val: readToEnvoyWebSocketOpen(bc) };
|
|
1850
|
+
case 6:
|
|
1851
|
+
return { tag: "ToEnvoyWebSocketMessage", val: readToEnvoyWebSocketMessage(bc) };
|
|
1852
|
+
case 7:
|
|
1720
1853
|
return { tag: "ToEnvoyWebSocketClose", val: readToEnvoyWebSocketClose(bc) };
|
|
1721
1854
|
default: {
|
|
1722
1855
|
bc.offset = offset;
|
|
@@ -1738,20 +1871,30 @@ function writeToEnvoyTunnelMessageKind(bc, x) {
|
|
|
1738
1871
|
}
|
|
1739
1872
|
case "ToEnvoyRequestAbort": {
|
|
1740
1873
|
bare.writeU8(bc, 2);
|
|
1874
|
+
writeToEnvoyRequestAbort(bc, x.val);
|
|
1741
1875
|
break;
|
|
1742
1876
|
}
|
|
1743
|
-
case "
|
|
1877
|
+
case "ToEnvoyRequestBodyCancel": {
|
|
1744
1878
|
bare.writeU8(bc, 3);
|
|
1879
|
+
break;
|
|
1880
|
+
}
|
|
1881
|
+
case "ToEnvoyResponseBodyWindowUpdate": {
|
|
1882
|
+
bare.writeU8(bc, 4);
|
|
1883
|
+
writeToEnvoyResponseBodyWindowUpdate(bc, x.val);
|
|
1884
|
+
break;
|
|
1885
|
+
}
|
|
1886
|
+
case "ToEnvoyWebSocketOpen": {
|
|
1887
|
+
bare.writeU8(bc, 5);
|
|
1745
1888
|
writeToEnvoyWebSocketOpen(bc, x.val);
|
|
1746
1889
|
break;
|
|
1747
1890
|
}
|
|
1748
1891
|
case "ToEnvoyWebSocketMessage": {
|
|
1749
|
-
bare.writeU8(bc,
|
|
1892
|
+
bare.writeU8(bc, 6);
|
|
1750
1893
|
writeToEnvoyWebSocketMessage(bc, x.val);
|
|
1751
1894
|
break;
|
|
1752
1895
|
}
|
|
1753
1896
|
case "ToEnvoyWebSocketClose": {
|
|
1754
|
-
bare.writeU8(bc,
|
|
1897
|
+
bare.writeU8(bc, 7);
|
|
1755
1898
|
writeToEnvoyWebSocketClose(bc, x.val);
|
|
1756
1899
|
break;
|
|
1757
1900
|
}
|
|
@@ -1775,7 +1918,7 @@ function readToEnvoyPing(bc) {
|
|
|
1775
1918
|
function writeToEnvoyPing(bc, x) {
|
|
1776
1919
|
bare.writeI64(bc, x.ts);
|
|
1777
1920
|
}
|
|
1778
|
-
function
|
|
1921
|
+
function read26(bc) {
|
|
1779
1922
|
const len = bare.readUintSafe(bc);
|
|
1780
1923
|
const result = /* @__PURE__ */ new Map();
|
|
1781
1924
|
for (let i = 0; i < len; i++) {
|
|
@@ -1789,26 +1932,26 @@ function read24(bc) {
|
|
|
1789
1932
|
}
|
|
1790
1933
|
return result;
|
|
1791
1934
|
}
|
|
1792
|
-
function
|
|
1935
|
+
function write26(bc, x) {
|
|
1793
1936
|
bare.writeUintSafe(bc, x.size);
|
|
1794
1937
|
for (const kv of x) {
|
|
1795
1938
|
bare.writeString(bc, kv[0]);
|
|
1796
1939
|
writeActorName(bc, kv[1]);
|
|
1797
1940
|
}
|
|
1798
1941
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return bare.readBool(bc) ?
|
|
1942
|
+
function read27(bc) {
|
|
1943
|
+
return bare.readBool(bc) ? read26(bc) : null;
|
|
1801
1944
|
}
|
|
1802
|
-
function
|
|
1945
|
+
function write27(bc, x) {
|
|
1803
1946
|
bare.writeBool(bc, x != null);
|
|
1804
1947
|
if (x != null) {
|
|
1805
|
-
|
|
1948
|
+
write26(bc, x);
|
|
1806
1949
|
}
|
|
1807
1950
|
}
|
|
1808
|
-
function
|
|
1951
|
+
function read28(bc) {
|
|
1809
1952
|
return bare.readBool(bc) ? readJson(bc) : null;
|
|
1810
1953
|
}
|
|
1811
|
-
function
|
|
1954
|
+
function write28(bc, x) {
|
|
1812
1955
|
bare.writeBool(bc, x != null);
|
|
1813
1956
|
if (x != null) {
|
|
1814
1957
|
writeJson(bc, x);
|
|
@@ -1816,13 +1959,13 @@ function write26(bc, x) {
|
|
|
1816
1959
|
}
|
|
1817
1960
|
function readToRivetMetadata(bc) {
|
|
1818
1961
|
return {
|
|
1819
|
-
prepopulateActorNames:
|
|
1820
|
-
metadata:
|
|
1962
|
+
prepopulateActorNames: read27(bc),
|
|
1963
|
+
metadata: read28(bc)
|
|
1821
1964
|
};
|
|
1822
1965
|
}
|
|
1823
1966
|
function writeToRivetMetadata(bc, x) {
|
|
1824
|
-
|
|
1825
|
-
|
|
1967
|
+
write27(bc, x.prepopulateActorNames);
|
|
1968
|
+
write28(bc, x.metadata);
|
|
1826
1969
|
}
|
|
1827
1970
|
function readToRivetEvents(bc) {
|
|
1828
1971
|
const len = bare.readUintSafe(bc);
|
|
@@ -1841,7 +1984,7 @@ function writeToRivetEvents(bc, x) {
|
|
|
1841
1984
|
writeEventWrapper(bc, x[i]);
|
|
1842
1985
|
}
|
|
1843
1986
|
}
|
|
1844
|
-
function
|
|
1987
|
+
function read29(bc) {
|
|
1845
1988
|
const len = bare.readUintSafe(bc);
|
|
1846
1989
|
if (len === 0) {
|
|
1847
1990
|
return [];
|
|
@@ -1852,7 +1995,7 @@ function read27(bc) {
|
|
|
1852
1995
|
}
|
|
1853
1996
|
return result;
|
|
1854
1997
|
}
|
|
1855
|
-
function
|
|
1998
|
+
function write29(bc, x) {
|
|
1856
1999
|
bare.writeUintSafe(bc, x.length);
|
|
1857
2000
|
for (let i = 0; i < x.length; i++) {
|
|
1858
2001
|
writeActorCheckpoint(bc, x[i]);
|
|
@@ -1860,11 +2003,11 @@ function write27(bc, x) {
|
|
|
1860
2003
|
}
|
|
1861
2004
|
function readToRivetAckCommands(bc) {
|
|
1862
2005
|
return {
|
|
1863
|
-
lastCommandCheckpoints:
|
|
2006
|
+
lastCommandCheckpoints: read29(bc)
|
|
1864
2007
|
};
|
|
1865
2008
|
}
|
|
1866
2009
|
function writeToRivetAckCommands(bc, x) {
|
|
1867
|
-
|
|
2010
|
+
write29(bc, x.lastCommandCheckpoints);
|
|
1868
2011
|
}
|
|
1869
2012
|
function readToRivetPong(bc) {
|
|
1870
2013
|
return {
|
|
@@ -2089,11 +2232,11 @@ function writeToEnvoyCommands(bc, x) {
|
|
|
2089
2232
|
}
|
|
2090
2233
|
function readToEnvoyAckEvents(bc) {
|
|
2091
2234
|
return {
|
|
2092
|
-
lastEventCheckpoints:
|
|
2235
|
+
lastEventCheckpoints: read29(bc)
|
|
2093
2236
|
};
|
|
2094
2237
|
}
|
|
2095
2238
|
function writeToEnvoyAckEvents(bc, x) {
|
|
2096
|
-
|
|
2239
|
+
write29(bc, x.lastEventCheckpoints);
|
|
2097
2240
|
}
|
|
2098
2241
|
function readToEnvoyKvResponse(bc) {
|
|
2099
2242
|
return {
|
|
@@ -2450,8 +2593,9 @@ function decodeToOutbound(bytes) {
|
|
|
2450
2593
|
function assert(condition, message) {
|
|
2451
2594
|
if (!condition) throw new Error(message ?? "Assertion failed");
|
|
2452
2595
|
}
|
|
2453
|
-
var VERSION =
|
|
2596
|
+
var VERSION = 7;
|
|
2454
2597
|
export {
|
|
2598
|
+
HttpStreamAbortReasonKind,
|
|
2455
2599
|
StopActorReason,
|
|
2456
2600
|
StopCode,
|
|
2457
2601
|
VERSION,
|
|
@@ -2485,6 +2629,8 @@ export {
|
|
|
2485
2629
|
readEventWrapper,
|
|
2486
2630
|
readGatewayId,
|
|
2487
2631
|
readHibernatingRequest,
|
|
2632
|
+
readHttpStreamAbortReason,
|
|
2633
|
+
readHttpStreamAbortReasonKind,
|
|
2488
2634
|
readId,
|
|
2489
2635
|
readJson,
|
|
2490
2636
|
readKvDeleteRangeRequest,
|
|
@@ -2549,8 +2695,10 @@ export {
|
|
|
2549
2695
|
readToEnvoyInit,
|
|
2550
2696
|
readToEnvoyKvResponse,
|
|
2551
2697
|
readToEnvoyPing,
|
|
2698
|
+
readToEnvoyRequestAbort,
|
|
2552
2699
|
readToEnvoyRequestChunk,
|
|
2553
2700
|
readToEnvoyRequestStart,
|
|
2701
|
+
readToEnvoyResponseBodyWindowUpdate,
|
|
2554
2702
|
readToEnvoySqliteCommitResponse,
|
|
2555
2703
|
readToEnvoySqliteExecResponse,
|
|
2556
2704
|
readToEnvoySqliteExecuteBatchResponse,
|
|
@@ -2571,6 +2719,8 @@ export {
|
|
|
2571
2719
|
readToRivetKvRequest,
|
|
2572
2720
|
readToRivetMetadata,
|
|
2573
2721
|
readToRivetPong,
|
|
2722
|
+
readToRivetRequestBodyWindowUpdate,
|
|
2723
|
+
readToRivetResponseAbort,
|
|
2574
2724
|
readToRivetResponseChunk,
|
|
2575
2725
|
readToRivetResponseStart,
|
|
2576
2726
|
readToRivetSqliteCommitRequest,
|
|
@@ -2602,6 +2752,8 @@ export {
|
|
|
2602
2752
|
writeEventWrapper,
|
|
2603
2753
|
writeGatewayId,
|
|
2604
2754
|
writeHibernatingRequest,
|
|
2755
|
+
writeHttpStreamAbortReason,
|
|
2756
|
+
writeHttpStreamAbortReasonKind,
|
|
2605
2757
|
writeId,
|
|
2606
2758
|
writeJson,
|
|
2607
2759
|
writeKvDeleteRangeRequest,
|
|
@@ -2666,8 +2818,10 @@ export {
|
|
|
2666
2818
|
writeToEnvoyInit,
|
|
2667
2819
|
writeToEnvoyKvResponse,
|
|
2668
2820
|
writeToEnvoyPing,
|
|
2821
|
+
writeToEnvoyRequestAbort,
|
|
2669
2822
|
writeToEnvoyRequestChunk,
|
|
2670
2823
|
writeToEnvoyRequestStart,
|
|
2824
|
+
writeToEnvoyResponseBodyWindowUpdate,
|
|
2671
2825
|
writeToEnvoySqliteCommitResponse,
|
|
2672
2826
|
writeToEnvoySqliteExecResponse,
|
|
2673
2827
|
writeToEnvoySqliteExecuteBatchResponse,
|
|
@@ -2688,6 +2842,8 @@ export {
|
|
|
2688
2842
|
writeToRivetKvRequest,
|
|
2689
2843
|
writeToRivetMetadata,
|
|
2690
2844
|
writeToRivetPong,
|
|
2845
|
+
writeToRivetRequestBodyWindowUpdate,
|
|
2846
|
+
writeToRivetResponseAbort,
|
|
2691
2847
|
writeToRivetResponseChunk,
|
|
2692
2848
|
writeToRivetResponseStart,
|
|
2693
2849
|
writeToRivetSqliteCommitRequest,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/engine-envoy-protocol",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.13",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsup src/index.ts",
|
|
24
|
+
"test": "vitest run",
|
|
24
25
|
"clean": "rm -rf dist",
|
|
25
26
|
"check-types": "tsc --noEmit"
|
|
26
27
|
},
|
|
@@ -31,7 +32,8 @@
|
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/node": "^20.19.13",
|
|
33
34
|
"tsup": "^8.5.0",
|
|
34
|
-
"typescript": "^5.9.2"
|
|
35
|
+
"typescript": "^5.9.2",
|
|
36
|
+
"vitest": "^3.2.4"
|
|
35
37
|
},
|
|
36
38
|
"repository": {
|
|
37
39
|
"type": "git",
|