@effect-app/infra 0.73.1 → 0.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/_cjs/RequestContext.cjs +2 -4
- package/_cjs/RequestContext.cjs.map +1 -1
- package/_cjs/api/authorization.jwt.cjs +1 -2
- package/_cjs/api/authorization.jwt.cjs.map +1 -1
- package/_cjs/api/codec.cjs +4 -3
- package/_cjs/api/codec.cjs.map +1 -1
- package/_cjs/api/defaultErrorHandler.cjs +6 -8
- package/_cjs/api/defaultErrorHandler.cjs.map +1 -1
- package/_cjs/api/express/makeJsonSchema.test.cjs +2 -2
- package/_cjs/api/express/makeJsonSchema.test.cjs.map +1 -1
- package/_cjs/api/express/schema/jwt.cjs +8 -10
- package/_cjs/api/express/schema/jwt.cjs.map +1 -1
- package/_cjs/api/express/schema/requestHandler.cjs +7 -6
- package/_cjs/api/express/schema/requestHandler.cjs.map +1 -1
- package/_cjs/api/express/schema/routing.cjs +20 -5
- package/_cjs/api/express/schema/routing.cjs.map +1 -1
- package/_cjs/api/reportError.cjs +7 -8
- package/_cjs/api/reportError.cjs.map +1 -1
- package/_cjs/api/routing.cjs +26 -25
- package/_cjs/api/routing.cjs.map +1 -1
- package/_cjs/api/setupRequest.cjs +3 -4
- package/_cjs/api/setupRequest.cjs.map +1 -1
- package/_cjs/api/writeDocs.cjs +3 -4
- package/_cjs/api/writeDocs.cjs.map +1 -1
- package/_cjs/errorReporter.cjs +10 -11
- package/_cjs/errorReporter.cjs.map +1 -1
- package/_cjs/errors.cjs +1 -1
- package/_cjs/errors.cjs.map +1 -1
- package/_cjs/filter.cjs +14 -28
- package/_cjs/filter.cjs.map +1 -1
- package/_cjs/instrument.cjs +1 -2
- package/_cjs/instrument.cjs.map +1 -1
- package/_cjs/logger/jsonLogger.cjs +17 -12
- package/_cjs/logger/jsonLogger.cjs.map +1 -1
- package/_cjs/logger/logFmtLogger.cjs +7 -6
- package/_cjs/logger/logFmtLogger.cjs.map +1 -1
- package/_cjs/rateLimit.cjs +13 -5
- package/_cjs/rateLimit.cjs.map +1 -1
- package/_cjs/services/Emailer/Sendgrid.cjs +10 -9
- package/_cjs/services/Emailer/Sendgrid.cjs.map +1 -1
- package/_cjs/services/Emailer/fake.cjs +3 -3
- package/_cjs/services/Emailer/fake.cjs.map +1 -1
- package/_cjs/services/Operations/live.cjs +4 -6
- package/_cjs/services/Operations/live.cjs.map +1 -1
- package/_cjs/services/Operations/service.cjs +5 -7
- package/_cjs/services/Operations/service.cjs.map +1 -1
- package/_cjs/services/QueueMaker/errors.cjs +5 -3
- package/_cjs/services/QueueMaker/errors.cjs.map +1 -1
- package/_cjs/services/QueueMaker/memQueue.cjs +5 -6
- package/_cjs/services/QueueMaker/memQueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/sbqueue.cjs +9 -10
- package/_cjs/services/QueueMaker/sbqueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/service.cjs +1 -2
- package/_cjs/services/QueueMaker/service.cjs.map +1 -1
- package/_cjs/services/Repository.cjs +18 -30
- package/_cjs/services/Repository.cjs.map +1 -1
- package/_cjs/services/RepositoryBase.cjs +7 -5
- package/_cjs/services/RepositoryBase.cjs.map +1 -1
- package/_cjs/services/RequestContextContainer.cjs +1 -2
- package/_cjs/services/RequestContextContainer.cjs.map +1 -1
- package/_cjs/services/Store/Cosmos.cjs +68 -58
- package/_cjs/services/Store/Cosmos.cjs.map +1 -1
- package/_cjs/services/Store/Disk.cjs +2 -1
- package/_cjs/services/Store/Disk.cjs.map +1 -1
- package/_cjs/services/Store/Memory.cjs +15 -19
- package/_cjs/services/Store/Memory.cjs.map +1 -1
- package/_cjs/services/Store/Redis.cjs +2 -1
- package/_cjs/services/Store/Redis.cjs.map +1 -1
- package/_cjs/services/Store/index.cjs +4 -3
- package/_cjs/services/Store/index.cjs.map +1 -1
- package/_cjs/services/Store/service.cjs +1 -2
- package/_cjs/services/Store/service.cjs.map +1 -1
- package/_cjs/services/simpledb/cosmosdb.cjs +25 -23
- package/_cjs/services/simpledb/cosmosdb.cjs.map +1 -1
- package/_cjs/services/simpledb/diskdb.cjs +16 -7
- package/_cjs/services/simpledb/diskdb.cjs.map +1 -1
- package/_cjs/services/simpledb/memdb.cjs +1 -1
- package/_cjs/services/simpledb/memdb.cjs.map +1 -1
- package/_cjs/services/simpledb/mongodb.cjs +26 -22
- package/_cjs/services/simpledb/mongodb.cjs.map +1 -1
- package/_cjs/services/simpledb/redisdb.cjs +35 -28
- package/_cjs/services/simpledb/redisdb.cjs.map +1 -1
- package/_cjs/services/simpledb/simpledb.cjs +25 -17
- package/_cjs/services/simpledb/simpledb.cjs.map +1 -1
- package/_cjs/test.arbs.cjs +5 -4
- package/_cjs/test.arbs.cjs.map +1 -1
- package/_src/api/defaultErrorHandler.ts +33 -37
- package/_src/api/express/makeJsonSchema.test.ts +2 -2
- package/_src/api/express/routing.ts.bak +1 -1
- package/_src/api/express/schema/routing.ts +20 -20
- package/_src/api/reportError.ts +15 -19
- package/_src/api/routing.ts +96 -95
- package/_src/api/setupRequest.ts +4 -6
- package/_src/api/writeDocs.ts +1 -1
- package/_src/errorReporter.ts +25 -29
- package/_src/errors.ts +1 -1
- package/_src/instrument.ts +4 -5
- package/_src/logger/jsonLogger.ts +5 -6
- package/_src/logger/logFmtLogger.ts +5 -4
- package/_src/rateLimit.ts +10 -9
- package/_src/services/Emailer/Sendgrid.ts +3 -3
- package/_src/services/Emailer/fake.ts +1 -1
- package/_src/services/Operations/live.ts +1 -1
- package/_src/services/Operations/service.ts +32 -38
- package/_src/services/QueueMaker/errors.ts +1 -2
- package/_src/services/QueueMaker/memQueue.ts +1 -1
- package/_src/services/QueueMaker/sbqueue.ts +3 -3
- package/_src/services/Repository.ts +6 -10
- package/_src/services/RepositoryBase.ts +4 -2
- package/_src/services/Store/Cosmos.ts +66 -62
- package/_src/services/Store/Memory.ts +1 -1
- package/_src/services/simpledb/cosmosdb.ts +45 -43
- package/_src/services/simpledb/diskdb.ts +9 -10
- package/_src/services/simpledb/mongodb.ts +33 -31
- package/_src/services/simpledb/redisdb.ts +42 -40
- package/_src/services/simpledb/simpledb.ts +6 -7
- package/dist/RequestContext.d.ts +4 -4
- package/dist/RequestContext.js +5 -3
- package/dist/api/defaultErrorHandler.d.ts.map +1 -1
- package/dist/api/defaultErrorHandler.js +7 -9
- package/dist/api/express/schema/routing.js +21 -6
- package/dist/api/reportError.d.ts.map +1 -1
- package/dist/api/reportError.js +9 -10
- package/dist/api/routing.d.ts +1 -1
- package/dist/api/routing.d.ts.map +1 -1
- package/dist/api/routing.js +35 -33
- package/dist/api/setupRequest.d.ts.map +1 -1
- package/dist/api/setupRequest.js +4 -5
- package/dist/api/writeDocs.js +4 -5
- package/dist/errorReporter.d.ts.map +1 -1
- package/dist/errorReporter.js +11 -12
- package/dist/errors.js +2 -2
- package/dist/instrument.d.ts.map +1 -1
- package/dist/instrument.js +2 -3
- package/dist/logger/jsonLogger.d.ts +1 -1
- package/dist/logger/jsonLogger.d.ts.map +1 -1
- package/dist/logger/jsonLogger.js +9 -11
- package/dist/logger/logFmtLogger.d.ts +1 -1
- package/dist/logger/logFmtLogger.d.ts.map +1 -1
- package/dist/logger/logFmtLogger.js +5 -4
- package/dist/rateLimit.d.ts.map +1 -1
- package/dist/rateLimit.js +6 -6
- package/dist/services/Emailer/Sendgrid.d.ts +1 -1
- package/dist/services/Emailer/Sendgrid.d.ts.map +1 -1
- package/dist/services/Emailer/Sendgrid.js +11 -10
- package/dist/services/Emailer/fake.js +4 -3
- package/dist/services/Emailer/service.d.ts +1 -1
- package/dist/services/Operations/live.js +5 -6
- package/dist/services/Operations/service.d.ts.map +1 -1
- package/dist/services/Operations/service.js +8 -9
- package/dist/services/QueueMaker/errors.d.ts.map +1 -1
- package/dist/services/QueueMaker/errors.js +2 -2
- package/dist/services/QueueMaker/memQueue.js +6 -7
- package/dist/services/QueueMaker/sbqueue.js +10 -11
- package/dist/services/Repository.d.ts.map +1 -1
- package/dist/services/Repository.js +8 -9
- package/dist/services/RepositoryBase.d.ts +1 -1
- package/dist/services/RepositoryBase.d.ts.map +1 -1
- package/dist/services/RepositoryBase.js +5 -4
- package/dist/services/Store/Cosmos.d.ts +1 -1
- package/dist/services/Store/Cosmos.d.ts.map +1 -1
- package/dist/services/Store/Cosmos.js +64 -55
- package/dist/services/Store/Disk.d.ts +1 -1
- package/dist/services/Store/Disk.d.ts.map +1 -1
- package/dist/services/Store/Disk.js +3 -2
- package/dist/services/Store/Memory.js +13 -14
- package/dist/services/Store/Redis.d.ts +1 -1
- package/dist/services/Store/Redis.d.ts.map +1 -1
- package/dist/services/Store/Redis.js +3 -2
- package/dist/services/Store/index.d.ts +1 -1
- package/dist/services/Store/index.d.ts.map +1 -1
- package/dist/services/Store/index.js +5 -4
- package/dist/services/Store/service.d.ts +1 -1
- package/dist/services/simpledb/cosmosdb.d.ts.map +1 -1
- package/dist/services/simpledb/cosmosdb.js +29 -27
- package/dist/services/simpledb/diskdb.d.ts.map +1 -1
- package/dist/services/simpledb/diskdb.js +10 -4
- package/dist/services/simpledb/memdb.d.ts +2 -2
- package/dist/services/simpledb/memdb.js +1 -1
- package/dist/services/simpledb/mongodb.d.ts.map +1 -1
- package/dist/services/simpledb/mongodb.js +18 -15
- package/dist/services/simpledb/redisdb.d.ts.map +1 -1
- package/dist/services/simpledb/redisdb.js +30 -23
- package/dist/services/simpledb/simpledb.d.ts.map +1 -1
- package/dist/services/simpledb/simpledb.js +16 -12
- package/package.json +22 -22
- package/tsconfig.json +1 -1
|
@@ -4,17 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.logJson = exports.jsonLogger = void 0;
|
|
7
|
-
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/
|
|
7
|
+
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/FiberId"));
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/Option"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Cause"));
|
|
10
|
-
var tsplus_module_4 = _interopRequireWildcard(require("@effect/data/
|
|
11
|
-
var tsplus_module_5 = _interopRequireWildcard(require("@effect
|
|
12
|
-
var tsplus_module_6 = _interopRequireWildcard(require("@effect/
|
|
13
|
-
var tsplus_module_7 = _interopRequireWildcard(require("@effect/io/Logger"));
|
|
10
|
+
var tsplus_module_4 = _interopRequireWildcard(require("@effect/data/List"));
|
|
11
|
+
var tsplus_module_5 = _interopRequireWildcard(require("@effect/data/HashMap"));
|
|
12
|
+
var tsplus_module_6 = _interopRequireWildcard(require("@effect/io/Logger"));
|
|
14
13
|
var _shared = require("./shared.cjs");
|
|
15
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
const jsonLogger =
|
|
16
|
+
const jsonLogger = exports.jsonLogger = tsplus_module_6.make(({
|
|
17
|
+
annotations,
|
|
18
|
+
cause,
|
|
19
|
+
context,
|
|
20
|
+
fiberId,
|
|
21
|
+
logLevel,
|
|
22
|
+
message,
|
|
23
|
+
spans
|
|
24
|
+
}) => {
|
|
18
25
|
const now = new Date();
|
|
19
26
|
const nowMillis = now.getTime();
|
|
20
27
|
const c = (0, _shared.getRequestContext)(context);
|
|
@@ -25,18 +32,16 @@ const jsonLogger = tsplus_module_7.make((fiberId, logLevel, message, cause, cont
|
|
|
25
32
|
message,
|
|
26
33
|
request: tsplus_module_2.getOrUndefined(c),
|
|
27
34
|
cause: cause != null && cause != tsplus_module_3.empty ? tsplus_module_3.pretty(cause) : undefined,
|
|
28
|
-
spans: tsplus_module_4.
|
|
35
|
+
spans: tsplus_module_4.toReadonlyArray(tsplus_module_4.map(spans, _ => ({
|
|
29
36
|
label: _.label,
|
|
30
37
|
timing: nowMillis - _.startTime
|
|
31
|
-
})))
|
|
32
|
-
annotations:
|
|
38
|
+
}))),
|
|
39
|
+
annotations: tsplus_module_5.size(annotations) > 0 ? [...annotations].reduce((prev, [k, v]) => {
|
|
33
40
|
prev[k] = v;
|
|
34
41
|
return prev;
|
|
35
42
|
}, {}) : undefined
|
|
36
43
|
};
|
|
37
44
|
globalThis.console.log(JSON.stringify(data));
|
|
38
45
|
});
|
|
39
|
-
exports.
|
|
40
|
-
const logJson = tsplus_module_7.replace(tsplus_module_7.defaultLogger, jsonLogger);
|
|
41
|
-
exports.logJson = logJson;
|
|
46
|
+
const logJson = exports.logJson = tsplus_module_6.replace(tsplus_module_6.defaultLogger, jsonLogger);
|
|
42
47
|
//# sourceMappingURL=jsonLogger.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonLogger.cjs","names":["_shared","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","jsonLogger","
|
|
1
|
+
{"version":3,"file":"jsonLogger.cjs","names":["_shared","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","jsonLogger","exports","tsplus_module_6","make","annotations","cause","context","fiberId","logLevel","message","spans","now","Date","nowMillis","getTime","c","getRequestContext","data","timestamp","level","label","fiber","tsplus_module_1","threadName","request","tsplus_module_2","getOrUndefined","tsplus_module_3","empty","pretty","undefined","tsplus_module_4","toReadonlyArray","map","_","timing","startTime","tsplus_module_5","size","reduce","prev","k","v","globalThis","console","log","JSON","stringify","logJson","replace","defaultLogger"],"sources":["../../_src/logger/jsonLogger.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAA+C,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SA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e,MAAM,EAAEtB,SAAS,GAAGqB,CAAC,CAACE;IAAS,CAAE,CAAC,CAAC,CAAgB;IAC9FhC,WAAW,EAAEiC,eAAA,CAAAC,IAAA,CAAAlC,WAAW,IAAQ,CAAC,GAC7B,CAAC,GAAGA,WAAW,CAAC,CAACmC,MAAM,CAAC,CAACC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAI;MACzCF,IAAI,CAACC,CAAC,CAAC,GAAGC,CAAC;MACX,OAAOF,IAAI;IACb,CAAC,EAAE,EAAqC,CAAC,GACvCV;GACL;EAEDa,UAAU,CAACC,OAAO,CAACC,GAAG,CAACC,IAAI,CAACC,SAAS,CAAC9B,IAAI,CAAC,CAAC;AAC9C,CAAC,CACF;AAEM,MAAM+B,OAAO,GAAA/C,OAAA,CAAA+C,OAAA,GAAG9C,eAAA,CAAA+C,OAAA,CAAA/C,eAAA,CAAAgD,aAAA,EAAqClD,UAAU,CAAC"}
|
|
@@ -11,8 +11,11 @@ var tsplus_module_4 = _interopRequireWildcard(require("@effect/io/Logger"));
|
|
|
11
11
|
var _shared = require("./shared.cjs");
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
const logfmtLogger = tsplus_module_4.make(
|
|
15
|
-
|
|
14
|
+
const logfmtLogger = exports.logfmtLogger = tsplus_module_4.make(_ => {
|
|
15
|
+
let {
|
|
16
|
+
annotations
|
|
17
|
+
} = _;
|
|
18
|
+
const c = (0, _shared.getRequestContext)(_.context);
|
|
16
19
|
const requestContext = tsplus_module_1.getOrUndefined(c);
|
|
17
20
|
if (requestContext) {
|
|
18
21
|
annotations = tsplus_module_3.make(...[...annotations, ...tsplus_module_2.RecordEntries(tsplus_module_2.object$({
|
|
@@ -24,10 +27,8 @@ const logfmtLogger = tsplus_module_4.make((fiberId, logLevel, message, cause, co
|
|
|
24
27
|
} : {})
|
|
25
28
|
}))]);
|
|
26
29
|
}
|
|
27
|
-
const formatted = tsplus_module_4.logfmtLogger.log(
|
|
30
|
+
const formatted = tsplus_module_4.logfmtLogger.log(_);
|
|
28
31
|
globalThis.console.log(formatted);
|
|
29
32
|
});
|
|
30
|
-
exports.
|
|
31
|
-
const logFmt = tsplus_module_4.replace(tsplus_module_4.defaultLogger, logfmtLogger);
|
|
32
|
-
exports.logFmt = logFmt;
|
|
33
|
+
const logFmt = exports.logFmt = tsplus_module_4.replace(tsplus_module_4.defaultLogger, logfmtLogger);
|
|
33
34
|
//# sourceMappingURL=logFmtLogger.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logFmtLogger.cjs","names":["_shared","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","logfmtLogger","tsplus_module_4","make","
|
|
1
|
+
{"version":3,"file":"logFmtLogger.cjs","names":["_shared","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","logfmtLogger","exports","tsplus_module_4","make","_","annotations","c","getRequestContext","context","requestContext","tsplus_module_1","getOrUndefined","tsplus_module_3","tsplus_module_2","RecordEntries","object$","requestRootId","rootId","requestId","id","requestName","name","userProfile","sub","requestUserSub","formatted","log","globalThis","console","logFmt","replace","defaultLogger"],"sources":["../../_src/logger/logFmtLogger.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAA+C,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAA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,EAAqC/B,YAAY,CAAC"}
|
package/_cjs/rateLimit.cjs
CHANGED
|
@@ -8,8 +8,8 @@ exports.batch = batch;
|
|
|
8
8
|
exports.batchPar = batchPar;
|
|
9
9
|
exports.naiveRateLimit = naiveRateLimit;
|
|
10
10
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
11
|
-
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/
|
|
12
|
-
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/
|
|
11
|
+
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/_ext/Iterable"));
|
|
12
|
+
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/Array"));
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
// /**
|
|
@@ -55,14 +55,20 @@ function SEM_withPermitsDuration(permits, duration) {
|
|
|
55
55
|
* @tsplus static Collection.Ops batchPar
|
|
56
56
|
*/
|
|
57
57
|
function batchPar(n, forEachItem, forEachBatch) {
|
|
58
|
-
return items => tsplus_module_2.
|
|
58
|
+
return items => tsplus_module_2.ext_forEach(tsplus_module_3.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_2.ext_forEach(_, (_, j) => forEachItem(_, j, i), {
|
|
59
|
+
concurrency: "inherit"
|
|
60
|
+
}), _ => forEachBatch(_, i)), {
|
|
61
|
+
concurrency: "inherit"
|
|
62
|
+
});
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
61
65
|
* @tsplus pipeable Iterable batch
|
|
62
66
|
* @tsplus static Collection.Ops batch
|
|
63
67
|
*/
|
|
64
68
|
function batch(n, forEachItem, forEachBatch) {
|
|
65
|
-
return items => tsplus_module_2.
|
|
69
|
+
return items => tsplus_module_2.ext_forEach(tsplus_module_3.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_2.ext_forEach(_, (_, j) => forEachItem(_, j, i), {
|
|
70
|
+
concurrency: "inherit"
|
|
71
|
+
}), _ => forEachBatch(_, i)));
|
|
66
72
|
}
|
|
67
73
|
// /**
|
|
68
74
|
// * @tsplus pipeable Iterable rateLimit
|
|
@@ -88,6 +94,8 @@ function batch(n, forEachItem, forEachBatch) {
|
|
|
88
94
|
* @tsplus static Collection.Ops naiveRateLimit
|
|
89
95
|
*/
|
|
90
96
|
function naiveRateLimit(n, d) {
|
|
91
|
-
return items => (forEachItem, forEachBatch) => tsplus_module_2.
|
|
97
|
+
return items => (forEachItem, forEachBatch) => tsplus_module_2.ext_forEach(tsplus_module_3.chunk_(items, n), (batch, i) => tsplus_module_1.zipRight(i === 0 ? tsplus_module_1.unit : tsplus_module_1.sleep(d), tsplus_module_1.flatMap(tsplus_module_2.ext_forEach(batch, forEachItem, {
|
|
98
|
+
concurrency: n
|
|
99
|
+
}), forEachBatch)));
|
|
92
100
|
}
|
|
93
101
|
//# sourceMappingURL=rateLimit.cjs.map
|
package/_cjs/rateLimit.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimit.cjs","names":["SEM_withPermitsDuration","permits","duration","self","effect","tsplus_module_1","uninterruptibleMask","restore","zipRight","ensuring","delay","release","take","batchPar","n","forEachItem","forEachBatch","items","tsplus_module_2","
|
|
1
|
+
{"version":3,"file":"rateLimit.cjs","names":["SEM_withPermitsDuration","permits","duration","self","effect","tsplus_module_1","uninterruptibleMask","restore","zipRight","ensuring","delay","release","take","batchPar","n","forEachItem","forEachBatch","items","tsplus_module_2","ext_forEach","tsplus_module_3","chunk_","_","i","flatMap","j","concurrency","batch","naiveRateLimit","d","unit","sleep"],"sources":["../_src/rateLimit.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;AASM,SAAUA,uBAAuBA,CAACC,OAAe,EAAEC,QAAkB;EACzE,OAAQC,IAAe,IAA2D;IAChF,OAAQC,MAAM,IACZC,eAAA,CAAAC,mBAAA,CACGC,OAAO,IAAIF,eAAA,CAAAG,QAAA,CAENH,eAAA,CAAAI,QAAA,CAAAF,OAAO,CAACH,MAAM,CAAC,EAEbC,eAAA,CAAAK,KAAA,CAAAP,IAAI,CACDQ,OAAO,CAACV,OAAO,CAAC,EACVC,QAAQ,CAAC,CACnB,EANLK,OAAO,CAACJ,IAAI,CAACS,IAAI,CAACX,OAAO,CAAC,CAAC,CAMtB,CACR;EACL,CAAC;AACH;AAEA;;;;AAIM,SAAUY,QAAQA,CACtBC,CAAS,EACTC,WAA+E,EAC/EC,YAAoE;EAEpE,OAAQC,KAAkB,IACxBC,eAAA,CAAAC,WAAA,CAAAC,eAAA,CAAAC,MAAA,CAAAJ,KAAK,EACIH,CAAC,CAAC,EAEP,CAACQ,CAAC,EAAEC,CAAC,KACHlB,eAAA,CAAAmB,OAAA,CAAAN,eAAA,CAAAC,WAAA,CAAAG,CAAC,EACgB,CAACA,CAA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,CAAAQ,KAAK,EACYZ,WAAW,EAAE;IAAEW,WAAW,EAAEZ;EAAC,CAAE,CAAC,EACtCE,YAAY,CAAC,CACzB,CACH;AACR"}
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.LiveSendgrid = LiveSendgrid;
|
|
7
7
|
exports.isTestAddress = isTestAddress;
|
|
8
8
|
exports.renderMessage = renderMessage;
|
|
9
|
-
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/
|
|
9
|
+
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/ConfigSecret"));
|
|
10
10
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
11
|
-
var tsplus_module_3 = _interopRequireWildcard(require("@effect/
|
|
12
|
-
var tsplus_module_4 = _interopRequireWildcard(require("@effect
|
|
13
|
-
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/core/
|
|
11
|
+
var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Layer"));
|
|
12
|
+
var tsplus_module_4 = _interopRequireWildcard(require("@effect/data/Equivalence"));
|
|
13
|
+
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/core/_ext/ord.ext"));
|
|
14
|
+
var tsplus_module_6 = _interopRequireWildcard(require("@effect-app/core/Array"));
|
|
14
15
|
var _mail = _interopRequireDefault(require("@sendgrid/mail"));
|
|
15
16
|
var _util = require("util");
|
|
16
17
|
var _service = require("./service.cjs");
|
|
@@ -39,7 +40,7 @@ const makeLiveSendgrid = ({
|
|
|
39
40
|
...renderedMsg_,
|
|
40
41
|
subject: `${subjectPrefix}${renderedMsg_.subject}`
|
|
41
42
|
};
|
|
42
|
-
yield* $(tsplus_module_2.
|
|
43
|
+
yield* $(tsplus_module_2.annotateLogs(tsplus_module_2.logDebug("Sending email"), "msg", (0, _util.inspect)(renderedMsg, false, 5)));
|
|
43
44
|
const ret = yield* $(tsplus_module_2.async(cb => void _mail.default.send(renderedMsg, false, (err, result) => err ? cb(tsplus_module_2.fail(err)) : cb(tsplus_module_2.sync(() => result)))));
|
|
44
45
|
// const event = {
|
|
45
46
|
// name: "EmailSent",
|
|
@@ -47,7 +48,7 @@ const makeLiveSendgrid = ({
|
|
|
47
48
|
// templateId: msg.templateId
|
|
48
49
|
// }
|
|
49
50
|
// }
|
|
50
|
-
// yield* $(Effect.logDebug("Tracking email event").
|
|
51
|
+
// yield* $(Effect.logDebug("Tracking email event").annotateLogs("event", event.$$.pretty))
|
|
51
52
|
// const { trackEvent } = yield* $(AiContextService)
|
|
52
53
|
// trackEvent(event)
|
|
53
54
|
return ret;
|
|
@@ -59,7 +60,7 @@ const makeLiveSendgrid = ({
|
|
|
59
60
|
* @tsplus static Emailer.Ops LiveSendgrid
|
|
60
61
|
*/
|
|
61
62
|
function LiveSendgrid(config) {
|
|
62
|
-
return
|
|
63
|
+
return tsplus_module_3.effect(_service.Emailer)(tsplus_module_2.flatMap(tsplus_module_2.config(config), makeLiveSendgrid));
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
65
66
|
* @hidden
|
|
@@ -91,11 +92,11 @@ function renderFake(addr, makeId) {
|
|
|
91
92
|
email: `test+${makeId()}@nomizz.com`
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
|
-
const eq =
|
|
95
|
+
const eq = tsplus_module_4.mapInput(to => typeof to === "string" ? to.toLowerCase() : to.email.toLowerCase())(tsplus_module_4.string);
|
|
95
96
|
// TODO: should just not add any already added email address
|
|
96
97
|
// https://stackoverflow.com/a/53603076/11595834
|
|
97
98
|
function renderFakeIfTest(addr, makeId) {
|
|
98
|
-
return Array.isArray(addr) ?
|
|
99
|
+
return Array.isArray(addr) ? tsplus_module_6.iterableToArray(tsplus_module_5.uniqArray(eq)(addr.map(x => isTestAddress(x) ? renderFake(x, makeId) : x))) : isTestAddress(addr) ? renderFake(addr, makeId) : addr;
|
|
99
100
|
}
|
|
100
101
|
function renderMailData(md) {
|
|
101
102
|
if (Array.isArray(md)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sendgrid.cjs","names":["_mail","_interopRequireDefault","require","_util","_service","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","makeLiveSendgrid","apiKey","defaultFrom","defaultReplyTo","realMail","subjectPrefix","tsplus_module_2","sync","sgMail","setApiKey","tsplus_module_1","value","sendMail","msg_","gen","$","msg","from","replyTo","undefined","render","renderMessage","renderedMsg_","renderedMsg","subject","
|
|
1
|
+
{"version":3,"file":"Sendgrid.cjs","names":["_mail","_interopRequireDefault","require","_util","_service","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","makeLiveSendgrid","apiKey","defaultFrom","defaultReplyTo","realMail","subjectPrefix","tsplus_module_2","sync","sgMail","setApiKey","tsplus_module_1","value","sendMail","msg_","gen","$","msg","from","replyTo","undefined","render","renderMessage","renderedMsg_","renderedMsg","subject","annotateLogs","logDebug","inspect","ret","async","cb","send","err","result","fail","LiveSendgrid","config","tsplus_module_3","effect","Emailer","flatMap","forceFake","i","makeId","to","renderFake","cc","bcc","renderFakeIfTest","isTestAddress","toLowerCase","endsWith","email","addr","name","renderMailData","eq","tsplus_module_4","mapInput","string","Array","isArray","tsplus_module_6","iterableToArray","tsplus_module_5","uniqArray","map","x","md","join"],"sources":["../../../_src/services/Emailer/Sendgrid.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAsC,SAAAD,uBAAAI,G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|
|
@@ -5,18 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FakeSendgrid = void 0;
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
8
|
+
var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/Layer"));
|
|
8
9
|
var _utils = require("@effect-app/prelude/utils");
|
|
9
10
|
var _service = require("./service.cjs");
|
|
10
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
13
|
const makeFake = tsplus_module_1.map(tsplus_module_1.logDebug("FAKE Emailer Service enabled"), () => ({
|
|
13
14
|
sendMail(msg) {
|
|
14
|
-
return tsplus_module_1.
|
|
15
|
+
return tsplus_module_1.annotateLogs(tsplus_module_1.logDebug(`Fake send mail`), "msg", (0, _utils.pretty)(msg));
|
|
15
16
|
}
|
|
16
17
|
}));
|
|
17
18
|
/**
|
|
18
19
|
* @tsplus static Emailer.Ops Fake
|
|
19
20
|
*/
|
|
20
|
-
const FakeSendgrid =
|
|
21
|
-
exports.FakeSendgrid = FakeSendgrid;
|
|
21
|
+
const FakeSendgrid = exports.FakeSendgrid = tsplus_module_2.effect(_service.Emailer)(makeFake);
|
|
22
22
|
//# sourceMappingURL=fake.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake.cjs","names":["_utils","require","_service","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","makeFake","tsplus_module_1","map","logDebug","sendMail","msg","
|
|
1
|
+
{"version":3,"file":"fake.cjs","names":["_utils","require","_service","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","makeFake","tsplus_module_1","map","logDebug","sendMail","msg","annotateLogs","pretty","FakeSendgrid","exports","tsplus_module_2","effect","Emailer"],"sources":["../../../_src/services/Emailer/fake.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAsC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAA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|
|
17
17
|
var tsplus_module_11 = _interopRequireWildcard(require("@effect/data/Duration"));
|
|
18
18
|
var tsplus_module_12 = _interopRequireWildcard(require("@effect/io/Schedule"));
|
|
19
|
-
var tsplus_module_13 = _interopRequireWildcard(require("@effect
|
|
20
|
-
var tsplus_module_14 = _interopRequireWildcard(require("@effect/io/Layer"));
|
|
19
|
+
var tsplus_module_13 = _interopRequireWildcard(require("@effect/io/Layer"));
|
|
21
20
|
var _reportError = require("@effect-app/infra/api/reportError");
|
|
22
21
|
var _errorReporter = require("@effect-app/infra/errorReporter");
|
|
23
22
|
var _Operations = require("@effect-app/prelude/Operations");
|
|
@@ -75,14 +74,14 @@ const make = tsplus_module_1.sync(() => {
|
|
|
75
74
|
}
|
|
76
75
|
return {
|
|
77
76
|
cleanup,
|
|
78
|
-
register: tsplus_module_1.tap(makeOp, id => tsplus_module_1.zipRight(tsplus_module_1.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))(tsplus_module_10.
|
|
77
|
+
register: tsplus_module_1.tap(makeOp, id => tsplus_module_1.zipRight(tsplus_module_1.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))(tsplus_module_10.annotateLogscoped("operationId", id))),
|
|
79
78
|
find: findOp,
|
|
80
79
|
update
|
|
81
80
|
};
|
|
82
81
|
});
|
|
83
82
|
const cleanupLoop = tsplus_module_1.forkScoped(tsplus_module_1.schedule(tsplus_module_1.flatMap(tsplus_module_1.exit(_service.Operations.flatMap(_ => _.cleanup)), _ => {
|
|
84
83
|
if (tsplus_module_6.isSuccess(_)) {
|
|
85
|
-
return
|
|
84
|
+
return tsplus_module_1.unit;
|
|
86
85
|
} else {
|
|
87
86
|
return reportAppError(_.cause);
|
|
88
87
|
}
|
|
@@ -90,6 +89,5 @@ const cleanupLoop = tsplus_module_1.forkScoped(tsplus_module_1.schedule(tsplus_m
|
|
|
90
89
|
/**
|
|
91
90
|
* @tsplus static Operations.Ops Live
|
|
92
91
|
*/
|
|
93
|
-
const Live =
|
|
94
|
-
exports.Live = Live;
|
|
92
|
+
const Live = exports.Live = tsplus_module_13.provideMerge(tsplus_module_13.scopedDiscard(cleanupLoop))(tsplus_module_13.effect(_service.Operations)(make));
|
|
95
93
|
//# sourceMappingURL=live.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.cjs","names":["_reportError","require","_errorReporter","_Operations","_service","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","reportAppError","reportError","cause","RequestException","make","tsplus_module_1","sync","ops","Map","makeOp","OperationId","cleanup","before","tsplus_module_2","DateSubHours","Date","tsplus_module_5","forEach","tsplus_module_4","ext_itToChunk","entries","id","op","lastChanged","tsplus_module_3","getOrElse","fromNullable","updatedAt","createdAt","delete","addOp","Operation","findOp","finishOp","exit","flatMap","_","isNone","Error","value","result","tsplus_module_6","isSuccess","Success","Failure","message","tsplus_module_7","isInterrupted","tsplus_module_8","LongString","isDie","tsplus_module_9","getOrUndefined","failureOption","Guard","some","none","update","progress","register","tap","zipRight","acquireRelease","tsplus_module_10","
|
|
1
|
+
{"version":3,"file":"live.cjs","names":["_reportError","require","_errorReporter","_Operations","_service","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","reportAppError","reportError","cause","RequestException","make","tsplus_module_1","sync","ops","Map","makeOp","OperationId","cleanup","before","tsplus_module_2","DateSubHours","Date","tsplus_module_5","forEach","tsplus_module_4","ext_itToChunk","entries","id","op","lastChanged","tsplus_module_3","getOrElse","fromNullable","updatedAt","createdAt","delete","addOp","Operation","findOp","finishOp","exit","flatMap","_","isNone","Error","value","result","tsplus_module_6","isSuccess","Success","Failure","message","tsplus_module_7","isInterrupted","tsplus_module_8","LongString","isDie","tsplus_module_9","getOrUndefined","failureOption","Guard","some","none","update","progress","register","tap","zipRight","acquireRelease","tsplus_module_10","annotateLogscoped","find","cleanupLoop","forkScoped","schedule","Operations","unit","tsplus_module_12","fixed","tsplus_module_11","minutes","Live","exports","tsplus_module_13","provideMerge","scopedDiscard","effect"],"sources":["../../../_src/services/Operations/live.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAyC,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA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hByB,CAAC,IAAI;EACb,IAAIK,eAAA,CAAAC,SAAA,CAAAN,CAAC,CAAY,EAAE;IACjB,OAAA/B,eAAA,CAAAiE,IAAA;GACD,MAAM;IACL,OAAOtE,cAAc,CAACoC,CAAC,CAAClC,KAAK,CAAC;;AAElC,CAAC,CAAC,EACQqE,gBAAA,CAAAC,KAAA,CAAeC,gBAAA,CAAAC,OAAA,CAAiB,CAAC,CAAC,CAAC,CAAC,CACnC;AAEb;;;AAGO,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAAE,gBAAA,CAAAC,YAAA,CAAAD,gBAAA,CAAAE,aAAA,CACbb,WAAW,GADKW,gBAAA,CAAAG,MAAA,CAAaX,mBAAU,EAAvBjE,IAAI,CAAoB,CAEnB"}
|
|
@@ -10,12 +10,10 @@ exports.forkOperationWithEffect = forkOperationWithEffect;
|
|
|
10
10
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/prelude/service"));
|
|
11
11
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/infra/api/reportError"));
|
|
12
12
|
var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
13
|
-
var tsplus_module_4 = _interopRequireWildcard(require("@effect/data/Debug"));
|
|
14
13
|
var Scope = _interopRequireWildcard(require("@effect/io/Scope"));
|
|
15
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
const forkOperation = forkOperation_1;
|
|
18
|
-
exports.forkOperation = forkOperation;
|
|
16
|
+
const forkOperation = exports.forkOperation = forkOperation_1;
|
|
19
17
|
/**
|
|
20
18
|
* @tsplus type Operations
|
|
21
19
|
* @tsplus companion Operations.Ops
|
|
@@ -26,24 +24,24 @@ class Operations extends tsplus_module_1.TagClass() {}
|
|
|
26
24
|
*/
|
|
27
25
|
exports.Operations = Operations;
|
|
28
26
|
function forkOperation_1(self) {
|
|
29
|
-
return
|
|
27
|
+
return Operations.flatMap(Operations => tsplus_module_3.flatMap(Scope.make(), scope => tsplus_module_3.tap(Scope.extend(Operations.register, scope), () => tsplus_module_2.forkDaemonReportRequestUnexpected(Scope.use(self, scope)))));
|
|
30
28
|
}
|
|
31
29
|
/**
|
|
32
30
|
* @tsplus getter function forkOperation
|
|
33
31
|
*/
|
|
34
32
|
function forkOperationFunction(fnc) {
|
|
35
|
-
return inp =>
|
|
33
|
+
return inp => forkOperation_1(fnc(inp));
|
|
36
34
|
}
|
|
37
35
|
/**
|
|
38
36
|
* @tsplus static effect/io/Effect.Ops forkOperation
|
|
39
37
|
*/
|
|
40
38
|
function forkOperation2(self) {
|
|
41
|
-
return
|
|
39
|
+
return Operations.flatMap(Operations => tsplus_module_3.flatMap(Scope.make(), scope => tsplus_module_3.tap(Scope.extend(Operations.register, scope), id => tsplus_module_2.forkDaemonReportRequestUnexpected(Scope.use(self(id), scope)))));
|
|
42
40
|
}
|
|
43
41
|
/**
|
|
44
42
|
* @tsplus static effect/io/Effect.Ops forkOperationWithEffect
|
|
45
43
|
*/
|
|
46
44
|
function forkOperationWithEffect(self, fnc) {
|
|
47
|
-
return
|
|
45
|
+
return Operations.flatMap(Operations => tsplus_module_3.flatMap(Scope.make(), scope => tsplus_module_3.tap(tsplus_module_3.tap(Scope.extend(Operations.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))));
|
|
48
46
|
}
|
|
49
47
|
//# sourceMappingURL=service.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.cjs","names":["Scope","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","forkOperation","
|
|
1
|
+
{"version":3,"file":"service.cjs","names":["Scope","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","forkOperation","exports","forkOperation_1","Operations","tsplus_module_1","TagClass","self","flatMap","tsplus_module_3","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;AAAyC,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAA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AAiB,aAAA,CA0EUP,GAAG,CAACK,IAAI,CAAC,IAAiCb,KAAK,CAAC,CAAC,CACnE,CACN;AACH"}
|
|
@@ -43,11 +43,13 @@ exports.reportQueueError = reportQueueError;
|
|
|
43
43
|
function forkDaemonReportQueue(self) {
|
|
44
44
|
return tsplus_module_1.daemonChildren(tsplus_module_1.fork(tsplus_module_1.tapErrorCause(self, reportNonInterruptedFailureCause({}))));
|
|
45
45
|
}
|
|
46
|
-
const reportFatalQueueError = (0, _errorReporter.reportError)(cause => new FatalQueueException(cause));
|
|
47
|
-
exports.reportFatalQueueError = reportFatalQueueError;
|
|
46
|
+
const reportFatalQueueError = exports.reportFatalQueueError = (0, _errorReporter.reportError)(cause => new FatalQueueException(cause));
|
|
48
47
|
function reportNonInterruptedFailure(context) {
|
|
49
48
|
const report = reportNonInterruptedFailureCause(context);
|
|
50
|
-
return inp => tsplus_module_1.flatMap(tsplus_module_1.exit(inp), result => tsplus_module_2.match(result,
|
|
49
|
+
return inp => tsplus_module_1.flatMap(tsplus_module_1.exit(inp), result => tsplus_module_2.match(result, {
|
|
50
|
+
onFailure: cause => tsplus_module_1.map(report(cause), () => result),
|
|
51
|
+
onSuccess: () => tsplus_module_1.sync(() => result)
|
|
52
|
+
}));
|
|
51
53
|
}
|
|
52
54
|
function reportNonInterruptedFailureCause(context) {
|
|
53
55
|
return cause => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","names":["_errorReporter","require","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","MessageException","CauseException","constructor","cause","exports","FatalQueueException","reportQueueError_","reportError","reportQueueError","extras","forkDaemonReportQueue","self","tsplus_module_1","daemonChildren","fork","tapErrorCause","reportNonInterruptedFailureCause","reportFatalQueueError","reportNonInterruptedFailure","context","report","inp","flatMap","exit","result","tsplus_module_2","match","map","sync","tsplus_module_3","isInterrupted","failCause"],"sources":["../../../_src/services/QueueMaker/errors.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAyD,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAEnD,MAAOW,gBAAoB,SAAQC,sBAAiB;EACxDC,YAAYC,KAAe;IACzB,KAAK,CAACA,KAAK,EAAE,SAAS,CAAC;EACzB;;AACDC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA;AAEK,MAAOK,mBAAuB,SAAQJ,sBAAiB;EAC3DC,YAAYC,KAAe;IACzB,KAAK,CAACA,KAAK,EAAE,YAAY,CAAC;EAC5B;;AACDC,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAED,MAAMC,iBAAiB,GAAG,IAAAC,0BAAW,EAAEJ,KAAK,IAAK,IAAIH,gBAAgB,CAACG,KAAK,CAAC,CAAC;AAEtE,MAAMK,gBAAgB,GAAGA,CAAIL,KAAe,EAAEM,MAA4C,KAC/FH,iBAAiB,CAACH,KAAK,EAAEM,MAAM,CAAC;AAElC;;;;;;;;;AAAAL,OAAA,CAAAI,gBAAA,GAAAA,gBAAA;AASM,SAAUE,qBAAqBA,CAAUC,IAAqB;EAClE,OAAAC,eAAA,CAAAC,cAAA,CAAAD,eAAA,CAAAE,IAAA,CAAOF,eAAA,CAAAG,aAAA,CAAAJ,IAAI,EAAeK,gCAAgC,CAAC,EAAE,CAAC,CAAC;AACjE;AAEO,MAAMC,qBAAqB,GAAG,IAAAV,0BAAW,EAC7CJ,KAAK,IAAK,IAAIE,mBAAmB,CAACF,KAAK,CAAC,CAC1C;
|
|
1
|
+
{"version":3,"file":"errors.cjs","names":["_errorReporter","require","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","MessageException","CauseException","constructor","cause","exports","FatalQueueException","reportQueueError_","reportError","reportQueueError","extras","forkDaemonReportQueue","self","tsplus_module_1","daemonChildren","fork","tapErrorCause","reportNonInterruptedFailureCause","reportFatalQueueError","reportNonInterruptedFailure","context","report","inp","flatMap","exit","result","tsplus_module_2","match","onFailure","map","onSuccess","sync","tsplus_module_3","isInterrupted","failCause"],"sources":["../../../_src/services/QueueMaker/errors.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAyD,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAI,wBAAAC,GAAA,EAAAL,WAAA,SAAAA,WAAA,IAAAK,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAA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M,EACJ;IAAEG,SAAS,EAAGxB,KAAK,IAAKS,eAAA,CAAAgB,GAAA,CAAAR,MAAM,CAACjB,KAAK,CAAC,EAAK,MAAMqB,MAAM,CAAC;IAAEK,SAAS,EAAEA,CAAA,KAAMjB,eAAA,CAAAkB,IAAA,OAAON,MAAM;EAAC,CAAE,CAC3F,CACF;AACP;AAEM,SAAUR,gCAAgCA,CAACG,OAAiC;EAChF,OAAWhB,KAAe,IAAgC;IACxD,IAAI4B,eAAA,CAAAC,aAAA,CAAA7B,KAAK,CAAgB,EAAE;MACzB,OAAAS,eAAA,CAAAqB,SAAA,CAAQ9B,KAAsB;;IAEhC,OAAOK,gBAAgB,CAACL,KAAK,EAAEgB,OAAO,CAAC;EACzC,CAAC;AACH"}
|
|
@@ -8,9 +8,8 @@ var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/_ext/Iterable"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/infra/services/QueueMaker/errors"));
|
|
10
10
|
var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
|
|
11
|
-
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/prelude/
|
|
12
|
-
var tsplus_module_6 = _interopRequireWildcard(require("@effect
|
|
13
|
-
var tsplus_module_7 = _interopRequireWildcard(require("@effect/io/Fiber"));
|
|
11
|
+
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
|
|
12
|
+
var tsplus_module_6 = _interopRequireWildcard(require("@effect/io/Fiber"));
|
|
14
13
|
var _memQueue = require("@effect-app/infra-adapters/memQueue");
|
|
15
14
|
var _RequestContext = require("@effect-app/infra/RequestContext");
|
|
16
15
|
var _ids = require("@effect-app/prelude/ids");
|
|
@@ -52,12 +51,12 @@ function makeMemQueue(queueName, queueDrainName, encoder, makeHandleEvent, provi
|
|
|
52
51
|
}) => provideContext(_RequestContext.RequestContext.inherit(meta, {
|
|
53
52
|
id: (0, _ids.RequestId)(body.id),
|
|
54
53
|
locale: "en",
|
|
55
|
-
name:
|
|
56
|
-
}))(silenceAndReportError(tsplus_module_1.zipRight(tsplus_module_1.tap(
|
|
54
|
+
name: tsplus_module_5.ReasonableString(body._tag)
|
|
55
|
+
}))(silenceAndReportError(tsplus_module_1.zipRight(tsplus_module_1.tap(tsplus_module_1.annotateLogs({
|
|
57
56
|
body: tsplus_module_4.RecordPretty(tsplus_module_4.object$(body)),
|
|
58
57
|
meta: tsplus_module_4.RecordPretty(tsplus_module_4.object$(meta))
|
|
59
58
|
})(tsplus_module_1.logDebug(`$$ [${queueDrainName}] Processing incoming message`)), () => _Memory.restoreFromRequestContext), handleEvent(body)))));
|
|
60
|
-
return yield* $(tsplus_module_1.forkScoped(tsplus_module_1.forever(silenceAndReportError(tsplus_module_1.flatMap(qDrain.take(), x => tsplus_module_1.flatMap(tsplus_module_1.fork(tsplus_module_1.uninterruptible(processMessage(x))), _ =>
|
|
59
|
+
return yield* $(tsplus_module_1.forkScoped(tsplus_module_1.forever(silenceAndReportError(tsplus_module_1.flatMap(qDrain.take(), x => tsplus_module_1.flatMap(tsplus_module_1.fork(tsplus_module_1.uninterruptible(processMessage(x))), _ => tsplus_module_6.join(_)))
|
|
61
60
|
// TODO: normally a failed item would be returned to the queue and retried up to X times.
|
|
62
61
|
// .flatMap(_ => _._tag === "Failure" && !isInterrupted ? qDrain.offer(x) : Effect.unit) // TODO: retry count tracking and max retries.
|
|
63
62
|
))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memQueue.cjs","names":["_memQueue","require","_RequestContext","_ids","_RequestContextContainer","_Memory","_errors2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","makeMemQueue","queueName","queueDrainName","encoder","makeHandleEvent","provideContext","parseDrain","tsplus_module_1","gen","$","mem","MemQueue","q","getOrCreateQueue","qDrain","publish","messages","requestContext","RequestContextContainer","tsplus_module_3","forkDaemonReportQueue","tsplus_module_2","ext_forEach","m","asUnit","flatMap","sync","JSON","stringify","body","meta","_","offer","drain","handleEvent","silenceAndReportError","reportNonInterruptedFailure","name","processMessage","msg","orDie","parse","RequestContext","inherit","id","RequestId","locale","
|
|
1
|
+
{"version":3,"file":"memQueue.cjs","names":["_memQueue","require","_RequestContext","_ids","_RequestContextContainer","_Memory","_errors2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","makeMemQueue","queueName","queueDrainName","encoder","makeHandleEvent","provideContext","parseDrain","tsplus_module_1","gen","$","mem","MemQueue","q","getOrCreateQueue","qDrain","publish","messages","requestContext","RequestContextContainer","tsplus_module_3","forkDaemonReportQueue","tsplus_module_2","ext_forEach","m","asUnit","flatMap","sync","JSON","stringify","body","meta","_","offer","drain","handleEvent","silenceAndReportError","reportNonInterruptedFailure","name","processMessage","msg","orDie","parse","RequestContext","inherit","id","RequestId","locale","tsplus_module_5","ReasonableString","_tag","zipRight","tap","annotateLogs","tsplus_module_4","RecordPretty","object$","logDebug","restoreFromRequestContext","forkScoped","forever","take","x","fork","uninterruptible","tsplus_module_6","join"],"sources":["../../../_src/services/QueueMaker/memQueue.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEA,IAAAG,wBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAyD,SAAAM,yBAAAC,WAAA,e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