@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,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>;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh.
4
+ */
5
+ /**
6
+ * Make a request with a specific generic typing, optionally passing
7
+ * the request method, endpoint, request body and response body types.
8
+ */
9
+ export async function request(options) {
10
+ const { method = 'GET', url = null, data = null, json = true, credentials = "same-origin", headers = {}, } = options;
11
+ if (url instanceof RegExp) {
12
+ throw Error("The 'url' parameter cannot be a RegExp.");
13
+ }
14
+ // — prepare headers —
15
+ if (json && data != null && !headers['Content-Type']) {
16
+ headers['Content-Type'] = 'application/json';
17
+ }
18
+ // — build URL + body —
19
+ let finalUrl = url;
20
+ let body;
21
+ if (data != null && typeof data === 'object') {
22
+ if (method.toUpperCase() === 'GET') {
23
+ // @todo do without any cast.
24
+ finalUrl = `${url}?${new URLSearchParams(data).toString()}`;
25
+ }
26
+ else {
27
+ body = JSON.stringify(data);
28
+ }
29
+ }
30
+ else if (data != null) {
31
+ body = String(data);
32
+ }
33
+ const init = { method, credentials, headers };
34
+ if (body !== undefined)
35
+ init.body = body;
36
+ try {
37
+ const response = await fetch(finalUrl, init);
38
+ const status = response.status;
39
+ // — parse payload once —
40
+ let payload;
41
+ const clone = response.clone(); // @dev.
42
+ if (json) {
43
+ try {
44
+ payload = await response.json();
45
+ }
46
+ catch (e) {
47
+ // malformed JSON still counts as a “success” fetch
48
+ console.log("[debug] Unable to parse a json from response:", await clone.text(), "- Error: ", JSON.stringify(e, null, 4));
49
+ console.log("[debug] Response:", response);
50
+ return {
51
+ status,
52
+ error: { message: `Failed to parse JSON response: ${e.message}` },
53
+ };
54
+ }
55
+ }
56
+ else {
57
+ try {
58
+ payload = await response.text();
59
+ }
60
+ catch (e) {
61
+ return {
62
+ status,
63
+ error: { message: `Failed to parse text response: ${e.message}` },
64
+ };
65
+ }
66
+ }
67
+ // console.log("Payload", json, payload)
68
+ // — handle HTTP errors (4xx/5xx) by resolving with an error object —
69
+ if (!response.ok) {
70
+ // if server wrapped its error in { error: { message, type?, invalid_fields? }, … }
71
+ if (payload &&
72
+ typeof payload === 'object' &&
73
+ payload.error &&
74
+ typeof payload.error === 'object' &&
75
+ typeof payload.error.message === 'string') {
76
+ return {
77
+ status,
78
+ error: {
79
+ message: payload.error.message,
80
+ type: typeof payload.error.type === "string" ? payload.error.type : undefined,
81
+ invalid_fields: payload.error.invalid_fields && typeof payload.error.invalid_fields === "object" && !Array.isArray(payload.error.invalid_fields)
82
+ ? payload.error.invalid_fields
83
+ : undefined,
84
+ },
85
+ data: payload.data,
86
+ };
87
+ }
88
+ // otherwise fall back to a generic single‐message error
89
+ const msg = typeof payload === 'string'
90
+ ? payload
91
+ : payload?.error?.toString() ?? JSON.stringify(payload);
92
+ return {
93
+ status,
94
+ error: { message: msg },
95
+ data: payload.data,
96
+ };
97
+ }
98
+ // — 2xx: success —
99
+ return { status, data: payload };
100
+ }
101
+ catch (networkErr) {
102
+ // genuine network / system failure
103
+ throw networkErr;
104
+ }
105
+ }
106
+ ;
107
+ // void request<{
108
+ // method: "GET",
109
+ // endpoint: "/example",
110
+ // payload: { id: string },
111
+ // result: { name: string, age: number },
112
+ // error: { reason: string }
113
+ // }>({
114
+ // method: "GET",
115
+ // url: "/example",
116
+ // data: { id: "123" }
117
+ // })
@@ -0,0 +1,3 @@
1
+ export declare namespace Settings {
2
+ const production: boolean;
3
+ }
@@ -0,0 +1,5 @@
1
+ // Settings.
2
+ export var Settings;
3
+ (function (Settings) {
4
+ Settings.production = "{{PRODUCTION}}";
5
+ })(Settings || (Settings = {}));
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ export declare const Statics: {
6
+ aspect_ratios: any;
7
+ /**
8
+ * Retrieve the aspect ratio of a static endpoint.
9
+ *
10
+ * All aspect ratios are embedded into the compiled HTML document.
11
+ *
12
+ * @warning This function only works when the endpoint has been defined using the `Endpoint.view` attribute.
13
+ *
14
+ * @param endpoint The static image endpoint.
15
+ *
16
+ * @nav Frontend/Static
17
+ * @docs
18
+ */
19
+ aspect_ratio(endpoint: string): any;
20
+ };
21
+ export { Statics as statics };
@@ -1,6 +1,6 @@
1
- /*
2
- * Author: Daan van den Bergh
3
- * Copyright: © 2022 - 2024 Daan van den Bergh.
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
4
  */
5
5
  // Static module
6
6
  if (window.volt_statics_aspect_ratios === undefined) {
@@ -13,21 +13,18 @@ export const Statics = {
13
13
  set aspect_ratios(aspect_ratios) {
14
14
  window.volt_statics_aspect_ratios = aspect_ratios;
15
15
  },
16
- /* @docs:
17
- @nav: Frontend
18
- @chapter: Static
19
- @title: Aspect Ratio
20
- @desc:
21
- Retrieve the aspect ratio of a static endpoint.
22
-
23
- All aspect ratios are embedded into the compiled HTML document.
24
- @warning:
25
- This function only works when the endpoint has been defined using the `Endpoint.view` attribute.
26
- @param:
27
- @name: endpoint
28
- @type: string
29
- @descr: The static image endpoint.
30
- */
16
+ /**
17
+ * Retrieve the aspect ratio of a static endpoint.
18
+ *
19
+ * All aspect ratios are embedded into the compiled HTML document.
20
+ *
21
+ * @warning This function only works when the endpoint has been defined using the `Endpoint.view` attribute.
22
+ *
23
+ * @param endpoint The static image endpoint.
24
+ *
25
+ * @nav Frontend/Static
26
+ * @docs
27
+ */
31
28
  aspect_ratio(endpoint) {
32
29
  if (endpoint.charAt(0) !== "/") {
33
30
  endpoint = "/" + endpoint;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ import type { Users as UsersBackend } from "../../../backend/src/users.js";
6
+ import { Attachment } from "./attachment.js";
7
+ import { Request } from "./request.js";
8
+ export declare namespace Support {
9
+ /**
10
+ * Submit a support contact form. The server will send an email to your registered SMTP mail.
11
+ *
12
+ * All provided argument keys will be included in the support mail, even the undefined parameters.
13
+ * Allows for a maximum of 5 attachments, each up to 5 MB in size.
14
+ * @nav Frontend/Support
15
+ * @returns Returns a promise with a successful submit response or a request error on a failed request.
16
+ * @param payload The request payload, see {@link UsersBackend.Endpoints.SubmitSupport.Params}.
17
+ * @docs
18
+ */
19
+ function submit(payload: Omit<UsersBackend.Endpoints.SubmitSupport["payload"], "attachments"> & {
20
+ attachments?: Attachment[];
21
+ }): Request.ResultPromiseFromInfo<UsersBackend.Endpoints.SubmitSupport>;
22
+ /**
23
+ * Get the support pin of an authenticated user.
24
+ * @nav Frontend/Support
25
+ * @returns Returns a promise that resolves with an object containing `pin` (the user's support pin) on success, or a request error on failure.
26
+ * @docs
27
+ */
28
+ function get_pin(): Request.ResultPromiseFromInfo<UsersBackend.Endpoints.GetSupportPin>;
29
+ }
30
+ export { Support as support };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ import { request } from "./request.js";
6
+ // Support module.
7
+ export var Support;
8
+ (function (Support) {
9
+ /**
10
+ * Submit a support contact form. The server will send an email to your registered SMTP mail.
11
+ *
12
+ * All provided argument keys will be included in the support mail, even the undefined parameters.
13
+ * Allows for a maximum of 5 attachments, each up to 5 MB in size.
14
+ * @nav Frontend/Support
15
+ * @returns Returns a promise with a successful submit response or a request error on a failed request.
16
+ * @param payload The request payload, see {@link UsersBackend.Endpoints.SubmitSupport.Params}.
17
+ * @docs
18
+ */
19
+ function submit(payload) {
20
+ if (payload.attachments) {
21
+ const total_attachments_size = payload.attachments.reduce((acc, it) => acc + it.size, 0);
22
+ if (total_attachments_size > 5 * 1024 * 1024) { // 5 MB total
23
+ throw new Error(`Total attachments size exceeds the maximum of 5 MB.`);
24
+ }
25
+ }
26
+ return request({
27
+ method: "POST",
28
+ url: "/volt/api/v1/support/submit",
29
+ data: {
30
+ ...payload,
31
+ attachments: payload.attachments?.map(a => a.to_rest_api({
32
+ decompress: true,
33
+ encoding: "base64",
34
+ }))
35
+ },
36
+ });
37
+ }
38
+ Support.submit = submit;
39
+ /**
40
+ * Get the support pin of an authenticated user.
41
+ * @nav Frontend/Support
42
+ * @returns Returns a promise that resolves with an object containing `pin` (the user's support pin) on success, or a request error on failure.
43
+ * @docs
44
+ */
45
+ function get_pin() {
46
+ return request({
47
+ method: "GET",
48
+ url: "/volt/api/v1/support/pin",
49
+ });
50
+ }
51
+ Support.get_pin = get_pin;
52
+ })(Support || (Support = {}));
53
+ export { Support as support }; // also export as lowercase for compatibility.
@@ -1,10 +1,39 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ /** Name of a theme attribute key. */
1
6
  type ThemeAttributeName = string;
7
+ /** Identifier of a theme variant. */
2
8
  type ThemeId = "dark" | "light";
9
+ /** Theme options for dark and light variants. */
3
10
  type ThemesOptions<ThemeOptions extends {}> = {
4
11
  dark: ThemeOptions;
5
12
  light: ThemeOptions;
6
13
  };
14
+ /** Callback invoked when a theme is activated. */
7
15
  type OnActivateCallback<ThemeOptions extends {}> = (themes_class: Theme<ThemeOptions>, active_id: ThemeId) => void;
16
+ /**
17
+ * A themes class to efficiently style the site using themes.
18
+ *
19
+ * The constructor arguments must be a theme style per theme name. Every theme variable should exist in all themes or it may cause undefined behaviour. The theme name that is passed first will be the active theme by default.
20
+ * ```
21
+ * Theme("main-theme", {
22
+ * light: {
23
+ * text_fg: "#000000",
24
+ * },
25
+ * dark: {
26
+ * text_fg: "#FFFFFF",
27
+ * },
28
+ * })
29
+ * ```
30
+ *
31
+ * When theme attributes are retrieved, by default they will be the active theme's attribute as a css variable. So this can be passed to an element.
32
+ * However, some element functions do not accept css variables, in this case the `value()` function can be used to retrieve the raw value. Do not forget to apply an `on_theme_update()` callback on the elements where you use this.
33
+ * @nav Frontend/Themes
34
+ * @note The `ThemesClass` is also initializable under function `Themes`.
35
+ * @docs
36
+ */
8
37
  export declare class Theme<ThemeOptions extends Record<string, any>> {
9
38
  active_id: ThemeId;
10
39
  active: ThemeOptions;
@@ -29,15 +58,46 @@ export declare class Theme<ThemeOptions extends Record<string, any>> {
29
58
  initialize(id?: ThemeId): this;
30
59
  /** Get full active theme id. */
31
60
  get id(): string;
61
+ /** Get cached active subtheme id from localStorage. */
32
62
  get_active_id_cached(): string;
63
+ /**
64
+ * Activate a theme and update CSS variables.
65
+ * @param id The theme id to activate.
66
+ * @param apply_theme_update Whether to call the global theme update hook after activation.
67
+ */
33
68
  activate(id: ThemeId, apply_theme_update?: boolean): this;
34
69
  on_activate(): OnActivateCallback<ThemeOptions> | undefined;
35
70
  on_activate(callback: OnActivateCallback<ThemeOptions>): this;
71
+ /**
72
+ * Toggle the active theme between "dark" and "light".
73
+ * @param apply_theme_update Whether to call the global theme update hook after toggling.
74
+ */
36
75
  toggle(apply_theme_update?: boolean): this;
76
+ /**
77
+ * Internal: add a theme attribute and expose it as a CSS variable-backed property.
78
+ * @param id The attribute name to add.
79
+ * @param theme Optional theme id used for initialization and gradient detection.
80
+ */
37
81
  _add_attr(id: string, theme?: ThemeId): void;
82
+ /**
83
+ * Assign a new value to a theme attribute and update its CSS variable for the active theme.
84
+ * @param theme The theme id to modify.
85
+ * @param key The attribute name.
86
+ * @param value The new value for the attribute.
87
+ */
38
88
  set(theme: ThemeId, key: string, value: any): this;
89
+ /** Get the raw active theme object. */
39
90
  get raw(): ThemeOptions;
91
+ /**
92
+ * Get the raw (non-CSS-variable) value of an attribute from the active theme.
93
+ * @param id The attribute name.
94
+ */
40
95
  value(id: ThemeAttributeName): any;
96
+ /**
97
+ * Create a new attribute for each theme using a callback and expose it as a CSS variable.
98
+ * @param id The new attribute name to create.
99
+ * @param create_theme_value Callback that returns the value for each theme.
100
+ */
41
101
  create<T = string>(id: string, create_theme_value: (theme_id: ThemeId, theme: ThemeOptions) => T): void;
42
102
  /**
43
103
  * Auto darken lighten a color from the theme
@@ -48,6 +108,12 @@ export declare class Theme<ThemeOptions extends Record<string, any>> {
48
108
  * @param percent Percentage between 0. and 1.0.
49
109
  */
50
110
  auto_darken_lighten(theme_attr: ThemeAttributeName, percent?: number, reversed?: boolean): string;
111
+ /**
112
+ * Set the opacity on a theme color, creating a derived CSS variable.
113
+ * Opacity must be a number `0.0` till `1.0`, and may also be an object with opacity per theme `{dark: 0.2, light: 0.35}`.
114
+ * @param theme_attr The source theme color attribute.
115
+ * @param opacity The opacity value or per-theme map.
116
+ */
51
117
  opacity(theme_attr: ThemeAttributeName, opacity?: number): string;
52
118
  /**
53
119
  * Create a new value by multiplying a numeric attribute.
@@ -61,6 +127,7 @@ export declare class Theme<ThemeOptions extends Record<string, any>> {
61
127
  /** Function to re-enable all transition attributes on all elements. */
62
128
  enable_transitions(delay?: number): this;
63
129
  }
130
+ /** Interface merge to expose theme attributes as properties from ThemeOptions on Theme instances. */
64
131
  export interface Theme<ThemeOptions extends Record<string, any>> extends ThemeOptions {
65
132
  }
66
133
  export {};
@@ -1,36 +1,34 @@
1
- /*
2
- * Author: Daan van den Bergh
3
- * Copyright: © 2022 - 2024 Daan van den Bergh.
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
4
  */
5
5
  // Imports.
6
6
  import { Color } from "./color.js";
7
7
  import { Themes as ThemesModule } from "./themes.js";
8
+ /** List of supported theme identifiers. */
8
9
  const ThemeIdList = ["dark", "light"];
9
- // Themes class.
10
- /* @docs:
11
- @nav: Frontend
12
- @chapter: Themes
13
- @note: The `ThemesClass` is also initializable under function `Themes`.
14
- @desc:
15
- A themes class to efficiently style the site using themes.
16
-
17
- The constructor arguments must be a theme style per theme name. Every theme variable should exist in all themes or it may cause undefined behaviour. The theme name that is passed first will be the active theme by default.
18
- ```
19
- Theme("main-theme", {
20
- light: {
21
- text_fg: "#000000",
22
- },
23
- dark: {
24
- text_fg: "#FFFFFF",
25
- },
26
- })
27
- ```
28
-
29
- When theme attributes are retrieved, by default they will be the active theme's attribute as a css variable. So this can be passed to an element.
30
- However, some element functions do not accept css variables, in this case the `value()` function can be used to retrieve the raw value. Do not forget to apply an `on_theme_update()` callback on the elements where you use this.
10
+ /**
11
+ * A themes class to efficiently style the site using themes.
12
+ *
13
+ * The constructor arguments must be a theme style per theme name. Every theme variable should exist in all themes or it may cause undefined behaviour. The theme name that is passed first will be the active theme by default.
14
+ * ```
15
+ * Theme("main-theme", {
16
+ * light: {
17
+ * text_fg: "#000000",
18
+ * },
19
+ * dark: {
20
+ * text_fg: "#FFFFFF",
21
+ * },
22
+ * })
23
+ * ```
24
+ *
25
+ * When theme attributes are retrieved, by default they will be the active theme's attribute as a css variable. So this can be passed to an element.
26
+ * However, some element functions do not accept css variables, in this case the `value()` function can be used to retrieve the raw value. Do not forget to apply an `on_theme_update()` callback on the elements where you use this.
27
+ * @nav Frontend/Themes
28
+ * @note The `ThemesClass` is also initializable under function `Themes`.
29
+ * @docs
31
30
  */
32
31
  export class Theme {
33
- // helper: union of all keys across all themes
34
32
  // Attributes.
35
33
  active_id;
36
34
  active;
@@ -97,11 +95,15 @@ export class Theme {
97
95
  get id() {
98
96
  return `${this._id}.${String(this.active_id)}`;
99
97
  }
100
- // Get cached active subtheme id.
98
+ /** Get cached active subtheme id from localStorage. */
101
99
  get_active_id_cached() {
102
100
  return localStorage.getItem(this._id) ?? "";
103
101
  }
104
- // Activate a theme.
102
+ /**
103
+ * Activate a theme and update CSS variables.
104
+ * @param id The theme id to activate.
105
+ * @param apply_theme_update Whether to call the global theme update hook after activation.
106
+ */
105
107
  activate(id, apply_theme_update = true) {
106
108
  if (ThemeIdList.includes(id) === false || this[id] === undefined) {
107
109
  throw Error(`Theme "${id}" does not exist.`);
@@ -125,6 +127,11 @@ export class Theme {
125
127
  localStorage.setItem(this._id, String(this.active_id));
126
128
  return this;
127
129
  }
130
+ /**
131
+ * Get or set the callback invoked after a theme is activated.
132
+ * When called without a callback, returns the currently set callback.
133
+ * @param callback The callback to invoke with the theme instance and active id after activation.
134
+ */
128
135
  on_activate(callback) {
129
136
  if (callback == null) {
130
137
  return this._on_activate_callback;
@@ -132,7 +139,10 @@ export class Theme {
132
139
  this._on_activate_callback = callback;
133
140
  return this;
134
141
  }
135
- // Toggle themes.
142
+ /**
143
+ * Toggle the active theme between "dark" and "light".
144
+ * @param apply_theme_update Whether to call the global theme update hook after toggling.
145
+ */
136
146
  toggle(apply_theme_update = true) {
137
147
  const other = this.active_id === "dark" ? "light" : "dark";
138
148
  this.activate(other, apply_theme_update);
@@ -140,7 +150,11 @@ export class Theme {
140
150
  }
141
151
  // ---------------------------------------------------------------------
142
152
  // Adding values.
143
- // Add a new attribute.
153
+ /**
154
+ * Internal: add a theme attribute and expose it as a CSS variable-backed property.
155
+ * @param id The attribute name to add.
156
+ * @param theme Optional theme id used for initialization and gradient detection.
157
+ */
144
158
  _add_attr(id, theme) {
145
159
  if (theme == null) {
146
160
  this._css_vars[id] = `var(--${this._id}_${id})`;
@@ -173,7 +187,12 @@ export class Theme {
173
187
  });
174
188
  this._attrs.append(id);
175
189
  }
176
- // Assign a new value.
190
+ /**
191
+ * Assign a new value to a theme attribute and update its CSS variable for the active theme.
192
+ * @param theme The theme id to modify.
193
+ * @param key The attribute name.
194
+ * @param value The new value for the attribute.
195
+ */
177
196
  set(theme, key, value) {
178
197
  // Update theme.
179
198
  const theme_style = this[theme];
@@ -194,10 +213,14 @@ export class Theme {
194
213
  // Response.
195
214
  return this;
196
215
  }
216
+ /** Get the raw active theme object. */
197
217
  get raw() {
198
218
  return this.active;
199
219
  }
200
- // Get raw value.
220
+ /**
221
+ * Get the raw (non-CSS-variable) value of an attribute from the active theme.
222
+ * @param id The attribute name.
223
+ */
201
224
  value(id) {
202
225
  if (this.active === undefined) {
203
226
  return;
@@ -206,7 +229,11 @@ export class Theme {
206
229
  }
207
230
  // ---------------------------------------------------------------------
208
231
  // Color manipulation methods.
209
- // Create a new color for each theme.
232
+ /**
233
+ * Create a new attribute for each theme using a callback and expose it as a CSS variable.
234
+ * @param id The new attribute name to create.
235
+ * @param create_theme_value Callback that returns the value for each theme.
236
+ */
210
237
  create(id, create_theme_value) {
211
238
  // Already created.
212
239
  if (this._css_vars[id]) {
@@ -253,8 +280,12 @@ export class Theme {
253
280
  });
254
281
  return this._css_vars[full_id];
255
282
  }
256
- // Opacity.
257
- // Opacity must be a number `0.0` till `1.0`, and may also be an object with opacity pet theme `{dark: 0.2, light: 0.35}`.
283
+ /**
284
+ * Set the opacity on a theme color, creating a derived CSS variable.
285
+ * Opacity must be a number `0.0` till `1.0`, and may also be an object with opacity per theme `{dark: 0.2, light: 0.35}`.
286
+ * @param theme_attr The source theme color attribute.
287
+ * @param opacity The opacity value or per-theme map.
288
+ */
258
289
  opacity(theme_attr, opacity = 1.0) {
259
290
  // Create full id.
260
291
  let full_id;
@@ -342,7 +373,7 @@ export class Theme {
342
373
  // *::before { transition: none !important; }
343
374
  // `.dedent();
344
375
  // document.head.appendChild(style);
345
- document.body.classList.add("notransition");
376
+ document.body.classList.add("volt_notransition");
346
377
  // Force a reflow to apply the new styles immediately
347
378
  // document.head.getBoundingClientRect();
348
379
  void document.body.offsetHeight;
@@ -354,7 +385,7 @@ export class Theme {
354
385
  setTimeout(() => this.enable_transitions(0), delay);
355
386
  return this;
356
387
  }
357
- document.body.classList.remove("notransition");
388
+ document.body.classList.remove("volt_notransition");
358
389
  // const style = document.getElementById('__libris_thme_disable_transitions__');
359
390
  // if (style) {
360
391
  // style.remove();
@@ -363,4 +394,3 @@ export class Theme {
363
394
  return this;
364
395
  }
365
396
  }
366
- // export type ExtendTheme<ThemeOptions extends Record<string, any>> = Theme<any>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ interface ThemeElement {
6
+ element: any;
7
+ }
8
+ export declare namespace Themes {
9
+ const theme_elements: ThemeElement[];
10
+ function apply_theme_update(): void;
11
+ }
12
+ export { Themes as themes };