@naturalcycles/nodejs-lib 15.107.0 → 15.107.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.
@@ -117,7 +117,7 @@ export class SlackService {
117
117
  * Returns a CommonLogger implementation based on this SlackService instance.
118
118
  */
119
119
  getCommonLogger(opt) {
120
- const { minLogLevel = 'log', debugChannel, logChannel, warnChannel, errorChannel } = opt;
120
+ const { minLogLevel, debugChannel, logChannel, warnChannel, errorChannel } = opt;
121
121
  const defaultChannel = this.cfg.defaults?.channel || DEFAULTS.channel;
122
122
  const q = new PQueue({
123
123
  concurrency: 1,
@@ -1187,11 +1187,15 @@ function executeValidation(fn, builtSchema, input, opt = {}, defaultInputName) {
1187
1187
  // the error message Input would contain already mutated object print, such as Input: {}
1188
1188
  // Unless `getOriginalInput` function is provided - then it will be used to preserve the Input pureness.
1189
1189
  const inputStringified = _inspect(opt.getOriginalInput?.() || input, { maxLen: 4000 });
1190
+ // fingerprint is captured before appending the dynamic Input snippet,
1191
+ // so we can group repeated validation errors by rule rather than by unique request content.
1192
+ const fingerprint = message;
1190
1193
  message = [message, 'Input: ' + inputStringified].join(separator);
1191
1194
  const err = new AjvValidationError(message, _filterNullishValues({
1192
1195
  errors,
1193
1196
  inputName,
1194
1197
  inputId,
1198
+ fingerprint,
1195
1199
  }));
1196
1200
  return [err, output];
1197
1201
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
3
  "type": "module",
4
- "version": "15.107.0",
4
+ "version": "15.107.1",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@standard-schema/spec": "^1",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@typescript/native-preview": "7.0.0-dev.20260401.1",
21
- "@naturalcycles/dev-lib": "20.42.0"
21
+ "@naturalcycles/dev-lib": "18.4.2"
22
22
  },
23
23
  "exports": {
24
24
  ".": "./dist/index.js",
@@ -156,7 +156,7 @@ export class SlackService<CTX = any> {
156
156
  warnChannel?: string
157
157
  errorChannel?: string
158
158
  }): CommonLogger {
159
- const { minLogLevel = 'log', debugChannel, logChannel, warnChannel, errorChannel } = opt
159
+ const { minLogLevel, debugChannel, logChannel, warnChannel, errorChannel } = opt
160
160
  const defaultChannel = this.cfg.defaults?.channel || DEFAULTS.channel!
161
161
 
162
162
  const q = new PQueue({
@@ -1703,6 +1703,9 @@ function executeValidation<OUT>(
1703
1703
  // the error message Input would contain already mutated object print, such as Input: {}
1704
1704
  // Unless `getOriginalInput` function is provided - then it will be used to preserve the Input pureness.
1705
1705
  const inputStringified = _inspect(opt.getOriginalInput?.() || input, { maxLen: 4000 })
1706
+ // fingerprint is captured before appending the dynamic Input snippet,
1707
+ // so we can group repeated validation errors by rule rather than by unique request content.
1708
+ const fingerprint = message
1706
1709
  message = [message, 'Input: ' + inputStringified].join(separator)
1707
1710
 
1708
1711
  const err = new AjvValidationError(
@@ -1711,6 +1714,7 @@ function executeValidation<OUT>(
1711
1714
  errors,
1712
1715
  inputName,
1713
1716
  inputId,
1717
+ fingerprint,
1714
1718
  }),
1715
1719
  )
1716
1720
  return [err, output]