@effect-app/infra 4.0.0-beta.127 → 4.0.0-beta.129

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,18 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 4.0.0-beta.129
4
+
5
+ ### Patch Changes
6
+
7
+ - effect-app@4.0.0-beta.129
8
+
9
+ ## 4.0.0-beta.128
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [57db551]
14
+ - effect-app@4.0.0-beta.128
15
+
3
16
  ## 4.0.0-beta.127
4
17
 
5
18
  ### Patch Changes
@@ -16,7 +16,7 @@ export declare const extendRepo: <T, Encoded extends FieldValues, Evt, ItemType
16
16
  * Note: batching breaks transactional properties because chunks are saved independently.
17
17
  */
18
18
  save: (itemOrItems: T | ReadonlyArray<T>, options?: BatchOptions) => Effect.Effect<void, InvalidStateError | OptimisticConcurrencyException, RSchema | RPublish>;
19
- saveWithEvents: (events: Iterable<Evt>) => (...items: NonEmptyArray<T>) => Effect.Effect<void, InvalidStateError | OptimisticConcurrencyException, RSchema | RPublish>;
19
+ saveWithEvents: (events: Iterable<Evt>) => (...items: NonEmptyArray<T>) => Effect.Effect<void, OptimisticConcurrencyException | InvalidStateError, RSchema | RPublish>;
20
20
  /**
21
21
  * Enables chunked deletes for large batches via `options.batch`.
22
22
  * Note: batching breaks transactional properties because chunks are removed independently.
@@ -49,7 +49,7 @@ export declare const extendRepo: <T, Encoded extends FieldValues, Evt, ItemType
49
49
  byIdAndSaveWithPure: <R, A_2, E_2, S2_2 extends T>(id: T[IdKey], pure: Effect.Effect<A_2, E_2, FixEnv<R, Evt, T, S2_2>>) => Effect.Effect<A_2, InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | E_2, RSchema | RPublish | Exclude<R, {
50
50
  env: PureEnv<Evt, T, S2_2>;
51
51
  }>>;
52
- saveWithPure: <R, A_3, E_3, S1_2 extends T, S2_3 extends T>(item: S1_2, pure: Effect.Effect<A_3, E_3, FixEnv<R, Evt, S1_2, S2_3>>) => Effect.Effect<A_3, InvalidStateError | OptimisticConcurrencyException | E_3, RSchema | RPublish | Exclude<R, {
52
+ saveWithPure: <R, A_3, E_3, S1_2 extends T, S2_3 extends T>(item: S1_2, pure: Effect.Effect<A_3, E_3, FixEnv<R, Evt, S1_2, S2_3>>) => Effect.Effect<A_3, OptimisticConcurrencyException | InvalidStateError | E_3, RSchema | RPublish | Exclude<R, {
53
53
  env: PureEnv<Evt, S1_2, S2_3>;
54
54
  }>>;
55
55
  };
@@ -20,12 +20,12 @@ export declare function makeRepoInternal<Evt = never>(): <ItemType extends strin
20
20
  config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
21
21
  partitionValue?: (e?: Encoded) => string;
22
22
  };
23
- }) => Effect.Effect<Repository<T, Encoded, Evt, ItemType, IdKey, Exclude<R, RCtx>, RPublish, RCtx>, E, R | RInitial | StoreMaker>;
23
+ }) => Effect.Effect<Repository<T, Encoded, Evt, ItemType, IdKey, Exclude<R, RCtx>, RPublish, RCtx>, E, StoreMaker | R | RInitial>;
24
24
  Q: Q.Query<Encoded>;
25
25
  };
26
26
  export declare function makeStore<Encoded extends FieldValues>(): <ItemType extends string, R, E, T, IdKey extends keyof Encoded>(name: ItemType, schema: S.Codec<T, E, R>, mapTo: (e: E, etag: string | undefined) => Encoded, idKey: IdKey) => <RInitial = never, EInitial = never>(makeInitial?: Effect.Effect<readonly T[], EInitial, RInitial>, config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
27
27
  partitionValue?: (e?: Encoded) => string;
28
- }) => Effect.Effect<import("../../../Store.js").Store<IdKey, Encoded, PersistenceModelType<Encoded>>, EInitial, R | RInitial | StoreMaker>;
28
+ }) => Effect.Effect<import("../../../Store.js").Store<IdKey, Encoded, PersistenceModelType<Encoded>>, EInitial, StoreMaker | R | RInitial>;
29
29
  export interface Repos<T, Encoded extends {
30
30
  id: string;
31
31
  }, RSchema, Evt, ItemType extends string, IdKey extends keyof T, RPublish> {
@@ -37,7 +37,7 @@ declare const Operations_base: Context.OpaqueClass<Operations, "effect-app/Opera
37
37
  all: Effect.Effect<Operation[], never, never>;
38
38
  find: (id: OperationId) => Effect.Effect<Option.Option<Operation>, never, never>;
39
39
  update: (id: S.StringId, progress: OperationProgress) => Effect.Effect<void, never, never>;
40
- }, never, OperationsRepo | RequestFiberSet>;
40
+ }, never, RequestFiberSet | OperationsRepo>;
41
41
  };
42
42
  export declare class Operations extends Operations_base {
43
43
  private static readonly CleanupLive;
@@ -1,7 +1,7 @@
1
1
  import { Context, Effect, Layer, RequestResolver } from "effect-app";
2
2
  import type * as Request from "effect/Request";
3
3
  import { ContextMap } from "./service.js";
4
- declare const ContextMapContainer_base: Context.Reference<ContextMap | "root">;
4
+ declare const ContextMapContainer_base: Context.Reference<"root" | ContextMap>;
5
5
  export declare class ContextMapContainer extends ContextMapContainer_base {
6
6
  static readonly layer: Layer.Layer<never, never, never>;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/infra",
3
- "version": "4.0.0-beta.127",
3
+ "version": "4.0.0-beta.129",
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.127"
16
+ "effect-app": "4.0.0-beta.129"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@azure/cosmos": "^4.9.3",
@@ -204,13 +204,15 @@ export const middleware3 = MiddlewareMaker
204
204
 
205
205
  export const { TaggedRequestFor } = makeRpcClient(RequestContextMap)
206
206
  const Req = TaggedRequestFor("Something")
207
+ const Command = Req.Command
208
+ const Query = Req.Query
207
209
 
208
- export class Eff extends Req<Eff>()("Eff", {}, { success: S.Void }) {}
209
- export class Gen extends Req<Gen>()("Gen", {}) {}
210
+ export class Eff extends Command<Eff>()("Eff", {}, { success: S.Void }) {}
211
+ export class Gen extends Command<Gen>()("Gen", {}) {}
210
212
 
211
213
  expectTypeOf(Eff.error).toEqualTypeOf<typeof Gen.error>()
212
214
 
213
- export class DoSomething extends Req<DoSomething>()("DoSomething", {
215
+ export class DoSomething extends Command<DoSomething>()("DoSomething", {
214
216
  id: S.String
215
217
  }, { success: S.Void }) {}
216
218
 
@@ -228,11 +230,11 @@ export class DoSomething extends Req<DoSomething>()("DoSomething", {
228
230
  // )
229
231
  // )
230
232
 
231
- export class GetSomething extends Req<GetSomething>()("GetSomething", {
233
+ export class GetSomething extends Query<GetSomething>()("GetSomething", {
232
234
  id: S.String
233
235
  }, { success: S.String }) {}
234
236
 
235
- export class GetSomething2 extends Req<GetSomething2>()("GetSomething2", {
237
+ export class GetSomething2 extends Query<GetSomething2>()("GetSomething2", {
236
238
  id: S.String
237
239
  }, { success: S.FiniteFromString }) {}
238
240
 
@@ -1 +1 @@
1
- {"version":3,"file":"controller.test.d.ts","sourceRoot":"","sources":["../controller.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAc,MAAM,+BAA+B,CAAA;AAE7F,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAoC,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAEvF,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAGtC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG3D,OAAO,EAAE,cAAc,EAAsB,YAAY,EAAqB,YAAY,EAAoB,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAY,MAAM,eAAe,CAAA;;cAuE/G,QAAQ;;AADzE,cAAM,kBACJ,SAAQ,uBAA0F;IAElG,MAAM,CAAC,OAAO,uDAUZ;CACH;;AAID,c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