@effect-app/infra 4.0.0-beta.267 → 4.0.0-beta.269
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 +17 -0
- package/dist/Store/Memory.d.ts +2 -3
- package/dist/Store/Memory.d.ts.map +1 -1
- package/dist/Store/Memory.js +3 -6
- package/dist/Store/codeFilter.d.ts +1 -1
- package/dist/Store/codeFilter.d.ts.map +1 -1
- package/dist/Store/codeFilter.js +2 -3
- package/dist/Store/index.js +1 -1
- package/dist/Store/utils.d.ts +3 -1
- package/dist/Store/utils.d.ts.map +1 -1
- package/dist/Store/utils.js +5 -1
- package/dist/routing/middleware.d.ts +2 -2
- package/dist/routing.d.ts +9 -11
- package/dist/routing.d.ts.map +1 -1
- package/dist/routing.js +5 -6
- package/package.json +3 -3
- package/src/CUPS.ts +1 -1
- package/src/ClusterCosmos.ts +2 -2
- package/src/ContextProvider.ts +1 -1
- package/src/Emailer/Sendgrid.ts +1 -1
- package/src/Emailer/fake.ts +1 -1
- package/src/MainFiberSet.ts +3 -3
- package/src/QueueMaker/SQLQueue.ts +3 -3
- package/src/QueueMaker/memQueue.ts +4 -4
- package/src/QueueMaker/sbqueue.ts +4 -4
- package/src/RequestFiberSet.ts +2 -2
- package/src/SQL/Model.ts +1 -1
- package/src/SQL.ts +1 -1
- package/src/ServiceBus.ts +1 -1
- package/src/Store/Cosmos/query.ts +2 -2
- package/src/Store/Cosmos.ts +5 -5
- package/src/Store/Disk.ts +3 -3
- package/src/Store/Memory.ts +5 -8
- package/src/Store/SQL/Pg.ts +5 -5
- package/src/Store/SQL/query.ts +2 -2
- package/src/Store/SQL.ts +5 -5
- package/src/Store/codeFilter.ts +1 -2
- package/src/Store/index.test.ts.bak +2 -2
- package/src/Store/index.ts +6 -6
- package/src/Store/utils.ts +6 -1
- package/src/WorkflowEngineCosmos.ts +3 -3
- package/src/WorkflowEngineSqlite.ts +2 -2
- package/src/errorReporter.ts +2 -2
- package/src/index.ts +2 -2
- package/src/internal/events.ts +1 -1
- package/src/layerUtils.ts +1 -1
- package/src/logger/jsonLogger.ts +1 -1
- package/src/logger/logFmtLogger.ts +1 -1
- package/src/middlewares.ts +4 -4
- package/src/reportError.ts +1 -1
- package/src/routing/middleware/middleware.ts +3 -3
- package/src/routing.ts +14 -16
- package/src/test.ts +2 -2
- package/src/vitest.ts +1 -1
- package/tsconfig.json +1 -0
package/src/routing.ts
CHANGED
|
@@ -18,10 +18,10 @@ import * as Ref from "effect/Ref"
|
|
|
18
18
|
import type * as Scope from "effect/Scope"
|
|
19
19
|
import * as Stream from "effect/Stream"
|
|
20
20
|
import { Rpc, RpcGroup, type RpcSerialization, RpcServer } from "effect/unstable/rpc"
|
|
21
|
-
import { type LayerUtils } from "./layerUtils.
|
|
22
|
-
import { RequestType as RequestTypeAnnotation } from "./routing/middleware.
|
|
21
|
+
import { type LayerUtils } from "./layerUtils.ts"
|
|
22
|
+
import { RequestType as RequestTypeAnnotation } from "./routing/middleware.ts"
|
|
23
23
|
|
|
24
|
-
export * from "./routing/middleware.
|
|
24
|
+
export * from "./routing/middleware.ts"
|
|
25
25
|
|
|
26
26
|
export const applyRequestTypeInterruptibility = <A, E, R>(
|
|
27
27
|
requestType: "command" | "query",
|
|
@@ -61,12 +61,10 @@ export interface AddAction<Actions extends AnyRequestModule, Accum extends Recor
|
|
|
61
61
|
// note:
|
|
62
62
|
// "d" stands for decoded i.e. the Type
|
|
63
63
|
// "raw" stands for encoded i.e. the Encoded
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export type RAW = typeof RAW
|
|
69
|
-
}
|
|
64
|
+
const RequestTypes = {
|
|
65
|
+
DECODED: "d",
|
|
66
|
+
RAW: "raw"
|
|
67
|
+
} as const
|
|
70
68
|
type RequestType = typeof RequestTypes[keyof typeof RequestTypes]
|
|
71
69
|
|
|
72
70
|
type GetSuccess<T> = T extends { success: S.Top } ? T["success"] : typeof S.Void
|
|
@@ -168,7 +166,7 @@ export type RouteMatcher<
|
|
|
168
166
|
* Requires the Type shape
|
|
169
167
|
*/
|
|
170
168
|
[Key in keyof FilterRequestModules<Resource>]:
|
|
171
|
-
& Match<Resource, RequestContextMap, RequestTypes.DECODED, Key>
|
|
169
|
+
& Match<Resource, RequestContextMap, typeof RequestTypes.DECODED, Key>
|
|
172
170
|
& {
|
|
173
171
|
success: Resource[Key]["success"]
|
|
174
172
|
successRaw: S.Codec<Resource[Key]["success"]["Encoded"]>
|
|
@@ -176,7 +174,7 @@ export type RouteMatcher<
|
|
|
176
174
|
/**
|
|
177
175
|
* Requires the Encoded shape (e.g directly undecoded from DB, so that we don't do multiple Decode/Encode)
|
|
178
176
|
*/
|
|
179
|
-
raw: Match<Resource, RequestContextMap, RequestTypes.RAW, Key>
|
|
177
|
+
raw: Match<Resource, RequestContextMap, typeof RequestTypes.RAW, Key>
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
180
|
|
|
@@ -308,13 +306,13 @@ export const makeRouter = <Live extends Layer.Layer<any, any, any> = Layer.Layer
|
|
|
308
306
|
? HandlerWithInputStream<Action, RT>
|
|
309
307
|
: HandlerWithInputGen<Action, RT> | HandlerWithInputEff<Action, RT>
|
|
310
308
|
|
|
311
|
-
type HandlersDecoded<Action extends AnyRequestModule> = Handlers<Action, RequestTypes.DECODED>
|
|
309
|
+
type HandlersDecoded<Action extends AnyRequestModule> = Handlers<Action, typeof RequestTypes.DECODED>
|
|
312
310
|
|
|
313
311
|
type HandlersRaw<Action extends AnyRequestModule> = Action extends { stream: true }
|
|
314
|
-
? { raw: HandlerWithInputStream<Action, RequestTypes.RAW> }
|
|
312
|
+
? { raw: HandlerWithInputStream<Action, typeof RequestTypes.RAW> }
|
|
315
313
|
:
|
|
316
|
-
| { raw: HandlerWithInputGen<Action, RequestTypes.RAW> }
|
|
317
|
-
| { raw: HandlerWithInputEff<Action, RequestTypes.RAW> }
|
|
314
|
+
| { raw: HandlerWithInputGen<Action, typeof RequestTypes.RAW> }
|
|
315
|
+
| { raw: HandlerWithInputEff<Action, typeof RequestTypes.RAW> }
|
|
318
316
|
|
|
319
317
|
type AnyHandlers<Action extends AnyRequestModule> = HandlersRaw<Action> | HandlersDecoded<Action>
|
|
320
318
|
|
|
@@ -374,7 +372,7 @@ export const makeRouter = <Live extends Layer.Layer<any, any, any> = Layer.Layer
|
|
|
374
372
|
) => {
|
|
375
373
|
[K in keyof Impl & keyof FilterRequestModules<Resource>]: Handler<
|
|
376
374
|
FilterRequestModules<Resource>[K],
|
|
377
|
-
Impl[K] extends { raw: any } ? RequestTypes.RAW : RequestTypes.DECODED,
|
|
375
|
+
Impl[K] extends { raw: any } ? typeof RequestTypes.RAW : typeof RequestTypes.DECODED,
|
|
378
376
|
Exclude<
|
|
379
377
|
Exclude<
|
|
380
378
|
// retrieves context R from the actual implementation of the handler
|
package/src/test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as S from "effect-app/Schema"
|
|
2
2
|
import { copy } from "effect-app/utils"
|
|
3
|
-
import { generate } from "./arbs.
|
|
3
|
+
import { generate } from "./arbs.ts"
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Given the schema for an object-like structure, creates a function that generates random instances of that object with some values provided.
|
|
@@ -27,4 +27,4 @@ export const createRandomInstanceI = <A extends object, I>(s: S.Codec<A, I> & {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export * from "./arbs.
|
|
30
|
+
export * from "./arbs.ts"
|
package/src/vitest.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "@effect/vitest"
|
|
2
|
-
export * from "./test.
|
|
2
|
+
export * from "./test.ts"
|
package/tsconfig.json
CHANGED