@xeno-js/core 0.1.7 → 0.1.8

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.cts CHANGED
@@ -4,7 +4,9 @@ export { Query as BaseQuery } from '@xeno-js/shared';
4
4
  import { SupabaseClientOptions } from '@supabase/supabase-js';
5
5
  import * as _libsql_client_web from '@libsql/client/web';
6
6
  import * as drizzle_orm_libsql from 'drizzle-orm/libsql';
7
+ import { LibSQLDatabase } from 'drizzle-orm/libsql';
7
8
  import * as drizzle_orm_node_postgres from 'drizzle-orm/node-postgres';
9
+ import { NodePgDatabase } from 'drizzle-orm/node-postgres';
8
10
  export * from 'drizzle-orm';
9
11
  export { Query } from 'drizzle-orm';
10
12
 
@@ -2017,6 +2019,42 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
2017
2019
  private _queueContextModule;
2018
2020
  }
2019
2021
 
2022
+ /**
2023
+ * @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.
2024
+ *
2025
+ * @author Xeno
2026
+ * @version 1.0.0
2027
+ * @since 2025-09-30
2028
+ * @link https://github.com/xeno-js/xeno-js
2029
+ */
2030
+ declare abstract class BasePostgresSqlDataSource<TSchema extends Dictionary = Dictionary> {
2031
+ private readonly _db;
2032
+ constructor(_db: DbContext<TSchema>);
2033
+ /**
2034
+ * @description Returns the database connection.
2035
+ * @returns {NodePgDatabase<TSchema>} The database connection.
2036
+ */
2037
+ protected get db(): NodePgDatabase<TSchema>;
2038
+ }
2039
+
2040
+ /**
2041
+ * @description BaseSqliteSqlDataSource is an abstract class that serves as a foundation for creating data sources that interact with a SQLite / libSQL database.
2042
+ *
2043
+ * @author Xeno
2044
+ * @version 1.0.0
2045
+ * @since 2025-09-30
2046
+ * @link https://github.com/xeno-js/xeno-js
2047
+ */
2048
+ declare abstract class BaseSqliteSqlDataSource<TSchema extends Dictionary = Dictionary> {
2049
+ private readonly _db;
2050
+ constructor(_db: DbContext<TSchema>);
2051
+ /**
2052
+ * @description Returns the SQLite database connection.
2053
+ * @returns {LibSQLDatabase<TSchema>} The database connection.
2054
+ */
2055
+ protected get db(): LibSQLDatabase<TSchema>;
2056
+ }
2057
+
2020
2058
  interface SupabaseServerAuthFactoryInput<TRegistry extends XenoRegistry> {
2021
2059
  config: AuthSsrConfig<SupabaseClientOptions<'public'>>;
2022
2060
  container: IServiceContainer<TRegistry>;
@@ -2166,4 +2204,4 @@ declare abstract class BaseController<TRequest, TResponse> implements IControlle
2166
2204
  protected getContext(): Optional<RequestContext>;
2167
2205
  }
2168
2206
 
2169
- export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, ContainerUtils, type DbContext, type DbTransaction, type ExecutionContext, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, 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, SupabaseServerAuthFactory, type XenoRegistry };
2207
+ export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BasePostgresSqlDataSource, BaseSqliteSqlDataSource, ContainerUtils, type DbContext, type DbTransaction, type ExecutionContext, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, 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, SupabaseServerAuthFactory, type XenoRegistry };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,9 @@ export { Query as BaseQuery } from '@xeno-js/shared';
4
4
  import { SupabaseClientOptions } from '@supabase/supabase-js';
5
5
  import * as _libsql_client_web from '@libsql/client/web';
6
6
  import * as drizzle_orm_libsql from 'drizzle-orm/libsql';
7
+ import { LibSQLDatabase } from 'drizzle-orm/libsql';
7
8
  import * as drizzle_orm_node_postgres from 'drizzle-orm/node-postgres';
9
+ import { NodePgDatabase } from 'drizzle-orm/node-postgres';
8
10
  export * from 'drizzle-orm';
9
11
  export { Query } from 'drizzle-orm';
10
12
 
@@ -2017,6 +2019,42 @@ declare class AppBuilder<TRegistry extends XenoRegistry = XenoRegistry> {
2017
2019
  private _queueContextModule;
2018
2020
  }
2019
2021
 
2022
+ /**
2023
+ * @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.
2024
+ *
2025
+ * @author Xeno
2026
+ * @version 1.0.0
2027
+ * @since 2025-09-30
2028
+ * @link https://github.com/xeno-js/xeno-js
2029
+ */
2030
+ declare abstract class BasePostgresSqlDataSource<TSchema extends Dictionary = Dictionary> {
2031
+ private readonly _db;
2032
+ constructor(_db: DbContext<TSchema>);
2033
+ /**
2034
+ * @description Returns the database connection.
2035
+ * @returns {NodePgDatabase<TSchema>} The database connection.
2036
+ */
2037
+ protected get db(): NodePgDatabase<TSchema>;
2038
+ }
2039
+
2040
+ /**
2041
+ * @description BaseSqliteSqlDataSource is an abstract class that serves as a foundation for creating data sources that interact with a SQLite / libSQL database.
2042
+ *
2043
+ * @author Xeno
2044
+ * @version 1.0.0
2045
+ * @since 2025-09-30
2046
+ * @link https://github.com/xeno-js/xeno-js
2047
+ */
2048
+ declare abstract class BaseSqliteSqlDataSource<TSchema extends Dictionary = Dictionary> {
2049
+ private readonly _db;
2050
+ constructor(_db: DbContext<TSchema>);
2051
+ /**
2052
+ * @description Returns the SQLite database connection.
2053
+ * @returns {LibSQLDatabase<TSchema>} The database connection.
2054
+ */
2055
+ protected get db(): LibSQLDatabase<TSchema>;
2056
+ }
2057
+
2020
2058
  interface SupabaseServerAuthFactoryInput<TRegistry extends XenoRegistry> {
2021
2059
  config: AuthSsrConfig<SupabaseClientOptions<'public'>>;
2022
2060
  container: IServiceContainer<TRegistry>;
@@ -2166,4 +2204,4 @@ declare abstract class BaseController<TRequest, TResponse> implements IControlle
2166
2204
  protected getContext(): Optional<RequestContext>;
2167
2205
  }
2168
2206
 
2169
- export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, ContainerUtils, type DbContext, type DbTransaction, type ExecutionContext, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, 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, SupabaseServerAuthFactory, type XenoRegistry };
2207
+ export { AppBuilder, type ApplicationRegistry, type AuthSsrConfig, BaseAuthorizationStrategy, BaseController, BaseHandler, BasePostgresSqlDataSource, BaseSqliteSqlDataSource, ContainerUtils, type DbContext, type DbTransaction, type ExecutionContext, type HttpConfig, type HttpCoreConfig, type IAllowMethod, type IAllowOrigin, type IAtomicCache, type ICryptoService, type ICsrfTokenService, 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, SupabaseServerAuthFactory, type XenoRegistry };
package/dist/index.js CHANGED
@@ -4539,7 +4539,9 @@ __export(index_exports, {
4539
4539
  BaseAuthorizationStrategy: () => BaseAuthorizationStrategy,
4540
4540
  BaseController: () => BaseController,
4541
4541
  BaseHandler: () => BaseHandler,
4542
+ BasePostgresSqlDataSource: () => BasePostgresSqlDataSource,
4542
4543
  BaseQuery: () => Query,
4544
+ BaseSqliteSqlDataSource: () => BaseSqliteSqlDataSource,
4543
4545
  ContainerUtils: () => ContainerUtils,
4544
4546
  ReadDao: () => ReadDao,
4545
4547
  Repository: () => Repository,
@@ -5311,6 +5313,36 @@ init_cache();
5311
5313
  // src/infrastructure/context/index.ts
5312
5314
  init_request_context();
5313
5315
 
5316
+ // src/infrastructure/datasources/base-postgressql.datasource.ts
5317
+ var BasePostgresSqlDataSource = class {
5318
+ constructor(_db) {
5319
+ this._db = _db;
5320
+ }
5321
+ _db;
5322
+ /**
5323
+ * @description Returns the database connection.
5324
+ * @returns {NodePgDatabase<TSchema>} The database connection.
5325
+ */
5326
+ get db() {
5327
+ return this._db;
5328
+ }
5329
+ };
5330
+
5331
+ // src/infrastructure/datasources/base-sqllite.datasource.ts
5332
+ var BaseSqliteSqlDataSource = class {
5333
+ constructor(_db) {
5334
+ this._db = _db;
5335
+ }
5336
+ _db;
5337
+ /**
5338
+ * @description Returns the SQLite database connection.
5339
+ * @returns {LibSQLDatabase<TSchema>} The database connection.
5340
+ */
5341
+ get db() {
5342
+ return this._db;
5343
+ }
5344
+ };
5345
+
5314
5346
  // src/infrastructure/datasources/remote.datasource.ts
5315
5347
  import { AppError as AppError15, Result as Result16 } from "@xeno-js/shared";
5316
5348
 
@@ -5452,7 +5484,9 @@ export {
5452
5484
  BaseAuthorizationStrategy,
5453
5485
  BaseController,
5454
5486
  BaseHandler,
5487
+ BasePostgresSqlDataSource,
5455
5488
  Query as BaseQuery,
5489
+ BaseSqliteSqlDataSource,
5456
5490
  ContainerUtils,
5457
5491
  ReadDao,
5458
5492
  Repository,