@effect-app/infra 0.15.2 → 0.15.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,15 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 0.15.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [90d6e600]
8
+ - @effect-app/core@0.14.2
9
+ - @effect-app/infra-adapters@0.12.9
10
+ - @effect-app/prelude@0.14.2
11
+ - @effect-app/schema@0.12.9
12
+
3
13
  ## 0.15.2
4
14
 
5
15
  ### Patch 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<"PATCH" | "GET" | "POST" | "PUT" | "DELETE", {
21
+ paths: Record<string, Record<"GET" | "POST" | "PUT" | "PATCH" | "DELETE", {
22
22
  [x: string]: {
23
23
  responses: any;
24
24
  tags: readonly string[] | undefined;
@@ -182,7 +182,7 @@ export declare function queryAndSavePureEffect<Id extends string, T extends {
182
182
  skip?: number;
183
183
  }>): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, import("@fp-ts/data/Chunk").Chunk<S>, Iterable<S2>>, E2, A>) => import("@effect/io/Effect").Effect<RequestContext | ContextMap | R | Exclude<R2, {
184
184
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@fp-ts/data/Chunk").Chunk<S>, Iterable<S2>>;
185
- }>, InvalidStateError | OptimisticConcurrencyException | E | E2, A>;
185
+ }>, OptimisticConcurrencyException | InvalidStateError | E | E2, A>;
186
186
  /**
187
187
  * @tsplus fluent Repository queryAndSavePure
188
188
  * @tsplus location "@effect-app/infra/services/Repository"
@@ -198,7 +198,7 @@ export declare function queryAndSavePure<Id extends string, T extends {
198
198
  skip?: number;
199
199
  }): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, import("@fp-ts/data/Chunk").Chunk<S>, Iterable<S2>>, E2, A>) => import("@effect/io/Effect").Effect<RequestContext | ContextMap | Exclude<R2, {
200
200
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@fp-ts/data/Chunk").Chunk<S>, Iterable<S2>>;
201
- }>, InvalidStateError | OptimisticConcurrencyException | E2, A>;
201
+ }>, OptimisticConcurrencyException | InvalidStateError | E2, A>;
202
202
  /**
203
203
  * @tsplus getter Repository saveManyWithPure
204
204
  * @tsplus location "@effect-app/infra/services/Repository"
@@ -209,7 +209,7 @@ export declare function saveManyWithPure<Id extends string, T extends {
209
209
  id: string;
210
210
  }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>): <R, A, E, S1 extends T, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R, Evt, import("@fp-ts/data/Chunk").Chunk<S1>, Iterable<S2>>, E, A>) => (items: Iterable<S1>) => import("@effect/io/Effect").Effect<RequestContext | ContextMap | Exclude<R, {
211
211
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@fp-ts/data/Chunk").Chunk<S1>, Iterable<S2>>;
212
- }>, InvalidStateError | OptimisticConcurrencyException | E, A>;
212
+ }>, OptimisticConcurrencyException | InvalidStateError | E, A>;
213
213
  /**
214
214
  * @tsplus fluent Repository byIdAndSaveWithPure
215
215
  * @tsplus location "@effect-app/infra/services/Repository"
@@ -220,7 +220,7 @@ export declare function byIdAndSaveWithPure<Id extends string, T extends {
220
220
  id: string;
221
221
  }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>, id: 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<RequestContext | ContextMap | Exclude<R, {
222
222
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, T, S2>;
223
- }>, InvalidStateError | OptimisticConcurrencyException | E | NotFoundError<ItemType>, A>;
223
+ }>, OptimisticConcurrencyException | InvalidStateError | E | NotFoundError<ItemType>, A>;
224
224
  /**
225
225
  * NOTE: it's not as composable, only useful when the request is simple, and only this part needs request args.
226
226
  * @tsplus getter Repository handleByIdAndSaveWithPure
@@ -234,7 +234,7 @@ export declare function handleByIdAndSaveWithPure<Id extends string, T extends {
234
234
  id: Id;
235
235
  }, 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<RequestContext | ContextMap | Exclude<R, {
236
236
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, T, S2>;
237
- }>, InvalidStateError | OptimisticConcurrencyException | E | NotFoundError<ItemType>, A>;
237
+ }>, OptimisticConcurrencyException | InvalidStateError | E | NotFoundError<ItemType>, A>;
238
238
  /**
239
239
  * @tsplus fluent Repository saveManyWithPure_
240
240
  * @tsplus location "@effect-app/infra/services/Repository"
@@ -245,7 +245,7 @@ export declare function saveManyWithPure_<Id extends string, R, T extends {
245
245
  id: string;
246
246
  }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>, items: Iterable<S1>, pure: Effect<FixEnv<R, Evt, Chunk<S1>, Iterable<S2>>, E, A>): import("@effect/io/Effect").Effect<RequestContext | ContextMap | Exclude<R, {
247
247
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, import("@fp-ts/data/Chunk").Chunk<S1>, Iterable<S2>>;
248
- }>, InvalidStateError | OptimisticConcurrencyException | E, A>;
248
+ }>, OptimisticConcurrencyException | InvalidStateError | E, A>;
249
249
  /**
250
250
  * @tsplus fluent Repository saveWithPure_
251
251
  * @tsplus location "@effect-app/infra/services/Repository"
@@ -256,7 +256,7 @@ export declare function saveWithPure_<Id extends string, R, T extends {
256
256
  id: string;
257
257
  }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>, item: S1, pure: Effect<FixEnv<R, Evt, S1, S2>, E, A>): import("@effect/io/Effect").Effect<RequestContext | ContextMap | Exclude<R, {
258
258
  env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1, S2>;
259
- }>, InvalidStateError | OptimisticConcurrencyException | E, A>;
259
+ }>, OptimisticConcurrencyException | InvalidStateError | E, A>;
260
260
  export type AllDSL<T, Evt> = (<R, A, E, S1 extends T, S2 extends T>(pure: (dsl: PureDSL<Chunk<S1>, Iterable<S2>, Evt>) => Effect<R, E, A>) => Effect<FixEnv<R, Evt, Chunk<S1>, Iterable<S2>>, E, A>) & AllDSLExt<T, Evt>;
261
261
  /**
262
262
  * @tsplus type DSLExt
@@ -305,7 +305,7 @@ export declare function save<Id extends string, T extends {
305
305
  id: Id;
306
306
  }, PM extends {
307
307
  id: string;
308
- }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>): (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContext | ContextMap, InvalidStateError | OptimisticConcurrencyException, void>;
308
+ }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>): (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContext | ContextMap, OptimisticConcurrencyException | InvalidStateError, void>;
309
309
  /**
310
310
  * @tsplus getter Repository saveWithEvents
311
311
  * @tsplus location "@effect-app/infra/services/Repository"
@@ -314,5 +314,5 @@ export declare function saveWithEvents<Id extends string, T extends {
314
314
  id: Id;
315
315
  }, PM extends {
316
316
  id: string;
317
- }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>): (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContext | ContextMap, InvalidStateError | OptimisticConcurrencyException, void>;
317
+ }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, Id, ItemType>): (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContext | ContextMap, OptimisticConcurrencyException | InvalidStateError, void>;
318
318
  //# 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 | RDecode, unknown, import("@fp-ts/core/Option").Option<A>>;
9
+ find: (id: string) => import("@effect/io/Effect").Effect<RDecode | Cosmos.CosmosClient | simpledb.RecordCache, unknown, import("@fp-ts/core/Option").Option<A>>;
10
10
  findBy: (parameters: Record<string, string>) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient, unknown, import("@fp-ts/core/Option").Option<any>>;
11
- save: (record: A) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache | REncode, OptimisticLockException, A>;
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 | RDecode, simpledb.InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
7
+ find: (id: string) => import("@effect/io/Effect").Effect<RDecode | simpledb.RecordCache, simpledb.InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
8
8
  findByIndex: (index: Index) => import("@effect/io/Effect").Effect<never, never, import("@fp-ts/core/Option").Option<TKey & {}>>;
9
- save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode, CouldNotAquireDbLockException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
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 | RDecode, MO.CondemnException | simpledb.InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
8
+ find: (id: string) => import("@effect/io/Effect").Effect<RDecode | simpledb.RecordCache, MO.CondemnException | simpledb.InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
9
9
  findBy: <V extends Partial<A>>(keys: V, eq: import("@fp-ts/core/typeclass/Equivalence").Equivalence<V>) => import("@effect/io/Effect").Effect<RDecode, MO.CondemnException, import("@fp-ts/core/Option").Option<A & {}>>;
10
- save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode, MO.CondemnException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
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<simpledb.RecordCache | RDecode | Mongo.MongoClient, unknown, import("@fp-ts/core/Option").Option<A>>;
9
+ find: (id: string) => import("@effect/io/Effect").Effect<RDecode | Mongo.MongoClient | simpledb.RecordCache, unknown, import("@fp-ts/core/Option").Option<A>>;
10
10
  findBy: (keys: Record<string, string>) => import("@effect/io/Effect").Effect<Mongo.MongoClient, unknown, import("@fp-ts/core/Option").Option<TKey>>;
11
- save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode | Mongo.MongoClient, OptimisticLockException, A>;
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 | RDecode, simpledb.InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
9
+ find: (id: string) => import("@effect/io/Effect").Effect<RDecode | RED.RedisClient | simpledb.RecordCache, simpledb.InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
10
10
  findByIndex: (index: Index) => import("@effect/io/Effect").Effect<RED.RedisClient, RED.ConnectionException, import("@fp-ts/core/Option").Option<TKey>>;
11
- save: (record: A) => import("@effect/io/Effect").Effect<RED.RedisClient | simpledb.RecordCache | REncode, CouldNotAquireDbLockException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
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("@fp-ts/core/Option").None, import("@fp-ts/core/Option").None>;
@@ -17,7 +17,7 @@ export interface RecordCache extends ReturnType<typeof makeLiveRecordCache> {
17
17
  }
18
18
  export declare const RecordCache: import("@fp-ts/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, Opt<CachedRecord<EA>>>, decode: (d: EA) => Effect<RDecode, EDecode, A>, type: string): (id: string) => import("@effect/io/Effect").Effect<RecordCache | R | RDecode, InvalidStateError | E, import("@fp-ts/core/Option").Option<A>>;
21
- export declare function storeDirectly<R, E, TKey extends string, A extends DBRecord<TKey>>(save: (r: A, version: Opt<Version>) => Effect<R, E, CachedRecord<A>>, type: string): (record: A) => import("@effect/io/Effect").Effect<RecordCache | R, 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, Opt<CachedRecord<EA>>>, save: (r: A, version: Opt<Version>) => Effect<R, E, CachedRecord<A>>, lock: (id: string) => Effect<R2 | Scope, E2, unknown>, type: string): (record: A) => import("@effect/io/Effect").Effect<RecordCache | R | Exclude<R2, import("@effect/io/Scope").Scope>, OptimisticLockException | InvalidStateError | E | E2, A>;
20
+ export declare function find<R, RDecode, EDecode, E, EA, A>(tryRead: (id: string) => Effect<R, E, Opt<CachedRecord<EA>>>, decode: (d: EA) => Effect<RDecode, EDecode, A>, type: string): (id: string) => import("@effect/io/Effect").Effect<R | RDecode | RecordCache, E | InvalidStateError, import("@fp-ts/core/Option").Option<A>>;
21
+ export declare function storeDirectly<R, E, TKey extends string, A extends DBRecord<TKey>>(save: (r: A, version: Opt<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, Opt<CachedRecord<EA>>>, save: (r: A, version: Opt<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.15.2",
3
+ "version": "0.15.3",
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.0",
21
21
  "redlock": "^4.2.0",
22
- "@effect-app/prelude": "0.14.1",
23
- "@effect-app/core": "0.14.1",
24
- "@effect-app/schema": "0.12.8",
25
- "@effect-app/infra-adapters": "0.12.8"
22
+ "@effect-app/prelude": "0.14.2",
23
+ "@effect-app/infra-adapters": "0.12.9",
24
+ "@effect-app/core": "0.14.2",
25
+ "@effect-app/schema": "0.12.9"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@babel/cli": "^7.20.7",