@effect-app/infra 1.1.10 → 1.1.11
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 +9 -0
- package/dist/RequestContext.d.ts +12 -12
- package/dist/api/routing/match.d.ts +1 -1
- package/dist/services/QueueMaker/service.d.ts +2 -2
- package/dist/services/RepositoryBase.d.ts +1 -1
- package/dist/services/RequestContextContainer.d.ts +1 -1
- package/dist/services/Store/ContextMapContainer.d.ts +1 -1
- package/dist/services/Store/service.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/RequestContext.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ declare const RequestContextParent_base: S.EnhancedClass<RequestContextParent, {
|
|
|
5
5
|
} & {
|
|
6
6
|
id: S.WithDefaults<S.Schema<NonEmptyString255, string, never> & {
|
|
7
7
|
make: () => NonEmptyString255;
|
|
8
|
-
withDefault: S.PropertySignature<":",
|
|
8
|
+
withDefault: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
|
|
9
9
|
}> & S.Schema<NonEmptyString255, string, never> & {
|
|
10
10
|
make: () => NonEmptyString255;
|
|
11
|
-
withDefault: S.PropertySignature<":",
|
|
11
|
+
withDefault: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
|
|
12
12
|
};
|
|
13
13
|
name: S.WithDefaults<S.Schema<string & S.NonEmptyString255Brand, string, never>> & S.Schema<string & S.NonEmptyString255Brand, string, never>;
|
|
14
14
|
userProfile: S.PropertySignature<"?:", {
|
|
@@ -30,10 +30,10 @@ declare const RequestContextParent_base: S.EnhancedClass<RequestContextParent, {
|
|
|
30
30
|
}, RequestContextParent.From, never, {
|
|
31
31
|
readonly id: NonEmptyString255;
|
|
32
32
|
readonly name: string & S.NonEmptyString255Brand;
|
|
33
|
-
readonly locale: "en" | "de";
|
|
34
33
|
readonly userProfile?: {
|
|
35
34
|
readonly sub: string & import("effect-app/ids").UserProfileIdBrand;
|
|
36
35
|
} | undefined;
|
|
36
|
+
readonly locale: "en" | "de";
|
|
37
37
|
readonly createdAt?: Date;
|
|
38
38
|
}, {}, {}>;
|
|
39
39
|
export declare class RequestContextParent extends RequestContextParent_base {
|
|
@@ -41,13 +41,13 @@ export declare class RequestContextParent extends RequestContextParent_base {
|
|
|
41
41
|
declare const RequestContext_base: S.EnhancedClass<RequestContext, {
|
|
42
42
|
readonly _tag: S.Literal<["RequestContext"]>;
|
|
43
43
|
} & {
|
|
44
|
-
id: S.PropertySignature<":",
|
|
44
|
+
id: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
|
|
45
45
|
rootId: S.WithDefaults<S.Schema<NonEmptyString255, string, never> & {
|
|
46
46
|
make: () => NonEmptyString255;
|
|
47
|
-
withDefault: S.PropertySignature<":",
|
|
47
|
+
withDefault: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
|
|
48
48
|
}> & S.Schema<NonEmptyString255, string, never> & {
|
|
49
49
|
make: () => NonEmptyString255;
|
|
50
|
-
withDefault: S.PropertySignature<":",
|
|
50
|
+
withDefault: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
|
|
51
51
|
};
|
|
52
52
|
sourceId: S.PropertySignature<"?:", (string & S.NonEmptyString255Brand) | undefined, never, "?:", string | undefined, false, never>;
|
|
53
53
|
parent: S.PropertySignature<"?:", RequestContextParent | undefined, never, "?:", RequestContextParent.From | undefined, false, never>;
|
|
@@ -62,7 +62,7 @@ declare const RequestContext_base: S.EnhancedClass<RequestContext, {
|
|
|
62
62
|
createdAt: S.PropertySignature<":", Date, never, ":", string, true, never>;
|
|
63
63
|
}, {
|
|
64
64
|
readonly _tag: "RequestContext";
|
|
65
|
-
readonly id:
|
|
65
|
+
readonly id: string & S.NonEmptyString255Brand;
|
|
66
66
|
readonly name: string & S.NonEmptyString255Brand;
|
|
67
67
|
readonly userProfile?: {
|
|
68
68
|
readonly sub: string & import("effect-app/ids").UserProfileIdBrand;
|
|
@@ -74,17 +74,17 @@ declare const RequestContext_base: S.EnhancedClass<RequestContext, {
|
|
|
74
74
|
readonly parent?: RequestContextParent | undefined;
|
|
75
75
|
readonly namespace?: (string & S.NonEmptyString255Brand) | undefined;
|
|
76
76
|
}, RequestContext.From, never, {
|
|
77
|
+
readonly id?: string & S.NonEmptyString255Brand;
|
|
77
78
|
readonly name: string & S.NonEmptyString255Brand;
|
|
78
|
-
readonly locale: "en" | "de";
|
|
79
|
-
readonly rootId: NonEmptyString255;
|
|
80
79
|
readonly userProfile?: {
|
|
81
80
|
readonly sub: string & import("effect-app/ids").UserProfileIdBrand;
|
|
82
81
|
} | undefined;
|
|
82
|
+
readonly locale: "en" | "de";
|
|
83
|
+
readonly createdAt?: Date;
|
|
84
|
+
readonly rootId: NonEmptyString255;
|
|
83
85
|
readonly sourceId?: (string & S.NonEmptyString255Brand) | undefined;
|
|
84
86
|
readonly parent?: RequestContextParent | undefined;
|
|
85
87
|
readonly namespace?: (string & S.NonEmptyString255Brand) | undefined;
|
|
86
|
-
readonly id?: NonEmptyString255;
|
|
87
|
-
readonly createdAt?: Date;
|
|
88
88
|
}, {}, {}>;
|
|
89
89
|
/**
|
|
90
90
|
* @tsplus type RequestContext
|
|
@@ -103,7 +103,7 @@ export declare const spanAttributes: (ctx: RequestContext) => {
|
|
|
103
103
|
"request.user.sub"?: string & import("effect-app/ids").UserProfileIdBrand;
|
|
104
104
|
"request.user.roles"?: unknown;
|
|
105
105
|
"request.source.id"?: string & S.NonEmptyString255Brand;
|
|
106
|
-
"request.id":
|
|
106
|
+
"request.id": string & S.NonEmptyString255Brand;
|
|
107
107
|
"request.root.id": NonEmptyString255;
|
|
108
108
|
"request.name": string & S.NonEmptyString255Brand;
|
|
109
109
|
"request.locale": "en" | "de";
|
|
@@ -8,5 +8,5 @@ import type { HttpServerRequest, HttpServerResponse } from "effect-app/http";
|
|
|
8
8
|
import type { RequestHandler } from "./base.js";
|
|
9
9
|
import type { Middleware } from "./makeRequestHandler.js";
|
|
10
10
|
export declare const RouteDescriptors: Context.Tag<Ref<RouteDescriptorAny[]>, Ref<RouteDescriptorAny[]>>;
|
|
11
|
-
export declare function match<R, M, PathA extends Struct.Fields, CookieA extends Struct.Fields, QueryA extends Struct.Fields, BodyA extends Struct.Fields, HeaderA extends Struct.Fields, ReqA extends PathA & QueryA & BodyA, ResA extends Struct.Fields, ResE, MiddlewareE, PPath extends `/${string}`, R2, PR, RErr, CTX, Context, Config>(requestHandler: RequestHandler<R, M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, ResE, PPath, CTX, Context, Config>, errorHandler: <R>(req: HttpServerRequest.ServerRequest, res: HttpServerResponse.ServerResponse, r2: Effect<HttpServerResponse.ServerResponse, ValidationError | MiddlewareE | ResE, R>) => Effect<HttpServerResponse.ServerResponse, never, Exclude<RErr | R, HttpServerRequest.ServerRequest | HttpRouter.RouteContext | Scope>>, middleware?: Middleware<R, M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, ResE, MiddlewareE, PPath, R2, PR, CTX, Context, Config>): Effect.Effect<HttpRouter.Route<import("@effect/platform/Http/ServerError").RequestError, import("../../services/RequestContextContainer.js").RequestContextContainer | import("
|
|
11
|
+
export declare function match<R, M, PathA extends Struct.Fields, CookieA extends Struct.Fields, QueryA extends Struct.Fields, BodyA extends Struct.Fields, HeaderA extends Struct.Fields, ReqA extends PathA & QueryA & BodyA, ResA extends Struct.Fields, ResE, MiddlewareE, PPath extends `/${string}`, R2, PR, RErr, CTX, Context, Config>(requestHandler: RequestHandler<R, M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, ResE, PPath, CTX, Context, Config>, errorHandler: <R>(req: HttpServerRequest.ServerRequest, res: HttpServerResponse.ServerResponse, r2: Effect<HttpServerResponse.ServerResponse, ValidationError | MiddlewareE | ResE, R>) => Effect<HttpServerResponse.ServerResponse, never, Exclude<RErr | R, HttpServerRequest.ServerRequest | HttpRouter.RouteContext | Scope>>, middleware?: Middleware<R, M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, ResE, MiddlewareE, PPath, R2, PR, CTX, Context, Config>): Effect.Effect<HttpRouter.Route<import("@effect/platform/Http/ServerError").RequestError, import("../../services/RequestContextContainer.js").RequestContextContainer | import("@effect-app/infra-adapters/RequestFiberSet").RequestFiberSet | import("../../services/Store/ContextMapContainer.js").ContextMapContainer | Exclude<R2, Scope.Scope | HttpServerRequest.ServerRequest | HttpRouter.RouteContext> | Exclude<RErr, Scope.Scope | HttpServerRequest.ServerRequest | HttpRouter.RouteContext> | Exclude<Exclude<Exclude<R, import("effect-app/utils").EnforceNonEmptyRecord<M>>, PR>, Scope.Scope | HttpServerRequest.ServerRequest | HttpRouter.RouteContext>>, never, never>;
|
|
12
12
|
//# sourceMappingURL=match.d.ts.map
|
|
@@ -16,13 +16,13 @@ export declare const QueueMaker: QueueMakerOps;
|
|
|
16
16
|
export declare const QueueMeta: import("@effect/schema/Schema").Struct<{
|
|
17
17
|
requestContext: typeof RequestContext;
|
|
18
18
|
span: S.PropertySignature<"?:", {
|
|
19
|
+
readonly sampled: boolean;
|
|
19
20
|
readonly spanId: string;
|
|
20
21
|
readonly traceId: string;
|
|
21
|
-
readonly sampled: boolean;
|
|
22
22
|
} | undefined, never, "?:", {
|
|
23
|
+
readonly sampled: boolean;
|
|
23
24
|
readonly spanId: string;
|
|
24
25
|
readonly traceId: string;
|
|
25
|
-
readonly sampled: boolean;
|
|
26
26
|
} | undefined, false, never>;
|
|
27
27
|
}>;
|
|
28
28
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -145,7 +145,7 @@ export declare function makeRepo<Evt = never>(): <ItemType extends string, R, En
|
|
|
145
145
|
config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
|
|
146
146
|
partitionValue?: (a: Encoded) => string;
|
|
147
147
|
};
|
|
148
|
-
}) => Effect.Effect<Repository<T, Encoded, Evt, ItemType>, E,
|
|
148
|
+
}) => Effect.Effect<Repository<T, Encoded, Evt, ItemType>, E, StoreMaker | ContextMapContainer | R | RInitial | R2>;
|
|
149
149
|
Q: Query<Encoded>;
|
|
150
150
|
};
|
|
151
151
|
export declare function makeStore<Encoded extends {
|
|
@@ -25,7 +25,7 @@ declare const RequestContextContainer_base: (abstract new (service: {
|
|
|
25
25
|
requestContext: Effect<RequestContext>;
|
|
26
26
|
update: (f: (rc: RequestContext) => RequestContext) => Effect<RequestContext>;
|
|
27
27
|
start: (f: RequestContext) => Effect<void>;
|
|
28
|
-
}) => X) => X extends Effect<infer A_3, infer E_4, infer R_4> ? Effect<A_3, E_4,
|
|
28
|
+
}) => X) => X extends Effect<infer A_3, infer E_4, infer R_4> ? Effect<A_3, E_4, R_4 | RequestContextContainer> : Effect<X, never, RequestContextContainer>;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* @tsplus type RequestContextContainer
|
|
@@ -20,7 +20,7 @@ declare const ContextMapContainer_base: (abstract new (service: {
|
|
|
20
20
|
use: <X>(body: (_: {
|
|
21
21
|
get: Effect<ContextMap>;
|
|
22
22
|
start: Effect<void>;
|
|
23
|
-
}) => X) => X extends Effect<infer A_3, infer E_4, infer R_4> ? Effect<A_3, E_4,
|
|
23
|
+
}) => X) => X extends Effect<infer A_3, infer E_4, infer R_4> ? Effect<A_3, E_4, R_4 | ContextMapContainer> : Effect<X, never, ContextMapContainer>;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* @tsplus companion ContextMapContainer.Ops
|
|
@@ -88,7 +88,7 @@ declare const StoreMaker_base: (abstract new (service: {
|
|
|
88
88
|
make: <Encoded extends {
|
|
89
89
|
id: Id;
|
|
90
90
|
}, Id extends string, R = never, E = never>(name: string, seed?: Effect<Iterable<Encoded>, E, R> | undefined, config?: StoreConfig<Encoded> | undefined) => Effect<Store<Encoded, Id, PersistenceModelType<Encoded>>, E, R>;
|
|
91
|
-
}) => X) => X extends Effect<infer A_3, infer E_4, infer R_4> ? Effect<A_3, E_4,
|
|
91
|
+
}) => X) => X extends Effect<infer A_3, infer E_4, infer R_4> ? Effect<A_3, E_4, StoreMaker | R_4> : Effect<X, never, StoreMaker>;
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
94
|
* @tsplus type StoreMaker
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/infra",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"proper-lockfile": "^4.1.2",
|
|
19
19
|
"pure-rand": "6.1.0",
|
|
20
20
|
"redlock": "^4.2.0",
|
|
21
|
+
"@effect-app/infra-adapters": "1.0.13",
|
|
22
|
+
"effect-app": "1.0.9",
|
|
21
23
|
"@effect-app/core": "1.0.5",
|
|
22
|
-
"@effect-app/schema": "1.0.
|
|
23
|
-
"@effect-app/infra-adapters": "1.0.12",
|
|
24
|
-
"effect-app": "1.0.8"
|
|
24
|
+
"@effect-app/schema": "1.0.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@babel/cli": "^7.24.1",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"redis": "^3.1.2",
|
|
39
39
|
"ts-node": "^10.9.2",
|
|
40
40
|
"typescript": "^5.4.5",
|
|
41
|
-
"vitest": "^1.5.
|
|
41
|
+
"vitest": "^1.5.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"express": "^4.19.2",
|