@venizia/ignis 0.2.0-4 → 0.2.0-40

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 (361) hide show
  1. package/dist/base/applications/base.d.ts +19 -13
  2. package/dist/base/applications/base.d.ts.map +1 -1
  3. package/dist/base/applications/base.js +85 -65
  4. package/dist/base/applications/base.js.map +1 -1
  5. package/dist/base/applications/boot-steps.d.ts +13 -0
  6. package/dist/base/applications/boot-steps.d.ts.map +1 -0
  7. package/dist/base/applications/boot-steps.js +23 -0
  8. package/dist/base/applications/boot-steps.js.map +1 -0
  9. package/dist/base/applications/common/index.d.ts +2 -0
  10. package/dist/base/applications/common/index.d.ts.map +1 -0
  11. package/dist/base/applications/common/index.js +18 -0
  12. package/dist/base/applications/common/index.js.map +1 -0
  13. package/dist/base/applications/{types.d.ts → common/types.d.ts} +11 -0
  14. package/dist/base/applications/common/types.d.ts.map +1 -0
  15. package/dist/base/applications/common/types.js.map +1 -0
  16. package/dist/base/applications/index.d.ts +2 -1
  17. package/dist/base/applications/index.d.ts.map +1 -1
  18. package/dist/base/applications/index.js +2 -1
  19. package/dist/base/applications/index.js.map +1 -1
  20. package/dist/base/applications/server.d.ts +4 -2
  21. package/dist/base/applications/server.d.ts.map +1 -1
  22. package/dist/base/applications/server.js +25 -2
  23. package/dist/base/applications/server.js.map +1 -1
  24. package/dist/base/controllers/grpc/adapter.d.ts +2 -1
  25. package/dist/base/controllers/grpc/adapter.d.ts.map +1 -1
  26. package/dist/base/controllers/grpc/adapter.js +4 -3
  27. package/dist/base/controllers/grpc/adapter.js.map +1 -1
  28. package/dist/base/middlewares/app-error/app-error.middleware.d.ts +3 -2
  29. package/dist/base/middlewares/app-error/app-error.middleware.d.ts.map +1 -1
  30. package/dist/base/middlewares/app-error/app-error.middleware.js +4 -3
  31. package/dist/base/middlewares/app-error/app-error.middleware.js.map +1 -1
  32. package/dist/base/middlewares/request-spy/request-spy.middleware.d.ts.map +1 -1
  33. package/dist/base/middlewares/request-spy/request-spy.middleware.js +2 -1
  34. package/dist/base/middlewares/request-spy/request-spy.middleware.js.map +1 -1
  35. package/dist/common/constants.d.ts.map +1 -1
  36. package/dist/common/constants.js +2 -1
  37. package/dist/common/constants.js.map +1 -1
  38. package/dist/common/environments.d.ts +31 -10
  39. package/dist/common/environments.d.ts.map +1 -1
  40. package/dist/common/environments.js +33 -10
  41. package/dist/common/environments.js.map +1 -1
  42. package/dist/components/api-reference/component.js +2 -2
  43. package/dist/components/api-reference/component.js.map +1 -1
  44. package/dist/components/api-reference/index.d.ts +1 -1
  45. package/dist/components/api-reference/index.d.ts.map +1 -1
  46. package/dist/components/api-reference/index.js +1 -1
  47. package/dist/components/api-reference/index.js.map +1 -1
  48. package/dist/components/api-reference/ui/factory.d.ts +14 -0
  49. package/dist/components/api-reference/ui/factory.d.ts.map +1 -0
  50. package/dist/components/api-reference/{ui-factory.js → ui/factory.js} +12 -25
  51. package/dist/components/api-reference/ui/factory.js.map +1 -0
  52. package/dist/components/api-reference/ui/index.d.ts +4 -0
  53. package/dist/components/api-reference/ui/index.d.ts.map +1 -0
  54. package/dist/components/api-reference/ui/index.js +20 -0
  55. package/dist/components/api-reference/ui/index.js.map +1 -0
  56. package/dist/components/api-reference/ui/scalar.d.ts +8 -0
  57. package/dist/components/api-reference/ui/scalar.d.ts.map +1 -0
  58. package/dist/components/api-reference/ui/scalar.js +28 -0
  59. package/dist/components/api-reference/ui/scalar.js.map +1 -0
  60. package/dist/components/api-reference/ui/swagger.d.ts +8 -0
  61. package/dist/components/api-reference/ui/swagger.d.ts.map +1 -0
  62. package/dist/components/api-reference/ui/swagger.js +28 -0
  63. package/dist/components/api-reference/ui/swagger.js.map +1 -0
  64. package/dist/components/auth/authenticate/controllers/factory.d.ts +33 -2
  65. package/dist/components/auth/authenticate/controllers/factory.d.ts.map +1 -1
  66. package/dist/components/auth/authenticate/services/service/verifier.service.d.ts.map +1 -1
  67. package/dist/components/auth/authenticate/services/service/verifier.service.js +10 -6
  68. package/dist/components/auth/authenticate/services/service/verifier.service.js.map +1 -1
  69. package/dist/components/auth/authenticate/strategies/index.d.ts +1 -1
  70. package/dist/components/auth/authenticate/strategies/index.d.ts.map +1 -1
  71. package/dist/components/auth/authenticate/strategies/index.js +1 -1
  72. package/dist/components/auth/authenticate/strategies/index.js.map +1 -1
  73. package/dist/components/auth/authenticate/strategies/jwks/index.d.ts +3 -0
  74. package/dist/components/auth/authenticate/strategies/jwks/index.d.ts.map +1 -0
  75. package/dist/components/auth/authenticate/strategies/jwks/index.js +19 -0
  76. package/dist/components/auth/authenticate/strategies/jwks/index.js.map +1 -0
  77. package/dist/components/auth/authenticate/strategies/jwks/issuer.d.ts +13 -0
  78. package/dist/components/auth/authenticate/strategies/jwks/issuer.d.ts.map +1 -0
  79. package/dist/components/auth/authenticate/strategies/{jwks.strategy.js → jwks/issuer.js} +4 -27
  80. package/dist/components/auth/authenticate/strategies/jwks/issuer.js.map +1 -0
  81. package/dist/components/auth/authenticate/strategies/{jwks.strategy.d.ts → jwks/verifier.d.ts} +2 -10
  82. package/dist/components/auth/authenticate/strategies/jwks/verifier.d.ts.map +1 -0
  83. package/dist/components/auth/authenticate/strategies/jwks/verifier.js +45 -0
  84. package/dist/components/auth/authenticate/strategies/jwks/verifier.js.map +1 -0
  85. package/dist/components/auth/authorize/adapters/base-filtered.d.ts +1 -1
  86. package/dist/components/auth/authorize/adapters/base-filtered.d.ts.map +1 -1
  87. package/dist/components/auth/authorize/adapters/base-filtered.js +5 -8
  88. package/dist/components/auth/authorize/adapters/base-filtered.js.map +1 -1
  89. package/dist/components/auth/authorize/adapters/common/index.d.ts +2 -0
  90. package/dist/components/auth/authorize/adapters/common/index.d.ts.map +1 -0
  91. package/dist/components/auth/authorize/adapters/common/index.js +18 -0
  92. package/dist/components/auth/authorize/adapters/common/index.js.map +1 -0
  93. package/dist/components/auth/authorize/adapters/{types.d.ts → common/types.d.ts} +1 -1
  94. package/dist/components/auth/authorize/adapters/common/types.d.ts.map +1 -0
  95. package/dist/components/auth/authorize/adapters/common/types.js.map +1 -0
  96. package/dist/components/auth/authorize/adapters/connector.d.ts +10 -0
  97. package/dist/components/auth/authorize/adapters/connector.d.ts.map +1 -0
  98. package/dist/components/auth/authorize/adapters/connector.js +20 -0
  99. package/dist/components/auth/authorize/adapters/connector.js.map +1 -0
  100. package/dist/components/auth/authorize/adapters/custom-grant-expander.d.ts +52 -0
  101. package/dist/components/auth/authorize/adapters/custom-grant-expander.d.ts.map +1 -0
  102. package/dist/components/auth/authorize/adapters/custom-grant-expander.js +111 -0
  103. package/dist/components/auth/authorize/adapters/custom-grant-expander.js.map +1 -0
  104. package/dist/components/auth/authorize/adapters/index.d.ts +4 -2
  105. package/dist/components/auth/authorize/adapters/index.d.ts.map +1 -1
  106. package/dist/components/auth/authorize/adapters/index.js +4 -2
  107. package/dist/components/auth/authorize/adapters/index.js.map +1 -1
  108. package/dist/components/auth/authorize/adapters/scoped-casbin/adapter.d.ts +93 -0
  109. package/dist/components/auth/authorize/adapters/scoped-casbin/adapter.d.ts.map +1 -0
  110. package/dist/components/auth/authorize/adapters/{scoped-casbin.adapter.js → scoped-casbin/adapter.js} +95 -97
  111. package/dist/components/auth/authorize/adapters/scoped-casbin/adapter.js.map +1 -0
  112. package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.d.ts +2 -0
  113. package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.d.ts.map +1 -0
  114. package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.js +5 -0
  115. package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.js.map +1 -0
  116. package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.d.ts +3 -0
  117. package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.d.ts.map +1 -0
  118. package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.js +19 -0
  119. package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.js.map +1 -0
  120. package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.d.ts +50 -0
  121. package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.d.ts.map +1 -0
  122. package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.js +3 -0
  123. package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.js.map +1 -0
  124. package/dist/components/auth/authorize/adapters/scoped-casbin/index.d.ts +4 -0
  125. package/dist/components/auth/authorize/adapters/scoped-casbin/index.d.ts.map +1 -0
  126. package/dist/components/auth/authorize/adapters/scoped-casbin/index.js +19 -0
  127. package/dist/components/auth/authorize/adapters/scoped-casbin/index.js.map +1 -0
  128. package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.d.ts +17 -0
  129. package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.d.ts.map +1 -0
  130. package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.js +11 -0
  131. package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.js.map +1 -0
  132. package/dist/components/auth/authorize/component.d.ts.map +1 -1
  133. package/dist/components/auth/authorize/component.js +3 -0
  134. package/dist/components/auth/authorize/component.js.map +1 -1
  135. package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts +7 -36
  136. package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts.map +1 -1
  137. package/dist/components/auth/authorize/enforcers/casbin.enforcer.js +48 -117
  138. package/dist/components/auth/authorize/enforcers/casbin.enforcer.js.map +1 -1
  139. package/dist/components/auth/authorize/enforcers/index.d.ts +2 -1
  140. package/dist/components/auth/authorize/enforcers/index.d.ts.map +1 -1
  141. package/dist/components/auth/authorize/enforcers/index.js +2 -1
  142. package/dist/components/auth/authorize/enforcers/index.js.map +1 -1
  143. package/dist/components/auth/authorize/enforcers/policy-line-codec.d.ts +26 -0
  144. package/dist/components/auth/authorize/enforcers/policy-line-codec.d.ts.map +1 -0
  145. package/dist/components/auth/authorize/enforcers/policy-line-codec.js +57 -0
  146. package/dist/components/auth/authorize/enforcers/policy-line-codec.js.map +1 -0
  147. package/dist/components/auth/authorize/enforcers/user-policy-line-cache.d.ts +46 -0
  148. package/dist/components/auth/authorize/enforcers/user-policy-line-cache.d.ts.map +1 -0
  149. package/dist/components/auth/authorize/enforcers/user-policy-line-cache.js +98 -0
  150. package/dist/components/auth/authorize/enforcers/user-policy-line-cache.js.map +1 -0
  151. package/dist/components/auth/authorize/index.d.ts +1 -0
  152. package/dist/components/auth/authorize/index.d.ts.map +1 -1
  153. package/dist/components/auth/authorize/index.js +1 -0
  154. package/dist/components/auth/authorize/index.js.map +1 -1
  155. package/dist/components/auth/authorize/role-managers/base.d.ts +34 -0
  156. package/dist/components/auth/authorize/role-managers/base.d.ts.map +1 -0
  157. package/dist/components/auth/authorize/role-managers/base.js +76 -0
  158. package/dist/components/auth/authorize/role-managers/base.js.map +1 -0
  159. package/dist/components/auth/authorize/role-managers/domain-hierarchy.d.ts +28 -0
  160. package/dist/components/auth/authorize/role-managers/domain-hierarchy.d.ts.map +1 -0
  161. package/dist/components/auth/authorize/role-managers/domain-hierarchy.js +77 -0
  162. package/dist/components/auth/authorize/role-managers/domain-hierarchy.js.map +1 -0
  163. package/dist/components/auth/authorize/role-managers/index.d.ts +5 -0
  164. package/dist/components/auth/authorize/role-managers/index.d.ts.map +1 -0
  165. package/dist/components/auth/authorize/role-managers/index.js +21 -0
  166. package/dist/components/auth/authorize/role-managers/index.js.map +1 -0
  167. package/dist/components/auth/authorize/role-managers/membership.d.ts +21 -0
  168. package/dist/components/auth/authorize/role-managers/membership.d.ts.map +1 -0
  169. package/dist/components/auth/authorize/role-managers/membership.js +69 -0
  170. package/dist/components/auth/authorize/role-managers/membership.js.map +1 -0
  171. package/dist/components/auth/authorize/{enforcers/resource-role-manager.d.ts → role-managers/resource.d.ts} +3 -9
  172. package/dist/components/auth/authorize/role-managers/resource.d.ts.map +1 -0
  173. package/dist/components/auth/authorize/{enforcers/resource-role-manager.js → role-managers/resource.js} +9 -21
  174. package/dist/components/auth/authorize/role-managers/resource.js.map +1 -0
  175. package/dist/components/auth/models/entities/policy-definition.model.d.ts +49 -14
  176. package/dist/components/auth/models/entities/policy-definition.model.d.ts.map +1 -1
  177. package/dist/components/auth/models/entities/policy-definition.model.js +45 -11
  178. package/dist/components/auth/models/entities/policy-definition.model.js.map +1 -1
  179. package/dist/components/auth/models/entities/user.model.d.ts +2 -2
  180. package/dist/components/health-check/common/constants.d.ts +5 -0
  181. package/dist/components/health-check/common/constants.d.ts.map +1 -0
  182. package/dist/components/health-check/common/constants.js +9 -0
  183. package/dist/components/health-check/common/constants.js.map +1 -0
  184. package/dist/components/health-check/common/index.d.ts +1 -0
  185. package/dist/components/health-check/common/index.d.ts.map +1 -1
  186. package/dist/components/health-check/common/index.js +1 -0
  187. package/dist/components/health-check/common/index.js.map +1 -1
  188. package/dist/components/health-check/common/keys.d.ts +2 -0
  189. package/dist/components/health-check/common/keys.d.ts.map +1 -1
  190. package/dist/components/health-check/common/keys.js +2 -0
  191. package/dist/components/health-check/common/keys.js.map +1 -1
  192. package/dist/components/health-check/common/rest-paths.d.ts +1 -0
  193. package/dist/components/health-check/common/rest-paths.d.ts.map +1 -1
  194. package/dist/components/health-check/common/rest-paths.js +1 -0
  195. package/dist/components/health-check/common/rest-paths.js.map +1 -1
  196. package/dist/components/health-check/common/types.d.ts +22 -0
  197. package/dist/components/health-check/common/types.d.ts.map +1 -1
  198. package/dist/components/health-check/component.d.ts +9 -3
  199. package/dist/components/health-check/component.d.ts.map +1 -1
  200. package/dist/components/health-check/component.js +38 -1
  201. package/dist/components/health-check/component.js.map +1 -1
  202. package/dist/components/health-check/controller.d.ts +10 -2
  203. package/dist/components/health-check/controller.d.ts.map +1 -1
  204. package/dist/components/health-check/controller.js +79 -13
  205. package/dist/components/health-check/controller.js.map +1 -1
  206. package/dist/components/health-check/index.d.ts +1 -0
  207. package/dist/components/health-check/index.d.ts.map +1 -1
  208. package/dist/components/health-check/index.js +1 -0
  209. package/dist/components/health-check/index.js.map +1 -1
  210. package/dist/components/health-check/reporter.d.ts +98 -0
  211. package/dist/components/health-check/reporter.d.ts.map +1 -0
  212. package/dist/components/health-check/reporter.js +138 -0
  213. package/dist/components/health-check/reporter.js.map +1 -0
  214. package/dist/components/mail/common/constants.d.ts +8 -0
  215. package/dist/components/mail/common/constants.d.ts.map +1 -1
  216. package/dist/components/mail/common/constants.js +9 -1
  217. package/dist/components/mail/common/constants.js.map +1 -1
  218. package/dist/components/mail/common/types/index.d.ts +6 -0
  219. package/dist/components/mail/common/types/index.d.ts.map +1 -0
  220. package/dist/components/mail/common/types/index.js +22 -0
  221. package/dist/components/mail/common/types/index.js.map +1 -0
  222. package/dist/components/mail/common/types/message.d.ts +49 -0
  223. package/dist/components/mail/common/types/message.d.ts.map +1 -0
  224. package/dist/components/mail/common/types/message.js +3 -0
  225. package/dist/components/mail/common/types/message.js.map +1 -0
  226. package/dist/components/mail/common/types/options.d.ts +65 -0
  227. package/dist/components/mail/common/types/options.d.ts.map +1 -0
  228. package/dist/components/mail/common/types/options.js +3 -0
  229. package/dist/components/mail/common/types/options.js.map +1 -0
  230. package/dist/components/mail/common/types/queue.d.ts +53 -0
  231. package/dist/components/mail/common/types/queue.d.ts.map +1 -0
  232. package/dist/components/mail/common/types/queue.js +3 -0
  233. package/dist/components/mail/common/types/queue.js.map +1 -0
  234. package/dist/components/mail/common/types/template.d.ts +33 -0
  235. package/dist/components/mail/common/types/template.d.ts.map +1 -0
  236. package/dist/components/mail/common/types/template.js +3 -0
  237. package/dist/components/mail/common/types/template.js.map +1 -0
  238. package/dist/components/mail/common/types/verification.d.ts +26 -0
  239. package/dist/components/mail/common/types/verification.d.ts.map +1 -0
  240. package/dist/components/mail/common/types/verification.js +3 -0
  241. package/dist/components/mail/common/types/verification.js.map +1 -0
  242. package/dist/components/mail/component.d.ts +4 -1
  243. package/dist/components/mail/component.d.ts.map +1 -1
  244. package/dist/components/mail/component.js +12 -0
  245. package/dist/components/mail/component.js.map +1 -1
  246. package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.d.ts +19 -0
  247. package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.d.ts.map +1 -0
  248. package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.js +111 -0
  249. package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.js.map +1 -0
  250. package/dist/components/mail/helpers/transporters/index.d.ts +2 -1
  251. package/dist/components/mail/helpers/transporters/index.d.ts.map +1 -1
  252. package/dist/components/mail/helpers/transporters/index.js +2 -1
  253. package/dist/components/mail/helpers/transporters/index.js.map +1 -1
  254. package/dist/components/mail/providers/mail-transporter.provider.d.ts +2 -0
  255. package/dist/components/mail/providers/mail-transporter.provider.d.ts.map +1 -1
  256. package/dist/components/mail/providers/mail-transporter.provider.js +17 -0
  257. package/dist/components/mail/providers/mail-transporter.provider.js.map +1 -1
  258. package/dist/components/mail/services/generators/index.d.ts +4 -0
  259. package/dist/components/mail/services/generators/index.d.ts.map +1 -0
  260. package/dist/components/mail/services/generators/index.js +20 -0
  261. package/dist/components/mail/services/generators/index.js.map +1 -0
  262. package/dist/components/mail/services/generators/numeric-code.d.ts +7 -0
  263. package/dist/components/mail/services/generators/numeric-code.d.ts.map +1 -0
  264. package/dist/components/mail/services/generators/numeric-code.js +20 -0
  265. package/dist/components/mail/services/generators/numeric-code.js.map +1 -0
  266. package/dist/components/mail/services/generators/random-token.d.ts +7 -0
  267. package/dist/components/mail/services/generators/random-token.d.ts.map +1 -0
  268. package/dist/components/mail/services/generators/random-token.js +18 -0
  269. package/dist/components/mail/services/generators/random-token.js.map +1 -0
  270. package/dist/components/mail/services/generators/verification-data.d.ts +9 -0
  271. package/dist/components/mail/services/generators/verification-data.d.ts.map +1 -0
  272. package/dist/components/mail/services/{generator.service.js → generators/verification-data.js} +10 -25
  273. package/dist/components/mail/services/generators/verification-data.js.map +1 -0
  274. package/dist/components/mail/services/index.d.ts +1 -1
  275. package/dist/components/mail/services/index.d.ts.map +1 -1
  276. package/dist/components/mail/services/index.js +1 -1
  277. package/dist/components/mail/services/index.js.map +1 -1
  278. package/dist/components/mail/utilities/address.utility.d.ts +9 -0
  279. package/dist/components/mail/utilities/address.utility.d.ts.map +1 -0
  280. package/dist/components/mail/utilities/address.utility.js +36 -0
  281. package/dist/components/mail/utilities/address.utility.js.map +1 -0
  282. package/dist/components/mail/utilities/index.d.ts +2 -0
  283. package/dist/components/mail/utilities/index.d.ts.map +1 -1
  284. package/dist/components/mail/utilities/index.js +2 -0
  285. package/dist/components/mail/utilities/index.js.map +1 -1
  286. package/dist/components/mail/utilities/mime.utility.d.ts +19 -0
  287. package/dist/components/mail/utilities/mime.utility.d.ts.map +1 -0
  288. package/dist/components/mail/utilities/mime.utility.js +412 -0
  289. package/dist/components/mail/utilities/mime.utility.js.map +1 -0
  290. package/dist/components/static-asset/common/commit-token.d.ts +23 -0
  291. package/dist/components/static-asset/common/commit-token.d.ts.map +1 -0
  292. package/dist/components/static-asset/common/commit-token.js +40 -0
  293. package/dist/components/static-asset/common/commit-token.js.map +1 -0
  294. package/dist/components/static-asset/common/constants.d.ts +17 -1
  295. package/dist/components/static-asset/common/constants.d.ts.map +1 -1
  296. package/dist/components/static-asset/common/constants.js +33 -2
  297. package/dist/components/static-asset/common/constants.js.map +1 -1
  298. package/dist/components/static-asset/common/errors.d.ts +34 -0
  299. package/dist/components/static-asset/common/errors.d.ts.map +1 -1
  300. package/dist/components/static-asset/common/errors.js +28 -0
  301. package/dist/components/static-asset/common/errors.js.map +1 -1
  302. package/dist/components/static-asset/common/index.d.ts +1 -0
  303. package/dist/components/static-asset/common/index.d.ts.map +1 -1
  304. package/dist/components/static-asset/common/index.js +1 -0
  305. package/dist/components/static-asset/common/index.js.map +1 -1
  306. package/dist/components/static-asset/common/keys.d.ts +1 -0
  307. package/dist/components/static-asset/common/keys.d.ts.map +1 -1
  308. package/dist/components/static-asset/common/keys.js +1 -0
  309. package/dist/components/static-asset/common/keys.js.map +1 -1
  310. package/dist/components/static-asset/common/types.d.ts +87 -30
  311. package/dist/components/static-asset/common/types.d.ts.map +1 -1
  312. package/dist/components/static-asset/component.d.ts +4 -1
  313. package/dist/components/static-asset/component.d.ts.map +1 -1
  314. package/dist/components/static-asset/component.js +19 -9
  315. package/dist/components/static-asset/component.js.map +1 -1
  316. package/dist/components/static-asset/controller/base.definition.d.ts +27 -554
  317. package/dist/components/static-asset/controller/base.definition.d.ts.map +1 -1
  318. package/dist/components/static-asset/controller/base.definition.js +250 -285
  319. package/dist/components/static-asset/controller/base.definition.js.map +1 -1
  320. package/dist/components/static-asset/controller/factory.d.ts +71 -6
  321. package/dist/components/static-asset/controller/factory.d.ts.map +1 -1
  322. package/dist/components/static-asset/controller/factory.js +578 -138
  323. package/dist/components/static-asset/controller/factory.js.map +1 -1
  324. package/dist/components/static-asset/index.d.ts +1 -0
  325. package/dist/components/static-asset/index.d.ts.map +1 -1
  326. package/dist/components/static-asset/index.js +1 -0
  327. package/dist/components/static-asset/index.js.map +1 -1
  328. package/dist/components/static-asset/ingest.d.ts +58 -0
  329. package/dist/components/static-asset/ingest.d.ts.map +1 -0
  330. package/dist/components/static-asset/ingest.js +82 -0
  331. package/dist/components/static-asset/ingest.js.map +1 -0
  332. package/dist/components/static-asset/models/base.model.d.ts +48 -6
  333. package/dist/components/static-asset/models/base.model.d.ts.map +1 -1
  334. package/dist/components/static-asset/models/base.model.js +12 -1
  335. package/dist/components/static-asset/models/base.model.js.map +1 -1
  336. package/dist/index.d.ts +1 -1
  337. package/dist/index.d.ts.map +1 -1
  338. package/package.json +27 -23
  339. package/dist/base/applications/types.d.ts.map +0 -1
  340. package/dist/base/applications/types.js.map +0 -1
  341. package/dist/components/api-reference/ui-factory.d.ts +0 -21
  342. package/dist/components/api-reference/ui-factory.d.ts.map +0 -1
  343. package/dist/components/api-reference/ui-factory.js.map +0 -1
  344. package/dist/components/auth/authenticate/strategies/jwks.strategy.d.ts.map +0 -1
  345. package/dist/components/auth/authenticate/strategies/jwks.strategy.js.map +0 -1
  346. package/dist/components/auth/authorize/adapters/scoped-casbin.adapter.d.ts +0 -121
  347. package/dist/components/auth/authorize/adapters/scoped-casbin.adapter.d.ts.map +0 -1
  348. package/dist/components/auth/authorize/adapters/scoped-casbin.adapter.js.map +0 -1
  349. package/dist/components/auth/authorize/adapters/types.d.ts.map +0 -1
  350. package/dist/components/auth/authorize/adapters/types.js.map +0 -1
  351. package/dist/components/auth/authorize/enforcers/resource-role-manager.d.ts.map +0 -1
  352. package/dist/components/auth/authorize/enforcers/resource-role-manager.js.map +0 -1
  353. package/dist/components/mail/common/types.d.ts +0 -201
  354. package/dist/components/mail/common/types.d.ts.map +0 -1
  355. package/dist/components/mail/common/types.js +0 -10
  356. package/dist/components/mail/common/types.js.map +0 -1
  357. package/dist/components/mail/services/generator.service.d.ts +0 -14
  358. package/dist/components/mail/services/generator.service.d.ts.map +0 -1
  359. package/dist/components/mail/services/generator.service.js.map +0 -1
  360. /package/dist/base/applications/{types.js → common/types.js} +0 -0
  361. /package/dist/components/auth/authorize/adapters/{types.js → common/types.js} +0 -0
@@ -1,6 +1,40 @@
1
1
  import type { TRegisterErrors } from '@venizia/ignis-helpers/core';
2
2
  /** Codes a client branches on for a rejected static-asset request. A throw site may override `message` to name the offending value. */
3
3
  export declare const StaticAssetErrors: {
4
+ readonly UPLOAD_NOT_AUTHORIZED: {
5
+ readonly message: {
6
+ readonly text: "Not allowed to request an upload policy";
7
+ readonly code: "core.static_asset.upload_not_authorized";
8
+ };
9
+ readonly statusCode: 403;
10
+ readonly category: "validation";
11
+ };
12
+ /** Both upload paths: over `options.maxBytes` on the ordinary route, over `directUpload.maxBytes` in a policy. One condition, one code for a client to branch on. */
13
+ readonly UPLOAD_TOO_LARGE: {
14
+ readonly message: {
15
+ readonly text: "File is larger than the maximum allowed";
16
+ readonly code: "core.static_asset.upload_too_large";
17
+ };
18
+ readonly statusCode: 413;
19
+ readonly category: "validation";
20
+ };
21
+ /** Deliberately not 404 and deliberately not "expired": a caller learns only that the token is no good, never whether the key it names exists. */
22
+ readonly INVALID_COMMIT_TOKEN: {
23
+ readonly message: {
24
+ readonly text: "Invalid commit token";
25
+ readonly code: "core.static_asset.invalid_commit_token";
26
+ };
27
+ readonly statusCode: 400;
28
+ readonly category: "validation";
29
+ };
30
+ readonly EXPIRED_COMMIT_TOKEN: {
31
+ readonly message: {
32
+ readonly text: "Commit token has expired";
33
+ readonly code: "core.static_asset.expired_commit_token";
34
+ };
35
+ readonly statusCode: 400;
36
+ readonly category: "validation";
37
+ };
4
38
  readonly BUCKET_NAME_INVALID: {
5
39
  readonly message: {
6
40
  readonly text: "Invalid bucket name";
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAIrF,uIAAuI;AACvI,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDuB,CAAC;AAEtD,2GAA2G;AAC3G,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,iBAAkB,SAAQ,eAAe,CAAC,OAAO,iBAAiB,CAAC;KAAG;CACjF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAIrF,uIAAuI;AACvI,eAAO,MAAM,iBAAiB;;;;;;;;;IAS5B,qKAAqK;;;;;;;;;IASrK,kJAAkJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D/F,CAAC;AAEtD,2GAA2G;AAC3G,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,iBAAkB,SAAQ,eAAe,CAAC,OAAO,iBAAiB,CAAC;KAAG;CACjF"}
@@ -5,6 +5,34 @@ const core_1 = require("@venizia/ignis-helpers/core");
5
5
  const common_1 = require("@venizia/ignis-helpers/common");
6
6
  /** Codes a client branches on for a rejected static-asset request. A throw site may override `message` to name the offending value. */
7
7
  exports.StaticAssetErrors = {
8
+ UPLOAD_NOT_AUTHORIZED: {
9
+ message: {
10
+ text: 'Not allowed to request an upload policy',
11
+ code: 'core.static_asset.upload_not_authorized',
12
+ },
13
+ statusCode: common_1.HTTP.ResultCodes.RS_4.Forbidden,
14
+ category: core_1.ErrorScopes.VALIDATION,
15
+ },
16
+ /** Both upload paths: over `options.maxBytes` on the ordinary route, over `directUpload.maxBytes` in a policy. One condition, one code for a client to branch on. */
17
+ UPLOAD_TOO_LARGE: {
18
+ message: {
19
+ text: 'File is larger than the maximum allowed',
20
+ code: 'core.static_asset.upload_too_large',
21
+ },
22
+ statusCode: common_1.HTTP.ResultCodes.RS_4.ContentTooLarge,
23
+ category: core_1.ErrorScopes.VALIDATION,
24
+ },
25
+ /** Deliberately not 404 and deliberately not "expired": a caller learns only that the token is no good, never whether the key it names exists. */
26
+ INVALID_COMMIT_TOKEN: {
27
+ message: { text: 'Invalid commit token', code: 'core.static_asset.invalid_commit_token' },
28
+ statusCode: common_1.HTTP.ResultCodes.RS_4.BadRequest,
29
+ category: core_1.ErrorScopes.VALIDATION,
30
+ },
31
+ EXPIRED_COMMIT_TOKEN: {
32
+ message: { text: 'Commit token has expired', code: 'core.static_asset.expired_commit_token' },
33
+ statusCode: common_1.HTTP.ResultCodes.RS_4.BadRequest,
34
+ category: core_1.ErrorScopes.VALIDATION,
35
+ },
8
36
  BUCKET_NAME_INVALID: {
9
37
  message: { text: 'Invalid bucket name', code: 'core.static_asset.bucket_name_invalid' },
10
38
  statusCode: common_1.HTTP.ResultCodes.RS_4.BadRequest,
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/components/static-asset/common/errors.ts"],"names":[],"mappings":";;;AACA,sDAA0D;AAC1D,0DAAqD;AAEr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C,UAAU;KACjC;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE;YACP,IAAI,EAAE,+CAA+C;YACrD,IAAI,EAAE,oCAAoC;SAC3C;QACD,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU;QAC5C,QAAQ,EAAE,kBAAW,CAAC,UAAU;KACjC;CACkD,CAAC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/components/static-asset/common/errors.ts"],"names":[],"mappings":";;;AACA,sDAA0D;AAC1D,0DAAqD;AAErD,uIAAuI;AAC1H,QAAA,iBAAiB,GAAG;IAC/B,qBAAqB,EAAE;QACrB,OAAO,EAAE;YACP,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,yCAAyC;SAChD;QACD,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS;QAC3C,QAAQ,EAAE,kBAAW,CAAC,UAAU;KACjC;IACD,qKAAqK;IACrK,gBAAgB,EAAE;QAChB,OAAO,EAAE;YACP,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,oCAAoC;SAC3C;QACD,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe;QACjD,QAAQ,EAAE,kBAAW,CAAC,UAAU;KACjC;IACD,kJAAkJ;IAClJ,oBAAoB,EAAE;QACpB,OAAO,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,wCAAwC,EAAE;QACzF,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU;QAC5C,QAAQ,EAAE,kBAAW,CAAC,UAAU;KACjC;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,wCAAwC,EAAE;QAC7F,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU;QAC5C,QAAQ,EAAE,kBAAW,CAAC,UAAU;KACjC;IACD,mBAA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;YACP,IAAI,EAAE,+CAA+C;YACrD,IAAI,EAAE,oCAAoC;SAC3C;QACD,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU;QAC5C,QAAQ,EAAE,kBAAW,CAAC,UAAU;KACjC;CACkD,CAAC"}
@@ -2,4 +2,5 @@ export * from './errors';
2
2
  export * from './constants';
3
3
  export * from './keys';
4
4
  export * from './types';
5
+ export * from './commit-token';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
@@ -18,4 +18,5 @@ __exportStar(require("./errors"), exports);
18
18
  __exportStar(require("./constants"), exports);
19
19
  __exportStar(require("./keys"), exports);
20
20
  __exportStar(require("./types"), exports);
21
+ __exportStar(require("./commit-token"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/static-asset/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/static-asset/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,iDAA+B"}
@@ -1,4 +1,5 @@
1
1
  export declare class StaticAssetComponentBindingKeys {
2
+ /** The options an application registers through `configs.artifacts` land here, because an artifact index carries classes and no options. `application.component(StaticAssetComponent, { options })` passes them directly and wins over this key. */
2
3
  static readonly STATIC_ASSET_COMPONENT_OPTIONS = "@app/static-asset-component/options";
3
4
  }
4
5
  //# sourceMappingURL=keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/keys.ts"],"names":[],"mappings":"AAAA,qBAAa,+BAA+B;IAC1C,MAAM,CAAC,QAAQ,CAAC,8BAA8B,yCAAyC;CACxF"}
1
+ {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/keys.ts"],"names":[],"mappings":"AAAA,qBAAa,+BAA+B;IAC1C,oPAAoP;IACpP,MAAM,CAAC,QAAQ,CAAC,8BAA8B,yCAAyC;CACxF"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StaticAssetComponentBindingKeys = void 0;
4
4
  class StaticAssetComponentBindingKeys {
5
+ /** The options an application registers through `configs.artifacts` land here, because an artifact index carries classes and no options. `application.component(StaticAssetComponent, { options })` passes them directly and wins over this key. */
5
6
  static { this.STATIC_ASSET_COMPONENT_OPTIONS = '@app/static-asset-component/options'; }
6
7
  }
7
8
  exports.StaticAssetComponentBindingKeys = StaticAssetComponentBindingKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../src/components/static-asset/common/keys.ts"],"names":[],"mappings":";;;AAAA,MAAa,+BAA+B;aAC1B,mCAA8B,GAAG,qCAAqC,CAAC;;AADzF,0EAEC"}
1
+ {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../src/components/static-asset/common/keys.ts"],"names":[],"mappings":";;;AAAA,MAAa,+BAA+B;IAC1C,oPAAoP;aACpO,mCAA8B,GAAG,qCAAqC,CAAC;;AAFzF,0EAGC"}
@@ -1,11 +1,11 @@
1
- import type { IAuthRouteConfig } from '../../../base';
2
- import type { BaseRelationalEntity } from '@venizia/ignis-connectors/postgres';
3
- import type { DefaultCRUDRepository } from '@venizia/ignis-connectors/postgres';
4
- import type { AnyType, ValueOrPromise } from '@venizia/ignis-helpers/common';
5
- import type { DiskHelper, IFileStat, IUploadResult } from '@venizia/ignis-helpers';
1
+ import type { BaseRestController, IAuthRouteConfig, TRouteContext } from '../../../base';
2
+ import type { IDuration } from '@venizia/ignis-helpers/common';
3
+ import type { BaseRelationalEntity, DefaultCRUDRepository, TTableObject } from '@venizia/ignis-connectors/postgres';
4
+ import type { DiskHelper, IBucketRef, IFileStat, IObjectLocation, IObjectRef, IStorageHelper, IUploadResult, TUploadNaming } from '@venizia/ignis-helpers';
6
5
  import type { BunS3Helper } from '@venizia/ignis-helpers/bun-s3';
6
+ import type { AnyType, TValueOrAsyncResolver, ValueOrPromise } from '@venizia/ignis-helpers/common';
7
7
  import type { MinioHelper } from '@venizia/ignis-helpers/minio';
8
- import type { TMetaLinkSchema } from '../models';
8
+ import type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from '../models';
9
9
  import type { StaticAssetStorageTypes } from './constants';
10
10
  export type TStaticAssetExtraOptions = {
11
11
  parseMultipartBody?: {
@@ -14,17 +14,28 @@ export type TStaticAssetExtraOptions = {
14
14
  };
15
15
  /** `folderPath` carries the upload query's target folder - dropping it flattens nested uploads. */
16
16
  normalizeNameFn?: (opts: {
17
- originalName: string;
18
- folderPath?: string;
19
- }) => string;
20
- normalizeLinkFn?: (opts: {
21
- bucketName: string;
22
- normalizeName: string;
17
+ file: TUploadNaming;
23
18
  }) => string;
19
+ normalizeLinkFn?: (opts: IObjectLocation) => string;
24
20
  /** Maximum folder nesting depth allowed in object paths. Default: 2 */
25
21
  maxFolderDepth?: number;
22
+ /** Largest file the UPLOAD route accepts, in bytes. Absent means no ceiling. Checked against `content-length` before the body is spooled, and per file after parsing - a multipart body can lie about its total. */
23
+ maxBytes?: number;
26
24
  [key: string]: AnyType;
27
25
  };
26
+ /** Decides the key one uploaded file is stored under. `defaultKey` is what IGNIS would have written. */
27
+ export type TObjectNameResolver = (opts: {
28
+ bucket: IBucketRef;
29
+ file: TUploadNaming;
30
+ defaultKey: string;
31
+ }) => string;
32
+ /** 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. */
33
+ /** 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. */
34
+ export type TDefineExtraRoutes = (opts: {
35
+ controller: BaseRestController;
36
+ helper: IStorageHelper;
37
+ basePath: string;
38
+ }) => void;
28
39
  export type TBucketParams = {
29
40
  bucketName: string;
30
41
  };
@@ -36,6 +47,8 @@ export type TUploadQuery = {
36
47
  principalType?: string;
37
48
  principalId?: string;
38
49
  variant?: string;
50
+ /** Display order within the principal. The caller supplies it; the component never derives one, because reading a maximum and writing max+1 is not atomic. */
51
+ sequence?: number;
39
52
  folderPath?: string;
40
53
  };
41
54
  export type TListQuery = {
@@ -43,38 +56,82 @@ export type TListQuery = {
43
56
  recursive?: string;
44
57
  maxKeys?: string;
45
58
  };
46
- export type TMetaLinkConfig<Schema extends TMetaLinkSchema = TMetaLinkSchema> = {
47
- model: typeof BaseRelationalEntity<Schema>;
48
- repository: DefaultCRUDRepository<Schema>;
59
+ export type TDirectUploadOptions = {
60
+ /** Who may ask for a policy. REQUIRED, not defaulted: this route hands out a write credential, and there is no safe default for that. */
61
+ authorize: (opts: {
62
+ context: TRouteContext;
63
+ }) => ValueOrPromise<boolean>;
64
+ /** Signs the commit token. Keep it out of the repository and out of the client. */
65
+ secretKey: string;
66
+ /** 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. */
67
+ maxBytes: number;
68
+ /** Where a policy may write. The final key is NEVER in a policy, so content cannot be replaced after the commit. Default: `pending/`. */
69
+ pendingPrefix?: string;
70
+ /** How long a policy and its commit token stay good. Default: the helper's POST default. */
71
+ expiresIn?: IDuration;
72
+ /** 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. */
73
+ onCommit?: (opts: {
74
+ bucket: IBucketRef;
75
+ pendingObject: IObjectRef;
76
+ object: IObjectRef;
77
+ }) => ValueOrPromise<void>;
78
+ };
79
+ export type TUploadPolicyRequest = {
80
+ files: Array<{
81
+ fileName: string;
82
+ contentType?: string;
83
+ size?: number;
84
+ }>;
85
+ };
86
+ /** 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. */
87
+ export type TMetaLinkConfig<Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema> = {
88
+ model: TValueOrAsyncResolver<typeof BaseRelationalEntity<Schema>>;
89
+ repository: TValueOrAsyncResolver<DefaultCRUDRepository<Schema>>;
49
90
  createMetaLink?: (opts: {
50
91
  uploadResult: IUploadResult;
51
92
  fileStat: IFileStat;
93
+ /** 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. */
52
94
  query: TUploadQuery;
53
95
  }) => ValueOrPromise<{
54
96
  count: number;
55
- data: Schema;
97
+ data: TTableObject<Schema>;
56
98
  }>;
57
99
  };
58
- export type TStaticAssetsComponentOptions = {
100
+ export type TStaticAssetRoutes = {
101
+ getBuckets?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
102
+ getBucketByName?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
103
+ createBucket?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
104
+ deleteBucket?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
105
+ upload?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
106
+ listObjects?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
107
+ deleteObject?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
108
+ getObjectByName?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
109
+ downloadObjectByName?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
110
+ uploadPolicy?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
111
+ uploadCommit?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
112
+ recreateMetaLink?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
113
+ };
114
+ export type TStaticAssetsComponentOptions<Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema> = {
59
115
  [key: string]: {
60
116
  controller: {
61
117
  name: string;
62
118
  basePath: string;
63
119
  isStrict?: boolean;
64
- routes?: {
65
- getBuckets?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
66
- getBucketByName?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
67
- createBucket?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
68
- deleteBucket?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
69
- upload?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
70
- listObjects?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
71
- deleteObject?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
72
- getObjectByName?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
73
- downloadObjectByName?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
74
- recreateMetaLink?: Partial<Omit<IAuthRouteConfig, 'method' | 'request' | 'responses'>>;
75
- };
120
+ /** `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`. */
121
+ rawObjectPath?: boolean;
122
+ /** 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. */
123
+ bucket?: TValueOrAsyncResolver<string>;
124
+ routes?: TStaticAssetRoutes;
125
+ /** 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. */
126
+ directUpload?: TDirectUploadOptions;
76
127
  };
77
128
  extra?: TStaticAssetExtraOptions;
129
+ /** Decides the stored object name of each uploaded file; absent keeps the storage helper's own naming. */
130
+ resolveObjectName?: TObjectNameResolver;
131
+ /** 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. */
132
+ defineRoutesBefore?: TDefineExtraRoutes;
133
+ /** Registers the application's own routes on the generated controller, after every built-in one. */
134
+ defineExtraRoutes?: TDefineExtraRoutes;
78
135
  } & ({
79
136
  storage: typeof StaticAssetStorageTypes.BUN_S3;
80
137
  helper: BunS3Helper;
@@ -88,7 +145,7 @@ export type TStaticAssetsComponentOptions = {
88
145
  useMetaLink?: false | undefined;
89
146
  } | {
90
147
  useMetaLink: true;
91
- metaLink: TMetaLinkConfig;
148
+ metaLink: TMetaLinkConfig<Schema>;
92
149
  });
93
150
  };
94
151
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/static-asset/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+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,qKAAqK;YACrK,aAAa,CAAC,EAAE,OAAO,CAAC;YAExB,6OAA6O;YAC7O,MAAM,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;YAEvC,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,CACE;QAAE,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE,GAAG;QAAE,WAAW,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;KAAE,CAC/F,CAAC;CACL,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { BaseApplication } from '../../base/applications';
2
2
  import { BaseComponent } from '@venizia/ignis-kernel';
3
3
  import { ValueOrPromise } from '@venizia/ignis-helpers/common';
4
- export declare class StaticAssetComponent extends BaseComponent {
4
+ import { TStaticAssetsComponentOptions } from './common';
5
+ import type { TMetaLinkCompatibleSchema, TMetaLinkSchema } from './models';
6
+ /** `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. */
7
+ export declare class StaticAssetComponent<Schema extends TMetaLinkCompatibleSchema = TMetaLinkSchema> extends BaseComponent<TStaticAssetsComponentOptions<Schema>> {
5
8
  private application;
6
9
  constructor(application: BaseApplication);
7
10
  binding(): ValueOrPromise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/static-asset/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D,qBAAa,oBAAqB,SAAQ,aAAa;IAEC,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,eAAe;IAcjF,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC;CAoCzC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/static-asset/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAmC,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3E,kQAAkQ;AAClQ,qBAAa,oBAAoB,CAC/B,MAAM,SAAS,yBAAyB,GAAG,eAAe,CAC1D,SAAQ,aAAa,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;IAEN,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,eAAe;IAcjF,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC;CAuDzC"}
@@ -21,6 +21,7 @@ const ignis_kernel_2 = require("@venizia/ignis-kernel");
21
21
  const ignis_kernel_3 = require("@venizia/ignis-kernel");
22
22
  const common_1 = require("./common");
23
23
  const controller_1 = require("./controller");
24
+ /** `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. */
24
25
  let StaticAssetComponent = StaticAssetComponent_1 = class StaticAssetComponent extends ignis_kernel_1.BaseComponent {
25
26
  constructor(application) {
26
27
  super({
@@ -35,25 +36,34 @@ let StaticAssetComponent = StaticAssetComponent_1 = class StaticAssetComponent e
35
36
  this.application = application;
36
37
  }
37
38
  binding() {
38
- const componentOptions = this.application.get({
39
- key: common_1.StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS,
40
- });
39
+ // Direct options win. The key is the path for an application that registers this component
40
+ // through `configs.artifacts`, where an index carries classes and no options.
41
+ const componentOptions = this.configuredOptions ??
42
+ this.application.get({
43
+ key: common_1.StaticAssetComponentBindingKeys.STATIC_ASSET_COMPONENT_OPTIONS,
44
+ });
41
45
  for (const [key, opt] of Object.entries(componentOptions)) {
42
- const { storage, controller, helper, extra } = opt;
46
+ const { storage, controller, helper, extra, resolveObjectName, defineRoutesBefore, defineExtraRoutes, } = opt;
43
47
  this.application.controller(controller_1.AssetControllerFactory.defineAssetController({
44
48
  controller,
45
49
  storage,
46
50
  helper,
47
51
  useMetaLink: opt.useMetaLink,
48
52
  metaLink: opt.useMetaLink ? opt.metaLink : undefined,
53
+ resolveObjectName,
54
+ defineRoutesBefore,
55
+ defineExtraRoutes,
49
56
  options: {
50
57
  ...extra,
51
58
  normalizeLinkFn: extra?.normalizeLinkFn ??
52
- (opts => {
53
- // The object route binds `{objectName}` as one Hono path segment, so a nested path must be encoded whole - a raw `/` produces a 404 link.
54
- const encodedPath = encodeURIComponent(opts.normalizeName);
55
- return `${controller.basePath}/buckets/${opts.bucketName}/objects/${encodedPath}`;
56
- }),
59
+ // 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.
60
+ (linkOptions => (0, controller_1.buildObjectLink)({
61
+ basePath: controller.basePath,
62
+ bucket: linkOptions.bucket,
63
+ object: linkOptions.object,
64
+ hasConfiguredBucket: controller.bucket !== undefined,
65
+ rawObjectPath: controller.rawObjectPath,
66
+ })),
57
67
  },
58
68
  }));
59
69
  this.application.logger.info(`[binding] Asset storage is bound | Key: %s | Storage type: %s | UseMetaLink: %s`, key, storage, Boolean(opt.useMetaLink));
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/static-asset/component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,wDAAsD;AACtD,8CAAyC;AACzC,wDAAqD;AACrD,wDAAgD;AAEhD,qCAA0F;AAC1F,6CAAsD;AAEtD,IAAa,oBAAoB,4BAAjC,MAAa,oBAAqB,SAAQ,4BAAa;IACrD,YAC8D,WAA4B;QAExF,KAAK,CAAC;YACJ,KAAK,EAAE,sBAAoB,CAAC,IAAI;YAChC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE;YACrD,QAAQ,EAAE;gBACR,CAAC,wCAA+B,CAAC,8BAA8B,CAAC,EAC9D,sBAAO,CAAC,IAAI,CAAgC;oBAC1C,GAAG,EAAE,wCAA+B,CAAC,8BAA8B;iBACpE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;aACjB;SACF,CAAC,CAAC;QAXyD,gBAAW,GAAX,WAAW,CAAiB;IAY1F,CAAC;IAEQ,OAAO;QACd,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAgC;YAC3E,GAAG,EAAE,wCAA+B,CAAC,8BAA8B;SACpE,CAAC,CAAC;QAEH,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC1D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;YAEnD,IAAI,CAAC,WAAW,CAAC,UAAU,CACzB,mCAAsB,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,OAAO,EAAE;oBACP,GAAG,KAAK;oBACR,eAAe,EACb,KAAK,EAAE,eAAe;wBACtB,CAAC,IAAI,CAAC,EAAE;4BACN,0IAA0I;4BAC1I,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;4BAC3D,OAAO,GAAG,UAAU,CAAC,QAAQ,YAAY,IAAI,CAAC,UAAU,YAAY,WAAW,EAAE,CAAC;wBACpF,CAAC,CAAC;iBACL;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;AApDY,oDAAoB;+BAApB,oBAAoB;IAE5B,WAAA,IAAA,iBAAM,EAAC,EAAE,GAAG,EAAE,2BAAY,CAAC,oBAAoB,EAAE,CAAC,CAAA;qCAAsB,8BAAe;GAF/E,oBAAoB,CAoDhC"}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/components/static-asset/component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAsD;AACtD,wDAAsD;AACtD,8CAAyC;AACzC,wDAAqD;AACrD,wDAAgD;AAEhD,qCAA0F;AAE1F,6CAAuE;AAEvE,kQAAkQ;AAClQ,IAAa,oBAAoB,4BAAjC,MAAa,oBAEX,SAAQ,4BAAoD;IAC5D,YAC8D,WAA4B;QAExF,KAAK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