effect-app 0.181.3 → 0.181.5

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @effect-app/prelude
2
2
 
3
+ ## 0.181.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [09bc0d5]
8
+ - @effect-app/schema@0.203.1
9
+
10
+ ## 0.181.4
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [e355a45]
15
+ - @effect-app/schema@0.203.0
16
+
3
17
  ## 0.181.3
4
18
 
5
19
  ### Patch Changes
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 | S.ParseResult.ParseError | B, To>;
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 | B | S.ParseResult.ParseError, 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 | S.ParseResult.ParseError | B, {
28
+ }, To, A, B>(client: HttpClient.Client<A, B, ClientResponse>, schema: Schema<To, From, R>) => HttpClient.Client<R | A, HttpClientError.ResponseError | B | S.ParseResult.ParseError, {
29
29
  body: To;
30
30
  headers: Headers;
31
31
  status: number;
@@ -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 type: string;
5
4
  readonly id: unknown;
5
+ readonly type: string;
6
6
  }, {
7
7
  readonly _tag: "NotFoundError";
8
- readonly type: string;
9
8
  readonly id: unknown;
10
- }, never, {
11
9
  readonly type: string;
10
+ }, never, {
12
11
  readonly id: unknown;
12
+ readonly type: string;
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<InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | LoginError | UnauthorizedError | ValidationError, {
134
- readonly _tag: "InvalidStateError";
135
- readonly message: string;
133
+ export declare const SupportedErrors: S.Schema<NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | LoginError | UnauthorizedError | OptimisticConcurrencyException, {
134
+ readonly _tag: "NotFoundError";
135
+ readonly id: unknown;
136
+ readonly type: string;
136
137
  } | {
137
- readonly _tag: "OptimisticConcurrencyException";
138
+ readonly _tag: "InvalidStateError";
138
139
  readonly message: string;
139
140
  } | {
140
- readonly _tag: "NotFoundError";
141
- readonly type: string;
142
- readonly id: unknown;
141
+ readonly _tag: "ValidationError";
142
+ readonly errors: readonly unknown[];
143
143
  } | {
144
144
  readonly _tag: "NotLoggedInError";
145
145
  readonly message?: string | undefined;
@@ -150,20 +150,20 @@ export declare const SupportedErrors: S.Schema<InvalidStateError | OptimisticCon
150
150
  readonly _tag: "UnauthorizedError";
151
151
  readonly message?: string | undefined;
152
152
  } | {
153
- readonly _tag: "ValidationError";
154
- readonly errors: readonly unknown[];
153
+ readonly _tag: "OptimisticConcurrencyException";
154
+ readonly message: string;
155
155
  }, never>;
156
156
  export type SupportedErrors = S.Schema.To<typeof SupportedErrors>;
157
- export declare const MutationErrors: S.Schema<InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | LoginError | UnauthorizedError | ValidationError, {
158
- readonly _tag: "InvalidStateError";
159
- readonly message: string;
157
+ export declare const MutationErrors: S.Schema<NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | LoginError | UnauthorizedError | OptimisticConcurrencyException, {
158
+ readonly _tag: "NotFoundError";
159
+ readonly id: unknown;
160
+ readonly type: string;
160
161
  } | {
161
- readonly _tag: "OptimisticConcurrencyException";
162
+ readonly _tag: "InvalidStateError";
162
163
  readonly message: string;
163
164
  } | {
164
- readonly _tag: "NotFoundError";
165
- readonly type: string;
166
- readonly id: unknown;
165
+ readonly _tag: "ValidationError";
166
+ readonly errors: readonly unknown[];
167
167
  } | {
168
168
  readonly _tag: "NotLoggedInError";
169
169
  readonly message?: string | undefined;
@@ -173,20 +173,20 @@ export declare const MutationErrors: S.Schema<InvalidStateError | OptimisticConc
173
173
  } | {
174
174
  readonly _tag: "UnauthorizedError";
175
175
  readonly message?: string | undefined;
176
- } | {
177
- readonly _tag: "ValidationError";
178
- readonly errors: readonly unknown[];
179
- }, never>;
180
- export declare const QueryErrors: S.Schema<InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | LoginError | UnauthorizedError | ValidationError, {
181
- readonly _tag: "InvalidStateError";
182
- readonly message: string;
183
176
  } | {
184
177
  readonly _tag: "OptimisticConcurrencyException";
185
178
  readonly message: string;
186
- } | {
179
+ }, never>;
180
+ export declare const QueryErrors: S.Schema<NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | LoginError | UnauthorizedError | OptimisticConcurrencyException, {
187
181
  readonly _tag: "NotFoundError";
188
- readonly type: string;
189
182
  readonly id: unknown;
183
+ readonly type: string;
184
+ } | {
185
+ readonly _tag: "InvalidStateError";
186
+ readonly message: string;
187
+ } | {
188
+ readonly _tag: "ValidationError";
189
+ readonly errors: readonly unknown[];
190
190
  } | {
191
191
  readonly _tag: "NotLoggedInError";
192
192
  readonly message?: string | undefined;
@@ -197,8 +197,8 @@ export declare const QueryErrors: S.Schema<InvalidStateError | OptimisticConcurr
197
197
  readonly _tag: "UnauthorizedError";
198
198
  readonly message?: string | undefined;
199
199
  } | {
200
- readonly _tag: "ValidationError";
201
- readonly errors: readonly unknown[];
200
+ readonly _tag: "OptimisticConcurrencyException";
201
+ readonly message: string;
202
202
  }, never>;
203
203
  export type MutationErrors = S.Schema.To<typeof MutationErrors>;
204
204
  export type QueryErrors = S.Schema.To<typeof QueryErrors>;
@@ -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>, HttpRequestError | InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | ValidationError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, HttpClient.Client.Default | ApiConfig>;
19
+ } | FetchResponse<unknown>, NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | 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
- }, 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>;
24
+ }, S.ParseResult.ParseError | NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, 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
- }, 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>;
32
+ }, S.ParseResult.ParseError | NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, 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>, 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>;
36
+ }): (req: RequestA) => Effect.Effect<FetchResponse<ResponseE>, S.ParseResult.ParseError | NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-app",
3
- "version": "0.181.3",
3
+ "version": "0.181.5",
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/schema": "0.202.5",
17
16
  "@effect-app/core": "0.150.5",
18
- "@effect-app/fluent-extensions": "0.143.4"
17
+ "@effect-app/fluent-extensions": "0.143.4",
18
+ "@effect-app/schema": "0.203.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@babel/cli": "^7.23.9",