@xeno-js/core 3.0.4 → 3.0.5

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
@@ -1,4 +1,4 @@
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, ResultType, ISpecification, CacheConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
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, ResultType, ISpecification, Nullable, CacheConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
2
2
  export * from '@xeno-js/shared';
3
3
  export { Query } from '@xeno-js/shared';
4
4
 
@@ -1686,9 +1686,9 @@ interface QueuedModule {
1686
1686
  * @link https://github.com/xeno-js/xeno-js
1687
1687
  */
1688
1688
  declare class AppBuilder<TRegistry extends ApplicationRegistry = ApplicationRegistry> {
1689
- protected readonly _container: IServiceContainer<TRegistry>;
1689
+ protected _container: IServiceContainer<TRegistry>;
1690
1690
  protected readonly _configuration: IConfigurationService;
1691
- private _buildPromise;
1691
+ protected _buildPromise: Nullable<Promise<IServiceContainer<TRegistry>>>;
1692
1692
  constructor(container?: IServiceContainer<TRegistry>, configurationService?: IConfigurationService);
1693
1693
  protected readonly _modules: QueuedModule[];
1694
1694
  private _adapterConfig;
@@ -1857,6 +1857,7 @@ declare class AppBuilder<TRegistry extends ApplicationRegistry = ApplicationRegi
1857
1857
  * @link https://github.com/xeno-js/xeno-js
1858
1858
  */
1859
1859
  build(): Promise<IServiceContainer<TRegistry>>;
1860
+ protected _resetContainer(): Promise<void>;
1860
1861
  /**
1861
1862
  * @description Executes the build process by initializing all registered modules in the container.
1862
1863
  */
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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, ResultType, ISpecification, CacheConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
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, ResultType, ISpecification, Nullable, CacheConfig, IReadDao, IReadDataSource, IMapper, IRepository, IWriteDataSource, IController, AppError } from '@xeno-js/shared';
2
2
  export * from '@xeno-js/shared';
3
3
  export { Query } from '@xeno-js/shared';
4
4
 
@@ -1686,9 +1686,9 @@ interface QueuedModule {
1686
1686
  * @link https://github.com/xeno-js/xeno-js
1687
1687
  */
1688
1688
  declare class AppBuilder<TRegistry extends ApplicationRegistry = ApplicationRegistry> {
1689
- protected readonly _container: IServiceContainer<TRegistry>;
1689
+ protected _container: IServiceContainer<TRegistry>;
1690
1690
  protected readonly _configuration: IConfigurationService;
1691
- private _buildPromise;
1691
+ protected _buildPromise: Nullable<Promise<IServiceContainer<TRegistry>>>;
1692
1692
  constructor(container?: IServiceContainer<TRegistry>, configurationService?: IConfigurationService);
1693
1693
  protected readonly _modules: QueuedModule[];
1694
1694
  private _adapterConfig;
@@ -1857,6 +1857,7 @@ declare class AppBuilder<TRegistry extends ApplicationRegistry = ApplicationRegi
1857
1857
  * @link https://github.com/xeno-js/xeno-js
1858
1858
  */
1859
1859
  build(): Promise<IServiceContainer<TRegistry>>;
1860
+ protected _resetContainer(): Promise<void>;
1860
1861
  /**
1861
1862
  * @description Executes the build process by initializing all registered modules in the container.
1862
1863
  */
package/dist/index.js CHANGED
@@ -5186,14 +5186,20 @@ var AppBuilder = class {
5186
5186
  void attempt.then(
5187
5187
  () => {
5188
5188
  },
5189
- () => {
5189
+ async () => {
5190
5190
  if (this._buildPromise === attempt) {
5191
5191
  this._buildPromise = null;
5192
+ await this._resetContainer();
5192
5193
  }
5193
5194
  }
5194
5195
  );
5195
5196
  return attempt;
5196
5197
  }
5198
+ async _resetContainer() {
5199
+ await this._container.dispose();
5200
+ this._container = new ServiceContainer();
5201
+ this._container.addSingleton(TOKENS5.CONFIGURATION_SERVICE, () => this._configuration);
5202
+ }
5197
5203
  /**
5198
5204
  * @description Executes the build process by initializing all registered modules in the container.
5199
5205
  */