@dyanet/nestjs-config-aws 1.0.1
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/LICENSE +21 -0
- package/README.md +1183 -0
- package/dist/cjs/config.module.js +178 -0
- package/dist/cjs/config.module.js.map +1 -0
- package/dist/cjs/index.js +47 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/integration/index.js +23 -0
- package/dist/cjs/integration/index.js.map +1 -0
- package/dist/cjs/integration/interfaces/configuration-factory.interface.js +3 -0
- package/dist/cjs/integration/interfaces/configuration-factory.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/configuration-source.interface.js +3 -0
- package/dist/cjs/integration/interfaces/configuration-source.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/index.js +26 -0
- package/dist/cjs/integration/interfaces/index.js.map +1 -0
- package/dist/cjs/integration/interfaces/integration-options.interface.js +3 -0
- package/dist/cjs/integration/interfaces/integration-options.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/integration-state.interface.js +3 -0
- package/dist/cjs/integration/interfaces/integration-state.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/nestjs-config-compatibility.interface.js +73 -0
- package/dist/cjs/integration/interfaces/nestjs-config-compatibility.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/nestjs-config-integration.interface.js +3 -0
- package/dist/cjs/integration/interfaces/nestjs-config-integration.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/typed-configuration.interface.js +4 -0
- package/dist/cjs/integration/interfaces/typed-configuration.interface.js.map +1 -0
- package/dist/cjs/integration/interfaces/utility-types.interface.js +52 -0
- package/dist/cjs/integration/interfaces/utility-types.interface.js.map +1 -0
- package/dist/cjs/integration/nestjs-config-integration.module.js +124 -0
- package/dist/cjs/integration/nestjs-config-integration.module.js.map +1 -0
- package/dist/cjs/integration/providers/aws-configuration-loader.service.js +591 -0
- package/dist/cjs/integration/providers/aws-configuration-loader.service.js.map +1 -0
- package/dist/cjs/integration/providers/configuration-factory.provider.js +383 -0
- package/dist/cjs/integration/providers/configuration-factory.provider.js.map +1 -0
- package/dist/cjs/integration/providers/index.js +20 -0
- package/dist/cjs/integration/providers/index.js.map +1 -0
- package/dist/cjs/integration/services/async-config-helper.service.js +356 -0
- package/dist/cjs/integration/services/async-config-helper.service.js.map +1 -0
- package/dist/cjs/integration/services/error-handler.service.js +265 -0
- package/dist/cjs/integration/services/error-handler.service.js.map +1 -0
- package/dist/cjs/integration/services/factory-registration.service.js +512 -0
- package/dist/cjs/integration/services/factory-registration.service.js.map +1 -0
- package/dist/cjs/integration/services/index.js +26 -0
- package/dist/cjs/integration/services/index.js.map +1 -0
- package/dist/cjs/integration/services/integration-state.service.js +83 -0
- package/dist/cjs/integration/services/integration-state.service.js.map +1 -0
- package/dist/cjs/integration/services/namespace-handler.service.js +467 -0
- package/dist/cjs/integration/services/namespace-handler.service.js.map +1 -0
- package/dist/cjs/integration/services/nestjs-config-integration.service.js +316 -0
- package/dist/cjs/integration/services/nestjs-config-integration.service.js.map +1 -0
- package/dist/cjs/integration/services/precedence-handler.service.js +294 -0
- package/dist/cjs/integration/services/precedence-handler.service.js.map +1 -0
- package/dist/cjs/integration/services/validation-integration.service.js +591 -0
- package/dist/cjs/integration/services/validation-integration.service.js.map +1 -0
- package/dist/cjs/integration/utils/config-integration.util.js +283 -0
- package/dist/cjs/integration/utils/config-integration.util.js.map +1 -0
- package/dist/cjs/integration/utils/index.js +19 -0
- package/dist/cjs/integration/utils/index.js.map +1 -0
- package/dist/cjs/interfaces/config-loader.interface.js +3 -0
- package/dist/cjs/interfaces/config-loader.interface.js.map +1 -0
- package/dist/cjs/interfaces/config-service.interface.js +11 -0
- package/dist/cjs/interfaces/config-service.interface.js.map +1 -0
- package/dist/cjs/interfaces/default-schema.interface.js +63 -0
- package/dist/cjs/interfaces/default-schema.interface.js.map +1 -0
- package/dist/cjs/interfaces/errors.interface.js +77 -0
- package/dist/cjs/interfaces/errors.interface.js.map +1 -0
- package/dist/cjs/interfaces/index.js +25 -0
- package/dist/cjs/interfaces/index.js.map +1 -0
- package/dist/cjs/interfaces/module-options.interface.js +3 -0
- package/dist/cjs/interfaces/module-options.interface.js.map +1 -0
- package/dist/cjs/loaders/environment.loader.js +59 -0
- package/dist/cjs/loaders/environment.loader.js.map +1 -0
- package/dist/cjs/loaders/secrets-manager.loader.js +122 -0
- package/dist/cjs/loaders/secrets-manager.loader.js.map +1 -0
- package/dist/cjs/loaders/ssm-parameter-store.loader.js +146 -0
- package/dist/cjs/loaders/ssm-parameter-store.loader.js.map +1 -0
- package/dist/cjs/services/config.service.js +297 -0
- package/dist/cjs/services/config.service.js.map +1 -0
- package/dist/cjs/utils/validation.util.js +114 -0
- package/dist/cjs/utils/validation.util.js.map +1 -0
- package/dist/esm/config.module.js +175 -0
- package/dist/esm/config.module.js.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/integration/index.js +7 -0
- package/dist/esm/integration/index.js.map +1 -0
- package/dist/esm/integration/interfaces/configuration-factory.interface.js +2 -0
- package/dist/esm/integration/interfaces/configuration-factory.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/configuration-source.interface.js +2 -0
- package/dist/esm/integration/interfaces/configuration-source.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/index.js +10 -0
- package/dist/esm/integration/interfaces/index.js.map +1 -0
- package/dist/esm/integration/interfaces/integration-options.interface.js +2 -0
- package/dist/esm/integration/interfaces/integration-options.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/integration-state.interface.js +2 -0
- package/dist/esm/integration/interfaces/integration-state.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/nestjs-config-compatibility.interface.js +64 -0
- package/dist/esm/integration/interfaces/nestjs-config-compatibility.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/nestjs-config-integration.interface.js +2 -0
- package/dist/esm/integration/interfaces/nestjs-config-integration.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/typed-configuration.interface.js +3 -0
- package/dist/esm/integration/interfaces/typed-configuration.interface.js.map +1 -0
- package/dist/esm/integration/interfaces/utility-types.interface.js +44 -0
- package/dist/esm/integration/interfaces/utility-types.interface.js.map +1 -0
- package/dist/esm/integration/nestjs-config-integration.module.js +121 -0
- package/dist/esm/integration/nestjs-config-integration.module.js.map +1 -0
- package/dist/esm/integration/providers/aws-configuration-loader.service.js +588 -0
- package/dist/esm/integration/providers/aws-configuration-loader.service.js.map +1 -0
- package/dist/esm/integration/providers/configuration-factory.provider.js +380 -0
- package/dist/esm/integration/providers/configuration-factory.provider.js.map +1 -0
- package/dist/esm/integration/providers/index.js +4 -0
- package/dist/esm/integration/providers/index.js.map +1 -0
- package/dist/esm/integration/services/async-config-helper.service.js +353 -0
- package/dist/esm/integration/services/async-config-helper.service.js.map +1 -0
- package/dist/esm/integration/services/error-handler.service.js +262 -0
- package/dist/esm/integration/services/error-handler.service.js.map +1 -0
- package/dist/esm/integration/services/factory-registration.service.js +509 -0
- package/dist/esm/integration/services/factory-registration.service.js.map +1 -0
- package/dist/esm/integration/services/index.js +10 -0
- package/dist/esm/integration/services/index.js.map +1 -0
- package/dist/esm/integration/services/integration-state.service.js +80 -0
- package/dist/esm/integration/services/integration-state.service.js.map +1 -0
- package/dist/esm/integration/services/namespace-handler.service.js +464 -0
- package/dist/esm/integration/services/namespace-handler.service.js.map +1 -0
- package/dist/esm/integration/services/nestjs-config-integration.service.js +313 -0
- package/dist/esm/integration/services/nestjs-config-integration.service.js.map +1 -0
- package/dist/esm/integration/services/precedence-handler.service.js +291 -0
- package/dist/esm/integration/services/precedence-handler.service.js.map +1 -0
- package/dist/esm/integration/services/validation-integration.service.js +585 -0
- package/dist/esm/integration/services/validation-integration.service.js.map +1 -0
- package/dist/esm/integration/utils/config-integration.util.js +240 -0
- package/dist/esm/integration/utils/config-integration.util.js.map +1 -0
- package/dist/esm/integration/utils/index.js +3 -0
- package/dist/esm/integration/utils/index.js.map +1 -0
- package/dist/esm/interfaces/config-loader.interface.js +2 -0
- package/dist/esm/interfaces/config-loader.interface.js.map +1 -0
- package/dist/esm/interfaces/config-service.interface.js +7 -0
- package/dist/esm/interfaces/config-service.interface.js.map +1 -0
- package/dist/esm/interfaces/default-schema.interface.js +59 -0
- package/dist/esm/interfaces/default-schema.interface.js.map +1 -0
- package/dist/esm/interfaces/errors.interface.js +69 -0
- package/dist/esm/interfaces/errors.interface.js.map +1 -0
- package/dist/esm/interfaces/index.js +9 -0
- package/dist/esm/interfaces/index.js.map +1 -0
- package/dist/esm/interfaces/module-options.interface.js +2 -0
- package/dist/esm/interfaces/module-options.interface.js.map +1 -0
- package/dist/esm/loaders/environment.loader.js +55 -0
- package/dist/esm/loaders/environment.loader.js.map +1 -0
- package/dist/esm/loaders/secrets-manager.loader.js +118 -0
- package/dist/esm/loaders/secrets-manager.loader.js.map +1 -0
- package/dist/esm/loaders/ssm-parameter-store.loader.js +142 -0
- package/dist/esm/loaders/ssm-parameter-store.loader.js.map +1 -0
- package/dist/esm/services/config.service.js +261 -0
- package/dist/esm/services/config.service.js.map +1 -0
- package/dist/esm/utils/validation.util.js +110 -0
- package/dist/esm/utils/validation.util.js.map +1 -0
- package/dist/types/config.module.d.ts +46 -0
- package/dist/types/config.module.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/integration/index.d.ts +6 -0
- package/dist/types/integration/index.d.ts.map +1 -0
- package/dist/types/integration/interfaces/configuration-factory.interface.d.ts +71 -0
- package/dist/types/integration/interfaces/configuration-factory.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/configuration-source.interface.d.ts +24 -0
- package/dist/types/integration/interfaces/configuration-source.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/index.d.ts +9 -0
- package/dist/types/integration/interfaces/index.d.ts.map +1 -0
- package/dist/types/integration/interfaces/integration-options.interface.d.ts +66 -0
- package/dist/types/integration/interfaces/integration-options.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/integration-state.interface.d.ts +17 -0
- package/dist/types/integration/interfaces/integration-state.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/nestjs-config-compatibility.interface.d.ts +332 -0
- package/dist/types/integration/interfaces/nestjs-config-compatibility.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/nestjs-config-integration.interface.d.ts +259 -0
- package/dist/types/integration/interfaces/nestjs-config-integration.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/typed-configuration.interface.d.ts +209 -0
- package/dist/types/integration/interfaces/typed-configuration.interface.d.ts.map +1 -0
- package/dist/types/integration/interfaces/utility-types.interface.d.ts +249 -0
- package/dist/types/integration/interfaces/utility-types.interface.d.ts.map +1 -0
- package/dist/types/integration/nestjs-config-integration.module.d.ts +36 -0
- package/dist/types/integration/nestjs-config-integration.module.d.ts.map +1 -0
- package/dist/types/integration/providers/aws-configuration-loader.service.d.ts +134 -0
- package/dist/types/integration/providers/aws-configuration-loader.service.d.ts.map +1 -0
- package/dist/types/integration/providers/configuration-factory.provider.d.ts +119 -0
- package/dist/types/integration/providers/configuration-factory.provider.d.ts.map +1 -0
- package/dist/types/integration/providers/index.d.ts +3 -0
- package/dist/types/integration/providers/index.d.ts.map +1 -0
- package/dist/types/integration/services/async-config-helper.service.d.ts +84 -0
- package/dist/types/integration/services/async-config-helper.service.d.ts.map +1 -0
- package/dist/types/integration/services/error-handler.service.d.ts +84 -0
- package/dist/types/integration/services/error-handler.service.d.ts.map +1 -0
- package/dist/types/integration/services/factory-registration.service.d.ts +158 -0
- package/dist/types/integration/services/factory-registration.service.d.ts.map +1 -0
- package/dist/types/integration/services/index.d.ts +9 -0
- package/dist/types/integration/services/index.d.ts.map +1 -0
- package/dist/types/integration/services/integration-state.service.d.ts +41 -0
- package/dist/types/integration/services/integration-state.service.d.ts.map +1 -0
- package/dist/types/integration/services/namespace-handler.service.d.ts +192 -0
- package/dist/types/integration/services/namespace-handler.service.d.ts.map +1 -0
- package/dist/types/integration/services/nestjs-config-integration.service.d.ts +87 -0
- package/dist/types/integration/services/nestjs-config-integration.service.d.ts.map +1 -0
- package/dist/types/integration/services/precedence-handler.service.d.ts +103 -0
- package/dist/types/integration/services/precedence-handler.service.d.ts.map +1 -0
- package/dist/types/integration/services/validation-integration.service.d.ts +222 -0
- package/dist/types/integration/services/validation-integration.service.d.ts.map +1 -0
- package/dist/types/integration/utils/config-integration.util.d.ts +81 -0
- package/dist/types/integration/utils/config-integration.util.d.ts.map +1 -0
- package/dist/types/integration/utils/index.d.ts +2 -0
- package/dist/types/integration/utils/index.d.ts.map +1 -0
- package/dist/types/interfaces/config-loader.interface.d.ts +22 -0
- package/dist/types/interfaces/config-loader.interface.d.ts.map +1 -0
- package/dist/types/interfaces/config-service.interface.d.ts +23 -0
- package/dist/types/interfaces/config-service.interface.d.ts.map +1 -0
- package/dist/types/interfaces/default-schema.interface.d.ts +195 -0
- package/dist/types/interfaces/default-schema.interface.d.ts.map +1 -0
- package/dist/types/interfaces/errors.interface.d.ts +38 -0
- package/dist/types/interfaces/errors.interface.d.ts.map +1 -0
- package/dist/types/interfaces/index.d.ts +6 -0
- package/dist/types/interfaces/index.d.ts.map +1 -0
- package/dist/types/interfaces/module-options.interface.d.ts +64 -0
- package/dist/types/interfaces/module-options.interface.d.ts.map +1 -0
- package/dist/types/loaders/environment.loader.d.ts +26 -0
- package/dist/types/loaders/environment.loader.d.ts.map +1 -0
- package/dist/types/loaders/secrets-manager.loader.d.ts +52 -0
- package/dist/types/loaders/secrets-manager.loader.d.ts.map +1 -0
- package/dist/types/loaders/ssm-parameter-store.loader.d.ts +68 -0
- package/dist/types/loaders/ssm-parameter-store.loader.d.ts.map +1 -0
- package/dist/types/services/config.service.d.ts +94 -0
- package/dist/types/services/config.service.d.ts.map +1 -0
- package/dist/types/utils/validation.util.d.ts +53 -0
- package/dist/types/utils/validation.util.d.ts.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ConfigFactory } from '@nestjs/config';
|
|
2
|
+
import { ConfigurationSource } from './configuration-source.interface';
|
|
3
|
+
import { PrecedenceRule } from './integration-options.interface';
|
|
4
|
+
/**
|
|
5
|
+
* Enhanced configuration factory that includes AWS integration metadata.
|
|
6
|
+
*/
|
|
7
|
+
export interface AwsConfigurationFactory extends ConfigFactory {
|
|
8
|
+
/** Optional namespace for the configuration */
|
|
9
|
+
namespace?: string;
|
|
10
|
+
/** Sources that contributed to this configuration */
|
|
11
|
+
sources: ConfigurationSource[];
|
|
12
|
+
/** Precedence rule applied to this configuration */
|
|
13
|
+
precedenceRule: PrecedenceRule;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Provider for creating configuration factories that @nestjs/config can consume.
|
|
17
|
+
*/
|
|
18
|
+
export interface ConfigurationFactoryProvider {
|
|
19
|
+
/**
|
|
20
|
+
* Create a configuration factory for a specific namespace.
|
|
21
|
+
* @param namespace - The namespace for the configuration
|
|
22
|
+
* @param config - The configuration data
|
|
23
|
+
* @returns A configuration factory
|
|
24
|
+
*/
|
|
25
|
+
createFactory(namespace: string, config: Record<string, any>): ConfigFactory;
|
|
26
|
+
/**
|
|
27
|
+
* Create multiple namespaced configuration factories.
|
|
28
|
+
* @param config - The configuration data organized by namespace
|
|
29
|
+
* @returns Array of configuration factories
|
|
30
|
+
*/
|
|
31
|
+
createNamespacedFactories(config: Record<string, any>): ConfigFactory[];
|
|
32
|
+
/**
|
|
33
|
+
* Merge AWS configuration with existing local configuration.
|
|
34
|
+
* @param awsConfig - Configuration loaded from AWS sources
|
|
35
|
+
* @param localConfig - Local configuration data
|
|
36
|
+
* @returns Merged configuration data
|
|
37
|
+
*/
|
|
38
|
+
mergeWithExisting(awsConfig: Record<string, any>, localConfig: Record<string, any>): Record<string, any>;
|
|
39
|
+
/**
|
|
40
|
+
* Create an enhanced AWS configuration factory with metadata.
|
|
41
|
+
* @param namespace - Optional namespace for the configuration
|
|
42
|
+
* @param config - The configuration data
|
|
43
|
+
* @param sources - Sources that contributed to this configuration
|
|
44
|
+
* @param precedenceRule - Precedence rule applied to this configuration
|
|
45
|
+
* @returns Enhanced AWS configuration factory
|
|
46
|
+
*/
|
|
47
|
+
createAwsConfigurationFactory(namespace: string | undefined, config: Record<string, any>, sources: ConfigurationSource[], precedenceRule: PrecedenceRule): AwsConfigurationFactory;
|
|
48
|
+
/**
|
|
49
|
+
* Create configuration factories from multiple sources with proper organization.
|
|
50
|
+
* @param sourceConfigs - Map of source name to configuration data
|
|
51
|
+
* @param namespaces - Optional list of namespaces to organize configuration
|
|
52
|
+
* @returns Array of configuration factories organized by namespace
|
|
53
|
+
*/
|
|
54
|
+
createFactoriesFromSources(sourceConfigs: Map<string, Record<string, any>>, namespaces?: string[]): ConfigFactory[];
|
|
55
|
+
/**
|
|
56
|
+
* Create configuration factories from sources with precedence rules.
|
|
57
|
+
* @param sources - Array of configuration sources
|
|
58
|
+
* @param precedenceRule - Precedence rule to apply
|
|
59
|
+
* @param namespaces - Optional list of namespaces to organize configuration
|
|
60
|
+
* @returns Array of configuration factories
|
|
61
|
+
*/
|
|
62
|
+
createFactoriesWithPrecedence(sources: ConfigurationSource[], precedenceRule: PrecedenceRule, namespaces?: string[]): ConfigFactory[];
|
|
63
|
+
/**
|
|
64
|
+
* Merge configuration with explicit precedence rule.
|
|
65
|
+
* @param sources - Configuration sources
|
|
66
|
+
* @param precedenceRule - Precedence rule to apply
|
|
67
|
+
* @returns Merged configuration data
|
|
68
|
+
*/
|
|
69
|
+
mergeWithPrecedence(sources: ConfigurationSource[], precedenceRule: PrecedenceRule): Record<string, any>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=configuration-factory.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-factory.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/configuration-factory.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC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,EAAE,cAAc,EAC9B,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,aAAa,EAAE,CAAC;IAEnB;;;;;OAKG;IACH,mBAAmB,CACjB,OAAO,EAAE,mBAAmB,EAAE,EAC9B,cAAc,EAAE,cAAc,GAC7B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACxB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of configuration sources supported by the integration.
|
|
3
|
+
*/
|
|
4
|
+
export type ConfigurationSourceType = 'environment' | 'secrets-manager' | 'ssm' | 'local-file';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a configuration source with metadata about its origin and state.
|
|
7
|
+
*/
|
|
8
|
+
export interface ConfigurationSource {
|
|
9
|
+
/** Human-readable name of the configuration source */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Type of the configuration source */
|
|
12
|
+
type: ConfigurationSourceType;
|
|
13
|
+
/** Priority of this source (higher numbers have higher priority) */
|
|
14
|
+
priority: number;
|
|
15
|
+
/** The configuration data from this source */
|
|
16
|
+
data: Record<string, any>;
|
|
17
|
+
/** Optional namespace for this configuration */
|
|
18
|
+
namespace?: string;
|
|
19
|
+
/** Timestamp when this configuration was loaded */
|
|
20
|
+
loadedAt: Date;
|
|
21
|
+
/** Any errors encountered while loading this source */
|
|
22
|
+
errors?: string[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=configuration-source.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-source.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/configuration-source.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,iBAAiB,GAAG,KAAK,GAAG,YAAY,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,QAAQ,EAAE,IAAI,CAAC;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './integration-options.interface';
|
|
2
|
+
export * from './configuration-factory.interface';
|
|
3
|
+
export * from './configuration-source.interface';
|
|
4
|
+
export * from './integration-state.interface';
|
|
5
|
+
export * from './typed-configuration.interface';
|
|
6
|
+
export * from './nestjs-config-integration.interface';
|
|
7
|
+
export * from './nestjs-config-compatibility.interface';
|
|
8
|
+
export * from './utility-types.interface';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/index.ts"],"names":[],"mappings":"AACA,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SecretsManagerConfig, SSMConfig } from '../../interfaces/module-options.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Precedence rules for configuration sources when the same key exists in multiple sources.
|
|
4
|
+
*/
|
|
5
|
+
export type PrecedenceRule = 'aws-first' | 'local-first' | 'merge';
|
|
6
|
+
/**
|
|
7
|
+
* Error handling strategy for various failure scenarios.
|
|
8
|
+
*/
|
|
9
|
+
export interface ErrorHandlingStrategy {
|
|
10
|
+
/** How to handle AWS service unavailability */
|
|
11
|
+
onAwsUnavailable: 'fail' | 'warn' | 'silent';
|
|
12
|
+
/** How to handle configuration errors */
|
|
13
|
+
onConfigurationError: 'fail' | 'warn' | 'use-default';
|
|
14
|
+
/** How to handle validation errors */
|
|
15
|
+
onValidationError: 'fail' | 'warn' | 'skip-invalid';
|
|
16
|
+
/** Whether to enable detailed logging */
|
|
17
|
+
enableDetailedLogging: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Factory options for @nestjs/config compatibility.
|
|
21
|
+
*/
|
|
22
|
+
export interface FactoryOptions {
|
|
23
|
+
/** Whether to cache configuration values */
|
|
24
|
+
cache?: boolean;
|
|
25
|
+
/** Whether to expand variables in configuration values */
|
|
26
|
+
expandVariables?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Configuration options for the NestJS Config AWS Integration module.
|
|
30
|
+
*/
|
|
31
|
+
export interface IntegrationOptions {
|
|
32
|
+
/** Configuration for AWS Secrets Manager integration */
|
|
33
|
+
secretsManagerConfig?: SecretsManagerConfig;
|
|
34
|
+
/** Configuration for AWS Systems Manager Parameter Store integration */
|
|
35
|
+
ssmConfig?: SSMConfig;
|
|
36
|
+
/** Precedence rule for configuration sources */
|
|
37
|
+
precedence?: PrecedenceRule;
|
|
38
|
+
/** Namespaces to load configuration for */
|
|
39
|
+
namespaces?: string[];
|
|
40
|
+
/** Whether to enable logging */
|
|
41
|
+
enableLogging?: boolean;
|
|
42
|
+
/** Whether to register the module globally */
|
|
43
|
+
registerGlobally?: boolean;
|
|
44
|
+
/** Factory options for @nestjs/config compatibility */
|
|
45
|
+
factoryOptions?: FactoryOptions;
|
|
46
|
+
/** Whether to fail on AWS errors */
|
|
47
|
+
failOnAwsError?: boolean;
|
|
48
|
+
/** Whether to fallback to local configuration on AWS errors */
|
|
49
|
+
fallbackToLocal?: boolean;
|
|
50
|
+
/** Error handling strategy */
|
|
51
|
+
errorHandling?: ErrorHandlingStrategy;
|
|
52
|
+
/** Prefix for environment variables (e.g., 'APP_') */
|
|
53
|
+
envPrefix?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Async factory options for dynamic integration module configuration.
|
|
57
|
+
*/
|
|
58
|
+
export interface AsyncIntegrationOptions {
|
|
59
|
+
/** Factory function to create integration options */
|
|
60
|
+
useFactory: (...args: any[]) => Promise<IntegrationOptions> | IntegrationOptions;
|
|
61
|
+
/** Dependencies to inject into the factory function */
|
|
62
|
+
inject?: any[];
|
|
63
|
+
/** Imports required for the factory function */
|
|
64
|
+
imports?: any[];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=integration-options.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/integration-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,aAAa,GAAG,OAAO,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,gBAAgB,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC7C,yCAAyC;IACzC,oBAAoB,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;IACtD,sCAAsC;IACtC,iBAAiB,EAAE,MAAM,GAAG,MAAM,GAAG,cAAc,CAAC;IACpD,yCAAyC;IACzC,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAEjC,wDAAwD;IACxD,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS,CAAC;IAGtB,gDAAgD;IAChD,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,gCAAgC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uDAAuD;IACvD,cAAc,CAAC,EAAE,cAAc,CAAC;IAGhC,oCAAoC;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8BAA8B;IAC9B,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAEtC,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IAEjF,uDAAuD;IACvD,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IAEf,gDAAgD;IAChD,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConfigurationSource } from './configuration-source.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the current state of the integration module.
|
|
4
|
+
*/
|
|
5
|
+
export interface IntegrationState {
|
|
6
|
+
/** Whether the integration has been initialized */
|
|
7
|
+
isInitialized: boolean;
|
|
8
|
+
/** Whether AWS services are available */
|
|
9
|
+
awsAvailable: boolean;
|
|
10
|
+
/** List of configuration sources that have been loaded */
|
|
11
|
+
loadedSources: ConfigurationSource[];
|
|
12
|
+
/** List of factory names that have been registered with @nestjs/config */
|
|
13
|
+
registeredFactories: string[];
|
|
14
|
+
/** Any errors encountered during initialization or operation */
|
|
15
|
+
errors: string[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=integration-state.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-state.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/integration-state.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,aAAa,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,YAAY,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,0EAA0E;IAC1E,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,gEAAgE;IAChE,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { Type } from '@nestjs/common';
|
|
3
|
+
/**
|
|
4
|
+
* Enhanced ConfigService that provides AWS integration capabilities.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnhancedConfigService extends ConfigService {
|
|
7
|
+
/**
|
|
8
|
+
* Get configuration value with AWS source information.
|
|
9
|
+
* @param propertyPath - Configuration property path
|
|
10
|
+
* @param defaultValue - Default value if property is not found
|
|
11
|
+
* @returns Configuration value with source metadata
|
|
12
|
+
*/
|
|
13
|
+
getWithSource<T = any>(propertyPath: string, defaultValue?: T): ConfigValueWithSource<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Get configuration value from AWS sources only.
|
|
16
|
+
* @param propertyPath - Configuration property path
|
|
17
|
+
* @param defaultValue - Default value if property is not found
|
|
18
|
+
* @returns Configuration value from AWS sources
|
|
19
|
+
*/
|
|
20
|
+
getFromAws<T = any>(propertyPath: string, defaultValue?: T): T | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Get configuration value from local sources only.
|
|
23
|
+
* @param propertyPath - Configuration property path
|
|
24
|
+
* @param defaultValue - Default value if property is not found
|
|
25
|
+
* @returns Configuration value from local sources
|
|
26
|
+
*/
|
|
27
|
+
getFromLocal<T = any>(propertyPath: string, defaultValue?: T): T | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Check if a configuration value comes from AWS sources.
|
|
30
|
+
* @param propertyPath - Configuration property path
|
|
31
|
+
* @returns True if value comes from AWS, false otherwise
|
|
32
|
+
*/
|
|
33
|
+
isFromAws(propertyPath: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Get all configuration keys from AWS sources.
|
|
36
|
+
* @returns Array of configuration keys from AWS sources
|
|
37
|
+
*/
|
|
38
|
+
getAwsKeys(): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Get all configuration keys from local sources.
|
|
41
|
+
* @returns Array of configuration keys from local sources
|
|
42
|
+
*/
|
|
43
|
+
getLocalKeys(): string[];
|
|
44
|
+
/**
|
|
45
|
+
* Get configuration source information for a property.
|
|
46
|
+
* @param propertyPath - Configuration property path
|
|
47
|
+
* @returns Source information or undefined
|
|
48
|
+
*/
|
|
49
|
+
getSourceInfo(propertyPath: string): ConfigSourceInfo | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Refresh AWS configuration values.
|
|
52
|
+
* @returns Promise that resolves when refresh is complete
|
|
53
|
+
*/
|
|
54
|
+
refreshAwsConfig(): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get configuration health status.
|
|
57
|
+
* @returns Configuration health information
|
|
58
|
+
*/
|
|
59
|
+
getHealthStatus(): ConfigHealthStatus;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Configuration value with source metadata.
|
|
63
|
+
*/
|
|
64
|
+
export interface ConfigValueWithSource<T = any> {
|
|
65
|
+
/** The configuration value */
|
|
66
|
+
value: T;
|
|
67
|
+
/** Source information */
|
|
68
|
+
source: ConfigSourceInfo;
|
|
69
|
+
/** Whether the value was found */
|
|
70
|
+
found: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Configuration source information.
|
|
74
|
+
*/
|
|
75
|
+
export interface ConfigSourceInfo {
|
|
76
|
+
/** Source type */
|
|
77
|
+
type: 'environment' | 'secrets-manager' | 'ssm' | 'local-file';
|
|
78
|
+
/** Whether this is an AWS source */
|
|
79
|
+
isAws: boolean;
|
|
80
|
+
/** Source priority */
|
|
81
|
+
priority: number;
|
|
82
|
+
/** Namespace if applicable */
|
|
83
|
+
namespace?: string;
|
|
84
|
+
/** When the value was loaded */
|
|
85
|
+
loadedAt: Date;
|
|
86
|
+
/** Original key used to load the value */
|
|
87
|
+
originalKey?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Configuration health status.
|
|
91
|
+
*/
|
|
92
|
+
export interface ConfigHealthStatus {
|
|
93
|
+
/** Overall health status */
|
|
94
|
+
healthy: boolean;
|
|
95
|
+
/** AWS services availability */
|
|
96
|
+
awsAvailable: boolean;
|
|
97
|
+
/** Number of loaded configuration sources */
|
|
98
|
+
sourcesLoaded: number;
|
|
99
|
+
/** Number of failed sources */
|
|
100
|
+
sourcesFailed: number;
|
|
101
|
+
/** Last successful AWS load time */
|
|
102
|
+
lastAwsLoad?: Date;
|
|
103
|
+
/** Any health issues */
|
|
104
|
+
issues: string[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Decorator for injecting enhanced config service.
|
|
108
|
+
*/
|
|
109
|
+
export declare const InjectEnhancedConfig: () => ParameterDecorator;
|
|
110
|
+
/**
|
|
111
|
+
* Configuration property decorator for type-safe configuration access.
|
|
112
|
+
*/
|
|
113
|
+
export interface ConfigPropertyOptions {
|
|
114
|
+
/** Configuration key */
|
|
115
|
+
key: string;
|
|
116
|
+
/** Default value */
|
|
117
|
+
defaultValue?: any;
|
|
118
|
+
/** Whether to require the property */
|
|
119
|
+
required?: boolean;
|
|
120
|
+
/** Validation function */
|
|
121
|
+
validate?: (value: any) => boolean;
|
|
122
|
+
/** Transformation function */
|
|
123
|
+
transform?: (value: any) => any;
|
|
124
|
+
/** Whether to prefer AWS sources */
|
|
125
|
+
preferAws?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Configuration property decorator.
|
|
129
|
+
*/
|
|
130
|
+
export declare function ConfigProperty(options: ConfigPropertyOptions): PropertyDecorator;
|
|
131
|
+
/**
|
|
132
|
+
* Configuration class decorator for automatic configuration injection.
|
|
133
|
+
*/
|
|
134
|
+
export interface ConfigClassOptions {
|
|
135
|
+
/** Configuration namespace */
|
|
136
|
+
namespace?: string;
|
|
137
|
+
/** Whether to validate all properties */
|
|
138
|
+
validate?: boolean;
|
|
139
|
+
/** Whether to prefer AWS sources */
|
|
140
|
+
preferAws?: boolean;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Configuration class decorator.
|
|
144
|
+
*/
|
|
145
|
+
export declare function ConfigClass(options?: ConfigClassOptions): ClassDecorator;
|
|
146
|
+
/**
|
|
147
|
+
* Configuration validation decorator.
|
|
148
|
+
*/
|
|
149
|
+
export interface ConfigValidationOptions {
|
|
150
|
+
/** Validation schema */
|
|
151
|
+
schema?: any;
|
|
152
|
+
/** Custom validation function */
|
|
153
|
+
validator?: (config: any) => boolean | Promise<boolean>;
|
|
154
|
+
/** Whether to throw on validation failure */
|
|
155
|
+
throwOnError?: boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Configuration validation decorator.
|
|
159
|
+
*/
|
|
160
|
+
export declare function ValidateConfig(options: ConfigValidationOptions): ClassDecorator;
|
|
161
|
+
/**
|
|
162
|
+
* Configuration transformer interface.
|
|
163
|
+
*/
|
|
164
|
+
export interface ConfigTransformer<TInput = any, TOutput = any> {
|
|
165
|
+
/**
|
|
166
|
+
* Transform configuration value.
|
|
167
|
+
* @param value - Input value
|
|
168
|
+
* @param key - Configuration key
|
|
169
|
+
* @returns Transformed value
|
|
170
|
+
*/
|
|
171
|
+
transform(value: TInput, key: string): TOutput;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Configuration transformer decorator.
|
|
175
|
+
*/
|
|
176
|
+
export declare function TransformConfig<TInput, TOutput>(transformer: ConfigTransformer<TInput, TOutput>): PropertyDecorator;
|
|
177
|
+
/**
|
|
178
|
+
* Configuration factory with enhanced type safety.
|
|
179
|
+
*/
|
|
180
|
+
export interface TypeSafeConfigFactory<T = any> {
|
|
181
|
+
(): T;
|
|
182
|
+
KEY: string;
|
|
183
|
+
asProvider(): {
|
|
184
|
+
provide: string;
|
|
185
|
+
useFactory: () => T;
|
|
186
|
+
inject: [ConfigService];
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Create a type-safe configuration factory.
|
|
191
|
+
*/
|
|
192
|
+
export declare function createTypeSafeConfigFactory<T>(key: string, factory: (config: ConfigService) => T): TypeSafeConfigFactory<T>;
|
|
193
|
+
/**
|
|
194
|
+
* Configuration module builder for enhanced setup.
|
|
195
|
+
*/
|
|
196
|
+
export interface ConfigModuleBuilder {
|
|
197
|
+
/**
|
|
198
|
+
* Add AWS integration.
|
|
199
|
+
*/
|
|
200
|
+
withAwsIntegration(options: any): ConfigModuleBuilder;
|
|
201
|
+
/**
|
|
202
|
+
* Add configuration factories.
|
|
203
|
+
*/
|
|
204
|
+
withFactories(factories: TypeSafeConfigFactory[]): ConfigModuleBuilder;
|
|
205
|
+
/**
|
|
206
|
+
* Add validation.
|
|
207
|
+
*/
|
|
208
|
+
withValidation(schema: any): ConfigModuleBuilder;
|
|
209
|
+
/**
|
|
210
|
+
* Set as global module.
|
|
211
|
+
*/
|
|
212
|
+
asGlobal(): ConfigModuleBuilder;
|
|
213
|
+
/**
|
|
214
|
+
* Enable caching.
|
|
215
|
+
*/
|
|
216
|
+
withCaching(): ConfigModuleBuilder;
|
|
217
|
+
/**
|
|
218
|
+
* Build the module.
|
|
219
|
+
*/
|
|
220
|
+
build(): Type<any>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Configuration testing utilities.
|
|
224
|
+
*/
|
|
225
|
+
export interface ConfigTestingUtils {
|
|
226
|
+
/**
|
|
227
|
+
* Create a mock config service.
|
|
228
|
+
*/
|
|
229
|
+
createMockConfigService(config: Record<string, any>): EnhancedConfigService;
|
|
230
|
+
/**
|
|
231
|
+
* Create test configuration module.
|
|
232
|
+
*/
|
|
233
|
+
createTestConfigModule(config: Record<string, any>): Type<any>;
|
|
234
|
+
/**
|
|
235
|
+
* Mock AWS configuration sources.
|
|
236
|
+
*/
|
|
237
|
+
mockAwsSources(config: Record<string, any>): void;
|
|
238
|
+
/**
|
|
239
|
+
* Reset all mocks.
|
|
240
|
+
*/
|
|
241
|
+
resetMocks(): void;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Configuration monitoring interface.
|
|
245
|
+
*/
|
|
246
|
+
export interface ConfigMonitor {
|
|
247
|
+
/**
|
|
248
|
+
* Start monitoring configuration changes.
|
|
249
|
+
*/
|
|
250
|
+
startMonitoring(): void;
|
|
251
|
+
/**
|
|
252
|
+
* Stop monitoring configuration changes.
|
|
253
|
+
*/
|
|
254
|
+
stopMonitoring(): void;
|
|
255
|
+
/**
|
|
256
|
+
* Get configuration metrics.
|
|
257
|
+
*/
|
|
258
|
+
getMetrics(): ConfigMetrics;
|
|
259
|
+
/**
|
|
260
|
+
* Subscribe to configuration events.
|
|
261
|
+
*/
|
|
262
|
+
subscribe(callback: (event: ConfigEvent) => void): () => void;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Configuration metrics.
|
|
266
|
+
*/
|
|
267
|
+
export interface ConfigMetrics {
|
|
268
|
+
/** Total configuration loads */
|
|
269
|
+
totalLoads: number;
|
|
270
|
+
/** Successful AWS loads */
|
|
271
|
+
successfulAwsLoads: number;
|
|
272
|
+
/** Failed AWS loads */
|
|
273
|
+
failedAwsLoads: number;
|
|
274
|
+
/** Average load time */
|
|
275
|
+
averageLoadTime: number;
|
|
276
|
+
/** Last load time */
|
|
277
|
+
lastLoadTime?: Date;
|
|
278
|
+
/** Configuration cache hit rate */
|
|
279
|
+
cacheHitRate: number;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Configuration event.
|
|
283
|
+
*/
|
|
284
|
+
export interface ConfigEvent {
|
|
285
|
+
/** Event type */
|
|
286
|
+
type: 'loaded' | 'updated' | 'error' | 'validated';
|
|
287
|
+
/** Event timestamp */
|
|
288
|
+
timestamp: Date;
|
|
289
|
+
/** Event data */
|
|
290
|
+
data: any;
|
|
291
|
+
/** Source of the event */
|
|
292
|
+
source: string;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Configuration audit log entry.
|
|
296
|
+
*/
|
|
297
|
+
export interface ConfigAuditEntry {
|
|
298
|
+
/** Audit entry ID */
|
|
299
|
+
id: string;
|
|
300
|
+
/** Timestamp */
|
|
301
|
+
timestamp: Date;
|
|
302
|
+
/** Action performed */
|
|
303
|
+
action: 'load' | 'update' | 'delete' | 'validate';
|
|
304
|
+
/** Configuration key affected */
|
|
305
|
+
key: string;
|
|
306
|
+
/** Old value (for updates) */
|
|
307
|
+
oldValue?: any;
|
|
308
|
+
/** New value */
|
|
309
|
+
newValue?: any;
|
|
310
|
+
/** Source of the change */
|
|
311
|
+
source: string;
|
|
312
|
+
/** User or system that made the change */
|
|
313
|
+
actor: string;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Configuration audit logger.
|
|
317
|
+
*/
|
|
318
|
+
export interface ConfigAuditLogger {
|
|
319
|
+
/**
|
|
320
|
+
* Log a configuration change.
|
|
321
|
+
*/
|
|
322
|
+
log(entry: Omit<ConfigAuditEntry, 'id' | 'timestamp'>): void;
|
|
323
|
+
/**
|
|
324
|
+
* Get audit log entries.
|
|
325
|
+
*/
|
|
326
|
+
getEntries(filter?: Partial<ConfigAuditEntry>): ConfigAuditEntry[];
|
|
327
|
+
/**
|
|
328
|
+
* Clear audit log.
|
|
329
|
+
*/
|
|
330
|
+
clear(): void;
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=nestjs-config-compatibility.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nestjs-config-compatibility.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/nestjs-config-compatibility.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D;;;;;OAKG;IACH,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAEzF;;;;;OAKG;IACH,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAE3E;;;;;OAKG;IACH,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAE7E;;;;OAIG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzC;;;OAGG;IACH,UAAU,IAAI,MAAM,EAAE,CAAC;IAEvB;;;OAGG;IACH,YAAY,IAAI,MAAM,EAAE,CAAC;IAEzB;;;;OAIG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAElE;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;OAGG;IACH,eAAe,IAAI,kBAAkB,CAAC;CACvC;AAED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