effect 4.0.0-beta.44 → 4.0.0-beta.45

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.
Files changed (151) hide show
  1. package/dist/Equal.d.ts.map +1 -1
  2. package/dist/Equal.js +16 -0
  3. package/dist/Equal.js.map +1 -1
  4. package/dist/Hash.js +1 -1
  5. package/dist/Hash.js.map +1 -1
  6. package/dist/Semaphore.d.ts +1 -1
  7. package/dist/Semaphore.d.ts.map +1 -1
  8. package/dist/Semaphore.js +1 -3
  9. package/dist/Semaphore.js.map +1 -1
  10. package/dist/unstable/ai/McpServer.d.ts.map +1 -1
  11. package/dist/unstable/ai/McpServer.js +24 -21
  12. package/dist/unstable/ai/McpServer.js.map +1 -1
  13. package/dist/unstable/eventlog/Event.d.ts +0 -6
  14. package/dist/unstable/eventlog/Event.d.ts.map +1 -1
  15. package/dist/unstable/eventlog/Event.js +0 -5
  16. package/dist/unstable/eventlog/Event.js.map +1 -1
  17. package/dist/unstable/eventlog/EventGroup.d.ts +0 -2
  18. package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
  19. package/dist/unstable/eventlog/EventGroup.js +0 -2
  20. package/dist/unstable/eventlog/EventGroup.js.map +1 -1
  21. package/dist/unstable/eventlog/EventJournal.d.ts +22 -5
  22. package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
  23. package/dist/unstable/eventlog/EventJournal.js +126 -67
  24. package/dist/unstable/eventlog/EventJournal.js.map +1 -1
  25. package/dist/unstable/eventlog/EventLog.d.ts +88 -34
  26. package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
  27. package/dist/unstable/eventlog/EventLog.js +215 -141
  28. package/dist/unstable/eventlog/EventLog.js.map +1 -1
  29. package/dist/unstable/eventlog/EventLogEncryption.d.ts +9 -7
  30. package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
  31. package/dist/unstable/eventlog/EventLogEncryption.js +13 -15
  32. package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
  33. package/dist/unstable/eventlog/EventLogMessage.d.ts +228 -0
  34. package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -0
  35. package/dist/unstable/eventlog/EventLogMessage.js +214 -0
  36. package/dist/unstable/eventlog/EventLogMessage.js.map +1 -0
  37. package/dist/unstable/eventlog/EventLogRemote.d.ts +109 -194
  38. package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
  39. package/dist/unstable/eventlog/EventLogRemote.js +165 -320
  40. package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
  41. package/dist/unstable/eventlog/EventLogServer.d.ts +25 -47
  42. package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
  43. package/dist/unstable/eventlog/EventLogServer.js +127 -198
  44. package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
  45. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +60 -0
  46. package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -0
  47. package/dist/unstable/eventlog/EventLogServerEncrypted.js +166 -0
  48. package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -0
  49. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +183 -0
  50. package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -0
  51. package/dist/unstable/eventlog/EventLogServerUnencrypted.js +461 -0
  52. package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -0
  53. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +117 -0
  54. package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -0
  55. package/dist/unstable/eventlog/EventLogSessionAuth.js +284 -0
  56. package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -0
  57. package/dist/unstable/eventlog/{SqlEventLogJournal.d.ts → SqlEventJournal.d.ts} +2 -2
  58. package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -0
  59. package/dist/unstable/eventlog/{SqlEventLogJournal.js → SqlEventJournal.js} +20 -14
  60. package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -0
  61. package/dist/unstable/eventlog/{SqlEventLogServer.d.ts → SqlEventLogServerEncrypted.d.ts} +5 -5
  62. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -0
  63. package/dist/unstable/eventlog/{SqlEventLogServer.js → SqlEventLogServerEncrypted.js} +65 -24
  64. package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -0
  65. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +25 -0
  66. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -0
  67. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +354 -0
  68. package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -0
  69. package/dist/unstable/eventlog/index.d.ts +22 -2
  70. package/dist/unstable/eventlog/index.d.ts.map +1 -1
  71. package/dist/unstable/eventlog/index.js +22 -2
  72. package/dist/unstable/eventlog/index.js.map +1 -1
  73. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts +2 -0
  74. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts.map +1 -0
  75. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js +89 -0
  76. package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -0
  77. package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -2
  78. package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
  79. package/dist/unstable/reactivity/AtomHttpApi.js +2 -2
  80. package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
  81. package/dist/unstable/reactivity/AtomRpc.d.ts +1 -2
  82. package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
  83. package/dist/unstable/reactivity/AtomRpc.js +3 -3
  84. package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
  85. package/dist/unstable/rpc/Rpc.d.ts +25 -4
  86. package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
  87. package/dist/unstable/rpc/Rpc.js +26 -0
  88. package/dist/unstable/rpc/Rpc.js.map +1 -1
  89. package/dist/unstable/rpc/RpcClient.d.ts +3 -13
  90. package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
  91. package/dist/unstable/rpc/RpcClient.js +47 -23
  92. package/dist/unstable/rpc/RpcClient.js.map +1 -1
  93. package/dist/unstable/rpc/RpcGroup.d.ts +1 -1
  94. package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
  95. package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
  96. package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
  97. package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
  98. package/dist/unstable/rpc/RpcServer.js +3 -2
  99. package/dist/unstable/rpc/RpcServer.js.map +1 -1
  100. package/dist/unstable/rpc/Utils.d.ts +6 -0
  101. package/dist/unstable/rpc/Utils.d.ts.map +1 -1
  102. package/dist/unstable/rpc/Utils.js +44 -0
  103. package/dist/unstable/rpc/Utils.js.map +1 -1
  104. package/dist/unstable/schema/Model.d.ts +2 -2
  105. package/dist/unstable/schema/Model.d.ts.map +1 -1
  106. package/dist/unstable/schema/Model.js +2 -4
  107. package/dist/unstable/schema/Model.js.map +1 -1
  108. package/dist/unstable/schema/VariantSchema.d.ts +1 -1
  109. package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
  110. package/dist/unstable/schema/VariantSchema.js +1 -12
  111. package/dist/unstable/schema/VariantSchema.js.map +1 -1
  112. package/dist/unstable/workers/Transferable.d.ts +1 -1
  113. package/dist/unstable/workers/Transferable.d.ts.map +1 -1
  114. package/dist/unstable/workers/Transferable.js +1 -1
  115. package/dist/unstable/workers/Transferable.js.map +1 -1
  116. package/package.json +1 -1
  117. package/src/Equal.ts +17 -0
  118. package/src/Hash.ts +2 -2
  119. package/src/Semaphore.ts +2 -4
  120. package/src/unstable/ai/McpServer.ts +24 -22
  121. package/src/unstable/eventlog/Event.ts +0 -8
  122. package/src/unstable/eventlog/EventGroup.ts +0 -4
  123. package/src/unstable/eventlog/EventJournal.ts +144 -76
  124. package/src/unstable/eventlog/EventLog.ts +342 -221
  125. package/src/unstable/eventlog/EventLogEncryption.ts +16 -30
  126. package/src/unstable/eventlog/EventLogMessage.ts +277 -0
  127. package/src/unstable/eventlog/EventLogRemote.ts +261 -408
  128. package/src/unstable/eventlog/EventLogServer.ts +182 -274
  129. package/src/unstable/eventlog/EventLogServerEncrypted.ts +206 -0
  130. package/src/unstable/eventlog/EventLogServerUnencrypted.ts +749 -0
  131. package/src/unstable/eventlog/EventLogSessionAuth.ts +437 -0
  132. package/src/unstable/eventlog/{SqlEventLogJournal.ts → SqlEventJournal.ts} +26 -18
  133. package/src/unstable/eventlog/{SqlEventLogServer.ts → SqlEventLogServerEncrypted.ts} +102 -40
  134. package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +500 -0
  135. package/src/unstable/eventlog/index.ts +27 -2
  136. package/src/unstable/eventlog/internal/identityRootSecretDerivation.ts +153 -0
  137. package/src/unstable/reactivity/AtomHttpApi.ts +23 -8
  138. package/src/unstable/reactivity/AtomRpc.ts +16 -5
  139. package/src/unstable/rpc/Rpc.ts +42 -4
  140. package/src/unstable/rpc/RpcClient.ts +59 -24
  141. package/src/unstable/rpc/RpcGroup.ts +1 -1
  142. package/src/unstable/rpc/RpcMiddleware.ts +2 -2
  143. package/src/unstable/rpc/RpcServer.ts +5 -3
  144. package/src/unstable/rpc/Utils.ts +59 -0
  145. package/src/unstable/schema/Model.ts +4 -6
  146. package/src/unstable/schema/VariantSchema.ts +4 -17
  147. package/src/unstable/workers/Transferable.ts +9 -11
  148. package/dist/unstable/eventlog/SqlEventLogJournal.d.ts.map +0 -1
  149. package/dist/unstable/eventlog/SqlEventLogJournal.js.map +0 -1
  150. package/dist/unstable/eventlog/SqlEventLogServer.d.ts.map +0 -1
  151. package/dist/unstable/eventlog/SqlEventLogServer.js.map +0 -1
@@ -1,21 +1,28 @@
1
- /**
2
- * @since 4.0.0
3
- */
4
1
  import * as Context from "../../Context.ts";
5
2
  import * as Effect from "../../Effect.ts";
6
3
  import * as Layer from "../../Layer.ts";
7
4
  import * as Queue from "../../Queue.ts";
8
- import * as Schema from "../../Schema.ts";
5
+ import type * as Schema from "../../Schema.ts";
9
6
  import type * as Scope from "../../Scope.ts";
10
- import * as Msgpack from "../encoding/Msgpack.ts";
11
- import * as Socket from "../socket/Socket.ts";
12
- import { type Entry, RemoteEntry, RemoteId } from "./EventJournal.ts";
13
- import type { Identity } from "./EventLog.ts";
7
+ import * as RpcClient from "../rpc/RpcClient.ts";
8
+ import type { RpcClientError } from "../rpc/RpcClientError.ts";
9
+ import type { Entry, RemoteEntry, RemoteId } from "./EventJournal.ts";
10
+ import { type Identity, Registry } from "./EventLog.ts";
14
11
  import { EventLogEncryption } from "./EventLogEncryption.ts";
12
+ import { ChunkedMessage, type EventLogProtocolError, type HelloResponse, type StoreId } from "./EventLogMessage.ts";
15
13
  declare const EventLogRemote_base: Context.ServiceClass<EventLogRemote, "effect/eventlog/EventLogRemote", {
16
14
  readonly id: RemoteId;
17
- readonly changes: (identity: Identity["Service"], startSequence: number) => Effect.Effect<Queue.Dequeue<RemoteEntry>, never, Scope.Scope>;
18
- readonly write: (identity: Identity["Service"], entries: ReadonlyArray<Entry>) => Effect.Effect<void>;
15
+ readonly changes: (options: {
16
+ readonly identity: Identity["Service"];
17
+ readonly storeId: StoreId;
18
+ readonly startSequence: number;
19
+ }) => Effect.Effect<Queue.Dequeue<RemoteEntry, EventLogRemoteError>, never, Scope.Scope>;
20
+ readonly write: (options: {
21
+ readonly identity: Identity["Service"];
22
+ readonly storeId: StoreId;
23
+ readonly entries: ReadonlyArray<Entry>;
24
+ }) => Effect.Effect<void, EventLogRemoteError>;
25
+ readonly whenAuthenticated: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EventLogRemoteError, R | Identity>;
19
26
  }>;
20
27
  /**
21
28
  * @since 4.0.0
@@ -23,174 +30,6 @@ declare const EventLogRemote_base: Context.ServiceClass<EventLogRemote, "effect/
23
30
  */
24
31
  export declare class EventLogRemote extends EventLogRemote_base {
25
32
  }
26
- declare const Hello_base: Schema.Class<Hello, Schema.Struct<{
27
- readonly _tag: Schema.tag<"Hello">;
28
- readonly remoteId: Schema.brand<Schema.Uint8Array, "effect/eventlog/EventJournal/RemoteId">;
29
- }>, {}>;
30
- /**
31
- * @since 4.0.0
32
- * @category protocol
33
- */
34
- export declare class Hello extends Hello_base {
35
- }
36
- declare const ChunkedMessage_base: Schema.Class<ChunkedMessage, Schema.Struct<{
37
- readonly _tag: Schema.tag<"ChunkedMessage">;
38
- readonly id: Schema.Number;
39
- readonly part: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
40
- readonly data: Schema.Uint8Array;
41
- }>, {}>;
42
- /**
43
- * @since 4.0.0
44
- * @category protocol
45
- */
46
- export declare class ChunkedMessage extends ChunkedMessage_base {
47
- /**
48
- * @since 4.0.0
49
- */
50
- static split(id: number, data: Uint8Array): ReadonlyArray<ChunkedMessage>;
51
- /**
52
- * @since 4.0.0
53
- */
54
- static join(map: Map<number, {
55
- readonly parts: Array<Uint8Array>;
56
- count: number;
57
- bytes: number;
58
- }>, part: ChunkedMessage): Uint8Array | undefined;
59
- }
60
- declare const WriteEntries_base: Schema.Class<WriteEntries, Schema.Struct<{
61
- readonly _tag: Schema.tag<"WriteEntries">;
62
- readonly publicKey: Schema.String;
63
- readonly id: Schema.Number;
64
- readonly iv: Schema.Uint8Array;
65
- readonly encryptedEntries: Schema.$Array<Schema.Struct<{
66
- readonly entryId: Schema.brand<Schema.Uint8Array, "effect/eventlog/EventJournal/EntryId">;
67
- readonly encryptedEntry: Schema.Uint8Array;
68
- }>>;
69
- }>, {}>;
70
- /**
71
- * @since 4.0.0
72
- * @category protocol
73
- */
74
- export declare class WriteEntries extends WriteEntries_base {
75
- }
76
- declare const Ack_base: Schema.Class<Ack, Schema.Struct<{
77
- readonly _tag: Schema.tag<"Ack">;
78
- readonly id: Schema.Number;
79
- readonly sequenceNumbers: Schema.$Array<Schema.Number>;
80
- }>, {}>;
81
- /**
82
- * @since 4.0.0
83
- * @category protocol
84
- */
85
- export declare class Ack extends Ack_base {
86
- }
87
- declare const RequestChanges_base: Schema.Class<RequestChanges, Schema.Struct<{
88
- readonly _tag: Schema.tag<"RequestChanges">;
89
- readonly publicKey: Schema.String;
90
- readonly startSequence: Schema.Number;
91
- }>, {}>;
92
- /**
93
- * @since 4.0.0
94
- * @category protocol
95
- */
96
- export declare class RequestChanges extends RequestChanges_base {
97
- }
98
- declare const Changes_base: Schema.Class<Changes, Schema.Struct<{
99
- readonly _tag: Schema.tag<"Changes">;
100
- readonly publicKey: Schema.String;
101
- readonly entries: Schema.$Array<Schema.Struct<{
102
- readonly sequence: Schema.Number;
103
- readonly iv: Schema.Uint8Array;
104
- readonly entryId: Schema.brand<Schema.Uint8Array, "effect/eventlog/EventJournal/EntryId">;
105
- readonly encryptedEntry: Schema.Uint8Array;
106
- }>>;
107
- }>, {}>;
108
- /**
109
- * @since 4.0.0
110
- * @category protocol
111
- */
112
- export declare class Changes extends Changes_base {
113
- }
114
- declare const StopChanges_base: Schema.Class<StopChanges, Schema.Struct<{
115
- readonly _tag: Schema.tag<"StopChanges">;
116
- readonly publicKey: Schema.String;
117
- }>, {}>;
118
- /**
119
- * @since 4.0.0
120
- * @category protocol
121
- */
122
- export declare class StopChanges extends StopChanges_base {
123
- }
124
- declare const Ping_base: Schema.Class<Ping, Schema.Struct<{
125
- readonly _tag: Schema.tag<"Ping">;
126
- readonly id: Schema.Number;
127
- }>, {}>;
128
- /**
129
- * @since 4.0.0
130
- * @category protocol
131
- */
132
- export declare class Ping extends Ping_base {
133
- }
134
- declare const Pong_base: Schema.Class<Pong, Schema.Struct<{
135
- readonly _tag: Schema.tag<"Pong">;
136
- readonly id: Schema.Number;
137
- }>, {}>;
138
- /**
139
- * @since 4.0.0
140
- * @category protocol
141
- */
142
- export declare class Pong extends Pong_base {
143
- }
144
- /**
145
- * @since 4.0.0
146
- * @category protocol
147
- */
148
- export declare const ProtocolRequest: Schema.Union<readonly [typeof WriteEntries, typeof RequestChanges, typeof StopChanges, typeof ChunkedMessage, typeof Ping]>;
149
- /**
150
- * @since 4.0.0
151
- * @category protocol
152
- */
153
- export declare const ProtocolRequestMsgpack: Msgpack.schema<Schema.Union<readonly [typeof WriteEntries, typeof RequestChanges, typeof StopChanges, typeof ChunkedMessage, typeof Ping]>>;
154
- /**
155
- * @since 4.0.0
156
- * @category protocol
157
- */
158
- export declare const decodeRequest: (input: unknown, options?: import("../../SchemaAST.ts").ParseOptions) => Effect.Effect<ChunkedMessage | WriteEntries | RequestChanges | StopChanges | Ping, Schema.SchemaError, never>;
159
- /**
160
- * @since 4.0.0
161
- * @category protocol
162
- */
163
- export declare const encodeRequest: (input: unknown, options?: import("../../SchemaAST.ts").ParseOptions) => Effect.Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
164
- /**
165
- * @since 4.0.0
166
- * @category protocol
167
- */
168
- export declare const ProtocolResponse: Schema.Union<readonly [typeof Hello, typeof Ack, typeof Changes, typeof ChunkedMessage, typeof Pong]>;
169
- /**
170
- * @since 4.0.0
171
- * @category protocol
172
- */
173
- export declare const ProtocolResponseMsgpack: Msgpack.schema<Schema.Union<readonly [typeof Hello, typeof Ack, typeof Changes, typeof ChunkedMessage, typeof Pong]>>;
174
- /**
175
- * @since 4.0.0
176
- * @category protocol
177
- */
178
- export declare const decodeResponse: (input: unknown, options?: import("../../SchemaAST.ts").ParseOptions) => Effect.Effect<Hello | ChunkedMessage | Ack | Changes | Pong, Schema.SchemaError, never>;
179
- /**
180
- * @since 4.0.0
181
- * @category protocol
182
- */
183
- export declare const encodeResponse: (input: unknown, options?: import("../../SchemaAST.ts").ParseOptions) => Effect.Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
184
- declare const RemoteAdditions_base: Schema.Class<RemoteAdditions, Schema.Struct<{
185
- readonly _tag: Schema.tag<"RemoteAdditions">;
186
- readonly entries: Schema.$Array<typeof RemoteEntry>;
187
- }>, {}>;
188
- /**
189
- * @since 4.0.0
190
- * @category change
191
- */
192
- export declare class RemoteAdditions extends RemoteAdditions_base {
193
- }
194
33
  declare const EventLogRemoteError_base: new <A extends Record<string, any> = {}>(args: import("../../Types.ts").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("../../Cause.ts").YieldableError & {
195
34
  readonly _tag: "EventLogRemoteError";
196
35
  } & Readonly<A>;
@@ -203,38 +42,114 @@ export declare class EventLogRemoteError extends EventLogRemoteError_base<{
203
42
  readonly cause: unknown;
204
43
  }> {
205
44
  }
45
+ declare const EventLogRemoteClient_base: Context.ServiceClass<EventLogRemoteClient, "effect/unstable/eventlog/EventLogRemote/EventLogRemoteClient", {
46
+ readonly "EventLog.Hello": <const AsQueue extends boolean = false, const Discard = false>(input: void, options?: {
47
+ readonly headers?: import("../http/Headers.ts").Input | undefined;
48
+ readonly context?: Context.Context<never> | undefined;
49
+ readonly discard?: Discard | undefined;
50
+ } | undefined) => Effect.Effect<Discard extends true ? void : HelloResponse, RpcClientError | (Discard extends true ? never : never), never>;
51
+ readonly "EventLog.Authenticate": <const AsQueue extends boolean = false, const Discard = false>(input: {
52
+ readonly publicKey: string;
53
+ readonly signingPublicKey: Uint8Array<ArrayBuffer>;
54
+ readonly signature: Uint8Array<ArrayBuffer>;
55
+ readonly algorithm: "Ed25519";
56
+ }, options?: {
57
+ readonly headers?: import("../http/Headers.ts").Input | undefined;
58
+ readonly context?: Context.Context<never> | undefined;
59
+ readonly discard?: Discard | undefined;
60
+ } | undefined) => Effect.Effect<Discard extends true ? void : void, RpcClientError | (Discard extends true ? never : EventLogProtocolError), never>;
61
+ readonly "EventLog.WriteChunked": <const AsQueue extends boolean = false, const Discard = false>(input: {
62
+ readonly id: number;
63
+ readonly part: readonly [number, number];
64
+ readonly data: Uint8Array<ArrayBuffer>;
65
+ readonly _tag?: "Chunked";
66
+ }, options?: {
67
+ readonly headers?: import("../http/Headers.ts").Input | undefined;
68
+ readonly context?: Context.Context<never> | undefined;
69
+ readonly discard?: Discard | undefined;
70
+ } | undefined) => Effect.Effect<Discard extends true ? void : void, RpcClientError | EventLogProtocolError | (Discard extends true ? never : EventLogProtocolError), never>;
71
+ readonly "EventLog.WriteSingle": <const AsQueue extends boolean = false, const Discard = false>(input: {
72
+ readonly data: Uint8Array<ArrayBuffer>;
73
+ }, options?: {
74
+ readonly headers?: import("../http/Headers.ts").Input | undefined;
75
+ readonly context?: Context.Context<never> | undefined;
76
+ readonly discard?: Discard | undefined;
77
+ } | undefined) => Effect.Effect<Discard extends true ? void : void, RpcClientError | EventLogProtocolError | (Discard extends true ? never : EventLogProtocolError), never>;
78
+ readonly "EventLog.Changes": <const AsQueue extends boolean = false, const Discard = false>(input: {
79
+ readonly publicKey: string;
80
+ readonly storeId: string & import("../../Brand.ts").Brand<"effect/eventlog/EventLog/StoreId">;
81
+ readonly startSequence: number;
82
+ }, options?: {
83
+ readonly asQueue?: AsQueue | undefined;
84
+ readonly streamBufferSize?: number | undefined;
85
+ readonly headers?: import("../http/Headers.ts").Input | undefined;
86
+ readonly context?: Context.Context<never> | undefined;
87
+ } | undefined) => AsQueue extends true ? Effect.Effect<Queue.Dequeue<ChunkedMessage | import("./EventLogMessage.ts").SingleMessage, import("../../Cause.ts").Done<void> | RpcClientError | EventLogProtocolError>, never, Scope.Scope> : import("../../Stream.ts").Stream<ChunkedMessage | import("./EventLogMessage.ts").SingleMessage, RpcClientError | EventLogProtocolError, never>;
88
+ }>;
206
89
  /**
207
90
  * @since 4.0.0
208
- * @category entry
91
+ * @category RpcClient
209
92
  */
210
- export declare const RemoteEntryChange: Schema.Tuple<readonly [Schema.brand<Schema.Uint8Array, "effect/eventlog/EventJournal/RemoteId">, Schema.$Array<Schema.brand<Schema.Uint8Array, "effect/eventlog/EventJournal/EntryId">>]>;
93
+ export declare class EventLogRemoteClient extends EventLogRemoteClient_base {
94
+ static readonly layer: Layer.Layer<EventLogRemoteClient, never, RpcClient.Protocol>;
95
+ }
211
96
  /**
212
97
  * @since 4.0.0
213
98
  * @category constructors
214
99
  */
215
- export declare const fromSocket: (options?: {
216
- readonly disablePing?: boolean;
217
- }) => Effect.Effect<EventLogRemote["Service"], never, Scope.Scope | EventLogEncryption | Socket.Socket>;
100
+ export declare const makeWith: (args_0: {
101
+ readonly encodeWrite: (options: {
102
+ readonly identity: Identity["Service"];
103
+ readonly entries: ReadonlyArray<Entry>;
104
+ readonly storeId: StoreId;
105
+ }) => Effect.Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError>;
106
+ readonly decodeChanges: (identity: Identity["Service"], data: Uint8Array<ArrayBuffer>) => Effect.Effect<ReadonlyArray<RemoteEntry>, Schema.SchemaError>;
107
+ }) => Effect.Effect<{
108
+ readonly id: RemoteId;
109
+ readonly changes: (options: {
110
+ readonly identity: Identity["Service"];
111
+ readonly storeId: StoreId;
112
+ readonly startSequence: number;
113
+ }) => Effect.Effect<Queue.Dequeue<RemoteEntry, EventLogRemoteError>, never, Scope.Scope>;
114
+ readonly write: (options: {
115
+ readonly identity: Identity["Service"];
116
+ readonly storeId: StoreId;
117
+ readonly entries: ReadonlyArray<Entry>;
118
+ }) => Effect.Effect<void, EventLogRemoteError>;
119
+ readonly whenAuthenticated: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EventLogRemoteError, R | Identity>;
120
+ }, EventLogRemoteError, Scope.Scope | EventLogRemoteClient | Registry>;
121
+ /**
122
+ * @since 4.0.0
123
+ * @category constructors
124
+ */
125
+ export declare const makeEncrypted: Effect.Effect<{
126
+ readonly id: RemoteId;
127
+ readonly changes: (options: {
128
+ readonly identity: Identity["Service"];
129
+ readonly storeId: StoreId;
130
+ readonly startSequence: number;
131
+ }) => Effect.Effect<Queue.Dequeue<RemoteEntry, EventLogRemoteError>, never, Scope.Scope>;
132
+ readonly write: (options: {
133
+ readonly identity: Identity["Service"];
134
+ readonly storeId: StoreId;
135
+ readonly entries: ReadonlyArray<Entry>;
136
+ }) => Effect.Effect<void, EventLogRemoteError>;
137
+ readonly whenAuthenticated: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EventLogRemoteError, R | Identity>;
138
+ }, EventLogRemoteError, Scope.Scope | EventLogEncryption | EventLogRemoteClient | Registry>;
218
139
  /**
219
140
  * @since 4.0.0
220
141
  * @category constructors
221
142
  */
222
- export declare const fromWebSocket: (url: string, options?: {
223
- readonly disablePing?: boolean;
224
- }) => Effect.Effect<EventLogRemote["Service"], never, Scope.Scope | EventLogEncryption | Socket.WebSocketConstructor>;
143
+ export declare const makeUnencrypted: Effect.Effect<EventLogRemote["Service"], EventLogRemoteError, Scope.Scope | EventLogRemoteClient | Registry>;
225
144
  /**
226
145
  * @since 4.0.0
227
- * @category layers
146
+ * @category Layers
228
147
  */
229
- export declare const layerWebSocket: (url: string, options?: {
230
- readonly disablePing?: boolean;
231
- }) => Layer.Layer<never, never, Socket.WebSocketConstructor | EventLogEncryption>;
148
+ export declare const layerEncrypted: Layer.Layer<EventLogRemote, EventLogRemoteError, RpcClient.Protocol | Registry>;
232
149
  /**
233
150
  * @since 4.0.0
234
- * @category layers
151
+ * @category Layers
235
152
  */
236
- export declare const layerWebSocketBrowser: (url: string, options?: {
237
- readonly disablePing?: boolean;
238
- }) => Layer.Layer<never>;
153
+ export declare const layerUnencrypted: Layer.Layer<EventLogRemote, EventLogRemoteError, RpcClient.Protocol | Registry>;
239
154
  export {};
240
155
  //# sourceMappingURL=EventLogRemote.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventLogRemote.d.ts","sourceRoot":"","sources":["../../../src/unstable/eventlog/EventLogRemote.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAG3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,gBA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