@bymax-one/nest-core 1.0.0 → 1.1.0

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.
@@ -1,3 +1,35 @@
1
+ import { CustomDecorator } from '@nestjs/common';
2
+
3
+ /**
4
+ * Reflect metadata key carrying the discoverable marker. Namespaced so it cannot
5
+ * collide with a consumer's own metadata, and exported so a test — or a sibling
6
+ * library's own conformance suite — can assert a class is marked without
7
+ * depending on how the decorator is implemented.
8
+ */
9
+ declare const BYMAX_HEALTH_INDICATOR_METADATA = "bymax-one:health-indicator";
10
+ /**
11
+ * Mark a provider class as a readiness indicator, so `BymaxCoreModule` discovers
12
+ * it without the application registering it by hand.
13
+ *
14
+ * The class must implement `IHealthIndicator`; a marked provider that does not
15
+ * fails at bootstrap with a message naming it, rather than being skipped
16
+ * silently. Discovery has to be enabled (`health.autoDiscover`) for the marker to
17
+ * be read at all — marking a class in an application that never enables it costs
18
+ * one metadata entry and changes nothing.
19
+ *
20
+ * @returns The class decorator carrying the marker.
21
+ * @example
22
+ * \@BymaxHealthIndicator()
23
+ * \@Injectable()
24
+ * export class RedisHealthIndicator implements IHealthIndicator {
25
+ * readonly name = 'redis'
26
+ * async check(): Promise<HealthIndicatorResult> {
27
+ * return { status: 'up' }
28
+ * }
29
+ * }
30
+ */
31
+ declare function BymaxHealthIndicator(): CustomDecorator<string>;
32
+
1
33
  /**
2
34
  * @fileoverview Health-check contracts. Consumers implement
3
35
  * {@link IHealthIndicator} against a client they already own (a cache, a
@@ -61,4 +93,4 @@ interface HealthResponse {
61
93
  checks: HealthCheckEntry[];
62
94
  }
63
95
 
64
- export type { HealthCheckEntry, HealthIndicatorResult, HealthResponse, IHealthIndicator };
96
+ export { BYMAX_HEALTH_INDICATOR_METADATA, BymaxHealthIndicator, type HealthCheckEntry, type HealthIndicatorResult, type HealthResponse, type IHealthIndicator };
@@ -1,3 +1,35 @@
1
+ import { CustomDecorator } from '@nestjs/common';
2
+
3
+ /**
4
+ * Reflect metadata key carrying the discoverable marker. Namespaced so it cannot
5
+ * collide with a consumer's own metadata, and exported so a test — or a sibling
6
+ * library's own conformance suite — can assert a class is marked without
7
+ * depending on how the decorator is implemented.
8
+ */
9
+ declare const BYMAX_HEALTH_INDICATOR_METADATA = "bymax-one:health-indicator";
10
+ /**
11
+ * Mark a provider class as a readiness indicator, so `BymaxCoreModule` discovers
12
+ * it without the application registering it by hand.
13
+ *
14
+ * The class must implement `IHealthIndicator`; a marked provider that does not
15
+ * fails at bootstrap with a message naming it, rather than being skipped
16
+ * silently. Discovery has to be enabled (`health.autoDiscover`) for the marker to
17
+ * be read at all — marking a class in an application that never enables it costs
18
+ * one metadata entry and changes nothing.
19
+ *
20
+ * @returns The class decorator carrying the marker.
21
+ * @example
22
+ * \@BymaxHealthIndicator()
23
+ * \@Injectable()
24
+ * export class RedisHealthIndicator implements IHealthIndicator {
25
+ * readonly name = 'redis'
26
+ * async check(): Promise<HealthIndicatorResult> {
27
+ * return { status: 'up' }
28
+ * }
29
+ * }
30
+ */
31
+ declare function BymaxHealthIndicator(): CustomDecorator<string>;
32
+
1
33
  /**
2
34
  * @fileoverview Health-check contracts. Consumers implement
3
35
  * {@link IHealthIndicator} against a client they already own (a cache, a
@@ -61,4 +93,4 @@ interface HealthResponse {
61
93
  checks: HealthCheckEntry[];
62
94
  }
63
95
 
64
- export type { HealthCheckEntry, HealthIndicatorResult, HealthResponse, IHealthIndicator };
96
+ export { BYMAX_HEALTH_INDICATOR_METADATA, BymaxHealthIndicator, type HealthCheckEntry, type HealthIndicatorResult, type HealthResponse, type IHealthIndicator };
@@ -1 +1,9 @@
1
+ import { SetMetadata } from '@nestjs/common';
1
2
 
3
+ // src/health/health.marker.ts
4
+ var BYMAX_HEALTH_INDICATOR_METADATA = "bymax-one:health-indicator";
5
+ function BymaxHealthIndicator() {
6
+ return SetMetadata(BYMAX_HEALTH_INDICATOR_METADATA, true);
7
+ }
8
+
9
+ export { BYMAX_HEALTH_INDICATOR_METADATA, BymaxHealthIndicator };