@elsikora/nestjs-typeorm-aws-connector 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +102 -101
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/external/tslib/tslib.es6.js +43 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/external/tslib/tslib.es6.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/aws/parameter-store/parameter-store.service.js +49 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/aws/parameter-store/parameter-store.service.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.module.js +89 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.module.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.service.js +62 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.service.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/constant/config/constant.js +22 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/constant/config/constant.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/environment.enum.js +20 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/environment.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/instance-name.enum.js +11 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/instance-name.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/service.enum.js +224 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/service.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/config-parameters.provider.js +33 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/config-parameters.provider.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/properties.provider.js +18 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/properties.provider.js.map +1 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/ssm-client.provider.js +19 -0
- package/dist/cjs/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/ssm-client.provider.js.map +1 -0
- package/dist/cjs/external/tslib/tslib.es6.js +43 -0
- package/dist/cjs/external/tslib/tslib.es6.js.map +1 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/modules/typeorm-aws-connector/index.d.ts +3 -0
- package/dist/cjs/modules/typeorm-aws-connector/rotator/index.d.ts +1 -0
- package/dist/cjs/modules/typeorm-aws-connector/rotator/rotator.service.d.ts +22 -0
- package/dist/cjs/modules/typeorm-aws-connector/rotator/rotator.service.js +172 -0
- package/dist/cjs/modules/typeorm-aws-connector/rotator/rotator.service.js.map +1 -0
- package/dist/cjs/modules/typeorm-aws-connector/typeorm-aws-connector.module.d.ts +7 -0
- package/dist/cjs/modules/typeorm-aws-connector/typeorm-aws-connector.module.js +60 -0
- package/dist/cjs/modules/typeorm-aws-connector/typeorm-aws-connector.module.js.map +1 -0
- package/dist/cjs/modules/typeorm-aws-connector/typeorm-aws-connector.service.d.ts +14 -0
- package/dist/cjs/modules/typeorm-aws-connector/typeorm-aws-connector.service.js +79 -0
- package/dist/cjs/modules/typeorm-aws-connector/typeorm-aws-connector.service.js.map +1 -0
- package/dist/cjs/package.json +8 -0
- package/dist/cjs/shared/constant/typeorm-aws-connector/constant.d.ts +11 -0
- package/dist/cjs/shared/constant/typeorm-aws-connector/constant.js +27 -0
- package/dist/cjs/shared/constant/typeorm-aws-connector/constant.js.map +1 -0
- package/dist/cjs/shared/constant/typeorm-aws-connector/index.d.ts +1 -0
- package/dist/cjs/shared/enum/database/index.d.ts +1 -0
- package/dist/cjs/shared/enum/database/type.enum.js +8 -0
- package/dist/cjs/shared/enum/database/type.enum.js.map +1 -0
- package/dist/cjs/shared/enum/index.d.ts +2 -0
- package/dist/cjs/shared/enum/relation-load-strategy.enum.js +8 -0
- package/dist/cjs/shared/enum/relation-load-strategy.enum.js.map +1 -0
- package/dist/cjs/shared/interface/aws/secrets-manager/index.d.ts +1 -0
- package/dist/cjs/shared/interface/typeorm-aws-connector/config.interface.d.ts +25 -0
- package/dist/cjs/shared/interface/typeorm-aws-connector/index.d.ts +2 -0
- package/dist/cjs/shared/interface/typeorm-aws-connector/module-async-options.interface.d.ts +6 -0
- package/dist/cjs/shared/provider/typeorm-aws-connector/database.provider.d.ts +8 -0
- package/dist/cjs/shared/provider/typeorm-aws-connector/database.provider.js +18 -0
- package/dist/cjs/shared/provider/typeorm-aws-connector/database.provider.js.map +1 -0
- package/dist/cjs/shared/provider/typeorm-aws-connector/index.d.ts +1 -0
- package/dist/{shared → cjs/shared}/type/database/config-rotation.type.d.ts +4 -4
- package/dist/cjs/shared/type/database/index.d.ts +1 -0
- package/dist/cjs/shared/type/typeorm-aws-connector/index.d.ts +1 -0
- package/dist/cjs/shared/type/typeorm-aws-connector/module-options.type.d.ts +2 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/external/tslib/tslib.es6.js +39 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/external/tslib/tslib.es6.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/aws/parameter-store/parameter-store.service.js +49 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/aws/parameter-store/parameter-store.service.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.module.js +89 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.module.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.service.js +62 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.service.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/constant/config/constant.js +18 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/constant/config/constant.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/environment.enum.js +20 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/environment.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/instance-name.enum.js +11 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/instance-name.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/service.enum.js +224 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/service.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/config-parameters.provider.js +31 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/config-parameters.provider.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/properties.provider.js +16 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/properties.provider.js.map +1 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/ssm-client.provider.js +17 -0
- package/dist/esm/external/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/provider/config/ssm-client.provider.js.map +1 -0
- package/dist/esm/external/tslib/tslib.es6.js +39 -0
- package/dist/esm/external/tslib/tslib.es6.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/modules/typeorm-aws-connector/index.d.ts +3 -0
- package/dist/esm/modules/typeorm-aws-connector/rotator/index.d.ts +1 -0
- package/dist/esm/modules/typeorm-aws-connector/rotator/rotator.service.d.ts +22 -0
- package/dist/esm/modules/typeorm-aws-connector/rotator/rotator.service.js +172 -0
- package/dist/esm/modules/typeorm-aws-connector/rotator/rotator.service.js.map +1 -0
- package/dist/esm/modules/typeorm-aws-connector/typeorm-aws-connector.module.d.ts +7 -0
- package/dist/esm/modules/typeorm-aws-connector/typeorm-aws-connector.module.js +60 -0
- package/dist/esm/modules/typeorm-aws-connector/typeorm-aws-connector.module.js.map +1 -0
- package/dist/esm/modules/typeorm-aws-connector/typeorm-aws-connector.service.d.ts +14 -0
- package/dist/esm/modules/typeorm-aws-connector/typeorm-aws-connector.service.js +79 -0
- package/dist/esm/modules/typeorm-aws-connector/typeorm-aws-connector.service.js.map +1 -0
- package/dist/esm/package.json +8 -0
- package/dist/esm/shared/constant/typeorm-aws-connector/constant.d.ts +11 -0
- package/dist/esm/shared/constant/typeorm-aws-connector/constant.js +23 -0
- package/dist/esm/shared/constant/typeorm-aws-connector/constant.js.map +1 -0
- package/dist/esm/shared/constant/typeorm-aws-connector/index.d.ts +1 -0
- package/dist/esm/shared/enum/database/index.d.ts +1 -0
- package/dist/esm/shared/enum/database/type.enum.d.ts +4 -0
- package/dist/esm/shared/enum/database/type.enum.js +8 -0
- package/dist/esm/shared/enum/database/type.enum.js.map +1 -0
- package/dist/esm/shared/enum/index.d.ts +2 -0
- package/dist/esm/shared/enum/relation-load-strategy.enum.d.ts +4 -0
- package/dist/esm/shared/enum/relation-load-strategy.enum.js +8 -0
- package/dist/esm/shared/enum/relation-load-strategy.enum.js.map +1 -0
- package/dist/esm/shared/interface/aws/secrets-manager/index.d.ts +1 -0
- package/dist/esm/shared/interface/aws/secrets-manager/item.interface.d.ts +4 -0
- package/dist/esm/shared/interface/typeorm-aws-connector/config.interface.d.ts +25 -0
- package/dist/esm/shared/interface/typeorm-aws-connector/index.d.ts +2 -0
- package/dist/esm/shared/interface/typeorm-aws-connector/module-async-options.interface.d.ts +6 -0
- package/dist/esm/shared/provider/typeorm-aws-connector/database.provider.d.ts +8 -0
- package/dist/esm/shared/provider/typeorm-aws-connector/database.provider.js +15 -0
- package/dist/esm/shared/provider/typeorm-aws-connector/database.provider.js.map +1 -0
- package/dist/esm/shared/provider/typeorm-aws-connector/index.d.ts +1 -0
- package/dist/esm/shared/type/database/config-rotation.type.d.ts +6 -0
- package/dist/esm/shared/type/database/index.d.ts +1 -0
- package/dist/esm/shared/type/typeorm-aws-connector/index.d.ts +1 -0
- package/dist/esm/shared/type/typeorm-aws-connector/module-options.type.d.ts +2 -0
- package/package.json +99 -93
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/modules/typeorm-aws-connector/index.d.ts +0 -3
- package/dist/modules/typeorm-aws-connector/index.js +0 -20
- package/dist/modules/typeorm-aws-connector/index.js.map +0 -1
- package/dist/modules/typeorm-aws-connector/rotator/rotator.service.d.ts +0 -13
- package/dist/modules/typeorm-aws-connector/rotator/rotator.service.js +0 -62
- package/dist/modules/typeorm-aws-connector/rotator/rotator.service.js.map +0 -1
- package/dist/modules/typeorm-aws-connector/typeorm-aws-connector.module.d.ts +0 -7
- package/dist/modules/typeorm-aws-connector/typeorm-aws-connector.module.js +0 -63
- package/dist/modules/typeorm-aws-connector/typeorm-aws-connector.module.js.map +0 -1
- package/dist/modules/typeorm-aws-connector/typeorm-aws-connector.service.d.ts +0 -29
- package/dist/modules/typeorm-aws-connector/typeorm-aws-connector.service.js +0 -73
- package/dist/modules/typeorm-aws-connector/typeorm-aws-connector.service.js.map +0 -1
- package/dist/shared/constant/typeorm-aws-connector/constant.d.ts +0 -11
- package/dist/shared/constant/typeorm-aws-connector/constant.js +0 -21
- package/dist/shared/constant/typeorm-aws-connector/constant.js.map +0 -1
- package/dist/shared/enum/database/type.enum.js +0 -9
- package/dist/shared/enum/database/type.enum.js.map +0 -1
- package/dist/shared/enum/relation-load-strategy.enum.js +0 -9
- package/dist/shared/enum/relation-load-strategy.enum.js.map +0 -1
- package/dist/shared/interface/aws/secrets-manager/item.interface.js +0 -3
- package/dist/shared/interface/aws/secrets-manager/item.interface.js.map +0 -1
- package/dist/shared/interface/typeorm-aws-connector/config.interface.d.ts +0 -17
- package/dist/shared/interface/typeorm-aws-connector/config.interface.js +0 -3
- package/dist/shared/interface/typeorm-aws-connector/config.interface.js.map +0 -1
- package/dist/shared/interface/typeorm-aws-connector/module-async-options.interface.d.ts +0 -7
- package/dist/shared/interface/typeorm-aws-connector/module-async-options.interface.js +0 -3
- package/dist/shared/interface/typeorm-aws-connector/module-async-options.interface.js.map +0 -1
- package/dist/shared/interface/typeorm-aws-connector/module-options.interface.d.ts +0 -2
- package/dist/shared/interface/typeorm-aws-connector/module-options.interface.js +0 -3
- package/dist/shared/interface/typeorm-aws-connector/module-options.interface.js.map +0 -1
- package/dist/shared/provider/typeorm-aws-connector/database.provider.d.ts +0 -4
- package/dist/shared/provider/typeorm-aws-connector/database.provider.js +0 -13
- package/dist/shared/provider/typeorm-aws-connector/database.provider.js.map +0 -1
- package/dist/shared/type/database/config-rotation.type.js +0 -3
- package/dist/shared/type/database/config-rotation.type.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/{shared → cjs/shared}/enum/database/type.enum.d.ts +0 -0
- package/dist/{shared → cjs/shared}/enum/relation-load-strategy.enum.d.ts +0 -0
- package/dist/{shared → cjs/shared}/interface/aws/secrets-manager/item.interface.d.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 ElsiKora
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -39,33 +39,33 @@ Example of both modules working together:
|
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
@Module({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
imports: [
|
|
43
|
+
// First, configure Parameter Store
|
|
44
|
+
ParameterStoreConfigModule.registerAsync({
|
|
45
|
+
imports: [ConfigModule],
|
|
46
|
+
inject: [ConfigService],
|
|
47
|
+
useFactory: (config: ConfigService) => ({
|
|
48
|
+
application: config.get<string>("APPLICATION"),
|
|
49
|
+
config: {
|
|
50
|
+
region: config.get<string>("AWS_REGION"),
|
|
51
|
+
},
|
|
52
|
+
decryptParameters: true,
|
|
53
|
+
environment: config.get<string>("ENVIRONMENT"),
|
|
54
|
+
recursiveLoading: true,
|
|
55
|
+
}),
|
|
56
|
+
}),
|
|
57
|
+
// Then, configure Database module
|
|
58
|
+
TypeOrmAwsConnectorModule.registerAsync({
|
|
59
|
+
imports: [ConfigModule],
|
|
60
|
+
inject: [ConfigService],
|
|
61
|
+
useFactory: async () => ({
|
|
62
|
+
connectionTimeoutMs: 30_000,
|
|
63
|
+
databaseName: "app",
|
|
64
|
+
entities: [Bank],
|
|
65
|
+
// ... other options
|
|
66
|
+
}),
|
|
67
|
+
}),
|
|
68
|
+
],
|
|
69
69
|
})
|
|
70
70
|
export class AppModule {}
|
|
71
71
|
```
|
|
@@ -78,16 +78,16 @@ NestJS-TypeORM-AWS-Connector is a powerful integration module that provides seam
|
|
|
78
78
|
|
|
79
79
|
## Features
|
|
80
80
|
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
| 🔄
|
|
84
|
-
| 🏊
|
|
85
|
-
| ⚡️ | **Performance**
|
|
86
|
-
| 🔧
|
|
87
|
-
| 🎯
|
|
88
|
-
| 📊
|
|
89
|
-
| 🔍
|
|
90
|
-
| 🔄
|
|
81
|
+
| | Feature | Description |
|
|
82
|
+
| --- | ----------------------- | -------------------------------------------------------------------------------------------------- |
|
|
83
|
+
| 🔄 | **Connection Rotation** | Automatic connection rotation to prevent stale connections and ensure optimal database performance |
|
|
84
|
+
| 🏊 | **Connection Pooling** | Configurable connection pool with customizable size and timeout settings |
|
|
85
|
+
| ⚡️ | **Performance** | Optimized database connections with configurable timeouts and idle connection management |
|
|
86
|
+
| 🔧 | **Easy Configuration** | Flexible configuration options through both static and async module registration |
|
|
87
|
+
| 🎯 | **Type Safety** | Full TypeScript support with strong typing for all configuration options |
|
|
88
|
+
| 📊 | **Multiple Databases** | Support for different database types (PostgreSQL, MySQL, etc.) through EDatabaseType enum |
|
|
89
|
+
| 🔍 | **Verbose Logging** | Optional verbose mode for detailed logging of database operations |
|
|
90
|
+
| 🔄 | **Auto-Sync Schema** | Optional automatic schema synchronization with database |
|
|
91
91
|
|
|
92
92
|
## Installation
|
|
93
93
|
|
|
@@ -100,30 +100,30 @@ npm install @elsikora/nestjs-typeorm-aws-connector
|
|
|
100
100
|
### Async Configuration
|
|
101
101
|
|
|
102
102
|
```typescript
|
|
103
|
-
import { TypeOrmAwsConnectorModule, EDatabaseType } from
|
|
103
|
+
import { TypeOrmAwsConnectorModule, EDatabaseType } from "@elsikora/nestjs-typeorm-aws-connector";
|
|
104
104
|
|
|
105
105
|
@Module({
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
106
|
+
imports: [
|
|
107
|
+
TypeOrmAwsConnectorModule.registerAsync({
|
|
108
|
+
imports: [ConfigModule],
|
|
109
|
+
inject: [ConfigService],
|
|
110
|
+
useFactory: async () => ({
|
|
111
|
+
connectionTimeoutMs: 30_000,
|
|
112
|
+
databaseName: "app",
|
|
113
|
+
entities: [Bank],
|
|
114
|
+
idleTimeoutMs: 30_000,
|
|
115
|
+
isVerbose: true,
|
|
116
|
+
poolSize: 10,
|
|
117
|
+
port: 5432,
|
|
118
|
+
rotation: {
|
|
119
|
+
intervalMs: 5000,
|
|
120
|
+
isEnabled: true,
|
|
121
|
+
},
|
|
122
|
+
shouldSynchronize: true,
|
|
123
|
+
type: EDatabaseType.POSTGRES,
|
|
124
|
+
}),
|
|
125
|
+
}),
|
|
126
|
+
],
|
|
127
127
|
})
|
|
128
128
|
export class AppModule {}
|
|
129
129
|
```
|
|
@@ -131,49 +131,48 @@ export class AppModule {}
|
|
|
131
131
|
### Static Configuration
|
|
132
132
|
|
|
133
133
|
```typescript
|
|
134
|
-
import {TypeOrmAwsConnectorModule, EDatabaseType} from
|
|
134
|
+
import { TypeOrmAwsConnectorModule, EDatabaseType } from "@elsikora/nestjs-typeorm-aws-connector";
|
|
135
135
|
|
|
136
136
|
@Module({
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
137
|
+
imports: [
|
|
138
|
+
TypeOrmAwsConnectorModule.register({
|
|
139
|
+
connectionTimeoutMs: 30_000,
|
|
140
|
+
databaseName: "app",
|
|
141
|
+
entities: [Bank],
|
|
142
|
+
idleTimeoutMs: 30_000,
|
|
143
|
+
isVerbose: true,
|
|
144
|
+
poolSize: 10,
|
|
145
|
+
port: 5432,
|
|
146
|
+
rotation: {
|
|
147
|
+
intervalMs: 5000,
|
|
148
|
+
isEnabled: true,
|
|
149
|
+
},
|
|
150
|
+
shouldSynchronize: true,
|
|
151
|
+
type: EDatabaseType.POSTGRES,
|
|
152
|
+
}),
|
|
153
|
+
],
|
|
154
154
|
})
|
|
155
|
-
export class AppModule {
|
|
156
|
-
}
|
|
155
|
+
export class AppModule {}
|
|
157
156
|
```
|
|
158
157
|
|
|
159
158
|
### Integration with TypeORM
|
|
160
159
|
|
|
161
160
|
```typescript
|
|
162
|
-
import { TypeOrmModule } from
|
|
163
|
-
import { TypeOrmAwsConnectorService } from
|
|
161
|
+
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
162
|
+
import { TypeOrmAwsConnectorService } from "@elsikora/nestjs-typeorm-aws-connector";
|
|
164
163
|
|
|
165
164
|
@Module({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
165
|
+
imports: [
|
|
166
|
+
TypeOrmModule.forRootAsync({
|
|
167
|
+
inject: [TypeOrmAwsConnectorService],
|
|
168
|
+
useFactory: async (databaseService: TypeOrmAwsConnectorService) => {
|
|
169
|
+
const options = await databaseService.getTypeOrmOptions();
|
|
170
|
+
return {
|
|
171
|
+
...options,
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
],
|
|
177
176
|
})
|
|
178
177
|
export class AppModule {}
|
|
179
178
|
```
|
|
@@ -181,7 +180,7 @@ export class AppModule {}
|
|
|
181
180
|
## Configuration Options
|
|
182
181
|
|
|
183
182
|
| Option | Type | Required | Default | Description |
|
|
184
|
-
|
|
183
|
+
| -------------------- | --------------------- | -------- | --------------------------- | -------------------------------------------- |
|
|
185
184
|
| type | EDatabaseType | Yes | - | Database type (POSTGRES, MYSQL, etc.) |
|
|
186
185
|
| databaseName | string | Yes | - | Name of the database to connect to |
|
|
187
186
|
| port | number | Yes | - | Database port number |
|
|
@@ -201,8 +200,8 @@ The module supports multiple database types through the `EDatabaseType` enum:
|
|
|
201
200
|
|
|
202
201
|
```typescript
|
|
203
202
|
enum EDatabaseType {
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
POSTGRES = "postgres",
|
|
204
|
+
MYSQL = "mysql",
|
|
206
205
|
}
|
|
207
206
|
```
|
|
208
207
|
|
|
@@ -227,16 +226,18 @@ The module includes built-in error handling for common database connection issue
|
|
|
227
226
|
## Best Practices
|
|
228
227
|
|
|
229
228
|
1. **Connection Pooling**
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
|
|
230
|
+
- Set appropriate `poolSize` based on your application's needs
|
|
231
|
+
- Monitor pool usage in production
|
|
232
232
|
|
|
233
233
|
2. **Connection Rotation**
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
|
|
235
|
+
- Enable rotation for long-running applications
|
|
236
|
+
- Adjust `rotation.intervalMs` based on your workload
|
|
236
237
|
|
|
237
238
|
3. **Timeouts**
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
- Set reasonable `connectionTimeoutMs` and `idleTimeoutMs`
|
|
240
|
+
- Consider your application's specific requirements
|
|
240
241
|
|
|
241
242
|
## Contributing
|
|
242
243
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/******************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function __decorate(decorators, target, key, desc) {
|
|
21
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
22
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
23
|
+
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;
|
|
24
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function __param(paramIndex, decorator) {
|
|
28
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function __metadata(metadataKey, metadataValue) {
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
36
|
+
var e = new Error(message);
|
|
37
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.__decorate = __decorate;
|
|
41
|
+
exports.__metadata = __metadata;
|
|
42
|
+
exports.__param = __param;
|
|
43
|
+
//# sourceMappingURL=tslib.es6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tslib.es6.js","sources":["../../../../../../../../../node_modules/@elsikora/nestjs-aws-parameter-store-config/dist/esm/external/tslib/tslib.es6.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n 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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nexport { __decorate, __metadata, __param };\n//# sourceMappingURL=tslib.es6.js.map\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;AACnD,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACnI,SAAS,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;AACtJ,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAClE,CAAC;AACD;AACA,SAAS,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE;AACxC,IAAI,OAAO,UAAU,MAAM,EAAE,GAAG,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE;AACzE,CAAC;AACD;AACA,SAAS,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE;AAChD,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AACnI,CAAC;AACD;AACA,OAAO,eAAe,KAAK,UAAU,GAAG,eAAe,GAAG,UAAU,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE;AAChG,IAAI,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC/B,IAAI,OAAO,CAAC,CAAC,IAAI,GAAG,iBAAiB,EAAE,CAAC,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC,CAAC;AACrF,CAAC;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('../../../external/tslib/tslib.es6.js');
|
|
4
|
+
var clientSsm = require('@aws-sdk/client-ssm');
|
|
5
|
+
var common = require('@nestjs/common');
|
|
6
|
+
var constant = require('../../../shared/constant/config/constant.js');
|
|
7
|
+
|
|
8
|
+
exports.ParameterStoreService = class ParameterStoreService {
|
|
9
|
+
client;
|
|
10
|
+
constructor(client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves parameters from AWS Parameter Store by the specified path.
|
|
15
|
+
* @param {string} path - The path to the parameters in AWS Parameter Store.
|
|
16
|
+
* @param {boolean} shouldDecryptParameters - Whether to decrypt the parameter values. Default is false.
|
|
17
|
+
* @param {boolean} shouldUseRecursiveLoading - Whether to recursively load parameters under the specified path. Default is false.
|
|
18
|
+
* @param {boolean} isVerbose - Whether to log verbose messages. Default is false.
|
|
19
|
+
* @returns {Promise<Array<Parameter>>} - A promise that resolves to an array of Parameter objects.
|
|
20
|
+
*/
|
|
21
|
+
async getParametersByPath(path, shouldDecryptParameters = false, shouldUseRecursiveLoading = false, isVerbose = false) {
|
|
22
|
+
if (isVerbose)
|
|
23
|
+
common.Logger.verbose(`Getting parameters from path: ${path}`, "ParameterStoreConfig");
|
|
24
|
+
let allParameters = [];
|
|
25
|
+
let nextParametersToken;
|
|
26
|
+
do {
|
|
27
|
+
const getParameters = new clientSsm.GetParametersByPathCommand({
|
|
28
|
+
NextToken: nextParametersToken,
|
|
29
|
+
Path: path,
|
|
30
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
31
|
+
Recursive: shouldUseRecursiveLoading,
|
|
32
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
33
|
+
WithDecryption: shouldDecryptParameters,
|
|
34
|
+
});
|
|
35
|
+
const { NextToken, Parameters = [] } = await this.client.send(getParameters);
|
|
36
|
+
allParameters = [...allParameters, ...Parameters];
|
|
37
|
+
nextParametersToken = NextToken;
|
|
38
|
+
} while (nextParametersToken);
|
|
39
|
+
if (isVerbose)
|
|
40
|
+
common.Logger.verbose(`Found ${String(allParameters.length)} parameters`, "ParameterStoreConfig");
|
|
41
|
+
return allParameters;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.ParameterStoreService = tslib_es6.__decorate([
|
|
45
|
+
common.Injectable(),
|
|
46
|
+
tslib_es6.__param(0, common.Inject(constant.PARAMETER_STORE_SSM_CLIENT)),
|
|
47
|
+
tslib_es6.__metadata("design:paramtypes", [clientSsm.SSMClient])
|
|
48
|
+
], exports.ParameterStoreService);
|
|
49
|
+
//# sourceMappingURL=parameter-store.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter-store.service.js","sources":["../../../../../../../../../../node_modules/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/aws/parameter-store/parameter-store.service.js"],"sourcesContent":["import { __decorate, __param, __metadata } from '../../../external/tslib/tslib.es6.js';\nimport { GetParametersByPathCommand, SSMClient } from '@aws-sdk/client-ssm';\nimport { Injectable, Inject, Logger } from '@nestjs/common';\nimport { PARAMETER_STORE_SSM_CLIENT } from '../../../shared/constant/config/constant.js';\n\nlet ParameterStoreService = class ParameterStoreService {\n client;\n constructor(client) {\n this.client = client;\n }\n /**\n * Retrieves parameters from AWS Parameter Store by the specified path.\n * @param {string} path - The path to the parameters in AWS Parameter Store.\n * @param {boolean} shouldDecryptParameters - Whether to decrypt the parameter values. Default is false.\n * @param {boolean} shouldUseRecursiveLoading - Whether to recursively load parameters under the specified path. Default is false.\n * @param {boolean} isVerbose - Whether to log verbose messages. Default is false.\n * @returns {Promise<Array<Parameter>>} - A promise that resolves to an array of Parameter objects.\n */\n async getParametersByPath(path, shouldDecryptParameters = false, shouldUseRecursiveLoading = false, isVerbose = false) {\n if (isVerbose)\n Logger.verbose(`Getting parameters from path: ${path}`, \"ParameterStoreConfig\");\n let allParameters = [];\n let nextParametersToken;\n do {\n const getParameters = new GetParametersByPathCommand({\n NextToken: nextParametersToken,\n Path: path,\n // eslint-disable-next-line @elsikora/typescript/naming-convention\n Recursive: shouldUseRecursiveLoading,\n // eslint-disable-next-line @elsikora/typescript/naming-convention\n WithDecryption: shouldDecryptParameters,\n });\n const { NextToken, Parameters = [] } = await this.client.send(getParameters);\n allParameters = [...allParameters, ...Parameters];\n nextParametersToken = NextToken;\n } while (nextParametersToken);\n if (isVerbose)\n Logger.verbose(`Found ${String(allParameters.length)} parameters`, \"ParameterStoreConfig\");\n return allParameters;\n }\n};\nParameterStoreService = __decorate([\n Injectable(),\n __param(0, Inject(PARAMETER_STORE_SSM_CLIENT)),\n __metadata(\"design:paramtypes\", [SSMClient])\n], ParameterStoreService);\n\nexport { ParameterStoreService };\n//# sourceMappingURL=parameter-store.service.js.map\n"],"names":["ParameterStoreService","Logger","GetParametersByPathCommand","__decorate","Injectable","__param","Inject","PARAMETER_STORE_SSM_CLIENT","__metadata","SSMClient"],"mappings":";;;;;;;AAKIA,6BAAqB,GAAG,MAAM,qBAAqB,CAAC;AACxD,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,KAAK,EAAE,yBAAyB,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE;AAC3H,QAAQ,IAAI,SAAS;AACrB,YAAYC,aAAM,CAAC,OAAO,CAAC,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAC,EAAE,sBAAsB,CAAC;AAC3F,QAAQ,IAAI,aAAa,GAAG,EAAE;AAC9B,QAAQ,IAAI,mBAAmB;AAC/B,QAAQ,GAAG;AACX,YAAY,MAAM,aAAa,GAAG,IAAIC,oCAA0B,CAAC;AACjE,gBAAgB,SAAS,EAAE,mBAAmB;AAC9C,gBAAgB,IAAI,EAAE,IAAI;AAC1B;AACA,gBAAgB,SAAS,EAAE,yBAAyB;AACpD;AACA,gBAAgB,cAAc,EAAE,uBAAuB;AACvD,aAAa,CAAC;AACd,YAAY,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;AACxF,YAAY,aAAa,GAAG,CAAC,GAAG,aAAa,EAAE,GAAG,UAAU,CAAC;AAC7D,YAAY,mBAAmB,GAAG,SAAS;AAC3C,SAAS,QAAQ,mBAAmB;AACpC,QAAQ,IAAI,SAAS;AACrB,YAAYD,aAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;AACtG,QAAQ,OAAO,aAAa;AAC5B;AACA;AACAD,6BAAqB,GAAGG,oBAAU,CAAC;AACnC,IAAIC,iBAAU,EAAE;AAChB,IAAIC,iBAAO,CAAC,CAAC,EAAEC,aAAM,CAACC,mCAA0B,CAAC,CAAC;AAClD,IAAIC,oBAAU,CAAC,mBAAmB,EAAE,CAACC,mBAAS,CAAC;AAC/C,CAAC,EAAET,6BAAqB,CAAC;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('../../external/tslib/tslib.es6.js');
|
|
4
|
+
var common = require('@nestjs/common');
|
|
5
|
+
var constant = require('../../shared/constant/config/constant.js');
|
|
6
|
+
var configParameters_provider = require('../../shared/provider/config/config-parameters.provider.js');
|
|
7
|
+
var properties_provider = require('../../shared/provider/config/properties.provider.js');
|
|
8
|
+
var ssmClient_provider = require('../../shared/provider/config/ssm-client.provider.js');
|
|
9
|
+
var parameterStore_service = require('../aws/parameter-store/parameter-store.service.js');
|
|
10
|
+
var config_service = require('./config.service.js');
|
|
11
|
+
|
|
12
|
+
var ParameterStoreConfigModule_1;
|
|
13
|
+
exports.ParameterStoreConfigModule = ParameterStoreConfigModule_1 = class ParameterStoreConfigModule {
|
|
14
|
+
/**
|
|
15
|
+
* Registers the given options for dynamic module configuration.
|
|
16
|
+
* @param {IParameterStoreConfigProperties} options - The configuration options.
|
|
17
|
+
* @returns {DynamicModule} - The dynamic module configuration.
|
|
18
|
+
*/
|
|
19
|
+
static register(options) {
|
|
20
|
+
const propertiesProvider = properties_provider.ParameterStoreConfigPropertiesProvider(options);
|
|
21
|
+
return {
|
|
22
|
+
exports: [config_service.ParameterStoreConfigService, constant.PARAMETER_STORE_CONFIG_PARAMETERS],
|
|
23
|
+
module: ParameterStoreConfigModule_1,
|
|
24
|
+
providers: [propertiesProvider, configParameters_provider.ParameterStoreConfigParametersProvider, ssmClient_provider.ParameterStoreConfigSSMProvider, config_service.ParameterStoreConfigService, parameterStore_service.ParameterStoreService],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Registers an asynchronous module in the application.
|
|
29
|
+
* @param {IParameterStoreConfigAsyncModuleProperties} properties - The properties for the async module.
|
|
30
|
+
* @returns {DynamicModule} - The registered dynamic module.
|
|
31
|
+
*/
|
|
32
|
+
static registerAsync(properties) {
|
|
33
|
+
const providers = this.createAsyncProviders(properties);
|
|
34
|
+
return {
|
|
35
|
+
exports: [config_service.ParameterStoreConfigService, constant.PARAMETER_STORE_CONFIG_PARAMETERS],
|
|
36
|
+
imports: properties.imports ?? [],
|
|
37
|
+
module: ParameterStoreConfigModule_1,
|
|
38
|
+
providers,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates an async options provider for the given `properties` object.
|
|
43
|
+
* @param {IParameterStoreConfigAsyncModuleProperties} properties - The properties object used to configure the async options provider.
|
|
44
|
+
* @returns {Provider} - The created async options provider.
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
static createAsyncOptionsProvider(properties) {
|
|
48
|
+
if (properties.useFactory) {
|
|
49
|
+
return {
|
|
50
|
+
inject: properties.inject ?? [],
|
|
51
|
+
provide: constant.PARAMETER_STORE_CONFIG_PROPERTIES,
|
|
52
|
+
useFactory: properties.useFactory,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const inject = properties.useExisting ?? properties.useClass;
|
|
56
|
+
return {
|
|
57
|
+
inject: inject ? [inject] : [],
|
|
58
|
+
provide: constant.PARAMETER_STORE_CONFIG_PROPERTIES,
|
|
59
|
+
useFactory: async (optionsFactory) => {
|
|
60
|
+
return optionsFactory.createOptions();
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates an array of Providers for asynchronous module configuration using the given properties.
|
|
66
|
+
* @param {IParameterStoreConfigAsyncModuleProperties} properties - The properties for configuring the module asynchronously.
|
|
67
|
+
* @returns {Array<Provider>} An array of Providers for the module configuration.
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
static createAsyncProviders(properties) {
|
|
71
|
+
const optionsProvider = this.createAsyncOptionsProvider(properties);
|
|
72
|
+
const requestProviders = [optionsProvider, configParameters_provider.ParameterStoreConfigParametersProvider, ssmClient_provider.ParameterStoreConfigSSMProvider, config_service.ParameterStoreConfigService, parameterStore_service.ParameterStoreService];
|
|
73
|
+
if (properties.useExisting || properties.useFactory || !properties.useClass) {
|
|
74
|
+
return requestProviders;
|
|
75
|
+
}
|
|
76
|
+
return [
|
|
77
|
+
...requestProviders,
|
|
78
|
+
{
|
|
79
|
+
provide: properties.useClass,
|
|
80
|
+
useClass: properties.useClass,
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.ParameterStoreConfigModule = ParameterStoreConfigModule_1 = tslib_es6.__decorate([
|
|
86
|
+
common.Global(),
|
|
87
|
+
common.Module({})
|
|
88
|
+
], exports.ParameterStoreConfigModule);
|
|
89
|
+
//# sourceMappingURL=config.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.module.js","sources":["../../../../../../../../../node_modules/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.module.js"],"sourcesContent":["import { __decorate } from '../../external/tslib/tslib.es6.js';\nimport { Global, Module } from '@nestjs/common';\nimport { PARAMETER_STORE_CONFIG_PARAMETERS, PARAMETER_STORE_CONFIG_PROPERTIES } from '../../shared/constant/config/constant.js';\nimport { ParameterStoreConfigParametersProvider } from '../../shared/provider/config/config-parameters.provider.js';\nimport { ParameterStoreConfigPropertiesProvider } from '../../shared/provider/config/properties.provider.js';\nimport { ParameterStoreConfigSSMProvider } from '../../shared/provider/config/ssm-client.provider.js';\nimport { ParameterStoreService } from '../aws/parameter-store/parameter-store.service.js';\nimport { ParameterStoreConfigService } from './config.service.js';\n\nvar ParameterStoreConfigModule_1;\nlet ParameterStoreConfigModule = ParameterStoreConfigModule_1 = class ParameterStoreConfigModule {\n /**\n * Registers the given options for dynamic module configuration.\n * @param {IParameterStoreConfigProperties} options - The configuration options.\n * @returns {DynamicModule} - The dynamic module configuration.\n */\n static register(options) {\n const propertiesProvider = ParameterStoreConfigPropertiesProvider(options);\n return {\n exports: [ParameterStoreConfigService, PARAMETER_STORE_CONFIG_PARAMETERS],\n module: ParameterStoreConfigModule_1,\n providers: [propertiesProvider, ParameterStoreConfigParametersProvider, ParameterStoreConfigSSMProvider, ParameterStoreConfigService, ParameterStoreService],\n };\n }\n /**\n * Registers an asynchronous module in the application.\n * @param {IParameterStoreConfigAsyncModuleProperties} properties - The properties for the async module.\n * @returns {DynamicModule} - The registered dynamic module.\n */\n static registerAsync(properties) {\n const providers = this.createAsyncProviders(properties);\n return {\n exports: [ParameterStoreConfigService, PARAMETER_STORE_CONFIG_PARAMETERS],\n imports: properties.imports ?? [],\n module: ParameterStoreConfigModule_1,\n providers,\n };\n }\n /**\n * Creates an async options provider for the given `properties` object.\n * @param {IParameterStoreConfigAsyncModuleProperties} properties - The properties object used to configure the async options provider.\n * @returns {Provider} - The created async options provider.\n * @private\n */\n static createAsyncOptionsProvider(properties) {\n if (properties.useFactory) {\n return {\n inject: properties.inject ?? [],\n provide: PARAMETER_STORE_CONFIG_PROPERTIES,\n useFactory: properties.useFactory,\n };\n }\n const inject = properties.useExisting ?? properties.useClass;\n return {\n inject: inject ? [inject] : [],\n provide: PARAMETER_STORE_CONFIG_PROPERTIES,\n useFactory: async (optionsFactory) => {\n return optionsFactory.createOptions();\n },\n };\n }\n /**\n * Creates an array of Providers for asynchronous module configuration using the given properties.\n * @param {IParameterStoreConfigAsyncModuleProperties} properties - The properties for configuring the module asynchronously.\n * @returns {Array<Provider>} An array of Providers for the module configuration.\n * @private\n */\n static createAsyncProviders(properties) {\n const optionsProvider = this.createAsyncOptionsProvider(properties);\n const requestProviders = [optionsProvider, ParameterStoreConfigParametersProvider, ParameterStoreConfigSSMProvider, ParameterStoreConfigService, ParameterStoreService];\n if (properties.useExisting || properties.useFactory || !properties.useClass) {\n return requestProviders;\n }\n return [\n ...requestProviders,\n {\n provide: properties.useClass,\n useClass: properties.useClass,\n },\n ];\n }\n};\nParameterStoreConfigModule = ParameterStoreConfigModule_1 = __decorate([\n Global(),\n Module({})\n], ParameterStoreConfigModule);\n\nexport { ParameterStoreConfigModule };\n//# sourceMappingURL=config.module.js.map\n"],"names":["ParameterStoreConfigModule","ParameterStoreConfigPropertiesProvider","ParameterStoreConfigService","PARAMETER_STORE_CONFIG_PARAMETERS","ParameterStoreConfigParametersProvider","ParameterStoreConfigSSMProvider","ParameterStoreService","PARAMETER_STORE_CONFIG_PROPERTIES","__decorate","Global","Module"],"mappings":";;;;;;;;;;;AASA,IAAI,4BAA4B;AAC5BA,kCAA0B,GAAG,4BAA4B,GAAG,MAAM,0BAA0B,CAAC;AACjG;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE;AAC7B,QAAQ,MAAM,kBAAkB,GAAGC,0DAAsC,CAAC,OAAO,CAAC;AAClF,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,CAACC,0CAA2B,EAAEC,0CAAiC,CAAC;AACrF,YAAY,MAAM,EAAE,4BAA4B;AAChD,YAAY,SAAS,EAAE,CAAC,kBAAkB,EAAEC,gEAAsC,EAAEC,kDAA+B,EAAEH,0CAA2B,EAAEI,4CAAqB,CAAC;AACxK,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,aAAa,CAAC,UAAU,EAAE;AACrC,QAAQ,MAAM,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC;AAC/D,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,CAACJ,0CAA2B,EAAEC,0CAAiC,CAAC;AACrF,YAAY,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,EAAE;AAC7C,YAAY,MAAM,EAAE,4BAA4B;AAChD,YAAY,SAAS;AACrB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,0BAA0B,CAAC,UAAU,EAAE;AAClD,QAAQ,IAAI,UAAU,CAAC,UAAU,EAAE;AACnC,YAAY,OAAO;AACnB,gBAAgB,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,EAAE;AAC/C,gBAAgB,OAAO,EAAEI,0CAAiC;AAC1D,gBAAgB,UAAU,EAAE,UAAU,CAAC,UAAU;AACjD,aAAa;AACb;AACA,QAAQ,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,QAAQ;AACpE,QAAQ,OAAO;AACf,YAAY,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE;AAC1C,YAAY,OAAO,EAAEA,0CAAiC;AACtD,YAAY,UAAU,EAAE,OAAO,cAAc,KAAK;AAClD,gBAAgB,OAAO,cAAc,CAAC,aAAa,EAAE;AACrD,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,oBAAoB,CAAC,UAAU,EAAE;AAC5C,QAAQ,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC;AAC3E,QAAQ,MAAM,gBAAgB,GAAG,CAAC,eAAe,EAAEH,gEAAsC,EAAEC,kDAA+B,EAAEH,0CAA2B,EAAEI,4CAAqB,CAAC;AAC/K,QAAQ,IAAI,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;AACrF,YAAY,OAAO,gBAAgB;AACnC;AACA,QAAQ,OAAO;AACf,YAAY,GAAG,gBAAgB;AAC/B,YAAY;AACZ,gBAAgB,OAAO,EAAE,UAAU,CAAC,QAAQ;AAC5C,gBAAgB,QAAQ,EAAE,UAAU,CAAC,QAAQ;AAC7C,aAAa;AACb,SAAS;AACT;AACA;AACAN,kCAA0B,GAAG,4BAA4B,GAAGQ,oBAAU,CAAC;AACvE,IAAIC,aAAM,EAAE;AACZ,IAAIC,aAAM,CAAC,EAAE;AACb,CAAC,EAAEV,kCAA0B,CAAC;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('../../external/tslib/tslib.es6.js');
|
|
4
|
+
var common = require('@nestjs/common');
|
|
5
|
+
var constant = require('../../shared/constant/config/constant.js');
|
|
6
|
+
require('../../shared/enum/environment.enum.js');
|
|
7
|
+
var instanceName_enum = require('../../shared/enum/instance-name.enum.js');
|
|
8
|
+
require('../../shared/enum/service.enum.js');
|
|
9
|
+
|
|
10
|
+
exports.ParameterStoreConfigService = class ParameterStoreConfigService {
|
|
11
|
+
parameters;
|
|
12
|
+
constructor(parameters) {
|
|
13
|
+
this.parameters = parameters;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the value of a parameter with the specified name.
|
|
17
|
+
* @param {IConfigGetProperties | string} properties - The parameter name or context options.
|
|
18
|
+
* @returns {null | string} - The value of the parameter if found, or null if not found.
|
|
19
|
+
*/
|
|
20
|
+
get(properties) {
|
|
21
|
+
if (typeof properties === "string") {
|
|
22
|
+
const found = this.parameters.find((parameter) => parameter.Name == properties);
|
|
23
|
+
if (!found?.Value) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return found.Value;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const { application = this.getApplication(), environment = this.getEnvironment(), path = [], service = "" } = properties;
|
|
30
|
+
let instanceName = properties.instanceName ?? `${application}-${instanceName_enum.EInstanceName.REAPER_API}`;
|
|
31
|
+
if (properties.instanceName === instanceName_enum.EInstanceName.REAPER_API || properties.instanceName === instanceName_enum.EInstanceName.REAPER_API_TEST) {
|
|
32
|
+
instanceName = `${application}-${properties.instanceName}`;
|
|
33
|
+
}
|
|
34
|
+
const parameterPath = `/${application}/${environment}/${instanceName}/${service}/${path.join("/")}`;
|
|
35
|
+
const found = this.parameters.find((parameter) => parameter.Name == parameterPath);
|
|
36
|
+
if (!found?.Value) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return found.Value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Gets the application name from environment variables.
|
|
44
|
+
* @returns {string} The application name.
|
|
45
|
+
*/
|
|
46
|
+
getApplication() {
|
|
47
|
+
return process.env.APPLICATION ?? "";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets the environment name from environment variables.
|
|
51
|
+
* @returns {string} The environment name.
|
|
52
|
+
*/
|
|
53
|
+
getEnvironment() {
|
|
54
|
+
return process.env.ENVIRONMENT ?? "";
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.ParameterStoreConfigService = tslib_es6.__decorate([
|
|
58
|
+
common.Injectable(),
|
|
59
|
+
tslib_es6.__param(0, common.Inject(constant.PARAMETER_STORE_CONFIG_PARAMETERS)),
|
|
60
|
+
tslib_es6.__metadata("design:paramtypes", [Array])
|
|
61
|
+
], exports.ParameterStoreConfigService);
|
|
62
|
+
//# sourceMappingURL=config.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.service.js","sources":["../../../../../../../../../node_modules/@elsikora/nestjs-aws-parameter-store-config/dist/esm/modules/config/config.service.js"],"sourcesContent":["import { __decorate, __param, __metadata } from '../../external/tslib/tslib.es6.js';\nimport { Injectable, Inject } from '@nestjs/common';\nimport { PARAMETER_STORE_CONFIG_PARAMETERS } from '../../shared/constant/config/constant.js';\nimport '../../shared/enum/environment.enum.js';\nimport { EInstanceName } from '../../shared/enum/instance-name.enum.js';\nimport '../../shared/enum/service.enum.js';\n\nlet ParameterStoreConfigService = class ParameterStoreConfigService {\n parameters;\n constructor(parameters) {\n this.parameters = parameters;\n }\n /**\n * Retrieves the value of a parameter with the specified name.\n * @param {IConfigGetProperties | string} properties - The parameter name or context options.\n * @returns {null | string} - The value of the parameter if found, or null if not found.\n */\n get(properties) {\n if (typeof properties === \"string\") {\n const found = this.parameters.find((parameter) => parameter.Name == properties);\n if (!found?.Value) {\n return null;\n }\n return found.Value;\n }\n else {\n const { application = this.getApplication(), environment = this.getEnvironment(), path = [], service = \"\" } = properties;\n let instanceName = properties.instanceName ?? `${application}-${EInstanceName.REAPER_API}`;\n if (properties.instanceName === EInstanceName.REAPER_API || properties.instanceName === EInstanceName.REAPER_API_TEST) {\n instanceName = `${application}-${properties.instanceName}`;\n }\n const parameterPath = `/${application}/${environment}/${instanceName}/${service}/${path.join(\"/\")}`;\n const found = this.parameters.find((parameter) => parameter.Name == parameterPath);\n if (!found?.Value) {\n return null;\n }\n return found.Value;\n }\n }\n /**\n * Gets the application name from environment variables.\n * @returns {string} The application name.\n */\n getApplication() {\n return process.env.APPLICATION ?? \"\";\n }\n /**\n * Gets the environment name from environment variables.\n * @returns {string} The environment name.\n */\n getEnvironment() {\n return process.env.ENVIRONMENT ?? \"\";\n }\n};\nParameterStoreConfigService = __decorate([\n Injectable(),\n __param(0, Inject(PARAMETER_STORE_CONFIG_PARAMETERS)),\n __metadata(\"design:paramtypes\", [Array])\n], ParameterStoreConfigService);\n\nexport { ParameterStoreConfigService };\n//# sourceMappingURL=config.service.js.map\n"],"names":["ParameterStoreConfigService","EInstanceName","__decorate","Injectable","__param","Inject","PARAMETER_STORE_CONFIG_PARAMETERS","__metadata"],"mappings":";;;;;;;;;AAOIA,mCAA2B,GAAG,MAAM,2BAA2B,CAAC;AACpE,IAAI,UAAU;AACd,IAAI,WAAW,CAAC,UAAU,EAAE;AAC5B,QAAQ,IAAI,CAAC,UAAU,GAAG,UAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,GAAG,CAAC,UAAU,EAAE;AACpB,QAAQ,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;AAC5C,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,IAAI,UAAU,CAAC;AAC3F,YAAY,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE;AAC/B,gBAAgB,OAAO,IAAI;AAC3B;AACA,YAAY,OAAO,KAAK,CAAC,KAAK;AAC9B;AACA,aAAa;AACb,YAAY,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,UAAU;AACpI,YAAY,IAAI,YAAY,GAAG,UAAU,CAAC,YAAY,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,EAAEC,+BAAa,CAAC,UAAU,CAAC,CAAC;AACtG,YAAY,IAAI,UAAU,CAAC,YAAY,KAAKA,+BAAa,CAAC,UAAU,IAAI,UAAU,CAAC,YAAY,KAAKA,+BAAa,CAAC,eAAe,EAAE;AACnI,gBAAgB,YAAY,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;AAC1E;AACA,YAAY,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/G,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,IAAI,aAAa,CAAC;AAC9F,YAAY,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE;AAC/B,gBAAgB,OAAO,IAAI;AAC3B;AACA,YAAY,OAAO,KAAK,CAAC,KAAK;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE;AAC5C;AACA;AACA;AACA;AACA;AACA,IAAI,cAAc,GAAG;AACrB,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE;AAC5C;AACA;AACAD,mCAA2B,GAAGE,oBAAU,CAAC;AACzC,IAAIC,iBAAU,EAAE;AAChB,IAAIC,iBAAO,CAAC,CAAC,EAAEC,aAAM,CAACC,0CAAiC,CAAC,CAAC;AACzD,IAAIC,oBAAU,CAAC,mBAAmB,EAAE,CAAC,KAAK,CAAC;AAC3C,CAAC,EAAEP,mCAA2B,CAAC;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Injection token for Parameter Store configuration properties.
|
|
5
|
+
* Used to provide and inject configuration options throughout the module.
|
|
6
|
+
*/
|
|
7
|
+
const PARAMETER_STORE_CONFIG_PROPERTIES = "PARAMETER_STORE_CONFIG_PROPERTIES";
|
|
8
|
+
/**
|
|
9
|
+
* Injection token for Parameter Store parameters.
|
|
10
|
+
* Used to provide and inject the parameters retrieved from AWS Parameter Store.
|
|
11
|
+
*/
|
|
12
|
+
const PARAMETER_STORE_CONFIG_PARAMETERS = "PARAMETER_STORE_CONFIG_PARAMETERS";
|
|
13
|
+
/**
|
|
14
|
+
* Injection token for the AWS SSM client.
|
|
15
|
+
* Used to provide and inject the configured SSM client.
|
|
16
|
+
*/
|
|
17
|
+
const PARAMETER_STORE_SSM_CLIENT = "PARAMETER_STORE_SSM_CLIENT";
|
|
18
|
+
|
|
19
|
+
exports.PARAMETER_STORE_CONFIG_PARAMETERS = PARAMETER_STORE_CONFIG_PARAMETERS;
|
|
20
|
+
exports.PARAMETER_STORE_CONFIG_PROPERTIES = PARAMETER_STORE_CONFIG_PROPERTIES;
|
|
21
|
+
exports.PARAMETER_STORE_SSM_CLIENT = PARAMETER_STORE_SSM_CLIENT;
|
|
22
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sources":["../../../../../../../../../../node_modules/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/constant/config/constant.js"],"sourcesContent":["/**\n * Injection token for Parameter Store configuration properties.\n * Used to provide and inject configuration options throughout the module.\n */\nconst PARAMETER_STORE_CONFIG_PROPERTIES = \"PARAMETER_STORE_CONFIG_PROPERTIES\";\n/**\n * Injection token for Parameter Store parameters.\n * Used to provide and inject the parameters retrieved from AWS Parameter Store.\n */\nconst PARAMETER_STORE_CONFIG_PARAMETERS = \"PARAMETER_STORE_CONFIG_PARAMETERS\";\n/**\n * Injection token for the AWS SSM client.\n * Used to provide and inject the configured SSM client.\n */\nconst PARAMETER_STORE_SSM_CLIENT = \"PARAMETER_STORE_SSM_CLIENT\";\n\nexport { PARAMETER_STORE_CONFIG_PARAMETERS, PARAMETER_STORE_CONFIG_PROPERTIES, PARAMETER_STORE_SSM_CLIENT };\n//# sourceMappingURL=constant.js.map\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACK,MAAC,iCAAiC,GAAG;AAC1C;AACA;AACA;AACA;AACK,MAAC,iCAAiC,GAAG;AAC1C;AACA;AACA;AACA;AACK,MAAC,0BAA0B,GAAG;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enum representing different deployment environments.
|
|
5
|
+
*/
|
|
6
|
+
exports.EEnvironment = void 0;
|
|
7
|
+
(function (EEnvironment) {
|
|
8
|
+
EEnvironment["DOCKER"] = "docker";
|
|
9
|
+
EEnvironment["EC2"] = "ec2";
|
|
10
|
+
EEnvironment["ECS"] = "ecs";
|
|
11
|
+
EEnvironment["EKS"] = "eks";
|
|
12
|
+
EEnvironment["ELASTIC_BEANSTALK"] = "elastic-beanstalk";
|
|
13
|
+
EEnvironment["HEROKU"] = "heroku";
|
|
14
|
+
EEnvironment["KUBERNETES"] = "kubernetes";
|
|
15
|
+
EEnvironment["LOCAL"] = "local";
|
|
16
|
+
EEnvironment["PRODUCTION"] = "production";
|
|
17
|
+
EEnvironment["STAGING"] = "staging";
|
|
18
|
+
EEnvironment["TEST"] = "test";
|
|
19
|
+
})(exports.EEnvironment || (exports.EEnvironment = {}));
|
|
20
|
+
//# sourceMappingURL=environment.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.enum.js","sources":["../../../../../../../../../node_modules/@elsikora/nestjs-aws-parameter-store-config/dist/esm/shared/enum/environment.enum.js"],"sourcesContent":["/**\n * Enum representing different deployment environments.\n */\nvar EEnvironment;\n(function (EEnvironment) {\n EEnvironment[\"DOCKER\"] = \"docker\";\n EEnvironment[\"EC2\"] = \"ec2\";\n EEnvironment[\"ECS\"] = \"ecs\";\n EEnvironment[\"EKS\"] = \"eks\";\n EEnvironment[\"ELASTIC_BEANSTALK\"] = \"elastic-beanstalk\";\n EEnvironment[\"HEROKU\"] = \"heroku\";\n EEnvironment[\"KUBERNETES\"] = \"kubernetes\";\n EEnvironment[\"LOCAL\"] = \"local\";\n EEnvironment[\"PRODUCTION\"] = \"production\";\n EEnvironment[\"STAGING\"] = \"staging\";\n EEnvironment[\"TEST\"] = \"test\";\n})(EEnvironment || (EEnvironment = {}));\n\nexport { EEnvironment };\n//# sourceMappingURL=environment.enum.js.map\n"],"names":["EEnvironment"],"mappings":";;AAAA;AACA;AACA;AACIA;AACJ,CAAC,UAAU,YAAY,EAAE;AACzB,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK;AAC/B,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK;AAC/B,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG,KAAK;AAC/B,IAAI,YAAY,CAAC,mBAAmB,CAAC,GAAG,mBAAmB;AAC3D,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC,IAAI,YAAY,CAAC,YAAY,CAAC,GAAG,YAAY;AAC7C,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,OAAO;AACnC,IAAI,YAAY,CAAC,YAAY,CAAC,GAAG,YAAY;AAC7C,IAAI,YAAY,CAAC,SAAS,CAAC,GAAG,SAAS;AACvC,IAAI,YAAY,CAAC,MAAM,CAAC,GAAG,MAAM;AACjC,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;;","x_google_ignoreList":[0]}
|