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.
- package/README.md +56 -15
- package/dist/s3db.cjs +72446 -39022
- package/dist/s3db.cjs.map +1 -1
- package/dist/s3db.es.js +72172 -38790
- package/dist/s3db.es.js.map +1 -1
- package/mcp/lib/base-handler.js +157 -0
- package/mcp/lib/handlers/connection-handler.js +280 -0
- package/mcp/lib/handlers/query-handler.js +533 -0
- package/mcp/lib/handlers/resource-handler.js +428 -0
- package/mcp/lib/tool-registry.js +336 -0
- package/mcp/lib/tools/connection-tools.js +161 -0
- package/mcp/lib/tools/query-tools.js +267 -0
- package/mcp/lib/tools/resource-tools.js +404 -0
- package/package.json +85 -50
- package/src/clients/memory-client.class.js +346 -191
- package/src/clients/memory-storage.class.js +300 -84
- package/src/clients/s3-client.class.js +7 -6
- package/src/concerns/geo-encoding.js +19 -2
- package/src/concerns/ip.js +59 -9
- package/src/concerns/money.js +8 -1
- package/src/concerns/password-hashing.js +49 -8
- package/src/concerns/plugin-storage.js +186 -18
- package/src/concerns/storage-drivers/filesystem-driver.js +284 -0
- package/src/database.class.js +139 -29
- package/src/errors.js +332 -42
- package/src/plugins/api/auth/oidc-auth.js +66 -17
- package/src/plugins/api/auth/strategies/base-strategy.class.js +74 -0
- package/src/plugins/api/auth/strategies/factory.class.js +63 -0
- package/src/plugins/api/auth/strategies/global-strategy.class.js +44 -0
- package/src/plugins/api/auth/strategies/path-based-strategy.class.js +83 -0
- package/src/plugins/api/auth/strategies/path-rules-strategy.class.js +118 -0
- package/src/plugins/api/concerns/failban-manager.js +106 -57
- package/src/plugins/api/concerns/route-context.js +601 -0
- package/src/plugins/api/index.js +168 -40
- package/src/plugins/api/routes/auth-routes.js +198 -30
- package/src/plugins/api/routes/resource-routes.js +19 -4
- package/src/plugins/api/server/health-manager.class.js +163 -0
- package/src/plugins/api/server/middleware-chain.class.js +310 -0
- package/src/plugins/api/server/router.class.js +472 -0
- package/src/plugins/api/server.js +280 -1303
- package/src/plugins/api/utils/custom-routes.js +17 -5
- package/src/plugins/api/utils/guards.js +76 -17
- package/src/plugins/api/utils/openapi-generator-cached.class.js +133 -0
- package/src/plugins/api/utils/openapi-generator.js +7 -6
- package/src/plugins/audit.plugin.js +30 -8
- package/src/plugins/backup.plugin.js +110 -14
- package/src/plugins/cache/cache.class.js +22 -5
- package/src/plugins/cache/filesystem-cache.class.js +116 -19
- package/src/plugins/cache/memory-cache.class.js +211 -57
- package/src/plugins/cache/multi-tier-cache.class.js +371 -0
- package/src/plugins/cache/partition-aware-filesystem-cache.class.js +168 -47
- package/src/plugins/cache/redis-cache.class.js +552 -0
- package/src/plugins/cache/s3-cache.class.js +17 -8
- package/src/plugins/cache.plugin.js +176 -61
- package/src/plugins/cloud-inventory/drivers/alibaba-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/aws-driver.js +60 -29
- package/src/plugins/cloud-inventory/drivers/azure-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/base-driver.js +16 -2
- package/src/plugins/cloud-inventory/drivers/cloudflare-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/digitalocean-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/hetzner-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/linode-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/mongodb-atlas-driver.js +8 -1
- package/src/plugins/cloud-inventory/drivers/vultr-driver.js +8 -1
- package/src/plugins/cloud-inventory/index.js +29 -8
- package/src/plugins/cloud-inventory/registry.js +64 -42
- package/src/plugins/cloud-inventory.plugin.js +240 -138
- package/src/plugins/concerns/plugin-dependencies.js +54 -0
- package/src/plugins/concerns/resource-names.js +100 -0
- package/src/plugins/consumers/index.js +10 -2
- package/src/plugins/consumers/sqs-consumer.js +12 -2
- package/src/plugins/cookie-farm-suite.plugin.js +278 -0
- package/src/plugins/cookie-farm.errors.js +73 -0
- package/src/plugins/cookie-farm.plugin.js +869 -0
- package/src/plugins/costs.plugin.js +7 -1
- package/src/plugins/eventual-consistency/analytics.js +94 -19
- package/src/plugins/eventual-consistency/config.js +15 -7
- package/src/plugins/eventual-consistency/consolidation.js +29 -11
- package/src/plugins/eventual-consistency/garbage-collection.js +3 -1
- package/src/plugins/eventual-consistency/helpers.js +39 -14
- package/src/plugins/eventual-consistency/install.js +21 -2
- package/src/plugins/eventual-consistency/utils.js +32 -10
- package/src/plugins/fulltext.plugin.js +38 -11
- package/src/plugins/geo.plugin.js +61 -9
- package/src/plugins/identity/concerns/config.js +61 -0
- package/src/plugins/identity/concerns/mfa-manager.js +15 -2
- package/src/plugins/identity/concerns/rate-limit.js +124 -0
- package/src/plugins/identity/concerns/resource-schemas.js +9 -1
- package/src/plugins/identity/concerns/token-generator.js +29 -4
- package/src/plugins/identity/drivers/auth-driver.interface.js +76 -0
- package/src/plugins/identity/drivers/client-credentials-driver.js +127 -0
- package/src/plugins/identity/drivers/index.js +18 -0
- package/src/plugins/identity/drivers/password-driver.js +122 -0
- package/src/plugins/identity/email-service.js +17 -2
- package/src/plugins/identity/index.js +413 -69
- package/src/plugins/identity/oauth2-server.js +413 -30
- package/src/plugins/identity/oidc-discovery.js +16 -8
- package/src/plugins/identity/rsa-keys.js +115 -35
- package/src/plugins/identity/server.js +166 -45
- package/src/plugins/identity/session-manager.js +53 -7
- package/src/plugins/identity/ui/pages/mfa-verification.js +17 -15
- package/src/plugins/identity/ui/routes.js +363 -255
- package/src/plugins/importer/index.js +153 -20
- package/src/plugins/index.js +9 -2
- package/src/plugins/kubernetes-inventory/index.js +6 -0
- package/src/plugins/kubernetes-inventory/k8s-driver.js +867 -0
- package/src/plugins/kubernetes-inventory/resource-types.js +274 -0
- package/src/plugins/kubernetes-inventory.plugin.js +980 -0
- package/src/plugins/metrics.plugin.js +64 -16
- package/src/plugins/ml/base-model.class.js +25 -15
- package/src/plugins/ml/regression-model.class.js +1 -1
- package/src/plugins/ml.errors.js +57 -25
- package/src/plugins/ml.plugin.js +28 -4
- package/src/plugins/namespace.js +210 -0
- package/src/plugins/plugin.class.js +180 -8
- package/src/plugins/puppeteer/console-monitor.js +729 -0
- package/src/plugins/puppeteer/cookie-manager.js +492 -0
- package/src/plugins/puppeteer/network-monitor.js +816 -0
- package/src/plugins/puppeteer/performance-manager.js +746 -0
- package/src/plugins/puppeteer/proxy-manager.js +478 -0
- package/src/plugins/puppeteer/stealth-manager.js +556 -0
- package/src/plugins/puppeteer.errors.js +81 -0
- package/src/plugins/puppeteer.plugin.js +1327 -0
- package/src/plugins/queue-consumer.plugin.js +69 -14
- package/src/plugins/recon/behaviors/uptime-behavior.js +691 -0
- package/src/plugins/recon/concerns/command-runner.js +148 -0
- package/src/plugins/recon/concerns/diff-detector.js +372 -0
- package/src/plugins/recon/concerns/fingerprint-builder.js +307 -0
- package/src/plugins/recon/concerns/process-manager.js +338 -0
- package/src/plugins/recon/concerns/report-generator.js +478 -0
- package/src/plugins/recon/concerns/security-analyzer.js +571 -0
- package/src/plugins/recon/concerns/target-normalizer.js +68 -0
- package/src/plugins/recon/config/defaults.js +321 -0
- package/src/plugins/recon/config/resources.js +370 -0
- package/src/plugins/recon/index.js +778 -0
- package/src/plugins/recon/managers/dependency-manager.js +174 -0
- package/src/plugins/recon/managers/scheduler-manager.js +179 -0
- package/src/plugins/recon/managers/storage-manager.js +745 -0
- package/src/plugins/recon/managers/target-manager.js +274 -0
- package/src/plugins/recon/stages/asn-stage.js +314 -0
- package/src/plugins/recon/stages/certificate-stage.js +84 -0
- package/src/plugins/recon/stages/dns-stage.js +107 -0
- package/src/plugins/recon/stages/dnsdumpster-stage.js +362 -0
- package/src/plugins/recon/stages/fingerprint-stage.js +71 -0
- package/src/plugins/recon/stages/google-dorks-stage.js +440 -0
- package/src/plugins/recon/stages/http-stage.js +89 -0
- package/src/plugins/recon/stages/latency-stage.js +148 -0
- package/src/plugins/recon/stages/massdns-stage.js +302 -0
- package/src/plugins/recon/stages/osint-stage.js +1373 -0
- package/src/plugins/recon/stages/ports-stage.js +169 -0
- package/src/plugins/recon/stages/screenshot-stage.js +94 -0
- package/src/plugins/recon/stages/secrets-stage.js +514 -0
- package/src/plugins/recon/stages/subdomains-stage.js +295 -0
- package/src/plugins/recon/stages/tls-audit-stage.js +78 -0
- package/src/plugins/recon/stages/vulnerability-stage.js +78 -0
- package/src/plugins/recon/stages/web-discovery-stage.js +113 -0
- package/src/plugins/recon/stages/whois-stage.js +349 -0
- package/src/plugins/recon.plugin.js +75 -0
- package/src/plugins/recon.plugin.js.backup +2635 -0
- package/src/plugins/relation.errors.js +87 -14
- package/src/plugins/replicator.plugin.js +514 -137
- package/src/plugins/replicators/base-replicator.class.js +89 -1
- package/src/plugins/replicators/bigquery-replicator.class.js +66 -22
- package/src/plugins/replicators/dynamodb-replicator.class.js +22 -15
- package/src/plugins/replicators/mongodb-replicator.class.js +22 -15
- package/src/plugins/replicators/mysql-replicator.class.js +52 -17
- package/src/plugins/replicators/planetscale-replicator.class.js +30 -4
- package/src/plugins/replicators/postgres-replicator.class.js +62 -27
- package/src/plugins/replicators/s3db-replicator.class.js +25 -18
- package/src/plugins/replicators/schema-sync.helper.js +3 -3
- package/src/plugins/replicators/sqs-replicator.class.js +8 -2
- package/src/plugins/replicators/turso-replicator.class.js +23 -3
- package/src/plugins/replicators/webhook-replicator.class.js +42 -4
- package/src/plugins/s3-queue.plugin.js +464 -65
- package/src/plugins/scheduler.plugin.js +20 -6
- package/src/plugins/state-machine.plugin.js +40 -9
- package/src/plugins/tfstate/base-driver.js +28 -4
- package/src/plugins/tfstate/errors.js +65 -10
- package/src/plugins/tfstate/filesystem-driver.js +52 -8
- package/src/plugins/tfstate/index.js +163 -90
- package/src/plugins/tfstate/s3-driver.js +64 -6
- package/src/plugins/ttl.plugin.js +72 -17
- package/src/plugins/vector/distances.js +18 -12
- package/src/plugins/vector/kmeans.js +26 -4
- package/src/resource.class.js +115 -19
- package/src/testing/factory.class.js +20 -3
- package/src/testing/seeder.class.js +7 -1
- package/src/clients/memory-client.md +0 -917
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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)
|
|
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
|
|
package/src/plugins/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
39
|
+
export * from './cloud-inventory/index.js'
|
|
40
|
+
export * from './kubernetes-inventory/index.js'
|