@vandenberghinc/volt 1.2.6 → 1.2.8
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/.libris/config.json +82 -0
- package/backend/dist/cjs/backend/src/blacklist.d.ts +12 -0
- package/backend/dist/cjs/backend/src/blacklist.js +78 -0
- package/backend/dist/cjs/backend/src/cli.d.ts +2 -0
- package/backend/dist/cjs/backend/src/cli.js +198 -0
- package/backend/dist/cjs/backend/src/database/collection.d.ts +1765 -0
- package/backend/dist/cjs/backend/src/database/collection.js +3301 -0
- package/backend/dist/cjs/backend/src/database/database.d.ts +92 -0
- package/backend/dist/cjs/backend/src/database/database.js +170 -0
- package/backend/dist/cjs/backend/src/database/document.d.ts +1 -0
- package/backend/dist/cjs/backend/src/database/document.js +15 -0
- 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.d.ts +1 -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.d.ts +1 -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 +78 -0
- package/backend/dist/cjs/backend/src/database/flatten.js +53 -0
- package/backend/dist/cjs/backend/src/database/flatten_test.d.ts +1 -0
- package/backend/dist/cjs/backend/src/database/flatten_test.js +175 -0
- package/backend/dist/cjs/backend/src/database/quota/quoata_v2.d.ts +533 -0
- package/backend/dist/cjs/backend/src/database/quota/quoata_v2.js +1046 -0
- package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +551 -0
- package/backend/dist/cjs/backend/src/database/quota/quota.js +1108 -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 +412 -0
- package/backend/dist/cjs/backend/src/database/quota/safe_int.js +745 -0
- package/backend/dist/cjs/backend/src/endpoint.d.ts +346 -0
- package/backend/dist/cjs/backend/src/endpoint.js +468 -0
- 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/cjs/backend/src/errors/internal_external.d.ts +52 -0
- package/backend/dist/cjs/backend/src/errors/internal_external.js +95 -0
- package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +41 -0
- package/backend/dist/cjs/backend/src/errors/invalid_usage_error.js +47 -0
- package/backend/dist/cjs/backend/src/errors/system_error.d.ts +261 -0
- package/backend/dist/cjs/backend/src/errors/system_error.js +436 -0
- package/backend/dist/cjs/backend/src/events.d.ts +97 -0
- package/backend/dist/cjs/backend/src/events.js +15 -0
- package/backend/dist/cjs/backend/src/frontend.d.ts +13 -0
- package/backend/dist/cjs/backend/src/frontend.js +56 -0
- package/backend/dist/cjs/backend/src/image_endpoint.d.ts +44 -0
- package/backend/dist/cjs/backend/src/image_endpoint.js +185 -0
- package/backend/dist/cjs/backend/src/index.d.ts +23 -0
- package/backend/dist/cjs/backend/src/index.js +70 -0
- 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 +112 -0
- package/backend/dist/cjs/backend/src/meta.js +181 -0
- package/backend/dist/cjs/backend/src/payments/paddle.d.ts +329 -0
- package/backend/dist/cjs/backend/src/payments/paddle.js +1996 -0
- package/backend/dist/cjs/backend/src/payments/stripe/checkout.d.ts +113 -0
- package/backend/dist/cjs/backend/src/payments/stripe/checkout.js +295 -0
- package/backend/dist/cjs/backend/src/payments/stripe/customers.d.ts +17 -0
- package/backend/dist/cjs/backend/src/payments/stripe/customers.js +164 -0
- package/backend/dist/cjs/backend/src/payments/stripe/error.d.ts +74 -0
- package/backend/dist/cjs/backend/src/payments/stripe/error.js +64 -0
- package/backend/dist/cjs/backend/src/payments/stripe/events.d.ts +155 -0
- package/backend/dist/cjs/backend/src/payments/stripe/events.js +15 -0
- package/backend/dist/cjs/backend/src/payments/stripe/meters.d.ts +105 -0
- package/backend/dist/cjs/backend/src/payments/stripe/meters.js +230 -0
- package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.d.ts +58 -0
- package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.js +109 -0
- package/backend/dist/cjs/backend/src/payments/stripe/products.d.ts +519 -0
- package/backend/dist/cjs/backend/src/payments/stripe/products.js +650 -0
- package/backend/dist/cjs/backend/src/payments/stripe/stripe.d.ts +215 -0
- package/backend/dist/cjs/backend/src/payments/stripe/stripe.js +468 -0
- package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.d.ts +172 -0
- package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.js +557 -0
- package/backend/dist/cjs/backend/src/payments/stripe/utils.d.ts +63 -0
- package/backend/dist/cjs/backend/src/payments/stripe/utils.js +118 -0
- package/backend/dist/cjs/backend/src/payments/stripe/webhooks.d.ts +105 -0
- package/backend/dist/cjs/backend/src/payments/stripe/webhooks.js +627 -0
- 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/communication.d.ts +70 -0
- package/backend/dist/cjs/backend/src/plugins/communication.js +196 -0
- package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +255 -0
- package/backend/dist/cjs/backend/src/plugins/mail/mail.js +381 -0
- package/backend/dist/cjs/backend/src/plugins/mail/ui.d.ts +297 -0
- package/backend/dist/cjs/backend/src/plugins/mail/ui.js +1370 -0
- package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +1 -0
- package/backend/dist/cjs/backend/src/plugins/pdf.js +1456 -0
- package/backend/dist/cjs/backend/src/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/cjs/backend/src/plugins/thread_monitor.js +116 -0
- package/backend/dist/cjs/backend/src/rate_limit.d.ts +148 -0
- package/backend/dist/cjs/backend/src/rate_limit.js +543 -0
- package/backend/dist/cjs/backend/src/route.d.ts +39 -0
- package/backend/dist/cjs/backend/src/route.js +172 -0
- package/backend/dist/cjs/backend/src/server.d.ts +502 -0
- package/backend/dist/cjs/backend/src/server.js +1710 -0
- package/backend/dist/cjs/backend/src/server.old.d.ts +594 -0
- package/backend/dist/cjs/backend/src/server.old.js +2058 -0
- package/backend/dist/cjs/backend/src/splash_screen.d.ts +93 -0
- package/backend/dist/cjs/backend/src/splash_screen.js +119 -0
- package/backend/dist/cjs/backend/src/status.d.ts +89 -0
- package/backend/dist/cjs/backend/src/status.js +211 -0
- package/backend/dist/cjs/backend/src/stream.d.ts +494 -0
- package/backend/dist/cjs/backend/src/stream.js +1370 -0
- package/backend/dist/cjs/backend/src/users.d.ts +926 -0
- package/backend/dist/cjs/backend/src/users.js +2223 -0
- package/backend/dist/cjs/backend/src/utils.d.ts +22 -0
- package/backend/dist/cjs/backend/src/utils.js +626 -0
- package/backend/dist/cjs/backend/src/view.d.ts +115 -0
- package/backend/dist/cjs/backend/src/view.js +519 -0
- package/backend/dist/cjs/backend/src/vinc.d.ts +6 -0
- package/backend/dist/cjs/backend/src/vinc.js +40 -0
- package/backend/dist/cjs/backend/src/volt.d.ts +24 -0
- package/backend/dist/cjs/backend/src/volt.js +72 -0
- 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/cjs/package.json +1 -0
- package/backend/dist/esm/backend/src/blacklist.d.ts +12 -0
- package/backend/dist/esm/backend/src/blacklist.js +52 -0
- package/backend/dist/esm/backend/src/cli.d.ts +2 -0
- package/backend/dist/esm/backend/src/cli.js +211 -0
- package/backend/dist/esm/backend/src/database/collection.d.ts +1765 -0
- package/backend/dist/esm/backend/src/database/collection.js +3779 -0
- package/backend/dist/esm/backend/src/database/database.d.ts +92 -0
- package/backend/dist/esm/backend/src/database/database.js +214 -0
- 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 +415 -0
- package/backend/dist/esm/backend/src/database/flatten.d.ts +78 -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/quoata_v2.d.ts +533 -0
- package/backend/dist/esm/backend/src/database/quota/quoata_v2.js +1155 -0
- package/backend/dist/esm/backend/src/database/quota/quota.d.ts +551 -0
- package/backend/dist/esm/backend/src/database/quota/quota.js +1219 -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 +412 -0
- package/backend/dist/esm/backend/src/database/quota/safe_int.js +810 -0
- package/backend/dist/esm/backend/src/endpoint.d.ts +346 -0
- package/backend/dist/esm/backend/src/endpoint.js +479 -0
- 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/esm/backend/src/errors/internal_external.d.ts +52 -0
- package/backend/dist/esm/backend/src/errors/internal_external.js +86 -0
- package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +41 -0
- package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +33 -0
- package/backend/dist/esm/backend/src/errors/system_error.d.ts +261 -0
- package/backend/dist/esm/backend/src/errors/system_error.js +444 -0
- package/backend/dist/esm/backend/src/events.d.ts +97 -0
- package/backend/dist/esm/backend/src/events.js +5 -0
- package/backend/dist/esm/backend/src/frontend.d.ts +13 -0
- package/backend/dist/esm/backend/src/frontend.js +23 -0
- package/backend/dist/esm/backend/src/image_endpoint.d.ts +44 -0
- package/backend/dist/esm/backend/src/image_endpoint.js +196 -0
- package/backend/dist/esm/backend/src/index.d.ts +23 -0
- package/backend/dist/esm/backend/src/index.js +26 -0
- 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 +112 -0
- package/backend/dist/esm/backend/src/meta.js +152 -0
- package/backend/dist/esm/backend/src/payments/paddle.d.ts +329 -0
- package/backend/dist/esm/backend/src/payments/paddle.js +2276 -0
- package/backend/dist/esm/backend/src/payments/stripe/checkout.d.ts +113 -0
- package/backend/dist/esm/backend/src/payments/stripe/checkout.js +356 -0
- package/backend/dist/esm/backend/src/payments/stripe/customers.d.ts +17 -0
- package/backend/dist/esm/backend/src/payments/stripe/customers.js +193 -0
- package/backend/dist/esm/backend/src/payments/stripe/error.d.ts +74 -0
- package/backend/dist/esm/backend/src/payments/stripe/error.js +51 -0
- package/backend/dist/esm/backend/src/payments/stripe/events.d.ts +155 -0
- package/backend/dist/esm/backend/src/payments/stripe/events.js +5 -0
- package/backend/dist/esm/backend/src/payments/stripe/meters.d.ts +105 -0
- package/backend/dist/esm/backend/src/payments/stripe/meters.js +318 -0
- package/backend/dist/esm/backend/src/payments/stripe/payment_methods.d.ts +58 -0
- package/backend/dist/esm/backend/src/payments/stripe/payment_methods.js +135 -0
- package/backend/dist/esm/backend/src/payments/stripe/products.d.ts +519 -0
- package/backend/dist/esm/backend/src/payments/stripe/products.js +896 -0
- package/backend/dist/esm/backend/src/payments/stripe/stripe.d.ts +215 -0
- package/backend/dist/esm/backend/src/payments/stripe/stripe.js +464 -0
- package/backend/dist/esm/backend/src/payments/stripe/subscriptions.d.ts +172 -0
- package/backend/dist/esm/backend/src/payments/stripe/subscriptions.js +754 -0
- package/backend/dist/esm/backend/src/payments/stripe/utils.d.ts +63 -0
- package/backend/dist/esm/backend/src/payments/stripe/utils.js +131 -0
- package/backend/dist/esm/backend/src/payments/stripe/webhooks.d.ts +105 -0
- package/backend/dist/esm/backend/src/payments/stripe/webhooks.js +752 -0
- 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/communication.d.ts +70 -0
- package/backend/dist/esm/backend/src/plugins/communication.js +169 -0
- package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +255 -0
- package/backend/dist/esm/backend/src/plugins/mail/mail.js +396 -0
- package/backend/dist/esm/backend/src/plugins/mail/ui.d.ts +297 -0
- package/backend/dist/esm/backend/src/plugins/mail/ui.js +1400 -0
- package/backend/dist/esm/backend/src/plugins/pdf.d.ts +1 -0
- package/backend/dist/esm/backend/src/plugins/pdf.js +1694 -0
- package/backend/dist/esm/backend/src/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/esm/backend/src/plugins/thread_monitor.js +120 -0
- package/backend/dist/esm/backend/src/rate_limit.d.ts +148 -0
- package/backend/dist/esm/backend/src/rate_limit.js +667 -0
- package/backend/dist/esm/backend/src/route.d.ts +39 -0
- package/backend/dist/esm/backend/src/route.js +222 -0
- package/backend/dist/esm/backend/src/server.d.ts +502 -0
- package/backend/dist/esm/backend/src/server.js +2031 -0
- package/backend/dist/esm/backend/src/server.old.d.ts +594 -0
- package/backend/dist/esm/backend/src/server.old.js +2630 -0
- package/backend/dist/esm/backend/src/splash_screen.d.ts +93 -0
- package/backend/dist/esm/backend/src/splash_screen.js +156 -0
- package/backend/dist/esm/backend/src/status.d.ts +89 -0
- package/backend/dist/esm/backend/src/status.js +213 -0
- package/backend/dist/esm/backend/src/stream.d.ts +494 -0
- package/backend/dist/esm/backend/src/stream.js +1611 -0
- package/backend/dist/esm/backend/src/users.d.ts +926 -0
- package/backend/dist/esm/backend/src/users.js +2423 -0
- package/backend/dist/esm/backend/src/utils.d.ts +22 -0
- package/backend/dist/esm/backend/src/utils.js +463 -0
- package/backend/dist/esm/backend/src/view.d.ts +115 -0
- package/backend/dist/esm/backend/src/view.js +584 -0
- package/backend/dist/esm/backend/src/vinc.d.ts +6 -0
- package/backend/dist/esm/backend/src/vinc.js +6 -0
- package/backend/dist/esm/backend/src/volt.d.ts +24 -0
- package/backend/dist/esm/backend/src/volt.js +27 -0
- package/backend/dist/esm/frontend/src/modules/request.d.ts +70 -0
- package/backend/dist/esm/frontend/src/modules/request.js +117 -0
- package/backend/old/file_watcher.ts +359 -0
- package/backend/old/request.deprc.js +626 -0
- package/backend/old/response.deprc.js +354 -0
- package/frontend/dist/backend/src/database/collection.d.ts +1765 -0
- package/frontend/dist/backend/src/database/collection.js +3779 -0
- package/frontend/dist/backend/src/database/database.d.ts +92 -0
- package/frontend/dist/backend/src/database/database.js +214 -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 +78 -0
- package/frontend/dist/backend/src/database/flatten.js +22 -0
- package/frontend/dist/backend/src/endpoint.d.ts +346 -0
- package/frontend/dist/backend/src/endpoint.js +479 -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 +52 -0
- package/frontend/dist/backend/src/errors/internal_external.js +86 -0
- package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +41 -0
- package/frontend/dist/backend/src/errors/invalid_usage_error.js +33 -0
- package/frontend/dist/backend/src/errors/system_error.d.ts +261 -0
- package/frontend/dist/backend/src/errors/system_error.js +444 -0
- package/frontend/dist/backend/src/events.d.ts +97 -0
- package/frontend/dist/backend/src/events.js +5 -0
- package/frontend/dist/backend/src/frontend.d.ts +13 -0
- package/frontend/dist/backend/src/frontend.js +23 -0
- package/frontend/dist/backend/src/image_endpoint.d.ts +44 -0
- package/frontend/dist/backend/src/image_endpoint.js +196 -0
- package/frontend/dist/backend/src/meta.d.ts +112 -0
- package/frontend/dist/backend/src/meta.js +152 -0
- package/frontend/dist/backend/src/payments/paddle.d.ts +329 -0
- package/frontend/dist/backend/src/payments/paddle.js +2276 -0
- package/frontend/dist/backend/src/payments/stripe/checkout.d.ts +113 -0
- package/frontend/dist/backend/src/payments/stripe/checkout.js +356 -0
- package/frontend/dist/backend/src/payments/stripe/customers.d.ts +17 -0
- package/frontend/dist/backend/src/payments/stripe/customers.js +193 -0
- package/frontend/dist/backend/src/payments/stripe/error.d.ts +74 -0
- package/frontend/dist/backend/src/payments/stripe/error.js +51 -0
- package/frontend/dist/backend/src/payments/stripe/events.d.ts +155 -0
- package/frontend/dist/backend/src/payments/stripe/events.js +5 -0
- package/frontend/dist/backend/src/payments/stripe/meters.d.ts +105 -0
- package/frontend/dist/backend/src/payments/stripe/meters.js +318 -0
- package/frontend/dist/backend/src/payments/stripe/payment_methods.d.ts +58 -0
- package/frontend/dist/backend/src/payments/stripe/payment_methods.js +135 -0
- package/frontend/dist/backend/src/payments/stripe/products.d.ts +519 -0
- package/frontend/dist/backend/src/payments/stripe/products.js +896 -0
- package/frontend/dist/backend/src/payments/stripe/stripe.d.ts +215 -0
- package/frontend/dist/backend/src/payments/stripe/stripe.js +464 -0
- package/frontend/dist/backend/src/payments/stripe/subscriptions.d.ts +172 -0
- package/frontend/dist/backend/src/payments/stripe/subscriptions.js +754 -0
- package/frontend/dist/backend/src/payments/stripe/utils.d.ts +63 -0
- package/frontend/dist/backend/src/payments/stripe/utils.js +131 -0
- package/frontend/dist/backend/src/payments/stripe/webhooks.d.ts +105 -0
- package/frontend/dist/backend/src/payments/stripe/webhooks.js +752 -0
- package/frontend/dist/backend/src/plugins/mail/mail.d.ts +255 -0
- package/frontend/dist/backend/src/plugins/mail/mail.js +396 -0
- package/frontend/dist/backend/src/plugins/mail/ui.d.ts +297 -0
- package/frontend/dist/backend/src/plugins/mail/ui.js +1400 -0
- package/frontend/dist/backend/src/rate_limit.d.ts +148 -0
- package/frontend/dist/backend/src/rate_limit.js +667 -0
- package/frontend/dist/backend/src/route.d.ts +39 -0
- package/frontend/dist/backend/src/route.js +222 -0
- package/frontend/dist/backend/src/server.d.ts +502 -0
- package/frontend/dist/backend/src/server.js +2031 -0
- package/frontend/dist/backend/src/splash_screen.d.ts +93 -0
- package/frontend/dist/backend/src/splash_screen.js +156 -0
- package/frontend/dist/backend/src/status.d.ts +89 -0
- package/frontend/dist/backend/src/status.js +213 -0
- package/frontend/dist/backend/src/stream.d.ts +494 -0
- package/frontend/dist/backend/src/stream.js +1611 -0
- package/frontend/dist/backend/src/users.d.ts +926 -0
- package/frontend/dist/backend/src/users.js +2423 -0
- package/frontend/dist/backend/src/utils.d.ts +22 -0
- package/frontend/dist/backend/src/utils.js +463 -0
- package/frontend/dist/backend/src/view.d.ts +115 -0
- package/frontend/dist/backend/src/view.js +584 -0
- package/frontend/dist/frontend/src/css/adyen.css +92 -0
- package/frontend/dist/frontend/src/css/volt.css +75 -0
- package/frontend/dist/frontend/src/elements/base.d.ts +3743 -0
- package/frontend/dist/frontend/src/elements/base.js +12151 -0
- package/frontend/dist/frontend/src/elements/module.d.ts +95 -0
- package/frontend/dist/frontend/src/elements/module.js +216 -0
- package/frontend/dist/frontend/src/elements/register_element.d.ts +3 -0
- package/frontend/dist/frontend/src/elements/register_element.js +22 -0
- package/frontend/dist/frontend/src/elements/resize_query_manager.d.ts +0 -0
- package/frontend/dist/frontend/src/elements/resize_query_manager.js +150 -0
- 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/index.d.ts +21 -0
- package/frontend/dist/frontend/src/index.js +29 -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/frontend/src/modules/color.d.ts +160 -0
- package/frontend/dist/frontend/src/modules/color.js +316 -0
- 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 +79 -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/frontend/src/modules/meta.js +48 -0
- package/frontend/dist/frontend/src/modules/paddle.d.ts +1207 -0
- package/frontend/dist/frontend/src/modules/paddle.js +2594 -0
- 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/frontend/src/modules/statics.js +43 -0
- package/frontend/dist/frontend/src/modules/stripe/cart.d.ts +112 -0
- package/frontend/dist/frontend/src/modules/stripe/cart.js +321 -0
- package/frontend/dist/frontend/src/modules/stripe/checkout.d.ts +7 -0
- package/frontend/dist/frontend/src/modules/stripe/checkout.js +37 -0
- package/frontend/dist/frontend/src/modules/stripe/index.m.d.ts +6 -0
- package/frontend/dist/frontend/src/modules/stripe/index.m.js +6 -0
- package/frontend/dist/frontend/src/modules/stripe/payments.d.ts +58 -0
- package/frontend/dist/frontend/src/modules/stripe/payments.js +92 -0
- package/frontend/dist/frontend/src/modules/support.d.ts +30 -0
- package/frontend/dist/frontend/src/modules/support.js +53 -0
- package/frontend/dist/frontend/src/modules/theme.d.ts +133 -0
- package/frontend/dist/frontend/src/modules/theme.js +406 -0
- 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 +270 -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/frontend/src/types/gradient.js +79 -0
- package/frontend/dist/frontend/src/ui/border_button.d.ts +94 -0
- package/frontend/dist/frontend/src/ui/border_button.js +228 -0
- package/frontend/dist/frontend/src/ui/button.d.ts +241 -0
- package/frontend/dist/frontend/src/ui/button.js +682 -0
- package/frontend/dist/frontend/src/ui/canvas.d.ts +138 -0
- package/frontend/dist/frontend/src/ui/canvas.js +444 -0
- package/frontend/dist/frontend/src/ui/checkbox.d.ts +74 -0
- package/frontend/dist/frontend/src/ui/checkbox.js +321 -0
- package/frontend/dist/frontend/src/ui/code.d.ts +235 -0
- package/frontend/dist/frontend/src/ui/code.js +1007 -0
- package/frontend/dist/frontend/src/ui/context_menu.d.ts +36 -0
- package/frontend/dist/frontend/src/ui/context_menu.js +205 -0
- package/frontend/dist/frontend/src/ui/css.d.ts +16 -0
- package/frontend/dist/frontend/src/ui/css.js +48 -0
- package/frontend/dist/frontend/src/ui/divider.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/divider.js +78 -0
- package/frontend/dist/frontend/src/ui/dropdown.d.ts +176 -0
- package/frontend/dist/frontend/src/ui/dropdown.js +481 -0
- package/frontend/dist/frontend/src/ui/for_each.d.ts +37 -0
- package/frontend/dist/frontend/src/ui/for_each.js +92 -0
- package/frontend/dist/frontend/src/ui/form.d.ts +34 -0
- package/frontend/dist/frontend/src/ui/form.js +233 -0
- package/frontend/dist/frontend/src/ui/frame_modes.d.ts +37 -0
- package/frontend/dist/frontend/src/ui/frame_modes.js +108 -0
- package/frontend/dist/frontend/src/ui/google_map.d.ts +24 -0
- package/frontend/dist/frontend/src/ui/google_map.js +106 -0
- package/frontend/dist/frontend/src/ui/gradient.d.ts +25 -0
- package/frontend/dist/frontend/src/ui/gradient.js +131 -0
- package/frontend/dist/frontend/src/ui/image.d.ts +111 -0
- package/frontend/dist/frontend/src/ui/image.js +576 -0
- package/frontend/dist/frontend/src/ui/input.d.ts +392 -0
- package/frontend/dist/frontend/src/ui/input.js +1201 -0
- package/frontend/dist/frontend/src/ui/link.d.ts +25 -0
- package/frontend/dist/frontend/src/ui/link.js +140 -0
- package/frontend/dist/frontend/src/ui/list.d.ts +37 -0
- package/frontend/dist/frontend/src/ui/list.js +170 -0
- package/frontend/dist/frontend/src/ui/loader_button.d.ts +80 -0
- package/frontend/dist/frontend/src/ui/loader_button.js +193 -0
- package/frontend/dist/frontend/src/ui/loaders.d.ts +57 -0
- package/frontend/dist/frontend/src/ui/loaders.js +157 -0
- package/frontend/dist/frontend/src/ui/popup.d.ts +94 -0
- package/frontend/dist/frontend/src/ui/popup.js +510 -0
- package/frontend/dist/frontend/src/ui/pseudo.d.ts +44 -0
- package/frontend/dist/frontend/src/ui/pseudo.js +154 -0
- package/frontend/dist/frontend/src/ui/scroller.d.ts +105 -0
- package/frontend/dist/frontend/src/ui/scroller.js +1253 -0
- package/frontend/dist/frontend/src/ui/slider.d.ts +45 -0
- package/frontend/dist/frontend/src/ui/slider.js +217 -0
- package/frontend/dist/frontend/src/ui/spacer.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/spacer.js +78 -0
- package/frontend/dist/frontend/src/ui/span.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/span.js +73 -0
- package/frontend/dist/frontend/src/ui/stack.d.ts +66 -0
- package/frontend/dist/frontend/src/ui/stack.js +335 -0
- package/frontend/dist/frontend/src/ui/steps.d.ts +131 -0
- package/frontend/dist/frontend/src/ui/steps.js +308 -0
- package/frontend/dist/frontend/src/ui/style.d.ts +17 -0
- package/frontend/dist/frontend/src/ui/style.js +73 -0
- package/frontend/dist/frontend/src/ui/switch.d.ts +69 -0
- package/frontend/dist/frontend/src/ui/switch.js +357 -0
- package/frontend/dist/frontend/src/ui/table.d.ts +100 -0
- package/frontend/dist/frontend/src/ui/table.js +405 -0
- package/frontend/dist/frontend/src/ui/tabs.d.ts +111 -0
- package/frontend/dist/frontend/src/ui/tabs.js +424 -0
- package/frontend/dist/frontend/src/ui/text.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/text.js +83 -0
- package/frontend/dist/frontend/src/ui/title.d.ts +91 -0
- package/frontend/dist/frontend/src/ui/title.js +272 -0
- package/frontend/dist/frontend/src/ui/ui.d.ts +35 -0
- package/frontend/dist/frontend/src/ui/ui.js +38 -0
- package/frontend/dist/frontend/src/ui/view.d.ts +15 -0
- package/frontend/dist/frontend/src/ui/view.js +88 -0
- package/frontend/dist/frontend/src/volt.d.ts +20 -0
- package/frontend/dist/frontend/src/volt.js +27 -0
- package/frontend/examples/theme/theme.ts +58 -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/frontend/tools/scan_mixed_imports.js +69 -0
- package/package.json +1 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// import * as vlib from "@vandenberghinc/vlib";
|
|
2
|
+
// import { chromium, firefox, Browser, BrowserContext, Page } from 'playwright';
|
|
3
|
+
export {};
|
|
4
|
+
// export class BrowserPreview {
|
|
5
|
+
// private browser_type: string;
|
|
6
|
+
// private browser: Browser | null;
|
|
7
|
+
// private context: BrowserContext | null;
|
|
8
|
+
// private page: Page | null;
|
|
9
|
+
// /**
|
|
10
|
+
// * Initializes the browser_controller with the specified browser type.
|
|
11
|
+
// * @param {string} browser - The browser to launch ('chrome' or 'firefox').
|
|
12
|
+
// */
|
|
13
|
+
// constructor(browser: string = 'chrome') {
|
|
14
|
+
// this.browser_type = browser.toLowerCase();
|
|
15
|
+
// this.browser = null;
|
|
16
|
+
// this.context = null;
|
|
17
|
+
// this.page = null;
|
|
18
|
+
// }
|
|
19
|
+
// /**
|
|
20
|
+
// * Starts the browser and opens a new page.
|
|
21
|
+
// */
|
|
22
|
+
// async start(): Promise<void> {
|
|
23
|
+
// try {
|
|
24
|
+
// if (this.browser_type === 'chrome') {
|
|
25
|
+
// // Launch Chromium with Chrome channel for Chrome-specific features
|
|
26
|
+
// this.browser = await chromium.launch({
|
|
27
|
+
// headless: false, // Set to true if you don't need to see the browser
|
|
28
|
+
// channel: 'chrome', // Ensure Chrome is installed on your system
|
|
29
|
+
// args: [
|
|
30
|
+
// '--ignore-certificate-errors',
|
|
31
|
+
// '--allow-insecure-localhost',
|
|
32
|
+
// ],
|
|
33
|
+
// });
|
|
34
|
+
// } else if (this.browser_type === 'firefox') {
|
|
35
|
+
// this.browser = await firefox.launch({
|
|
36
|
+
// headless: false, // Set to true if you don't need to see the browser
|
|
37
|
+
// });
|
|
38
|
+
// } else {
|
|
39
|
+
// throw new Error(`Unsupported browser type: ${this.browser_type}`);
|
|
40
|
+
// }
|
|
41
|
+
// this.context = await this.browser.newContext({
|
|
42
|
+
// ignoreHTTPSErrors: true,
|
|
43
|
+
// viewport: null,
|
|
44
|
+
// });
|
|
45
|
+
// this.page = await this.context.newPage();
|
|
46
|
+
// log(0, `${this.browser_type} browser launched successfully.`);
|
|
47
|
+
// } catch (error: any) {
|
|
48
|
+
// error(`Error launching browser: ${error.message}`);
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
// /**
|
|
52
|
+
// * Stops the browser and cleans up resources.
|
|
53
|
+
// */
|
|
54
|
+
// async stop(): Promise<void> {
|
|
55
|
+
// try {
|
|
56
|
+
// if (this.browser) {
|
|
57
|
+
// await this.browser.close();
|
|
58
|
+
// log(0, `${this.browser_type} browser closed successfully.`);
|
|
59
|
+
// }
|
|
60
|
+
// } catch (error: any) {
|
|
61
|
+
// error(`Error closing browser: ${error.message}`);
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
64
|
+
// /**
|
|
65
|
+
// * Refreshes the active tab if its URL matches the specified endpoint.
|
|
66
|
+
// * @param {string | RegExp} endpoint - The server endpoint URL to check against the active tab.
|
|
67
|
+
// */
|
|
68
|
+
// async refresh(endpoint: string | RegExp): Promise<void> {
|
|
69
|
+
// if (!this.page) {
|
|
70
|
+
// log.warn(0, `No page is open. Please call start() first.`);
|
|
71
|
+
// return;
|
|
72
|
+
// }
|
|
73
|
+
// let current_endpoint: string = this.page.url().replace(/http[s]*:\/\//g, "");
|
|
74
|
+
// const index = current_endpoint.indexOf("/");
|
|
75
|
+
// if (index !== -1) {
|
|
76
|
+
// current_endpoint = current_endpoint.substr(index);
|
|
77
|
+
// }
|
|
78
|
+
// // Normalize URLs for comparison
|
|
79
|
+
// current_endpoint = this._normalize_url(current_endpoint);
|
|
80
|
+
// if (typeof endpoint === "string") {
|
|
81
|
+
// endpoint = this._normalize_url(endpoint);
|
|
82
|
+
// }
|
|
83
|
+
// if (
|
|
84
|
+
// (typeof endpoint === "string" && current_endpoint === endpoint) ||
|
|
85
|
+
// (endpoint instanceof RegExp && endpoint.test(current_endpoint))
|
|
86
|
+
// ) {
|
|
87
|
+
// // Capture the current scroll position
|
|
88
|
+
// const scrollPosition = await this.page.evaluate(() => {
|
|
89
|
+
// // @ts-ignore
|
|
90
|
+
// const scrollableElement = document.scrollingElement;
|
|
91
|
+
// if (scrollableElement) {
|
|
92
|
+
// return {
|
|
93
|
+
// x: scrollableElement.scrollLeft,
|
|
94
|
+
// y: scrollableElement.scrollTop
|
|
95
|
+
// };
|
|
96
|
+
// } else {
|
|
97
|
+
// // Fallback to window scroll if scrollingElement not found
|
|
98
|
+
// return {
|
|
99
|
+
// // @ts-ignore
|
|
100
|
+
// x: window.scrollX,
|
|
101
|
+
// // @ts-ignore
|
|
102
|
+
// y: window.scrollY
|
|
103
|
+
// };
|
|
104
|
+
// }
|
|
105
|
+
// });
|
|
106
|
+
// // Reload the page
|
|
107
|
+
// await this.page.reload();
|
|
108
|
+
// log(2, `Page reloaded because it matches the endpoint: ${endpoint}`);
|
|
109
|
+
// // Restore the scroll position after reload
|
|
110
|
+
// await this.page.evaluate(({ x, y }) => {
|
|
111
|
+
// // @ts-ignore
|
|
112
|
+
// const scrollableElement = document.scrollingElement;
|
|
113
|
+
// if (scrollableElement) {
|
|
114
|
+
// scrollableElement.scrollTo(x, y);
|
|
115
|
+
// } else {
|
|
116
|
+
// // @ts-ignore
|
|
117
|
+
// window.scrollTo(x, y);
|
|
118
|
+
// }
|
|
119
|
+
// }, { x: scrollPosition.x, y: scrollPosition.y });
|
|
120
|
+
// log(2, `Scroll position restored to x: ${scrollPosition.x}, y: ${scrollPosition.y}`);
|
|
121
|
+
// } else {
|
|
122
|
+
// log(2, `Active tab URL (${current_endpoint}) does not match the endpoint (${endpoint}). No action taken.`);
|
|
123
|
+
// }
|
|
124
|
+
// }
|
|
125
|
+
// /**
|
|
126
|
+
// * Opens the specified endpoint in the browser.
|
|
127
|
+
// * @param {string} endpoint - The URL to navigate to.
|
|
128
|
+
// */
|
|
129
|
+
// async navigate(endpoint: string): Promise<void> {
|
|
130
|
+
// try {
|
|
131
|
+
// if (!this.page) {
|
|
132
|
+
// log.warn(0, `No page is open. Please call start() first.`);
|
|
133
|
+
// return;
|
|
134
|
+
// }
|
|
135
|
+
// await this.page.goto(endpoint);
|
|
136
|
+
// log(1, `Navigated to ${endpoint}`);
|
|
137
|
+
// } catch (error: any) {
|
|
138
|
+
// error(`Error navigating to ${endpoint}: ${error.message}`);
|
|
139
|
+
// }
|
|
140
|
+
// }
|
|
141
|
+
// /**
|
|
142
|
+
// * Normalizes URLs by removing trailing slashes and converting to lowercase.
|
|
143
|
+
// * @param {string} url - The URL to normalize.
|
|
144
|
+
// * @returns {string} - The normalized URL.
|
|
145
|
+
// */
|
|
146
|
+
// _normalize_url(url: string): string {
|
|
147
|
+
// if (/http[s]*:\/\//.test(url)) {
|
|
148
|
+
// url = url.replace(/http[s]*:\/\//g, "");
|
|
149
|
+
// const index = url.indexOf("/");
|
|
150
|
+
// if (index !== -1) {
|
|
151
|
+
// url = url.substr(index);
|
|
152
|
+
// }
|
|
153
|
+
// }
|
|
154
|
+
// let index;
|
|
155
|
+
// if ((index = url.indexOf("#")) !== -1) {
|
|
156
|
+
// url = url.substr(0, index);
|
|
157
|
+
// }
|
|
158
|
+
// while (url.includes("//")) {
|
|
159
|
+
// url = url.replaceAll("//", "/");
|
|
160
|
+
// }
|
|
161
|
+
// while (url[0] === "/") {
|
|
162
|
+
// url = url.slice(1);
|
|
163
|
+
// }
|
|
164
|
+
// while (url[url.length - 1] === "/") {
|
|
165
|
+
// url = url.slice(0, -1);
|
|
166
|
+
// }
|
|
167
|
+
// return url.toLowerCase();
|
|
168
|
+
// }
|
|
169
|
+
// }
|
|
170
|
+
// export default BrowserPreview;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import net from 'net';
|
|
2
|
+
declare module 'net' {
|
|
3
|
+
interface Socket {
|
|
4
|
+
buffer: string;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Very basic internal communication socket between processes.
|
|
9
|
+
*/
|
|
10
|
+
declare class Base {
|
|
11
|
+
port: number;
|
|
12
|
+
host: string;
|
|
13
|
+
_on_message: ((message: any, socket: net.Socket) => void) | null;
|
|
14
|
+
constructor(port: number, host?: string);
|
|
15
|
+
on_message(callback: (message: any, socket: net.Socket) => void): this;
|
|
16
|
+
/**
|
|
17
|
+
* Processes the buffer to extract complete messages.
|
|
18
|
+
* Handles multiple consecutive messages.
|
|
19
|
+
* @param {net.Socket} socket - The client socket.
|
|
20
|
+
*/
|
|
21
|
+
_process_buffer(socket: net.Socket): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class Server extends Base {
|
|
24
|
+
server: net.Server;
|
|
25
|
+
clients: Set<net.Socket>;
|
|
26
|
+
/**
|
|
27
|
+
* Initializes the JSON Server.
|
|
28
|
+
* @param {number} port - Port number to listen on.
|
|
29
|
+
* @param {string} host - Host address to bind to.
|
|
30
|
+
*/
|
|
31
|
+
constructor(port: number, host?: string);
|
|
32
|
+
/**
|
|
33
|
+
* Sends a JSON message to a specific socket.
|
|
34
|
+
* @param {net.Socket} socket - The socket to send the message to.
|
|
35
|
+
* @param {Object} obj - The JSON object to send.
|
|
36
|
+
*/
|
|
37
|
+
message(socket: net.Socket, obj: Record<string, any>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Broadcasts a JSON message to all connected clients.
|
|
40
|
+
* @param {Object} obj - The JSON object to broadcast.
|
|
41
|
+
*/
|
|
42
|
+
broadcast(obj: Record<string, any>): void;
|
|
43
|
+
/**
|
|
44
|
+
* Closes the server and all client connections.
|
|
45
|
+
*/
|
|
46
|
+
close(): void;
|
|
47
|
+
}
|
|
48
|
+
export declare class Client extends Base {
|
|
49
|
+
socket: net.Socket;
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the JSON Client.
|
|
52
|
+
* @param {number} port - Port number to connect to.
|
|
53
|
+
* @param {string} host - Host address to connect to.
|
|
54
|
+
*/
|
|
55
|
+
constructor(port: number, host?: string);
|
|
56
|
+
/**
|
|
57
|
+
* Sends a JSON message to the server.
|
|
58
|
+
* @param {Object} obj - The JSON object to send.
|
|
59
|
+
*/
|
|
60
|
+
message(obj: Record<string, any>): void;
|
|
61
|
+
/**
|
|
62
|
+
* Closes the client connection.
|
|
63
|
+
*/
|
|
64
|
+
close(): void;
|
|
65
|
+
}
|
|
66
|
+
declare const _default: {
|
|
67
|
+
Server: typeof Server;
|
|
68
|
+
Client: typeof Client;
|
|
69
|
+
};
|
|
70
|
+
export default _default;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import net from 'net';
|
|
2
|
+
/**
|
|
3
|
+
* Very basic internal communication socket between processes.
|
|
4
|
+
*/
|
|
5
|
+
// Base class.
|
|
6
|
+
class Base {
|
|
7
|
+
port;
|
|
8
|
+
host;
|
|
9
|
+
_on_message;
|
|
10
|
+
constructor(port, host = '127.0.0.1') {
|
|
11
|
+
this.port = port;
|
|
12
|
+
this.host = host;
|
|
13
|
+
this._on_message = null;
|
|
14
|
+
}
|
|
15
|
+
// Set on message.
|
|
16
|
+
on_message(callback) {
|
|
17
|
+
this._on_message = callback;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Processes the buffer to extract complete messages.
|
|
22
|
+
* Handles multiple consecutive messages.
|
|
23
|
+
* @param {net.Socket} socket - The client socket.
|
|
24
|
+
*/
|
|
25
|
+
_process_buffer(socket) {
|
|
26
|
+
while (socket.buffer.length >= 4) { // At least 4 characters for length prefix
|
|
27
|
+
// Read the first 4 characters to get the message length
|
|
28
|
+
const length_str = socket.buffer.slice(0, 4);
|
|
29
|
+
const message_length = parseInt(length_str, 10);
|
|
30
|
+
if (isNaN(message_length)) {
|
|
31
|
+
console.error('Invalid message length:', length_str);
|
|
32
|
+
socket.destroy();
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
if (socket.buffer.length >= 4 + message_length) {
|
|
36
|
+
const message_str = socket.buffer.slice(4, 4 + message_length);
|
|
37
|
+
socket.buffer = socket.buffer.slice(4 + message_length);
|
|
38
|
+
try {
|
|
39
|
+
const message = JSON.parse(message_str);
|
|
40
|
+
if (this._on_message)
|
|
41
|
+
this._on_message(message, socket);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
console.error('Invalid JSON received:', message_str);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Wait for more data
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Server class.
|
|
55
|
+
export class Server extends Base {
|
|
56
|
+
server;
|
|
57
|
+
clients;
|
|
58
|
+
/**
|
|
59
|
+
* Initializes the JSON Server.
|
|
60
|
+
* @param {number} port - Port number to listen on.
|
|
61
|
+
* @param {string} host - Host address to bind to.
|
|
62
|
+
*/
|
|
63
|
+
constructor(port, host = '127.0.0.1') {
|
|
64
|
+
super(port, host);
|
|
65
|
+
this.server = net.createServer();
|
|
66
|
+
this.clients = new Set();
|
|
67
|
+
this.server.on('connection', (socket) => {
|
|
68
|
+
console.log('Client connected:', socket.remoteAddress, socket.remotePort);
|
|
69
|
+
this.clients.add(socket);
|
|
70
|
+
socket.setEncoding('utf8');
|
|
71
|
+
// Initialize buffer for each client
|
|
72
|
+
socket.buffer = '';
|
|
73
|
+
socket.on('data', (data) => {
|
|
74
|
+
socket.buffer += data;
|
|
75
|
+
this._process_buffer(socket);
|
|
76
|
+
});
|
|
77
|
+
socket.on('close', () => {
|
|
78
|
+
console.log('Client disconnected:', socket.remoteAddress, socket.remotePort);
|
|
79
|
+
this.clients.delete(socket);
|
|
80
|
+
});
|
|
81
|
+
socket.on('error', (err) => {
|
|
82
|
+
console.error('Socket error:', err);
|
|
83
|
+
socket.destroy();
|
|
84
|
+
this.clients.delete(socket);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
this.server.on('error', (err) => {
|
|
88
|
+
console.error('Server error:', err);
|
|
89
|
+
});
|
|
90
|
+
this.server.listen(port, host, () => {
|
|
91
|
+
console.log(`JSON Server listening on ${host}:${port}`);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Sends a JSON message to a specific socket.
|
|
96
|
+
* @param {net.Socket} socket - The socket to send the message to.
|
|
97
|
+
* @param {Object} obj - The JSON object to send.
|
|
98
|
+
*/
|
|
99
|
+
message(socket, obj) {
|
|
100
|
+
const json = JSON.stringify(obj);
|
|
101
|
+
const length = json.length.toString().padStart(4, '0'); // 4-digit length prefix
|
|
102
|
+
socket.write(length + json);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Broadcasts a JSON message to all connected clients.
|
|
106
|
+
* @param {Object} obj - The JSON object to broadcast.
|
|
107
|
+
*/
|
|
108
|
+
broadcast(obj) {
|
|
109
|
+
for (let socket of this.clients) {
|
|
110
|
+
this.message(socket, obj);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Closes the server and all client connections.
|
|
115
|
+
*/
|
|
116
|
+
close() {
|
|
117
|
+
for (let socket of this.clients) {
|
|
118
|
+
socket.destroy();
|
|
119
|
+
}
|
|
120
|
+
this.server.close(() => {
|
|
121
|
+
console.log('JSON Server closed.');
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Client class.
|
|
126
|
+
export class Client extends Base {
|
|
127
|
+
socket;
|
|
128
|
+
/**
|
|
129
|
+
* Initializes the JSON Client.
|
|
130
|
+
* @param {number} port - Port number to connect to.
|
|
131
|
+
* @param {string} host - Host address to connect to.
|
|
132
|
+
*/
|
|
133
|
+
constructor(port, host = '127.0.0.1') {
|
|
134
|
+
super(port, host);
|
|
135
|
+
this.socket = net.createConnection(port, host, () => {
|
|
136
|
+
console.log(`Connected to JSON Server at ${host}:${port}`);
|
|
137
|
+
});
|
|
138
|
+
this.socket.buffer = '';
|
|
139
|
+
this.socket.setEncoding('utf8');
|
|
140
|
+
this.socket.on('data', (data) => {
|
|
141
|
+
this.socket.buffer += data;
|
|
142
|
+
this._process_buffer(this.socket);
|
|
143
|
+
});
|
|
144
|
+
this.socket.on('close', () => {
|
|
145
|
+
console.log('Disconnected from JSON Server');
|
|
146
|
+
});
|
|
147
|
+
this.socket.on('error', (err) => {
|
|
148
|
+
console.error('Socket error:', err);
|
|
149
|
+
this.socket.destroy();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Sends a JSON message to the server.
|
|
154
|
+
* @param {Object} obj - The JSON object to send.
|
|
155
|
+
*/
|
|
156
|
+
message(obj) {
|
|
157
|
+
const json = JSON.stringify(obj);
|
|
158
|
+
const length = json.length.toString().padStart(4, '0'); // 4-digit length prefix
|
|
159
|
+
this.socket.write(length + json);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Closes the client connection.
|
|
163
|
+
*/
|
|
164
|
+
close() {
|
|
165
|
+
this.socket.end();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Exports.
|
|
169
|
+
export default { Server, Client };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Daan van den Bergh
|
|
3
|
+
* @copyright © 2022 - 2025 Daan van den Bergh.
|
|
4
|
+
*/
|
|
5
|
+
import * as nodemailer from "nodemailer";
|
|
6
|
+
import * as vlib from "@vandenberghinc/vlib";
|
|
7
|
+
import { Readable } from "stream";
|
|
8
|
+
import { Url } from "url";
|
|
9
|
+
import * as UI from "./ui.js";
|
|
10
|
+
/**
|
|
11
|
+
* The mail class, used to send emails via SMTP.
|
|
12
|
+
*
|
|
13
|
+
* @note This class is initialized under server property `mail` when the server is started with the `smtp` option.
|
|
14
|
+
*
|
|
15
|
+
* @nav Plugins
|
|
16
|
+
* @docs
|
|
17
|
+
*/
|
|
18
|
+
export declare class Mail {
|
|
19
|
+
/** the smpt mailer. */
|
|
20
|
+
private smtp;
|
|
21
|
+
/** the smtp sender address. */
|
|
22
|
+
sender: Mail.Address;
|
|
23
|
+
/** the default mail style. */
|
|
24
|
+
style: Mail.Style;
|
|
25
|
+
/** construct a new server instance. */
|
|
26
|
+
constructor({ smtp, style, }: Mail.Opts);
|
|
27
|
+
/**
|
|
28
|
+
* send one or multiple mails.
|
|
29
|
+
*
|
|
30
|
+
* @note ensure SPF/DKIM are configured when sending attachments.
|
|
31
|
+
* @returns resolves/rejects when the mail has been sent.
|
|
32
|
+
*
|
|
33
|
+
* @param sender optional sender override.
|
|
34
|
+
* @param recipients recipient addresses.
|
|
35
|
+
* @param subject subject line.
|
|
36
|
+
* @param body html string or `UI.MailElement`.
|
|
37
|
+
* @param attachments supported inputs (paths, backend model, REST model, or nodemailer attachment).
|
|
38
|
+
* @param max_attachments limit on number of attachments; -1 disables.
|
|
39
|
+
* @param max_attachment_size max size (bytes) per attachment; -1 disables.
|
|
40
|
+
* @param max_attachments_size max total size (bytes) across attachments; -1 disables.
|
|
41
|
+
*
|
|
42
|
+
* @docs
|
|
43
|
+
*/
|
|
44
|
+
send({ sender, recipients, subject, body, attachments, max_attachments, max_attachment_size, max_attachments_size, allow_untrusted_urls, }: {
|
|
45
|
+
sender?: Mail.Address;
|
|
46
|
+
recipients?: Mail.Address[];
|
|
47
|
+
subject?: string;
|
|
48
|
+
body?: string | UI.MailElement;
|
|
49
|
+
attachments?: Mail.Attachment.Any[];
|
|
50
|
+
} & Mail.Attachment.Limits): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* convert a single generic attachment input into a nodemailer attachment.
|
|
53
|
+
*/
|
|
54
|
+
private build_attachment;
|
|
55
|
+
/** returns true when url starts with http:// or https:// */
|
|
56
|
+
private is_http_url;
|
|
57
|
+
/**
|
|
58
|
+
* normalize and validate a mixed attachment input into nodemailer attachments.
|
|
59
|
+
* @param input mixed list of attachments.
|
|
60
|
+
* @param limits size/count validation limits.
|
|
61
|
+
* @returns normalized nodemailer attachments.
|
|
62
|
+
* @throws {ExternalError} when limits are exceeded.
|
|
63
|
+
*/
|
|
64
|
+
private normalize_and_validate_attachments;
|
|
65
|
+
/**
|
|
66
|
+
* measure the on-wire payload size (approx) of a nodemailer attachment content.
|
|
67
|
+
* note: if `encoding: "base64"` is set, we decode to compute raw byte size.
|
|
68
|
+
*/
|
|
69
|
+
private measure_attachment_bytes;
|
|
70
|
+
/**
|
|
71
|
+
* normalize a base64 or url-safe base64 string to standard base64 (no decoding).
|
|
72
|
+
* trims whitespace and converts url-safe chars.
|
|
73
|
+
*/
|
|
74
|
+
private normalize_base64;
|
|
75
|
+
/**
|
|
76
|
+
* optional content headers for charset/compression hints.
|
|
77
|
+
* email clients usually ignore custom headers; added for traceability.
|
|
78
|
+
*/
|
|
79
|
+
private build_content_headers;
|
|
80
|
+
}
|
|
81
|
+
/** nested types for the mail module. */
|
|
82
|
+
export declare namespace Mail {
|
|
83
|
+
/** a mail address, either a string or an array of [name, email]. */
|
|
84
|
+
type Address = string | [string, string];
|
|
85
|
+
/** options for the smtp mailer. */
|
|
86
|
+
interface Opts {
|
|
87
|
+
/**
|
|
88
|
+
* the smtp nodemailer arguments object.
|
|
89
|
+
* more information can be found at the nodemailer documentation.
|
|
90
|
+
*/
|
|
91
|
+
smtp: {
|
|
92
|
+
/** the smtp sender address; either a string email, e.g. `your@email.com`, or`[name, email]`. */
|
|
93
|
+
sender: Address;
|
|
94
|
+
/** the mail server's host address. */
|
|
95
|
+
host?: string;
|
|
96
|
+
/** the mail server's port. */
|
|
97
|
+
port?: number;
|
|
98
|
+
/** enable secure options. */
|
|
99
|
+
secure?: boolean;
|
|
100
|
+
/** the authentication settings. */
|
|
101
|
+
auth?: {
|
|
102
|
+
/** the email used for authentication. */
|
|
103
|
+
user: string;
|
|
104
|
+
/** the password used for authentication. */
|
|
105
|
+
pass: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* the smtp `nodemailer.createTransport` argument that overrides the other {@link Mail.Opts.smtp} options.
|
|
109
|
+
* use this to supply vendor-specific transport options.
|
|
110
|
+
*/
|
|
111
|
+
override?: nodemailer.TransportOptions;
|
|
112
|
+
};
|
|
113
|
+
/** the default mail style. */
|
|
114
|
+
style?: Style;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* style tokens used to theme automatically generated emails.
|
|
118
|
+
*/
|
|
119
|
+
interface Style {
|
|
120
|
+
/** the font family. */
|
|
121
|
+
font: string;
|
|
122
|
+
/** the title foreground color. */
|
|
123
|
+
title_fg: string;
|
|
124
|
+
/** the subtitle foreground color. */
|
|
125
|
+
subtitle_fg: string;
|
|
126
|
+
/** the body text foreground color. */
|
|
127
|
+
text_fg: string;
|
|
128
|
+
/** the foreground color used for buttons. */
|
|
129
|
+
button_fg: string;
|
|
130
|
+
/** the footer foreground color. */
|
|
131
|
+
footer_fg: string;
|
|
132
|
+
/** page background color. */
|
|
133
|
+
bg: string;
|
|
134
|
+
/** widget background color. */
|
|
135
|
+
widget_bg: string;
|
|
136
|
+
/** widget border color. */
|
|
137
|
+
widget_border: string;
|
|
138
|
+
/** button background color. */
|
|
139
|
+
button_bg: string;
|
|
140
|
+
/** divider color. */
|
|
141
|
+
divider_bg: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* stable backend attachment model.
|
|
145
|
+
* mirrors the frontend Attachment; provide either raw `bytes` or `{ content, encoding }`.
|
|
146
|
+
* encoding is only used when `content` is a string.
|
|
147
|
+
*/
|
|
148
|
+
interface Attachment {
|
|
149
|
+
/** file or directory name. */
|
|
150
|
+
name: string;
|
|
151
|
+
/** path relative to a logical root (optional). */
|
|
152
|
+
path?: string;
|
|
153
|
+
/** mime type of the data. */
|
|
154
|
+
mime_type?: string;
|
|
155
|
+
/** charset used for text decoding (if applicable). */
|
|
156
|
+
charset?: string;
|
|
157
|
+
/** raw bytes buffer. */
|
|
158
|
+
bytes?: Buffer | Uint8Array;
|
|
159
|
+
/** textual payload to be decoded using `encoding`. */
|
|
160
|
+
content?: string;
|
|
161
|
+
/** encoding used to decode `content` into bytes (e.g. base64, hex, utf8, binary, latin1). */
|
|
162
|
+
encoding?: "base64" | "hex" | "utf8" | "utf-8" | "binary" | "latin1";
|
|
163
|
+
/** whether bytes are gzip-compressed (metadata only). */
|
|
164
|
+
compressed?: boolean;
|
|
165
|
+
}
|
|
166
|
+
/** Nested attachment types. */
|
|
167
|
+
namespace Attachment {
|
|
168
|
+
/** The possible encodings. */
|
|
169
|
+
type Encoding = "base64" | "hex" | "utf8" | "utf-8" | "binary" | "latin1";
|
|
170
|
+
const encodings: Set<Encoding>;
|
|
171
|
+
/** Attachment validation limits. */
|
|
172
|
+
interface Limits {
|
|
173
|
+
/** Maximum number of attachments allowed (unset means no limit). */
|
|
174
|
+
max_attachments?: number;
|
|
175
|
+
/** Maximum size in bytes per attachment (unset means no limit). */
|
|
176
|
+
max_attachment_size?: number;
|
|
177
|
+
/** Maximum cumulative size in bytes across all attachments (unset means no limit). */
|
|
178
|
+
max_attachments_size?: number;
|
|
179
|
+
/** Allow loading http/https urls as attachments (default: false). */
|
|
180
|
+
allow_untrusted_urls?: boolean;
|
|
181
|
+
}
|
|
182
|
+
/** Type guard. */
|
|
183
|
+
function is(a: any): a is Attachment;
|
|
184
|
+
/**
|
|
185
|
+
* user-friendly REST attachment payload.
|
|
186
|
+
* choose one of:
|
|
187
|
+
* - `{ content, encoding }` for inline payloads (encoding: base64/hex/utf8/binary/latin1).
|
|
188
|
+
* - `{ url }` for http(s) or data: urls (streamed by nodemailer).
|
|
189
|
+
*/
|
|
190
|
+
interface RestAPI {
|
|
191
|
+
/** file name to display to the recipient. */
|
|
192
|
+
name: string;
|
|
193
|
+
/** relative path inside a bundle/archive (metadata only, optional). */
|
|
194
|
+
path?: string;
|
|
195
|
+
/** mime type of the data. */
|
|
196
|
+
mime_type?: string;
|
|
197
|
+
/** charset used for text decoding (if applicable). */
|
|
198
|
+
charset?: string;
|
|
199
|
+
/** whether the provided bytes are gzip-compressed (metadata only). */
|
|
200
|
+
compressed?: boolean;
|
|
201
|
+
/** textual payload to be decoded using `encoding`. */
|
|
202
|
+
content?: string;
|
|
203
|
+
/** encoding used to decode `content` into bytes. */
|
|
204
|
+
encoding?: "base64" | "hex" | "utf8" | "utf-8" | "binary" | "latin1";
|
|
205
|
+
/** http(s) url or data: url to stream. */
|
|
206
|
+
url?: string;
|
|
207
|
+
}
|
|
208
|
+
namespace RestAPI {
|
|
209
|
+
/** Type guard. */
|
|
210
|
+
function is(a: any): a is RestAPI;
|
|
211
|
+
/** Schema validation. */
|
|
212
|
+
const Schema: vlib.Schema.Opts;
|
|
213
|
+
}
|
|
214
|
+
/** A native nodemailer attachment. */
|
|
215
|
+
interface Native {
|
|
216
|
+
/** String, Buffer or a Stream contents for the attachment */
|
|
217
|
+
content?: string | Buffer | Readable | undefined;
|
|
218
|
+
/** path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) */
|
|
219
|
+
path?: string | Url | undefined;
|
|
220
|
+
/** filename to be reported as the name of the attached file, use of unicode is allowed. If you do not want to use a filename, set this value as false, otherwise a filename is generated automatically */
|
|
221
|
+
filename?: string | false | undefined;
|
|
222
|
+
/** optional content id for using inline images in HTML message source. Using cid sets the default contentDisposition to 'inline' and moves the attachment into a multipart/related mime node, so use it only if you actually want to use this attachment as an embedded image */
|
|
223
|
+
cid?: string | undefined;
|
|
224
|
+
/** If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: base64, hex, binary etc. Useful if you want to use binary attachments in a JSON formatted e-mail object */
|
|
225
|
+
encoding?: string | undefined;
|
|
226
|
+
/** optional content type for the attachment, if not set will be derived from the filename property */
|
|
227
|
+
contentType?: string | undefined;
|
|
228
|
+
/** optional transfer encoding for the attachment, if not set it will be derived from the contentType property. Example values: quoted-printable, base64. If it is unset then base64 encoding is used for the attachment. If it is set to false then previous default applies (base64 for most, 7bit for text). */
|
|
229
|
+
contentTransferEncoding?: "7bit" | "base64" | "quoted-printable" | false | undefined;
|
|
230
|
+
/** optional content disposition type for the attachment, defaults to ‘attachment’ */
|
|
231
|
+
contentDisposition?: "attachment" | "inline" | undefined;
|
|
232
|
+
/** is an object of additional headers */
|
|
233
|
+
headers?: {
|
|
234
|
+
[key: string]: string | string[] | {
|
|
235
|
+
prepared: boolean;
|
|
236
|
+
value: string;
|
|
237
|
+
};
|
|
238
|
+
} | Array<{
|
|
239
|
+
key: string;
|
|
240
|
+
value: string;
|
|
241
|
+
}>;
|
|
242
|
+
/** an optional value that overrides entire node content in the mime message. If used then all other options set for this node are ignored. */
|
|
243
|
+
raw?: string | Buffer | Readable | Native | undefined;
|
|
244
|
+
}
|
|
245
|
+
/** Nested native types. */
|
|
246
|
+
namespace Native {
|
|
247
|
+
/** Simple type guard. */
|
|
248
|
+
function is(a: any): a is Native;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Unified attachment input accepted by {@link Mail.send}.
|
|
252
|
+
*/
|
|
253
|
+
type Any = string | vlib.Path | Attachment | RestAPI | Native;
|
|
254
|
+
}
|
|
255
|
+
}
|