@antelopejs/dms-saas 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -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 +83 -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 +172 -55
- 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 +104 -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 +71 -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 +264 -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 +304 -0
- package/frontend-vue/i18n/locales/saas-public-fr-FR.json +304 -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
|
@@ -1,120 +1,192 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from
|
|
2
|
+
computed,
|
|
3
|
+
type MaybeRefOrGetter,
|
|
4
|
+
onMounted,
|
|
5
|
+
reactive,
|
|
6
|
+
ref,
|
|
7
|
+
toRef,
|
|
8
|
+
toValue,
|
|
9
|
+
} from 'vue'
|
|
10
|
+
import { rememberChosenPlan } from '../build/public/chosen-plan'
|
|
11
|
+
import {
|
|
12
|
+
isPaidPlan,
|
|
13
|
+
type RegistrationPlanSummary,
|
|
14
|
+
} from '../build/public/pricing'
|
|
15
|
+
import {
|
|
16
|
+
billingUpgradePath,
|
|
17
|
+
LOGIN_PATH,
|
|
18
|
+
loginPathThen,
|
|
19
|
+
REGISTER_PLAN_PARAM,
|
|
20
|
+
} from '../build/public/routes'
|
|
21
|
+
import {
|
|
22
|
+
onPublicLocaleChange,
|
|
23
|
+
usePublicFetch,
|
|
24
|
+
} from '../build/public/usePublicFetch'
|
|
10
25
|
|
|
11
26
|
export interface RegistrationForm {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
email: string
|
|
28
|
+
password: string
|
|
29
|
+
name: string
|
|
30
|
+
hasAcceptedLegal: boolean
|
|
31
|
+
/** The visitor chose to add a card later. Only read under `optional`. */
|
|
32
|
+
skipsPaymentMethod: boolean
|
|
18
33
|
}
|
|
19
34
|
|
|
20
35
|
/** Everything the submit guard looks at, independent of how it is bound. */
|
|
21
36
|
export interface RegistrationRequirements {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
isPaymentRequired: boolean
|
|
38
|
+
isPaymentReady: boolean
|
|
39
|
+
hasAcceptedLegal: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The account fields on top of the requirements, for field-level errors. */
|
|
43
|
+
export interface RegistrationFieldState extends RegistrationRequirements {
|
|
44
|
+
name: string
|
|
45
|
+
email: string
|
|
46
|
+
isPasswordValid: boolean
|
|
25
47
|
}
|
|
26
48
|
|
|
49
|
+
/** A field of the registration form an error can be attached to. */
|
|
50
|
+
export type RegistrationField = 'name' | 'email' | 'password' | 'card' | 'legal'
|
|
51
|
+
|
|
52
|
+
/** Translation key of each field's error, for the fields that have one. */
|
|
53
|
+
export type RegistrationFieldErrors = Partial<Record<RegistrationField, string>>
|
|
54
|
+
|
|
27
55
|
export type RegistrationTranslator = (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
) => string
|
|
56
|
+
key: string,
|
|
57
|
+
params?: Record<string, string>,
|
|
58
|
+
) => string
|
|
31
59
|
|
|
32
60
|
export interface UseSaasRegistrationOptions {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
/**
|
|
62
|
+
* In-app route to land on once the workspace is provisioned. Defaults to
|
|
63
|
+
* sign-in, and from there to the upgrade review on Billing when a paid
|
|
64
|
+
* plan was chosen. Landing on another origin is the consumer's own call to
|
|
65
|
+
* make, from the tenant id `submit()` returns.
|
|
66
|
+
*/
|
|
67
|
+
redirectTo?: string
|
|
68
|
+
/**
|
|
69
|
+
* DOM id the Stripe payment element mounts into. Consumers that render
|
|
70
|
+
* several registration surfaces on one page must give distinct ids.
|
|
71
|
+
*/
|
|
72
|
+
paymentElementId?: string
|
|
73
|
+
/**
|
|
74
|
+
* Whatever the consuming SaaS captures on top of the account fields, read
|
|
75
|
+
* when the visitor submits. It stays the consumer's data: dms-saas forwards
|
|
76
|
+
* it inside the provisioning transaction, to the consumer's own
|
|
77
|
+
* `TENANT_BEING_PROVISIONED` listener, and neither reads nor stores it. A
|
|
78
|
+
* listener that fails to write it cancels the whole registration.
|
|
79
|
+
*
|
|
80
|
+
* Keep it to what a form captures — the endpoint is public, so the API caps
|
|
81
|
+
* its serialised size, depth and number of keys and answers 400 above them.
|
|
82
|
+
*/
|
|
83
|
+
extras?: MaybeRefOrGetter<Record<string, unknown> | undefined>
|
|
84
|
+
/** Slug or id of the plan chosen on Pricing; defaults to `?plan=`. */
|
|
85
|
+
plan?: MaybeRefOrGetter<string | null | undefined>
|
|
55
86
|
}
|
|
56
87
|
|
|
57
|
-
interface
|
|
58
|
-
|
|
59
|
-
|
|
88
|
+
interface RegistrationRule {
|
|
89
|
+
field: RegistrationField
|
|
90
|
+
errorKey: string
|
|
91
|
+
isMet: (state: RegistrationFieldState) => boolean
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
interface RegistrationPayload {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
95
|
+
email: string
|
|
96
|
+
password: string
|
|
97
|
+
name: string
|
|
98
|
+
workspaceName: string
|
|
99
|
+
paymentMethodId?: string
|
|
100
|
+
/**
|
|
101
|
+
* The plan chosen on Pricing: the API opens the workspace on it, awaiting
|
|
102
|
+
* its first payment, when the card already backs every free workspace it
|
|
103
|
+
* may.
|
|
104
|
+
*/
|
|
105
|
+
requestedPlanId?: string
|
|
106
|
+
extras?: Record<string, unknown>
|
|
69
107
|
}
|
|
70
108
|
|
|
71
109
|
/** Everything but the card, which only exists once Stripe has confirmed it. */
|
|
72
|
-
type RegistrationSubmission = Omit<RegistrationPayload,
|
|
110
|
+
type RegistrationSubmission = Omit<RegistrationPayload, 'paymentMethodId'>
|
|
73
111
|
|
|
74
112
|
interface RegistrationResult {
|
|
75
|
-
|
|
113
|
+
tenantId: string
|
|
76
114
|
}
|
|
77
115
|
|
|
78
116
|
interface SetupIntentResponse {
|
|
79
|
-
|
|
117
|
+
clientSecret: string | null
|
|
80
118
|
}
|
|
81
119
|
|
|
82
|
-
type PaymentStepRule = (skipsPaymentMethod: boolean) => boolean
|
|
83
|
-
|
|
84
|
-
const SETUP_INTENT_ENDPOINT =
|
|
85
|
-
const REGISTER_ENDPOINT =
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const DEFAULT_PAYMENT_POLICY: RegistrationPaymentMethodPolicy =
|
|
89
|
-
const INVITATION_ONLY =
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
type PaymentStepRule = (skipsPaymentMethod: boolean) => boolean
|
|
121
|
+
|
|
122
|
+
const SETUP_INTENT_ENDPOINT = '/api/saas/register/setup-intent'
|
|
123
|
+
const REGISTER_ENDPOINT = '/api/saas/register'
|
|
124
|
+
const REGISTRATION_PLAN_ENDPOINT = '/api/saas/register/plan'
|
|
125
|
+
const DEFAULT_PAYMENT_ELEMENT_ID = 'dms-saas-register-payment-element'
|
|
126
|
+
const DEFAULT_PAYMENT_POLICY: RegistrationPaymentMethodPolicy = 'required'
|
|
127
|
+
const INVITATION_ONLY = 'invitation-only'
|
|
128
|
+
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
|
129
|
+
const DEFAULT_WORKSPACE_NAME_KEY = 'saas.public.register.default_workspace_name'
|
|
130
|
+
const NO_PAYMENT_ERROR_KEY = 'saas.public.register.error.card_required'
|
|
131
|
+
const LOAD_ERROR_KEY = 'saas.public.register.error.load'
|
|
132
|
+
const SUBMIT_ERROR_KEY = 'saas.public.register.error.failed'
|
|
133
|
+
const PASSWORD_POLICY_ERROR_KEY = 'saas.errors.registration.password_policy'
|
|
134
|
+
|
|
135
|
+
const PAYMENT_STEP_RULES: Record<
|
|
136
|
+
RegistrationPaymentMethodPolicy,
|
|
137
|
+
PaymentStepRule
|
|
138
|
+
> = {
|
|
139
|
+
required: () => true,
|
|
140
|
+
optional: (skipsPaymentMethod) => !skipsPaymentMethod,
|
|
141
|
+
none: () => false,
|
|
142
|
+
}
|
|
102
143
|
|
|
103
144
|
/**
|
|
104
145
|
* Checked in the order the visitor can act on them: the card field comes
|
|
105
146
|
* before the legal checkbox on every screen.
|
|
106
147
|
*/
|
|
107
|
-
const REGISTRATION_REQUIREMENTS:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
148
|
+
const REGISTRATION_REQUIREMENTS: RegistrationRule[] = [
|
|
149
|
+
{
|
|
150
|
+
field: 'card',
|
|
151
|
+
errorKey: NO_PAYMENT_ERROR_KEY,
|
|
152
|
+
isMet: (state) => !state.isPaymentRequired || state.isPaymentReady,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
field: 'legal',
|
|
156
|
+
errorKey: 'saas.public.register.error.legal_required',
|
|
157
|
+
isMet: (state) => state.hasAcceptedLegal,
|
|
158
|
+
},
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
/** The account fields, in form order, ahead of the requirements. */
|
|
162
|
+
const ACCOUNT_RULES: RegistrationRule[] = [
|
|
163
|
+
{
|
|
164
|
+
field: 'name',
|
|
165
|
+
errorKey: 'saas.public.register.error.name_required',
|
|
166
|
+
isMet: (state) => state.name.trim().length > 0,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
field: 'email',
|
|
170
|
+
errorKey: 'saas.public.register.error.email_invalid',
|
|
171
|
+
isMet: (state) => EMAIL_PATTERN.test(state.email.trim()),
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
field: 'password',
|
|
175
|
+
errorKey: PASSWORD_POLICY_ERROR_KEY,
|
|
176
|
+
isMet: (state) => state.isPasswordValid,
|
|
177
|
+
},
|
|
178
|
+
]
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The server's refusals that are about one field: shown next to it rather
|
|
182
|
+
* than above the form.
|
|
183
|
+
*/
|
|
184
|
+
const API_ERROR_FIELDS: Record<string, RegistrationField> = {
|
|
185
|
+
'saas.errors.user.email_in_use': 'email',
|
|
186
|
+
'saas.errors.registration.password_policy': 'password',
|
|
187
|
+
'saas.errors.registration.payment_method_required': 'card',
|
|
188
|
+
'saas.errors.workspace.free_card_limit_reached': 'card',
|
|
189
|
+
}
|
|
118
190
|
|
|
119
191
|
/**
|
|
120
192
|
* The one guard a consumer cannot get wrong on its own: the first requirement
|
|
@@ -124,12 +196,34 @@ const REGISTRATION_REQUIREMENTS: RegistrationRequirement[] = [
|
|
|
124
196
|
* @returns Translation key of the first unmet requirement, or null
|
|
125
197
|
*/
|
|
126
198
|
export function firstMissingRegistrationRequirement(
|
|
127
|
-
|
|
199
|
+
requirements: RegistrationRequirements,
|
|
128
200
|
): string | null {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
201
|
+
const state = { ...requirements, name: '', email: '', isPasswordValid: true }
|
|
202
|
+
const missing = REGISTRATION_REQUIREMENTS.find((rule) => !rule.isMet(state))
|
|
203
|
+
return missing?.errorKey ?? null
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Every field the visitor still has to fix, each with its error key, so the
|
|
208
|
+
* form can mark them all at once and count them in its summary.
|
|
209
|
+
*
|
|
210
|
+
* @param state Current state of the registration form
|
|
211
|
+
*/
|
|
212
|
+
export function missingRegistrationFields(
|
|
213
|
+
state: RegistrationFieldState,
|
|
214
|
+
): RegistrationFieldErrors {
|
|
215
|
+
return Object.fromEntries(
|
|
216
|
+
[...ACCOUNT_RULES, ...REGISTRATION_REQUIREMENTS]
|
|
217
|
+
.filter((rule) => !rule.isMet(state))
|
|
218
|
+
.map((rule) => [rule.field, rule.errorKey]),
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** The field a server refusal is about, or null for a form-wide failure. */
|
|
223
|
+
export function registrationFieldOf(
|
|
224
|
+
errorKey: string | undefined,
|
|
225
|
+
): RegistrationField | null {
|
|
226
|
+
return (errorKey && API_ERROR_FIELDS[errorKey]) || null
|
|
133
227
|
}
|
|
134
228
|
|
|
135
229
|
/**
|
|
@@ -140,10 +234,12 @@ export function firstMissingRegistrationRequirement(
|
|
|
140
234
|
* @returns The configured policy, or `required`
|
|
141
235
|
*/
|
|
142
236
|
export function resolveRegistrationPaymentPolicy(
|
|
143
|
-
|
|
237
|
+
config: DmsSaasPublicRuntimeConfig | undefined,
|
|
144
238
|
): RegistrationPaymentMethodPolicy {
|
|
145
|
-
|
|
146
|
-
|
|
239
|
+
const policy = config?.registrationPaymentMethod
|
|
240
|
+
return policy && policy in PAYMENT_STEP_RULES
|
|
241
|
+
? policy
|
|
242
|
+
: DEFAULT_PAYMENT_POLICY
|
|
147
243
|
}
|
|
148
244
|
|
|
149
245
|
/**
|
|
@@ -154,10 +250,10 @@ export function resolveRegistrationPaymentPolicy(
|
|
|
154
250
|
* @returns True when the card step is shown and must be completed
|
|
155
251
|
*/
|
|
156
252
|
export function isPaymentStepShown(
|
|
157
|
-
|
|
158
|
-
|
|
253
|
+
policy: RegistrationPaymentMethodPolicy,
|
|
254
|
+
skipsPaymentMethod: boolean,
|
|
159
255
|
): boolean {
|
|
160
|
-
|
|
256
|
+
return PAYMENT_STEP_RULES[policy](skipsPaymentMethod)
|
|
161
257
|
}
|
|
162
258
|
|
|
163
259
|
/**
|
|
@@ -167,9 +263,23 @@ export function isPaymentStepShown(
|
|
|
167
263
|
* @returns True when only invited accounts may sign up
|
|
168
264
|
*/
|
|
169
265
|
export function isRegistrationClosedBy(
|
|
170
|
-
|
|
266
|
+
config: DmsSaasPublicRuntimeConfig | undefined,
|
|
171
267
|
): boolean {
|
|
172
|
-
|
|
268
|
+
return config?.admissionMode === INVITATION_ONLY
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Where a new account lands: sign-in, then the upgrade review on Billing
|
|
273
|
+
* when the visitor chose a paid plan on Pricing.
|
|
274
|
+
*
|
|
275
|
+
* @param summary The registration plan summary, when it loaded
|
|
276
|
+
*/
|
|
277
|
+
export function registrationLandingPath(
|
|
278
|
+
summary: RegistrationPlanSummary | null,
|
|
279
|
+
): string {
|
|
280
|
+
const requested = summary?.requestedPlan
|
|
281
|
+
if (!requested || !isPaidPlan(requested)) return LOGIN_PATH
|
|
282
|
+
return loginPathThen(billingUpgradePath(requested._id))
|
|
173
283
|
}
|
|
174
284
|
|
|
175
285
|
/**
|
|
@@ -184,10 +294,48 @@ export function isRegistrationClosedBy(
|
|
|
184
294
|
* @returns A detached copy, or undefined when there is nothing to send
|
|
185
295
|
*/
|
|
186
296
|
export function snapshotRegistrationExtras(
|
|
187
|
-
|
|
297
|
+
extras: Record<string, unknown> | undefined,
|
|
188
298
|
): Record<string, unknown> | undefined {
|
|
189
|
-
|
|
190
|
-
|
|
299
|
+
if (!extras || Object.keys(extras).length === 0) return undefined
|
|
300
|
+
return JSON.parse(JSON.stringify(extras)) as Record<string, unknown>
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* The plan a registration opens the workspace on, and the one chosen on
|
|
305
|
+
* Pricing, loaded for display. The chosen plan is remembered for the tab, so
|
|
306
|
+
* the OAuth round-trip back to "Set up your first workspace" keeps it.
|
|
307
|
+
*
|
|
308
|
+
* @param planReference Slug or id of the chosen plan
|
|
309
|
+
*/
|
|
310
|
+
export function useSaasRegistrationPlan(
|
|
311
|
+
planReference: MaybeRefOrGetter<string | null | undefined>,
|
|
312
|
+
) {
|
|
313
|
+
const publicFetch = usePublicFetch()
|
|
314
|
+
const { resolveApiError } = useApiErrorMessage()
|
|
315
|
+
const summary = ref<RegistrationPlanSummary | null>(null)
|
|
316
|
+
const isLoading = ref(false)
|
|
317
|
+
const loadError = ref<string | null>(null)
|
|
318
|
+
|
|
319
|
+
async function load(): Promise<void> {
|
|
320
|
+
isLoading.value = true
|
|
321
|
+
loadError.value = null
|
|
322
|
+
const plan = toValue(planReference) || undefined
|
|
323
|
+
try {
|
|
324
|
+
summary.value = await publicFetch<RegistrationPlanSummary>(
|
|
325
|
+
REGISTRATION_PLAN_ENDPOINT,
|
|
326
|
+
{ query: plan ? { [REGISTER_PLAN_PARAM]: plan } : {} },
|
|
327
|
+
)
|
|
328
|
+
rememberChosenPlan(summary.value.requestedPlan?._id ?? null)
|
|
329
|
+
} catch (error) {
|
|
330
|
+
loadError.value = resolveApiError(error, LOAD_ERROR_KEY)
|
|
331
|
+
} finally {
|
|
332
|
+
isLoading.value = false
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
onPublicLocaleChange(load)
|
|
337
|
+
|
|
338
|
+
return { summary, isLoading, loadError, load }
|
|
191
339
|
}
|
|
192
340
|
|
|
193
341
|
/**
|
|
@@ -195,216 +343,283 @@ export function snapshotRegistrationExtras(
|
|
|
195
343
|
*
|
|
196
344
|
* Registration is short on purpose: an account, the legal acceptance and —
|
|
197
345
|
* when the deployment asks for one — a card. The workspace it opens lands on
|
|
198
|
-
* the free plan under a default name; plan
|
|
199
|
-
*
|
|
346
|
+
* the free plan under a default name; a paid plan chosen on Pricing is
|
|
347
|
+
* reviewed on Billing right after, where plan, customer type and billing
|
|
348
|
+
* address are collected.
|
|
200
349
|
*
|
|
201
350
|
* dms-saas owns what is dangerous to re-derive — the card policy, the Stripe
|
|
202
351
|
* setup intent and card confirmation, the order the fields are validated in,
|
|
203
352
|
* the shape of the provisioning call, the mapping from API failures to a
|
|
204
|
-
*
|
|
205
|
-
*
|
|
353
|
+
* field — and hands the consumer plain state to bind and one action to call.
|
|
354
|
+
* Each SaaS then writes the markup its conversion funnel needs.
|
|
206
355
|
*
|
|
207
356
|
* The screen shipped in this package is one consumer among others: replace it
|
|
208
357
|
* by turning it off (`publicScreens.register: false` in the module config) and
|
|
209
358
|
* registering your own page on the `register` slug, then build the markup you
|
|
210
359
|
* want on this composable rather than forking its logic.
|
|
211
360
|
*
|
|
212
|
-
* @param options Landing route
|
|
213
|
-
* @returns Bindable form state, card policy, submission action and status
|
|
361
|
+
* @param options Landing route, payment element id, extras and chosen plan
|
|
362
|
+
* @returns Bindable form state, card policy, plan, submission action and status
|
|
214
363
|
*/
|
|
215
364
|
export function useSaasRegistration(options: UseSaasRegistrationOptions = {}) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
365
|
+
const { $authFetch } = useAuthFetch()
|
|
366
|
+
const { resolveApiError } = useApiErrorMessage()
|
|
367
|
+
const { $i18n } = useDmsApp()
|
|
368
|
+
const config = useDmsRuntimeConfig()
|
|
369
|
+
const route = useDmsRoute()
|
|
370
|
+
|
|
371
|
+
const translate: RegistrationTranslator = (key, params) =>
|
|
372
|
+
params ? $i18n.t(key, params) : $i18n.t(key)
|
|
373
|
+
|
|
374
|
+
const paymentElementId =
|
|
375
|
+
options.paymentElementId ?? DEFAULT_PAYMENT_ELEMENT_ID
|
|
376
|
+
const saasConfig = config.public.dmsSaas as
|
|
377
|
+
| DmsSaasPublicRuntimeConfig
|
|
378
|
+
| undefined
|
|
379
|
+
|
|
380
|
+
const form = reactive<RegistrationForm>({
|
|
381
|
+
email: '',
|
|
382
|
+
password: '',
|
|
383
|
+
name: '',
|
|
384
|
+
hasAcceptedLegal: false,
|
|
385
|
+
skipsPaymentMethod: false,
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
const isLoading = ref(true)
|
|
389
|
+
const isSubmitting = ref(false)
|
|
390
|
+
const hasTriedSubmit = ref(false)
|
|
391
|
+
const errorMessage = ref<string | null>(null)
|
|
392
|
+
const serverFieldErrors = ref<RegistrationFieldErrors>({})
|
|
393
|
+
const stripeHandle = ref<ReturnType<typeof useStripePaymentElement> | null>(
|
|
394
|
+
null,
|
|
395
|
+
)
|
|
396
|
+
const plan = useSaasRegistrationPlan(
|
|
397
|
+
options.plan ?? (() => readQueryString(route.query[REGISTER_PLAN_PARAM])),
|
|
398
|
+
)
|
|
399
|
+
|
|
400
|
+
/** Registration by invitation only: render the closed state, not the form. */
|
|
401
|
+
const isRegistrationClosed = isRegistrationClosedBy(saasConfig)
|
|
402
|
+
const paymentMethodPolicy = resolveRegistrationPaymentPolicy(saasConfig)
|
|
403
|
+
/** Whether the screen should offer to add the card later. */
|
|
404
|
+
const canSkipPaymentMethod = paymentMethodPolicy === 'optional'
|
|
405
|
+
|
|
406
|
+
/** Bind the card field's visibility to this, with `v-show`, not `v-if`. */
|
|
407
|
+
const isPaymentStepVisible = computed(() =>
|
|
408
|
+
isPaymentStepShown(paymentMethodPolicy, form.skipsPaymentMethod),
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Whether the card field has been wired to Stripe — false as long as the
|
|
413
|
+
* publishable key or the setup intent is missing.
|
|
414
|
+
*/
|
|
415
|
+
const isPaymentReady = computed(() => stripeHandle.value !== null)
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* DMS's password rules, scored for `<DmsPasswordRules>`. The API holds the
|
|
419
|
+
* password to the same policy.
|
|
420
|
+
*/
|
|
421
|
+
const passwordStrength = usePasswordStrength(toRef(form, 'password'))
|
|
422
|
+
|
|
423
|
+
const fieldState = computed<RegistrationFieldState>(() => ({
|
|
424
|
+
name: form.name,
|
|
425
|
+
email: form.email,
|
|
426
|
+
isPasswordValid: passwordSchema.safeParse(form.password).success,
|
|
427
|
+
isPaymentRequired: isPaymentStepVisible.value,
|
|
428
|
+
isPaymentReady: isPaymentReady.value,
|
|
429
|
+
hasAcceptedLegal: form.hasAcceptedLegal,
|
|
430
|
+
}))
|
|
431
|
+
|
|
432
|
+
const missingFields = computed(() =>
|
|
433
|
+
missingRegistrationFields(fieldState.value),
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* The errors to show next to each field: what is still missing once the
|
|
438
|
+
* visitor tried to submit, and what the server refused.
|
|
439
|
+
*/
|
|
440
|
+
const fieldErrors = computed<RegistrationFieldErrors>(() => ({
|
|
441
|
+
...(hasTriedSubmit.value ? missingFields.value : {}),
|
|
442
|
+
...serverFieldErrors.value,
|
|
443
|
+
}))
|
|
444
|
+
|
|
445
|
+
const fieldErrorCount = computed(() => Object.keys(fieldErrors.value).length)
|
|
446
|
+
|
|
447
|
+
// The password comes first: a card confirmed for a registration the API
|
|
448
|
+
// then refuses would be confirmed for nothing.
|
|
449
|
+
const missingRequirement = computed(
|
|
450
|
+
() => Object.values(missingFields.value)[0] ?? null,
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
const canSubmit = computed(
|
|
454
|
+
() => !isSubmitting.value && missingRequirement.value === null,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
function clearServerError(field: RegistrationField): void {
|
|
458
|
+
if (!serverFieldErrors.value[field]) return
|
|
459
|
+
const { [field]: _cleared, ...rest } = serverFieldErrors.value
|
|
460
|
+
serverFieldErrors.value = rest
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
async function mountPaymentElement(): Promise<void> {
|
|
464
|
+
const publishableKey = saasConfig?.stripePublishableKey
|
|
465
|
+
if (!publishableKey) return
|
|
466
|
+
const setup = await $authFetch<SetupIntentResponse>(SETUP_INTENT_ENDPOINT)
|
|
467
|
+
if (!setup.clientSecret) return
|
|
468
|
+
stripeHandle.value = useStripePaymentElement({
|
|
469
|
+
publishableKey,
|
|
470
|
+
clientSecret: setup.clientSecret,
|
|
471
|
+
containerId: paymentElementId,
|
|
472
|
+
billingEmail: () => form.email,
|
|
473
|
+
})
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
async function confirmPaymentMethod(): Promise<string | null> {
|
|
477
|
+
const confirmation = await stripeHandle.value?.confirmAndGetPaymentMethod()
|
|
478
|
+
if (confirmation?.paymentMethodId) return confirmation.paymentMethodId
|
|
479
|
+
serverFieldErrors.value = {
|
|
480
|
+
...serverFieldErrors.value,
|
|
481
|
+
card: confirmation?.error?.message ?? NO_PAYMENT_ERROR_KEY,
|
|
482
|
+
}
|
|
483
|
+
return null
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* The form as it stood when the visitor submitted.
|
|
488
|
+
*
|
|
489
|
+
* Taken whole, before the card confirmation: that step can hold a 3-D Secure
|
|
490
|
+
* challenge open for seconds while the fields stay editable, and a payload
|
|
491
|
+
* half read before and half after would not be the one the visitor sent.
|
|
492
|
+
*/
|
|
493
|
+
function captureSubmission(): RegistrationSubmission {
|
|
494
|
+
return {
|
|
495
|
+
email: form.email.trim(),
|
|
496
|
+
password: form.password,
|
|
497
|
+
name: form.name.trim(),
|
|
498
|
+
workspaceName: translate(DEFAULT_WORKSPACE_NAME_KEY, {
|
|
499
|
+
name: form.name.trim(),
|
|
500
|
+
}),
|
|
501
|
+
requestedPlanId: plan.summary.value?.requestedPlan?._id,
|
|
502
|
+
extras: snapshotRegistrationExtras(toValue(options.extras)),
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function reportFailure(error: unknown): void {
|
|
507
|
+
const field = registrationFieldOf(readApiErrorKey(error))
|
|
508
|
+
if (!field) {
|
|
509
|
+
errorMessage.value = resolveApiError(error, SUBMIT_ERROR_KEY)
|
|
510
|
+
return
|
|
511
|
+
}
|
|
512
|
+
serverFieldErrors.value = {
|
|
513
|
+
...serverFieldErrors.value,
|
|
514
|
+
[field]: readApiErrorKey(error)!,
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
async function provision(
|
|
519
|
+
submission: RegistrationSubmission,
|
|
520
|
+
paymentMethodId: string | undefined,
|
|
521
|
+
): Promise<string | null> {
|
|
522
|
+
const result = await $authFetch<RegistrationResult>(REGISTER_ENDPOINT, {
|
|
523
|
+
method: 'POST',
|
|
524
|
+
body: { ...submission, paymentMethodId },
|
|
525
|
+
})
|
|
526
|
+
return result.tenantId ?? null
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Confirm the card when one is collected, provision the workspace, land on
|
|
531
|
+
* the configured route.
|
|
532
|
+
*
|
|
533
|
+
* Everything the caller needs to know travels through `errorMessage` and
|
|
534
|
+
* `fieldErrors`: nothing throws, so a consumer template can bind the action
|
|
535
|
+
* directly.
|
|
536
|
+
*
|
|
537
|
+
* @returns Tenant id when the workspace was provisioned, null otherwise
|
|
538
|
+
*/
|
|
539
|
+
async function submit(): Promise<string | null> {
|
|
540
|
+
// A card is confirmed and an account created in here: a second call while
|
|
541
|
+
// the first is in flight would run both again.
|
|
542
|
+
if (isSubmitting.value) return null
|
|
543
|
+
hasTriedSubmit.value = true
|
|
544
|
+
serverFieldErrors.value = {}
|
|
545
|
+
errorMessage.value = null
|
|
546
|
+
if (missingRequirement.value) return null
|
|
547
|
+
|
|
548
|
+
isSubmitting.value = true
|
|
549
|
+
let tenantId: string | null = null
|
|
550
|
+
try {
|
|
551
|
+
// Inside the guard: freezing the capture reads the consumer's object,
|
|
552
|
+
// and a consumer's object is never guaranteed to be serialisable.
|
|
553
|
+
const submission = captureSubmission()
|
|
554
|
+
const paymentMethodId = isPaymentStepVisible.value
|
|
555
|
+
? await confirmPaymentMethod()
|
|
556
|
+
: undefined
|
|
557
|
+
if (paymentMethodId === null) return null
|
|
558
|
+
tenantId = await provision(submission, paymentMethodId)
|
|
559
|
+
if (tenantId) {
|
|
560
|
+
await navigateDms(
|
|
561
|
+
options.redirectTo ?? registrationLandingPath(plan.summary.value),
|
|
562
|
+
)
|
|
563
|
+
}
|
|
564
|
+
return tenantId
|
|
565
|
+
} catch (error) {
|
|
566
|
+
// Once the workspace exists, whatever failed after it is a landing
|
|
567
|
+
// problem: calling it a failed registration sends the visitor back
|
|
568
|
+
// through a flow that would create a second account.
|
|
569
|
+
if (tenantId) return tenantId
|
|
570
|
+
reportFailure(error)
|
|
571
|
+
return null
|
|
572
|
+
} finally {
|
|
573
|
+
isSubmitting.value = false
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
onMounted(async () => {
|
|
578
|
+
// Closed registration and a card-less policy never reach Stripe: the
|
|
579
|
+
// setup intent would only answer 403 or 400.
|
|
580
|
+
if (isRegistrationClosed) {
|
|
581
|
+
isLoading.value = false
|
|
582
|
+
return
|
|
583
|
+
}
|
|
584
|
+
void plan.load()
|
|
585
|
+
if (paymentMethodPolicy === 'none') {
|
|
586
|
+
isLoading.value = false
|
|
587
|
+
return
|
|
588
|
+
}
|
|
589
|
+
try {
|
|
590
|
+
await mountPaymentElement()
|
|
591
|
+
} catch (error) {
|
|
592
|
+
errorMessage.value = resolveApiError(error, LOAD_ERROR_KEY)
|
|
593
|
+
} finally {
|
|
594
|
+
isLoading.value = false
|
|
595
|
+
}
|
|
596
|
+
})
|
|
597
|
+
|
|
598
|
+
return {
|
|
599
|
+
form,
|
|
600
|
+
paymentElementId,
|
|
601
|
+
paymentMethodPolicy,
|
|
602
|
+
canSkipPaymentMethod,
|
|
603
|
+
isPaymentStepVisible,
|
|
604
|
+
isPaymentReady,
|
|
605
|
+
passwordStrength,
|
|
606
|
+
isRegistrationClosed,
|
|
607
|
+
isLoading,
|
|
608
|
+
isSubmitting,
|
|
609
|
+
errorMessage,
|
|
610
|
+
fieldErrors,
|
|
611
|
+
fieldErrorCount,
|
|
612
|
+
clearServerError,
|
|
613
|
+
missingRequirement,
|
|
614
|
+
canSubmit,
|
|
615
|
+
submit,
|
|
616
|
+
planSummary: plan.summary,
|
|
617
|
+
isPlanLoading: plan.isLoading,
|
|
618
|
+
planLoadError: plan.loadError,
|
|
619
|
+
reloadPlan: plan.load,
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function readQueryString(value: unknown): string | null {
|
|
624
|
+
return typeof value === 'string' && value.length > 0 ? value : null
|
|
410
625
|
}
|