@vandenberghinc/volt 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/assets/admin/admin.png +0 -0
- package/frontend/assets/admin/password.webp +0 -0
- package/frontend/assets/icons/arrow.v1.webp +0 -0
- package/frontend/assets/icons/copy.webp +0 -0
- package/frontend/assets/payments/arrow.long.webp +0 -0
- package/frontend/assets/payments/arrow.long2.webp +0 -0
- package/frontend/assets/payments/cancelled.webp +0 -0
- package/frontend/assets/payments/check.sign.webp +0 -0
- package/frontend/assets/payments/check.webp +0 -0
- package/frontend/assets/payments/close.webp +0 -0
- package/frontend/assets/payments/error.webp +0 -0
- package/frontend/assets/payments/exclamation.webp +0 -0
- package/frontend/assets/payments/minus.webp +0 -0
- package/frontend/assets/payments/party.webp +0 -0
- package/frontend/assets/payments/plus.webp +0 -0
- package/frontend/assets/payments/shopping_cart.webp +0 -0
- package/frontend/assets/payments/trash.webp +0 -0
- package/package.json +6 -2
- package/.libris/config.json +0 -82
- package/backend/dist/cjs/backend/src/blacklist.d.ts +0 -12
- package/backend/dist/cjs/backend/src/blacklist.js +0 -78
- package/backend/dist/cjs/backend/src/cli.d.ts +0 -2
- package/backend/dist/cjs/backend/src/cli.js +0 -198
- package/backend/dist/cjs/backend/src/database/collection.d.ts +0 -1765
- package/backend/dist/cjs/backend/src/database/collection.js +0 -3301
- package/backend/dist/cjs/backend/src/database/database.d.ts +0 -92
- package/backend/dist/cjs/backend/src/database/database.js +0 -170
- package/backend/dist/cjs/backend/src/database/document.d.ts +0 -1
- package/backend/dist/cjs/backend/src/database/document.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/filters.d.ts +0 -6
- package/backend/dist/cjs/backend/src/database/filters/filters.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_filter.d.ts +0 -223
- package/backend/dist/cjs/backend/src/database/filters/strict_filter.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.d.ts +0 -1
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.js +0 -443
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.d.ts +0 -1
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.d.ts +0 -50
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.d.ts +0 -76
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.d.ts +0 -75
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.d.ts +0 -219
- package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.d.ts +0 -165
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.js +0 -15
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.d.ts +0 -5
- package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.js +0 -355
- package/backend/dist/cjs/backend/src/database/flatten.d.ts +0 -78
- package/backend/dist/cjs/backend/src/database/flatten.js +0 -53
- package/backend/dist/cjs/backend/src/database/flatten_test.d.ts +0 -1
- package/backend/dist/cjs/backend/src/database/flatten_test.js +0 -175
- package/backend/dist/cjs/backend/src/database/quota/quoata_v2.d.ts +0 -533
- package/backend/dist/cjs/backend/src/database/quota/quoata_v2.js +0 -1046
- package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +0 -551
- package/backend/dist/cjs/backend/src/database/quota/quota.js +0 -1108
- package/backend/dist/cjs/backend/src/database/quota/quota_v1.d.ts +0 -534
- package/backend/dist/cjs/backend/src/database/quota/quota_v1.js +0 -1087
- package/backend/dist/cjs/backend/src/database/quota/safe_int.d.ts +0 -412
- package/backend/dist/cjs/backend/src/database/quota/safe_int.js +0 -745
- package/backend/dist/cjs/backend/src/endpoint.d.ts +0 -346
- package/backend/dist/cjs/backend/src/endpoint.js +0 -468
- package/backend/dist/cjs/backend/src/errors/index.d.ts +0 -7
- package/backend/dist/cjs/backend/src/errors/index.js +0 -25
- package/backend/dist/cjs/backend/src/errors/internal_external.d.ts +0 -52
- package/backend/dist/cjs/backend/src/errors/internal_external.js +0 -95
- package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +0 -41
- package/backend/dist/cjs/backend/src/errors/invalid_usage_error.js +0 -47
- package/backend/dist/cjs/backend/src/errors/system_error.d.ts +0 -261
- package/backend/dist/cjs/backend/src/errors/system_error.js +0 -436
- package/backend/dist/cjs/backend/src/events.d.ts +0 -97
- package/backend/dist/cjs/backend/src/events.js +0 -15
- package/backend/dist/cjs/backend/src/frontend.d.ts +0 -11
- package/backend/dist/cjs/backend/src/frontend.js +0 -37
- package/backend/dist/cjs/backend/src/image_endpoint.d.ts +0 -44
- package/backend/dist/cjs/backend/src/image_endpoint.js +0 -185
- package/backend/dist/cjs/backend/src/index.d.ts +0 -23
- package/backend/dist/cjs/backend/src/index.js +0 -70
- package/backend/dist/cjs/backend/src/logger.d.ts +0 -5
- package/backend/dist/cjs/backend/src/logger.js +0 -15
- package/backend/dist/cjs/backend/src/meta.d.ts +0 -112
- package/backend/dist/cjs/backend/src/meta.js +0 -181
- package/backend/dist/cjs/backend/src/payments/paddle.d.ts +0 -329
- package/backend/dist/cjs/backend/src/payments/paddle.js +0 -1996
- package/backend/dist/cjs/backend/src/payments/stripe/checkout.d.ts +0 -113
- package/backend/dist/cjs/backend/src/payments/stripe/checkout.js +0 -295
- package/backend/dist/cjs/backend/src/payments/stripe/customers.d.ts +0 -17
- package/backend/dist/cjs/backend/src/payments/stripe/customers.js +0 -164
- package/backend/dist/cjs/backend/src/payments/stripe/error.d.ts +0 -74
- package/backend/dist/cjs/backend/src/payments/stripe/error.js +0 -64
- package/backend/dist/cjs/backend/src/payments/stripe/events.d.ts +0 -155
- package/backend/dist/cjs/backend/src/payments/stripe/events.js +0 -15
- package/backend/dist/cjs/backend/src/payments/stripe/meters.d.ts +0 -105
- package/backend/dist/cjs/backend/src/payments/stripe/meters.js +0 -230
- package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.d.ts +0 -58
- package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.js +0 -109
- package/backend/dist/cjs/backend/src/payments/stripe/products.d.ts +0 -519
- package/backend/dist/cjs/backend/src/payments/stripe/products.js +0 -650
- package/backend/dist/cjs/backend/src/payments/stripe/stripe.d.ts +0 -215
- package/backend/dist/cjs/backend/src/payments/stripe/stripe.js +0 -468
- package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.d.ts +0 -172
- package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.js +0 -557
- package/backend/dist/cjs/backend/src/payments/stripe/utils.d.ts +0 -63
- package/backend/dist/cjs/backend/src/payments/stripe/utils.js +0 -118
- package/backend/dist/cjs/backend/src/payments/stripe/webhooks.d.ts +0 -105
- package/backend/dist/cjs/backend/src/payments/stripe/webhooks.js +0 -627
- package/backend/dist/cjs/backend/src/plugins/browser.d.ts +0 -1
- package/backend/dist/cjs/backend/src/plugins/browser.js +0 -15
- package/backend/dist/cjs/backend/src/plugins/communication.d.ts +0 -70
- package/backend/dist/cjs/backend/src/plugins/communication.js +0 -196
- package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +0 -255
- package/backend/dist/cjs/backend/src/plugins/mail/mail.js +0 -381
- package/backend/dist/cjs/backend/src/plugins/mail/ui.d.ts +0 -297
- package/backend/dist/cjs/backend/src/plugins/mail/ui.js +0 -1370
- package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +0 -1
- package/backend/dist/cjs/backend/src/plugins/pdf.js +0 -1456
- package/backend/dist/cjs/backend/src/plugins/thread_monitor.d.ts +0 -18
- package/backend/dist/cjs/backend/src/plugins/thread_monitor.js +0 -116
- package/backend/dist/cjs/backend/src/rate_limit.d.ts +0 -148
- package/backend/dist/cjs/backend/src/rate_limit.js +0 -543
- package/backend/dist/cjs/backend/src/route.d.ts +0 -39
- package/backend/dist/cjs/backend/src/route.js +0 -172
- package/backend/dist/cjs/backend/src/server.d.ts +0 -502
- package/backend/dist/cjs/backend/src/server.js +0 -1713
- package/backend/dist/cjs/backend/src/server.old.d.ts +0 -594
- package/backend/dist/cjs/backend/src/server.old.js +0 -2058
- package/backend/dist/cjs/backend/src/splash_screen.d.ts +0 -93
- package/backend/dist/cjs/backend/src/splash_screen.js +0 -119
- package/backend/dist/cjs/backend/src/status.d.ts +0 -89
- package/backend/dist/cjs/backend/src/status.js +0 -211
- package/backend/dist/cjs/backend/src/stream.d.ts +0 -494
- package/backend/dist/cjs/backend/src/stream.js +0 -1370
- package/backend/dist/cjs/backend/src/users.d.ts +0 -926
- package/backend/dist/cjs/backend/src/users.js +0 -2223
- package/backend/dist/cjs/backend/src/utils.d.ts +0 -22
- package/backend/dist/cjs/backend/src/utils.js +0 -626
- package/backend/dist/cjs/backend/src/view.d.ts +0 -115
- package/backend/dist/cjs/backend/src/view.js +0 -519
- package/backend/dist/cjs/backend/src/vinc.d.ts +0 -6
- package/backend/dist/cjs/backend/src/vinc.js +0 -40
- package/backend/dist/cjs/backend/src/volt.d.ts +0 -24
- package/backend/dist/cjs/backend/src/volt.js +0 -72
- package/backend/dist/cjs/frontend/src/modules/request.d.ts +0 -70
- package/backend/dist/cjs/frontend/src/modules/request.js +0 -99
- package/backend/dist/cjs/package.json +0 -1
- package/backend/dist/esm/backend/src/blacklist.d.ts +0 -12
- package/backend/dist/esm/backend/src/blacklist.js +0 -52
- package/backend/dist/esm/backend/src/cli.d.ts +0 -2
- package/backend/dist/esm/backend/src/cli.js +0 -211
- package/backend/dist/esm/backend/src/database/collection.d.ts +0 -1765
- package/backend/dist/esm/backend/src/database/collection.js +0 -3779
- package/backend/dist/esm/backend/src/database/database.d.ts +0 -92
- package/backend/dist/esm/backend/src/database/database.js +0 -214
- package/backend/dist/esm/backend/src/database/document.d.ts +0 -1
- package/backend/dist/esm/backend/src/database/document.js +0 -558
- package/backend/dist/esm/backend/src/database/filters/filters.d.ts +0 -6
- package/backend/dist/esm/backend/src/database/filters/filters.js +0 -1
- package/backend/dist/esm/backend/src/database/filters/strict_filter.d.ts +0 -223
- package/backend/dist/esm/backend/src/database/filters/strict_filter.js +0 -3
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test.d.ts +0 -1
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test.js +0 -505
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.d.ts +0 -1
- package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.js +0 -712
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.d.ts +0 -50
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.js +0 -5
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.d.ts +0 -76
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.js +0 -44
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.d.ts +0 -75
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.js +0 -5
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.d.ts +0 -219
- package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.js +0 -1
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter.d.ts +0 -165
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter.js +0 -5
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.d.ts +0 -5
- package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.js +0 -415
- package/backend/dist/esm/backend/src/database/flatten.d.ts +0 -78
- package/backend/dist/esm/backend/src/database/flatten.js +0 -22
- package/backend/dist/esm/backend/src/database/flatten_test.d.ts +0 -1
- package/backend/dist/esm/backend/src/database/flatten_test.js +0 -174
- package/backend/dist/esm/backend/src/database/quota/quoata_v2.d.ts +0 -533
- package/backend/dist/esm/backend/src/database/quota/quoata_v2.js +0 -1155
- package/backend/dist/esm/backend/src/database/quota/quota.d.ts +0 -551
- package/backend/dist/esm/backend/src/database/quota/quota.js +0 -1219
- package/backend/dist/esm/backend/src/database/quota/quota_v1.d.ts +0 -534
- package/backend/dist/esm/backend/src/database/quota/quota_v1.js +0 -1242
- package/backend/dist/esm/backend/src/database/quota/safe_int.d.ts +0 -412
- package/backend/dist/esm/backend/src/database/quota/safe_int.js +0 -810
- package/backend/dist/esm/backend/src/endpoint.d.ts +0 -346
- package/backend/dist/esm/backend/src/endpoint.js +0 -479
- package/backend/dist/esm/backend/src/errors/index.d.ts +0 -7
- package/backend/dist/esm/backend/src/errors/index.js +0 -7
- package/backend/dist/esm/backend/src/errors/internal_external.d.ts +0 -52
- package/backend/dist/esm/backend/src/errors/internal_external.js +0 -86
- package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +0 -41
- package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +0 -33
- package/backend/dist/esm/backend/src/errors/system_error.d.ts +0 -261
- package/backend/dist/esm/backend/src/errors/system_error.js +0 -444
- package/backend/dist/esm/backend/src/events.d.ts +0 -97
- package/backend/dist/esm/backend/src/events.js +0 -5
- package/backend/dist/esm/backend/src/frontend.d.ts +0 -11
- package/backend/dist/esm/backend/src/frontend.js +0 -12
- package/backend/dist/esm/backend/src/image_endpoint.d.ts +0 -44
- package/backend/dist/esm/backend/src/image_endpoint.js +0 -196
- package/backend/dist/esm/backend/src/index.d.ts +0 -23
- package/backend/dist/esm/backend/src/index.js +0 -26
- package/backend/dist/esm/backend/src/logger.d.ts +0 -5
- package/backend/dist/esm/backend/src/logger.js +0 -8
- package/backend/dist/esm/backend/src/meta.d.ts +0 -112
- package/backend/dist/esm/backend/src/meta.js +0 -152
- package/backend/dist/esm/backend/src/payments/paddle.d.ts +0 -329
- package/backend/dist/esm/backend/src/payments/paddle.js +0 -2276
- package/backend/dist/esm/backend/src/payments/stripe/checkout.d.ts +0 -113
- package/backend/dist/esm/backend/src/payments/stripe/checkout.js +0 -356
- package/backend/dist/esm/backend/src/payments/stripe/customers.d.ts +0 -17
- package/backend/dist/esm/backend/src/payments/stripe/customers.js +0 -193
- package/backend/dist/esm/backend/src/payments/stripe/error.d.ts +0 -74
- package/backend/dist/esm/backend/src/payments/stripe/error.js +0 -51
- package/backend/dist/esm/backend/src/payments/stripe/events.d.ts +0 -155
- package/backend/dist/esm/backend/src/payments/stripe/events.js +0 -5
- package/backend/dist/esm/backend/src/payments/stripe/meters.d.ts +0 -105
- package/backend/dist/esm/backend/src/payments/stripe/meters.js +0 -318
- package/backend/dist/esm/backend/src/payments/stripe/payment_methods.d.ts +0 -58
- package/backend/dist/esm/backend/src/payments/stripe/payment_methods.js +0 -135
- package/backend/dist/esm/backend/src/payments/stripe/products.d.ts +0 -519
- package/backend/dist/esm/backend/src/payments/stripe/products.js +0 -896
- package/backend/dist/esm/backend/src/payments/stripe/stripe.d.ts +0 -215
- package/backend/dist/esm/backend/src/payments/stripe/stripe.js +0 -464
- package/backend/dist/esm/backend/src/payments/stripe/subscriptions.d.ts +0 -172
- package/backend/dist/esm/backend/src/payments/stripe/subscriptions.js +0 -754
- package/backend/dist/esm/backend/src/payments/stripe/utils.d.ts +0 -63
- package/backend/dist/esm/backend/src/payments/stripe/utils.js +0 -131
- package/backend/dist/esm/backend/src/payments/stripe/webhooks.d.ts +0 -105
- package/backend/dist/esm/backend/src/payments/stripe/webhooks.js +0 -752
- package/backend/dist/esm/backend/src/plugins/browser.d.ts +0 -1
- package/backend/dist/esm/backend/src/plugins/browser.js +0 -170
- package/backend/dist/esm/backend/src/plugins/communication.d.ts +0 -70
- package/backend/dist/esm/backend/src/plugins/communication.js +0 -169
- package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +0 -255
- package/backend/dist/esm/backend/src/plugins/mail/mail.js +0 -396
- package/backend/dist/esm/backend/src/plugins/mail/ui.d.ts +0 -297
- package/backend/dist/esm/backend/src/plugins/mail/ui.js +0 -1400
- package/backend/dist/esm/backend/src/plugins/pdf.d.ts +0 -1
- package/backend/dist/esm/backend/src/plugins/pdf.js +0 -1694
- package/backend/dist/esm/backend/src/plugins/thread_monitor.d.ts +0 -18
- package/backend/dist/esm/backend/src/plugins/thread_monitor.js +0 -120
- package/backend/dist/esm/backend/src/rate_limit.d.ts +0 -148
- package/backend/dist/esm/backend/src/rate_limit.js +0 -667
- package/backend/dist/esm/backend/src/route.d.ts +0 -39
- package/backend/dist/esm/backend/src/route.js +0 -222
- package/backend/dist/esm/backend/src/server.d.ts +0 -502
- package/backend/dist/esm/backend/src/server.js +0 -2034
- package/backend/dist/esm/backend/src/server.old.d.ts +0 -594
- package/backend/dist/esm/backend/src/server.old.js +0 -2630
- package/backend/dist/esm/backend/src/splash_screen.d.ts +0 -93
- package/backend/dist/esm/backend/src/splash_screen.js +0 -156
- package/backend/dist/esm/backend/src/status.d.ts +0 -89
- package/backend/dist/esm/backend/src/status.js +0 -213
- package/backend/dist/esm/backend/src/stream.d.ts +0 -494
- package/backend/dist/esm/backend/src/stream.js +0 -1611
- package/backend/dist/esm/backend/src/users.d.ts +0 -926
- package/backend/dist/esm/backend/src/users.js +0 -2423
- package/backend/dist/esm/backend/src/utils.d.ts +0 -22
- package/backend/dist/esm/backend/src/utils.js +0 -463
- package/backend/dist/esm/backend/src/view.d.ts +0 -115
- package/backend/dist/esm/backend/src/view.js +0 -584
- package/backend/dist/esm/backend/src/vinc.d.ts +0 -6
- package/backend/dist/esm/backend/src/vinc.js +0 -6
- package/backend/dist/esm/backend/src/volt.d.ts +0 -24
- package/backend/dist/esm/backend/src/volt.js +0 -27
- package/backend/dist/esm/frontend/src/modules/request.d.ts +0 -70
- package/backend/dist/esm/frontend/src/modules/request.js +0 -117
- package/backend/old/file_watcher.ts +0 -359
- package/backend/old/request.deprc.js +0 -626
- package/backend/old/response.deprc.js +0 -354
- package/frontend/dist/backend/src/database/collection.d.ts +0 -1765
- package/frontend/dist/backend/src/database/collection.js +0 -3779
- package/frontend/dist/backend/src/database/database.d.ts +0 -92
- package/frontend/dist/backend/src/database/database.js +0 -214
- package/frontend/dist/backend/src/database/filters/filters.d.ts +0 -6
- package/frontend/dist/backend/src/database/filters/filters.js +0 -1
- package/frontend/dist/backend/src/database/filters/strict_filter.d.ts +0 -223
- package/frontend/dist/backend/src/database/filters/strict_filter.js +0 -3
- package/frontend/dist/backend/src/database/filters/strict_update_filter.d.ts +0 -165
- package/frontend/dist/backend/src/database/filters/strict_update_filter.js +0 -5
- package/frontend/dist/backend/src/database/flatten.d.ts +0 -78
- package/frontend/dist/backend/src/database/flatten.js +0 -22
- package/frontend/dist/backend/src/endpoint.d.ts +0 -346
- package/frontend/dist/backend/src/endpoint.js +0 -479
- package/frontend/dist/backend/src/errors/index.d.ts +0 -7
- package/frontend/dist/backend/src/errors/index.js +0 -7
- package/frontend/dist/backend/src/errors/internal_external.d.ts +0 -52
- package/frontend/dist/backend/src/errors/internal_external.js +0 -86
- package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +0 -41
- package/frontend/dist/backend/src/errors/invalid_usage_error.js +0 -33
- package/frontend/dist/backend/src/errors/system_error.d.ts +0 -261
- package/frontend/dist/backend/src/errors/system_error.js +0 -444
- package/frontend/dist/backend/src/events.d.ts +0 -97
- package/frontend/dist/backend/src/events.js +0 -5
- package/frontend/dist/backend/src/frontend.d.ts +0 -11
- package/frontend/dist/backend/src/frontend.js +0 -12
- package/frontend/dist/backend/src/image_endpoint.d.ts +0 -44
- package/frontend/dist/backend/src/image_endpoint.js +0 -196
- package/frontend/dist/backend/src/meta.d.ts +0 -112
- package/frontend/dist/backend/src/meta.js +0 -152
- package/frontend/dist/backend/src/payments/paddle.d.ts +0 -329
- package/frontend/dist/backend/src/payments/paddle.js +0 -2276
- package/frontend/dist/backend/src/payments/stripe/checkout.d.ts +0 -113
- package/frontend/dist/backend/src/payments/stripe/checkout.js +0 -356
- package/frontend/dist/backend/src/payments/stripe/customers.d.ts +0 -17
- package/frontend/dist/backend/src/payments/stripe/customers.js +0 -193
- package/frontend/dist/backend/src/payments/stripe/error.d.ts +0 -74
- package/frontend/dist/backend/src/payments/stripe/error.js +0 -51
- package/frontend/dist/backend/src/payments/stripe/events.d.ts +0 -155
- package/frontend/dist/backend/src/payments/stripe/events.js +0 -5
- package/frontend/dist/backend/src/payments/stripe/meters.d.ts +0 -105
- package/frontend/dist/backend/src/payments/stripe/meters.js +0 -318
- package/frontend/dist/backend/src/payments/stripe/payment_methods.d.ts +0 -58
- package/frontend/dist/backend/src/payments/stripe/payment_methods.js +0 -135
- package/frontend/dist/backend/src/payments/stripe/products.d.ts +0 -519
- package/frontend/dist/backend/src/payments/stripe/products.js +0 -896
- package/frontend/dist/backend/src/payments/stripe/stripe.d.ts +0 -215
- package/frontend/dist/backend/src/payments/stripe/stripe.js +0 -464
- package/frontend/dist/backend/src/payments/stripe/subscriptions.d.ts +0 -172
- package/frontend/dist/backend/src/payments/stripe/subscriptions.js +0 -754
- package/frontend/dist/backend/src/payments/stripe/utils.d.ts +0 -63
- package/frontend/dist/backend/src/payments/stripe/utils.js +0 -131
- package/frontend/dist/backend/src/payments/stripe/webhooks.d.ts +0 -105
- package/frontend/dist/backend/src/payments/stripe/webhooks.js +0 -752
- package/frontend/dist/backend/src/plugins/mail/mail.d.ts +0 -255
- package/frontend/dist/backend/src/plugins/mail/mail.js +0 -396
- package/frontend/dist/backend/src/plugins/mail/ui.d.ts +0 -297
- package/frontend/dist/backend/src/plugins/mail/ui.js +0 -1400
- package/frontend/dist/backend/src/rate_limit.d.ts +0 -148
- package/frontend/dist/backend/src/rate_limit.js +0 -667
- package/frontend/dist/backend/src/route.d.ts +0 -39
- package/frontend/dist/backend/src/route.js +0 -222
- package/frontend/dist/backend/src/server.d.ts +0 -502
- package/frontend/dist/backend/src/server.js +0 -2034
- package/frontend/dist/backend/src/splash_screen.d.ts +0 -93
- package/frontend/dist/backend/src/splash_screen.js +0 -156
- package/frontend/dist/backend/src/status.d.ts +0 -89
- package/frontend/dist/backend/src/status.js +0 -213
- package/frontend/dist/backend/src/stream.d.ts +0 -494
- package/frontend/dist/backend/src/stream.js +0 -1611
- package/frontend/dist/backend/src/users.d.ts +0 -926
- package/frontend/dist/backend/src/users.js +0 -2423
- package/frontend/dist/backend/src/utils.d.ts +0 -22
- package/frontend/dist/backend/src/utils.js +0 -463
- package/frontend/dist/backend/src/view.d.ts +0 -115
- package/frontend/dist/backend/src/view.js +0 -584
- package/frontend/dist/frontend/src/elements/base.d.ts +0 -3743
- package/frontend/dist/frontend/src/elements/base.js +0 -12151
- package/frontend/dist/frontend/src/elements/module.d.ts +0 -95
- package/frontend/dist/frontend/src/elements/module.js +0 -216
- package/frontend/dist/frontend/src/elements/register_element.d.ts +0 -3
- package/frontend/dist/frontend/src/elements/register_element.js +0 -22
- package/frontend/dist/frontend/src/elements/resize_query_manager.d.ts +0 -0
- package/frontend/dist/frontend/src/elements/resize_query_manager.js +0 -150
- package/frontend/dist/frontend/src/elements/types.d.ts +0 -52
- package/frontend/dist/frontend/src/elements/types.js +0 -5
- package/frontend/dist/frontend/src/index.d.ts +0 -21
- package/frontend/dist/frontend/src/index.js +0 -29
- package/frontend/dist/frontend/src/modules/attachment.d.ts +0 -126
- package/frontend/dist/frontend/src/modules/attachment.js +0 -306
- package/frontend/dist/frontend/src/modules/auth.d.ts +0 -44
- package/frontend/dist/frontend/src/modules/auth.js +0 -80
- package/frontend/dist/frontend/src/modules/color.d.ts +0 -160
- package/frontend/dist/frontend/src/modules/color.js +0 -316
- package/frontend/dist/frontend/src/modules/compression.d.ts +0 -39
- package/frontend/dist/frontend/src/modules/compression.js +0 -102
- package/frontend/dist/frontend/src/modules/cookies.d.ts +0 -44
- package/frontend/dist/frontend/src/modules/cookies.js +0 -143
- package/frontend/dist/frontend/src/modules/events.d.ts +0 -31
- package/frontend/dist/frontend/src/modules/events.js +0 -79
- package/frontend/dist/frontend/src/modules/google.d.ts +0 -23
- package/frontend/dist/frontend/src/modules/google.js +0 -52
- package/frontend/dist/frontend/src/modules/meta.d.ts +0 -14
- package/frontend/dist/frontend/src/modules/meta.js +0 -48
- package/frontend/dist/frontend/src/modules/paddle.d.ts +0 -1207
- package/frontend/dist/frontend/src/modules/paddle.js +0 -2594
- package/frontend/dist/frontend/src/modules/request.d.ts +0 -70
- package/frontend/dist/frontend/src/modules/request.js +0 -117
- package/frontend/dist/frontend/src/modules/settings.d.ts +0 -3
- package/frontend/dist/frontend/src/modules/settings.js +0 -5
- package/frontend/dist/frontend/src/modules/statics.d.ts +0 -21
- package/frontend/dist/frontend/src/modules/statics.js +0 -43
- package/frontend/dist/frontend/src/modules/stripe/cart.d.ts +0 -112
- package/frontend/dist/frontend/src/modules/stripe/cart.js +0 -321
- package/frontend/dist/frontend/src/modules/stripe/checkout.d.ts +0 -7
- package/frontend/dist/frontend/src/modules/stripe/checkout.js +0 -37
- package/frontend/dist/frontend/src/modules/stripe/index.m.d.ts +0 -6
- package/frontend/dist/frontend/src/modules/stripe/index.m.js +0 -6
- package/frontend/dist/frontend/src/modules/stripe/payments.d.ts +0 -58
- package/frontend/dist/frontend/src/modules/stripe/payments.js +0 -92
- package/frontend/dist/frontend/src/modules/support.d.ts +0 -30
- package/frontend/dist/frontend/src/modules/support.js +0 -53
- package/frontend/dist/frontend/src/modules/theme.d.ts +0 -133
- package/frontend/dist/frontend/src/modules/theme.js +0 -406
- package/frontend/dist/frontend/src/modules/themes.d.ts +0 -12
- package/frontend/dist/frontend/src/modules/themes.js +0 -22
- package/frontend/dist/frontend/src/modules/user.d.ts +0 -164
- package/frontend/dist/frontend/src/modules/user.js +0 -270
- package/frontend/dist/frontend/src/modules/utils.d.ts +0 -176
- package/frontend/dist/frontend/src/modules/utils.js +0 -569
- package/frontend/dist/frontend/src/types/gradient.d.ts +0 -29
- package/frontend/dist/frontend/src/types/gradient.js +0 -79
- package/frontend/dist/frontend/src/ui/border_button.d.ts +0 -94
- package/frontend/dist/frontend/src/ui/border_button.js +0 -228
- package/frontend/dist/frontend/src/ui/button.d.ts +0 -241
- package/frontend/dist/frontend/src/ui/button.js +0 -682
- package/frontend/dist/frontend/src/ui/canvas.d.ts +0 -138
- package/frontend/dist/frontend/src/ui/canvas.js +0 -444
- package/frontend/dist/frontend/src/ui/checkbox.d.ts +0 -74
- package/frontend/dist/frontend/src/ui/checkbox.js +0 -321
- package/frontend/dist/frontend/src/ui/code.d.ts +0 -235
- package/frontend/dist/frontend/src/ui/code.js +0 -1007
- package/frontend/dist/frontend/src/ui/context_menu.d.ts +0 -36
- package/frontend/dist/frontend/src/ui/context_menu.js +0 -205
- package/frontend/dist/frontend/src/ui/css.d.ts +0 -16
- package/frontend/dist/frontend/src/ui/css.js +0 -48
- package/frontend/dist/frontend/src/ui/divider.d.ts +0 -15
- package/frontend/dist/frontend/src/ui/divider.js +0 -78
- package/frontend/dist/frontend/src/ui/dropdown.d.ts +0 -176
- package/frontend/dist/frontend/src/ui/dropdown.js +0 -481
- package/frontend/dist/frontend/src/ui/for_each.d.ts +0 -37
- package/frontend/dist/frontend/src/ui/for_each.js +0 -92
- package/frontend/dist/frontend/src/ui/form.d.ts +0 -34
- package/frontend/dist/frontend/src/ui/form.js +0 -233
- package/frontend/dist/frontend/src/ui/frame_modes.d.ts +0 -37
- package/frontend/dist/frontend/src/ui/frame_modes.js +0 -108
- package/frontend/dist/frontend/src/ui/google_map.d.ts +0 -24
- package/frontend/dist/frontend/src/ui/google_map.js +0 -106
- package/frontend/dist/frontend/src/ui/gradient.d.ts +0 -25
- package/frontend/dist/frontend/src/ui/gradient.js +0 -131
- package/frontend/dist/frontend/src/ui/image.d.ts +0 -111
- package/frontend/dist/frontend/src/ui/image.js +0 -576
- package/frontend/dist/frontend/src/ui/input.d.ts +0 -392
- package/frontend/dist/frontend/src/ui/input.js +0 -1201
- package/frontend/dist/frontend/src/ui/link.d.ts +0 -25
- package/frontend/dist/frontend/src/ui/link.js +0 -140
- package/frontend/dist/frontend/src/ui/list.d.ts +0 -37
- package/frontend/dist/frontend/src/ui/list.js +0 -170
- package/frontend/dist/frontend/src/ui/loader_button.d.ts +0 -80
- package/frontend/dist/frontend/src/ui/loader_button.js +0 -193
- package/frontend/dist/frontend/src/ui/loaders.d.ts +0 -57
- package/frontend/dist/frontend/src/ui/loaders.js +0 -157
- package/frontend/dist/frontend/src/ui/popup.d.ts +0 -94
- package/frontend/dist/frontend/src/ui/popup.js +0 -510
- package/frontend/dist/frontend/src/ui/pseudo.d.ts +0 -44
- package/frontend/dist/frontend/src/ui/pseudo.js +0 -154
- package/frontend/dist/frontend/src/ui/scroller.d.ts +0 -105
- package/frontend/dist/frontend/src/ui/scroller.js +0 -1253
- package/frontend/dist/frontend/src/ui/slider.d.ts +0 -45
- package/frontend/dist/frontend/src/ui/slider.js +0 -217
- package/frontend/dist/frontend/src/ui/spacer.d.ts +0 -15
- package/frontend/dist/frontend/src/ui/spacer.js +0 -78
- package/frontend/dist/frontend/src/ui/span.d.ts +0 -15
- package/frontend/dist/frontend/src/ui/span.js +0 -73
- package/frontend/dist/frontend/src/ui/stack.d.ts +0 -66
- package/frontend/dist/frontend/src/ui/stack.js +0 -335
- package/frontend/dist/frontend/src/ui/steps.d.ts +0 -131
- package/frontend/dist/frontend/src/ui/steps.js +0 -308
- package/frontend/dist/frontend/src/ui/style.d.ts +0 -17
- package/frontend/dist/frontend/src/ui/style.js +0 -73
- package/frontend/dist/frontend/src/ui/switch.d.ts +0 -69
- package/frontend/dist/frontend/src/ui/switch.js +0 -357
- package/frontend/dist/frontend/src/ui/table.d.ts +0 -100
- package/frontend/dist/frontend/src/ui/table.js +0 -405
- package/frontend/dist/frontend/src/ui/tabs.d.ts +0 -111
- package/frontend/dist/frontend/src/ui/tabs.js +0 -424
- package/frontend/dist/frontend/src/ui/text.d.ts +0 -15
- package/frontend/dist/frontend/src/ui/text.js +0 -83
- package/frontend/dist/frontend/src/ui/title.d.ts +0 -91
- package/frontend/dist/frontend/src/ui/title.js +0 -272
- package/frontend/dist/frontend/src/ui/ui.d.ts +0 -35
- package/frontend/dist/frontend/src/ui/ui.js +0 -38
- package/frontend/dist/frontend/src/ui/view.d.ts +0 -15
- package/frontend/dist/frontend/src/ui/view.js +0 -88
- package/frontend/dist/frontend/src/volt.d.ts +0 -20
- package/frontend/dist/frontend/src/volt.js +0 -27
- package/frontend/examples/theme/theme.ts +0 -58
- package/frontend/tools/bundle_d_ts.js +0 -71
- package/frontend/tools/convert_to_jsdoc_input.txt +0 -9452
- package/frontend/tools/convert_to_jsdoc_output.txt +0 -7626
- package/frontend/tools/convert_to_jsdoc_tmp.js +0 -345
- package/frontend/tools/scan_mixed_imports.js +0 -69
- /package/frontend/{dist/frontend/src/css → css}/adyen.css +0 -0
- /package/frontend/{dist/frontend/src/css → css}/volt.css +0 -0
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Daan van den Bergh
|
|
3
|
-
* @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
|
|
4
|
-
*/
|
|
5
|
-
import * as vlib from "@vandenberghinc/vlib";
|
|
6
|
-
import { Meta } from "./meta.js";
|
|
7
|
-
import { Endpoint } from "./endpoint.js";
|
|
8
|
-
import { Server } from "./server.js";
|
|
9
|
-
import { SplashScreen } from "./splash_screen.js";
|
|
10
|
-
import { Stream } from "./stream.js";
|
|
11
|
-
/**
|
|
12
|
-
* The view class can be used to create HTML pages through JavaScript or TypeScript source code.
|
|
13
|
-
* The view instance or constructor options can be passed to an {@link Endpoint} to serve the view at a specific route.
|
|
14
|
-
*
|
|
15
|
-
* @docs
|
|
16
|
-
* @nav Endpoints
|
|
17
|
-
*/
|
|
18
|
-
export declare class View {
|
|
19
|
-
static includes: Array<string | Record<string, any>>;
|
|
20
|
-
static links: Array<string | Record<string, any>>;
|
|
21
|
-
static body_style: string | null;
|
|
22
|
-
static splash_screen: SplashScreen | undefined;
|
|
23
|
-
private static _volt_css?;
|
|
24
|
-
private static _vhighlight_css?;
|
|
25
|
-
source: string;
|
|
26
|
-
source_path: vlib.Path;
|
|
27
|
-
includes: Array<string | Record<string, any>>;
|
|
28
|
-
links: Array<string | Record<string, any>>;
|
|
29
|
-
templates: Record<string, any>;
|
|
30
|
-
meta: Meta;
|
|
31
|
-
jquery: boolean;
|
|
32
|
-
lang: string;
|
|
33
|
-
body_style: string | null;
|
|
34
|
-
splash_screen: SplashScreen | undefined;
|
|
35
|
-
tree_shaking: boolean;
|
|
36
|
-
mangle: boolean;
|
|
37
|
-
_src?: string;
|
|
38
|
-
_embedded_sources: Array<string>;
|
|
39
|
-
min_device_width?: number;
|
|
40
|
-
server?: Server;
|
|
41
|
-
endpoint?: Endpoint;
|
|
42
|
-
/**
|
|
43
|
-
* The file path of a pre-bundled source, that can be sent from file instead of in-memory data.
|
|
44
|
-
*/
|
|
45
|
-
private cached_html_path;
|
|
46
|
-
/**
|
|
47
|
-
* Clone this view, used to create a modified copy of the current view.
|
|
48
|
-
* @note
|
|
49
|
-
* The following attributes are not deep copied, but just referenced:
|
|
50
|
-
* - `params`
|
|
51
|
-
* @param override Override specific endpoint options, note that this will be shallow merged.
|
|
52
|
-
*
|
|
53
|
-
* @docs
|
|
54
|
-
*/
|
|
55
|
-
clone(this: View, override?: Partial<View.Opts>): View;
|
|
56
|
-
/**
|
|
57
|
-
* Options for constructing a {@link View} instance.
|
|
58
|
-
* @docs
|
|
59
|
-
*/
|
|
60
|
-
constructor({ source, includes, links, templates, meta, jquery, lang, body_style, splash_screen, tree_shaking, mangle, min_device_width, _src, }: {
|
|
61
|
-
/** The file path to the client side JavaScript source code. */
|
|
62
|
-
source: string;
|
|
63
|
-
/**
|
|
64
|
-
* The included static JS files.
|
|
65
|
-
* By default, the local includes will be embedded into the HTML page. However, this behaviour can be disabled by passing an object of type `IncludeObject` with the attribute `embed = false`.
|
|
66
|
-
*/
|
|
67
|
-
includes?: (string | Record<string, any>)[];
|
|
68
|
-
/**
|
|
69
|
-
* The included static CSS files.
|
|
70
|
-
* By default, the local links will be embedded into the HTML page. However, this behaviour can be disabled by passing an object of type `LinkObject` with the attribute `embed = false`.
|
|
71
|
-
*/
|
|
72
|
-
links?: (string | Record<string, any>)[];
|
|
73
|
-
/**
|
|
74
|
-
* Templates that will be filled in the bundled source code.
|
|
75
|
-
* Templates can be created through a {{template_name}} syntax.
|
|
76
|
-
*/
|
|
77
|
-
templates?: Record<string, any>;
|
|
78
|
-
/** The meta information object. */
|
|
79
|
-
meta?: Meta;
|
|
80
|
-
/** Include jQuery by default. */
|
|
81
|
-
jquery?: boolean;
|
|
82
|
-
/** The style of the `<body>` element. When left undefined, the static attribute `View.body_style` will be used. */
|
|
83
|
-
lang?: string;
|
|
84
|
-
body_style?: string | null;
|
|
85
|
-
/** The splash screen settings. When left undefined, the static attribute `View.splash_screen` will be used. */
|
|
86
|
-
splash_screen?: SplashScreen;
|
|
87
|
-
/** Optimize JavaScript source code by removing dead code. */
|
|
88
|
-
tree_shaking?: boolean;
|
|
89
|
-
/** Optimize JavaScript source code by mangling function names. */
|
|
90
|
-
mangle?: boolean;
|
|
91
|
-
min_device_width?: number;
|
|
92
|
-
_src?: string;
|
|
93
|
-
});
|
|
94
|
-
initialize(server: Server, endpoint: Endpoint): void;
|
|
95
|
-
/**
|
|
96
|
-
* Production initialization.
|
|
97
|
-
* This will bundle the source code and prepare the view for production use.
|
|
98
|
-
* Instead of bundling on demand in the request which is used for development mode.
|
|
99
|
-
*/
|
|
100
|
-
production_initialize(): Promise<void>;
|
|
101
|
-
/** Create an error HTML file when errors are encountered during the bundle process. */
|
|
102
|
-
private _build_bundle_err_html;
|
|
103
|
-
private _build_html;
|
|
104
|
-
/** Create the cached HTML file if it doesn't exist. */
|
|
105
|
-
private _create_html_file;
|
|
106
|
-
_serve(stream: Stream, status_code?: number, opts?: {
|
|
107
|
-
/** Compress. */
|
|
108
|
-
compress?: boolean;
|
|
109
|
-
/** Template replacements. */
|
|
110
|
-
templates?: Record<string, string>;
|
|
111
|
-
}): Promise<void>;
|
|
112
|
-
}
|
|
113
|
-
export declare namespace View {
|
|
114
|
-
type Opts = ConstructorParameters<typeof View>[0];
|
|
115
|
-
}
|
|
@@ -1,519 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var stdin_exports = {};
|
|
29
|
-
__export(stdin_exports, {
|
|
30
|
-
View: () => View
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
33
|
-
var vlib = __toESM(require("@vandenberghinc/vlib"));
|
|
34
|
-
var vts = __toESM(require("@vandenberghinc/vlib/vts"));
|
|
35
|
-
var vhighlight = __toESM(require("@vandenberghinc/vhighlight"));
|
|
36
|
-
var import_meta = require("./meta.js");
|
|
37
|
-
var import_route = require("./route.js");
|
|
38
|
-
var import_frontend = require("./frontend.js");
|
|
39
|
-
var crypto = __toESM(require("crypto"));
|
|
40
|
-
const { debug } = vlib;
|
|
41
|
-
class View {
|
|
42
|
-
// Global settings.
|
|
43
|
-
static includes = [];
|
|
44
|
-
static links = [];
|
|
45
|
-
static body_style = null;
|
|
46
|
-
// css string style.
|
|
47
|
-
static splash_screen = void 0;
|
|
48
|
-
// SplashScreen object.
|
|
49
|
-
// Private static attributes,
|
|
50
|
-
static _volt_css;
|
|
51
|
-
static _vhighlight_css;
|
|
52
|
-
// Attributes.
|
|
53
|
-
source;
|
|
54
|
-
source_path;
|
|
55
|
-
// callback: Function | null;
|
|
56
|
-
includes;
|
|
57
|
-
links;
|
|
58
|
-
templates;
|
|
59
|
-
meta;
|
|
60
|
-
jquery;
|
|
61
|
-
lang;
|
|
62
|
-
body_style;
|
|
63
|
-
splash_screen;
|
|
64
|
-
tree_shaking;
|
|
65
|
-
mangle;
|
|
66
|
-
_src;
|
|
67
|
-
_embedded_sources;
|
|
68
|
-
min_device_width;
|
|
69
|
-
server;
|
|
70
|
-
endpoint;
|
|
71
|
-
/**
|
|
72
|
-
* The file path of a pre-bundled source, that can be sent from file instead of in-memory data.
|
|
73
|
-
*/
|
|
74
|
-
cached_html_path;
|
|
75
|
-
// private html_nonce_split?: string[];
|
|
76
|
-
/**
|
|
77
|
-
* Clone this view, used to create a modified copy of the current view.
|
|
78
|
-
* @note
|
|
79
|
-
* The following attributes are not deep copied, but just referenced:
|
|
80
|
-
* - `params`
|
|
81
|
-
* @param override Override specific endpoint options, note that this will be shallow merged.
|
|
82
|
-
*
|
|
83
|
-
* @docs
|
|
84
|
-
*/
|
|
85
|
-
clone(override) {
|
|
86
|
-
return new View({
|
|
87
|
-
...vlib.Object.deep_copy({
|
|
88
|
-
source: this.source,
|
|
89
|
-
// callback: this.callback,
|
|
90
|
-
includes: this.includes,
|
|
91
|
-
links: this.links,
|
|
92
|
-
templates: this.templates,
|
|
93
|
-
jquery: this.jquery,
|
|
94
|
-
lang: this.lang,
|
|
95
|
-
body_style: this.body_style,
|
|
96
|
-
tree_shaking: this.tree_shaking,
|
|
97
|
-
mangle: this.mangle,
|
|
98
|
-
min_device_width: this.min_device_width,
|
|
99
|
-
_src: this._src
|
|
100
|
-
}),
|
|
101
|
-
meta: this.meta.copy(),
|
|
102
|
-
splash_screen: this.splash_screen?.clone(),
|
|
103
|
-
...override
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Options for constructing a {@link View} instance.
|
|
108
|
-
* @docs
|
|
109
|
-
*/
|
|
110
|
-
constructor({
|
|
111
|
-
source,
|
|
112
|
-
// callback = null,
|
|
113
|
-
includes = [],
|
|
114
|
-
links = [],
|
|
115
|
-
templates = {},
|
|
116
|
-
meta = new import_meta.Meta(),
|
|
117
|
-
jquery = false,
|
|
118
|
-
lang = "en",
|
|
119
|
-
body_style = null,
|
|
120
|
-
splash_screen = void 0,
|
|
121
|
-
tree_shaking = false,
|
|
122
|
-
mangle = false,
|
|
123
|
-
min_device_width = 600,
|
|
124
|
-
_src
|
|
125
|
-
}) {
|
|
126
|
-
this.source = source;
|
|
127
|
-
this.includes = [...View.includes, ...includes];
|
|
128
|
-
this.links = [...View.links, ...links];
|
|
129
|
-
this.templates = templates;
|
|
130
|
-
this.meta = meta;
|
|
131
|
-
this.jquery = jquery;
|
|
132
|
-
this.lang = lang;
|
|
133
|
-
this.body_style = body_style ?? View.body_style;
|
|
134
|
-
this.splash_screen = splash_screen ?? View.splash_screen;
|
|
135
|
-
this.tree_shaking = tree_shaking;
|
|
136
|
-
this.mangle = mangle;
|
|
137
|
-
this.min_device_width = min_device_width;
|
|
138
|
-
this._src = _src;
|
|
139
|
-
this._embedded_sources = [];
|
|
140
|
-
this.source_path = new vlib.Path(this.source);
|
|
141
|
-
if (!this.source_path.exists()) {
|
|
142
|
-
throw new Error(`Defined source path "${this.source}" does not exist.`);
|
|
143
|
-
}
|
|
144
|
-
this.source_path = this.source_path.abs();
|
|
145
|
-
this.source = this.source_path.str();
|
|
146
|
-
if (!/\.(jsx?|tsx?)$/.test(this.source_path.extension())) {
|
|
147
|
-
throw new Error(`Invalid view source extension "${this.source_path.extension()}", only ".js", ".ts", ".jsx" and ".tsx" are supported.`);
|
|
148
|
-
}
|
|
149
|
-
this.includes = vlib.Array.drop_duplicates(this.includes);
|
|
150
|
-
}
|
|
151
|
-
// Initialize.
|
|
152
|
-
initialize(server, endpoint) {
|
|
153
|
-
if (server === void 0) {
|
|
154
|
-
throw Error('Invalid usage, define parameter "server".');
|
|
155
|
-
}
|
|
156
|
-
if (endpoint === void 0) {
|
|
157
|
-
throw Error('Invalid usage, define parameter "endpoint".');
|
|
158
|
-
}
|
|
159
|
-
this.server = server;
|
|
160
|
-
this.endpoint = endpoint;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Production initialization.
|
|
164
|
-
* This will bundle the source code and prepare the view for production use.
|
|
165
|
-
* Instead of bundling on demand in the request which is used for development mode.
|
|
166
|
-
*/
|
|
167
|
-
async production_initialize() {
|
|
168
|
-
await this._create_html_file();
|
|
169
|
-
}
|
|
170
|
-
/** Create an error HTML file when errors are encountered during the bundle process. */
|
|
171
|
-
async _build_bundle_err_html() {
|
|
172
|
-
if (this.server?.production) {
|
|
173
|
-
throw new Error("Encountered an error while bundling in production.");
|
|
174
|
-
}
|
|
175
|
-
const nonce_identifier = "{{__VOLT_NONCE__}}";
|
|
176
|
-
const bundle = await vts.inspect_bundle({
|
|
177
|
-
include: this.source_path ? [this.source_path?.str()] : [],
|
|
178
|
-
output: vlib.Path.tmp().join(`${this.endpoint?.route.method}_${this.source_path.str().replace(/\//g, "_")}.js`),
|
|
179
|
-
// esbuild requires an output path to resolve .css and .ttf files etc which can be imported by libraries (such as monaco-editor).
|
|
180
|
-
minify: false,
|
|
181
|
-
//this._server.production,
|
|
182
|
-
platform: "browser",
|
|
183
|
-
format: "esm",
|
|
184
|
-
// format: "iife", // can causes issues with node_modules imports.
|
|
185
|
-
target: "es2022",
|
|
186
|
-
tree_shaking: true
|
|
187
|
-
});
|
|
188
|
-
this.server?.log.error(this.endpoint?.route?.id, `: Encountered an error while bundling "${this.source}".
|
|
189
|
-
${bundle.debug({ limit: 25 })}`);
|
|
190
|
-
const escape_html = (str) => vlib.Color.to_html(str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"));
|
|
191
|
-
let html;
|
|
192
|
-
if (this.server?.production) {
|
|
193
|
-
html = `
|
|
194
|
-
<!DOCTYPE html>
|
|
195
|
-
<html lang='${this.lang}'>
|
|
196
|
-
<head>
|
|
197
|
-
<meta charset="UTF-8">
|
|
198
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
199
|
-
<title>Bundling Error</title>
|
|
200
|
-
<style nonce="${nonce_identifier}">
|
|
201
|
-
body {
|
|
202
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 2rem; background: #f5f5f5;
|
|
203
|
-
}
|
|
204
|
-
h1 {
|
|
205
|
-
color: #d32f2f; margin-top: 0;
|
|
206
|
-
}
|
|
207
|
-
#error-container {
|
|
208
|
-
max-width: 800px; margin: 0 auto; background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
209
|
-
}
|
|
210
|
-
</style>
|
|
211
|
-
</head>
|
|
212
|
-
<body>
|
|
213
|
-
<div id="error-container">
|
|
214
|
-
<h1>Bundling Error</h1>
|
|
215
|
-
<p>An error occurred while processing your request. Please contact support if this issue persists.</p>
|
|
216
|
-
</div>
|
|
217
|
-
</body>
|
|
218
|
-
</html>
|
|
219
|
-
`.dedent(false);
|
|
220
|
-
} else {
|
|
221
|
-
const formatted_import_chains = bundle.format_import_chains();
|
|
222
|
-
const formatted_errors = bundle.format_errors();
|
|
223
|
-
html = `
|
|
224
|
-
<!DOCTYPE html>
|
|
225
|
-
<html lang='${this.lang}'>
|
|
226
|
-
<head>
|
|
227
|
-
<meta charset="UTF-8">
|
|
228
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
229
|
-
<title>Bundling Error - ${escape_html(this.source || "Unknown")}</title>
|
|
230
|
-
<style nonce="${nonce_identifier}">
|
|
231
|
-
body {
|
|
232
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
233
|
-
margin: 0;
|
|
234
|
-
padding: 1rem;
|
|
235
|
-
background: #1e1e1e;
|
|
236
|
-
color: #d4d4d4;
|
|
237
|
-
}
|
|
238
|
-
.container {
|
|
239
|
-
max-width: 1200px;
|
|
240
|
-
margin: 0 auto;
|
|
241
|
-
}
|
|
242
|
-
h1 {
|
|
243
|
-
color: #FFFFFF;
|
|
244
|
-
font-size: 1.5rem;
|
|
245
|
-
margin-bottom: 0.5rem;
|
|
246
|
-
}
|
|
247
|
-
.source {
|
|
248
|
-
color: #C0C0C0;
|
|
249
|
-
font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
|
|
250
|
-
font-size: 0.875rem;
|
|
251
|
-
margin-bottom: 1rem;
|
|
252
|
-
}
|
|
253
|
-
pre {
|
|
254
|
-
background: #2d2d2d;
|
|
255
|
-
border: 1px solid #3e3e3e;
|
|
256
|
-
border-radius: 4px;
|
|
257
|
-
padding: 1rem;
|
|
258
|
-
overflow-x: auto;
|
|
259
|
-
font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
|
|
260
|
-
font-size: 0.875rem;
|
|
261
|
-
line-height: 1.5;
|
|
262
|
-
margin: 20px 0px 0px 0px;
|
|
263
|
-
}
|
|
264
|
-
.error-count {
|
|
265
|
-
background: #f44336;
|
|
266
|
-
color: white;
|
|
267
|
-
padding: 0.25rem 0.5rem;
|
|
268
|
-
border-radius: 4px;
|
|
269
|
-
font-size: 0.875rem;
|
|
270
|
-
display: inline-block;
|
|
271
|
-
margin-bottom: 1rem;
|
|
272
|
-
}
|
|
273
|
-
</style>
|
|
274
|
-
</head>
|
|
275
|
-
<body>
|
|
276
|
-
<div class="container">
|
|
277
|
-
<h1>Bundle Error</h1>
|
|
278
|
-
<div class="source">Source: ${escape_html(this.source || "Unknown")}</div>
|
|
279
|
-
<div class="error-count">${bundle.errors.length} error${bundle.errors.length === 1 ? "" : "s"}</div>
|
|
280
|
-
<pre>${escape_html(bundle.debug({ limit: -1 }))}</pre>
|
|
281
|
-
<!--<h2>Metafile</h2>
|
|
282
|
-
<pre>${escape_html(bundle.metafile ?? "No metafile detected.")}</pre>
|
|
283
|
-
<h2>Input files</h2>
|
|
284
|
-
<pre>${escape_html(bundle.inputs.length ? bundle.inputs.join("\n") : "No input files detected.")}</pre>
|
|
285
|
-
<h2>Import Chains</h2>
|
|
286
|
-
<pre>${escape_html(formatted_import_chains.length ? formatted_import_chains.join("\n") : "No import chains detected.")}</pre>
|
|
287
|
-
<h2>Encountered Errors</h2>
|
|
288
|
-
<pre>${escape_html(formatted_errors.length ? formatted_errors.join("\n") : "No errors detected.")}</pre>
|
|
289
|
-
-->
|
|
290
|
-
</div>
|
|
291
|
-
</body>
|
|
292
|
-
</html>
|
|
293
|
-
`.dedent(false);
|
|
294
|
-
}
|
|
295
|
-
return html;
|
|
296
|
-
}
|
|
297
|
-
// Build html.
|
|
298
|
-
async _build_html() {
|
|
299
|
-
const nonce_identifier = "{{__VOLT_NONCE__}}";
|
|
300
|
-
if (this.server == null || this.endpoint == null) {
|
|
301
|
-
throw Error('View has not been initialized with "View._initialize()" yet.');
|
|
302
|
-
}
|
|
303
|
-
if (debug.on(3))
|
|
304
|
-
debug(this.endpoint?.route?.id, `: Bundling entry path "${this.source_path?.str()}".`);
|
|
305
|
-
const bundle = await vts.bundle({
|
|
306
|
-
include: this.source_path ? [this.source_path?.str()] : [],
|
|
307
|
-
output: `/tmp/${this.endpoint.route.method}_${this.source_path.str().replace(/\//g, "_")}.js`,
|
|
308
|
-
// esbuild requires an output path to resolve .css and .ttf files etc which can be imported by libraries (such as monaco-editor).
|
|
309
|
-
minify: false,
|
|
310
|
-
//this._server.production,
|
|
311
|
-
platform: "browser",
|
|
312
|
-
format: "esm",
|
|
313
|
-
// format: "iife", // can causes issues with node_modules imports.
|
|
314
|
-
target: "es2022",
|
|
315
|
-
// sourcemap: this.server.production ? false : "inline",
|
|
316
|
-
extract_inputs: true,
|
|
317
|
-
// since bundle.inputs is used by server.js.
|
|
318
|
-
tree_shaking: true
|
|
319
|
-
});
|
|
320
|
-
const add_payments_module = bundle.inputs.find((path) => path.endsWith("/modules/paddle.js"));
|
|
321
|
-
if (bundle.errors.length > 0) {
|
|
322
|
-
return this._build_bundle_err_html();
|
|
323
|
-
}
|
|
324
|
-
const line_break = this.server.production ? "\n" : "\n";
|
|
325
|
-
let html = "";
|
|
326
|
-
html += `<!DOCTYPE html><html lang='${this.lang}'>${line_break}`;
|
|
327
|
-
html += `<head>${line_break}`;
|
|
328
|
-
if (this.meta) {
|
|
329
|
-
html += this.meta.build_html(this.server.full_domain) + line_break;
|
|
330
|
-
}
|
|
331
|
-
html += `<style nonce="${nonce_identifier}">html { min-width:100%;min-height:100%; }body { width:100vw;height:100vh;margin:0;padding:0;${this.body_style ?? ""} }</style>${line_break}`;
|
|
332
|
-
const embed_stylesheet = (url, embed) => {
|
|
333
|
-
if (embed == null && url != null && url.charAt(0) === "/") {
|
|
334
|
-
for (const endpoint of this.server.endpoints.values()) {
|
|
335
|
-
if (url === endpoint.route.endpoint_str) {
|
|
336
|
-
if (typeof endpoint.raw_data === "string") {
|
|
337
|
-
embed = endpoint.raw_data;
|
|
338
|
-
} else if (typeof endpoint.data === "string") {
|
|
339
|
-
embed = endpoint.data;
|
|
340
|
-
}
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
if (embed) {
|
|
346
|
-
html += `<style nonce="${nonce_identifier}">${line_break}${embed}${line_break}</style>${line_break}`;
|
|
347
|
-
if (url) {
|
|
348
|
-
this._embedded_sources.push(url);
|
|
349
|
-
}
|
|
350
|
-
return true;
|
|
351
|
-
}
|
|
352
|
-
return false;
|
|
353
|
-
};
|
|
354
|
-
let include_links_script = null;
|
|
355
|
-
const include_link_async = (link) => {
|
|
356
|
-
if (include_links_script == null) {
|
|
357
|
-
include_links_script = "async function __incl_lnk(args){var link = document.createElement('link');for (let key in args) {if (args.hasOwnProperty(key)){link.setAttribute(key,args[key])}}document.head.appendChild(link)}" + line_break;
|
|
358
|
-
}
|
|
359
|
-
if (link.rel == null) {
|
|
360
|
-
link.rel = "stylesheet";
|
|
361
|
-
}
|
|
362
|
-
include_links_script += `__incl_lnk(${JSON.stringify(link)});${line_break}`;
|
|
363
|
-
};
|
|
364
|
-
if (!View._volt_css) {
|
|
365
|
-
View._volt_css = await new vlib.Path(import_frontend.Frontend.css.volt).load();
|
|
366
|
-
}
|
|
367
|
-
if (!View._vhighlight_css) {
|
|
368
|
-
View._vhighlight_css = await new vlib.Path(vhighlight.web_exports.css).load();
|
|
369
|
-
}
|
|
370
|
-
embed_stylesheet(void 0, View._volt_css);
|
|
371
|
-
embed_stylesheet(void 0, View._vhighlight_css);
|
|
372
|
-
if (this.min_device_width != null) {
|
|
373
|
-
html += `
|
|
374
|
-
<script nonce="${nonce_identifier}">
|
|
375
|
-
let has_min_width = false;
|
|
376
|
-
const viewport = document.querySelector('meta[name="viewport"]');
|
|
377
|
-
function set_min_width() {
|
|
378
|
-
const device_width = window.innerWidth;
|
|
379
|
-
// console.log("Device width [" + device_width + "] below min_device_width [${this.min_device_width} =", (device_width <= ${this.min_device_width}).toString() + "]");
|
|
380
|
-
if (device_width <= ${this.min_device_width}) {
|
|
381
|
-
const content = 'width=${this.min_device_width}, initial-scale=' + (device_width / ${this.min_device_width});
|
|
382
|
-
// console.log("Below ${this.min_device_width}", {content, width: device_width, has_min_width, viewport: viewport.getAttribute('content')});
|
|
383
|
-
if (viewport.getAttribute('content') !== content) {
|
|
384
|
-
// console.log('set min width viewport', device_width, device_width / ${this.min_device_width})
|
|
385
|
-
viewport.setAttribute('content', content);
|
|
386
|
-
has_min_width = true;
|
|
387
|
-
}
|
|
388
|
-
} else if (has_min_width) {
|
|
389
|
-
// console.log('disable min width viewport', device_width)
|
|
390
|
-
viewport.setAttribute('content', 'width=device-width, initial-scale=1');
|
|
391
|
-
has_min_width = false;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
let timeout_load; window.addEventListener('load', () => {clearTimeout(timeout_load); timeout_load = setTimeout(set_min_width, 25); } );
|
|
395
|
-
let timeout_resize; window.addEventListener('resize', () => {clearTimeout(timeout_resize); timeout_resize = setTimeout(set_min_width, 25); } );
|
|
396
|
-
set_min_width();
|
|
397
|
-
</script>
|
|
398
|
-
`.dedent();
|
|
399
|
-
}
|
|
400
|
-
this.links.forEach((url) => {
|
|
401
|
-
if (typeof url === "string") {
|
|
402
|
-
html += `<link rel="stylesheet" href="${url}">`;
|
|
403
|
-
} else if (typeof url === "object") {
|
|
404
|
-
if (typeof url === "object" && url.rel === "stylesheet" && url.embed !== true && typeof url.href === "string" && embed_stylesheet(import_route.Route.clean_endpoint(url.href))) {
|
|
405
|
-
} else {
|
|
406
|
-
if (url.async) {
|
|
407
|
-
include_link_async(url);
|
|
408
|
-
} else {
|
|
409
|
-
html += "<link";
|
|
410
|
-
Object.keys(url).forEach((key) => {
|
|
411
|
-
if (key !== "embed") {
|
|
412
|
-
html += ` ${key}="${url[key]}"`;
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
html += ">" + line_break;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
} else {
|
|
419
|
-
throw Error('Invalid type for a css include, the valid value types are "string" and "object".');
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
if (include_links_script) {
|
|
423
|
-
html += `<script nonce="${nonce_identifier}">${line_break}${include_links_script}${line_break}</script>${line_break}`;
|
|
424
|
-
}
|
|
425
|
-
html += "</head>" + line_break;
|
|
426
|
-
html += "<body id='body'>";
|
|
427
|
-
if (this.splash_screen != null) {
|
|
428
|
-
html += this.splash_screen.html + line_break;
|
|
429
|
-
}
|
|
430
|
-
const embed_script = (url) => {
|
|
431
|
-
let embed;
|
|
432
|
-
for (const endpoint of this.server.endpoints.values()) {
|
|
433
|
-
if (url === endpoint.route.endpoint_str && (endpoint.raw_data != null || endpoint.data != null)) {
|
|
434
|
-
embed = endpoint;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
if (embed && (embed.raw_data || embed.data)) {
|
|
438
|
-
if (embed.content_type === "application/javascript") {
|
|
439
|
-
html += `<script nonce="${nonce_identifier}">${line_break}${embed.raw_data || embed.data}${line_break}</script>${line_break}`;
|
|
440
|
-
} else {
|
|
441
|
-
html += `<script nonce="${nonce_identifier}" type='${embed.content_type}'>${line_break}${embed.raw_data || embed.data}${line_break}</script>${line_break}`;
|
|
442
|
-
}
|
|
443
|
-
this._embedded_sources.push(url);
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
|
-
return false;
|
|
447
|
-
};
|
|
448
|
-
let include_js_script = `async function __volt_incl_js(url, async = true) {var script=document.createElement('script');if(async){script.async = true;}script.src=url;document.head.appendChild(script);};${line_break}`;
|
|
449
|
-
if (this.jquery) {
|
|
450
|
-
html += `<script nonce="${nonce_identifier}" src='https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js'></script>${line_break}`;
|
|
451
|
-
}
|
|
452
|
-
if (this.server.google_tag !== void 0) {
|
|
453
|
-
include_js_script += `__volt_incl_js("https://www.googletagmanager.com/gtag/js?id=${this.server.google_tag}");${line_break}`;
|
|
454
|
-
}
|
|
455
|
-
html += `<script nonce="${nonce_identifier}">${line_break}window.volt_statics_aspect_ratios = ${JSON.stringify(Object.fromEntries(this.server.statics_aspect_ratios))}${line_break}</script>${line_break}`;
|
|
456
|
-
if (this.server.payments) {
|
|
457
|
-
}
|
|
458
|
-
html += `<script nonce="${nonce_identifier}">${line_break}${include_js_script.trimEnd()}${line_break}</script>${line_break}`;
|
|
459
|
-
this.includes.forEach((url) => {
|
|
460
|
-
if (typeof url === "string" && embed_script(url)) {
|
|
461
|
-
} else {
|
|
462
|
-
if (typeof url === "string") {
|
|
463
|
-
html += `<script nonce="${nonce_identifier}" src='${url}'></script>${line_break}`;
|
|
464
|
-
} else if (typeof url === "object") {
|
|
465
|
-
html += `<script nonce="${nonce_identifier}"`;
|
|
466
|
-
Object.keys(url).forEach((key) => {
|
|
467
|
-
if (key !== "embed") {
|
|
468
|
-
html += ` ${key}="${url[key]}"`;
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
html += "></script>" + line_break;
|
|
472
|
-
} else {
|
|
473
|
-
throw Error('Invalid type for a js include, the valid value types are "string" and "object".');
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
if (typeof bundle.code === "string") {
|
|
478
|
-
html += `<script nonce="${nonce_identifier}" type='module'>${line_break}${bundle.code}${line_break}</script>${line_break}`;
|
|
479
|
-
} else if (typeof this.source === "string") {
|
|
480
|
-
html += `<script nonce="${nonce_identifier}">${line_break}${await new vlib.Path(this.source).load()}${line_break}</script>${line_break}`;
|
|
481
|
-
}
|
|
482
|
-
html += "</body>" + line_break;
|
|
483
|
-
html += "</html>" + line_break;
|
|
484
|
-
return html;
|
|
485
|
-
}
|
|
486
|
-
/** Create the cached HTML file if it doesn't exist. */
|
|
487
|
-
async _create_html_file() {
|
|
488
|
-
const cache_id = `${this.endpoint?.route.method}_${this.source_path?.str()}.html`.replaceAll("/", "_");
|
|
489
|
-
if (!this.cached_html_path) {
|
|
490
|
-
this.cached_html_path = this.server.endpoint_cache_dir.join(cache_id);
|
|
491
|
-
}
|
|
492
|
-
if (!this.cached_html_path.exists()) {
|
|
493
|
-
const html = await this._build_html();
|
|
494
|
-
await this.cached_html_path.save(html);
|
|
495
|
-
}
|
|
496
|
-
return this.cached_html_path;
|
|
497
|
-
}
|
|
498
|
-
// Serve a client.
|
|
499
|
-
async _serve(stream, status_code = 200, opts) {
|
|
500
|
-
const html_file = await this._create_html_file();
|
|
501
|
-
const nonce = crypto.randomBytes(16).toString("base64");
|
|
502
|
-
const csp = stream.get_header("Content-Security-Policy");
|
|
503
|
-
if (typeof csp === "string") {
|
|
504
|
-
const new_csp = csp.replace(/(script-src|style-src)([^;]*)/g, (_, g1, g2) => `${g1}${g2} 'nonce-${nonce}'`);
|
|
505
|
-
stream.set_header("Content-Security-Policy", new_csp);
|
|
506
|
-
}
|
|
507
|
-
stream.send({
|
|
508
|
-
status: status_code,
|
|
509
|
-
headers: { "Content-Type": "text/html" },
|
|
510
|
-
from_file: html_file,
|
|
511
|
-
templates: { ...this.templates, ...opts?.templates ?? {}, "__VOLT_NONCE__": nonce },
|
|
512
|
-
compress: opts?.compress
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
517
|
-
0 && (module.exports = {
|
|
518
|
-
View
|
|
519
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var stdin_exports = {};
|
|
29
|
-
__export(stdin_exports, {
|
|
30
|
-
vlib: () => vlib,
|
|
31
|
-
vts: () => vts
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
34
|
-
var vlib = __toESM(require("@vandenberghinc/vlib"));
|
|
35
|
-
var vts = __toESM(require("@vandenberghinc/vlib/vts"));
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
vlib,
|
|
39
|
-
vts
|
|
40
|
-
});
|