@geekmidas/constructs 10.0.0-alpha.165 → 10.0.0-alpha.167

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 (157) hide show
  1. package/dist/{Cron-D_sfaMGz.d.cts → Cron-Ca_qHQu2.d.cts} +2 -2
  2. package/dist/{Cron-D6Y7BBt3.d.mts.map → Cron-Ca_qHQu2.d.cts.map} +1 -1
  3. package/dist/{Cron-D6Y7BBt3.d.mts → Cron-DPJiR7Lt.d.mts} +2 -2
  4. package/dist/{Cron-D_sfaMGz.d.cts.map → Cron-DPJiR7Lt.d.mts.map} +1 -1
  5. package/dist/{CronBuilder-4BZhkChG.d.mts → CronBuilder-BC4za5Bx.d.mts} +4 -4
  6. package/dist/{CronBuilder-4BZhkChG.d.mts.map → CronBuilder-BC4za5Bx.d.mts.map} +1 -1
  7. package/dist/{CronBuilder-C91MVLSr.d.cts → CronBuilder-C3RrAF1-.d.cts} +4 -4
  8. package/dist/{CronBuilder-C91MVLSr.d.cts.map → CronBuilder-C3RrAF1-.d.cts.map} +1 -1
  9. package/dist/{Endpoint-YYwjqtS1.d.cts → Endpoint-BlIZLsBQ.d.cts} +5 -5
  10. package/dist/{Endpoint-BUoDD96P.d.mts.map → Endpoint-BlIZLsBQ.d.cts.map} +1 -1
  11. package/dist/{Endpoint-BUoDD96P.d.mts → Endpoint-DC7mreOr.d.mts} +5 -5
  12. package/dist/{Endpoint-YYwjqtS1.d.cts.map → Endpoint-DC7mreOr.d.mts.map} +1 -1
  13. package/dist/{EndpointFactory-BbVOeryo.d.mts → EndpointFactory-DCmnCmkX.d.mts} +5 -5
  14. package/dist/{EndpointFactory-BbVOeryo.d.mts.map → EndpointFactory-DCmnCmkX.d.mts.map} +1 -1
  15. package/dist/{EndpointFactory-Hh1r6J_C.d.cts → EndpointFactory-cVTb8kCc.d.cts} +5 -5
  16. package/dist/{EndpointFactory-Hh1r6J_C.d.cts.map → EndpointFactory-cVTb8kCc.d.cts.map} +1 -1
  17. package/dist/{ObjectSubscriberBuilder-DfzXQEKW.d.mts → ObjectSubscriberBuilder-AwGKoUKy.d.mts} +2 -2
  18. package/dist/{ObjectSubscriberBuilder-DfzXQEKW.d.mts.map → ObjectSubscriberBuilder-AwGKoUKy.d.mts.map} +1 -1
  19. package/dist/{ObjectSubscriberBuilder-LWkey_oq.d.cts → ObjectSubscriberBuilder-CB6imsX4.d.cts} +2 -2
  20. package/dist/{ObjectSubscriberBuilder-LWkey_oq.d.cts.map → ObjectSubscriberBuilder-CB6imsX4.d.cts.map} +1 -1
  21. package/dist/{ProcessorBuilder-_jdZlbfW.d.cts → ProcessorBuilder-CeEZ2vCx.d.cts} +2 -2
  22. package/dist/{ProcessorBuilder-D4oYvZeG.d.mts.map → ProcessorBuilder-CeEZ2vCx.d.cts.map} +1 -1
  23. package/dist/{ProcessorBuilder-D4oYvZeG.d.mts → ProcessorBuilder-CwIlm75W.d.mts} +2 -2
  24. package/dist/{ProcessorBuilder-_jdZlbfW.d.cts.map → ProcessorBuilder-CwIlm75W.d.mts.map} +1 -1
  25. package/dist/{QueueBuilder-CVS_qPuo.d.mts → QueueBuilder-CUERv8jt.d.mts} +2 -2
  26. package/dist/{QueueBuilder-CVS_qPuo.d.mts.map → QueueBuilder-CUERv8jt.d.mts.map} +1 -1
  27. package/dist/{QueueBuilder-SQli59An.d.cts → QueueBuilder-CmB1vOgn.d.cts} +2 -2
  28. package/dist/{QueueBuilder-SQli59An.d.cts.map → QueueBuilder-CmB1vOgn.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.cjs +1 -1
  36. package/dist/adaptors/testing.cjs.map +1 -1
  37. package/dist/adaptors/testing.d.cts +5 -5
  38. package/dist/adaptors/testing.d.cts.map +1 -1
  39. package/dist/adaptors/testing.d.mts +5 -5
  40. package/dist/adaptors/testing.d.mts.map +1 -1
  41. package/dist/adaptors/testing.mjs +1 -1
  42. package/dist/adaptors/testing.mjs.map +1 -1
  43. package/dist/{auth-DnB9H9KL.d.mts → auth-1yI2wR-4.d.cts} +6 -6
  44. package/dist/{auth-BqWz2JxC.d.cts.map → auth-1yI2wR-4.d.cts.map} +1 -1
  45. package/dist/{auth-BqWz2JxC.d.cts → auth-D4NMXgLt.d.mts} +6 -6
  46. package/dist/{auth-DnB9H9KL.d.mts.map → auth-D4NMXgLt.d.mts.map} +1 -1
  47. package/dist/auth.d.cts +1 -1
  48. package/dist/auth.d.mts +1 -1
  49. package/dist/{cache-CCHcO9Oo.d.mts → cache-0VoeOTF9.d.mts} +2 -2
  50. package/dist/{cache-CCHcO9Oo.d.mts.map → cache-0VoeOTF9.d.mts.map} +1 -1
  51. package/dist/{cache-CQjMNPrC.d.cts → cache-CW-sArzS.d.cts} +2 -2
  52. package/dist/{cache-CQjMNPrC.d.cts.map → cache-CW-sArzS.d.cts.map} +1 -1
  53. package/dist/cache.d.cts +1 -1
  54. package/dist/cache.d.mts +1 -1
  55. package/dist/{construct-interface-CSA9VeWM.d.mts → construct-interface-DhbaONW2.d.cts} +20 -4
  56. package/dist/construct-interface-DhbaONW2.d.cts.map +1 -0
  57. package/dist/{construct-interface-DugP0E5q.d.cts → construct-interface-DxfkFxkl.d.mts} +20 -4
  58. package/dist/construct-interface-DxfkFxkl.d.mts.map +1 -0
  59. package/dist/construct-interface.cjs +9 -0
  60. package/dist/construct-interface.cjs.map +1 -1
  61. package/dist/construct-interface.d.cts +2 -2
  62. package/dist/construct-interface.d.mts +2 -2
  63. package/dist/construct-interface.mjs +9 -1
  64. package/dist/construct-interface.mjs.map +1 -1
  65. package/dist/credential.d.cts +1 -1
  66. package/dist/credential.d.mts +1 -1
  67. package/dist/crons/index.d.cts +2 -2
  68. package/dist/crons/index.d.mts +2 -2
  69. package/dist/database/kysely.d.cts +1 -1
  70. package/dist/database/kysely.d.mts +1 -1
  71. package/dist/email.d.cts +1 -1
  72. package/dist/email.d.mts +1 -1
  73. package/dist/encryption.d.cts +1 -1
  74. package/dist/encryption.d.mts +1 -1
  75. package/dist/endpoints/index.d.cts +2 -2
  76. package/dist/endpoints/index.d.mts +2 -2
  77. package/dist/external-api.d.cts +1 -1
  78. package/dist/external-api.d.mts +1 -1
  79. package/dist/{fake-BqhP8RRQ.d.mts → fake-BvOXkZmj.d.mts} +2 -2
  80. package/dist/{fake-BqhP8RRQ.d.mts.map → fake-BvOXkZmj.d.mts.map} +1 -1
  81. package/dist/{fake-DqieDYYA.d.cts → fake-Djx8E0o1.d.cts} +2 -2
  82. package/dist/{fake-DqieDYYA.d.cts.map → fake-Djx8E0o1.d.cts.map} +1 -1
  83. package/dist/file-server.cjs +79 -20
  84. package/dist/file-server.cjs.map +1 -1
  85. package/dist/file-server.d.cts +35 -17
  86. package/dist/file-server.d.cts.map +1 -1
  87. package/dist/file-server.d.mts +35 -17
  88. package/dist/file-server.d.mts.map +1 -1
  89. package/dist/file-server.mjs +80 -22
  90. package/dist/file-server.mjs.map +1 -1
  91. package/dist/functions/index.d.cts +1 -1
  92. package/dist/functions/index.d.mts +1 -1
  93. package/dist/{inbox-CR3L1fOI.d.cts → inbox-BjvMs7EJ.d.cts} +2 -2
  94. package/dist/{inbox-CR3L1fOI.d.cts.map → inbox-BjvMs7EJ.d.cts.map} +1 -1
  95. package/dist/{inbox-YOdxlyfj.d.mts → inbox-C8bOR9UL.d.mts} +2 -2
  96. package/dist/{inbox-YOdxlyfj.d.mts.map → inbox-C8bOR9UL.d.mts.map} +1 -1
  97. package/dist/inbox.d.cts +1 -1
  98. package/dist/inbox.d.mts +1 -1
  99. package/dist/{index-DPTHa6Ud.d.cts → index-DaK-C7N3.d.cts} +2 -2
  100. package/dist/{index-BoQ3-M-K.d.mts.map → index-DaK-C7N3.d.cts.map} +1 -1
  101. package/dist/{index-BoQ3-M-K.d.mts → index-vCS4HBEG.d.mts} +2 -2
  102. package/dist/{index-DPTHa6Ud.d.cts.map → index-vCS4HBEG.d.mts.map} +1 -1
  103. package/dist/{kysely-CebjCWTl.d.cts → kysely-2HqIQ2fC.d.cts} +3 -3
  104. package/dist/{kysely-CebjCWTl.d.cts.map → kysely-2HqIQ2fC.d.cts.map} +1 -1
  105. package/dist/{kysely-De5rAC-E.d.mts → kysely-BGvpd_ZH.d.mts} +3 -3
  106. package/dist/{kysely-De5rAC-E.d.mts.map → kysely-BGvpd_ZH.d.mts.map} +1 -1
  107. package/dist/mobile-app.cjs +5 -1
  108. package/dist/mobile-app.cjs.map +1 -1
  109. package/dist/mobile-app.d.cts +5 -1
  110. package/dist/mobile-app.d.cts.map +1 -1
  111. package/dist/mobile-app.d.mts +5 -1
  112. package/dist/mobile-app.d.mts.map +1 -1
  113. package/dist/mobile-app.mjs +6 -2
  114. package/dist/mobile-app.mjs.map +1 -1
  115. package/dist/object-storage.cjs +6 -6
  116. package/dist/object-storage.cjs.map +1 -1
  117. package/dist/object-storage.d.cts +3 -3
  118. package/dist/object-storage.d.cts.map +1 -1
  119. package/dist/object-storage.d.mts +3 -3
  120. package/dist/object-storage.d.mts.map +1 -1
  121. package/dist/object-storage.mjs +6 -6
  122. package/dist/object-storage.mjs.map +1 -1
  123. package/dist/processors/index.d.cts +1 -1
  124. package/dist/processors/index.d.mts +1 -1
  125. package/dist/queue/index.d.cts +1 -1
  126. package/dist/queue/index.d.mts +1 -1
  127. package/dist/random-password.d.cts +1 -1
  128. package/dist/random-password.d.mts +1 -1
  129. package/dist/rest-api.d.cts +4 -4
  130. package/dist/rest-api.d.mts +4 -4
  131. package/dist/site.cjs +6 -1
  132. package/dist/site.cjs.map +1 -1
  133. package/dist/site.d.cts +7 -2
  134. package/dist/site.d.cts.map +1 -1
  135. package/dist/site.d.mts +7 -2
  136. package/dist/site.d.mts.map +1 -1
  137. package/dist/site.mjs +7 -2
  138. package/dist/site.mjs.map +1 -1
  139. package/dist/subscribers/index.d.cts +1 -1
  140. package/dist/subscribers/index.d.mts +1 -1
  141. package/dist/{telemetry-CObow3Dn.d.mts → telemetry-BirKau0X.d.mts} +2 -2
  142. package/dist/{telemetry-C1oqncFY.d.cts.map → telemetry-BirKau0X.d.mts.map} +1 -1
  143. package/dist/{telemetry-C1oqncFY.d.cts → telemetry-DjJgtQ_N.d.cts} +2 -2
  144. package/dist/{telemetry-CObow3Dn.d.mts.map → telemetry-DjJgtQ_N.d.cts.map} +1 -1
  145. package/dist/telemetry.d.cts +1 -1
  146. package/dist/telemetry.d.mts +1 -1
  147. package/dist/{websocket-api-DkF8Hva-.d.cts → websocket-api-B1Wl3tg4.d.cts} +3 -3
  148. package/dist/{websocket-api-CPEzJyDt.d.mts.map → websocket-api-B1Wl3tg4.d.cts.map} +1 -1
  149. package/dist/{websocket-api-CPEzJyDt.d.mts → websocket-api-CvnPDSZB.d.mts} +3 -3
  150. package/dist/{websocket-api-DkF8Hva-.d.cts.map → websocket-api-CvnPDSZB.d.mts.map} +1 -1
  151. package/dist/websocket-api.d.cts +1 -1
  152. package/dist/websocket-api.d.mts +1 -1
  153. package/dist/worker.d.cts +8 -8
  154. package/dist/worker.d.mts +8 -8
  155. package/package.json +31 -31
  156. package/dist/construct-interface-CSA9VeWM.d.mts.map +0 -1
  157. package/dist/construct-interface-DugP0E5q.d.cts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-server.mjs","names":[],"sources":["../src/file-server.ts"],"sourcesContent":["/**\n * `FileServer` — a domain that serves a bucket's objects.\n *\n * `ObjectStorage` is the bucket: it writes, it presigns, and its URL is never\n * public. Serving those objects on a domain is a different thing, and it is a\n * construct of its own rather than a flag on the bucket — see\n * `docs/design/constructs-paradigm.md`, \"Why a separate construct, and what it\n * costs\", for the comparison that rules the other two shapes out.\n *\n * ```ts\n * export const uploads = new FileServer('Uploads', { open: ['brand/**'] });\n *\n * uploads.getUploadURL({ path, contentType }) // an S3 presign at the bucket\n * uploads.url('brand/logo.png') // open path — no signature\n * uploads.signedUrl('invoices/7.pdf') // one object, one recipient\n * ```\n *\n * **One construct, one client, both halves.** How a file lands in the bucket is\n * the same whether or not it is served, so splitting the upload half from the\n * serving half would be ceremony rather than safety. The client is a *superset*\n * of `StorageClient`, made literal in the type, so anything taking\n * `services.uploads` keeps compiling when the construct behind it grows a\n * serving half.\n *\n * **The id names the bucket, not the surface.** This is the detail that has to\n * be right before anything ships, because getting it backwards is destructive:\n * the migration people actually perform is serving a bucket they already have,\n * and naming the bucket after the construct makes that edit *add* a node rather\n * than rename the one holding the data.\n */\n\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\tDERIVED_PREFIX,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type { Construct, Declarable } from './construct-interface';\nimport { expiryDays, type ObjectExpiry } from './expire';\nimport type { Processor } from './processors/Processor';\nimport { ProcessorBuilder } from './processors/ProcessorBuilder';\nimport {\n\tfillPattern,\n\ttype PatternParams,\n\tparsePattern,\n} from './processors/pattern';\nimport type { Telemetry } from './telemetry';\n\n/**\n * A key an open pattern admits.\n *\n * The same template-literal trick `ConstructName` uses, so `open` is checked at\n * the call site rather than only at the edge:\n *\n * ```ts\n * files.url('brand/logo.png') // ok\n * files.url(`avatars/${id}.png`) // ok — a template literal still matches\n * files.url('invoices/7.pdf') // not assignable — never served unsigned\n * ```\n *\n * A single star and a double star resolve to the same type, stated rather than\n * discovered: a template literal cannot exclude `/`, so this is a prefix-and-\n * suffix guard while the *exact* pattern is enforced by the bucket policy, by\n * the cache behaviour, and by this construct's own runtime check. The type says\n * plausibly open; the infrastructure says definitely.\n */\nexport type Served<P extends string> = P extends `${infer Head}**`\n\t? `${Head}${string}`\n\t: P extends `${infer Head}*${infer Tail}`\n\t\t? `${Head}${string}${Tail}`\n\t\t: P;\n\n/** What consuming a file server hands you: a bucket client that also serves. */\nexport interface FileServerClient<TOpen extends string = never>\n\textends StorageClient {\n\t/**\n\t * The unsigned address of an open object.\n\t *\n\t * Compile-checked against the declared patterns, *and* checked again at\n\t * runtime — a JavaScript caller gets no compiler, and minting an unsigned\n\t * URL for a private object is a leak rather than a mistake.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\turl(key: Served<TOpen>): string;\n\n\t/**\n\t * The same thing for a key the compiler cannot see.\n\t *\n\t * A fully dynamic key does not type, which is correct and is also the case\n\t * people will hit — so the escape hatch is a named method rather than a\n\t * cast, and it runs the *same* runtime check rather than being a way around\n\t * it.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\topenUrl(key: string): string;\n\n\t/**\n\t * A signed address for one object and one recipient.\n\t *\n\t * Today this is an **S3 presign at the bucket**, which is what works\n\t * unchanged against MinIO locally and against S3 deployed. It is deliberately\n\t * not described as a CDN URL: CloudFront signing is a different mechanism,\n\t * with different keys, against a different host, and it needs key material\n\t * this construct does not yet declare.\n\t *\n\t * @param expiresIn - minutes, matching `getUploadURL`.\n\t */\n\tsignedUrl(key: string, expiresIn?: number): Promise<string>;\n\n\t/**\n\t * The address of a processor's derivative of an open object — the\n\t * thumbnail, not the original.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t * @throws {ProcessorNotOnThisServer} for another file server's processor.\n\t */\n\tprocessedUrl<\n\t\tTPattern extends string,\n\t\tTSchema extends StandardSchemaV1 | undefined,\n\t>(\n\t\tprocessor: Processor<TPattern, TSchema, any, any>,\n\t\tparams: ProcessorUrlParams<TPattern, TSchema>,\n\t\tkey: string,\n\t): string;\n}\n\n/**\n * What addresses a derivative: the values the processor's schema accepts —\n * its input, since these go into a path — or, without one, the raw strings.\n */\nexport type ProcessorUrlParams<\n\tTPattern extends string,\n\tTSchema extends StandardSchemaV1 | undefined,\n> = TSchema extends StandardSchemaV1\n\t? StandardSchemaV1.InferInput<TSchema>\n\t: PatternParams<TPattern>;\n\n/** A processed URL was asked of a file server the processor is not on. */\nexport class ProcessorNotOnThisServer extends Error {\n\tconstructor(\n\t\treadonly pattern: string,\n\t\treadonly server: string,\n\t\treadonly expected: string,\n\t) {\n\t\tsuper(\n\t\t\t`The processor at '${pattern}' belongs to '${server}', not '${expected}'. ` +\n\t\t\t\t`Ask its own file server for the URL: services.<its id>.processedUrl(…).`,\n\t\t);\n\t\tthis.name = 'ProcessorNotOnThisServer';\n\t}\n}\n\nexport interface FileServerOptions<TOpen extends string = never> {\n\t/**\n\t * Paths served without a signature. Everything else needs one.\n\t *\n\t * Private by default: a bucket where forgetting a flag publishes user\n\t * uploads is the wrong default, so this is an exception list, and listing it\n\t * in code means exactly one set of paths is unauthenticated and it is\n\t * reviewable in a diff.\n\t *\n\t * Uploading is deliberately *not* restricted to these. Writing to a path\n\t * that happens to be open is ordinary; the only asymmetry worth enforcing is\n\t * that you cannot hand out an unsigned URL for something the server would\n\t * refuse to serve unsigned.\n\t */\n\topen?: readonly TOpen[];\n\t/**\n\t * Open paths whose objects never change once written — keyed by a content\n\t * hash or a file id — so every client may keep them forever: the edge\n\t * sends `Cache-Control: public, max-age=31536000, immutable`, over\n\t * whatever the object was stored with.\n\t *\n\t * A subset of `open`, because a signed object is never served by the edge.\n\t * Only say it of paths whose keys are written once: a client holding an\n\t * immutable copy never asks again.\n\t */\n\timmutable?: readonly string[];\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * Delete the objects under each prefix this many days after they were\n\t * written — `{ 'previews/': { days: 7 } }`. A setting of the bucket this\n\t * server vends, so it cannot be given with `origin`.\n\t */\n\texpire?: ObjectExpiry;\n\t/**\n\t * How long its processors' derivatives are kept in the bucket before it\n\t * deletes them — 30 days unless said. They are remade on the next request,\n\t * so this trades storage for the work of making one again.\n\t */\n\tderived?: { readonly days: number };\n\t/**\n\t * What its processor unit emits — the `Telemetry` construct, as a worker\n\t * takes it: each request is a span, and the deploy hands the unit the\n\t * `OTEL_*` keys its stage resolves.\n\t */\n\ttelemetry?: Telemetry;\n\t/**\n\t * A bucket declared elsewhere, instead of one of this server's own.\n\t *\n\t * `new FileServer('Uploads')` declares both nodes; this fronts a bucket that\n\t * already exists, which is also how the two edges come back when you want\n\t * them separately — a handler depending on the bucket writes, a handler\n\t * depending on the server mints URLs.\n\t */\n\torigin?: Declarable;\n}\n\n/** An immutable pattern that no open pattern admits. */\nexport class ImmutableNotOpen extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly pattern: string,\n\t\treadonly open: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`'${id}' says '${pattern}' is immutable, and no open path admits it` +\n\t\t\t\t(open.length ? ` (open: ${open.join(', ')})` : ' — it opens none') +\n\t\t\t\t'. Only an open path is served by the edge, so only one can be ' +\n\t\t\t\t'cached there: add it to `open`, or narrow it to one that is.',\n\t\t);\n\t\tthis.name = 'ImmutableNotOpen';\n\t}\n}\n\n/**\n * A bucket setting given to a file server that fronts a bucket declared\n * elsewhere — where the bucket's own construct is the one that says it.\n */\nexport class BucketOptionOnOrigin extends Error {\n\tconstructor(\n\t\treadonly server: string,\n\t\treadonly origin: string,\n\t\treadonly option: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${server}' fronts '${origin}', which declares itself, so '${option}' ` +\n\t\t\t\t`belongs on the construct that declares '${origin}', not on the file server.`,\n\t\t);\n\t\tthis.name = 'BucketOptionOnOrigin';\n\t}\n}\n\n/** A key was asked to be served unsigned, and no open pattern admits it. */\nexport class NotOpen extends Error {\n\tconstructor(\n\t\treadonly key: string,\n\t\treadonly open: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`'${key}' is not served without a signature. ` +\n\t\t\t\t(open.length\n\t\t\t\t\t? `Open paths: ${open.join(', ')}. Use signedUrl() for anything else.`\n\t\t\t\t\t: 'This file server declares no open paths, so every object needs signedUrl().'),\n\t\t);\n\t\tthis.name = 'NotOpen';\n\t}\n}\n\nexport class FileServer<\n\tTName extends string = string,\n\tTOpen extends string = never,\n> implements Construct<TName, FileServerClient<TOpen>>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, FileServerClient<TOpen>>;\n\n\t/** The id of the surface node, as opposed to the bucket's. */\n\treadonly surfaceId: string;\n\n\tprivate readonly open: readonly string[];\n\tprivate readonly immutable: readonly string[];\n\n\t/** The vended bucket's expiry, checked once: prefix → days. */\n\tprivate readonly expire: Record<string, number> | undefined;\n\n\t/** Days its processors' derivatives are kept, when it says. */\n\tprivate readonly derivedDays: number | undefined;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the keys the\n\t * target publishes and the keys the client reads cannot drift.\n\t */\n\tprivate readonly keys: { origin: string; server: string };\n\n\t/**\n\t * How a processor reaches the bucket: the bucket's own URL and nothing of\n\t * the serving half, which a processor never needs. A field, not a getter:\n\t * services are cached by object identity.\n\t */\n\tprivate readonly origin: Service<string, StorageClient>;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: FileServerOptions<TOpen> = {},\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.open = options.open ?? [];\n\t\tthis.immutable = options.immutable ?? [];\n\t\tfor (const pattern of this.immutable) {\n\t\t\tif (!this.covers(pattern)) {\n\t\t\t\tthrow new ImmutableNotOpen(canonical, pattern, this.open);\n\t\t\t}\n\t\t}\n\n\t\t// The surface takes the suffix and the bucket keeps the plain id, which\n\t\t// is what makes \"serve a bucket I already have\" an edit that adds a node\n\t\t// instead of renaming the one holding the data.\n\t\tconst originId = options.origin?.id ?? canonical;\n\t\tif (options.origin && options.expire) {\n\t\t\tthrow new BucketOptionOnOrigin(canonical, originId, 'expire');\n\t\t}\n\t\tthis.expire = expiryDays(canonical, options.expire);\n\t\tthis.derivedDays = options.derived\n\t\t\t? expiryDays(canonical, { [DERIVED_PREFIX]: options.derived })?.[\n\t\t\t\t\tDERIVED_PREFIX\n\t\t\t\t]\n\t\t\t: undefined;\n\t\tthis.surfaceId = `${canonical}Server`;\n\n\t\tthis.keys = {\n\t\t\torigin: provideKey(originId, 'url'),\n\t\t\tserver: provideKey(this.surfaceId, 'url'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (registerOptions) => this.connect(registerOptions),\n\t\t};\n\n\t\tconst originKey = this.keys.origin;\n\t\tthis.origin = {\n\t\t\tserviceName: `${serviceKey(originId)}ProcessorOrigin`,\n\t\t\tregister: ({ envParser }) => {\n\t\t\t\tconst { url } = envParser\n\t\t\t\t\t.create((get) => ({ url: get(originKey).string() }))\n\t\t\t\t\t.parse();\n\t\t\t\treturn createStorageClient(url);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * A processor behind one path pattern of this server: a handler that makes\n\t * a derivative of an open object on read.\n\t *\n\t * ```ts\n\t * export const thumbnails = assets\n\t * .process('/i/:width/*')\n\t * .params(z.object({ width: z.enum(['64', '256', '1024']) }))\n\t * .native(['sharp'])\n\t * .handle(async ({ params, object }) => ({\n\t * body: await sharp(await object.bytes()).resize(Number(params.width)).webp().toBuffer(),\n\t * contentType: 'image/webp',\n\t * cache: 'immutable',\n\t * }));\n\t * ```\n\t *\n\t * Open paths only: a key no `open` pattern admits is answered 404, as an\n\t * unsigned read of it would be.\n\t *\n\t * @throws {ProcessorPatternInvalid} for a pattern the edge cannot route.\n\t */\n\tprocess<TPattern extends `/${string}/*`>(\n\t\tpattern: TPattern,\n\t\toptions: { logger?: Logger } = {},\n\t): ProcessorBuilder<TPattern> {\n\t\treturn new ProcessorBuilder<TPattern>({\n\t\t\tparsed: parsePattern(pattern),\n\t\t\tsurfaceId: this.surfaceId,\n\t\t\tbucketId: this.options.origin?.id ?? this.id,\n\t\t\torigin: this.origin,\n\t\t\tserves: (key) => this.serves(key),\n\t\t\tlogger: (options.logger ?? DEFAULT_LOGGER) as Logger,\n\t\t\tnative: [],\n\t\t\tservices: [],\n\t\t\tconstructs: [],\n\t\t});\n\t}\n\n\t/**\n\t * The served surface, as something an edge can point at.\n\t *\n\t * Depending on the `FileServer` itself points at the **bucket** — its\n\t * canonical node — which is right for a handler: it presigns and writes. But\n\t * a bucket's URL is never public, so a site depending on it gets nothing\n\t * inlined, which is correct and also useless.\n\t *\n\t * This is the other half: `.dependsOn([uploads.server])` points at the\n\t * surface, whose address *is* public, and is what puts\n\t * `VITE_UPLOADS_SERVER_URL` in a bundle. The same accessor shape\n\t * `database.reader()` uses, and for the same reason — one construct owning\n\t * two addresses needs a way to name the second.\n\t */\n\tget server(): Declarable {\n\t\tconst surface = this.declare().find(\n\t\t\t(declaration) => declaration.id === this.surfaceId,\n\t\t);\n\n\t\treturn {\n\t\t\tid: this.surfaceId,\n\t\t\tdeclare: () => (surface ? [surface] : []),\n\t\t};\n\t}\n\n\t/**\n\t * The bucket and the surface over it — or just the surface, when the bucket\n\t * was declared elsewhere.\n\t *\n\t * The surface names its origin through `of`, which is what makes the\n\t * reference check work: an origin resolving to nothing is a build failure,\n\t * the same guarantee `assertDerivations` already gives a reader and a schema\n\t * tenant.\n\t */\n\tdeclare(): Declaration[] {\n\t\tconst origin = this.options.origin;\n\n\t\tconst surface: Declaration = {\n\t\t\tkind: 'file-server',\n\t\t\tid: this.surfaceId,\n\t\t\tof: origin?.id ?? this.id,\n\t\t\t...(this.open.length ? { open: this.open } : {}),\n\t\t\t...(this.immutable.length ? { immutable: this.immutable } : {}),\n\t\t\t...(this.derivedDays !== undefined\n\t\t\t\t? { derivedDays: this.derivedDays }\n\t\t\t\t: {}),\n\t\t\t...(this.options.telemetry\n\t\t\t\t? { telemetry: this.options.telemetry.id }\n\t\t\t\t: {}),\n\t\t\tprovides: [this.keys.server],\n\t\t};\n\n\t\t// A vended bucket is declared here; a given one already declares itself,\n\t\t// and declaring it twice is the duplication the whole model removes.\n\t\tif (origin) return [surface];\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.origin],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t\t...(this.expire ? { expire: this.expire } : {}),\n\t\t\t},\n\t\t\tsurface,\n\t\t];\n\t}\n\n\t/**\n\t * The bucket's client, with the serving half added.\n\t *\n\t * Both addresses are read here, which is also how the environment reaches a\n\t * handler: the sniffer records what this reads, so `.dependsOn([uploads])`\n\t * carries the bucket URL and the server URL without either being written\n\t * down beside the handler.\n\t */\n\tprivate async connect(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<FileServerClient<TOpen>> {\n\t\tconst { origin, server } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\torigin: get(this.keys.origin).string(),\n\t\t\t\tserver: get(this.keys.server).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\tconst storage = createStorageClient(origin);\n\t\tconst base = server.replace(/\\/+$/, '');\n\n\t\tconst serve = (key: string): string => {\n\t\t\tif (!this.serves(key)) throw new NotOpen(key, this.open);\n\n\t\t\treturn `${base}/${key.replace(/^\\/+/, '')}`;\n\t\t};\n\n\t\t// Delegating rather than copying: the bucket half is whatever the driver\n\t\t// produced, including anything it grows later, and only the serving half\n\t\t// is added on top.\n\t\treturn Object.assign(Object.create(storage) as StorageClient, {\n\t\t\turl: serve as (key: Served<TOpen>) => string,\n\t\t\topenUrl: serve,\n\t\t\tsignedUrl: (key: string, expiresIn?: number) =>\n\t\t\t\tstorage.getDownloadURL({ path: key } as never, expiresIn),\n\t\t\tprocessedUrl: (\n\t\t\t\tprocessor: Processor<string, any, any, any>,\n\t\t\t\tparams: Record<string, string | number>,\n\t\t\t\tkey: string,\n\t\t\t) => {\n\t\t\t\tif (processor.surfaceId !== this.surfaceId) {\n\t\t\t\t\tthrow new ProcessorNotOnThisServer(\n\t\t\t\t\t\tprocessor.pattern,\n\t\t\t\t\t\tprocessor.surfaceId,\n\t\t\t\t\t\tthis.surfaceId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!this.serves(key)) throw new NotOpen(key, this.open);\n\t\t\t\treturn `${base}${fillPattern(processor.parsed, params, key)}`;\n\t\t\t},\n\t\t}) as FileServerClient<TOpen>;\n\t}\n\n\t/**\n\t * Whether an open pattern admits a key.\n\t *\n\t * The runtime half of {@link Served}, and stricter than it: here a single\n\t * star stops at a segment boundary and a double star does not, which is the\n\t * distinction a template-literal type cannot draw and the infrastructure\n\t * does.\n\t */\n\tprivate serves(key: string): boolean {\n\t\treturn this.open.some((pattern) => globToRegExp(pattern).test(key));\n\t}\n\n\t/**\n\t * Whether every key a pattern admits is open: the pattern itself, each of\n\t * its wildcards taken as a segment of its own, is a key an open pattern\n\t * serves — `brand/logos/*` under `brand/**`, but not `**` under `brand/**`.\n\t */\n\tprivate covers(pattern: string): boolean {\n\t\treturn this.serves(pattern.replace(/\\*\\*/g, 'x/x').replace(/\\*/g, 'x'));\n\t}\n}\n\n/**\n * One open pattern as an anchored expression.\n *\n * A double star crosses `/`; a single star does not. Both are consumed in one\n * left-to-right pass rather than by substitution, so a pattern cannot be\n * rewritten into a placeholder that a later pass mistakes for literal text.\n */\nfunction globToRegExp(pattern: string): RegExp {\n\tlet source = '';\n\n\tfor (let index = 0; index < pattern.length; index++) {\n\t\tconst character = pattern[index];\n\n\t\tif (character !== '*') {\n\t\t\tsource += character?.replace(/[.+^${}()|[\\]\\\\?]/, '\\\\$&') ?? '';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (pattern[index + 1] === '*') {\n\t\t\tsource += '.*';\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tsource += '[^/]*';\n\t}\n\n\treturn new RegExp(`^${source}$`);\n}\n"],"mappings":";;;;;;;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AAM,IAAI,QAAQ,KAAK,KAAK,IAAI;GAEvD,OAAO,GAAG,KAAK,GAAG,IAAI,QAAQ,QAAQ,EAAE;EACzC;EAKA,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,GAAoB;GAC7D,KAAK;GACL,SAAS;GACT,YAAY,KAAa,cACxB,QAAQ,eAAe,EAAE,MAAM,IAAI,GAAY,SAAS;GACzD,eACC,WACA,QACA,QACI;IACJ,IAAI,UAAU,cAAc,KAAK,WAChC,MAAM,IAAI,yBACT,UAAU,SACV,UAAU,WACV,KAAK,SACN;IAED,IAAI,CAAC,KAAK,OAAO,GAAG,GAAG,MAAM,IAAI,QAAQ,KAAK,KAAK,IAAI;IACvD,OAAO,GAAG,OAAO,YAAY,UAAU,QAAQ,QAAQ,GAAG;GAC3D;EACD,CAAC;CACF;;;;;;;;;CAUA,OAAe,KAAsB;EACpC,OAAO,KAAK,KAAK,MAAM,YAAY,aAAa,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC;CACnE;;;;;;CAOA,OAAe,SAA0B;EACxC,OAAO,KAAK,OAAO,QAAQ,QAAQ,SAAS,KAAK,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC;CACvE;AACD;;;;;;;;AASA,SAAS,aAAa,SAAyB;CAC9C,IAAI,SAAS;CAEb,KAAK,IAAI,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,SAAS;EACpD,MAAM,YAAY,QAAQ;EAE1B,IAAI,cAAc,KAAK;GACtB,UAAU,WAAW,QAAQ,qBAAqB,MAAM,KAAK;GAC7D;EACD;EAEA,IAAI,QAAQ,QAAQ,OAAO,KAAK;GAC/B,UAAU;GACV;GACA;EACD;EAEA,UAAU;CACX;CAEA,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE;AAChC"}
1
+ {"version":3,"file":"file-server.mjs","names":[],"sources":["../src/file-server.ts"],"sourcesContent":["/**\n * `FileServer` — a domain that serves a bucket's objects.\n *\n * `ObjectStorage` is the bucket: it writes, it presigns, and its URL is never\n * public. Serving those objects on a domain is a different thing, and it is a\n * construct of its own rather than a flag on the bucket — see\n * `docs/design/constructs-paradigm.md`, \"Why a separate construct, and what it\n * costs\", for the comparison that rules the other two shapes out.\n *\n * ```ts\n * export const uploads = new FileServer('Uploads', { open: ['brand/**'] });\n *\n * uploads.getUploadURL({ path, contentType }) // an S3 presign at the bucket\n * uploads.url('brand/logo.png') // open path — no signature\n * uploads.signedUrl('invoices/7.pdf') // one object, one recipient\n * ```\n *\n * **One construct, one client, both halves.** How a file lands in the bucket is\n * the same whether or not it is served, so splitting the upload half from the\n * serving half would be ceremony rather than safety. The client is a *superset*\n * of `StorageClient`, made literal in the type, so anything taking\n * `services.uploads` keeps compiling when the construct behind it grows a\n * serving half.\n *\n * **The id names the bucket, not the surface.** This is the detail that has to\n * be right before anything ships, because getting it backwards is destructive:\n * the migration people actually perform is serving a bucket they already have,\n * and naming the bucket after the construct makes that edit *add* a node rather\n * than rename the one holding the data.\n */\n\nimport type { Logger } from '@geekmidas/logger';\nimport { DEFAULT_LOGGER } from '@geekmidas/logger/console';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\tDERIVED_PREFIX,\n\ttype Declaration,\n\tfileServerSurfaceId,\n\tprovidedKeyFor,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport type {\n\tConstruct,\n\tDeclarable,\n\tHasPublicFace,\n} from './construct-interface';\nimport { expiryDays, type ObjectExpiry } from './expire';\nimport type { Processor } from './processors/Processor';\nimport { ProcessorBuilder } from './processors/ProcessorBuilder';\nimport {\n\tfillPattern,\n\ttype PatternParams,\n\tparsePattern,\n} from './processors/pattern';\nimport type { Telemetry } from './telemetry';\n\n/**\n * A key an open pattern admits.\n *\n * The same template-literal trick `ConstructName` uses, so `open` is checked at\n * the call site rather than only at the edge:\n *\n * ```ts\n * files.url('brand/logo.png') // ok\n * files.url(`avatars/${id}.png`) // ok — a template literal still matches\n * files.url('invoices/7.pdf') // not assignable — never served unsigned\n * ```\n *\n * A single star and a double star resolve to the same type, stated rather than\n * discovered: a template literal cannot exclude `/`, so this is a prefix-and-\n * suffix guard while the *exact* pattern is enforced by the bucket policy, by\n * the cache behaviour, and by this construct's own runtime check. The type says\n * plausibly open; the infrastructure says definitely.\n */\nexport type Served<P extends string> = P extends `${infer Head}**`\n\t? `${Head}${string}`\n\t: P extends `${infer Head}*${infer Tail}`\n\t\t? `${Head}${string}${Tail}`\n\t\t: P;\n\n/** What consuming a file server hands you: a bucket client that also serves. */\nexport interface FileServerClient<TOpen extends string = never>\n\textends StorageClient {\n\t/**\n\t * The unsigned address of an open object.\n\t *\n\t * Compile-checked against the declared patterns, *and* checked again at\n\t * runtime — a JavaScript caller gets no compiler, and minting an unsigned\n\t * URL for a private object is a leak rather than a mistake.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\turl(key: Served<TOpen>): string;\n\n\t/**\n\t * The same thing for a key the compiler cannot see.\n\t *\n\t * A fully dynamic key does not type, which is correct and is also the case\n\t * people will hit — so the escape hatch is a named method rather than a\n\t * cast, and it runs the *same* runtime check rather than being a way around\n\t * it.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t */\n\topenUrl(key: string): string;\n\n\t/**\n\t * A signed address for one object and one recipient.\n\t *\n\t * Today this is an **S3 presign at the bucket**, which is what works\n\t * unchanged against MinIO locally and against S3 deployed. It is deliberately\n\t * not described as a CDN URL: CloudFront signing is a different mechanism,\n\t * with different keys, against a different host, and it needs key material\n\t * this construct does not yet declare.\n\t *\n\t * @param expiresIn - minutes, matching `getUploadURL`.\n\t */\n\tsignedUrl(key: string, expiresIn?: number): Promise<string>;\n\n\t/**\n\t * The address of a processor's derivative of an open object — the\n\t * thumbnail, not the original.\n\t *\n\t * @throws {NotOpen} when the key matches no declared pattern.\n\t * @throws {ProcessorNotOnThisServer} for another file server's processor.\n\t */\n\tprocessedUrl<\n\t\tTPattern extends string,\n\t\tTSchema extends StandardSchemaV1 | undefined,\n\t>(\n\t\tprocessor: Processor<TPattern, TSchema, any, any>,\n\t\tparams: ProcessorUrlParams<TPattern, TSchema>,\n\t\tkey: string,\n\t): string;\n}\n\n/**\n * What addresses a derivative: the values the processor's schema accepts —\n * its input, since these go into a path — or, without one, the raw strings.\n */\nexport type ProcessorUrlParams<\n\tTPattern extends string,\n\tTSchema extends StandardSchemaV1 | undefined,\n> = TSchema extends StandardSchemaV1\n\t? StandardSchemaV1.InferInput<TSchema>\n\t: PatternParams<TPattern>;\n\n/** A processed URL was asked of a file server the processor is not on. */\nexport class ProcessorNotOnThisServer extends Error {\n\tconstructor(\n\t\treadonly pattern: string,\n\t\treadonly server: string,\n\t\treadonly expected: string,\n\t) {\n\t\tsuper(\n\t\t\t`The processor at '${pattern}' belongs to '${server}', not '${expected}'. ` +\n\t\t\t\t`Ask its own file server for the URL: services.<its id>.processedUrl(…).`,\n\t\t);\n\t\tthis.name = 'ProcessorNotOnThisServer';\n\t}\n}\n\nexport interface FileServerOptions<TOpen extends string = never> {\n\t/**\n\t * Paths served without a signature. Everything else needs one.\n\t *\n\t * Private by default: a bucket where forgetting a flag publishes user\n\t * uploads is the wrong default, so this is an exception list, and listing it\n\t * in code means exactly one set of paths is unauthenticated and it is\n\t * reviewable in a diff.\n\t *\n\t * Uploading is deliberately *not* restricted to these. Writing to a path\n\t * that happens to be open is ordinary; the only asymmetry worth enforcing is\n\t * that you cannot hand out an unsigned URL for something the server would\n\t * refuse to serve unsigned.\n\t */\n\topen?: readonly TOpen[];\n\t/**\n\t * Open paths whose objects never change once written — keyed by a content\n\t * hash or a file id — so every client may keep them forever: the edge\n\t * sends `Cache-Control: public, max-age=31536000, immutable`, over\n\t * whatever the object was stored with.\n\t *\n\t * A subset of `open`, because a signed object is never served by the edge.\n\t * Only say it of paths whose keys are written once: a client holding an\n\t * immutable copy never asks again.\n\t */\n\timmutable?: readonly string[];\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * Delete the objects under each prefix this many days after they were\n\t * written — `{ 'previews/': { days: 7 } }`. A setting of the bucket this\n\t * server vends, so it cannot be given with `origin`.\n\t */\n\texpire?: ObjectExpiry;\n\t/**\n\t * How long its processors' derivatives are kept in the bucket before it\n\t * deletes them — 30 days unless said. They are remade on the next request,\n\t * so this trades storage for the work of making one again.\n\t */\n\tderived?: { readonly days: number };\n\t/**\n\t * What its processor unit emits — the `Telemetry` construct, as a worker\n\t * takes it: each request is a span, and the deploy hands the unit the\n\t * `OTEL_*` keys its stage resolves.\n\t */\n\ttelemetry?: Telemetry;\n\t/**\n\t * A bucket declared elsewhere, instead of one of this server's own.\n\t *\n\t * `new FileServer('Uploads')` declares both nodes; this fronts a bucket that\n\t * already exists, which is also how the two edges come back when you want\n\t * them separately — a handler depending on the bucket writes, a handler\n\t * depending on the server mints URLs.\n\t */\n\torigin?: Declarable;\n}\n\n/** An immutable pattern that no open pattern admits. */\nexport class ImmutableNotOpen extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly pattern: string,\n\t\treadonly open: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`'${id}' says '${pattern}' is immutable, and no open path admits it` +\n\t\t\t\t(open.length ? ` (open: ${open.join(', ')})` : ' — it opens none') +\n\t\t\t\t'. Only an open path is served by the edge, so only one can be ' +\n\t\t\t\t'cached there: add it to `open`, or narrow it to one that is.',\n\t\t);\n\t\tthis.name = 'ImmutableNotOpen';\n\t}\n}\n\n/**\n * A bucket setting given to a file server that fronts a bucket declared\n * elsewhere — where the bucket's own construct is the one that says it.\n */\nexport class BucketOptionOnOrigin extends Error {\n\tconstructor(\n\t\treadonly server: string,\n\t\treadonly origin: string,\n\t\treadonly option: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${server}' fronts '${origin}', which declares itself, so '${option}' ` +\n\t\t\t\t`belongs on the construct that declares '${origin}', not on the file server.`,\n\t\t);\n\t\tthis.name = 'BucketOptionOnOrigin';\n\t}\n}\n\n/**\n * A bucket method called on a file server's client that was handed only its\n * public address — a frontend's plain edge.\n */\nexport class FileServerReadOnly extends Error {\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly method: string,\n\t\treadonly key: string,\n\t) {\n\t\tsuper(\n\t\t\t`'${id}' was reached through its public address only, so it serves ` +\n\t\t\t\t`and cannot ${method}(): ${key} is not in this process's environment. ` +\n\t\t\t\t`A site or app whose server half writes or presigns depends on ` +\n\t\t\t\t`'${id}'.server instead — .dependsOn([${id.charAt(0).toLowerCase()}${id.slice(1)}.server]).`,\n\t\t);\n\t\tthis.name = 'FileServerReadOnly';\n\t}\n}\n\n/** Names asked of any object, which a read-only client must not answer. */\nconst INTROSPECTED = new Set([\n\t'then',\n\t'toJSON',\n\t'constructor',\n\t'asymmetricMatch',\n\t'$$typeof',\n\t'nodeType',\n\t'inspect',\n]);\n\n/**\n * The bucket half of a client that has no bucket: every method throws\n * {@link FileServerReadOnly}, naming itself.\n *\n * A proxy rather than a list of stubs, so a method the storage client grows\n * later refuses the same way. What a runtime asks of any object is left\n * alone: `then`, because a client is resolved from a promise, and the names a\n * serialiser or a test's printer looks for.\n */\nfunction readOnlyStorage(id: string, key: string): StorageClient {\n\treturn new Proxy({} as StorageClient, {\n\t\tget(_target, property) {\n\t\t\tif (typeof property !== 'string' || INTROSPECTED.has(property)) return;\n\t\t\treturn () => {\n\t\t\t\tthrow new FileServerReadOnly(id, property, key);\n\t\t\t};\n\t\t},\n\t});\n}\n\n/** A key was asked to be served unsigned, and no open pattern admits it. */\nexport class NotOpen extends Error {\n\tconstructor(\n\t\treadonly key: string,\n\t\treadonly open: readonly string[],\n\t) {\n\t\tsuper(\n\t\t\t`'${key}' is not served without a signature. ` +\n\t\t\t\t(open.length\n\t\t\t\t\t? `Open paths: ${open.join(', ')}. Use signedUrl() for anything else.`\n\t\t\t\t\t: 'This file server declares no open paths, so every object needs signedUrl().'),\n\t\t);\n\t\tthis.name = 'NotOpen';\n\t}\n}\n\nexport class FileServer<\n\tTName extends string = string,\n\tTOpen extends string = never,\n> implements Construct<TName, FileServerClient<TOpen>>, HasPublicFace\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, FileServerClient<TOpen>>;\n\n\t/** The id of the surface node, as opposed to the bucket's. */\n\treadonly surfaceId: string;\n\n\tprivate readonly open: readonly string[];\n\tprivate readonly immutable: readonly string[];\n\n\t/** The vended bucket's expiry, checked once: prefix → days. */\n\tprivate readonly expire: Record<string, number> | undefined;\n\n\t/** Days its processors' derivatives are kept, when it says. */\n\tprivate readonly derivedDays: number | undefined;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the keys the\n\t * target publishes and the keys the client reads cannot drift.\n\t */\n\tprivate readonly keys: { origin: string; server: string };\n\n\t/**\n\t * How a processor reaches the bucket: the bucket's own URL and nothing of\n\t * the serving half, which a processor never needs. A field, not a getter:\n\t * services are cached by object identity.\n\t */\n\tprivate readonly origin: Service<string, StorageClient>;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: FileServerOptions<TOpen> = {},\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.open = options.open ?? [];\n\t\tthis.immutable = options.immutable ?? [];\n\t\tfor (const pattern of this.immutable) {\n\t\t\tif (!this.covers(pattern)) {\n\t\t\t\tthrow new ImmutableNotOpen(canonical, pattern, this.open);\n\t\t\t}\n\t\t}\n\n\t\t// The surface takes the suffix and the bucket keeps the plain id, which\n\t\t// is what makes \"serve a bucket I already have\" an edit that adds a node\n\t\t// instead of renaming the one holding the data.\n\t\tconst originId = options.origin?.id ?? canonical;\n\t\tif (options.origin && options.expire) {\n\t\t\tthrow new BucketOptionOnOrigin(canonical, originId, 'expire');\n\t\t}\n\t\tthis.expire = expiryDays(canonical, options.expire);\n\t\tthis.derivedDays = options.derived\n\t\t\t? expiryDays(canonical, { [DERIVED_PREFIX]: options.derived })?.[\n\t\t\t\t\tDERIVED_PREFIX\n\t\t\t\t]\n\t\t\t: undefined;\n\t\tthis.surfaceId = fileServerSurfaceId(canonical);\n\n\t\tthis.keys = {\n\t\t\torigin: provideKey(originId, 'connectionString'),\n\t\t\tserver: providedKeyFor(this.surfaceId, 'file-server', 'url'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (registerOptions) => this.connect(registerOptions),\n\t\t};\n\n\t\tconst originKey = this.keys.origin;\n\t\tthis.origin = {\n\t\t\tserviceName: `${serviceKey(originId)}ProcessorOrigin`,\n\t\t\tregister: ({ envParser }) => {\n\t\t\t\tconst { url } = envParser\n\t\t\t\t\t.create((get) => ({ url: get(originKey).string() }))\n\t\t\t\t\t.parse();\n\t\t\t\treturn createStorageClient(url);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * A processor behind one path pattern of this server: a handler that makes\n\t * a derivative of an open object on read.\n\t *\n\t * ```ts\n\t * export const thumbnails = assets\n\t * .process('/i/:width/*')\n\t * .params(z.object({ width: z.enum(['64', '256', '1024']) }))\n\t * .native(['sharp'])\n\t * .handle(async ({ params, object }) => ({\n\t * body: await sharp(await object.bytes()).resize(Number(params.width)).webp().toBuffer(),\n\t * contentType: 'image/webp',\n\t * cache: 'immutable',\n\t * }));\n\t * ```\n\t *\n\t * Open paths only: a key no `open` pattern admits is answered 404, as an\n\t * unsigned read of it would be.\n\t *\n\t * @throws {ProcessorPatternInvalid} for a pattern the edge cannot route.\n\t */\n\tprocess<TPattern extends `/${string}/*`>(\n\t\tpattern: TPattern,\n\t\toptions: { logger?: Logger } = {},\n\t): ProcessorBuilder<TPattern> {\n\t\treturn new ProcessorBuilder<TPattern>({\n\t\t\tparsed: parsePattern(pattern),\n\t\t\tsurfaceId: this.surfaceId,\n\t\t\tbucketId: this.options.origin?.id ?? this.id,\n\t\t\torigin: this.origin,\n\t\t\tserves: (key) => this.serves(key),\n\t\t\tlogger: (options.logger ?? DEFAULT_LOGGER) as Logger,\n\t\t\tnative: [],\n\t\t\tservices: [],\n\t\t\tconstructs: [],\n\t\t});\n\t}\n\n\t/**\n\t * The served surface: what a site's or a mobile app's plain\n\t * `.dependsOn([uploads])` points at.\n\t *\n\t * Its address is public, so the frontend is built with it\n\t * (`VITE_UPLOADS_URL`) — and it is all the frontend gets: no bucket, no\n\t * key. A backend's plain edge is to the bucket, as it presigns and writes.\n\t */\n\tget publicFace(): Declarable {\n\t\tconst surface = this.declare().find(\n\t\t\t(declaration) => declaration.id === this.surfaceId,\n\t\t);\n\n\t\treturn {\n\t\t\tid: this.surfaceId,\n\t\t\tdeclare: () => (surface ? [surface] : []),\n\t\t};\n\t}\n\n\t/**\n\t * Everything: the bucket, its credentials, and the address it is served\n\t * on.\n\t *\n\t * What a backend's plain edge already is. A frontend asks for it by name —\n\t * `.dependsOn([uploads.server])` — when its server half uploads or\n\t * presigns: a full-stack site's, never a bundle's. The bucket's connection\n\t * is never inlined into a bundle either way; only the served address is.\n\t */\n\tget server(): Declarable {\n\t\tconst originId = this.options.origin?.id ?? this.id;\n\t\tconst declarations = this.options.origin\n\t\t\t? this.options.origin.declare()\n\t\t\t: this.declare();\n\n\t\treturn { id: originId, declare: () => declarations };\n\t}\n\n\t/**\n\t * The bucket and the surface over it — or just the surface, when the bucket\n\t * was declared elsewhere.\n\t *\n\t * The surface names its origin through `of`, which is what makes the\n\t * reference check work: an origin resolving to nothing is a build failure,\n\t * the same guarantee `assertDerivations` already gives a reader and a schema\n\t * tenant.\n\t */\n\tdeclare(): Declaration[] {\n\t\tconst origin = this.options.origin;\n\n\t\tconst surface: Declaration = {\n\t\t\tkind: 'file-server',\n\t\t\tid: this.surfaceId,\n\t\t\tof: origin?.id ?? this.id,\n\t\t\t...(this.open.length ? { open: this.open } : {}),\n\t\t\t...(this.immutable.length ? { immutable: this.immutable } : {}),\n\t\t\t...(this.derivedDays !== undefined\n\t\t\t\t? { derivedDays: this.derivedDays }\n\t\t\t\t: {}),\n\t\t\t...(this.options.telemetry\n\t\t\t\t? { telemetry: this.options.telemetry.id }\n\t\t\t\t: {}),\n\t\t\tprovides: [this.keys.server],\n\t\t};\n\n\t\t// A vended bucket is declared here; a given one already declares itself,\n\t\t// and declaring it twice is the duplication the whole model removes.\n\t\tif (origin) return [surface];\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.origin],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t\t...(this.expire ? { expire: this.expire } : {}),\n\t\t\t},\n\t\t\tsurface,\n\t\t];\n\t}\n\n\t/**\n\t * The bucket's client, with the serving half added.\n\t *\n\t * Both keys are read here, which is also how the environment reaches a\n\t * handler: the sniffer records what this reads, so `.dependsOn([uploads])`\n\t * carries the bucket's connection and the server's address without either\n\t * being written down beside the handler.\n\t *\n\t * Without the connection — a site's or an app's plain edge, which is to\n\t * the public face — the client serves and does nothing else: its bucket\n\t * methods throw {@link FileServerReadOnly}.\n\t */\n\tprivate async connect(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<FileServerClient<TOpen>> {\n\t\tconst { origin, server } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\torigin: get(this.keys.origin).string().optional(),\n\t\t\t\tserver: get(this.keys.server).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\tconst storage = origin\n\t\t\t? createStorageClient(origin)\n\t\t\t: readOnlyStorage(this.id, this.keys.origin);\n\t\tconst base = server.replace(/\\/+$/, '');\n\n\t\tconst serve = (key: string): string => {\n\t\t\tif (!this.serves(key)) throw new NotOpen(key, this.open);\n\n\t\t\treturn `${base}/${key.replace(/^\\/+/, '')}`;\n\t\t};\n\n\t\t// Delegating rather than copying: the bucket half is whatever the driver\n\t\t// produced, including anything it grows later, and only the serving half\n\t\t// is added on top.\n\t\treturn Object.assign(Object.create(storage) as StorageClient, {\n\t\t\turl: serve as (key: Served<TOpen>) => string,\n\t\t\topenUrl: serve,\n\t\t\tsignedUrl: (key: string, expiresIn?: number) =>\n\t\t\t\tstorage.getDownloadURL({ path: key } as never, expiresIn),\n\t\t\tprocessedUrl: (\n\t\t\t\tprocessor: Processor<string, any, any, any>,\n\t\t\t\tparams: Record<string, string | number>,\n\t\t\t\tkey: string,\n\t\t\t) => {\n\t\t\t\tif (processor.surfaceId !== this.surfaceId) {\n\t\t\t\t\tthrow new ProcessorNotOnThisServer(\n\t\t\t\t\t\tprocessor.pattern,\n\t\t\t\t\t\tprocessor.surfaceId,\n\t\t\t\t\t\tthis.surfaceId,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (!this.serves(key)) throw new NotOpen(key, this.open);\n\t\t\t\treturn `${base}${fillPattern(processor.parsed, params, key)}`;\n\t\t\t},\n\t\t}) as FileServerClient<TOpen>;\n\t}\n\n\t/**\n\t * Whether an open pattern admits a key.\n\t *\n\t * The runtime half of {@link Served}, and stricter than it: here a single\n\t * star stops at a segment boundary and a double star does not, which is the\n\t * distinction a template-literal type cannot draw and the infrastructure\n\t * does.\n\t */\n\tprivate serves(key: string): boolean {\n\t\treturn this.open.some((pattern) => globToRegExp(pattern).test(key));\n\t}\n\n\t/**\n\t * Whether every key a pattern admits is open: the pattern itself, each of\n\t * its wildcards taken as a segment of its own, is a key an open pattern\n\t * serves — `brand/logos/*` under `brand/**`, but not `**` under `brand/**`.\n\t */\n\tprivate covers(pattern: string): boolean {\n\t\treturn this.serves(pattern.replace(/\\*\\*/g, 'x/x').replace(/\\*/g, 'x'));\n\t}\n}\n\n/**\n * One open pattern as an anchored expression.\n *\n * A double star crosses `/`; a single star does not. Both are consumed in one\n * left-to-right pass rather than by substitution, so a pattern cannot be\n * rewritten into a placeholder that a later pass mistakes for literal text.\n */\nfunction globToRegExp(pattern: string): RegExp {\n\tlet source = '';\n\n\tfor (let index = 0; index < pattern.length; index++) {\n\t\tconst character = pattern[index];\n\n\t\tif (character !== '*') {\n\t\t\tsource += character?.replace(/[.+^${}()|[\\]\\\\?]/, '\\\\$&') ?? '';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (pattern[index + 1] === '*') {\n\t\t\tsource += '.*';\n\t\t\tindex++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tsource += '[^/]*';\n\t}\n\n\treturn new RegExp(`^${source}$`);\n}\n"],"mappings":";;;;;;;AAyJA,IAAa,2BAAb,cAA8C,MAAM;CAEzC;CACA;CACA;CAHV,YACC,SACA,QACA,UACC;EACD,MACC,qBAAqB,QAAQ,gBAAgB,OAAO,UAAU,SAAS,2EAExE;EAPS,KAAA,UAAA;EACA,KAAA,SAAA;EACA,KAAA,WAAA;EAMT,KAAK,OAAO;CACb;AACD;;AA4DA,IAAa,mBAAb,cAAsC,MAAM;CAEjC;CACA;CACA;CAHV,YACC,IACA,SACA,MACC;EACD,MACC,IAAI,GAAG,UAAU,QAAQ,+CACvB,KAAK,SAAS,WAAW,KAAK,KAAK,IAAI,EAAE,KAAK,sBAC/C,4HAEF;EATS,KAAA,KAAA;EACA,KAAA,UAAA;EACA,KAAA,OAAA;EAQT,KAAK,OAAO;CACb;AACD;;;;;AAMA,IAAa,uBAAb,cAA0C,MAAM;CAErC;CACA;CACA;CAHV,YACC,QACA,QACA,QACC;EACD,MACC,IAAI,OAAO,YAAY,OAAO,gCAAgC,OAAO,4CACzB,OAAO,2BACpD;EAPS,KAAA,SAAA;EACA,KAAA,SAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD;;;;;AAMA,IAAa,qBAAb,cAAwC,MAAM;CAEnC;CACA;CACA;CAHV,YACC,IACA,QACA,KACC;EACD,MACC,IAAI,GAAG,yEACQ,OAAO,MAAM,IAAI,wGAE3B,GAAG,iCAAiC,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,GAAG,MAAM,CAAC,EAAE,WACnF;EATS,KAA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AAQ,KAAK,KAAK,IAAI;GAEvD,OAAO,GAAG,KAAK,GAAG,IAAI,QAAQ,QAAQ,EAAE;EACzC;EAKA,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,GAAoB;GAC7D,KAAK;GACL,SAAS;GACT,YAAY,KAAa,cACxB,QAAQ,eAAe,EAAE,MAAM,IAAI,GAAY,SAAS;GACzD,eACC,WACA,QACA,QACI;IACJ,IAAI,UAAU,cAAc,KAAK,WAChC,MAAM,IAAI,yBACT,UAAU,SACV,UAAU,WACV,KAAK,SACN;IAED,IAAI,CAAC,KAAK,OAAO,GAAG,GAAG,MAAM,IAAI,QAAQ,KAAK,KAAK,IAAI;IACvD,OAAO,GAAG,OAAO,YAAY,UAAU,QAAQ,QAAQ,GAAG;GAC3D;EACD,CAAC;CACF;;;;;;;;;CAUA,OAAe,KAAsB;EACpC,OAAO,KAAK,KAAK,MAAM,YAAY,aAAa,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC;CACnE;;;;;;CAOA,OAAe,SAA0B;EACxC,OAAO,KAAK,OAAO,QAAQ,QAAQ,SAAS,KAAK,CAAC,CAAC,QAAQ,OAAO,GAAG,CAAC;CACvE;AACD;;;;;;;;AASA,SAAS,aAAa,SAAyB;CAC9C,IAAI,SAAS;CAEb,KAAK,IAAI,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,SAAS;EACpD,MAAM,YAAY,QAAQ;EAE1B,IAAI,cAAc,KAAK;GACtB,UAAU,WAAW,QAAQ,qBAAqB,MAAM,KAAK;GAC7D;EACD;EAEA,IAAI,QAAQ,QAAQ,OAAO,KAAK;GAC/B,UAAU;GACV;GACA;EACD;EAEA,UAAU;CACX;CAEA,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE;AAChC"}
@@ -1,3 +1,3 @@
1
1
  import { i as FunctionHandler, n as Function, r as FunctionContext } from "../Function-BIEsY0Hm.cjs";
2
- import { n as BaseFunctionBuilder, t as FunctionBuilder } from "../index-DPTHa6Ud.cjs";
2
+ import { n as BaseFunctionBuilder, t as FunctionBuilder } from "../index-DaK-C7N3.cjs";
3
3
  export { BaseFunctionBuilder, Function, FunctionBuilder, type FunctionContext, type FunctionHandler };
@@ -1,3 +1,3 @@
1
1
  import { i as FunctionHandler, n as Function, r as FunctionContext } from "../Function-BKReud5p.mjs";
2
- import { n as BaseFunctionBuilder, t as FunctionBuilder } from "../index-BoQ3-M-K.mjs";
2
+ import { n as BaseFunctionBuilder, t as FunctionBuilder } from "../index-vCS4HBEG.mjs";
3
3
  export { BaseFunctionBuilder, Function, FunctionBuilder, type FunctionContext, type FunctionHandler };
@@ -1,5 +1,5 @@
1
1
  import { c as Topic } from "./Construct-127M7yrl.cjs";
2
- import { n as Construct } from "./construct-interface-DugP0E5q.cjs";
2
+ import { n as Construct } from "./construct-interface-DhbaONW2.cjs";
3
3
  import { Service } from "@geekmidas/services";
4
4
  import { ConstructName, Declaration, InboxAddressing, InboxRecipient } from "@geekmidas/manifest";
5
5
  import { ParsedEmail } from "@geekmidas/emailkit/inbound";
@@ -192,4 +192,4 @@ declare function receiveMail(message: ArrivedMessage, inboxes: readonly Receivin
192
192
  declare function isInbox(value: unknown): value is Inbox;
193
193
  //#endregion
194
194
  export { InboxHasNoAddresses as a, RawMessageUnreadable as c, ReceivingInbox as d, Verdict as f, unjudgedReceipt as g, receiveMail as h, InboxClient as i, ReceiptNotification as l, isInbox as m, Inbox as n, InboxMessage as o, Verdicts as p, InboxAddressInvalid as r, InboxOptions as s, ArrivedMessage as t, ReceiptNotificationMalformed as u };
195
- //# sourceMappingURL=inbox-CR3L1fOI.d.cts.map
195
+ //# sourceMappingURL=inbox-BjvMs7EJ.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inbox-CR3L1fOI.d.cts","names":[],"sources":["../src/inbox.ts"],"mappings":";;;;;;UAsDiB;;;;;EAKhB;;;;;EAKA;;;cAIY,4BAA4B;WACnB;EAArB,YAAqB;;;cAUT,4BAA4B;WAE9B;WACA;EAFV,YACU,eACA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YACU,eACA;;;;;;;;KAgBC;;UAGK;EAChB,KAAK;EACL,MAAM;EACN,OAAO;EACP,MAAM;EACN,OAAO;;;;;;;;;;UAWS,qBACR,KAAK,6BACZ,KAAK;EACN,WAAW;;;;;EAKX;IAAO;IAAgB;;EACvB,UAAU;;;UAID;EACT;;;;;;;;UASgB;EAChB;EACA;IACC;IACA;;IAEA;IACA;;EAED;IACC;;IAEA;IACA,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,eAAe;IACf;MACC;MACA;MACA;MACA;;;;;UAMc;;WAEP;;EAET,IAAI,cAAc,QAAQ;;;;;;EAM1B,SAAS,cAAc,sBAAsB,QAAQ;;KAYjD,aAAa;cAEL,MAAM,0CACP,UAAU,OAAO;WAEnB,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;WAEtC,OAAO;;WAGP,YAAY;mBACJ;mBACA;mBACA;EAEjB,YAAY,MAAM,cAAc,QAAQ,SAAS;EAgCjD,WAAW;UAcG;;;cAmEF,6BAA6B;WAE/B;WACA;WACA;EAHV,YACU,eACA,aACA;;;;;;iBA2DK,gBAAgB;EAC/B;EACA;EACA;EACA;EACA;EACA,WAAW,QAAQ;EACnB,YAAY;IACT;;UA+Ba;EAChB;EACA,YAAY;;EAEZ;;EAEA,QAAQ,cAAc,sBAAsB;;;UAI5B;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,QAAQ;;;;;;;;;;;;iBAaE,YACrB,SAAS,gBACT,kBAAkB,mBAChB;;iBAuBa,QAAQ,iBAAiB,SAAS"}
@@ -1,5 +1,5 @@
1
1
  import { c as Topic } from "./Construct-BMk_CRSD.mjs";
2
- import { n as Construct } from "./construct-interface-CSA9VeWM.mjs";
2
+ import { n as Construct } from "./construct-interface-DxfkFxkl.mjs";
3
3
  import { ConstructName, Declaration, InboxAddressing, InboxRecipient } from "@geekmidas/manifest";
4
4
  import { Service } from "@geekmidas/services";
5
5
  import { ParsedEmail } from "@geekmidas/emailkit/inbound";
@@ -192,4 +192,4 @@ declare function receiveMail(message: ArrivedMessage, inboxes: readonly Receivin
192
192
  declare function isInbox(value: unknown): value is Inbox;
193
193
  //#endregion
194
194
  export { InboxHasNoAddresses as a, RawMessageUnreadable as c, ReceivingInbox as d, Verdict as f, unjudgedReceipt as g, receiveMail as h, InboxClient as i, ReceiptNotification as l, isInbox as m, Inbox as n, InboxMessage as o, Verdicts as p, InboxAddressInvalid as r, InboxOptions as s, ArrivedMessage as t, ReceiptNotificationMalformed as u };
195
- //# sourceMappingURL=inbox-YOdxlyfj.d.mts.map
195
+ //# sourceMappingURL=inbox-C8bOR9UL.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inbox-YOdxlyfj.d.mts","names":[],"sources":["../src/inbox.ts"],"mappings":";;;;;;UAsDiB;;;;;EAKhB;;;;;EAKA;;;cAIY,4BAA4B;WACnB;EAArB,YAAqB;;;cAUT,4BAA4B;WAE9B;WACA;EAFV,YACU,eACA;;;;;;cAeE,qCAAqC;WAEvC;WACA;EAFV,YACU,eACA;;;;;;;;KAgBC;;UAGK;EAChB,KAAK;EACL,MAAM;EACN,OAAO;EACP,MAAM;EACN,OAAO;;;;;;;;;;UAWS,qBACR,KAAK,6BACZ,KAAK;EACN,WAAW;;;;;EAKX;IAAO;IAAgB;;EACvB,UAAU;;;UAID;EACT;;;;;;;;UASgB;EAChB;EACA;IACC;IACA;;IAEA;IACA;;EAED;IACC;;IAEA;IACA,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,eAAe;IACf;MACC;MACA;MACA;MACA;;;;;UAMc;;WAEP;;EAET,IAAI,cAAc,QAAQ;;;;;;EAM1B,SAAS,cAAc,sBAAsB,QAAQ;;KAYjD,aAAa;cAEL,MAAM,0CACP,UAAU,OAAO;WAEnB,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;WAEtC,OAAO;;WAGP,YAAY;mBACJ;mBACA;mBACA;EAEjB,YAAY,MAAM,cAAc,QAAQ,SAAS;EAg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;WACA;WACA;EAHV,YACU,eACA,aACA;;;;;;iBA2DK,gBAAgB;EAC/B;EACA;EACA;EACA;EACA;EACA,WAAW,QAAQ;EACnB,YAAY;IACT;;UA+Ba;EAChB;EACA,YAAY;;EAEZ;;EAEA,QAAQ,cAAc,sBAAsB;;;UAI5B;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,QAAQ;;;;;;;;;;;;iBAaE,YACrB,SAAS,gBACT,kBAAkB,mBAChB;;iBAuBa,QAAQ,iBAAiB,SAAS"}
package/dist/inbox.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as InboxHasNoAddresses, c as RawMessageUnreadable, d as ReceivingInbox, f as Verdict, g as unjudgedReceipt, h as receiveMail, i as InboxClient, l as ReceiptNotification, m as isInbox, n as Inbox, o as InboxMessage, p as Verdicts, r as InboxAddressInvalid, s as InboxOptions, t as ArrivedMessage, u as ReceiptNotificationMalformed } from "./inbox-CR3L1fOI.cjs";
1
+ import { a as InboxHasNoAddresses, c as RawMessageUnreadable, d as ReceivingInbox, f as Verdict, g as unjudgedReceipt, h as receiveMail, i as InboxClient, l as ReceiptNotification, m as isInbox, n as Inbox, o as InboxMessage, p as Verdicts, r as InboxAddressInvalid, s as InboxOptions, t as ArrivedMessage, u as ReceiptNotificationMalformed } from "./inbox-BjvMs7EJ.cjs";
2
2
  export { ArrivedMessage, Inbox, InboxAddressInvalid, InboxClient, InboxHasNoAddresses, InboxMessage, InboxOptions, RawMessageUnreadable, ReceiptNotification, ReceiptNotificationMalformed, ReceivingInbox, Verdict, Verdicts, isInbox, receiveMail, unjudgedReceipt };
package/dist/inbox.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as InboxHasNoAddresses, c as RawMessageUnreadable, d as ReceivingInbox, f as Verdict, g as unjudgedReceipt, h as receiveMail, i as InboxClient, l as ReceiptNotification, m as isInbox, n as Inbox, o as InboxMessage, p as Verdicts, r as InboxAddressInvalid, s as InboxOptions, t as ArrivedMessage, u as ReceiptNotificationMalformed } from "./inbox-YOdxlyfj.mjs";
1
+ import { a as InboxHasNoAddresses, c as RawMessageUnreadable, d as ReceivingInbox, f as Verdict, g as unjudgedReceipt, h as receiveMail, i as InboxClient, l as ReceiptNotification, m as isInbox, n as Inbox, o as InboxMessage, p as Verdicts, r as InboxAddressInvalid, s as InboxOptions, t as ArrivedMessage, u as ReceiptNotificationMalformed } from "./inbox-C8bOR9UL.mjs";
2
2
  export { ArrivedMessage, Inbox, InboxAddressInvalid, InboxClient, InboxHasNoAddresses, InboxMessage, InboxOptions, RawMessageUnreadable, ReceiptNotification, ReceiptNotificationMalformed, ReceivingInbox, Verdict, Verdicts, isInbox, receiveMail, unjudgedReceipt };
@@ -1,7 +1,7 @@
1
1
  import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.cjs";
2
2
  import { a as EventFor, c as Topic, n as ConstructType, o as TopicEvent } from "./Construct-127M7yrl.cjs";
3
3
  import { i as FunctionHandler, n as Function } from "./Function-BIEsY0Hm.cjs";
4
- import { c as ServicesOf, r as Consumable } from "./construct-interface-DugP0E5q.cjs";
4
+ import { l as ServicesOf, r as Consumable } from "./construct-interface-DhbaONW2.cjs";
5
5
  import { Logger } from "@geekmidas/logger";
6
6
  import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
7
7
  import { Service } from "@geekmidas/services";
@@ -112,4 +112,4 @@ declare class FunctionBuilder<TInput extends ComposableStandardSchema, OutSchema
112
112
  }
113
113
  //#endregion
114
114
  export { BaseFunctionBuilder as n, FunctionBuilder as t };
115
- //# sourceMappingURL=index-DPTHa6Ud.d.cts.map
115
+ //# sourceMappingURL=index-DaK-C7N3.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-BoQ3-M-K.d.mts","names":[],"sources":["../src/functions/BaseFunctionBuilder.ts","../src/functions/FunctionBuilder.ts"],"mappings":";;;;;;;;;uBAsBsB,oBACrB,eAAe,0BACf,kBAAkB,0CAClB,kBAAkB,gBAClB,g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eACI,cAAc,WAAW,KAC7B,SACA,eACA,0BACA,WACA,sBACA;EA8BD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,eACI,cAAc,IAClB,SACA,eACA,0BACA,WACA,sBACA;EAoBD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,WACA,WACA,GACA,eACA,0BACA,WACA,sBACA;;;;;;;EAuBD,MAAM,eAAe,iBACpB,OAAO,QACP,OAAO,SAAS,QAAQ,oBAAoB,cAC1C,gBACF,QACA,eACI,WAAW,oBACf,SACA,eACA,0BACA,WACA,sBACA;EAeQ,QAAQ,UAAU,cAAc,sBACxC,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,WACA,WACA,SACA,GACA,OACA,WACA,sBACA;;;;;EAwBD,QAAQ,UAAU,qCAAqC,gBACtD,QACA,WACA,WACA,SACA,eACA,0BACA,WACA,sBACA;;;;;EAmBQ,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,WACA,WACA,SACA,eACA,0BACA,GACA,OACA;EAkCD,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,WACA,eACA,gBAEC,SACF,QACA,WACA,SACA,WACA,eACA,0BACA,WACA,sBACA,cACA,gBACC,QACA,WACA,SACA,WACA,WACA,eACA"}
1
+ {"version":3,"file":"index-DaK-C7N3.d.cts","names":[],"sources":["../src/functions/BaseFunctionBuilder.ts","../src/functions/FunctionBuilder.ts"],"mappings":";;;;;;;;;uBAsBsB,oBACrB,eAAe,0BACf,kBAAkB,0CAClB,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,sBAAsB,sCACtB,kDACA,uBACA;EAoFmB,MAAI;YAlFb,cAAc;YACd,eAAe;YACf;EAEH,WAAW;;;;;;;;;EASX;EACA,SAAS;;;;;;;EAQT;;;;;;;;EASA;;EAGA,SAAS;YACN,kBAAkB,QAAQ,0BAA0B;YACpD,mBAAmB,QAAQ,sBAAsB;;YAEjD;SAEH,m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AM,eAAe,iBACpB,OAAO,QACP,OAAO,SAAS,QAAQ,oBAAoB,cAC1C,gBACF,QACA,eACI,WAAW,oBACf,SACA,eACA,0BACA,WACA,sBACA;EAeQ,QAAQ,UAAU,cAAc,sBACxC,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,WACA,WACA,SACA,GACA,OACA,WACA,sBACA;;;;;EAwBD,QAAQ,UAAU,qCAAqC,gBACtD,QACA,WACA,WACA,SACA,eACA,0BACA,WACA,sBACA;;;;;EAmBQ,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,WACA,WACA,SACA,eACA,0BACA,GACA,OACA;EAkCD,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,WACA,eACA,gBAEC,SACF,QACA,WACA,SACA,WACA,eACA,0BACA,WACA,sBACA,cACA,gBACC,QACA,WACA,SACA,WACA,WACA,eACA"}
@@ -1,7 +1,7 @@
1
1
  import { n as StandardSchemaV1 } from "./index-DdRjYhiJ.mjs";
2
2
  import { a as EventFor, c as Topic, n as ConstructType, o as TopicEvent } from "./Construct-BMk_CRSD.mjs";
3
3
  import { i as FunctionHandler, n as Function } from "./Function-BKReud5p.mjs";
4
- import { c as ServicesOf, r as Consumable } from "./construct-interface-CSA9VeWM.mjs";
4
+ import { l as ServicesOf, r as Consumable } from "./construct-interface-DxfkFxkl.mjs";
5
5
  import { Service } from "@geekmidas/services";
6
6
  import { Logger } from "@geekmidas/logger";
7
7
  import { ComposableStandardSchema, InferComposableStandardSchema, InferStandardSchema } from "@geekmidas/schema";
@@ -112,4 +112,4 @@ declare class FunctionBuilder<TInput extends ComposableStandardSchema, OutSchema
112
112
  }
113
113
  //#endregion
114
114
  export { BaseFunctionBuilder as n, FunctionBuilder as t };
115
- //# sourceMappingURL=index-BoQ3-M-K.d.mts.map
115
+ //# sourceMappingURL=index-vCS4HBEG.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DPTHa6Ud.d.cts","names":[],"sources":["../src/functions/BaseFunctionBuilder.ts","../src/functions/FunctionBuilder.ts"],"mappings":";;;;;;;;;uBAsBsB,oBACrB,eAAe,0BACf,kBAAkB,0CAClB,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,sBAAsB,sCACtB,kDACA,uBACA;EAoFmB,MAAI;YAlFb,cAAc;YACd,eAAe;YACf;EAEH,WAAW;;;;;;;;;EASX;EACA,SAAS;;;;;;;EAQT;;;;;;;;EASA;;EAGA,SAAS;YACN,kBAAkB,QAAQ,0BAA0B;YACpD,mBAAmB,QAAQ,sBAAsB;;YAEjD;SAEH,mBAAmB,aAAa,KAAK;SAM/B,8BACZ,UAAU,sCACT,eAAe,QAAQ,IAAI,QAAQ,8BAA8B;EAkCnE,YAAmB,OAAI;WAEd,SAAS,UAAU,WAAW,UAAU;WAExC,OAAO,UAAU,QAAQ,QAAQ;EAE1C,QAAQ;WAIC,OAAO,UAAU,kBAAkB,QAAQ;WAE3C,MAAM,UAAU,0BAA0B,QAAQ;;;;;;;YAQjD,UACT,OAAO,iBACP,OAAO,SAAS;EAcjB,QAAQ,UAAU,cAAc,sBAC/B,SAAS,QAAQ,OAAO,KACtB,oBACF,QACA,WACA,WACA,SACA,GACA,OACA,WACA;;;;;EAuBD,SAAS,GAAG,sBACX,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,oBACF,QACA,WACA,WACA,SACA,eACA,0BACA,GACA;;;;cCzKW,gBACZ,eAAe,0BACf,kBAAkB,0CAClB,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,sBAAsB,sCACtB,kDACA,uBACA,8CACA,qBAAqB,mCAAmC,0CAI/C,oBACT,QACA,WACA,WACA,SACA,eACA,0BACA,WACA;EAI4B,MAAI;YAFtB;EAEV,YAA4B,OAAI;EAIvB,QAAQ;EAIjB,WAAW;EAIX,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,GACA,WACA,SACA,eACA,0BACA,WACA,sBACA;EAiBD,MAAM,UAAU,0BACf,QAAQ,IACN,gBACF,GACA,WACA,WACA,SACA,eACA,0BACA,WACA,sBACA;;;;;;;;;;;;EA4BD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,eACI,cAAc,WAAW,KAC7B,SACA,eACA,0BACA,WACA,sBACA;EA8BD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,eACI,cAAc,IAClB,SACA,eACA,0BACA,WACA,sBACA;EAoBD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,WACA,WACA,GACA,eACA,0BACA,WACA,sBACA;;;;;;;EAuBD,MAAM,eAAe,iBACpB,OAAO,QACP,OAAO,SAAS,QAAQ,oBAAoB,cAC1C,gBACF,QACA,eACI,WAAW,oBACf,SACA,eACA,0BACA,WACA,sBACA;EAeQ,QAAQ,UAAU,cAAc,sBACxC,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,WACA,WACA,SACA,GACA,OACA,WACA,sBACA;;;;;EAwBD,QAAQ,UAAU,qCAAqC,gBACtD,QACA,WACA,WACA,SACA,eACA,0BACA,WACA,sBACA;;;;;EAmBQ,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,WACA,WACA,SACA,eACA,0BACA,GACA,OACA;EAkCD,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,WACA,eACA,gBAEC,SACF,QACA,WACA,SACA,WACA,eACA,0BACA,WACA,sBACA,cACA,gBACC,QACA,WACA,SACA,WACA,WACA,eACA"}
1
+ {"version":3,"file":"index-vCS4HBEG.d.mts","names":[],"sources":["../src/functions/BaseFunctionBuilder.ts","../src/functions/FunctionBuilder.ts"],"mappings":";;;;;;;;;uBAsBsB,oBACrB,eAAe,0BACf,kBAAkB,0CAClB,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,sBAAsB,sCACtB,kDACA,uBACA;EAoFmB,MAAI;YAlFb,cAAc;YACd,eAAe;YACf;EAEH,WAA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I,cAAc,IAClB,SACA,eACA,0BACA,WACA,sBACA;EAoBD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,WACA,WACA,GACA,eACA,0BACA,WACA,sBACA;;;;;;;EAuBD,MAAM,eAAe,iBACpB,OAAO,QACP,OAAO,SAAS,QAAQ,oBAAoB,cAC1C,gBACF,QACA,eACI,WAAW,oBACf,SACA,eACA,0BACA,WACA,sBACA;EAeQ,QAAQ,UAAU,cAAc,sBACxC,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,WACA,WACA,SACA,GACA,OACA,WACA,sBACA;;;;;EAwBD,QAAQ,UAAU,qCAAqC,gBACtD,QACA,WACA,WACA,SACA,eACA,0BACA,WACA,sBACA;;;;;EAmBQ,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,WACA,WACA,SACA,eACA,0BACA,GACA,OACA;EAkCD,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,WACA,eACA,gBAEC,SACF,QACA,WACA,SACA,WACA,eACA,0BACA,WACA,sBACA,cACA,gBACC,QACA,WACA,SACA,WACA,WACA,eACA"}
@@ -1,5 +1,5 @@
1
- import { n as Construct } from "./construct-interface-DugP0E5q.cjs";
2
- import { t as Cache } from "./cache-CQjMNPrC.cjs";
1
+ import { n as Construct } from "./construct-interface-DhbaONW2.cjs";
2
+ import { t as Cache } from "./cache-CW-sArzS.cjs";
3
3
  import { Service } from "@geekmidas/services";
4
4
  import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
5
5
  import { Kysely, KyselyConfig } from "kysely";
@@ -213,4 +213,4 @@ declare class KyselyDatabase<DB = unknown, TName extends string = string> implem
213
213
  type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
214
214
  //#endregion
215
215
  export { closeDatabasePools as a, ReadOnlyDatabase as i, KyselyDatabaseOptions as n, PostgresRuntime as r, KyselyDatabase as t };
216
- //# sourceMappingURL=kysely-CebjCWTl.d.cts.map
216
+ //# sourceMappingURL=kysely-2HqIQ2fC.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kysely-CebjCWTl.d.cts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChElC,kCAAkC,KAAK;;;;;;;;EAQhD;;;;;;;;EAQA;;;;;;;;;;EAUA;;;;;;;;EAQA;;;;;;;KAQW;;;;;;;;;;;EAYT,UAAU;EACV;;;;;;;;;;;;;;;;;EAkBA;EACA;;;;;;KAOS,wBAAwB,4BAA4B;;UAGtD;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EA2Bf,WAAW;;;;;;;;;;;;;EAyDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAiBX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
1
+ {"version":3,"file":"kysely-2HqIQ2fC.d.cts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChElC,kCAAkC,KAAK;;;;;;;;EAQhD;;;;;;;;EAQA;;;;;;;;;;EAUA;;;;;;;;EAQA;;;;;;;KAQW;;;;;;;;;;;EAYT,UAAU;EACV;;;;;;;;;;;;;;;;;EAkBA;EACA;;;;;;KAOS,wBAAwB,4BAA4B;;UAGtD;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EA2Bf,WAAW;;;;;;;;;;;;;EAyDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAiBX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
@@ -1,5 +1,5 @@
1
- import { n as Construct } from "./construct-interface-CSA9VeWM.mjs";
2
- import { t as Cache } from "./cache-CCHcO9Oo.mjs";
1
+ import { n as Construct } from "./construct-interface-DxfkFxkl.mjs";
2
+ import { t as Cache } from "./cache-0VoeOTF9.mjs";
3
3
  import { ConstructName, Declaration, PostgresVersion } from "@geekmidas/manifest";
4
4
  import { Service } from "@geekmidas/services";
5
5
  import { Kysely, KyselyConfig } from "kysely";
@@ -213,4 +213,4 @@ declare class KyselyDatabase<DB = unknown, TName extends string = string> implem
213
213
  type ReadOnlyDatabase<DB, TName extends string> = Omit<KyselyDatabase<DB, TName>, 'reader' | 'cache' | 'schema'>;
214
214
  //#endregion
215
215
  export { closeDatabasePools as a, ReadOnlyDatabase as i, KyselyDatabaseOptions as n, PostgresRuntime as r, KyselyDatabase as t };
216
- //# sourceMappingURL=kysely-De5rAC-E.d.mts.map
216
+ //# sourceMappingURL=kysely-BGvpd_ZH.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kysely-De5rAC-E.d.mts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChElC,kCAAkC,KAAK;;;;;;;;EAQhD;;;;;;;;EAQA;;;;;;;;;;EAUA;;;;;;;;EAQA;;;;;;;KAQW;;;;;;;;;;;EAYT,UAAU;EACV;;;;;;;;;;;;;;;;;EAkBA;EACA;;;;;;KAOS,wBAAwB,4BAA4B;;UAGtD;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EA2Bf,WAAW;;;;;;;;;;;;;EAyDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAiBX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
1
+ {"version":3,"file":"kysely-BGvpd_ZH.d.mts","names":[],"sources":["../src/database/pool.ts","../src/database/kysely.ts"],"mappings":";;;;;;;;;;;iBAwGsB,sBAAsB;;;;;;;;;;;;UChElC,kCAAkC,KAAK;;;;;;;;EAQhD;;;;;;;;EAQA;;;;;;;;;;EAUA;;;;;;;;EAQA;;;;;;;KAQW;;;;;;;;;;;EAYT,UAAU;EACV;;;;;;;;;;;;;;;;;EAkBA;EACA;;;;;;KAOS,wBAAwB,4BAA4B;;UAGtD;EACT;EACA;EACA;;;;;;;;;cAUY,eAAe,cAAc,0CAC9B,UAAU,OAAO,OAAO;mBAiBjB;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ,OAAO;;;;;mBAMrC;mBACA;mBACA;mBACA;mBACA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS,uBAC1B,cAAc;EA2Bf,WAAW;;;;;;;;;;;;;EAyDX,UAAU,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;EAyBlC,MAAM,2BAA2B,cAChC,KAAI,cAAc,SAClB;IAAW;MACT,MAAM;;;;;;;;;EAeT,OAAO,UAAU,wBAChB,IAAI,cAAc,UAClB,UAAS,wBACP,eAAe,UAAU;;;;;;;;;;;;;MAoBxB,SAAS,WAAW,aAAa,eAAe,OAAO;;;;;;;;;MAgBvD,gBAAgB,KAAK;UAiBX;;;;;;;;;;;;;;;;;;;KAuCH,iBAAiB,IAAI,wBAAwB,KACxD,eAAe,IAAI"}
@@ -47,9 +47,13 @@ var MobileApp = class MobileApp {
47
47
  *
48
48
  * Immutable, like every other builder: it returns a new app rather than
49
49
  * changing this one.
50
+ *
51
+ * A plain edge to a `FileServer` is to its public face — the address its
52
+ * objects are served on, inlined — never to the bucket a phone has no
53
+ * business holding a key to.
50
54
  */
51
55
  dependsOn(constructs) {
52
- return new MobileApp(this.id, this.config, [...this.dependencies, ...constructs.map(require_construct_interface.edgeTo)]);
56
+ return new MobileApp(this.id, this.config, [...this.dependencies, ...constructs.map(require_construct_interface.frontendEdgeTo)]);
53
57
  }
54
58
  declare() {
55
59
  return [{
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-app.cjs","names":["canonicalId","provideKey","edgeTo"],"sources":["../src/mobile-app.ts"],"sourcesContent":["/**\n * `MobileApp` — an Expo app, declared like a site.\n *\n * Its edges are the point, as a site's are. One `.dependsOn([api, auth])` is\n * the fact behind everything a mobile app otherwise has written down by hand:\n *\n * - its `EXPO_PUBLIC_API_URL` and `EXPO_PUBLIC_AUTH_URL`, which locally are\n * the servers' own ports — reachable once the app swaps `localhost` for the\n * address Metro is served from, which is what makes a phone on the LAN work;\n * - with an `Email` among them, Mailpit's inbox on a local stage\n * (`EXPO_PUBLIC_<ID>_INBOX_URL`), so a sign-in link can be opened from the\n * app — unset deployed, where there is no inbox;\n * - its URL scheme (`shop`), the same on every stage;\n * - the scheme in the auth server's and the API's trusted origins — and, on a\n * local stage, the `exp://` origins Expo Go sends from;\n * - Better Auth's Expo plugin on the auth server, and sign-in links an app asks\n * for built on an address the phone can open.\n *\n * ```ts\n * export const app = new MobileApp('App', { path: 'apps/app' })\n * .dependsOn([api, auth]);\n * ```\n *\n * Like a site it has no `.service`: it is built by its own toolchain, and\n * consumes addresses rather than connections. Nothing deploys it — EAS and the\n * stores do — so the targets derive *for* it and never run it.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\ttype MobileAppDeclaration,\n\ttype MobileAppStage,\n\tprovideKey,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\n\nexport interface MobileAppConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/app'`.\n\t * Required, the same field a site and a surface take.\n\t */\n\tpath: string;\n\t/**\n\t * The port Metro serves it on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, as a site's are,\n\t * and `gkm exec` hands it to Expo as `RCT_METRO_PORT`.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars the app reads — its\n\t * values are inlined at build time, as a site's are.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Which toolchain builds it — the same field a site names its framework\n\t * by. Expo is the one that ships, and the default.\n\t */\n\tvariant?: MobileAppDeclaration['variant'];\n\t/**\n\t * Its URL scheme.\n\t *\n\t * Normally omitted: it is the project's name — `shop` — on every stage.\n\t * Give one only when the app is known by another name.\n\t */\n\tscheme?: string;\n\t/**\n\t * How a deployed stage ships it, where that differs from the defaults: the\n\t * protected stage reads EAS's `production` environment and submits to\n\t * Play's `production` track, every other deployed stage `preview` and\n\t * `internal`, and every Android release is a `draft` until someone\n\t * releases it in Play Console.\n\t *\n\t * ```ts\n\t * stages: { beta: { environment: 'preview', android: { track: 'alpha' } } }\n\t * ```\n\t */\n\tstages?: Readonly<Record<string, MobileAppStage>>;\n}\n\nexport class MobileApp<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\t/** The key its scheme arrives under — what its `app.config.ts` reads. */\n\treadonly keys: { scheme: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: MobileAppConfig,\n\t\t/** Internal: how `.dependsOn()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { scheme: provideKey(this.id, 'scheme') };\n\t}\n\n\t/**\n\t * What this app calls — the surfaces it is built with the URLs of, and the\n\t * ones that come to trust its scheme.\n\t *\n\t * Immutable, like every other builder: it returns a new app rather than\n\t * changing this one.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): MobileApp<TName> {\n\t\treturn new MobileApp<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'mobile-app',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'expo',\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.scheme ? { scheme: this.config.scheme } : {}),\n\t\t\t\t...(this.config.stages ? { stages: this.config.stages } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.scheme],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAEb;CAOmB;CAEA;CARlB;;CAEA;CAEA,YACC,IACA,QAEA,eAAuD,CAAC,GACvD;EAHgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAEjB,KAAK,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,EAAY;EAClC,KAAK,OAAO,EAAE,SAAA,GAAQC,oBAAAA,WAAAA,CAAW,KAAK,IAAI,QAAQ,EAAE;CACrD;;;;;;;;CASA,UAAU,YAAqD;EAC9D,OAAO,IAAI,UAAiB,KAAK,IAA4B,KAAK,QAAQ,CACzE,GAAG,KAAK,cACR,GAAG,WAAW,IAAIC,4BAAAA,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,MAAM;EAC5B,CACD;CACD;AACD"}
1
+ {"version":3,"file":"mobile-app.cjs","names":["canonicalId","provideKey","frontendEdgeTo"],"sources":["../src/mobile-app.ts"],"sourcesContent":["/**\n * `MobileApp` — an Expo app, declared like a site.\n *\n * Its edges are the point, as a site's are. One `.dependsOn([api, auth])` is\n * the fact behind everything a mobile app otherwise has written down by hand:\n *\n * - its `EXPO_PUBLIC_API_URL` and `EXPO_PUBLIC_AUTH_URL`, which locally are\n * the servers' own ports — reachable once the app swaps `localhost` for the\n * address Metro is served from, which is what makes a phone on the LAN work;\n * - with an `Email` among them, Mailpit's inbox on a local stage\n * (`EXPO_PUBLIC_<ID>_INBOX_URL`), so a sign-in link can be opened from the\n * app — unset deployed, where there is no inbox;\n * - its URL scheme (`shop`), the same on every stage;\n * - the scheme in the auth server's and the API's trusted origins — and, on a\n * local stage, the `exp://` origins Expo Go sends from;\n * - Better Auth's Expo plugin on the auth server, and sign-in links an app asks\n * for built on an address the phone can open.\n *\n * ```ts\n * export const app = new MobileApp('App', { path: 'apps/app' })\n * .dependsOn([api, auth]);\n * ```\n *\n * Like a site it has no `.service`: it is built by its own toolchain, and\n * consumes addresses rather than connections. Nothing deploys it — EAS and the\n * stores do — so the targets derive *for* it and never run it.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\ttype MobileAppDeclaration,\n\ttype MobileAppStage,\n\tprovideKey,\n} from '@geekmidas/manifest';\nimport { type Declarable, frontendEdgeTo } from './construct-interface';\n\nexport interface MobileAppConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/app'`.\n\t * Required, the same field a site and a surface take.\n\t */\n\tpath: string;\n\t/**\n\t * The port Metro serves it on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, as a site's are,\n\t * and `gkm exec` hands it to Expo as `RCT_METRO_PORT`.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars the app reads — its\n\t * values are inlined at build time, as a site's are.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Which toolchain builds it — the same field a site names its framework\n\t * by. Expo is the one that ships, and the default.\n\t */\n\tvariant?: MobileAppDeclaration['variant'];\n\t/**\n\t * Its URL scheme.\n\t *\n\t * Normally omitted: it is the project's name — `shop` — on every stage.\n\t * Give one only when the app is known by another name.\n\t */\n\tscheme?: string;\n\t/**\n\t * How a deployed stage ships it, where that differs from the defaults: the\n\t * protected stage reads EAS's `production` environment and submits to\n\t * Play's `production` track, every other deployed stage `preview` and\n\t * `internal`, and every Android release is a `draft` until someone\n\t * releases it in Play Console.\n\t *\n\t * ```ts\n\t * stages: { beta: { environment: 'preview', android: { track: 'alpha' } } }\n\t * ```\n\t */\n\tstages?: Readonly<Record<string, MobileAppStage>>;\n}\n\nexport class MobileApp<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\t/** The key its scheme arrives under — what its `app.config.ts` reads. */\n\treadonly keys: { scheme: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: MobileAppConfig,\n\t\t/** Internal: how `.dependsOn()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { scheme: provideKey(this.id, 'scheme') };\n\t}\n\n\t/**\n\t * What this app calls — the surfaces it is built with the URLs of, and the\n\t * ones that come to trust its scheme.\n\t *\n\t * Immutable, like every other builder: it returns a new app rather than\n\t * changing this one.\n\t *\n\t * A plain edge to a `FileServer` is to its public face — the address its\n\t * objects are served on, inlined — never to the bucket a phone has no\n\t * business holding a key to.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): MobileApp<TName> {\n\t\treturn new MobileApp<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(frontendEdgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'mobile-app',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'expo',\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.scheme ? { scheme: this.config.scheme } : {}),\n\t\t\t\t...(this.config.stages ? { stages: this.config.stages } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.scheme],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAEb;CAOmB;CAEA;CARlB;;CAEA;CAEA,YACC,IACA,QAEA,eAAuD,CAAC,GACvD;EAHgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAEjB,KAAK,MAAA,GAAKA,oBAAAA,YAAAA,CAAY,EAAY;EAClC,KAAK,OAAO,EAAE,SAAA,GAAQC,oBAAAA,WAAAA,CAAW,KAAK,IAAI,QAAQ,EAAE;CACrD;;;;;;;;;;;;CAaA,UAAU,YAAqD;EAC9D,OAAO,IAAI,UAAiB,KAAK,IAA4B,KAAK,QAAQ,CACzE,GAAG,KAAK,cACR,GAAG,WAAW,IAAIC,4BAAAA,cAAc,CACjC,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,MAAM;EAC5B,CACD;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- import { i as Declarable } from "./construct-interface-DugP0E5q.cjs";
1
+ import { i as Declarable } from "./construct-interface-DhbaONW2.cjs";
2
2
  import { ConstructName, Declaration, Dependency, MobileAppDeclaration, MobileAppStage } from "@geekmidas/manifest";
3
3
  //#region src/mobile-app.d.ts
4
4
  export interface MobileAppConfig {
@@ -65,6 +65,10 @@ export declare class MobileApp<TName extends string = string> implements Declara
65
65
  *
66
66
  * Immutable, like every other builder: it returns a new app rather than
67
67
  * changing this one.
68
+ *
69
+ * A plain edge to a `FileServer` is to its public face — the address its
70
+ * objects are served on, inlined — never to the bucket a phone has no
71
+ * business holding a key to.
68
72
  */
69
73
  dependsOn(constructs: readonly Declarable[]): MobileApp<TName>;
70
74
  declare(): Declaration[];
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-app.d.cts","names":[],"sources":["../src/mobile-app.ts"],"mappings":";;;iBAuCiB;;;;;EAKhB;;;;;;;EAOA;;;;;EAKA;IAAW;IAAiB;;;;;;EAK5B,UAAU;;;;;;;EAOV;;;;;;;;;;;;EAYA,SAAS,SAAS,eAAe;;qBAGrB,UAAU,0CACX,WAAW;mBAQJ;;mBAEA;WART,IAAI;;WAEJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAER;;EAAA,wBAAuB;;;;;;;;EAazC,UAAU,qBAAqB,eAAe,UAAU;EAOxD,WAAW"}
1
+ {"version":3,"file":"mobile-app.d.cts","names":[],"sources":["../src/mobile-app.ts"],"mappings":";;;iBAuCiB;;;;;EAKhB;;;;;;;EAOA;;;;;EAKA;IAAW;IAAiB;;;;;;EAK5B,UAAU;;;;;;;EAOV;;;;;;;;;;;;EAYA,SAAS,SAAS,eAAe;;qBAGrB,UAAU,0CACX,WAAW;mBAQJ;;mBAEA;WART,IAAI;;WAEJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAER;;EAAA,wBAAuB;;;;;;;;;;;;EAiBzC,UAAU,qBAAqB,eAAe,UAAU;EAOxD,WAAW"}
@@ -1,4 +1,4 @@
1
- import { i as Declarable } from "./construct-interface-CSA9VeWM.mjs";
1
+ import { i as Declarable } from "./construct-interface-DxfkFxkl.mjs";
2
2
  import { ConstructName, Declaration, Dependency, MobileAppDeclaration, MobileAppStage } from "@geekmidas/manifest";
3
3
  //#region src/mobile-app.d.ts
4
4
  export interface MobileAppConfig {
@@ -65,6 +65,10 @@ export declare class MobileApp<TName extends string = string> implements Declara
65
65
  *
66
66
  * Immutable, like every other builder: it returns a new app rather than
67
67
  * changing this one.
68
+ *
69
+ * A plain edge to a `FileServer` is to its public face — the address its
70
+ * objects are served on, inlined — never to the bucket a phone has no
71
+ * business holding a key to.
68
72
  */
69
73
  dependsOn(constructs: readonly Declarable[]): MobileApp<TName>;
70
74
  declare(): Declaration[];
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-app.d.mts","names":[],"sources":["../src/mobile-app.ts"],"mappings":";;;iBAuCiB;;;;;EAKhB;;;;;;;EAOA;;;;;EAKA;IAAW;IAAiB;;;;;;EAK5B,UAAU;;;;;;;EAOV;;;;;;;;;;;;EAYA,SAAS,SAAS,eAAe;;qBAGrB,UAAU,0CACX,WAAW;mBAQJ;;mBAEA;WART,IAAI;;WAEJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAER;;EAAA,wBAAuB;;;;;;;;EAazC,UAAU,qBAAqB,eAAe,UAAU;EAOxD,WAAW"}
1
+ {"version":3,"file":"mobile-app.d.mts","names":[],"sources":["../src/mobile-app.ts"],"mappings":";;;iBAuCiB;;;;;EAKhB;;;;;;;EAOA;;;;;EAKA;IAAW;IAAiB;;;;;;EAK5B,UAAU;;;;;;;EAOV;;;;;;;;;;;;EAYA,SAAS,SAAS,eAAe;;qBAGrB,UAAU,0CACX,WAAW;mBAQJ;;mBAEA;WART,IAAI;;WAEJ;IAAQ;;EAEjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAER;;EAAA,wBAAuB;;;;;;;;;;;;EAiBzC,UAAU,qBAAqB,eAAe,UAAU;EAOxD,WAAW"}
@@ -1,4 +1,4 @@
1
- import { edgeTo } from "./construct-interface.mjs";
1
+ import { frontendEdgeTo } from "./construct-interface.mjs";
2
2
  import { canonicalId, provideKey } from "@geekmidas/manifest";
3
3
  //#region src/mobile-app.ts
4
4
  /**
@@ -46,9 +46,13 @@ var MobileApp = class MobileApp {
46
46
  *
47
47
  * Immutable, like every other builder: it returns a new app rather than
48
48
  * changing this one.
49
+ *
50
+ * A plain edge to a `FileServer` is to its public face — the address its
51
+ * objects are served on, inlined — never to the bucket a phone has no
52
+ * business holding a key to.
49
53
  */
50
54
  dependsOn(constructs) {
51
- return new MobileApp(this.id, this.config, [...this.dependencies, ...constructs.map(edgeTo)]);
55
+ return new MobileApp(this.id, this.config, [...this.dependencies, ...constructs.map(frontendEdgeTo)]);
52
56
  }
53
57
  declare() {
54
58
  return [{
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-app.mjs","names":[],"sources":["../src/mobile-app.ts"],"sourcesContent":["/**\n * `MobileApp` — an Expo app, declared like a site.\n *\n * Its edges are the point, as a site's are. One `.dependsOn([api, auth])` is\n * the fact behind everything a mobile app otherwise has written down by hand:\n *\n * - its `EXPO_PUBLIC_API_URL` and `EXPO_PUBLIC_AUTH_URL`, which locally are\n * the servers' own ports — reachable once the app swaps `localhost` for the\n * address Metro is served from, which is what makes a phone on the LAN work;\n * - with an `Email` among them, Mailpit's inbox on a local stage\n * (`EXPO_PUBLIC_<ID>_INBOX_URL`), so a sign-in link can be opened from the\n * app — unset deployed, where there is no inbox;\n * - its URL scheme (`shop`), the same on every stage;\n * - the scheme in the auth server's and the API's trusted origins — and, on a\n * local stage, the `exp://` origins Expo Go sends from;\n * - Better Auth's Expo plugin on the auth server, and sign-in links an app asks\n * for built on an address the phone can open.\n *\n * ```ts\n * export const app = new MobileApp('App', { path: 'apps/app' })\n * .dependsOn([api, auth]);\n * ```\n *\n * Like a site it has no `.service`: it is built by its own toolchain, and\n * consumes addresses rather than connections. Nothing deploys it — EAS and the\n * stores do — so the targets derive *for* it and never run it.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\ttype MobileAppDeclaration,\n\ttype MobileAppStage,\n\tprovideKey,\n} from '@geekmidas/manifest';\nimport { type Declarable, edgeTo } from './construct-interface';\n\nexport interface MobileAppConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/app'`.\n\t * Required, the same field a site and a surface take.\n\t */\n\tpath: string;\n\t/**\n\t * The port Metro serves it on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, as a site's are,\n\t * and `gkm exec` hands it to Expo as `RCT_METRO_PORT`.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars the app reads — its\n\t * values are inlined at build time, as a site's are.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Which toolchain builds it — the same field a site names its framework\n\t * by. Expo is the one that ships, and the default.\n\t */\n\tvariant?: MobileAppDeclaration['variant'];\n\t/**\n\t * Its URL scheme.\n\t *\n\t * Normally omitted: it is the project's name — `shop` — on every stage.\n\t * Give one only when the app is known by another name.\n\t */\n\tscheme?: string;\n\t/**\n\t * How a deployed stage ships it, where that differs from the defaults: the\n\t * protected stage reads EAS's `production` environment and submits to\n\t * Play's `production` track, every other deployed stage `preview` and\n\t * `internal`, and every Android release is a `draft` until someone\n\t * releases it in Play Console.\n\t *\n\t * ```ts\n\t * stages: { beta: { environment: 'preview', android: { track: 'alpha' } } }\n\t * ```\n\t */\n\tstages?: Readonly<Record<string, MobileAppStage>>;\n}\n\nexport class MobileApp<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\t/** The key its scheme arrives under — what its `app.config.ts` reads. */\n\treadonly keys: { scheme: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: MobileAppConfig,\n\t\t/** Internal: how `.dependsOn()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { scheme: provideKey(this.id, 'scheme') };\n\t}\n\n\t/**\n\t * What this app calls — the surfaces it is built with the URLs of, and the\n\t * ones that come to trust its scheme.\n\t *\n\t * Immutable, like every other builder: it returns a new app rather than\n\t * changing this one.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): MobileApp<TName> {\n\t\treturn new MobileApp<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(edgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'mobile-app',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'expo',\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.scheme ? { scheme: this.config.scheme } : {}),\n\t\t\t\t...(this.config.stages ? { stages: this.config.stages } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.scheme],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAEb;CAOmB;CAEA;CARlB;;CAEA;CAEA,YACC,IACA,QAEA,eAAuD,CAAC,GACvD;EAHgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAEjB,KAAK,KAAK,YAAY,EAAY;EAClC,KAAK,OAAO,EAAE,QAAQ,WAAW,KAAK,IAAI,QAAQ,EAAE;CACrD;;;;;;;;CASA,UAAU,YAAqD;EAC9D,OAAO,IAAI,UAAiB,KAAK,IAA4B,KAAK,QAAQ,CACzE,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,MAAM,CACzB,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,MAAM;EAC5B,CACD;CACD;AACD"}
1
+ {"version":3,"file":"mobile-app.mjs","names":[],"sources":["../src/mobile-app.ts"],"sourcesContent":["/**\n * `MobileApp` — an Expo app, declared like a site.\n *\n * Its edges are the point, as a site's are. One `.dependsOn([api, auth])` is\n * the fact behind everything a mobile app otherwise has written down by hand:\n *\n * - its `EXPO_PUBLIC_API_URL` and `EXPO_PUBLIC_AUTH_URL`, which locally are\n * the servers' own ports — reachable once the app swaps `localhost` for the\n * address Metro is served from, which is what makes a phone on the LAN work;\n * - with an `Email` among them, Mailpit's inbox on a local stage\n * (`EXPO_PUBLIC_<ID>_INBOX_URL`), so a sign-in link can be opened from the\n * app — unset deployed, where there is no inbox;\n * - its URL scheme (`shop`), the same on every stage;\n * - the scheme in the auth server's and the API's trusted origins — and, on a\n * local stage, the `exp://` origins Expo Go sends from;\n * - Better Auth's Expo plugin on the auth server, and sign-in links an app asks\n * for built on an address the phone can open.\n *\n * ```ts\n * export const app = new MobileApp('App', { path: 'apps/app' })\n * .dependsOn([api, auth]);\n * ```\n *\n * Like a site it has no `.service`: it is built by its own toolchain, and\n * consumes addresses rather than connections. Nothing deploys it — EAS and the\n * stores do — so the targets derive *for* it and never run it.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\ttype Dependency,\n\ttype MobileAppDeclaration,\n\ttype MobileAppStage,\n\tprovideKey,\n} from '@geekmidas/manifest';\nimport { type Declarable, frontendEdgeTo } from './construct-interface';\n\nexport interface MobileAppConfig {\n\t/**\n\t * Where its source lives, relative to the workspace root — `'apps/app'`.\n\t * Required, the same field a site and a surface take.\n\t */\n\tpath: string;\n\t/**\n\t * The port Metro serves it on locally.\n\t *\n\t * Normally omitted: ports are assigned in a stable order, as a site's are,\n\t * and `gkm exec` hands it to Expo as `RCT_METRO_PORT`.\n\t */\n\tport?: number;\n\t/**\n\t * Modules to import when sniffing which env vars the app reads — its\n\t * values are inlined at build time, as a site's are.\n\t */\n\tconfig?: { client?: string; server?: string };\n\t/**\n\t * Which toolchain builds it — the same field a site names its framework\n\t * by. Expo is the one that ships, and the default.\n\t */\n\tvariant?: MobileAppDeclaration['variant'];\n\t/**\n\t * Its URL scheme.\n\t *\n\t * Normally omitted: it is the project's name — `shop` — on every stage.\n\t * Give one only when the app is known by another name.\n\t */\n\tscheme?: string;\n\t/**\n\t * How a deployed stage ships it, where that differs from the defaults: the\n\t * protected stage reads EAS's `production` environment and submits to\n\t * Play's `production` track, every other deployed stage `preview` and\n\t * `internal`, and every Android release is a `draft` until someone\n\t * releases it in Play Console.\n\t *\n\t * ```ts\n\t * stages: { beta: { environment: 'preview', android: { track: 'alpha' } } }\n\t * ```\n\t */\n\tstages?: Readonly<Record<string, MobileAppStage>>;\n}\n\nexport class MobileApp<TName extends string = string>\n\timplements Declarable<TName>\n{\n\treadonly id: TName;\n\t/** The key its scheme arrives under — what its `app.config.ts` reads. */\n\treadonly keys: { scheme: string };\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: MobileAppConfig,\n\t\t/** Internal: how `.dependsOn()` carries edges into the copy it returns. */\n\t\tprivate readonly dependencies: readonly Dependency[] = [],\n\t) {\n\t\tthis.id = canonicalId(id as string) as TName;\n\t\tthis.keys = { scheme: provideKey(this.id, 'scheme') };\n\t}\n\n\t/**\n\t * What this app calls — the surfaces it is built with the URLs of, and the\n\t * ones that come to trust its scheme.\n\t *\n\t * Immutable, like every other builder: it returns a new app rather than\n\t * changing this one.\n\t *\n\t * A plain edge to a `FileServer` is to its public face — the address its\n\t * objects are served on, inlined — never to the bucket a phone has no\n\t * business holding a key to.\n\t */\n\tdependsOn(constructs: readonly Declarable[]): MobileApp<TName> {\n\t\treturn new MobileApp<TName>(this.id as ConstructName<TName>, this.config, [\n\t\t\t...this.dependencies,\n\t\t\t...constructs.map(frontendEdgeTo),\n\t\t]);\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'mobile-app',\n\t\t\t\tid: this.id,\n\t\t\t\tvariant: this.config.variant ?? 'expo',\n\t\t\t\tapp: {\n\t\t\t\t\tpath: this.config.path,\n\t\t\t\t\t...(this.config.port ? { port: this.config.port } : {}),\n\t\t\t\t\t...(this.config.config ? { config: this.config.config } : {}),\n\t\t\t\t},\n\t\t\t\t...(this.config.scheme ? { scheme: this.config.scheme } : {}),\n\t\t\t\t...(this.config.stages ? { stages: this.config.stages } : {}),\n\t\t\t\tdependencies: this.dependencies,\n\t\t\t\tprovides: [this.keys.scheme],\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAEb;CAOmB;CAEA;CARlB;;CAEA;CAEA,YACC,IACA,QAEA,eAAuD,CAAC,GACvD;EAHgB,KAAA,SAAA;EAEA,KAAA,eAAA;EAEjB,KAAK,KAAK,YAAY,EAAY;EAClC,KAAK,OAAO,EAAE,QAAQ,WAAW,KAAK,IAAI,QAAQ,EAAE;CACrD;;;;;;;;;;;;CAaA,UAAU,YAAqD;EAC9D,OAAO,IAAI,UAAiB,KAAK,IAA4B,KAAK,QAAQ,CACzE,GAAG,KAAK,cACR,GAAG,WAAW,IAAI,cAAc,CACjC,CAAC;CACF;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,SAAS,KAAK,OAAO,WAAW;GAChC,KAAK;IACJ,MAAM,KAAK,OAAO;IAClB,GAAI,KAAK,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;IACrD,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC5D;GACA,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,GAAI,KAAK,OAAO,SAAS,EAAE,QAAQ,KAAK,OAAO,OAAO,IAAI,CAAC;GAC3D,cAAc,KAAK;GACnB,UAAU,CAAC,KAAK,KAAK,MAAM;EAC5B,CACD;CACD;AACD"}
@@ -27,7 +27,7 @@ var ObjectStorage = class {
27
27
  this.options = options;
28
28
  const canonical = (0, _geekmidas_manifest.canonicalId)(id);
29
29
  this.id = canonical;
30
- this.keys = { url: (0, _geekmidas_manifest.provideKey)(canonical, "url") };
30
+ this.keys = { connectionString: (0, _geekmidas_manifest.provideKey)(canonical, "connectionString") };
31
31
  this.expire = require_expire.expiryDays(canonical, options.expire);
32
32
  this.service = {
33
33
  serviceName: (0, _geekmidas_manifest.serviceKey)(canonical),
@@ -38,21 +38,21 @@ var ObjectStorage = class {
38
38
  return [{
39
39
  kind: "objects",
40
40
  id: this.id,
41
- provides: [this.keys.url],
41
+ provides: [this.keys.connectionString],
42
42
  ...this.options.versioned ? { versioned: true } : {},
43
43
  ...this.expire ? { expire: this.expire } : {}
44
44
  }];
45
45
  }
46
46
  /**
47
- * Builds the client from the single URL the adapter supplied.
47
+ * Builds the client from the connection string the adapter supplied.
48
48
  *
49
- * The URL's scheme selects the driver, so this construct imports no provider
49
+ * Its scheme selects the driver, so this construct imports no provider
50
50
  * and an app that never touches S3 never resolves the AWS SDK. Whoever
51
51
  * assembles the application registers the drivers its target needs.
52
52
  */
53
53
  async connect({ envParser }) {
54
- const { url } = envParser.create((get) => ({ url: get(this.keys.url).string() })).parse();
55
- return (0, _geekmidas_storage.createStorageClient)(url);
54
+ const { connectionString } = envParser.create((get) => ({ connectionString: get(this.keys.connectionString).string() })).parse();
55
+ return (0, _geekmidas_storage.createStorageClient)(connectionString);
56
56
  }
57
57
  };
58
58
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"object-storage.cjs","names":["canonicalId","provideKey","expiryDays","serviceKey","createStorageClient"],"sources":["../src/object-storage.ts"],"sourcesContent":["/**\n * `ObjectStorage` — a declared bucket.\n *\n * Where the three packages meet: it implements the construct contract, derives\n * its env key through `@geekmidas/manifest`, and hands back a\n * `@geekmidas/storage` client. It names no cloud — `--target=aws` fills the\n * injected URL with S3's values, local dev with MinIO's.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport type { Construct } from './construct-interface';\nimport { expiryDays, type ObjectExpiry } from './expire';\n\nexport {\n\tExpiryDaysInvalid,\n\tExpiryPrefixInvalid,\n\ttype ObjectExpiry,\n} from './expire';\n\nexport interface ObjectStorageOptions {\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * Delete the objects under each prefix this many days after they were\n\t * written — `{ 'quotes/': { days: 30 } }`.\n\t */\n\texpire?: ObjectExpiry;\n}\n\nexport class ObjectStorage<TName extends string = string>\n\timplements Construct<TName, StorageClient>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, StorageClient>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift — the whole point\n\t * of the construct owning both faces.\n\t */\n\tprivate readonly keys: { url: string };\n\n\t/** Checked once, at declaration: prefix → days. */\n\tprivate readonly expire: Record<string, number> | undefined;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: ObjectStorageOptions = {},\n\t) {\n\t\t// Canonicalises, so `uploads` and `Uploads` are one construct rather than\n\t\t// two that collide. Throws on anything that cannot become a valid id.\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = { url: provideKey(canonical, 'url') };\n\t\tthis.expire = expiryDays(canonical, options.expire);\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.url],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t\t...(this.expire ? { expire: this.expire } : {}),\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Builds the client from the single URL the adapter supplied.\n\t *\n\t * The URL's scheme selects the driver, so this construct imports no provider\n\t * and an app that never touches S3 never resolves the AWS SDK. Whoever\n\t * assembles the application registers the drivers its target needs.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<StorageClient> {\n\t\tconst { url } = envParser\n\t\t\t.create((get) => ({ url: get(this.keys.url).string() }))\n\t\t\t.parse();\n\n\t\treturn createStorageClient(url);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,IAAa,gBAAb,MAEA;CAgBmB;CAflB;CACA;;;;;;CAOA;;CAGA;CAEA,YACC,IACA,UAAiD,CAAC,GACjD;EADgB,KAAA,UAAA;EAIjB,MAAM,aAAA,GAAYA,oBAAAA,YAAAA,CAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,OAAO,EAAE,MAAA,GAAKC,oBAAAA,WAAAA,CAAW,WAAW,KAAK,EAAE;EAChD,KAAK,SAASC,eAAAA,WAAW,WAAW,QAAQ,MAAM;EAGlD,KAAK,UAAU;GACd,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,SAAS;GACjC,WAAW,YAAY,KAAK,QAAQ,OAAO;EAC5C;CACD;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,GAAG;GACxB,GAAI,KAAK,QAAQ,YAAY,EAAE,WAAW,KAAK,IAAI,CAAC;GACpD,GAAI,KAAK,SAAS,EAAE,QAAQ,KAAK,OAAO,IAAI,CAAC;EAC9C,CACD;CACD;;;;;;;;CASA,MAAc,QAAQ,EACrB,aACkD;EAClD,MAAM,EAAE,QAAQ,UACd,QAAQ,SAAS,EAAE,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACvD,MAAM;EAER,QAAA,GAAOC,mBAAAA,oBAAAA,CAAoB,GAAG;CAC/B;AACD"}
1
+ {"version":3,"file":"object-storage.cjs","names":["canonicalId","provideKey","expiryDays","serviceKey","createStorageClient"],"sources":["../src/object-storage.ts"],"sourcesContent":["/**\n * `ObjectStorage` — a declared bucket.\n *\n * Where the three packages meet: it implements the construct contract, derives\n * its env key through `@geekmidas/manifest`, and hands back a\n * `@geekmidas/storage` client. It names no cloud — `--target=aws` fills the\n * injected URL with S3's values, local dev with MinIO's.\n */\n\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type { Service, ServiceRegisterOptions } from '@geekmidas/services';\nimport { createStorageClient, type StorageClient } from '@geekmidas/storage';\nimport type { Construct } from './construct-interface';\nimport { expiryDays, type ObjectExpiry } from './expire';\n\nexport {\n\tExpiryDaysInvalid,\n\tExpiryPrefixInvalid,\n\ttype ObjectExpiry,\n} from './expire';\n\nexport interface ObjectStorageOptions {\n\t/** Keep previous versions of an object. */\n\tversioned?: boolean;\n\t/**\n\t * Delete the objects under each prefix this many days after they were\n\t * written — `{ 'quotes/': { days: 30 } }`.\n\t */\n\texpire?: ObjectExpiry;\n}\n\nexport class ObjectStorage<TName extends string = string>\n\timplements Construct<TName, StorageClient>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, StorageClient>;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the key the\n\t * build publishes and the key the client reads cannot drift — the whole point\n\t * of the construct owning both faces.\n\t */\n\tprivate readonly keys: { connectionString: string };\n\n\t/** Checked once, at declaration: prefix → days. */\n\tprivate readonly expire: Record<string, number> | undefined;\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly options: ObjectStorageOptions = {},\n\t) {\n\t\t// Canonicalises, so `uploads` and `Uploads` are one construct rather than\n\t\t// two that collide. Throws on anything that cannot become a valid id.\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.keys = {\n\t\t\tconnectionString: provideKey(canonical, 'connectionString'),\n\t\t};\n\t\tthis.expire = expiryDays(canonical, options.expire);\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'objects',\n\t\t\t\tid: this.id,\n\t\t\t\tprovides: [this.keys.connectionString],\n\t\t\t\t...(this.options.versioned ? { versioned: true } : {}),\n\t\t\t\t...(this.expire ? { expire: this.expire } : {}),\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Builds the client from the connection string the adapter supplied.\n\t *\n\t * Its scheme selects the driver, so this construct imports no provider\n\t * and an app that never touches S3 never resolves the AWS SDK. Whoever\n\t * assembles the application registers the drivers its target needs.\n\t */\n\tprivate async connect({\n\t\tenvParser,\n\t}: ServiceRegisterOptions): Promise<StorageClient> {\n\t\tconst { connectionString } = envParser\n\t\t\t.create((get) => ({\n\t\t\t\tconnectionString: get(this.keys.connectionString).string(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\treturn createStorageClient(connectionString);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,IAAa,gBAAb,MAEA;CAgBmB;CAflB;CACA;;;;;;CAOA;;CAGA;CAEA,YACC,IACA,UAAiD,CAAC,GACjD;EADgB,KAAA,UAAA;EAIjB,MAAM,aAAA,GAAYA,oBAAAA,YAAAA,CAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,OAAO,EACX,mBAAA,GAAkBC,oBAAAA,WAAAA,CAAW,WAAW,kBAAkB,EAC3D;EACA,KAAK,SAASC,eAAAA,WAAW,WAAW,QAAQ,MAAM;EAGlD,KAAK,UAAU;GACd,cAAA,GAAaC,oBAAAA,WAAAA,CAAW,SAAS;GACjC,WAAW,YAAY,KAAK,QAAQ,OAAO;EAC5C;CACD;CAEA,UAAyB;EACxB,OAAO,CACN;GACC,MAAM;GACN,IAAI,KAAK;GACT,UAAU,CAAC,KAAK,KAAK,gBAAgB;GACrC,GAAI,KAAK,QAAQ,YAAY,EAAE,WAAW,KAAK,IAAI,CAAC;GACpD,GAAI,KAAK,SAAS,EAAE,QAAQ,KAAK,OAAO,IAAI,CAAC;EAC9C,CACD;CACD;;;;;;;;CASA,MAAc,QAAQ,EACrB,aACkD;EAClD,MAAM,EAAE,qBAAqB,UAC3B,QAAQ,SAAS,EACjB,kBAAkB,IAAI,KAAK,KAAK,gBAAgB,CAAC,CAAC,OAAO,EAC1D,EAAE,CAAC,CACF,MAAM;EAER,QAAA,GAAOC,mBAAAA,oBAAAA,CAAoB,gBAAgB;CAC5C;AACD"}
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-DugP0E5q.cjs";
1
+ import { n as Construct } from "./construct-interface-DhbaONW2.cjs";
2
2
  import { n as ExpiryPrefixInvalid, r as ObjectExpiry, t as ExpiryDaysInvalid } from "./expire-C586zznE.cjs";
3
3
  import { Service } from "@geekmidas/services";
4
4
  import { ConstructName, Declaration } from "@geekmidas/manifest";
@@ -28,9 +28,9 @@ export declare class ObjectStorage<TName extends string = string> implements Con
28
28
  constructor(id: ConstructName<TName>, options?: ObjectStorageOptions);
29
29
  declare(): Declaration[];
30
30
  /**
31
- * Builds the client from the single URL the adapter supplied.
31
+ * Builds the client from the connection string the adapter supplied.
32
32
  *
33
- * The URL's scheme selects the driver, so this construct imports no provider
33
+ * Its scheme selects the driver, so this construct imports no provider
34
34
  * and an app that never touches S3 never resolves the AWS SDK. Whoever
35
35
  * assembles the application registers the drivers its target needs.
36
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"object-storage.d.cts","names":[],"sources":["../src/object-storage.ts"],"mappings":";;;;;;iBA2BiB;;EAEhB;;;;;EAKA,SAAS;;qBAGG,cAAc,0CACf,UAAU,OAAO;mBAiBV;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;;;;;mBAO9B;;mBAGA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAiB3B,WAAW;;;;;;;;UAmBG"}
1
+ {"version":3,"file":"object-storage.d.cts","names":[],"sources":["../src/object-storage.ts"],"mappings":";;;;;;iBA2BiB;;EAEhB;;;;;EAKA,SAAS;;qBAGG,cAAc,0CACf,UAAU,OAAO;mBAiBV;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;;;;;mBAO9B;;mBAGA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAmB3B,WAAW;;;;;;;;UAmBG"}
@@ -1,4 +1,4 @@
1
- import { n as Construct } from "./construct-interface-CSA9VeWM.mjs";
1
+ import { n as Construct } from "./construct-interface-DxfkFxkl.mjs";
2
2
  import { n as ExpiryPrefixInvalid, r as ObjectExpiry, t as ExpiryDaysInvalid } from "./expire-C586zznE.mjs";
3
3
  import { ConstructName, Declaration } from "@geekmidas/manifest";
4
4
  import { StorageClient } from "@geekmidas/storage";
@@ -28,9 +28,9 @@ export declare class ObjectStorage<TName extends string = string> implements Con
28
28
  constructor(id: ConstructName<TName>, options?: ObjectStorageOptions);
29
29
  declare(): Declaration[];
30
30
  /**
31
- * Builds the client from the single URL the adapter supplied.
31
+ * Builds the client from the connection string the adapter supplied.
32
32
  *
33
- * The URL's scheme selects the driver, so this construct imports no provider
33
+ * Its scheme selects the driver, so this construct imports no provider
34
34
  * and an app that never touches S3 never resolves the AWS SDK. Whoever
35
35
  * assembles the application registers the drivers its target needs.
36
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"object-storage.d.mts","names":[],"sources":["../src/object-storage.ts"],"mappings":";;;;;;iBA2BiB;;EAEhB;;;;;EAKA,SAAS;;qBAGG,cAAc,0CACf,UAAU,OAAO;mBAiBV;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;;;;;mBAO9B;;mBAGA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAiB3B,WAAW;;;;;;;;UAmBG"}
1
+ {"version":3,"file":"object-storage.d.mts","names":[],"sources":["../src/object-storage.ts"],"mappings":";;;;;;iBA2BiB;;EAEhB;;;;;EAKA,SAAS;;qBAGG,cAAc,0CACf,UAAU,OAAO;mBAiBV;WAfT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;;;;;;mBAO9B;;mBAGA;EAEjB,YACC,IAAI,cAAc,QACD,UAAS;EAmB3B,WAAW;;;;;;;;UAmBG"}