angular-toolbox 0.9.1 → 0.9.3

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.
Files changed (30) hide show
  1. package/README.md +2 -2
  2. package/esm2022/lib/core/abstract/abstract-subscription-manager.mjs +113 -0
  3. package/esm2022/lib/core/abstract/abstract-version-manager.mjs +37 -0
  4. package/esm2022/lib/core/abstract/index.mjs +3 -0
  5. package/esm2022/lib/core/impl/lang/identifiable-component.mjs +18 -2
  6. package/esm2022/lib/core/index.mjs +2 -1
  7. package/esm2022/lib/model/business/index.mjs +2 -1
  8. package/esm2022/lib/model/business/lang/identifiable.mjs +1 -1
  9. package/esm2022/lib/model/business/subscription/index.mjs +2 -0
  10. package/esm2022/lib/model/business/subscription/subscription-manager.mjs +9 -0
  11. package/esm2022/lib/model/business/version/index.mjs +2 -1
  12. package/esm2022/lib/model/business/version/version-manager.mjs +10 -0
  13. package/esm2022/lib/model/service/subscription/subscription.service.mjs +6 -98
  14. package/esm2022/lib/model/service/version/version.service.mjs +4 -20
  15. package/fesm2022/angular-toolbox.mjs +221 -149
  16. package/fesm2022/angular-toolbox.mjs.map +1 -1
  17. package/lib/core/abstract/abstract-subscription-manager.d.ts +73 -0
  18. package/lib/core/abstract/abstract-version-manager.d.ts +34 -0
  19. package/lib/core/abstract/index.d.ts +2 -0
  20. package/lib/core/impl/lang/identifiable-component.d.ts +18 -0
  21. package/lib/core/index.d.ts +1 -0
  22. package/lib/model/business/index.d.ts +1 -0
  23. package/lib/model/business/lang/identifiable.d.ts +7 -0
  24. package/lib/model/business/subscription/index.d.ts +1 -0
  25. package/lib/model/business/subscription/subscription-manager.d.ts +52 -0
  26. package/lib/model/business/version/index.d.ts +1 -0
  27. package/lib/model/business/version/version-manager.d.ts +25 -0
  28. package/lib/model/service/subscription/subscription.service.d.ts +3 -59
  29. package/lib/model/service/version/version.service.d.ts +3 -18
  30. package/package.json +1 -1
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ import { Subscription } from 'rxjs';
9
+ import { Identifiable, SubscriptionManager } from '../../model';
10
+ /**
11
+ * The abstract class for all services that implement the `SubscriptionManager` interface.
12
+ */
13
+ export declare abstract class AbstractSubscriptionManager implements SubscriptionManager {
14
+ /**
15
+ * @private
16
+ * Stores an internal reference to the last reference used with the `register()`
17
+ * method.
18
+ */
19
+ private _lastRef;
20
+ /**
21
+ * @private
22
+ * The internal `Subscription` instances storage.
23
+ */
24
+ private _subMap;
25
+ /**
26
+ * Stores a new `Subscription` instance associated with the specified reference.
27
+ *
28
+ * @param ref The reference for which to store a new `Subscription` instance.
29
+ * Can be either a string or an `Identifiable` object.
30
+ * @param subscription The `Subscription` instance to register.
31
+ *
32
+ * @returns A reference to this `SubscriptionService` instance.
33
+ */
34
+ register(ref: string | Identifiable, subscription: Subscription): SubscriptionManager;
35
+ /**
36
+ * Stores a new `Subscription` instance associated with the reference specified
37
+ * by the last `register()` method invokation.
38
+ *
39
+ * @param subscription The `Subscription` instance to register.
40
+ *
41
+ * @returns A reference to this `SubscriptionService` instance.
42
+ */
43
+ append(subscription: Subscription): SubscriptionManager;
44
+ /**
45
+ * Unsubscribes and removes all `Subscription` instances associated with the specified reference.
46
+ *
47
+ * @param ref The reference for which to remove all `Subscription` instances.
48
+ * Can be either a string or an `Identifiable` object.
49
+ *
50
+ * @returns `true` whether the specified reference exists; `false` otherwise.
51
+ */
52
+ clearAll(ref: string | Identifiable): boolean;
53
+ /**
54
+ * Returns all `Subscription` instances associated with the specified reference.
55
+ *
56
+ * @param ref The reference for which to remove get `Subscription` instances.
57
+ * Can be either a string or an `Identifiable` object.
58
+ *
59
+ * @returns All `Subscription` instances associated with the specified reference, or
60
+ * `null` whether the specified reference does not exists.
61
+ */
62
+ get(ref: string | Identifiable): Array<Subscription> | null;
63
+ /**
64
+ * @private
65
+ * Returns the string reference for the regsitration process.
66
+ *
67
+ * @param ref The reference to be used the regsitration process.
68
+ * Can be either a string or an `Identifiable` object.
69
+ *
70
+ * @returns the string reference for the regsitration process.
71
+ */
72
+ private getRef;
73
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ import { Version, VersionConfig, VersionManager } from "../../model";
9
+ /**
10
+ * The abstract class for all services that implement the `VersionManager` interface.
11
+ */
12
+ export declare abstract class AbstractVersionManager implements VersionManager {
13
+ /**
14
+ * @private
15
+ */
16
+ private readonly _version;
17
+ /**
18
+ * Creates a new VersionManager object.
19
+ * @param config the reference to the VersionConfig provider.
20
+ */
21
+ constructor(config: VersionConfig);
22
+ /**
23
+ * Returns the version of the associated Angular project.
24
+ *
25
+ * @return the version of the associated Angular project.
26
+ */
27
+ getVersion(): Version;
28
+ /**
29
+ * Returns the build timestamp of the associated Angular project.
30
+ *
31
+ * @return the build timestamp of the associated Angular project.
32
+ */
33
+ getBuildTimestamp(): number;
34
+ }
@@ -0,0 +1,2 @@
1
+ export * from './abstract-subscription-manager';
2
+ export * from './abstract-version-manager';
@@ -13,14 +13,32 @@ import { Uuid } from "../../../util";
13
13
  * Angular Toolbox Subscription Service.
14
14
  */
15
15
  export declare class IdentifiableComponent implements Identifiable {
16
+ /**
17
+ * @private
18
+ */
19
+ private readonly _classRef;
16
20
  /**
17
21
  * @private
18
22
  */
19
23
  private readonly _uuid;
24
+ /**
25
+ * A string that represent the class reference for this object.
26
+ * This can be useful to workaround TypeScript compilation obfuscation.
27
+ *
28
+ * @param classRef The class reference for this object.
29
+ */
30
+ constructor(classRef?: string | undefined);
20
31
  /**
21
32
  * Returns the unique identifier for this object.
22
33
  *
23
34
  * @returns An instance of the `Uuid` class.
24
35
  */
25
36
  getID(): Uuid;
37
+ /**
38
+ * Returns the class name reference of this object. Can be either the `classRef`
39
+ * paramter of the contructor method, or the constructor `name` property value.
40
+ *
41
+ * @returns the class name reference of this object.
42
+ */
43
+ getClassRef(): string;
26
44
  }
@@ -1,2 +1,3 @@
1
1
  export * from './error';
2
2
  export * from './impl';
3
+ export * from './abstract';
@@ -2,3 +2,4 @@ export * from './version';
2
2
  export * from './ui';
3
3
  export * from './lang';
4
4
  export * from './mock/http';
5
+ export * from './subscription';
@@ -16,4 +16,11 @@ export interface Identifiable {
16
16
  * @returns An instance of the `Uuid` class.
17
17
  */
18
18
  getID(): Uuid;
19
+ /**
20
+ * Returns the class name reference of this object.
21
+ * This can be useful to workaround TypeScript compilation obfuscation.
22
+ *
23
+ * @returns the class name reference of this object.
24
+ */
25
+ getClassRef(): string;
19
26
  }
@@ -0,0 +1 @@
1
+ export * from './subscription-manager';
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ import { Subscription } from 'rxjs';
9
+ import { Identifiable } from '../lang';
10
+ /**
11
+ * Defines the API to implement to create Angular subscription management objects.
12
+ */
13
+ export interface SubscriptionManager {
14
+ /**
15
+ * Stores a new `Subscription` instance associated with the specified reference.
16
+ *
17
+ * @param ref The reference for which to store a new `Subscription` instance.
18
+ * Can be either a string or an `Identifiable` object.
19
+ * @param subscription The `Subscription` instance to register.
20
+ *
21
+ * @returns A reference to this `SubscriptionManager` object.
22
+ */
23
+ register(ref: string | Identifiable, subscription: Subscription): SubscriptionManager;
24
+ /**
25
+ * Stores a new `Subscription` instance associated with the reference specified
26
+ * by the last `register()` method invokation.
27
+ *
28
+ * @param subscription The `Subscription` instance to register.
29
+ *
30
+ * @returns A reference to this `SubscriptionManager` object.
31
+ */
32
+ append(subscription: Subscription): SubscriptionManager;
33
+ /**
34
+ * Unsubscribes and removes all `Subscription` instances associated with the specified reference.
35
+ *
36
+ * @param ref The reference for which to remove all `Subscription` instances.
37
+ * Can be either a string or an `Identifiable` object.
38
+ *
39
+ * @returns `true` whether the specified reference exists; `false` otherwise.
40
+ */
41
+ clearAll(ref: string | Identifiable): boolean;
42
+ /**
43
+ * Returns all `Subscription` instances associated with the specified reference.
44
+ *
45
+ * @param ref The reference for which to remove get `Subscription` instances.
46
+ * Can be either a string or an `Identifiable` object.
47
+ *
48
+ * @returns All `Subscription` instances associated with the specified reference, or
49
+ * `null` whether the specified reference does not exists.
50
+ */
51
+ get(ref: string | Identifiable): Array<Subscription> | null;
52
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './version';
2
2
  export * from './version-config';
3
3
  export * from './version-config.provider';
4
+ export * from './version-manager';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright Pascal ECHEMANN. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be found in
6
+ * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
+ */
8
+ import { Version } from "./version";
9
+ /**
10
+ * The interface implemented by services that specifie the semantic versioning of an Angular application.
11
+ */
12
+ export interface VersionManager {
13
+ /**
14
+ * Returns the version of the associated Angular project.
15
+ *
16
+ * @return the version of the associated Angular project.
17
+ */
18
+ getVersion(): Version;
19
+ /**
20
+ * Returns the build timestamp of the associated Angular project.
21
+ *
22
+ * @return the build timestamp of the associated Angular project.
23
+ */
24
+ getBuildTimestamp(): number;
25
+ }
@@ -1,66 +1,10 @@
1
- import { Subscription } from 'rxjs';
2
- import { Identifiable } from '../../business';
1
+ import { AbstractSubscriptionManager } from '../../../core';
3
2
  import * as i0 from "@angular/core";
4
- export declare class SubscriptionService {
3
+ export declare class SubscriptionService extends AbstractSubscriptionManager {
5
4
  /**
6
5
  * @private
7
- * Stores an internal reference to the last reference used with the `register()`
8
- * method.
9
6
  */
10
- private _lastRef;
11
- /**
12
- * @private
13
- * The internal `Subscription` instances storage.
14
- */
15
- private _subMap;
16
- /**
17
- * Stores a new `Subscription` instance associated with the specified reference.
18
- *
19
- * @param ref The reference for which to store a new `Subscription` instance.
20
- * Can be either a string or an `Identifiable` object.
21
- * @param subscription The `Subscription` instance to register.
22
- *
23
- * @returns A reference to this `SubscriptionService` instance.
24
- */
25
- register(ref: string | Identifiable, subscription: Subscription): SubscriptionService;
26
- /**
27
- * Stores a new `Subscription` instance associated with the reference specified
28
- * by the last `register()` method invokation.
29
- *
30
- * @param subscription The `Subscription` instance to register.
31
- *
32
- * @returns A reference to this `SubscriptionService` instance.
33
- */
34
- append(subscription: Subscription): SubscriptionService;
35
- /**
36
- * Unsubscribes and removes all `Subscription` instances associated with the specified reference.
37
- *
38
- * @param ref The reference for which to remove all `Subscription` instances.
39
- * Can be either a string or an `Identifiable` object.
40
- *
41
- * @returns `true` whether the specified reference exists; `false` otherwise.
42
- */
43
- clearAll(ref: string | Identifiable): boolean;
44
- /**
45
- * Returns all `Subscription` instances associated with the specified reference.
46
- *
47
- * @param ref The reference for which to remove get `Subscription` instances.
48
- * Can be either a string or an `Identifiable` object.
49
- *
50
- * @returns All `Subscription` instances associated with the specified reference, or
51
- * `null` whether the specified reference does not exists.
52
- */
53
- get(ref: string | Identifiable): Array<Subscription> | null;
54
- /**
55
- * @private
56
- * Returns the string reference for the regsitration process.
57
- *
58
- * @param ref The reference to be used the regsitration process.
59
- * Can be either a string or an `Identifiable` object.
60
- *
61
- * @returns the string reference for the regsitration process.
62
- */
63
- private getRef;
7
+ constructor();
64
8
  static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionService, never>;
65
9
  static ɵprov: i0.ɵɵInjectableDeclaration<SubscriptionService>;
66
10
  }
@@ -1,30 +1,15 @@
1
- import { Version, VersionConfig } from '../../business';
1
+ import { VersionConfig, VersionManager } from '../../business';
2
+ import { AbstractVersionManager } from '../../../core';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
5
  * A lightweight service that provides Semantic Versioning implementation for your Angular projects.
5
6
  */
6
- export declare class VersionService {
7
- /**
8
- * @private
9
- */
10
- private readonly _version;
7
+ export declare class VersionService extends AbstractVersionManager implements VersionManager {
11
8
  /**
12
9
  * Creates a new VersionService instance.
13
10
  * @param config the reference to the VersionConfig provider.
14
11
  */
15
12
  constructor(config: VersionConfig);
16
- /**
17
- * Returns the version of the associated Angular project.
18
- *
19
- * @return the version of the associated Angular project.
20
- */
21
- getVersion(): Version;
22
- /**
23
- * Returns the build timestamp of the associated Angular project.
24
- *
25
- * @return the build timestamp of the associated Angular project.
26
- */
27
- getBuildTimestamp(): number;
28
13
  static ɵfac: i0.ɵɵFactoryDeclaration<VersionService, never>;
29
14
  static ɵprov: i0.ɵɵInjectableDeclaration<VersionService>;
30
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-toolbox",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^18.0.0",