@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.
Files changed (231) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1183 -0
  3. package/dist/cjs/config.module.js +178 -0
  4. package/dist/cjs/config.module.js.map +1 -0
  5. package/dist/cjs/index.js +47 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/integration/index.js +23 -0
  8. package/dist/cjs/integration/index.js.map +1 -0
  9. package/dist/cjs/integration/interfaces/configuration-factory.interface.js +3 -0
  10. package/dist/cjs/integration/interfaces/configuration-factory.interface.js.map +1 -0
  11. package/dist/cjs/integration/interfaces/configuration-source.interface.js +3 -0
  12. package/dist/cjs/integration/interfaces/configuration-source.interface.js.map +1 -0
  13. package/dist/cjs/integration/interfaces/index.js +26 -0
  14. package/dist/cjs/integration/interfaces/index.js.map +1 -0
  15. package/dist/cjs/integration/interfaces/integration-options.interface.js +3 -0
  16. package/dist/cjs/integration/interfaces/integration-options.interface.js.map +1 -0
  17. package/dist/cjs/integration/interfaces/integration-state.interface.js +3 -0
  18. package/dist/cjs/integration/interfaces/integration-state.interface.js.map +1 -0
  19. package/dist/cjs/integration/interfaces/nestjs-config-compatibility.interface.js +73 -0
  20. package/dist/cjs/integration/interfaces/nestjs-config-compatibility.interface.js.map +1 -0
  21. package/dist/cjs/integration/interfaces/nestjs-config-integration.interface.js +3 -0
  22. package/dist/cjs/integration/interfaces/nestjs-config-integration.interface.js.map +1 -0
  23. package/dist/cjs/integration/interfaces/typed-configuration.interface.js +4 -0
  24. package/dist/cjs/integration/interfaces/typed-configuration.interface.js.map +1 -0
  25. package/dist/cjs/integration/interfaces/utility-types.interface.js +52 -0
  26. package/dist/cjs/integration/interfaces/utility-types.interface.js.map +1 -0
  27. package/dist/cjs/integration/nestjs-config-integration.module.js +124 -0
  28. package/dist/cjs/integration/nestjs-config-integration.module.js.map +1 -0
  29. package/dist/cjs/integration/providers/aws-configuration-loader.service.js +591 -0
  30. package/dist/cjs/integration/providers/aws-configuration-loader.service.js.map +1 -0
  31. package/dist/cjs/integration/providers/configuration-factory.provider.js +383 -0
  32. package/dist/cjs/integration/providers/configuration-factory.provider.js.map +1 -0
  33. package/dist/cjs/integration/providers/index.js +20 -0
  34. package/dist/cjs/integration/providers/index.js.map +1 -0
  35. package/dist/cjs/integration/services/async-config-helper.service.js +356 -0
  36. package/dist/cjs/integration/services/async-config-helper.service.js.map +1 -0
  37. package/dist/cjs/integration/services/error-handler.service.js +265 -0
  38. package/dist/cjs/integration/services/error-handler.service.js.map +1 -0
  39. package/dist/cjs/integration/services/factory-registration.service.js +512 -0
  40. package/dist/cjs/integration/services/factory-registration.service.js.map +1 -0
  41. package/dist/cjs/integration/services/index.js +26 -0
  42. package/dist/cjs/integration/services/index.js.map +1 -0
  43. package/dist/cjs/integration/services/integration-state.service.js +83 -0
  44. package/dist/cjs/integration/services/integration-state.service.js.map +1 -0
  45. package/dist/cjs/integration/services/namespace-handler.service.js +467 -0
  46. package/dist/cjs/integration/services/namespace-handler.service.js.map +1 -0
  47. package/dist/cjs/integration/services/nestjs-config-integration.service.js +316 -0
  48. package/dist/cjs/integration/services/nestjs-config-integration.service.js.map +1 -0
  49. package/dist/cjs/integration/services/precedence-handler.service.js +294 -0
  50. package/dist/cjs/integration/services/precedence-handler.service.js.map +1 -0
  51. package/dist/cjs/integration/services/validation-integration.service.js +591 -0
  52. package/dist/cjs/integration/services/validation-integration.service.js.map +1 -0
  53. package/dist/cjs/integration/utils/config-integration.util.js +283 -0
  54. package/dist/cjs/integration/utils/config-integration.util.js.map +1 -0
  55. package/dist/cjs/integration/utils/index.js +19 -0
  56. package/dist/cjs/integration/utils/index.js.map +1 -0
  57. package/dist/cjs/interfaces/config-loader.interface.js +3 -0
  58. package/dist/cjs/interfaces/config-loader.interface.js.map +1 -0
  59. package/dist/cjs/interfaces/config-service.interface.js +11 -0
  60. package/dist/cjs/interfaces/config-service.interface.js.map +1 -0
  61. package/dist/cjs/interfaces/default-schema.interface.js +63 -0
  62. package/dist/cjs/interfaces/default-schema.interface.js.map +1 -0
  63. package/dist/cjs/interfaces/errors.interface.js +77 -0
  64. package/dist/cjs/interfaces/errors.interface.js.map +1 -0
  65. package/dist/cjs/interfaces/index.js +25 -0
  66. package/dist/cjs/interfaces/index.js.map +1 -0
  67. package/dist/cjs/interfaces/module-options.interface.js +3 -0
  68. package/dist/cjs/interfaces/module-options.interface.js.map +1 -0
  69. package/dist/cjs/loaders/environment.loader.js +59 -0
  70. package/dist/cjs/loaders/environment.loader.js.map +1 -0
  71. package/dist/cjs/loaders/secrets-manager.loader.js +122 -0
  72. package/dist/cjs/loaders/secrets-manager.loader.js.map +1 -0
  73. package/dist/cjs/loaders/ssm-parameter-store.loader.js +146 -0
  74. package/dist/cjs/loaders/ssm-parameter-store.loader.js.map +1 -0
  75. package/dist/cjs/services/config.service.js +297 -0
  76. package/dist/cjs/services/config.service.js.map +1 -0
  77. package/dist/cjs/utils/validation.util.js +114 -0
  78. package/dist/cjs/utils/validation.util.js.map +1 -0
  79. package/dist/esm/config.module.js +175 -0
  80. package/dist/esm/config.module.js.map +1 -0
  81. package/dist/esm/index.js +18 -0
  82. package/dist/esm/index.js.map +1 -0
  83. package/dist/esm/integration/index.js +7 -0
  84. package/dist/esm/integration/index.js.map +1 -0
  85. package/dist/esm/integration/interfaces/configuration-factory.interface.js +2 -0
  86. package/dist/esm/integration/interfaces/configuration-factory.interface.js.map +1 -0
  87. package/dist/esm/integration/interfaces/configuration-source.interface.js +2 -0
  88. package/dist/esm/integration/interfaces/configuration-source.interface.js.map +1 -0
  89. package/dist/esm/integration/interfaces/index.js +10 -0
  90. package/dist/esm/integration/interfaces/index.js.map +1 -0
  91. package/dist/esm/integration/interfaces/integration-options.interface.js +2 -0
  92. package/dist/esm/integration/interfaces/integration-options.interface.js.map +1 -0
  93. package/dist/esm/integration/interfaces/integration-state.interface.js +2 -0
  94. package/dist/esm/integration/interfaces/integration-state.interface.js.map +1 -0
  95. package/dist/esm/integration/interfaces/nestjs-config-compatibility.interface.js +64 -0
  96. package/dist/esm/integration/interfaces/nestjs-config-compatibility.interface.js.map +1 -0
  97. package/dist/esm/integration/interfaces/nestjs-config-integration.interface.js +2 -0
  98. package/dist/esm/integration/interfaces/nestjs-config-integration.interface.js.map +1 -0
  99. package/dist/esm/integration/interfaces/typed-configuration.interface.js +3 -0
  100. package/dist/esm/integration/interfaces/typed-configuration.interface.js.map +1 -0
  101. package/dist/esm/integration/interfaces/utility-types.interface.js +44 -0
  102. package/dist/esm/integration/interfaces/utility-types.interface.js.map +1 -0
  103. package/dist/esm/integration/nestjs-config-integration.module.js +121 -0
  104. package/dist/esm/integration/nestjs-config-integration.module.js.map +1 -0
  105. package/dist/esm/integration/providers/aws-configuration-loader.service.js +588 -0
  106. package/dist/esm/integration/providers/aws-configuration-loader.service.js.map +1 -0
  107. package/dist/esm/integration/providers/configuration-factory.provider.js +380 -0
  108. package/dist/esm/integration/providers/configuration-factory.provider.js.map +1 -0
  109. package/dist/esm/integration/providers/index.js +4 -0
  110. package/dist/esm/integration/providers/index.js.map +1 -0
  111. package/dist/esm/integration/services/async-config-helper.service.js +353 -0
  112. package/dist/esm/integration/services/async-config-helper.service.js.map +1 -0
  113. package/dist/esm/integration/services/error-handler.service.js +262 -0
  114. package/dist/esm/integration/services/error-handler.service.js.map +1 -0
  115. package/dist/esm/integration/services/factory-registration.service.js +509 -0
  116. package/dist/esm/integration/services/factory-registration.service.js.map +1 -0
  117. package/dist/esm/integration/services/index.js +10 -0
  118. package/dist/esm/integration/services/index.js.map +1 -0
  119. package/dist/esm/integration/services/integration-state.service.js +80 -0
  120. package/dist/esm/integration/services/integration-state.service.js.map +1 -0
  121. package/dist/esm/integration/services/namespace-handler.service.js +464 -0
  122. package/dist/esm/integration/services/namespace-handler.service.js.map +1 -0
  123. package/dist/esm/integration/services/nestjs-config-integration.service.js +313 -0
  124. package/dist/esm/integration/services/nestjs-config-integration.service.js.map +1 -0
  125. package/dist/esm/integration/services/precedence-handler.service.js +291 -0
  126. package/dist/esm/integration/services/precedence-handler.service.js.map +1 -0
  127. package/dist/esm/integration/services/validation-integration.service.js +585 -0
  128. package/dist/esm/integration/services/validation-integration.service.js.map +1 -0
  129. package/dist/esm/integration/utils/config-integration.util.js +240 -0
  130. package/dist/esm/integration/utils/config-integration.util.js.map +1 -0
  131. package/dist/esm/integration/utils/index.js +3 -0
  132. package/dist/esm/integration/utils/index.js.map +1 -0
  133. package/dist/esm/interfaces/config-loader.interface.js +2 -0
  134. package/dist/esm/interfaces/config-loader.interface.js.map +1 -0
  135. package/dist/esm/interfaces/config-service.interface.js +7 -0
  136. package/dist/esm/interfaces/config-service.interface.js.map +1 -0
  137. package/dist/esm/interfaces/default-schema.interface.js +59 -0
  138. package/dist/esm/interfaces/default-schema.interface.js.map +1 -0
  139. package/dist/esm/interfaces/errors.interface.js +69 -0
  140. package/dist/esm/interfaces/errors.interface.js.map +1 -0
  141. package/dist/esm/interfaces/index.js +9 -0
  142. package/dist/esm/interfaces/index.js.map +1 -0
  143. package/dist/esm/interfaces/module-options.interface.js +2 -0
  144. package/dist/esm/interfaces/module-options.interface.js.map +1 -0
  145. package/dist/esm/loaders/environment.loader.js +55 -0
  146. package/dist/esm/loaders/environment.loader.js.map +1 -0
  147. package/dist/esm/loaders/secrets-manager.loader.js +118 -0
  148. package/dist/esm/loaders/secrets-manager.loader.js.map +1 -0
  149. package/dist/esm/loaders/ssm-parameter-store.loader.js +142 -0
  150. package/dist/esm/loaders/ssm-parameter-store.loader.js.map +1 -0
  151. package/dist/esm/services/config.service.js +261 -0
  152. package/dist/esm/services/config.service.js.map +1 -0
  153. package/dist/esm/utils/validation.util.js +110 -0
  154. package/dist/esm/utils/validation.util.js.map +1 -0
  155. package/dist/types/config.module.d.ts +46 -0
  156. package/dist/types/config.module.d.ts.map +1 -0
  157. package/dist/types/index.d.ts +13 -0
  158. package/dist/types/index.d.ts.map +1 -0
  159. package/dist/types/integration/index.d.ts +6 -0
  160. package/dist/types/integration/index.d.ts.map +1 -0
  161. package/dist/types/integration/interfaces/configuration-factory.interface.d.ts +71 -0
  162. package/dist/types/integration/interfaces/configuration-factory.interface.d.ts.map +1 -0
  163. package/dist/types/integration/interfaces/configuration-source.interface.d.ts +24 -0
  164. package/dist/types/integration/interfaces/configuration-source.interface.d.ts.map +1 -0
  165. package/dist/types/integration/interfaces/index.d.ts +9 -0
  166. package/dist/types/integration/interfaces/index.d.ts.map +1 -0
  167. package/dist/types/integration/interfaces/integration-options.interface.d.ts +66 -0
  168. package/dist/types/integration/interfaces/integration-options.interface.d.ts.map +1 -0
  169. package/dist/types/integration/interfaces/integration-state.interface.d.ts +17 -0
  170. package/dist/types/integration/interfaces/integration-state.interface.d.ts.map +1 -0
  171. package/dist/types/integration/interfaces/nestjs-config-compatibility.interface.d.ts +332 -0
  172. package/dist/types/integration/interfaces/nestjs-config-compatibility.interface.d.ts.map +1 -0
  173. package/dist/types/integration/interfaces/nestjs-config-integration.interface.d.ts +259 -0
  174. package/dist/types/integration/interfaces/nestjs-config-integration.interface.d.ts.map +1 -0
  175. package/dist/types/integration/interfaces/typed-configuration.interface.d.ts +209 -0
  176. package/dist/types/integration/interfaces/typed-configuration.interface.d.ts.map +1 -0
  177. package/dist/types/integration/interfaces/utility-types.interface.d.ts +249 -0
  178. package/dist/types/integration/interfaces/utility-types.interface.d.ts.map +1 -0
  179. package/dist/types/integration/nestjs-config-integration.module.d.ts +36 -0
  180. package/dist/types/integration/nestjs-config-integration.module.d.ts.map +1 -0
  181. package/dist/types/integration/providers/aws-configuration-loader.service.d.ts +134 -0
  182. package/dist/types/integration/providers/aws-configuration-loader.service.d.ts.map +1 -0
  183. package/dist/types/integration/providers/configuration-factory.provider.d.ts +119 -0
  184. package/dist/types/integration/providers/configuration-factory.provider.d.ts.map +1 -0
  185. package/dist/types/integration/providers/index.d.ts +3 -0
  186. package/dist/types/integration/providers/index.d.ts.map +1 -0
  187. package/dist/types/integration/services/async-config-helper.service.d.ts +84 -0
  188. package/dist/types/integration/services/async-config-helper.service.d.ts.map +1 -0
  189. package/dist/types/integration/services/error-handler.service.d.ts +84 -0
  190. package/dist/types/integration/services/error-handler.service.d.ts.map +1 -0
  191. package/dist/types/integration/services/factory-registration.service.d.ts +158 -0
  192. package/dist/types/integration/services/factory-registration.service.d.ts.map +1 -0
  193. package/dist/types/integration/services/index.d.ts +9 -0
  194. package/dist/types/integration/services/index.d.ts.map +1 -0
  195. package/dist/types/integration/services/integration-state.service.d.ts +41 -0
  196. package/dist/types/integration/services/integration-state.service.d.ts.map +1 -0
  197. package/dist/types/integration/services/namespace-handler.service.d.ts +192 -0
  198. package/dist/types/integration/services/namespace-handler.service.d.ts.map +1 -0
  199. package/dist/types/integration/services/nestjs-config-integration.service.d.ts +87 -0
  200. package/dist/types/integration/services/nestjs-config-integration.service.d.ts.map +1 -0
  201. package/dist/types/integration/services/precedence-handler.service.d.ts +103 -0
  202. package/dist/types/integration/services/precedence-handler.service.d.ts.map +1 -0
  203. package/dist/types/integration/services/validation-integration.service.d.ts +222 -0
  204. package/dist/types/integration/services/validation-integration.service.d.ts.map +1 -0
  205. package/dist/types/integration/utils/config-integration.util.d.ts +81 -0
  206. package/dist/types/integration/utils/config-integration.util.d.ts.map +1 -0
  207. package/dist/types/integration/utils/index.d.ts +2 -0
  208. package/dist/types/integration/utils/index.d.ts.map +1 -0
  209. package/dist/types/interfaces/config-loader.interface.d.ts +22 -0
  210. package/dist/types/interfaces/config-loader.interface.d.ts.map +1 -0
  211. package/dist/types/interfaces/config-service.interface.d.ts +23 -0
  212. package/dist/types/interfaces/config-service.interface.d.ts.map +1 -0
  213. package/dist/types/interfaces/default-schema.interface.d.ts +195 -0
  214. package/dist/types/interfaces/default-schema.interface.d.ts.map +1 -0
  215. package/dist/types/interfaces/errors.interface.d.ts +38 -0
  216. package/dist/types/interfaces/errors.interface.d.ts.map +1 -0
  217. package/dist/types/interfaces/index.d.ts +6 -0
  218. package/dist/types/interfaces/index.d.ts.map +1 -0
  219. package/dist/types/interfaces/module-options.interface.d.ts +64 -0
  220. package/dist/types/interfaces/module-options.interface.d.ts.map +1 -0
  221. package/dist/types/loaders/environment.loader.d.ts +26 -0
  222. package/dist/types/loaders/environment.loader.d.ts.map +1 -0
  223. package/dist/types/loaders/secrets-manager.loader.d.ts +52 -0
  224. package/dist/types/loaders/secrets-manager.loader.d.ts.map +1 -0
  225. package/dist/types/loaders/ssm-parameter-store.loader.d.ts +68 -0
  226. package/dist/types/loaders/ssm-parameter-store.loader.d.ts.map +1 -0
  227. package/dist/types/services/config.service.d.ts +94 -0
  228. package/dist/types/services/config.service.d.ts.map +1 -0
  229. package/dist/types/utils/validation.util.d.ts +53 -0
  230. package/dist/types/utils/validation.util.d.ts.map +1 -0
  231. package/package.json +102 -0
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var ConfigModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ConfigModule = exports.NEST_CONFIG_AWS_OPTIONS = void 0;
11
+ const common_1 = require("@nestjs/common");
12
+ const config_service_interface_1 = require("./interfaces/config-service.interface");
13
+ const default_schema_interface_1 = require("./interfaces/default-schema.interface");
14
+ const config_service_1 = require("./services/config.service");
15
+ const environment_loader_1 = require("./loaders/environment.loader");
16
+ const secrets_manager_loader_1 = require("./loaders/secrets-manager.loader");
17
+ const ssm_parameter_store_loader_1 = require("./loaders/ssm-parameter-store.loader");
18
+ /**
19
+ * Token for injecting module options
20
+ */
21
+ exports.NEST_CONFIG_AWS_OPTIONS = 'NEST_CONFIG_AWS_OPTIONS';
22
+ /**
23
+ * NestJS module for AWS-integrated configuration management.
24
+ * Provides global configuration service with support for environment variables,
25
+ * AWS Secrets Manager, and AWS Systems Manager Parameter Store.
26
+ */
27
+ let ConfigModule = ConfigModule_1 = class ConfigModule {
28
+ /**
29
+ * Create a synchronous configuration module with provided options.
30
+ *
31
+ * @param options - Configuration options for the module
32
+ * @returns Dynamic module configuration
33
+ */
34
+ static forRoot(options = {}) {
35
+ const configServiceProvider = this.createConfigServiceProvider(options);
36
+ return {
37
+ module: ConfigModule_1,
38
+ providers: [
39
+ {
40
+ provide: exports.NEST_CONFIG_AWS_OPTIONS,
41
+ useValue: options,
42
+ },
43
+ configServiceProvider,
44
+ ],
45
+ exports: [config_service_interface_1.ConfigService],
46
+ global: true,
47
+ };
48
+ }
49
+ /**
50
+ * Create an asynchronous configuration module with factory-based options.
51
+ * Useful when configuration options depend on other services or async operations.
52
+ *
53
+ * @param options - Async configuration options with factory function
54
+ * @returns Dynamic module configuration
55
+ */
56
+ static forRootAsync(options) {
57
+ const asyncProviders = this.createAsyncProviders(options);
58
+ return {
59
+ module: ConfigModule_1,
60
+ imports: options.imports || [],
61
+ providers: [
62
+ ...asyncProviders,
63
+ this.createAsyncConfigServiceProvider(),
64
+ ],
65
+ exports: [config_service_interface_1.ConfigService],
66
+ global: true,
67
+ };
68
+ }
69
+ /**
70
+ * Create the ConfigService provider for synchronous module registration.
71
+ */
72
+ static createConfigServiceProvider(options) {
73
+ return {
74
+ provide: config_service_interface_1.ConfigService,
75
+ useFactory: async () => {
76
+ // Create loaders based on configuration
77
+ const loaders = this.createLoaders(options);
78
+ // Create ConfigService options
79
+ const serviceOptions = {
80
+ schema: options.schema || default_schema_interface_1.defaultConfigSchema,
81
+ loaders,
82
+ envPrefix: options.envPrefix,
83
+ validateOnLoad: !options.ignoreValidationErrors,
84
+ enableLogging: true,
85
+ };
86
+ // Create and initialize the service
87
+ const configService = new config_service_1.ConfigServiceImpl(serviceOptions);
88
+ // Initialize configuration loading if not in sync mode
89
+ if (!options.loadSync) {
90
+ await configService.initialize();
91
+ }
92
+ return configService;
93
+ },
94
+ };
95
+ }
96
+ /**
97
+ * Create providers for asynchronous module registration.
98
+ */
99
+ static createAsyncProviders(options) {
100
+ return [
101
+ {
102
+ provide: exports.NEST_CONFIG_AWS_OPTIONS,
103
+ useFactory: options.useFactory,
104
+ inject: options.inject || [],
105
+ },
106
+ ];
107
+ }
108
+ /**
109
+ * Create the ConfigService provider for asynchronous module registration.
110
+ */
111
+ static createAsyncConfigServiceProvider() {
112
+ return {
113
+ provide: config_service_interface_1.ConfigService,
114
+ useFactory: async (options) => {
115
+ // Create loaders based on configuration
116
+ const loaders = this.createLoaders(options);
117
+ // Create ConfigService options
118
+ const serviceOptions = {
119
+ schema: options.schema || default_schema_interface_1.defaultConfigSchema,
120
+ loaders,
121
+ envPrefix: options.envPrefix,
122
+ validateOnLoad: !options.ignoreValidationErrors,
123
+ enableLogging: true,
124
+ };
125
+ // Create and initialize the service
126
+ const configService = new config_service_1.ConfigServiceImpl(serviceOptions);
127
+ // Initialize configuration loading if not in sync mode
128
+ if (!options.loadSync) {
129
+ await configService.initialize();
130
+ }
131
+ return configService;
132
+ },
133
+ inject: [exports.NEST_CONFIG_AWS_OPTIONS],
134
+ };
135
+ }
136
+ /**
137
+ * Create configuration loaders based on module options.
138
+ */
139
+ static createLoaders(options) {
140
+ const loaders = [];
141
+ // Always add environment loader first (lowest precedence)
142
+ loaders.push(new environment_loader_1.EnvironmentLoader(options.envPrefix));
143
+ // Add Secrets Manager loader if enabled
144
+ if (options.secretsManagerConfig?.enabled !== false) {
145
+ const secretsConfig = {
146
+ region: options.secretsManagerConfig?.region,
147
+ // Map paths to environment mapping if provided
148
+ environmentMapping: options.secretsManagerConfig?.paths ? {
149
+ development: options.secretsManagerConfig.paths.development || 'dev',
150
+ test: options.secretsManagerConfig.paths.test || 'test',
151
+ production: options.secretsManagerConfig.paths.production || 'production',
152
+ } : undefined,
153
+ };
154
+ loaders.push(new secrets_manager_loader_1.SecretsManagerLoader(secretsConfig));
155
+ }
156
+ // Add SSM Parameter Store loader if enabled
157
+ if (options.ssmConfig?.enabled !== false) {
158
+ const ssmConfig = {
159
+ region: options.ssmConfig?.region,
160
+ withDecryption: options.ssmConfig?.decrypt,
161
+ // Map paths to environment mapping if provided
162
+ environmentMapping: options.ssmConfig?.paths ? {
163
+ development: options.ssmConfig.paths.development || 'dev',
164
+ test: options.ssmConfig.paths.test || 'test',
165
+ production: options.ssmConfig.paths.production || 'production',
166
+ } : undefined,
167
+ };
168
+ loaders.push(new ssm_parameter_store_loader_1.SSMParameterStoreLoader(ssmConfig));
169
+ }
170
+ return loaders;
171
+ }
172
+ };
173
+ exports.ConfigModule = ConfigModule;
174
+ exports.ConfigModule = ConfigModule = ConfigModule_1 = __decorate([
175
+ (0, common_1.Global)(),
176
+ (0, common_1.Module)({})
177
+ ], ConfigModule);
178
+ //# sourceMappingURL=config.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../src/config.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AAEzE,oFAAsE;AAEtE,oFAAiG;AACjG,8DAAoF;AACpF,qEAAiE;AACjE,6EAAwE;AACxE,qFAA+E;AAG/E;;GAEG;AACU,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE;;;;GAIG;AAGI,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,UAAyC,EAAE;QAE3C,MAAM,qBAAqB,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;QAExE,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,+BAAuB;oBAChC,QAAQ,EAAE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AA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CA8KxB"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ // Main entry point for nestjs-config-aws package
3
+ // This file will export all public interfaces and classes
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.NestConfigAwsIntegrationModule = exports.createTypeSafeConfigFactory = exports.TransformConfig = exports.ValidateConfig = exports.ConfigClass = exports.ConfigProperty = exports.InjectEnhancedConfig = exports.isCacheEntry = exports.isValidationResult = exports.hasMetadata = exports.isLocalSource = exports.isAwsSource = void 0;
20
+ __exportStar(require("./config.module"), exports);
21
+ __exportStar(require("./interfaces"), exports);
22
+ __exportStar(require("./loaders/environment.loader"), exports);
23
+ __exportStar(require("./loaders/secrets-manager.loader"), exports);
24
+ __exportStar(require("./loaders/ssm-parameter-store.loader"), exports);
25
+ __exportStar(require("./services/config.service"), exports);
26
+ __exportStar(require("./utils/validation.util"), exports);
27
+ // Integration module exports for @nestjs/config compatibility
28
+ __exportStar(require("./integration"), exports);
29
+ // Utility functions
30
+ var utility_types_interface_1 = require("./integration/interfaces/utility-types.interface");
31
+ Object.defineProperty(exports, "isAwsSource", { enumerable: true, get: function () { return utility_types_interface_1.isAwsSource; } });
32
+ Object.defineProperty(exports, "isLocalSource", { enumerable: true, get: function () { return utility_types_interface_1.isLocalSource; } });
33
+ Object.defineProperty(exports, "hasMetadata", { enumerable: true, get: function () { return utility_types_interface_1.hasMetadata; } });
34
+ Object.defineProperty(exports, "isValidationResult", { enumerable: true, get: function () { return utility_types_interface_1.isValidationResult; } });
35
+ Object.defineProperty(exports, "isCacheEntry", { enumerable: true, get: function () { return utility_types_interface_1.isCacheEntry; } });
36
+ // Decorators and utility functions
37
+ var nestjs_config_compatibility_interface_1 = require("./integration/interfaces/nestjs-config-compatibility.interface");
38
+ Object.defineProperty(exports, "InjectEnhancedConfig", { enumerable: true, get: function () { return nestjs_config_compatibility_interface_1.InjectEnhancedConfig; } });
39
+ Object.defineProperty(exports, "ConfigProperty", { enumerable: true, get: function () { return nestjs_config_compatibility_interface_1.ConfigProperty; } });
40
+ Object.defineProperty(exports, "ConfigClass", { enumerable: true, get: function () { return nestjs_config_compatibility_interface_1.ConfigClass; } });
41
+ Object.defineProperty(exports, "ValidateConfig", { enumerable: true, get: function () { return nestjs_config_compatibility_interface_1.ValidateConfig; } });
42
+ Object.defineProperty(exports, "TransformConfig", { enumerable: true, get: function () { return nestjs_config_compatibility_interface_1.TransformConfig; } });
43
+ Object.defineProperty(exports, "createTypeSafeConfigFactory", { enumerable: true, get: function () { return nestjs_config_compatibility_interface_1.createTypeSafeConfigFactory; } });
44
+ // Explicit exports for better discoverability
45
+ var nestjs_config_integration_module_1 = require("./integration/nestjs-config-integration.module");
46
+ Object.defineProperty(exports, "NestConfigAwsIntegrationModule", { enumerable: true, get: function () { return nestjs_config_integration_module_1.NestConfigAwsIntegrationModule; } });
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,0DAA0D;;;;;;;;;;;;;;;;;AAE1D,kDAAgC;AAChC,+CAA6B;AAC7B,+DAA6C;AAC7C,mEAAiD;AACjD,uEAAqD;AACrD,4DAA0C;AAC1C,0DAAwC;AAExC,8DAA8D;AAC9D,gDAA8B;AAE9B,oBAAoB;AACpB,4FAM0D;AALxD,sHAAA,WAAW,OAAA;AACX,wHAAA,aAAa,OAAA;AACb,sHAAA,WAAW,OAAA;AACX,6HAAA,kBAAkB,OAAA;AAClB,uHAAA,YAAY,OAAA;AAGd,mCAAmC;AACnC,wHAOwE;AANtE,6IAAA,oBAAoB,OAAA;AACpB,uIAAA,cAAc,OAAA;AACd,oIAAA,WAAW,OAAA;AACX,uIAAA,cAAc,OAAA;AACd,wIAAA,eAAe,OAAA;AACf,oJAAA,2BAA2B,OAAA;AAG7B,8CAA8C;AAC9C,mGAAgG;AAAvF,kJAAA,8BAA8B,OAAA"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Integration module exports
18
+ __exportStar(require("./interfaces"), exports);
19
+ __exportStar(require("./nestjs-config-integration.module"), exports);
20
+ __exportStar(require("./providers"), exports);
21
+ __exportStar(require("./services"), exports);
22
+ __exportStar(require("./utils"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,+CAA6B;AAC7B,qEAAmD;AACnD,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=configuration-factory.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-factory.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/configuration-factory.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=configuration-source.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-source.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/configuration-source.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Integration interfaces exports
18
+ __exportStar(require("./integration-options.interface"), exports);
19
+ __exportStar(require("./configuration-factory.interface"), exports);
20
+ __exportStar(require("./configuration-source.interface"), exports);
21
+ __exportStar(require("./integration-state.interface"), exports);
22
+ __exportStar(require("./typed-configuration.interface"), exports);
23
+ __exportStar(require("./nestjs-config-integration.interface"), exports);
24
+ __exportStar(require("./nestjs-config-compatibility.interface"), exports);
25
+ __exportStar(require("./utility-types.interface"), exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,kEAAgD;AAChD,oEAAkD;AAClD,mEAAiD;AACjD,gEAA8C;AAC9C,kEAAgD;AAChD,wEAAsD;AACtD,0EAAwD;AACxD,4DAA0C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=integration-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-options.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/integration-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=integration-state.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-state.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/integration-state.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InjectEnhancedConfig = void 0;
4
+ exports.ConfigProperty = ConfigProperty;
5
+ exports.ConfigClass = ConfigClass;
6
+ exports.ValidateConfig = ValidateConfig;
7
+ exports.TransformConfig = TransformConfig;
8
+ exports.createTypeSafeConfigFactory = createTypeSafeConfigFactory;
9
+ const config_1 = require("@nestjs/config");
10
+ /**
11
+ * Decorator for injecting enhanced config service.
12
+ */
13
+ const InjectEnhancedConfig = () => {
14
+ return (_target, _propertyKey, _parameterIndex) => {
15
+ // Implementation would be handled by the actual decorator
16
+ };
17
+ };
18
+ exports.InjectEnhancedConfig = InjectEnhancedConfig;
19
+ /**
20
+ * Configuration property decorator.
21
+ */
22
+ function ConfigProperty(options) {
23
+ return function (target, propertyKey) {
24
+ // Store metadata for the property
25
+ Reflect.defineMetadata('config:property', options, target, propertyKey);
26
+ };
27
+ }
28
+ /**
29
+ * Configuration class decorator.
30
+ */
31
+ function ConfigClass(options) {
32
+ return function (target) {
33
+ // Store metadata for the class
34
+ Reflect.defineMetadata('config:class', options || {}, target);
35
+ return target;
36
+ };
37
+ }
38
+ /**
39
+ * Configuration validation decorator.
40
+ */
41
+ function ValidateConfig(options) {
42
+ return function (target) {
43
+ // Store validation metadata
44
+ Reflect.defineMetadata('config:validation', options, target);
45
+ return target;
46
+ };
47
+ }
48
+ /**
49
+ * Configuration transformer decorator.
50
+ */
51
+ function TransformConfig(transformer) {
52
+ return function (target, propertyKey) {
53
+ // Store transformer metadata
54
+ Reflect.defineMetadata('config:transformer', transformer, target, propertyKey);
55
+ };
56
+ }
57
+ /**
58
+ * Create a type-safe configuration factory.
59
+ */
60
+ function createTypeSafeConfigFactory(key, factory) {
61
+ const configFactory = () => {
62
+ const configService = new config_1.ConfigService();
63
+ return factory(configService);
64
+ };
65
+ configFactory.KEY = key;
66
+ configFactory.asProvider = () => ({
67
+ provide: key,
68
+ useFactory: factory,
69
+ inject: [config_1.ConfigService],
70
+ });
71
+ return configFactory;
72
+ }
73
+ //# sourceMappingURL=nestjs-config-compatibility.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs-config-compatibility.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/nestjs-config-compatibility.interface.ts"],"names":[],"mappings":";;;AAoJA,wCAKC;AAiBD,kCAMC;AAiBD,wCAMC;AAkBD,0CAOC;AAkBD,kEAeC;AAjQD,2CAA+C;AAsH/C;;GAEG;AACI,MAAM,oBAAoB,GAAG,GAAuB,EAAE;IAC3D,OAAO,CAAC,OAAY,EAAE,YAAyC,EAAE,eAAuB,EAAE,EAAE;QAC1F,0DAA0D;IAC5D,CAAC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B;AAoBF;;G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AE,CAAC,sBAAa,CAAC;KACxB,CAAC,CAAC;IACH,OAAO,aAAyC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=nestjs-config-integration.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs-config-integration.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/nestjs-config-integration.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Type definitions for typed configuration access
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=typed-configuration.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-configuration.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/typed-configuration.interface.ts"],"names":[],"mappings":";AAAA,kDAAkD"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * Utility types for enhanced TypeScript support in nest-config-aws integration.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isCacheEntry = exports.isValidationResult = exports.hasMetadata = exports.isLocalSource = exports.isAwsSource = void 0;
7
+ /**
8
+ * Type guard for AWS configuration sources.
9
+ */
10
+ const isAwsSource = (source) => {
11
+ return source === 'secrets-manager' || source === 'ssm';
12
+ };
13
+ exports.isAwsSource = isAwsSource;
14
+ /**
15
+ * Type guard for local configuration sources.
16
+ */
17
+ const isLocalSource = (source) => {
18
+ return source === 'environment' || source === 'local-file';
19
+ };
20
+ exports.isLocalSource = isLocalSource;
21
+ /**
22
+ * Type guard for configuration with metadata.
23
+ */
24
+ const hasMetadata = (config) => {
25
+ return config && typeof config === 'object' && '__metadata' in config;
26
+ };
27
+ exports.hasMetadata = hasMetadata;
28
+ /**
29
+ * Type guard for validation result.
30
+ */
31
+ const isValidationResult = (result) => {
32
+ return (result &&
33
+ typeof result === 'object' &&
34
+ 'isValid' in result &&
35
+ typeof result.isValid === 'boolean' &&
36
+ 'errors' in result &&
37
+ Array.isArray(result.errors));
38
+ };
39
+ exports.isValidationResult = isValidationResult;
40
+ /**
41
+ * Type guard for cache entry.
42
+ */
43
+ const isCacheEntry = (entry) => {
44
+ return (entry &&
45
+ typeof entry === 'object' &&
46
+ 'key' in entry &&
47
+ 'value' in entry &&
48
+ 'timestamp' in entry &&
49
+ entry.timestamp instanceof Date);
50
+ };
51
+ exports.isCacheEntry = isCacheEntry;
52
+ //# sourceMappingURL=utility-types.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility-types.interface.js","sourceRoot":"","sources":["../../../../src/integration/interfaces/utility-types.interface.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAmSH;;GAEG;AACI,MAAM,WAAW,GAAG,CAAC,MAAuB,EAA6B,EAAE;IAChF,OAAO,MAAM,KAAK,iBAAiB,IAAI,MAAM,KAAK,KAAK,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB;AAEF;;GAEG;AACI,MAAM,aAAa,GAAG,CAAC,MAAuB,EAA+B,EAAE;IACpF,OAAO,MAAM,KAAK,aAAa,IAAI,MAAM,KAAK,YAAY,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEF;;GAEG;AACI,MAAM,WAAW,GAAG,CACzB,MAAW,EACuB,EAAE;IACpC,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,YAAY,IAAI,MAAM,CAAC;AACxE,CAAC,CAAC;AAJW,QAAA,WAAW,eAItB;AAEF;;GAEG;AACI,MAAM,kBAAkB,GAAG,CAAI,MAAW,EAAiC,EAAE;IAClF,OAAO,CACL,MAAM;QACN,OAAO,MAAM,KAAK,QAAQ;QAC1B,SAAS,IAAI,MAAM;QACnB,OAAO,MAAM,CAAC,OAAO,KAAK,SAAS;QACnC,QAAQ,IAAI,MAAM;QAClB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAC7B,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B;AAEF;;GAEG;AACI,MAAM,YAAY,GAAG,CAAI,KAAU,EAA0B,EAAE;IACpE,OAAO,CACL,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,IAAI,KAAK;QACd,OAAO,IAAI,KAAK;QAChB,WAAW,IAAI,KAAK;QACpB,KAAK,CAAC,SAAS,YAAY,IAAI,CAChC,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,YAAY,gBASvB"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var NestConfigAwsIntegrationModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.NestConfigAwsIntegrationModule = exports.NESTJS_CONFIG_AWS_INTEGRATION_OPTIONS = void 0;
11
+ const common_1 = require("@nestjs/common");
12
+ const configuration_factory_provider_1 = require("./providers/configuration-factory.provider");
13
+ const aws_configuration_loader_service_1 = require("./providers/aws-configuration-loader.service");
14
+ const integration_state_service_1 = require("./services/integration-state.service");
15
+ const factory_registration_service_1 = require("./services/factory-registration.service");
16
+ const nestjs_config_integration_service_1 = require("./services/nestjs-config-integration.service");
17
+ const precedence_handler_service_1 = require("./services/precedence-handler.service");
18
+ const async_config_helper_service_1 = require("./services/async-config-helper.service");
19
+ const namespace_handler_service_1 = require("./services/namespace-handler.service");
20
+ const validation_integration_service_1 = require("./services/validation-integration.service");
21
+ /**
22
+ * Token for injecting integration options
23
+ */
24
+ exports.NESTJS_CONFIG_AWS_INTEGRATION_OPTIONS = 'NESTJS_CONFIG_AWS_INTEGRATION_OPTIONS';
25
+ /**
26
+ * NestJS module for integrating nestjs-config-aws with @nestjs/config.
27
+ * This module provides AWS-sourced configuration values to the standard @nestjs/config module.
28
+ */
29
+ let NestConfigAwsIntegrationModule = NestConfigAwsIntegrationModule_1 = class NestConfigAwsIntegrationModule {
30
+ /**
31
+ * Create a synchronous integration module with provided options.
32
+ *
33
+ * @param options - Integration options for the module
34
+ * @returns Dynamic module configuration
35
+ */
36
+ static forRoot(options = {}) {
37
+ const providers = this.createProviders(options);
38
+ return {
39
+ module: NestConfigAwsIntegrationModule_1,
40
+ providers: [
41
+ {
42
+ provide: exports.NESTJS_CONFIG_AWS_INTEGRATION_OPTIONS,
43
+ useValue: options,
44
+ },
45
+ ...providers,
46
+ ],
47
+ exports: [
48
+ configuration_factory_provider_1.ConfigurationFactoryProviderImpl,
49
+ aws_configuration_loader_service_1.AwsConfigurationLoaderService,
50
+ integration_state_service_1.IntegrationStateService,
51
+ factory_registration_service_1.FactoryRegistrationService,
52
+ nestjs_config_integration_service_1.NestjsConfigIntegrationService,
53
+ async_config_helper_service_1.AsyncConfigHelperService,
54
+ namespace_handler_service_1.NamespaceHandlerService,
55
+ validation_integration_service_1.ValidationIntegrationService,
56
+ ],
57
+ global: options.registerGlobally !== false,
58
+ };
59
+ }
60
+ /**
61
+ * Create an asynchronous integration module with factory-based options.
62
+ * Useful when integration options depend on other services or async operations.
63
+ *
64
+ * @param options - Async integration options with factory function
65
+ * @returns Dynamic module configuration
66
+ */
67
+ static forRootAsync(options) {
68
+ const asyncProviders = this.createAsyncProviders(options);
69
+ const providers = this.createProviders();
70
+ return {
71
+ module: NestConfigAwsIntegrationModule_1,
72
+ imports: options.imports || [],
73
+ providers: [
74
+ ...asyncProviders,
75
+ ...providers,
76
+ ],
77
+ exports: [
78
+ configuration_factory_provider_1.ConfigurationFactoryProviderImpl,
79
+ aws_configuration_loader_service_1.AwsConfigurationLoaderService,
80
+ integration_state_service_1.IntegrationStateService,
81
+ factory_registration_service_1.FactoryRegistrationService,
82
+ nestjs_config_integration_service_1.NestjsConfigIntegrationService,
83
+ async_config_helper_service_1.AsyncConfigHelperService,
84
+ namespace_handler_service_1.NamespaceHandlerService,
85
+ validation_integration_service_1.ValidationIntegrationService,
86
+ ],
87
+ global: true, // Default to global for async modules
88
+ };
89
+ }
90
+ /**
91
+ * Create the standard providers for the integration module.
92
+ */
93
+ static createProviders(_options) {
94
+ return [
95
+ configuration_factory_provider_1.ConfigurationFactoryProviderImpl,
96
+ aws_configuration_loader_service_1.AwsConfigurationLoaderService,
97
+ integration_state_service_1.IntegrationStateService,
98
+ precedence_handler_service_1.PrecedenceHandlerService,
99
+ factory_registration_service_1.FactoryRegistrationService,
100
+ nestjs_config_integration_service_1.NestjsConfigIntegrationService,
101
+ async_config_helper_service_1.AsyncConfigHelperService,
102
+ namespace_handler_service_1.NamespaceHandlerService,
103
+ validation_integration_service_1.ValidationIntegrationService,
104
+ ];
105
+ }
106
+ /**
107
+ * Create providers for asynchronous module registration.
108
+ */
109
+ static createAsyncProviders(options) {
110
+ return [
111
+ {
112
+ provide: exports.NESTJS_CONFIG_AWS_INTEGRATION_OPTIONS,
113
+ useFactory: options.useFactory,
114
+ inject: options.inject || [],
115
+ },
116
+ ];
117
+ }
118
+ };
119
+ exports.NestConfigAwsIntegrationModule = NestConfigAwsIntegrationModule;
120
+ exports.NestConfigAwsIntegrationModule = NestConfigAwsIntegrationModule = NestConfigAwsIntegrationModule_1 = __decorate([
121
+ (0, common_1.Global)(),
122
+ (0, common_1.Module)({})
123
+ ], NestConfigAwsIntegrationModule);
124
+ //# sourceMappingURL=nestjs-config-integration.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestjs-config-integration.module.js","sourceRoot":"","sources":["../../../src/integration/nestjs-config-integration.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AAEz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