effect-app 0.181.1 → 0.181.2
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/Request.d.ts +2 -2
- package/dist/client/errors.d.ts +30 -30
- package/dist/client/fetch.d.ts +4 -4
- package/dist/service.d.ts +4 -4
- package/dist/services/FiberBag.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/dist/Request.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare const responseWithJsonBody: (response: ClientResponse) => Effect.
|
|
|
13
13
|
/**
|
|
14
14
|
* @tsplus fluent effect/platform/Http/Client schemaJsonBody
|
|
15
15
|
*/
|
|
16
|
-
export declare const schemaJsonBody: <R, To, From, A, B>(client: HttpClient.Client<A, B, ClientResponse>, schema: Schema<To, From, R>) => HttpClient.Client<R | A, HttpClientError.ResponseError |
|
|
16
|
+
export declare const schemaJsonBody: <R, To, From, A, B>(client: HttpClient.Client<A, B, ClientResponse>, schema: Schema<To, From, R>) => HttpClient.Client<R | A, HttpClientError.ResponseError | S.ParseResult.ParseError | B, To>;
|
|
17
17
|
/**
|
|
18
18
|
* @tsplus fluent effect/platform/Http/Client schemaJsonBodyUnsafe
|
|
19
19
|
*/
|
|
@@ -25,7 +25,7 @@ export declare const responseWithSchemaBody: <R, From extends {
|
|
|
25
25
|
readonly status?: number;
|
|
26
26
|
readonly headers?: Headers;
|
|
27
27
|
readonly body?: unknown;
|
|
28
|
-
}, To, A, B>(client: HttpClient.Client<A, B, ClientResponse>, schema: Schema<To, From, R>) => HttpClient.Client<R | A, HttpClientError.ResponseError |
|
|
28
|
+
}, To, A, B>(client: HttpClient.Client<A, B, ClientResponse>, schema: Schema<To, From, R>) => HttpClient.Client<R | A, HttpClientError.ResponseError | S.ParseResult.ParseError | B, {
|
|
29
29
|
body: To;
|
|
30
30
|
headers: Headers;
|
|
31
31
|
status: number;
|
package/dist/client/errors.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { S } from "../lib.js";
|
|
2
2
|
declare const NotFoundError_base: import("@effect/schema/Schema").Class<{
|
|
3
3
|
readonly _tag: "NotFoundError";
|
|
4
|
-
readonly id: unknown;
|
|
5
4
|
readonly type: string;
|
|
5
|
+
readonly id: unknown;
|
|
6
6
|
}, {
|
|
7
7
|
readonly _tag: "NotFoundError";
|
|
8
|
-
readonly id: unknown;
|
|
9
8
|
readonly type: string;
|
|
10
|
-
}, never, {
|
|
11
9
|
readonly id: unknown;
|
|
10
|
+
}, never, {
|
|
12
11
|
readonly type: string;
|
|
12
|
+
readonly id: unknown;
|
|
13
13
|
}, NotFoundError<ItemType>, {
|
|
14
14
|
type: S.Schema<string, string, never>;
|
|
15
15
|
id: S.Schema<unknown, unknown, never>;
|
|
@@ -130,16 +130,16 @@ export declare class OptimisticConcurrencyException extends OptimisticConcurrenc
|
|
|
130
130
|
message: string;
|
|
131
131
|
}, disableValidation?: boolean);
|
|
132
132
|
}
|
|
133
|
-
export declare const SupportedErrors: S.Schema<
|
|
134
|
-
readonly _tag: "NotFoundError";
|
|
135
|
-
readonly id: unknown;
|
|
136
|
-
readonly type: string;
|
|
137
|
-
} | {
|
|
133
|
+
export declare const SupportedErrors: S.Schema<InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | LoginError | UnauthorizedError | ValidationError, {
|
|
138
134
|
readonly _tag: "InvalidStateError";
|
|
139
135
|
readonly message: string;
|
|
140
136
|
} | {
|
|
141
|
-
readonly _tag: "
|
|
142
|
-
readonly
|
|
137
|
+
readonly _tag: "OptimisticConcurrencyException";
|
|
138
|
+
readonly message: string;
|
|
139
|
+
} | {
|
|
140
|
+
readonly _tag: "NotFoundError";
|
|
141
|
+
readonly type: string;
|
|
142
|
+
readonly id: unknown;
|
|
143
143
|
} | {
|
|
144
144
|
readonly _tag: "NotLoggedInError";
|
|
145
145
|
readonly message?: string | undefined;
|
|
@@ -150,20 +150,20 @@ export declare const SupportedErrors: S.Schema<NotFoundError<ItemType> | Invalid
|
|
|
150
150
|
readonly _tag: "UnauthorizedError";
|
|
151
151
|
readonly message?: string | undefined;
|
|
152
152
|
} | {
|
|
153
|
-
readonly _tag: "
|
|
154
|
-
readonly
|
|
153
|
+
readonly _tag: "ValidationError";
|
|
154
|
+
readonly errors: readonly unknown[];
|
|
155
155
|
}, never>;
|
|
156
156
|
export type SupportedErrors = S.Schema.To<typeof SupportedErrors>;
|
|
157
|
-
export declare const MutationErrors: S.Schema<
|
|
158
|
-
readonly _tag: "NotFoundError";
|
|
159
|
-
readonly id: unknown;
|
|
160
|
-
readonly type: string;
|
|
161
|
-
} | {
|
|
157
|
+
export declare const MutationErrors: S.Schema<InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | LoginError | UnauthorizedError | ValidationError, {
|
|
162
158
|
readonly _tag: "InvalidStateError";
|
|
163
159
|
readonly message: string;
|
|
164
160
|
} | {
|
|
165
|
-
readonly _tag: "
|
|
166
|
-
readonly
|
|
161
|
+
readonly _tag: "OptimisticConcurrencyException";
|
|
162
|
+
readonly message: string;
|
|
163
|
+
} | {
|
|
164
|
+
readonly _tag: "NotFoundError";
|
|
165
|
+
readonly type: string;
|
|
166
|
+
readonly id: unknown;
|
|
167
167
|
} | {
|
|
168
168
|
readonly _tag: "NotLoggedInError";
|
|
169
169
|
readonly message?: string | undefined;
|
|
@@ -174,19 +174,19 @@ export declare const MutationErrors: S.Schema<NotFoundError<ItemType> | InvalidS
|
|
|
174
174
|
readonly _tag: "UnauthorizedError";
|
|
175
175
|
readonly message?: string | undefined;
|
|
176
176
|
} | {
|
|
177
|
-
readonly _tag: "
|
|
178
|
-
readonly
|
|
177
|
+
readonly _tag: "ValidationError";
|
|
178
|
+
readonly errors: readonly unknown[];
|
|
179
179
|
}, never>;
|
|
180
|
-
export declare const QueryErrors: S.Schema<
|
|
181
|
-
readonly _tag: "NotFoundError";
|
|
182
|
-
readonly id: unknown;
|
|
183
|
-
readonly type: string;
|
|
184
|
-
} | {
|
|
180
|
+
export declare const QueryErrors: S.Schema<InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | LoginError | UnauthorizedError | ValidationError, {
|
|
185
181
|
readonly _tag: "InvalidStateError";
|
|
186
182
|
readonly message: string;
|
|
187
183
|
} | {
|
|
188
|
-
readonly _tag: "
|
|
189
|
-
readonly
|
|
184
|
+
readonly _tag: "OptimisticConcurrencyException";
|
|
185
|
+
readonly message: string;
|
|
186
|
+
} | {
|
|
187
|
+
readonly _tag: "NotFoundError";
|
|
188
|
+
readonly type: string;
|
|
189
|
+
readonly id: unknown;
|
|
190
190
|
} | {
|
|
191
191
|
readonly _tag: "NotLoggedInError";
|
|
192
192
|
readonly message?: string | undefined;
|
|
@@ -197,8 +197,8 @@ export declare const QueryErrors: S.Schema<NotFoundError<ItemType> | InvalidStat
|
|
|
197
197
|
readonly _tag: "UnauthorizedError";
|
|
198
198
|
readonly message?: string | undefined;
|
|
199
199
|
} | {
|
|
200
|
-
readonly _tag: "
|
|
201
|
-
readonly
|
|
200
|
+
readonly _tag: "ValidationError";
|
|
201
|
+
readonly errors: readonly unknown[];
|
|
202
202
|
}, never>;
|
|
203
203
|
export type MutationErrors = S.Schema.To<typeof MutationErrors>;
|
|
204
204
|
export type QueryErrors = S.Schema.To<typeof QueryErrors>;
|
package/dist/client/fetch.d.ts
CHANGED
|
@@ -16,12 +16,12 @@ export declare function fetchApi(method: Method, path: string, body?: unknown):
|
|
|
16
16
|
status: number;
|
|
17
17
|
body: unknown;
|
|
18
18
|
headers: import("@effect/platform/Http/Headers").Headers;
|
|
19
|
-
} | FetchResponse<unknown>,
|
|
19
|
+
} | FetchResponse<unknown>, HttpRequestError | InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | ValidationError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, HttpClient.Client.Default | ApiConfig>;
|
|
20
20
|
export declare function fetchApi2S<RequestR, RequestFrom, RequestTo, ResponseR, ResponseFrom, ResponseTo>(request: Schema<RequestTo, RequestFrom, RequestR>, response: Schema<ResponseTo, ResponseFrom, ResponseR>): (method: Method, path: Path) => (req: RequestTo) => Effect.Effect<{
|
|
21
21
|
body: ResponseTo;
|
|
22
22
|
headers: Headers;
|
|
23
23
|
status: number;
|
|
24
|
-
},
|
|
24
|
+
}, HttpRequestError | ResError | InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | ValidationError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError | S.ParseResult.ParseError, HttpClient.Client.Default | ApiConfig | RequestR | ResponseR>;
|
|
25
25
|
export declare function fetchApi3S<RequestA, RequestE, ResponseE = unknown, ResponseA = void>({ Request, Response }: {
|
|
26
26
|
Request: REST.RequestSchemed<RequestA, RequestE>;
|
|
27
27
|
Response: REST.ReqRes<ResponseA, ResponseE, any>;
|
|
@@ -29,11 +29,11 @@ export declare function fetchApi3S<RequestA, RequestE, ResponseE = unknown, Resp
|
|
|
29
29
|
body: ResponseA;
|
|
30
30
|
headers: Headers;
|
|
31
31
|
status: number;
|
|
32
|
-
},
|
|
32
|
+
}, HttpRequestError | ResError | InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | ValidationError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError | S.ParseResult.ParseError, any>;
|
|
33
33
|
export declare function fetchApi3SE<RequestA, RequestE, ResponseE = unknown, ResponseA = void>({ Request, Response }: {
|
|
34
34
|
Request: REST.RequestSchemed<RequestA, RequestE>;
|
|
35
35
|
Response: REST.ReqRes<ResponseA, ResponseE, any>;
|
|
36
|
-
}): (req: RequestA) => Effect.Effect<FetchResponse<ResponseE>,
|
|
36
|
+
}): (req: RequestA) => Effect.Effect<FetchResponse<ResponseE>, HttpRequestError | ResError | InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | ValidationError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError | S.ParseResult.ParseError, any>;
|
|
37
37
|
export declare function makePathWithQuery(path: Path, pars: Record<string, string | number | boolean | readonly string[] | readonly number[] | readonly boolean[] | null>): string;
|
|
38
38
|
export declare function makePathWithBody(path: Path, pars: Record<string, string | number | boolean | readonly string[] | readonly number[] | readonly boolean[] | null>): string;
|
|
39
39
|
export declare function mapResponse<T, A>(map: (t: T) => A): (r: FetchResponse<T>) => FetchResponse<A>;
|
package/dist/service.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ export type ServiceAcessorShape<Self, Type> = {
|
|
|
32
32
|
} & {
|
|
33
33
|
use: <X>(body: (_: Type) => X) => X extends Effect<infer A, infer E, infer R> ? Effect<A, E, R | Self> : Effect<X, never, Self>;
|
|
34
34
|
};
|
|
35
|
-
export declare const proxify: <T extends object>(TagClass: T) => <Self, Shape>() => T & { [k in keyof Shape as Shape[k] extends (...args_0: infer Args) => infer Ret ? ((...args: Readonly<Args>) => Ret) extends Shape[k] ? k : never : k]: Shape[k] extends (...args_0: infer Args_1) => Effect<infer A, infer E, infer R> ? (...args: Readonly<Args_1>) => Effect<A, E,
|
|
36
|
-
use: <X>(body: (_: Shape) => X) => X extends Effect<infer A_3, infer E_2, infer R_2> ? Effect<A_3, E_2,
|
|
35
|
+
export declare const proxify: <T extends object>(TagClass: T) => <Self, Shape>() => T & { [k in keyof Shape as Shape[k] extends (...args_0: infer Args) => infer Ret ? ((...args: Readonly<Args>) => Ret) extends Shape[k] ? k : never : k]: Shape[k] extends (...args_0: infer Args_1) => Effect<infer A, infer E, infer R> ? (...args: Readonly<Args_1>) => Effect<A, E, Self | R> : Shape[k] extends (...args_0: infer Args_2) => infer A_1 ? (...args: Readonly<Args_2>) => Effect<A_1, never, Self> : Shape[k] extends Effect<infer A_2, infer E_1, infer R_1> ? Effect<A_2, E_1, Self | R_1> : Effect<Shape[k], never, Self>; } & {
|
|
36
|
+
use: <X>(body: (_: Shape) => X) => X extends Effect<infer A_3, infer E_2, infer R_2> ? Effect<A_3, E_2, Self | R_2> : Effect<X, never, Self>;
|
|
37
37
|
};
|
|
38
38
|
export declare const TagMake: <ServiceImpl, R, E, const Key extends string>(key: Key, make: Effect<ServiceImpl, E, R>) => <Id>() => {
|
|
39
39
|
new (): Context.TagClassShape<Key, ServiceImpl>;
|
|
@@ -77,7 +77,7 @@ export declare const TagClassMakeId: <ServiceImpl, R, E, const Key extends strin
|
|
|
77
77
|
};
|
|
78
78
|
wrap: (service: ServiceImpl) => Id;
|
|
79
79
|
make: Effect<Id, E, R>;
|
|
80
|
-
} & Context.Tag<Id, Id> & { [k in keyof ServiceImpl as ServiceImpl[k] extends (...args_0: infer Args) => infer Ret ? ((...args: Readonly<Args>) => Ret) extends ServiceImpl[k] ? k : never : k]: ServiceImpl[k] extends (...args_0: infer Args_1) => Effect<infer A, infer E_3, infer R_3> ? (...args: Readonly<Args_1>) => Effect<A, E_3,
|
|
81
|
-
use: <X>(body: (_: ServiceImpl) => X) => X extends Effect<infer A_3, infer E_5, infer R_5> ? Effect<A_3, E_5,
|
|
80
|
+
} & Context.Tag<Id, Id> & { [k in keyof ServiceImpl as ServiceImpl[k] extends (...args_0: infer Args) => infer Ret ? ((...args: Readonly<Args>) => Ret) extends ServiceImpl[k] ? k : never : k]: ServiceImpl[k] extends (...args_0: infer Args_1) => Effect<infer A, infer E_3, infer R_3> ? (...args: Readonly<Args_1>) => Effect<A, E_3, Id | R_3> : ServiceImpl[k] extends (...args_0: infer Args_2) => infer A_1 ? (...args: Readonly<Args_2>) => Effect<A_1, never, Id> : ServiceImpl[k] extends Effect<infer A_2, infer E_4, infer R_4> ? Effect<A_2, E_4, Id | R_4> : Effect<ServiceImpl[k], never, Id>; } & {
|
|
81
|
+
use: <X>(body: (_: ServiceImpl) => X) => X extends Effect<infer A_3, infer E_5, infer R_5> ? Effect<A_3, E_5, Id | R_5> : Effect<X, never, Id>;
|
|
82
82
|
};
|
|
83
83
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -51,7 +51,7 @@ declare const FiberBag_base: {
|
|
|
51
51
|
run: <R, XE extends never, XA extends never>(effect: Effect.Effect<XA, XE, R>) => Effect.Effect<Fiber.RuntimeFiber<XA, XE>, never, R>;
|
|
52
52
|
add: (...fibers: Fiber.RuntimeFiber<never, never>[]) => Effect.Effect<void, never, never>;
|
|
53
53
|
addAll: (fibers: readonly Fiber.RuntimeFiber<never, never>[]) => Effect.Effect<void, never, never>;
|
|
54
|
-
}) => X) => X extends Effect<infer A, infer E_2, infer R_3> ? Effect<A, E_2,
|
|
54
|
+
}) => X) => X extends Effect<infer A, infer E_2, infer R_3> ? Effect<A, E_2, FiberBag | R_3> : Effect<X, never, FiberBag>;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* Whenever you fork long running fibers e.g via `Effect.forkScoped` or `Effect.forkDaemon`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-app",
|
|
3
|
-
"version": "0.181.
|
|
3
|
+
"version": "0.181.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"ts-pattern": "^5.0.8",
|
|
14
14
|
"uuid": "^9.0.1",
|
|
15
15
|
"validator": "^13.11.0",
|
|
16
|
-
"@effect-app/core": "0.150.
|
|
17
|
-
"@effect-app/
|
|
18
|
-
"@effect-app/
|
|
16
|
+
"@effect-app/core": "0.150.4",
|
|
17
|
+
"@effect-app/schema": "0.202.4",
|
|
18
|
+
"@effect-app/fluent-extensions": "0.143.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@babel/cli": "^7.23.9",
|