@effect-app/infra 2.79.0 → 2.81.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/api/internal/auth.d.ts +2 -2
  3. package/dist/api/internal/auth.d.ts.map +1 -1
  4. package/dist/api/internal/auth.js +5 -5
  5. package/dist/api/routing/middleware/ContextProvider.d.ts +1 -3
  6. package/dist/api/routing/middleware/ContextProvider.d.ts.map +1 -1
  7. package/dist/api/routing/middleware/ContextProvider.js +1 -1
  8. package/dist/api/routing/middleware/DynamicMiddleware.d.ts +135 -12
  9. package/dist/api/routing/middleware/DynamicMiddleware.d.ts.map +1 -1
  10. package/dist/api/routing/middleware/DynamicMiddleware.js +78 -7
  11. package/dist/api/routing/middleware/dynamic-middleware.d.ts +8 -9
  12. package/dist/api/routing/middleware/dynamic-middleware.d.ts.map +1 -1
  13. package/dist/api/routing/middleware/dynamic-middleware.js +3 -3
  14. package/dist/api/routing/middleware/generic-middleware.d.ts +8 -3
  15. package/dist/api/routing/middleware/generic-middleware.d.ts.map +1 -1
  16. package/dist/api/routing/middleware/generic-middleware.js +1 -1
  17. package/dist/api/routing/middleware/middleware-api.d.ts +17 -0
  18. package/dist/api/routing/middleware/middleware-api.d.ts.map +1 -0
  19. package/dist/api/routing/middleware/middleware-api.js +19 -0
  20. package/dist/api/routing/middleware/middleware.d.ts +3 -3
  21. package/dist/api/routing/middleware.d.ts +1 -0
  22. package/dist/api/routing/middleware.d.ts.map +1 -1
  23. package/dist/api/routing/middleware.js +2 -1
  24. package/dist/api/routing.d.ts +7 -7
  25. package/dist/api/routing.d.ts.map +1 -1
  26. package/dist/api/routing.js +1 -1
  27. package/package.json +5 -1
  28. package/src/api/internal/auth.ts +4 -5
  29. package/src/api/routing/middleware/ContextProvider.ts +8 -7
  30. package/src/api/routing/middleware/DynamicMiddleware.ts +309 -28
  31. package/src/api/routing/middleware/dynamic-middleware.ts +12 -23
  32. package/src/api/routing/middleware/generic-middleware.ts +8 -3
  33. package/src/api/routing/middleware/middleware-api.ts +44 -0
  34. package/src/api/routing/middleware.ts +1 -0
  35. package/src/api/routing.ts +5 -5
  36. package/test/{dynamicContext.test.ts → contextProvider.test.ts} +5 -6
  37. package/test/controller.test.ts +39 -30
  38. package/test/dist/contextProvider.test.d.ts.map +1 -0
  39. package/test/dist/controller.test.d.ts.map +1 -1
  40. package/test/dist/middleware-api.test.d.ts.map +1 -0
@@ -4,7 +4,7 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  import { determineMethod, isCommand } from "@effect-app/infra/api/routing/utils"
6
6
  import { Rpc, RpcGroup, RpcServer } from "@effect/rpc"
7
- import { type Array, Duration, Effect, Layer, type NonEmptyReadonlyArray, Predicate, Request, S, Schedule, Schema } from "effect-app"
7
+ import { type Array, Duration, Effect, Layer, type NonEmptyReadonlyArray, Predicate, Request, S, Schedule, Schema, type Scope } from "effect-app"
8
8
  import type { GetEffectContext, GetEffectError, RPCContextMap } from "effect-app/client/req"
9
9
  import { type HttpHeaders, HttpRouter } from "effect-app/http"
10
10
  import { typedKeysOf, typedValuesOf } from "effect-app/utils"
@@ -123,7 +123,7 @@ type Match<
123
123
  RT,
124
124
  Exclude<
125
125
  Exclude<R2, GetEffectContext<RequestContextMap, Resource[Key]["config"]>>,
126
- HttpRouter.HttpRouter.Provided
126
+ Scope.Scope
127
127
  >
128
128
  >
129
129
 
@@ -134,7 +134,7 @@ type Match<
134
134
  RT,
135
135
  Exclude<
136
136
  Exclude<R2, GetEffectContext<RequestContextMap, Resource[Key]["config"]>>,
137
- HttpRouter.HttpRouter.Provided
137
+ Scope.Scope
138
138
  >
139
139
  >
140
140
  }
@@ -340,7 +340,7 @@ export const makeRouter = <
340
340
  | GetEffectContext<RequestContextMap, Resource[K]["config"]>
341
341
  | ContextProviderA
342
342
  >,
343
- HttpRouter.HttpRouter.Provided
343
+ Scope.Scope
344
344
  >
345
345
  >
346
346
  } = (impl: Record<keyof RequestModules, any>) =>
@@ -751,7 +751,7 @@ export const makeRouter = <
751
751
  // RPCRouteR<
752
752
  // { [K in keyof Filter<Resource>]: Rpc.Rpc<Resource[K], Effect.Context<ReturnType<THandlers[K]["handler"]>>> }[keyof Filter<Resource>]
753
753
  // >,
754
- // HttpRouter.HttpRouter.Provided
754
+ // Scope.Scope
755
755
  // >
756
756
  routes: any
757
757
 
@@ -1,8 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
3
  import { expectTypeOf } from "@effect/vitest"
4
- import { Context, Effect } from "effect-app"
5
- import { HttpServerRequest } from "effect-app/http"
4
+ import { Context, Effect, Scope } from "effect-app"
6
5
  import { ContextProvider, mergeContextProviders, MergedContextProvider } from "../src/api/routing.js"
7
6
  import { CustomError1, Some, SomeElse } from "./controller.test.js"
8
7
  import { SomeService } from "./query.test.js"
@@ -15,7 +14,7 @@ class MyContextProvider extends Effect.Service<MyContextProvider>()("MyContextPr
15
14
 
16
15
  return Effect.gen(function*() {
17
16
  // the only requirements you can have are the one provided by HttpRouter.HttpRouter.Provided
18
- yield* HttpServerRequest.HttpServerRequest
17
+ yield* Scope.Scope
19
18
 
20
19
  yield* Effect.logInfo("MyContextProviderGen", "this is a generator")
21
20
  yield* Effect.succeed("this is a generator")
@@ -66,7 +65,7 @@ class MyContextProviderGen extends Effect.Service<MyContextProviderGen>()("MyCon
66
65
 
67
66
  return function*() {
68
67
  // the only requirements you can have are the one provided by HttpRouter.HttpRouter.Provided
69
- yield* HttpServerRequest.HttpServerRequest
68
+ yield* Scope.Scope
70
69
 
71
70
  yield* Effect.logInfo("MyContextProviderGen", "this is a generator")
72
71
  yield* Effect.succeed("this is a generator")
@@ -90,7 +89,7 @@ export const someContextProvider = ContextProvider({
90
89
 
91
90
  return Effect.gen(function*() {
92
91
  // the only requirements you can have are the one provided by HttpRouter.HttpRouter.Provided
93
- yield* HttpServerRequest.HttpServerRequest
92
+ yield* Scope.Scope
94
93
 
95
94
  // not allowed
96
95
  // yield* SomeElse
@@ -109,7 +108,7 @@ export const someContextProviderGen = ContextProvider({
109
108
 
110
109
  return function*() {
111
110
  // the only requirements you can have are the one provided by HttpRouter.HttpRouter.Provided
112
- yield* HttpServerRequest.HttpServerRequest
111
+ yield* Scope.Scope
113
112
 
114
113
  // not allowed
115
114
  // yield* SomeElse
@@ -3,15 +3,14 @@
3
3
  import { type MakeContext, type MakeErrors, makeRouter } from "@effect-app/infra/api/routing"
4
4
  import type { RequestContext } from "@effect-app/infra/RequestContext"
5
5
  import { expect, expectTypeOf, it } from "@effect/vitest"
6
- import { type Array, Context, Effect, Layer, Option, S } from "effect-app"
6
+ import { type Array, Context, Effect, Layer, Option, S, Scope } from "effect-app"
7
7
  import { InvalidStateError, makeRpcClient, type RPCContextMap, UnauthorizedError } from "effect-app/client"
8
- import { HttpServerRequest } from "effect-app/http"
9
8
  import { Class, TaggedError } from "effect-app/Schema"
10
- import { DefaultGenericMiddlewares, implementMiddleware, makeMiddleware, Middleware, Tag } from "../src/api/routing/middleware.js"
9
+ import { contextMap, DefaultGenericMiddlewares, implementMiddleware, makeMiddleware, makeNewMiddleware, Middleware, Tag } from "../src/api/routing/middleware.js"
11
10
  import { sort } from "../src/api/routing/tsort.js"
12
11
  import { SomeService } from "./query.test.js"
13
12
 
14
- class UserProfile extends Context.assignTag<UserProfile, UserProfile>("UserProfile")(
13
+ export class UserProfile extends Context.assignTag<UserProfile, UserProfile>("UserProfile")(
15
14
  Class<UserProfile>("UserProfile")({
16
15
  id: S.String,
17
16
  roles: S.Array(S.String)
@@ -19,7 +18,7 @@ class UserProfile extends Context.assignTag<UserProfile, UserProfile>("UserProfi
19
18
  ) {
20
19
  }
21
20
 
22
- class NotLoggedInError extends TaggedError<NotLoggedInError>()("NotLoggedInError", {
21
+ export class NotLoggedInError extends TaggedError<NotLoggedInError>()("NotLoggedInError", {
23
22
  message: S.String
24
23
  }) {}
25
24
 
@@ -41,7 +40,7 @@ class MyContextProvider extends Middleware.Tag<MyContextProvider>()("MyContextPr
41
40
 
42
41
  return Effect.fnUntraced(function*() {
43
42
  // the only requirements you can have are the one provided by HttpRouter.HttpRouter.Provided
44
- yield* HttpServerRequest.HttpServerRequest
43
+ yield* Scope.Scope
45
44
 
46
45
  yield* Effect.logInfo("MyContextProviderGen", "this is a generator")
47
46
  yield* Effect.succeed("this is a generator")
@@ -82,14 +81,16 @@ export type RequestContextMap = {
82
81
  const Str = Context.GenericTag<"str", "str">("str")
83
82
  const Str2 = Context.GenericTag<"str2", "str">("str2")
84
83
 
85
- class AllowAnonymous extends Effect.Service<AllowAnonymous>()("AllowAnonymous", {
84
+ class AllowAnonymous extends Middleware.Tag<AllowAnonymous>()("AllowAnonymous", {
85
+ dynamic: contextMap<RequestContextMap>()("allowAnonymous")
86
+ })({
86
87
  effect: Effect.gen(function*() {
87
- return {
88
- handle: Effect.fn(function*(opts: { allowAnonymous?: false }, headers: Record<string, string>) {
89
- yield* HttpServerRequest.HttpServerRequest // provided by HttpRouter.HttpRouter.Provided
90
- const isLoggedIn = !!headers["x-user"]
88
+ return Effect.fnUntraced(
89
+ function*(options) {
90
+ yield* Scope.Scope // provided by HttpRouter.HttpRouter.Provided
91
+ const isLoggedIn = !!options.headers["x-user"]
91
92
  if (!isLoggedIn) {
92
- if (!opts.allowAnonymous) {
93
+ if (!options.config.allowAnonymous) {
93
94
  return yield* new NotLoggedInError({ message: "Not logged in" })
94
95
  }
95
96
  return Option.none()
@@ -98,40 +99,38 @@ class AllowAnonymous extends Effect.Service<AllowAnonymous>()("AllowAnonymous",
98
99
  UserProfile,
99
100
  { id: "whatever", roles: ["user", "manager"] }
100
101
  ))
101
- })
102
- }
102
+ }
103
+ )
103
104
  })
104
105
  }) {}
105
106
 
106
107
  // @effect-diagnostics-next-line missingEffectServiceDependency:off
107
- class RequireRoles extends Effect.Service<RequireRoles>()("RequireRoles", {
108
- effect: Effect.gen(function*() {
109
- yield* Some
110
- return {
111
- handle: Effect.fn(
112
- function*(cfg: { requireRoles?: readonly string[] }, _headers: Record<string, string>) {
108
+ class RequireRoles
109
+ extends Middleware.Tag<RequireRoles>()("RequireRoles", { dynamic: contextMap<RequestContextMap>()("requireRoles") })({
110
+ effect: Effect.gen(function*() {
111
+ yield* Some
112
+ return Effect.fnUntraced(
113
+ function*(options) {
113
114
  // we don't know if the service will be provided or not, so we use option..
114
115
  const userProfile = yield* Effect.serviceOption(UserProfile)
115
- const { requireRoles } = cfg
116
+ const { requireRoles } = options.config
116
117
  if (requireRoles && !userProfile.value?.roles?.some((role) => requireRoles.includes(role))) {
117
118
  return yield* new UnauthorizedError({ message: "don't have the right roles" })
118
119
  }
119
120
  return Option.none<Context<never>>()
120
121
  }
121
122
  )
122
- }
123
+ })
123
124
  })
124
- }) {
125
+ {
125
126
  static dependsOn = [AllowAnonymous]
126
127
  }
127
128
 
128
- class Test extends Effect.Service<Test>()("Test", {
129
+ class Test extends Middleware.Tag<Test>()("Test", { dynamic: contextMap<RequestContextMap>()("test") })({
129
130
  effect: Effect.gen(function*() {
130
- return {
131
- handle: Effect.fn(function*(_cfg, _headers) {
132
- return Option.none<Context<never>>()
133
- })
134
- }
131
+ return Effect.fn(function*(_options) {
132
+ return Option.none<Context<never>>()
133
+ })
135
134
  })
136
135
  }) {}
137
136
 
@@ -177,7 +176,7 @@ const middleware = makeMiddleware<RequestContextMap>()({
177
176
  // and what ContextProvider provides too
178
177
  // const someElse = yield* SomeElse
179
178
  yield* Some // provided by ContextProvider
180
- yield* HttpServerRequest.HttpServerRequest // provided by HttpRouter.HttpRouter.Provided
179
+ yield* Scope.Scope // provided by HttpRouter.HttpRouter.Provided
181
180
 
182
181
  return yield* handler(req, headers)
183
182
  })
@@ -196,6 +195,16 @@ const middleware2 = makeMiddleware<RequestContextMap>()({
196
195
  }
197
196
  })
198
197
 
198
+ export const middleware3 = makeNewMiddleware<RequestContextMap>()(
199
+ ...genericMiddlewares
200
+ )
201
+ .addDynamicMiddleware(AllowAnonymous)
202
+ .addDynamicMiddleware(Test)
203
+ .addDynamicMiddleware(RequireRoles)
204
+ .make()
205
+
206
+ expectTypeOf(middleware3).toEqualTypeOf<typeof middleware2>()
207
+
199
208
  export type RequestConfig = {
200
209
  /** Disable authentication requirement */
201
210
  allowAnonymous?: true
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextProvider.test.d.ts","sourceRoot":"","sources":["../contextProvider.test.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEnD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AA8E7C,eAAO,MAAM,mBAAmB;;CAkB9B,CAAA;AACF,eAAO,MAAM,sBAAsB;;CAkBjC,CAAA;AAMF,eAAO,MAAM,gBAAgB;;CAA0B,CAAA;AACvD,eAAO,MAAM,gBAAgB,kMAA2C,CAAA;AAIxE,eAAO,MAAM,mBAAmB;;CAA6B,CAAA;AAC7D,eAAO,MAAM,mBAAmB,kMAA8C,CAAA;AAQ9E,eAAO,MAAM,iBAAiB;;CAA2B,CAAA;AACzD,eAAO,MAAM,iBAAiB,6MAA+D,CAAA;AAI7F,eAAO,MAAM,oBAAoB;;CAA8B,CAAA;AAC/D,eAAO,MAAM,oBAAoB,6MAAqE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"controller.test.d.ts","sourceRoot":"","sources":["../controller.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAc,MAAM,+BAA+B,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEtE,OAAO,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,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