@candlerip/shared3 0.0.100 → 0.0.102

Sign up to get free protection for your applications and to get access to all the features.
Files changed (532) hide show
  1. package/package.json +16 -1
  2. package/src/_devops/get-project-config/domains/args/index.d.ts +5 -0
  3. package/src/_devops/get-project-config/domains/index.d.ts +1 -0
  4. package/src/_devops/get-project-config/domains/index.js +1 -0
  5. package/src/_devops/get-project-config/index.d.ts +2 -0
  6. package/src/_devops/get-project-config/index.js +18 -0
  7. package/src/aws/account-id/config.d.ts +1 -0
  8. package/src/aws/account-id/config.js +1 -0
  9. package/src/aws/app-config/get-app-config/util.d.ts +10 -0
  10. package/src/aws/app-config/get-app-config/util.js +79 -0
  11. package/src/aws/app-config/index.d.ts +1 -0
  12. package/src/aws/app-config/index.js +1 -0
  13. package/src/aws/cdk/attach-policy/type.d.ts +24 -0
  14. package/src/aws/cdk/attach-policy/util.d.ts +2 -0
  15. package/src/aws/cdk/attach-policy/util.js +33 -0
  16. package/src/aws/cdk/compose-cdk-stack/type.d.ts +2 -0
  17. package/src/aws/cdk/compose-cdk-stack/util.d.ts +2 -0
  18. package/src/aws/cdk/compose-cdk-stack/util.js +2 -0
  19. package/src/aws/cdk/index.d.ts +2 -0
  20. package/src/aws/cdk/index.js +2 -0
  21. package/src/aws/index.d.ts +7 -1
  22. package/src/aws/index.js +7 -1
  23. package/src/aws/lambda/index.d.ts +2 -0
  24. package/src/aws/lambda/index.js +2 -0
  25. package/src/aws/lambda/lambda-arn/compose-lambda-arn/type.d.ts +2 -0
  26. package/src/aws/lambda/lambda-arn/compose-lambda-arn/util.d.ts +2 -0
  27. package/src/aws/lambda/lambda-arn/compose-lambda-arn/util.js +2 -0
  28. package/src/aws/lambda/lambda-arn/config.d.ts +1 -0
  29. package/src/aws/lambda/lambda-arn/config.js +3 -0
  30. package/src/aws/lambda/lambda-arn/index.d.ts +2 -0
  31. package/src/aws/lambda/lambda-arn/index.js +2 -0
  32. package/src/aws/lambda/lambda-name/config.d.ts +1 -0
  33. package/src/aws/lambda/lambda-name/config.js +1 -0
  34. package/src/aws/lambda/lambda-name/type.d.ts +2 -0
  35. package/src/aws/s3/index.d.ts +1 -0
  36. package/src/aws/s3/index.js +1 -0
  37. package/src/aws/s3/s3-arn/compose-s3-arn/index.d.ts +1 -0
  38. package/src/aws/s3/s3-arn/compose-s3-arn/index.js +1 -0
  39. package/src/aws/s3/s3-arn/compose-s3-arn/type.d.ts +1 -0
  40. package/src/aws/s3/s3-arn/compose-s3-arn/util.d.ts +2 -0
  41. package/src/aws/s3/s3-arn/compose-s3-arn/util.js +2 -0
  42. package/src/aws/s3/s3-arn/config.d.ts +1 -0
  43. package/src/aws/s3/s3-arn/config.js +1 -0
  44. package/src/aws/s3/s3-arn/index.d.ts +2 -0
  45. package/src/aws/s3/s3-arn/index.js +2 -0
  46. package/src/aws/sqs/index.d.ts +2 -0
  47. package/src/aws/sqs/index.js +2 -0
  48. package/src/aws/sqs/queue-arn/compose-queue-arn/index.d.ts +1 -0
  49. package/src/aws/sqs/queue-arn/compose-queue-arn/index.js +1 -0
  50. package/src/aws/sqs/queue-arn/compose-queue-arn/type.d.ts +2 -0
  51. package/src/aws/sqs/queue-arn/compose-queue-arn/util.d.ts +2 -0
  52. package/src/aws/sqs/queue-arn/compose-queue-arn/util.js +2 -0
  53. package/src/aws/sqs/queue-arn/config.d.ts +1 -0
  54. package/src/aws/sqs/queue-arn/config.js +3 -0
  55. package/src/aws/sqs/queue-arn/index.d.ts +2 -0
  56. package/src/aws/sqs/queue-arn/index.js +2 -0
  57. package/src/aws/sqs/queue-name/cache/config.d.ts +1 -0
  58. package/src/aws/sqs/queue-name/cache/config.js +1 -0
  59. package/src/aws/sqs/queue-name/cache/type.d.ts +2 -0
  60. package/src/aws/sqs/queue-name/index.d.ts +3 -0
  61. package/src/aws/sqs/queue-name/index.js +3 -0
  62. package/src/aws/sqs/queue-name/logger/config.d.ts +1 -0
  63. package/src/aws/sqs/queue-name/logger/config.js +1 -0
  64. package/src/aws/sqs/queue-name/logger/type.d.ts +2 -0
  65. package/src/aws/sqs/queue-name/queue-name/config.d.ts +1 -0
  66. package/src/aws/sqs/queue-name/queue-name/config.js +3 -0
  67. package/src/aws/sqs/queue-name/queue-name/index.d.ts +2 -0
  68. package/src/aws/sqs/queue-name/queue-name/index.js +2 -0
  69. package/src/aws/sqs/queue-name/queue-name/type.d.ts +2 -0
  70. package/src/backend/cache/cache/index.d.ts +2 -0
  71. package/src/backend/cache/cache/index.js +2 -0
  72. package/src/backend/cache/cache/singleton.d.ts +23 -0
  73. package/src/backend/cache/cache/singleton.js +104 -0
  74. package/src/backend/cache/cache/type.d.ts +5 -0
  75. package/src/backend/cache/cache-key/config.d.ts +1 -0
  76. package/src/backend/cache/cache-key/config.js +18 -0
  77. package/src/backend/cache/cache-key/type-guard.d.ts +2 -0
  78. package/src/backend/cache/cache-key/type-guard.js +4 -0
  79. package/src/backend/cache/cache-key/type.d.ts +2 -0
  80. package/src/backend/cache/index.d.ts +2 -0
  81. package/src/backend/cache/index.js +2 -0
  82. package/src/backend/database/connect-database/index.d.ts +1 -0
  83. package/src/backend/database/connect-database/index.js +1 -0
  84. package/src/backend/database/connect-database/type.d.ts +1 -0
  85. package/src/backend/database/connect-database/util.d.ts +2 -0
  86. package/src/backend/database/connect-database/util.js +12 -0
  87. package/src/{candle/candles-count → backend/database/model/translation}/index.d.ts +1 -0
  88. package/src/{candle/candles-count → backend/database/model/translation}/index.js +1 -0
  89. package/src/{database → backend/database}/model/translation/type.d.ts +1 -1
  90. package/src/backend/database/model/translation/util.d.ts +7 -0
  91. package/src/backend/database/model/translation/util.js +7 -0
  92. package/src/backend/database/mutation/translation/get-translations/index.d.ts +1 -0
  93. package/src/backend/database/mutation/translation/get-translations/index.js +1 -0
  94. package/src/backend/database/mutation/translation/get-translations/type.d.ts +8 -0
  95. package/src/backend/database/mutation/translation/get-translations/util.d.ts +2 -0
  96. package/src/backend/database/mutation/translation/get-translations/util.js +30 -0
  97. package/src/backend/database/mutation/translation/get-translations-as-dictionary/index.d.ts +1 -0
  98. package/src/backend/database/mutation/translation/get-translations-as-dictionary/index.js +1 -0
  99. package/src/backend/database/mutation/translation/get-translations-as-dictionary/util.d.ts +7 -0
  100. package/src/backend/database/mutation/translation/get-translations-as-dictionary/util.js +51 -0
  101. package/src/backend/database/mutation/translation/index.d.ts +2 -0
  102. package/src/backend/database/mutation/translation/index.js +2 -0
  103. package/src/backend/dictionary/compose-dictionary/index.d.ts +1 -0
  104. package/src/backend/dictionary/compose-dictionary/index.js +1 -0
  105. package/src/backend/dictionary/compose-dictionary/type.d.ts +10 -0
  106. package/src/backend/dictionary/compose-dictionary/util.d.ts +2 -0
  107. package/src/backend/dictionary/compose-dictionary/util.js +10 -0
  108. package/src/backend/dictionary/get-excluded-translation-ids/index.d.ts +1 -0
  109. package/src/backend/dictionary/get-excluded-translation-ids/index.js +1 -0
  110. package/src/backend/dictionary/get-excluded-translation-ids/type.d.ts +5 -0
  111. package/src/backend/dictionary/get-excluded-translation-ids/util.d.ts +2 -0
  112. package/src/backend/dictionary/get-excluded-translation-ids/util.js +10 -0
  113. package/src/backend/dictionary/index.d.ts +2 -0
  114. package/src/backend/dictionary/index.js +2 -0
  115. package/src/backend/express/index.d.ts +1 -0
  116. package/src/backend/express/index.js +1 -0
  117. package/src/backend/express/start-express-app/index.d.ts +1 -0
  118. package/src/backend/express/start-express-app/index.js +1 -0
  119. package/src/backend/express/start-express-app/type.d.ts +2 -0
  120. package/src/backend/express/start-express-app/util.d.ts +2 -0
  121. package/src/backend/express/start-express-app/util.js +8 -0
  122. package/src/backend/message-broker/index.d.ts +4 -0
  123. package/src/backend/message-broker/index.js +4 -0
  124. package/src/backend/message-broker/log-custom-error/index.d.ts +1 -0
  125. package/src/backend/message-broker/log-custom-error/index.js +1 -0
  126. package/src/backend/message-broker/log-custom-error/type.d.ts +2 -0
  127. package/src/backend/message-broker/log-custom-error/util.d.ts +2 -0
  128. package/src/backend/message-broker/log-custom-error/util.js +2 -0
  129. package/src/backend/message-broker/message-broker/config.d.ts +4 -0
  130. package/src/backend/message-broker/message-broker/config.js +4 -0
  131. package/src/backend/message-broker/message-broker/index.d.ts +3 -0
  132. package/src/backend/message-broker/message-broker/index.js +3 -0
  133. package/src/backend/message-broker/message-broker/singleton.d.ts +7 -0
  134. package/src/backend/message-broker/message-broker/singleton.js +70 -0
  135. package/src/backend/message-broker/message-broker/type.d.ts +12 -0
  136. package/src/backend/message-broker/message-broker-queue-name/type.d.ts +2 -0
  137. package/src/backend/message-broker/message-broker-refresh-cache/index.d.ts +2 -0
  138. package/src/backend/message-broker/message-broker-refresh-cache/index.js +2 -0
  139. package/src/backend/message-broker/message-broker-refresh-cache/refresh-cache/index.d.ts +1 -0
  140. package/src/backend/message-broker/message-broker-refresh-cache/refresh-cache/index.js +1 -0
  141. package/src/backend/message-broker/message-broker-refresh-cache/refresh-cache/type.d.ts +2 -0
  142. package/src/backend/message-broker/message-broker-refresh-cache/refresh-cache/util.d.ts +2 -0
  143. package/src/backend/message-broker/message-broker-refresh-cache/refresh-cache/util.js +6 -0
  144. package/src/backend/message-broker/message-broker-refresh-cache/type.d.ts +4 -0
  145. package/src/dictionary/dictionary/config.js +1 -1
  146. package/src/dictionary/translation-id/index.d.ts +5 -0
  147. package/src/dictionary/translation-id/index.js +5 -0
  148. package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/index.d.ts +0 -1
  149. package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/index.js +0 -1
  150. package/src/error/custom-error/console-custom-error/index.d.ts +2 -1
  151. package/src/error/custom-error/console-custom-error/index.js +10 -1
  152. package/src/helper/promise-all/index.d.ts +12 -1
  153. package/src/helper/promise-all/index.js +24 -1
  154. package/src/index.d.ts +1 -12
  155. package/src/index.js +1 -12
  156. package/src/page/index.d.ts +3 -2
  157. package/src/page/index.js +3 -2
  158. package/src/type/index.d.ts +1 -1
  159. package/src/type/index.js +1 -1
  160. package/src/type/null/index.d.ts +1 -0
  161. package/src/type/null/index.js +1 -0
  162. package/src/type/object/index.d.ts +3 -2
  163. package/src/type/object/index.js +3 -2
  164. package/src/type/object/properties-in-object/index.d.ts +1 -0
  165. package/src/type/object/properties-in-object/index.js +1 -0
  166. package/src/type/object/{is-object/properties-in-object/index.js → properties-in-object/type-guard.js} +2 -2
  167. package/src/type/object/property-in-object/index.d.ts +1 -0
  168. package/src/type/object/property-in-object/index.js +1 -0
  169. package/src/type/object/{is-object/property-in-object/index.js → property-in-object/type-guard.js} +1 -1
  170. package/src/type/object/{is-object/object/index.js → type-guard.js} +2 -2
  171. package/src/type/string/comma-separated/index.d.ts +1 -0
  172. package/src/type/string/comma-separated/index.js +1 -0
  173. package/src/type/string/index.d.ts +1 -1
  174. package/src/type/string/index.js +1 -1
  175. package/src/auth/type.d.ts +0 -8
  176. package/src/candle/burning-candle-state/config.d.ts +0 -1
  177. package/src/candle/burning-candle-state/config.js +0 -1
  178. package/src/candle/burning-candle-state/type-guard.d.ts +0 -2
  179. package/src/candle/burning-candle-state/type-guard.js +0 -4
  180. package/src/candle/burning-candle-state/type.d.ts +0 -2
  181. package/src/candle/candle-ext-person/index.d.ts +0 -1
  182. package/src/candle/candle-ext-person/index.js +0 -1
  183. package/src/candle/candle-ext-person/type.d.ts +0 -4
  184. package/src/candle/candles-count/type.d.ts +0 -6
  185. package/src/candle/has-candle-permission/type.d.ts +0 -4
  186. package/src/candle/has-candle-permission/util.d.ts +0 -2
  187. package/src/candle/has-candle-permission/util.js +0 -13
  188. package/src/candle/index.d.ts +0 -4
  189. package/src/candle/index.js +0 -4
  190. package/src/cookie/consent/cookie-consent/compose-cookie-consent/type.d.ts +0 -2
  191. package/src/cookie/consent/cookie-consent/compose-cookie-consent/util.d.ts +0 -2
  192. package/src/cookie/consent/cookie-consent/compose-cookie-consent/util.js +0 -5
  193. package/src/cookie/consent/cookie-consent/config.d.ts +0 -3
  194. package/src/cookie/consent/cookie-consent/config.js +0 -3
  195. package/src/cookie/consent/cookie-consent/default.d.ts +0 -2
  196. package/src/cookie/consent/cookie-consent/default.js +0 -3
  197. package/src/cookie/consent/cookie-consent/index.d.ts +0 -4
  198. package/src/cookie/consent/cookie-consent/index.js +0 -4
  199. package/src/cookie/consent/cookie-consent/type.d.ts +0 -9
  200. package/src/cookie/consent/cookie-consent-key/config.d.ts +0 -2
  201. package/src/cookie/consent/cookie-consent-key/config.js +0 -2
  202. package/src/cookie/consent/cookie-consent-key/type.d.ts +0 -2
  203. package/src/cookie/consent/index.d.ts +0 -2
  204. package/src/cookie/consent/index.js +0 -2
  205. package/src/cookie/index.d.ts +0 -1
  206. package/src/cookie/index.js +0 -1
  207. package/src/database/index.d.ts +0 -1
  208. package/src/database/index.js +0 -1
  209. package/src/database/model/candle/index.d.ts +0 -1
  210. package/src/database/model/candle/index.js +0 -1
  211. package/src/database/model/candle/type.d.ts +0 -11
  212. package/src/database/model/contact/index.d.ts +0 -1
  213. package/src/database/model/contact/index.js +0 -1
  214. package/src/database/model/contact/type.d.ts +0 -9
  215. package/src/database/model/country/index.d.ts +0 -1
  216. package/src/database/model/country/index.js +0 -1
  217. package/src/database/model/country/type.d.ts +0 -13
  218. package/src/database/model/error-log/index.d.ts +0 -1
  219. package/src/database/model/error-log/index.js +0 -1
  220. package/src/database/model/error-log/type.d.ts +0 -7
  221. package/src/database/model/index.d.ts +0 -6
  222. package/src/database/model/index.js +0 -6
  223. package/src/database/model/person/index.d.ts +0 -2
  224. package/src/database/model/person/index.js +0 -2
  225. package/src/database/model/person/person-image/index.d.ts +0 -1
  226. package/src/database/model/person/person-image/index.js +0 -1
  227. package/src/database/model/person/person-image/type.d.ts +0 -10
  228. package/src/database/model/person/type.d.ts +0 -21
  229. package/src/database/model/translation/index.d.ts +0 -1
  230. package/src/database/model/translation/index.js +0 -1
  231. package/src/date/index.d.ts +0 -1
  232. package/src/date/index.js +0 -1
  233. package/src/date/minutes/config.d.ts +0 -8
  234. package/src/date/minutes/config.js +0 -9
  235. package/src/dictionary/translation-ids/index.d.ts +0 -5
  236. package/src/dictionary/translation-ids/index.js +0 -5
  237. package/src/dictionary/translation-ids/page-translation-ids/candles-page-translation-ids/config.d.ts +0 -1
  238. package/src/dictionary/translation-ids/page-translation-ids/candles-page-translation-ids/config.js +0 -4
  239. package/src/dictionary/translation-ids/time/time-abbreviation/index.d.ts +0 -1
  240. package/src/dictionary/translation-ids/time/time-abbreviation/index.js +0 -1
  241. package/src/error/custom-error/console-custom-error/util.d.ts +0 -2
  242. package/src/error/custom-error/console-custom-error/util.js +0 -10
  243. package/src/filter-sort/filter-sort/candle-filter-sort/domains/index.d.ts +0 -12
  244. package/src/filter-sort/filter-sort/candle-filter-sort/index.d.ts +0 -1
  245. package/src/filter-sort/filter-sort/candle-filter-sort/index.js +0 -1
  246. package/src/filter-sort/filter-sort/index.d.ts +0 -2
  247. package/src/filter-sort/filter-sort/index.js +0 -2
  248. package/src/filter-sort/filter-sort/person-filter-sort/domains/index.d.ts +0 -14
  249. package/src/filter-sort/filter-sort/person-filter-sort/domains/index.js +0 -1
  250. package/src/filter-sort/filter-sort/person-filter-sort/index.d.ts +0 -1
  251. package/src/filter-sort/filter-sort/person-filter-sort/index.js +0 -1
  252. package/src/filter-sort/index.d.ts +0 -4
  253. package/src/filter-sort/index.js +0 -4
  254. package/src/filter-sort/sort/domains/index.d.ts +0 -5
  255. package/src/filter-sort/sort/domains/index.js +0 -1
  256. package/src/filter-sort/sort/index.d.ts +0 -1
  257. package/src/filter-sort/sort/index.js +0 -1
  258. package/src/filter-sort/sort-name/candle-sort-name/configs/index.d.ts +0 -1
  259. package/src/filter-sort/sort-name/candle-sort-name/configs/index.js +0 -1
  260. package/src/filter-sort/sort-name/candle-sort-name/domains/index.d.ts +0 -2
  261. package/src/filter-sort/sort-name/candle-sort-name/domains/index.js +0 -1
  262. package/src/filter-sort/sort-name/candle-sort-name/index.d.ts +0 -3
  263. package/src/filter-sort/sort-name/candle-sort-name/index.js +0 -3
  264. package/src/filter-sort/sort-name/candle-sort-name/type-guards/index.d.ts +0 -1
  265. package/src/filter-sort/sort-name/candle-sort-name/type-guards/index.js +0 -1
  266. package/src/filter-sort/sort-name/candle-sort-name/type-guards/is-candle-sort-name/index.d.ts +0 -2
  267. package/src/filter-sort/sort-name/candle-sort-name/type-guards/is-candle-sort-name/index.js +0 -4
  268. package/src/filter-sort/sort-name/index.d.ts +0 -2
  269. package/src/filter-sort/sort-name/index.js +0 -2
  270. package/src/filter-sort/sort-name/person-sort-name/configs/index.d.ts +0 -1
  271. package/src/filter-sort/sort-name/person-sort-name/configs/index.js +0 -1
  272. package/src/filter-sort/sort-name/person-sort-name/domains/index.d.ts +0 -2
  273. package/src/filter-sort/sort-name/person-sort-name/domains/index.js +0 -1
  274. package/src/filter-sort/sort-name/person-sort-name/index.d.ts +0 -3
  275. package/src/filter-sort/sort-name/person-sort-name/index.js +0 -3
  276. package/src/filter-sort/sort-name/person-sort-name/type-guards/index.d.ts +0 -1
  277. package/src/filter-sort/sort-name/person-sort-name/type-guards/index.js +0 -1
  278. package/src/filter-sort/sort-name/person-sort-name/type-guards/is-person-sort-name/index.d.ts +0 -2
  279. package/src/filter-sort/sort-name/person-sort-name/type-guards/is-person-sort-name/index.js +0 -4
  280. package/src/filter-sort/sort-order/configs/index.d.ts +0 -1
  281. package/src/filter-sort/sort-order/configs/index.js +0 -1
  282. package/src/filter-sort/sort-order/domains/index.d.ts +0 -2
  283. package/src/filter-sort/sort-order/domains/index.js +0 -1
  284. package/src/filter-sort/sort-order/index.d.ts +0 -3
  285. package/src/filter-sort/sort-order/index.js +0 -3
  286. package/src/filter-sort/sort-order/type-guards/index.d.ts +0 -1
  287. package/src/filter-sort/sort-order/type-guards/index.js +0 -1
  288. package/src/filter-sort/sort-order/type-guards/is-sort-order/index.d.ts +0 -2
  289. package/src/filter-sort/sort-order/type-guards/is-sort-order/index.js +0 -4
  290. package/src/geographical/county-code/config.d.ts +0 -1
  291. package/src/geographical/county-code/config.js +0 -248
  292. package/src/geographical/county-code/index.d.ts +0 -3
  293. package/src/geographical/county-code/index.js +0 -3
  294. package/src/geographical/county-code/type-guard.d.ts +0 -2
  295. package/src/geographical/county-code/type-guard.js +0 -4
  296. package/src/geographical/county-code/type.d.ts +0 -2
  297. package/src/geographical/index.d.ts +0 -1
  298. package/src/geographical/index.js +0 -1
  299. package/src/helper/promise-all/util.d.ts +0 -12
  300. package/src/helper/promise-all/util.js +0 -24
  301. package/src/image/convert-base-64-image/type.d.ts +0 -1
  302. package/src/image/convert-base-64-image/util.d.ts +0 -2
  303. package/src/image/convert-base-64-image/util.js +0 -1
  304. package/src/image/image/index.d.ts +0 -1
  305. package/src/image/image/index.js +0 -1
  306. package/src/image/image/type.d.ts +0 -5
  307. package/src/image/image-dimension/index.d.ts +0 -1
  308. package/src/image/image-dimension/index.js +0 -1
  309. package/src/image/image-dimension/type.d.ts +0 -5
  310. package/src/image/index.d.ts +0 -3
  311. package/src/image/index.js +0 -3
  312. package/src/page/page/index.d.ts +0 -3
  313. package/src/page/page/index.js +0 -3
  314. package/src/page/page-data/candle-details/index.d.ts +0 -1
  315. package/src/page/page-data/candle-details/index.js +0 -1
  316. package/src/page/page-data/candle-details/type.d.ts +0 -6
  317. package/src/page/page-data/candles-page-data.type.d.ts +0 -7
  318. package/src/page/page-data/candles-page-data.type.js +0 -1
  319. package/src/page/page-data/edit-candle/index.d.ts +0 -1
  320. package/src/page/page-data/edit-candle/index.js +0 -1
  321. package/src/page/page-data/edit-candle/type.d.ts +0 -8
  322. package/src/page/page-data/index.d.ts +0 -4
  323. package/src/page/page-data/index.js +0 -4
  324. package/src/page/page-data/light-candle/index.d.ts +0 -1
  325. package/src/page/page-data/light-candle/index.js +0 -1
  326. package/src/page/page-data/light-candle/type.d.ts +0 -6
  327. package/src/person/birth-place-country/index.d.ts +0 -1
  328. package/src/person/birth-place-country/index.js +0 -1
  329. package/src/person/birth-place-country/type.d.ts +0 -4
  330. package/src/person/birth-place-country/type.js +0 -1
  331. package/src/person/index.d.ts +0 -3
  332. package/src/person/index.js +0 -3
  333. package/src/person/person-image/index.d.ts +0 -2
  334. package/src/person/person-image/index.js +0 -2
  335. package/src/person/person-image/person-image-file-name/config.d.ts +0 -1
  336. package/src/person/person-image/person-image-file-name/config.js +0 -2
  337. package/src/person/person-image/person-image-file-name/type.d.ts +0 -2
  338. package/src/person/person-image/person-image-file-name/type.js +0 -1
  339. package/src/person/person-image/person-image-width/config.d.ts +0 -1
  340. package/src/person/person-image/person-image-width/config.js +0 -1
  341. package/src/person/person-image/person-image-width/type.d.ts +0 -2
  342. package/src/person/person-image/person-image-width/type.js +0 -1
  343. package/src/person/persons-count/index.d.ts +0 -1
  344. package/src/person/persons-count/index.js +0 -1
  345. package/src/person/persons-count/type.d.ts +0 -3
  346. package/src/person/persons-count/type.js +0 -1
  347. package/src/ssr/index.d.ts +0 -1
  348. package/src/ssr/index.js +0 -1
  349. package/src/ssr/server-side-props/candle-details-page/index.d.ts +0 -1
  350. package/src/ssr/server-side-props/candle-details-page/index.js +0 -1
  351. package/src/ssr/server-side-props/candle-details-page/type.d.ts +0 -11
  352. package/src/ssr/server-side-props/candle-details-page/type.js +0 -1
  353. package/src/ssr/server-side-props/candles-page-server-side-props.type.d.ts +0 -13
  354. package/src/ssr/server-side-props/candles-page-server-side-props.type.js +0 -1
  355. package/src/ssr/server-side-props/contact-page/index.d.ts +0 -1
  356. package/src/ssr/server-side-props/contact-page/index.js +0 -1
  357. package/src/ssr/server-side-props/contact-page/type.d.ts +0 -9
  358. package/src/ssr/server-side-props/contact-page/type.js +0 -1
  359. package/src/ssr/server-side-props/cookie-policy-page/index.d.ts +0 -1
  360. package/src/ssr/server-side-props/cookie-policy-page/index.js +0 -1
  361. package/src/ssr/server-side-props/cookie-policy-page/type.d.ts +0 -9
  362. package/src/ssr/server-side-props/cookie-policy-page/type.js +0 -1
  363. package/src/ssr/server-side-props/edit-candle-page/index.d.ts +0 -1
  364. package/src/ssr/server-side-props/edit-candle-page/index.js +0 -1
  365. package/src/ssr/server-side-props/edit-candle-page/type.d.ts +0 -11
  366. package/src/ssr/server-side-props/edit-candle-page/type.js +0 -1
  367. package/src/ssr/server-side-props/help-page/index.d.ts +0 -1
  368. package/src/ssr/server-side-props/help-page/index.js +0 -1
  369. package/src/ssr/server-side-props/help-page/type.d.ts +0 -9
  370. package/src/ssr/server-side-props/help-page/type.js +0 -1
  371. package/src/ssr/server-side-props/index.d.ts +0 -9
  372. package/src/ssr/server-side-props/index.js +0 -9
  373. package/src/ssr/server-side-props/light-candle-page/index.d.ts +0 -1
  374. package/src/ssr/server-side-props/light-candle-page/index.js +0 -1
  375. package/src/ssr/server-side-props/light-candle-page/type.d.ts +0 -11
  376. package/src/ssr/server-side-props/light-candle-page/type.js +0 -1
  377. package/src/ssr/server-side-props/terms-and-conditions-page/index.d.ts +0 -1
  378. package/src/ssr/server-side-props/terms-and-conditions-page/index.js +0 -1
  379. package/src/ssr/server-side-props/terms-and-conditions-page/type.d.ts +0 -9
  380. package/src/ssr/server-side-props/terms-and-conditions-page/type.js +0 -1
  381. package/src/ssr/server-side-props/type.d.ts +0 -9
  382. package/src/ssr/server-side-props/type.js +0 -1
  383. package/src/type/object/add-prefix-to-object-props/type.d.ts +0 -1
  384. package/src/type/object/add-prefix-to-object-props/type.js +0 -1
  385. package/src/type/object/add-prefix-to-object-props/util.d.ts +0 -2
  386. package/src/type/object/add-prefix-to-object-props/util.js +0 -1
  387. package/src/type/object/is-object/index.d.ts +0 -3
  388. package/src/type/object/is-object/index.js +0 -3
  389. /package/src/{filter-sort/filter-sort/candle-filter-sort/domains → _devops/get-project-config/domains/args}/index.js +0 -0
  390. /package/src/{date/minutes → aws/account-id}/index.d.ts +0 -0
  391. /package/src/{date/minutes → aws/account-id}/index.js +0 -0
  392. /package/src/{candle/has-candle-permission → aws/app-config/get-app-config}/index.d.ts +0 -0
  393. /package/src/{candle/has-candle-permission → aws/app-config/get-app-config}/index.js +0 -0
  394. /package/src/{cookie/consent/cookie-consent/compose-cookie-consent → aws/cdk/attach-policy}/index.d.ts +0 -0
  395. /package/src/{cookie/consent/cookie-consent/compose-cookie-consent → aws/cdk/attach-policy}/index.js +0 -0
  396. /package/src/{auth → aws/cdk/attach-policy}/type.js +0 -0
  397. /package/src/{image/convert-base-64-image → aws/cdk/compose-cdk-stack}/index.d.ts +0 -0
  398. /package/src/{image/convert-base-64-image → aws/cdk/compose-cdk-stack}/index.js +0 -0
  399. /package/src/aws/{aws-region → cdk/compose-cdk-stack}/type.js +0 -0
  400. /package/src/{type/object/add-prefix-to-object-props → aws/lambda/lambda-arn/compose-lambda-arn}/index.d.ts +0 -0
  401. /package/src/{type/object/add-prefix-to-object-props → aws/lambda/lambda-arn/compose-lambda-arn}/index.js +0 -0
  402. /package/src/{candle/burning-candle-state → aws/lambda/lambda-arn/compose-lambda-arn}/type.js +0 -0
  403. /package/src/{cookie/consent/cookie-consent-key → aws/lambda/lambda-name}/index.d.ts +0 -0
  404. /package/src/{cookie/consent/cookie-consent-key → aws/lambda/lambda-name}/index.js +0 -0
  405. /package/src/{candle/candle-ext-person → aws/lambda/lambda-name}/type.js +0 -0
  406. /package/src/aws/{aws-region → region}/config.d.ts +0 -0
  407. /package/src/aws/{aws-region → region}/config.js +0 -0
  408. /package/src/aws/{aws-region → region}/default.d.ts +0 -0
  409. /package/src/aws/{aws-region → region}/default.js +0 -0
  410. /package/src/aws/{aws-region → region}/index.d.ts +0 -0
  411. /package/src/aws/{aws-region → region}/index.js +0 -0
  412. /package/src/aws/{aws-region → region}/type.d.ts +0 -0
  413. /package/src/{candle/candles-count → aws/region}/type.js +0 -0
  414. /package/src/{candle/has-candle-permission → aws/s3/s3-arn/compose-s3-arn}/type.js +0 -0
  415. /package/src/{cookie/consent/cookie-consent-key → aws/sqs/queue-arn/compose-queue-arn}/type.js +0 -0
  416. /package/src/{person/person-image/person-image-file-name → aws/sqs/queue-name/cache}/index.d.ts +0 -0
  417. /package/src/{person/person-image/person-image-file-name → aws/sqs/queue-name/cache}/index.js +0 -0
  418. /package/src/{cookie/consent/cookie-consent/compose-cookie-consent → aws/sqs/queue-name/cache}/type.js +0 -0
  419. /package/src/{person/person-image/person-image-width → aws/sqs/queue-name/logger}/index.d.ts +0 -0
  420. /package/src/{person/person-image/person-image-width → aws/sqs/queue-name/logger}/index.js +0 -0
  421. /package/src/{cookie/consent/cookie-consent → aws/sqs/queue-name/logger}/type.js +0 -0
  422. /package/src/{database/model/candle → aws/sqs/queue-name/queue-name}/type.js +0 -0
  423. /package/src/{database/model/country → backend/cache/cache}/type.js +0 -0
  424. /package/src/{candle/burning-candle-state → backend/cache/cache-key}/index.d.ts +0 -0
  425. /package/src/{candle/burning-candle-state → backend/cache/cache-key}/index.js +0 -0
  426. /package/src/{database/model/contact → backend/cache/cache-key}/type.js +0 -0
  427. /package/src/{database/model/error-log → backend/database/connect-database}/type.js +0 -0
  428. /package/src/{database/model/person/person-image → backend/database/model/translation}/type.js +0 -0
  429. /package/src/{database/model/person → backend/database/mutation/translation/get-translations}/type.js +0 -0
  430. /package/src/{database/model/translation → backend/dictionary/compose-dictionary}/type.js +0 -0
  431. /package/src/{geographical/county-code → backend/dictionary/get-excluded-translation-ids}/type.js +0 -0
  432. /package/src/{image/convert-base-64-image → backend/express/start-express-app}/type.js +0 -0
  433. /package/src/{image/image-dimension → backend/message-broker/log-custom-error}/type.js +0 -0
  434. /package/src/{page/page-data/light-candle → backend/message-broker/message-broker}/type.js +0 -0
  435. /package/src/{auth → backend/message-broker/message-broker-queue-name}/index.d.ts +0 -0
  436. /package/src/{auth → backend/message-broker/message-broker-queue-name}/index.js +0 -0
  437. /package/src/{image/image → backend/message-broker/message-broker-queue-name}/type.js +0 -0
  438. /package/src/{page/page-data/candle-details → backend/message-broker/message-broker-refresh-cache/refresh-cache}/type.js +0 -0
  439. /package/src/{page/page-data/edit-candle → backend/message-broker/message-broker-refresh-cache}/type.js +0 -0
  440. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-card/config.d.ts +0 -0
  441. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-card/config.js +0 -0
  442. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-card/index.d.ts +0 -0
  443. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-card/index.js +0 -0
  444. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-cards/config.d.ts +0 -0
  445. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-cards/config.js +0 -0
  446. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-cards/index.d.ts +0 -0
  447. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-cards/index.js +0 -0
  448. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-image/config.d.ts +0 -0
  449. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-image/config.js +0 -0
  450. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-image/index.d.ts +0 -0
  451. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-image/index.js +0 -0
  452. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-maintenance/config.d.ts +0 -0
  453. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-maintenance/config.js +0 -0
  454. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-maintenance/index.d.ts +0 -0
  455. /package/src/dictionary/{translation-ids → translation-id}/candle/candle-maintenance/index.js +0 -0
  456. /package/src/dictionary/{translation-ids → translation-id}/candle/candles-list/config.d.ts +0 -0
  457. /package/src/dictionary/{translation-ids → translation-id}/candle/candles-list/config.js +0 -0
  458. /package/src/dictionary/{translation-ids → translation-id}/candle/candles-list/index.d.ts +0 -0
  459. /package/src/dictionary/{translation-ids → translation-id}/candle/candles-list/index.js +0 -0
  460. /package/src/dictionary/{translation-ids → translation-id}/candle/index.d.ts +0 -0
  461. /package/src/dictionary/{translation-ids → translation-id}/candle/index.js +0 -0
  462. /package/src/dictionary/{translation-ids → translation-id}/common-page/config.d.ts +0 -0
  463. /package/src/dictionary/{translation-ids → translation-id}/common-page/config.js +0 -0
  464. /package/src/dictionary/{translation-ids → translation-id}/common-page/index.d.ts +0 -0
  465. /package/src/dictionary/{translation-ids → translation-id}/common-page/index.js +0 -0
  466. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/add-person-page-translation-ids/config.d.ts +0 -0
  467. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/add-person-page-translation-ids/config.js +0 -0
  468. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/add-person-page-translation-ids/index.d.ts +0 -0
  469. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/add-person-page-translation-ids/index.js +0 -0
  470. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/edit-person-page-translation-ids/config.d.ts +0 -0
  471. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/edit-person-page-translation-ids/config.js +0 -0
  472. /package/src/dictionary/{translation-ids/page-translation-ids/candles-page-translation-ids → translation-id/page/edit-person-page-translation-ids}/index.d.ts +0 -0
  473. /package/src/dictionary/{translation-ids/page-translation-ids/candles-page-translation-ids → translation-id/page/edit-person-page-translation-ids}/index.js +0 -0
  474. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/person-candles-page-translation-ids/config.d.ts +0 -0
  475. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/person-candles-page-translation-ids/config.js +0 -0
  476. /package/src/dictionary/{translation-ids/page-translation-ids/edit-person-page-translation-ids → translation-id/page/person-candles-page-translation-ids}/index.d.ts +0 -0
  477. /package/src/dictionary/{translation-ids/page-translation-ids/edit-person-page-translation-ids → translation-id/page/person-candles-page-translation-ids}/index.js +0 -0
  478. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/person-details-page-translation-ids/config.d.ts +0 -0
  479. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/person-details-page-translation-ids/config.js +0 -0
  480. /package/src/dictionary/{translation-ids/page-translation-ids/person-candles-page-translation-ids → translation-id/page/person-details-page-translation-ids}/index.d.ts +0 -0
  481. /package/src/dictionary/{translation-ids/page-translation-ids/person-candles-page-translation-ids → translation-id/page/person-details-page-translation-ids}/index.js +0 -0
  482. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/persons-map-page-translation-ids/config.d.ts +0 -0
  483. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/persons-map-page-translation-ids/config.js +0 -0
  484. /package/src/dictionary/{translation-ids/page-translation-ids/person-details-page-translation-ids → translation-id/page/persons-map-page-translation-ids}/index.d.ts +0 -0
  485. /package/src/dictionary/{translation-ids/page-translation-ids/person-details-page-translation-ids → translation-id/page/persons-map-page-translation-ids}/index.js +0 -0
  486. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/persons-page-translation-ids/config.d.ts +0 -0
  487. /package/src/dictionary/{translation-ids/page-translation-ids → translation-id/page}/persons-page-translation-ids/config.js +0 -0
  488. /package/src/dictionary/{translation-ids/page-translation-ids/persons-map-page-translation-ids → translation-id/page/persons-page-translation-ids}/index.d.ts +0 -0
  489. /package/src/dictionary/{translation-ids/page-translation-ids/persons-map-page-translation-ids → translation-id/page/persons-page-translation-ids}/index.js +0 -0
  490. /package/src/dictionary/{translation-ids → translation-id}/person/index.d.ts +0 -0
  491. /package/src/dictionary/{translation-ids → translation-id}/person/index.js +0 -0
  492. /package/src/dictionary/{translation-ids → translation-id}/person/person-card/config.d.ts +0 -0
  493. /package/src/dictionary/{translation-ids → translation-id}/person/person-card/config.js +0 -0
  494. /package/src/dictionary/{translation-ids/page-translation-ids/persons-page-translation-ids → translation-id/person/person-card}/index.d.ts +0 -0
  495. /package/src/dictionary/{translation-ids/page-translation-ids/persons-page-translation-ids → translation-id/person/person-card}/index.js +0 -0
  496. /package/src/dictionary/{translation-ids → translation-id}/person/person-cards/config.d.ts +0 -0
  497. /package/src/dictionary/{translation-ids → translation-id}/person/person-cards/config.js +0 -0
  498. /package/src/dictionary/{translation-ids/person/person-card → translation-id/person/person-cards}/index.d.ts +0 -0
  499. /package/src/dictionary/{translation-ids/person/person-card → translation-id/person/person-cards}/index.js +0 -0
  500. /package/src/dictionary/{translation-ids → translation-id}/person/person-image/config.d.ts +0 -0
  501. /package/src/dictionary/{translation-ids → translation-id}/person/person-image/config.js +0 -0
  502. /package/src/dictionary/{translation-ids/person/person-cards → translation-id/person/person-image}/index.d.ts +0 -0
  503. /package/src/dictionary/{translation-ids/person/person-cards → translation-id/person/person-image}/index.js +0 -0
  504. /package/src/dictionary/{translation-ids → translation-id}/person/person-maintenance/config.d.ts +0 -0
  505. /package/src/dictionary/{translation-ids → translation-id}/person/person-maintenance/config.js +0 -0
  506. /package/src/dictionary/{translation-ids/person/person-image → translation-id/person/person-maintenance}/index.d.ts +0 -0
  507. /package/src/dictionary/{translation-ids/person/person-image → translation-id/person/person-maintenance}/index.js +0 -0
  508. /package/src/dictionary/{translation-ids → translation-id}/person/persons-list/config.d.ts +0 -0
  509. /package/src/dictionary/{translation-ids → translation-id}/person/persons-list/config.js +0 -0
  510. /package/src/dictionary/{translation-ids/person/person-maintenance → translation-id/person/persons-list}/index.d.ts +0 -0
  511. /package/src/dictionary/{translation-ids/person/person-maintenance → translation-id/person/persons-list}/index.js +0 -0
  512. /package/src/dictionary/{translation-ids → translation-id}/time/index.d.ts +0 -0
  513. /package/src/dictionary/{translation-ids → translation-id}/time/index.js +0 -0
  514. /package/src/dictionary/{translation-ids → translation-id}/time/time-abbreviation/config.d.ts +0 -0
  515. /package/src/dictionary/{translation-ids → translation-id}/time/time-abbreviation/config.js +0 -0
  516. /package/src/dictionary/{translation-ids/person/persons-list → translation-id/time/time-abbreviation}/index.d.ts +0 -0
  517. /package/src/dictionary/{translation-ids/person/persons-list → translation-id/time/time-abbreviation}/index.js +0 -0
  518. /package/src/page/{page/config.d.ts → config.d.ts} +0 -0
  519. /package/src/page/{page/config.js → config.js} +0 -0
  520. /package/src/page/{page/type-guard.d.ts → type-guard.d.ts} +0 -0
  521. /package/src/page/{page/type-guard.js → type-guard.js} +0 -0
  522. /package/src/page/{page/type.d.ts → type.d.ts} +0 -0
  523. /package/src/page/{page/type.js → type.js} +0 -0
  524. /package/src/type/{is-null/index.d.ts → null/type-guard.d.ts} +0 -0
  525. /package/src/type/{is-null/index.js → null/type-guard.js} +0 -0
  526. /package/src/type/object/{is-object/properties-in-object/index.d.ts → properties-in-object/type-guard.d.ts} +0 -0
  527. /package/src/type/object/{is-object/property-in-object/index.d.ts → property-in-object/type-guard.d.ts} +0 -0
  528. /package/src/type/object/{is-object/object/index.d.ts → type-guard.d.ts} +0 -0
  529. /package/src/type/string/{validate-comma-separated-string → comma-separated}/types.d.ts +0 -0
  530. /package/src/type/string/{validate-comma-separated-string → comma-separated}/types.js +0 -0
  531. /package/src/type/string/{validate-comma-separated-string/index.d.ts → comma-separated/validate.d.ts} +0 -0
  532. /package/src/type/string/{validate-comma-separated-string/index.js → comma-separated/validate.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.100",
3
+ "version": "0.0.102",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  "crs-docker-publish": "./_devops/docker/docker-publish.sh",
9
9
  "crs-ec2-deploy": "./_devops/ec2/ec2-deploy.sh",
10
10
  "crs-eslint": "./_devops/eslint/eslint.sh",
11
+ "crs-get-project-config": "./src/_devops/get-project-config/index.js",
11
12
  "crs-git-push": "./_devops/git/git-push.sh",
12
13
  "crs-npm-patch-version": "./_devops/npm/npm-patch-version.sh",
13
14
  "crs-npm-publish": "./_devops/npm/npm-publish.sh",
@@ -21,6 +22,8 @@
21
22
  "start": "./_devops/typescript/tsc-watch.sh"
22
23
  },
23
24
  "devDependencies": {
25
+ "@types/amqplib": "^0.10.5",
26
+ "@types/express": "^5.0.0",
24
27
  "@types/node": "^22.7.4",
25
28
  "eslint": "^9.12.0",
26
29
  "globals": "^15.10.0",
@@ -28,5 +31,17 @@
28
31
  "tsc-alias": "^1.8.10",
29
32
  "typescript": "^5.6.2",
30
33
  "typescript-eslint": "^8.8.0"
34
+ },
35
+ "dependencies": {
36
+ "@aws-sdk/client-appconfig": "^3.682.0",
37
+ "@aws-sdk/client-appconfigdata": "^3.682.0",
38
+ "@aws-sdk/client-s3": "^3.685.0",
39
+ "amqplib": "^0.10.4",
40
+ "aws-cdk-lib": "^2.165.0",
41
+ "commander": "^12.1.0",
42
+ "dotenv": "^16.4.5",
43
+ "express": "^4.21.1",
44
+ "mongoose": "^8.8.0",
45
+ "redis": "^4.7.0"
31
46
  }
32
47
  }
@@ -0,0 +1,5 @@
1
+ import { EnvironmentMode, EnvironmentVariables } from '../../../../environment/index.js';
2
+ export interface Args {
3
+ projectName: keyof EnvironmentVariables;
4
+ environmentMode: EnvironmentMode;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './args/index.js';
@@ -0,0 +1 @@
1
+ export * from './args/index.js';
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { program } from 'commander';
3
+ import * as fs from 'fs';
4
+ import { getAppConfig } from '../../aws/index.js';
5
+ import { ProjectSingleton } from '../../project/index.js';
6
+ import { consoleCustomError } from '../../error/index.js';
7
+ ProjectSingleton.init('shared-aws');
8
+ program.requiredOption('--project-name <value>').requiredOption('--environment-mode <value>');
9
+ program.parse();
10
+ const { environmentMode, projectName } = program.opts();
11
+ const resp = await getAppConfig({ projectName, environmentMode });
12
+ if ('customError' in resp) {
13
+ consoleCustomError(resp.customError);
14
+ process.exit(1);
15
+ }
16
+ const config = resp.data;
17
+ const fileData = Object.keys(config).map((it) => `${it}=${config[it]}`).join('\n');
18
+ fs.writeFileSync(`.env.${environmentMode}`, fileData);
@@ -0,0 +1 @@
1
+ export declare const AWS_ACCOUNT_ID = 430408040574;
@@ -0,0 +1 @@
1
+ export const AWS_ACCOUNT_ID = 430408040574;
@@ -0,0 +1,10 @@
1
+ import { EnvironmentMode, EnvironmentVariables } from '../../../environment/index.js';
2
+ import { CustomError } from '../../../error/index.js';
3
+ export declare const getAppConfig: <T extends keyof EnvironmentVariables>(props: {
4
+ environmentMode: EnvironmentMode;
5
+ projectName: T;
6
+ }) => Promise<{
7
+ data: EnvironmentVariables[T];
8
+ } | {
9
+ customError: CustomError;
10
+ }>;
@@ -0,0 +1,79 @@
1
+ import * as appConfigDataSdk from '@aws-sdk/client-appconfigdata';
2
+ import * as appConfigSdk from '@aws-sdk/client-appconfig';
3
+ import { customErrorWorker } from '../../../error/index.js';
4
+ export const getAppConfig = async (props) => {
5
+ const { environmentMode, projectName } = props;
6
+ const { composeCustomError } = customErrorWorker(props);
7
+ let client;
8
+ let resp;
9
+ client = new appConfigSdk.AppConfigClient();
10
+ try {
11
+ resp = await client.send(new appConfigSdk.ListApplicationsCommand());
12
+ }
13
+ catch (err) {
14
+ return composeCustomError('Error during list AppConfig Applications', { err });
15
+ }
16
+ const applications = resp.Items;
17
+ if (!applications) {
18
+ return composeCustomError('No AppConfig Applications found');
19
+ }
20
+ const application = applications.find((it) => it.Name === projectName);
21
+ if (!application) {
22
+ return composeCustomError('AppConfig Application not found');
23
+ }
24
+ const applicationId = application.Id;
25
+ try {
26
+ resp = await client.send(new appConfigSdk.ListEnvironmentsCommand({ ApplicationId: applicationId }));
27
+ }
28
+ catch (err) {
29
+ return composeCustomError('Error during list AppConfig Environments', { err });
30
+ }
31
+ const environments = resp.Items;
32
+ if (!environments) {
33
+ return composeCustomError('No AppConfig Environments found');
34
+ }
35
+ const environment = environments.find((it) => it.Name === environmentMode);
36
+ if (!environment) {
37
+ return composeCustomError('AppConfig Environment not found');
38
+ }
39
+ const environmentId = environment.Id;
40
+ try {
41
+ resp = await client.send(new appConfigSdk.ListConfigurationProfilesCommand({ ApplicationId: applicationId }));
42
+ }
43
+ catch (err) {
44
+ return composeCustomError('Error during list AppConfig Configuration Profiles', { err });
45
+ }
46
+ const configurationProfiles = resp.Items;
47
+ if (!configurationProfiles) {
48
+ return composeCustomError('No AppConfig Configuration Profiles found');
49
+ }
50
+ const configurationProfile = configurationProfiles.find((it) => it.Name === `${environmentMode}-profile`);
51
+ if (!configurationProfile) {
52
+ return composeCustomError('AppConfig Configuration Profile not found');
53
+ }
54
+ const configurationProfileId = configurationProfile.Id;
55
+ client = new appConfigDataSdk.AppConfigDataClient();
56
+ try {
57
+ resp = await client.send(new appConfigDataSdk.StartConfigurationSessionCommand({
58
+ ApplicationIdentifier: applicationId,
59
+ EnvironmentIdentifier: environmentId,
60
+ ConfigurationProfileIdentifier: configurationProfileId,
61
+ }));
62
+ }
63
+ catch (err) {
64
+ return composeCustomError('Error during get AppConfig initial configuration token', { err });
65
+ }
66
+ const ConfigurationToken = resp.InitialConfigurationToken;
67
+ let appConfig;
68
+ try {
69
+ resp = await client.send(new appConfigDataSdk.GetLatestConfigurationCommand({ ConfigurationToken }));
70
+ const appConfigStr = new TextDecoder().decode(resp.Configuration);
71
+ appConfig = JSON.parse(appConfigStr);
72
+ }
73
+ catch (err) {
74
+ return composeCustomError('Error during get AppConfig', { err });
75
+ }
76
+ return {
77
+ data: appConfig,
78
+ };
79
+ };
@@ -0,0 +1 @@
1
+ export * from './get-app-config/index.js';
@@ -0,0 +1 @@
1
+ export * from './get-app-config/index.js';
@@ -0,0 +1,24 @@
1
+ import { Function as LambdaFunction } from 'aws-cdk-lib/aws-lambda';
2
+ import { Instance } from 'aws-cdk-lib/aws-ec2';
3
+ import { LambdaName } from '../../lambda/index.js';
4
+ import { QueueName } from '../../sqs/index.js';
5
+ export type AttachPolicy = (instance: LambdaFunction | Instance, props: {
6
+ appConfig: {
7
+ actions: Array<'appconfig:GetLatestConfiguration' | 'appconfig:ListApplications' | 'appconfig:ListConfigurationProfiles' | 'appconfig:ListEnvironments' | 'appconfig:StartConfigurationSession'>;
8
+ };
9
+ } | {
10
+ lambda: {
11
+ actions: 'lambda:InvokeFunction'[];
12
+ name: LambdaName;
13
+ };
14
+ } | {
15
+ sqs: {
16
+ actions: 'sqs:SendMessage'[];
17
+ name: QueueName;
18
+ };
19
+ } | {
20
+ s3: {
21
+ actions: Array<'s3:DeleteObject' | 's3:PutObject'>;
22
+ bucketName: string;
23
+ };
24
+ }) => void;
@@ -0,0 +1,2 @@
1
+ import { AttachPolicy } from './type.js';
2
+ export declare const attachPolicy: AttachPolicy;
@@ -0,0 +1,33 @@
1
+ import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
2
+ import { composeLambdaArn } from '../../lambda/index.js';
3
+ import { composeQueueArn } from '../../sqs/index.js';
4
+ import { composeS3Arn } from '../../s3/index.js';
5
+ export const attachPolicy = (instance, props) => {
6
+ let actions;
7
+ let resource;
8
+ if ('appConfig' in props) {
9
+ const { appConfig } = props;
10
+ actions = appConfig.actions;
11
+ resource = '*';
12
+ }
13
+ else if ('lambda' in props) {
14
+ const { lambda } = props;
15
+ actions = lambda.actions;
16
+ resource = composeLambdaArn(lambda.name);
17
+ }
18
+ else if ('sqs' in props) {
19
+ const { sqs } = props;
20
+ actions = sqs.actions;
21
+ resource = composeQueueArn(sqs.name);
22
+ }
23
+ else {
24
+ const { s3 } = props;
25
+ actions = s3.actions;
26
+ resource = composeS3Arn(s3.bucketName);
27
+ }
28
+ instance.addToRolePolicy(new PolicyStatement({
29
+ effect: Effect.ALLOW,
30
+ actions,
31
+ resources: [resource],
32
+ }));
33
+ };
@@ -0,0 +1,2 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ export type ComposeCdkStack = (stackName: string) => cdk.Stack;
@@ -0,0 +1,2 @@
1
+ import { ComposeCdkStack } from './type.js';
2
+ export declare const composeCdkStack: ComposeCdkStack;
@@ -0,0 +1,2 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ export const composeCdkStack = (stackName) => new cdk.Stack(new cdk.App(), stackName);
@@ -0,0 +1,2 @@
1
+ export * from './attach-policy/index.js';
2
+ export * from './compose-cdk-stack/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './attach-policy/index.js';
2
+ export * from './compose-cdk-stack/index.js';
@@ -1 +1,7 @@
1
- export * from './aws-region/index.js';
1
+ export * from './account-id/index.js';
2
+ export * from './app-config/index.js';
3
+ export * from './cdk/index.js';
4
+ export * from './lambda/index.js';
5
+ export * from './region/index.js';
6
+ export * from './s3/index.js';
7
+ export * from './sqs/index.js';
package/src/aws/index.js CHANGED
@@ -1 +1,7 @@
1
- export * from './aws-region/index.js';
1
+ export * from './account-id/index.js';
2
+ export * from './app-config/index.js';
3
+ export * from './cdk/index.js';
4
+ export * from './lambda/index.js';
5
+ export * from './region/index.js';
6
+ export * from './s3/index.js';
7
+ export * from './sqs/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './lambda-arn/index.js';
2
+ export * from './lambda-name/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './lambda-arn/index.js';
2
+ export * from './lambda-name/index.js';
@@ -0,0 +1,2 @@
1
+ import { LambdaName } from '../../lambda-name/index.js';
2
+ export type ComposeLambdaArn = (lambdaName: LambdaName) => string;
@@ -0,0 +1,2 @@
1
+ import { LambdaName } from '../../lambda-name/index.js';
2
+ export declare const composeLambdaArn: (lambdaName: LambdaName) => string;
@@ -0,0 +1,2 @@
1
+ import { LAMBDA_ARN_TEMPLATE } from '../config.js';
2
+ export const composeLambdaArn = (lambdaName) => LAMBDA_ARN_TEMPLATE.replace('<NAME>', lambdaName);
@@ -0,0 +1 @@
1
+ export declare const LAMBDA_ARN_TEMPLATE: string;
@@ -0,0 +1,3 @@
1
+ import { AWS_ACCOUNT_ID } from '../../account-id/index.js';
2
+ import { DEFAULT_AWS_REGION } from '../../region/index.js';
3
+ export const LAMBDA_ARN_TEMPLATE = `arn:aws:sqs:${DEFAULT_AWS_REGION}:${AWS_ACCOUNT_ID}:function:<NAME>`;
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './compose-lambda-arn/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './compose-lambda-arn/index.js';
@@ -0,0 +1 @@
1
+ export declare const LAMBDA_NAMES: readonly ["cache-development", "cache-production", "logger-development", "logger-production"];
@@ -0,0 +1 @@
1
+ export const LAMBDA_NAMES = ['cache-development', 'cache-production', 'logger-development', 'logger-production'];
@@ -0,0 +1,2 @@
1
+ import { LAMBDA_NAMES } from './config.js';
2
+ export type LambdaName = (typeof LAMBDA_NAMES)[number];
@@ -0,0 +1 @@
1
+ export * from './s3-arn/index.js';
@@ -0,0 +1 @@
1
+ export * from './s3-arn/index.js';
@@ -0,0 +1 @@
1
+ export * from './util.js';
@@ -0,0 +1 @@
1
+ export * from './util.js';
@@ -0,0 +1 @@
1
+ export type ComposeS3Arn = (bucketName: string) => string;
@@ -0,0 +1,2 @@
1
+ import { ComposeS3Arn } from './type.js';
2
+ export declare const composeS3Arn: ComposeS3Arn;
@@ -0,0 +1,2 @@
1
+ import { S3_ARN_TEMPLATE } from '../config.js';
2
+ export const composeS3Arn = (bucketName) => S3_ARN_TEMPLATE.replace('<NAME>', bucketName);
@@ -0,0 +1 @@
1
+ export declare const S3_ARN_TEMPLATE = "arn:aws:s3:::<NAME>/*";
@@ -0,0 +1 @@
1
+ export const S3_ARN_TEMPLATE = `arn:aws:s3:::<NAME>/*`;
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './compose-s3-arn/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './compose-s3-arn/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './queue-arn/index.js';
2
+ export * from './queue-name/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './queue-arn/index.js';
2
+ export * from './queue-name/index.js';
@@ -0,0 +1 @@
1
+ export * from './util.js';
@@ -0,0 +1 @@
1
+ export * from './util.js';
@@ -0,0 +1,2 @@
1
+ import { QueueName } from '../../queue-name/index.js';
2
+ export type ComposeQueueArn = (queueName: QueueName) => string;
@@ -0,0 +1,2 @@
1
+ import { ComposeQueueArn } from './type.js';
2
+ export declare const composeQueueArn: ComposeQueueArn;
@@ -0,0 +1,2 @@
1
+ import { QUEUE_ARN_TEMPLATE } from '../config.js';
2
+ export const composeQueueArn = (queueName) => QUEUE_ARN_TEMPLATE.replace('<NAME>', queueName);
@@ -0,0 +1 @@
1
+ export declare const QUEUE_ARN_TEMPLATE: string;
@@ -0,0 +1,3 @@
1
+ import { AWS_ACCOUNT_ID } from '../../account-id/index.js';
2
+ import { DEFAULT_AWS_REGION } from '../../region/index.js';
3
+ export const QUEUE_ARN_TEMPLATE = `arn:aws:sqs:${DEFAULT_AWS_REGION}:${AWS_ACCOUNT_ID}:<NAME>`;
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './compose-queue-arn/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './compose-queue-arn/index.js';
@@ -0,0 +1 @@
1
+ export declare const CACHE_QUEUE_NAMES: readonly ["cache-development", "cache-production"];
@@ -0,0 +1 @@
1
+ export const CACHE_QUEUE_NAMES = ['cache-development', 'cache-production'];
@@ -0,0 +1,2 @@
1
+ import { CACHE_QUEUE_NAMES } from './config.js';
2
+ export type CacheQueueName = (typeof CACHE_QUEUE_NAMES)[number];
@@ -0,0 +1,3 @@
1
+ export * from './cache/index.js';
2
+ export * from './logger/index.js';
3
+ export * from './queue-name/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './cache/index.js';
2
+ export * from './logger/index.js';
3
+ export * from './queue-name/index.js';
@@ -0,0 +1 @@
1
+ export declare const LOGGER_QUEUE_NAMES: readonly ["logger-development", "logger-production"];
@@ -0,0 +1 @@
1
+ export const LOGGER_QUEUE_NAMES = ['logger-development', 'logger-production'];
@@ -0,0 +1,2 @@
1
+ import { LOGGER_QUEUE_NAMES } from './config.js';
2
+ export type LoggerQueueName = (typeof LOGGER_QUEUE_NAMES)[number];
@@ -0,0 +1 @@
1
+ export declare const QUEUE_NAMES: ("cache-development" | "cache-production" | "logger-development" | "logger-production")[];
@@ -0,0 +1,3 @@
1
+ import { CACHE_QUEUE_NAMES } from '../cache/index.js';
2
+ import { LOGGER_QUEUE_NAMES } from '../logger/index.js';
3
+ export const QUEUE_NAMES = [...LOGGER_QUEUE_NAMES, ...CACHE_QUEUE_NAMES];
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './type.js';
@@ -0,0 +1,2 @@
1
+ export * from './config.js';
2
+ export * from './type.js';
@@ -0,0 +1,2 @@
1
+ import { QUEUE_NAMES } from './config.js';
2
+ export type QueueName = (typeof QUEUE_NAMES)[number];
@@ -0,0 +1,2 @@
1
+ export * from './type.js';
2
+ export * from './singleton.js';
@@ -0,0 +1,2 @@
1
+ export * from './type.js';
2
+ export * from './singleton.js';
@@ -0,0 +1,23 @@
1
+ import { CacheKey } from '../cache-key/index.js';
2
+ import { Cache } from './type.js';
3
+ import { CustomError } from '../../../error/index.js';
4
+ export declare const CacheSingleton: {
5
+ get: <T extends CacheKey>(key: T) => Promise<{
6
+ data: Cache[T];
7
+ } | {
8
+ customError: CustomError;
9
+ }>;
10
+ init: (url: string, password: string, options?: {
11
+ isEnabled?: boolean;
12
+ }) => void;
13
+ mGet: <T extends CacheKey>(keys: CacheKey[]) => Promise<{
14
+ data: Pick<Cache, T>;
15
+ } | {
16
+ customError: CustomError;
17
+ }>;
18
+ set: <T extends CacheKey>(key: T, data: Cache[T]) => Promise<{
19
+ data: null;
20
+ } | {
21
+ customError: CustomError;
22
+ }>;
23
+ };
@@ -0,0 +1,104 @@
1
+ import { createClient } from 'redis';
2
+ import { customErrorWorker } from '../../../error/index.js';
3
+ import { isArray, isString } from '../../../type/index.js';
4
+ export const CacheSingleton = (() => {
5
+ let _client;
6
+ let _isEnabled;
7
+ let _err;
8
+ let _customErrorWorker;
9
+ const checkErrorStatus = () => {
10
+ if (!_isEnabled) {
11
+ return _customErrorWorker.composeCustomError('Cache disabled');
12
+ }
13
+ if (_err) {
14
+ return _customErrorWorker.composeCustomError('Error connect Cache', { err: _err });
15
+ }
16
+ return;
17
+ };
18
+ const init = (url, password, options) => {
19
+ _isEnabled = Boolean(options?.isEnabled);
20
+ _customErrorWorker = customErrorWorker({ password, url, options });
21
+ _client = createClient({
22
+ password,
23
+ url,
24
+ });
25
+ _client.on('error', (error) => {
26
+ _err = error;
27
+ });
28
+ _client.on('ready', () => {
29
+ _err = undefined;
30
+ });
31
+ _client.connect();
32
+ };
33
+ const get = async (key) => {
34
+ _customErrorWorker.addInfo({ key });
35
+ const resp = checkErrorStatus();
36
+ if (resp) {
37
+ return resp;
38
+ }
39
+ let data;
40
+ try {
41
+ const cache = await _client.get(key);
42
+ if (cache) {
43
+ data = JSON.parse(cache);
44
+ }
45
+ }
46
+ catch (err) {
47
+ return _customErrorWorker.composeCustomError('Error get data from Redis', { err });
48
+ }
49
+ if (!data) {
50
+ return _customErrorWorker.composeCustomError('No data in Redis');
51
+ }
52
+ return {
53
+ data,
54
+ };
55
+ };
56
+ const mGet = async (keys) => {
57
+ _customErrorWorker.addInfo({ keys });
58
+ const resp = checkErrorStatus();
59
+ if (resp) {
60
+ return resp;
61
+ }
62
+ const data = {};
63
+ try {
64
+ const cache = await _client.mGet(keys);
65
+ if (!isArray(cache, isString)) {
66
+ return _customErrorWorker.composeCustomError('Error get data from redis', { cache });
67
+ }
68
+ cache.forEach((it, i) => {
69
+ data[keys[i]] = JSON.parse(it);
70
+ });
71
+ }
72
+ catch (err) {
73
+ return _customErrorWorker.composeCustomError('Error get data from redis', { err });
74
+ }
75
+ if (Object.keys(data).length !== keys.length) {
76
+ return _customErrorWorker.composeCustomError('Missing data from redis', { data });
77
+ }
78
+ return {
79
+ data,
80
+ };
81
+ };
82
+ const set = async (key, data) => {
83
+ _customErrorWorker.addInfo({ key, data });
84
+ const resp = checkErrorStatus();
85
+ if (resp) {
86
+ return resp;
87
+ }
88
+ try {
89
+ await _client.set(key, JSON.stringify(data));
90
+ }
91
+ catch (err) {
92
+ return _customErrorWorker.composeCustomError('Error set data to redis', { err });
93
+ }
94
+ return {
95
+ data: null,
96
+ };
97
+ };
98
+ return {
99
+ get,
100
+ init,
101
+ mGet,
102
+ set,
103
+ };
104
+ })();
@@ -0,0 +1,5 @@
1
+ import { Dictionary } from '../../../dictionary/index.js';
2
+ import { CacheKey } from '../cache-key/index.js';
3
+ export type Cache = {
4
+ [key in CacheKey]: Dictionary;
5
+ };
@@ -0,0 +1 @@
1
+ export declare const CACHE_KEYS: string[];