@effect-app/infra 0.84.0 → 0.85.0-next.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 +11 -0
- package/_cjs/_ext/Array.cjs +3 -2
- package/_cjs/_ext/Array.cjs.map +1 -1
- package/_cjs/api/defaultErrorHandler.cjs +11 -10
- package/_cjs/api/defaultErrorHandler.cjs.map +1 -1
- package/_cjs/api/express/makeJsonSchema.cjs +3 -2
- package/_cjs/api/express/makeJsonSchema.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/makeOpenApiSpecs.cjs +6 -4
- package/_cjs/api/express/makeOpenApiSpecs.cjs.map +1 -1
- package/_cjs/api/express/schema/requestHandler.cjs +25 -23
- package/_cjs/api/express/schema/requestHandler.cjs.map +1 -1
- package/_cjs/api/express/schema/routing.cjs +22 -20
- package/_cjs/api/express/schema/routing.cjs.map +1 -1
- package/_cjs/api/reportError.cjs +2 -2
- package/_cjs/api/routing.cjs +56 -53
- package/_cjs/api/routing.cjs.map +1 -1
- package/_cjs/api/setupRequest.cjs +3 -2
- package/_cjs/api/setupRequest.cjs.map +1 -1
- package/_cjs/api/writeDocs.cjs +6 -4
- package/_cjs/api/writeDocs.cjs.map +1 -1
- package/_cjs/errorReporter.cjs +12 -11
- package/_cjs/errorReporter.cjs.map +1 -1
- package/_cjs/errors.cjs +8 -8
- package/_cjs/errors.cjs.map +1 -1
- package/_cjs/instrument.cjs +2 -1
- package/_cjs/instrument.cjs.map +1 -1
- package/_cjs/logger/jsonLogger.cjs +11 -10
- package/_cjs/logger/jsonLogger.cjs.map +1 -1
- package/_cjs/logger/logFmtLogger.cjs +5 -5
- package/_cjs/logger/logFmtLogger.cjs.map +1 -1
- package/_cjs/logger/shared.cjs +4 -4
- package/_cjs/logger/shared.cjs.map +1 -1
- package/_cjs/rateLimit.cjs +8 -7
- package/_cjs/rateLimit.cjs.map +1 -1
- package/_cjs/services/Emailer/Sendgrid.cjs +14 -12
- package/_cjs/services/Emailer/Sendgrid.cjs.map +1 -1
- package/_cjs/services/Emailer/fake.cjs +5 -4
- package/_cjs/services/Emailer/fake.cjs.map +1 -1
- package/_cjs/services/Operations/live.cjs +31 -29
- package/_cjs/services/Operations/live.cjs.map +1 -1
- package/_cjs/services/Operations/service.cjs +6 -5
- package/_cjs/services/Operations/service.cjs.map +1 -1
- package/_cjs/services/QueueMaker/errors.cjs +7 -6
- package/_cjs/services/QueueMaker/errors.cjs.map +1 -1
- package/_cjs/services/QueueMaker/memQueue.cjs +18 -17
- package/_cjs/services/QueueMaker/memQueue.cjs.map +1 -1
- package/_cjs/services/QueueMaker/sbqueue.cjs +16 -15
- package/_cjs/services/QueueMaker/sbqueue.cjs.map +1 -1
- package/_cjs/services/Repository.cjs +17 -16
- package/_cjs/services/Repository.cjs.map +1 -1
- package/_cjs/services/RepositoryBase.cjs +35 -33
- package/_cjs/services/RepositoryBase.cjs.map +1 -1
- package/_cjs/services/RequestContextContainer.cjs +12 -10
- package/_cjs/services/RequestContextContainer.cjs.map +1 -1
- package/_cjs/services/Store/Cosmos.cjs +49 -46
- package/_cjs/services/Store/Cosmos.cjs.map +1 -1
- package/_cjs/services/Store/Disk.cjs +19 -18
- package/_cjs/services/Store/Disk.cjs.map +1 -1
- package/_cjs/services/Store/Memory.cjs +43 -39
- package/_cjs/services/Store/Memory.cjs.map +1 -1
- package/_cjs/services/Store/Redis.cjs +16 -14
- package/_cjs/services/Store/Redis.cjs.map +1 -1
- package/_cjs/services/Store/codeFilter.test.cjs +1 -1
- package/_cjs/services/Store/index.cjs +7 -6
- package/_cjs/services/Store/index.cjs.map +1 -1
- package/_cjs/services/Store/service.cjs +1 -1
- package/_cjs/services/Store/service.cjs.map +1 -1
- package/_cjs/services/Store/utils.cjs +13 -13
- package/_cjs/services/Store/utils.cjs.map +1 -1
- package/_cjs/services/simpledb/cosmosdb.cjs +19 -17
- package/_cjs/services/simpledb/cosmosdb.cjs.map +1 -1
- package/_cjs/services/simpledb/diskdb.cjs +9 -8
- package/_cjs/services/simpledb/diskdb.cjs.map +1 -1
- package/_cjs/services/simpledb/memdb.cjs +11 -9
- package/_cjs/services/simpledb/memdb.cjs.map +1 -1
- package/_cjs/services/simpledb/mongodb.cjs +20 -18
- package/_cjs/services/simpledb/mongodb.cjs.map +1 -1
- package/_cjs/services/simpledb/redisdb.cjs +11 -10
- package/_cjs/services/simpledb/redisdb.cjs.map +1 -1
- package/_cjs/services/simpledb/shared.cjs +5 -5
- package/_cjs/services/simpledb/shared.cjs.map +1 -1
- package/_cjs/services/simpledb/simpledb.cjs +18 -17
- package/_cjs/services/simpledb/simpledb.cjs.map +1 -1
- package/_src/api/authorization.jwt.ts +1 -1
- package/_src/api/defaultErrorHandler.ts +2 -2
- package/_src/api/express/routing.ts.bak +8 -8
- package/_src/api/express/schema/requestHandler.ts +12 -12
- package/_src/api/express/schema/routing.ts +11 -11
- package/_src/api/routing.ts +14 -13
- package/_src/errorReporter.ts +1 -1
- package/_src/services/Emailer/Sendgrid.ts +1 -1
- package/_src/services/Operations/live.ts +5 -5
- package/_src/services/QueueMaker/errors.ts +1 -1
- package/_src/services/QueueMaker/memQueue.ts +2 -2
- package/_src/services/QueueMaker/sbqueue.ts +1 -1
- package/_src/services/Repository.ts +9 -9
- package/_src/services/RepositoryBase.ts +8 -6
- package/_src/services/RequestContextContainer.ts +1 -1
- package/_src/services/Store/Cosmos.ts +17 -12
- package/_src/services/Store/Disk.ts +4 -4
- package/_src/services/Store/Memory.ts +4 -4
- package/_src/services/Store/Redis.ts +1 -1
- package/_src/services/Store/index.test.ts.bak +5 -5
- package/_src/services/Store/index.ts +1 -1
- package/_src/services/Store/utils.ts +16 -16
- package/_src/services/simpledb/diskdb.ts +1 -1
- package/_src/services/simpledb/memdb.ts +1 -1
- package/_src/services/simpledb/redisdb.ts +1 -1
- package/_src/services/simpledb/shared.ts +1 -1
- package/_src/services/simpledb/simpledb.ts +3 -3
- package/dist/RequestContext.d.ts +20 -20
- package/dist/_ext/Array.d.ts +1 -1
- package/dist/_ext/Array.d.ts.map +1 -1
- package/dist/_ext/Array.js +4 -3
- package/dist/api/codec.d.ts +1 -1
- package/dist/api/codec.d.ts.map +1 -1
- package/dist/api/defaultErrorHandler.d.ts +2 -2
- package/dist/api/defaultErrorHandler.d.ts.map +1 -1
- package/dist/api/defaultErrorHandler.js +13 -11
- package/dist/api/express/makeJsonSchema.d.ts +2 -2
- package/dist/api/express/makeJsonSchema.d.ts.map +1 -1
- package/dist/api/express/makeJsonSchema.js +4 -3
- package/dist/api/express/makeOpenApiSpecs.d.ts +1 -1
- package/dist/api/express/makeOpenApiSpecs.js +7 -5
- package/dist/api/express/schema/requestHandler.d.ts +8 -8
- package/dist/api/express/schema/requestHandler.d.ts.map +1 -1
- package/dist/api/express/schema/requestHandler.js +36 -34
- package/dist/api/express/schema/routing.d.ts +2 -2
- package/dist/api/express/schema/routing.js +23 -21
- package/dist/api/reportError.d.ts +5 -5
- package/dist/api/reportError.d.ts.map +1 -1
- package/dist/api/reportError.js +2 -2
- package/dist/api/routing.d.ts +6 -6
- package/dist/api/routing.d.ts.map +1 -1
- package/dist/api/routing.js +60 -57
- package/dist/api/setupRequest.d.ts +2 -2
- package/dist/api/setupRequest.d.ts.map +1 -1
- package/dist/api/setupRequest.js +4 -3
- package/dist/api/writeDocs.d.ts +1 -1
- package/dist/api/writeDocs.d.ts.map +1 -1
- package/dist/api/writeDocs.js +7 -5
- package/dist/errorReporter.d.ts +3 -3
- package/dist/errorReporter.d.ts.map +1 -1
- package/dist/errorReporter.js +13 -12
- package/dist/errors.d.ts +7 -7
- package/dist/errors.js +9 -9
- package/dist/instrument.d.ts +1 -1
- package/dist/instrument.d.ts.map +1 -1
- package/dist/instrument.js +3 -2
- package/dist/logger/jsonLogger.d.ts +2 -2
- package/dist/logger/jsonLogger.d.ts.map +1 -1
- package/dist/logger/jsonLogger.js +12 -11
- package/dist/logger/logFmtLogger.d.ts +2 -2
- package/dist/logger/logFmtLogger.d.ts.map +1 -1
- package/dist/logger/logFmtLogger.js +6 -6
- package/dist/logger/shared.d.ts +1 -1
- package/dist/logger/shared.d.ts.map +1 -1
- package/dist/logger/shared.js +5 -5
- package/dist/rateLimit.d.ts +3 -3
- package/dist/rateLimit.d.ts.map +1 -1
- package/dist/rateLimit.js +9 -8
- 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 +17 -15
- package/dist/services/Emailer/fake.d.ts +1 -1
- package/dist/services/Emailer/fake.d.ts.map +1 -1
- package/dist/services/Emailer/fake.js +6 -5
- package/dist/services/Emailer/service.d.ts +4 -4
- package/dist/services/Operations/live.d.ts +1 -1
- package/dist/services/Operations/live.d.ts.map +1 -1
- package/dist/services/Operations/live.js +39 -37
- package/dist/services/Operations/service.d.ts +9 -9
- package/dist/services/Operations/service.d.ts.map +1 -1
- package/dist/services/Operations/service.js +13 -12
- package/dist/services/QueueMaker/errors.d.ts +3 -3
- package/dist/services/QueueMaker/errors.d.ts.map +1 -1
- package/dist/services/QueueMaker/errors.js +7 -6
- package/dist/services/QueueMaker/memQueue.d.ts +3 -3
- package/dist/services/QueueMaker/memQueue.js +17 -16
- package/dist/services/QueueMaker/sbqueue.d.ts +4 -4
- package/dist/services/QueueMaker/sbqueue.d.ts.map +1 -1
- package/dist/services/QueueMaker/sbqueue.js +16 -15
- package/dist/services/Repository.d.ts +31 -31
- package/dist/services/Repository.d.ts.map +1 -1
- package/dist/services/Repository.js +18 -17
- package/dist/services/RepositoryBase.d.ts +14 -15
- package/dist/services/RepositoryBase.d.ts.map +1 -1
- package/dist/services/RepositoryBase.js +37 -35
- package/dist/services/RequestContextContainer.d.ts +9 -9
- package/dist/services/RequestContextContainer.d.ts.map +1 -1
- package/dist/services/RequestContextContainer.js +15 -13
- package/dist/services/Store/Cosmos.d.ts +3 -3
- package/dist/services/Store/Cosmos.d.ts.map +1 -1
- package/dist/services/Store/Cosmos.js +54 -51
- package/dist/services/Store/Disk.d.ts +3 -3
- package/dist/services/Store/Disk.d.ts.map +1 -1
- package/dist/services/Store/Disk.js +20 -19
- package/dist/services/Store/Memory.d.ts +5 -5
- package/dist/services/Store/Memory.d.ts.map +1 -1
- package/dist/services/Store/Memory.js +45 -41
- package/dist/services/Store/Redis.d.ts +3 -3
- package/dist/services/Store/Redis.d.ts.map +1 -1
- package/dist/services/Store/Redis.js +17 -15
- 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 +8 -7
- package/dist/services/Store/service.d.ts +10 -10
- package/dist/services/Store/service.d.ts.map +1 -1
- package/dist/services/Store/service.js +2 -2
- package/dist/services/Store/utils.d.ts +3 -3
- package/dist/services/Store/utils.d.ts.map +1 -1
- package/dist/services/Store/utils.js +21 -21
- package/dist/services/simpledb/cosmosdb.d.ts +5 -5
- package/dist/services/simpledb/cosmosdb.js +19 -17
- package/dist/services/simpledb/diskdb.d.ts +4 -4
- package/dist/services/simpledb/diskdb.js +10 -9
- package/dist/services/simpledb/memdb.d.ts +4 -4
- package/dist/services/simpledb/memdb.js +13 -11
- package/dist/services/simpledb/mongodb.d.ts +5 -5
- package/dist/services/simpledb/mongodb.js +16 -14
- package/dist/services/simpledb/redisdb.d.ts +10 -10
- package/dist/services/simpledb/redisdb.js +12 -11
- package/dist/services/simpledb/shared.d.ts +13 -13
- package/dist/services/simpledb/shared.js +6 -6
- package/dist/services/simpledb/simpledb.d.ts +7 -7
- package/dist/services/simpledb/simpledb.d.ts.map +1 -1
- package/dist/services/simpledb/simpledb.js +16 -15
- package/package.json +5 -5
|
@@ -4,16 +4,17 @@ 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/FiberId"));
|
|
8
|
-
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/
|
|
7
|
+
var tsplus_module_1 = _interopRequireWildcard(require("effect/FiberId.impl"));
|
|
8
|
+
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/core/OptionX"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("effect/Cause"));
|
|
10
|
-
var tsplus_module_4 = _interopRequireWildcard(require("effect/
|
|
11
|
-
var tsplus_module_5 = _interopRequireWildcard(require("effect/
|
|
12
|
-
var tsplus_module_6 = _interopRequireWildcard(require("effect/
|
|
10
|
+
var tsplus_module_4 = _interopRequireWildcard(require("effect/Cause.impl"));
|
|
11
|
+
var tsplus_module_5 = _interopRequireWildcard(require("effect/List.impl"));
|
|
12
|
+
var tsplus_module_6 = _interopRequireWildcard(require("effect/HashMap.impl"));
|
|
13
|
+
var tsplus_module_7 = _interopRequireWildcard(require("effect/Logger"));
|
|
13
14
|
var _shared = require("./shared.cjs");
|
|
14
15
|
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); }
|
|
15
16
|
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; }
|
|
16
|
-
const jsonLogger = exports.jsonLogger =
|
|
17
|
+
const jsonLogger = exports.jsonLogger = tsplus_module_7.Logger.make(({
|
|
17
18
|
annotations,
|
|
18
19
|
cause,
|
|
19
20
|
context,
|
|
@@ -31,17 +32,17 @@ const jsonLogger = exports.jsonLogger = tsplus_module_6.make(({
|
|
|
31
32
|
fiber: tsplus_module_1.threadName(fiberId),
|
|
32
33
|
message,
|
|
33
34
|
request: tsplus_module_2.getOrUndefined(c),
|
|
34
|
-
cause: cause != null && cause != tsplus_module_3.empty ?
|
|
35
|
-
spans:
|
|
35
|
+
cause: cause != null && cause != tsplus_module_3.Cause.empty ? tsplus_module_4.pretty(cause) : undefined,
|
|
36
|
+
spans: tsplus_module_5.toReadonlyArray(tsplus_module_5.map(spans, _ => ({
|
|
36
37
|
label: _.label,
|
|
37
38
|
timing: nowMillis - _.startTime
|
|
38
39
|
}))),
|
|
39
|
-
annotations:
|
|
40
|
+
annotations: tsplus_module_6.size(annotations) > 0 ? [...annotations].reduce((prev, [k, v]) => {
|
|
40
41
|
prev[k] = v;
|
|
41
42
|
return prev;
|
|
42
43
|
}, {}) : undefined
|
|
43
44
|
};
|
|
44
45
|
globalThis.console.log(JSON.stringify(data));
|
|
45
46
|
});
|
|
46
|
-
const logJson = exports.logJson =
|
|
47
|
+
const logJson = exports.logJson = tsplus_module_7.Logger.replace(tsplus_module_7.Logger.defaultLogger, jsonLogger);
|
|
47
48
|
//# sourceMappingURL=jsonLogger.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonLogger.cjs","names":["_shared","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","jsonLogger","exports","
|
|
1
|
+
{"version":3,"file":"jsonLogger.cjs","names":["_shared","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","jsonLogger","exports","tsplus_module_7","Logger","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","Cause","empty","tsplus_module_4","pretty","undefined","tsplus_module_5","toReadonlyArray","map","_","timing","startTime","tsplus_module_6","size","reduce","prev","k","v","globalThis","console","log","JSON","stringify","logJson","replace","defaultLogger"],"sources":["../../_src/logger/jsonLogger.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAA+C,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,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CAAC,CAACC,IAAI,EAAE,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAI;MACzCF,IAAI,CAACC,CAAC,CAAC,GAAGC,CAAC;MACX,OAAOF,IAAI;IACb,CAAC,EAAE,EAA6B,CAAC,GAC/BV;GACL;EAEDa,UAAU,CAACC,OAAO,CAACC,GAAG,CAACC,IAAI,CAACC,SAAS,CAAChC,IAAI,CAAC,CAAC;AAC9C,CAAC,CACF;AAEM,MAAMiC,OAAO,GAAAlD,OAAA,CAAAkD,OAAA,GAAGjD,eAAA,CAAAC,MAAM,CAACiD,OAAO,CAAClD,eAAA,CAAAC,MAAM,CAACkD,aAAa,EAAErD,UAAU,CAAC"}
|
|
@@ -4,21 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.logfmtLogger = exports.logFmt = void 0;
|
|
7
|
-
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/core/
|
|
7
|
+
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/core/OptionX"));
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/utils"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("effect/HashMap"));
|
|
10
10
|
var tsplus_module_4 = _interopRequireWildcard(require("effect/Logger"));
|
|
11
11
|
var _shared = require("./shared.cjs");
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
|
-
const logfmtLogger = exports.logfmtLogger = tsplus_module_4.make(_ => {
|
|
14
|
+
const logfmtLogger = exports.logfmtLogger = tsplus_module_4.Logger.make(_ => {
|
|
15
15
|
let {
|
|
16
16
|
annotations
|
|
17
17
|
} = _;
|
|
18
18
|
const c = (0, _shared.getRequestContext)(_.context);
|
|
19
19
|
const requestContext = tsplus_module_1.getOrUndefined(c);
|
|
20
20
|
if (requestContext) {
|
|
21
|
-
annotations = tsplus_module_3.make(...[...annotations, ...tsplus_module_2.RecordEntries(tsplus_module_2.object$({
|
|
21
|
+
annotations = tsplus_module_3.HashMap.make(...[...annotations, ...tsplus_module_2.RecordEntries(tsplus_module_2.object$({
|
|
22
22
|
requestRootId: requestContext.rootId,
|
|
23
23
|
requestId: requestContext.id,
|
|
24
24
|
requestName: requestContext.name,
|
|
@@ -27,8 +27,8 @@ const logfmtLogger = exports.logfmtLogger = tsplus_module_4.make(_ => {
|
|
|
27
27
|
} : {})
|
|
28
28
|
}))]);
|
|
29
29
|
}
|
|
30
|
-
const formatted = tsplus_module_4.logfmtLogger.log(_);
|
|
30
|
+
const formatted = tsplus_module_4.Logger.logfmtLogger.log(_);
|
|
31
31
|
globalThis.console.log(formatted);
|
|
32
32
|
});
|
|
33
|
-
const logFmt = exports.logFmt = tsplus_module_4.replace(tsplus_module_4.defaultLogger, logfmtLogger);
|
|
33
|
+
const logFmt = exports.logFmt = tsplus_module_4.Logger.replace(tsplus_module_4.Logger.defaultLogger, logfmtLogger);
|
|
34
34
|
//# sourceMappingURL=logFmtLogger.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logFmtLogger.cjs","names":["_shared","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","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,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAExC,MAAMY,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,eAAA,CAAAC,
|
|
1
|
+
{"version":3,"file":"logFmtLogger.cjs","names":["_shared","require","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","logfmtLogger","exports","tsplus_module_4","Logger","make","_","annotations","c","getRequestContext","context","requestContext","tsplus_module_1","getOrUndefined","tsplus_module_3","HashMap","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,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAA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G,EAAE;KAC7F,EAES,CACX,CAAC;EACJ;EACA,MAAME,SAAS,GAAGzB,eAAA,CAAAC,MAAM,CAACH,YAAY,CAAC4B,GAAG,CAACvB,CAAC,CAAC;EAC5CwB,UAAU,CAACC,OAAO,CAACF,GAAG,CAACD,SAAS,CAAC;AACnC,CAAC,CACF;AAEM,MAAMI,MAAM,GAAA9B,OAAA,CAAA8B,MAAA,GAAG7B,eAAA,CAAAC,MAAM,CAAC6B,OAAO,CAAC9B,eAAA,CAAAC,MAAM,CAAC8B,aAAa,EAAEjC,YAAY,CAAC"}
|
package/_cjs/logger/shared.cjs
CHANGED
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getRequestContext = getRequestContext;
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("effect/FiberRef"));
|
|
8
|
-
var tsplus_module_2 = _interopRequireWildcard(require("effect/Context"));
|
|
9
|
-
var tsplus_module_3 = _interopRequireWildcard(require("effect/Effect"));
|
|
10
|
-
var tsplus_module_4 = _interopRequireWildcard(require("effect/Option"));
|
|
8
|
+
var tsplus_module_2 = _interopRequireWildcard(require("effect/Context.impl"));
|
|
9
|
+
var tsplus_module_3 = _interopRequireWildcard(require("effect/Effect.impl"));
|
|
10
|
+
var tsplus_module_4 = _interopRequireWildcard(require("effect/Option.impl"));
|
|
11
11
|
var FiberRefs = _interopRequireWildcard(require("effect/FiberRefs"));
|
|
12
12
|
var _RequestContextContainer = require("../services/RequestContextContainer.cjs");
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
15
15
|
function getRequestContext(context) {
|
|
16
|
-
const ctx = FiberRefs.getOrDefault(context, tsplus_module_1.currentContext);
|
|
16
|
+
const ctx = FiberRefs.getOrDefault(context, tsplus_module_1.FiberRef.currentContext);
|
|
17
17
|
// TODO: use `RequestContext.Tag` once switched?
|
|
18
18
|
const a = tsplus_module_2.getOption(ctx, _RequestContextContainer.RequestContextContainer);
|
|
19
19
|
const c = tsplus_module_4.map(a, _ => tsplus_module_3.runSync(_.requestContext));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.cjs","names":["FiberRefs","_interopRequireWildcard","require","_RequestContextContainer","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","getRequestContext","context","ctx","getOrDefault","tsplus_module_1","currentContext","tsplus_module_2","getOption","RequestContextContainer","c","tsplus_module_4","map","_","tsplus_module_3","runSync","requestContext"],"sources":["../../_src/logger/shared.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAAgF,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,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAE1E,SAAUY,iBAAiBA,CAACC,OAA4B;EAC5D,MAAMC,GAAG,GAAG3B,SAAS,CAAC4B,YAAY,CAACF,OAAO,
|
|
1
|
+
{"version":3,"file":"shared.cjs","names":["FiberRefs","_interopRequireWildcard","require","_RequestContextContainer","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","getRequestContext","context","ctx","getOrDefault","tsplus_module_1","FiberRef","currentContext","tsplus_module_2","getOption","RequestContextContainer","c","tsplus_module_4","map","_","tsplus_module_3","runSync","requestContext"],"sources":["../../_src/logger/shared.ts"],"sourcesContent":[null],"mappings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B;EAC5D,MAAMC,GAAG,GAAG3B,SAAS,CAAC4B,YAAY,CAACF,OAAO,EAAEG,eAAA,CAAAC,QAAQ,CAACC,cAAc,CAAC;EACpE;EACA,MAAMhB,CAAC,GAAGiB,eAAA,CAAAC,SAAA,CAAAN,GAAG,EAAWO,gDAAuB,CAAC;EAChD,MAAMC,CAAC,GAAGC,eAAA,CAAAC,GAAA,CAAAtB,CAAC,EAAMuB,CAAC,IAAIC,eAAA,CAAAC,OAAA,CAACF,CAAC,CAACG,cAAc,CAAQ,CAAC;EAChD,OAAON,CAAC;AACV"}
|
package/_cjs/rateLimit.cjs
CHANGED
|
@@ -7,9 +7,10 @@ exports.SEM_withPermitsDuration = SEM_withPermitsDuration;
|
|
|
7
7
|
exports.batch = batch;
|
|
8
8
|
exports.batchPar = batchPar;
|
|
9
9
|
exports.naiveRateLimit = naiveRateLimit;
|
|
10
|
-
var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect"));
|
|
11
|
-
var tsplus_module_2 = _interopRequireWildcard(require("
|
|
12
|
-
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/
|
|
10
|
+
var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect.impl"));
|
|
11
|
+
var tsplus_module_2 = _interopRequireWildcard(require("effect/Effect"));
|
|
12
|
+
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/core/_ext/Iterable"));
|
|
13
|
+
var tsplus_module_4 = _interopRequireWildcard(require("@effect-app/core/Array"));
|
|
13
14
|
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); }
|
|
14
15
|
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; }
|
|
15
16
|
// /**
|
|
@@ -47,7 +48,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
47
48
|
*/
|
|
48
49
|
function SEM_withPermitsDuration(permits, duration) {
|
|
49
50
|
return self => {
|
|
50
|
-
return effect =>
|
|
51
|
+
return effect => tsplus_module_2.Effect.uninterruptibleMask(restore => tsplus_module_1.zipRight(tsplus_module_1.ensuring(restore(effect), tsplus_module_1.delay(self.release(permits), duration)))(restore(self.take(permits))));
|
|
51
52
|
};
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
@@ -55,7 +56,7 @@ function SEM_withPermitsDuration(permits, duration) {
|
|
|
55
56
|
* @tsplus static Collection.Ops batchPar
|
|
56
57
|
*/
|
|
57
58
|
function batchPar(n, forEachItem, forEachBatch) {
|
|
58
|
-
return items =>
|
|
59
|
+
return items => tsplus_module_3.ext_forEach(tsplus_module_4.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_3.ext_forEach(_, (_, j) => forEachItem(_, j, i), {
|
|
59
60
|
concurrency: "inherit"
|
|
60
61
|
}), _ => forEachBatch(_, i)), {
|
|
61
62
|
concurrency: "inherit"
|
|
@@ -66,7 +67,7 @@ function batchPar(n, forEachItem, forEachBatch) {
|
|
|
66
67
|
* @tsplus static Collection.Ops batch
|
|
67
68
|
*/
|
|
68
69
|
function batch(n, forEachItem, forEachBatch) {
|
|
69
|
-
return items =>
|
|
70
|
+
return items => tsplus_module_3.ext_forEach(tsplus_module_4.chunk_(items, n), (_, i) => tsplus_module_1.flatMap(tsplus_module_3.ext_forEach(_, (_, j) => forEachItem(_, j, i), {
|
|
70
71
|
concurrency: "inherit"
|
|
71
72
|
}), _ => forEachBatch(_, i)));
|
|
72
73
|
}
|
|
@@ -94,7 +95,7 @@ function batch(n, forEachItem, forEachBatch) {
|
|
|
94
95
|
* @tsplus static Collection.Ops naiveRateLimit
|
|
95
96
|
*/
|
|
96
97
|
function naiveRateLimit(n, d) {
|
|
97
|
-
return items => (forEachItem, forEachBatch) =>
|
|
98
|
+
return items => (forEachItem, forEachBatch) => tsplus_module_3.ext_forEach(tsplus_module_4.chunk_(items, n), (batch, i) => tsplus_module_1.zipRight(i === 0 ? tsplus_module_2.Effect.unit : tsplus_module_2.Effect.sleep(d), tsplus_module_1.flatMap(tsplus_module_3.ext_forEach(batch, forEachItem, {
|
|
98
99
|
concurrency: n
|
|
99
100
|
}), forEachBatch)));
|
|
100
101
|
}
|
package/_cjs/rateLimit.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimit.cjs","names":["SEM_withPermitsDuration","permits","duration","self","effect","
|
|
1
|
+
{"version":3,"file":"rateLimit.cjs","names":["SEM_withPermitsDuration","permits","duration","self","effect","tsplus_module_2","Effect","uninterruptibleMask","restore","tsplus_module_1","zipRight","ensuring","delay","release","take","batchPar","n","forEachItem","forEachBatch","items","tsplus_module_3","ext_forEach","tsplus_module_4","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,MAAM,CAACC,mBAAmB,CACvBC,OAAO,IAAIC,eAAA,CAAAC,QAAA,CAEND,eAAA,CAAAE,QAAA,CAAAH,OAAO,CAACJ,MAAM,CAAC,EAEbK,eAAA,CAAAG,K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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;AAKM,SAAUK,cAAcA,CAC5Bd,CAAS,EACTe,CAAM;EAEN,OAAWZ,KAAkB,IAAM,CACjCF,WAAsC,EACtCC,YAA4C,KAE5CE,eAAA,CAAAC,WAAA,CAAAC,eAAA,CAAAC,MAAA,CAAAJ,KAAK,EACIH,CAAC,CAAC,EACM,CAACa,KAAK,EAAEJ,CAAC,KACtBhB,eAAA,CAAAC,QAAA,CAAEe,CAAC,KAAK,CAAC,GAAIpB,eAAA,CAAAC,MAAM,CAAC0B,IAAI,GAAG3B,eAAA,CAAAC,MAAM,CAAC2B,KAAK,CAACF,CAAC,CAAC,EAEtCtB,eAAA,CAAAiB,OAAA,CAAAN,eAAA,CAAAC,WAAA,CAAAQ,KAAK,EACYZ,WAAW,EAAE;IAAEW,WAAW,EAAEZ;EAAC,CAAE,CAAC,EACtCE,YAAY,CAAC,CACzB,CACH;AACR"}
|
|
@@ -6,12 +6,14 @@ 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/ConfigSecret"));
|
|
9
|
+
var tsplus_module_1 = _interopRequireWildcard(require("effect/ConfigSecret.impl"));
|
|
10
10
|
var tsplus_module_2 = _interopRequireWildcard(require("effect/Effect"));
|
|
11
|
-
var tsplus_module_3 = _interopRequireWildcard(require("effect/
|
|
12
|
-
var tsplus_module_4 = _interopRequireWildcard(require("effect/
|
|
13
|
-
var tsplus_module_5 = _interopRequireWildcard(require("
|
|
14
|
-
var tsplus_module_6 = _interopRequireWildcard(require("
|
|
11
|
+
var tsplus_module_3 = _interopRequireWildcard(require("effect/Effect.impl"));
|
|
12
|
+
var tsplus_module_4 = _interopRequireWildcard(require("effect/Layer.impl"));
|
|
13
|
+
var tsplus_module_5 = _interopRequireWildcard(require("effect/Equivalence"));
|
|
14
|
+
var tsplus_module_6 = _interopRequireWildcard(require("effect/Equivalence.impl"));
|
|
15
|
+
var tsplus_module_7 = _interopRequireWildcard(require("@effect-app/core/_ext/ord.ext"));
|
|
16
|
+
var tsplus_module_8 = _interopRequireWildcard(require("@effect-app/core/Array"));
|
|
15
17
|
var _mail = _interopRequireDefault(require("@sendgrid/mail"));
|
|
16
18
|
var _util = require("util");
|
|
17
19
|
var _service = require("./service.cjs");
|
|
@@ -24,11 +26,11 @@ const makeLiveSendgrid = ({
|
|
|
24
26
|
defaultReplyTo,
|
|
25
27
|
realMail,
|
|
26
28
|
subjectPrefix
|
|
27
|
-
}) => tsplus_module_2.sync(() => {
|
|
29
|
+
}) => tsplus_module_2.Effect.sync(() => {
|
|
28
30
|
_mail.default.setApiKey(tsplus_module_1.value(apiKey));
|
|
29
31
|
return {
|
|
30
32
|
sendMail(msg_) {
|
|
31
|
-
return tsplus_module_2.gen(function* ($) {
|
|
33
|
+
return tsplus_module_2.Effect.gen(function* ($) {
|
|
32
34
|
const msg = {
|
|
33
35
|
...msg_,
|
|
34
36
|
from: msg_.from ?? defaultFrom,
|
|
@@ -40,8 +42,8 @@ const makeLiveSendgrid = ({
|
|
|
40
42
|
...renderedMsg_,
|
|
41
43
|
subject: `${subjectPrefix}${renderedMsg_.subject}`
|
|
42
44
|
};
|
|
43
|
-
yield* $(
|
|
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)))));
|
|
45
|
+
yield* $(tsplus_module_3.annotateLogs(tsplus_module_2.Effect.logDebug("Sending email"), "msg", (0, _util.inspect)(renderedMsg, false, 5)));
|
|
46
|
+
const ret = yield* $(tsplus_module_2.Effect.async(cb => void _mail.default.send(renderedMsg, false, (err, result) => err ? cb(tsplus_module_2.Effect.fail(err)) : cb(tsplus_module_2.Effect.sync(() => result)))));
|
|
45
47
|
// const event = {
|
|
46
48
|
// name: "EmailSent",
|
|
47
49
|
// properties: {
|
|
@@ -60,7 +62,7 @@ const makeLiveSendgrid = ({
|
|
|
60
62
|
* @tsplus static Emailer.Ops LiveSendgrid
|
|
61
63
|
*/
|
|
62
64
|
function LiveSendgrid(config) {
|
|
63
|
-
return
|
|
65
|
+
return tsplus_module_4.effect(_service.Emailer)(tsplus_module_3.flatMap(tsplus_module_3.config(config), makeLiveSendgrid));
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* @hidden
|
|
@@ -92,11 +94,11 @@ function renderFake(addr, makeId) {
|
|
|
92
94
|
email: `test+${makeId()}@nomizz.com`
|
|
93
95
|
};
|
|
94
96
|
}
|
|
95
|
-
const eq =
|
|
97
|
+
const eq = tsplus_module_6.mapInput(tsplus_module_5.Equivalence.string, to => typeof to === "string" ? to.toLowerCase() : to.email.toLowerCase());
|
|
96
98
|
// TODO: should just not add any already added email address
|
|
97
99
|
// https://stackoverflow.com/a/53603076/11595834
|
|
98
100
|
function renderFakeIfTest(addr, makeId) {
|
|
99
|
-
return Array.isArray(addr) ?
|
|
101
|
+
return Array.isArray(addr) ? tsplus_module_8.iterableToArray(tsplus_module_7.uniqArray(eq)(addr.map(x => isTestAddress(x) ? renderFake(x, makeId) : x))) : isTestAddress(addr) ? renderFake(addr, makeId) : addr;
|
|
100
102
|
}
|
|
101
103
|
function renderMailData(md) {
|
|
102
104
|
if (Array.isArray(md)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sendgrid.cjs","names":["_mail","_interopRequireDefault","require","_util","_service","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","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","
|
|
1
|
+
{"version":3,"file":"Sendgrid.cjs","names":["_mail","_interopRequireDefault","require","_util","_service","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeLiveSendgrid","apiKey","defaultFrom","defaultReplyTo","realMail","subjectPrefix","tsplus_module_2","Effect","sync","sgMail","setApiKey","tsplus_module_1","value","sendMail","msg_","gen","$","msg","from","replyTo","undefined","render","renderMessage","renderedMsg_","renderedMsg","subject","tsplus_module_3","annotateLogs","logDebug","inspect","ret","async","cb","send","err","result","fail","LiveSendgrid","config","tsplus_module_4","effect","Emailer","flatMap","forceFake","makeId","to","renderFake","cc","bcc","renderFakeIfTest","isTestAddress","toLowerCase","endsWith","email","addr","name","renderMailData","eq","tsplus_module_6","mapInput","tsplus_module_5","Equivalence","string","Array","isArray","tsplus_module_8","iterableToArray","tsplus_module_7","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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,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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EV,MAAoB;EACrE,OAAO;IACLW,IAAI,EAAEC,cAAc,CAACF,IAAI,CAAC;IAC1BD,KAAK,EAAE,QAAQT,MAAM,EAAE;GACxB;AACH;AACA,MAAMa,EAAE,GAAGC,eAAA,CAAAC,QAAA,CAAAC,eAAA,CAAAC,WAAW,CAACC,MAAM,EAAWjB,EAA6C,IACnF,OAAOA,EAAE,KAAK,QAAQ,GAAGA,EAAE,CAACM,WAAW,EAAE,GAAGN,EAAE,CAACQ,KAAK,CAACF,WAAW,EAAE,CACnE;AAED;AACA;AACA,SAASF,gBAAgBA,CAACK,IAA6B,EAAEV,MAAoB;EAC3E,OAAOmB,KAAK,CAACC,OAAO,CAACV,IAAI,CAAC,GACvBW,eAAA,CAAAC,eAAA,CAACC,eAAA,CAAAC,SAAA,CAEMX,EAAE,EAFRH,IAAI,CACHe,GAAG,CAAEC,CAAC,IAAMpB,aAAa,CAACoB,CAAC,CAAC,GAAGxB,UAAU,CAACwB,CAAC,EAAE1B,MAAM,CAAC,GAAG0B,CAAE,CAAC,CAClD,IAETpB,aAAa,CAACI,IAAI,CAAC,GACnBR,UAAU,CAACQ,IAAI,EAAEV,MAAM,CAAC,GACxBU,IAAI;AACV;AAEA,SAASE,cAAcA,CAACe,EAA+B;EACrD,IAAIR,KAAK,CAACC,OAAO,CAACO,EAAE,CAAC,EAAE;IACrB,OAAOA,EAAE,CAACF,GAAG,CAACb,cAAc,CAAC,CAACgB,IAAI,CAAC,IAAI,CAAC;EAC1C;EACA,IAAI,OAAOD,EAAE,KAAK,QAAQ,EAAE;IAC1B,OAAOA,EAAE;EACX;EACA,OAAOA,EAAE,CAAClB,KAAK;AACjB"}
|
|
@@ -5,18 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FakeSendgrid = void 0;
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect"));
|
|
8
|
-
var tsplus_module_2 = _interopRequireWildcard(require("effect/
|
|
8
|
+
var tsplus_module_2 = _interopRequireWildcard(require("effect/Effect.impl"));
|
|
9
|
+
var tsplus_module_3 = _interopRequireWildcard(require("effect/Layer.impl"));
|
|
9
10
|
var _utils = require("@effect-app/prelude/utils");
|
|
10
11
|
var _service = require("./service.cjs");
|
|
11
12
|
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); }
|
|
12
13
|
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; }
|
|
13
|
-
const makeFake =
|
|
14
|
+
const makeFake = tsplus_module_2.map(tsplus_module_1.Effect.logDebug("FAKE Emailer Service enabled"), () => ({
|
|
14
15
|
sendMail(msg) {
|
|
15
|
-
return
|
|
16
|
+
return tsplus_module_2.annotateLogs(tsplus_module_1.Effect.logDebug(`Fake send mail`), "msg", (0, _utils.pretty)(msg));
|
|
16
17
|
}
|
|
17
18
|
}));
|
|
18
19
|
/**
|
|
19
20
|
* @tsplus static Emailer.Ops Fake
|
|
20
21
|
*/
|
|
21
|
-
const FakeSendgrid = exports.FakeSendgrid =
|
|
22
|
+
const FakeSendgrid = exports.FakeSendgrid = tsplus_module_3.effect(_service.Emailer)(makeFake);
|
|
22
23
|
//# sourceMappingURL=fake.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake.cjs","names":["_utils","require","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeFake","
|
|
1
|
+
{"version":3,"file":"fake.cjs","names":["_utils","require","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","makeFake","tsplus_module_2","map","tsplus_module_1","Effect","logDebug","sendMail","msg","annotateLogs","pretty","FakeSendgrid","exports","tsplus_module_3","effect","Emailer"],"sources":["../../../_src/services/Emailer/fake.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAsC,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAlB,CAAA,EAAAe,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAEtC,MAAMY,QAAQ,GAAGC,eAAA,CAAAC,GAAA,CAAAC,eAAA,CAAAC,MAAM,CACpBC,QAAQ,CAAC,8BAA8B,CAAC,EACpC,OAAgB;EACnBC,QAAQA,CAACC,GAAG;IACV,OAAON,eAAA,CAAAO,YAAA,CAAAL,eAAA,CAAAC,MAAM,CAACC,QAAQ,CAAC,gBAAgB,CAAC,EAAc,KAAK,EAAE,IAAAI,aAAM,EAACF,GAAG,CAAC,CAAC;EAC3E;CACD,CAAC,CAAC;AAEL;;;AAGO,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,eAAA,CAAAC,MAAA,CAAiBC,gBAAO,EAAxBd,QAAQ,CAAiB"}
|
|
@@ -7,16 +7,18 @@ exports.Live = void 0;
|
|
|
7
7
|
var tsplus_module_1 = _interopRequireWildcard(require("effect/Effect"));
|
|
8
8
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect-app/prelude/_ext/date"));
|
|
9
9
|
var tsplus_module_3 = _interopRequireWildcard(require("effect/Option"));
|
|
10
|
-
var tsplus_module_4 = _interopRequireWildcard(require("
|
|
11
|
-
var tsplus_module_5 = _interopRequireWildcard(require("effect/
|
|
12
|
-
var tsplus_module_6 = _interopRequireWildcard(require("effect/
|
|
13
|
-
var tsplus_module_7 = _interopRequireWildcard(require("effect/
|
|
14
|
-
var tsplus_module_8 = _interopRequireWildcard(require("
|
|
15
|
-
var tsplus_module_9 = _interopRequireWildcard(require("@effect-app/
|
|
16
|
-
var tsplus_module_10 = _interopRequireWildcard(require("@effect-app/
|
|
17
|
-
var tsplus_module_11 = _interopRequireWildcard(require("effect/
|
|
18
|
-
var tsplus_module_12 = _interopRequireWildcard(require("effect/
|
|
19
|
-
var tsplus_module_13 = _interopRequireWildcard(require("effect/
|
|
10
|
+
var tsplus_module_4 = _interopRequireWildcard(require("effect/Option.impl"));
|
|
11
|
+
var tsplus_module_5 = _interopRequireWildcard(require("@effect-app/core/Array"));
|
|
12
|
+
var tsplus_module_6 = _interopRequireWildcard(require("effect/Chunk.impl"));
|
|
13
|
+
var tsplus_module_7 = _interopRequireWildcard(require("effect/Exit.impl"));
|
|
14
|
+
var tsplus_module_8 = _interopRequireWildcard(require("effect/Cause.impl"));
|
|
15
|
+
var tsplus_module_9 = _interopRequireWildcard(require("@effect-app/prelude/schema"));
|
|
16
|
+
var tsplus_module_10 = _interopRequireWildcard(require("@effect-app/core/OptionX"));
|
|
17
|
+
var tsplus_module_11 = _interopRequireWildcard(require("effect/Effect.impl"));
|
|
18
|
+
var tsplus_module_12 = _interopRequireWildcard(require("@effect-app/core/EffectX"));
|
|
19
|
+
var tsplus_module_13 = _interopRequireWildcard(require("effect/Duration"));
|
|
20
|
+
var tsplus_module_14 = _interopRequireWildcard(require("effect/Schedule"));
|
|
21
|
+
var tsplus_module_15 = _interopRequireWildcard(require("effect/Layer.impl"));
|
|
20
22
|
var _reportError = require("@effect-app/infra/api/reportError");
|
|
21
23
|
var _errorReporter = require("@effect-app/infra/errorReporter");
|
|
22
24
|
var _Operations = require("@effect-app/prelude/Operations");
|
|
@@ -24,45 +26,45 @@ var _service = require("./service.cjs");
|
|
|
24
26
|
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); }
|
|
25
27
|
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; }
|
|
26
28
|
const reportAppError = (0, _errorReporter.reportError)(cause => new _reportError.RequestException(cause));
|
|
27
|
-
const make = tsplus_module_1.sync(() => {
|
|
29
|
+
const make = tsplus_module_1.Effect.sync(() => {
|
|
28
30
|
const ops = new Map();
|
|
29
|
-
const makeOp = tsplus_module_1.sync(() => _Operations.OperationId.make());
|
|
30
|
-
const cleanup = tsplus_module_1.sync(() => {
|
|
31
|
+
const makeOp = tsplus_module_1.Effect.sync(() => _Operations.OperationId.make());
|
|
32
|
+
const cleanup = tsplus_module_1.Effect.sync(() => {
|
|
31
33
|
const before = tsplus_module_2.DateSubHours(new Date(), 1);
|
|
32
|
-
|
|
33
|
-
const lastChanged =
|
|
34
|
+
tsplus_module_6.forEach(tsplus_module_5.ext_itToChunk(ops.entries()), ([id, op]) => {
|
|
35
|
+
const lastChanged = tsplus_module_4.getOrElse(tsplus_module_3.Option.fromNullable(op.updatedAt), () => op.createdAt);
|
|
34
36
|
if (lastChanged < before) {
|
|
35
37
|
ops.delete(id);
|
|
36
38
|
}
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
function addOp(id) {
|
|
40
|
-
return tsplus_module_1.sync(() => {
|
|
42
|
+
return tsplus_module_1.Effect.sync(() => {
|
|
41
43
|
ops.set(id, new _Operations.Operation({
|
|
42
44
|
id
|
|
43
45
|
}));
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
function findOp(id) {
|
|
47
|
-
return tsplus_module_1.sync(() => tsplus_module_3.fromNullable(ops.get(id)));
|
|
49
|
+
return tsplus_module_1.Effect.sync(() => tsplus_module_3.Option.fromNullable(ops.get(id)));
|
|
48
50
|
}
|
|
49
51
|
function finishOp(id, exit) {
|
|
50
|
-
return
|
|
51
|
-
if (
|
|
52
|
+
return tsplus_module_11.flatMap(findOp(id), _ => tsplus_module_1.Effect.sync(() => {
|
|
53
|
+
if (tsplus_module_4.isNone(_)) {
|
|
52
54
|
throw new Error("Not found");
|
|
53
55
|
}
|
|
54
56
|
ops.set(id, {
|
|
55
57
|
..._.value,
|
|
56
58
|
updatedAt: new Date(),
|
|
57
|
-
result:
|
|
58
|
-
message:
|
|
59
|
+
result: tsplus_module_7.isSuccess(exit) ? new _Operations.Success() : new _Operations.Failure({
|
|
60
|
+
message: tsplus_module_8.isInterrupted(exit.cause) ? tsplus_module_9.LongString("Interrupted") : tsplus_module_8.isDie(exit.cause) ? tsplus_module_9.LongString("Unknown error") : tsplus_module_10.getOrUndefined(tsplus_module_4.flatMap(tsplus_module_8.failureOption(exit.cause), _ => typeof _ === "object" && _ !== null && "message" in _ && tsplus_module_9.LongString.Guard(_.message) ? tsplus_module_3.Option.some(_.message) : tsplus_module_3.Option.none())) ?? null
|
|
59
61
|
})
|
|
60
62
|
});
|
|
61
63
|
}));
|
|
62
64
|
}
|
|
63
65
|
function update(id, progress) {
|
|
64
|
-
return
|
|
65
|
-
if (
|
|
66
|
+
return tsplus_module_11.flatMap(findOp(id), _ => tsplus_module_1.Effect.sync(() => {
|
|
67
|
+
if (tsplus_module_4.isNone(_)) {
|
|
66
68
|
throw new Error("Not found");
|
|
67
69
|
}
|
|
68
70
|
ops.set(id, {
|
|
@@ -74,20 +76,20 @@ const make = tsplus_module_1.sync(() => {
|
|
|
74
76
|
}
|
|
75
77
|
return {
|
|
76
78
|
cleanup,
|
|
77
|
-
register:
|
|
79
|
+
register: tsplus_module_11.tap(makeOp, id => tsplus_module_11.zipRight(tsplus_module_11.acquireRelease(addOp(id), (_, exit) => finishOp(id, exit)))(tsplus_module_12.EffectX.annotateLogscoped("operationId", id))),
|
|
78
80
|
find: findOp,
|
|
79
81
|
update
|
|
80
82
|
};
|
|
81
83
|
});
|
|
82
|
-
const cleanupLoop =
|
|
83
|
-
if (
|
|
84
|
-
return tsplus_module_1.unit;
|
|
84
|
+
const cleanupLoop = tsplus_module_11.forkScoped(tsplus_module_11.schedule(tsplus_module_11.flatMap(tsplus_module_11.exit(_service.Operations.flatMap(_ => _.cleanup)), _ => {
|
|
85
|
+
if (tsplus_module_7.isSuccess(_)) {
|
|
86
|
+
return tsplus_module_1.Effect.unit;
|
|
85
87
|
} else {
|
|
86
88
|
return reportAppError(_.cause);
|
|
87
89
|
}
|
|
88
|
-
}),
|
|
90
|
+
}), tsplus_module_14.Schedule.fixed(tsplus_module_13.Duration.minutes(1))));
|
|
89
91
|
/**
|
|
90
92
|
* @tsplus static Operations.Ops Live
|
|
91
93
|
*/
|
|
92
|
-
const Live = exports.Live =
|
|
94
|
+
const Live = exports.Live = tsplus_module_15.provideMerge(tsplus_module_15.scopedDiscard(cleanupLoop))(tsplus_module_15.effect(_service.Operations)(make));
|
|
93
95
|
//# sourceMappingURL=live.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.cjs","names":["_reportError","require","_errorReporter","_Operations","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","reportAppError","reportError","cause","RequestException","make","tsplus_module_1","sync","ops","Map","makeOp","OperationId","cleanup","before","tsplus_module_2","DateSubHours","Date","
|
|
1
|
+
{"version":3,"file":"live.cjs","names":["_reportError","require","_errorReporter","_Operations","_service","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","reportAppError","reportError","cause","RequestException","make","tsplus_module_1","Effect","sync","ops","Map","makeOp","OperationId","cleanup","before","tsplus_module_2","DateSubHours","Date","tsplus_module_6","forEach","tsplus_module_5","ext_itToChunk","entries","id","op","lastChanged","tsplus_module_4","getOrElse","tsplus_module_3","Option","fromNullable","updatedAt","createdAt","delete","addOp","Operation","findOp","finishOp","exit","tsplus_module_11","flatMap","_","isNone","Error","value","result","tsplus_module_7","isSuccess","Success","Failure","message","tsplus_module_8","isInterrupted","tsplus_module_9","LongString","isDie","tsplus_module_10","getOrUndefined","failureOption","Guard","some","none","update","progress","register","tap","zipRight","acquireRelease","tsplus_module_12","EffectX","annotateLogscoped","find","cleanupLoop","forkScoped","schedule","Operations","unit","tsplus_module_14","Schedule","fixed","tsplus_module_13","Duration","minutes","Live","exports","tsplus_module_15","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,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,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,IAAI,CAAC,CAChC,EAHH8B,gBAAA,CAAAC,OAAO,CAACC,iBAAiB,CAAC,aAAa,EAAE/C,EAAE,CAAC,CAGzC,CACJ;IAEHgD,IAAI,EAAEnC,MAAM;IACZ0B;GACD;AACH,CAAC,CAAC;AAEF,MAAMU,WAAW,GAAAjC,gBAAA,CAAAkC,UAAA,CAAGlC,gBAAA,CAAAmC,QAAA,CAAAnC,gBAAA,CAAAC,OAAA,CAAAD,gBAAA,CAAAD,IAAA,CAAAqC,mBAAU,CAC3BnC,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAAC5B,OAAO,CAAC,GAEhB4B,CAAC,IAAI;EACb,IAAIK,eAAA,CAAAC,SAAA,CAAAN,CAAC,CAAY,EAAE;IACjB,OAAOnC,eAAA,CAAAC,MAAM,CAACqE,IAAI;EACpB,CAAC,MAAM;IACL,OAAO3E,cAAc,CAACwC,CAAC,CAACtC,KAAK,CAAC;EAChC;AACF,CAAC,CAAC,EACQ0E,gBAAA,CAAAC,QAAQ,CAACC,KAAK,CAACC,gBAAA,CAAAC,QAAQ,CAACC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CACnC;AAEb;;;AAGO,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAAE,gBAAA,CAAAC,YAAA,CAAAD,gBAAA,CAAAE,aAAA,CACbf,WAAW,GADKa,gBAAA,CAAAG,MAAA,CAAab,mBAAU,EAAvBtE,IAAI,CAAoB,CAEnB"}
|
|
@@ -8,8 +8,9 @@ exports.forkOperation2 = forkOperation2;
|
|
|
8
8
|
exports.forkOperationFunction = forkOperationFunction;
|
|
9
9
|
exports.forkOperationWithEffect = forkOperationWithEffect;
|
|
10
10
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect-app/prelude/service"));
|
|
11
|
-
var tsplus_module_2 = _interopRequireWildcard(require("
|
|
12
|
-
var tsplus_module_3 = _interopRequireWildcard(require("effect/
|
|
11
|
+
var tsplus_module_2 = _interopRequireWildcard(require("effect/Scope.impl"));
|
|
12
|
+
var tsplus_module_3 = _interopRequireWildcard(require("@effect-app/infra/api/reportError"));
|
|
13
|
+
var tsplus_module_4 = _interopRequireWildcard(require("effect/Effect.impl"));
|
|
13
14
|
var Scope = _interopRequireWildcard(require("effect/Scope"));
|
|
14
15
|
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); }
|
|
15
16
|
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 +25,7 @@ class Operations extends tsplus_module_1.TagClass() {}
|
|
|
24
25
|
*/
|
|
25
26
|
exports.Operations = Operations;
|
|
26
27
|
function forkOperation_1(self) {
|
|
27
|
-
return Operations.flatMap(Operations =>
|
|
28
|
+
return Operations.flatMap(Operations => tsplus_module_4.flatMap(Scope.make(), scope => tsplus_module_4.tap(tsplus_module_2.extend(Operations.register, scope), () => tsplus_module_3.forkDaemonReportRequestUnexpected(tsplus_module_2.use(self, scope)))));
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* @tsplus getter function forkOperation
|
|
@@ -36,12 +37,12 @@ function forkOperationFunction(fnc) {
|
|
|
36
37
|
* @tsplus static effect/io/Effect.Ops forkOperation
|
|
37
38
|
*/
|
|
38
39
|
function forkOperation2(self) {
|
|
39
|
-
return Operations.flatMap(Operations =>
|
|
40
|
+
return Operations.flatMap(Operations => tsplus_module_4.flatMap(Scope.make(), scope => tsplus_module_4.tap(tsplus_module_2.extend(Operations.register, scope), id => tsplus_module_3.forkDaemonReportRequestUnexpected(tsplus_module_2.use(self(id), scope)))));
|
|
40
41
|
}
|
|
41
42
|
/**
|
|
42
43
|
* @tsplus static effect/io/Effect.Ops forkOperationWithEffect
|
|
43
44
|
*/
|
|
44
45
|
function forkOperationWithEffect(self, fnc) {
|
|
45
|
-
return Operations.flatMap(Operations =>
|
|
46
|
+
return Operations.flatMap(Operations => tsplus_module_4.flatMap(Scope.make(), scope => tsplus_module_4.tap(tsplus_module_4.tap(tsplus_module_2.extend(Operations.register, scope), opId => tsplus_module_3.forkDaemonReportRequestUnexpected(tsplus_module_2.use(self(opId), scope))), opId => tsplus_module_2.extend(tsplus_module_4.forkScoped(tsplus_module_4.interruptible(fnc(opId))), scope))));
|
|
46
47
|
}
|
|
47
48
|
//# sourceMappingURL=service.cjs.map
|