@antelopejs/dms-saas 0.4.0 → 0.5.1
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/README.md +42 -2
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/owner-only-permissions-resolver.d.ts +1 -0
- package/dist/auth/owner-only-permissions-resolver.js +25 -0
- package/dist/auth/owner-only-permissions-resolver.js.map +1 -0
- package/dist/billing-state/directory-hooks.d.ts +1 -0
- package/dist/billing-state/directory-hooks.js +35 -0
- package/dist/billing-state/directory-hooks.js.map +1 -0
- package/dist/billing-state/directory.d.ts +29 -0
- package/dist/billing-state/directory.js +152 -0
- package/dist/billing-state/directory.js.map +1 -0
- package/dist/billing-state/index.d.ts +5 -1
- package/dist/billing-state/index.js +14 -2
- package/dist/billing-state/index.js.map +1 -1
- package/dist/billing-state/past-due-banner.d.ts +4 -3
- package/dist/billing-state/past-due-banner.js +30 -10
- package/dist/billing-state/past-due-banner.js.map +1 -1
- package/dist/billing-state/recovery.d.ts +4 -0
- package/dist/billing-state/recovery.js +7 -5
- package/dist/billing-state/recovery.js.map +1 -1
- package/dist/billing-state/trial-ending-banner.d.ts +4 -0
- package/dist/billing-state/trial-ending-banner.js +66 -0
- package/dist/billing-state/trial-ending-banner.js.map +1 -0
- package/dist/config/runtime.d.ts +1 -0
- package/dist/config/runtime.js +5 -0
- package/dist/config/runtime.js.map +1 -1
- package/dist/crons/auto-suspend-past-due.js +4 -5
- package/dist/crons/auto-suspend-past-due.js.map +1 -1
- package/dist/data-api/platformOwner/admin-user-invoices.d.ts +6 -4
- package/dist/data-api/platformOwner/admin-user-invoices.js +52 -30
- package/dist/data-api/platformOwner/admin-user-invoices.js.map +1 -1
- package/dist/data-api/platformOwner/admin-user-workspaces.d.ts +2 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.js +69 -3
- package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -1
- package/dist/data-api/platformOwner/credit-note-rows.d.ts +11 -0
- package/dist/data-api/platformOwner/credit-note-rows.js +54 -0
- package/dist/data-api/platformOwner/credit-note-rows.js.map +1 -0
- package/dist/data-api/platformOwner/credit-notes.d.ts +13 -0
- package/dist/data-api/platformOwner/credit-notes.js +149 -10
- package/dist/data-api/platformOwner/credit-notes.js.map +1 -1
- package/dist/data-api/platformOwner/features.d.ts +7 -2
- package/dist/data-api/platformOwner/features.js +151 -37
- package/dist/data-api/platformOwner/features.js.map +1 -1
- package/dist/data-api/platformOwner/invitations.js +29 -9
- package/dist/data-api/platformOwner/invitations.js.map +1 -1
- package/dist/data-api/platformOwner/invoice-cells.d.ts +5 -0
- package/dist/data-api/platformOwner/invoice-cells.js +51 -0
- package/dist/data-api/platformOwner/invoice-cells.js.map +1 -0
- package/dist/data-api/platformOwner/invoice-options.js.map +1 -1
- package/dist/data-api/platformOwner/invoice-rows.d.ts +9 -0
- package/dist/data-api/platformOwner/invoice-rows.js +39 -0
- package/dist/data-api/platformOwner/invoice-rows.js.map +1 -0
- package/dist/data-api/platformOwner/invoices.d.ts +24 -6
- package/dist/data-api/platformOwner/invoices.js +192 -11
- package/dist/data-api/platformOwner/invoices.js.map +1 -1
- package/dist/data-api/platformOwner/members.d.ts +2 -1
- package/dist/data-api/platformOwner/members.js +56 -20
- package/dist/data-api/platformOwner/members.js.map +1 -1
- package/dist/data-api/platformOwner/plan-migrations.d.ts +14 -2
- package/dist/data-api/platformOwner/plan-migrations.js +179 -33
- package/dist/data-api/platformOwner/plan-migrations.js.map +1 -1
- package/dist/data-api/platformOwner/plans.d.ts +30 -6
- package/dist/data-api/platformOwner/plans.js +269 -44
- package/dist/data-api/platformOwner/plans.js.map +1 -1
- package/dist/data-api/platformOwner/segments.d.ts +9 -7
- package/dist/data-api/platformOwner/segments.js +108 -101
- package/dist/data-api/platformOwner/segments.js.map +1 -1
- package/dist/data-api/platformOwner/table-scope.d.ts +6 -0
- package/dist/data-api/platformOwner/table-scope.js +8 -0
- package/dist/data-api/platformOwner/table-scope.js.map +1 -0
- package/dist/data-api/platformOwner/users.d.ts +15 -2
- package/dist/data-api/platformOwner/users.js +171 -15
- package/dist/data-api/platformOwner/users.js.map +1 -1
- package/dist/data-api/platformOwner/workspace-cells.d.ts +12 -0
- package/dist/data-api/platformOwner/workspace-cells.js +90 -0
- package/dist/data-api/platformOwner/workspace-cells.js.map +1 -0
- package/dist/data-api/platformOwner/workspaces.d.ts +26 -4
- package/dist/data-api/platformOwner/workspaces.js +269 -97
- package/dist/data-api/platformOwner/workspaces.js.map +1 -1
- package/dist/data-api/tenant/tenant-invoices.d.ts +4 -0
- package/dist/data-api/tenant/tenant-invoices.js +68 -4
- package/dist/data-api/tenant/tenant-invoices.js.map +1 -1
- package/dist/hooks/register.js +5 -1
- package/dist/hooks/register.js.map +1 -1
- package/dist/i18n/composed-text.d.ts +17 -0
- package/dist/i18n/composed-text.js +71 -0
- package/dist/i18n/composed-text.js.map +1 -0
- package/dist/implementations/dms-saas/billing.d.ts +1 -0
- package/dist/implementations/dms-saas/billing.js +4 -1
- package/dist/implementations/dms-saas/billing.js.map +1 -1
- package/dist/implementations/dms-saas/pages.d.ts +0 -1
- package/dist/implementations/dms-saas/pages.js +0 -4
- package/dist/implementations/dms-saas/pages.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics/activity-sources.d.ts +2 -0
- package/dist/metrics/activity-sources.js +60 -0
- package/dist/metrics/activity-sources.js.map +1 -0
- package/dist/metrics/activity.d.ts +25 -0
- package/dist/metrics/activity.js +197 -0
- package/dist/metrics/activity.js.map +1 -0
- package/dist/metrics/directory-summary.d.ts +30 -0
- package/dist/metrics/directory-summary.js +95 -0
- package/dist/metrics/directory-summary.js.map +1 -0
- package/dist/metrics/headline-items.d.ts +32 -0
- package/dist/metrics/headline-items.js +242 -0
- package/dist/metrics/headline-items.js.map +1 -0
- package/dist/metrics/normalised-mrr.d.ts +32 -0
- package/dist/metrics/normalised-mrr.js +75 -0
- package/dist/metrics/normalised-mrr.js.map +1 -0
- package/dist/metrics/revenue.d.ts +30 -0
- package/dist/metrics/revenue.js +126 -0
- package/dist/metrics/revenue.js.map +1 -0
- package/dist/notifications/recipients.d.ts +1 -0
- package/dist/notifications/recipients.js +4 -0
- package/dist/notifications/recipients.js.map +1 -1
- package/dist/notifications/subjects.d.ts +18 -17
- package/dist/notifications/subjects.js +7 -1
- package/dist/notifications/subjects.js.map +1 -1
- package/dist/operator-actions/commands.js +9 -6
- package/dist/operator-actions/commands.js.map +1 -1
- package/dist/operator-actions/invitation-commands.d.ts +7 -1
- package/dist/operator-actions/invitation-commands.js +16 -0
- package/dist/operator-actions/invitation-commands.js.map +1 -1
- package/dist/operator-actions/previews.d.ts +50 -0
- package/dist/operator-actions/previews.js +113 -0
- package/dist/operator-actions/previews.js.map +1 -0
- package/dist/operator-actions/types.d.ts +1 -1
- package/dist/operator-actions/upgrade-preview.d.ts +35 -0
- package/dist/operator-actions/upgrade-preview.js +110 -0
- package/dist/operator-actions/upgrade-preview.js.map +1 -0
- package/dist/operator-billing/billing-rules.d.ts +58 -0
- package/dist/operator-billing/billing-rules.js +90 -0
- package/dist/operator-billing/billing-rules.js.map +1 -0
- package/dist/operator-billing/billing-settings-store.d.ts +3 -0
- package/dist/operator-billing/billing-settings-store.js +34 -0
- package/dist/operator-billing/billing-settings-store.js.map +1 -0
- package/dist/operator-billing/billing-stats.d.ts +37 -0
- package/dist/operator-billing/billing-stats.js +197 -0
- package/dist/operator-billing/billing-stats.js.map +1 -0
- package/dist/operator-billing/credit-allowance.d.ts +17 -0
- package/dist/operator-billing/credit-allowance.js +44 -0
- package/dist/operator-billing/credit-allowance.js.map +1 -0
- package/dist/operator-billing/credit-note-request.d.ts +39 -0
- package/dist/operator-billing/credit-note-request.js +73 -0
- package/dist/operator-billing/credit-note-request.js.map +1 -0
- package/dist/operator-billing/index.d.ts +8 -0
- package/dist/operator-billing/index.js +25 -0
- package/dist/operator-billing/index.js.map +1 -0
- package/dist/operator-billing/invoice-credit.d.ts +41 -0
- package/dist/operator-billing/invoice-credit.js +111 -0
- package/dist/operator-billing/invoice-credit.js.map +1 -0
- package/dist/operator-billing/legal-documents-store.d.ts +12 -0
- package/dist/operator-billing/legal-documents-store.js +46 -0
- package/dist/operator-billing/legal-documents-store.js.map +1 -0
- package/dist/operator-billing/legal-versions.d.ts +5 -0
- package/dist/operator-billing/legal-versions.js +31 -0
- package/dist/operator-billing/legal-versions.js.map +1 -0
- package/dist/pages/block-meta.d.ts +15 -0
- package/dist/pages/block-meta.js +21 -0
- package/dist/pages/block-meta.js.map +1 -0
- package/dist/pages/module.d.ts +1 -3
- package/dist/pages/module.js +1 -8
- package/dist/pages/module.js.map +1 -1
- package/dist/pages/platform/credit-notes.d.ts +1 -0
- package/dist/pages/platform/credit-notes.js +63 -5
- package/dist/pages/platform/credit-notes.js.map +1 -1
- package/dist/pages/platform/dashboard.d.ts +4 -1
- package/dist/pages/platform/dashboard.js +123 -64
- package/dist/pages/platform/dashboard.js.map +1 -1
- package/dist/pages/platform/features.js +85 -12
- package/dist/pages/platform/features.js.map +1 -1
- package/dist/pages/platform/index.d.ts +1 -0
- package/dist/pages/platform/index.js +1 -0
- package/dist/pages/platform/index.js.map +1 -1
- package/dist/pages/platform/invoices.d.ts +6 -0
- package/dist/pages/platform/invoices.js +84 -28
- package/dist/pages/platform/invoices.js.map +1 -1
- package/dist/pages/platform/paths.d.ts +9 -0
- package/dist/pages/platform/paths.js +25 -0
- package/dist/pages/platform/paths.js.map +1 -0
- package/dist/pages/platform/plans/edit.d.ts +2 -2
- package/dist/pages/platform/plans/edit.js +170 -105
- package/dist/pages/platform/plans/edit.js.map +1 -1
- package/dist/pages/platform/plans/index.d.ts +1 -0
- package/dist/pages/platform/plans/index.js +177 -54
- package/dist/pages/platform/plans/index.js.map +1 -1
- package/dist/pages/platform/plans/migrations.d.ts +12 -0
- package/dist/pages/platform/plans/migrations.js +259 -13
- package/dist/pages/platform/plans/migrations.js.map +1 -1
- package/dist/pages/platform/segments/edit.d.ts +17 -0
- package/dist/pages/platform/segments/edit.js +124 -0
- package/dist/pages/platform/segments/edit.js.map +1 -0
- package/dist/pages/platform/segments/index.js +68 -8
- package/dist/pages/platform/segments/index.js.map +1 -1
- package/dist/pages/platform/settings.d.ts +1 -1
- package/dist/pages/platform/settings.js +164 -105
- package/dist/pages/platform/settings.js.map +1 -1
- package/dist/pages/platform/users/detail.js +112 -33
- package/dist/pages/platform/users/detail.js.map +1 -1
- package/dist/pages/platform/users/index.js +52 -18
- package/dist/pages/platform/users/index.js.map +1 -1
- package/dist/pages/platform/workspaces/detail.d.ts +3 -1
- package/dist/pages/platform/workspaces/detail.js +184 -113
- package/dist/pages/platform/workspaces/detail.js.map +1 -1
- package/dist/pages/platform/workspaces/index.d.ts +1 -20
- package/dist/pages/platform/workspaces/index.js +152 -180
- package/dist/pages/platform/workspaces/index.js.map +1 -1
- package/dist/pages/platform/workspaces/shared.d.ts +11 -0
- package/dist/pages/platform/workspaces/shared.js +53 -0
- package/dist/pages/platform/workspaces/shared.js.map +1 -0
- package/dist/pages/public/auth/no-workspace.js +7 -2
- package/dist/pages/public/auth/no-workspace.js.map +1 -1
- package/dist/pages/public/index.js.map +1 -1
- package/dist/pages/public/legal/privacy-policy.d.ts +1 -0
- package/dist/pages/public/legal/privacy-policy.js +9 -4
- package/dist/pages/public/legal/privacy-policy.js.map +1 -1
- package/dist/pages/public/legal/terms-and-conditions.d.ts +1 -0
- package/dist/pages/public/legal/terms-and-conditions.js +9 -4
- package/dist/pages/public/legal/terms-and-conditions.js.map +1 -1
- package/dist/pages/public/legal/terms-of-use.d.ts +1 -0
- package/dist/pages/public/legal/terms-of-use.js +9 -4
- package/dist/pages/public/legal/terms-of-use.js.map +1 -1
- package/dist/pages/public/nav-bar.d.ts +2 -0
- package/dist/pages/public/nav-bar.js +14 -0
- package/dist/pages/public/nav-bar.js.map +1 -0
- package/dist/pages/public/pricing.d.ts +10 -0
- package/dist/pages/public/pricing.js +32 -0
- package/dist/pages/public/pricing.js.map +1 -0
- package/dist/pages/public/register.d.ts +1 -0
- package/dist/pages/public/register.js +6 -3
- package/dist/pages/public/register.js.map +1 -1
- package/dist/pages/public/screens.js +1 -0
- package/dist/pages/public/screens.js.map +1 -1
- package/dist/pages/tenant/billing.d.ts +7 -7
- package/dist/pages/tenant/billing.js +141 -63
- package/dist/pages/tenant/billing.js.map +1 -1
- package/dist/pages/tenant/data-export.d.ts +3 -1
- package/dist/pages/tenant/data-export.js +25 -6
- package/dist/pages/tenant/data-export.js.map +1 -1
- package/dist/pages/tenant/general.d.ts +3 -2
- package/dist/pages/tenant/general.js +91 -11
- package/dist/pages/tenant/general.js.map +1 -1
- package/dist/pages/tenant/index.d.ts +1 -0
- package/dist/pages/tenant/index.js +1 -0
- package/dist/pages/tenant/index.js.map +1 -1
- package/dist/pages/tenant/members-seat-quota.d.ts +3 -0
- package/dist/pages/tenant/members-seat-quota.js +18 -6
- package/dist/pages/tenant/members-seat-quota.js.map +1 -1
- package/dist/pages/tenant/owner-only.d.ts +1 -0
- package/dist/pages/tenant/owner-only.js +14 -0
- package/dist/pages/tenant/owner-only.js.map +1 -0
- package/dist/pages/tenant/workspace-suspended.js +7 -3
- package/dist/pages/tenant/workspace-suspended.js.map +1 -1
- package/dist/plan-changes/applied-upgrade.d.ts +5 -0
- package/dist/plan-changes/applied-upgrade.js +51 -0
- package/dist/plan-changes/applied-upgrade.js.map +1 -0
- package/dist/plan-changes/deferred.js +9 -40
- package/dist/plan-changes/deferred.js.map +1 -1
- package/dist/plan-changes/immediate.d.ts +4 -0
- package/dist/plan-changes/immediate.js +34 -0
- package/dist/plan-changes/immediate.js.map +1 -0
- package/dist/plan-changes/index.d.ts +1 -0
- package/dist/plan-changes/index.js +1 -0
- package/dist/plan-changes/index.js.map +1 -1
- package/dist/plan-changes/pending-target.d.ts +17 -0
- package/dist/plan-changes/pending-target.js +62 -0
- package/dist/plan-changes/pending-target.js.map +1 -0
- package/dist/plans/catalogue-summary.d.ts +24 -0
- package/dist/plans/catalogue-summary.js +97 -0
- package/dist/plans/catalogue-summary.js.map +1 -0
- package/dist/plans/catalogue-usage.d.ts +36 -0
- package/dist/plans/catalogue-usage.js +120 -0
- package/dist/plans/catalogue-usage.js.map +1 -0
- package/dist/plans/feature-guards.d.ts +5 -0
- package/dist/plans/feature-guards.js +31 -0
- package/dist/plans/feature-guards.js.map +1 -0
- package/dist/plans/feature-usage.d.ts +4 -0
- package/dist/plans/feature-usage.js +22 -0
- package/dist/plans/feature-usage.js.map +1 -0
- package/dist/plans/migration-blocks.d.ts +13 -0
- package/dist/plans/migration-blocks.js +337 -0
- package/dist/plans/migration-blocks.js.map +1 -0
- package/dist/plans/migration-detail.d.ts +48 -0
- package/dist/plans/migration-detail.js +80 -0
- package/dist/plans/migration-detail.js.map +1 -0
- package/dist/plans/migration-dialogs.d.ts +8 -0
- package/dist/plans/migration-dialogs.js +103 -0
- package/dist/plans/migration-dialogs.js.map +1 -0
- package/dist/plans/migration-outcomes.d.ts +7 -0
- package/dist/plans/migration-outcomes.js +38 -0
- package/dist/plans/migration-outcomes.js.map +1 -0
- package/dist/plans/migration-realtime.d.ts +2 -0
- package/dist/plans/migration-realtime.js +19 -0
- package/dist/plans/migration-realtime.js.map +1 -0
- package/dist/plans/migration-workspaces.d.ts +40 -0
- package/dist/plans/migration-workspaces.js +121 -0
- package/dist/plans/migration-workspaces.js.map +1 -0
- package/dist/plans/money.d.ts +1 -0
- package/dist/plans/money.js +11 -0
- package/dist/plans/money.js.map +1 -0
- package/dist/plans/plan-access-type.d.ts +25 -0
- package/dist/plans/plan-access-type.js +49 -0
- package/dist/plans/plan-access-type.js.map +1 -0
- package/dist/plans/plan-audience.d.ts +3 -0
- package/dist/plans/plan-audience.js +9 -0
- package/dist/plans/plan-audience.js.map +1 -0
- package/dist/plans/plan-diff.d.ts +13 -0
- package/dist/plans/plan-diff.js +73 -0
- package/dist/plans/plan-diff.js.map +1 -0
- package/dist/plans/plan-permission-tree.d.ts +11 -0
- package/dist/plans/plan-permission-tree.js +58 -0
- package/dist/plans/plan-permission-tree.js.map +1 -0
- package/dist/plans/plan-write.d.ts +17 -0
- package/dist/plans/plan-write.js +111 -0
- package/dist/plans/plan-write.js.map +1 -0
- package/dist/plans/seat-capacity.d.ts +3 -1
- package/dist/plans/seat-capacity.js +10 -2
- package/dist/plans/seat-capacity.js.map +1 -1
- package/dist/plans/seat-hooks.d.ts +1 -0
- package/dist/plans/seat-hooks.js +1 -0
- package/dist/plans/seat-hooks.js.map +1 -1
- package/dist/plans/stripe-sync.d.ts +3 -0
- package/dist/plans/stripe-sync.js +16 -0
- package/dist/plans/stripe-sync.js.map +1 -1
- package/dist/routes/platformOwner/billing-settings.d.ts +11 -35
- package/dist/routes/platformOwner/billing-settings.js +77 -47
- package/dist/routes/platformOwner/billing-settings.js.map +1 -1
- package/dist/routes/platformOwner/billing-stats.d.ts +15 -0
- package/dist/routes/platformOwner/billing-stats.js +106 -0
- package/dist/routes/platformOwner/billing-stats.js.map +1 -0
- package/dist/routes/platformOwner/block-payloads.d.ts +7 -0
- package/dist/routes/platformOwner/block-payloads.js +3 -0
- package/dist/routes/platformOwner/block-payloads.js.map +1 -0
- package/dist/routes/platformOwner/credit-notes-issue.d.ts +7 -8
- package/dist/routes/platformOwner/credit-notes-issue.js +28 -16
- package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -1
- package/dist/routes/platformOwner/dashboard.d.ts +14 -57
- package/dist/routes/platformOwner/dashboard.js +126 -247
- package/dist/routes/platformOwner/dashboard.js.map +1 -1
- package/dist/routes/platformOwner/index.d.ts +7 -0
- package/dist/routes/platformOwner/index.js +7 -0
- package/dist/routes/platformOwner/index.js.map +1 -1
- package/dist/routes/platformOwner/plan-deletion.d.ts +77 -19
- package/dist/routes/platformOwner/plan-deletion.js +219 -67
- package/dist/routes/platformOwner/plan-deletion.js.map +1 -1
- package/dist/routes/platformOwner/plan-dialogs.d.ts +22 -0
- package/dist/routes/platformOwner/plan-dialogs.js +211 -0
- package/dist/routes/platformOwner/plan-dialogs.js.map +1 -0
- package/dist/routes/platformOwner/plan-migration-context.d.ts +9 -0
- package/dist/routes/platformOwner/plan-migration-context.js +147 -0
- package/dist/routes/platformOwner/plan-migration-context.js.map +1 -0
- package/dist/routes/platformOwner/plan-migration-export.d.ts +12 -0
- package/dist/routes/platformOwner/plan-migration-export.js +100 -0
- package/dist/routes/platformOwner/plan-migration-export.js.map +1 -0
- package/dist/routes/platformOwner/plan-migrations.d.ts +43 -0
- package/dist/routes/platformOwner/plan-migrations.js +260 -0
- package/dist/routes/platformOwner/plan-migrations.js.map +1 -0
- package/dist/routes/platformOwner/plans.d.ts +44 -41
- package/dist/routes/platformOwner/plans.js +155 -142
- package/dist/routes/platformOwner/plans.js.map +1 -1
- package/dist/routes/platformOwner/platform-owners.d.ts +8 -6
- package/dist/routes/platformOwner/platform-owners.js +40 -12
- package/dist/routes/platformOwner/platform-owners.js.map +1 -1
- package/dist/routes/platformOwner/segments-export.d.ts +15 -0
- package/dist/routes/platformOwner/segments-export.js +143 -0
- package/dist/routes/platformOwner/segments-export.js.map +1 -0
- package/dist/routes/platformOwner/segments.d.ts +17 -11
- package/dist/routes/platformOwner/segments.js +62 -113
- package/dist/routes/platformOwner/segments.js.map +1 -1
- package/dist/routes/platformOwner/stripe-dashboard.d.ts +6 -0
- package/dist/routes/platformOwner/stripe-dashboard.js +29 -0
- package/dist/routes/platformOwner/stripe-dashboard.js.map +1 -0
- package/dist/routes/platformOwner/users-detail.d.ts +12 -22
- package/dist/routes/platformOwner/users-detail.js +60 -53
- package/dist/routes/platformOwner/users-detail.js.map +1 -1
- package/dist/routes/platformOwner/workspace-detail.d.ts +36 -0
- package/dist/routes/platformOwner/workspace-detail.js +222 -0
- package/dist/routes/platformOwner/workspace-detail.js.map +1 -0
- package/dist/routes/platformOwner/workspace-invitations.d.ts +4 -0
- package/dist/routes/platformOwner/workspace-invitations.js +18 -0
- package/dist/routes/platformOwner/workspace-invitations.js.map +1 -1
- package/dist/routes/platformOwner/workspace-operator-actions.d.ts +14 -2
- package/dist/routes/platformOwner/workspace-operator-actions.js +42 -4
- package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
- package/dist/routes/platformOwner/workspaces-admin.d.ts +17 -12
- package/dist/routes/platformOwner/workspaces-admin.js +122 -28
- package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
- package/dist/routes/public/index.d.ts +1 -0
- package/dist/routes/public/index.js +1 -0
- package/dist/routes/public/index.js.map +1 -1
- package/dist/routes/public/legal-documents.d.ts +2 -8
- package/dist/routes/public/legal-documents.js +4 -39
- package/dist/routes/public/legal-documents.js.map +1 -1
- package/dist/routes/public/pricing.d.ts +12 -0
- package/dist/routes/public/pricing.js +50 -0
- package/dist/routes/public/pricing.js.map +1 -0
- package/dist/routes/public/public-plan-catalog.d.ts +37 -0
- package/dist/routes/public/public-plan-catalog.js +63 -0
- package/dist/routes/public/public-plan-catalog.js.map +1 -0
- package/dist/routes/public/register.d.ts +13 -0
- package/dist/routes/public/register.js +88 -4
- package/dist/routes/public/register.js.map +1 -1
- package/dist/routes/tenant/billing-pay-invoice.d.ts +13 -0
- package/dist/routes/tenant/billing-pay-invoice.js +82 -0
- package/dist/routes/tenant/billing-pay-invoice.js.map +1 -0
- package/dist/routes/tenant/billing-portal.d.ts +8 -3
- package/dist/routes/tenant/billing-portal.js +34 -16
- package/dist/routes/tenant/billing-portal.js.map +1 -1
- package/dist/routes/tenant/billing-self-refund.d.ts +26 -1
- package/dist/routes/tenant/billing-self-refund.js +95 -46
- package/dist/routes/tenant/billing-self-refund.js.map +1 -1
- package/dist/routes/tenant/complimentary-banner.d.ts +12 -0
- package/dist/routes/tenant/complimentary-banner.js +64 -0
- package/dist/routes/tenant/complimentary-banner.js.map +1 -0
- package/dist/routes/tenant/data-export.js +14 -0
- package/dist/routes/tenant/data-export.js.map +1 -1
- package/dist/routes/tenant/index.d.ts +7 -0
- package/dist/routes/tenant/index.js +7 -0
- package/dist/routes/tenant/index.js.map +1 -1
- package/dist/routes/tenant/tenant-billing.d.ts +1 -0
- package/dist/routes/tenant/tenant-billing.js +18 -13
- package/dist/routes/tenant/tenant-billing.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-authentication.d.ts +13 -0
- package/dist/routes/tenant/tenant-plan-authentication.js +79 -0
- package/dist/routes/tenant/tenant-plan-authentication.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-cancellation.d.ts +12 -0
- package/dist/routes/tenant/tenant-plan-cancellation.js +87 -0
- package/dist/routes/tenant/tenant-plan-cancellation.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-checkout.d.ts +3 -0
- package/dist/routes/tenant/tenant-plan-checkout.js +21 -11
- package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-ops.d.ts +32 -2
- package/dist/routes/tenant/tenant-plan-ops.js +112 -39
- package/dist/routes/tenant/tenant-plan-ops.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-preview.d.ts +33 -0
- package/dist/routes/tenant/tenant-plan-preview.js +216 -0
- package/dist/routes/tenant/tenant-plan-preview.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-resubscription.d.ts +2 -0
- package/dist/routes/tenant/tenant-plan-resubscription.js +61 -0
- package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -0
- package/dist/routes/tenant/tenant-plan.d.ts +9 -4
- package/dist/routes/tenant/tenant-plan.js +124 -16
- package/dist/routes/tenant/tenant-plan.js.map +1 -1
- package/dist/routes/tenant/tenant-seats.d.ts +6 -1
- package/dist/routes/tenant/tenant-seats.js +26 -5
- package/dist/routes/tenant/tenant-seats.js.map +1 -1
- package/dist/routes/tenant/tenant-upcoming-invoice.d.ts +26 -0
- package/dist/routes/tenant/tenant-upcoming-invoice.js +200 -0
- package/dist/routes/tenant/tenant-upcoming-invoice.js.map +1 -0
- package/dist/routes/tenant/workspace-access.d.ts +67 -0
- package/dist/routes/tenant/workspace-access.js +224 -0
- package/dist/routes/tenant/workspace-access.js.map +1 -0
- package/dist/routes/tenant/workspaces.d.ts +12 -43
- package/dist/routes/tenant/workspaces.js +82 -192
- package/dist/routes/tenant/workspaces.js.map +1 -1
- package/dist/segments/index.d.ts +29 -0
- package/dist/segments/index.js +116 -0
- package/dist/segments/index.js.map +1 -0
- package/dist/stripe/client.d.ts +1 -0
- package/dist/stripe/client.js +11 -0
- package/dist/stripe/client.js.map +1 -1
- package/dist/stripe/customer-locale.d.ts +3 -0
- package/dist/stripe/customer-locale.js +36 -0
- package/dist/stripe/customer-locale.js.map +1 -0
- package/dist/stripe/dashboard-links.d.ts +2 -0
- package/dist/stripe/dashboard-links.js +8 -0
- package/dist/stripe/dashboard-links.js.map +1 -0
- package/dist/stripe/index.d.ts +3 -0
- package/dist/stripe/index.js +3 -0
- package/dist/stripe/index.js.map +1 -1
- package/dist/stripe/pending-update.d.ts +5 -0
- package/dist/stripe/pending-update.js +56 -0
- package/dist/stripe/pending-update.js.map +1 -0
- package/dist/stripe/plan-schedule.js +4 -1
- package/dist/stripe/plan-schedule.js.map +1 -1
- package/dist/stripe/subscription-cancellation.d.ts +3 -0
- package/dist/stripe/subscription-cancellation.js +26 -0
- package/dist/stripe/subscription-cancellation.js.map +1 -0
- package/dist/stripe/sync-plan.js +5 -6
- package/dist/stripe/sync-plan.js.map +1 -1
- package/dist/stripe/upcoming-invoice.d.ts +9 -0
- package/dist/stripe/upcoming-invoice.js +19 -3
- package/dist/stripe/upcoming-invoice.js.map +1 -1
- package/dist/stripe/webhook-checkout.js +2 -0
- package/dist/stripe/webhook-checkout.js.map +1 -1
- package/dist/stripe/webhook-credit-notes.js +15 -0
- package/dist/stripe/webhook-credit-notes.js.map +1 -1
- package/dist/stripe/webhook-dispatch.js +2 -0
- package/dist/stripe/webhook-dispatch.js.map +1 -1
- package/dist/stripe/webhook-handlers.d.ts +1 -0
- package/dist/stripe/webhook-handlers.js +34 -9
- package/dist/stripe/webhook-handlers.js.map +1 -1
- package/dist/stripe/webhook-shared.d.ts +3 -1
- package/dist/stripe/webhook-shared.js +20 -1
- package/dist/stripe/webhook-shared.js.map +1 -1
- package/dist/stripe/workspace-checkout.d.ts +2 -0
- package/dist/stripe/workspace-checkout.js +4 -0
- package/dist/stripe/workspace-checkout.js.map +1 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/config.js.map +1 -1
- package/dist/upcoming-invoice/mapping.js +1 -0
- package/dist/upcoming-invoice/mapping.js.map +1 -1
- package/dist/users/index.d.ts +4 -0
- package/dist/users/index.js +21 -0
- package/dist/users/index.js.map +1 -0
- package/dist/users/platform-role.d.ts +18 -0
- package/dist/users/platform-role.js +127 -0
- package/dist/users/platform-role.js.map +1 -0
- package/dist/users/user-detail.d.ts +43 -0
- package/dist/users/user-detail.js +100 -0
- package/dist/users/user-detail.js.map +1 -0
- package/dist/users/user-facts.d.ts +10 -0
- package/dist/users/user-facts.js +157 -0
- package/dist/users/user-facts.js.map +1 -0
- package/dist/users/user-segments.d.ts +10 -0
- package/dist/users/user-segments.js +32 -0
- package/dist/users/user-segments.js.map +1 -0
- package/dist/utils/billing-displays.d.ts +6 -0
- package/dist/utils/billing-displays.js +17 -0
- package/dist/utils/billing-displays.js.map +1 -0
- package/dist/utils/billing-document-status.d.ts +0 -4
- package/dist/utils/billing-document-status.js +1 -13
- package/dist/utils/billing-document-status.js.map +1 -1
- package/dist/utils/billing-document-type.d.ts +6 -0
- package/dist/utils/billing-document-type.js +13 -0
- package/dist/utils/billing-document-type.js.map +1 -1
- package/dist/utils/csv-file.d.ts +2 -0
- package/dist/utils/csv-file.js +23 -0
- package/dist/utils/csv-file.js.map +1 -0
- package/dist/utils/form-insight-type.d.ts +8 -0
- package/dist/utils/form-insight-type.js +34 -0
- package/dist/utils/form-insight-type.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/language.d.ts +1 -0
- package/dist/utils/language.js +7 -0
- package/dist/utils/language.js.map +1 -0
- package/dist/utils/money.d.ts +2 -0
- package/dist/utils/money.js +24 -0
- package/dist/utils/money.js.map +1 -0
- package/dist/utils/segment-evaluator.d.ts +4 -0
- package/dist/utils/segment-evaluator.js +15 -8
- package/dist/utils/segment-evaluator.js.map +1 -1
- package/dist/utils/segment-explain.d.ts +10 -0
- package/dist/utils/segment-explain.js +31 -0
- package/dist/utils/segment-explain.js.map +1 -0
- package/dist/utils/segment-fields.d.ts +13 -2
- package/dist/utils/segment-fields.js +137 -116
- package/dist/utils/segment-fields.js.map +1 -1
- package/dist/utils/segment-matching.d.ts +14 -3
- package/dist/utils/segment-matching.js +47 -13
- package/dist/utils/segment-matching.js.map +1 -1
- package/dist/utils/segment-preview.d.ts +31 -0
- package/dist/utils/segment-preview.js +83 -0
- package/dist/utils/segment-preview.js.map +1 -0
- package/dist/utils/segment-user-projection.d.ts +3 -0
- package/dist/utils/segment-user-projection.js +31 -0
- package/dist/utils/segment-user-projection.js.map +1 -0
- package/dist/utils/segment-validation.d.ts +14 -0
- package/dist/utils/segment-validation.js +98 -0
- package/dist/utils/segment-validation.js.map +1 -0
- package/dist/utils/status-vocabulary.d.ts +57 -0
- package/dist/utils/status-vocabulary.js +92 -0
- package/dist/utils/status-vocabulary.js.map +1 -0
- package/dist/workers/index.d.ts +1 -0
- package/dist/workers/index.js +1 -0
- package/dist/workers/index.js.map +1 -1
- package/dist/workers/plan-migration-resolution.d.ts +14 -0
- package/dist/workers/plan-migration-resolution.js +99 -0
- package/dist/workers/plan-migration-resolution.js.map +1 -0
- package/dist/workers/plan-migration.d.ts +6 -1
- package/dist/workers/plan-migration.js +152 -37
- package/dist/workers/plan-migration.js.map +1 -1
- package/dist/workspaces/billing-identity-lock.d.ts +1 -0
- package/dist/workspaces/billing-identity-lock.js +18 -0
- package/dist/workspaces/billing-identity-lock.js.map +1 -0
- package/dist/workspaces/complimentary-banner.d.ts +11 -0
- package/dist/workspaces/complimentary-banner.js +83 -0
- package/dist/workspaces/complimentary-banner.js.map +1 -0
- package/dist/workspaces/default-member-role.d.ts +2 -0
- package/dist/workspaces/default-member-role.js +43 -0
- package/dist/workspaces/default-member-role.js.map +1 -0
- package/dist/workspaces/deletion-request.d.ts +2 -0
- package/dist/workspaces/deletion-request.js +5 -0
- package/dist/workspaces/deletion-request.js.map +1 -0
- package/dist/workspaces/deletion.d.ts +1 -1
- package/dist/workspaces/deletion.js +19 -7
- package/dist/workspaces/deletion.js.map +1 -1
- package/dist/workspaces/detail-items.d.ts +15 -0
- package/dist/workspaces/detail-items.js +226 -0
- package/dist/workspaces/detail-items.js.map +1 -0
- package/dist/workspaces/first-payment.d.ts +5 -0
- package/dist/workspaces/first-payment.js +28 -0
- package/dist/workspaces/first-payment.js.map +1 -0
- package/dist/workspaces/free-workspaces-per-card.d.ts +6 -0
- package/dist/workspaces/free-workspaces-per-card.js +58 -0
- package/dist/workspaces/free-workspaces-per-card.js.map +1 -0
- package/dist/workspaces/index.d.ts +7 -0
- package/dist/workspaces/index.js +7 -0
- package/dist/workspaces/index.js.map +1 -1
- package/dist/workspaces/invitations.d.ts +2 -1
- package/dist/workspaces/invitations.js +16 -6
- package/dist/workspaces/invitations.js.map +1 -1
- package/dist/workspaces/my-workspaces.d.ts +13 -0
- package/dist/workspaces/my-workspaces.js +68 -0
- package/dist/workspaces/my-workspaces.js.map +1 -0
- package/dist/workspaces/operator-creation.d.ts +39 -0
- package/dist/workspaces/operator-creation.js +123 -0
- package/dist/workspaces/operator-creation.js.map +1 -0
- package/dist/workspaces/operator-view.d.ts +13 -0
- package/dist/workspaces/operator-view.js +37 -0
- package/dist/workspaces/operator-view.js.map +1 -0
- package/dist/workspaces/owner-contact.d.ts +7 -0
- package/dist/workspaces/owner-contact.js +24 -0
- package/dist/workspaces/owner-contact.js.map +1 -0
- package/dist/workspaces/owner-invitation-email.d.ts +12 -0
- package/dist/workspaces/owner-invitation-email.js +53 -0
- package/dist/workspaces/owner-invitation-email.js.map +1 -0
- package/dist/workspaces/provisioning.d.ts +2 -0
- package/dist/workspaces/provisioning.js +37 -15
- package/dist/workspaces/provisioning.js.map +1 -1
- package/dist/workspaces/self-serve-creation.d.ts +38 -0
- package/dist/workspaces/self-serve-creation.js +106 -0
- package/dist/workspaces/self-serve-creation.js.map +1 -0
- package/dist/workspaces/workspace-glance.d.ts +3 -0
- package/dist/workspaces/workspace-glance.js +93 -0
- package/dist/workspaces/workspace-glance.js.map +1 -0
- package/dist/workspaces/workspace-name.d.ts +2 -0
- package/dist/workspaces/workspace-name.js +14 -0
- package/dist/workspaces/workspace-name.js.map +1 -0
- package/dist/workspaces/workspace-overview.d.ts +41 -0
- package/dist/workspaces/workspace-overview.js +84 -0
- package/dist/workspaces/workspace-overview.js.map +1 -0
- package/dist/workspaces/workspace-owner.d.ts +7 -0
- package/dist/workspaces/workspace-owner.js +14 -0
- package/dist/workspaces/workspace-owner.js.map +1 -0
- package/frontend-vue/app/build/PayInvoiceDialog.vue +40 -0
- package/frontend-vue/app/build/PayInvoicePanel.vue +203 -0
- package/frontend-vue/app/build/PlanChangeReview.vue +415 -0
- package/frontend-vue/app/build/PlanFeatureValueInput.vue +143 -0
- package/frontend-vue/app/build/PlanPermissionPicker.vue +246 -0
- package/frontend-vue/app/build/WorkspaceSwitcherRow.vue +116 -0
- package/frontend-vue/app/build/components/CreditNoteInvoiceSummary.vue +82 -0
- package/frontend-vue/app/build/components/FormFieldRow.vue +97 -0
- package/frontend-vue/app/build/components/FormRows.vue +26 -0
- package/frontend-vue/app/build/components/RequiredLegend.vue +7 -0
- package/frontend-vue/app/build/composables/useCreditNoteDraft.ts +142 -0
- package/frontend-vue/app/build/composables/useCreditNoteTexts.ts +123 -0
- package/frontend-vue/app/build/composables/useLiveFormValues.ts +49 -0
- package/frontend-vue/app/build/day-formats.ts +17 -0
- package/frontend-vue/app/build/highlight.ts +28 -0
- package/frontend-vue/app/build/plan-catalog.ts +161 -0
- package/frontend-vue/app/build/plan-change-heading.ts +81 -0
- package/frontend-vue/app/build/plan-permissions.ts +92 -0
- package/frontend-vue/app/build/plan-retire.ts +83 -0
- package/frontend-vue/app/build/public/AccessTimeline.vue +68 -0
- package/frontend-vue/app/build/public/LegalAcceptance.vue +51 -0
- package/frontend-vue/app/build/public/OtherWorkspaces.vue +88 -0
- package/frontend-vue/app/build/public/PricingComparison.vue +227 -0
- package/frontend-vue/app/build/public/PricingFaq.vue +76 -0
- package/frontend-vue/app/build/public/PublicStage.vue +72 -0
- package/frontend-vue/app/build/public/RegistrationCardField.vue +74 -0
- package/frontend-vue/app/build/public/RegistrationPlanCard.vue +122 -0
- package/frontend-vue/app/build/public/access.ts +118 -0
- package/frontend-vue/app/build/public/chosen-plan.ts +36 -0
- package/frontend-vue/app/build/public/legal.ts +99 -0
- package/frontend-vue/app/build/public/pricing.ts +175 -0
- package/frontend-vue/app/build/public/routes.ts +122 -0
- package/frontend-vue/app/build/public/usePublicFetch.ts +44 -0
- package/frontend-vue/app/build/public/usePublicPlanFormat.ts +52 -0
- package/frontend-vue/app/build/segments/tree.ts +137 -0
- package/frontend-vue/app/build/segments/types.ts +119 -0
- package/frontend-vue/app/build/segments/useSegmentCatalog.ts +58 -0
- package/frontend-vue/app/build/segments/useSegmentDraft.ts +33 -0
- package/frontend-vue/app/build/segments/useSegmentPreview.ts +78 -0
- package/frontend-vue/app/build/segments/useSegmentSentence.ts +60 -0
- package/frontend-vue/app/build/segments/useSegmentWords.ts +204 -0
- package/frontend-vue/app/build/useWorkspaceName.ts +14 -0
- package/frontend-vue/app/build/users/useUserDetail.ts +82 -0
- package/frontend-vue/app/build/workspace-detail/ComplimentaryDialog.vue +219 -0
- package/frontend-vue/app/build/workspace-detail/CreditDialog.vue +243 -0
- package/frontend-vue/app/build/workspace-detail/UpgradeDialog.vue +258 -0
- package/frontend-vue/app/build/workspace-detail/WorkspaceActionDialogs.vue +82 -0
- package/frontend-vue/app/build/workspace-detail/planPrice.ts +26 -0
- package/frontend-vue/app/build/workspace-detail/types.ts +138 -0
- package/frontend-vue/app/build/workspace-detail/useWorkspaceActions.ts +177 -0
- package/frontend-vue/app/build/workspace-detail/useWorkspaceOverview.ts +44 -0
- package/frontend-vue/app/build/workspace-paths.ts +8 -0
- package/frontend-vue/app/components/BillingIdentityFields.vue +294 -161
- package/frontend-vue/app/components/CustomerPortalButton.vue +80 -32
- package/frontend-vue/app/components/DataExport.vue +250 -260
- package/frontend-vue/app/components/DataExportHistory.vue +246 -0
- package/frontend-vue/app/components/DunningTimeline.vue +120 -0
- package/frontend-vue/app/components/IssueCreditNoteModal.vue +318 -116
- package/frontend-vue/app/components/LegalDocumentRelease.vue +64 -0
- package/frontend-vue/app/components/LegalLayout.vue +284 -46
- package/frontend-vue/app/components/MigrationStripeCheck.vue +133 -0
- package/frontend-vue/app/components/PastDueAlert.vue +186 -78
- package/frontend-vue/app/components/PastDueBanner.vue +96 -67
- package/frontend-vue/app/components/PayInvoiceModal.vue +57 -0
- package/frontend-vue/app/components/PaymentMethodCard.vue +159 -163
- package/frontend-vue/app/components/PendingCheckoutModal.vue +61 -61
- package/frontend-vue/app/components/PlanAccessEditor.vue +410 -0
- package/frontend-vue/app/components/PlanCard.vue +358 -261
- package/frontend-vue/app/components/PlanCardPublic.vue +123 -51
- package/frontend-vue/app/components/PlanComparisonModal.vue +373 -309
- package/frontend-vue/app/components/PlanEditorPreview.vue +374 -0
- package/frontend-vue/app/components/PlanLimitInput.vue +92 -0
- package/frontend-vue/app/components/PlanTaxSync.vue +118 -0
- package/frontend-vue/app/components/PlanUpgradeModal.vue +265 -156
- package/frontend-vue/app/components/PlatformNotes.vue +215 -255
- package/frontend-vue/app/components/Pricing.vue +236 -0
- package/frontend-vue/app/components/PublicNavBar.vue +70 -0
- package/frontend-vue/app/components/RefundButton.vue +265 -113
- package/frontend-vue/app/components/RefundExample.vue +86 -0
- package/frontend-vue/app/components/Register.vue +217 -121
- package/frontend-vue/app/components/RegistrationClosed.vue +30 -13
- package/frontend-vue/app/components/RetirePlanModal.vue +829 -0
- package/frontend-vue/app/components/SeatQuotaBanner.vue +240 -90
- package/frontend-vue/app/components/SegmentConditionRow.vue +171 -0
- package/frontend-vue/app/components/SegmentConditionsBuilder.vue +89 -162
- package/frontend-vue/app/components/SegmentConditionsGroup.vue +273 -463
- package/frontend-vue/app/components/SegmentLivePreview.vue +301 -0
- package/frontend-vue/app/components/SegmentLogicToggle.vue +24 -0
- package/frontend-vue/app/components/SegmentRulesText.vue +57 -0
- package/frontend-vue/app/components/SegmentValueInput.vue +165 -0
- package/frontend-vue/app/components/SegmentWords.vue +36 -0
- package/frontend-vue/app/components/TenantBillingForm.vue +142 -103
- package/frontend-vue/app/components/TenantPlanCard.vue +635 -280
- package/frontend-vue/app/components/TrialEndingBanner.vue +76 -0
- package/frontend-vue/app/components/UserPlatformRoleCard.vue +102 -0
- package/frontend-vue/app/components/UserSegmentMatches.vue +123 -0
- package/frontend-vue/app/components/UserSummaryCard.vue +107 -158
- package/frontend-vue/app/components/WorkspaceAdminCreateModal.vue +354 -177
- package/frontend-vue/app/components/WorkspaceCreateModal.vue +372 -252
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +178 -126
- package/frontend-vue/app/components/WorkspaceDetailHeader.vue +262 -19
- package/frontend-vue/app/components/WorkspaceInvitationLink.vue +108 -86
- package/frontend-vue/app/components/WorkspaceOperatorActions.vue +105 -330
- package/frontend-vue/app/components/WorkspaceSuspendButton.vue +34 -158
- package/frontend-vue/app/components/WorkspaceSuspended.vue +390 -149
- package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +145 -161
- package/frontend-vue/app/composables/useBillingIdentity.ts +97 -95
- package/frontend-vue/app/composables/useBillingStatus.ts +56 -24
- package/frontend-vue/app/composables/useCurrentWorkspace.ts +15 -30
- package/frontend-vue/app/composables/useDaysLeft.ts +20 -0
- package/frontend-vue/app/composables/useExportHistory.ts +209 -120
- package/frontend-vue/app/composables/useInvitationLink.ts +39 -53
- package/frontend-vue/app/composables/useMoneyFormat.ts +64 -33
- package/frontend-vue/app/composables/useMyWorkspaces.ts +41 -32
- package/frontend-vue/app/composables/useNextInvoice.ts +20 -0
- package/frontend-vue/app/composables/usePayInvoice.ts +52 -0
- package/frontend-vue/app/composables/usePendingCheckout.ts +71 -67
- package/frontend-vue/app/composables/usePlanCatalog.ts +16 -0
- package/frontend-vue/app/composables/usePlanChangeReview.ts +115 -0
- package/frontend-vue/app/composables/usePlanComparison.ts +17 -8
- package/frontend-vue/app/composables/usePlanDowngrade.ts +25 -23
- package/frontend-vue/app/composables/usePlanFeatureFormat.ts +238 -202
- package/frontend-vue/app/composables/usePlanPriceLabel.ts +28 -0
- package/frontend-vue/app/composables/useSaasRegistration.ts +516 -301
- package/frontend-vue/app/composables/useSaasStatus.ts +81 -0
- package/frontend-vue/app/composables/useSeatQuota.ts +27 -17
- package/frontend-vue/app/composables/useServerConfirm.ts +44 -0
- package/frontend-vue/app/composables/useStripePaymentElement.ts +3 -5
- package/frontend-vue/app/composables/useTenantPlan.ts +235 -99
- package/frontend-vue/app/composables/useUpgradeAuthentication.ts +37 -0
- package/frontend-vue/app/composables/useWorkspaceFinalization.ts +4 -0
- package/frontend-vue/app/composables/useWorkspaceOverview.ts +58 -0
- package/frontend-vue/app/composables/useWorkspaceRenamed.ts +33 -0
- package/frontend-vue/app/custom-pages/auth/no-workspace.vue +391 -312
- package/frontend-vue/app/plugins/auth-links.ts +38 -17
- package/frontend-vue/app/plugins/billing-data-types.ts +111 -58
- package/frontend-vue/app/plugins/footer-links.ts +13 -33
- package/frontend-vue/app/plugins/segment-conditions-data-type.ts +45 -0
- package/frontend-vue/app/plugins/sidebar-widgets.ts +13 -10
- package/frontend-vue/app/types/runtime-config.ts +9 -4
- package/frontend-vue/dms.frontend.build.ts +7 -0
- package/frontend-vue/dms.frontend.ts +6 -13
- package/frontend-vue/i18n/locales/saas-en-GB.json +499 -1380
- package/frontend-vue/i18n/locales/saas-fr-FR.json +499 -1380
- package/frontend-vue/i18n/locales/saas-operator-billing-en-GB.json +282 -0
- package/frontend-vue/i18n/locales/saas-operator-billing-fr-FR.json +282 -0
- package/frontend-vue/i18n/locales/saas-operator-catalog-en-GB.json +597 -0
- package/frontend-vue/i18n/locales/saas-operator-catalog-fr-FR.json +597 -0
- package/frontend-vue/i18n/locales/saas-operator-users-en-GB.json +505 -0
- package/frontend-vue/i18n/locales/saas-operator-users-fr-FR.json +505 -0
- package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +595 -0
- package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +595 -0
- package/frontend-vue/i18n/locales/saas-public-en-GB.json +305 -0
- package/frontend-vue/i18n/locales/saas-public-fr-FR.json +305 -0
- package/frontend-vue/i18n/locales/saas-tenant-billing-en-GB.json +434 -0
- package/frontend-vue/i18n/locales/saas-tenant-billing-fr-FR.json +434 -0
- package/frontend-vue/i18n/locales/saas-tenant-workspace-en-GB.json +252 -0
- package/frontend-vue/i18n/locales/saas-tenant-workspace-fr-FR.json +252 -0
- package/frontend-vue/package.json +1 -1
- package/package.json +10 -10
- package/frontend-vue/app/components/CardGrid.vue +0 -77
- package/frontend-vue/app/components/DeletePlanModal.vue +0 -223
- package/frontend-vue/app/components/FreeAccessBanner.vue +0 -70
- package/frontend-vue/app/components/PlanCardsDisplay.vue +0 -127
- package/frontend-vue/app/components/PlanInheritancePicker.vue +0 -329
- package/frontend-vue/app/components/RecentActivity.vue +0 -72
- package/frontend-vue/app/components/WorkspaceBillingInfo.vue +0 -68
- package/frontend-vue/app/components/WorkspaceCompAccessButton.vue +0 -198
- package/frontend-vue/app/components/WorkspaceIdentity.vue +0 -99
- package/frontend-vue/app/components/WorkspaceJoinButton.vue +0 -50
- package/frontend-vue/app/components/WorkspaceSummaryCard.vue +0 -185
- package/frontend-vue/app/composables/useDetailRefresh.ts +0 -17
- package/frontend-vue/app/composables/usePastDueBannerAction.ts +0 -20
- package/frontend-vue/app/plugins/plan-cards-display.ts +0 -16
- package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +0 -122
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SaasTenantPlanAuthenticationController = void 0;
|
|
16
|
+
exports.confirmOwnerUpgrade = confirmOwnerUpgrade;
|
|
17
|
+
const promises_1 = require("node:timers/promises");
|
|
18
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
19
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
20
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
21
|
+
const guards_1 = require("@antelopejs/interface-dms/guards");
|
|
22
|
+
const request_tenant_1 = require("@antelopejs/interface-dms/request-tenant");
|
|
23
|
+
const tenant_scoped_model_1 = require("@antelopejs/interface-dms/tenant-scoped-model");
|
|
24
|
+
const db_1 = require("../../db");
|
|
25
|
+
const client_1 = require("../../stripe/client");
|
|
26
|
+
const pending_update_1 = require("../../stripe/pending-update");
|
|
27
|
+
const applied_upgrade_1 = require("../../plan-changes/applied-upgrade");
|
|
28
|
+
const tenant_plan_ops_1 = require("./tenant-plan-ops");
|
|
29
|
+
const HTTP_PAYMENT_REQUIRED = 402;
|
|
30
|
+
const SETTLE_POLL_ATTEMPTS = 6;
|
|
31
|
+
const SETTLE_POLL_INTERVAL_MS = 500;
|
|
32
|
+
async function waitForAppliedUpdate(stripeSubscriptionId) {
|
|
33
|
+
for (let attempt = 0; attempt < SETTLE_POLL_ATTEMPTS; attempt += 1) {
|
|
34
|
+
await (0, promises_1.setTimeout)(SETTLE_POLL_INTERVAL_MS);
|
|
35
|
+
const current = await (0, client_1.getStripeClient)().subscriptions.retrieve(stripeSubscriptionId);
|
|
36
|
+
if (!current.pending_update)
|
|
37
|
+
return current;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
async function settlePendingUpgrade(stripeSubscription) {
|
|
42
|
+
if (!stripeSubscription.pending_update)
|
|
43
|
+
return stripeSubscription;
|
|
44
|
+
if (await (0, pending_update_1.isPendingPaymentTaken)(stripeSubscription)) {
|
|
45
|
+
return waitForAppliedUpdate(stripeSubscription.id);
|
|
46
|
+
}
|
|
47
|
+
await (0, pending_update_1.discardPendingUpdate)(stripeSubscription);
|
|
48
|
+
throw new interface_api_1.HTTPResult(HTTP_PAYMENT_REQUIRED, "saas.errors.plan.upgrade_authentication_failed");
|
|
49
|
+
}
|
|
50
|
+
async function confirmOwnerUpgrade(tenantId, subscription, plan, model) {
|
|
51
|
+
const applied = { ...tenant_plan_ops_1.UNCHANGED_RESULT_BASE, changed: true, planId: plan._id };
|
|
52
|
+
(0, interface_api_util_1.assert)(subscription?.stripeSubscriptionId, tenant_plan_ops_1.HTTP_BAD_REQUEST, "saas.errors.workspace.no_active_subscription");
|
|
53
|
+
if (subscription.planId === plan._id)
|
|
54
|
+
return applied;
|
|
55
|
+
const settled = await settlePendingUpgrade(await (0, client_1.getStripeClient)().subscriptions.retrieve(subscription.stripeSubscriptionId));
|
|
56
|
+
if (!settled)
|
|
57
|
+
return applied;
|
|
58
|
+
(0, interface_api_util_1.assert)((0, applied_upgrade_1.billedPriceId)(settled) === plan.paymentProviderRefs?.stripePriceId, tenant_plan_ops_1.HTTP_CONFLICT, "saas.errors.plan.upgrade_not_applied");
|
|
59
|
+
await (0, applied_upgrade_1.recordUnlessAlreadyApplied)(tenantId, subscription, plan, model);
|
|
60
|
+
return applied;
|
|
61
|
+
}
|
|
62
|
+
class SaasTenantPlanAuthenticationController extends (0, interface_api_1.Controller)("/api/saas/tenant/plan/authentication") {
|
|
63
|
+
async confirmUpgrade(_user, body, ctx, tenantSubscriptionModel) {
|
|
64
|
+
const plan = await (0, tenant_plan_ops_1.loadSellablePlan)((0, interface_database_decorators_1.GetModel)(db_1.PlanModel), body.planId);
|
|
65
|
+
return confirmOwnerUpgrade((0, request_tenant_1.getRequestTenantId)(ctx), await tenantSubscriptionModel.findOne(), plan, tenantSubscriptionModel);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.SaasTenantPlanAuthenticationController = SaasTenantPlanAuthenticationController;
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, interface_api_1.Post)("/"),
|
|
71
|
+
__param(0, (0, guards_1.AuthTenantOwner)({ bypassTenantAccessGate: true })),
|
|
72
|
+
__param(1, (0, interface_api_1.JSONBody)()),
|
|
73
|
+
__param(2, (0, interface_api_1.Context)()),
|
|
74
|
+
__param(3, (0, tenant_scoped_model_1.TenantScopedModel)(db_1.TenantSubscriptionModel)),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [Function, Object, Object, db_1.TenantSubscriptionModel]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], SaasTenantPlanAuthenticationController.prototype, "confirmUpgrade", null);
|
|
79
|
+
//# sourceMappingURL=tenant-plan-authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-plan-authentication.js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A,wBAAe,EAAC,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAA;IACjD,WAAA,IAAA,wBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,uBAAO,GAAE,CAAA;IACT,WAAA,IAAA,uCAAiB,EAAC,4BAAuB,CAAC,CAAA;;+DAClB,4BAAuB;;4EASjD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RequestContext } from "@antelopejs/interface-api";
|
|
2
|
+
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
import { TenantSubscriptionModel } from "../../db";
|
|
4
|
+
export interface CancellationResult {
|
|
5
|
+
cancelAt: Date | null;
|
|
6
|
+
}
|
|
7
|
+
declare const SaasTenantPlanCancellationController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
8
|
+
export declare class SaasTenantPlanCancellationController extends SaasTenantPlanCancellationController_base {
|
|
9
|
+
cancelAtPeriodEnd(_user: User, ctx: RequestContext, tenantSubscriptionModel: TenantSubscriptionModel): Promise<CancellationResult>;
|
|
10
|
+
keepSubscription(_user: User, ctx: RequestContext, tenantSubscriptionModel: TenantSubscriptionModel): Promise<CancellationResult>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SaasTenantPlanCancellationController = void 0;
|
|
16
|
+
const node_crypto_1 = require("node:crypto");
|
|
17
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
18
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
19
|
+
const guards_1 = require("@antelopejs/interface-dms/guards");
|
|
20
|
+
const request_tenant_1 = require("@antelopejs/interface-dms/request-tenant");
|
|
21
|
+
const tenant_scoped_model_1 = require("@antelopejs/interface-dms/tenant-scoped-model");
|
|
22
|
+
const billing_state_1 = require("../../billing-state");
|
|
23
|
+
const db_1 = require("../../db");
|
|
24
|
+
const plan_changes_1 = require("../../plan-changes");
|
|
25
|
+
const plan_schedule_1 = require("../../stripe/plan-schedule");
|
|
26
|
+
const complimentary_1 = require("../../workspaces/complimentary");
|
|
27
|
+
const tenant_plan_ops_1 = require("./tenant-plan-ops");
|
|
28
|
+
const CANCEL_KIND = "cancel";
|
|
29
|
+
function assertStripeBilled(subscription) {
|
|
30
|
+
(0, interface_api_util_1.assert)(subscription?.stripeSubscriptionId &&
|
|
31
|
+
!(0, complimentary_1.isComplimentarySubscription)(subscription), tenant_plan_ops_1.HTTP_BAD_REQUEST, "saas.errors.workspace.no_active_subscription");
|
|
32
|
+
}
|
|
33
|
+
function assertNothingUnpaid(subscription) {
|
|
34
|
+
(0, interface_api_util_1.assert)(subscription.status !== tenant_plan_ops_1.PAST_DUE_STATUS, tenant_plan_ops_1.HTTP_CONFLICT, "saas.errors.plan.unpaid_invoice_blocks_cancellation");
|
|
35
|
+
}
|
|
36
|
+
function cancelIntent() {
|
|
37
|
+
return {
|
|
38
|
+
operationId: (0, node_crypto_1.randomUUID)(),
|
|
39
|
+
kind: CANCEL_KIND,
|
|
40
|
+
targetPlanId: null,
|
|
41
|
+
requestedAt: new Date(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async function writeCancellation(tenantId, subscription, model, shouldCancel) {
|
|
45
|
+
const intent = cancelIntent();
|
|
46
|
+
await model.beginTransition(subscription, intent);
|
|
47
|
+
await (0, plan_changes_1.clearPendingPlanChange)(tenantId, subscription, intent.operationId);
|
|
48
|
+
const periodEnd = await (0, plan_schedule_1.setSubscriptionCancelAtPeriodEnd)(subscription.stripeSubscriptionId, shouldCancel);
|
|
49
|
+
await model.completeTransition(subscription._id, intent.operationId, {
|
|
50
|
+
updatedAt: new Date(),
|
|
51
|
+
});
|
|
52
|
+
await (0, billing_state_1.recomputeTenantBillingState)(tenantId);
|
|
53
|
+
return { cancelAt: shouldCancel ? periodEnd : null };
|
|
54
|
+
}
|
|
55
|
+
class SaasTenantPlanCancellationController extends (0, interface_api_1.Controller)("/api/saas/tenant/plan/cancellation") {
|
|
56
|
+
async cancelAtPeriodEnd(_user, ctx, tenantSubscriptionModel) {
|
|
57
|
+
const subscription = await tenantSubscriptionModel.findOne();
|
|
58
|
+
assertStripeBilled(subscription);
|
|
59
|
+
assertNothingUnpaid(subscription);
|
|
60
|
+
return writeCancellation((0, request_tenant_1.getRequestTenantId)(ctx), subscription, tenantSubscriptionModel, true);
|
|
61
|
+
}
|
|
62
|
+
async keepSubscription(_user, ctx, tenantSubscriptionModel) {
|
|
63
|
+
const subscription = await tenantSubscriptionModel.findOne();
|
|
64
|
+
assertStripeBilled(subscription);
|
|
65
|
+
return writeCancellation((0, request_tenant_1.getRequestTenantId)(ctx), subscription, tenantSubscriptionModel, false);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.SaasTenantPlanCancellationController = SaasTenantPlanCancellationController;
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, interface_api_1.Post)("/"),
|
|
71
|
+
__param(0, (0, guards_1.AuthTenantOwner)()),
|
|
72
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
73
|
+
__param(2, (0, tenant_scoped_model_1.TenantScopedModel)(db_1.TenantSubscriptionModel)),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [Function, Object, db_1.TenantSubscriptionModel]),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], SaasTenantPlanCancellationController.prototype, "cancelAtPeriodEnd", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, interface_api_1.Delete)("/"),
|
|
80
|
+
__param(0, (0, guards_1.AuthTenantOwner)()),
|
|
81
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
82
|
+
__param(2, (0, tenant_scoped_model_1.TenantScopedModel)(db_1.TenantSubscriptionModel)),
|
|
83
|
+
__metadata("design:type", Function),
|
|
84
|
+
__metadata("design:paramtypes", [Function, Object, db_1.TenantSubscriptionModel]),
|
|
85
|
+
__metadata("design:returntype", Promise)
|
|
86
|
+
], SaasTenantPlanCancellationController.prototype, "keepSubscription", null);
|
|
87
|
+
//# sourceMappingURL=tenant-plan-cancellation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-plan-cancellation.js","sourceRoot":"","sources":["../../../src/routes/tenant/tenant-plan-cancellation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAKA,6CAAyC;AACzC,6DAMmC;AACnC,uEAAwD;AACxD,6DAAmE;AACnE,6EAA8E;AAC9E,uFAAkF;AAElF,uDAAkE;AAClE,iCAIkB;AAClB,qDAA4D;AAC5D,8DAA8E;AAC9E,kEAA6E;AAC7E,uDAI2B;AAE3B,MAAM,WAAW,GAAG,QAAiB,CAAC;AAatC,SAAS,kBAAkB,CACzB,YAA4C;IAE5C,IAAA,2BAAM,EACJ,YAAY,EAAE,oBAAoB;QAChC,CAAC,IAAA,2CAA2B,EAAC,YAAY,CAAC,EAC5C,kCAAgB,EAChB,8CAA8C,CAC/C,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AAC,CAAC;QACjC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAClC,OAAO,iBAAiB,CACtB,IAAA,mCAAkB,EAAC,GAAG,CAAC,EACvB,YAAY,EACZ,uBAAuB,EACvB,IAAI,CACL,CAAC;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACD,KAAW,EACnB,GAAmB,EAE9B,uBAAgD;QAEhD,MAAM,YAAY,GAAG,MAAM,uBAAuB,CAAC,OAAO,EAAE,CAAC;QAC7D,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACjC,OAAO,iBAAiB,CACtB,IAAA,mCAAkB,EAAC,GAAG,CAAC,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,CACN,CAAC;IACJ,CAAC;CACF;AAvCD,oFAuCC;AAlCO;IADL,IAAA,oBAAI,EAAC,GAAG,CAAC;IAEP,WAAA,IAAA,wBAAe,GAAE,CAAA;IACjB,WAAA,IAAA,uBAAO,GAAE,CAAA;IACT,WAAA,IAAA,uCAAiB,EAAC,4BAAuB,CAAC,CAAA;;uDAClB,4BAAuB;;6EAWjD;AAIK;IADL,IAAA,sBAAM,EAAC,GAAG,CAAC;IAET,WAAA,IAAA,wBAAe,GAAE,CAAA;IACjB,WAAA,IAAA,uBAAO,GAAE,CAAA;IACT,WAAA,IAAA,uCAAiB,EAAC,4BAAuB,CAAC,CAAA;;uDAClB,4BAAuB;;4EAUjD"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { type Plan, type TenantSubscription } from "../../db";
|
|
1
2
|
import { type ChangePlanResult, type PlanChangeRequest } from "./tenant-plan-ops";
|
|
3
|
+
export declare function isCheckoutTrialAvailable(plan: Plan, ownerEmail: string): Promise<boolean>;
|
|
4
|
+
export declare function isTrialOfferedOnChange(plan: Plan, subscription: TenantSubscription | undefined, ownerEmail: string): Promise<boolean>;
|
|
2
5
|
export declare function startPaidCheckout(request: PlanChangeRequest): Promise<ChangePlanResult>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCheckoutTrialAvailable = isCheckoutTrialAvailable;
|
|
4
|
+
exports.isTrialOfferedOnChange = isTrialOfferedOnChange;
|
|
3
5
|
exports.startPaidCheckout = startPaidCheckout;
|
|
4
6
|
const node_crypto_1 = require("node:crypto");
|
|
5
7
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
@@ -36,20 +38,26 @@ function validateCheckoutRedirectInput(body) {
|
|
|
36
38
|
(0, interface_api_util_1.assert)(cancelUrl && (0, config_1.isAllowedRedirectUrl)(cancelUrl), tenant_plan_ops_1.HTTP_BAD_REQUEST, "saas.errors.billing.invalid_return_url");
|
|
37
39
|
return { successUrl, cancelUrl };
|
|
38
40
|
}
|
|
41
|
+
async function isCheckoutTrialAvailable(plan, ownerEmail) {
|
|
42
|
+
if (!plan.trialDays || plan.trialDays <= 0)
|
|
43
|
+
return false;
|
|
44
|
+
const emailHash = (0, utils_1.hashEmail)(ownerEmail);
|
|
45
|
+
if (await (0, interface_database_decorators_1.GetModel)(db_1.TrialConsumptionModel).existsForIdentity(emailHash, null))
|
|
46
|
+
return false;
|
|
47
|
+
const identity = await (0, interface_database_decorators_1.GetModel)(trial_identity_model_1.TrialIdentityModel).get((0, trial_identity_model_1.trialIdentityId)("email", emailHash));
|
|
48
|
+
return !identity?.tenantId;
|
|
49
|
+
}
|
|
50
|
+
async function isTrialOfferedOnChange(plan, subscription, ownerEmail) {
|
|
51
|
+
if (!(0, tenant_plan_ops_1.startsPaidCheckout)(plan, subscription))
|
|
52
|
+
return false;
|
|
53
|
+
return isCheckoutTrialAvailable(plan, ownerEmail);
|
|
54
|
+
}
|
|
39
55
|
async function resolveCheckoutTrial(request) {
|
|
40
56
|
const { newPlan, user, tenantId } = request;
|
|
41
|
-
if (!newPlan
|
|
42
|
-
return NO_TRIAL;
|
|
43
|
-
const trialConsumptionModel = (0, interface_database_decorators_1.GetModel)(db_1.TrialConsumptionModel);
|
|
44
|
-
const emailHash = (0, utils_1.hashEmail)(user.email);
|
|
45
|
-
if (await trialConsumptionModel.existsForIdentity(emailHash, null)) {
|
|
46
|
-
return NO_TRIAL;
|
|
47
|
-
}
|
|
48
|
-
const identities = (0, interface_database_decorators_1.GetModel)(trial_identity_model_1.TrialIdentityModel);
|
|
49
|
-
const id = (0, trial_identity_model_1.trialIdentityId)("email", emailHash);
|
|
50
|
-
if ((await identities.get(id))?.tenantId)
|
|
57
|
+
if (!(await isCheckoutTrialAvailable(newPlan, user.email)))
|
|
51
58
|
return NO_TRIAL;
|
|
52
|
-
|
|
59
|
+
const id = (0, trial_identity_model_1.trialIdentityId)("email", (0, utils_1.hashEmail)(user.email));
|
|
60
|
+
if (!(await (0, interface_database_decorators_1.GetModel)(trial_identity_model_1.TrialIdentityModel).reserve(id, tenantId)))
|
|
53
61
|
return NO_TRIAL;
|
|
54
62
|
return { days: newPlan.trialDays, reservedIdentityId: id };
|
|
55
63
|
}
|
|
@@ -139,6 +147,7 @@ async function openCheckoutSession(request, attempt, target) {
|
|
|
139
147
|
operationId: attempt.operationId,
|
|
140
148
|
tenantId: request.tenantId,
|
|
141
149
|
ownerEmail: request.user.email,
|
|
150
|
+
ownerLanguage: request.user.language,
|
|
142
151
|
}));
|
|
143
152
|
if (!existingCustomerId)
|
|
144
153
|
attempt.createdCustomerId = customerId;
|
|
@@ -146,6 +155,7 @@ async function openCheckoutSession(request, attempt, target) {
|
|
|
146
155
|
operationId: attempt.operationId,
|
|
147
156
|
tenantId: request.tenantId,
|
|
148
157
|
ownerEmail: request.user.email,
|
|
158
|
+
ownerLanguage: request.user.language,
|
|
149
159
|
stripePriceId: target.stripePriceId,
|
|
150
160
|
trialDays: trial.days,
|
|
151
161
|
successUrl: redirect.successUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-plan-checkout.js","sourceRoot":"","sources":["../../../src/routes/tenant/tenant-plan-checkout.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tenant-plan-checkout.js","sourceRoot":"","sources":["../../../src/routes/tenant/tenant-plan-checkout.ts"],"names":[],"mappings":";;AA0HA,4DAYC;AAUD,wDAOC;AA+ND,8CAMC;AAjXD,6CAAyC;AACzC,6DAAuD;AACvD,uEAAwD;AACxD,gEAA6D;AAC7D,6FAAqE;AACrE,iFAAyF;AACzF,uDAAkE;AAClE,yCAAoD;AACpD,iCAKkB;AAClB,gDAAsD;AACtD,wEAOyC;AACzC,uCAAwC;AACxC,kEAA6E;AAC7E,mFAGkD;AAClD,uDAQ2B;AAC3B,mFAGyC;AAEzC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,sBAAsB,GAAG,iBAA0B,CAAC;AAC1D,MAAM,mBAAmB,GAAkB,IAAI,CAAC;AAChD,MAAM,aAAa,GAAG,UAAmB,CAAC;AAC1C,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAgCzC,MAAM,QAAQ,GAAe,EAAE,IAAI,EAAE,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;AAEnE,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QACzD,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE;QACd,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,6BAA6B,CACpC,IAAoB;IAEpB,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,IAAA,2BAAM,EACJ,UAAU,IAAI,IAAA,6BAAoB,EAAC,UAAU,CAAC,EAC9C,kCAAgB,EAChB,wCAAwC,CACzC,CAAC;IACF,IAAA,2BAAM,EACJ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MAAM,QAAQ,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,OAAO,CAAC,mBAAmB,EAAE,aAAa,CAAC;IACjE,IAAA,2BAAM,EAAC,aAAa,EAAE,kCAAgB,EAAE,kCAAkC,CAAC,CAAC;IAC5E,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE;QAC3D,aAAa;QACb,kBAAkB,EAAE,YAAY,CAAC,gBAAgB,IAAI,IAAI;QACzD,QAAQ;KACT,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAC1B,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAC7D,CAAC;IACF,MAAM,qBAAqB,CACzB,QAAQ,EACR,YAAY,EACZ,uBAAuB,EACvB,OAAO,CAAC,WAAW,CACpB,CAAC;IACF,MAAM,IAAA,2CAA2B,EAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO;QACL,GAAG,uCAAqB;QACxB,MAAM,EAAE,OAAO,CAAC,GAAG;QACnB,WAAW,EAAE,QAAQ,CAAC,GAAG;KAC1B,CAAC;AACJ,CAAC;AAGM,KAAK,UAAU,iBAAiB,CACrC,OAA0B;IAE1B,OAAO,IAAA,8CAA2B,EAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,CACxD,sBAAsB,CAAC,OAAO,CAAC,CAChC,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,14 @@ export interface ChangePlanBody {
|
|
|
10
10
|
planId: string;
|
|
11
11
|
successUrl?: string;
|
|
12
12
|
cancelUrl?: string;
|
|
13
|
+
prorationDate?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ImmediateChangeBilling {
|
|
16
|
+
prorationBehavior: "create_prorations" | "always_invoice";
|
|
17
|
+
prorationDate?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface UpgradeAuthentication {
|
|
20
|
+
clientSecret: string;
|
|
13
21
|
}
|
|
14
22
|
export interface ChangePlanResult {
|
|
15
23
|
changed: boolean;
|
|
@@ -17,16 +25,33 @@ export interface ChangePlanResult {
|
|
|
17
25
|
planId: string;
|
|
18
26
|
effectiveAt: Date | null;
|
|
19
27
|
checkoutUrl: string | null;
|
|
28
|
+
authentication: UpgradeAuthentication | null;
|
|
29
|
+
}
|
|
30
|
+
export interface OfferedPlanView extends TenantPlanView {
|
|
31
|
+
description: string;
|
|
32
|
+
billingMode: Plan["billingMode"];
|
|
33
|
+
maxMembers: number;
|
|
34
|
+
trialDays: number;
|
|
35
|
+
isTrialOffered: boolean;
|
|
36
|
+
audience: Plan["audience"];
|
|
37
|
+
isOfferedToCustomerType: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface SeatsInUse {
|
|
40
|
+
members: number;
|
|
41
|
+
pendingInvites: number;
|
|
42
|
+
occupied: number;
|
|
20
43
|
}
|
|
21
44
|
export interface CurrentPlanResult {
|
|
22
45
|
current: Plan | null;
|
|
23
|
-
|
|
46
|
+
seats: SeatsInUse;
|
|
47
|
+
available: OfferedPlanView[];
|
|
24
48
|
features: TenantPlanFeature[];
|
|
25
49
|
status: string | null;
|
|
26
50
|
freeUntil: Date | null;
|
|
27
51
|
isComplimentary: boolean;
|
|
28
52
|
isPlanChangeLocked: boolean;
|
|
29
53
|
canRecoverComplimentary: boolean;
|
|
54
|
+
canResubscribe: boolean;
|
|
30
55
|
paidUsageStartedAt: Date | null;
|
|
31
56
|
paidUsagePeriods: PaidUsagePeriod[] | null;
|
|
32
57
|
currentPeriodEnd: Date | null;
|
|
@@ -45,12 +70,17 @@ export declare const UNCHANGED_RESULT_BASE: {
|
|
|
45
70
|
readonly scheduled: false;
|
|
46
71
|
readonly effectiveAt: null;
|
|
47
72
|
readonly checkoutUrl: null;
|
|
73
|
+
readonly authentication: null;
|
|
48
74
|
};
|
|
75
|
+
export declare function loadSellablePlan(planModel: PlanModel, planId: string): Promise<Plan>;
|
|
76
|
+
export declare function assertPlanAudience(plan: Plan, customerType: string | null | undefined): void;
|
|
49
77
|
export declare function loadAndValidateTargetPlan(planModel: PlanModel, planId: string, customerType: string | null | undefined): Promise<Plan>;
|
|
50
78
|
export declare function assertSeatLimit(tenantId: string, plan: Plan): Promise<void>;
|
|
51
|
-
export declare function
|
|
79
|
+
export declare function planQuantity(tenantId: string, plan: Plan): Promise<number>;
|
|
52
80
|
export declare function isPaidPlan(plan: Plan): boolean;
|
|
81
|
+
export declare function startsPaidCheckout(newPlan: Plan, subscription: TenantSubscription | undefined): boolean;
|
|
53
82
|
export declare function insertFreeSubscription(user: User, newPlanId: string, tenantId: string, tenantSubscriptionModel: TenantSubscriptionModel): Promise<ChangePlanResult>;
|
|
54
83
|
export declare function scheduleDowngrade(tenantId: string, subscription: TenantSubscription, newPlan: Plan): Promise<ChangePlanResult>;
|
|
55
84
|
export declare function dropPendingChange(tenantId: string, subscription: TenantSubscription): Promise<ChangePlanResult>;
|
|
56
85
|
export declare function applyImmediateChange(tenantId: string, subscription: TenantSubscription, newPlan: Plan, tenantSubscriptionModel: TenantSubscriptionModel, operatorIntent?: SubscriptionTransition): Promise<ChangePlanResult>;
|
|
86
|
+
export declare function applyOwnerUpgrade(tenantId: string, subscription: TenantSubscription, newPlan: Plan, tenantSubscriptionModel: TenantSubscriptionModel, prorationDate: number | undefined): Promise<ChangePlanResult>;
|
|
@@ -1,78 +1,103 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.UNCHANGED_RESULT_BASE = exports.PAST_DUE_STATUS = exports.HTTP_CONFLICT = exports.HTTP_BAD_REQUEST = exports.HTTP_NOT_FOUND = void 0;
|
|
7
|
+
exports.loadSellablePlan = loadSellablePlan;
|
|
8
|
+
exports.assertPlanAudience = assertPlanAudience;
|
|
4
9
|
exports.loadAndValidateTargetPlan = loadAndValidateTargetPlan;
|
|
5
10
|
exports.assertSeatLimit = assertSeatLimit;
|
|
6
|
-
exports.
|
|
11
|
+
exports.planQuantity = planQuantity;
|
|
7
12
|
exports.isPaidPlan = isPaidPlan;
|
|
13
|
+
exports.startsPaidCheckout = startsPaidCheckout;
|
|
8
14
|
exports.insertFreeSubscription = insertFreeSubscription;
|
|
9
15
|
exports.scheduleDowngrade = scheduleDowngrade;
|
|
10
16
|
exports.dropPendingChange = dropPendingChange;
|
|
11
17
|
exports.applyImmediateChange = applyImmediateChange;
|
|
12
|
-
|
|
18
|
+
exports.applyOwnerUpgrade = applyOwnerUpgrade;
|
|
19
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
13
20
|
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
14
21
|
const tenant_lifecycle_1 = require("@antelopejs/interface-dms/tenant-lifecycle");
|
|
15
22
|
const billing_state_1 = require("../../billing-state");
|
|
16
23
|
const plan_changes_1 = require("../../plan-changes");
|
|
17
24
|
const plans_1 = require("../../plans");
|
|
25
|
+
const stripe_1 = __importDefault(require("stripe"));
|
|
18
26
|
const client_1 = require("../../stripe/client");
|
|
19
|
-
const
|
|
27
|
+
const pending_update_1 = require("../../stripe/pending-update");
|
|
28
|
+
const first_payment_1 = require("../../workspaces/first-payment");
|
|
29
|
+
const plan_audience_1 = require("../../plans/plan-audience");
|
|
20
30
|
exports.HTTP_NOT_FOUND = 404;
|
|
21
31
|
exports.HTTP_BAD_REQUEST = 400;
|
|
22
32
|
const HTTP_PAYMENT_REQUIRED = 402;
|
|
23
33
|
exports.HTTP_CONFLICT = 409;
|
|
24
34
|
exports.PAST_DUE_STATUS = "past_due";
|
|
25
|
-
const PRORATION_BEHAVIOR = "create_prorations";
|
|
26
35
|
const ACTIVE_STATUS = "active";
|
|
36
|
+
const SEAT_BILLING_MODE = "seat";
|
|
37
|
+
const FLAT_QUANTITY = 1;
|
|
38
|
+
const PAID_UPGRADE_PAYMENT_BEHAVIOR = "pending_if_incomplete";
|
|
39
|
+
const DEFERRED_PRORATION_BILLING = {
|
|
40
|
+
prorationBehavior: "create_prorations",
|
|
41
|
+
};
|
|
27
42
|
exports.UNCHANGED_RESULT_BASE = {
|
|
28
43
|
changed: false,
|
|
29
44
|
scheduled: false,
|
|
30
45
|
effectiveAt: null,
|
|
31
46
|
checkoutUrl: null,
|
|
47
|
+
authentication: null,
|
|
32
48
|
};
|
|
33
|
-
async function
|
|
49
|
+
async function loadSellablePlan(planModel, planId) {
|
|
34
50
|
const storedPlan = await planModel.get(planId);
|
|
35
51
|
(0, interface_api_util_1.assert)(storedPlan && !storedPlan.isDeleted && storedPlan.isActive, exports.HTTP_BAD_REQUEST, "saas.errors.plan.invalid");
|
|
36
|
-
(0, interface_api_util_1.assert)(customerType, exports.HTTP_BAD_REQUEST, "saas.errors.plan.customer_type_unknown");
|
|
37
|
-
(0, interface_api_util_1.assert)(storedPlan.audience === "any" || storedPlan.audience === customerType, exports.HTTP_BAD_REQUEST, "saas.errors.plan.not_available_for_customer_type");
|
|
38
52
|
const newPlan = await (0, plans_1.ensurePlanStripeRefs)(storedPlan, planModel);
|
|
39
53
|
(0, interface_api_util_1.assert)(newPlan.price <= 0 || !!newPlan.paymentProviderRefs?.stripePriceId, exports.HTTP_BAD_REQUEST, "saas.errors.plan.not_synced_with_stripe");
|
|
40
54
|
return newPlan;
|
|
41
55
|
}
|
|
56
|
+
function assertPlanAudience(plan, customerType) {
|
|
57
|
+
(0, interface_api_util_1.assert)(customerType, exports.HTTP_BAD_REQUEST, "saas.errors.plan.customer_type_unknown");
|
|
58
|
+
(0, interface_api_util_1.assert)((0, plan_audience_1.isPlanOfferedTo)(plan, customerType), exports.HTTP_BAD_REQUEST, "saas.errors.plan.not_available_for_customer_type");
|
|
59
|
+
}
|
|
60
|
+
async function loadAndValidateTargetPlan(planModel, planId, customerType) {
|
|
61
|
+
const plan = await loadSellablePlan(planModel, planId);
|
|
62
|
+
assertPlanAudience(plan, customerType);
|
|
63
|
+
return plan;
|
|
64
|
+
}
|
|
42
65
|
async function assertSeatLimit(tenantId, plan) {
|
|
43
66
|
const occupiedSeats = await (0, plans_1.countOccupiedSeats)(tenantId);
|
|
44
67
|
(0, interface_api_util_1.assert)((0, plans_1.fitsWithinSeatLimit)(plan.maxMembers, occupiedSeats), HTTP_PAYMENT_REQUIRED, "saas.errors.plan.downgrade_exceeds_seat_limit");
|
|
45
68
|
}
|
|
46
|
-
async function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
updatedAt: new Date(),
|
|
51
|
-
});
|
|
69
|
+
async function planQuantity(tenantId, plan) {
|
|
70
|
+
if (plan.billingMode !== SEAT_BILLING_MODE)
|
|
71
|
+
return FLAT_QUANTITY;
|
|
72
|
+
return (0, plans_1.countOccupiedSeats)(tenantId);
|
|
52
73
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
function toChargeParams(billing) {
|
|
75
|
+
if (billing.prorationBehavior !== "always_invoice") {
|
|
76
|
+
return {
|
|
77
|
+
proration_behavior: billing.prorationBehavior,
|
|
78
|
+
automatic_tax: { enabled: true },
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
proration_behavior: billing.prorationBehavior,
|
|
83
|
+
proration_date: billing.prorationDate,
|
|
84
|
+
payment_behavior: PAID_UPGRADE_PAYMENT_BEHAVIOR,
|
|
85
|
+
};
|
|
62
86
|
}
|
|
63
|
-
async function syncStripePlanChange(
|
|
87
|
+
async function syncStripePlanChange(change) {
|
|
88
|
+
const { subscription, newPlan, operationId, billing } = change;
|
|
64
89
|
if (!subscription.stripeSubscriptionId)
|
|
65
|
-
return;
|
|
90
|
+
return null;
|
|
66
91
|
const stripePriceId = newPlan.paymentProviderRefs?.stripePriceId;
|
|
67
92
|
(0, interface_api_util_1.assert)(stripePriceId, exports.HTTP_BAD_REQUEST, "saas.errors.plan.no_stripe_price");
|
|
68
93
|
const stripe = (0, client_1.getStripeClient)();
|
|
69
94
|
const stripeSubscription = await stripe.subscriptions.retrieve(subscription.stripeSubscriptionId);
|
|
70
95
|
const itemId = stripeSubscription.items.data[0]?.id;
|
|
71
96
|
(0, interface_api_util_1.assert)(itemId, exports.HTTP_BAD_REQUEST, "saas.errors.stripe.subscription_no_item");
|
|
72
|
-
await
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
const quantity = await planQuantity(subscription._id, newPlan);
|
|
98
|
+
return stripe.subscriptions.update(subscription.stripeSubscriptionId, {
|
|
99
|
+
items: [{ id: itemId, price: stripePriceId, quantity }],
|
|
100
|
+
...toChargeParams(billing),
|
|
76
101
|
}, {
|
|
77
102
|
idempotencyKey: `change-plan:${operationId}`,
|
|
78
103
|
});
|
|
@@ -80,6 +105,9 @@ async function syncStripePlanChange(subscription, newPlan, operationId) {
|
|
|
80
105
|
function isPaidPlan(plan) {
|
|
81
106
|
return !!plan.paymentProviderRefs?.stripePriceId;
|
|
82
107
|
}
|
|
108
|
+
function startsPaidCheckout(newPlan, subscription) {
|
|
109
|
+
return isPaidPlan(newPlan) && !(0, first_payment_1.liveStripeSubscriptionId)(subscription);
|
|
110
|
+
}
|
|
83
111
|
async function insertFreeSubscription(user, newPlanId, tenantId, tenantSubscriptionModel) {
|
|
84
112
|
await (0, tenant_lifecycle_1.runTenantLifecycleOperation)(tenantId, () => tenantSubscriptionModel.insert([
|
|
85
113
|
{
|
|
@@ -126,20 +154,65 @@ async function dropPendingChange(tenantId, subscription) {
|
|
|
126
154
|
planId: subscription.planId ?? "",
|
|
127
155
|
};
|
|
128
156
|
}
|
|
157
|
+
async function runImmediateChange(change, admission) {
|
|
158
|
+
const { tenantId, intent, model } = admission;
|
|
159
|
+
await model.beginTransition(change.subscription, intent);
|
|
160
|
+
await (0, plan_changes_1.clearPendingPlanChange)(tenantId, change.subscription, intent.operationId);
|
|
161
|
+
const updated = await syncStripePlanChange(change);
|
|
162
|
+
if (updated?.pending_update)
|
|
163
|
+
return updated;
|
|
164
|
+
await (0, plan_changes_1.recordPlanChange)(change.subscription, change.newPlan, intent.operationId, model);
|
|
165
|
+
await (0, plan_changes_1.finalizeImmediateChange)(tenantId, change.subscription, change.newPlan);
|
|
166
|
+
return updated;
|
|
167
|
+
}
|
|
129
168
|
async function applyImmediateChange(tenantId, subscription, newPlan, tenantSubscriptionModel, operatorIntent) {
|
|
130
|
-
const intent = operatorIntent ??
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
await
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
169
|
+
const intent = operatorIntent ?? (0, plan_changes_1.newChangeIntent)(newPlan);
|
|
170
|
+
const change = {
|
|
171
|
+
subscription,
|
|
172
|
+
newPlan,
|
|
173
|
+
operationId: intent.operationId,
|
|
174
|
+
billing: DEFERRED_PRORATION_BILLING,
|
|
175
|
+
};
|
|
176
|
+
await runImmediateChange(change, {
|
|
177
|
+
tenantId,
|
|
178
|
+
intent,
|
|
179
|
+
model: tenantSubscriptionModel,
|
|
180
|
+
});
|
|
141
181
|
if (!operatorIntent)
|
|
142
182
|
await tenantSubscriptionModel.completeTransition(subscription._id, intent.operationId, {});
|
|
143
183
|
return { ...exports.UNCHANGED_RESULT_BASE, changed: true, planId: newPlan._id };
|
|
144
184
|
}
|
|
185
|
+
async function releaseDeclinedUpgrade(error, admission, subscriptionId) {
|
|
186
|
+
if (!(error instanceof stripe_1.default.errors.StripeCardError))
|
|
187
|
+
throw error;
|
|
188
|
+
await admission.model.completeTransition(subscriptionId, admission.intent.operationId, {});
|
|
189
|
+
throw new interface_api_1.HTTPResult(HTTP_PAYMENT_REQUIRED, "saas.errors.plan.upgrade_payment_declined");
|
|
190
|
+
}
|
|
191
|
+
async function requestUpgradeAuthentication(stripeSubscription) {
|
|
192
|
+
const clientSecret = await (0, pending_update_1.readPendingChallengeSecret)(stripeSubscription);
|
|
193
|
+
if (clientSecret)
|
|
194
|
+
return { clientSecret };
|
|
195
|
+
await (0, pending_update_1.discardPendingUpdate)(stripeSubscription);
|
|
196
|
+
throw new interface_api_1.HTTPResult(HTTP_PAYMENT_REQUIRED, "saas.errors.plan.upgrade_payment_declined");
|
|
197
|
+
}
|
|
198
|
+
async function applyOwnerUpgrade(tenantId, subscription, newPlan, tenantSubscriptionModel, prorationDate) {
|
|
199
|
+
const intent = (0, plan_changes_1.newChangeIntent)(newPlan);
|
|
200
|
+
const admission = { tenantId, intent, model: tenantSubscriptionModel };
|
|
201
|
+
const change = {
|
|
202
|
+
subscription,
|
|
203
|
+
newPlan,
|
|
204
|
+
operationId: intent.operationId,
|
|
205
|
+
billing: { prorationBehavior: "always_invoice", prorationDate },
|
|
206
|
+
};
|
|
207
|
+
const updated = await runImmediateChange(change, admission).catch((error) => releaseDeclinedUpgrade(error, admission, subscription._id));
|
|
208
|
+
await tenantSubscriptionModel.completeTransition(subscription._id, intent.operationId, {});
|
|
209
|
+
if (updated?.pending_update) {
|
|
210
|
+
return {
|
|
211
|
+
...exports.UNCHANGED_RESULT_BASE,
|
|
212
|
+
planId: newPlan._id,
|
|
213
|
+
authentication: await requestUpgradeAuthentication(updated),
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
return { ...exports.UNCHANGED_RESULT_BASE, changed: true, planId: newPlan._id };
|
|
217
|
+
}
|
|
145
218
|
//# sourceMappingURL=tenant-plan-ops.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-plan-ops.js","sourceRoot":"","sources":["../../../src/routes/tenant/tenant-plan-ops.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tenant-plan-ops.js","sourceRoot":"","sources":["../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