@vlynk-studios/nodulus-core 1.2.0 → 1.2.6

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/dist/index.d.ts CHANGED
@@ -1,21 +1,5 @@
1
- import { RequestHandler, Router, Application } from 'express';
1
+ import { RequestHandler, Application } from 'express';
2
2
 
3
- interface ControllerEntry {
4
- name: string;
5
- path: string;
6
- prefix: string;
7
- middlewares: RequestHandler[];
8
- router?: Router;
9
- enabled: boolean;
10
- }
11
- interface ModuleEntry {
12
- name: string;
13
- path: string;
14
- indexPath: string;
15
- imports: string[];
16
- exports: string[];
17
- controllers: ControllerEntry[];
18
- }
19
3
  type LogLevel = 'debug' | 'info' | 'warn' | 'error';
20
4
  /**
21
5
  * Function that receives a log event from Nodulus.
@@ -93,9 +77,24 @@ interface SchemaEntry {
93
77
  }
94
78
  /** Discriminated union for all file-level identifier entries. */
95
79
  type FileEntry = ServiceEntry | RepositoryEntry | SchemaEntry;
80
+ interface NitsConfig {
81
+ /**
82
+ * Custom similarity threshold (0.0 to 1.0).
83
+ * If omitted, a dynamic threshold based on module size is used.
84
+ */
85
+ similarityThreshold?: number;
86
+ /** Whether to enable NITS identity tracking. Default: true. */
87
+ enabled?: boolean;
88
+ /** Custom path to the NITS registry file. Default: '.nodulus/registry.json'. */
89
+ registryPath?: string;
90
+ }
96
91
  interface CreateAppOptions {
97
92
  /** Glob pointing to module folders. Default: 'src/modules/*'. */
98
93
  modules?: string;
94
+ /** Glob pointing to domain folders (v2.0.0+). Default: undefined. */
95
+ domains?: string;
96
+ /** Glob pointing to shared global folders (v2.0.0+). Default: undefined. */
97
+ shared?: string;
99
98
  /** Global route prefix. Example: '/api/v1'. Default: ''. */
100
99
  prefix?: string;
101
100
  /** Folder aliases beyond the auto-generated @modules/* entries. Default: {}. */
@@ -122,16 +121,8 @@ interface CreateAppOptions {
122
121
  * Default: 'info' (debug is off unless explicitly set).
123
122
  */
124
123
  logLevel?: LogLevel;
125
- }
126
- /** Resolved configuration used internally (defaults applied). */
127
- interface ResolvedConfig {
128
- modules: string;
129
- prefix: string;
130
- aliases: Record<string, string>;
131
- strict: boolean;
132
- resolveAliases: boolean;
133
- logger: LogHandler;
134
- logLevel: LogLevel;
124
+ /** NITS (Nodulus Integrated Tracking System) configuration. */
125
+ nits?: NitsConfig;
135
126
  }
136
127
  /** A module as it appears in the NodularApp result after bootstrap. */
137
128
  interface RegisteredModule {
@@ -184,6 +175,8 @@ interface GetAliasesOptions {
184
175
  absolute?: boolean;
185
176
  }
186
177
 
178
+ type ModuleRegistration = RegisteredModule;
179
+ type FeatureRegistration = FileEntry;
187
180
  /**
188
181
  * Returns a read-only view of the registry active in the current async context.
189
182
  *
@@ -193,14 +186,12 @@ interface GetAliasesOptions {
193
186
  */
194
187
  declare const getRegistry: () => NodulusRegistryAdvanced;
195
188
 
196
- type NodulusErrorCode = "MODULE_NOT_FOUND" | "DUPLICATE_MODULE" | "MISSING_IMPORT" | "UNDECLARED_IMPORT" | "CIRCULAR_DEPENDENCY" | "EXPORT_MISMATCH" | "INVALID_CONTROLLER" | "ALIAS_NOT_FOUND" | "DUPLICATE_ALIAS" | "DUPLICATE_BOOTSTRAP" | "REGISTRY_MISSING_CONTEXT" | "INVALID_MODULE_DECLARATION" | "DUPLICATE_SERVICE" | "DUPLICATE_REPOSITORY" | "DUPLICATE_SCHEMA" | "INVALID_ESM_ENV";
189
+ type NodulusErrorCode = "MODULE_NOT_FOUND" | "DUPLICATE_MODULE" | "MISSING_IMPORT" | "UNDECLARED_IMPORT" | "CIRCULAR_DEPENDENCY" | "EXPORT_MISMATCH" | "INVALID_CONTROLLER" | "ALIAS_NOT_FOUND" | "DUPLICATE_ALIAS" | "DUPLICATE_BOOTSTRAP" | "REGISTRY_MISSING_CONTEXT" | "INVALID_MODULE_DECLARATION" | "DUPLICATE_SERVICE" | "DUPLICATE_REPOSITORY" | "DUPLICATE_SCHEMA" | "INVALID_ESM_ENV" | "CLI_ERROR" | "UNUSED_IMPORT";
197
190
  declare class NodulusError extends Error {
198
191
  readonly code: NodulusErrorCode;
199
192
  readonly details?: string;
200
193
  constructor(code: NodulusErrorCode, message: string, details?: string);
201
194
  }
202
- /** @deprecated — not used internally. Messages are defined at each throw site. */
203
- declare const ERROR_MESSAGES: Record<NodulusErrorCode, string>;
204
195
 
205
196
  declare function Module(name: string, options?: ModuleOptions): void;
206
197
 
@@ -264,4 +255,4 @@ declare function createApp(app: Application, options?: CreateAppOptions): Promis
264
255
 
265
256
  declare function getAliases(options?: GetAliasesOptions): Promise<Record<string, string>>;
266
257
 
267
- export { Controller, type ControllerEntry, type ControllerOptions, type CreateAppOptions, ERROR_MESSAGES, type FileEntry, type GetAliasesOptions, type LogHandler, type LogLevel, Module, type ModuleEntry, type ModuleOptions, type MountedRoute, type NodulusApp, type NodulusConfig, NodulusError, type NodulusErrorCode, type NodulusRegistry, type NodulusRegistryAdvanced, type RegisteredModule, Repository, type RepositoryEntry, type RepositoryOptions, type ResolvedConfig, Schema, type SchemaEntry, type SchemaOptions, Service, type ServiceEntry, type ServiceOptions, createApp, getAliases, getRegistry };
258
+ export { Controller, type ControllerOptions, type CreateAppOptions, type FeatureRegistration, type GetAliasesOptions, type LogHandler, type LogLevel, Module, type ModuleOptions, type ModuleRegistration, type MountedRoute, type NodulusApp, type NodulusConfig, NodulusError, type NodulusErrorCode, type NodulusRegistry, type NodulusRegistryAdvanced, type RegisteredModule, Repository, type RepositoryOptions, Schema, type SchemaOptions, Service, type ServiceOptions, createApp, getAliases, getRegistry };