@effect-app/infra 0.54.3 → 0.54.4
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 +11 -0
- package/_cjs/RequestContext.cjs +0 -1
- package/_cjs/RequestContext.cjs.map +1 -1
- package/_src/RequestContext.ts +1 -1
- package/dist/RequestContext.d.ts +0 -1
- package/dist/RequestContext.d.ts.map +1 -1
- package/dist/RequestContext.js +1 -2
- package/dist/services/Repository.d.ts +14 -14
- package/dist/services/RepositoryBase.d.ts +1 -1
- package/dist/services/simpledb/cosmosdb.d.ts +2 -2
- package/dist/services/simpledb/diskdb.d.ts +1 -1
- package/dist/services/simpledb/memdb.d.ts +1 -1
- package/dist/services/simpledb/redisdb.d.ts +2 -2
- package/dist/services/simpledb/simpledb.d.ts +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @effect-app/infra
|
|
2
2
|
|
|
3
|
+
## 0.54.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix global
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @effect-app/prelude@0.44.4
|
|
10
|
+
- @effect-app/core@0.47.1
|
|
11
|
+
- @effect-app/infra-adapters@0.40.4
|
|
12
|
+
- @effect-app/schema@0.39.4
|
|
13
|
+
|
|
3
14
|
## 0.54.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/_cjs/RequestContext.cjs
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RequestId = exports.RequestContextParent = exports.RequestContext = void 0;
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/_ext/Schema.ext"));
|
|
9
|
-
require("@effect-app/prelude/_global.ext");
|
|
10
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
11
|
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestContext.cjs","names":["
|
|
1
|
+
{"version":3,"file":"RequestContext.cjs","names":["RequestId","tsplus_module_1","StringId","exports","RequestContextParent","MNModel","_tag","literal","id","name","ReasonableString","user","tsplus_module_2","optionalProp","props","prop","locale","createdAt","withDefaultProp","date","__decorate","useClassFeaturesForSchema","RequestContext","RequestContext_1","omit","withDefault","rootId","parent","namespace","inherit","newSelf","toMonitoring","self","operationName","parentOperationName","parentLocale","Encoded","EncodedClass"],"sources":["../_src/RequestContext.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;AAEO,MAAMA,SAAS,GAAAC,eAAA,CAAGC,QAAQ;AAAAC,OAAA,CAAAH,SAAA,GAAAA,SAAA;AAIjC,IAAaI,oBAAoB,GAAjC,MAAaA,oBAAqB,SAAQH,eAAA,CAAAI,OAAO,EAK9C,CAAC;EAC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AI,CAACvB,IAAI;MACxBO,MAAM,EAAEgB,IAAI,CAAChB,MAAM;MACnB,IAAIgB,IAAI,CAACL,MAAM,GACX;QAAEO,mBAAmB,EAAEF,IAAI,CAACL,MAAM,CAAClB,IAAI;QAAE0B,YAAY,EAAEH,IAAI,CAACL,MAAM,CAACX;MAAM,CAAE,GAC3E,EAAE;KACP;EACH;CACD;AAAAb,OAAA,CAAAmB,cAAA,GAAAA,cAAA;AAlCYnB,OAAA,CAAAmB,cAAA,GAAAA,cAAc,GAAAC,gBAAA,GAAAH,UAAA,E,gBAD1BC,yBAAyB,C,EACbC,cAAc,CAkC1B;AAKD;AACA;AACA;AACA,WAAiBlB,oBAAoB;EACnC;;;;EAIA,MAAagC,OAAQ,SAAQnC,eAAA,CAAAoC,YAAY,EAA+B;EAA3DjC,oBAAA,CAAAgC,OAAO,GAAAA,OAAuD;AAI7E,CAAC,EATgBhC,oBAAoB,KAAAD,OAAA,CAAAC,oBAAA,GAApBA,oBAAoB;AAUrC,WAAiBkB,cAAc;EAC7B;;;;EAIA,MAAac,OAAQ,SAAQnC,eAAA,CAAAoC,YAAY,EAAyB;EAArDf,cAAA,CAAAc,OAAO,GAAAA,OAAiD;AAIvE,CAAC,EATgBd,cAAc,KAAAnB,OAAA,CAAAmB,cAAA,GAAdA,cAAc"}
|
package/_src/RequestContext.ts
CHANGED
package/dist/RequestContext.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ParsedShapeOfCustom, useClassFeaturesForSchema, MNModel, literal, ReasonableString, props, prop, StringId, date, EncodedClass, ConstructorInputFromApi, GetProvidedProps } from "@effect-app/prelude/schema";
|
|
2
|
-
import "@effect-app/prelude/_global.ext";
|
|
3
2
|
export declare const RequestId: import("@effect-app/prelude/schema").StringIdSchema & import("@effect-app/schema").Utils<import("@effect-app/prelude/schema").StringIdSchema> & {
|
|
4
3
|
make: () => import("@effect-app/prelude/schema").StringId;
|
|
5
4
|
withDefault: import("@effect-app/schema").Property<import("@effect-app/schema").SchemaDefaultSchema<unknown, import("@effect-app/prelude/schema").StringId, string, string, import("@effect-app/schema").ApiSelfType<import("@effect-app/prelude/schema").StringId>>, "required", import("@effect/data/Option").None<any>, import("@effect/data/Option").Some<["constructor", () => import("@effect-app/prelude/schema").StringId]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestContext.d.ts","sourceRoot":"","sources":["../_src/RequestContext.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RequestContext.d.ts","sourceRoot":"","sources":["../_src/RequestContext.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,SAAS;;;CAAW,CAAA;AACjC,MAAM,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,SAAS,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAE7D,qBACa,oBAAqB,SAAQ,yBAYxC;CAAG;AACL,oCAAoC;AACpC,MAAM,MAAM,+BAA+B,GAAG,OAAO,oBAAoB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzE;;;GAGG;AACH,qBACa,cAAe,SAAQ,mBAWlC;IACA,MAAM,CAAC,OAAO,CACZ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,oBAAoB,CAAC,gBAAgB;IAUhD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc;;;;;;CASrD;AAED,oCAAoC;AACpC,MAAM,MAAM,yBAAyB,GAAG,OAAO,cAAc,CAAA;AAK7D,yBAAiB,oBAAoB,CAAC;;;;;;;;;;;IACpC;;;OAGG;IACH,MAAM,OAAO,OAAQ,SAAQ,YAA2C;KAAG;IAC3E,MAAM,WAAW,gBACf,SAAQ,uBAAuB,CAAC,OAAO,oBAAoB,CAAC;KAAG;IACjE,MAAM,WAAW,KAAM,SAAQ,gBAAgB,CAAC,OAAO,oBAAoB,CAAC;KAAG;;CAChF;AACD,yBAAiB,cAAc,CAAC;;;;;;;;;;;;;;IAC9B;;;OAGG;IACH,MAAM,OAAO,OAAQ,SAAQ,cAAqC;KAAG;IACrE,MAAM,WAAW,gBACf,SAAQ,uBAAuB,CAAC,OAAO,cAAc,CAAC;KAAG;IAC3D,MAAM,WAAW,KAAM,SAAQ,gBAAgB,CAAC,OAAO,cAAc,CAAC;KAAG;;CAC1E"}
|
package/dist/RequestContext.js
CHANGED
|
@@ -7,7 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var RequestContext_1;
|
|
8
8
|
import * as tsplus_module_1 from "@effect-app/prelude/schema";
|
|
9
9
|
import * as tsplus_module_2 from "@effect-app/prelude/_ext/Schema.ext";
|
|
10
|
-
import "@effect-app/prelude/_global.ext";
|
|
11
10
|
export const RequestId = tsplus_module_1.StringId;
|
|
12
11
|
let RequestContextParent = class RequestContextParent extends tsplus_module_1.MNModel()({
|
|
13
12
|
_tag: tsplus_module_1.literal("RequestContext"),
|
|
@@ -76,4 +75,4 @@ export { RequestContext };
|
|
|
76
75
|
}
|
|
77
76
|
RequestContext.Encoded = Encoded;
|
|
78
77
|
})(RequestContext || (RequestContext = {}));
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVxdWVzdENvbnRleHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9fc3JjL1JlcXVlc3RDb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUVBLE1BQU0sQ0FBQyxNQUFNLFNBQVMsbUJBQUcsUUFBUSxDQUFBO0FBSWpDLElBQWEsb0JBQW9CLEdBQWpDLE1BQWEsb0JBQXFCLFNBQVEsZ0JBQUEsT0FBTyxFQUs5QyxDQUFDO0lBQ0YsSUFBSSxFQUFFLGdCQUFBLE9BQU8sQ0FBQyxnQkFBZ0Is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FDeEIsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO1lBQ25CLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTTtnQkFDYixDQUFDLENBQUMsRUFBRSxtQkFBbUIsRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxZQUFZLEVBQUUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUU7Z0JBQzdFLENBQUMsQ0FBQyxFQUFFLENBQUM7U0FDUixDQUFBO0lBQ0gsQ0FBQztDQUNGLENBQUE7QUFsQ1ksY0FBYztvQkFEMUIseUJBQXlCO0dBQ2IsY0FBYyxDQWtDMUI7U0FsQ1ksY0FBYztBQXVDM0IsZ0NBQWdDO0FBQ2hDLEVBQUU7QUFDRixvQkFBb0I7QUFDcEIsV0FBaUIsb0JBQW9CO0lBQ25DOzs7T0FHRztJQUNILE1BQWEsT0FBUSxTQUFRLGdCQUFBLFlBQVksRUFBK0I7S0FBRztJQUE5RCw0QkFBTyxVQUF1RCxDQUFBO0FBSTdFLENBQUMsRUFUZ0Isb0JBQW9CLEtBQXBCLG9CQUFvQixRQVNwQztBQUNELFdBQWlCLGNBQWM7SUFDN0I7OztPQUdHO0lBQ0gsTUFBYSxPQUFRLFNBQVEsZ0JBQUEsWUFBWSxFQUF5QjtLQUFHO0lBQXhELHNCQUFPLFVBQWlELENBQUE7QUFJdkUsQ0FBQyxFQVRnQixjQUFjLEtBQWQsY0FBYyxRQVM5QiJ9
|
|
@@ -182,7 +182,7 @@ export declare function queryAndSavePureEffect<T extends {
|
|
|
182
182
|
skip?: number;
|
|
183
183
|
}>): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, S[], S2[]>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | R | Exclude<R2, {
|
|
184
184
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S[], S2[]>;
|
|
185
|
-
}>,
|
|
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<T extends {
|
|
|
198
198
|
skip?: number;
|
|
199
199
|
}): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, S[], S2[]>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R2, {
|
|
200
200
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S[], S2[]>;
|
|
201
|
-
}>,
|
|
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<T extends {
|
|
|
209
209
|
id: string;
|
|
210
210
|
}, 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, S1[], S2[]>, E, A>) => (items: Iterable<S1>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
211
211
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1[], S2[]>;
|
|
212
|
-
}>,
|
|
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<T extends {
|
|
|
220
220
|
id: string;
|
|
221
221
|
}, 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, {
|
|
222
222
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, T, S2>;
|
|
223
|
-
}>,
|
|
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<T extends {
|
|
|
234
234
|
id: T["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<RequestContextContainer | ContextMap | Exclude<R, {
|
|
236
236
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, T, S2>;
|
|
237
|
-
}>,
|
|
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, ItemType>, items: Iterable<S1>, pure: Effect<FixEnv<R, Evt, S1[], S2[]>, E, A>): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
247
247
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1[], S2[]>;
|
|
248
|
-
}>,
|
|
248
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A>;
|
|
249
249
|
/**
|
|
250
250
|
* @tsplus fluent Repository saveWithPure_
|
|
251
251
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -256,12 +256,12 @@ 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, ItemType>, item: S1, pure: Effect<FixEnv<R, Evt, S1, S2>, E, A>): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
258
258
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1, S2>;
|
|
259
|
-
}>,
|
|
259
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A>;
|
|
260
260
|
export declare function saveAllWithEffectInt<T extends {
|
|
261
261
|
id: string;
|
|
262
262
|
}, PM extends {
|
|
263
263
|
id: string;
|
|
264
|
-
}, 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,
|
|
264
|
+
}, 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
265
|
/**
|
|
266
266
|
* @tsplus fluent Repository queryAndSavePureEffectBatched
|
|
267
267
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -277,7 +277,7 @@ export declare function queryAndSavePureEffectBatched<T extends {
|
|
|
277
277
|
skip?: number;
|
|
278
278
|
}>, batchSize?: number): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, S[], S2[]>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | R | Exclude<R2, {
|
|
279
279
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S[], S2[]>;
|
|
280
|
-
}>,
|
|
280
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E | E2, A[]>;
|
|
281
281
|
/**
|
|
282
282
|
* @tsplus fluent Repository queryAndSavePureBatched
|
|
283
283
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -293,7 +293,7 @@ export declare function queryAndSavePureBatched<T extends {
|
|
|
293
293
|
skip?: number;
|
|
294
294
|
}, batchSize?: number): <R2, A, E2, S2 extends T>(pure: import("@effect/io/Effect").Effect<FixEnv<R2, Evt, S[], S2[]>, E2, A>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R2, {
|
|
295
295
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S[], S2[]>;
|
|
296
|
-
}>,
|
|
296
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E2, A[]>;
|
|
297
297
|
/**
|
|
298
298
|
* @tsplus fluent Repository saveManyWithPureBatched
|
|
299
299
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -304,7 +304,7 @@ export declare function saveManyWithPureBatched<T extends {
|
|
|
304
304
|
id: string;
|
|
305
305
|
}, 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, S1[], S2[]>, E, A>) => (items: Iterable<S1>) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
306
306
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1[], S2[]>;
|
|
307
|
-
}>,
|
|
307
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A[]>;
|
|
308
308
|
/**
|
|
309
309
|
* @tsplus fluent Repository saveManyWithPureBatched_
|
|
310
310
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -315,7 +315,7 @@ export declare function saveManyWithPureBatched_<Id extends string, R, T extends
|
|
|
315
315
|
id: string;
|
|
316
316
|
}, 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, S1[], S2[]>, E, A>, batchSize?: number): import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap | Exclude<R, {
|
|
317
317
|
env: import("@effect-app/prelude/Pure").PureEnv<Evt, S1[], S2[]>;
|
|
318
|
-
}>,
|
|
318
|
+
}>, OptimisticConcurrencyException | InvalidStateError | E, A[]>;
|
|
319
319
|
export type AllDSL<T, Evt> = (<R, A, E, S1 extends T, S2 extends T>(pure: (dsl: PureDSL<S1[], S2[], Evt>) => Effect<R, E, A>) => Effect<FixEnv<R, Evt, S1[], S2[]>, E, A>) & AllDSLExt<T, Evt>;
|
|
320
320
|
/**
|
|
321
321
|
* @tsplus type DSLExt
|
|
@@ -364,7 +364,7 @@ export declare function save<T extends {
|
|
|
364
364
|
id: string;
|
|
365
365
|
}, PM extends {
|
|
366
366
|
id: string;
|
|
367
|
-
}, Evt, ItemType extends string>(self: Repository<T, PM, Evt, ItemType>): (items_0: T, ...items_1: T[]) => import("@effect/io/Effect").Effect<RequestContextContainer | ContextMap,
|
|
367
|
+
}, 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
368
|
/**
|
|
369
369
|
* @tsplus getter Repository saveWithEvents
|
|
370
370
|
* @tsplus location "@effect-app/infra/services/Repository"
|
|
@@ -373,5 +373,5 @@ export declare function saveWithEvents<T extends {
|
|
|
373
373
|
id: string;
|
|
374
374
|
}, PM extends {
|
|
375
375
|
id: string;
|
|
376
|
-
}, 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,
|
|
376
|
+
}, 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
377
|
//# 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?: "
|
|
105
|
+
}) => Where | readonly [Where, ...Where[]], mode?: "or" | "and" | 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<
|
|
9
|
+
find: (id: string) => import("@effect/io/Effect").Effect<simpledb.RecordCache | RDecode | Cosmos.CosmosClient, 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<
|
|
11
|
+
save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode | Cosmos.CosmosClient, 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, CouldNotAquireDbLockException | import("./shared.js").OptimisticLockException
|
|
9
|
+
save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode, CouldNotAquireDbLockException | simpledb.InvalidStateError | import("./shared.js").OptimisticLockException, A>;
|
|
10
10
|
};
|
|
11
11
|
export declare function initialise(dir: string): void;
|
|
12
12
|
//# sourceMappingURL=diskdb.d.ts.map
|
|
@@ -7,6 +7,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
8
|
find: (id: string) => import("@effect/io/Effect").Effect<simpledb.RecordCache | RDecode, MO.CondemnException | simpledb.InvalidStateError, import("@effect/data/Option").Option<A>>;
|
|
9
9
|
findBy: <V extends Partial<A>>(keys: V, eq: import("@effect/data/typeclass/Equivalence").Equivalence<V>) => import("@effect/io/Effect").Effect<RDecode, MO.CondemnException, import("@effect/data/Option").Option<A & {}>>;
|
|
10
|
-
save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode, MO.CondemnException | import("./shared.js").OptimisticLockException
|
|
10
|
+
save: (record: A) => import("@effect/io/Effect").Effect<simpledb.RecordCache | REncode, MO.CondemnException | simpledb.InvalidStateError | import("./shared.js").OptimisticLockException, A>;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=memdb.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<RedisClient | simpledb.RecordCache
|
|
9
|
+
find: (id: string) => import("@effect/io/Effect").Effect<RDecode | RedisClient | simpledb.RecordCache, simpledb.InvalidStateError, import("@effect/data/Option").Option<A>>;
|
|
10
10
|
findByIndex: (index: Index) => import("@effect/io/Effect").Effect<RedisClient, import("@effect-app/infra-adapters/redis-client").ConnectionException, import("@effect/data/Option").Option<TKey>>;
|
|
11
|
-
save: (record: A) => import("@effect/io/Effect").Effect<RedisClient | simpledb.RecordCache
|
|
11
|
+
save: (record: A) => import("@effect/io/Effect").Effect<REncode | RedisClient | simpledb.RecordCache, CouldNotAquireDbLockException | simpledb.InvalidStateError | import("./shared.js").OptimisticLockException, 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<any>, import("@effect/data/Option").None<any>>;
|
|
@@ -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<
|
|
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
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
|
-
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<
|
|
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<R | RecordCache | Exclude<R2, import("@effect/io/Scope").Scope>, E | E2 | InvalidStateError | OptimisticLockException, 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.54.
|
|
3
|
+
"version": "0.54.4",
|
|
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.44.
|
|
23
|
-
"@effect-app/core": "0.47.
|
|
24
|
-
"@effect-app/
|
|
25
|
-
"@effect-app/
|
|
22
|
+
"@effect-app/prelude": "0.44.4",
|
|
23
|
+
"@effect-app/core": "0.47.1",
|
|
24
|
+
"@effect-app/schema": "0.39.4",
|
|
25
|
+
"@effect-app/infra-adapters": "0.40.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/cli": "^7.21.0",
|