@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,259 @@
|
|
|
1
|
+
import { ConfigFactory, ConfigModuleOptions } from '@nestjs/config';
|
|
2
|
+
import { DynamicModule, ModuleMetadata, Type } from '@nestjs/common';
|
|
3
|
+
import { IntegrationOptions } from './integration-options.interface';
|
|
4
|
+
import { ConfigurationSource } from './configuration-source.interface';
|
|
5
|
+
import { TypedConfiguration, ConfigurationSchema } from './typed-configuration.interface';
|
|
6
|
+
/**
|
|
7
|
+
* Enhanced module options that extend @nestjs/config options with AWS integration.
|
|
8
|
+
*/
|
|
9
|
+
export interface EnhancedConfigModuleOptions extends ConfigModuleOptions {
|
|
10
|
+
/** AWS integration options */
|
|
11
|
+
awsIntegration?: IntegrationOptions;
|
|
12
|
+
/** Whether to enable AWS configuration loading */
|
|
13
|
+
enableAwsIntegration?: boolean;
|
|
14
|
+
/** Custom configuration schemas for type safety */
|
|
15
|
+
schemas?: ConfigurationSchema[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Factory function type for creating enhanced configuration modules.
|
|
19
|
+
*/
|
|
20
|
+
export type EnhancedConfigModuleFactory = (options?: EnhancedConfigModuleOptions) => DynamicModule;
|
|
21
|
+
/**
|
|
22
|
+
* Async factory function type for creating enhanced configuration modules.
|
|
23
|
+
*/
|
|
24
|
+
export type EnhancedAsyncConfigModuleFactory = (options: EnhancedAsyncConfigModuleOptions) => DynamicModule;
|
|
25
|
+
/**
|
|
26
|
+
* Async options for enhanced configuration module.
|
|
27
|
+
*/
|
|
28
|
+
export interface EnhancedAsyncConfigModuleOptions extends ModuleMetadata {
|
|
29
|
+
/** Factory function to create enhanced configuration options */
|
|
30
|
+
useFactory?: (...args: any[]) => Promise<EnhancedConfigModuleOptions> | EnhancedConfigModuleOptions;
|
|
31
|
+
/** Class to use as factory */
|
|
32
|
+
useClass?: Type<EnhancedConfigModuleOptionsFactory>;
|
|
33
|
+
/** Existing instance to use as factory */
|
|
34
|
+
useExisting?: Type<EnhancedConfigModuleOptionsFactory>;
|
|
35
|
+
/** Dependencies to inject into the factory function */
|
|
36
|
+
inject?: any[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Factory interface for creating enhanced configuration module options.
|
|
40
|
+
*/
|
|
41
|
+
export interface EnhancedConfigModuleOptionsFactory {
|
|
42
|
+
/**
|
|
43
|
+
* Create enhanced configuration module options.
|
|
44
|
+
* @returns Enhanced configuration module options
|
|
45
|
+
*/
|
|
46
|
+
createConfigOptions(): Promise<EnhancedConfigModuleOptions> | EnhancedConfigModuleOptions;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Integration service interface for managing AWS and @nestjs/config integration.
|
|
50
|
+
*/
|
|
51
|
+
export interface NestJSConfigIntegrationService {
|
|
52
|
+
/**
|
|
53
|
+
* Initialize the integration with @nestjs/config.
|
|
54
|
+
* @param options - Integration options
|
|
55
|
+
*/
|
|
56
|
+
initialize(options: IntegrationOptions): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Register configuration factories with @nestjs/config.
|
|
59
|
+
* @param factories - Configuration factories to register
|
|
60
|
+
*/
|
|
61
|
+
registerFactories(factories: ConfigFactory[]): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Get configuration from AWS sources and format for @nestjs/config.
|
|
64
|
+
* @param namespaces - Optional namespaces to load
|
|
65
|
+
* @returns Configuration data organized for @nestjs/config
|
|
66
|
+
*/
|
|
67
|
+
getConfigurationForNestJS(namespaces?: string[]): Promise<Record<string, any>>;
|
|
68
|
+
/**
|
|
69
|
+
* Create configuration factories from AWS sources.
|
|
70
|
+
* @param sources - Configuration sources from AWS
|
|
71
|
+
* @param namespaces - Optional namespaces to organize configuration
|
|
72
|
+
* @returns Array of configuration factories
|
|
73
|
+
*/
|
|
74
|
+
createFactoriesFromAwsSources(sources: ConfigurationSource[], namespaces?: string[]): ConfigFactory[];
|
|
75
|
+
/**
|
|
76
|
+
* Merge AWS configuration with existing @nestjs/config configuration.
|
|
77
|
+
* @param awsConfig - Configuration from AWS sources
|
|
78
|
+
* @param existingConfig - Existing @nestjs/config configuration
|
|
79
|
+
* @returns Merged configuration
|
|
80
|
+
*/
|
|
81
|
+
mergeWithExistingConfig(awsConfig: Record<string, any>, existingConfig: Record<string, any>): Record<string, any>;
|
|
82
|
+
/**
|
|
83
|
+
* Validate configuration using @nestjs/config validation patterns.
|
|
84
|
+
* @param config - Configuration to validate
|
|
85
|
+
* @param validationSchema - Optional validation schema
|
|
86
|
+
* @returns Validation result
|
|
87
|
+
*/
|
|
88
|
+
validateConfiguration(config: Record<string, any>, validationSchema?: any): Promise<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Get typed configuration with full type safety.
|
|
91
|
+
* @param key - Configuration key or namespace
|
|
92
|
+
* @returns Typed configuration
|
|
93
|
+
*/
|
|
94
|
+
getTypedConfiguration<T = any>(key: string): TypedConfiguration<T> | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Check if the integration is properly initialized.
|
|
97
|
+
* @returns True if initialized, false otherwise
|
|
98
|
+
*/
|
|
99
|
+
isInitialized(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Get integration status and health information.
|
|
102
|
+
* @returns Integration status information
|
|
103
|
+
*/
|
|
104
|
+
getStatus(): IntegrationStatus;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Integration status information.
|
|
108
|
+
*/
|
|
109
|
+
export interface IntegrationStatus {
|
|
110
|
+
/** Whether the integration is initialized */
|
|
111
|
+
initialized: boolean;
|
|
112
|
+
/** Whether AWS services are available */
|
|
113
|
+
awsAvailable: boolean;
|
|
114
|
+
/** Number of configuration sources loaded */
|
|
115
|
+
sourcesLoaded: number;
|
|
116
|
+
/** Number of factories registered */
|
|
117
|
+
factoriesRegistered: number;
|
|
118
|
+
/** Any errors encountered */
|
|
119
|
+
errors: string[];
|
|
120
|
+
/** Last update timestamp */
|
|
121
|
+
lastUpdated: Date;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Configuration loader interface for AWS integration with @nestjs/config.
|
|
125
|
+
*/
|
|
126
|
+
export interface AwsConfigurationLoader {
|
|
127
|
+
/**
|
|
128
|
+
* Load configuration from AWS sources for @nestjs/config integration.
|
|
129
|
+
* @param options - Integration options
|
|
130
|
+
* @returns Promise resolving to configuration data
|
|
131
|
+
*/
|
|
132
|
+
loadForNestJSConfig(options: IntegrationOptions): Promise<Record<string, any>>;
|
|
133
|
+
/**
|
|
134
|
+
* Load namespaced configuration from AWS sources.
|
|
135
|
+
* @param namespaces - Namespaces to load
|
|
136
|
+
* @param options - Integration options
|
|
137
|
+
* @returns Promise resolving to namespaced configuration data
|
|
138
|
+
*/
|
|
139
|
+
loadNamespacedForNestJSConfig(namespaces: string[], options: IntegrationOptions): Promise<Record<string, Record<string, any>>>;
|
|
140
|
+
/**
|
|
141
|
+
* Check if AWS services are available for configuration loading.
|
|
142
|
+
* @returns Promise resolving to availability status
|
|
143
|
+
*/
|
|
144
|
+
checkAwsAvailability(): Promise<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* Get configuration sources that are available.
|
|
147
|
+
* @param options - Integration options
|
|
148
|
+
* @returns Promise resolving to available sources
|
|
149
|
+
*/
|
|
150
|
+
getAvailableSources(options: IntegrationOptions): Promise<string[]>;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Configuration merger interface for handling precedence rules.
|
|
154
|
+
*/
|
|
155
|
+
export interface ConfigurationMerger {
|
|
156
|
+
/**
|
|
157
|
+
* Merge configurations with precedence rules.
|
|
158
|
+
* @param sources - Configuration sources to merge
|
|
159
|
+
* @param precedenceRule - Precedence rule to apply
|
|
160
|
+
* @returns Merged configuration
|
|
161
|
+
*/
|
|
162
|
+
mergeWithPrecedence(sources: ConfigurationSource[], precedenceRule: 'aws-first' | 'local-first' | 'merge'): Record<string, any>;
|
|
163
|
+
/**
|
|
164
|
+
* Merge two configuration objects.
|
|
165
|
+
* @param primary - Primary configuration (higher precedence)
|
|
166
|
+
* @param secondary - Secondary configuration (lower precedence)
|
|
167
|
+
* @returns Merged configuration
|
|
168
|
+
*/
|
|
169
|
+
merge(primary: Record<string, any>, secondary: Record<string, any>): Record<string, any>;
|
|
170
|
+
/**
|
|
171
|
+
* Deep merge configuration objects with conflict resolution.
|
|
172
|
+
* @param configs - Array of configuration objects to merge
|
|
173
|
+
* @param conflictResolution - How to resolve conflicts
|
|
174
|
+
* @returns Merged configuration
|
|
175
|
+
*/
|
|
176
|
+
deepMerge(configs: Record<string, any>[], conflictResolution?: 'first-wins' | 'last-wins' | 'merge-arrays'): Record<string, any>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Configuration validator interface for AWS-sourced values.
|
|
180
|
+
*/
|
|
181
|
+
export interface AwsConfigurationValidator {
|
|
182
|
+
/**
|
|
183
|
+
* Validate configuration using Joi schema.
|
|
184
|
+
* @param config - Configuration to validate
|
|
185
|
+
* @param schema - Joi validation schema
|
|
186
|
+
* @returns Validation result
|
|
187
|
+
*/
|
|
188
|
+
validateWithJoi(config: Record<string, any>, schema: any): Promise<boolean>;
|
|
189
|
+
/**
|
|
190
|
+
* Validate configuration using class-validator.
|
|
191
|
+
* @param config - Configuration to validate
|
|
192
|
+
* @param validationClass - Class with validation decorators
|
|
193
|
+
* @returns Validation result
|
|
194
|
+
*/
|
|
195
|
+
validateWithClassValidator(config: Record<string, any>, validationClass: any): Promise<boolean>;
|
|
196
|
+
/**
|
|
197
|
+
* Validate configuration using custom validation function.
|
|
198
|
+
* @param config - Configuration to validate
|
|
199
|
+
* @param validationFn - Custom validation function
|
|
200
|
+
* @returns Validation result
|
|
201
|
+
*/
|
|
202
|
+
validateWithCustomFunction(config: Record<string, any>, validationFn: (config: any) => boolean | Promise<boolean>): Promise<boolean>;
|
|
203
|
+
/**
|
|
204
|
+
* Get validation errors for configuration.
|
|
205
|
+
* @param config - Configuration to validate
|
|
206
|
+
* @param schema - Validation schema
|
|
207
|
+
* @returns Array of validation errors
|
|
208
|
+
*/
|
|
209
|
+
getValidationErrors(config: Record<string, any>, schema: any): string[];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Utility type for extracting configuration type from @nestjs/config factory.
|
|
213
|
+
*/
|
|
214
|
+
export type ExtractConfigType<T> = T extends () => infer U ? U : never;
|
|
215
|
+
/**
|
|
216
|
+
* Utility type for creating strongly typed configuration service.
|
|
217
|
+
*/
|
|
218
|
+
export type TypedConfigService<T extends Record<string, ConfigFactory>> = {
|
|
219
|
+
get<K extends keyof T>(key: K): ExtractConfigType<T[K]> | undefined;
|
|
220
|
+
getOrThrow<K extends keyof T>(key: K): ExtractConfigType<T[K]>;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Configuration namespace registry for managing namespaced configurations.
|
|
224
|
+
*/
|
|
225
|
+
export interface ConfigurationNamespaceRegistry {
|
|
226
|
+
/**
|
|
227
|
+
* Register a namespace with its configuration factory.
|
|
228
|
+
* @param namespace - Namespace name
|
|
229
|
+
* @param factory - Configuration factory for the namespace
|
|
230
|
+
*/
|
|
231
|
+
register(namespace: string, factory: ConfigFactory): void;
|
|
232
|
+
/**
|
|
233
|
+
* Get a configuration factory by namespace.
|
|
234
|
+
* @param namespace - Namespace name
|
|
235
|
+
* @returns Configuration factory or undefined
|
|
236
|
+
*/
|
|
237
|
+
get(namespace: string): ConfigFactory | undefined;
|
|
238
|
+
/**
|
|
239
|
+
* Check if a namespace is registered.
|
|
240
|
+
* @param namespace - Namespace name
|
|
241
|
+
* @returns True if registered, false otherwise
|
|
242
|
+
*/
|
|
243
|
+
has(namespace: string): boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Get all registered namespaces.
|
|
246
|
+
* @returns Array of namespace names
|
|
247
|
+
*/
|
|
248
|
+
getNamespaces(): string[];
|
|
249
|
+
/**
|
|
250
|
+
* Unregister a namespace.
|
|
251
|
+
* @param namespace - Namespace name
|
|
252
|
+
*/
|
|
253
|
+
unregister(namespace: string): void;
|
|
254
|
+
/**
|
|
255
|
+
* Clear all registered namespaces.
|
|
256
|
+
*/
|
|
257
|
+
clear(): void;
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=nestjs-config-integration.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nestjs-config-integration.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/nestjs-config-integration.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE1F;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,8BAA8B;IAC9B,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,kDAAkD;IAClD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mDAAmD;IACnD,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,CAAC,EAAE,2BAA2B,KAClC,aAAa,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,CAC7C,OAAO,EAAE,gCAAgC,KACtC,aAAa,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,gCAAiC,SAAQ,cAAc;IACtE,gEAAgE;IAChE,UAAU,CAAC,EAAE,CACX,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC,2BAA2B,CAAC,GAAG,2BAA2B,CAAC;IAExE,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAEpD,0CAA0C;IAC1C,WAAW,CAAC,EAAE,IAAI,CAAC,kCA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CAAC;IACpE,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAE1D;;;;OAIG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAElD;;;;OAIG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhC;;;OAGG;IACH,aAAa,IAAI,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic type for typed configuration access.
|
|
3
|
+
* Provides type safety for configuration values loaded from AWS sources.
|
|
4
|
+
*/
|
|
5
|
+
export interface TypedConfiguration<T = any> {
|
|
6
|
+
/** The configuration data with proper typing */
|
|
7
|
+
data: T;
|
|
8
|
+
/** Namespace for this configuration */
|
|
9
|
+
namespace?: string;
|
|
10
|
+
/** Whether this configuration was loaded from AWS sources */
|
|
11
|
+
fromAws: boolean;
|
|
12
|
+
/** Timestamp when this configuration was loaded */
|
|
13
|
+
loadedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generic configuration factory with type safety.
|
|
17
|
+
*/
|
|
18
|
+
export interface TypedConfigurationFactory<T = any> {
|
|
19
|
+
/** Type-safe configuration data */
|
|
20
|
+
(): T;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Configuration accessor with type safety for AWS-sourced values.
|
|
24
|
+
*/
|
|
25
|
+
export interface TypedConfigurationAccessor {
|
|
26
|
+
/**
|
|
27
|
+
* Get typed configuration value with type safety.
|
|
28
|
+
* @param key - Configuration key (supports dot notation)
|
|
29
|
+
* @returns Typed configuration value
|
|
30
|
+
*/
|
|
31
|
+
get<T = any>(key: string): T | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Get typed configuration value or throw if not found.
|
|
34
|
+
* @param key - Configuration key (supports dot notation)
|
|
35
|
+
* @returns Typed configuration value
|
|
36
|
+
* @throws Error if key is not found
|
|
37
|
+
*/
|
|
38
|
+
getOrThrow<T = any>(key: string): T;
|
|
39
|
+
/**
|
|
40
|
+
* Get namespaced typed configuration.
|
|
41
|
+
* @param namespace - Configuration namespace
|
|
42
|
+
* @returns Typed configuration for the namespace
|
|
43
|
+
*/
|
|
44
|
+
getNamespaced<T = any>(namespace: string): TypedConfiguration<T> | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Get namespaced typed configuration or throw if not found.
|
|
47
|
+
* @param namespace - Configuration namespace
|
|
48
|
+
* @returns Typed configuration for the namespace
|
|
49
|
+
* @throws Error if namespace is not found
|
|
50
|
+
*/
|
|
51
|
+
getNamespacedOrThrow<T = any>(namespace: string): TypedConfiguration<T>;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a configuration key exists.
|
|
54
|
+
* @param key - Configuration key (supports dot notation)
|
|
55
|
+
* @returns True if key exists, false otherwise
|
|
56
|
+
*/
|
|
57
|
+
has(key: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Check if a namespace exists.
|
|
60
|
+
* @param namespace - Configuration namespace
|
|
61
|
+
* @returns True if namespace exists, false otherwise
|
|
62
|
+
*/
|
|
63
|
+
hasNamespace(namespace: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Get all configuration keys.
|
|
66
|
+
* @returns Array of all configuration keys
|
|
67
|
+
*/
|
|
68
|
+
getKeys(): string[];
|
|
69
|
+
/**
|
|
70
|
+
* Get all namespaces.
|
|
71
|
+
* @returns Array of all namespaces
|
|
72
|
+
*/
|
|
73
|
+
getNamespaces(): string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Type-safe configuration schema definition.
|
|
77
|
+
*/
|
|
78
|
+
export interface ConfigurationSchema<T = any> {
|
|
79
|
+
/** Schema name/identifier */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Optional namespace for this schema */
|
|
82
|
+
namespace?: string;
|
|
83
|
+
/** Type definition for the configuration */
|
|
84
|
+
type: new () => T;
|
|
85
|
+
/** Optional validation function */
|
|
86
|
+
validate?: (config: any) => config is T;
|
|
87
|
+
/** Optional default values */
|
|
88
|
+
defaults?: Partial<T>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Configuration registry for managing typed configurations.
|
|
92
|
+
*/
|
|
93
|
+
export interface TypedConfigurationRegistry {
|
|
94
|
+
/**
|
|
95
|
+
* Register a typed configuration schema.
|
|
96
|
+
* @param schema - Configuration schema to register
|
|
97
|
+
*/
|
|
98
|
+
register<T>(schema: ConfigurationSchema<T>): void;
|
|
99
|
+
/**
|
|
100
|
+
* Get a typed configuration by name.
|
|
101
|
+
* @param name - Schema name
|
|
102
|
+
* @returns Typed configuration or undefined
|
|
103
|
+
*/
|
|
104
|
+
get<T = any>(name: string): TypedConfiguration<T> | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Get a typed configuration by name or throw if not found.
|
|
107
|
+
* @param name - Schema name
|
|
108
|
+
* @returns Typed configuration
|
|
109
|
+
* @throws Error if schema is not found
|
|
110
|
+
*/
|
|
111
|
+
getOrThrow<T = any>(name: string): TypedConfiguration<T>;
|
|
112
|
+
/**
|
|
113
|
+
* Check if a schema is registered.
|
|
114
|
+
* @param name - Schema name
|
|
115
|
+
* @returns True if schema is registered, false otherwise
|
|
116
|
+
*/
|
|
117
|
+
has(name: string): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Get all registered schema names.
|
|
120
|
+
* @returns Array of schema names
|
|
121
|
+
*/
|
|
122
|
+
getSchemaNames(): string[];
|
|
123
|
+
/**
|
|
124
|
+
* Unregister a schema.
|
|
125
|
+
* @param name - Schema name to unregister
|
|
126
|
+
*/
|
|
127
|
+
unregister(name: string): void;
|
|
128
|
+
/**
|
|
129
|
+
* Clear all registered schemas.
|
|
130
|
+
*/
|
|
131
|
+
clear(): void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Options for typed configuration access.
|
|
135
|
+
*/
|
|
136
|
+
export interface TypedConfigurationOptions {
|
|
137
|
+
/** Whether to enable strict type checking */
|
|
138
|
+
strictTypes?: boolean;
|
|
139
|
+
/** Whether to cache typed configurations */
|
|
140
|
+
cache?: boolean;
|
|
141
|
+
/** Default namespace for unnamespaced configurations */
|
|
142
|
+
defaultNamespace?: string;
|
|
143
|
+
/** Whether to throw on type validation failures */
|
|
144
|
+
throwOnValidationError?: boolean;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Utility type for extracting configuration type from a factory.
|
|
148
|
+
*/
|
|
149
|
+
export type ConfigurationType<T> = T extends TypedConfigurationFactory<infer U> ? U : never;
|
|
150
|
+
/**
|
|
151
|
+
* Utility type for creating strongly typed configuration objects.
|
|
152
|
+
*/
|
|
153
|
+
export type StronglyTypedConfig<T extends Record<string, any>> = {
|
|
154
|
+
readonly [K in keyof T]: T[K];
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Configuration value with metadata about its source and type.
|
|
158
|
+
*/
|
|
159
|
+
export interface ConfigurationValue<T = any> {
|
|
160
|
+
/** The actual configuration value */
|
|
161
|
+
value: T;
|
|
162
|
+
/** Source of this configuration value */
|
|
163
|
+
source: 'environment' | 'secrets-manager' | 'ssm' | 'local-file';
|
|
164
|
+
/** Whether this value came from AWS */
|
|
165
|
+
fromAws: boolean;
|
|
166
|
+
/** Namespace this value belongs to */
|
|
167
|
+
namespace?: string;
|
|
168
|
+
/** Original key used to access this value */
|
|
169
|
+
key: string;
|
|
170
|
+
/** Type of the value */
|
|
171
|
+
type: string;
|
|
172
|
+
/** Whether this value was validated */
|
|
173
|
+
validated: boolean;
|
|
174
|
+
/** Timestamp when this value was loaded */
|
|
175
|
+
loadedAt: Date;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Configuration path resolver for nested configuration access.
|
|
179
|
+
*/
|
|
180
|
+
export interface ConfigurationPathResolver {
|
|
181
|
+
/**
|
|
182
|
+
* Resolve a configuration path to its value.
|
|
183
|
+
* @param path - Configuration path (supports dot notation)
|
|
184
|
+
* @param config - Configuration object to resolve against
|
|
185
|
+
* @returns Resolved value or undefined
|
|
186
|
+
*/
|
|
187
|
+
resolve<T = any>(path: string, config: Record<string, any>): T | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Set a value at a configuration path.
|
|
190
|
+
* @param path - Configuration path (supports dot notation)
|
|
191
|
+
* @param value - Value to set
|
|
192
|
+
* @param config - Configuration object to modify
|
|
193
|
+
*/
|
|
194
|
+
set<T = any>(path: string, value: T, config: Record<string, any>): void;
|
|
195
|
+
/**
|
|
196
|
+
* Check if a configuration path exists.
|
|
197
|
+
* @param path - Configuration path (supports dot notation)
|
|
198
|
+
* @param config - Configuration object to check
|
|
199
|
+
* @returns True if path exists, false otherwise
|
|
200
|
+
*/
|
|
201
|
+
exists(path: string, config: Record<string, any>): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Get all paths in a configuration object.
|
|
204
|
+
* @param config - Configuration object to analyze
|
|
205
|
+
* @returns Array of all configuration paths
|
|
206
|
+
*/
|
|
207
|
+
getAllPaths(config: Record<string, any>): string[];
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=typed-configuration.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-configuration.interface.d.ts","sourceRoot":"","sources":["../../../../src/integration/interfaces/typed-configuration.interface.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG;IACzC,gDAAgD;IACh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