@venizia/ignis 0.4.6 → 0.4.7-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/LICENSE.md +1 -4
  2. package/README.md +2 -2
  3. package/dist/esm/base/applications/base.d.ts.map +1 -1
  4. package/dist/esm/base/applications/base.js +19 -15
  5. package/dist/esm/base/applications/base.js.map +1 -1
  6. package/dist/esm/base/applications/server.d.ts +14 -9
  7. package/dist/esm/base/applications/server.d.ts.map +1 -1
  8. package/dist/esm/base/applications/server.js +36 -29
  9. package/dist/esm/base/applications/server.js.map +1 -1
  10. package/dist/esm/base/controllers/grpc/adapter.d.ts.map +1 -1
  11. package/dist/esm/base/controllers/grpc/adapter.js +5 -1
  12. package/dist/esm/base/controllers/grpc/adapter.js.map +1 -1
  13. package/dist/esm/base/middlewares/request-spy/request-spy.middleware.d.ts.map +1 -1
  14. package/dist/esm/base/middlewares/request-spy/request-spy.middleware.js +9 -3
  15. package/dist/esm/base/middlewares/request-spy/request-spy.middleware.js.map +1 -1
  16. package/dist/esm/common/constants.d.ts.map +1 -1
  17. package/dist/esm/common/constants.js +2 -2
  18. package/dist/esm/common/constants.js.map +1 -1
  19. package/dist/esm/components/api-reference/ui/scalar.d.ts.map +1 -1
  20. package/dist/esm/components/api-reference/ui/scalar.js +2 -1
  21. package/dist/esm/components/api-reference/ui/scalar.js.map +1 -1
  22. package/dist/esm/components/api-reference/ui/swagger.d.ts.map +1 -1
  23. package/dist/esm/components/api-reference/ui/swagger.js +2 -1
  24. package/dist/esm/components/api-reference/ui/swagger.js.map +1 -1
  25. package/dist/esm/components/auth/authenticate/component.js +2 -2
  26. package/dist/esm/components/auth/authenticate/component.js.map +1 -1
  27. package/dist/esm/components/auth/authenticate/controllers/factory.d.ts +139 -136
  28. package/dist/esm/components/auth/authenticate/controllers/factory.d.ts.map +1 -1
  29. package/dist/esm/components/auth/authenticate/controllers/factory.js +175 -172
  30. package/dist/esm/components/auth/authenticate/controllers/factory.js.map +1 -1
  31. package/dist/esm/components/auth/authenticate/controllers/jwks/definitions.js +2 -2
  32. package/dist/esm/components/auth/authenticate/controllers/jwks/definitions.js.map +1 -1
  33. package/dist/esm/components/auth/authenticate/controllers/service-certs/definitions.js +2 -2
  34. package/dist/esm/components/auth/authenticate/controllers/service-certs/definitions.js.map +1 -1
  35. package/dist/esm/components/auth/authenticate/services/bearer/abstract.service.d.ts.map +1 -1
  36. package/dist/esm/components/auth/authenticate/services/bearer/abstract.service.js +4 -2
  37. package/dist/esm/components/auth/authenticate/services/bearer/abstract.service.js.map +1 -1
  38. package/dist/esm/components/auth/authenticate/services/service/signer.service.d.ts.map +1 -1
  39. package/dist/esm/components/auth/authenticate/services/service/signer.service.js +6 -4
  40. package/dist/esm/components/auth/authenticate/services/service/signer.service.js.map +1 -1
  41. package/dist/esm/components/auth/authorize/adapters/base-filtered.js +2 -2
  42. package/dist/esm/components/auth/authorize/adapters/base-filtered.js.map +1 -1
  43. package/dist/esm/components/auth/authorize/adapters/custom-grant-expander.d.ts.map +1 -1
  44. package/dist/esm/components/auth/authorize/adapters/custom-grant-expander.js +2 -2
  45. package/dist/esm/components/auth/authorize/adapters/custom-grant-expander.js.map +1 -1
  46. package/dist/esm/components/auth/authorize/adapters/scoped-casbin/adapter.d.ts.map +1 -1
  47. package/dist/esm/components/auth/authorize/adapters/scoped-casbin/adapter.js +6 -3
  48. package/dist/esm/components/auth/authorize/adapters/scoped-casbin/adapter.js.map +1 -1
  49. package/dist/esm/components/auth/authorize/enforcers/casbin-module.d.ts.map +1 -1
  50. package/dist/esm/components/auth/authorize/enforcers/casbin-module.js +2 -1
  51. package/dist/esm/components/auth/authorize/enforcers/casbin-module.js.map +1 -1
  52. package/dist/esm/components/auth/authorize/enforcers/casbin.enforcer.d.ts.map +1 -1
  53. package/dist/esm/components/auth/authorize/enforcers/casbin.enforcer.js +9 -3
  54. package/dist/esm/components/auth/authorize/enforcers/casbin.enforcer.js.map +1 -1
  55. package/dist/esm/components/auth/models/entities/columns.d.ts +99 -0
  56. package/dist/esm/components/auth/models/entities/columns.d.ts.map +1 -0
  57. package/dist/esm/components/auth/models/entities/columns.js +133 -0
  58. package/dist/esm/components/auth/models/entities/columns.js.map +1 -0
  59. package/dist/esm/components/auth/models/entities/index.d.ts +1 -2
  60. package/dist/esm/components/auth/models/entities/index.d.ts.map +1 -1
  61. package/dist/esm/components/auth/models/entities/index.js +1 -2
  62. package/dist/esm/components/auth/models/entities/index.js.map +1 -1
  63. package/dist/esm/components/auth/models/entities/permission.model.d.ts +1 -12
  64. package/dist/esm/components/auth/models/entities/permission.model.d.ts.map +1 -1
  65. package/dist/esm/components/auth/models/entities/permission.model.js +1 -36
  66. package/dist/esm/components/auth/models/entities/permission.model.js.map +1 -1
  67. package/dist/esm/components/auth/models/entities/policy-definition.model.d.ts +1 -49
  68. package/dist/esm/components/auth/models/entities/policy-definition.model.d.ts.map +1 -1
  69. package/dist/esm/components/auth/models/entities/policy-definition.model.js +1 -69
  70. package/dist/esm/components/auth/models/entities/policy-definition.model.js.map +1 -1
  71. package/dist/esm/components/controller/grpc/grpc.component.js +2 -2
  72. package/dist/esm/components/controller/grpc/grpc.component.js.map +1 -1
  73. package/dist/esm/components/health-check/component.d.ts.map +1 -1
  74. package/dist/esm/components/health-check/component.js +5 -3
  75. package/dist/esm/components/health-check/component.js.map +1 -1
  76. package/dist/esm/components/health-check/controller.js +5 -5
  77. package/dist/esm/components/health-check/controller.js.map +1 -1
  78. package/dist/esm/components/index.d.ts +0 -1
  79. package/dist/esm/components/index.d.ts.map +1 -1
  80. package/dist/esm/components/index.js +0 -1
  81. package/dist/esm/components/index.js.map +1 -1
  82. package/dist/esm/components/mail/helpers/executors/bull-mq-executor.helper.d.ts.map +1 -1
  83. package/dist/esm/components/mail/helpers/executors/bull-mq-executor.helper.js +2 -1
  84. package/dist/esm/components/mail/helpers/executors/bull-mq-executor.helper.js.map +1 -1
  85. package/dist/esm/components/mail/helpers/transporters/amazon-ses-transporter.helper.d.ts.map +1 -1
  86. package/dist/esm/components/mail/helpers/transporters/amazon-ses-transporter.helper.js +13 -9
  87. package/dist/esm/components/mail/helpers/transporters/amazon-ses-transporter.helper.js.map +1 -1
  88. package/dist/esm/components/mail/helpers/transporters/mailgun-transporter.helper.d.ts.map +1 -1
  89. package/dist/esm/components/mail/helpers/transporters/mailgun-transporter.helper.js +5 -3
  90. package/dist/esm/components/mail/helpers/transporters/mailgun-transporter.helper.js.map +1 -1
  91. package/dist/esm/components/mail/helpers/transporters/nodemail-transporter.helper.d.ts.map +1 -1
  92. package/dist/esm/components/mail/helpers/transporters/nodemail-transporter.helper.js +9 -7
  93. package/dist/esm/components/mail/helpers/transporters/nodemail-transporter.helper.js.map +1 -1
  94. package/dist/esm/components/mail/services/generators/verification-data.d.ts.map +1 -1
  95. package/dist/esm/components/mail/services/generators/verification-data.js +7 -3
  96. package/dist/esm/components/mail/services/generators/verification-data.js.map +1 -1
  97. package/dist/esm/components/mail/services/mail.service.d.ts.map +1 -1
  98. package/dist/esm/components/mail/services/mail.service.js +12 -9
  99. package/dist/esm/components/mail/services/mail.service.js.map +1 -1
  100. package/dist/esm/components/mail/utilities/address.utility.d.ts +12 -8
  101. package/dist/esm/components/mail/utilities/address.utility.d.ts.map +1 -1
  102. package/dist/esm/components/mail/utilities/address.utility.js +30 -27
  103. package/dist/esm/components/mail/utilities/address.utility.js.map +1 -1
  104. package/dist/esm/components/mail/utilities/attachment.utility.d.ts +31 -29
  105. package/dist/esm/components/mail/utilities/attachment.utility.d.ts.map +1 -1
  106. package/dist/esm/components/mail/utilities/attachment.utility.js +94 -86
  107. package/dist/esm/components/mail/utilities/attachment.utility.js.map +1 -1
  108. package/dist/esm/components/mail/utilities/body.utility.d.ts +6 -4
  109. package/dist/esm/components/mail/utilities/body.utility.d.ts.map +1 -1
  110. package/dist/esm/components/mail/utilities/body.utility.js +14 -12
  111. package/dist/esm/components/mail/utilities/body.utility.js.map +1 -1
  112. package/dist/esm/components/mail/utilities/mime.utility.d.ts +23 -17
  113. package/dist/esm/components/mail/utilities/mime.utility.d.ts.map +1 -1
  114. package/dist/esm/components/mail/utilities/mime.utility.js +109 -98
  115. package/dist/esm/components/mail/utilities/mime.utility.js.map +1 -1
  116. package/dist/esm/components/mail/utilities/verification.utility.d.ts +8 -2
  117. package/dist/esm/components/mail/utilities/verification.utility.d.ts.map +1 -1
  118. package/dist/esm/components/mail/utilities/verification.utility.js +7 -5
  119. package/dist/esm/components/mail/utilities/verification.utility.js.map +1 -1
  120. package/dist/esm/components/socket-io/component.js +3 -3
  121. package/dist/esm/components/socket-io/component.js.map +1 -1
  122. package/dist/esm/components/socket-io/handlers/bun.handler.d.ts +13 -11
  123. package/dist/esm/components/socket-io/handlers/bun.handler.d.ts.map +1 -1
  124. package/dist/esm/components/socket-io/handlers/bun.handler.js +32 -30
  125. package/dist/esm/components/socket-io/handlers/bun.handler.js.map +1 -1
  126. package/dist/esm/components/static-asset/common/commit-token.d.ts +21 -16
  127. package/dist/esm/components/static-asset/common/commit-token.d.ts.map +1 -1
  128. package/dist/esm/components/static-asset/common/commit-token.js +35 -28
  129. package/dist/esm/components/static-asset/common/commit-token.js.map +1 -1
  130. package/dist/esm/components/static-asset/common/constants.d.ts +0 -2
  131. package/dist/esm/components/static-asset/common/constants.d.ts.map +1 -1
  132. package/dist/esm/components/static-asset/common/constants.js +1 -3
  133. package/dist/esm/components/static-asset/common/constants.js.map +1 -1
  134. package/dist/esm/components/static-asset/common/types.d.ts +0 -4
  135. package/dist/esm/components/static-asset/common/types.d.ts.map +1 -1
  136. package/dist/esm/components/static-asset/common/types.js.map +1 -1
  137. package/dist/esm/components/static-asset/component.js +2 -2
  138. package/dist/esm/components/static-asset/component.js.map +1 -1
  139. package/dist/esm/components/static-asset/controller/base.definition.d.ts +6 -6
  140. package/dist/esm/components/static-asset/controller/base.definition.d.ts.map +1 -1
  141. package/dist/esm/components/static-asset/controller/base.definition.js +224 -224
  142. package/dist/esm/components/static-asset/controller/base.definition.js.map +1 -1
  143. package/dist/esm/components/static-asset/controller/factory.d.ts +23 -23
  144. package/dist/esm/components/static-asset/controller/factory.d.ts.map +1 -1
  145. package/dist/esm/components/static-asset/controller/factory.js +104 -74
  146. package/dist/esm/components/static-asset/controller/factory.js.map +1 -1
  147. package/dist/esm/components/static-asset/controller/key-scope.d.ts +28 -26
  148. package/dist/esm/components/static-asset/controller/key-scope.d.ts.map +1 -1
  149. package/dist/esm/components/static-asset/controller/key-scope.js +34 -30
  150. package/dist/esm/components/static-asset/controller/key-scope.js.map +1 -1
  151. package/dist/esm/components/static-asset/controller/meta-link.d.ts +37 -33
  152. package/dist/esm/components/static-asset/controller/meta-link.d.ts.map +1 -1
  153. package/dist/esm/components/static-asset/controller/meta-link.js +86 -84
  154. package/dist/esm/components/static-asset/controller/meta-link.js.map +1 -1
  155. package/dist/esm/components/static-asset/controller/route-options.d.ts +18 -16
  156. package/dist/esm/components/static-asset/controller/route-options.d.ts.map +1 -1
  157. package/dist/esm/components/static-asset/controller/route-options.js +28 -26
  158. package/dist/esm/components/static-asset/controller/route-options.js.map +1 -1
  159. package/dist/esm/components/static-asset/models/base.model.js +3 -3
  160. package/dist/esm/components/static-asset/models/base.model.js.map +1 -1
  161. package/dist/esm/components/websocket/component.js +2 -2
  162. package/dist/esm/components/websocket/component.js.map +1 -1
  163. package/dist/esm/components/websocket/handlers/bun.handler.d.ts +6 -4
  164. package/dist/esm/components/websocket/handlers/bun.handler.d.ts.map +1 -1
  165. package/dist/esm/components/websocket/handlers/bun.handler.js +21 -19
  166. package/dist/esm/components/websocket/handlers/bun.handler.js.map +1 -1
  167. package/dist/esm/testing/assert-application-boots.d.ts +6 -1
  168. package/dist/esm/testing/assert-application-boots.d.ts.map +1 -1
  169. package/dist/esm/testing/assert-application-boots.js +139 -129
  170. package/dist/esm/testing/assert-application-boots.js.map +1 -1
  171. package/dist/esm/utilities/drizzle-result.utility.d.ts +6 -8
  172. package/dist/esm/utilities/drizzle-result.utility.d.ts.map +1 -1
  173. package/dist/esm/utilities/drizzle-result.utility.js +23 -49
  174. package/dist/esm/utilities/drizzle-result.utility.js.map +1 -1
  175. package/dist/esm/utilities/network.utility.d.ts.map +1 -1
  176. package/dist/esm/utilities/network.utility.js +1 -1
  177. package/dist/esm/utilities/network.utility.js.map +1 -1
  178. package/dist/presets/app/files/src/boot.test.ts +2 -2
  179. package/dist/presets/app/files/src/controllers/hello.controller.ts +2 -2
  180. package/dist/presets/app/preset.json +4 -4
  181. package/dist/presets/lib/preset.json +4 -4
  182. package/dist/presets/shared/files/.configs/formatters/.ignore +4 -0
  183. package/dist/presets/shared/files/.configs/lints/.ignore +4 -0
  184. package/dist/presets/shared/files/.configs/lints/eslint.config.mjs +4 -0
  185. package/dist/presets/shared/files/.configs/lints/oxlint.config.mts +4 -0
  186. package/dist/presets/shared/files/README.md +15 -0
  187. package/dist/presets/shared/files/src/index.test.ts +8 -0
  188. package/dist/presets/shared/files/src/index.ts +8 -0
  189. package/dist/presets/shared/files/tsconfig.json +20 -0
  190. package/dist/presets/shared/preset.json +35 -0
  191. package/package.json +11 -11
  192. package/dist/esm/components/auth/models/entities/role.model.d.ts +0 -10
  193. package/dist/esm/components/auth/models/entities/role.model.d.ts.map +0 -1
  194. package/dist/esm/components/auth/models/entities/role.model.js +0 -15
  195. package/dist/esm/components/auth/models/entities/role.model.js.map +0 -1
  196. package/dist/esm/components/auth/models/entities/user.model.d.ts +0 -28
  197. package/dist/esm/components/auth/models/entities/user.model.d.ts.map +0 -1
  198. package/dist/esm/components/auth/models/entities/user.model.js +0 -17
  199. package/dist/esm/components/auth/models/entities/user.model.js.map +0 -1
  200. package/dist/esm/components/controller/index.d.ts +0 -2
  201. package/dist/esm/components/controller/index.d.ts.map +0 -1
  202. package/dist/esm/components/controller/index.js +0 -7
  203. package/dist/esm/components/controller/index.js.map +0 -1
@@ -1,32 +1,34 @@
1
- export async function createBunEngine(opts) {
2
- const { serverOptions } = opts;
3
- const { Server: BunEngine } = await import('@socket.io/bun-engine');
4
- // Extract cors fields explicitly to bridge socket.io/bun-engine type differences
5
- const corsConfig = typeof serverOptions.cors === 'object' ? serverOptions.cors : undefined;
6
- const engine = new BunEngine({
7
- path: serverOptions.path ?? '/socket.io/',
8
- ...(corsConfig && {
9
- cors: {
10
- origin: corsConfig.origin,
11
- methods: corsConfig.methods,
12
- credentials: corsConfig.credentials,
13
- allowedHeaders: corsConfig.allowedHeaders,
14
- exposedHeaders: corsConfig.exposedHeaders,
15
- maxAge: corsConfig.maxAge,
16
- },
17
- }),
18
- });
19
- const engineHandler = engine.handler();
20
- return { engine, engineHandler };
21
- }
22
- export function createBunFetchHandler(opts) {
23
- const { engine, enginePath, honoServer } = opts;
24
- return (req, server) => {
25
- const url = new URL(req.url);
26
- if (!url.pathname.startsWith(enginePath)) {
27
- return honoServer.fetch(req, server);
28
- }
29
- return engine.handleRequest(req, server) ?? new Response(null, { status: 404 });
30
- };
1
+ export class SocketIOBunHandler {
2
+ static async createEngine(opts) {
3
+ const { serverOptions } = opts;
4
+ const { Server: BunEngine } = await import('@socket.io/bun-engine');
5
+ // Extract cors fields explicitly to bridge socket.io/bun-engine type differences
6
+ const corsConfig = typeof serverOptions.cors === 'object' ? serverOptions.cors : undefined;
7
+ const engine = new BunEngine({
8
+ path: serverOptions.path ?? '/socket.io/',
9
+ ...(corsConfig && {
10
+ cors: {
11
+ origin: corsConfig.origin,
12
+ methods: corsConfig.methods,
13
+ credentials: corsConfig.credentials,
14
+ allowedHeaders: corsConfig.allowedHeaders,
15
+ exposedHeaders: corsConfig.exposedHeaders,
16
+ maxAge: corsConfig.maxAge,
17
+ },
18
+ }),
19
+ });
20
+ const engineHandler = engine.handler();
21
+ return { engine, engineHandler };
22
+ }
23
+ static createFetchHandler(opts) {
24
+ const { engine, enginePath, honoServer } = opts;
25
+ return (req, server) => {
26
+ const url = new URL(req.url);
27
+ if (!url.pathname.startsWith(enginePath)) {
28
+ return honoServer.fetch(req, server);
29
+ }
30
+ return engine.handleRequest(req, server) ?? new Response(null, { status: 404 });
31
+ };
32
+ }
31
33
  }
32
34
  //# sourceMappingURL=bun.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bun.handler.js","sourceRoot":"","sources":["../../../../../src/components/socket-io/handlers/bun.handler.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAErC;IACC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAEpE,iFAAiF;IACjF,MAAM,UAAU,GAAG,OAAO,aAAa,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,aAAa,CAAC,IAAI,IAAI,aAAa;QACzC,GAAG,CAAC,UAAU,IAAI;YAChB,IAAI,EAAE;gBACJ,MAAM,EAAE,UAAU,CAAC,MAA2D;gBAC9E,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,cAAc,EAAE,UAAU,CAAC,cAAc;gBACzC,cAAc,EAAE,UAAU,CAAC,cAAc;gBACzC,MAAM,EAAE,UAAU,CAAC,MAAM;aAC1B;SACF,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAEvC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAIrC;IACC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAEhD,OAAO,CAAC,GAAY,EAAE,MAA0B,EAAgC,EAAE;QAChF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAE7B,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAClF,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { OpenAPIHono } from '@hono/zod-openapi';\nimport type { TBunServerInstance } from '@/base/applications';\nimport type { ServerOptions } from 'socket.io';\n\nexport async function createBunEngine(opts: {\n serverOptions: Partial<ServerOptions>;\n}): Promise<{ engine: any; engineHandler: any }> {\n const { serverOptions } = opts;\n const { Server: BunEngine } = await import('@socket.io/bun-engine');\n\n // Extract cors fields explicitly to bridge socket.io/bun-engine type differences\n const corsConfig = typeof serverOptions.cors === 'object' ? serverOptions.cors : undefined;\n const engine = new BunEngine({\n path: serverOptions.path ?? '/socket.io/',\n ...(corsConfig && {\n cors: {\n origin: corsConfig.origin as string | RegExp | (string | RegExp)[] | undefined,\n methods: corsConfig.methods,\n credentials: corsConfig.credentials,\n allowedHeaders: corsConfig.allowedHeaders,\n exposedHeaders: corsConfig.exposedHeaders,\n maxAge: corsConfig.maxAge,\n },\n }),\n });\n\n const engineHandler = engine.handler();\n\n return { engine, engineHandler };\n}\n\nexport function createBunFetchHandler(opts: {\n engine: any;\n enginePath: string;\n honoServer: OpenAPIHono;\n}): (req: Request, server: TBunServerInstance) => Response | Promise<Response> {\n const { engine, enginePath, honoServer } = opts;\n\n return (req: Request, server: TBunServerInstance): Response | Promise<Response> => {\n const url = new URL(req.url);\n\n if (!url.pathname.startsWith(enginePath)) {\n return honoServer.fetch(req, server);\n }\n\n return engine.handleRequest(req, server) ?? new Response(null, { status: 404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C,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBACzC,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACvC,CAAC;YAED,OAAO,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QAClF,CAAC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { OpenAPIHono } from '@hono/zod-openapi';\nimport type { TBunServerInstance } from '@/base/applications';\nimport type { ServerOptions } from 'socket.io';\n\nexport class SocketIOBunHandler {\n static async createEngine(opts: {\n serverOptions: Partial<ServerOptions>;\n }): Promise<{ engine: any; engineHandler: any }> {\n const { serverOptions } = opts;\n const { Server: BunEngine } = await import('@socket.io/bun-engine');\n\n // Extract cors fields explicitly to bridge socket.io/bun-engine type differences\n const corsConfig = typeof serverOptions.cors === 'object' ? serverOptions.cors : undefined;\n const engine = new BunEngine({\n path: serverOptions.path ?? '/socket.io/',\n ...(corsConfig && {\n cors: {\n origin: corsConfig.origin as string | RegExp | (string | RegExp)[] | undefined,\n methods: corsConfig.methods,\n credentials: corsConfig.credentials,\n allowedHeaders: corsConfig.allowedHeaders,\n exposedHeaders: corsConfig.exposedHeaders,\n maxAge: corsConfig.maxAge,\n },\n }),\n });\n\n const engineHandler = engine.handler();\n\n return { engine, engineHandler };\n }\n\n static createFetchHandler(opts: {\n engine: any;\n enginePath: string;\n honoServer: OpenAPIHono;\n }): (req: Request, server: TBunServerInstance) => Response | Promise<Response> {\n const { engine, enginePath, honoServer } = opts;\n\n return (req: Request, server: TBunServerInstance): Response | Promise<Response> => {\n const url = new URL(req.url);\n\n if (!url.pathname.startsWith(enginePath)) {\n return honoServer.fetch(req, server);\n }\n\n return engine.handleRequest(req, server) ?? new Response(null, { status: 404 });\n };\n }\n}\n"]}
@@ -4,20 +4,25 @@ export interface ICommitTokenPayload {
4
4
  key: string;
5
5
  expiresAt: number;
6
6
  }
7
- /** Signs `{ bucket, key, expiresAt }` so the commit route can trust the key it is handed. */
8
- export declare const buildCommitToken: (opts: {
9
- payload: ICommitTokenPayload;
10
- secretKey: string;
11
- }) => string;
12
- /**
13
- * Reads a commit token back, or throws.
14
- *
15
- * Verification happens BEFORE any storage call, which is what makes the commit route refuse to be a
16
- * name prober: a forged token fails without a round trip, so timing says nothing about what exists.
17
- */
18
- export declare const readCommitToken: (opts: {
19
- token: string;
20
- secretKey: string;
21
- now?: number;
22
- }) => ICommitTokenPayload;
7
+ /** Signs and reads the token the commit route trusts instead of a key a caller names. */
8
+ export declare class AssetCommitToken {
9
+ private static encode;
10
+ private static sign;
11
+ /** Signs `{ bucket, key, expiresAt }` so the commit route can trust the key it is handed. */
12
+ static build(opts: {
13
+ payload: ICommitTokenPayload;
14
+ secretKey: string;
15
+ }): string;
16
+ /**
17
+ * Reads a commit token back, or throws.
18
+ *
19
+ * Verification happens BEFORE any storage call, which is what makes the commit route refuse to be a
20
+ * name prober: a forged token fails without a round trip, so timing says nothing about what exists.
21
+ */
22
+ static read(opts: {
23
+ token: string;
24
+ secretKey: string;
25
+ now?: number;
26
+ }): ICommitTokenPayload;
27
+ }
23
28
  //# sourceMappingURL=commit-token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commit-token.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/commit-token.ts"],"names":[],"mappings":"AAIA,yNAAyN;AACzN,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAQD,6FAA6F;AAC7F,eAAO,MAAM,gBAAgB,GAAI,MAAM;IACrC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB,KAAG,MAGH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,KAAG,mBAsBH,CAAC"}
1
+ {"version":3,"file":"commit-token.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/commit-token.ts"],"names":[],"mappings":"AAIA,yNAAyN;AACzN,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yFAAyF;AACzF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,MAAM;IAIrB,OAAO,CAAC,MAAM,CAAC,IAAI;IAInB,6FAA6F;IAC7F,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,mBAAmB,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAK/E;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,mBAAmB;CAyB3F"}
@@ -1,35 +1,42 @@
1
1
  import { getError } from '@venizia/ignis-helpers/core';
2
2
  import { createHmac, timingSafeEqual } from 'node:crypto';
3
3
  import { StaticAssetErrors } from './errors.js';
4
- const encode = (payload) => Buffer.from(JSON.stringify(payload)).toString('base64url');
5
- const sign = (opts) => createHmac('sha256', opts.secretKey).update(opts.body).digest('base64url');
6
- /** Signs `{ bucket, key, expiresAt }` so the commit route can trust the key it is handed. */
7
- export const buildCommitToken = (opts) => {
8
- const body = encode(opts.payload);
9
- return `${body}.${sign({ body, secretKey: opts.secretKey })}`;
10
- };
11
- /**
12
- * Reads a commit token back, or throws.
13
- *
14
- * Verification happens BEFORE any storage call, which is what makes the commit route refuse to be a
15
- * name prober: a forged token fails without a round trip, so timing says nothing about what exists.
16
- */
17
- export const readCommitToken = (opts) => {
18
- const { token, secretKey, now = Date.now() } = opts;
19
- const [body, signature] = token.split('.');
20
- if (!body || !signature) {
21
- throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);
4
+ /** Signs and reads the token the commit route trusts instead of a key a caller names. */
5
+ export class AssetCommitToken {
6
+ static encode(payload) {
7
+ return Buffer.from(JSON.stringify(payload)).toString('base64url');
22
8
  }
23
- const expected = Buffer.from(sign({ body, secretKey }));
24
- const given = Buffer.from(signature);
25
- // Length-checked first: `timingSafeEqual` throws on a length mismatch instead of answering false.
26
- if (expected.length !== given.length || !timingSafeEqual(expected, given)) {
27
- throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);
9
+ static sign(opts) {
10
+ return createHmac('sha256', opts.secretKey).update(opts.body).digest('base64url');
28
11
  }
29
- const payload = JSON.parse(Buffer.from(body, 'base64url').toString('utf8'));
30
- if (payload.expiresAt <= now) {
31
- throw getError(StaticAssetErrors.EXPIRED_COMMIT_TOKEN);
12
+ /** Signs `{ bucket, key, expiresAt }` so the commit route can trust the key it is handed. */
13
+ static build(opts) {
14
+ const body = AssetCommitToken.encode(opts.payload);
15
+ return `${body}.${AssetCommitToken.sign({ body, secretKey: opts.secretKey })}`;
32
16
  }
33
- return payload;
34
- };
17
+ /**
18
+ * Reads a commit token back, or throws.
19
+ *
20
+ * Verification happens BEFORE any storage call, which is what makes the commit route refuse to be a
21
+ * name prober: a forged token fails without a round trip, so timing says nothing about what exists.
22
+ */
23
+ static read(opts) {
24
+ const { token, secretKey, now = Date.now() } = opts;
25
+ const [body, signature] = token.split('.');
26
+ if (!body || !signature) {
27
+ throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);
28
+ }
29
+ const expected = Buffer.from(AssetCommitToken.sign({ body, secretKey }));
30
+ const given = Buffer.from(signature);
31
+ // Length-checked first: `timingSafeEqual` throws on a length mismatch instead of answering false.
32
+ if (expected.length !== given.length || !timingSafeEqual(expected, given)) {
33
+ throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);
34
+ }
35
+ const payload = JSON.parse(Buffer.from(body, 'base64url').toString('utf8'));
36
+ if (payload.expiresAt <= now) {
37
+ throw getError(StaticAssetErrors.EXPIRED_COMMIT_TOKEN);
38
+ }
39
+ return payload;
40
+ }
41
+ }
35
42
  //# sourceMappingURL=commit-token.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commit-token.js","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/commit-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAS7C,MAAM,MAAM,GAAG,CAAC,OAA4B,EAAU,EAAE,CACtD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE7D,MAAM,IAAI,GAAG,CAAC,IAAyC,EAAU,EAAE,CACjE,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7E,6FAA6F;AAC7F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAGhC,EAAU,EAAE;IACX,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;AAChE,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAI/B,EAAuB,EAAE;IACxB,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IACpD,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3C,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACxB,MAAM,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAErC,kGAAkG;IAClG,IAAI,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;QAC1E,MAAM,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,OAAO,GAAwB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,IAAI,OAAO,CAAC,SAAS,IAAI,GAAG,EAAE,CAAC;QAC7B,MAAM,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { getError } from '@venizia/ignis-helpers/core';\nimport { createHmac, timingSafeEqual } from 'node:crypto';\nimport { StaticAssetErrors } from './errors';\n\n/** What a commit token binds. Business fields are deliberately absent - which order or tenant an upload belongs to is the application's, and a token the framework signs is the wrong place to put its authorization. */\nexport interface ICommitTokenPayload {\n bucket: string;\n key: string;\n expiresAt: number;\n}\n\nconst encode = (payload: ICommitTokenPayload): string =>\n Buffer.from(JSON.stringify(payload)).toString('base64url');\n\nconst sign = (opts: { body: string; secretKey: string }): string =>\n createHmac('sha256', opts.secretKey).update(opts.body).digest('base64url');\n\n/** Signs `{ bucket, key, expiresAt }` so the commit route can trust the key it is handed. */\nexport const buildCommitToken = (opts: {\n payload: ICommitTokenPayload;\n secretKey: string;\n}): string => {\n const body = encode(opts.payload);\n return `${body}.${sign({ body, secretKey: opts.secretKey })}`;\n};\n\n/**\n * Reads a commit token back, or throws.\n *\n * Verification happens BEFORE any storage call, which is what makes the commit route refuse to be a\n * name prober: a forged token fails without a round trip, so timing says nothing about what exists.\n */\nexport const readCommitToken = (opts: {\n token: string;\n secretKey: string;\n now?: number;\n}): ICommitTokenPayload => {\n const { token, secretKey, now = Date.now() } = opts;\n const [body, signature] = token.split('.');\n\n if (!body || !signature) {\n throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);\n }\n\n const expected = Buffer.from(sign({ body, secretKey }));\n const given = Buffer.from(signature);\n\n // Length-checked first: `timingSafeEqual` throws on a length mismatch instead of answering false.\n if (expected.length !== given.length || !timingSafeEqual(expected, given)) {\n throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);\n }\n\n const payload: ICommitTokenPayload = JSON.parse(Buffer.from(body, 'base64url').toString('utf8'));\n if (payload.expiresAt <= now) {\n throw getError(StaticAssetErrors.EXPIRED_COMMIT_TOKEN);\n }\n\n return payload;\n};\n"]}
1
+ {"version":3,"file":"commit-token.js","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/commit-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAS7C,yFAAyF;AACzF,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAC,MAAM,CAAC,O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,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;YAC1E,MAAM,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,OAAO,GAAwB,IAAI,CAAC,KAAK,CAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAChD,CAAC;QACF,IAAI,OAAO,CAAC,SAAS,IAAI,GAAG,EAAE,CAAC;YAC7B,MAAM,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { getError } from '@venizia/ignis-helpers/core';\nimport { createHmac, timingSafeEqual } from 'node:crypto';\nimport { StaticAssetErrors } from './errors';\n\n/** What a commit token binds. Business fields are deliberately absent - which order or tenant an upload belongs to is the application's, and a token the framework signs is the wrong place to put its authorization. */\nexport interface ICommitTokenPayload {\n bucket: string;\n key: string;\n expiresAt: number;\n}\n\n/** Signs and reads the token the commit route trusts instead of a key a caller names. */\nexport class AssetCommitToken {\n private static encode(payload: ICommitTokenPayload): string {\n return Buffer.from(JSON.stringify(payload)).toString('base64url');\n }\n\n private static sign(opts: { body: string; secretKey: string }): string {\n return createHmac('sha256', opts.secretKey).update(opts.body).digest('base64url');\n }\n\n /** Signs `{ bucket, key, expiresAt }` so the commit route can trust the key it is handed. */\n static build(opts: { payload: ICommitTokenPayload; secretKey: string }): string {\n const body = AssetCommitToken.encode(opts.payload);\n return `${body}.${AssetCommitToken.sign({ body, secretKey: opts.secretKey })}`;\n }\n\n /**\n * Reads a commit token back, or throws.\n *\n * Verification happens BEFORE any storage call, which is what makes the commit route refuse to be a\n * name prober: a forged token fails without a round trip, so timing says nothing about what exists.\n */\n static read(opts: { token: string; secretKey: string; now?: number }): ICommitTokenPayload {\n const { token, secretKey, now = Date.now() } = opts;\n const [body, signature] = token.split('.');\n\n if (!body || !signature) {\n throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);\n }\n\n const expected = Buffer.from(AssetCommitToken.sign({ body, secretKey }));\n const given = Buffer.from(signature);\n\n // Length-checked first: `timingSafeEqual` throws on a length mismatch instead of answering false.\n if (expected.length !== given.length || !timingSafeEqual(expected, given)) {\n throw getError(StaticAssetErrors.INVALID_COMMIT_TOKEN);\n }\n\n const payload: ICommitTokenPayload = JSON.parse(\n Buffer.from(body, 'base64url').toString('utf8'),\n );\n if (payload.expiresAt <= now) {\n throw getError(StaticAssetErrors.EXPIRED_COMMIT_TOKEN);\n }\n\n return payload;\n }\n}\n"]}
@@ -9,8 +9,6 @@ export declare const WHITELIST_HEADERS: readonly ["content-encoding", "cache-con
9
9
  export declare const RENDERABLE_CONTENT_TYPES: Set<string>;
10
10
  export declare class StaticAssetStorageTypes {
11
11
  static readonly DISK = "disk";
12
- /** @deprecated Use {@link StaticAssetStorageTypes.BUN_S3}, which reaches MinIO over the same S3 API. */
13
- static readonly MINIO = "minio";
14
12
  static readonly BUN_S3 = "bun-s3";
15
13
  static readonly SCHEME_SET: Set<string>;
16
14
  static isValid(orgType: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGjE,uGAAuG;AACvG,eAAO,MAAM,iBAAiB,yEAKpB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAgBnC,CAAC;AAEH,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,wGAAwG;IACxG,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAElC,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAiD;IAE3E,MAAM,CAAC,OAAO,C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AU,cAA2C;IAErE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AAED,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAElF,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,aAAa,CAAC;AAEjD,2LAA2L;AAC3L,eAAO,MAAM,uBAAuB,4BAA4B,CAAC"}
@@ -30,10 +30,8 @@ export const RENDERABLE_CONTENT_TYPES = new Set([
30
30
  ]);
31
31
  export class StaticAssetStorageTypes {
32
32
  static { this.DISK = 'disk'; }
33
- /** @deprecated Use {@link StaticAssetStorageTypes.BUN_S3}, which reaches MinIO over the same S3 API. */
34
- static { this.MINIO = 'minio'; }
35
33
  static { this.BUN_S3 = 'bun-s3'; }
36
- static { this.SCHEME_SET = new Set([this.DISK, this.MINIO, this.BUN_S3]); }
34
+ static { this.SCHEME_SET = new Set([this.DISK, this.BUN_S3]); }
37
35
  static isValid(orgType) {
38
36
  return this.SCHEME_SET.has(orgType);
39
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,uGAAuG;AACvG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,CAAC,OAAO,CAAC,gBAAgB;IAC7B,IAAI,CAAC,OAAO,CAAC,aAAa;IAC1B,IAAI,CAAC,OAAO,CAAC,IAAI;IACjB,IAAI,CAAC,OAAO,CAAC,aAAa;CAClB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAS;IACtD,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,cAAc;IACd,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,YAAY;IACZ,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,OAAO,uBAAuB;aAClB,SAAI,GAAG,MAAM,CAAC;IAC9B,wGAAwG;aACxF,UAAK,GAAG,OAAO,CAAC;aAChB,WAAM,GAAG,QAAQ,CAAC;aAElB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE3E,MAAM,CAAC,OAAO,CAAC,OAAe;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;;AAKH,+FAA+F;AAC/F,MAAM,OAAO,uBAAuB;aAClB,YAAO,GAAG,SAAS,CAAC;aACpB,cAAS,GAAG,WAAW,CAAC;aAExB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAErE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAKH,yHAAyH;AACzH,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAEjD,2LAA2L;AAC3L,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC","sourcesContent":["import type { TConstValue } from '@venizia/ignis-helpers/common';\nimport { HTTP } from '@venizia/ignis-helpers/common';\n\n/** `content-type` is absent on purpose: it is decided from the object name, never from the backend. */\nexport const WHITELIST_HEADERS = [\n HTTP.Headers.CONTENT_ENCODING,\n HTTP.Headers.CACHE_CONTROL,\n HTTP.Headers.ETAG,\n HTTP.Headers.LAST_MODIFIED,\n] as const;\n\n/**\n * Types the controller will let a browser render, keyed off the object name. Anything absent here is\n * served as an attachment, because a renderable upload on the API origin is stored XSS - and `nosniff`\n * cannot stop a type we declared ourselves. `image/svg+xml` is deliberately excluded: SVG carries script.\n */\nexport const RENDERABLE_CONTENT_TYPES = new Set<string>([\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/avif',\n 'image/bmp',\n 'image/x-icon',\n 'video/mp4',\n 'video/webm',\n 'audio/mpeg',\n 'audio/wav',\n 'audio/ogg',\n 'application/pdf',\n 'text/plain',\n 'text/csv',\n]);\n\nexport class StaticAssetStorageTypes {\n static readonly DISK = 'disk';\n /** @deprecated Use {@link StaticAssetStorageTypes.BUN_S3}, which reaches MinIO over the same S3 API. */\n static readonly MINIO = 'minio';\n static readonly BUN_S3 = 'bun-s3';\n\n static readonly SCHEME_SET = new Set([this.DISK, this.MINIO, this.BUN_S3]);\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\nexport type TStaticAssetStorageType = TConstValue<typeof StaticAssetStorageTypes>;\n\n/** What `recreate-metalink` did: refreshed the rows of an object, or created its first one. */\nexport class MetaLinkRecreateActions {\n static readonly CREATED = 'created';\n static readonly REFRESHED = 'refreshed';\n\n static readonly SCHEME_SET = new Set([this.CREATED, this.REFRESHED]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\nexport type TMetaLinkRecreateAction = TConstValue<typeof MetaLinkRecreateActions>;\n\n/** Where a signed policy may write. The final key is never inside it, so content cannot be replaced after the commit. */\nexport const DEFAULT_PENDING_PREFIX = 'pending/';\n\n/** Reported in the body, never thrown: the bytes are stored, only the row is not. A CODE, because a 200 bypasses the middleware that strips the driver's `detail`/`table`/`constraint`. */\nexport const META_LINK_CREATE_FAILED = 'META_LINK_CREATE_FAILED';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,uGAAuG;AACvG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,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izia/ignis-helpers/common';\n\n/** `content-type` is absent on purpose: it is decided from the object name, never from the backend. */\nexport const WHITELIST_HEADERS = [\n HTTP.Headers.CONTENT_ENCODING,\n HTTP.Headers.CACHE_CONTROL,\n HTTP.Headers.ETAG,\n HTTP.Headers.LAST_MODIFIED,\n] as const;\n\n/**\n * Types the controller will let a browser render, keyed off the object name. Anything absent here is\n * served as an attachment, because a renderable upload on the API origin is stored XSS - and `nosniff`\n * cannot stop a type we declared ourselves. `image/svg+xml` is deliberately excluded: SVG carries script.\n */\nexport const RENDERABLE_CONTENT_TYPES = new Set<string>([\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/avif',\n 'image/bmp',\n 'image/x-icon',\n 'video/mp4',\n 'video/webm',\n 'audio/mpeg',\n 'audio/wav',\n 'audio/ogg',\n 'application/pdf',\n 'text/plain',\n 'text/csv',\n]);\n\nexport class StaticAssetStorageTypes {\n static readonly DISK = 'disk';\n static readonly BUN_S3 = 'bun-s3';\n\n static readonly SCHEME_SET = new Set([this.DISK, this.BUN_S3]);\n\n static isValid(orgType: string): boolean {\n return this.SCHEME_SET.has(orgType);\n }\n}\n\nexport type TStaticAssetStorageType = TConstValue<typeof StaticAssetStorageTypes>;\n\n/** What `recreate-metalink` did: refreshed the rows of an object, or created its first one. */\nexport class MetaLinkRecreateActions {\n static readonly CREATED = 'created';\n static readonly REFRESHED = 'refreshed';\n\n static readonly SCHEME_SET = new Set([this.CREATED, this.REFRESHED]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\nexport type TMetaLinkRecreateAction = TConstValue<typeof MetaLinkRecreateActions>;\n\n/** Where a signed policy may write. The final key is never inside it, so content cannot be replaced after the commit. */\nexport const DEFAULT_PENDING_PREFIX = 'pending/';\n\n/** Reported in the body, never thrown: the bytes are stored, only the row is not. A CODE, because a 200 bypasses the middleware that strips the driver's `detail`/`table`/`constraint`. */\nexport const META_LINK_CREATE_FAILED = 'META_LINK_CREATE_FAILED';\n"]}
@@ -5,7 +5,6 @@ import type { DiskHelper, IBucketRef, IFileStat, IObjectLocation, IObjectRef, IS
5
5
  import type { BunS3Helper } from '@venizia/ignis-helpers/bun-s3';
6
6
  import type { AnyType, TValueOrAsyncResolver, ValueOrPromise } from '@venizia/ignis-helpers/common';
7
7
  import type { TMultipartStorage } from '@venizia/ignis-helpers';
8
- import type { MinioHelper } from '@venizia/ignis-helpers/minio';
9
8
  import type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from '../models/index.js';
10
9
  import type { StaticAssetStorageTypes } from './constants.js';
11
10
  export type TStaticAssetExtraOptions = {
@@ -152,9 +151,6 @@ export type TStaticAssetsComponentOptions<Schema extends TMetaLinkCompatibleSche
152
151
  } | {
153
152
  storage: typeof StaticAssetStorageTypes.DISK;
154
153
  helper: DiskHelper;
155
- } | {
156
- storage: typeof StaticAssetStorageTypes.MINIO;
157
- helper: MinioHelper;
158
154
  }) & ({
159
155
  useMetaLink?: false | undefined;
160
156
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAClF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,KAAK,E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,yBAAyB,GAAG,eAAe,IACxD;IACF,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,UAAU,EAAE;YACV,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;YACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;YAEnB,qKAAqK;YACrK,aAAa,CAAC,EAAE,OAAO,CAAC;YAExB,6OAA6O;YAC7O,MAAM,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAEvC;;;;;;eAMG;YACH,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB,MAAM,CAAC,EAAE,kBAAkB,CAAC;YAE5B,oPAAoP;YACpP,YAAY,CAAC,EAAE,oBAAoB,CAAC;SACrC,CAAC;QACF,KAAK,CAAC,EAAE,wBAAwB,CAAC;QAEjC,0GAA0G;QAC1G,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;QAExC,gLAAgL;QAChL,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;QAExC,oGAAoG;QACpG,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;KACxC,GAAG,CACA;QAAE,OAAO,EAAE,OAAO,uBAAuB,CAAC,MAAM,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,GACvE;QAAE,OAAO,EAAE,OAAO,uBAAuB,CAAC,IAAI,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,GACpE;QAAE,OAAO,EAAE,OAAO,uBAAuB,CAAC,KAAK,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CACzE,GACC,CACI;QAAE,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,GACnC;QAAE,WAAW,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;KAAE,CAC3D,CAAC;CACL,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/types.ts"],"names":[],"mappings":"AAAA,OAA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AO,EAAE,OAAO,uBAAuB,CAAC,IAAI,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,CACvE,GACC,CACI;QAAE,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,GACnC;QAAE,WAAW,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;KAAE,CAC3D,CAAC;CACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseRestController, IAuthRouteConfig, TRouteContext } from '@/base';\nimport type { IDuration } from '@venizia/ignis-helpers/common';\nimport type {\n BaseRelationalEntity,\n DefaultCRUDRepository,\n TTableObject,\n} from '@venizia/ignis-connectors/postgres';\nimport type {\n DiskHelper,\n IBucketRef,\n IFileStat,\n IObjectLocation,\n IObjectRef,\n IStorageHelper,\n IUploadResult,\n TUploadNaming,\n} from '@venizia/ignis-helpers';\nimport type { BunS3Helper } from '@venizia/ignis-helpers/bun-s3';\nimport type { AnyType, TValueOrAsyncResolver, ValueOrPromise } from '@venizia/ignis-helpers/common';\nimport type { TMultipartStorage } from '@venizia/ignis-helpers';\nimport type { MinioHelper } from '@venizia/ignis-helpers/minio';\nimport type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from '../models';\nimport type { StaticAssetStorageTypes } from './constants';\n\nexport type TStaticAssetExtraOptions = {\n parseMultipartBody?: {\n storage?: TMultipartStorage;\n uploadDir?: string;\n };\n\n /** `folderPath` carries the upload query's target folder - dropping it flattens nested uploads. */\n normalizeNameFn?: (opts: { file: TUploadNaming }) => string;\n normalizeLinkFn?: (opts: IObjectLocation) => string;\n\n /** Maximum folder nesting depth allowed in object paths. Default: 2 */\n maxFolderDepth?: number;\n\n /** Largest file the UPLOAD route accepts. Absent means no ceiling. Checked against `content-length` before spooling, then per file after parsing. */\n maxBytes?: number;\n [key: string]: AnyType;\n};\n\n/** Decides the key one uploaded file is stored under. `defaultKey` is what IGNIS would have written. */\nexport type TObjectNameResolver = (opts: {\n bucket: IBucketRef;\n file: TUploadNaming;\n defaultKey: string;\n}) => string;\n\n/** Adds routes of the application's own to a generated asset controller. Runs after every built-in route, so a built-in route always wins a path collision. `basePath` is the mount path with exactly one leading slash. */\n/** Adds routes of the application's own. Registration order decides a path collision, so the same shape serves both the before and the after hook. */\nexport type TDefineExtraRoutes = (opts: {\n controller: BaseRestController;\n helper: IStorageHelper;\n basePath: string;\n}) => void;\n\n// Declared by hand rather than inferred: RouteHandler inference here is heavy.\nexport type TBucketParams = { bucketName: string };\nexport type TObjectParams = { bucketName: string; objectName: string };\nexport type TUploadQuery = {\n principalType?: string;\n principalId?: string;\n variant?: string;\n /** Display order within the principal. Caller-supplied: deriving it would be a non-atomic read of `max(sequence)` then a write of `max + 1`. */\n sequence?: number;\n folderPath?: string;\n};\nexport type TListQuery = { prefix?: string; recursive?: string; maxKeys?: string };\n\nexport type TDirectUploadOptions = {\n /** Who may ask for a policy. REQUIRED, not defaulted: this route hands out a write credential, and there is no safe default for that. */\n authorize: (opts: { context: TRouteContext }) => ValueOrPromise<boolean>;\n\n /** Signs the commit token. Keep it out of the repository and out of the client. */\n secretKey: string;\n\n /** The ceiling the policy carries as `content-length-range`. A signed PUT cannot express this at all, which is why this is a POST policy. */\n maxBytes: number;\n\n /** Where a policy may write. The final key is NEVER in a policy, so content cannot be replaced after the commit. Default: `pending/`. */\n pendingPrefix?: string;\n\n /** How long a policy and its commit token stay good. Default: the helper's POST default. */\n expiresIn?: IDuration;\n\n /** Runs BEFORE the copy to the final key, so a hook that throws leaves the object under the pending prefix for a lifecycle rule to collect, rather than stranding it at the final key. */\n onCommit?: (opts: {\n bucket: IBucketRef;\n pendingObject: IObjectRef;\n object: IObjectRef;\n }) => ValueOrPromise<void>;\n};\n\nexport type TUploadPolicyRequest = {\n files: Array<{ fileName: string; contentType?: string; size?: number }>;\n};\n\n/** The MetaLink table belongs to the application. `Schema` defaults to the table IGNIS ships, and widens to any table whose row carries the same fields. */\nexport type TMetaLinkConfig<Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema> = {\n model: TValueOrAsyncResolver<typeof BaseRelationalEntity<Schema>>;\n repository: TValueOrAsyncResolver<DefaultCRUDRepository<Schema>>;\n createMetaLink?: (opts: {\n uploadResult: IUploadResult;\n fileStat: IFileStat;\n /** The caller's labels. Named for where they used to travel - they arrive in the request BODY now, as form fields on an upload and beside the commit token on a direct one. */\n query: TUploadQuery;\n }) => ValueOrPromise<{ count: number; data: TTableObject<Schema> }>;\n};\n\n/** The part of a built-in route an application may change. */\nexport type TStaticAssetRouteConfig = Partial<\n Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>\n> & {\n /** Whether this route is registered. Defaults to true. */\n enabled?: boolean;\n};\n\nexport type TStaticAssetRoutes = {\n getBuckets?: TStaticAssetRouteConfig;\n getBucketByName?: TStaticAssetRouteConfig;\n createBucket?: TStaticAssetRouteConfig;\n deleteBucket?: TStaticAssetRouteConfig;\n\n upload?: TStaticAssetRouteConfig;\n listObjects?: TStaticAssetRouteConfig;\n deleteObject?: TStaticAssetRouteConfig;\n getObjectByName?: TStaticAssetRouteConfig;\n downloadObjectByName?: TStaticAssetRouteConfig;\n\n uploadPolicy?: TStaticAssetRouteConfig;\n uploadCommit?: TStaticAssetRouteConfig;\n\n recreateMetaLink?: TStaticAssetRouteConfig;\n};\n\nexport type TStaticAssetsComponentOptions<\n Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema,\n> = {\n [key: string]: {\n controller: {\n name: string;\n basePath: string;\n isStrict?: boolean;\n\n /** `true` serves a raw nested object path (`/objects/photos/2024/f.jpg`) - a URL shape change; a percent-encoded path keeps working either way. Default: `false`. */\n rawObjectPath?: boolean;\n\n /** The single bucket every object route uses. It leaves the URL (`/objects/{objectName}`) and the four bucket-management routes are not registered. The function form is read per request, so an environment variable can be read lazily. */\n bucket?: TValueOrAsyncResolver<string>;\n\n /**\n * The key scope this controller owns, e.g. `inventory/`. Every route refuses a key outside it\n * as a 404 without calling the storage, `listObjects` lists only inside it, and an upload key\n * must land inside it: the default name is placed there, a `resolveObjectName` or\n * `extra.normalizeNameFn` key outside it is refused. `maxFolderDepth` counts the folders below\n * it. Absent: every key in the bucket.\n */\n keyPrefix?: string;\n\n routes?: TStaticAssetRoutes;\n\n /** Direct upload: the browser posts the bytes to the storage and IGNIS only signs the permission. Absent leaves both routes unregistered. Requires `bucket` - a policy names one bucket, and a bucket in the URL is a bucket the caller chooses. */\n directUpload?: TDirectUploadOptions;\n };\n extra?: TStaticAssetExtraOptions;\n\n /** Decides the stored object name of each uploaded file; absent keeps the storage helper's own naming. */\n resolveObjectName?: TObjectNameResolver;\n\n /** Registers the application's own routes BEFORE every built-in one, so a literal path wins over the catch-all `rawObjectPath` produces. Hono matches in registration order. */\n defineRoutesBefore?: TDefineExtraRoutes;\n\n /** Registers the application's own routes on the generated controller, after every built-in one. */\n defineExtraRoutes?: TDefineExtraRoutes;\n } & (\n | { storage: typeof StaticAssetStorageTypes.BUN_S3; helper: BunS3Helper }\n | { storage: typeof StaticAssetStorageTypes.DISK; helper: DiskHelper }\n | { storage: typeof StaticAssetStorageTypes.MINIO; helper: MinioHelper }\n ) &\n (\n | { useMetaLink?: false | undefined }\n | { useMetaLink: true; metaLink: TMetaLinkConfig<Schema> }\n );\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/static-asset/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseRestController, IAuthRouteConfig, TRouteContext } from '@/base';\nimport type { IDuration } from '@venizia/ignis-helpers/common';\nimport type {\n BaseRelationalEntity,\n DefaultCRUDRepository,\n TTableObject,\n} from '@venizia/ignis-connectors/postgres';\nimport type {\n DiskHelper,\n IBucketRef,\n IFileStat,\n IObjectLocation,\n IObjectRef,\n IStorageHelper,\n IUploadResult,\n TUploadNaming,\n} from '@venizia/ignis-helpers';\nimport type { BunS3Helper } from '@venizia/ignis-helpers/bun-s3';\nimport type { AnyType, TValueOrAsyncResolver, ValueOrPromise } from '@venizia/ignis-helpers/common';\nimport type { TMultipartStorage } from '@venizia/ignis-helpers';\nimport type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from '../models';\nimport type { StaticAssetStorageTypes } from './constants';\n\nexport type TStaticAssetExtraOptions = {\n parseMultipartBody?: {\n storage?: TMultipartStorage;\n uploadDir?: string;\n };\n\n /** `folderPath` carries the upload query's target folder - dropping it flattens nested uploads. */\n normalizeNameFn?: (opts: { file: TUploadNaming }) => string;\n normalizeLinkFn?: (opts: IObjectLocation) => string;\n\n /** Maximum folder nesting depth allowed in object paths. Default: 2 */\n maxFolderDepth?: number;\n\n /** Largest file the UPLOAD route accepts. Absent means no ceiling. Checked against `content-length` before spooling, then per file after parsing. */\n maxBytes?: number;\n [key: string]: AnyType;\n};\n\n/** Decides the key one uploaded file is stored under. `defaultKey` is what IGNIS would have written. */\nexport type TObjectNameResolver = (opts: {\n bucket: IBucketRef;\n file: TUploadNaming;\n defaultKey: string;\n}) => string;\n\n/** Adds routes of the application's own to a generated asset controller. Runs after every built-in route, so a built-in route always wins a path collision. `basePath` is the mount path with exactly one leading slash. */\n/** Adds routes of the application's own. Registration order decides a path collision, so the same shape serves both the before and the after hook. */\nexport type TDefineExtraRoutes = (opts: {\n controller: BaseRestController;\n helper: IStorageHelper;\n basePath: string;\n}) => void;\n\n// Declared by hand rather than inferred: RouteHandler inference here is heavy.\nexport type TBucketParams = { bucketName: string };\nexport type TObjectParams = { bucketName: string; objectName: string };\nexport type TUploadQuery = {\n principalType?: string;\n principalId?: string;\n variant?: string;\n /** Display order within the principal. Caller-supplied: deriving it would be a non-atomic read of `max(sequence)` then a write of `max + 1`. */\n sequence?: number;\n folderPath?: string;\n};\nexport type TListQuery = { prefix?: string; recursive?: string; maxKeys?: string };\n\nexport type TDirectUploadOptions = {\n /** Who may ask for a policy. REQUIRED, not defaulted: this route hands out a write credential, and there is no safe default for that. */\n authorize: (opts: { context: TRouteContext }) => ValueOrPromise<boolean>;\n\n /** Signs the commit token. Keep it out of the repository and out of the client. */\n secretKey: string;\n\n /** The ceiling the policy carries as `content-length-range`. A signed PUT cannot express this at all, which is why this is a POST policy. */\n maxBytes: number;\n\n /** Where a policy may write. The final key is NEVER in a policy, so content cannot be replaced after the commit. Default: `pending/`. */\n pendingPrefix?: string;\n\n /** How long a policy and its commit token stay good. Default: the helper's POST default. */\n expiresIn?: IDuration;\n\n /** Runs BEFORE the copy to the final key, so a hook that throws leaves the object under the pending prefix for a lifecycle rule to collect, rather than stranding it at the final key. */\n onCommit?: (opts: {\n bucket: IBucketRef;\n pendingObject: IObjectRef;\n object: IObjectRef;\n }) => ValueOrPromise<void>;\n};\n\nexport type TUploadPolicyRequest = {\n files: Array<{ fileName: string; contentType?: string; size?: number }>;\n};\n\n/** The MetaLink table belongs to the application. `Schema` defaults to the table IGNIS ships, and widens to any table whose row carries the same fields. */\nexport type TMetaLinkConfig<Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema> = {\n model: TValueOrAsyncResolver<typeof BaseRelationalEntity<Schema>>;\n repository: TValueOrAsyncResolver<DefaultCRUDRepository<Schema>>;\n createMetaLink?: (opts: {\n uploadResult: IUploadResult;\n fileStat: IFileStat;\n /** The caller's labels. Named for where they used to travel - they arrive in the request BODY now, as form fields on an upload and beside the commit token on a direct one. */\n query: TUploadQuery;\n }) => ValueOrPromise<{ count: number; data: TTableObject<Schema> }>;\n};\n\n/** The part of a built-in route an application may change. */\nexport type TStaticAssetRouteConfig = Partial<\n Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>\n> & {\n /** Whether this route is registered. Defaults to true. */\n enabled?: boolean;\n};\n\nexport type TStaticAssetRoutes = {\n getBuckets?: TStaticAssetRouteConfig;\n getBucketByName?: TStaticAssetRouteConfig;\n createBucket?: TStaticAssetRouteConfig;\n deleteBucket?: TStaticAssetRouteConfig;\n\n upload?: TStaticAssetRouteConfig;\n listObjects?: TStaticAssetRouteConfig;\n deleteObject?: TStaticAssetRouteConfig;\n getObjectByName?: TStaticAssetRouteConfig;\n downloadObjectByName?: TStaticAssetRouteConfig;\n\n uploadPolicy?: TStaticAssetRouteConfig;\n uploadCommit?: TStaticAssetRouteConfig;\n\n recreateMetaLink?: TStaticAssetRouteConfig;\n};\n\nexport type TStaticAssetsComponentOptions<\n Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema,\n> = {\n [key: string]: {\n controller: {\n name: string;\n basePath: string;\n isStrict?: boolean;\n\n /** `true` serves a raw nested object path (`/objects/photos/2024/f.jpg`) - a URL shape change; a percent-encoded path keeps working either way. Default: `false`. */\n rawObjectPath?: boolean;\n\n /** The single bucket every object route uses. It leaves the URL (`/objects/{objectName}`) and the four bucket-management routes are not registered. The function form is read per request, so an environment variable can be read lazily. */\n bucket?: TValueOrAsyncResolver<string>;\n\n /**\n * The key scope this controller owns, e.g. `inventory/`. Every route refuses a key outside it\n * as a 404 without calling the storage, `listObjects` lists only inside it, and an upload key\n * must land inside it: the default name is placed there, a `resolveObjectName` or\n * `extra.normalizeNameFn` key outside it is refused. `maxFolderDepth` counts the folders below\n * it. Absent: every key in the bucket.\n */\n keyPrefix?: string;\n\n routes?: TStaticAssetRoutes;\n\n /** Direct upload: the browser posts the bytes to the storage and IGNIS only signs the permission. Absent leaves both routes unregistered. Requires `bucket` - a policy names one bucket, and a bucket in the URL is a bucket the caller chooses. */\n directUpload?: TDirectUploadOptions;\n };\n extra?: TStaticAssetExtraOptions;\n\n /** Decides the stored object name of each uploaded file; absent keeps the storage helper's own naming. */\n resolveObjectName?: TObjectNameResolver;\n\n /** Registers the application's own routes BEFORE every built-in one, so a literal path wins over the catch-all `rawObjectPath` produces. Hono matches in registration order. */\n defineRoutesBefore?: TDefineExtraRoutes;\n\n /** Registers the application's own routes on the generated controller, after every built-in one. */\n defineExtraRoutes?: TDefineExtraRoutes;\n } & (\n | { storage: typeof StaticAssetStorageTypes.BUN_S3; helper: BunS3Helper }\n | { storage: typeof StaticAssetStorageTypes.DISK; helper: DiskHelper }\n ) &\n (\n | { useMetaLink?: false | undefined }\n | { useMetaLink: true; metaLink: TMetaLinkConfig<Schema> }\n );\n};\n"]}
@@ -16,7 +16,7 @@ import { inject } from '../../base/metadata/index.js';
16
16
  import { CoreBindings } from '@venizia/ignis-kernel';
17
17
  import { Binding } from '@venizia/ignis-kernel';
18
18
  import { StaticAssetComponentBindingKeys } from './common/index.js';
19
- import { AssetControllerFactory, buildObjectLink } from './controller/index.js';
19
+ import { AssetControllerFactory } from './controller/index.js';
20
20
  /** `Schema` is the MetaLink table the application binds. It has to live on the CLASS, not only on the options: `component(Ctor, { options })` infers the options from the class, so a class pinned to the shipped table can only carry options for that table. */
21
21
  let StaticAssetComponent = StaticAssetComponent_1 = class StaticAssetComponent extends BaseComponent {
22
22
  constructor(application) {
@@ -54,7 +54,7 @@ let StaticAssetComponent = StaticAssetComponent_1 = class StaticAssetComponent e
54
54
  ...extra,
55
55
  normalizeLinkFn: extra?.normalizeLinkFn ??
56
56
  // The link follows the URL shape the controller serves: `{objectName}` is one Hono path segment unless `rawObjectPath` widens it, and a configured bucket leaves the path.
57
- ((linkOptions) => buildObjectLink({
57
+ ((linkOptions) => AssetControllerFactory.buildObjectLink({
58
58
  basePath: controller.basePath,
59
59
  bucket: linkOptions.bucket,
60
60
  object: linkOptions.object,
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/static-asset/component.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,+BAA+B,EAAsC,MAAM,UAAU,CAAC;AAE/F,OAAO,EAA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D,iBAAiB;gBACjB,kBAAkB;gBAClB,iBAAiB;gBACjB,OAAO,EAAE;oBACP,GAAG,KAAK;oBACR,eAAe,EACb,KAAK,EAAE,eAAe;wBACtB,2KAA2K;wBAC3K,CAAC,CAAC,WAAW,EAAE,EAAE,CACf,eAAe,CAAC;4BACd,QAAQ,EAAE,UAAU,CAAC,QAAQ;4BAC7B,MAAM,EAAE,WAAW,CAAC,MAAM;4BAC1B,MAAM,EAAE,WAAW,CAAC,MAAM;4BAC1B,mBAAmB,EAAE,UAAU,CAAC,MAAM,KAAK,SAAS;4BACpD,aAAa,EAAE,UAAU,CAAC,aAAa;yBACxC,CAAC,CAAC;iBACR;aACF,CAAC,CACH,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAC1B,iFAAiF,EACjF,GAAG,EACH,OAAO,EACP,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CACzB,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA1EY,oBAAoB;IAI5B,WAAA,MAAM,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,oBAAoB,EAAE,CAAC,CAAA;;GAJ1C,oBAAoB,CA0EhC","sourcesContent":["import { type BaseApplication } from '@/base/applications';\nimport { BaseComponent } from '@venizia/ignis-kernel';\nimport { inject } from '@/base/metadata';\nimport { CoreBindings } from '@venizia/ignis-kernel';\nimport { Binding } from '@venizia/ignis-kernel';\nimport { type ValueOrPromise } from '@venizia/ignis-helpers/common';\nimport { StaticAssetComponentBindingKeys, type TStaticAssetsComponentOptions } from './common';\nimport type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from './models';\nimport { AssetControllerFactory, buildObjectLink } from './controller';\n\n/** `Schema` is the MetaLink table the application binds. It has to live on the CLASS, not only on the options: `component(Ctor, { options })` infers the options from the class, so a class pinned to the shipped table can only carry options for that table. */\nexport class StaticAssetComponent<\n Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema,\n> extends BaseComponent<TStaticAssetsComponentOptions<Schema>> {\n constructor(\n @inject({ key: CoreBindings.APPLICATION_INSTANCE }) private application: BaseApplication,\n ) {\n super({\n scope: StaticAssetComponent.name,\n initDefault: { enable: true, container: application },\n bindings: {\n [StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS]:\n Binding.bind<TStaticAssetsComponentOptions>({\n key: StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS,\n }).toValue({}),\n },\n });\n }\n\n override binding(): ValueOrPromise<void> {\n // Direct options win. The key is the path for an application that registers this component\n // through `configs.artifacts`, where an index carries classes and no options.\n const componentOptions =\n this.options ??\n this.application.get<TStaticAssetsComponentOptions<Schema>>({\n key: StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS,\n });\n\n const componentOptionsEntries = Object.entries(componentOptions);\n for (const [key, opt] of componentOptionsEntries) {\n const {\n storage,\n controller,\n helper,\n extra,\n resolveObjectName,\n defineRoutesBefore,\n defineExtraRoutes,\n } = opt;\n\n this.application.controller(\n AssetControllerFactory.defineAssetController({\n controller,\n storage,\n helper,\n useMetaLink: opt.useMetaLink,\n metaLink: opt.useMetaLink ? opt.metaLink : undefined,\n resolveObjectName,\n defineRoutesBefore,\n defineExtraRoutes,\n options: {\n ...extra,\n normalizeLinkFn:\n extra?.normalizeLinkFn ??\n // The link follows the URL shape the controller serves: `{objectName}` is one Hono path segment unless `rawObjectPath` widens it, and a configured bucket leaves the path.\n ((linkOptions) =>\n buildObjectLink({\n basePath: controller.basePath,\n bucket: linkOptions.bucket,\n object: linkOptions.object,\n hasConfiguredBucket: controller.bucket !== undefined,\n rawObjectPath: controller.rawObjectPath,\n })),\n },\n }),\n );\n\n this.application.logger.info(\n `[binding] Asset storage is bound | Key: %s | Storage type: %s | UseMetaLink: %s`,\n key,\n storage,\n Boolean(opt.useMetaLink),\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/static-asset/component.ts"],"names":[],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AAiB,GAClB,GAAG,GAAG,CAAC;YAER,IAAI,CAAC,WAAW,CAAC,UAAU,CACzB,sBAAsB,CAAC,qBAAqB,CAAC;gBAC3C,UAAU;gBACV,OAAO;gBACP,MAAM;gBACN,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,QAAQ,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBACpD,iBAAiB;gBACjB,kBAAkB;gBAClB,iBAAiB;gBACjB,OAAO,EAAE;oBACP,GAAG,KAAK;oBACR,eAAe,EACb,KAAK,EAAE,eAAe;wBACtB,2KAA2K;wBAC3K,CAAC,CAAC,WAAW,EAAE,EAAE,CACf,sBAAsB,CAAC,eAAe,CAAC;4BACrC,QAAQ,EAAE,UAAU,CAAC,QAAQ;4BAC7B,MAAM,EAAE,WAAW,CAAC,MAAM;4BAC1B,MAAM,EAAE,WAAW,CAAC,MAAM;4BAC1B,mBAAmB,EAAE,UAAU,CAAC,MAAM,KAAK,SAAS;4BACpD,aAAa,EAAE,UAAU,CAAC,aAAa;yBACxC,CAAC,CAAC;iBACR;aACF,CAAC,CACH,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAC1B,iFAAiF,EACjF,GAAG,EACH,OAAO,EACP,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CACzB,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA1EY,oBAAoB;IAI5B,WAAA,MAAM,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,oBAAoB,EAAE,CAAC,CAAA;;GAJ1C,oBAAoB,CA0EhC","sourcesContent":["import { type BaseApplication } from '@/base/applications';\nimport { BaseComponent } from '@venizia/ignis-kernel';\nimport { inject } from '@/base/metadata';\nimport { CoreBindings } from '@venizia/ignis-kernel';\nimport { Binding } from '@venizia/ignis-kernel';\nimport { type ValueOrPromise } from '@venizia/ignis-helpers/common';\nimport { StaticAssetComponentBindingKeys, type TStaticAssetsComponentOptions } from './common';\nimport type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from './models';\nimport { AssetControllerFactory } from './controller';\n\n/** `Schema` is the MetaLink table the application binds. It has to live on the CLASS, not only on the options: `component(Ctor, { options })` infers the options from the class, so a class pinned to the shipped table can only carry options for that table. */\nexport class StaticAssetComponent<\n Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema,\n> extends BaseComponent<TStaticAssetsComponentOptions<Schema>> {\n constructor(\n @inject({ key: CoreBindings.APPLICATION_INSTANCE }) private application: BaseApplication,\n ) {\n super({\n scope: StaticAssetComponent.name,\n initDefault: { enable: true, container: application },\n bindings: {\n [StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS]:\n Binding.bind<TStaticAssetsComponentOptions>({\n key: StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS,\n }).toValue({}),\n },\n });\n }\n\n override binding(): ValueOrPromise<void> {\n // Direct options win. The key is the path for an application that registers this component\n // through `configs.artifacts`, where an index carries classes and no options.\n const componentOptions =\n this.options ??\n this.application.get<TStaticAssetsComponentOptions<Schema>>({\n key: StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS,\n });\n\n const componentOptionsEntries = Object.entries(componentOptions);\n for (const [key, opt] of componentOptionsEntries) {\n const {\n storage,\n controller,\n helper,\n extra,\n resolveObjectName,\n defineRoutesBefore,\n defineExtraRoutes,\n } = opt;\n\n this.application.controller(\n AssetControllerFactory.defineAssetController({\n controller,\n storage,\n helper,\n useMetaLink: opt.useMetaLink,\n metaLink: opt.useMetaLink ? opt.metaLink : undefined,\n resolveObjectName,\n defineRoutesBefore,\n defineExtraRoutes,\n options: {\n ...extra,\n normalizeLinkFn:\n extra?.normalizeLinkFn ??\n // The link follows the URL shape the controller serves: `{objectName}` is one Hono path segment unless `rawObjectPath` widens it, and a configured bucket leaves the path.\n ((linkOptions) =>\n AssetControllerFactory.buildObjectLink({\n basePath: controller.basePath,\n bucket: linkOptions.bucket,\n object: linkOptions.object,\n hasConfiguredBucket: controller.bucket !== undefined,\n rawObjectPath: controller.rawObjectPath,\n })),\n },\n }),\n );\n\n this.application.logger.info(\n `[binding] Asset storage is bound | Key: %s | Storage type: %s | UseMetaLink: %s`,\n key,\n storage,\n Boolean(opt.useMetaLink),\n );\n }\n }\n}\n"]}
@@ -19,10 +19,10 @@ export interface IAssetDefinitions {
19
19
  * `hasConfiguredBucket` drops `/buckets/{bucketName}` and its param from every object route.
20
20
  * `rawObjectPath` appends the `{.+}` catch-all, the spelling `@hono/zod-openapi` translates.
21
21
  */
22
- export declare const buildAssetDefinitions: (opts: {
23
- hasConfiguredBucket?: boolean;
24
- rawObjectPath?: boolean;
25
- }) => IAssetDefinitions;
26
- /** The bucket-in-path shape, unchanged - every existing importer keeps working. */
27
- export declare const StaticAssetDefinitions: IAssetDefinitions;
22
+ export declare class AssetDefinitionBuilder {
23
+ static build(opts: {
24
+ hasConfiguredBucket?: boolean;
25
+ rawObjectPath?: boolean;
26
+ }): IAssetDefinitions;
27
+ }
28
28
  //# sourceMappingURL=base.definition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.definition.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/controller/base.definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAiE/C,0GAA0G;AAC1G,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,aAAa,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,gBAAgB,CAAC;IAChC,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,uBAAuB,EAAE,gBAAgB,CAAC;IAC1C,aAAa,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,gBAAgB,CAAC;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,aAAa,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,iBAAiB,EAAE,gBAAgB,CAAC;CACrC;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,KAAG,iBAkQH,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,sBAAsB,mBAA4B,CAAC"}
1
+ {"version":3,"file":"base.definition.d.ts","sourceRoot":"","sources":["../../../../../src/components/static-asset/controller/base.definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAiE/C,0GAA0G;AAC1G,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,aAAa,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,gBAAgB,CAAC;IAChC,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,uBAAuB,EAAE,gBAAgB,CAAC;IAC1C,aAAa,EAAE,gBAAgB,CAAC;IAChC,aAAa,EAAE,gBAAgB,CAAC;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,aAAa,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,iBAAiB,EAAE,gBAAgB,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,sBAAsB;IACjC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;QACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,GAAG,iBAAiB;CAoQtB"}