@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,558 @@
1
+ // /**
2
+ // * @author Daan van den Bergh
3
+ // * @copyright © 2022 - 2025 Daan van den Bergh.
4
+ // */
5
+ export {};
6
+ // // ---------------------------------------------------------
7
+ // // Libraries.
8
+ // import * as vlib from "@vandenberghinc/vlib";
9
+ // import * as mongodb from "mongodb";
10
+ // import { WithId } from "mongodb";
11
+ // // Imports.
12
+ // import { Status } from "../status.js";
13
+ // import { ExternalError, InternalError } from "../utils.js";
14
+ // import { Collection } from "./collection.js";
15
+ // import { FlattenToDotNotation } from "./flatten.js";
16
+ // import { StrictUpdateFilter } from "./filters/filters.js";
17
+ // // ---------------------------------------------------------
18
+ // // Document reference object.
19
+ // export namespace Document {
20
+ // /** Nested types for the {@link Ref} class. */
21
+ // export namespace Ref {
22
+ // /** The options interface for the second args `opts` from the {@link Ref} constructor. */
23
+ // export interface Opts<
24
+ // Data extends mongodb.Document,
25
+ // Default extends Collection.LoadOpts.Default<Data> = Collection.LoadOpts.Default<Data>,
26
+ // > {
27
+ // /** The parent collection. */
28
+ // col: Collection<Data>;
29
+ // /**
30
+ // * The default value to return for an empty document.
31
+ // * Or when the document exists, fields present in the default
32
+ // * which are not present in the document will be merged in.
33
+ // *
34
+ // * @note For inserts, the entire default is deep-cloned.
35
+ // * For load-time merging, only the values that get assigned are cloned; the default object itself is not mutated.
36
+ // */
37
+ // default?: Default;
38
+ // /** If true then (some) errors are thrown as external errors, instead of internal errors. */
39
+ // external_errors?: boolean;
40
+ // /**
41
+ // * The record type version for the database.
42
+ // * This can be used to transform older record versions to the current
43
+ // * version when used in combination with field {@link Opts.transform_version}.
44
+ // */
45
+ // record_version?: number;
46
+ // /**
47
+ // * The function to transform an older document version to the current version.
48
+ // * This callback is only executed when loading the document through {@link Ref.load},
49
+ // * or when executing {@link Ref.on_load}.
50
+ // *
51
+ // * This callback is executed before the optional {@link Opts.on_load} callback.
52
+ // *
53
+ // * @note The callback input `data` may be an older document shape that does not match {@link Data}.
54
+ // */
55
+ // transform_version?: OnTransformVersion<Data>;
56
+ // /**
57
+ // * The function to call when the document is loaded, also when the default value is used.
58
+ // * This callback is only executed when loading the document through {@link Ref.load},
59
+ // * or when executing {@link Ref.on_load}.
60
+ // *
61
+ // * This callback is executed after the optional {@link Opts.transform_version} callback.
62
+ // */
63
+ // on_load?: OnLoad<Data>;
64
+ // }
65
+ // /**
66
+ // * The type for the {@link Opts.transform_version} and {@link Ref.transform_version} callback.
67
+ // * @note The input `data` may be an older document shape that does not match {@link Data}.
68
+ // */
69
+ // export type OnTransformVersion<
70
+ // Data extends mongodb.Document,
71
+ // > = <
72
+ // Projection extends Collection.LoadOpts.Projection,
73
+ // D extends (
74
+ // Projection extends undefined
75
+ // ? Ref.WithSysFieldsAndId<Data>
76
+ // : Ref.WithSysFieldsAndId<Partial<Data>>
77
+ // ) = (
78
+ // Projection extends undefined
79
+ // ? Ref.WithSysFieldsAndId<Data>
80
+ // : Ref.WithSysFieldsAndId<Partial<Data>>
81
+ // )
82
+ // >(
83
+ // data: Record<string, any>,
84
+ // opts: {
85
+ // from_version: undefined | number;
86
+ // to_version: number;
87
+ // partial: Projection extends undefined ? false : true;
88
+ // },
89
+ // ) => D;
90
+ // /** The type for the {@link Opts.on_load} and {@link Ref._on_load} callback */
91
+ // export type OnLoad<
92
+ // Data extends mongodb.Document,
93
+ // > = <
94
+ // Projection extends Collection.LoadOpts.Projection,
95
+ // D extends (
96
+ // Projection extends undefined
97
+ // ? Ref.WithSysFieldsAndId<Data>
98
+ // : Ref.WithSysFieldsAndId<Partial<Data>>
99
+ // ) = (
100
+ // Projection extends undefined
101
+ // ? Ref.WithSysFieldsAndId<Data>
102
+ // : Ref.WithSysFieldsAndId<Partial<Data>>
103
+ // )
104
+ // >(
105
+ // data: D,
106
+ // opts: {
107
+ // partial: Projection extends undefined ? false : true;
108
+ // },
109
+ // ) => D;
110
+ // /**
111
+ // * A type to add system values always added by the ref class,
112
+ // */
113
+ // export type WithSysFields<T> = T & { __record_version?: number };
114
+ // export type WithSysFieldsAndId<T> = WithId<WithSysFields<T>>;
115
+ // }
116
+ // /**
117
+ // * Document reference object. Its objectively a document without holding its data.
118
+ // * Its more efficient to store that separately and use this to perform operations on it.
119
+ // * This supports a hierarchy where a class instance always holds a reference and the loaded document.
120
+ // * And a static function can be declared to load the document and initialize the class instance.
121
+ // * This is a better design then a class with an optional data attribute, which was the previous design.
122
+ // * This proved very difficult to work with and was not very efficient.
123
+ // *
124
+ // * @warning This class adds system field `__record_version` to each record, do not override this field manually.
125
+ // */
126
+ // export class Ref<
127
+ // Data extends mongodb.Document,
128
+ // Default extends Collection.LoadOpts.Default<Data> = undefined,
129
+ // > {
130
+ // col: Collection<Data>;
131
+ // query: Collection.Query<Data>;
132
+ // default?: Default;
133
+ // // chunked: boolean;
134
+ // record_version: number; // defaults to 1.
135
+ // error_type: typeof InternalError | typeof ExternalError;
136
+ // transform_version?: Ref.OnTransformVersion<Data>;
137
+ // _on_load?: Ref.OnLoad<Data>;
138
+ // /** Construct a new `Ref` instance. */
139
+ // constructor(query: Collection.Query<Data>, opts: Ref.Opts<Data, Default>) {
140
+ // // Validate query
141
+ // if (
142
+ // !query ||
143
+ // (typeof query !== "string" && typeof query !== "object") ||
144
+ // (typeof query === "object" && query != null && Object.keys(query).length === 0)
145
+ // ) {
146
+ // throw new (opts.external_errors ? ExternalError : InternalError)({
147
+ // type: "InvalidDocumentRef",
148
+ // message: "Query must be a non-empty string or a non-empty object",
149
+ // status: Status.bad_request,
150
+ // });
151
+ // }
152
+ // // Assign attributes.
153
+ // this.query = query;
154
+ // this.col = opts.col;
155
+ // this.default = opts.default;
156
+ // // this.chunked = opts.chunked || false;
157
+ // this.error_type = opts.external_errors ? ExternalError : InternalError;
158
+ // this.transform_version = opts.transform_version;
159
+ // this._on_load = opts.on_load;
160
+ // // Validate and set record version
161
+ // const version = opts.record_version ?? 1;
162
+ // if (!Number.isInteger(version) || version < 1) {
163
+ // throw new this.error_type({
164
+ // type: "InvalidDocumentRef",
165
+ // message: "Record version must be a positive integer",
166
+ // status: Status.bad_request,
167
+ // });
168
+ // }
169
+ // this.record_version = version;
170
+ // // Check transform.
171
+ // if (this.record_version !== 1 && !this.transform_version) {
172
+ // throw new this.error_type({
173
+ // type: "InvalidDocumentRef",
174
+ // message: "Transform version must be set when record version is set.",
175
+ // status: Status.bad_request,
176
+ // });
177
+ // }
178
+ // }
179
+ // /**
180
+ // * On load callback.
181
+ // *
182
+ // * @param opts.insert_defaults Whether to insert default values.
183
+ // * Defaults to `true`.
184
+ // */
185
+ // private on_load<Projection extends Collection.LoadOpts.Projection>(
186
+ // data: Projection extends undefined
187
+ // ? Ref.WithSysFieldsAndId<Data>
188
+ // : Ref.WithSysFieldsAndId<globalThis.Partial<Data>>,
189
+ // opts: {
190
+ // insert_defaults: boolean,
191
+ // projection: Projection,
192
+ // },
193
+ // ): Projection extends undefined ? Ref.WithSysFieldsAndId<Data> : Ref.WithSysFieldsAndId<Partial<Data>> {
194
+ // const is_partial = (opts?.projection != null && Object.keys(opts.projection).length > 0) as Projection extends undefined ? false : true;
195
+ // if (
196
+ // this.record_version != null
197
+ // && this.transform_version != null
198
+ // && data.__record_version !== this.record_version
199
+ // ) {
200
+ // try {
201
+ // data = this.transform_version<Projection>(data, {
202
+ // from_version: data.__record_version,
203
+ // to_version: this.record_version,
204
+ // partial: is_partial,
205
+ // });
206
+ // } catch (e) {
207
+ // throw new this.error_type({
208
+ // type: "DocumentTransformError",
209
+ // message: `Failed to transform document version: ${e instanceof Error ? e.message : String(e)}`,
210
+ // status: Status.internal_server_error,
211
+ // cause: e
212
+ // });
213
+ // }
214
+ // data.__record_version = this.record_version;
215
+ // }
216
+ // // Set record version if it doesnt exist.
217
+ // // ENSURE THIS IS DONE AFTER CALLING transform_version
218
+ // if (this.record_version != null && data.__record_version == null) {
219
+ // data.__record_version = this.record_version;
220
+ // }
221
+ // // Merge defaults only on full loads. For partial (projected) loads we avoid adding fields the caller did not request.
222
+ // if (
223
+ // this.default
224
+ // && (opts?.insert_defaults ?? true)
225
+ // && !is_partial
226
+ // ) {
227
+ // try {
228
+ // Collection.insert_defaults_helper(
229
+ // data,
230
+ // this.as_default({ clone: false })!,
231
+ // { clone: true },
232
+ // );
233
+ // } catch (e) {
234
+ // throw new this.error_type({
235
+ // type: "RecursionDepthExceeded",
236
+ // message: e instanceof Error ? e.message : String(e),
237
+ // status: Status.internal_server_error,
238
+ // cause: e,
239
+ // });
240
+ // }
241
+ // }
242
+ // // Call on load.
243
+ // if (this._on_load) {
244
+ // data = this._on_load<Projection>(data, {
245
+ // partial: is_partial,
246
+ // });
247
+ // }
248
+ // // Response.
249
+ // return data;
250
+ // }
251
+ // /**
252
+ // * Get the computed default value, when defined.
253
+ // *
254
+ // * Cloning the default object by default.
255
+ // *
256
+ // * @param opts.clone Whether to clone the default object.
257
+ // * Defaults to `true`.
258
+ // */
259
+ // as_default(opts?: { clone: boolean}): Ref.WithSysFields<Data> | undefined {
260
+ // // Dont insert `_id` here so it will never be overridden.
261
+ // if (this.default) {
262
+ // const raw: Ref.WithSysFields<Data> = typeof this.default === "function" ? this.default() : this.default;
263
+ // if (opts?.clone ?? true) {
264
+ // const cloned: Data = (typeof globalThis.structuredClone === "function")
265
+ // ? structuredClone(raw)
266
+ // : vlib.Object.deep_copy(raw);
267
+ // (cloned as Ref.WithSysFields<Data>).__record_version = this.record_version;
268
+ // return cloned;
269
+ // }
270
+ // // still not mutate raw since we set __record_version.
271
+ // return {
272
+ // ...raw,
273
+ // __record_version: this.record_version,
274
+ // }
275
+ // }
276
+ // }
277
+ // /** Check if a document exists.
278
+ // * @note This does not load the full document.
279
+ // */
280
+ // async exists(): Promise<boolean> {
281
+ // return await this.col.exists(
282
+ // this.query,
283
+ // );
284
+ // }
285
+ // /**
286
+ // * Load a document from the database.
287
+ // *
288
+ // * Automatically performing the optional {@link Ref.Opts.transform_version} and {@link Ref.Opts.on_load} callbacks.
289
+ // *
290
+ // * Internally performing {@link Collection.load} so more info about the loading process can be found there.
291
+ // *
292
+ // * Default fields are automatically upserted when missing in the loaded document and
293
+ // * {@link Ref.Opts.default} is defined while {@link Collection.LoadOpts.projection} is not defined.
294
+ // *
295
+ // * @note When loading a document with a specified {@link Collection.LoadOpts.projection} the `__record_version` field will always be included.
296
+ // *
297
+ // * @returns See {@link Collection.LoadResult} for more info about the return type.
298
+ // */
299
+ // async load<
300
+ // Projection extends Collection.LoadOpts.Projection = undefined,
301
+ // Throw extends Collection.LoadOpts.Throw = undefined,
302
+ // >(
303
+ // opts?: Omit<Collection.LoadOpts<Data, Default, Projection, Throw>, "default">
304
+ // ): Promise<Collection.LoadResult<Data, Default, Projection, Throw>> {
305
+ // type Res = Collection.LoadResult<Data, Default, Projection, Throw>;
306
+ // const throw_errors = opts?.throw ?? true;
307
+ // try {
308
+ // // Check projection.
309
+ // if (opts?.projection && Object.keys(opts.projection).length === 0) {
310
+ // opts.projection = undefined;
311
+ // }
312
+ // if (opts?.projection) {
313
+ // // Insert __record_version for the transform version callback.
314
+ // if (Array.isArray(opts.projection) && !opts.projection.includes("__record_version")) {
315
+ // opts.projection = [...opts.projection, "__record_version"] as unknown as Projection;
316
+ // }
317
+ // else if (typeof opts.projection === "object") {
318
+ // // For exclusion patterns ensure record version is not excluded,
319
+ // // Inclusion and exclusion styles can not be mixed.
320
+ // if (Object.values(opts.projection).some(v => v === 0 || v === false)) {
321
+ // if (opts.projection["__record_version"] != null) {
322
+ // opts.projection = { ...opts.projection };
323
+ // delete opts.projection["__record_version"];
324
+ // }
325
+ // } else if (opts.projection["__record_version"] !== 1 && opts.projection["__record_version"] !== true) {
326
+ // // Ensure its included.
327
+ // opts.projection = {
328
+ // ...opts.projection,
329
+ // __record_version: 1,
330
+ // }
331
+ // }
332
+ // }
333
+ // }
334
+ // // Load data.
335
+ // if ((opts as undefined | Collection.LoadOpts<Data, Default, Projection, Throw>)?.default) {
336
+ // // ensure default is not present at runtime.
337
+ // opts = { ...opts, default: undefined } as Collection.LoadOpts<Data, Default, Projection, Throw>
338
+ // }
339
+ // const data = await this.col.load<Default, Projection, Throw>(
340
+ // this.query,
341
+ // opts,
342
+ // );
343
+ // // Error returned by `throw:false`
344
+ // if (data instanceof Error) {
345
+ // if (data instanceof Collection.NotFoundError && this.default) {
346
+ // // Not found & this.default is defined.
347
+ // const data = this.as_default() as Ref.WithSysFieldsAndId<Data>;
348
+ // if ((data as any)._id == null) {
349
+ // (data as any)._id = new mongodb.ObjectId();
350
+ // }
351
+ // return this.on_load<Projection>(
352
+ // data,
353
+ // { insert_defaults: false, projection: opts?.projection as Projection },
354
+ // ) as Res;
355
+ // }
356
+ // if (throw_errors) throw data;
357
+ // return data;
358
+ // }
359
+ // // Not an error.
360
+ // const success_data = data as Projection extends undefined ? Ref.WithSysFieldsAndId<Data> : Ref.WithSysFieldsAndId<Partial<Data>>;
361
+ // return this.on_load<Projection>(
362
+ // success_data,
363
+ // { insert_defaults: true, projection: opts?.projection as Projection },
364
+ // ) as Res;
365
+ // // Handle thrown errors.
366
+ // } catch (err: unknown) {
367
+ // // Not found when `throw:true`.
368
+ // if (err instanceof Collection.NotFoundError) {
369
+ // if (this.default) {
370
+ // const data = this.as_default() as Ref.WithSysFieldsAndId<Data>;
371
+ // if (!(data as any)._id) {
372
+ // (data as any)._id = new mongodb.ObjectId();
373
+ // }
374
+ // return this.on_load<Projection>(
375
+ // data,
376
+ // { insert_defaults: false, projection: opts?.projection as Projection },
377
+ // ) as Res;
378
+ // }
379
+ // if (throw_errors) throw err;
380
+ // return err as Res;
381
+ // }
382
+ // // Throw or return error.
383
+ // if (throw_errors) throw err;
384
+ // return err as Res;
385
+ // }
386
+ // }
387
+ // /**
388
+ // * Safely save the document to the database, internally executing {@link Collection.save}
389
+ // * Inserting default values upon document creation.
390
+ // *
391
+ // * @note This retrieves the default document values upon every call.
392
+ // * Either by executing the {@link Ref.def} method, or by passing its
393
+ // * raw properties directly if it is passed as such.
394
+ // *
395
+ // * @warning Keep in mind that if you defined {@link Ref.def} as method,
396
+ // * it will be called on every call of this function.
397
+ // */
398
+ // async safe_set<
399
+ // Bulk extends boolean | undefined = undefined,
400
+ // Return extends boolean | undefined = undefined,
401
+ // Throw extends boolean | undefined = undefined,
402
+ // Upsert extends boolean | undefined = undefined,
403
+ // >(
404
+ // data: Data | FlattenToDotNotation<Data>,
405
+ // opts?: Collection.SaveOpts<Bulk, Return, Throw, Upsert> & Pick<Collection.SetOpts, "flatten">,
406
+ // ): Promise<Collection.SaveResult<Data, Bulk, Return, Throw>> {
407
+ // const op_data: Ref.WithSysFields<Data | FlattenToDotNotation<Data>> = {
408
+ // ...(opts?.flatten ? this.col.flatten(data) as any : data),
409
+ // __record_version: this.record_version,
410
+ // };
411
+ // return this.col.save<Bulk, Return, Throw, Upsert>(
412
+ // this.query,
413
+ // {
414
+ // $set: op_data,
415
+ // $setOnInsert: this.as_default(),
416
+ // } as StrictUpdateFilter<Data>,
417
+ // opts,
418
+ // );
419
+ // }
420
+ // /**
421
+ // * Save the document to the database, internally executing {@link Collection.set}
422
+ // *
423
+ // * @warning This does not insert the default values upon document creation.
424
+ // * Use {@link safe_set} to safely insert defaults.
425
+ // *
426
+ // * @throws An error if the document write is not acknowledged by mongodb (failed) or if the matched query count is 0.
427
+ // * Or when `return` is `true` it returns an error if the returned document is undefined.
428
+ // */
429
+ // async set<
430
+ // Bulk extends boolean | undefined = undefined,
431
+ // Return extends boolean | undefined = undefined,
432
+ // Throw extends boolean | undefined = undefined,
433
+ // Upsert extends boolean | undefined = undefined,
434
+ // >(
435
+ // data: Data | FlattenToDotNotation<Data>,
436
+ // opts?: Collection.SetOpts<Bulk, Return, Throw, Upsert>,
437
+ // ): Promise<Collection.SetResult<Data, Bulk, Return, Throw>> {
438
+ // const op_data: Ref.WithSysFields<Data | FlattenToDotNotation<Data>> = {
439
+ // ...data, // flattening is handled in `col.set`.
440
+ // __record_version: this.record_version,
441
+ // };
442
+ // return this.col.set(
443
+ // this.query,
444
+ // op_data,
445
+ // opts,
446
+ // );
447
+ // }
448
+ // /**
449
+ // * Save the document to the database, internally executing {@link Collection.set}
450
+ // *
451
+ // * @warning This does not insert the default values upon document creation.
452
+ // * Use {@link safe_set} to safely insert defaults.
453
+ // *
454
+ // * @throws An error if the document write is not acknowledged by mongodb (failed) or if the matched query count is 0.
455
+ // * Or when `return` is `true` it returns an error if the returned document is undefined.
456
+ // */
457
+ // async set_partial<
458
+ // Bulk extends boolean | undefined = undefined,
459
+ // Return extends boolean | undefined = undefined,
460
+ // Throw extends boolean | undefined = undefined,
461
+ // Upsert extends boolean | undefined = undefined,
462
+ // >(
463
+ // data: Partial<Data> | Partial<FlattenToDotNotation<Data>>,
464
+ // opts?: Collection.SetOpts<Bulk, Return, Throw, Upsert>,
465
+ // ): Promise<Collection.SetResult<Data, Bulk, Return, Throw>> {
466
+ // const op_data: Ref.WithSysFields<Partial<Data> | Partial<FlattenToDotNotation<Data>>> = {
467
+ // ...data, // flattening is handled in `col.set`.
468
+ // __record_version: this.record_version,
469
+ // };
470
+ // return this.col.set(
471
+ // this.query,
472
+ // op_data,
473
+ // opts,
474
+ // );
475
+ // }
476
+ // /**
477
+ // * Save a single document without performing any default `$set` or `$inc` like operations.
478
+ // * When a document does not exist it will automatically be created.
479
+ // * Inserting default values upon document creation.
480
+ // *
481
+ // * @warning Keep in mind that if you defined {@link Ref.def} as method,
482
+ // * it will be called on every call of this function.
483
+ // *
484
+ // * @note This retrieves the default document values upon every call.
485
+ // * Either by executing the {@link Ref.def} method, or by passing its
486
+ // * raw properties directly if it is passed as such.
487
+ // *
488
+ // * @throws An error if the document write is not acknowledged by mongodb (failed) or if the matched query count is 0.
489
+ // * Or when `return` is `true` it returns an error if the returned document is undefined.
490
+ // */
491
+ // async safe_save<
492
+ // Bulk extends boolean | undefined = undefined,
493
+ // Return extends boolean | undefined = undefined,
494
+ // Throw extends boolean | undefined = undefined,
495
+ // Upsert extends boolean | undefined = undefined,
496
+ // >(
497
+ // data: vlib.Types.Neverify<StrictUpdateFilter<Data>, "$setOnInsert">,
498
+ // opts?: Collection.SaveOpts<Bulk, Return, Throw, Upsert>,
499
+ // ): Promise<Collection.SaveResult<Data, Bulk, Return, Throw>> {
500
+ // if (data.$set == null) {
501
+ // (data as StrictUpdateFilter<any>).$set = { __record_version: this.record_version }
502
+ // } else {
503
+ // (data as StrictUpdateFilter<any>).$set = {
504
+ // ...(data as StrictUpdateFilter<any>).$set,
505
+ // __record_version: this.record_version,
506
+ // };
507
+ // }
508
+ // (data as StrictUpdateFilter<any>).$setOnInsert = this.as_default();
509
+ // return this.col.save(
510
+ // this.query,
511
+ // data,
512
+ // opts,
513
+ // );
514
+ // }
515
+ // /**
516
+ // * Save a single document without performing any default `$set` or `$inc` like operations.
517
+ // * When a document does not exist it will automatically be created.
518
+ // *
519
+ // * @warning This does not insert the default values upon document creation.
520
+ // * Use {@link safe_save} to safely insert defaults.
521
+ // *
522
+ // * @throws An error if the document write is not acknowledged by mongodb (failed) or if the matched query count is 0.
523
+ // * Or when `return` is `true` it returns an error if the returned document is undefined.
524
+ // */
525
+ // async save<
526
+ // Bulk extends boolean | undefined = undefined,
527
+ // Return extends boolean | undefined = undefined,
528
+ // Throw extends boolean | undefined = undefined,
529
+ // Upsert extends boolean | undefined = undefined,
530
+ // >(
531
+ // data: StrictUpdateFilter<Data>,
532
+ // opts?: Collection.SaveOpts<Bulk, Return, Throw, Upsert>,
533
+ // ): Promise<Collection.SaveResult<Data, Bulk, Return, Throw>> {
534
+ // if (data.$set == null) {
535
+ // (data as StrictUpdateFilter<any>).$set = { __record_version: this.record_version }
536
+ // } else {
537
+ // (data as StrictUpdateFilter<any>).$set = {
538
+ // ...(data as StrictUpdateFilter<any>).$set,
539
+ // __record_version: this.record_version,
540
+ // };
541
+ // }
542
+ // return this.col.save(
543
+ // this.query,
544
+ // data,
545
+ // opts,
546
+ // );
547
+ // }
548
+ // /** Delete the database record. */
549
+ // async delete<Bulk extends boolean | undefined = undefined>(
550
+ // opts?: Collection.DeleteOpts<Bulk>,
551
+ // ): Promise<Collection.DeleteResult<Data, Bulk>> {
552
+ // return this.col.delete(
553
+ // this.query,
554
+ // opts,
555
+ // );
556
+ // }
557
+ // }
558
+ // }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh.
4
+ */
5
+ export { StrictFilter } from "./strict_filter.js";
6
+ export { StrictUpdateFilter } from "./strict_update_filter.js";