@xeno-js/core 1.2.12 → 2.0.0
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.cjs +868 -966
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -95
- package/dist/index.d.ts +15 -95
- package/dist/index.js +822 -947
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { ICache, Optional, IExtendendAuthService, IBaseAuthService, ICacheKeyBuilder, IPipelineBehavior, ICommand, IConcurrencyService, IConfigurationService, ILogger, IMediator, IMiddleware, IQuery, RequestContext, IServiceResilience, IServiceExtractor, Metadata, IUnitOfWork, IDisposable, IValidatorService, IIdentityAccessor, IContextAccessor, INetworkContextAccessor, IFactory, UserContext, ITransactionState, Factory, IBaseAccessor, Identity, ExtendedRequest, HttpMethod, AuthConfig, CookieOptions, SetupAction, HttpClientConfig, LogLevel, ILoggerClient, Dictionary, AuthPolicy, IStrategy, IRequest, ResponseDto, IHandler, ResultType, ISpecification, CacheConfig, DbConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
|
|
2
2
|
export * from '@xeno-js/shared';
|
|
3
|
-
export { Query
|
|
4
|
-
import { SupabaseClientOptions } from '@supabase/supabase-js';
|
|
5
|
-
import * as _libsql_client_web from '@libsql/client/web';
|
|
6
|
-
import * as drizzle_orm_libsql from 'drizzle-orm/libsql';
|
|
7
|
-
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
|
8
|
-
import * as drizzle_orm_node_postgres from 'drizzle-orm/node-postgres';
|
|
9
|
-
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
10
|
-
export * from 'drizzle-orm';
|
|
11
|
-
export { Query } from 'drizzle-orm';
|
|
3
|
+
export { Query } from '@xeno-js/shared';
|
|
12
4
|
|
|
13
5
|
/**
|
|
14
6
|
* @description IAtomicCache is an interface that extends the ICache interface and adds an increment method. The increment method takes a key and an optional ttlSeconds parameter and returns a Promise that resolves to an incremented value.
|
|
@@ -762,7 +754,7 @@ interface ISsrCookieHandler {
|
|
|
762
754
|
interface CookieHandlerOptions extends CookieOptions {
|
|
763
755
|
httpOnly: boolean;
|
|
764
756
|
}
|
|
765
|
-
interface AuthSsrConfig<TOption, TRegistry extends ApplicationRegistry = ApplicationRegistry> extends AuthConfig<TOption> {
|
|
757
|
+
interface AuthSsrConfig<TOption = unknown, TRegistry extends ApplicationRegistry = ApplicationRegistry> extends AuthConfig<TOption> {
|
|
766
758
|
ssrOpts: Optional<(container: IServiceContainer<TRegistry>) => ISsrCookieHandler>;
|
|
767
759
|
cookieOpts: CookieHandlerOptions;
|
|
768
760
|
customAuth: Optional<{
|
|
@@ -1663,38 +1655,6 @@ declare abstract class Specification<T> implements ISpecification<T> {
|
|
|
1663
1655
|
not(): ISpecification<T>;
|
|
1664
1656
|
}
|
|
1665
1657
|
|
|
1666
|
-
/**
|
|
1667
|
-
* @description Type definition for the database context used in the application.
|
|
1668
|
-
* Polymorphically handles both PostgreSQL and libSQL (SQLite/Turso) engines.
|
|
1669
|
-
*
|
|
1670
|
-
* @author Xeno
|
|
1671
|
-
* @version 1.0.0
|
|
1672
|
-
* @since 2025-09-30
|
|
1673
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1674
|
-
*/
|
|
1675
|
-
type DbContext<TSchema extends Dictionary = Dictionary> = drizzle_orm_node_postgres.NodePgDatabase<TSchema> | (drizzle_orm_libsql.LibSQLDatabase<TSchema> & {
|
|
1676
|
-
$client: _libsql_client_web.Client;
|
|
1677
|
-
});
|
|
1678
|
-
/**
|
|
1679
|
-
* @description Type definition for the transaction object used in the database context.
|
|
1680
|
-
* Polymorphically handles both PostgreSQL and libSQL (SQLite/Turso) engines.
|
|
1681
|
-
*
|
|
1682
|
-
* @author Xeno
|
|
1683
|
-
* @version 1.0.0
|
|
1684
|
-
* @since 2025-09-30
|
|
1685
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1686
|
-
*/
|
|
1687
|
-
type DbTransaction = Parameters<Parameters<DbContext['transaction']>[0]>[0];
|
|
1688
|
-
|
|
1689
|
-
/**
|
|
1690
|
-
* @description The XenoRegistry type is an alias for the ApplicationRegistry specialized with DbContext. It represents the registry of application services and dependencies, specifically tailored for applications that utilize a database context. This type is used throughout the application to ensure consistent typing and to facilitate dependency injection and service resolution.
|
|
1691
|
-
* @author Xeno
|
|
1692
|
-
* @version 1.0.0
|
|
1693
|
-
* @since 2025-09-30
|
|
1694
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1695
|
-
*/
|
|
1696
|
-
type XenoRegistry<TSchema extends Dictionary = Dictionary, TExtensions = object> = ApplicationRegistry<DbContext<TSchema>, DbTransaction> & Readonly<Omit<TExtensions, keyof ApplicationRegistry<DbContext<TSchema>, DbTransaction>>>;
|
|
1697
|
-
|
|
1698
1658
|
/**
|
|
1699
1659
|
* @description The AppBuilder class provides a fluent, .NET-style API for configuring and bootstrapping the application.
|
|
1700
1660
|
* It orchestrates the registration of various modules (CQRS, HTTP, Database, Logging, Auth) into the ServiceContainer.
|
|
@@ -1705,11 +1665,11 @@ type XenoRegistry<TSchema extends Dictionary = Dictionary, TExtensions = object>
|
|
|
1705
1665
|
* @since 2025-09-30
|
|
1706
1666
|
* @link https://github.com/xeno-js/xeno-js
|
|
1707
1667
|
*/
|
|
1708
|
-
declare class AppBuilder<TRegistry extends
|
|
1668
|
+
declare class AppBuilder<TRegistry extends ApplicationRegistry = ApplicationRegistry> {
|
|
1709
1669
|
private readonly _container;
|
|
1710
1670
|
private readonly _configuration;
|
|
1711
1671
|
private _isBuilded;
|
|
1712
|
-
constructor(container?: IServiceContainer<TRegistry
|
|
1672
|
+
constructor(container?: IServiceContainer<TRegistry>, configurationService?: IConfigurationService);
|
|
1713
1673
|
private readonly _modules;
|
|
1714
1674
|
private _adapterConfig;
|
|
1715
1675
|
private _pipelineConfig;
|
|
@@ -1784,7 +1744,7 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1784
1744
|
* @since 2025-09-30
|
|
1785
1745
|
* @link https://github.com/xeno-js/xeno-js
|
|
1786
1746
|
*/
|
|
1787
|
-
addAuth(setupAction: SetupAction<AuthSsrConfig
|
|
1747
|
+
addAuth(setupAction: SetupAction<AuthSsrConfig, IConfigurationService>): this;
|
|
1788
1748
|
/**
|
|
1789
1749
|
* @description Configures the database settings for the application. This method allows you to set up database options such as enabling/disabling the database, connection string, and table definitions.
|
|
1790
1750
|
* @param setupAction A callback function that receives a DbConfig object to configure the database settings.
|
|
@@ -1860,7 +1820,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1860
1820
|
* @description Resolves a service from the dependency injection container.
|
|
1861
1821
|
* @param token The injection token used to identify the service.
|
|
1862
1822
|
* @returns The resolved service instance.
|
|
1863
|
-
|
|
1864
1823
|
*
|
|
1865
1824
|
* @author Xeno
|
|
1866
1825
|
* @version 1.0.0
|
|
@@ -1871,7 +1830,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1871
1830
|
/**
|
|
1872
1831
|
* @description Finalizes the configuration and initializes all registered modules in the container.
|
|
1873
1832
|
* @returns The fully configured ServiceContainer.
|
|
1874
|
-
|
|
1875
1833
|
*
|
|
1876
1834
|
* @author Xeno
|
|
1877
1835
|
* @version 1.0.0
|
|
@@ -1881,7 +1839,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1881
1839
|
build(): Promise<IServiceContainer<TRegistry>>;
|
|
1882
1840
|
/**
|
|
1883
1841
|
* @description Queues the configuration of the CQRS pipeline module if it has not already been queued. This method ensures that the pipeline module is only added once, even if multiple pipeline-related configurations are made.
|
|
1884
|
-
|
|
1885
1842
|
*
|
|
1886
1843
|
* @author Xeno
|
|
1887
1844
|
* @version 1.0.0
|
|
@@ -1891,7 +1848,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1891
1848
|
private _queuePipelineModule;
|
|
1892
1849
|
/**
|
|
1893
1850
|
* @description Queues the configuration of the middleware module if it has not already been queued. This method ensures that the middleware module is only added once, even if multiple middleware-related configurations are made.
|
|
1894
|
-
|
|
1895
1851
|
*
|
|
1896
1852
|
* @author Xeno
|
|
1897
1853
|
* @version 1.0.0
|
|
@@ -1911,51 +1867,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1911
1867
|
private _queueContextModule;
|
|
1912
1868
|
}
|
|
1913
1869
|
|
|
1914
|
-
/**
|
|
1915
|
-
* @description BasePostgresSqlDataSource is an abstract class that serves as a foundation for creating data sources that interact with a PostgreSQL database. It provides a common interface for accessing the database connection and ensures that the database connection is properly initialized and managed. By extending this class, developers can easily create data sources that are tailored to their specific use cases.
|
|
1916
|
-
*
|
|
1917
|
-
* @author Xeno
|
|
1918
|
-
* @version 1.0.0
|
|
1919
|
-
* @since 2025-09-30
|
|
1920
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1921
|
-
*/
|
|
1922
|
-
declare abstract class BasePostgresSqlDataSource<TSchema extends Dictionary = Dictionary> {
|
|
1923
|
-
private readonly _db;
|
|
1924
|
-
constructor(_db: DbContext<TSchema>);
|
|
1925
|
-
/**
|
|
1926
|
-
* @description Returns the database connection.
|
|
1927
|
-
* @returns {NodePgDatabase<TSchema>} The database connection.
|
|
1928
|
-
*/
|
|
1929
|
-
protected get db(): NodePgDatabase<TSchema>;
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
/**
|
|
1933
|
-
* @description BaseSqliteSqlDataSource is an abstract class that serves as a foundation for creating data sources that interact with a SQLite / libSQL database.
|
|
1934
|
-
*
|
|
1935
|
-
* @author Xeno
|
|
1936
|
-
* @version 1.0.0
|
|
1937
|
-
* @since 2025-09-30
|
|
1938
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1939
|
-
*/
|
|
1940
|
-
declare abstract class BaseSqliteSqlDataSource<TSchema extends Dictionary = Dictionary> {
|
|
1941
|
-
private readonly _db;
|
|
1942
|
-
constructor(_db: DbContext<TSchema>);
|
|
1943
|
-
/**
|
|
1944
|
-
* @description Returns the SQLite database connection.
|
|
1945
|
-
* @returns {LibSQLDatabase<TSchema>} The database connection.
|
|
1946
|
-
*/
|
|
1947
|
-
protected get db(): LibSQLDatabase<TSchema>;
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
interface SupabaseServerAuthFactoryInput<TRegistry extends XenoRegistry> {
|
|
1951
|
-
config: AuthSsrConfig<SupabaseClientOptions<'public'>>;
|
|
1952
|
-
container: IServiceContainer<TRegistry>;
|
|
1953
|
-
}
|
|
1954
|
-
declare class SupabaseServerAuthFactory<TRegistry extends XenoRegistry = XenoRegistry> implements IFactory<SupabaseServerAuthFactoryInput<TRegistry>, IExtendendAuthService> {
|
|
1955
|
-
create({ config, container, }: SupabaseServerAuthFactoryInput<TRegistry>): IExtendendAuthService;
|
|
1956
|
-
private _getCookieSsr;
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
1870
|
/**
|
|
1960
1871
|
* @description Base HTTP adapter.
|
|
1961
1872
|
* @author Xeno
|
|
@@ -2070,6 +1981,15 @@ declare abstract class Repository<T, TDto> implements IRepository<T> {
|
|
|
2070
1981
|
update(id: string | number, entity: Partial<T>, ctx: UserContext, signal: Optional<AbortSignal>): Promise<ResultType<void>>;
|
|
2071
1982
|
}
|
|
2072
1983
|
|
|
1984
|
+
/**
|
|
1985
|
+
* @description The XenoRegistry type is an alias for the ApplicationRegistry specialized with DbContext. It represents the registry of application services and dependencies, specifically tailored for applications that utilize a database context. This type is used throughout the application to ensure consistent typing and to facilitate dependency injection and service resolution.
|
|
1986
|
+
* @author Xeno
|
|
1987
|
+
* @version 1.0.0
|
|
1988
|
+
* @since 2025-09-30
|
|
1989
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
1990
|
+
*/
|
|
1991
|
+
type XenoRegistry<TExtensions = object> = ApplicationRegistry & Readonly<Omit<TExtensions, keyof ApplicationRegistry>>;
|
|
1992
|
+
|
|
2073
1993
|
/**
|
|
2074
1994
|
* BaseController is an abstract class that implements the IController interface. It provides a foundation for creating specific controllers that handle incoming requests and return responses. The class requires a mediator to facilitate communication between different parts of the application.
|
|
2075
1995
|
* @template TRequest - The type of the request object that the controller will handle.
|
|
@@ -2150,4 +2070,4 @@ declare abstract class BaseController<TRequest, TResponse> implements IControlle
|
|
|
2150
2070
|
protected getContext(): Optional<RequestContext>;
|
|
2151
2071
|
}
|
|
2152
2072
|
|
|
2153
|
-
export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BaseHttpAdapter,
|
|
2073
|
+
export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BaseHttpAdapter, ContainerUtils, type CookieHandlerOptions, type ExecutionContext, type HttpAdapterConfig, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, type IHttpAdapter, type IIPResolver, type IModule, type IRateLimitKeyBuilder, type IRequestContext, type IServiceContainer, type IServiceProvider, type IServiceScope, type IServiceScopeAccessor, type ISsrCookie, type ISsrCookieHandler, type ISsrCookieToSet, type Lifetime, type LoggerConfig, type MiddlewareConfig, type PinoLoggerConfig, type PipelineConfig, ReadDao, Repository, type ResilienceConfig, type SchemaConfig, type SentryLoggerConfig, type ServiceDescriptor, Specification, type XenoRegistry, type XenoWebTransport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { ICache, Optional, IExtendendAuthService, IBaseAuthService, ICacheKeyBuilder, IPipelineBehavior, ICommand, IConcurrencyService, IConfigurationService, ILogger, IMediator, IMiddleware, IQuery, RequestContext, IServiceResilience, IServiceExtractor, Metadata, IUnitOfWork, IDisposable, IValidatorService, IIdentityAccessor, IContextAccessor, INetworkContextAccessor, IFactory, UserContext, ITransactionState, Factory, IBaseAccessor, Identity, ExtendedRequest, HttpMethod, AuthConfig, CookieOptions, SetupAction, HttpClientConfig, LogLevel, ILoggerClient, Dictionary, AuthPolicy, IStrategy, IRequest, ResponseDto, IHandler, ResultType, ISpecification, CacheConfig, DbConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
|
|
2
2
|
export * from '@xeno-js/shared';
|
|
3
|
-
export { Query
|
|
4
|
-
import { SupabaseClientOptions } from '@supabase/supabase-js';
|
|
5
|
-
import * as _libsql_client_web from '@libsql/client/web';
|
|
6
|
-
import * as drizzle_orm_libsql from 'drizzle-orm/libsql';
|
|
7
|
-
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
|
8
|
-
import * as drizzle_orm_node_postgres from 'drizzle-orm/node-postgres';
|
|
9
|
-
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
10
|
-
export * from 'drizzle-orm';
|
|
11
|
-
export { Query } from 'drizzle-orm';
|
|
3
|
+
export { Query } from '@xeno-js/shared';
|
|
12
4
|
|
|
13
5
|
/**
|
|
14
6
|
* @description IAtomicCache is an interface that extends the ICache interface and adds an increment method. The increment method takes a key and an optional ttlSeconds parameter and returns a Promise that resolves to an incremented value.
|
|
@@ -762,7 +754,7 @@ interface ISsrCookieHandler {
|
|
|
762
754
|
interface CookieHandlerOptions extends CookieOptions {
|
|
763
755
|
httpOnly: boolean;
|
|
764
756
|
}
|
|
765
|
-
interface AuthSsrConfig<TOption, TRegistry extends ApplicationRegistry = ApplicationRegistry> extends AuthConfig<TOption> {
|
|
757
|
+
interface AuthSsrConfig<TOption = unknown, TRegistry extends ApplicationRegistry = ApplicationRegistry> extends AuthConfig<TOption> {
|
|
766
758
|
ssrOpts: Optional<(container: IServiceContainer<TRegistry>) => ISsrCookieHandler>;
|
|
767
759
|
cookieOpts: CookieHandlerOptions;
|
|
768
760
|
customAuth: Optional<{
|
|
@@ -1663,38 +1655,6 @@ declare abstract class Specification<T> implements ISpecification<T> {
|
|
|
1663
1655
|
not(): ISpecification<T>;
|
|
1664
1656
|
}
|
|
1665
1657
|
|
|
1666
|
-
/**
|
|
1667
|
-
* @description Type definition for the database context used in the application.
|
|
1668
|
-
* Polymorphically handles both PostgreSQL and libSQL (SQLite/Turso) engines.
|
|
1669
|
-
*
|
|
1670
|
-
* @author Xeno
|
|
1671
|
-
* @version 1.0.0
|
|
1672
|
-
* @since 2025-09-30
|
|
1673
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1674
|
-
*/
|
|
1675
|
-
type DbContext<TSchema extends Dictionary = Dictionary> = drizzle_orm_node_postgres.NodePgDatabase<TSchema> | (drizzle_orm_libsql.LibSQLDatabase<TSchema> & {
|
|
1676
|
-
$client: _libsql_client_web.Client;
|
|
1677
|
-
});
|
|
1678
|
-
/**
|
|
1679
|
-
* @description Type definition for the transaction object used in the database context.
|
|
1680
|
-
* Polymorphically handles both PostgreSQL and libSQL (SQLite/Turso) engines.
|
|
1681
|
-
*
|
|
1682
|
-
* @author Xeno
|
|
1683
|
-
* @version 1.0.0
|
|
1684
|
-
* @since 2025-09-30
|
|
1685
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1686
|
-
*/
|
|
1687
|
-
type DbTransaction = Parameters<Parameters<DbContext['transaction']>[0]>[0];
|
|
1688
|
-
|
|
1689
|
-
/**
|
|
1690
|
-
* @description The XenoRegistry type is an alias for the ApplicationRegistry specialized with DbContext. It represents the registry of application services and dependencies, specifically tailored for applications that utilize a database context. This type is used throughout the application to ensure consistent typing and to facilitate dependency injection and service resolution.
|
|
1691
|
-
* @author Xeno
|
|
1692
|
-
* @version 1.0.0
|
|
1693
|
-
* @since 2025-09-30
|
|
1694
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1695
|
-
*/
|
|
1696
|
-
type XenoRegistry<TSchema extends Dictionary = Dictionary, TExtensions = object> = ApplicationRegistry<DbContext<TSchema>, DbTransaction> & Readonly<Omit<TExtensions, keyof ApplicationRegistry<DbContext<TSchema>, DbTransaction>>>;
|
|
1697
|
-
|
|
1698
1658
|
/**
|
|
1699
1659
|
* @description The AppBuilder class provides a fluent, .NET-style API for configuring and bootstrapping the application.
|
|
1700
1660
|
* It orchestrates the registration of various modules (CQRS, HTTP, Database, Logging, Auth) into the ServiceContainer.
|
|
@@ -1705,11 +1665,11 @@ type XenoRegistry<TSchema extends Dictionary = Dictionary, TExtensions = object>
|
|
|
1705
1665
|
* @since 2025-09-30
|
|
1706
1666
|
* @link https://github.com/xeno-js/xeno-js
|
|
1707
1667
|
*/
|
|
1708
|
-
declare class AppBuilder<TRegistry extends
|
|
1668
|
+
declare class AppBuilder<TRegistry extends ApplicationRegistry = ApplicationRegistry> {
|
|
1709
1669
|
private readonly _container;
|
|
1710
1670
|
private readonly _configuration;
|
|
1711
1671
|
private _isBuilded;
|
|
1712
|
-
constructor(container?: IServiceContainer<TRegistry
|
|
1672
|
+
constructor(container?: IServiceContainer<TRegistry>, configurationService?: IConfigurationService);
|
|
1713
1673
|
private readonly _modules;
|
|
1714
1674
|
private _adapterConfig;
|
|
1715
1675
|
private _pipelineConfig;
|
|
@@ -1784,7 +1744,7 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1784
1744
|
* @since 2025-09-30
|
|
1785
1745
|
* @link https://github.com/xeno-js/xeno-js
|
|
1786
1746
|
*/
|
|
1787
|
-
addAuth(setupAction: SetupAction<AuthSsrConfig
|
|
1747
|
+
addAuth(setupAction: SetupAction<AuthSsrConfig, IConfigurationService>): this;
|
|
1788
1748
|
/**
|
|
1789
1749
|
* @description Configures the database settings for the application. This method allows you to set up database options such as enabling/disabling the database, connection string, and table definitions.
|
|
1790
1750
|
* @param setupAction A callback function that receives a DbConfig object to configure the database settings.
|
|
@@ -1860,7 +1820,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1860
1820
|
* @description Resolves a service from the dependency injection container.
|
|
1861
1821
|
* @param token The injection token used to identify the service.
|
|
1862
1822
|
* @returns The resolved service instance.
|
|
1863
|
-
|
|
1864
1823
|
*
|
|
1865
1824
|
* @author Xeno
|
|
1866
1825
|
* @version 1.0.0
|
|
@@ -1871,7 +1830,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1871
1830
|
/**
|
|
1872
1831
|
* @description Finalizes the configuration and initializes all registered modules in the container.
|
|
1873
1832
|
* @returns The fully configured ServiceContainer.
|
|
1874
|
-
|
|
1875
1833
|
*
|
|
1876
1834
|
* @author Xeno
|
|
1877
1835
|
* @version 1.0.0
|
|
@@ -1881,7 +1839,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1881
1839
|
build(): Promise<IServiceContainer<TRegistry>>;
|
|
1882
1840
|
/**
|
|
1883
1841
|
* @description Queues the configuration of the CQRS pipeline module if it has not already been queued. This method ensures that the pipeline module is only added once, even if multiple pipeline-related configurations are made.
|
|
1884
|
-
|
|
1885
1842
|
*
|
|
1886
1843
|
* @author Xeno
|
|
1887
1844
|
* @version 1.0.0
|
|
@@ -1891,7 +1848,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1891
1848
|
private _queuePipelineModule;
|
|
1892
1849
|
/**
|
|
1893
1850
|
* @description Queues the configuration of the middleware module if it has not already been queued. This method ensures that the middleware module is only added once, even if multiple middleware-related configurations are made.
|
|
1894
|
-
|
|
1895
1851
|
*
|
|
1896
1852
|
* @author Xeno
|
|
1897
1853
|
* @version 1.0.0
|
|
@@ -1911,51 +1867,6 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
|
|
|
1911
1867
|
private _queueContextModule;
|
|
1912
1868
|
}
|
|
1913
1869
|
|
|
1914
|
-
/**
|
|
1915
|
-
* @description BasePostgresSqlDataSource is an abstract class that serves as a foundation for creating data sources that interact with a PostgreSQL database. It provides a common interface for accessing the database connection and ensures that the database connection is properly initialized and managed. By extending this class, developers can easily create data sources that are tailored to their specific use cases.
|
|
1916
|
-
*
|
|
1917
|
-
* @author Xeno
|
|
1918
|
-
* @version 1.0.0
|
|
1919
|
-
* @since 2025-09-30
|
|
1920
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1921
|
-
*/
|
|
1922
|
-
declare abstract class BasePostgresSqlDataSource<TSchema extends Dictionary = Dictionary> {
|
|
1923
|
-
private readonly _db;
|
|
1924
|
-
constructor(_db: DbContext<TSchema>);
|
|
1925
|
-
/**
|
|
1926
|
-
* @description Returns the database connection.
|
|
1927
|
-
* @returns {NodePgDatabase<TSchema>} The database connection.
|
|
1928
|
-
*/
|
|
1929
|
-
protected get db(): NodePgDatabase<TSchema>;
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
/**
|
|
1933
|
-
* @description BaseSqliteSqlDataSource is an abstract class that serves as a foundation for creating data sources that interact with a SQLite / libSQL database.
|
|
1934
|
-
*
|
|
1935
|
-
* @author Xeno
|
|
1936
|
-
* @version 1.0.0
|
|
1937
|
-
* @since 2025-09-30
|
|
1938
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1939
|
-
*/
|
|
1940
|
-
declare abstract class BaseSqliteSqlDataSource<TSchema extends Dictionary = Dictionary> {
|
|
1941
|
-
private readonly _db;
|
|
1942
|
-
constructor(_db: DbContext<TSchema>);
|
|
1943
|
-
/**
|
|
1944
|
-
* @description Returns the SQLite database connection.
|
|
1945
|
-
* @returns {LibSQLDatabase<TSchema>} The database connection.
|
|
1946
|
-
*/
|
|
1947
|
-
protected get db(): LibSQLDatabase<TSchema>;
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
interface SupabaseServerAuthFactoryInput<TRegistry extends XenoRegistry> {
|
|
1951
|
-
config: AuthSsrConfig<SupabaseClientOptions<'public'>>;
|
|
1952
|
-
container: IServiceContainer<TRegistry>;
|
|
1953
|
-
}
|
|
1954
|
-
declare class SupabaseServerAuthFactory<TRegistry extends XenoRegistry = XenoRegistry> implements IFactory<SupabaseServerAuthFactoryInput<TRegistry>, IExtendendAuthService> {
|
|
1955
|
-
create({ config, container, }: SupabaseServerAuthFactoryInput<TRegistry>): IExtendendAuthService;
|
|
1956
|
-
private _getCookieSsr;
|
|
1957
|
-
}
|
|
1958
|
-
|
|
1959
1870
|
/**
|
|
1960
1871
|
* @description Base HTTP adapter.
|
|
1961
1872
|
* @author Xeno
|
|
@@ -2070,6 +1981,15 @@ declare abstract class Repository<T, TDto> implements IRepository<T> {
|
|
|
2070
1981
|
update(id: string | number, entity: Partial<T>, ctx: UserContext, signal: Optional<AbortSignal>): Promise<ResultType<void>>;
|
|
2071
1982
|
}
|
|
2072
1983
|
|
|
1984
|
+
/**
|
|
1985
|
+
* @description The XenoRegistry type is an alias for the ApplicationRegistry specialized with DbContext. It represents the registry of application services and dependencies, specifically tailored for applications that utilize a database context. This type is used throughout the application to ensure consistent typing and to facilitate dependency injection and service resolution.
|
|
1986
|
+
* @author Xeno
|
|
1987
|
+
* @version 1.0.0
|
|
1988
|
+
* @since 2025-09-30
|
|
1989
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
1990
|
+
*/
|
|
1991
|
+
type XenoRegistry<TExtensions = object> = ApplicationRegistry & Readonly<Omit<TExtensions, keyof ApplicationRegistry>>;
|
|
1992
|
+
|
|
2073
1993
|
/**
|
|
2074
1994
|
* BaseController is an abstract class that implements the IController interface. It provides a foundation for creating specific controllers that handle incoming requests and return responses. The class requires a mediator to facilitate communication between different parts of the application.
|
|
2075
1995
|
* @template TRequest - The type of the request object that the controller will handle.
|
|
@@ -2150,4 +2070,4 @@ declare abstract class BaseController<TRequest, TResponse> implements IControlle
|
|
|
2150
2070
|
protected getContext(): Optional<RequestContext>;
|
|
2151
2071
|
}
|
|
2152
2072
|
|
|
2153
|
-
export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BaseHttpAdapter,
|
|
2073
|
+
export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BaseHttpAdapter, ContainerUtils, type CookieHandlerOptions, type ExecutionContext, type HttpAdapterConfig, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, type IHttpAdapter, type IIPResolver, type IModule, type IRateLimitKeyBuilder, type IRequestContext, type IServiceContainer, type IServiceProvider, type IServiceScope, type IServiceScopeAccessor, type ISsrCookie, type ISsrCookieHandler, type ISsrCookieToSet, type Lifetime, type LoggerConfig, type MiddlewareConfig, type PinoLoggerConfig, type PipelineConfig, ReadDao, Repository, type ResilienceConfig, type SchemaConfig, type SentryLoggerConfig, type ServiceDescriptor, Specification, type XenoRegistry, type XenoWebTransport };
|