@effect-app/infra 0.87.4 → 0.88.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/.cache/effect/095519d034161945a8d2616a506d3e7f35a9b3d868814f44c747429c60fc4e7f.content +36 -2
- package/.cache/effect/095519d034161945a8d2616a506d3e7f35a9b3d868814f44c747429c60fc4e7f.hash +1 -1
- package/.cache/effect/134218688132dfbdea493cbe1f26e73449f2759121df35ddd5448346b59c9a8d.content +24 -6
- package/.cache/effect/134218688132dfbdea493cbe1f26e73449f2759121df35ddd5448346b59c9a8d.hash +1 -1
- package/.cache/effect/14eb9da4ca6d22162888c7fdb7f39ab772d2a2dc6625db6031ecdb32ac89158f.content +75 -40
- package/.cache/effect/14eb9da4ca6d22162888c7fdb7f39ab772d2a2dc6625db6031ecdb32ac89158f.hash +1 -1
- package/.cache/effect/1bfd92946b11da4292f2ed99dc0e322462b60559148f9524abc20e26f70779e1.hash +1 -1
- package/.cache/effect/49c1bd9ec26e6df78b994d8df0bfe21b119803fa4aa46349bf4679fd0f1e7cda.content +3 -1
- package/.cache/effect/49c1bd9ec26e6df78b994d8df0bfe21b119803fa4aa46349bf4679fd0f1e7cda.hash +1 -1
- package/.cache/effect/58d4ccde8bd2db7829706db5bebd01b99900ee83f0f6a8413b53d17cbd69f510.content +1 -1
- package/.cache/effect/58d4ccde8bd2db7829706db5bebd01b99900ee83f0f6a8413b53d17cbd69f510.hash +1 -1
- package/.cache/effect/72a5a16a6b62b63cd71719c833091128207d7e6c823cb32293549b3dd58c451b.content +15 -7
- package/.cache/effect/72a5a16a6b62b63cd71719c833091128207d7e6c823cb32293549b3dd58c451b.hash +1 -1
- package/.cache/effect/7a9c33db6aedaf00093a132c1d4e48e9d043cef05e932b8a37da24d44e224248.hash +1 -1
- package/.cache/effect/8594f0f42afc0641b00e88998000cc47382a1d07da31f4a148f7976701ca22d5.hash +1 -1
- package/.cache/effect/c67d971634d2dc8118b40452b61c9a51620c35809be4a89982476aa80701d852.hash +1 -1
- package/.cache/effect/f38adf43700dab905456a534a0690eaf882cff2cd576c731f23d6d14a3c3d659.content +5 -1
- package/.cache/effect/f38adf43700dab905456a534a0690eaf882cff2cd576c731f23d6d14a3c3d659.hash +1 -1
- package/CHANGELOG.md +17 -0
- package/_cjs/services/QueueMaker/memQueue.cjs +13 -12
- package/_cjs/services/QueueMaker/memQueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/sbqueue.cjs +23 -22
- package/_cjs/services/QueueMaker/sbqueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/service.cjs.map +1 -1
- package/_cjs/services/Store/Memory.cjs +5 -4
- package/_cjs/services/Store/Memory.cjs.map +1 -1
- package/_src/services/QueueMaker/memQueue.ts +16 -19
- package/_src/services/QueueMaker/sbqueue.ts +18 -21
- package/_src/services/QueueMaker/service.ts +1 -3
- package/_src/services/Store/Memory.ts +6 -4
- package/dist/services/QueueMaker/memQueue.d.ts +3 -3
- package/dist/services/QueueMaker/memQueue.d.ts.map +1 -1
- package/dist/services/QueueMaker/memQueue.js +11 -10
- package/dist/services/QueueMaker/sbqueue.d.ts +3 -3
- package/dist/services/QueueMaker/sbqueue.d.ts.map +1 -1
- package/dist/services/QueueMaker/sbqueue.js +20 -19
- package/dist/services/QueueMaker/service.d.ts +1 -2
- package/dist/services/QueueMaker/service.d.ts.map +1 -1
- package/dist/services/QueueMaker/service.js +1 -1
- package/dist/services/RepositoryBase.d.ts +1 -1
- package/dist/services/Store/Memory.d.ts +6 -2
- package/dist/services/Store/Memory.d.ts.map +1 -1
- package/dist/services/Store/Memory.js +5 -4
- package/package.json +11 -11
|
@@ -6,17 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.makeServiceBusLayers = makeServiceBusLayers;
|
|
7
7
|
exports.makeServiceBusQueue = makeServiceBusQueue;
|
|
8
8
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/core/Tag"));
|
|
9
|
-
var tsplus_module_2 = _interopRequireWildcard(require("effect/
|
|
10
|
-
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/
|
|
11
|
-
var tsplus_module_4 = _interopRequireWildcard(require("
|
|
12
|
-
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/
|
|
13
|
-
var tsplus_module_6 = _interopRequireWildcard(require("effect/
|
|
9
|
+
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
|
|
10
|
+
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/infra/services/Store/Memory"));
|
|
11
|
+
var tsplus_module_4 = _interopRequireWildcard(require("effect/Effect"));
|
|
12
|
+
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
|
|
13
|
+
var tsplus_module_6 = _interopRequireWildcard(require("@effect-app/infra/services/QueueMaker/errors"));
|
|
14
|
+
var tsplus_module_7 = _interopRequireWildcard(require("effect/Layer"));
|
|
14
15
|
var _ServiceBus = require("@effect-app/infra-adapters/ServiceBus");
|
|
15
16
|
var _errorReporter = require("@effect-app/infra/errorReporter");
|
|
16
17
|
var _RequestContext = require("@effect-app/infra/RequestContext");
|
|
17
18
|
var _ids = require("@effect-app/prelude/ids");
|
|
18
19
|
var _RequestContextContainer = require("../RequestContextContainer.cjs");
|
|
19
|
-
var _Memory = require("../Store/Memory.cjs");
|
|
20
20
|
var _errors2 = require("./errors.cjs");
|
|
21
21
|
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); }
|
|
22
22
|
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; }
|
|
@@ -24,7 +24,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
24
24
|
* @tsplus static QueueMaker.Ops makeServiceBus
|
|
25
25
|
*/
|
|
26
26
|
function makeServiceBusQueue(_queueName, queueDrainName, encoder, makeHandleEvent, provideContext, parseDrain) {
|
|
27
|
-
return
|
|
27
|
+
return tsplus_module_4.gen(function* ($) {
|
|
28
28
|
const s = yield* $(_ServiceBus.Sender);
|
|
29
29
|
const receiver = yield* $(_ServiceBus.Receiver);
|
|
30
30
|
const receiverLayer = tsplus_module_1.makeLayer(_ServiceBus.Receiver, receiver);
|
|
@@ -34,33 +34,34 @@ function makeServiceBusQueue(_queueName, queueDrainName, encoder, makeHandleEven
|
|
|
34
34
|
const reportError = (0, _errors2.reportNonInterruptedFailureCause)({
|
|
35
35
|
name: "ServiceBusQueue.drain." + queueDrainName
|
|
36
36
|
});
|
|
37
|
+
const rcc = yield* $(_RequestContextContainer.RequestContextContainer);
|
|
37
38
|
return {
|
|
38
|
-
drain:
|
|
39
|
+
drain: tsplus_module_4.gen(function* ($) {
|
|
39
40
|
const handleEvent = yield* $(makeHandleEvent);
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
42
|
function processMessage(messageBody) {
|
|
42
|
-
return
|
|
43
|
+
return tsplus_module_4.tapErrorCause(tsplus_module_4.flatMap(tsplus_module_4.orDie(tsplus_module_4.flatMap(tsplus_module_4.sync(() => JSON.parse(messageBody)), x => parseDrain(x))), ({
|
|
43
44
|
body,
|
|
44
45
|
meta
|
|
45
|
-
}) => provideContext(
|
|
46
|
+
}) => tsplus_module_4.zipRight(provideContext(silenceAndReportError(tsplus_module_4.orDie(tsplus_module_4.zipRight(tsplus_module_4.annotateLogs({
|
|
47
|
+
body: tsplus_module_5.RecordPretty(tsplus_module_5.object$(body)),
|
|
48
|
+
meta: tsplus_module_5.RecordPretty(tsplus_module_5.object$(meta))
|
|
49
|
+
})(tsplus_module_4.logDebug(`$$ [${queueDrainName}] Processing incoming message`)), handleEvent(body))))))(tsplus_module_4.zipRight(tsplus_module_4.flatMap(rcc.requestContext, _ => tsplus_module_3.restoreFromRequestContext(_)))(rcc.start(_RequestContext.RequestContext.inherit(meta, {
|
|
46
50
|
id: (0, _ids.RequestId)(body.id),
|
|
47
51
|
locale: "en",
|
|
48
|
-
name:
|
|
49
|
-
}))
|
|
50
|
-
body: tsplus_module_3.RecordPretty(tsplus_module_3.object$(body)),
|
|
51
|
-
meta: tsplus_module_3.RecordPretty(tsplus_module_3.object$(meta))
|
|
52
|
-
})(tsplus_module_2.logDebug(`$$ [${queueDrainName}] Processing incoming message`)), () => _Memory.restoreFromRequestContext), handleEvent(body))))))
|
|
52
|
+
name: tsplus_module_2.ReasonableString(body._tag)
|
|
53
|
+
})))))
|
|
53
54
|
// we reportError here, so that we report the error only, and keep flowing
|
|
54
55
|
, reportError);
|
|
55
56
|
}
|
|
56
|
-
return yield* $(
|
|
57
|
-
processMessage: x =>
|
|
58
|
-
processError: err =>
|
|
57
|
+
return yield* $(tsplus_module_4.provide((0, _ServiceBus.subscribe)({
|
|
58
|
+
processMessage: x => tsplus_module_4.uninterruptible(processMessage(x.body)),
|
|
59
|
+
processError: err => tsplus_module_4.sync(() => (0, _errorReporter.captureException)(err.error))
|
|
59
60
|
}), receiverLayer));
|
|
60
61
|
}),
|
|
61
|
-
publish: (...messages) =>
|
|
62
|
-
const requestContext = yield* $(
|
|
63
|
-
return yield* $(
|
|
62
|
+
publish: (...messages) => tsplus_module_4.gen(function* ($) {
|
|
63
|
+
const requestContext = yield* $(rcc.requestContext);
|
|
64
|
+
return yield* $(tsplus_module_6.forkDaemonReportQueue(tsplus_module_4.promise(() => s.sendMessages(messages.map(x => ({
|
|
64
65
|
body: JSON.stringify(encoder({
|
|
65
66
|
body: x,
|
|
66
67
|
meta: requestContext
|
|
@@ -77,6 +78,6 @@ function makeServiceBusQueue(_queueName, queueDrainName, encoder, makeHandleEven
|
|
|
77
78
|
* @tsplus static QueueMaker.Ops makeServiceBusLayers
|
|
78
79
|
*/
|
|
79
80
|
function makeServiceBusLayers(url, queueName, queueDrainName) {
|
|
80
|
-
return
|
|
81
|
+
return tsplus_module_7.provide(tsplus_module_7.merge((0, _ServiceBus.LiveSender)(queueName))((0, _ServiceBus.LiveReceiver)(queueDrainName)))((0, _ServiceBus.LiveServiceBusClient)(url));
|
|
81
82
|
}
|
|
82
83
|
//# sourceMappingURL=sbqueue.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sbqueue.cjs","names":["_ServiceBus","require","_errorReporter","_RequestContext","_ids","_RequestContextContainer","
|
|
1
|
+
{"version":3,"file":"sbqueue.cjs","names":["_ServiceBus","require","_errorReporter","_RequestContext","_ids","_RequestContextContainer","_errors2","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeServiceBusQueue","_queueName","queueDrainName","encoder","makeHandleEvent","provideContext","parseDrain","tsplus_module_4","gen","$","s","Sender","receiver","Receiver","receiverLayer","tsplus_module_1","makeLayer","silenceAndReportError","reportNonInterruptedFailure","name","reportError","reportNonInterruptedFailureCause","rcc","RequestContextContainer","drain","handleEvent","processMessage","messageBody","tapErrorCause","flatMap","orDie","sync","JSON","parse","x","body","meta","zipRight","annotateLogs","tsplus_module_5","RecordPretty","object$","logDebug","requestContext","_","tsplus_module_3","restoreFromRequestContext","start","RequestContext","inherit","id","RequestId","locale","tsplus_module_2","ReasonableString","_tag","provide","subscribe","uninterruptible","processError","err","captureException","error","publish","messages","tsplus_module_6","forkDaemonReportQueue","promise","sendMessages","map","stringify","messageId","contentType","makeServiceBusLayers","url","queueName","tsplus_module_7","merge","LiveSender","LiveReceiver","LiveServiceBusClient"],"s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CAAC,CAAC;MAEFiD,OAAO,EAAEA,CAAC,GAAGC,QAAQ,KACnBzD,eAAA,CAAAC,GAAA,CAAW,WAAUC,CAAC;QACpB,MAAMkC,cAAc,GAAG,OAAOlC,CAAC,CAACa,GAAG,CAACqB,cAAc,CAAC;QACnD,OAAO,OAAOlC,CAAC,CAAAwD,eAAA,CAAAC,qBAAA,CACb3D,eAAA,CAAA4D,OAAA,CACW,MACPzD,CAAC,CAAC0D,YAAY,CACZJ,QAAQ,CAACK,GAAG,CAAEnC,CAAC,KAAM;UACnBC,IAAI,EAAEH,IAAI,CAACsC,SAAS,CAClBnE,OAAO,CAAC;YAAEgC,IAAI,EAAED,CAAC;YAAEE,IAAI,EAAEO;UAAc,CAAE,CAAC,CAC3C;UACD4B,SAAS,EAAErC,CAAC,CAACgB,EAAE;UAAE;UACjBsB,WAAW,EAAE;SACd,CAAC,CAAC,CACJ,CACF,EAEJ;MACH,CAAC;KAC6B;EACpC,CAAC,CAAC;AACJ;AAEA;;;AAGM,SAAUC,oBAAoBA,CAACC,GAAW,EAAEC,SAAiB,EAAEzE,cAAsB;EACzF,OAAA0E,eAAA,CAAApB,OAAA,CACKoB,eAAA,CAAAC,KAAA,CAAgC,IAAAC,sBAAU,EAACH,SAAS,CAAC,EAApD,IAAAI,wBAAY,EAAC7E,cAAc,CAAC,CAAyB,EADpD,IAAA8E,gCAAoB,EAACN,GAAG,CAAC;AAElC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.cjs","names":["QueueMaker","exports"],"sources":["../../../_src/services/QueueMaker/service.ts"],"sourcesContent":[null],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"service.cjs","names":["QueueMaker","exports"],"sources":["../../../_src/services/QueueMaker/service.ts"],"sourcesContent":[null],"mappings":";;;;;;AAWO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAkB,EAAE"}
|
|
@@ -15,13 +15,10 @@ var tsplus_module_5 = _interopRequireWildcard(require("effect/Effect"));
|
|
|
15
15
|
var tsplus_module_6 = _interopRequireWildcard(require("effect/Chunk"));
|
|
16
16
|
var tsplus_module_7 = _interopRequireWildcard(require("effect/Ref"));
|
|
17
17
|
var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/core/_ext/Iterable"));
|
|
18
|
-
var _RequestContextContainer = require("../RequestContextContainer.cjs");
|
|
19
18
|
var _service = require("./service.cjs");
|
|
20
19
|
var _utils = require("./utils.cjs");
|
|
21
20
|
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); }
|
|
22
21
|
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; }
|
|
23
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
24
|
-
|
|
25
22
|
function memFilter(filter, cursor) {
|
|
26
23
|
return c => {
|
|
27
24
|
const skip = cursor?.skip;
|
|
@@ -40,7 +37,11 @@ function memFilter(filter, cursor) {
|
|
|
40
37
|
};
|
|
41
38
|
}
|
|
42
39
|
const storeId = exports.storeId = tsplus_module_4.unsafeMake("primary");
|
|
43
|
-
|
|
40
|
+
/**
|
|
41
|
+
* @tsplus getter RequestContext restoreStoreId
|
|
42
|
+
*/
|
|
43
|
+
const restoreFromRequestContext = ctx => tsplus_module_4.set(storeId, ctx.namespace ?? "primary");
|
|
44
|
+
exports.restoreFromRequestContext = restoreFromRequestContext;
|
|
44
45
|
function logQuery(filter, cursor) {
|
|
45
46
|
return tsplus_module_5.annotateLogs({
|
|
46
47
|
query: JSON.stringify(filter, undefined, 2),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Memory.cjs","names":["
|
|
1
|
+
{"version":3,"file":"Memory.cjs","names":["_service","require","_utils","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","memFilter","filter","cursor","c","skip","limit","tsplus_module_3","getOrElse","map","tsplus_module_2","findFirstMap","codeFilter","tsplus_module_1","make","filterMap","drop","undefined","take","storeId","exports","tsplus_module_4","unsafeMake","restoreFromRequestContext","ctx","namespace","logQuery","tsplus_module_5","annotateLogs","query","JSON","stringify","logDebug","makeMemoryStoreInt","name","seed","gen","$","updateETag","makeUpdateETag","items_","sync","items","Map","tsplus_module_6","ext_itToChunk","_","id","makeStore","entries","makeETag","store","tsplus_module_7","sem","unsafeMakeSemaphore","withPermit","withPermits","values","s","all","fromIterable","batchSet","tap","tsplus_module_8","ext_forEach","flatMap","find","current","m","mut","forEach","fromNullable","filterJoinSelect","codeFilterJoinSelect","bulkSet","remove","makeMemoryStore","config","storesSem","primary","context","stores","getStore","allowNamespace","succeed","Error","suspend","provide","orDie","args","MemoryStoreLive","StoreMaker","makeLayer"],"sources":["../../../_src/services/Store/Memory.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAuF,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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AC;AAAAtC,OAAA,CAAAwD,eAAA,GAAAA,eAAA;AAEK,MAAMc,eAAe,GAAAtE,OAAA,CAAAsE,eAAA,GAAGC,mBAAU,CAACC,SAAS,CAAChB,eAAe,EAAE,CAAC"}
|
|
@@ -3,7 +3,6 @@ import { RequestContext } from "@effect-app/infra/RequestContext"
|
|
|
3
3
|
import { RequestId } from "@effect-app/prelude/ids"
|
|
4
4
|
import type { CustomSchemaException } from "@effect-app/prelude/schema"
|
|
5
5
|
import { RequestContextContainer } from "../RequestContextContainer.js"
|
|
6
|
-
import { restoreFromRequestContext } from "../Store/Memory.js"
|
|
7
6
|
import { reportNonInterruptedFailure } from "./errors.js"
|
|
8
7
|
import type { QueueBase } from "./service.js"
|
|
9
8
|
|
|
@@ -22,9 +21,9 @@ export function makeMemQueue<
|
|
|
22
21
|
queueDrainName: string,
|
|
23
22
|
encoder: (e: { body: Evt; meta: RequestContext }) => EvtE,
|
|
24
23
|
makeHandleEvent: Effect<DrainR, never, (ks: DrainEvt) => Effect<RContext, DrainE, void>>,
|
|
25
|
-
provideContext:
|
|
24
|
+
provideContext: <R, E, A>(
|
|
26
25
|
eff: Effect<RContext | R, E, A>
|
|
27
|
-
) => Effect<Exclude<R, RContext
|
|
26
|
+
) => Effect<Exclude<R, RContext>, E, A>,
|
|
28
27
|
parseDrain: (
|
|
29
28
|
a: unknown,
|
|
30
29
|
env?: Parser.ParserEnv | undefined
|
|
@@ -34,11 +33,12 @@ export function makeMemQueue<
|
|
|
34
33
|
const mem = yield* $(MemQueue)
|
|
35
34
|
const q = yield* $(mem.getOrCreateQueue(queueName))
|
|
36
35
|
const qDrain = yield* $(mem.getOrCreateQueue(queueDrainName))
|
|
36
|
+
const rcc = yield* $(RequestContextContainer)
|
|
37
37
|
|
|
38
38
|
return {
|
|
39
39
|
publish: (...messages) =>
|
|
40
40
|
Effect.gen(function*($) {
|
|
41
|
-
const requestContext = yield* $(
|
|
41
|
+
const requestContext = yield* $(rcc.requestContext)
|
|
42
42
|
return yield* $(
|
|
43
43
|
messages
|
|
44
44
|
.forEachEffect((m) =>
|
|
@@ -64,21 +64,18 @@ export function makeMemQueue<
|
|
|
64
64
|
.flatMap(parseDrain)
|
|
65
65
|
.orDie
|
|
66
66
|
.flatMap(({ body, meta }) =>
|
|
67
|
-
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
})
|
|
80
|
-
)
|
|
81
|
-
)
|
|
67
|
+
rcc.start(RequestContext.inherit(meta, {
|
|
68
|
+
id: RequestId(body.id),
|
|
69
|
+
locale: "en" as const,
|
|
70
|
+
name: ReasonableString(body._tag)
|
|
71
|
+
}))
|
|
72
|
+
> rcc.requestContext.flatMap((_) => _.restoreStoreId)
|
|
73
|
+
> Effect
|
|
74
|
+
.logDebug(`$$ [${queueDrainName}] Processing incoming message`)
|
|
75
|
+
.apply(Effect.annotateLogs({ body: body.$$.pretty, meta: meta.$$.pretty }))
|
|
76
|
+
.zipRight(handleEvent(body))
|
|
77
|
+
.apply(silenceAndReportError)
|
|
78
|
+
.apply(provideContext)
|
|
82
79
|
)
|
|
83
80
|
return yield* $(
|
|
84
81
|
qDrain
|
|
@@ -12,7 +12,6 @@ import { RequestContext } from "@effect-app/infra/RequestContext"
|
|
|
12
12
|
import { RequestId } from "@effect-app/prelude/ids"
|
|
13
13
|
import type { CustomSchemaException } from "@effect-app/prelude/schema"
|
|
14
14
|
import { RequestContextContainer } from "../RequestContextContainer.js"
|
|
15
|
-
import { restoreFromRequestContext } from "../Store/Memory.js"
|
|
16
15
|
import { reportNonInterruptedFailure, reportNonInterruptedFailureCause } from "./errors.js"
|
|
17
16
|
import type { QueueBase } from "./service.js"
|
|
18
17
|
|
|
@@ -31,9 +30,9 @@ export function makeServiceBusQueue<
|
|
|
31
30
|
queueDrainName: string,
|
|
32
31
|
encoder: (e: { body: Evt; meta: RequestContext }) => EvtE,
|
|
33
32
|
makeHandleEvent: Effect<DrainR, never, (ks: DrainEvt) => Effect<RContext, DrainE, void>>,
|
|
34
|
-
provideContext:
|
|
33
|
+
provideContext: <R, E, A>(
|
|
35
34
|
eff: Effect<RContext | R, E, A>
|
|
36
|
-
) => Effect<Exclude<R, RContext
|
|
35
|
+
) => Effect<Exclude<R, RContext>, E, A>,
|
|
37
36
|
parseDrain: (
|
|
38
37
|
a: unknown,
|
|
39
38
|
env?: Parser.ParserEnv | undefined
|
|
@@ -45,6 +44,7 @@ export function makeServiceBusQueue<
|
|
|
45
44
|
const receiverLayer = Receiver.makeLayer(receiver)
|
|
46
45
|
const silenceAndReportError = reportNonInterruptedFailure({ name: "ServiceBusQueue.drain." + queueDrainName })
|
|
47
46
|
const reportError = reportNonInterruptedFailureCause({ name: "ServiceBusQueue.drain." + queueDrainName })
|
|
47
|
+
const rcc = yield* $(RequestContextContainer)
|
|
48
48
|
|
|
49
49
|
return {
|
|
50
50
|
drain: Effect.gen(function*($) {
|
|
@@ -56,23 +56,20 @@ export function makeServiceBusQueue<
|
|
|
56
56
|
.flatMap((x) => parseDrain(x))
|
|
57
57
|
.orDie
|
|
58
58
|
.flatMap(({ body, meta }) =>
|
|
59
|
-
|
|
60
|
-
.
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
)
|
|
75
|
-
)
|
|
59
|
+
rcc.start(RequestContext.inherit(meta, {
|
|
60
|
+
id: RequestId(body.id),
|
|
61
|
+
locale: "en" as const,
|
|
62
|
+
name: ReasonableString(body._tag)
|
|
63
|
+
}))
|
|
64
|
+
> rcc.requestContext.flatMap((_) => _.restoreStoreId)
|
|
65
|
+
> Effect
|
|
66
|
+
.logDebug(`$$ [${queueDrainName}] Processing incoming message`)
|
|
67
|
+
.apply(Effect.annotateLogs({ body: body.$$.pretty, meta: meta.$$.pretty }))
|
|
68
|
+
.zipRight(handleEvent(body))
|
|
69
|
+
.orDie
|
|
70
|
+
// we silenceAndReportError here, so that the error is reported, and moves into the Exit.
|
|
71
|
+
.apply(silenceAndReportError)
|
|
72
|
+
.apply(provideContext)
|
|
76
73
|
)
|
|
77
74
|
// we reportError here, so that we report the error only, and keep flowing
|
|
78
75
|
.tapErrorCause(reportError)
|
|
@@ -89,7 +86,7 @@ export function makeServiceBusQueue<
|
|
|
89
86
|
|
|
90
87
|
publish: (...messages) =>
|
|
91
88
|
Effect.gen(function*($) {
|
|
92
|
-
const requestContext = yield* $(
|
|
89
|
+
const requestContext = yield* $(rcc.requestContext)
|
|
93
90
|
return yield* $(
|
|
94
91
|
Effect
|
|
95
92
|
.promise(() =>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { RequestContextContainer } from "../RequestContextContainer.js"
|
|
2
|
-
|
|
3
1
|
export interface QueueBase<RContext, Evt> {
|
|
4
2
|
drain: Effect<Scope | RContext, never, void>
|
|
5
3
|
publish: (
|
|
6
4
|
...messages: NonEmptyReadonlyArray<Evt>
|
|
7
|
-
) => Effect<
|
|
5
|
+
) => Effect<never, never, void>
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { RequestContext } from "../../RequestContext.js"
|
|
4
4
|
import type { Filter, FilterJoinSelect, PersistenceModelType, Store, StoreConfig } from "./service.js"
|
|
5
5
|
import { StoreMaker } from "./service.js"
|
|
6
6
|
import { codeFilter, codeFilterJoinSelect, makeETag, makeUpdateETag } from "./utils.js"
|
|
@@ -24,9 +24,11 @@ export function memFilter<T extends { id: string }>(filter: Filter<T>, cursor?:
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const storeId = FiberRef.unsafeMake("primary")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @tsplus getter RequestContext restoreStoreId
|
|
30
|
+
*/
|
|
31
|
+
export const restoreFromRequestContext = (ctx: RequestContext) => storeId.set(ctx.namespace ?? "primary")
|
|
30
32
|
|
|
31
33
|
function logQuery(filter: any, cursor: any) {
|
|
32
34
|
return Effect
|
|
@@ -14,11 +14,11 @@ export declare function makeMemQueue<DrainR, Evt, DrainEvt extends {
|
|
|
14
14
|
}, RContext, EvtE, DrainE>(queueName: string, queueDrainName: string, encoder: (e: {
|
|
15
15
|
body: Evt;
|
|
16
16
|
meta: RequestContext;
|
|
17
|
-
}) => EvtE, makeHandleEvent: Effect<DrainR, never, (ks: DrainEvt) => Effect<RContext, DrainE, void>>, provideContext:
|
|
17
|
+
}) => EvtE, makeHandleEvent: Effect<DrainR, never, (ks: DrainEvt) => Effect<RContext, DrainE, void>>, provideContext: <R, E, A>(eff: Effect<RContext | R, E, A>) => Effect<Exclude<R, RContext>, E, A>, parseDrain: (a: unknown, env?: Parser.ParserEnv | undefined) => Effect<never, CustomSchemaException, {
|
|
18
18
|
body: DrainEvt;
|
|
19
19
|
meta: RequestContext;
|
|
20
|
-
}>): import("effect/Effect").Effect<MemQueue, never, {
|
|
21
|
-
publish: (messages_0: Evt, ...messages_1: Evt[]) => import("effect/Effect").Effect<
|
|
20
|
+
}>): import("effect/Effect").Effect<MemQueue | RequestContextContainer, never, {
|
|
21
|
+
publish: (messages_0: Evt, ...messages_1: Evt[]) => import("effect/Effect").Effect<never, never, import("effect/Fiber").RuntimeFiber<never, void[]>>;
|
|
22
22
|
drain: import("effect/Effect").Effect<import("effect/Scope").Scope | DrainR, never, import("effect/Fiber").RuntimeFiber<never, never>>;
|
|
23
23
|
}>;
|
|
24
24
|
//# sourceMappingURL=memQueue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memQueue.d.ts","sourceRoot":"","sources":["../../../_src/services/QueueMaker/memQueue.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;;;;;
|
|
1
|
+
{"version":3,"file":"memQueue.d.ts","sourceRoot":"","sources":["../../../_src/services/QueueMaker/memQueue.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;;;;;AAOvE,wBAAgB,YAAY,CAC1B,MAAM,EACN,GAAG,EACH,QAAQ,SAAS;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC/C,QAAQ,EACR,IAAI,EACJ,MAAM,EAEN,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,KAAK,IAAI,EACzD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,EACxF,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACtB,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC5B,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACvC,UAAU,EAAE,CACV,CAAC,EAAE,OAAO,EACV,GAAG,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS,KAC/B,MAAM,CAAC,KAAK,EAAE,qBAAqB,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;;;GA+DpF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "effect/Effect";
|
|
2
2
|
import * as tsplus_module_2 from "@effect-app/core/_ext/Iterable";
|
|
3
3
|
import * as tsplus_module_3 from "@effect-app/infra/services/QueueMaker/errors";
|
|
4
|
-
import * as tsplus_module_4 from "@effect-app/prelude/
|
|
5
|
-
import * as tsplus_module_5 from "@effect-app/
|
|
6
|
-
import * as tsplus_module_6 from "effect/
|
|
4
|
+
import * as tsplus_module_4 from "@effect-app/prelude/schema";
|
|
5
|
+
import * as tsplus_module_5 from "@effect-app/infra/services/Store/Memory";
|
|
6
|
+
import * as tsplus_module_6 from "@effect-app/prelude/utils";
|
|
7
|
+
import * as tsplus_module_7 from "effect/Fiber";
|
|
7
8
|
import { MemQueue } from "@effect-app/infra-adapters/memQueue";
|
|
8
9
|
import { RequestContext } from "@effect-app/infra/RequestContext";
|
|
9
10
|
import { RequestId } from "@effect-app/prelude/ids";
|
|
10
11
|
import { RequestContextContainer } from "../RequestContextContainer.js";
|
|
11
|
-
import { restoreFromRequestContext } from "../Store/Memory.js";
|
|
12
12
|
import { reportNonInterruptedFailure } from "./errors.js";
|
|
13
13
|
/**
|
|
14
14
|
* @tsplus static QueueMaker.Ops makeMem
|
|
@@ -18,9 +18,10 @@ export function makeMemQueue(queueName, queueDrainName, encoder, makeHandleEvent
|
|
|
18
18
|
const mem = yield* $(MemQueue);
|
|
19
19
|
const q = yield* $(mem.getOrCreateQueue(queueName));
|
|
20
20
|
const qDrain = yield* $(mem.getOrCreateQueue(queueDrainName));
|
|
21
|
+
const rcc = yield* $(RequestContextContainer);
|
|
21
22
|
return {
|
|
22
23
|
publish: (...messages) => tsplus_module_1.gen(function* ($) {
|
|
23
|
-
const requestContext = yield* $(
|
|
24
|
+
const requestContext = yield* $(rcc.requestContext);
|
|
24
25
|
return yield* $(tsplus_module_3.forkDaemonReportQueue(tsplus_module_2.ext_forEach(messages, (m) => tsplus_module_1.asUnit(
|
|
25
26
|
// we JSON encode, because that is what the wire also does, and it reveals holes in e.g unknown encoders (Date->String)
|
|
26
27
|
tsplus_module_1.flatMap(tsplus_module_1.sync(() => JSON.stringify(encoder({ body: m, meta: requestContext })))
|
|
@@ -32,13 +33,13 @@ export function makeMemQueue(queueName, queueDrainName, encoder, makeHandleEvent
|
|
|
32
33
|
const silenceAndReportError = reportNonInterruptedFailure({ name: "MemQueue.drain." + queueDrainName });
|
|
33
34
|
const processMessage = (msg) =>
|
|
34
35
|
// we JSON parse, because that is what the wire also does, and it reveals holes in e.g unknown encoders (Date->String)
|
|
35
|
-
tsplus_module_1.flatMap(tsplus_module_1.orDie(tsplus_module_1.flatMap(tsplus_module_1.sync(() => JSON.parse(msg)), parseDrain)), ({ body, meta }) => provideContext(RequestContext.inherit(meta, {
|
|
36
|
+
tsplus_module_1.flatMap(tsplus_module_1.orDie(tsplus_module_1.flatMap(tsplus_module_1.sync(() => JSON.parse(msg)), parseDrain)), ({ body, meta }) => tsplus_module_1.zipRight(provideContext(silenceAndReportError(tsplus_module_1.zipRight(tsplus_module_1.annotateLogs({ body: tsplus_module_6.RecordPretty(tsplus_module_6.object$(body)), meta: tsplus_module_6.RecordPretty(tsplus_module_6.object$(meta)) })(tsplus_module_1.logDebug(`$$ [${queueDrainName}] Processing incoming message`)), handleEvent(body)))))(tsplus_module_1.zipRight(tsplus_module_1.flatMap(rcc.requestContext, (_) => tsplus_module_5.restoreFromRequestContext(_)))(rcc.start(RequestContext.inherit(meta, {
|
|
36
37
|
id: RequestId(body.id),
|
|
37
38
|
locale: "en",
|
|
38
|
-
name:
|
|
39
|
-
}))
|
|
39
|
+
name: tsplus_module_4.ReasonableString(body._tag)
|
|
40
|
+
})))));
|
|
40
41
|
return yield* $(tsplus_module_1.forkScoped(tsplus_module_1.forever(silenceAndReportError(tsplus_module_1.flatMap(qDrain
|
|
41
|
-
.take(), (x) => tsplus_module_1.flatMap(tsplus_module_1.fork(tsplus_module_1.uninterruptible(processMessage(x))), (_) =>
|
|
42
|
+
.take(), (x) => tsplus_module_1.flatMap(tsplus_module_1.fork(tsplus_module_1.uninterruptible(processMessage(x))), (_) => tsplus_module_7.join(_)))
|
|
42
43
|
// TODO: normally a failed item would be returned to the queue and retried up to X times.
|
|
43
44
|
// .flatMap(_ => _._tag === "Failure" && !isInterrupted ? qDrain.offer(x) : Effect.unit) // TODO: retry count tracking and max retries.
|
|
44
45
|
))));
|
|
@@ -46,4 +47,4 @@ export function makeMemQueue(queueName, queueDrainName, encoder, makeHandleEvent
|
|
|
46
47
|
};
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVtUXVldWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9fc3JjL3NlcnZpY2VzL1F1ZXVlTWFrZXIvbWVtUXVldWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQTtBQUM5RCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sa0NBQWtDLENBQUE7QUFDakUsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHlCQUF5QixDQUFBO0FBRW5ELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLCtCQUErQixDQUFB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QUFDLENBQWUsQ0FBQyxFQUx2RCxHQUFHLENBQUMsS0FBSyxDQUFDLGNBQWMsQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFO29CQUNyQyxFQUFFLEVBQUUsU0FBUyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUM7b0JBQ3RCLE1BQU0sRUFBRSxJQUFhO29CQUNyQixJQUFJLEVBQUUsZ0JBQUEsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQztpQkFDbEMsQ0FBQyxDQUFDLEVBT3VCLENBQzNCLENBQUE7Z0JBQ0wsT0FBTyxLQUFLLENBQUMsQ0FBQyxDQUFDLG9EQU1KLHFCQUFxQixDQUw5Qix3QkFBQSxNQUFNO3FCQUNILElBQUksRUFBRSxFQUNFLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyw2RUFBQSxjQUFjLENBQUMsQ0FBQyxDQUFDLElBQThCLENBQUMsQ0FBQyxFQUFFLEVBQUUsc0JBQUMsQ0FBQyxDQUFLLENBQUMsQ0FBQztnQkFDOUUseUZBQXlGO2dCQUN6Rix1SUFBdUk7b0JBSTFJLENBQUE7WUFDSCxDQUFDLENBQUM7U0FDOEIsQ0FBQTtJQUNwQyxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMifQ==
|
|
@@ -16,12 +16,12 @@ export declare function makeServiceBusQueue<DrainR, Evt extends {
|
|
|
16
16
|
}, RContext, EvtE, DrainE>(_queueName: string, queueDrainName: string, encoder: (e: {
|
|
17
17
|
body: Evt;
|
|
18
18
|
meta: RequestContext;
|
|
19
|
-
}) => EvtE, makeHandleEvent: Effect<DrainR, never, (ks: DrainEvt) => Effect<RContext, DrainE, void>>, provideContext:
|
|
19
|
+
}) => EvtE, makeHandleEvent: Effect<DrainR, never, (ks: DrainEvt) => Effect<RContext, DrainE, void>>, provideContext: <R, E, A>(eff: Effect<RContext | R, E, A>) => Effect<Exclude<R, RContext>, E, A>, parseDrain: (a: unknown, env?: Parser.ParserEnv | undefined) => Effect<never, CustomSchemaException, {
|
|
20
20
|
body: DrainEvt;
|
|
21
21
|
meta: RequestContext;
|
|
22
|
-
}>): import("effect/Effect").Effect<import("@azure/service-bus").ServiceBusReceiver | import("@azure/service-bus").ServiceBusSender, never, {
|
|
22
|
+
}>): import("effect/Effect").Effect<RequestContextContainer | import("@azure/service-bus").ServiceBusReceiver | import("@azure/service-bus").ServiceBusSender, never, {
|
|
23
23
|
drain: import("effect/Effect").Effect<import("effect/Scope").Scope | DrainR, never, void>;
|
|
24
|
-
publish: (messages_0: Evt, ...messages_1: Evt[]) => import("effect/Effect").Effect<
|
|
24
|
+
publish: (messages_0: Evt, ...messages_1: Evt[]) => import("effect/Effect").Effect<never, never, import("effect/Fiber").RuntimeFiber<never, void>>;
|
|
25
25
|
}>;
|
|
26
26
|
/**
|
|
27
27
|
* @tsplus static QueueMaker.Ops makeServiceBusLayers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sbqueue.d.ts","sourceRoot":"","sources":["../../../_src/services/QueueMaker/sbqueue.ts"],"names":[],"mappings":";;AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;;;;;
|
|
1
|
+
{"version":3,"file":"sbqueue.d.ts","sourceRoot":"","sources":["../../../_src/services/QueueMaker/sbqueue.ts"],"names":[],"mappings":";;AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;;;;;AAOvE,wBAAgB,mBAAmB,CACjC,MAAM,EACN,GAAG,SAAS;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CA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