@antelopejs/dms-saas 0.3.15 → 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 +61 -14
- 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 +8 -2
- package/dist/data-api/platformOwner/features.js +155 -35
- 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 -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 +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 +45 -42
- package/dist/routes/platformOwner/plans.js +162 -143
- 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 +125 -15
- 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/content-language.d.ts +2 -0
- package/dist/utils/content-language.js +12 -0
- package/dist/utils/content-language.js.map +1 -0
- 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 +9 -0
- package/dist/utils/index.js +9 -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 -310
- 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 -281
- 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/composables/usePlanFeatureLabel.ts +0 -24
- package/frontend-vue/app/plugins/plan-cards-display.client.ts +0 -16
- package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +0 -122
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
import { type Plan, type PlanBillingMode, type PlanInterval } from "../db";
|
|
3
|
+
import { type CardDetails, type WorkspaceBillingProfile } from "./provisioning";
|
|
4
|
+
export type CardRequirement = "none" | "payment" | "verification";
|
|
5
|
+
export interface WorkspaceCreatePlanOption {
|
|
6
|
+
_id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
price: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
interval: PlanInterval;
|
|
12
|
+
billingMode: PlanBillingMode;
|
|
13
|
+
trialDays: number;
|
|
14
|
+
maxMembers: number;
|
|
15
|
+
cardRequirement: CardRequirement;
|
|
16
|
+
}
|
|
17
|
+
export interface FreePerCardRule {
|
|
18
|
+
limit: number;
|
|
19
|
+
usedBy: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface WorkspaceCreateOptions {
|
|
22
|
+
plans: WorkspaceCreatePlanOption[];
|
|
23
|
+
freePerCard: FreePerCardRule | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function cardRequirementOf(plan: Plan, freeWorkspacesPerCard: number): CardRequirement;
|
|
26
|
+
export declare function buildWorkspaceCreateOptions(user: User, preferredTenantId?: string): Promise<WorkspaceCreateOptions>;
|
|
27
|
+
export interface SelfServeCardInput {
|
|
28
|
+
requirement: CardRequirement;
|
|
29
|
+
paymentMethodId: string | undefined;
|
|
30
|
+
card: CardDetails;
|
|
31
|
+
billingProfile: WorkspaceBillingProfile;
|
|
32
|
+
freeWorkspacesPerCard: number;
|
|
33
|
+
}
|
|
34
|
+
export interface SelfServeCardUse {
|
|
35
|
+
paymentMethodId: string | undefined;
|
|
36
|
+
card: CardDetails;
|
|
37
|
+
}
|
|
38
|
+
export declare function resolveSelfServeCardUse(input: SelfServeCardInput): Promise<SelfServeCardUse>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cardRequirementOf = cardRequirementOf;
|
|
4
|
+
exports.buildWorkspaceCreateOptions = buildWorkspaceCreateOptions;
|
|
5
|
+
exports.resolveSelfServeCardUse = resolveSelfServeCardUse;
|
|
6
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
7
|
+
const interface_database_1 = require("@antelopejs/interface-database");
|
|
8
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
9
|
+
const db_1 = require("@antelopejs/interface-dms/db");
|
|
10
|
+
const db_2 = require("../db");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
12
|
+
const billing_profile_1 = require("./billing-profile");
|
|
13
|
+
const free_plan_1 = require("./free-plan");
|
|
14
|
+
const free_workspaces_per_card_1 = require("./free-workspaces-per-card");
|
|
15
|
+
const provisioning_1 = require("./provisioning");
|
|
16
|
+
const plan_audience_1 = require("../plans/plan-audience");
|
|
17
|
+
const HTTP_BAD_REQUEST = 400;
|
|
18
|
+
const NO_TRIAL_DAYS = 0;
|
|
19
|
+
const CANCELLED_STATUS = "cancelled";
|
|
20
|
+
const NO_CARD = { fingerprint: null, billingAddress: undefined };
|
|
21
|
+
function cardRequirementOf(plan, freeWorkspacesPerCard) {
|
|
22
|
+
if (!(0, free_plan_1.isFreePlan)(plan))
|
|
23
|
+
return "payment";
|
|
24
|
+
return (0, free_workspaces_per_card_1.isFreePerCardPolicyActive)(freeWorkspacesPerCard)
|
|
25
|
+
? "verification"
|
|
26
|
+
: "none";
|
|
27
|
+
}
|
|
28
|
+
function toPlanOption(plan, freeWorkspacesPerCard, hasUsedTrial) {
|
|
29
|
+
return {
|
|
30
|
+
_id: plan._id,
|
|
31
|
+
name: plan.name,
|
|
32
|
+
description: plan.description,
|
|
33
|
+
price: plan.price,
|
|
34
|
+
currency: plan.currency,
|
|
35
|
+
interval: plan.interval,
|
|
36
|
+
billingMode: plan.billingMode,
|
|
37
|
+
trialDays: hasUsedTrial ? NO_TRIAL_DAYS : plan.trialDays,
|
|
38
|
+
maxMembers: plan.maxMembers,
|
|
39
|
+
cardRequirement: cardRequirementOf(plan, freeWorkspacesPerCard),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async function listOwnedTenantIds(userId) {
|
|
43
|
+
const memberships = await (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, interface_database_1.CROSS_INSTANCE).listByUserWithTenantIds(userId);
|
|
44
|
+
return memberships
|
|
45
|
+
.filter((membership) => membership.member.isTenantOwner)
|
|
46
|
+
.map((membership) => membership.tenantId);
|
|
47
|
+
}
|
|
48
|
+
async function isCardBackedFreeWorkspace(tenantId) {
|
|
49
|
+
const subscription = await (0, interface_database_decorators_1.GetModel)(db_2.TenantSubscriptionModel, tenantId).findOne();
|
|
50
|
+
if (!subscription?.cardFingerprint || !subscription.planId)
|
|
51
|
+
return false;
|
|
52
|
+
if (subscription.status === CANCELLED_STATUS)
|
|
53
|
+
return false;
|
|
54
|
+
if (subscription.isComplimentary)
|
|
55
|
+
return false;
|
|
56
|
+
const plan = await (0, interface_database_decorators_1.GetModel)(db_2.PlanModel).get(subscription.planId);
|
|
57
|
+
return !!plan && (0, free_plan_1.isFreePlan)(plan);
|
|
58
|
+
}
|
|
59
|
+
async function listCardBackedFreeWorkspaceNames(userId) {
|
|
60
|
+
const tenantIds = await listOwnedTenantIds(userId);
|
|
61
|
+
const verdicts = await Promise.all(tenantIds.map(isCardBackedFreeWorkspace));
|
|
62
|
+
const backed = tenantIds.filter((_, index) => verdicts[index]);
|
|
63
|
+
const tenants = await (0, interface_database_decorators_1.GetModel)(db_1.TenantModel).getMany(backed);
|
|
64
|
+
return tenants.map((tenant) => tenant.name);
|
|
65
|
+
}
|
|
66
|
+
async function resolveFreePerCardRule(userId, limit) {
|
|
67
|
+
if (!(0, free_workspaces_per_card_1.isFreePerCardPolicyActive)(limit))
|
|
68
|
+
return null;
|
|
69
|
+
return { limit, usedBy: await listCardBackedFreeWorkspaceNames(userId) };
|
|
70
|
+
}
|
|
71
|
+
async function buildWorkspaceCreateOptions(user, preferredTenantId) {
|
|
72
|
+
const [plans, profile, limit, hasUsedTrial] = await Promise.all([
|
|
73
|
+
(0, interface_database_decorators_1.GetModel)(db_2.PlanModel).findPubliclyVisible(),
|
|
74
|
+
(0, billing_profile_1.resolveBillingProfileForNewWorkspace)(user._id, NO_CARD, preferredTenantId),
|
|
75
|
+
(0, free_workspaces_per_card_1.resolveFreeWorkspacesPerCard)(),
|
|
76
|
+
(0, interface_database_decorators_1.GetModel)(db_2.TrialConsumptionModel).existsForIdentity((0, utils_1.hashEmail)(user.email), null),
|
|
77
|
+
]);
|
|
78
|
+
return {
|
|
79
|
+
plans: plans
|
|
80
|
+
.filter((plan) => (0, plan_audience_1.isPlanOfferedTo)(plan, profile.customerType))
|
|
81
|
+
.sort((a, b) => a.order - b.order)
|
|
82
|
+
.map((plan) => toPlanOption(plan, limit, hasUsedTrial)),
|
|
83
|
+
freePerCard: await resolveFreePerCardRule(user._id, limit),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function assertCardSent(value) {
|
|
87
|
+
(0, interface_api_util_1.assert)(value, HTTP_BAD_REQUEST, "saas.errors.workspace.payment_method_required");
|
|
88
|
+
}
|
|
89
|
+
const CARD_USES = {
|
|
90
|
+
payment: async ({ paymentMethodId, card, billingProfile }) => {
|
|
91
|
+
assertCardSent(paymentMethodId);
|
|
92
|
+
(0, provisioning_1.assertBillingCountry)(billingProfile.address);
|
|
93
|
+
return { paymentMethodId, card };
|
|
94
|
+
},
|
|
95
|
+
verification: async ({ paymentMethodId, card, freeWorkspacesPerCard }) => {
|
|
96
|
+
assertCardSent(paymentMethodId);
|
|
97
|
+
assertCardSent(card.fingerprint);
|
|
98
|
+
await (0, free_workspaces_per_card_1.assertCardMayBackFreeWorkspace)(card.fingerprint, freeWorkspacesPerCard);
|
|
99
|
+
return { paymentMethodId: undefined, card };
|
|
100
|
+
},
|
|
101
|
+
none: async () => ({ paymentMethodId: undefined, card: NO_CARD }),
|
|
102
|
+
};
|
|
103
|
+
function resolveSelfServeCardUse(input) {
|
|
104
|
+
return CARD_USES[input.requirement](input);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=self-serve-creation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"self-serve-creation.js","sourceRoot":"","sources":["../../src/workspaces/self-serve-creation.ts"],"names":[],"mappings":";;AAuEA,8CAQC;AAuED,kEAoBC;AA4DD,0DAIC;AA1OD,uEAAwD;AACxD,uEAAgE;AAChE,6FAAqE;AACrE,qDAA8E;AAE9E,8BAOe;AACf,oCAAqC;AACrC,uDAAyE;AACzE,2CAAyC;AACzC,yEAIoC;AACpC,iDAIwB;AACxB,0DAAyD;AAEzD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,gBAAgB,GAAG,WAAW,CAAC;AACrC,MAAM,OAAO,GAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AAwC9E,SAAgB,iBAAiB,CAC/B,IAAU,EACV,qBAA6B;IAE7B,IAAI,CAAC,IAAA,sBAAU,EAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,OAAO,IAAA,oDAAyB,EAAC,qBAAqB,CAAC;QACrD,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,MAAM,CAAC;AACb,CAAC;AAED,SAAS,YAAY,CACnB,IAAU,EACV,qBAA6B,EAC7B,YAAqB;IAErB,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,E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,CAAC,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;CAClE,CAAC;AAYF,SAAgB,uBAAuB,CACrC,KAAyB;IAEzB,OAAO,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workspaceGlanceItems = workspaceGlanceItems;
|
|
4
|
+
const composed_text_1 = require("../i18n/composed-text");
|
|
5
|
+
const status_vocabulary_1 = require("../utils/status-vocabulary");
|
|
6
|
+
const money_1 = require("../utils/money");
|
|
7
|
+
const KEYS = "saas.workspace.general.glance";
|
|
8
|
+
const PRICE_KEYS = "saas.workspace.plan_price";
|
|
9
|
+
const MEMBERS_PATH = "/settings/workspace/members";
|
|
10
|
+
const BILLING_PATH = "/settings/workspace/billing";
|
|
11
|
+
const HEALTHY_TONE = "success";
|
|
12
|
+
const NO_VALUE = "—";
|
|
13
|
+
function membersItem({ seats }) {
|
|
14
|
+
const occupied = seats.occupied;
|
|
15
|
+
return {
|
|
16
|
+
id: "members",
|
|
17
|
+
icon: "i-ph-users-three",
|
|
18
|
+
eyebrow: `$${KEYS}.members`,
|
|
19
|
+
value: seats.maxMembers === null
|
|
20
|
+
? (0, composed_text_1.composed)(`${KEYS}.seats_unlimited`, {
|
|
21
|
+
occupied: (0, composed_text_1.countParam)(occupied),
|
|
22
|
+
})
|
|
23
|
+
: (0, composed_text_1.composed)(`${KEYS}.seats_of`, { occupied, max: seats.maxMembers }),
|
|
24
|
+
detail: (0, composed_text_1.composed)(`${KEYS}.seats_detail`, {
|
|
25
|
+
members: (0, composed_text_1.composed)(`${KEYS}.members_count`, {
|
|
26
|
+
count: (0, composed_text_1.countParam)(seats.members),
|
|
27
|
+
}),
|
|
28
|
+
invites: (0, composed_text_1.composed)(`${KEYS}.invites_count`, {
|
|
29
|
+
count: (0, composed_text_1.countParam)(seats.pendingInvites),
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
to: MEMBERS_PATH,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function priceLabel(plan) {
|
|
36
|
+
if (plan.price <= 0)
|
|
37
|
+
return (0, composed_text_1.composed)(`${PRICE_KEYS}.free`);
|
|
38
|
+
return (0, composed_text_1.composed)(`${PRICE_KEYS}.${plan.billingMode}_${plan.interval}`, {
|
|
39
|
+
price: (0, composed_text_1.moneyParam)((0, money_1.toMinorUnits)(plan.price, plan.currency), plan.currency),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function planDetail(plan) {
|
|
43
|
+
const parts = [
|
|
44
|
+
(0, composed_text_1.composed)(`saas.status.workspace.${plan.status}`),
|
|
45
|
+
plan.isComplimentary ? (0, composed_text_1.composed)(`${KEYS}.complimentary`) : priceLabel(plan),
|
|
46
|
+
];
|
|
47
|
+
if (plan.renewsAt) {
|
|
48
|
+
parts.push((0, composed_text_1.composed)(`${KEYS}.renews`, { date: (0, composed_text_1.dateParam)(plan.renewsAt) }));
|
|
49
|
+
}
|
|
50
|
+
return (0, composed_text_1.dotList)(parts);
|
|
51
|
+
}
|
|
52
|
+
function planItem({ plan }) {
|
|
53
|
+
const tone = plan ? status_vocabulary_1.STATUS_TONES.workspace[plan.status] : "neutral";
|
|
54
|
+
return {
|
|
55
|
+
id: "plan",
|
|
56
|
+
icon: "i-ph-stack",
|
|
57
|
+
eyebrow: `$${KEYS}.plan`,
|
|
58
|
+
value: plan?.name ?? `$${KEYS}.no_plan`,
|
|
59
|
+
detail: plan ? (planDetail(plan) ?? undefined) : undefined,
|
|
60
|
+
detailTone: tone === HEALTHY_TONE ? undefined : tone,
|
|
61
|
+
to: BILLING_PATH,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function ownerItem(view) {
|
|
65
|
+
const [first, ...others] = view.owners;
|
|
66
|
+
const created = (0, composed_text_1.composed)(`${KEYS}.created`, {
|
|
67
|
+
name: view.name,
|
|
68
|
+
date: (0, composed_text_1.dateParam)(view.createdAt),
|
|
69
|
+
});
|
|
70
|
+
const lead = first?.isCaller
|
|
71
|
+
? (0, composed_text_1.dotList)([(0, composed_text_1.composed)(`${KEYS}.you`), created])
|
|
72
|
+
: created;
|
|
73
|
+
const name = first?.name ?? NO_VALUE;
|
|
74
|
+
return {
|
|
75
|
+
id: "owner",
|
|
76
|
+
icon: "i-ph-crown-simple",
|
|
77
|
+
eyebrow: `$${KEYS}.owner`,
|
|
78
|
+
value: others.length
|
|
79
|
+
? (0, composed_text_1.composed)(`${KEYS}.owner_and_others`, {
|
|
80
|
+
name,
|
|
81
|
+
others: (0, composed_text_1.composed)(`${KEYS}.more_owners`, {
|
|
82
|
+
count: (0, composed_text_1.countParam)(others.length),
|
|
83
|
+
}),
|
|
84
|
+
})
|
|
85
|
+
: name,
|
|
86
|
+
detail: lead ?? undefined,
|
|
87
|
+
to: MEMBERS_PATH,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function workspaceGlanceItems(view) {
|
|
91
|
+
return [membersItem(view), planItem(view), ownerItem(view)];
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=workspace-glance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-glance.js","sourceRoot":"","sources":["../../src/workspaces/workspace-glance.ts"],"names":[],"mappings":";;AAmHA,oDAEC;AAhHD,yDAM+B;AAC/B,kEAA0D;AAK1D,0CAA8C;AAE9C,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAC/C,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,YAAY,GAAG,6BAA6B,CAAC;AACnD,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,SAAS,WAAW,CAAC,EAAE,KAA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;
|
|
4
|
+
exports.normalizeWorkspaceName = normalizeWorkspaceName;
|
|
5
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
6
|
+
const HTTP_BAD_REQUEST = 400;
|
|
7
|
+
exports.WORKSPACE_NAME_MAX_LENGTH = 60;
|
|
8
|
+
function normalizeWorkspaceName(name) {
|
|
9
|
+
const trimmed = name?.trim() ?? "";
|
|
10
|
+
(0, interface_api_util_1.assert)(trimmed, HTTP_BAD_REQUEST, "saas.errors.workspace.name_required");
|
|
11
|
+
(0, interface_api_util_1.assert)(trimmed.length <= exports.WORKSPACE_NAME_MAX_LENGTH, HTTP_BAD_REQUEST, "saas.errors.workspace.name_too_long");
|
|
12
|
+
return trimmed;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=workspace-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-name.js","sourceRoot":"","sources":["../../src/workspaces/workspace-name.ts"],"names":[],"mappings":";;;AAaA,wDASC;AAtBD,uEAAwD;AAExD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAGhB,QAAA,yBAAyB,GAAG,EAAE,CAAC;AAQ5C,SAAgB,sBAAsB,CAAC,IAAwB;IAC7D,MAAM,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnC,IAAA,2BAAM,EAAC,OAAO,EAAE,gBAAgB,EAAE,qCAAqC,CAAC,CAAC;IACzE,IAAA,2BAAM,EACJ,OAAO,CAAC,MAAM,IAAI,iCAAyB,EAC3C,gBAAgB,EAChB,qCAAqC,CACtC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type BillingState, type PlanBillingMode, type PlanInterval } from "../db";
|
|
2
|
+
export interface WorkspaceSeatsOverview {
|
|
3
|
+
members: number;
|
|
4
|
+
pendingInvites: number;
|
|
5
|
+
occupied: number;
|
|
6
|
+
maxMembers: number | null;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspacePlanOverview {
|
|
9
|
+
name: string;
|
|
10
|
+
status: BillingState;
|
|
11
|
+
isComplimentary: boolean;
|
|
12
|
+
price: number;
|
|
13
|
+
currency: string;
|
|
14
|
+
interval: PlanInterval;
|
|
15
|
+
billingMode: PlanBillingMode;
|
|
16
|
+
renewsAt: Date | null;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkspaceOwnerOverview {
|
|
19
|
+
userId: string;
|
|
20
|
+
name: string;
|
|
21
|
+
email: string;
|
|
22
|
+
isCaller: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface NextWorkspaceRef {
|
|
25
|
+
_id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkspaceOverview {
|
|
29
|
+
_id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
createdAt: Date;
|
|
32
|
+
seats: WorkspaceSeatsOverview;
|
|
33
|
+
plan: WorkspacePlanOverview | null;
|
|
34
|
+
owners: WorkspaceOwnerOverview[];
|
|
35
|
+
invoicesCount: number;
|
|
36
|
+
unpaidInvoiceNumber: string | null;
|
|
37
|
+
retentionDays: number;
|
|
38
|
+
destroyedAt: Date;
|
|
39
|
+
nextWorkspace: NextWorkspaceRef | null;
|
|
40
|
+
}
|
|
41
|
+
export declare function buildWorkspaceOverview(tenantId: string, callerId: string, now?: Date): Promise<WorkspaceOverview>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildWorkspaceOverview = buildWorkspaceOverview;
|
|
4
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
5
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
6
|
+
const db_1 = require("@antelopejs/interface-dms/db");
|
|
7
|
+
const db_2 = require("@antelopejs/interface-dms/auth/db");
|
|
8
|
+
const billing_state_1 = require("../billing-state");
|
|
9
|
+
const db_3 = require("../db");
|
|
10
|
+
const plans_1 = require("../plans");
|
|
11
|
+
const time_1 = require("../utils/time");
|
|
12
|
+
const deletion_1 = require("./deletion");
|
|
13
|
+
const my_workspaces_1 = require("./my-workspaces");
|
|
14
|
+
const HTTP_NOT_FOUND = 404;
|
|
15
|
+
function toPlanOverview(plan, subscription) {
|
|
16
|
+
return {
|
|
17
|
+
name: plan.name,
|
|
18
|
+
status: (0, billing_state_1.deriveBillingState)(subscription),
|
|
19
|
+
isComplimentary: subscription.isComplimentary,
|
|
20
|
+
price: plan.price,
|
|
21
|
+
currency: plan.currency,
|
|
22
|
+
interval: plan.interval,
|
|
23
|
+
billingMode: plan.billingMode,
|
|
24
|
+
renewsAt: subscription.currentPeriodEnd ?? null,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async function resolvePlan(subscription) {
|
|
28
|
+
if (!subscription?.planId)
|
|
29
|
+
return null;
|
|
30
|
+
return (await (0, interface_database_decorators_1.GetModel)(db_3.PlanModel).get(subscription.planId)) ?? null;
|
|
31
|
+
}
|
|
32
|
+
async function resolveOwners(members, callerId) {
|
|
33
|
+
const owners = members.filter((member) => member.isTenantOwner);
|
|
34
|
+
const users = await Promise.all(owners.map((owner) => (0, interface_database_decorators_1.GetModel)(db_2.UserModel).get(owner.userId)));
|
|
35
|
+
return owners.map((owner, index) => ({
|
|
36
|
+
userId: owner.userId,
|
|
37
|
+
name: users[index]?.name || users[index]?.email || owner.userId,
|
|
38
|
+
email: users[index]?.email ?? "",
|
|
39
|
+
isCaller: owner.userId === callerId,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
function toSeats(usage, plan) {
|
|
43
|
+
const isLimited = !!plan && plan.maxMembers !== db_3.PLAN_UNLIMITED;
|
|
44
|
+
return {
|
|
45
|
+
members: usage.members,
|
|
46
|
+
pendingInvites: usage.pendingInvites,
|
|
47
|
+
occupied: usage.occupied,
|
|
48
|
+
maxMembers: isLimited ? plan.maxMembers : null,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async function resolveNextWorkspace(callerId, tenantId) {
|
|
52
|
+
const rows = await (0, my_workspaces_1.listMyWorkspaces)(callerId, tenantId);
|
|
53
|
+
const next = rows.find((row) => row._id !== tenantId);
|
|
54
|
+
return next ? { _id: next._id, name: next.name } : null;
|
|
55
|
+
}
|
|
56
|
+
async function buildWorkspaceOverview(tenantId, callerId, now = new Date()) {
|
|
57
|
+
const tenant = await (0, interface_database_decorators_1.GetModel)(db_1.TenantModel).get(tenantId);
|
|
58
|
+
(0, interface_api_util_1.assert)(tenant, HTTP_NOT_FOUND, "saas.errors.workspace.not_found");
|
|
59
|
+
const invoiceModel = (0, interface_database_decorators_1.GetModel)(db_3.InvoiceModel, tenantId);
|
|
60
|
+
const [subscription, members, usage, invoices, unpaid, retentionDays, next] = await Promise.all([
|
|
61
|
+
(0, interface_database_decorators_1.GetModel)(db_3.TenantSubscriptionModel, tenantId).findOne(),
|
|
62
|
+
(0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId).listAll(),
|
|
63
|
+
(0, plans_1.getSeatUsage)(tenantId),
|
|
64
|
+
invoiceModel.getAllInvoices(),
|
|
65
|
+
invoiceModel.findLatestOpen(),
|
|
66
|
+
(0, deletion_1.resolveDataRetentionDays)(),
|
|
67
|
+
resolveNextWorkspace(callerId, tenantId),
|
|
68
|
+
]);
|
|
69
|
+
const plan = await resolvePlan(subscription);
|
|
70
|
+
return {
|
|
71
|
+
_id: tenant._id,
|
|
72
|
+
name: tenant.name,
|
|
73
|
+
createdAt: tenant.createdAt,
|
|
74
|
+
seats: toSeats(usage, plan),
|
|
75
|
+
plan: plan && subscription ? toPlanOverview(plan, subscription) : null,
|
|
76
|
+
owners: await resolveOwners(members, callerId),
|
|
77
|
+
invoicesCount: invoices.length,
|
|
78
|
+
unpaidInvoiceNumber: unpaid?.number ?? null,
|
|
79
|
+
retentionDays,
|
|
80
|
+
destroyedAt: new Date(now.getTime() + retentionDays * time_1.MS_PER_DAY),
|
|
81
|
+
nextWorkspace: next,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=workspace-overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-overview.js","sourceRoot":"","sources":["../../src/workspaces/workspace-overview.ts"],"names":[],"mappings":";;AAkJA,wDAgCC;AAlLD,uEAAwD;AACxD,6FAAqE;AACrE,qDAIsC;AACtC,0DAA8D;AAC9D,oDAAsD;AACtD,8BAUe;AACf,oCAAwC;AACxC,wCAA2C;AAC3C,yCAAsD;AACtD,mDAAmD;AAEnD,MAAM,cAAc,GAAG,GAAG,CAAC;AAuD3B,SAAS,cAAc,CACrB,IAAU,EACV,YAAgC;IAEhC,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAA,kCAAkB,EAAC,YAAY,CAAC;QACxC,eAAe,EAAE,YAAY,CAAC,eAAe;QAC7C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,YAAY,CAAC,gBAAgB,IAAI,IAAI;KAChD,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,WAAW,CACxB,YAA4C;IAE5C,IAAI,CAAC,YAAY,EAAE,MAAM;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,CAAC,MAAM,IAAA,wCAAQ,EAAC,cAAS,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC;AACtE,CAAC;AAED,KAAK,UAAU,aAAa,CAC1B,OAAuB,EACvB,QAAgB;IAEhB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAChE,MAAM,KA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,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI;QACtE,MAAM,EAAE,MAAM,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC9C,aAAa,EAAE,QAAQ,CAAC,MAAM;QAC9B,mBAAmB,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI;QAC3C,aAAa;QACb,WAAW,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,aAAa,GAAG,iBAAU,CAAC;QACjE,aAAa,EAAE,IAAI;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
export interface WorkspaceRequestContext {
|
|
3
|
+
user: User | undefined;
|
|
4
|
+
tenantId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function isWorkspaceOwner(userId: string, tenantId: string): Promise<boolean>;
|
|
7
|
+
export declare function isWorkspaceOwnerRequest({ user, tenantId, }: WorkspaceRequestContext): Promise<boolean>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isWorkspaceOwner = isWorkspaceOwner;
|
|
4
|
+
exports.isWorkspaceOwnerRequest = isWorkspaceOwnerRequest;
|
|
5
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
6
|
+
const db_1 = require("@antelopejs/interface-dms/db");
|
|
7
|
+
async function isWorkspaceOwner(userId, tenantId) {
|
|
8
|
+
const membership = await (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId).getByUser(userId);
|
|
9
|
+
return !!membership?.isTenantOwner;
|
|
10
|
+
}
|
|
11
|
+
async function isWorkspaceOwnerRequest({ user, tenantId, }) {
|
|
12
|
+
return !!user && isWorkspaceOwner(user._id, tenantId);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=workspace-owner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-owner.js","sourceRoot":"","sources":["../../src/workspaces/workspace-owner.ts"],"names":[],"mappings":";;AAYA,4CAQC;AAGD,0DAKC;AA5BD,6FAAqE;AAErE,qDAAiE;AAU1D,KAAK,UAAU,gBAAgB,CACpC,MAAc,EACd,QAAgB;IAEhB,MAAM,UAAU,GAAG,MAAM,IAAA,wCAAQ,EAAC,sBAAiB,EAAE,QAAQ,CAAC,CAAC,SAAS,CACtE,MAAM,CACP,CAAC;IACF,OAAO,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC;AACrC,CAAC;AAGM,KAAK,UAAU,uBAAuB,CAAC,EAC5C,IAAI,EACJ,QAAQ,GACgB;IACxB,OAAO,CAAC,CAAC,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import PayInvoicePanel from './PayInvoicePanel.vue'
|
|
4
|
+
|
|
5
|
+
// Hosted by the past-due alert and the past-due strip; whichever opens it
|
|
6
|
+
// sets the shared target, so a single dialog shows at a time.
|
|
7
|
+
const { target, close } = usePayInvoice()
|
|
8
|
+
const { formatMinorUnits } = useMoneyFormat()
|
|
9
|
+
|
|
10
|
+
const open = computed({
|
|
11
|
+
get: () => target.value !== null,
|
|
12
|
+
set: (isOpen: boolean) => {
|
|
13
|
+
if (!isOpen) close()
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const title = computed(() => {
|
|
18
|
+
const invoice = target.value
|
|
19
|
+
if (!invoice) return ''
|
|
20
|
+
const amount = formatMinorUnits(invoice.amount, invoice.currency)
|
|
21
|
+
return invoice.number ? `${invoice.number} · ${amount}` : amount
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<UModal
|
|
27
|
+
v-model:open="open"
|
|
28
|
+
:title="$t('saas.tenant_billing.pay.title', { invoice: title })"
|
|
29
|
+
:ui="{ content: 'sm:max-w-md' }"
|
|
30
|
+
>
|
|
31
|
+
<template #body>
|
|
32
|
+
<PayInvoicePanel
|
|
33
|
+
v-if="target"
|
|
34
|
+
:invoice="target"
|
|
35
|
+
@paid="close"
|
|
36
|
+
@cancel="close"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
</UModal>
|
|
40
|
+
</template>
|