@xeno-js/core 0.1.6 → 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.cjs CHANGED
@@ -4308,8 +4308,7 @@ var init_middleware_module = __esm({
4308
4308
  )
4309
4309
  );
4310
4310
  if (!import_shared73.Guards.isNullOrEmpty(opts.allowOrigins)) {
4311
- const withCredentials2 = opts.httpConfig.withCredentials ?? false;
4312
- if (withCredentials2 && opts.allowOrigins.includes("*"))
4311
+ if (opts.withCredentials && opts.allowOrigins.includes("*"))
4313
4312
  throw new Error(
4314
4313
  "Wildcard CORS origin is not allowed when withCredentials is set to true in addHttpCore"
4315
4314
  );
@@ -4327,7 +4326,7 @@ var init_middleware_module = __esm({
4327
4326
  });
4328
4327
  middlewares.push(TOKENS4.ALLOW_ORIGIN_MIDDLEWARE);
4329
4328
  }
4330
- const withCredentials = import_shared73.Guards.isDefined(opts.httpConfig.withCredentials) && opts.httpConfig.withCredentials ? "true" : "false";
4329
+ const withCredentials = opts.withCredentials ? "true" : "false";
4331
4330
  if (opts.optionsMiddleware) {
4332
4331
  const { OptionsMiddleware: OptionsMiddleware2 } = await Promise.resolve().then(() => (init_presentation(), presentation_exports));
4333
4332
  container.addSingleton(
@@ -4486,7 +4485,9 @@ __export(index_exports, {
4486
4485
  BaseAuthorizationStrategy: () => BaseAuthorizationStrategy,
4487
4486
  BaseController: () => BaseController,
4488
4487
  BaseHandler: () => BaseHandler,
4488
+ BasePostgresSqlDataSource: () => BasePostgresSqlDataSource,
4489
4489
  BaseQuery: () => import_shared80.Query,
4490
+ BaseSqliteSqlDataSource: () => BaseSqliteSqlDataSource,
4490
4491
  ContainerUtils: () => ContainerUtils,
4491
4492
  ReadDao: () => ReadDao,
4492
4493
  Repository: () => Repository,
@@ -4810,7 +4811,8 @@ var AppBuilder = class {
4810
4811
  trustedProxies: [],
4811
4812
  allowOrigins: [],
4812
4813
  allowHeaders: [],
4813
- cors: true
4814
+ cors: true,
4815
+ withCredentials: true
4814
4816
  };
4815
4817
  _httpConfig = {
4816
4818
  dataSourceToken: void 0,
@@ -5223,8 +5225,7 @@ var AppBuilder = class {
5223
5225
  ...this._middlewareConfig,
5224
5226
  isAuth: this._isAuthModuleQueued,
5225
5227
  isLogger: this._isLoggerModuleQueued,
5226
- isCache: this._isCacheModuleQueued || this._isPipelineModuleQueued,
5227
- httpConfig: this._httpConfig.http.client
5228
+ isCache: this._isCacheModuleQueued || this._isPipelineModuleQueued
5228
5229
  });
5229
5230
  }
5230
5231
  });
@@ -5259,6 +5260,36 @@ init_cache();
5259
5260
  // src/infrastructure/context/index.ts
5260
5261
  init_request_context();
5261
5262
 
5263
+ // src/infrastructure/datasources/base-postgressql.datasource.ts
5264
+ var BasePostgresSqlDataSource = class {
5265
+ constructor(_db) {
5266
+ this._db = _db;
5267
+ }
5268
+ _db;
5269
+ /**
5270
+ * @description Returns the database connection.
5271
+ * @returns {NodePgDatabase<TSchema>} The database connection.
5272
+ */
5273
+ get db() {
5274
+ return this._db;
5275
+ }
5276
+ };
5277
+
5278
+ // src/infrastructure/datasources/base-sqllite.datasource.ts
5279
+ var BaseSqliteSqlDataSource = class {
5280
+ constructor(_db) {
5281
+ this._db = _db;
5282
+ }
5283
+ _db;
5284
+ /**
5285
+ * @description Returns the SQLite database connection.
5286
+ * @returns {LibSQLDatabase<TSchema>} The database connection.
5287
+ */
5288
+ get db() {
5289
+ return this._db;
5290
+ }
5291
+ };
5292
+
5262
5293
  // src/infrastructure/datasources/remote.datasource.ts
5263
5294
  var import_shared75 = require("@xeno-js/shared");
5264
5295
 
@@ -5400,7 +5431,9 @@ var import_shared80 = require("@xeno-js/shared");
5400
5431
  BaseAuthorizationStrategy,
5401
5432
  BaseController,
5402
5433
  BaseHandler,
5434
+ BasePostgresSqlDataSource,
5403
5435
  BaseQuery,
5436
+ BaseSqliteSqlDataSource,
5404
5437
  ContainerUtils,
5405
5438
  ReadDao,
5406
5439
  Repository,