@effect-app/infra 1.1.10 → 1.1.12
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 +18 -0
- package/dist/RequestContext.d.ts +12 -12
- package/dist/api/reportError.d.ts +2 -2
- package/dist/api/routing/match.d.ts +1 -1
- package/dist/api/setupRequest.d.ts +2 -2
- package/dist/services/Operations.d.ts +1 -1
- package/dist/services/QueueMaker/memQueue.d.ts +1 -1
- package/dist/services/QueueMaker/sbqueue.d.ts +1 -1
- package/dist/services/QueueMaker/service.d.ts +2 -2
- package/dist/services/RequestContextContainer.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @effect-app/infra
|
|
2
2
|
|
|
3
|
+
## 1.1.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [f202812]
|
|
8
|
+
- @effect-app/schema@1.0.9
|
|
9
|
+
- @effect-app/infra-adapters@1.0.14
|
|
10
|
+
- effect-app@1.0.10
|
|
11
|
+
|
|
12
|
+
## 1.1.11
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [83f19e1]
|
|
17
|
+
- effect-app@1.0.9
|
|
18
|
+
- @effect-app/schema@1.0.8
|
|
19
|
+
- @effect-app/infra-adapters@1.0.13
|
|
20
|
+
|
|
3
21
|
## 1.1.10
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
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";
|
|
@@ -9,7 +9,7 @@ import { Effect } from "effect-app";
|
|
|
9
9
|
*
|
|
10
10
|
* @tsplus getter effect/io/Effect forkDaemonReportRequest
|
|
11
11
|
*/
|
|
12
|
-
export declare function forkDaemonReportRequest<R, E, A>(self: Effect<A, E, R>): Effect.Effect<import("effect/Fiber").RuntimeFiber<A, E>, never, Exclude<R, import("effect/Tracer").ParentSpan
|
|
12
|
+
export declare function forkDaemonReportRequest<R, E, A>(self: Effect<A, E, R>): Effect.Effect<import("effect/Fiber").RuntimeFiber<A, E>, never, RequestFiberSet | Exclude<R, import("effect/Tracer").ParentSpan>>;
|
|
13
13
|
/**
|
|
14
14
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
15
15
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -19,5 +19,5 @@ export declare function forkDaemonReportRequest<R, E, A>(self: Effect<A, E, R>):
|
|
|
19
19
|
*
|
|
20
20
|
* @tsplus getter effect/io/Effect forkDaemonReportRequestUnexpected
|
|
21
21
|
*/
|
|
22
|
-
export declare function forkDaemonReportRequestUnexpected<R, E, A>(self: Effect<A, E, R>): Effect.Effect<import("effect/Fiber").RuntimeFiber<A, E>, never,
|
|
22
|
+
export declare function forkDaemonReportRequestUnexpected<R, E, A>(self: Effect<A, E, R>): Effect.Effect<import("effect/Fiber").RuntimeFiber<A, E>, never, Exclude<R, import("effect/Tracer").ParentSpan> | RequestFiberSet>;
|
|
23
23
|
//# sourceMappingURL=reportError.d.ts.map
|
|
@@ -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/
|
|
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/Store/ContextMapContainer.js").ContextMapContainer | import("../../services/RequestContextContainer.js").RequestContextContainer | import("@effect-app/infra-adapters/RequestFiberSet").RequestFiberSet | 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
|
|
@@ -2,8 +2,8 @@ import { Effect } from "effect-app";
|
|
|
2
2
|
import { RequestContext } from "../RequestContext.js";
|
|
3
3
|
import { RequestContextContainer } from "../services/RequestContextContainer.js";
|
|
4
4
|
import { ContextMapContainer } from "../services/Store/ContextMapContainer.js";
|
|
5
|
-
export declare function setupRequestContext<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext | string): Effect.Effect<A, E,
|
|
6
|
-
export declare function setupExistingRequestContext<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext | string): Effect.Effect<A, E,
|
|
5
|
+
export declare function setupRequestContext<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext | string): Effect.Effect<A, E, ContextMapContainer | RequestContextContainer | Exclude<Exclude<R, import("effect/Tracer").ParentSpan>, never>>;
|
|
6
|
+
export declare function setupExistingRequestContext<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext | string): Effect.Effect<A, E, ContextMapContainer | RequestContextContainer | Exclude<R, never>>;
|
|
7
7
|
/**
|
|
8
8
|
* @tsplus fluent effect/io/Effect updateRequestContext
|
|
9
9
|
*/
|
|
@@ -47,7 +47,7 @@ declare const Operations_base: (abstract new (service: {
|
|
|
47
47
|
all: Effect.Effect<Operation[], never, never>;
|
|
48
48
|
find: (id: StringId) => Effect.Effect<Option.Option<Operation>, never, never>;
|
|
49
49
|
update: (id: StringId, progress: OperationProgress) => Effect.Effect<void, never, never>;
|
|
50
|
-
}) => X) => X extends Effect<infer A_3, infer E_5, infer R_5> ? Effect<A_3, E_5,
|
|
50
|
+
}) => X) => X extends Effect<infer A_3, infer E_5, infer R_5> ? Effect<A_3, E_5, Operations | R_5> : Effect<X, never, Operations>;
|
|
51
51
|
};
|
|
52
52
|
export declare class Operations extends Operations_base {
|
|
53
53
|
private static readonly CleanupLive;
|
|
@@ -13,6 +13,6 @@ export declare function makeMemQueue<Evt extends {
|
|
|
13
13
|
_tag: string;
|
|
14
14
|
}, EvtE, DrainEvtE>(queueName: string, queueDrainName: string, schema: S.Schema<Evt, EvtE>, drainSchema: S.Schema<DrainEvt, DrainEvtE>): Effect.Effect<{
|
|
15
15
|
publish: (messages_0: Evt, ...messages_1: Evt[]) => Effect.Effect<void, never, never>;
|
|
16
|
-
drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never,
|
|
16
|
+
drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, import("../Store/ContextMapContainer.js").ContextMapContainer | RequestContextContainer | Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, never>, Tracer.ParentSpan>>;
|
|
17
17
|
}, never, RequestContextContainer | MemQueue>;
|
|
18
18
|
//# sourceMappingURL=memQueue.d.ts.map
|
|
@@ -13,7 +13,7 @@ export declare function makeServiceBusQueue<Evt extends {
|
|
|
13
13
|
id: StringId;
|
|
14
14
|
_tag: string;
|
|
15
15
|
}, EvtE, DrainEvtE>(queueName: string, queueDrainName: string, schema: S.Schema<Evt, EvtE>, drainSchema: S.Schema<DrainEvt, DrainEvtE>): Effect.Effect<{
|
|
16
|
-
drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, import("
|
|
16
|
+
drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, import("../Store/ContextMapContainer.js").ContextMapContainer | import("effect/Scope").Scope | RequestContextContainer | Exclude<Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, never>, Tracer.ParentSpan>, ServiceBusReceiverFactory>>;
|
|
17
17
|
publish: (messages_0: Evt, ...messages_1: Evt[]) => Effect.Effect<void, never, never>;
|
|
18
18
|
}, never, RequestContextContainer | ServiceBusReceiverFactory | import("@azure/service-bus").ServiceBusSender>;
|
|
19
19
|
/**
|
|
@@ -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
|
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/infra",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"pure-rand": "6.1.0",
|
|
20
20
|
"redlock": "^4.2.0",
|
|
21
21
|
"@effect-app/core": "1.0.5",
|
|
22
|
-
"@effect-app/
|
|
23
|
-
"
|
|
24
|
-
"effect-app": "1.0.
|
|
22
|
+
"@effect-app/infra-adapters": "1.0.14",
|
|
23
|
+
"effect-app": "1.0.10",
|
|
24
|
+
"@effect-app/schema": "1.0.9"
|
|
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",
|