@effect-app/infra 0.131.0 → 0.132.0
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 +12 -0
- package/_cjs/services/Emailer/service.cjs.map +1 -1
- package/_cjs/services/Operations/service.cjs.map +1 -1
- package/_cjs/services/RequestContextContainer.cjs +14 -36
- package/_cjs/services/RequestContextContainer.cjs.map +1 -1
- package/_cjs/services/Store/ContextMapContainer.cjs +6 -28
- package/_cjs/services/Store/ContextMapContainer.cjs.map +1 -1
- package/_cjs/services/Store/service.cjs.map +1 -1
- package/_src/services/Emailer/service.ts +3 -3
- package/_src/services/Operations/service.ts +10 -9
- package/_src/services/RequestContextContainer.ts +15 -23
- package/_src/services/Store/ContextMapContainer.ts +9 -18
- package/_src/services/Store/service.ts +8 -6
- package/dist/services/Emailer/service.d.ts +6 -3
- package/dist/services/Emailer/service.d.ts.map +1 -1
- package/dist/services/Emailer/service.js +1 -1
- package/dist/services/Operations/live.d.ts +2 -1
- package/dist/services/Operations/live.d.ts.map +1 -1
- package/dist/services/Operations/service.d.ts +21 -13
- package/dist/services/Operations/service.d.ts.map +1 -1
- package/dist/services/Operations/service.js +1 -1
- package/dist/services/RepositoryBase.d.ts +1 -1
- package/dist/services/RequestContextContainer.d.ts +11 -15
- package/dist/services/RequestContextContainer.d.ts.map +1 -1
- package/dist/services/RequestContextContainer.js +9 -30
- package/dist/services/Store/ContextMapContainer.d.ts +9 -12
- package/dist/services/Store/ContextMapContainer.d.ts.map +1 -1
- package/dist/services/Store/ContextMapContainer.js +2 -26
- package/dist/services/Store/service.d.ts +16 -8
- package/dist/services/Store/service.d.ts.map +1 -1
- package/dist/services/Store/service.js +1 -1
- package/dist/services/simpledb/cosmosdb.d.ts +2 -2
- package/dist/services/simpledb/diskdb.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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @effect-app/infra
|
|
2
2
|
|
|
3
|
+
## 0.132.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4330242: improve: TagClass
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [4330242]
|
|
12
|
+
- @effect-app/infra-adapters@0.84.0
|
|
13
|
+
- @effect-app/prelude@0.106.0
|
|
14
|
+
|
|
3
15
|
## 0.131.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.cjs","names":["Emailer","tsplus_module_1","TagClass","exports"],"sources":["../../../_src/services/Emailer/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAIA;;;;AAIM,
|
|
1
|
+
{"version":3,"file":"service.cjs","names":["Emailer","tsplus_module_1","TagClass","exports"],"sources":["../../../_src/services/Emailer/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAIA;;;;AAIM,MAAOA,OAAQ,SAAQC,eAAA,CAAAC,QAAQ,EAEjC;AAAGC,OAAA,CAAAH,OAAA,GAAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.cjs","names":["Scope","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","forkOperation","exports","forkOperation_1","Operations","tsplus_module_1","TagClass","self","tsplus_module_3","flatMap","make","scope","tap","extend","register","tsplus_module_2","forkDaemonReportRequestUnexpected","use","forkOperationFunction","fnc","inp","forkOperation2","id","forkOperationWithEffect","opId","forkScoped","interruptible"],"sources":["../../../_src/services/Operations/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAqC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"service.cjs","names":["Scope","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","forkOperation","exports","forkOperation_1","Operations","tsplus_module_1","TagClass","self","tsplus_module_3","flatMap","make","scope","tap","extend","register","tsplus_module_2","forkDaemonReportRequestUnexpected","use","forkOperationFunction","fnc","inp","forkOperation2","id","forkOperationWithEffect","opId","forkScoped","interruptible"],"sources":["../../../_src/services/Operations/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAqC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,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CAAC,EAAKX,KAAK,CAAC,CAAkC,CAAC,CACtE,CACN;AACH;AAEA;;;AAGM,SAAUY,uBAAuBA,CACrChB,IAA0C,EAC1CY,GAA4C;EAE5C,OAAOX,eAAA,CAAAC,OAAA,CAAAL,UAAU,EACdA,UAAU,IACTI,eAAA,CAAAC,OAAA,CAAAhC,KAAK,CACFiC,IAAI,EAAE,EACGC,KAAK,IACbH,eAAA,CAAAI,GAAA,CAAAJ,eAAA,CAAAI,GAAA,CAAAnC,KAvEO,CAAAoC,MAAA,CAuEPT,UAAU,CACPU,QAAQ,EACDH,KAAK,CAAC,EACRa,IAAI,IAAIT,eAAA,CAAAC,iCAAA,CAACvC,KA1EV,CAAAwC,GAAA,CA0EUV,IAAI,CAACiB,IAAI,CAAC,EAAKb,KAAK,CAAC,CAAkC,CAAC,EACjEa,IAAI,IAAK/C,KA3EV,CAAAoC,MAAA,CAAAL,eAAA,CAAAiB,UAAA,CAAAjB,eAAA,CAAAkB,aAAA,CA2EUP,GAAG,CAACK,IAAI,CAAC,IAAiCb,KAAK,CAAC,CAAC,CACnE,CACN;AACH"}
|
|
@@ -3,32 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.spanAttributes = exports.live = exports.
|
|
6
|
+
exports.spanAttributes = exports.live = exports.RequestContextContainer = exports.RCTag = void 0;
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/prelude/service"));
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("effect/Effect"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("effect/Option"));
|
|
10
10
|
var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/core/Option"));
|
|
11
11
|
var tsplus_module_5 = _interopRequireWildcard(require("effect/Context"));
|
|
12
|
-
var tsplus_module_6 = _interopRequireWildcard(require("
|
|
13
|
-
var tsplus_module_7 = _interopRequireWildcard(require("effect/
|
|
14
|
-
var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/
|
|
12
|
+
var tsplus_module_6 = _interopRequireWildcard(require("effect/FiberRef"));
|
|
13
|
+
var tsplus_module_7 = _interopRequireWildcard(require("@effect-app/infra/services/Store/Memory"));
|
|
14
|
+
var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
|
|
15
15
|
var tsplus_module_9 = _interopRequireWildcard(require("effect/Layer"));
|
|
16
16
|
var _ids = require("@effect-app/prelude/ids");
|
|
17
17
|
var _RequestContext = require("../RequestContext.cjs");
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
-
var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function (receiver, state, value, kind, f) {
|
|
21
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
22
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
23
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
24
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
25
|
-
};
|
|
26
|
-
var __classPrivateFieldGet = void 0 && (void 0).__classPrivateFieldGet || function (receiver, state, kind, f) {
|
|
27
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
28
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
29
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
|
-
};
|
|
31
|
-
var _RequestContextContainerImpl_ref;
|
|
32
20
|
/**
|
|
33
21
|
* @tsplus type RequestContextContainer
|
|
34
22
|
* @tsplus companion RequestContextContainer.Ops
|
|
@@ -41,29 +29,19 @@ class RequestContextContainer extends tsplus_module_1.TagClass() {
|
|
|
41
29
|
return tsplus_module_2.flatMap(tsplus_module_2.contextWith(_ => tsplus_module_5.getOption(_, RequestContextContainer)), requestContext => tsplus_module_3.isSome(requestContext) ? tsplus_module_2.map(requestContext.value.requestContext, tsplus_module_3.some) : tsplus_module_2.sync(() => tsplus_module_4.none));
|
|
42
30
|
}
|
|
43
31
|
}
|
|
44
|
-
exports.RequestContextContainer = RequestContextContainer;
|
|
45
|
-
class RequestContextContainerImpl extends RequestContextContainer {
|
|
46
|
-
constructor() {
|
|
47
|
-
super();
|
|
48
|
-
_RequestContextContainerImpl_ref.set(this, void 0);
|
|
49
|
-
this.update = f => tsplus_module_2.tap(tsplus_module_7.getAndUpdate(__classPrivateFieldGet(this, _RequestContextContainerImpl_ref, "f"), f), rc => tsplus_module_2.annotateCurrentSpan(spanAttributes_1(rc)));
|
|
50
|
-
this.start = a => tsplus_module_2.zipRight(tsplus_module_8.restoreFromRequestContext(a))(tsplus_module_7.set(__classPrivateFieldGet(this, _RequestContextContainerImpl_ref, "f"), a));
|
|
51
|
-
__classPrivateFieldSet(this, _RequestContextContainerImpl_ref, tsplus_module_7.unsafeMake(new _RequestContext.RequestContext({
|
|
52
|
-
name: tsplus_module_6.NonEmptyString255("_root_"),
|
|
53
|
-
rootId: (0, _ids.RequestId)("_root_"),
|
|
54
|
-
locale: "en"
|
|
55
|
-
})), "f");
|
|
56
|
-
}
|
|
57
|
-
get requestContext() {
|
|
58
|
-
return tsplus_module_7.get(__classPrivateFieldGet(this, _RequestContextContainerImpl_ref, "f"));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.RequestContextContainerImpl = RequestContextContainerImpl;
|
|
62
|
-
_RequestContextContainerImpl_ref = new WeakMap();
|
|
63
32
|
/**
|
|
64
33
|
* @tsplus static RequestContextContainer.Ops live
|
|
65
34
|
*/
|
|
66
|
-
|
|
35
|
+
exports.RequestContextContainer = RequestContextContainer;
|
|
36
|
+
const live = exports.live = tsplus_module_9.effect(RequestContextContainer)(tsplus_module_2.map(tsplus_module_2.andThen(tsplus_module_2.sync(() => new _RequestContext.RequestContext({
|
|
37
|
+
name: tsplus_module_8.NonEmptyString255("_root_"),
|
|
38
|
+
rootId: (0, _ids.RequestId)("_root_"),
|
|
39
|
+
locale: "en"
|
|
40
|
+
})), tsplus_module_6.make), ref => ({
|
|
41
|
+
requestContext: tsplus_module_6.get(ref),
|
|
42
|
+
update: f => tsplus_module_2.tap(tsplus_module_6.getAndUpdate(ref, f), rc => tsplus_module_2.annotateCurrentSpan(spanAttributes_1(rc))),
|
|
43
|
+
start: a => tsplus_module_2.zipRight(tsplus_module_7.restoreFromRequestContext(a))(tsplus_module_6.set(ref, a))
|
|
44
|
+
})));
|
|
67
45
|
/** @tsplus static RequestContext.Ops Tag */
|
|
68
46
|
const RCTag = exports.RCTag = tsplus_module_5.Tag();
|
|
69
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestContextContainer.cjs","names":["_ids","require","_RequestContext","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RequestContextContainer","tsplus_module_1","TagClass","tsplus_module_2","flatMap","_","requestContext","getOption","contextWith","tsplus_module_5","tsplus_module_3","isSome","map","value","some","sync","tsplus_module_4","none","exports","
|
|
1
|
+
{"version":3,"file":"RequestContextContainer.cjs","names":["_ids","require","_RequestContext","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RequestContextContainer","tsplus_module_1","TagClass","tsplus_module_2","flatMap","_","requestContext","getOption","contextWith","tsplus_module_5","tsplus_module_3","isSome","map","value","some","sync","tsplus_module_4","none","exports","live","tsplus_module_9","effect","andThen","RequestContext","name","tsplus_module_8","NonEmptyString255","rootId","RequestId","locale","tsplus_module_6","make","ref","update","f","tap","getAndUpdate","rc","annotateCurrentSpan","spanAttributes_1","start","zipRight","tsplus_module_7","restoreFromRequestContext","RCTag","Tag","ctx","id","namespace","userProfile","sub","roles","undefined","spanAttributes"],"sources":["../../_src/services/RequestContextContainer.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAAqD,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,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W,GACZH,GAAG,CAACG,WAAW,CAACE,KAAK,GACrBC;GACL,GACC,EAAE;CACP,CAAC;MAhBWC,cAAc,GAAAnC,OAAA,CAAAmC,cAAA,GAAAd,gBAAA"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.live = exports.RCTag = exports.
|
|
6
|
+
exports.live = exports.RCTag = exports.ContextMapContainer = void 0;
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/prelude/service"));
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("effect/Effect"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("effect/Option"));
|
|
@@ -15,18 +15,6 @@ var tsplus_module_8 = _interopRequireWildcard(require("effect/Layer"));
|
|
|
15
15
|
var _service3 = require("./service.cjs");
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
var __classPrivateFieldSet = void 0 && (void 0).__classPrivateFieldSet || function (receiver, state, value, kind, f) {
|
|
19
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
20
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
21
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
22
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
23
|
-
};
|
|
24
|
-
var __classPrivateFieldGet = void 0 && (void 0).__classPrivateFieldGet || function (receiver, state, kind, f) {
|
|
25
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
26
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
27
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
28
|
-
};
|
|
29
|
-
var _ContextMapContainerImpl_ref;
|
|
30
18
|
// TODO: we have to create a new contextmap on every request.
|
|
31
19
|
// we want to share one map during startup
|
|
32
20
|
// but we want to make sure we don't re-use the startup map after startup
|
|
@@ -43,24 +31,14 @@ class ContextMapContainer extends tsplus_module_1.TagClass() {
|
|
|
43
31
|
return tsplus_module_2.flatMap(tsplus_module_2.contextWith(_ => tsplus_module_5.getOption(_, ContextMapContainer)), ctx => tsplus_module_3.isSome(ctx) ? tsplus_module_2.map(ctx.value.get, tsplus_module_3.some) : tsplus_module_2.sync(() => tsplus_module_4.none));
|
|
44
32
|
}
|
|
45
33
|
}
|
|
46
|
-
exports.ContextMapContainer = ContextMapContainer;
|
|
47
|
-
class ContextMapContainerImpl extends ContextMapContainer {
|
|
48
|
-
constructor() {
|
|
49
|
-
super();
|
|
50
|
-
_ContextMapContainerImpl_ref.set(this, void 0);
|
|
51
|
-
this.start = tsplus_module_2.flatMap(tsplus_module_7.makeMap, _ => tsplus_module_6.set(__classPrivateFieldGet(this, _ContextMapContainerImpl_ref, "f"), _));
|
|
52
|
-
__classPrivateFieldSet(this, _ContextMapContainerImpl_ref, tsplus_module_6.unsafeMake((0, _service3.makeContextMap)()), "f");
|
|
53
|
-
}
|
|
54
|
-
get get() {
|
|
55
|
-
return tsplus_module_6.get(__classPrivateFieldGet(this, _ContextMapContainerImpl_ref, "f"));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.ContextMapContainerImpl = ContextMapContainerImpl;
|
|
59
|
-
_ContextMapContainerImpl_ref = new WeakMap();
|
|
60
34
|
/**
|
|
61
35
|
* @tsplus static ContextMapContainer.Ops live
|
|
62
36
|
*/
|
|
63
|
-
|
|
37
|
+
exports.ContextMapContainer = ContextMapContainer;
|
|
38
|
+
const live = exports.live = tsplus_module_8.effect(ContextMapContainer)(tsplus_module_2.map(tsplus_module_2.andThen(tsplus_module_2.sync(() => (0, _service3.makeContextMap)()), tsplus_module_6.make), ref => new ContextMapContainer({
|
|
39
|
+
get: tsplus_module_6.get(ref),
|
|
40
|
+
start: tsplus_module_2.flatMap(tsplus_module_7.makeMap, _ => tsplus_module_6.set(ref, _))
|
|
41
|
+
})));
|
|
64
42
|
/** @tsplus static ContextMap.Ops Tag */
|
|
65
43
|
const RCTag = exports.RCTag = tsplus_module_5.Tag();
|
|
66
44
|
//# sourceMappingURL=ContextMapContainer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMapContainer.cjs","names":["_service3","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ContextMapContainer","tsplus_module_1","TagClass","tsplus_module_2","flatMap","_","getOption","contextWith","tsplus_module_5","ctx","tsplus_module_3","isSome","map","value","some","sync","tsplus_module_4","none","exports","
|
|
1
|
+
{"version":3,"file":"ContextMapContainer.cjs","names":["_service3","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ContextMapContainer","tsplus_module_1","TagClass","tsplus_module_2","flatMap","_","getOption","contextWith","tsplus_module_5","ctx","tsplus_module_3","isSome","map","value","some","sync","tsplus_module_4","none","exports","live","tsplus_module_8","effect","andThen","makeContextMap","tsplus_module_6","make","ref","start","tsplus_module_7","makeMap","RCTag","Tag"],"sources":["../../../_src/services/Store/ContextMapContainer.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAAyD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,C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C;AAAC,CAAE,CAAC,CAAC,CAC9E;AAE/B;AACO,MAAMyB,KAAK,GAAAZ,OAAA,CAAAY,KAAA,GAAGtB,eAAA,CAAAuB,GAAG,EAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.cjs","names":["StoreMaker","tsplus_module_1","TagClass","exports","makeContextMap","etags","Map","getEtag","id","get","setEtag","eTag","undefined","delete","set","parsedCache","parserCache","setAndReturn","p","np","parserEnv","lax","cache","getOrSetParser","i","getOrSet","getOrSetParsers","parsers","Object","entries","reduce","prev","k","v","parse","c","f","nf","makeMap","tsplus_module_2","sync","ContextMap"],"sources":["../../../_src/services/Store/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AAoGA;;;;AAIM,
|
|
1
|
+
{"version":3,"file":"service.cjs","names":["StoreMaker","tsplus_module_1","TagClass","exports","makeContextMap","etags","Map","getEtag","id","get","setEtag","eTag","undefined","delete","set","parsedCache","parserCache","setAndReturn","p","np","parserEnv","lax","cache","getOrSetParser","i","getOrSet","getOrSetParsers","parsers","Object","entries","reduce","prev","k","v","parse","c","f","nf","makeMap","tsplus_module_2","sync","ContextMap"],"sources":["../../../_src/services/Store/service.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AAoGA;;;;AAIM,MAAOA,UAAW,SAAQC,eAAA,CAAAC,QAAQ,EAMpC;AACHC,OAAA,CAAAH,UAAA,GAAAA,UAAA;AAEM,MAAMI,cAAc,GAAGA,CAAA,KAAiB;EAC7C,MAAMC,KAAK,GAAG,IAAIC,GAAG,EAAkB;EACvC,MAAMC,OAAO,GAAIC,EAAU,IAAKH,KAAK,CAACI,GAAG,CAACD,EAAE,CAAC;EAC7C,MAAME,OAAO,GAAGA,CAACF,EAAU,EAAEG,IAAwB,KAAI;IACvDA,IAAI,KAAKC,SAAS,GAAGP,KAAK,CAACQ,MAAM,CAACL,EAAE,CAAC,GAAGH,KAAK,CAACS,GAAG,CAACN,EAAE,EAAEG,IAAI,CAAC;E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ACX;QACF,CAAC,MAAM;UACL,MAAMA,EAAE,GAAGH,KAAK,CAACV,CAAC,EAAEJ,SAAS,CAAC;UAC9BL,WAAW,CAACD,GAAG,CAACoB,KAAK,EAAE,IAAI5B,GAAG,CAAC,CAAC,CAACkB,CAAC,EAAEa,EAAE,CAAC,CAAC,CAAC,CAAC;UAC1C,OAAOA,EAAE;QACX;MACF;;GAEH;EAED,OAAO;IACL5B,GAAG,EAAEF,OAAO;IACZO,GAAG,EAAEJ,OAAO;IACZU;GACD;AACH,CAAC;AAED;;;AAAAjB,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAGO,MAAMkC,OAAO,GAAAnC,OAAA,CAAAmC,OAAA,GAAGC,eAAA,CAAAC,IAAA,CAAY,MAAMpC,cAAc,EAAE,CAAC;AAE1D;;;;AAIM,MAAOqC,UAAW,SAAQxC,eAAA,CAAAC,QAAQ,EAIpC;AACHC,OAAA,CAAAsC,UAAA,GAAAA,UAAA"}
|
|
@@ -6,9 +6,9 @@ import type sgMail from "@sendgrid/mail"
|
|
|
6
6
|
* @tsplus type Emailer
|
|
7
7
|
* @tsplus companion Emailer.Ops
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
export class Emailer extends TagClass<Emailer, {
|
|
10
|
+
sendMail: (msg: EmailMsgOptionalFrom) => Effect<never, Error | ResponseError, void>
|
|
11
|
+
}>() {}
|
|
12
12
|
|
|
13
13
|
export interface SendgridConfig {
|
|
14
14
|
defaultReplyTo?: Email | { name?: NonEmptyString255; email: Email }
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { Operation, OperationId, OperationProgress } from "@effect-app/prelude/Operations"
|
|
2
2
|
import * as Scope from "effect/Scope"
|
|
3
3
|
|
|
4
|
-
export interface OperationsId {
|
|
5
|
-
readonly _: unique symbol
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
/**
|
|
9
5
|
* @tsplus type Operations
|
|
10
6
|
* @tsplus companion Operations.Ops
|
|
11
7
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
export class Operations extends TagClass<Operations.Id, {
|
|
9
|
+
register: Effect<Scope.Scope, never, OperationId>
|
|
10
|
+
update: (id: OperationId, progress: OperationProgress) => Effect<never, never, void>
|
|
11
|
+
find: (id: OperationId) => Effect<never, never, Option<Operation>>
|
|
12
|
+
cleanup: Effect<never, never, void>
|
|
13
|
+
}, Operations>() {}
|
|
14
|
+
export namespace Operations {
|
|
15
|
+
export interface Id {
|
|
16
|
+
readonly _: unique symbol
|
|
17
|
+
}
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -5,10 +5,11 @@ import { RequestContext } from "../RequestContext.js"
|
|
|
5
5
|
* @tsplus type RequestContextContainer
|
|
6
6
|
* @tsplus companion RequestContextContainer.Ops
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export class RequestContextContainer extends TagClass<RequestContextContainer, {
|
|
9
|
+
requestContext: Effect<never, never, RequestContext>
|
|
10
|
+
update: (f: (rc: RequestContext) => RequestContext) => Effect<never, never, RequestContext>
|
|
11
|
+
start: (f: RequestContext) => Effect<never, never, void>
|
|
12
|
+
}>() {
|
|
12
13
|
static get get(): Effect<RequestContextContainer, never, RequestContext> {
|
|
13
14
|
return RequestContextContainer.flatMap((_) => _.requestContext)
|
|
14
15
|
}
|
|
@@ -23,28 +24,19 @@ export abstract class RequestContextContainer extends TagClass<RequestContextCon
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export class RequestContextContainerImpl extends RequestContextContainer {
|
|
27
|
-
#ref: FiberRef<RequestContext>
|
|
28
|
-
constructor() {
|
|
29
|
-
super()
|
|
30
|
-
this.#ref = FiberRef.unsafeMake<RequestContext>(
|
|
31
|
-
new RequestContext({ name: NonEmptyString255("_root_"), rootId: RequestId("_root_"), locale: "en" })
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
override get requestContext() {
|
|
36
|
-
return this.#ref.get
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
override update = (f: (a: RequestContext) => RequestContext) =>
|
|
40
|
-
this.#ref.getAndUpdate(f).tap((rc) => Effect.annotateCurrentSpan(rc.spanAttributes))
|
|
41
|
-
override start = (a: RequestContext) => this.#ref.set(a) > a.restoreStoreId
|
|
42
|
-
}
|
|
43
|
-
|
|
44
27
|
/**
|
|
45
28
|
* @tsplus static RequestContextContainer.Ops live
|
|
46
29
|
*/
|
|
47
|
-
export const live = Effect
|
|
30
|
+
export const live = Effect
|
|
31
|
+
.sync(() => new RequestContext({ name: NonEmptyString255("_root_"), rootId: RequestId("_root_"), locale: "en" }))
|
|
32
|
+
.andThen(FiberRef.make<RequestContext>)
|
|
33
|
+
.map((ref) => ({
|
|
34
|
+
requestContext: ref.get,
|
|
35
|
+
update: (f: (a: RequestContext) => RequestContext) =>
|
|
36
|
+
ref.getAndUpdate(f).tap((rc) => Effect.annotateCurrentSpan(rc.spanAttributes)),
|
|
37
|
+
start: (a: RequestContext) => ref.set(a) > a.restoreStoreId
|
|
38
|
+
}))
|
|
39
|
+
.toLayer(RequestContextContainer)
|
|
48
40
|
|
|
49
41
|
/** @tsplus static RequestContext.Ops Tag */
|
|
50
42
|
export const RCTag = Tag<RequestContext>()
|
|
@@ -9,9 +9,10 @@ import { ContextMap, makeContextMap } from "./service.js"
|
|
|
9
9
|
/**
|
|
10
10
|
* @tsplus companion ContextMapContainer.Ops
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export class ContextMapContainer extends TagClass<ContextMapContainer, {
|
|
13
|
+
get: Effect<never, never, ContextMap>
|
|
14
|
+
start: Effect<never, never, void>
|
|
15
|
+
}>() {
|
|
15
16
|
static get get(): Effect<ContextMapContainer, never, ContextMap> {
|
|
16
17
|
return ContextMapContainer.flatMap((_) => _.get)
|
|
17
18
|
}
|
|
@@ -26,24 +27,14 @@ export abstract class ContextMapContainer extends TagClass<ContextMapContainer>(
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export class ContextMapContainerImpl extends ContextMapContainer {
|
|
30
|
-
#ref: FiberRef<ContextMap>
|
|
31
|
-
constructor() {
|
|
32
|
-
super()
|
|
33
|
-
this.#ref = FiberRef.unsafeMake<ContextMap>(makeContextMap())
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
override get get() {
|
|
37
|
-
return this.#ref.get
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
override start = ContextMap.Make.flatMap((_) => this.#ref.set(_))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
30
|
/**
|
|
44
31
|
* @tsplus static ContextMapContainer.Ops live
|
|
45
32
|
*/
|
|
46
|
-
export const live = Effect
|
|
33
|
+
export const live = Effect
|
|
34
|
+
.sync(() => makeContextMap())
|
|
35
|
+
.andThen(FiberRef.make<ContextMap>)
|
|
36
|
+
.map((ref) => new ContextMapContainer({ get: ref.get, start: ContextMap.Make.flatMap((_) => ref.set(_)) }))
|
|
37
|
+
.toLayer(ContextMapContainer)
|
|
47
38
|
|
|
48
39
|
/** @tsplus static ContextMap.Ops Tag */
|
|
49
40
|
export const RCTag = Tag<ContextMap>()
|
|
@@ -102,12 +102,13 @@ export interface Store<PM extends PersistenceModelType<Id>, Id extends string> {
|
|
|
102
102
|
* @tsplus type StoreMaker
|
|
103
103
|
* @tsplus companion StoreMaker.Ops
|
|
104
104
|
*/
|
|
105
|
-
export
|
|
106
|
-
|
|
105
|
+
export class StoreMaker extends TagClass<StoreMaker, {
|
|
106
|
+
make: <PM extends PersistenceModelType<Id>, Id extends string, R = never, E = never>(
|
|
107
107
|
name: string,
|
|
108
108
|
seed?: Effect<R, E, Iterable<PM>>,
|
|
109
109
|
config?: StoreConfig<PM>
|
|
110
110
|
) => Effect<R, E, Store<PM, Id>>
|
|
111
|
+
}>() {
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export const makeContextMap = (): ContextMap => {
|
|
@@ -184,10 +185,11 @@ export const makeMap = Effect.sync(() => makeContextMap())
|
|
|
184
185
|
* @tsplus type ContextMap
|
|
185
186
|
* @tsplus companion ContextMap.Ops
|
|
186
187
|
*/
|
|
187
|
-
export
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
export class ContextMap extends TagClass<ContextMap, {
|
|
189
|
+
get: (id: string) => string | undefined
|
|
190
|
+
set: (id: string, eTag: string | undefined) => void
|
|
191
|
+
parserEnv: ParserEnv
|
|
192
|
+
}>() {
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
export interface PersistenceModelType<Id extends string> {
|
|
@@ -6,13 +6,16 @@ import { NonEmptyReadonlyArray } from "effect/ReadonlyArray";
|
|
|
6
6
|
import type { MailContent, MailData } from "@sendgrid/helpers/classes/mail.js";
|
|
7
7
|
import type { ResponseError } from "@sendgrid/mail";
|
|
8
8
|
import type sgMail from "@sendgrid/mail";
|
|
9
|
-
declare const Emailer_base: (
|
|
9
|
+
declare const Emailer_base: (new (service: {
|
|
10
|
+
sendMail: (msg: EmailMsgOptionalFrom) => Effect<never, Error | ResponseError, void>;
|
|
11
|
+
}) => Readonly<{
|
|
12
|
+
sendMail: (msg: EmailMsgOptionalFrom) => Effect<never, Error | ResponseError, void>;
|
|
13
|
+
}>) & import("effect/Context").Tag<Emailer, Emailer>;
|
|
10
14
|
/**
|
|
11
15
|
* @tsplus type Emailer
|
|
12
16
|
* @tsplus companion Emailer.Ops
|
|
13
17
|
*/
|
|
14
|
-
export declare
|
|
15
|
-
abstract sendMail: (msg: EmailMsgOptionalFrom) => Effect<never, Error | ResponseError, void>;
|
|
18
|
+
export declare class Emailer extends Emailer_base {
|
|
16
19
|
}
|
|
17
20
|
export interface SendgridConfig {
|
|
18
21
|
defaultReplyTo?: Email | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../_src/services/Emailer/service.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../_src/services/Emailer/service.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;;oBAOtB,oBAAoB,KAAK,OAAO,KAAK,EAAE,KAAK,GAAG,aAAa,EAAE,IAAI,CAAC;;oBAAnE,oBAAoB,KAAK,OAAO,KAAK,EAAE,KAAK,GAAG,aAAa,EAAE,IAAI,CAAC;;AALrF;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAEzB;CAAG;AAEP,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,KAAK,GAAG;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAA;IACnE,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,KAAK,GAAG;QAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAA;IAC/D,MAAM,EAAE,MAAM,CAAA;CACf;AACD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAA;AAC9C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAC5B,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,GACtB,CACA;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAA;CAAE,CAC/G,GACC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA"}
|
|
@@ -5,4 +5,4 @@ import * as tsplus_module_1 from "@effect-app/prelude/service";
|
|
|
5
5
|
*/
|
|
6
6
|
export class Emailer extends tsplus_module_1.TagClass() {
|
|
7
7
|
}
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL19zcmMvc2VydmljZXMvRW1haWxlci9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFJQTs7O0dBR0c7QUFDSCxNQUFNLE9BQU8sT0FBUSxTQUFRLGdCQUFBLFFBQVEsRUFFakM7Q0FBRyJ9
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Exit } from "effect/Exit";
|
|
2
|
+
import { Operations } from "./service.js";
|
|
2
3
|
/**
|
|
3
4
|
* @tsplus static Operations.Ops Live
|
|
4
5
|
* @tsplus location "@effect-app/infra/services/Operations/live"
|
|
5
6
|
*/
|
|
6
|
-
export declare const Live: import("effect/Layer").Layer<never, never,
|
|
7
|
+
export declare const Live: import("effect/Layer").Layer<never, never, Operations.Id>;
|
|
7
8
|
//# sourceMappingURL=live.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../_src/services/Operations/live.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../_src/services/Operations/live.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;;;;;AAsGzC,eAAO,MAAM,IAAI,2DAEwB,CAAA"}
|
|
@@ -3,39 +3,47 @@ import { Effect } from "effect/Effect";
|
|
|
3
3
|
import { Option } from "@effect-app/core/Option";
|
|
4
4
|
import type { Operation, OperationId, OperationProgress } from "@effect-app/prelude/Operations";
|
|
5
5
|
import * as Scope from "effect/Scope";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
declare const Operations_base: (new (service: {
|
|
7
|
+
register: Effect<Scope.Scope, never, OperationId>;
|
|
8
|
+
update: (id: OperationId, progress: OperationProgress) => Effect<never, never, void>;
|
|
9
|
+
find: (id: OperationId) => Effect<never, never, Option<Operation>>;
|
|
10
|
+
cleanup: Effect<never, never, void>;
|
|
11
|
+
}) => Readonly<{
|
|
12
|
+
register: Effect<Scope.Scope, never, OperationId>;
|
|
13
|
+
update: (id: OperationId, progress: OperationProgress) => Effect<never, never, void>;
|
|
14
|
+
find: (id: OperationId) => Effect<never, never, Option<Operation>>;
|
|
15
|
+
cleanup: Effect<never, never, void>;
|
|
16
|
+
}>) & import("effect/Context").Tag<Operations.Id, Operations>;
|
|
10
17
|
/**
|
|
11
18
|
* @tsplus type Operations
|
|
12
19
|
* @tsplus companion Operations.Ops
|
|
13
20
|
*/
|
|
14
|
-
export declare
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
export declare class Operations extends Operations_base {
|
|
22
|
+
}
|
|
23
|
+
export declare namespace Operations {
|
|
24
|
+
interface Id {
|
|
25
|
+
readonly _: unique symbol;
|
|
26
|
+
}
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* @tsplus getter effect/io/Effect forkOperation
|
|
22
30
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
23
31
|
*/
|
|
24
|
-
export declare function forkOperation<R, E, A>(self: Effect<R, E, A>): import("effect/Effect").Effect<
|
|
32
|
+
export declare function forkOperation<R, E, A>(self: Effect<R, E, A>): import("effect/Effect").Effect<Operations.Id | Exclude<R, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
25
33
|
/**
|
|
26
34
|
* @tsplus getter function forkOperation
|
|
27
35
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
28
36
|
*/
|
|
29
|
-
export declare function forkOperationFunction<R, E, A, Inp>(fnc: (inp: Inp) => Effect<R, E, A>): (inp: Inp) => import("effect/Effect").Effect<
|
|
37
|
+
export declare function forkOperationFunction<R, E, A, Inp>(fnc: (inp: Inp) => Effect<R, E, A>): (inp: Inp) => import("effect/Effect").Effect<Operations.Id | Exclude<R, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
30
38
|
/**
|
|
31
39
|
* @tsplus static effect/io/Effect.Ops forkOperation
|
|
32
40
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
33
41
|
*/
|
|
34
|
-
export declare function forkOperation2<R, E, A>(self: (opId: OperationId) => Effect<R, E, A>): import("effect/Effect").Effect<
|
|
42
|
+
export declare function forkOperation2<R, E, A>(self: (opId: OperationId) => Effect<R, E, A>): import("effect/Effect").Effect<Operations.Id | Exclude<R, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
35
43
|
/**
|
|
36
44
|
* @tsplus static effect/io/Effect.Ops forkOperationWithEffect
|
|
37
45
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
38
46
|
*/
|
|
39
|
-
export declare function forkOperationWithEffect<R, R2, E, E2, A, A2>(self: (id: OperationId) => Effect<R, E, A>, fnc: (id: OperationId) => Effect<R2, E2, A2>): import("effect/Effect").Effect<
|
|
47
|
+
export declare function forkOperationWithEffect<R, R2, E, E2, A, A2>(self: (id: OperationId) => Effect<R, E, A>, fnc: (id: OperationId) => Effect<R2, E2, A2>): import("effect/Effect").Effect<Operations.Id | Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
40
48
|
export {};
|
|
41
49
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../_src/services/Operations/service.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC/F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../_src/services/Operations/service.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC/F,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;;cAOzB,OAAO,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC;iBACpC,WAAW,YAAY,iBAAiB,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;eACzE,WAAW,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,SAAS,CAAC,CAAC;aACzD,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;;cAHzB,OAAO,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC;iBACpC,WAAW,YAAY,iBAAiB,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;eACzE,WAAW,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,SAAS,CAAC,CAAC;aACzD,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;;AARrC;;;GAGG;AACH,qBAAa,UAAW,SAAQ,eAKhB;CAAG;AACnB,yBAAiB,UAAU,CAAC;IAC1B,UAAiB,EAAE;QACjB,QAAQ,CAAC,CAAC,EAAE,OAAO,MAAM,CAAA;KAC1B;CACF;;;;;AAKD,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,iIAY3D;;;;;AAKD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,SACvE,GAAG,mIACjB;;;;;AAKD,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,iIAYnF;;;;;AAKD,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EACzD,IAAI,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC1C,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,4JAc7C"}
|
|
@@ -39,4 +39,4 @@ export function forkOperationWithEffect(self, fnc) {
|
|
|
39
39
|
.make(), (scope) => tsplus_module_3.tap(tsplus_module_3.tap(Scope.extend(Operations
|
|
40
40
|
.register, scope), (opId) => tsplus_module_2.forkDaemonReportRequestUnexpected(Scope.use(self(opId), scope))), (opId) => Scope.extend(tsplus_module_3.forkScoped(tsplus_module_3.interruptible(fnc(opId))), scope))));
|
|
41
41
|
}
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxl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RSxDQUNqQixvQkFBQSxBQW5ERSxLQUFLLFFBbURQLFVBQVU7U0FDUCxRQUFRLEVBQ0QsS0FBSyxDQUFDLEVBQ1QsQ0FBQyxFQUFFLEVBQUUsRUFBRSxtREFBQyxBQXREYixLQUFLLEtBc0RRLElBQUksQ0FBQyxFQUFFLENBQUMsRUFBSyxLQUFLLENBQUMsQ0FBa0MsQ0FBQyxDQUN0RSxDQUNOLENBQUE7QUFDSCxDQUFDO0FBRUQ7O0dBRUc7QUFDSCxNQUFNLFVBQVUsdUJBQXVCLENBQ3JDLElBQTBDLEVBQzFDLEdBQTRDO0lBRTVDLE9BQU8sd0JBQUEsVUFBVSxFQUNmLENBQUMsVUFBVSxFQUFFLEVBQUUsQ0FDYix3QkFBQSxLQUFLO1NBQ0YsSUFBSSxFQUFFLEVBQ0UsQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUNqQixvQkFBQSxvQkFBQSxBQXZFRSxLQUFLLFFBdUVQLFVBQVU7U0FDUCxRQUFRLEVBQ0QsS0FBSyxDQUFDLEVBQ1QsQ0FBQyxJQUFJLEVBQUUsRUFBRSxtREFBQyxBQTFFZixLQUFLLEtBMEVVLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBSyxLQUFLLENBQUMsQ0FBa0MsQ0FBQyxFQUNsRSxDQUFDLElBQUksRUFBRSxFQUFFLENBQUMsQUEzRWYsS0FBSyxpRUEyRVUsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFpQyxLQUFLLENBQUMsQ0FBQyxDQUNuRSxDQUNOLENBQUE7QUFDSCxDQUFDIn0=
|
|
@@ -100,7 +100,7 @@ export declare function makeRepo<PM extends {
|
|
|
100
100
|
value: A_1;
|
|
101
101
|
readonly S: PM;
|
|
102
102
|
};
|
|
103
|
-
}) => Where | readonly [Where, ...Where[]], mode?: "
|
|
103
|
+
}) => Where | readonly [Where, ...Where[]], mode?: "or" | "and" | undefined) => Filter<PM>;
|
|
104
104
|
query: (fn: (f: import("./Store/filterApi/query.js").FilterTest<PM>, fields: import("./Store/filterApi/proxy.js").Filter<PM, never>) => QueryBuilder<PM>) => QueryBuilder<PM>;
|
|
105
105
|
};
|
|
106
106
|
/**
|
|
@@ -2,33 +2,29 @@ import { TagClass } from "@effect-app/prelude/service";
|
|
|
2
2
|
import { Effect } from "effect/Effect";
|
|
3
3
|
import { Context } from "effect/Context";
|
|
4
4
|
import { Option } from "@effect-app/core/Option";
|
|
5
|
-
import { FiberRef } from "effect/FiberRef";
|
|
6
|
-
import { NonEmptyString255 } from "@effect-app/prelude/schema";
|
|
7
5
|
import { RequestContext } from "../RequestContext.js";
|
|
8
|
-
declare const RequestContextContainer_base: (
|
|
6
|
+
declare const RequestContextContainer_base: (new (service: {
|
|
7
|
+
requestContext: Effect<never, never, RequestContext>;
|
|
8
|
+
update: (f: (rc: RequestContext) => RequestContext) => Effect<never, never, RequestContext>;
|
|
9
|
+
start: (f: RequestContext) => Effect<never, never, void>;
|
|
10
|
+
}) => Readonly<{
|
|
11
|
+
requestContext: Effect<never, never, RequestContext>;
|
|
12
|
+
update: (f: (rc: RequestContext) => RequestContext) => Effect<never, never, RequestContext>;
|
|
13
|
+
start: (f: RequestContext) => Effect<never, never, void>;
|
|
14
|
+
}>) & import("effect/Context").Tag<RequestContextContainer, RequestContextContainer>;
|
|
9
15
|
/**
|
|
10
16
|
* @tsplus type RequestContextContainer
|
|
11
17
|
* @tsplus companion RequestContextContainer.Ops
|
|
12
18
|
*/
|
|
13
|
-
export declare
|
|
14
|
-
abstract readonly requestContext: Effect<never, never, RequestContext>;
|
|
15
|
-
abstract readonly update: (f: (rc: RequestContext) => RequestContext) => Effect<never, never, RequestContext>;
|
|
16
|
-
abstract readonly start: (f: RequestContext) => Effect<never, never, void>;
|
|
19
|
+
export declare class RequestContextContainer extends RequestContextContainer_base {
|
|
17
20
|
static get get(): Effect<RequestContextContainer, never, RequestContext>;
|
|
18
21
|
static get getOption(): import("effect/Effect").Effect<never, never, import("effect/Option").Option<RequestContext>>;
|
|
19
22
|
}
|
|
20
|
-
export declare class RequestContextContainerImpl extends RequestContextContainer {
|
|
21
|
-
#private;
|
|
22
|
-
constructor();
|
|
23
|
-
get requestContext(): import("effect/Effect").Effect<never, never, RequestContext>;
|
|
24
|
-
update: (f: (a: RequestContext) => RequestContext) => import("effect/Effect").Effect<never, never, RequestContext>;
|
|
25
|
-
start: (a: RequestContext) => import("effect/Effect").Effect<never, never, void>;
|
|
26
|
-
}
|
|
27
23
|
/**
|
|
28
24
|
* @tsplus static RequestContextContainer.Ops live
|
|
29
25
|
* @tsplus location "@effect-app/infra/services/RequestContextContainer"
|
|
30
26
|
*/
|
|
31
|
-
export declare const live: import("effect/Layer").Layer<
|
|
27
|
+
export declare const live: import("effect/Layer").Layer<import("effect/Scope").Scope, never, RequestContextContainer>;
|
|
32
28
|
/**
|
|
33
29
|
* @tsplus static RequestContext.Ops Tag
|
|
34
30
|
* @tsplus location "@effect-app/infra/services/RequestContextContainer"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestContextContainer.d.ts","sourceRoot":"","sources":["../../_src/services/RequestContextContainer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestContextContainer.d.ts","sourceRoot":"","sources":["../../_src/services/RequestContextContainer.ts"],"names":[],"mappings":";;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;;oBAOnC,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC;qBACnC,cAAc,KAAK,cAAc,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC;eAChF,cAAc,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;;oBAFxC,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC;qBACnC,cAAc,KAAK,cAAc,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC;eAChF,cAAc,KAAK,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;;AAP1D;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,4BAIzC;IACF,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,uBAAuB,EAAE,KAAK,EAAE,cAAc,CAAC,CAEvE;IACD,MAAM,KAAK,SAAS,iGAQnB;CACF;;;;;AAKD,eAAO,MAAM,IAAI,4FASkB,CAAA;;;;;AAGnC,eAAO,MAAM,KAAK,8DAAwB,CAAA;;;;;AAK1C,eAAO,MAAM,cAAc,QAAS,cAAc;;;;;;;CAgBhD,CAAA"}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _RequestContextContainerImpl_ref;
|
|
13
1
|
import * as tsplus_module_1 from "@effect-app/prelude/service";
|
|
14
2
|
import * as tsplus_module_2 from "effect/Effect";
|
|
15
3
|
import * as tsplus_module_3 from "effect/Option";
|
|
16
4
|
import * as tsplus_module_4 from "@effect-app/core/Option";
|
|
17
5
|
import * as tsplus_module_5 from "effect/Context";
|
|
18
|
-
import * as tsplus_module_6 from "
|
|
19
|
-
import * as tsplus_module_7 from "effect/
|
|
20
|
-
import * as tsplus_module_8 from "@effect-app/
|
|
6
|
+
import * as tsplus_module_6 from "effect/FiberRef";
|
|
7
|
+
import * as tsplus_module_7 from "@effect-app/infra/services/Store/Memory";
|
|
8
|
+
import * as tsplus_module_8 from "@effect-app/prelude/schema";
|
|
21
9
|
import * as tsplus_module_9 from "effect/Layer";
|
|
22
10
|
import { RequestId } from "@effect-app/prelude/ids";
|
|
23
11
|
import { RequestContext } from "../RequestContext.js";
|
|
@@ -35,23 +23,14 @@ export class RequestContextContainer extends tsplus_module_1.TagClass() {
|
|
|
35
23
|
: tsplus_module_2.sync(() => tsplus_module_4.none));
|
|
36
24
|
}
|
|
37
25
|
}
|
|
38
|
-
export class RequestContextContainerImpl extends RequestContextContainer {
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
_RequestContextContainerImpl_ref.set(this, void 0);
|
|
42
|
-
this.update = (f) => tsplus_module_2.tap(tsplus_module_7.getAndUpdate(__classPrivateFieldGet(this, _RequestContextContainerImpl_ref, "f"), f), (rc) => tsplus_module_2.annotateCurrentSpan(spanAttributes_1(rc)));
|
|
43
|
-
this.start = (a) => tsplus_module_2.zipRight(tsplus_module_8.restoreFromRequestContext(a))(tsplus_module_7.set(__classPrivateFieldGet(this, _RequestContextContainerImpl_ref, "f"), a));
|
|
44
|
-
__classPrivateFieldSet(this, _RequestContextContainerImpl_ref, tsplus_module_7.unsafeMake(new RequestContext({ name: tsplus_module_6.NonEmptyString255("_root_"), rootId: RequestId("_root_"), locale: "en" })), "f");
|
|
45
|
-
}
|
|
46
|
-
get requestContext() {
|
|
47
|
-
return tsplus_module_7.get(__classPrivateFieldGet(this, _RequestContextContainerImpl_ref, "f"));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
_RequestContextContainerImpl_ref = new WeakMap();
|
|
51
26
|
/**
|
|
52
27
|
* @tsplus static RequestContextContainer.Ops live
|
|
53
28
|
*/
|
|
54
|
-
export const live = tsplus_module_9.effect(RequestContextContainer)(tsplus_module_2.sync(() => new
|
|
29
|
+
export const live = tsplus_module_9.effect(RequestContextContainer)(tsplus_module_2.map(tsplus_module_2.andThen(tsplus_module_2.sync(() => new RequestContext({ name: tsplus_module_8.NonEmptyString255("_root_"), rootId: RequestId("_root_"), locale: "en" })), (tsplus_module_6.make)), (ref) => ({
|
|
30
|
+
requestContext: tsplus_module_6.get(ref),
|
|
31
|
+
update: (f) => tsplus_module_2.tap(tsplus_module_6.getAndUpdate(ref, f), (rc) => tsplus_module_2.annotateCurrentSpan(spanAttributes_1(rc))),
|
|
32
|
+
start: (a) => tsplus_module_2.zipRight(tsplus_module_7.restoreFromRequestContext(a))(tsplus_module_6.set(ref, a))
|
|
33
|
+
})));
|
|
55
34
|
/** @tsplus static RequestContext.Ops Tag */
|
|
56
35
|
export const RCTag = tsplus_module_5.Tag();
|
|
57
36
|
/**
|
|
@@ -75,4 +54,4 @@ const spanAttributes_1 = (ctx) => ({
|
|
|
75
54
|
: {}
|
|
76
55
|
});
|
|
77
56
|
export const spanAttributes = spanAttributes_1;
|
|
78
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVxdWVzdENvbnRleHRDb250YWluZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9fc3JjL3NlcnZpY2VzL1JlcXVlc3RDb250ZXh0Q29udGFpbmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQTtBQUNuRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sc0JBQXNCLENBQUE7QUFFckQ7OztHQUdHO0FBQ0gsTUFBTSxPQUFPLHVCQUF3QixTQUFRLGdCQUFBLFFBQVEsRUFJakQ7SU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QUFDLHFEQUEyQixFQUFFLEVBQWdCLENBQUM7SUFDaEYsS0FBSyxFQUFFLENBQUMsQ0FBaUIsRUFBRSxFQUFFLG9FQUFjLENBQUMsR0FBZCxvQkFBQSxHQUFHLEVBQUssQ0FBQyxDQUFDLENBQW1CO0NBQzVELENBQUMsQ0FBQyxDQUM4QixDQUFBO0FBRW5DLDRDQUE0QztBQUM1QyxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUcsZ0JBQUEsR0FBRyxFQUFrQixDQUFBO0FBRTFDOztHQUVHO0FBQ0ksTUFBTSxtQkFBaUIsQ0FBQyxHQUFtQixFQUFFLEVBQUUsQ0FBQyxDQUFDO0lBQ3RELFlBQVksRUFBRSxHQUFHLENBQUMsRUFBRTtJQUNwQixjQUFjLEVBQUUsR0FBRyxDQUFDLElBQUk7SUFDeEIsZ0JBQWdCLEVBQUUsR0FBRyxDQUFDLE1BQU07SUFDNUIsbUJBQW1CLEVBQUUsR0FBRyxDQUFDLFNBQVM7SUFDbEMsR0FBRyxHQUFHLENBQUMsV0FBVyxFQUFFLEdBQUc7UUFDckIsQ0FBQyxDQUFDO1lBQ0Esa0JBQWtCLEVBQUUsR0FBRztpQkFDcEIsV0FBVztpQkFDWCxHQUFHO1lBQ04sb0JBQW9CLEVBQUUsT0FBTyxJQUFJLEdBQUc7aUJBQy9CLFdBQVc7Z0JBQ2QsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsS0FBSztnQkFDdkIsQ0FBQyxDQUFDLFNBQVM7U0FDZDtRQUNELENBQUMsQ0FBQyxFQUFFO0NBQ1AsQ0FBQyxDQUFBO2FBaEJXLGNBQWMifQ==
|
|
@@ -2,29 +2,26 @@ import { TagClass } from "@effect-app/prelude/service";
|
|
|
2
2
|
import { Effect } from "effect/Effect";
|
|
3
3
|
import { Context } from "effect/Context";
|
|
4
4
|
import { Option } from "@effect-app/core/Option";
|
|
5
|
-
import { FiberRef } from "effect/FiberRef";
|
|
6
5
|
import { ContextMap } from "./service.js";
|
|
7
|
-
declare const ContextMapContainer_base: (
|
|
6
|
+
declare const ContextMapContainer_base: (new (service: {
|
|
7
|
+
get: Effect<never, never, ContextMap>;
|
|
8
|
+
start: Effect<never, never, void>;
|
|
9
|
+
}) => Readonly<{
|
|
10
|
+
get: Effect<never, never, ContextMap>;
|
|
11
|
+
start: Effect<never, never, void>;
|
|
12
|
+
}>) & import("effect/Context").Tag<ContextMapContainer, ContextMapContainer>;
|
|
8
13
|
/**
|
|
9
14
|
* @tsplus companion ContextMapContainer.Ops
|
|
10
15
|
*/
|
|
11
|
-
export declare
|
|
12
|
-
abstract readonly get: Effect<never, never, ContextMap>;
|
|
13
|
-
abstract readonly start: Effect<never, never, void>;
|
|
16
|
+
export declare class ContextMapContainer extends ContextMapContainer_base {
|
|
14
17
|
static get get(): Effect<ContextMapContainer, never, ContextMap>;
|
|
15
18
|
static get getOption(): import("effect/Effect").Effect<never, never, import("effect/Option").Option<ContextMap>>;
|
|
16
19
|
}
|
|
17
|
-
export declare class ContextMapContainerImpl extends ContextMapContainer {
|
|
18
|
-
#private;
|
|
19
|
-
constructor();
|
|
20
|
-
get get(): import("effect/Effect").Effect<never, never, ContextMap>;
|
|
21
|
-
start: import("effect/Effect").Effect<never, never, void>;
|
|
22
|
-
}
|
|
23
20
|
/**
|
|
24
21
|
* @tsplus static ContextMapContainer.Ops live
|
|
25
22
|
* @tsplus location "@effect-app/infra/services/Store/ContextMapContainer"
|
|
26
23
|
*/
|
|
27
|
-
export declare const live: import("effect/Layer").Layer<
|
|
24
|
+
export declare const live: import("effect/Layer").Layer<import("effect/Scope").Scope, never, ContextMapContainer>;
|
|
28
25
|
/**
|
|
29
26
|
* @tsplus static ContextMap.Ops Tag
|
|
30
27
|
* @tsplus location "@effect-app/infra/services/Store/ContextMapContainer"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMapContainer.d.ts","sourceRoot":"","sources":["../../../_src/services/Store/ContextMapContainer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContextMapContainer.d.ts","sourceRoot":"","sources":["../../../_src/services/Store/ContextMapContainer.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;;SAYlD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;WAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;;SAD5B,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;WAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;;AALnC;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,wBAGrC;IACF,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,mBAAmB,EAAE,KAAK,EAAE,UAAU,CAAC,CAE/D;IACD,MAAM,KAAK,SAAS,6FAQnB;CACF;;;;;AAKD,eAAO,MAAM,IAAI,wFAIc,CAAA;;;;;AAG/B,eAAO,MAAM,KAAK,sDAAoB,CAAA"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _ContextMapContainerImpl_ref;
|
|
13
1
|
import * as tsplus_module_1 from "@effect-app/prelude/service";
|
|
14
2
|
import * as tsplus_module_2 from "effect/Effect";
|
|
15
3
|
import * as tsplus_module_3 from "effect/Option";
|
|
@@ -37,22 +25,10 @@ export class ContextMapContainer extends tsplus_module_1.TagClass() {
|
|
|
37
25
|
: tsplus_module_2.sync(() => tsplus_module_4.none));
|
|
38
26
|
}
|
|
39
27
|
}
|
|
40
|
-
export class ContextMapContainerImpl extends ContextMapContainer {
|
|
41
|
-
constructor() {
|
|
42
|
-
super();
|
|
43
|
-
_ContextMapContainerImpl_ref.set(this, void 0);
|
|
44
|
-
this.start = tsplus_module_2.flatMap(tsplus_module_7.makeMap, (_) => tsplus_module_6.set(__classPrivateFieldGet(this, _ContextMapContainerImpl_ref, "f"), _));
|
|
45
|
-
__classPrivateFieldSet(this, _ContextMapContainerImpl_ref, tsplus_module_6.unsafeMake(makeContextMap()), "f");
|
|
46
|
-
}
|
|
47
|
-
get get() {
|
|
48
|
-
return tsplus_module_6.get(__classPrivateFieldGet(this, _ContextMapContainerImpl_ref, "f"));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
_ContextMapContainerImpl_ref = new WeakMap();
|
|
52
28
|
/**
|
|
53
29
|
* @tsplus static ContextMapContainer.Ops live
|
|
54
30
|
*/
|
|
55
|
-
export const live = tsplus_module_8.effect(ContextMapContainer)(tsplus_module_2.sync(() => new
|
|
31
|
+
export const live = tsplus_module_8.effect(ContextMapContainer)(tsplus_module_2.map(tsplus_module_2.andThen(tsplus_module_2.sync(() => makeContextMap()), (tsplus_module_6.make)), (ref) => new ContextMapContainer({ get: tsplus_module_6.get(ref), start: tsplus_module_2.flatMap(tsplus_module_7.makeMap, (_) => tsplus_module_6.set(ref, _)) })));
|
|
56
32
|
/** @tsplus static ContextMap.Ops Tag */
|
|
57
33
|
export const RCTag = tsplus_module_5.Tag();
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WLG9CQUFBLHdCQUFBLHFCQUNaLEdBQUcsRUFBRSxDQUFDLGNBQWMsRUFBRSxDQUFDLEVBQ3BCLENBQUEsb0JBQXlCLENBQUEsQ0FBQyxFQUM5QixDQUFDLEdBQUcsRUFBRSxFQUFFLENBQUMsSUFBSSxtQkFBbUIsQ0FBQyxFQUFFLEdBQUcsc0JBQUUsR0FBRyxDQUFJLEVBQUUsS0FBSyxFQUFFLGlEQUF3QixDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsb0JBQUEsR0FBRyxFQUFLLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQzlFLENBQUE7QUFFL0Isd0NBQXdDO0FBQ3hDLE1BQU0sQ0FBQyxNQUFNLEtBQUssR0FBRyxnQkFBQSxHQUFHLEVBQWMsQ0FBQSJ9
|
|
@@ -95,13 +95,16 @@ export interface Store<PM extends PersistenceModelType<Id>, Id extends string> {
|
|
|
95
95
|
*/
|
|
96
96
|
remove: (e: PM) => Effect<never, never, void>;
|
|
97
97
|
}
|
|
98
|
-
declare const StoreMaker_base: (
|
|
98
|
+
declare const StoreMaker_base: (new (service: {
|
|
99
|
+
make: <PM extends PersistenceModelType<Id>, Id extends string, R = never, E = never>(name: string, seed?: Effect<R, E, Iterable<PM>>, config?: StoreConfig<PM>) => Effect<R, E, Store<PM, Id>>;
|
|
100
|
+
}) => Readonly<{
|
|
101
|
+
make: <PM extends PersistenceModelType<Id>, Id extends string, R = never, E = never>(name: string, seed?: Effect<R, E, Iterable<PM>>, config?: StoreConfig<PM>) => Effect<R, E, Store<PM, Id>>;
|
|
102
|
+
}>) & import("effect/Context").Tag<StoreMaker, StoreMaker>;
|
|
99
103
|
/**
|
|
100
104
|
* @tsplus type StoreMaker
|
|
101
105
|
* @tsplus companion StoreMaker.Ops
|
|
102
106
|
*/
|
|
103
|
-
export declare
|
|
104
|
-
abstract make: <PM extends PersistenceModelType<Id>, Id extends string, R = never, E = never>(name: string, seed?: Effect<R, E, Iterable<PM>>, config?: StoreConfig<PM>) => Effect<R, E, Store<PM, Id>>;
|
|
107
|
+
export declare class StoreMaker extends StoreMaker_base {
|
|
105
108
|
}
|
|
106
109
|
export declare const makeContextMap: () => ContextMap;
|
|
107
110
|
/**
|
|
@@ -109,15 +112,20 @@ export declare const makeContextMap: () => ContextMap;
|
|
|
109
112
|
* @tsplus location "@effect-app/infra/services/Store/service"
|
|
110
113
|
*/
|
|
111
114
|
export declare const makeMap: import("effect/Effect").Effect<never, never, ContextMap>;
|
|
112
|
-
declare const ContextMap_base: (
|
|
115
|
+
declare const ContextMap_base: (new (service: {
|
|
116
|
+
get: (id: string) => string | undefined;
|
|
117
|
+
set: (id: string, eTag: string | undefined) => void;
|
|
118
|
+
parserEnv: ParserEnv;
|
|
119
|
+
}) => Readonly<{
|
|
120
|
+
get: (id: string) => string | undefined;
|
|
121
|
+
set: (id: string, eTag: string | undefined) => void;
|
|
122
|
+
parserEnv: ParserEnv;
|
|
123
|
+
}>) & import("effect/Context").Tag<ContextMap, ContextMap>;
|
|
113
124
|
/**
|
|
114
125
|
* @tsplus type ContextMap
|
|
115
126
|
* @tsplus companion ContextMap.Ops
|
|
116
127
|
*/
|
|
117
|
-
export declare
|
|
118
|
-
abstract get: (id: string) => string | undefined;
|
|
119
|
-
abstract set: (id: string, eTag: string | undefined) => void;
|
|
120
|
-
abstract parserEnv: ParserEnv;
|
|
128
|
+
export declare class ContextMap extends ContextMap_base {
|
|
121
129
|
}
|
|
122
130
|
export interface PersistenceModelType<Id extends string> {
|
|
123
131
|
id: Id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../_src/services/Store/service.ts"],"names":[],"mappings":";;;;;AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAU,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAGzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,i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EAAE,CAAC,KACrB,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;;AATlC;;;GAGG;AACH,qBAAa,UAAW,SAAQ,eAM5B;CACH;AAED,eAAO,MAAM,cAAc,QAAO,UA+DjC,CAAA;;;;;AAKD,eAAO,MAAM,OAAO,0DAAsC,CAAA;;cAO9C,MAAM,KAAK,MAAM,GAAG,SAAS;cAC7B,MAAM,QAAQ,MAAM,GAAG,SAAS,KAAK,IAAI;eACxC,SAAS;;cAFV,MAAM,KAAK,MAAM,GAAG,SAAS;cAC7B,MAAM,QAAQ,MAAM,GAAG,SAAS,KAAK,IAAI;eACxC,SAAS;;AAPtB;;;GAGG;AACH,qBAAa,UAAW,SAAQ,eAI5B;CACH;AAED,MAAM,WAAW,oBAAoB,CAAC,EAAE,SAAS,MAAM;IACrD,EAAE,EAAE,EAAE,CAAA;IACN,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -68,4 +68,4 @@ export const makeMap = tsplus_module_2.sync(() => makeContextMap());
|
|
|
68
68
|
*/
|
|
69
69
|
export class ContextMap extends tsplus_module_1.TagClass() {
|
|
70
70
|
}
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL19zcmMvc2VydmljZXMvU3RvcmUvc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQW9HQTs7O0dBR0c7QUFDSCxNQUFNLE9BQU8sVUFBVyxTQUFRLGdCQUFBLFFBQVEsRUFNcEM7Q0FDSDtBQUVELE1B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LEVBQUUsR0FBRyxLQUFLLENBQUMsQ0FBQyxFQUFFLFNBQVMsQ0FBQyxDQUFBO29CQUM5QixXQUFXLENBQUMsR0FBRyxDQUFDLEtBQUssRUFBRSxJQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBO29CQUMxQyxPQUFPLEVBQUUsQ0FBQTtnQkFDWCxDQUFDO1lBQ0gsQ0FBQztTQUNGO0tBQ0YsQ0FBQTtJQUVELE9BQU87UUFDTCxHQUFHLEVBQUUsT0FBTztRQUNaLEdBQUcsRUFBRSxPQUFPO1FBQ1osU0FBUztLQUNWLENBQUE7QUFDSCxDQUFDLENBQUE7QUFFRDs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxxQkFBWSxHQUFHLEVBQUUsQ0FBQyxjQUFjLEVBQUUsQ0FBQyxDQUFBO0FBRTFEOzs7R0FHRztBQUNILE1BQU0sT0FBTyxVQUFXLFNBQVEsZ0JBQUEsUUFBUSxFQUlwQztDQUNIIn0=
|
|
@@ -7,8 +7,8 @@ import type { DBRecord } from "./shared.js";
|
|
|
7
7
|
import { OptimisticLockException } from "./shared.js";
|
|
8
8
|
import * as simpledb from "./simpledb.js";
|
|
9
9
|
export declare function createContext<TKey extends string, EA, A extends DBRecord<TKey>>(): <REncode, RDecode, EDecode>(type: string, encode: (record: A) => Effect<REncode, never, EA>, decode: (d: EA) => Effect<RDecode, EDecode, A>, indexes: IndexingPolicy) => import("effect/Effect").Effect<Cosmos.CosmosClient, import("effect/Cause").UnknownException, {
|
|
10
|
-
find: (id: string) => import("effect/Effect").Effect<
|
|
10
|
+
find: (id: string) => import("effect/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache | RDecode, import("effect/Cause").UnknownException | simpledb.InvalidStateError, import("effect/Option").Option<A>>;
|
|
11
11
|
findBy: (parameters: Record<string, string>) => import("effect/Effect").Effect<Cosmos.CosmosClient, import("effect/Cause").UnknownException, import("effect/Option").Option<any>>;
|
|
12
|
-
save: (record: A) => import("effect/Effect").Effect<
|
|
12
|
+
save: (record: A) => import("effect/Effect").Effect<Cosmos.CosmosClient | simpledb.RecordCache | REncode, OptimisticLockException, A>;
|
|
13
13
|
}>;
|
|
14
14
|
//# 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) => Effect<REncode, never, EA>, decode: (d: EA) => Effect<RDecode, EDecode, A>, schemaVersion: string, makeIndexKey: (r: A) => Index, dir?: string) => {
|
|
7
7
|
find: (id: string) => import("effect/Effect").Effect<simpledb.RecordCache | RDecode, simpledb.InvalidStateError, import("effect/Option").Option<A>>;
|
|
8
8
|
findByIndex: (index: Index) => import("effect/Effect").Effect<never, never, import("effect/Option").Option<TKey & {}>>;
|
|
9
|
-
save: (record: A) => import("effect/Effect").Effect<simpledb.RecordCache | REncode, import("./shared.js").OptimisticLockException | simpledb.InvalidStateError
|
|
9
|
+
save: (record: A) => import("effect/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
|
|
@@ -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) => Effect<REncode, never, EA>, decode: (d: EA) => Effect<RDecode, EDecode, A>, schemaVersion: string, makeIndexKey: (r: A) => Index) => {
|
|
9
|
-
find: (id: string) => import("effect/Effect").Effect<simpledb.RecordCache | RDecode
|
|
9
|
+
find: (id: string) => import("effect/Effect").Effect<RedisClient | simpledb.RecordCache | RDecode, simpledb.InvalidStateError, import("effect/Option").Option<A>>;
|
|
10
10
|
findByIndex: (index: Index) => import("effect/Effect").Effect<RedisClient, import("@effect-app/infra-adapters/redis-client").ConnectionException, import("effect/Option").Option<TKey>>;
|
|
11
|
-
save: (record: A) => import("effect/Effect").Effect<simpledb.RecordCache | REncode |
|
|
11
|
+
save: (record: A) => import("effect/Effect").Effect<RedisClient | simpledb.RecordCache | REncode, CouldNotAquireDbLockException | import("./shared.js").OptimisticLockException | simpledb.InvalidStateError, A>;
|
|
12
12
|
};
|
|
13
13
|
declare const RedisSerializedDBRecord_base: S.Class<RedisSerializedDBRecord, S.SchemaProperties<S.ToProps<{
|
|
14
14
|
version: S.SchemaDefaultSchema<unknown, string, string, string, {}>;
|
|
@@ -17,7 +17,7 @@ export interface RecordCache extends ReturnType<typeof makeLiveRecordCache> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const RecordCache: import("effect/Context").Tag<RecordCache, RecordCache>;
|
|
19
19
|
export declare const LiveRecordCache: import("effect/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/Effect").Effect<
|
|
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/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/Effect").Effect<RecordCache | R | RDecode, InvalidStateError | E, import("effect/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/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/Effect").Effect<RecordCache | R | Exclude<R2, import("effect/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.
|
|
3
|
+
"version": "0.132.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"pure-rand": "6.0.4",
|
|
20
20
|
"redlock": "^4.2.0",
|
|
21
21
|
"@effect-app/core": "0.96.0",
|
|
22
|
-
"@effect-app/
|
|
23
|
-
"@effect-app/
|
|
24
|
-
"@effect-app/
|
|
22
|
+
"@effect-app/prelude": "0.106.0",
|
|
23
|
+
"@effect-app/schema": "0.90.0",
|
|
24
|
+
"@effect-app/infra-adapters": "0.84.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@babel/cli": "^7.23.4",
|