@vandenberghinc/volt 1.1.26 → 1.1.28

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 (502) hide show
  1. package/backend/dist/cjs/{blacklist.d.ts → backend/src/blacklist.d.ts} +5 -3
  2. package/backend/dist/cjs/{blacklist.js → backend/src/blacklist.js} +8 -5
  3. package/backend/dist/cjs/{cli.js → backend/src/cli.js} +29 -47
  4. package/backend/dist/cjs/backend/src/database/collection.d.ts +1543 -0
  5. package/backend/dist/cjs/backend/src/database/collection.js +3042 -0
  6. package/backend/dist/cjs/backend/src/database/database.d.ts +66 -0
  7. package/backend/dist/cjs/{database → backend/src/database}/database.js +48 -43
  8. package/backend/dist/cjs/backend/src/database/filters/filters.d.ts +6 -0
  9. package/backend/dist/cjs/backend/src/database/filters/filters.js +15 -0
  10. package/backend/dist/cjs/backend/src/database/filters/strict_filter.d.ts +223 -0
  11. package/backend/dist/cjs/backend/src/database/filters/strict_filter.js +15 -0
  12. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.js +443 -0
  13. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.js +15 -0
  14. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.d.ts +50 -0
  15. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.js +15 -0
  16. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.d.ts +76 -0
  17. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.js +15 -0
  18. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.d.ts +75 -0
  19. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.js +15 -0
  20. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.d.ts +219 -0
  21. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.js +15 -0
  22. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.d.ts +165 -0
  23. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.js +15 -0
  24. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.d.ts +5 -0
  25. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.js +355 -0
  26. package/backend/dist/cjs/backend/src/database/flatten.d.ts +75 -0
  27. package/backend/dist/cjs/{logger.js → backend/src/database/flatten.js} +18 -7
  28. package/backend/dist/cjs/backend/src/database/flatten_test.js +175 -0
  29. package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +461 -0
  30. package/backend/dist/cjs/backend/src/database/quota/quota.js +1014 -0
  31. package/backend/dist/cjs/backend/src/database/quota/quota_v1.d.ts +534 -0
  32. package/backend/dist/cjs/backend/src/database/quota/quota_v1.js +1087 -0
  33. package/backend/dist/cjs/backend/src/database/quota/safe_int.d.ts +293 -0
  34. package/backend/dist/cjs/backend/src/database/quota/safe_int.js +573 -0
  35. package/backend/dist/{esm → cjs/backend/src}/endpoint.d.ts +69 -46
  36. package/backend/dist/cjs/{endpoint.js → backend/src/endpoint.js} +87 -101
  37. package/backend/dist/cjs/backend/src/errors/index.d.ts +7 -0
  38. package/backend/dist/cjs/backend/src/errors/index.js +25 -0
  39. package/backend/dist/{esm/utils.d.ts → cjs/backend/src/errors/internal_external.d.ts} +14 -22
  40. package/backend/dist/cjs/backend/src/errors/internal_external.js +85 -0
  41. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +38 -0
  42. package/backend/dist/cjs/{mutex.js → backend/src/errors/invalid_usage_error.js} +20 -37
  43. package/backend/dist/cjs/backend/src/errors/system_error.d.ts +230 -0
  44. package/backend/dist/cjs/backend/src/errors/system_error.js +393 -0
  45. package/backend/dist/cjs/backend/src/events.d.ts +54 -0
  46. package/backend/dist/cjs/backend/src/events.js +15 -0
  47. package/backend/dist/cjs/{frontend.js → backend/src/frontend.js} +1 -1
  48. package/backend/dist/cjs/{image_endpoint.d.ts → backend/src/image_endpoint.d.ts} +16 -1
  49. package/backend/dist/cjs/{image_endpoint.js → backend/src/image_endpoint.js} +3 -5
  50. package/backend/dist/cjs/backend/src/logger.d.ts +5 -0
  51. package/backend/dist/cjs/backend/src/logger.js +15 -0
  52. package/backend/dist/cjs/backend/src/meta.d.ts +64 -0
  53. package/backend/dist/cjs/{meta.js → backend/src/meta.js} +9 -12
  54. package/backend/dist/cjs/backend/src/payments/paddle.d.ts +326 -0
  55. package/backend/dist/cjs/{payments → backend/src/payments}/paddle.js +377 -327
  56. package/backend/dist/cjs/backend/src/plugins/browser.d.ts +1 -0
  57. package/backend/dist/cjs/backend/src/plugins/browser.js +15 -0
  58. package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +248 -0
  59. package/backend/dist/cjs/backend/src/plugins/mail/mail.js +379 -0
  60. package/backend/dist/{esm → cjs/backend/src}/plugins/mail/ui.d.ts +23 -0
  61. package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +1 -0
  62. package/backend/dist/cjs/backend/src/rate_limit.d.ts +145 -0
  63. package/backend/dist/cjs/backend/src/rate_limit.js +549 -0
  64. package/backend/dist/cjs/{route.d.ts → backend/src/route.d.ts} +3 -10
  65. package/backend/dist/cjs/{route.js → backend/src/route.js} +23 -21
  66. package/backend/dist/cjs/backend/src/server.d.ts +485 -0
  67. package/backend/dist/cjs/{server.js → backend/src/server.js} +688 -873
  68. package/backend/dist/cjs/backend/src/splash_screen.d.ts +80 -0
  69. package/backend/dist/cjs/{splash_screen.js → backend/src/splash_screen.js} +24 -3
  70. package/backend/dist/cjs/backend/src/status.d.ts +74 -0
  71. package/backend/dist/cjs/{status.js → backend/src/status.js} +64 -64
  72. package/backend/dist/cjs/backend/src/stream.d.ts +376 -0
  73. package/backend/dist/cjs/{stream.js → backend/src/stream.js} +299 -276
  74. package/backend/dist/cjs/backend/src/users.d.ts +807 -0
  75. package/backend/dist/cjs/backend/src/users.js +1971 -0
  76. package/backend/dist/cjs/backend/src/utils.d.ts +16 -0
  77. package/backend/dist/cjs/{utils.js → backend/src/utils.js} +14 -77
  78. package/backend/dist/{esm → cjs/backend/src}/view.d.ts +33 -11
  79. package/backend/dist/cjs/backend/src/view.js +508 -0
  80. package/backend/dist/{esm → cjs/backend/src}/volt.d.ts +10 -1
  81. package/backend/dist/cjs/{volt.js → backend/src/volt.js} +8 -5
  82. package/backend/dist/cjs/frontend/src/modules/request.d.ts +70 -0
  83. package/backend/dist/cjs/frontend/src/modules/request.js +99 -0
  84. package/backend/dist/esm/{blacklist.d.ts → backend/src/blacklist.d.ts} +5 -3
  85. package/backend/dist/esm/{blacklist.js → backend/src/blacklist.js} +9 -6
  86. package/backend/dist/esm/{cli.js → backend/src/cli.js} +43 -60
  87. package/backend/dist/esm/backend/src/database/collection.d.ts +1543 -0
  88. package/backend/dist/esm/backend/src/database/collection.js +3510 -0
  89. package/backend/dist/esm/backend/src/database/database.d.ts +66 -0
  90. package/backend/dist/esm/{database → backend/src/database}/database.js +62 -103
  91. package/backend/dist/esm/backend/src/database/document.d.ts +1 -0
  92. package/backend/dist/esm/backend/src/database/document.js +558 -0
  93. package/backend/dist/esm/backend/src/database/filters/filters.d.ts +6 -0
  94. package/backend/dist/esm/backend/src/database/filters/filters.js +1 -0
  95. package/backend/dist/esm/backend/src/database/filters/strict_filter.d.ts +223 -0
  96. package/backend/dist/esm/backend/src/database/filters/strict_filter.js +3 -0
  97. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.d.ts +1 -0
  98. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.js +505 -0
  99. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.d.ts +1 -0
  100. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.js +712 -0
  101. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.d.ts +50 -0
  102. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.js +5 -0
  103. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.d.ts +76 -0
  104. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.js +44 -0
  105. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.d.ts +75 -0
  106. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.js +5 -0
  107. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.d.ts +219 -0
  108. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.js +1 -0
  109. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.d.ts +165 -0
  110. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.js +5 -0
  111. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.d.ts +5 -0
  112. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.js +405 -0
  113. package/backend/dist/esm/backend/src/database/flatten.d.ts +75 -0
  114. package/backend/dist/esm/backend/src/database/flatten.js +22 -0
  115. package/backend/dist/esm/backend/src/database/flatten_test.d.ts +1 -0
  116. package/backend/dist/esm/backend/src/database/flatten_test.js +174 -0
  117. package/backend/dist/esm/backend/src/database/quota/quota.d.ts +461 -0
  118. package/backend/dist/esm/backend/src/database/quota/quota.js +1118 -0
  119. package/backend/dist/esm/backend/src/database/quota/quota_v1.d.ts +534 -0
  120. package/backend/dist/esm/backend/src/database/quota/quota_v1.js +1242 -0
  121. package/backend/dist/esm/backend/src/database/quota/safe_int.d.ts +293 -0
  122. package/backend/dist/esm/backend/src/database/quota/safe_int.js +602 -0
  123. package/backend/dist/{cjs → esm/backend/src}/endpoint.d.ts +69 -46
  124. package/backend/dist/esm/{endpoint.js → backend/src/endpoint.js} +136 -127
  125. package/backend/dist/esm/backend/src/errors/index.d.ts +7 -0
  126. package/backend/dist/esm/backend/src/errors/index.js +7 -0
  127. package/backend/dist/{cjs/utils.d.ts → esm/backend/src/errors/internal_external.d.ts} +14 -22
  128. package/backend/dist/esm/backend/src/errors/internal_external.js +70 -0
  129. package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +38 -0
  130. package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +30 -0
  131. package/backend/dist/esm/backend/src/errors/system_error.d.ts +230 -0
  132. package/backend/dist/esm/backend/src/errors/system_error.js +402 -0
  133. package/backend/dist/esm/backend/src/events.d.ts +54 -0
  134. package/backend/dist/esm/backend/src/events.js +5 -0
  135. package/backend/dist/esm/{frontend.js → backend/src/frontend.js} +1 -1
  136. package/backend/dist/esm/{image_endpoint.d.ts → backend/src/image_endpoint.d.ts} +16 -1
  137. package/backend/dist/esm/{image_endpoint.js → backend/src/image_endpoint.js} +16 -20
  138. package/backend/dist/esm/backend/src/logger.d.ts +5 -0
  139. package/backend/dist/esm/backend/src/logger.js +8 -0
  140. package/backend/dist/esm/backend/src/meta.d.ts +64 -0
  141. package/backend/dist/esm/{meta.js → backend/src/meta.js} +15 -54
  142. package/backend/dist/esm/backend/src/payments/paddle.d.ts +326 -0
  143. package/backend/dist/esm/{payments → backend/src/payments}/paddle.js +417 -452
  144. package/backend/dist/esm/backend/src/plugins/browser.d.ts +1 -0
  145. package/backend/dist/esm/backend/src/plugins/browser.js +170 -0
  146. package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +248 -0
  147. package/backend/dist/esm/backend/src/plugins/mail/mail.js +389 -0
  148. package/backend/dist/{cjs → esm/backend/src}/plugins/mail/ui.d.ts +23 -0
  149. package/backend/dist/esm/{plugins → backend/src/plugins}/mail/ui.js +3 -6
  150. package/backend/dist/esm/backend/src/plugins/pdf.d.ts +1 -0
  151. package/backend/dist/esm/{plugins → backend/src/plugins}/pdf.js +3 -3
  152. package/backend/dist/esm/backend/src/rate_limit.d.ts +145 -0
  153. package/backend/dist/esm/backend/src/rate_limit.js +667 -0
  154. package/backend/dist/esm/{route.d.ts → backend/src/route.d.ts} +3 -10
  155. package/backend/dist/esm/{route.js → backend/src/route.js} +26 -21
  156. package/backend/dist/esm/backend/src/server.d.ts +485 -0
  157. package/backend/dist/esm/{server.js → backend/src/server.js} +891 -1441
  158. package/backend/dist/esm/backend/src/splash_screen.d.ts +80 -0
  159. package/backend/dist/esm/{splash_screen.js → backend/src/splash_screen.js} +42 -55
  160. package/backend/dist/esm/backend/src/status.d.ts +74 -0
  161. package/backend/dist/esm/backend/src/status.js +199 -0
  162. package/backend/dist/esm/backend/src/stream.d.ts +376 -0
  163. package/backend/dist/esm/{stream.js → backend/src/stream.js} +327 -292
  164. package/backend/dist/esm/backend/src/users.d.ts +809 -0
  165. package/backend/dist/esm/backend/src/users.js +2140 -0
  166. package/backend/dist/esm/backend/src/utils.d.ts +16 -0
  167. package/backend/dist/esm/{utils.js → backend/src/utils.js} +20 -81
  168. package/backend/dist/{cjs → esm/backend/src}/view.d.ts +33 -11
  169. package/backend/dist/esm/{view.js → backend/src/view.js} +266 -86
  170. package/backend/dist/{cjs → esm/backend/src}/volt.d.ts +10 -1
  171. package/backend/dist/esm/{volt.js → backend/src/volt.js} +7 -4
  172. package/backend/dist/esm/frontend/src/modules/request.d.ts +70 -0
  173. package/backend/dist/esm/frontend/src/modules/request.js +117 -0
  174. package/frontend/dist/backend/src/database/collection.d.ts +1543 -0
  175. package/frontend/dist/backend/src/database/collection.js +3510 -0
  176. package/frontend/dist/backend/src/database/database.d.ts +66 -0
  177. package/frontend/dist/backend/src/database/database.js +196 -0
  178. package/frontend/dist/backend/src/database/filters/filters.d.ts +6 -0
  179. package/frontend/dist/backend/src/database/filters/filters.js +1 -0
  180. package/frontend/dist/backend/src/database/filters/strict_filter.d.ts +223 -0
  181. package/frontend/dist/backend/src/database/filters/strict_filter.js +3 -0
  182. package/frontend/dist/backend/src/database/filters/strict_update_filter.d.ts +165 -0
  183. package/frontend/dist/backend/src/database/filters/strict_update_filter.js +5 -0
  184. package/frontend/dist/backend/src/database/flatten.d.ts +75 -0
  185. package/frontend/dist/backend/src/database/flatten.js +22 -0
  186. package/frontend/dist/backend/src/endpoint.d.ts +204 -0
  187. package/frontend/dist/backend/src/endpoint.js +570 -0
  188. package/frontend/dist/backend/src/errors/index.d.ts +7 -0
  189. package/frontend/dist/backend/src/errors/index.js +7 -0
  190. package/frontend/dist/backend/src/errors/internal_external.d.ts +38 -0
  191. package/frontend/dist/backend/src/errors/internal_external.js +70 -0
  192. package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +38 -0
  193. package/frontend/dist/backend/src/errors/invalid_usage_error.js +30 -0
  194. package/frontend/dist/backend/src/errors/system_error.d.ts +230 -0
  195. package/frontend/dist/backend/src/errors/system_error.js +402 -0
  196. package/frontend/dist/backend/src/events.d.ts +54 -0
  197. package/frontend/dist/backend/src/events.js +5 -0
  198. package/frontend/dist/backend/src/frontend.d.ts +11 -0
  199. package/frontend/dist/backend/src/frontend.js +12 -0
  200. package/frontend/dist/backend/src/image_endpoint.d.ts +39 -0
  201. package/frontend/dist/backend/src/image_endpoint.js +202 -0
  202. package/frontend/dist/backend/src/meta.d.ts +64 -0
  203. package/frontend/dist/backend/src/meta.js +110 -0
  204. package/frontend/dist/backend/src/payments/paddle.d.ts +326 -0
  205. package/frontend/dist/backend/src/payments/paddle.js +2256 -0
  206. package/frontend/dist/backend/src/plugins/mail/mail.d.ts +248 -0
  207. package/frontend/dist/backend/src/plugins/mail/mail.js +389 -0
  208. package/{backend/dist/esm/plugins/mail.d.ts → frontend/dist/backend/src/plugins/mail/ui.d.ts} +23 -0
  209. package/{backend/dist/esm/plugins/mail.js → frontend/dist/backend/src/plugins/mail/ui.js} +3 -6
  210. package/frontend/dist/backend/src/rate_limit.d.ts +145 -0
  211. package/frontend/dist/backend/src/rate_limit.js +673 -0
  212. package/frontend/dist/backend/src/route.d.ts +35 -0
  213. package/frontend/dist/backend/src/route.js +212 -0
  214. package/frontend/dist/backend/src/server.d.ts +485 -0
  215. package/frontend/dist/backend/src/server.js +2670 -0
  216. package/frontend/dist/backend/src/splash_screen.d.ts +80 -0
  217. package/frontend/dist/backend/src/splash_screen.js +135 -0
  218. package/frontend/dist/backend/src/status.d.ts +74 -0
  219. package/frontend/dist/backend/src/status.js +199 -0
  220. package/frontend/dist/backend/src/stream.d.ts +376 -0
  221. package/frontend/dist/backend/src/stream.js +1007 -0
  222. package/frontend/dist/backend/src/users.d.ts +807 -0
  223. package/frontend/dist/backend/src/users.js +2118 -0
  224. package/frontend/dist/backend/src/utils.d.ts +16 -0
  225. package/frontend/dist/backend/src/utils.js +241 -0
  226. package/frontend/dist/backend/src/view.d.ts +162 -0
  227. package/frontend/dist/backend/src/view.js +720 -0
  228. package/frontend/dist/frontend/src/elements/base.d.ts +4414 -0
  229. package/frontend/dist/{elements → frontend/src/elements}/base.js +3624 -260
  230. package/frontend/dist/frontend/src/elements/module.d.ts +95 -0
  231. package/frontend/dist/{elements → frontend/src/elements}/module.js +53 -52
  232. package/frontend/dist/frontend/src/elements/types.d.ts +52 -0
  233. package/frontend/dist/frontend/src/elements/types.js +5 -0
  234. package/frontend/dist/frontend/src/modules/attachment.d.ts +126 -0
  235. package/frontend/dist/frontend/src/modules/attachment.js +306 -0
  236. package/frontend/dist/frontend/src/modules/auth.d.ts +44 -0
  237. package/frontend/dist/frontend/src/modules/auth.js +80 -0
  238. package/frontend/dist/{modules → frontend/src/modules}/color.js +2 -2
  239. package/frontend/dist/frontend/src/modules/compression.d.ts +39 -0
  240. package/frontend/dist/frontend/src/modules/compression.js +102 -0
  241. package/frontend/dist/frontend/src/modules/cookies.d.ts +44 -0
  242. package/frontend/dist/frontend/src/modules/cookies.js +143 -0
  243. package/frontend/dist/frontend/src/modules/events.d.ts +31 -0
  244. package/frontend/dist/frontend/src/modules/events.js +74 -0
  245. package/frontend/dist/frontend/src/modules/google.d.ts +23 -0
  246. package/frontend/dist/frontend/src/modules/google.js +52 -0
  247. package/frontend/dist/frontend/src/modules/meta.d.ts +14 -0
  248. package/frontend/dist/{modules → frontend/src/modules}/meta.js +9 -7
  249. package/frontend/dist/{modules → frontend/src/modules}/paddle.d.ts +37 -134
  250. package/frontend/dist/{modules → frontend/src/modules}/paddle.js +620 -568
  251. package/frontend/dist/frontend/src/modules/request.d.ts +70 -0
  252. package/frontend/dist/frontend/src/modules/request.js +117 -0
  253. package/frontend/dist/frontend/src/modules/settings.d.ts +3 -0
  254. package/frontend/dist/frontend/src/modules/settings.js +5 -0
  255. package/frontend/dist/frontend/src/modules/statics.d.ts +21 -0
  256. package/frontend/dist/{modules → frontend/src/modules}/statics.js +15 -18
  257. package/frontend/dist/frontend/src/modules/support.d.ts +30 -0
  258. package/frontend/dist/frontend/src/modules/support.js +53 -0
  259. package/frontend/dist/{modules → frontend/src/modules}/theme.d.ts +67 -0
  260. package/frontend/dist/{modules → frontend/src/modules}/theme.js +68 -38
  261. package/frontend/dist/frontend/src/modules/themes.d.ts +12 -0
  262. package/frontend/dist/frontend/src/modules/themes.js +22 -0
  263. package/frontend/dist/frontend/src/modules/user.d.ts +164 -0
  264. package/frontend/dist/frontend/src/modules/user.js +268 -0
  265. package/frontend/dist/frontend/src/modules/utils.d.ts +176 -0
  266. package/frontend/dist/frontend/src/modules/utils.js +569 -0
  267. package/frontend/dist/frontend/src/types/gradient.d.ts +29 -0
  268. package/frontend/dist/{types → frontend/src/types}/gradient.js +14 -18
  269. package/frontend/dist/frontend/src/ui/border_button.d.ts +94 -0
  270. package/frontend/dist/{ui → frontend/src/ui}/border_button.js +7 -13
  271. package/frontend/dist/frontend/src/ui/button.d.ts +28 -0
  272. package/frontend/dist/{ui → frontend/src/ui}/button.js +21 -12
  273. package/frontend/dist/frontend/src/ui/canvas.d.ts +138 -0
  274. package/frontend/dist/{ui → frontend/src/ui}/canvas.js +88 -55
  275. package/frontend/dist/frontend/src/ui/checkbox.d.ts +74 -0
  276. package/frontend/dist/{ui → frontend/src/ui}/checkbox.js +80 -41
  277. package/frontend/dist/{ui → frontend/src/ui}/code.d.ts +73 -6
  278. package/frontend/dist/{ui → frontend/src/ui}/code.js +55 -52
  279. package/frontend/dist/{ui → frontend/src/ui}/context_menu.d.ts +4 -0
  280. package/frontend/dist/{ui → frontend/src/ui}/context_menu.js +12 -17
  281. package/frontend/dist/{ui → frontend/src/ui}/css.d.ts +4 -0
  282. package/frontend/dist/{ui → frontend/src/ui}/css.js +3 -3
  283. package/frontend/dist/{ui → frontend/src/ui}/divider.d.ts +4 -0
  284. package/frontend/dist/{ui → frontend/src/ui}/divider.js +3 -3
  285. package/frontend/dist/{ui → frontend/src/ui}/dropdown.d.ts +57 -2
  286. package/frontend/dist/{ui → frontend/src/ui}/dropdown.js +87 -94
  287. package/frontend/dist/{ui → frontend/src/ui}/for_each.d.ts +4 -0
  288. package/frontend/dist/{ui → frontend/src/ui}/for_each.js +3 -3
  289. package/frontend/dist/{ui → frontend/src/ui}/form.d.ts +6 -2
  290. package/frontend/dist/{ui → frontend/src/ui}/form.js +10 -7
  291. package/frontend/dist/frontend/src/ui/frame_modes.d.ts +37 -0
  292. package/frontend/dist/{ui → frontend/src/ui}/frame_modes.js +16 -22
  293. package/frontend/dist/{ui → frontend/src/ui}/google_map.d.ts +4 -0
  294. package/frontend/dist/{ui → frontend/src/ui}/google_map.js +4 -4
  295. package/frontend/dist/{ui → frontend/src/ui}/gradient.d.ts +4 -0
  296. package/frontend/dist/{ui → frontend/src/ui}/gradient.js +3 -3
  297. package/frontend/dist/{ui → frontend/src/ui}/image.d.ts +4 -0
  298. package/frontend/dist/{ui → frontend/src/ui}/image.js +5 -5
  299. package/frontend/dist/frontend/src/ui/input.d.ts +392 -0
  300. package/frontend/dist/{ui → frontend/src/ui}/input.js +346 -360
  301. package/frontend/dist/{ui → frontend/src/ui}/link.d.ts +4 -0
  302. package/frontend/dist/{ui → frontend/src/ui}/link.js +3 -3
  303. package/frontend/dist/{ui → frontend/src/ui}/list.d.ts +4 -0
  304. package/frontend/dist/{ui → frontend/src/ui}/list.js +12 -6
  305. package/frontend/dist/frontend/src/ui/loader_button.d.ts +80 -0
  306. package/frontend/dist/{ui → frontend/src/ui}/loader_button.js +35 -47
  307. package/frontend/dist/frontend/src/ui/loaders.d.ts +57 -0
  308. package/frontend/dist/{ui → frontend/src/ui}/loaders.js +11 -11
  309. package/frontend/dist/{ui → frontend/src/ui}/popup.d.ts +11 -6
  310. package/frontend/dist/{ui → frontend/src/ui}/popup.js +32 -18
  311. package/frontend/dist/frontend/src/ui/pseudo.d.ts +44 -0
  312. package/frontend/dist/{ui → frontend/src/ui}/pseudo.js +84 -8
  313. package/frontend/dist/{ui → frontend/src/ui}/scroller.d.ts +14 -2
  314. package/frontend/dist/{ui → frontend/src/ui}/scroller.js +37 -43
  315. package/frontend/dist/{ui → frontend/src/ui}/slider.d.ts +5 -1
  316. package/frontend/dist/{ui → frontend/src/ui}/slider.js +4 -4
  317. package/frontend/dist/{ui → frontend/src/ui}/spacer.d.ts +4 -0
  318. package/frontend/dist/{ui → frontend/src/ui}/spacer.js +3 -3
  319. package/frontend/dist/{ui → frontend/src/ui}/span.d.ts +4 -0
  320. package/frontend/dist/{ui → frontend/src/ui}/span.js +3 -3
  321. package/frontend/dist/{ui → frontend/src/ui}/stack.d.ts +4 -0
  322. package/frontend/dist/{ui → frontend/src/ui}/stack.js +3 -9
  323. package/frontend/dist/frontend/src/ui/steps.d.ts +131 -0
  324. package/frontend/dist/{ui → frontend/src/ui}/steps.js +30 -45
  325. package/frontend/dist/{ui → frontend/src/ui}/style.d.ts +4 -0
  326. package/frontend/dist/{ui → frontend/src/ui}/style.js +3 -3
  327. package/frontend/dist/{ui → frontend/src/ui}/switch.d.ts +5 -1
  328. package/frontend/dist/{ui → frontend/src/ui}/switch.js +4 -4
  329. package/frontend/dist/{ui → frontend/src/ui}/table.d.ts +4 -0
  330. package/frontend/dist/{ui → frontend/src/ui}/table.js +6 -6
  331. package/frontend/dist/{ui → frontend/src/ui}/tabs.d.ts +45 -3
  332. package/frontend/dist/{ui → frontend/src/ui}/tabs.js +65 -40
  333. package/frontend/dist/{ui → frontend/src/ui}/text.d.ts +4 -0
  334. package/frontend/dist/{ui → frontend/src/ui}/text.js +3 -3
  335. package/frontend/dist/frontend/src/ui/title.d.ts +91 -0
  336. package/frontend/dist/frontend/src/ui/title.js +272 -0
  337. package/frontend/dist/{ui → frontend/src/ui}/view.d.ts +4 -0
  338. package/frontend/dist/{ui → frontend/src/ui}/view.js +3 -3
  339. package/frontend/dist/{volt.d.ts → frontend/src/volt.d.ts} +3 -0
  340. package/frontend/dist/{volt.js → frontend/src/volt.js} +4 -0
  341. package/frontend/tools/bundle_d_ts.js +71 -0
  342. package/frontend/tools/convert_to_jsdoc_input.txt +9452 -0
  343. package/frontend/tools/convert_to_jsdoc_output.txt +7626 -0
  344. package/frontend/tools/convert_to_jsdoc_tmp.js +345 -0
  345. package/package.json +11 -12
  346. package/backend/dist/cjs/database/collection.d.ts +0 -160
  347. package/backend/dist/cjs/database/collection.js +0 -842
  348. package/backend/dist/cjs/database/database.d.ts +0 -121
  349. package/backend/dist/cjs/database/document.d.ts +0 -131
  350. package/backend/dist/cjs/database/document.js +0 -224
  351. package/backend/dist/cjs/database.d.ts +0 -502
  352. package/backend/dist/cjs/database.js +0 -2248
  353. package/backend/dist/cjs/logger.d.ts +0 -3
  354. package/backend/dist/cjs/meta.d.ts +0 -50
  355. package/backend/dist/cjs/mutex.d.ts +0 -24
  356. package/backend/dist/cjs/payments/paddle.d.ts +0 -160
  357. package/backend/dist/cjs/plugins/browser.d.ts +0 -36
  358. package/backend/dist/cjs/plugins/browser.js +0 -198
  359. package/backend/dist/cjs/plugins/css.d.ts +0 -11
  360. package/backend/dist/cjs/plugins/css.js +0 -80
  361. package/backend/dist/cjs/plugins/mail.d.ts +0 -277
  362. package/backend/dist/cjs/plugins/mail.js +0 -1370
  363. package/backend/dist/cjs/plugins/ts/compiler.d.ts +0 -139
  364. package/backend/dist/cjs/plugins/ts/compiler.js +0 -750
  365. package/backend/dist/cjs/plugins/ts/preprocessing.d.ts +0 -14
  366. package/backend/dist/cjs/plugins/ts/preprocessing.js +0 -440
  367. package/backend/dist/cjs/rate_limit.d.ts +0 -63
  368. package/backend/dist/cjs/rate_limit.js +0 -348
  369. package/backend/dist/cjs/request.deprc.d.ts +0 -48
  370. package/backend/dist/cjs/request.deprc.js +0 -572
  371. package/backend/dist/cjs/response.deprc.d.ts +0 -55
  372. package/backend/dist/cjs/response.deprc.js +0 -275
  373. package/backend/dist/cjs/server.d.ts +0 -342
  374. package/backend/dist/cjs/splash_screen.d.ts +0 -35
  375. package/backend/dist/cjs/status.d.ts +0 -61
  376. package/backend/dist/cjs/stream.d.ts +0 -79
  377. package/backend/dist/cjs/users.d.ts +0 -111
  378. package/backend/dist/cjs/users.js +0 -1817
  379. package/backend/dist/cjs/view.js +0 -352
  380. package/backend/dist/cjs/vinc.dev.d.ts +0 -3
  381. package/backend/dist/cjs/vinc.dev.js +0 -7
  382. package/backend/dist/css/adyen.css +0 -92
  383. package/backend/dist/css/volt.css +0 -70
  384. package/backend/dist/esm/database/collection.d.ts +0 -160
  385. package/backend/dist/esm/database/collection.js +0 -1328
  386. package/backend/dist/esm/database/database.d.ts +0 -121
  387. package/backend/dist/esm/database/document.d.ts +0 -131
  388. package/backend/dist/esm/database/document.js +0 -247
  389. package/backend/dist/esm/database.d.ts +0 -502
  390. package/backend/dist/esm/database.js +0 -2423
  391. package/backend/dist/esm/file_watcher.js +0 -329
  392. package/backend/dist/esm/logger.d.ts +0 -3
  393. package/backend/dist/esm/logger.js +0 -11
  394. package/backend/dist/esm/meta.d.ts +0 -50
  395. package/backend/dist/esm/mutex.d.ts +0 -24
  396. package/backend/dist/esm/mutex.js +0 -48
  397. package/backend/dist/esm/payments/paddle.d.ts +0 -160
  398. package/backend/dist/esm/plugins/browser.d.ts +0 -36
  399. package/backend/dist/esm/plugins/browser.js +0 -176
  400. package/backend/dist/esm/plugins/css.d.ts +0 -11
  401. package/backend/dist/esm/plugins/css.js +0 -90
  402. package/backend/dist/esm/plugins/ts/compiler.d.ts +0 -139
  403. package/backend/dist/esm/plugins/ts/compiler.js +0 -1194
  404. package/backend/dist/esm/plugins/ts/preprocessing.d.ts +0 -14
  405. package/backend/dist/esm/plugins/ts/preprocessing.js +0 -726
  406. package/backend/dist/esm/rate_limit.d.ts +0 -63
  407. package/backend/dist/esm/rate_limit.js +0 -417
  408. package/backend/dist/esm/request.deprc.d.ts +0 -48
  409. package/backend/dist/esm/request.deprc.js +0 -572
  410. package/backend/dist/esm/response.deprc.d.ts +0 -55
  411. package/backend/dist/esm/response.deprc.js +0 -275
  412. package/backend/dist/esm/server.d.ts +0 -342
  413. package/backend/dist/esm/splash_screen.d.ts +0 -35
  414. package/backend/dist/esm/status.d.ts +0 -61
  415. package/backend/dist/esm/status.js +0 -197
  416. package/backend/dist/esm/stream.d.ts +0 -79
  417. package/backend/dist/esm/users.d.ts +0 -111
  418. package/backend/dist/esm/users.js +0 -1935
  419. package/backend/dist/esm/vinc.dev.d.ts +0 -3
  420. package/backend/dist/esm/vinc.dev.js +0 -7
  421. package/frontend/dist/elements/base.d.ts +0 -9889
  422. package/frontend/dist/elements/module.d.ts +0 -30
  423. package/frontend/dist/modules/array.d.ts +0 -94
  424. package/frontend/dist/modules/array.js +0 -634
  425. package/frontend/dist/modules/auth.d.ts +0 -46
  426. package/frontend/dist/modules/auth.js +0 -139
  427. package/frontend/dist/modules/colors.d.ts +0 -1
  428. package/frontend/dist/modules/colors.js +0 -417
  429. package/frontend/dist/modules/compression.d.ts +0 -6
  430. package/frontend/dist/modules/compression.js +0 -999
  431. package/frontend/dist/modules/cookies.d.ts +0 -18
  432. package/frontend/dist/modules/cookies.js +0 -167
  433. package/frontend/dist/modules/date.d.ts +0 -142
  434. package/frontend/dist/modules/date.js +0 -493
  435. package/frontend/dist/modules/events.d.ts +0 -8
  436. package/frontend/dist/modules/events.js +0 -91
  437. package/frontend/dist/modules/google.d.ts +0 -11
  438. package/frontend/dist/modules/google.js +0 -54
  439. package/frontend/dist/modules/meta.d.ts +0 -10
  440. package/frontend/dist/modules/mutex.d.ts +0 -7
  441. package/frontend/dist/modules/mutex.js +0 -51
  442. package/frontend/dist/modules/number.d.ts +0 -16
  443. package/frontend/dist/modules/number.js +0 -23
  444. package/frontend/dist/modules/object.d.ts +0 -52
  445. package/frontend/dist/modules/object.js +0 -383
  446. package/frontend/dist/modules/scheme.d.ts +0 -227
  447. package/frontend/dist/modules/scheme.js +0 -531
  448. package/frontend/dist/modules/settings.d.ts +0 -3
  449. package/frontend/dist/modules/settings.js +0 -4
  450. package/frontend/dist/modules/statics.d.ts +0 -5
  451. package/frontend/dist/modules/string.d.ts +0 -124
  452. package/frontend/dist/modules/string.js +0 -745
  453. package/frontend/dist/modules/support.d.ts +0 -19
  454. package/frontend/dist/modules/support.js +0 -103
  455. package/frontend/dist/modules/themes.d.ts +0 -8
  456. package/frontend/dist/modules/themes.js +0 -18
  457. package/frontend/dist/modules/user.d.ts +0 -59
  458. package/frontend/dist/modules/user.js +0 -280
  459. package/frontend/dist/modules/utils.d.ts +0 -87
  460. package/frontend/dist/modules/utils.js +0 -923
  461. package/frontend/dist/types/gradient.d.ts +0 -12
  462. package/frontend/dist/ui/border_button.d.ts +0 -152
  463. package/frontend/dist/ui/button.d.ts +0 -21
  464. package/frontend/dist/ui/canvas.d.ts +0 -56
  465. package/frontend/dist/ui/checkbox.d.ts +0 -52
  466. package/frontend/dist/ui/frame_modes.d.ts +0 -25
  467. package/frontend/dist/ui/input.d.ts +0 -241
  468. package/frontend/dist/ui/loader_button.d.ts +0 -93
  469. package/frontend/dist/ui/loaders.d.ts +0 -57
  470. package/frontend/dist/ui/pseudo.d.ts +0 -16
  471. package/frontend/dist/ui/steps.d.ts +0 -59
  472. package/frontend/dist/ui/title.d.ts +0 -21
  473. package/frontend/dist/ui/title.js +0 -121
  474. package/frontend/examples/dashboard/dashboard.ts +0 -776
  475. /package/backend/dist/cjs/{cli.d.ts → backend/src/cli.d.ts} +0 -0
  476. /package/backend/dist/cjs/{file_watcher.d.ts → backend/src/database/document.d.ts} +0 -0
  477. /package/backend/dist/cjs/{file_watcher.js → backend/src/database/document.js} +0 -0
  478. /package/backend/dist/cjs/{plugins/pdf.d.ts → backend/src/database/filters/strict_filter_test.d.ts} +0 -0
  479. /package/backend/dist/{esm/file_watcher.d.ts → cjs/backend/src/database/filters/strict_filter_test_v0.d.ts} +0 -0
  480. /package/backend/dist/{esm/plugins/pdf.d.ts → cjs/backend/src/database/flatten_test.d.ts} +0 -0
  481. /package/backend/dist/cjs/{frontend.d.ts → backend/src/frontend.d.ts} +0 -0
  482. /package/backend/dist/cjs/{plugins → backend/src/plugins}/communication.d.ts +0 -0
  483. /package/backend/dist/cjs/{plugins → backend/src/plugins}/communication.js +0 -0
  484. /package/backend/dist/cjs/{plugins → backend/src/plugins}/mail/ui.js +0 -0
  485. /package/backend/dist/cjs/{plugins → backend/src/plugins}/pdf.js +0 -0
  486. /package/backend/dist/cjs/{plugins → backend/src/plugins}/thread_monitor.d.ts +0 -0
  487. /package/backend/dist/cjs/{plugins → backend/src/plugins}/thread_monitor.js +0 -0
  488. /package/backend/dist/cjs/{vinc.d.ts → backend/src/vinc.d.ts} +0 -0
  489. /package/backend/dist/cjs/{vinc.js → backend/src/vinc.js} +0 -0
  490. /package/backend/dist/esm/{cli.d.ts → backend/src/cli.d.ts} +0 -0
  491. /package/backend/dist/esm/{frontend.d.ts → backend/src/frontend.d.ts} +0 -0
  492. /package/backend/dist/esm/{plugins → backend/src/plugins}/communication.d.ts +0 -0
  493. /package/backend/dist/esm/{plugins → backend/src/plugins}/communication.js +0 -0
  494. /package/backend/dist/esm/{plugins → backend/src/plugins}/thread_monitor.d.ts +0 -0
  495. /package/backend/dist/esm/{plugins → backend/src/plugins}/thread_monitor.js +0 -0
  496. /package/backend/dist/esm/{vinc.d.ts → backend/src/vinc.d.ts} +0 -0
  497. /package/backend/dist/esm/{vinc.js → backend/src/vinc.js} +0 -0
  498. /package/frontend/dist/{elements → frontend/src/elements}/register_element.d.ts +0 -0
  499. /package/frontend/dist/{elements → frontend/src/elements}/register_element.js +0 -0
  500. /package/frontend/dist/{modules → frontend/src/modules}/color.d.ts +0 -0
  501. /package/frontend/dist/{ui → frontend/src/ui}/ui.d.ts +0 -0
  502. /package/frontend/dist/{ui → frontend/src/ui}/ui.js +0 -0
@@ -0,0 +1,508 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var stdin_exports = {};
29
+ __export(stdin_exports, {
30
+ View: () => View
31
+ });
32
+ module.exports = __toCommonJS(stdin_exports);
33
+ var vlib = __toESM(require("@vandenberghinc/vlib"));
34
+ var vts = __toESM(require("@vandenberghinc/vlib/vts"));
35
+ var vhighlight = __toESM(require("@vandenberghinc/vhighlight"));
36
+ var import_zlib = __toESM(require("zlib"));
37
+ var import_meta = require("./meta.js");
38
+ var import_route = require("./route.js");
39
+ var import_frontend = require("./frontend.js");
40
+ var crypto = __toESM(require("crypto"));
41
+ const { debug } = vlib;
42
+ class View {
43
+ // Global settings.
44
+ static includes = [];
45
+ static links = [];
46
+ static body_style = null;
47
+ // css string style.
48
+ static splash_screen = void 0;
49
+ // SplashScreen object.
50
+ // Private static attributes,
51
+ static _volt_css;
52
+ static _vhighlight_css;
53
+ // Attributes.
54
+ source;
55
+ source_path;
56
+ callback;
57
+ includes;
58
+ links;
59
+ templates;
60
+ meta;
61
+ jquery;
62
+ lang;
63
+ body_style;
64
+ splash_screen;
65
+ tree_shaking;
66
+ mangle;
67
+ _src;
68
+ _embedded_sources;
69
+ is_js_ts_view;
70
+ _html;
71
+ raw_html;
72
+ _bundle;
73
+ payments;
74
+ // vhighlight?: string | undefined;
75
+ min_device_width;
76
+ server;
77
+ endpoint;
78
+ // Constructor.
79
+ constructor({ source = null, callback = null, includes = [], links = [], templates = {}, meta = new import_meta.Meta(), jquery = false, lang = "en", body_style = null, splash_screen = void 0, tree_shaking = false, mangle = false, min_device_width = 600, _src }) {
80
+ this.source = source;
81
+ this.callback = callback;
82
+ this.includes = [...View.includes, ...includes];
83
+ this.links = [...View.links, ...links];
84
+ this.templates = templates;
85
+ this.meta = meta;
86
+ this.jquery = jquery;
87
+ this.lang = lang;
88
+ this.body_style = body_style ?? View.body_style;
89
+ this.splash_screen = splash_screen ?? View.splash_screen;
90
+ this.tree_shaking = tree_shaking;
91
+ this.mangle = mangle;
92
+ this.min_device_width = min_device_width;
93
+ this._src = _src;
94
+ this._embedded_sources = [];
95
+ if (this.source != null) {
96
+ this.source_path = new vlib.Path(this.source);
97
+ if (!this.source_path.exists()) {
98
+ throw new Error(`Defined source path "${this.source}" does not exist.`);
99
+ }
100
+ this.source_path = this.source_path.abs();
101
+ this.source = this.source_path.str();
102
+ }
103
+ this.is_js_ts_view = this.source_path != null && /\.(jsx?|tsx?)/.test(this.source_path.extension());
104
+ if (typeof source !== "string" && typeof callback !== "function") {
105
+ throw Error('Invalid usage, define either parameter "source" or "callback".');
106
+ }
107
+ this.includes = vlib.Array.drop_duplicates(this.includes);
108
+ this._html = void 0;
109
+ this._bundle = void 0;
110
+ }
111
+ // Initialize.
112
+ _initialize(server, endpoint) {
113
+ if (server === void 0) {
114
+ throw Error('Invalid usage, define parameter "server".');
115
+ }
116
+ if (endpoint === void 0) {
117
+ throw Error('Invalid usage, define parameter "endpoint".');
118
+ }
119
+ this.server = server;
120
+ this.endpoint = endpoint;
121
+ }
122
+ // Bundle the compiled typescript / javascript dynamically on demand to optimize server startup for development purposes.
123
+ async _dynamic_bundle() {
124
+ if (this.server === void 0 || this.endpoint === void 0) {
125
+ throw Error('View has not been initialized with "View._initialize()" yet.');
126
+ }
127
+ debug(3, this.endpoint?.route?.id, `: Bundling entry path "${this.source_path?.str()}".`);
128
+ this._bundle = await vts.bundle({
129
+ include: this.source_path ? [this.source_path?.str()] : [],
130
+ output: `/tmp/${this.endpoint.route.method}_${this.source_path.str().replace(/\//g, "_")}.js`,
131
+ // esbuild requires an output path to resolve .css and .ttf files etc which can be imported by libraries (such as monaco-editor).
132
+ minify: false,
133
+ //this._server.production,
134
+ platform: "browser",
135
+ format: "esm",
136
+ // format: "iife", // can causes issues with node_modules imports.
137
+ target: "es2022",
138
+ // sourcemap: this.server.production ? false : "inline",
139
+ extract_inputs: true,
140
+ // since bundle.inputs is used by server.js.
141
+ tree_shaking: true
142
+ });
143
+ this.payments = this._bundle.inputs.find((path) => path.endsWith("/modules/paddle.js"));
144
+ }
145
+ /** Ensure the view is bundled when required. */
146
+ async ensure_bundle() {
147
+ if (this.is_js_ts_view && !this._bundle) {
148
+ return this._dynamic_bundle();
149
+ }
150
+ }
151
+ /** Create an error HTML file when errors are encountered during the bundle process. */
152
+ async _build_bundle_err_html() {
153
+ if (this.server?.production) {
154
+ throw new Error("Encountered an error while bundling in production.");
155
+ }
156
+ const nonce_identifier = "{{__VOLT_NONCE__}}";
157
+ const bundle = await vts.inspect_bundle({
158
+ include: this.source_path ? [this.source_path?.str()] : [],
159
+ output: vlib.Path.tmp().join(`${this.endpoint?.route.method}_${this.source_path.str().replace(/\//g, "_")}.js`),
160
+ // esbuild requires an output path to resolve .css and .ttf files etc which can be imported by libraries (such as monaco-editor).
161
+ minify: false,
162
+ //this._server.production,
163
+ platform: "browser",
164
+ format: "esm",
165
+ // format: "iife", // can causes issues with node_modules imports.
166
+ target: "es2022",
167
+ tree_shaking: true
168
+ });
169
+ this.server?.log.error(this.endpoint?.route?.id, `: Encountered an error while bundling "${this.source}".
170
+ ${bundle.debug({ limit: 25 })}`);
171
+ const escape_html = (str) => vlib.Color.to_html(str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"));
172
+ if (this.server?.production) {
173
+ this._html = `
174
+ <!DOCTYPE html>
175
+ <html lang='${this.lang}'>
176
+ <head>
177
+ <meta charset="UTF-8">
178
+ <meta name="viewport" content="width=device-width, initial-scale=1">
179
+ <title>Bundling Error</title>
180
+ <style nonce="${nonce_identifier}">
181
+ body {
182
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 2rem; background: #f5f5f5;
183
+ }
184
+ h1 {
185
+ color: #d32f2f; margin-top: 0;
186
+ }
187
+ #error-container {
188
+ max-width: 800px; margin: 0 auto; background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
189
+ }
190
+ </style>
191
+ </head>
192
+ <body>
193
+ <div id="error-container">
194
+ <h1>Bundling Error</h1>
195
+ <p>An error occurred while processing your request. Please contact support if this issue persists.</p>
196
+ </div>
197
+ </body>
198
+ </html>
199
+ `.dedent(false);
200
+ } else {
201
+ const formatted_import_chains = bundle.format_import_chains();
202
+ const formatted_errors = bundle.format_errors();
203
+ this._html = `
204
+ <!DOCTYPE html>
205
+ <html lang='${this.lang}'>
206
+ <head>
207
+ <meta charset="UTF-8">
208
+ <meta name="viewport" content="width=device-width, initial-scale=1">
209
+ <title>Bundling Error - ${escape_html(this.source || "Unknown")}</title>
210
+ <style nonce="${nonce_identifier}">
211
+ body {
212
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
213
+ margin: 0;
214
+ padding: 1rem;
215
+ background: #1e1e1e;
216
+ color: #d4d4d4;
217
+ }
218
+ .container {
219
+ max-width: 1200px;
220
+ margin: 0 auto;
221
+ }
222
+ h1 {
223
+ color: #FFFFFF;
224
+ font-size: 1.5rem;
225
+ margin-bottom: 0.5rem;
226
+ }
227
+ .source {
228
+ color: #C0C0C0;
229
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
230
+ font-size: 0.875rem;
231
+ margin-bottom: 1rem;
232
+ }
233
+ pre {
234
+ background: #2d2d2d;
235
+ border: 1px solid #3e3e3e;
236
+ border-radius: 4px;
237
+ padding: 1rem;
238
+ overflow-x: auto;
239
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
240
+ font-size: 0.875rem;
241
+ line-height: 1.5;
242
+ margin: 20px 0px 0px 0px;
243
+ }
244
+ .error-count {
245
+ background: #f44336;
246
+ color: white;
247
+ padding: 0.25rem 0.5rem;
248
+ border-radius: 4px;
249
+ font-size: 0.875rem;
250
+ display: inline-block;
251
+ margin-bottom: 1rem;
252
+ }
253
+ </style>
254
+ </head>
255
+ <body>
256
+ <div class="container">
257
+ <h1>Bundle Error</h1>
258
+ <div class="source">Source: ${escape_html(this.source || "Unknown")}</div>
259
+ <div class="error-count">${bundle.errors.length} error${bundle.errors.length === 1 ? "" : "s"}</div>
260
+ <pre>${escape_html(bundle.debug({ limit: -1 }))}</pre>
261
+ <!--<h2>Metafile</h2>
262
+ <pre>${escape_html(bundle.metafile ?? "No metafile detected.")}</pre>
263
+ <h2>Input files</h2>
264
+ <pre>${escape_html(bundle.inputs.length ? bundle.inputs.join("\n") : "No input files detected.")}</pre>
265
+ <h2>Import Chains</h2>
266
+ <pre>${escape_html(formatted_import_chains.length ? formatted_import_chains.join("\n") : "No import chains detected.")}</pre>
267
+ <h2>Encountered Errors</h2>
268
+ <pre>${escape_html(formatted_errors.length ? formatted_errors.join("\n") : "No errors detected.")}</pre>
269
+ -->
270
+ </div>
271
+ </body>
272
+ </html>
273
+ `.dedent(false);
274
+ }
275
+ this.html_nonce_split = this._html.split(nonce_identifier);
276
+ }
277
+ // Build html.
278
+ async _build_html() {
279
+ const nonce_identifier = "{{__VOLT_NONCE__}}";
280
+ if (this.server == null || this.endpoint == null) {
281
+ throw Error('View has not been initialized with "View._initialize()" yet.');
282
+ }
283
+ if (this.is_js_ts_view && !this._bundle) {
284
+ await this._dynamic_bundle();
285
+ }
286
+ if (this._bundle != null && this._bundle.errors.length > 0) {
287
+ return this._build_bundle_err_html();
288
+ }
289
+ const line_break = this.server.production ? "\n" : "\n";
290
+ const has_bundle = this._bundle != null && typeof this._bundle === "object";
291
+ this._html = "";
292
+ this._html += `<!DOCTYPE html><html lang='${this.lang}'>${line_break}`;
293
+ this._html += `<head>${line_break}`;
294
+ if (this.meta) {
295
+ this._html += this.meta.build_html(this.server.full_domain) + line_break;
296
+ }
297
+ this._html += `<style nonce="${nonce_identifier}">html { min-width:100%;min-height:100%; }body { width:100vw;height:100vh;margin:0;padding:0;${this.body_style ?? ""} }</style>${line_break}`;
298
+ const embed_stylesheet = (url, embed) => {
299
+ if (embed == null && url != null && url.charAt(0) === "/") {
300
+ for (const endpoint of this.server.endpoints.values()) {
301
+ if (url === endpoint.route.endpoint_str) {
302
+ if (typeof endpoint.raw_data === "string") {
303
+ embed = endpoint.raw_data;
304
+ } else if (typeof endpoint.data === "string") {
305
+ embed = endpoint.data;
306
+ }
307
+ break;
308
+ }
309
+ }
310
+ }
311
+ if (embed) {
312
+ this._html += `<style nonce="${nonce_identifier}">${line_break}${embed}${line_break}</style>${line_break}`;
313
+ if (url) {
314
+ this._embedded_sources.push(url);
315
+ }
316
+ return true;
317
+ }
318
+ return false;
319
+ };
320
+ let include_links_script = null;
321
+ const include_link_async = (link) => {
322
+ if (include_links_script == null) {
323
+ include_links_script = "async function __incl_lnk(args){var link = document.createElement('link');for (let key in args) {if (args.hasOwnProperty(key)){link.setAttribute(key,args[key])}}document.head.appendChild(link)}" + line_break;
324
+ }
325
+ if (link.rel == null) {
326
+ link.rel = "stylesheet";
327
+ }
328
+ include_links_script += `__incl_lnk(${JSON.stringify(link)});${line_break}`;
329
+ };
330
+ if (!View._volt_css) {
331
+ View._volt_css = await new vlib.Path(import_frontend.Frontend.css.volt).load();
332
+ }
333
+ if (!View._vhighlight_css) {
334
+ View._vhighlight_css = await new vlib.Path(vhighlight.web_exports.css).load();
335
+ }
336
+ embed_stylesheet(void 0, View._volt_css);
337
+ embed_stylesheet(void 0, View._vhighlight_css);
338
+ if (this.min_device_width != null) {
339
+ this._html += `
340
+ <script nonce="${nonce_identifier}">
341
+ let has_min_width = false;
342
+ const viewport = document.querySelector('meta[name="viewport"]');
343
+ function set_min_width() {
344
+ const device_width = window.innerWidth;
345
+ // console.log("Device width [" + device_width + "] below min_device_width [${this.min_device_width} =", (device_width <= ${this.min_device_width}).toString() + "]");
346
+ if (device_width <= ${this.min_device_width}) {
347
+ const content = 'width=${this.min_device_width}, initial-scale=' + (device_width / ${this.min_device_width});
348
+ // console.log("Below ${this.min_device_width}", {content, width: device_width, has_min_width, viewport: viewport.getAttribute('content')});
349
+ if (viewport.getAttribute('content') !== content) {
350
+ // console.log('set min width viewport', device_width, device_width / ${this.min_device_width})
351
+ viewport.setAttribute('content', content);
352
+ has_min_width = true;
353
+ }
354
+ } else if (has_min_width) {
355
+ // console.log('disable min width viewport', device_width)
356
+ viewport.setAttribute('content', 'width=device-width, initial-scale=1');
357
+ has_min_width = false;
358
+ }
359
+ }
360
+ let timeout_load; window.addEventListener('load', () => {clearTimeout(timeout_load); timeout_load = setTimeout(set_min_width, 25); } );
361
+ let timeout_resize; window.addEventListener('resize', () => {clearTimeout(timeout_resize); timeout_resize = setTimeout(set_min_width, 25); } );
362
+ set_min_width();
363
+ </script>
364
+ `.dedent();
365
+ }
366
+ this.links.forEach((url) => {
367
+ if (typeof url === "string") {
368
+ this._html += `<link rel="stylesheet" href="${url}">`;
369
+ } else if (typeof url === "object") {
370
+ if (typeof url === "object" && url.rel === "stylesheet" && url.embed !== true && typeof url.href === "string" && embed_stylesheet(import_route.Route.clean_endpoint(url.href))) {
371
+ } else {
372
+ if (url.async) {
373
+ include_link_async(url);
374
+ } else {
375
+ this._html += "<link";
376
+ Object.keys(url).forEach((key) => {
377
+ if (key !== "embed") {
378
+ this._html += ` ${key}="${url[key]}"`;
379
+ }
380
+ });
381
+ this._html += ">" + line_break;
382
+ }
383
+ }
384
+ } else {
385
+ throw Error('Invalid type for a css include, the valid value types are "string" and "object".');
386
+ }
387
+ });
388
+ if (include_links_script) {
389
+ this._html += `<script nonce="${nonce_identifier}">${line_break}${include_links_script}${line_break}</script>${line_break}`;
390
+ }
391
+ this._html += "</head>" + line_break;
392
+ this._html += "<body id='body'>";
393
+ if (this.splash_screen != null) {
394
+ this._html += this.splash_screen.html + line_break;
395
+ }
396
+ const embed_script = (url) => {
397
+ let embed;
398
+ for (const endpoint of this.server.endpoints.values()) {
399
+ if (url === endpoint.route.endpoint_str && (endpoint.raw_data != null || endpoint.data != null)) {
400
+ embed = endpoint;
401
+ }
402
+ }
403
+ if (embed && (embed.raw_data || embed.data)) {
404
+ if (embed.content_type === "application/javascript") {
405
+ this._html += `<script nonce="${nonce_identifier}">${line_break}${embed.raw_data || embed.data}${line_break}</script>${line_break}`;
406
+ } else {
407
+ this._html += `<script nonce="${nonce_identifier}" type='${embed.content_type}'>${line_break}${embed.raw_data || embed.data}${line_break}</script>${line_break}`;
408
+ }
409
+ this._embedded_sources.push(url);
410
+ return true;
411
+ }
412
+ return false;
413
+ };
414
+ let include_js_script = `async function __volt_incl_js(url, async = true) {var script=document.createElement('script');if(async){script.async = true;}script.src=url;document.head.appendChild(script);};${line_break}`;
415
+ if (this.jquery) {
416
+ this._html += `<script nonce="${nonce_identifier}" src='https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js'></script>${line_break}`;
417
+ }
418
+ if (this.server.google_tag !== void 0) {
419
+ include_js_script += `__volt_incl_js("https://www.googletagmanager.com/gtag/js?id=${this.server.google_tag}");${line_break}`;
420
+ }
421
+ this._html += `<script nonce="${nonce_identifier}">${line_break}window.volt_statics_aspect_ratios = ${JSON.stringify(Object.fromEntries(this.server.statics_aspect_ratios))}${line_break}</script>${line_break}`;
422
+ if (this.server.payments) {
423
+ if (this.server.payments.type === "paddle") {
424
+ if (this.payments) {
425
+ include_js_script += `__volt_incl_js("https://cdn.paddle.com/paddle/v2/paddle.js");${line_break}`;
426
+ }
427
+ }
428
+ }
429
+ this._html += `<script nonce="${nonce_identifier}">${line_break}${include_js_script.trimEnd()}${line_break}</script>${line_break}`;
430
+ this.includes.forEach((url) => {
431
+ if (typeof url === "string" && embed_script(url)) {
432
+ } else {
433
+ if (typeof url === "string") {
434
+ this._html += `<script nonce="${nonce_identifier}" src='${url}'></script>${line_break}`;
435
+ } else if (typeof url === "object") {
436
+ this._html += `<script nonce="${nonce_identifier}"`;
437
+ Object.keys(url).forEach((key) => {
438
+ if (key !== "embed") {
439
+ this._html += ` ${key}="${url[key]}"`;
440
+ }
441
+ });
442
+ this._html += "></script>" + line_break;
443
+ } else {
444
+ throw Error('Invalid type for a js include, the valid value types are "string" and "object".');
445
+ }
446
+ }
447
+ });
448
+ if (has_bundle && this._bundle != null && typeof this._bundle.code === "string") {
449
+ this._html += `<script nonce="${nonce_identifier}" type='module'>${line_break}${this._bundle.code}${line_break}</script>${line_break}`;
450
+ } else if (typeof this.source === "string") {
451
+ this._html += `<script nonce="${nonce_identifier}">${line_break}${await new vlib.Path(this.source).load()}${line_break}</script>${line_break}`;
452
+ } else if (this.callback != null) {
453
+ let code = this.callback.toString();
454
+ this._html += `<script nonce="${nonce_identifier}">${line_break}(${code})()${line_break}</script>${line_break}`;
455
+ }
456
+ this._html += "</body>" + line_break;
457
+ this._html += "</html>" + line_break;
458
+ this.html_nonce_split = this._html.split(nonce_identifier);
459
+ }
460
+ /** Retrieve the content length of the built html. */
461
+ async content_length() {
462
+ const nonce = crypto.randomBytes(16).toString("base64");
463
+ if (!this._html) {
464
+ await this._build_html();
465
+ }
466
+ let html = this.html_nonce_split.join(nonce);
467
+ return html.length;
468
+ }
469
+ /** Retrieve the HTML. */
470
+ async html(opts) {
471
+ const nonce = crypto.randomBytes(16).toString("base64");
472
+ if (!this._html) {
473
+ await this._build_html();
474
+ }
475
+ let html = this.html_nonce_split.join(nonce);
476
+ const content_length = Buffer.byteLength(html, "utf-8");
477
+ if (opts?.compress) {
478
+ html = import_zlib.default.gzipSync(html, { level: import_zlib.default.constants.Z_BEST_COMPRESSION });
479
+ }
480
+ return {
481
+ html,
482
+ content_length,
483
+ nonce
484
+ };
485
+ }
486
+ // Serve a client.
487
+ async _serve(stream, status_code = 200, opts) {
488
+ debug(2, this.endpoint?.route?.id, ": Serving HTML ", this._html?.slice(0, 50), "...");
489
+ const html = await this.html(opts);
490
+ stream.set_header("Content-Length", html.content_length.toString());
491
+ const csp = stream.get_header("Content-Security-Policy");
492
+ if (csp == null || typeof csp !== "string") {
493
+ throw new Error("Cannot serve HTML without a string typed Content-Security-Policy (CSP) header defined on the endpoint. This should by default be defined by the Server.");
494
+ }
495
+ const new_csp = csp.replace(/(script-src|style-src)([^;]*)/g, (_, g1, g2) => `${g1}${g2} 'nonce-${html.nonce}'`);
496
+ stream.set_header("Content-Security-Policy", new_csp);
497
+ stream.send({
498
+ status: status_code,
499
+ headers: { "Content-Type": "text/html" },
500
+ data: html.html
501
+ });
502
+ }
503
+ html_nonce_split;
504
+ }
505
+ // Annotate the CommonJS export names for ESM import in node:
506
+ 0 && (module.exports = {
507
+ View
508
+ });
@@ -1,4 +1,8 @@
1
- export { ExternalError, InternalError } from "./utils.js";
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ export * from "./errors/index.js";
2
6
  export * from "./status.js";
3
7
  export * from "./meta.js";
4
8
  export * from "./splash_screen.js";
@@ -9,7 +13,12 @@ export * from "./server.js";
9
13
  export * from "./database/database.js";
10
14
  export * from "./database/document.js";
11
15
  export * from "./database/collection.js";
16
+ export * from "./database/quota/quota.js";
17
+ export * from "./database/quota/safe_int.js";
12
18
  export * from "./rate_limit.js";
13
19
  export * from "./logger.js";
20
+ export * from "./events.js";
21
+ export { User } from "./users.js";
14
22
  export * as Mail from "./plugins/mail/ui.js";
15
23
  export * from "./frontend.js";
24
+ export type { Request } from "../../frontend/src/modules/request.js";
@@ -28,12 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var stdin_exports = {};
30
30
  __export(stdin_exports, {
31
- ExternalError: () => import_utils.ExternalError,
32
- InternalError: () => import_utils.InternalError,
33
31
  Mail: () => Mail
34
32
  });
35
33
  module.exports = __toCommonJS(stdin_exports);
36
- var import_utils = require("./utils.js");
34
+ __reExport(stdin_exports, require("./errors/index.js"), module.exports);
37
35
  __reExport(stdin_exports, require("./status.js"), module.exports);
38
36
  __reExport(stdin_exports, require("./meta.js"), module.exports);
39
37
  __reExport(stdin_exports, require("./splash_screen.js"), module.exports);
@@ -44,15 +42,17 @@ __reExport(stdin_exports, require("./server.js"), module.exports);
44
42
  __reExport(stdin_exports, require("./database/database.js"), module.exports);
45
43
  __reExport(stdin_exports, require("./database/document.js"), module.exports);
46
44
  __reExport(stdin_exports, require("./database/collection.js"), module.exports);
45
+ __reExport(stdin_exports, require("./database/quota/quota.js"), module.exports);
46
+ __reExport(stdin_exports, require("./database/quota/safe_int.js"), module.exports);
47
47
  __reExport(stdin_exports, require("./rate_limit.js"), module.exports);
48
48
  __reExport(stdin_exports, require("./logger.js"), module.exports);
49
+ __reExport(stdin_exports, require("./events.js"), module.exports);
49
50
  var Mail = __toESM(require("./plugins/mail/ui.js"));
50
51
  __reExport(stdin_exports, require("./frontend.js"), module.exports);
51
52
  // Annotate the CommonJS export names for ESM import in node:
52
53
  0 && (module.exports = {
53
- ExternalError,
54
- InternalError,
55
54
  Mail,
55
+ ...require("./errors/index.js"),
56
56
  ...require("./status.js"),
57
57
  ...require("./meta.js"),
58
58
  ...require("./splash_screen.js"),
@@ -63,7 +63,10 @@ __reExport(stdin_exports, require("./frontend.js"), module.exports);
63
63
  ...require("./database/database.js"),
64
64
  ...require("./database/document.js"),
65
65
  ...require("./database/collection.js"),
66
+ ...require("./database/quota/quota.js"),
67
+ ...require("./database/quota/safe_int.js"),
66
68
  ...require("./rate_limit.js"),
67
69
  ...require("./logger.js"),
70
+ ...require("./events.js"),
68
71
  ...require("./frontend.js")
69
72
  });
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh.
4
+ */
5
+ import type { RegisteredEndpoint } from "../../../backend/src/server.js";
6
+ import type { APIError } from "../../../backend/src/stream.js";
7
+ export declare namespace Request {
8
+ /** The method type. */
9
+ export type Method = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
10
+ /** The response data template base. */
11
+ type ResponseBodyBase = unknown | null | undefined | number | boolean | string | any[] | Record<string, any>;
12
+ /** The request data template base. */
13
+ type RequestBodyBase = unknown | null | undefined | string | Record<string, any>;
14
+ /**
15
+ * The detailed generic type for providing info for the {@link request} function.
16
+ */
17
+ export type Info<Method extends Request.Method, Endpoint extends string | RegExp, ParamsBody extends RequestBodyBase, SuccessBody extends ResponseBodyBase, ErrorBody extends ResponseBodyBase> = {
18
+ /** The HTTP method for the request. */
19
+ method: Method;
20
+ /** The route's endpoint or full url with domain, string or regex. */
21
+ endpoint: Endpoint;
22
+ /** The request payload (body) type. */
23
+ payload: ParamsBody;
24
+ /** The success result body type. */
25
+ result: SuccessBody;
26
+ /** The error result body type. */
27
+ error: ErrorBody;
28
+ };
29
+ /**
30
+ * Create request info from a registered endpoint.
31
+ */
32
+ export type InfoFromEndpoint<E extends RegisteredEndpoint<any, any, any>, SuccessBody extends ResponseBodyBase = undefined, ErrorBody extends ResponseBodyBase = undefined> = E extends RegisteredEndpoint<infer M, infer EP, infer P> ? Info<M extends undefined ? "GET" : M extends Method ? M : never, EP extends string ? EP : never, P, SuccessBody, ErrorBody> : never;
33
+ /** The request options. */
34
+ export interface Opts<Method extends Request.Method = "GET", Url extends string | RegExp = string, // use regex for backend support.
35
+ RequestBody extends RequestBodyBase = unknown> {
36
+ method?: Method;
37
+ url: Url;
38
+ data?: RequestBody;
39
+ json?: boolean;
40
+ credentials?: RequestCredentials;
41
+ headers?: Record<string, string>;
42
+ }
43
+ /** The returned result */
44
+ export type Result<SuccessBody extends ResponseBodyBase = unknown, ErrorBody extends ResponseBodyBase = unknown> = {
45
+ /** The request status. */
46
+ status: number;
47
+ } & ({
48
+ /** The api error from the backend {@link Stream.error}. */
49
+ error: APIError;
50
+ /** The error response body, always optional in case of body parsing failure. */
51
+ data?: ErrorBody;
52
+ } | {
53
+ /** The success response body. */
54
+ data: SuccessBody;
55
+ /** No API error from the backend {@link Stream.error} was found. */
56
+ error?: never;
57
+ });
58
+ /** The returned result by endpoint {@link Info} */
59
+ export type ResultFromInfo<Info extends Request.Info<any, any, any, any, any>> = Info extends Request.Info<any, any, any, infer S, infer E> ? Result<S, E> : never;
60
+ /** A promise to {@link Result}, for convenience. */
61
+ export type ResultPromise<SuccessBody extends ResponseBodyBase = unknown, ErrorBody extends ResponseBodyBase = unknown> = Promise<Result<SuccessBody, ErrorBody>>;
62
+ /** A promise to {@link Result} from endpoint {@link Info}, for convenience. */
63
+ export type ResultPromiseFromInfo<Info extends Request.Info<any, any, any, any, any>> = Info extends Request.Info<any, any, any, infer S, infer E> ? Promise<Result<S, E>> : never;
64
+ export {};
65
+ }
66
+ /**
67
+ * Make a request with a specific generic typing, optionally passing
68
+ * the request method, endpoint, request body and response body types.
69
+ */
70
+ export declare function request<Info extends Request.Info<any, any, any, any, any>>(options: Info extends Request.Info<infer M, infer E, infer P, any, any> ? Request.Opts<M, E, P> : never): Promise<Info extends Request.Info<any, any, any, infer S, infer E> ? Request.Result<S, E> : never>;