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