@effect-app/infra 1.11.4 → 1.12.1

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,27 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 1.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9fbf129]
8
+ - effect-app@1.10.1
9
+ - @effect-app/infra-adapters@1.8.1
10
+
11
+ ## 1.12.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 2143dd9: update packages
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [2143dd9]
20
+ - @effect-app/infra-adapters@1.8.0
21
+ - effect-app@1.10.0
22
+ - @effect-app/schema@1.7.0
23
+ - @effect-app/core@1.7.0
24
+
3
25
  ## 1.11.4
4
26
 
5
27
  ### Patch Changes
@@ -63,11 +63,11 @@ declare const RequestContext_base: S.EnhancedClass<RequestContext, {
63
63
  readonly id?: string & S.NonEmptyString255Brand;
64
64
  readonly name: string & S.NonEmptyString255Brand;
65
65
  readonly createdAt?: Date;
66
- readonly rootId: NonEmptyString255;
67
66
  readonly userProfile?: {
68
67
  readonly sub: string & S.StringIdBrand & import("effect-app/ids").UserProfileIdBrand;
69
68
  } | undefined;
70
69
  readonly locale: "en" | "de";
70
+ readonly rootId: NonEmptyString255;
71
71
  readonly sourceId?: (string & S.NonEmptyString255Brand) | undefined;
72
72
  readonly parent?: RequestContextParent | undefined;
73
73
  readonly namespace?: (string & S.NonEmptyString255Brand) | undefined;
@@ -48,7 +48,7 @@ declare const Operations_base: (abstract new (service: {
48
48
  all: Effect<Operation[]>;
49
49
  find: (id: OperationId) => Effect<Option<Operation>>;
50
50
  update: (id: OperationId, progress: OperationProgress) => Effect.Effect<void, never, never>;
51
- }) => X) => X extends Effect<infer A_1, infer E_2, infer R_4> ? Effect<A_1, E_2, Operations | R_4> : Effect<X, never, Operations>;
51
+ }) => X) => X extends Effect<infer A_1, infer E_2, infer R_4> ? Effect<A_1, E_2, R_4 | Operations> : Effect<X, never, Operations>;
52
52
  };
53
53
  export declare class Operations extends Operations_base {
54
54
  private static readonly CleanupLive;
@@ -26,7 +26,7 @@ export declare function byIdAndSaveWithPure<T extends {
26
26
  id: unknown;
27
27
  }, Encoded extends {
28
28
  id: string;
29
- }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, id: T["id"]): <R, A, E, S2 extends T>(pure: Effect<A, E, FixEnv<R, Evt, T, S2>>) => Effect.Effect<A, E | import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | NotFoundError<ItemType>, Exclude<R, {
29
+ }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, id: T["id"]): <R, A, E, S2 extends T>(pure: Effect<A, E, FixEnv<R, Evt, T, S2>>) => Effect.Effect<A, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E | NotFoundError<ItemType>, Exclude<R, {
30
30
  env: import("effect-app/Pure").PureEnv<Evt, T, S2>;
31
31
  }>>;
32
32
  /**
@@ -39,7 +39,7 @@ export declare function handleByIdAndSaveWithPure<T extends {
39
39
  id: string;
40
40
  }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>): <Req extends {
41
41
  id: T["id"];
42
- }, Context, R, A, E, S2 extends T>(pure: (req: Req, ctx: Context) => Effect<A, E, FixEnv<R, Evt, T, S2>>) => (req: Req, ctx: Context) => Effect.Effect<A, E | import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | NotFoundError<ItemType>, Exclude<R, {
42
+ }, Context, R, A, E, S2 extends T>(pure: (req: Req, ctx: Context) => Effect<A, E, FixEnv<R, Evt, T, S2>>) => (req: Req, ctx: Context) => Effect.Effect<A, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E | NotFoundError<ItemType>, Exclude<R, {
43
43
  env: import("effect-app/Pure").PureEnv<Evt, T, S2>;
44
44
  }>>;
45
45
  /**
@@ -49,7 +49,7 @@ export declare function saveManyWithPure_<R, T extends {
49
49
  id: unknown;
50
50
  }, Encoded extends {
51
51
  id: string;
52
- }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, items: Iterable<S1>, pure: Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>): Effect.Effect<A, E | import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException, Exclude<R, {
52
+ }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, items: Iterable<S1>, pure: Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>): Effect.Effect<A, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E, Exclude<R, {
53
53
  env: import("effect-app/Pure").PureEnv<Evt, readonly S1[], readonly S2[]>;
54
54
  }>>;
55
55
  /**
@@ -59,14 +59,14 @@ export declare function saveWithPure_<R, T extends {
59
59
  id: unknown;
60
60
  }, Encoded extends {
61
61
  id: string;
62
- }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, item: S1, pure: Effect<A, E, FixEnv<R, Evt, S1, S2>>): Effect.Effect<A, import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | E, Exclude<R, {
62
+ }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, item: S1, pure: Effect<A, E, FixEnv<R, Evt, S1, S2>>): Effect.Effect<A, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E, Exclude<R, {
63
63
  env: import("effect-app/Pure").PureEnv<Evt, S1, S2>;
64
64
  }>>;
65
65
  export declare function saveAllWithEffectInt<T extends {
66
66
  id: unknown;
67
67
  }, Encoded extends {
68
68
  id: string;
69
- }, P extends T, Evt, ItemType extends string, R, E, A>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, gen: Effect<readonly [Iterable<P>, Iterable<Evt>, A], E, R>): Effect.Effect<A, E | import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException, R>;
69
+ }, P extends T, Evt, ItemType extends string, R, E, A>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, gen: Effect<readonly [Iterable<P>, Iterable<Evt>, A], E, R>): Effect.Effect<A, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E, R>;
70
70
  /**
71
71
  * @tsplus fluent Repository saveManyWithPureBatched
72
72
  */
@@ -74,7 +74,7 @@ export declare function saveManyWithPureBatched<T extends {
74
74
  id: unknown;
75
75
  }, Encoded extends {
76
76
  id: string;
77
- }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, batchSize?: number): <R, A, E, S1 extends T, S2 extends T>(pure: Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>) => (items: Iterable<S1>) => Effect.Effect<A[], import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | E, Exclude<R, {
77
+ }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, batchSize?: number): <R, A, E, S1 extends T, S2 extends T>(pure: Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>) => (items: Iterable<S1>) => Effect.Effect<A[], import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E, Exclude<R, {
78
78
  env: import("effect-app/Pure").PureEnv<Evt, readonly S1[], readonly S2[]>;
79
79
  }>>;
80
80
  /**
@@ -84,7 +84,7 @@ export declare function saveManyWithPureBatched_<R, T extends {
84
84
  id: unknown;
85
85
  }, Encoded extends {
86
86
  id: string;
87
- }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, items: Iterable<S1>, pure: Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>, batchSize?: number): Effect.Effect<A[], import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | E, Exclude<R, {
87
+ }, A, E, Evt, S1 extends T, S2 extends T, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>, items: Iterable<S1>, pure: Effect<A, E, FixEnv<R, Evt, readonly S1[], readonly S2[]>>, batchSize?: number): Effect.Effect<A[], import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E, Exclude<R, {
88
88
  env: import("effect-app/Pure").PureEnv<Evt, readonly S1[], readonly S2[]>;
89
89
  }>>;
90
90
  /**
@@ -94,7 +94,7 @@ export declare function save<T extends {
94
94
  id: unknown;
95
95
  }, Encoded extends {
96
96
  id: string;
97
- }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>): (items_0: T, ...items_1: T[]) => Effect<void, import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException>;
97
+ }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>): (items_0: T, ...items_1: T[]) => Effect<void, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError>;
98
98
  /**
99
99
  * @tsplus getter Repository saveWithEvents
100
100
  */
@@ -102,7 +102,7 @@ export declare function saveWithEvents<T extends {
102
102
  id: unknown;
103
103
  }, Encoded extends {
104
104
  id: string;
105
- }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>): (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => Effect<void, import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException>;
105
+ }, Evt, ItemType extends string>(self: RepositoryBaseC<T, Encoded, Evt, ItemType>): (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => Effect<void, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError>;
106
106
  /**
107
107
  * @tsplus fluent Repository updateWithEffect
108
108
  */
@@ -110,7 +110,7 @@ export declare function itemUpdateWithEffect<R, E, T extends {
110
110
  id: string;
111
111
  }, Encoded extends {
112
112
  id: string;
113
- }, Evt, ItemType extends string>(repo: RepositoryBaseC<T, Encoded, Evt, ItemType>, id: T["id"], mod: (item: T) => Effect<T, E, R>): Effect.Effect<void, import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | E | NotFoundError<ItemType>, R>;
113
+ }, Evt, ItemType extends string>(repo: RepositoryBaseC<T, Encoded, Evt, ItemType>, id: T["id"], mod: (item: T) => Effect<T, E, R>): Effect.Effect<void, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | E | NotFoundError<ItemType>, R>;
114
114
  /**
115
115
  * @tsplus fluent Repository update
116
116
  */
@@ -118,7 +118,7 @@ export declare function itemUpdate<T extends {
118
118
  id: string;
119
119
  }, Encoded extends {
120
120
  id: string;
121
- }, Evt, ItemType extends string>(repo: RepositoryBaseC<T, Encoded, Evt, ItemType>, id: T["id"], mod: (item: T) => T): Effect.Effect<void, import("effect-app/client/errors").InvalidStateError | import("effect-app/client/errors").OptimisticConcurrencyException | NotFoundError<ItemType>, never>;
121
+ }, Evt, ItemType extends string>(repo: RepositoryBaseC<T, Encoded, Evt, ItemType>, id: T["id"], mod: (item: T) => T): Effect.Effect<void, import("effect-app/client/errors").OptimisticConcurrencyException | import("effect-app/client/errors").InvalidStateError | NotFoundError<ItemType>, never>;
122
122
  /**
123
123
  * only use this as a shortcut if you don't have the item already
124
124
  * @tsplus fluent Repository removeById
@@ -88,8 +88,8 @@ export declare class RepositoryBaseC3<T extends {
88
88
  get(id: T["id"]): Effect.Effect<T, NotFoundError<ItemType>, never>;
89
89
  readonly log: (evt: Evt) => import("effect-app/Pure").PureLogT<any>;
90
90
  removeById(id: T["id"]): Effect.Effect<void, NotFoundError<ItemType>, never>;
91
- readonly save: (items_0: T, ...items_1: T[]) => Effect<void, InvalidStateError | OptimisticConcurrencyException>;
92
- readonly saveWithEvents: (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => Effect<void, InvalidStateError | OptimisticConcurrencyException>;
91
+ readonly save: (items_0: T, ...items_1: T[]) => Effect<void, OptimisticConcurrencyException | InvalidStateError>;
92
+ readonly saveWithEvents: (events: Iterable<Evt>) => (items_0: T, ...items_1: T[]) => Effect<void, OptimisticConcurrencyException | InvalidStateError>;
93
93
  readonly queryAndSavePure: {
94
94
  <A, E2, R2, T2 extends T>(q: (q: Query<Encoded>) => QueryEnd<Encoded, "one">, pure: Effect<A, E2, FixEnv<R2, Evt, T, T2>>): Effect.Effect<A, InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | E2, Exclude<R2, {
95
95
  env: PureEnv<Evt, T, T2>;
@@ -106,7 +106,7 @@ export declare class RepositoryBaseC3<T extends {
106
106
  */
107
107
  readonly handleByIdAndSaveWithPure: <Req extends {
108
108
  id: T["id"];
109
- }, Context, R, A, E, S2 extends T>(pure: (req: Req, ctx: Context) => Effect<A, E, FixEnv<R, Evt, T, S2>>) => (req: Req, ctx: Context) => Effect.Effect<A, InvalidStateError | OptimisticConcurrencyException | NotFoundError<ItemType> | E, Exclude<R, {
109
+ }, Context, R, A, E, S2 extends T>(pure: (req: Req, ctx: Context) => Effect<A, E, FixEnv<R, Evt, T, S2>>) => (req: Req, ctx: Context) => Effect.Effect<A, OptimisticConcurrencyException | InvalidStateError | NotFoundError<ItemType> | E, Exclude<R, {
110
110
  env: PureEnv<Evt, T, S2>;
111
111
  }>>;
112
112
  saveManyWithPure: {
@@ -122,7 +122,7 @@ export declare class RepositoryBaseC3<T extends {
122
122
  env: PureEnv<Evt, T, S2>;
123
123
  }>>;
124
124
  };
125
- saveWithPure<R, A, E, S1 extends T, S2 extends T>(item: S1, pure: Effect<A, E, FixEnv<R, Evt, S1, S2>>): Effect.Effect<A, InvalidStateError | OptimisticConcurrencyException | E, Exclude<R, {
125
+ saveWithPure<R, A, E, S1 extends T, S2 extends T>(item: S1, pure: Effect<A, E, FixEnv<R, Evt, S1, S2>>): Effect.Effect<A, OptimisticConcurrencyException | InvalidStateError | E, Exclude<R, {
126
126
  env: PureEnv<Evt, S1, S2>;
127
127
  }>>;
128
128
  }
@@ -145,7 +145,7 @@ export declare function makeRepo<Evt = never>(): <ItemType extends string, R, En
145
145
  config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
146
146
  partitionValue?: (a: Encoded) => string;
147
147
  };
148
- }) => Effect.Effect<Repository<T, Encoded, Evt, ItemType>, E, R | StoreMaker | ContextMapContainer | RInitial | R2>;
148
+ }) => Effect.Effect<Repository<T, Encoded, Evt, ItemType>, E, StoreMaker | ContextMapContainer | R | RInitial | R2>;
149
149
  Q: Query<Encoded>;
150
150
  };
151
151
  export declare function makeStore<Encoded extends {
@@ -156,7 +156,7 @@ export declare function makeStore<Encoded extends {
156
156
  id: unknown;
157
157
  }>(name: ItemType, schema: S.Schema<T, E, R>, mapTo: (e: E, etag: string | undefined) => Encoded) => <RInitial = never, EInitial = never>(makeInitial?: Effect<readonly T[], EInitial, RInitial>, config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
158
158
  partitionValue?: (a: Encoded) => string;
159
- }) => Effect.Effect<import("./Store.js").Store<Encoded, string, PersistenceModelType<Encoded>>, EInitial, R | StoreMaker | RInitial>;
159
+ }) => Effect.Effect<import("./Store.js").Store<Encoded, string, PersistenceModelType<Encoded>>, EInitial, StoreMaker | R | RInitial>;
160
160
  export interface Repos<T extends {
161
161
  id: unknown;
162
162
  }, Encoded extends {
@@ -20,7 +20,7 @@ declare const ContextMapContainer_base: (abstract new (service: {
20
20
  use: <X>(body: (_: {
21
21
  get: Effect<ContextMap>;
22
22
  start: Effect<void>;
23
- }) => X) => X extends Effect<infer A_1, infer E_1, infer R_3> ? Effect<A_1, E_1, ContextMapContainer | R_3> : Effect<X, never, ContextMapContainer>;
23
+ }) => X) => X extends Effect<infer A_1, infer E_1, infer R_3> ? Effect<A_1, E_1, R_3 | ContextMapContainer> : Effect<X, never, ContextMapContainer>;
24
24
  };
25
25
  /**
26
26
  * @tsplus companion ContextMapContainer.Ops
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@effect-app/infra",
3
- "version": "1.11.4",
3
+ "version": "1.12.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@azure/cosmos": "^4.1.0",
7
+ "@azure/cosmos": "^4.1.1",
8
8
  "@azure/service-bus": "^7.9.5",
9
9
  "express-oauth2-jwt-bearer": "^1.6.0",
10
10
  "@faker-js/faker": "^8.4.1",
@@ -12,22 +12,22 @@
12
12
  "@sendgrid/mail": "^8.1.3",
13
13
  "change-case": "^5.4.4",
14
14
  "cross-fetch": "^4.0.0",
15
- "fast-check": "~3.21.0",
15
+ "fast-check": "~3.22.0",
16
16
  "object-hash": "^3.0.0",
17
17
  "path-parser": "^6.1.0",
18
18
  "proper-lockfile": "^4.1.2",
19
19
  "pure-rand": "6.1.0",
20
20
  "redlock": "^4.2.0",
21
- "@effect-app/core": "1.6.1",
22
- "@effect-app/infra-adapters": "1.7.2",
23
- "@effect-app/schema": "1.6.1",
24
- "effect-app": "1.9.2"
21
+ "@effect-app/core": "1.7.0",
22
+ "@effect-app/infra-adapters": "1.8.1",
23
+ "effect-app": "1.10.1",
24
+ "@effect-app/schema": "1.7.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@babel/cli": "^7.24.8",
28
- "@sentry/node": "^8.26.0",
27
+ "@babel/cli": "^7.25.6",
28
+ "@sentry/node": "^8.28.0",
29
29
  "@types/express": "^4.17.21",
30
- "@types/node": "~22.3.0",
30
+ "@types/node": "~22.5.3",
31
31
  "@types/proper-lockfile": "^4.1.4",
32
32
  "@types/redis": "^2.8.32",
33
33
  "@types/redlock": "^4.0.7",
@@ -42,9 +42,9 @@
42
42
  },
43
43
  "peerDependencies": {
44
44
  "express": "^4.19.2",
45
- "@effect/platform": "^0.61.8",
46
- "@effect/schema": "^0.70.4",
47
- "effect": "^3.6.3"
45
+ "@effect/platform": "^0.63.1",
46
+ "@effect/schema": "^0.72.1",
47
+ "effect": "^3.7.1"
48
48
  },
49
49
  "typesVersions": {
50
50
  "*": {