@geekmidas/constructs 10.0.0-alpha.98 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (533) hide show
  1. package/CHANGELOG.md +437 -0
  2. package/README.md +193 -285
  3. package/dist/AWSScheduledFunction-BzGCUbkk.d.mts +117 -0
  4. package/dist/AWSScheduledFunction-BzGCUbkk.d.mts.map +1 -0
  5. package/dist/AWSScheduledFunction-C42adp8A.cjs +266 -0
  6. package/dist/AWSScheduledFunction-C42adp8A.cjs.map +1 -0
  7. package/dist/AWSScheduledFunction-CsNJhXQj.d.cts +117 -0
  8. package/dist/AWSScheduledFunction-CsNJhXQj.d.cts.map +1 -0
  9. package/dist/AWSScheduledFunction-KP6lqbsW.mjs +254 -0
  10. package/dist/AWSScheduledFunction-KP6lqbsW.mjs.map +1 -0
  11. package/dist/{Construct-B1vGBPme.mjs → Construct-BWF5HxaM.mjs} +37 -47
  12. package/dist/Construct-BWF5HxaM.mjs.map +1 -0
  13. package/dist/Construct-JlyQkBkv.d.cts +117 -0
  14. package/dist/Construct-JlyQkBkv.d.cts.map +1 -0
  15. package/dist/{Construct-DUSXuTHP.cjs → Construct-TGIM_E4o.cjs} +88 -67
  16. package/dist/Construct-TGIM_E4o.cjs.map +1 -0
  17. package/dist/Construct-pxwC6fDD.d.mts +117 -0
  18. package/dist/Construct-pxwC6fDD.d.mts.map +1 -0
  19. package/dist/{Endpoint-Du-NwPX2.d.mts → Endpoint-B0P_pEMr.d.mts} +85 -126
  20. package/dist/Endpoint-B0P_pEMr.d.mts.map +1 -0
  21. package/dist/{Endpoint-aCvBMPoH.d.cts → Endpoint-BLZ7r67m.d.cts} +84 -125
  22. package/dist/Endpoint-BLZ7r67m.d.cts.map +1 -0
  23. package/dist/{HonoEndpointAdaptor-PtPlbeKY.mjs → HonoEndpointAdaptor-BMVwx2cz.mjs} +69 -81
  24. package/dist/HonoEndpointAdaptor-BMVwx2cz.mjs.map +1 -0
  25. package/dist/{HonoEndpointAdaptor-zVzVLJEO.cjs → HonoEndpointAdaptor-DPDsDi-D.cjs} +77 -92
  26. package/dist/HonoEndpointAdaptor-DPDsDi-D.cjs.map +1 -0
  27. package/dist/Queue-BL68oDJ-.d.mts +66 -0
  28. package/dist/Queue-BL68oDJ-.d.mts.map +1 -0
  29. package/dist/Queue-DxJ6btRE.d.cts +66 -0
  30. package/dist/Queue-DxJ6btRE.d.cts.map +1 -0
  31. package/dist/Subscriber-BpVhcGhX.d.cts +47 -0
  32. package/dist/Subscriber-BpVhcGhX.d.cts.map +1 -0
  33. package/dist/Subscriber-DF6xsBAJ.d.mts +47 -0
  34. package/dist/Subscriber-DF6xsBAJ.d.mts.map +1 -0
  35. package/dist/Topic-DJXoDeMP.d.cts +60 -0
  36. package/dist/Topic-DJXoDeMP.d.cts.map +1 -0
  37. package/dist/Topic-DxWQBgMN.d.mts +60 -0
  38. package/dist/Topic-DxWQBgMN.d.mts.map +1 -0
  39. package/dist/adaptors/aws.cjs +205 -355
  40. package/dist/adaptors/aws.cjs.map +1 -1
  41. package/dist/adaptors/aws.d.cts +48 -126
  42. package/dist/adaptors/aws.d.cts.map +1 -1
  43. package/dist/adaptors/aws.d.mts +49 -127
  44. package/dist/adaptors/aws.d.mts.map +1 -1
  45. package/dist/adaptors/aws.mjs +178 -325
  46. package/dist/adaptors/aws.mjs.map +1 -1
  47. package/dist/adaptors/hono.cjs +9 -3
  48. package/dist/adaptors/hono.d.cts +15 -7
  49. package/dist/adaptors/hono.d.cts.map +1 -1
  50. package/dist/adaptors/hono.d.mts +17 -9
  51. package/dist/adaptors/hono.d.mts.map +1 -1
  52. package/dist/adaptors/hono.mjs +9 -2
  53. package/dist/adaptors/testing.cjs +209 -831
  54. package/dist/adaptors/testing.cjs.map +1 -1
  55. package/dist/adaptors/testing.d.cts +55 -351
  56. package/dist/adaptors/testing.d.cts.map +1 -1
  57. package/dist/adaptors/testing.d.mts +53 -349
  58. package/dist/adaptors/testing.d.mts.map +1 -1
  59. package/dist/adaptors/testing.mjs +195 -798
  60. package/dist/adaptors/testing.mjs.map +1 -1
  61. package/dist/{clone-UGJpvQnL.cjs → clone-I_WIpiFf.cjs} +8 -7
  62. package/dist/clone-I_WIpiFf.cjs.map +1 -0
  63. package/dist/{clone-EKNovYHu.mjs → clone-pdXxc0t3.mjs} +3 -3
  64. package/dist/clone-pdXxc0t3.mjs.map +1 -0
  65. package/dist/crons/index.cjs +66 -190
  66. package/dist/crons/index.cjs.map +1 -1
  67. package/dist/crons/index.d.cts +35 -70
  68. package/dist/crons/index.d.cts.map +1 -1
  69. package/dist/crons/index.d.mts +32 -70
  70. package/dist/crons/index.d.mts.map +1 -1
  71. package/dist/crons/index.mjs +63 -184
  72. package/dist/crons/index.mjs.map +1 -1
  73. package/dist/endpoints/index.cjs +761 -19
  74. package/dist/endpoints/index.cjs.map +1 -0
  75. package/dist/endpoints/index.d.cts +322 -22
  76. package/dist/endpoints/index.d.cts.map +1 -1
  77. package/dist/endpoints/index.d.mts +321 -22
  78. package/dist/endpoints/index.d.mts.map +1 -1
  79. package/dist/endpoints/index.mjs +751 -6
  80. package/dist/endpoints/index.mjs.map +1 -0
  81. package/dist/functions/index.cjs +5 -2
  82. package/dist/functions/index.d.cts +3 -3
  83. package/dist/functions/index.d.mts +3 -3
  84. package/dist/functions/index.mjs +5 -2
  85. package/dist/{functions-BFizikJU.mjs → functions-EqTloHjo.mjs} +331 -425
  86. package/dist/functions-EqTloHjo.mjs.map +1 -0
  87. package/dist/{functions-CfzJG9hK.cjs → functions-SqtCDc9c.cjs} +370 -459
  88. package/dist/functions-SqtCDc9c.cjs.map +1 -0
  89. package/dist/index-C7iynzLI.d.mts +139 -0
  90. package/dist/index-C7iynzLI.d.mts.map +1 -0
  91. package/dist/index-D4dM_WDY.d.cts +142 -0
  92. package/dist/index-D4dM_WDY.d.cts.map +1 -0
  93. package/dist/index.cjs +3 -6
  94. package/dist/index.d.cts +4 -27
  95. package/dist/index.d.mts +4 -27
  96. package/dist/index.mjs +3 -3
  97. package/dist/{Endpoint-BG4UJ9oA.mjs → lazyAccessors-CCTK19xj.mjs} +1040 -914
  98. package/dist/lazyAccessors-CCTK19xj.mjs.map +1 -0
  99. package/dist/{Endpoint-BoUg8ocM.cjs → lazyAccessors-D04oftGw.cjs} +1127 -960
  100. package/dist/lazyAccessors-D04oftGw.cjs.map +1 -0
  101. package/dist/monitors/index.cjs +49 -0
  102. package/dist/monitors/index.cjs.map +1 -0
  103. package/dist/monitors/index.d.cts +45 -0
  104. package/dist/monitors/index.d.cts.map +1 -0
  105. package/dist/monitors/index.d.mts +45 -0
  106. package/dist/monitors/index.d.mts.map +1 -0
  107. package/dist/monitors/index.mjs +48 -0
  108. package/dist/monitors/index.mjs.map +1 -0
  109. package/dist/processAudits-BJZT5gmy.cjs +92 -0
  110. package/dist/processAudits-BJZT5gmy.cjs.map +1 -0
  111. package/dist/processAudits-CwyaaSQc.mjs +80 -0
  112. package/dist/processAudits-CwyaaSQc.mjs.map +1 -0
  113. package/dist/publisher-BZgcrVPy.cjs +53 -0
  114. package/dist/publisher-BZgcrVPy.cjs.map +1 -0
  115. package/dist/publisher-CnpeMv-r.mjs +41 -0
  116. package/dist/publisher-CnpeMv-r.mjs.map +1 -0
  117. package/dist/queue/index.cjs +114 -6
  118. package/dist/queue/index.cjs.map +1 -0
  119. package/dist/queue/index.d.cts +45 -3
  120. package/dist/queue/index.d.cts.map +1 -0
  121. package/dist/queue/index.d.mts +44 -3
  122. package/dist/queue/index.d.mts.map +1 -0
  123. package/dist/queue/index.mjs +112 -3
  124. package/dist/queue/index.mjs.map +1 -0
  125. package/dist/subscribers/index.cjs +80 -111
  126. package/dist/subscribers/index.cjs.map +1 -1
  127. package/dist/subscribers/index.d.cts +43 -46
  128. package/dist/subscribers/index.d.cts.map +1 -1
  129. package/dist/subscribers/index.d.mts +42 -46
  130. package/dist/subscribers/index.d.mts.map +1 -1
  131. package/dist/subscribers/index.mjs +78 -108
  132. package/dist/subscribers/index.mjs.map +1 -1
  133. package/dist/{lambdaTelemetry-8vnmVZQ5.d.cts → telemetry-C--EgYVr.d.mts} +7 -4
  134. package/dist/telemetry-C--EgYVr.d.mts.map +1 -0
  135. package/dist/{lambdaTelemetry-8vnmVZQ5.d.mts → telemetry-Dqx-D3F7.d.cts} +7 -4
  136. package/dist/telemetry-Dqx-D3F7.d.cts.map +1 -0
  137. package/dist/topic/index.cjs +91 -3
  138. package/dist/topic/index.cjs.map +1 -0
  139. package/dist/topic/index.d.cts +32 -2
  140. package/dist/topic/index.d.cts.map +1 -0
  141. package/dist/topic/index.d.mts +32 -2
  142. package/dist/topic/index.d.mts.map +1 -0
  143. package/dist/topic/index.mjs +89 -2
  144. package/dist/topic/index.mjs.map +1 -0
  145. package/dist/{types-DMuSQeLL.d.cts → types-BdAaYDvd.d.cts} +5 -3
  146. package/dist/types-BdAaYDvd.d.cts.map +1 -0
  147. package/dist/{types-DMuSQeLL.d.mts → types-DNngH0fX.d.mts} +5 -3
  148. package/dist/types-DNngH0fX.d.mts.map +1 -0
  149. package/dist/types.d.cts +1 -1
  150. package/dist/types.d.mts +1 -1
  151. package/dist/types.mjs +0 -1
  152. package/package.json +55 -223
  153. package/src/Construct.ts +209 -0
  154. package/src/__benchmarks__/build-time-optimization.bench.ts +274 -0
  155. package/src/__benchmarks__/endpoint.bench.ts +494 -0
  156. package/src/__benchmarks__/fixtures.ts +241 -0
  157. package/src/__benchmarks__/hono-adaptor.bench.ts +533 -0
  158. package/src/__benchmarks__/hono-server.bench.ts +249 -0
  159. package/src/__benchmarks__/response-builder.bench.ts +428 -0
  160. package/src/__benchmarks__/strategies/strategy-a-lazy-services.ts +319 -0
  161. package/src/__benchmarks__/strategies/strategy-c-middleware.ts +530 -0
  162. package/src/__benchmarks__/strategies/strategy-d-opt-in-events.ts +567 -0
  163. package/src/__tests__/Construct.environment.spec.ts +704 -0
  164. package/src/__tests__/builder-reuse.spec.ts +587 -0
  165. package/src/__tests__/monitor.spec.ts +636 -0
  166. package/src/__tests__/publisher.setting.spec.ts +508 -0
  167. package/src/__tests__/publisher.spec.ts +452 -0
  168. package/src/adaptors/aws.ts +6 -0
  169. package/src/adaptors/hono.ts +1 -0
  170. package/src/adaptors/testing.ts +11 -0
  171. package/src/clone.ts +38 -0
  172. package/src/crons/AWSScheduledFunction.ts +73 -0
  173. package/src/crons/Cron.ts +149 -0
  174. package/src/crons/CronBuilder.ts +261 -0
  175. package/src/crons/__tests__/AWSScheduledFunction.spec.ts +152 -0
  176. package/src/crons/__tests__/Cron.spec.ts +472 -0
  177. package/src/crons/__tests__/CronBuilder.state-isolation.spec.ts +273 -0
  178. package/src/crons/index.ts +12 -0
  179. package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +698 -0
  180. package/src/endpoints/AmazonApiGatewayV1EndpointAdaptor.ts +105 -0
  181. package/src/endpoints/AmazonApiGatewayV2EndpointAdaptor.ts +97 -0
  182. package/src/endpoints/Authorizer.ts +152 -0
  183. package/src/endpoints/Endpoint.ts +1287 -0
  184. package/src/endpoints/EndpointBuilder.ts +749 -0
  185. package/src/endpoints/EndpointFactory.ts +1179 -0
  186. package/src/endpoints/HonoEndpointAdaptor.ts +692 -0
  187. package/src/endpoints/MswEndpointAdaptor.ts +226 -0
  188. package/src/endpoints/TestEndpointAdaptor.ts +466 -0
  189. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.audits.spec.ts +499 -0
  190. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.events.spec.ts +560 -0
  191. package/src/endpoints/__tests__/AmazonApiGatewayV1EndpointAdaptor.spec.ts +1304 -0
  192. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.audits.spec.ts +626 -0
  193. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.events.spec.ts +732 -0
  194. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.factory-publisher.spec.ts +296 -0
  195. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.kysely-audit.integration.spec.ts +951 -0
  196. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.responseType.spec.ts +111 -0
  197. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.rls.spec.ts +307 -0
  198. package/src/endpoints/__tests__/AmazonApiGatewayV2EndpointAdaptor.spec.ts +629 -0
  199. package/src/endpoints/__tests__/Authorizer.spec.ts +286 -0
  200. package/src/endpoints/__tests__/Endpoint.cookies.spec.ts +207 -0
  201. package/src/endpoints/__tests__/Endpoint.headers.spec.ts +187 -0
  202. package/src/endpoints/__tests__/Endpoint.manifest.spec.ts +175 -0
  203. package/src/endpoints/__tests__/Endpoint.spec.ts +857 -0
  204. package/src/endpoints/__tests__/EndpointBuilder.audit.spec.ts +451 -0
  205. package/src/endpoints/__tests__/EndpointBuilder.responseType.spec.ts +50 -0
  206. package/src/endpoints/__tests__/EndpointBuilder.spec.ts +531 -0
  207. package/src/endpoints/__tests__/EndpointFactory.authorizers.spec.ts +492 -0
  208. package/src/endpoints/__tests__/EndpointFactory.database-auditor.spec.ts +509 -0
  209. package/src/endpoints/__tests__/EndpointFactory.reference-audit.spec.ts +190 -0
  210. package/src/endpoints/__tests__/EndpointFactory.spec.ts +479 -0
  211. package/src/endpoints/__tests__/EndpointFactory.state-isolation.spec.ts +155 -0
  212. package/src/endpoints/__tests__/HonoEndpointAdaptor.audit-transactions.spec.ts +703 -0
  213. package/src/endpoints/__tests__/HonoEndpointAdaptor.audits.spec.ts +632 -0
  214. package/src/endpoints/__tests__/HonoEndpointAdaptor.events.spec.ts +577 -0
  215. package/src/endpoints/__tests__/HonoEndpointAdaptor.kysely-audit.integration.spec.ts +1067 -0
  216. package/src/endpoints/__tests__/HonoEndpointAdaptor.openapi.spec.ts +317 -0
  217. package/src/endpoints/__tests__/HonoEndpointAdaptor.pgboss-publisher.spec.ts +289 -0
  218. package/src/endpoints/__tests__/HonoEndpointAdaptor.responseType.spec.ts +128 -0
  219. package/src/endpoints/__tests__/HonoEndpointAdaptor.spec.ts +1207 -0
  220. package/src/endpoints/__tests__/MswEndpointAdaptor.spec.ts +211 -0
  221. package/src/endpoints/__tests__/ResponseBuilder.spec.ts +235 -0
  222. package/src/endpoints/__tests__/TestEndpointAdaptor.audits.spec.ts +602 -0
  223. package/src/endpoints/__tests__/TestEndpointAdaptor.spec.ts +1044 -0
  224. package/src/endpoints/__tests__/__snapshots__/HonoEndpointAdaptor.spec.ts.snap +54 -0
  225. package/src/endpoints/__tests__/endpoint-types.test.ts +88 -0
  226. package/src/endpoints/__tests__/helpers.spec.ts +37 -0
  227. package/src/endpoints/__tests__/lazyAccessors.spec.ts +330 -0
  228. package/src/endpoints/__tests__/processAudits.spec.ts +631 -0
  229. package/src/endpoints/audit.ts +87 -0
  230. package/src/endpoints/helpers.ts +98 -0
  231. package/src/endpoints/index.ts +42 -0
  232. package/src/endpoints/lazyAccessors.ts +241 -0
  233. package/src/endpoints/parseHonoQuery.ts +16 -0
  234. package/src/endpoints/parseQueryParams.ts +32 -0
  235. package/src/endpoints/processAudits.ts +371 -0
  236. package/src/endpoints/rls.ts +67 -0
  237. package/src/functions/AWSLambdaFunction.ts +374 -0
  238. package/src/functions/BaseFunctionBuilder.ts +212 -0
  239. package/src/functions/Function.ts +238 -0
  240. package/src/functions/FunctionBuilder.ts +381 -0
  241. package/src/functions/FunctionExecutionWrapper.ts +216 -0
  242. package/src/functions/TestFunctionAdaptor.ts +252 -0
  243. package/src/functions/__tests__/AWSLambdaFunctionAdaptor.spec.ts +513 -0
  244. package/src/functions/__tests__/Function.audits.spec.ts +393 -0
  245. package/src/functions/__tests__/Function.spec.ts +477 -0
  246. package/src/functions/__tests__/FunctionBuilder.state-isolation.spec.ts +250 -0
  247. package/src/functions/__tests__/TestFunctionAdaptor.spec.ts +480 -0
  248. package/src/functions/index.ts +12 -0
  249. package/src/index.ts +29 -0
  250. package/src/monitor.ts +145 -0
  251. package/src/monitors/heartbeat.ts +86 -0
  252. package/src/monitors/index.ts +6 -0
  253. package/src/publisher.ts +93 -0
  254. package/src/queue/AWSLambdaQueueAdaptor.ts +162 -0
  255. package/src/queue/Queue.ts +128 -0
  256. package/src/queue/QueueBuilder.ts +115 -0
  257. package/src/queue/TestQueueAdaptor.ts +63 -0
  258. package/src/queue/__tests__/QueueBuilder.spec.ts +137 -0
  259. package/src/queue/index.ts +12 -0
  260. package/src/subscribers/AWSLambdaSubscriberAdaptor.ts +342 -0
  261. package/src/subscribers/Subscriber.ts +117 -0
  262. package/src/subscribers/SubscriberBuilder.ts +183 -0
  263. package/src/subscribers/TestSubscriberAdaptor.ts +133 -0
  264. package/src/subscribers/__tests__/AWSLambdaSubscriberAdaptor.spec.ts +1018 -0
  265. package/src/subscribers/__tests__/Subscriber.spec.ts +430 -0
  266. package/src/subscribers/__tests__/TestSubscriberAdaptor.spec.ts +652 -0
  267. package/src/subscribers/index.ts +6 -0
  268. package/src/telemetry.ts +103 -0
  269. package/src/topic/Topic.ts +103 -0
  270. package/src/topic/TopicBuilder.ts +53 -0
  271. package/src/topic/__tests__/TopicBuilder.spec.ts +82 -0
  272. package/src/topic/index.ts +11 -0
  273. package/src/types.ts +13 -0
  274. package/test.ts +91 -0
  275. package/tsconfig.json +9 -0
  276. package/tsdown.config.ts +35 -0
  277. package/dist/Construct-B1vGBPme.mjs.map +0 -1
  278. package/dist/Construct-BQALFCh2.d.cts +0 -230
  279. package/dist/Construct-BQALFCh2.d.cts.map +0 -1
  280. package/dist/Construct-DUSXuTHP.cjs.map +0 -1
  281. package/dist/Construct-QXnl3VqT.d.mts +0 -230
  282. package/dist/Construct-QXnl3VqT.d.mts.map +0 -1
  283. package/dist/Cron-DI3nKoic.d.cts +0 -45
  284. package/dist/Cron-DI3nKoic.d.cts.map +0 -1
  285. package/dist/Cron-uYAHPnp7.d.mts +0 -45
  286. package/dist/Cron-uYAHPnp7.d.mts.map +0 -1
  287. package/dist/CronBuilder-C0Ek1-RA.cjs +0 -121
  288. package/dist/CronBuilder-C0Ek1-RA.cjs.map +0 -1
  289. package/dist/CronBuilder-DaSUm2Na.d.mts +0 -47
  290. package/dist/CronBuilder-DaSUm2Na.d.mts.map +0 -1
  291. package/dist/CronBuilder-Dmix_Pen.mjs +0 -109
  292. package/dist/CronBuilder-Dmix_Pen.mjs.map +0 -1
  293. package/dist/CronBuilder-g1lZLWyG.d.cts +0 -47
  294. package/dist/CronBuilder-g1lZLWyG.d.cts.map +0 -1
  295. package/dist/Endpoint-BG4UJ9oA.mjs.map +0 -1
  296. package/dist/Endpoint-BoUg8ocM.cjs.map +0 -1
  297. package/dist/Endpoint-Du-NwPX2.d.mts.map +0 -1
  298. package/dist/Endpoint-aCvBMPoH.d.cts.map +0 -1
  299. package/dist/EndpointFactory-BDtsrEvJ.mjs +0 -791
  300. package/dist/EndpointFactory-BDtsrEvJ.mjs.map +0 -1
  301. package/dist/EndpointFactory-DJ7gXLpR.cjs +0 -833
  302. package/dist/EndpointFactory-DJ7gXLpR.cjs.map +0 -1
  303. package/dist/EndpointFactory-DMYdJCOj.d.mts +0 -363
  304. package/dist/EndpointFactory-DMYdJCOj.d.mts.map +0 -1
  305. package/dist/EndpointFactory-I7s1co3Y.d.cts +0 -363
  306. package/dist/EndpointFactory-I7s1co3Y.d.cts.map +0 -1
  307. package/dist/Function-DuqGcbOI.d.mts +0 -76
  308. package/dist/Function-DuqGcbOI.d.mts.map +0 -1
  309. package/dist/Function-Pu-1kKZz.d.cts +0 -76
  310. package/dist/Function-Pu-1kKZz.d.cts.map +0 -1
  311. package/dist/HonoEndpointAdaptor-PtPlbeKY.mjs.map +0 -1
  312. package/dist/HonoEndpointAdaptor-zVzVLJEO.cjs.map +0 -1
  313. package/dist/Queue-A3wfD0it.cjs +0 -109
  314. package/dist/Queue-A3wfD0it.cjs.map +0 -1
  315. package/dist/Queue-D6USGS4q.mjs +0 -104
  316. package/dist/Queue-D6USGS4q.mjs.map +0 -1
  317. package/dist/Queue-DlsHRzUp.d.mts +0 -105
  318. package/dist/Queue-DlsHRzUp.d.mts.map +0 -1
  319. package/dist/Queue-HPyi0e1i.d.cts +0 -105
  320. package/dist/Queue-HPyi0e1i.d.cts.map +0 -1
  321. package/dist/QueueBuilder-BjuF0UBl.cjs +0 -135
  322. package/dist/QueueBuilder-BjuF0UBl.cjs.map +0 -1
  323. package/dist/QueueBuilder-Cue73M4t.mjs +0 -118
  324. package/dist/QueueBuilder-Cue73M4t.mjs.map +0 -1
  325. package/dist/QueueBuilder-OSi6LkV9.d.cts +0 -75
  326. package/dist/QueueBuilder-OSi6LkV9.d.cts.map +0 -1
  327. package/dist/QueueBuilder-QHsnVt1P.d.mts +0 -75
  328. package/dist/QueueBuilder-QHsnVt1P.d.mts.map +0 -1
  329. package/dist/Subscriber-Bpp02cGr.d.cts +0 -61
  330. package/dist/Subscriber-Bpp02cGr.d.cts.map +0 -1
  331. package/dist/Subscriber-CtN9R48-.d.mts +0 -61
  332. package/dist/Subscriber-CtN9R48-.d.mts.map +0 -1
  333. package/dist/SubscriberBuilder-CDy4nHCz.mjs +0 -134
  334. package/dist/SubscriberBuilder-CDy4nHCz.mjs.map +0 -1
  335. package/dist/SubscriberBuilder-CuCMFpYW.d.mts +0 -67
  336. package/dist/SubscriberBuilder-CuCMFpYW.d.mts.map +0 -1
  337. package/dist/SubscriberBuilder-D_owVoHo.cjs +0 -145
  338. package/dist/SubscriberBuilder-D_owVoHo.cjs.map +0 -1
  339. package/dist/SubscriberBuilder-g3fAVWgs.d.cts +0 -67
  340. package/dist/SubscriberBuilder-g3fAVWgs.d.cts.map +0 -1
  341. package/dist/Topic-D74b5cgs.mjs +0 -99
  342. package/dist/Topic-D74b5cgs.mjs.map +0 -1
  343. package/dist/Topic-GHxcU8AG.cjs +0 -104
  344. package/dist/Topic-GHxcU8AG.cjs.map +0 -1
  345. package/dist/auth-BMCJN30Y.d.cts +0 -268
  346. package/dist/auth-BMCJN30Y.d.cts.map +0 -1
  347. package/dist/auth-CcuceLYo.d.mts +0 -268
  348. package/dist/auth-CcuceLYo.d.mts.map +0 -1
  349. package/dist/auth.cjs +0 -433
  350. package/dist/auth.cjs.map +0 -1
  351. package/dist/auth.d.cts +0 -2
  352. package/dist/auth.d.mts +0 -2
  353. package/dist/auth.mjs +0 -426
  354. package/dist/auth.mjs.map +0 -1
  355. package/dist/cache-CXh6GIgb.d.mts +0 -44
  356. package/dist/cache-CXh6GIgb.d.mts.map +0 -1
  357. package/dist/cache-DnGDGly3.d.cts +0 -44
  358. package/dist/cache-DnGDGly3.d.cts.map +0 -1
  359. package/dist/cache.cjs +0 -69
  360. package/dist/cache.cjs.map +0 -1
  361. package/dist/cache.d.cts +0 -2
  362. package/dist/cache.d.mts +0 -2
  363. package/dist/cache.mjs +0 -68
  364. package/dist/cache.mjs.map +0 -1
  365. package/dist/cipher-C1lEFX63.mjs +0 -225
  366. package/dist/cipher-C1lEFX63.mjs.map +0 -1
  367. package/dist/cipher-CVxfwLjk.cjs +0 -332
  368. package/dist/cipher-CVxfwLjk.cjs.map +0 -1
  369. package/dist/clone-EKNovYHu.mjs.map +0 -1
  370. package/dist/clone-UGJpvQnL.cjs.map +0 -1
  371. package/dist/construct-interface-B1AfqRl4.d.cts +0 -162
  372. package/dist/construct-interface-B1AfqRl4.d.cts.map +0 -1
  373. package/dist/construct-interface-DluK3_da.d.mts +0 -162
  374. package/dist/construct-interface-DluK3_da.d.mts.map +0 -1
  375. package/dist/construct-interface.cjs +0 -114
  376. package/dist/construct-interface.cjs.map +0 -1
  377. package/dist/construct-interface.d.cts +0 -2
  378. package/dist/construct-interface.d.mts +0 -2
  379. package/dist/construct-interface.mjs +0 -107
  380. package/dist/construct-interface.mjs.map +0 -1
  381. package/dist/credential.cjs +0 -156
  382. package/dist/credential.cjs.map +0 -1
  383. package/dist/credential.d.cts +0 -86
  384. package/dist/credential.d.cts.map +0 -1
  385. package/dist/credential.d.mts +0 -86
  386. package/dist/credential.d.mts.map +0 -1
  387. package/dist/credential.mjs +0 -152
  388. package/dist/credential.mjs.map +0 -1
  389. package/dist/database/kysely.cjs +0 -4
  390. package/dist/database/kysely.d.cts +0 -2
  391. package/dist/database/kysely.d.mts +0 -2
  392. package/dist/database/kysely.mjs +0 -2
  393. package/dist/email.cjs +0 -72
  394. package/dist/email.cjs.map +0 -1
  395. package/dist/email.d.cts +0 -46
  396. package/dist/email.d.cts.map +0 -1
  397. package/dist/email.d.mts +0 -46
  398. package/dist/email.d.mts.map +0 -1
  399. package/dist/email.mjs +0 -71
  400. package/dist/email.mjs.map +0 -1
  401. package/dist/encryption.cjs +0 -96
  402. package/dist/encryption.cjs.map +0 -1
  403. package/dist/encryption.d.cts +0 -117
  404. package/dist/encryption.d.cts.map +0 -1
  405. package/dist/encryption.d.mts +0 -117
  406. package/dist/encryption.d.mts.map +0 -1
  407. package/dist/encryption.mjs +0 -83
  408. package/dist/encryption.mjs.map +0 -1
  409. package/dist/external-api-MJ8id87V.d.mts +0 -105
  410. package/dist/external-api-MJ8id87V.d.mts.map +0 -1
  411. package/dist/external-api-O107yzZJ.d.cts +0 -105
  412. package/dist/external-api-O107yzZJ.d.cts.map +0 -1
  413. package/dist/external-api.cjs +0 -142
  414. package/dist/external-api.cjs.map +0 -1
  415. package/dist/external-api.d.cts +0 -2
  416. package/dist/external-api.d.mts +0 -2
  417. package/dist/external-api.mjs +0 -139
  418. package/dist/external-api.mjs.map +0 -1
  419. package/dist/file-server.cjs +0 -186
  420. package/dist/file-server.cjs.map +0 -1
  421. package/dist/file-server.d.cts +0 -152
  422. package/dist/file-server.d.cts.map +0 -1
  423. package/dist/file-server.d.mts +0 -152
  424. package/dist/file-server.d.mts.map +0 -1
  425. package/dist/file-server.mjs +0 -184
  426. package/dist/file-server.mjs.map +0 -1
  427. package/dist/functions-BFizikJU.mjs.map +0 -1
  428. package/dist/functions-CfzJG9hK.cjs.map +0 -1
  429. package/dist/index-BuzRvKOQ.d.cts +0 -115
  430. package/dist/index-BuzRvKOQ.d.cts.map +0 -1
  431. package/dist/index-CTkKOer4.d.mts +0 -115
  432. package/dist/index-CTkKOer4.d.mts.map +0 -1
  433. package/dist/index-CeEtxDmK.d.cts +0 -79
  434. package/dist/index-CeEtxDmK.d.cts.map +0 -1
  435. package/dist/index-CeEtxDmK.d.mts +0 -79
  436. package/dist/index-CeEtxDmK.d.mts.map +0 -1
  437. package/dist/index.d.cts.map +0 -1
  438. package/dist/index.d.mts.map +0 -1
  439. package/dist/kms-B-Hm3d5r.cjs +0 -85
  440. package/dist/kms-B-Hm3d5r.cjs.map +0 -1
  441. package/dist/kms-BdUlMJEZ.mjs +0 -85
  442. package/dist/kms-BdUlMJEZ.mjs.map +0 -1
  443. package/dist/kysely-Bii4l6eP.mjs +0 -370
  444. package/dist/kysely-Bii4l6eP.mjs.map +0 -1
  445. package/dist/kysely-CO_Dk43W.cjs +0 -383
  446. package/dist/kysely-CO_Dk43W.cjs.map +0 -1
  447. package/dist/kysely-D0bpzgPs.d.cts +0 -175
  448. package/dist/kysely-D0bpzgPs.d.cts.map +0 -1
  449. package/dist/kysely-DUqC3Ie0.d.mts +0 -175
  450. package/dist/kysely-DUqC3Ie0.d.mts.map +0 -1
  451. package/dist/lambdaTelemetry-8vnmVZQ5.d.cts.map +0 -1
  452. package/dist/lambdaTelemetry-8vnmVZQ5.d.mts.map +0 -1
  453. package/dist/lazyAccessors-CFanua0O.mjs +0 -174
  454. package/dist/lazyAccessors-CFanua0O.mjs.map +0 -1
  455. package/dist/lazyAccessors-hJKGv8Ay.cjs +0 -221
  456. package/dist/lazyAccessors-hJKGv8Ay.cjs.map +0 -1
  457. package/dist/mobile-app.cjs +0 -73
  458. package/dist/mobile-app.cjs.map +0 -1
  459. package/dist/mobile-app.d.cts +0 -61
  460. package/dist/mobile-app.d.cts.map +0 -1
  461. package/dist/mobile-app.d.mts +0 -61
  462. package/dist/mobile-app.d.mts.map +0 -1
  463. package/dist/mobile-app.mjs +0 -72
  464. package/dist/mobile-app.mjs.map +0 -1
  465. package/dist/object-storage.cjs +0 -56
  466. package/dist/object-storage.cjs.map +0 -1
  467. package/dist/object-storage.d.cts +0 -32
  468. package/dist/object-storage.d.cts.map +0 -1
  469. package/dist/object-storage.d.mts +0 -32
  470. package/dist/object-storage.d.mts.map +0 -1
  471. package/dist/object-storage.mjs +0 -55
  472. package/dist/object-storage.mjs.map +0 -1
  473. package/dist/processAudits-BRRVVHUB.mjs +0 -131
  474. package/dist/processAudits-BRRVVHUB.mjs.map +0 -1
  475. package/dist/processAudits-DasOZjPl.cjs +0 -154
  476. package/dist/processAudits-DasOZjPl.cjs.map +0 -1
  477. package/dist/rest-api.cjs +0 -216
  478. package/dist/rest-api.cjs.map +0 -1
  479. package/dist/rest-api.d.cts +0 -241
  480. package/dist/rest-api.d.cts.map +0 -1
  481. package/dist/rest-api.d.mts +0 -241
  482. package/dist/rest-api.d.mts.map +0 -1
  483. package/dist/rest-api.mjs +0 -215
  484. package/dist/rest-api.mjs.map +0 -1
  485. package/dist/rolldown-runtime-y5ARvAq5.cjs +0 -35
  486. package/dist/runSubscriber-BHvJ8POr.mjs +0 -109
  487. package/dist/runSubscriber-BHvJ8POr.mjs.map +0 -1
  488. package/dist/runSubscriber-D8nLXIv1.cjs +0 -126
  489. package/dist/runSubscriber-D8nLXIv1.cjs.map +0 -1
  490. package/dist/shutdown-BMJmAhSt.cjs +0 -38
  491. package/dist/shutdown-BMJmAhSt.cjs.map +0 -1
  492. package/dist/shutdown-C7xa8x9S.mjs +0 -27
  493. package/dist/shutdown-C7xa8x9S.mjs.map +0 -1
  494. package/dist/site.cjs +0 -74
  495. package/dist/site.cjs.map +0 -1
  496. package/dist/site.d.cts +0 -104
  497. package/dist/site.d.cts.map +0 -1
  498. package/dist/site.d.mts +0 -104
  499. package/dist/site.d.mts.map +0 -1
  500. package/dist/site.mjs +0 -73
  501. package/dist/site.mjs.map +0 -1
  502. package/dist/stages-BSCF19o2.d.cts +0 -56
  503. package/dist/stages-BSCF19o2.d.cts.map +0 -1
  504. package/dist/stages-BSCF19o2.d.mts +0 -56
  505. package/dist/stages-BSCF19o2.d.mts.map +0 -1
  506. package/dist/surfaceEnv-CNimK76p.cjs +0 -56
  507. package/dist/surfaceEnv-CNimK76p.cjs.map +0 -1
  508. package/dist/surfaceEnv-wMT5QzgZ.mjs +0 -45
  509. package/dist/surfaceEnv-wMT5QzgZ.mjs.map +0 -1
  510. package/dist/telemetry-B48RLjyk.d.cts +0 -40
  511. package/dist/telemetry-B48RLjyk.d.cts.map +0 -1
  512. package/dist/telemetry-DRtT1_0A.d.mts +0 -40
  513. package/dist/telemetry-DRtT1_0A.d.mts.map +0 -1
  514. package/dist/telemetry.cjs +0 -56
  515. package/dist/telemetry.cjs.map +0 -1
  516. package/dist/telemetry.d.cts +0 -2
  517. package/dist/telemetry.d.mts +0 -2
  518. package/dist/telemetry.mjs +0 -55
  519. package/dist/telemetry.mjs.map +0 -1
  520. package/dist/tracing-CxaZ98IB.mjs +0 -110
  521. package/dist/tracing-CxaZ98IB.mjs.map +0 -1
  522. package/dist/tracing-DPMidF_r.cjs +0 -127
  523. package/dist/tracing-DPMidF_r.cjs.map +0 -1
  524. package/dist/types-DMuSQeLL.d.cts.map +0 -1
  525. package/dist/types-DMuSQeLL.d.mts.map +0 -1
  526. package/dist/worker.cjs +0 -191
  527. package/dist/worker.cjs.map +0 -1
  528. package/dist/worker.d.cts +0 -171
  529. package/dist/worker.d.cts.map +0 -1
  530. package/dist/worker.d.mts +0 -171
  531. package/dist/worker.d.mts.map +0 -1
  532. package/dist/worker.mjs +0 -190
  533. package/dist/worker.mjs.map +0 -1
@@ -1,11 +1,87 @@
1
- import { a as __commonJSMin, o as __toESM, t as Construct } from "./Construct-B1vGBPme.mjs";
2
- import { databaseEdges, idsOf, serviceOf, servicesOf } from "./construct-interface.mjs";
3
- import { t as cloneWith } from "./clone-EKNovYHu.mjs";
4
- import { parseSchema } from "@geekmidas/schema/parser";
5
- import { DEFAULT_LOGGER } from "@geekmidas/logger/console";
1
+ import { Construct, ConstructType, __commonJS, __toESM } from "./Construct-BWF5HxaM.mjs";
2
+ import { cloneWith } from "./clone-pdXxc0t3.mjs";
6
3
  import { UnprocessableEntityError } from "@geekmidas/errors";
4
+ import { ConsoleLogger } from "@geekmidas/logger/console";
5
+ import { parseSchema } from "@geekmidas/schema/parser";
6
+
7
+ //#region src/monitor.ts
8
+ /**
9
+ * Add a monitor to a construct's list, refusing one that is already there.
10
+ *
11
+ * Services are cached by name, so two monitors with one name would silently
12
+ * share an instance: two heartbeats reading `HEARTBEAT_URL` would both ping
13
+ * whichever was registered first, and the other provider would never hear
14
+ * from the construct.
15
+ */
16
+ function addMonitor(monitors, monitor) {
17
+ if (monitors.some((m) => m.serviceName === monitor.serviceName)) throw new Error(`Monitor "${monitor.serviceName}" is already set on this construct. Two heartbeats reading the same env var would share one URL; give one its own, e.g. heartbeat.healthchecks('HEALTHCHECKS_HEARTBEAT_URL').`);
18
+ return [...monitors, monitor];
19
+ }
20
+ const NOOP_RUN = {
21
+ async success() {},
22
+ async failure() {},
23
+ async settle() {}
24
+ };
25
+ /**
26
+ * Start a construct's monitors for one run.
27
+ *
28
+ * Never throws: a monitor that fails to register, start or report is logged,
29
+ * and the run goes on without it.
30
+ */
31
+ async function startMonitors(construct, serviceDiscovery, logger) {
32
+ if (!construct.monitors.length) return NOOP_RUN;
33
+ const ctx = {
34
+ type: construct.type,
35
+ logger
36
+ };
37
+ let started;
38
+ try {
39
+ const registered = await serviceDiscovery.register([...construct.monitors]);
40
+ started = await Promise.all(construct.monitors.map(async ({ serviceName }) => {
41
+ const monitor = registered[serviceName];
42
+ let run$1;
43
+ try {
44
+ run$1 = await monitor.start?.(ctx);
45
+ } catch (error) {
46
+ logger.warn({
47
+ error,
48
+ monitor: serviceName
49
+ }, "Monitor failed to start");
50
+ }
51
+ return {
52
+ monitor,
53
+ run: run$1
54
+ };
55
+ }));
56
+ } catch (error) {
57
+ logger.warn({ error }, "Monitors could not be registered");
58
+ return NOOP_RUN;
59
+ }
60
+ const report = async (call) => {
61
+ const results = await Promise.allSettled(started.map(({ monitor, run: run$1 }) => call(monitor, run$1)));
62
+ for (const result of results) if (result.status === "rejected") logger.warn({ error: result.reason }, "Monitor failed to report");
63
+ };
64
+ const run = {
65
+ success: (output, status) => report((monitor, r) => monitor.success({
66
+ ...ctx,
67
+ run: r,
68
+ output,
69
+ status
70
+ })),
71
+ failure: (error, status) => report((monitor, r) => monitor.failure({
72
+ ...ctx,
73
+ run: r,
74
+ error,
75
+ status
76
+ })),
77
+ settle: (status, error) => status >= 500 ? run.failure(error ?? new Error(`Responded with ${status}`), status) : run.success(void 0, status)
78
+ };
79
+ return run;
80
+ }
81
+
82
+ //#endregion
7
83
  //#region ../../node_modules/.pnpm/lodash.uniqby@4.7.0/node_modules/lodash.uniqby/index.js
8
- var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84
+ var require_lodash$1 = __commonJS({ "../../node_modules/.pnpm/lodash.uniqby@4.7.0/node_modules/lodash.uniqby/index.js"(exports, module) {
9
85
  /**
10
86
  * lodash (Custom Build) <https://lodash.com/>
11
87
  * Build: `lodash modularize exports="npm" -o ./`
@@ -17,75 +93,47 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
17
93
  /** Used as the size to enable large array optimizations. */
18
94
  var LARGE_ARRAY_SIZE = 200;
19
95
  /** Used as the `TypeError` message for "Functions" methods. */
20
- var FUNC_ERROR_TEXT = "Expected a function";
96
+ var FUNC_ERROR_TEXT$1 = "Expected a function";
21
97
  /** Used to stand-in for `undefined` hash values. */
22
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
98
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
23
99
  /** Used to compose bitmasks for comparison styles. */
24
- var UNORDERED_COMPARE_FLAG = 1;
25
- var PARTIAL_COMPARE_FLAG = 2;
100
+ var UNORDERED_COMPARE_FLAG = 1, PARTIAL_COMPARE_FLAG = 2;
26
101
  /** Used as references for various `Number` constants. */
27
- var INFINITY = 1 / 0;
28
- var MAX_SAFE_INTEGER = 9007199254740991;
102
+ var INFINITY$1 = Infinity, MAX_SAFE_INTEGER = 9007199254740991;
29
103
  /** `Object#toString` result references. */
30
- var argsTag = "[object Arguments]";
31
- var arrayTag = "[object Array]";
32
- var boolTag = "[object Boolean]";
33
- var dateTag = "[object Date]";
34
- var errorTag = "[object Error]";
35
- var funcTag = "[object Function]";
36
- var genTag = "[object GeneratorFunction]";
37
- var mapTag = "[object Map]";
38
- var numberTag = "[object Number]";
39
- var objectTag = "[object Object]";
40
- var promiseTag = "[object Promise]";
41
- var regexpTag = "[object RegExp]";
42
- var setTag = "[object Set]";
43
- var stringTag = "[object String]";
44
- var symbolTag = "[object Symbol]";
45
- var weakMapTag = "[object WeakMap]";
46
- var arrayBufferTag = "[object ArrayBuffer]";
47
- var dataViewTag = "[object DataView]";
48
- var float32Tag = "[object Float32Array]";
49
- var float64Tag = "[object Float64Array]";
50
- var int8Tag = "[object Int8Array]";
51
- var int16Tag = "[object Int16Array]";
52
- var int32Tag = "[object Int32Array]";
53
- var uint8Tag = "[object Uint8Array]";
54
- var uint8ClampedTag = "[object Uint8ClampedArray]";
55
- var uint16Tag = "[object Uint16Array]";
56
- var uint32Tag = "[object Uint32Array]";
104
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag$1 = "[object Function]", genTag$1 = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
105
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
57
106
  /** Used to match property names within property paths. */
58
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
59
- var reIsPlainProp = /^\w*$/;
60
- var reLeadingDot = /^\./;
61
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
107
+ var reIsDeepProp$1 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp$1 = /^\w*$/, reLeadingDot$1 = /^\./, rePropName$1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
62
108
  /**
63
109
  * Used to match `RegExp`
64
110
  * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
65
111
  */
66
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
112
+ var reRegExpChar$1 = /[\\^$.*+?()[\]{}|]/g;
67
113
  /** Used to match backslashes in property paths. */
68
- var reEscapeChar = /\\(\\)?/g;
114
+ var reEscapeChar$1 = /\\(\\)?/g;
69
115
  /** Used to detect host constructors (Safari). */
70
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
116
+ var reIsHostCtor$1 = /^\[object .+?Constructor\]$/;
71
117
  /** Used to detect unsigned integer values. */
72
118
  var reIsUint = /^(?:0|[1-9]\d*)$/;
73
119
  /** Used to identify `toStringTag` values of typed arrays. */
74
120
  var typedArrayTags = {};
75
121
  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
76
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
122
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
77
123
  /** Detect free variable `global` from Node.js. */
78
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
124
+ var freeGlobal$1 = typeof global == "object" && global && global.Object === Object && global;
79
125
  /** Detect free variable `self`. */
80
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
126
+ var freeSelf$1 = typeof self == "object" && self && self.Object === Object && self;
81
127
  /** Used as a reference to the global object. */
82
- var root = freeGlobal || freeSelf || Function("return this")();
128
+ var root$1 = freeGlobal$1 || freeSelf$1 || Function("return this")();
83
129
  /** Detect free variable `exports`. */
84
130
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
85
131
  /** Detect free variable `module`. */
86
132
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
133
+ /** Detect the popular CommonJS extension `module.exports`. */
134
+ var moduleExports = freeModule && freeModule.exports === freeExports;
87
135
  /** Detect free variable `process` from Node.js. */
88
- var freeProcess = freeModule && freeModule.exports === freeExports && freeGlobal.process;
136
+ var freeProcess = moduleExports && freeGlobal$1.process;
89
137
  /** Used to access faster Node.js helpers. */
90
138
  var nodeUtil = function() {
91
139
  try {
@@ -103,7 +151,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
103
151
  * @returns {boolean} Returns `true` if `target` is found, else `false`.
104
152
  */
105
153
  function arrayIncludes(array, value) {
106
- return !!(array ? array.length : 0) && baseIndexOf(array, value, 0) > -1;
154
+ var length = array ? array.length : 0;
155
+ return !!length && baseIndexOf(array, value, 0) > -1;
107
156
  }
108
157
  /**
109
158
  * This function is like `arrayIncludes` except that it accepts a comparator.
@@ -232,7 +281,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
232
281
  * @param {string} key The key of the property to get.
233
282
  * @returns {*} Returns the property value.
234
283
  */
235
- function getValue(object, key) {
284
+ function getValue$1(object, key) {
236
285
  return object == null ? void 0 : object[key];
237
286
  }
238
287
  /**
@@ -242,7 +291,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
242
291
  * @param {*} value The value to check.
243
292
  * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
244
293
  */
245
- function isHostObject(value) {
294
+ function isHostObject$1(value) {
246
295
  var result = false;
247
296
  if (value != null && typeof value.toString != "function") try {
248
297
  result = !!(value + "");
@@ -291,50 +340,34 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
291
340
  return result;
292
341
  }
293
342
  /** Used for built-in method references. */
294
- var arrayProto = Array.prototype;
295
- var funcProto = Function.prototype;
296
- var objectProto = Object.prototype;
343
+ var arrayProto$1 = Array.prototype, funcProto$1 = Function.prototype, objectProto$1 = Object.prototype;
297
344
  /** Used to detect overreaching core-js shims. */
298
- var coreJsData = root["__core-js_shared__"];
345
+ var coreJsData$1 = root$1["__core-js_shared__"];
299
346
  /** Used to detect methods masquerading as native. */
300
- var maskSrcKey = function() {
301
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
347
+ var maskSrcKey$1 = function() {
348
+ var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
302
349
  return uid ? "Symbol(src)_1." + uid : "";
303
350
  }();
304
351
  /** Used to resolve the decompiled source of functions. */
305
- var funcToString = funcProto.toString;
352
+ var funcToString$1 = funcProto$1.toString;
306
353
  /** Used to check objects for own properties. */
307
- var hasOwnProperty = objectProto.hasOwnProperty;
354
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
308
355
  /**
309
356
  * Used to resolve the
310
357
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
311
358
  * of values.
312
359
  */
313
- var objectToString = objectProto.toString;
360
+ var objectToString$1 = objectProto$1.toString;
314
361
  /** Used to detect if a method is native. */
315
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
362
+ var reIsNative$1 = RegExp("^" + funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar$1, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
316
363
  /** Built-in value references. */
317
- var Symbol = root.Symbol;
318
- var Uint8Array = root.Uint8Array;
319
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
320
- var splice = arrayProto.splice;
364
+ var Symbol$1 = root$1.Symbol, Uint8Array = root$1.Uint8Array, propertyIsEnumerable = objectProto$1.propertyIsEnumerable, splice$1 = arrayProto$1.splice;
321
365
  var nativeKeys = overArg(Object.keys, Object);
322
- var DataView = getNative(root, "DataView");
323
- var Map = getNative(root, "Map");
324
- var Promise = getNative(root, "Promise");
325
- var Set = getNative(root, "Set");
326
- var WeakMap = getNative(root, "WeakMap");
327
- var nativeCreate = getNative(Object, "create");
366
+ var DataView = getNative$1(root$1, "DataView"), Map$1 = getNative$1(root$1, "Map"), Promise$1 = getNative$1(root$1, "Promise"), Set = getNative$1(root$1, "Set"), WeakMap = getNative$1(root$1, "WeakMap"), nativeCreate$1 = getNative$1(Object, "create");
328
367
  /** Used to detect maps, sets, and weakmaps. */
329
- var dataViewCtorString = toSource(DataView);
330
- var mapCtorString = toSource(Map);
331
- var promiseCtorString = toSource(Promise);
332
- var setCtorString = toSource(Set);
333
- var weakMapCtorString = toSource(WeakMap);
368
+ var dataViewCtorString = toSource$1(DataView), mapCtorString = toSource$1(Map$1), promiseCtorString = toSource$1(Promise$1), setCtorString = toSource$1(Set), weakMapCtorString = toSource$1(WeakMap);
334
369
  /** Used to convert symbols to primitives and strings. */
335
- var symbolProto = Symbol ? Symbol.prototype : void 0;
336
- var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
337
- var symbolToString = symbolProto ? symbolProto.toString : void 0;
370
+ var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : void 0, symbolToString$1 = symbolProto$1 ? symbolProto$1.toString : void 0;
338
371
  /**
339
372
  * Creates a hash object.
340
373
  *
@@ -342,7 +375,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
342
375
  * @constructor
343
376
  * @param {Array} [entries] The key-value pairs to cache.
344
377
  */
345
- function Hash(entries) {
378
+ function Hash$1(entries) {
346
379
  var index = -1, length = entries ? entries.length : 0;
347
380
  this.clear();
348
381
  while (++index < length) {
@@ -357,8 +390,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
357
390
  * @name clear
358
391
  * @memberOf Hash
359
392
  */
360
- function hashClear() {
361
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
393
+ function hashClear$1() {
394
+ this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
362
395
  }
363
396
  /**
364
397
  * Removes `key` and its value from the hash.
@@ -370,7 +403,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
370
403
  * @param {string} key The key of the value to remove.
371
404
  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
372
405
  */
373
- function hashDelete(key) {
406
+ function hashDelete$1(key) {
374
407
  return this.has(key) && delete this.__data__[key];
375
408
  }
376
409
  /**
@@ -382,13 +415,13 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
382
415
  * @param {string} key The key of the value to get.
383
416
  * @returns {*} Returns the entry value.
384
417
  */
385
- function hashGet(key) {
418
+ function hashGet$1(key) {
386
419
  var data = this.__data__;
387
- if (nativeCreate) {
420
+ if (nativeCreate$1) {
388
421
  var result = data[key];
389
- return result === HASH_UNDEFINED ? void 0 : result;
422
+ return result === HASH_UNDEFINED$1 ? void 0 : result;
390
423
  }
391
- return hasOwnProperty.call(data, key) ? data[key] : void 0;
424
+ return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
392
425
  }
393
426
  /**
394
427
  * Checks if a hash value for `key` exists.
@@ -399,9 +432,9 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
399
432
  * @param {string} key The key of the entry to check.
400
433
  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
401
434
  */
402
- function hashHas(key) {
435
+ function hashHas$1(key) {
403
436
  var data = this.__data__;
404
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
437
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$1.call(data, key);
405
438
  }
406
439
  /**
407
440
  * Sets the hash `key` to `value`.
@@ -413,16 +446,16 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
413
446
  * @param {*} value The value to set.
414
447
  * @returns {Object} Returns the hash instance.
415
448
  */
416
- function hashSet(key, value) {
449
+ function hashSet$1(key, value) {
417
450
  var data = this.__data__;
418
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
451
+ data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
419
452
  return this;
420
453
  }
421
- Hash.prototype.clear = hashClear;
422
- Hash.prototype["delete"] = hashDelete;
423
- Hash.prototype.get = hashGet;
424
- Hash.prototype.has = hashHas;
425
- Hash.prototype.set = hashSet;
454
+ Hash$1.prototype.clear = hashClear$1;
455
+ Hash$1.prototype["delete"] = hashDelete$1;
456
+ Hash$1.prototype.get = hashGet$1;
457
+ Hash$1.prototype.has = hashHas$1;
458
+ Hash$1.prototype.set = hashSet$1;
426
459
  /**
427
460
  * Creates an list cache object.
428
461
  *
@@ -430,7 +463,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
430
463
  * @constructor
431
464
  * @param {Array} [entries] The key-value pairs to cache.
432
465
  */
433
- function ListCache(entries) {
466
+ function ListCache$1(entries) {
434
467
  var index = -1, length = entries ? entries.length : 0;
435
468
  this.clear();
436
469
  while (++index < length) {
@@ -445,7 +478,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
445
478
  * @name clear
446
479
  * @memberOf ListCache
447
480
  */
448
- function listCacheClear() {
481
+ function listCacheClear$1() {
449
482
  this.__data__ = [];
450
483
  }
451
484
  /**
@@ -457,11 +490,12 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
457
490
  * @param {string} key The key of the value to remove.
458
491
  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
459
492
  */
460
- function listCacheDelete(key) {
461
- var data = this.__data__, index = assocIndexOf(data, key);
493
+ function listCacheDelete$1(key) {
494
+ var data = this.__data__, index = assocIndexOf$1(data, key);
462
495
  if (index < 0) return false;
463
- if (index == data.length - 1) data.pop();
464
- else splice.call(data, index, 1);
496
+ var lastIndex = data.length - 1;
497
+ if (index == lastIndex) data.pop();
498
+ else splice$1.call(data, index, 1);
465
499
  return true;
466
500
  }
467
501
  /**
@@ -473,8 +507,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
473
507
  * @param {string} key The key of the value to get.
474
508
  * @returns {*} Returns the entry value.
475
509
  */
476
- function listCacheGet(key) {
477
- var data = this.__data__, index = assocIndexOf(data, key);
510
+ function listCacheGet$1(key) {
511
+ var data = this.__data__, index = assocIndexOf$1(data, key);
478
512
  return index < 0 ? void 0 : data[index][1];
479
513
  }
480
514
  /**
@@ -486,8 +520,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
486
520
  * @param {string} key The key of the entry to check.
487
521
  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
488
522
  */
489
- function listCacheHas(key) {
490
- return assocIndexOf(this.__data__, key) > -1;
523
+ function listCacheHas$1(key) {
524
+ return assocIndexOf$1(this.__data__, key) > -1;
491
525
  }
492
526
  /**
493
527
  * Sets the list cache `key` to `value`.
@@ -499,17 +533,17 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
499
533
  * @param {*} value The value to set.
500
534
  * @returns {Object} Returns the list cache instance.
501
535
  */
502
- function listCacheSet(key, value) {
503
- var data = this.__data__, index = assocIndexOf(data, key);
536
+ function listCacheSet$1(key, value) {
537
+ var data = this.__data__, index = assocIndexOf$1(data, key);
504
538
  if (index < 0) data.push([key, value]);
505
539
  else data[index][1] = value;
506
540
  return this;
507
541
  }
508
- ListCache.prototype.clear = listCacheClear;
509
- ListCache.prototype["delete"] = listCacheDelete;
510
- ListCache.prototype.get = listCacheGet;
511
- ListCache.prototype.has = listCacheHas;
512
- ListCache.prototype.set = listCacheSet;
542
+ ListCache$1.prototype.clear = listCacheClear$1;
543
+ ListCache$1.prototype["delete"] = listCacheDelete$1;
544
+ ListCache$1.prototype.get = listCacheGet$1;
545
+ ListCache$1.prototype.has = listCacheHas$1;
546
+ ListCache$1.prototype.set = listCacheSet$1;
513
547
  /**
514
548
  * Creates a map cache object to store key-value pairs.
515
549
  *
@@ -517,7 +551,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
517
551
  * @constructor
518
552
  * @param {Array} [entries] The key-value pairs to cache.
519
553
  */
520
- function MapCache(entries) {
554
+ function MapCache$1(entries) {
521
555
  var index = -1, length = entries ? entries.length : 0;
522
556
  this.clear();
523
557
  while (++index < length) {
@@ -532,11 +566,11 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
532
566
  * @name clear
533
567
  * @memberOf MapCache
534
568
  */
535
- function mapCacheClear() {
569
+ function mapCacheClear$1() {
536
570
  this.__data__ = {
537
- "hash": new Hash(),
538
- "map": new (Map || ListCache)(),
539
- "string": new Hash()
571
+ "hash": new Hash$1(),
572
+ "map": new (Map$1 || ListCache$1)(),
573
+ "string": new Hash$1()
540
574
  };
541
575
  }
542
576
  /**
@@ -548,8 +582,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
548
582
  * @param {string} key The key of the value to remove.
549
583
  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
550
584
  */
551
- function mapCacheDelete(key) {
552
- return getMapData(this, key)["delete"](key);
585
+ function mapCacheDelete$1(key) {
586
+ return getMapData$1(this, key)["delete"](key);
553
587
  }
554
588
  /**
555
589
  * Gets the map value for `key`.
@@ -560,8 +594,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
560
594
  * @param {string} key The key of the value to get.
561
595
  * @returns {*} Returns the entry value.
562
596
  */
563
- function mapCacheGet(key) {
564
- return getMapData(this, key).get(key);
597
+ function mapCacheGet$1(key) {
598
+ return getMapData$1(this, key).get(key);
565
599
  }
566
600
  /**
567
601
  * Checks if a map value for `key` exists.
@@ -572,8 +606,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
572
606
  * @param {string} key The key of the entry to check.
573
607
  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
574
608
  */
575
- function mapCacheHas(key) {
576
- return getMapData(this, key).has(key);
609
+ function mapCacheHas$1(key) {
610
+ return getMapData$1(this, key).has(key);
577
611
  }
578
612
  /**
579
613
  * Sets the map `key` to `value`.
@@ -585,15 +619,15 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
585
619
  * @param {*} value The value to set.
586
620
  * @returns {Object} Returns the map cache instance.
587
621
  */
588
- function mapCacheSet(key, value) {
589
- getMapData(this, key).set(key, value);
622
+ function mapCacheSet$1(key, value) {
623
+ getMapData$1(this, key).set(key, value);
590
624
  return this;
591
625
  }
592
- MapCache.prototype.clear = mapCacheClear;
593
- MapCache.prototype["delete"] = mapCacheDelete;
594
- MapCache.prototype.get = mapCacheGet;
595
- MapCache.prototype.has = mapCacheHas;
596
- MapCache.prototype.set = mapCacheSet;
626
+ MapCache$1.prototype.clear = mapCacheClear$1;
627
+ MapCache$1.prototype["delete"] = mapCacheDelete$1;
628
+ MapCache$1.prototype.get = mapCacheGet$1;
629
+ MapCache$1.prototype.has = mapCacheHas$1;
630
+ MapCache$1.prototype.set = mapCacheSet$1;
597
631
  /**
598
632
  *
599
633
  * Creates an array cache object to store unique values.
@@ -604,7 +638,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
604
638
  */
605
639
  function SetCache(values) {
606
640
  var index = -1, length = values ? values.length : 0;
607
- this.__data__ = new MapCache();
641
+ this.__data__ = new MapCache$1();
608
642
  while (++index < length) this.add(values[index]);
609
643
  }
610
644
  /**
@@ -618,7 +652,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
618
652
  * @returns {Object} Returns the cache instance.
619
653
  */
620
654
  function setCacheAdd(value) {
621
- this.__data__.set(value, HASH_UNDEFINED);
655
+ this.__data__.set(value, HASH_UNDEFINED$1);
622
656
  return this;
623
657
  }
624
658
  /**
@@ -643,7 +677,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
643
677
  * @param {Array} [entries] The key-value pairs to cache.
644
678
  */
645
679
  function Stack(entries) {
646
- this.__data__ = new ListCache(entries);
680
+ this.__data__ = new ListCache$1(entries);
647
681
  }
648
682
  /**
649
683
  * Removes all key-value entries from the stack.
@@ -653,7 +687,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
653
687
  * @memberOf Stack
654
688
  */
655
689
  function stackClear() {
656
- this.__data__ = new ListCache();
690
+ this.__data__ = new ListCache$1();
657
691
  }
658
692
  /**
659
693
  * Removes `key` and its value from the stack.
@@ -703,13 +737,13 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
703
737
  */
704
738
  function stackSet(key, value) {
705
739
  var cache = this.__data__;
706
- if (cache instanceof ListCache) {
740
+ if (cache instanceof ListCache$1) {
707
741
  var pairs = cache.__data__;
708
- if (!Map || pairs.length < 199) {
742
+ if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
709
743
  pairs.push([key, value]);
710
744
  return this;
711
745
  }
712
- cache = this.__data__ = new MapCache(pairs);
746
+ cache = this.__data__ = new MapCache$1(pairs);
713
747
  }
714
748
  cache.set(key, value);
715
749
  return this;
@@ -728,9 +762,9 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
728
762
  * @returns {Array} Returns the array of property names.
729
763
  */
730
764
  function arrayLikeKeys(value, inherited) {
731
- var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
765
+ var result = isArray$1(value) || isArguments(value) ? baseTimes(value.length, String) : [];
732
766
  var length = result.length, skipIndexes = !!length;
733
- for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) result.push(key);
767
+ for (var key in value) if ((inherited || hasOwnProperty$1.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) result.push(key);
734
768
  return result;
735
769
  }
736
770
  /**
@@ -741,9 +775,9 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
741
775
  * @param {*} key The key to search for.
742
776
  * @returns {number} Returns the index of the matched value, else `-1`.
743
777
  */
744
- function assocIndexOf(array, key) {
778
+ function assocIndexOf$1(array, key) {
745
779
  var length = array.length;
746
- while (length--) if (eq(array[length][0], key)) return length;
780
+ while (length--) if (eq$1(array[length][0], key)) return length;
747
781
  return -1;
748
782
  }
749
783
  /**
@@ -754,10 +788,10 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
754
788
  * @param {Array|string} path The path of the property to get.
755
789
  * @returns {*} Returns the resolved value.
756
790
  */
757
- function baseGet(object, path) {
758
- path = isKey(path, object) ? [path] : castPath(path);
791
+ function baseGet$1(object, path) {
792
+ path = isKey$1(path, object) ? [path] : castPath$1(path);
759
793
  var index = 0, length = path.length;
760
- while (object != null && index < length) object = object[toKey(path[index++])];
794
+ while (object != null && index < length) object = object[toKey$1(path[index++])];
761
795
  return index && index == length ? object : void 0;
762
796
  }
763
797
  /**
@@ -768,7 +802,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
768
802
  * @returns {string} Returns the `toStringTag`.
769
803
  */
770
804
  function baseGetTag(value) {
771
- return objectToString.call(value);
805
+ return objectToString$1.call(value);
772
806
  }
773
807
  /**
774
808
  * The base implementation of `_.hasIn` without support for deep paths.
@@ -798,7 +832,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
798
832
  */
799
833
  function baseIsEqual(value, other, customizer, bitmask, stack) {
800
834
  if (value === other) return true;
801
- if (value == null || other == null || !isObject(value) && !isObjectLike(other)) return value !== value && other !== other;
835
+ if (value == null || other == null || !isObject$1(value) && !isObjectLike$1(other)) return value !== value && other !== other;
802
836
  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
803
837
  }
804
838
  /**
@@ -817,7 +851,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
817
851
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
818
852
  */
819
853
  function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
820
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag;
854
+ var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = arrayTag, othTag = arrayTag;
821
855
  if (!objIsArr) {
822
856
  objTag = getTag(object);
823
857
  objTag = objTag == argsTag ? objectTag : objTag;
@@ -826,13 +860,13 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
826
860
  othTag = getTag(other);
827
861
  othTag = othTag == argsTag ? objectTag : othTag;
828
862
  }
829
- var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag;
863
+ var objIsObj = objTag == objectTag && !isHostObject$1(object), othIsObj = othTag == objectTag && !isHostObject$1(other), isSameTag = objTag == othTag;
830
864
  if (isSameTag && !objIsObj) {
831
865
  stack || (stack = new Stack());
832
866
  return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
833
867
  }
834
868
  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
835
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
869
+ var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
836
870
  if (objIsWrapped || othIsWrapped) {
837
871
  var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
838
872
  stack || (stack = new Stack());
@@ -869,7 +903,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
869
903
  } else {
870
904
  var stack = new Stack();
871
905
  if (customizer) var result = customizer(objValue, srcValue, key, object, source, stack);
872
- if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, 3, stack) : result)) return false;
906
+ if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) return false;
873
907
  }
874
908
  }
875
909
  return true;
@@ -882,9 +916,10 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
882
916
  * @returns {boolean} Returns `true` if `value` is a native function,
883
917
  * else `false`.
884
918
  */
885
- function baseIsNative(value) {
886
- if (!isObject(value) || isMasked(value)) return false;
887
- return (isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor).test(toSource(value));
919
+ function baseIsNative$1(value) {
920
+ if (!isObject$1(value) || isMasked$1(value)) return false;
921
+ var pattern = isFunction$1(value) || isHostObject$1(value) ? reIsNative$1 : reIsHostCtor$1;
922
+ return pattern.test(toSource$1(value));
888
923
  }
889
924
  /**
890
925
  * The base implementation of `_.isTypedArray` without Node.js optimizations.
@@ -894,7 +929,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
894
929
  * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
895
930
  */
896
931
  function baseIsTypedArray(value) {
897
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
932
+ return isObjectLike$1(value) && isLength(value.length) && !!typedArrayTags[objectToString$1.call(value)];
898
933
  }
899
934
  /**
900
935
  * The base implementation of `_.iteratee`.
@@ -906,7 +941,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
906
941
  function baseIteratee(value) {
907
942
  if (typeof value == "function") return value;
908
943
  if (value == null) return identity;
909
- if (typeof value == "object") return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
944
+ if (typeof value == "object") return isArray$1(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
910
945
  return property(value);
911
946
  }
912
947
  /**
@@ -919,7 +954,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
919
954
  function baseKeys(object) {
920
955
  if (!isPrototype(object)) return nativeKeys(object);
921
956
  var result = [];
922
- for (var key in Object(object)) if (hasOwnProperty.call(object, key) && key != "constructor") result.push(key);
957
+ for (var key in Object(object)) if (hasOwnProperty$1.call(object, key) && key != "constructor") result.push(key);
923
958
  return result;
924
959
  }
925
960
  /**
@@ -945,10 +980,10 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
945
980
  * @returns {Function} Returns the new spec function.
946
981
  */
947
982
  function baseMatchesProperty(path, srcValue) {
948
- if (isKey(path) && isStrictComparable(srcValue)) return matchesStrictComparable(toKey(path), srcValue);
983
+ if (isKey$1(path) && isStrictComparable(srcValue)) return matchesStrictComparable(toKey$1(path), srcValue);
949
984
  return function(object) {
950
- var objValue = get(object, path);
951
- return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, 3);
985
+ var objValue = get$2(object, path);
986
+ return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
952
987
  };
953
988
  }
954
989
  /**
@@ -960,7 +995,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
960
995
  */
961
996
  function basePropertyDeep(path) {
962
997
  return function(object) {
963
- return baseGet(object, path);
998
+ return baseGet$1(object, path);
964
999
  };
965
1000
  }
966
1001
  /**
@@ -971,11 +1006,11 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
971
1006
  * @param {*} value The value to process.
972
1007
  * @returns {string} Returns the string.
973
1008
  */
974
- function baseToString(value) {
1009
+ function baseToString$1(value) {
975
1010
  if (typeof value == "string") return value;
976
- if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
1011
+ if (isSymbol$1(value)) return symbolToString$1 ? symbolToString$1.call(value) : "";
977
1012
  var result = value + "";
978
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
1013
+ return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
979
1014
  }
980
1015
  /**
981
1016
  * The base implementation of `_.uniqBy` without support for iteratee shorthands.
@@ -1020,8 +1055,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1020
1055
  * @param {*} value The value to inspect.
1021
1056
  * @returns {Array} Returns the cast property path array.
1022
1057
  */
1023
- function castPath(value) {
1024
- return isArray(value) ? value : stringToPath(value);
1058
+ function castPath$1(value) {
1059
+ return isArray$1(value) ? value : stringToPath$1(value);
1025
1060
  }
1026
1061
  /**
1027
1062
  * Creates a set object of `values`.
@@ -1030,7 +1065,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1030
1065
  * @param {Array} values The values to add to the set.
1031
1066
  * @returns {Object} Returns the new set.
1032
1067
  */
1033
- var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function(values) {
1068
+ var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY$1) ? noop : function(values) {
1034
1069
  return new Set(values);
1035
1070
  };
1036
1071
  /**
@@ -1064,8 +1099,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1064
1099
  break;
1065
1100
  }
1066
1101
  if (seen) {
1067
- if (!arraySome(other, function(othValue, othIndex) {
1068
- if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) return seen.add(othIndex);
1102
+ if (!arraySome(other, function(othValue$1, othIndex) {
1103
+ if (!seen.has(othIndex) && (arrValue === othValue$1 || equalFunc(arrValue, othValue$1, customizer, bitmask, stack))) return seen.add(othIndex);
1069
1104
  })) {
1070
1105
  result = false;
1071
1106
  break;
@@ -1108,7 +1143,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1108
1143
  return true;
1109
1144
  case boolTag:
1110
1145
  case dateTag:
1111
- case numberTag: return eq(+object, +other);
1146
+ case numberTag: return eq$1(+object, +other);
1112
1147
  case errorTag: return object.name == other.name && object.message == other.message;
1113
1148
  case regexpTag:
1114
1149
  case stringTag: return object == other + "";
@@ -1124,7 +1159,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1124
1159
  var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
1125
1160
  stack["delete"](object);
1126
1161
  return result;
1127
- case symbolTag: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other);
1162
+ case symbolTag$1: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other);
1128
1163
  }
1129
1164
  return false;
1130
1165
  }
@@ -1143,12 +1178,12 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1143
1178
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1144
1179
  */
1145
1180
  function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
1146
- var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length;
1147
- if (objLength != keys(other).length && !isPartial) return false;
1181
+ var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
1182
+ if (objLength != othLength && !isPartial) return false;
1148
1183
  var index = objLength;
1149
1184
  while (index--) {
1150
1185
  var key = objProps[index];
1151
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) return false;
1186
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) return false;
1152
1187
  }
1153
1188
  var stacked = stack.get(object);
1154
1189
  if (stacked && stack.get(other)) return stacked == other;
@@ -1182,9 +1217,9 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1182
1217
  * @param {string} key The reference key.
1183
1218
  * @returns {*} Returns the map data.
1184
1219
  */
1185
- function getMapData(map, key) {
1220
+ function getMapData$1(map, key) {
1186
1221
  var data = map.__data__;
1187
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1222
+ return isKeyable$1(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1188
1223
  }
1189
1224
  /**
1190
1225
  * Gets the property names, values, and compare flags of `object`.
@@ -1213,9 +1248,9 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1213
1248
  * @param {string} key The key of the method to get.
1214
1249
  * @returns {*} Returns the function if it's native, else `undefined`.
1215
1250
  */
1216
- function getNative(object, key) {
1217
- var value = getValue(object, key);
1218
- return baseIsNative(value) ? value : void 0;
1251
+ function getNative$1(object, key) {
1252
+ var value = getValue$1(object, key);
1253
+ return baseIsNative$1(value) ? value : void 0;
1219
1254
  }
1220
1255
  /**
1221
1256
  * Gets the `toStringTag` of `value`.
@@ -1225,8 +1260,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1225
1260
  * @returns {string} Returns the `toStringTag`.
1226
1261
  */
1227
1262
  var getTag = baseGetTag;
1228
- if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) getTag = function(value) {
1229
- var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
1263
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag(new Map$1()) != mapTag || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) getTag = function(value) {
1264
+ var result = objectToString$1.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource$1(Ctor) : void 0;
1230
1265
  if (ctorString) switch (ctorString) {
1231
1266
  case dataViewCtorString: return dataViewTag;
1232
1267
  case mapCtorString: return mapTag;
@@ -1246,16 +1281,16 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1246
1281
  * @returns {boolean} Returns `true` if `path` exists, else `false`.
1247
1282
  */
1248
1283
  function hasPath(object, path, hasFunc) {
1249
- path = isKey(path, object) ? [path] : castPath(path);
1284
+ path = isKey$1(path, object) ? [path] : castPath$1(path);
1250
1285
  var result, index = -1, length = path.length;
1251
1286
  while (++index < length) {
1252
- var key = toKey(path[index]);
1287
+ var key = toKey$1(path[index]);
1253
1288
  if (!(result = object != null && hasFunc(object, key))) break;
1254
1289
  object = object[key];
1255
1290
  }
1256
1291
  if (result) return result;
1257
1292
  var length = object ? object.length : 0;
1258
- return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
1293
+ return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
1259
1294
  }
1260
1295
  /**
1261
1296
  * Checks if `value` is a valid array-like index.
@@ -1277,11 +1312,11 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1277
1312
  * @param {Object} [object] The object to query keys on.
1278
1313
  * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1279
1314
  */
1280
- function isKey(value, object) {
1281
- if (isArray(value)) return false;
1315
+ function isKey$1(value, object) {
1316
+ if (isArray$1(value)) return false;
1282
1317
  var type = typeof value;
1283
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) return true;
1284
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
1318
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol$1(value)) return true;
1319
+ return reIsPlainProp$1.test(value) || !reIsDeepProp$1.test(value) || object != null && value in Object(object);
1285
1320
  }
1286
1321
  /**
1287
1322
  * Checks if `value` is suitable for use as unique object key.
@@ -1290,7 +1325,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1290
1325
  * @param {*} value The value to check.
1291
1326
  * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1292
1327
  */
1293
- function isKeyable(value) {
1328
+ function isKeyable$1(value) {
1294
1329
  var type = typeof value;
1295
1330
  return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1296
1331
  }
@@ -1301,8 +1336,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1301
1336
  * @param {Function} func The function to check.
1302
1337
  * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1303
1338
  */
1304
- function isMasked(func) {
1305
- return !!maskSrcKey && maskSrcKey in func;
1339
+ function isMasked$1(func) {
1340
+ return !!maskSrcKey$1 && maskSrcKey$1 in func;
1306
1341
  }
1307
1342
  /**
1308
1343
  * Checks if `value` is likely a prototype object.
@@ -1312,8 +1347,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1312
1347
  * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1313
1348
  */
1314
1349
  function isPrototype(value) {
1315
- var Ctor = value && value.constructor;
1316
- return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
1350
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$1;
1351
+ return value === proto;
1317
1352
  }
1318
1353
  /**
1319
1354
  * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
@@ -1324,7 +1359,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1324
1359
  * equality comparisons, else `false`.
1325
1360
  */
1326
1361
  function isStrictComparable(value) {
1327
- return value === value && !isObject(value);
1362
+ return value === value && !isObject$1(value);
1328
1363
  }
1329
1364
  /**
1330
1365
  * A specialized version of `matchesProperty` for source values suitable
@@ -1348,12 +1383,12 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1348
1383
  * @param {string} string The string to convert.
1349
1384
  * @returns {Array} Returns the property path array.
1350
1385
  */
1351
- var stringToPath = memoize(function(string) {
1352
- string = toString(string);
1386
+ var stringToPath$1 = memoize$1(function(string) {
1387
+ string = toString$1(string);
1353
1388
  var result = [];
1354
- if (reLeadingDot.test(string)) result.push("");
1355
- string.replace(rePropName, function(match, number, quote, string) {
1356
- result.push(quote ? string.replace(reEscapeChar, "$1") : number || match);
1389
+ if (reLeadingDot$1.test(string)) result.push("");
1390
+ string.replace(rePropName$1, function(match, number, quote, string$1) {
1391
+ result.push(quote ? string$1.replace(reEscapeChar$1, "$1") : number || match);
1357
1392
  });
1358
1393
  return result;
1359
1394
  });
@@ -1364,10 +1399,10 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1364
1399
  * @param {*} value The value to inspect.
1365
1400
  * @returns {string|symbol} Returns the key.
1366
1401
  */
1367
- function toKey(value) {
1368
- if (typeof value == "string" || isSymbol(value)) return value;
1402
+ function toKey$1(value) {
1403
+ if (typeof value == "string" || isSymbol$1(value)) return value;
1369
1404
  var result = value + "";
1370
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
1405
+ return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
1371
1406
  }
1372
1407
  /**
1373
1408
  * Converts `func` to its source code.
@@ -1376,10 +1411,10 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1376
1411
  * @param {Function} func The function to process.
1377
1412
  * @returns {string} Returns the source code.
1378
1413
  */
1379
- function toSource(func) {
1414
+ function toSource$1(func) {
1380
1415
  if (func != null) {
1381
1416
  try {
1382
- return funcToString.call(func);
1417
+ return funcToString$1.call(func);
1383
1418
  } catch (e) {}
1384
1419
  try {
1385
1420
  return func + "";
@@ -1409,7 +1444,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1409
1444
  * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
1410
1445
  * // => [{ 'x': 1 }, { 'x': 2 }]
1411
1446
  */
1412
- function uniqBy(array, iteratee) {
1447
+ function uniqBy$2(array, iteratee) {
1413
1448
  return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
1414
1449
  }
1415
1450
  /**
@@ -1456,8 +1491,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1456
1491
  * // Replace `_.memoize.Cache`.
1457
1492
  * _.memoize.Cache = WeakMap;
1458
1493
  */
1459
- function memoize(func, resolver) {
1460
- if (typeof func != "function" || resolver && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT);
1494
+ function memoize$1(func, resolver) {
1495
+ if (typeof func != "function" || resolver && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT$1);
1461
1496
  var memoized = function() {
1462
1497
  var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1463
1498
  if (cache.has(key)) return cache.get(key);
@@ -1465,10 +1500,10 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1465
1500
  memoized.cache = cache.set(key, result);
1466
1501
  return result;
1467
1502
  };
1468
- memoized.cache = new (memoize.Cache || MapCache)();
1503
+ memoized.cache = new (memoize$1.Cache || MapCache$1)();
1469
1504
  return memoized;
1470
1505
  }
1471
- memoize.Cache = MapCache;
1506
+ memoize$1.Cache = MapCache$1;
1472
1507
  /**
1473
1508
  * Performs a
1474
1509
  * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@@ -1501,7 +1536,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1501
1536
  * _.eq(NaN, NaN);
1502
1537
  * // => true
1503
1538
  */
1504
- function eq(value, other) {
1539
+ function eq$1(value, other) {
1505
1540
  return value === other || value !== value && other !== other;
1506
1541
  }
1507
1542
  /**
@@ -1523,7 +1558,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1523
1558
  * // => false
1524
1559
  */
1525
1560
  function isArguments(value) {
1526
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
1561
+ return isArrayLikeObject(value) && hasOwnProperty$1.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString$1.call(value) == argsTag);
1527
1562
  }
1528
1563
  /**
1529
1564
  * Checks if `value` is classified as an `Array` object.
@@ -1548,7 +1583,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1548
1583
  * _.isArray(_.noop);
1549
1584
  * // => false
1550
1585
  */
1551
- var isArray = Array.isArray;
1586
+ var isArray$1 = Array.isArray;
1552
1587
  /**
1553
1588
  * Checks if `value` is array-like. A value is considered array-like if it's
1554
1589
  * not a function and has a `value.length` that's an integer greater than or
@@ -1575,7 +1610,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1575
1610
  * // => false
1576
1611
  */
1577
1612
  function isArrayLike(value) {
1578
- return value != null && isLength(value.length) && !isFunction(value);
1613
+ return value != null && isLength(value.length) && !isFunction$1(value);
1579
1614
  }
1580
1615
  /**
1581
1616
  * This method is like `_.isArrayLike` except that it also checks if `value`
@@ -1603,7 +1638,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1603
1638
  * // => false
1604
1639
  */
1605
1640
  function isArrayLikeObject(value) {
1606
- return isObjectLike(value) && isArrayLike(value);
1641
+ return isObjectLike$1(value) && isArrayLike(value);
1607
1642
  }
1608
1643
  /**
1609
1644
  * Checks if `value` is classified as a `Function` object.
@@ -1622,9 +1657,9 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1622
1657
  * _.isFunction(/abc/);
1623
1658
  * // => false
1624
1659
  */
1625
- function isFunction(value) {
1626
- var tag = isObject(value) ? objectToString.call(value) : "";
1627
- return tag == funcTag || tag == genTag;
1660
+ function isFunction$1(value) {
1661
+ var tag = isObject$1(value) ? objectToString$1.call(value) : "";
1662
+ return tag == funcTag$1 || tag == genTag$1;
1628
1663
  }
1629
1664
  /**
1630
1665
  * Checks if `value` is a valid array-like length.
@@ -1680,7 +1715,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1680
1715
  * _.isObject(null);
1681
1716
  * // => false
1682
1717
  */
1683
- function isObject(value) {
1718
+ function isObject$1(value) {
1684
1719
  var type = typeof value;
1685
1720
  return !!value && (type == "object" || type == "function");
1686
1721
  }
@@ -1708,7 +1743,7 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1708
1743
  * _.isObjectLike(null);
1709
1744
  * // => false
1710
1745
  */
1711
- function isObjectLike(value) {
1746
+ function isObjectLike$1(value) {
1712
1747
  return !!value && typeof value == "object";
1713
1748
  }
1714
1749
  /**
@@ -1728,8 +1763,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1728
1763
  * _.isSymbol('abc');
1729
1764
  * // => false
1730
1765
  */
1731
- function isSymbol(value) {
1732
- return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
1766
+ function isSymbol$1(value) {
1767
+ return typeof value == "symbol" || isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1;
1733
1768
  }
1734
1769
  /**
1735
1770
  * Checks if `value` is classified as a typed array.
@@ -1770,8 +1805,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1770
1805
  * _.toString([1, 2, 3]);
1771
1806
  * // => '1,2,3'
1772
1807
  */
1773
- function toString(value) {
1774
- return value == null ? "" : baseToString(value);
1808
+ function toString$1(value) {
1809
+ return value == null ? "" : baseToString$1(value);
1775
1810
  }
1776
1811
  /**
1777
1812
  * Gets the value at `path` of `object`. If the resolved value is
@@ -1798,8 +1833,8 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1798
1833
  * _.get(object, 'a.b.c', 'default');
1799
1834
  * // => 'default'
1800
1835
  */
1801
- function get(object, path, defaultValue) {
1802
- var result = object == null ? void 0 : baseGet(object, path);
1836
+ function get$2(object, path, defaultValue) {
1837
+ var result = object == null ? void 0 : baseGet$1(object, path);
1803
1838
  return result === void 0 ? defaultValue : result;
1804
1839
  }
1805
1840
  /**
@@ -1917,13 +1952,14 @@ var require_lodash_uniqby = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1917
1952
  * // => [1, 2]
1918
1953
  */
1919
1954
  function property(path) {
1920
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
1955
+ return isKey$1(path) ? baseProperty(toKey$1(path)) : basePropertyDeep(path);
1921
1956
  }
1922
- module.exports = uniqBy;
1923
- }));
1957
+ module.exports = uniqBy$2;
1958
+ } });
1959
+
1924
1960
  //#endregion
1925
1961
  //#region ../../node_modules/.pnpm/lodash.get@4.4.2/node_modules/lodash.get/index.js
1926
- var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1962
+ var require_lodash = __commonJS({ "../../node_modules/.pnpm/lodash.get@4.4.2/node_modules/lodash.get/index.js"(exports, module) {
1927
1963
  /**
1928
1964
  * lodash (Custom Build) <https://lodash.com/>
1929
1965
  * Build: `lodash modularize exports="npm" -o ./`
@@ -1936,15 +1972,12 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1936
1972
  var FUNC_ERROR_TEXT = "Expected a function";
1937
1973
  /** Used to stand-in for `undefined` hash values. */
1938
1974
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
1975
+ /** Used as references for various `Number` constants. */
1976
+ var INFINITY = Infinity;
1939
1977
  /** `Object#toString` result references. */
1940
- var funcTag = "[object Function]";
1941
- var genTag = "[object GeneratorFunction]";
1942
- var symbolTag = "[object Symbol]";
1978
+ var funcTag = "[object Function]", genTag = "[object GeneratorFunction]", symbolTag = "[object Symbol]";
1943
1979
  /** Used to match property names within property paths. */
1944
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
1945
- var reIsPlainProp = /^\w*$/;
1946
- var reLeadingDot = /^\./;
1947
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1980
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1948
1981
  /**
1949
1982
  * Used to match `RegExp`
1950
1983
  * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
@@ -1986,9 +2019,7 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1986
2019
  return result;
1987
2020
  }
1988
2021
  /** Used for built-in method references. */
1989
- var arrayProto = Array.prototype;
1990
- var funcProto = Function.prototype;
1991
- var objectProto = Object.prototype;
2022
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
1992
2023
  /** Used to detect overreaching core-js shims. */
1993
2024
  var coreJsData = root["__core-js_shared__"];
1994
2025
  /** Used to detect methods masquerading as native. */
@@ -2009,13 +2040,10 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2009
2040
  /** Used to detect if a method is native. */
2010
2041
  var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
2011
2042
  /** Built-in value references. */
2012
- var Symbol = root.Symbol;
2013
- var splice = arrayProto.splice;
2014
- var Map = getNative(root, "Map");
2015
- var nativeCreate = getNative(Object, "create");
2043
+ var Symbol = root.Symbol, splice = arrayProto.splice;
2044
+ var Map = getNative(root, "Map"), nativeCreate = getNative(Object, "create");
2016
2045
  /** Used to convert symbols to primitives and strings. */
2017
- var symbolProto = Symbol ? Symbol.prototype : void 0;
2018
- var symbolToString = symbolProto ? symbolProto.toString : void 0;
2046
+ var symbolProto = Symbol ? Symbol.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
2019
2047
  /**
2020
2048
  * Creates a hash object.
2021
2049
  *
@@ -2141,7 +2169,8 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2141
2169
  function listCacheDelete(key) {
2142
2170
  var data = this.__data__, index = assocIndexOf(data, key);
2143
2171
  if (index < 0) return false;
2144
- if (index == data.length - 1) data.pop();
2172
+ var lastIndex = data.length - 1;
2173
+ if (index == lastIndex) data.pop();
2145
2174
  else splice.call(data, index, 1);
2146
2175
  return true;
2147
2176
  }
@@ -2312,7 +2341,8 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2312
2341
  */
2313
2342
  function baseIsNative(value) {
2314
2343
  if (!isObject(value) || isMasked(value)) return false;
2315
- return (isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor).test(toSource(value));
2344
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
2345
+ return pattern.test(toSource(value));
2316
2346
  }
2317
2347
  /**
2318
2348
  * The base implementation of `_.toString` which doesn't convert nullish
@@ -2326,7 +2356,7 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2326
2356
  if (typeof value == "string") return value;
2327
2357
  if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
2328
2358
  var result = value + "";
2329
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
2359
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
2330
2360
  }
2331
2361
  /**
2332
2362
  * Casts `value` to a path array if it's not one.
@@ -2408,8 +2438,8 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2408
2438
  string = toString(string);
2409
2439
  var result = [];
2410
2440
  if (reLeadingDot.test(string)) result.push("");
2411
- string.replace(rePropName, function(match, number, quote, string) {
2412
- result.push(quote ? string.replace(reEscapeChar, "$1") : number || match);
2441
+ string.replace(rePropName, function(match, number, quote, string$1) {
2442
+ result.push(quote ? string$1.replace(reEscapeChar, "$1") : number || match);
2413
2443
  });
2414
2444
  return result;
2415
2445
  });
@@ -2423,7 +2453,7 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2423
2453
  function toKey(value) {
2424
2454
  if (typeof value == "string" || isSymbol(value)) return value;
2425
2455
  var result = value + "";
2426
- return result == "0" && 1 / value == -Infinity ? "-0" : result;
2456
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
2427
2457
  }
2428
2458
  /**
2429
2459
  * Converts `func` to its source code.
@@ -2705,114 +2735,28 @@ var require_lodash_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2705
2735
  * _.get(object, 'a.b.c', 'default');
2706
2736
  * // => 'default'
2707
2737
  */
2708
- function get(object, path, defaultValue) {
2738
+ function get$1(object, path, defaultValue) {
2709
2739
  var result = object == null ? void 0 : baseGet(object, path);
2710
2740
  return result === void 0 ? defaultValue : result;
2711
2741
  }
2712
- module.exports = get;
2713
- }));
2714
- //#endregion
2715
- //#region src/publisher.ts
2716
- var import_lodash_uniqby = /* @__PURE__ */ __toESM(require_lodash_uniqby(), 1);
2717
- var import_lodash_get = /* @__PURE__ */ __toESM(require_lodash_get(), 1);
2718
- /** A topic event, bound to its topic — what the builders store. */
2719
- function topicEvent(topic, event) {
2720
- return {
2721
- topic: topic.service,
2722
- type: event.type,
2723
- payload: event.payload,
2724
- ...event.when ? { when: event.when } : {}
2725
- };
2726
- }
2727
- /**
2728
- * Publish a construct's events for what its handler returned, each through
2729
- * its own topic's publisher.
2730
- *
2731
- * Failures are logged, never thrown: the handler has already succeeded, and an
2732
- * event that could not be delivered must not turn its response into an error.
2733
- */
2734
- async function publishEvents(logger, serviceDiscovery, events = [], response, provided = {}) {
2735
- try {
2736
- if (!events.length) {
2737
- logger.debug("No events to publish");
2738
- return;
2739
- }
2740
- const byTopic = /* @__PURE__ */ new Map();
2741
- for (const { topic, type, payload, when } of events) {
2742
- if (when && !when(response)) continue;
2743
- logger.debug({ event: type }, "Processing event");
2744
- const group = byTopic.get(topic.serviceName) ?? {
2745
- topic,
2746
- messages: []
2747
- };
2748
- group.messages.push({
2749
- type,
2750
- payload: await payload(response)
2751
- });
2752
- byTopic.set(topic.serviceName, group);
2753
- }
2754
- if (!byTopic.size) return;
2755
- const missing = [...byTopic.values()].map(({ topic }) => topic).filter((topic) => !(topic.serviceName in provided));
2756
- const services = {
2757
- ...missing.length ? await serviceDiscovery.register(missing) : {},
2758
- ...provided
2759
- };
2760
- await Promise.all([...byTopic.values()].map(async ({ topic, messages }) => {
2761
- logger.debug({
2762
- topic: topic.serviceName,
2763
- eventCount: messages.length
2764
- }, "Publishing events");
2765
- await services[topic.serviceName].publish(messages).catch((err) => {
2766
- logger.error(err, "Failed to publish events");
2767
- });
2768
- }));
2769
- } catch (error) {
2770
- logger.error(error, "Something went wrong publishing events");
2771
- }
2772
- }
2773
- /** Publish a construct's declared events for what its handler returned. */
2774
- async function publishConstructEvents(construct, response, serviceDiscovery, logger = construct.logger, provided = {}) {
2775
- return publishEvents(logger, serviceDiscovery, construct.events, response, provided);
2776
- }
2742
+ module.exports = get$1;
2743
+ } });
2744
+
2777
2745
  //#endregion
2778
2746
  //#region src/functions/BaseFunctionBuilder.ts
2747
+ var import_lodash$2 = __toESM(require_lodash(), 1);
2748
+ const DEFAULT_LOGGER$2 = new ConsoleLogger();
2779
2749
  var BaseFunctionBuilder = class BaseFunctionBuilder {
2780
- type;
2781
2750
  inputSchema;
2782
2751
  outputSchema;
2783
2752
  _timeout;
2784
2753
  _services = [];
2785
- /**
2786
- * The construct ids `.dependsOn()` was given.
2787
- *
2788
- * Beside the services rather than instead of them: a handler *runs* with
2789
- * clients and the manifest *records* which constructs it reaches, and
2790
- * dissolving one into the other is what lost the edges. Shared by every
2791
- * builder because every one of them can depend on something.
2792
- */
2793
- _constructs = [];
2794
- _logger = DEFAULT_LOGGER;
2795
- /**
2796
- * The deploy unit everything built from this builder belongs to.
2797
- *
2798
- * Seeded by the factory a `Worker` or `RestApi` hands out, so a cron knows
2799
- * which process runs it without a directory having to imply it.
2800
- */
2801
- _owner;
2802
- /**
2803
- * Where a cron built from this factory keeps its schedule.
2804
- *
2805
- * Set by the worker that handed the factory out, the same way the logger
2806
- * and the owner are — so a cron file names a schedule and nothing else.
2807
- * Only a server target reads it; on AWS the schedule is an EventBridge rule.
2808
- */
2809
- _scheduleStore;
2810
- /** What the built construct publishes, each event bound to its topic. */
2754
+ _logger = DEFAULT_LOGGER$2;
2811
2755
  _events = [];
2756
+ _publisher;
2812
2757
  _auditorStorage;
2813
2758
  _databaseService;
2814
- /** The edge `.database()` added, so the next one can replace it. */
2815
- _databaseEdge;
2759
+ _monitors = [];
2816
2760
  static isStandardSchemaV1(s) {
2817
2761
  const schema = s["~standard"];
2818
2762
  return schema && typeof schema.validate === "function";
@@ -2824,11 +2768,10 @@ var BaseFunctionBuilder = class BaseFunctionBuilder {
2824
2768
  return validated.value;
2825
2769
  }
2826
2770
  const result = {};
2827
- const fields = schema;
2828
- for (const key in fields) {
2829
- const item = fields[key];
2771
+ for (const key in schema) {
2772
+ const item = schema[key];
2830
2773
  if (BaseFunctionBuilder.isStandardSchemaV1(item)) {
2831
- const value = (0, import_lodash_get.default)(data, key);
2774
+ const value = (0, import_lodash$2.default)(data, key);
2832
2775
  const validated = await item["~standard"].validate(value);
2833
2776
  if (validated.issues) throw validated.issues;
2834
2777
  result[key] = validated.value;
@@ -2836,24 +2779,24 @@ var BaseFunctionBuilder = class BaseFunctionBuilder {
2836
2779
  }
2837
2780
  return result;
2838
2781
  }
2839
- constructor(type = "dev.geekmidas.function.function") {
2782
+ constructor(type = ConstructType.Function) {
2840
2783
  this.type = type;
2841
2784
  }
2842
2785
  timeout(timeout) {
2843
2786
  return cloneWith(this, { _timeout: timeout });
2844
2787
  }
2845
2788
  /**
2846
- * A clone that publishes `event` to `topic` once the handler succeeds, and
2847
- * has the topic as a dependency the way `.dependsOn([topic])` would: in
2848
- * `services`, and an edge in the manifest. Each builder types it as its own
2849
- * `event()`, since only it knows how its services widen.
2789
+ * Report each run to a monitor — a heartbeat, an uptime check, an error
2790
+ * tracker. Can be called more than once; every monitor is told.
2850
2791
  */
2851
- withEvent(topic, event) {
2852
- return cloneWith(this, {
2853
- _events: [...this._events, topicEvent(topic, event)],
2854
- _services: (0, import_lodash_uniqby.default)([...this._services, topic.service], (s) => s.serviceName),
2855
- _constructs: idsOf([topic], this._constructs)
2856
- });
2792
+ monitor(monitor) {
2793
+ return cloneWith(this, { _monitors: addMonitor(this._monitors, monitor) });
2794
+ }
2795
+ event(event) {
2796
+ return cloneWith(this, { _events: [...this._events, event] });
2797
+ }
2798
+ publisher(publisher) {
2799
+ return cloneWith(this, { _publisher: publisher });
2857
2800
  }
2858
2801
  auditor(storage) {
2859
2802
  return cloneWith(this, { _auditorStorage: storage });
@@ -2862,28 +2805,19 @@ var BaseFunctionBuilder = class BaseFunctionBuilder {
2862
2805
  * Set the database service for this function.
2863
2806
  * The database will be available in the handler context as `db`.
2864
2807
  */
2865
- database(source) {
2866
- const service = serviceOf(source);
2867
- return cloneWith(this, {
2868
- _databaseService: service,
2869
- ...databaseEdges({
2870
- constructs: this._constructs,
2871
- edge: this._databaseEdge,
2872
- service: this._databaseService,
2873
- services: this._services
2874
- }, source)
2875
- });
2808
+ database(service) {
2809
+ return cloneWith(this, { _databaseService: service });
2876
2810
  }
2877
2811
  };
2812
+
2878
2813
  //#endregion
2879
2814
  //#region src/functions/Function.ts
2815
+ var import_lodash$1 = __toESM(require_lodash$1(), 1);
2816
+ const DEFAULT_LOGGER$1 = new ConsoleLogger();
2880
2817
  var Function$1 = class Function$1 extends Construct {
2881
- fn;
2882
- input;
2883
- databaseService;
2884
2818
  __IS_FUNCTION__ = true;
2885
2819
  static isFunction(obj) {
2886
- return Boolean(obj && obj.__IS_FUNCTION__ === true && obj.type === "dev.geekmidas.function.function");
2820
+ return Boolean(obj && obj.__IS_FUNCTION__ === true && obj.type === ConstructType.Function);
2887
2821
  }
2888
2822
  /**
2889
2823
  * Validates data against a StandardSchema.
@@ -2920,19 +2854,20 @@ var Function$1 = class Function$1 extends Construct {
2920
2854
  async parseOutput(output) {
2921
2855
  return Function$1.parseSchema(this.outputSchema, output);
2922
2856
  }
2923
- constructor(fn, timeout = 3e4, type = "dev.geekmidas.function.function", input, outputSchema, services = [], logger = DEFAULT_LOGGER, events = [], memorySize, auditorStorageService, databaseService, constructs = []) {
2924
- super(type, logger, services, events, outputSchema, timeout, memorySize, auditorStorageService, constructs);
2857
+ constructor(fn, timeout = 3e4, type = ConstructType.Function, input, outputSchema, services = [], logger = DEFAULT_LOGGER$1, publisherService, events = [], memorySize, auditorStorageService, databaseService) {
2858
+ super(type, logger, services, events, publisherService, outputSchema, timeout, memorySize, auditorStorageService);
2925
2859
  this.fn = fn;
2926
2860
  this.input = input;
2927
2861
  this.databaseService = databaseService;
2928
2862
  }
2929
2863
  };
2864
+
2930
2865
  //#endregion
2931
2866
  //#region src/functions/FunctionBuilder.ts
2867
+ var import_lodash = __toESM(require_lodash$1(), 1);
2932
2868
  var FunctionBuilder = class extends BaseFunctionBuilder {
2933
- type;
2934
2869
  _memorySize;
2935
- constructor(type = "dev.geekmidas.function.function") {
2870
+ constructor(type = ConstructType.Function) {
2936
2871
  super(type);
2937
2872
  this.type = type;
2938
2873
  }
@@ -2948,38 +2883,14 @@ var FunctionBuilder = class extends BaseFunctionBuilder {
2948
2883
  input(schema) {
2949
2884
  return cloneWith(this, { inputSchema: schema });
2950
2885
  }
2951
- /**
2952
- * Depend on constructs — a database, a bucket, a mail sender, a queue, a
2953
- * topic.
2954
- *
2955
- * It records the edge and dissolves each construct's client into the
2956
- * handler's service record under the construct's own id, so
2957
- * `.dependsOn([uploads])` is what makes `services.uploads` exist and type.
2958
- *
2959
- * Constructs only. A `Service` does not match the shape, which is what keeps
2960
- * env sniffing confined to `.services()` and the explicit lift.
2961
- */
2962
- dependsOn(constructs) {
2963
- const services = servicesOf(constructs);
2964
- return cloneWith(this, {
2965
- _services: (0, import_lodash_uniqby.default)([...this._services, ...services], (s) => s.serviceName),
2966
- _constructs: idsOf(constructs, this._constructs)
2967
- });
2968
- }
2969
2886
  services(services) {
2970
- return cloneWith(this, { _services: (0, import_lodash_uniqby.default)([...this._services, ...services], (s) => s.serviceName) });
2887
+ return cloneWith(this, { _services: (0, import_lodash.default)([...this._services, ...services], (s) => s.serviceName) });
2971
2888
  }
2972
2889
  logger(logger) {
2973
2890
  return cloneWith(this, { _logger: logger });
2974
2891
  }
2975
- /**
2976
- * Publish `event` to `topic` once the function has succeeded — repeatable,
2977
- * one call per event, to as many topics as it names. The topic becomes a
2978
- * dependency as with `.dependsOn([topic])`, so `services.<topic>` is there
2979
- * for events the handler decides on itself.
2980
- */
2981
- event(topic, event) {
2982
- return this.withEvent(topic, event);
2892
+ publisher(publisher) {
2893
+ return cloneWith(this, { _publisher: publisher });
2983
2894
  }
2984
2895
  auditor(storage) {
2985
2896
  return cloneWith(this, { _auditorStorage: storage });
@@ -2995,25 +2906,20 @@ var FunctionBuilder = class extends BaseFunctionBuilder {
2995
2906
  * Set the database service for this function.
2996
2907
  * The database will be available in the handler context as `db`.
2997
2908
  */
2998
- database(source) {
2999
- const service = serviceOf(source);
3000
- return cloneWith(this, {
3001
- _databaseService: service,
3002
- ...databaseEdges({
3003
- constructs: this._constructs,
3004
- edge: this._databaseEdge,
3005
- service: this._databaseService,
3006
- services: this._services
3007
- }, source)
3008
- });
2909
+ database(service) {
2910
+ return cloneWith(this, { _databaseService: service });
3009
2911
  }
3010
2912
  handle(fn) {
3011
- const func = new Function$1(fn, this._timeout, this.type, this.inputSchema, this.outputSchema, this._services, this._logger, this._events, this._memorySize, this._auditorStorage, this._databaseService, this._constructs);
3012
- func.owner = this._owner;
2913
+ const func = new Function$1(fn, this._timeout, this.type, this.inputSchema, this.outputSchema, this._services, this._logger, this._publisher, this._events, this._memorySize, this._auditorStorage, this._databaseService);
2914
+ func.monitors = this._monitors;
3013
2915
  return func;
3014
2916
  }
3015
2917
  };
2918
+
3016
2919
  //#endregion
3017
- export { publishEvents as a, publishConstructEvents as i, Function$1 as n, require_lodash_uniqby as o, BaseFunctionBuilder as r, FunctionBuilder as t };
2920
+ //#region src/functions/index.ts
2921
+ const f = new FunctionBuilder();
3018
2922
 
3019
- //# sourceMappingURL=functions-BFizikJU.mjs.map
2923
+ //#endregion
2924
+ export { BaseFunctionBuilder, Function$1 as Function, FunctionBuilder, addMonitor, f, require_lodash$1 as require_lodash, startMonitors };
2925
+ //# sourceMappingURL=functions-EqTloHjo.mjs.map