@vandenberghinc/volt 1.1.4 → 1.1.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 (290) hide show
  1. package/backend/dist/cjs/database.d.ts +41 -68
  2. package/backend/dist/cjs/database.js +136 -78
  3. package/backend/dist/cjs/endpoint.d.ts +23 -9
  4. package/backend/dist/cjs/endpoint.js +98 -21
  5. package/backend/dist/cjs/file_watcher.js +2 -2
  6. package/backend/dist/cjs/frontend.d.ts +0 -2
  7. package/backend/dist/cjs/frontend.js +9 -9
  8. package/backend/dist/cjs/image_endpoint.d.ts +3 -1
  9. package/backend/dist/cjs/image_endpoint.js +2 -1
  10. package/backend/dist/cjs/payments/paddle.js +10 -2
  11. package/backend/dist/cjs/plugins/css.d.ts +6 -5
  12. package/backend/dist/cjs/plugins/css.js +32 -7
  13. package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
  14. package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
  15. package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
  16. package/backend/dist/cjs/server.d.ts +7 -13
  17. package/backend/dist/cjs/server.js +184 -303
  18. package/backend/dist/cjs/status.d.ts +1 -0
  19. package/backend/dist/cjs/status.js +2 -1
  20. package/backend/dist/cjs/stream.d.ts +5 -3
  21. package/backend/dist/cjs/stream.js +13 -4
  22. package/backend/dist/cjs/users.d.ts +1 -1
  23. package/backend/dist/cjs/users.js +87 -72
  24. package/backend/dist/cjs/utils.d.ts +17 -9
  25. package/backend/dist/cjs/utils.js +22 -64
  26. package/backend/dist/cjs/view.d.ts +2 -2
  27. package/backend/dist/cjs/view.js +38 -40
  28. package/backend/dist/cjs/volt.d.ts +3 -2
  29. package/backend/dist/cjs/volt.js +2 -2
  30. package/backend/dist/css/volt.css +5 -0
  31. package/backend/dist/esm/database.d.ts +41 -68
  32. package/backend/dist/esm/database.js +137 -79
  33. package/backend/dist/esm/endpoint.d.ts +23 -9
  34. package/backend/dist/esm/endpoint.js +99 -22
  35. package/backend/dist/esm/file_watcher.js +2 -2
  36. package/backend/dist/esm/frontend.d.ts +0 -2
  37. package/backend/dist/esm/frontend.js +9 -9
  38. package/backend/dist/esm/image_endpoint.d.ts +3 -1
  39. package/backend/dist/esm/image_endpoint.js +2 -1
  40. package/backend/dist/esm/payments/paddle.js +11 -3
  41. package/backend/dist/esm/plugins/css.d.ts +6 -5
  42. package/backend/dist/esm/plugins/css.js +32 -6
  43. package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
  44. package/backend/dist/esm/plugins/ts/compiler.js +26 -2
  45. package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
  46. package/backend/dist/esm/server.d.ts +7 -13
  47. package/backend/dist/esm/server.js +182 -301
  48. package/backend/dist/esm/status.d.ts +1 -0
  49. package/backend/dist/esm/status.js +1 -0
  50. package/backend/dist/esm/stream.d.ts +5 -3
  51. package/backend/dist/esm/stream.js +13 -4
  52. package/backend/dist/esm/users.d.ts +1 -1
  53. package/backend/dist/esm/users.js +87 -72
  54. package/backend/dist/esm/utils.d.ts +17 -9
  55. package/backend/dist/esm/utils.js +21 -62
  56. package/backend/dist/esm/view.d.ts +2 -2
  57. package/backend/dist/esm/view.js +38 -40
  58. package/backend/dist/esm/volt.d.ts +3 -2
  59. package/backend/dist/esm/volt.js +2 -1
  60. package/backend/dist/esm-dev/blacklist.js +1 -1
  61. package/backend/dist/esm-dev/cli.js +2 -2
  62. package/backend/dist/esm-dev/database.d.ts +41 -68
  63. package/backend/dist/esm-dev/database.js +138 -80
  64. package/backend/dist/esm-dev/endpoint.d.ts +23 -9
  65. package/backend/dist/esm-dev/endpoint.js +100 -23
  66. package/backend/dist/esm-dev/file_watcher.js +3 -3
  67. package/backend/dist/esm-dev/frontend.d.ts +0 -2
  68. package/backend/dist/esm-dev/frontend.js +9 -9
  69. package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
  70. package/backend/dist/esm-dev/image_endpoint.js +2 -1
  71. package/backend/dist/esm-dev/logger.js +1 -1
  72. package/backend/dist/esm-dev/payments/paddle.js +12 -4
  73. package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
  74. package/backend/dist/esm-dev/plugins/css.js +33 -7
  75. package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
  76. package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
  77. package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
  78. package/backend/dist/esm-dev/rate_limit.js +1 -1
  79. package/backend/dist/esm-dev/server.d.ts +7 -13
  80. package/backend/dist/esm-dev/server.js +184 -303
  81. package/backend/dist/esm-dev/status.d.ts +1 -0
  82. package/backend/dist/esm-dev/status.js +1 -0
  83. package/backend/dist/esm-dev/stream.d.ts +5 -3
  84. package/backend/dist/esm-dev/stream.js +13 -4
  85. package/backend/dist/esm-dev/users.d.ts +1 -1
  86. package/backend/dist/esm-dev/users.js +88 -73
  87. package/backend/dist/esm-dev/utils.d.ts +17 -9
  88. package/backend/dist/esm-dev/utils.js +22 -63
  89. package/backend/dist/esm-dev/view.d.ts +2 -2
  90. package/backend/dist/esm-dev/view.js +39 -41
  91. package/backend/dist/esm-dev/volt.d.ts +3 -2
  92. package/backend/dist/esm-dev/volt.js +2 -1
  93. package/backend/src/database.ts +173 -155
  94. package/backend/src/endpoint.ts +123 -31
  95. package/backend/src/file_watcher.ts +2 -2
  96. package/backend/src/frontend.ts +9 -8
  97. package/backend/src/image_endpoint.ts +4 -0
  98. package/backend/src/payments/paddle.ts +11 -3
  99. package/backend/src/plugins/css.ts +36 -8
  100. package/backend/src/plugins/ts/compiler.ts +37 -1
  101. package/backend/src/plugins/ts/preprocessing.ts +5 -3
  102. package/backend/src/server.ts +167 -306
  103. package/backend/src/status.ts +1 -0
  104. package/backend/src/stream.ts +28 -8
  105. package/backend/src/users.ts +87 -72
  106. package/backend/src/utils.ts +58 -25
  107. package/backend/src/view.ts +30 -28
  108. package/backend/src/{volt.js → volt.ts} +2 -1
  109. package/backend/tsconfig.cjs.json +3 -3
  110. package/backend/tsconfig.esm.json +3 -3
  111. package/frontend/dist/elements/base.d.ts +414 -432
  112. package/frontend/dist/elements/base.js +566 -329
  113. package/frontend/dist/elements/module.d.ts +26 -12
  114. package/frontend/dist/elements/module.js +69 -32
  115. package/frontend/dist/elements/register_element.d.ts +3 -0
  116. package/frontend/dist/elements/register_element.js +22 -0
  117. package/frontend/dist/modules/auth.d.ts +1 -0
  118. package/frontend/dist/modules/auth.js +6 -5
  119. package/frontend/dist/modules/color.d.ts +159 -0
  120. package/frontend/dist/modules/color.js +315 -0
  121. package/frontend/dist/modules/colors.d.ts +1 -26
  122. package/frontend/dist/modules/colors.js +417 -340
  123. package/frontend/dist/modules/cookies.d.ts +1 -0
  124. package/frontend/dist/modules/cookies.js +1 -0
  125. package/frontend/dist/modules/events.d.ts +1 -0
  126. package/frontend/dist/modules/events.js +1 -0
  127. package/frontend/dist/modules/google.d.ts +1 -0
  128. package/frontend/dist/modules/google.js +1 -0
  129. package/frontend/dist/modules/meta.d.ts +1 -0
  130. package/frontend/dist/modules/meta.js +1 -0
  131. package/frontend/dist/modules/mutex.d.ts +1 -2
  132. package/frontend/dist/modules/mutex.js +3 -4
  133. package/frontend/dist/modules/paddle.d.ts +1 -0
  134. package/frontend/dist/modules/paddle.js +14 -13
  135. package/frontend/dist/modules/scheme.d.ts +1 -0
  136. package/frontend/dist/modules/scheme.js +5 -3
  137. package/frontend/dist/modules/statics.d.ts +1 -0
  138. package/frontend/dist/modules/statics.js +1 -0
  139. package/frontend/dist/modules/support.d.ts +1 -0
  140. package/frontend/dist/modules/support.js +3 -2
  141. package/frontend/dist/modules/theme.d.ts +56 -0
  142. package/frontend/dist/{ui → modules}/theme.js +186 -75
  143. package/frontend/dist/modules/themes.d.ts +1 -1
  144. package/frontend/dist/modules/themes.js +1 -0
  145. package/frontend/dist/modules/user.d.ts +1 -0
  146. package/frontend/dist/modules/user.js +11 -10
  147. package/frontend/dist/modules/utils.d.ts +23 -2
  148. package/frontend/dist/modules/utils.js +93 -1
  149. package/frontend/dist/types/gradient.js +4 -0
  150. package/frontend/dist/ui/border_button.d.ts +0 -25
  151. package/frontend/dist/ui/border_button.js +50 -51
  152. package/frontend/dist/ui/button.d.ts +0 -21
  153. package/frontend/dist/ui/button.js +41 -46
  154. package/frontend/dist/ui/canvas.js +15 -15
  155. package/frontend/dist/ui/checkbox.d.ts +3 -17
  156. package/frontend/dist/ui/checkbox.js +36 -30
  157. package/frontend/dist/ui/code.d.ts +15 -82
  158. package/frontend/dist/ui/code.js +150 -125
  159. package/frontend/dist/ui/color.d.ts +0 -1
  160. package/frontend/dist/ui/color.js +1 -1
  161. package/frontend/dist/ui/context_menu.d.ts +4 -2
  162. package/frontend/dist/ui/context_menu.js +16 -17
  163. package/frontend/dist/ui/css.js +2 -0
  164. package/frontend/dist/ui/divider.d.ts +0 -7
  165. package/frontend/dist/ui/divider.js +21 -25
  166. package/frontend/dist/ui/dropdown.d.ts +13 -7
  167. package/frontend/dist/ui/dropdown.js +65 -30
  168. package/frontend/dist/ui/for_each.d.ts +0 -5
  169. package/frontend/dist/ui/for_each.js +17 -22
  170. package/frontend/dist/ui/form.d.ts +17 -12
  171. package/frontend/dist/ui/form.js +21 -18
  172. package/frontend/dist/ui/frame_modes.d.ts +9 -12
  173. package/frontend/dist/ui/frame_modes.js +8 -10
  174. package/frontend/dist/ui/google_map.d.ts +0 -11
  175. package/frontend/dist/ui/google_map.js +23 -28
  176. package/frontend/dist/ui/gradient.d.ts +0 -5
  177. package/frontend/dist/ui/gradient.js +17 -22
  178. package/frontend/dist/ui/image.d.ts +27 -58
  179. package/frontend/dist/ui/image.js +99 -93
  180. package/frontend/dist/ui/input.d.ts +20 -97
  181. package/frontend/dist/ui/input.js +192 -170
  182. package/frontend/dist/ui/link.d.ts +0 -18
  183. package/frontend/dist/ui/link.js +42 -48
  184. package/frontend/dist/ui/list.js +36 -37
  185. package/frontend/dist/ui/loader_button.d.ts +4 -19
  186. package/frontend/dist/ui/loader_button.js +35 -37
  187. package/frontend/dist/ui/loaders.d.ts +0 -8
  188. package/frontend/dist/ui/loaders.js +20 -25
  189. package/frontend/dist/ui/popup.d.ts +11 -8
  190. package/frontend/dist/ui/popup.js +183 -24
  191. package/frontend/dist/ui/pseudo.d.ts +3 -3
  192. package/frontend/dist/ui/pseudo.js +14 -17
  193. package/frontend/dist/ui/scroller.d.ts +10 -48
  194. package/frontend/dist/ui/scroller.js +306 -300
  195. package/frontend/dist/ui/slider.d.ts +9 -3
  196. package/frontend/dist/ui/slider.js +31 -17
  197. package/frontend/dist/ui/spacer.d.ts +0 -9
  198. package/frontend/dist/ui/spacer.js +21 -26
  199. package/frontend/dist/ui/span.js +13 -15
  200. package/frontend/dist/ui/stack.d.ts +14 -75
  201. package/frontend/dist/ui/stack.js +166 -169
  202. package/frontend/dist/ui/steps.d.ts +10 -23
  203. package/frontend/dist/ui/steps.js +47 -34
  204. package/frontend/dist/ui/style.d.ts +4 -3
  205. package/frontend/dist/ui/style.js +13 -18
  206. package/frontend/dist/ui/switch.d.ts +10 -4
  207. package/frontend/dist/ui/switch.js +24 -16
  208. package/frontend/dist/ui/table.d.ts +0 -23
  209. package/frontend/dist/ui/table.js +113 -119
  210. package/frontend/dist/ui/tabs.d.ts +3 -19
  211. package/frontend/dist/ui/tabs.js +35 -29
  212. package/frontend/dist/ui/text.d.ts +0 -8
  213. package/frontend/dist/ui/text.js +20 -25
  214. package/frontend/dist/ui/title.d.ts +0 -15
  215. package/frontend/dist/ui/title.js +39 -45
  216. package/frontend/dist/ui/ui.d.ts +0 -2
  217. package/frontend/dist/ui/ui.js +0 -2
  218. package/frontend/dist/ui/view.d.ts +3 -17
  219. package/frontend/dist/ui/view.js +27 -32
  220. package/frontend/dist/volt.d.ts +2 -1
  221. package/frontend/dist/volt.js +3 -1
  222. package/frontend/examples/dashboard/dashboard.ts +774 -0
  223. package/frontend/examples/theme/theme.ts +58 -0
  224. package/frontend/src/css/volt.css +5 -0
  225. package/frontend/src/elements/base.ts +767 -545
  226. package/frontend/src/elements/module.ts +90 -29
  227. package/frontend/src/elements/register_element.ts +24 -0
  228. package/frontend/src/modules/auth.ts +7 -6
  229. package/frontend/src/modules/color.ts +348 -0
  230. package/frontend/src/modules/colors.ts +468 -449
  231. package/frontend/src/modules/cookies.ts +1 -0
  232. package/frontend/src/modules/events.ts +1 -0
  233. package/frontend/src/modules/google.ts +1 -0
  234. package/frontend/src/modules/meta.ts +2 -1
  235. package/frontend/src/modules/mutex.ts +2 -4
  236. package/frontend/src/modules/paddle.ts +21 -20
  237. package/frontend/src/modules/scheme.ts +5 -4
  238. package/frontend/src/modules/statics.ts +2 -1
  239. package/frontend/src/modules/support.ts +3 -2
  240. package/frontend/src/modules/theme.ts +413 -0
  241. package/frontend/src/modules/themes.ts +2 -1
  242. package/frontend/src/modules/user.ts +12 -11
  243. package/frontend/src/modules/utils.ts +125 -2
  244. package/frontend/src/ui/border_button.ts +41 -37
  245. package/frontend/src/ui/button.ts +33 -32
  246. package/frontend/src/ui/canvas.ts +5 -2
  247. package/frontend/src/ui/checkbox.ts +21 -22
  248. package/frontend/src/ui/code.ts +92 -86
  249. package/frontend/src/ui/context_menu.ts +7 -5
  250. package/frontend/src/ui/css.ts +1 -1
  251. package/frontend/src/ui/divider.ts +15 -10
  252. package/frontend/src/ui/dropdown.ts +38 -21
  253. package/frontend/src/ui/for_each.ts +9 -8
  254. package/frontend/src/ui/form.ts +26 -21
  255. package/frontend/src/ui/frame_modes.ts +13 -17
  256. package/frontend/src/ui/google_map.ts +15 -13
  257. package/frontend/src/ui/gradient.ts +9 -8
  258. package/frontend/src/ui/image.ts +108 -86
  259. package/frontend/src/ui/input.ts +145 -144
  260. package/frontend/src/ui/link.ts +25 -23
  261. package/frontend/src/ui/list.ts +12 -6
  262. package/frontend/src/ui/loader_button.ts +26 -25
  263. package/frontend/src/ui/loaders.ts +12 -11
  264. package/frontend/src/ui/popup.ts +168 -14
  265. package/frontend/src/ui/pseudo.ts +5 -3
  266. package/frontend/src/ui/scroller.ts +303 -294
  267. package/frontend/src/ui/slider.ts +15 -10
  268. package/frontend/src/ui/spacer.ts +14 -11
  269. package/frontend/src/ui/span.ts +6 -2
  270. package/frontend/src/ui/stack.ts +196 -183
  271. package/frontend/src/ui/steps.ts +38 -22
  272. package/frontend/src/ui/style.ts +7 -4
  273. package/frontend/src/ui/switch.ts +16 -11
  274. package/frontend/src/ui/table.ts +42 -34
  275. package/frontend/src/ui/tabs.ts +20 -19
  276. package/frontend/src/ui/text.ts +12 -11
  277. package/frontend/src/ui/title.ts +22 -20
  278. package/frontend/src/ui/ui.ts +0 -2
  279. package/frontend/src/ui/view.ts +20 -19
  280. package/frontend/src/volt.ts +3 -1
  281. package/frontend/{compile.js → tools/compile.old.js} +2 -2
  282. package/frontend/tools/embed_scripts.js +69 -0
  283. package/frontend/tsconfig.json +26 -0
  284. package/package.json +7 -6
  285. package/frontend/dist/ui/theme.d.ts +0 -25
  286. package/frontend/exports.json +0 -1340
  287. package/frontend/src/modules/date.js +0 -535
  288. package/frontend/src/ui/color.ts +0 -117
  289. package/frontend/src/ui/theme.ts +0 -279
  290. /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
@@ -180,3 +180,4 @@ Cookies._init();
180
180
 
181
181
  // Export.
182
182
  export { Cookies };
183
+ export { Cookies as cookies }; // also export as lowercase for compatibility.
@@ -94,3 +94,4 @@ window.onload = () => {
94
94
 
95
95
  // Export.
96
96
  export { Events };
97
+ export { Events as events }; // also export as lowercase for compatibility.
@@ -58,3 +58,4 @@ Google._initialize();
58
58
 
59
59
  // Exports.
60
60
  export { Google };
61
+ export { Google as google }; // also export as lowercase for compatibility.
@@ -56,4 +56,5 @@ export const Meta = {
56
56
  set_content_og("twitter:image", description);
57
57
  }
58
58
  },
59
- }
59
+ }
60
+ export { Meta as meta }; // also export as lowercase for compatibility.
@@ -9,7 +9,7 @@ import { Elements } from "../elements/module.js";
9
9
  // ---------------------------------------------------------
10
10
  // Mutex class.
11
11
 
12
- export class MutexType {
12
+ export class Mutex {
13
13
  locked: boolean;
14
14
  queue: Array<() => void>;
15
15
 
@@ -54,6 +54,4 @@ export class MutexType {
54
54
  this.locked = false;
55
55
  }
56
56
  }
57
- }
58
-
59
- export const Mutex = Elements.wrapper(MutexType);
57
+ }
@@ -20,7 +20,7 @@ import { Spacer } from "../ui/spacer"
20
20
  import { Link } from "../ui/link"
21
21
  import { CheckBox } from "../ui/checkbox"
22
22
  import { Form } from "../ui/form"
23
- import { Popup, PopupElement } from "../ui/popup"
23
+ import { YesNoPopupElement, YesNoPopup } from "../ui/popup"
24
24
 
25
25
  // Declare global variables or external libraries if necessary.
26
26
  // @todo import paddle here not using scripts
@@ -412,7 +412,7 @@ const Payments = {
412
412
  if (this._sign_in_redirect != null && !User.is_authenticated()) {
413
413
  Utils.redirect(this._sign_in_redirect);
414
414
  }
415
- const response = await Utils.request({
415
+ const response = await Utils.request_v1({
416
416
  method: "POST",
417
417
  url: "/volt/payments/init",
418
418
  data: {
@@ -1494,7 +1494,7 @@ const Payments = {
1494
1494
  .font_weight("bold")
1495
1495
  .on_click(() => {
1496
1496
  document.body.appendChild(
1497
- Popup({
1497
+ YesNoPopup({
1498
1498
  title: "Request Refund",
1499
1499
  text: `You are about to request a refund for payment <span style='border-radius: 7px; background: ${style.bg_1}; padding: 1px 4px; font-size: 0.9em;'>${payment.id}</span>, do you wish to proceed?`,
1500
1500
  no: "No",
@@ -1521,7 +1521,7 @@ const Payments = {
1521
1521
  .color(style.fg_1)
1522
1522
  .border_bottom("4px solid #E8454E")
1523
1523
  // .leading()
1524
- .parent<PopupElement>()
1524
+ .parent<YesNoPopupElement>()
1525
1525
  .title
1526
1526
  .color(style.fg)
1527
1527
  // .width("fit-content")
@@ -1533,13 +1533,13 @@ const Payments = {
1533
1533
  // .ellipsis_overflow(true)
1534
1534
  // .color(style.fg_1)
1535
1535
  .center()
1536
- .parent<PopupElement>()
1536
+ .parent<YesNoPopupElement>()
1537
1537
  .text
1538
1538
  .color(style.fg_1)
1539
1539
  .font_size(style.font_size)
1540
1540
  .margin_left(10)
1541
1541
  .center()
1542
- .parent<PopupElement>()
1542
+ .parent<YesNoPopupElement>()
1543
1543
  .image
1544
1544
  .padding(10)
1545
1545
  .mask_color(style.bg)
@@ -1547,7 +1547,7 @@ const Payments = {
1547
1547
  .background("#E8454E")
1548
1548
  .frame(40, 40)
1549
1549
  .box_shadow('0 0 0 4px #E8454E50')
1550
- .parent<PopupElement>()
1550
+ .parent<YesNoPopupElement>()
1551
1551
  .no_button
1552
1552
  .padding(10, 0)
1553
1553
  .font_size(style.font_size)
@@ -1556,7 +1556,7 @@ const Payments = {
1556
1556
  .border(1, style.divider_bg)
1557
1557
  .hover_brightness(...style.button.hover_brightness as [any, any])
1558
1558
  .box_shadow('0px 0px 5px #00000030')
1559
- .parent<PopupElement>()
1559
+ .parent<YesNoPopupElement>()
1560
1560
  .yes_button
1561
1561
  .padding(10, 0)
1562
1562
  .font_size(style.font_size)
@@ -1565,7 +1565,7 @@ const Payments = {
1565
1565
  .border(1, style.divider_bg)
1566
1566
  .hover_brightness(...style.button.hover_brightness as [any, any])
1567
1567
  .box_shadow('0px 0px 5px #00000030')
1568
- .parent<PopupElement>()
1568
+ .parent<YesNoPopupElement>()
1569
1569
  );
1570
1570
  }),
1571
1571
  !container.is_refunding ? null : RingLoader()
@@ -2518,7 +2518,7 @@ const Payments = {
2518
2518
  if (this._products !== undefined) {
2519
2519
  return resolve(this._products);
2520
2520
  }
2521
- Utils.request({
2521
+ Utils.request_v1({
2522
2522
  method: "GET",
2523
2523
  url: "/volt/payments/products",
2524
2524
  })
@@ -2587,7 +2587,7 @@ const Payments = {
2587
2587
  * @desc: The id of the payment.
2588
2588
  */
2589
2589
  get_payment: async function(id: string): Promise<any> {
2590
- return Utils.request({
2590
+ return Utils.request_v1({
2591
2591
  method: "GET",
2592
2592
  url: "/volt/payments/payment",
2593
2593
  data: {
@@ -2630,7 +2630,7 @@ const Payments = {
2630
2630
  limit = null,
2631
2631
  status = null,
2632
2632
  } = {}): Promise<any> {
2633
- return Utils.request({
2633
+ return Utils.request_v1({
2634
2634
  method: "GET",
2635
2635
  url: "/volt/payments/payments",
2636
2636
  data: {
@@ -2661,7 +2661,7 @@ const Payments = {
2661
2661
  days = 30,
2662
2662
  limit = null,
2663
2663
  } = {}): Promise<any> {
2664
- return Utils.request({
2664
+ return Utils.request_v1({
2665
2665
  method: "GET",
2666
2666
  url: "/volt/payments/payments/refundable",
2667
2667
  data: {
@@ -2691,7 +2691,7 @@ const Payments = {
2691
2691
  days = 30,
2692
2692
  limit = null,
2693
2693
  } = {}): Promise<any> {
2694
- return Utils.request({
2694
+ return Utils.request_v1({
2695
2695
  method: "GET",
2696
2696
  url: "/volt/payments/payments/refunded",
2697
2697
  data: {
@@ -2721,7 +2721,7 @@ const Payments = {
2721
2721
  days = null,
2722
2722
  limit = null,
2723
2723
  } = {}): Promise<any> {
2724
- return Utils.request({
2724
+ return Utils.request_v1({
2725
2725
  method: "GET",
2726
2726
  url: "/volt/payments/payments/refunding",
2727
2727
  data: {
@@ -2755,7 +2755,7 @@ const Payments = {
2755
2755
  * @desc: The refund reason.
2756
2756
  */
2757
2757
  create_refund: async function(payment: number | string, line_items: any[] | null = null, reason: string = "refund"): Promise<any> {
2758
- return Utils.request({
2758
+ return Utils.request_v1({
2759
2759
  method: "POST",
2760
2760
  url: "/volt/payments/refund",
2761
2761
  data: {
@@ -2781,7 +2781,7 @@ const Payments = {
2781
2781
  * @desc: The product id.
2782
2782
  */
2783
2783
  cancel_subscription: async function(product: string): Promise<any> {
2784
- return Utils.request({
2784
+ return Utils.request_v1({
2785
2785
  method: "DELETE",
2786
2786
  url: "/volt/payments/subscription",
2787
2787
  data: {
@@ -2804,7 +2804,7 @@ const Payments = {
2804
2804
  * @desc: The product id.
2805
2805
  */
2806
2806
  is_subscribed: async function(product: string): Promise<any> {
2807
- return Utils.request({
2807
+ return Utils.request_v1({
2808
2808
  method: "GET",
2809
2809
  url: "/volt/payments/subscribed",
2810
2810
  data: {
@@ -2822,7 +2822,7 @@ const Payments = {
2822
2822
  * @desc: Get the active subscriptions of the authenticated user.
2823
2823
  */
2824
2824
  get_active_subscriptions: async function(): Promise<any> {
2825
- return Utils.request({
2825
+ return Utils.request_v1({
2826
2826
  method: "GET",
2827
2827
  url: "/volt/payments/active_subscriptions",
2828
2828
  });
@@ -2987,4 +2987,5 @@ const Payments = {
2987
2987
  };
2988
2988
 
2989
2989
  // Exports.
2990
- export { Payments };
2990
+ export { Payments };
2991
+ export { Payments as payments }; // also export as lowercase for compatibility.
@@ -8,8 +8,6 @@
8
8
  * And beware that `vlib` will be replaced with `vweb`.
9
9
  */
10
10
 
11
- import { Colors } from "./colors.js"
12
-
13
11
  // Types for scheme validation
14
12
  type SchemeType = string | Function | (string | Function)[];
15
13
 
@@ -396,7 +394,7 @@ export const Scheme = {
396
394
  const is_required = scheme_item.required ?? true;
397
395
 
398
396
  // Skip when value is `null / undefined` and default is `null`.
399
- if (scheme_item.default === null && object[key] == null) {
397
+ if ((scheme_item.default == null || !is_required) && object[key] == null) {
400
398
  }
401
399
 
402
400
  // Multiple types supported.
@@ -496,7 +494,9 @@ export const Scheme = {
496
494
  if (last !== -1) {
497
495
  stack = stack.slice(last);
498
496
  }
499
- console.warn(`${Colors.end}[Scheme.verify] ${Colors.yellow}Warning${Colors.end}: Attribute "callback" is deprecated and replaced by attribute "verify" and will be removed in future versions.\n${stack.join('\n')}`);
497
+ const color_end = "\u001b[0m";
498
+ const color_yellow = "\u001b[33m";
499
+ console.warn(`${color_end}[Scheme.verify] ${color_yellow}Warning${color_end}: Attribute "callback" is deprecated and replaced by attribute "verify" and will be removed in future versions.\n${stack.join('\n')}`);
500
500
 
501
501
  // Still proceed as normal.
502
502
  const err = scheme_item.callback(object[key], object, key);
@@ -725,6 +725,7 @@ export const Scheme = {
725
725
  return err;
726
726
  }
727
727
  } as const;
728
+ export { Scheme as SchemeType }; // also export as lowercase for compatibility.
728
729
 
729
730
  // Add type for extended Error with json property
730
731
  declare global {
@@ -44,4 +44,5 @@ export const Statics = {
44
44
  }
45
45
  return this.aspect_ratios[endpoint];
46
46
  }
47
- }
47
+ }
48
+ export { Statics as statics }; // also export as lowercase for compatibility.
@@ -85,7 +85,7 @@ const Support = {
85
85
  detailed?: string;
86
86
  attachments?: { [fileName: string]: any };
87
87
  } = {}) {
88
- return Utils.request({
88
+ return Utils.request_v1({
89
89
  method: "POST",
90
90
  url: "/volt/support/submit",
91
91
  data: data,
@@ -107,7 +107,7 @@ const Support = {
107
107
  * @type: string
108
108
  */
109
109
  get_pin() {
110
- return Utils.request({
110
+ return Utils.request_v1({
111
111
  method: "GET",
112
112
  url: "/volt/support/pin",
113
113
  });
@@ -116,3 +116,4 @@ const Support = {
116
116
 
117
117
  // Export.
118
118
  export { Support };
119
+ export { Support as support }; // also export as lowercase for compatibility.