@effect-app/infra 0.50.0 → 0.50.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 +6 -0
- package/_cjs/api/reportError.cjs +3 -14
- package/_cjs/api/reportError.cjs.map +1 -1
- package/_cjs/services/QueueMaker/errors.cjs +8 -13
- package/_cjs/services/QueueMaker/errors.cjs.map +1 -1
- package/_src/api/reportError.ts +2 -14
- package/_src/services/QueueMaker/errors.ts +2 -5
- package/dist/api/defaultErrorHandler.d.ts +2 -2
- package/dist/api/defaultErrorHandler.d.ts.map +1 -1
- package/dist/api/express/makeOpenApiSpecs.d.ts +1 -1
- package/dist/api/reportError.d.ts +4 -7
- package/dist/api/reportError.d.ts.map +1 -1
- package/dist/api/reportError.js +3 -6
- package/dist/services/Operations/service.d.ts +4 -4
- package/dist/services/Operations/service.d.ts.map +1 -1
- package/dist/services/QueueMaker/errors.d.ts +1 -1
- package/dist/services/QueueMaker/errors.d.ts.map +1 -1
- package/dist/services/QueueMaker/errors.js +9 -11
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/_cjs/api/reportError.cjs
CHANGED
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RequestException = void 0;
|
|
7
7
|
exports.forkDaemonReportRequest = forkDaemonReportRequest;
|
|
8
8
|
exports.forkDaemonReportRequestUnexpected = forkDaemonReportRequestUnexpected;
|
|
9
|
-
exports.
|
|
9
|
+
exports.reportRequestError = exports.logRequestError = void 0;
|
|
10
10
|
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
11
11
|
var tsplus_module_2 = _interopRequireWildcard(require("@effect/data/Debug"));
|
|
12
12
|
var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Cause"));
|
|
13
13
|
var _errorReporter = require("../errorReporter.cjs");
|
|
14
14
|
var _errors = require("../errors.cjs");
|
|
15
|
-
var _RequestContextContainer = require("../services/RequestContextContainer.cjs");
|
|
16
15
|
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); }
|
|
17
16
|
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; }
|
|
18
17
|
class RequestException extends _errors.CauseException {
|
|
@@ -21,19 +20,9 @@ class RequestException extends _errors.CauseException {
|
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
exports.RequestException = RequestException;
|
|
24
|
-
const
|
|
25
|
-
exports.reportRequestError_ = reportRequestError_;
|
|
26
|
-
const reportRequestError = (cause, context) => tsplus_module_2.untraced(() => tsplus_module_1.flatMap(_RequestContextContainer.RequestContextContainer.get, requestContext => reportRequestError_(cause, {
|
|
27
|
-
requestContext,
|
|
28
|
-
...context
|
|
29
|
-
})));
|
|
23
|
+
const reportRequestError = (0, _errorReporter.reportError)(cause => new RequestException(cause));
|
|
30
24
|
exports.reportRequestError = reportRequestError;
|
|
31
|
-
const
|
|
32
|
-
exports.logRequestError_ = logRequestError_;
|
|
33
|
-
const logRequestError = (cause, context) => tsplus_module_2.untraced(() => tsplus_module_1.flatMap(_RequestContextContainer.RequestContextContainer.get, requestContext => logRequestError_(cause, {
|
|
34
|
-
requestContext,
|
|
35
|
-
...context
|
|
36
|
-
})));
|
|
25
|
+
const logRequestError = (0, _errorReporter.logError)(cause => new RequestException(cause));
|
|
37
26
|
/**
|
|
38
27
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
39
28
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportError.cjs","names":["_errorReporter","require","_errors","
|
|
1
|
+
{"version":3,"file":"reportError.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","RequestException","CauseException","constructor","cause","exports","reportRequestError","reportError","logRequestError","logError","forkDaemonReportRequest","self","tsplus_module_2","untraced","tsplus_module_1","daemonChildren","fork","tapErrorCause","forkDaemonReportRequestUnexpected","tsplus_module_3","isInterruptedOnly","isDie"],"sources":["../../_src/api/reportError.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAA6C,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,C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,CAAAG,aAAA,CAAAN,IAAI,EACaL,kBAAkB,CAAC,EAEnB,CAClB;AACH;AAEA;;;;;;;;;AASM,SAAUY,iCAAiCA,CAAUP,IAAqB;EAC9E,OAAOC,eAAA,CAAAC,QAAA,CAAe,MAAKC,eAAA,CAAAC,cAAA,CAAAD,eAAA,CAAAE,IAAA,CACzBF,eAAA,CAAAG,aAAA,CAAAN,IAAI,EACcP,KAAK,IACnBe,eAAA,CAAAC,iBAAA,CAAAhB,KAAK,CAAoB,IAAIe,eAAA,CAAAE,KAAA,CAAAjB,KAAK,CAAQ,GACtCE,kBAAkB,CAACF,KAAK,CAAC,GACzBI,eAAe,CAACJ,KAAK,CAAC,CAC3B,EAEc,CAClB;AACH"}
|
|
@@ -9,13 +9,11 @@ exports.reportFatalQueueError = void 0;
|
|
|
9
9
|
exports.reportNonInterruptedFailure = reportNonInterruptedFailure;
|
|
10
10
|
exports.reportNonInterruptedFailureCause = reportNonInterruptedFailureCause;
|
|
11
11
|
exports.reportQueueError = void 0;
|
|
12
|
-
var tsplus_module_1 = _interopRequireWildcard(require("@effect
|
|
13
|
-
var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/
|
|
14
|
-
var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/
|
|
15
|
-
var tsplus_module_4 = _interopRequireWildcard(require("@effect/io/Cause"));
|
|
12
|
+
var tsplus_module_1 = _interopRequireWildcard(require("@effect/io/Effect"));
|
|
13
|
+
var tsplus_module_2 = _interopRequireWildcard(require("@effect/io/Exit"));
|
|
14
|
+
var tsplus_module_3 = _interopRequireWildcard(require("@effect/io/Cause"));
|
|
16
15
|
var _errorReporter = require("@effect-app/infra/errorReporter");
|
|
17
16
|
var _errors = require("@effect-app/infra/errors");
|
|
18
|
-
var _RequestContextContainer = require("../RequestContextContainer.cjs");
|
|
19
17
|
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); }
|
|
20
18
|
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; }
|
|
21
19
|
class MessageException extends _errors.CauseException {
|
|
@@ -31,10 +29,7 @@ class FatalQueueException extends _errors.CauseException {
|
|
|
31
29
|
}
|
|
32
30
|
exports.FatalQueueException = FatalQueueException;
|
|
33
31
|
const reportQueueError_ = (0, _errorReporter.reportError)(cause => new MessageException(cause));
|
|
34
|
-
const reportQueueError = (cause,
|
|
35
|
-
requestContext: tsplus_module_1.getOrUndefined(requestContext),
|
|
36
|
-
...context
|
|
37
|
-
}));
|
|
32
|
+
const reportQueueError = (cause, extras) => reportQueueError_(cause, extras);
|
|
38
33
|
/**
|
|
39
34
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
40
35
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -46,18 +41,18 @@ const reportQueueError = (cause, context) => tsplus_module_2.flatMap(_RequestCon
|
|
|
46
41
|
*/
|
|
47
42
|
exports.reportQueueError = reportQueueError;
|
|
48
43
|
function forkDaemonReportQueue(self) {
|
|
49
|
-
return
|
|
44
|
+
return tsplus_module_1.daemonChildren(tsplus_module_1.fork(tsplus_module_1.tapErrorCause(self, reportNonInterruptedFailureCause({}))));
|
|
50
45
|
}
|
|
51
46
|
const reportFatalQueueError = (0, _errorReporter.reportError)(cause => new FatalQueueException(cause));
|
|
52
47
|
exports.reportFatalQueueError = reportFatalQueueError;
|
|
53
48
|
function reportNonInterruptedFailure(context) {
|
|
54
49
|
const report = reportNonInterruptedFailureCause(context);
|
|
55
|
-
return inp =>
|
|
50
|
+
return inp => tsplus_module_1.flatMap(tsplus_module_1.exit(inp), result => tsplus_module_2.match(result, cause => tsplus_module_1.map(report(cause), () => result), () => tsplus_module_1.sync(() => result)));
|
|
56
51
|
}
|
|
57
52
|
function reportNonInterruptedFailureCause(context) {
|
|
58
53
|
return cause => {
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
54
|
+
if (tsplus_module_3.isInterrupted(cause)) {
|
|
55
|
+
return tsplus_module_1.failCause(cause);
|
|
61
56
|
}
|
|
62
57
|
return reportQueueError(cause, context);
|
|
63
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","names":["_errorReporter","require","_errors","
|
|
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,kCA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AE;MACzB,OAAAS,eAAA,CAAAmB,SAAA,CAAQ5B,KAAsB;;IAEhC,OAAOK,gBAAgB,CAACL,KAAK,EAAEgB,OAAO,CAAC;EACzC,CAAC;AACH"}
|
package/_src/api/reportError.ts
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import { logError, reportError } from "../errorReporter.js"
|
|
2
2
|
import { CauseException } from "../errors.js"
|
|
3
|
-
import { RequestContextContainer } from "../services/RequestContextContainer.js"
|
|
4
3
|
|
|
5
4
|
export class RequestException<E> extends CauseException<E> {
|
|
6
5
|
constructor(cause: Cause<E>) {
|
|
7
6
|
super(cause, "Request")
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
export const reportRequestError = <E>(cause: Cause<E>, context?: Record<string, unknown> | undefined) =>
|
|
13
|
-
Debug.untraced(() =>
|
|
14
|
-
RequestContextContainer.get.flatMap((requestContext) => reportRequestError_(cause, { requestContext, ...context }))
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
export const logRequestError_ = logError((cause) => new RequestException(cause))
|
|
18
|
-
|
|
19
|
-
export const logRequestError = <E>(cause: Cause<E>, context?: Record<string, unknown> | undefined) =>
|
|
20
|
-
Debug.untraced(() =>
|
|
21
|
-
RequestContextContainer.get.flatMap((requestContext) => logRequestError_(cause, { requestContext, ...context }))
|
|
22
|
-
)
|
|
9
|
+
export const reportRequestError = reportError((cause) => new RequestException(cause))
|
|
10
|
+
export const logRequestError = logError((cause) => new RequestException(cause))
|
|
23
11
|
|
|
24
12
|
/**
|
|
25
13
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { reportError } from "@effect-app/infra/errorReporter"
|
|
2
2
|
import { CauseException } from "@effect-app/infra/errors"
|
|
3
|
-
import { RequestContextContainer } from "../RequestContextContainer.js"
|
|
4
3
|
|
|
5
4
|
export class MessageException<E> extends CauseException<E> {
|
|
6
5
|
constructor(cause: Cause<E>) {
|
|
@@ -16,10 +15,8 @@ export class FatalQueueException<E> extends CauseException<E> {
|
|
|
16
15
|
|
|
17
16
|
const reportQueueError_ = reportError((cause) => new MessageException(cause))
|
|
18
17
|
|
|
19
|
-
export const reportQueueError = <E>(cause: Cause<E>,
|
|
20
|
-
|
|
21
|
-
reportQueueError_(cause, { requestContext: requestContext.value, ...context })
|
|
22
|
-
)
|
|
18
|
+
export const reportQueueError = <E>(cause: Cause<E>, extras?: Record<string, unknown> | undefined) =>
|
|
19
|
+
reportQueueError_(cause, extras)
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "@effect/io/Effect";
|
|
2
2
|
import type express from "express";
|
|
3
3
|
import type { InvalidStateError, NotFoundError, NotLoggedInError, OptimisticConcurrencyException, UnauthorizedError, ValidationError } from "../errors.js";
|
|
4
|
-
export declare function defaultBasicErrorHandler<R>(_req: express.Request, res: express.Response, r2: Effect<R, ValidationError, void>): import("@effect/io/Effect").Effect<
|
|
5
|
-
export declare function defaultErrorHandler<R>(req: express.Request, res: express.Response, r2: Effect<R, SupportedErrors, void>): import("@effect/io/Effect").Effect<
|
|
4
|
+
export declare function defaultBasicErrorHandler<R>(_req: express.Request, res: express.Response, r2: Effect<R, ValidationError, void>): import("@effect/io/Effect").Effect<R, never, void | express.Response<any, Record<string, any>>>;
|
|
5
|
+
export declare function defaultErrorHandler<R>(req: express.Request, res: express.Response, r2: Effect<R, SupportedErrors, void>): import("@effect/io/Effect").Effect<R, never, void | express.Response<any, Record<string, any>>>;
|
|
6
6
|
export type SupportedErrors = ValidationError | NotFoundError | NotLoggedInError | UnauthorizedError | InvalidStateError | OptimisticConcurrencyException;
|
|
7
7
|
//# sourceMappingURL=defaultErrorHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultErrorHandler.d.ts","sourceRoot":"","sources":["../../_src/api/defaultErrorHandler.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,8BAA8B,EAC9B,iBAAiB,EACjB,eAAe,EAChB,MAAM,cAAc,CAAA;AAGrB,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,IAAI,EAAE,OAAO,CAAC,OAAO,EACrB,GAAG,EAAE,OAAO,CAAC,QAAQ,EACrB,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"defaultErrorHandler.d.ts","sourceRoot":"","sources":["../../_src/api/defaultErrorHandler.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,8BAA8B,EAC9B,iBAAiB,EACjB,eAAe,EAChB,MAAM,cAAc,CAAA;AAGrB,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,IAAI,EAAE,OAAO,CAAC,OAAO,EACrB,GAAG,EAAE,OAAO,CAAC,QAAQ,EACrB,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,mGAiBrC;AAKD,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,GAAG,EAAE,OAAO,CAAC,OAAO,EACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,EACrB,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,mGA4BrC;AAED,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,8BAA8B,CAAA"}
|
|
@@ -18,7 +18,7 @@ export declare function makeOpenApiSpecs(rdescs: Iterable<RouteDescriptorAny>, i
|
|
|
18
18
|
version: string;
|
|
19
19
|
};
|
|
20
20
|
tags: never[];
|
|
21
|
-
paths: Record<string, Record<"
|
|
21
|
+
paths: Record<string, Record<"GET" | "POST" | "PUT" | "PATCH" | "DELETE", {
|
|
22
22
|
[x: string]: {
|
|
23
23
|
responses: any;
|
|
24
24
|
tags: readonly string[] | undefined;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Cause } from "@effect/io/Cause";
|
|
2
2
|
import { Effect } from "@effect/io/Effect";
|
|
3
3
|
import { CauseException } from "../errors.js";
|
|
4
|
-
import { RequestContextContainer } from "../services/RequestContextContainer.js";
|
|
5
4
|
export declare class RequestException<E> extends CauseException<E> {
|
|
6
5
|
constructor(cause: Cause<E>);
|
|
7
6
|
}
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const logRequestError_: (cause: import("@effect/io/Cause").Cause<unknown>, context?: Record<string, unknown> | undefined) => import("@effect/io/Effect").Effect<never, never, void>;
|
|
11
|
-
export declare const logRequestError: <E>(cause: import("@effect/io/Cause").Cause<E>, context?: Record<string, unknown> | undefined) => import("@effect/io/Effect").Effect<RequestContextContainer, never, void>;
|
|
7
|
+
export declare const reportRequestError: (cause: import("@effect/io/Cause").Cause<unknown>, extras?: Record<string, unknown> | undefined) => import("@effect/io/Effect").Effect<never, never, void>;
|
|
8
|
+
export declare const logRequestError: (cause: import("@effect/io/Cause").Cause<unknown>, context?: Record<string, unknown> | undefined) => import("@effect/io/Effect").Effect<never, never, void>;
|
|
12
9
|
/**
|
|
13
10
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
14
11
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -18,7 +15,7 @@ export declare const logRequestError: <E>(cause: import("@effect/io/Cause").Caus
|
|
|
18
15
|
* @tsplus getter effect/io/Effect forkDaemonReportRequest
|
|
19
16
|
* @tsplus location "@effect-app/infra/api/reportError"
|
|
20
17
|
*/
|
|
21
|
-
export declare function forkDaemonReportRequest<R, E, A>(self: Effect<R, E, A>): import("@effect/io/Effect").Effect<
|
|
18
|
+
export declare function forkDaemonReportRequest<R, E, A>(self: Effect<R, E, A>): import("@effect/io/Effect").Effect<R, never, import("@effect/io/Fiber").RuntimeFiber<E, A>>;
|
|
22
19
|
/**
|
|
23
20
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
24
21
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -28,5 +25,5 @@ export declare function forkDaemonReportRequest<R, E, A>(self: Effect<R, E, A>):
|
|
|
28
25
|
* @tsplus getter effect/io/Effect forkDaemonReportRequestUnexpected
|
|
29
26
|
* @tsplus location "@effect-app/infra/api/reportError"
|
|
30
27
|
*/
|
|
31
|
-
export declare function forkDaemonReportRequestUnexpected<R, E, A>(self: Effect<R, E, A>): import("@effect/io/Effect").Effect<
|
|
28
|
+
export declare function forkDaemonReportRequestUnexpected<R, E, A>(self: Effect<R, E, A>): import("@effect/io/Effect").Effect<R, never, import("@effect/io/Fiber").RuntimeFiber<E, A>>;
|
|
32
29
|
//# sourceMappingURL=reportError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportError.d.ts","sourceRoot":"","sources":["../../_src/api/reportError.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"reportError.d.ts","sourceRoot":"","sources":["../../_src/api/reportError.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;gBAC5C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;CAG5B;AACD,eAAO,MAAM,kBAAkB,4JAAsD,CAAA;AACrF,eAAO,MAAM,eAAe,6JAAmD,CAAA;;;;;;;;;;AAW/E,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,+FAOrE;;;;;;;;;;AAWD,wBAAgB,iCAAiC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,+FAW/E"}
|
package/dist/api/reportError.js
CHANGED
|
@@ -3,16 +3,13 @@ import * as tsplus_module_2 from "@effect/data/Debug";
|
|
|
3
3
|
import * as tsplus_module_3 from "@effect/io/Cause";
|
|
4
4
|
import { logError, reportError } from "../errorReporter.js";
|
|
5
5
|
import { CauseException } from "../errors.js";
|
|
6
|
-
import { RequestContextContainer } from "../services/RequestContextContainer.js";
|
|
7
6
|
export class RequestException extends CauseException {
|
|
8
7
|
constructor(cause) {
|
|
9
8
|
super(cause, "Request");
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const logRequestError_ = logError((cause) => new RequestException(cause));
|
|
15
|
-
export const logRequestError = (cause, context) => tsplus_module_2.untraced(() => tsplus_module_1.flatMap(RequestContextContainer.get, (requestContext) => logRequestError_(cause, { requestContext, ...context })));
|
|
11
|
+
export const reportRequestError = reportError((cause) => new RequestException(cause));
|
|
12
|
+
export const logRequestError = logError((cause) => new RequestException(cause));
|
|
16
13
|
/**
|
|
17
14
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
18
15
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -39,4 +36,4 @@ export function forkDaemonReportRequestUnexpected(self) {
|
|
|
39
36
|
? reportRequestError(cause)
|
|
40
37
|
: logRequestError(cause)))));
|
|
41
38
|
}
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3J0RXJyb3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9fc3JjL2FwaS9yZXB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LEtBQUssQ0FBQztRQUMzQixDQUFDLENBQUMsZUFBZSxDQUFDLEtBQUssQ0FBQyxDQUMzQixFQUVjLENBQ2xCLENBQUE7QUFDSCxDQUFDIn0=
|
|
@@ -23,21 +23,21 @@ export declare abstract class Operations extends Operations_base {
|
|
|
23
23
|
* @tsplus getter effect/io/Effect forkOperation
|
|
24
24
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
25
25
|
*/
|
|
26
|
-
export declare function forkOperation<R, E, A>(self: Effect<R, E, A>): import("@effect/io/Effect").Effect<
|
|
26
|
+
export declare function forkOperation<R, E, A>(self: Effect<R, E, A>): import("@effect/io/Effect").Effect<Operations | Exclude<R, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
27
27
|
/**
|
|
28
28
|
* @tsplus getter function forkOperation
|
|
29
29
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
30
30
|
*/
|
|
31
|
-
export declare function forkOperationFunction<R, E, A, Inp>(fnc: (inp: Inp) => Effect<R, E, A>): (inp: Inp) => import("@effect/io/Effect").Effect<
|
|
31
|
+
export declare function forkOperationFunction<R, E, A, Inp>(fnc: (inp: Inp) => Effect<R, E, A>): (inp: Inp) => import("@effect/io/Effect").Effect<Operations | Exclude<R, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
32
32
|
/**
|
|
33
33
|
* @tsplus static effect/io/Effect.Ops forkOperation
|
|
34
34
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
35
35
|
*/
|
|
36
|
-
export declare function forkOperation2<R, E, A>(self: (opId: OperationId) => Effect<R, E, A>): import("@effect/io/Effect").Effect<
|
|
36
|
+
export declare function forkOperation2<R, E, A>(self: (opId: OperationId) => Effect<R, E, A>): import("@effect/io/Effect").Effect<Operations | Exclude<R, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
37
37
|
/**
|
|
38
38
|
* @tsplus static effect/io/Effect.Ops forkOperationWithEffect
|
|
39
39
|
* @tsplus location "@effect-app/infra/services/Operations/service"
|
|
40
40
|
*/
|
|
41
|
-
export declare function forkOperationWithEffect<R, R2, E, E2, A, A2>(self: (id: OperationId) => Effect<R, E, A>, fnc: (id: OperationId) => Effect<R2, E2, A2>): import("@effect/io/Effect").Effect<
|
|
41
|
+
export declare function forkOperationWithEffect<R, R2, E, E2, A, A2>(self: (id: OperationId) => Effect<R, E, A>, fnc: (id: OperationId) => Effect<R2, E2, A2>): import("@effect/io/Effect").Effect<Operations | Exclude<R, Scope.Scope> | Exclude<R2, Scope.Scope>, never, import("@effect-app/prelude/schema").StringId>;
|
|
42
42
|
export {};
|
|
43
43
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../_src/services/Operations/service.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC/F,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAEzC,eAAO,MAAM,YAAY,eAAyB,CAAA;;;;;;AAClD;;;GAGG;AACH,8BAAsB,UAAW,SAAQ,eAA8C;IACrF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;IAC1D,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IAC7F,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;CAC7C;;;;;AAKD,w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,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,kIAcnF;;;;;AAKD,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EACzD,IAAI,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC1C,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,6JAgB7C"}
|
|
@@ -8,7 +8,7 @@ export declare class MessageException<E> extends CauseException<E> {
|
|
|
8
8
|
export declare class FatalQueueException<E> extends CauseException<E> {
|
|
9
9
|
constructor(cause: Cause<E>);
|
|
10
10
|
}
|
|
11
|
-
export declare const reportQueueError: <E>(cause: import("@effect/io/Cause").Cause<E>,
|
|
11
|
+
export declare const reportQueueError: <E>(cause: import("@effect/io/Cause").Cause<E>, extras?: Record<string, unknown> | undefined) => import("@effect/io/Effect").Effect<never, never, void>;
|
|
12
12
|
/**
|
|
13
13
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
14
14
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../_src/services/QueueMaker/errors.ts"],"names":[],"mappings":";;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../_src/services/QueueMaker/errors.ts"],"names":[],"mappings":";;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;gBAC5C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;CAG5B;AAED,qBAAa,mBAAmB,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;gBAC/C,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;CAG5B;AAID,eAAO,MAAM,gBAAgB,2DAAiC,OAAO,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,2DAC7D,CAAA;;;;;;;;;;AAWpC,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,+FAEnE;AAED,eAAO,MAAM,qBAAqB,4JAEjC,CAAA;AAED,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,qJAW5E;AAED,wBAAgB,gCAAgC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,sDACnD,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAMxD"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@effect
|
|
2
|
-
import * as tsplus_module_2 from "@effect/io/
|
|
3
|
-
import * as tsplus_module_3 from "@effect/io/
|
|
4
|
-
import * as tsplus_module_4 from "@effect/io/Cause";
|
|
1
|
+
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Exit";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Cause";
|
|
5
4
|
import { reportError } from "@effect-app/infra/errorReporter";
|
|
6
5
|
import { CauseException } from "@effect-app/infra/errors";
|
|
7
|
-
import { RequestContextContainer } from "../RequestContextContainer.js";
|
|
8
6
|
export class MessageException extends CauseException {
|
|
9
7
|
constructor(cause) {
|
|
10
8
|
super(cause, "Message");
|
|
@@ -16,7 +14,7 @@ export class FatalQueueException extends CauseException {
|
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
const reportQueueError_ = reportError((cause) => new MessageException(cause));
|
|
19
|
-
export const reportQueueError = (cause,
|
|
17
|
+
export const reportQueueError = (cause, extras) => reportQueueError_(cause, extras);
|
|
20
18
|
/**
|
|
21
19
|
* Forks the effect into a new fiber attached to the global scope. Because the
|
|
22
20
|
* new fiber is attached to the global scope, when the fiber executing the
|
|
@@ -27,19 +25,19 @@ export const reportQueueError = (cause, context) => tsplus_module_2.flatMap(Requ
|
|
|
27
25
|
* @tsplus getter effect/io/Effect forkDaemonReportQueue
|
|
28
26
|
*/
|
|
29
27
|
export function forkDaemonReportQueue(self) {
|
|
30
|
-
return
|
|
28
|
+
return tsplus_module_1.daemonChildren(tsplus_module_1.fork(tsplus_module_1.tapErrorCause(self, reportNonInterruptedFailureCause({}))));
|
|
31
29
|
}
|
|
32
30
|
export const reportFatalQueueError = reportError((cause) => new FatalQueueException(cause));
|
|
33
31
|
export function reportNonInterruptedFailure(context) {
|
|
34
32
|
const report = reportNonInterruptedFailureCause(context);
|
|
35
|
-
return (inp) =>
|
|
33
|
+
return (inp) => tsplus_module_1.flatMap(tsplus_module_1.exit(inp), (result) => tsplus_module_2.match(result, (cause) => tsplus_module_1.map(report(cause), () => result), () => tsplus_module_1.sync(() => result)));
|
|
36
34
|
}
|
|
37
35
|
export function reportNonInterruptedFailureCause(context) {
|
|
38
36
|
return (cause) => {
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
37
|
+
if (tsplus_module_3.isInterrupted(cause)) {
|
|
38
|
+
return tsplus_module_1.failCause(cause);
|
|
41
39
|
}
|
|
42
40
|
return reportQueueError(cause, context);
|
|
43
41
|
};
|
|
44
42
|
}
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsi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FBQyxLQUFLLENBQUMsQ0FDMUMsQ0FBQTtBQUVELE1BQU0sVUFBVSwyQkFBMkIsQ0FBQyxPQUFpQztJQUMzRSxNQUFNLE1BQU0sR0FBRyxnQ0FBZ0MsQ0FBQyxPQUFPLENBQUMsQ0FBQTtJQUN4RCxPQUFPLENBQVUsR0FBb0IsRUFBZ0MsRUFBRSxDQUNyRSw2Q0FBQSxHQUFHLEdBRVEsQ0FBQyxNQUFNLEVBQUUsRUFBRSxDQUNsQixzQkFBQSxNQUFNLEVBQ0osQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLG9CQUFBLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBSyxHQUFHLEVBQUUsQ0FBQyxNQUFNLENBQUMsRUFDMUMsR0FBRyxFQUFFLENBQUMsMkJBQU8sTUFBTSxDQUFDLENBQ3JCLENBQ0YsQ0FBQTtBQUNQLENBQUM7QUFFRCxNQUFNLFVBQVUsZ0NBQWdDLENBQUMsT0FBaUM7SUFDaEYsT0FBTyxDQUFJLEtBQWUsRUFBOEIsRUFBRTtRQUN4RCxJQUFJLDhCQUFBLEtBQUssQ0FBZ0IsRUFBRTtZQUN6QixpQ0FBUSxLQUFzQixFQUFVO1NBQ3pDO1FBQ0QsT0FBTyxnQkFBZ0IsQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUE7SUFDekMsQ0FBQyxDQUFBO0FBQ0gsQ0FBQyJ9
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/infra",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"proper-lockfile": "^4.1.2",
|
|
20
20
|
"pure-rand": "^6.0.1",
|
|
21
21
|
"redlock": "^4.2.0",
|
|
22
|
-
"@effect-app/core": "0.43.0",
|
|
23
22
|
"@effect-app/prelude": "0.39.0",
|
|
23
|
+
"@effect-app/core": "0.43.0",
|
|
24
24
|
"@effect-app/infra-adapters": "0.37.0",
|
|
25
25
|
"@effect-app/schema": "0.35.0"
|
|
26
26
|
},
|