@geekmidas/constructs 10.0.0-alpha.170 → 10.0.0-alpha.171

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 (163) hide show
  1. package/dist/{Cron-Ca_qHQu2.d.cts → Cron-BcA8F0S-.d.cts} +2 -2
  2. package/dist/{Cron-Ca_qHQu2.d.cts.map → Cron-BcA8F0S-.d.cts.map} +1 -1
  3. package/dist/{Cron-DPJiR7Lt.d.mts → Cron-z2CiuQT_.d.mts} +2 -2
  4. package/dist/{Cron-DPJiR7Lt.d.mts.map → Cron-z2CiuQT_.d.mts.map} +1 -1
  5. package/dist/{CronBuilder-C3RrAF1-.d.cts → CronBuilder-BZvo34X2.d.cts} +4 -4
  6. package/dist/{CronBuilder-BC4za5Bx.d.mts.map → CronBuilder-BZvo34X2.d.cts.map} +1 -1
  7. package/dist/{CronBuilder-BC4za5Bx.d.mts → CronBuilder-BbgKo8OI.d.mts} +4 -4
  8. package/dist/{CronBuilder-C3RrAF1-.d.cts.map → CronBuilder-BbgKo8OI.d.mts.map} +1 -1
  9. package/dist/{Endpoint-DC7mreOr.d.mts → Endpoint-CIDUreMW.d.mts} +5 -5
  10. package/dist/{Endpoint-BlIZLsBQ.d.cts.map → Endpoint-CIDUreMW.d.mts.map} +1 -1
  11. package/dist/{Endpoint-BlIZLsBQ.d.cts → Endpoint-COisi9jw.d.cts} +5 -5
  12. package/dist/{Endpoint-DC7mreOr.d.mts.map → Endpoint-COisi9jw.d.cts.map} +1 -1
  13. package/dist/{EndpointFactory-DCmnCmkX.d.mts → EndpointFactory-CIM80WIK.d.mts} +5 -5
  14. package/dist/{EndpointFactory-DCmnCmkX.d.mts.map → EndpointFactory-CIM80WIK.d.mts.map} +1 -1
  15. package/dist/{EndpointFactory-cVTb8kCc.d.cts → EndpointFactory-CfBg6jJE.d.cts} +5 -5
  16. package/dist/{EndpointFactory-cVTb8kCc.d.cts.map → EndpointFactory-CfBg6jJE.d.cts.map} +1 -1
  17. package/dist/{ObjectSubscriberBuilder-AwGKoUKy.d.mts → ObjectSubscriberBuilder-Ci_Cc-WZ.d.mts} +2 -2
  18. package/dist/{ObjectSubscriberBuilder-AwGKoUKy.d.mts.map → ObjectSubscriberBuilder-Ci_Cc-WZ.d.mts.map} +1 -1
  19. package/dist/{ObjectSubscriberBuilder-CB6imsX4.d.cts → ObjectSubscriberBuilder-DWtLxfAJ.d.cts} +2 -2
  20. package/dist/{ObjectSubscriberBuilder-CB6imsX4.d.cts.map → ObjectSubscriberBuilder-DWtLxfAJ.d.cts.map} +1 -1
  21. package/dist/{ProcessorBuilder-CwIlm75W.d.mts → ProcessorBuilder-CdLwJK4k.d.mts} +2 -2
  22. package/dist/{ProcessorBuilder-CeEZ2vCx.d.cts.map → ProcessorBuilder-CdLwJK4k.d.mts.map} +1 -1
  23. package/dist/{ProcessorBuilder-CeEZ2vCx.d.cts → ProcessorBuilder-ClD7tmEe.d.cts} +2 -2
  24. package/dist/{ProcessorBuilder-CwIlm75W.d.mts.map → ProcessorBuilder-ClD7tmEe.d.cts.map} +1 -1
  25. package/dist/{QueueBuilder-CUERv8jt.d.mts → QueueBuilder-CjULiiDN.d.mts} +2 -2
  26. package/dist/{QueueBuilder-CUERv8jt.d.mts.map → QueueBuilder-CjULiiDN.d.mts.map} +1 -1
  27. package/dist/{QueueBuilder-CmB1vOgn.d.cts → QueueBuilder-Dacm9qAv.d.cts} +2 -2
  28. package/dist/{QueueBuilder-CmB1vOgn.d.cts.map → QueueBuilder-Dacm9qAv.d.cts.map} +1 -1
  29. package/dist/adaptors/aws.d.cts +2 -2
  30. package/dist/adaptors/aws.d.mts +2 -2
  31. package/dist/adaptors/awsWebsocket.d.cts +1 -1
  32. package/dist/adaptors/awsWebsocket.d.mts +1 -1
  33. package/dist/adaptors/hono.d.cts +1 -1
  34. package/dist/adaptors/hono.d.mts +1 -1
  35. package/dist/adaptors/testing.d.cts +5 -5
  36. package/dist/adaptors/testing.d.mts +5 -5
  37. package/dist/{auth-1yI2wR-4.d.cts → auth-CutSfNlr.d.mts} +6 -6
  38. package/dist/{auth-1yI2wR-4.d.cts.map → auth-CutSfNlr.d.mts.map} +1 -1
  39. package/dist/{auth-D4NMXgLt.d.mts → auth-b9ADezz9.d.cts} +6 -6
  40. package/dist/{auth-D4NMXgLt.d.mts.map → auth-b9ADezz9.d.cts.map} +1 -1
  41. package/dist/auth.d.cts +1 -1
  42. package/dist/auth.d.mts +1 -1
  43. package/dist/{cache-0VoeOTF9.d.mts → cache-9wLNSy3O.d.cts} +3 -3
  44. package/dist/{cache-0VoeOTF9.d.mts.map → cache-9wLNSy3O.d.cts.map} +1 -1
  45. package/dist/{cache-CW-sArzS.d.cts → cache-BFPs_CGs.d.mts} +3 -3
  46. package/dist/{cache-CW-sArzS.d.cts.map → cache-BFPs_CGs.d.mts.map} +1 -1
  47. package/dist/cache.d.cts +1 -1
  48. package/dist/cache.d.mts +1 -1
  49. package/dist/{construct-interface-DhbaONW2.d.cts → construct-interface-CVoejIpo.d.cts} +20 -4
  50. package/dist/construct-interface-CVoejIpo.d.cts.map +1 -0
  51. package/dist/{construct-interface-DxfkFxkl.d.mts → construct-interface-Nw5Dt9AC.d.mts} +20 -4
  52. package/dist/construct-interface-Nw5Dt9AC.d.mts.map +1 -0
  53. package/dist/construct-interface.cjs +17 -2
  54. package/dist/construct-interface.cjs.map +1 -1
  55. package/dist/construct-interface.d.cts +2 -2
  56. package/dist/construct-interface.d.mts +2 -2
  57. package/dist/construct-interface.mjs +17 -3
  58. package/dist/construct-interface.mjs.map +1 -1
  59. package/dist/credential.d.cts +1 -1
  60. package/dist/credential.d.mts +1 -1
  61. package/dist/crons/index.d.cts +2 -2
  62. package/dist/crons/index.d.mts +2 -2
  63. package/dist/database/kysely.d.cts +1 -1
  64. package/dist/database/kysely.d.mts +1 -1
  65. package/dist/email.d.cts +1 -1
  66. package/dist/email.d.mts +1 -1
  67. package/dist/encryption.d.cts +1 -1
  68. package/dist/encryption.d.mts +1 -1
  69. package/dist/endpoints/index.d.cts +2 -2
  70. package/dist/endpoints/index.d.mts +2 -2
  71. package/dist/external-api.d.cts +1 -1
  72. package/dist/external-api.d.mts +1 -1
  73. package/dist/{fake-Djx8E0o1.d.cts → fake-JI5uN1SF.d.cts} +2 -2
  74. package/dist/{fake-BvOXkZmj.d.mts.map → fake-JI5uN1SF.d.cts.map} +1 -1
  75. package/dist/{fake-BvOXkZmj.d.mts → fake-zpuXpBmY.d.mts} +2 -2
  76. package/dist/{fake-Djx8E0o1.d.cts.map → fake-zpuXpBmY.d.mts.map} +1 -1
  77. package/dist/file-server.cjs +6 -37
  78. package/dist/file-server.cjs.map +1 -1
  79. package/dist/file-server.d.cts +4 -4
  80. package/dist/file-server.d.cts.map +1 -1
  81. package/dist/file-server.d.mts +4 -4
  82. package/dist/file-server.d.mts.map +1 -1
  83. package/dist/file-server.mjs +4 -35
  84. package/dist/file-server.mjs.map +1 -1
  85. package/dist/functions/index.d.cts +1 -1
  86. package/dist/functions/index.d.mts +1 -1
  87. package/dist/{inbox-BjvMs7EJ.d.cts → inbox-CXLU7h_8.d.cts} +2 -2
  88. package/dist/{inbox-BjvMs7EJ.d.cts.map → inbox-CXLU7h_8.d.cts.map} +1 -1
  89. package/dist/{inbox-C8bOR9UL.d.mts → inbox-DYFsLd9A.d.mts} +2 -2
  90. package/dist/{inbox-C8bOR9UL.d.mts.map → inbox-DYFsLd9A.d.mts.map} +1 -1
  91. package/dist/inbox.d.cts +1 -1
  92. package/dist/inbox.d.mts +1 -1
  93. package/dist/{index-vCS4HBEG.d.mts → index-BpE9_6l5.d.mts} +2 -2
  94. package/dist/{index-DaK-C7N3.d.cts.map → index-BpE9_6l5.d.mts.map} +1 -1
  95. package/dist/{index-DaK-C7N3.d.cts → index-zRChehJ9.d.cts} +2 -2
  96. package/dist/{index-vCS4HBEG.d.mts.map → index-zRChehJ9.d.cts.map} +1 -1
  97. package/dist/{kysely-BGvpd_ZH.d.mts → kysely-5PAqFBzo.d.mts} +3 -3
  98. package/dist/{kysely-2HqIQ2fC.d.cts.map → kysely-5PAqFBzo.d.mts.map} +1 -1
  99. package/dist/{kysely-2HqIQ2fC.d.cts → kysely-lxNUBSTP.d.cts} +3 -3
  100. package/dist/{kysely-BGvpd_ZH.d.mts.map → kysely-lxNUBSTP.d.cts.map} +1 -1
  101. package/dist/mobile-app.cjs +2 -1
  102. package/dist/mobile-app.cjs.map +1 -1
  103. package/dist/mobile-app.d.cts +3 -2
  104. package/dist/mobile-app.d.cts.map +1 -1
  105. package/dist/mobile-app.d.mts +3 -2
  106. package/dist/mobile-app.d.mts.map +1 -1
  107. package/dist/mobile-app.mjs +2 -1
  108. package/dist/mobile-app.mjs.map +1 -1
  109. package/dist/object-storage.cjs +42 -6
  110. package/dist/object-storage.cjs.map +1 -1
  111. package/dist/object-storage.d.cts +27 -2
  112. package/dist/object-storage.d.cts.map +1 -1
  113. package/dist/object-storage.d.mts +27 -2
  114. package/dist/object-storage.d.mts.map +1 -1
  115. package/dist/object-storage.mjs +39 -4
  116. package/dist/object-storage.mjs.map +1 -1
  117. package/dist/processors/index.d.cts +1 -1
  118. package/dist/processors/index.d.mts +1 -1
  119. package/dist/queue/index.d.cts +1 -1
  120. package/dist/queue/index.d.mts +1 -1
  121. package/dist/random-password.d.cts +1 -1
  122. package/dist/random-password.d.mts +1 -1
  123. package/dist/{expire-CieftS01.cjs → readOnlyStorage-C7bCe-z5.cjs} +35 -1
  124. package/dist/readOnlyStorage-C7bCe-z5.cjs.map +1 -0
  125. package/dist/{expire-CpzUAfr9.mjs → readOnlyStorage-DMCeLuS2.mjs} +30 -2
  126. package/dist/readOnlyStorage-DMCeLuS2.mjs.map +1 -0
  127. package/dist/rest-api.d.cts +4 -4
  128. package/dist/rest-api.d.mts +4 -4
  129. package/dist/site.cjs +5 -2
  130. package/dist/site.cjs.map +1 -1
  131. package/dist/site.d.cts +7 -4
  132. package/dist/site.d.cts.map +1 -1
  133. package/dist/site.d.mts +7 -4
  134. package/dist/site.d.mts.map +1 -1
  135. package/dist/site.mjs +5 -2
  136. package/dist/site.mjs.map +1 -1
  137. package/dist/subscribers/index.d.cts +1 -1
  138. package/dist/subscribers/index.d.mts +1 -1
  139. package/dist/{telemetry-DjJgtQ_N.d.cts → telemetry-BbLyS7ln.d.cts} +22 -5
  140. package/dist/telemetry-BbLyS7ln.d.cts.map +1 -0
  141. package/dist/{telemetry-BirKau0X.d.mts → telemetry-DWX-qKUh.d.mts} +22 -5
  142. package/dist/telemetry-DWX-qKUh.d.mts.map +1 -0
  143. package/dist/telemetry.cjs +11 -3
  144. package/dist/telemetry.cjs.map +1 -1
  145. package/dist/telemetry.d.cts +1 -1
  146. package/dist/telemetry.d.mts +1 -1
  147. package/dist/telemetry.mjs +12 -4
  148. package/dist/telemetry.mjs.map +1 -1
  149. package/dist/{websocket-api-CD-E5Ogr.d.cts → websocket-api-9ndLBolx.d.cts} +3 -3
  150. package/dist/{websocket-api-CD-E5Ogr.d.cts.map → websocket-api-9ndLBolx.d.cts.map} +1 -1
  151. package/dist/{websocket-api-pJJfeTcm.d.mts → websocket-api-BPPXF79i.d.mts} +3 -3
  152. package/dist/{websocket-api-pJJfeTcm.d.mts.map → websocket-api-BPPXF79i.d.mts.map} +1 -1
  153. package/dist/websocket-api.d.cts +1 -1
  154. package/dist/websocket-api.d.mts +1 -1
  155. package/dist/worker.d.cts +8 -8
  156. package/dist/worker.d.mts +8 -8
  157. package/package.json +31 -31
  158. package/dist/construct-interface-DhbaONW2.d.cts.map +0 -1
  159. package/dist/construct-interface-DxfkFxkl.d.mts.map +0 -1
  160. package/dist/expire-CieftS01.cjs.map +0 -1
  161. package/dist/expire-CpzUAfr9.mjs.map +0 -1
  162. package/dist/telemetry-BirKau0X.d.mts.map +0 -1
  163. package/dist/telemetry-DjJgtQ_N.d.cts.map +0 -1
@@ -2,14 +2,14 @@ import { n as StandardSchemaV1 } from "../index-DdRjYhiJ.mjs";
2
2
  import "../Construct-BMk_CRSD.mjs";
3
3
  import { n as Function } from "../Function-BKReud5p.mjs";
4
4
  import { t as HttpMethod } from "../types-DMuSQeLL.mjs";
5
- import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-DC7mreOr.mjs";
5
+ import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-CIDUreMW.mjs";
6
6
  import { t as Queue } from "../Queue-B8HGg439.mjs";
7
7
  import { t as Subscriber } from "../Subscriber-CtQXhcL7.mjs";
8
- import { J as RecordedBroadcast, R as Connection, Y as RecordedClose, Z as RecordedSend, _t as WebSocketPublisher, gt as WebSocketMessages, it as TestWebSocketPublisher, mt as NoMessages, q as InvalidWebSocketRequest, r as WebSocketApi } from "../websocket-api-pJJfeTcm.mjs";
9
- import { t as KyselyDatabase } from "../kysely-BGvpd_ZH.mjs";
10
- import { t as Fake } from "../fake-BvOXkZmj.mjs";
8
+ import { J as RecordedBroadcast, R as Connection, Y as RecordedClose, Z as RecordedSend, _t as WebSocketPublisher, gt as WebSocketMessages, it as TestWebSocketPublisher, mt as NoMessages, q as InvalidWebSocketRequest, r as WebSocketApi } from "../websocket-api-BPPXF79i.mjs";
9
+ import { t as KyselyDatabase } from "../kysely-5PAqFBzo.mjs";
10
+ import { t as Fake } from "../fake-zpuXpBmY.mjs";
11
11
  import { o as TestStage } from "../stages-DaTaoQei.mjs";
12
- import { p as Verdicts } from "../inbox-C8bOR9UL.mjs";
12
+ import { p as Verdicts } from "../inbox-DYFsLd9A.mjs";
13
13
  import { InboxAddressing } from "@geekmidas/manifest";
14
14
  import { EventPublisher, ExtractPublisherMessage } from "@geekmidas/events";
15
15
  import { Service, ServiceDiscovery, ServiceRecord } from "@geekmidas/services";
@@ -1,10 +1,10 @@
1
- import { l as ServicesOf, n as Construct, r as Consumable, t as Authenticator } from "./construct-interface-DhbaONW2.cjs";
2
- import { n as Telemetry } from "./telemetry-DjJgtQ_N.cjs";
3
- import { EnvironmentParser } from "@geekmidas/envkit";
4
- import { Service, ServiceRecord, ServiceRegisterOptions } from "@geekmidas/services";
1
+ import { n as Construct, r as Consumable, t as Authenticator, u as ServicesOf } from "./construct-interface-Nw5Dt9AC.mjs";
2
+ import { n as Telemetry } from "./telemetry-DWX-qKUh.mjs";
5
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
6
- import { betterAuth } from "better-auth";
4
+ import { Service, ServiceRecord, ServiceRegisterOptions } from "@geekmidas/services";
5
+ import { EnvironmentParser } from "@geekmidas/envkit";
7
6
  import { Hono } from "hono";
7
+ import { betterAuth } from "better-auth";
8
8
  //#region src/auth.d.ts
9
9
  /** The server better-auth hands back. */
10
10
  type AuthServer = ReturnType<typeof betterAuth>;
@@ -271,4 +271,4 @@ declare function withTrustedClientIp(request: Request, remoteAddress: string | u
271
271
  edgeToken?: string): Request;
272
272
  //#endregion
273
273
  export { BetterAuth as a, BetterAuthOptionsContext as c, deviceLink as d, idempotent as f, AuthSession as i, ExpoPluginRequired as l, AuthServer as n, BetterAuthConfig as o, withTrustedClientIp as p, AuthServerUnreachable as r, BetterAuthOptions as s, AuthClient as t, SessionCheckFailed as u };
274
- //# sourceMappingURL=auth-1yI2wR-4.d.cts.map
274
+ //# sourceMappingURL=auth-CutSfNlr.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-1yI2wR-4.d.cts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;;KAqEY,aAAa,kBAAkB;;KAG/B,cAAc;;;;;;;;;;UAWT;WACP;;;;;;;;;;;IAWR,WAAW;MACV,SAAS,6BAA6B;QACnC,QAAQ;;;;KAKF,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;EAMA;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;EAMZ,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBA+BtC;WA7BT,IAAI;;;;;;;;;;;;WAYJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;EAiDL,OACL,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;EAWX,OAAO,WAAW,wBAAwB;;;;;MAqBtC;;;;;;;;;;;;;EAgBE,iBACL,SAAS,yBACP;;;;;;;;;;;;;;;;;;;;;;;;;EAsDG,OACL,SAAS,yBACP;IAAU,KAAK;IAAM,MAAM;;;;;;;EA2DxB,UAAU,SAAS,yBAAyB;;UAMpC;UAuBA;;;;;;;UAmBA;;;iBAgKC,WAAW,aAAa;;cAY3B,2BAA2B;WAE7B;;WAEA;EAHV,YACU,gBAEA;;EAAA;;;cAgFE,2BAA2B;WAE7B;WACA;EAFV,YACU,uBACA;;;cAYE,8BAA8B;WAEhC;WACA;EAFV,YACU,uBACA,aACT;;;;;;;;;;;iBAqBc,WAAW;;;;;;;;;;;iBAgCX,oBACf,SAAS,SACT,mCAMA;;;;;;AAAA,qBACE"}
1
+ {"version":3,"file":"auth-CutSfNlr.d.mts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;;KAqEY,aAAa,kBAAkB;;KAG/B,cAAc;;;;;;;;;;UAWT;WACP;;;;;;;;;;;IAWR,WAAW;MACV,SAAS,6BAA6B;QACnC,QAAQ;;;;KAKF,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;EAMA;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;EAMZ,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBA+BtC;WA7BT,IAAI;;;;;;;;;;;;WAYJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;EAiDL,OACL,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;EAWX,OAAO,WAAW,wBAAwB;;;;;MAqBtC;;;;;;;;;;;;;EAgBE,iBACL,SAAS,yBACP;;;;;;;;;;;;;;;;;;;;;;;;;EAsDG,OACL,SAAS,yBACP;IAAU,KAAK;IAAM,MAAM;;;;;;;EA2DxB,UAAU,SAAS,yBAAyB;;UAMpC;UAuBA;;;;;;;UAmBA;;;iBAgKC,WAAW,aAAa;;cAY3B,2BAA2B;WAE7B;;WAEA;EAHV,YACU,gBAEA;;EAAA;;;cAgFE,2BAA2B;WAE7B;WACA;EAFV,YACU,uBACA;;;cAYE,8BAA8B;WAEhC;WACA;EAFV,YACU,uBACA,aACT;;;;;;;;;;;iBAqBc,WAAW;;;;;;;;;;;iBAgCX,oBACf,SAAS,SACT,mCAMA;;;;;;AAAA,qBACE"}
@@ -1,10 +1,10 @@
1
- import { l as ServicesOf, n as Construct, r as Consumable, t as Authenticator } from "./construct-interface-DxfkFxkl.mjs";
2
- import { n as Telemetry } from "./telemetry-BirKau0X.mjs";
3
- import { ConstructName, Declaration } from "@geekmidas/manifest";
4
- import { Service, ServiceRecord, ServiceRegisterOptions } from "@geekmidas/services";
1
+ import { n as Construct, r as Consumable, t as Authenticator, u as ServicesOf } from "./construct-interface-CVoejIpo.cjs";
2
+ import { n as Telemetry } from "./telemetry-BbLyS7ln.cjs";
5
3
  import { EnvironmentParser } from "@geekmidas/envkit";
6
- import { Hono } from "hono";
4
+ import { Service, ServiceRecord, ServiceRegisterOptions } from "@geekmidas/services";
5
+ import { ConstructName, Declaration } from "@geekmidas/manifest";
7
6
  import { betterAuth } from "better-auth";
7
+ import { Hono } from "hono";
8
8
  //#region src/auth.d.ts
9
9
  /** The server better-auth hands back. */
10
10
  type AuthServer = ReturnType<typeof betterAuth>;
@@ -271,4 +271,4 @@ declare function withTrustedClientIp(request: Request, remoteAddress: string | u
271
271
  edgeToken?: string): Request;
272
272
  //#endregion
273
273
  export { BetterAuth as a, BetterAuthOptionsContext as c, deviceLink as d, idempotent as f, AuthSession as i, ExpoPluginRequired as l, AuthServer as n, BetterAuthConfig as o, withTrustedClientIp as p, AuthServerUnreachable as r, BetterAuthOptions as s, AuthClient as t, SessionCheckFailed as u };
274
- //# sourceMappingURL=auth-D4NMXgLt.d.mts.map
274
+ //# sourceMappingURL=auth-b9ADezz9.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-D4NMXgLt.d.mts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;;KAqEY,aAAa,kBAAkB;;KAG/B,cAAc;;;;;;;;;;UAWT;WACP;;;;;;;;;;;IAWR,WAAW;MACV,SAAS,6BAA6B;QACnC,QAAQ;;;;KAKF,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;EAMA;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;EAMZ,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBA+BtC;WA7BT,IAAI;;;;;;;;;;;;WAYJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;EAiDL,OACL,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;EAWX,OAAO,WAAW,wBAAwB;;;;;MAqBtC;;;;;;;;;;;;;EAgBE,iBACL,SAAS,yBACP;;;;;;;;;;;;;;;;;;;;;;;;;EAsDG,OACL,SAAS,yBACP;IAAU,KAAK;IAAM,MAAM;;;;;;;EA2DxB,UAAU,SAAS,yBAAyB;;UAMpC;UAuBA;;;;;;;UAmBA;;;iBAgKC,WAAW,aAAa;;cAY3B,2BAA2B;WAE7B;;WAEA;EAHV,YACU,gBAEA;;EAAA;;;cAgFE,2BAA2B;WAE7B;WACA;EAFV,YACU,uBACA;;;cAYE,8BAA8B;WAEhC;WACA;EAFV,YACU,uBACA,aACT;;;;;;;;;;;iBAqBc,WAAW;;;;;;;;;;;iBAgCX,oBACf,SAAS,SACT,mCAMA;;;;;;AAAA,qBACE"}
1
+ {"version":3,"file":"auth-b9ADezz9.d.cts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;;KAqEY,aAAa,kBAAkB;;KAG/B,cAAc;;;;;;;;;;UAWT;WACP;;;;;;;;;;;IAWR,WAAW;MACV,SAAS,6BAA6B;QACnC,QAAQ;;;;KAKF,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;EAMA;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;EAMZ,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBA+BtC;WA7BT,IAAI;;;;;;;;;;;;WAYJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;EAiDL,OACL,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;EAWX,OAAO,WAAW,wBAAwB;;;;;MAqBtC;;;;;;;;;;;;;EAgBE,iBACL,SAAS,yBACP;;;;;;;;;;;;;;;;;;;;;;;;;EAsDG,OACL,SAAS,yBACP;IAAU,KAAK;IAAM,MAAM;;;;;;;EA2DxB,UAAU,SAAS,yBAAyB;;UAMpC;UAuBA;;;;;;;UAmBA;;;iBAgKC,WAAW,aAAa;;cAY3B,2BAA2B;WAE7B;;WAEA;EAHV,YACU,gBAEA;;EAAA;;;cAgFE,2BAA2B;WAE7B;WACA;EAFV,YACU,uBACA;;;cAYE,8BAA8B;WAEhC;WACA;EAFV,YACU,uBACA,aACT;;;;;;;;;;;iBAqBc,WAAW;;;;;;;;;;;iBAgCX,oBACf,SAAS,SACT,mCAMA;;;;;;AAAA,qBACE"}
package/dist/auth.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as BetterAuth, c as BetterAuthOptionsContext, d as deviceLink, f as idempotent, i as AuthSession, l as ExpoPluginRequired, n as AuthServer, o as BetterAuthConfig, p as withTrustedClientIp, r as AuthServerUnreachable, s as BetterAuthOptions, t as AuthClient, u as SessionCheckFailed } from "./auth-1yI2wR-4.cjs";
1
+ import { a as BetterAuth, c as BetterAuthOptionsContext, d as deviceLink, f as idempotent, i as AuthSession, l as ExpoPluginRequired, n as AuthServer, o as BetterAuthConfig, p as withTrustedClientIp, r as AuthServerUnreachable, s as BetterAuthOptions, t as AuthClient, u as SessionCheckFailed } from "./auth-b9ADezz9.cjs";
2
2
  export { AuthClient, AuthServer, AuthServerUnreachable, AuthSession, BetterAuth, BetterAuthConfig, BetterAuthOptions, BetterAuthOptionsContext, ExpoPluginRequired, SessionCheckFailed, deviceLink, idempotent, withTrustedClientIp };
package/dist/auth.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as BetterAuth, c as BetterAuthOptionsContext, d as deviceLink, f as idempotent, i as AuthSession, l as ExpoPluginRequired, n as AuthServer, o as BetterAuthConfig, p as withTrustedClientIp, r as AuthServerUnreachable, s as BetterAuthOptions, t as AuthClient, u as SessionCheckFailed } from "./auth-D4NMXgLt.mjs";
1
+ import { a as BetterAuth, c as BetterAuthOptionsContext, d as deviceLink, f as idempotent, i as AuthSession, l as ExpoPluginRequired, n as AuthServer, o as BetterAuthConfig, p as withTrustedClientIp, r as AuthServerUnreachable, s as BetterAuthOptions, t as AuthClient, u as SessionCheckFailed } from "./auth-CutSfNlr.mjs";
2
2
  export { AuthClient, AuthServer, AuthServerUnreachable, AuthSession, BetterAuth, BetterAuthConfig, BetterAuthOptions, BetterAuthOptionsContext, ExpoPluginRequired, SessionCheckFailed, deviceLink, idempotent, withTrustedClientIp };
@@ -1,6 +1,6 @@
1
- import { n as Construct } from "./construct-interface-DxfkFxkl.mjs";
2
- import { ConstructName, Declaration } from "@geekmidas/manifest";
1
+ import { n as Construct } from "./construct-interface-CVoejIpo.cjs";
3
2
  import { Service } from "@geekmidas/services";
3
+ import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { Cache } from "@geekmidas/cache";
5
5
  //#region src/cache.d.ts
6
6
  interface CacheOptions {
@@ -41,4 +41,4 @@ declare class Cache$1<TName extends string = string> implements Construct<TName,
41
41
  }
42
42
  //#endregion
43
43
  export { CacheOptions as n, Cache$1 as t };
44
- //# sourceMappingURL=cache-0VoeOTF9.d.mts.map
44
+ //# sourceMappingURL=cache-9wLNSy3O.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache-0VoeOTF9.d.mts","names":["Cache","CacheClient"],"sources":["../src/cache.ts"],"mappings":";;;;;UA8BiB;;;;;;;;EAQhB;;EAEA;;cAGYA,QAAM,0CACP,UAAU,OAAOC;mBAaV;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQA;;;;;mBAM9B;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAc3B,WAAW;;;;;;;;;;;;UAuBG"}
1
+ {"version":3,"file":"cache-9wLNSy3O.d.cts","names":["Cache","CacheClient"],"sources":["../src/cache.ts"],"mappings":";;;;;UA8BiB;;;;;;;;EAQhB;;EAEA;;cAGYA,QAAM,0CACP,UAAU,OAAOC;mBAaV;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQA;;;;;mBAM9B;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAc3B,WAAW;;;;;;;;;;;;UAuBG"}
@@ -1,6 +1,6 @@
1
- import { n as Construct } from "./construct-interface-DhbaONW2.cjs";
2
- import { Service } from "@geekmidas/services";
1
+ import { n as Construct } from "./construct-interface-Nw5Dt9AC.mjs";
3
2
  import { ConstructName, Declaration } from "@geekmidas/manifest";
3
+ import { Service } from "@geekmidas/services";
4
4
  import { Cache } from "@geekmidas/cache";
5
5
  //#region src/cache.d.ts
6
6
  interface CacheOptions {
@@ -41,4 +41,4 @@ declare class Cache$1<TName extends string = string> implements Construct<TName,
41
41
  }
42
42
  //#endregion
43
43
  export { CacheOptions as n, Cache$1 as t };
44
- //# sourceMappingURL=cache-CW-sArzS.d.cts.map
44
+ //# sourceMappingURL=cache-BFPs_CGs.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache-CW-sArzS.d.cts","names":["Cache","CacheClient"],"sources":["../src/cache.ts"],"mappings":";;;;;UA8BiB;;;;;;;;EAQhB;;EAEA;;cAGYA,QAAM,0CACP,UAAU,OAAOC;mBAaV;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQA;;;;;mBAM9B;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAc3B,WAAW;;;;;;;;;;;;UAuBG"}
1
+ {"version":3,"file":"cache-BFPs_CGs.d.mts","names":["Cache","CacheClient"],"sources":["../src/cache.ts"],"mappings":";;;;;UA8BiB;;;;;;;;EAQhB;;EAEA;;cAGYA,QAAM,0CACP,UAAU,OAAOC;mBAaV;WAXT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQA;;;;;mBAM9B;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAc3B,WAAW;;;;;;;;;;;;UAuBG"}
package/dist/cache.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as CacheOptions, t as Cache } from "./cache-CW-sArzS.cjs";
1
+ import { n as CacheOptions, t as Cache } from "./cache-9wLNSy3O.cjs";
2
2
  export { Cache, CacheOptions };
package/dist/cache.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as CacheOptions, t as Cache } from "./cache-0VoeOTF9.mjs";
1
+ import { n as CacheOptions, t as Cache } from "./cache-BFPs_CGs.mjs";
2
2
  export { Cache, CacheOptions };
@@ -80,8 +80,24 @@ interface HasPublicFace {
80
80
  readonly publicFace: Declarable;
81
81
  }
82
82
  /**
83
- * The edge a frontend — a site or a mobile app — has to a construct: its
84
- * public face where it has one, the construct itself otherwise.
83
+ * A construct's server half, as a frontend names it: `documents.server`,
84
+ * `assets.server`.
85
+ *
86
+ * A `Declarable` and not a `Consumable`, so only a site or a mobile app can
87
+ * depend on it — a backend's plain edge is already the full one. A frontend's
88
+ * plain edge to a bucket holds where its links are signed and nothing that
89
+ * writes to it; this one hands its server half the connection and the key
90
+ * pair too.
91
+ */
92
+ interface ServerHalf extends Declarable {
93
+ readonly serverHalf: true;
94
+ }
95
+ /** `construct`, as the server half a frontend's edge can name. */
96
+ declare function serverHalfOf(construct: Declarable): ServerHalf;
97
+ /**
98
+ * The edge a frontend — a site or a mobile app — has to a construct: to its
99
+ * server half when it named one (`.server`, marked `server: true`), to its
100
+ * public face where it has one, to the construct itself otherwise.
85
101
  */
86
102
  declare function frontendEdgeTo(construct: Declarable): Dependency;
87
103
  /** What consuming a construct hands you. */
@@ -179,5 +195,5 @@ declare function serviceOf<TName extends string, TClient>(source: Consumable<TNa
179
195
  */
180
196
  declare function publicUrl(options: ServiceRegisterOptions, key: string): string;
181
197
  //#endregion
182
- export { servicesOf as _, HasPublicFace as a, NotAConstruct as c, edgeTo as d, frontendEdgeTo as f, serviceOf as g, publicUrl as h, Declarable as i, ServicesOf as l, isConsumable as m, Construct as n, Infer as o, idsOf as p, Consumable as r, NameOf as s, Authenticator as t, databaseEdges as u };
183
- //# sourceMappingURL=construct-interface-DhbaONW2.d.cts.map
198
+ export { serverHalfOf as _, HasPublicFace as a, NotAConstruct as c, databaseEdges as d, edgeTo as f, publicUrl as g, isConsumable as h, Declarable as i, ServerHalf as l, idsOf as m, Construct as n, Infer as o, frontendEdgeTo as p, Consumable as r, NameOf as s, Authenticator as t, ServicesOf as u, serviceOf as v, servicesOf as y };
199
+ //# sourceMappingURL=construct-interface-CVoejIpo.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"construct-interface-CVoejIpo.d.cts","names":[],"sources":["../src/construct-interface.ts"],"mappings":";;;;;;;;;;;;;UA8BiB,UAAU,+BAA+B;;WAEhD,IAAI;;;;;;;;EASb,WAAW;;;;;;;;WASF,UAAU,mCAEhB,QAAQ,aAAa,QAAQ;;;;;;;;;;;UAYhB,WAAW;WAClB,IAAI;EACb,WAAW;;;;;;;;;;UAWK,cAAc,4BAA4B;EAC1D,OACC,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;;;;;;;iBAeI,OAAO,WAAW,aAAa;;;;;;;;;UAkB9B;WACP,YAAY;;;;;;;;;;;;UAaL,mBAAmB;WAC1B;;;iBAIM,aAAa,WAAW,aAAa;;;;;;iBAcrC,eAAe,WAAW,aAAa;;KAS3C,MAAM,KACjB,UAAU,wBAAwB,WAAW;;KAGlC,OAAO,KAClB,UAAU,gBAAgB,kBAAkB;;;;;;;;;;;UAY5B,WAAW,+BAA+B;WACjD,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;EAC/C,WAAW;;;;;;;;;;KAWA,WAAW,mBAAmB,mBACxC,WAAW,IAAI,EAAE;;;;;;;;iBAUH,iBAAiB,mBAAmB,cACnD,YAAY,IACV,WAAW;;;;;;;;;;iBAiBE,MACf,qBAAqB,cACrB;;;;;;;;;;;;;;iBAkBe,cACf;EACC;EACA;EACA,SAAS;EACT,mBAAmB;GAEpB;EACI;EAAuB;;;cAgBf,sBAAsB;WACb;EAArB,YAAqB;;;;;;;;;iBAqBN,aAAa,iBAAiB,SAAS;;;;;;;;iBAmBvC,UAAU,sBAAsB,SAC/C,QAAQ,WAAW,OAAO,WAAW,QAAQ,OAAO,WAClD,QAAQ,OAAO;;;;;iBAYF,UACf,SAAS,wBACT"}
@@ -80,8 +80,24 @@ interface HasPublicFace {
80
80
  readonly publicFace: Declarable;
81
81
  }
82
82
  /**
83
- * The edge a frontend — a site or a mobile app — has to a construct: its
84
- * public face where it has one, the construct itself otherwise.
83
+ * A construct's server half, as a frontend names it: `documents.server`,
84
+ * `assets.server`.
85
+ *
86
+ * A `Declarable` and not a `Consumable`, so only a site or a mobile app can
87
+ * depend on it — a backend's plain edge is already the full one. A frontend's
88
+ * plain edge to a bucket holds where its links are signed and nothing that
89
+ * writes to it; this one hands its server half the connection and the key
90
+ * pair too.
91
+ */
92
+ interface ServerHalf extends Declarable {
93
+ readonly serverHalf: true;
94
+ }
95
+ /** `construct`, as the server half a frontend's edge can name. */
96
+ declare function serverHalfOf(construct: Declarable): ServerHalf;
97
+ /**
98
+ * The edge a frontend — a site or a mobile app — has to a construct: to its
99
+ * server half when it named one (`.server`, marked `server: true`), to its
100
+ * public face where it has one, to the construct itself otherwise.
85
101
  */
86
102
  declare function frontendEdgeTo(construct: Declarable): Dependency;
87
103
  /** What consuming a construct hands you. */
@@ -179,5 +195,5 @@ declare function serviceOf<TName extends string, TClient>(source: Consumable<TNa
179
195
  */
180
196
  declare function publicUrl(options: ServiceRegisterOptions, key: string): string;
181
197
  //#endregion
182
- export { servicesOf as _, HasPublicFace as a, NotAConstruct as c, edgeTo as d, frontendEdgeTo as f, serviceOf as g, publicUrl as h, Declarable as i, ServicesOf as l, isConsumable as m, Construct as n, Infer as o, idsOf as p, Consumable as r, NameOf as s, Authenticator as t, databaseEdges as u };
183
- //# sourceMappingURL=construct-interface-DxfkFxkl.d.mts.map
198
+ export { serverHalfOf as _, HasPublicFace as a, NotAConstruct as c, databaseEdges as d, edgeTo as f, publicUrl as g, isConsumable as h, Declarable as i, ServerHalf as l, idsOf as m, Construct as n, Infer as o, frontendEdgeTo as p, Consumable as r, NameOf as s, Authenticator as t, ServicesOf as u, serviceOf as v, servicesOf as y };
199
+ //# sourceMappingURL=construct-interface-Nw5Dt9AC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"construct-interface-Nw5Dt9AC.d.mts","names":[],"sources":["../src/construct-interface.ts"],"mappings":";;;;;;;;;;;;;UA8BiB,UAAU,+BAA+B;;WAEhD,IAAI;;;;;;;;EASb,WAAW;;;;;;;;WASF,UAAU,mCAEhB,QAAQ,aAAa,QAAQ;;;;;;;;;;;UAYhB,WAAW;WAClB,IAAI;EACb,WAAW;;;;;;;;;;UAWK,cAAc,4BAA4B;EAC1D,OACC,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;;;;;;;;;;iBAeI,OAAO,WAAW,aAAa;;;;;;;;;UAkB9B;WACP,YAAY;;;;;;;;;;;;UAaL,mBAAmB;WAC1B;;;iBAIM,aAAa,WAAW,aAAa;;;;;;iBAcrC,eAAe,WAAW,aAAa;;KAS3C,MAAM,KACjB,UAAU,wBAAwB,WAAW;;KAGlC,OAAO,KAClB,UAAU,gBAAgB,kBAAkB;;;;;;;;;;;UAY5B,WAAW,+BAA+B;WACjD,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;EAC/C,WAAW;;;;;;;;;;KAWA,WAAW,mBAAmB,mBACxC,WAAW,IAAI,EAAE;;;;;;;;iBAUH,iBAAiB,mBAAmB,cACnD,YAAY,IACV,WAAW;;;;;;;;;;iBAiBE,MACf,qBAAqB,cACrB;;;;;;;;;;;;;;iBAkBe,cACf;EACC;EACA;EACA,SAAS;EACT,mBAAmB;GAEpB;EACI;EAAuB;;;cAgBf,sBAAsB;WACb;EAArB,YAAqB;;;;;;;;;iBAqBN,aAAa,iBAAiB,SAAS;;;;;;;;iBAmBvC,UAAU,sBAAsB,SAC/C,QAAQ,WAAW,OAAO,WAAW,QAAQ,OAAO,WAClD,QAAQ,OAAO;;;;;iBAYF,UACf,SAAS,wBACT"}
@@ -20,11 +20,25 @@ function edgeTo(construct) {
20
20
  kind: canonical.kind
21
21
  };
22
22
  }
23
+ /** `construct`, as the server half a frontend's edge can name. */
24
+ function serverHalfOf(construct) {
25
+ const declarations = construct.declare();
26
+ return {
27
+ id: construct.id,
28
+ declare: () => declarations,
29
+ serverHalf: true
30
+ };
31
+ }
23
32
  /**
24
- * The edge a frontend — a site or a mobile app — has to a construct: its
25
- * public face where it has one, the construct itself otherwise.
33
+ * The edge a frontend — a site or a mobile app — has to a construct: to its
34
+ * server half when it named one (`.server`, marked `server: true`), to its
35
+ * public face where it has one, to the construct itself otherwise.
26
36
  */
27
37
  function frontendEdgeTo(construct) {
38
+ if (construct.serverHalf) return {
39
+ ...edgeTo(construct),
40
+ server: true
41
+ };
28
42
  const face = construct.publicFace;
29
43
  return edgeTo(face ?? construct);
30
44
  }
@@ -125,6 +139,7 @@ exports.frontendEdgeTo = frontendEdgeTo;
125
139
  exports.idsOf = idsOf;
126
140
  exports.isConsumable = isConsumable;
127
141
  exports.publicUrl = publicUrl;
142
+ exports.serverHalfOf = serverHalfOf;
128
143
  exports.serviceOf = serviceOf;
129
144
  exports.servicesOf = servicesOf;
130
145
 
@@ -1 +1 @@
1
- {"version":3,"file":"construct-interface.cjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/**\n * A construct whose public half is a node of its own: what a site's or a\n * mobile app's plain edge points at instead of the construct itself.\n *\n * A `FileServer` is the one: its own node is the bucket, which presigns and\n * writes, and a frontend that only shows the objects needs the address they\n * are served on and nothing that can write to them.\n */\nexport interface HasPublicFace {\n\treadonly publicFace: Declarable;\n}\n\n/**\n * The edge a frontend — a site or a mobile app — has to a construct: its\n * public face where it has one, the construct itself otherwise.\n */\nexport function frontendEdgeTo(construct: Declarable): Dependency {\n\tconst face = (construct as Partial<HasPublicFace>).publicFace;\n\treturn edgeTo(face ?? construct);\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/**\n * The edges after `.database(source)` names a builder's database.\n *\n * A database replaces the one before it — a worker's default, overridden by a\n * runnable that names its own — so the edge the previous one added goes with\n * it. Left behind, a Lambda built from a queue that moved to another database\n * would still be granted the worker's.\n *\n * Only an edge `.database()` added is removed, which is why it is returned as\n * `_databaseEdge` for the next call to read — and not even that one when\n * `.dependsOn()` has since named the same construct, since the handler still\n * reaches it through `services`.\n */\nexport function databaseEdges(\n\tcurrent: {\n\t\tconstructs: readonly string[];\n\t\tedge: string | undefined;\n\t\tservice: Service | undefined;\n\t\tservices: readonly Service[];\n\t},\n\tsource: unknown,\n): { _constructs: string[]; _databaseEdge: string | undefined } {\n\tconst stillDependedOn =\n\t\tcurrent.service !== undefined && current.services.includes(current.service);\n\tconst kept =\n\t\tcurrent.edge && !stillDependedOn\n\t\t\t? current.constructs.filter((id) => id !== current.edge)\n\t\t\t: [...current.constructs];\n\n\tif (!isConsumable(source) || kept.includes(source.id)) {\n\t\treturn { _constructs: kept, _databaseEdge: undefined };\n\t}\n\n\treturn { _constructs: [...kept, source.id], _databaseEdge: source.id };\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n\n/**\n * A surface's or a site's public address, read from its `<ID>_URL` — the\n * client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.\n */\nexport function publicUrl(\n\toptions: ServiceRegisterOptions,\n\tkey: string,\n): string {\n\treturn options.envParser.create((get) => ({ url: get(key).string() })).parse()\n\t\t.url;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;AAkBA,SAAgB,eAAe,WAAmC;CACjE,MAAM,OAAQ,UAAqC;CACnD,OAAO,OAAO,QAAQ,SAAS;AAChC;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;;;;;;;;;;;;;AAeA,SAAgB,cACf,SAMA,QAC+D;CAC/D,MAAM,kBACL,QAAQ,YAAY,KAAA,KAAa,QAAQ,SAAS,SAAS,QAAQ,OAAO;CAC3E,MAAM,OACL,QAAQ,QAAQ,CAAC,kBACd,QAAQ,WAAW,QAAQ,OAAO,OAAO,QAAQ,IAAI,IACrD,CAAC,GAAG,QAAQ,UAAU;CAE1B,IAAI,CAAC,aAAa,MAAM,KAAK,KAAK,SAAS,OAAO,EAAE,GACnD,OAAO;EAAE,aAAa;EAAM,eAAe,KAAA;CAAU;CAGtD,OAAO;EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,EAAE;EAAG,eAAe,OAAO;CAAG;AACtE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL;;;;;AAMA,SAAgB,UACf,SACA,KACS;CACT,OAAO,QAAQ,UAAU,QAAQ,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAC5E;AACH"}
1
+ {"version":3,"file":"construct-interface.cjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/**\n * A construct whose public half is a node of its own: what a site's or a\n * mobile app's plain edge points at instead of the construct itself.\n *\n * A `FileServer` is the one: its own node is the bucket, which presigns and\n * writes, and a frontend that only shows the objects needs the address they\n * are served on and nothing that can write to them.\n */\nexport interface HasPublicFace {\n\treadonly publicFace: Declarable;\n}\n\n/**\n * A construct's server half, as a frontend names it: `documents.server`,\n * `assets.server`.\n *\n * A `Declarable` and not a `Consumable`, so only a site or a mobile app can\n * depend on it — a backend's plain edge is already the full one. A frontend's\n * plain edge to a bucket holds where its links are signed and nothing that\n * writes to it; this one hands its server half the connection and the key\n * pair too.\n */\nexport interface ServerHalf extends Declarable {\n\treadonly serverHalf: true;\n}\n\n/** `construct`, as the server half a frontend's edge can name. */\nexport function serverHalfOf(construct: Declarable): ServerHalf {\n\tconst declarations = construct.declare();\n\treturn {\n\t\tid: construct.id,\n\t\tdeclare: () => declarations,\n\t\tserverHalf: true,\n\t};\n}\n\n/**\n * The edge a frontend — a site or a mobile app — has to a construct: to its\n * server half when it named one (`.server`, marked `server: true`), to its\n * public face where it has one, to the construct itself otherwise.\n */\nexport function frontendEdgeTo(construct: Declarable): Dependency {\n\tif ((construct as Partial<ServerHalf>).serverHalf) {\n\t\treturn { ...edgeTo(construct), server: true };\n\t}\n\tconst face = (construct as Partial<HasPublicFace>).publicFace;\n\treturn edgeTo(face ?? construct);\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/**\n * The edges after `.database(source)` names a builder's database.\n *\n * A database replaces the one before it — a worker's default, overridden by a\n * runnable that names its own — so the edge the previous one added goes with\n * it. Left behind, a Lambda built from a queue that moved to another database\n * would still be granted the worker's.\n *\n * Only an edge `.database()` added is removed, which is why it is returned as\n * `_databaseEdge` for the next call to read — and not even that one when\n * `.dependsOn()` has since named the same construct, since the handler still\n * reaches it through `services`.\n */\nexport function databaseEdges(\n\tcurrent: {\n\t\tconstructs: readonly string[];\n\t\tedge: string | undefined;\n\t\tservice: Service | undefined;\n\t\tservices: readonly Service[];\n\t},\n\tsource: unknown,\n): { _constructs: string[]; _databaseEdge: string | undefined } {\n\tconst stillDependedOn =\n\t\tcurrent.service !== undefined && current.services.includes(current.service);\n\tconst kept =\n\t\tcurrent.edge && !stillDependedOn\n\t\t\t? current.constructs.filter((id) => id !== current.edge)\n\t\t\t: [...current.constructs];\n\n\tif (!isConsumable(source) || kept.includes(source.id)) {\n\t\treturn { _constructs: kept, _databaseEdge: undefined };\n\t}\n\n\treturn { _constructs: [...kept, source.id], _databaseEdge: source.id };\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n\n/**\n * A surface's or a site's public address, read from its `<ID>_URL` — the\n * client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.\n */\nexport function publicUrl(\n\toptions: ServiceRegisterOptions,\n\tkey: string,\n): string {\n\treturn options.envParser.create((get) => ({ url: get(key).string() })).parse()\n\t\t.url;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;AA6BA,SAAgB,aAAa,WAAmC;CAC/D,MAAM,eAAe,UAAU,QAAQ;CACvC,OAAO;EACN,IAAI,UAAU;EACd,eAAe;EACf,YAAY;CACb;AACD;;;;;;AAOA,SAAgB,eAAe,WAAmC;CACjE,IAAK,UAAkC,YACtC,OAAO;EAAE,GAAG,OAAO,SAAS;EAAG,QAAQ;CAAK;CAE7C,MAAM,OAAQ,UAAqC;CACnD,OAAO,OAAO,QAAQ,SAAS;AAChC;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;;;;;;;;;;;;;AAeA,SAAgB,cACf,SAMA,QAC+D;CAC/D,MAAM,kBACL,QAAQ,YAAY,KAAA,KAAa,QAAQ,SAAS,SAAS,QAAQ,OAAO;CAC3E,MAAM,OACL,QAAQ,QAAQ,CAAC,kBACd,QAAQ,WAAW,QAAQ,OAAO,OAAO,QAAQ,IAAI,IACrD,CAAC,GAAG,QAAQ,UAAU;CAE1B,IAAI,CAAC,aAAa,MAAM,KAAK,KAAK,SAAS,OAAO,EAAE,GACnD,OAAO;EAAE,aAAa;EAAM,eAAe,KAAA;CAAU;CAGtD,OAAO;EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,EAAE;EAAG,eAAe,OAAO;CAAG;AACtE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL;;;;;AAMA,SAAgB,UACf,SACA,KACS;CACT,OAAO,QAAQ,UAAU,QAAQ,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAC5E;AACH"}
@@ -1,2 +1,2 @@
1
- import { _ as servicesOf, a as HasPublicFace, c as NotAConstruct, d as edgeTo, f as frontendEdgeTo, g as serviceOf, h as publicUrl, i as Declarable, l as ServicesOf, m as isConsumable, n as Construct, o as Infer, p as idsOf, r as Consumable, s as NameOf, t as Authenticator, u as databaseEdges } from "./construct-interface-DhbaONW2.cjs";
2
- export { Authenticator, Construct, Consumable, Declarable, HasPublicFace, Infer, NameOf, NotAConstruct, ServicesOf, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serviceOf, servicesOf };
1
+ import { _ as serverHalfOf, a as HasPublicFace, c as NotAConstruct, d as databaseEdges, f as edgeTo, g as publicUrl, h as isConsumable, i as Declarable, l as ServerHalf, m as idsOf, n as Construct, o as Infer, p as frontendEdgeTo, r as Consumable, s as NameOf, t as Authenticator, u as ServicesOf, v as serviceOf, y as servicesOf } from "./construct-interface-CVoejIpo.cjs";
2
+ export { Authenticator, Construct, Consumable, Declarable, HasPublicFace, Infer, NameOf, NotAConstruct, ServerHalf, ServicesOf, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serverHalfOf, serviceOf, servicesOf };
@@ -1,2 +1,2 @@
1
- import { _ as servicesOf, a as HasPublicFace, c as NotAConstruct, d as edgeTo, f as frontendEdgeTo, g as serviceOf, h as publicUrl, i as Declarable, l as ServicesOf, m as isConsumable, n as Construct, o as Infer, p as idsOf, r as Consumable, s as NameOf, t as Authenticator, u as databaseEdges } from "./construct-interface-DxfkFxkl.mjs";
2
- export { Authenticator, Construct, Consumable, Declarable, HasPublicFace, Infer, NameOf, NotAConstruct, ServicesOf, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serviceOf, servicesOf };
1
+ import { _ as serverHalfOf, a as HasPublicFace, c as NotAConstruct, d as databaseEdges, f as edgeTo, g as publicUrl, h as isConsumable, i as Declarable, l as ServerHalf, m as idsOf, n as Construct, o as Infer, p as frontendEdgeTo, r as Consumable, s as NameOf, t as Authenticator, u as ServicesOf, v as serviceOf, y as servicesOf } from "./construct-interface-Nw5Dt9AC.mjs";
2
+ export { Authenticator, Construct, Consumable, Declarable, HasPublicFace, Infer, NameOf, NotAConstruct, ServerHalf, ServicesOf, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serverHalfOf, serviceOf, servicesOf };
@@ -19,11 +19,25 @@ function edgeTo(construct) {
19
19
  kind: canonical.kind
20
20
  };
21
21
  }
22
+ /** `construct`, as the server half a frontend's edge can name. */
23
+ function serverHalfOf(construct) {
24
+ const declarations = construct.declare();
25
+ return {
26
+ id: construct.id,
27
+ declare: () => declarations,
28
+ serverHalf: true
29
+ };
30
+ }
22
31
  /**
23
- * The edge a frontend — a site or a mobile app — has to a construct: its
24
- * public face where it has one, the construct itself otherwise.
32
+ * The edge a frontend — a site or a mobile app — has to a construct: to its
33
+ * server half when it named one (`.server`, marked `server: true`), to its
34
+ * public face where it has one, to the construct itself otherwise.
25
35
  */
26
36
  function frontendEdgeTo(construct) {
37
+ if (construct.serverHalf) return {
38
+ ...edgeTo(construct),
39
+ server: true
40
+ };
27
41
  const face = construct.publicFace;
28
42
  return edgeTo(face ?? construct);
29
43
  }
@@ -117,6 +131,6 @@ function publicUrl(options, key) {
117
131
  return options.envParser.create((get) => ({ url: get(key).string() })).parse().url;
118
132
  }
119
133
  //#endregion
120
- export { NotAConstruct, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serviceOf, servicesOf };
134
+ export { NotAConstruct, databaseEdges, edgeTo, frontendEdgeTo, idsOf, isConsumable, publicUrl, serverHalfOf, serviceOf, servicesOf };
121
135
 
122
136
  //# sourceMappingURL=construct-interface.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"construct-interface.mjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/**\n * A construct whose public half is a node of its own: what a site's or a\n * mobile app's plain edge points at instead of the construct itself.\n *\n * A `FileServer` is the one: its own node is the bucket, which presigns and\n * writes, and a frontend that only shows the objects needs the address they\n * are served on and nothing that can write to them.\n */\nexport interface HasPublicFace {\n\treadonly publicFace: Declarable;\n}\n\n/**\n * The edge a frontend — a site or a mobile app — has to a construct: its\n * public face where it has one, the construct itself otherwise.\n */\nexport function frontendEdgeTo(construct: Declarable): Dependency {\n\tconst face = (construct as Partial<HasPublicFace>).publicFace;\n\treturn edgeTo(face ?? construct);\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/**\n * The edges after `.database(source)` names a builder's database.\n *\n * A database replaces the one before it — a worker's default, overridden by a\n * runnable that names its own — so the edge the previous one added goes with\n * it. Left behind, a Lambda built from a queue that moved to another database\n * would still be granted the worker's.\n *\n * Only an edge `.database()` added is removed, which is why it is returned as\n * `_databaseEdge` for the next call to read — and not even that one when\n * `.dependsOn()` has since named the same construct, since the handler still\n * reaches it through `services`.\n */\nexport function databaseEdges(\n\tcurrent: {\n\t\tconstructs: readonly string[];\n\t\tedge: string | undefined;\n\t\tservice: Service | undefined;\n\t\tservices: readonly Service[];\n\t},\n\tsource: unknown,\n): { _constructs: string[]; _databaseEdge: string | undefined } {\n\tconst stillDependedOn =\n\t\tcurrent.service !== undefined && current.services.includes(current.service);\n\tconst kept =\n\t\tcurrent.edge && !stillDependedOn\n\t\t\t? current.constructs.filter((id) => id !== current.edge)\n\t\t\t: [...current.constructs];\n\n\tif (!isConsumable(source) || kept.includes(source.id)) {\n\t\treturn { _constructs: kept, _databaseEdge: undefined };\n\t}\n\n\treturn { _constructs: [...kept, source.id], _databaseEdge: source.id };\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n\n/**\n * A surface's or a site's public address, read from its `<ID>_URL` — the\n * client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.\n */\nexport function publicUrl(\n\toptions: ServiceRegisterOptions,\n\tkey: string,\n): string {\n\treturn options.envParser.create((get) => ({ url: get(key).string() })).parse()\n\t\t.url;\n}\n"],"mappings":";;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;;;;AAkBA,SAAgB,eAAe,WAAmC;CACjE,MAAM,OAAQ,UAAqC;CACnD,OAAO,OAAO,QAAQ,SAAS;AAChC;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;;;;;;;;;;;;;AAeA,SAAgB,cACf,SAMA,QAC+D;CAC/D,MAAM,kBACL,QAAQ,YAAY,KAAA,KAAa,QAAQ,SAAS,SAAS,QAAQ,OAAO;CAC3E,MAAM,OACL,QAAQ,QAAQ,CAAC,kBACd,QAAQ,WAAW,QAAQ,OAAO,OAAO,QAAQ,IAAI,IACrD,CAAC,GAAG,QAAQ,UAAU;CAE1B,IAAI,CAAC,aAAa,MAAM,KAAK,KAAK,SAAS,OAAO,EAAE,GACnD,OAAO;EAAE,aAAa;EAAM,eAAe,KAAA;CAAU;CAGtD,OAAO;EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,EAAE;EAAG,eAAe,OAAO;CAAG;AACtE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL;;;;;AAMA,SAAgB,UACf,SACA,KACS;CACT,OAAO,QAAQ,UAAU,QAAQ,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAC5E;AACH"}
1
+ {"version":3,"file":"construct-interface.mjs","names":[],"sources":["../src/construct-interface.ts"],"sourcesContent":["/**\n * The construct contract.\n *\n * A construct is three things at once — an infrastructure requirement at build\n * time, a runtime capability, and something other code can consume — which is\n * what forces exactly these three members.\n *\n * An **interface**, not a base class: `Endpoint`, `Cron`, `Queue`, and `Topic`\n * can satisfy it without inheritance surgery, a lifted `Service` can satisfy it\n * as a plain object, and `.dependsOn()` gets its enforcement structurally — a\n * `Service` (`{ serviceName, register }`) simply does not match\n * `{ id, declare, service }`, with no `instanceof` anywhere.\n *\n * Lives in its own module while the existing abstract `Construct` class is\n * still in use; it takes that name once the class is gone.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport type { Declaration, Dependency } from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\n\n/**\n * @typeParam TName - the construct's canonical id, PascalCase. Keeping it a\n * literal is what lets the service key be `Uncapitalize<TName>` — a TypeScript\n * intrinsic, so no custom transform needs a runtime twin.\n * @typeParam TClient - what consuming this construct hands you. `never` means it\n * owns no address and cannot be consumed: a `Cron` is fired by a schedule and a\n * `Subscriber` is reached through its topic, so `.dependsOn()` on either is a\n * compile error rather than a stub that throws.\n */\nexport interface Construct<TName extends string = string, TClient = never> {\n\t/** Canonical, PascalCase, unique within the manifest. */\n\treadonly id: TName;\n\n\t/**\n\t * The build-time face: what this construct contributes to the manifest.\n\t *\n\t * Returns an array because some constructs contribute more than one node — a\n\t * queue declares the queue and its worker, a database declares its migrator\n\t * and seeder. Most return one.\n\t */\n\tdeclare(): Declaration[];\n\n\t/**\n\t * The consumable face — the address this construct owns, as a client.\n\t *\n\t * A field assigned once rather than a getter. `Construct.getEnvironment`\n\t * and `ServiceDiscovery` cache by service *object*, so a getter returning a\n\t * fresh literal on every access would never hit either cache.\n\t */\n\treadonly service: [TClient] extends [never]\n\t\t? never\n\t\t: Service<Uncapitalize<TName>, TClient>;\n}\n\n/**\n * The build-time face alone — an id and what it contributes to the manifest.\n *\n * Weaker than {@link Consumable} on purpose. An edge is not always an\n * injection: a site depending on an API needs that API's *address at build\n * time* and has no service record to put a client into, so requiring one would\n * make the weakest kind of edge impossible to express with the strongest\n * interface. Discovery asks this same question and nothing more.\n */\nexport interface Declarable<TName extends string = string> {\n\treadonly id: TName;\n\tdeclare(): Declaration[];\n}\n\n/**\n * A construct that authenticates requests — what `RestApi.auth()` takes.\n *\n * `verify` is the one thing every provider shares: given a request's headers,\n * whose request is it — the session, or `null` when there is none. Whether the\n * provider is a server mounted beside the API, deployed elsewhere, or an issuer\n * somebody else runs is its own business; a surface only ever asks this.\n */\nexport interface Authenticator<TSession = unknown> extends Declarable {\n\tverify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<TSession | null>;\n}\n\n/**\n * The edge that points at a construct.\n *\n * A construct's *canonical* node is the one carrying its own id — the others are\n * things it owns rather than things it is, like the signing secret beside an\n * auth server — so the kind an edge records is read off that node instead of\n * being written down beside it. Hand-written kinds are the same fact stated\n * twice, and the copy is what goes stale when a construct changes what it\n * declares.\n *\n * @throws {NotAConstruct} when the value declares nothing under its own id.\n */\nexport function edgeTo(construct: Declarable): Dependency {\n\tconst canonical = construct\n\t\t.declare()\n\t\t.find((declaration) => declaration.id === construct.id);\n\n\tif (!canonical) throw new NotAConstruct(construct);\n\n\treturn { target: construct.id, kind: canonical.kind };\n}\n\n/**\n * A construct whose public half is a node of its own: what a site's or a\n * mobile app's plain edge points at instead of the construct itself.\n *\n * A `FileServer` is the one: its own node is the bucket, which presigns and\n * writes, and a frontend that only shows the objects needs the address they\n * are served on and nothing that can write to them.\n */\nexport interface HasPublicFace {\n\treadonly publicFace: Declarable;\n}\n\n/**\n * A construct's server half, as a frontend names it: `documents.server`,\n * `assets.server`.\n *\n * A `Declarable` and not a `Consumable`, so only a site or a mobile app can\n * depend on it — a backend's plain edge is already the full one. A frontend's\n * plain edge to a bucket holds where its links are signed and nothing that\n * writes to it; this one hands its server half the connection and the key\n * pair too.\n */\nexport interface ServerHalf extends Declarable {\n\treadonly serverHalf: true;\n}\n\n/** `construct`, as the server half a frontend's edge can name. */\nexport function serverHalfOf(construct: Declarable): ServerHalf {\n\tconst declarations = construct.declare();\n\treturn {\n\t\tid: construct.id,\n\t\tdeclare: () => declarations,\n\t\tserverHalf: true,\n\t};\n}\n\n/**\n * The edge a frontend — a site or a mobile app — has to a construct: to its\n * server half when it named one (`.server`, marked `server: true`), to its\n * public face where it has one, to the construct itself otherwise.\n */\nexport function frontendEdgeTo(construct: Declarable): Dependency {\n\tif ((construct as Partial<ServerHalf>).serverHalf) {\n\t\treturn { ...edgeTo(construct), server: true };\n\t}\n\tconst face = (construct as Partial<HasPublicFace>).publicFace;\n\treturn edgeTo(face ?? construct);\n}\n\n/** What consuming a construct hands you. */\nexport type Infer<C> =\n\tC extends Construct<string, infer TClient> ? TClient : never;\n\n/** A construct's canonical id. */\nexport type NameOf<C> =\n\tC extends Construct<infer TName, unknown> ? TName : never;\n\n/**\n * What `.dependsOn([…])` accepts: a construct that owns a client.\n *\n * Structural, and deliberately narrower than {@link Construct} — it is the\n * face a *consumer* needs, so the builders can accept a database, a bucket, a\n * mail sender, a queue, or a topic without importing any of them. A plain\n * `Service` is not one of these, which is the point: constructs-only confines\n * env sniffing to `.services()` and the explicit lift, so retiring that method\n * retires implicit inference with it.\n */\nexport interface Consumable<TName extends string = string, TClient = unknown> {\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, TClient>;\n\tdeclare(): Declaration[];\n}\n\n/**\n * The services a list of constructs dissolves into.\n *\n * A mapped tuple, so `[db, uploads]` types as `[Service<'orders', Kysely<DB>>,\n * Service<'uploads', StorageClient>]` and the handler's service record gains\n * both keys — the same machinery `.services()` already uses, which is why\n * `dependsOn` needs no type plumbing of its own.\n */\nexport type ServicesOf<T extends readonly Consumable[]> = {\n\t[K in keyof T]: T[K]['service'];\n};\n\n/**\n * The services of a list of constructs, at runtime.\n *\n * @throws {NotAConstruct} when handed something else. The type already refuses\n * it, but a JavaScript caller gets no such warning, and a `Service` slipping\n * through would fail later as an undefined key in the handler.\n */\nexport function servicesOf<const T extends readonly Consumable[]>(\n\tconstructs: T,\n): ServicesOf<T> {\n\treturn constructs.map((construct) => {\n\t\tif (!isConsumable(construct)) throw new NotAConstruct(construct);\n\n\t\treturn construct.service;\n\t}) as ServicesOf<T>;\n}\n\n/**\n * The other half of `servicesOf`: the same edge, as the manifest records it.\n *\n * `.dependsOn()` used to keep only the services, which is what a handler runs\n * with — and an id cannot be recovered from a service name reliably, so the\n * edges were gone by the time the build could read them. Both halves are taken\n * from one call now, and `existing` is folded in so repeated `.dependsOn()`\n * calls accumulate the way `.services()` already does.\n */\nexport function idsOf(\n\tconstructs: readonly Consumable[],\n\texisting: readonly string[] = [],\n): string[] {\n\treturn [...new Set([...existing, ...constructs.map(({ id }) => id)])];\n}\n\n/**\n * The edges after `.database(source)` names a builder's database.\n *\n * A database replaces the one before it — a worker's default, overridden by a\n * runnable that names its own — so the edge the previous one added goes with\n * it. Left behind, a Lambda built from a queue that moved to another database\n * would still be granted the worker's.\n *\n * Only an edge `.database()` added is removed, which is why it is returned as\n * `_databaseEdge` for the next call to read — and not even that one when\n * `.dependsOn()` has since named the same construct, since the handler still\n * reaches it through `services`.\n */\nexport function databaseEdges(\n\tcurrent: {\n\t\tconstructs: readonly string[];\n\t\tedge: string | undefined;\n\t\tservice: Service | undefined;\n\t\tservices: readonly Service[];\n\t},\n\tsource: unknown,\n): { _constructs: string[]; _databaseEdge: string | undefined } {\n\tconst stillDependedOn =\n\t\tcurrent.service !== undefined && current.services.includes(current.service);\n\tconst kept =\n\t\tcurrent.edge && !stillDependedOn\n\t\t\t? current.constructs.filter((id) => id !== current.edge)\n\t\t\t: [...current.constructs];\n\n\tif (!isConsumable(source) || kept.includes(source.id)) {\n\t\treturn { _constructs: kept, _databaseEdge: undefined };\n\t}\n\n\treturn { _constructs: [...kept, source.id], _databaseEdge: source.id };\n}\n\n/** Something that is not a construct was passed to `.dependsOn()`. */\nexport class NotAConstruct extends Error {\n\tconstructor(readonly value: unknown) {\n\t\tconst name =\n\t\t\ttypeof value === 'object' && value !== null && 'serviceName' in value\n\t\t\t\t? `the service '${String((value as { serviceName: unknown }).serviceName)}'`\n\t\t\t\t: `a ${typeof value}`;\n\n\t\tsuper(\n\t\t\t`.dependsOn() takes constructs, and was given ${name}. ` +\n\t\t\t\t`Pass it to .services([…]) instead.`,\n\t\t);\n\t\tthis.name = 'NotAConstruct';\n\t}\n}\n\n/**\n * Whether a value is a construct rather than a bare `Service`.\n *\n * Structural rather than `instanceof`: a construct from a second copy of\n * `@geekmidas/constructs` — a linked workspace, two versions in a lockfile — is\n * still a construct, and `instanceof` is exactly the check that says otherwise.\n */\nexport function isConsumable(value: unknown): value is Consumable {\n\tif (typeof value !== 'object' || value === null) return false;\n\n\tconst candidate = value as Partial<Consumable>;\n\n\treturn (\n\t\ttypeof candidate.id === 'string' &&\n\t\ttypeof candidate.declare === 'function' &&\n\t\ttypeof (candidate.service as Service | undefined)?.serviceName === 'string'\n\t);\n}\n\n/**\n * The service behind either face.\n *\n * `.database()` and the auditor slot take a construct now; they took a\n * `Service` before and still do, because not every hand-written service has a\n * construct to stand for it.\n */\nexport function serviceOf<TName extends string, TClient>(\n\tsource: Consumable<TName, TClient> | Service<TName, TClient>,\n): Service<TName, TClient> {\n\t// A construct's service key is `Uncapitalize<TName>` and the slot is typed\n\t// by `TName`; the two describe the same key, and only the cast says so.\n\treturn isConsumable(source)\n\t\t? (source.service as unknown as Service<TName, TClient>)\n\t\t: (source as Service<TName, TClient>);\n}\n\n/**\n * A surface's or a site's public address, read from its `<ID>_URL` — the\n * client a `RestApi` or a `StaticSite` hands whatever `.dependsOn()` it.\n */\nexport function publicUrl(\n\toptions: ServiceRegisterOptions,\n\tkey: string,\n): string {\n\treturn options.envParser.create((get) => ({ url: get(key).string() })).parse()\n\t\t.url;\n}\n"],"mappings":";;;;;;;;;;;;;AAgGA,SAAgB,OAAO,WAAmC;CACzD,MAAM,YAAY,UAChB,QAAQ,CAAC,CACT,MAAM,gBAAgB,YAAY,OAAO,UAAU,EAAE;CAEvD,IAAI,CAAC,WAAW,MAAM,IAAI,cAAc,SAAS;CAEjD,OAAO;EAAE,QAAQ,UAAU;EAAI,MAAM,UAAU;CAAK;AACrD;;AA6BA,SAAgB,aAAa,WAAmC;CAC/D,MAAM,eAAe,UAAU,QAAQ;CACvC,OAAO;EACN,IAAI,UAAU;EACd,eAAe;EACf,YAAY;CACb;AACD;;;;;;AAOA,SAAgB,eAAe,WAAmC;CACjE,IAAK,UAAkC,YACtC,OAAO;EAAE,GAAG,OAAO,SAAS;EAAG,QAAQ;CAAK;CAE7C,MAAM,OAAQ,UAAqC;CACnD,OAAO,OAAO,QAAQ,SAAS;AAChC;;;;;;;;AA6CA,SAAgB,WACf,YACgB;CAChB,OAAO,WAAW,KAAK,cAAc;EACpC,IAAI,CAAC,aAAa,SAAS,GAAG,MAAM,IAAI,cAAc,SAAS;EAE/D,OAAO,UAAU;CAClB,CAAC;AACF;;;;;;;;;;AAWA,SAAgB,MACf,YACA,WAA8B,CAAC,GACpB;CACX,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,UAAU,GAAG,WAAW,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;AACrE;;;;;;;;;;;;;;AAeA,SAAgB,cACf,SAMA,QAC+D;CAC/D,MAAM,kBACL,QAAQ,YAAY,KAAA,KAAa,QAAQ,SAAS,SAAS,QAAQ,OAAO;CAC3E,MAAM,OACL,QAAQ,QAAQ,CAAC,kBACd,QAAQ,WAAW,QAAQ,OAAO,OAAO,QAAQ,IAAI,IACrD,CAAC,GAAG,QAAQ,UAAU;CAE1B,IAAI,CAAC,aAAa,MAAM,KAAK,KAAK,SAAS,OAAO,EAAE,GACnD,OAAO;EAAE,aAAa;EAAM,eAAe,KAAA;CAAU;CAGtD,OAAO;EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,EAAE;EAAG,eAAe,OAAO;CAAG;AACtE;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACnB;CAArB,YAAY,OAAyB;EACpC,MAAM,OACL,OAAO,UAAU,YAAY,UAAU,QAAQ,iBAAiB,QAC7D,gBAAgB,OAAQ,MAAmC,WAAW,EAAE,KACxE,KAAK,OAAO;EAEhB,MACC,gDAAgD,KAAK,qCAEtD;EAToB,KAAA,QAAA;EAUpB,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,SAAgB,aAAa,OAAqC;CACjE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CAExD,MAAM,YAAY;CAElB,OACC,OAAO,UAAU,OAAO,YACxB,OAAO,UAAU,YAAY,cAC7B,OAAQ,UAAU,SAAiC,gBAAgB;AAErE;;;;;;;;AASA,SAAgB,UACf,QAC0B;CAG1B,OAAO,aAAa,MAAM,IACtB,OAAO,UACP;AACL;;;;;AAMA,SAAgB,UACf,SACA,KACS;CACT,OAAO,QAAQ,UAAU,QAAQ,SAAS,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAC5E;AACH"}
@@ -1,2 +1,2 @@
1
- import { c as Credential, d as decodeCredentials, f as readCredentials, i as isFake, l as CredentialOptions, r as fake, t as Fake, u as MalformedCredential } from "./fake-Djx8E0o1.cjs";
1
+ import { c as Credential, d as decodeCredentials, f as readCredentials, i as isFake, l as CredentialOptions, r as fake, t as Fake, u as MalformedCredential } from "./fake-JI5uN1SF.cjs";
2
2
  export { Credential, CredentialOptions, type Fake, MalformedCredential, decodeCredentials, fake, isFake, readCredentials };
@@ -1,2 +1,2 @@
1
- import { c as Credential, d as decodeCredentials, f as readCredentials, i as isFake, l as CredentialOptions, r as fake, t as Fake, u as MalformedCredential } from "./fake-BvOXkZmj.mjs";
1
+ import { c as Credential, d as decodeCredentials, f as readCredentials, i as isFake, l as CredentialOptions, r as fake, t as Fake, u as MalformedCredential } from "./fake-zpuXpBmY.mjs";
2
2
  export { Credential, CredentialOptions, type Fake, MalformedCredential, decodeCredentials, fake, isFake, readCredentials };
@@ -1,5 +1,5 @@
1
- import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-Ca_qHQu2.cjs";
2
- import { t as CronBuilder } from "../CronBuilder-C3RrAF1-.cjs";
1
+ import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-BcA8F0S-.cjs";
2
+ import { t as CronBuilder } from "../CronBuilder-BZvo34X2.cjs";
3
3
  import { ServiceDiscovery } from "@geekmidas/services";
4
4
  //#region src/crons/inProcess.d.ts
5
5
  /** A schedule that is running, and the way to stop it. */
@@ -1,5 +1,5 @@
1
- import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-DPJiR7Lt.mjs";
2
- import { t as CronBuilder } from "../CronBuilder-BC4za5Bx.mjs";
1
+ import { i as ScheduleExpression, n as CronExpression, r as RateExpression, t as Cron } from "../Cron-z2CiuQT_.mjs";
2
+ import { t as CronBuilder } from "../CronBuilder-BbgKo8OI.mjs";
3
3
  import { ServiceDiscovery } from "@geekmidas/services";
4
4
  //#region src/crons/inProcess.d.ts
5
5
  /** A schedule that is running, and the way to stop it. */
@@ -1,2 +1,2 @@
1
- import { a as closeDatabasePools, i as ReadOnlyDatabase, n as KyselyDatabaseOptions, r as PostgresRuntime, t as KyselyDatabase } from "../kysely-2HqIQ2fC.cjs";
1
+ import { a as closeDatabasePools, i as ReadOnlyDatabase, n as KyselyDatabaseOptions, r as PostgresRuntime, t as KyselyDatabase } from "../kysely-lxNUBSTP.cjs";
2
2
  export { KyselyDatabase, KyselyDatabaseOptions, PostgresRuntime, ReadOnlyDatabase, closeDatabasePools };
@@ -1,2 +1,2 @@
1
- import { a as closeDatabasePools, i as ReadOnlyDatabase, n as KyselyDatabaseOptions, r as PostgresRuntime, t as KyselyDatabase } from "../kysely-BGvpd_ZH.mjs";
1
+ import { a as closeDatabasePools, i as ReadOnlyDatabase, n as KyselyDatabaseOptions, r as PostgresRuntime, t as KyselyDatabase } from "../kysely-5PAqFBzo.mjs";
2
2
  export { KyselyDatabase, KyselyDatabaseOptions, PostgresRuntime, ReadOnlyDatabase, closeDatabasePools };
package/dist/email.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-DhbaONW2.cjs";
1
+ import { n as Construct } from "./construct-interface-CVoejIpo.cjs";
2
2
  import { Service } from "@geekmidas/services";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { EmailClient, TemplateRecord } from "@geekmidas/emailkit";
package/dist/email.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-DxfkFxkl.mjs";
1
+ import { n as Construct } from "./construct-interface-Nw5Dt9AC.mjs";
2
2
  import { ConstructName, Declaration } from "@geekmidas/manifest";
3
3
  import { Service } from "@geekmidas/services";
4
4
  import { EmailClient, TemplateRecord } from "@geekmidas/emailkit";
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-DhbaONW2.cjs";
1
+ import { n as Construct } from "./construct-interface-CVoejIpo.cjs";
2
2
  import { a as CurrentKeyCannotRetire, c as Keyring, d as generateKeyring, f as keyringCipher, h as rotateKeyring, i as CiphertextNotAuthentic, l as UnknownEncryptionScheme, m as retireKey, n as CipherDriver, o as EncryptionKeyRetired, p as parseKeyring, r as CiphertextMalformed, s as EncryptionUrlInvalid, t as Cipher, u as formatKeyring } from "./cipher-DSDxPRIp.cjs";
3
3
  import { Service } from "@geekmidas/services";
4
4
  import { ConstructName, Declaration } from "@geekmidas/manifest";
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-DxfkFxkl.mjs";
1
+ import { n as Construct } from "./construct-interface-Nw5Dt9AC.mjs";
2
2
  import { a as CurrentKeyCannotRetire, c as Keyring, d as generateKeyring, f as keyringCipher, h as rotateKeyring, i as CiphertextNotAuthentic, l as UnknownEncryptionScheme, m as retireKey, n as CipherDriver, o as EncryptionKeyRetired, p as parseKeyring, r as CiphertextMalformed, s as EncryptionUrlInvalid, t as Cipher, u as formatKeyring } from "./cipher-DSDxPRIp.mjs";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { Service } from "@geekmidas/services";
@@ -1,6 +1,6 @@
1
1
  import { s as publishConstructEvents } from "../Construct-127M7yrl.cjs";
2
- import { A as SecurityScheme, C as ActorExtractor, D as BuiltInSecuritySchemeId, E as BUILT_IN_SECURITY_SCHEMES, M as getSecurityScheme, N as isBuiltInSecurityScheme, O as OAuthFlow, S as RlsContextExtractor, T as Authorizer, _ as SessionAuth, a as EndpointContext, b as RlsConfig, c as EndpointSchemas, d as HeaderFn, f as RedirectStatus, g as NoAuthenticator, h as SuccessStatus, i as Endpoint, j as createAuthorizer, k as OAuthFlows, l as EndpointStatus, n as ConvertRouteParams, o as EndpointHandler, p as ResponseBuilder, r as CookieFn, s as EndpointOutput, u as EndpointSurface, v as RLS_BYPASS, w as MappedAudit, x as RlsContext, y as RlsBypass } from "../Endpoint-BlIZLsBQ.cjs";
3
- import { a as UPLOAD_POST_SCHEMA, c as UploadContentTypeUnresolved, d as UploadOptions, f as UploadPost, i as UploadHandler, l as UploadExpiryInvalid, n as EndpointBuilder, o as UploadAcceptInvalid, r as UploadEndpointBuilder, s as UploadContentTypeRefused, t as EndpointFactory, u as UploadMaxSizeInvalid } from "../EndpointFactory-cVTb8kCc.cjs";
2
+ import { A as SecurityScheme, C as ActorExtractor, D as BuiltInSecuritySchemeId, E as BUILT_IN_SECURITY_SCHEMES, M as getSecurityScheme, N as isBuiltInSecurityScheme, O as OAuthFlow, S as RlsContextExtractor, T as Authorizer, _ as SessionAuth, a as EndpointContext, b as RlsConfig, c as EndpointSchemas, d as HeaderFn, f as RedirectStatus, g as NoAuthenticator, h as SuccessStatus, i as Endpoint, j as createAuthorizer, k as OAuthFlows, l as EndpointStatus, n as ConvertRouteParams, o as EndpointHandler, p as ResponseBuilder, r as CookieFn, s as EndpointOutput, u as EndpointSurface, v as RLS_BYPASS, w as MappedAudit, x as RlsContext, y as RlsBypass } from "../Endpoint-COisi9jw.cjs";
3
+ import { a as UPLOAD_POST_SCHEMA, c as UploadContentTypeUnresolved, d as UploadOptions, f as UploadPost, i as UploadHandler, l as UploadExpiryInvalid, n as EndpointBuilder, o as UploadAcceptInvalid, r as UploadEndpointBuilder, s as UploadContentTypeRefused, t as EndpointFactory, u as UploadMaxSizeInvalid } from "../EndpointFactory-CfBg6jJE.cjs";
4
4
  import { EnvironmentParser } from "@geekmidas/envkit";
5
5
  import { trustsOrigin } from "@geekmidas/manifest";
6
6
  import { Context } from "hono";
@@ -1,6 +1,6 @@
1
1
  import { s as publishConstructEvents } from "../Construct-BMk_CRSD.mjs";
2
- import { A as SecurityScheme, C as ActorExtractor, D as BuiltInSecuritySchemeId, E as BUILT_IN_SECURITY_SCHEMES, M as getSecurityScheme, N as isBuiltInSecurityScheme, O as OAuthFlow, S as RlsContextExtractor, T as Authorizer, _ as SessionAuth, a as EndpointContext, b as RlsConfig, c as EndpointSchemas, d as HeaderFn, f as RedirectStatus, g as NoAuthenticator, h as SuccessStatus, i as Endpoint, j as createAuthorizer, k as OAuthFlows, l as EndpointStatus, n as ConvertRouteParams, o as EndpointHandler, p as ResponseBuilder, r as CookieFn, s as EndpointOutput, u as EndpointSurface, v as RLS_BYPASS, w as MappedAudit, x as RlsContext, y as RlsBypass } from "../Endpoint-DC7mreOr.mjs";
3
- import { a as UPLOAD_POST_SCHEMA, c as UploadContentTypeUnresolved, d as UploadOptions, f as UploadPost, i as UploadHandler, l as UploadExpiryInvalid, n as EndpointBuilder, o as UploadAcceptInvalid, r as UploadEndpointBuilder, s as UploadContentTypeRefused, t as EndpointFactory, u as UploadMaxSizeInvalid } from "../EndpointFactory-DCmnCmkX.mjs";
2
+ import { A as SecurityScheme, C as ActorExtractor, D as BuiltInSecuritySchemeId, E as BUILT_IN_SECURITY_SCHEMES, M as getSecurityScheme, N as isBuiltInSecurityScheme, O as OAuthFlow, S as RlsContextExtractor, T as Authorizer, _ as SessionAuth, a as EndpointContext, b as RlsConfig, c as EndpointSchemas, d as HeaderFn, f as RedirectStatus, g as NoAuthenticator, h as SuccessStatus, i as Endpoint, j as createAuthorizer, k as OAuthFlows, l as EndpointStatus, n as ConvertRouteParams, o as EndpointHandler, p as ResponseBuilder, r as CookieFn, s as EndpointOutput, u as EndpointSurface, v as RLS_BYPASS, w as MappedAudit, x as RlsContext, y as RlsBypass } from "../Endpoint-CIDUreMW.mjs";
3
+ import { a as UPLOAD_POST_SCHEMA, c as UploadContentTypeUnresolved, d as UploadOptions, f as UploadPost, i as UploadHandler, l as UploadExpiryInvalid, n as EndpointBuilder, o as UploadAcceptInvalid, r as UploadEndpointBuilder, s as UploadContentTypeRefused, t as EndpointFactory, u as UploadMaxSizeInvalid } from "../EndpointFactory-CIM80WIK.mjs";
4
4
  import { trustsOrigin } from "@geekmidas/manifest";
5
5
  import { HttpError } from "@geekmidas/errors";
6
6
  import { EnvironmentParser } from "@geekmidas/envkit";
@@ -1,2 +1,2 @@
1
- import { a as ExternalApi, i as isFake, n as FetchHandler, o as ExternalApiOptions, r as fake, s as ExternalApiUrl, t as Fake } from "./fake-Djx8E0o1.cjs";
1
+ import { a as ExternalApi, i as isFake, n as FetchHandler, o as ExternalApiOptions, r as fake, s as ExternalApiUrl, t as Fake } from "./fake-JI5uN1SF.cjs";
2
2
  export { ExternalApi, ExternalApiOptions, ExternalApiUrl, type Fake, type FetchHandler, fake, isFake };
@@ -1,2 +1,2 @@
1
- import { a as ExternalApi, i as isFake, n as FetchHandler, o as ExternalApiOptions, r as fake, s as ExternalApiUrl, t as Fake } from "./fake-BvOXkZmj.mjs";
1
+ import { a as ExternalApi, i as isFake, n as FetchHandler, o as ExternalApiOptions, r as fake, s as ExternalApiUrl, t as Fake } from "./fake-zpuXpBmY.mjs";
2
2
  export { ExternalApi, ExternalApiOptions, ExternalApiUrl, type Fake, type FetchHandler, fake, isFake };
@@ -1,5 +1,5 @@
1
1
  import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.cjs";
2
- import { r as Consumable } from "./construct-interface-DhbaONW2.cjs";
2
+ import { r as Consumable } from "./construct-interface-CVoejIpo.cjs";
3
3
  import { n as DeployedStage, r as LocalStage } from "./stages-DaTaoQei.cjs";
4
4
  import { Service, ServiceRegisterOptions } from "@geekmidas/services";
5
5
  import { ConstructName, Declaration } from "@geekmidas/manifest";
@@ -198,4 +198,4 @@ declare const fake: {
198
198
  declare function isFake(value: unknown): value is Fake;
199
199
  //#endregion
200
200
  export { ExternalApi as a, Credential as c, decodeCredentials as d, readCredentials as f, isFake as i, CredentialOptions as l, FetchHandler as n, ExternalApiOptions as o, fake as r, ExternalApiUrl as s, Fake as t, MalformedCredential as u };
201
- //# sourceMappingURL=fake-Djx8E0o1.d.cts.map
201
+ //# sourceMappingURL=fake-JI5uN1SF.d.cts.map