@futdevpro/nts-dynamo 1.15.3 → 1.15.5

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 (74) hide show
  1. package/.cursor/rules/__main.mdc +3 -1
  2. package/.cursor/rules/default-command.mdc +324 -88
  3. package/_specifications/BACKLOG.md +15 -0
  4. package/_specifications/TODO.md +15 -0
  5. package/build/_modules/ai/_models/ai-test-generation-result.interface.d.ts +17 -0
  6. package/build/_modules/ai/_models/ai-test-generation-result.interface.d.ts.map +1 -0
  7. package/build/_modules/ai/_models/ai-test-generation-result.interface.js +3 -0
  8. package/build/_modules/ai/_models/ai-test-generation-result.interface.js.map +1 -0
  9. package/build/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.d.ts +36 -0
  10. package/build/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.d.ts.map +1 -0
  11. package/build/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.js +118 -0
  12. package/build/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.js.map +1 -0
  13. package/build/_modules/ai/_modules/anthropic/index.d.ts +3 -0
  14. package/build/_modules/ai/_modules/anthropic/index.d.ts.map +1 -0
  15. package/build/_modules/ai/_modules/anthropic/index.js +8 -0
  16. package/build/_modules/ai/_modules/anthropic/index.js.map +1 -0
  17. package/build/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.d.ts +35 -0
  18. package/build/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.d.ts.map +1 -0
  19. package/build/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.js +129 -0
  20. package/build/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.js.map +1 -0
  21. package/build/_modules/ai/_modules/fdp-ai/index.d.ts +3 -0
  22. package/build/_modules/ai/_modules/fdp-ai/index.d.ts.map +1 -0
  23. package/build/_modules/ai/_modules/fdp-ai/index.js +8 -0
  24. package/build/_modules/ai/_modules/fdp-ai/index.js.map +1 -0
  25. package/build/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.d.ts +40 -0
  26. package/build/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.d.ts.map +1 -0
  27. package/build/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.js +111 -0
  28. package/build/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.js.map +1 -0
  29. package/build/_modules/ai/_modules/open-ai/index.d.ts +1 -0
  30. package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
  31. package/build/_modules/ai/_modules/open-ai/index.js +1 -0
  32. package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
  33. package/build/_modules/ai/_services/ai-user-key.service-base.d.ts +45 -0
  34. package/build/_modules/ai/_services/ai-user-key.service-base.d.ts.map +1 -0
  35. package/build/_modules/ai/_services/ai-user-key.service-base.js +15 -0
  36. package/build/_modules/ai/_services/ai-user-key.service-base.js.map +1 -0
  37. package/build/_modules/ai/index.d.ts +2 -0
  38. package/build/_modules/ai/index.d.ts.map +1 -1
  39. package/build/_modules/ai/index.js +2 -0
  40. package/build/_modules/ai/index.js.map +1 -1
  41. package/build/_modules/socket/app-extended.server.js +1 -1
  42. package/build/_modules/socket/app-extended.server.js.map +1 -1
  43. package/build/_services/base/data.service.d.ts +1 -1
  44. package/build/_services/base/data.service.js +1 -1
  45. package/build/_services/base/db.service.d.ts +1 -1
  46. package/build/_services/base/db.service.js +1 -1
  47. package/build/_services/core/auth.service.d.ts +2 -2
  48. package/build/_services/core/auth.service.js +1 -1
  49. package/build/_services/core/email.service.js +1 -1
  50. package/build/_services/core/email.service.js.map +1 -1
  51. package/build/_services/core/global.service.d.ts +1 -1
  52. package/build/_services/core/global.service.js +2 -2
  53. package/build/_services/core/global.service.js.map +1 -1
  54. package/build/_services/server/app.server.d.ts.map +1 -1
  55. package/build/_services/server/app.server.js +11 -1
  56. package/build/_services/server/app.server.js.map +1 -1
  57. package/package.json +17 -4
  58. package/src/_modules/ai/_models/ai-test-generation-result.interface.ts +16 -0
  59. package/src/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.ts +138 -0
  60. package/src/_modules/ai/_modules/anthropic/index.ts +5 -0
  61. package/src/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.ts +189 -0
  62. package/src/_modules/ai/_modules/fdp-ai/index.ts +5 -0
  63. package/src/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.ts +157 -0
  64. package/src/_modules/ai/_modules/open-ai/index.ts +1 -0
  65. package/src/_modules/ai/_services/ai-user-key.service-base.ts +59 -0
  66. package/src/_modules/ai/index.ts +2 -0
  67. package/src/_modules/socket/app-extended.server.ts +1 -1
  68. package/src/_services/base/data.service.ts +1 -1
  69. package/src/_services/base/db.service.ts +1 -1
  70. package/src/_services/core/auth.service.ts +2 -2
  71. package/src/_services/core/email.service.ts +1 -1
  72. package/src/_services/core/global.service.ts +2 -2
  73. package/src/_services/route/controller.service.ts +1 -1
  74. package/src/_services/server/app.server.ts +17 -1
@@ -12,7 +12,7 @@ import { DyNTS_global_settings } from '../../_collections/global-settings.const'
12
12
  * You should use singleton instance getting function by implementing a
13
13
  * static getInstance() function
14
14
  * @example
15
- * export class AuthService extends DynamoBEAuthService {
15
+ * export class AuthService extends DyNTS_AuthService {
16
16
  *
17
17
  * static getInstance(): AuthService {
18
18
  * return AuthService.getSingletonInstance();
@@ -150,7 +150,7 @@ export abstract class DyNTS_AuthService extends DyNTS_SingletonService {
150
150
  abstract authenticate_tokenPerm_accUsageData: (req: Request, res: Response) => Promise<void>;
151
151
 
152
152
  /**
153
- * The DynamoBE System is using this to get issuer, that will be set on DBServices
153
+ * The DynamoNTS System is using this to get issuer, that will be set on DBServices
154
154
  * Don't throw error in this function, since it will be used in every request
155
155
  * @param req
156
156
  *
@@ -664,7 +664,7 @@ export class DyNTS_EmailService /* extends DyNTS_SingletonService */ {
664
664
  while (propertyOpenTagIndex >= 0) {
665
665
  if (propertyCloseTagIndex === -1) {
666
666
  DyFM_Log.error(
667
- `\nDynamoBEEmailService ERROR, missing closing tag from email template! ` +
667
+ `\nDyNTS_EmailService ERROR, missing closing tag from email template! ` +
668
668
  `(${propertyOpenTagIndex} -)`,
669
669
  propertyKeys
670
670
  );
@@ -30,7 +30,7 @@ import { DyNTS_SingletonService } from '../base/singleton.service';
30
30
  import { DyNTS_getArchivedDBName } from '../../_collections/archive.util';
31
31
 
32
32
  /**
33
- * This is the main Global/Core Service Collection used by DynamoBE,
33
+ * This is the main Global/Core Service Collection used by DynamoNTS,
34
34
  * you also can use this to access main services as
35
35
  * dbServices, emailServices, or authService
36
36
  */
@@ -373,7 +373,7 @@ export class DyNTS_GlobalService extends DyNTS_SingletonService {
373
373
  throw new Error(
374
374
  `\n Unique Email Service Collection missing!` +
375
375
  `\n Please create a Unique Email Service Collection extending ` +
376
- `DynamoBEEmailServiceCollection, ` +
376
+ `DyNTS_EmailServiceCollection, ` +
377
377
  '\n (If you set the globalErrorHandler, ' +
378
378
  'please check if it is using the same node_modules as the app)' +
379
379
  `\n and Setup with DyNTS_GlobalServiceC.setServices(...)\n` +
@@ -104,7 +104,7 @@ export abstract class DyNTS_Controller extends DyNTS_SingletonService {
104
104
  this.setupEndpoints();
105
105
  } catch (error) {
106
106
  throw new DyFM_Error({
107
- message: 'DynamoBEController setup failed. Please check the setupEndpoints() method.',
107
+ message: 'DynamoNTSController setup failed. Please check the setupEndpoints() method.',
108
108
  errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-COS-000',
109
109
  issuerService: this?.constructor?.name,
110
110
  error: error,
@@ -1256,8 +1256,17 @@ export abstract class DyNTS_App extends DyNTS_SingletonService {
1256
1256
  private async mountSecureRoutes (): Promise<void> {
1257
1257
  try {
1258
1258
  if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. mountSecureRoutes');
1259
+
1260
+ if (!this.secureExpress) {
1261
+ throw new Error(
1262
+ 'secureExpress was not initialized. ' +
1263
+ 'Secure routes require getCertificationSettings and httpsPort, and cert files must exist.' +
1264
+ '\n\nYou need to set security to secure or both in any route and set httpsPort in getPortSettings.' +
1265
+ '\n\nYou need to set cert files in getCertificationSettings.'
1266
+ );
1267
+ }
1259
1268
 
1260
- this.openExpress.use(
1269
+ this.secureExpress.use(
1261
1270
  (error, req, res, next): Promise<void> => this.expressErrorHandling(error, req, res, next)
1262
1271
  );
1263
1272
 
@@ -1310,6 +1319,13 @@ export abstract class DyNTS_App extends DyNTS_SingletonService {
1310
1319
  private async mountOpenRoutes(): Promise<void> {
1311
1320
  try {
1312
1321
  if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. mountOpenRoutes');
1322
+
1323
+ if (!this.openExpress) {
1324
+ throw new Error(
1325
+ 'openExpress was not initialized. Open routes require getOpenExpress and httpPort.' +
1326
+ '\n\nYou need to set security to open or both in any route and set httpPort in getPortSettings.'
1327
+ );
1328
+ }
1313
1329
 
1314
1330
  this.openExpress.use(
1315
1331
  (error, req, res, next): Promise<void> => this.expressErrorHandling(error, req, res, next)