@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,215 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
4
- */
5
- import StripeClient from "stripe";
6
- import { InitializedMeterProduct, InitializedOneTimeProduct, InitializedProduct, InitializedSubscriptionPlan, InitializedSubscriptionProduct, MeterProduct, Product, ProductId, SubscriptionPlan, SubscriptionPlanId } from "./products.js";
7
- import { SemiActiveSubscriptionStatus } from "./subscriptions.js";
8
- import { Server } from "../../server.js";
9
- import { CancelMeterUsageEventOpts, CancelMeterUsageEventResult, RecordMeterUsageOpts, RecordMeterUsageResult } from "./meters.js";
10
- import { Request } from "../../../../frontend/src/modules/request.js";
11
- import { CreatedCheckoutSession } from "./checkout.js";
12
- /**
13
- * The stripe payments class.
14
- */
15
- export declare class Stripe {
16
- /** The payments type. */
17
- type: "stripe";
18
- /** The initialized stripe client. */
19
- client: StripeClient;
20
- /** The uninitialized products. */
21
- raw_products: Product[];
22
- /** The initialized stripe products. */
23
- products: InitializedProduct[];
24
- /** The parent server instance. */
25
- server: Server;
26
- /** The webhook signing secret. */
27
- webhook_signing_secret?: string;
28
- /** Constructs the Stripe payments instance. */
29
- constructor(server: Server, opts: Stripe.Opts);
30
- /**
31
- * Initialize all endpoints.
32
- * @note Should not be called when initialized as a worker.
33
- */
34
- private initialize_endpoints;
35
- /**
36
- * Initialize the stripe class.
37
- */
38
- initialize(opts: {
39
- /**
40
- * By default the server is initialized as web server.
41
- *
42
- * However, when using worker threads, the web server parts are skipped.
43
- * Only essential operations such as database, users, payments etc. are initialized.
44
- * Therefore the server can still be used within a worker threads without
45
- * the overhead of creating http/https servers, endpoints, static files, etc.
46
- *
47
- * The user-defined initialize callbacks are still executed but the `worker` is passed as indication.
48
- */
49
- worker?: boolean;
50
- }): Promise<void>;
51
- /**
52
- * A callback to delete a user from the payments provider when the user is deleted from our system.
53
- */
54
- delete_user(uid: string): Promise<void>;
55
- /**
56
- * Get the stripe customer id for a given user id (uid), if a customer does
57
- * not exist, it is automatically created and the new customer id is returned.
58
- * @returns The stripe customer id.
59
- */
60
- ensure_stripe_customer(uid: string): Promise<string>;
61
- /**
62
- * Fetch an initialized product by its id.
63
- * @throws {InternalStripeError} When the product is not found.
64
- */
65
- get_product(product_id: ProductId): InitializedProduct;
66
- /**
67
- * Fetch an initialized subscription or subscription plan by its id.
68
- * @throws {InternalStripeError} When the product is not found.
69
- */
70
- get_subscription_or_plan(product_or_plan_id: ProductId | SubscriptionPlanId): InitializedSubscriptionProduct | InitializedSubscriptionPlan;
71
- /**
72
- * Get a one-time product by its id.
73
- * @throws {InternalStripeError} When the product is not found or is not a one-time product.
74
- */
75
- get_one_time_product(product_id: ProductId): InitializedOneTimeProduct;
76
- /**
77
- * Get a subscription product by its id.
78
- * @throws {InternalStripeError} When the product is not found or is not a subscription product.
79
- */
80
- get_subscription_product(product_id: ProductId): InitializedSubscriptionProduct;
81
- /**
82
- * Get a subscription plan by its id.
83
- * @throws {InternalStripeError} When the plan is not found.
84
- */
85
- get_subscription_plan(plan_id: SubscriptionPlanId): InitializedSubscriptionPlan;
86
- /**
87
- * Resolve a subscription plan to its parent subscription product.
88
- * @throws {InternalStripeError} When the plan or parent subscription is not found.
89
- */
90
- get_subscription_product_by_plan(plan: SubscriptionPlanId | SubscriptionPlan): InitializedSubscriptionProduct;
91
- /**
92
- * Get a meter product by its id.
93
- * @throws {InternalStripeError} When the product is not found or is not a meter product.
94
- */
95
- get_meter_product(product_id: ProductId): InitializedMeterProduct;
96
- /**
97
- * Check if a user is subscribed to a subscription (plan).
98
- * @returns `true` if the user has an active subscription to the plan or subscription product, `false` otherwise.
99
- */
100
- is_subscribed(opts: {
101
- /** The user id */
102
- uid: string;
103
- /** The subcription (plan) or its id to check. */
104
- plan: InitializedSubscriptionPlan | SubscriptionPlanId | InitializedMeterProduct | ProductId;
105
- /** Only allow specific subscription statuses. */
106
- status?: SemiActiveSubscriptionStatus[];
107
- }): Promise<boolean>;
108
- /**
109
- * Fetch all active subscription plan id's for a user.
110
- * @note
111
- * Note that `trialing` and `past_due` subscriptions statuses are considered active,
112
- * since Stripe can still attempt to pay those subscriptions and move them to `active` status.
113
- * @returns An array of active subscription plan id's the user is subscribed to.
114
- */
115
- get_active_subscriptions<Status extends SemiActiveSubscriptionStatus = "active" | "trialing" | "past_due">(opts: {
116
- /** The user id */
117
- uid: string;
118
- /** The optional subscription status to filter. */
119
- status?: Status[];
120
- }): Promise<Record<SubscriptionPlanId, Status>>;
121
- /**
122
- * Fetch all active meter subscription id's for a user.
123
- * @note
124
- * Note that only subscriptions with status `active` are considered active here,
125
- * not `trialing` and `past_due`.
126
- * This is to reduce risk of abusing meter products since they can be used in a pay-as-you-go manner without upfront commitment.
127
- *
128
- * @returns An array of active subscription plan id's the user is subscribed to.
129
- */
130
- get_active_meters<Status extends SemiActiveSubscriptionStatus = "active">(opts: {
131
- /** The user id */
132
- uid: string;
133
- /** The optional subscription status to filter. */
134
- status?: Status[];
135
- }): Promise<Record<ProductId, Status>>;
136
- /**
137
- * Cancel a user's subscription to a plan.
138
- * @warning This will cancel all of the user's subscriptions containing the plan's price id, use with caution.
139
- * @warning This will cancel the entire subscription containing the plan, even if the subscription contains multiple plans.
140
- * However, during checkout its not allowed to checkout multiple subscription plans, therefore this should not be an issue.
141
- */
142
- cancel_subscription(opts: {
143
- /** The user id (uid) to cancel the subscription for. */
144
- uid: string;
145
- /** The specific plan to cancel (cancels subscriptions containing this plan price id). */
146
- plan: InitializedSubscriptionPlan;
147
- /** Whether to cancel at period end (default true). */
148
- cancel_at_period_end?: boolean;
149
- }): Promise<void>;
150
- /**
151
- * Record usage for a meter product.
152
- */
153
- record_meter_usage<Kind extends MeterProduct.Kind>(opts: RecordMeterUsageOpts<Kind>): Promise<RecordMeterUsageResult>;
154
- /**
155
- * Cancel a previously recorded meter usage event by its identifier (best-effort within 24 hours).
156
- */
157
- cancel_meter_usage_event(opts: CancelMeterUsageEventOpts): Promise<CancelMeterUsageEventResult>;
158
- }
159
- /** Nested types for the {@link Stripe} class. */
160
- export declare namespace Stripe {
161
- /** The user facing options for initializing the Stripe class. */
162
- interface Opts {
163
- /** The stripe API key. */
164
- api_key: string;
165
- /** The stripe products. */
166
- products: Product[];
167
- }
168
- /** The types for the frontend endpoints. */
169
- namespace Endpoints {
170
- /** Get all (non-initialized) products. */
171
- type GetProducts = Request.Info<"GET", "/volt/api/stripe/v1/products", undefined, {
172
- products: Product[];
173
- }, undefined>;
174
- /** Get subscriptions of a user. */
175
- type GetSubscriptions = Request.Info<"GET", "/volt/api/stripe/v1/subscriptions", undefined, {
176
- subscriptions: {
177
- product: InitializedSubscriptionProduct;
178
- plan: InitializedSubscriptionPlan;
179
- }[];
180
- }, undefined>;
181
- /** Get meter subscriptions of a user. */
182
- type GetMeterSubscriptions = Request.Info<"GET", "/volt/api/stripe/v1/subscriptions/meters", undefined, {
183
- meters: InitializedMeterProduct[];
184
- }, undefined>;
185
- /** Cancel a user subscription. */
186
- type CancelSubscription = Request.Info<"DELETE", "/volt/api/stripe/v1/subscriptions", {
187
- /** The subscription plan id to cancel. */
188
- plan: SubscriptionPlanId;
189
- /** Whether to cancel at period end (default true), or immediately. */
190
- cancel_at_period_end?: boolean;
191
- }, {}, undefined>;
192
- /** Create checkout session id. */
193
- type CreateCheckoutSessionId = Request.Info<"POST", "/volt/api/stripe/v1/checkout/session_id", undefined, {
194
- session_id: string;
195
- }, undefined>;
196
- /** Start checkout session./ */
197
- type StartCheckoutSession = Request.Info<"POST", "/volt/api/stripe/v1/checkout/session", {
198
- /** The checkout session id generated by `create_checkout_session_id`. */
199
- session_id: string;
200
- /** The product or subscription plan id to checkout. */
201
- line_items: {
202
- /** The product or subscription plan to checkout. */
203
- product: ProductId | SubscriptionPlanId;
204
- /** The quantity to checkout (default 1). */
205
- quantity: number;
206
- }[];
207
- /** Where Stripe should redirect after successful payment. */
208
- success_url: string;
209
- /** Where Stripe should redirect when the customer cancels. */
210
- cancel_url: string;
211
- /** Require tax id collection (useful for B2B in EU). */
212
- tax_id_collection_enabled: boolean;
213
- }, CreatedCheckoutSession, undefined>;
214
- }
215
- }
@@ -1,468 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var stdin_exports = {};
29
- __export(stdin_exports, {
30
- Stripe: () => Stripe
31
- });
32
- module.exports = __toCommonJS(stdin_exports);
33
- var import_stripe = __toESM(require("stripe"));
34
- var import_customers = require("./customers.js");
35
- var import_products = require("./products.js");
36
- var import_utils = require("./utils.js");
37
- var import_subscriptions = require("./subscriptions.js");
38
- var import_webhooks = require("./webhooks.js");
39
- var import_meters = require("./meters.js");
40
- var import_checkout = require("./checkout.js");
41
- var import_endpoint = require("../../endpoint.js");
42
- class Stripe {
43
- /** The payments type. */
44
- type = "stripe";
45
- /** The initialized stripe client. */
46
- client;
47
- /** The uninitialized products. */
48
- raw_products;
49
- /** The initialized stripe products. */
50
- products = [];
51
- /** The parent server instance. */
52
- server;
53
- /** The webhook signing secret. */
54
- webhook_signing_secret;
55
- /** Constructs the Stripe payments instance. */
56
- constructor(server, opts) {
57
- this.raw_products = opts.products;
58
- this.server = server;
59
- this.client = new import_stripe.default(opts.api_key, {
60
- typescript: true,
61
- maxNetworkRetries: 5
62
- });
63
- }
64
- // -------------------------------------------------------------------------
65
- // Private methods.
66
- /**
67
- * Initialize all endpoints.
68
- * @note Should not be called when initialized as a worker.
69
- */
70
- async initialize_endpoints() {
71
- this.server.endpoint({
72
- method: "POST",
73
- endpoint: "/volt/api/stripe/webhook",
74
- allow_unknown_params: true,
75
- callback: async (stream) => {
76
- await stream.join();
77
- if (!this.webhook_signing_secret) {
78
- stream.error({
79
- status: 500,
80
- type: "stripe_webhook_not_initialized",
81
- message: "Stripe webhook signing secret is not initialized."
82
- });
83
- return;
84
- }
85
- const stripe_signature_header = stream.headers["stripe-signature"];
86
- if (typeof stripe_signature_header !== "string" || stripe_signature_header.length === 0) {
87
- stream.error({
88
- status: 400,
89
- type: "invalid_argument",
90
- message: "Missing Stripe-Signature header."
91
- });
92
- return;
93
- }
94
- await (0, import_webhooks.handle_stripe_webhook)(this.client, {
95
- server: this.server,
96
- stream,
97
- webhook_signing_secret: this.webhook_signing_secret,
98
- // use wire body instead of raw body since we need the wired body for signature verification.
99
- raw_body: stream.wire_body,
100
- stripe_signature_header,
101
- all_products: this.products
102
- });
103
- }
104
- });
105
- this.server.endpoint({
106
- method: import_endpoint.Endpoint.method("GET"),
107
- endpoint: import_endpoint.Endpoint.endpoint("/volt/api/stripe/v1/products"),
108
- authenticated: false,
109
- callback: async (stream) => {
110
- return stream.send({
111
- status: 200,
112
- data: {
113
- products: this.raw_products
114
- }
115
- });
116
- }
117
- });
118
- this.server.endpoint({
119
- method: import_endpoint.Endpoint.method("GET"),
120
- endpoint: import_endpoint.Endpoint.endpoint("/volt/api/stripe/v1/subscriptions"),
121
- authenticated: true,
122
- callback: async (stream) => {
123
- const subs = await this.get_active_subscriptions({
124
- uid: stream.uid
125
- });
126
- const active_subs = [];
127
- for (const plan_id of Object.keys(subs)) {
128
- const plan = this.get_subscription_plan(plan_id);
129
- const product = this.get_subscription_product_by_plan(plan);
130
- active_subs.push({ product, plan });
131
- }
132
- ;
133
- return stream.send({
134
- status: 200,
135
- data: {
136
- subscriptions: active_subs
137
- }
138
- });
139
- }
140
- });
141
- this.server.endpoint({
142
- method: import_endpoint.Endpoint.method("GET"),
143
- endpoint: import_endpoint.Endpoint.endpoint("/volt/api/stripe/v1/subscriptions/meters"),
144
- authenticated: true,
145
- callback: async (stream) => {
146
- const active = await this.get_active_meters({
147
- uid: stream.uid
148
- });
149
- const meters = [];
150
- for (const product_id of Object.keys(active)) {
151
- meters.push(this.get_meter_product(product_id));
152
- }
153
- return stream.send({
154
- status: 200,
155
- data: {
156
- meters
157
- }
158
- });
159
- }
160
- });
161
- this.server.endpoint({
162
- method: import_endpoint.Endpoint.method("DELETE"),
163
- endpoint: import_endpoint.Endpoint.endpoint("/volt/api/stripe/v1/subscriptions"),
164
- params: {
165
- plan: "string",
166
- cancel_at_period_end: { type: "boolean", default: true }
167
- },
168
- authenticated: true,
169
- callback: async (stream, params) => {
170
- const res = await this.cancel_subscription({
171
- uid: stream.uid,
172
- plan: this.get_subscription_plan(params.plan),
173
- cancel_at_period_end: params.cancel_at_period_end
174
- });
175
- return stream.send({
176
- status: 200,
177
- data: {}
178
- });
179
- }
180
- });
181
- this.server.endpoint({
182
- method: import_endpoint.Endpoint.method("POST"),
183
- endpoint: import_endpoint.Endpoint.endpoint("/volt/api/stripe/v1/checkout/session_id"),
184
- authenticated: false,
185
- callback: async (stream) => {
186
- return stream.send({
187
- status: 200,
188
- data: {
189
- session_id: (0, import_checkout.create_checkout_session_id)(stream.uid)
190
- }
191
- });
192
- }
193
- });
194
- this.server.endpoint({
195
- method: import_endpoint.Endpoint.method("POST"),
196
- endpoint: import_endpoint.Endpoint.endpoint("/volt/api/stripe/v1/checkout/session"),
197
- params: {
198
- session_id: "string",
199
- line_items: {
200
- type: "array",
201
- min: 1,
202
- max: 50,
203
- value_schema: {
204
- type: "object",
205
- schema: {
206
- product: "string",
207
- quantity: {
208
- type: "number",
209
- min: 1
210
- }
211
- }
212
- }
213
- },
214
- success_url: "string",
215
- cancel_url: "string",
216
- tax_id_collection_enabled: "boolean"
217
- },
218
- authenticated: false,
219
- callback: async (stream, params) => {
220
- const res = await (0, import_checkout.start_checkout_session)(this.client, this.server, {
221
- uid: stream.uid,
222
- session_id: params.session_id,
223
- line_items: params.line_items,
224
- success_url: params.success_url,
225
- cancel_url: params.cancel_url,
226
- tax_id_collection_enabled: params.tax_id_collection_enabled,
227
- all_products: this.products,
228
- allowed_hosts: void 0
229
- });
230
- return stream.send({
231
- status: 200,
232
- data: res
233
- });
234
- }
235
- });
236
- }
237
- // -------------------------------------------------------------------------
238
- // Initialization.
239
- /**
240
- * Initialize the stripe class.
241
- */
242
- async initialize(opts) {
243
- this.products = await (0, import_products.initialize_products)(this.client, this.server, this.raw_products);
244
- if (!opts.worker) {
245
- if (this.server.https_enabled) {
246
- const res = await (0, import_webhooks.register_or_update_stripe_webhook_endpoint)(this.client, this.server, {
247
- /**
248
- * @warning
249
- * Never change the webhook_id since this could break updating the webhook endpoint
250
- * if the url / description etc changes.
251
- */
252
- webhook_app_id: "Volt.Stripe.Webhook",
253
- webhook_url: `${this.server.full_domain}/volt/api/stripe/webhook`,
254
- description: "The internal volt stripe payments webhook endpoint.",
255
- ensure_enabled: true
256
- });
257
- this.webhook_signing_secret = res.webhook_signing_secret;
258
- }
259
- await this.initialize_endpoints();
260
- }
261
- }
262
- // -------------------------------------------------------------------------
263
- // Users API.
264
- /**
265
- * A callback to delete a user from the payments provider when the user is deleted from our system.
266
- */
267
- async delete_user(uid) {
268
- await (0, import_customers.delete_stripe_customer)(this.client, this.server, uid);
269
- (0, import_subscriptions.delete_subscription_caches)(uid);
270
- }
271
- /**
272
- * Get the stripe customer id for a given user id (uid), if a customer does
273
- * not exist, it is automatically created and the new customer id is returned.
274
- * @returns The stripe customer id.
275
- */
276
- async ensure_stripe_customer(uid) {
277
- return await (0, import_customers.ensure_stripe_customer)(this.client, this.server, uid);
278
- }
279
- // -------------------------------------------------------------------------
280
- // Products API.
281
- /**
282
- * Fetch an initialized product by its id.
283
- * @throws {InternalStripeError} When the product is not found.
284
- */
285
- get_product(product_id) {
286
- const product = this.products.find((p) => p.id === product_id);
287
- (0, import_utils.assert)(product, "invalid_product", `Product with id '${product_id}' not found.`, { product_id });
288
- return product;
289
- }
290
- /**
291
- * Fetch an initialized subscription or subscription plan by its id.
292
- * @throws {InternalStripeError} When the product is not found.
293
- */
294
- get_subscription_or_plan(product_or_plan_id) {
295
- for (const product of this.products) {
296
- if (product.type !== "subscription") {
297
- continue;
298
- }
299
- if (product.id === product_or_plan_id) {
300
- return product;
301
- }
302
- if (product.type === "subscription") {
303
- const plan = product.plans.find((p) => p.id === product_or_plan_id);
304
- if (plan) {
305
- return product;
306
- }
307
- }
308
- }
309
- (0, import_utils.assert)(false, "invalid_product", `Product or subscription plan with id '${product_or_plan_id}' not found.`, { product_id: product_or_plan_id });
310
- }
311
- /**
312
- * Get a one-time product by its id.
313
- * @throws {InternalStripeError} When the product is not found or is not a one-time product.
314
- */
315
- get_one_time_product(product_id) {
316
- const product = this.get_product(product_id);
317
- (0, import_utils.assert)(product.type === "one_time", "invalid_product", `Product with id '${product_id}' is not a one-time product.`, { product_id, product_type: product.type });
318
- return product;
319
- }
320
- /**
321
- * Get a subscription product by its id.
322
- * @throws {InternalStripeError} When the product is not found or is not a subscription product.
323
- */
324
- get_subscription_product(product_id) {
325
- const product = this.get_product(product_id);
326
- (0, import_utils.assert)(product.type === "subscription", "invalid_product", `Product with id '${product_id}' is not a subscription product.`, { product_id, product_type: product.type });
327
- return product;
328
- }
329
- /**
330
- * Get a subscription plan by its id.
331
- * @throws {InternalStripeError} When the plan is not found.
332
- */
333
- get_subscription_plan(plan_id) {
334
- for (const product of this.products) {
335
- if (product.type !== "subscription") {
336
- continue;
337
- }
338
- const plan = product.plans.find((p) => p.id === plan_id);
339
- if (plan) {
340
- return plan;
341
- }
342
- }
343
- (0, import_utils.assert)(false, "invalid_product", `Subscription plan with id '${plan_id}' not found.`, { plan_id });
344
- }
345
- /**
346
- * Resolve a subscription plan to its parent subscription product.
347
- * @throws {InternalStripeError} When the plan or parent subscription is not found.
348
- */
349
- get_subscription_product_by_plan(plan) {
350
- const plan_id = typeof plan === "string" ? plan : plan.id;
351
- for (const product of this.products) {
352
- if (product.type !== "subscription") {
353
- continue;
354
- }
355
- const found_plan = product.plans.find((p) => p.id === plan_id);
356
- if (found_plan) {
357
- return product;
358
- }
359
- }
360
- (0, import_utils.assert)(false, "invalid_product", `Subscription plan with id '${plan_id}' not found.`, { plan_id });
361
- }
362
- /**
363
- * Get a meter product by its id.
364
- * @throws {InternalStripeError} When the product is not found or is not a meter product.
365
- */
366
- get_meter_product(product_id) {
367
- const product = this.get_product(product_id);
368
- (0, import_utils.assert)(product.type === "meter", "invalid_product", `Product with id '${product_id}' is not a meter product.`, { product_id, product_type: product.type });
369
- return product;
370
- }
371
- // -------------------------------------------------------------------------
372
- // Subscriptions API.
373
- /**
374
- * Check if a user is subscribed to a subscription (plan).
375
- * @returns `true` if the user has an active subscription to the plan or subscription product, `false` otherwise.
376
- */
377
- async is_subscribed(opts) {
378
- let plan;
379
- if (typeof opts.plan === "string") {
380
- for (const product of this.products) {
381
- if (product.type === "subscription") {
382
- const found_plan = product.plans.find((p) => p.id === opts.plan);
383
- if (found_plan) {
384
- plan = found_plan;
385
- break;
386
- }
387
- } else if (product.type === "meter" && product.id === opts.plan) {
388
- plan = product;
389
- break;
390
- }
391
- }
392
- } else {
393
- plan = opts.plan;
394
- }
395
- (0, import_utils.assert)(plan, "invalid_argument", `Subscription plan or meter with id '${typeof opts.plan === "string" ? opts.plan : opts.plan.id}' not found.`, { plan_id: typeof opts.plan === "string" ? opts.plan : opts.plan.id });
396
- return await (0, import_subscriptions.is_user_subscribed_to)(this.client, this.server, {
397
- uid: opts.uid,
398
- plan,
399
- customer_id: void 0,
400
- all_products: this.products,
401
- status: opts.status
402
- });
403
- }
404
- /**
405
- * Fetch all active subscription plan id's for a user.
406
- * @note
407
- * Note that `trialing` and `past_due` subscriptions statuses are considered active,
408
- * since Stripe can still attempt to pay those subscriptions and move them to `active` status.
409
- * @returns An array of active subscription plan id's the user is subscribed to.
410
- */
411
- async get_active_subscriptions(opts) {
412
- return await (0, import_subscriptions.list_subscribed_plans)(this.client, this.server, {
413
- uid: opts.uid,
414
- customer_id: void 0,
415
- all_products: this.products,
416
- status: opts.status
417
- });
418
- }
419
- /**
420
- * Fetch all active meter subscription id's for a user.
421
- * @note
422
- * Note that only subscriptions with status `active` are considered active here,
423
- * not `trialing` and `past_due`.
424
- * This is to reduce risk of abusing meter products since they can be used in a pay-as-you-go manner without upfront commitment.
425
- *
426
- * @returns An array of active subscription plan id's the user is subscribed to.
427
- */
428
- async get_active_meters(opts) {
429
- return await (0, import_subscriptions.list_subscribed_meters)(this.client, this.server, {
430
- uid: opts.uid,
431
- stripe_customer_id: void 0,
432
- all_products: this.products,
433
- status: opts.status
434
- });
435
- }
436
- /**
437
- * Cancel a user's subscription to a plan.
438
- * @warning This will cancel all of the user's subscriptions containing the plan's price id, use with caution.
439
- * @warning This will cancel the entire subscription containing the plan, even if the subscription contains multiple plans.
440
- * However, during checkout its not allowed to checkout multiple subscription plans, therefore this should not be an issue.
441
- */
442
- async cancel_subscription(opts) {
443
- await (0, import_subscriptions.cancel_user_subscription)(this.client, this.server, {
444
- uid: opts.uid,
445
- plan: opts.plan,
446
- customer_id: void 0,
447
- cancel_at_period_end: opts.cancel_at_period_end
448
- });
449
- }
450
- // -------------------------------------------------------------------------
451
- // Meters API.
452
- /**
453
- * Record usage for a meter product.
454
- */
455
- async record_meter_usage(opts) {
456
- return await (0, import_meters.record_meter_usage)(this.client, this.server, this.products, opts);
457
- }
458
- /**
459
- * Cancel a previously recorded meter usage event by its identifier (best-effort within 24 hours).
460
- */
461
- async cancel_meter_usage_event(opts) {
462
- return await (0, import_meters.cancel_meter_usage_event)(this.client, this.server, this.products, opts);
463
- }
464
- }
465
- // Annotate the CommonJS export names for ESM import in node:
466
- 0 && (module.exports = {
467
- Stripe
468
- });