@vandenberghinc/volt 1.2.5 → 1.2.6

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 (489) hide show
  1. package/frontend/assets/admin/admin.png +0 -0
  2. package/frontend/assets/admin/password.webp +0 -0
  3. package/frontend/assets/icons/arrow.v1.webp +0 -0
  4. package/frontend/assets/icons/copy.webp +0 -0
  5. package/frontend/assets/payments/arrow.long.webp +0 -0
  6. package/frontend/assets/payments/arrow.long2.webp +0 -0
  7. package/frontend/assets/payments/cancelled.webp +0 -0
  8. package/frontend/assets/payments/check.sign.webp +0 -0
  9. package/frontend/assets/payments/check.webp +0 -0
  10. package/frontend/assets/payments/close.webp +0 -0
  11. package/frontend/assets/payments/error.webp +0 -0
  12. package/frontend/assets/payments/exclamation.webp +0 -0
  13. package/frontend/assets/payments/minus.webp +0 -0
  14. package/frontend/assets/payments/party.webp +0 -0
  15. package/frontend/assets/payments/plus.webp +0 -0
  16. package/frontend/assets/payments/shopping_cart.webp +0 -0
  17. package/frontend/assets/payments/trash.webp +0 -0
  18. package/package.json +5 -1
  19. package/.libris/config.json +0 -82
  20. package/backend/dist/cjs/backend/src/blacklist.d.ts +0 -12
  21. package/backend/dist/cjs/backend/src/blacklist.js +0 -78
  22. package/backend/dist/cjs/backend/src/cli.d.ts +0 -2
  23. package/backend/dist/cjs/backend/src/cli.js +0 -198
  24. package/backend/dist/cjs/backend/src/database/collection.d.ts +0 -1765
  25. package/backend/dist/cjs/backend/src/database/collection.js +0 -3301
  26. package/backend/dist/cjs/backend/src/database/database.d.ts +0 -92
  27. package/backend/dist/cjs/backend/src/database/database.js +0 -170
  28. package/backend/dist/cjs/backend/src/database/document.d.ts +0 -1
  29. package/backend/dist/cjs/backend/src/database/document.js +0 -15
  30. package/backend/dist/cjs/backend/src/database/filters/filters.d.ts +0 -6
  31. package/backend/dist/cjs/backend/src/database/filters/filters.js +0 -15
  32. package/backend/dist/cjs/backend/src/database/filters/strict_filter.d.ts +0 -223
  33. package/backend/dist/cjs/backend/src/database/filters/strict_filter.js +0 -15
  34. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.d.ts +0 -1
  35. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.js +0 -443
  36. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.d.ts +0 -1
  37. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.js +0 -15
  38. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.d.ts +0 -50
  39. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.js +0 -15
  40. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.d.ts +0 -76
  41. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.js +0 -15
  42. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.d.ts +0 -75
  43. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.js +0 -15
  44. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.d.ts +0 -219
  45. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.js +0 -15
  46. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.d.ts +0 -165
  47. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.js +0 -15
  48. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.d.ts +0 -5
  49. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.js +0 -355
  50. package/backend/dist/cjs/backend/src/database/flatten.d.ts +0 -78
  51. package/backend/dist/cjs/backend/src/database/flatten.js +0 -53
  52. package/backend/dist/cjs/backend/src/database/flatten_test.d.ts +0 -1
  53. package/backend/dist/cjs/backend/src/database/flatten_test.js +0 -175
  54. package/backend/dist/cjs/backend/src/database/quota/quoata_v2.d.ts +0 -533
  55. package/backend/dist/cjs/backend/src/database/quota/quoata_v2.js +0 -1046
  56. package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +0 -551
  57. package/backend/dist/cjs/backend/src/database/quota/quota.js +0 -1108
  58. package/backend/dist/cjs/backend/src/database/quota/quota_v1.d.ts +0 -534
  59. package/backend/dist/cjs/backend/src/database/quota/quota_v1.js +0 -1087
  60. package/backend/dist/cjs/backend/src/database/quota/safe_int.d.ts +0 -412
  61. package/backend/dist/cjs/backend/src/database/quota/safe_int.js +0 -745
  62. package/backend/dist/cjs/backend/src/endpoint.d.ts +0 -346
  63. package/backend/dist/cjs/backend/src/endpoint.js +0 -468
  64. package/backend/dist/cjs/backend/src/errors/index.d.ts +0 -7
  65. package/backend/dist/cjs/backend/src/errors/index.js +0 -25
  66. package/backend/dist/cjs/backend/src/errors/internal_external.d.ts +0 -52
  67. package/backend/dist/cjs/backend/src/errors/internal_external.js +0 -95
  68. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +0 -41
  69. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.js +0 -47
  70. package/backend/dist/cjs/backend/src/errors/system_error.d.ts +0 -261
  71. package/backend/dist/cjs/backend/src/errors/system_error.js +0 -436
  72. package/backend/dist/cjs/backend/src/events.d.ts +0 -97
  73. package/backend/dist/cjs/backend/src/events.js +0 -15
  74. package/backend/dist/cjs/backend/src/frontend.d.ts +0 -11
  75. package/backend/dist/cjs/backend/src/frontend.js +0 -37
  76. package/backend/dist/cjs/backend/src/image_endpoint.d.ts +0 -44
  77. package/backend/dist/cjs/backend/src/image_endpoint.js +0 -185
  78. package/backend/dist/cjs/backend/src/index.d.ts +0 -23
  79. package/backend/dist/cjs/backend/src/index.js +0 -70
  80. package/backend/dist/cjs/backend/src/logger.d.ts +0 -5
  81. package/backend/dist/cjs/backend/src/logger.js +0 -15
  82. package/backend/dist/cjs/backend/src/meta.d.ts +0 -112
  83. package/backend/dist/cjs/backend/src/meta.js +0 -181
  84. package/backend/dist/cjs/backend/src/payments/paddle.d.ts +0 -329
  85. package/backend/dist/cjs/backend/src/payments/paddle.js +0 -1996
  86. package/backend/dist/cjs/backend/src/payments/stripe/checkout.d.ts +0 -113
  87. package/backend/dist/cjs/backend/src/payments/stripe/checkout.js +0 -295
  88. package/backend/dist/cjs/backend/src/payments/stripe/customers.d.ts +0 -17
  89. package/backend/dist/cjs/backend/src/payments/stripe/customers.js +0 -164
  90. package/backend/dist/cjs/backend/src/payments/stripe/error.d.ts +0 -74
  91. package/backend/dist/cjs/backend/src/payments/stripe/error.js +0 -64
  92. package/backend/dist/cjs/backend/src/payments/stripe/events.d.ts +0 -155
  93. package/backend/dist/cjs/backend/src/payments/stripe/events.js +0 -15
  94. package/backend/dist/cjs/backend/src/payments/stripe/meters.d.ts +0 -105
  95. package/backend/dist/cjs/backend/src/payments/stripe/meters.js +0 -230
  96. package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.d.ts +0 -58
  97. package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.js +0 -109
  98. package/backend/dist/cjs/backend/src/payments/stripe/products.d.ts +0 -519
  99. package/backend/dist/cjs/backend/src/payments/stripe/products.js +0 -650
  100. package/backend/dist/cjs/backend/src/payments/stripe/stripe.d.ts +0 -215
  101. package/backend/dist/cjs/backend/src/payments/stripe/stripe.js +0 -468
  102. package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.d.ts +0 -172
  103. package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.js +0 -557
  104. package/backend/dist/cjs/backend/src/payments/stripe/utils.d.ts +0 -63
  105. package/backend/dist/cjs/backend/src/payments/stripe/utils.js +0 -118
  106. package/backend/dist/cjs/backend/src/payments/stripe/webhooks.d.ts +0 -105
  107. package/backend/dist/cjs/backend/src/payments/stripe/webhooks.js +0 -627
  108. package/backend/dist/cjs/backend/src/plugins/browser.d.ts +0 -1
  109. package/backend/dist/cjs/backend/src/plugins/browser.js +0 -15
  110. package/backend/dist/cjs/backend/src/plugins/communication.d.ts +0 -70
  111. package/backend/dist/cjs/backend/src/plugins/communication.js +0 -196
  112. package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +0 -255
  113. package/backend/dist/cjs/backend/src/plugins/mail/mail.js +0 -381
  114. package/backend/dist/cjs/backend/src/plugins/mail/ui.d.ts +0 -297
  115. package/backend/dist/cjs/backend/src/plugins/mail/ui.js +0 -1370
  116. package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +0 -1
  117. package/backend/dist/cjs/backend/src/plugins/pdf.js +0 -1456
  118. package/backend/dist/cjs/backend/src/plugins/thread_monitor.d.ts +0 -18
  119. package/backend/dist/cjs/backend/src/plugins/thread_monitor.js +0 -116
  120. package/backend/dist/cjs/backend/src/rate_limit.d.ts +0 -148
  121. package/backend/dist/cjs/backend/src/rate_limit.js +0 -543
  122. package/backend/dist/cjs/backend/src/route.d.ts +0 -39
  123. package/backend/dist/cjs/backend/src/route.js +0 -172
  124. package/backend/dist/cjs/backend/src/server.d.ts +0 -502
  125. package/backend/dist/cjs/backend/src/server.js +0 -1713
  126. package/backend/dist/cjs/backend/src/server.old.d.ts +0 -594
  127. package/backend/dist/cjs/backend/src/server.old.js +0 -2058
  128. package/backend/dist/cjs/backend/src/splash_screen.d.ts +0 -93
  129. package/backend/dist/cjs/backend/src/splash_screen.js +0 -119
  130. package/backend/dist/cjs/backend/src/status.d.ts +0 -89
  131. package/backend/dist/cjs/backend/src/status.js +0 -211
  132. package/backend/dist/cjs/backend/src/stream.d.ts +0 -494
  133. package/backend/dist/cjs/backend/src/stream.js +0 -1370
  134. package/backend/dist/cjs/backend/src/users.d.ts +0 -926
  135. package/backend/dist/cjs/backend/src/users.js +0 -2223
  136. package/backend/dist/cjs/backend/src/utils.d.ts +0 -22
  137. package/backend/dist/cjs/backend/src/utils.js +0 -626
  138. package/backend/dist/cjs/backend/src/view.d.ts +0 -115
  139. package/backend/dist/cjs/backend/src/view.js +0 -519
  140. package/backend/dist/cjs/backend/src/vinc.d.ts +0 -6
  141. package/backend/dist/cjs/backend/src/vinc.js +0 -40
  142. package/backend/dist/cjs/backend/src/volt.d.ts +0 -24
  143. package/backend/dist/cjs/backend/src/volt.js +0 -72
  144. package/backend/dist/cjs/frontend/src/modules/request.d.ts +0 -70
  145. package/backend/dist/cjs/frontend/src/modules/request.js +0 -99
  146. package/backend/dist/cjs/package.json +0 -1
  147. package/backend/dist/esm/backend/src/blacklist.d.ts +0 -12
  148. package/backend/dist/esm/backend/src/blacklist.js +0 -52
  149. package/backend/dist/esm/backend/src/cli.d.ts +0 -2
  150. package/backend/dist/esm/backend/src/cli.js +0 -211
  151. package/backend/dist/esm/backend/src/database/collection.d.ts +0 -1765
  152. package/backend/dist/esm/backend/src/database/collection.js +0 -3779
  153. package/backend/dist/esm/backend/src/database/database.d.ts +0 -92
  154. package/backend/dist/esm/backend/src/database/database.js +0 -214
  155. package/backend/dist/esm/backend/src/database/document.d.ts +0 -1
  156. package/backend/dist/esm/backend/src/database/document.js +0 -558
  157. package/backend/dist/esm/backend/src/database/filters/filters.d.ts +0 -6
  158. package/backend/dist/esm/backend/src/database/filters/filters.js +0 -1
  159. package/backend/dist/esm/backend/src/database/filters/strict_filter.d.ts +0 -223
  160. package/backend/dist/esm/backend/src/database/filters/strict_filter.js +0 -3
  161. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.d.ts +0 -1
  162. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.js +0 -505
  163. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.d.ts +0 -1
  164. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.js +0 -712
  165. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.d.ts +0 -50
  166. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.js +0 -5
  167. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.d.ts +0 -76
  168. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.js +0 -44
  169. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.d.ts +0 -75
  170. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.js +0 -5
  171. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.d.ts +0 -219
  172. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.js +0 -1
  173. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.d.ts +0 -165
  174. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.js +0 -5
  175. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.d.ts +0 -5
  176. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.js +0 -415
  177. package/backend/dist/esm/backend/src/database/flatten.d.ts +0 -78
  178. package/backend/dist/esm/backend/src/database/flatten.js +0 -22
  179. package/backend/dist/esm/backend/src/database/flatten_test.d.ts +0 -1
  180. package/backend/dist/esm/backend/src/database/flatten_test.js +0 -174
  181. package/backend/dist/esm/backend/src/database/quota/quoata_v2.d.ts +0 -533
  182. package/backend/dist/esm/backend/src/database/quota/quoata_v2.js +0 -1155
  183. package/backend/dist/esm/backend/src/database/quota/quota.d.ts +0 -551
  184. package/backend/dist/esm/backend/src/database/quota/quota.js +0 -1219
  185. package/backend/dist/esm/backend/src/database/quota/quota_v1.d.ts +0 -534
  186. package/backend/dist/esm/backend/src/database/quota/quota_v1.js +0 -1242
  187. package/backend/dist/esm/backend/src/database/quota/safe_int.d.ts +0 -412
  188. package/backend/dist/esm/backend/src/database/quota/safe_int.js +0 -810
  189. package/backend/dist/esm/backend/src/endpoint.d.ts +0 -346
  190. package/backend/dist/esm/backend/src/endpoint.js +0 -479
  191. package/backend/dist/esm/backend/src/errors/index.d.ts +0 -7
  192. package/backend/dist/esm/backend/src/errors/index.js +0 -7
  193. package/backend/dist/esm/backend/src/errors/internal_external.d.ts +0 -52
  194. package/backend/dist/esm/backend/src/errors/internal_external.js +0 -86
  195. package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +0 -41
  196. package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +0 -33
  197. package/backend/dist/esm/backend/src/errors/system_error.d.ts +0 -261
  198. package/backend/dist/esm/backend/src/errors/system_error.js +0 -444
  199. package/backend/dist/esm/backend/src/events.d.ts +0 -97
  200. package/backend/dist/esm/backend/src/events.js +0 -5
  201. package/backend/dist/esm/backend/src/frontend.d.ts +0 -11
  202. package/backend/dist/esm/backend/src/frontend.js +0 -12
  203. package/backend/dist/esm/backend/src/image_endpoint.d.ts +0 -44
  204. package/backend/dist/esm/backend/src/image_endpoint.js +0 -196
  205. package/backend/dist/esm/backend/src/index.d.ts +0 -23
  206. package/backend/dist/esm/backend/src/index.js +0 -26
  207. package/backend/dist/esm/backend/src/logger.d.ts +0 -5
  208. package/backend/dist/esm/backend/src/logger.js +0 -8
  209. package/backend/dist/esm/backend/src/meta.d.ts +0 -112
  210. package/backend/dist/esm/backend/src/meta.js +0 -152
  211. package/backend/dist/esm/backend/src/payments/paddle.d.ts +0 -329
  212. package/backend/dist/esm/backend/src/payments/paddle.js +0 -2276
  213. package/backend/dist/esm/backend/src/payments/stripe/checkout.d.ts +0 -113
  214. package/backend/dist/esm/backend/src/payments/stripe/checkout.js +0 -356
  215. package/backend/dist/esm/backend/src/payments/stripe/customers.d.ts +0 -17
  216. package/backend/dist/esm/backend/src/payments/stripe/customers.js +0 -193
  217. package/backend/dist/esm/backend/src/payments/stripe/error.d.ts +0 -74
  218. package/backend/dist/esm/backend/src/payments/stripe/error.js +0 -51
  219. package/backend/dist/esm/backend/src/payments/stripe/events.d.ts +0 -155
  220. package/backend/dist/esm/backend/src/payments/stripe/events.js +0 -5
  221. package/backend/dist/esm/backend/src/payments/stripe/meters.d.ts +0 -105
  222. package/backend/dist/esm/backend/src/payments/stripe/meters.js +0 -318
  223. package/backend/dist/esm/backend/src/payments/stripe/payment_methods.d.ts +0 -58
  224. package/backend/dist/esm/backend/src/payments/stripe/payment_methods.js +0 -135
  225. package/backend/dist/esm/backend/src/payments/stripe/products.d.ts +0 -519
  226. package/backend/dist/esm/backend/src/payments/stripe/products.js +0 -896
  227. package/backend/dist/esm/backend/src/payments/stripe/stripe.d.ts +0 -215
  228. package/backend/dist/esm/backend/src/payments/stripe/stripe.js +0 -464
  229. package/backend/dist/esm/backend/src/payments/stripe/subscriptions.d.ts +0 -172
  230. package/backend/dist/esm/backend/src/payments/stripe/subscriptions.js +0 -754
  231. package/backend/dist/esm/backend/src/payments/stripe/utils.d.ts +0 -63
  232. package/backend/dist/esm/backend/src/payments/stripe/utils.js +0 -131
  233. package/backend/dist/esm/backend/src/payments/stripe/webhooks.d.ts +0 -105
  234. package/backend/dist/esm/backend/src/payments/stripe/webhooks.js +0 -752
  235. package/backend/dist/esm/backend/src/plugins/browser.d.ts +0 -1
  236. package/backend/dist/esm/backend/src/plugins/browser.js +0 -170
  237. package/backend/dist/esm/backend/src/plugins/communication.d.ts +0 -70
  238. package/backend/dist/esm/backend/src/plugins/communication.js +0 -169
  239. package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +0 -255
  240. package/backend/dist/esm/backend/src/plugins/mail/mail.js +0 -396
  241. package/backend/dist/esm/backend/src/plugins/mail/ui.d.ts +0 -297
  242. package/backend/dist/esm/backend/src/plugins/mail/ui.js +0 -1400
  243. package/backend/dist/esm/backend/src/plugins/pdf.d.ts +0 -1
  244. package/backend/dist/esm/backend/src/plugins/pdf.js +0 -1694
  245. package/backend/dist/esm/backend/src/plugins/thread_monitor.d.ts +0 -18
  246. package/backend/dist/esm/backend/src/plugins/thread_monitor.js +0 -120
  247. package/backend/dist/esm/backend/src/rate_limit.d.ts +0 -148
  248. package/backend/dist/esm/backend/src/rate_limit.js +0 -667
  249. package/backend/dist/esm/backend/src/route.d.ts +0 -39
  250. package/backend/dist/esm/backend/src/route.js +0 -222
  251. package/backend/dist/esm/backend/src/server.d.ts +0 -502
  252. package/backend/dist/esm/backend/src/server.js +0 -2034
  253. package/backend/dist/esm/backend/src/server.old.d.ts +0 -594
  254. package/backend/dist/esm/backend/src/server.old.js +0 -2630
  255. package/backend/dist/esm/backend/src/splash_screen.d.ts +0 -93
  256. package/backend/dist/esm/backend/src/splash_screen.js +0 -156
  257. package/backend/dist/esm/backend/src/status.d.ts +0 -89
  258. package/backend/dist/esm/backend/src/status.js +0 -213
  259. package/backend/dist/esm/backend/src/stream.d.ts +0 -494
  260. package/backend/dist/esm/backend/src/stream.js +0 -1611
  261. package/backend/dist/esm/backend/src/users.d.ts +0 -926
  262. package/backend/dist/esm/backend/src/users.js +0 -2423
  263. package/backend/dist/esm/backend/src/utils.d.ts +0 -22
  264. package/backend/dist/esm/backend/src/utils.js +0 -463
  265. package/backend/dist/esm/backend/src/view.d.ts +0 -115
  266. package/backend/dist/esm/backend/src/view.js +0 -584
  267. package/backend/dist/esm/backend/src/vinc.d.ts +0 -6
  268. package/backend/dist/esm/backend/src/vinc.js +0 -6
  269. package/backend/dist/esm/backend/src/volt.d.ts +0 -24
  270. package/backend/dist/esm/backend/src/volt.js +0 -27
  271. package/backend/dist/esm/frontend/src/modules/request.d.ts +0 -70
  272. package/backend/dist/esm/frontend/src/modules/request.js +0 -117
  273. package/backend/old/file_watcher.ts +0 -359
  274. package/backend/old/request.deprc.js +0 -626
  275. package/backend/old/response.deprc.js +0 -354
  276. package/frontend/dist/backend/src/database/collection.d.ts +0 -1765
  277. package/frontend/dist/backend/src/database/collection.js +0 -3779
  278. package/frontend/dist/backend/src/database/database.d.ts +0 -92
  279. package/frontend/dist/backend/src/database/database.js +0 -214
  280. package/frontend/dist/backend/src/database/filters/filters.d.ts +0 -6
  281. package/frontend/dist/backend/src/database/filters/filters.js +0 -1
  282. package/frontend/dist/backend/src/database/filters/strict_filter.d.ts +0 -223
  283. package/frontend/dist/backend/src/database/filters/strict_filter.js +0 -3
  284. package/frontend/dist/backend/src/database/filters/strict_update_filter.d.ts +0 -165
  285. package/frontend/dist/backend/src/database/filters/strict_update_filter.js +0 -5
  286. package/frontend/dist/backend/src/database/flatten.d.ts +0 -78
  287. package/frontend/dist/backend/src/database/flatten.js +0 -22
  288. package/frontend/dist/backend/src/endpoint.d.ts +0 -346
  289. package/frontend/dist/backend/src/endpoint.js +0 -479
  290. package/frontend/dist/backend/src/errors/index.d.ts +0 -7
  291. package/frontend/dist/backend/src/errors/index.js +0 -7
  292. package/frontend/dist/backend/src/errors/internal_external.d.ts +0 -52
  293. package/frontend/dist/backend/src/errors/internal_external.js +0 -86
  294. package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +0 -41
  295. package/frontend/dist/backend/src/errors/invalid_usage_error.js +0 -33
  296. package/frontend/dist/backend/src/errors/system_error.d.ts +0 -261
  297. package/frontend/dist/backend/src/errors/system_error.js +0 -444
  298. package/frontend/dist/backend/src/events.d.ts +0 -97
  299. package/frontend/dist/backend/src/events.js +0 -5
  300. package/frontend/dist/backend/src/frontend.d.ts +0 -11
  301. package/frontend/dist/backend/src/frontend.js +0 -12
  302. package/frontend/dist/backend/src/image_endpoint.d.ts +0 -44
  303. package/frontend/dist/backend/src/image_endpoint.js +0 -196
  304. package/frontend/dist/backend/src/meta.d.ts +0 -112
  305. package/frontend/dist/backend/src/meta.js +0 -152
  306. package/frontend/dist/backend/src/payments/paddle.d.ts +0 -329
  307. package/frontend/dist/backend/src/payments/paddle.js +0 -2276
  308. package/frontend/dist/backend/src/payments/stripe/checkout.d.ts +0 -113
  309. package/frontend/dist/backend/src/payments/stripe/checkout.js +0 -356
  310. package/frontend/dist/backend/src/payments/stripe/customers.d.ts +0 -17
  311. package/frontend/dist/backend/src/payments/stripe/customers.js +0 -193
  312. package/frontend/dist/backend/src/payments/stripe/error.d.ts +0 -74
  313. package/frontend/dist/backend/src/payments/stripe/error.js +0 -51
  314. package/frontend/dist/backend/src/payments/stripe/events.d.ts +0 -155
  315. package/frontend/dist/backend/src/payments/stripe/events.js +0 -5
  316. package/frontend/dist/backend/src/payments/stripe/meters.d.ts +0 -105
  317. package/frontend/dist/backend/src/payments/stripe/meters.js +0 -318
  318. package/frontend/dist/backend/src/payments/stripe/payment_methods.d.ts +0 -58
  319. package/frontend/dist/backend/src/payments/stripe/payment_methods.js +0 -135
  320. package/frontend/dist/backend/src/payments/stripe/products.d.ts +0 -519
  321. package/frontend/dist/backend/src/payments/stripe/products.js +0 -896
  322. package/frontend/dist/backend/src/payments/stripe/stripe.d.ts +0 -215
  323. package/frontend/dist/backend/src/payments/stripe/stripe.js +0 -464
  324. package/frontend/dist/backend/src/payments/stripe/subscriptions.d.ts +0 -172
  325. package/frontend/dist/backend/src/payments/stripe/subscriptions.js +0 -754
  326. package/frontend/dist/backend/src/payments/stripe/utils.d.ts +0 -63
  327. package/frontend/dist/backend/src/payments/stripe/utils.js +0 -131
  328. package/frontend/dist/backend/src/payments/stripe/webhooks.d.ts +0 -105
  329. package/frontend/dist/backend/src/payments/stripe/webhooks.js +0 -752
  330. package/frontend/dist/backend/src/plugins/mail/mail.d.ts +0 -255
  331. package/frontend/dist/backend/src/plugins/mail/mail.js +0 -396
  332. package/frontend/dist/backend/src/plugins/mail/ui.d.ts +0 -297
  333. package/frontend/dist/backend/src/plugins/mail/ui.js +0 -1400
  334. package/frontend/dist/backend/src/rate_limit.d.ts +0 -148
  335. package/frontend/dist/backend/src/rate_limit.js +0 -667
  336. package/frontend/dist/backend/src/route.d.ts +0 -39
  337. package/frontend/dist/backend/src/route.js +0 -222
  338. package/frontend/dist/backend/src/server.d.ts +0 -502
  339. package/frontend/dist/backend/src/server.js +0 -2034
  340. package/frontend/dist/backend/src/splash_screen.d.ts +0 -93
  341. package/frontend/dist/backend/src/splash_screen.js +0 -156
  342. package/frontend/dist/backend/src/status.d.ts +0 -89
  343. package/frontend/dist/backend/src/status.js +0 -213
  344. package/frontend/dist/backend/src/stream.d.ts +0 -494
  345. package/frontend/dist/backend/src/stream.js +0 -1611
  346. package/frontend/dist/backend/src/users.d.ts +0 -926
  347. package/frontend/dist/backend/src/users.js +0 -2423
  348. package/frontend/dist/backend/src/utils.d.ts +0 -22
  349. package/frontend/dist/backend/src/utils.js +0 -463
  350. package/frontend/dist/backend/src/view.d.ts +0 -115
  351. package/frontend/dist/backend/src/view.js +0 -584
  352. package/frontend/dist/frontend/src/elements/base.d.ts +0 -3743
  353. package/frontend/dist/frontend/src/elements/base.js +0 -12151
  354. package/frontend/dist/frontend/src/elements/module.d.ts +0 -95
  355. package/frontend/dist/frontend/src/elements/module.js +0 -216
  356. package/frontend/dist/frontend/src/elements/register_element.d.ts +0 -3
  357. package/frontend/dist/frontend/src/elements/register_element.js +0 -22
  358. package/frontend/dist/frontend/src/elements/resize_query_manager.d.ts +0 -0
  359. package/frontend/dist/frontend/src/elements/resize_query_manager.js +0 -150
  360. package/frontend/dist/frontend/src/elements/types.d.ts +0 -52
  361. package/frontend/dist/frontend/src/elements/types.js +0 -5
  362. package/frontend/dist/frontend/src/index.d.ts +0 -21
  363. package/frontend/dist/frontend/src/index.js +0 -29
  364. package/frontend/dist/frontend/src/modules/attachment.d.ts +0 -126
  365. package/frontend/dist/frontend/src/modules/attachment.js +0 -306
  366. package/frontend/dist/frontend/src/modules/auth.d.ts +0 -44
  367. package/frontend/dist/frontend/src/modules/auth.js +0 -80
  368. package/frontend/dist/frontend/src/modules/color.d.ts +0 -160
  369. package/frontend/dist/frontend/src/modules/color.js +0 -316
  370. package/frontend/dist/frontend/src/modules/compression.d.ts +0 -39
  371. package/frontend/dist/frontend/src/modules/compression.js +0 -102
  372. package/frontend/dist/frontend/src/modules/cookies.d.ts +0 -44
  373. package/frontend/dist/frontend/src/modules/cookies.js +0 -143
  374. package/frontend/dist/frontend/src/modules/events.d.ts +0 -31
  375. package/frontend/dist/frontend/src/modules/events.js +0 -79
  376. package/frontend/dist/frontend/src/modules/google.d.ts +0 -23
  377. package/frontend/dist/frontend/src/modules/google.js +0 -52
  378. package/frontend/dist/frontend/src/modules/meta.d.ts +0 -14
  379. package/frontend/dist/frontend/src/modules/meta.js +0 -48
  380. package/frontend/dist/frontend/src/modules/paddle.d.ts +0 -1207
  381. package/frontend/dist/frontend/src/modules/paddle.js +0 -2594
  382. package/frontend/dist/frontend/src/modules/request.d.ts +0 -70
  383. package/frontend/dist/frontend/src/modules/request.js +0 -117
  384. package/frontend/dist/frontend/src/modules/settings.d.ts +0 -3
  385. package/frontend/dist/frontend/src/modules/settings.js +0 -5
  386. package/frontend/dist/frontend/src/modules/statics.d.ts +0 -21
  387. package/frontend/dist/frontend/src/modules/statics.js +0 -43
  388. package/frontend/dist/frontend/src/modules/stripe/cart.d.ts +0 -112
  389. package/frontend/dist/frontend/src/modules/stripe/cart.js +0 -321
  390. package/frontend/dist/frontend/src/modules/stripe/checkout.d.ts +0 -7
  391. package/frontend/dist/frontend/src/modules/stripe/checkout.js +0 -37
  392. package/frontend/dist/frontend/src/modules/stripe/index.m.d.ts +0 -6
  393. package/frontend/dist/frontend/src/modules/stripe/index.m.js +0 -6
  394. package/frontend/dist/frontend/src/modules/stripe/payments.d.ts +0 -58
  395. package/frontend/dist/frontend/src/modules/stripe/payments.js +0 -92
  396. package/frontend/dist/frontend/src/modules/support.d.ts +0 -30
  397. package/frontend/dist/frontend/src/modules/support.js +0 -53
  398. package/frontend/dist/frontend/src/modules/theme.d.ts +0 -133
  399. package/frontend/dist/frontend/src/modules/theme.js +0 -406
  400. package/frontend/dist/frontend/src/modules/themes.d.ts +0 -12
  401. package/frontend/dist/frontend/src/modules/themes.js +0 -22
  402. package/frontend/dist/frontend/src/modules/user.d.ts +0 -164
  403. package/frontend/dist/frontend/src/modules/user.js +0 -270
  404. package/frontend/dist/frontend/src/modules/utils.d.ts +0 -176
  405. package/frontend/dist/frontend/src/modules/utils.js +0 -569
  406. package/frontend/dist/frontend/src/types/gradient.d.ts +0 -29
  407. package/frontend/dist/frontend/src/types/gradient.js +0 -79
  408. package/frontend/dist/frontend/src/ui/border_button.d.ts +0 -94
  409. package/frontend/dist/frontend/src/ui/border_button.js +0 -228
  410. package/frontend/dist/frontend/src/ui/button.d.ts +0 -241
  411. package/frontend/dist/frontend/src/ui/button.js +0 -682
  412. package/frontend/dist/frontend/src/ui/canvas.d.ts +0 -138
  413. package/frontend/dist/frontend/src/ui/canvas.js +0 -444
  414. package/frontend/dist/frontend/src/ui/checkbox.d.ts +0 -74
  415. package/frontend/dist/frontend/src/ui/checkbox.js +0 -321
  416. package/frontend/dist/frontend/src/ui/code.d.ts +0 -235
  417. package/frontend/dist/frontend/src/ui/code.js +0 -1007
  418. package/frontend/dist/frontend/src/ui/context_menu.d.ts +0 -36
  419. package/frontend/dist/frontend/src/ui/context_menu.js +0 -205
  420. package/frontend/dist/frontend/src/ui/css.d.ts +0 -16
  421. package/frontend/dist/frontend/src/ui/css.js +0 -48
  422. package/frontend/dist/frontend/src/ui/divider.d.ts +0 -15
  423. package/frontend/dist/frontend/src/ui/divider.js +0 -78
  424. package/frontend/dist/frontend/src/ui/dropdown.d.ts +0 -176
  425. package/frontend/dist/frontend/src/ui/dropdown.js +0 -481
  426. package/frontend/dist/frontend/src/ui/for_each.d.ts +0 -37
  427. package/frontend/dist/frontend/src/ui/for_each.js +0 -92
  428. package/frontend/dist/frontend/src/ui/form.d.ts +0 -34
  429. package/frontend/dist/frontend/src/ui/form.js +0 -233
  430. package/frontend/dist/frontend/src/ui/frame_modes.d.ts +0 -37
  431. package/frontend/dist/frontend/src/ui/frame_modes.js +0 -108
  432. package/frontend/dist/frontend/src/ui/google_map.d.ts +0 -24
  433. package/frontend/dist/frontend/src/ui/google_map.js +0 -106
  434. package/frontend/dist/frontend/src/ui/gradient.d.ts +0 -25
  435. package/frontend/dist/frontend/src/ui/gradient.js +0 -131
  436. package/frontend/dist/frontend/src/ui/image.d.ts +0 -111
  437. package/frontend/dist/frontend/src/ui/image.js +0 -576
  438. package/frontend/dist/frontend/src/ui/input.d.ts +0 -392
  439. package/frontend/dist/frontend/src/ui/input.js +0 -1201
  440. package/frontend/dist/frontend/src/ui/link.d.ts +0 -25
  441. package/frontend/dist/frontend/src/ui/link.js +0 -140
  442. package/frontend/dist/frontend/src/ui/list.d.ts +0 -37
  443. package/frontend/dist/frontend/src/ui/list.js +0 -170
  444. package/frontend/dist/frontend/src/ui/loader_button.d.ts +0 -80
  445. package/frontend/dist/frontend/src/ui/loader_button.js +0 -193
  446. package/frontend/dist/frontend/src/ui/loaders.d.ts +0 -57
  447. package/frontend/dist/frontend/src/ui/loaders.js +0 -157
  448. package/frontend/dist/frontend/src/ui/popup.d.ts +0 -94
  449. package/frontend/dist/frontend/src/ui/popup.js +0 -510
  450. package/frontend/dist/frontend/src/ui/pseudo.d.ts +0 -44
  451. package/frontend/dist/frontend/src/ui/pseudo.js +0 -154
  452. package/frontend/dist/frontend/src/ui/scroller.d.ts +0 -105
  453. package/frontend/dist/frontend/src/ui/scroller.js +0 -1253
  454. package/frontend/dist/frontend/src/ui/slider.d.ts +0 -45
  455. package/frontend/dist/frontend/src/ui/slider.js +0 -217
  456. package/frontend/dist/frontend/src/ui/spacer.d.ts +0 -15
  457. package/frontend/dist/frontend/src/ui/spacer.js +0 -78
  458. package/frontend/dist/frontend/src/ui/span.d.ts +0 -15
  459. package/frontend/dist/frontend/src/ui/span.js +0 -73
  460. package/frontend/dist/frontend/src/ui/stack.d.ts +0 -66
  461. package/frontend/dist/frontend/src/ui/stack.js +0 -335
  462. package/frontend/dist/frontend/src/ui/steps.d.ts +0 -131
  463. package/frontend/dist/frontend/src/ui/steps.js +0 -308
  464. package/frontend/dist/frontend/src/ui/style.d.ts +0 -17
  465. package/frontend/dist/frontend/src/ui/style.js +0 -73
  466. package/frontend/dist/frontend/src/ui/switch.d.ts +0 -69
  467. package/frontend/dist/frontend/src/ui/switch.js +0 -357
  468. package/frontend/dist/frontend/src/ui/table.d.ts +0 -100
  469. package/frontend/dist/frontend/src/ui/table.js +0 -405
  470. package/frontend/dist/frontend/src/ui/tabs.d.ts +0 -111
  471. package/frontend/dist/frontend/src/ui/tabs.js +0 -424
  472. package/frontend/dist/frontend/src/ui/text.d.ts +0 -15
  473. package/frontend/dist/frontend/src/ui/text.js +0 -83
  474. package/frontend/dist/frontend/src/ui/title.d.ts +0 -91
  475. package/frontend/dist/frontend/src/ui/title.js +0 -272
  476. package/frontend/dist/frontend/src/ui/ui.d.ts +0 -35
  477. package/frontend/dist/frontend/src/ui/ui.js +0 -38
  478. package/frontend/dist/frontend/src/ui/view.d.ts +0 -15
  479. package/frontend/dist/frontend/src/ui/view.js +0 -88
  480. package/frontend/dist/frontend/src/volt.d.ts +0 -20
  481. package/frontend/dist/frontend/src/volt.js +0 -27
  482. package/frontend/examples/theme/theme.ts +0 -58
  483. package/frontend/tools/bundle_d_ts.js +0 -71
  484. package/frontend/tools/convert_to_jsdoc_input.txt +0 -9452
  485. package/frontend/tools/convert_to_jsdoc_output.txt +0 -7626
  486. package/frontend/tools/convert_to_jsdoc_tmp.js +0 -345
  487. package/frontend/tools/scan_mixed_imports.js +0 -69
  488. /package/frontend/{dist/frontend/src/css → css}/adyen.css +0 -0
  489. /package/frontend/{dist/frontend/src/css → css}/volt.css +0 -0
@@ -1,321 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
4
- *
5
- * Persistent shopping cart for Stripe checkout (frontend).
6
- *
7
- * - Stores product ids and/or subscription plan ids (strings).
8
- * - Persists across reloads using localStorage.
9
- */
10
- import { create_checkout_session, create_checkout_session_id } from "./payments";
11
- /**
12
- * Shopping cart module for Stripe checkout, managing product ids and subscription plan ids with quantities.
13
- */
14
- export var Cart;
15
- (function (Cart) {
16
- // ------------------------------------------------------------
17
- // Types.
18
- /** Nested types for the {@link PersistedCart} type. */
19
- let PersistedCart;
20
- (function (PersistedCart) {
21
- /** Type guard. */
22
- function is(value) {
23
- if (!value || typeof value !== "object" || Array.isArray(value)) {
24
- return false;
25
- }
26
- const record = value;
27
- const version = record["version"];
28
- const items = record["items"];
29
- if (version !== Cart.version || !Array.isArray(items)) {
30
- return false;
31
- }
32
- for (const item of items) {
33
- if (!Cart.CartItem.is(item)) {
34
- return false;
35
- }
36
- }
37
- return true;
38
- }
39
- PersistedCart.is = is;
40
- })(PersistedCart = Cart.PersistedCart || (Cart.PersistedCart = {}));
41
- /** Nested types for the {@link CartItem} type. */
42
- let CartItem;
43
- (function (CartItem) {
44
- /** Type guard. */
45
- function is(value) {
46
- if (!value || typeof value !== "object" || Array.isArray(value)) {
47
- return false;
48
- }
49
- const record = value;
50
- return (typeof record.product_id === "string" &&
51
- typeof record.quantity === "number" && Number.isInteger(record.quantity) && record.quantity >= 1);
52
- }
53
- CartItem.is = is;
54
- })(CartItem = Cart.CartItem || (Cart.CartItem = {}));
55
- // ------------------------------------------------------------
56
- // Attributes.
57
- /** Storage key used for persistence. */
58
- const storage_key = "Volt.Stripe.Cart";
59
- /** The cart storage version. */
60
- Cart.version = 1;
61
- /** Cached items in memory for fast access. */
62
- Cart.items = load();
63
- /** The checkout session id. */
64
- let checkout_session_id;
65
- // ------------------------------------------------------------
66
- // Public API.
67
- /**
68
- * Add an item to the cart (or increment quantity if it already exists).
69
- * @param product_id The product id or subscription plan id.
70
- * @param quantity Quantity to add (defaults to 1).
71
- */
72
- async function add(product_id, quantity = 1) {
73
- validate_quantity(quantity);
74
- // Merge with existing line item if present.
75
- const existing_index = Cart.items.findIndex((item) => item.product_id === product_id);
76
- if (existing_index >= 0) {
77
- const existing_item = Cart.items[existing_index];
78
- if (!existing_item) {
79
- throw new Error("cart_corrupted_state");
80
- }
81
- const next_quantity = existing_item.quantity + quantity;
82
- if (!Number.isSafeInteger(next_quantity) || next_quantity < 1) {
83
- throw new Error("cart_invalid_quantity");
84
- }
85
- Cart.items = Cart.items.map((item, index) => {
86
- if (index !== existing_index) {
87
- return item;
88
- }
89
- return { product_id: item.product_id, quantity: next_quantity };
90
- });
91
- }
92
- else {
93
- Cart.items = [...Cart.items, { product_id: product_id, quantity: quantity }];
94
- }
95
- persist();
96
- await ensure_session_id();
97
- }
98
- Cart.add = add;
99
- /**
100
- * Set an absolute quantity for an item.
101
- * If the item doesn't exist yet, it will be added.
102
- * @param product_id The product id or subscription plan id.
103
- * @param quantity The absolute quantity (>= 1).
104
- */
105
- async function set_quantity(product_id, quantity) {
106
- validate_quantity(quantity);
107
- const existing_index = Cart.items.findIndex((item) => item.product_id === product_id);
108
- // If missing, treat as add (common UX).
109
- if (existing_index < 0) {
110
- Cart.items = [...Cart.items, { product_id: product_id, quantity }];
111
- }
112
- else {
113
- Cart.items = Cart.items.map((item, index) => {
114
- if (index !== existing_index) {
115
- return item;
116
- }
117
- return { product_id: item.product_id, quantity };
118
- });
119
- }
120
- persist();
121
- await ensure_session_id();
122
- }
123
- Cart.set_quantity = set_quantity;
124
- /**
125
- * Remove an item entirely from the cart.
126
- * @param product_id The product id or subscription plan id.
127
- */
128
- function remove(product_id) {
129
- Cart.items = Cart.items.filter((item) => item.product_id !== product_id);
130
- persist();
131
- }
132
- Cart.remove = remove;
133
- /**
134
- * Clear the cart.
135
- */
136
- function clear() {
137
- Cart.items = [];
138
- persist();
139
- checkout_session_id = undefined;
140
- }
141
- Cart.clear = clear;
142
- /**
143
- * Start a Stripe hosted Checkout Session for the current cart and redirect the browser.
144
- *
145
- * This function is intentionally small and opinionated:
146
- * - validates the cart locally (fail fast)
147
- * - creates a backend session id first (idempotency)
148
- * - creates the Stripe Checkout Session on the backend
149
- * - redirects to the hosted URL
150
- *
151
- * @throws {Error} When validation fails or the backend returns an error.
152
- */
153
- async function checkout(opts) {
154
- // Validate + normalize URLs up-front so we never send dangerous redirects to the backend.
155
- const normalized_success_url = to_absolute_https_url(opts.success_url, "success_url");
156
- const normalized_cancel_url = to_absolute_https_url(opts.cancel_url, "cancel_url");
157
- // Fail fast on empty carts (avoid creating sessions we cannot complete).
158
- if (Cart.items.length === 0) {
159
- throw new Error("Checkout cart is empty. Please add an item to the cart first.");
160
- }
161
- else if (Cart.items.length > 50) {
162
- throw new Error("Checkout cart cannot have more than 50 items. Please reduce the number of items in the cart.");
163
- }
164
- // If no session id, throw error, should not happen.
165
- if (!checkout_session_id) {
166
- throw new Error("Checkout session id is missing. Please add an item to the cart first.");
167
- }
168
- // Create a checkout session on the backend (Stripe Tax + pricing logic is server-owned).
169
- const checkout_res = await create_checkout_session({
170
- session_id: checkout_session_id,
171
- line_items: Cart.items.map((item) => ({ product: item.product_id, quantity: item.quantity })),
172
- success_url: normalized_success_url,
173
- cancel_url: normalized_cancel_url,
174
- tax_id_collection_enabled: opts.tax_id_collection_enabled === true,
175
- });
176
- if ("error" in checkout_res && checkout_res.error) {
177
- throw new Error(checkout_res.error.message || "checkout_failed_to_create_session");
178
- }
179
- // Backend returns: { id, url, mode, currency }
180
- const checkout_url = checkout_res.data.url;
181
- if (!is_non_empty_string(checkout_url)) {
182
- throw new Error("Checkout session creation failed: invalid URL returned from backend.");
183
- }
184
- // Ensure the returned URL is a safe absolute https URL before redirecting.
185
- // Stripe-hosted URLs are https; if anything else, treat it as compromised/untrusted.
186
- assert_is_https_absolute_url(checkout_url, "checkout_url");
187
- // Optionally clear cart before redirect (default true).
188
- // This avoids “duplicate checkout” confusion if the user comes back.
189
- if (opts.clear_cart_on_redirect !== false) {
190
- Cart.clear();
191
- }
192
- // Step 3) Redirect to Stripe hosted Checkout.
193
- // Stripe docs: Redirect to Checkout: https://docs.stripe.com/payments/checkout/how-checkout-works
194
- window.location.assign(checkout_url);
195
- return {
196
- checkout_session_id,
197
- checkout_url,
198
- };
199
- }
200
- Cart.checkout = checkout;
201
- // ------------------------------------------------------------
202
- // Internal utilities.
203
- /**
204
- * Normalize and validate a quantity.
205
- * @param quantity The raw quantity.
206
- */
207
- function validate_quantity(quantity) {
208
- if (typeof quantity !== "number" || !Number.isInteger(quantity) || quantity < 1) {
209
- throw new Error("cart_invalid_quantity");
210
- }
211
- }
212
- /**
213
- * Load items from localStorage, validating shape strictly.
214
- */
215
- function load() {
216
- // localStorage access can throw in some environments; fail closed to empty cart.
217
- let raw = null;
218
- try {
219
- raw = localStorage.getItem(storage_key);
220
- }
221
- catch {
222
- return [];
223
- }
224
- if (Cart.PersistedCart.is(raw)) {
225
- return raw.items;
226
- }
227
- return [];
228
- }
229
- /**
230
- * Persist current items to localStorage using a versioned schema.
231
- */
232
- function persist() {
233
- const payload = {
234
- version: Cart.version,
235
- items: Cart.items.map((item) => ({ product_id: item.product_id, quantity: item.quantity })),
236
- };
237
- // Persistence must never crash the UI; ignore storage failures.
238
- try {
239
- localStorage.setItem(storage_key, JSON.stringify(payload));
240
- }
241
- catch {
242
- // Ignore (quota exceeded, blocked storage, etc.).
243
- }
244
- }
245
- /**
246
- * Ensure a checkout session id exists by creating one if needed.
247
- */
248
- async function ensure_session_id() {
249
- if (checkout_session_id) {
250
- return;
251
- }
252
- const res = await create_checkout_session_id(undefined);
253
- if ("error" in res && res.error) {
254
- throw new Error(`Failed to create a checkout session id: ${res.error.message}`);
255
- }
256
- checkout_session_id = res.data.session_id;
257
- }
258
- /**
259
- * Normalize a user-provided URL to an absolute https URL.
260
- *
261
- * Supports:
262
- * - absolute https URLs (kept as-is)
263
- * - relative paths (resolved against the current origin, forced to https if origin is https)
264
- *
265
- * @throws {Error} When the URL is invalid or not https.
266
- */
267
- function to_absolute_https_url(raw, field) {
268
- if (!is_non_empty_string(raw)) {
269
- throw new Error(`checkout_missing_${field}`);
270
- }
271
- // If it's already absolute, validate directly.
272
- const trimmed = raw.trim();
273
- if (looks_like_absolute_url(trimmed)) {
274
- assert_is_https_absolute_url(trimmed, field);
275
- return trimmed;
276
- }
277
- // Treat as a relative path and resolve against the current origin.
278
- // This avoids accidental open redirects and keeps the API simple for callers.
279
- const origin = window.location.origin;
280
- // If your app is served over https (production), this yields https URLs.
281
- // If served over http (local dev), this yields http URLs and will be rejected below
282
- // to match the backend's `https` enforcement for redirects.
283
- const resolved = new URL(trimmed, origin).toString();
284
- assert_is_https_absolute_url(resolved, field);
285
- return resolved;
286
- }
287
- /**
288
- * Assert that a string is a valid absolute https URL.
289
- *
290
- * @throws {Error} When invalid or not https.
291
- */
292
- function assert_is_https_absolute_url(raw, field) {
293
- // Use URL parser for correctness.
294
- let parsed;
295
- try {
296
- parsed = new URL(raw);
297
- }
298
- catch {
299
- throw new Error(`checkout_invalid_${field}`);
300
- }
301
- // Fail closed: only allow https redirects to reduce risk.
302
- if (parsed.protocol !== "https:") {
303
- throw new Error(`checkout_${field}_must_be_https`);
304
- }
305
- }
306
- /**
307
- * Check if a string looks like an absolute URL (scheme://...).
308
- */
309
- function looks_like_absolute_url(value) {
310
- // Minimal scheme check; final validation is done by `new URL(...)`.
311
- return value.includes("://");
312
- }
313
- /**
314
- * Check that a value is a non-empty string.
315
- */
316
- function is_non_empty_string(value) {
317
- return typeof value === "string" && value.trim().length > 0;
318
- }
319
- })(Cart || (Cart = {}));
320
- /** Snake case compatibility. */
321
- export { Cart as cart };
@@ -1,7 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
4
- *
5
- * The frontend payments module for stripe billing.
6
- */
7
- export {};
@@ -1,37 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
4
- *
5
- * The frontend payments module for stripe billing.
6
- */
7
- import { request } from "../request.js";
8
- /**
9
- * Start a checkout session, by generating a session id.
10
- * @nav Frontend/User
11
- * @return
12
- * Returns a promise with a successful update response or a request error on a failed request.
13
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
14
- * @docs
15
- */
16
- async function create_checkout_session_id(payload) {
17
- return request({
18
- method: "POST",
19
- url: "/volt/api/stripe/v1/checkout/session_id",
20
- data: payload,
21
- });
22
- }
23
- /**
24
- * Create a checkout session.
25
- * @nav Frontend/User
26
- * @return
27
- * Returns a promise with a successful update response or a request error on a failed request.
28
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
29
- * @docs
30
- */
31
- async function create_checkout_session(payload) {
32
- return request({
33
- method: "POST",
34
- url: "/volt/api/stripe/v1/checkout/session",
35
- data: payload,
36
- });
37
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved.
4
- */
5
- export * from "./payments.js";
6
- export * from "./cart.js";
@@ -1,6 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved.
4
- */
5
- export * from "./payments.js";
6
- export * from "./cart.js";
@@ -1,58 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
4
- *
5
- * The frontend payments module for stripe billing.
6
- */
7
- import { Stripe as StripeBackend } from "../../../../backend/src/payments/stripe/stripe";
8
- import { Request } from "../request.js";
9
- /**
10
- * Get the list of products.
11
- * @returns
12
- * A promise with a successful update response or a request error on a failed request.
13
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
14
- * @docs
15
- */
16
- export declare function get_products(): Request.ResultPromiseFromInfo<StripeBackend.Endpoints.GetProducts>;
17
- /**
18
- * List the signed in user's active subscriptions.
19
- * @returns
20
- * A promise with a successful update response or a request error on a failed request.
21
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
22
- * @docs
23
- */
24
- export declare function get_active_subscriptions(): Request.ResultPromiseFromInfo<StripeBackend.Endpoints.GetSubscriptions>;
25
- /**
26
- * List the signed in user's active meter subscriptions.
27
- * @returns
28
- * A promise with a successful update response or a request error on a failed request.
29
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
30
- * @docs
31
- */
32
- export declare function get_active_meters(): Request.ResultPromiseFromInfo<StripeBackend.Endpoints.GetMeterSubscriptions>;
33
- /**
34
- * Cancel a subscription of the signed in user.
35
- * @note A successfull operation will result in an empty `data` field,
36
- * any error will be returned in the `error` field.
37
- * @returns
38
- * A promise with a successful update response or a request error on a failed request.
39
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
40
- * @docs
41
- */
42
- export declare function cancel_subscription(payload: StripeBackend.Endpoints.CancelSubscription["payload"]): Request.ResultPromiseFromInfo<StripeBackend.Endpoints.CancelSubscription>;
43
- /**
44
- * Start a checkout session, by generating a session id.
45
- * @return
46
- * Returns a promise with a successful update response or a request error on a failed request.
47
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
48
- * @internal
49
- */
50
- export declare function create_checkout_session_id(payload: StripeBackend.Endpoints.CreateCheckoutSessionId["payload"]): Request.ResultPromiseFromInfo<StripeBackend.Endpoints.CreateCheckoutSessionId>;
51
- /**
52
- * Create a checkout session.
53
- * @return
54
- * Returns a promise with a successful update response or a request error on a failed request.
55
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
56
- * @internal
57
- */
58
- export declare function create_checkout_session(payload: StripeBackend.Endpoints.StartCheckoutSession["payload"]): Request.ResultPromiseFromInfo<StripeBackend.Endpoints.StartCheckoutSession>;
@@ -1,92 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
4
- *
5
- * The frontend payments module for stripe billing.
6
- */
7
- import { request } from "../request.js";
8
- /**
9
- * Get the list of products.
10
- * @returns
11
- * A promise with a successful update response or a request error on a failed request.
12
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
13
- * @docs
14
- */
15
- export async function get_products() {
16
- return request({
17
- method: "GET",
18
- url: "/volt/api/stripe/v1/products",
19
- });
20
- }
21
- /**
22
- * List the signed in user's active subscriptions.
23
- * @returns
24
- * A promise with a successful update response or a request error on a failed request.
25
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
26
- * @docs
27
- */
28
- export async function get_active_subscriptions() {
29
- return request({
30
- method: "GET",
31
- url: "/volt/api/stripe/v1/subscriptions",
32
- });
33
- }
34
- /**
35
- * List the signed in user's active meter subscriptions.
36
- * @returns
37
- * A promise with a successful update response or a request error on a failed request.
38
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
39
- * @docs
40
- */
41
- export async function get_active_meters() {
42
- return request({
43
- method: "GET",
44
- url: "/volt/api/stripe/v1/subscriptions/meters",
45
- });
46
- }
47
- /**
48
- * Cancel a subscription of the signed in user.
49
- * @note A successfull operation will result in an empty `data` field,
50
- * any error will be returned in the `error` field.
51
- * @returns
52
- * A promise with a successful update response or a request error on a failed request.
53
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
54
- * @docs
55
- */
56
- export async function cancel_subscription(payload) {
57
- return request({
58
- method: "DELETE",
59
- url: "/volt/api/stripe/v1/subscriptions",
60
- data: payload,
61
- });
62
- }
63
- // ------------------------------------------------------------
64
- // Semi-private functions.
65
- /**
66
- * Start a checkout session, by generating a session id.
67
- * @return
68
- * Returns a promise with a successful update response or a request error on a failed request.
69
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
70
- * @internal
71
- */
72
- export async function create_checkout_session_id(payload) {
73
- return request({
74
- method: "POST",
75
- url: "/volt/api/stripe/v1/checkout/session_id",
76
- data: payload,
77
- });
78
- }
79
- /**
80
- * Create a checkout session.
81
- * @return
82
- * Returns a promise with a successful update response or a request error on a failed request.
83
- * The response objects holds the `status` and `data` properties on a successful response, and an `error` property on a failed request.
84
- * @internal
85
- */
86
- export async function create_checkout_session(payload) {
87
- return request({
88
- method: "POST",
89
- url: "/volt/api/stripe/v1/checkout/session",
90
- data: payload,
91
- });
92
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
- */
5
- import type { Users as UsersBackend } from "../../../backend/src/users.js";
6
- import { Attachment } from "./attachment.js";
7
- import { Request } from "./request.js";
8
- export declare namespace Support {
9
- /**
10
- * Submit a support contact form. The server will send an email to your registered SMTP mail.
11
- *
12
- * All provided argument keys will be included in the support mail, even the undefined parameters.
13
- * Allows for a maximum of 5 attachments, each up to 5 MB in size.
14
- * @nav Frontend/Support
15
- * @returns Returns a promise with a successful submit response or a request error on a failed request.
16
- * @param payload The request payload, see {@link UsersBackend.Endpoints.SubmitSupport.Params}.
17
- * @docs
18
- */
19
- function submit(payload: Omit<UsersBackend.Endpoints.SubmitSupport["payload"], "attachments"> & {
20
- attachments?: Attachment[];
21
- }): Request.ResultPromiseFromInfo<UsersBackend.Endpoints.SubmitSupport>;
22
- /**
23
- * Get the support pin of an authenticated user.
24
- * @nav Frontend/Support
25
- * @returns Returns a promise that resolves with an object containing `pin` (the user's support pin) on success, or a request error on failure.
26
- * @docs
27
- */
28
- function get_pin(): Request.ResultPromiseFromInfo<UsersBackend.Endpoints.GetSupportPin>;
29
- }
30
- export { Support as support };
@@ -1,53 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
- */
5
- import { request } from "./request.js";
6
- // Support module.
7
- export var Support;
8
- (function (Support) {
9
- /**
10
- * Submit a support contact form. The server will send an email to your registered SMTP mail.
11
- *
12
- * All provided argument keys will be included in the support mail, even the undefined parameters.
13
- * Allows for a maximum of 5 attachments, each up to 5 MB in size.
14
- * @nav Frontend/Support
15
- * @returns Returns a promise with a successful submit response or a request error on a failed request.
16
- * @param payload The request payload, see {@link UsersBackend.Endpoints.SubmitSupport.Params}.
17
- * @docs
18
- */
19
- function submit(payload) {
20
- if (payload.attachments) {
21
- const total_attachments_size = payload.attachments.reduce((acc, it) => acc + it.size, 0);
22
- if (total_attachments_size > 5 * 1024 * 1024) { // 5 MB total
23
- throw new Error(`Total attachments size exceeds the maximum of 5 MB.`);
24
- }
25
- }
26
- return request({
27
- method: "POST",
28
- url: "/volt/api/v1/support/submit",
29
- data: {
30
- ...payload,
31
- attachments: payload.attachments?.map(a => a.to_rest_api({
32
- decompress: true,
33
- encoding: "base64",
34
- }))
35
- },
36
- });
37
- }
38
- Support.submit = submit;
39
- /**
40
- * Get the support pin of an authenticated user.
41
- * @nav Frontend/Support
42
- * @returns Returns a promise that resolves with an object containing `pin` (the user's support pin) on success, or a request error on failure.
43
- * @docs
44
- */
45
- function get_pin() {
46
- return request({
47
- method: "GET",
48
- url: "/volt/api/v1/support/pin",
49
- });
50
- }
51
- Support.get_pin = get_pin;
52
- })(Support || (Support = {}));
53
- export { Support as support }; // also export as lowercase for compatibility.