s3db.js 13.6.1 → 14.0.2

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 (189) hide show
  1. package/README.md +56 -15
  2. package/dist/s3db.cjs +72446 -39022
  3. package/dist/s3db.cjs.map +1 -1
  4. package/dist/s3db.es.js +72172 -38790
  5. package/dist/s3db.es.js.map +1 -1
  6. package/mcp/lib/base-handler.js +157 -0
  7. package/mcp/lib/handlers/connection-handler.js +280 -0
  8. package/mcp/lib/handlers/query-handler.js +533 -0
  9. package/mcp/lib/handlers/resource-handler.js +428 -0
  10. package/mcp/lib/tool-registry.js +336 -0
  11. package/mcp/lib/tools/connection-tools.js +161 -0
  12. package/mcp/lib/tools/query-tools.js +267 -0
  13. package/mcp/lib/tools/resource-tools.js +404 -0
  14. package/package.json +85 -50
  15. package/src/clients/memory-client.class.js +346 -191
  16. package/src/clients/memory-storage.class.js +300 -84
  17. package/src/clients/s3-client.class.js +7 -6
  18. package/src/concerns/geo-encoding.js +19 -2
  19. package/src/concerns/ip.js +59 -9
  20. package/src/concerns/money.js +8 -1
  21. package/src/concerns/password-hashing.js +49 -8
  22. package/src/concerns/plugin-storage.js +186 -18
  23. package/src/concerns/storage-drivers/filesystem-driver.js +284 -0
  24. package/src/database.class.js +139 -29
  25. package/src/errors.js +332 -42
  26. package/src/plugins/api/auth/oidc-auth.js +66 -17
  27. package/src/plugins/api/auth/strategies/base-strategy.class.js +74 -0
  28. package/src/plugins/api/auth/strategies/factory.class.js +63 -0
  29. package/src/plugins/api/auth/strategies/global-strategy.class.js +44 -0
  30. package/src/plugins/api/auth/strategies/path-based-strategy.class.js +83 -0
  31. package/src/plugins/api/auth/strategies/path-rules-strategy.class.js +118 -0
  32. package/src/plugins/api/concerns/failban-manager.js +106 -57
  33. package/src/plugins/api/concerns/route-context.js +601 -0
  34. package/src/plugins/api/index.js +168 -40
  35. package/src/plugins/api/routes/auth-routes.js +198 -30
  36. package/src/plugins/api/routes/resource-routes.js +19 -4
  37. package/src/plugins/api/server/health-manager.class.js +163 -0
  38. package/src/plugins/api/server/middleware-chain.class.js +310 -0
  39. package/src/plugins/api/server/router.class.js +472 -0
  40. package/src/plugins/api/server.js +280 -1303
  41. package/src/plugins/api/utils/custom-routes.js +17 -5
  42. package/src/plugins/api/utils/guards.js +76 -17
  43. package/src/plugins/api/utils/openapi-generator-cached.class.js +133 -0
  44. package/src/plugins/api/utils/openapi-generator.js +7 -6
  45. package/src/plugins/audit.plugin.js +30 -8
  46. package/src/plugins/backup.plugin.js +110 -14
  47. package/src/plugins/cache/cache.class.js +22 -5
  48. package/src/plugins/cache/filesystem-cache.class.js +116 -19
  49. package/src/plugins/cache/memory-cache.class.js +211 -57
  50. package/src/plugins/cache/multi-tier-cache.class.js +371 -0
  51. package/src/plugins/cache/partition-aware-filesystem-cache.class.js +168 -47
  52. package/src/plugins/cache/redis-cache.class.js +552 -0
  53. package/src/plugins/cache/s3-cache.class.js +17 -8
  54. package/src/plugins/cache.plugin.js +176 -61
  55. package/src/plugins/cloud-inventory/drivers/alibaba-driver.js +8 -1
  56. package/src/plugins/cloud-inventory/drivers/aws-driver.js +60 -29
  57. package/src/plugins/cloud-inventory/drivers/azure-driver.js +8 -1
  58. package/src/plugins/cloud-inventory/drivers/base-driver.js +16 -2
  59. package/src/plugins/cloud-inventory/drivers/cloudflare-driver.js +8 -1
  60. package/src/plugins/cloud-inventory/drivers/digitalocean-driver.js +8 -1
  61. package/src/plugins/cloud-inventory/drivers/hetzner-driver.js +8 -1
  62. package/src/plugins/cloud-inventory/drivers/linode-driver.js +8 -1
  63. package/src/plugins/cloud-inventory/drivers/mongodb-atlas-driver.js +8 -1
  64. package/src/plugins/cloud-inventory/drivers/vultr-driver.js +8 -1
  65. package/src/plugins/cloud-inventory/index.js +29 -8
  66. package/src/plugins/cloud-inventory/registry.js +64 -42
  67. package/src/plugins/cloud-inventory.plugin.js +240 -138
  68. package/src/plugins/concerns/plugin-dependencies.js +54 -0
  69. package/src/plugins/concerns/resource-names.js +100 -0
  70. package/src/plugins/consumers/index.js +10 -2
  71. package/src/plugins/consumers/sqs-consumer.js +12 -2
  72. package/src/plugins/cookie-farm-suite.plugin.js +278 -0
  73. package/src/plugins/cookie-farm.errors.js +73 -0
  74. package/src/plugins/cookie-farm.plugin.js +869 -0
  75. package/src/plugins/costs.plugin.js +7 -1
  76. package/src/plugins/eventual-consistency/analytics.js +94 -19
  77. package/src/plugins/eventual-consistency/config.js +15 -7
  78. package/src/plugins/eventual-consistency/consolidation.js +29 -11
  79. package/src/plugins/eventual-consistency/garbage-collection.js +3 -1
  80. package/src/plugins/eventual-consistency/helpers.js +39 -14
  81. package/src/plugins/eventual-consistency/install.js +21 -2
  82. package/src/plugins/eventual-consistency/utils.js +32 -10
  83. package/src/plugins/fulltext.plugin.js +38 -11
  84. package/src/plugins/geo.plugin.js +61 -9
  85. package/src/plugins/identity/concerns/config.js +61 -0
  86. package/src/plugins/identity/concerns/mfa-manager.js +15 -2
  87. package/src/plugins/identity/concerns/rate-limit.js +124 -0
  88. package/src/plugins/identity/concerns/resource-schemas.js +9 -1
  89. package/src/plugins/identity/concerns/token-generator.js +29 -4
  90. package/src/plugins/identity/drivers/auth-driver.interface.js +76 -0
  91. package/src/plugins/identity/drivers/client-credentials-driver.js +127 -0
  92. package/src/plugins/identity/drivers/index.js +18 -0
  93. package/src/plugins/identity/drivers/password-driver.js +122 -0
  94. package/src/plugins/identity/email-service.js +17 -2
  95. package/src/plugins/identity/index.js +413 -69
  96. package/src/plugins/identity/oauth2-server.js +413 -30
  97. package/src/plugins/identity/oidc-discovery.js +16 -8
  98. package/src/plugins/identity/rsa-keys.js +115 -35
  99. package/src/plugins/identity/server.js +166 -45
  100. package/src/plugins/identity/session-manager.js +53 -7
  101. package/src/plugins/identity/ui/pages/mfa-verification.js +17 -15
  102. package/src/plugins/identity/ui/routes.js +363 -255
  103. package/src/plugins/importer/index.js +153 -20
  104. package/src/plugins/index.js +9 -2
  105. package/src/plugins/kubernetes-inventory/index.js +6 -0
  106. package/src/plugins/kubernetes-inventory/k8s-driver.js +867 -0
  107. package/src/plugins/kubernetes-inventory/resource-types.js +274 -0
  108. package/src/plugins/kubernetes-inventory.plugin.js +980 -0
  109. package/src/plugins/metrics.plugin.js +64 -16
  110. package/src/plugins/ml/base-model.class.js +25 -15
  111. package/src/plugins/ml/regression-model.class.js +1 -1
  112. package/src/plugins/ml.errors.js +57 -25
  113. package/src/plugins/ml.plugin.js +28 -4
  114. package/src/plugins/namespace.js +210 -0
  115. package/src/plugins/plugin.class.js +180 -8
  116. package/src/plugins/puppeteer/console-monitor.js +729 -0
  117. package/src/plugins/puppeteer/cookie-manager.js +492 -0
  118. package/src/plugins/puppeteer/network-monitor.js +816 -0
  119. package/src/plugins/puppeteer/performance-manager.js +746 -0
  120. package/src/plugins/puppeteer/proxy-manager.js +478 -0
  121. package/src/plugins/puppeteer/stealth-manager.js +556 -0
  122. package/src/plugins/puppeteer.errors.js +81 -0
  123. package/src/plugins/puppeteer.plugin.js +1327 -0
  124. package/src/plugins/queue-consumer.plugin.js +69 -14
  125. package/src/plugins/recon/behaviors/uptime-behavior.js +691 -0
  126. package/src/plugins/recon/concerns/command-runner.js +148 -0
  127. package/src/plugins/recon/concerns/diff-detector.js +372 -0
  128. package/src/plugins/recon/concerns/fingerprint-builder.js +307 -0
  129. package/src/plugins/recon/concerns/process-manager.js +338 -0
  130. package/src/plugins/recon/concerns/report-generator.js +478 -0
  131. package/src/plugins/recon/concerns/security-analyzer.js +571 -0
  132. package/src/plugins/recon/concerns/target-normalizer.js +68 -0
  133. package/src/plugins/recon/config/defaults.js +321 -0
  134. package/src/plugins/recon/config/resources.js +370 -0
  135. package/src/plugins/recon/index.js +778 -0
  136. package/src/plugins/recon/managers/dependency-manager.js +174 -0
  137. package/src/plugins/recon/managers/scheduler-manager.js +179 -0
  138. package/src/plugins/recon/managers/storage-manager.js +745 -0
  139. package/src/plugins/recon/managers/target-manager.js +274 -0
  140. package/src/plugins/recon/stages/asn-stage.js +314 -0
  141. package/src/plugins/recon/stages/certificate-stage.js +84 -0
  142. package/src/plugins/recon/stages/dns-stage.js +107 -0
  143. package/src/plugins/recon/stages/dnsdumpster-stage.js +362 -0
  144. package/src/plugins/recon/stages/fingerprint-stage.js +71 -0
  145. package/src/plugins/recon/stages/google-dorks-stage.js +440 -0
  146. package/src/plugins/recon/stages/http-stage.js +89 -0
  147. package/src/plugins/recon/stages/latency-stage.js +148 -0
  148. package/src/plugins/recon/stages/massdns-stage.js +302 -0
  149. package/src/plugins/recon/stages/osint-stage.js +1373 -0
  150. package/src/plugins/recon/stages/ports-stage.js +169 -0
  151. package/src/plugins/recon/stages/screenshot-stage.js +94 -0
  152. package/src/plugins/recon/stages/secrets-stage.js +514 -0
  153. package/src/plugins/recon/stages/subdomains-stage.js +295 -0
  154. package/src/plugins/recon/stages/tls-audit-stage.js +78 -0
  155. package/src/plugins/recon/stages/vulnerability-stage.js +78 -0
  156. package/src/plugins/recon/stages/web-discovery-stage.js +113 -0
  157. package/src/plugins/recon/stages/whois-stage.js +349 -0
  158. package/src/plugins/recon.plugin.js +75 -0
  159. package/src/plugins/recon.plugin.js.backup +2635 -0
  160. package/src/plugins/relation.errors.js +87 -14
  161. package/src/plugins/replicator.plugin.js +514 -137
  162. package/src/plugins/replicators/base-replicator.class.js +89 -1
  163. package/src/plugins/replicators/bigquery-replicator.class.js +66 -22
  164. package/src/plugins/replicators/dynamodb-replicator.class.js +22 -15
  165. package/src/plugins/replicators/mongodb-replicator.class.js +22 -15
  166. package/src/plugins/replicators/mysql-replicator.class.js +52 -17
  167. package/src/plugins/replicators/planetscale-replicator.class.js +30 -4
  168. package/src/plugins/replicators/postgres-replicator.class.js +62 -27
  169. package/src/plugins/replicators/s3db-replicator.class.js +25 -18
  170. package/src/plugins/replicators/schema-sync.helper.js +3 -3
  171. package/src/plugins/replicators/sqs-replicator.class.js +8 -2
  172. package/src/plugins/replicators/turso-replicator.class.js +23 -3
  173. package/src/plugins/replicators/webhook-replicator.class.js +42 -4
  174. package/src/plugins/s3-queue.plugin.js +464 -65
  175. package/src/plugins/scheduler.plugin.js +20 -6
  176. package/src/plugins/state-machine.plugin.js +40 -9
  177. package/src/plugins/tfstate/base-driver.js +28 -4
  178. package/src/plugins/tfstate/errors.js +65 -10
  179. package/src/plugins/tfstate/filesystem-driver.js +52 -8
  180. package/src/plugins/tfstate/index.js +163 -90
  181. package/src/plugins/tfstate/s3-driver.js +64 -6
  182. package/src/plugins/ttl.plugin.js +72 -17
  183. package/src/plugins/vector/distances.js +18 -12
  184. package/src/plugins/vector/kmeans.js +26 -4
  185. package/src/resource.class.js +115 -19
  186. package/src/testing/factory.class.js +20 -3
  187. package/src/testing/seeder.class.js +7 -1
  188. package/src/clients/memory-client.md +0 -917
  189. package/src/plugins/cloud-inventory/drivers/mock-drivers.js +0 -449
@@ -313,10 +313,11 @@ import * as fs from 'fs';
313
313
  import * as readline from 'readline';
314
314
  import { pipeline } from 'stream/promises';
315
315
  import zlib from 'node:zlib';
316
+ import { PluginError } from '../../errors.js';
316
317
 
317
318
  /**
318
319
  * Base Importer Driver Interface
319
- */
320
+ */
320
321
  class ImporterDriver extends EventEmitter {
321
322
  constructor(config) {
322
323
  super();
@@ -330,7 +331,13 @@ class ImporterDriver extends EventEmitter {
330
331
  * @returns {AsyncIterator<Object>} - Async iterator of records
331
332
  */
332
333
  async *parse(filePath, options) {
333
- throw new Error('parse() must be implemented by driver');
334
+ throw new PluginError('Importer driver must implement parse()', {
335
+ pluginName: 'ImporterPlugin',
336
+ operation: 'driver.parse',
337
+ statusCode: 500,
338
+ retriable: false,
339
+ suggestion: 'Ensure custom importer drivers override parse(filePath, options).'
340
+ });
334
341
  }
335
342
 
336
343
  /**
@@ -398,10 +405,23 @@ class JSONImportDriver extends ImporterDriver {
398
405
  yield record;
399
406
  }
400
407
  } else {
401
- throw new Error('JSON file must contain an array of objects');
408
+ throw new PluginError('JSON import expects an array of objects', {
409
+ pluginName: 'ImporterPlugin',
410
+ operation: 'JSONImportDriver.parse',
411
+ statusCode: 400,
412
+ retriable: false,
413
+ suggestion: 'Ensure the JSON file contains an array at the root (e.g., [ {...}, {...} ]).'
414
+ });
402
415
  }
403
416
  } catch (error) {
404
- throw new Error(`Failed to parse JSON array: ${error.message}`);
417
+ throw new PluginError(`Failed to parse JSON array: ${error.message}`, {
418
+ pluginName: 'ImporterPlugin',
419
+ operation: 'JSONImportDriver.parse',
420
+ statusCode: 400,
421
+ retriable: false,
422
+ suggestion: 'Validate JSON syntax; consider using jsonlint before importing.',
423
+ original: error
424
+ });
405
425
  }
406
426
  buffer = '';
407
427
  inArray = false;
@@ -424,10 +444,23 @@ class JSONImportDriver extends ImporterDriver {
424
444
  yield record;
425
445
  }
426
446
  } else {
427
- throw new Error('JSON file must contain an array of objects');
447
+ throw new PluginError('JSON import expects an array of objects', {
448
+ pluginName: 'ImporterPlugin',
449
+ operation: 'JSONImportDriver.parse',
450
+ statusCode: 400,
451
+ retriable: false,
452
+ suggestion: 'Ensure the JSON file contains an array at the root (e.g., [ {...}, {...} ]).'
453
+ });
428
454
  }
429
455
  } catch (error) {
430
- throw new Error(`Failed to parse JSON array: ${error.message}`);
456
+ throw new PluginError(`Failed to parse JSON array: ${error.message}`, {
457
+ pluginName: 'ImporterPlugin',
458
+ operation: 'JSONImportDriver.parse',
459
+ statusCode: 400,
460
+ retriable: false,
461
+ suggestion: 'Validate JSON syntax; consider using jsonlint before importing.',
462
+ original: error
463
+ });
431
464
  }
432
465
  buffer = '';
433
466
  inArray = false;
@@ -457,7 +490,14 @@ class JSONImportDriver extends ImporterDriver {
457
490
  async validate(filePath) {
458
491
  // Check file exists and has .json/.jsonl/.ndjson extension (or .gz compressed)
459
492
  if (!fs.existsSync(filePath)) {
460
- throw new Error(`File not found: ${filePath}`);
493
+ throw new PluginError(`File not found: ${filePath}`, {
494
+ pluginName: 'ImporterPlugin',
495
+ operation: 'JSONImportDriver.validate',
496
+ statusCode: 404,
497
+ retriable: false,
498
+ suggestion: 'Verify the file path before importing or ensure the file is accessible to the process.',
499
+ filePath
500
+ });
461
501
  }
462
502
 
463
503
  // Handle .gz extension by checking the extension before .gz
@@ -466,17 +506,38 @@ class JSONImportDriver extends ImporterDriver {
466
506
  // Check format before .gz (e.g., .jsonl.gz -> .jsonl)
467
507
  const parts = lowerPath.split('.');
468
508
  if (parts.length < 3) {
469
- throw new Error(`Invalid file extension for JSON driver: .gz without format extension`);
509
+ throw new PluginError('Invalid file extension for JSON driver: .gz without format extension', {
510
+ pluginName: 'ImporterPlugin',
511
+ operation: 'JSONImportDriver.validate',
512
+ statusCode: 400,
513
+ retriable: false,
514
+ suggestion: 'Rename the file to include the format before .gz (e.g., data.json.gz).',
515
+ filePath
516
+ });
470
517
  }
471
518
  const formatExt = parts[parts.length - 2];
472
519
  if (!['json', 'jsonl', 'ndjson'].includes(formatExt)) {
473
- throw new Error(`Invalid file extension for JSON driver: .${formatExt}.gz (expected .json.gz, .jsonl.gz, or .ndjson.gz)`);
520
+ throw new PluginError(`Invalid file extension for JSON driver: .${formatExt}.gz (expected .json.gz, .jsonl.gz, or .ndjson.gz)`, {
521
+ pluginName: 'ImporterPlugin',
522
+ operation: 'JSONImportDriver.validate',
523
+ statusCode: 400,
524
+ retriable: false,
525
+ suggestion: 'Use supported extensions (.json, .jsonl, .ndjson) before .gz compression.',
526
+ filePath
527
+ });
474
528
  }
475
529
  } else {
476
530
  // Regular non-compressed file
477
531
  const ext = lowerPath.split('.').pop();
478
532
  if (!['json', 'jsonl', 'ndjson'].includes(ext)) {
479
- throw new Error(`Invalid file extension for JSON driver: .${ext}`);
533
+ throw new PluginError(`Invalid file extension for JSON driver: .${ext}`, {
534
+ pluginName: 'ImporterPlugin',
535
+ operation: 'JSONImportDriver.validate',
536
+ statusCode: 400,
537
+ retriable: false,
538
+ suggestion: 'Rename the file to use .json, .jsonl, or .ndjson extensions.',
539
+ filePath
540
+ });
480
541
  }
481
542
  }
482
543
 
@@ -639,7 +700,14 @@ class CSVImportDriver extends ImporterDriver {
639
700
  async validate(filePath) {
640
701
  // Check file exists and has .csv/.tsv extension (or .gz compressed)
641
702
  if (!fs.existsSync(filePath)) {
642
- throw new Error(`File not found: ${filePath}`);
703
+ throw new PluginError(`File not found: ${filePath}`, {
704
+ pluginName: 'ImporterPlugin',
705
+ operation: 'CSVImportDriver.validate',
706
+ statusCode: 404,
707
+ retriable: false,
708
+ suggestion: 'Verify the CSV file path or download it locally before importing.',
709
+ filePath
710
+ });
643
711
  }
644
712
 
645
713
  // Handle .gz extension by checking the extension before .gz
@@ -648,17 +716,38 @@ class CSVImportDriver extends ImporterDriver {
648
716
  // Check format before .gz (e.g., .csv.gz -> .csv)
649
717
  const parts = lowerPath.split('.');
650
718
  if (parts.length < 3) {
651
- throw new Error(`Invalid file extension for CSV driver: .gz without format extension`);
719
+ throw new PluginError('Invalid file extension for CSV driver: .gz without format extension', {
720
+ pluginName: 'ImporterPlugin',
721
+ operation: 'CSVImportDriver.validate',
722
+ statusCode: 400,
723
+ retriable: false,
724
+ suggestion: 'Rename the file to include .csv or .tsv before .gz (e.g., data.csv.gz).',
725
+ filePath
726
+ });
652
727
  }
653
728
  const formatExt = parts[parts.length - 2];
654
729
  if (!['csv', 'tsv', 'txt'].includes(formatExt)) {
655
- throw new Error(`Invalid file extension for CSV driver: .${formatExt}.gz (expected .csv.gz or .tsv.gz)`);
730
+ throw new PluginError(`Invalid file extension for CSV driver: .${formatExt}.gz (expected .csv.gz or .tsv.gz)`, {
731
+ pluginName: 'ImporterPlugin',
732
+ operation: 'CSVImportDriver.validate',
733
+ statusCode: 400,
734
+ retriable: false,
735
+ suggestion: 'Use supported extensions (.csv, .tsv, .txt) before gzip compression.',
736
+ filePath
737
+ });
656
738
  }
657
739
  } else {
658
740
  // Regular non-compressed file
659
741
  const ext = lowerPath.split('.').pop();
660
742
  if (!['csv', 'tsv', 'txt'].includes(ext)) {
661
- throw new Error(`Invalid file extension for CSV driver: .${ext}`);
743
+ throw new PluginError(`Invalid file extension for CSV driver: .${ext}`, {
744
+ pluginName: 'ImporterPlugin',
745
+ operation: 'CSVImportDriver.validate',
746
+ statusCode: 400,
747
+ retriable: false,
748
+ suggestion: 'Rename the file to use .csv, .tsv, or .txt extensions.',
749
+ filePath
750
+ });
662
751
  }
663
752
  }
664
753
 
@@ -672,7 +761,13 @@ class CSVImportDriver extends ImporterDriver {
672
761
  class ParquetImportDriver extends ImporterDriver {
673
762
  async *parse(filePath, options = {}) {
674
763
  // TODO: Implement Parquet parsing
675
- throw new Error('ParquetImportDriver not yet implemented');
764
+ throw new PluginError('ParquetImportDriver not yet implemented', {
765
+ pluginName: 'ImporterPlugin',
766
+ operation: 'ParquetImportDriver.parse',
767
+ statusCode: 501,
768
+ retriable: false,
769
+ suggestion: 'Parquet import support is under development. Convert data to CSV/JSON or implement a custom driver.'
770
+ });
676
771
  }
677
772
  }
678
773
 
@@ -682,7 +777,13 @@ class ParquetImportDriver extends ImporterDriver {
682
777
  class ExcelImportDriver extends ImporterDriver {
683
778
  async *parse(filePath, options = {}) {
684
779
  // TODO: Implement Excel parsing
685
- throw new Error('ExcelImportDriver not yet implemented');
780
+ throw new PluginError('ExcelImportDriver not yet implemented', {
781
+ pluginName: 'ImporterPlugin',
782
+ operation: 'ExcelImportDriver.parse',
783
+ statusCode: 501,
784
+ retriable: false,
785
+ suggestion: 'Convert Excel files to CSV/JSON or implement a custom Excel driver before importing.'
786
+ });
686
787
  }
687
788
  }
688
789
 
@@ -745,11 +846,26 @@ export class ImporterPlugin extends Plugin {
745
846
  this.resource = await this.resource;
746
847
  }
747
848
  } catch (error) {
748
- throw new Error(`Resource "${this.resourceName}" not found`);
849
+ throw new PluginError(`Resource "${this.resourceName}" not found`, {
850
+ pluginName: 'ImporterPlugin',
851
+ operation: 'onInstall',
852
+ statusCode: 404,
853
+ retriable: false,
854
+ suggestion: 'Create the target resource before running ImporterPlugin or update the configuration.',
855
+ resourceName: this.resourceName,
856
+ original: error
857
+ });
749
858
  }
750
859
 
751
860
  if (!this.resource) {
752
- throw new Error(`Resource "${this.resourceName}" not found`);
861
+ throw new PluginError(`Resource "${this.resourceName}" not found`, {
862
+ pluginName: 'ImporterPlugin',
863
+ operation: 'onInstall',
864
+ statusCode: 404,
865
+ retriable: false,
866
+ suggestion: 'Create the target resource before running ImporterPlugin or update the configuration.',
867
+ resourceName: this.resourceName
868
+ });
753
869
  }
754
870
 
755
871
  // Initialize driver based on format
@@ -782,7 +898,14 @@ export class ImporterPlugin extends Plugin {
782
898
  case 'xlsx':
783
899
  return new ExcelImportDriver(this.driverConfig);
784
900
  default:
785
- throw new Error(`Unsupported format: ${format}`);
901
+ throw new PluginError(`Unsupported import format: ${format}`, {
902
+ pluginName: 'ImporterPlugin',
903
+ operation: '_createDriver',
904
+ statusCode: 400,
905
+ retriable: false,
906
+ suggestion: 'Use one of the supported formats: json, jsonl, ndjson, csv, tsv, parquet, excel.',
907
+ format
908
+ });
786
909
  }
787
910
  }
788
911
 
@@ -828,7 +951,17 @@ export class ImporterPlugin extends Plugin {
828
951
  record: mapped
829
952
  });
830
953
  }
831
- if (!this.continueOnError) throw new Error('Validation failed');
954
+ if (!this.continueOnError) {
955
+ throw new PluginError('Validation failed', {
956
+ pluginName: 'ImporterPlugin',
957
+ operation: 'import',
958
+ statusCode: 422,
959
+ retriable: false,
960
+ suggestion: 'Fix the invalid record or enable continueOnError to skip bad rows.',
961
+ row: this.stats.totalProcessed,
962
+ record: mapped
963
+ });
964
+ }
832
965
  continue;
833
966
  }
834
967
 
@@ -8,13 +8,17 @@ export { IdentityPlugin } from './identity/index.js'
8
8
  export * from './audit.plugin.js'
9
9
  export * from './backup.plugin.js'
10
10
  export * from './cache.plugin.js'
11
+ export * from './cookie-farm.plugin.js'
12
+ export * from './cookie-farm-suite.plugin.js'
11
13
  export * from './costs.plugin.js'
12
14
  export * from './eventual-consistency/index.js'
13
15
  export * from './fulltext.plugin.js'
14
16
  export * from './geo.plugin.js'
15
17
  export * from './metrics.plugin.js'
16
18
  export * from './ml.plugin.js'
17
- // export * from './cloud-inventory.plugin.js' // Temporarily disabled due to AWS SDK paginator issues
19
+ export * from './puppeteer.plugin.js'
20
+ export * from './cloud-inventory.plugin.js'
21
+ export * from './importer/index.js'
18
22
  export * from './queue-consumer.plugin.js'
19
23
  export * from './relation.plugin.js'
20
24
  export * from './replicator.plugin.js'
@@ -24,10 +28,13 @@ export * from './state-machine.plugin.js'
24
28
  export * from './tfstate/index.js'
25
29
  export * from './ttl.plugin.js'
26
30
  export * from './vector.plugin.js'
31
+ export * from './recon.plugin.js'
32
+ export * from './kubernetes-inventory.plugin.js'
27
33
 
28
34
  // plugin drivers & utilities:
29
35
  export * from './backup/index.js'
30
36
  export * from './cache/index.js'
31
37
  export * from './replicators/index.js'
32
38
  export * from './consumers/index.js'
33
- // export * from './cloud-inventory/index.js' // Temporarily disabled due to AWS SDK paginator issues
39
+ export * from './cloud-inventory/index.js'
40
+ export * from './kubernetes-inventory/index.js'
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Kubernetes Inventory Plugin - Module Exports
3
+ */
4
+
5
+ export { KubernetesDriver } from './k8s-driver.js';
6
+ export * from './resource-types.js';