alepha 0.22.0 → 0.24.0
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/assets/swagger-ui/swagger-ui-bundle.js +1 -1
- package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
- package/dist/api/audits/index.browser.js +49 -52
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.d.ts +629 -565
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +206 -98
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.browser.js +44 -44
- package/dist/api/files/index.browser.js.map +1 -1
- package/dist/api/files/index.d.ts +292 -293
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +61 -64
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.browser.js +61 -59
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +546 -347
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +165 -86
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +242 -230
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/keys/index.js +63 -66
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.browser.js +40 -38
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +339 -209
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +108 -60
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/oauth/index.d.ts +190 -78
- package/dist/api/oauth/index.d.ts.map +1 -1
- package/dist/api/oauth/index.js +290 -68
- package/dist/api/oauth/index.js.map +1 -1
- package/dist/api/organizations/index.browser.js +14 -14
- package/dist/api/organizations/index.browser.js.map +1 -1
- package/dist/api/organizations/index.d.ts +158 -134
- package/dist/api/organizations/index.d.ts.map +1 -1
- package/dist/api/organizations/index.js +18 -18
- package/dist/api/organizations/index.js.map +1 -1
- package/dist/api/parameters/index.browser.js +74 -53
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +607 -513
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +205 -127
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/payments/index.d.ts +652 -449
- package/dist/api/payments/index.d.ts.map +1 -1
- package/dist/api/payments/index.js +159 -93
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/subscriptions/index.d.ts +1032 -762
- package/dist/api/subscriptions/index.d.ts.map +1 -1
- package/dist/api/subscriptions/index.js +166 -185
- package/dist/api/subscriptions/index.js.map +1 -1
- package/dist/api/users/index.browser.js +48 -71
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1297 -1109
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +454 -369
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.browser.js +17 -17
- package/dist/api/verifications/index.browser.js.map +1 -1
- package/dist/api/verifications/index.d.ts +169 -157
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +47 -95
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/background/index.d.ts +0 -1
- package/dist/background/index.d.ts.map +1 -1
- package/dist/background/index.js.map +1 -1
- package/dist/background/index.workerd.js.map +1 -1
- package/dist/batch/index.d.ts +0 -1
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js.map +1 -1
- package/dist/bin/index.js +1 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/bucket/index.d.ts +27 -32
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +56 -26
- package/dist/bucket/index.js.map +1 -1
- package/dist/bucket/index.workerd.js +52 -24
- package/dist/bucket/index.workerd.js.map +1 -1
- package/dist/cache/core/index.d.ts +4 -6
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +4 -10
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js +4 -10
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/cache/database/index.d.ts +22 -23
- package/dist/cache/database/index.d.ts.map +1 -1
- package/dist/cache/database/index.js +11 -20
- package/dist/cache/database/index.js.map +1 -1
- package/dist/cache/redis/index.d.ts +3 -4
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cache/redis/index.js +2 -2
- package/dist/cache/redis/index.js.map +1 -1
- package/dist/captcha/index.d.ts.map +1 -1
- package/dist/captcha/index.js +4 -4
- package/dist/captcha/index.js.map +1 -1
- package/dist/cli/config/index.d.ts +0 -1
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/core/index.d.ts +244 -475
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +308 -383
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +3 -9
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js +3 -3
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/i18n/index.d.ts +20 -39
- package/dist/cli/i18n/index.d.ts.map +1 -1
- package/dist/cli/i18n/index.js +51 -17
- package/dist/cli/i18n/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +89 -82
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +27 -33
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/platform-lib/index.d.ts +383 -410
- package/dist/cli/platform-lib/index.d.ts.map +1 -1
- package/dist/cli/platform-lib/index.js +300 -258
- package/dist/cli/platform-lib/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +17 -41
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +10 -13
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts +82 -194
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +160 -563
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +845 -859
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +787 -527
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +845 -859
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +845 -859
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +845 -859
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.browser.js +1 -1
- package/dist/crypto/index.browser.js.map +1 -1
- package/dist/crypto/index.d.ts +3 -4
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js +6 -3
- package/dist/crypto/index.js.map +1 -1
- package/dist/datetime/index.d.ts +12 -2
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +6 -1
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/brevo/index.d.ts +0 -1
- package/dist/email/brevo/index.d.ts.map +1 -1
- package/dist/email/brevo/index.js +4 -4
- package/dist/email/brevo/index.js.map +1 -1
- package/dist/email/cloudflare/index.d.ts +0 -1
- package/dist/email/cloudflare/index.d.ts.map +1 -1
- package/dist/email/cloudflare/index.js +2 -2
- package/dist/email/cloudflare/index.js.map +1 -1
- package/dist/email/core/index.d.ts +15 -7
- package/dist/email/core/index.d.ts.map +1 -1
- package/dist/email/core/index.js +14 -5
- package/dist/email/core/index.js.map +1 -1
- package/dist/email/core/index.workerd.js +5 -1
- package/dist/email/core/index.workerd.js.map +1 -1
- package/dist/email/smtp/index.d.ts +8 -9
- package/dist/email/smtp/index.d.ts.map +1 -1
- package/dist/email/smtp/index.js +702 -479
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/fake/index.d.ts +1580 -1238
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/fake/index.js +11728 -32131
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +13 -9
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +5 -5
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.d.ts +0 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.d.ts +81 -69
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +123 -56
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +36 -90
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +65 -70
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +54 -40
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +140 -106
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +145 -150
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +144 -109
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +64 -54
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +36 -76
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +67 -57
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +62 -75
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/core/index.js +48 -71
- package/dist/queue/core/index.js.map +1 -1
- package/dist/queue/core/index.workerd.js +48 -71
- package/dist/queue/core/index.workerd.js.map +1 -1
- package/dist/queue/redis/index.d.ts +3 -4
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/queue/redis/index.js +2 -2
- package/dist/queue/redis/index.js.map +1 -1
- package/dist/react/auth/index.browser.js.map +1 -1
- package/dist/react/auth/index.d.ts +7 -4
- package/dist/react/auth/index.d.ts.map +1 -1
- package/dist/react/auth/index.js.map +1 -1
- package/dist/react/core/index.d.ts +87 -5
- package/dist/react/core/index.d.ts.map +1 -1
- package/dist/react/core/index.js +170 -23
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +4 -6
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +107 -71
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/head/index.browser.js.map +1 -1
- package/dist/react/head/index.d.ts +0 -1
- package/dist/react/head/index.d.ts.map +1 -1
- package/dist/react/head/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +47 -5
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js +116 -12
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.d.ts +1 -4
- package/dist/react/intro/index.d.ts.map +1 -1
- package/dist/react/intro/index.js.map +1 -1
- package/dist/react/router/index.browser.js +188 -29
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +480 -372
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +261 -47
- package/dist/react/router/index.js.map +1 -1
- package/dist/react/sitemap/index.browser.js +35 -0
- package/dist/react/sitemap/index.browser.js.map +1 -0
- package/dist/react/sitemap/index.d.ts +91 -0
- package/dist/react/sitemap/index.d.ts.map +1 -0
- package/dist/react/sitemap/index.js +131 -0
- package/dist/react/sitemap/index.js.map +1 -0
- package/dist/react/testing/index.d.ts +4 -5
- package/dist/react/testing/index.d.ts.map +1 -1
- package/dist/react/testing/index.js +41 -15
- package/dist/react/testing/index.js.map +1 -1
- package/dist/react/testing/{chunk-BpyX8vjI.js → rolldown-runtime-Bl3dcgcQ.js} +1 -1
- package/dist/react/ui/index.d.ts +35 -34
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/react/ui/index.js +12 -17
- package/dist/react/ui/index.js.map +1 -1
- package/dist/redis/index.bun.js +5 -5
- package/dist/redis/index.bun.js.map +1 -1
- package/dist/redis/index.d.ts +6 -7
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +6 -6
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +0 -1
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/retry/index.js.map +1 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +4 -12
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +9 -4
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/index.workerd.js +9 -4
- package/dist/scheduler/index.workerd.js.map +1 -1
- package/dist/security/index.browser.js +30 -28
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +113 -44
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +452 -37
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.browser.js +19 -19
- package/dist/server/auth/index.browser.js.map +1 -1
- package/dist/server/auth/index.d.ts +215 -187
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +1145 -86
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.browser.js +103 -5
- package/dist/server/cookies/index.browser.js.map +1 -1
- package/dist/server/cookies/index.d.ts +86 -4
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +121 -8
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js +22 -27
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +134 -85
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +130 -118
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +9 -10
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/cors/index.js +14 -26
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/etag/index.d.ts +2 -3
- package/dist/server/etag/index.d.ts.map +1 -1
- package/dist/server/etag/index.js.map +1 -1
- package/dist/server/health/index.d.ts +18 -19
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/health/index.js +6 -6
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/links/index.browser.js +15 -18
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +66 -67
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +29 -32
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +0 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/metrics/index.js +10 -3
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/proxy/index.d.ts +0 -1
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +8 -9
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.js +6 -12
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.d.ts +0 -1
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +4 -4
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +37 -25
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +0 -1
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js.map +1 -1
- package/dist/system/index.d.ts +0 -1
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +2 -1
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js.map +1 -1
- package/dist/topic/core/index.d.ts +19 -20
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/core/index.js +8 -8
- package/dist/topic/core/index.js.map +1 -1
- package/dist/topic/redis/index.d.ts +3 -4
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/topic/redis/index.js +2 -2
- package/dist/topic/redis/index.js.map +1 -1
- package/package.json +36 -36
- package/src/api/audits/__tests__/AuditJobs.spec.ts +83 -0
- package/src/api/audits/__tests__/AuditService.spec.ts +139 -1
- package/src/api/audits/controllers/AdminAuditController.ts +41 -41
- package/src/api/audits/entities/audits.ts +22 -22
- package/src/api/audits/index.ts +6 -1
- package/src/api/audits/jobs/AuditJobs.ts +29 -0
- package/src/api/audits/parameters/AuditParameters.ts +51 -0
- package/src/api/audits/primitives/$audit.ts +24 -0
- package/src/api/audits/schemas/auditQuerySchema.ts +13 -13
- package/src/api/audits/schemas/createAuditSchema.ts +18 -18
- package/src/api/audits/services/AuditService.ts +79 -7
- package/src/api/files/__tests__/FileController.spec.ts +5 -5
- package/src/api/files/__tests__/FileJobs.spec.ts +6 -0
- package/src/api/files/controllers/FileController.ts +25 -25
- package/src/api/files/entities/files.ts +15 -15
- package/src/api/files/schemas/fileCreatorSummarySchema.ts +7 -7
- package/src/api/files/schemas/fileQuerySchema.ts +9 -9
- package/src/api/files/schemas/fileResourceSchema.ts +7 -9
- package/src/api/files/schemas/storageStatsSchema.ts +13 -13
- package/src/api/jobs/__tests__/$job-hardening.spec.ts +289 -0
- package/src/api/jobs/__tests__/$job.spec.ts +18 -18
- package/src/api/jobs/controllers/AdminJobController.ts +8 -8
- package/src/api/jobs/entities/jobExecutionEntity.ts +29 -19
- package/src/api/jobs/providers/JobProvider.ts +128 -12
- package/src/api/jobs/providers/JobQueueProvider.ts +2 -2
- package/src/api/jobs/schemas/jobConfigAtom.ts +22 -22
- package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +6 -6
- package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +11 -15
- package/src/api/jobs/schemas/jobRegistrationSchema.ts +20 -19
- package/src/api/jobs/schemas/triggerJobSchema.ts +3 -3
- package/src/api/jobs/services/JobService.ts +6 -6
- package/src/api/keys/__tests__/ApiKeyService.spec.ts +2 -2
- package/src/api/keys/controllers/AdminApiKeyController.ts +10 -10
- package/src/api/keys/entities/apiKeyEntity.ts +15 -15
- package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +4 -4
- package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +15 -15
- package/src/api/keys/schemas/createApiKeyBodySchema.ts +5 -5
- package/src/api/keys/schemas/createApiKeyResponseSchema.ts +9 -9
- package/src/api/keys/schemas/listApiKeyResponseSchema.ts +13 -13
- package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +3 -3
- package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +3 -3
- package/src/api/notifications/__tests__/AlephaApiNotifications.spec.ts +2 -2
- package/src/api/notifications/controllers/AdminNotificationController.ts +38 -14
- package/src/api/notifications/jobs/NotificationJobs.ts +7 -6
- package/src/api/notifications/primitives/$notification.ts +43 -4
- package/src/api/notifications/schemas/notificationContactPreferencesSchema.ts +4 -4
- package/src/api/notifications/schemas/notificationContactSchema.ts +7 -7
- package/src/api/notifications/schemas/notificationDetailResourceSchema.ts +9 -11
- package/src/api/notifications/schemas/notificationPayloadSchema.ts +11 -9
- package/src/api/notifications/schemas/notificationQuerySchema.ts +6 -6
- package/src/api/notifications/schemas/notificationResourceSchema.ts +14 -14
- package/src/api/notifications/services/NotificationSenderService.ts +38 -2
- package/src/api/oauth/__tests__/OAuthClientService.spec.ts +42 -0
- package/src/api/oauth/__tests__/OAuthController.spec.ts +128 -0
- package/src/api/oauth/controllers/OAuthController.ts +132 -12
- package/src/api/oauth/entities/oauthClientEntity.ts +29 -12
- package/src/api/oauth/helpers/oauthMetadata.ts +1 -0
- package/src/api/oauth/helpers/oidcMetadata.ts +19 -0
- package/src/api/oauth/index.ts +1 -0
- package/src/api/oauth/schemas/authorizeDecisionBodySchema.ts +12 -11
- package/src/api/oauth/schemas/authorizeQuerySchema.ts +12 -10
- package/src/api/oauth/schemas/registerClientBodySchema.ts +10 -11
- package/src/api/oauth/schemas/tokenRequestBodySchema.ts +9 -8
- package/src/api/oauth/services/OAuthClientService.ts +228 -15
- package/src/api/organizations/controllers/AdminOrganizationController.ts +8 -8
- package/src/api/organizations/entities/organizations.ts +6 -6
- package/src/api/organizations/schemas/createOrganizationSchema.ts +5 -5
- package/src/api/organizations/schemas/organizationQuerySchema.ts +4 -4
- package/src/api/organizations/schemas/updateOrganizationSchema.ts +1 -2
- package/src/api/parameters/__tests__/$parameter.spec.ts +229 -50
- package/src/api/parameters/controllers/AdminParameterController.ts +9 -12
- package/src/api/parameters/entities/parameters.ts +29 -16
- package/src/api/parameters/primitives/$parameter.ts +3 -3
- package/src/api/parameters/schemas/activateParameterBodySchema.ts +4 -4
- package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +15 -15
- package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +7 -7
- package/src/api/parameters/schemas/parameterCurrentResponseSchema.ts +7 -7
- package/src/api/parameters/schemas/parameterHistoryResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/parameterNameParamSchema.ts +2 -3
- package/src/api/parameters/schemas/parameterNamesResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/parameterResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/parameterStatusSchema.ts +2 -2
- package/src/api/parameters/schemas/parameterTreeNodeSchema.ts +6 -6
- package/src/api/parameters/schemas/parameterVersionParamSchema.ts +5 -6
- package/src/api/parameters/schemas/parameterVersionResponseSchema.ts +3 -3
- package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +6 -9
- package/src/api/parameters/services/ParameterProvider.ts +152 -65
- package/src/api/payments/controllers/AdminPaymentController.ts +7 -7
- package/src/api/payments/controllers/MockCheckoutController.ts +79 -28
- package/src/api/payments/controllers/PaymentController.ts +4 -4
- package/src/api/payments/entities/paymentIntents.ts +11 -11
- package/src/api/payments/entities/paymentMethods.ts +11 -11
- package/src/api/payments/entities/refunds.ts +9 -9
- package/src/api/payments/providers/PaymentProvider.ts +18 -0
- package/src/api/payments/schemas/intentSchemas.ts +25 -25
- package/src/api/payments/schemas/paymentMethodSchemas.ts +3 -3
- package/src/api/payments/services/PaymentService.ts +60 -3
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +14 -0
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +11 -11
- package/src/api/subscriptions/controllers/SubscriptionController.ts +5 -4
- package/src/api/subscriptions/entities/subscriptionEvents.ts +15 -15
- package/src/api/subscriptions/entities/subscriptions.ts +22 -22
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +22 -22
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +4 -4
- package/src/api/subscriptions/schemas/changePlanSchema.ts +5 -5
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +14 -7
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +10 -10
- package/src/api/subscriptions/schemas/mrrSchema.ts +9 -9
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +21 -21
- package/src/api/subscriptions/schemas/planResourceSchema.ts +19 -19
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +8 -8
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +7 -7
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +17 -17
- package/src/api/subscriptions/services/SubscriptionConfig.ts +2 -2
- package/src/api/users/__tests__/ApiKeys-integration.spec.ts +11 -11
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +111 -119
- package/src/api/users/controllers/AdminIdentityController.ts +29 -19
- package/src/api/users/controllers/AdminSessionController.ts +37 -27
- package/src/api/users/controllers/AdminUserController.ts +75 -53
- package/src/api/users/controllers/MySessionController.ts +125 -0
- package/src/api/users/controllers/RealmController.ts +9 -9
- package/src/api/users/controllers/UserController.ts +55 -55
- package/src/api/users/entities/identities.ts +8 -8
- package/src/api/users/entities/sessions.ts +17 -17
- package/src/api/users/entities/users.ts +17 -17
- package/src/api/users/index.ts +3 -0
- package/src/api/users/notifications/UserNotifications.ts +76 -24
- package/src/api/users/primitives/$realm.ts +12 -0
- package/src/api/users/schemas/completePasswordResetRequestSchema.ts +8 -12
- package/src/api/users/schemas/completeRegistrationRequestSchema.ts +17 -20
- package/src/api/users/schemas/createUserSchema.ts +2 -2
- package/src/api/users/schemas/identityQuerySchema.ts +4 -4
- package/src/api/users/schemas/identityResourceSchema.ts +3 -2
- package/src/api/users/schemas/loginSchema.ts +4 -4
- package/src/api/users/schemas/passwordResetIntentResponseSchema.ts +6 -8
- package/src/api/users/schemas/realmConfigSchema.ts +10 -10
- package/src/api/users/schemas/registerQuerySchema.ts +6 -6
- package/src/api/users/schemas/registerRequestSchema.ts +21 -43
- package/src/api/users/schemas/registerResponseSchema.ts +2 -2
- package/src/api/users/schemas/registerSchema.ts +13 -31
- package/src/api/users/schemas/registrationIntentResponseSchema.ts +19 -23
- package/src/api/users/schemas/resetPasswordSchema.ts +10 -17
- package/src/api/users/schemas/sessionQuerySchema.ts +3 -3
- package/src/api/users/schemas/sessionResourceSchema.ts +25 -25
- package/src/api/users/schemas/updateUserSchema.ts +3 -4
- package/src/api/users/schemas/userQuerySchema.ts +7 -7
- package/src/api/users/services/RegistrationService.ts +25 -11
- package/src/api/users/services/UserService.ts +12 -6
- package/src/api/verifications/__tests__/CodeVerification.spec.ts +63 -101
- package/src/api/verifications/__tests__/LinkVerification.spec.ts +23 -92
- package/src/api/verifications/controllers/VerificationController.ts +13 -27
- package/src/api/verifications/entities/verifications.ts +13 -14
- package/src/api/verifications/schemas/requestVerificationCodeResponseSchema.ts +17 -14
- package/src/api/verifications/schemas/validateVerificationCodeResponseSchema.ts +9 -10
- package/src/api/verifications/schemas/verificationSettingsSchema.ts +65 -66
- package/src/api/verifications/schemas/verificationTypeEnumSchema.ts +2 -2
- package/src/api/verifications/services/VerificationService.ts +12 -0
- package/src/background/__tests__/BackgroundTaskProvider.spec.ts +36 -0
- package/src/batch/__tests__/$batch.spec.ts +22 -22
- package/src/batch/__tests__/startup-buffering.spec.ts +9 -9
- package/src/bin/index.ts +1 -1
- package/src/bucket/__tests__/TenantScopedBucket.spec.ts +60 -0
- package/src/bucket/providers/LocalFileStorageProvider.ts +14 -6
- package/src/bucket/providers/MemoryFileStorageProvider.ts +18 -7
- package/src/bucket/providers/R2FileStorageProvider.ts +14 -6
- package/src/bucket/providers/S3FileStorageProvider.ts +31 -15
- package/src/cache/core/primitives/$cache.ts +7 -10
- package/src/cache/database/entities/cacheEntries.ts +16 -27
- package/src/cache/database/providers/DatabaseCacheProvider.ts +15 -13
- package/src/cache/redis/providers/RedisCacheProvider.ts +6 -6
- package/src/captcha/providers/TurnstileCaptchaProvider.ts +4 -4
- package/src/cli/core/__tests__/BuildCloudflareTask.spec.ts +178 -0
- package/src/cli/core/__tests__/BuildDockerTask.spec.ts +0 -2
- package/src/cli/core/__tests__/DbCommand.spec.ts +108 -0
- package/src/cli/core/atoms/appEntryOptions.ts +5 -5
- package/src/cli/core/atoms/buildOptions.ts +76 -88
- package/src/cli/core/atoms/changelogOptions.ts +3 -3
- package/src/cli/core/atoms/devOptions.ts +3 -3
- package/src/cli/core/commands/build.ts +36 -49
- package/src/cli/core/commands/db.ts +171 -83
- package/src/cli/core/commands/dev.ts +8 -8
- package/src/cli/core/commands/gen/changelog.ts +12 -14
- package/src/cli/core/commands/gen/env.ts +6 -6
- package/src/cli/core/commands/gen/openapi.ts +6 -6
- package/src/cli/core/commands/init.ts +28 -33
- package/src/cli/core/commands/pack.ts +10 -10
- package/src/cli/core/commands/root.ts +7 -8
- package/src/cli/core/commands/test.ts +17 -20
- package/src/cli/core/index.ts +0 -3
- package/src/cli/core/tasks/BuildCloudflareTask.ts +138 -245
- package/src/cli/core/tasks/BuildPrerenderTask.ts +44 -7
- package/src/cli/core/templates/apiHelloResponseSchemaTs.ts +4 -4
- package/src/cli/devtools/atoms/devtoolsOptions.ts +6 -6
- package/src/cli/i18n/__tests__/I18nCheckService.spec.ts +48 -0
- package/src/cli/i18n/atoms/i18nOptions.ts +8 -8
- package/src/cli/i18n/services/I18nCheckService.ts +65 -11
- package/src/cli/platform/commands/SecretsCommand.ts +24 -25
- package/src/cli/platform/commands/platform.ts +40 -46
- package/src/cli/platform/index.ts +1 -1
- package/src/cli/platform-lib/__tests__/CloudflareAdapter.spec.ts +0 -4
- package/src/cli/platform-lib/__tests__/PlatformInspector.spec.ts +10 -3
- package/src/cli/platform-lib/__tests__/VercelAdapter.spec.ts +0 -2
- package/src/cli/platform-lib/adapters/CloudflareAdapter.ts +141 -50
- package/src/cli/platform-lib/adapters/VercelAdapter.ts +6 -11
- package/src/cli/platform-lib/atoms/platformOptions.ts +46 -25
- package/src/cli/platform-lib/schemas/cloudflare.ts +87 -87
- package/src/cli/platform-lib/schemas/platform.ts +51 -51
- package/src/cli/platform-lib/schemas/vercel.ts +28 -28
- package/src/cli/platform-lib/services/CloudflareApi.ts +5 -5
- package/src/cli/platform-lib/services/VercelApi.ts +4 -4
- package/src/cli/platform-lib/services/VercelCli.ts +6 -15
- package/src/cli/platform-lib/services/WranglerApi.ts +6 -15
- package/src/cli/vendor/atoms/vendorOptions.ts +9 -9
- package/src/cli/vendor/commands/VendorCommand.ts +11 -12
- package/src/command/__tests__/$command.spec.ts +82 -83
- package/src/command/__tests__/Asker.spec.ts +6 -13
- package/src/command/__tests__/CliProvider.spec.ts +136 -149
- package/src/command/__tests__/Runner.spec.ts +86 -110
- package/src/command/helpers/Asker.ts +23 -58
- package/src/command/helpers/Runner.ts +34 -110
- package/src/command/index.ts +4 -9
- package/src/command/primitives/$command.ts +10 -10
- package/src/command/providers/CliProvider.ts +183 -161
- package/src/core/Alepha.ts +62 -13
- package/src/core/__tests__/$atom.spec.ts +52 -3
- package/src/core/__tests__/$computed.spec.ts +129 -0
- package/src/core/__tests__/$env.spec.ts +13 -13
- package/src/core/__tests__/$inject.spec.ts +4 -4
- package/src/core/__tests__/$module.spec.ts +1 -1
- package/src/core/__tests__/Alepha-graph.spec.ts +1 -1
- package/src/core/__tests__/Alepha-parseEnv.spec.ts +32 -32
- package/src/core/__tests__/Alepha-start.spec.ts +3 -3
- package/src/core/__tests__/CodecManager.spec.ts +113 -94
- package/src/core/__tests__/KeylessJsonSchemaCodec.spec.ts +138 -138
- package/src/core/__tests__/SchemaValidator.spec.ts +43 -44
- package/src/core/__tests__/StateManager.persist.browser.spec.ts +87 -0
- package/src/core/__tests__/StateManager.spec.ts +423 -0
- package/src/core/__tests__/TypeBox-usecases.spec.ts +8 -8
- package/src/core/__tests__/TypeProvider.spec.ts +314 -309
- package/src/core/__tests__/dump.spec.ts +6 -6
- package/src/core/__tests__/pagination.spec.ts +4 -4
- package/src/core/__tests__/scoped-after-start.spec.ts +43 -0
- package/src/core/errors/TypeBoxError.ts +10 -4
- package/src/core/helpers/FileLike.ts +5 -5
- package/src/core/helpers/coerceStrings.ts +70 -0
- package/src/core/helpers/jsonSchemaToZod.ts +112 -0
- package/src/core/index.shared.ts +4 -1
- package/src/core/primitives/$atom.ts +95 -27
- package/src/core/primitives/$computed.ts +148 -0
- package/src/core/primitives/$env.ts +5 -5
- package/src/core/primitives/$state.ts +1 -1
- package/src/core/providers/AlsProvider.ts +26 -0
- package/src/core/providers/CodecManager.ts +1 -2
- package/src/core/providers/JsonSchemaCodec.ts +1 -2
- package/src/core/providers/KeylessJsonSchemaCodec.ts +82 -57
- package/src/core/providers/SchemaValidator.ts +48 -158
- package/src/core/providers/StateManager.ts +383 -9
- package/src/core/providers/TypeProvider.ts +80 -734
- package/src/core/providers/ZodProvider.ts +380 -0
- package/src/core/providers/zodAugment.ts +69 -0
- package/src/core/schemas/pageQuerySchema.ts +19 -21
- package/src/core/schemas/pageSchema.ts +47 -57
- package/src/crypto/__tests__/SecretProvider.spec.ts +31 -0
- package/src/crypto/providers/SecretProvider.ts +16 -10
- package/src/datetime/primitives/$throttle.ts +6 -1
- package/src/email/brevo/providers/BrevoEmailProvider.ts +4 -4
- package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +6 -6
- package/src/email/core/index.ts +7 -2
- package/src/email/core/primitives/$email.ts +5 -1
- package/src/email/core/providers/LocalEmailProvider.ts +5 -5
- package/src/email/smtp/providers/NodemailerEmailProvider.ts +41 -52
- package/src/fake/__tests__/FakeProvider.spec.ts +110 -110
- package/src/fake/__tests__/keyName.example.ts +21 -21
- package/src/fake/__tests__/keyName.spec.ts +41 -41
- package/src/fake/__tests__/module.example.ts +8 -8
- package/src/fake/providers/FakeProvider.ts +122 -121
- package/src/lock/core/__tests__/lock-mutual-exclusion.spec.ts +44 -0
- package/src/lock/core/index.ts +1 -0
- package/src/lock/core/primitives/$lock.ts +13 -6
- package/src/logger/__tests__/CliFormatterProvider.spec.ts +76 -0
- package/src/logger/__tests__/Logger.spec.ts +49 -0
- package/src/logger/index.ts +25 -18
- package/src/logger/providers/CliFormatterProvider.ts +75 -0
- package/src/logger/schemas/logEntrySchema.ts +10 -10
- package/src/logger/services/Logger.ts +18 -0
- package/src/mcp/__tests__/$prompt.spec.ts +21 -23
- package/src/mcp/__tests__/$tool.spec.ts +22 -22
- package/src/mcp/__tests__/McpServerProvider.spec.ts +82 -11
- package/src/mcp/__tests__/StreamableHttpMcpTransport.spec.ts +2 -2
- package/src/mcp/__tests__/integration.spec.ts +33 -33
- package/src/mcp/primitives/$prompt.ts +11 -9
- package/src/mcp/primitives/$tool.ts +27 -86
- package/src/mcp/providers/McpServerProvider.ts +55 -0
- package/src/mcp/transports/StreamableHttpMcpTransport.ts +7 -7
- package/src/orm/__tests__/$repository-tests.ts +133 -27
- package/src/orm/__tests__/$repository.spec.ts +23 -0
- package/src/orm/__tests__/$transactional-tests.ts +4 -4
- package/src/orm/__tests__/ModelBuilder-tests.ts +28 -28
- package/src/orm/__tests__/ModelBuilder.spec.ts +124 -106
- package/src/orm/__tests__/QueryManager.spec.ts +5 -5
- package/src/orm/__tests__/delete-returning-tests.ts +11 -11
- package/src/orm/__tests__/deletedAt-tests.ts +3 -3
- package/src/orm/__tests__/enums.spec.ts +29 -25
- package/src/orm/__tests__/execute-tests.ts +8 -8
- package/src/orm/__tests__/fixtures/bigEntitySchema.ts +48 -48
- package/src/orm/__tests__/fixtures/userEntitySchema.ts +6 -6
- package/src/orm/__tests__/joins-tests.ts +30 -30
- package/src/orm/__tests__/organization-tests.ts +105 -3
- package/src/orm/__tests__/organization.spec.ts +46 -0
- package/src/orm/__tests__/orm-errors.spec.ts +10 -10
- package/src/orm/__tests__/orm-next-tests.ts +29 -29
- package/src/orm/__tests__/orm-showcase-tests.ts +9 -9
- package/src/orm/__tests__/primaryKey.spec.ts +4 -4
- package/src/orm/__tests__/query-date-encoding-tests.ts +17 -17
- package/src/orm/__tests__/ref-auto-onDelete.spec.ts +14 -14
- package/src/orm/__tests__/references.spec.ts +7 -7
- package/src/orm/__tests__/security.spec.ts +17 -17
- package/src/orm/__tests__/string-operators-tests.ts +5 -5
- package/src/orm/__tests__/timestamps-tests.ts +14 -14
- package/src/orm/__tests__/validation-tests.ts +5 -5
- package/src/orm/core/__tests__/BunSqliteProvider.bun.spec.ts +8 -8
- package/src/orm/core/constants/PG_SYMBOLS.ts +13 -1
- package/src/orm/core/entities/alephaSequences.ts +8 -8
- package/src/orm/core/helpers/pgAttr.ts +4 -4
- package/src/orm/core/primitives/$entity.ts +10 -6
- package/src/orm/core/providers/DatabaseTypeProvider.ts +46 -53
- package/src/orm/core/providers/drivers/BunSqliteProvider.ts +8 -8
- package/src/orm/core/providers/drivers/CloudflareD1Provider.ts +3 -5
- package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +8 -8
- package/src/orm/core/schemas/databaseEnvSchema.ts +4 -4
- package/src/orm/core/schemas/insertSchema.ts +14 -18
- package/src/orm/core/schemas/legacyIdSchema.ts +2 -2
- package/src/orm/core/schemas/updateSchema.ts +10 -16
- package/src/orm/core/services/PgRelationManager.ts +2 -2
- package/src/orm/core/services/QueryManager.ts +13 -2
- package/src/orm/core/services/Repository.ts +88 -33
- package/src/orm/core/services/SqliteModelBuilder.ts +38 -45
- package/src/orm/postgres/__tests__/BunPostgresProvider.bun.spec.ts +4 -4
- package/src/orm/postgres/providers/CloudflareHyperdriveProvider.ts +4 -6
- package/src/orm/postgres/schemas/postgresEnvSchema.ts +6 -6
- package/src/orm/postgres/services/PostgresModelBuilder.ts +127 -114
- package/src/queue/core/__tests__/$consumer.spec.ts +4 -4
- package/src/queue/core/__tests__/WorkerProvider.spec.ts +4 -4
- package/src/queue/core/__tests__/shared.ts +6 -6
- package/src/queue/core/primitives/$consumer.ts +5 -5
- package/src/queue/core/primitives/$queue.ts +44 -61
- package/src/queue/core/providers/CloudflareQueueProvider.ts +6 -0
- package/src/queue/core/providers/WorkerProvider.ts +17 -14
- package/src/queue/redis/providers/RedisQueueProvider.ts +3 -3
- package/src/react/core/__tests__/ErrorBoundary.browser.spec.tsx +92 -0
- package/src/react/core/__tests__/Router.spec.tsx +4 -4
- package/src/react/core/__tests__/useComputed.browser.spec.tsx +192 -0
- package/src/react/core/__tests__/useQuery.browser.spec.tsx +48 -0
- package/src/react/core/__tests__/useSelector.browser.spec.tsx +105 -0
- package/src/react/core/__tests__/useStore.browser.spec.tsx +113 -0
- package/src/react/core/components/ErrorBoundary.tsx +42 -0
- package/src/react/core/hooks/useAction.ts +56 -19
- package/src/react/core/hooks/useComputed.ts +91 -0
- package/src/react/core/hooks/useSelector.ts +67 -0
- package/src/react/core/hooks/useStore.ts +36 -17
- package/src/react/core/index.ts +3 -0
- package/src/react/core/utils/shallowEqual.ts +36 -0
- package/src/react/form/__tests__/FormModel-submit-loading.spec.ts +71 -0
- package/src/react/form/__tests__/form-submitting-reactive.browser.spec.tsx +96 -0
- package/src/react/form/__tests__/useForm.browser.spec.tsx +54 -54
- package/src/react/form/errors/FormValidationError.ts +0 -2
- package/src/react/form/hooks/useForm.ts +19 -4
- package/src/react/form/hooks/useFormQuerySync.ts +0 -0
- package/src/react/form/services/FormModel.ts +124 -86
- package/src/react/form/services/parseField.ts +66 -27
- package/src/react/i18n/__tests__/I18nProvider.spec.ts +89 -0
- package/src/react/i18n/__tests__/Localize.spec.tsx +1 -1
- package/src/react/i18n/__tests__/locale-routing.spec.ts +107 -0
- package/src/react/i18n/providers/I18nProvider.ts +173 -14
- package/src/react/router/__tests__/$page.browser.spec.tsx +19 -19
- package/src/react/router/__tests__/$page.spec.tsx +21 -21
- package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +87 -1
- package/src/react/router/__tests__/RouterLocaleProvider.spec.ts +127 -0
- package/src/react/router/atoms/ssrManifestAtom.ts +16 -16
- package/src/react/router/components/NestedView.tsx +11 -3
- package/src/react/router/hooks/useQueryParams.ts +1 -1
- package/src/react/router/index.browser.ts +4 -0
- package/src/react/router/index.shared.ts +1 -0
- package/src/react/router/index.ts +9 -0
- package/src/react/router/primitives/$page.ts +2 -2
- package/src/react/router/providers/ReactBrowserProvider.ts +64 -13
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +15 -1
- package/src/react/router/providers/ReactPageProvider.ts +38 -13
- package/src/react/router/providers/ReactServerProvider.ts +105 -16
- package/src/react/router/providers/RootComponentsProvider.ts +13 -0
- package/src/react/router/providers/RouterLocaleProvider.ts +125 -0
- package/src/react/router/providers/__tests__/RootComponentsProvider.spec.ts +15 -0
- package/src/react/router/providers/__tests__/rootComponents.ssr.browser.spec.tsx +67 -0
- package/src/react/sitemap/__tests__/$sitemap.spec.ts +131 -0
- package/src/react/sitemap/index.browser.ts +21 -0
- package/src/react/sitemap/index.ts +25 -0
- package/src/react/sitemap/primitives/$sitemap.browser.ts +26 -0
- package/src/react/sitemap/primitives/$sitemap.ts +196 -0
- package/src/react/ui/atoms/uiAtom.ts +6 -6
- package/src/react/ui/atoms/uiThemeListAtom.ts +7 -7
- package/src/react/ui/hooks/useColorMode.ts +11 -4
- package/src/react/ui/services/SchemaControl.ts +4 -4
- package/src/redis/providers/BunRedisProvider.ts +19 -11
- package/src/redis/providers/NodeRedisProvider.ts +3 -3
- package/src/scheduler/primitives/$scheduler.ts +21 -8
- package/src/security/__tests__/assertRealmScope.spec.ts +29 -0
- package/src/security/atoms/currentTenantAtom.ts +6 -6
- package/src/security/atoms/currentUserAtom.ts +2 -2
- package/src/security/primitives/$issuer.ts +24 -2
- package/src/security/providers/JwtProvider.ts +100 -0
- package/src/security/providers/SecurityProvider.ts +43 -2
- package/src/security/schemas/permissionSchema.ts +19 -19
- package/src/security/schemas/roleSchema.ts +22 -28
- package/src/security/schemas/userAccountInfoSchema.ts +47 -37
- package/src/server/auth/__tests__/appleClientSecret.spec.ts +34 -0
- package/src/server/auth/__tests__/federationRedirectReplay.spec.ts +44 -0
- package/src/server/auth/helpers/appleClientSecret.ts +24 -0
- package/src/server/auth/helpers/jtiReplayGuard.ts +41 -0
- package/src/server/auth/helpers/safeRedirectPath.ts +19 -0
- package/src/server/auth/index.ts +1 -0
- package/src/server/auth/primitives/$auth.ts +6 -6
- package/src/server/auth/primitives/$authApple.ts +10 -10
- package/src/server/auth/primitives/$authFacebook.ts +10 -10
- package/src/server/auth/primitives/$authFranceConnect.ts +10 -10
- package/src/server/auth/primitives/$authGithub.ts +10 -10
- package/src/server/auth/primitives/$authGoogle.ts +10 -10
- package/src/server/auth/primitives/$authMicrosoft.ts +14 -14
- package/src/server/auth/providers/ServerAuthProvider.ts +67 -52
- package/src/server/auth/schemas/authenticationProviderSchema.ts +9 -12
- package/src/server/auth/schemas/tokenResponseSchema.ts +2 -2
- package/src/server/auth/schemas/tokensSchema.ts +16 -16
- package/src/server/auth/schemas/userinfoResponseSchema.ts +3 -3
- package/src/server/cookies/__tests__/AtomCookieBinding.spec.ts +80 -0
- package/src/server/cookies/__tests__/AtomCookiePersistence.browser.spec.ts +169 -0
- package/src/server/cookies/__tests__/AtomCookiePersistence.spec.ts +294 -0
- package/src/server/cookies/__tests__/ServerCookiesProvider.spec.ts +82 -12
- package/src/server/cookies/index.browser.ts +4 -1
- package/src/server/cookies/index.ts +8 -1
- package/src/server/cookies/primitives/$cookie.browser.ts +1 -1
- package/src/server/cookies/primitives/$cookie.ts +16 -0
- package/src/server/cookies/providers/AtomCookiePersistence.browser.ts +133 -0
- package/src/server/cookies/providers/AtomCookiePersistence.ts +148 -0
- package/src/server/cookies/providers/ServerCookiesProvider.ts +32 -4
- package/src/server/cookies/services/CookieParser.ts +6 -1
- package/src/server/core/__tests__/$action.spec.ts +13 -13
- package/src/server/core/__tests__/$middleware.spec.ts +10 -10
- package/src/server/core/__tests__/$route.spec.ts +9 -9
- package/src/server/core/__tests__/$sse.spec.ts +26 -26
- package/src/server/core/__tests__/BunHttpServerProvider.bun.spec.ts +6 -6
- package/src/server/core/__tests__/HttpClient.spec.ts +2 -2
- package/src/server/core/__tests__/NodeHttpServerProvider.spec.ts +15 -3
- package/src/server/core/__tests__/ServerBodyParserProvider.spec.ts +14 -14
- package/src/server/core/__tests__/ServerMultipartProvider.spec.ts +33 -33
- package/src/server/core/__tests__/ServerRouterProvider-errorHandler.spec.ts +5 -1
- package/src/server/core/__tests__/ServerRouterProvider-getRoutes.spec.ts +25 -25
- package/src/server/core/__tests__/ServerRouterProvider-serializationError.spec.ts +9 -5
- package/src/server/core/__tests__/ServerRouterProvider-validationError.spec.ts +56 -24
- package/src/server/core/errors/ValidationError.ts +6 -3
- package/src/server/core/helpers/isMultipart.ts +2 -1
- package/src/server/core/index.ts +5 -2
- package/src/server/core/interfaces/ServerRequest.ts +14 -14
- package/src/server/core/primitives/$action.ts +26 -36
- package/src/server/core/primitives/$route.ts +27 -0
- package/src/server/core/primitives/$sse.ts +3 -3
- package/src/server/core/providers/BunHttpServerProvider.ts +8 -9
- package/src/server/core/providers/NodeHttpServerProvider.ts +8 -9
- package/src/server/core/providers/ServerBodyParserProvider.ts +20 -12
- package/src/server/core/providers/ServerCompressProvider.ts +9 -10
- package/src/server/core/providers/ServerHelmetProvider.ts +26 -27
- package/src/server/core/providers/ServerMultipartProvider.ts +19 -19
- package/src/server/core/providers/ServerRouterProvider.ts +44 -15
- package/src/server/core/schemas/errorSchema.ts +20 -25
- package/src/server/core/schemas/okSchema.ts +9 -14
- package/src/server/core/services/HttpClient.ts +13 -1
- package/src/server/core/services/ServerRequestParser.ts +6 -6
- package/src/server/cors/providers/ServerCorsProvider.ts +26 -28
- package/src/server/health/schemas/healthSchema.ts +6 -6
- package/src/server/links/__tests__/$remote.spec.ts +3 -3
- package/src/server/links/__tests__/BatchEndpoint.spec.ts +9 -9
- package/src/server/links/__tests__/LinkProvider.spec.ts +9 -9
- package/src/server/links/__tests__/ServerLinksProvider.spec.ts +23 -23
- package/src/server/links/__tests__/fixtures/CrudApp.ts +21 -21
- package/src/server/links/atoms/apiLinksAtom.ts +2 -2
- package/src/server/links/atoms/linkOptionsAtom.ts +6 -6
- package/src/server/links/primitives/$remote.ts +3 -3
- package/src/server/links/providers/LinkProvider.ts +3 -3
- package/src/server/links/providers/ServerLinksProvider.ts +20 -20
- package/src/server/links/schemas/apiLinksResponseSchema.ts +23 -23
- package/src/server/proxy/__tests__/$proxy.spec.ts +9 -9
- package/src/server/proxy/providers/ServerProxyProvider.ts +5 -0
- package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +18 -20
- package/src/server/swagger/__tests__/$swagger.spec.ts +91 -94
- package/src/server/swagger/__tests__/ui.spec.ts +3 -3
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +66 -43
- package/src/system/__tests__/NodeShellProvider.spec.ts +46 -0
- package/src/system/providers/NodeShellProvider.ts +4 -1
- package/src/topic/core/__tests__/$subscriber.spec.ts +4 -4
- package/src/topic/core/__tests__/shared.ts +8 -8
- package/src/topic/core/primitives/$subscriber.ts +5 -5
- package/src/topic/core/primitives/$topic.ts +14 -14
- package/src/topic/redis/providers/RedisTopicProvider.ts +3 -3
- package/dist/container/core/index.d.ts +0 -236
- package/dist/container/core/index.d.ts.map +0 -1
- package/dist/container/core/index.js +0 -231
- package/dist/container/core/index.js.map +0 -1
- package/dist/container/core/index.workerd.js +0 -192
- package/dist/container/core/index.workerd.js.map +0 -1
- package/src/cli/core/tasks/BuildSitemapTask.ts +0 -130
- package/src/command/helpers/PrettyAsker.ts +0 -256
- package/src/command/helpers/PrettyPrint.ts +0 -332
- package/src/container/core/__tests__/$container.spec.ts +0 -83
- package/src/container/core/index.ts +0 -50
- package/src/container/core/index.workerd.ts +0 -53
- package/src/container/core/interfaces/ContainerOptions.ts +0 -69
- package/src/container/core/primitives/$container.ts +0 -100
- package/src/container/core/providers/CloudflareContainerProvider.ts +0 -70
- package/src/container/core/providers/ContainerProvider.ts +0 -92
- package/src/container/core/providers/MockContainerProvider.ts +0 -62
- package/src/container/core/providers/NodeContainerProvider.ts +0 -53
- package/src/core/__tests__/jsonSchemaToTypeBox.spec.ts +0 -771
- package/src/core/helpers/jsonSchemaToTypeBox.ts +0 -359
- /package/dist/orm/core/{chunk-B4FMCO8f.js → rolldown-runtime-B4FMCO8f.js} +0 -0
|
@@ -5,6 +5,12 @@ import { PaymentService } from "alepha/api/payments";
|
|
|
5
5
|
import { CacheProvider } from "alepha/cache";
|
|
6
6
|
import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
|
|
7
7
|
import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
8
|
+
import "drizzle-orm/pg-core/foreign-keys";
|
|
9
|
+
import "drizzle-orm/pg-core/session";
|
|
10
|
+
import "alepha/crypto";
|
|
11
|
+
import "drizzle-kit/api";
|
|
12
|
+
import "drizzle-orm/d1";
|
|
13
|
+
import "drizzle-orm/sqlite-core";
|
|
8
14
|
//#region ../../src/orm/core/schemas/insertSchema.d.ts
|
|
9
15
|
/**
|
|
10
16
|
* Transforms a TObject schema for insert operations.
|
|
@@ -15,15 +21,13 @@ import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, Update
|
|
|
15
21
|
* Before: { name: string; age: number(default=0); fullName: generated }
|
|
16
22
|
* After: { name: string; age?: number; }
|
|
17
23
|
*/
|
|
18
|
-
type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["
|
|
24
|
+
type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["shape"] as T["shape"][K] extends {
|
|
19
25
|
[PG_GENERATED]: any;
|
|
20
|
-
} ? never : K]: T["
|
|
26
|
+
} ? never : K]: T["shape"][K] extends {
|
|
21
27
|
[PG_DEFAULT]: any;
|
|
22
28
|
} | {
|
|
23
29
|
[PG_ORGANIZATION]: any;
|
|
24
|
-
}
|
|
25
|
-
"~optional": true;
|
|
26
|
-
} ? TOptional<T["properties"][K]> : T["properties"][K] }>;
|
|
30
|
+
} ? TOptional<Extract<T["shape"][K], TSchema>> : T["shape"][K]; }>;
|
|
27
31
|
//#endregion
|
|
28
32
|
//#region ../../src/orm/core/schemas/updateSchema.d.ts
|
|
29
33
|
/**
|
|
@@ -35,9 +39,9 @@ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"] as
|
|
|
35
39
|
* Before: { name?: string; age: number; fullName: generated }
|
|
36
40
|
* After: { name?: string | null; age: number; }
|
|
37
41
|
*/
|
|
38
|
-
type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["
|
|
42
|
+
type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["shape"] as T["shape"][K] extends {
|
|
39
43
|
[PG_GENERATED]: any;
|
|
40
|
-
} ? never : K]: T["
|
|
44
|
+
} ? never : K]: T["shape"][K] extends TOptional<infer U extends TSchema> ? TOptional<TUnion<[U, TNull]>> : T["shape"][K]; }>;
|
|
41
45
|
//#endregion
|
|
42
46
|
//#region ../../src/orm/core/primitives/$entity.d.ts
|
|
43
47
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
@@ -197,18 +201,20 @@ declare class EntityPrimitive<T extends TObject = TObject> {
|
|
|
197
201
|
get cols(): EntityColumns<T>;
|
|
198
202
|
get name(): string;
|
|
199
203
|
get schema(): T;
|
|
204
|
+
protected _insertSchema?: TObjectInsert<T>;
|
|
200
205
|
get insertSchema(): TObjectInsert<T>;
|
|
206
|
+
protected _updateSchema?: TObjectUpdate<T>;
|
|
201
207
|
get updateSchema(): TObjectUpdate<T>;
|
|
202
208
|
}
|
|
203
209
|
/**
|
|
204
210
|
* Convert a schema to columns.
|
|
205
211
|
*/
|
|
206
|
-
type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
|
|
212
|
+
type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase; };
|
|
207
213
|
type EntityColumn<T extends TObject> = {
|
|
208
214
|
name: string;
|
|
209
215
|
entity: EntityPrimitive<T>;
|
|
210
216
|
};
|
|
211
|
-
type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T
|
|
217
|
+
type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T>; };
|
|
212
218
|
//#endregion
|
|
213
219
|
//#region ../../src/orm/core/constants/PG_SYMBOLS.d.ts
|
|
214
220
|
declare const PG_DEFAULT: unique symbol;
|
|
@@ -237,13 +243,24 @@ type PgSymbols = {
|
|
|
237
243
|
[PG_REF]: PgRefOptions;
|
|
238
244
|
[PG_ENUM]: PgEnumOptions;
|
|
239
245
|
[PG_GENERATED]: PgGeneratedOptions;
|
|
240
|
-
[PG_ORGANIZATION]:
|
|
246
|
+
[PG_ORGANIZATION]: PgOrganizationOptions;
|
|
241
247
|
/**
|
|
242
248
|
* @deprecated Use `PG_IDENTITY` instead.
|
|
243
249
|
*/
|
|
244
250
|
[PG_SERIAL]: {};
|
|
245
251
|
};
|
|
246
252
|
type PgSymbolKeys = keyof PgSymbols;
|
|
253
|
+
interface PgOrganizationOptions {
|
|
254
|
+
/**
|
|
255
|
+
* Fail-closed tenant scoping. When `true`, the repository (a) refuses any
|
|
256
|
+
* read/write with no resolved tenant instead of falling through to an
|
|
257
|
+
* unfiltered "see/write everything" query, and (b) drops the
|
|
258
|
+
* `OR organizationId IS NULL` "global row" escape — a scoped tenant never
|
|
259
|
+
* sees NULL/global rows. Use for security-sensitive tables. Defaults to
|
|
260
|
+
* `false` (the historic fail-open semantics).
|
|
261
|
+
*/
|
|
262
|
+
strict?: boolean;
|
|
263
|
+
}
|
|
247
264
|
type PgIdentityOptions = {
|
|
248
265
|
mode: "always" | "byDefault";
|
|
249
266
|
} & PgSequenceOptions & {
|
|
@@ -280,7 +297,7 @@ interface PgRefOptions {
|
|
|
280
297
|
/**
|
|
281
298
|
* Type representation.
|
|
282
299
|
*/
|
|
283
|
-
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
300
|
+
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K]; };
|
|
284
301
|
//#endregion
|
|
285
302
|
//#region ../../src/orm/core/schemas/databaseEnvSchema.d.ts
|
|
286
303
|
/**
|
|
@@ -296,135 +313,82 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
|
|
|
296
313
|
* - `d1://BINDING_NAME` — Cloudflare D1
|
|
297
314
|
* - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
|
|
298
315
|
*/
|
|
299
|
-
declare const databaseEnvSchema: import("
|
|
300
|
-
DATABASE_URL: import("
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
*
|
|
304
|
-
* Defaults to `true` in development and test, `false` in production.
|
|
305
|
-
* Set to `false` in development to skip automatic schema sync
|
|
306
|
-
* (e.g. when managing migrations manually).
|
|
307
|
-
*/
|
|
308
|
-
DATABASE_SYNC: import("typebox").TOptional<import("typebox").TBoolean>;
|
|
309
|
-
}>;
|
|
316
|
+
declare const databaseEnvSchema: import("zod").ZodObject<{
|
|
317
|
+
DATABASE_URL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
318
|
+
DATABASE_SYNC: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
319
|
+
}, import("zod/v4/core").$strip>;
|
|
310
320
|
declare module "alepha" {
|
|
311
321
|
interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
|
|
312
|
-
}
|
|
322
|
+
}
|
|
313
323
|
//#endregion
|
|
314
324
|
//#region ../../src/api/subscriptions/schemas/planDefinitionSchema.d.ts
|
|
315
|
-
declare const planDefinitionSchema: import("
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
interval: import("typebox").TUnsafe<"monthly" | "yearly">;
|
|
338
|
-
amount: import("typebox").TInteger;
|
|
339
|
-
currency: import("typebox").TString;
|
|
340
|
-
}>>;
|
|
341
|
-
/**
|
|
342
|
-
* Trial configuration for this plan.
|
|
343
|
-
* Overrides global settings.trialDays if set.
|
|
344
|
-
*/
|
|
345
|
-
trial: import("typebox").TOptional<import("typebox").TObject<{
|
|
346
|
-
days: import("typebox").TInteger;
|
|
347
|
-
requirePaymentMethod: import("typebox").TBoolean;
|
|
348
|
-
}>>;
|
|
349
|
-
/**
|
|
350
|
-
* Feature entitlements. Boolean flags for feature access.
|
|
351
|
-
* Checked via SubscriptionService.can("feature-name").
|
|
352
|
-
*/
|
|
353
|
-
features: import("typebox").TArray<import("typebox").TString>;
|
|
354
|
-
/**
|
|
355
|
-
* Usage limits. Numeric caps on resources.
|
|
356
|
-
* Checked via SubscriptionService.limit("resource-name").
|
|
357
|
-
* -1 = unlimited.
|
|
358
|
-
*/
|
|
359
|
-
limits: import("typebox").TRecord<"^.*$", import("typebox").TInteger>;
|
|
360
|
-
/**
|
|
361
|
-
* Sort order for display (lower = first).
|
|
362
|
-
*/
|
|
363
|
-
order: import("typebox").TInteger;
|
|
364
|
-
/**
|
|
365
|
-
* Metadata for app-specific plan data.
|
|
366
|
-
*/
|
|
367
|
-
metadata: import("typebox").TOptional<import("typebox").TRecord<"^.*$", import("typebox").TAny>>;
|
|
368
|
-
}>;
|
|
325
|
+
declare const planDefinitionSchema: import("zod").ZodObject<{
|
|
326
|
+
id: import("zod").ZodString;
|
|
327
|
+
name: import("zod").ZodString;
|
|
328
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
329
|
+
available: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
330
|
+
pricing: import("zod").ZodArray<import("zod").ZodObject<{
|
|
331
|
+
interval: import("zod").ZodEnum<{
|
|
332
|
+
monthly: "monthly";
|
|
333
|
+
yearly: "yearly";
|
|
334
|
+
}>;
|
|
335
|
+
amount: import("zod").ZodInt;
|
|
336
|
+
currency: import("zod").ZodString;
|
|
337
|
+
}, import("zod/v4/core").$strip>>;
|
|
338
|
+
trial: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
339
|
+
days: import("zod").ZodInt;
|
|
340
|
+
requirePaymentMethod: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
341
|
+
}, import("zod/v4/core").$strip>>;
|
|
342
|
+
features: import("zod").ZodArray<import("zod").ZodString>;
|
|
343
|
+
limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
344
|
+
order: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
345
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
346
|
+
}, import("zod/v4/core").$strip>;
|
|
369
347
|
type PlanDefinition = Static<typeof planDefinitionSchema>;
|
|
370
348
|
//#endregion
|
|
371
349
|
//#region ../../src/api/subscriptions/schemas/subscriptionSettingsSchema.d.ts
|
|
372
|
-
declare const subscriptionSettingsSchema: import("
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
* During grace period, subscription remains active but flagged.
|
|
380
|
-
*/
|
|
381
|
-
gracePeriodDays: import("typebox").TInteger;
|
|
382
|
-
/**
|
|
383
|
-
* Days after first payment failure to retry, relative to the failure date.
|
|
384
|
-
* e.g., [1, 3, 5, 7] means retry on day 1, 3, 5, 7 after failure.
|
|
385
|
-
*/
|
|
386
|
-
dunningSchedule: import("typebox").TArray<import("typebox").TInteger>;
|
|
387
|
-
/**
|
|
388
|
-
* When user cancels, wait until period end (true) or cancel immediately (false).
|
|
389
|
-
*/
|
|
390
|
-
cancelAtPeriodEnd: import("typebox").TBoolean;
|
|
391
|
-
/**
|
|
392
|
-
* Prorate charges when changing plans mid-cycle.
|
|
393
|
-
*/
|
|
394
|
-
prorateOnChange: import("typebox").TBoolean;
|
|
395
|
-
}>;
|
|
350
|
+
declare const subscriptionSettingsSchema: import("zod").ZodObject<{
|
|
351
|
+
trialDays: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
352
|
+
gracePeriodDays: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
353
|
+
dunningSchedule: import("zod").ZodArray<import("zod").ZodInt>;
|
|
354
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
355
|
+
prorateOnChange: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
356
|
+
}, import("zod/v4/core").$strip>;
|
|
396
357
|
type SubscriptionSettings = Static<typeof subscriptionSettingsSchema>;
|
|
397
358
|
//#endregion
|
|
398
359
|
//#region ../../src/api/subscriptions/services/SubscriptionConfig.d.ts
|
|
399
360
|
declare class SubscriptionConfig {
|
|
400
|
-
protected readonly plans: import("alepha/api/parameters").ParameterPrimitive<import("
|
|
401
|
-
plans: import("
|
|
402
|
-
id: import("
|
|
403
|
-
name: import("
|
|
404
|
-
description: import("
|
|
405
|
-
available: import("
|
|
406
|
-
pricing: import("
|
|
407
|
-
interval: import("
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
361
|
+
protected readonly plans: import("alepha/api/parameters").ParameterPrimitive<import("zod").ZodObject<{
|
|
362
|
+
plans: import("zod").ZodArray<import("zod").ZodObject<{
|
|
363
|
+
id: import("zod").ZodString;
|
|
364
|
+
name: import("zod").ZodString;
|
|
365
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
366
|
+
available: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
367
|
+
pricing: import("zod").ZodArray<import("zod").ZodObject<{
|
|
368
|
+
interval: import("zod").ZodEnum<{
|
|
369
|
+
monthly: "monthly";
|
|
370
|
+
yearly: "yearly";
|
|
371
|
+
}>;
|
|
372
|
+
amount: import("zod").ZodInt;
|
|
373
|
+
currency: import("zod").ZodString;
|
|
374
|
+
}, import("zod/v4/core").$strip>>;
|
|
375
|
+
trial: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
376
|
+
days: import("zod").ZodInt;
|
|
377
|
+
requirePaymentMethod: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
378
|
+
}, import("zod/v4/core").$strip>>;
|
|
379
|
+
features: import("zod").ZodArray<import("zod").ZodString>;
|
|
380
|
+
limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
381
|
+
order: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
382
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
383
|
+
}, import("zod/v4/core").$strip>>;
|
|
384
|
+
}, import("zod/v4/core").$strip>>;
|
|
385
|
+
protected readonly settings: import("alepha/api/parameters").ParameterPrimitive<import("zod").ZodObject<{
|
|
386
|
+
trialDays: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
387
|
+
gracePeriodDays: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
388
|
+
dunningSchedule: import("zod").ZodArray<import("zod").ZodInt>;
|
|
389
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
390
|
+
prorateOnChange: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
391
|
+
}, import("zod/v4/core").$strip>>;
|
|
428
392
|
getPlans(): Promise<PlanDefinition[]>;
|
|
429
393
|
getSettings(): Promise<SubscriptionSettings>;
|
|
430
394
|
getPlan(planId: string): Promise<PlanDefinition>;
|
|
@@ -436,95 +400,138 @@ declare class SubscriptionConfig {
|
|
|
436
400
|
}
|
|
437
401
|
//#endregion
|
|
438
402
|
//#region ../../src/api/subscriptions/entities/subscriptionEvents.d.ts
|
|
439
|
-
declare const subscriptionEvents: import("alepha/orm").EntityPrimitive<import("
|
|
440
|
-
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
441
|
-
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
442
|
-
subscriptionId: import("alepha/orm").PgAttr<import("
|
|
443
|
-
organizationId: import("alepha/orm").PgAttr<import("
|
|
444
|
-
type: import("
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
403
|
+
declare const subscriptionEvents: import("alepha/orm").EntityPrimitive<import("zod").ZodObject<{
|
|
404
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
405
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
406
|
+
subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
|
|
407
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
408
|
+
type: import("zod").ZodEnum<{
|
|
409
|
+
activated: "activated";
|
|
410
|
+
cancelled: "cancelled";
|
|
411
|
+
created: "created";
|
|
412
|
+
expired: "expired";
|
|
413
|
+
past_due: "past_due";
|
|
414
|
+
payment_failed: "payment_failed";
|
|
415
|
+
payment_retried: "payment_retried";
|
|
416
|
+
plan_change_scheduled: "plan_change_scheduled";
|
|
417
|
+
plan_changed: "plan_changed";
|
|
418
|
+
reactivated: "reactivated";
|
|
419
|
+
renewed: "renewed";
|
|
420
|
+
resumed: "resumed";
|
|
421
|
+
suspended: "suspended";
|
|
422
|
+
trial_ended: "trial_ended";
|
|
423
|
+
trial_started: "trial_started";
|
|
424
|
+
}>;
|
|
425
|
+
previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
426
|
+
newStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
427
|
+
previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
428
|
+
newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
429
|
+
paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
430
|
+
amount: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
431
|
+
currency: import("zod").ZodOptional<import("zod").ZodString>;
|
|
432
|
+
triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
433
|
+
userId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
434
|
+
note: import("zod").ZodOptional<import("zod").ZodString>;
|
|
435
|
+
}, import("zod/v4/core").$strip>>;
|
|
456
436
|
type SubscriptionEventEntity = Static<typeof subscriptionEvents.schema>;
|
|
457
437
|
//#endregion
|
|
458
438
|
//#region ../../src/api/subscriptions/entities/subscriptions.d.ts
|
|
459
|
-
declare const subscriptions: import("alepha/orm").EntityPrimitive<import("
|
|
460
|
-
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
461
|
-
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
462
|
-
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
463
|
-
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
464
|
-
organizationId: import("alepha/orm").PgAttr<import("
|
|
465
|
-
planId: import("
|
|
466
|
-
interval: import("
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
439
|
+
declare const subscriptions: import("alepha/orm").EntityPrimitive<import("zod").ZodObject<{
|
|
440
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
441
|
+
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
442
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
443
|
+
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
444
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
445
|
+
planId: import("zod").ZodString;
|
|
446
|
+
interval: import("zod").ZodEnum<{
|
|
447
|
+
monthly: "monthly";
|
|
448
|
+
yearly: "yearly";
|
|
449
|
+
}>;
|
|
450
|
+
status: import("zod").ZodEnum<{
|
|
451
|
+
active: "active";
|
|
452
|
+
cancelled: "cancelled";
|
|
453
|
+
expired: "expired";
|
|
454
|
+
past_due: "past_due";
|
|
455
|
+
suspended: "suspended";
|
|
456
|
+
trialing: "trialing";
|
|
457
|
+
}>;
|
|
458
|
+
currentPeriodStart: import("zod").ZodString;
|
|
459
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
460
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
461
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
462
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
463
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
464
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
465
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
466
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
467
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
468
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
469
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
470
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
471
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
472
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
473
|
+
monthly: "monthly";
|
|
474
|
+
yearly: "yearly";
|
|
475
|
+
}>>;
|
|
476
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
477
|
+
}, import("zod/v4/core").$strip>>;
|
|
485
478
|
type SubscriptionEntity = Static<typeof subscriptions.schema>;
|
|
486
479
|
//#endregion
|
|
487
480
|
//#region ../../src/api/subscriptions/schemas/entitlementsSchema.d.ts
|
|
488
|
-
declare const entitlementsSchema: import("
|
|
489
|
-
planId: import("
|
|
490
|
-
planName: import("
|
|
491
|
-
status: import("
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
481
|
+
declare const entitlementsSchema: import("zod").ZodObject<{
|
|
482
|
+
planId: import("zod").ZodString;
|
|
483
|
+
planName: import("zod").ZodString;
|
|
484
|
+
status: import("zod").ZodEnum<{
|
|
485
|
+
active: "active";
|
|
486
|
+
cancelled: "cancelled";
|
|
487
|
+
expired: "expired";
|
|
488
|
+
past_due: "past_due";
|
|
489
|
+
suspended: "suspended";
|
|
490
|
+
trialing: "trialing";
|
|
491
|
+
}>;
|
|
492
|
+
features: import("zod").ZodArray<import("zod").ZodString>;
|
|
493
|
+
limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
494
|
+
trialEndsAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
495
|
+
periodEndsAt: import("zod").ZodString;
|
|
496
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
497
|
+
}, import("zod/v4/core").$strip>;
|
|
498
498
|
type Entitlements = Static<typeof entitlementsSchema>;
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region ../../src/api/subscriptions/schemas/subscriptionQuerySchema.d.ts
|
|
501
|
-
declare const subscriptionQuerySchema: import("
|
|
502
|
-
page: import("
|
|
503
|
-
size: import("
|
|
504
|
-
sort: import("
|
|
505
|
-
status: import("
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
501
|
+
declare const subscriptionQuerySchema: import("zod").ZodObject<{
|
|
502
|
+
page: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
|
|
503
|
+
size: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
|
|
504
|
+
sort: import("zod").ZodOptional<import("zod").ZodString>;
|
|
505
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
506
|
+
active: "active";
|
|
507
|
+
cancelled: "cancelled";
|
|
508
|
+
expired: "expired";
|
|
509
|
+
past_due: "past_due";
|
|
510
|
+
suspended: "suspended";
|
|
511
|
+
trialing: "trialing";
|
|
512
|
+
}>>;
|
|
513
|
+
planId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
514
|
+
organizationId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
515
|
+
}, import("zod/v4/core").$strip>;
|
|
509
516
|
type SubscriptionQuery = Static<typeof subscriptionQuerySchema>;
|
|
510
517
|
//#endregion
|
|
511
518
|
//#region ../../src/api/subscriptions/schemas/subscriptionStatsSchema.d.ts
|
|
512
|
-
declare const subscriptionStatsSchema: import("
|
|
513
|
-
total: import("
|
|
514
|
-
trialing: import("
|
|
515
|
-
active: import("
|
|
516
|
-
pastDue: import("
|
|
517
|
-
suspended: import("
|
|
518
|
-
cancelled: import("
|
|
519
|
-
expired: import("
|
|
520
|
-
trialConversionRate: import("
|
|
521
|
-
churnRate: import("
|
|
522
|
-
byPlan: import("
|
|
523
|
-
active: import("
|
|
524
|
-
trialing: import("
|
|
525
|
-
total: import("
|
|
526
|
-
}>>;
|
|
527
|
-
}>;
|
|
519
|
+
declare const subscriptionStatsSchema: import("zod").ZodObject<{
|
|
520
|
+
total: import("zod").ZodInt;
|
|
521
|
+
trialing: import("zod").ZodInt;
|
|
522
|
+
active: import("zod").ZodInt;
|
|
523
|
+
pastDue: import("zod").ZodInt;
|
|
524
|
+
suspended: import("zod").ZodInt;
|
|
525
|
+
cancelled: import("zod").ZodInt;
|
|
526
|
+
expired: import("zod").ZodInt;
|
|
527
|
+
trialConversionRate: import("zod").ZodNumber;
|
|
528
|
+
churnRate: import("zod").ZodNumber;
|
|
529
|
+
byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
530
|
+
active: import("zod").ZodInt;
|
|
531
|
+
trialing: import("zod").ZodInt;
|
|
532
|
+
total: import("zod").ZodInt;
|
|
533
|
+
}, import("zod/v4/core").$strip>>;
|
|
534
|
+
}, import("zod/v4/core").$strip>;
|
|
528
535
|
type SubscriptionStats = Static<typeof subscriptionStatsSchema>;
|
|
529
536
|
//#endregion
|
|
530
537
|
//#region ../../src/api/subscriptions/services/SubscriptionService.d.ts
|
|
@@ -582,49 +589,78 @@ declare class SubscriptionService {
|
|
|
582
589
|
protected readonly alepha: Alepha;
|
|
583
590
|
protected readonly log: import("alepha/logger").Logger;
|
|
584
591
|
protected readonly dateTime: DateTimeProvider;
|
|
585
|
-
protected readonly subscriptionRepo: import("alepha/orm").Repository<import("
|
|
586
|
-
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
587
|
-
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
588
|
-
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
589
|
-
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
590
|
-
organizationId: import("alepha/orm").PgAttr<import("
|
|
591
|
-
planId: import("
|
|
592
|
-
interval: import("
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
592
|
+
protected readonly subscriptionRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
|
|
593
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
594
|
+
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
595
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
596
|
+
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
597
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
598
|
+
planId: import("zod").ZodString;
|
|
599
|
+
interval: import("zod").ZodEnum<{
|
|
600
|
+
monthly: "monthly";
|
|
601
|
+
yearly: "yearly";
|
|
602
|
+
}>;
|
|
603
|
+
status: import("zod").ZodEnum<{
|
|
604
|
+
active: "active";
|
|
605
|
+
cancelled: "cancelled";
|
|
606
|
+
expired: "expired";
|
|
607
|
+
past_due: "past_due";
|
|
608
|
+
suspended: "suspended";
|
|
609
|
+
trialing: "trialing";
|
|
610
|
+
}>;
|
|
611
|
+
currentPeriodStart: import("zod").ZodString;
|
|
612
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
613
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
614
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
615
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
616
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
617
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
618
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
619
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
620
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
621
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
622
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
623
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
624
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
625
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
626
|
+
monthly: "monthly";
|
|
627
|
+
yearly: "yearly";
|
|
628
|
+
}>>;
|
|
629
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
630
|
+
}, import("zod/v4/core").$strip>>;
|
|
631
|
+
protected readonly eventRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
|
|
632
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
633
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
634
|
+
subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
|
|
635
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
636
|
+
type: import("zod").ZodEnum<{
|
|
637
|
+
activated: "activated";
|
|
638
|
+
cancelled: "cancelled";
|
|
639
|
+
created: "created";
|
|
640
|
+
expired: "expired";
|
|
641
|
+
past_due: "past_due";
|
|
642
|
+
payment_failed: "payment_failed";
|
|
643
|
+
payment_retried: "payment_retried";
|
|
644
|
+
plan_change_scheduled: "plan_change_scheduled";
|
|
645
|
+
plan_changed: "plan_changed";
|
|
646
|
+
reactivated: "reactivated";
|
|
647
|
+
renewed: "renewed";
|
|
648
|
+
resumed: "resumed";
|
|
649
|
+
suspended: "suspended";
|
|
650
|
+
trial_ended: "trial_ended";
|
|
651
|
+
trial_started: "trial_started";
|
|
652
|
+
}>;
|
|
653
|
+
previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
654
|
+
newStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
655
|
+
previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
656
|
+
newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
657
|
+
paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
658
|
+
amount: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
659
|
+
currency: import("zod").ZodOptional<import("zod").ZodString>;
|
|
660
|
+
triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
661
|
+
userId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
662
|
+
note: import("zod").ZodOptional<import("zod").ZodString>;
|
|
663
|
+
}, import("zod/v4/core").$strip>>;
|
|
628
664
|
protected readonly config: SubscriptionConfig;
|
|
629
665
|
/**
|
|
630
666
|
* Find a subscription by organization ID.
|
|
@@ -730,206 +766,268 @@ declare class AdminSubscriptionController {
|
|
|
730
766
|
* Find subscriptions with pagination and filtering.
|
|
731
767
|
*/
|
|
732
768
|
readonly findSubscriptions: import("alepha/server").ActionPrimitiveFn<{
|
|
733
|
-
query: import("
|
|
734
|
-
page: import("
|
|
735
|
-
size: import("
|
|
736
|
-
sort: import("
|
|
737
|
-
status: import("
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
organizationId:
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
769
|
+
query: import("zod").ZodObject<{
|
|
770
|
+
page: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
|
|
771
|
+
size: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodInt>>;
|
|
772
|
+
sort: import("zod").ZodOptional<import("zod").ZodString>;
|
|
773
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
774
|
+
active: "active";
|
|
775
|
+
cancelled: "cancelled";
|
|
776
|
+
expired: "expired";
|
|
777
|
+
past_due: "past_due";
|
|
778
|
+
suspended: "suspended";
|
|
779
|
+
trialing: "trialing";
|
|
780
|
+
}>>;
|
|
781
|
+
planId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
782
|
+
organizationId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
783
|
+
}, import("zod/v4/core").$strip>;
|
|
784
|
+
response: import("zod").ZodObject<{
|
|
785
|
+
content: import("zod").ZodArray<import("zod").ZodObject<{
|
|
786
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
787
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
788
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
789
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
790
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
791
|
+
planId: import("zod").ZodString;
|
|
792
|
+
interval: import("zod").ZodEnum<{
|
|
793
|
+
monthly: "monthly";
|
|
794
|
+
yearly: "yearly";
|
|
795
|
+
}>;
|
|
796
|
+
status: import("zod").ZodEnum<{
|
|
797
|
+
active: "active";
|
|
798
|
+
cancelled: "cancelled";
|
|
799
|
+
expired: "expired";
|
|
800
|
+
past_due: "past_due";
|
|
801
|
+
suspended: "suspended";
|
|
802
|
+
trialing: "trialing";
|
|
803
|
+
}>;
|
|
804
|
+
currentPeriodStart: import("zod").ZodString;
|
|
805
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
806
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
807
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
808
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
809
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
810
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
811
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
812
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
813
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
814
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
815
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
816
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
817
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
818
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
819
|
+
monthly: "monthly";
|
|
820
|
+
yearly: "yearly";
|
|
821
|
+
}>>;
|
|
822
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
823
|
+
}, import("zod/v4/core").$strip>>;
|
|
824
|
+
page: import("zod").ZodObject<{
|
|
825
|
+
number: import("zod").ZodInt;
|
|
826
|
+
size: import("zod").ZodInt;
|
|
827
|
+
offset: import("zod").ZodInt;
|
|
828
|
+
numberOfElements: import("zod").ZodInt;
|
|
829
|
+
totalElements: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
830
|
+
totalPages: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
831
|
+
isEmpty: import("zod").ZodBoolean;
|
|
832
|
+
isFirst: import("zod").ZodBoolean;
|
|
833
|
+
isLast: import("zod").ZodBoolean;
|
|
834
|
+
}, import("zod/v4/core").$strip>;
|
|
835
|
+
}, import("zod/v4/core").$strip>;
|
|
767
836
|
}>;
|
|
768
837
|
/**
|
|
769
838
|
* Get a subscription by ID.
|
|
770
839
|
*/
|
|
771
840
|
readonly getSubscription: import("alepha/server").ActionPrimitiveFn<{
|
|
772
|
-
params: import("
|
|
773
|
-
id: import("
|
|
774
|
-
}>;
|
|
775
|
-
response: import("
|
|
776
|
-
id: PgAttr<PgAttr<import("
|
|
777
|
-
version: PgAttr<PgAttr<import("
|
|
778
|
-
createdAt: PgAttr<PgAttr<import("
|
|
779
|
-
updatedAt: PgAttr<PgAttr<import("
|
|
780
|
-
organizationId: PgAttr<import("
|
|
781
|
-
planId: import("
|
|
782
|
-
interval: import("
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
841
|
+
params: import("zod").ZodObject<{
|
|
842
|
+
id: import("zod").ZodString;
|
|
843
|
+
}, import("zod/v4/core").$strip>;
|
|
844
|
+
response: import("zod").ZodObject<{
|
|
845
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
846
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
847
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
848
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
849
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
850
|
+
planId: import("zod").ZodString;
|
|
851
|
+
interval: import("zod").ZodEnum<{
|
|
852
|
+
monthly: "monthly";
|
|
853
|
+
yearly: "yearly";
|
|
854
|
+
}>;
|
|
855
|
+
status: import("zod").ZodEnum<{
|
|
856
|
+
active: "active";
|
|
857
|
+
cancelled: "cancelled";
|
|
858
|
+
expired: "expired";
|
|
859
|
+
past_due: "past_due";
|
|
860
|
+
suspended: "suspended";
|
|
861
|
+
trialing: "trialing";
|
|
862
|
+
}>;
|
|
863
|
+
currentPeriodStart: import("zod").ZodString;
|
|
864
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
865
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
866
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
867
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
868
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
869
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
870
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
871
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
872
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
873
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
874
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
875
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
876
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
877
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
878
|
+
monthly: "monthly";
|
|
879
|
+
yearly: "yearly";
|
|
880
|
+
}>>;
|
|
881
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
882
|
+
}, import("zod/v4/core").$strip>;
|
|
801
883
|
}>;
|
|
802
884
|
/**
|
|
803
885
|
* Get aggregated subscription statistics.
|
|
804
886
|
*/
|
|
805
887
|
readonly getStats: import("alepha/server").ActionPrimitiveFn<{
|
|
806
|
-
response: import("
|
|
807
|
-
total: import("
|
|
808
|
-
trialing: import("
|
|
809
|
-
active: import("
|
|
810
|
-
pastDue: import("
|
|
811
|
-
suspended: import("
|
|
812
|
-
cancelled: import("
|
|
813
|
-
expired: import("
|
|
814
|
-
trialConversionRate: import("
|
|
815
|
-
churnRate: import("
|
|
816
|
-
byPlan: import("
|
|
817
|
-
active: import("
|
|
818
|
-
trialing: import("
|
|
819
|
-
total: import("
|
|
820
|
-
}>>;
|
|
821
|
-
}>;
|
|
888
|
+
response: import("zod").ZodObject<{
|
|
889
|
+
total: import("zod").ZodInt;
|
|
890
|
+
trialing: import("zod").ZodInt;
|
|
891
|
+
active: import("zod").ZodInt;
|
|
892
|
+
pastDue: import("zod").ZodInt;
|
|
893
|
+
suspended: import("zod").ZodInt;
|
|
894
|
+
cancelled: import("zod").ZodInt;
|
|
895
|
+
expired: import("zod").ZodInt;
|
|
896
|
+
trialConversionRate: import("zod").ZodNumber;
|
|
897
|
+
churnRate: import("zod").ZodNumber;
|
|
898
|
+
byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
899
|
+
active: import("zod").ZodInt;
|
|
900
|
+
trialing: import("zod").ZodInt;
|
|
901
|
+
total: import("zod").ZodInt;
|
|
902
|
+
}, import("zod/v4/core").$strip>>;
|
|
903
|
+
}, import("zod/v4/core").$strip>;
|
|
822
904
|
}>;
|
|
823
905
|
/**
|
|
824
906
|
* Get revenue data from recent subscription events.
|
|
825
907
|
*/
|
|
826
908
|
readonly getRevenue: import("alepha/server").ActionPrimitiveFn<{
|
|
827
|
-
query: import("
|
|
828
|
-
days: import("
|
|
829
|
-
}>;
|
|
830
|
-
response: import("
|
|
831
|
-
total: import("
|
|
832
|
-
count: import("
|
|
833
|
-
}>;
|
|
909
|
+
query: import("zod").ZodObject<{
|
|
910
|
+
days: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
911
|
+
}, import("zod/v4/core").$strip>;
|
|
912
|
+
response: import("zod").ZodObject<{
|
|
913
|
+
total: import("zod").ZodInt;
|
|
914
|
+
count: import("zod").ZodInt;
|
|
915
|
+
}, import("zod/v4/core").$strip>;
|
|
834
916
|
}>;
|
|
835
917
|
/**
|
|
836
918
|
* Get Monthly Recurring Revenue breakdown.
|
|
837
919
|
*/
|
|
838
920
|
readonly getMrr: import("alepha/server").ActionPrimitiveFn<{
|
|
839
|
-
response: import("
|
|
840
|
-
total: import("
|
|
841
|
-
byPlan: import("
|
|
842
|
-
growth: import("
|
|
843
|
-
newMrr: import("
|
|
844
|
-
expansionMrr: import("
|
|
845
|
-
contractionMrr: import("
|
|
846
|
-
churnMrr: import("
|
|
847
|
-
}>;
|
|
921
|
+
response: import("zod").ZodObject<{
|
|
922
|
+
total: import("zod").ZodInt;
|
|
923
|
+
byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
924
|
+
growth: import("zod").ZodInt;
|
|
925
|
+
newMrr: import("zod").ZodInt;
|
|
926
|
+
expansionMrr: import("zod").ZodInt;
|
|
927
|
+
contractionMrr: import("zod").ZodInt;
|
|
928
|
+
churnMrr: import("zod").ZodInt;
|
|
929
|
+
}, import("zod/v4/core").$strip>;
|
|
848
930
|
}>;
|
|
849
931
|
/**
|
|
850
932
|
* Force a plan change for a subscription (admin action).
|
|
851
933
|
*/
|
|
852
934
|
readonly adminChangePlan: import("alepha/server").ActionPrimitiveFn<{
|
|
853
|
-
params: import("
|
|
854
|
-
id: import("
|
|
855
|
-
}>;
|
|
856
|
-
body: import("
|
|
857
|
-
planId: import("
|
|
858
|
-
interval: import("
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
935
|
+
params: import("zod").ZodObject<{
|
|
936
|
+
id: import("zod").ZodString;
|
|
937
|
+
}, import("zod/v4/core").$strip>;
|
|
938
|
+
body: import("zod").ZodObject<{
|
|
939
|
+
planId: import("zod").ZodString;
|
|
940
|
+
interval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
941
|
+
monthly: "monthly";
|
|
942
|
+
yearly: "yearly";
|
|
943
|
+
}>>;
|
|
944
|
+
immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
945
|
+
}, import("zod/v4/core").$strip>;
|
|
946
|
+
response: import("zod").ZodObject<{
|
|
947
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
948
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
949
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
950
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
951
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
952
|
+
planId: import("zod").ZodString;
|
|
953
|
+
interval: import("zod").ZodEnum<{
|
|
954
|
+
monthly: "monthly";
|
|
955
|
+
yearly: "yearly";
|
|
956
|
+
}>;
|
|
957
|
+
status: import("zod").ZodEnum<{
|
|
958
|
+
active: "active";
|
|
959
|
+
cancelled: "cancelled";
|
|
960
|
+
expired: "expired";
|
|
961
|
+
past_due: "past_due";
|
|
962
|
+
suspended: "suspended";
|
|
963
|
+
trialing: "trialing";
|
|
964
|
+
}>;
|
|
965
|
+
currentPeriodStart: import("zod").ZodString;
|
|
966
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
967
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
968
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
969
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
970
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
971
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
972
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
973
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
974
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
975
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
976
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
977
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
978
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
979
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
980
|
+
monthly: "monthly";
|
|
981
|
+
yearly: "yearly";
|
|
982
|
+
}>>;
|
|
983
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
984
|
+
}, import("zod/v4/core").$strip>;
|
|
887
985
|
}>;
|
|
888
986
|
/**
|
|
889
987
|
* Force cancel a subscription (admin action).
|
|
890
988
|
*/
|
|
891
989
|
readonly adminCancel: import("alepha/server").ActionPrimitiveFn<{
|
|
892
|
-
params: import("
|
|
893
|
-
id: import("
|
|
894
|
-
}>;
|
|
895
|
-
body: import("
|
|
896
|
-
reason: import("
|
|
897
|
-
immediate: import("
|
|
898
|
-
}>;
|
|
899
|
-
response: import("
|
|
900
|
-
ok: import("
|
|
901
|
-
id: import("
|
|
902
|
-
count: import("
|
|
903
|
-
}>;
|
|
990
|
+
params: import("zod").ZodObject<{
|
|
991
|
+
id: import("zod").ZodString;
|
|
992
|
+
}, import("zod/v4/core").$strip>;
|
|
993
|
+
body: import("zod").ZodObject<{
|
|
994
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
995
|
+
immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
996
|
+
}, import("zod/v4/core").$strip>;
|
|
997
|
+
response: import("zod").ZodObject<{
|
|
998
|
+
ok: import("zod").ZodBoolean;
|
|
999
|
+
id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
1000
|
+
count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1001
|
+
}, import("zod/v4/core").$strip>;
|
|
904
1002
|
}>;
|
|
905
1003
|
/**
|
|
906
1004
|
* Reactivate a suspended subscription (admin action).
|
|
907
1005
|
*/
|
|
908
1006
|
readonly adminReactivate: import("alepha/server").ActionPrimitiveFn<{
|
|
909
|
-
params: import("
|
|
910
|
-
id: import("
|
|
911
|
-
}>;
|
|
912
|
-
response: import("
|
|
913
|
-
ok: import("
|
|
914
|
-
id: import("
|
|
915
|
-
count: import("
|
|
916
|
-
}>;
|
|
1007
|
+
params: import("zod").ZodObject<{
|
|
1008
|
+
id: import("zod").ZodString;
|
|
1009
|
+
}, import("zod/v4/core").$strip>;
|
|
1010
|
+
response: import("zod").ZodObject<{
|
|
1011
|
+
ok: import("zod").ZodBoolean;
|
|
1012
|
+
id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
1013
|
+
count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1014
|
+
}, import("zod/v4/core").$strip>;
|
|
917
1015
|
}>;
|
|
918
1016
|
/**
|
|
919
1017
|
* Extend the trial period for a trialing subscription (admin action).
|
|
920
1018
|
*/
|
|
921
1019
|
readonly adminExtendTrial: import("alepha/server").ActionPrimitiveFn<{
|
|
922
|
-
params: import("
|
|
923
|
-
id: import("
|
|
924
|
-
}>;
|
|
925
|
-
body: import("
|
|
926
|
-
days: import("
|
|
927
|
-
}>;
|
|
928
|
-
response: import("
|
|
929
|
-
ok: import("
|
|
930
|
-
id: import("
|
|
931
|
-
count: import("
|
|
932
|
-
}>;
|
|
1020
|
+
params: import("zod").ZodObject<{
|
|
1021
|
+
id: import("zod").ZodString;
|
|
1022
|
+
}, import("zod/v4/core").$strip>;
|
|
1023
|
+
body: import("zod").ZodObject<{
|
|
1024
|
+
days: import("zod").ZodInt;
|
|
1025
|
+
}, import("zod/v4/core").$strip>;
|
|
1026
|
+
response: import("zod").ZodObject<{
|
|
1027
|
+
ok: import("zod").ZodBoolean;
|
|
1028
|
+
id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
1029
|
+
count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1030
|
+
}, import("zod/v4/core").$strip>;
|
|
933
1031
|
}>;
|
|
934
1032
|
}
|
|
935
1033
|
//#endregion
|
|
@@ -943,189 +1041,258 @@ declare class SubscriptionController {
|
|
|
943
1041
|
* List available subscription plans with pricing.
|
|
944
1042
|
*/
|
|
945
1043
|
readonly getPlans: import("alepha/server").ActionPrimitiveFn<{
|
|
946
|
-
response: import("
|
|
947
|
-
id: import("
|
|
948
|
-
name: import("
|
|
949
|
-
description: import("
|
|
950
|
-
pricing: import("
|
|
951
|
-
interval: import("
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1044
|
+
response: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1045
|
+
id: import("zod").ZodString;
|
|
1046
|
+
name: import("zod").ZodString;
|
|
1047
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1048
|
+
pricing: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1049
|
+
interval: import("zod").ZodEnum<{
|
|
1050
|
+
monthly: "monthly";
|
|
1051
|
+
yearly: "yearly";
|
|
1052
|
+
}>;
|
|
1053
|
+
amount: import("zod").ZodInt;
|
|
1054
|
+
currency: import("zod").ZodString;
|
|
1055
|
+
}, import("zod/v4/core").$strip>>;
|
|
1056
|
+
features: import("zod").ZodArray<import("zod").ZodString>;
|
|
1057
|
+
limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
1058
|
+
trial: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1059
|
+
days: import("zod").ZodInt;
|
|
1060
|
+
requirePaymentMethod: import("zod").ZodBoolean;
|
|
1061
|
+
}, import("zod/v4/core").$strip>>;
|
|
1062
|
+
order: import("zod").ZodInt;
|
|
1063
|
+
}, import("zod/v4/core").$strip>>;
|
|
963
1064
|
}>;
|
|
964
1065
|
/**
|
|
965
1066
|
* Get the current organization's subscription.
|
|
966
1067
|
*/
|
|
967
1068
|
readonly getMySubscription: import("alepha/server").ActionPrimitiveFn<{
|
|
968
|
-
response: import("
|
|
969
|
-
id: PgAttr<PgAttr<import("
|
|
970
|
-
version: PgAttr<PgAttr<import("
|
|
971
|
-
createdAt: PgAttr<PgAttr<import("
|
|
972
|
-
updatedAt: PgAttr<PgAttr<import("
|
|
973
|
-
organizationId: PgAttr<import("
|
|
974
|
-
planId: import("
|
|
975
|
-
interval: import("
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1069
|
+
response: import("zod").ZodObject<{
|
|
1070
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1071
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1072
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1073
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1074
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
1075
|
+
planId: import("zod").ZodString;
|
|
1076
|
+
interval: import("zod").ZodEnum<{
|
|
1077
|
+
monthly: "monthly";
|
|
1078
|
+
yearly: "yearly";
|
|
1079
|
+
}>;
|
|
1080
|
+
status: import("zod").ZodEnum<{
|
|
1081
|
+
active: "active";
|
|
1082
|
+
cancelled: "cancelled";
|
|
1083
|
+
expired: "expired";
|
|
1084
|
+
past_due: "past_due";
|
|
1085
|
+
suspended: "suspended";
|
|
1086
|
+
trialing: "trialing";
|
|
1087
|
+
}>;
|
|
1088
|
+
currentPeriodStart: import("zod").ZodString;
|
|
1089
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
1090
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1091
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1092
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1093
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1094
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
1095
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1096
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1097
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1098
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1099
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
1100
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1101
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1102
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1103
|
+
monthly: "monthly";
|
|
1104
|
+
yearly: "yearly";
|
|
1105
|
+
}>>;
|
|
1106
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1107
|
+
}, import("zod/v4/core").$strip>;
|
|
994
1108
|
}>;
|
|
995
1109
|
/**
|
|
996
1110
|
* Create a new subscription for the current organization.
|
|
997
1111
|
*/
|
|
998
1112
|
readonly subscribe: import("alepha/server").ActionPrimitiveFn<{
|
|
999
|
-
body: import("
|
|
1000
|
-
planId: import("
|
|
1001
|
-
interval: import("
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1113
|
+
body: import("zod").ZodObject<{
|
|
1114
|
+
planId: import("zod").ZodString;
|
|
1115
|
+
interval: import("zod").ZodEnum<{
|
|
1116
|
+
monthly: "monthly";
|
|
1117
|
+
yearly: "yearly";
|
|
1118
|
+
}>;
|
|
1119
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1120
|
+
}, import("zod/v4/core").$strip>;
|
|
1121
|
+
response: import("zod").ZodObject<{
|
|
1122
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1123
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1124
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1125
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1126
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
1127
|
+
planId: import("zod").ZodString;
|
|
1128
|
+
interval: import("zod").ZodEnum<{
|
|
1129
|
+
monthly: "monthly";
|
|
1130
|
+
yearly: "yearly";
|
|
1131
|
+
}>;
|
|
1132
|
+
status: import("zod").ZodEnum<{
|
|
1133
|
+
active: "active";
|
|
1134
|
+
cancelled: "cancelled";
|
|
1135
|
+
expired: "expired";
|
|
1136
|
+
past_due: "past_due";
|
|
1137
|
+
suspended: "suspended";
|
|
1138
|
+
trialing: "trialing";
|
|
1139
|
+
}>;
|
|
1140
|
+
currentPeriodStart: import("zod").ZodString;
|
|
1141
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
1142
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1143
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1144
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1145
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1146
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
1147
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1148
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1149
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1150
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1151
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
1152
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1153
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1154
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1155
|
+
monthly: "monthly";
|
|
1156
|
+
yearly: "yearly";
|
|
1157
|
+
}>>;
|
|
1158
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1159
|
+
}, import("zod/v4/core").$strip>;
|
|
1032
1160
|
}>;
|
|
1033
1161
|
/**
|
|
1034
1162
|
* Change the plan for the current organization's subscription.
|
|
1035
1163
|
*/
|
|
1036
1164
|
readonly changePlan: import("alepha/server").ActionPrimitiveFn<{
|
|
1037
|
-
body: import("
|
|
1038
|
-
planId: import("
|
|
1039
|
-
interval: import("
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1165
|
+
body: import("zod").ZodObject<{
|
|
1166
|
+
planId: import("zod").ZodString;
|
|
1167
|
+
interval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1168
|
+
monthly: "monthly";
|
|
1169
|
+
yearly: "yearly";
|
|
1170
|
+
}>>;
|
|
1171
|
+
immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1172
|
+
}, import("zod/v4/core").$strip>;
|
|
1173
|
+
response: import("zod").ZodObject<{
|
|
1174
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1175
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1176
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1177
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1178
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
1179
|
+
planId: import("zod").ZodString;
|
|
1180
|
+
interval: import("zod").ZodEnum<{
|
|
1181
|
+
monthly: "monthly";
|
|
1182
|
+
yearly: "yearly";
|
|
1183
|
+
}>;
|
|
1184
|
+
status: import("zod").ZodEnum<{
|
|
1185
|
+
active: "active";
|
|
1186
|
+
cancelled: "cancelled";
|
|
1187
|
+
expired: "expired";
|
|
1188
|
+
past_due: "past_due";
|
|
1189
|
+
suspended: "suspended";
|
|
1190
|
+
trialing: "trialing";
|
|
1191
|
+
}>;
|
|
1192
|
+
currentPeriodStart: import("zod").ZodString;
|
|
1193
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
1194
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1195
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1196
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1197
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1198
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
1199
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1200
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1201
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1202
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1203
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
1204
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1205
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1206
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1207
|
+
monthly: "monthly";
|
|
1208
|
+
yearly: "yearly";
|
|
1209
|
+
}>>;
|
|
1210
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1211
|
+
}, import("zod/v4/core").$strip>;
|
|
1068
1212
|
}>;
|
|
1069
1213
|
/**
|
|
1070
1214
|
* Cancel the current organization's subscription.
|
|
1071
1215
|
*/
|
|
1072
1216
|
readonly cancel: import("alepha/server").ActionPrimitiveFn<{
|
|
1073
|
-
body: import("
|
|
1074
|
-
reason: import("
|
|
1075
|
-
immediate: import("
|
|
1076
|
-
}>;
|
|
1077
|
-
response: import("
|
|
1078
|
-
ok: import("
|
|
1079
|
-
id: import("
|
|
1080
|
-
count: import("
|
|
1081
|
-
}>;
|
|
1217
|
+
body: import("zod").ZodObject<{
|
|
1218
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1219
|
+
immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1220
|
+
}, import("zod/v4/core").$strip>;
|
|
1221
|
+
response: import("zod").ZodObject<{
|
|
1222
|
+
ok: import("zod").ZodBoolean;
|
|
1223
|
+
id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
1224
|
+
count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1225
|
+
}, import("zod/v4/core").$strip>;
|
|
1082
1226
|
}>;
|
|
1083
1227
|
/**
|
|
1084
1228
|
* Resume a cancelled subscription before the period ends.
|
|
1085
1229
|
*/
|
|
1086
1230
|
readonly resume: import("alepha/server").ActionPrimitiveFn<{
|
|
1087
|
-
response: import("
|
|
1088
|
-
ok: import("
|
|
1089
|
-
id: import("
|
|
1090
|
-
count: import("
|
|
1091
|
-
}>;
|
|
1231
|
+
response: import("zod").ZodObject<{
|
|
1232
|
+
ok: import("zod").ZodBoolean;
|
|
1233
|
+
id: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodInt]>>;
|
|
1234
|
+
count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1235
|
+
}, import("zod/v4/core").$strip>;
|
|
1092
1236
|
}>;
|
|
1093
1237
|
/**
|
|
1094
1238
|
* Get the billing event history for the current organization's subscription.
|
|
1095
1239
|
*/
|
|
1096
1240
|
readonly getSubscriptionHistory: import("alepha/server").ActionPrimitiveFn<{
|
|
1097
|
-
response: import("
|
|
1098
|
-
id: PgAttr<PgAttr<import("
|
|
1099
|
-
createdAt: PgAttr<PgAttr<import("
|
|
1100
|
-
subscriptionId: PgAttr<import("
|
|
1101
|
-
organizationId: PgAttr<import("
|
|
1102
|
-
type: import("
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1241
|
+
response: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1242
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1243
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1244
|
+
subscriptionId: PgAttr<import("zod").ZodString, typeof PG_REF>;
|
|
1245
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
1246
|
+
type: import("zod").ZodEnum<{
|
|
1247
|
+
activated: "activated";
|
|
1248
|
+
cancelled: "cancelled";
|
|
1249
|
+
created: "created";
|
|
1250
|
+
expired: "expired";
|
|
1251
|
+
past_due: "past_due";
|
|
1252
|
+
payment_failed: "payment_failed";
|
|
1253
|
+
payment_retried: "payment_retried";
|
|
1254
|
+
plan_change_scheduled: "plan_change_scheduled";
|
|
1255
|
+
plan_changed: "plan_changed";
|
|
1256
|
+
reactivated: "reactivated";
|
|
1257
|
+
renewed: "renewed";
|
|
1258
|
+
resumed: "resumed";
|
|
1259
|
+
suspended: "suspended";
|
|
1260
|
+
trial_ended: "trial_ended";
|
|
1261
|
+
trial_started: "trial_started";
|
|
1262
|
+
}>;
|
|
1263
|
+
previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1264
|
+
newStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1265
|
+
previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1266
|
+
newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1267
|
+
paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1268
|
+
amount: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
1269
|
+
currency: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1270
|
+
triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1271
|
+
userId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1272
|
+
note: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1273
|
+
}, import("zod/v4/core").$strip>>;
|
|
1114
1274
|
}>;
|
|
1115
1275
|
/**
|
|
1116
1276
|
* Get the feature and usage limit entitlements for the current organization.
|
|
1117
1277
|
*/
|
|
1118
1278
|
readonly getEntitlements: import("alepha/server").ActionPrimitiveFn<{
|
|
1119
|
-
response: import("
|
|
1120
|
-
planId: import("
|
|
1121
|
-
planName: import("
|
|
1122
|
-
status: import("
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1279
|
+
response: import("zod").ZodObject<{
|
|
1280
|
+
planId: import("zod").ZodString;
|
|
1281
|
+
planName: import("zod").ZodString;
|
|
1282
|
+
status: import("zod").ZodEnum<{
|
|
1283
|
+
active: "active";
|
|
1284
|
+
cancelled: "cancelled";
|
|
1285
|
+
expired: "expired";
|
|
1286
|
+
past_due: "past_due";
|
|
1287
|
+
suspended: "suspended";
|
|
1288
|
+
trialing: "trialing";
|
|
1289
|
+
}>;
|
|
1290
|
+
features: import("zod").ZodArray<import("zod").ZodString>;
|
|
1291
|
+
limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
1292
|
+
trialEndsAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1293
|
+
periodEndsAt: import("zod").ZodString;
|
|
1294
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1295
|
+
}, import("zod/v4/core").$strip>;
|
|
1129
1296
|
}>;
|
|
1130
1297
|
}
|
|
1131
1298
|
//#endregion
|
|
@@ -1144,49 +1311,78 @@ declare class SubscriptionJobs {
|
|
|
1144
1311
|
protected readonly dateTime: DateTimeProvider;
|
|
1145
1312
|
protected readonly paymentService: PaymentService;
|
|
1146
1313
|
protected readonly config: SubscriptionConfig;
|
|
1147
|
-
protected readonly subscriptionRepo: import("alepha/orm").Repository<import("
|
|
1148
|
-
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1149
|
-
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1150
|
-
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1151
|
-
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1152
|
-
organizationId: import("alepha/orm").PgAttr<import("
|
|
1153
|
-
planId: import("
|
|
1154
|
-
interval: import("
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1314
|
+
protected readonly subscriptionRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
|
|
1315
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1316
|
+
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1317
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1318
|
+
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1319
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
1320
|
+
planId: import("zod").ZodString;
|
|
1321
|
+
interval: import("zod").ZodEnum<{
|
|
1322
|
+
monthly: "monthly";
|
|
1323
|
+
yearly: "yearly";
|
|
1324
|
+
}>;
|
|
1325
|
+
status: import("zod").ZodEnum<{
|
|
1326
|
+
active: "active";
|
|
1327
|
+
cancelled: "cancelled";
|
|
1328
|
+
expired: "expired";
|
|
1329
|
+
past_due: "past_due";
|
|
1330
|
+
suspended: "suspended";
|
|
1331
|
+
trialing: "trialing";
|
|
1332
|
+
}>;
|
|
1333
|
+
currentPeriodStart: import("zod").ZodString;
|
|
1334
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
1335
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1336
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1337
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1338
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1339
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
1340
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1341
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1342
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1343
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1344
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
1345
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1346
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1347
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1348
|
+
monthly: "monthly";
|
|
1349
|
+
yearly: "yearly";
|
|
1350
|
+
}>>;
|
|
1351
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1352
|
+
}, import("zod/v4/core").$strip>>;
|
|
1353
|
+
protected readonly eventRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
|
|
1354
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1355
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1356
|
+
subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
|
|
1357
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
1358
|
+
type: import("zod").ZodEnum<{
|
|
1359
|
+
activated: "activated";
|
|
1360
|
+
cancelled: "cancelled";
|
|
1361
|
+
created: "created";
|
|
1362
|
+
expired: "expired";
|
|
1363
|
+
past_due: "past_due";
|
|
1364
|
+
payment_failed: "payment_failed";
|
|
1365
|
+
payment_retried: "payment_retried";
|
|
1366
|
+
plan_change_scheduled: "plan_change_scheduled";
|
|
1367
|
+
plan_changed: "plan_changed";
|
|
1368
|
+
reactivated: "reactivated";
|
|
1369
|
+
renewed: "renewed";
|
|
1370
|
+
resumed: "resumed";
|
|
1371
|
+
suspended: "suspended";
|
|
1372
|
+
trial_ended: "trial_ended";
|
|
1373
|
+
trial_started: "trial_started";
|
|
1374
|
+
}>;
|
|
1375
|
+
previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1376
|
+
newStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1377
|
+
previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1378
|
+
newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1379
|
+
paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1380
|
+
amount: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
1381
|
+
currency: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1382
|
+
triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1383
|
+
userId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1384
|
+
note: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1385
|
+
}, import("zod/v4/core").$strip>>;
|
|
1190
1386
|
/**
|
|
1191
1387
|
* Record a subscription event in the event log.
|
|
1192
1388
|
*/
|
|
@@ -1195,32 +1391,32 @@ declare class SubscriptionJobs {
|
|
|
1195
1391
|
* Creates payment intents for subscriptions due for renewal.
|
|
1196
1392
|
* Runs hourly.
|
|
1197
1393
|
*/
|
|
1198
|
-
readonly billingCycle: import("alepha/api/jobs").JobPrimitive<import("
|
|
1394
|
+
readonly billingCycle: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
|
|
1199
1395
|
/**
|
|
1200
1396
|
* Retries failed payments on the dunning schedule.
|
|
1201
1397
|
* Runs hourly.
|
|
1202
1398
|
*/
|
|
1203
|
-
readonly dunningRetry: import("alepha/api/jobs").JobPrimitive<import("
|
|
1399
|
+
readonly dunningRetry: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
|
|
1204
1400
|
/**
|
|
1205
1401
|
* Handles trial expirations.
|
|
1206
1402
|
* Runs hourly.
|
|
1207
1403
|
*/
|
|
1208
|
-
readonly trialExpiry: import("alepha/api/jobs").JobPrimitive<import("
|
|
1404
|
+
readonly trialExpiry: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
|
|
1209
1405
|
/**
|
|
1210
1406
|
* Expires cancelled subscriptions that reached period end.
|
|
1211
1407
|
* Runs hourly.
|
|
1212
1408
|
*/
|
|
1213
|
-
readonly expirationSweep: import("alepha/api/jobs").JobPrimitive<import("
|
|
1409
|
+
readonly expirationSweep: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
|
|
1214
1410
|
/**
|
|
1215
1411
|
* Suspends past_due subscriptions where grace period has elapsed.
|
|
1216
1412
|
* Runs daily at 2 AM.
|
|
1217
1413
|
*/
|
|
1218
|
-
readonly gracePeriodSweep: import("alepha/api/jobs").JobPrimitive<import("
|
|
1414
|
+
readonly gracePeriodSweep: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
|
|
1219
1415
|
/**
|
|
1220
1416
|
* Purges old subscription events older than 365 days.
|
|
1221
1417
|
* Runs daily at 3 AM.
|
|
1222
1418
|
*/
|
|
1223
|
-
readonly purgeEvents: import("alepha/api/jobs").JobPrimitive<import("
|
|
1419
|
+
readonly purgeEvents: import("alepha/api/jobs").JobPrimitive<import("alepha").ZType>;
|
|
1224
1420
|
}
|
|
1225
1421
|
//#endregion
|
|
1226
1422
|
//#region ../../src/api/subscriptions/middleware/$requireLimit.d.ts
|
|
@@ -1271,155 +1467,200 @@ declare class SubscriptionNotifications {
|
|
|
1271
1467
|
/**
|
|
1272
1468
|
* Sent when a trial is ending soon.
|
|
1273
1469
|
*/
|
|
1274
|
-
protected readonly trialEnding: import("alepha/api/notifications").NotificationPrimitive<import("
|
|
1275
|
-
planName: import("
|
|
1276
|
-
trialEndDate: import("
|
|
1277
|
-
amount: import("
|
|
1278
|
-
interval: import("
|
|
1279
|
-
}>>;
|
|
1470
|
+
protected readonly trialEnding: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
|
|
1471
|
+
planName: import("zod").ZodString;
|
|
1472
|
+
trialEndDate: import("zod").ZodString;
|
|
1473
|
+
amount: import("zod").ZodString;
|
|
1474
|
+
interval: import("zod").ZodString;
|
|
1475
|
+
}, import("zod/v4/core").$strip>>;
|
|
1280
1476
|
/**
|
|
1281
1477
|
* Sent when a payment fails. Critical notification.
|
|
1282
1478
|
*/
|
|
1283
|
-
protected readonly paymentFailed: import("alepha/api/notifications").NotificationPrimitive<import("
|
|
1284
|
-
planName: import("
|
|
1285
|
-
amount: import("
|
|
1286
|
-
retryDate: import("
|
|
1287
|
-
}>>;
|
|
1479
|
+
protected readonly paymentFailed: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
|
|
1480
|
+
planName: import("zod").ZodString;
|
|
1481
|
+
amount: import("zod").ZodString;
|
|
1482
|
+
retryDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1483
|
+
}, import("zod/v4/core").$strip>>;
|
|
1288
1484
|
/**
|
|
1289
1485
|
* Sent when a subscription is suspended due to failed payments. Critical notification.
|
|
1290
1486
|
*/
|
|
1291
|
-
protected readonly subscriptionSuspended: import("alepha/api/notifications").NotificationPrimitive<import("
|
|
1292
|
-
planName: import("
|
|
1293
|
-
}>>;
|
|
1487
|
+
protected readonly subscriptionSuspended: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
|
|
1488
|
+
planName: import("zod").ZodString;
|
|
1489
|
+
}, import("zod/v4/core").$strip>>;
|
|
1294
1490
|
/**
|
|
1295
1491
|
* Sent when a subscription is successfully renewed.
|
|
1296
1492
|
*/
|
|
1297
|
-
protected readonly subscriptionRenewed: import("alepha/api/notifications").NotificationPrimitive<import("
|
|
1298
|
-
planName: import("
|
|
1299
|
-
amount: import("
|
|
1300
|
-
nextBillingDate: import("
|
|
1301
|
-
}>>;
|
|
1493
|
+
protected readonly subscriptionRenewed: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
|
|
1494
|
+
planName: import("zod").ZodString;
|
|
1495
|
+
amount: import("zod").ZodString;
|
|
1496
|
+
nextBillingDate: import("zod").ZodString;
|
|
1497
|
+
}, import("zod/v4/core").$strip>>;
|
|
1302
1498
|
/**
|
|
1303
1499
|
* Sent when a subscription plan is changed.
|
|
1304
1500
|
*/
|
|
1305
|
-
protected readonly planChanged: import("alepha/api/notifications").NotificationPrimitive<import("
|
|
1306
|
-
oldPlanName: import("
|
|
1307
|
-
newPlanName: import("
|
|
1308
|
-
effectiveDate: import("
|
|
1309
|
-
}>>;
|
|
1501
|
+
protected readonly planChanged: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
|
|
1502
|
+
oldPlanName: import("zod").ZodString;
|
|
1503
|
+
newPlanName: import("zod").ZodString;
|
|
1504
|
+
effectiveDate: import("zod").ZodString;
|
|
1505
|
+
}, import("zod/v4/core").$strip>>;
|
|
1310
1506
|
/**
|
|
1311
1507
|
* Sent when a subscription is cancelled.
|
|
1312
1508
|
*/
|
|
1313
|
-
protected readonly cancellationConfirmed: import("alepha/api/notifications").NotificationPrimitive<import("
|
|
1314
|
-
planName: import("
|
|
1315
|
-
accessUntil: import("
|
|
1316
|
-
}>>;
|
|
1509
|
+
protected readonly cancellationConfirmed: import("alepha/api/notifications").NotificationPrimitive<import("zod").ZodObject<{
|
|
1510
|
+
planName: import("zod").ZodString;
|
|
1511
|
+
accessUntil: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1512
|
+
}, import("zod/v4/core").$strip>>;
|
|
1317
1513
|
}
|
|
1318
1514
|
//#endregion
|
|
1319
1515
|
//#region ../../src/api/subscriptions/schemas/cancelSubscriptionSchema.d.ts
|
|
1320
|
-
declare const cancelSubscriptionSchema: import("
|
|
1321
|
-
reason: import("
|
|
1322
|
-
immediate: import("
|
|
1323
|
-
}>;
|
|
1516
|
+
declare const cancelSubscriptionSchema: import("zod").ZodObject<{
|
|
1517
|
+
reason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1518
|
+
immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1519
|
+
}, import("zod/v4/core").$strip>;
|
|
1324
1520
|
type CancelSubscription = Static<typeof cancelSubscriptionSchema>;
|
|
1325
1521
|
//#endregion
|
|
1326
1522
|
//#region ../../src/api/subscriptions/schemas/changePlanSchema.d.ts
|
|
1327
|
-
declare const changePlanSchema: import("
|
|
1328
|
-
planId: import("
|
|
1329
|
-
interval: import("
|
|
1330
|
-
|
|
1331
|
-
|
|
1523
|
+
declare const changePlanSchema: import("zod").ZodObject<{
|
|
1524
|
+
planId: import("zod").ZodString;
|
|
1525
|
+
interval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1526
|
+
monthly: "monthly";
|
|
1527
|
+
yearly: "yearly";
|
|
1528
|
+
}>>;
|
|
1529
|
+
immediate: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1530
|
+
}, import("zod/v4/core").$strip>;
|
|
1332
1531
|
type ChangePlan = Static<typeof changePlanSchema>;
|
|
1333
1532
|
//#endregion
|
|
1334
1533
|
//#region ../../src/api/subscriptions/schemas/createSubscriptionSchema.d.ts
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1534
|
+
/**
|
|
1535
|
+
* Public body for the self-service subscribe endpoint.
|
|
1536
|
+
*
|
|
1537
|
+
* Deliberately does NOT expose `skipTrial` (or a `paymentMethodId`): skipping
|
|
1538
|
+
* the trial goes straight to a paid `active` subscription with no captured
|
|
1539
|
+
* payment, so it must never be client-controlled. Trusted server-side callers
|
|
1540
|
+
* pass `skipTrial` through the `SubscriptionService.subscribe` options after a
|
|
1541
|
+
* payment is captured — it is not part of the public request.
|
|
1542
|
+
*/
|
|
1543
|
+
declare const createSubscriptionSchema: import("zod").ZodObject<{
|
|
1544
|
+
planId: import("zod").ZodString;
|
|
1545
|
+
interval: import("zod").ZodEnum<{
|
|
1546
|
+
monthly: "monthly";
|
|
1547
|
+
yearly: "yearly";
|
|
1548
|
+
}>;
|
|
1549
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1550
|
+
}, import("zod/v4/core").$strip>;
|
|
1342
1551
|
type CreateSubscription = Static<typeof createSubscriptionSchema>;
|
|
1343
1552
|
//#endregion
|
|
1344
1553
|
//#region ../../src/api/subscriptions/schemas/mrrSchema.d.ts
|
|
1345
|
-
declare const mrrSchema: import("
|
|
1346
|
-
total: import("
|
|
1347
|
-
byPlan: import("
|
|
1348
|
-
growth: import("
|
|
1349
|
-
newMrr: import("
|
|
1350
|
-
expansionMrr: import("
|
|
1351
|
-
contractionMrr: import("
|
|
1352
|
-
churnMrr: import("
|
|
1353
|
-
}>;
|
|
1554
|
+
declare const mrrSchema: import("zod").ZodObject<{
|
|
1555
|
+
total: import("zod").ZodInt;
|
|
1556
|
+
byPlan: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
1557
|
+
growth: import("zod").ZodInt;
|
|
1558
|
+
newMrr: import("zod").ZodInt;
|
|
1559
|
+
expansionMrr: import("zod").ZodInt;
|
|
1560
|
+
contractionMrr: import("zod").ZodInt;
|
|
1561
|
+
churnMrr: import("zod").ZodInt;
|
|
1562
|
+
}, import("zod/v4/core").$strip>;
|
|
1354
1563
|
type MrrData = Static<typeof mrrSchema>;
|
|
1355
1564
|
//#endregion
|
|
1356
1565
|
//#region ../../src/api/subscriptions/schemas/planResourceSchema.d.ts
|
|
1357
|
-
declare const planResourceSchema: import("
|
|
1358
|
-
id: import("
|
|
1359
|
-
name: import("
|
|
1360
|
-
description: import("
|
|
1361
|
-
pricing: import("
|
|
1362
|
-
interval: import("
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1566
|
+
declare const planResourceSchema: import("zod").ZodObject<{
|
|
1567
|
+
id: import("zod").ZodString;
|
|
1568
|
+
name: import("zod").ZodString;
|
|
1569
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1570
|
+
pricing: import("zod").ZodArray<import("zod").ZodObject<{
|
|
1571
|
+
interval: import("zod").ZodEnum<{
|
|
1572
|
+
monthly: "monthly";
|
|
1573
|
+
yearly: "yearly";
|
|
1574
|
+
}>;
|
|
1575
|
+
amount: import("zod").ZodInt;
|
|
1576
|
+
currency: import("zod").ZodString;
|
|
1577
|
+
}, import("zod/v4/core").$strip>>;
|
|
1578
|
+
features: import("zod").ZodArray<import("zod").ZodString>;
|
|
1579
|
+
limits: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodInt>;
|
|
1580
|
+
trial: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1581
|
+
days: import("zod").ZodInt;
|
|
1582
|
+
requirePaymentMethod: import("zod").ZodBoolean;
|
|
1583
|
+
}, import("zod/v4/core").$strip>>;
|
|
1584
|
+
order: import("zod").ZodInt;
|
|
1585
|
+
}, import("zod/v4/core").$strip>;
|
|
1374
1586
|
type PlanResource = Static<typeof planResourceSchema>;
|
|
1375
1587
|
//#endregion
|
|
1376
1588
|
//#region ../../src/api/subscriptions/schemas/subscriptionEventResourceSchema.d.ts
|
|
1377
|
-
declare const subscriptionEventResourceSchema: import("
|
|
1378
|
-
id: PgAttr<PgAttr<import("
|
|
1379
|
-
createdAt: PgAttr<PgAttr<import("
|
|
1380
|
-
subscriptionId: PgAttr<import("
|
|
1381
|
-
organizationId: PgAttr<import("
|
|
1382
|
-
type: import("
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1589
|
+
declare const subscriptionEventResourceSchema: import("zod").ZodObject<{
|
|
1590
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1591
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1592
|
+
subscriptionId: PgAttr<import("zod").ZodString, typeof PG_REF>;
|
|
1593
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
1594
|
+
type: import("zod").ZodEnum<{
|
|
1595
|
+
activated: "activated";
|
|
1596
|
+
cancelled: "cancelled";
|
|
1597
|
+
created: "created";
|
|
1598
|
+
expired: "expired";
|
|
1599
|
+
past_due: "past_due";
|
|
1600
|
+
payment_failed: "payment_failed";
|
|
1601
|
+
payment_retried: "payment_retried";
|
|
1602
|
+
plan_change_scheduled: "plan_change_scheduled";
|
|
1603
|
+
plan_changed: "plan_changed";
|
|
1604
|
+
reactivated: "reactivated";
|
|
1605
|
+
renewed: "renewed";
|
|
1606
|
+
resumed: "resumed";
|
|
1607
|
+
suspended: "suspended";
|
|
1608
|
+
trial_ended: "trial_ended";
|
|
1609
|
+
trial_started: "trial_started";
|
|
1610
|
+
}>;
|
|
1611
|
+
previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1612
|
+
newStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1613
|
+
previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1614
|
+
newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1615
|
+
paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1616
|
+
amount: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
1617
|
+
currency: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1618
|
+
triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1619
|
+
userId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1620
|
+
note: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1621
|
+
}, import("zod/v4/core").$strip>;
|
|
1394
1622
|
type SubscriptionEventResource = Static<typeof subscriptionEventResourceSchema>;
|
|
1395
1623
|
//#endregion
|
|
1396
1624
|
//#region ../../src/api/subscriptions/schemas/subscriptionResourceSchema.d.ts
|
|
1397
|
-
declare const subscriptionResourceSchema: import("
|
|
1398
|
-
id: PgAttr<PgAttr<import("
|
|
1399
|
-
version: PgAttr<PgAttr<import("
|
|
1400
|
-
createdAt: PgAttr<PgAttr<import("
|
|
1401
|
-
updatedAt: PgAttr<PgAttr<import("
|
|
1402
|
-
organizationId: PgAttr<import("
|
|
1403
|
-
planId: import("
|
|
1404
|
-
interval: import("
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1625
|
+
declare const subscriptionResourceSchema: import("zod").ZodObject<{
|
|
1626
|
+
id: PgAttr<PgAttr<import("zod").ZodString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1627
|
+
version: PgAttr<PgAttr<import("zod").ZodInt, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1628
|
+
createdAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1629
|
+
updatedAt: PgAttr<PgAttr<import("zod").ZodString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1630
|
+
organizationId: PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof PG_ORGANIZATION>;
|
|
1631
|
+
planId: import("zod").ZodString;
|
|
1632
|
+
interval: import("zod").ZodEnum<{
|
|
1633
|
+
monthly: "monthly";
|
|
1634
|
+
yearly: "yearly";
|
|
1635
|
+
}>;
|
|
1636
|
+
status: import("zod").ZodEnum<{
|
|
1637
|
+
active: "active";
|
|
1638
|
+
cancelled: "cancelled";
|
|
1639
|
+
expired: "expired";
|
|
1640
|
+
past_due: "past_due";
|
|
1641
|
+
suspended: "suspended";
|
|
1642
|
+
trialing: "trialing";
|
|
1643
|
+
}>;
|
|
1644
|
+
currentPeriodStart: import("zod").ZodString;
|
|
1645
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
1646
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1647
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1648
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1649
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1650
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
1651
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1652
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1653
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1654
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1655
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
1656
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1657
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1658
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1659
|
+
monthly: "monthly";
|
|
1660
|
+
yearly: "yearly";
|
|
1661
|
+
}>>;
|
|
1662
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1663
|
+
}, import("zod/v4/core").$strip>;
|
|
1423
1664
|
type SubscriptionResource = Static<typeof subscriptionResourceSchema>;
|
|
1424
1665
|
//#endregion
|
|
1425
1666
|
//#region ../../src/api/subscriptions/services/BillingService.d.ts
|
|
@@ -1445,49 +1686,78 @@ declare class BillingService {
|
|
|
1445
1686
|
protected readonly alepha: Alepha;
|
|
1446
1687
|
protected readonly log: import("alepha/logger").Logger;
|
|
1447
1688
|
protected readonly dateTime: DateTimeProvider;
|
|
1448
|
-
protected readonly subscriptionRepo: import("alepha/orm").Repository<import("
|
|
1449
|
-
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1450
|
-
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1451
|
-
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1452
|
-
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("
|
|
1453
|
-
organizationId: import("alepha/orm").PgAttr<import("
|
|
1454
|
-
planId: import("
|
|
1455
|
-
interval: import("
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1689
|
+
protected readonly subscriptionRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
|
|
1690
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1691
|
+
version: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodInt, typeof import("alepha/orm").PG_VERSION>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1692
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1693
|
+
updatedAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_UPDATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1694
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
1695
|
+
planId: import("zod").ZodString;
|
|
1696
|
+
interval: import("zod").ZodEnum<{
|
|
1697
|
+
monthly: "monthly";
|
|
1698
|
+
yearly: "yearly";
|
|
1699
|
+
}>;
|
|
1700
|
+
status: import("zod").ZodEnum<{
|
|
1701
|
+
active: "active";
|
|
1702
|
+
cancelled: "cancelled";
|
|
1703
|
+
expired: "expired";
|
|
1704
|
+
past_due: "past_due";
|
|
1705
|
+
suspended: "suspended";
|
|
1706
|
+
trialing: "trialing";
|
|
1707
|
+
}>;
|
|
1708
|
+
currentPeriodStart: import("zod").ZodString;
|
|
1709
|
+
currentPeriodEnd: import("zod").ZodString;
|
|
1710
|
+
trialStart: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1711
|
+
trialEnd: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1712
|
+
cancelledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1713
|
+
cancelReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1714
|
+
cancelAtPeriodEnd: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
1715
|
+
lastPaymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1716
|
+
lastPaymentAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1717
|
+
nextBillingAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1718
|
+
dunningStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1719
|
+
dunningAttempt: import("zod").ZodDefault<import("zod").ZodInt>;
|
|
1720
|
+
dunningNextRetryAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1721
|
+
pendingPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1722
|
+
pendingInterval: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1723
|
+
monthly: "monthly";
|
|
1724
|
+
yearly: "yearly";
|
|
1725
|
+
}>>;
|
|
1726
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1727
|
+
}, import("zod/v4/core").$strip>>;
|
|
1728
|
+
protected readonly eventRepo: import("alepha/orm").Repository<import("zod").ZodObject<{
|
|
1729
|
+
id: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_PRIMARY_KEY>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1730
|
+
createdAt: import("alepha/orm").PgAttr<import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_CREATED_AT>, typeof import("alepha/orm").PG_DEFAULT>;
|
|
1731
|
+
subscriptionId: import("alepha/orm").PgAttr<import("zod").ZodString, typeof import("alepha/orm").PG_REF>;
|
|
1732
|
+
organizationId: import("alepha/orm").PgAttr<import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodString, typeof import("alepha/orm").PG_ORGANIZATION>;
|
|
1733
|
+
type: import("zod").ZodEnum<{
|
|
1734
|
+
activated: "activated";
|
|
1735
|
+
cancelled: "cancelled";
|
|
1736
|
+
created: "created";
|
|
1737
|
+
expired: "expired";
|
|
1738
|
+
past_due: "past_due";
|
|
1739
|
+
payment_failed: "payment_failed";
|
|
1740
|
+
payment_retried: "payment_retried";
|
|
1741
|
+
plan_change_scheduled: "plan_change_scheduled";
|
|
1742
|
+
plan_changed: "plan_changed";
|
|
1743
|
+
reactivated: "reactivated";
|
|
1744
|
+
renewed: "renewed";
|
|
1745
|
+
resumed: "resumed";
|
|
1746
|
+
suspended: "suspended";
|
|
1747
|
+
trial_ended: "trial_ended";
|
|
1748
|
+
trial_started: "trial_started";
|
|
1749
|
+
}>;
|
|
1750
|
+
previousStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1751
|
+
newStatus: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1752
|
+
previousPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1753
|
+
newPlanId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1754
|
+
paymentIntentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1755
|
+
amount: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
1756
|
+
currency: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1757
|
+
triggeredBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1758
|
+
userId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1759
|
+
note: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1760
|
+
}, import("zod/v4/core").$strip>>;
|
|
1491
1761
|
protected readonly paymentService: PaymentService;
|
|
1492
1762
|
protected readonly config: SubscriptionConfig;
|
|
1493
1763
|
/**
|