@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/Store/Memory.d.ts +2 -3
  3. package/dist/Store/Memory.d.ts.map +1 -1
  4. package/dist/Store/Memory.js +3 -6
  5. package/dist/Store/codeFilter.d.ts +1 -1
  6. package/dist/Store/codeFilter.d.ts.map +1 -1
  7. package/dist/Store/codeFilter.js +2 -3
  8. package/dist/Store/index.js +1 -1
  9. package/dist/Store/utils.d.ts +3 -1
  10. package/dist/Store/utils.d.ts.map +1 -1
  11. package/dist/Store/utils.js +5 -1
  12. package/dist/routing/middleware.d.ts +2 -2
  13. package/dist/routing.d.ts +9 -11
  14. package/dist/routing.d.ts.map +1 -1
  15. package/dist/routing.js +5 -6
  16. package/package.json +3 -3
  17. package/src/CUPS.ts +1 -1
  18. package/src/ClusterCosmos.ts +2 -2
  19. package/src/ContextProvider.ts +1 -1
  20. package/src/Emailer/Sendgrid.ts +1 -1
  21. package/src/Emailer/fake.ts +1 -1
  22. package/src/MainFiberSet.ts +3 -3
  23. package/src/QueueMaker/SQLQueue.ts +3 -3
  24. package/src/QueueMaker/memQueue.ts +4 -4
  25. package/src/QueueMaker/sbqueue.ts +4 -4
  26. package/src/RequestFiberSet.ts +2 -2
  27. package/src/SQL/Model.ts +1 -1
  28. package/src/SQL.ts +1 -1
  29. package/src/ServiceBus.ts +1 -1
  30. package/src/Store/Cosmos/query.ts +2 -2
  31. package/src/Store/Cosmos.ts +5 -5
  32. package/src/Store/Disk.ts +3 -3
  33. package/src/Store/Memory.ts +5 -8
  34. package/src/Store/SQL/Pg.ts +5 -5
  35. package/src/Store/SQL/query.ts +2 -2
  36. package/src/Store/SQL.ts +5 -5
  37. package/src/Store/codeFilter.ts +1 -2
  38. package/src/Store/index.test.ts.bak +2 -2
  39. package/src/Store/index.ts +6 -6
  40. package/src/Store/utils.ts +6 -1
  41. package/src/WorkflowEngineCosmos.ts +3 -3
  42. package/src/WorkflowEngineSqlite.ts +2 -2
  43. package/src/errorReporter.ts +2 -2
  44. package/src/index.ts +2 -2
  45. package/src/internal/events.ts +1 -1
  46. package/src/layerUtils.ts +1 -1
  47. package/src/logger/jsonLogger.ts +1 -1
  48. package/src/logger/logFmtLogger.ts +1 -1
  49. package/src/middlewares.ts +4 -4
  50. package/src/reportError.ts +1 -1
  51. package/src/routing/middleware/middleware.ts +3 -3
  52. package/src/routing.ts +14 -16
  53. package/src/test.ts +2 -2
  54. package/src/vitest.ts +1 -1
  55. 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.js"
22
- import { RequestType as RequestTypeAnnotation } from "./routing/middleware.js"
21
+ import { type LayerUtils } from "./layerUtils.ts"
22
+ import { RequestType as RequestTypeAnnotation } from "./routing/middleware.ts"
23
23
 
24
- export * from "./routing/middleware.js"
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
- namespace RequestTypes {
65
- export const DECODED = "d" as const
66
- export type DECODED = typeof DECODED
67
- export const RAW = "raw" as const
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.js"
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.js"
30
+ export * from "./arbs.ts"
package/src/vitest.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "@effect/vitest"
2
- export * from "./test.js"
2
+ export * from "./test.ts"
package/tsconfig.json CHANGED
@@ -34,6 +34,7 @@
34
34
  "moduleResolution": "Node16",
35
35
  "noErrorTruncation": true,
36
36
  "forceConsistentCasingInFileNames": true,
37
+ "erasableSyntaxOnly": true,
37
38
  "rewriteRelativeImportExtensions": true,
38
39
  "allowImportingTsExtensions": true,
39
40
  "types": [