@asor-studio/asor-core 1.0.10 → 1.0.12

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/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { OnInit, OnDestroy, QueryList, Type, PipeTransform } from '@angular/core
3
3
  import { ActivatedRoute, CanActivate, Data, Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, RedirectCommand } from '@angular/router';
4
4
  import { Location } from '@angular/common';
5
5
  import { Observable, BehaviorSubject, ReplaySubject } from 'rxjs';
6
- import { HttpParams, HttpHeaders, HttpResponse, HttpRequest, HttpErrorResponse, HttpStatusCode, HttpInterceptor, HttpHandler, HttpEvent } from '@angular/common/http';
6
+ import { HttpParams, HttpHeaders, HttpResponse, HttpRequest, HttpErrorResponse, HttpStatusCode, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
7
7
  import * as _asor_studio_asor_core from '@asor-studio/asor-core';
8
8
 
9
9
  /**
@@ -191,7 +191,7 @@ declare abstract class ConfigConst {
191
191
  * }
192
192
  * }
193
193
  */
194
- declare abstract class BaseMolecule implements IComp, IConsoleLoggable {
194
+ declare abstract class BaseMolecule implements IBaseMolecule, IConsoleLoggable, OnInit, OnDestroy {
195
195
  static readonly className: string;
196
196
  /**
197
197
  * Injected ActivatedRoute for accessing route data and parameters.
@@ -263,6 +263,36 @@ declare abstract class BaseMolecule implements IComp, IConsoleLoggable {
263
263
  * }
264
264
  */
265
265
  baseCompViewLeave(): void;
266
+ /**
267
+ * Lifecycle hook called when the component view is about to enter.
268
+ * Must be implemented by derived classes to define component-specific initialization logic.
269
+ *
270
+ * @throws Error if not implemented by the extending class
271
+ *
272
+ * @example
273
+ * export class MyMolecule extends BaseMolecule {
274
+ * baseCompViewWillEnter(): void {
275
+ * console.log('Component is entering view');
276
+ * this.loadData();
277
+ * }
278
+ * }
279
+ */
280
+ baseMoleculeViewWillEnter(): void;
281
+ /**
282
+ * Lifecycle hook called when the component view is about to leave.
283
+ * Must be implemented by derived classes to define component-specific cleanup logic.
284
+ *
285
+ * @throws Error if not implemented by the extending class
286
+ *
287
+ * @example
288
+ * export class MyMolecule extends BaseMolecule {
289
+ * baseCompViewWillLeave(): void {
290
+ * console.log('Component is leaving view');
291
+ * this.cleanup();
292
+ * }
293
+ * }
294
+ */
295
+ baseMoleculeViewWillLeave(): void;
266
296
  /**
267
297
  * Returns the name of the current component class.
268
298
  * Used internally to match the component with its configuration in route data.
@@ -274,6 +304,28 @@ declare abstract class BaseMolecule implements IComp, IConsoleLoggable {
274
304
  * console.log(this.getClassName()); // Outputs: "UserCardComponent"
275
305
  */
276
306
  getClassName(): string;
307
+ /**
308
+ * Lifecycle hook called when the component is initialized.
309
+ * Calls the baseMoleculeViewWillEnter() method.
310
+ */
311
+ ngOnInit(): void;
312
+ /**
313
+ * Lifecycle hook called when the component is destroyed.
314
+ * Calls the baseMoleculeViewWillLeave() method.
315
+ */
316
+ ngOnDestroy(): void;
317
+ /**
318
+ * Ionic lifecycle hook called when the view is about to enter and become the active view.
319
+ * This is called regardless of whether it is the first load or cached view.
320
+ * Delegates to baseCompViewWillEnter() for consistency across Angular and Ionic.
321
+ */
322
+ ionViewWillEnter(): void;
323
+ /**
324
+ * Ionic lifecycle hook called when the view is about to leave and no longer be the active view.
325
+ * This is called when navigating away from the current view.
326
+ * Delegates to baseCompViewWillLeave() for consistency across Angular and Ionic.
327
+ */
328
+ ionViewWillLeave(): void;
277
329
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseMolecule, never>;
278
330
  static ɵdir: i0.ɵɵDirectiveDeclaration<BaseMolecule, never, never, {}, {}, never, never, true, never>;
279
331
  }
@@ -532,10 +584,10 @@ declare class StateConst {
532
584
  static readonly CMPLX12 = 12;
533
585
  static readonly CMPLX6 = 6;
534
586
  }
535
- type EncryptType = typeof StateConst.EncryptType[keyof typeof StateConst.EncryptType];
536
- type GenerateType = typeof StateConst.Generate[keyof typeof StateConst.Generate];
537
- type StoreType = typeof StateConst.StoreType[keyof typeof StateConst.StoreType];
538
- type DataMethod = typeof StateConst.Data[keyof typeof StateConst.Data];
587
+ type EncryptType = (typeof StateConst.EncryptType)[keyof typeof StateConst.EncryptType];
588
+ type GenerateType = (typeof StateConst.Generate)[keyof typeof StateConst.Generate];
589
+ type StoreType = (typeof StateConst.StoreType)[keyof typeof StateConst.StoreType];
590
+ type DataMethod = (typeof StateConst.Data)[keyof typeof StateConst.Data];
539
591
 
540
592
  type StateConstants_d_DataMethod = DataMethod;
541
593
  type StateConstants_d_EncryptType = EncryptType;
@@ -870,6 +922,9 @@ interface IComponent {
870
922
  interface ICompStatic {
871
923
  readonly className: string;
872
924
  }
925
+ /**
926
+ * Interface for BaseComponent
927
+ */
873
928
  interface IComp {
874
929
  /** Array of i18n translation paths for this component */
875
930
  I18nPath: string[];
@@ -878,6 +933,19 @@ interface IComp {
878
933
  /** Called when the component view is about to leave/destroy */
879
934
  baseCompViewLeave(): void;
880
935
  }
936
+ /**
937
+ * Interface for BaseMolecule
938
+ */
939
+ interface IBaseMolecule extends IComp {
940
+ /**
941
+ * Called when the molecule view is about to enter/initialize
942
+ */
943
+ baseMoleculeViewWillEnter(): void;
944
+ /**
945
+ * Called when the molecule view is about to leave/destroy
946
+ */
947
+ baseMoleculeViewWillLeave(): void;
948
+ }
881
949
  /**
882
950
  * Interface for authorization response from the backend API.
883
951
  * Contains the authorization status indicating if the user is allowed to perform an action.
@@ -992,6 +1060,12 @@ interface IHttpResponseError {
992
1060
  */
993
1061
  interface IConsoleLoggable {
994
1062
  }
1063
+ interface IRequestMapping {
1064
+ className?: string;
1065
+ controller?: any;
1066
+ path: string;
1067
+ method: IHttpMethod;
1068
+ }
995
1069
 
996
1070
  /**
997
1071
  * Base cache path configuration class for the asor-core library.
@@ -2208,6 +2282,10 @@ declare abstract class BaseStorageMolecule<T extends object = Record<string, any
2208
2282
  * Override baseCompViewLeave to unregister from store
2209
2283
  */
2210
2284
  baseCompViewLeave(): void;
2285
+ /**
2286
+ * Override baseMoleculeViewWillLeave to unregister from store
2287
+ */
2288
+ baseMoleculeViewWillLeave(): void;
2211
2289
  constructor();
2212
2290
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseStorageMolecule<any>, never>;
2213
2291
  static ɵdir: i0.ɵɵDirectiveDeclaration<BaseStorageMolecule<any>, never, never, {}, {}, never, never, true, never>;
@@ -2331,6 +2409,14 @@ declare class NotifyErrorService implements IConsoleLoggable {
2331
2409
  static ɵprov: i0.ɵɵInjectableDeclaration<NotifyErrorService>;
2332
2410
  }
2333
2411
 
2412
+ declare class MockOrchestratorService {
2413
+ private get requestMappings();
2414
+ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
2415
+ registryController(className: string, controller: any): void;
2416
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockOrchestratorService, never>;
2417
+ static ɵprov: i0.ɵɵInjectableDeclaration<MockOrchestratorService>;
2418
+ }
2419
+
2334
2420
  declare class AuthGuard implements CanActivate, IConsoleLoggable {
2335
2421
  static readonly className: string;
2336
2422
  private routingUtility;
@@ -2359,6 +2445,13 @@ declare class CacheInterceptor implements HttpInterceptor, IConsoleLoggable {
2359
2445
  static ɵprov: i0.ɵɵInjectableDeclaration<CacheInterceptor>;
2360
2446
  }
2361
2447
 
2448
+ declare class MockHttpInterceptor implements HttpInterceptor {
2449
+ private orchestratorService;
2450
+ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
2451
+ static ɵfac: i0.ɵɵFactoryDeclaration<MockHttpInterceptor, never>;
2452
+ static ɵprov: i0.ɵɵInjectableDeclaration<MockHttpInterceptor>;
2453
+ }
2454
+
2362
2455
  declare class TranslatePipe implements PipeTransform, OnDestroy {
2363
2456
  private translateUtility;
2364
2457
  private changeDetectorRef;
@@ -2568,5 +2661,5 @@ declare class AsorWidgetComponent {
2568
2661
  static ɵcmp: i0.ɵɵComponentDeclaration<AsorWidgetComponent, "asor-core-widget", never, { "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
2569
2662
  }
2570
2663
 
2571
- export { GlobalEnum_d as AsorGlobalEnum, StateConstants_d as AsorStorage, AsorWidgetComponent, AuthGuard, AuthUtility, BaseComponent, BaseHandlerMixin, BaseMolecule, BaseStorageComponent, BaseStorageMolecule, CacheInterceptor, CachePathUtility, CacheUtility, CollectionUtils, ConfigCache, ConfigConst, ConsoleLogsConfig, ConsoleLogsUtility, CookieUtils, ErrorInterceptor, HttpRequestHandler, NotifyErrorService, ObjectUtils, RandomUtils, RoutingUtility, StateConst, StateService, StringUtils, TranslatePipe, TranslateUtility, createFlattenedReactiveProxy };
2572
- export type { AsorWidgetMode, Constructor, CreateDataSetOption, DataElement, DataMethod, EncryptType, GenerateType, IAsorRoute, IAuth, IComp, ICompStatic, IComponent, IConnectDataSet, IConsoleLoggable, ICreateDataSet, IHttpAuthSubscribe, IHttpFormError, IHttpRequest, IHttpRequestHandlerConfig, IHttpResponseError, IHttpSubscribe, IMolecule, IPath, IStorageHandler, LogClassConfig, LogEntry, LogLevel, RegistryElement, RegistryEntry, StateHandlerConfig, StoreType, UpdateDataSetOption };
2664
+ export { GlobalEnum_d as AsorGlobalEnum, StateConstants_d as AsorStorage, AsorWidgetComponent, AuthGuard, AuthUtility, BaseComponent, BaseHandlerMixin, BaseMolecule, BaseStorageComponent, BaseStorageMolecule, CacheInterceptor, CachePathUtility, CacheUtility, CollectionUtils, ConfigCache, ConfigConst, ConsoleLogsConfig, ConsoleLogsUtility, CookieUtils, ErrorInterceptor, HttpRequestHandler, MockHttpInterceptor, MockOrchestratorService, NotifyErrorService, ObjectUtils, RandomUtils, RoutingUtility, StateConst, StateService, StringUtils, TranslatePipe, TranslateUtility, createFlattenedReactiveProxy };
2665
+ export type { AsorWidgetMode, Constructor, CreateDataSetOption, DataElement, DataMethod, EncryptType, GenerateType, IAsorRoute, IAuth, IBaseMolecule, IComp, ICompStatic, IComponent, IConnectDataSet, IConsoleLoggable, ICreateDataSet, IHttpAuthSubscribe, IHttpFormError, IHttpRequest, IHttpRequestHandlerConfig, IHttpResponseError, IHttpSubscribe, IMolecule, IPath, IRequestMapping, IStorageHandler, LogClassConfig, LogEntry, LogLevel, RegistryElement, RegistryEntry, StateHandlerConfig, StoreType, UpdateDataSetOption };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asor-studio/asor-core",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0 || ^21.0.0",
6
6
  "@angular/core": "^20.3.0 || ^21.0.0",