@nan0web/core 1.0.3 → 1.1.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.
@@ -1,42 +0,0 @@
1
- /**
2
- * Registry for API route namespaces
3
- * Tracks registered prefixes and their owners
4
- *
5
- * @example
6
- * const registry = new RouteRegistry()
7
- * registry.register('auth', { setup: (router) => { ... }, owner: '@nan0web/auth.app' })
8
- * registry.has('auth') // true
9
- */
10
- export default class RouteRegistry {
11
- /**
12
- * Register a namespace prefix
13
- * @param {string} prefix - URL prefix (e.g. 'auth')
14
- * @param {{ setup: Function, owner: string }} config - Setup function and package name
15
- * @returns {this}
16
- */
17
- register(prefix: string, config: {
18
- setup: Function;
19
- owner: string;
20
- }): this;
21
- /**
22
- * Get all registered routes
23
- * @returns {Map<string, { setup: Function, owner: string }>}
24
- */
25
- getRoutes(): Map<string, {
26
- setup: Function;
27
- owner: string;
28
- }>;
29
- /**
30
- * Check if prefix exists
31
- * @param {string} prefix
32
- * @returns {boolean}
33
- */
34
- has(prefix: string): boolean;
35
- /**
36
- * Get owner of prefix
37
- * @param {string} prefix
38
- * @returns {string | null}
39
- */
40
- getOwner(prefix: string): string | null;
41
- #private;
42
- }
@@ -1,3 +0,0 @@
1
- export default class UiRegistry extends ComponentRegistry {
2
- }
3
- import ComponentRegistry from './ComponentRegistry.js';
@@ -1,30 +0,0 @@
1
- /**
2
- * Validates application integration before registration
3
- * Checks for namespace collisions across all registries
4
- */
5
- export default class SystemValidator {
6
- /**
7
- * @param {Object} registries - System-wide registries
8
- * @param {RouteRegistry} registries.apiRegistry - Manages API route prefixes
9
- * @param {CommandRegistry} registries.cliRegistry - Manages CLI commands
10
- * @param {ComponentRegistry} [registries.uiRegistry] - Manages UI components
11
- */
12
- constructor({ apiRegistry, cliRegistry, uiRegistry }: {
13
- apiRegistry: RouteRegistry;
14
- cliRegistry: CommandRegistry;
15
- uiRegistry?: ComponentRegistry | undefined;
16
- });
17
- apiRegistry: RouteRegistry;
18
- cliRegistry: CommandRegistry;
19
- uiRegistry: ComponentRegistry;
20
- /**
21
- * Validate application configuration for potential conflicts
22
- * @param {Object} application - Must have register() method
23
- * @param {Object} [configuration] - Custom integration settings
24
- * @returns {Array<string>} List of collision errors
25
- */
26
- validate(application: any, configuration?: any): Array<string>;
27
- }
28
- import RouteRegistry from '../registry/RouteRegistry.js';
29
- import CommandRegistry from '../registry/CommandRegistry.js';
30
- import ComponentRegistry from '../registry/ComponentRegistry.js';
@@ -1,30 +0,0 @@
1
- /**
2
- * Integrates applications based on configuration file.
3
- * The config is loaded lazily to avoid TS JSON‑module issues.
4
- */
5
- export class AppIntegrator {
6
- apiRegistry: ApiRegistry;
7
- cliRegistry: CliRegistry;
8
- uiRegistry: UiRegistry;
9
- validator: SystemValidator;
10
- /**
11
- * Load the apps configuration (JSON) at runtime.
12
- * @returns {Promise<Record<string, any>>}
13
- */
14
- _loadConfig(): Promise<Record<string, any>>;
15
- /**
16
- * Register all configured applications.
17
- */
18
- registerAll(): Promise<void>;
19
- /**
20
- * Internal registration logic.
21
- * @param {string} packageName
22
- * @param {object} app
23
- * @param {object} cfg
24
- */
25
- _registerApp(packageName: string, app: object, cfg: object): void;
26
- }
27
- import ApiRegistry from '../registry/ApiRegistry.js';
28
- import CliRegistry from '../registry/CommandRegistry.js';
29
- import UiRegistry from '../registry/UiRegistry.js';
30
- import SystemValidator from './Validator.js';
@@ -1 +0,0 @@
1
- export {};