@l-v-yonsama/multi-platform-database-drivers 1.3.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/README.md +40 -0
  2. package/built/src/drivers/Auth0Driver.js +9 -9
  3. package/built/src/drivers/Auth0Driver.js.map +1 -1
  4. package/built/src/drivers/AwsDriver.js +3 -3
  5. package/built/src/drivers/AwsDriver.js.map +1 -1
  6. package/built/src/drivers/BaseDriver.d.ts +1 -1
  7. package/built/src/drivers/BaseDriver.js +4 -6
  8. package/built/src/drivers/BaseDriver.js.map +1 -1
  9. package/built/src/drivers/DBDriverResolver.js.map +1 -1
  10. package/built/src/drivers/DBError.js.map +1 -1
  11. package/built/src/drivers/KeycloakDriver.d.ts +2 -3
  12. package/built/src/drivers/KeycloakDriver.js +27 -262
  13. package/built/src/drivers/KeycloakDriver.js.map +1 -1
  14. package/built/src/drivers/MemcacheDriver.d.ts +0 -1
  15. package/built/src/drivers/MemcacheDriver.js +5 -5
  16. package/built/src/drivers/MemcacheDriver.js.map +1 -1
  17. package/built/src/drivers/MqttDriver.d.ts +0 -1
  18. package/built/src/drivers/MqttDriver.js +4 -4
  19. package/built/src/drivers/MqttDriver.js.map +1 -1
  20. package/built/src/drivers/MySQLDriver.js +12 -12
  21. package/built/src/drivers/MySQLDriver.js.map +1 -1
  22. package/built/src/drivers/OracleDriver.js +13 -13
  23. package/built/src/drivers/OracleDriver.js.map +1 -1
  24. package/built/src/drivers/PostgresDriver.js +22 -2
  25. package/built/src/drivers/PostgresDriver.js.map +1 -1
  26. package/built/src/drivers/RDSBaseDriver.d.ts +1 -1
  27. package/built/src/drivers/RDSBaseDriver.js +6 -6
  28. package/built/src/drivers/RDSBaseDriver.js.map +1 -1
  29. package/built/src/drivers/RedisDriver.js +2 -2
  30. package/built/src/drivers/RedisDriver.js.map +1 -1
  31. package/built/src/drivers/SQLServerDriver.js +7 -7
  32. package/built/src/drivers/SQLServerDriver.js.map +1 -1
  33. package/built/src/drivers/SQLiteDriver.d.ts +1 -1
  34. package/built/src/drivers/SQLiteDriver.js +7 -7
  35. package/built/src/drivers/SQLiteDriver.js.map +1 -1
  36. package/built/src/drivers/aws/AwsCloudFormationServiceClient.js +2 -2
  37. package/built/src/drivers/aws/AwsCloudFormationServiceClient.js.map +1 -1
  38. package/built/src/drivers/aws/AwsCloudwatchServiceClient.js +3 -3
  39. package/built/src/drivers/aws/AwsCloudwatchServiceClient.js.map +1 -1
  40. package/built/src/drivers/aws/AwsDynamoServiceClient.js +7 -7
  41. package/built/src/drivers/aws/AwsDynamoServiceClient.js.map +1 -1
  42. package/built/src/drivers/aws/AwsS3ServiceClient.js +24 -24
  43. package/built/src/drivers/aws/AwsS3ServiceClient.js.map +1 -1
  44. package/built/src/drivers/aws/AwsSESServiceClient.js.map +1 -1
  45. package/built/src/drivers/aws/AwsSQSServiceClient.js +8 -8
  46. package/built/src/drivers/aws/AwsSQSServiceClient.js.map +1 -1
  47. package/built/src/drivers/aws/AwsSecretsManagerServiceClient.js +1 -1
  48. package/built/src/drivers/aws/AwsSecretsManagerServiceClient.js.map +1 -1
  49. package/built/src/drivers/aws/AwsServiceClient.js +2 -2
  50. package/built/src/drivers/aws/AwsServiceClient.js.map +1 -1
  51. package/built/src/drivers/aws/AwsSsmServiceClient.js +1 -1
  52. package/built/src/drivers/aws/AwsSsmServiceClient.js.map +1 -1
  53. package/built/src/drivers/keycloak/resourceTreeBuilder.d.ts +5 -0
  54. package/built/src/drivers/keycloak/resourceTreeBuilder.js +37 -0
  55. package/built/src/drivers/keycloak/resourceTreeBuilder.js.map +1 -0
  56. package/built/src/drivers/keycloak/scanResultBuilder.d.ts +8 -0
  57. package/built/src/drivers/keycloak/scanResultBuilder.js +212 -0
  58. package/built/src/drivers/keycloak/scanResultBuilder.js.map +1 -0
  59. package/built/src/drivers/memcache/helper.d.ts +0 -1
  60. package/built/src/drivers/memcache/helper.js +13 -14
  61. package/built/src/drivers/memcache/helper.js.map +1 -1
  62. package/built/src/helpers/ProposalHelper.js +3 -3
  63. package/built/src/helpers/ProposalHelper.js.map +1 -1
  64. package/built/src/helpers/RdhRecordRuleHelper.js.map +1 -1
  65. package/built/src/helpers/RuleEngine.d.ts +5 -5
  66. package/built/src/helpers/RuleEngine.js +14 -14
  67. package/built/src/helpers/RuleEngine.js.map +1 -1
  68. package/built/src/helpers/SQLHelper.d.ts +8 -115
  69. package/built/src/helpers/SQLHelper.js +35 -1084
  70. package/built/src/helpers/SQLHelper.js.map +1 -1
  71. package/built/src/helpers/prompts/Auth0PromptHelper.js.map +1 -1
  72. package/built/src/helpers/prompts/AwsPromptHelper.js.map +1 -1
  73. package/built/src/helpers/prompts/KeycloakPromptHelper.js.map +1 -1
  74. package/built/src/helpers/prompts/MemcachePromptHelper.js.map +1 -1
  75. package/built/src/helpers/prompts/MqttPromptHelper.js.map +1 -1
  76. package/built/src/helpers/prompts/RdsPromptHelper.js +1 -1
  77. package/built/src/helpers/prompts/RdsPromptHelper.js.map +1 -1
  78. package/built/src/helpers/prompts/RedisPromptHelper.js.map +1 -1
  79. package/built/src/helpers/prompts/SchemaPromptHelper.js.map +1 -1
  80. package/built/src/helpers/sql/dynamoConversion.d.ts +2 -0
  81. package/built/src/helpers/sql/dynamoConversion.js +27 -0
  82. package/built/src/helpers/sql/dynamoConversion.js.map +1 -0
  83. package/built/src/helpers/sql/formatQuery.d.ts +6 -0
  84. package/built/src/helpers/sql/formatQuery.js +45 -0
  85. package/built/src/helpers/sql/formatQuery.js.map +1 -0
  86. package/built/src/helpers/sql/mutationQuery.d.ts +54 -0
  87. package/built/src/helpers/sql/mutationQuery.js +250 -0
  88. package/built/src/helpers/sql/mutationQuery.js.map +1 -0
  89. package/built/src/helpers/sql/parameterNormalizer.d.ts +16 -0
  90. package/built/src/helpers/sql/parameterNormalizer.js +166 -0
  91. package/built/src/helpers/sql/parameterNormalizer.js.map +1 -0
  92. package/built/src/helpers/sql/queryParser.d.ts +6 -0
  93. package/built/src/helpers/sql/queryParser.js +239 -0
  94. package/built/src/helpers/sql/queryParser.js.map +1 -0
  95. package/built/src/helpers/sql/quote.d.ts +17 -0
  96. package/built/src/helpers/sql/quote.js +140 -0
  97. package/built/src/helpers/sql/quote.js.map +1 -0
  98. package/built/src/helpers/sql/selectQuery.d.ts +24 -0
  99. package/built/src/helpers/sql/selectQuery.js +262 -0
  100. package/built/src/helpers/sql/selectQuery.js.map +1 -0
  101. package/built/src/resource/aws.d.ts +106 -0
  102. package/built/src/resource/aws.js +219 -0
  103. package/built/src/resource/aws.js.map +1 -0
  104. package/built/src/resource/base.d.ts +28 -0
  105. package/built/src/resource/base.js +76 -0
  106. package/built/src/resource/base.js.map +1 -0
  107. package/built/src/resource/connection.d.ts +35 -0
  108. package/built/src/resource/connection.js +52 -0
  109. package/built/src/resource/connection.js.map +1 -0
  110. package/built/src/resource/fromJson.d.ts +2 -0
  111. package/built/src/resource/fromJson.js +125 -0
  112. package/built/src/resource/fromJson.js.map +1 -0
  113. package/built/src/resource/iam.d.ts +70 -0
  114. package/built/src/resource/iam.js +175 -0
  115. package/built/src/resource/iam.js.map +1 -0
  116. package/built/src/resource/index.d.ts +8 -1
  117. package/built/src/resource/index.js +8 -1
  118. package/built/src/resource/index.js.map +1 -1
  119. package/built/src/resource/keyValue.d.ts +85 -0
  120. package/built/src/resource/keyValue.js +74 -0
  121. package/built/src/resource/keyValue.js.map +1 -0
  122. package/built/src/resource/rdb.d.ts +49 -0
  123. package/built/src/resource/rdb.js +155 -0
  124. package/built/src/resource/rdb.js.map +1 -0
  125. package/built/src/resource/types.d.ts +18 -0
  126. package/built/src/resource/types.js +3 -0
  127. package/built/src/resource/types.js.map +1 -0
  128. package/built/src/types/drivers/Keycloak.js +1 -1
  129. package/built/src/types/drivers/Keycloak.js.map +1 -1
  130. package/built/src/types/drivers/MemcachedParams.d.ts +0 -1
  131. package/built/src/types/helpers/index.js +1 -1
  132. package/built/src/types/helpers/index.js.map +1 -1
  133. package/built/src/types/resource/AwsCfnStackAttributes.d.ts +1 -1
  134. package/built/src/types/resource/MySQLColumnType.js +2 -2
  135. package/built/src/types/resource/MySQLColumnType.js.map +1 -1
  136. package/built/src/types/resource/OracleColumnType.js +2 -2
  137. package/built/src/types/resource/OracleColumnType.js.map +1 -1
  138. package/built/src/types/resource/PartiQLAttrType.js.map +1 -1
  139. package/built/src/types/resource/PostgresColumnType.js +2 -2
  140. package/built/src/types/resource/PostgresColumnType.js.map +1 -1
  141. package/built/src/types/resource/SQLServerColumnType.js +2 -2
  142. package/built/src/types/resource/SQLServerColumnType.js.map +1 -1
  143. package/built/src/types/utils/index.js +2 -2
  144. package/built/src/types/utils/index.js.map +1 -1
  145. package/built/src/utils/base.js +1 -1
  146. package/built/src/utils/base.js.map +1 -1
  147. package/built/src/utils/cfn/applicationDiagram.js +52 -12
  148. package/built/src/utils/cfn/applicationDiagram.js.map +1 -1
  149. package/built/src/utils/cfn/applicationRelations.d.ts +1 -1
  150. package/built/src/utils/cfn/applicationRelations.js +107 -15
  151. package/built/src/utils/cfn/applicationRelations.js.map +1 -1
  152. package/built/src/utils/cfn/cfnDependencyGraphDiagram.js.map +1 -1
  153. package/built/src/utils/cfn/{architectureTopology.d.ts → deploymentTopology.d.ts} +5 -1
  154. package/built/src/utils/cfn/{architectureTopology.js → deploymentTopology.js} +127 -13
  155. package/built/src/utils/cfn/deploymentTopology.js.map +1 -0
  156. package/built/src/utils/cfn/diagramFileModel.js.map +1 -1
  157. package/built/src/utils/cfn/drawio/cfnDependencyGraphDiagram.d.ts +3 -0
  158. package/built/src/utils/cfn/drawio/cfnDependencyGraphDiagram.js +174 -0
  159. package/built/src/utils/cfn/drawio/cfnDependencyGraphDiagram.js.map +1 -0
  160. package/built/src/utils/cfn/drawio/commonCells.d.ts +22 -0
  161. package/built/src/utils/cfn/drawio/commonCells.js +83 -0
  162. package/built/src/utils/cfn/drawio/commonCells.js.map +1 -0
  163. package/built/src/utils/cfn/drawio/edgeRouting.d.ts +34 -0
  164. package/built/src/utils/cfn/drawio/edgeRouting.js +77 -0
  165. package/built/src/utils/cfn/drawio/edgeRouting.js.map +1 -0
  166. package/built/src/utils/cfn/drawio/multiAzInfrastructureDiagram.d.ts +3 -0
  167. package/built/src/utils/cfn/drawio/multiAzInfrastructureDiagram.js +812 -0
  168. package/built/src/utils/cfn/drawio/multiAzInfrastructureDiagram.js.map +1 -0
  169. package/built/src/utils/cfn/drawioApplicationDiagram.d.ts +1 -0
  170. package/built/src/utils/cfn/drawioApplicationDiagram.js +290 -32
  171. package/built/src/utils/cfn/drawioApplicationDiagram.js.map +1 -1
  172. package/built/src/utils/cfn/drawioInfrastructureDiagrams.d.ts +2 -4
  173. package/built/src/utils/cfn/drawioInfrastructureDiagrams.js +7 -441
  174. package/built/src/utils/cfn/drawioInfrastructureDiagrams.js.map +1 -1
  175. package/built/src/utils/cfn/drawioXml.d.ts +0 -24
  176. package/built/src/utils/cfn/drawioXml.js +5 -47
  177. package/built/src/utils/cfn/drawioXml.js.map +1 -1
  178. package/built/src/utils/cfn/generateDiagram.js +3 -4
  179. package/built/src/utils/cfn/generateDiagram.js.map +1 -1
  180. package/built/src/utils/cfn/icons.js.map +1 -1
  181. package/built/src/utils/cfn/index.d.ts +4 -4
  182. package/built/src/utils/cfn/index.js +9 -8
  183. package/built/src/utils/cfn/index.js.map +1 -1
  184. package/built/src/utils/cfn/intrinsics.d.ts +1 -1
  185. package/built/src/utils/cfn/intrinsics.js.map +1 -1
  186. package/built/src/utils/cfn/multiAzDeploymentTrafficPathsAndProtection.d.ts +27 -0
  187. package/built/src/utils/cfn/{multiAzDeploymentDataPaths.js → multiAzDeploymentTrafficPathsAndProtection.js} +162 -10
  188. package/built/src/utils/cfn/multiAzDeploymentTrafficPathsAndProtection.js.map +1 -0
  189. package/built/src/utils/cfn/multiAzDeploymentTrafficPathsAndProtectionDiagram.d.ts +2 -0
  190. package/built/src/utils/cfn/{architectureDiagram.js → multiAzDeploymentTrafficPathsAndProtectionDiagram.js} +82 -34
  191. package/built/src/utils/cfn/multiAzDeploymentTrafficPathsAndProtectionDiagram.js.map +1 -0
  192. package/built/src/utils/cfn/naming.d.ts +2 -1
  193. package/built/src/utils/cfn/naming.js +3 -3
  194. package/built/src/utils/cfn/naming.js.map +1 -1
  195. package/built/src/utils/cfn/resourceDependencies.js.map +1 -1
  196. package/built/src/utils/cfn/templateParsing.js +11 -26
  197. package/built/src/utils/cfn/templateParsing.js.map +1 -1
  198. package/built/src/utils/csv.js.map +1 -1
  199. package/built/src/utils/dbType.js.map +1 -1
  200. package/built/src/utils/diagramLayout/elkLayoutEngine.d.ts +3 -0
  201. package/built/src/utils/diagramLayout/elkLayoutEngine.js +199 -0
  202. package/built/src/utils/diagramLayout/elkLayoutEngine.js.map +1 -0
  203. package/built/src/utils/diagramLayout/index.d.ts +4 -0
  204. package/built/src/utils/diagramLayout/index.js +13 -0
  205. package/built/src/utils/diagramLayout/index.js.map +1 -0
  206. package/built/src/utils/diagramLayout/normalizeLayout.d.ts +33 -0
  207. package/built/src/utils/diagramLayout/normalizeLayout.js +116 -0
  208. package/built/src/utils/diagramLayout/normalizeLayout.js.map +1 -0
  209. package/built/src/utils/diagramLayout/types.d.ts +64 -0
  210. package/built/src/utils/diagramLayout/types.js +3 -0
  211. package/built/src/utils/diagramLayout/types.js.map +1 -0
  212. package/built/src/utils/drawio/drawioXml.d.ts +24 -0
  213. package/built/src/utils/drawio/drawioXml.js +47 -0
  214. package/built/src/utils/drawio/drawioXml.js.map +1 -0
  215. package/built/src/utils/drawio/index.d.ts +2 -0
  216. package/built/src/utils/drawio/index.js +10 -0
  217. package/built/src/utils/drawio/index.js.map +1 -0
  218. package/built/src/utils/driverUtil.d.ts +1 -1
  219. package/built/src/utils/driverUtil.js.map +1 -1
  220. package/built/src/utils/er/erDiagramDrawioGenerator.d.ts +26 -0
  221. package/built/src/utils/er/erDiagramDrawioGenerator.js +99 -0
  222. package/built/src/utils/er/erDiagramDrawioGenerator.js.map +1 -0
  223. package/built/src/utils/er/erDiagramDrawioGeneratorAuto.d.ts +2 -0
  224. package/built/src/utils/er/erDiagramDrawioGeneratorAuto.js +103 -0
  225. package/built/src/utils/er/erDiagramDrawioGeneratorAuto.js.map +1 -0
  226. package/built/src/utils/er/erDiagramGenerator.d.ts +7 -0
  227. package/built/src/utils/er/erDiagramGenerator.js +321 -0
  228. package/built/src/utils/er/erDiagramGenerator.js.map +1 -0
  229. package/built/src/utils/er/index.d.ts +4 -0
  230. package/built/src/utils/er/index.js +13 -0
  231. package/built/src/utils/er/index.js.map +1 -0
  232. package/built/src/utils/er/types.d.ts +31 -0
  233. package/built/src/utils/er/types.js +3 -0
  234. package/built/src/utils/er/types.js.map +1 -0
  235. package/built/src/utils/index.d.ts +1 -0
  236. package/built/src/utils/index.js +1 -0
  237. package/built/src/utils/index.js.map +1 -1
  238. package/built/src/utils/log/LogParser.js.map +1 -1
  239. package/built/src/utils/log/buildSqlExecutions.js +3 -4
  240. package/built/src/utils/log/buildSqlExecutions.js.map +1 -1
  241. package/built/src/utils/log/classify/classifyEvent.js +2 -3
  242. package/built/src/utils/log/classify/classifyEvent.js.map +1 -1
  243. package/built/src/utils/log/detect/presetDetector.js +4 -5
  244. package/built/src/utils/log/detect/presetDetector.js.map +1 -1
  245. package/built/src/utils/log/extract/runExtractors.js +1 -2
  246. package/built/src/utils/log/extract/runExtractors.js.map +1 -1
  247. package/built/src/utils/log/logSummary.js +5 -5
  248. package/built/src/utils/log/logSummary.js.map +1 -1
  249. package/built/src/utils/log/pattern/logEventPattern.js +2 -3
  250. package/built/src/utils/log/pattern/logEventPattern.js.map +1 -1
  251. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.js +2 -3
  252. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.js.map +1 -1
  253. package/built/src/utils/log/split/splitLogEvents.js +1 -2
  254. package/built/src/utils/log/split/splitLogEvents.js.map +1 -1
  255. package/built/src/utils/log/sql/removeSqlComments.js +2 -3
  256. package/built/src/utils/log/sql/removeSqlComments.js.map +1 -1
  257. package/built/src/utils/log/validator.js +8 -5
  258. package/built/src/utils/log/validator.js.map +1 -1
  259. package/package.json +14 -10
  260. package/built/src/resource/DbResource.d.ts +0 -373
  261. package/built/src/resource/DbResource.js +0 -836
  262. package/built/src/resource/DbResource.js.map +0 -1
  263. package/built/src/utils/cfn/architectureDiagram.d.ts +0 -3
  264. package/built/src/utils/cfn/architectureDiagram.js.map +0 -1
  265. package/built/src/utils/cfn/architectureTopology.js.map +0 -1
  266. package/built/src/utils/cfn/multiAzDeploymentDataPaths.d.ts +0 -27
  267. package/built/src/utils/cfn/multiAzDeploymentDataPaths.js.map +0 -1
@@ -1,836 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DbResourceGroup = exports.DbCfnStack = exports.DbSecretsManagerSecret = exports.DbSsmParameter = exports.DbSESIdentity = exports.DbS3Owner = exports.DbLogStream = exports.DbLogGroup = exports.DbSQSQueue = exports.DbSubscription = exports.DbS3Bucket = exports.DbDynamoTableColumn = exports.DbDynamoTable = exports.AwsDbResource = exports.DbColumn = exports.DbKey = exports.DbTable = exports.DbSchema = exports.IamRole = exports.IamOrganization = exports.IamGroup = exports.IamUser = exports.IamClient = exports.IamRealm = exports.Auth0Database = exports.KeycloakDatabase = exports.MqttDatabase = exports.MemcacheDatabase = exports.RedisDatabase = exports.AwsDatabase = exports.RdsDatabase = exports.DbConnection = exports.DbResource = exports.fromJson = void 0;
4
- const tslib_1 = require("tslib");
5
- const rdh_1 = require("@l-v-yonsama/rdh");
6
- const bytes_1 = require("bytes");
7
- const short_unique_id_1 = tslib_1.__importDefault(require("short-unique-id"));
8
- const types_1 = require("../types");
9
- const uid = new short_unique_id_1.default();
10
- function fromJson(json) {
11
- const resourceType = json.resourceType;
12
- const { name } = json;
13
- let res;
14
- switch (resourceType) {
15
- case types_1.ResourceType.Connection:
16
- res = Object.assign(new DbConnection(name), json);
17
- break;
18
- case types_1.ResourceType.RdsDatabase:
19
- res = Object.assign(new RdsDatabase(name), json);
20
- break;
21
- case types_1.ResourceType.AwsDatabase:
22
- res = Object.assign(new AwsDatabase(name, (0, rdh_1.castTo)(json).serviceType), json);
23
- break;
24
- case types_1.ResourceType.RedisDatabase:
25
- res = Object.assign(new RedisDatabase(name, (0, rdh_1.castTo)(json).numOfKeys), json);
26
- break;
27
- case types_1.ResourceType.MemcacheDatabase:
28
- res = Object.assign(new MemcacheDatabase(name), json);
29
- break;
30
- case types_1.ResourceType.MqttDatabase:
31
- res = Object.assign(new MqttDatabase(name), json);
32
- break;
33
- case types_1.ResourceType.Subscription:
34
- res = Object.assign(new DbSubscription(name, (0, rdh_1.castTo)(json).qos), json);
35
- break;
36
- case types_1.ResourceType.Schema:
37
- res = Object.assign(new DbSchema(name), json);
38
- break;
39
- case types_1.ResourceType.Table:
40
- res = Object.assign(new DbTable(name, (0, rdh_1.castTo)(json).tableType), json);
41
- break;
42
- case types_1.ResourceType.Column:
43
- res = Object.assign(new DbColumn(name, (0, rdh_1.castTo)(json).colType, null), json);
44
- break;
45
- case types_1.ResourceType.Key:
46
- res = Object.assign(new DbKey(name, json.params), json);
47
- break;
48
- case types_1.ResourceType.Bucket:
49
- res = Object.assign(new DbS3Bucket(name), json);
50
- break;
51
- case types_1.ResourceType.Queue:
52
- res = Object.assign(new DbSQSQueue(name, (0, rdh_1.castTo)(json).url, (0, rdh_1.castTo)(json).attr), json);
53
- break;
54
- case types_1.ResourceType.Owner:
55
- res = Object.assign(new DbS3Owner(json.id, name), json);
56
- break;
57
- case types_1.ResourceType.LogGroup:
58
- res = Object.assign(new DbLogGroup(name, (0, rdh_1.castTo)(json).attr), json);
59
- break;
60
- case types_1.ResourceType.LogStream:
61
- res = Object.assign(new DbLogStream(name, (0, rdh_1.castTo)(json).attr), json);
62
- break;
63
- case types_1.ResourceType.DynamoTable:
64
- res = Object.assign(new DbDynamoTable(name, (0, rdh_1.castTo)(json).attr), json);
65
- break;
66
- case types_1.ResourceType.DynamoColumn:
67
- {
68
- const params = (0, rdh_1.castTo)(json);
69
- res = Object.assign(new DbDynamoTableColumn(name, params.attrType, params.pk, params.sk), json);
70
- }
71
- break;
72
- case types_1.ResourceType.Identity:
73
- res = Object.assign(new DbSESIdentity(name, (0, rdh_1.castTo)(json).attr), json);
74
- break;
75
- case types_1.ResourceType.SsmParameter:
76
- res = Object.assign(new DbSsmParameter(name, (0, rdh_1.castTo)(json).attr), json);
77
- break;
78
- case types_1.ResourceType.SecretsManagerSecret:
79
- res = Object.assign(new DbSecretsManagerSecret(name, (0, rdh_1.castTo)(json).attr), json);
80
- break;
81
- case types_1.ResourceType.CfnStack:
82
- res = Object.assign(new DbCfnStack(name, (0, rdh_1.castTo)(json).attr), json);
83
- break;
84
- case types_1.ResourceType.Group:
85
- res = Object.assign(new DbResourceGroup(name), json);
86
- break;
87
- case types_1.ResourceType.KeycloakDatabase:
88
- res = Object.assign(new KeycloakDatabase(name), json);
89
- break;
90
- case types_1.ResourceType.Auth0Database:
91
- res = Object.assign(new Auth0Database(name), json);
92
- break;
93
- case types_1.ResourceType.IamRealm:
94
- res = Object.assign(new IamRealm(name), json);
95
- break;
96
- case types_1.ResourceType.IamClient:
97
- res = Object.assign(new IamClient(name), json);
98
- break;
99
- case types_1.ResourceType.IamUser:
100
- res = Object.assign(new IamUser(name), json);
101
- break;
102
- case types_1.ResourceType.IamGroup:
103
- res = Object.assign(new IamGroup(name), json);
104
- break;
105
- case types_1.ResourceType.IamOrganization:
106
- res = Object.assign(new IamOrganization(name), json);
107
- break;
108
- case types_1.ResourceType.IamRole:
109
- res = Object.assign(new IamRole(name), json);
110
- break;
111
- case types_1.ResourceType.IamSession:
112
- throw new Error('IamSession is not a DbResource node and cannot be restored via fromJson.');
113
- default: {
114
- const _exhaustiveCheck = resourceType;
115
- throw new Error(`Unhandled resourceType in fromJson: ${_exhaustiveCheck}`);
116
- }
117
- }
118
- if (json.children) {
119
- const children = json.children.map((child) => fromJson(child));
120
- res['children'] = children;
121
- }
122
- return res;
123
- }
124
- exports.fromJson = fromJson;
125
- class DbResource {
126
- constructor(resourceType, name) {
127
- this.id = uid.randomUUID(8);
128
- this.resourceType = resourceType;
129
- this.name = name;
130
- this.children = [];
131
- }
132
- getProperties() {
133
- return {
134
- name: this.name,
135
- comment: this.comment,
136
- };
137
- }
138
- addChild(res) {
139
- this.children.push(res);
140
- return res;
141
- }
142
- hasChildren() {
143
- return this.children.length > 0;
144
- }
145
- clearChildren() {
146
- this.children.splice(0, this.children.length);
147
- }
148
- getChildByName(name, insensitive) {
149
- if (insensitive === true) {
150
- const uname = name.toUpperCase();
151
- return this.children.find((it) => it.name.toUpperCase() == uname);
152
- }
153
- return this.children.find((it) => it.name == name);
154
- }
155
- findChildren({ keyword, resourceType, recursively, }) {
156
- var _a, _b;
157
- if (this.children.some((it) => it.resourceType === resourceType)) {
158
- const children2 = this.children.filter((it) => it.resourceType === resourceType);
159
- if (keyword == undefined) {
160
- return (children2 !== null && children2 !== void 0 ? children2 : []);
161
- }
162
- if (typeof keyword === 'string') {
163
- const k = keyword.toUpperCase();
164
- return ((_a = children2.filter((it) => it.name.toUpperCase() == k)) !== null && _a !== void 0 ? _a : []);
165
- }
166
- return ((_b = children2.filter((it) => keyword.test(it.name))) !== null && _b !== void 0 ? _b : []);
167
- }
168
- if (recursively === true) {
169
- const ret = [];
170
- this.children.forEach((it) => {
171
- ret.push(...it.findChildren({
172
- keyword,
173
- resourceType,
174
- recursively,
175
- }));
176
- });
177
- return ret;
178
- }
179
- return [];
180
- }
181
- toString() {
182
- return `[${this.resourceType}]:${this.name}`;
183
- }
184
- toJsonStringify(space = 0) {
185
- return JSON.stringify(this, (k, v) => {
186
- if (['disabled'].includes(k)) {
187
- return undefined;
188
- }
189
- return v;
190
- }, space);
191
- }
192
- }
193
- exports.DbResource = DbResource;
194
- class DbConnection extends DbResource {
195
- constructor(prop) {
196
- super(types_1.ResourceType.Connection, prop.name);
197
- this.dbType = prop.dbType;
198
- this.comment = prop.comment;
199
- this.environment = prop.environment;
200
- this.host = prop.host;
201
- this.port = prop.port;
202
- this.user = prop.user;
203
- this.password = prop.password;
204
- this.database = prop.database;
205
- this.databaseVersion = prop.databaseVersion;
206
- this.ds = prop.ds;
207
- this.url = prop.url;
208
- this.apiVersion = prop.apiVersion;
209
- this.ssh = prop.ssh;
210
- this.ssl = prop.ssl;
211
- this.awsSetting = prop.awsSetting;
212
- this.iamSolution = prop.iamSolution;
213
- this.mqttSetting = prop.mqttSetting;
214
- this.firebase = prop.firebase;
215
- this.sqlServer = prop.sqlServer;
216
- this.timezone = prop.timezone;
217
- this.readOnly = prop.readOnly;
218
- this.transactionIsolationLevel = prop.transactionIsolationLevel;
219
- this.connectTimeoutMs = prop.connectTimeoutMs;
220
- this.queryTimeoutMs = prop.queryTimeoutMs;
221
- this.lockWaitTimeoutMs = prop.lockWaitTimeoutMs;
222
- this.resourceFilter = prop.resourceFilter;
223
- this.isConnected = false;
224
- this.isInProgress = false;
225
- }
226
- hasUrl() {
227
- if (this.url && this.url.length > 0) {
228
- return true;
229
- }
230
- return false;
231
- }
232
- hasSshSetting() {
233
- if (this.ssh && this.ssh.use === true) {
234
- return true;
235
- }
236
- return false;
237
- }
238
- }
239
- exports.DbConnection = DbConnection;
240
- class RdsDatabase extends DbResource {
241
- constructor(name) {
242
- super(types_1.ResourceType.RdsDatabase, name);
243
- }
244
- getProperties() {
245
- return Object.assign(Object.assign({}, super.getProperties()), { version: this.version });
246
- }
247
- getSchema(option) {
248
- const { name, isDefault } = option;
249
- for (const child of this.children) {
250
- if (child.resourceType !== types_1.ResourceType.Schema) {
251
- continue;
252
- }
253
- const currentSchema = child;
254
- if (name && name === child.name) {
255
- return currentSchema;
256
- }
257
- if (isDefault && currentSchema.isDefault) {
258
- return currentSchema;
259
- }
260
- }
261
- return null;
262
- }
263
- }
264
- exports.RdsDatabase = RdsDatabase;
265
- class AwsDatabase extends DbResource {
266
- constructor(name, serviceType) {
267
- super(types_1.ResourceType.AwsDatabase, name);
268
- this.serviceType = serviceType;
269
- }
270
- }
271
- exports.AwsDatabase = AwsDatabase;
272
- class RedisDatabase extends DbResource {
273
- constructor(name, numOfKeys) {
274
- super(types_1.ResourceType.RedisDatabase, name);
275
- this.numOfKeys = numOfKeys;
276
- }
277
- getDBIndex() {
278
- return parseInt(this.name, 10);
279
- }
280
- getProperties() {
281
- return Object.assign(Object.assign({}, super.getProperties()), { 'number of keys': this.numOfKeys });
282
- }
283
- }
284
- exports.RedisDatabase = RedisDatabase;
285
- class MemcacheDatabase extends DbResource {
286
- constructor(name) {
287
- super(types_1.ResourceType.MemcacheDatabase, name);
288
- }
289
- getProperties() {
290
- return Object.assign(Object.assign({}, super.getProperties()), { servers: this.servers, hot: this.hot, warm: this.warm, cold: this.cold });
291
- }
292
- }
293
- exports.MemcacheDatabase = MemcacheDatabase;
294
- class MqttDatabase extends DbResource {
295
- constructor(name) {
296
- super(types_1.ResourceType.MqttDatabase, name);
297
- }
298
- getProperties() {
299
- return Object.assign({}, super.getProperties());
300
- }
301
- }
302
- exports.MqttDatabase = MqttDatabase;
303
- class KeycloakDatabase extends DbResource {
304
- constructor(name) {
305
- super(types_1.ResourceType.KeycloakDatabase, name);
306
- }
307
- getProperties() {
308
- return Object.assign({}, super.getProperties());
309
- }
310
- getRealm(option) {
311
- const { name, isDefault } = option;
312
- for (const child of this.children) {
313
- if (child.resourceType !== types_1.ResourceType.IamRealm) {
314
- continue;
315
- }
316
- const currentRealm = child;
317
- if (name && name === child.name) {
318
- return currentRealm;
319
- }
320
- if (isDefault && currentRealm.isDefault) {
321
- return currentRealm;
322
- }
323
- }
324
- return null;
325
- }
326
- }
327
- exports.KeycloakDatabase = KeycloakDatabase;
328
- class Auth0Database extends DbResource {
329
- constructor(name) {
330
- super(types_1.ResourceType.Auth0Database, name);
331
- this.isDefault = false;
332
- this.numOfUsers = 0;
333
- this.numOfOrganizations = 0;
334
- }
335
- getClientByName(name) {
336
- var _a;
337
- return (_a = this.findChildren({
338
- keyword: name,
339
- resourceType: types_1.ResourceType.IamClient,
340
- recursively: false,
341
- })) === null || _a === void 0 ? void 0 : _a[0];
342
- }
343
- getUserByName(name) {
344
- var _a;
345
- return (_a = this.findChildren({
346
- keyword: name,
347
- resourceType: types_1.ResourceType.IamUser,
348
- recursively: false,
349
- })) === null || _a === void 0 ? void 0 : _a[0];
350
- }
351
- getGroupByName(name) {
352
- var _a;
353
- return (_a = this.findChildren({
354
- keyword: name,
355
- resourceType: types_1.ResourceType.IamGroup,
356
- recursively: false,
357
- })) === null || _a === void 0 ? void 0 : _a[0];
358
- }
359
- getRoleByName(name) {
360
- var _a;
361
- return (_a = this.findChildren({
362
- keyword: name,
363
- resourceType: types_1.ResourceType.IamRole,
364
- recursively: false,
365
- })) === null || _a === void 0 ? void 0 : _a[0];
366
- }
367
- getProperties() {
368
- const { id, numOfOrganizations, numOfUsers } = this;
369
- return Object.assign({ id,
370
- numOfUsers,
371
- numOfOrganizations }, super.getProperties());
372
- }
373
- }
374
- exports.Auth0Database = Auth0Database;
375
- class IamRealm extends DbResource {
376
- constructor(name) {
377
- super(types_1.ResourceType.IamRealm, name);
378
- this.isDefault = false;
379
- this.numOfUsers = 0;
380
- this.numOfGroups = 0;
381
- }
382
- getClientByName(name) {
383
- var _a;
384
- return (_a = this.findChildren({
385
- keyword: name,
386
- resourceType: types_1.ResourceType.IamClient,
387
- recursively: false,
388
- })) === null || _a === void 0 ? void 0 : _a[0];
389
- }
390
- getUserByName(name) {
391
- var _a;
392
- return (_a = this.findChildren({
393
- keyword: name,
394
- resourceType: types_1.ResourceType.IamUser,
395
- recursively: false,
396
- })) === null || _a === void 0 ? void 0 : _a[0];
397
- }
398
- getGroupByName(name) {
399
- var _a;
400
- return (_a = this.findChildren({
401
- keyword: name,
402
- resourceType: types_1.ResourceType.IamGroup,
403
- recursively: false,
404
- })) === null || _a === void 0 ? void 0 : _a[0];
405
- }
406
- getRoleByName(name) {
407
- var _a;
408
- return (_a = this.findChildren({
409
- keyword: name,
410
- resourceType: types_1.ResourceType.IamRole,
411
- recursively: false,
412
- })) === null || _a === void 0 ? void 0 : _a[0];
413
- }
414
- getProperties() {
415
- const { id, numOfGroups, numOfUsers } = this;
416
- return Object.assign({ id,
417
- numOfUsers,
418
- numOfGroups }, super.getProperties());
419
- }
420
- }
421
- exports.IamRealm = IamRealm;
422
- class IamClient extends DbResource {
423
- constructor(name) {
424
- super(types_1.ResourceType.IamClient, name);
425
- }
426
- getProperties() {
427
- const { id, protocol, clientId, appType, standardFlowEnabled, implicitFlowEnabled, directAccessGrantsEnabled, numOfUserSessions, numOfOfflineSessions, } = this;
428
- return Object.assign({ id,
429
- protocol,
430
- clientId,
431
- appType,
432
- standardFlowEnabled,
433
- implicitFlowEnabled,
434
- directAccessGrantsEnabled,
435
- numOfUserSessions,
436
- numOfOfflineSessions }, super.getProperties());
437
- }
438
- }
439
- exports.IamClient = IamClient;
440
- class IamUser extends DbResource {
441
- constructor(name) {
442
- super(types_1.ResourceType.IamUser, name);
443
- }
444
- getProperties() {
445
- const { id } = this;
446
- return Object.assign({ id }, super.getProperties());
447
- }
448
- }
449
- exports.IamUser = IamUser;
450
- class IamGroup extends DbResource {
451
- constructor(name) {
452
- super(types_1.ResourceType.IamGroup, name);
453
- }
454
- }
455
- exports.IamGroup = IamGroup;
456
- class IamOrganization extends DbResource {
457
- constructor(name) {
458
- super(types_1.ResourceType.IamOrganization, name);
459
- }
460
- }
461
- exports.IamOrganization = IamOrganization;
462
- class IamRole extends DbResource {
463
- constructor(name) {
464
- super(types_1.ResourceType.IamRole, name);
465
- }
466
- getProperties() {
467
- const { id } = this;
468
- return Object.assign({ id }, super.getProperties());
469
- }
470
- }
471
- exports.IamRole = IamRole;
472
- class DbSchema extends DbResource {
473
- constructor(name) {
474
- super(types_1.ResourceType.Schema, name);
475
- this.isDefault = false;
476
- }
477
- getUniqColumnNameWithComments() {
478
- const ret = [];
479
- this.children.forEach((table) => {
480
- table.children.forEach((column) => {
481
- const c = ret.find((it) => it.name === column.name);
482
- if (c) {
483
- if (c.comment === undefined) {
484
- c.comment = column.comment;
485
- }
486
- }
487
- else {
488
- ret.push({
489
- name: column.name,
490
- comment: column.comment,
491
- });
492
- }
493
- });
494
- });
495
- return ret.sort((a, b) => {
496
- const nameA = a.name.toUpperCase();
497
- const nameB = b.name.toUpperCase();
498
- if (nameA < nameB) {
499
- return -1;
500
- }
501
- if (nameA > nameB) {
502
- return 1;
503
- }
504
- return 0;
505
- });
506
- }
507
- }
508
- exports.DbSchema = DbSchema;
509
- class DbTable extends DbResource {
510
- constructor(name, tableType, comment) {
511
- super(types_1.ResourceType.Table, name);
512
- this.foreignKeys = {};
513
- this.tableType = tableType;
514
- this.comment = comment;
515
- this.isInProgress = false;
516
- }
517
- getCompareKeys(availableColumnNames) {
518
- var _a;
519
- const ret = [];
520
- const pks = this.getPrimaryColumnNames();
521
- if (pks.length) {
522
- if (availableColumnNames) {
523
- if (pks.every((pk) => availableColumnNames.some((ac) => (0, rdh_1.equalsIgnoreCase)(ac, pk)))) {
524
- ret.push({
525
- kind: 'primary',
526
- names: pks.map((pk) => availableColumnNames.find((ac) => (0, rdh_1.equalsIgnoreCase)(ac, pk))),
527
- });
528
- }
529
- }
530
- else {
531
- ret.push({
532
- kind: 'primary',
533
- names: pks,
534
- });
535
- }
536
- }
537
- (_a = this.uniqueKeys) === null || _a === void 0 ? void 0 : _a.forEach((it) => {
538
- if (availableColumnNames) {
539
- if (it.columns.every((uk) => availableColumnNames.some((ac) => (0, rdh_1.equalsIgnoreCase)(ac, uk)))) {
540
- ret.push({
541
- kind: 'uniq',
542
- names: it.columns.map((uk) => availableColumnNames.find((ac) => (0, rdh_1.equalsIgnoreCase)(ac, uk))),
543
- });
544
- }
545
- }
546
- else {
547
- ret.push({
548
- kind: 'uniq',
549
- names: it.columns,
550
- });
551
- }
552
- });
553
- return ret;
554
- }
555
- getPrimaryColumnNames() {
556
- var _a;
557
- return ((_a = this.children.filter((it) => it.primaryKey).map((it) => it.name)) !== null && _a !== void 0 ? _a : []);
558
- }
559
- getUniqColumnNames() {
560
- var _a;
561
- return (_a = this.children.filter((it) => it.uniqKey).map((it) => it.name)) !== null && _a !== void 0 ? _a : [];
562
- }
563
- toString() {
564
- return `[${super.toString()}]: Type[${this.tableType}]`;
565
- }
566
- getProperties() {
567
- return Object.assign(Object.assign({}, super.getProperties()), { 'table type': this.tableType });
568
- }
569
- }
570
- exports.DbTable = DbTable;
571
- class DbKey extends DbResource {
572
- constructor(name, params) {
573
- super(types_1.ResourceType.Key, name);
574
- this.params = params;
575
- }
576
- getProperties() {
577
- return Object.assign(Object.assign({ 'id or key': this.id }, super.getProperties()), this.params);
578
- }
579
- }
580
- exports.DbKey = DbKey;
581
- class DbColumn extends DbResource {
582
- constructor(name, colType, params, comment) {
583
- super(types_1.ResourceType.Column, name);
584
- this.colType = colType;
585
- this.comment = comment;
586
- if (params) {
587
- this.nullable = params.nullable || false;
588
- this.primaryKey = params.key === 'PRI';
589
- this.uniqKey = params.key === 'UNI' || params.key === 'MUL';
590
- this.default = params.default;
591
- this.extra = params.extra;
592
- }
593
- else {
594
- this.nullable = true;
595
- }
596
- }
597
- toString() {
598
- return `[${super.toString()}]: Nullable[${this.nullable}]]`;
599
- }
600
- getProperties() {
601
- return Object.assign(Object.assign({}, super.getProperties()), { 'column type': (0, rdh_1.displayGeneralColumnType)(this.colType), nullable: this.nullable, primaryKey: this.primaryKey, uniqKey: this.uniqKey, default: this.default });
602
- }
603
- }
604
- exports.DbColumn = DbColumn;
605
- class AwsDbResource extends DbResource {
606
- constructor(resourceType, name, attr) {
607
- super(resourceType, name);
608
- this.attr = attr;
609
- }
610
- setPropertyFormat({ dates, bytes, }) {
611
- this.dateProperties = dates;
612
- this.byteProperties = bytes;
613
- }
614
- getProperties() {
615
- var _a, _b;
616
- const props = Object.assign(Object.assign({}, super.getProperties()), this.attr);
617
- (_a = this.dateProperties) === null || _a === void 0 ? void 0 : _a.forEach((name) => {
618
- var _a;
619
- const v = props[name];
620
- props[name] = (_a = (0, rdh_1.toDate)(v)) === null || _a === void 0 ? void 0 : _a.toISOString();
621
- });
622
- (_b = this.byteProperties) === null || _b === void 0 ? void 0 : _b.forEach((name) => {
623
- const v = props[name];
624
- props[name] = (0, bytes_1.format)(v);
625
- });
626
- return props;
627
- }
628
- }
629
- exports.AwsDbResource = AwsDbResource;
630
- class DbDynamoTable extends AwsDbResource {
631
- constructor(name, attr) {
632
- super(types_1.ResourceType.DynamoTable, name, attr);
633
- this.setPropertyFormat({
634
- dates: ['CreationDateTime'],
635
- bytes: ['TableSizeBytes'],
636
- });
637
- }
638
- getProperties() {
639
- const props = Object.assign(Object.assign({}, super.getProperties()), { lsi: this.attr.lsi.length, gsi: this.attr.gsi.length });
640
- if (this.attr.ttl) {
641
- props.ttl = `${this.attr.ttl.AttributeName} (${this.attr.ttl.TimeToLiveStatus})`;
642
- }
643
- if (this.attr.lsi) {
644
- this.attr.lsi.forEach((it, idx) => {
645
- props[`lsi${idx + 1}_${it.IndexName}`] = it.KeySchema.map((ks) => `${ks.AttributeName}(${ks.KeyType})`).join(', ');
646
- });
647
- }
648
- if (this.attr.gsi) {
649
- this.attr.gsi.forEach((it, idx) => {
650
- props[`gsi${idx + 1}_${it.IndexName}`] = it.KeySchema.map((ks) => `${ks.AttributeName}(${ks.KeyType})`).join(', ');
651
- });
652
- }
653
- return props;
654
- }
655
- getPrimaryColumnNames() {
656
- var _a;
657
- return ((_a = this.children.filter((it) => it.pk || it.sk).map((it) => it.name)) !== null && _a !== void 0 ? _a : []);
658
- }
659
- getPkAndSkByIndex(indexName) {
660
- var _a, _b, _c, _d;
661
- if (!indexName) {
662
- return {
663
- pk: (_a = this.children.find((it) => it.pk)) === null || _a === void 0 ? void 0 : _a.name,
664
- sk: (_b = this.children.find((it) => it.sk)) === null || _b === void 0 ? void 0 : _b.name,
665
- };
666
- }
667
- let index = this.attr.lsi.find((it) => it.IndexName === indexName);
668
- if (index === undefined) {
669
- index = this.attr.gsi.find((it) => it.IndexName === indexName);
670
- }
671
- if (index) {
672
- return {
673
- pk: (_c = index.KeySchema.find((it) => it.KeyType === 'HASH')) === null || _c === void 0 ? void 0 : _c.AttributeName,
674
- sk: (_d = index.KeySchema.find((it) => it.KeyType === 'RANGE')) === null || _d === void 0 ? void 0 : _d.AttributeName,
675
- };
676
- }
677
- return {
678
- pk: undefined,
679
- sk: undefined,
680
- };
681
- }
682
- getCompareKeys(availableColumnNames) {
683
- const ret = [];
684
- const pks = this.getPrimaryColumnNames();
685
- if (pks.length) {
686
- if (availableColumnNames) {
687
- if (pks.every((pk) => availableColumnNames.some((ac) => (0, rdh_1.equalsIgnoreCase)(ac, pk)))) {
688
- ret.push({
689
- kind: 'primary',
690
- names: pks.map((pk) => availableColumnNames.find((ac) => (0, rdh_1.equalsIgnoreCase)(ac, pk))),
691
- });
692
- }
693
- }
694
- else {
695
- ret.push({
696
- kind: 'primary',
697
- names: pks,
698
- });
699
- }
700
- }
701
- return ret;
702
- }
703
- }
704
- exports.DbDynamoTable = DbDynamoTable;
705
- class DbDynamoTableColumn extends DbResource {
706
- constructor(name, attrType, pk, sk) {
707
- super(types_1.ResourceType.DynamoColumn, name);
708
- this.attrType = attrType;
709
- this.pk = pk;
710
- this.sk = sk;
711
- }
712
- toString() {
713
- return `[${super.toString()}]: Pk[${this.pk}]]`;
714
- }
715
- getProperties() {
716
- return Object.assign(Object.assign({}, super.getProperties()), { 'attribute type': this.attrType, 'partial key': this.pk, 'sort key': this.sk });
717
- }
718
- }
719
- exports.DbDynamoTableColumn = DbDynamoTableColumn;
720
- class DbS3Bucket extends AwsDbResource {
721
- constructor(name, CreationDate) {
722
- super(types_1.ResourceType.Bucket, name === undefined ? '' : name, {
723
- CreationDate,
724
- });
725
- this.setPropertyFormat({ dates: ['CreationDate'] });
726
- }
727
- }
728
- exports.DbS3Bucket = DbS3Bucket;
729
- class DbSubscription extends DbResource {
730
- constructor(name, qos, options) {
731
- super(types_1.ResourceType.Subscription, name);
732
- this.qos = qos;
733
- this.isSubscribed = false;
734
- this.comment = '';
735
- if (options) {
736
- this.nl = options.nl;
737
- this.rap = options.rap;
738
- this.rh = options.rh;
739
- }
740
- }
741
- getProperties() {
742
- const prop = Object.assign(Object.assign({}, super.getProperties()), { isSubscribed: this.isSubscribed, QoS: this.qos });
743
- if (this.nl !== undefined) {
744
- prop['No Local'] = this.nl;
745
- }
746
- if (this.rap !== undefined) {
747
- prop['Retain As Published'] = this.rap;
748
- }
749
- if (this.rh !== undefined) {
750
- prop['Retain Handling'] = this.rh;
751
- }
752
- return prop;
753
- }
754
- }
755
- exports.DbSubscription = DbSubscription;
756
- class DbSQSQueue extends AwsDbResource {
757
- constructor(name, url, attr) {
758
- super(types_1.ResourceType.Queue, name, attr);
759
- this.url = url;
760
- this.setPropertyFormat({
761
- dates: ['CreatedTimestamp', 'LastModifiedTimestamp'],
762
- });
763
- }
764
- getProperties() {
765
- return Object.assign(Object.assign({}, super.getProperties()), { url: this.url });
766
- }
767
- }
768
- exports.DbSQSQueue = DbSQSQueue;
769
- class DbLogGroup extends AwsDbResource {
770
- constructor(name, attr) {
771
- super(types_1.ResourceType.LogGroup, name, attr);
772
- this.setPropertyFormat({ dates: ['creationTime'], bytes: ['storedBytes'] });
773
- }
774
- }
775
- exports.DbLogGroup = DbLogGroup;
776
- class DbLogStream extends AwsDbResource {
777
- constructor(name, attr) {
778
- super(types_1.ResourceType.LogStream, name, attr);
779
- this.setPropertyFormat({
780
- dates: [
781
- 'creationTime',
782
- 'firstEventTimestamp',
783
- 'lastEventTimestamp',
784
- 'lastIngestionTime',
785
- ],
786
- });
787
- }
788
- }
789
- exports.DbLogStream = DbLogStream;
790
- class DbS3Owner extends AwsDbResource {
791
- constructor(ownerId, name) {
792
- super(types_1.ResourceType.Owner, name === undefined ? '' : name, {});
793
- this.ownerId = ownerId;
794
- }
795
- getProperties() {
796
- return Object.assign(Object.assign({}, super.getProperties()), { 'Owner id': this.ownerId });
797
- }
798
- }
799
- exports.DbS3Owner = DbS3Owner;
800
- class DbSESIdentity extends AwsDbResource {
801
- constructor(name, attr) {
802
- super(types_1.ResourceType.Identity, name, attr);
803
- }
804
- getProperties() {
805
- return Object.assign(Object.assign({}, super.getProperties()), { identityType: this.attr.identityType, verificationStatus: this.attr.verificationStatus });
806
- }
807
- }
808
- exports.DbSESIdentity = DbSESIdentity;
809
- class DbSsmParameter extends AwsDbResource {
810
- constructor(name, attr) {
811
- super(types_1.ResourceType.SsmParameter, name, attr);
812
- this.setPropertyFormat({ dates: ['lastModifiedDate'] });
813
- }
814
- }
815
- exports.DbSsmParameter = DbSsmParameter;
816
- class DbSecretsManagerSecret extends AwsDbResource {
817
- constructor(name, attr) {
818
- super(types_1.ResourceType.SecretsManagerSecret, name, attr);
819
- this.setPropertyFormat({ dates: ['lastChangedDate', 'lastAccessedDate'] });
820
- }
821
- }
822
- exports.DbSecretsManagerSecret = DbSecretsManagerSecret;
823
- class DbCfnStack extends AwsDbResource {
824
- constructor(name, attr) {
825
- super(types_1.ResourceType.CfnStack, name, attr);
826
- this.setPropertyFormat({ dates: ['creationTime'] });
827
- }
828
- }
829
- exports.DbCfnStack = DbCfnStack;
830
- class DbResourceGroup extends DbResource {
831
- constructor(name) {
832
- super(types_1.ResourceType.Group, name);
833
- }
834
- }
835
- exports.DbResourceGroup = DbResourceGroup;
836
- //# sourceMappingURL=DbResource.js.map