@effect-app/infra 4.0.0-beta.93 → 4.0.0-beta.95
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 +14 -0
- package/examples/query.ts +2 -2
- package/package.json +2 -2
- package/test/dist/fixtures.d.ts +4 -4
- package/test/dist/query.test.d.ts.map +1 -1
- package/test/query.test.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @effect-app/infra
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.95
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 88838fb: Remove pick/omit customizations from Class/TaggedClass/Struct/TaggedStruct. Use `Struct.pick(X.fields, [...])` from `effect-app` instead.
|
|
8
|
+
- Updated dependencies [88838fb]
|
|
9
|
+
- effect-app@4.0.0-beta.95
|
|
10
|
+
|
|
11
|
+
## 4.0.0-beta.94
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- effect-app@4.0.0-beta.94
|
|
16
|
+
|
|
3
17
|
## 4.0.0-beta.93
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/examples/query.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expectTypeOf } from "@effect/vitest"
|
|
2
|
-
import { Effect, Layer, ManagedRuntime, S } from "effect-app"
|
|
2
|
+
import { Effect, Layer, ManagedRuntime, S, Struct } from "effect-app"
|
|
3
3
|
import { makeRepo } from "../src/Model.js"
|
|
4
4
|
import { and, make, one, or, order, page, project, type QueryWhere, where } from "../src/Model/query.js"
|
|
5
5
|
import { MemoryStoreLive } from "../src/Store/Memory.js"
|
|
@@ -78,7 +78,7 @@ const program = Effect.gen(function*() {
|
|
|
78
78
|
order("displayName"),
|
|
79
79
|
page({ take: 1 }),
|
|
80
80
|
one,
|
|
81
|
-
project(
|
|
81
|
+
project(Something.mapFields(Struct.pick(["id", "displayName"])))
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
const r2 = yield* somethingRepo.query(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/infra",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.95",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"proper-lockfile": "^4.1.2",
|
|
14
14
|
"pure-rand": "7.0.1",
|
|
15
15
|
"query-string": "^9.3.1",
|
|
16
|
-
"effect-app": "4.0.0-beta.
|
|
16
|
+
"effect-app": "4.0.0-beta.95"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@azure/cosmos": "^4.9.2",
|
package/test/dist/fixtures.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Effect, Layer, S } from "effect-app";
|
|
2
2
|
import { NotLoggedInError, UnauthorizedError } from "effect-app/client";
|
|
3
3
|
import { RpcContextMap, RpcX } from "effect-app/rpc";
|
|
4
|
-
declare const UserProfile_base: S.EnhancedClass<UserProfile,
|
|
4
|
+
declare const UserProfile_base: S.EnhancedClass<UserProfile, S.Struct<{
|
|
5
5
|
id: S.String;
|
|
6
6
|
roles: S.$Array<S.String> & {
|
|
7
7
|
withDefault: S.withConstructorDefault<S.$Array<S.String>>;
|
|
@@ -67,7 +67,7 @@ declare const RequestContextMap_base: (new () => {
|
|
|
67
67
|
readonly requireRoles: RpcContextMap.RpcContextMap.Custom<never, typeof UnauthorizedError, string[]>;
|
|
68
68
|
readonly test: RpcContextMap.RpcContextMap<never, S.Never>;
|
|
69
69
|
}>;
|
|
70
|
-
get: <Key extends "
|
|
70
|
+
get: <Key extends "test" | "allowAnonymous" | "requireRoles">(key: Key) => RpcX.RpcMiddleware.RpcDynamic<Key, {
|
|
71
71
|
readonly allowAnonymous: RpcContextMap.RpcContextMap.Inverted<UserProfile, typeof NotLoggedInError>;
|
|
72
72
|
readonly requireRoles: RpcContextMap.RpcContextMap.Custom<never, typeof UnauthorizedError, string[]>;
|
|
73
73
|
readonly test: RpcContextMap.RpcContextMap<never, S.Never>;
|
|
@@ -111,10 +111,10 @@ declare const Counter_base: Context.OpaqueClass<Counter, "Counter", {
|
|
|
111
111
|
};
|
|
112
112
|
export declare class Counter extends Counter_base {
|
|
113
113
|
}
|
|
114
|
-
declare const CustomError1_base: import("effect/Schema").Class<CustomError1,
|
|
114
|
+
declare const CustomError1_base: import("effect/Schema").Class<CustomError1, S.TaggedStruct<"CustomError1", {}>, import("effect/Cause").YieldableError>;
|
|
115
115
|
export declare class CustomError1 extends CustomError1_base {
|
|
116
116
|
}
|
|
117
|
-
declare const CustomError2_base: import("effect/Schema").Class<CustomError2,
|
|
117
|
+
declare const CustomError2_base: import("effect/Schema").Class<CustomError2, S.TaggedStruct<"CustomError2", {}>, import("effect/Cause").YieldableError>;
|
|
118
118
|
export declare class CustomError2 extends CustomError2_base {
|
|
119
119
|
}
|
|
120
120
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.test.d.ts","sourceRoot":"","sources":["../query.test.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8C,CAAC,EAAU,MAAM,YAAY,CAAA
|
|
1
|
+
{"version":3,"file":"query.test.d.ts","sourceRoot":"","sources":["../query.test.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8C,CAAC,EAAU,MAAM,YAAY,CAAA;;;;;;;;;;;;;;;;;AAalF,qBAAa,SAAU,SAAQ,cAM7B;CAAG;AACL,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IAEjC,UAAiB,OAAQ,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,SAAS,CAAC;KAAG;CACtE"}
|
package/test/query.test.ts
CHANGED
|
@@ -91,7 +91,7 @@ it("works", () => {
|
|
|
91
91
|
|
|
92
92
|
const processed = memFilter(interpreted)(items.map((_) =>
|
|
93
93
|
S.encodeUnknownSync(S.Struct({
|
|
94
|
-
...
|
|
94
|
+
...Struct.omit(Something.fields, ["displayName"]),
|
|
95
95
|
displayName: S.Literals(["Verona", "Riley"])
|
|
96
96
|
}))(_)
|
|
97
97
|
))
|
|
@@ -809,7 +809,7 @@ it("refine inner without imposing a projection", () =>
|
|
|
809
809
|
where("union._tag", "AA"),
|
|
810
810
|
// But if I wanna the whole Data as output ignoring the inner refinement
|
|
811
811
|
// I wanna be able to do so
|
|
812
|
-
project(
|
|
812
|
+
project(Data.mapFields(Struct.pick(["union"])))
|
|
813
813
|
)
|
|
814
814
|
|
|
815
815
|
expectTypeOf(query2).toEqualTypeOf<
|