odata-active-record-core
Version:
Core Active Record implementation for OData - The easiest way to interact with OData APIs
84 lines • 2.49 kB
TypeScript
import { EntityNamespace } from './entity-namespace';
import type { IDataTypeHandler, IEntityNamespaceManager, IEntityNamespace, IValidationResult, INamespaceStats } from 'odata-active-record-contracts';
/**
* EntityNamespaceManager class - Manages multiple independent entity namespaces
* Provides complete isolation between different OData endpoints
*/
export declare class EntityNamespaceManager implements IEntityNamespaceManager {
private dataTypeHandler;
private namespaces;
constructor(dataTypeHandler: IDataTypeHandler);
/**
* Create a new entity namespace
*/
createNamespace(name: string): IEntityNamespace;
/**
* Get an existing namespace by name
*/
getNamespace(name: string): IEntityNamespace | null;
/**
* Check if a namespace exists
*/
hasNamespace(name: string): boolean;
/**
* List all namespace names
*/
listNamespaces(): string[];
/**
* Remove a namespace and all its entities
*/
removeNamespace(name: string): boolean;
/**
* Get the data type handler used by this manager
*/
getDataTypeHandler(): IDataTypeHandler;
/**
* Validate all namespaces for consistency
*/
validateAllNamespaces(): IValidationResult;
/**
* Get statistics about all namespaces
*/
getNamespaceStats(): INamespaceStats;
/**
* Get all namespaces as a Map
*/
getAllNamespaces(): Map<string, EntityNamespace>;
/**
* Check if this manager has any namespaces
*/
isEmpty(): boolean;
/**
* Clear all namespaces
*/
clear(): void;
/**
* Get a namespace by name, creating it if it doesn't exist
*/
getOrCreateNamespace(name: string): IEntityNamespace;
/**
* Check if any namespace has validation issues
*/
hasValidationIssues(): boolean;
/**
* Get all entities across all namespaces
*/
getAllEntities(): Map<string, Map<string, any>>;
/**
* Find which namespace contains a specific entity
*/
findEntityNamespace(entityName: string): string | null;
/**
* Get all entity names across all namespaces
*/
getAllEntityNames(): string[];
/**
* Check if an entity exists in any namespace
*/
hasEntity(entityName: string): boolean;
/**
* Get an entity from any namespace by name
*/
getEntity(entityName: string): any | null;
}
//# sourceMappingURL=entity-namespace-manager.d.ts.map