@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,64 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var stdin_exports = {};
|
|
19
|
-
__export(stdin_exports, {
|
|
20
|
-
ExternalStripeError: () => ExternalStripeError,
|
|
21
|
-
InternalStripeError: () => InternalStripeError
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
-
var import_internal_external = require("../../errors/internal_external.js");
|
|
25
|
-
class InternalStripeError extends import_internal_external.InternalError {
|
|
26
|
-
/** Stable error code for programmatic handling (never include secrets). */
|
|
27
|
-
error_code;
|
|
28
|
-
/** Optional safe context for debugging (never include secrets). */
|
|
29
|
-
context;
|
|
30
|
-
/** Constructs a StripeWrapperError. */
|
|
31
|
-
constructor(code, message, context, cause) {
|
|
32
|
-
super({
|
|
33
|
-
message,
|
|
34
|
-
type: code,
|
|
35
|
-
cause
|
|
36
|
-
});
|
|
37
|
-
this.name = "StripeError";
|
|
38
|
-
this.error_code = code;
|
|
39
|
-
this.context = context;
|
|
40
|
-
this.cause = cause;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
class ExternalStripeError extends import_internal_external.ExternalError {
|
|
44
|
-
/** Stable error code for programmatic handling (never include secrets). */
|
|
45
|
-
error_code;
|
|
46
|
-
/** Optional safe context for debugging (never include secrets). */
|
|
47
|
-
context;
|
|
48
|
-
/** Constructs a StripeWrapperError. */
|
|
49
|
-
constructor(code, message, context, cause) {
|
|
50
|
-
super({
|
|
51
|
-
message,
|
|
52
|
-
type: code,
|
|
53
|
-
cause
|
|
54
|
-
});
|
|
55
|
-
this.name = "StripeError";
|
|
56
|
-
this.error_code = code;
|
|
57
|
-
this.context = context;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
ExternalStripeError,
|
|
63
|
-
InternalStripeError
|
|
64
|
-
});
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Daan van den Bergh
|
|
3
|
-
* @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
|
|
4
|
-
*/
|
|
5
|
-
import Stripe from "stripe";
|
|
6
|
-
import { StripeResolvedSubscriptionItem } from "./webhooks.js";
|
|
7
|
-
/**
|
|
8
|
-
* Stripe webhook-driven events emitted by this module.
|
|
9
|
-
*
|
|
10
|
-
* These event names are intentionally explicit and stable.
|
|
11
|
-
* Consumers can subscribe via `server.on("<event-type>", cb)` if your Server supports it,
|
|
12
|
-
* or you can route them via `server.events.trigger("<event-type>", args)` as done below.
|
|
13
|
-
*/
|
|
14
|
-
export type StripeEvents = {
|
|
15
|
-
/**
|
|
16
|
-
* Fired when a Stripe Checkout Session is completed.
|
|
17
|
-
*
|
|
18
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-checkout.session.completed
|
|
19
|
-
*
|
|
20
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
21
|
-
*/
|
|
22
|
-
"stripe.checkout_session_completed": (opts: {
|
|
23
|
-
/** The internal user id resolved from metadata. */
|
|
24
|
-
uid: string;
|
|
25
|
-
/** Stripe checkout session id. */
|
|
26
|
-
stripe_session_id: string;
|
|
27
|
-
/** Stripe checkout mode. */
|
|
28
|
-
mode: "payment" | "subscription" | "setup";
|
|
29
|
-
/** Stripe customer id. */
|
|
30
|
-
stripe_customer_id: string;
|
|
31
|
-
/** Stripe subscription id (only for mode="subscription"). */
|
|
32
|
-
stripe_subscription_id?: string;
|
|
33
|
-
/** Currency if available on the session. */
|
|
34
|
-
currency?: string;
|
|
35
|
-
/** Session metadata (safe). */
|
|
36
|
-
metadata: Stripe.Metadata;
|
|
37
|
-
}) => void | Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Fired when a Stripe subscription is created.
|
|
40
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-customer.subscription.created
|
|
41
|
-
*
|
|
42
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
43
|
-
*/
|
|
44
|
-
"stripe.subscription_created": (opts: {
|
|
45
|
-
/** The internal user id. */
|
|
46
|
-
uid: string;
|
|
47
|
-
/** Stripe subscription id. */
|
|
48
|
-
stripe_subscription_id: string;
|
|
49
|
-
/** Stripe customer id. */
|
|
50
|
-
stripe_customer_id: string;
|
|
51
|
-
/** Stripe subscription status. */
|
|
52
|
-
status: Stripe.Subscription.Status;
|
|
53
|
-
/**
|
|
54
|
-
* Matched subscription items (price -> plan/product mapping when resolvable).
|
|
55
|
-
* This can contain multiple items if the subscription has multiple prices.
|
|
56
|
-
*/
|
|
57
|
-
items: StripeResolvedSubscriptionItem[];
|
|
58
|
-
}) => void | Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Fired when a Stripe subscription is updated.
|
|
61
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-customer.subscription.updated
|
|
62
|
-
*
|
|
63
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
64
|
-
*/
|
|
65
|
-
"stripe.subscription_updated": (opts: {
|
|
66
|
-
uid: string;
|
|
67
|
-
stripe_subscription_id: string;
|
|
68
|
-
stripe_customer_id: string;
|
|
69
|
-
status: Stripe.Subscription.Status;
|
|
70
|
-
items: StripeResolvedSubscriptionItem[];
|
|
71
|
-
cancel_at_period_end?: boolean;
|
|
72
|
-
}) => void | Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Fired when a Stripe subscription is deleted/canceled.
|
|
75
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-customer.subscription.deleted
|
|
76
|
-
*
|
|
77
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
78
|
-
*/
|
|
79
|
-
"stripe.subscription_deleted": (opts: {
|
|
80
|
-
uid: string;
|
|
81
|
-
stripe_subscription_id: string;
|
|
82
|
-
stripe_customer_id: string;
|
|
83
|
-
status: Stripe.Subscription.Status;
|
|
84
|
-
items: StripeResolvedSubscriptionItem[];
|
|
85
|
-
}) => void | Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* Fired when an invoice is paid successfully.
|
|
88
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-invoice.paid
|
|
89
|
-
*
|
|
90
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
91
|
-
*/
|
|
92
|
-
"stripe.invoice_paid": (opts: {
|
|
93
|
-
uid: string;
|
|
94
|
-
stripe_invoice_id: string;
|
|
95
|
-
stripe_customer_id: string;
|
|
96
|
-
amount_paid: number;
|
|
97
|
-
currency: string;
|
|
98
|
-
hosted_invoice_url?: string;
|
|
99
|
-
}) => void | Promise<void>;
|
|
100
|
-
/**
|
|
101
|
-
* Fired when an invoice payment fails.
|
|
102
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-invoice.payment_failed
|
|
103
|
-
*
|
|
104
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
105
|
-
*/
|
|
106
|
-
"stripe.invoice_payment_failed": (opts: {
|
|
107
|
-
uid: string;
|
|
108
|
-
stripe_invoice_id: string;
|
|
109
|
-
stripe_customer_id: string;
|
|
110
|
-
amount_due: number;
|
|
111
|
-
currency: string;
|
|
112
|
-
hosted_invoice_url?: string;
|
|
113
|
-
}) => void | Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Fired when a PaymentIntent succeeds (covers one-time and some subscription flows).
|
|
116
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-payment_intent.succeeded
|
|
117
|
-
*
|
|
118
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
119
|
-
*/
|
|
120
|
-
"stripe.payment_succeeded": (opts: {
|
|
121
|
-
uid: string;
|
|
122
|
-
stripe_payment_intent_id: string;
|
|
123
|
-
stripe_customer_id?: string;
|
|
124
|
-
amount_received: number;
|
|
125
|
-
currency: string;
|
|
126
|
-
metadata: Stripe.Metadata;
|
|
127
|
-
}) => void | Promise<void>;
|
|
128
|
-
/**
|
|
129
|
-
* Fired when a PaymentIntent fails.
|
|
130
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-payment_intent.payment_failed
|
|
131
|
-
*
|
|
132
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
133
|
-
*/
|
|
134
|
-
"stripe.payment_failed": (opts: {
|
|
135
|
-
uid: string;
|
|
136
|
-
stripe_payment_intent_id: string;
|
|
137
|
-
stripe_customer_id?: string;
|
|
138
|
-
amount: number;
|
|
139
|
-
currency: string;
|
|
140
|
-
last_payment_error_message?: string;
|
|
141
|
-
metadata: Stripe.Metadata;
|
|
142
|
-
}) => void | Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* Fired when a SetupIntent succeeds and we (best-effort) set the default payment method.
|
|
145
|
-
* Docs: https://docs.stripe.com/api/events/types#event_types-setup_intent.succeeded
|
|
146
|
-
*
|
|
147
|
-
* @note The defined events are executed in parallel and are awaited inside the webhook handler.
|
|
148
|
-
*/
|
|
149
|
-
"stripe.payment_method_ready": (opts: {
|
|
150
|
-
uid: string;
|
|
151
|
-
stripe_customer_id: string;
|
|
152
|
-
stripe_setup_intent_id: string;
|
|
153
|
-
stripe_payment_method_id: string;
|
|
154
|
-
}) => void | Promise<void>;
|
|
155
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
-
var stdin_exports = {};
|
|
15
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Daan van den Bergh
|
|
3
|
-
* @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
|
|
4
|
-
*/
|
|
5
|
-
import Stripe from "stripe";
|
|
6
|
-
import { InitializedMeterProduct, InitializedProduct, MeterProduct } from "./products.js";
|
|
7
|
-
import { Server } from "../../server.js";
|
|
8
|
-
type AmountRounding = "exact" | "floor" | "ceil" | "round";
|
|
9
|
-
/**
|
|
10
|
-
* The options for recording meter usage.
|
|
11
|
-
*/
|
|
12
|
-
export type RecordMeterUsageOpts<Kind extends MeterProduct.Kind> = {
|
|
13
|
-
/** The internal user id (uid) whose usage should be recorded. */
|
|
14
|
-
uid: string;
|
|
15
|
-
/** The initialized meter product to record usage for. */
|
|
16
|
-
product: InitializedMeterProduct<Kind extends "units" ? MeterProduct.UnitsMeter : Kind extends "money" ? MeterProduct.MoneyMeter : never>;
|
|
17
|
-
/**
|
|
18
|
-
* Optional event timestamp.
|
|
19
|
-
* Must be within the past 35 calendar days or up to 5 minutes in the future.
|
|
20
|
-
* @see https://docs.stripe.com/api/billing/meter-event/create
|
|
21
|
-
*/
|
|
22
|
-
timestamp?: Date;
|
|
23
|
-
/**
|
|
24
|
-
* Event identifier to deduplicate accidental retries.
|
|
25
|
-
* Stripe enforces uniqueness within a rolling >=24h window.
|
|
26
|
-
* Must be non-empty, max 100 chars, and contain only letters, numbers, dots, underscores or hyphens.
|
|
27
|
-
* @see https://docs.stripe.com/api/billing/meter-event/create
|
|
28
|
-
*/
|
|
29
|
-
identifier: string;
|
|
30
|
-
} & (Kind extends "units" ? {
|
|
31
|
-
/**
|
|
32
|
-
* The numeric usage value to record (integer).
|
|
33
|
-
* For "sum"/"last" meters this is the numeric value.
|
|
34
|
-
* For "count" meters this can be 1 per event (but we still send a value).
|
|
35
|
-
*/
|
|
36
|
-
value: number;
|
|
37
|
-
} : Kind extends "money" ? {
|
|
38
|
-
/**
|
|
39
|
-
* Money amount in major units (e.g., "0.007463" USD), used only when product.kind === "money".
|
|
40
|
-
* Can be string or number (number is normalized to string).
|
|
41
|
-
*/
|
|
42
|
-
amount: string | number;
|
|
43
|
-
/**
|
|
44
|
-
* Rounding mode used when converting amount to internal integer units.
|
|
45
|
-
* @default "exact"
|
|
46
|
-
* @warning When round is `exact`, amounts with more precision than supported will be rejected by a thrown error, to prevent silent rounding bugs. Use an explicit rounding mode to allow lossy conversions.
|
|
47
|
-
*/
|
|
48
|
-
round?: AmountRounding;
|
|
49
|
-
} : never);
|
|
50
|
-
/**
|
|
51
|
-
* The result of recording meter usage.
|
|
52
|
-
*/
|
|
53
|
-
export interface RecordMeterUsageResult {
|
|
54
|
-
/** The Stripe billing meter event id. */
|
|
55
|
-
meter_event_identifier: string;
|
|
56
|
-
/** The meter event name used. */
|
|
57
|
-
event_name: string;
|
|
58
|
-
/** The unix timestamp (seconds) used for the event, if provided. */
|
|
59
|
-
timestamp: number;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Record usage for a metered subscription by creating a Stripe Billing Meter Event.
|
|
63
|
-
*
|
|
64
|
-
* Security & correctness guarantees:
|
|
65
|
-
* - Requires that the user has an active-ish subscription containing the meter product's price id.
|
|
66
|
-
* - Uses the meter's configured payload keys for customer/value mapping.
|
|
67
|
-
* - Allows caller-provided `identifier` to dedupe retries.
|
|
68
|
-
*
|
|
69
|
-
* Stripe docs:
|
|
70
|
-
* - Create meter event: https://docs.stripe.com/api/billing/meter-event/create
|
|
71
|
-
* - Record usage guide: https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage-api
|
|
72
|
-
*
|
|
73
|
-
* @throws {InternalStripeError} When round mode is `exact` and the amount has more precision than supported.
|
|
74
|
-
* @throws {InternalStripeError} On internal errors.
|
|
75
|
-
* @throws {ExternalStripeError} On external errors such as the customer not being entitled to record usage for the meter product.
|
|
76
|
-
*/
|
|
77
|
-
export declare function record_meter_usage<Kind extends MeterProduct.Kind>(client: Stripe, server: Server, all_products: InitializedProduct[], opts: RecordMeterUsageOpts<Kind>): Promise<RecordMeterUsageResult>;
|
|
78
|
-
/** The options for {@link cancel_meter_usage_event} */
|
|
79
|
-
export interface CancelMeterUsageEventOpts {
|
|
80
|
-
/** The user id. */
|
|
81
|
-
uid: string;
|
|
82
|
-
/** The meter product whose event stream the event belongs to. */
|
|
83
|
-
product: InitializedMeterProduct;
|
|
84
|
-
/** The identifier of the meter event to cancel. */
|
|
85
|
-
meter_event_identifier: string;
|
|
86
|
-
}
|
|
87
|
-
/** The result type of {@link cancel_meter_usage_event} */
|
|
88
|
-
export interface CancelMeterUsageEventResult {
|
|
89
|
-
/** The identifier of the canceled meter event. */
|
|
90
|
-
meter_event_identifier: string;
|
|
91
|
-
/** The status of the adjustment created to cancel the event. Typically "pending". */
|
|
92
|
-
status: string;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Cancel a previously recorded meter event by identifier (best-effort within 24 hours).
|
|
96
|
-
*
|
|
97
|
-
* This is useful for:
|
|
98
|
-
* - reverting accidental double-reporting
|
|
99
|
-
* - compensating failed internal workflows
|
|
100
|
-
*
|
|
101
|
-
* Stripe docs:
|
|
102
|
-
* - Create meter event adjustment: https://docs.stripe.com/api/billing/meter-event-adjustment/create
|
|
103
|
-
*/
|
|
104
|
-
export declare function cancel_meter_usage_event(client: Stripe, server: Server, all_products: InitializedProduct[], opts: CancelMeterUsageEventOpts): Promise<CancelMeterUsageEventResult>;
|
|
105
|
-
export {};
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var stdin_exports = {};
|
|
19
|
-
__export(stdin_exports, {
|
|
20
|
-
cancel_meter_usage_event: () => cancel_meter_usage_event,
|
|
21
|
-
record_meter_usage: () => record_meter_usage
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
-
var import_customers = require("./customers.js");
|
|
25
|
-
var import_error = require("./error.js");
|
|
26
|
-
var import_utils = require("./utils.js");
|
|
27
|
-
var import_products = require("./products.js");
|
|
28
|
-
var import_subscriptions = require("./subscriptions.js");
|
|
29
|
-
function money_major_to_pico_cents_units(amount, round) {
|
|
30
|
-
const s = amount.trim();
|
|
31
|
-
(0, import_utils.assert)(s.length > 0, "invalid_argument", "Property 'amount' must be a non-empty string.", { amount });
|
|
32
|
-
(0, import_utils.assert)(/^\d+(\.\d+)?$/.test(s), "invalid_argument", "Property 'amount' must be a non-negative decimal.", { amount });
|
|
33
|
-
const [whole_raw, frac_raw = ""] = s.split(".");
|
|
34
|
-
const whole = whole_raw ?? "0";
|
|
35
|
-
const frac = frac_raw ?? "";
|
|
36
|
-
const SHIFT = import_products.MeterProduct.MONEY_METER_MAJOR_TO_PICO_CENTS_SHIFT;
|
|
37
|
-
const frac_padded = frac + "0".repeat(SHIFT);
|
|
38
|
-
const frac_keep = frac_padded.slice(0, SHIFT);
|
|
39
|
-
const frac_rest = frac_padded.slice(SHIFT);
|
|
40
|
-
const remainder_nonzero = /[1-9]/.test(frac_rest);
|
|
41
|
-
let increment = false;
|
|
42
|
-
if (frac.length > SHIFT || remainder_nonzero) {
|
|
43
|
-
if (round === "exact") {
|
|
44
|
-
(0, import_utils.assert)(!remainder_nonzero, "invalid_argument", "Property 'amount' has more precision than supported for exact conversion.", {
|
|
45
|
-
amount,
|
|
46
|
-
max_decimals: SHIFT
|
|
47
|
-
});
|
|
48
|
-
} else if (round === "floor") {
|
|
49
|
-
} else if (round === "ceil") {
|
|
50
|
-
increment = remainder_nonzero;
|
|
51
|
-
} else if (round === "round") {
|
|
52
|
-
increment = frac_rest.length > 0 && frac_rest[0] >= "5";
|
|
53
|
-
} else {
|
|
54
|
-
round.toString();
|
|
55
|
-
throw new import_error.InternalStripeError("invalid_argument", `Invalid rounding: ${round}`, { round });
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const raw_int_str = (whole + frac_keep).replace(/^0+/, "") || "0";
|
|
59
|
-
let units = BigInt(raw_int_str);
|
|
60
|
-
if (increment) {
|
|
61
|
-
units += 1n;
|
|
62
|
-
}
|
|
63
|
-
return units.toString();
|
|
64
|
-
}
|
|
65
|
-
function normalize_amount_to_string(amount) {
|
|
66
|
-
if (typeof amount === "string") {
|
|
67
|
-
return amount;
|
|
68
|
-
}
|
|
69
|
-
(0, import_utils.assert)(Number.isFinite(amount), "invalid_argument", "Property 'amount' must be a finite number.", { amount });
|
|
70
|
-
(0, import_utils.assert)(Math.abs(amount) < 1e21, "invalid_argument", "Property 'amount' number is too large.", { amount });
|
|
71
|
-
const s = amount.toFixed(20);
|
|
72
|
-
return s.replace(/\.?0+$/, "");
|
|
73
|
-
}
|
|
74
|
-
function validate_meter_event_identifier(identifier) {
|
|
75
|
-
(0, import_utils.assert)(identifier.length <= 100, "invalid_argument", "Meter event identifier must be <= 100 characters.", { identifier_length: identifier.length });
|
|
76
|
-
(0, import_utils.assert)(identifier.trim().length > 0, "invalid_argument", "Meter event identifier must be non-empty.", {
|
|
77
|
-
identifier_length: identifier.length
|
|
78
|
-
});
|
|
79
|
-
(0, import_utils.assert)(/^[a-zA-Z0-9._-]+$/.test(identifier), "invalid_argument", "Meter event identifier contains invalid characters.", {});
|
|
80
|
-
}
|
|
81
|
-
function validate_meter_event_timestamp(now, timestamp) {
|
|
82
|
-
const now_ms = now.getTime();
|
|
83
|
-
const ts_ms = timestamp.getTime();
|
|
84
|
-
(0, import_utils.assert)(Number.isFinite(ts_ms), "invalid_argument", "Meter event timestamp is invalid.", {});
|
|
85
|
-
const max_past_ms = 35 * 24 * 60 * 60 * 1e3;
|
|
86
|
-
const max_future_ms = 5 * 60 * 1e3;
|
|
87
|
-
(0, import_utils.assert)(ts_ms >= now_ms - max_past_ms, "invalid_argument", "Meter event timestamp is too far in the past.", { now_ms, ts_ms });
|
|
88
|
-
(0, import_utils.assert)(ts_ms <= now_ms + max_future_ms, "invalid_argument", "Meter event timestamp is too far in the future.", { now_ms, ts_ms });
|
|
89
|
-
}
|
|
90
|
-
async function assert_customer_entitled_for_meter_price(client, server, opts) {
|
|
91
|
-
const active_meters = await (0, import_subscriptions.list_subscribed_meters)(client, server, {
|
|
92
|
-
uid: opts.uid,
|
|
93
|
-
stripe_customer_id: opts.stripe_customer_id,
|
|
94
|
-
all_products: opts.all_products
|
|
95
|
-
});
|
|
96
|
-
if (!active_meters[opts.meter_product.id]) {
|
|
97
|
-
throw new import_error.ExternalStripeError("subscription_not_active", "You must be subscribed to use this metered feature.", { uid: opts.uid, stripe_customer_id: opts.stripe_customer_id, meter_product: opts.meter_product.id });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
function resolve_meter_payload_keys(product) {
|
|
101
|
-
const customer_key = product.customer_mapping_event_payload_key ?? "stripe_customer_id";
|
|
102
|
-
const value_key = product.value_settings_event_payload_key ?? "value";
|
|
103
|
-
(0, import_utils.assert)(customer_key.trim().length > 0, "invalid_product", "Meter customer payload key must be non-empty.", {
|
|
104
|
-
product_id: product.id,
|
|
105
|
-
customer_key
|
|
106
|
-
});
|
|
107
|
-
(0, import_utils.assert)(value_key.trim().length > 0, "invalid_product", "Meter value payload key must be non-empty.", {
|
|
108
|
-
product_id: product.id,
|
|
109
|
-
value_key
|
|
110
|
-
});
|
|
111
|
-
(0, import_utils.assert)(customer_key.length <= 100, "invalid_product", "Meter customer payload key must be <= 100 characters.", {
|
|
112
|
-
product_id: product.id,
|
|
113
|
-
customer_key_length: customer_key.length
|
|
114
|
-
});
|
|
115
|
-
(0, import_utils.assert)(value_key.length <= 100, "invalid_product", "Meter value payload key must be <= 100 characters.", {
|
|
116
|
-
product_id: product.id,
|
|
117
|
-
value_key_length: value_key.length
|
|
118
|
-
});
|
|
119
|
-
return { customer_key, value_key };
|
|
120
|
-
}
|
|
121
|
-
async function record_meter_usage(client, server, all_products, opts) {
|
|
122
|
-
(0, import_utils.public_assert)((0, import_utils.is_non_empty_string)(opts.uid), "invalid_argument", "Property 'uid' must be a non-empty string.");
|
|
123
|
-
(0, import_utils.assert)(opts.product.type === "meter", "invalid_argument", "Property 'product' must be a meter product.", {
|
|
124
|
-
product_type: opts.product.type
|
|
125
|
-
});
|
|
126
|
-
(0, import_utils.assert)((0, import_utils.is_non_empty_string)(opts.product.meter_event_name) && opts.product.meter_event_name.length <= 100, "invalid_product", "Meter product meter_event_name is invalid.", { product_id: opts.product.id, meter_event_name: opts.product.meter_event_name });
|
|
127
|
-
let value_str;
|
|
128
|
-
const meter_kind = opts.product.kind ?? "units";
|
|
129
|
-
if (meter_kind === "money") {
|
|
130
|
-
(0, import_utils.assert)("amount" in opts, "invalid_argument", "Property 'amount' must be provided for money meters.", {
|
|
131
|
-
product_id: opts.product.id
|
|
132
|
-
});
|
|
133
|
-
const rounding = opts.round ?? "exact";
|
|
134
|
-
const amount_str = normalize_amount_to_string(opts.amount);
|
|
135
|
-
value_str = money_major_to_pico_cents_units(amount_str, rounding);
|
|
136
|
-
(0, import_utils.assert)(BigInt(value_str) >= 0n, "invalid_argument", "Property 'amount' must be >= 0.", {
|
|
137
|
-
amount: amount_str,
|
|
138
|
-
value_str
|
|
139
|
-
});
|
|
140
|
-
} else if (meter_kind === "units") {
|
|
141
|
-
(0, import_utils.assert)("value" in opts, "invalid_argument", "Property 'value' must be provided for unit meters.", {
|
|
142
|
-
product_id: opts.product.id
|
|
143
|
-
});
|
|
144
|
-
(0, import_utils.assert)(Number.isFinite(opts.value), "invalid_argument", "Property 'value' must be a finite number.", { value: opts.value });
|
|
145
|
-
(0, import_utils.assert)(opts.value >= 0, "invalid_argument", "Property 'value' must be >= 0.", { value: opts.value });
|
|
146
|
-
(0, import_utils.assert)(Number.isInteger(opts.value), "invalid_argument", "Property 'value' must be an integer.", { value: opts.value });
|
|
147
|
-
value_str = `${opts.value}`;
|
|
148
|
-
} else {
|
|
149
|
-
meter_kind.toString();
|
|
150
|
-
throw new import_error.InternalStripeError("invalid_product", `Invalid MeterProduct kind: ${meter_kind}`, {
|
|
151
|
-
product_id: opts.product.id,
|
|
152
|
-
meter_kind
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
const identifier = opts.identifier;
|
|
156
|
-
validate_meter_event_identifier(identifier);
|
|
157
|
-
const now = /* @__PURE__ */ new Date();
|
|
158
|
-
const timestamp_seconds = opts.timestamp ? (0, import_utils.to_unix_seconds)(opts.timestamp) : null;
|
|
159
|
-
if (opts.timestamp) {
|
|
160
|
-
validate_meter_event_timestamp(now, opts.timestamp);
|
|
161
|
-
}
|
|
162
|
-
const stripe_customer_id = await (0, import_customers.ensure_stripe_customer)(client, server, opts.uid);
|
|
163
|
-
await assert_customer_entitled_for_meter_price(client, server, {
|
|
164
|
-
uid: opts.uid,
|
|
165
|
-
meter_product: opts.product,
|
|
166
|
-
stripe_customer_id,
|
|
167
|
-
all_products
|
|
168
|
-
});
|
|
169
|
-
const { customer_key, value_key } = resolve_meter_payload_keys(opts.product);
|
|
170
|
-
const payload = {
|
|
171
|
-
[customer_key]: stripe_customer_id,
|
|
172
|
-
[value_key]: value_str
|
|
173
|
-
};
|
|
174
|
-
const meter_event = await (0, import_utils.stripe_api_call)(() => client.billing.meterEvents.create(
|
|
175
|
-
{
|
|
176
|
-
event_name: opts.product.meter_event_name,
|
|
177
|
-
payload,
|
|
178
|
-
identifier,
|
|
179
|
-
...timestamp_seconds !== null ? { timestamp: timestamp_seconds } : {}
|
|
180
|
-
},
|
|
181
|
-
// Idempotency at the HTTP layer in addition to Stripe's identifier dedupe helps during transient retries.
|
|
182
|
-
{ idempotencyKey: (0, import_utils.stable_idempotency_key)(`meter_event_create_${identifier}`, 255) }
|
|
183
|
-
), {
|
|
184
|
-
operation: "billing.meterEvents.create",
|
|
185
|
-
uid: opts.uid,
|
|
186
|
-
stripe_customer_id,
|
|
187
|
-
stripe_price_id: opts.product.stripe_price_id,
|
|
188
|
-
meter_event_name: opts.product.meter_event_name,
|
|
189
|
-
identifier,
|
|
190
|
-
timestamp_seconds
|
|
191
|
-
});
|
|
192
|
-
return {
|
|
193
|
-
meter_event_identifier: meter_event.identifier,
|
|
194
|
-
event_name: meter_event.event_name,
|
|
195
|
-
timestamp: meter_event.timestamp
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
async function cancel_meter_usage_event(client, server, all_products, opts) {
|
|
199
|
-
(0, import_utils.public_assert)(opts.product.type === "meter", "invalid_argument", "Property 'product' must be a meter product.", {
|
|
200
|
-
product_type: opts.product.type
|
|
201
|
-
});
|
|
202
|
-
(0, import_utils.public_assert)((0, import_utils.is_non_empty_string)(opts.uid), "invalid_argument", "Property 'uid' must be a non-empty string.");
|
|
203
|
-
(0, import_utils.public_assert)((0, import_utils.is_non_empty_string)(opts.meter_event_identifier), "invalid_argument", "Property 'identifier' must be a non-empty string.");
|
|
204
|
-
validate_meter_event_identifier(opts.meter_event_identifier);
|
|
205
|
-
const stripe_customer_id = await (0, import_customers.ensure_stripe_customer)(client, server, opts.uid);
|
|
206
|
-
await assert_customer_entitled_for_meter_price(client, server, {
|
|
207
|
-
uid: opts.uid,
|
|
208
|
-
meter_product: opts.product,
|
|
209
|
-
stripe_customer_id,
|
|
210
|
-
all_products
|
|
211
|
-
});
|
|
212
|
-
const adjustment = await (0, import_utils.stripe_api_call)(() => client.billing.meterEventAdjustments.create({
|
|
213
|
-
event_name: opts.product.meter_event_name,
|
|
214
|
-
type: "cancel",
|
|
215
|
-
cancel: { identifier: opts.meter_event_identifier }
|
|
216
|
-
}, { idempotencyKey: (0, import_utils.stable_idempotency_key)(`meter_event_cancel_${opts.meter_event_identifier}`, 255) }), {
|
|
217
|
-
operation: "billing.meterEventAdjustments.create",
|
|
218
|
-
meter_event_name: opts.product.meter_event_name,
|
|
219
|
-
identifier: opts.meter_event_identifier
|
|
220
|
-
});
|
|
221
|
-
return {
|
|
222
|
-
meter_event_identifier: opts.meter_event_identifier,
|
|
223
|
-
status: adjustment.status
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
227
|
-
0 && (module.exports = {
|
|
228
|
-
cancel_meter_usage_event,
|
|
229
|
-
record_meter_usage
|
|
230
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Daan van den Bergh
|
|
3
|
-
* @copyright © 2026 - 2026 Daan van den Bergh. All rights reserved
|
|
4
|
-
*/
|
|
5
|
-
import Stripe from "stripe";
|
|
6
|
-
import { Server } from "../../server.js";
|
|
7
|
-
/**
|
|
8
|
-
* Create a Stripe SetupIntent so the client can add a payment method and prepare it for off-session billing.
|
|
9
|
-
*
|
|
10
|
-
* Client flow:
|
|
11
|
-
* - Call this endpoint to get `client_secret`.
|
|
12
|
-
* - Confirm SetupIntent on the client (e.g. Stripe.js / mobile SDK).
|
|
13
|
-
* - Call `finalize_payment_method_setup` with the returned `setup_intent_id`.
|
|
14
|
-
*
|
|
15
|
-
* Stripe docs:
|
|
16
|
-
* - SetupIntents overview: https://docs.stripe.com/payments/setup-intents
|
|
17
|
-
* - Create SetupIntent: https://docs.stripe.com/api/setup_intents/create
|
|
18
|
-
*/
|
|
19
|
-
export declare function create_payment_method_setup_intent(client: Stripe, server: Server, opts: {
|
|
20
|
-
/** The internal user id, used to resolve/ensure Stripe customer. */
|
|
21
|
-
uid: string;
|
|
22
|
-
/** An optional idempotency key. */
|
|
23
|
-
idempotency_key?: string;
|
|
24
|
-
}): Promise<{
|
|
25
|
-
/** The SetupIntent id. */
|
|
26
|
-
id: string;
|
|
27
|
-
/** The client secret used by the client to confirm the SetupIntent. */
|
|
28
|
-
client_secret: string;
|
|
29
|
-
/** The Stripe customer id. */
|
|
30
|
-
stripe_customer_id: string;
|
|
31
|
-
}>;
|
|
32
|
-
/**
|
|
33
|
-
* Finalize a confirmed SetupIntent by setting its payment method as the customer's default for invoices/subscriptions.
|
|
34
|
-
*
|
|
35
|
-
* This ensures future subscription invoices can be charged automatically.
|
|
36
|
-
*
|
|
37
|
-
* Stripe docs:
|
|
38
|
-
* - Retrieve SetupIntent: https://docs.stripe.com/api/setup_intents/retrieve
|
|
39
|
-
* - Update customer invoice_settings.default_payment_method: https://docs.stripe.com/api/customers/update
|
|
40
|
-
*/
|
|
41
|
-
export declare function finalize_payment_method_setup(client: Stripe, server: Server, opts: {
|
|
42
|
-
/** The internal user id, used to resolve/ensure Stripe customer. */
|
|
43
|
-
uid: string;
|
|
44
|
-
/**
|
|
45
|
-
* The SetupIntent id after client confirmation.
|
|
46
|
-
* The client should send this to the backend once confirmation succeeded.
|
|
47
|
-
*/
|
|
48
|
-
setup_intent_id: string;
|
|
49
|
-
/** Optional idempotency key. */
|
|
50
|
-
idempotency_key?: string;
|
|
51
|
-
}): Promise<{
|
|
52
|
-
/** The Stripe customer id. */
|
|
53
|
-
stripe_customer_id: string;
|
|
54
|
-
/** The payment method id that is now set as default. */
|
|
55
|
-
payment_method_id: string;
|
|
56
|
-
/** The SetupIntent id used to finalize. */
|
|
57
|
-
setup_intent_id: string;
|
|
58
|
-
}>;
|