effect-app 4.0.0-beta.53 → 4.0.0-beta.55
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 +8 -0
- package/dist/{ServiceMap.d.ts → Context.d.ts} +6 -9
- package/dist/Context.d.ts.map +1 -0
- package/dist/Context.js +87 -0
- package/dist/Effect.d.ts +8 -7
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1 -1
- package/dist/Layer.d.ts +5 -4
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +1 -1
- package/dist/Pure.d.ts +2 -2
- package/dist/Pure.d.ts.map +1 -1
- package/dist/Pure.js +3 -3
- package/dist/Schema/ext.d.ts +4 -3
- package/dist/Schema/ext.d.ts.map +1 -1
- package/dist/Schema/ext.js +4 -3
- package/dist/client/apiClientFactory.d.ts +2 -2
- package/dist/client/apiClientFactory.d.ts.map +1 -1
- package/dist/client/apiClientFactory.js +5 -5
- package/dist/client/errors.d.ts.map +1 -1
- package/dist/client/errors.js +2 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -8
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +3 -3
- package/dist/rpc/MiddlewareMaker.d.ts +4 -3
- package/dist/rpc/MiddlewareMaker.d.ts.map +1 -1
- package/dist/rpc/MiddlewareMaker.js +6 -5
- package/dist/rpc/RpcContextMap.d.ts +2 -2
- package/dist/rpc/RpcContextMap.d.ts.map +1 -1
- package/dist/rpc/RpcContextMap.js +4 -4
- package/dist/rpc/RpcMiddleware.d.ts +4 -3
- package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/rpc/RpcMiddleware.js +1 -1
- package/dist/utils/gen.d.ts +1 -1
- package/dist/utils/gen.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +2 -2
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +3 -3
- package/package.json +5 -5
- package/src/{ServiceMap.ts → Context.ts} +10 -12
- package/src/Effect.ts +8 -7
- package/src/Layer.ts +5 -4
- package/src/Pure.ts +5 -5
- package/src/Schema/ext.ts +8 -7
- package/src/client/apiClientFactory.ts +4 -4
- package/src/client/errors.ts +1 -0
- package/src/client/makeClient.ts +1 -1
- package/src/index.ts +4 -8
- package/src/middleware.ts +2 -2
- package/src/rpc/MiddlewareMaker.ts +7 -6
- package/src/rpc/RpcContextMap.ts +6 -5
- package/src/rpc/RpcMiddleware.ts +5 -4
- package/src/utils/gen.ts +1 -1
- package/src/utils/logger.ts +2 -2
- package/dist/ServiceMap.d.ts.map +0 -1
- package/dist/ServiceMap.js +0 -91
package/dist/utils/logger.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
import { Effect } from "effect";
|
|
4
|
-
import * as
|
|
5
|
-
export class LogLevels extends
|
|
4
|
+
import * as Context from "../Context.js";
|
|
5
|
+
export class LogLevels extends Context.Reference("LogLevels", {
|
|
6
6
|
defaultValue: () => new Map()
|
|
7
7
|
}) {
|
|
8
8
|
}
|
|
@@ -21,4 +21,4 @@ export const makeLog = (namespace, defaultLevel = "warn") => {
|
|
|
21
21
|
logWithLevel: (level, ...message) => Effect.logWithLevel(level)(...message).pipe(withLogNamespace)
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL2xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwwREFBMEQ7QUFDMUQsdURBQXVEO0FBRXZELE9BQU8s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yxDQUFDLENBQUMsR0FBRyxPQUFPLENBQUMsQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUM7S0FDaEUsQ0FBQTtBQUNILENBQUMsQ0FBQSJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-app",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.55",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
"types": "./dist/ConfigProvider.d.ts",
|
|
60
60
|
"default": "./dist/ConfigProvider.js"
|
|
61
61
|
},
|
|
62
|
+
"./Context": {
|
|
63
|
+
"types": "./dist/Context.d.ts",
|
|
64
|
+
"default": "./dist/Context.js"
|
|
65
|
+
},
|
|
62
66
|
"./Effect": {
|
|
63
67
|
"types": "./dist/Effect.d.ts",
|
|
64
68
|
"default": "./dist/Effect.js"
|
|
@@ -147,10 +151,6 @@
|
|
|
147
151
|
"types": "./dist/Schema/strings.d.ts",
|
|
148
152
|
"default": "./dist/Schema/strings.js"
|
|
149
153
|
},
|
|
150
|
-
"./ServiceMap": {
|
|
151
|
-
"types": "./dist/ServiceMap.d.ts",
|
|
152
|
-
"default": "./dist/ServiceMap.js"
|
|
153
|
-
},
|
|
154
154
|
"./Set": {
|
|
155
155
|
"types": "./dist/Set.d.ts",
|
|
156
156
|
"default": "./dist/Set.js"
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
/**
|
|
3
|
-
* We're doing the long way around here with assignTag, TagBase & TagBaseTagged,
|
|
4
|
-
* because there's a typescript compiler issue where it will complain about Equal.symbol, and Hash.symbol not being accessible.
|
|
5
|
-
* https://github.com/microsoft/TypeScript/issues/52644
|
|
6
|
-
*/
|
|
7
2
|
|
|
8
3
|
import { type Effect, Layer, type Scope, type Types } from "effect"
|
|
9
|
-
import * as
|
|
4
|
+
import * as SM from "effect/ServiceMap"
|
|
10
5
|
import { type Yieldable } from "./Effect.js"
|
|
11
6
|
|
|
12
7
|
export * from "effect/ServiceMap"
|
|
13
8
|
|
|
9
|
+
export { type ServiceMap as Context } from "effect/ServiceMap"
|
|
10
|
+
export { isServiceMap as isContext } from "effect/ServiceMap"
|
|
11
|
+
|
|
14
12
|
export interface Opaque<Self extends object, in out Shape extends object>
|
|
15
|
-
extends
|
|
13
|
+
extends SM.Key<Self, Self>, Yieldable<Opaque<Self, Shape>, Self, never, Self>
|
|
16
14
|
{
|
|
17
15
|
of(this: void, self: Shape): Self
|
|
18
|
-
serviceMap(self: Shape):
|
|
16
|
+
serviceMap(self: Shape): SM.ServiceMap<Self>
|
|
19
17
|
// a version that leverages the Shape -> Self conversion
|
|
20
18
|
toLayer: <E, R>(
|
|
21
19
|
eff: Effect.Effect<Shape, E, R>
|
|
@@ -25,11 +23,11 @@ export interface Opaque<Self extends object, in out Shape extends object>
|
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
// export interface OpaqueMake<Self extends object, in out Shape extends object, E, R>
|
|
28
|
-
// extends
|
|
26
|
+
// extends SM.Service<Self, Self>
|
|
29
27
|
// {
|
|
30
28
|
// // temp while sorting out https://github.com/Effect-TS/effect-smol/pull/1534
|
|
31
29
|
// of(self: Shape): Self
|
|
32
|
-
// serviceMap2(self: Shape):
|
|
30
|
+
// serviceMap2(self: Shape): SM.ServiceMap<Self>
|
|
33
31
|
// // a version that leverages the Shape -> Self conversion
|
|
34
32
|
// toLayer: {
|
|
35
33
|
// <E, R>(
|
|
@@ -44,7 +42,7 @@ export function assignTag<Identifier extends object, Shape extends object = Iden
|
|
|
44
42
|
creationError?: Error
|
|
45
43
|
) {
|
|
46
44
|
return <S extends object>(cls: S): S & Opaque<Identifier, Shape> => {
|
|
47
|
-
const tag =
|
|
45
|
+
const tag = SM.Service<Identifier, Shape>(key)
|
|
48
46
|
let fields = tag
|
|
49
47
|
if (Reflect.ownKeys(cls).includes("key")) {
|
|
50
48
|
const { key, ...rest } = tag
|
|
@@ -179,7 +177,7 @@ export const Opaque: {
|
|
|
179
177
|
>
|
|
180
178
|
& { readonly make: Make }
|
|
181
179
|
} = () => (id: string, options: any) => {
|
|
182
|
-
const svc =
|
|
180
|
+
const svc = SM.Service()(id, options) as any
|
|
183
181
|
return Object.assign(svc, {
|
|
184
182
|
toLayer: (eff: Effect.Effect<any, any, any>) => {
|
|
185
183
|
return Layer.effect(svc, eff)
|
package/src/Effect.ts
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
/* eslint-disable prefer-destructuring */
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
4
|
|
|
5
|
-
import { Effect, Option, Ref
|
|
5
|
+
import { Effect, Option, Ref } from "effect"
|
|
6
6
|
import * as Def from "effect/Deferred"
|
|
7
7
|
import * as Fiber from "effect/Fiber"
|
|
8
8
|
import type { Scope } from "effect/Scope"
|
|
9
9
|
import type { Semaphore } from "effect/Semaphore"
|
|
10
|
+
import type * as Context from "./Context.js"
|
|
10
11
|
import { curry } from "./Function.js"
|
|
11
12
|
import { typedKeysOf } from "./utils.js"
|
|
12
13
|
|
|
@@ -116,10 +117,10 @@ export function joinAll<E, A>(fibers: Iterable<Fiber.Fiber<A, E>>): Effect.Effec
|
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
type ServiceA<T> = T extends Effect.Effect<infer S, any, any> ? S
|
|
119
|
-
: T extends
|
|
120
|
+
: T extends Context.Service<any, infer S> ? S
|
|
120
121
|
: never
|
|
121
122
|
type ServiceR<T> = T extends Effect.Effect<any, any, infer R> ? R
|
|
122
|
-
: T extends
|
|
123
|
+
: T extends Context.Service<infer I, any> ? I
|
|
123
124
|
: never
|
|
124
125
|
type ServiceE<T> = T extends Effect.Effect<any, infer E, any> ? E : never
|
|
125
126
|
// type Values<T> = T extends { [s: string]: infer S } ? ServiceA<S> : never
|
|
@@ -144,11 +145,11 @@ export interface EffectUnunified<R, E, A> extends Effect.Effect<R, E, A> {}
|
|
|
144
145
|
|
|
145
146
|
export type LowerFirst<S extends PropertyKey> = S extends `${infer First}${infer Rest}` ? `${Lowercase<First>}${Rest}`
|
|
146
147
|
: S
|
|
147
|
-
export type LowerServices<T extends Record<string,
|
|
148
|
+
export type LowerServices<T extends Record<string, Context.Service<any, any> | Effect.Effect<any, any, any>>> = {
|
|
148
149
|
[key in keyof T as LowerFirst<key>]: ServiceA<T[key]>
|
|
149
150
|
}
|
|
150
151
|
|
|
151
|
-
export function allLower<T extends Record<string,
|
|
152
|
+
export function allLower<T extends Record<string, Context.Service<any, any> | Effect.Effect<any, any, any>>>(
|
|
152
153
|
services: T
|
|
153
154
|
) {
|
|
154
155
|
return Effect.all(
|
|
@@ -162,7 +163,7 @@ export function allLower<T extends Record<string, ServiceMap.Service<any, any> |
|
|
|
162
163
|
) as any as Effect.Effect<LowerServices<T>, ValuesE<T>, ValuesR<T>>
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
export function allLowerWith<T extends Record<string,
|
|
166
|
+
export function allLowerWith<T extends Record<string, Context.Service<any, any> | Effect.Effect<any, any, any>>, A>(
|
|
166
167
|
services: T,
|
|
167
168
|
fn: (services: LowerServices<T>) => A
|
|
168
169
|
) {
|
|
@@ -170,7 +171,7 @@ export function allLowerWith<T extends Record<string, ServiceMap.Service<any, an
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
export function allLowerWithEffect<
|
|
173
|
-
T extends Record<string,
|
|
174
|
+
T extends Record<string, Context.Service<any, any> | Effect.Effect<any, any, any>>,
|
|
174
175
|
R,
|
|
175
176
|
E,
|
|
176
177
|
A
|
package/src/Layer.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type Array, Effect, Layer, type Scope, type
|
|
1
|
+
import { type Array, Effect, Layer, type Scope, type Types } from "effect"
|
|
2
2
|
import { type Yieldable } from "effect/Effect"
|
|
3
3
|
import { dual } from "effect/Function"
|
|
4
|
+
import type * as Context from "./Context.js"
|
|
4
5
|
import { type EffectGenUtils } from "./utils/gen.js"
|
|
5
6
|
|
|
6
7
|
export * from "effect/Layer"
|
|
@@ -17,7 +18,7 @@ type MakeGenNo<S> = {
|
|
|
17
18
|
readonly make: () => Generator<unknown, S>
|
|
18
19
|
}
|
|
19
20
|
type MakeErr<Opts> = Opts extends { make: () => any } ? EffectGenUtils.Error<Opts["make"]> : never
|
|
20
|
-
type MakeContext<Opts> = Opts extends { make: () => any } ? EffectGenUtils.
|
|
21
|
+
type MakeContext<Opts> = Opts extends { make: () => any } ? EffectGenUtils.Context<Opts["make"]> : never
|
|
21
22
|
|
|
22
23
|
type DependenciesOpt = { dependencies?: Array.NonEmptyReadonlyArray<Layer.Any> }
|
|
23
24
|
type Dependencies = { dependencies: Array.NonEmptyReadonlyArray<Layer.Any> }
|
|
@@ -41,12 +42,12 @@ type PackedOrUnpackedLayer<I, Opts> = Opts extends Dependencies ? PackedLayers<I
|
|
|
41
42
|
|
|
42
43
|
export const make: {
|
|
43
44
|
<I, S>(
|
|
44
|
-
tag:
|
|
45
|
+
tag: Context.Service<I, S>
|
|
45
46
|
): <Opts extends Make<Types.NoInfer<S>, any, any>>(
|
|
46
47
|
options: Opts
|
|
47
48
|
) => PackedOrUnpackedLayer<I, Opts>
|
|
48
49
|
<I, S, Opts extends Make<Types.NoInfer<S>, any, any>>(
|
|
49
|
-
tag:
|
|
50
|
+
tag: Context.Service<I, S>,
|
|
50
51
|
options: Opts
|
|
51
52
|
): PackedOrUnpackedLayer<I, Opts>
|
|
52
53
|
} = dual(2, (tag, options) => {
|
package/src/Pure.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { Chunk, Effect, Layer, Result } from "effect"
|
|
3
|
+
import * as Context from "./Context.js"
|
|
3
4
|
import { tuple } from "./Function.js"
|
|
4
|
-
import * as ServiceMap from "./ServiceMap.js"
|
|
5
5
|
|
|
6
6
|
const S1 = Symbol()
|
|
7
7
|
const S2 = Symbol()
|
|
@@ -86,9 +86,9 @@ export function GMU<W, S, S2, GA, MR, ME>(modify: (i: GA) => Pure<W, S, S2, MR,
|
|
|
86
86
|
) => GMU_(get, modify, update)
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const tagg =
|
|
89
|
+
const tagg = Context.Service<{ env: PureEnv<never, unknown, never> }>("PureEnv")
|
|
90
90
|
function castTag<W, S, S2>() {
|
|
91
|
-
return tagg as any as
|
|
91
|
+
return tagg as any as Context.Service<PureEnvEnv<W, S, S2>, PureEnvEnv<W, S, S2>>
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export const ServiceTag = Symbol()
|
|
@@ -100,9 +100,9 @@ export abstract class PhantomTypeParameter<Identifier extends keyof any, Instant
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export type ServiceShape<T extends
|
|
103
|
+
export type ServiceShape<T extends Context.ServiceClass.Shape<any, any>> = Omit<
|
|
104
104
|
T,
|
|
105
|
-
keyof
|
|
105
|
+
keyof Context.ServiceClass.Shape<any, any>
|
|
106
106
|
>
|
|
107
107
|
|
|
108
108
|
export abstract class ServiceTagged<ServiceKey> extends PhantomTypeParameter<string, ServiceKey> {}
|
package/src/Schema/ext.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
3
|
-
import { Effect, Option, pipe, type SchemaAST, SchemaGetter, SchemaIssue, SchemaTransformation
|
|
3
|
+
import { Effect, Option, pipe, type SchemaAST, SchemaGetter, SchemaIssue, SchemaTransformation } from "effect"
|
|
4
4
|
import * as S from "effect/Schema"
|
|
5
5
|
import { isDateValid } from "effect/Schema"
|
|
6
6
|
import { type NonEmptyReadonlyArray } from "../Array.js"
|
|
7
|
+
import * as Context from "../Context.js"
|
|
7
8
|
import { extendM, typedKeysOf } from "../utils.js"
|
|
8
9
|
import { type AST } from "./schema.js"
|
|
9
10
|
|
|
@@ -405,7 +406,7 @@ export const transformToOrFail = <To extends S.Top, From extends S.Top, RD>(
|
|
|
405
406
|
|
|
406
407
|
export const provide = <Self extends S.Top, R>(
|
|
407
408
|
self: Self,
|
|
408
|
-
context:
|
|
409
|
+
context: Context.Context<R>
|
|
409
410
|
): ProvidedCodec<Self, R> => {
|
|
410
411
|
const prov = Effect.provide(context)
|
|
411
412
|
return self.pipe(
|
|
@@ -415,18 +416,18 @@ export const provide = <Self extends S.Top, R>(
|
|
|
415
416
|
}
|
|
416
417
|
export const contextFromServices = <
|
|
417
418
|
Self extends S.Top,
|
|
418
|
-
Tags extends ReadonlyArray<
|
|
419
|
+
Tags extends ReadonlyArray<Context.Key<any, any>>
|
|
419
420
|
>(
|
|
420
421
|
self: Self,
|
|
421
422
|
...services: Tags
|
|
422
423
|
): Effect.Effect<
|
|
423
|
-
ProvidedCodec<Self,
|
|
424
|
+
ProvidedCodec<Self, Context.Service.Identifier<Tags[number]>>,
|
|
424
425
|
never,
|
|
425
|
-
|
|
426
|
+
Context.Service.Identifier<Tags[number]>
|
|
426
427
|
> =>
|
|
427
428
|
Effect.gen(function*() {
|
|
428
|
-
const context:
|
|
429
|
-
yield* Effect.services<
|
|
429
|
+
const context: Context.Context<Context.Service.Identifier<Tags[number]>> = Context.pick(...services)(
|
|
430
|
+
yield* Effect.services<Context.Service.Identifier<Tags[number]>>()
|
|
430
431
|
)
|
|
431
432
|
return provide(self, context)
|
|
432
433
|
})
|
|
@@ -7,11 +7,11 @@ import * as Schema from "effect/Schema"
|
|
|
7
7
|
import * as Struct from "effect/Struct"
|
|
8
8
|
import { Rpc, RpcClient, RpcGroup, RpcSerialization } from "effect/unstable/rpc"
|
|
9
9
|
import * as Config from "../Config.js"
|
|
10
|
+
import * as Context from "../Context.js"
|
|
10
11
|
import * as Effect from "../Effect.js"
|
|
11
12
|
import { HttpClient, HttpClientRequest } from "../http.js"
|
|
12
13
|
import * as Option from "../Option.js"
|
|
13
14
|
import type * as S from "../Schema.js"
|
|
14
|
-
import * as ServiceMap from "../ServiceMap.js"
|
|
15
15
|
import { typedKeysOf, typedValuesOf } from "../utils.js"
|
|
16
16
|
import type { Client, ClientForOptions, Requests, RequestsAny } from "./clientFor.js"
|
|
17
17
|
|
|
@@ -40,7 +40,7 @@ export type Req = S.Top & {
|
|
|
40
40
|
readonly "~decodingServices"?: unknown
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
class RequestName extends
|
|
43
|
+
class RequestName extends Context.Reference("RequestName", {
|
|
44
44
|
defaultValue: () => ({ requestName: "Unspecified", moduleName: "Error" })
|
|
45
45
|
}) {}
|
|
46
46
|
|
|
@@ -139,7 +139,7 @@ const makeRpcTag = <M extends Requests>(resource: M) => {
|
|
|
139
139
|
|
|
140
140
|
// Use Object.assign instead of class extension to avoid TS2509 with complex generic return types.
|
|
141
141
|
// The first type arg is `any` because this is a dynamically created tag — its identity is the string key.
|
|
142
|
-
const TheClient =
|
|
142
|
+
const TheClient = Context.Opaque<
|
|
143
143
|
any,
|
|
144
144
|
RpcClient.RpcClient<RpcGroup.Rpcs<typeof rpcs>>
|
|
145
145
|
>()(`RpcClient.${meta.moduleName}`)
|
|
@@ -281,7 +281,7 @@ const makeApiClientFactory = Effect
|
|
|
281
281
|
* Used to create clients for resource modules.
|
|
282
282
|
*/
|
|
283
283
|
export class ApiClientFactory
|
|
284
|
-
extends
|
|
284
|
+
extends Context.Opaque<ApiClientFactory, Effect.Success<typeof makeApiClientFactory>>()("ApiClientFactory")
|
|
285
285
|
{
|
|
286
286
|
static readonly layer = (config: ApiConfig) =>
|
|
287
287
|
ApiClientFactory.toLayer(makeApiClientFactory).pipe(Layer.provide(RpcSerializationLayer(config)))
|
package/src/client/errors.ts
CHANGED
|
@@ -207,6 +207,7 @@ export class CauseException<E> extends Error {
|
|
|
207
207
|
Error.stackTraceLimit = 0
|
|
208
208
|
super()
|
|
209
209
|
Error.stackTraceLimit = limit
|
|
210
|
+
this.cause = Cause.squash(originalCause)
|
|
210
211
|
// v4: makeFiberFailure removed — use Cause.prettyErrors instead
|
|
211
212
|
const errors = Cause.prettyErrors(originalCause)
|
|
212
213
|
const first = errors[0]
|
package/src/client/makeClient.ts
CHANGED
|
@@ -40,7 +40,7 @@ export const makeRpcClient = <
|
|
|
40
40
|
RequestContextMap extends RequestContextMapTagAny,
|
|
41
41
|
GeneralErrors extends S.Top = never
|
|
42
42
|
>(rcs: RequestContextMap, generalErrors?: GeneralErrors) => {
|
|
43
|
-
// Long way around
|
|
43
|
+
// Long way around Context/C extends etc to support actual jsdoc from passed in RequestConfig etc... (??)
|
|
44
44
|
type ServiceMap = {
|
|
45
45
|
success: S.Top | S.Struct.Fields // SchemaOrFields will make a Schema type out of Struct.Fields
|
|
46
46
|
error: S.Top | S.Struct.Fields // SchemaOrFields will make a Schema type out of Struct.Fields
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./builtin.js"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Context from "./Context.js"
|
|
4
4
|
|
|
5
5
|
export * as Fnc from "./Function.js"
|
|
6
6
|
export * as Utils from "./utils.js"
|
|
@@ -8,18 +8,14 @@ export * as Utils from "./utils.js"
|
|
|
8
8
|
export * as Array from "./Array.js"
|
|
9
9
|
export * as Config from "./Config.js"
|
|
10
10
|
export * as ConfigProvider from "./ConfigProvider.js"
|
|
11
|
+
export * as Context from "./Context.js"
|
|
11
12
|
export * as Effect from "./Effect.js"
|
|
12
13
|
export * as Layer from "./Layer.js"
|
|
13
14
|
export * as NonEmptySet from "./NonEmptySet.js"
|
|
14
|
-
export * as ServiceMap from "./ServiceMap.js"
|
|
15
15
|
export * as Set from "./Set.js"
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* @deprecated use ServiceMap directly instead
|
|
20
|
-
*/
|
|
21
|
-
ServiceMap as Context
|
|
22
|
-
}
|
|
17
|
+
/** @deprecated Use `Context` instead */
|
|
18
|
+
export { Context as ServiceMap }
|
|
23
19
|
|
|
24
20
|
export { type NonEmptyArray, type NonEmptyReadonlyArray } from "./Array.js"
|
|
25
21
|
|
package/src/middleware.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import {
|
|
2
|
+
import { Context } from "effect-app"
|
|
3
3
|
import { RpcX } from "./rpc.js"
|
|
4
4
|
|
|
5
|
-
export class DevMode extends
|
|
5
|
+
export class DevMode extends Context.Reference("DevMode", { defaultValue: () => false }) {}
|
|
6
6
|
|
|
7
7
|
export class RequestCacheMiddleware
|
|
8
8
|
extends RpcX.RpcMiddleware.Tag<RequestCacheMiddleware>()("RequestCacheMiddleware")
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { Effect, Layer, type Schema, Schema as S, type Scope
|
|
2
|
+
import { Effect, Layer, type Schema, Schema as S, type Scope } from "effect"
|
|
3
3
|
import { type NonEmptyArray, type NonEmptyReadonlyArray } from "effect/Array"
|
|
4
4
|
import { type Simplify } from "effect/Types"
|
|
5
5
|
import { Rpc, type RpcGroup, type RpcSchema } from "effect/unstable/rpc"
|
|
6
6
|
import { type HandlersFrom } from "effect/unstable/rpc/RpcGroup"
|
|
7
7
|
import { type RequestId } from "effect/unstable/rpc/RpcMessage"
|
|
8
|
+
import * as Context from "../Context.js"
|
|
8
9
|
import { type HttpHeaders } from "../http.js"
|
|
9
10
|
import { PreludeLogger } from "../logger.js"
|
|
10
11
|
import { type TypeTestId } from "../TypeTest.js"
|
|
@@ -61,13 +62,13 @@ export interface MiddlewareMaker<
|
|
|
61
62
|
}
|
|
62
63
|
>
|
|
63
64
|
{
|
|
64
|
-
readonly layer: Layer.Layer<Self, never,
|
|
65
|
+
readonly layer: Layer.Layer<Self, never, Context.Service.Identifier<MiddlewareProviders[number]>>
|
|
65
66
|
readonly requestContext: RequestContextTag<RequestContextMap>
|
|
66
67
|
readonly requestContextMap: RequestContextMap
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
export interface RequestContextTag<RequestContextMap extends Record<string, RpcContextMap.Any>>
|
|
70
|
-
extends
|
|
71
|
+
extends Context.Service<"RequestContextConfig", GetContextConfig<RequestContextMap>>
|
|
71
72
|
{}
|
|
72
73
|
|
|
73
74
|
export namespace MiddlewareMaker {
|
|
@@ -295,7 +296,7 @@ const middlewareMaker = <
|
|
|
295
296
|
// inspired from Effect/RpcMiddleware
|
|
296
297
|
for (const tag of middlewares) {
|
|
297
298
|
// use the tag to get the middleware from context
|
|
298
|
-
const middleware =
|
|
299
|
+
const middleware = Context.getUnsafe(context, tag)
|
|
299
300
|
|
|
300
301
|
// wrap the current handler, allowing the middleware to run before and after it
|
|
301
302
|
handler = PreludeLogger.logDebug("Applying middleware wrap " + tag.key).pipe(
|
|
@@ -367,7 +368,7 @@ const makeMiddlewareBasic = <Self>() =>
|
|
|
367
368
|
return Object.assign(MiddlewareMaker, {
|
|
368
369
|
layer,
|
|
369
370
|
// tag to be used to retrieve the RequestContextConfig from Rpc annotations
|
|
370
|
-
requestContext:
|
|
371
|
+
requestContext: Context.Service<"RequestContextConfig", GetContextConfig<RequestContextMap>>(
|
|
371
372
|
"RequestContextConfig"
|
|
372
373
|
),
|
|
373
374
|
requestContextMap: rcm
|
|
@@ -380,7 +381,7 @@ export const Tag = <Self>() =>
|
|
|
380
381
|
RequestContextMap extends RequestContextMapTagAny
|
|
381
382
|
>(id: Id, rcm: RequestContextMap): MiddlewaresBuilder<Self, Id, RequestContextMap["config"]> => {
|
|
382
383
|
let allMiddleware: MiddlewareMaker.Any[] = []
|
|
383
|
-
const requestContext =
|
|
384
|
+
const requestContext = Context.Service<"RequestContextConfig", GetContextConfig<RequestContextMap["config"]>>(
|
|
384
385
|
"RequestContextConfig"
|
|
385
386
|
)
|
|
386
387
|
const it = {
|
package/src/rpc/RpcContextMap.ts
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
4
|
|
|
5
|
-
import { type Schema as S
|
|
5
|
+
import { type Schema as S } from "effect"
|
|
6
6
|
import { type AnyWithProps } from "effect/unstable/rpc/Rpc"
|
|
7
|
+
import * as Context from "../Context.js"
|
|
7
8
|
import { type RpcDynamic } from "./RpcMiddleware.js"
|
|
8
9
|
|
|
9
10
|
type Values<T extends Record<any, any>> = T[keyof T]
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
|
-
* Middleware is inactivate by default, the Key is optional in route context, and the service is optionally provided as Effect
|
|
13
|
+
* Middleware is inactivate by default, the Key is optional in route context, and the service is optionally provided as Effect Context.
|
|
13
14
|
* Unless explicitly configured as `true`.
|
|
14
15
|
*/
|
|
15
16
|
export type RpcContextMap<Service, E> = {
|
|
@@ -22,7 +23,7 @@ export type RpcContextMap<Service, E> = {
|
|
|
22
23
|
|
|
23
24
|
export declare namespace RpcContextMap {
|
|
24
25
|
/**
|
|
25
|
-
* Middleware is active by default, and provides the Service at Key in route context, and the Service is provided as Effect
|
|
26
|
+
* Middleware is active by default, and provides the Service at Key in route context, and the Service is provided as Effect Context.
|
|
26
27
|
* Unless explicitly omitted.
|
|
27
28
|
*/
|
|
28
29
|
export type Inverted<Service, E> = {
|
|
@@ -97,7 +98,7 @@ export type GetEffectError<RequestContextMap extends Record<string, RpcContextMa
|
|
|
97
98
|
}
|
|
98
99
|
>
|
|
99
100
|
|
|
100
|
-
const tag =
|
|
101
|
+
const tag = Context.Service("RequestContextConfig")
|
|
101
102
|
|
|
102
103
|
export const makeMap = <const Config extends Record<string, RpcContextMap.Any>>(config: Config) => {
|
|
103
104
|
const cls = class {
|
|
@@ -109,7 +110,7 @@ export const makeMap = <const Config extends Record<string, RpcContextMap.Any>>(
|
|
|
109
110
|
return Object.assign(cls, {
|
|
110
111
|
config, /** Retrieves RequestContextConfig out of the Rpc annotations */
|
|
111
112
|
getConfig: (rpc: AnyWithProps): GetContextConfig<Config> => {
|
|
112
|
-
return
|
|
113
|
+
return Context.getOrElse(rpc.annotations, tag as any, () => ({}))
|
|
113
114
|
},
|
|
114
115
|
/** Adapter used when setting the dynamic prop on a middleware implementation */
|
|
115
116
|
get: <
|
package/src/rpc/RpcMiddleware.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
-
import { type Effect, type Schema, type Schema as S, type Scope, type
|
|
4
|
+
import { type Effect, type Schema, type Schema as S, type Scope, type Stream } from "effect"
|
|
5
5
|
import { type NonEmptyReadonlyArray } from "effect/Array"
|
|
6
6
|
import { type Rpc, RpcMiddleware } from "effect/unstable/rpc"
|
|
7
7
|
import { type TypeId } from "effect/unstable/rpc/RpcMiddleware"
|
|
8
|
+
import type * as Context from "../Context.js"
|
|
8
9
|
import { type GetEffectContext, type RpcContextMap } from "./RpcContextMap.js"
|
|
9
10
|
|
|
10
11
|
export type RpcMiddlewareV4<Provides, E, Requires> = RpcMiddleware.RpcMiddleware<Provides, E, Requires>
|
|
@@ -102,8 +103,8 @@ export declare namespace TagClass {
|
|
|
102
103
|
requires?: any
|
|
103
104
|
provides?: any
|
|
104
105
|
}
|
|
105
|
-
> extends
|
|
106
|
-
new(_: never):
|
|
106
|
+
> extends Context.Service<Self, Service> {
|
|
107
|
+
new(_: never): Context.ServiceClass.Shape<Name, Service>
|
|
107
108
|
readonly [TypeId]: TypeId
|
|
108
109
|
readonly optional: Optional<Options>
|
|
109
110
|
readonly error: FailureSchema<Options>
|
|
@@ -226,7 +227,7 @@ export type ExtractProvides<R extends Rpc.Any, Tag extends string> = R extends
|
|
|
226
227
|
Rpc.Rpc<Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware, infer _Requires> ? _Middleware extends {
|
|
227
228
|
readonly provides: infer _P
|
|
228
229
|
} ? [_P] extends [never] ? never
|
|
229
|
-
: _P /*_P extends
|
|
230
|
+
: _P /*_P extends Context.Service<infer _I, infer _S> ? _I
|
|
230
231
|
: never */
|
|
231
232
|
: never
|
|
232
233
|
: never
|
package/src/utils/gen.ts
CHANGED
|
@@ -15,7 +15,7 @@ export namespace EffectGenUtils {
|
|
|
15
15
|
: EG extends (..._: infer _3) => Generator<Yieldable<any, infer _, infer E, infer _R>, infer _A, infer _2> ? E
|
|
16
16
|
: never
|
|
17
17
|
|
|
18
|
-
export type
|
|
18
|
+
export type Context<EG> = EG extends Effect<infer _A, infer _E, infer R> ? R
|
|
19
19
|
// there could be a case where the generator function does not yield anything, so we need to handle that
|
|
20
20
|
: EG extends (..._: infer _3) => Generator<never, infer _A, infer _2> ? never
|
|
21
21
|
// v4: generators can yield Yieldable (Effect, Service, etc.), all have asEffect()
|
package/src/utils/logger.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
|
|
4
4
|
import { Effect, type LogLevel } from "effect"
|
|
5
|
-
import * as
|
|
5
|
+
import * as Context from "../Context.js"
|
|
6
6
|
|
|
7
7
|
type Levels = "info" | "debug" | "warn" | "error"
|
|
8
8
|
|
|
9
|
-
export class LogLevels extends
|
|
9
|
+
export class LogLevels extends Context.Reference("LogLevels", {
|
|
10
10
|
defaultValue: () => new Map<string, Levels>()
|
|
11
11
|
}) {}
|
|
12
12
|
|
package/dist/ServiceMap.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceMap.d.ts","sourceRoot":"","sources":["../src/ServiceMap.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAAE,KAA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