@futdevpro/nts-dynamo 1.15.391 → 1.15.392
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/LICENSE +21 -21
- package/README.md +786 -786
- package/build/_modules/server/errors/errors-sink.util.d.ts +9 -0
- package/build/_modules/server/errors/errors-sink.util.d.ts.map +1 -1
- package/build/_modules/server/errors/errors-sink.util.js +52 -0
- package/build/_modules/server/errors/errors-sink.util.js.map +1 -1
- package/package.json +1 -1
|
@@ -26,5 +26,14 @@ export declare class DyNTS_ErrorsSink_Util {
|
|
|
26
26
|
* (`recordError` handles the missing-data case itself).
|
|
27
27
|
*/
|
|
28
28
|
static clientRecord<T>(body: T): T;
|
|
29
|
+
/** The prefix of a report that arrived with nothing readable — a loud marker instead of `[unknown] (no message)`. */
|
|
30
|
+
static readonly emptyReportPrefix: string;
|
|
31
|
+
/**
|
|
32
|
+
* BFR-FDPFTPSERVICE-007 ② — a `DyFM_Error`-shaped body (`_message`, `_errorCode`, `___issuerSystem`) sent to the sink
|
|
33
|
+
* was stored SILENTLY as `[unknown] (no message)`: the record reads `message` / `source`, the DyFM error keeps them
|
|
34
|
+
* under its own names. The fields are adopted where the record has none; a report that still says nothing is
|
|
35
|
+
* stored with a loud marker naming the keys it did carry (never the values — they may hold personal data).
|
|
36
|
+
*/
|
|
37
|
+
static adoptDyFmErrorShape(record: object): void;
|
|
29
38
|
}
|
|
30
39
|
//# sourceMappingURL=errors-sink.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-sink.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/server/errors/errors-sink.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IAEhC,gFAAgF;IAChF,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAoB;IAE/D,6DAA6D;IAC7D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAShD;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"errors-sink.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/server/errors/errors-sink.util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IAEhC,gFAAgF;IAChF,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAoB;IAE/D,6DAA6D;IAC7D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAShD;IAEF;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC;IAwBlC,qHAAqH;IACrH,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAA0B;IAEnE;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CA6DjD"}
|
|
@@ -45,6 +45,7 @@ class DyNTS_ErrorsSink_Util {
|
|
|
45
45
|
for (const key of DyNTS_ErrorsSink_Util.serverOwnedKeys) {
|
|
46
46
|
Reflect.deleteProperty(clean, key);
|
|
47
47
|
}
|
|
48
|
+
DyNTS_ErrorsSink_Util.adoptDyFmErrorShape(clean);
|
|
48
49
|
// BFR-MASTERPROMPTER-085 — a report without a usable `source` is stored as `CLIENT-UNKNOWN`, so every reader can
|
|
49
50
|
// rely on the field (before, one such record crashed the error statistics)
|
|
50
51
|
const source = Reflect.get(clean, 'source');
|
|
@@ -53,6 +54,57 @@ class DyNTS_ErrorsSink_Util {
|
|
|
53
54
|
}
|
|
54
55
|
return clean;
|
|
55
56
|
}
|
|
57
|
+
/** The prefix of a report that arrived with nothing readable — a loud marker instead of `[unknown] (no message)`. */
|
|
58
|
+
static emptyReportPrefix = '[EMPTY ERROR REPORT]';
|
|
59
|
+
/**
|
|
60
|
+
* BFR-FDPFTPSERVICE-007 ② — a `DyFM_Error`-shaped body (`_message`, `_errorCode`, `___issuerSystem`) sent to the sink
|
|
61
|
+
* was stored SILENTLY as `[unknown] (no message)`: the record reads `message` / `source`, the DyFM error keeps them
|
|
62
|
+
* under its own names. The fields are adopted where the record has none; a report that still says nothing is
|
|
63
|
+
* stored with a loud marker naming the keys it did carry (never the values — they may hold personal data).
|
|
64
|
+
*/
|
|
65
|
+
static adoptDyFmErrorShape(record) {
|
|
66
|
+
const text = (key) => {
|
|
67
|
+
const value = Reflect.get(record, key);
|
|
68
|
+
return typeof value === 'string' && value.trim() ? value : undefined;
|
|
69
|
+
};
|
|
70
|
+
const firstText = (key) => {
|
|
71
|
+
const values = Reflect.get(record, key);
|
|
72
|
+
return Array.isArray(values)
|
|
73
|
+
? values.find((value) => typeof value === 'string' && !!value.trim())
|
|
74
|
+
: undefined;
|
|
75
|
+
};
|
|
76
|
+
// an `FDP_Errors` report may carry its text only inside the nested `error`
|
|
77
|
+
const nested = Reflect.get(record, 'error');
|
|
78
|
+
const nestedText = (key) => {
|
|
79
|
+
const value = nested && typeof nested === 'object' ? Reflect.get(nested, key) : undefined;
|
|
80
|
+
return typeof value === 'string' && value.trim() ? value : undefined;
|
|
81
|
+
};
|
|
82
|
+
if (!text('message')) {
|
|
83
|
+
const message = text('_message') ?? firstText('_messages') ?? text('__userMessage') ?? firstText('__userMessages')
|
|
84
|
+
?? nestedText('message') ?? nestedText('_message');
|
|
85
|
+
if (message) {
|
|
86
|
+
Reflect.set(record, 'message', message);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// the error code goes where the readers look for it (`fdp errors --code` reads `additionalContent.errorCode`, ①)
|
|
90
|
+
const errorCode = text('_errorCode') ?? firstText('_errorCodes');
|
|
91
|
+
const additional = Reflect.get(record, 'additionalContent');
|
|
92
|
+
const additionalObject = additional && typeof additional === 'object' && !Array.isArray(additional) ? { ...additional } : {};
|
|
93
|
+
if (errorCode && !additionalObject['errorCode']) {
|
|
94
|
+
Reflect.set(record, 'additionalContent', { ...additionalObject, errorCode: errorCode });
|
|
95
|
+
}
|
|
96
|
+
if (!text('source')) {
|
|
97
|
+
const source = text('___issuerService') ?? text('___issuerSystem');
|
|
98
|
+
if (source) {
|
|
99
|
+
Reflect.set(record, 'source', source);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (!text('message')) {
|
|
103
|
+
const keys = Object.keys(record).sort().slice(0, 20);
|
|
104
|
+
Reflect.set(record, 'message', `${DyNTS_ErrorsSink_Util.emptyReportPrefix} the report carried no message — received keys: ` +
|
|
105
|
+
(keys.length ? keys.join(', ') : '(none)'));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
56
108
|
}
|
|
57
109
|
exports.DyNTS_ErrorsSink_Util = DyNTS_ErrorsSink_Util;
|
|
58
110
|
//# sourceMappingURL=errors-sink.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-sink.util.js","sourceRoot":"","sources":["../../../../src/_modules/server/errors/errors-sink.util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,qBAAqB;IAEhC,gFAAgF;IAChF,MAAM,CAAU,mBAAmB,GAAW,gBAAgB,CAAC;IAE/D,6DAA6D;IAC7D,MAAM,CAAU,eAAe,GAAsB;QACnD,kCAAkC;QAClC,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK;QAC9E,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa;QACpD,YAAY;QACZ,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB;QACnH,mBAAmB,EAAE,qBAAqB;QAC1C,2CAA2C;QAC3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBAAkB;KACjF,CA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Q,CAAC,CAC7C,CAAC;QACJ,CAAC;IACH,CAAC;;AAlHH,sDAmHC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.392",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Program Ltd.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "server-package",
|