@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,122 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DmsSaasPublicRuntimeConfig,
|
|
3
|
+
DmsSaasPublicScreenId,
|
|
4
|
+
} from '../../types/runtime-config'
|
|
5
|
+
|
|
6
|
+
export const LOGIN_PATH = '/auth/login'
|
|
7
|
+
export const REGISTER_PATH = '/register'
|
|
8
|
+
export const PRICING_PATH = '/pricing'
|
|
9
|
+
export const HOME_PATH = '/'
|
|
10
|
+
export const BILLING_PATH = '/settings/workspace/billing'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Query parameter of the Billing page naming the plan a new workspace owner
|
|
14
|
+
* chose on Pricing: the page opens its upgrade review on it.
|
|
15
|
+
*/
|
|
16
|
+
export const BILLING_UPGRADE_PARAM = 'upgrade'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Query parameter of the Billing page asking it to open the plan comparison:
|
|
20
|
+
* how the access-restricted screen sends the owner to choose a plan.
|
|
21
|
+
*/
|
|
22
|
+
export const BILLING_CHOOSE_PLAN_PARAM = 'choose-plan'
|
|
23
|
+
|
|
24
|
+
/** Query parameter of Register naming the plan chosen on Pricing. */
|
|
25
|
+
export const REGISTER_PLAN_PARAM = 'plan'
|
|
26
|
+
|
|
27
|
+
/** Query parameter of a legal page naming where the visitor came from. */
|
|
28
|
+
export const LEGAL_FROM_PARAM = 'from'
|
|
29
|
+
|
|
30
|
+
/** A legal document served publicly, keyed like the legal documents payload. */
|
|
31
|
+
export type LegalDocumentField =
|
|
32
|
+
| 'termsOfUse'
|
|
33
|
+
| 'termsAndConditions'
|
|
34
|
+
| 'privacyPolicy'
|
|
35
|
+
|
|
36
|
+
export interface LegalDocumentLink {
|
|
37
|
+
field: LegalDocumentField
|
|
38
|
+
path: string
|
|
39
|
+
labelKey: string
|
|
40
|
+
summaryKey: string
|
|
41
|
+
/** Footer position, after the core's own links. */
|
|
42
|
+
order: number
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const LEGAL_DOCUMENTS: LegalDocumentLink[] = [
|
|
46
|
+
{
|
|
47
|
+
field: 'termsOfUse',
|
|
48
|
+
path: '/terms-of-use',
|
|
49
|
+
labelKey: 'saas.legal.terms_of_use',
|
|
50
|
+
summaryKey: 'saas.public.legal.summary.terms_of_use',
|
|
51
|
+
order: 100,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
field: 'termsAndConditions',
|
|
55
|
+
path: '/terms-and-conditions',
|
|
56
|
+
labelKey: 'saas.legal.terms_and_conditions',
|
|
57
|
+
summaryKey: 'saas.public.legal.summary.terms_and_conditions',
|
|
58
|
+
order: 200,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
field: 'privacyPolicy',
|
|
62
|
+
path: '/privacy-policy',
|
|
63
|
+
labelKey: 'saas.legal.privacy_policy',
|
|
64
|
+
summaryKey: 'saas.public.legal.summary.privacy_policy',
|
|
65
|
+
order: 300,
|
|
66
|
+
},
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Whether the deployment serves one of the bundled public screens. A backend
|
|
71
|
+
* that publishes no list predates the option and serves them all.
|
|
72
|
+
*
|
|
73
|
+
* @param config dms-saas public runtime config
|
|
74
|
+
* @param screen Screen id
|
|
75
|
+
*/
|
|
76
|
+
export function isPublicScreenServed(
|
|
77
|
+
config: DmsSaasPublicRuntimeConfig | undefined,
|
|
78
|
+
screen: DmsSaasPublicScreenId,
|
|
79
|
+
): boolean {
|
|
80
|
+
return config?.publicScreens?.includes(screen) ?? true
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const INVITATION_ONLY = 'invitation-only'
|
|
84
|
+
|
|
85
|
+
/** Whether a visitor may open a workspace on their own, from Register. */
|
|
86
|
+
export function isSelfRegistrationOpen(
|
|
87
|
+
config: DmsSaasPublicRuntimeConfig | undefined,
|
|
88
|
+
): boolean {
|
|
89
|
+
return (
|
|
90
|
+
config?.admissionMode !== INVITATION_ONLY &&
|
|
91
|
+
isPublicScreenServed(config, 'register')
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Where a new workspace owner reviews the paid plan chosen on Pricing. */
|
|
96
|
+
export function billingUpgradePath(planId: string): string {
|
|
97
|
+
return `${BILLING_PATH}?${BILLING_UPGRADE_PARAM}=${encodeURIComponent(planId)}`
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The Billing page with its plan comparison open. */
|
|
101
|
+
export const BILLING_CHOOSE_PLAN_PATH = `${BILLING_PATH}?${BILLING_CHOOSE_PLAN_PARAM}=1`
|
|
102
|
+
|
|
103
|
+
/** Sign-up link carrying the plan chosen on Pricing. */
|
|
104
|
+
export function registerPathFor(planReference: string): string {
|
|
105
|
+
return `${REGISTER_PATH}?${REGISTER_PLAN_PARAM}=${encodeURIComponent(planReference)}`
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Sign-in, then straight to `destination` once the session exists. */
|
|
109
|
+
export function loginPathThen(destination: string | null): string {
|
|
110
|
+
if (!destination) return LOGIN_PATH
|
|
111
|
+
return `${LOGIN_PATH}?redirect=${encodeURIComponent(destination)}`
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** An in-app path, never another origin: `/x` but not `//x` or `/\x`. */
|
|
115
|
+
export function isInAppPath(value: unknown): value is string {
|
|
116
|
+
return (
|
|
117
|
+
typeof value === 'string' &&
|
|
118
|
+
value.startsWith('/') &&
|
|
119
|
+
!value.startsWith('//') &&
|
|
120
|
+
!value.startsWith('/\\')
|
|
121
|
+
)
|
|
122
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { watch } from 'vue'
|
|
2
|
+
|
|
3
|
+
const CONTENT_LANGUAGE_HEADER = 'x-content-language'
|
|
4
|
+
|
|
5
|
+
interface DmsPublicRuntime {
|
|
6
|
+
baseURL: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Fetch for the anonymous screens, on the DMS API in the reader's locale.
|
|
11
|
+
*
|
|
12
|
+
* Not `$authFetch`: its 401 handling sends a visitor without a session to
|
|
13
|
+
* sign-in, while these screens must show their own state for an expired
|
|
14
|
+
* sign-up token. Called after mount only, so it never runs during SSR, where
|
|
15
|
+
* the API base URL may not be reachable. The locale is read on each request,
|
|
16
|
+
* not when the fetch is created: a visitor who switches language gets the
|
|
17
|
+
* next answer in the new one.
|
|
18
|
+
*/
|
|
19
|
+
export function usePublicFetch() {
|
|
20
|
+
const config = useDmsRuntimeConfig()
|
|
21
|
+
const { locale } = useI18n()
|
|
22
|
+
const dmsRuntime = config.public.dms as DmsPublicRuntime
|
|
23
|
+
return $fetch.create({
|
|
24
|
+
baseURL: dmsRuntime.baseURL,
|
|
25
|
+
onRequest({ options }) {
|
|
26
|
+
const headers = new Headers(options.headers)
|
|
27
|
+
headers.set(CONTENT_LANGUAGE_HEADER, locale.value)
|
|
28
|
+
options.headers = headers
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Runs `reload` each time the reader switches language, so the texts the API
|
|
35
|
+
* localizes (feature names, units) follow the switch without a page reload.
|
|
36
|
+
*
|
|
37
|
+
* @param reload Loads the screen's data again
|
|
38
|
+
*/
|
|
39
|
+
export function onPublicLocaleChange(reload: () => unknown): void {
|
|
40
|
+
const { locale } = useI18n()
|
|
41
|
+
watch(locale, () => {
|
|
42
|
+
void reload()
|
|
43
|
+
})
|
|
44
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { formatMajorUnits } from '../../composables/useMoneyFormat'
|
|
2
|
+
import { type PublicPlan, seatExample } from './pricing'
|
|
3
|
+
|
|
4
|
+
const PRICE_KEYS: Record<PublicPlan['billingMode'], string> = {
|
|
5
|
+
flat: 'saas.public.plan.price.flat',
|
|
6
|
+
seat: 'saas.public.plan.price.seat',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Locale-bound wording of a public plan's price, trial and seat example. */
|
|
10
|
+
export function usePublicPlanFormat() {
|
|
11
|
+
const { t, locale } = useI18n()
|
|
12
|
+
|
|
13
|
+
function money(amount: number, currency: string): string {
|
|
14
|
+
return formatMajorUnits(amount, currency, locale.value, {
|
|
15
|
+
hideWholeAmountDecimals: true,
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function intervalLabel(plan: PublicPlan): string {
|
|
20
|
+
return t(`saas.public.plan.interval.${plan.interval}`)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** `€29 / month`, `€49 / member / month`. */
|
|
24
|
+
function priceLabel(plan: PublicPlan): string {
|
|
25
|
+
return t(PRICE_KEYS[plan.billingMode], {
|
|
26
|
+
price: money(plan.price, plan.currency),
|
|
27
|
+
interval: intervalLabel(plan),
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** `10 members = €490 a month`, or null for a flat price. */
|
|
32
|
+
function seatExampleLabel(plan: PublicPlan): string | null {
|
|
33
|
+
const example = seatExample(plan)
|
|
34
|
+
if (!example) return null
|
|
35
|
+
return t('saas.public.plan.seat_example', {
|
|
36
|
+
seats: String(example.seats),
|
|
37
|
+
total: money(example.total, plan.currency),
|
|
38
|
+
interval: intervalLabel(plan),
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** `14-day free trial`, `Free forever`, or null for a paid plan without trial. */
|
|
43
|
+
function termsLabel(plan: PublicPlan): string | null {
|
|
44
|
+
if (plan.price <= 0) return t('saas.public.plan.free_forever')
|
|
45
|
+
if (plan.trialDays > 0) {
|
|
46
|
+
return t('saas.public.plan.trial', { days: String(plan.trialDays) })
|
|
47
|
+
}
|
|
48
|
+
return null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { money, priceLabel, seatExampleLabel, termsLabel, intervalLabel }
|
|
52
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SegmentCondition,
|
|
3
|
+
SegmentConditionGroup,
|
|
4
|
+
SegmentFieldDefinition,
|
|
5
|
+
SegmentNode,
|
|
6
|
+
SegmentOperator,
|
|
7
|
+
SegmentScope,
|
|
8
|
+
SegmentValueKind,
|
|
9
|
+
SegmentWorkspaceRef,
|
|
10
|
+
} from './types'
|
|
11
|
+
|
|
12
|
+
const ISO_DATE_LENGTH = 10
|
|
13
|
+
const LIST_OPERATORS: readonly SegmentOperator[] = ['in', 'nin']
|
|
14
|
+
const PATH_SEPARATOR = '.'
|
|
15
|
+
|
|
16
|
+
export function isSegmentGroup(
|
|
17
|
+
node: SegmentNode,
|
|
18
|
+
): node is SegmentConditionGroup {
|
|
19
|
+
return (node as SegmentConditionGroup).logical !== undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function isSegmentWorkspaceRef(
|
|
23
|
+
node: SegmentNode,
|
|
24
|
+
): node is SegmentWorkspaceRef {
|
|
25
|
+
return (node as SegmentWorkspaceRef).kind === 'workspaceRef'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isListOperator(operator: SegmentOperator): boolean {
|
|
29
|
+
return LIST_OPERATORS.includes(operator)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function emptySegmentGroup(): SegmentConditionGroup {
|
|
33
|
+
return { logical: 'and', conditions: [] }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The rules from the JSON string or object a field holds. */
|
|
37
|
+
export function parseSegmentGroup(raw: unknown): SegmentConditionGroup {
|
|
38
|
+
let value: unknown = raw
|
|
39
|
+
if (typeof raw === 'string') {
|
|
40
|
+
try {
|
|
41
|
+
value = raw ? JSON.parse(raw) : null
|
|
42
|
+
} catch {
|
|
43
|
+
value = null
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const group = value as Partial<SegmentConditionGroup> | null
|
|
47
|
+
return {
|
|
48
|
+
logical: group?.logical === 'or' ? 'or' : 'and',
|
|
49
|
+
conditions: Array.isArray(group?.conditions) ? [...group.conditions] : [],
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The path of the child at `index` of the node at `parent` ("1.2"). */
|
|
54
|
+
export function childPath(parent: string, index: number): string {
|
|
55
|
+
return parent ? `${parent}${PATH_SEPARATOR}${index}` : String(index)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** A node found by its path, with the fields its level reads. */
|
|
59
|
+
export interface SegmentPlacedNode {
|
|
60
|
+
node: SegmentNode
|
|
61
|
+
scope: SegmentScope
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function childrenOf(node: SegmentNode): SegmentNode[] {
|
|
65
|
+
if (isSegmentWorkspaceRef(node)) return node.conditions.conditions
|
|
66
|
+
if (isSegmentGroup(node)) return node.conditions
|
|
67
|
+
return []
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The node at a path of the rules ("1.0"), or null when it is gone. */
|
|
71
|
+
export function findSegmentNode(
|
|
72
|
+
group: SegmentConditionGroup,
|
|
73
|
+
path: string,
|
|
74
|
+
): SegmentPlacedNode | null {
|
|
75
|
+
let placed: SegmentPlacedNode = { node: group, scope: 'user' }
|
|
76
|
+
for (const index of path.split(PATH_SEPARATOR).map(Number)) {
|
|
77
|
+
const next = childrenOf(placed.node)[index]
|
|
78
|
+
if (!next) return null
|
|
79
|
+
const scope = isSegmentWorkspaceRef(placed.node)
|
|
80
|
+
? 'workspace'
|
|
81
|
+
: placed.scope
|
|
82
|
+
placed = { node: next, scope }
|
|
83
|
+
}
|
|
84
|
+
return placed
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Whether a tree holds at least one condition, at any depth. */
|
|
88
|
+
export function hasSegmentConditions(group: SegmentConditionGroup): boolean {
|
|
89
|
+
return group.conditions.some((node) => {
|
|
90
|
+
if (isSegmentWorkspaceRef(node)) return true
|
|
91
|
+
if (isSegmentGroup(node)) return hasSegmentConditions(node)
|
|
92
|
+
return true
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const DEFAULT_VALUE_BY_KIND: Record<SegmentValueKind, () => unknown> = {
|
|
97
|
+
number: () => 0,
|
|
98
|
+
boolean: () => true,
|
|
99
|
+
date: () => new Date().toISOString().slice(0, ISO_DATE_LENGTH),
|
|
100
|
+
string: () => '',
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The value a rule starts with for a field and an operator. */
|
|
104
|
+
export function defaultSegmentValue(
|
|
105
|
+
field: SegmentFieldDefinition | undefined,
|
|
106
|
+
operator: SegmentOperator,
|
|
107
|
+
): unknown {
|
|
108
|
+
if (isListOperator(operator)) return []
|
|
109
|
+
if (!field) return ''
|
|
110
|
+
const firstOption = field.enumOptions?.[0]?.value
|
|
111
|
+
if (firstOption !== undefined) return firstOption
|
|
112
|
+
return DEFAULT_VALUE_BY_KIND[field.valueKind]()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** A new rule reading `field`, on its first operator. */
|
|
116
|
+
export function newSegmentCondition(
|
|
117
|
+
field: SegmentFieldDefinition | undefined,
|
|
118
|
+
): SegmentCondition {
|
|
119
|
+
const operator = field?.operators[0] ?? 'eq'
|
|
120
|
+
return {
|
|
121
|
+
field: field?.id ?? '',
|
|
122
|
+
operator,
|
|
123
|
+
value: defaultSegmentValue(field, operator),
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** The value kept when a rule moves between a single and a list operator. */
|
|
128
|
+
export function adaptSegmentValue(
|
|
129
|
+
value: unknown,
|
|
130
|
+
operator: SegmentOperator,
|
|
131
|
+
): unknown {
|
|
132
|
+
if (isListOperator(operator)) {
|
|
133
|
+
if (Array.isArray(value)) return value
|
|
134
|
+
return value === '' || value === null || value === undefined ? [] : [value]
|
|
135
|
+
}
|
|
136
|
+
return Array.isArray(value) ? (value[0] ?? '') : value
|
|
137
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export type SegmentOperator =
|
|
2
|
+
| 'eq'
|
|
3
|
+
| 'neq'
|
|
4
|
+
| 'gt'
|
|
5
|
+
| 'gte'
|
|
6
|
+
| 'lt'
|
|
7
|
+
| 'lte'
|
|
8
|
+
| 'in'
|
|
9
|
+
| 'nin'
|
|
10
|
+
| 'contains'
|
|
11
|
+
|
|
12
|
+
export type SegmentLogical = 'and' | 'or'
|
|
13
|
+
export type SegmentQuantifier = 'any' | 'all'
|
|
14
|
+
export type SegmentMemberRole = 'member' | 'owner'
|
|
15
|
+
export type SegmentValueKind = 'string' | 'number' | 'boolean' | 'date'
|
|
16
|
+
export type SegmentFieldType =
|
|
17
|
+
| 'string'
|
|
18
|
+
| 'number'
|
|
19
|
+
| 'boolean'
|
|
20
|
+
| 'date'
|
|
21
|
+
| 'enum'
|
|
22
|
+
| 'enum:plan'
|
|
23
|
+
export type SegmentFieldUnit = 'currency' | 'days' | 'count'
|
|
24
|
+
|
|
25
|
+
/** One value of an enum field, as the server names it. */
|
|
26
|
+
export interface SegmentEnumOption {
|
|
27
|
+
value: string
|
|
28
|
+
labelKey: string
|
|
29
|
+
tone?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A field a rule reads, as `GET /api/saas/segments/fields` lists it. */
|
|
33
|
+
export interface SegmentFieldDefinition {
|
|
34
|
+
id: string
|
|
35
|
+
type: SegmentFieldType
|
|
36
|
+
valueKind: SegmentValueKind
|
|
37
|
+
labelKey: string
|
|
38
|
+
descriptionKey: string
|
|
39
|
+
operators: readonly SegmentOperator[]
|
|
40
|
+
group: string
|
|
41
|
+
icon: string
|
|
42
|
+
enumOptions?: readonly SegmentEnumOption[]
|
|
43
|
+
unit?: SegmentFieldUnit
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface SegmentPlanOption {
|
|
47
|
+
_id: string
|
|
48
|
+
name: string
|
|
49
|
+
currency: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The fields catalog the server answers. */
|
|
53
|
+
export interface SegmentFieldsCatalog {
|
|
54
|
+
fields: SegmentFieldDefinition[]
|
|
55
|
+
userFields: SegmentFieldDefinition[]
|
|
56
|
+
plans: SegmentPlanOption[]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Which fields a level of the rules reads: a user's, or a workspace's. */
|
|
60
|
+
export type SegmentScope = 'user' | 'workspace'
|
|
61
|
+
|
|
62
|
+
export interface SegmentCondition {
|
|
63
|
+
field: string
|
|
64
|
+
operator: SegmentOperator
|
|
65
|
+
value: unknown
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SegmentWorkspaceRef {
|
|
69
|
+
kind: 'workspaceRef'
|
|
70
|
+
quantifier: SegmentQuantifier
|
|
71
|
+
role?: SegmentMemberRole
|
|
72
|
+
conditions: SegmentConditionGroup
|
|
73
|
+
/** Set on an explanation: the user's workspaces meeting the rules. */
|
|
74
|
+
workspaceNames?: string[]
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface SegmentConditionGroup {
|
|
78
|
+
logical: SegmentLogical
|
|
79
|
+
conditions: SegmentNode[]
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type SegmentNode =
|
|
83
|
+
| SegmentCondition
|
|
84
|
+
| SegmentConditionGroup
|
|
85
|
+
| SegmentWorkspaceRef
|
|
86
|
+
|
|
87
|
+
/** A user a preview names among its matches. */
|
|
88
|
+
export interface SegmentPreviewUser {
|
|
89
|
+
_id: string
|
|
90
|
+
name: string
|
|
91
|
+
email: string
|
|
92
|
+
workspaceName: string | null
|
|
93
|
+
isAdded: boolean
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** What `POST /api/saas/segments/preview` answers. */
|
|
97
|
+
export interface SegmentPreview {
|
|
98
|
+
matchCount: number
|
|
99
|
+
totalUsers: number
|
|
100
|
+
savedCount: number | null
|
|
101
|
+
addedCount: number
|
|
102
|
+
removedCount: number
|
|
103
|
+
nodeCounts: Record<string, number>
|
|
104
|
+
signals: { path: string; count: number }[]
|
|
105
|
+
universalPaths: string[]
|
|
106
|
+
sample: SegmentPreviewUser[]
|
|
107
|
+
savedEvaluatedAt: string | null
|
|
108
|
+
evaluatedAt: string
|
|
109
|
+
durationMs: number
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** A piece of a rule read in words: plain text, or a value pill. */
|
|
113
|
+
export interface SegmentWordToken {
|
|
114
|
+
text: string
|
|
115
|
+
/** Drawn as a pill in this tone; plain text without one. */
|
|
116
|
+
tone?: string
|
|
117
|
+
/** Drawn in bold: the field a rule reads. */
|
|
118
|
+
isStrong?: boolean
|
|
119
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { computed, type ComputedRef, type Ref } from 'vue'
|
|
2
|
+
import type {
|
|
3
|
+
SegmentFieldDefinition,
|
|
4
|
+
SegmentFieldsCatalog,
|
|
5
|
+
SegmentScope,
|
|
6
|
+
} from './types'
|
|
7
|
+
|
|
8
|
+
export const SEGMENT_FIELDS_URL = '/api/saas/segments/fields'
|
|
9
|
+
const CATALOG_STATE_KEY = 'saas-segment-fields'
|
|
10
|
+
|
|
11
|
+
const EMPTY_CATALOG: SegmentFieldsCatalog = {
|
|
12
|
+
fields: [],
|
|
13
|
+
userFields: [],
|
|
14
|
+
plans: [],
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SegmentCatalog {
|
|
18
|
+
catalog: ComputedRef<SegmentFieldsCatalog>
|
|
19
|
+
isLoading: ComputedRef<boolean>
|
|
20
|
+
error: Ref<boolean>
|
|
21
|
+
load: () => Promise<unknown>
|
|
22
|
+
refresh: () => Promise<unknown>
|
|
23
|
+
fieldsOf: (scope: SegmentScope) => SegmentFieldDefinition[]
|
|
24
|
+
findField: (
|
|
25
|
+
scope: SegmentScope,
|
|
26
|
+
fieldId: string,
|
|
27
|
+
) => SegmentFieldDefinition | undefined
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The fields a rule can read, fetched once per page whatever the number of
|
|
32
|
+
* builders, rule cells and previews reading it.
|
|
33
|
+
*/
|
|
34
|
+
export function useSegmentCatalog(
|
|
35
|
+
url: string = SEGMENT_FIELDS_URL,
|
|
36
|
+
): SegmentCatalog {
|
|
37
|
+
const { $authFetch } = useAuthFetch()
|
|
38
|
+
const request = useSharedRequest<SegmentFieldsCatalog>(
|
|
39
|
+
`${CATALOG_STATE_KEY}:${url}`,
|
|
40
|
+
() => $authFetch<SegmentFieldsCatalog>(url),
|
|
41
|
+
)
|
|
42
|
+
const catalog = computed(() => request.data.value ?? EMPTY_CATALOG)
|
|
43
|
+
|
|
44
|
+
function fieldsOf(scope: SegmentScope): SegmentFieldDefinition[] {
|
|
45
|
+
return scope === 'user' ? catalog.value.userFields : catalog.value.fields
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
catalog,
|
|
50
|
+
isLoading: computed(() => !request.data.value && !request.error.value),
|
|
51
|
+
error: request.error,
|
|
52
|
+
load: request.load,
|
|
53
|
+
refresh: request.refresh,
|
|
54
|
+
fieldsOf,
|
|
55
|
+
findField: (scope, fieldId) =>
|
|
56
|
+
fieldsOf(scope).find((field) => field.id === fieldId),
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import type { SegmentConditionGroup, SegmentPreview } from './types'
|
|
3
|
+
|
|
4
|
+
const DRAFT_STATE_KEY = 'saas-segment-draft'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The rules being edited and their preview, shared by the editor's builder
|
|
8
|
+
* (which writes the rules and reads the counts) and the live preview (which
|
|
9
|
+
* reads the rules and writes the counts): two blocks of one page.
|
|
10
|
+
*/
|
|
11
|
+
export interface SegmentDraft {
|
|
12
|
+
conditions: Ref<SegmentConditionGroup | null>
|
|
13
|
+
preview: Ref<SegmentPreview | null>
|
|
14
|
+
/** A recount for the latest edit is on its way. */
|
|
15
|
+
isRecounting: Ref<boolean>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function useSegmentDraft(): SegmentDraft {
|
|
19
|
+
return {
|
|
20
|
+
conditions: useDmsState<SegmentConditionGroup | null>(
|
|
21
|
+
`${DRAFT_STATE_KEY}:conditions`,
|
|
22
|
+
() => null,
|
|
23
|
+
),
|
|
24
|
+
preview: useDmsState<SegmentPreview | null>(
|
|
25
|
+
`${DRAFT_STATE_KEY}:preview`,
|
|
26
|
+
() => null,
|
|
27
|
+
),
|
|
28
|
+
isRecounting: useDmsState<boolean>(
|
|
29
|
+
`${DRAFT_STATE_KEY}:recounting`,
|
|
30
|
+
() => false,
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
2
|
+
import { hasSegmentConditions } from './tree'
|
|
3
|
+
import type { SegmentPreview } from './types'
|
|
4
|
+
import { useSegmentDraft } from './useSegmentDraft'
|
|
5
|
+
|
|
6
|
+
const PREVIEW_URL = '/api/saas/segments/preview'
|
|
7
|
+
const RECOUNT_DELAY_MS = 500
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Recounts the rules being edited, without saving them: on each edit, once
|
|
11
|
+
* typing pauses, and after the form saved (the saved version changed).
|
|
12
|
+
*/
|
|
13
|
+
export function useSegmentPreview(segmentId: () => string | undefined) {
|
|
14
|
+
const { $authFetch } = useAuthFetch()
|
|
15
|
+
const draft = useSegmentDraft()
|
|
16
|
+
const hasFailed = ref(false)
|
|
17
|
+
const recountedAt = ref<Date | null>(null)
|
|
18
|
+
let timer: ReturnType<typeof setTimeout> | null = null
|
|
19
|
+
let latestRequest = 0
|
|
20
|
+
|
|
21
|
+
const hasRules = computed(
|
|
22
|
+
() =>
|
|
23
|
+
!!draft.conditions.value && hasSegmentConditions(draft.conditions.value),
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
async function recount(): Promise<void> {
|
|
27
|
+
const conditions = draft.conditions.value
|
|
28
|
+
if (!conditions || !hasSegmentConditions(conditions)) {
|
|
29
|
+
draft.preview.value = null
|
|
30
|
+
draft.isRecounting.value = false
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
const request = ++latestRequest
|
|
34
|
+
draft.isRecounting.value = true
|
|
35
|
+
try {
|
|
36
|
+
const preview = await $authFetch<SegmentPreview>(PREVIEW_URL, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
body: { conditions, segmentId: segmentId() },
|
|
39
|
+
})
|
|
40
|
+
if (request !== latestRequest) return
|
|
41
|
+
draft.preview.value = preview
|
|
42
|
+
recountedAt.value = new Date()
|
|
43
|
+
hasFailed.value = false
|
|
44
|
+
} catch {
|
|
45
|
+
if (request === latestRequest) hasFailed.value = true
|
|
46
|
+
} finally {
|
|
47
|
+
if (request === latestRequest) draft.isRecounting.value = false
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function scheduleRecount(): void {
|
|
52
|
+
if (timer) clearTimeout(timer)
|
|
53
|
+
draft.isRecounting.value = hasRules.value
|
|
54
|
+
timer = setTimeout(() => void recount(), RECOUNT_DELAY_MS)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const onSaved = () => void recount()
|
|
58
|
+
|
|
59
|
+
watch(() => JSON.stringify(draft.conditions.value), scheduleRecount)
|
|
60
|
+
onMounted(() => {
|
|
61
|
+
window.addEventListener(FormEvents.SUBMIT_SUCCESS, onSaved)
|
|
62
|
+
scheduleRecount()
|
|
63
|
+
})
|
|
64
|
+
onBeforeUnmount(() => {
|
|
65
|
+
if (timer) clearTimeout(timer)
|
|
66
|
+
window.removeEventListener(FormEvents.SUBMIT_SUCCESS, onSaved)
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
preview: draft.preview,
|
|
71
|
+
isRecounting: draft.isRecounting,
|
|
72
|
+
conditions: draft.conditions,
|
|
73
|
+
hasRules,
|
|
74
|
+
hasFailed,
|
|
75
|
+
recountedAt,
|
|
76
|
+
recount,
|
|
77
|
+
}
|
|
78
|
+
}
|