@effect-app/infra 4.0.0-beta.200 → 4.0.0-beta.202
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/CHANGELOG.md +39 -0
- package/dist/CUPS.d.ts +2 -10
- package/dist/CUPS.d.ts.map +1 -1
- package/dist/Model/Repository/validation.d.ts +13 -109
- package/dist/Model/Repository/validation.d.ts.map +1 -1
- package/dist/RequestContext.d.ts +7 -55
- package/dist/RequestContext.d.ts.map +1 -1
- package/dist/adapters/logger.d.ts +1 -1
- package/dist/api/routing/middleware/middleware.d.ts +3 -13
- package/dist/api/routing/middleware/middleware.d.ts.map +1 -1
- package/dist/api/routing/middleware/middleware.js +5 -35
- package/dist/api/routing.d.ts +1 -1
- package/dist/api/routing.d.ts.map +1 -1
- package/dist/api/routing.js +18 -2
- package/dist/logger.d.ts +1 -1
- package/package.json +2 -2
- package/src/api/routing/middleware/middleware.ts +5 -61
- package/src/api/routing.ts +32 -1
- package/test/controller.test.ts +1 -1
- package/test/dist/controller.test.d.ts.map +1 -1
- package/test/dist/date-query.test.d.ts.map +1 -0
- package/test/dist/query.test.d.ts.map +1 -1
- package/test/router-generator.test.ts +4 -1
- package/test/rpc-e2e-invalidation.test.ts +188 -446
- package/test/rpc-stream-fullstack.test.ts +9 -9
|
@@ -200,7 +200,7 @@ const TestLayer = Layer.mergeAll(ServerLayer, ClientLayer)
|
|
|
200
200
|
it.live(
|
|
201
201
|
"stream resource without input: ApiClientFactory client emits all values",
|
|
202
202
|
Effect.fnUntraced(function*() {
|
|
203
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
203
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
204
204
|
const values = yield* Stream.runCollect(client.StreamTicks.handler())
|
|
205
205
|
expect(values).toStrictEqual([10, 20, 30])
|
|
206
206
|
}, Effect.provide(TestLayer)),
|
|
@@ -210,7 +210,7 @@ it.live(
|
|
|
210
210
|
it.live(
|
|
211
211
|
"stream resource with input: payload drives the emitted values",
|
|
212
212
|
Effect.fnUntraced(function*() {
|
|
213
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
213
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
214
214
|
const values = yield* Stream.runCollect(client.StreamCountTo.handler({ to: 4 }))
|
|
215
215
|
expect(values).toStrictEqual([1, 2, 3, 4])
|
|
216
216
|
}, Effect.provide(TestLayer)),
|
|
@@ -220,7 +220,7 @@ it.live(
|
|
|
220
220
|
it.live(
|
|
221
221
|
"stream resource is delivered element-by-element in real time (not batched)",
|
|
222
222
|
Effect.fnUntraced(function*() {
|
|
223
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
223
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
224
224
|
const start = Date.now()
|
|
225
225
|
const arrivals = yield* Stream.runCollect(
|
|
226
226
|
client.StreamRealtime.handler().pipe(
|
|
@@ -244,7 +244,7 @@ it.live(
|
|
|
244
244
|
it.live(
|
|
245
245
|
"stream handler returning Effect.fail surfaces as failing stream on client",
|
|
246
246
|
Effect.fnUntraced(function*() {
|
|
247
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
247
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
248
248
|
const exit = yield* Stream.runCollect(client.StreamFailEffect.handler()).pipe(Effect.exit)
|
|
249
249
|
expect(Exit.isFailure(exit)).toBe(true)
|
|
250
250
|
if (Exit.isFailure(exit)) {
|
|
@@ -260,7 +260,7 @@ it.live(
|
|
|
260
260
|
it.live(
|
|
261
261
|
"stream handler returning Stream.fail surfaces as failing stream on client",
|
|
262
262
|
Effect.fnUntraced(function*() {
|
|
263
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
263
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
264
264
|
const exit = yield* Stream.runCollect(client.StreamFailStream.handler()).pipe(Effect.exit)
|
|
265
265
|
expect(Exit.isFailure(exit)).toBe(true)
|
|
266
266
|
if (Exit.isFailure(exit)) {
|
|
@@ -276,7 +276,7 @@ it.live(
|
|
|
276
276
|
it.live(
|
|
277
277
|
"stream resource without `success` exposes handler as a Stream on the client",
|
|
278
278
|
Effect.fnUntraced(function*() {
|
|
279
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
279
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
280
280
|
const exit = yield* Stream.runCollect(client.StreamNoSuccess.handler()).pipe(Effect.exit)
|
|
281
281
|
expect(Exit.isSuccess(exit)).toBe(true)
|
|
282
282
|
}, Effect.provide(TestLayer)),
|
|
@@ -297,7 +297,7 @@ const expectNotLoggedIn = (exit: Exit.Exit<unknown, unknown>) => {
|
|
|
297
297
|
it.live(
|
|
298
298
|
"stream resource: middleware-emitted NotLoggedInError surfaces cleanly on the client",
|
|
299
299
|
Effect.fnUntraced(function*() {
|
|
300
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
300
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
301
301
|
const exit = yield* Stream.runCollect(client.StreamRequiresAuth.handler()).pipe(Effect.exit)
|
|
302
302
|
expectNotLoggedIn(exit)
|
|
303
303
|
}, Effect.provide(TestLayer)),
|
|
@@ -307,7 +307,7 @@ it.live(
|
|
|
307
307
|
it.live(
|
|
308
308
|
"command resource: middleware-emitted NotLoggedInError surfaces cleanly on the client",
|
|
309
309
|
Effect.fnUntraced(function*() {
|
|
310
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
310
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
311
311
|
const exit = yield* client.CommandRequiresAuth.handler().pipe(Effect.exit)
|
|
312
312
|
expectNotLoggedIn(exit)
|
|
313
313
|
}, Effect.provide(TestLayer)),
|
|
@@ -317,7 +317,7 @@ it.live(
|
|
|
317
317
|
it.live(
|
|
318
318
|
"query resource: middleware-emitted NotLoggedInError surfaces cleanly on the client",
|
|
319
319
|
Effect.fnUntraced(function*() {
|
|
320
|
-
const client = yield* ApiClientFactory.makeFor(Layer.empty)(StreamyRsc)
|
|
320
|
+
const client = yield* ApiClientFactory.makeFor(Layer.empty, { middleware: AppMiddleware })(StreamyRsc)
|
|
321
321
|
const exit = yield* client.QueryRequiresAuth.handler().pipe(Effect.exit)
|
|
322
322
|
expectNotLoggedIn(exit)
|
|
323
323
|
}, Effect.provide(TestLayer)),
|