@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,103 @@
|
|
|
1
|
+
import { ConfigurationSource } from '../interfaces/configuration-source.interface';
|
|
2
|
+
import { PrecedenceRule } from '../interfaces/integration-options.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Service responsible for handling configuration precedence rules and merging strategies.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PrecedenceHandlerService {
|
|
7
|
+
private readonly logger;
|
|
8
|
+
/**
|
|
9
|
+
* Apply precedence rules to merge configuration from multiple sources.
|
|
10
|
+
* @param sources - Array of configuration sources
|
|
11
|
+
* @param precedenceRule - The precedence rule to apply
|
|
12
|
+
* @returns Merged configuration data
|
|
13
|
+
*/
|
|
14
|
+
applyPrecedenceRules(sources: ConfigurationSource[], precedenceRule: PrecedenceRule): Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Apply AWS-first precedence: AWS sources override local sources.
|
|
17
|
+
* Priority order: AWS Secrets Manager > SSM Parameter Store > Environment > Local Files
|
|
18
|
+
* @param sources - Configuration sources
|
|
19
|
+
* @returns Merged configuration
|
|
20
|
+
*/
|
|
21
|
+
private applyAwsFirstPrecedence;
|
|
22
|
+
/**
|
|
23
|
+
* Apply local-first precedence: Local sources override AWS sources.
|
|
24
|
+
* Priority order: Local Files > Environment > SSM Parameter Store > AWS Secrets Manager
|
|
25
|
+
* @param sources - Configuration sources
|
|
26
|
+
* @returns Merged configuration
|
|
27
|
+
*/
|
|
28
|
+
private applyLocalFirstPrecedence;
|
|
29
|
+
/**
|
|
30
|
+
* Apply merge precedence: Intelligent merging based on source type and priority.
|
|
31
|
+
* Uses a balanced approach where both AWS and local sources contribute.
|
|
32
|
+
* @param sources - Configuration sources
|
|
33
|
+
* @returns Merged configuration
|
|
34
|
+
*/
|
|
35
|
+
private applyMergePrecedence;
|
|
36
|
+
/**
|
|
37
|
+
* Sort sources by AWS-first priority.
|
|
38
|
+
* @param sources - Configuration sources
|
|
39
|
+
* @returns Sorted sources (lowest priority first, highest priority last)
|
|
40
|
+
*/
|
|
41
|
+
private sortSourcesByAwsFirstPriority;
|
|
42
|
+
/**
|
|
43
|
+
* Sort sources by local-first priority.
|
|
44
|
+
* @param sources - Configuration sources
|
|
45
|
+
* @returns Sorted sources (lowest priority first, highest priority last)
|
|
46
|
+
*/
|
|
47
|
+
private sortSourcesByLocalFirstPriority;
|
|
48
|
+
/**
|
|
49
|
+
* Group sources by their type.
|
|
50
|
+
* @param sources - Configuration sources
|
|
51
|
+
* @returns Sources grouped by type
|
|
52
|
+
*/
|
|
53
|
+
private groupSourcesByType;
|
|
54
|
+
/**
|
|
55
|
+
* Merge sources in the given order (later sources override earlier ones).
|
|
56
|
+
* @param sources - Ordered configuration sources
|
|
57
|
+
* @returns Merged configuration
|
|
58
|
+
*/
|
|
59
|
+
private mergeSourcesInOrder;
|
|
60
|
+
/**
|
|
61
|
+
* Merge groups with balanced priority for merge precedence.
|
|
62
|
+
* @param groups - Configuration groups by type
|
|
63
|
+
* @returns Merged configuration
|
|
64
|
+
*/
|
|
65
|
+
private mergeGroupsWithBalancedPriority;
|
|
66
|
+
/**
|
|
67
|
+
* Deep merge two configuration objects with conflict resolution.
|
|
68
|
+
* @param target - Target object (lower priority)
|
|
69
|
+
* @param source - Source object (higher priority)
|
|
70
|
+
* @returns Merged object
|
|
71
|
+
*/
|
|
72
|
+
private deepMerge;
|
|
73
|
+
/**
|
|
74
|
+
* Determine if two values should be deep merged.
|
|
75
|
+
* @param target - Target value
|
|
76
|
+
* @param source - Source value
|
|
77
|
+
* @returns True if should deep merge, false otherwise
|
|
78
|
+
*/
|
|
79
|
+
private shouldDeepMerge;
|
|
80
|
+
/**
|
|
81
|
+
* Clone a value to avoid reference issues.
|
|
82
|
+
* @param value - Value to clone
|
|
83
|
+
* @returns Cloned value
|
|
84
|
+
*/
|
|
85
|
+
private cloneValue;
|
|
86
|
+
/**
|
|
87
|
+
* Validate configuration sources for precedence handling.
|
|
88
|
+
* @param sources - Configuration sources to validate
|
|
89
|
+
* @returns Validation result with any issues found
|
|
90
|
+
*/
|
|
91
|
+
validateSources(sources: ConfigurationSource[]): {
|
|
92
|
+
valid: boolean;
|
|
93
|
+
issues: string[];
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Get the effective priority for a source based on precedence rule.
|
|
97
|
+
* @param source - Configuration source
|
|
98
|
+
* @param precedenceRule - Precedence rule
|
|
99
|
+
* @returns Effective priority
|
|
100
|
+
*/
|
|
101
|
+
getEffectivePriority(source: ConfigurationSource, precedenceRule: PrecedenceRule): number;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=precedence-handler.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"precedence-handler.service.d.ts","sourceRoot":"","sources":["../../../../src/integration/services/precedence-handler.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E;;GAEG;AACH,qBACa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;IAEpE;;;;;OAKG;IACH,oBAAoB,CAClB,OAAO,EAAE,mBAAmB,EAAE,EAC9B,cAAc,EAAE,cAAc,GAC7B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAwBtB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAO/B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAOjC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAmB5B;;;;OAIG;IACH,OAAO,CAAC,6BAA6B;IAqBrC;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;IAqBvC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAkB1B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;IAgBvC;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAcjB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IASvB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAiBlB;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE;IAwCrF;;;;;OAKG;IACH,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM;CAsB1F"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { ConfigFactory } from '@nestjs/config';
|
|
2
|
+
import { ConfigurationSource } from '../interfaces/configuration-source.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for validation schema providers.
|
|
5
|
+
*/
|
|
6
|
+
export interface ValidationSchemaProvider {
|
|
7
|
+
name: string;
|
|
8
|
+
validate(config: any, schema: any): {
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
errors: string[];
|
|
11
|
+
};
|
|
12
|
+
isAvailable(): boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Joi validation schema provider.
|
|
16
|
+
*/
|
|
17
|
+
export declare class JoiValidationProvider implements ValidationSchemaProvider {
|
|
18
|
+
name: string;
|
|
19
|
+
private joi;
|
|
20
|
+
constructor();
|
|
21
|
+
isAvailable(): boolean;
|
|
22
|
+
validate(config: any, schema: any): {
|
|
23
|
+
isValid: boolean;
|
|
24
|
+
errors: string[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Class-validator validation schema provider.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ClassValidatorProvider implements ValidationSchemaProvider {
|
|
31
|
+
name: string;
|
|
32
|
+
private classValidator;
|
|
33
|
+
private classTransformer;
|
|
34
|
+
constructor();
|
|
35
|
+
isAvailable(): boolean;
|
|
36
|
+
validate(config: any, schemaClass: any): {
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
errors: string[];
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Custom validation function provider.
|
|
43
|
+
*/
|
|
44
|
+
export declare class CustomValidationProvider implements ValidationSchemaProvider {
|
|
45
|
+
name: string;
|
|
46
|
+
isAvailable(): boolean;
|
|
47
|
+
validate(config: any, validationFn: (config: any) => string[] | void): {
|
|
48
|
+
isValid: boolean;
|
|
49
|
+
errors: string[];
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Service for integrating AWS-sourced configuration with @nestjs/config validation.
|
|
54
|
+
* Supports Joi, class-validator, and custom validation functions.
|
|
55
|
+
*/
|
|
56
|
+
export declare class ValidationIntegrationService {
|
|
57
|
+
private readonly logger;
|
|
58
|
+
private readonly validationProviders;
|
|
59
|
+
constructor();
|
|
60
|
+
/**
|
|
61
|
+
* Create a validated configuration factory.
|
|
62
|
+
* This factory will validate AWS-sourced configuration before returning it.
|
|
63
|
+
*
|
|
64
|
+
* @param namespace - Optional namespace for the configuration
|
|
65
|
+
* @param config - Configuration data to validate
|
|
66
|
+
* @param validationSchema - Validation schema (Joi schema, class-validator class, or custom function)
|
|
67
|
+
* @param validationType - Type of validation ('joi', 'class-validator', or 'custom')
|
|
68
|
+
* @param sources - Configuration sources metadata
|
|
69
|
+
* @returns Validated configuration factory
|
|
70
|
+
*/
|
|
71
|
+
createValidatedFactory(namespace: string | undefined, config: Record<string, any>, validationSchema: any, validationType: 'joi' | 'class-validator' | 'custom', sources?: ConfigurationSource[]): ConfigFactory;
|
|
72
|
+
/**
|
|
73
|
+
* Validate configuration using the specified validation type and schema.
|
|
74
|
+
*
|
|
75
|
+
* @param config - Configuration to validate
|
|
76
|
+
* @param schema - Validation schema
|
|
77
|
+
* @param validationType - Type of validation
|
|
78
|
+
* @param sources - Configuration sources for error reporting
|
|
79
|
+
* @returns Validation result
|
|
80
|
+
*/
|
|
81
|
+
validateConfiguration(config: Record<string, any>, schema: any, validationType: 'joi' | 'class-validator' | 'custom', sources?: ConfigurationSource[]): {
|
|
82
|
+
isValid: boolean;
|
|
83
|
+
errors: string[];
|
|
84
|
+
warnings: string[];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Create a factory that validates configuration and provides fallback values.
|
|
88
|
+
*
|
|
89
|
+
* @param namespace - Optional namespace
|
|
90
|
+
* @param config - Configuration data
|
|
91
|
+
* @param validationSchema - Validation schema
|
|
92
|
+
* @param validationType - Type of validation
|
|
93
|
+
* @param fallbackConfig - Fallback configuration to use if validation fails
|
|
94
|
+
* @param sources - Configuration sources
|
|
95
|
+
* @returns Factory with validation and fallback
|
|
96
|
+
*/
|
|
97
|
+
createValidatedFactoryWithFallback(namespace: string | undefined, config: Record<string, any>, validationSchema: any, validationType: 'joi' | 'class-validator' | 'custom', fallbackConfig: Record<string, any>, sources?: ConfigurationSource[]): ConfigFactory;
|
|
98
|
+
/**
|
|
99
|
+
* Validate multiple namespace configurations.
|
|
100
|
+
*
|
|
101
|
+
* @param namespacedConfig - Configuration organized by namespace
|
|
102
|
+
* @param validationSchemas - Validation schemas for each namespace
|
|
103
|
+
* @param validationType - Type of validation
|
|
104
|
+
* @param sources - Configuration sources
|
|
105
|
+
* @returns Validation results for each namespace
|
|
106
|
+
*/
|
|
107
|
+
validateNamespacedConfiguration(namespacedConfig: Record<string, Record<string, any>>, validationSchemas: Record<string, any>, validationType: 'joi' | 'class-validator' | 'custom', sources?: ConfigurationSource[]): Record<string, {
|
|
108
|
+
isValid: boolean;
|
|
109
|
+
errors: string[];
|
|
110
|
+
warnings: string[];
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Check which validation providers are available.
|
|
114
|
+
*
|
|
115
|
+
* @returns Object indicating availability of each provider
|
|
116
|
+
*/
|
|
117
|
+
getAvailableValidationProviders(): Record<string, boolean>;
|
|
118
|
+
/**
|
|
119
|
+
* Get validation recommendations based on configuration structure.
|
|
120
|
+
*
|
|
121
|
+
* @param config - Configuration to analyze
|
|
122
|
+
* @returns Validation recommendations
|
|
123
|
+
*/
|
|
124
|
+
getValidationRecommendations(config: Record<string, any>): {
|
|
125
|
+
recommendedProvider: string;
|
|
126
|
+
reasons: string[];
|
|
127
|
+
examples: Record<string, string>;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Register validation providers.
|
|
131
|
+
*/
|
|
132
|
+
private registerValidationProviders;
|
|
133
|
+
/**
|
|
134
|
+
* Create a detailed validation error with source information.
|
|
135
|
+
*
|
|
136
|
+
* @param namespace - Namespace that failed validation
|
|
137
|
+
* @param errors - Validation errors
|
|
138
|
+
* @param sources - Configuration sources
|
|
139
|
+
* @returns Detailed error
|
|
140
|
+
*/
|
|
141
|
+
private createValidationError;
|
|
142
|
+
/**
|
|
143
|
+
* Enhance error message with source information.
|
|
144
|
+
*
|
|
145
|
+
* @param error - Original error message
|
|
146
|
+
* @param sources - Configuration sources
|
|
147
|
+
* @returns Enhanced error message
|
|
148
|
+
*/
|
|
149
|
+
private enhanceErrorWithSourceInfo;
|
|
150
|
+
/**
|
|
151
|
+
* Analyze configuration structure for validation recommendations.
|
|
152
|
+
*
|
|
153
|
+
* @param config - Configuration to analyze
|
|
154
|
+
* @returns Structure analysis
|
|
155
|
+
*/
|
|
156
|
+
private analyzeConfigurationStructure;
|
|
157
|
+
/**
|
|
158
|
+
* Generate Joi validation example.
|
|
159
|
+
*
|
|
160
|
+
* @param config - Configuration to generate example for
|
|
161
|
+
* @returns Joi validation example
|
|
162
|
+
*/
|
|
163
|
+
private generateJoiExample;
|
|
164
|
+
/**
|
|
165
|
+
* Generate class-validator example.
|
|
166
|
+
*
|
|
167
|
+
* @param config - Configuration to generate example for
|
|
168
|
+
* @returns class-validator example
|
|
169
|
+
*/
|
|
170
|
+
private generateClassValidatorExample;
|
|
171
|
+
/**
|
|
172
|
+
* Generate custom validation example.
|
|
173
|
+
*
|
|
174
|
+
* @param config - Configuration to generate example for
|
|
175
|
+
* @returns Custom validation example
|
|
176
|
+
*/
|
|
177
|
+
private generateCustomValidationExample;
|
|
178
|
+
/**
|
|
179
|
+
* Generate Joi schema from configuration structure.
|
|
180
|
+
*
|
|
181
|
+
* @param config - Configuration object
|
|
182
|
+
* @returns Joi schema string
|
|
183
|
+
*/
|
|
184
|
+
private generateJoiSchemaFromConfig;
|
|
185
|
+
/**
|
|
186
|
+
* Generate class definition from configuration structure.
|
|
187
|
+
*
|
|
188
|
+
* @param config - Configuration object
|
|
189
|
+
* @returns Class definition string
|
|
190
|
+
*/
|
|
191
|
+
private generateClassFromConfig;
|
|
192
|
+
/**
|
|
193
|
+
* Generate validation checks for custom validation.
|
|
194
|
+
*
|
|
195
|
+
* @param config - Configuration object
|
|
196
|
+
* @returns Validation checks string
|
|
197
|
+
*/
|
|
198
|
+
private generateValidationChecks;
|
|
199
|
+
/**
|
|
200
|
+
* Get class-validator decorator for a value.
|
|
201
|
+
*
|
|
202
|
+
* @param value - Value to get decorator for
|
|
203
|
+
* @returns Decorator string
|
|
204
|
+
*/
|
|
205
|
+
private getClassValidatorDecorator;
|
|
206
|
+
/**
|
|
207
|
+
* Get TypeScript type for a value.
|
|
208
|
+
*
|
|
209
|
+
* @param value - Value to get type for
|
|
210
|
+
* @returns TypeScript type string
|
|
211
|
+
*/
|
|
212
|
+
private getTypeScriptType;
|
|
213
|
+
/**
|
|
214
|
+
* Get validation check for custom validation.
|
|
215
|
+
*
|
|
216
|
+
* @param key - Configuration key
|
|
217
|
+
* @param value - Configuration value
|
|
218
|
+
* @returns Validation check string
|
|
219
|
+
*/
|
|
220
|
+
private getValidationCheck;
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=validation-integration.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-integration.service.d.ts","sourceRoot":"","sources":["../../../../src/integration/services/validation-integration.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ConfigFactory, ConfigModuleOptions } from '@nestjs/config';
|
|
2
|
+
import { DynamicModule } from '@nestjs/common';
|
|
3
|
+
import { IntegrationOptions } from '../interfaces/integration-options.interface';
|
|
4
|
+
/**
|
|
5
|
+
* Utility functions for integrating nestjs-config-aws with @nestjs/config.
|
|
6
|
+
* These functions provide convenient ways to set up AWS configuration integration.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Create a configuration factory that loads from AWS sources.
|
|
10
|
+
* This factory can be used directly in @nestjs/config's load array.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Integration options for AWS configuration
|
|
13
|
+
* @returns Promise resolving to configuration factory
|
|
14
|
+
*/
|
|
15
|
+
export declare function createAwsConfigFactory(options?: IntegrationOptions): Promise<ConfigFactory>;
|
|
16
|
+
/**
|
|
17
|
+
* Create configuration factories for specific namespaces.
|
|
18
|
+
* This function creates separate factories for each namespace.
|
|
19
|
+
*
|
|
20
|
+
* @param namespaces - Array of namespace names
|
|
21
|
+
* @param options - Integration options for AWS configuration
|
|
22
|
+
* @returns Promise resolving to array of namespaced configuration factories
|
|
23
|
+
*/
|
|
24
|
+
export declare function createAwsNamespacedFactories(namespaces: string[], options?: IntegrationOptions): Promise<ConfigFactory[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Create enhanced ConfigModule options with AWS integration.
|
|
27
|
+
* This function enhances existing ConfigModule options with AWS-sourced configuration.
|
|
28
|
+
*
|
|
29
|
+
* @param baseOptions - Base ConfigModule options to enhance
|
|
30
|
+
* @param integrationOptions - Integration options for AWS configuration
|
|
31
|
+
* @returns Promise resolving to enhanced ConfigModule options
|
|
32
|
+
*/
|
|
33
|
+
export declare function createEnhancedConfigOptions(baseOptions?: ConfigModuleOptions, integrationOptions?: IntegrationOptions): Promise<ConfigModuleOptions>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a complete integration module for use with @nestjs/config.
|
|
36
|
+
* This function returns a module that can be imported alongside ConfigModule.
|
|
37
|
+
*
|
|
38
|
+
* @param options - Integration options for AWS configuration
|
|
39
|
+
* @returns Dynamic module for AWS integration
|
|
40
|
+
*/
|
|
41
|
+
export declare function createAwsIntegrationModule(options?: IntegrationOptions): DynamicModule;
|
|
42
|
+
/**
|
|
43
|
+
* Create an async integration module for use with @nestjs/config.
|
|
44
|
+
* This function returns a module that can be imported alongside ConfigModule for async scenarios.
|
|
45
|
+
*
|
|
46
|
+
* @param useFactory - Factory function to create integration options
|
|
47
|
+
* @param inject - Dependencies to inject into the factory function
|
|
48
|
+
* @param imports - Modules to import for the factory function
|
|
49
|
+
* @returns Dynamic module for async AWS integration
|
|
50
|
+
*/
|
|
51
|
+
export declare function createAsyncAwsIntegrationModule(useFactory: (...args: any[]) => Promise<IntegrationOptions> | IntegrationOptions, inject?: any[], imports?: any[]): DynamicModule;
|
|
52
|
+
/**
|
|
53
|
+
* Create a factory function that can be used with ConfigModule.forRoot().
|
|
54
|
+
* This factory function loads AWS configuration and merges it with local configuration.
|
|
55
|
+
*
|
|
56
|
+
* @param integrationOptions - Integration options for AWS configuration
|
|
57
|
+
* @returns Factory function for use with ConfigModule
|
|
58
|
+
*/
|
|
59
|
+
export declare function createConfigModuleFactory(integrationOptions?: IntegrationOptions): () => Promise<ConfigModuleOptions>;
|
|
60
|
+
/**
|
|
61
|
+
* Create a factory function with dependency injection support.
|
|
62
|
+
* This factory function can receive injected dependencies and use them to configure AWS integration.
|
|
63
|
+
*
|
|
64
|
+
* @param integrationOptions - Integration options for AWS configuration
|
|
65
|
+
* @param dependencies - Array of dependency tokens to inject
|
|
66
|
+
* @returns Factory function with dependency injection support
|
|
67
|
+
*/
|
|
68
|
+
export declare function createConfigModuleFactoryWithDependencies(integrationOptions?: IntegrationOptions, dependencies?: any[]): (...args: any[]) => Promise<ConfigModuleOptions>;
|
|
69
|
+
/**
|
|
70
|
+
* Check if AWS configuration is available for integration.
|
|
71
|
+
* This function can be used to determine if AWS integration should be enabled.
|
|
72
|
+
*
|
|
73
|
+
* @param options - Integration options for AWS configuration
|
|
74
|
+
* @returns Promise resolving to availability status
|
|
75
|
+
*/
|
|
76
|
+
export declare function checkAwsConfigAvailability(options?: IntegrationOptions): Promise<{
|
|
77
|
+
isAvailable: boolean;
|
|
78
|
+
factoriesCount: number;
|
|
79
|
+
errors: string[];
|
|
80
|
+
}>;
|
|
81
|
+
//# sourceMappingURL=config-integration.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-integration.util.d.ts","sourceRoot":"","sources":["../../../../src/integration/utils/config-integration.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF;;;GAGG;AAEH;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC,CA2BrG;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,aAAa,EAAE,CAAC,CA2B1B;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,GAAE,mBAAwB,EACrC,kBAAkB,GAAE,kBAAuB,GAC1C,OAAO,CAAC,mBAAmB,CAAC,CA2B9B;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,kBAAuB,GAAG,aAAa,CAE1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,EAChF,MAAM,GAAE,GAAG,EAAO,EAClB,OAAO,GAAE,GAAG,EAAO,GAClB,aAAa,CAMf;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,kBAAkB,GAAE,kBAAuB,GAC1C,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAgCpC;AAED;;;;;;;GAOG;AACH,wBAAgB,yCAAyC,CACvD,kBAAkB,GAAE,kBAAuB,EAC3C,YAAY,GAAE,GAAG,EAAO,GACvB,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAmDlD;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC;IACT,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC,CAqCD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integration/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for configuration source abstraction.
|
|
3
|
+
* Allows different configuration sources (env vars, AWS services) to be loaded uniformly.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfigLoader {
|
|
6
|
+
/**
|
|
7
|
+
* Load configuration from the source.
|
|
8
|
+
* @returns Promise resolving to a record of configuration key-value pairs
|
|
9
|
+
*/
|
|
10
|
+
load(): Promise<Record<string, any>>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the name of this configuration loader for logging and debugging.
|
|
13
|
+
* @returns The loader name
|
|
14
|
+
*/
|
|
15
|
+
getName(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Check if this loader is available in the current environment.
|
|
18
|
+
* @returns True if the loader can be used
|
|
19
|
+
*/
|
|
20
|
+
isAvailable(): Promise<boolean>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=config-loader.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-loader.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/config-loader.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAErC;;;OAGG;IACH,OAAO,IAAI,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract ConfigService interface for dependency injection.
|
|
3
|
+
* Provides type-safe access to configuration values with generic type support.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class ConfigService<T = any> {
|
|
6
|
+
/**
|
|
7
|
+
* Get a configuration value by key with type safety.
|
|
8
|
+
* @param key - The configuration key to retrieve
|
|
9
|
+
* @returns The configuration value with proper typing
|
|
10
|
+
*/
|
|
11
|
+
abstract get<K extends keyof T>(key: K): T[K];
|
|
12
|
+
/**
|
|
13
|
+
* Check if the configuration service has been initialized.
|
|
14
|
+
* @returns True if the service is ready to serve configuration values
|
|
15
|
+
*/
|
|
16
|
+
abstract isInitialized(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Get all configuration values.
|
|
19
|
+
* @returns The complete configuration object
|
|
20
|
+
*/
|
|
21
|
+
abstract getAll(): T;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=config-service.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-service.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/config-service.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,8BAAsB,aAAa,CAAC,CAAC,GAAG,GAAG;IACzC;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAE7C;;;OAGG;IACH,QAAQ,CAAC,aAAa,IAAI,OAAO;IAEjC;;;OAGG;IACH,QAAQ,CAAC,MAAM,IAAI,CAAC;CACrB"}
|