@effect-app/infra 0.41.0 → 0.41.2
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 +18 -0
- package/dist/api/express/makeOpenApiSpecs.d.ts +1 -1
- package/dist/services/Repository.d.ts +14 -14
- package/dist/services/simpledb/cosmosdb.d.ts +2 -2
- package/dist/services/simpledb/diskdb.d.ts +2 -2
- package/dist/services/simpledb/memdb.d.ts +2 -2
- package/dist/services/simpledb/mongodb.d.ts +2 -2
- package/dist/services/simpledb/redisdb.d.ts +2 -2
- package/dist/services/simpledb/simpledb.d.ts +3 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @effect-app/infra
|
|
2
2
|
|
|
3
|
+
## 0.41.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @effect-app/core@0.36.1
|
|
9
|
+
- @effect-app/infra-adapters@0.29.2
|
|
10
|
+
- @effect-app/prelude@0.29.2
|
|
11
|
+
- @effect-app/schema@0.27.1
|
|
12
|
+
|
|
13
|
+
## 0.41.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @effect-app/prelude@0.29.1
|
|
19
|
+
- @effect-app/infra-adapters@0.29.1
|
|
20
|
+
|
|
3
21
|
## 0.41.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -18,7 +18,7 @@ export declare function makeOpenApiSpecs(rdescs: Iterable<RouteDescriptorAny>, i
|
|
|
18
18
|
version: string;
|
|
19
19
|
};
|
|
20
20
|
tags: never[];
|
|
21
|
-
paths: Record<string, Record<"
|
|
21
|
+
paths: Record<string, Record<"GET" | "POST" | "PUT" | "PATCH" | "DELETE", {
|
|
22
22
|
[x: string]: {
|
|
23
23
|
responses: any;
|
|
24
24
|
tags: readonly string[] | undefined;
|
|
@@ -183,7 +183,7 @@ export declare function queryAndSavePureEffect<T extends {
|
|
|
183
183
|
skip?: number;
|
|
184
184
|
}>): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | R | Exclude<R2, {
|
|
185
185
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
186
|
-
}>,
|
|
186
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E | E2, A>;
|
|
187
187
|
/**
|
|
188
188
|
* @tsplus fluent Repository queryAndSavePure
|
|
189
189
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -199,7 +199,7 @@ export declare function queryAndSavePure<T extends {
|
|
|
199
199
|
skip?: number;
|
|
200
200
|
}): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R2, {
|
|
201
201
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
202
|
-
}>,
|
|
202
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E2, A>;
|
|
203
203
|
/**
|
|
204
204
|
* @tsplus getter Repository saveManyWithPure
|
|
205
205
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -210,7 +210,7 @@ export declare function saveManyWithPure<T extends {
|
|
|
210
210
|
id: string;
|
|
211
211
|
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): <R, A, E, S1 extends T, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R, Evt, import("@effect/data/Chunk").Chunk<S1>, import("@effect/data/Chunk").Chunk<S2>>, E, A>) => (items: Iterable<S1>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
212
212
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S1>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
213
|
-
}>,
|
|
213
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A>;
|
|
214
214
|
/**
|
|
215
215
|
* @tsplus fluent Repository byIdAndSaveWithPure
|
|
216
216
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -221,7 +221,7 @@ export declare function byIdAndSaveWithPure<T extends {
|
|
|
221
221
|
id: string;
|
|
222
222
|
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>, id: T["id"]): <R, A, E, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R, Evt, T, S2>, E, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
223
223
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, T, S2>;
|
|
224
|
-
}>,
|
|
224
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E | NotFoundError<ItemType>, A>;
|
|
225
225
|
/**
|
|
226
226
|
* NOTE: it's not as composable, only useful when the request is simple, and only this part needs request args.
|
|
227
227
|
* @tsplus getter Repository handleByIdAndSaveWithPure
|
|
@@ -235,7 +235,7 @@ export declare function handleByIdAndSaveWithPure<T extends {
|
|
|
235
235
|
id: T["id"];
|
|
236
236
|
}, Context_1, R, A, E, S2 extends T>(pure: (req: Req, ctx: Context_1) => import("@effect/io/Effect").Effect<FixEnv<R, Evt, T, S2>, E, A>) => (req: Req, ctx: Context_1) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
237
237
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, T, S2>;
|
|
238
|
-
}>,
|
|
238
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E | NotFoundError<ItemType>, A>;
|
|
239
239
|
/**
|
|
240
240
|
* @tsplus fluent Repository saveManyWithPure_
|
|
241
241
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -246,7 +246,7 @@ export declare function saveManyWithPure_<Id extends string, R, T extends {
|
|
|
246
246
|
id: string;
|
|
247
247
|
}, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>, items: Iterable<S1>, pure: Effect<FixEnv<R, Evt, Chunk<S1>, Chunk<S2>>, E, A>): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
248
248
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S1>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
249
|
-
}>,
|
|
249
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A>;
|
|
250
250
|
/**
|
|
251
251
|
* @tsplus fluent Repository saveWithPure_
|
|
252
252
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -257,12 +257,12 @@ export declare function saveWithPure_<Id extends string, R, T extends {
|
|
|
257
257
|
id: string;
|
|
258
258
|
}, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>, item: S1, pure: Effect<FixEnv<R, Evt, S1, S2>, E, A>): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
259
259
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1, S2>;
|
|
260
|
-
}>,
|
|
260
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A>;
|
|
261
261
|
export declare function saveAllWithEffectInt<T extends {
|
|
262
262
|
id: string;
|
|
263
263
|
}, PM extends {
|
|
264
264
|
id: string;
|
|
265
|
-
}, P extends T, Evt, ItemType extends string, R, E, A>(self: Repository<T, PM, Evt, ItemType>, gen: Effect<R, E, readonly [Iterable<P>, Iterable<Evt>, A]>): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | R,
|
|
265
|
+
}, P extends T, Evt, ItemType extends string, R, E, A>(self: Repository<T, PM, Evt, ItemType>, gen: Effect<R, E, readonly [Iterable<P>, Iterable<Evt>, A]>): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | R, OptimisticConcurrencyException | InvalidStateError | E, A>;
|
|
266
266
|
/**
|
|
267
267
|
* @tsplus fluent Repository queryAndSavePureEffectBatched
|
|
268
268
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -278,7 +278,7 @@ export declare function queryAndSavePureEffectBatched<T extends {
|
|
|
278
278
|
skip?: number;
|
|
279
279
|
}>, batchSize?: number): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | R | Exclude<R2, {
|
|
280
280
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
281
|
-
}>,
|
|
281
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E | E2, import("@effect/data/Chunk").Chunk<A>>;
|
|
282
282
|
/**
|
|
283
283
|
* @tsplus fluent Repository queryAndSavePureBatched
|
|
284
284
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -294,7 +294,7 @@ export declare function queryAndSavePureBatched<T extends {
|
|
|
294
294
|
skip?: number;
|
|
295
295
|
}, batchSize?: number): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R2, {
|
|
296
296
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
297
|
-
}>,
|
|
297
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E2, import("@effect/data/Chunk").Chunk<A>>;
|
|
298
298
|
/**
|
|
299
299
|
* @tsplus fluent Repository saveManyWithPureBatched
|
|
300
300
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -305,7 +305,7 @@ export declare function saveManyWithPureBatched<T extends {
|
|
|
305
305
|
id: string;
|
|
306
306
|
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>, batchSize?: number): <R, A, E, S1 extends T, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R, Evt, import("@effect/data/Chunk").Chunk<S1>, import("@effect/data/Chunk").Chunk<S2>>, E, A>) => (items: Iterable<S1>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
307
307
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S1>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
308
|
-
}>,
|
|
308
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, import("@effect/data/Chunk").Chunk<A>>;
|
|
309
309
|
/**
|
|
310
310
|
* @tsplus fluent Repository saveManyWithPureBatched_
|
|
311
311
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -316,7 +316,7 @@ export declare function saveManyWithPureBatched_<Id extends string, R, T extends
|
|
|
316
316
|
id: string;
|
|
317
317
|
}, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>, items: Iterable<S1>, pure: Effect<FixEnv<R, Evt, Chunk<S1>, Chunk<S2>>, E, A>, batchSize?: number): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
318
318
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@effect/data/Chunk").Chunk<S1>, import("@effect/data/Chunk").Chunk<S2>>;
|
|
319
|
-
}>,
|
|
319
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, import("@effect/data/Chunk").Chunk<A>>;
|
|
320
320
|
export type AllDSL<T, Evt> = (<R, A, E, S1 extends T, S2 extends T>(pure: (dsl: PureDSL<Chunk<S1>, Chunk<S2>, Evt>) => Effect<R, E, A>) => Effect<FixEnv<R, Evt, Chunk<S1>, Chunk<S2>>, E, A>) & AllDSLExt<T, Evt>;
|
|
321
321
|
/**
|
|
322
322
|
* @tsplus type DSLExt
|
|
@@ -365,7 +365,7 @@ export declare function save<T extends {
|
|
|
365
365
|
id: string;
|
|
366
366
|
}, PM extends {
|
|
367
367
|
id: string;
|
|
368
|
-
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap,
|
|
368
|
+
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap, OptimisticConcurrencyException | InvalidStateError, void>;
|
|
369
369
|
/**
|
|
370
370
|
* @tsplus getter Repository saveWithEvents
|
|
371
371
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -374,5 +374,5 @@ export declare function saveWithEvents<T extends {
|
|
|
374
374
|
id: string;
|
|
375
375
|
}, PM extends {
|
|
376
376
|
id: string;
|
|
377
|
-
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap,
|
|
377
|
+
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap, OptimisticConcurrencyException | InvalidStateError, void>;
|
|
378
378
|
//# sourceMappingURL=Repository.d.ts.map
|
|
@@ -6,8 +6,8 @@ import type { DBRecord } from "./shared.js";
|
|
|
6
6
|
import { OptimisticLockException } 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) => import("@effect/io/Effect").Effect<REncode, never, EA>, decode: (d: EA) => import("@effect/io/Effect").Effect<RDecode, EDecode, A>, indexes: IndexingPolicy) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient, unknown, {
|
|
9
|
-
find: (id: string) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache
|
|
9
|
+
find: (id: string) => import("@effect/io/Effect").Effect<RDecode | Cosmos.CosmosClient | simpledb.RecordCache, unknown, import("@effect/data/Option").Option<A>>;
|
|
10
10
|
findBy: (parameters: Record<string, string>) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient, unknown, import("@effect/data/Option").Option<any>>;
|
|
11
|
-
save: (record: A) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache
|
|
11
|
+
save: (record: A) => import("@effect/io/Effect").Effect<REncode | Cosmos.CosmosClient | simpledb.RecordCache, OptimisticLockException, A>;
|
|
12
12
|
}>;
|
|
13
13
|
//# sourceMappingURL=cosmosdb.d.ts.map
|
|
@@ -4,9 +4,9 @@ import type { DBRecord, Index } from "./shared.js";
|
|
|
4
4
|
import { CouldNotAquireDbLockException } from "./shared.js";
|
|
5
5
|
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) => import("@effect/io/Effect").Effect<REncode, never, EA>, decode: (d: EA) => import("@effect/io/Effect").Effect<RDecode, EDecode, A>, schemaVersion: string, makeIndexKey: (r: A) => Index, dir?: string) => {
|
|
7
|
-
find: (id: string) => import("@effect/io/Effect").Effect<simpledb.RecordCache
|
|
7
|
+
find: (id: string) => import("@effect/io/Effect").Effect<RDecode | simpledb.RecordCache, simpledb.InvalidStateError, import("@effect/data/Option").Option<A>>;
|
|
8
8
|
findByIndex: (index: Index) => import("@effect/io/Effect").Effect<never, never, import("@effect/data/Option").Option<TKey & {}>>;
|
|
9
|
-
save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache
|
|
9
|
+
save: (record: A) => import("@effect/io/Effect").Effect<REncode | simpledb.RecordCache, CouldNotAquireDbLockException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
|
|
10
10
|
};
|
|
11
11
|
export declare function initialise(dir: string): void;
|
|
12
12
|
//# sourceMappingURL=diskdb.d.ts.map
|
|
@@ -5,8 +5,8 @@ import * as MO from "@effect-app/schema";
|
|
|
5
5
|
import type { DBRecord } from "./shared.js";
|
|
6
6
|
import * as simpledb from "./simpledb.js";
|
|
7
7
|
export declare function createContext<TKey extends string, EA, A extends DBRecord<TKey>>(): <REncode, RDecode, EDecode>(type: string, encode: (record: A) => import("@effect/io/Effect").Effect<REncode, never, EA>, decode: (d: EA) => import("@effect/io/Effect").Effect<RDecode, EDecode, A>) => {
|
|
8
|
-
find: (id: string) => import("@effect/io/Effect").Effect<simpledb.RecordCache
|
|
8
|
+
find: (id: string) => import("@effect/io/Effect").Effect<RDecode | simpledb.RecordCache, MO.CondemnException | simpledb.InvalidStateError, import("@effect/data/Option").Option<A>>;
|
|
9
9
|
findBy: <V extends Partial<A>>(keys: V, eq: import("@effect/data/typeclass/Equivalence").Equivalence<V>) => import("@effect/io/Effect").Effect<RDecode, MO.CondemnException, import("@effect/data/Option").Option<A & {}>>;
|
|
10
|
-
save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache
|
|
10
|
+
save: (record: A) => import("@effect/io/Effect").Effect<REncode | simpledb.RecordCache, MO.CondemnException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=memdb.d.ts.map
|
|
@@ -6,8 +6,8 @@ import type { DBRecord } from "./shared.js";
|
|
|
6
6
|
import { OptimisticLockException } 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) => import("@effect/io/Effect").Effect<REncode, never, EA>, decode: (d: EA) => import("@effect/io/Effect").Effect<RDecode, EDecode, A>, indexes: IndexDescription[]) => import("@effect/io/Effect").Effect<Mongo.MongoClient, unknown, {
|
|
9
|
-
find: (id: string) => import("@effect/io/Effect").Effect<
|
|
9
|
+
find: (id: string) => import("@effect/io/Effect").Effect<RDecode | Mongo.MongoClient | simpledb.RecordCache, unknown, import("@effect/data/Option").Option<A>>;
|
|
10
10
|
findBy: (keys: Record<string, string>) => import("@effect/io/Effect").Effect<Mongo.MongoClient, unknown, import("@effect/data/Option").Option<TKey>>;
|
|
11
|
-
save: (record: A) => import("@effect/io/Effect").Effect<
|
|
11
|
+
save: (record: A) => import("@effect/io/Effect").Effect<REncode | Mongo.MongoClient | simpledb.RecordCache, OptimisticLockException, A>;
|
|
12
12
|
}>;
|
|
13
13
|
//# sourceMappingURL=mongodb.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) => import("@effect/io/Effect").Effect<REncode, never, EA>, decode: (d: EA) => import("@effect/io/Effect").Effect<RDecode, EDecode, A>, schemaVersion: string, makeIndexKey: (r: A) => Index) => {
|
|
9
|
-
find: (id: string) => import("@effect/io/Effect").Effect<RED.RedisClient | simpledb.RecordCache
|
|
9
|
+
find: (id: string) => import("@effect/io/Effect").Effect<RDecode | RED.RedisClient | simpledb.RecordCache, simpledb.InvalidStateError, import("@effect/data/Option").Option<A>>;
|
|
10
10
|
findByIndex: (index: Index) => import("@effect/io/Effect").Effect<RED.RedisClient, RED.ConnectionException, import("@effect/data/Option").Option<TKey>>;
|
|
11
|
-
save: (record: A) => import("@effect/io/Effect").Effect<RED.RedisClient | simpledb.RecordCache
|
|
11
|
+
save: (record: A) => import("@effect/io/Effect").Effect<REncode | RED.RedisClient | simpledb.RecordCache, CouldNotAquireDbLockException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
|
|
12
12
|
};
|
|
13
13
|
declare const RedisSerializedDBRecord_base: MO.Model<RedisSerializedDBRecord, MO.SchemaProperties<{
|
|
14
14
|
version: MO.Property<MO.SchemaDefaultSchema<unknown, string, string, string, {}>, "required", import("@effect/data/Option").None, import("@effect/data/Option").None>;
|
|
@@ -17,7 +17,7 @@ export interface RecordCache extends ReturnType<typeof makeLiveRecordCache> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const RecordCache: import("@effect/data/Context").Tag<RecordCache>;
|
|
19
19
|
export declare const LiveRecordCache: import("@effect/io/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/io/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/io/Effect").Effect<
|
|
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/io/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/io/Effect").Effect<R | RDecode | RecordCache, E | InvalidStateError, import("@effect/data/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/io/Effect").Effect<R | RecordCache, E, A>;
|
|
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/io/Effect").Effect<R | RecordCache | Exclude<R2, import("@effect/io/Scope").Scope>, E | E2 | OptimisticLockException | InvalidStateError, 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.41.
|
|
3
|
+
"version": "0.41.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"proper-lockfile": "^4.1.2",
|
|
20
20
|
"pure-rand": "^6.0.1",
|
|
21
21
|
"redlock": "^4.2.0",
|
|
22
|
-
"@effect-app/prelude": "0.29.
|
|
23
|
-
"@effect-app/
|
|
24
|
-
"@effect-app/
|
|
25
|
-
"@effect-app/schema": "0.27.
|
|
22
|
+
"@effect-app/prelude": "0.29.2",
|
|
23
|
+
"@effect-app/core": "0.36.1",
|
|
24
|
+
"@effect-app/infra-adapters": "0.29.2",
|
|
25
|
+
"@effect-app/schema": "0.27.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/cli": "^7.21.0",
|