@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
@@ -13,7 +13,6 @@ export declare class Route {
13
13
  required: boolean;
14
14
  }[];
15
15
  private matcher?;
16
- matched_params: Record<string, any>;
17
16
  /**
18
17
  *
19
18
  * @param method HTTP method (e.g. "GET", "post", etc.)
@@ -23,20 +22,14 @@ export declare class Route {
23
22
  * Ensure the wildcards are encapsulated by / or at the start of end of the string.
24
23
  */
25
24
  constructor(method: string, endpoint: string | RegExp);
26
- /** Create match args
27
- * @warning this is required for the `match()` method
28
- */
29
- static create_match_args(method: string, endpoint: string): {
30
- method: string;
31
- endpoint: string;
32
- };
33
25
  /**
34
26
  * Tests this route against another Route (e.g. a “request” Route).
35
- * Returns true/false and on true populates other.params.
27
+ * @returns `false` when not matched, and a `params` object when matched.
36
28
  */
37
- match(other: Route): boolean;
29
+ match(other: Route): false | Record<string, any>;
38
30
  private _create_route_matcher;
39
31
  private static _stringify_endpoint_regex;
32
+ /** Clean an endpoint url. */
40
33
  static clean_endpoint(endpoint: RegExp): RegExp;
41
34
  static clean_endpoint(endpoint: string): string;
42
35
  }
@@ -29,8 +29,6 @@ class Route {
29
29
  params = [];
30
30
  // path param names.
31
31
  matcher;
32
- // Inserted only when passed as arg into `match()`.
33
- matched_params = {};
34
32
  /**
35
33
  *
36
34
  * @param method HTTP method (e.g. "GET", "post", etc.)
@@ -59,47 +57,51 @@ class Route {
59
57
  }
60
58
  this.id = `${this.method}:${this.endpoint_str}`;
61
59
  }
62
- /** Create match args
63
- * @warning this is required for the `match()` method
64
- */
65
- static create_match_args(method, endpoint) {
66
- return {
67
- method: method.trim().toUpperCase(),
68
- endpoint: endpoint.replace(/\/+$/, "") || "/"
69
- };
70
- }
60
+ // /** Create match args
61
+ // * @warning this is required for the `match()` method
62
+ // */
63
+ // public static create_match_args(method: string, endpoint: string): { method: string, endpoint: string} {
64
+ // return {
65
+ // method: method.trim().toUpperCase(),
66
+ // endpoint: endpoint.replace(/\/+$/, "") || "/",
67
+ // };
68
+ // }
71
69
  /**
72
70
  * Tests this route against another Route (e.g. a “request” Route).
73
- * Returns true/false and on true populates other.params.
71
+ * @returns `false` when not matched, and a `params` object when matched.
74
72
  */
75
73
  match(other) {
76
74
  if (this.endpoint instanceof RegExp && other.endpoint instanceof RegExp) {
77
75
  return false;
78
76
  }
79
77
  if (other.method !== this.method) {
80
- other.matched_params = {};
81
78
  return false;
82
79
  }
83
80
  if (this.endpoint instanceof RegExp) {
84
81
  const m = this.endpoint.exec(other.endpoint_str);
85
82
  if (!m) {
86
- other.matched_params = {};
87
83
  return false;
84
+ } else if (m.groups) {
85
+ const x = Object.fromEntries(Object.entries(m.groups).map(([name, val]) => {
86
+ return [name, val == null ? val : decodeURIComponent(val)];
87
+ }));
88
+ console.log("ROUTE PARAMS:", x);
89
+ return x;
88
90
  }
89
- other.matched_params = m.groups ? { ...m.groups } : {};
90
- return true;
91
+ return {};
91
92
  }
92
93
  if (this.matcher) {
93
94
  const result = this.matcher.match(other.endpoint_str);
94
95
  if (!result) {
95
- other.matched_params = {};
96
96
  return false;
97
97
  }
98
- other.matched_params = result;
99
- return true;
98
+ const keys = Object.keys(result);
99
+ for (const k of keys) {
100
+ result[k] = decodeURIComponent(result[k]);
101
+ }
102
+ return result;
100
103
  }
101
- other.matched_params = {};
102
- return this.endpoint_str === other.endpoint_str;
104
+ return this.endpoint_str === other.endpoint_str ? {} : false;
103
105
  }
104
106
  // ─── Helper: compile colon-style patterns ───
105
107
  _create_route_matcher(pattern) {
@@ -0,0 +1,485 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh.
4
+ */
5
+ import * as vlib from "@vandenberghinc/vlib";
6
+ import { Meta } from './meta.js';
7
+ import { Mail } from "./plugins/mail/mail.js";
8
+ import { Status } from "./status.js";
9
+ import { Endpoint } from "./endpoint.js";
10
+ import { Database } from "./database/database.js";
11
+ import { Users } from "./users.js";
12
+ import { Paddle } from "./payments/paddle.js";
13
+ import { RateLimits, RateLimitServer, RateLimitClient } from "./rate_limit.js";
14
+ import { Route } from "./route.js";
15
+ import { EventCallback, EventName, Events } from './events.js';
16
+ /** Company profile information used in invoices, emails, and branding. */
17
+ export interface CompanyInfo {
18
+ /** The name of your company. */
19
+ name: string;
20
+ /** The legal name of your company. */
21
+ legal_name: string;
22
+ /** The street name of your company's address. */
23
+ street: string;
24
+ /** The house number or house name of your company's address. */
25
+ house_number: string;
26
+ /** The postal/zip code of your company's address. */
27
+ postal_code: string;
28
+ /** The city of your company's address. */
29
+ city: string;
30
+ /** The province or state of your company's address. */
31
+ province: string;
32
+ /** The country name of your company's address. */
33
+ country: string;
34
+ /** The two-letter ISO country code of your company's location. */
35
+ country_code: string;
36
+ /** The tax ID of your company. */
37
+ tax_id?: string;
38
+ /** The type of company. */
39
+ type?: string;
40
+ /** The endpoint URL path of your company's icon (PNG). Must be an endpoint URL since access to the file path is also required for creating invoices. */
41
+ icon?: string;
42
+ /** The endpoint URL path of your company's stroke icon (PNG). In payment invoices the stroke icon precedes the default icon. Must be an endpoint URL since access to the file path is also required for creating invoices. */
43
+ stroke_icon?: string;
44
+ /** The file path of your company's icon (PNG), automatically retrieved from the {@link CompanyInfo.icon} property when possible. */
45
+ icon_path?: string;
46
+ /** The file path of your company's stroke icon (PNG), automatically retrieved from the {@link CompanyInfo.stroke_icon} property when possible. */
47
+ stroke_icon_path?: string;
48
+ }
49
+ /** TLS certificate configuration for enabling HTTPS. */
50
+ export interface TLSConfig {
51
+ /** The path to the certificate. */
52
+ cert: string;
53
+ /** The path to the private key file. */
54
+ key: string;
55
+ /** The path to the CA bundle file. */
56
+ ca?: string | null;
57
+ /** The passphrase of the private key. */
58
+ passphrase?: string;
59
+ }
60
+ /** Description of a static directory or file that should be served. */
61
+ export interface StaticDirectory {
62
+ /** The path to the static directory or file. */
63
+ path: string;
64
+ /** The base endpoint of the static directory, by default the path's name will be used.*/
65
+ endpoint?: string;
66
+ /** Enable caching for the static endpoints; this value will be used for parameter `Endpoint.cache`. */
67
+ cache?: number | boolean;
68
+ /** Define a specific cache policy per endpoint from this static directory as `{<endpoint>: <cache>}`; the cache value will be used for parameter `Endpoint.cache`. */
69
+ endpoints_cache?: Record<string, boolean | number>;
70
+ /** An array of paths to exclude. The array may contain regexes. */
71
+ exclude?: Array<string | RegExp>;
72
+ }
73
+ /**
74
+ * A definition of a registered endpoint, can be used to export params and response types to the frontend.
75
+ * @prop params The inferred interface of the endpoint parameters, note that the runtime value of this property is always `undefined`.
76
+ * @prop Params Alias for property {@link RegisteredEndpoint.params}.
77
+ */
78
+ export type RegisteredEndpoint<M extends Endpoint.Method, E extends string | RegExp, P extends Record<string, any>> = {
79
+ /** The HTTP method for the endpoint (e.g. GET, POST). */
80
+ method: M;
81
+ /** A pascal cased alias for the endpoint, for type exports conforming with `Params`. */
82
+ Method: M;
83
+ /**
84
+ * The route's endpoint endpoint, string or regex,
85
+ * use `route.endpoint_str` for the string representation.
86
+ */
87
+ endpoint: E;
88
+ /** A pascal cased alias for the method, for type exports conforming with `Params`. */
89
+ Endpoint: E;
90
+ /** The endpoint route. */
91
+ route: Route;
92
+ /**
93
+ * The inferred params type, can be used to export the params payload type.
94
+ * @warning This value is `undefined` at runtime, but contains the correct params payload type at compile time.
95
+ */
96
+ Params: P;
97
+ };
98
+ /** The payment options. */
99
+ export type PaymentOpts = (Paddle.Opts & {
100
+ /** The payment provider type. */
101
+ type: "paddle";
102
+ });
103
+ /** Nested types for the {@link Server} class. */
104
+ export declare namespace Server {
105
+ /** Key options for the {@link Server.Opts} interface. */
106
+ interface KeyOpts {
107
+ /** The name of the key. */
108
+ name: string;
109
+ /** The length of the key. */
110
+ length: number;
111
+ }
112
+ /** Constructor options. */
113
+ interface Opts {
114
+ /** Whether the server is in production mode or in development mode. */
115
+ production?: boolean;
116
+ /** The IP address where the server will run. */
117
+ ip?: string;
118
+ /** The port where the server will run. Leave `null` to run on port `80` for HTTP and `443` for HTTPS. */
119
+ port?: number;
120
+ /** The full domain url without `http://` or `https://`. */
121
+ domain: string;
122
+ /** Used to indicate if the current server is the primary node. */
123
+ is_primary?: boolean;
124
+ /** The path to a persistent directory where some files such as logs, status info etc will be saved. */
125
+ source: string;
126
+ /** The database settings, see {@link Database.Opts}. */
127
+ database: string | Database.Opts;
128
+ /** Array with paths to static directories or static directory objects, see {@link StaticDirectory}. */
129
+ statics?: Array<string | vlib.Path | StaticDirectory>;
130
+ /** The path to the favicon. */
131
+ favicon?: string;
132
+ /** Your company information, see {@link CompanyInfo}. */
133
+ company: CompanyInfo;
134
+ /** The default meta object. */
135
+ meta?: Meta | Meta.Opts;
136
+ /** The TLS settings for HTTPS, see {@link TLSConfig}. */
137
+ tls?: TLSConfig;
138
+ /** The mail options. */
139
+ mail?: Mail.Opts;
140
+ /**
141
+ * The rate limit server and client settings. Rate limiting works with a centralizer websocket server and secondary clients.
142
+ * By default rate limiting is enabled but can be disabled by explicitly setting `rate_limit` to `false`.
143
+ */
144
+ rate_limit?: false | {
145
+ /** The primary server rate limit settings. */
146
+ server?: RateLimitServer.Opts;
147
+ /** The rate limit client settings. */
148
+ client?: RateLimitClient.Opts;
149
+ };
150
+ /** An array with names of crypto keys. Keys will be generated and stored in the database when they do not exist, and accessible as `Server.keys.$name`. Items may be a string (name) or an object with `name` and `length`, see {@link Server.KeyOpts}. */
151
+ keys?: (string | Server.KeyOpts)[];
152
+ /** The arguments for the payment class, see {@link PaymentOpts}. */
153
+ payments?: PaymentOpts;
154
+ /** Override the default headers generated by volt. Leave `default_headers` undefined to let volt automatically generate default headers. */
155
+ default_headers?: Record<string, any>;
156
+ /** The Google Tag ID. */
157
+ google_tag?: string;
158
+ /** Additional options for managing the {@link Users} class. */
159
+ users?: Users.Opts;
160
+ /** Enable threading behaviour when in production mode. */
161
+ threading?: false | true | {
162
+ /** Wether to enable threading behaviour. */
163
+ enabled: boolean;
164
+ /** The number of processes when threading is enabled. By default, the number of CPU's will be used. */
165
+ threads?: number;
166
+ };
167
+ /** Boolean indicating if the development server is being run offline. */
168
+ offline?: boolean;
169
+ /**
170
+ * Additional endpoints to add to the sitemap. By default all endpoints where attribute `view` is defined are added.
171
+ * @note Regex based endpoints are not added to the default sitemap so they should perhaps they should partially be included here.
172
+ */
173
+ additional_sitemap_endpoints?: string[];
174
+ /**
175
+ * Optional settings for the service daemons. Pass `false` to disable, see {@link vlib.Daemon.Opts}.
176
+ * The {@link vlib.Daemon.Opts.name} field will be defined with a default value of `domain.replaceAll(".", "")`.
177
+ * The {@link vlib.Daemon.Opts.logs}, {@link vlib.Daemon.Opts.errors} fields will be defined with a default value of `<source>/daemon/<name>`.
178
+ */
179
+ daemon?: false | vlib.Types.Optional<vlib.Daemon.Opts, "name">;
180
+ /** The active log level. */
181
+ log_level?: number;
182
+ }
183
+ }
184
+ /**
185
+ * The backend server class.
186
+ *
187
+ * When the HTTPS parameters `certificate` and `private_key` are defined, the server will run automatically on HTTP and HTTPS.
188
+ *
189
+ * @property users The initialized {@link Users} instance.
190
+ */
191
+ export declare class Server {
192
+ /** Content type per mime. */
193
+ static content_type_mimes: Map<string, string>;
194
+ /** All file path extensions that are already compressed. */
195
+ static compressed_extensions: Set<string>;
196
+ /** The binded ip address. */
197
+ ip: string;
198
+ /** The binded http port. */
199
+ port: number;
200
+ /** The binded https port. */
201
+ https_port: number;
202
+ /** The raw domain. */
203
+ domain: string;
204
+ /** The full domain name with http/https depending if tls is enabled. */
205
+ full_domain: string;
206
+ /** The persistent storage source directory. */
207
+ source: vlib.Path;
208
+ /** Is the primary thread. */
209
+ is_primary: boolean;
210
+ /** Is in production mode. */
211
+ production: boolean;
212
+ /** The company information. */
213
+ company: CompanyInfo;
214
+ /** The default meta information. */
215
+ meta: Meta;
216
+ /** Is running in offline mode. */
217
+ offline: boolean;
218
+ /** The database instance. */
219
+ db: Database;
220
+ /** The rate limit instance. */
221
+ rate_limit?: RateLimitServer | RateLimitClient;
222
+ /** The added endpoints. */
223
+ endpoints: Map<string, Endpoint>;
224
+ /** The added error endpoints. */
225
+ err_endpoints: Map<number, Endpoint>;
226
+ /** A record of keys used for hashing. */
227
+ keys: Record<string, string>;
228
+ /** Alias for the `Status` module. */
229
+ status: typeof Status;
230
+ /** Alias for the `RateLimits` module. */
231
+ rate_limits: typeof RateLimits;
232
+ /** The file logger. */
233
+ log: vlib.logging.FileLogger;
234
+ /** The users instance. */
235
+ users: Users;
236
+ /** The payments instance. */
237
+ payments?: Paddle;
238
+ /** Daemon instance to manage a live daemon. */
239
+ daemon?: vlib.Daemon;
240
+ /** The mail instance. */
241
+ mail?: Mail;
242
+ csp: Record<string, string>;
243
+ statics_aspect_ratios: Map<string | RegExp, any>;
244
+ google_tag?: string;
245
+ rate_limit_api_key: string | undefined;
246
+ performance: vlib.Performance;
247
+ /** The events map @internal */
248
+ events: vlib.Events<Events>;
249
+ private favicon?;
250
+ private statics;
251
+ private _user_keys_opts;
252
+ private additional_sitemap_endpoints;
253
+ private tls?;
254
+ private default_headers;
255
+ private http;
256
+ private https;
257
+ private threading;
258
+ private _keys_db;
259
+ private _sys_keys_db;
260
+ private _website_status_db;
261
+ /** Construct a new server instance. */
262
+ constructor({ ip, port, // leave undefined for blank detection.
263
+ domain, is_primary, source, database, statics, favicon, company, meta, tls, mail, rate_limit, keys, payments, default_headers, google_tag, users, production, threading, offline, additional_sitemap_endpoints, log_level, daemon, }: Server.Opts);
264
+ /** Get a content type (MIME) from a file extension. */
265
+ get_content_type(extension: string): string;
266
+ /** Set the logging verbosity level. */
267
+ set_log_level(level: number): void;
268
+ /** Generate a cryptographically secure random key as a hex string. */
269
+ generate_crypto_key(length?: number): string;
270
+ /** Create an HMAC hash using the provided key and data. */
271
+ hmac(key: string, data: string, algo?: string): string;
272
+ /** Create a hash (no key) of the given data using the specified algorithm. */
273
+ hash(data: string | object, algo?: string): string;
274
+ private _init_default_headers;
275
+ private _set_header_defaults;
276
+ private _find_endpoint;
277
+ private _create_default_endpoints;
278
+ private _create_sitemap;
279
+ private _create_robots_txt;
280
+ private _initialize_statics;
281
+ /** Initialize the system and user defined keys. */
282
+ _initialize_keys(): Promise<void>;
283
+ /**
284
+ * Checks if an endpoint route already exists.
285
+ * @param method HTTP method
286
+ * @param endpoint String path or RegExp
287
+ */
288
+ private _check_duplicate_route;
289
+ private _serve;
290
+ /** The promise of database initialization and connecting. */
291
+ private _db_init_promise;
292
+ initialize(): Promise<void>;
293
+ /**
294
+ * Start the server.
295
+ * @example
296
+ * ...
297
+ * server.start();
298
+ */
299
+ start(): Promise<void>;
300
+ /**
301
+ * Stop the server.
302
+ * @example
303
+ * ...
304
+ * server.stop();
305
+ */
306
+ stop(): Promise<void>;
307
+ /** Add an event callback. */
308
+ on<N extends EventName>(name: N, callback: EventCallback<N>): this;
309
+ /** Remove an event callback. */
310
+ off<N extends EventName>(name: N, callback: EventCallback<N>): this;
311
+ /**
312
+ * Add a single endpoint.
313
+ * Only supports a single endpoint due to parameter inference.
314
+ * @note An error is thrown when the endpoint route already exists.
315
+ * @template Response User inputted response type that will be returned as response, optionaly typing used for consistency.
316
+ * @template S system template for inferring the endpoint callback parameters.
317
+ * @param endpoint The endpoint or endpoint options to add.
318
+ * @returns A registered endpoint object that can for instance be used to infer the endpoint parameters.
319
+ */
320
+ endpoint<const M extends Endpoint.Method = "GET", const E extends string | RegExp = string, const S extends vlib.Schema.Entries.Opts = {}>(endpoint: Endpoint<M, E, S> | ConstructorParameters<typeof Endpoint<M, E, S>>[0]): RegisteredEndpoint<M, E, vlib.Schema.Entries.Infer<S>>;
321
+ /**
322
+ * Add an endpoint per error status code.
323
+ * @param status_code
324
+ * The status code of the error.
325
+ *
326
+ * The supported status codes are:
327
+ * * `404`
328
+ * * `400` (Will not be used when the endpoint uses an API callback).
329
+ * * `403`
330
+ * * `404`
331
+ * * `500`
332
+ * @param endpoint The error endpoint or error endpoint options
333
+ */
334
+ error_endpoint<const M extends Endpoint.Method = "GET", const E extends string | RegExp = string, const S extends vlib.Schema.Entries.Opts = {}>(status_code: number, endpoint: Endpoint<M, E, S> | Endpoint.Opts<M, E, S>): this;
335
+ /**
336
+ * Add an url to the Content-Security-Policy. This function does not overwrite the existing key's value.
337
+ * @warning This function no longer has any effect when `Server.start()` has been called.
338
+ * @param key The Content-Security-Policy key, e.g. `script-src`.
339
+ * @param value The value to add to the Content-Security-Policy key.
340
+ * @example
341
+ * ...
342
+ * server.add_csp("script-src", "somewebsite.com");
343
+ * server.add_csp("upgrade-insecure-requests");
344
+ */
345
+ add_csp(key: string, value?: null | string | string[]): void;
346
+ /**
347
+ * Remove an url from the Content-Security-Policy. This function does not overwrite the existing key's value.
348
+ * @warning This function no longer has any effect when `Server.start()` has been called.
349
+ * @param key The Content-Security-Policy key, e.g. `script-src`.
350
+ * @param value The value to remove from the Content-Security-Policy key.
351
+ * @example
352
+ * ...
353
+ * server.remove_csp("script-src", "somewebsite.com");
354
+ * server.remove_csp("upgrade-insecure-requests");
355
+ */
356
+ remove_csp(key: string, value?: null | string): void;
357
+ /**
358
+ * Delete an key from the Content-Security-Policy.
359
+ * @warning This function no longer has any effect when `Server.start()` has been called.
360
+ * @param key The Content-Security-Policy key, e.g. `script-src`.
361
+ * @example
362
+ * ...
363
+ * server.del_csp("script-src");
364
+ * server.del_csp("upgrade-insecure-requests");
365
+ */
366
+ del_csp(key: string): void;
367
+ /**
368
+ * This function is meant to be used when the server is in production mode, it will make an API request to your server through the defined `Server.domain` parameter.
369
+ * @note This function can be called without initializing the server.
370
+ * @param type The wanted output type. Either an `object` or a `string` type for CLI purposes.
371
+ */
372
+ fetch_status(type?: "object" | "string"): Promise<string | Record<string, any>>;
373
+ /** Generate a key and csr for tls. */
374
+ generate_ssl_key({ output_path, ec, }: {
375
+ output_path: string;
376
+ ec?: boolean;
377
+ }): Promise<void>;
378
+ /** Generate a csr for tls. */
379
+ generate_csr({ output_path, key_path, name, domain, organization_unit, country_code, province, city, }: {
380
+ output_path: string;
381
+ key_path: string;
382
+ name: string;
383
+ domain: string;
384
+ organization_unit: string;
385
+ country_code: string;
386
+ province: string;
387
+ city: string;
388
+ }): Promise<void>;
389
+ /** Called for each product in a successful one-time payment. Override to implement your logic. */
390
+ on_payment({ product, payment }: {
391
+ product: any;
392
+ payment: any;
393
+ }): Promise<void>;
394
+ /** Called for each product in a successful subscription. Override to implement your logic. */
395
+ on_subscription({ product, payment }: {
396
+ product: any;
397
+ payment: any;
398
+ }): Promise<void>;
399
+ /** Called when a cancellation succeeds. Override to implement your logic. */
400
+ on_cancellation({ payment, line_items }: {
401
+ payment: any;
402
+ line_items: any[];
403
+ }): Promise<void>;
404
+ /** Called when a refund succeeds. The line items array are the items that were refunded. */
405
+ on_refund({ payment, line_items }: {
406
+ payment: any;
407
+ line_items: any[];
408
+ }): Promise<void>;
409
+ /** Called when a refund fails. The line items array are the items where the refund failed. */
410
+ on_failed_refund({ payment, line_items }: {
411
+ payment: any;
412
+ line_items: any[];
413
+ }): Promise<void>;
414
+ /** Called when a chargeback occurs. The line items array are the items that were charged back. */
415
+ on_chargeback({ payment, line_items }: {
416
+ payment: any;
417
+ line_items: any[];
418
+ }): Promise<void>;
419
+ /** Called when a chargeback fails. The line items array are the items where the chargeback failed. */
420
+ on_failed_chargeback({ payment, line_items }: {
421
+ payment: any;
422
+ line_items: any[];
423
+ }): Promise<void>;
424
+ /** Build the base email layout used by the various transactional email builders. */
425
+ _mail_template({ max_width, children, }: {
426
+ max_width?: number;
427
+ children?: any[];
428
+ }): any;
429
+ /** Helper that renders a list of payment line items for use in transactional emails. */
430
+ _render_mail_payment_line_items({ payment, line_items, show_total_due }: {
431
+ payment: any;
432
+ line_items: any[];
433
+ show_total_due?: boolean;
434
+ }): any[];
435
+ /** Assert mail is configured. */
436
+ assert_mail(): asserts this is {
437
+ mail: Mail;
438
+ };
439
+ /** Build the 2FA verification email content. */
440
+ on_2fa_mail({ code, username, email, date, ip, device }: {
441
+ code: string;
442
+ username: string;
443
+ email: string;
444
+ date: string;
445
+ ip: string;
446
+ device: string;
447
+ }): any;
448
+ /** Build the successful payment email content. */
449
+ on_payment_mail({ payment }: {
450
+ payment: any;
451
+ }): any;
452
+ /** Build the failed payment email content. */
453
+ on_failed_payment_mail({ payment }: {
454
+ payment: any;
455
+ }): any;
456
+ /** Build the successful cancellation email content. */
457
+ on_cancellation_mail({ payment, line_items }: {
458
+ payment: any;
459
+ line_items: any[];
460
+ }): any;
461
+ /** Build the failed cancellation email content. */
462
+ on_failed_cancellation_mail({ payment }: {
463
+ payment: any;
464
+ }): any;
465
+ /** Build the successful refund email content. */
466
+ on_refund_mail({ payment, line_items }: {
467
+ payment: any;
468
+ line_items: any[];
469
+ }): any;
470
+ /** Build the failed refund email content. */
471
+ on_failed_refund_mail({ payment, line_items }: {
472
+ payment: any;
473
+ line_items: any[];
474
+ }): any;
475
+ /** Build the successful chargeback email content. */
476
+ on_chargeback_mail({ payment, line_items }: {
477
+ payment: any;
478
+ line_items: any[];
479
+ }): any;
480
+ /** Build the failed chargeback email content. */
481
+ on_failed_chargeback_mail({ payment, line_items }: {
482
+ payment: any;
483
+ line_items: any[];
484
+ }): any;
485
+ }