@digitraffic/common 2024.1.10-1 → 2024.1.23-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 (292) hide show
  1. package/dist/aws/infra/api/{handler-factory.d.ts → handler-factory.d.mts} +2 -2
  2. package/dist/aws/infra/api/{handler-factory.js → handler-factory.mjs} +5 -10
  3. package/dist/aws/infra/api/{integration.d.ts → integration.d.mts} +1 -1
  4. package/dist/aws/infra/api/{integration.js → integration.mjs} +10 -14
  5. package/dist/aws/infra/api/{response.d.ts → response.d.mts} +2 -3
  6. package/dist/aws/infra/api/{response.js → response.mjs} +26 -31
  7. package/dist/aws/infra/api/{responses.d.ts → responses.d.mts} +2 -3
  8. package/dist/aws/infra/api/responses.mjs +78 -0
  9. package/dist/aws/infra/api/{static-integration.d.ts → static-integration.d.mts} +1 -1
  10. package/dist/aws/infra/api/{static-integration.js → static-integration.mjs} +8 -12
  11. package/dist/aws/infra/canaries/{canary-alarm.d.ts → canary-alarm.d.mts} +1 -1
  12. package/dist/aws/infra/canaries/canary-alarm.mjs +20 -0
  13. package/dist/aws/infra/canaries/canary-keys.mjs +4 -0
  14. package/dist/aws/infra/canaries/canary-parameters.mjs +2 -0
  15. package/dist/aws/infra/canaries/{canary-role.js → canary-role.mjs} +9 -13
  16. package/dist/aws/infra/canaries/{canary.d.ts → canary.d.mts} +2 -2
  17. package/dist/aws/infra/canaries/canary.mjs +26 -0
  18. package/dist/aws/infra/canaries/{database-canary.d.ts → database-canary.d.mts} +3 -3
  19. package/dist/aws/infra/canaries/{database-canary.js → database-canary.mjs} +9 -13
  20. package/dist/aws/infra/canaries/{database-checker.d.ts → database-checker.d.mts} +1 -1
  21. package/dist/aws/infra/canaries/{database-checker.js → database-checker.mjs} +12 -18
  22. package/dist/aws/infra/canaries/{url-canary.d.ts → url-canary.d.mts} +4 -4
  23. package/dist/aws/infra/canaries/{url-canary.js → url-canary.mjs} +9 -13
  24. package/dist/aws/infra/canaries/{url-checker.d.ts → url-checker.d.mts} +2 -2
  25. package/dist/aws/infra/canaries/{url-checker.js → url-checker.mjs} +35 -42
  26. package/dist/aws/infra/{documentation.js → documentation.mjs} +9 -17
  27. package/dist/aws/infra/{import-util.js → import-util.mjs} +11 -19
  28. package/dist/aws/infra/scheduler.mjs +27 -0
  29. package/dist/aws/infra/{security-rule.js → security-rule.mjs} +5 -9
  30. package/dist/aws/infra/{sqs-integration.d.ts → sqs-integration.d.mts} +1 -2
  31. package/dist/aws/infra/{sqs-integration.js → sqs-integration.mjs} +12 -16
  32. package/dist/aws/infra/{sqs-queue.d.ts → sqs-queue.d.mts} +1 -1
  33. package/dist/aws/infra/{sqs-queue.js → sqs-queue.mjs} +33 -41
  34. package/dist/aws/infra/stack/{lambda-configs.d.ts → lambda-configs.d.mts} +2 -2
  35. package/dist/aws/infra/stack/{lambda-configs.js → lambda-configs.mjs} +15 -21
  36. package/dist/aws/infra/stack/{monitoredfunction.d.ts → monitoredfunction.d.mts} +3 -3
  37. package/dist/aws/infra/stack/{monitoredfunction.js → monitoredfunction.mjs} +20 -28
  38. package/dist/aws/infra/stack/{parameters.d.ts → parameters.d.mts} +1 -1
  39. package/dist/aws/infra/stack/{parameters.js → parameters.mjs} +6 -11
  40. package/dist/aws/infra/stack/{rest_apis.d.ts → rest_apis.d.mts} +3 -3
  41. package/dist/aws/infra/stack/{rest_apis.js → rest_apis.mjs} +42 -55
  42. package/dist/aws/infra/stack/{stack-checking-aspect.d.ts → stack-checking-aspect.d.mts} +1 -1
  43. package/dist/aws/infra/stack/{stack-checking-aspect.js → stack-checking-aspect.mjs} +25 -32
  44. package/dist/aws/infra/stack/{stack.d.ts → stack.d.mts} +3 -4
  45. package/dist/aws/infra/stack/stack.mjs +63 -0
  46. package/dist/aws/infra/stack/{subscription.d.ts → subscription.d.mts} +2 -2
  47. package/dist/aws/infra/stack/{subscription.js → subscription.mjs} +6 -11
  48. package/dist/aws/infra/stacks/{db-dns-stack.d.ts → db-dns-stack.d.mts} +2 -2
  49. package/dist/aws/infra/stacks/db-dns-stack.mjs +60 -0
  50. package/dist/aws/infra/stacks/{db-proxy-stack.d.ts → db-proxy-stack.d.mts} +2 -2
  51. package/dist/aws/infra/stacks/db-proxy-stack.mjs +73 -0
  52. package/dist/aws/infra/stacks/{db-stack.d.ts → db-stack.d.mts} +3 -4
  53. package/dist/aws/infra/stacks/{db-stack.js → db-stack.mjs} +31 -35
  54. package/dist/aws/infra/stacks/intra-stack-configuration.mjs +2 -0
  55. package/dist/aws/infra/stacks/{network-stack.d.ts → network-stack.d.mts} +2 -2
  56. package/dist/aws/infra/stacks/network-stack.mjs +40 -0
  57. package/dist/aws/infra/{usage-plans.js → usage-plans.mjs} +3 -8
  58. package/dist/aws/runtime/apikey.mjs +9 -0
  59. package/dist/aws/runtime/{digitraffic-integration-response.d.ts → digitraffic-integration-response.d.mts} +1 -1
  60. package/dist/aws/runtime/digitraffic-integration-response.mjs +24 -0
  61. package/dist/aws/runtime/{dt-logger-default.d.ts → dt-logger-default.d.mts} +2 -2
  62. package/dist/aws/runtime/dt-logger-default.mjs +6 -0
  63. package/dist/aws/runtime/{dt-logger.d.ts → dt-logger.d.mts} +1 -1
  64. package/dist/aws/runtime/{dt-logger.js → dt-logger.mjs} +4 -11
  65. package/dist/aws/runtime/{environment.js → environment.mjs} +4 -8
  66. package/dist/aws/runtime/{messaging.js → messaging.mjs} +2 -6
  67. package/dist/aws/runtime/{s3.js → s3.mjs} +4 -8
  68. package/dist/aws/runtime/secrets/{dbsecret.d.ts → dbsecret.d.mts} +1 -1
  69. package/dist/aws/runtime/secrets/{dbsecret.js → dbsecret.mjs} +6 -10
  70. package/dist/aws/runtime/secrets/proxy-holder.mjs +24 -0
  71. package/dist/aws/runtime/secrets/rds-holder.mjs +24 -0
  72. package/dist/aws/runtime/secrets/{secret-holder.d.ts → secret-holder.d.mts} +1 -1
  73. package/dist/aws/runtime/secrets/{secret-holder.js → secret-holder.mjs} +14 -19
  74. package/dist/aws/runtime/secrets/{secret.js → secret.mjs} +8 -12
  75. package/dist/aws/types/errors.mjs +12 -0
  76. package/dist/aws/types/{lambda-response.js → lambda-response.mjs} +4 -11
  77. package/dist/aws/types/{mediatypes.js → mediatypes.mjs} +3 -6
  78. package/dist/aws/types/model-with-reference.mjs +2 -0
  79. package/dist/aws/types/proxytypes.mjs +2 -0
  80. package/dist/aws/types/tags.mjs +4 -0
  81. package/dist/database/{cached.d.ts → cached.d.mts} +1 -1
  82. package/dist/database/{cached.js → cached.mjs} +10 -15
  83. package/dist/database/{database.d.ts → database.d.mts} +1 -1
  84. package/dist/database/{database.js → database.mjs} +17 -24
  85. package/dist/database/{last-updated.d.ts → last-updated.d.mts} +1 -1
  86. package/dist/database/{last-updated.js → last-updated.mjs} +9 -18
  87. package/dist/database/models.mjs +2 -0
  88. package/dist/index.d.mts +1 -0
  89. package/dist/index.mjs +2 -0
  90. package/dist/marine/{id_utils.js → id_utils.mjs} +4 -10
  91. package/dist/marine/rtz.mjs +2 -0
  92. package/dist/test/{asserter.js → asserter.mjs} +2 -6
  93. package/dist/test/{db-testutils.d.ts → db-testutils.d.mts} +1 -1
  94. package/dist/test/db-testutils.mjs +29 -0
  95. package/dist/test/{httpserver.js → httpserver.mjs} +11 -15
  96. package/dist/test/secrets-manager.mjs +34 -0
  97. package/dist/test/testutils.mjs +33 -0
  98. package/dist/types/async-timeout-error.mjs +6 -0
  99. package/dist/types/aws-env.mjs +2 -0
  100. package/dist/types/either.mjs +2 -0
  101. package/dist/types/http-error.mjs +7 -0
  102. package/dist/types/input-error.mjs +3 -0
  103. package/dist/types/language.mjs +7 -0
  104. package/dist/types/{nullable.d.ts → nullable.d.mts} +1 -1
  105. package/dist/types/nullable.mjs +2 -0
  106. package/dist/types/{traffictype.js → traffictype.mjs} +3 -6
  107. package/dist/types/urn.mjs +2 -0
  108. package/dist/types/util-types.mjs +2 -0
  109. package/dist/types/validator.mjs +9 -0
  110. package/dist/utils/{api-model.d.ts → api-model.d.mts} +1 -1
  111. package/dist/utils/{api-model.js → api-model.mjs} +18 -28
  112. package/dist/utils/{base64.d.ts → base64.d.mts} +1 -1
  113. package/dist/utils/base64.mjs +16 -0
  114. package/dist/utils/date-utils.mjs +44 -0
  115. package/dist/utils/geojson-types.mjs +13 -0
  116. package/dist/utils/{geometry.js → geometry.mjs} +16 -49
  117. package/dist/utils/{logging.d.ts → logging.d.mts} +1 -1
  118. package/dist/utils/{logging.js → logging.mjs} +9 -14
  119. package/dist/utils/{retry.js → retry.mjs} +22 -27
  120. package/dist/utils/slack.mjs +23 -0
  121. package/dist/utils/{utils.d.ts → utils.d.mts} +2 -2
  122. package/dist/utils/{utils.js → utils.mjs} +15 -30
  123. package/package.json +99 -10
  124. package/src/aws/infra/api/{handler-factory.ts → handler-factory.mts} +3 -3
  125. package/src/aws/infra/api/{integration.ts → integration.mts} +2 -2
  126. package/src/aws/infra/api/{response.ts → response.mts} +3 -3
  127. package/src/aws/infra/api/{responses.ts → responses.mts} +4 -4
  128. package/src/aws/infra/api/{static-integration.ts → static-integration.mts} +2 -2
  129. package/src/aws/infra/canaries/Synthetics.d.mts +21 -0
  130. package/src/aws/infra/canaries/{canary-alarm.ts → canary-alarm.mts} +1 -1
  131. package/src/aws/infra/canaries/{canary.ts → canary.mts} +3 -3
  132. package/src/aws/infra/canaries/{database-canary.ts → database-canary.mts} +3 -3
  133. package/src/aws/infra/canaries/{database-checker.ts → database-checker.mts} +7 -10
  134. package/src/aws/infra/canaries/{url-canary.ts → url-canary.mts} +6 -6
  135. package/src/aws/infra/canaries/{url-checker.ts → url-checker.mts} +9 -29
  136. package/src/aws/infra/{sqs-integration.ts → sqs-integration.mts} +1 -1
  137. package/src/aws/infra/{sqs-queue.ts → sqs-queue.mts} +3 -6
  138. package/src/aws/infra/stack/{lambda-configs.ts → lambda-configs.mts} +2 -2
  139. package/src/aws/infra/stack/{monitoredfunction.ts → monitoredfunction.mts} +4 -4
  140. package/src/aws/infra/stack/{parameters.ts → parameters.mts} +1 -1
  141. package/src/aws/infra/stack/{rest_apis.ts → rest_apis.mts} +6 -6
  142. package/src/aws/infra/stack/{stack-checking-aspect.ts → stack-checking-aspect.mts} +1 -1
  143. package/src/aws/infra/stack/{stack.ts → stack.mts} +4 -5
  144. package/src/aws/infra/stack/{subscription.ts → subscription.mts} +2 -2
  145. package/src/aws/infra/stacks/{db-dns-stack.ts → db-dns-stack.mts} +4 -4
  146. package/src/aws/infra/stacks/{db-proxy-stack.ts → db-proxy-stack.mts} +5 -5
  147. package/src/aws/infra/stacks/{db-stack.ts → db-stack.mts} +5 -5
  148. package/src/aws/infra/stacks/{network-stack.ts → network-stack.mts} +3 -3
  149. package/src/aws/runtime/{digitraffic-integration-response.ts → digitraffic-integration-response.mts} +2 -2
  150. package/src/aws/runtime/{dt-logger-default.ts → dt-logger-default.mts} +2 -2
  151. package/src/aws/runtime/secrets/{dbsecret.ts → dbsecret.mts} +1 -1
  152. package/src/aws/runtime/secrets/node-ttl.d.mts +12 -0
  153. package/src/aws/runtime/secrets/{proxy-holder.ts → proxy-holder.mts} +4 -4
  154. package/src/aws/runtime/secrets/{rds-holder.ts → rds-holder.mts} +4 -4
  155. package/src/aws/runtime/secrets/{secret-holder.ts → secret-holder.mts} +8 -9
  156. package/src/aws/runtime/secrets/{secret.ts → secret.mts} +2 -2
  157. package/src/database/{cached.ts → cached.mts} +4 -2
  158. package/src/database/{database.ts → database.mts} +6 -6
  159. package/src/database/{last-updated.ts → last-updated.mts} +1 -1
  160. package/src/index.mts +2 -0
  161. package/src/test/{db-testutils.ts → db-testutils.mts} +2 -2
  162. package/src/test/{secrets-manager.ts → secrets-manager.mts} +3 -3
  163. package/src/types/{nullable.ts → nullable.mts} +1 -1
  164. package/src/utils/{api-model.ts → api-model.mts} +1 -1
  165. package/src/utils/{geometry.ts → geometry.mts} +5 -3
  166. package/src/utils/{logging.ts → logging.mts} +2 -2
  167. package/src/utils/{retry.ts → retry.mts} +3 -3
  168. package/src/utils/{slack.ts → slack.mts} +2 -2
  169. package/src/utils/{utils.ts → utils.mts} +3 -3
  170. package/dist/aws/infra/api/responses.js +0 -84
  171. package/dist/aws/infra/canaries/canary-alarm.js +0 -24
  172. package/dist/aws/infra/canaries/canary-keys.js +0 -7
  173. package/dist/aws/infra/canaries/canary-parameters.js +0 -3
  174. package/dist/aws/infra/canaries/canary.js +0 -30
  175. package/dist/aws/infra/scheduler.js +0 -31
  176. package/dist/aws/infra/stack/stack.js +0 -67
  177. package/dist/aws/infra/stacks/db-dns-stack.js +0 -64
  178. package/dist/aws/infra/stacks/db-proxy-stack.js +0 -77
  179. package/dist/aws/infra/stacks/intra-stack-configuration.js +0 -3
  180. package/dist/aws/infra/stacks/network-stack.js +0 -44
  181. package/dist/aws/runtime/apikey.js +0 -13
  182. package/dist/aws/runtime/digitraffic-integration-response.js +0 -28
  183. package/dist/aws/runtime/dt-logger-default.js +0 -9
  184. package/dist/aws/runtime/secrets/proxy-holder.js +0 -28
  185. package/dist/aws/runtime/secrets/rds-holder.js +0 -28
  186. package/dist/aws/types/errors.js +0 -16
  187. package/dist/aws/types/model-with-reference.js +0 -3
  188. package/dist/aws/types/proxytypes.js +0 -3
  189. package/dist/aws/types/tags.js +0 -7
  190. package/dist/database/models.js +0 -3
  191. package/dist/marine/rtz.js +0 -3
  192. package/dist/test/db-testutils.js +0 -34
  193. package/dist/test/secrets-manager.js +0 -62
  194. package/dist/test/testutils.js +0 -44
  195. package/dist/types/async-timeout-error.js +0 -10
  196. package/dist/types/aws-env.js +0 -3
  197. package/dist/types/either.js +0 -3
  198. package/dist/types/http-error.js +0 -11
  199. package/dist/types/input-error.js +0 -7
  200. package/dist/types/language.js +0 -10
  201. package/dist/types/nullable.js +0 -3
  202. package/dist/types/urn.js +0 -3
  203. package/dist/types/util-types.js +0 -3
  204. package/dist/types/validator.js +0 -14
  205. package/dist/utils/base64.js +0 -21
  206. package/dist/utils/date-utils.js +0 -51
  207. package/dist/utils/geojson-types.js +0 -18
  208. package/dist/utils/slack.js +0 -30
  209. /package/dist/aws/infra/canaries/{canary-keys.d.ts → canary-keys.d.mts} +0 -0
  210. /package/dist/aws/infra/canaries/{canary-parameters.d.ts → canary-parameters.d.mts} +0 -0
  211. /package/dist/aws/infra/canaries/{canary-role.d.ts → canary-role.d.mts} +0 -0
  212. /package/dist/aws/infra/{documentation.d.ts → documentation.d.mts} +0 -0
  213. /package/dist/aws/infra/{import-util.d.ts → import-util.d.mts} +0 -0
  214. /package/dist/aws/infra/{scheduler.d.ts → scheduler.d.mts} +0 -0
  215. /package/dist/aws/infra/{security-rule.d.ts → security-rule.d.mts} +0 -0
  216. /package/dist/aws/infra/stacks/{intra-stack-configuration.d.ts → intra-stack-configuration.d.mts} +0 -0
  217. /package/dist/aws/infra/{usage-plans.d.ts → usage-plans.d.mts} +0 -0
  218. /package/dist/aws/runtime/{apikey.d.ts → apikey.d.mts} +0 -0
  219. /package/dist/aws/runtime/{environment.d.ts → environment.d.mts} +0 -0
  220. /package/dist/aws/runtime/{messaging.d.ts → messaging.d.mts} +0 -0
  221. /package/dist/aws/runtime/{s3.d.ts → s3.d.mts} +0 -0
  222. /package/dist/aws/runtime/secrets/{proxy-holder.d.ts → proxy-holder.d.mts} +0 -0
  223. /package/dist/aws/runtime/secrets/{rds-holder.d.ts → rds-holder.d.mts} +0 -0
  224. /package/dist/aws/runtime/secrets/{secret.d.ts → secret.d.mts} +0 -0
  225. /package/dist/aws/types/{errors.d.ts → errors.d.mts} +0 -0
  226. /package/dist/aws/types/{lambda-response.d.ts → lambda-response.d.mts} +0 -0
  227. /package/dist/aws/types/{mediatypes.d.ts → mediatypes.d.mts} +0 -0
  228. /package/dist/aws/types/{model-with-reference.d.ts → model-with-reference.d.mts} +0 -0
  229. /package/dist/aws/types/{proxytypes.d.ts → proxytypes.d.mts} +0 -0
  230. /package/dist/aws/types/{tags.d.ts → tags.d.mts} +0 -0
  231. /package/dist/database/{models.d.ts → models.d.mts} +0 -0
  232. /package/dist/marine/{id_utils.d.ts → id_utils.d.mts} +0 -0
  233. /package/dist/marine/{rtz.d.ts → rtz.d.mts} +0 -0
  234. /package/dist/test/{asserter.d.ts → asserter.d.mts} +0 -0
  235. /package/dist/test/{httpserver.d.ts → httpserver.d.mts} +0 -0
  236. /package/dist/test/{secrets-manager.d.ts → secrets-manager.d.mts} +0 -0
  237. /package/dist/test/{testutils.d.ts → testutils.d.mts} +0 -0
  238. /package/dist/types/{async-timeout-error.d.ts → async-timeout-error.d.mts} +0 -0
  239. /package/dist/types/{aws-env.d.ts → aws-env.d.mts} +0 -0
  240. /package/dist/types/{either.d.ts → either.d.mts} +0 -0
  241. /package/dist/types/{http-error.d.ts → http-error.d.mts} +0 -0
  242. /package/dist/types/{input-error.d.ts → input-error.d.mts} +0 -0
  243. /package/dist/types/{language.d.ts → language.d.mts} +0 -0
  244. /package/dist/types/{traffictype.d.ts → traffictype.d.mts} +0 -0
  245. /package/dist/types/{urn.d.ts → urn.d.mts} +0 -0
  246. /package/dist/types/{util-types.d.ts → util-types.d.mts} +0 -0
  247. /package/dist/types/{validator.d.ts → validator.d.mts} +0 -0
  248. /package/dist/utils/{date-utils.d.ts → date-utils.d.mts} +0 -0
  249. /package/dist/utils/{geojson-types.d.ts → geojson-types.d.mts} +0 -0
  250. /package/dist/utils/{geometry.d.ts → geometry.d.mts} +0 -0
  251. /package/dist/utils/{retry.d.ts → retry.d.mts} +0 -0
  252. /package/dist/utils/{slack.d.ts → slack.d.mts} +0 -0
  253. /package/src/@types/geojson-validation/{index.d.ts → index.d.mts} +0 -0
  254. /package/src/aws/infra/canaries/{canary-keys.ts → canary-keys.mts} +0 -0
  255. /package/src/aws/infra/canaries/{canary-parameters.ts → canary-parameters.mts} +0 -0
  256. /package/src/aws/infra/canaries/{canary-role.ts → canary-role.mts} +0 -0
  257. /package/src/aws/infra/{documentation.ts → documentation.mts} +0 -0
  258. /package/src/aws/infra/{import-util.ts → import-util.mts} +0 -0
  259. /package/src/aws/infra/{scheduler.ts → scheduler.mts} +0 -0
  260. /package/src/aws/infra/{security-rule.ts → security-rule.mts} +0 -0
  261. /package/src/aws/infra/stacks/{intra-stack-configuration.ts → intra-stack-configuration.mts} +0 -0
  262. /package/src/aws/infra/{usage-plans.ts → usage-plans.mts} +0 -0
  263. /package/src/aws/runtime/{apikey.ts → apikey.mts} +0 -0
  264. /package/src/aws/runtime/{dt-logger.ts → dt-logger.mts} +0 -0
  265. /package/src/aws/runtime/{environment.ts → environment.mts} +0 -0
  266. /package/src/aws/runtime/{messaging.ts → messaging.mts} +0 -0
  267. /package/src/aws/runtime/{s3.ts → s3.mts} +0 -0
  268. /package/src/aws/types/{errors.ts → errors.mts} +0 -0
  269. /package/src/aws/types/{lambda-response.ts → lambda-response.mts} +0 -0
  270. /package/src/aws/types/{mediatypes.ts → mediatypes.mts} +0 -0
  271. /package/src/aws/types/{model-with-reference.ts → model-with-reference.mts} +0 -0
  272. /package/src/aws/types/{proxytypes.ts → proxytypes.mts} +0 -0
  273. /package/src/aws/types/{tags.ts → tags.mts} +0 -0
  274. /package/src/database/{models.ts → models.mts} +0 -0
  275. /package/src/marine/{id_utils.ts → id_utils.mts} +0 -0
  276. /package/src/marine/{rtz.ts → rtz.mts} +0 -0
  277. /package/src/test/{asserter.ts → asserter.mts} +0 -0
  278. /package/src/test/{httpserver.ts → httpserver.mts} +0 -0
  279. /package/src/test/{testutils.ts → testutils.mts} +0 -0
  280. /package/src/types/{async-timeout-error.ts → async-timeout-error.mts} +0 -0
  281. /package/src/types/{aws-env.ts → aws-env.mts} +0 -0
  282. /package/src/types/{either.ts → either.mts} +0 -0
  283. /package/src/types/{http-error.ts → http-error.mts} +0 -0
  284. /package/src/types/{input-error.ts → input-error.mts} +0 -0
  285. /package/src/types/{language.ts → language.mts} +0 -0
  286. /package/src/types/{traffictype.ts → traffictype.mts} +0 -0
  287. /package/src/types/{urn.ts → urn.mts} +0 -0
  288. /package/src/types/{util-types.ts → util-types.mts} +0 -0
  289. /package/src/types/{validator.ts → validator.mts} +0 -0
  290. /package/src/utils/{base64.ts → base64.mts} +0 -0
  291. /package/src/utils/{date-utils.ts → date-utils.mts} +0 -0
  292. /package/src/utils/{geojson-types.ts → geojson-types.mts} +0 -0
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDefaultUsagePlan = exports.createUsagePlan = void 0;
4
1
  /**
5
2
  * Creates an usage plan for a REST API with a single API key
6
3
  * @param api The REST API
@@ -8,7 +5,7 @@ exports.createDefaultUsagePlan = exports.createUsagePlan = void 0;
8
5
  * @param apiKeyName Name for the API key, this is displayed in the AWS Console
9
6
  * @deprecated Creates randomized API key names, use createDefaultUsagePlan instead
10
7
  */
11
- function createUsagePlan(api, apiKeyId, apiKeyName) {
8
+ export function createUsagePlan(api, apiKeyId, apiKeyName) {
12
9
  const apiKey = api.addApiKey(apiKeyId);
13
10
  const plan = api.addUsagePlan(apiKeyName, {
14
11
  name: apiKeyName,
@@ -19,14 +16,13 @@ function createUsagePlan(api, apiKeyId, apiKeyName) {
19
16
  plan.addApiKey(apiKey);
20
17
  return apiKey;
21
18
  }
22
- exports.createUsagePlan = createUsagePlan;
23
19
  /**
24
20
  * Creates a default usage plan for a REST API with a single API key
25
21
  * @param api The REST API
26
22
  * @param apiName Name of the api. Will generate key: apiName + ' API Key' and plan: apiName + ' API Usage Plan'
27
23
  * @param value Optional value for the API key
28
24
  */
29
- function createDefaultUsagePlan(api, apiName, value) {
25
+ export function createDefaultUsagePlan(api, apiName, value) {
30
26
  const apiKeyName = apiName + " API Key";
31
27
  const usagePlanName = apiName + " API Usage Plan";
32
28
  const apiKey = api.addApiKey(apiKeyName, { apiKeyName: apiKeyName, value });
@@ -39,5 +35,4 @@ function createDefaultUsagePlan(api, apiName, value) {
39
35
  plan.addApiKey(apiKey);
40
36
  return apiKey;
41
37
  }
42
- exports.createDefaultUsagePlan = createDefaultUsagePlan;
43
- //# sourceMappingURL=usage-plans.js.map
38
+ //# sourceMappingURL=usage-plans.mjs.map
@@ -0,0 +1,9 @@
1
+ import { APIGateway } from "aws-sdk";
2
+ export function getApiKeyFromAPIGateway(keyId) {
3
+ const agw = new APIGateway();
4
+ return agw.getApiKey({
5
+ apiKey: keyId,
6
+ includeValue: true,
7
+ }).promise();
8
+ }
9
+ //# sourceMappingURL=apikey.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { IntegrationResponse } from "aws-cdk-lib/aws-apigateway";
2
- import { MediaType } from "../types/mediatypes";
2
+ import { MediaType } from "../types/mediatypes.mjs";
3
3
  export declare abstract class DigitrafficIntegrationResponse {
4
4
  static ok(mediaType: MediaType, sunset?: string): IntegrationResponse;
5
5
  static badRequest(mediaType?: MediaType): IntegrationResponse;
@@ -0,0 +1,24 @@
1
+ import { MediaType } from "../types/mediatypes.mjs";
2
+ import { getDeprecatedDefaultLambdaResponse, RESPONSE_DEFAULT_LAMBDA, } from "../infra/api/response.mjs";
3
+ export class DigitrafficIntegrationResponse {
4
+ static ok(mediaType, sunset) {
5
+ return this.create("200", mediaType, sunset);
6
+ }
7
+ static badRequest(mediaType) {
8
+ return this.create("400", mediaType ?? MediaType.TEXT_PLAIN);
9
+ }
10
+ static notImplemented(mediaType) {
11
+ return this.create("501", mediaType ?? MediaType.TEXT_PLAIN);
12
+ }
13
+ static create(statusCode, mediaType, sunset) {
14
+ return {
15
+ statusCode,
16
+ responseTemplates: {
17
+ [mediaType]: sunset
18
+ ? getDeprecatedDefaultLambdaResponse(sunset)
19
+ : RESPONSE_DEFAULT_LAMBDA,
20
+ },
21
+ };
22
+ }
23
+ }
24
+ //# sourceMappingURL=digitraffic-integration-response.mjs.map
@@ -1,8 +1,8 @@
1
- import { DtLogger } from "./dt-logger";
1
+ import { DtLogger } from "./dt-logger.mjs";
2
2
  /**
3
3
  * You can use this for method name definition to match DtLogger LoggableType.method parameter.
4
4
  */
5
- export type { LoggerMethodType } from "./dt-logger";
5
+ export type { LoggerMethodType } from "./dt-logger.mjs";
6
6
  /**
7
7
  * You can use this for your logging needs or create one locally and configure it as you wish.
8
8
  */
@@ -0,0 +1,6 @@
1
+ import { DtLogger } from "./dt-logger.mjs";
2
+ /**
3
+ * You can use this for your logging needs or create one locally and configure it as you wish.
4
+ */
5
+ export const logger = new DtLogger();
6
+ //# sourceMappingURL=dt-logger-default.mjs.map
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ /// <reference types="node" resolution-mode="require"/>
2
2
  import { Writable } from "stream";
3
3
  /** Logging level */
4
4
  export type LOG_LEVEL = "DEBUG" | "INFO" | "WARN" | "ERROR";
@@ -1,10 +1,4 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DtLogger = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
1
+ import _ from "lodash";
8
2
  /**
9
3
  * Helper class for json-logging.
10
4
  *
@@ -14,7 +8,7 @@ const lodash_1 = __importDefault(require("lodash"));
14
8
  * * runtime (taken from process environment)
15
9
  * * the actual message (as json or as string)
16
10
  */
17
- class DtLogger {
11
+ export class DtLogger {
18
12
  /**
19
13
  * Create a new Logger instance.
20
14
  * @constructor
@@ -100,8 +94,7 @@ class DtLogger {
100
94
  this.writeStream.write(JSON.stringify(logMessage) + "\n");
101
95
  }
102
96
  }
103
- exports.DtLogger = DtLogger;
104
97
  function removePrefix(prefix, loggable) {
105
- return lodash_1.default.mapKeys(loggable, (_index, key) => key.startsWith(prefix) ? lodash_1.default.lowerFirst(key.replace(prefix, "")) : key);
98
+ return _.mapKeys(loggable, (_index, key) => key.startsWith(prefix) ? _.lowerFirst(key.replace(prefix, "")) : key);
106
99
  }
107
- //# sourceMappingURL=dt-logger.js.map
100
+ //# sourceMappingURL=dt-logger.mjs.map
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.envValue = exports.EnvKeys = void 0;
4
- var EnvKeys;
1
+ export var EnvKeys;
5
2
  (function (EnvKeys) {
6
3
  EnvKeys["AWS_REGION"] = "AWS_REGION";
7
4
  EnvKeys["SECRET_ID"] = "SECRET_ID";
8
5
  EnvKeys["SECRET_OVERRIDE_AWS_REGION"] = "SECRET_OVERRIDE_AWS_REGION";
9
- })(EnvKeys || (exports.EnvKeys = EnvKeys = {}));
6
+ })(EnvKeys || (EnvKeys = {}));
10
7
  /**
11
8
  * @deprecated Use digitraffic/common/utils/utils#getEnvVariable
12
9
  */
13
- function envValue(key, defaultValue) {
10
+ export function envValue(key, defaultValue) {
14
11
  const value = process.env[key];
15
12
  if (value == null) {
16
13
  if (defaultValue) {
@@ -20,5 +17,4 @@ function envValue(key, defaultValue) {
20
17
  }
21
18
  return value;
22
19
  }
23
- exports.envValue = envValue;
24
- //# sourceMappingURL=environment.js.map
20
+ //# sourceMappingURL=environment.mjs.map
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.snsPublish = void 0;
4
1
  /**
5
2
  * Utility function for publishing SNS messages.
6
3
  * Made because using *await* with AWS APIs doesn't require calling promise() but nothing works if it isn't called.
@@ -9,7 +6,7 @@ exports.snsPublish = void 0;
9
6
  * @param topicArn
10
7
  * @param sns
11
8
  */
12
- async function snsPublish(message, topicArn, sns) {
9
+ export async function snsPublish(message, topicArn, sns) {
13
10
  const publishParams = {
14
11
  Message: message,
15
12
  TopicArn: topicArn,
@@ -27,5 +24,4 @@ async function snsPublish(message, topicArn, sns) {
27
24
  }
28
25
  }
29
26
  }
30
- exports.snsPublish = snsPublish;
31
- //# sourceMappingURL=messaging.js.map
27
+ //# sourceMappingURL=messaging.mjs.map
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadToS3 = void 0;
4
- const aws_sdk_1 = require("aws-sdk");
5
- async function uploadToS3(bucketName, body, objectName, cannedAcl, contentType) {
6
- const s3 = new aws_sdk_1.S3();
1
+ import { S3 } from "aws-sdk";
2
+ export async function uploadToS3(bucketName, body, objectName, cannedAcl, contentType) {
3
+ const s3 = new S3();
7
4
  try {
8
5
  await doUpload(s3, bucketName, body, objectName, cannedAcl, contentType);
9
6
  }
@@ -17,7 +14,6 @@ async function uploadToS3(bucketName, body, objectName, cannedAcl, contentType)
17
14
  }
18
15
  }
19
16
  }
20
- exports.uploadToS3 = uploadToS3;
21
17
  function doUpload(s3, bucketName, body, filename, cannedAcl, contentType) {
22
18
  return s3.upload({
23
19
  Bucket: bucketName,
@@ -27,4 +23,4 @@ function doUpload(s3, bucketName, body, filename, cannedAcl, contentType) {
27
23
  ContentType: contentType,
28
24
  }).promise();
29
25
  }
30
- //# sourceMappingURL=s3.js.map
26
+ //# sourceMappingURL=s3.mjs.map
@@ -1,4 +1,4 @@
1
- import { GenericSecret } from "./secret";
1
+ import { GenericSecret } from "./secret.mjs";
2
2
  export declare enum RdsProxySecretKey {
3
3
  username = "username",
4
4
  password = "password",
@@ -1,26 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkExpectedSecretKeys = exports.RdsSecretKey = exports.RdsProxySecretKey = void 0;
4
- var RdsProxySecretKey;
1
+ export var RdsProxySecretKey;
5
2
  (function (RdsProxySecretKey) {
6
3
  RdsProxySecretKey["username"] = "username";
7
4
  RdsProxySecretKey["password"] = "password";
8
5
  RdsProxySecretKey["proxy_host"] = "proxy_host";
9
6
  RdsProxySecretKey["proxy_ro_host"] = "proxy_ro_host";
10
- })(RdsProxySecretKey || (exports.RdsProxySecretKey = RdsProxySecretKey = {}));
11
- var RdsSecretKey;
7
+ })(RdsProxySecretKey || (RdsProxySecretKey = {}));
8
+ export var RdsSecretKey;
12
9
  (function (RdsSecretKey) {
13
10
  RdsSecretKey["username"] = "username";
14
11
  RdsSecretKey["password"] = "password";
15
12
  RdsSecretKey["host"] = "host";
16
13
  RdsSecretKey["ro_host"] = "ro_host";
17
- })(RdsSecretKey || (exports.RdsSecretKey = RdsSecretKey = {}));
18
- function checkExpectedSecretKeys(keys, secret) {
14
+ })(RdsSecretKey || (RdsSecretKey = {}));
15
+ export function checkExpectedSecretKeys(keys, secret) {
19
16
  const missingKeys = keys.filter((key) => !(key in secret));
20
17
  if (missingKeys.length) {
21
18
  console.error(`method=checkExpectedSecretKeys secret didn't contain the key(s) ${missingKeys.toString()}`);
22
19
  throw new Error("Expected keys were not found");
23
20
  }
24
21
  }
25
- exports.checkExpectedSecretKeys = checkExpectedSecretKeys;
26
- //# sourceMappingURL=dbsecret.js.map
22
+ //# sourceMappingURL=dbsecret.mjs.map
@@ -0,0 +1,24 @@
1
+ import { SecretHolder } from "./secret-holder.mjs";
2
+ import { RdsProxySecretKey } from "./dbsecret.mjs";
3
+ import { getEnvVariable } from "../../../utils/utils.mjs";
4
+ import { DatabaseEnvironmentKeys } from "../../../database/database.mjs";
5
+ const RDS_PROXY_SECRET_KEYS = Object.values(RdsProxySecretKey);
6
+ /**
7
+ * Holds credentials for RDS Proxy access.
8
+ */
9
+ export class ProxyHolder {
10
+ constructor(secretId) {
11
+ this.secretHolder = new SecretHolder(secretId, "", RDS_PROXY_SECRET_KEYS);
12
+ }
13
+ static create() {
14
+ return new ProxyHolder(getEnvVariable("SECRET_ID"));
15
+ }
16
+ async setCredentials() {
17
+ const secret = await this.secretHolder.get();
18
+ process.env[DatabaseEnvironmentKeys.DB_USER] = secret.username;
19
+ process.env[DatabaseEnvironmentKeys.DB_PASS] = secret.password;
20
+ process.env[DatabaseEnvironmentKeys.DB_URI] = secret.proxy_host;
21
+ process.env[DatabaseEnvironmentKeys.DB_RO_URI] = secret.proxy_ro_host;
22
+ }
23
+ }
24
+ //# sourceMappingURL=proxy-holder.mjs.map
@@ -0,0 +1,24 @@
1
+ import { SecretHolder } from "./secret-holder.mjs";
2
+ import { RdsSecretKey } from "./dbsecret.mjs";
3
+ import { getEnvVariable } from "../../../utils/utils.mjs";
4
+ import { DatabaseEnvironmentKeys } from "../../../database/database.mjs";
5
+ const RDS_SECRET_KEYS = Object.values(RdsSecretKey);
6
+ /**
7
+ * Holds credentials for RDS access.
8
+ */
9
+ export class RdsHolder {
10
+ constructor(secretId) {
11
+ this.secretHolder = new SecretHolder(secretId, "", RDS_SECRET_KEYS);
12
+ }
13
+ static create() {
14
+ return new RdsHolder(getEnvVariable("SECRET_ID"));
15
+ }
16
+ async setCredentials() {
17
+ const secret = await this.secretHolder.get();
18
+ process.env[DatabaseEnvironmentKeys.DB_USER] = secret.username;
19
+ process.env[DatabaseEnvironmentKeys.DB_PASS] = secret.password;
20
+ process.env[DatabaseEnvironmentKeys.DB_URI] = secret.host;
21
+ process.env[DatabaseEnvironmentKeys.DB_RO_URI] = secret.ro_host;
22
+ }
23
+ }
24
+ //# sourceMappingURL=rds-holder.mjs.map
@@ -1,4 +1,4 @@
1
- import { GenericSecret } from "./secret";
1
+ import { GenericSecret } from "./secret.mjs";
2
2
  /**
3
3
  * Utility class for getting secrets from Secret Manager.
4
4
  * Supports prefix for secrets, checking of expected keys and ttl-configuration.
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SecretHolder = void 0;
4
- const secret_1 = require("./secret");
5
- const dbsecret_1 = require("./dbsecret");
6
- const utils_1 = require("../../../utils/utils");
7
- const dt_logger_default_1 = require("../dt-logger-default");
8
- // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
9
- const NodeTtl = require("node-ttl");
1
+ import { getSecret } from "./secret.mjs";
2
+ import { checkExpectedSecretKeys } from "./dbsecret.mjs";
3
+ import { getEnvVariable } from "../../../utils/utils.mjs";
4
+ import { logger } from "../dt-logger-default.mjs";
5
+ const NodeTtlImport = await import("node-ttl");
6
+ //eslint-disable-next-line
7
+ const NodeTtl = NodeTtlImport.default;
10
8
  const DEFAULT_PREFIX = "";
11
9
  const DEFAULT_SECRET_KEY = "SECRET";
12
10
  const DEFAULT_CONFIGURATION = {
@@ -24,7 +22,7 @@ const DEFAULT_CONFIGURATION = {
24
22
  * setting the region with utils setSecretOverideAwsRegionEnv method.
25
23
  *
26
24
  */
27
- class SecretHolder {
25
+ export class SecretHolder {
28
26
  constructor(secretId, prefix = "", expectedKeys = [], configuration = DEFAULT_CONFIGURATION) {
29
27
  this.secretId = secretId;
30
28
  this.prefix = prefix;
@@ -33,8 +31,8 @@ class SecretHolder {
33
31
  this.secretCache = new NodeTtl(configuration);
34
32
  }
35
33
  async initSecret() {
36
- const secretValue = await (0, secret_1.getSecret)(this.secretId);
37
- dt_logger_default_1.logger.info({
34
+ const secretValue = await getSecret(this.secretId);
35
+ logger.info({
38
36
  method: "SecretHolder.initSecret",
39
37
  message: "Refreshing secret " + this.secretId,
40
38
  });
@@ -42,7 +40,7 @@ class SecretHolder {
42
40
  this.secretCache.push(DEFAULT_SECRET_KEY, secretValue);
43
41
  }
44
42
  static create(prefix = DEFAULT_PREFIX, expectedKeys = []) {
45
- return new SecretHolder((0, utils_1.getEnvVariable)("SECRET_ID"), prefix, expectedKeys);
43
+ return new SecretHolder(getEnvVariable("SECRET_ID"), prefix, expectedKeys);
46
44
  }
47
45
  async get() {
48
46
  const secret = await this.getSecret();
@@ -50,7 +48,7 @@ class SecretHolder {
50
48
  ? secret
51
49
  : this.parseSecret(secret, `${this.prefix}.`);
52
50
  if (this.expectedKeys.length > 0) {
53
- (0, dbsecret_1.checkExpectedSecretKeys)(this.expectedKeys, parsedSecret);
51
+ checkExpectedSecretKeys(this.expectedKeys, parsedSecret);
54
52
  }
55
53
  return parsedSecret;
56
54
  }
@@ -65,14 +63,11 @@ class SecretHolder {
65
63
  return parsed;
66
64
  }
67
65
  async getSecret() {
68
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
69
66
  const secret = this.secretCache.get(DEFAULT_SECRET_KEY);
70
67
  if (!secret) {
71
68
  await this.initSecret();
72
69
  }
73
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
74
- return secret ?? this.secretCache.get(DEFAULT_SECRET_KEY);
70
+ return secret ?? (this.secretCache.get(DEFAULT_SECRET_KEY));
75
71
  }
76
72
  }
77
- exports.SecretHolder = SecretHolder;
78
- //# sourceMappingURL=secret-holder.js.map
73
+ //# sourceMappingURL=secret-holder.mjs.map
@@ -1,22 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSecret = void 0;
4
- const aws_sdk_1 = require("aws-sdk");
5
- const utils_1 = require("../../../utils/utils");
6
- const environment_1 = require("../environment");
1
+ import { SecretsManager } from "aws-sdk";
2
+ import { getEnvVariable, getEnvVariableOrElse } from "../../../utils/utils.mjs";
3
+ import { EnvKeys } from "../environment.mjs";
7
4
  // SECRET_OVERRIDE_AWS_REGION might not have been set before import of
8
5
  // secret, so we need to lazy initialize SecretsManager
9
6
  let smClient;
10
7
  function getSmClient() {
11
8
  if (!smClient) {
12
- smClient = new aws_sdk_1.SecretsManager({
13
- region: (0, utils_1.getEnvVariableOrElse)(environment_1.EnvKeys.SECRET_OVERRIDE_AWS_REGION, // this is override secret region
14
- (0, utils_1.getEnvVariable)(environment_1.EnvKeys.AWS_REGION)),
9
+ smClient = new SecretsManager({
10
+ region: getEnvVariableOrElse(EnvKeys.SECRET_OVERRIDE_AWS_REGION, // this is override secret region
11
+ getEnvVariable(EnvKeys.AWS_REGION)),
15
12
  });
16
13
  }
17
14
  return smClient;
18
15
  }
19
- async function getSecret(secretId, prefix = "") {
16
+ export async function getSecret(secretId, prefix = "") {
20
17
  const secretObj = await getSmClient()
21
18
  .getSecretValue({
22
19
  SecretId: secretId,
@@ -31,7 +28,6 @@ async function getSecret(secretId, prefix = "") {
31
28
  }
32
29
  return parseSecret(secret, `${prefix}.`);
33
30
  }
34
- exports.getSecret = getSecret;
35
31
  function parseSecret(secret, prefix) {
36
32
  const parsed = {};
37
33
  const skip = prefix.length;
@@ -42,4 +38,4 @@ function parseSecret(secret, prefix) {
42
38
  }
43
39
  return parsed;
44
40
  }
45
- //# sourceMappingURL=secret.js.map
41
+ //# sourceMappingURL=secret.mjs.map
@@ -0,0 +1,12 @@
1
+ // DEPRECATED, remove these!
2
+ export const NOT_FOUND_MESSAGE = "NOT_FOUND";
3
+ export const ERROR_MESSAGE = "ERROR";
4
+ export const OK_MESSAGE = "OK";
5
+ export const BAD_REQUEST_MESSAGE = "BAD REQUEST";
6
+ export class ValidationError extends Error {
7
+ constructor(statusCode, body) {
8
+ super(body);
9
+ this.statusCode = statusCode;
10
+ }
11
+ }
12
+ //# sourceMappingURL=errors.mjs.map
@@ -1,17 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LambdaResponse = void 0;
7
- const etag_1 = __importDefault(require("etag"));
8
- class LambdaResponse {
1
+ import etag from "etag";
2
+ export class LambdaResponse {
9
3
  constructor(status, body, fileName, timestamp) {
10
4
  this.status = status;
11
5
  this.body = body;
12
6
  this.fileName = fileName;
13
7
  this.timestamp = timestamp?.toUTCString();
14
- this.etag = (0, etag_1.default)(body); // create strong etag by default
8
+ this.etag = etag(body); // create strong etag by default
15
9
  }
16
10
  withTimestamp(timestamp) {
17
11
  return new LambdaResponse(this.status, this.body, this.fileName, timestamp);
@@ -65,8 +59,7 @@ class LambdaResponse {
65
59
  return new LambdaResponse(status, base64Body, fileName);
66
60
  }
67
61
  }
68
- exports.LambdaResponse = LambdaResponse;
69
62
  function toBase64(body) {
70
63
  return Buffer.from(body).toString("base64");
71
64
  }
72
- //# sourceMappingURL=lambda-response.js.map
65
+ //# sourceMappingURL=lambda-response.mjs.map
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaType = void 0;
4
1
  // charset=UTF-8 is deprecated but mobile applications sometimes needs it
5
- var MediaType;
2
+ export var MediaType;
6
3
  (function (MediaType) {
7
4
  MediaType["APPLICATION_JSON"] = "application/json";
8
5
  MediaType["APPLICATION_XML"] = "application/xml";
@@ -13,5 +10,5 @@ var MediaType;
13
10
  MediaType["TEXT_HTML"] = "text/html";
14
11
  MediaType["TEXT_CSV"] = "text/csv";
15
12
  MediaType["APPLICATION_JSON_UTF8"] = "application/json;charset=UTF-8";
16
- })(MediaType || (exports.MediaType = MediaType = {}));
17
- //# sourceMappingURL=mediatypes.js.map
13
+ })(MediaType || (MediaType = {}));
14
+ //# sourceMappingURL=mediatypes.mjs.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=model-with-reference.mjs.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=proxytypes.mjs.map
@@ -0,0 +1,4 @@
1
+ // DEPRECATED! This must be replaced with new application specific tags
2
+ export const BETA_TAGS = ['Beta'];
3
+ export const DATA_V1_TAGS = ['Data v1'];
4
+ //# sourceMappingURL=tags.mjs.map
@@ -1,4 +1,4 @@
1
- import { DTDatabase, DTTransaction } from "./database";
1
+ import { DTDatabase, DTTransaction } from "./database.mjs";
2
2
  export interface CachedValue<T> {
3
3
  content: T;
4
4
  last_updated: Date;
@@ -1,23 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFromCache = exports.getJsonFromCache = exports.updateCachedJson = exports.JSON_CACHE_KEY = void 0;
4
- const pg_promise_1 = require("pg-promise");
5
- const PS_UPDATE_CACHE_VALUE = new pg_promise_1.PreparedStatement({
1
+ import pg from "pg-promise";
2
+ const { PreparedStatement } = pg;
3
+ const PS_UPDATE_CACHE_VALUE = new PreparedStatement({
6
4
  name: "update-cache-value",
7
5
  text: `insert into cached_json(cache_id, content, last_updated)
8
6
  values ($1, $2, $3)
9
7
  on conflict(cache_id) do
10
8
  update set content = $2, last_updated = $3`,
11
9
  });
12
- const PS_GET_CACHE_VALUE = new pg_promise_1.PreparedStatement({
10
+ const PS_GET_CACHE_VALUE = new PreparedStatement({
13
11
  name: "get-cache-value",
14
12
  text: "select content, last_updated, modified from cached_json where cache_id = $1",
15
13
  });
16
- var JSON_CACHE_KEY;
14
+ export var JSON_CACHE_KEY;
17
15
  (function (JSON_CACHE_KEY) {
18
16
  JSON_CACHE_KEY["NAUTICAL_WARNINGS_ACTIVE"] = "nautical-warnings-active";
19
17
  JSON_CACHE_KEY["NAUTICAL_WARNINGS_ARCHIVED"] = "nautical-warnings-archived";
20
- })(JSON_CACHE_KEY || (exports.JSON_CACHE_KEY = JSON_CACHE_KEY = {}));
18
+ })(JSON_CACHE_KEY || (JSON_CACHE_KEY = {}));
21
19
  /**
22
20
  *
23
21
  * @param db
@@ -25,22 +23,19 @@ var JSON_CACHE_KEY;
25
23
  * @param value
26
24
  * @param lastUpdated time when data was created or updated
27
25
  */
28
- async function updateCachedJson(db, cacheKey, value, lastUpdated) {
26
+ export async function updateCachedJson(db, cacheKey, value, lastUpdated) {
29
27
  await db.none(PS_UPDATE_CACHE_VALUE, [cacheKey, value, lastUpdated]);
30
28
  }
31
- exports.updateCachedJson = updateCachedJson;
32
- function getJsonFromCache(db, cacheKey) {
29
+ export function getJsonFromCache(db, cacheKey) {
33
30
  return db
34
31
  .oneOrNone(PS_GET_CACHE_VALUE, [cacheKey])
35
32
  .then((value) => value?.content ?? undefined);
36
33
  }
37
- exports.getJsonFromCache = getJsonFromCache;
38
- async function getFromCache(db, cacheKey) {
34
+ export async function getFromCache(db, cacheKey) {
39
35
  return db
40
36
  .oneOrNone(PS_GET_CACHE_VALUE, [cacheKey])
41
37
  .then((result) => {
42
38
  return result ?? undefined;
43
39
  });
44
40
  }
45
- exports.getFromCache = getFromCache;
46
- //# sourceMappingURL=cached.js.map
41
+ //# sourceMappingURL=cached.mjs.map
@@ -1,4 +1,4 @@
1
- import { IDatabase, ITask } from "pg-promise";
1
+ import { type IDatabase, type ITask } from "pg-promise";
2
2
  export declare enum DatabaseEnvironmentKeys {
3
3
  DB_USER = "DB_USER",
4
4
  DB_PASS = "DB_PASS",