@effect-app/infra 4.0.0-beta.18 → 4.0.0-beta.180
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 +1217 -0
- package/dist/CUPS.d.ts +15 -7
- package/dist/CUPS.d.ts.map +1 -1
- package/dist/CUPS.js +10 -12
- package/dist/Emailer/Sendgrid.d.ts +14 -14
- package/dist/Emailer/Sendgrid.d.ts.map +1 -1
- package/dist/Emailer/Sendgrid.js +16 -15
- package/dist/Emailer/fake.d.ts +1 -1
- package/dist/Emailer/service.d.ts +9 -3
- package/dist/Emailer/service.d.ts.map +1 -1
- package/dist/Emailer/service.js +3 -3
- package/dist/Emailer.d.ts +1 -1
- package/dist/MainFiberSet.d.ts +5 -5
- package/dist/MainFiberSet.d.ts.map +1 -1
- package/dist/MainFiberSet.js +3 -3
- package/dist/Model/Repository/Registry.d.ts +20 -0
- package/dist/Model/Repository/Registry.d.ts.map +1 -0
- package/dist/Model/Repository/Registry.js +17 -0
- package/dist/Model/Repository/ext.d.ts +33 -15
- package/dist/Model/Repository/ext.d.ts.map +1 -1
- package/dist/Model/Repository/ext.js +54 -2
- package/dist/Model/Repository/internal/internal.d.ts +6 -6
- package/dist/Model/Repository/internal/internal.d.ts.map +1 -1
- package/dist/Model/Repository/internal/internal.js +43 -32
- package/dist/Model/Repository/legacy.d.ts +1 -1
- package/dist/Model/Repository/makeRepo.d.ts +7 -6
- package/dist/Model/Repository/makeRepo.d.ts.map +1 -1
- package/dist/Model/Repository/makeRepo.js +5 -1
- package/dist/Model/Repository/service.d.ts +28 -23
- package/dist/Model/Repository/service.d.ts.map +1 -1
- package/dist/Model/Repository/validation.d.ts +142 -17
- package/dist/Model/Repository/validation.d.ts.map +1 -1
- package/dist/Model/Repository/validation.js +5 -5
- package/dist/Model/Repository.d.ts +2 -1
- package/dist/Model/Repository.d.ts.map +1 -1
- package/dist/Model/Repository.js +2 -1
- package/dist/Model/dsl.d.ts +4 -4
- package/dist/Model/dsl.d.ts.map +1 -1
- package/dist/Model/filter/filterApi.d.ts +5 -5
- package/dist/Model/filter/filterApi.d.ts.map +1 -1
- package/dist/Model/filter/types/errors.d.ts +1 -1
- package/dist/Model/filter/types/fields.d.ts +1 -1
- package/dist/Model/filter/types/path/common.d.ts +1 -1
- package/dist/Model/filter/types/path/eager.d.ts +1 -1
- package/dist/Model/filter/types/path/eager.d.ts.map +1 -1
- package/dist/Model/filter/types/path/index.d.ts +1 -1
- package/dist/Model/filter/types/utils.d.ts +1 -1
- package/dist/Model/filter/types/validator.d.ts +1 -1
- package/dist/Model/filter/types.d.ts +1 -1
- package/dist/Model/query/dsl.d.ts +1 -1
- package/dist/Model/query/dsl.d.ts.map +1 -1
- package/dist/Model/query/new-kid-interpreter.d.ts +6 -6
- package/dist/Model/query/new-kid-interpreter.d.ts.map +1 -1
- package/dist/Model/query/new-kid-interpreter.js +3 -3
- package/dist/Model/query.d.ts +1 -1
- package/dist/Model.d.ts +2 -1
- package/dist/Model.d.ts.map +1 -1
- package/dist/Model.js +2 -1
- package/dist/Operations.d.ts +6 -6
- package/dist/Operations.d.ts.map +1 -1
- package/dist/Operations.js +56 -59
- package/dist/OperationsRepo.d.ts +11 -29
- package/dist/OperationsRepo.d.ts.map +1 -1
- package/dist/OperationsRepo.js +3 -3
- package/dist/QueueMaker/SQLQueue.d.ts +5 -7
- package/dist/QueueMaker/SQLQueue.d.ts.map +1 -1
- package/dist/QueueMaker/SQLQueue.js +105 -114
- package/dist/QueueMaker/errors.d.ts +2 -2
- package/dist/QueueMaker/errors.d.ts.map +1 -1
- package/dist/QueueMaker/memQueue.d.ts +7 -4
- package/dist/QueueMaker/memQueue.d.ts.map +1 -1
- package/dist/QueueMaker/memQueue.js +51 -62
- package/dist/QueueMaker/sbqueue.d.ts +6 -3
- package/dist/QueueMaker/sbqueue.d.ts.map +1 -1
- package/dist/QueueMaker/sbqueue.js +37 -53
- package/dist/QueueMaker/service.d.ts +1 -1
- package/dist/RequestContext.d.ts +114 -26
- package/dist/RequestContext.d.ts.map +1 -1
- package/dist/RequestContext.js +7 -7
- package/dist/RequestFiberSet.d.ts +7 -7
- package/dist/RequestFiberSet.d.ts.map +1 -1
- package/dist/RequestFiberSet.js +5 -5
- package/dist/Store/ContextMapContainer.d.ts +19 -3
- package/dist/Store/ContextMapContainer.d.ts.map +1 -1
- package/dist/Store/ContextMapContainer.js +13 -3
- package/dist/Store/Cosmos/query.d.ts +1 -1
- package/dist/Store/Cosmos/query.d.ts.map +1 -1
- package/dist/Store/Cosmos/query.js +8 -10
- package/dist/Store/Cosmos.d.ts +1 -1
- package/dist/Store/Cosmos.d.ts.map +1 -1
- package/dist/Store/Cosmos.js +308 -242
- package/dist/Store/Disk.d.ts +2 -2
- package/dist/Store/Disk.d.ts.map +1 -1
- package/dist/Store/Disk.js +25 -22
- package/dist/Store/Memory.d.ts +4 -4
- package/dist/Store/Memory.d.ts.map +1 -1
- package/dist/Store/Memory.js +27 -22
- package/dist/Store/SQL/Pg.d.ts +4 -0
- package/dist/Store/SQL/Pg.d.ts.map +1 -0
- package/dist/Store/SQL/Pg.js +189 -0
- package/dist/Store/SQL/query.d.ts +38 -0
- package/dist/Store/SQL/query.d.ts.map +1 -0
- package/dist/Store/SQL/query.js +367 -0
- package/dist/Store/SQL.d.ts +20 -0
- package/dist/Store/SQL.d.ts.map +1 -0
- package/dist/Store/SQL.js +381 -0
- package/dist/Store/codeFilter.d.ts +1 -1
- package/dist/Store/codeFilter.d.ts.map +1 -1
- package/dist/Store/codeFilter.js +2 -1
- package/dist/Store/index.d.ts +5 -2
- package/dist/Store/index.d.ts.map +1 -1
- package/dist/Store/index.js +15 -3
- package/dist/Store/service.d.ts +17 -6
- package/dist/Store/service.d.ts.map +1 -1
- package/dist/Store/service.js +24 -6
- package/dist/Store/utils.d.ts +1 -1
- package/dist/Store/utils.d.ts.map +1 -1
- package/dist/Store/utils.js +3 -4
- package/dist/Store.d.ts +1 -1
- package/dist/adapters/SQL/Model.d.ts +28 -42
- package/dist/adapters/SQL/Model.d.ts.map +1 -1
- package/dist/adapters/SQL/Model.js +2 -2
- package/dist/adapters/SQL.d.ts +1 -1
- package/dist/adapters/ServiceBus.d.ts +9 -9
- package/dist/adapters/ServiceBus.d.ts.map +1 -1
- package/dist/adapters/ServiceBus.js +13 -15
- package/dist/adapters/cosmos-client.d.ts +3 -3
- package/dist/adapters/cosmos-client.d.ts.map +1 -1
- package/dist/adapters/cosmos-client.js +3 -3
- package/dist/adapters/index.d.ts +8 -2
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +8 -2
- package/dist/adapters/logger.d.ts +1 -1
- package/dist/adapters/logger.d.ts.map +1 -1
- package/dist/adapters/memQueue.d.ts +3 -3
- package/dist/adapters/memQueue.d.ts.map +1 -1
- package/dist/adapters/memQueue.js +3 -3
- package/dist/adapters/mongo-client.d.ts +3 -3
- package/dist/adapters/mongo-client.d.ts.map +1 -1
- package/dist/adapters/mongo-client.js +3 -3
- package/dist/adapters/redis-client.d.ts +3 -3
- package/dist/adapters/redis-client.d.ts.map +1 -1
- package/dist/adapters/redis-client.js +3 -3
- package/dist/api/ContextProvider.d.ts +7 -7
- package/dist/api/ContextProvider.d.ts.map +1 -1
- package/dist/api/ContextProvider.js +6 -6
- package/dist/api/codec.d.ts +1 -1
- package/dist/api/internal/RequestContextMiddleware.d.ts +2 -2
- package/dist/api/internal/RequestContextMiddleware.d.ts.map +1 -1
- package/dist/api/internal/RequestContextMiddleware.js +2 -2
- package/dist/api/internal/auth.d.ts +44 -6
- package/dist/api/internal/auth.d.ts.map +1 -1
- package/dist/api/internal/auth.js +160 -29
- package/dist/api/internal/events.d.ts +3 -3
- package/dist/api/internal/events.d.ts.map +1 -1
- package/dist/api/internal/events.js +9 -7
- package/dist/api/internal/health.d.ts +1 -1
- package/dist/api/layerUtils.d.ts +6 -6
- package/dist/api/layerUtils.d.ts.map +1 -1
- package/dist/api/layerUtils.js +5 -5
- package/dist/api/middlewares.d.ts +1 -1
- package/dist/api/reportError.d.ts +1 -1
- package/dist/api/routing/middleware/RouterMiddleware.d.ts +4 -4
- package/dist/api/routing/middleware/RouterMiddleware.d.ts.map +1 -1
- package/dist/api/routing/middleware/middleware.d.ts +50 -4
- package/dist/api/routing/middleware/middleware.d.ts.map +1 -1
- package/dist/api/routing/middleware/middleware.js +75 -17
- package/dist/api/routing/middleware.d.ts +1 -2
- package/dist/api/routing/middleware.d.ts.map +1 -1
- package/dist/api/routing/middleware.js +1 -2
- package/dist/api/routing/schema/jwt.d.ts +1 -1
- package/dist/api/routing/schema/jwt.d.ts.map +1 -1
- package/dist/api/routing/tsort.d.ts +1 -1
- package/dist/api/routing/tsort.d.ts.map +1 -1
- package/dist/api/routing/utils.d.ts +3 -3
- package/dist/api/routing/utils.d.ts.map +1 -1
- package/dist/api/routing.d.ts +26 -18
- package/dist/api/routing.d.ts.map +1 -1
- package/dist/api/routing.js +65 -10
- package/dist/api/setupRequest.d.ts +8 -5
- package/dist/api/setupRequest.d.ts.map +1 -1
- package/dist/api/setupRequest.js +12 -7
- package/dist/api/util.d.ts +1 -1
- package/dist/arbs.d.ts +1 -1
- package/dist/arbs.d.ts.map +1 -1
- package/dist/arbs.js +5 -3
- package/dist/errorReporter.d.ts +4 -4
- package/dist/errorReporter.d.ts.map +1 -1
- package/dist/errorReporter.js +20 -25
- package/dist/errors.d.ts +1 -1
- package/dist/fileUtil.d.ts +1 -1
- package/dist/fileUtil.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/logger/jsonLogger.d.ts +1 -1
- package/dist/logger/logFmtLogger.d.ts +1 -1
- package/dist/logger/shared.d.ts +1 -1
- package/dist/logger/shared.js +2 -2
- package/dist/logger.d.ts +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/rateLimit.d.ts +9 -3
- package/dist/rateLimit.d.ts.map +1 -1
- package/dist/rateLimit.js +5 -11
- package/dist/test.d.ts +1 -1
- package/dist/test.d.ts.map +1 -1
- package/dist/vitest.d.ts +1 -1
- package/eslint.config.mjs +3 -3
- package/examples/query.ts +39 -35
- package/package.json +42 -28
- package/src/CUPS.ts +9 -11
- package/src/Emailer/Sendgrid.ts +17 -14
- package/src/Emailer/service.ts +8 -2
- package/src/MainFiberSet.ts +3 -3
- package/src/Model/Repository/Registry.ts +33 -0
- package/src/Model/Repository/ext.ts +93 -6
- package/src/Model/Repository/internal/internal.ts +97 -88
- package/src/Model/Repository/makeRepo.ts +12 -10
- package/src/Model/Repository/service.ts +31 -22
- package/src/Model/Repository/validation.ts +4 -4
- package/src/Model/Repository.ts +1 -0
- package/src/Model/dsl.ts +3 -3
- package/src/Model/query/new-kid-interpreter.ts +2 -2
- package/src/Model.ts +1 -0
- package/src/Operations.ts +78 -113
- package/src/OperationsRepo.ts +2 -2
- package/src/QueueMaker/SQLQueue.ts +121 -151
- package/src/QueueMaker/memQueue.ts +82 -103
- package/src/QueueMaker/sbqueue.ts +56 -86
- package/src/RequestContext.ts +8 -8
- package/src/RequestFiberSet.ts +4 -4
- package/src/Store/ContextMapContainer.ts +41 -2
- package/src/Store/Cosmos/query.ts +9 -11
- package/src/Store/Cosmos.ts +437 -343
- package/src/Store/Disk.ts +52 -49
- package/src/Store/Memory.ts +54 -48
- package/src/Store/SQL/Pg.ts +318 -0
- package/src/Store/SQL/query.ts +409 -0
- package/src/Store/SQL.ts +668 -0
- package/src/Store/codeFilter.ts +1 -0
- package/src/Store/index.ts +17 -2
- package/src/Store/service.ts +31 -7
- package/src/Store/utils.ts +23 -22
- package/src/adapters/SQL/Model.ts +10 -4
- package/src/adapters/ServiceBus.ts +111 -115
- package/src/adapters/cosmos-client.ts +2 -2
- package/src/adapters/index.ts +7 -0
- package/src/adapters/memQueue.ts +2 -2
- package/src/adapters/mongo-client.ts +2 -2
- package/src/adapters/redis-client.ts +2 -2
- package/src/api/ContextProvider.ts +11 -11
- package/src/api/internal/RequestContextMiddleware.ts +1 -1
- package/src/api/internal/auth.ts +246 -44
- package/src/api/internal/events.ts +12 -8
- package/src/api/layerUtils.ts +8 -8
- package/src/api/routing/middleware/RouterMiddleware.ts +4 -4
- package/src/api/routing/middleware/middleware.ts +109 -15
- package/src/api/routing/middleware.ts +0 -2
- package/src/api/routing.ts +149 -12
- package/src/api/setupRequest.ts +28 -8
- package/src/arbs.ts +4 -2
- package/src/errorReporter.ts +62 -74
- package/src/logger/shared.ts +1 -1
- package/src/rateLimit.ts +30 -22
- package/test/auth.test.ts +101 -0
- package/test/contextProvider.test.ts +11 -11
- package/test/controller.test.ts +18 -14
- package/test/dist/auth.test.d.ts.map +1 -0
- package/test/dist/contextProvider.test.d.ts.map +1 -1
- package/test/dist/controller.test.d.ts.map +1 -1
- package/test/dist/date-query.test.d.ts.map +1 -0
- package/test/dist/fixtures.d.ts +26 -12
- package/test/dist/fixtures.d.ts.map +1 -1
- package/test/dist/fixtures.js +12 -10
- package/test/dist/query.test.d.ts.map +1 -1
- package/test/dist/rawQuery.test.d.ts.map +1 -1
- package/test/dist/repository-ext.test.d.ts.map +1 -0
- package/test/dist/requires.test.d.ts.map +1 -1
- package/test/dist/router-generator.test.d.ts.map +1 -0
- package/test/dist/routing-interruptibility.test.d.ts.map +1 -0
- package/test/dist/rpc-e2e-invalidation.test.d.ts.map +1 -0
- package/test/dist/rpc-multi-middleware.test.d.ts.map +1 -1
- package/test/dist/rpc-stream-fullstack.test.d.ts.map +1 -0
- package/test/dist/sql-store.test.d.ts.map +1 -0
- package/test/fixtures.ts +11 -9
- package/test/query.test.ts +216 -34
- package/test/rawQuery.test.ts +23 -19
- package/test/repository-ext.test.ts +60 -0
- package/test/requires.test.ts +6 -6
- package/test/router-generator.test.ts +180 -0
- package/test/routing-interruptibility.test.ts +63 -0
- package/test/rpc-e2e-invalidation.test.ts +507 -0
- package/test/rpc-multi-middleware.test.ts +78 -9
- package/test/rpc-stream-fullstack.test.ts +181 -0
- package/test/sql-store.test.ts +1064 -0
- package/test/validateSample.test.ts +15 -12
- package/tsconfig.examples.json +1 -1
- package/tsconfig.json +0 -1
- package/tsconfig.json.bak +2 -2
- package/tsconfig.src.json +35 -35
- package/tsconfig.test.json +2 -2
|
@@ -14,7 +14,8 @@ export interface Repository<
|
|
|
14
14
|
ItemType extends string,
|
|
15
15
|
IdKey extends keyof T,
|
|
16
16
|
RSchema,
|
|
17
|
-
RPublish
|
|
17
|
+
RPublish,
|
|
18
|
+
RProvided = never
|
|
18
19
|
> {
|
|
19
20
|
readonly itemType: ItemType
|
|
20
21
|
readonly idKey: IdKey
|
|
@@ -30,13 +31,21 @@ export interface Repository<
|
|
|
30
31
|
events?: Iterable<Evt>
|
|
31
32
|
) => Effect.Effect<void, never, RSchema | RPublish>
|
|
32
33
|
|
|
33
|
-
readonly removeById: (
|
|
34
|
+
readonly removeById: (
|
|
35
|
+
idOrIds: T[IdKey] | ReadonlyArray<T[IdKey]>
|
|
36
|
+
) => Effect.Effect<void, never, RSchema>
|
|
34
37
|
|
|
35
38
|
readonly queryRaw: <T, Out, R>(
|
|
36
39
|
schema: S.Codec<T, Out, R>,
|
|
37
40
|
raw: RawQuery<Encoded, Out>
|
|
38
41
|
) => Effect.Effect<readonly T[], S.SchemaError, R>
|
|
39
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Explicitly seed a namespace. Primary is seeded eagerly on initialization.
|
|
45
|
+
* Non-primary namespaces must be seeded explicitly before use.
|
|
46
|
+
*/
|
|
47
|
+
readonly seedNamespace: (namespace: string) => Effect.Effect<void>
|
|
48
|
+
|
|
40
49
|
readonly query: {
|
|
41
50
|
// ending with projection
|
|
42
51
|
<
|
|
@@ -53,7 +62,7 @@ export interface Repository<
|
|
|
53
62
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
54
63
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
55
64
|
| (TType extends "count" ? never : S.SchemaError),
|
|
56
|
-
R | RSchema
|
|
65
|
+
Exclude<R, RProvided> | RSchema
|
|
57
66
|
>
|
|
58
67
|
<
|
|
59
68
|
A,
|
|
@@ -73,7 +82,7 @@ export interface Repository<
|
|
|
73
82
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
74
83
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
75
84
|
| (TType extends "count" ? never : S.SchemaError),
|
|
76
|
-
R | RSchema
|
|
85
|
+
Exclude<R, RProvided> | RSchema
|
|
77
86
|
>
|
|
78
87
|
<
|
|
79
88
|
A,
|
|
@@ -95,7 +104,7 @@ export interface Repository<
|
|
|
95
104
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
96
105
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
97
106
|
| (TType extends "count" ? never : S.SchemaError),
|
|
98
|
-
R | RSchema
|
|
107
|
+
Exclude<R, RProvided> | RSchema
|
|
99
108
|
>
|
|
100
109
|
<
|
|
101
110
|
A,
|
|
@@ -119,7 +128,7 @@ export interface Repository<
|
|
|
119
128
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
120
129
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
121
130
|
| (TType extends "count" ? never : S.SchemaError),
|
|
122
|
-
R | RSchema
|
|
131
|
+
Exclude<R, RProvided> | RSchema
|
|
123
132
|
>
|
|
124
133
|
<
|
|
125
134
|
A,
|
|
@@ -145,7 +154,7 @@ export interface Repository<
|
|
|
145
154
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
146
155
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
147
156
|
| (TType extends "count" ? never : S.SchemaError),
|
|
148
|
-
R | RSchema
|
|
157
|
+
Exclude<R, RProvided> | RSchema
|
|
149
158
|
>
|
|
150
159
|
<
|
|
151
160
|
A,
|
|
@@ -171,7 +180,7 @@ export interface Repository<
|
|
|
171
180
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
172
181
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
173
182
|
| (TType extends "count" ? never : S.SchemaError),
|
|
174
|
-
R | RSchema
|
|
183
|
+
Exclude<R, RProvided> | RSchema
|
|
175
184
|
>
|
|
176
185
|
<
|
|
177
186
|
A,
|
|
@@ -199,7 +208,7 @@ export interface Repository<
|
|
|
199
208
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
200
209
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
201
210
|
| (TType extends "count" ? never : S.SchemaError),
|
|
202
|
-
R | RSchema
|
|
211
|
+
Exclude<R, RProvided> | RSchema
|
|
203
212
|
>
|
|
204
213
|
<
|
|
205
214
|
A,
|
|
@@ -229,7 +238,7 @@ export interface Repository<
|
|
|
229
238
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
230
239
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
231
240
|
| (TType extends "count" ? never : S.SchemaError),
|
|
232
|
-
R | RSchema
|
|
241
|
+
Exclude<R, RProvided> | RSchema
|
|
233
242
|
>
|
|
234
243
|
<
|
|
235
244
|
A,
|
|
@@ -261,7 +270,7 @@ export interface Repository<
|
|
|
261
270
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
262
271
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
263
272
|
| (TType extends "count" ? never : S.SchemaError),
|
|
264
|
-
R | RSchema
|
|
273
|
+
Exclude<R, RProvided> | RSchema
|
|
265
274
|
>
|
|
266
275
|
<
|
|
267
276
|
A,
|
|
@@ -295,7 +304,7 @@ export interface Repository<
|
|
|
295
304
|
TType extends "many" ? readonly A[] : TType extends "count" ? NonNegativeInt : A,
|
|
296
305
|
| (TType extends "many" ? never : NotFoundError<ItemType>)
|
|
297
306
|
| (TType extends "count" ? never : S.SchemaError),
|
|
298
|
-
R | RSchema
|
|
307
|
+
Exclude<R, RProvided> | RSchema
|
|
299
308
|
>
|
|
300
309
|
|
|
301
310
|
// ending with generic query
|
|
@@ -309,7 +318,7 @@ export interface Repository<
|
|
|
309
318
|
): Effect.Effect<
|
|
310
319
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
311
320
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
312
|
-
R | RSchema
|
|
321
|
+
Exclude<R, RProvided> | RSchema
|
|
313
322
|
>
|
|
314
323
|
<
|
|
315
324
|
R = never,
|
|
@@ -325,7 +334,7 @@ export interface Repository<
|
|
|
325
334
|
): Effect.Effect<
|
|
326
335
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
327
336
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
328
|
-
R | RSchema
|
|
337
|
+
Exclude<R, RProvided> | RSchema
|
|
329
338
|
>
|
|
330
339
|
<
|
|
331
340
|
R = never,
|
|
@@ -345,7 +354,7 @@ export interface Repository<
|
|
|
345
354
|
): Effect.Effect<
|
|
346
355
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
347
356
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
348
|
-
R | RSchema
|
|
357
|
+
Exclude<R, RProvided> | RSchema
|
|
349
358
|
>
|
|
350
359
|
<
|
|
351
360
|
R = never,
|
|
@@ -365,7 +374,7 @@ export interface Repository<
|
|
|
365
374
|
): Effect.Effect<
|
|
366
375
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
367
376
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
368
|
-
R | RSchema
|
|
377
|
+
Exclude<R, RProvided> | RSchema
|
|
369
378
|
>
|
|
370
379
|
<
|
|
371
380
|
R = never,
|
|
@@ -387,7 +396,7 @@ export interface Repository<
|
|
|
387
396
|
): Effect.Effect<
|
|
388
397
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
389
398
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
390
|
-
R | RSchema
|
|
399
|
+
Exclude<R, RProvided> | RSchema
|
|
391
400
|
>
|
|
392
401
|
<
|
|
393
402
|
R = never,
|
|
@@ -411,7 +420,7 @@ export interface Repository<
|
|
|
411
420
|
): Effect.Effect<
|
|
412
421
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
413
422
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
414
|
-
R | RSchema
|
|
423
|
+
Exclude<R, RProvided> | RSchema
|
|
415
424
|
>
|
|
416
425
|
<
|
|
417
426
|
R = never,
|
|
@@ -437,7 +446,7 @@ export interface Repository<
|
|
|
437
446
|
): Effect.Effect<
|
|
438
447
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined> : RefineTHelper<T, EncodedRefined>,
|
|
439
448
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
440
|
-
R | RSchema
|
|
449
|
+
Exclude<R, RProvided> | RSchema
|
|
441
450
|
>
|
|
442
451
|
<
|
|
443
452
|
R = never,
|
|
@@ -466,7 +475,7 @@ export interface Repository<
|
|
|
466
475
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined>
|
|
467
476
|
: RefineTHelper<T, EncodedRefined>,
|
|
468
477
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
469
|
-
R | RSchema
|
|
478
|
+
Exclude<R, RProvided> | RSchema
|
|
470
479
|
>
|
|
471
480
|
<
|
|
472
481
|
R = never,
|
|
@@ -497,7 +506,7 @@ export interface Repository<
|
|
|
497
506
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined>
|
|
498
507
|
: RefineTHelper<T, EncodedRefined>,
|
|
499
508
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
500
|
-
R | RSchema
|
|
509
|
+
Exclude<R, RProvided> | RSchema
|
|
501
510
|
>
|
|
502
511
|
<
|
|
503
512
|
R = never,
|
|
@@ -530,7 +539,7 @@ export interface Repository<
|
|
|
530
539
|
TType extends "many" ? DistributeQueryIfExclusiveOnArray<E, T, EncodedRefined>
|
|
531
540
|
: RefineTHelper<T, EncodedRefined>,
|
|
532
541
|
TType extends "many" ? never : NotFoundError<ItemType>,
|
|
533
|
-
R | RSchema
|
|
542
|
+
Exclude<R, RProvided> | RSchema
|
|
534
543
|
>
|
|
535
544
|
}
|
|
536
545
|
|
|
@@ -5,7 +5,7 @@ import { NonNegativeInt } from "effect-app/Schema"
|
|
|
5
5
|
* Represents a single validation error when decoding a repository item.
|
|
6
6
|
* Contains full context for debugging: raw data, jitM result, and decode error.
|
|
7
7
|
*/
|
|
8
|
-
export class ValidationError extends S.
|
|
8
|
+
export class ValidationError extends S.Opaque<ValidationError>()(S.Struct({
|
|
9
9
|
/** the id of the item that failed validation */
|
|
10
10
|
id: S.Unknown,
|
|
11
11
|
/** the raw data from the database before jitM */
|
|
@@ -14,12 +14,12 @@ export class ValidationError extends S.Class<ValidationError>("@effect-app/infra
|
|
|
14
14
|
jitMResult: S.Unknown,
|
|
15
15
|
/** the S.SchemaError from schema decode */
|
|
16
16
|
error: S.Unknown
|
|
17
|
-
}) {}
|
|
17
|
+
})) {}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Result of validating a sample of repository items.
|
|
21
21
|
*/
|
|
22
|
-
export class ValidationResult extends S.
|
|
22
|
+
export class ValidationResult extends S.Opaque<ValidationResult>()(S.Struct({
|
|
23
23
|
/** total number of items in the repository */
|
|
24
24
|
total: NonNegativeInt,
|
|
25
25
|
/** number of items that were sampled for validation */
|
|
@@ -28,4 +28,4 @@ export class ValidationResult extends S.Class<ValidationResult>("@effect-app/inf
|
|
|
28
28
|
valid: NonNegativeInt,
|
|
29
29
|
/** list of validation errors with full context */
|
|
30
30
|
errors: S.Array(ValidationError)
|
|
31
|
-
}) {}
|
|
31
|
+
})) {}
|
package/src/Model/Repository.ts
CHANGED
package/src/Model/dsl.ts
CHANGED
|
@@ -42,16 +42,16 @@ export function makeAllDSL<T, Evt>() {
|
|
|
42
42
|
|
|
43
43
|
export type OneDSL<T, Evt> =
|
|
44
44
|
& (<R, A, E, S1 extends T, S2 extends T>(
|
|
45
|
-
pure: (dsl: PureDSL<S1, S2, Evt>) => Effect.Effect<A, E,
|
|
45
|
+
pure: (dsl: PureDSL<S1, S2, Evt>) => Effect.Effect<A, E, R>
|
|
46
46
|
) => Effect.Effect<A, E, FixEnv<R, Evt, S1, S2>>)
|
|
47
47
|
& OneDSLExt<T, Evt>
|
|
48
48
|
|
|
49
49
|
export interface OneDSLExt<T, Evt> {
|
|
50
50
|
modify: <R, E, A, S1 extends T, S2 extends T>(
|
|
51
|
-
pure: (items: S1, dsl: PureDSL<S1, S2, Evt>) => Effect.Effect<A, E,
|
|
51
|
+
pure: (items: S1, dsl: PureDSL<S1, S2, Evt>) => Effect.Effect<A, E, R>
|
|
52
52
|
) => Effect.Effect<A, E, FixEnv<R, Evt, S1, S2> | PureEnvEnv<Evt, S1, S1>>
|
|
53
53
|
update: <R, E, S1 extends T, S2 extends T>(
|
|
54
|
-
pure: (items: S1, log: (...evt: Evt[]) => PureLogT<Evt>) => Effect.Effect<S2, E,
|
|
54
|
+
pure: (items: S1, log: (...evt: Evt[]) => PureLogT<Evt>) => Effect.Effect<S2, E, R>
|
|
55
55
|
) => Effect.Effect<S2, E, FixEnv<R, Evt, S1, S2>>
|
|
56
56
|
updateWith: <S1 extends T, S2 extends T>(
|
|
57
57
|
upd: (item: S1) => S2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
3
|
-
import { Array, identity, Match, Option, pipe, S } from "effect-app"
|
|
3
|
+
import { Array, identity, Match, Option, pipe, S, SchemaAST } from "effect-app"
|
|
4
4
|
import { toNonEmptyArray } from "effect-app/Array"
|
|
5
5
|
import { dropUndefinedT } from "effect-app/utils"
|
|
6
6
|
import type { FilterResult } from "../filter/filterApi.js"
|
|
@@ -165,7 +165,7 @@ export const toFilter = <
|
|
|
165
165
|
let select: (keyof TFieldValues | { key: string; subKeys: string[] })[] = []
|
|
166
166
|
// TODO: support more complex (nested) schemas?
|
|
167
167
|
if (schema) {
|
|
168
|
-
const t = walkTransformation(schema.ast)
|
|
168
|
+
const t = walkTransformation(SchemaAST.toEncoded(schema.ast))
|
|
169
169
|
if (S.AST.isObjects(t)) {
|
|
170
170
|
select = t.propertySignatures.map((_) => _.name as string)
|
|
171
171
|
for (const prop of t.propertySignatures) {
|
package/src/Model.ts
CHANGED
package/src/Operations.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reportError } from "@effect-app/infra/errorReporter"
|
|
2
2
|
import { subHours } from "date-fns"
|
|
3
|
-
import { Cause, copy, Duration, Effect, Exit, type Fiber, Layer, Option, S, Schedule
|
|
3
|
+
import { Cause, Context, copy, Duration, Effect, Exit, type Fiber, Layer, Option, S, Schedule } from "effect-app"
|
|
4
4
|
import { annotateLogscoped } from "effect-app/Effect"
|
|
5
5
|
import { dual, pipe } from "effect-app/Function"
|
|
6
6
|
import { Operation, OperationFailure, OperationId, type OperationProgress, OperationSuccess } from "effect-app/Operations"
|
|
@@ -20,6 +20,33 @@ const make = Effect.gen(function*() {
|
|
|
20
20
|
const reqFiberSet = yield* RequestFiberSet
|
|
21
21
|
const makeOp = Effect.sync(() => OperationId.make())
|
|
22
22
|
|
|
23
|
+
const addOp = Effect.fnUntraced(function*(id: OperationId, title: NonEmptyString2k) {
|
|
24
|
+
return yield* repo.save(Operation.make({ id, title })).pipe(Effect.orDie)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const finishOp = Effect.fnUntraced(function*(id: OperationId, exit: Exit.Exit<unknown, unknown>) {
|
|
28
|
+
const op = yield* repo.get(id).pipe(Effect.orDie)
|
|
29
|
+
const result = Exit.isSuccess(exit)
|
|
30
|
+
? OperationSuccess.make({})
|
|
31
|
+
: OperationFailure.make({
|
|
32
|
+
message: Cause.hasInterruptsOnly(exit.cause)
|
|
33
|
+
? NonEmptyString2k("Interrupted")
|
|
34
|
+
: Cause.hasDies(exit.cause)
|
|
35
|
+
? NonEmptyString2k("Unknown error")
|
|
36
|
+
: Cause
|
|
37
|
+
.findErrorOption(exit.cause)
|
|
38
|
+
.pipe(
|
|
39
|
+
Option.flatMap((_) =>
|
|
40
|
+
typeof _ === "object" && _ !== null && "message" in _ && S.is(NonEmptyString2k)(_.message)
|
|
41
|
+
? Option.some(_.message)
|
|
42
|
+
: Option.none()
|
|
43
|
+
),
|
|
44
|
+
Option.getOrNull
|
|
45
|
+
)
|
|
46
|
+
})
|
|
47
|
+
return yield* repo.save(copy(op, { updatedAt: new Date(), result })).pipe(Effect.orDie)
|
|
48
|
+
})
|
|
49
|
+
|
|
23
50
|
const register = (title: NonEmptyString2k) =>
|
|
24
51
|
Effect.tap(
|
|
25
52
|
makeOp,
|
|
@@ -30,53 +57,20 @@ const make = Effect.gen(function*() {
|
|
|
30
57
|
)
|
|
31
58
|
)
|
|
32
59
|
|
|
33
|
-
const cleanup = Effect
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
const cleanup = Effect
|
|
61
|
+
.gen(function*() {
|
|
62
|
+
const before = subHours(new Date(), 1)
|
|
63
|
+
const ops = yield* repo.query(where("updatedAt", "lt", before.toISOString()))
|
|
64
|
+
return yield* pipe(ops, batch(100, Effect.succeed, (items) => repo.removeAndPublish(items)))
|
|
65
|
+
})
|
|
66
|
+
.pipe(setupRequestContextFromCurrent("Operations.cleanup"))
|
|
38
67
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return repo.
|
|
44
|
-
}
|
|
45
|
-
function finishOp(id: OperationId, exit: Exit.Exit<unknown, unknown>) {
|
|
46
|
-
return Effect
|
|
47
|
-
.flatMap(repo.get(id).pipe(Effect.orDie), (_) =>
|
|
48
|
-
repo
|
|
49
|
-
.save(
|
|
50
|
-
copy(_, {
|
|
51
|
-
updatedAt: new Date(),
|
|
52
|
-
result: Exit.isSuccess(exit)
|
|
53
|
-
? new OperationSuccess()
|
|
54
|
-
: new OperationFailure({
|
|
55
|
-
message: Cause.hasInterruptsOnly(exit.cause)
|
|
56
|
-
? NonEmptyString2k("Interrupted")
|
|
57
|
-
: Cause.hasDies(exit.cause)
|
|
58
|
-
? NonEmptyString2k("Unknown error")
|
|
59
|
-
: Cause
|
|
60
|
-
.findErrorOption(exit.cause)
|
|
61
|
-
.pipe(
|
|
62
|
-
Option.flatMap((_) =>
|
|
63
|
-
typeof _ === "object" && _ !== null && "message" in _ && S.is(NonEmptyString2k)(_.message)
|
|
64
|
-
? Option.some(_.message)
|
|
65
|
-
: Option.none()
|
|
66
|
-
),
|
|
67
|
-
Option.getOrNull
|
|
68
|
-
)
|
|
69
|
-
})
|
|
70
|
-
})
|
|
71
|
-
)
|
|
72
|
-
.pipe(Effect.orDie))
|
|
73
|
-
}
|
|
74
|
-
function update(id: OperationId, progress: OperationProgress) {
|
|
75
|
-
return Effect.flatMap(
|
|
76
|
-
repo.get(id).pipe(Effect.orDie),
|
|
77
|
-
(_) => repo.save(copy(_, { updatedAt: new Date(), progress })).pipe(Effect.orDie)
|
|
78
|
-
)
|
|
79
|
-
}
|
|
68
|
+
const findOp = (id: OperationId) => repo.find(id)
|
|
69
|
+
|
|
70
|
+
const update = Effect.fnUntraced(function*(id: OperationId, progress: OperationProgress) {
|
|
71
|
+
const op = yield* repo.get(id).pipe(Effect.orDie)
|
|
72
|
+
return yield* repo.save(copy(op, { updatedAt: new Date(), progress })).pipe(Effect.orDie)
|
|
73
|
+
})
|
|
80
74
|
|
|
81
75
|
function fork<R, R2, E, E2, A, A2>(
|
|
82
76
|
self: (id: OperationId) => Effect.Effect<A, E, R>,
|
|
@@ -87,29 +81,18 @@ const make = Effect.gen(function*() {
|
|
|
87
81
|
never,
|
|
88
82
|
Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>
|
|
89
83
|
> {
|
|
90
|
-
return Effect
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
reqFiberSet
|
|
99
|
-
.forkDaemonReportUnexpected(Scope.use(
|
|
100
|
-
self(id).pipe(Effect.withSpan(title, {}, { captureStackTrace: false })),
|
|
101
|
-
scope
|
|
102
|
-
))
|
|
103
|
-
.pipe(Effect.map((fiber): RunningOperation<A, E> => ({ fiber, id })))
|
|
104
|
-
),
|
|
105
|
-
Effect.tap(({ id }) =>
|
|
106
|
-
Effect.interruptible(fnc(id)).pipe(
|
|
107
|
-
Effect.forkScoped,
|
|
108
|
-
Scope.provide(scope)
|
|
109
|
-
)
|
|
110
|
-
)
|
|
111
|
-
)
|
|
84
|
+
return Effect.gen(function*() {
|
|
85
|
+
const scope = yield* Scope.make()
|
|
86
|
+
const id = yield* Scope.provide(register(title), scope)
|
|
87
|
+
const fiber = yield* reqFiberSet.forkDaemonReportUnexpected(
|
|
88
|
+
Scope.use(
|
|
89
|
+
self(id).pipe(Effect.withSpan(title, {}, { captureStackTrace: false })),
|
|
90
|
+
scope
|
|
91
|
+
)
|
|
112
92
|
)
|
|
93
|
+
yield* Scope.provide(Effect.forkScoped(Effect.interruptible(fnc(id))), scope)
|
|
94
|
+
return { fiber, id } satisfies RunningOperation<A, E>
|
|
95
|
+
})
|
|
113
96
|
}
|
|
114
97
|
|
|
115
98
|
const fork2: {
|
|
@@ -122,24 +105,20 @@ const make = Effect.gen(function*() {
|
|
|
122
105
|
): Effect.Effect<RunningOperation<A, E>, never, Exclude<R, Scope.Scope>>
|
|
123
106
|
} = dual(
|
|
124
107
|
2,
|
|
125
|
-
|
|
126
|
-
Effect.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
self(id).pipe(Effect.withSpan(title, {}, { captureStackTrace: false })),
|
|
137
|
-
scope
|
|
138
|
-
))
|
|
139
|
-
.pipe(Effect.map((fiber): RunningOperation<A, E> => ({ fiber, id })))
|
|
140
|
-
)
|
|
141
|
-
)
|
|
108
|
+
Effect.fnUntraced(function*<R, E, A>(
|
|
109
|
+
self: (opId: OperationId) => Effect.Effect<A, E, R>,
|
|
110
|
+
title: NonEmptyString2k
|
|
111
|
+
) {
|
|
112
|
+
const scope = yield* Scope.make()
|
|
113
|
+
const id = yield* Scope.provide(register(title), scope)
|
|
114
|
+
const fiber = yield* reqFiberSet.forkDaemonReportUnexpected(
|
|
115
|
+
Scope.use(
|
|
116
|
+
self(id).pipe(Effect.withSpan(title, {}, { captureStackTrace: false })),
|
|
117
|
+
scope
|
|
118
|
+
)
|
|
142
119
|
)
|
|
120
|
+
return { fiber, id } satisfies RunningOperation<A, E>
|
|
121
|
+
})
|
|
143
122
|
)
|
|
144
123
|
|
|
145
124
|
const forkOperation: {
|
|
@@ -152,28 +131,21 @@ const make = Effect.gen(function*() {
|
|
|
152
131
|
): Effect.Effect<RunningOperation<A, E>, never, Exclude<R, Scope.Scope>>
|
|
153
132
|
} = dual(
|
|
154
133
|
2,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.flatMap((id) =>
|
|
164
|
-
reqFiberSet
|
|
165
|
-
.forkDaemonReportUnexpected(Scope.use(
|
|
166
|
-
self.pipe(Effect.withSpan(title, {}, { captureStackTrace: false })),
|
|
167
|
-
scope
|
|
168
|
-
))
|
|
169
|
-
.pipe(Effect.map((fiber): RunningOperation<A, E> => ({ fiber, id })))
|
|
170
|
-
)
|
|
171
|
-
)
|
|
134
|
+
Effect.fnUntraced(function*<R, E, A>(self: Effect.Effect<A, E, R>, title: NonEmptyString2k) {
|
|
135
|
+
const scope = yield* Scope.make()
|
|
136
|
+
const id = yield* Scope.provide(register(title), scope)
|
|
137
|
+
const fiber = yield* reqFiberSet.forkDaemonReportUnexpected(
|
|
138
|
+
Scope.use(
|
|
139
|
+
self.pipe(Effect.withSpan(title, {}, { captureStackTrace: false })),
|
|
140
|
+
scope
|
|
141
|
+
)
|
|
172
142
|
)
|
|
143
|
+
return { fiber, id } satisfies RunningOperation<A, E>
|
|
144
|
+
})
|
|
173
145
|
)
|
|
174
146
|
|
|
175
147
|
function forkOperationFunction<R, E, A, Inp>(fnc: (inp: Inp) => Effect.Effect<A, E, R>, title: NonEmptyString2k) {
|
|
176
|
-
return (inp: Inp) => fnc(inp)
|
|
148
|
+
return (inp: Inp) => forkOperation(fnc(inp), title)
|
|
177
149
|
}
|
|
178
150
|
|
|
179
151
|
return {
|
|
@@ -189,19 +161,12 @@ const make = Effect.gen(function*() {
|
|
|
189
161
|
}
|
|
190
162
|
})
|
|
191
163
|
|
|
192
|
-
export class Operations extends
|
|
164
|
+
export class Operations extends Context.Opaque<Operations>()("effect-app/Operations", { make }) {
|
|
193
165
|
private static readonly CleanupLive = this
|
|
194
166
|
.use((_) =>
|
|
195
167
|
_.cleanup.pipe(
|
|
196
168
|
Effect.exit,
|
|
197
|
-
Effect
|
|
198
|
-
.flatMap((_) => {
|
|
199
|
-
if (Exit.isSuccess(_)) {
|
|
200
|
-
return Effect.void
|
|
201
|
-
} else {
|
|
202
|
-
return reportAppError(_.cause)
|
|
203
|
-
}
|
|
204
|
-
}),
|
|
169
|
+
Effect.flatMap((exit) => Exit.isSuccess(exit) ? Effect.void : reportAppError(exit.cause)),
|
|
205
170
|
Effect.schedule(Schedule.fixed(Duration.minutes(20))),
|
|
206
171
|
Effect.map((_) => _ as never),
|
|
207
172
|
MainFiberSet.run
|
package/src/OperationsRepo.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Context, Effect } from "effect-app"
|
|
2
2
|
import { Operation } from "effect-app/Operations"
|
|
3
3
|
import { makeRepo } from "./Model.js"
|
|
4
4
|
|
|
5
|
-
export class OperationsRepo extends
|
|
5
|
+
export class OperationsRepo extends Context.Service<OperationsRepo>()(
|
|
6
6
|
"OperationRepo",
|
|
7
7
|
{
|
|
8
8
|
make: Effect.gen(function*() {
|