@digitraffic/common 2024.8.16-1 → 2024.8.30-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 (226) hide show
  1. package/dist/{test/asserter.mjs → __test__/asserter.js} +3 -3
  2. package/dist/{test/db-testutils.d.mts → __test__/db-testutils.d.ts} +1 -1
  3. package/dist/{test/db-testutils.mjs → __test__/db-testutils.js} +4 -3
  4. package/dist/__test__/{dependencies.test.mjs → dependencies.test.js} +1 -1
  5. package/dist/__test__/{imports.test.mjs → imports.test.js} +79 -79
  6. package/dist/__test__/infra/{acl-builder.test.mjs → acl-builder.test.js} +4 -4
  7. package/dist/__test__/infra/api/{handler-factory.test.mjs → handler-factory.test.js} +3 -4
  8. package/dist/__test__/infra/api/{response.test.mjs → response.test.js} +3 -11
  9. package/dist/__test__/infra/api/{static-integration.test.mjs → static-integration.test.js} +3 -3
  10. package/dist/__test__/infra/{documentation.test.mjs → documentation.test.js} +2 -2
  11. package/dist/__test__/infra/{scheduler.test.mjs → scheduler.test.js} +2 -2
  12. package/dist/__test__/infra/{security-rule.test.mjs → security-rule.test.js} +2 -2
  13. package/dist/__test__/marine/{id_utils.test.mjs → id_utils.test.js} +3 -3
  14. package/dist/{test/mock-ky.mjs → __test__/mock-ky.js} +1 -1
  15. package/dist/__test__/promise/{promise.test.mjs → promise.test.js} +9 -13
  16. package/dist/__test__/runtime/{dt-logger.test.mjs → dt-logger.test.js} +7 -7
  17. package/dist/__test__/secrets/{secret-holder.test.mjs → secret-holder.test.js} +6 -4
  18. package/dist/__test__/secrets/{secret.test.mjs → secret.test.js} +4 -2
  19. package/dist/__test__/stack/{rest-apis.test.mjs → rest-apis.test.js} +4 -4
  20. package/dist/__test__/test/{mock-ky.test.mjs → mock-ky.test.js} +3 -3
  21. package/dist/{test/testutils.mjs → __test__/testutils.js} +1 -2
  22. package/dist/__test__/types/{lambda-response.test.mjs → lambda-response.test.js} +2 -2
  23. package/dist/__test__/utils/{date-utils.test.mjs → date-utils.test.js} +3 -3
  24. package/dist/__test__/utils/{geometry.test.mjs → geometry.test.js} +3 -3
  25. package/dist/__test__/utils/{logging.test.mjs → logging.test.js} +4 -4
  26. package/dist/__test__/utils/{utils.test.mjs → utils.test.js} +2 -3
  27. package/dist/aws/infra/{acl-builder.d.mts → acl-builder.d.ts} +15 -8
  28. package/dist/aws/infra/{acl-builder.mjs → acl-builder.js} +77 -55
  29. package/dist/aws/infra/api/{handler-factory.d.mts → handler-factory.d.ts} +4 -4
  30. package/dist/aws/infra/api/{handler-factory.mjs → handler-factory.js} +7 -5
  31. package/dist/aws/infra/api/{integration.d.mts → integration.d.ts} +3 -1
  32. package/dist/aws/infra/api/{integration.mjs → integration.js} +31 -13
  33. package/dist/aws/infra/api/{response.d.mts → response.d.ts} +2 -2
  34. package/dist/aws/infra/api/{response.mjs → response.js} +4 -4
  35. package/dist/aws/infra/api/{responses.d.mts → responses.d.ts} +3 -3
  36. package/dist/aws/infra/api/{responses.mjs → responses.js} +4 -6
  37. package/dist/aws/infra/api/{static-integration.d.mts → static-integration.d.ts} +3 -9
  38. package/dist/aws/infra/api/{static-integration.mjs → static-integration.js} +3 -3
  39. package/dist/aws/infra/canaries/canary-alarm.d.ts +6 -0
  40. package/dist/aws/infra/canaries/{canary-alarm.mjs → canary-alarm.js} +1 -3
  41. package/dist/aws/infra/canaries/{canary-keys.mjs → canary-keys.js} +1 -1
  42. package/dist/aws/infra/canaries/{canary-parameters.d.mts → canary-parameters.d.ts} +1 -1
  43. package/dist/aws/infra/canaries/canary-parameters.js +2 -0
  44. package/dist/aws/infra/canaries/{canary-role.d.mts → canary-role.d.ts} +1 -1
  45. package/dist/aws/infra/canaries/{canary-role.mjs → canary-role.js} +2 -5
  46. package/dist/aws/infra/canaries/{canary.d.mts → canary.d.ts} +4 -4
  47. package/dist/aws/infra/canaries/{canary.mjs → canary.js} +3 -4
  48. package/dist/aws/infra/canaries/{database-canary.d.mts → database-canary.d.ts} +4 -5
  49. package/dist/aws/infra/canaries/{database-canary.mjs → database-canary.js} +4 -11
  50. package/dist/aws/infra/canaries/{database-checker.d.mts → database-checker.d.ts} +5 -5
  51. package/dist/aws/infra/canaries/{database-checker.mjs → database-checker.js} +15 -12
  52. package/dist/aws/infra/canaries/{url-canary.d.mts → url-canary.d.ts} +5 -5
  53. package/dist/aws/infra/canaries/{url-canary.mjs → url-canary.js} +7 -12
  54. package/dist/aws/infra/canaries/{url-checker.d.mts → url-checker.d.ts} +2 -2
  55. package/dist/aws/infra/canaries/{url-checker.mjs → url-checker.js} +12 -21
  56. package/dist/aws/infra/{documentation.d.mts → documentation.d.ts} +2 -2
  57. package/dist/aws/infra/{documentation.mjs → documentation.js} +4 -3
  58. package/dist/aws/infra/{import-util.d.mts → import-util.d.ts} +2 -2
  59. package/dist/aws/infra/{import-util.mjs → import-util.js} +3 -3
  60. package/dist/aws/infra/{scheduler.d.mts → scheduler.d.ts} +2 -2
  61. package/dist/aws/infra/{scheduler.mjs → scheduler.js} +1 -3
  62. package/dist/aws/infra/{security-rule.d.mts → security-rule.d.ts} +1 -1
  63. package/dist/aws/infra/{security-rule.mjs → security-rule.js} +1 -2
  64. package/dist/aws/infra/{sqs-integration.d.mts → sqs-integration.d.ts} +3 -3
  65. package/dist/aws/infra/{sqs-integration.mjs → sqs-integration.js} +3 -7
  66. package/dist/aws/infra/{sqs-queue.d.mts → sqs-queue.d.ts} +1 -1
  67. package/dist/aws/infra/{sqs-queue.mjs → sqs-queue.js} +19 -19
  68. package/dist/aws/infra/stack/{lambda-configs.d.mts → lambda-configs.d.ts} +4 -4
  69. package/dist/aws/infra/stack/{lambda-configs.mjs → lambda-configs.js} +3 -7
  70. package/dist/aws/infra/stack/{monitoredfunction.d.mts → monitoredfunction.d.ts} +15 -15
  71. package/dist/aws/infra/stack/{monitoredfunction.mjs → monitoredfunction.js} +42 -43
  72. package/dist/aws/infra/stack/{parameters.mjs → parameters.js} +1 -1
  73. package/dist/aws/infra/stack/{rest_apis.d.mts → rest_apis.d.ts} +12 -6
  74. package/dist/aws/infra/stack/{rest_apis.mjs → rest_apis.js} +26 -24
  75. package/dist/aws/infra/stack/{stack-checking-aspect.mjs → stack-checking-aspect.js} +7 -2
  76. package/dist/aws/infra/stack/{stack.d.mts → stack.d.ts} +4 -4
  77. package/dist/aws/infra/stack/{stack.mjs → stack.js} +2 -5
  78. package/dist/aws/infra/stack/{subscription.d.mts → subscription.d.ts} +4 -4
  79. package/dist/aws/infra/stack/{subscription.mjs → subscription.js} +2 -6
  80. package/dist/aws/infra/stacks/{db-dns-stack.d.mts → db-dns-stack.d.ts} +1 -1
  81. package/dist/aws/infra/stacks/{db-dns-stack.mjs → db-dns-stack.js} +4 -4
  82. package/dist/aws/infra/stacks/{db-proxy-stack.d.mts → db-proxy-stack.d.ts} +2 -2
  83. package/dist/aws/infra/stacks/{db-proxy-stack.mjs → db-proxy-stack.js} +5 -6
  84. package/dist/aws/infra/stacks/{db-stack.d.mts → db-stack.d.ts} +4 -4
  85. package/dist/aws/infra/stacks/{db-stack.mjs → db-stack.js} +7 -10
  86. package/dist/aws/infra/stacks/intra-stack-configuration.js +2 -0
  87. package/dist/aws/infra/stacks/{network-stack.d.mts → network-stack.d.ts} +2 -2
  88. package/dist/aws/infra/stacks/{network-stack.mjs → network-stack.js} +4 -7
  89. package/dist/aws/infra/{usage-plans.d.mts → usage-plans.d.ts} +1 -1
  90. package/dist/aws/infra/{usage-plans.mjs → usage-plans.js} +1 -2
  91. package/dist/aws/runtime/{apikey.mjs → apikey.js} +1 -1
  92. package/dist/aws/runtime/{digitraffic-integration-response.d.mts → digitraffic-integration-response.d.ts} +1 -1
  93. package/dist/aws/runtime/{digitraffic-integration-response.mjs → digitraffic-integration-response.js} +4 -6
  94. package/dist/aws/runtime/{dt-logger-default.d.mts → dt-logger-default.d.ts} +2 -2
  95. package/dist/aws/runtime/{dt-logger-default.mjs → dt-logger-default.js} +2 -2
  96. package/dist/aws/runtime/{dt-logger.mjs → dt-logger.js} +9 -4
  97. package/dist/aws/runtime/{environment.mjs → environment.js} +2 -2
  98. package/dist/aws/runtime/{s3.d.mts → s3.d.ts} +1 -1
  99. package/dist/aws/runtime/{s3.mjs → s3.js} +3 -3
  100. package/dist/aws/runtime/secrets/{dbsecret.d.mts → dbsecret.d.ts} +1 -1
  101. package/dist/aws/runtime/secrets/{dbsecret.mjs → dbsecret.js} +6 -2
  102. package/dist/aws/runtime/secrets/proxy-holder.js +25 -0
  103. package/dist/aws/runtime/secrets/rds-holder.js +25 -0
  104. package/dist/aws/runtime/secrets/{secret-holder.d.mts → secret-holder.d.ts} +6 -5
  105. package/dist/aws/runtime/secrets/{secret-holder.mjs → secret-holder.js} +11 -12
  106. package/dist/aws/runtime/secrets/{secret.mjs → secret.js} +7 -3
  107. package/dist/aws/types/{errors.mjs → errors.js} +1 -1
  108. package/dist/aws/types/{lambda-response.mjs → lambda-response.js} +1 -1
  109. package/dist/aws/types/{mediatypes.mjs → mediatypes.js} +1 -1
  110. package/dist/aws/types/{model-with-reference.d.mts → model-with-reference.d.ts} +1 -1
  111. package/dist/aws/types/model-with-reference.js +2 -0
  112. package/dist/aws/types/proxytypes.js +2 -0
  113. package/dist/aws/types/tags.js +4 -0
  114. package/dist/database/{cached.d.mts → cached.d.ts} +1 -1
  115. package/dist/database/{cached.mjs → cached.js} +2 -4
  116. package/dist/database/{database.mjs → database.js} +4 -8
  117. package/dist/database/{last-updated.d.mts → last-updated.d.ts} +1 -1
  118. package/dist/database/{last-updated.mjs → last-updated.js} +3 -1
  119. package/dist/database/models.js +2 -0
  120. package/dist/index.d.ts +1 -0
  121. package/dist/index.js +2 -0
  122. package/dist/marine/{id_utils.mjs → id_utils.js} +2 -2
  123. package/dist/marine/rtz.js +2 -0
  124. package/dist/types/{async-timeout-error.mjs → async-timeout-error.js} +1 -1
  125. package/dist/types/aws-env.js +2 -0
  126. package/dist/types/either.js +2 -0
  127. package/dist/types/{http-error.mjs → http-error.js} +1 -1
  128. package/dist/types/{input-error.mjs → input-error.js} +1 -1
  129. package/dist/types/{language.mjs → language.js} +1 -1
  130. package/dist/types/{nullable.d.mts → nullable.d.ts} +1 -1
  131. package/dist/types/nullable.js +2 -0
  132. package/dist/types/openapi-schema.d.ts +4342 -0
  133. package/dist/types/openapi-schema.js +134 -0
  134. package/dist/types/{traffictype.mjs → traffictype.js} +1 -1
  135. package/dist/types/urn.js +2 -0
  136. package/dist/types/util-types.js +2 -0
  137. package/dist/types/{validator.mjs → validator.js} +1 -1
  138. package/dist/utils/{api-model.d.mts → api-model.d.ts} +6 -5
  139. package/dist/utils/{api-model.mjs → api-model.js} +14 -15
  140. package/dist/utils/{base64.mjs → base64.js} +3 -3
  141. package/dist/utils/{date-utils.mjs → date-utils.js} +1 -1
  142. package/dist/utils/{geojson-types.d.mts → geojson-types.d.ts} +2 -2
  143. package/dist/utils/{geojson-types.mjs → geojson-types.js} +1 -1
  144. package/dist/utils/{geometry.d.mts → geometry.d.ts} +4 -3
  145. package/dist/utils/{geometry.mjs → geometry.js} +7 -4
  146. package/dist/utils/{logging.d.mts → logging.d.ts} +1 -1
  147. package/dist/utils/{logging.mjs → logging.js} +5 -8
  148. package/dist/utils/{retry.mjs → retry.js} +6 -8
  149. package/dist/utils/{slack.mjs → slack.js} +3 -3
  150. package/dist/utils/{utils.d.mts → utils.d.ts} +2 -3
  151. package/dist/utils/{utils.mjs → utils.js} +9 -5
  152. package/package.json +137 -131
  153. package/dist/aws/infra/canaries/canary-alarm.d.mts +0 -6
  154. package/dist/aws/infra/canaries/canary-parameters.mjs +0 -2
  155. package/dist/aws/infra/stacks/intra-stack-configuration.mjs +0 -2
  156. package/dist/aws/runtime/secrets/proxy-holder.mjs +0 -25
  157. package/dist/aws/runtime/secrets/rds-holder.mjs +0 -25
  158. package/dist/aws/types/model-with-reference.mjs +0 -2
  159. package/dist/aws/types/proxytypes.mjs +0 -2
  160. package/dist/aws/types/tags.mjs +0 -4
  161. package/dist/database/models.mjs +0 -2
  162. package/dist/index.d.mts +0 -1
  163. package/dist/index.mjs +0 -2
  164. package/dist/marine/rtz.mjs +0 -2
  165. package/dist/types/aws-env.mjs +0 -2
  166. package/dist/types/either.mjs +0 -2
  167. package/dist/types/nullable.mjs +0 -2
  168. package/dist/types/urn.mjs +0 -2
  169. package/dist/types/util-types.mjs +0 -2
  170. /package/dist/{test/asserter.d.mts → __test__/asserter.d.ts} +0 -0
  171. /package/dist/__test__/{dependencies.test.d.mts → dependencies.test.d.ts} +0 -0
  172. /package/dist/__test__/{imports.test.d.mts → imports.test.d.ts} +0 -0
  173. /package/dist/__test__/infra/{acl-builder.test.d.mts → acl-builder.test.d.ts} +0 -0
  174. /package/dist/__test__/infra/api/{handler-factory.test.d.mts → handler-factory.test.d.ts} +0 -0
  175. /package/dist/__test__/infra/api/{response.test.d.mts → response.test.d.ts} +0 -0
  176. /package/dist/__test__/infra/api/{static-integration.test.d.mts → static-integration.test.d.ts} +0 -0
  177. /package/dist/__test__/infra/{documentation.test.d.mts → documentation.test.d.ts} +0 -0
  178. /package/dist/__test__/infra/{scheduler.test.d.mts → scheduler.test.d.ts} +0 -0
  179. /package/dist/__test__/infra/{security-rule.test.d.mts → security-rule.test.d.ts} +0 -0
  180. /package/dist/__test__/marine/{id_utils.test.d.mts → id_utils.test.d.ts} +0 -0
  181. /package/dist/{test/mock-ky.d.mts → __test__/mock-ky.d.ts} +0 -0
  182. /package/dist/__test__/promise/{promise.test.d.mts → promise.test.d.ts} +0 -0
  183. /package/dist/__test__/runtime/{dt-logger.test.d.mts → dt-logger.test.d.ts} +0 -0
  184. /package/dist/__test__/secrets/{secret-holder.test.d.mts → secret-holder.test.d.ts} +0 -0
  185. /package/dist/__test__/secrets/{secret.test.d.mts → secret.test.d.ts} +0 -0
  186. /package/dist/__test__/stack/{rest-apis.test.d.mts → rest-apis.test.d.ts} +0 -0
  187. /package/dist/__test__/test/{mock-ky.test.d.mts → mock-ky.test.d.ts} +0 -0
  188. /package/dist/{test/testutils.d.mts → __test__/testutils.d.ts} +0 -0
  189. /package/dist/__test__/types/{lambda-response.test.d.mts → lambda-response.test.d.ts} +0 -0
  190. /package/dist/__test__/utils/{date-utils.test.d.mts → date-utils.test.d.ts} +0 -0
  191. /package/dist/__test__/utils/{geometry.test.d.mts → geometry.test.d.ts} +0 -0
  192. /package/dist/__test__/utils/{logging.test.d.mts → logging.test.d.ts} +0 -0
  193. /package/dist/__test__/utils/{utils.test.d.mts → utils.test.d.ts} +0 -0
  194. /package/dist/aws/infra/canaries/{canary-keys.d.mts → canary-keys.d.ts} +0 -0
  195. /package/dist/aws/infra/stack/{parameters.d.mts → parameters.d.ts} +0 -0
  196. /package/dist/aws/infra/stack/{stack-checking-aspect.d.mts → stack-checking-aspect.d.ts} +0 -0
  197. /package/dist/aws/infra/stacks/{intra-stack-configuration.d.mts → intra-stack-configuration.d.ts} +0 -0
  198. /package/dist/aws/runtime/{apikey.d.mts → apikey.d.ts} +0 -0
  199. /package/dist/aws/runtime/{dt-logger.d.mts → dt-logger.d.ts} +0 -0
  200. /package/dist/aws/runtime/{environment.d.mts → environment.d.ts} +0 -0
  201. /package/dist/aws/runtime/secrets/{proxy-holder.d.mts → proxy-holder.d.ts} +0 -0
  202. /package/dist/aws/runtime/secrets/{rds-holder.d.mts → rds-holder.d.ts} +0 -0
  203. /package/dist/aws/runtime/secrets/{secret.d.mts → secret.d.ts} +0 -0
  204. /package/dist/aws/types/{errors.d.mts → errors.d.ts} +0 -0
  205. /package/dist/aws/types/{lambda-response.d.mts → lambda-response.d.ts} +0 -0
  206. /package/dist/aws/types/{mediatypes.d.mts → mediatypes.d.ts} +0 -0
  207. /package/dist/aws/types/{proxytypes.d.mts → proxytypes.d.ts} +0 -0
  208. /package/dist/aws/types/{tags.d.mts → tags.d.ts} +0 -0
  209. /package/dist/database/{database.d.mts → database.d.ts} +0 -0
  210. /package/dist/database/{models.d.mts → models.d.ts} +0 -0
  211. /package/dist/marine/{id_utils.d.mts → id_utils.d.ts} +0 -0
  212. /package/dist/marine/{rtz.d.mts → rtz.d.ts} +0 -0
  213. /package/dist/types/{async-timeout-error.d.mts → async-timeout-error.d.ts} +0 -0
  214. /package/dist/types/{aws-env.d.mts → aws-env.d.ts} +0 -0
  215. /package/dist/types/{either.d.mts → either.d.ts} +0 -0
  216. /package/dist/types/{http-error.d.mts → http-error.d.ts} +0 -0
  217. /package/dist/types/{input-error.d.mts → input-error.d.ts} +0 -0
  218. /package/dist/types/{language.d.mts → language.d.ts} +0 -0
  219. /package/dist/types/{traffictype.d.mts → traffictype.d.ts} +0 -0
  220. /package/dist/types/{urn.d.mts → urn.d.ts} +0 -0
  221. /package/dist/types/{util-types.d.mts → util-types.d.ts} +0 -0
  222. /package/dist/types/{validator.d.mts → validator.d.ts} +0 -0
  223. /package/dist/utils/{base64.d.mts → base64.d.ts} +0 -0
  224. /package/dist/utils/{date-utils.d.mts → date-utils.d.ts} +0 -0
  225. /package/dist/utils/{retry.d.mts → retry.d.ts} +0 -0
  226. /package/dist/utils/{slack.d.mts → slack.d.ts} +0 -0
@@ -0,0 +1,134 @@
1
+ import { z } from "zod";
2
+ export const serverObject = z.object({
3
+ url: z.string(),
4
+ description: z.string().optional(),
5
+ variables: z.record(z.unknown()).optional(),
6
+ });
7
+ export const parameterObject = z.object({
8
+ name: z.string(),
9
+ in: z.enum(["query", "header", "path", "cookie"]),
10
+ description: z.string().optional(),
11
+ required: z.boolean().optional(),
12
+ deprecated: z.boolean().optional(),
13
+ allowEmptyValue: z.boolean().optional(),
14
+ style: z
15
+ .enum(["matrix", "label", "form", "simple", "spaceDelimited", "pipeDelimited", "deepObject"])
16
+ .optional(),
17
+ explode: z.string().optional(),
18
+ allowReserved: z.boolean().optional(),
19
+ schema: z.unknown().optional(),
20
+ example: z.unknown().optional(),
21
+ examples: z.record(z.unknown()).optional(),
22
+ content: z.record(z.unknown()).optional(),
23
+ });
24
+ export const referenceObject = z.object({
25
+ $ref: z.string(),
26
+ summary: z.string().optional(),
27
+ description: z.string().optional(),
28
+ });
29
+ export const openapiOperation = z
30
+ .object({
31
+ tags: z.array(z.string()),
32
+ summary: z.string(),
33
+ description: z.string(),
34
+ externalDocs: z.unknown(),
35
+ operationId: z.string(),
36
+ parameters: z.array(parameterObject.or(referenceObject)),
37
+ requestBody: z.unknown(),
38
+ responses: z.unknown(),
39
+ callbacks: z.unknown(),
40
+ deprecated: z.boolean(),
41
+ security: z.array(z.record(z.array(z.string()))),
42
+ servers: z.array(z.unknown()),
43
+ })
44
+ .partial();
45
+ // Path items have some fixed fields but also allow for extended fields starting with "x-".
46
+ //export const openapiPathItem = z.record(openapiOperation.or(serverObject).or(parameterObject));
47
+ export const openapiPathItem = z
48
+ .object({
49
+ summary: z.string(),
50
+ description: z.string(),
51
+ get: openapiOperation,
52
+ put: openapiOperation,
53
+ post: openapiOperation,
54
+ delete: openapiOperation,
55
+ options: openapiOperation,
56
+ head: openapiOperation,
57
+ patch: openapiOperation,
58
+ trace: openapiOperation,
59
+ servers: serverObject,
60
+ parameters: z.array(parameterObject),
61
+ })
62
+ .partial();
63
+ export const openapiSchema = z
64
+ .object({
65
+ openapi: z.string().regex(new RegExp("^3\\.0\\.\\d(-.+)?$")),
66
+ info: z
67
+ .object({
68
+ title: z.string(),
69
+ description: z.string().optional(),
70
+ termsOfService: z.string().optional(),
71
+ contact: z
72
+ .object({
73
+ name: z.string().optional(),
74
+ url: z.string().optional(),
75
+ email: z.string().email().optional(),
76
+ })
77
+ .strict()
78
+ .optional(),
79
+ license: z.object({ name: z.string(), url: z.string().optional() }).strict().optional(),
80
+ version: z.string(),
81
+ })
82
+ .strict(),
83
+ externalDocs: z.object({ description: z.string().optional(), url: z.string() }).strict().optional(),
84
+ servers: z
85
+ .array(z
86
+ .object({
87
+ url: z.string(),
88
+ description: z.string().optional(),
89
+ variables: z
90
+ .record(z
91
+ .object({
92
+ enum: z.array(z.string()).optional(),
93
+ default: z.string(),
94
+ description: z.string().optional(),
95
+ })
96
+ .strict())
97
+ .optional(),
98
+ })
99
+ .strict())
100
+ .optional(),
101
+ security: z.array(z.record(z.array(z.string()))).optional(),
102
+ tags: z
103
+ .array(z
104
+ .object({
105
+ name: z.string(),
106
+ description: z.string().optional(),
107
+ externalDocs: z
108
+ .object({
109
+ description: z.string().optional(),
110
+ url: z.string(),
111
+ })
112
+ .strict()
113
+ .optional(),
114
+ })
115
+ .strict())
116
+ .optional(),
117
+ paths: z.record(openapiPathItem),
118
+ components: z
119
+ .object({
120
+ schemas: z.record(z.any()).optional(),
121
+ responses: z.record(z.any()).optional(),
122
+ parameters: z.record(z.any()).optional(),
123
+ examples: z.record(z.any()).optional(),
124
+ requestBodies: z.record(z.any()).optional(),
125
+ headers: z.record(z.any()).optional(),
126
+ securitySchemes: z.record(z.any()).optional(),
127
+ links: z.record(z.any()).optional(),
128
+ callbacks: z.record(z.any()).optional(),
129
+ })
130
+ .strict()
131
+ .optional(),
132
+ })
133
+ .describe("The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3");
134
+ //# sourceMappingURL=openapi-schema.js.map
@@ -7,4 +7,4 @@ export var TrafficType;
7
7
  TrafficType["MCP"] = "MCP";
8
8
  TrafficType["OTHER"] = "Other";
9
9
  })(TrafficType || (TrafficType = {}));
10
- //# sourceMappingURL=traffictype.mjs.map
10
+ //# sourceMappingURL=traffictype.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=urn.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=util-types.js.map
@@ -6,4 +6,4 @@ export function validateYear(year, minYear = MIN_YEAR, maxYear = MAX_YEAR) {
6
6
  export function validateMonth(month) {
7
7
  return month > 0 && month < 13;
8
8
  }
9
- //# sourceMappingURL=validator.mjs.map
9
+ //# sourceMappingURL=validator.js.map
@@ -1,12 +1,13 @@
1
- import { RestApi, Model, type JsonSchema, RequestValidator, JsonSchemaType, JsonSchemaVersion } from 'aws-cdk-lib/aws-apigateway';
2
- import type { ModelWithReference } from "../aws/types/model-with-reference.mjs";
1
+ import { type JsonSchema, JsonSchemaType, JsonSchemaVersion, type Model, type RequestValidator, type RestApi } from "aws-cdk-lib/aws-apigateway";
2
+ import type { ModelWithReference } from "../aws/types/model-with-reference.js";
3
+ type ModelReferenceUrl = `https://apigateway.amazonaws.com/restapis/${string}/models/${string}`;
3
4
  /**
4
5
  * Get a reference to an OpenAPI model object in a REST API.
5
6
  * Can be used to supply a reference to properties of a GeoJSON feature.
6
7
  * @param modelId Id of the referenced object
7
8
  * @param restApiId Id of the REST API
8
9
  */
9
- export declare function getModelReference(modelId: string, restApiId: string): string;
10
+ export declare function getModelReference(modelId: string, restApiId: string): ModelReferenceUrl;
10
11
  /**
11
12
  * Adds a request validator to a REST API to enforce request parameters/body requirements.
12
13
  * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html
@@ -29,7 +30,7 @@ export declare function addServiceModel(modelName: string, api: RestApi, schema:
29
30
  * @param api
30
31
  * @param contentType
31
32
  */
32
- export declare function addSimpleServiceModel(modelName: string, api: RestApi, contentType?: string): Model;
33
+ export declare function addSimpleServiceModel(modelName: string, api: RestApi, contentType?: `${string}/${string}`): Model;
33
34
  /**
34
35
  * Adds a JSON Schema model to an API Gateway API. Can be used later to generate OpenAPI specifications.
35
36
  * This method adds a schema for _an array._
@@ -62,7 +63,6 @@ export declare function featureSchema(modelReference: string): {
62
63
  };
63
64
  };
64
65
  /**
65
- *
66
66
  * Creates a JSON Schema for a GeoJSON Feature Collection. Can be used to generate OpenAPI descriptions.
67
67
  * @param modelReference Reference to a model object, in this case Features.
68
68
  */
@@ -85,3 +85,4 @@ export declare function geojsonSchema(modelReference: string): {
85
85
  };
86
86
  };
87
87
  };
88
+ export {};
@@ -1,4 +1,4 @@
1
- import { RestApi, Model, RequestValidator, JsonSchemaType, JsonSchemaVersion, } from 'aws-cdk-lib/aws-apigateway';
1
+ import { JsonSchemaType, JsonSchemaVersion, } from "aws-cdk-lib/aws-apigateway";
2
2
  /**
3
3
  * Get a reference to an OpenAPI model object in a REST API.
4
4
  * Can be used to supply a reference to properties of a GeoJSON feature.
@@ -14,7 +14,7 @@ export function getModelReference(modelId, restApiId) {
14
14
  * @param api REST API
15
15
  */
16
16
  export function addDefaultValidator(api) {
17
- return api.addRequestValidator('DefaultValidator', {
17
+ return api.addRequestValidator("DefaultValidator", {
18
18
  validateRequestParameters: true,
19
19
  validateRequestBody: true,
20
20
  });
@@ -29,7 +29,7 @@ export function addDefaultValidator(api) {
29
29
  */
30
30
  export function addServiceModel(modelName, api, schema) {
31
31
  const mwr = api.addModel(modelName, {
32
- contentType: 'application/json',
32
+ contentType: "application/json",
33
33
  modelName,
34
34
  schema,
35
35
  });
@@ -43,7 +43,7 @@ export function addServiceModel(modelName, api, schema) {
43
43
  * @param api
44
44
  * @param contentType
45
45
  */
46
- export function addSimpleServiceModel(modelName, api, contentType = 'application/xml') {
46
+ export function addSimpleServiceModel(modelName, api, contentType = "application/xml") {
47
47
  return api.addModel(modelName, {
48
48
  contentType,
49
49
  modelName,
@@ -72,26 +72,25 @@ export function featureSchema(modelReference) {
72
72
  return {
73
73
  schema: JsonSchemaVersion.DRAFT4,
74
74
  type: JsonSchemaType.OBJECT,
75
- description: 'GeoJson Feature',
76
- required: ['type', 'properties', 'geometry'],
75
+ description: "GeoJson Feature",
76
+ required: ["type", "properties", "geometry"],
77
77
  properties: {
78
78
  type: {
79
79
  type: JsonSchemaType.STRING,
80
- description: 'Feature',
81
- enum: ['Feature'],
80
+ description: "Feature",
81
+ enum: ["Feature"],
82
82
  },
83
83
  properties: {
84
84
  ref: modelReference,
85
85
  },
86
86
  geometry: {
87
87
  type: JsonSchemaType.OBJECT,
88
- description: 'GeoJSON geometry',
88
+ description: "GeoJSON geometry",
89
89
  },
90
90
  },
91
91
  };
92
92
  }
93
93
  /**
94
- *
95
94
  * Creates a JSON Schema for a GeoJSON Feature Collection. Can be used to generate OpenAPI descriptions.
96
95
  * @param modelReference Reference to a model object, in this case Features.
97
96
  */
@@ -99,13 +98,13 @@ export function geojsonSchema(modelReference) {
99
98
  return {
100
99
  schema: JsonSchemaVersion.DRAFT4,
101
100
  type: JsonSchemaType.OBJECT,
102
- description: 'GeoJson FeatureCollection',
103
- required: ['type', 'features'],
101
+ description: "GeoJson FeatureCollection",
102
+ required: ["type", "features"],
104
103
  properties: {
105
104
  type: {
106
105
  type: JsonSchemaType.STRING,
107
- description: 'FeatureCollection',
108
- enum: ['FeatureCollection'],
106
+ description: "FeatureCollection",
107
+ enum: ["FeatureCollection"],
109
108
  },
110
109
  features: {
111
110
  type: JsonSchemaType.ARRAY,
@@ -116,4 +115,4 @@ export function geojsonSchema(modelReference) {
116
115
  },
117
116
  };
118
117
  }
119
- //# sourceMappingURL=api-model.mjs.map
118
+ //# sourceMappingURL=api-model.js.map
@@ -3,7 +3,7 @@
3
3
  * @param str string
4
4
  */
5
5
  export function decodeBase64ToAscii(str) {
6
- return decodeBase64(str, 'ascii');
6
+ return decodeBase64(str, "ascii");
7
7
  }
8
8
  /**
9
9
  * Decode given string from base64 to given encoding
@@ -11,6 +11,6 @@ export function decodeBase64ToAscii(str) {
11
11
  * @param encoding
12
12
  */
13
13
  export function decodeBase64(str, encoding) {
14
- return Buffer.from(str, 'base64').toString(encoding);
14
+ return Buffer.from(str, "base64").toString(encoding);
15
15
  }
16
- //# sourceMappingURL=base64.mjs.map
16
+ //# sourceMappingURL=base64.js.map
@@ -41,4 +41,4 @@ function isValidDate(d) {
41
41
  export function dateToUTCString(date, format) {
42
42
  return formatInTimeZone(date, UTC, format);
43
43
  }
44
- //# sourceMappingURL=date-utils.mjs.map
44
+ //# sourceMappingURL=date-utils.js.map
@@ -3,12 +3,12 @@
3
3
  */
4
4
  import type { LineString, Point, Position } from "geojson";
5
5
  export declare class GeoJsonPoint implements Point {
6
- readonly type = "Point";
6
+ readonly type: "Point";
7
7
  readonly coordinates: Position;
8
8
  constructor(coordinates: Position);
9
9
  }
10
10
  export declare class GeoJsonLineString implements LineString {
11
- readonly type = "LineString";
11
+ readonly type: "LineString";
12
12
  readonly coordinates: Position[];
13
13
  constructor(coordinates: Position[]);
14
14
  }
@@ -12,4 +12,4 @@ export class GeoJsonLineString {
12
12
  this.coordinates = coordinates;
13
13
  }
14
14
  }
15
- //# sourceMappingURL=geojson-types.mjs.map
15
+ //# sourceMappingURL=geojson-types.js.map
@@ -32,8 +32,9 @@ export declare function areDistinctPositions(previous: Position, next: Position)
32
32
  * @param pos2
33
33
  */
34
34
  export declare function distanceBetweenPositionsInM(pos1: Position, pos2: Position): number;
35
- export declare function createGmlLineString(geometry: Geometry, srsName?: string): {
36
- srsName: string;
35
+ export interface GmlLineString {
36
+ srsName: `${string}:${string}`;
37
37
  posList: string;
38
- };
38
+ }
39
+ export declare function createGmlLineString(geometry: Geometry, srsName?: `${string}:${string}`): GmlLineString;
39
40
  export declare function positionToList(position: Position, precision?: number): string;
@@ -1,5 +1,5 @@
1
1
  import * as geoJsonValidator from "geojson-validation";
2
- import { logger } from "../aws/runtime/dt-logger-default.mjs";
2
+ import { logger } from "../aws/runtime/dt-logger-default.js";
3
3
  export const SRID_WGS84 = 4326;
4
4
  /**
5
5
  * Creates WKT geometry from GeoJSON geometry
@@ -47,6 +47,7 @@ function coordinatePair(coordinate) {
47
47
  * @param features List of Features
48
48
  * @param lastUpdated Last updated date
49
49
  */
50
+ // eslint-disable-next-line @rushstack/no-new-null
50
51
  export function createFeatureCollection(features, lastUpdated) {
51
52
  return {
52
53
  type: "FeatureCollection",
@@ -94,10 +95,12 @@ function distanceBetweenWGS84PointsInKm(fromXLon, fromYLat, toXLon, toYLat) {
94
95
  * @param pos2 second position
95
96
  */
96
97
  export function distanceBetweenPositionsInKm(pos1, pos2) {
97
- if (pos1.length < 2 || pos1.length > 3 || pos2.length < 2 || pos2.length > 3) {
98
+ const [pos10, pos11] = pos1;
99
+ const [pos20, pos21] = pos2;
100
+ if (pos1.length > 3 || pos2.length > 3 || !pos10 || !pos11 || !pos20 || !pos21) {
98
101
  throw Error(`Illegal Positions ${pos1.toString()} and ${pos2.toString()}. Both must have length between 2 or 3.`);
99
102
  }
100
- return distanceBetweenWGS84PointsInKm(pos1[0], pos1[1], pos2[0], pos2[1]);
103
+ return distanceBetweenWGS84PointsInKm(pos10, pos11, pos20, pos21);
101
104
  }
102
105
  export function areDistinctPositions(previous, next) {
103
106
  return previous[0] !== next[0] || previous[1] !== next[1];
@@ -142,4 +145,4 @@ export function positionToList(position, precision = 8) {
142
145
  function toRadians(angdeg) {
143
146
  return angdeg * DEGREES_TO_RADIANS;
144
147
  }
145
- //# sourceMappingURL=geometry.mjs.map
148
+ //# sourceMappingURL=geometry.js.map
@@ -1,4 +1,4 @@
1
- import { DtLogger } from "../aws/runtime/dt-logger.mjs";
1
+ import { DtLogger } from "../aws/runtime/dt-logger.js";
2
2
  /**
3
3
  * Curried version of logException.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { DtLogger } from "../aws/runtime/dt-logger.mjs";
2
- import { getEnvVariableOrElse } from "./utils.mjs";
1
+ import { DtLogger } from "../aws/runtime/dt-logger.js";
2
+ import { getEnvVariableOrElse } from "./utils.js";
3
3
  const functionName = getEnvVariableOrElse("AWS_LAMBDA_FUNCTION_NAME", "test");
4
4
  /**
5
5
  * Curried version of logException.
@@ -42,13 +42,10 @@ export function createExceptionLogger(logger = undefined, includeStack = false)
42
42
  * @see {@link createExceptionLogger} for a curried setup
43
43
  */
44
44
  export function logException(logger, error, includeStack = false) {
45
- const message = error instanceof Error
46
- ? error.message
47
- : typeof error === "string"
48
- ? error
49
- : JSON.stringify(error);
45
+ const message = error instanceof Error ? error.message : typeof error === "string" ? error : JSON.stringify(error);
50
46
  const stack = error instanceof Error && includeStack ? error.stack : undefined;
51
47
  // In case error is AxiosError, log the custom code property.
48
+ // eslint-disable-next-line dot-notation
52
49
  const customCode = error["code"];
53
50
  logger.error({
54
51
  type: "Error",
@@ -58,4 +55,4 @@ export function logException(logger, error, includeStack = false) {
58
55
  stack,
59
56
  });
60
57
  }
61
- //# sourceMappingURL=logging.mjs.map
58
+ //# sourceMappingURL=logging.js.map
@@ -1,6 +1,6 @@
1
- import { HttpError } from "../types/http-error.mjs";
2
- import { AsyncTimeoutError } from "../types/async-timeout-error.mjs";
3
- import { logger } from "../aws/runtime/dt-logger-default.mjs";
1
+ import { HttpError } from "../types/http-error.js";
2
+ import { AsyncTimeoutError } from "../types/async-timeout-error.js";
3
+ import { logger } from "../aws/runtime/dt-logger-default.js";
4
4
  export var RetryLogError;
5
5
  (function (RetryLogError) {
6
6
  RetryLogError[RetryLogError["LOG_ALL_AS_ERRORS"] = 0] = "LOG_ALL_AS_ERRORS";
@@ -12,7 +12,6 @@ export var RetryLogError;
12
12
  */
13
13
  export const timeoutFunctions = (function () {
14
14
  return {
15
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
15
  noTimeout: (_) => {
17
16
  return 0;
18
17
  },
@@ -38,7 +37,6 @@ export const retryPredicates = (function () {
38
37
  }
39
38
  return false;
40
39
  },
41
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
42
40
  alwaysRetry: (_) => {
43
41
  return true;
44
42
  },
@@ -62,10 +60,10 @@ async function retryRecursive(asyncFn, retries, retryCountInj, logError, timeout
62
60
  }
63
61
  try {
64
62
  // NOTE, a Promise cannot be cancelled. So if the asyncFn calls multiple async/await paris and the first one takes 31 minutes to complete,
65
- // then the rest of async/await pairs will be called even though AysncTimeoutError is allready thrown.
63
+ // then the rest of async/await pairs will be called even though AsyncTimeoutError is already thrown.
66
64
  const result = await Promise.race([
67
65
  asyncFn(),
68
- new Promise((_, reject) => setTimeout(() => reject(new AsyncTimeoutError()), asyncFnTimeout)),
66
+ new Promise((_resolve, reject) => setTimeout(() => reject(new AsyncTimeoutError()), asyncFnTimeout)),
69
67
  ]);
70
68
  return result;
71
69
  }
@@ -140,4 +138,4 @@ export async function retryRequest(request, ...args) {
140
138
  const asyncFn = wrapArgsToFn(request, ...args);
141
139
  return retry(asyncFn, 5, RetryLogError.LOG_LAST_RETRY_AS_ERROR_OTHERS_AS_WARNS, timeoutFunctions.exponentialTimeout, retryPredicates.retryBasedOnStatusCode);
142
140
  }
143
- //# sourceMappingURL=retry.mjs.map
141
+ //# sourceMappingURL=retry.js.map
@@ -1,6 +1,6 @@
1
1
  import ky from "ky";
2
- import { logger } from "../aws/runtime/dt-logger-default.mjs";
3
- import { logException } from "./logging.mjs";
2
+ import { logger } from "../aws/runtime/dt-logger-default.js";
3
+ import { logException } from "./logging.js";
4
4
  export class SlackApi {
5
5
  url;
6
6
  constructor(url) {
@@ -21,4 +21,4 @@ export class SlackApi {
21
21
  }
22
22
  }
23
23
  }
24
- //# sourceMappingURL=slack.mjs.map
24
+ //# sourceMappingURL=slack.js.map
@@ -1,5 +1,5 @@
1
- import type { AwsEnv } from "../types/aws-env.mjs";
2
- import type { Either } from "../types/either.mjs";
1
+ import type { AwsEnv } from "../types/aws-env.js";
2
+ import type { Either } from "../types/either.js";
3
3
  /**
4
4
  * Check if arrays have only elements that also exists also in other array.
5
5
  * Individual element count doesn't matter.
@@ -90,7 +90,6 @@ export declare function hasOwnPropertySafe(object: object, propertyName: string)
90
90
  */
91
91
  export declare function getErrorMessage(maybeError: unknown): string;
92
92
  /**
93
- *
94
93
  * @param value
95
94
  */
96
95
  export declare function isDefined<T>(value: T | undefined | null): value is T;
@@ -1,4 +1,4 @@
1
- import { EnvKeys } from "../aws/runtime/environment.mjs";
1
+ import { EnvKeys } from "../aws/runtime/environment.js";
2
2
  /**
3
3
  * Check if arrays have only elements that also exists also in other array.
4
4
  * Individual element count doesn't matter.
@@ -20,7 +20,11 @@ import { EnvKeys } from "../aws/runtime/environment.mjs";
20
20
  * @param a first array to compare
21
21
  * @param b second array to compare
22
22
  */
23
- export function bothArraysHasSameValues(a, b) {
23
+ export function bothArraysHasSameValues(
24
+ // eslint-disable-next-line @rushstack/no-new-null
25
+ a,
26
+ // eslint-disable-next-line @rushstack/no-new-null
27
+ b) {
24
28
  if ((a && !b) || (!a && b)) {
25
29
  return false;
26
30
  }
@@ -47,7 +51,7 @@ export function getFirst(array, sortFunction) {
47
51
  return getFirstOrLast(true, array, sortFunction);
48
52
  }
49
53
  function getFirstOrLast(getFirst, array, sortFunction) {
50
- if (array.length == 0) {
54
+ if (array.length === 0) {
51
55
  throw new Error(`can't get ${getFirst ? "first" : "last"} from empty array!`);
52
56
  }
53
57
  const index = getFirst ? 0 : array.length - 1;
@@ -154,10 +158,10 @@ export function getErrorMessage(maybeError) {
154
158
  return String(maybeError);
155
159
  }
156
160
  /**
157
- *
158
161
  * @param value
159
162
  */
163
+ // eslint-disable-next-line @rushstack/no-new-null
160
164
  export function isDefined(value) {
161
165
  return value !== undefined && value !== null;
162
166
  }
163
- //# sourceMappingURL=utils.mjs.map
167
+ //# sourceMappingURL=utils.js.map