effect-app 2.27.0 → 2.28.0
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 +6 -0
- package/package.json +1 -5
- package/dist/http/http-client.d.ts +0 -43
- package/dist/http/http-client.d.ts.map +0 -1
- package/dist/http/http-client.js +0 -30
- package/src/http/http-client.ts +0 -73
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -219,10 +219,6 @@
|
|
|
219
219
|
"types": "./dist/http/Request.d.ts",
|
|
220
220
|
"default": "./dist/http/Request.js"
|
|
221
221
|
},
|
|
222
|
-
"./http/http-client": {
|
|
223
|
-
"types": "./dist/http/http-client.d.ts",
|
|
224
|
-
"default": "./dist/http/http-client.js"
|
|
225
|
-
},
|
|
226
222
|
"./ids": {
|
|
227
223
|
"types": "./dist/ids.d.ts",
|
|
228
224
|
"default": "./dist/ids.js"
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Option } from "../Option.js";
|
|
2
|
-
export declare const Method: {
|
|
3
|
-
GET: null;
|
|
4
|
-
POST: null;
|
|
5
|
-
PUT: null;
|
|
6
|
-
DELETE: null;
|
|
7
|
-
PATCH: null;
|
|
8
|
-
};
|
|
9
|
-
export type Method = keyof typeof Method;
|
|
10
|
-
/** @deprecated use @effect/platform */
|
|
11
|
-
export type Headers = Record<string, string>;
|
|
12
|
-
/** @deprecated use @effect/platform */
|
|
13
|
-
export interface Response<Body> {
|
|
14
|
-
body: Option<Body>;
|
|
15
|
-
headers: Headers;
|
|
16
|
-
status: number;
|
|
17
|
-
}
|
|
18
|
-
/** @deprecated use @effect/platform */
|
|
19
|
-
export declare const HttpErrorReason: {
|
|
20
|
-
readonly Request: "HttpErrorRequest";
|
|
21
|
-
readonly Response: "HttpErrorResponse";
|
|
22
|
-
};
|
|
23
|
-
/** @deprecated use @effect/platform */
|
|
24
|
-
export type HttpErrorReason = typeof HttpErrorReason;
|
|
25
|
-
/** @deprecated use @effect/platform */
|
|
26
|
-
export interface HttpResponseError<ErrorBody> {
|
|
27
|
-
_tag: HttpErrorReason["Response"];
|
|
28
|
-
response: Response<ErrorBody>;
|
|
29
|
-
}
|
|
30
|
-
/** @deprecated use @effect/platform */
|
|
31
|
-
export declare function isHttpResponseError(u: unknown): u is HttpResponseError<unknown>;
|
|
32
|
-
/** @deprecated use @effect/platform */
|
|
33
|
-
export interface HttpRequestError {
|
|
34
|
-
_tag: HttpErrorReason["Request"];
|
|
35
|
-
error: Error;
|
|
36
|
-
}
|
|
37
|
-
/** @deprecated use @effect/platform */
|
|
38
|
-
export declare function isHttpRequestError(u: unknown): u is HttpRequestError;
|
|
39
|
-
/** @deprecated use @effect/platform */
|
|
40
|
-
export declare function isHttpError(u: unknown): u is HttpError<unknown>;
|
|
41
|
-
/** @deprecated use @effect/platform */
|
|
42
|
-
export type HttpError<ErrorBody> = HttpRequestError | HttpResponseError<ErrorBody>;
|
|
43
|
-
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/http/http-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAA;AACD,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,MAAM,CAAA;AAExC,uCAAuC;AACvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE5C,uCAAuC;AACvC,MAAM,WAAW,QAAQ,CAAC,IAAI;IAC5B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,uCAAuC;AACvC,eAAO,MAAM,eAAe;;;CAGlB,CAAA;AAEV,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAA;AAEpD,uCAAuC;AACvC,MAAM,WAAW,iBAAiB,CAAC,SAAS;IAC1C,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjC,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;CAC9B;AAED,uCAAuC;AACvC,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAMjC;AAED,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;IAChC,KAAK,EAAE,KAAK,CAAA;CACb;AAED,uCAAuC;AACvC,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,gBAAgB,CAMpE;AAED,uCAAuC;AACvC,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,CAE/D;AAED,uCAAuC;AACvC,MAAM,MAAM,SAAS,CAAC,SAAS,IAC3B,gBAAgB,GAChB,iBAAiB,CAAC,SAAS,CAAC,CAAA"}
|
package/dist/http/http-client.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
export const Method = {
|
|
3
|
-
GET: null,
|
|
4
|
-
POST: null,
|
|
5
|
-
PUT: null,
|
|
6
|
-
DELETE: null,
|
|
7
|
-
PATCH: null
|
|
8
|
-
};
|
|
9
|
-
/** @deprecated use @effect/platform */
|
|
10
|
-
export const HttpErrorReason = {
|
|
11
|
-
Request: "HttpErrorRequest",
|
|
12
|
-
Response: "HttpErrorResponse"
|
|
13
|
-
};
|
|
14
|
-
/** @deprecated use @effect/platform */
|
|
15
|
-
export function isHttpResponseError(u) {
|
|
16
|
-
return (typeof u === "object"
|
|
17
|
-
&& u !== null
|
|
18
|
-
&& u["_tag"] === HttpErrorReason.Response);
|
|
19
|
-
}
|
|
20
|
-
/** @deprecated use @effect/platform */
|
|
21
|
-
export function isHttpRequestError(u) {
|
|
22
|
-
return (typeof u === "object"
|
|
23
|
-
&& u !== null
|
|
24
|
-
&& u["_tag"] === HttpErrorReason.Request);
|
|
25
|
-
}
|
|
26
|
-
/** @deprecated use @effect/platform */
|
|
27
|
-
export function isHttpError(u) {
|
|
28
|
-
return isHttpRequestError(u) || isHttpResponseError(u);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cC1jbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaHR0cC9odHRwLWNsaWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1REFBdUQ7QUFJdkQsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHO0lBQ3BCLEdBQUcsRUFBRSxJQUFJO0lBQ1QsSUFBSSxFQUFFLElBQUk7SUFDVixHQUFHLEVBQUUsSUFBSTtJQUNULE1BQU0sRUFBRSxJQUFJO0lBQ1osS0FBSyxFQUFFLElBQUk7Q0FDWixDQUFBO0FBYUQsdUNBQXVDO0FBQ3ZDLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBRztJQUM3QixPQUFPLEVBQUUsa0JBQWtCO0lBQzNCLFFBQVEsRUFBRSxtQkFBbUI7Q0FDckIsQ0FBQTtBQVdWLHVDQUF1QztBQUN2QyxNQUFNLFVBQVUsbUJBQW1CLENBQ2pDLENBQVU7SUFFVixPQUFPLENBQ0wsT0FBTyxDQUFDLEtBQUssUUFBUTtXQUNsQixDQUFDLEtBQUssSUFBSTtXQUNULENBQVMsQ0FBQyxNQUFNLENBQUMsS0FBSyxlQUFlLENBQUMsUUFBUSxDQUNuRCxDQUFBO0FBQ0gsQ0FBQztBQVFELHVDQUF1QztBQUN2QyxNQUFNLFVBQVUsa0JBQWtCLENBQUMsQ0FBVTtJQUMzQyxPQUFPLENBQ0wsT0FBTyxDQUFDLEtBQUssUUFBUTtXQUNsQixDQUFDLEtBQUssSUFBSTtXQUNULENBQVMsQ0FBQyxNQUFNLENBQUMsS0FBSyxlQUFlLENBQUMsT0FBTyxDQUNsRCxDQUFBO0FBQ0gsQ0FBQztBQUVELHVDQUF1QztBQUN2QyxNQUFNLFVBQVUsV0FBVyxDQUFDLENBQVU7SUFDcEMsT0FBTyxrQkFBa0IsQ0FBQyxDQUFDLENBQUMsSUFBSSxtQkFBbUIsQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUN4RCxDQUFDIn0=
|
package/src/http/http-client.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
|
|
3
|
-
import type { Option } from "../Option.js"
|
|
4
|
-
|
|
5
|
-
export const Method = {
|
|
6
|
-
GET: null,
|
|
7
|
-
POST: null,
|
|
8
|
-
PUT: null,
|
|
9
|
-
DELETE: null,
|
|
10
|
-
PATCH: null
|
|
11
|
-
}
|
|
12
|
-
export type Method = keyof typeof Method
|
|
13
|
-
|
|
14
|
-
/** @deprecated use @effect/platform */
|
|
15
|
-
export type Headers = Record<string, string>
|
|
16
|
-
|
|
17
|
-
/** @deprecated use @effect/platform */
|
|
18
|
-
export interface Response<Body> {
|
|
19
|
-
body: Option<Body>
|
|
20
|
-
headers: Headers
|
|
21
|
-
status: number
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** @deprecated use @effect/platform */
|
|
25
|
-
export const HttpErrorReason = {
|
|
26
|
-
Request: "HttpErrorRequest",
|
|
27
|
-
Response: "HttpErrorResponse"
|
|
28
|
-
} as const
|
|
29
|
-
|
|
30
|
-
/** @deprecated use @effect/platform */
|
|
31
|
-
export type HttpErrorReason = typeof HttpErrorReason
|
|
32
|
-
|
|
33
|
-
/** @deprecated use @effect/platform */
|
|
34
|
-
export interface HttpResponseError<ErrorBody> {
|
|
35
|
-
_tag: HttpErrorReason["Response"]
|
|
36
|
-
response: Response<ErrorBody>
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** @deprecated use @effect/platform */
|
|
40
|
-
export function isHttpResponseError(
|
|
41
|
-
u: unknown
|
|
42
|
-
): u is HttpResponseError<unknown> {
|
|
43
|
-
return (
|
|
44
|
-
typeof u === "object"
|
|
45
|
-
&& u !== null
|
|
46
|
-
&& (u as any)["_tag"] === HttpErrorReason.Response
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** @deprecated use @effect/platform */
|
|
51
|
-
export interface HttpRequestError {
|
|
52
|
-
_tag: HttpErrorReason["Request"]
|
|
53
|
-
error: Error
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** @deprecated use @effect/platform */
|
|
57
|
-
export function isHttpRequestError(u: unknown): u is HttpRequestError {
|
|
58
|
-
return (
|
|
59
|
-
typeof u === "object"
|
|
60
|
-
&& u !== null
|
|
61
|
-
&& (u as any)["_tag"] === HttpErrorReason.Request
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** @deprecated use @effect/platform */
|
|
66
|
-
export function isHttpError(u: unknown): u is HttpError<unknown> {
|
|
67
|
-
return isHttpRequestError(u) || isHttpResponseError(u)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** @deprecated use @effect/platform */
|
|
71
|
-
export type HttpError<ErrorBody> =
|
|
72
|
-
| HttpRequestError
|
|
73
|
-
| HttpResponseError<ErrorBody>
|