s3db.js 13.6.0 → 13.6.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.
package/README.md CHANGED
@@ -106,6 +106,18 @@
106
106
 
107
107
  ---
108
108
 
109
+ ## 📚 Documentation Quick Links
110
+
111
+ > **Core Concepts:** [Schema Validation](./docs/schema.md) • [Client API](./docs/client.md) • [Fastest Validator](./docs/fastest-validator.md)
112
+
113
+ > **Plugins:** [API Plugin](./docs/plugins/api.md) • [Identity Plugin](./docs/plugins/identity.md) • [All Plugins](#-plugins)
114
+
115
+ > **Integrations:** [MCP Server](./docs/mcp.md) • [Model Context Protocol](./docs/mcp.md)
116
+
117
+ > **Advanced:** [Performance Tuning](./docs/benchmarks/) • [Migration Guides](./docs/examples/) • [TypeScript Support](./docs/typescript/)
118
+
119
+ ---
120
+
109
121
  ## 🚀 Quick Start
110
122
 
111
123
  Get up and running in less than 5 minutes!
@@ -1271,34 +1283,77 @@ orders.useMiddleware('updated', async (ctx, next) => {
1271
1283
 
1272
1284
  ## 🔌 Plugins
1273
1285
 
1274
- Extend s3db.js with powerful plugins for caching, monitoring, replication, relationships, and more.
1275
-
1276
- ### Available Plugins
1277
-
1278
- | Plugin | Description | Dependencies |
1279
- |--------|-------------|--------------|
1280
- | [**APIPlugin**](./docs/plugins/api.md) | Auto-generated REST API with OpenAPI, path-based auth, template engine | `ejs` (optional) |
1281
- | [**AuditPlugin**](./docs/plugins/audit.md) | Complete audit trail for all operations | None |
1282
- | [**BackupPlugin**](./docs/plugins/backup.md) | Multi-destination backup system for data protection | None |
1283
- | [**CachePlugin**](./docs/plugins/cache.md) | Memory/S3/filesystem caching with compression | None |
1284
- | [**CloudInventoryPlugin**](./docs/plugins/cloud-inventory.md) | Multi-cloud inventory with versioning & diffs | None |
1285
- | [**CostsPlugin**](./docs/plugins/costs.md) | AWS cost tracking and optimization | None |
1286
- | [**EventualConsistencyPlugin**](./docs/plugins/eventual-consistency.md) | Eventually consistent counters and analytics | None |
1287
- | [**FullTextPlugin**](./docs/plugins/fulltext.md) | Full-text search with indexing | None |
1288
- | [**GeoPlugin**](./docs/plugins/geo.md) | Geospatial queries and distance calculations | None |
1289
- | [**IdentityPlugin**](./docs/plugins/identity.md) | OAuth2/OIDC authentication with MFA and whitelabel UI | None |
1290
- | [**ImporterPlugin**](./docs/plugins/importer.md) | Multi-format data import (JSON, CSV, bulk migrations) | None |
1291
- | [**MetricsPlugin**](./docs/plugins/metrics.md) | Performance monitoring and Prometheus export | None |
1292
- | [**MLPlugin**](./docs/plugins/ml-plugin.md) | Machine learning model management and inference | None |
1293
- | [**QueueConsumerPlugin**](./docs/plugins/queue-consumer.md) | Process RabbitMQ/SQS messages for event-driven architecture | `@aws-sdk/client-sqs`, `amqplib` |
1294
- | [**RelationPlugin**](./docs/plugins/relation.md) | ORM-like relationships (10-100x faster queries) | None |
1295
- | [**ReplicatorPlugin**](./docs/plugins/replicator.md) | Real-time replication to BigQuery, PostgreSQL, SQS | `pg`, `@google-cloud/bigquery`, `@aws-sdk/client-sqs` |
1296
- | [**S3QueuePlugin**](./docs/plugins/s3-queue.md) | Distributed queue with zero race conditions | None |
1297
- | [**SchedulerPlugin**](./docs/plugins/scheduler.md) | Cron-based job scheduling for maintenance tasks | `node-cron` |
1298
- | [**StateMachinePlugin**](./docs/plugins/state-machine.md) | Finite state machine workflows for business processes | None |
1299
- | [**TfstatePlugin**](./docs/plugins/tfstate.md) | Track Terraform infrastructure changes | `node-cron` |
1300
- | [**TTLPlugin**](./docs/plugins/ttl.md) | Auto-cleanup expired records (O(1) partition-based) | None |
1301
- | [**VectorPlugin**](./docs/plugins/vector.md) | Vector similarity search (cosine, euclidean) for RAG & ML | None |
1286
+ > **Quick Jump:** [🌐 API](#-api) | [🔐 Identity](#-identity) | [⚡ Performance](#-performance) | [📊 Data](#-data) | [🔧 DevOps](#-devops) | [🤖 ML/AI](#-mlai)
1287
+
1288
+ Extend s3db.js with powerful plugins. All plugins are optional and can be installed independently.
1289
+
1290
+ ### 🌐 API & Auth
1291
+
1292
+ [**APIPlugin**](./docs/plugins/api.md) [**IdentityPlugin**](./docs/plugins/identity.md)
1293
+
1294
+ **APIPlugin** - Transform s3db.js into production-ready REST API with OpenAPI, multi-auth (JWT/OIDC/Basic/API Key), rate limiting, and template engines.
1295
+
1296
+ **IdentityPlugin** - Complete OAuth2/OIDC server with MFA, whitelabel UI, and enterprise SSO.
1297
+
1298
+ ### Performance
1299
+
1300
+ [**CachePlugin**](./docs/plugins/cache.md) [**TTLPlugin**](./docs/plugins/ttl.md) [**EventualConsistencyPlugin**](./docs/plugins/eventual-consistency.md) [**MetricsPlugin**](./docs/plugins/metrics.md)
1301
+
1302
+ **CachePlugin** - Memory/S3/filesystem caching with compression and automatic invalidation.
1303
+
1304
+ **TTLPlugin** - Auto-cleanup expired records with O(1) partition-based deletion.
1305
+
1306
+ **EventualConsistencyPlugin** - Eventually consistent counters and high-performance analytics.
1307
+
1308
+ **MetricsPlugin** - Performance monitoring with Prometheus export.
1309
+
1310
+ ### 📊 Data & Replication
1311
+
1312
+ [**ReplicatorPlugin**](./docs/plugins/replicator.md) [**ImporterPlugin**](./docs/plugins/importer.md) [**BackupPlugin**](./docs/plugins/backup.md) • [**AuditPlugin**](./docs/plugins/audit.md)
1313
+
1314
+ **ReplicatorPlugin** - Real-time replication to BigQuery, PostgreSQL, MySQL, Turso, PlanetScale, and SQS.
1315
+
1316
+ **ImporterPlugin** - Multi-format data import (JSON, CSV, bulk migrations).
1317
+
1318
+ **BackupPlugin** - Multi-destination backup system for disaster recovery.
1319
+
1320
+ **AuditPlugin** - Complete audit trail for compliance and security.
1321
+
1322
+ ### 🔧 DevOps & Automation
1323
+
1324
+ [**QueueConsumerPlugin**](./docs/plugins/queue-consumer.md) • [**SchedulerPlugin**](./docs/plugins/scheduler.md) • [**TfstatePlugin**](./docs/plugins/tfstate.md) • [**CloudInventoryPlugin**](./docs/plugins/cloud-inventory.md) • [**CostsPlugin**](./docs/plugins/costs.md)
1325
+
1326
+ **QueueConsumerPlugin** - Process RabbitMQ/SQS messages for event-driven architectures.
1327
+
1328
+ **SchedulerPlugin** - Cron-based job scheduling for maintenance tasks.
1329
+
1330
+ **TfstatePlugin** - Track Terraform infrastructure changes and drift detection.
1331
+
1332
+ **CloudInventoryPlugin** - Multi-cloud inventory with versioning and diff tracking.
1333
+
1334
+ **CostsPlugin** - AWS cost tracking and optimization insights.
1335
+
1336
+ ### 🤖 ML/AI & Advanced Features
1337
+
1338
+ [**MLPlugin**](./docs/plugins/ml-plugin.md) • [**VectorPlugin**](./docs/plugins/vector.md) • [**FullTextPlugin**](./docs/plugins/fulltext.md) • [**GeoPlugin**](./docs/plugins/geo.md)
1339
+
1340
+ **MLPlugin** - Machine learning model management and inference pipelines.
1341
+
1342
+ **VectorPlugin** - Vector similarity search (cosine, euclidean) for RAG and ML applications.
1343
+
1344
+ **FullTextPlugin** - Full-text search with tokenization and indexing.
1345
+
1346
+ **GeoPlugin** - Geospatial queries and distance calculations.
1347
+
1348
+ ### 🔗 Other Plugins
1349
+
1350
+ [**RelationPlugin**](./docs/plugins/relation.md) • [**StateMachinePlugin**](./docs/plugins/state-machine.md) • [**S3QueuePlugin**](./docs/plugins/s3-queue.md)
1351
+
1352
+ **RelationPlugin** - ORM-like relationships with join optimization (10-100x faster queries).
1353
+
1354
+ **StateMachinePlugin** - Finite state machine workflows for business processes.
1355
+
1356
+ **S3QueuePlugin** - Distributed queue with zero race conditions using S3.
1302
1357
 
1303
1358
  ### Plugin Installation
1304
1359
 
package/dist/s3db.cjs CHANGED
@@ -6742,6 +6742,16 @@ async function loadEJS() {
6742
6742
  );
6743
6743
  }
6744
6744
  }
6745
+ async function loadPug() {
6746
+ try {
6747
+ const pug = await import('pug');
6748
+ return pug.default || pug;
6749
+ } catch (err) {
6750
+ throw new Error(
6751
+ "Pug template engine not installed. Install with: npm install pug\nPug is a peer dependency to keep the core package lightweight."
6752
+ );
6753
+ }
6754
+ }
6745
6755
  function setupTemplateEngine(options = {}) {
6746
6756
  const {
6747
6757
  engine = "jsx",
@@ -6756,6 +6766,27 @@ function setupTemplateEngine(options = {}) {
6756
6766
  if (typeof template === "object" && template !== null) {
6757
6767
  return c.html(template);
6758
6768
  }
6769
+ if (engine === "pug") {
6770
+ const pug = await loadPug();
6771
+ const templateFile = template.endsWith(".pug") ? template : `${template}.pug`;
6772
+ const templatePath = path.join(templatesPath, templateFile);
6773
+ if (!fs$1.existsSync(templatePath)) {
6774
+ throw new Error(`Template not found: ${templatePath}`);
6775
+ }
6776
+ const renderData = {
6777
+ ...data,
6778
+ // Add helpers that Pug templates might expect
6779
+ _url: c.req.url,
6780
+ _path: c.req.path,
6781
+ _method: c.req.method
6782
+ };
6783
+ const html = pug.renderFile(templatePath, {
6784
+ ...renderData,
6785
+ ...engineOptions,
6786
+ ...renderOptions
6787
+ });
6788
+ return c.html(html);
6789
+ }
6759
6790
  if (engine === "ejs") {
6760
6791
  const ejs = await loadEJS();
6761
6792
  const templateFile = template.endsWith(".ejs") ? template : `${template}.ejs`;
@@ -34068,7 +34099,7 @@ class Database extends EventEmitter {
34068
34099
  })();
34069
34100
  this.version = "1";
34070
34101
  this.s3dbVersion = (() => {
34071
- const [ok, err, version] = tryFn(() => true ? "13.6.0" : "latest");
34102
+ const [ok, err, version] = tryFn(() => true ? "13.6.1" : "latest");
34072
34103
  return ok ? version : "latest";
34073
34104
  })();
34074
34105
  this._resourcesMap = {};