@effect-app/infra 0.44.0 → 0.44.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 0.44.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @effect-app/prelude@0.33.1
9
+ - @effect-app/infra-adapters@0.32.1
10
+
11
+ ## 0.44.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - @effect-app/infra-adapters@0.32.0
17
+ - @effect-app/prelude@0.33.0
18
+ - @effect-app/schema@0.30.0
19
+
3
20
  ## 0.44.0
4
21
 
5
22
  ### 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<"PATCH" | "GET" | "PUT" | "POST" | "DELETE", {
21
+ paths: Record<string, Record<"PATCH" | "GET" | "POST" | "PUT" | "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
- }>, OptimisticConcurrencyException | InvalidStateError | E | E2, A>;
186
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E2, A>;
202
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E, A>;
213
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E | NotFoundError<ItemType>, A>;
224
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E | NotFoundError<ItemType>, A>;
238
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E, A>;
249
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E, A>;
260
+ }>, InvalidStateError | OptimisticConcurrencyException | 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, OptimisticConcurrencyException | InvalidStateError | E, A>;
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, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E | E2, import("@effect/data/Chunk").Chunk<A>>;
281
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E2, import("@effect/data/Chunk").Chunk<A>>;
297
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E, import("@effect/data/Chunk").Chunk<A>>;
308
+ }>, InvalidStateError | OptimisticConcurrencyException | 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
- }>, OptimisticConcurrencyException | InvalidStateError | E, import("@effect/data/Chunk").Chunk<A>>;
319
+ }>, InvalidStateError | OptimisticConcurrencyException | 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, OptimisticConcurrencyException | InvalidStateError, void>;
368
+ }, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap, InvalidStateError | OptimisticConcurrencyException, 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, OptimisticConcurrencyException | InvalidStateError, void>;
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, InvalidStateError | OptimisticConcurrencyException, void>;
378
378
  //# sourceMappingURL=Repository.d.ts.map
@@ -102,7 +102,7 @@ export declare function makeRepo<PM extends {
102
102
  value: A_1;
103
103
  readonly S: PM;
104
104
  };
105
- }) => Where | readonly [Where, ...Where[]], mode?: "or" | "and" | undefined) => Filter<PM>;
105
+ }) => Where | readonly [Where, ...Where[]], mode?: "and" | "or" | undefined) => Filter<PM>;
106
106
  };
107
107
  /**
108
108
  * @tsplus fluent Repository removeById
@@ -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 | RDecode | simpledb.RecordCache, unknown, import("@effect/data/Option").Option<A>>;
9
+ find: (id: string) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache | RDecode, 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 | REncode | simpledb.RecordCache, OptimisticLockException, A>;
11
+ save: (record: A) => import("@effect/io/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache | REncode, OptimisticLockException, A>;
12
12
  }>;
13
13
  //# 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) => 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
7
  find: (id: string) => import("@effect/io/Effect").Effect<simpledb.RecordCache | RDecode, 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 | REncode, import("./shared.js").OptimisticLockException | simpledb.InvalidStateError | CouldNotAquireDbLockException, A>;
9
+ save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode, 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
@@ -8,7 +8,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
9
  find: (id: string) => import("@effect/io/Effect").Effect<RED.RedisClient | simpledb.RecordCache | RDecode, 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 | REncode, import("./shared.js").OptimisticLockException | simpledb.InvalidStateError | CouldNotAquireDbLockException, A>;
11
+ save: (record: A) => import("@effect/io/Effect").Effect<RED.RedisClient | simpledb.RecordCache | REncode, 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, 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<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>;
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<RecordCache | R | RDecode, InvalidStateError | E, 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<RecordCache | R, 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/io/Effect").Effect<RecordCache | R | Exclude<R2, import("@effect/io/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.44.0",
3
+ "version": "0.44.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.32.0",
23
- "@effect-app/schema": "0.29.0",
24
- "@effect-app/infra-adapters": "0.31.0",
25
- "@effect-app/core": "0.38.0"
22
+ "@effect-app/prelude": "0.33.1",
23
+ "@effect-app/core": "0.38.0",
24
+ "@effect-app/infra-adapters": "0.32.1",
25
+ "@effect-app/schema": "0.30.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@babel/cli": "^7.21.0",