@effect-app/infra 0.99.3 → 0.99.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 +22 -0
- package/_src/api/express/schema/routing.ts +3 -3
- package/dist/api/express/schema/routing.d.ts +3 -3
- package/dist/api/express/schema/routing.d.ts.map +1 -1
- package/dist/services/simpledb/cosmosdb.d.ts +2 -2
- package/dist/services/simpledb/diskdb.d.ts +1 -1
- package/dist/services/simpledb/redisdb.d.ts +2 -2
- package/dist/services/simpledb/simpledb.d.ts +2 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @effect-app/infra
|
|
2
2
|
|
|
3
|
+
## 0.99.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [f436ce54]
|
|
8
|
+
- @effect-app/schema@0.66.0
|
|
9
|
+
- @effect-app/infra-adapters@0.63.4
|
|
10
|
+
- @effect-app/prelude@0.74.4
|
|
11
|
+
|
|
12
|
+
## 0.99.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 7ff1f6f9: update packages
|
|
17
|
+
- 04f6bafa: update packages
|
|
18
|
+
- Updated dependencies [7ff1f6f9]
|
|
19
|
+
- Updated dependencies [04f6bafa]
|
|
20
|
+
- @effect-app/infra-adapters@0.63.3
|
|
21
|
+
- @effect-app/prelude@0.74.3
|
|
22
|
+
- @effect-app/core@0.72.1
|
|
23
|
+
- @effect-app/schema@0.65.3
|
|
24
|
+
|
|
3
25
|
## 0.99.3
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ export type Request<
|
|
|
16
16
|
HeaderA,
|
|
17
17
|
ReqA extends PathA & QueryA & BodyA
|
|
18
18
|
> = MO.ReqResSchemed<unknown, ReqA> & {
|
|
19
|
-
method: Methods
|
|
19
|
+
method: Methods.Methods
|
|
20
20
|
path: string
|
|
21
21
|
Cookie?: MO.ReqRes<Record<string, string>, CookieA>
|
|
22
22
|
Path?: MO.ReqRes<Record<string, string>, PathA>
|
|
@@ -60,7 +60,7 @@ export interface RouteDescriptor<
|
|
|
60
60
|
HeaderA,
|
|
61
61
|
ReqA extends PathA & QueryA & BodyA,
|
|
62
62
|
ResA,
|
|
63
|
-
METHOD extends Methods = Methods
|
|
63
|
+
METHOD extends Methods.Methods = Methods.Methods
|
|
64
64
|
> {
|
|
65
65
|
_tag: "Schema"
|
|
66
66
|
path: string
|
|
@@ -91,7 +91,7 @@ export function makeRouteDescriptor<
|
|
|
91
91
|
HeaderA,
|
|
92
92
|
ReqA extends PathA & QueryA & BodyA,
|
|
93
93
|
ResA = void,
|
|
94
|
-
METHOD extends Methods = Methods
|
|
94
|
+
METHOD extends Methods.Methods = Methods.Methods
|
|
95
95
|
>(
|
|
96
96
|
path: string,
|
|
97
97
|
method: METHOD,
|
|
@@ -4,7 +4,7 @@ import * as MO from "@effect-app/schema";
|
|
|
4
4
|
import type { Methods } from "@effect-app/schema";
|
|
5
5
|
import type { JSONSchema, ParameterLocation, SubSchema } from "@effect-app/infra-adapters/Openapi/atlas-plutus";
|
|
6
6
|
export type Request<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA extends PathA & QueryA & BodyA> = MO.ReqResSchemed<unknown, ReqA> & {
|
|
7
|
-
method: Methods;
|
|
7
|
+
method: Methods.Methods;
|
|
8
8
|
path: string;
|
|
9
9
|
Cookie?: MO.ReqRes<Record<string, string>, CookieA>;
|
|
10
10
|
Path?: MO.ReqRes<Record<string, string>, PathA>;
|
|
@@ -20,7 +20,7 @@ export interface RouteRequestHandler<M, PathA, CookieA, QueryA, BodyA, HeaderA,
|
|
|
20
20
|
}
|
|
21
21
|
export declare function asRouteDescriptionAny<R extends RouteDescriptorAny>(i: R): RouteDescriptorAny;
|
|
22
22
|
export declare function arrAsRouteDescriptionAny<R extends RouteDescriptorAny>(arr: ReadonlyArray<R>): RouteDescriptorAny[];
|
|
23
|
-
export interface RouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA extends PathA & QueryA & BodyA, ResA, METHOD extends Methods = Methods> {
|
|
23
|
+
export interface RouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA extends PathA & QueryA & BodyA, ResA, METHOD extends Methods.Methods = Methods.Methods> {
|
|
24
24
|
_tag: "Schema";
|
|
25
25
|
path: string;
|
|
26
26
|
method: METHOD;
|
|
@@ -30,7 +30,7 @@ export interface RouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export type RouteDescriptorAny = RouteDescriptor<any, any, any, any, any, any, any, any>;
|
|
33
|
-
export declare function makeRouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA extends PathA & QueryA & BodyA, ResA = void, METHOD extends Methods = Methods>(path: string, method: METHOD, handler: RouteRequestHandler<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA>): RouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, METHOD>;
|
|
33
|
+
export declare function makeRouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA extends PathA & QueryA & BodyA, ResA = void, METHOD extends Methods.Methods = Methods.Methods>(path: string, method: METHOD, handler: RouteRequestHandler<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA>): RouteDescriptor<M, PathA, CookieA, QueryA, BodyA, HeaderA, ReqA, ResA, METHOD>;
|
|
34
34
|
export declare function makeFromSchema<ResA>(e: RouteDescriptor<any, any, any, any, any, any, ResA, any>): import("effect/Effect").Effect<never, never, {
|
|
35
35
|
path: string;
|
|
36
36
|
method: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../../_src/api/express/schema/routing.ts"],"names":[],"mappings":";;AA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js";
|
|
|
7
7
|
import { OptimisticLockException } from "./shared.js";
|
|
8
8
|
import * as simpledb from "./simpledb.js";
|
|
9
9
|
export declare function createContext<TKey extends string, EA, A extends DBRecord<TKey>>(): <REncode, RDecode, EDecode>(type: string, encode: (record: A) => Effect<REncode, never, EA>, decode: (d: EA) => Effect<RDecode, EDecode, A>, indexes: IndexingPolicy) => import("effect/Effect").Effect<Cosmos.CosmosClient, import("effect/Cause").UnknownException, {
|
|
10
|
-
find: (id: string) => import("effect/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache
|
|
10
|
+
find: (id: string) => import("effect/Effect").Effect<RDecode | Cosmos.CosmosClient | simpledb.RecordCache, import("effect/Cause").UnknownException | simpledb.InvalidStateError, import("effect/Option").Option<A>>;
|
|
11
11
|
findBy: (parameters: Record<string, string>) => import("effect/Effect").Effect<Cosmos.CosmosClient, import("effect/Cause").UnknownException, import("effect/Option").Option<any>>;
|
|
12
|
-
save: (record: A) => import("effect/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache
|
|
12
|
+
save: (record: A) => import("effect/Effect").Effect<REncode | Cosmos.CosmosClient | simpledb.RecordCache, OptimisticLockException, A>;
|
|
13
13
|
}>;
|
|
14
14
|
//# sourceMappingURL=cosmosdb.d.ts.map
|
|
@@ -6,7 +6,7 @@ import * as simpledb from "./simpledb.js";
|
|
|
6
6
|
export declare function createContext<TKey extends string, EA, A extends DBRecord<TKey>>(): <REncode, RDecode, EDecode>(type: string, encode: (record: A) => Effect<REncode, never, EA>, decode: (d: EA) => Effect<RDecode, EDecode, A>, schemaVersion: string, makeIndexKey: (r: A) => Index, dir?: string) => {
|
|
7
7
|
find: (id: string) => import("effect/Effect").Effect<simpledb.RecordCache | RDecode, simpledb.InvalidStateError, import("effect/Option").Option<A>>;
|
|
8
8
|
findByIndex: (index: Index) => import("effect/Effect").Effect<never, never, import("effect/Option").Option<TKey & {}>>;
|
|
9
|
-
save: (record: A) => import("effect/Effect").Effect<simpledb.RecordCache | REncode,
|
|
9
|
+
save: (record: A) => import("effect/Effect").Effect<simpledb.RecordCache | REncode, import("./shared.js").OptimisticLockException | simpledb.InvalidStateError | CouldNotAquireDbLockException, A>;
|
|
10
10
|
};
|
|
11
11
|
export declare function initialise(dir: string): void;
|
|
12
12
|
//# sourceMappingURL=diskdb.d.ts.map
|
|
@@ -6,9 +6,9 @@ import type { DBRecord, Index } from "./shared.js";
|
|
|
6
6
|
import { CouldNotAquireDbLockException } from "./shared.js";
|
|
7
7
|
import * as simpledb from "./simpledb.js";
|
|
8
8
|
export declare function createContext<TKey extends string, EA, A extends DBRecord<TKey>>(): <REncode, RDecode, EDecode>(type: string, encode: (record: A) => Effect<REncode, never, EA>, decode: (d: EA) => Effect<RDecode, EDecode, A>, schemaVersion: string, makeIndexKey: (r: A) => Index) => {
|
|
9
|
-
find: (id: string) => import("effect/Effect").Effect<
|
|
9
|
+
find: (id: string) => import("effect/Effect").Effect<simpledb.RecordCache | RDecode | RedisClient, simpledb.InvalidStateError, import("effect/Option").Option<A>>;
|
|
10
10
|
findByIndex: (index: Index) => import("effect/Effect").Effect<RedisClient, import("@effect-app/infra-adapters/redis-client").ConnectionException, import("effect/Option").Option<TKey>>;
|
|
11
|
-
save: (record: A) => import("effect/Effect").Effect<
|
|
11
|
+
save: (record: A) => import("effect/Effect").Effect<simpledb.RecordCache | REncode | RedisClient, import("./shared.js").OptimisticLockException | simpledb.InvalidStateError | CouldNotAquireDbLockException, A>;
|
|
12
12
|
};
|
|
13
13
|
declare const RedisSerializedDBRecord_base: MO.Model<RedisSerializedDBRecord, MO.SchemaProperties<MO.ToProps<{
|
|
14
14
|
version: MO.Property<MO.SchemaDefaultSchema<unknown, string, string, string, {}>, "required", import("effect/Option").None<any>, import("effect/Option").None<any>>;
|
|
@@ -17,7 +17,7 @@ export interface RecordCache extends ReturnType<typeof makeLiveRecordCache> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const RecordCache: import("effect/Context").Tag<RecordCache, RecordCache>;
|
|
19
19
|
export declare const LiveRecordCache: import("effect/Layer").Layer<never, never, RecordCache>;
|
|
20
|
-
export declare function find<R, RDecode, EDecode, E, EA, A>(tryRead: (id: string) => Effect<R, E, Option<CachedRecord<EA>>>, decode: (d: EA) => Effect<RDecode, EDecode, A>, type: string): (id: string) => import("effect/Effect").Effect<
|
|
21
|
-
export declare function storeDirectly<R, E, TKey extends string, A extends DBRecord<TKey>>(save: (r: A, version: Option<Version>) => Effect<R, E, CachedRecord<A>>, type: string): (record: A) => import("effect/Effect").Effect<
|
|
20
|
+
export declare function find<R, RDecode, EDecode, E, EA, A>(tryRead: (id: string) => Effect<R, E, Option<CachedRecord<EA>>>, decode: (d: EA) => Effect<RDecode, EDecode, A>, type: string): (id: string) => import("effect/Effect").Effect<R | RDecode | RecordCache, E | InvalidStateError, import("effect/Option").Option<A>>;
|
|
21
|
+
export declare function storeDirectly<R, E, TKey extends string, A extends DBRecord<TKey>>(save: (r: A, version: Option<Version>) => Effect<R, E, CachedRecord<A>>, type: string): (record: A) => import("effect/Effect").Effect<R | RecordCache, E, A>;
|
|
22
22
|
export declare function store<R, E, R2, E2, TKey extends string, EA, A extends DBRecord<TKey>>(tryRead: (id: string) => Effect<R, E, Option<CachedRecord<EA>>>, save: (r: A, version: Option<Version>) => Effect<R, E, CachedRecord<A>>, lock: (id: string) => Effect<R2 | Scope, E2, unknown>, type: string): (record: A) => import("effect/Effect").Effect<RecordCache | R | Exclude<R2, import("effect/Scope").Scope>, OptimisticLockException | InvalidStateError | E | E2, A>;
|
|
23
23
|
//# sourceMappingURL=simpledb.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/infra",
|
|
3
|
-
"version": "0.99.
|
|
3
|
+
"version": "0.99.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"proper-lockfile": "^4.1.2",
|
|
19
19
|
"pure-rand": "6.0.4",
|
|
20
20
|
"redlock": "^4.2.0",
|
|
21
|
-
"@effect-app/core": "0.72.
|
|
22
|
-
"@effect-app/infra-adapters": "0.63.
|
|
23
|
-
"@effect-app/prelude": "0.74.
|
|
24
|
-
"@effect-app/schema": "0.
|
|
21
|
+
"@effect-app/core": "0.72.1",
|
|
22
|
+
"@effect-app/infra-adapters": "0.63.4",
|
|
23
|
+
"@effect-app/prelude": "0.74.4",
|
|
24
|
+
"@effect-app/schema": "0.66.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@babel/cli": "^7.23.4",
|
|
28
|
-
"@sentry/node": "^7.81.
|
|
28
|
+
"@sentry/node": "^7.81.1",
|
|
29
29
|
"@types/express": "^4.17.21",
|
|
30
|
-
"@types/node": "~20.9.
|
|
30
|
+
"@types/node": "~20.9.4",
|
|
31
31
|
"@types/proper-lockfile": "^4.1.4",
|
|
32
32
|
"@types/redis": "^2.8.32",
|
|
33
33
|
"@types/redlock": "^4.0.7",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"mongodb": "6.3.0",
|
|
38
38
|
"redis": "^3.1.2",
|
|
39
39
|
"ts-node": "^10.9.1",
|
|
40
|
-
"typescript": "npm:@effect-app/typescript@5.4.0-tsplus.
|
|
40
|
+
"typescript": "npm:@effect-app/typescript@5.4.0-tsplus.202311222",
|
|
41
41
|
"vitest": "^0.34.6",
|
|
42
|
-
"@effect-app/compiler": "0.36.
|
|
42
|
+
"@effect-app/compiler": "0.36.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"express": "^4.18.2"
|