@futdevpro/nts-dynamo 1.15.186 → 1.15.187

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 (21) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +795 -789
  3. package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.d.ts +8 -0
  4. package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.d.ts.map +1 -1
  5. package/build/_modules/privacy-lifecycle/index.d.ts +2 -1
  6. package/build/_modules/privacy-lifecycle/index.d.ts.map +1 -1
  7. package/build/_modules/privacy-lifecycle/index.js +4 -1
  8. package/build/_modules/privacy-lifecycle/index.js.map +1 -1
  9. package/build/_modules/privacy-lifecycle/privacy-export-artifact-privacy-contributor.control-service.d.ts +30 -0
  10. package/build/_modules/privacy-lifecycle/privacy-export-artifact-privacy-contributor.control-service.d.ts.map +1 -0
  11. package/build/_modules/privacy-lifecycle/privacy-export-artifact-privacy-contributor.control-service.js +95 -0
  12. package/build/_modules/privacy-lifecycle/privacy-export-artifact-privacy-contributor.control-service.js.map +1 -0
  13. package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.d.ts +6 -1
  14. package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.d.ts.map +1 -1
  15. package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.js +44 -0
  16. package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.js.map +1 -1
  17. package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.d.ts +5 -1
  18. package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.d.ts.map +1 -1
  19. package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.js +14 -0
  20. package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.js.map +1 -1
  21. package/package.json +1 -1
package/README.md CHANGED
@@ -1,349 +1,349 @@
1
- # Dynamo-NTS
2
-
3
- ![Dynamo-NTS Logo](src/_assets/dynamo-nts-logo-256.png)
4
-
5
- **Dynamo-NTS** (NodeTS) is a comprehensive backend framework for building robust, secure, and scalable Node.js applications with TypeScript. Built on top of [Dynamo FSM](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) (`@futdevpro/fsm-dynamo`), it provides a structured approach to server-side development with clear separation of concerns, extensive configuration options, and production-ready implementations for common backend tasks.
6
-
7
- Dynamo-NTS uses **[Dynamo FSM](https://www.npmjs.com/package/@futdevpro/fsm-dynamo)** as its foundational layer, implementing the server-side components of the FSM architecture. All core interfaces, types, and utilities are provided by FSM, ensuring consistency and type safety across the entire Dynamo ecosystem.
8
-
9
- Dynamo-NTS is part of the unified **Dynamo ecosystem**, a full-stack development framework designed to accelerate the development of scalable web applications. The ecosystem consists of interconnected packages that work together seamlessly, with Dynamo-NTS serving as the backend implementation layer. The frontend counterpart is **[Dynamo NGX](https://www.npmjs.com/package/@futdevpro/ngx-dynamo)**, which uses **[Dynamo NGX Models](https://www.npmjs.com/package/@futdevpro/ngx-dynamo-models)** for type-safe model definitions.
10
-
11
- ### Design Philosophy
12
-
13
- Dynamo-NTS is built with two key principles:
14
-
15
- - **Full Override Capability**: Every component, service, and class can be overridden or extended. The framework provides a solid foundation with sensible defaults, but you have complete control to customize or replace any part to fit your specific needs. This makes Dynamo-NTS highly customizable and adaptable to any project requirements.
16
-
17
- - **Complete Type Information**: All types, interfaces, and definitions are included in the compiled output. This ensures excellent readability and maintainability—everything you need is available at compile time through TypeScript's type system, providing full IntelliSense support and eliminating the need to reference external documentation during development.
18
-
19
- ### Simplified System Definitions
20
-
21
- Dynamo-NTS simplifies complex system definitions by abstracting common backend infrastructure into simple parameterization. Instead of manually configuring various libraries and services, you define your application through straightforward parameter objects:
22
-
23
- - **Express Usage**: HTTP/HTTPS server setup, routing, middleware, and error handling are configured through `DyNTS_App_Params`, `DyNTS_Http_Settings`, and `DyNTS_RoutingModule` parameters (simplifies Express server initialization and route management)
24
- - **MongoDB/Mongoose Usage**: Database connections, models, schemas, and operations are managed through `DyNTS_DBService` and `DyNTS_DataService` with simple data model parameter definitions (simplifies Mongoose schema creation and model management)
25
- - **Socket.io Usage**: Real-time communication setup, event handling, and presence tracking are configured through `DyNTS_SocketServerService` parameters and the `DyNTS_AppExtended` class (simplifies Socket.io server initialization and event management)
26
- - **Nodemailer Usage**: Email sending with templating, attachments, and async delivery is handled through `DyNTS_EmailService` with template component definitions (simplifies Nodemailer transporter setup and email template management)
27
- - **OAuth2 Implementation**: Complete OAuth2.0 protocol flows including authorization codes, token exchange, and refresh tokens are managed through `DyNTS_OAuth2_Controller` and `DyNTS_OAuth2_AuthService` (simplifies complex OAuth2 flow implementation)
28
- - **Axios Usage**: HTTP client requests to external APIs are standardized through `DyNTS_ApiService` with `DyNTS_ApiCall_Params` configuration (simplifies Axios request setup, error handling, and response management)
29
- - **Discord.js / Slack / Teams Bot Development**: Platform-agnostic bot framework through `DyNTS_Bot_MessagingProvider_ServiceBase` and bot modules (simplifies Discord.js, Slack, and Teams bot development with unified interfaces)
30
- - **OpenAI / AI Provider Integration**: AI/LLM operations including chat, embeddings, and vector search are abstracted through `DyNTS_AI_Provider_ServiceBase` and provider implementations (simplifies OpenAI SDK usage and enables multi-provider architecture)
31
- - **Location Tracking**: Optional, local-only IP geolocation through `geoip-lite`; addresses are not sent to an external service or written to logs by Dynamo-NTS
32
-
33
- This parameterization approach eliminates boilerplate code and provides a consistent, type-safe interface for all backend operations. Instead of learning multiple library APIs and their configuration patterns, developers work with unified Dynamo-NTS parameter objects that handle the underlying complexity.
34
-
35
- ### Content-free process diagnostics
36
-
37
- `DyNTS_App` projects bootstrap failures, unhandled promise rejections, database connection/runtime failures,
38
- HTTP/HTTPS server errors, routing failures and Express fallbacks through the versioned
39
- `dynts-safe-diagnostic/1` contract before framework-owned logging or error forwarding. The public allowlist is
40
- limited to `contractVersion`, `code`, `stage`, `causeType`, `fingerprint` and `status`. Raw error messages,
41
- stacks, rejected promises, requests and database URIs are excluded. The fingerprint is derived only from the
42
- allowlisted classification, never from raw failure content.
43
-
44
- Consumers can use `DyNTS_SafeDiagnostic_ControlService.project()` when they need the same deterministic
45
- projection without logging, `report()` for safe framework logging, and `toError()` when a content-free
46
- `DyFM_Error` must cross an existing error-handler boundary. See
47
- [`__documentations/2026-08-22-content-free-process-error-boundary.md`](./__documentations/2026-08-22-content-free-process-error-boundary.md)
48
- for the normative boundary and verification matrix.
49
-
50
- ## Table of Contents
51
-
52
- - [Installation](#installation)
53
- - [Quick Start](#quick-start)
54
- - [Core Concepts](#core-concepts)
55
- - [Modules Overview](#modules-overview)
56
- - [Usage Examples](#usage-examples)
57
- - [Ecosystem Integration](#ecosystem-integration)
58
- - [API Reference](#api-reference)
59
-
60
- ## Installation
61
-
62
- Install Dynamo-NTS using pnpm (recommended) or npm:
63
-
64
- ```bash
65
- pnpm add @futdevpro/dynamo-nts
66
- # or
67
- npm install @futdevpro/dynamo-nts
68
- ```
69
-
70
- ### Peer Dependencies
71
-
72
- Dynamo-NTS requires peer dependencies that are divided into two categories: core dependencies (required for the main module) and module-specific dependencies (required only when using specific modules).
73
-
74
- #### Core Dependencies (Required)
75
-
76
- These dependencies are required for the main Dynamo-NTS functionality:
77
-
78
- - [`@futdevpro/fsm-dynamo`](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) - The foundational package providing core interfaces and utilities (always required)
79
- - `express` - Web framework for Node.js (simplified through Dynamo-NTS parameterization)
80
- - `mongoose` - MongoDB object modeling (simplified through Dynamo-NTS data services)
81
- - `axios` - HTTP client (simplified through Dynamo-NTS API service)
82
- - `body-parser` - Request body parsing middleware
83
- - `dotenv` - Environment variable management
84
- - `rxjs` - Reactive programming library
85
- - `@types/express` - TypeScript types for Express
86
- - `@types/node` - TypeScript types for Node.js
87
- - `ts-node` - TypeScript execution environment
88
-
89
- Install core dependencies:
90
-
91
- ```bash
92
- pnpm add @futdevpro/fsm-dynamo express mongoose axios body-parser dotenv rxjs @types/express @types/node ts-node
93
- ```
94
-
95
- #### Module-Specific Dependencies (Optional)
96
-
97
- These dependencies are only required when using specific modules:
98
-
99
- - **Socket Module**: `socket.io` - Real-time communication (simplified through Dynamo-NTS socket services)
100
- - **Email Service**: `nodemailer` - Email sending (simplified through Dynamo-NTS email services)
101
- - **Usage Module**: `geoip-lite` and `@types/geoip-lite` - optional, local-only IP geolocation. The provider is loaded only when a lookup is requested. Without it, lookup methods return `null` and the rest of Dynamo-NTS remains usable. The supported secure `geoip-lite` line requires Node.js 24 or newer.
102
- - **Bot Module (Discord)**: `discord.js` - Discord bot development (simplified through Dynamo-NTS bot module)
103
- - **AI Module (OpenAI)**: `openai` - OpenAI API integration (simplified through Dynamo-NTS AI module)
104
-
105
- The GeoIP lookup itself does not transmit or log an address. Calling the Usage module can persist the
106
- request address and derived location in the consumer's own data store. Consumers enabling that capability
107
- must define the applicable lawful basis, user-facing transparency, access controls, retention and deletion.
108
-
109
- Install module-specific dependencies as needed:
110
-
111
- ```bash
112
- # For Socket module
113
- pnpm add socket.io
114
-
115
- # For Email service
116
- pnpm add nodemailer
117
-
118
- # For Usage module
119
- pnpm add geoip-lite@^2.0.3 @types/geoip-lite@^1.4.4
120
-
121
- # For Bot module (Discord)
122
- pnpm add discord.js
123
-
124
- # For AI module (OpenAI)
125
- pnpm add openai
126
- ```
127
-
128
- ## Quick Start
129
-
130
- The following example demonstrates how to set up a basic Dynamo-NTS application with routing and socket support:
131
-
132
- ```typescript
133
- import {
134
- DyNTS_AppExtended,
135
- DyNTS_App_Params,
136
- DyNTS_GlobalService_Settings,
137
- DyNTS_Http_Settings,
138
- DyNTS_RoutingModule
139
- } from '@futdevpro/nts-dynamo';
140
- import {
141
- DyNTS_SocketServerService
142
- } from '@futdevpro/nts-dynamo/socket';
143
- import { DyFM_usageSession_dataParams } from '@futdevpro/fsm-dynamo/usage';
144
- import { DyFM_customData_dataParams } from '@futdevpro/fsm-dynamo/custom-data';
145
- import { DyNTS_getUsageRoutingModule } from '@futdevpro/nts-dynamo/usage';
146
- import { DyNTS_getTestRoutingModule } from '@futdevpro/nts-dynamo/test';
147
-
148
- import { AuthService } from './core-services/auth.service';
149
- import { Email_ServiceCollection } from './core-services/email.service-collection';
150
- import { User_Controller } from './routes/user/user.controller';
151
- import { Chat_SocketServerService } from './socket-services/chat.socket-server-service';
152
-
153
- export class App extends DyNTS_AppExtended {
154
-
155
- getAppParams(): DyNTS_App_Params {
156
- return new DyNTS_App_Params({
157
- name: 'My Application',
158
- version: '1.0.0',
159
- dbName: 'myapp',
160
- dbUri: process.env.MONGO_URL || 'mongodb://localhost:27017/myapp',
161
- systemShortCodeName: 'MYAPP',
162
- });
163
- }
164
-
165
- getGlobalServiceCollection(): DyNTS_GlobalService_Settings {
166
- return {
167
- authService: AuthService.getInstance(),
168
- emailServiceCollection: Email_ServiceCollection.getInstance(),
169
- dbModels: [
170
- // Your data model parameters here
171
- DyFM_usageSession_dataParams,
172
- DyFM_customData_dataParams,
173
- ],
174
- };
175
- }
176
-
177
- getPortSettings(): DyNTS_Http_Settings {
178
- return new DyNTS_Http_Settings({
179
- httpPort: 3000,
180
- });
181
- }
182
-
183
- getRoutingModules(): DyNTS_RoutingModule[] {
184
- return [
185
- new DyNTS_RoutingModule({
186
- route: '/user',
187
- controllers: [
188
- User_Controller.getInstance(),
189
- ],
190
- }),
191
- DyNTS_getTestRoutingModule(),
192
- DyNTS_getUsageRoutingModule(),
193
- ];
194
- }
195
-
196
- getSocketServices(): DyNTS_SocketServerService<any>[] {
197
- return [
198
- Chat_SocketServerService.getInstance(),
199
- ];
200
- }
201
- }
202
-
203
- // Start the application
204
- const app = new App();
205
- ```
206
-
207
- ## Core Concepts
208
-
209
- Dynamo-NTS uses [Dynamo FSM](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) as its foundation, implementing all server-side components defined in the FSM architecture. All types, interfaces, and base models are provided by FSM, ensuring full type safety and consistency.
210
-
211
- ### Extensibility and Customization
212
-
213
- Dynamo-NTS is designed with extensibility in mind. Every component, service, and class can be overridden or extended to meet your specific requirements:
214
-
215
- - **Service Override**: All services (authentication, email, data services, etc.) can be extended or completely replaced with custom implementations
216
- - **Method Override**: Abstract methods in base classes allow you to customize behavior while maintaining the framework structure
217
- - **Configuration Override**: Global settings, route security, and application parameters can be overridden at any level
218
- - **Type Safety**: All overrides maintain full TypeScript type safety, with all types and interfaces available at compile time
219
-
220
- This design philosophy ensures that Dynamo-NTS provides a solid foundation while remaining fully customizable for your specific use cases.
221
-
222
- ### Complete Type Information
223
-
224
- All types, interfaces, and definitions are included in the compiled output, ensuring excellent readability and maintainability. When you compile your project, you have access to:
225
-
226
- - Complete type definitions for all services, models, and interfaces
227
- - Full IntelliSense support in your IDE
228
- - Compile-time type checking for all framework components
229
- - Self-documenting code through TypeScript's type system
230
-
231
- This approach eliminates the need to reference external documentation during development—everything you need is available in your IDE's autocomplete and type hints.
232
-
233
- ### Application Classes
234
-
235
- Dynamo-NTS provides two main application base classes that simplify Express server setup:
236
-
237
- - **`DyNTS_App`**: Basic application class for standard HTTP server applications without real-time socket support
238
- - **`DyNTS_AppExtended`**: Extended application class that includes built-in socket server capabilities for real-time communication (simplifies Socket.io setup)
239
-
240
- Both classes abstract away Express server configuration, requiring you to implement several abstract methods with simple parameter objects:
241
-
242
- - `getAppParams()`: Define application parameters (name, version, database name, etc.) - replaces Express app initialization
243
- - `getGlobalServiceCollection()`: Configure global services (authentication, email, database models) - replaces manual service registration
244
- - `getPortSettings()`: Configure HTTP/HTTPS ports - replaces Express server.listen() configuration
245
- - `getRoutingModules()`: Define API routes and controllers - replaces Express router setup
246
-
247
- ### Data Services
248
-
249
- Data services provide a structured way to interact with MongoDB, simplifying Mongoose model and schema definitions:
250
-
251
- - **`DyNTS_DBService<T>`**: Low-level MongoDB service for direct database operations (simplifies Mongoose model creation)
252
- - **`DyNTS_DataService<T>`**: High-level data service with business logic, validation, and dependency management (simplifies MongoDB CRUD operations)
253
- - **`DyNTS_ArchiveDataService<T>`**: Service for managing archived data in separate collections
254
-
255
- Instead of manually creating Mongoose schemas and models, you define data models through `DyFM_DataModel_Params` (from FSM), and Dynamo-NTS handles schema generation, model creation, and connection management automatically. Data services handle CRUD operations, data validation, dependency tracking, and provide methods for searching, filtering, and managing data relationships.
256
-
257
- ### Atomic MongoDB transactions
258
-
259
- `DyNTS_MongoTransaction_ControlService` is the shared Bedrock entry point for business operations that must
260
- commit several MongoDB writes as one unit. The callback receives the same Mongoose `ClientSession` that must
261
- be attached to every participating query or write:
262
-
263
- ```typescript
264
- import { ClientSession } from 'mongoose';
265
-
266
- import { DyNTS_MongoTransaction_ControlService } from '@futdevpro/nts-dynamo';
267
-
268
- const transactionService: DyNTS_MongoTransaction_ControlService =
269
- DyNTS_MongoTransaction_ControlService.getInstance();
270
-
271
- const pipelineId: string = await transactionService.execute<string>({
272
- transactionName: 'publish-pipeline-version',
273
- issuer: 'pipeline-persistence-service',
274
- maxCommitTimeMs: 3_000,
275
- task: async (session: ClientSession): Promise<string> => {
276
- // Every MongoDB operation in this callback must use `session`.
277
- // Example: await model.updateOne(filter, update, { session: session });
278
- // Example: await auditModel.create([ event ], { session: session });
279
- return 'pipeline-id';
280
- },
281
- });
282
- ```
283
-
284
- The service uses snapshot reads, majority writes and primary routing, always closes the session, and emits
285
- stable content-free error codes. MongoDB transactions require a replica set or sharded deployment; a standalone
286
- MongoDB instance is intentionally not treated as transaction-capable. Mongoose may retry the callback after a
287
- transient transaction error, so the callback must not perform non-transactional side effects such as sending
288
- messages or mutating external systems.
289
-
290
- ### Routing System
291
-
292
- The routing system provides a structured approach to defining RESTful API endpoints, simplifying Express router configuration:
293
-
294
- - **`DyNTS_RoutingModule`**: Groups related controllers under a common route path (replaces Express Router setup)
295
- - **`DyNTS_Controller`**: Abstract base class for defining HTTP endpoints (simplifies Express route handlers)
296
- - **`DyNTS_Endpoint_Params`**: Configuration for individual API endpoints (replaces Express route definitions)
297
-
298
- Instead of manually setting up Express routers and route handlers, you define endpoints through parameter objects. Controllers define endpoints with support for:
299
- - Multiple HTTP methods (GET, POST, PUT, PATCH, DELETE)
300
- - Pre-processing middleware (authentication, validation)
301
- - Task functions for handling requests
302
- - Route security levels (open, secure, both)
303
-
304
- ### Global Services
305
-
306
- The `DyNTS_GlobalService` provides centralized access to:
307
-
308
- - Authentication service
309
- - Email service collection
310
- - Database models registry
311
- - Error handlers
312
- - Socket server instances
313
-
314
- ### Authentication
315
-
316
- Dynamo-NTS provides an abstract `DyNTS_AuthService` class that you can extend to implement your authentication logic. The framework supports:
317
-
318
- - Token-based authentication
319
- - OAuth2 flows (via the OAuth2 module)
320
- - Session management
321
- - Route-level security configuration
322
-
323
- For product-local accounts, the optional `@futdevpro/nts-dynamo/account-security` entry point adds production
324
- security primitives without coupling a product to a shared account provider:
325
-
326
- - versioned adaptive password hashing and rehash detection;
327
- - hash-only email-verification and password-reset challenges with atomic one-time consumption;
328
- - opaque, hash-only access credentials backed by revocable server-side sessions;
329
- - one-time refresh rotation, replay detection, session listing and subject-wide revocation.
330
-
331
- Persistence remains application-owned through explicit atomic adapters. Transports must never put the raw
332
- credentials in URLs, logs, analytics or durable client storage. A consuming application must also apply its
333
- rate-limit, authorization, cookie/storage and audit-redaction policy at the API boundary.
334
-
335
- ### Distributed rate limiting
336
-
337
- The `@futdevpro/nts-dynamo/rate-limit` entry point provides an atomic rate-limit boundary for HTTP services:
338
-
339
- - an exact sliding-window in-memory store for deterministic tests and explicitly single-instance development;
340
- - an application-owned shared-store contract for production deployments;
341
- - a production configuration gate that requires both shared persistence and explicit opaque subject/endpoint
342
- extractors;
343
- - validated positive limits, windows and weighted request costs with stable, content-free failures;
344
- - trusted `req.ip` as the safe local default instead of reading caller-controlled forwarding headers directly;
345
- - explicit opportunistic local cleanup with no timer, polling loop or hidden background task.
346
-
1
+ # Dynamo-NTS
2
+
3
+ ![Dynamo-NTS Logo](src/_assets/dynamo-nts-logo-256.png)
4
+
5
+ **Dynamo-NTS** (NodeTS) is a comprehensive backend framework for building robust, secure, and scalable Node.js applications with TypeScript. Built on top of [Dynamo FSM](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) (`@futdevpro/fsm-dynamo`), it provides a structured approach to server-side development with clear separation of concerns, extensive configuration options, and production-ready implementations for common backend tasks.
6
+
7
+ Dynamo-NTS uses **[Dynamo FSM](https://www.npmjs.com/package/@futdevpro/fsm-dynamo)** as its foundational layer, implementing the server-side components of the FSM architecture. All core interfaces, types, and utilities are provided by FSM, ensuring consistency and type safety across the entire Dynamo ecosystem.
8
+
9
+ Dynamo-NTS is part of the unified **Dynamo ecosystem**, a full-stack development framework designed to accelerate the development of scalable web applications. The ecosystem consists of interconnected packages that work together seamlessly, with Dynamo-NTS serving as the backend implementation layer. The frontend counterpart is **[Dynamo NGX](https://www.npmjs.com/package/@futdevpro/ngx-dynamo)**, which uses **[Dynamo NGX Models](https://www.npmjs.com/package/@futdevpro/ngx-dynamo-models)** for type-safe model definitions.
10
+
11
+ ### Design Philosophy
12
+
13
+ Dynamo-NTS is built with two key principles:
14
+
15
+ - **Full Override Capability**: Every component, service, and class can be overridden or extended. The framework provides a solid foundation with sensible defaults, but you have complete control to customize or replace any part to fit your specific needs. This makes Dynamo-NTS highly customizable and adaptable to any project requirements.
16
+
17
+ - **Complete Type Information**: All types, interfaces, and definitions are included in the compiled output. This ensures excellent readability and maintainability—everything you need is available at compile time through TypeScript's type system, providing full IntelliSense support and eliminating the need to reference external documentation during development.
18
+
19
+ ### Simplified System Definitions
20
+
21
+ Dynamo-NTS simplifies complex system definitions by abstracting common backend infrastructure into simple parameterization. Instead of manually configuring various libraries and services, you define your application through straightforward parameter objects:
22
+
23
+ - **Express Usage**: HTTP/HTTPS server setup, routing, middleware, and error handling are configured through `DyNTS_App_Params`, `DyNTS_Http_Settings`, and `DyNTS_RoutingModule` parameters (simplifies Express server initialization and route management)
24
+ - **MongoDB/Mongoose Usage**: Database connections, models, schemas, and operations are managed through `DyNTS_DBService` and `DyNTS_DataService` with simple data model parameter definitions (simplifies Mongoose schema creation and model management)
25
+ - **Socket.io Usage**: Real-time communication setup, event handling, and presence tracking are configured through `DyNTS_SocketServerService` parameters and the `DyNTS_AppExtended` class (simplifies Socket.io server initialization and event management)
26
+ - **Nodemailer Usage**: Email sending with templating, attachments, and async delivery is handled through `DyNTS_EmailService` with template component definitions (simplifies Nodemailer transporter setup and email template management)
27
+ - **OAuth2 Implementation**: Complete OAuth2.0 protocol flows including authorization codes, token exchange, and refresh tokens are managed through `DyNTS_OAuth2_Controller` and `DyNTS_OAuth2_AuthService` (simplifies complex OAuth2 flow implementation)
28
+ - **Axios Usage**: HTTP client requests to external APIs are standardized through `DyNTS_ApiService` with `DyNTS_ApiCall_Params` configuration (simplifies Axios request setup, error handling, and response management)
29
+ - **Discord.js / Slack / Teams Bot Development**: Platform-agnostic bot framework through `DyNTS_Bot_MessagingProvider_ServiceBase` and bot modules (simplifies Discord.js, Slack, and Teams bot development with unified interfaces)
30
+ - **OpenAI / AI Provider Integration**: AI/LLM operations including chat, embeddings, and vector search are abstracted through `DyNTS_AI_Provider_ServiceBase` and provider implementations (simplifies OpenAI SDK usage and enables multi-provider architecture)
31
+ - **Location Tracking**: Optional, local-only IP geolocation through `geoip-lite`; addresses are not sent to an external service or written to logs by Dynamo-NTS
32
+
33
+ This parameterization approach eliminates boilerplate code and provides a consistent, type-safe interface for all backend operations. Instead of learning multiple library APIs and their configuration patterns, developers work with unified Dynamo-NTS parameter objects that handle the underlying complexity.
34
+
35
+ ### Content-free process diagnostics
36
+
37
+ `DyNTS_App` projects bootstrap failures, unhandled promise rejections, database connection/runtime failures,
38
+ HTTP/HTTPS server errors, routing failures and Express fallbacks through the versioned
39
+ `dynts-safe-diagnostic/1` contract before framework-owned logging or error forwarding. The public allowlist is
40
+ limited to `contractVersion`, `code`, `stage`, `causeType`, `fingerprint` and `status`. Raw error messages,
41
+ stacks, rejected promises, requests and database URIs are excluded. The fingerprint is derived only from the
42
+ allowlisted classification, never from raw failure content.
43
+
44
+ Consumers can use `DyNTS_SafeDiagnostic_ControlService.project()` when they need the same deterministic
45
+ projection without logging, `report()` for safe framework logging, and `toError()` when a content-free
46
+ `DyFM_Error` must cross an existing error-handler boundary. See
47
+ [`__documentations/2026-08-22-content-free-process-error-boundary.md`](./__documentations/2026-08-22-content-free-process-error-boundary.md)
48
+ for the normative boundary and verification matrix.
49
+
50
+ ## Table of Contents
51
+
52
+ - [Installation](#installation)
53
+ - [Quick Start](#quick-start)
54
+ - [Core Concepts](#core-concepts)
55
+ - [Modules Overview](#modules-overview)
56
+ - [Usage Examples](#usage-examples)
57
+ - [Ecosystem Integration](#ecosystem-integration)
58
+ - [API Reference](#api-reference)
59
+
60
+ ## Installation
61
+
62
+ Install Dynamo-NTS using pnpm (recommended) or npm:
63
+
64
+ ```bash
65
+ pnpm add @futdevpro/dynamo-nts
66
+ # or
67
+ npm install @futdevpro/dynamo-nts
68
+ ```
69
+
70
+ ### Peer Dependencies
71
+
72
+ Dynamo-NTS requires peer dependencies that are divided into two categories: core dependencies (required for the main module) and module-specific dependencies (required only when using specific modules).
73
+
74
+ #### Core Dependencies (Required)
75
+
76
+ These dependencies are required for the main Dynamo-NTS functionality:
77
+
78
+ - [`@futdevpro/fsm-dynamo`](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) - The foundational package providing core interfaces and utilities (always required)
79
+ - `express` - Web framework for Node.js (simplified through Dynamo-NTS parameterization)
80
+ - `mongoose` - MongoDB object modeling (simplified through Dynamo-NTS data services)
81
+ - `axios` - HTTP client (simplified through Dynamo-NTS API service)
82
+ - `body-parser` - Request body parsing middleware
83
+ - `dotenv` - Environment variable management
84
+ - `rxjs` - Reactive programming library
85
+ - `@types/express` - TypeScript types for Express
86
+ - `@types/node` - TypeScript types for Node.js
87
+ - `ts-node` - TypeScript execution environment
88
+
89
+ Install core dependencies:
90
+
91
+ ```bash
92
+ pnpm add @futdevpro/fsm-dynamo express mongoose axios body-parser dotenv rxjs @types/express @types/node ts-node
93
+ ```
94
+
95
+ #### Module-Specific Dependencies (Optional)
96
+
97
+ These dependencies are only required when using specific modules:
98
+
99
+ - **Socket Module**: `socket.io` - Real-time communication (simplified through Dynamo-NTS socket services)
100
+ - **Email Service**: `nodemailer` - Email sending (simplified through Dynamo-NTS email services)
101
+ - **Usage Module**: `geoip-lite` and `@types/geoip-lite` - optional, local-only IP geolocation. The provider is loaded only when a lookup is requested. Without it, lookup methods return `null` and the rest of Dynamo-NTS remains usable. The supported secure `geoip-lite` line requires Node.js 24 or newer.
102
+ - **Bot Module (Discord)**: `discord.js` - Discord bot development (simplified through Dynamo-NTS bot module)
103
+ - **AI Module (OpenAI)**: `openai` - OpenAI API integration (simplified through Dynamo-NTS AI module)
104
+
105
+ The GeoIP lookup itself does not transmit or log an address. Calling the Usage module can persist the
106
+ request address and derived location in the consumer's own data store. Consumers enabling that capability
107
+ must define the applicable lawful basis, user-facing transparency, access controls, retention and deletion.
108
+
109
+ Install module-specific dependencies as needed:
110
+
111
+ ```bash
112
+ # For Socket module
113
+ pnpm add socket.io
114
+
115
+ # For Email service
116
+ pnpm add nodemailer
117
+
118
+ # For Usage module
119
+ pnpm add geoip-lite@^2.0.3 @types/geoip-lite@^1.4.4
120
+
121
+ # For Bot module (Discord)
122
+ pnpm add discord.js
123
+
124
+ # For AI module (OpenAI)
125
+ pnpm add openai
126
+ ```
127
+
128
+ ## Quick Start
129
+
130
+ The following example demonstrates how to set up a basic Dynamo-NTS application with routing and socket support:
131
+
132
+ ```typescript
133
+ import {
134
+ DyNTS_AppExtended,
135
+ DyNTS_App_Params,
136
+ DyNTS_GlobalService_Settings,
137
+ DyNTS_Http_Settings,
138
+ DyNTS_RoutingModule
139
+ } from '@futdevpro/nts-dynamo';
140
+ import {
141
+ DyNTS_SocketServerService
142
+ } from '@futdevpro/nts-dynamo/socket';
143
+ import { DyFM_usageSession_dataParams } from '@futdevpro/fsm-dynamo/usage';
144
+ import { DyFM_customData_dataParams } from '@futdevpro/fsm-dynamo/custom-data';
145
+ import { DyNTS_getUsageRoutingModule } from '@futdevpro/nts-dynamo/usage';
146
+ import { DyNTS_getTestRoutingModule } from '@futdevpro/nts-dynamo/test';
147
+
148
+ import { AuthService } from './core-services/auth.service';
149
+ import { Email_ServiceCollection } from './core-services/email.service-collection';
150
+ import { User_Controller } from './routes/user/user.controller';
151
+ import { Chat_SocketServerService } from './socket-services/chat.socket-server-service';
152
+
153
+ export class App extends DyNTS_AppExtended {
154
+
155
+ getAppParams(): DyNTS_App_Params {
156
+ return new DyNTS_App_Params({
157
+ name: 'My Application',
158
+ version: '1.0.0',
159
+ dbName: 'myapp',
160
+ dbUri: process.env.MONGO_URL || 'mongodb://localhost:27017/myapp',
161
+ systemShortCodeName: 'MYAPP',
162
+ });
163
+ }
164
+
165
+ getGlobalServiceCollection(): DyNTS_GlobalService_Settings {
166
+ return {
167
+ authService: AuthService.getInstance(),
168
+ emailServiceCollection: Email_ServiceCollection.getInstance(),
169
+ dbModels: [
170
+ // Your data model parameters here
171
+ DyFM_usageSession_dataParams,
172
+ DyFM_customData_dataParams,
173
+ ],
174
+ };
175
+ }
176
+
177
+ getPortSettings(): DyNTS_Http_Settings {
178
+ return new DyNTS_Http_Settings({
179
+ httpPort: 3000,
180
+ });
181
+ }
182
+
183
+ getRoutingModules(): DyNTS_RoutingModule[] {
184
+ return [
185
+ new DyNTS_RoutingModule({
186
+ route: '/user',
187
+ controllers: [
188
+ User_Controller.getInstance(),
189
+ ],
190
+ }),
191
+ DyNTS_getTestRoutingModule(),
192
+ DyNTS_getUsageRoutingModule(),
193
+ ];
194
+ }
195
+
196
+ getSocketServices(): DyNTS_SocketServerService<any>[] {
197
+ return [
198
+ Chat_SocketServerService.getInstance(),
199
+ ];
200
+ }
201
+ }
202
+
203
+ // Start the application
204
+ const app = new App();
205
+ ```
206
+
207
+ ## Core Concepts
208
+
209
+ Dynamo-NTS uses [Dynamo FSM](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) as its foundation, implementing all server-side components defined in the FSM architecture. All types, interfaces, and base models are provided by FSM, ensuring full type safety and consistency.
210
+
211
+ ### Extensibility and Customization
212
+
213
+ Dynamo-NTS is designed with extensibility in mind. Every component, service, and class can be overridden or extended to meet your specific requirements:
214
+
215
+ - **Service Override**: All services (authentication, email, data services, etc.) can be extended or completely replaced with custom implementations
216
+ - **Method Override**: Abstract methods in base classes allow you to customize behavior while maintaining the framework structure
217
+ - **Configuration Override**: Global settings, route security, and application parameters can be overridden at any level
218
+ - **Type Safety**: All overrides maintain full TypeScript type safety, with all types and interfaces available at compile time
219
+
220
+ This design philosophy ensures that Dynamo-NTS provides a solid foundation while remaining fully customizable for your specific use cases.
221
+
222
+ ### Complete Type Information
223
+
224
+ All types, interfaces, and definitions are included in the compiled output, ensuring excellent readability and maintainability. When you compile your project, you have access to:
225
+
226
+ - Complete type definitions for all services, models, and interfaces
227
+ - Full IntelliSense support in your IDE
228
+ - Compile-time type checking for all framework components
229
+ - Self-documenting code through TypeScript's type system
230
+
231
+ This approach eliminates the need to reference external documentation during development—everything you need is available in your IDE's autocomplete and type hints.
232
+
233
+ ### Application Classes
234
+
235
+ Dynamo-NTS provides two main application base classes that simplify Express server setup:
236
+
237
+ - **`DyNTS_App`**: Basic application class for standard HTTP server applications without real-time socket support
238
+ - **`DyNTS_AppExtended`**: Extended application class that includes built-in socket server capabilities for real-time communication (simplifies Socket.io setup)
239
+
240
+ Both classes abstract away Express server configuration, requiring you to implement several abstract methods with simple parameter objects:
241
+
242
+ - `getAppParams()`: Define application parameters (name, version, database name, etc.) - replaces Express app initialization
243
+ - `getGlobalServiceCollection()`: Configure global services (authentication, email, database models) - replaces manual service registration
244
+ - `getPortSettings()`: Configure HTTP/HTTPS ports - replaces Express server.listen() configuration
245
+ - `getRoutingModules()`: Define API routes and controllers - replaces Express router setup
246
+
247
+ ### Data Services
248
+
249
+ Data services provide a structured way to interact with MongoDB, simplifying Mongoose model and schema definitions:
250
+
251
+ - **`DyNTS_DBService<T>`**: Low-level MongoDB service for direct database operations (simplifies Mongoose model creation)
252
+ - **`DyNTS_DataService<T>`**: High-level data service with business logic, validation, and dependency management (simplifies MongoDB CRUD operations)
253
+ - **`DyNTS_ArchiveDataService<T>`**: Service for managing archived data in separate collections
254
+
255
+ Instead of manually creating Mongoose schemas and models, you define data models through `DyFM_DataModel_Params` (from FSM), and Dynamo-NTS handles schema generation, model creation, and connection management automatically. Data services handle CRUD operations, data validation, dependency tracking, and provide methods for searching, filtering, and managing data relationships.
256
+
257
+ ### Atomic MongoDB transactions
258
+
259
+ `DyNTS_MongoTransaction_ControlService` is the shared Bedrock entry point for business operations that must
260
+ commit several MongoDB writes as one unit. The callback receives the same Mongoose `ClientSession` that must
261
+ be attached to every participating query or write:
262
+
263
+ ```typescript
264
+ import { ClientSession } from 'mongoose';
265
+
266
+ import { DyNTS_MongoTransaction_ControlService } from '@futdevpro/nts-dynamo';
267
+
268
+ const transactionService: DyNTS_MongoTransaction_ControlService =
269
+ DyNTS_MongoTransaction_ControlService.getInstance();
270
+
271
+ const pipelineId: string = await transactionService.execute<string>({
272
+ transactionName: 'publish-pipeline-version',
273
+ issuer: 'pipeline-persistence-service',
274
+ maxCommitTimeMs: 3_000,
275
+ task: async (session: ClientSession): Promise<string> => {
276
+ // Every MongoDB operation in this callback must use `session`.
277
+ // Example: await model.updateOne(filter, update, { session: session });
278
+ // Example: await auditModel.create([ event ], { session: session });
279
+ return 'pipeline-id';
280
+ },
281
+ });
282
+ ```
283
+
284
+ The service uses snapshot reads, majority writes and primary routing, always closes the session, and emits
285
+ stable content-free error codes. MongoDB transactions require a replica set or sharded deployment; a standalone
286
+ MongoDB instance is intentionally not treated as transaction-capable. Mongoose may retry the callback after a
287
+ transient transaction error, so the callback must not perform non-transactional side effects such as sending
288
+ messages or mutating external systems.
289
+
290
+ ### Routing System
291
+
292
+ The routing system provides a structured approach to defining RESTful API endpoints, simplifying Express router configuration:
293
+
294
+ - **`DyNTS_RoutingModule`**: Groups related controllers under a common route path (replaces Express Router setup)
295
+ - **`DyNTS_Controller`**: Abstract base class for defining HTTP endpoints (simplifies Express route handlers)
296
+ - **`DyNTS_Endpoint_Params`**: Configuration for individual API endpoints (replaces Express route definitions)
297
+
298
+ Instead of manually setting up Express routers and route handlers, you define endpoints through parameter objects. Controllers define endpoints with support for:
299
+ - Multiple HTTP methods (GET, POST, PUT, PATCH, DELETE)
300
+ - Pre-processing middleware (authentication, validation)
301
+ - Task functions for handling requests
302
+ - Route security levels (open, secure, both)
303
+
304
+ ### Global Services
305
+
306
+ The `DyNTS_GlobalService` provides centralized access to:
307
+
308
+ - Authentication service
309
+ - Email service collection
310
+ - Database models registry
311
+ - Error handlers
312
+ - Socket server instances
313
+
314
+ ### Authentication
315
+
316
+ Dynamo-NTS provides an abstract `DyNTS_AuthService` class that you can extend to implement your authentication logic. The framework supports:
317
+
318
+ - Token-based authentication
319
+ - OAuth2 flows (via the OAuth2 module)
320
+ - Session management
321
+ - Route-level security configuration
322
+
323
+ For product-local accounts, the optional `@futdevpro/nts-dynamo/account-security` entry point adds production
324
+ security primitives without coupling a product to a shared account provider:
325
+
326
+ - versioned adaptive password hashing and rehash detection;
327
+ - hash-only email-verification and password-reset challenges with atomic one-time consumption;
328
+ - opaque, hash-only access credentials backed by revocable server-side sessions;
329
+ - one-time refresh rotation, replay detection, session listing and subject-wide revocation.
330
+
331
+ Persistence remains application-owned through explicit atomic adapters. Transports must never put the raw
332
+ credentials in URLs, logs, analytics or durable client storage. A consuming application must also apply its
333
+ rate-limit, authorization, cookie/storage and audit-redaction policy at the API boundary.
334
+
335
+ ### Distributed rate limiting
336
+
337
+ The `@futdevpro/nts-dynamo/rate-limit` entry point provides an atomic rate-limit boundary for HTTP services:
338
+
339
+ - an exact sliding-window in-memory store for deterministic tests and explicitly single-instance development;
340
+ - an application-owned shared-store contract for production deployments;
341
+ - a production configuration gate that requires both shared persistence and explicit opaque subject/endpoint
342
+ extractors;
343
+ - validated positive limits, windows and weighted request costs with stable, content-free failures;
344
+ - trusted `req.ip` as the safe local default instead of reading caller-controlled forwarding headers directly;
345
+ - explicit opportunistic local cleanup with no timer, polling loop or hidden background task.
346
+
347
347
  Production consumers must implement the shared store with one atomic permit decision across every application
348
348
  instance. They must derive non-sensitive, purpose-scoped bucket identifiers and must not persist or log raw IP
349
349
  addresses, credentials, email addresses or other request content as rate-limit keys.
@@ -359,18 +359,19 @@ values such as canonical timestamps and opaque resource identifiers into the tup
359
359
  authorization or business-content fields must remain server-derived and outside the cursor payload.
360
360
 
361
361
  ### Privacy lifecycle
362
-
363
- The optional `@futdevpro/nts-dynamo/privacy-lifecycle` entry point provides the shared machinery for standalone
364
- GDPR-capable products:
365
-
366
- - identity-gated, deadline-bearing data-subject requests;
367
- - explicit `received → identity-verified → scoped → planned → executing → verifying` processing;
362
+
363
+ The optional `@futdevpro/nts-dynamo/privacy-lifecycle` entry point provides the shared machinery for standalone
364
+ GDPR-capable products:
365
+
366
+ - identity-gated, deadline-bearing data-subject requests;
367
+ - explicit `received → identity-verified → scoped → planned → executing → verifying` processing;
368
368
  - deterministic product-domain contributors with resumable partial outcomes and documented retention bases;
369
369
  - bounded deterministic assembly of completed, checksum-verified multi-contributor JSON export bundles;
370
+ - exact subject-and-organization scoped deletion and terminal verification of encrypted export artifacts;
370
371
  - append-only, checksummed legal acceptances;
371
- - versioned, purpose-specific consent grants and withdrawals.
372
-
373
- The Bedrock module coordinates state and evidence only. Each consuming product must register every data domain,
372
+ - versioned, purpose-specific consent grants and withdrawals.
373
+
374
+ The Bedrock module coordinates state and evidence only. Each consuming product must register every data domain,
374
375
  implement hard-delete/anonymization/export behavior, and provide transaction-safe persistence. A request is
375
376
  never reported complete while a registered contributor has a failed outcome.
376
377
 
@@ -380,437 +381,442 @@ checksum, sorts contributors deterministically and returns sensitive JSON only i
380
381
  still owns step-up authorization, response delivery, filename policy and cache-prevention headers, and must never
381
382
  log or persist the returned plaintext without equivalent encryption and expiry controls.
382
383
 
383
- ## Modules Overview
384
-
385
- Dynamo-NTS is organized into focused modules, each providing specific functionality:
386
-
387
- ### Main Module
388
-
389
- The core foundation providing essential components:
390
-
391
- - **Collections**: Archive utilities, global settings, environment configuration
392
- - **Enums**: Data model types, service functions, route security levels
393
- - **Models**: Application configuration interfaces, control models, database types
394
- - **Services**: Core services for API communication, authentication, data management, routing
395
-
396
- ### AI Module
397
-
398
- Provides abstractions and implementations for AI operations:
399
-
400
- - **Abstract Service Bases**: Base classes for AI providers, LLM services, LLM chat services, and embedding services
401
- - **OpenAI Implementation**: Complete OpenAI integration with LLM, chat, and embedding support
402
- - **Document AI**: Document chunking and preprocessing for AI models
403
- - **Vector Search**: MongoDB Atlas vector database operations with automatic data vectorization
404
-
405
- #### OpenAI-Compatible Providers
406
-
407
- The OAI service-ek (`DyNTS_OAI_LLM_ServiceBase`, `DyNTS_OAI_LLMChat_ServiceBase`, `DyNTS_OAI_Embedding_ControlService`) bármely OpenAI-API-kompatibilis endpoint-tal működnek — lokál LLM (LM Studio, Ollama), self-hosted (vLLM, LocalAI) is — a `DyFM_OAI_ClientOptions.baseURL` mező segítségével. Részletek + provider-konfig sample-ök: [`__documentations/2026-05-17-oai-compatible-providers.md`](__documentations/2026-05-17-oai-compatible-providers.md).
408
-
409
- ### Assistant Module
410
-
411
- Platform and AI provider agnostic solutions for creating intelligent assistants:
412
-
413
- - Integrates communication providers (bot) with AI providers (LLM Chat)
414
- - Message conversion utilities
415
- - Conversation management
416
- - Configurable settings for system prompts and message filtering
417
-
418
- ### Bot Module
419
-
420
- Platform-agnostic bot functionality:
421
-
422
- - Message, channel, and user wrappers for any messaging platform
423
- - Command system for bot commands
424
- - Routine system for scheduled and event-driven tasks
425
- - IO management for bot interactions
426
- - Provider support for Discord, Slack, and Teams
427
-
428
- ### Socket Module
429
-
430
- Real-time communication capabilities that simplify Socket.io setup:
431
-
432
- - Socket client and server implementations with secure and open connection options (simplifies Socket.io server initialization)
433
- - Event handling system for managing real-time communications (replaces manual Socket.io event handler setup)
434
- - Presence tracking for monitoring connected clients
435
- - Error handling and logging for reliable operation
436
- - Extended application class with built-in socket server capabilities (automatically configures Socket.io with Express server)
437
-
438
- ### Messaging Module
439
-
440
- Backend implementation for unified messaging system:
441
-
442
- - Data services for messages and conversations
443
- - Control services for business logic orchestration
444
- - Real-time socket events
445
- - RESTful HTTP endpoints
446
- - Integration with bot and assistant modules
447
-
448
- ### OAuth2 Module
449
-
450
- Complete OAuth2.0 protocol implementation:
451
-
452
- - OAuth2 authorization and token management
453
- - Client management and user authentication
454
- - Token exchange and refresh operations
455
- - Authorization code and access token generation
456
-
457
- ### Server Module
458
-
459
- Solutions for basic server endpoints:
460
-
461
- - Error handling for saving and retrieving server errors
462
- - Server status monitoring with version and uptime information
463
- - Server status snapshots for saving and retrieving status at specific times
464
- - Error statistics for monitoring and analysis
465
-
466
- #### Content-free database readiness probe
467
-
468
- Applications can perform one foreground readiness check against their own Mongoose connection without
469
- starting a timer, listener, retry loop, subscription, process hook, or background task:
470
-
471
- ```typescript
472
- import {
473
- DyNTS_DbReadinessProbe_ControlService,
474
- DyNTS_DbReadinessProbeResult_Interface,
475
- } from '@futdevpro/nts-dynamo/server';
476
-
477
- const result: DyNTS_DbReadinessProbeResult_Interface =
478
- await DyNTS_DbReadinessProbe_ControlService.probe({
479
- connection: mongoose.connection,
480
- });
481
- ```
482
-
483
- The `dynts-db-readiness/1` result contains exactly six allowlisted fields: contract version, readiness,
484
- normalized connection state, ping success, bounded stage, and stable result code. It never contains a host,
485
- database name, URI, model metadata, credentials, driver error text, or arbitrary error properties. Failures
486
- resolve to a content-free, fail-closed result and the probe writes no log output.
487
-
488
- Timeout policy and cancellation are caller-owned. The probe observes the supplied `AbortSignal` before and
489
- after its single ping, but it does not create a timeout or interrupt an already-running driver operation.
490
- Configure the driver's operation timeout and abort the supplied signal at the application boundary.
491
-
492
- ### Defaults Module
493
-
494
- Default implementations for common services:
495
-
496
- - Default user data model and service for authentication and user management
497
- - Default authentication service with basic token-based authentication
498
- - Default socket events service with graceful degradation
499
- - All services can be extended or replaced with custom implementations
500
-
501
- ### Custom Data Module
502
-
503
- Tools for managing custom data:
504
-
505
- - Data service for handling custom data operations with optional initialization
506
- - Controller with RESTful endpoints for data operations
507
- - GET endpoint for retrieving custom data by ID
508
- - POST endpoint for modifying custom data
509
- - Configurable routing module with optional security overrides
510
-
511
- ### Test Module
512
-
513
- Testing and monitoring tools:
514
-
515
- - Test endpoints for different HTTP methods (GET, POST, DELETE)
516
- - Server status endpoint with version and uptime information
517
- - Configurable routing module with security override options
518
- - Automatic controller registration for easy setup
519
-
520
- ### Usage Module
521
-
522
- Session and usage tracking tools:
523
-
524
- - Session management tools for creating, updating, and closing sessions
525
- - Usage data collection and analysis tools
526
- - Location tracking from HTTP requests
527
- - Usage statistics retrieval with time range filtering
528
- - Daily usage statistics calculation
529
-
530
- ## Usage Examples
531
-
532
- ### Basic Application Setup
533
-
534
- This example shows a complete application setup using `DyNTS_AppExtended`:
535
-
536
- ```typescript
537
- import {
538
- DyNTS_AppExtended,
539
- DyNTS_App_Params,
540
- DyNTS_GlobalService_Settings,
541
- DyNTS_Http_Settings,
542
- DyNTS_RoutingModule
543
- } from '@futdevpro/nts-dynamo';
544
- import { DyNTS_SocketServerService } from '@futdevpro/nts-dynamo/socket';
545
-
546
- export class App extends DyNTS_AppExtended {
547
-
548
- getAppParams(): DyNTS_App_Params {
549
- return new DyNTS_App_Params({
550
- name: 'My Server',
551
- version: '1.0.0',
552
- dbName: 'myapp',
553
- });
554
- }
555
-
556
- getGlobalServiceCollection(): DyNTS_GlobalService_Settings {
557
- return {
558
- authService: AuthService.getInstance(),
559
- dbModels: [
560
- // Your data models
561
- ],
562
- };
563
- }
564
-
565
- getPortSettings(): DyNTS_Http_Settings {
566
- return new DyNTS_Http_Settings({
567
- httpPort: 3000,
568
- });
569
- }
570
-
571
- getRoutingModules(): DyNTS_RoutingModule[] {
572
- return [
573
- new DyNTS_RoutingModule({
574
- route: '/api',
575
- controllers: [
576
- MyController.getInstance(),
577
- ],
578
- }),
579
- ];
580
- }
581
-
582
- getSocketServices(): DyNTS_SocketServerService<any>[] {
583
- return [
584
- MySocketService.getInstance(),
585
- ];
586
- }
587
- }
588
- ```
589
-
590
- ### Routing Module Configuration
591
-
592
- Multiple routing modules can be configured to organize your API:
593
-
594
- ```typescript
595
- getRoutingModules(): DyNTS_RoutingModule[] {
596
- return [
597
- new DyNTS_RoutingModule({
598
- route: '/user',
599
- controllers: [
600
- User_Controller.getInstance(),
601
- UserData_Controller.getInstance(),
602
- UserSettings_Controller.getInstance(),
603
- ],
604
- }),
605
- new DyNTS_RoutingModule({
606
- route: '/project',
607
- controllers: [
608
- Project_Controller.getInstance(),
609
- ProjectExtension_Controller.getInstance(),
610
- ],
611
- }),
612
- new DyNTS_RoutingModule({
613
- route: '/server',
614
- controllers: [
615
- ServerStatus_Controller.getInstance(),
616
- ],
617
- }),
618
- DyNTS_getTestRoutingModule(),
619
- DyNTS_getUsageRoutingModule(),
620
- ];
621
- }
622
- ```
623
-
624
- ### Controller Implementation
625
-
626
- Controllers define API endpoints with authentication and business logic:
627
-
628
- ```typescript
629
- import { Request, Response } from 'express';
630
- import { DyNTS_Controller, DyNTS_Endpoint_Params } from '@futdevpro/nts-dynamo';
631
- import { DyFM_HttpCallType } from '@futdevpro/fsm-dynamo';
632
-
633
- export class User_Controller extends DyNTS_Controller {
634
-
635
- static getInstance(): User_Controller {
636
- return User_Controller.getSingletonInstance();
637
- }
638
-
639
- private authService: AuthService = AuthService.getInstance();
640
-
641
- setupEndpoints(): void {
642
- this.endpoints = [
643
- new DyNTS_Endpoint_Params({
644
- name: 'getUser',
645
- type: DyFM_HttpCallType.get,
646
- endpoint: '/get/:userId',
647
- preProcesses: [this.authService.authenticate_tokenSelf],
648
- tasks: [
649
- async (req: Request, res: Response, issuer: string): Promise<void> => {
650
- const userService = new User_DataService({ issuer });
651
- await userService.getDataById(req.params.userId);
652
- res.send(userService.data);
653
- },
654
- ],
655
- }),
656
- new DyNTS_Endpoint_Params({
657
- name: 'updateUser',
658
- type: DyFM_HttpCallType.post,
659
- endpoint: '/update',
660
- preProcesses: [this.authService.authenticate_tokenSelf],
661
- tasks: [
662
- async (req: Request, res: Response, issuer: string): Promise<void> => {
663
- const userService = new User_DataService({ issuer });
664
- await userService.saveData(req.body);
665
- res.send(userService.data);
666
- },
667
- ],
668
- }),
669
- ];
670
- }
671
- }
672
- ```
673
-
674
- ### Data Service Implementation
675
-
676
- Data services provide a structured way to interact with MongoDB:
677
-
678
- ```typescript
679
- import { DyNTS_DataService } from '@futdevpro/nts-dynamo';
680
- import { DyFM_DataModel_Params } from '@futdevpro/fsm-dynamo'; // FSM provides the data model parameter definition
681
-
682
- // Define your data model parameters
683
- const userDataParams: DyFM_DataModel_Params<UserData> = new DyFM_DataModel_Params({
684
- dataName: 'userData',
685
- typeSample: {
686
- userId: '',
687
- preferences: {},
688
- },
689
- // ... additional configuration
690
- });
691
-
692
- export class User_DataService extends DyNTS_DataService<UserData> {
693
- constructor(params: { issuer: string }) {
694
- super(userDataParams);
695
- this.issuer = params.issuer;
696
- }
697
-
698
- // Custom business logic methods
699
- async getUserPreferences(userId: string): Promise<UserPreferences> {
700
- await this.getDataByDependencyId({ userId });
701
- return this.data?.preferences || {};
702
- }
703
- }
704
- ```
705
-
706
- ### Socket Server Service
707
-
708
- Socket services enable real-time communication:
709
-
710
- ```typescript
711
- import { DyNTS_SocketServerService, DyNTS_SocketPresence } from '@futdevpro/nts-dynamo/socket';
712
-
713
- export class Chat_SocketServerService extends DyNTS_SocketServerService<DyNTS_SocketPresence, any> {
714
-
715
- static getInstance(): Chat_SocketServerService {
716
- return Chat_SocketServerService.getSingletonInstance();
717
- }
718
-
719
- protected setupSocketEvents(): void {
720
- this.socketServer.on('connection', (socket) => {
721
- socket.on('joinRoom', (roomId: string) => {
722
- socket.join(roomId);
723
- });
724
-
725
- socket.on('sendMessage', async (data: { roomId: string; message: string }) => {
726
- this.socketServer.to(data.roomId).emit('newMessage', data);
727
- });
728
- });
729
- }
730
- }
731
- ```
732
-
733
- ### Vector Search with AI
734
-
735
- Dynamo-NTS provides built-in support for MongoDB Atlas vector search with automatic vectorization:
736
-
737
- ```typescript
738
- import { DyNTS_OAI_VectorDataService } from '@futdevpro/nts-dynamo/ai/open-ai';
739
-
740
- export class Knowledge_DataService extends DyNTS_OAI_VectorDataService<Knowledge> {
741
-
742
- constructor() {
743
- super(knowledgeDataParams);
744
- }
745
-
746
- async searchSimilarContent(query: string, limit: number = 10): Promise<Knowledge[]> {
747
- return await this.vectorSearch({
748
- input: query,
749
- searchInKey: 'content', // Property that has vectorization enabled
750
- limit: limit,
751
- numberOfCandidates: 100,
752
- });
753
- }
754
- }
755
- ```
756
-
757
- The vector search automatically:
758
- - Creates embeddings for search queries using the configured AI provider
759
- - Performs semantic search in MongoDB Atlas vector database
760
- - Returns results sorted by relevance
761
- - Supports filtering with additional MongoDB queries
762
-
763
- ## Ecosystem Integration
764
-
765
- Dynamo-NTS is part of the unified **Dynamo ecosystem**, which consists of several interconnected packages:
766
-
767
- ### Dynamo FSM (Full Stack Module)
768
-
769
- The foundational package [`@futdevpro/fsm-dynamo`](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) that provides:
770
- - Core interfaces and types shared across the ecosystem
771
- - Base model definitions (used by all Dynamo-NTS data services)
772
- - Utility functions
773
- - Type definitions for system-wide use
774
- - Data model parameter definitions (`DyFM_DataModel_Params`)
775
-
776
- Dynamo-NTS is built on top of Dynamo FSM and implements the server-side components of the FSM architecture. All data models, interfaces, and type definitions used in Dynamo-NTS are provided by FSM, ensuring consistency and type safety across the entire ecosystem.
777
-
778
- ### Dynamo NGX (AngularX)
779
-
780
- The frontend counterpart [`@futdevpro/dynamo-ngx`](https://www.npmjs.com/package/@futdevpro/dynamo-ngx) provides:
781
- - Angular components and services
782
- - Frontend models that integrate with Dynamo-NTS backend (using shared FSM types)
783
- - Real-time communication clients (connects to Dynamo-NTS socket services)
784
- - Form management and data table components
785
-
786
- ### Unified Patterns
787
-
788
- The Dynamo ecosystem enforces consistent patterns across all packages:
789
-
790
- - **Naming Conventions**: Consistent prefixes (`DyNTS_` for backend, `DyNX_` for frontend, `DyFM_` for shared)
791
- - **Type Safety**: Full TypeScript support with shared type definitions
792
- - **Architecture Patterns**: Consistent service patterns, data models, and API structures
793
- - **Error Handling**: Unified error handling across the stack
794
- - **Logging**: Consistent logging patterns and utilities
795
-
796
- This unified approach ensures that:
797
- - Developers learn one set of patterns that apply everywhere
798
- - Frontend and backend code integrate seamlessly
799
- - Type safety is maintained across the entire stack
800
- - Maintenance and updates are simplified
801
-
802
- ## API Reference
803
-
804
- For detailed API documentation, see:
805
-
806
- - [Dynamo-NTS Documentation](fdp-documentations/specifications/dynamo-packages/dynamo-nts/dynamo-nts.md)
807
- - [Dynamo FSM Documentation](fdp-documentations/specifications/dynamo-packages/dynamo-fsm/dynamo-fsm.md)
808
- - [Dynamo Ecosystem Overview](fdp-documentations/specifications/dynamo-packages/dynamo_packages.md)
809
-
810
- ## License
811
-
812
- ISC
813
-
814
- ## Support
815
-
816
- For issues, questions, or contributions, please refer to the project repository.
384
+ `DyNTS_PrivacyExportArtifactPrivacyContributor_ControlService` can be registered before product-domain authority
385
+ roots to include transient export artifacts in account erasure. It deletes only the exact data-subject and tenant
386
+ scope and verifies that scope again after execution. Prior export artifacts are deliberately not recursively
387
+ included in later access or export bundles.
388
+
389
+ ## Modules Overview
390
+
391
+ Dynamo-NTS is organized into focused modules, each providing specific functionality:
392
+
393
+ ### Main Module
394
+
395
+ The core foundation providing essential components:
396
+
397
+ - **Collections**: Archive utilities, global settings, environment configuration
398
+ - **Enums**: Data model types, service functions, route security levels
399
+ - **Models**: Application configuration interfaces, control models, database types
400
+ - **Services**: Core services for API communication, authentication, data management, routing
401
+
402
+ ### AI Module
403
+
404
+ Provides abstractions and implementations for AI operations:
405
+
406
+ - **Abstract Service Bases**: Base classes for AI providers, LLM services, LLM chat services, and embedding services
407
+ - **OpenAI Implementation**: Complete OpenAI integration with LLM, chat, and embedding support
408
+ - **Document AI**: Document chunking and preprocessing for AI models
409
+ - **Vector Search**: MongoDB Atlas vector database operations with automatic data vectorization
410
+
411
+ #### OpenAI-Compatible Providers
412
+
413
+ The OAI service-ek (`DyNTS_OAI_LLM_ServiceBase`, `DyNTS_OAI_LLMChat_ServiceBase`, `DyNTS_OAI_Embedding_ControlService`) bármely OpenAI-API-kompatibilis endpoint-tal működnek — lokál LLM (LM Studio, Ollama), self-hosted (vLLM, LocalAI) is — a `DyFM_OAI_ClientOptions.baseURL` mező segítségével. Részletek + provider-konfig sample-ök: [`__documentations/2026-05-17-oai-compatible-providers.md`](__documentations/2026-05-17-oai-compatible-providers.md).
414
+
415
+ ### Assistant Module
416
+
417
+ Platform and AI provider agnostic solutions for creating intelligent assistants:
418
+
419
+ - Integrates communication providers (bot) with AI providers (LLM Chat)
420
+ - Message conversion utilities
421
+ - Conversation management
422
+ - Configurable settings for system prompts and message filtering
423
+
424
+ ### Bot Module
425
+
426
+ Platform-agnostic bot functionality:
427
+
428
+ - Message, channel, and user wrappers for any messaging platform
429
+ - Command system for bot commands
430
+ - Routine system for scheduled and event-driven tasks
431
+ - IO management for bot interactions
432
+ - Provider support for Discord, Slack, and Teams
433
+
434
+ ### Socket Module
435
+
436
+ Real-time communication capabilities that simplify Socket.io setup:
437
+
438
+ - Socket client and server implementations with secure and open connection options (simplifies Socket.io server initialization)
439
+ - Event handling system for managing real-time communications (replaces manual Socket.io event handler setup)
440
+ - Presence tracking for monitoring connected clients
441
+ - Error handling and logging for reliable operation
442
+ - Extended application class with built-in socket server capabilities (automatically configures Socket.io with Express server)
443
+
444
+ ### Messaging Module
445
+
446
+ Backend implementation for unified messaging system:
447
+
448
+ - Data services for messages and conversations
449
+ - Control services for business logic orchestration
450
+ - Real-time socket events
451
+ - RESTful HTTP endpoints
452
+ - Integration with bot and assistant modules
453
+
454
+ ### OAuth2 Module
455
+
456
+ Complete OAuth2.0 protocol implementation:
457
+
458
+ - OAuth2 authorization and token management
459
+ - Client management and user authentication
460
+ - Token exchange and refresh operations
461
+ - Authorization code and access token generation
462
+
463
+ ### Server Module
464
+
465
+ Solutions for basic server endpoints:
466
+
467
+ - Error handling for saving and retrieving server errors
468
+ - Server status monitoring with version and uptime information
469
+ - Server status snapshots for saving and retrieving status at specific times
470
+ - Error statistics for monitoring and analysis
471
+
472
+ #### Content-free database readiness probe
473
+
474
+ Applications can perform one foreground readiness check against their own Mongoose connection without
475
+ starting a timer, listener, retry loop, subscription, process hook, or background task:
476
+
477
+ ```typescript
478
+ import {
479
+ DyNTS_DbReadinessProbe_ControlService,
480
+ DyNTS_DbReadinessProbeResult_Interface,
481
+ } from '@futdevpro/nts-dynamo/server';
482
+
483
+ const result: DyNTS_DbReadinessProbeResult_Interface =
484
+ await DyNTS_DbReadinessProbe_ControlService.probe({
485
+ connection: mongoose.connection,
486
+ });
487
+ ```
488
+
489
+ The `dynts-db-readiness/1` result contains exactly six allowlisted fields: contract version, readiness,
490
+ normalized connection state, ping success, bounded stage, and stable result code. It never contains a host,
491
+ database name, URI, model metadata, credentials, driver error text, or arbitrary error properties. Failures
492
+ resolve to a content-free, fail-closed result and the probe writes no log output.
493
+
494
+ Timeout policy and cancellation are caller-owned. The probe observes the supplied `AbortSignal` before and
495
+ after its single ping, but it does not create a timeout or interrupt an already-running driver operation.
496
+ Configure the driver's operation timeout and abort the supplied signal at the application boundary.
497
+
498
+ ### Defaults Module
499
+
500
+ Default implementations for common services:
501
+
502
+ - Default user data model and service for authentication and user management
503
+ - Default authentication service with basic token-based authentication
504
+ - Default socket events service with graceful degradation
505
+ - All services can be extended or replaced with custom implementations
506
+
507
+ ### Custom Data Module
508
+
509
+ Tools for managing custom data:
510
+
511
+ - Data service for handling custom data operations with optional initialization
512
+ - Controller with RESTful endpoints for data operations
513
+ - GET endpoint for retrieving custom data by ID
514
+ - POST endpoint for modifying custom data
515
+ - Configurable routing module with optional security overrides
516
+
517
+ ### Test Module
518
+
519
+ Testing and monitoring tools:
520
+
521
+ - Test endpoints for different HTTP methods (GET, POST, DELETE)
522
+ - Server status endpoint with version and uptime information
523
+ - Configurable routing module with security override options
524
+ - Automatic controller registration for easy setup
525
+
526
+ ### Usage Module
527
+
528
+ Session and usage tracking tools:
529
+
530
+ - Session management tools for creating, updating, and closing sessions
531
+ - Usage data collection and analysis tools
532
+ - Location tracking from HTTP requests
533
+ - Usage statistics retrieval with time range filtering
534
+ - Daily usage statistics calculation
535
+
536
+ ## Usage Examples
537
+
538
+ ### Basic Application Setup
539
+
540
+ This example shows a complete application setup using `DyNTS_AppExtended`:
541
+
542
+ ```typescript
543
+ import {
544
+ DyNTS_AppExtended,
545
+ DyNTS_App_Params,
546
+ DyNTS_GlobalService_Settings,
547
+ DyNTS_Http_Settings,
548
+ DyNTS_RoutingModule
549
+ } from '@futdevpro/nts-dynamo';
550
+ import { DyNTS_SocketServerService } from '@futdevpro/nts-dynamo/socket';
551
+
552
+ export class App extends DyNTS_AppExtended {
553
+
554
+ getAppParams(): DyNTS_App_Params {
555
+ return new DyNTS_App_Params({
556
+ name: 'My Server',
557
+ version: '1.0.0',
558
+ dbName: 'myapp',
559
+ });
560
+ }
561
+
562
+ getGlobalServiceCollection(): DyNTS_GlobalService_Settings {
563
+ return {
564
+ authService: AuthService.getInstance(),
565
+ dbModels: [
566
+ // Your data models
567
+ ],
568
+ };
569
+ }
570
+
571
+ getPortSettings(): DyNTS_Http_Settings {
572
+ return new DyNTS_Http_Settings({
573
+ httpPort: 3000,
574
+ });
575
+ }
576
+
577
+ getRoutingModules(): DyNTS_RoutingModule[] {
578
+ return [
579
+ new DyNTS_RoutingModule({
580
+ route: '/api',
581
+ controllers: [
582
+ MyController.getInstance(),
583
+ ],
584
+ }),
585
+ ];
586
+ }
587
+
588
+ getSocketServices(): DyNTS_SocketServerService<any>[] {
589
+ return [
590
+ MySocketService.getInstance(),
591
+ ];
592
+ }
593
+ }
594
+ ```
595
+
596
+ ### Routing Module Configuration
597
+
598
+ Multiple routing modules can be configured to organize your API:
599
+
600
+ ```typescript
601
+ getRoutingModules(): DyNTS_RoutingModule[] {
602
+ return [
603
+ new DyNTS_RoutingModule({
604
+ route: '/user',
605
+ controllers: [
606
+ User_Controller.getInstance(),
607
+ UserData_Controller.getInstance(),
608
+ UserSettings_Controller.getInstance(),
609
+ ],
610
+ }),
611
+ new DyNTS_RoutingModule({
612
+ route: '/project',
613
+ controllers: [
614
+ Project_Controller.getInstance(),
615
+ ProjectExtension_Controller.getInstance(),
616
+ ],
617
+ }),
618
+ new DyNTS_RoutingModule({
619
+ route: '/server',
620
+ controllers: [
621
+ ServerStatus_Controller.getInstance(),
622
+ ],
623
+ }),
624
+ DyNTS_getTestRoutingModule(),
625
+ DyNTS_getUsageRoutingModule(),
626
+ ];
627
+ }
628
+ ```
629
+
630
+ ### Controller Implementation
631
+
632
+ Controllers define API endpoints with authentication and business logic:
633
+
634
+ ```typescript
635
+ import { Request, Response } from 'express';
636
+ import { DyNTS_Controller, DyNTS_Endpoint_Params } from '@futdevpro/nts-dynamo';
637
+ import { DyFM_HttpCallType } from '@futdevpro/fsm-dynamo';
638
+
639
+ export class User_Controller extends DyNTS_Controller {
640
+
641
+ static getInstance(): User_Controller {
642
+ return User_Controller.getSingletonInstance();
643
+ }
644
+
645
+ private authService: AuthService = AuthService.getInstance();
646
+
647
+ setupEndpoints(): void {
648
+ this.endpoints = [
649
+ new DyNTS_Endpoint_Params({
650
+ name: 'getUser',
651
+ type: DyFM_HttpCallType.get,
652
+ endpoint: '/get/:userId',
653
+ preProcesses: [this.authService.authenticate_tokenSelf],
654
+ tasks: [
655
+ async (req: Request, res: Response, issuer: string): Promise<void> => {
656
+ const userService = new User_DataService({ issuer });
657
+ await userService.getDataById(req.params.userId);
658
+ res.send(userService.data);
659
+ },
660
+ ],
661
+ }),
662
+ new DyNTS_Endpoint_Params({
663
+ name: 'updateUser',
664
+ type: DyFM_HttpCallType.post,
665
+ endpoint: '/update',
666
+ preProcesses: [this.authService.authenticate_tokenSelf],
667
+ tasks: [
668
+ async (req: Request, res: Response, issuer: string): Promise<void> => {
669
+ const userService = new User_DataService({ issuer });
670
+ await userService.saveData(req.body);
671
+ res.send(userService.data);
672
+ },
673
+ ],
674
+ }),
675
+ ];
676
+ }
677
+ }
678
+ ```
679
+
680
+ ### Data Service Implementation
681
+
682
+ Data services provide a structured way to interact with MongoDB:
683
+
684
+ ```typescript
685
+ import { DyNTS_DataService } from '@futdevpro/nts-dynamo';
686
+ import { DyFM_DataModel_Params } from '@futdevpro/fsm-dynamo'; // FSM provides the data model parameter definition
687
+
688
+ // Define your data model parameters
689
+ const userDataParams: DyFM_DataModel_Params<UserData> = new DyFM_DataModel_Params({
690
+ dataName: 'userData',
691
+ typeSample: {
692
+ userId: '',
693
+ preferences: {},
694
+ },
695
+ // ... additional configuration
696
+ });
697
+
698
+ export class User_DataService extends DyNTS_DataService<UserData> {
699
+ constructor(params: { issuer: string }) {
700
+ super(userDataParams);
701
+ this.issuer = params.issuer;
702
+ }
703
+
704
+ // Custom business logic methods
705
+ async getUserPreferences(userId: string): Promise<UserPreferences> {
706
+ await this.getDataByDependencyId({ userId });
707
+ return this.data?.preferences || {};
708
+ }
709
+ }
710
+ ```
711
+
712
+ ### Socket Server Service
713
+
714
+ Socket services enable real-time communication:
715
+
716
+ ```typescript
717
+ import { DyNTS_SocketServerService, DyNTS_SocketPresence } from '@futdevpro/nts-dynamo/socket';
718
+
719
+ export class Chat_SocketServerService extends DyNTS_SocketServerService<DyNTS_SocketPresence, any> {
720
+
721
+ static getInstance(): Chat_SocketServerService {
722
+ return Chat_SocketServerService.getSingletonInstance();
723
+ }
724
+
725
+ protected setupSocketEvents(): void {
726
+ this.socketServer.on('connection', (socket) => {
727
+ socket.on('joinRoom', (roomId: string) => {
728
+ socket.join(roomId);
729
+ });
730
+
731
+ socket.on('sendMessage', async (data: { roomId: string; message: string }) => {
732
+ this.socketServer.to(data.roomId).emit('newMessage', data);
733
+ });
734
+ });
735
+ }
736
+ }
737
+ ```
738
+
739
+ ### Vector Search with AI
740
+
741
+ Dynamo-NTS provides built-in support for MongoDB Atlas vector search with automatic vectorization:
742
+
743
+ ```typescript
744
+ import { DyNTS_OAI_VectorDataService } from '@futdevpro/nts-dynamo/ai/open-ai';
745
+
746
+ export class Knowledge_DataService extends DyNTS_OAI_VectorDataService<Knowledge> {
747
+
748
+ constructor() {
749
+ super(knowledgeDataParams);
750
+ }
751
+
752
+ async searchSimilarContent(query: string, limit: number = 10): Promise<Knowledge[]> {
753
+ return await this.vectorSearch({
754
+ input: query,
755
+ searchInKey: 'content', // Property that has vectorization enabled
756
+ limit: limit,
757
+ numberOfCandidates: 100,
758
+ });
759
+ }
760
+ }
761
+ ```
762
+
763
+ The vector search automatically:
764
+ - Creates embeddings for search queries using the configured AI provider
765
+ - Performs semantic search in MongoDB Atlas vector database
766
+ - Returns results sorted by relevance
767
+ - Supports filtering with additional MongoDB queries
768
+
769
+ ## Ecosystem Integration
770
+
771
+ Dynamo-NTS is part of the unified **Dynamo ecosystem**, which consists of several interconnected packages:
772
+
773
+ ### Dynamo FSM (Full Stack Module)
774
+
775
+ The foundational package [`@futdevpro/fsm-dynamo`](https://www.npmjs.com/package/@futdevpro/fsm-dynamo) that provides:
776
+ - Core interfaces and types shared across the ecosystem
777
+ - Base model definitions (used by all Dynamo-NTS data services)
778
+ - Utility functions
779
+ - Type definitions for system-wide use
780
+ - Data model parameter definitions (`DyFM_DataModel_Params`)
781
+
782
+ Dynamo-NTS is built on top of Dynamo FSM and implements the server-side components of the FSM architecture. All data models, interfaces, and type definitions used in Dynamo-NTS are provided by FSM, ensuring consistency and type safety across the entire ecosystem.
783
+
784
+ ### Dynamo NGX (AngularX)
785
+
786
+ The frontend counterpart [`@futdevpro/dynamo-ngx`](https://www.npmjs.com/package/@futdevpro/dynamo-ngx) provides:
787
+ - Angular components and services
788
+ - Frontend models that integrate with Dynamo-NTS backend (using shared FSM types)
789
+ - Real-time communication clients (connects to Dynamo-NTS socket services)
790
+ - Form management and data table components
791
+
792
+ ### Unified Patterns
793
+
794
+ The Dynamo ecosystem enforces consistent patterns across all packages:
795
+
796
+ - **Naming Conventions**: Consistent prefixes (`DyNTS_` for backend, `DyNX_` for frontend, `DyFM_` for shared)
797
+ - **Type Safety**: Full TypeScript support with shared type definitions
798
+ - **Architecture Patterns**: Consistent service patterns, data models, and API structures
799
+ - **Error Handling**: Unified error handling across the stack
800
+ - **Logging**: Consistent logging patterns and utilities
801
+
802
+ This unified approach ensures that:
803
+ - Developers learn one set of patterns that apply everywhere
804
+ - Frontend and backend code integrate seamlessly
805
+ - Type safety is maintained across the entire stack
806
+ - Maintenance and updates are simplified
807
+
808
+ ## API Reference
809
+
810
+ For detailed API documentation, see:
811
+
812
+ - [Dynamo-NTS Documentation](fdp-documentations/specifications/dynamo-packages/dynamo-nts/dynamo-nts.md)
813
+ - [Dynamo FSM Documentation](fdp-documentations/specifications/dynamo-packages/dynamo-fsm/dynamo-fsm.md)
814
+ - [Dynamo Ecosystem Overview](fdp-documentations/specifications/dynamo-packages/dynamo_packages.md)
815
+
816
+ ## License
817
+
818
+ ISC
819
+
820
+ ## Support
821
+
822
+ For issues, questions, or contributions, please refer to the project repository.