@abyss-project/monitor 9.3.0 → 9.4.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.
Files changed (80) hide show
  1. package/dist/api/error-group.api.d.ts +4 -1
  2. package/dist/api/error-group.api.js +13 -1
  3. package/dist/api/error-group.api.js.map +1 -1
  4. package/dist/api/incident.api.d.ts +3 -1
  5. package/dist/api/incident.api.js +9 -1
  6. package/dist/api/incident.api.js.map +1 -1
  7. package/dist/index.d.ts +6 -0
  8. package/dist/index.js +6 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/texts/error-type-texts.d.ts +13 -0
  11. package/dist/texts/error-type-texts.js +154 -0
  12. package/dist/texts/error-type-texts.js.map +1 -0
  13. package/dist/texts/index.d.ts +2 -0
  14. package/dist/texts/index.js +19 -0
  15. package/dist/texts/index.js.map +1 -0
  16. package/dist/texts/report-texts.d.ts +42 -0
  17. package/dist/texts/report-texts.js +192 -0
  18. package/dist/texts/report-texts.js.map +1 -0
  19. package/dist/types/enum/api-error.enum.d.ts +2 -0
  20. package/dist/types/enum/api-error.enum.js +2 -0
  21. package/dist/types/enum/api-error.enum.js.map +1 -1
  22. package/dist/types/enum/error-report-export-channel.enum.d.ts +5 -0
  23. package/dist/types/enum/error-report-export-channel.enum.js +10 -0
  24. package/dist/types/enum/error-report-export-channel.enum.js.map +1 -0
  25. package/dist/types/enum/export-removal-reason.enum.d.ts +14 -0
  26. package/dist/types/enum/export-removal-reason.enum.js +19 -0
  27. package/dist/types/enum/export-removal-reason.enum.js.map +1 -0
  28. package/dist/types/enum/index.d.ts +7 -0
  29. package/dist/types/enum/index.js +7 -0
  30. package/dist/types/enum/index.js.map +1 -1
  31. package/dist/types/enum/monitor-report-block.enum.d.ts +10 -0
  32. package/dist/types/enum/monitor-report-block.enum.js +23 -0
  33. package/dist/types/enum/monitor-report-block.enum.js.map +1 -0
  34. package/dist/types/enum/report-absent-source.enum.d.ts +8 -0
  35. package/dist/types/enum/report-absent-source.enum.js +13 -0
  36. package/dist/types/enum/report-absent-source.enum.js.map +1 -0
  37. package/dist/types/enum/report-block-availability.enum.d.ts +4 -0
  38. package/dist/types/enum/report-block-availability.enum.js +9 -0
  39. package/dist/types/enum/report-block-availability.enum.js.map +1 -0
  40. package/dist/types/enum/report-block-reason.enum.d.ts +11 -0
  41. package/dist/types/enum/report-block-reason.enum.js +16 -0
  42. package/dist/types/enum/report-block-reason.enum.js.map +1 -0
  43. package/dist/types/enum/report-observed-unknown.enum.d.ts +8 -0
  44. package/dist/types/enum/report-observed-unknown.enum.js +13 -0
  45. package/dist/types/enum/report-observed-unknown.enum.js.map +1 -0
  46. package/dist/types/interface/api/requests/error-group.request.d.ts +25 -1
  47. package/dist/types/interface/api/requests/incident.request.d.ts +11 -0
  48. package/dist/types/interface/api/responses/error-group.response.d.ts +34 -1
  49. package/dist/types/interface/api/responses/incident.response.d.ts +13 -0
  50. package/dist/types/interface/index.d.ts +1 -0
  51. package/dist/types/interface/index.js +1 -0
  52. package/dist/types/interface/index.js.map +1 -1
  53. package/dist/types/interface/models/monitor-error-report-export.model.d.ts +16 -0
  54. package/dist/types/interface/models/monitor-error-report-export.model.js +3 -0
  55. package/dist/types/interface/models/monitor-error-report-export.model.js.map +1 -0
  56. package/dist/utils/error-report/index.d.ts +1 -0
  57. package/dist/utils/error-report/index.js +18 -0
  58. package/dist/utils/error-report/index.js.map +1 -0
  59. package/dist/utils/error-report/report-optimizer.d.ts +19 -0
  60. package/dist/utils/error-report/report-optimizer.js +54 -0
  61. package/dist/utils/error-report/report-optimizer.js.map +1 -0
  62. package/dist/utils/export-redaction/iban.d.ts +1 -0
  63. package/dist/utils/export-redaction/iban.js +19 -0
  64. package/dist/utils/export-redaction/iban.js.map +1 -0
  65. package/dist/utils/export-redaction/index.d.ts +1 -0
  66. package/dist/utils/export-redaction/index.js +18 -0
  67. package/dist/utils/export-redaction/index.js.map +1 -0
  68. package/dist/utils/export-redaction/luhn.d.ts +1 -0
  69. package/dist/utils/export-redaction/luhn.js +22 -0
  70. package/dist/utils/export-redaction/luhn.js.map +1 -0
  71. package/dist/utils/export-redaction/patterns.d.ts +3 -0
  72. package/dist/utils/export-redaction/patterns.js +109 -0
  73. package/dist/utils/export-redaction/patterns.js.map +1 -0
  74. package/dist/utils/export-redaction/redact-for-export.d.ts +26 -0
  75. package/dist/utils/export-redaction/redact-for-export.js +187 -0
  76. package/dist/utils/export-redaction/redact-for-export.js.map +1 -0
  77. package/dist/utils/index.d.ts +2 -0
  78. package/dist/utils/index.js +2 -0
  79. package/dist/utils/index.js.map +1 -1
  80. package/package.json +2 -1
@@ -39,6 +39,7 @@ __exportStar(require("./models/monitor-notification-channel.model"), exports);
39
39
  __exportStar(require("./models/monitor-notification-delivery.model"), exports);
40
40
  __exportStar(require("./models/monitor-warning.model"), exports);
41
41
  __exportStar(require("./models/monitor-error-group.model"), exports);
42
+ __exportStar(require("./models/monitor-error-report-export.model"), exports);
42
43
  __exportStar(require("./models/alert-message.model"), exports);
43
44
  __exportStar(require("./api"), exports);
44
45
  __exportStar(require("./dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yEAAuD;AACvD,sDAAoC;AACpC,mEAAiD;AACjD,iEAA+C;AAC/C,0EAAwD;AACxD,uEAAqD;AACrD,+EAA6D;AAC7D,mEAAiD;AACjD,qEAAmD;AACnD,6EAA2D;AAC3D,sEAAoD;AACpD,6EAA2D;AAC3D,8EAA4D;AAC5D,gFAA8D;AAC9D,8EAA4D;AAC5D,4EAA0D;AAC1D,mEAAiD;AACjD,iEAA+C;AAC/C,kEAAgD;AAChD,oEAAkD;AAClD,8EAA4D;AAC5D,+EAA6D;AAC7D,iEAA+C;AAC/C,qEAAmD;AACnD,+DAA6C;AAG7C,wCAAsB;AACtB,wCAAsB;AACtB,+CAA6B;AAC7B,mDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yEAAuD;AACvD,sDAAoC;AACpC,mEAAiD;AACjD,iEAA+C;AAC/C,0EAAwD;AACxD,uEAAqD;AACrD,+EAA6D;AAC7D,mEAAiD;AACjD,qEAAmD;AACnD,6EAA2D;AAC3D,sEAAoD;AACpD,6EAA2D;AAC3D,8EAA4D;AAC5D,gFAA8D;AAC9D,8EAA4D;AAC5D,4EAA0D;AAC1D,mEAAiD;AACjD,iEAA+C;AAC/C,kEAAgD;AAChD,oEAAkD;AAClD,8EAA4D;AAC5D,+EAA6D;AAC7D,iEAA+C;AAC/C,qEAAmD;AACnD,6EAA2D;AAC3D,+DAA6C;AAG7C,wCAAsB;AACtB,wCAAsB;AACtB,+CAA6B;AAC7B,mDAAiC"}
@@ -0,0 +1,16 @@
1
+ import { MonitorTextLocale } from '../../../texts/error-type-texts';
2
+ import { ErrorReportExportChannel, MonitorReportBlock } from '../../enum';
3
+ export interface IMonitorErrorReportExport {
4
+ id: string;
5
+ groupId: string;
6
+ projectId: string;
7
+ applicationId: string;
8
+ environment: string;
9
+ channel: ErrorReportExportChannel;
10
+ userId: string | null;
11
+ mcpConnectionId: string | null;
12
+ blocks: MonitorReportBlock[];
13
+ locale: MonitorTextLocale;
14
+ estimatedTokens: number;
15
+ createdAt?: Date;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=monitor-error-report-export.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monitor-error-report-export.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/monitor-error-report-export.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './report-optimizer';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./report-optimizer"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/error-report/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
@@ -0,0 +1,19 @@
1
+ import { ErrorGroupStatus } from '../../types/enum/error-group-status.enum';
2
+ import { MonitorErrorType } from '../../types/enum/error-type.enum';
3
+ import { MonitorReportBlock } from '../../types/enum/monitor-report-block.enum';
4
+ import { ReportBlockAvailability } from '../../types/enum/report-block-availability.enum';
5
+ import { ReportBlockReason } from '../../types/enum/report-block-reason.enum';
6
+ export declare const REPORT_TOKEN_BUDGET = 12000;
7
+ export interface IReportBlockSuggestion {
8
+ block: MonitorReportBlock;
9
+ reason: ReportBlockReason;
10
+ }
11
+ export declare const REPORT_BLOCK_SUGGESTIONS: Record<MonitorErrorType, ReadonlyArray<IReportBlockSuggestion>>;
12
+ export interface ISuggestReportBlocksInput {
13
+ errorType: MonitorErrorType;
14
+ status: ErrorGroupStatus;
15
+ currentReleaseIsFirst: boolean;
16
+ availability: Record<MonitorReportBlock, ReportBlockAvailability>;
17
+ }
18
+ export declare const suggestReportBlocks: (input: ISuggestReportBlocksInput) => IReportBlockSuggestion[];
19
+ export declare const estimateTokens: (text: string) => number;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.estimateTokens = exports.suggestReportBlocks = exports.REPORT_BLOCK_SUGGESTIONS = exports.REPORT_TOKEN_BUDGET = void 0;
4
+ const error_group_status_enum_1 = require("../../types/enum/error-group-status.enum");
5
+ const error_type_enum_1 = require("../../types/enum/error-type.enum");
6
+ const monitor_report_block_enum_1 = require("../../types/enum/monitor-report-block.enum");
7
+ const report_block_availability_enum_1 = require("../../types/enum/report-block-availability.enum");
8
+ const report_block_reason_enum_1 = require("../../types/enum/report-block-reason.enum");
9
+ exports.REPORT_TOKEN_BUDGET = 12000;
10
+ const { SYMPTOM, REQUEST, RELEASE, STATS, NEIGHBOURS, LINKED_INCIDENT, OCCURRENCES } = monitor_report_block_enum_1.MonitorReportBlock;
11
+ const always = { block: SYMPTOM, reason: report_block_reason_enum_1.ReportBlockReason.ALWAYS_INCLUDED };
12
+ const release = { block: RELEASE, reason: report_block_reason_enum_1.ReportBlockReason.RULES_OUT_FALSE_LEAD };
13
+ const stats = { block: STATS, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_FREQUENCY };
14
+ const request = { block: REQUEST, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_REQUEST };
15
+ const neighbours = { block: NEIGHBOURS, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_REQUEST_PATH };
16
+ const linkedIncident = { block: LINKED_INCIDENT, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_ONGOING_INCIDENT };
17
+ exports.REPORT_BLOCK_SUGGESTIONS = {
18
+ [error_type_enum_1.MonitorErrorType.TIMEOUT_DOWNSTREAM]: [
19
+ always,
20
+ release,
21
+ stats,
22
+ linkedIncident,
23
+ { block: REQUEST, reason: report_block_reason_enum_1.ReportBlockReason.KEY_FOR_TIMEOUT },
24
+ ],
25
+ [error_type_enum_1.MonitorErrorType.CONNECTION_REFUSED]: [always, release, stats, linkedIncident],
26
+ [error_type_enum_1.MonitorErrorType.VALIDATION_FAILED]: [always, request, neighbours, release],
27
+ [error_type_enum_1.MonitorErrorType.PERMISSION_DENIED]: [always, request, neighbours],
28
+ [error_type_enum_1.MonitorErrorType.NOT_FOUND]: [always, request, release],
29
+ [error_type_enum_1.MonitorErrorType.RATE_LIMITED]: [always, stats, request],
30
+ [error_type_enum_1.MonitorErrorType.RESOURCE_EXHAUSTED]: [
31
+ always,
32
+ stats,
33
+ release,
34
+ { block: OCCURRENCES, reason: report_block_reason_enum_1.ReportBlockReason.SHOWS_SATURATION_PATTERN },
35
+ ],
36
+ [error_type_enum_1.MonitorErrorType.SERIALIZATION]: [always, request, neighbours, release],
37
+ [error_type_enum_1.MonitorErrorType.CONFIGURATION]: [always, release, stats],
38
+ [error_type_enum_1.MonitorErrorType.UNKNOWN]: [always, request, release, stats, neighbours],
39
+ };
40
+ const suggestReportBlocks = (input) => {
41
+ const regression = input.status === error_group_status_enum_1.ErrorGroupStatus.REGRESSED || input.currentReleaseIsFirst;
42
+ return exports.REPORT_BLOCK_SUGGESTIONS[input.errorType]
43
+ .filter(({ block }) => input.availability[block] === report_block_availability_enum_1.ReportBlockAvailability.AVAILABLE)
44
+ .map(({ block, reason }) => ({
45
+ block,
46
+ reason: block === RELEASE && regression ? report_block_reason_enum_1.ReportBlockReason.REGRESSION_DETECTED : reason,
47
+ }))
48
+ .sort((left, right) => monitor_report_block_enum_1.MONITOR_REPORT_BLOCK_ORDER.indexOf(left.block) -
49
+ monitor_report_block_enum_1.MONITOR_REPORT_BLOCK_ORDER.indexOf(right.block));
50
+ };
51
+ exports.suggestReportBlocks = suggestReportBlocks;
52
+ const estimateTokens = (text) => Math.ceil(text.length / 4);
53
+ exports.estimateTokens = estimateTokens;
54
+ //# sourceMappingURL=report-optimizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-optimizer.js","sourceRoot":"","sources":["../../../src/utils/error-report/report-optimizer.ts"],"names":[],"mappings":";;;AAAA,sFAA4E;AAC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AC,mBAAmB,CAAC,CAAC,CAAC,MAAM;KACzF,CAAC,CAAC;SACF,IAAI,CACH,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,sDAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9C,sDAA0B,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAClD,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,mBAAmB,uBAa9B;AAGK,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAAtE,QAAA,cAAc,kBAAwD"}
@@ -0,0 +1 @@
1
+ export declare const passesIbanCheck: (compact: string) => boolean;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.passesIbanCheck = void 0;
4
+ const IBAN_SHAPE = /^[A-Z]{2}\d{2}[A-Z0-9]{11,30}$/;
5
+ const passesIbanCheck = (compact) => {
6
+ const iban = compact.toUpperCase();
7
+ if (!IBAN_SHAPE.test(iban))
8
+ return false;
9
+ const rearranged = iban.slice(4) + iban.slice(0, 4);
10
+ let remainder = 0;
11
+ for (const char of rearranged) {
12
+ const code = char.charCodeAt(0);
13
+ remainder =
14
+ code <= 57 ? (remainder * 10 + (code - 48)) % 97 : (remainder * 100 + (code - 55)) % 97;
15
+ }
16
+ return remainder === 1;
17
+ };
18
+ exports.passesIbanCheck = passesIbanCheck;
19
+ //# sourceMappingURL=iban.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iban.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/iban.ts"],"names":[],"mappings":";;;AACA,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAM7C,MAAM,eAAe,GAAG,CAAC,OAAe,EAAW,EAAE;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAEhC,SAAS;YACP,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAC5F,CAAC;IACD,OAAO,SAAS,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B"}
@@ -0,0 +1 @@
1
+ export * from './redact-for-export';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./redact-for-export"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
@@ -0,0 +1 @@
1
+ export declare const passesLuhn: (digits: string) => boolean;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.passesLuhn = void 0;
4
+ const passesLuhn = (digits) => {
5
+ if (!/^\d+$/.test(digits))
6
+ return false;
7
+ let sum = 0;
8
+ let double = false;
9
+ for (let index = digits.length - 1; index >= 0; index -= 1) {
10
+ let digit = digits.charCodeAt(index) - 48;
11
+ if (double) {
12
+ digit *= 2;
13
+ if (digit > 9)
14
+ digit -= 9;
15
+ }
16
+ sum += digit;
17
+ double = !double;
18
+ }
19
+ return sum % 10 === 0;
20
+ };
21
+ exports.passesLuhn = passesLuhn;
22
+ //# sourceMappingURL=luhn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"luhn.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/luhn.ts"],"names":[],"mappings":";;;AACO,MAAM,UAAU,GAAG,CAAC,MAAc,EAAW,EAAE;IACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC3D,IAAI,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAC1C,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,IAAI,CAAC,CAAC;YACX,IAAI,KAAK,GAAG,CAAC;gBAAE,KAAK,IAAI,CAAC,CAAC;QAC5B,CAAC;QACD,GAAG,IAAI,KAAK,CAAC;QACb,MAAM,GAAG,CAAC,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAdW,QAAA,UAAU,cAcrB"}
@@ -0,0 +1,3 @@
1
+ import { MonitorTextLocale } from '../../texts/error-type-texts';
2
+ import { ExportRemovalReason } from '../../types/enum/export-removal-reason.enum';
3
+ export declare const replaceExportPatterns: (text: string, locale: MonitorTextLocale, onRemoval: (reason: ExportRemovalReason) => void) => string;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceExportPatterns = void 0;
4
+ const report_texts_1 = require("../../texts/report-texts");
5
+ const export_removal_reason_enum_1 = require("../../types/enum/export-removal-reason.enum");
6
+ const iban_1 = require("./iban");
7
+ const luhn_1 = require("./luhn");
8
+ const EXPORT_EMAIL_PLACEHOLDER = '<email>';
9
+ const EXPORT_IP_PLACEHOLDER = '<ip>';
10
+ const whole = (match) => match.length;
11
+ const digitCount = (match) => match.replace(/\D/g, '').length;
12
+ const acceptBearer = (match) => {
13
+ const token = match.replace(/^\S+\s+/, '');
14
+ return token.length >= 6 && (/[0-9._~+/=-]/.test(token) || token.length >= 20) ? match.length : 0;
15
+ };
16
+ const acceptCard = (match) => (0, luhn_1.passesLuhn)(match.replace(/\D/g, '')) ? match.length : 0;
17
+ const acceptIban = (match) => {
18
+ const parts = match.split(' ');
19
+ for (let kept = parts.length; kept >= 1; kept -= 1) {
20
+ const candidate = parts.slice(0, kept).join(' ');
21
+ if ((0, iban_1.passesIbanCheck)(candidate.replace(/ /g, '')))
22
+ return candidate.length;
23
+ }
24
+ return 0;
25
+ };
26
+ const acceptPhone = (match) => {
27
+ const digits = digitCount(match);
28
+ return digits >= 9 && digits <= 15 ? match.length : 0;
29
+ };
30
+ const HEX_GROUP = /^[0-9A-Fa-f]{1,4}$/;
31
+ const hexGroups = (part) => {
32
+ if (part === '')
33
+ return [];
34
+ const groups = part.split(':');
35
+ return groups.every((group) => HEX_GROUP.test(group)) ? groups : null;
36
+ };
37
+ const acceptIpv6 = (match) => {
38
+ if (!/[0-9A-Fa-f]/.test(match) || match.includes(':::'))
39
+ return 0;
40
+ const halves = match.split('::');
41
+ if (halves.length > 2)
42
+ return 0;
43
+ const groups = halves.map(hexGroups);
44
+ if (groups.some((group) => group === null))
45
+ return 0;
46
+ const total = groups.reduce((sum, group) => sum + group.length, 0);
47
+ const valid = halves.length === 1 ? total === 8 : total <= 7;
48
+ return valid ? match.length : 0;
49
+ };
50
+ const OCTET = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)';
51
+ const EXPORT_TEXT_PATTERNS = [
52
+ {
53
+ reason: export_removal_reason_enum_1.ExportRemovalReason.BEARER,
54
+ regex: /(?<![A-Za-z0-9])(?:bearer|basic)[ \t]+[A-Za-z0-9\-._~+/]+=*/gi,
55
+ accept: acceptBearer,
56
+ },
57
+ {
58
+ reason: export_removal_reason_enum_1.ExportRemovalReason.JWT,
59
+ regex: /(?<![A-Za-z0-9_-])eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
60
+ accept: whole,
61
+ },
62
+ {
63
+ reason: export_removal_reason_enum_1.ExportRemovalReason.EMAIL,
64
+ regex: /(?<![A-Za-z0-9._%+-])[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,
65
+ accept: whole,
66
+ },
67
+ {
68
+ reason: export_removal_reason_enum_1.ExportRemovalReason.IBAN,
69
+ regex: /(?<![A-Za-z0-9])[A-Za-z]{2}\d{2}(?:(?: [A-Za-z0-9]{4}){2,7}(?: [A-Za-z0-9]{1,3})?|[A-Za-z0-9]{11,30})(?![A-Za-z0-9])/g,
70
+ accept: acceptIban,
71
+ },
72
+ {
73
+ reason: export_removal_reason_enum_1.ExportRemovalReason.CARD_NUMBER,
74
+ regex: /(?<![\w+.-]|\d[ -])\d(?:[ -]?\d){12,18}(?!\w|[ -]\d)/g,
75
+ accept: acceptCard,
76
+ },
77
+ {
78
+ reason: export_removal_reason_enum_1.ExportRemovalReason.PHONE,
79
+ regex: /(?<![\w+.-]|\d[ .-])(?:\+\d(?:[ .-]?\d){8,14}|0\d(?:[ .-]?\d){7,13})(?!\w|[ .-]\d)/g,
80
+ accept: acceptPhone,
81
+ },
82
+ {
83
+ reason: export_removal_reason_enum_1.ExportRemovalReason.IP,
84
+ regex: new RegExp(`(?<![\\w.])(?:${OCTET}\\.){3}${OCTET}(?!\\w|\\.\\d)`, 'g'),
85
+ accept: whole,
86
+ },
87
+ {
88
+ reason: export_removal_reason_enum_1.ExportRemovalReason.IP,
89
+ regex: /(?<![\w:.])(?:[0-9A-Fa-f]{0,4}:){2,7}[0-9A-Fa-f]{0,4}(?![\w:])/g,
90
+ accept: acceptIpv6,
91
+ },
92
+ ];
93
+ const replacementOf = (reason, locale) => {
94
+ if (reason === export_removal_reason_enum_1.ExportRemovalReason.EMAIL)
95
+ return EXPORT_EMAIL_PLACEHOLDER;
96
+ if (reason === export_removal_reason_enum_1.ExportRemovalReason.IP)
97
+ return EXPORT_IP_PLACEHOLDER;
98
+ const texts = report_texts_1.MONITOR_REPORT_TEXTS[locale];
99
+ return texts.removedValue(texts.removalLabels[reason]);
100
+ };
101
+ const replaceExportPatterns = (text, locale, onRemoval) => EXPORT_TEXT_PATTERNS.reduce((current, pattern) => current.replace(pattern.regex, (match) => {
102
+ const length = pattern.accept(match);
103
+ if (length === 0)
104
+ return match;
105
+ onRemoval(pattern.reason);
106
+ return replacementOf(pattern.reason, locale) + match.slice(length);
107
+ }), text);
108
+ exports.replaceExportPatterns = replaceExportPatterns;
109
+ //# sourceMappingURL=patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/patterns.ts"],"names":[],"mappings":";;;AAAA,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E,KAAK;KACd;IACD;QACE,MAAM,EAAE,gDAAmB,CAAC,EAAE;QAC9B,KAAK,EAAE,iEAAiE;QACxE,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,MAA2B,EAAE,MAAyB,EAAU,EAAE;IACvF,IAAI,MAAM,KAAK,gDAAmB,CAAC,KAAK;QAAE,OAAO,wBAAwB,CAAC;IAC1E,IAAI,MAAM,KAAK,gDAAmB,CAAC,EAAE;QAAE,OAAO,qBAAqB,CAAC;IACpE,MAAM,KAAK,GAAG,mCAAoB,CAAC,MAAM,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC,CAAC;AAMK,MAAM,qBAAqB,GAAG,CACnC,IAAY,EACZ,MAAyB,EACzB,SAAgD,EACxC,EAAE,CACV,oBAAoB,CAAC,MAAM,CACzB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CACnB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/B,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC,CAAC,EACJ,IAAI,CACL,CAAC;AAdS,QAAA,qBAAqB,yBAc9B"}
@@ -0,0 +1,26 @@
1
+ import { MonitorTextLocale } from '../../texts/error-type-texts';
2
+ import { ExportRemovalReason } from '../../types/enum/export-removal-reason.enum';
3
+ export declare const EXPORT_MAX_DEPTH = 16;
4
+ export declare const EXPORT_REMOVAL_PATH_MAX_LENGTH = 120;
5
+ export declare const EXPORT_HEADER_ALLOWLIST: readonly string[];
6
+ export declare const EXPORT_CREDENTIAL_KEY_SUFFIXES: readonly string[];
7
+ export declare const EXPORT_CREDENTIAL_KEY_WORDS: ReadonlySet<string>;
8
+ export interface IExportRemoval {
9
+ path: string;
10
+ reason: ExportRemovalReason;
11
+ count: number;
12
+ }
13
+ export declare const isExportCredentialKey: (key: string) => boolean;
14
+ export declare const redactForExport: (value: unknown, path: string, locale: MonitorTextLocale) => {
15
+ value: unknown;
16
+ removals: IExportRemoval[];
17
+ };
18
+ export declare const redactTextForExport: (text: string, path: string, locale: MonitorTextLocale) => {
19
+ text: string;
20
+ removals: IExportRemoval[];
21
+ };
22
+ export declare const redactHeadersForExport: (headers: Record<string, string> | null, path: string, locale: MonitorTextLocale) => {
23
+ value: Record<string, string> | null;
24
+ removals: IExportRemoval[];
25
+ };
26
+ export declare const mergeRemovals: (lists: IExportRemoval[][]) => IExportRemoval[];
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeRemovals = exports.redactHeadersForExport = exports.redactTextForExport = exports.redactForExport = exports.isExportCredentialKey = exports.EXPORT_CREDENTIAL_KEY_WORDS = exports.EXPORT_CREDENTIAL_KEY_SUFFIXES = exports.EXPORT_HEADER_ALLOWLIST = exports.EXPORT_REMOVAL_PATH_MAX_LENGTH = exports.EXPORT_MAX_DEPTH = void 0;
4
+ const report_texts_1 = require("../../texts/report-texts");
5
+ const export_removal_reason_enum_1 = require("../../types/enum/export-removal-reason.enum");
6
+ const body_redaction_1 = require("../body-redaction");
7
+ const patterns_1 = require("./patterns");
8
+ exports.EXPORT_MAX_DEPTH = 16;
9
+ exports.EXPORT_REMOVAL_PATH_MAX_LENGTH = 120;
10
+ exports.EXPORT_HEADER_ALLOWLIST = [
11
+ 'content-type',
12
+ 'content-length',
13
+ 'accept',
14
+ 'user-agent',
15
+ 'x-request-id',
16
+ ];
17
+ exports.EXPORT_CREDENTIAL_KEY_SUFFIXES = ['iban', 'cvv', 'cvc', 'ssn'];
18
+ exports.EXPORT_CREDENTIAL_KEY_WORDS = new Set(['card', 'pan']);
19
+ const TRAILING_QUALIFIER = /(?:number)?\d*$/;
20
+ const normalizedStem = (key) => key
21
+ .toLowerCase()
22
+ .replace(/[_\-\s.]/g, '')
23
+ .replace(TRAILING_QUALIFIER, '');
24
+ const lastWord = (key) => {
25
+ const words = key
26
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
27
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
28
+ .replace(/([A-Za-z])(\d)/g, '$1 $2')
29
+ .split(/[^A-Za-z0-9]+/)
30
+ .map((word) => word.toLowerCase())
31
+ .filter((word) => word !== '');
32
+ while (words.length > 0 && /^(?:\d+|number)$/.test(words[words.length - 1]))
33
+ words.pop();
34
+ return words[words.length - 1];
35
+ };
36
+ const isExportCredentialKey = (key) => {
37
+ if ((0, body_redaction_1.isCredentialBodyKey)(key, body_redaction_1.CapturedBodySide.REQUEST))
38
+ return true;
39
+ const stem = normalizedStem(key);
40
+ if (exports.EXPORT_CREDENTIAL_KEY_SUFFIXES.some((suffix) => stem.endsWith(suffix)))
41
+ return true;
42
+ const word = lastWord(key);
43
+ return word !== undefined && exports.EXPORT_CREDENTIAL_KEY_WORDS.has(word);
44
+ };
45
+ exports.isExportCredentialKey = isExportCredentialKey;
46
+ const safePath = (path, locale) => {
47
+ const redacted = (0, patterns_1.replaceExportPatterns)(path, locale, () => undefined);
48
+ return redacted.length > exports.EXPORT_REMOVAL_PATH_MAX_LENGTH
49
+ ? `${redacted.slice(0, exports.EXPORT_REMOVAL_PATH_MAX_LENGTH - 1)}…`
50
+ : redacted;
51
+ };
52
+ class RemovalCollector {
53
+ constructor() {
54
+ this.byKey = new Map();
55
+ }
56
+ add(path, reason, count) {
57
+ if (count <= 0)
58
+ return;
59
+ const key = `${reason}\u0000${path}`;
60
+ const existing = this.byKey.get(key);
61
+ if (existing) {
62
+ existing.count += count;
63
+ return;
64
+ }
65
+ this.byKey.set(key, { path, reason, count });
66
+ }
67
+ list() {
68
+ return [...this.byKey.values()].map((removal) => ({ ...removal }));
69
+ }
70
+ }
71
+ const removedValue = (reason, locale) => {
72
+ const texts = report_texts_1.MONITOR_REPORT_TEXTS[locale];
73
+ return texts.removedValue(texts.removalLabels[reason]);
74
+ };
75
+ const remove = (reason, path, context) => {
76
+ context.collector.add(safePath(path, context.locale), reason, 1);
77
+ return removedValue(reason, context.locale);
78
+ };
79
+ const redactText = (text, path, context) => {
80
+ const counts = new Map();
81
+ const redacted = (0, patterns_1.replaceExportPatterns)(text, context.locale, (reason) => {
82
+ counts.set(reason, (counts.get(reason) ?? 0) + 1);
83
+ });
84
+ if (counts.size > 0) {
85
+ const where = safePath(path, context.locale);
86
+ for (const [reason, count] of counts)
87
+ context.collector.add(where, reason, count);
88
+ }
89
+ return redacted;
90
+ };
91
+ const joinKey = (path, key) => (path === '' ? key : `${path}.${key}`);
92
+ const defineKey = (target, key, value) => {
93
+ let name = key;
94
+ for (let rank = 2; Object.prototype.hasOwnProperty.call(target, name); rank += 1) {
95
+ name = `${key} (${rank})`;
96
+ }
97
+ Object.defineProperty(target, name, {
98
+ value,
99
+ enumerable: true,
100
+ writable: true,
101
+ configurable: true,
102
+ });
103
+ };
104
+ const walk = (value, path, depth, ancestors, context) => {
105
+ if (value === null || value === undefined || typeof value === 'boolean')
106
+ return value;
107
+ if (typeof value === 'string')
108
+ return redactText(value, path, context);
109
+ if (typeof value === 'number') {
110
+ if (!Number.isSafeInteger(value))
111
+ return value;
112
+ const asText = value.toString();
113
+ const redacted = redactText(asText, path, context);
114
+ return redacted === asText ? value : redacted;
115
+ }
116
+ if (typeof value !== 'object')
117
+ return remove(export_removal_reason_enum_1.ExportRemovalReason.DEPTH, path, context);
118
+ if (value instanceof Date)
119
+ return value;
120
+ if (depth > exports.EXPORT_MAX_DEPTH || ancestors.has(value)) {
121
+ return remove(export_removal_reason_enum_1.ExportRemovalReason.DEPTH, path, context);
122
+ }
123
+ ancestors.add(value);
124
+ try {
125
+ if (Array.isArray(value)) {
126
+ return value.map((item, index) => walk(item, `${path}[${index}]`, depth + 1, ancestors, context));
127
+ }
128
+ const safe = {};
129
+ for (const [key, item] of Object.entries(value)) {
130
+ const childPath = joinKey(path, key);
131
+ const safeKey = redactText(key, path, context);
132
+ const safeValue = (0, exports.isExportCredentialKey)(key)
133
+ ? remove(export_removal_reason_enum_1.ExportRemovalReason.CREDENTIAL_KEY, childPath, context)
134
+ : walk(item, childPath, depth + 1, ancestors, context);
135
+ defineKey(safe, safeKey, safeValue);
136
+ }
137
+ return safe;
138
+ }
139
+ finally {
140
+ ancestors.delete(value);
141
+ }
142
+ };
143
+ const redactForExport = (value, path, locale) => {
144
+ const context = { locale, collector: new RemovalCollector() };
145
+ const redacted = walk(value, path, 1, new Set(), context);
146
+ return { value: redacted, removals: context.collector.list() };
147
+ };
148
+ exports.redactForExport = redactForExport;
149
+ const redactTextForExport = (text, path, locale) => {
150
+ const context = { locale, collector: new RemovalCollector() };
151
+ const redacted = redactText(text, path, context);
152
+ return { text: redacted, removals: context.collector.list() };
153
+ };
154
+ exports.redactTextForExport = redactTextForExport;
155
+ const redactHeadersForExport = (headers, path, locale) => {
156
+ if (headers === null)
157
+ return { value: null, removals: [] };
158
+ const context = { locale, collector: new RemovalCollector() };
159
+ const safe = {};
160
+ for (const [name, headerValue] of Object.entries(headers)) {
161
+ const childPath = joinKey(path, name);
162
+ const safeName = redactText(name, path, context);
163
+ let safeValue;
164
+ if (!exports.EXPORT_HEADER_ALLOWLIST.includes(name.toLowerCase())) {
165
+ safeValue = remove(export_removal_reason_enum_1.ExportRemovalReason.HEADER, childPath, context);
166
+ }
167
+ else if (typeof headerValue !== 'string') {
168
+ safeValue = remove(export_removal_reason_enum_1.ExportRemovalReason.DEPTH, childPath, context);
169
+ }
170
+ else {
171
+ safeValue = redactText(headerValue, childPath, context);
172
+ }
173
+ defineKey(safe, safeName, safeValue);
174
+ }
175
+ return { value: safe, removals: context.collector.list() };
176
+ };
177
+ exports.redactHeadersForExport = redactHeadersForExport;
178
+ const mergeRemovals = (lists) => {
179
+ const collector = new RemovalCollector();
180
+ for (const list of lists) {
181
+ for (const removal of list)
182
+ collector.add(removal.path, removal.reason, removal.count);
183
+ }
184
+ return collector.list();
185
+ };
186
+ exports.mergeRemovals = mergeRemovals;
187
+ //# sourceMappingURL=redact-for-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact-for-export.js","sourceRoot":"","sources":["../../../src/utils/export-redaction/redact-for-export.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,4FAAkF;AAClF,sDAA0E;AAC1E,yCAAmD;AAGtC,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAGtB,QAAA,8BAA8B,GAAG,GAAG,CAAC;AAMrC,QAAA,uBAAuB,GAAsB;IACxD,cAAc;IACd,gBAAgB;IAChB,QAAQ;IACR,YAAY;IACZ,cAAc;CACf,CAAC;AAMW,QAAA,8BAA8B,GAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAMlF,QAAA,2BAA2B,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAczF,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE,CAC7C,GAAG;KACA,WAAW,EAAE;KACb,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;KACxB,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AAErC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAsB,EAAE;IACnD,MAAM,KAAK,GAAG,GAAG;SACd,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;SACzC,OAAO,CAAC,iBAAiB,EAAE,OA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,OAAO,CAAC,CAAC;QACjD,IAAI,SAAiB,CAAC;QACtB,IAAI,CAAC,+BAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YAC1D,SAAS,GAAG,MAAM,CAAC,gDAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;aAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;YAE3C,SAAS,GAAG,MAAM,CAAC,gDAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;AAC7D,CAAC,CAAC;AAvBW,QAAA,sBAAsB,0BAuBjC;AAGK,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAoB,EAAE;IAC3E,MAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,OAAO,IAAI,IAAI;YAAE,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
@@ -10,3 +10,5 @@ export * from './body-redaction';
10
10
  export * from './node-require';
11
11
  export * from './release.utils';
12
12
  export * from './error-fingerprint';
13
+ export * from './export-redaction';
14
+ export * from './error-report';
@@ -26,4 +26,6 @@ __exportStar(require("./body-redaction"), exports);
26
26
  __exportStar(require("./node-require"), exports);
27
27
  __exportStar(require("./release.utils"), exports);
28
28
  __exportStar(require("./error-fingerprint"), exports);
29
+ __exportStar(require("./export-redaction"), exports);
30
+ __exportStar(require("./error-report"), exports);
29
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8DAA4C;AAC5C,+CAA6B;AAC7B,+DAA6C;AAC7C,0DAAwC;AACxC,4DAA0C;AAC1C,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC;AAChC,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8DAA4C;AAC5C,+CAA6B;AAC7B,+DAA6C;AAC7C,0DAAwC;AACxC,4DAA0C;AAC1C,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC;AAChC,sDAAoC;AACpC,qDAAmC;AACnC,iDAA+B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "9.3.0",
3
+ "version": "9.4.1",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -52,6 +52,7 @@
52
52
  "eslint-plugin-node": "^11.1.0",
53
53
  "eslint-plugin-prettier": "^3.4.0",
54
54
  "eslint-plugin-promise": "^5.1.0",
55
+ "intl-messageformat": "10.7.7",
55
56
  "ioredis-mock": "^8.13.1",
56
57
  "jest": "^29.7.0",
57
58
  "prettier": "2.3.1",