@futdevpro/nts-dynamo 1.14.65 → 1.14.68

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 (31) hide show
  1. package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.d.ts +1 -1
  2. package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.d.ts.map +1 -1
  3. package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.js +3 -2
  4. package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.js.map +1 -1
  5. package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.d.ts +2 -0
  6. package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.d.ts.map +1 -0
  7. package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.js +294 -0
  8. package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.js.map +1 -0
  9. package/build/_services/base/data.service.d.ts +2 -2
  10. package/build/_services/base/data.service.d.ts.map +1 -1
  11. package/build/_services/base/data.service.js +10 -3
  12. package/build/_services/base/data.service.js.map +1 -1
  13. package/build/_services/base/singleton.service.d.ts +1 -1
  14. package/build/_services/base/singleton.service.d.ts.map +1 -1
  15. package/build/_services/base/singleton.service.js +3 -2
  16. package/build/_services/base/singleton.service.js.map +1 -1
  17. package/build/_services/core/email.service.d.ts +1 -1
  18. package/build/_services/core/email.service.d.ts.map +1 -1
  19. package/build/_services/core/email.service.js +3 -2
  20. package/build/_services/core/email.service.js.map +1 -1
  21. package/build/_services/core/global.service.d.ts +1 -1
  22. package/build/_services/core/global.service.d.ts.map +1 -1
  23. package/build/_services/core/global.service.js +3 -2
  24. package/build/_services/core/global.service.js.map +1 -1
  25. package/package.json +4 -4
  26. package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.ts +3 -1
  27. package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.ts +393 -0
  28. package/src/_services/base/data.service.ts +16 -5
  29. package/src/_services/base/singleton.service.ts +3 -1
  30. package/src/_services/core/email.service.ts +4 -2
  31. package/src/_services/core/global.service.ts +4 -2
@@ -0,0 +1,393 @@
1
+ import { LVS_Search_Mode } from '../_enums/lvs-search-mode.enum';
2
+ import { LVS_SearchResult } from '../_models/lvs-search-result.interface';
3
+ import { LVS_VectorPool_ControlService } from './lvs-vector-pool.control-service';
4
+
5
+ describe('| LVS_VectorPool_ControlService', () => {
6
+ let vectorPool: LVS_VectorPool_ControlService;
7
+
8
+ beforeEach(() => {
9
+ vectorPool = new LVS_VectorPool_ControlService();
10
+ });
11
+
12
+ describe('| Constructor/Initialization', () => {
13
+ it('| should initialize with empty pools', () => {
14
+ const all: Map<string, number[]> = vectorPool.getAll();
15
+ expect(all.size).toBe(0);
16
+ });
17
+ });
18
+
19
+ describe('| addVector', () => {
20
+ it('| should add a valid vector to the pool', () => {
21
+ const id: string = 'vector1';
22
+ const vector: number[] = [1, 2, 3];
23
+
24
+ vectorPool.addVector(id, vector);
25
+
26
+ const all: Map<string, number[]> = vectorPool.getAll();
27
+ expect(all.size).toBe(1);
28
+ expect(all.has(id)).toBeTrue();
29
+ expect(all.get(id)).toEqual(vector);
30
+ });
31
+
32
+ it('| should add multiple vectors to the pool', () => {
33
+ vectorPool.addVector('vector1', [1, 2, 3]);
34
+ vectorPool.addVector('vector2', [4, 5, 6]);
35
+ vectorPool.addVector('vector3', [7, 8, 9]);
36
+
37
+ const all: Map<string, number[]> = vectorPool.getAll();
38
+ expect(all.size).toBe(3);
39
+ });
40
+
41
+ it('| should throw error when ID is empty string', () => {
42
+ expect(() => {
43
+ vectorPool.addVector('', [1, 2, 3]);
44
+ }).toThrowError('Vector ID is required');
45
+ });
46
+
47
+ it('| should throw error when vector is empty array', () => {
48
+ expect(() => {
49
+ vectorPool.addVector('vector1', []);
50
+ }).toThrowError('Vector must be a non-empty array');
51
+ });
52
+
53
+ it('| should throw error when vector is not an array', () => {
54
+ expect(() => {
55
+ vectorPool.addVector('vector1', null as any);
56
+ }).toThrowError('Vector must be a non-empty array');
57
+ });
58
+
59
+ it('| should throw error when vector contains non-finite number', () => {
60
+ expect(() => {
61
+ vectorPool.addVector('vector1', [1, 2, Infinity]);
62
+ }).toThrowError('Vector must contain only finite numbers at index 2');
63
+ });
64
+
65
+ it('| should throw error when vector contains NaN', () => {
66
+ expect(() => {
67
+ vectorPool.addVector('vector1', [1, 2, NaN]);
68
+ }).toThrowError('Vector must contain only finite numbers at index 2');
69
+ });
70
+
71
+ it('| should store normalized vector internally', () => {
72
+ const id: string = 'vector1';
73
+ const vector: number[] = [3, 4]; // Magnitude = 5, normalized = [0.6, 0.8]
74
+
75
+ vectorPool.addVector(id, vector);
76
+
77
+ // Verify original vector is stored
78
+ const all: Map<string, number[]> = vectorPool.getAll();
79
+ expect(all.get(id)).toEqual(vector);
80
+ });
81
+ });
82
+
83
+ describe('| removeVector', () => {
84
+ it('| should remove an existing vector from the pool', () => {
85
+ vectorPool.addVector('vector1', [1, 2, 3]);
86
+ vectorPool.addVector('vector2', [4, 5, 6]);
87
+
88
+ vectorPool.removeVector('vector1');
89
+
90
+ const all: Map<string, number[]> = vectorPool.getAll();
91
+ expect(all.size).toBe(1);
92
+ expect(all.has('vector1')).toBeFalse();
93
+ expect(all.has('vector2')).toBeTrue();
94
+ });
95
+
96
+ it('| should not throw when removing non-existent vector', () => {
97
+ expect(() => {
98
+ vectorPool.removeVector('non-existent');
99
+ }).not.toThrow();
100
+ });
101
+
102
+ it('| should remove vector from both pools', () => {
103
+ vectorPool.addVector('vector1', [1, 2, 3]);
104
+ vectorPool.removeVector('vector1');
105
+
106
+ const all: Map<string, number[]> = vectorPool.getAll();
107
+ expect(all.size).toBe(0);
108
+ });
109
+ });
110
+
111
+ describe('| updateVector', () => {
112
+ it('| should update an existing vector', () => {
113
+ vectorPool.addVector('vector1', [1, 2, 3]);
114
+ const newVector: number[] = [4, 5, 6];
115
+
116
+ vectorPool.updateVector('vector1', newVector);
117
+
118
+ const all: Map<string, number[]> = vectorPool.getAll();
119
+ expect(all.get('vector1')).toEqual(newVector);
120
+ });
121
+
122
+ it('| should throw error when updating non-existent vector', () => {
123
+ expect(() => {
124
+ vectorPool.updateVector('non-existent', [1, 2, 3]);
125
+ }).toThrowError('Vector with ID "non-existent" does not exist');
126
+ });
127
+ });
128
+
129
+ describe('| clearPool', () => {
130
+ it('| should clear a populated pool', () => {
131
+ vectorPool.addVector('vector1', [1, 2, 3]);
132
+ vectorPool.addVector('vector2', [4, 5, 6]);
133
+ vectorPool.addVector('vector3', [7, 8, 9]);
134
+
135
+ vectorPool.clearPool();
136
+
137
+ const all: Map<string, number[]> = vectorPool.getAll();
138
+ expect(all.size).toBe(0);
139
+ });
140
+
141
+ it('| should not throw when clearing empty pool', () => {
142
+ expect(() => {
143
+ vectorPool.clearPool();
144
+ }).not.toThrow();
145
+ });
146
+ });
147
+
148
+ describe('| getAll', () => {
149
+ it('| should return a copy of the pool, not a reference', () => {
150
+ vectorPool.addVector('vector1', [1, 2, 3]);
151
+ const all1: Map<string, number[]> = vectorPool.getAll();
152
+ const all2: Map<string, number[]> = vectorPool.getAll();
153
+
154
+ expect(all1).not.toBe(all2);
155
+ expect(all1.size).toBe(all2.size);
156
+ });
157
+
158
+ it('| should return empty map when pool is empty', () => {
159
+ const all: Map<string, number[]> = vectorPool.getAll();
160
+ expect(all.size).toBe(0);
161
+ });
162
+ });
163
+
164
+ describe('| cosineSimilarity (static)', () => {
165
+ it('| should return 1 for identical vectors', () => {
166
+ const vector: number[] = [1, 2, 3];
167
+ const similarity: number = LVS_VectorPool_ControlService.cosineSimilarity(vector, vector);
168
+ expect(similarity).toBeCloseTo(1, 10);
169
+ });
170
+
171
+ it('| should return approximately 0 for orthogonal vectors', () => {
172
+ const vector1: number[] = [1, 0, 0];
173
+ const vector2: number[] = [0, 1, 0];
174
+ const similarity: number =
175
+ LVS_VectorPool_ControlService.cosineSimilarity(vector1, vector2);
176
+ expect(similarity).toBeCloseTo(0, 10);
177
+ });
178
+
179
+ it('| should throw error for vectors with different dimensions', () => {
180
+ const vector1: number[] = [1, 2, 3];
181
+ const vector2: number[] = [1, 2];
182
+
183
+ expect(() => {
184
+ LVS_VectorPool_ControlService.cosineSimilarity(vector1, vector2);
185
+ }).toThrowError('Vectors must have the same dimension. Got 3 and 2');
186
+ });
187
+
188
+ it('| should calculate correct cosine similarity for known vectors', () => {
189
+ // Two vectors pointing in similar direction
190
+ const vector1: number[] = [1, 1, 0];
191
+ const vector2: number[] = [1, 0, 0];
192
+ // Normalized: [1/√2, 1/√2, 0] and [1, 0, 0]
193
+ // Dot product: 1/√2 ≈ 0.707
194
+ const similarity: number =
195
+ LVS_VectorPool_ControlService.cosineSimilarity(vector1, vector2);
196
+ expect(similarity).toBeCloseTo(1 / Math.sqrt(2), 10);
197
+ });
198
+
199
+ it('| should handle zero vector', () => {
200
+ const vector1: number[] = [0, 0, 0];
201
+ const vector2: number[] = [1, 2, 3];
202
+ const similarity: number =
203
+ LVS_VectorPool_ControlService.cosineSimilarity(vector1, vector2);
204
+ expect(similarity).toBeCloseTo(0, 10);
205
+ });
206
+ });
207
+
208
+ describe('| l2Distance (static)', () => {
209
+ it('| should return 0 for identical vectors', () => {
210
+ const vector: number[] = [1, 2, 3];
211
+ const distance: number = LVS_VectorPool_ControlService.l2Distance(vector, vector);
212
+ expect(distance).toBe(0);
213
+ });
214
+
215
+ it('| should throw error for vectors with different dimensions', () => {
216
+ const vector1: number[] = [1, 2, 3];
217
+ const vector2: number[] = [1, 2];
218
+
219
+ expect(() => {
220
+ LVS_VectorPool_ControlService.l2Distance(vector1, vector2);
221
+ }).toThrowError('Vectors must have the same dimension. Got 3 and 2');
222
+ });
223
+
224
+ it('| should calculate correct L2 distance for known vectors', () => {
225
+ const vector1: number[] = [0, 0, 0];
226
+ const vector2: number[] = [3, 4, 0];
227
+ // Distance = √(3² + 4² + 0²) = √25 = 5
228
+ const distance: number = LVS_VectorPool_ControlService.l2Distance(vector1, vector2);
229
+ expect(distance).toBe(5);
230
+ });
231
+
232
+ it('| should calculate correct L2 distance for 1D vectors', () => {
233
+ const vector1: number[] = [5];
234
+ const vector2: number[] = [2];
235
+ const distance: number = LVS_VectorPool_ControlService.l2Distance(vector1, vector2);
236
+ expect(distance).toBe(3);
237
+ });
238
+ });
239
+
240
+ describe('| search', () => {
241
+ beforeEach(() => {
242
+ // Add test vectors
243
+ vectorPool.addVector('vec1', [1, 0, 0]);
244
+ vectorPool.addVector('vec2', [0, 1, 0]);
245
+ vectorPool.addVector('vec3', [0, 0, 1]);
246
+ vectorPool.addVector('vec4', [1, 1, 0]);
247
+ });
248
+
249
+ it('| should return empty array for empty pool', () => {
250
+ const emptyPool: LVS_VectorPool_ControlService = new LVS_VectorPool_ControlService();
251
+ const results: LVS_SearchResult[] = emptyPool.search([1, 0, 0], 3, LVS_Search_Mode.cosineSimilarity);
252
+ expect(results.length).toBe(0);
253
+ });
254
+
255
+ it('| should return results in descending order for cosine similarity', () => {
256
+ const query: number[] = [1, 0, 0];
257
+ const results: LVS_SearchResult[] = vectorPool.search(
258
+ query,
259
+ 4,
260
+ LVS_Search_Mode.cosineSimilarity
261
+ );
262
+
263
+ expect(results.length).toBe(4);
264
+ // vec1 should be most similar (identical)
265
+ expect(results[0].id).toBe('vec1');
266
+ expect(results[0].score).toBeCloseTo(1, 10);
267
+ // Results should be in descending order
268
+ for (let i: number = 0; i < results.length - 1; i++) {
269
+ expect(results[i].score).toBeGreaterThanOrEqual(results[i + 1].score);
270
+ }
271
+ });
272
+
273
+ it('| should return results in ascending order for L2 distance', () => {
274
+ const query: number[] = [1, 0, 0];
275
+ const results: LVS_SearchResult[] = vectorPool.search(
276
+ query,
277
+ 4,
278
+ LVS_Search_Mode.l2Distance
279
+ );
280
+
281
+ expect(results.length).toBe(4);
282
+ // vec1 should be closest (distance = 0)
283
+ expect(results[0].id).toBe('vec1');
284
+ expect(results[0].score).toBe(0);
285
+ // Results should be in ascending order
286
+ for (let i: number = 0; i < results.length - 1; i++) {
287
+ expect(results[i].score).toBeLessThanOrEqual(results[i + 1].score);
288
+ }
289
+ });
290
+
291
+ it('| should limit results to top-K when k < pool size', () => {
292
+ const query: number[] = [1, 0, 0];
293
+ const results: LVS_SearchResult[] = vectorPool.search(
294
+ query,
295
+ 2,
296
+ LVS_Search_Mode.cosineSimilarity
297
+ );
298
+
299
+ expect(results.length).toBe(2);
300
+ });
301
+
302
+ it('| should return all results when k > pool size', () => {
303
+ const query: number[] = [1, 0, 0];
304
+ const results: LVS_SearchResult[] = vectorPool.search(
305
+ query,
306
+ 10,
307
+ LVS_Search_Mode.cosineSimilarity
308
+ );
309
+
310
+ expect(results.length).toBe(4);
311
+ });
312
+
313
+ it('| should return all results when k = pool size', () => {
314
+ const query: number[] = [1, 0, 0];
315
+ const results: LVS_SearchResult[] = vectorPool.search(
316
+ query,
317
+ 4,
318
+ LVS_Search_Mode.cosineSimilarity
319
+ );
320
+
321
+ expect(results.length).toBe(4);
322
+ });
323
+
324
+ it('| should throw error for dimension mismatch', () => {
325
+ const query: number[] = [1, 0]; // 2D query, pool has 3D vectors
326
+
327
+ expect(() => {
328
+ vectorPool.search(query, 3, LVS_Search_Mode.cosineSimilarity);
329
+ }).toThrowError('Query vector dimension (2) does not match pool vector dimension (3)');
330
+ });
331
+
332
+ it('| should throw error for empty query vector', () => {
333
+ expect(() => {
334
+ vectorPool.search([], 3, LVS_Search_Mode.cosineSimilarity);
335
+ }).toThrowError('Query vector must be a non-empty array');
336
+ });
337
+
338
+ it('| should throw error for non-array query', () => {
339
+ expect(() => {
340
+ vectorPool.search(null as any, 3, LVS_Search_Mode.cosineSimilarity);
341
+ }).toThrowError('Query vector must be a non-empty array');
342
+ });
343
+
344
+ it('| should throw error for k = 0', () => {
345
+ expect(() => {
346
+ vectorPool.search([1, 0, 0], 0, LVS_Search_Mode.cosineSimilarity);
347
+ }).toThrowError('k must be a positive number');
348
+ });
349
+
350
+ it('| should throw error for negative k', () => {
351
+ expect(() => {
352
+ vectorPool.search([1, 0, 0], -1, LVS_Search_Mode.cosineSimilarity);
353
+ }).toThrowError('k must be a positive number');
354
+ });
355
+
356
+ it('| should throw error for unknown search mode', () => {
357
+ expect(() => {
358
+ vectorPool.search([1, 0, 0], 3, 'unknown-mode' as LVS_Search_Mode);
359
+ }).toThrowError('Unknown search mode: unknown-mode');
360
+ });
361
+
362
+ it('| should return correct scores for cosine similarity', () => {
363
+ const query: number[] = [1, 0, 0];
364
+ const results: LVS_SearchResult[] = vectorPool.search(
365
+ query,
366
+ 4,
367
+ LVS_Search_Mode.cosineSimilarity
368
+ );
369
+
370
+ // vec1 should have score = 1 (identical)
371
+ const vec1Result: LVS_SearchResult | undefined =
372
+ results.find((r: LVS_SearchResult) => r.id === 'vec1');
373
+ expect(vec1Result).toBeDefined();
374
+ expect(vec1Result!.score).toBeCloseTo(1, 10);
375
+ });
376
+
377
+ it('| should return correct scores for L2 distance', () => {
378
+ const query: number[] = [1, 0, 0];
379
+ const results: LVS_SearchResult[] = vectorPool.search(
380
+ query,
381
+ 4,
382
+ LVS_Search_Mode.l2Distance
383
+ );
384
+
385
+ // vec1 should have score = 0 (identical)
386
+ const vec1Result: LVS_SearchResult | undefined =
387
+ results.find((r: LVS_SearchResult) => r.id === 'vec1');
388
+ expect(vec1Result).toBeDefined();
389
+ expect(vec1Result!.score).toBe(0);
390
+ });
391
+ });
392
+ });
393
+
@@ -804,10 +804,8 @@ export class DyNTS_DataService<T extends DyFM_Metadata> {
804
804
  return data;
805
805
  }
806
806
 
807
- async patchData(data?: T): Promise<T> {
807
+ async patchData(data?: Partial<T>): Promise<T> {
808
808
  try {
809
- data = this.ensureData(data);
810
-
811
809
  if (!data._id) {
812
810
  throw new DyFM_Error({
813
811
  ...this._getDefaultErrorSettings(
@@ -828,6 +826,17 @@ export class DyNTS_DataService<T extends DyFM_Metadata> {
828
826
  });
829
827
  }
830
828
 
829
+ for (const key in this.depSettings) {
830
+ if (data[key] && data[key] !== dataExists[key]) {
831
+ throw new DyFM_Error({
832
+ ...this._getDefaultErrorSettings(
833
+ 'patchData',
834
+ new Error(`Cannot patch data: dependency data mismatch! (${this.dataParams.dataName})`)
835
+ ),
836
+ });
837
+ }
838
+ }
839
+
831
840
  DyFM_Object.cleanAssign(dataExists, data);
832
841
 
833
842
  await this.validateForSave(dataExists);
@@ -2335,7 +2344,8 @@ export class DyNTS_DataService<T extends DyFM_Metadata> {
2335
2344
 
2336
2345
  protected getDefaultErrorSettings(
2337
2346
  fnName: string,
2338
- error: DyFM_AnyError
2347
+ error: DyFM_AnyError,
2348
+ useMessageAsUserMessage: boolean = true,
2339
2349
  ): DyFM_Error_Settings {
2340
2350
  return {
2341
2351
  status: (error as DyFM_Error)?.___status ?? 500,
@@ -2343,7 +2353,8 @@ export class DyNTS_DataService<T extends DyFM_Metadata> {
2343
2353
  (error as DyFM_Error)?._message ??
2344
2354
  `${fnName} was UNSUCCESSFUL (${DyNTS_global_settings.systemShortCodeName})`,
2345
2355
  addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
2346
- userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
2356
+ userMessage: (error as DyFM_Error)?.__userMessage ??
2357
+ (useMessageAsUserMessage ? (error as Error)?.message : this.defaultErrorUserMsg),
2347
2358
  issuer: this.issuer,
2348
2359
  issuerService: this.constructor?.name,
2349
2360
  systemVersion: DyNTS_global_settings.systemVersion,
@@ -16,6 +16,7 @@ export class DyNTS_SingletonService extends DyNTS_SingletonServiceBase {
16
16
  fnName: string,
17
17
  error: DyFM_AnyError,
18
18
  issuer: string,
19
+ useMessageAsUserMessage: boolean = true,
19
20
  /* errorCode: string, */
20
21
  ): DyFM_Error_Settings {
21
22
  return {
@@ -24,7 +25,8 @@ export class DyNTS_SingletonService extends DyNTS_SingletonServiceBase {
24
25
  (error as DyFM_Error)?._message ??
25
26
  `${fnName} was UNSUCCESSFUL (${DyNTS_global_settings.systemShortCodeName})`,
26
27
  addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
27
- userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
28
+ userMessage: (error as DyFM_Error)?.__userMessage ??
29
+ (useMessageAsUserMessage ? (error as Error)?.message : this.defaultErrorUserMsg),
28
30
  /* errorCode: errorCode, */
29
31
  issuer: issuer,
30
32
  issuerService: this.constructor?.name,
@@ -722,7 +722,8 @@ export class DyNTS_EmailService /* extends DyNTS_SingletonService */ {
722
722
  protected getDefaultErrorSettings(
723
723
  fnName: string,
724
724
  error: DyFM_AnyError,
725
- issuer: string
725
+ issuer: string,
726
+ useMessageAsUserMessage: boolean = true,
726
727
  ): DyFM_Error_Settings {
727
728
  return {
728
729
  status: (error as DyFM_Error)?.___status ?? 500,
@@ -730,7 +731,8 @@ export class DyNTS_EmailService /* extends DyNTS_SingletonService */ {
730
731
  (error as DyFM_Error)?._message ??
731
732
  `${fnName} was UNSUCCESSFUL (${DyNTS_global_settings.systemShortCodeName})`,
732
733
  addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
733
- userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
734
+ userMessage: (error as DyFM_Error)?.__userMessage ??
735
+ (useMessageAsUserMessage ? (error as Error)?.message : this.defaultErrorUserMsg),
734
736
  issuer: issuer,
735
737
  issuerService: this.constructor?.name,
736
738
  error: error,
@@ -441,7 +441,8 @@ export class DyNTS_GlobalService extends DyNTS_SingletonService {
441
441
  protected static getDefaultErrorSettings(
442
442
  fnName: string,
443
443
  error: DyFM_AnyError,
444
- issuer: string
444
+ issuer: string,
445
+ useMessageAsUserMessage: boolean = true,
445
446
  ): DyFM_Error_Settings {
446
447
  return {
447
448
  status: (error as DyFM_Error)?.___status ?? 500,
@@ -449,7 +450,8 @@ export class DyNTS_GlobalService extends DyNTS_SingletonService {
449
450
  (error as DyFM_Error)?._message ??
450
451
  `${fnName} was UNSUCCESSFUL (${DyNTS_global_settings.systemShortCodeName})`,
451
452
  addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
452
- userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
453
+ userMessage: (error as DyFM_Error)?.__userMessage ??
454
+ (useMessageAsUserMessage ? (error as Error)?.message : this.defaultErrorUserMsg),
453
455
  issuer: issuer,
454
456
  issuerService: this.constructor?.name,
455
457
  error: error,