@livestore/common-cf 0.4.0-dev.9 → 0.5.0-dev.0
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/.tsbuildinfo +1 -1
- package/dist/cf-types.js +2 -0
- package/dist/cf-types.js.map +1 -1
- package/dist/declare/cf-declare.d.ts +32 -5
- package/dist/declare/cf-declare.d.ts.map +1 -1
- package/dist/declare/cf-declare.js +9 -10
- package/dist/declare/cf-declare.js.map +1 -1
- package/dist/do-rpc/client.d.ts +1 -1
- package/dist/do-rpc/client.d.ts.map +1 -1
- package/dist/do-rpc/client.js +23 -46
- package/dist/do-rpc/client.js.map +1 -1
- package/dist/do-rpc/client.test.d.ts +2 -0
- package/dist/do-rpc/client.test.d.ts.map +1 -0
- package/dist/do-rpc/client.test.js +99 -0
- package/dist/do-rpc/client.test.js.map +1 -0
- package/dist/do-rpc/rpc.test.js +27 -59
- package/dist/do-rpc/rpc.test.js.map +1 -1
- package/dist/do-rpc/server.d.ts +10 -5
- package/dist/do-rpc/server.d.ts.map +1 -1
- package/dist/do-rpc/server.js +104 -54
- package/dist/do-rpc/server.js.map +1 -1
- package/dist/do-rpc/test-fixtures/rpc-schema.d.ts +27 -27
- package/dist/do-rpc/test-fixtures/rpc-schema.js +11 -11
- package/dist/do-rpc/test-fixtures/worker.d.ts.map +1 -1
- package/dist/do-rpc/test-fixtures/worker.js +10 -10
- package/dist/do-rpc/test-fixtures/worker.js.map +1 -1
- package/dist/ws-rpc/test-fixtures/rpc-schema.d.ts +27 -27
- package/dist/ws-rpc/test-fixtures/rpc-schema.js +9 -9
- package/dist/ws-rpc/test-fixtures/worker.d.ts.map +1 -1
- package/dist/ws-rpc/test-fixtures/worker.js +2 -2
- package/dist/ws-rpc/test-fixtures/worker.js.map +1 -1
- package/dist/ws-rpc/ws-rpc-server.d.ts +47 -6
- package/dist/ws-rpc/ws-rpc-server.d.ts.map +1 -1
- package/dist/ws-rpc/ws-rpc-server.js +30 -20
- package/dist/ws-rpc/ws-rpc-server.js.map +1 -1
- package/dist/ws-rpc/ws-rpc.test.js +29 -61
- package/dist/ws-rpc/ws-rpc.test.js.map +1 -1
- package/package.json +40 -16
- package/src/cf-types.ts +2 -0
- package/src/declare/cf-declare.ts +18 -10
- package/src/do-rpc/README.md +1 -2
- package/src/do-rpc/client.test.ts +122 -0
- package/src/do-rpc/client.ts +30 -50
- package/src/do-rpc/rpc.test.ts +33 -61
- package/src/do-rpc/server.ts +157 -80
- package/src/do-rpc/test-fixtures/rpc-schema.ts +11 -11
- package/src/do-rpc/test-fixtures/worker.ts +13 -14
- package/src/ws-rpc/README.md +1 -1
- package/src/ws-rpc/test-fixtures/rpc-schema.ts +9 -9
- package/src/ws-rpc/test-fixtures/worker.ts +6 -4
- package/src/ws-rpc/ws-rpc-server.ts +69 -34
- package/src/ws-rpc/ws-rpc.test.ts +35 -63
- package/src/do-rpc/test-fixtures/.wrangler/state/v3/do/test-durable-object-rpc-TestRpcDurableObject/9ad3dfcb5436dfc3f2e14f5b554a0fd6d8b68206ad64fdde7320232d04e16dfe.sqlite +0 -0
- package/src/do-rpc/test-fixtures/.wrangler/state/v3/do/test-durable-object-rpc-TestRpcDurableObject/9ad3dfcb5436dfc3f2e14f5b554a0fd6d8b68206ad64fdde7320232d04e16dfe.sqlite-shm +0 -0
- package/src/do-rpc/test-fixtures/.wrangler/state/v3/do/test-durable-object-rpc-TestRpcDurableObject/9ad3dfcb5436dfc3f2e14f5b554a0fd6d8b68206ad64fdde7320232d04e16dfe.sqlite-wal +0 -0
- package/src/ws-rpc/test-fixtures/.wrangler/state/v3/do/test-durable-object-rpc-TestRpcDurableObject/9ad3dfcb5436dfc3f2e14f5b554a0fd6d8b68206ad64fdde7320232d04e16dfe.sqlite +0 -0
- package/src/ws-rpc/test-fixtures/.wrangler/state/v3/do/test-durable-object-rpc-TestRpcDurableObject/9ad3dfcb5436dfc3f2e14f5b554a0fd6d8b68206ad64fdde7320232d04e16dfe.sqlite-shm +0 -0
- package/src/ws-rpc/test-fixtures/.wrangler/state/v3/do/test-durable-object-rpc-TestRpcDurableObject/9ad3dfcb5436dfc3f2e14f5b554a0fd6d8b68206ad64fdde7320232d04e16dfe.sqlite-wal +0 -0
package/dist/do-rpc/server.js
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect, Exit, Headers, Option, Rpc, RpcMessage, RpcSchema, RpcSerialization, Result, Schema, SchemaIssue, Stream, } from '@livestore/utils/effect';
|
|
2
|
+
/**
|
|
3
|
+
* The erased dynamic RPC schemas (`Rpc.exitSchema(...) as Schema.Top`, `rpc.payloadSchema`) are
|
|
4
|
+
* plain data — they need NO decoding/encoding services. `Schema.Top` types those service channels
|
|
5
|
+
* as `unknown`, which surfaces as `unknown` in the requirements channel of `encode/decodeUnknownEffect`
|
|
6
|
+
* (anyUnknownInErrorContext / TS377030). Assert the true `never` services in ONE place.
|
|
7
|
+
*
|
|
8
|
+
* TODO(effect): revisit if a cleaner/idiomatic API lands — https://github.com/Effect-TS/effect/issues/6489
|
|
9
|
+
*/
|
|
10
|
+
const erasedJsonCodec = (schema) =>
|
|
11
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- erased RPC data schemas require no codec services
|
|
12
|
+
Schema.toCodecJson(schema);
|
|
2
13
|
/**
|
|
3
14
|
* Construct a Durable Object RPC handler from an `RpcGroup`.
|
|
4
15
|
* This is the DO equivalent of `RpcServer.toWebHandler`.
|
|
5
16
|
*/
|
|
6
17
|
export const toDurableObjectHandler = (group, options) => (serializedPayload) => Effect.gen(function* () {
|
|
7
|
-
const parser = RpcSerialization.msgPack.
|
|
18
|
+
const parser = RpcSerialization.msgPack.makeUnsafe();
|
|
8
19
|
// Decode incoming requests - client sends array of requests
|
|
9
20
|
const decoded = parser.decode(serializedPayload);
|
|
10
21
|
// Handle potential nested array from client serialization
|
|
11
22
|
let requests;
|
|
12
|
-
if (Array.isArray(decoded) && decoded.length === 1 && Array.isArray(decoded[0])) {
|
|
23
|
+
if (Array.isArray(decoded) === true && decoded.length === 1 && Array.isArray(decoded[0]) === true) {
|
|
13
24
|
// Double-wrapped array [[{...}]] -> [{...}]
|
|
14
25
|
requests = decoded[0];
|
|
15
26
|
}
|
|
16
|
-
else if (Array.isArray(decoded)) {
|
|
27
|
+
else if (Array.isArray(decoded) === true) {
|
|
17
28
|
// Single array [{...}]
|
|
18
29
|
requests = decoded;
|
|
19
30
|
}
|
|
@@ -28,45 +39,69 @@ export const toDurableObjectHandler = (group, options) => (serializedPayload) =>
|
|
|
28
39
|
if (request._tag !== 'Request') {
|
|
29
40
|
continue;
|
|
30
41
|
}
|
|
42
|
+
const requestId = RpcMessage.RequestId(request.id);
|
|
31
43
|
// Find the RPC handler
|
|
44
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- RpcGroup.requests map returns Rpc.Any; narrowing to AnyWithProps for property access
|
|
32
45
|
const rpc = group.requests.get(request.tag);
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- context.mapUnsafe dynamic lookup; type safety ensured by RpcGroup registration
|
|
47
|
+
const entry = context.mapUnsafe.get(rpc.key);
|
|
48
|
+
if (rpc == null || entry == null) {
|
|
35
49
|
responses.push({
|
|
36
50
|
_tag: 'Exit',
|
|
37
|
-
requestId
|
|
51
|
+
requestId,
|
|
38
52
|
exit: Exit.die(`Unknown request tag: ${request.tag}`),
|
|
39
53
|
});
|
|
40
54
|
continue;
|
|
41
55
|
}
|
|
56
|
+
const payloadResult = yield* Schema.decodeUnknownEffect(erasedJsonCodec(rpc.payloadSchema))(request.payload).pipe(Effect.provideContext(entry.context), Effect.result);
|
|
57
|
+
if (Result.isFailure(payloadResult) === true) {
|
|
58
|
+
// Request payloads are encoded with the JSON codec by Effect's RPC client. Decode them
|
|
59
|
+
// before dispatch so JSON-only representations such as `null` become their schema values.
|
|
60
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Rpc.exitSchema requires AnyWithProps; type narrowing already done above
|
|
61
|
+
const exitSchema = Rpc.exitSchema(rpc);
|
|
62
|
+
const rawExit = Exit.die(SchemaIssue.makeFormatterDefault()(payloadResult.failure.issue));
|
|
63
|
+
const encodedExit = yield* Schema.encodeUnknownEffect(erasedJsonCodec(exitSchema))(rawExit).pipe(Effect.provideContext(entry.context));
|
|
64
|
+
responses.push({
|
|
65
|
+
_tag: 'Exit',
|
|
66
|
+
requestId,
|
|
67
|
+
exit: encodedExit,
|
|
68
|
+
});
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const payload = payloadResult.success;
|
|
42
72
|
// Check if this is a streaming RPC
|
|
43
73
|
const isStream = RpcSchema.isStreamSchema(rpc.successSchema);
|
|
44
74
|
// For streaming RPCs with only one request, return ReadableStream directly
|
|
45
|
-
if (isStream && requests.length === 1) {
|
|
46
|
-
return yield* createStreamingResponse(rpc, entry,
|
|
75
|
+
if (isStream === true && requests.length === 1) {
|
|
76
|
+
return yield* createStreamingResponse(rpc, entry, requestId, payload, parser, options.layer);
|
|
47
77
|
}
|
|
48
78
|
// Execute the handler
|
|
49
79
|
const result = yield* Effect.gen(function* () {
|
|
50
|
-
const handlerResult = entry.handler(
|
|
51
|
-
|
|
80
|
+
const handlerResult = entry.handler(payload, {
|
|
81
|
+
client: new Rpc.ServerClient(0), // TODO: add proper clientId if needed
|
|
82
|
+
requestId,
|
|
52
83
|
headers: Headers.fromInput({
|
|
53
|
-
'x-rpc-request-id':
|
|
84
|
+
'x-rpc-request-id': requestId.toString(),
|
|
54
85
|
}),
|
|
86
|
+
rpc,
|
|
55
87
|
});
|
|
88
|
+
const effectOrStream = Rpc.isWrapper(handlerResult) === true ? handlerResult.value : handlerResult;
|
|
56
89
|
let value;
|
|
57
|
-
if (Effect.isEffect(
|
|
58
|
-
|
|
90
|
+
if (Effect.isEffect(effectOrStream) === true) {
|
|
91
|
+
// @effect-diagnostics-next-line anyUnknownInErrorContext:off -- `Rpc.Handler.handler` returns `Effect<any, any>` due to dynamic dispatch
|
|
92
|
+
value = yield* effectOrStream;
|
|
59
93
|
}
|
|
60
94
|
else {
|
|
61
|
-
value =
|
|
95
|
+
value = effectOrStream;
|
|
62
96
|
}
|
|
63
97
|
// Get the exit schema for this RPC
|
|
98
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Rpc.exitSchema requires AnyWithProps; type narrowing already done above
|
|
64
99
|
const exitSchema = Rpc.exitSchema(rpc);
|
|
65
100
|
let encodedExit;
|
|
66
|
-
if (exitSchema) {
|
|
101
|
+
if (exitSchema !== undefined) {
|
|
67
102
|
// Use schema encoding for proper serialization
|
|
68
103
|
const rawExit = Exit.succeed(value);
|
|
69
|
-
encodedExit = yield* Schema.
|
|
104
|
+
encodedExit = yield* Schema.encodeUnknownEffect(erasedJsonCodec(exitSchema))(rawExit);
|
|
70
105
|
}
|
|
71
106
|
else {
|
|
72
107
|
// Fallback to direct exit
|
|
@@ -74,18 +109,19 @@ export const toDurableObjectHandler = (group, options) => (serializedPayload) =>
|
|
|
74
109
|
}
|
|
75
110
|
return {
|
|
76
111
|
_tag: 'Exit',
|
|
77
|
-
requestId
|
|
112
|
+
requestId,
|
|
78
113
|
exit: encodedExit,
|
|
79
114
|
};
|
|
80
|
-
}).pipe(Effect.
|
|
115
|
+
}).pipe(Effect.catchCause((cause) => {
|
|
81
116
|
// Get the exit schema for this RPC
|
|
117
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Rpc.exitSchema requires AnyWithProps; type narrowing already done above
|
|
82
118
|
const exitSchema = Rpc.exitSchema(rpc);
|
|
83
119
|
return Effect.gen(function* () {
|
|
84
120
|
let encodedExit;
|
|
85
|
-
if (exitSchema) {
|
|
121
|
+
if (exitSchema !== undefined) {
|
|
86
122
|
// Use schema encoding for proper serialization
|
|
87
123
|
const rawExit = Exit.failCause(cause);
|
|
88
|
-
encodedExit = yield* Schema.
|
|
124
|
+
encodedExit = yield* Schema.encodeUnknownEffect(erasedJsonCodec(exitSchema))(rawExit);
|
|
89
125
|
}
|
|
90
126
|
else {
|
|
91
127
|
// Fallback to direct exit
|
|
@@ -93,102 +129,116 @@ export const toDurableObjectHandler = (group, options) => (serializedPayload) =>
|
|
|
93
129
|
}
|
|
94
130
|
return {
|
|
95
131
|
_tag: 'Exit',
|
|
96
|
-
requestId
|
|
132
|
+
requestId,
|
|
97
133
|
exit: encodedExit,
|
|
98
134
|
};
|
|
99
135
|
});
|
|
100
136
|
}));
|
|
101
137
|
responses.push(result);
|
|
102
138
|
}
|
|
139
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- msgPack parser.encode returns unknown; cast to expected wire format
|
|
103
140
|
const encoded = parser.encode(responses);
|
|
104
141
|
return encoded;
|
|
105
142
|
}).pipe(Effect.provide(options.layer), Effect.scoped, Effect.orDie);
|
|
106
143
|
/** Out-of-band RPC stream response emission back to the caller DO */
|
|
107
|
-
export const emitStreamResponse = ({ callerContext, env, requestId, values, })
|
|
144
|
+
export const emitStreamResponse = Effect.fn('do-rpc/emitStreamResponse')(function* ({ callerContext, env, requestId, storeId, values, }) {
|
|
145
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- CF worker env bindings are typed as Record<string, any>; narrowing to known DO namespace
|
|
108
146
|
const clientDoNamespace = env[callerContext.bindingName];
|
|
109
147
|
if (clientDoNamespace === undefined) {
|
|
110
148
|
throw new Error(`Client DO namespace not found: ${callerContext.bindingName}`);
|
|
111
149
|
}
|
|
112
150
|
const clientDo = clientDoNamespace.get(clientDoNamespace.idFromString(callerContext.durableObjectId));
|
|
113
151
|
const res = { _tag: 'Chunk', requestId, values };
|
|
114
|
-
|
|
115
|
-
|
|
152
|
+
const parser = RpcSerialization.msgPack.makeUnsafe();
|
|
153
|
+
// Native Cloudflare RPC rejects schema values with custom prototypes. Keep the callback
|
|
154
|
+
// boundary clone-safe by sending the already-encoded Effect RPC message as bytes.
|
|
155
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- msgPack parser.encode returns unknown; the encoded result is a byte payload
|
|
156
|
+
const serializedRes = parser.encode(res);
|
|
157
|
+
yield* Effect.tryPromise(() => clientDo.syncUpdateRpc(serializedRes, storeId));
|
|
158
|
+
});
|
|
116
159
|
/**
|
|
117
160
|
* Creates a ReadableStream response for streaming RPCs.
|
|
118
161
|
* This converts an Effect Stream into a ReadableStream of serialized RPC messages.
|
|
119
162
|
*/
|
|
120
|
-
const createStreamingResponse = (rpc, entry,
|
|
163
|
+
const createStreamingResponse = (rpc, entry, requestId, payload, parser, layer) => Effect.gen(function* () {
|
|
121
164
|
// Execute the handler to get the stream
|
|
122
|
-
const handlerResult = entry.handler(
|
|
123
|
-
|
|
165
|
+
const handlerResult = entry.handler(payload, {
|
|
166
|
+
client: new Rpc.ServerClient(0), // TODO: add proper clientId if needed
|
|
167
|
+
requestId,
|
|
124
168
|
headers: Headers.fromInput({
|
|
125
|
-
'x-rpc-request-id':
|
|
169
|
+
'x-rpc-request-id': requestId.toString(),
|
|
126
170
|
}),
|
|
171
|
+
rpc,
|
|
127
172
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
// Direct stream
|
|
135
|
-
stream = handlerResult;
|
|
136
|
-
}
|
|
173
|
+
const effectOrStream = Rpc.isWrapper(handlerResult) === true ? handlerResult.value : handlerResult;
|
|
174
|
+
const stream =
|
|
175
|
+
// @effect-diagnostics-next-line anyUnknownInErrorContext:off -- `Rpc.Handler.handler` returns `Effect<any, any>` due to dynamic dispatch; orDie converts the error to a defect handled by the downstream catchCause
|
|
176
|
+
Effect.isEffect(effectOrStream) === true ? yield* Effect.orDie(effectOrStream) : effectOrStream;
|
|
137
177
|
// Get the stream schemas for proper chunk-level encoding
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
?
|
|
141
|
-
|
|
178
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Rpc.Handler doesn't expose successSchema publicly; see https://github.com/Effect-TS/effect/issues/6064
|
|
179
|
+
const streamSchemas = RpcSchema.isStreamSchema(rpc.successSchema) === true
|
|
180
|
+
? Option.some({
|
|
181
|
+
success: rpc.successSchema.success,
|
|
182
|
+
error: rpc.successSchema.error,
|
|
183
|
+
})
|
|
184
|
+
: Option.none();
|
|
185
|
+
const arrayEncoder = Option.isSome(streamSchemas) === true
|
|
186
|
+
? Schema.encodeUnknownEffect(Schema.toCodecJson(Schema.Array(streamSchemas.value.success)))
|
|
187
|
+
: Schema.encodeUnknownEffect(Schema.toCodecJson(Schema.Array(Schema.Any)));
|
|
142
188
|
// Convert stream to ReadableStream
|
|
143
189
|
const readableStream = new ReadableStream({
|
|
144
190
|
start(controller) {
|
|
145
191
|
// Run the stream and send chunks + final exit
|
|
146
192
|
const runStream = Effect.gen(function* () {
|
|
147
193
|
// Process stream chunks - let chunk encoder handle Effect objects properly
|
|
148
|
-
yield* Stream.
|
|
149
|
-
|
|
150
|
-
if (chunkArray.length === 0)
|
|
194
|
+
yield* Stream.runForEachArray(stream, (array) => Effect.gen(function* () {
|
|
195
|
+
if (array.length === 0)
|
|
151
196
|
return;
|
|
152
197
|
// Encode the chunk using the proper chunk encoder (like official RPC)
|
|
153
|
-
const encodedValues = yield*
|
|
198
|
+
const encodedValues = yield* arrayEncoder(array);
|
|
154
199
|
const chunkMessage = {
|
|
155
200
|
_tag: 'Chunk',
|
|
156
|
-
requestId
|
|
201
|
+
requestId,
|
|
157
202
|
values: encodedValues,
|
|
158
203
|
};
|
|
204
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- msgPack parser.encode returns unknown; cast to expected wire format
|
|
159
205
|
const serialized = parser.encode([chunkMessage]);
|
|
160
206
|
controller.enqueue(serialized);
|
|
161
207
|
}));
|
|
162
208
|
// Send final exit message with proper schema encoding
|
|
163
209
|
const rawExit = Exit.void;
|
|
210
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Rpc.exitSchema requires AnyWithProps; type narrowing already done above
|
|
164
211
|
const exitSchema = Rpc.exitSchema(rpc);
|
|
165
|
-
const encodedExit = yield* Schema.
|
|
212
|
+
const encodedExit = yield* Schema.encodeUnknownEffect(erasedJsonCodec(exitSchema))(rawExit);
|
|
166
213
|
const exitMessage = {
|
|
167
214
|
_tag: 'Exit',
|
|
168
|
-
requestId
|
|
215
|
+
requestId,
|
|
169
216
|
exit: encodedExit,
|
|
170
217
|
};
|
|
218
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- msgPack parser.encode returns unknown; cast to expected wire format
|
|
171
219
|
const exitSerialized = parser.encode([exitMessage]);
|
|
172
220
|
controller.enqueue(exitSerialized);
|
|
173
221
|
controller.close();
|
|
174
|
-
}).pipe(Effect.
|
|
222
|
+
}).pipe(Effect.catchCause((cause) => Effect.gen(function* () {
|
|
175
223
|
// Send error exit with proper schema encoding
|
|
176
224
|
const rawExit = Exit.failCause(cause);
|
|
225
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Rpc.exitSchema requires AnyWithProps; type narrowing already done above
|
|
177
226
|
const exitSchema = Rpc.exitSchema(rpc);
|
|
178
|
-
const encodedExit = yield* Schema.
|
|
227
|
+
const encodedExit = yield* Schema.encodeUnknownEffect(erasedJsonCodec(exitSchema))(rawExit);
|
|
179
228
|
const exitMessage = {
|
|
180
229
|
_tag: 'Exit',
|
|
181
|
-
requestId
|
|
230
|
+
requestId,
|
|
182
231
|
exit: encodedExit,
|
|
183
232
|
};
|
|
233
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- msgPack parser.encode returns unknown; cast to expected wire format
|
|
184
234
|
const exitSerialized = parser.encode([exitMessage]);
|
|
185
235
|
controller.enqueue(exitSerialized);
|
|
186
236
|
controller.close();
|
|
187
237
|
})));
|
|
188
238
|
// Run the stream processing
|
|
189
|
-
|
|
190
|
-
runStream.pipe(Effect.provide(layer), Effect.scoped, Effect.tapCauseLogPretty, Effect.runPromise);
|
|
239
|
+
runStream.pipe(Effect.provide(layer), Effect.scoped, Effect.tapCauseLogPretty, (_) => _, Effect.runPromise);
|
|
191
240
|
},
|
|
241
|
+
// oxlint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- bridging standard Web API ReadableStream to Cloudflare Worker ReadableStream type
|
|
192
242
|
});
|
|
193
243
|
// yield* Effect.addFinalizer(() => Effect.promise(() => readableStream.cancel()))
|
|
194
244
|
return readableStream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/do-rpc/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/do-rpc/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EAEP,MAAM,EAEN,GAAG,EAEH,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,WAAW,EAEX,MAAM,GACP,MAAM,yBAAyB,CAAA;AAIhC;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG,CAAC,MAAkB,EAAE,EAAE;AAC7C,4HAA4H;AAC5H,MAAM,CAAC,WAAW,CAAC,MAAsD,CAAC,CAAA;AAW5E;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GACjC,CACE,KAA8B,EAC9B,OAKC,EAGmE,EAAE,CACxE,CAAC,iBAAiB,EAAE,EAAE,CACpB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;IAEpD,4DAA4D;IAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEhD,0DAA0D;IAC1D,IAAI,QAAwC,CAAA;IA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C,IAAI,CACL,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAC1B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAClB,8CAA8C;gBAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;gBACrC,kJAAkJ;gBAClJ,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,GAAU,CAAe,CAAA;gBAC3D,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;gBAE3F,MAAM,WAAW,GAAG;oBAClB,IAAI,EAAE,MAAe;oBACrB,SAAS;oBACT,IAAI,EAAE,WAAW;iBAClB,CAAA;gBAED,8IAA8I;gBAC9I,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAA4B,CAAA;gBAC9E,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;gBAClC,UAAU,CAAC,KAAK,EAAE,CAAA;YACpB,CAAC,CAAC,CACH,CACF,CAAA;YAED,4BAA4B;YAC5B,SAAS,CAAC,IAAI,CACZ,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EACrB,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,iBAAiB,EACxB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAwB,EAC/B,MAAM,CAAC,UAAU,CAClB,CAAA;QACH,CAAC;QACD,4JAA4J;KAC7J,CAAkC,CAAA;IAEnC,kFAAkF;IAElF,OAAO,cAAc,CAAA;AACvB,CAAC,CAAC,CAAA"}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { Rpc, RpcGroup, Schema } from '@livestore/utils/effect';
|
|
2
2
|
declare const TestRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"Ping", Schema.Struct<{
|
|
3
|
-
message:
|
|
3
|
+
readonly message: Schema.String;
|
|
4
4
|
}>, Schema.Struct<{
|
|
5
|
-
response:
|
|
6
|
-
}>,
|
|
7
|
-
text:
|
|
5
|
+
readonly response: Schema.String;
|
|
6
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Echo", Schema.Struct<{
|
|
7
|
+
readonly text: Schema.String;
|
|
8
8
|
}>, Schema.Struct<{
|
|
9
|
-
echo:
|
|
10
|
-
}>,
|
|
11
|
-
a:
|
|
12
|
-
b:
|
|
9
|
+
readonly echo: Schema.String;
|
|
10
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Add", Schema.Struct<{
|
|
11
|
+
readonly a: Schema.Finite;
|
|
12
|
+
readonly b: Schema.Finite;
|
|
13
13
|
}>, Schema.Struct<{
|
|
14
|
-
result:
|
|
15
|
-
}>,
|
|
16
|
-
message:
|
|
14
|
+
readonly result: Schema.Finite;
|
|
15
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Defect", Schema.Struct<{
|
|
16
|
+
readonly message: Schema.String;
|
|
17
17
|
}>, Schema.Struct<{
|
|
18
|
-
never:
|
|
19
|
-
}>,
|
|
20
|
-
message:
|
|
18
|
+
readonly never: Schema.String;
|
|
19
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Fail", Schema.Struct<{
|
|
20
|
+
readonly message: Schema.String;
|
|
21
21
|
}>, Schema.Struct<{
|
|
22
|
-
never:
|
|
23
|
-
}>,
|
|
24
|
-
maybeNumber: Schema.Option<
|
|
25
|
-
}>,
|
|
26
|
-
count:
|
|
27
|
-
errorAfter:
|
|
28
|
-
}>, import("
|
|
29
|
-
count:
|
|
30
|
-
defectAfter:
|
|
31
|
-
}>, import("
|
|
32
|
-
delay:
|
|
33
|
-
interruptAfterCount:
|
|
34
|
-
}>, import("
|
|
22
|
+
readonly never: Schema.String;
|
|
23
|
+
}>, Schema.String, never, never> | Rpc.Rpc<"Stream", Schema.Struct<{}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Struct<{
|
|
24
|
+
readonly maybeNumber: Schema.Option<Schema.Finite>;
|
|
25
|
+
}>, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"StreamError", Schema.Struct<{
|
|
26
|
+
readonly count: Schema.Finite;
|
|
27
|
+
readonly errorAfter: Schema.Finite;
|
|
28
|
+
}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.String>, Schema.Never, never, never> | Rpc.Rpc<"StreamDefect", Schema.Struct<{
|
|
29
|
+
readonly count: Schema.Finite;
|
|
30
|
+
readonly defectAfter: Schema.Finite;
|
|
31
|
+
}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"StreamInterruptible", Schema.Struct<{
|
|
32
|
+
readonly delay: Schema.Finite;
|
|
33
|
+
readonly interruptAfterCount: Schema.Finite;
|
|
34
|
+
}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"StreamBugScenarioDoServer", Schema.Struct<{}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"StreamBugScenarioDoClient", Schema.Struct<{}>, Schema.Finite, Schema.Never, never, never>>;
|
|
35
35
|
export declare class TestRpcs extends TestRpcs_base {
|
|
36
36
|
}
|
|
37
37
|
export type TestRpcsI = RpcGroup.Rpcs<typeof TestRpcs>;
|
|
@@ -6,8 +6,8 @@ export class TestRpcs extends RpcGroup.make(Rpc.make('Ping', {
|
|
|
6
6
|
payload: Schema.Struct({ text: Schema.String }),
|
|
7
7
|
success: Schema.Struct({ echo: Schema.String }),
|
|
8
8
|
}), Rpc.make('Add', {
|
|
9
|
-
payload: Schema.Struct({ a: Schema.
|
|
10
|
-
success: Schema.Struct({ result: Schema.
|
|
9
|
+
payload: Schema.Struct({ a: Schema.Finite, b: Schema.Finite }),
|
|
10
|
+
success: Schema.Struct({ result: Schema.Finite }),
|
|
11
11
|
}), Rpc.make('Defect', {
|
|
12
12
|
payload: Schema.Struct({ message: Schema.String }),
|
|
13
13
|
success: Schema.Struct({ never: Schema.String }),
|
|
@@ -18,29 +18,29 @@ export class TestRpcs extends RpcGroup.make(Rpc.make('Ping', {
|
|
|
18
18
|
}), Rpc.make('Stream', {
|
|
19
19
|
payload: Schema.Struct({}),
|
|
20
20
|
success: Schema.Struct({
|
|
21
|
-
maybeNumber: Schema.Option(Schema.
|
|
21
|
+
maybeNumber: Schema.Option(Schema.Finite),
|
|
22
22
|
}),
|
|
23
23
|
stream: true,
|
|
24
24
|
}), Rpc.make('StreamError', {
|
|
25
|
-
payload: Schema.Struct({ count: Schema.
|
|
26
|
-
success: Schema.
|
|
25
|
+
payload: Schema.Struct({ count: Schema.Finite, errorAfter: Schema.Finite }),
|
|
26
|
+
success: Schema.Finite,
|
|
27
27
|
error: Schema.String,
|
|
28
28
|
stream: true,
|
|
29
29
|
}), Rpc.make('StreamDefect', {
|
|
30
|
-
payload: Schema.Struct({ count: Schema.
|
|
31
|
-
success: Schema.
|
|
30
|
+
payload: Schema.Struct({ count: Schema.Finite, defectAfter: Schema.Finite }),
|
|
31
|
+
success: Schema.Finite,
|
|
32
32
|
stream: true,
|
|
33
33
|
}), Rpc.make('StreamInterruptible', {
|
|
34
|
-
payload: Schema.Struct({ delay: Schema.
|
|
35
|
-
success: Schema.
|
|
34
|
+
payload: Schema.Struct({ delay: Schema.Finite, interruptAfterCount: Schema.Finite }),
|
|
35
|
+
success: Schema.Finite,
|
|
36
36
|
stream: true,
|
|
37
37
|
}), Rpc.make('StreamBugScenarioDoServer', {
|
|
38
38
|
payload: Schema.Struct({}),
|
|
39
|
-
success: Schema.
|
|
39
|
+
success: Schema.Finite,
|
|
40
40
|
stream: true,
|
|
41
41
|
}), Rpc.make('StreamBugScenarioDoClient', {
|
|
42
42
|
payload: Schema.Struct({}),
|
|
43
|
-
success: Schema.
|
|
43
|
+
success: Schema.Finite,
|
|
44
44
|
})) {
|
|
45
45
|
}
|
|
46
46
|
//# sourceMappingURL=rpc-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/do-rpc/test-fixtures/worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/do-rpc/test-fixtures/worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAiBlD,MAAM,WAAW,GAAG;IAClB,WAAW,EAAE,sBAAsB,CAAC,oBAAoB,CAAC,CAAA;CAC1D;AAED,qBAAa,oBAAqB,SAAQ,aAAa;IAC5C,sBAAsB,EAA6B,KAAK,CAAA;IAE3D,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CA4C9C;;mBAGsB,OAAO,OAAO,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;;AAD5D,wBAuEC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
2
|
import { DurableObject } from 'cloudflare:workers';
|
|
3
3
|
import { layerProtocolDurableObject, toDurableObjectHandler } from '@livestore/common-cf';
|
|
4
|
-
import { Effect,
|
|
4
|
+
import { Effect, HttpEffect, Layer, Option, RpcClient, RpcSerialization, RpcServer, Schedule, Stream, } from '@livestore/utils/effect';
|
|
5
5
|
import { TestRpcs } from "./rpc-schema.js";
|
|
6
6
|
export class TestRpcDurableObject extends DurableObject {
|
|
7
7
|
__DURABLE_OBJECT_BRAND = 'TestRpcDurableObject';
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
try {
|
|
33
33
|
const url = new URL(request.url);
|
|
34
34
|
// Handle HTTP RPC endpoint
|
|
35
|
-
if (url.pathname === '/rpc') {
|
|
35
|
+
if (url.pathname === '/rpc/') {
|
|
36
36
|
// Get the test server DO instance
|
|
37
37
|
const doId = env.TEST_RPC_DO.idFromName('test-server');
|
|
38
38
|
const serverDO = env.TEST_RPC_DO.get(doId);
|
|
@@ -56,16 +56,16 @@ export default {
|
|
|
56
56
|
StreamBugScenarioDoServer: () => Stream.die('never called'),
|
|
57
57
|
StreamBugScenarioDoClient: (msg) => doRpcClient.StreamBugScenarioDoServer(msg).pipe(Stream.tap(() => Effect.fail('doh')),
|
|
58
58
|
// observed behaviour: `log1` is still logged
|
|
59
|
-
Stream.
|
|
59
|
+
Stream.tapCause((cause) => Effect.log('log1', cause)), Stream.mapError((cause) => cause.toString()),
|
|
60
60
|
// observed behaviour: after this error mapping `log2` is never logged
|
|
61
|
-
Stream.
|
|
61
|
+
Stream.tapCause((cause) => Effect.log('log2', cause)), Stream.tapLogWithLabel('stream'), Stream.runCount, Effect.orDie,
|
|
62
62
|
// observed behaviour: `log3` is also never logged
|
|
63
|
-
Effect.
|
|
64
|
-
}).pipe(Layer.provideMerge(
|
|
65
|
-
// Create the HTTP RPC
|
|
66
|
-
const
|
|
63
|
+
Effect.tapCause((cause) => Effect.log('log3', cause))),
|
|
64
|
+
}).pipe(Layer.provideMerge(RpcSerialization.layerJson));
|
|
65
|
+
// Create the HTTP RPC effect
|
|
66
|
+
const httpEffect = yield* RpcServer.toHttpEffect(TestRpcs).pipe(Effect.provide(handlersLayer));
|
|
67
67
|
// Run the app and convert to web handler
|
|
68
|
-
const webHandler =
|
|
68
|
+
const webHandler = HttpEffect.toWebHandler(httpEffect);
|
|
69
69
|
return yield* Effect.promise(() => webHandler(request));
|
|
70
70
|
}).pipe(Effect.tapCauseLogPretty, Effect.scoped, Effect.withSpan('@livestore/common-cf/do-rpc/test-fixtures/worker:fetch'),
|
|
71
71
|
// Effect.provide(ProtocolLive),
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
catch (error) {
|
|
79
|
-
return new Response(`Error: ${error}`, { status: 500 });
|
|
79
|
+
return new Response(`Error: ${String(error)}`, { status: 500 });
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/do-rpc/test-fixtures/worker.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/do-rpc/test-fixtures/worker.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AACzF,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,GACP,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAM1C,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IAC5C,sBAAsB,GAAG,sBAA+B,CAAA;IAEjE,KAAK,CAAC,GAAG,CAAC,OAAgB;QACxB,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;YACpC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,CAAC;YACvE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,IAAI,EAAE,EAAE,CAAC;YAC7D,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG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AAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,QAAQ,CAAC,UAAU,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { Rpc, RpcGroup, Schema } from '@livestore/utils/effect';
|
|
2
2
|
declare const TestRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"Ping", Schema.Struct<{
|
|
3
|
-
message:
|
|
3
|
+
readonly message: Schema.String;
|
|
4
4
|
}>, Schema.Struct<{
|
|
5
|
-
response:
|
|
6
|
-
}>,
|
|
7
|
-
text:
|
|
5
|
+
readonly response: Schema.String;
|
|
6
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Echo", Schema.Struct<{
|
|
7
|
+
readonly text: Schema.String;
|
|
8
8
|
}>, Schema.Struct<{
|
|
9
|
-
echo:
|
|
10
|
-
}>,
|
|
11
|
-
a:
|
|
12
|
-
b:
|
|
9
|
+
readonly echo: Schema.String;
|
|
10
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Add", Schema.Struct<{
|
|
11
|
+
readonly a: Schema.Finite;
|
|
12
|
+
readonly b: Schema.Finite;
|
|
13
13
|
}>, Schema.Struct<{
|
|
14
|
-
result:
|
|
15
|
-
}>,
|
|
16
|
-
message:
|
|
14
|
+
readonly result: Schema.Finite;
|
|
15
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Defect", Schema.Struct<{
|
|
16
|
+
readonly message: Schema.String;
|
|
17
17
|
}>, Schema.Struct<{
|
|
18
|
-
never:
|
|
19
|
-
}>,
|
|
20
|
-
message:
|
|
18
|
+
readonly never: Schema.String;
|
|
19
|
+
}>, Schema.Never, never, never> | Rpc.Rpc<"Fail", Schema.Struct<{
|
|
20
|
+
readonly message: Schema.String;
|
|
21
21
|
}>, Schema.Struct<{
|
|
22
|
-
never:
|
|
23
|
-
}>,
|
|
24
|
-
maybeNumber: Schema.Option<
|
|
25
|
-
}>,
|
|
26
|
-
count:
|
|
27
|
-
errorAfter:
|
|
28
|
-
}>, import("
|
|
29
|
-
count:
|
|
30
|
-
defectAfter:
|
|
31
|
-
}>, import("
|
|
32
|
-
delay:
|
|
33
|
-
interruptAfterCount:
|
|
34
|
-
}>, import("
|
|
22
|
+
readonly never: Schema.String;
|
|
23
|
+
}>, Schema.String, never, never> | Rpc.Rpc<"Stream", Schema.Struct<{}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Struct<{
|
|
24
|
+
readonly maybeNumber: Schema.Option<Schema.Finite>;
|
|
25
|
+
}>, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"StreamError", Schema.Struct<{
|
|
26
|
+
readonly count: Schema.Finite;
|
|
27
|
+
readonly errorAfter: Schema.Finite;
|
|
28
|
+
}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.String>, Schema.Never, never, never> | Rpc.Rpc<"StreamDefect", Schema.Struct<{
|
|
29
|
+
readonly count: Schema.Finite;
|
|
30
|
+
readonly defectAfter: Schema.Finite;
|
|
31
|
+
}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.Never>, Schema.Never, never, never> | Rpc.Rpc<"StreamInterruptible", Schema.Struct<{
|
|
32
|
+
readonly delay: Schema.Finite;
|
|
33
|
+
readonly interruptAfterCount: Schema.Finite;
|
|
34
|
+
}>, import("effect/unstable/rpc/RpcSchema").Stream<Schema.Finite, Schema.Never>, Schema.Never, never, never>>;
|
|
35
35
|
export declare class TestRpcs extends TestRpcs_base {
|
|
36
36
|
}
|
|
37
37
|
export type TestRpcsI = RpcGroup.Rpcs<typeof TestRpcs>;
|