stratal 0.0.16 → 0.0.18

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 (181) hide show
  1. package/README.md +4 -0
  2. package/dist/bin/cloudflare-workers-loader.mjs +33 -1
  3. package/dist/bin/cloudflare-workers-loader.mjs.map +1 -1
  4. package/dist/bin/quarry.mjs +183 -55
  5. package/dist/bin/quarry.mjs.map +1 -1
  6. package/dist/cache/index.d.mts +2 -2
  7. package/dist/cache/index.d.mts.map +1 -1
  8. package/dist/cache/index.mjs +3 -11
  9. package/dist/cache/index.mjs.map +1 -1
  10. package/dist/{colors-DJaRDXoS.mjs → colors-BTAnQRGU.mjs} +1 -1
  11. package/dist/{colors-DJaRDXoS.mjs.map → colors-BTAnQRGU.mjs.map} +1 -1
  12. package/dist/{command-B-QH-Vu3.d.mts → command-B1YuV-UZ.d.mts} +2 -2
  13. package/dist/{command-B-QH-Vu3.d.mts.map → command-B1YuV-UZ.d.mts.map} +1 -1
  14. package/dist/{command-BvCOD6df.mjs → command-DjGqCYHv.mjs} +7 -4
  15. package/dist/command-DjGqCYHv.mjs.map +1 -0
  16. package/dist/config/index.d.mts +2 -2
  17. package/dist/config/index.mjs +12 -20
  18. package/dist/config/index.mjs.map +1 -1
  19. package/dist/consumer-registry-BkuHXR_u.d.mts +142 -0
  20. package/dist/consumer-registry-BkuHXR_u.d.mts.map +1 -0
  21. package/dist/cron/index.d.mts +3 -116
  22. package/dist/cron/index.d.mts.map +1 -1
  23. package/dist/cron/index.mjs +1 -4
  24. package/dist/{cron-manager-DR7fiG6o.mjs → cron-manager-1KnZvojs.mjs} +3 -3
  25. package/dist/{cron-manager-DR7fiG6o.mjs.map → cron-manager-1KnZvojs.mjs.map} +1 -1
  26. package/dist/cron-manager-BnEZquBL.d.mts +117 -0
  27. package/dist/cron-manager-BnEZquBL.d.mts.map +1 -0
  28. package/dist/di/index.d.mts +2 -2
  29. package/dist/di/index.mjs +3 -4
  30. package/dist/email/index.d.mts +3 -3
  31. package/dist/email/index.mjs +8 -17
  32. package/dist/email/index.mjs.map +1 -1
  33. package/dist/{en-DaewN8hc.mjs → en-3QnZwP-u.mjs} +10 -1
  34. package/dist/en-3QnZwP-u.mjs.map +1 -0
  35. package/dist/errors/index.d.mts +2 -2
  36. package/dist/errors/index.mjs +2 -4
  37. package/dist/errors--RBIvDXr.mjs +1560 -0
  38. package/dist/errors--RBIvDXr.mjs.map +1 -0
  39. package/dist/{errors-H3TZnVeX.mjs → errors-B7hCnXgB.mjs} +2 -2
  40. package/dist/{errors-H3TZnVeX.mjs.map → errors-B7hCnXgB.mjs.map} +1 -1
  41. package/dist/events/index.d.mts +2 -2
  42. package/dist/events/index.mjs +1 -3
  43. package/dist/{events-CXl-o1Ad.mjs → events-UTJliZhl.mjs} +2 -3
  44. package/dist/{events-CXl-o1Ad.mjs.map → events-UTJliZhl.mjs.map} +1 -1
  45. package/dist/{gateway-context-BkZ4UKaX.mjs → gateway-context-BdBFoQd8.mjs} +66 -10
  46. package/dist/gateway-context-BdBFoQd8.mjs.map +1 -0
  47. package/dist/guards/index.d.mts +3 -3
  48. package/dist/guards/index.d.mts.map +1 -1
  49. package/dist/guards/index.mjs +1 -1
  50. package/dist/{guards-DUk_Kzst.mjs → guards-MtDgcHnF.mjs} +1 -1
  51. package/dist/{guards-DUk_Kzst.mjs.map → guards-MtDgcHnF.mjs.map} +1 -1
  52. package/dist/i18n/index.d.mts +3 -3
  53. package/dist/i18n/index.mjs +3 -16
  54. package/dist/i18n/messages/en/index.d.mts +1 -1
  55. package/dist/i18n/messages/en/index.mjs +1 -1
  56. package/dist/i18n/utils/index.d.mts +30 -0
  57. package/dist/i18n/utils/index.d.mts.map +1 -0
  58. package/dist/i18n/utils/index.mjs +2 -0
  59. package/dist/i18n/validation/index.d.mts +1 -1
  60. package/dist/i18n/validation/index.mjs +1 -1
  61. package/dist/i18n.module-BpLLLCTg.mjs +2462 -0
  62. package/dist/i18n.module-BpLLLCTg.mjs.map +1 -0
  63. package/dist/{index-D_w_Rmtd.d.mts → index-BDh9J2KD.d.mts} +10 -1
  64. package/dist/{index-D_w_Rmtd.d.mts.map → index-BDh9J2KD.d.mts.map} +1 -1
  65. package/dist/{index-Dp6A5ywM.d.mts → index-BR23zDMy.d.mts} +1 -1
  66. package/dist/{index-Dp6A5ywM.d.mts.map → index-BR23zDMy.d.mts.map} +1 -1
  67. package/dist/index-BrmS34sa.d.mts +4287 -0
  68. package/dist/index-BrmS34sa.d.mts.map +1 -0
  69. package/dist/{index-D9iYu2Yc.d.mts → index-DPxmo6AY.d.mts} +5 -144
  70. package/dist/index-DPxmo6AY.d.mts.map +1 -0
  71. package/dist/{index-DVhdhLvE.d.mts → index-Dfpd_ypO.d.mts} +38 -9
  72. package/dist/index-Dfpd_ypO.d.mts.map +1 -0
  73. package/dist/index.d.mts +4 -3
  74. package/dist/index.d.mts.map +1 -1
  75. package/dist/index.mjs +1 -20
  76. package/dist/{is-command-BfCgWAcQ.mjs → is-command-PvULqiTa.mjs} +2 -2
  77. package/dist/{is-command-BfCgWAcQ.mjs.map → is-command-PvULqiTa.mjs.map} +1 -1
  78. package/dist/{is-seeder-CebjZCDn.mjs → is-seeder-BN9Ej1r7.mjs} +1 -1
  79. package/dist/{is-seeder-CebjZCDn.mjs.map → is-seeder-BN9Ej1r7.mjs.map} +1 -1
  80. package/dist/logger/index.d.mts +1 -1
  81. package/dist/logger/index.mjs +1 -2
  82. package/dist/{logger-BR1-s1Um.mjs → logger-c0ftIK4G.mjs} +170 -4
  83. package/dist/logger-c0ftIK4G.mjs.map +1 -0
  84. package/dist/module/index.d.mts +3 -119
  85. package/dist/module/index.d.mts.map +1 -1
  86. package/dist/module/index.mjs +1 -11
  87. package/dist/module-C3YZ-kZN.mjs +719 -0
  88. package/dist/module-C3YZ-kZN.mjs.map +1 -0
  89. package/dist/openapi/index.d.mts +54 -54
  90. package/dist/openapi/index.d.mts.map +1 -1
  91. package/dist/openapi/index.mjs +3 -16
  92. package/dist/openapi-tools.service-B77QXD56.mjs +197 -0
  93. package/dist/openapi-tools.service-B77QXD56.mjs.map +1 -0
  94. package/dist/openapi.service-6yj0BUY4.d.mts +50 -0
  95. package/dist/openapi.service-6yj0BUY4.d.mts.map +1 -0
  96. package/dist/quarry/index.d.mts +124 -29
  97. package/dist/quarry/index.d.mts.map +1 -1
  98. package/dist/quarry/index.mjs +5 -7
  99. package/dist/quarry-registry-CQCIlYTO.mjs +686 -0
  100. package/dist/quarry-registry-CQCIlYTO.mjs.map +1 -0
  101. package/dist/queue/index.d.mts +2 -1
  102. package/dist/queue/index.mjs +3 -14
  103. package/dist/queue/index.mjs.map +1 -1
  104. package/dist/{queue.module-BZvmeAMj.mjs → queue.module-DIjD6nr-.mjs} +39 -42
  105. package/dist/queue.module-DIjD6nr-.mjs.map +1 -0
  106. package/dist/{resend.provider-BCCACQAU.mjs → resend.provider-Bvw36rQy.mjs} +1 -4
  107. package/dist/{resend.provider-BCCACQAU.mjs.map → resend.provider-Bvw36rQy.mjs.map} +1 -1
  108. package/dist/router/index.d.mts +2 -2
  109. package/dist/router/index.mjs +5 -16
  110. package/dist/{s3-storage.provider-BLlzQYiJ.mjs → s3-storage.provider-BAhHDMI3.mjs} +16 -9
  111. package/dist/s3-storage.provider-BAhHDMI3.mjs.map +1 -0
  112. package/dist/seeder/index.d.mts +3 -4
  113. package/dist/seeder/index.d.mts.map +1 -1
  114. package/dist/seeder/index.mjs +2 -7
  115. package/dist/{seeder-Cupi5jl-.mjs → seeder-D7VXULXB.mjs} +20 -17
  116. package/dist/seeder-D7VXULXB.mjs.map +1 -0
  117. package/dist/setup-BRIN-iYT.mjs +37 -0
  118. package/dist/setup-BRIN-iYT.mjs.map +1 -0
  119. package/dist/{smtp.provider-B8XtOcHU.mjs → smtp.provider-CAwpvzvD.mjs} +1 -4
  120. package/dist/{smtp.provider-B8XtOcHU.mjs.map → smtp.provider-CAwpvzvD.mjs.map} +1 -1
  121. package/dist/storage/index.d.mts +2 -195
  122. package/dist/storage/index.d.mts.map +1 -1
  123. package/dist/storage/index.mjs +2 -14
  124. package/dist/storage/providers/index.d.mts +273 -0
  125. package/dist/storage/providers/index.d.mts.map +1 -0
  126. package/dist/storage/providers/index.mjs +2 -0
  127. package/dist/{storage-By_ow2o_.mjs → storage-CJ-QOwNv.mjs} +8 -9
  128. package/dist/storage-CJ-QOwNv.mjs.map +1 -0
  129. package/dist/storage-provider.interface-YRtyYBxV.d.mts +203 -0
  130. package/dist/storage-provider.interface-YRtyYBxV.d.mts.map +1 -0
  131. package/dist/stratal-B7G4i9-N.mjs +502 -0
  132. package/dist/stratal-B7G4i9-N.mjs.map +1 -0
  133. package/dist/{types-DahElfUw.d.mts → types-CN0zONAZ.d.mts} +2 -2
  134. package/dist/types-CN0zONAZ.d.mts.map +1 -0
  135. package/dist/{usage-generator-C9hWziY4.mjs → usage-generator-Cl1HPlUp.mjs} +2 -2
  136. package/dist/{usage-generator-C9hWziY4.mjs.map → usage-generator-Cl1HPlUp.mjs.map} +1 -1
  137. package/dist/{validation-Bh875Lyg.mjs → validation-B4bePOa_.mjs} +5 -5
  138. package/dist/{validation-Bh875Lyg.mjs.map → validation-B4bePOa_.mjs.map} +1 -1
  139. package/dist/websocket/index.d.mts +2 -2
  140. package/dist/websocket/index.d.mts.map +1 -1
  141. package/dist/websocket/index.mjs +1 -5
  142. package/dist/workers/index.d.mts +1 -1
  143. package/dist/workers/index.d.mts.map +1 -1
  144. package/dist/workers/index.mjs +2 -20
  145. package/dist/workers/index.mjs.map +1 -1
  146. package/package.json +39 -31
  147. package/dist/application-zG8b-pol.d.mts +0 -116
  148. package/dist/application-zG8b-pol.d.mts.map +0 -1
  149. package/dist/command-BvCOD6df.mjs.map +0 -1
  150. package/dist/decorate-D5j-d9_z.mjs +0 -171
  151. package/dist/decorate-D5j-d9_z.mjs.map +0 -1
  152. package/dist/en-DaewN8hc.mjs.map +0 -1
  153. package/dist/errors-CtCi1wn6.mjs +0 -707
  154. package/dist/errors-CtCi1wn6.mjs.map +0 -1
  155. package/dist/gateway-context-BkZ4UKaX.mjs.map +0 -1
  156. package/dist/i18n.module-W8OJxg3d.mjs +0 -1791
  157. package/dist/i18n.module-W8OJxg3d.mjs.map +0 -1
  158. package/dist/index-BJWm863C.d.mts +0 -2616
  159. package/dist/index-BJWm863C.d.mts.map +0 -1
  160. package/dist/index-D9iYu2Yc.d.mts.map +0 -1
  161. package/dist/index-DVhdhLvE.d.mts.map +0 -1
  162. package/dist/logger-BR1-s1Um.mjs.map +0 -1
  163. package/dist/middleware/index.d.mts +0 -2
  164. package/dist/middleware/index.mjs +0 -6
  165. package/dist/middleware-C0Ebzswy.mjs +0 -362
  166. package/dist/middleware-C0Ebzswy.mjs.map +0 -1
  167. package/dist/module-BgdxxzBe.mjs +0 -370
  168. package/dist/module-BgdxxzBe.mjs.map +0 -1
  169. package/dist/quarry-registry-DCwqVcRp.mjs +0 -310
  170. package/dist/quarry-registry-DCwqVcRp.mjs.map +0 -1
  171. package/dist/queue.module-BZvmeAMj.mjs.map +0 -1
  172. package/dist/router-context-BEJe9HEB.mjs +0 -264
  173. package/dist/router-context-BEJe9HEB.mjs.map +0 -1
  174. package/dist/s3-storage.provider-BLlzQYiJ.mjs.map +0 -1
  175. package/dist/seeder-Cupi5jl-.mjs.map +0 -1
  176. package/dist/storage-By_ow2o_.mjs.map +0 -1
  177. package/dist/stratal-CE0iTz4f.mjs +0 -305
  178. package/dist/stratal-CE0iTz4f.mjs.map +0 -1
  179. package/dist/types-CLhOhYsQ.d.mts +0 -64
  180. package/dist/types-CLhOhYsQ.d.mts.map +0 -1
  181. package/dist/types-DahElfUw.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quarry-registry-CQCIlYTO.mjs","names":[],"sources":["../src/quarry/commands/api.command.ts","../src/quarry/commands/event-list.command.ts","../src/quarry/errors/command-not-found.error.ts","../src/quarry/commands/help.command.ts","../src/quarry/commands/mcp-serve.command.ts","../src/quarry/commands/mcp-tools.command.ts","../src/quarry/commands/queue-list.command.ts","../src/quarry/commands/route-list.command.ts","../src/quarry/commands/schedule-list.command.ts","../src/quarry/command-internals.ts","../src/quarry/signature-parser.ts","../src/quarry/quarry-registry.ts"],"sourcesContent":["import { inject } from 'tsyringe'\nimport type { Application } from '../../application'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { Command } from '../command'\nimport { bold, cyan, green, red, yellow } from '../colors'\n\nexport class ApiCommand extends Command {\n static command = 'api {route?} {--method= : HTTP method} {--data= : JSON request body} {--header=* : Headers (Key:Value)} {--query=* : Query params (key=value)}'\n static description = 'Call an API route directly'\n static aliases = ['api:call']\n\n constructor(@inject(DI_TOKENS.Application) private app: Application) {\n super()\n }\n\n async handle(): Promise<number | undefined> {\n const route = this.string('route')\n\n if (!route) {\n return (await this.call('route:list')).exitCode\n }\n\n return this.callRoute(route)\n }\n\n private async callRoute(route: string): Promise<number> {\n const method = (this.string('method') || 'GET').toUpperCase()\n const data = this.string('data')\n const headerArgs = this.array('header')\n const queryArgs = this.array('query')\n\n const headers: Record<string, string> = {}\n if (data) {\n headers['Content-Type'] = 'application/json'\n }\n for (const h of headerArgs) {\n const colonIdx = h.indexOf(':')\n if (colonIdx > 0) {\n headers[h.slice(0, colonIdx).trim()] = h.slice(colonIdx + 1).trim()\n }\n }\n\n // Build query string\n let url = route\n if (queryArgs.length > 0) {\n const parts = queryArgs.map((q) => {\n const eqIdx = q.indexOf('=')\n if (eqIdx > 0) {\n return `${encodeURIComponent(q.slice(0, eqIdx))}=${encodeURIComponent(q.slice(eqIdx + 1))}`\n }\n return encodeURIComponent(q)\n })\n url += `?${parts.join('&')}`\n }\n\n const request = new Request(`http://localhost${url}`, {\n method,\n headers,\n body: data || undefined,\n })\n\n const response = await this.app.hono.fetch(request, this.app.env)\n const body = await response.text()\n\n // Color-coded status\n const statusText = `${response.status} ${response.statusText}`\n let coloredStatus: string\n if (response.status >= 200 && response.status < 300) {\n coloredStatus = green(bold(statusText))\n } else if (response.status >= 300 && response.status < 400) {\n coloredStatus = yellow(bold(statusText))\n } else {\n coloredStatus = red(bold(statusText))\n }\n\n this.line(`${cyan(method)} ${route} ${coloredStatus}`)\n this.newLine()\n\n // Response headers\n const headerLines: string[] = []\n response.headers.forEach((value, key) => {\n headerLines.push(` ${key}: ${value}`)\n })\n if (headerLines.length > 0) {\n this.line(bold('Headers:'))\n for (const hl of headerLines) {\n this.line(hl)\n }\n this.newLine()\n }\n\n // Body\n if (body) {\n this.line(bold('Body:'))\n try {\n this.line(JSON.stringify(JSON.parse(body), null, 2))\n } catch {\n this.line(body)\n }\n }\n\n return response.status >= 400 ? 1 : 0\n }\n}\n","import { inject } from 'tsyringe'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { getListenerHandlers } from '../../events'\nimport type { ModuleRegistry } from '../../module/module-registry'\nimport { Command } from '../command'\n\nexport class EventListCommand extends Command {\n static command = 'event:list'\n static description = 'List all registered event listeners'\n\n constructor(@inject(DI_TOKENS.ModuleRegistry) private modules: ModuleRegistry) {\n super()\n }\n\n handle(): number | undefined {\n const listeners = this.modules.getAllListeners()\n\n if (listeners.length === 0) {\n this.info('No event listeners found')\n return 0\n }\n\n const rows: string[][] = []\n\n for (const ListenerClass of listeners) {\n const handlers = getListenerHandlers(ListenerClass)\n for (const { methodName, event, options } of handlers) {\n rows.push([\n event,\n ListenerClass.name,\n methodName,\n String(options?.priority ?? 0),\n options?.blocking ? 'Yes' : 'No',\n ])\n }\n }\n\n if (rows.length === 0) {\n this.info('No event handlers found')\n return 0\n }\n\n this.table(['Event', 'Listener', 'Method', 'Priority', 'Blocking'], rows)\n\n return undefined\n }\n}\n","/**\n * Thrown when a command is not found in the Quarry registry.\n */\nexport class CommandNotFoundError extends Error {\n constructor(name: string) {\n super(`Command \"${name}\" is not registered.`)\n this.name = 'CommandNotFoundError'\n }\n}\n","import { inject } from 'tsyringe'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { Command } from '../command'\nimport { CommandNotFoundError } from '../errors/command-not-found.error'\nimport type { QuarryRegistry } from '../quarry-registry'\n\nexport class HelpCommand extends Command {\n static command = 'help {command?}'\n static description = 'Show help for a command or list all commands'\n static aliases = ['list']\n\n constructor(@inject(DI_TOKENS.Quarry) private quarryRegistry: QuarryRegistry) {\n super()\n }\n\n async handle(): Promise<number | undefined> {\n const commandName = this.string('command')\n\n if (!commandName) {\n const listing = await this.quarryRegistry.listUsage()\n this.line(listing)\n return 0\n }\n\n try {\n const usage = await this.quarryRegistry.usage(commandName)\n this.line(usage)\n return 0\n } catch (error) {\n if (error instanceof CommandNotFoundError) {\n this.fail(`Unknown command: ${commandName}`)\n return 1\n }\n throw error\n }\n }\n}\n","import { inject } from 'tsyringe'\nimport { z } from 'zod'\nimport type { Application } from '../../application'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { OPENAPI_TOKENS } from '../../openapi/openapi.tokens'\nimport type { Dispatcher } from '../../openapi/services/openapi-tools.service'\nimport { OpenApiToolsService } from '../../openapi/services/openapi-tools.service'\nimport type { OpenAPIService } from '../../openapi/services/openapi.service'\nimport type { IOpenAPIConfigService } from '../../openapi/types'\nimport { Command } from '../command'\n\nexport class McpServeCommand extends Command {\n static command = 'mcp:serve {--url= : Base URL for external dispatch} {--header=* : Headers (Key:Value)} {--tag=* : Only expose routes with these OpenAPI tags} {--path= : Only expose routes matching this path prefix}'\n static description = 'Start an MCP stdio server exposing API routes as tools'\n\n constructor(\n @inject(DI_TOKENS.Application) private app: Application,\n @inject(OPENAPI_TOKENS.OpenAPIService) private openAPIService: OpenAPIService,\n ) {\n super()\n }\n\n async handle(): Promise<number | undefined> {\n const { McpServer } = await import('@modelcontextprotocol/sdk/server/mcp.js')\n const { StdioServerTransport } = await import('@modelcontextprotocol/sdk/server/stdio.js')\n\n const baseUrl = this.string('url')\n const headerArgs = this.array('header')\n const tags = this.array('tag')\n const pathPrefix = this.string('path')\n\n const headers: Record<string, string> = {}\n for (const h of headerArgs) {\n const colonIdx = h.indexOf(':')\n if (colonIdx > 0) {\n headers[h.slice(0, colonIdx).trim()] = h.slice(colonIdx + 1).trim()\n }\n }\n\n const spec = this.openAPIService.getSpec(this.app.hono, this.app.container)\n\n const dispatcher: Dispatcher = baseUrl\n ? async (method, url, opts) => {\n const fullUrl = `${baseUrl}${url}`\n try {\n return await fetch(fullUrl, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n ...opts?.headers,\n },\n body: opts?.body !== undefined ? JSON.stringify(opts.body) : undefined,\n })\n } catch (error) {\n throw new Error(`MCP dispatch failed: ${method} ${fullUrl} — ${error instanceof Error ? error.message : String(error)}`, { cause: error })\n }\n }\n : async (method, url, opts) => {\n const request = new Request(`http://localhost${url}`, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n ...headers,\n ...opts?.headers,\n },\n body: opts?.body !== undefined ? JSON.stringify(opts.body) : undefined,\n })\n try {\n return await this.app.hono.fetch(request, this.app.env)\n } catch (error) {\n throw new Error(`MCP dispatch failed: ${method} ${url} — ${error instanceof Error ? error.message : String(error)}`, { cause: error })\n }\n }\n\n const service = new OpenApiToolsService(spec, { dispatcher })\n const filter = {\n tags: tags.length > 0 ? tags : undefined,\n pathPrefix: pathPrefix || undefined,\n }\n const tools = service.getTools(filter)\n\n const configService = this.app.container.resolve<IOpenAPIConfigService>(OPENAPI_TOKENS.ConfigService)\n const config = configService.getEffectiveConfig()\n\n const server = new McpServer({\n name: config.info.title,\n version: config.info.version,\n })\n\n // Register each tool\n for (const tool of tools) {\n const inputSchema = z.fromJSONSchema(tool.inputSchema)\n server.registerTool(tool.name, { description: tool.description, inputSchema }, async (args) => {\n const result = await service.executeTool(tool.name, args as Record<string, unknown>)\n return {\n content: [{ type: 'text' as const, text: `Status: ${result.status}\\n\\n${result.body}` }],\n }\n })\n }\n\n // Expose OpenAPI spec as a resource\n server.registerResource(\n 'openapi-spec',\n 'openapi://spec',\n { description: 'Full OpenAPI specification', mimeType: 'application/json' },\n () => ({\n contents: [{\n uri: 'openapi://spec',\n mimeType: 'application/json',\n text: JSON.stringify(spec, null, 2),\n }],\n }),\n )\n\n const transport = new StdioServerTransport()\n const closed = new Promise<void>((resolve) => { transport.onclose = resolve })\n await server.connect(transport)\n\n // Write info to stderr (stdout is reserved for MCP JSON-RPC)\n process.stderr.write(`MCP server started with ${tools.length} tool(s)\\n`)\n\n // Keep process alive until client disconnects\n await closed\n\n return 0\n }\n}\n","import { inject } from 'tsyringe'\nimport type { Application } from '../../application'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { OPENAPI_TOKENS } from '../../openapi/openapi.tokens'\nimport type { OpenAPIService } from '../../openapi/services/openapi.service'\nimport { OpenApiToolsService } from '../../openapi/services/openapi-tools.service'\nimport { Command } from '../command'\n\nexport class McpToolsCommand extends Command {\n static command = 'mcp:tools {--tag=* : Filter by OpenAPI tags} {--path= : Filter by path prefix}'\n static description = 'List API routes that would be exposed as MCP tools'\n\n constructor(\n @inject(DI_TOKENS.Application) private app: Application,\n @inject(OPENAPI_TOKENS.OpenAPIService) private openAPIService: OpenAPIService,\n ) {\n super()\n }\n\n handle(): number | undefined {\n const tags = this.array('tag')\n const pathPrefix = this.string('path')\n\n const spec = this.openAPIService.getSpec(this.app.hono, this.app.container)\n\n const service = new OpenApiToolsService(spec)\n const filter = {\n tags: tags.length > 0 ? tags : undefined,\n pathPrefix: pathPrefix || undefined,\n }\n const tools = service.getTools(filter)\n\n if (tools.length === 0) {\n this.info('No tools found')\n return 0\n }\n\n this.table(\n ['Name', 'Method', 'Path', 'Description'],\n tools.map((t) => [t.name, t.method, t.path, t.description]),\n )\n\n return 0\n }\n}\n","import { inject } from 'tsyringe'\nimport { DI_TOKENS } from '../../di/tokens'\nimport type { ConsumerRegistry } from '../../queue/consumer-registry'\nimport { Command } from '../command'\n\nexport class QueueListCommand extends Command {\n static command = 'queue:list'\n static description = 'List all registered queue consumers'\n\n constructor(@inject(DI_TOKENS.ConsumerRegistry) private consumers: ConsumerRegistry) {\n super()\n }\n\n handle(): number | undefined {\n const consumers = this.consumers.getAllConsumers()\n\n if (consumers.length === 0) {\n this.info('No queue consumers found')\n return 0\n }\n\n this.table(\n ['Consumer', 'Message Types'],\n consumers.map(c => [c.constructor.name, c.messageTypes.join(', ')]),\n )\n\n return undefined\n }\n}\n","import { inject } from 'tsyringe'\nimport type { RouteRegistry, RegisteredRoute } from '../../router/route-registry'\nimport { ROUTER_TOKENS } from '../../router/router.tokens'\nimport { Command } from '../command'\n\n/**\n * List all registered routes from RouteRegistry.\n *\n * By default, hidden routes (hideFromDocs) are excluded.\n * Use `--hidden` to include them.\n *\n * @example\n * ```bash\n * quarry route:list\n * quarry route:list --method=GET\n * quarry route:list --path=/users\n * quarry route:list --name=users\n * quarry route:list --hidden\n * ```\n */\nexport class RouteListCommand extends Command {\n static command = 'route:list {--method= : Filter by HTTP method} {--path= : Filter by path substring} {--name= : Filter by route name} {--hidden : Include hidden routes}'\n static description = 'List all registered routes'\n\n constructor(@inject(ROUTER_TOKENS.RouteRegistry) private registry: RouteRegistry) {\n super()\n }\n\n handle(): number | undefined {\n const methodFilter = this.string('method').toUpperCase()\n const pathFilter = this.string('path')\n const nameFilter = this.string('name')\n const showHidden = this.boolean('hidden')\n\n let routes = this.registry.all()\n\n // Filter hidden routes (default: exclude)\n if (!showHidden) {\n routes = routes.filter(r => !r.hidden)\n }\n\n if (methodFilter) {\n routes = routes.filter(r => r.method.toUpperCase() === methodFilter)\n }\n\n if (pathFilter) {\n routes = routes.filter(r => r.path.includes(pathFilter))\n }\n\n if (nameFilter) {\n routes = routes.filter(r => r.name?.includes(nameFilter))\n }\n\n if (routes.length === 0) {\n this.info('No routes found')\n return 0\n }\n\n this.table(\n ['Method', 'Path', 'Name', 'Handler', 'Domain'],\n routes.map(r => this.formatRow(r)),\n )\n\n return undefined\n }\n\n private formatRow(route: RegisteredRoute): string[] {\n return [\n route.method.toUpperCase(),\n route.path,\n route.name ?? '-',\n `${route.controller}.${route.action}`,\n route.domain ?? '-',\n ]\n }\n}\n","import { inject } from 'tsyringe'\nimport { DI_TOKENS } from '../../di/tokens'\nimport type { CronManager } from '../../cron/cron-manager'\nimport { Command } from '../command'\n\nexport class ScheduleListCommand extends Command {\n static command = 'schedule:list'\n static description = 'List all registered cron jobs'\n\n constructor(@inject(DI_TOKENS.Cron) private cron: CronManager) {\n super()\n }\n\n handle(): number | undefined {\n const schedules = this.cron.getAllSchedules()\n\n if (schedules.length === 0) {\n this.info('No cron jobs found')\n return 0\n }\n\n const rows: string[][] = []\n\n for (const schedule of schedules) {\n const jobs = this.cron.getJobsForSchedule(schedule)\n for (const job of jobs) {\n rows.push([schedule, job.constructor.name])\n }\n }\n\n this.table(['Schedule', 'Job'], rows)\n\n return undefined\n }\n}\n","import type { Command } from './command'\nimport { COMMAND_INTERNALS } from './constants'\nimport type { CommandInput, CommandInternals, CommandResult } from './types'\n\n/** @internal Set the flat input values before calling handle() */\nexport function setCommandInputs(command: Command, values: CommandInput): void {\n command[COMMAND_INTERNALS].inputs = { ...values }\n}\n\n/** @internal Set the Quarry reference for this.call() support */\nexport function setCommandQuarry(\n command: Command,\n quarry: { call(name: string, input?: CommandInput): Promise<CommandResult> },\n): void {\n command[COMMAND_INTERNALS].quarry = quarry\n}\n\n/** @internal Collect the result after handle() completes */\nexport function getCommandResult(command: Command): CommandResult {\n const internals: CommandInternals = command[COMMAND_INTERNALS]\n return {\n exitCode: internals.exitCode,\n output: [...internals.output],\n errors: [...internals.errors],\n }\n}\n\n/** @internal Reset state between invocations */\nexport function resetCommandState(command: Command): void {\n const internals: CommandInternals = command[COMMAND_INTERNALS]\n internals.inputs = {}\n internals.output = []\n internals.errors = []\n internals.exitCode = 0\n}\n","import { CommandError } from './errors/command.error'\nimport type { ParsedArgument, ParsedOption, ParsedSignature } from './types'\n\n/**\n * Parse a Laravel-style command signature string.\n *\n * Signature syntax:\n * command-name {arg} ... — flat command\n * group subcommand {arg} ... — subcommand hierarchy (space-separated)\n * namespace:command {arg} ... — namespaced flat command (colon-separated)\n * {--flag} {--name=} {--name=default} {--name=*} {--A|name} {--name= : desc}\n *\n * Pure function, zero dependencies, edge-compatible.\n */\nexport function parseSignature(signature: string): ParsedSignature {\n const tokens = extractTokens(signature)\n const name = extractCommandName(signature)\n const args: ParsedArgument[] = []\n const options: ParsedOption[] = []\n\n for (const token of tokens) {\n const inner = token.slice(1, -1).trim() // strip { }\n\n if (inner.startsWith('--')) {\n options.push(parseOption(inner))\n } else {\n args.push(parseArgument(inner))\n }\n }\n\n return { name, arguments: args, options }\n}\n\nfunction extractCommandName(signature: string): string {\n const match = /^[\\w:.-]+(?:\\s+[\\w:.-]+)*/.exec(signature)\n if (!match) {\n throw new CommandError(`Invalid signature: cannot extract command name from \"${signature}\"`)\n }\n return match[0]\n}\n\nfunction extractTokens(signature: string): string[] {\n const tokens: string[] = []\n const regex = /\\{[^}]+\\}/g\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(signature)) !== null) {\n tokens.push(match[0])\n }\n\n return tokens\n}\n\nfunction parseArgument(inner: string): ParsedArgument {\n const { value, description } = splitDescription(inner)\n\n // {name*} — array/variadic argument\n if (value.endsWith('*')) {\n return {\n name: value.slice(0, -1).trim(),\n required: true,\n isArray: true,\n description,\n }\n }\n\n // {name=default} — argument with default value\n const eqIdx = value.indexOf('=')\n if (eqIdx !== -1) {\n return {\n name: value.slice(0, eqIdx).trim(),\n required: false,\n default: value.slice(eqIdx + 1).trim(),\n isArray: false,\n description,\n }\n }\n\n // {name?} — optional argument\n if (value.endsWith('?')) {\n return {\n name: value.slice(0, -1).trim(),\n required: false,\n isArray: false,\n description,\n }\n }\n\n // {name} — required argument\n return {\n name: value.trim(),\n required: true,\n isArray: false,\n description,\n }\n}\n\nfunction parseOption(inner: string): ParsedOption {\n // Remove leading --\n const withoutDashes = inner.slice(2)\n const { value, description } = splitDescription(withoutDashes)\n\n // Check for alias: {--A|name...}\n let alias: string | undefined\n let optBody = value\n\n const pipeIdx = optBody.indexOf('|')\n if (pipeIdx !== -1) {\n alias = optBody.slice(0, pipeIdx).trim()\n optBody = optBody.slice(pipeIdx + 1).trim()\n }\n\n // {--name=*} — array option\n if (optBody.endsWith('=*')) {\n return {\n name: optBody.slice(0, -2).trim(),\n alias,\n isFlag: false,\n isArray: true,\n description,\n }\n }\n\n // {--name=default} — option with default value\n const eqIdx = optBody.indexOf('=')\n if (eqIdx !== -1) {\n const name = optBody.slice(0, eqIdx).trim()\n const defaultValue = optBody.slice(eqIdx + 1).trim()\n\n return {\n name,\n alias,\n isFlag: false,\n isArray: false,\n default: defaultValue || undefined,\n description,\n }\n }\n\n // {--flag} — boolean flag\n return {\n name: optBody.trim(),\n alias,\n isFlag: true,\n isArray: false,\n description,\n }\n}\n\nfunction splitDescription(value: string): { value: string; description?: string } {\n const colonIdx = value.indexOf(' : ')\n if (colonIdx === -1) {\n return { value }\n }\n\n return {\n value: value.slice(0, colonIdx).trim(),\n description: value.slice(colonIdx + 3).trim(),\n }\n}\n","import { inject } from 'tsyringe'\nimport type { Container } from '../di/container'\nimport { Transient } from '../di/decorators'\nimport { DI_TOKENS } from '../di/tokens'\nimport { createCliExceptionContext } from '../errors/exception-context'\nimport type { ExceptionHandler } from '../errors/exception-handler'\nimport type { Constructor } from '../types'\nimport { type Command } from './command'\nimport { getCommandResult, setCommandInputs, setCommandQuarry } from './command-internals'\nimport { CommandNotFoundError } from './errors/command-not-found.error'\nimport { CommandError } from './errors/command.error'\nimport { parseSignature } from './signature-parser'\nimport type { CommandInput, CommandResult, ParsedSignature, Quarry } from './types'\n\n/**\n * QuarryRegistry — edge-compatible programmatic API for running commands.\n *\n * Registered as a singleton via DI_TOKENS.Quarry.\n * Commands are auto-discovered from module providers and registered at bootstrap.\n * Command constructors are stored at bootstrap; fresh instances are resolved per `call()`.\n *\n * Users should inject and type as `Quarry` (the interface), which only exposes `call()`.\n */\n@Transient(DI_TOKENS.Quarry)\nexport class QuarryRegistry implements Quarry {\n private commands = new Map<string, Constructor<Command>>()\n private signatures = new Map<string, ParsedSignature>()\n private aliases = new Map<string, string>()\n\n constructor(@inject(DI_TOKENS.Container) private readonly container: Container) { }\n\n /**\n * Execute a command by name with optional flat input.\n * A fresh command instance is resolved from the container per invocation.\n */\n async call(name: string, input?: CommandInput): Promise<CommandResult> {\n const resolvedName = this.resolveName(name)\n const CommandClass = this.commands.get(resolvedName)\n\n if (!CommandClass) {\n throw new CommandNotFoundError(name)\n }\n\n const signature = this.signatures.get(resolvedName)!\n const mergedInput = this.applyDefaults(input ?? {}, signature)\n\n // Validate required arguments\n for (const arg of signature.arguments) {\n if (arg.required && (mergedInput[arg.name] === undefined || mergedInput[arg.name] === null)) {\n throw new CommandError(`Missing required argument: ${arg.name}`)\n }\n }\n\n let command: Command | undefined\n\n try {\n // Resolve a fresh instance per invocation to avoid shared mutable state\n command = this.container.resolve<Command>(CommandClass)\n\n setCommandQuarry(command, this)\n setCommandInputs(command, mergedInput)\n\n const exitCode = await command.handle()\n const result = getCommandResult(command)\n\n if (typeof exitCode === 'number') {\n return { ...result, exitCode }\n }\n\n return result\n } catch (error) {\n if (error instanceof CommandError) {\n if (command) {\n const result = getCommandResult(command)\n return {\n exitCode: result.exitCode === 0 ? 1 : result.exitCode,\n output: result.output,\n errors: [...result.errors, error.message],\n }\n }\n return { exitCode: 1, output: [], errors: [error.message] }\n }\n\n const errorMessage = this.handleError(error, resolvedName)\n\n if (command) {\n const result = getCommandResult(command)\n return {\n exitCode: result.exitCode === 0 ? 1 : result.exitCode,\n output: result.output,\n errors: [...result.errors, errorMessage],\n }\n }\n return { exitCode: 1, output: [], errors: [errorMessage] }\n }\n }\n\n /**\n * Check if a command exists by name or alias.\n */\n has(name: string): boolean {\n const resolved = this.resolveName(name)\n return this.commands.has(resolved)\n }\n\n /**\n * Get a command constructor by name or alias.\n */\n get(name: string): Constructor<Command> | undefined {\n const resolved = this.resolveName(name)\n return this.commands.get(resolved)\n }\n\n /**\n * Get all registered command constructors.\n */\n all(): Map<string, Constructor<Command>> {\n return new Map(this.commands)\n }\n\n /**\n * List all commands with their descriptions and aliases.\n */\n list(): { name: string; description?: string; aliases: string[] }[] {\n const result: { name: string; description?: string; aliases: string[] }[] = []\n\n for (const [name, CommandClass] of this.commands) {\n const staticCommand = CommandClass as unknown as typeof Command\n const commandAliases: string[] = []\n\n for (const [alias, target] of this.aliases) {\n if (target === name) {\n commandAliases.push(alias)\n }\n }\n\n result.push({\n name,\n description: staticCommand.description,\n aliases: commandAliases,\n })\n }\n\n return result.sort((a, b) => a.name.localeCompare(b.name))\n }\n\n /**\n * Generate a compact listing of all commands with visual hierarchy and colors.\n */\n async listUsage(options?: { binaryName?: string; binaryLabel?: string; binaryVersion?: string }): Promise<string> {\n const commands = this.list()\n\n // Dynamic import to keep usage-generator tree-shakeable\n const { generateListing } = await import('./usage-generator')\n return generateListing(commands, this.signatures, options)\n }\n\n /**\n * Get auto-generated usage text for a command.\n */\n async usage(name: string): Promise<string> {\n const resolvedName = this.resolveName(name)\n const CommandClass = this.commands.get(resolvedName)\n\n if (!CommandClass) {\n throw new CommandNotFoundError(name)\n }\n\n const signature = this.signatures.get(resolvedName)!\n const staticCommand = CommandClass as unknown as typeof Command\n\n // Dynamic import to keep usage-generator tree-shakeable\n const { generateUsage } = await import('./usage-generator')\n return generateUsage(signature, staticCommand.description)\n }\n\n /**\n * Register a command constructor with the registry.\n * @internal Called by Application during bootstrap.\n */\n register(commandClass: Constructor<Command>): void {\n const staticCommand = commandClass as unknown as typeof Command\n\n if (!staticCommand.command) {\n throw new CommandError(`Command class ${commandClass.name} is missing static \"command\" signature`)\n }\n\n const signature = parseSignature(staticCommand.command)\n const name = signature.name\n\n if (this.commands.has(name) || this.aliases.has(name)) {\n throw new CommandError(`Duplicate command name: \"${name}\" is already registered`)\n }\n\n // Validate all aliases before any mutation\n if (staticCommand.aliases) {\n for (const alias of staticCommand.aliases) {\n if (this.commands.has(alias) || this.aliases.has(alias)) {\n throw new CommandError(`Duplicate alias: \"${alias}\" conflicts with an existing command or alias`)\n }\n }\n }\n\n // All checks passed — safe to mutate\n this.commands.set(name, commandClass)\n this.signatures.set(name, signature)\n\n if (staticCommand.aliases) {\n for (const alias of staticCommand.aliases) {\n this.aliases.set(alias, name)\n }\n }\n }\n\n private handleError(error: unknown, commandName: string): string {\n const handler = this.container.resolve<ExceptionHandler>(DI_TOKENS.ExceptionHandler)\n const ctx = createCliExceptionContext(commandName)\n // Fire-and-forget — reporting happens via waitUntil internally\n void handler.handle(error, ctx)\n return error instanceof Error ? error.message : String(error)\n }\n\n private resolveName(name: string): string {\n return this.aliases.get(name) ?? name\n }\n\n private applyDefaults(input: CommandInput, signature: ParsedSignature): CommandInput {\n const result = { ...input }\n\n // Apply argument defaults\n for (const arg of signature.arguments) {\n if (result[arg.name] === undefined && arg.default !== undefined) {\n result[arg.name] = arg.default\n }\n }\n\n // Apply option defaults\n for (const opt of signature.options) {\n if (result[opt.name] === undefined) {\n if (opt.default !== undefined) {\n result[opt.name] = opt.default\n } else if (opt.isFlag) {\n result[opt.name] = false\n }\n }\n }\n\n return result\n }\n}\n"],"mappings":";;;;;;;;;AAMO,IAAA,aAAA,MAAM,mBAAmB,QAAQ;CACtC,OAAO,UAAU;CACjB,OAAO,cAAc;CACrB,OAAO,UAAU,CAAC,WAAW;CAE7B,YAAY,KAAyD;AACnE,SAAO;AAD0C,OAAA,MAAA;;CAInD,MAAM,SAAsC;EAC1C,MAAM,QAAQ,KAAK,OAAO,QAAQ;AAElC,MAAI,CAAC,MACH,SAAQ,MAAM,KAAK,KAAK,aAAa,EAAE;AAGzC,SAAO,KAAK,UAAU,MAAM;;CAG9B,MAAc,UAAU,OAAgC;EACtD,MAAM,UAAU,KAAK,OAAO,SAAS,IAAI,OAAO,aAAa;EAC7D,MAAM,OAAO,KAAK,OAAO,OAAO;EAChC,MAAM,aAAa,KAAK,MAAM,SAAS;EACvC,MAAM,YAAY,KAAK,MAAM,QAAQ;EAErC,MAAM,UAAkC,EAAE;AAC1C,MAAI,KACF,SAAQ,kBAAkB;AAE5B,OAAK,MAAM,KAAK,Y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AI;AAK3B,OAAK,MAAM,OAAO,UAAU,QAC1B,KAAI,OAAO,IAAI,UAAU,KAAA;OACnB,IAAI,YAAY,KAAA,EAClB,QAAO,IAAI,QAAQ,IAAI;YACd,IAAI,OACb,QAAO,IAAI,QAAQ;;AAKzB,SAAO;;;;CAhOV,UAAU,UAAU,OAAO;oBAMb,OAAO,UAAU,UAAU,CAAA"}
@@ -1,2 +1,3 @@
1
- import { _ as QueueNames, a as InjectQueue, b as IQueueConsumer, c as QueueModule, d as SyncQueueProvider, f as CloudflareQueueProvider, g as QueueName, h as IQueueSender, i as QueueToken, l as QueueModuleOptions, m as DispatchMessage, n as QueueBindingNotFoundError, o as QueueRegistry, p as IQueueProvider, r as QUEUE_TOKENS, s as QueueProviderFactory, t as QueueProviderNotSupportedError, u as QueueSender, v as QueueManager, x as QueueMessage, y as ConsumerRegistry } from "../index-D9iYu2Yc.mjs";
1
+ import { n as IQueueConsumer, r as QueueMessage, t as ConsumerRegistry } from "../consumer-registry-BkuHXR_u.mjs";
2
+ import { _ as QueueNames, a as InjectQueue, c as QueueModule, d as SyncQueueProvider, f as CloudflareQueueProvider, g as QueueName, h as IQueueSender, i as QueueToken, l as QueueModuleOptions, m as DispatchMessage, n as QueueBindingNotFoundError, o as QueueRegistry, p as IQueueProvider, r as QUEUE_TOKENS, s as QueueProviderFactory, t as QueueProviderNotSupportedError, u as QueueSender, v as QueueManager } from "../index-DPxmo6AY.mjs";
2
3
  export { CloudflareQueueProvider, ConsumerRegistry, DispatchMessage, IQueueConsumer, IQueueProvider, IQueueSender, InjectQueue, QUEUE_TOKENS, QueueBindingNotFoundError, QueueManager, QueueMessage, QueueModule, QueueModuleOptions, QueueName, QueueNames, QueueProviderFactory, QueueProviderNotSupportedError, QueueRegistry, QueueSender, QueueToken, SyncQueueProvider };
@@ -1,18 +1,7 @@
1
- import "../errors-CtCi1wn6.mjs";
2
- import { i as Transient, l as DI_TOKENS, n as __decorateParam, r as __decorateMetadata, t as __decorate } from "../decorate-D5j-d9_z.mjs";
3
- import "../logger-BR1-s1Um.mjs";
4
- import "../module-BgdxxzBe.mjs";
5
- import "../events-CXl-o1Ad.mjs";
6
- import "../colors-DJaRDXoS.mjs";
7
- import "../command-BvCOD6df.mjs";
8
- import "../is-command-BfCgWAcQ.mjs";
9
- import "../is-seeder-CebjZCDn.mjs";
10
- import "../middleware-C0Ebzswy.mjs";
11
- import "../router-context-BEJe9HEB.mjs";
12
- import { a as CloudflareQueueProvider, c as QUEUE_TOKENS, i as SyncQueueProvider, l as QueueSender, n as QueueRegistry, o as QueueProviderNotSupportedError, r as QueueProviderFactory, s as QueueBindingNotFoundError, t as QueueModule, u as ConsumerRegistry } from "../queue.module-BZvmeAMj.mjs";
1
+ import { a as __decorate, f as DI_TOKENS, o as __decorateParam, p as Transient, s as __decorateMetadata } from "../logger-c0ftIK4G.mjs";
2
+ import { a as QueueProviderNotSupportedError, c as QUEUE_TOKENS, i as CloudflareQueueProvider, l as QueueSender, n as QueueProviderFactory, o as QueueBindingNotFoundError, r as SyncQueueProvider, s as QueueRegistry, t as QueueModule, u as ConsumerRegistry } from "../queue.module-DIjD6nr-.mjs";
13
3
  import { inject } from "tsyringe";
14
4
  //#region src/queue/queue-manager.ts
15
- var _ref;
16
5
  let QueueManager = class QueueManager {
17
6
  constructor(registry) {
18
7
  this.registry = registry;
@@ -44,7 +33,7 @@ let QueueManager = class QueueManager {
44
33
  QueueManager = __decorate([
45
34
  Transient(DI_TOKENS.Queue),
46
35
  __decorateParam(0, inject(DI_TOKENS.ConsumerRegistry)),
47
- __decorateMetadata("design:paramtypes", [typeof (_ref = typeof ConsumerRegistry !== "undefined" && ConsumerRegistry) === "function" ? _ref : Object])
36
+ __decorateMetadata("design:paramtypes", [Object])
48
37
  ], QueueManager);
49
38
  //#endregion
50
39
  //#region src/queue/decorators/inject-queue.decorator.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/queue/queue-manager.ts","../../src/queue/decorators/inject-queue.decorator.ts"],"sourcesContent":["import { inject } from 'tsyringe'\nimport { Transient } from '../di/decorators'\nimport { DI_TOKENS } from '../di/tokens'\nimport { ConsumerRegistry } from './consumer-registry'\nimport type { QueueMessage } from './queue-consumer'\n\n/**\n * Queue Manager\n *\n * Singleton service for processing queue message batches.\n * Routes messages to consumers based on message type.\n *\n * **Message Routing:**\n * - Consumers declare message types they handle (e.g., ['email.send'])\n * - When a message arrives, consumers matching the message type are invoked\n * - A consumer can handle messages from ANY queue (routing is by type, not queue)\n *\n * **Note:** For sending messages to queues, use IQueueSender instances\n * obtained via @InjectQueue('queue-name') or module bindings.\n *\n * @example Processing a queue batch\n * ```typescript\n * // In Cloudflare Worker queue handler\n * await queueManager.processBatch('notifications-queue', batch)\n * ```\n */\n@Transient(DI_TOKENS.Queue)\nexport class QueueManager {\n constructor(\n @inject(DI_TOKENS.ConsumerRegistry) private readonly registry: ConsumerRegistry\n ) {}\n\n /**\n * Process a batch of queue messages\n *\n * Routes messages to registered consumers based on message type.\n * Uses ConsumerRegistry to find matching consumers.\n *\n * @param _queueName - Name of the queue (for logging, not used for routing)\n * @param batch - Batch of messages from Cloudflare Queue\n */\n async processBatch(_queueName: string, batch: MessageBatch): Promise<void> {\n for (const message of batch.messages) {\n const queueMessage = message.body as QueueMessage\n\n // Find consumers by message type (not by queue name)\n const consumers = this.registry.getConsumers(queueMessage.type)\n\n for (const consumer of consumers) {\n try {\n await consumer.handle(queueMessage)\n message.ack()\n } catch (error) {\n const errorInstance = error instanceof Error\n ? error\n : new Error(String(error))\n\n if (consumer.onError) {\n await consumer.onError(errorInstance, queueMessage)\n }\n message.retry()\n }\n }\n }\n }\n}\n","import { inject } from 'tsyringe'\nimport type { QueueName } from '../queue-name'\n\n/**\n * Inject a queue sender by name.\n *\n * Queue names are typed via module augmentation of QueueNames interface.\n * The queue name serves as both the identifier and the DI injection token.\n *\n * @param name - Queue name (typed with autocomplete if QueueNames is augmented)\n * @returns Parameter decorator for constructor injection\n *\n * @example\n * ```typescript\n * // Direct injection by queue name\n * constructor(\n * @InjectQueue('notifications-queue') private queue: IQueueSender\n * ) {}\n *\n * // Usage\n * await this.queue.dispatch({\n * type: 'email.send',\n * payload: { to: 'user@example.com', subject: 'Hello' }\n * })\n * ```\n *\n * @remarks\n * The queue must be registered via `QueueModule.registerQueue(name)` before injection.\n * For module-internal queue bindings (e.g., EmailModule), use `@inject(TOKEN)` with\n * `useExisting` provider binding instead.\n */\nexport function InjectQueue(name: QueueName): ParameterDecorator {\n return inject(name)\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2BO,IAAA,eAAA,MAAM,aAAa;CACxB,YACE,UACA;AADqD,OAAA,WAAA;;;;;;;;;;;CAYvD,MAAM,aAAa,YAAoB,OAAoC;AACzE,OAAK,MAAM,WAAW,MAAM,UAAU;GACpC,MAAM,eAAe,QAAQ;GAG7B,MAAM,YAAY,KAAK,SAAS,aAAa,aAAa,KAAK;AAE/D,QAAK,MAAM,YAAY,UACrB,KAAI;AACF,UAAM,SAAS,OAAO,aAAa;AACnC,YAAQ,KAAK;YACN,OAAO;IACd,MAAM,gBAAgB,iBAAiB,QACnC,QACA,IAAI,MAAM,OAAO,MAAM,CAAC;AAE5B,QAAI,SAAS,QACX,OAAM,SAAS,QAAQ,eAAe,aAAa;AAErD,YAAQ,OAAO;;;;;;CAlCxB,UAAU,UAAU,MAAM;oBAGtB,OAAO,UAAU,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEvC,SAAgB,YAAY,MAAqC;AAC/D,QAAO,OAAO,KAAK"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/queue/queue-manager.ts","../../src/queue/decorators/inject-queue.decorator.ts"],"sourcesContent":["import { inject } from 'tsyringe'\nimport { Transient } from '../di/decorators'\nimport { DI_TOKENS } from '../di/tokens'\nimport { type ConsumerRegistry } from './consumer-registry'\nimport type { QueueMessage } from './queue-consumer'\n\n/**\n * Queue Manager\n *\n * Singleton service for processing queue message batches.\n * Routes messages to consumers based on message type.\n *\n * **Message Routing:**\n * - Consumers declare message types they handle (e.g., ['email.send'])\n * - When a message arrives, consumers matching the message type are invoked\n * - A consumer can handle messages from ANY queue (routing is by type, not queue)\n *\n * **Note:** For sending messages to queues, use IQueueSender instances\n * obtained via @InjectQueue('queue-name') or module bindings.\n *\n * @example Processing a queue batch\n * ```typescript\n * // In Cloudflare Worker queue handler\n * await queueManager.processBatch('notifications-queue', batch)\n * ```\n */\n@Transient(DI_TOKENS.Queue)\nexport class QueueManager {\n constructor(\n @inject(DI_TOKENS.ConsumerRegistry) private readonly registry: ConsumerRegistry\n ) {}\n\n /**\n * Process a batch of queue messages\n *\n * Routes messages to registered consumers based on message type.\n * Uses ConsumerRegistry to find matching consumers.\n *\n * @param _queueName - Name of the queue (for logging, not used for routing)\n * @param batch - Batch of messages from Cloudflare Queue\n */\n async processBatch(_queueName: string, batch: MessageBatch): Promise<void> {\n for (const message of batch.messages) {\n const queueMessage = message.body as QueueMessage\n\n // Find consumers by message type (not by queue name)\n const consumers = this.registry.getConsumers(queueMessage.type)\n\n for (const consumer of consumers) {\n try {\n await consumer.handle(queueMessage)\n message.ack()\n } catch (error) {\n const errorInstance = error instanceof Error\n ? error\n : new Error(String(error))\n\n if (consumer.onError) {\n await consumer.onError(errorInstance, queueMessage)\n }\n message.retry()\n }\n }\n }\n }\n}\n","import { inject } from 'tsyringe'\nimport type { QueueName } from '../queue-name'\n\n/**\n * Inject a queue sender by name.\n *\n * Queue names are typed via module augmentation of QueueNames interface.\n * The queue name serves as both the identifier and the DI injection token.\n *\n * @param name - Queue name (typed with autocomplete if QueueNames is augmented)\n * @returns Parameter decorator for constructor injection\n *\n * @example\n * ```typescript\n * // Direct injection by queue name\n * constructor(\n * @InjectQueue('notifications-queue') private queue: IQueueSender\n * ) {}\n *\n * // Usage\n * await this.queue.dispatch({\n * type: 'email.send',\n * payload: { to: 'user@example.com', subject: 'Hello' }\n * })\n * ```\n *\n * @remarks\n * The queue must be registered via `QueueModule.registerQueue(name)` before injection.\n * For module-internal queue bindings (e.g., EmailModule), use `@inject(TOKEN)` with\n * `useExisting` provider binding instead.\n */\nexport function InjectQueue(name: QueueName): ParameterDecorator {\n return inject(name)\n}\n"],"mappings":";;;;AA2BO,IAAA,eAAA,MAAM,aAAa;CACxB,YACE,UACA;AADqD,OAAA,WAAA;;;;;;;;;;;CAYvD,MAAM,aAAa,YAAoB,OAAoC;AACzE,OAAK,MAAM,WAAW,MAAM,UAAU;GACpC,MAAM,eAAe,QAAQ;GAG7B,MAAM,YAAY,KAAK,SAAS,aAAa,aAAa,KAAK;AAE/D,QAAK,MAAM,YAAY,UACrB,KAAI;AACF,UAAM,SAAS,OAAO,aAAa;AACnC,YAAQ,KAAK;YACN,OAAO;IACd,MAAM,gBAAgB,iBAAiB,QACnC,QACA,IAAI,MAAM,OAAO,MAAM,CAAC;AAE5B,QAAI,SAAS,QACX,OAAM,SAAS,QAAQ,eAAe,aAAa;AAErD,YAAQ,OAAO;;;;;;CAlCxB,UAAU,UAAU,MAAM;oBAGtB,OAAO,UAAU,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEvC,SAAgB,YAAY,MAAqC;AAC/D,QAAO,OAAO,KAAK"}
@@ -1,6 +1,6 @@
1
- import { S as ApplicationError, b as ERROR_CODES, o as I18N_TOKENS, s as Scope } from "./errors-CtCi1wn6.mjs";
2
- import { i as Transient, l as DI_TOKENS, n as __decorateParam, r as __decorateMetadata, t as __decorate } from "./decorate-D5j-d9_z.mjs";
3
- import { r as Module } from "./module-BgdxxzBe.mjs";
1
+ import { A as Scope, H as ApplicationError, k as ERROR_CODES, w as I18N_TOKENS } from "./errors--RBIvDXr.mjs";
2
+ import { a as __decorate, f as DI_TOKENS, o as __decorateParam, p as Transient, s as __decorateMetadata } from "./logger-c0ftIK4G.mjs";
3
+ import { S as Module } from "./module-C3YZ-kZN.mjs";
4
4
  import { inject } from "tsyringe";
5
5
  //#region src/queue/consumer-registry.ts
6
6
  let ConsumerRegistry = class ConsumerRegistry {
@@ -125,6 +125,38 @@ const QUEUE_TOKENS = {
125
125
  QueueModuleOptions: Symbol.for("stratal:queue:options")
126
126
  };
127
127
  //#endregion
128
+ //#region src/queue/queue-registry.ts
129
+ let QueueRegistry = class QueueRegistry {
130
+ provider;
131
+ senders = /* @__PURE__ */ new Map();
132
+ constructor(providerFactory, i18n) {
133
+ this.i18n = i18n;
134
+ this.provider = providerFactory.create();
135
+ }
136
+ /**
137
+ * Get or create a QueueSender for the specified queue name.
138
+ *
139
+ * Senders are cached per queue name within the request scope.
140
+ *
141
+ * @param queueName - The queue name to get a sender for
142
+ * @returns QueueSender bound to the specified queue
143
+ */
144
+ getQueue(queueName) {
145
+ let sender = this.senders.get(queueName);
146
+ if (!sender) {
147
+ sender = new QueueSender(queueName, this.provider, this.i18n);
148
+ this.senders.set(queueName, sender);
149
+ }
150
+ return sender;
151
+ }
152
+ };
153
+ QueueRegistry = __decorate([
154
+ Transient(QUEUE_TOKENS.QueueRegistry),
155
+ __decorateParam(0, inject(QUEUE_TOKENS.QueueProviderFactory)),
156
+ __decorateParam(1, inject(I18N_TOKENS.I18nService)),
157
+ __decorateMetadata("design:paramtypes", [Object, Object])
158
+ ], QueueRegistry);
159
+ //#endregion
128
160
  //#region src/queue/errors/queue-binding-not-found.error.ts
129
161
  /**
130
162
  * QueueBindingNotFoundError
@@ -195,7 +227,6 @@ CloudflareQueueProvider = __decorate([
195
227
  ], CloudflareQueueProvider);
196
228
  //#endregion
197
229
  //#region src/queue/providers/sync-queue.provider.ts
198
- var _ref$2;
199
230
  let SyncQueueProvider = class SyncQueueProvider {
200
231
  constructor(registry) {
201
232
  this.registry = registry;
@@ -224,11 +255,10 @@ let SyncQueueProvider = class SyncQueueProvider {
224
255
  SyncQueueProvider = __decorate([
225
256
  Transient(),
226
257
  __decorateParam(0, inject(DI_TOKENS.ConsumerRegistry)),
227
- __decorateMetadata("design:paramtypes", [typeof (_ref$2 = typeof ConsumerRegistry !== "undefined" && ConsumerRegistry) === "function" ? _ref$2 : Object])
258
+ __decorateMetadata("design:paramtypes", [Object])
228
259
  ], SyncQueueProvider);
229
260
  //#endregion
230
261
  //#region src/queue/services/queue-provider-factory.ts
231
- var _ref$1;
232
262
  let QueueProviderFactory = class QueueProviderFactory {
233
263
  constructor(env, registry, options) {
234
264
  this.env = env;
@@ -257,44 +287,11 @@ QueueProviderFactory = __decorate([
257
287
  __decorateParam(2, inject(QUEUE_TOKENS.QueueModuleOptions, { isOptional: true })),
258
288
  __decorateMetadata("design:paramtypes", [
259
289
  Object,
260
- typeof (_ref$1 = typeof ConsumerRegistry !== "undefined" && ConsumerRegistry) === "function" ? _ref$1 : Object,
290
+ Object,
261
291
  Object
262
292
  ])
263
293
  ], QueueProviderFactory);
264
294
  //#endregion
265
- //#region src/queue/queue-registry.ts
266
- var _ref;
267
- let QueueRegistry = class QueueRegistry {
268
- provider;
269
- senders = /* @__PURE__ */ new Map();
270
- constructor(providerFactory, i18n) {
271
- this.i18n = i18n;
272
- this.provider = providerFactory.create();
273
- }
274
- /**
275
- * Get or create a QueueSender for the specified queue name.
276
- *
277
- * Senders are cached per queue name within the request scope.
278
- *
279
- * @param queueName - The queue name to get a sender for
280
- * @returns QueueSender bound to the specified queue
281
- */
282
- getQueue(queueName) {
283
- let sender = this.senders.get(queueName);
284
- if (!sender) {
285
- sender = new QueueSender(queueName, this.provider, this.i18n);
286
- this.senders.set(queueName, sender);
287
- }
288
- return sender;
289
- }
290
- };
291
- QueueRegistry = __decorate([
292
- Transient(QUEUE_TOKENS.QueueRegistry),
293
- __decorateParam(0, inject(QUEUE_TOKENS.QueueProviderFactory)),
294
- __decorateParam(1, inject(I18N_TOKENS.I18nService)),
295
- __decorateMetadata("design:paramtypes", [typeof (_ref = typeof QueueProviderFactory !== "undefined" && QueueProviderFactory) === "function" ? _ref : Object, Object])
296
- ], QueueRegistry);
297
- //#endregion
298
295
  //#region src/queue/queue.module.ts
299
296
  /**
300
297
  * Queue Module
@@ -398,6 +395,6 @@ QueueModule = _QueueModule = __decorate([Module({ providers: [
398
395
  }
399
396
  ] })], QueueModule);
400
397
  //#endregion
401
- export { CloudflareQueueProvider as a, QUEUE_TOKENS as c, SyncQueueProvider as i, QueueSender as l, QueueRegistry as n, QueueProviderNotSupportedError as o, QueueProviderFactory as r, QueueBindingNotFoundError as s, QueueModule as t, ConsumerRegistry as u };
398
+ export { QueueProviderNotSupportedError as a, QUEUE_TOKENS as c, CloudflareQueueProvider as i, QueueSender as l, QueueProviderFactory as n, QueueBindingNotFoundError as o, SyncQueueProvider as r, QueueRegistry as s, QueueModule as t, ConsumerRegistry as u };
402
399
 
403
- //# sourceMappingURL=queue.module-BZvmeAMj.mjs.map
400
+ //# sourceMappingURL=queue.module-DIjD6nr-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.module-DIjD6nr-.mjs","names":[],"sources":["../src/queue/consumer-registry.ts","../src/queue/queue-sender.ts","../src/queue/queue.tokens.ts","../src/queue/queue-registry.ts","../src/queue/errors/queue-binding-not-found.error.ts","../src/queue/errors/queue-provider-not-supported.error.ts","../src/queue/providers/cloudflare-queue.provider.ts","../src/queue/providers/sync-queue.provider.ts","../src/queue/services/queue-provider-factory.ts","../src/queue/queue.module.ts"],"sourcesContent":["import { Transient } from '../di/decorators'\nimport { DI_TOKENS } from '../di/tokens'\nimport type { IQueueConsumer } from './queue-consumer'\n\n/**\n * Consumer Registry\n *\n * Singleton service that holds all registered queue consumers indexed by message type.\n * Consumers declare the message types they handle, and this registry routes messages\n * to the appropriate consumers based on their types.\n *\n * **Message-Type Routing:**\n * - Consumers declare `messageTypes` array (e.g., `['email.send', 'email.batch.send']`)\n * - When a message arrives, consumers matching the message type are invoked\n * - A consumer can handle messages from ANY queue (routing is by type, not queue)\n * - Use `'*'` as a wildcard to handle all message types\n *\n * @example Consumer registration\n * ```typescript\n * // In consumer.ts\n * @Transient()\n * export class EmailConsumer implements IQueueConsumer {\n * readonly messageTypes = ['email.send', 'email.batch.send']\n * // ...\n * }\n *\n * // In module.ts\n * @Module({\n * consumers: [EmailConsumer]\n * })\n *\n * // Application auto-registers via ConsumerRegistry\n * this.consumerRegistry.register(consumer)\n * ```\n */\n@Transient(DI_TOKENS.ConsumerRegistry)\nexport class ConsumerRegistry {\n /** Map from message type to consumers handling that type */\n private consumersByType = new Map<string, IQueueConsumer[]>()\n\n /** Set of all registered consumers (for iteration) */\n private allConsumers = new Set<IQueueConsumer>()\n\n /**\n * Register a queue consumer\n *\n * Indexes the consumer by each of its declared message types.\n *\n * @param consumer - Queue consumer to register\n */\n register(consumer: IQueueConsumer): void {\n if (this.allConsumers.has(consumer)) {\n return // Already registered\n }\n\n this.allConsumers.add(consumer)\n\n for (const messageType of consumer.messageTypes) {\n const existing = this.consumersByType.get(messageType) ?? []\n existing.push(consumer)\n this.consumersByType.set(messageType, existing)\n }\n }\n\n /**\n * Get all consumers that can handle a specific message type\n *\n * Returns consumers that either:\n * - Explicitly declare the message type\n * - Use '*' wildcard to handle all types\n *\n * @param messageType - The message type to find consumers for\n * @returns Array of consumers that can handle this message type\n */\n getConsumers(messageType: string): IQueueConsumer[] {\n const exactMatch = this.consumersByType.get(messageType) ?? []\n const wildcardMatch = this.consumersByType.get('*') ?? []\n\n // Combine and dedupe\n const combined = new Set([...exactMatch, ...wildcardMatch])\n return Array.from(combined)\n }\n\n /**\n * Check if any consumers can handle a message type\n *\n * @param messageType - The message type to check\n * @returns true if at least one consumer can handle this type\n */\n hasConsumers(messageType: string): boolean {\n return this.getConsumers(messageType).length > 0\n }\n\n /**\n * Get all registered message types\n *\n * @returns Array of message types with registered consumers\n */\n getMessageTypes(): string[] {\n return Array.from(this.consumersByType.keys())\n }\n\n /**\n * Get all registered consumers\n *\n * @returns Array of all registered consumers\n */\n getAllConsumers(): IQueueConsumer[] {\n return Array.from(this.allConsumers)\n }\n}\n","import type { II18nService } from '../i18n/i18n.types'\nimport type { IQueueProvider } from './providers'\nimport type { QueueMessage } from './queue-consumer'\nimport type { DispatchMessage, IQueueSender } from './queue-sender.interface'\n\n/**\n * Queue Sender\n *\n * Implementation of IQueueSender bound to a specific queue name.\n * Created by QueueRegistry for each registered queue.\n *\n * Automatically enriches messages with:\n * - `id`: UUID generated via crypto.randomUUID()\n * - `timestamp`: Current time in milliseconds\n * - `metadata.locale`: Current locale from I18n context\n *\n * @example\n * ```typescript\n * // Created by QueueRegistry, not directly instantiated\n * const sender = registry.getQueue('notifications-queue')\n *\n * await sender.dispatch({\n * type: 'email.send',\n * payload: { to: 'user@example.com', subject: 'Hello' }\n * })\n * ```\n */\nexport class QueueSender implements IQueueSender {\n constructor(\n private readonly queueName: string,\n private readonly provider: IQueueProvider,\n private readonly i18n: II18nService\n ) {}\n\n /**\n * Dispatch a message to this queue.\n *\n * @param message - Message to dispatch (without id/timestamp)\n */\n async dispatch<T>(message: DispatchMessage<T>): Promise<void> {\n const metadata = { ...message.metadata }\n\n if (!metadata.locale) {\n const locale = this.i18n.getLocale()\n if (locale) {\n metadata.locale = locale\n }\n }\n\n const fullMessage: QueueMessage<T> = {\n id: crypto.randomUUID(),\n timestamp: Date.now(),\n ...message,\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined\n }\n\n await this.provider.send(this.queueName, fullMessage)\n }\n}\n","export const QUEUE_TOKENS = {\n QueueProviderFactory: Symbol.for('stratal:queue:provider:factory'),\n QueueRegistry: Symbol.for('stratal:queue:registry'),\n QueueModuleOptions: Symbol.for('stratal:queue:options'),\n} as const\n\nexport type QueueToken = (typeof QUEUE_TOKENS)[keyof typeof QUEUE_TOKENS]\n","import { inject } from 'tsyringe'\nimport { Transient } from '../di/decorators'\nimport { I18N_TOKENS } from '../i18n/i18n.tokens'\nimport type { II18nService } from '../i18n/i18n.types'\nimport type { IQueueProvider } from './providers'\nimport type { IQueueSender } from './queue-sender.interface'\nimport { QueueSender } from './queue-sender'\nimport { QUEUE_TOKENS } from './queue.tokens'\nimport { type QueueProviderFactory } from './services'\n\n/**\n * Queue Registry\n *\n * Request-scoped factory service for creating QueueSender instances.\n * Caches senders per queue name within the request scope.\n *\n * This service is used internally by QueueModule.registerQueue() to provide\n * IQueueSender instances for each registered queue.\n *\n * **Why request-scoped?**\n * - Needs access to I18nService for locale-aware message metadata\n * - Provider is created once per request for consistency\n * - Queue senders are cached per request to avoid recreating them\n *\n * @example\n * ```typescript\n * // Used internally by QueueModule.registerQueue()\n * QueueModule.registerQueue('notifications-queue')\n *\n * // The module creates a factory provider:\n * {\n * provide: 'notifications-queue',\n * useFactory: (registry: QueueRegistry) => registry.getQueue('notifications-queue'),\n * inject: [QUEUE_TOKENS.QueueRegistry],\n * }\n * ```\n */\n@Transient(QUEUE_TOKENS.QueueRegistry)\nexport class QueueRegistry {\n private readonly provider: IQueueProvider\n private readonly senders = new Map<string, IQueueSender>()\n\n constructor(\n @inject(QUEUE_TOKENS.QueueProviderFactory) providerFactory: QueueProviderFactory,\n @inject(I18N_TOKENS.I18nService) private readonly i18n: II18nService\n ) {\n this.provider = providerFactory.create()\n }\n\n /**\n * Get or create a QueueSender for the specified queue name.\n *\n * Senders are cached per queue name within the request scope.\n *\n * @param queueName - The queue name to get a sender for\n * @returns QueueSender bound to the specified queue\n */\n getQueue(queueName: string): IQueueSender {\n let sender = this.senders.get(queueName)\n\n if (!sender) {\n sender = new QueueSender(queueName, this.provider, this.i18n)\n this.senders.set(queueName, sender)\n }\n\n return sender\n }\n}\n","import { ApplicationError, ERROR_CODES } from '../../errors'\n\n/**\n * QueueBindingNotFoundError\n *\n * Thrown when attempting to access a Cloudflare Queue binding that hasn't been configured.\n * This typically indicates that the queue binding is missing from wrangler.jsonc\n * or the environment variables are not properly set.\n */\nexport class QueueBindingNotFoundError extends ApplicationError {\n constructor(queueName: string, bindingName: string) {\n super(\n 'errors.queueBindingNotFound',\n ERROR_CODES.SYSTEM.QUEUE_BINDING_NOT_FOUND,\n { queueName, bindingName }\n )\n }\n}\n","import { ApplicationError, ERROR_CODES } from '../../errors'\n\n/**\n * QueueProviderNotSupportedError\n *\n * Thrown when attempting to use a queue provider that is not supported.\n * Valid providers are: 'cloudflare', 'sync'\n *\n * This typically indicates an invalid QUEUE_PROVIDER environment variable.\n */\nexport class QueueProviderNotSupportedError extends ApplicationError {\n constructor(provider: string) {\n super(\n 'errors.queueProviderNotSupported',\n ERROR_CODES.SYSTEM.QUEUE_PROVIDER_NOT_SUPPORTED,\n { provider }\n )\n }\n}\n","import { inject } from 'tsyringe'\nimport { type StratalEnv } from '../../env'\nimport { Transient } from '../../di/decorators'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { QueueBindingNotFoundError } from '../errors'\nimport type { QueueMessage } from '../queue-consumer'\nimport type { IQueueProvider } from './queue-provider.interface'\n\n/**\n * Cloudflare Queue Provider\n *\n * Sends messages to Cloudflare Queues by resolving bindings from the environment.\n * Used in production environments where Cloudflare Workers handle queue processing.\n *\n * **Binding Resolution:**\n * Queue names are converted to binding names:\n * - `notifications-queue` → `NOTIFICATIONS_QUEUE`\n *\n * @example\n * ```typescript\n * const provider = new CloudflareQueueProvider(env)\n * await provider.send('notifications-queue', message)\n * ```\n */\n@Transient()\nexport class CloudflareQueueProvider implements IQueueProvider {\n constructor(\n @inject(DI_TOKENS.CloudflareEnv) private readonly env: StratalEnv\n ) { }\n\n /**\n * Send a message to a Cloudflare Queue\n *\n * @param queueName - Queue name (e.g., 'notifications-queue')\n * @param message - Complete message with id, timestamp, and payload\n * @throws {QueueBindingNotFoundError} If queue binding is not configured\n */\n async send<T>(queueName: string, message: QueueMessage<T>): Promise<void> {\n const queue = this.getQueue(queueName)\n await queue.send(message)\n }\n\n /**\n * Resolve queue binding from Cloudflare environment\n *\n * Converts kebab-case queue name to UPPER_SNAKE_CASE binding name.\n *\n * @param queueName - Queue name (e.g., 'notifications-queue')\n * @returns Cloudflare Queue binding\n * @throws {QueueBindingNotFoundError} If binding not found in env\n */\n private getQueue(queueName: string): Queue {\n const bindingName = queueName.toUpperCase().replace(/-/g, '_')\n const queue = (this.env as unknown as Record<string, unknown>)[bindingName] as Queue | undefined\n\n if (!queue) {\n throw new QueueBindingNotFoundError(queueName, bindingName)\n }\n\n return queue\n }\n}\n","import { inject } from 'tsyringe'\nimport { Transient } from '../../di/decorators'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { type ConsumerRegistry } from '../consumer-registry'\nimport type { QueueMessage } from '../queue-consumer'\nimport type { IQueueProvider } from './queue-provider.interface'\n\n/**\n * Sync Queue Provider\n *\n * Processes messages immediately by finding matching consumers and calling\n * their handle() method directly. Used for testing and development where\n * real queue infrastructure is not available.\n *\n * **Behavior:**\n * - Messages are processed synchronously when send() is called\n * - Matching consumers are found via ConsumerRegistry by message type\n * - All matching consumers are called sequentially\n * - Errors are re-thrown after onError() is called (fail-fast for testing)\n *\n * **Consumer Matching:**\n * - Consumers are matched by message type, not queue name\n * - Wildcard ('*') matches all message types\n *\n * @example Testing with sync provider\n * ```typescript\n * const provider = new SyncQueueProvider(registry)\n * await provider.send('notifications-queue', {\n * id: '123',\n * timestamp: Date.now(),\n * type: 'email.send',\n * payload: { to: 'test@example.com' }\n * })\n * // Consumer's handle() is called immediately!\n * ```\n */\n@Transient()\nexport class SyncQueueProvider implements IQueueProvider {\n constructor(\n @inject(DI_TOKENS.ConsumerRegistry) private readonly registry: ConsumerRegistry\n ) {}\n\n /**\n * Process a message synchronously\n *\n * Finds all matching consumers by message type and calls their handle() method.\n * If any consumer throws, onError() is called and the error is re-thrown.\n *\n * @param _queueName - Queue name (not used for routing, consumers match by message type)\n * @param message - Complete message with id, timestamp, and payload\n * @throws Re-throws any error from consumer.handle() after calling onError()\n */\n async send<T>(_queueName: string, message: QueueMessage<T>): Promise<void> {\n // Consumers are matched by message type, not queue name\n const consumers = this.registry.getConsumers(message.type)\n\n // Process synchronously - call each matching consumer\n for (const consumer of consumers) {\n try {\n await consumer.handle(message)\n } catch (error) {\n const errorInstance = error instanceof Error\n ? error\n : new Error(String(error))\n\n // Call onError hook if defined\n if (consumer.onError) {\n await consumer.onError(errorInstance, message)\n }\n\n // Re-throw for fail-fast behavior in tests\n throw errorInstance\n }\n }\n }\n}\n","import { inject } from 'tsyringe'\nimport { type StratalEnv } from '../../env'\nimport { Transient } from '../../di/decorators'\nimport { DI_TOKENS } from '../../di/tokens'\nimport { type ConsumerRegistry } from '../consumer-registry'\nimport { QueueProviderNotSupportedError } from '../errors'\nimport { CloudflareQueueProvider, SyncQueueProvider, type IQueueProvider } from '../providers'\nimport type { QueueModuleOptions } from '../queue.module'\nimport { QUEUE_TOKENS } from '../queue.tokens'\n\n/**\n * Queue Provider Factory\n *\n * Creates the appropriate queue provider based on configuration provided\n * via QueueModule.forRootAsync().\n *\n * **Provider Selection:**\n * - `cloudflare`: Production provider using Cloudflare Queue bindings\n * - `sync`: Testing provider that processes messages immediately\n *\n * @example\n * ```typescript\n * // Configuration via QueueModule.forRootAsync()\n * QueueModule.forRootAsync({\n * inject: [CONFIG_TOKENS.ConfigService],\n * useFactory: (config) => ({ provider: config.get('queue').provider })\n * })\n *\n * // Factory usage (internal)\n * const factory = container.resolve(QueueProviderFactory)\n * const provider = factory.create()\n * ```\n */\n@Transient(QUEUE_TOKENS.QueueProviderFactory)\nexport class QueueProviderFactory {\n constructor(\n @inject(DI_TOKENS.CloudflareEnv) private readonly env: StratalEnv,\n @inject(DI_TOKENS.ConsumerRegistry) private readonly registry: ConsumerRegistry,\n @inject(QUEUE_TOKENS.QueueModuleOptions, { isOptional: true }) private readonly options?: QueueModuleOptions,\n ) { }\n\n /**\n * Create a queue provider based on module configuration\n *\n * @returns Queue provider instance\n * @throws {QueueProviderNotSupportedError} If provider type is not supported\n */\n create(): IQueueProvider {\n const providerType = this.options?.provider ?? 'cloudflare'\n\n switch (providerType) {\n case 'cloudflare':\n return new CloudflareQueueProvider(this.env)\n\n case 'sync':\n return new SyncQueueProvider(this.registry)\n\n default:\n throw new QueueProviderNotSupportedError(providerType)\n }\n }\n}\n","/**\n * Queue Module\n *\n * Provides declarative queue infrastructure with provider abstraction.\n *\n * **Usage:**\n * ```typescript\n * // 1. Configure provider (once, in app root)\n * QueueModule.forRootAsync({\n * inject: [CONFIG_TOKENS.ConfigService],\n * useFactory: (config) => ({ provider: config.get('queue').provider })\n * })\n *\n * // 2. Register queues (queue name IS the injection token)\n * QueueModule.registerQueue('notifications-queue')\n * QueueModule.registerQueue('batch-notifications-queue')\n *\n * // 3. Inject and use\n * constructor(@InjectQueue('notifications-queue') private queue: IQueueSender) {}\n * await this.queue.dispatch({ type: 'email.send', payload: {...} })\n * ```\n *\n * **Providers:**\n * - `cloudflare`: Production provider using Cloudflare Queue bindings\n * - `sync`: Testing provider that processes messages immediately\n */\n\nimport { DI_TOKENS } from '../di/tokens'\nimport { Scope } from '../di/types'\nimport { Module } from '../module'\nimport type { AsyncModuleOptions, DynamicModule, InjectionToken } from '../module/types'\nimport { ConsumerRegistry } from './consumer-registry'\nimport type { QueueName } from './queue-name'\nimport { QueueRegistry } from './queue-registry'\nimport type { IQueueSender } from './queue-sender.interface'\nimport { QUEUE_TOKENS } from './queue.tokens'\nimport { QueueProviderFactory } from './services'\n\n/**\n * Queue module configuration options\n */\nexport interface QueueModuleOptions {\n /**\n * Queue provider type\n * - 'cloudflare': Production provider using Cloudflare Queue bindings\n * - 'sync': Testing provider that processes messages immediately\n */\n provider: 'cloudflare' | 'sync'\n}\n\n@Module({\n providers: [\n { provide: DI_TOKENS.ConsumerRegistry, useClass: ConsumerRegistry, scope: Scope.Singleton },\n { provide: QUEUE_TOKENS.QueueProviderFactory, useClass: QueueProviderFactory, scope: Scope.Singleton },\n { provide: QUEUE_TOKENS.QueueRegistry, useClass: QueueRegistry },\n ],\n})\nexport class QueueModule {\n /**\n * Configure queue infrastructure with async factory.\n *\n * Use when provider configuration depends on other services like ConfigService.\n *\n * @param options - Async configuration with factory and inject tokens\n * @returns Dynamic module with queue infrastructure\n *\n * @example\n * ```typescript\n * QueueModule.forRootAsync({\n * inject: [CONFIG_TOKENS.ConfigService],\n * useFactory: (config: IConfigService) => ({\n * provider: config.get('queue').provider\n * })\n * })\n * ```\n */\n static forRootAsync(options: AsyncModuleOptions<QueueModuleOptions>): DynamicModule {\n return {\n module: QueueModule,\n providers: [\n {\n provide: QUEUE_TOKENS.QueueModuleOptions,\n useFactory: options.useFactory,\n inject: options.inject,\n },\n ],\n }\n }\n\n /**\n * Register a queue for injection.\n *\n * The queue name serves as both the identifier and the DI injection token.\n * Queue names are typed via module augmentation of QueueNames interface.\n *\n * @param name - Queue name (typed with autocomplete if QueueNames is augmented)\n * @returns Dynamic module that provides the queue sender\n *\n * @example\n * ```typescript\n * // In AppModule imports\n * QueueModule.registerQueue('notifications-queue')\n *\n * // Then inject using the queue name\n * constructor(@InjectQueue('notifications-queue') private queue: IQueueSender) {}\n * ```\n */\n static registerQueue(name: QueueName): DynamicModule {\n return {\n module: QueueModule,\n providers: [\n {\n provide: name as InjectionToken<IQueueSender>,\n useFactory: (registry: QueueRegistry) => registry.getQueue(name),\n inject: [QUEUE_TOKENS.QueueRegistry],\n },\n ],\n }\n }\n}\n"],"mappings":";;;;;AAoCO,IAAA,mBAAA,MAAM,iBAAiB;;CAE5B,kCAA0B,IAAI,KAA+B;;CAG7D,+BAAuB,IAAI,KAAqB;;;;;;;;CAShD,SAAS,UAAgC;AACvC,MAAI,KAAK,aAAa,IAAI,SAAS,CACjC;AAGF,OAAK,aAAa,IAAI,SAAS;AAE/B,OAAK,MAAM,eAAe,SAAS,cAAc;GAC/C,MAAM,WAAW,KAAK,gBAAgB,IAAI,YAAY,IAAI,EAAE;AAC5D,YAAS,KAAK,SAAS;AACvB,QAAK,gBAAgB,IAAI,aAAa,SAAS;;;;;;;;;;;;;CAcnD,aAAa,aAAuC;EAClD,MAAM,aAAa,KAAK,gBAAgB,IAAI,YAAY,IAAI,EAAE;EAC9D,MAAM,gBAAgB,KAAK,gBAAgB,IAAI,IAAI,IAAI,EAAE;EAGzD,MAAM,WAAW,IAAI,IAAI,CAAC,GAAG,YAAY,GAAG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ate-D5j-d9_z.mjs";
3
- import "./logger-BR1-s1Um.mjs";
4
1
  import { EmailResendApiFailedError, ResendApiKeyMissingError } from "./email/index.mjs";
5
2
  import { t as BaseEmailProvider } from "./base-email.provider-Cuw4OAB0.mjs";
6
3
  import { Resend } from "resend";
@@ -67,4 +64,4 @@ var ResendProvider = class extends BaseEmailProvider {
67
64
  //#endregion
68
65
  export { ResendProvider };
69
66
 
70
- //# sourceMappingURL=resend.provider-BCCACQAU.mjs.map
67
+ //# sourceMappingURL=resend.provider-Bvw36rQy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resend.provider-BCCACQAU.mjs","names":[],"sources":["../src/email/providers/resend.provider.ts"],"sourcesContent":["import { Resend } from 'resend'\nimport type { ResolvedEmailAttachment, ResolvedEmailMessage } from '../contracts'\nimport type { EmailModuleOptions } from '../email.module'\nimport { EmailResendApiFailedError, ResendApiKeyMissingError } from '../errors'\nimport { BaseEmailProvider } from './base-email.provider'\nimport type { EmailSendResult } from './email-provider.interface'\n\n/**\n * Resend Email Provider\n *\n * Implementation of IEmailProvider using Resend API\n * Docs: https://resend.com/docs\n */\nexport class ResendProvider extends BaseEmailProvider {\n private readonly client: Resend\n private readonly defaultFrom: { name: string; email: string }\n\n constructor(\n private readonly options: EmailModuleOptions\n ) {\n super()\n\n // Validate Resend API key\n if (!this.options.apiKey) {\n throw new ResendApiKeyMissingError()\n }\n\n this.client = new Resend(this.options.apiKey)\n this.defaultFrom = this.options.from\n }\n\n async send(message: ResolvedEmailMessage): Promise<EmailSendResult> {\n try {\n const from = message.from\n ? `${message.from.name} <${message.from.email}>`\n : `${this.defaultFrom.name} <${this.defaultFrom.email}>`\n\n const to = Array.isArray(message.to) ? message.to : [message.to]\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Resend SDK types\n const response = await this.client.emails.send({\n from,\n to,\n subject: message.subject,\n html: message.html,\n text: message.text,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment -- Resend template extension\n ...((message as any).template && { template: (message as any).template }),\n ...(message.replyTo && { replyTo: message.replyTo }),\n ...(message.cc && { cc: message.cc }),\n ...(message.bcc && { bcc: message.bcc }),\n ...(message.attachments && {\n attachments: await Promise.all(\n message.attachments.map(async attachment => ({\n filename: attachment.filename,\n content: await this.toBuffer(attachment.content),\n }))\n ),\n }),\n })\n\n if (response.error) {\n throw new EmailResendApiFailedError()\n }\n\n return {\n messageId: response.data.id,\n accepted: true,\n metadata: {\n provider: 'resend',\n },\n }\n } catch (error) {\n if (error instanceof EmailResendApiFailedError || error instanceof ResendApiKeyMissingError) {\n throw error\n }\n\n throw new EmailResendApiFailedError()\n }\n }\n\n /**\n * Convert attachment content to Buffer\n *\n * Resend SDK expects Buffer for attachment content.\n * If content is already a Buffer, return as-is.\n * If content is a ReadableStream, convert to Buffer.\n */\n private async toBuffer(content: ResolvedEmailAttachment['content']): Promise<Buffer> {\n if (Buffer.isBuffer(content)) {\n return content\n }\n // Convert ReadableStream to Buffer\n const response = new Response(content)\n const arrayBuffer = await response.arrayBuffer()\n return Buffer.from(arrayBuffer)\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,iBAAb,cAAoC,kBAAkB;CACpD;CACA;CAEA,YACE,SACA;AACA,SAAO;AAFU,OAAA,UAAA;AAKjB,MAAI,CAAC,KAAK,QAAQ,OAChB,OAAM,IAAI,0BAA0B;AAGtC,OAAK,SAAS,IAAI,OAAO,KAAK,QAAQ,OAAO;AAC7C,OAAK,cAAc,KAAK,QAAQ;;CAGlC,MAAM,KAAK,SAAyD;AAClE,MAAI;GACF,MAAM,OAAO,QAAQ,OACjB,GAAG,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,MAAM,KAC5C,GAAG,KAAK,YAAY,KAAK,IAAI,KAAK,YAAY,MAAM;GAExD,MAAM,KAAK,MAAM,QAAQ,QAAQ,GAAG,GAAG,QAAQ,KAAK,CAAC,QAAQ,GAAG;GAGhE,MAAM,WAAW,MAAM,KAAK,OAAO,OAAO,KAAK;IAC7C;IACA;IACA,SAAS,QAAQ;IACjB,MAAM,QAAQ;IACd,MAAM,QAAQ;IAEd,GAAK,QAAgB,YAAY,EAAE,UAAW,QAAgB,UAAU;IACxE,GAAI,QAAQ,WAAW,EAAE,SAAS,QAAQ,SAAS;IACnD,GAAI,QAAQ,MAAM,EAAE,IAAI,QAAQ,IAAI;IACpC,GAAI,QAAQ,OAAO,EAAE,KAAK,QAAQ,KAAK;IACvC,GAAI,QAAQ,eAAe,EACzB,aAAa,MAAM,QAAQ,IACzB,QAAQ,YAAY,IAAI,OAAM,gBAAe;KAC3C,UAAU,WAAW;KACrB,SAAS,MAAM,KAAK,SAAS,WAAW,QAAQ;KACjD,EAAE,CACJ,EACF;IACF,CAAC;AAEF,OAAI,SAAS,MACX,OAAM,IAAI,2BAA2B;AAGvC,UAAO;IACL,WAAW,SAAS,KAAK;IACzB,UAAU;IACV,UAAU,EACR,UAAU,UACX;IACF;WACM,OAAO;AACd,OAAI,iBAAiB,6BAA6B,iBAAiB,yBACjE,OAAM;AAGR,SAAM,IAAI,2BAA2B;;;;;;;;;;CAWzC,MAAc,SAAS,SAA8D;AACnF,MAAI,OAAO,SAAS,QAAQ,CAC1B,QAAO;EAIT,MAAM,cAAc,MADH,IAAI,SAAS,QAAQ,CACH,aAAa;AAChD,SAAO,OAAO,KAAK,YAAY"}
1
+ {"version":3,"file":"resend.provider-Bvw36rQy.mjs","names":[],"sources":["../src/email/providers/resend.provider.ts"],"sourcesContent":["import { Resend } from 'resend'\nimport type { ResolvedEmailAttachment, ResolvedEmailMessage } from '../contracts'\nimport type { EmailModuleOptions } from '../email.module'\nimport { EmailResendApiFailedError, ResendApiKeyMissingError } from '../errors'\nimport { BaseEmailProvider } from './base-email.provider'\nimport type { EmailSendResult } from './email-provider.interface'\n\n/**\n * Resend Email Provider\n *\n * Implementation of IEmailProvider using Resend API\n * Docs: https://resend.com/docs\n */\nexport class ResendProvider extends BaseEmailProvider {\n private readonly client: Resend\n private readonly defaultFrom: { name: string; email: string }\n\n constructor(\n private readonly options: EmailModuleOptions\n ) {\n super()\n\n // Validate Resend API key\n if (!this.options.apiKey) {\n throw new ResendApiKeyMissingError()\n }\n\n this.client = new Resend(this.options.apiKey)\n this.defaultFrom = this.options.from\n }\n\n async send(message: ResolvedEmailMessage): Promise<EmailSendResult> {\n try {\n const from = message.from\n ? `${message.from.name} <${message.from.email}>`\n : `${this.defaultFrom.name} <${this.defaultFrom.email}>`\n\n const to = Array.isArray(message.to) ? message.to : [message.to]\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Resend SDK types\n const response = await this.client.emails.send({\n from,\n to,\n subject: message.subject,\n html: message.html,\n text: message.text,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment -- Resend template extension\n ...((message as any).template && { template: (message as any).template }),\n ...(message.replyTo && { replyTo: message.replyTo }),\n ...(message.cc && { cc: message.cc }),\n ...(message.bcc && { bcc: message.bcc }),\n ...(message.attachments && {\n attachments: await Promise.all(\n message.attachments.map(async attachment => ({\n filename: attachment.filename,\n content: await this.toBuffer(attachment.content),\n }))\n ),\n }),\n })\n\n if (response.error) {\n throw new EmailResendApiFailedError()\n }\n\n return {\n messageId: response.data.id,\n accepted: true,\n metadata: {\n provider: 'resend',\n },\n }\n } catch (error) {\n if (error instanceof EmailResendApiFailedError || error instanceof ResendApiKeyMissingError) {\n throw error\n }\n\n throw new EmailResendApiFailedError()\n }\n }\n\n /**\n * Convert attachment content to Buffer\n *\n * Resend SDK expects Buffer for attachment content.\n * If content is already a Buffer, return as-is.\n * If content is a ReadableStream, convert to Buffer.\n */\n private async toBuffer(content: ResolvedEmailAttachment['content']): Promise<Buffer> {\n if (Buffer.isBuffer(content)) {\n return content\n }\n // Convert ReadableStream to Buffer\n const response = new Response(content)\n const arrayBuffer = await response.arrayBuffer()\n return Buffer.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IAAI,2BAA2B;;;;;;;;;;CAWzC,MAAc,SAAS,SAA8D;AACnF,MAAI,OAAO,SAAS,QAAQ,CAC1B,QAAO;EAIT,MAAM,cAAc,MADH,IAAI,SAAS,QAAQ,CACH,aAAa;AAChD,SAAO,OAAO,KAAK,YAAY"}
@@ -1,2 +1,2 @@
1
- import { A as Delete, At as RouteConfig, B as getControllerVersion, Bt as SECURITY_SCHEMES, C as successMessageSchema, Ct as IController, D as getDecoratedMethods, Dt as HttpRouteMetadata, E as Route, Et as ControllerOptions, F as getHttpDecoratedMethods, Ft as SecurityScheme, H as RouteRegistrationService, I as getHttpRouteMetadata, It as VersioningOptions, L as Controller, Lt as HTTP_METHODS, M as Patch, Mt as RouteResponseObject, N as Post, Nt as RouterEnv, O as getRouteConfig, Ot as RouteBody, P as Put, Pt as RouterVariables, R as getControllerOptions, Rt as ROUTER_CONTEXT_KEYS, S as paginationQuerySchema, St as Middleware, T as validationErrorResponseSchema, Tt as RouterContext, U as HonoApp, V as ROUTER_TOKENS, Vt as VERSION_NEUTRAL, _ as ControllerRegistrationError, b as errorResponseSchema, d as SSEMessage, f as SSEStreamingApi, g as OpenAPIRouteRegistrationError, h as OpenAPIValidationError, j as Get, jt as RouteResponse, k as All, kt as RouteBodyObject, m as RouteNotFoundError, p as StreamingApi, v as HonoAppAlreadyConfiguredError, w as uuidParamSchema, x as paginatedResponseSchema, y as commonErrorSchemas, z as getControllerRoute, zt as ROUTE_METADATA_KEYS } from "../index-BJWm863C.mjs";
2
- export { All, Controller, ControllerOptions, ControllerRegistrationError, Delete, Get, HTTP_METHODS, HonoApp, HonoAppAlreadyConfiguredError, HttpRouteMetadata, IController, Middleware, OpenAPIRouteRegistrationError, OpenAPIValidationError, Patch, Post, Put, ROUTER_CONTEXT_KEYS, ROUTER_TOKENS, ROUTE_METADATA_KEYS, Route, RouteBody, RouteBodyObject, RouteConfig, RouteNotFoundError, RouteRegistrationService, RouteResponse, RouteResponseObject, RouterContext, RouterEnv, RouterVariables, SECURITY_SCHEMES, SSEMessage, SSEStreamingApi, SecurityScheme, StreamingApi, VERSION_NEUTRAL, VersioningOptions, commonErrorSchemas, errorResponseSchema, getControllerOptions, getControllerRoute, getControllerVersion, getDecoratedMethods, getHttpDecoratedMethods, getHttpRouteMetadata, getRouteConfig, paginatedResponseSchema, paginationQuerySchema, successMessageSchema, uuidParamSchema, validationErrorResponseSchema };
1
+ import { $ as SSEMessage, $n as HTTP_METHODS, $t as RouteConfigurable, At as getRouteDecoratedMethods, Bn as ConventionRouteMetadata, Bt as getControllerRoute, Ct as errorResponseSchema, Dt as uuidParamSchema, Et as successMessageSchema, Ft as Patch, G as buildRouteUrl, Gn as RouteConfig, Gt as generateConventionRouteName, H as SignedUriOptions, Hn as LocalePathConfig, Ht as createMiddlewareChain, In as LocalePathService, It as Post, J as RouteRegistry, Jn as RouteResponseObject, Jt as toOpenAPIPath, K as RegisteredRoute, Kn as RouteMetadata, Kt as getPathSpecificityScore, Ln as ResolvedPath, Lt as Put, Mt as All, Nt as Delete, Ot as validationErrorResponseSchema, Pt as Get, Qn as VersioningOptions, Rn as HonoApp, Rt as Controller, Sr as StratalRouteMap, St as commonErrorSchemas, Tt as paginationQuerySchema, U as Uri, Un as RouteBody, Ut as extractDomainParamNames, V as RouterContext, Vn as ExplicitRouteMetadata, Vt as getControllerVersion, W as UriOptions, Wn as RouteBodyObject, Wt as extractParamNames, Xn as RouterVariables, Xt as ROUTER_TOKENS, Y as VersioningService, Yn as RouterEnv, Yt as route, Zn as SecurityScheme, Zt as RouteRegistrationService, _t as signUrl, at as MissingEnvironmentVariableError, br as SerializedRoute, bt as createDomainMiddleware, ct as RouteNameNotFoundError, dt as RouteNotFoundError, en as Router, er as ROUTER_CONTEXT_KEYS, et as SSEStreamingApi, ft as OpenAPIValidationError, gt as SignedUrlOptions, ht as ControllerRegistrationError, in as IController, it as InvalidSignatureError, jt as getRouteMetadata, kt as Route, lt as RouterUseScopeError, mt as HonoAppAlreadyConfiguredError, nn as Middleware, nr as SECURITY_SCHEMES, nt as DomainMismatchError, ot as MissingRouteParamError, pt as OpenAPIRouteRegistrationError, q as RouteRegistrationInput, qn as RouteResponse, qt as sortRoutesBySpecificity, rn as Next, rr as VERSION_NEUTRAL, rt as DuplicateRouteNameError, st as ResponseValidationError, tn as RouterGroupConfig, tr as ROUTE_METADATA_KEYS, tt as StreamingApi, ut as SchemaValidationError, vr as RouteName, vt as verifySignedUrl, wt as paginatedResponseSchema, xr as SerializedRoutes, xt as parseDomainPattern, yr as RouteParams, yt as VerifySignatureMiddleware, zn as ControllerOptions, zt as getControllerOptions } from "../index-BrmS34sa.mjs";
2
+ export { All, Controller, ControllerOptions, ControllerRegistrationError, ConventionRouteMetadata, Delete, DomainMismatchError, DuplicateRouteNameError, ExplicitRouteMetadata, Get, HTTP_METHODS, HonoApp, HonoAppAlreadyConfiguredError, IController, InvalidSignatureError, LocalePathConfig, LocalePathService, Middleware, MissingEnvironmentVariableError, MissingRouteParamError, Next, OpenAPIRouteRegistrationError, OpenAPIValidationError, Patch, Post, Put, ROUTER_CONTEXT_KEYS, ROUTER_TOKENS, ROUTE_METADATA_KEYS, RegisteredRoute, ResolvedPath, ResponseValidationError, Route, RouteBody, RouteBodyObject, RouteConfig, RouteConfigurable, RouteMetadata, RouteName, RouteNameNotFoundError, RouteNotFoundError, RouteParams, RouteRegistrationInput, RouteRegistrationService, RouteRegistry, RouteResponse, RouteResponseObject, Router, RouterContext, RouterEnv, RouterGroupConfig, RouterUseScopeError, RouterVariables, SECURITY_SCHEMES, SSEMessage, SSEStreamingApi, SchemaValidationError, SecurityScheme, SerializedRoute, SerializedRoutes, SignedUriOptions, SignedUrlOptions, StratalRouteMap, StreamingApi, Uri, UriOptions, VERSION_NEUTRAL, VerifySignatureMiddleware, VersioningOptions, VersioningService, buildRouteUrl, commonErrorSchemas, createDomainMiddleware, createMiddlewareChain, errorResponseSchema, extractDomainParamNames, extractParamNames, generateConventionRouteName, getControllerOptions, getControllerRoute, getControllerVersion, getPathSpecificityScore, getRouteDecoratedMethods, getRouteMetadata, paginatedResponseSchema, paginationQuerySchema, parseDomainPattern, route, signUrl, sortRoutesBySpecificity, successMessageSchema, toOpenAPIPath, uuidParamSchema, validationErrorResponseSchema, verifySignedUrl };
@@ -1,16 +1,5 @@
1
- import { v as ROUTER_TOKENS } from "../errors-CtCi1wn6.mjs";
2
- import "../decorate-D5j-d9_z.mjs";
3
- import "../logger-BR1-s1Um.mjs";
4
- import "../module-BgdxxzBe.mjs";
5
- import "../events-CXl-o1Ad.mjs";
6
- import "../colors-DJaRDXoS.mjs";
7
- import "../command-BvCOD6df.mjs";
8
- import "../is-command-BfCgWAcQ.mjs";
9
- import "../is-seeder-CebjZCDn.mjs";
10
- import { a as getControllerVersion, i as getControllerRoute, n as Controller, r as getControllerOptions } from "../middleware-C0Ebzswy.mjs";
11
- import { a as ROUTER_CONTEXT_KEYS, c as VERSION_NEUTRAL, o as ROUTE_METADATA_KEYS, r as HTTP_METHODS, s as SECURITY_SCHEMES, t as RouterContext } from "../router-context-BEJe9HEB.mjs";
12
- import "../validation-Bh875Lyg.mjs";
13
- import { C as Get, D as getHttpDecoratedMethods, E as Put, O as getHttpRouteMetadata, S as Delete, T as Post, a as errorResponseSchema, b as getRouteConfig, c as successMessageSchema, d as RouteNotFoundError, f as OpenAPIValidationError, h as HonoAppAlreadyConfiguredError, i as commonErrorSchemas, l as uuidParamSchema, m as ControllerRegistrationError, n as HonoApp, o as paginatedResponseSchema, p as OpenAPIRouteRegistrationError, r as RouteRegistrationService, s as paginationQuerySchema, u as validationErrorResponseSchema, v as Route, w as Patch, x as All, y as getDecoratedMethods } from "../i18n.module-W8OJxg3d.mjs";
14
- import "../guards-DUk_Kzst.mjs";
15
- import "../gateway-context-BkZ4UKaX.mjs";
16
- export { All, Controller, ControllerRegistrationError, Delete, Get, HTTP_METHODS, HonoApp, HonoAppAlreadyConfiguredError, OpenAPIRouteRegistrationError, OpenAPIValidationError, Patch, Post, Put, ROUTER_CONTEXT_KEYS, ROUTER_TOKENS, ROUTE_METADATA_KEYS, Route, RouteNotFoundError, RouteRegistrationService, RouterContext, SECURITY_SCHEMES, VERSION_NEUTRAL, commonErrorSchemas, errorResponseSchema, getControllerOptions, getControllerRoute, getControllerVersion, getDecoratedMethods, getHttpDecoratedMethods, getHttpRouteMetadata, getRouteConfig, paginatedResponseSchema, paginationQuerySchema, successMessageSchema, uuidParamSchema, validationErrorResponseSchema };
1
+ import { V as ROUTER_TOKENS, d as ROUTER_CONTEXT_KEYS, f as ROUTE_METADATA_KEYS, l as HTTP_METHODS, m as VERSION_NEUTRAL, p as SECURITY_SCHEMES, s as RouterContext } from "../errors--RBIvDXr.mjs";
2
+ import { _ as OpenAPIRouteRegistrationError, c as InvalidSignatureError, d as ResponseValidationError, f as RouteNameNotFoundError, g as OpenAPIValidationError, h as RouteNotFoundError, l as MissingEnvironmentVariableError, m as SchemaValidationError, n as Router, o as DomainMismatchError, p as RouterUseScopeError, s as DuplicateRouteNameError, u as MissingRouteParamError, v as HonoAppAlreadyConfiguredError, y as ControllerRegistrationError } from "../module-C3YZ-kZN.mjs";
3
+ import { A as Delete, C as successMessageSchema, D as getRouteDecoratedMethods, E as Route, F as createMiddlewareChain, I as createDomainMiddleware, L as parseDomainPattern, M as Patch, N as Post, O as getRouteMetadata, P as Put, S as paginationQuerySchema, T as validationErrorResponseSchema, _ as sortRoutesBySpecificity, a as buildRouteUrl, b as errorResponseSchema, c as RouteRegistry, d as HonoApp, f as RouteRegistrationService, g as getPathSpecificityScore, h as generateConventionRouteName, i as Uri, j as Get, k as All, l as VersioningService, m as extractParamNames, n as VerifySignatureMiddleware, o as signUrl, p as extractDomainParamNames, r as route, s as verifySignedUrl, u as LocalePathService, v as toOpenAPIPath, w as uuidParamSchema, x as paginatedResponseSchema, y as commonErrorSchemas } from "../i18n.module-BpLLLCTg.mjs";
4
+ import { f as Controller, h as getControllerVersion, m as getControllerRoute, p as getControllerOptions } from "../gateway-context-BdBFoQd8.mjs";
5
+ export { All, Controller, ControllerRegistrationError, Delete, DomainMismatchError, DuplicateRouteNameError, Get, HTTP_METHODS, HonoApp, HonoAppAlreadyConfiguredError, InvalidSignatureError, LocalePathService, MissingEnvironmentVariableError, MissingRouteParamError, OpenAPIRouteRegistrationError, OpenAPIValidationError, Patch, Post, Put, ROUTER_CONTEXT_KEYS, ROUTER_TOKENS, ROUTE_METADATA_KEYS, ResponseValidationError, Route, RouteNameNotFoundError, RouteNotFoundError, RouteRegistrationService, RouteRegistry, Router, RouterContext, RouterUseScopeError, SECURITY_SCHEMES, SchemaValidationError, Uri, VERSION_NEUTRAL, VerifySignatureMiddleware, VersioningService, buildRouteUrl, commonErrorSchemas, createDomainMiddleware, createMiddlewareChain, errorResponseSchema, extractDomainParamNames, extractParamNames, generateConventionRouteName, getControllerOptions, getControllerRoute, getControllerVersion, getPathSpecificityScore, getRouteDecoratedMethods, getRouteMetadata, paginatedResponseSchema, paginationQuerySchema, parseDomainPattern, route, signUrl, sortRoutesBySpecificity, successMessageSchema, toOpenAPIPath, uuidParamSchema, validationErrorResponseSchema, verifySignedUrl };
@@ -1,7 +1,5 @@
1
- import "./errors-CtCi1wn6.mjs";
2
- import "./decorate-D5j-d9_z.mjs";
3
- import "./logger-BR1-s1Um.mjs";
4
- import { t as StorageResponseBodyMissingError } from "./errors-H3TZnVeX.mjs";
1
+ import { t as __exportAll } from "./chunk-D1SwGrFN.mjs";
2
+ import { t as StorageResponseBodyMissingError } from "./errors-B7hCnXgB.mjs";
5
3
  import { DOMParser } from "@xmldom/xmldom";
6
4
  import { AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CreateMultipartUploadCommand, DeleteObjectCommand, DeleteObjectsCommand, GetObjectCommand, HeadObjectCommand, ListMultipartUploadsCommand, ListPartsCommand, PutObjectCommand, S3Client, UploadPartCommand } from "@aws-sdk/client-s3";
7
5
  import { Upload } from "@aws-sdk/lib-storage";
@@ -32,6 +30,7 @@ if (typeof globalThis.Node === "undefined") globalThis.Node = {
32
30
  };
33
31
  //#endregion
34
32
  //#region src/storage/providers/s3-storage.provider.ts
33
+ var s3_storage_provider_exports = /* @__PURE__ */ __exportAll({ S3StorageProvider: () => S3StorageProvider });
35
34
  /**
36
35
  * S3 Storage Provider
37
36
  * Implements storage operations using AWS SDK for S3-compatible storage
@@ -41,18 +40,26 @@ if (typeof globalThis.Node === "undefined") globalThis.Node = {
41
40
  */
42
41
  var S3StorageProvider = class {
43
42
  client;
43
+ presigningClient;
44
44
  bucket;
45
45
  disk;
46
46
  constructor(config) {
47
- this.client = new S3Client({
47
+ const clientConfig = {
48
48
  region: config.region || "auto",
49
- endpoint: config.endpoint,
50
49
  credentials: {
51
50
  accessKeyId: config.accessKeyId,
52
51
  secretAccessKey: config.secretAccessKey
53
52
  },
54
53
  forcePathStyle: true
54
+ };
55
+ this.client = new S3Client({
56
+ ...clientConfig,
57
+ endpoint: config.endpoint
55
58
  });
59
+ this.presigningClient = config.url ? new S3Client({
60
+ ...clientConfig,
61
+ endpoint: config.url
62
+ }) : this.client;
56
63
  this.bucket = config.bucket;
57
64
  this.disk = config.disk;
58
65
  }
@@ -140,7 +147,7 @@ var S3StorageProvider = class {
140
147
  break;
141
148
  }
142
149
  return {
143
- url: await getSignedUrl(this.client, command, { expiresIn }),
150
+ url: await getSignedUrl(this.presigningClient, command, { expiresIn }),
144
151
  expiresIn,
145
152
  expiresAt: new Date(Date.now() + expiresIn * 1e3),
146
153
  method
@@ -331,6 +338,6 @@ var S3StorageProvider = class {
331
338
  }
332
339
  };
333
340
  //#endregion
334
- export { S3StorageProvider };
341
+ export { s3_storage_provider_exports as n, S3StorageProvider as t };
335
342
 
336
- //# sourceMappingURL=s3-storage.provider-BLlzQYiJ.mjs.map
343
+ //# sourceMappingURL=s3-storage.provider-BAhHDMI3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3-storage.provider-BAhHDMI3.mjs","names":[],"sources":["../src/storage/dom.polyfill.ts","../src/storage/providers/s3-storage.provider.ts"],"sourcesContent":["/**\n * DOM polyfills for Cloudflare Workers\n *\n * AWS SDK v3 uses DOMParser and Node for XML parsing, which are not available in Workers.\n * This module must be imported BEFORE any AWS SDK imports (including transitive).\n *\n * @see https://github.com/aws/aws-sdk-js-v3/issues/7375\n */\nimport { DOMParser } from '@xmldom/xmldom'\n\n// DOMParser polyfill for XML response parsing\nglobalThis.DOMParser = DOMParser\n\n// Node interface polyfill with DOM node type constants\n// Required by AWS SDK for XML response parsing\nif (typeof globalThis.Node === 'undefined') {\n globalThis.Node = {\n ELEMENT_NODE: 1,\n ATTRIBUTE_NODE: 2,\n TEXT_NODE: 3,\n CDATA_SECTION_NODE: 4,\n ENTITY_REFERENCE_NODE: 5,\n ENTITY_NODE: 6,\n PROCESSING_INSTRUCTION_NODE: 7,\n COMMENT_NODE: 8,\n DOCUMENT_NODE: 9,\n DOCUMENT_TYPE_NODE: 10,\n DOCUMENT_FRAGMENT_NODE: 11,\n NOTATION_NODE: 12,\n } as unknown as typeof Node\n}\n","import '../dom.polyfill'\n\nimport {\n AbortMultipartUploadCommand,\n CompleteMultipartUploadCommand,\n CreateMultipartUploadCommand,\n DeleteObjectCommand,\n DeleteObjectsCommand,\n GetObjectCommand,\n HeadObjectCommand,\n ListMultipartUploadsCommand,\n ListPartsCommand,\n PutObjectCommand,\n S3Client,\n UploadPartCommand\n} from '@aws-sdk/client-s3'\nimport { Upload } from '@aws-sdk/lib-storage'\nimport { getSignedUrl } from '@aws-sdk/s3-request-presigner'\nimport type { StorageEntry } from '../types'\nimport type { DownloadResult, PresignedUrlResult, UploadOptions, UploadResult } from '../contracts'\nimport { StorageResponseBodyMissingError } from '../errors'\nimport type {\n CompletedPart,\n CompleteMultipartResult,\n CreateMultipartOptions,\n CreateMultipartResult,\n DeleteObjectsResult,\n HeadObjectResult,\n IS3MultipartProvider,\n ListMultipartUploadsResult,\n ListPartsResult,\n UploadPartResult,\n} from './s3-multipart-provider.interface'\nimport type { StreamingBlobPayloadInputTypes } from './storage-provider.interface'\n\n/**\n * S3 Storage Provider\n * Implements storage operations using AWS SDK for S3-compatible storage\n * Works with AWS S3, Cloudflare R2, MinIO, and other S3-compatible services\n *\n * Implements IS3MultipartProvider for multipart upload support needed by TUS\n */\nexport class S3StorageProvider implements IS3MultipartProvider {\n private readonly client: S3Client\n private readonly presigningClient: S3Client\n private readonly bucket: string\n private readonly disk: string\n\n constructor(config: StorageEntry) {\n const clientConfig = {\n region: config.region || 'auto',\n credentials: {\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n },\n forcePathStyle: true,\n }\n\n // API client for storage operations (upload, download, delete)\n this.client = new S3Client({ ...clientConfig, endpoint: config.endpoint })\n\n // Presigning client uses `url` when set, so generated URLs are valid\n // for the client-accessible host (the host is part of the AWS SigV4 signature)\n this.presigningClient = config.url\n ? new S3Client({ ...clientConfig, endpoint: config.url })\n : this.client\n\n this.bucket = config.bucket\n this.disk = config.disk\n }\n\n async upload(\n body: StreamingBlobPayloadInputTypes,\n path: string,\n options: UploadOptions\n ): Promise<UploadResult> {\n const command = new PutObjectCommand({\n Bucket: this.bucket,\n Key: path,\n Body: body,\n ContentType: options.mimeType,\n ContentLength: options.size,\n Metadata: options.metadata,\n Tagging: options.tagging,\n })\n\n await this.client.send(command)\n\n return {\n path,\n disk: this.disk,\n fullPath: `${this.bucket}/${path}`,\n size: options.size,\n mimeType: options.mimeType ?? 'application/octet-stream',\n uploadedAt: new Date(),\n }\n }\n\n async download(path: string): Promise<DownloadResult> {\n const command = new GetObjectCommand({\n Bucket: this.bucket,\n Key: path,\n })\n\n const response = await this.client.send(command)\n\n if (!response.Body) {\n throw new StorageResponseBodyMissingError(path)\n }\n\n return {\n toStream: () => response.Body?.transformToWebStream(),\n contentType: response.ContentType ?? 'application/octet-stream',\n size: response.ContentLength ?? 0,\n metadata: response.Metadata,\n toString: () => response.Body?.transformToString(),\n toArrayBuffer: () => response.Body?.transformToByteArray(),\n }\n }\n\n async delete(path: string): Promise<void> {\n const command = new DeleteObjectCommand({\n Bucket: this.bucket,\n Key: path,\n })\n\n await this.client.send(command)\n }\n\n async exists(path: string): Promise<boolean> {\n try {\n const command = new HeadObjectCommand({\n Bucket: this.bucket,\n Key: path,\n })\n\n await this.client.send(command)\n return true\n } catch {\n // HeadObject throws error if file doesn't exist\n return false\n }\n }\n\n async getPresignedUrl(\n path: string,\n method: 'GET' | 'PUT' | 'DELETE' | 'HEAD',\n expiresIn: number\n ): Promise<PresignedUrlResult> {\n // Select appropriate command based on method\n let command\n switch (method) {\n case 'GET':\n command = new GetObjectCommand({ Bucket: this.bucket, Key: path })\n break\n case 'PUT':\n command = new PutObjectCommand({ Bucket: this.bucket, Key: path })\n break\n case 'DELETE':\n command = new DeleteObjectCommand({ Bucket: this.bucket, Key: path })\n break\n case 'HEAD':\n command = new HeadObjectCommand({ Bucket: this.bucket, Key: path })\n break\n }\n\n const url = await getSignedUrl(this.presigningClient, command as GetObjectCommand, { expiresIn })\n\n return {\n url,\n expiresIn,\n expiresAt: new Date(Date.now() + expiresIn * 1000),\n method,\n }\n }\n\n /**\n * Chunked upload for streaming data without known size\n * Uses @aws-sdk/lib-storage for multipart upload handling\n *\n * Benefits:\n * - Handles unknown Content-Length automatically\n * - Automatic retry on transient failures\n * - Cleanup of partial uploads on error\n * - Works with S3-compatible storage (R2, MinIO, RustFS)\n *\n * @param body - Content to upload (stream or buffer)\n * @param path - Full path including disk root\n * @param options - Upload options (mimeType required, size optional)\n * @returns Upload result with metadata\n */\n async chunkedUpload(\n body: StreamingBlobPayloadInputTypes,\n path: string,\n options: Omit<UploadOptions, 'size'> & { size?: number }\n ): Promise<UploadResult> {\n const upload = new Upload({\n client: this.client,\n params: {\n Bucket: this.bucket,\n Key: path,\n Body: body,\n ContentType: options.mimeType,\n },\n // Concurrency configuration\n queueSize: 4,\n // Part size: 5MB minimum for S3\n partSize: 5 * 1024 * 1024,\n // Don't leave orphaned parts on error\n leavePartsOnError: false,\n })\n\n await upload.done()\n\n // Get the actual uploaded size via HeadObject\n const headResponse = await this.client.send(\n new HeadObjectCommand({\n Bucket: this.bucket,\n Key: path,\n })\n )\n\n return {\n path,\n disk: this.disk,\n fullPath: `${this.bucket}/${path}`,\n size: headResponse.ContentLength ?? options.size ?? 0,\n mimeType: options.mimeType ?? 'application/octet-stream',\n uploadedAt: new Date(),\n }\n }\n\n // ============================================\n // IS3MultipartProvider - Multipart upload methods\n // ============================================\n\n /**\n * Get the bucket name\n */\n getBucket(): string {\n return this.bucket\n }\n\n /**\n * Get object metadata without downloading the body\n */\n async headObject(key: string): Promise<HeadObjectResult | null> {\n const response = await this.client.send(\n new HeadObjectCommand({\n Bucket: this.bucket,\n Key: key,\n })\n )\n return {\n size: response.ContentLength ?? 0,\n contentType: response.ContentType,\n metadata: response.Metadata,\n }\n }\n\n /**\n * Delete multiple objects in a single request\n */\n async deleteObjects(keys: string[]): Promise<DeleteObjectsResult> {\n if (keys.length === 0) {\n return { deleted: 0, errors: [] }\n }\n\n const response = await this.client.send(\n new DeleteObjectsCommand({\n Bucket: this.bucket,\n Delete: {\n Objects: keys.map((key) => ({ Key: key })),\n },\n })\n )\n\n return {\n deleted: response.Deleted?.length ?? 0,\n errors: (response.Errors ?? []).map((e) => ({\n key: e.Key ?? '',\n code: e.Code ?? 'Unknown',\n message: e.Message ?? 'Unknown error',\n })),\n }\n }\n\n /**\n * Create a multipart upload\n */\n async createMultipartUpload(\n key: string,\n options?: CreateMultipartOptions\n ): Promise<CreateMultipartResult> {\n const response = await this.client.send(\n new CreateMultipartUploadCommand({\n Bucket: this.bucket,\n Key: key,\n ContentType: options?.contentType,\n CacheControl: options?.cacheControl,\n Metadata: options?.metadata,\n Tagging: options?.tagging,\n })\n )\n\n return {\n uploadId: response.UploadId ?? '',\n key: response.Key ?? '',\n }\n }\n\n /**\n * Upload a part to an existing multipart upload\n */\n async uploadPart(\n key: string,\n uploadId: string,\n partNumber: number,\n body: Uint8Array\n ): Promise<UploadPartResult> {\n const response = await this.client.send(\n new UploadPartCommand({\n Bucket: this.bucket,\n Key: key,\n UploadId: uploadId,\n PartNumber: partNumber,\n Body: body,\n ContentLength: body.length,\n })\n )\n\n return {\n etag: response.ETag ?? '',\n partNumber,\n }\n }\n\n /**\n * Complete a multipart upload\n */\n async completeMultipartUpload(\n key: string,\n uploadId: string,\n parts: CompletedPart[]\n ): Promise<CompleteMultipartResult> {\n const response = await this.client.send(\n new CompleteMultipartUploadCommand({\n Bucket: this.bucket,\n Key: key,\n UploadId: uploadId,\n MultipartUpload: {\n Parts: parts.map((p) => ({\n ETag: p.etag,\n PartNumber: p.partNumber,\n })),\n },\n })\n )\n\n return {\n location: response.Location,\n key: response.Key ?? '',\n }\n }\n\n /**\n * Abort a multipart upload\n */\n async abortMultipartUpload(key: string, uploadId: string): Promise<void> {\n await this.client.send(\n new AbortMultipartUploadCommand({\n Bucket: this.bucket,\n Key: key,\n UploadId: uploadId,\n })\n )\n }\n\n /**\n * List parts of a multipart upload\n */\n async listParts(\n key: string,\n uploadId: string,\n partNumberMarker?: string\n ): Promise<ListPartsResult> {\n const response = await this.client.send(\n new ListPartsCommand({\n Bucket: this.bucket,\n Key: key,\n UploadId: uploadId,\n PartNumberMarker: partNumberMarker,\n })\n )\n\n return {\n parts: (response.Parts ?? []).map((p) => ({\n partNumber: p.PartNumber ?? 0,\n etag: p.ETag ?? '',\n size: p.Size ?? 0,\n })),\n isTruncated: response.IsTruncated ?? false,\n nextPartNumberMarker: response.NextPartNumberMarker?.toString(),\n }\n }\n\n /**\n * List all in-progress multipart uploads\n */\n async listMultipartUploads(\n keyMarker?: string,\n uploadIdMarker?: string\n ): Promise<ListMultipartUploadsResult> {\n const response = await this.client.send(\n new ListMultipartUploadsCommand({\n Bucket: this.bucket,\n KeyMarker: keyMarker,\n UploadIdMarker: uploadIdMarker,\n })\n )\n\n return {\n uploads: (response.Uploads ?? []).map((u) => ({\n key: u.Key ?? '',\n uploadId: u.UploadId ?? '',\n initiated: u.Initiated,\n })),\n isTruncated: response.IsTru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sBAAsB,SAAS,sBAAsB,UAAU;GAChE;;;;;CAMH,MAAM,qBACJ,WACA,gBACqC;EACrC,MAAM,WAAW,MAAM,KAAK,OAAO,KACjC,IAAI,4BAA4B;GAC9B,QAAQ,KAAK;GACb,WAAW;GACX,gBAAgB;GACjB,CAAC,CACH;AAED,SAAO;GACL,UAAU,SAAS,WAAW,EAAE,EAAE,KAAK,OAAO;IAC5C,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE;IACd,EAAE;GACH,aAAa,SAAS,eAAe;GACrC,eAAe,SAAS;GACxB,oBAAoB,SAAS;GAC9B"}
@@ -1,7 +1,6 @@
1
- import { $t as Container, s as ApplicationError } from "../index-BJWm863C.mjs";
2
- import { t as Constructor } from "../types-DahElfUw.mjs";
3
- import { t as Application } from "../application-zG8b-pol.mjs";
4
- import { t as Command } from "../command-B-QH-Vu3.mjs";
1
+ import { Cr as Container, X as Application, d as ApplicationError } from "../index-BrmS34sa.mjs";
2
+ import { t as Constructor } from "../types-CN0zONAZ.mjs";
3
+ import { t as Command } from "../command-B1YuV-UZ.mjs";
5
4
 
6
5
  //#region src/seeder/seeder.d.ts
7
6
  declare const SEEDER_INTERNALS: unique symbol;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/seeder/seeder.ts","../../src/seeder/seeder-registry.ts","../../src/seeder/commands/db-seed-list.command.ts","../../src/seeder/commands/db-seed.command.ts","../../src/seeder/errors.ts","../../src/seeder/is-seeder.ts"],"mappings":";;;;;;cAGa,gBAAA;AAAA,UAEI,aAAA;EACf,GAAA,CAAI,WAAA,EAAa,WAAA,CAAY,MAAA,IAAU,OAAA;EACvC,SAAA,EAAW,SAAA;AAAA;AAAA,uBAGS,MAAA;EAAA,CACnB,gBAAA,GAAmB,aAAA;EAAA,SAKX,GAAA,CAAA,GAAO,OAAA;EAbwC;EAAA,UAgBxC,IAAA,CAAK,WAAA,EAAa,WAAA,CAAY,MAAA,IAAU,OAAA;AAAA;;;cCb7C,aAAA;EAAA,SAEH,cAAA;AAAA;AAAA,cAEG,cAAA;EAAA,QAIS,GAAA;EAAA,QAHZ,OAAA;EAAA,QACA,SAAA;cAEY,GAAA,EAAK,WAAA;EAEzB,QAAA,CAAS,WAAA,EAAa,WAAA,CAAY,MAAA;EAS5B,GAAA,CAAI,WAAA,EAAa,WAAA,CAAY,MAAA,GAAS,OAAA;IAAY,SAAA,GAAY,SAAA;EAAA,IAAc,OAAA;EAsB5E,MAAA,CAAO,OAAA;IAAY,SAAA,GAAY,SAAA;EAAA,IAAc,OAAA;EAMnD,IAAA,CAAK,IAAA,WAAe,WAAA,CAAY,MAAA;EAIhC,GAAA,CAAI,WAAA,EAAa,WAAA,CAAY,MAAA;EAI7B,IAAA,CAAA;IAAU,SAAA;EAAA;AAAA;;;cCzDC,iBAAA,SAA0B,OAAA;EAAA,QAIqB,OAAA;EAAA,OAHnD,OAAA;EAAA,OACA,WAAA;cAEmD,OAAA,EAAS,cAAA;EAInE,MAAA,CAAA;AAAA;;;cCRW,aAAA,SAAsB,OAAA;EAAA,QAIyB,OAAA;EAAA,OAHnD,OAAA;EAAA,OACA,WAAA;cAEmD,OAAA,EAAS,cAAA;EAI7D,MAAA,CAAA,GAAU,OAAA;AAAA;;;cCVL,wBAAA,SAAiC,gBAAA;cAChC,IAAA;AAAA;AAAA,cASD,wBAAA,SAAiC,gBAAA;cAChC,IAAA;AAAA;;;;;;;;iBCLE,QAAA,CAAS,MAAA,EAAQ,WAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/seeder/seeder.ts","../../src/seeder/seeder-registry.ts","../../src/seeder/commands/db-seed-list.command.ts","../../src/seeder/commands/db-seed.command.ts","../../src/seeder/errors.ts","../../src/seeder/is-seeder.ts"],"mappings":";;;;;cAGa,gBAAA;AAAA,UAEI,aAAA;EACf,GAAA,CAAI,WAAA,EAAa,WAAA,CAAY,MAAA,IAAU,OAAA;EACvC,SAAA,EAAW,SAA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.mjs";
5
- import "../command-BvCOD6df.mjs";
6
- import { n as SEEDER_INTERNALS, r as Seeder, t as isSeeder } from "../is-seeder-CebjZCDn.mjs";
7
- import { a as SeederNameCollisionError, i as SeederRegistry, n as DbSeedListCommand, o as SeederNotRegisteredError, r as SEEDER_TOKENS, t as DbSeedCommand } from "../seeder-Cupi5jl-.mjs";
1
+ import { n as SEEDER_INTERNALS, r as Seeder, t as isSeeder } from "../is-seeder-BN9Ej1r7.mjs";
2
+ import { a as SeederNameCollisionError, i as SeederRegistry, n as DbSeedListCommand, o as SeederNotRegisteredError, r as SEEDER_TOKENS, t as DbSeedCommand } from "../seeder-D7VXULXB.mjs";
8
3
  export { DbSeedCommand, DbSeedListCommand, SEEDER_INTERNALS, SEEDER_TOKENS, Seeder, SeederNameCollisionError, SeederNotRegisteredError, SeederRegistry, isSeeder };