effect-app 0.185.1 → 0.185.3
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,20 @@
|
|
|
1
1
|
# @effect-app/prelude
|
|
2
2
|
|
|
3
|
+
## 0.185.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f385129: fix legacy struct use
|
|
8
|
+
- Updated dependencies [f385129]
|
|
9
|
+
- @effect-app/schema@0.206.3
|
|
10
|
+
|
|
11
|
+
## 0.185.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [fe910fe]
|
|
16
|
+
- @effect-app/schema@0.206.2
|
|
17
|
+
|
|
3
18
|
## 0.185.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/Operations.d.ts
CHANGED
|
@@ -20,15 +20,7 @@ declare const OperationProgress_base: S.EnhancedClass<OperationProgress, {
|
|
|
20
20
|
}, OperationProgress.From, never, {
|
|
21
21
|
readonly completed: number & S.NonNegativeIntBrand;
|
|
22
22
|
readonly total: number & S.NonNegativeIntBrand;
|
|
23
|
-
}, {}, {}
|
|
24
|
-
readonly structFrom: S.Schema<{
|
|
25
|
-
readonly completed: number & S.NonNegativeIntBrand;
|
|
26
|
-
readonly total: number & S.NonNegativeIntBrand;
|
|
27
|
-
}, {
|
|
28
|
-
readonly completed: number;
|
|
29
|
-
readonly total: number;
|
|
30
|
-
}, never>;
|
|
31
|
-
};
|
|
23
|
+
}, {}, {}>;
|
|
32
24
|
export declare class OperationProgress extends OperationProgress_base {
|
|
33
25
|
}
|
|
34
26
|
declare const Success_base: S.EnhancedClass<Success, {
|
|
@@ -38,15 +30,7 @@ declare const Success_base: S.EnhancedClass<Success, {
|
|
|
38
30
|
readonly message: (string & S.NonEmptyString2kBrand) | null;
|
|
39
31
|
}, Success.From, never, {
|
|
40
32
|
readonly message?: (string & S.NonEmptyString2kBrand) | null;
|
|
41
|
-
}, {}, {}
|
|
42
|
-
readonly structFrom: S.Schema<{
|
|
43
|
-
readonly _tag: "Success";
|
|
44
|
-
readonly message: (string & S.NonEmptyString2kBrand) | null;
|
|
45
|
-
}, {
|
|
46
|
-
readonly _tag: "Success";
|
|
47
|
-
readonly message: string | null;
|
|
48
|
-
}, never>;
|
|
49
|
-
};
|
|
33
|
+
}, {}, {}>;
|
|
50
34
|
export declare class Success extends Success_base {
|
|
51
35
|
}
|
|
52
36
|
declare const Failure_base: S.EnhancedClass<Failure, {
|
|
@@ -56,15 +40,7 @@ declare const Failure_base: S.EnhancedClass<Failure, {
|
|
|
56
40
|
readonly message: (string & S.NonEmptyString2kBrand) | null;
|
|
57
41
|
}, Failure.From, never, {
|
|
58
42
|
readonly message?: (string & S.NonEmptyString2kBrand) | null;
|
|
59
|
-
}, {}, {}
|
|
60
|
-
readonly structFrom: S.Schema<{
|
|
61
|
-
readonly _tag: "Failure";
|
|
62
|
-
readonly message: (string & S.NonEmptyString2kBrand) | null;
|
|
63
|
-
}, {
|
|
64
|
-
readonly _tag: "Failure";
|
|
65
|
-
readonly message: string | null;
|
|
66
|
-
}, never>;
|
|
67
|
-
};
|
|
43
|
+
}, {}, {}>;
|
|
68
44
|
export declare class Failure extends Failure_base {
|
|
69
45
|
}
|
|
70
46
|
export declare const OperationResult: S.Schema<Success | Failure, Success.From | Failure.From, never> & {
|
|
@@ -96,58 +72,64 @@ declare const Operation_base: S.EnhancedClass<Operation, {
|
|
|
96
72
|
readonly result?: Success | Failure | undefined;
|
|
97
73
|
readonly createdAt?: Date;
|
|
98
74
|
readonly updatedAt?: Date | null;
|
|
99
|
-
}, {}, {}
|
|
100
|
-
readonly structFrom: S.Schema<{
|
|
101
|
-
readonly id: string & S.StringIdBrand;
|
|
102
|
-
readonly createdAt: Date;
|
|
103
|
-
readonly updatedAt: Date | null;
|
|
104
|
-
readonly progress?: OperationProgress | undefined;
|
|
105
|
-
readonly result?: Success | Failure | undefined;
|
|
106
|
-
}, {
|
|
107
|
-
readonly id: string;
|
|
108
|
-
readonly createdAt: string;
|
|
109
|
-
readonly updatedAt: string | null;
|
|
110
|
-
readonly progress?: OperationProgress.From | undefined;
|
|
111
|
-
readonly result?: Success.From | Failure.From | undefined;
|
|
112
|
-
}, never>;
|
|
113
|
-
};
|
|
75
|
+
}, {}, {}>;
|
|
114
76
|
export declare class Operation extends Operation_base {
|
|
115
77
|
}
|
|
116
78
|
export declare namespace OperationProgress {
|
|
117
|
-
const From_base: S.FromClass<{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
79
|
+
const From_base: S.FromClass<S.Struct.Encoded<{
|
|
80
|
+
completed: S.WithDefaults<S.Schema<number & S.NonNegativeIntBrand, number, never>> & S.Schema<number & S.NonNegativeIntBrand, number, never> & {
|
|
81
|
+
withDefault: S.PropertySignature<":", number & S.NonNegativeIntBrand, never, ":", number, true, never>;
|
|
82
|
+
};
|
|
83
|
+
total: S.WithDefaults<S.Schema<number & S.NonNegativeIntBrand, number, never>> & S.Schema<number & S.NonNegativeIntBrand, number, never> & {
|
|
84
|
+
withDefault: S.PropertySignature<":", number & S.NonNegativeIntBrand, never, ":", number, true, never>;
|
|
85
|
+
};
|
|
86
|
+
}, never>>;
|
|
121
87
|
export class From extends From_base {
|
|
122
88
|
}
|
|
123
89
|
export {};
|
|
124
90
|
}
|
|
125
91
|
export declare namespace Success {
|
|
126
|
-
const From_base_1: S.FromClass<{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}>;
|
|
92
|
+
const From_base_1: S.FromClass<S.Struct.Encoded<{
|
|
93
|
+
message: S.PropertySignature<":", (string & S.NonEmptyString2kBrand) | null, never, ":", string | null, true, never>;
|
|
94
|
+
}, never>>;
|
|
130
95
|
export class From extends From_base_1 {
|
|
131
96
|
}
|
|
132
97
|
export {};
|
|
133
98
|
}
|
|
134
99
|
export declare namespace Failure {
|
|
135
|
-
const From_base_2: S.FromClass<{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}>;
|
|
100
|
+
const From_base_2: S.FromClass<S.Struct.Encoded<{
|
|
101
|
+
message: S.PropertySignature<":", (string & S.NonEmptyString2kBrand) | null, never, ":", string | null, true, never>;
|
|
102
|
+
}, never>>;
|
|
139
103
|
export class From extends From_base_2 {
|
|
140
104
|
}
|
|
141
105
|
export {};
|
|
142
106
|
}
|
|
143
107
|
export declare namespace Operation {
|
|
144
|
-
const From_base_3: S.FromClass<{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
108
|
+
const From_base_3: S.FromClass<S.Struct.Encoded<{
|
|
109
|
+
id: S.WithDefaults<S.Schema<string & S.StringIdBrand, string, never> & {
|
|
110
|
+
make: () => S.StringId;
|
|
111
|
+
withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
|
|
112
|
+
}> & S.Schema<string & S.StringIdBrand, string, never> & {
|
|
113
|
+
make: () => S.StringId;
|
|
114
|
+
withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
|
|
115
|
+
};
|
|
116
|
+
progress: S.PropertySignature<"?:", OperationProgress | undefined, never, "?:", OperationProgress.From | undefined, false, never>;
|
|
117
|
+
result: S.PropertySignature<"?:", Success | Failure | undefined, never, "?:", Success.From | Failure.From | undefined, false, never>;
|
|
118
|
+
createdAt: S.PropertySignature<":", Date, never, ":", string, true, never>;
|
|
119
|
+
updatedAt: S.PropertySignature<":", Date | null, never, ":", string | null, true, never>;
|
|
120
|
+
}, S.Struct.EncodedTokenKeys<{
|
|
121
|
+
id: S.WithDefaults<S.Schema<string & S.StringIdBrand, string, never> & {
|
|
122
|
+
make: () => S.StringId;
|
|
123
|
+
withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
|
|
124
|
+
}> & S.Schema<string & S.StringIdBrand, string, never> & {
|
|
125
|
+
make: () => S.StringId;
|
|
126
|
+
withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
|
|
127
|
+
};
|
|
128
|
+
progress: S.PropertySignature<"?:", OperationProgress | undefined, never, "?:", OperationProgress.From | undefined, false, never>;
|
|
129
|
+
result: S.PropertySignature<"?:", Success | Failure | undefined, never, "?:", Success.From | Failure.From | undefined, false, never>;
|
|
130
|
+
createdAt: S.PropertySignature<":", Date, never, ":", string, true, never>;
|
|
131
|
+
updatedAt: S.PropertySignature<":", Date | null, never, ":", string | null, true, never>;
|
|
132
|
+
}>>>;
|
|
151
133
|
export class From extends From_base_3 {
|
|
152
134
|
}
|
|
153
135
|
export {};
|
package/dist/Operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operations.d.ts","sourceRoot":"","sources":["../src/Operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAA;AAEhC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAA;AACpC,eAAO,MAAM,WAAW;;;;;;CAAa,CAAA
|
|
1
|
+
{"version":3,"file":"Operations.d.ts","sourceRoot":"","sources":["../src/Operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAA;AAEhC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAA;AACpC,eAAO,MAAM,WAAW;;;;;;CAAa,CAAA;;;;;;;;;;;;;;;AAErC,qBAAa,iBAAkB,SAAQ,sBAMrC;CAAG;;;;;;;;;AAEL,qBAAa,OAAQ,SAAQ,YAE3B;CAAG;;;;;;;;;AAEL,qBAAa,OAAQ,SAAQ,YAE3B;CAAG;AAEL,eAAO,MAAM,eAAe;;;CAAiD,CAAA;AAC7E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnE,qBAAa,SAAU,SAAQ,cAM7B;CAAG;AAKL,yBAAiB,iBAAiB,CAAC;;;;;;;;;IACjC,MAAM,OAAO,IAAK,SAAQ,SAAuC;KAAG;;CACrE;AACD,yBAAiB,OAAO,CAAC;;;;IACvB,MAAM,OAAO,IAAK,SAAQ,WAA6B;KAAG;;CAC3D;AACD,yBAAiB,OAAO,CAAC;;;;IACvB,MAAM,OAAO,IAAK,SAAQ,WAA6B;KAAG;;CAC3D;AACD,yBAAiB,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;IACzB,MAAM,OAAO,IAAK,SAAQ,WAA+B;KAAG;;CAC7D"}
|
|
@@ -2,6 +2,7 @@ import { Effect } from "@effect-app/core";
|
|
|
2
2
|
import type { Schema } from "effect-app/schema";
|
|
3
3
|
import { REST } from "effect-app/schema";
|
|
4
4
|
import type { HttpClient } from "../http.js";
|
|
5
|
+
import { S } from "../lib.js";
|
|
5
6
|
import type { ApiConfig } from "./config.js";
|
|
6
7
|
import type { SupportedErrors } from "./errors.js";
|
|
7
8
|
import type { FetchError, FetchResponse } from "./fetch.js";
|
|
@@ -13,8 +14,8 @@ export declare function clientFor<M extends Requests>(models: M): Client<Omit<M,
|
|
|
13
14
|
export type ExtractResponse<T> = T extends Schema<any, any, any> ? Schema.Type<T> : T extends unknown ? void : never;
|
|
14
15
|
export type ExtractEResponse<T> = T extends Schema<any, any, any> ? Schema.Encoded<T> : T extends unknown ? void : never;
|
|
15
16
|
type HasEmptyTo<T extends Schema<any, any, any>> = T extends {
|
|
16
|
-
|
|
17
|
-
} ? Schema.Type<T["
|
|
17
|
+
fields: S.Struct.Fields;
|
|
18
|
+
} ? Schema.Type<T["fields"]> extends Record<any, never> ? true : Schema.Type<T> extends Record<any, never> ? true : false : false;
|
|
18
19
|
type RequestHandlers<R, E, M extends Requests> = {
|
|
19
20
|
[K in keyof M]: HasEmptyTo<REST.GetRequest<M[K]>> extends true ? {
|
|
20
21
|
handler: Effect<FetchResponse<ExtractResponse<REST.GetResponse<M[K]>>>, E, R>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientFor.d.ts","sourceRoot":"","sources":["../../src/client/clientFor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAQ,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"clientFor.d.ts","sourceRoot":"","sources":["../../src/client/clientFor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAQ,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAOL,QAAQ,EACT,MAAM,YAAY,CAAA;AAEnB,cAAc,aAAa,CAAA;AAE3B,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAUnC,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,QAAQ,IACjC,eAAe,CACf,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,EACrC,eAAe,GAAG,UAAU,GAAG,QAAQ,EACvC,CAAC,CACF,GACC,gBAAgB,CAChB,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,EACrC,e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,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACvD,CAAC,EACD,CAAC,CACF,CAAA;QACD,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAChD,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,EAAE,MAAM,CAAA;KACb,GACC;QACA,OAAO,EAAE,CACP,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KACrC,MAAM,CACT,aAAa,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACvD,CAAC,EACD,CAAC,CACF,CAAA;QACD,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAChD,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,CAAA;QAC7D,IAAI,EAAE,MAAM,CAAA;KACb;CACJ,CAAA"}
|
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>, NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, HttpClient.Client.Default
|
|
19
|
+
} | FetchResponse<unknown>, NotFoundError<ItemType> | InvalidStateError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, ApiConfig | HttpClient.Client.Default>;
|
|
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
|
-
}, 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 |
|
|
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, ApiConfig | HttpClient.Client.Default | 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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-app",
|
|
3
|
-
"version": "0.185.
|
|
3
|
+
"version": "0.185.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"validator": "^13.11.0",
|
|
16
16
|
"@effect-app/core": "0.152.1",
|
|
17
17
|
"@effect-app/fluent-extensions": "0.146.0",
|
|
18
|
-
"@effect-app/schema": "0.206.
|
|
18
|
+
"@effect-app/schema": "0.206.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@babel/cli": "^7.23.9",
|
package/src/client/clientFor.ts
CHANGED
|
@@ -224,8 +224,8 @@ export type ExtractEResponse<T> = T extends Schema<any, any, any> ? Schema.Encod
|
|
|
224
224
|
: T extends unknown ? void
|
|
225
225
|
: never
|
|
226
226
|
|
|
227
|
-
type HasEmptyTo<T extends Schema<any, any, any>> = T extends {
|
|
228
|
-
? Schema.Type<T["
|
|
227
|
+
type HasEmptyTo<T extends Schema<any, any, any>> = T extends { fields: S.Struct.Fields }
|
|
228
|
+
? Schema.Type<T["fields"]> extends Record<any, never> ? true
|
|
229
229
|
: Schema.Type<T> extends Record<any, never> ? true
|
|
230
230
|
: false
|
|
231
231
|
: false
|