@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toMinorUnits = toMinorUnits;
|
|
4
|
+
exports.fromMinorUnits = fromMinorUnits;
|
|
5
|
+
const DEFAULT_MINOR_DIGITS = 2;
|
|
6
|
+
const DECIMAL_BASE = 10;
|
|
7
|
+
function currencyMinorDigits(currency) {
|
|
8
|
+
try {
|
|
9
|
+
return (new Intl.NumberFormat("en", {
|
|
10
|
+
style: "currency",
|
|
11
|
+
currency: currency.toUpperCase(),
|
|
12
|
+
}).resolvedOptions().maximumFractionDigits ?? DEFAULT_MINOR_DIGITS);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return DEFAULT_MINOR_DIGITS;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function toMinorUnits(amount, currency) {
|
|
19
|
+
return Math.round(amount * DECIMAL_BASE ** currencyMinorDigits(currency));
|
|
20
|
+
}
|
|
21
|
+
function fromMinorUnits(amount, currency) {
|
|
22
|
+
return amount / DECIMAL_BASE ** currencyMinorDigits(currency);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=money.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.js","sourceRoot":"","sources":["../../src/utils/money.ts"],"names":[],"mappings":";;AAqBA,oCAEC;AAGD,wCAEC;AA5BD,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,YAAY,GAAG,EAAE,CAAC;AAGxB,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,IAAI,CAAC;QACH,OAAO,CACL,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;YAC1B,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;SACjC,CAAC,CAAC,eAAe,EAAE,CAAC,qBAAqB,IAAI,oBAAoB,CACnE,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,oBAAoB,CAAC;IAC9B,CAAC;AACH,CAAC;AAMD,SAAgB,YAAY,CAAC,MAAc,EAAE,QAAgB;IAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,YAAY,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5E,CAAC;AAGD,SAAgB,cAAc,CAAC,MAAc,EAAE,QAAgB;IAC7D,OAAO,MAAM,GAAG,YAAY,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { SegmentCondition, SegmentConditionGroup, SegmentWorkspaceRef } from "../db";
|
|
2
2
|
export type SegmentNode = SegmentCondition | SegmentConditionGroup | SegmentWorkspaceRef;
|
|
3
|
+
export declare function isSegmentGroup(node: SegmentNode): node is SegmentConditionGroup;
|
|
4
|
+
export declare function isSegmentWorkspaceRef(node: SegmentNode): node is SegmentWorkspaceRef;
|
|
5
|
+
export declare function segmentWorkspacePool(node: SegmentWorkspaceRef, target: Record<string, unknown>): Record<string, unknown>[];
|
|
6
|
+
export declare function evaluateSegmentNode(node: SegmentNode, target: Record<string, unknown>): boolean;
|
|
3
7
|
export declare function evaluateSegmentGroup(group: SegmentConditionGroup | null | undefined, target: Record<string, unknown>): boolean;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSegmentGroup = isSegmentGroup;
|
|
4
|
+
exports.isSegmentWorkspaceRef = isSegmentWorkspaceRef;
|
|
5
|
+
exports.segmentWorkspacePool = segmentWorkspacePool;
|
|
6
|
+
exports.evaluateSegmentNode = evaluateSegmentNode;
|
|
3
7
|
exports.evaluateSegmentGroup = evaluateSegmentGroup;
|
|
4
8
|
const segment_fields_1 = require("./segment-fields");
|
|
5
|
-
function
|
|
9
|
+
function isSegmentGroup(node) {
|
|
6
10
|
return node.logical !== undefined;
|
|
7
11
|
}
|
|
8
|
-
function
|
|
12
|
+
function isSegmentWorkspaceRef(node) {
|
|
9
13
|
return node.kind === "workspaceRef";
|
|
10
14
|
}
|
|
11
15
|
function getFieldValue(target, path) {
|
|
@@ -88,28 +92,31 @@ function evaluateCondition(condition, target) {
|
|
|
88
92
|
const actual = getFieldValue(target, condition.field);
|
|
89
93
|
return handler(actual, condition.value, getKind(condition.field));
|
|
90
94
|
}
|
|
91
|
-
function
|
|
95
|
+
function segmentWorkspacePool(node, target) {
|
|
92
96
|
const all = Array.isArray(target.workspaces)
|
|
93
97
|
? target.workspaces
|
|
94
98
|
: [];
|
|
95
|
-
|
|
99
|
+
return node.role === "owner" ? all.filter((w) => w.isOwner === true) : all;
|
|
100
|
+
}
|
|
101
|
+
function evaluateWorkspaceRef(node, target) {
|
|
102
|
+
const workspaces = segmentWorkspacePool(node, target);
|
|
96
103
|
if (workspaces.length === 0)
|
|
97
104
|
return false;
|
|
98
105
|
return node.quantifier === "all"
|
|
99
106
|
? workspaces.every((w) => evaluateSegmentGroup(node.conditions, w))
|
|
100
107
|
: workspaces.some((w) => evaluateSegmentGroup(node.conditions, w));
|
|
101
108
|
}
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
109
|
+
function evaluateSegmentNode(node, target) {
|
|
110
|
+
if (isSegmentWorkspaceRef(node))
|
|
104
111
|
return evaluateWorkspaceRef(node, target);
|
|
105
|
-
if (
|
|
112
|
+
if (isSegmentGroup(node))
|
|
106
113
|
return evaluateSegmentGroup(node, target);
|
|
107
114
|
return evaluateCondition(node, target);
|
|
108
115
|
}
|
|
109
116
|
function evaluateSegmentGroup(group, target) {
|
|
110
117
|
if (!group?.conditions?.length)
|
|
111
118
|
return false;
|
|
112
|
-
const results = group.conditions.map((node) =>
|
|
119
|
+
const results = group.conditions.map((node) => evaluateSegmentNode(node, target));
|
|
113
120
|
return group.logical === "or"
|
|
114
121
|
? results.some(Boolean)
|
|
115
122
|
: results.every(Boolean);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-evaluator.js","sourceRoot":"","sources":["../../src/utils/segment-evaluator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"segment-evaluator.js","sourceRoot":"","sources":["../../src/utils/segment-evaluator.ts"],"names":[],"mappings":";;AAgBA,wCAIC;AAGD,sDAIC;AAoHD,oDAQC;AAmBD,kDAOC;AAED,oDAWC;AAxLD,qDAA8E;AAU9E,SAAgB,cAAc,CAC5B,IAAiB;IAEjB,OAAQ,IAA8B,CAAC,OAAO,KAAK,SAAS,CAAC;AAC/D,CAAC;AAGD,SAAgB,qBAAqB,CACnC,IAAiB;IAEjB,OAAQ,IAA4B,CAAC,IAAI,KAAK,cAAc,CAAC;AAC/D,CAAC;AAED,SAAS,aAAa,CAAC,MAA+B,EAAE,IAAY;IAClE,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CACL,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CACX,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAC5B,CAAC,CAAE,GAA+B,CAAC,GAAG,CAAC;QACvC,CAAC,CAAC,SAAS,EACf,MAAM,CACP,CAAC;AACN,CAAC;AAED,MAAM,aAAa,GAA0D;IAC3E,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QAChB,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACnD,CAAC;IACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,IAAI,OAAO,KAAK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B,CACjC,IAAiB,EACjB,MAA+B;IAE/B,IAAI,qBAAqB,CAAC,IAAI,CAAC;QAAE,OAAO,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3E,IAAI,cAAc,CAAC,IAAI,CAAC;QAAE,OAAO,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpE,OAAO,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,oBAAoB,CAClC,KAA+C,EAC/C,MAA+B;IAE/B,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM;QAAE,OAAO,KAAK,CAAC;IAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5C,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAClC,CAAC;IACF,OAAO,KAAK,CAAC,OAAO,KAAK,IAAI;QAC3B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QACvB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SegmentCondition, SegmentConditionGroup, SegmentWorkspaceRef } from "../db";
|
|
2
|
+
export interface ExplainedWorkspaceRef extends Omit<SegmentWorkspaceRef, "conditions"> {
|
|
3
|
+
conditions: ExplainedGroup;
|
|
4
|
+
workspaceNames: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface ExplainedGroup extends Omit<SegmentConditionGroup, "conditions"> {
|
|
7
|
+
conditions: ExplainedNode[];
|
|
8
|
+
}
|
|
9
|
+
export type ExplainedNode = SegmentCondition | ExplainedGroup | ExplainedWorkspaceRef;
|
|
10
|
+
export declare function explainSegmentGroup(group: SegmentConditionGroup, target: Record<string, unknown>): ExplainedGroup;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.explainSegmentGroup = explainSegmentGroup;
|
|
4
|
+
const segment_evaluator_1 = require("./segment-evaluator");
|
|
5
|
+
function explainWorkspaceRef(node, target) {
|
|
6
|
+
const meeting = (0, segment_evaluator_1.segmentWorkspacePool)(node, target).filter((workspace) => (0, segment_evaluator_1.evaluateSegmentNode)(node.conditions, workspace));
|
|
7
|
+
const [first] = meeting;
|
|
8
|
+
return {
|
|
9
|
+
...node,
|
|
10
|
+
conditions: first
|
|
11
|
+
? explainSegmentGroup(node.conditions, first)
|
|
12
|
+
: { ...node.conditions, conditions: [] },
|
|
13
|
+
workspaceNames: meeting.map((workspace) => typeof workspace.name === "string" ? workspace.name : ""),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function explainNode(node, target) {
|
|
17
|
+
if ((0, segment_evaluator_1.isSegmentWorkspaceRef)(node))
|
|
18
|
+
return explainWorkspaceRef(node, target);
|
|
19
|
+
if ((0, segment_evaluator_1.isSegmentGroup)(node))
|
|
20
|
+
return explainSegmentGroup(node, target);
|
|
21
|
+
return node;
|
|
22
|
+
}
|
|
23
|
+
function explainSegmentGroup(group, target) {
|
|
24
|
+
return {
|
|
25
|
+
logical: group.logical,
|
|
26
|
+
conditions: group.conditions
|
|
27
|
+
.filter((node) => (0, segment_evaluator_1.evaluateSegmentNode)(node, target))
|
|
28
|
+
.map((node) => explainNode(node, target)),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=segment-explain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment-explain.js","sourceRoot":"","sources":["../../src/utils/segment-explain.ts"],"names":[],"mappings":";;AAuEA,kDAUC;AA5ED,2DAM6B;AA0B7B,SAAS,mBAAmB,CAC1B,IAAyB,EACzB,MAA+B;IAE/B,MAAM,OAAO,GAAG,IAAA,wCAAoB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CA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opejs/interface-dms/base";
|
|
1
2
|
import { type SEGMENT_OPERATORS } from "../db";
|
|
2
3
|
export type SegmentFieldCatalog = "workspace" | "user";
|
|
3
4
|
export type SegmentFieldType = "string" | "number" | "boolean" | "date" | "enum" | "enum:plan";
|
|
4
5
|
export type SegmentValueKind = "string" | "number" | "boolean" | "date";
|
|
6
|
+
export type SegmentFieldGroup = "identity" | "activity" | "memberships" | "workspace" | "billing";
|
|
7
|
+
export interface SegmentEnumOption {
|
|
8
|
+
value: string;
|
|
9
|
+
labelKey: string;
|
|
10
|
+
tone?: Tone;
|
|
11
|
+
}
|
|
12
|
+
type SegmentOperatorId = (typeof SEGMENT_OPERATORS)[number];
|
|
5
13
|
export interface SegmentFieldDefinition {
|
|
6
14
|
id: string;
|
|
7
15
|
type: SegmentFieldType;
|
|
8
16
|
valueKind: SegmentValueKind;
|
|
9
17
|
labelKey: string;
|
|
10
18
|
descriptionKey: string;
|
|
11
|
-
operators: readonly
|
|
12
|
-
|
|
19
|
+
operators: readonly SegmentOperatorId[];
|
|
20
|
+
group: SegmentFieldGroup;
|
|
21
|
+
icon: string;
|
|
22
|
+
enumOptions?: readonly SegmentEnumOption[];
|
|
13
23
|
unit?: "currency" | "days" | "count";
|
|
14
24
|
}
|
|
15
25
|
export declare const SEGMENT_FIELDS: readonly SegmentFieldDefinition[];
|
|
@@ -17,3 +27,4 @@ export declare const USER_SEGMENT_FIELDS: readonly SegmentFieldDefinition[];
|
|
|
17
27
|
export declare function getSegmentFields(catalog: SegmentFieldCatalog): readonly SegmentFieldDefinition[];
|
|
18
28
|
export declare function findSegmentField(fieldId: string, catalog: SegmentFieldCatalog): SegmentFieldDefinition | undefined;
|
|
19
29
|
export declare function findAnySegmentField(fieldId: string): SegmentFieldDefinition | undefined;
|
|
30
|
+
export {};
|
|
@@ -5,201 +5,222 @@ exports.getSegmentFields = getSegmentFields;
|
|
|
5
5
|
exports.findSegmentField = findSegmentField;
|
|
6
6
|
exports.findAnySegmentField = findAnySegmentField;
|
|
7
7
|
const db_1 = require("../db");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const status_vocabulary_1 = require("./status-vocabulary");
|
|
9
|
+
const NUMBER_OPERATORS = ["gt", "gte", "lt", "lte", "eq", "neq"];
|
|
10
|
+
const STRING_OPERATORS = ["contains", "eq", "neq"];
|
|
11
|
+
const ENUM_OPERATORS = ["in", "nin", "eq", "neq"];
|
|
11
12
|
const BOOLEAN_OPERATORS = ["eq"];
|
|
12
13
|
const DATE_OPERATORS = ["gt", "gte", "lt", "lte"];
|
|
13
|
-
|
|
14
|
+
const OPERATORS_BY_KIND = {
|
|
15
|
+
string: STRING_OPERATORS,
|
|
16
|
+
number: NUMBER_OPERATORS,
|
|
17
|
+
boolean: BOOLEAN_OPERATORS,
|
|
18
|
+
date: DATE_OPERATORS,
|
|
19
|
+
};
|
|
20
|
+
const FIELD_KEY_PREFIX = "saas.segments.fields";
|
|
21
|
+
const VALUE_KIND_BY_TYPE = {
|
|
22
|
+
string: "string",
|
|
23
|
+
number: "number",
|
|
24
|
+
boolean: "boolean",
|
|
25
|
+
date: "date",
|
|
26
|
+
enum: "string",
|
|
27
|
+
"enum:plan": "string",
|
|
28
|
+
};
|
|
29
|
+
function defineField(spec) {
|
|
30
|
+
const valueKind = VALUE_KIND_BY_TYPE[spec.type];
|
|
31
|
+
const isEnum = spec.type === "enum" || spec.type === "enum:plan";
|
|
32
|
+
return {
|
|
33
|
+
id: spec.id,
|
|
34
|
+
type: spec.type,
|
|
35
|
+
valueKind,
|
|
36
|
+
labelKey: `${FIELD_KEY_PREFIX}.${spec.key}.label`,
|
|
37
|
+
descriptionKey: `${FIELD_KEY_PREFIX}.${spec.key}.description`,
|
|
38
|
+
operators: isEnum ? ENUM_OPERATORS : OPERATORS_BY_KIND[valueKind],
|
|
39
|
+
group: spec.group,
|
|
40
|
+
icon: spec.icon,
|
|
41
|
+
unit: spec.unit,
|
|
42
|
+
enumOptions: spec.enumOptions,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const BILLING_STATE_OPTIONS = status_vocabulary_1.WORKSPACE_STATUS_ORDER.map((state) => ({
|
|
46
|
+
value: state,
|
|
47
|
+
labelKey: `saas.status.workspace.${state}`,
|
|
48
|
+
tone: status_vocabulary_1.STATUS_TONES.workspace[state],
|
|
49
|
+
}));
|
|
50
|
+
const CUSTOMER_TYPE_OPTIONS = db_1.TENANT_CUSTOMER_TYPES.map((type) => ({
|
|
51
|
+
value: type,
|
|
52
|
+
labelKey: `saas.segments.enum.customer_type.${type}`,
|
|
53
|
+
}));
|
|
54
|
+
const WORKSPACE_FIELD_SPECS = [
|
|
14
55
|
{
|
|
15
56
|
id: "name",
|
|
57
|
+
key: "name",
|
|
16
58
|
type: "string",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
descriptionKey: "saas.segments.fields.name.description",
|
|
20
|
-
operators: STRING_OPERATORS,
|
|
59
|
+
group: "workspace",
|
|
60
|
+
icon: "i-ph-buildings",
|
|
21
61
|
},
|
|
22
62
|
{
|
|
23
63
|
id: "createdAt",
|
|
64
|
+
key: "created_at",
|
|
24
65
|
type: "date",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
descriptionKey: "saas.segments.fields.created_at.description",
|
|
28
|
-
operators: DATE_OPERATORS,
|
|
66
|
+
group: "workspace",
|
|
67
|
+
icon: "i-ph-calendar-blank",
|
|
29
68
|
},
|
|
30
69
|
{
|
|
31
70
|
id: "ageInDays",
|
|
71
|
+
key: "age_in_days",
|
|
32
72
|
type: "number",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
descriptionKey: "saas.segments.fields.age_in_days.description",
|
|
36
|
-
operators: NUMBER_OPERATORS,
|
|
73
|
+
group: "workspace",
|
|
74
|
+
icon: "i-ph-hourglass",
|
|
37
75
|
unit: "days",
|
|
38
76
|
},
|
|
39
77
|
{
|
|
40
|
-
id: "
|
|
41
|
-
|
|
42
|
-
valueKind: "string",
|
|
43
|
-
labelKey: "saas.segments.fields.plan_id.label",
|
|
44
|
-
descriptionKey: "saas.segments.fields.plan_id.description",
|
|
45
|
-
operators: ENUM_OPERATORS,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "mrr",
|
|
78
|
+
id: "membersCount",
|
|
79
|
+
key: "members_count",
|
|
49
80
|
type: "number",
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
operators: NUMBER_OPERATORS,
|
|
54
|
-
unit: "currency",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "isPaying",
|
|
58
|
-
type: "boolean",
|
|
59
|
-
valueKind: "boolean",
|
|
60
|
-
labelKey: "saas.segments.fields.is_paying.label",
|
|
61
|
-
descriptionKey: "saas.segments.fields.is_paying.description",
|
|
62
|
-
operators: BOOLEAN_OPERATORS,
|
|
81
|
+
group: "workspace",
|
|
82
|
+
icon: "i-ph-users",
|
|
83
|
+
unit: "count",
|
|
63
84
|
},
|
|
64
85
|
{
|
|
65
86
|
id: "status",
|
|
87
|
+
key: "status",
|
|
66
88
|
type: "enum",
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
operators: ENUM_OPERATORS,
|
|
71
|
-
enumValues: db_1.TENANT_SUBSCRIPTION_STATUSES,
|
|
89
|
+
group: "billing",
|
|
90
|
+
icon: "i-ph-pulse",
|
|
91
|
+
enumOptions: BILLING_STATE_OPTIONS,
|
|
72
92
|
},
|
|
73
93
|
{
|
|
74
|
-
id: "
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
operators: BOOLEAN_OPERATORS,
|
|
94
|
+
id: "planId",
|
|
95
|
+
key: "plan_id",
|
|
96
|
+
type: "enum:plan",
|
|
97
|
+
group: "billing",
|
|
98
|
+
icon: "i-ph-package",
|
|
80
99
|
},
|
|
81
100
|
{
|
|
82
|
-
id: "
|
|
101
|
+
id: "isPaying",
|
|
102
|
+
key: "is_paying",
|
|
83
103
|
type: "boolean",
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
descriptionKey: "saas.segments.fields.is_on_trial.description",
|
|
87
|
-
operators: BOOLEAN_OPERATORS,
|
|
104
|
+
group: "billing",
|
|
105
|
+
icon: "i-ph-currency-circle-dollar",
|
|
88
106
|
},
|
|
89
107
|
{
|
|
90
|
-
id: "
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
operators: ENUM_OPERATORS,
|
|
96
|
-
enumValues: db_1.TENANT_CUSTOMER_TYPES,
|
|
108
|
+
id: "isOnTrial",
|
|
109
|
+
key: "is_on_trial",
|
|
110
|
+
type: "boolean",
|
|
111
|
+
group: "billing",
|
|
112
|
+
icon: "i-ph-hourglass-medium",
|
|
97
113
|
},
|
|
98
114
|
{
|
|
99
|
-
id: "
|
|
115
|
+
id: "mrr",
|
|
116
|
+
key: "mrr",
|
|
100
117
|
type: "number",
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
operators: NUMBER_OPERATORS,
|
|
105
|
-
unit: "count",
|
|
118
|
+
group: "billing",
|
|
119
|
+
icon: "i-ph-chart-line-up",
|
|
120
|
+
unit: "currency",
|
|
106
121
|
},
|
|
107
122
|
{
|
|
108
123
|
id: "totalRevenue",
|
|
124
|
+
key: "total_revenue",
|
|
109
125
|
type: "number",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
descriptionKey: "saas.segments.fields.total_revenue.description",
|
|
113
|
-
operators: NUMBER_OPERATORS,
|
|
126
|
+
group: "billing",
|
|
127
|
+
icon: "i-ph-coins",
|
|
114
128
|
unit: "currency",
|
|
115
129
|
},
|
|
116
130
|
{
|
|
117
131
|
id: "daysSinceLastInvoice",
|
|
132
|
+
key: "days_since_last_invoice",
|
|
118
133
|
type: "number",
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
descriptionKey: "saas.segments.fields.days_since_last_invoice.description",
|
|
122
|
-
operators: NUMBER_OPERATORS,
|
|
134
|
+
group: "billing",
|
|
135
|
+
icon: "i-ph-receipt",
|
|
123
136
|
unit: "days",
|
|
124
137
|
},
|
|
138
|
+
{
|
|
139
|
+
id: "hasStripeCustomer",
|
|
140
|
+
key: "has_stripe_customer",
|
|
141
|
+
type: "boolean",
|
|
142
|
+
group: "billing",
|
|
143
|
+
icon: "i-ph-credit-card",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "customerType",
|
|
147
|
+
key: "customer_type",
|
|
148
|
+
type: "enum",
|
|
149
|
+
group: "billing",
|
|
150
|
+
icon: "i-ph-identification-card",
|
|
151
|
+
enumOptions: CUSTOMER_TYPE_OPTIONS,
|
|
152
|
+
},
|
|
125
153
|
];
|
|
126
|
-
|
|
154
|
+
const USER_FIELD_SPECS = [
|
|
127
155
|
{
|
|
128
156
|
id: "email",
|
|
157
|
+
key: "user_email",
|
|
129
158
|
type: "string",
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
descriptionKey: "saas.segments.fields.user_email.description",
|
|
133
|
-
operators: STRING_OPERATORS,
|
|
159
|
+
group: "identity",
|
|
160
|
+
icon: "i-ph-envelope-simple",
|
|
134
161
|
},
|
|
135
162
|
{
|
|
136
163
|
id: "name",
|
|
164
|
+
key: "user_name",
|
|
137
165
|
type: "string",
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
descriptionKey: "saas.segments.fields.user_name.description",
|
|
141
|
-
operators: STRING_OPERATORS,
|
|
166
|
+
group: "identity",
|
|
167
|
+
icon: "i-ph-user",
|
|
142
168
|
},
|
|
143
169
|
{
|
|
144
170
|
id: "language",
|
|
171
|
+
key: "user_language",
|
|
145
172
|
type: "string",
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
173
|
+
group: "identity",
|
|
174
|
+
icon: "i-ph-translate",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "isValidated",
|
|
178
|
+
key: "user_is_validated",
|
|
179
|
+
type: "boolean",
|
|
180
|
+
group: "identity",
|
|
181
|
+
icon: "i-ph-seal-check",
|
|
150
182
|
},
|
|
151
183
|
{
|
|
152
184
|
id: "createdAt",
|
|
185
|
+
key: "user_created_at",
|
|
153
186
|
type: "date",
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
descriptionKey: "saas.segments.fields.user_created_at.description",
|
|
157
|
-
operators: DATE_OPERATORS,
|
|
187
|
+
group: "activity",
|
|
188
|
+
icon: "i-ph-calendar-blank",
|
|
158
189
|
},
|
|
159
190
|
{
|
|
160
191
|
id: "ageInDays",
|
|
192
|
+
key: "user_age_in_days",
|
|
161
193
|
type: "number",
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
descriptionKey: "saas.segments.fields.user_age_in_days.description",
|
|
165
|
-
operators: NUMBER_OPERATORS,
|
|
194
|
+
group: "activity",
|
|
195
|
+
icon: "i-ph-hourglass",
|
|
166
196
|
unit: "days",
|
|
167
197
|
},
|
|
168
|
-
{
|
|
169
|
-
id: "isValidated",
|
|
170
|
-
type: "boolean",
|
|
171
|
-
valueKind: "boolean",
|
|
172
|
-
labelKey: "saas.segments.fields.user_is_validated.label",
|
|
173
|
-
descriptionKey: "saas.segments.fields.user_is_validated.description",
|
|
174
|
-
operators: BOOLEAN_OPERATORS,
|
|
175
|
-
},
|
|
176
198
|
{
|
|
177
199
|
id: "daysSinceLastActive",
|
|
200
|
+
key: "days_since_last_active",
|
|
178
201
|
type: "number",
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
descriptionKey: "saas.segments.fields.days_since_last_active.description",
|
|
182
|
-
operators: NUMBER_OPERATORS,
|
|
202
|
+
group: "activity",
|
|
203
|
+
icon: "i-ph-clock",
|
|
183
204
|
unit: "days",
|
|
184
205
|
},
|
|
185
206
|
{
|
|
186
207
|
id: "workspacesCount",
|
|
208
|
+
key: "workspaces_count",
|
|
187
209
|
type: "number",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
descriptionKey: "saas.segments.fields.workspaces_count.description",
|
|
191
|
-
operators: NUMBER_OPERATORS,
|
|
210
|
+
group: "memberships",
|
|
211
|
+
icon: "i-ph-buildings",
|
|
192
212
|
unit: "count",
|
|
193
213
|
},
|
|
194
214
|
{
|
|
195
215
|
id: "isOwnerOfAnyWorkspace",
|
|
216
|
+
key: "is_owner_of_any_workspace",
|
|
196
217
|
type: "boolean",
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
descriptionKey: "saas.segments.fields.is_owner_of_any_workspace.description",
|
|
200
|
-
operators: BOOLEAN_OPERATORS,
|
|
218
|
+
group: "memberships",
|
|
219
|
+
icon: "i-ph-crown-simple",
|
|
201
220
|
},
|
|
202
221
|
];
|
|
222
|
+
exports.SEGMENT_FIELDS = WORKSPACE_FIELD_SPECS.map(defineField);
|
|
223
|
+
exports.USER_SEGMENT_FIELDS = USER_FIELD_SPECS.map(defineField);
|
|
203
224
|
function getSegmentFields(catalog) {
|
|
204
225
|
return catalog === "user" ? exports.USER_SEGMENT_FIELDS : exports.SEGMENT_FIELDS;
|
|
205
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-fields.js","sourceRoot":"","sources":["../../src/utils/segment-fields.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"segment-fields.js","sourceRoot":"","sources":["../../src/utils/segment-fields.ts"],"names":[],"mappings":";;;AAmTA,4CAIC;AAED,4CAKC;AAMD,kDAMC;AAzUD,8BAAsE;AACtE,2DAA2E;AA2D3E,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAC1E,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAC5D,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAC3D,MAAM,iBAAiB,GAAG,CAAC,IAAI,CAAU,CAAC;AAC1C,MAAM,cAAc,GAA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AA4B;IAE5B,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,2BAAmB,CAAC,CAAC,CAAC,sBAAc,CAAC;AACnE,CAAC;AAED,SAAgB,gBAAgB,CAC9B,OAAe,EACf,OAA4B;IAE5B,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;AACjE,CAAC;AAMD,SAAgB,mBAAmB,CACjC,OAAe;IAEf,OAAO,CACL,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type Tenant } from "@antelopejs/interface-dms/db";
|
|
2
|
-
import { type
|
|
2
|
+
import { type User } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
import { type BillingState, type Invoice, type Plan, PlanModel, type Segment, type TenantBillingInfo, type TenantSubscription } from "../db";
|
|
3
4
|
export interface WorkspaceProjection {
|
|
4
5
|
_id: string;
|
|
5
6
|
name: string;
|
|
6
7
|
createdAt: Date;
|
|
7
8
|
ageInDays: number;
|
|
8
|
-
status: TenantSubscription["status"] | null;
|
|
9
|
+
status: BillingState | TenantSubscription["status"] | null;
|
|
9
10
|
hasSubscription: boolean;
|
|
10
11
|
hasStripeCustomer: boolean;
|
|
11
12
|
isOnTrial: boolean;
|
|
@@ -25,12 +26,17 @@ interface ProjectionInputs {
|
|
|
25
26
|
subscription: TenantSubscription | undefined;
|
|
26
27
|
billingInfo: TenantBillingInfo | undefined;
|
|
27
28
|
plan: Plan | null;
|
|
29
|
+
billingState?: BillingState | null;
|
|
28
30
|
membersCount: number;
|
|
29
31
|
invoices: Invoice[];
|
|
30
32
|
now: Date;
|
|
31
33
|
}
|
|
32
34
|
export declare function buildWorkspaceProjection(inputs: ProjectionInputs): WorkspaceProjection;
|
|
33
|
-
export
|
|
35
|
+
export interface ProjectionLookups {
|
|
36
|
+
plansById?: ReadonlyMap<string, Plan>;
|
|
37
|
+
billingStatesByTenant?: ReadonlyMap<string, BillingState>;
|
|
38
|
+
}
|
|
39
|
+
export declare function loadWorkspaceProjection(tenant: Tenant, planModel: PlanModel, now?: Date, lookups?: ProjectionLookups): Promise<WorkspaceProjection>;
|
|
34
40
|
export declare function loadAllTenantProjections(planModel: PlanModel, now?: Date): Promise<WorkspaceProjection[]>;
|
|
35
41
|
export type UserWorkspaceProjection = WorkspaceProjection & {
|
|
36
42
|
isOwner: boolean;
|
|
@@ -48,6 +54,11 @@ export type UserProjection = {
|
|
|
48
54
|
isOwnerOfAnyWorkspace: boolean;
|
|
49
55
|
workspaces: UserWorkspaceProjection[];
|
|
50
56
|
};
|
|
57
|
+
export interface UserMembership {
|
|
58
|
+
tenantId: string;
|
|
59
|
+
isTenantOwner: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare function buildUserProjection(user: User, memberships: readonly UserMembership[], sessionActivity: Date | undefined, workspacesById: ReadonlyMap<string, WorkspaceProjection>, now: Date): UserProjection;
|
|
51
62
|
export declare function loadUserProjectionsFrom(workspaceProjections: readonly WorkspaceProjection[], now?: Date): Promise<UserProjection[]>;
|
|
52
63
|
export declare function loadAllUserProjections(planModel: PlanModel, now?: Date): Promise<UserProjection[]>;
|
|
53
64
|
export declare function recomputeSegments(segments: readonly Segment[]): Promise<void>;
|