@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,60 @@
|
|
|
1
|
+
import { isSegmentGroup, isSegmentWorkspaceRef } from './tree'
|
|
2
|
+
import type { SegmentCatalog } from './useSegmentCatalog'
|
|
3
|
+
import { useSegmentWords } from './useSegmentWords'
|
|
4
|
+
import type {
|
|
5
|
+
SegmentConditionGroup,
|
|
6
|
+
SegmentNode,
|
|
7
|
+
SegmentScope,
|
|
8
|
+
SegmentWordToken,
|
|
9
|
+
} from './types'
|
|
10
|
+
|
|
11
|
+
const I18N = 'saas.segments.sentence'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The rules as one sentence ("Users where Email verified is Yes, they own
|
|
15
|
+
* at least one workspace where Paying is Yes and …"), tokens in bold for
|
|
16
|
+
* the fields read.
|
|
17
|
+
*/
|
|
18
|
+
export function useSegmentSentence(catalog: SegmentCatalog) {
|
|
19
|
+
const { t } = useI18n()
|
|
20
|
+
const words = useSegmentWords(catalog)
|
|
21
|
+
|
|
22
|
+
function clause(node: SegmentNode, scope: SegmentScope): SegmentWordToken[] {
|
|
23
|
+
if (isSegmentWorkspaceRef(node)) {
|
|
24
|
+
const role = node.role === 'owner' ? 'owner' : 'member'
|
|
25
|
+
return [
|
|
26
|
+
{ text: t(`${I18N}.ref.${role}.${node.quantifier}`) },
|
|
27
|
+
...clauses(node.conditions, 'workspace'),
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
if (isSegmentGroup(node)) {
|
|
31
|
+
return [{ text: '(' }, ...clauses(node, scope), { text: ')' }]
|
|
32
|
+
}
|
|
33
|
+
return words.conditionTokens(node, scope)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function clauses(
|
|
37
|
+
group: SegmentConditionGroup,
|
|
38
|
+
scope: SegmentScope,
|
|
39
|
+
): SegmentWordToken[] {
|
|
40
|
+
const last = group.conditions.length - 1
|
|
41
|
+
const conjunction = t(`${I18N}.${group.logical}`)
|
|
42
|
+
return group.conditions.flatMap((node, index) => {
|
|
43
|
+
const separator =
|
|
44
|
+
index === 0 ? [] : [{ text: index === last ? conjunction : ',' }]
|
|
45
|
+
return [...separator, ...clause(node, scope)]
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The rules of a segment as tokens of one sentence. */
|
|
50
|
+
function sentence(group: SegmentConditionGroup): SegmentWordToken[] {
|
|
51
|
+
if (group.conditions.length === 0) return [{ text: t(`${I18N}.empty`) }]
|
|
52
|
+
return [
|
|
53
|
+
{ text: t(`${I18N}.lead`) },
|
|
54
|
+
...clauses(group, 'user'),
|
|
55
|
+
{ text: '.' },
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return { sentence }
|
|
60
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { formatMinorUnits } from '../../composables/useMoneyFormat'
|
|
2
|
+
import { isSegmentGroup, isSegmentWorkspaceRef } from './tree'
|
|
3
|
+
import type { SegmentCatalog } from './useSegmentCatalog'
|
|
4
|
+
import type {
|
|
5
|
+
SegmentCondition,
|
|
6
|
+
SegmentConditionGroup,
|
|
7
|
+
SegmentFieldDefinition,
|
|
8
|
+
SegmentNode,
|
|
9
|
+
SegmentOperator,
|
|
10
|
+
SegmentScope,
|
|
11
|
+
SegmentWordToken,
|
|
12
|
+
SegmentWorkspaceRef,
|
|
13
|
+
} from './types'
|
|
14
|
+
|
|
15
|
+
const I18N = 'saas.segments'
|
|
16
|
+
const DAY_FORMAT: Intl.DateTimeFormatOptions = {
|
|
17
|
+
day: 'numeric',
|
|
18
|
+
month: 'short',
|
|
19
|
+
year: 'numeric',
|
|
20
|
+
}
|
|
21
|
+
const BOOLEAN_TONES: Record<string, string> = {
|
|
22
|
+
true: 'success',
|
|
23
|
+
false: 'neutral',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** One piece of rules read in words: a rule, or the AND / OR joining two. */
|
|
27
|
+
export type SegmentRulePart =
|
|
28
|
+
| { kind: 'rule'; tokens: SegmentWordToken[] }
|
|
29
|
+
| { kind: 'join'; text: string }
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* `compact` collapses nested groups ("any of 3 conditions"), for a table
|
|
33
|
+
* cell; `full` spells every rule out.
|
|
34
|
+
*/
|
|
35
|
+
export type SegmentRulesMode = 'compact' | 'full'
|
|
36
|
+
|
|
37
|
+
const OPERATOR_FAMILY: Record<string, string> = {
|
|
38
|
+
enum: 'enum',
|
|
39
|
+
'enum:plan': 'enum',
|
|
40
|
+
boolean: 'boolean',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function text(value: string): SegmentWordToken {
|
|
44
|
+
return { text: value }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Words for fields, operators, values and whole rules, in the UI locale. */
|
|
48
|
+
export function useSegmentWords(catalog: SegmentCatalog) {
|
|
49
|
+
const { t, locale } = useI18n()
|
|
50
|
+
|
|
51
|
+
function operatorFamily(field: SegmentFieldDefinition | undefined): string {
|
|
52
|
+
if (!field) return 'string'
|
|
53
|
+
return OPERATOR_FAMILY[field.type] ?? field.valueKind
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function operatorLabel(
|
|
57
|
+
field: SegmentFieldDefinition | undefined,
|
|
58
|
+
operator: SegmentOperator,
|
|
59
|
+
): string {
|
|
60
|
+
return t(`${I18N}.operators.${operatorFamily(field)}.${operator}`)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function enumToken(
|
|
64
|
+
field: SegmentFieldDefinition,
|
|
65
|
+
value: unknown,
|
|
66
|
+
): SegmentWordToken {
|
|
67
|
+
const key = String(value)
|
|
68
|
+
if (field.type === 'enum:plan') {
|
|
69
|
+
const plan = catalog.catalog.value.plans.find((p) => p._id === key)
|
|
70
|
+
return { text: plan?.name ?? t(`${I18N}.unknown_plan`), tone: 'neutral' }
|
|
71
|
+
}
|
|
72
|
+
const option = field.enumOptions?.find((o) => o.value === key)
|
|
73
|
+
return {
|
|
74
|
+
text: option ? t(option.labelKey) : key,
|
|
75
|
+
tone: option?.tone ?? 'neutral',
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const SCALAR_FORMATTERS: Record<
|
|
80
|
+
string,
|
|
81
|
+
(field: SegmentFieldDefinition, value: unknown) => SegmentWordToken
|
|
82
|
+
> = {
|
|
83
|
+
boolean: (_field, value) => ({
|
|
84
|
+
text: t(`${I18N}.boolean.${value === true || value === 'true'}`),
|
|
85
|
+
tone: BOOLEAN_TONES[String(value === true || value === 'true')],
|
|
86
|
+
}),
|
|
87
|
+
date: (_field, value) =>
|
|
88
|
+
text(formatDate(value, locale.value, DAY_FORMAT) ?? String(value)),
|
|
89
|
+
number: (field, value) => text(numberText(field, Number(value))),
|
|
90
|
+
string: (_field, value) => text(`“${String(value ?? '')}”`),
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function numberText(field: SegmentFieldDefinition, value: number): string {
|
|
94
|
+
if (field.unit === 'currency') {
|
|
95
|
+
return formatMinorUnits(value, null, locale.value)
|
|
96
|
+
}
|
|
97
|
+
if (field.unit === 'days') {
|
|
98
|
+
return t(`${I18N}.units.days`, { count: value }, value)
|
|
99
|
+
}
|
|
100
|
+
return new Intl.NumberFormat(locale.value).format(value)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function valueTokens(
|
|
104
|
+
field: SegmentFieldDefinition | undefined,
|
|
105
|
+
value: unknown,
|
|
106
|
+
): SegmentWordToken[] {
|
|
107
|
+
if (!field) return [text(String(value ?? ''))]
|
|
108
|
+
const values = Array.isArray(value) ? value : [value]
|
|
109
|
+
const isEnum = field.type === 'enum' || field.type === 'enum:plan'
|
|
110
|
+
const format = isEnum
|
|
111
|
+
? enumToken
|
|
112
|
+
: (SCALAR_FORMATTERS[field.type] ?? SCALAR_FORMATTERS.string)
|
|
113
|
+
if (values.length === 0) return [text(t(`${I18N}.no_value`))]
|
|
114
|
+
return values.map((entry) => format!(field, entry))
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function fieldLabel(field: SegmentFieldDefinition | undefined): string {
|
|
118
|
+
return field ? t(field.labelKey) : t(`${I18N}.unknown_field`)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function conditionTokens(
|
|
122
|
+
condition: SegmentCondition,
|
|
123
|
+
scope: SegmentScope,
|
|
124
|
+
): SegmentWordToken[] {
|
|
125
|
+
const field = catalog.findField(scope, condition.field)
|
|
126
|
+
return [
|
|
127
|
+
{ text: fieldLabel(field), isStrong: true },
|
|
128
|
+
text(operatorLabel(field, condition.operator)),
|
|
129
|
+
...valueTokens(field, condition.value),
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function refHead(ref: SegmentWorkspaceRef): SegmentWordToken[] {
|
|
134
|
+
const role = ref.role === 'owner' ? 'owner' : 'member'
|
|
135
|
+
const names = ref.workspaceNames ?? []
|
|
136
|
+
const target = names.length
|
|
137
|
+
? names.join(', ')
|
|
138
|
+
: t(`${I18N}.rules.quantifier.${ref.quantifier}`)
|
|
139
|
+
return [
|
|
140
|
+
{ text: t(`${I18N}.rules.role.${role}`), isStrong: true },
|
|
141
|
+
text(target),
|
|
142
|
+
text(t(`${I18N}.rules.where`)),
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function nodeParts(
|
|
147
|
+
node: SegmentNode,
|
|
148
|
+
scope: SegmentScope,
|
|
149
|
+
mode: SegmentRulesMode,
|
|
150
|
+
): SegmentRulePart[] {
|
|
151
|
+
if (isSegmentWorkspaceRef(node)) {
|
|
152
|
+
return [
|
|
153
|
+
{ kind: 'rule', tokens: refHead(node) },
|
|
154
|
+
...groupParts(node.conditions, 'workspace', mode),
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
if (isSegmentGroup(node)) return nestedGroupParts(node, scope, mode)
|
|
158
|
+
return [{ kind: 'rule', tokens: conditionTokens(node, scope) }]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function nestedGroupParts(
|
|
162
|
+
group: SegmentConditionGroup,
|
|
163
|
+
scope: SegmentScope,
|
|
164
|
+
mode: SegmentRulesMode,
|
|
165
|
+
): SegmentRulePart[] {
|
|
166
|
+
if (mode === 'full') {
|
|
167
|
+
return [
|
|
168
|
+
{ kind: 'rule', tokens: [text('(')] },
|
|
169
|
+
...groupParts(group, scope, mode),
|
|
170
|
+
{ kind: 'rule', tokens: [text(')')] },
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
const count = group.conditions.length
|
|
174
|
+
return [
|
|
175
|
+
{
|
|
176
|
+
kind: 'rule',
|
|
177
|
+
tokens: [
|
|
178
|
+
text(t(`${I18N}.rules.group.${group.logical}`, { count }, count)),
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Rules read in words, the parts joined by AND / OR. */
|
|
185
|
+
function groupParts(
|
|
186
|
+
group: SegmentConditionGroup,
|
|
187
|
+
scope: SegmentScope,
|
|
188
|
+
mode: SegmentRulesMode,
|
|
189
|
+
): SegmentRulePart[] {
|
|
190
|
+
const join = t(`${I18N}.conditions.${group.logical}`)
|
|
191
|
+
return group.conditions.flatMap((node, index) => [
|
|
192
|
+
...(index > 0 ? [{ kind: 'join' as const, text: join }] : []),
|
|
193
|
+
...nodeParts(node, scope, mode),
|
|
194
|
+
])
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
fieldLabel,
|
|
199
|
+
operatorLabel,
|
|
200
|
+
valueTokens,
|
|
201
|
+
conditionTokens,
|
|
202
|
+
groupParts,
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed, type ComputedRef } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The current workspace's name, read from the caller's own workspace list
|
|
5
|
+
* (which the sidebar switcher already loads), so it is known to members too.
|
|
6
|
+
* Empty until the list is loaded.
|
|
7
|
+
*/
|
|
8
|
+
export function useWorkspaceName(): ComputedRef<string> {
|
|
9
|
+
const { workspaces, isLoaded, refresh } = useMyWorkspaces()
|
|
10
|
+
if (!isLoaded.value) void refresh().catch(() => undefined)
|
|
11
|
+
return computed(
|
|
12
|
+
() => workspaces.value.find((workspace) => workspace.isCurrent)?.name ?? '',
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { computed, type ComputedRef } from 'vue'
|
|
2
|
+
import type { SharedRequest } from '../../composables/useSharedRequest'
|
|
3
|
+
|
|
4
|
+
/** A workspace of the user, with their place in it. */
|
|
5
|
+
export interface UserWorkspace {
|
|
6
|
+
tenantId: string
|
|
7
|
+
name: string
|
|
8
|
+
isTenantOwner: boolean
|
|
9
|
+
joinedAt: string | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MoneyTotal {
|
|
13
|
+
currency: string
|
|
14
|
+
amount: number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface UserSecurity {
|
|
18
|
+
signInMethods: string[]
|
|
19
|
+
twoFactorMethods: string[]
|
|
20
|
+
backupCodesLeft: number | null
|
|
21
|
+
activeSessions: number
|
|
22
|
+
sessionLocations: string[]
|
|
23
|
+
isEmailVerified: boolean
|
|
24
|
+
verificationRequestedAt: string | null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A stored image, as the DMS image type writes it. */
|
|
28
|
+
export interface UserAvatar {
|
|
29
|
+
key: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** What `GET /api/saas/users/:id` answers. */
|
|
33
|
+
export interface UserDetail {
|
|
34
|
+
_id: string
|
|
35
|
+
name: string
|
|
36
|
+
email: string
|
|
37
|
+
avatar: UserAvatar | null
|
|
38
|
+
language: string | null
|
|
39
|
+
createdAt: string
|
|
40
|
+
lastActiveAt: string | null
|
|
41
|
+
lastSession: { browser: string; os: string; location: string } | null
|
|
42
|
+
isPlatformAdmin: boolean
|
|
43
|
+
isSelf: boolean
|
|
44
|
+
workspaces: UserWorkspace[]
|
|
45
|
+
billedAsOwner: MoneyTotal[]
|
|
46
|
+
segmentCount: number
|
|
47
|
+
security: UserSecurity
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface UserDetailRequest extends SharedRequest<UserDetail> {
|
|
51
|
+
userId: ComputedRef<string>
|
|
52
|
+
isLoading: ComputedRef<boolean>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const STATE_KEY = 'saas-user-detail'
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The user a platform admin's user page shows, fetched once for the header
|
|
59
|
+
* and the platform role card.
|
|
60
|
+
*/
|
|
61
|
+
export function useUserDetail(
|
|
62
|
+
routeParams: () => Record<string, string> | undefined,
|
|
63
|
+
): UserDetailRequest {
|
|
64
|
+
const { $authFetch } = useAuthFetch()
|
|
65
|
+
const userId = computed(() => routeParams()?.id ?? '')
|
|
66
|
+
const request = useSharedRequest<UserDetail>(
|
|
67
|
+
`${STATE_KEY}:${userId.value}`,
|
|
68
|
+
() => $authFetch<UserDetail>(`/api/saas/users/${userId.value}`),
|
|
69
|
+
)
|
|
70
|
+
return {
|
|
71
|
+
...request,
|
|
72
|
+
userId,
|
|
73
|
+
isLoading: computed(() => !request.data.value && !request.error.value),
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The user's display name: their name, or their address without one. */
|
|
78
|
+
export function userDisplayName(
|
|
79
|
+
user: Pick<UserDetail, 'name' | 'email'>,
|
|
80
|
+
): string {
|
|
81
|
+
return user.name || user.email
|
|
82
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from 'vue'
|
|
3
|
+
import FormFieldRow from '../components/FormFieldRow.vue'
|
|
4
|
+
import FormRows from '../components/FormRows.vue'
|
|
5
|
+
import { useApiErrorMessage } from '../../composables/useApiErrorMessage'
|
|
6
|
+
import { formatMinorUnits } from '../../composables/useMoneyFormat'
|
|
7
|
+
import { PLAN_UNLIMITED } from '../plan-catalog'
|
|
8
|
+
import { planPriceLabel } from './planPrice'
|
|
9
|
+
import type { ComplimentaryImpact } from './types'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Grants (or updates) complimentary access. Over a paid Stripe subscription
|
|
13
|
+
* it says which subscription is cancelled and the MRR it stops, and asks the
|
|
14
|
+
* operator to acknowledge it — the server refuses it otherwise.
|
|
15
|
+
*/
|
|
16
|
+
const props = defineProps<{ tenantId: string }>()
|
|
17
|
+
const emit = defineEmits<{ done: []; cancel: [] }>()
|
|
18
|
+
|
|
19
|
+
const D = 'saas.workspace_detail.complimentary'
|
|
20
|
+
|
|
21
|
+
const { $authFetch } = useAuthFetch()
|
|
22
|
+
const { t, locale } = useI18n()
|
|
23
|
+
const toast = useToast()
|
|
24
|
+
const { resolveApiError } = useApiErrorMessage()
|
|
25
|
+
|
|
26
|
+
const impact = ref<ComplimentaryImpact | null>(null)
|
|
27
|
+
const loadError = ref<string | null>(null)
|
|
28
|
+
const planId = ref<string | undefined>()
|
|
29
|
+
const freeUntil = ref('')
|
|
30
|
+
const isAcknowledged = ref(false)
|
|
31
|
+
const submitError = ref<string | null>(null)
|
|
32
|
+
const isSubmitting = ref(false)
|
|
33
|
+
|
|
34
|
+
const cancelsSubscription = computed(() => !!impact.value?.stripeSubscriptionId)
|
|
35
|
+
const selectedPlan = computed(() =>
|
|
36
|
+
impact.value?.plans.find((plan) => plan.id === planId.value),
|
|
37
|
+
)
|
|
38
|
+
const planItems = computed(() =>
|
|
39
|
+
(impact.value?.plans ?? []).map((plan) => ({
|
|
40
|
+
value: plan.id,
|
|
41
|
+
label: `${plan.name} · ${planPriceLabel(plan, t, locale.value)}`,
|
|
42
|
+
})),
|
|
43
|
+
)
|
|
44
|
+
const daysLeft = computed(() =>
|
|
45
|
+
freeUntil.value ? countDaysUntil(freeUntil.value, new Date()) : null,
|
|
46
|
+
)
|
|
47
|
+
const canSubmit = computed(
|
|
48
|
+
() =>
|
|
49
|
+
!!planId.value &&
|
|
50
|
+
!isSubmitting.value &&
|
|
51
|
+
(!cancelsSubscription.value || isAcknowledged.value),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
function money(minor: number): string {
|
|
55
|
+
return formatMinorUnits(minor, impact.value?.currency ?? null, locale.value)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const fitNote = computed(() => {
|
|
59
|
+
const plan = selectedPlan.value
|
|
60
|
+
const seats = impact.value?.seats ?? 0
|
|
61
|
+
if (!plan) return ''
|
|
62
|
+
if (plan.maxMembers === PLAN_UNLIMITED) return t(`${D}.fits_unlimited`, { seats }, seats)
|
|
63
|
+
const key = plan.fits ? 'fits' : 'exceeds'
|
|
64
|
+
return t(`${D}.${key}`, { seats, max: plan.maxMembers }, seats)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const cancellation = computed(() => {
|
|
68
|
+
const current = impact.value
|
|
69
|
+
if (!current?.stripeSubscriptionId) return ''
|
|
70
|
+
const invoice = current.nextInvoice
|
|
71
|
+
return t(`${D}.cancellation`, {
|
|
72
|
+
id: current.stripeSubscriptionId,
|
|
73
|
+
mrr: money(current.mrrMinor),
|
|
74
|
+
date: invoice
|
|
75
|
+
? formatDate(invoice.date, locale.value, { dateStyle: 'medium' })
|
|
76
|
+
: '—',
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const submitLabel = computed(() => {
|
|
81
|
+
if (cancelsSubscription.value) return t(`${D}.submit_cancel`)
|
|
82
|
+
return impact.value?.isComplimentary
|
|
83
|
+
? t(`${D}.submit_update`)
|
|
84
|
+
: t(`${D}.submit`)
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
async function load(): Promise<void> {
|
|
88
|
+
loadError.value = null
|
|
89
|
+
try {
|
|
90
|
+
impact.value = await $authFetch<ComplimentaryImpact>(
|
|
91
|
+
`/api/saas/workspaces/${props.tenantId}/complimentary-impact`,
|
|
92
|
+
)
|
|
93
|
+
planId.value = impact.value.currentPlanId ?? impact.value.plans[0]?.id
|
|
94
|
+
freeUntil.value = impact.value.freeUntil?.slice(0, 10) ?? ''
|
|
95
|
+
} catch (error) {
|
|
96
|
+
loadError.value = resolveApiError(error, `${D}.load_error`)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async function submit(): Promise<void> {
|
|
101
|
+
if (!canSubmit.value) return
|
|
102
|
+
isSubmitting.value = true
|
|
103
|
+
submitError.value = null
|
|
104
|
+
try {
|
|
105
|
+
await $authFetch(
|
|
106
|
+
`/api/saas/workspaces/${props.tenantId}/grant-free-access`,
|
|
107
|
+
{
|
|
108
|
+
method: 'POST',
|
|
109
|
+
body: {
|
|
110
|
+
planId: planId.value,
|
|
111
|
+
freeUntil: freeUntil.value || null,
|
|
112
|
+
acknowledgeCancellation: isAcknowledged.value,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
)
|
|
116
|
+
toast.add({
|
|
117
|
+
title: t(`${D}.success`),
|
|
118
|
+
color: 'success',
|
|
119
|
+
icon: 'i-ph-check-circle',
|
|
120
|
+
})
|
|
121
|
+
emit('done')
|
|
122
|
+
} catch (error) {
|
|
123
|
+
submitError.value = resolveApiError(error, `${D}.error`)
|
|
124
|
+
} finally {
|
|
125
|
+
isSubmitting.value = false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
onMounted(load)
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<template>
|
|
133
|
+
<div class="flex flex-col gap-4">
|
|
134
|
+
<DmsEmptyState
|
|
135
|
+
v-if="loadError"
|
|
136
|
+
variant="error"
|
|
137
|
+
size="sm"
|
|
138
|
+
:title="$t(`${D}.load_error`)"
|
|
139
|
+
:description="loadError"
|
|
140
|
+
:actions="[{ label: $t('saas.workspace_detail.retry'), onClick: load }]"
|
|
141
|
+
/>
|
|
142
|
+
<USkeleton v-else-if="!impact" class="h-32 w-full" />
|
|
143
|
+
<template v-else>
|
|
144
|
+
<p class="text-muted text-sm">
|
|
145
|
+
{{ $t(`${D}.lead`, { name: impact.workspaceName }) }}
|
|
146
|
+
</p>
|
|
147
|
+
<FormRows has-required>
|
|
148
|
+
<FormFieldRow :label="$t(`${D}.plan`)" :help="fitNote" required>
|
|
149
|
+
<template #default="{ id }">
|
|
150
|
+
<DmsSelect
|
|
151
|
+
:id="id"
|
|
152
|
+
v-model="planId"
|
|
153
|
+
:items="planItems"
|
|
154
|
+
:deselectable="false"
|
|
155
|
+
class="w-full"
|
|
156
|
+
/>
|
|
157
|
+
</template>
|
|
158
|
+
</FormFieldRow>
|
|
159
|
+
<FormFieldRow
|
|
160
|
+
:label="$t(`${D}.expires`)"
|
|
161
|
+
:help="
|
|
162
|
+
daysLeft === null
|
|
163
|
+
? $t(`${D}.no_end`)
|
|
164
|
+
: $t(`${D}.expires_help`, { count: daysLeft }, daysLeft)
|
|
165
|
+
"
|
|
166
|
+
>
|
|
167
|
+
<template #default="{ id }">
|
|
168
|
+
<DmsDatePicker
|
|
169
|
+
:id="id"
|
|
170
|
+
:model-value="freeUntil || undefined"
|
|
171
|
+
@update:model-value="freeUntil = $event ?? ''"
|
|
172
|
+
/>
|
|
173
|
+
</template>
|
|
174
|
+
</FormFieldRow>
|
|
175
|
+
</FormRows>
|
|
176
|
+
<DmsBanner
|
|
177
|
+
v-if="cancelsSubscription"
|
|
178
|
+
tone="error"
|
|
179
|
+
icon="i-ph-warning"
|
|
180
|
+
:title="$t(`${D}.cancellation_title`)"
|
|
181
|
+
:description="cancellation"
|
|
182
|
+
/>
|
|
183
|
+
<DmsCheckbox
|
|
184
|
+
v-if="cancelsSubscription"
|
|
185
|
+
v-model="isAcknowledged"
|
|
186
|
+
:label="$t(`${D}.acknowledge`)"
|
|
187
|
+
/>
|
|
188
|
+
<p v-if="impact.owner" class="text-muted flex items-center gap-2 text-sm">
|
|
189
|
+
<UIcon name="i-ph-envelope-simple" class="size-4" />
|
|
190
|
+
{{
|
|
191
|
+
$t(`${D}.owner_emailed`, {
|
|
192
|
+
owner: impact.owner.name || impact.owner.email,
|
|
193
|
+
})
|
|
194
|
+
}}
|
|
195
|
+
</p>
|
|
196
|
+
<UAlert
|
|
197
|
+
v-if="submitError"
|
|
198
|
+
color="error"
|
|
199
|
+
variant="subtle"
|
|
200
|
+
icon="i-ph-warning-circle"
|
|
201
|
+
:description="submitError"
|
|
202
|
+
/>
|
|
203
|
+
</template>
|
|
204
|
+
<div class="flex justify-end gap-2">
|
|
205
|
+
<UButton color="neutral" variant="ghost" @click="emit('cancel')">
|
|
206
|
+
{{ $t('common.cancel') }}
|
|
207
|
+
</UButton>
|
|
208
|
+
<UButton
|
|
209
|
+
:color="cancelsSubscription ? 'error' : 'primary'"
|
|
210
|
+
icon="i-ph-gift"
|
|
211
|
+
:loading="isSubmitting"
|
|
212
|
+
:disabled="!canSubmit"
|
|
213
|
+
@click="submit"
|
|
214
|
+
>
|
|
215
|
+
{{ submitLabel }}
|
|
216
|
+
</UButton>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</template>
|