@antelopejs/dms-saas 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -2
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/owner-only-permissions-resolver.d.ts +1 -0
- package/dist/auth/owner-only-permissions-resolver.js +25 -0
- package/dist/auth/owner-only-permissions-resolver.js.map +1 -0
- package/dist/billing-state/directory-hooks.d.ts +1 -0
- package/dist/billing-state/directory-hooks.js +35 -0
- package/dist/billing-state/directory-hooks.js.map +1 -0
- package/dist/billing-state/directory.d.ts +29 -0
- package/dist/billing-state/directory.js +152 -0
- package/dist/billing-state/directory.js.map +1 -0
- package/dist/billing-state/index.d.ts +5 -1
- package/dist/billing-state/index.js +14 -2
- package/dist/billing-state/index.js.map +1 -1
- package/dist/billing-state/past-due-banner.d.ts +4 -3
- package/dist/billing-state/past-due-banner.js +30 -10
- package/dist/billing-state/past-due-banner.js.map +1 -1
- package/dist/billing-state/recovery.d.ts +4 -0
- package/dist/billing-state/recovery.js +7 -5
- package/dist/billing-state/recovery.js.map +1 -1
- package/dist/billing-state/trial-ending-banner.d.ts +4 -0
- package/dist/billing-state/trial-ending-banner.js +66 -0
- package/dist/billing-state/trial-ending-banner.js.map +1 -0
- package/dist/config/runtime.d.ts +1 -0
- package/dist/config/runtime.js +5 -0
- package/dist/config/runtime.js.map +1 -1
- package/dist/crons/auto-suspend-past-due.js +4 -5
- package/dist/crons/auto-suspend-past-due.js.map +1 -1
- package/dist/data-api/platformOwner/admin-user-invoices.d.ts +6 -4
- package/dist/data-api/platformOwner/admin-user-invoices.js +52 -30
- package/dist/data-api/platformOwner/admin-user-invoices.js.map +1 -1
- package/dist/data-api/platformOwner/admin-user-workspaces.d.ts +2 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.js +69 -3
- package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -1
- package/dist/data-api/platformOwner/credit-note-rows.d.ts +11 -0
- package/dist/data-api/platformOwner/credit-note-rows.js +54 -0
- package/dist/data-api/platformOwner/credit-note-rows.js.map +1 -0
- package/dist/data-api/platformOwner/credit-notes.d.ts +13 -0
- package/dist/data-api/platformOwner/credit-notes.js +149 -10
- package/dist/data-api/platformOwner/credit-notes.js.map +1 -1
- package/dist/data-api/platformOwner/features.d.ts +7 -2
- package/dist/data-api/platformOwner/features.js +151 -37
- package/dist/data-api/platformOwner/features.js.map +1 -1
- package/dist/data-api/platformOwner/invitations.js +29 -9
- package/dist/data-api/platformOwner/invitations.js.map +1 -1
- package/dist/data-api/platformOwner/invoice-cells.d.ts +5 -0
- package/dist/data-api/platformOwner/invoice-cells.js +51 -0
- package/dist/data-api/platformOwner/invoice-cells.js.map +1 -0
- package/dist/data-api/platformOwner/invoice-options.js.map +1 -1
- package/dist/data-api/platformOwner/invoice-rows.d.ts +9 -0
- package/dist/data-api/platformOwner/invoice-rows.js +39 -0
- package/dist/data-api/platformOwner/invoice-rows.js.map +1 -0
- package/dist/data-api/platformOwner/invoices.d.ts +24 -6
- package/dist/data-api/platformOwner/invoices.js +192 -11
- package/dist/data-api/platformOwner/invoices.js.map +1 -1
- package/dist/data-api/platformOwner/members.d.ts +2 -1
- package/dist/data-api/platformOwner/members.js +56 -20
- package/dist/data-api/platformOwner/members.js.map +1 -1
- package/dist/data-api/platformOwner/plan-migrations.d.ts +14 -2
- package/dist/data-api/platformOwner/plan-migrations.js +179 -33
- package/dist/data-api/platformOwner/plan-migrations.js.map +1 -1
- package/dist/data-api/platformOwner/plans.d.ts +30 -6
- package/dist/data-api/platformOwner/plans.js +269 -44
- package/dist/data-api/platformOwner/plans.js.map +1 -1
- package/dist/data-api/platformOwner/segments.d.ts +9 -7
- package/dist/data-api/platformOwner/segments.js +108 -101
- package/dist/data-api/platformOwner/segments.js.map +1 -1
- package/dist/data-api/platformOwner/table-scope.d.ts +6 -0
- package/dist/data-api/platformOwner/table-scope.js +8 -0
- package/dist/data-api/platformOwner/table-scope.js.map +1 -0
- package/dist/data-api/platformOwner/users.d.ts +15 -2
- package/dist/data-api/platformOwner/users.js +171 -15
- package/dist/data-api/platformOwner/users.js.map +1 -1
- package/dist/data-api/platformOwner/workspace-cells.d.ts +12 -0
- package/dist/data-api/platformOwner/workspace-cells.js +90 -0
- package/dist/data-api/platformOwner/workspace-cells.js.map +1 -0
- package/dist/data-api/platformOwner/workspaces.d.ts +26 -4
- package/dist/data-api/platformOwner/workspaces.js +269 -97
- package/dist/data-api/platformOwner/workspaces.js.map +1 -1
- package/dist/data-api/tenant/tenant-invoices.d.ts +4 -0
- package/dist/data-api/tenant/tenant-invoices.js +68 -4
- package/dist/data-api/tenant/tenant-invoices.js.map +1 -1
- package/dist/hooks/register.js +5 -1
- package/dist/hooks/register.js.map +1 -1
- package/dist/i18n/composed-text.d.ts +17 -0
- package/dist/i18n/composed-text.js +71 -0
- package/dist/i18n/composed-text.js.map +1 -0
- package/dist/implementations/dms-saas/billing.d.ts +1 -0
- package/dist/implementations/dms-saas/billing.js +4 -1
- package/dist/implementations/dms-saas/billing.js.map +1 -1
- package/dist/implementations/dms-saas/pages.d.ts +0 -1
- package/dist/implementations/dms-saas/pages.js +0 -4
- package/dist/implementations/dms-saas/pages.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics/activity-sources.d.ts +2 -0
- package/dist/metrics/activity-sources.js +60 -0
- package/dist/metrics/activity-sources.js.map +1 -0
- package/dist/metrics/activity.d.ts +25 -0
- package/dist/metrics/activity.js +197 -0
- package/dist/metrics/activity.js.map +1 -0
- package/dist/metrics/directory-summary.d.ts +30 -0
- package/dist/metrics/directory-summary.js +95 -0
- package/dist/metrics/directory-summary.js.map +1 -0
- package/dist/metrics/headline-items.d.ts +32 -0
- package/dist/metrics/headline-items.js +242 -0
- package/dist/metrics/headline-items.js.map +1 -0
- package/dist/metrics/normalised-mrr.d.ts +32 -0
- package/dist/metrics/normalised-mrr.js +75 -0
- package/dist/metrics/normalised-mrr.js.map +1 -0
- package/dist/metrics/revenue.d.ts +30 -0
- package/dist/metrics/revenue.js +126 -0
- package/dist/metrics/revenue.js.map +1 -0
- package/dist/notifications/recipients.d.ts +1 -0
- package/dist/notifications/recipients.js +4 -0
- package/dist/notifications/recipients.js.map +1 -1
- package/dist/notifications/subjects.d.ts +18 -17
- package/dist/notifications/subjects.js +7 -1
- package/dist/notifications/subjects.js.map +1 -1
- package/dist/operator-actions/commands.js +9 -6
- package/dist/operator-actions/commands.js.map +1 -1
- package/dist/operator-actions/invitation-commands.d.ts +7 -1
- package/dist/operator-actions/invitation-commands.js +16 -0
- package/dist/operator-actions/invitation-commands.js.map +1 -1
- package/dist/operator-actions/previews.d.ts +50 -0
- package/dist/operator-actions/previews.js +113 -0
- package/dist/operator-actions/previews.js.map +1 -0
- package/dist/operator-actions/types.d.ts +1 -1
- package/dist/operator-actions/upgrade-preview.d.ts +35 -0
- package/dist/operator-actions/upgrade-preview.js +110 -0
- package/dist/operator-actions/upgrade-preview.js.map +1 -0
- package/dist/operator-billing/billing-rules.d.ts +58 -0
- package/dist/operator-billing/billing-rules.js +90 -0
- package/dist/operator-billing/billing-rules.js.map +1 -0
- package/dist/operator-billing/billing-settings-store.d.ts +3 -0
- package/dist/operator-billing/billing-settings-store.js +34 -0
- package/dist/operator-billing/billing-settings-store.js.map +1 -0
- package/dist/operator-billing/billing-stats.d.ts +37 -0
- package/dist/operator-billing/billing-stats.js +197 -0
- package/dist/operator-billing/billing-stats.js.map +1 -0
- package/dist/operator-billing/credit-allowance.d.ts +17 -0
- package/dist/operator-billing/credit-allowance.js +44 -0
- package/dist/operator-billing/credit-allowance.js.map +1 -0
- package/dist/operator-billing/credit-note-request.d.ts +39 -0
- package/dist/operator-billing/credit-note-request.js +73 -0
- package/dist/operator-billing/credit-note-request.js.map +1 -0
- package/dist/operator-billing/index.d.ts +8 -0
- package/dist/operator-billing/index.js +25 -0
- package/dist/operator-billing/index.js.map +1 -0
- package/dist/operator-billing/invoice-credit.d.ts +41 -0
- package/dist/operator-billing/invoice-credit.js +111 -0
- package/dist/operator-billing/invoice-credit.js.map +1 -0
- package/dist/operator-billing/legal-documents-store.d.ts +12 -0
- package/dist/operator-billing/legal-documents-store.js +46 -0
- package/dist/operator-billing/legal-documents-store.js.map +1 -0
- package/dist/operator-billing/legal-versions.d.ts +5 -0
- package/dist/operator-billing/legal-versions.js +31 -0
- package/dist/operator-billing/legal-versions.js.map +1 -0
- package/dist/pages/block-meta.d.ts +15 -0
- package/dist/pages/block-meta.js +21 -0
- package/dist/pages/block-meta.js.map +1 -0
- package/dist/pages/module.d.ts +1 -3
- package/dist/pages/module.js +1 -8
- package/dist/pages/module.js.map +1 -1
- package/dist/pages/platform/credit-notes.d.ts +1 -0
- package/dist/pages/platform/credit-notes.js +63 -5
- package/dist/pages/platform/credit-notes.js.map +1 -1
- package/dist/pages/platform/dashboard.d.ts +4 -1
- package/dist/pages/platform/dashboard.js +123 -64
- package/dist/pages/platform/dashboard.js.map +1 -1
- package/dist/pages/platform/features.js +85 -12
- package/dist/pages/platform/features.js.map +1 -1
- package/dist/pages/platform/index.d.ts +1 -0
- package/dist/pages/platform/index.js +1 -0
- package/dist/pages/platform/index.js.map +1 -1
- package/dist/pages/platform/invoices.d.ts +6 -0
- package/dist/pages/platform/invoices.js +84 -28
- package/dist/pages/platform/invoices.js.map +1 -1
- package/dist/pages/platform/paths.d.ts +9 -0
- package/dist/pages/platform/paths.js +25 -0
- package/dist/pages/platform/paths.js.map +1 -0
- package/dist/pages/platform/plans/edit.d.ts +2 -2
- package/dist/pages/platform/plans/edit.js +170 -105
- package/dist/pages/platform/plans/edit.js.map +1 -1
- package/dist/pages/platform/plans/index.d.ts +1 -0
- package/dist/pages/platform/plans/index.js +177 -54
- package/dist/pages/platform/plans/index.js.map +1 -1
- package/dist/pages/platform/plans/migrations.d.ts +12 -0
- package/dist/pages/platform/plans/migrations.js +259 -13
- package/dist/pages/platform/plans/migrations.js.map +1 -1
- package/dist/pages/platform/segments/edit.d.ts +17 -0
- package/dist/pages/platform/segments/edit.js +124 -0
- package/dist/pages/platform/segments/edit.js.map +1 -0
- package/dist/pages/platform/segments/index.js +68 -8
- package/dist/pages/platform/segments/index.js.map +1 -1
- package/dist/pages/platform/settings.d.ts +1 -1
- package/dist/pages/platform/settings.js +164 -105
- package/dist/pages/platform/settings.js.map +1 -1
- package/dist/pages/platform/users/detail.js +112 -33
- package/dist/pages/platform/users/detail.js.map +1 -1
- package/dist/pages/platform/users/index.js +52 -18
- package/dist/pages/platform/users/index.js.map +1 -1
- package/dist/pages/platform/workspaces/detail.d.ts +3 -1
- package/dist/pages/platform/workspaces/detail.js +184 -113
- package/dist/pages/platform/workspaces/detail.js.map +1 -1
- package/dist/pages/platform/workspaces/index.d.ts +1 -20
- package/dist/pages/platform/workspaces/index.js +152 -180
- package/dist/pages/platform/workspaces/index.js.map +1 -1
- package/dist/pages/platform/workspaces/shared.d.ts +11 -0
- package/dist/pages/platform/workspaces/shared.js +53 -0
- package/dist/pages/platform/workspaces/shared.js.map +1 -0
- package/dist/pages/public/auth/no-workspace.js +7 -2
- package/dist/pages/public/auth/no-workspace.js.map +1 -1
- package/dist/pages/public/index.js.map +1 -1
- package/dist/pages/public/legal/privacy-policy.d.ts +1 -0
- package/dist/pages/public/legal/privacy-policy.js +9 -4
- package/dist/pages/public/legal/privacy-policy.js.map +1 -1
- package/dist/pages/public/legal/terms-and-conditions.d.ts +1 -0
- package/dist/pages/public/legal/terms-and-conditions.js +9 -4
- package/dist/pages/public/legal/terms-and-conditions.js.map +1 -1
- package/dist/pages/public/legal/terms-of-use.d.ts +1 -0
- package/dist/pages/public/legal/terms-of-use.js +9 -4
- package/dist/pages/public/legal/terms-of-use.js.map +1 -1
- package/dist/pages/public/nav-bar.d.ts +2 -0
- package/dist/pages/public/nav-bar.js +14 -0
- package/dist/pages/public/nav-bar.js.map +1 -0
- package/dist/pages/public/pricing.d.ts +10 -0
- package/dist/pages/public/pricing.js +32 -0
- package/dist/pages/public/pricing.js.map +1 -0
- package/dist/pages/public/register.d.ts +1 -0
- package/dist/pages/public/register.js +6 -3
- package/dist/pages/public/register.js.map +1 -1
- package/dist/pages/public/screens.js +1 -0
- package/dist/pages/public/screens.js.map +1 -1
- package/dist/pages/tenant/billing.d.ts +7 -7
- package/dist/pages/tenant/billing.js +141 -63
- package/dist/pages/tenant/billing.js.map +1 -1
- package/dist/pages/tenant/data-export.d.ts +3 -1
- package/dist/pages/tenant/data-export.js +25 -6
- package/dist/pages/tenant/data-export.js.map +1 -1
- package/dist/pages/tenant/general.d.ts +3 -2
- package/dist/pages/tenant/general.js +91 -11
- package/dist/pages/tenant/general.js.map +1 -1
- package/dist/pages/tenant/index.d.ts +1 -0
- package/dist/pages/tenant/index.js +1 -0
- package/dist/pages/tenant/index.js.map +1 -1
- package/dist/pages/tenant/members-seat-quota.d.ts +3 -0
- package/dist/pages/tenant/members-seat-quota.js +18 -6
- package/dist/pages/tenant/members-seat-quota.js.map +1 -1
- package/dist/pages/tenant/owner-only.d.ts +1 -0
- package/dist/pages/tenant/owner-only.js +14 -0
- package/dist/pages/tenant/owner-only.js.map +1 -0
- package/dist/pages/tenant/workspace-suspended.js +7 -3
- package/dist/pages/tenant/workspace-suspended.js.map +1 -1
- package/dist/plan-changes/applied-upgrade.d.ts +5 -0
- package/dist/plan-changes/applied-upgrade.js +51 -0
- package/dist/plan-changes/applied-upgrade.js.map +1 -0
- package/dist/plan-changes/deferred.js +9 -40
- package/dist/plan-changes/deferred.js.map +1 -1
- package/dist/plan-changes/immediate.d.ts +4 -0
- package/dist/plan-changes/immediate.js +34 -0
- package/dist/plan-changes/immediate.js.map +1 -0
- package/dist/plan-changes/index.d.ts +1 -0
- package/dist/plan-changes/index.js +1 -0
- package/dist/plan-changes/index.js.map +1 -1
- package/dist/plan-changes/pending-target.d.ts +17 -0
- package/dist/plan-changes/pending-target.js +62 -0
- package/dist/plan-changes/pending-target.js.map +1 -0
- package/dist/plans/catalogue-summary.d.ts +24 -0
- package/dist/plans/catalogue-summary.js +97 -0
- package/dist/plans/catalogue-summary.js.map +1 -0
- package/dist/plans/catalogue-usage.d.ts +36 -0
- package/dist/plans/catalogue-usage.js +120 -0
- package/dist/plans/catalogue-usage.js.map +1 -0
- package/dist/plans/feature-guards.d.ts +5 -0
- package/dist/plans/feature-guards.js +31 -0
- package/dist/plans/feature-guards.js.map +1 -0
- package/dist/plans/feature-usage.d.ts +4 -0
- package/dist/plans/feature-usage.js +22 -0
- package/dist/plans/feature-usage.js.map +1 -0
- package/dist/plans/migration-blocks.d.ts +13 -0
- package/dist/plans/migration-blocks.js +337 -0
- package/dist/plans/migration-blocks.js.map +1 -0
- package/dist/plans/migration-detail.d.ts +48 -0
- package/dist/plans/migration-detail.js +80 -0
- package/dist/plans/migration-detail.js.map +1 -0
- package/dist/plans/migration-dialogs.d.ts +8 -0
- package/dist/plans/migration-dialogs.js +103 -0
- package/dist/plans/migration-dialogs.js.map +1 -0
- package/dist/plans/migration-outcomes.d.ts +7 -0
- package/dist/plans/migration-outcomes.js +38 -0
- package/dist/plans/migration-outcomes.js.map +1 -0
- package/dist/plans/migration-realtime.d.ts +2 -0
- package/dist/plans/migration-realtime.js +19 -0
- package/dist/plans/migration-realtime.js.map +1 -0
- package/dist/plans/migration-workspaces.d.ts +40 -0
- package/dist/plans/migration-workspaces.js +121 -0
- package/dist/plans/migration-workspaces.js.map +1 -0
- package/dist/plans/money.d.ts +1 -0
- package/dist/plans/money.js +11 -0
- package/dist/plans/money.js.map +1 -0
- package/dist/plans/plan-access-type.d.ts +25 -0
- package/dist/plans/plan-access-type.js +49 -0
- package/dist/plans/plan-access-type.js.map +1 -0
- package/dist/plans/plan-audience.d.ts +3 -0
- package/dist/plans/plan-audience.js +9 -0
- package/dist/plans/plan-audience.js.map +1 -0
- package/dist/plans/plan-diff.d.ts +13 -0
- package/dist/plans/plan-diff.js +73 -0
- package/dist/plans/plan-diff.js.map +1 -0
- package/dist/plans/plan-permission-tree.d.ts +11 -0
- package/dist/plans/plan-permission-tree.js +58 -0
- package/dist/plans/plan-permission-tree.js.map +1 -0
- package/dist/plans/plan-write.d.ts +17 -0
- package/dist/plans/plan-write.js +111 -0
- package/dist/plans/plan-write.js.map +1 -0
- package/dist/plans/seat-capacity.d.ts +3 -1
- package/dist/plans/seat-capacity.js +10 -2
- package/dist/plans/seat-capacity.js.map +1 -1
- package/dist/plans/seat-hooks.d.ts +1 -0
- package/dist/plans/seat-hooks.js +1 -0
- package/dist/plans/seat-hooks.js.map +1 -1
- package/dist/plans/stripe-sync.d.ts +3 -0
- package/dist/plans/stripe-sync.js +16 -0
- package/dist/plans/stripe-sync.js.map +1 -1
- package/dist/routes/platformOwner/billing-settings.d.ts +11 -35
- package/dist/routes/platformOwner/billing-settings.js +77 -47
- package/dist/routes/platformOwner/billing-settings.js.map +1 -1
- package/dist/routes/platformOwner/billing-stats.d.ts +15 -0
- package/dist/routes/platformOwner/billing-stats.js +106 -0
- package/dist/routes/platformOwner/billing-stats.js.map +1 -0
- package/dist/routes/platformOwner/block-payloads.d.ts +7 -0
- package/dist/routes/platformOwner/block-payloads.js +3 -0
- package/dist/routes/platformOwner/block-payloads.js.map +1 -0
- package/dist/routes/platformOwner/credit-notes-issue.d.ts +7 -8
- package/dist/routes/platformOwner/credit-notes-issue.js +28 -16
- package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -1
- package/dist/routes/platformOwner/dashboard.d.ts +14 -57
- package/dist/routes/platformOwner/dashboard.js +126 -247
- package/dist/routes/platformOwner/dashboard.js.map +1 -1
- package/dist/routes/platformOwner/index.d.ts +7 -0
- package/dist/routes/platformOwner/index.js +7 -0
- package/dist/routes/platformOwner/index.js.map +1 -1
- package/dist/routes/platformOwner/plan-deletion.d.ts +77 -19
- package/dist/routes/platformOwner/plan-deletion.js +219 -67
- package/dist/routes/platformOwner/plan-deletion.js.map +1 -1
- package/dist/routes/platformOwner/plan-dialogs.d.ts +22 -0
- package/dist/routes/platformOwner/plan-dialogs.js +211 -0
- package/dist/routes/platformOwner/plan-dialogs.js.map +1 -0
- package/dist/routes/platformOwner/plan-migration-context.d.ts +9 -0
- package/dist/routes/platformOwner/plan-migration-context.js +147 -0
- package/dist/routes/platformOwner/plan-migration-context.js.map +1 -0
- package/dist/routes/platformOwner/plan-migration-export.d.ts +12 -0
- package/dist/routes/platformOwner/plan-migration-export.js +100 -0
- package/dist/routes/platformOwner/plan-migration-export.js.map +1 -0
- package/dist/routes/platformOwner/plan-migrations.d.ts +43 -0
- package/dist/routes/platformOwner/plan-migrations.js +260 -0
- package/dist/routes/platformOwner/plan-migrations.js.map +1 -0
- package/dist/routes/platformOwner/plans.d.ts +44 -41
- package/dist/routes/platformOwner/plans.js +155 -142
- package/dist/routes/platformOwner/plans.js.map +1 -1
- package/dist/routes/platformOwner/platform-owners.d.ts +8 -6
- package/dist/routes/platformOwner/platform-owners.js +40 -12
- package/dist/routes/platformOwner/platform-owners.js.map +1 -1
- package/dist/routes/platformOwner/segments-export.d.ts +15 -0
- package/dist/routes/platformOwner/segments-export.js +143 -0
- package/dist/routes/platformOwner/segments-export.js.map +1 -0
- package/dist/routes/platformOwner/segments.d.ts +17 -11
- package/dist/routes/platformOwner/segments.js +62 -113
- package/dist/routes/platformOwner/segments.js.map +1 -1
- package/dist/routes/platformOwner/stripe-dashboard.d.ts +6 -0
- package/dist/routes/platformOwner/stripe-dashboard.js +29 -0
- package/dist/routes/platformOwner/stripe-dashboard.js.map +1 -0
- package/dist/routes/platformOwner/users-detail.d.ts +12 -22
- package/dist/routes/platformOwner/users-detail.js +60 -53
- package/dist/routes/platformOwner/users-detail.js.map +1 -1
- package/dist/routes/platformOwner/workspace-detail.d.ts +36 -0
- package/dist/routes/platformOwner/workspace-detail.js +222 -0
- package/dist/routes/platformOwner/workspace-detail.js.map +1 -0
- package/dist/routes/platformOwner/workspace-invitations.d.ts +4 -0
- package/dist/routes/platformOwner/workspace-invitations.js +18 -0
- package/dist/routes/platformOwner/workspace-invitations.js.map +1 -1
- package/dist/routes/platformOwner/workspace-operator-actions.d.ts +14 -2
- package/dist/routes/platformOwner/workspace-operator-actions.js +42 -4
- package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -1
- package/dist/routes/platformOwner/workspaces-admin.d.ts +17 -12
- package/dist/routes/platformOwner/workspaces-admin.js +122 -28
- package/dist/routes/platformOwner/workspaces-admin.js.map +1 -1
- package/dist/routes/public/index.d.ts +1 -0
- package/dist/routes/public/index.js +1 -0
- package/dist/routes/public/index.js.map +1 -1
- package/dist/routes/public/legal-documents.d.ts +2 -8
- package/dist/routes/public/legal-documents.js +4 -39
- package/dist/routes/public/legal-documents.js.map +1 -1
- package/dist/routes/public/pricing.d.ts +12 -0
- package/dist/routes/public/pricing.js +50 -0
- package/dist/routes/public/pricing.js.map +1 -0
- package/dist/routes/public/public-plan-catalog.d.ts +37 -0
- package/dist/routes/public/public-plan-catalog.js +63 -0
- package/dist/routes/public/public-plan-catalog.js.map +1 -0
- package/dist/routes/public/register.d.ts +13 -0
- package/dist/routes/public/register.js +88 -4
- package/dist/routes/public/register.js.map +1 -1
- package/dist/routes/tenant/billing-pay-invoice.d.ts +13 -0
- package/dist/routes/tenant/billing-pay-invoice.js +82 -0
- package/dist/routes/tenant/billing-pay-invoice.js.map +1 -0
- package/dist/routes/tenant/billing-portal.d.ts +8 -3
- package/dist/routes/tenant/billing-portal.js +34 -16
- package/dist/routes/tenant/billing-portal.js.map +1 -1
- package/dist/routes/tenant/billing-self-refund.d.ts +26 -1
- package/dist/routes/tenant/billing-self-refund.js +95 -46
- package/dist/routes/tenant/billing-self-refund.js.map +1 -1
- package/dist/routes/tenant/complimentary-banner.d.ts +12 -0
- package/dist/routes/tenant/complimentary-banner.js +64 -0
- package/dist/routes/tenant/complimentary-banner.js.map +1 -0
- package/dist/routes/tenant/data-export.js +14 -0
- package/dist/routes/tenant/data-export.js.map +1 -1
- package/dist/routes/tenant/index.d.ts +7 -0
- package/dist/routes/tenant/index.js +7 -0
- package/dist/routes/tenant/index.js.map +1 -1
- package/dist/routes/tenant/tenant-billing.d.ts +1 -0
- package/dist/routes/tenant/tenant-billing.js +18 -13
- package/dist/routes/tenant/tenant-billing.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-authentication.d.ts +13 -0
- package/dist/routes/tenant/tenant-plan-authentication.js +79 -0
- package/dist/routes/tenant/tenant-plan-authentication.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-cancellation.d.ts +12 -0
- package/dist/routes/tenant/tenant-plan-cancellation.js +87 -0
- package/dist/routes/tenant/tenant-plan-cancellation.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-checkout.d.ts +3 -0
- package/dist/routes/tenant/tenant-plan-checkout.js +21 -11
- package/dist/routes/tenant/tenant-plan-checkout.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-ops.d.ts +32 -2
- package/dist/routes/tenant/tenant-plan-ops.js +112 -39
- package/dist/routes/tenant/tenant-plan-ops.js.map +1 -1
- package/dist/routes/tenant/tenant-plan-preview.d.ts +33 -0
- package/dist/routes/tenant/tenant-plan-preview.js +216 -0
- package/dist/routes/tenant/tenant-plan-preview.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-resubscription.d.ts +2 -0
- package/dist/routes/tenant/tenant-plan-resubscription.js +61 -0
- package/dist/routes/tenant/tenant-plan-resubscription.js.map +1 -0
- package/dist/routes/tenant/tenant-plan.d.ts +9 -4
- package/dist/routes/tenant/tenant-plan.js +124 -16
- package/dist/routes/tenant/tenant-plan.js.map +1 -1
- package/dist/routes/tenant/tenant-seats.d.ts +6 -1
- package/dist/routes/tenant/tenant-seats.js +26 -5
- package/dist/routes/tenant/tenant-seats.js.map +1 -1
- package/dist/routes/tenant/tenant-upcoming-invoice.d.ts +26 -0
- package/dist/routes/tenant/tenant-upcoming-invoice.js +200 -0
- package/dist/routes/tenant/tenant-upcoming-invoice.js.map +1 -0
- package/dist/routes/tenant/workspace-access.d.ts +67 -0
- package/dist/routes/tenant/workspace-access.js +224 -0
- package/dist/routes/tenant/workspace-access.js.map +1 -0
- package/dist/routes/tenant/workspaces.d.ts +12 -43
- package/dist/routes/tenant/workspaces.js +82 -192
- package/dist/routes/tenant/workspaces.js.map +1 -1
- package/dist/segments/index.d.ts +29 -0
- package/dist/segments/index.js +116 -0
- package/dist/segments/index.js.map +1 -0
- package/dist/stripe/client.d.ts +1 -0
- package/dist/stripe/client.js +11 -0
- package/dist/stripe/client.js.map +1 -1
- package/dist/stripe/customer-locale.d.ts +3 -0
- package/dist/stripe/customer-locale.js +36 -0
- package/dist/stripe/customer-locale.js.map +1 -0
- package/dist/stripe/dashboard-links.d.ts +2 -0
- package/dist/stripe/dashboard-links.js +8 -0
- package/dist/stripe/dashboard-links.js.map +1 -0
- package/dist/stripe/index.d.ts +3 -0
- package/dist/stripe/index.js +3 -0
- package/dist/stripe/index.js.map +1 -1
- package/dist/stripe/pending-update.d.ts +5 -0
- package/dist/stripe/pending-update.js +56 -0
- package/dist/stripe/pending-update.js.map +1 -0
- package/dist/stripe/plan-schedule.js +4 -1
- package/dist/stripe/plan-schedule.js.map +1 -1
- package/dist/stripe/subscription-cancellation.d.ts +3 -0
- package/dist/stripe/subscription-cancellation.js +26 -0
- package/dist/stripe/subscription-cancellation.js.map +1 -0
- package/dist/stripe/sync-plan.js +5 -6
- package/dist/stripe/sync-plan.js.map +1 -1
- package/dist/stripe/upcoming-invoice.d.ts +9 -0
- package/dist/stripe/upcoming-invoice.js +19 -3
- package/dist/stripe/upcoming-invoice.js.map +1 -1
- package/dist/stripe/webhook-checkout.js +2 -0
- package/dist/stripe/webhook-checkout.js.map +1 -1
- package/dist/stripe/webhook-credit-notes.js +15 -0
- package/dist/stripe/webhook-credit-notes.js.map +1 -1
- package/dist/stripe/webhook-dispatch.js +2 -0
- package/dist/stripe/webhook-dispatch.js.map +1 -1
- package/dist/stripe/webhook-handlers.d.ts +1 -0
- package/dist/stripe/webhook-handlers.js +34 -9
- package/dist/stripe/webhook-handlers.js.map +1 -1
- package/dist/stripe/webhook-shared.d.ts +3 -1
- package/dist/stripe/webhook-shared.js +20 -1
- package/dist/stripe/webhook-shared.js.map +1 -1
- package/dist/stripe/workspace-checkout.d.ts +2 -0
- package/dist/stripe/workspace-checkout.js +4 -0
- package/dist/stripe/workspace-checkout.js.map +1 -1
- package/dist/types/config.d.ts +2 -0
- package/dist/types/config.js.map +1 -1
- package/dist/upcoming-invoice/mapping.js +1 -0
- package/dist/upcoming-invoice/mapping.js.map +1 -1
- package/dist/users/index.d.ts +4 -0
- package/dist/users/index.js +21 -0
- package/dist/users/index.js.map +1 -0
- package/dist/users/platform-role.d.ts +18 -0
- package/dist/users/platform-role.js +127 -0
- package/dist/users/platform-role.js.map +1 -0
- package/dist/users/user-detail.d.ts +43 -0
- package/dist/users/user-detail.js +100 -0
- package/dist/users/user-detail.js.map +1 -0
- package/dist/users/user-facts.d.ts +10 -0
- package/dist/users/user-facts.js +157 -0
- package/dist/users/user-facts.js.map +1 -0
- package/dist/users/user-segments.d.ts +10 -0
- package/dist/users/user-segments.js +32 -0
- package/dist/users/user-segments.js.map +1 -0
- package/dist/utils/billing-displays.d.ts +6 -0
- package/dist/utils/billing-displays.js +17 -0
- package/dist/utils/billing-displays.js.map +1 -0
- package/dist/utils/billing-document-status.d.ts +0 -4
- package/dist/utils/billing-document-status.js +1 -13
- package/dist/utils/billing-document-status.js.map +1 -1
- package/dist/utils/billing-document-type.d.ts +6 -0
- package/dist/utils/billing-document-type.js +13 -0
- package/dist/utils/billing-document-type.js.map +1 -1
- package/dist/utils/csv-file.d.ts +2 -0
- package/dist/utils/csv-file.js +23 -0
- package/dist/utils/csv-file.js.map +1 -0
- package/dist/utils/form-insight-type.d.ts +8 -0
- package/dist/utils/form-insight-type.js +34 -0
- package/dist/utils/form-insight-type.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/language.d.ts +1 -0
- package/dist/utils/language.js +7 -0
- package/dist/utils/language.js.map +1 -0
- package/dist/utils/money.d.ts +2 -0
- package/dist/utils/money.js +24 -0
- package/dist/utils/money.js.map +1 -0
- package/dist/utils/segment-evaluator.d.ts +4 -0
- package/dist/utils/segment-evaluator.js +15 -8
- package/dist/utils/segment-evaluator.js.map +1 -1
- package/dist/utils/segment-explain.d.ts +10 -0
- package/dist/utils/segment-explain.js +31 -0
- package/dist/utils/segment-explain.js.map +1 -0
- package/dist/utils/segment-fields.d.ts +13 -2
- package/dist/utils/segment-fields.js +137 -116
- package/dist/utils/segment-fields.js.map +1 -1
- package/dist/utils/segment-matching.d.ts +14 -3
- package/dist/utils/segment-matching.js +47 -13
- package/dist/utils/segment-matching.js.map +1 -1
- package/dist/utils/segment-preview.d.ts +31 -0
- package/dist/utils/segment-preview.js +83 -0
- package/dist/utils/segment-preview.js.map +1 -0
- package/dist/utils/segment-user-projection.d.ts +3 -0
- package/dist/utils/segment-user-projection.js +31 -0
- package/dist/utils/segment-user-projection.js.map +1 -0
- package/dist/utils/segment-validation.d.ts +14 -0
- package/dist/utils/segment-validation.js +98 -0
- package/dist/utils/segment-validation.js.map +1 -0
- package/dist/utils/status-vocabulary.d.ts +57 -0
- package/dist/utils/status-vocabulary.js +92 -0
- package/dist/utils/status-vocabulary.js.map +1 -0
- package/dist/workers/index.d.ts +1 -0
- package/dist/workers/index.js +1 -0
- package/dist/workers/index.js.map +1 -1
- package/dist/workers/plan-migration-resolution.d.ts +14 -0
- package/dist/workers/plan-migration-resolution.js +99 -0
- package/dist/workers/plan-migration-resolution.js.map +1 -0
- package/dist/workers/plan-migration.d.ts +6 -1
- package/dist/workers/plan-migration.js +152 -37
- package/dist/workers/plan-migration.js.map +1 -1
- package/dist/workspaces/billing-identity-lock.d.ts +1 -0
- package/dist/workspaces/billing-identity-lock.js +18 -0
- package/dist/workspaces/billing-identity-lock.js.map +1 -0
- package/dist/workspaces/complimentary-banner.d.ts +11 -0
- package/dist/workspaces/complimentary-banner.js +83 -0
- package/dist/workspaces/complimentary-banner.js.map +1 -0
- package/dist/workspaces/default-member-role.d.ts +2 -0
- package/dist/workspaces/default-member-role.js +43 -0
- package/dist/workspaces/default-member-role.js.map +1 -0
- package/dist/workspaces/deletion-request.d.ts +2 -0
- package/dist/workspaces/deletion-request.js +5 -0
- package/dist/workspaces/deletion-request.js.map +1 -0
- package/dist/workspaces/deletion.d.ts +1 -1
- package/dist/workspaces/deletion.js +19 -7
- package/dist/workspaces/deletion.js.map +1 -1
- package/dist/workspaces/detail-items.d.ts +15 -0
- package/dist/workspaces/detail-items.js +226 -0
- package/dist/workspaces/detail-items.js.map +1 -0
- package/dist/workspaces/first-payment.d.ts +5 -0
- package/dist/workspaces/first-payment.js +28 -0
- package/dist/workspaces/first-payment.js.map +1 -0
- package/dist/workspaces/free-workspaces-per-card.d.ts +6 -0
- package/dist/workspaces/free-workspaces-per-card.js +58 -0
- package/dist/workspaces/free-workspaces-per-card.js.map +1 -0
- package/dist/workspaces/index.d.ts +7 -0
- package/dist/workspaces/index.js +7 -0
- package/dist/workspaces/index.js.map +1 -1
- package/dist/workspaces/invitations.d.ts +2 -1
- package/dist/workspaces/invitations.js +16 -6
- package/dist/workspaces/invitations.js.map +1 -1
- package/dist/workspaces/my-workspaces.d.ts +13 -0
- package/dist/workspaces/my-workspaces.js +68 -0
- package/dist/workspaces/my-workspaces.js.map +1 -0
- package/dist/workspaces/operator-creation.d.ts +39 -0
- package/dist/workspaces/operator-creation.js +123 -0
- package/dist/workspaces/operator-creation.js.map +1 -0
- package/dist/workspaces/operator-view.d.ts +13 -0
- package/dist/workspaces/operator-view.js +37 -0
- package/dist/workspaces/operator-view.js.map +1 -0
- package/dist/workspaces/owner-contact.d.ts +7 -0
- package/dist/workspaces/owner-contact.js +24 -0
- package/dist/workspaces/owner-contact.js.map +1 -0
- package/dist/workspaces/owner-invitation-email.d.ts +12 -0
- package/dist/workspaces/owner-invitation-email.js +53 -0
- package/dist/workspaces/owner-invitation-email.js.map +1 -0
- package/dist/workspaces/provisioning.d.ts +2 -0
- package/dist/workspaces/provisioning.js +37 -15
- package/dist/workspaces/provisioning.js.map +1 -1
- package/dist/workspaces/self-serve-creation.d.ts +38 -0
- package/dist/workspaces/self-serve-creation.js +106 -0
- package/dist/workspaces/self-serve-creation.js.map +1 -0
- package/dist/workspaces/workspace-glance.d.ts +3 -0
- package/dist/workspaces/workspace-glance.js +93 -0
- package/dist/workspaces/workspace-glance.js.map +1 -0
- package/dist/workspaces/workspace-name.d.ts +2 -0
- package/dist/workspaces/workspace-name.js +14 -0
- package/dist/workspaces/workspace-name.js.map +1 -0
- package/dist/workspaces/workspace-overview.d.ts +41 -0
- package/dist/workspaces/workspace-overview.js +84 -0
- package/dist/workspaces/workspace-overview.js.map +1 -0
- package/dist/workspaces/workspace-owner.d.ts +7 -0
- package/dist/workspaces/workspace-owner.js +14 -0
- package/dist/workspaces/workspace-owner.js.map +1 -0
- package/frontend-vue/app/build/PayInvoiceDialog.vue +40 -0
- package/frontend-vue/app/build/PayInvoicePanel.vue +203 -0
- package/frontend-vue/app/build/PlanChangeReview.vue +415 -0
- package/frontend-vue/app/build/PlanFeatureValueInput.vue +143 -0
- package/frontend-vue/app/build/PlanPermissionPicker.vue +246 -0
- package/frontend-vue/app/build/WorkspaceSwitcherRow.vue +116 -0
- package/frontend-vue/app/build/components/CreditNoteInvoiceSummary.vue +82 -0
- package/frontend-vue/app/build/components/FormFieldRow.vue +97 -0
- package/frontend-vue/app/build/components/FormRows.vue +26 -0
- package/frontend-vue/app/build/components/RequiredLegend.vue +7 -0
- package/frontend-vue/app/build/composables/useCreditNoteDraft.ts +142 -0
- package/frontend-vue/app/build/composables/useCreditNoteTexts.ts +123 -0
- package/frontend-vue/app/build/composables/useLiveFormValues.ts +49 -0
- package/frontend-vue/app/build/day-formats.ts +17 -0
- package/frontend-vue/app/build/highlight.ts +28 -0
- package/frontend-vue/app/build/plan-catalog.ts +161 -0
- package/frontend-vue/app/build/plan-change-heading.ts +81 -0
- package/frontend-vue/app/build/plan-permissions.ts +92 -0
- package/frontend-vue/app/build/plan-retire.ts +83 -0
- package/frontend-vue/app/build/public/AccessTimeline.vue +68 -0
- package/frontend-vue/app/build/public/LegalAcceptance.vue +51 -0
- package/frontend-vue/app/build/public/OtherWorkspaces.vue +88 -0
- package/frontend-vue/app/build/public/PricingComparison.vue +227 -0
- package/frontend-vue/app/build/public/PricingFaq.vue +76 -0
- package/frontend-vue/app/build/public/PublicStage.vue +72 -0
- package/frontend-vue/app/build/public/RegistrationCardField.vue +74 -0
- package/frontend-vue/app/build/public/RegistrationPlanCard.vue +122 -0
- package/frontend-vue/app/build/public/access.ts +118 -0
- package/frontend-vue/app/build/public/chosen-plan.ts +36 -0
- package/frontend-vue/app/build/public/legal.ts +99 -0
- package/frontend-vue/app/build/public/pricing.ts +175 -0
- package/frontend-vue/app/build/public/routes.ts +122 -0
- package/frontend-vue/app/build/public/usePublicFetch.ts +44 -0
- package/frontend-vue/app/build/public/usePublicPlanFormat.ts +52 -0
- package/frontend-vue/app/build/segments/tree.ts +137 -0
- package/frontend-vue/app/build/segments/types.ts +119 -0
- package/frontend-vue/app/build/segments/useSegmentCatalog.ts +58 -0
- package/frontend-vue/app/build/segments/useSegmentDraft.ts +33 -0
- package/frontend-vue/app/build/segments/useSegmentPreview.ts +78 -0
- package/frontend-vue/app/build/segments/useSegmentSentence.ts +60 -0
- package/frontend-vue/app/build/segments/useSegmentWords.ts +204 -0
- package/frontend-vue/app/build/useWorkspaceName.ts +14 -0
- package/frontend-vue/app/build/users/useUserDetail.ts +82 -0
- package/frontend-vue/app/build/workspace-detail/ComplimentaryDialog.vue +219 -0
- package/frontend-vue/app/build/workspace-detail/CreditDialog.vue +243 -0
- package/frontend-vue/app/build/workspace-detail/UpgradeDialog.vue +258 -0
- package/frontend-vue/app/build/workspace-detail/WorkspaceActionDialogs.vue +82 -0
- package/frontend-vue/app/build/workspace-detail/planPrice.ts +26 -0
- package/frontend-vue/app/build/workspace-detail/types.ts +138 -0
- package/frontend-vue/app/build/workspace-detail/useWorkspaceActions.ts +177 -0
- package/frontend-vue/app/build/workspace-detail/useWorkspaceOverview.ts +44 -0
- package/frontend-vue/app/build/workspace-paths.ts +8 -0
- package/frontend-vue/app/components/BillingIdentityFields.vue +294 -161
- package/frontend-vue/app/components/CustomerPortalButton.vue +80 -32
- package/frontend-vue/app/components/DataExport.vue +250 -260
- package/frontend-vue/app/components/DataExportHistory.vue +246 -0
- package/frontend-vue/app/components/DunningTimeline.vue +120 -0
- package/frontend-vue/app/components/IssueCreditNoteModal.vue +318 -116
- package/frontend-vue/app/components/LegalDocumentRelease.vue +64 -0
- package/frontend-vue/app/components/LegalLayout.vue +284 -46
- package/frontend-vue/app/components/MigrationStripeCheck.vue +133 -0
- package/frontend-vue/app/components/PastDueAlert.vue +186 -78
- package/frontend-vue/app/components/PastDueBanner.vue +96 -67
- package/frontend-vue/app/components/PayInvoiceModal.vue +57 -0
- package/frontend-vue/app/components/PaymentMethodCard.vue +159 -163
- package/frontend-vue/app/components/PendingCheckoutModal.vue +61 -61
- package/frontend-vue/app/components/PlanAccessEditor.vue +410 -0
- package/frontend-vue/app/components/PlanCard.vue +358 -261
- package/frontend-vue/app/components/PlanCardPublic.vue +123 -51
- package/frontend-vue/app/components/PlanComparisonModal.vue +373 -309
- package/frontend-vue/app/components/PlanEditorPreview.vue +374 -0
- package/frontend-vue/app/components/PlanLimitInput.vue +92 -0
- package/frontend-vue/app/components/PlanTaxSync.vue +118 -0
- package/frontend-vue/app/components/PlanUpgradeModal.vue +265 -156
- package/frontend-vue/app/components/PlatformNotes.vue +215 -255
- package/frontend-vue/app/components/Pricing.vue +236 -0
- package/frontend-vue/app/components/PublicNavBar.vue +70 -0
- package/frontend-vue/app/components/RefundButton.vue +265 -113
- package/frontend-vue/app/components/RefundExample.vue +86 -0
- package/frontend-vue/app/components/Register.vue +217 -121
- package/frontend-vue/app/components/RegistrationClosed.vue +30 -13
- package/frontend-vue/app/components/RetirePlanModal.vue +829 -0
- package/frontend-vue/app/components/SeatQuotaBanner.vue +240 -90
- package/frontend-vue/app/components/SegmentConditionRow.vue +171 -0
- package/frontend-vue/app/components/SegmentConditionsBuilder.vue +89 -162
- package/frontend-vue/app/components/SegmentConditionsGroup.vue +273 -463
- package/frontend-vue/app/components/SegmentLivePreview.vue +301 -0
- package/frontend-vue/app/components/SegmentLogicToggle.vue +24 -0
- package/frontend-vue/app/components/SegmentRulesText.vue +57 -0
- package/frontend-vue/app/components/SegmentValueInput.vue +165 -0
- package/frontend-vue/app/components/SegmentWords.vue +36 -0
- package/frontend-vue/app/components/TenantBillingForm.vue +142 -103
- package/frontend-vue/app/components/TenantPlanCard.vue +635 -280
- package/frontend-vue/app/components/TrialEndingBanner.vue +76 -0
- package/frontend-vue/app/components/UserPlatformRoleCard.vue +102 -0
- package/frontend-vue/app/components/UserSegmentMatches.vue +123 -0
- package/frontend-vue/app/components/UserSummaryCard.vue +107 -158
- package/frontend-vue/app/components/WorkspaceAdminCreateModal.vue +354 -177
- package/frontend-vue/app/components/WorkspaceCreateModal.vue +372 -252
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +178 -126
- package/frontend-vue/app/components/WorkspaceDetailHeader.vue +262 -19
- package/frontend-vue/app/components/WorkspaceInvitationLink.vue +108 -86
- package/frontend-vue/app/components/WorkspaceOperatorActions.vue +105 -330
- package/frontend-vue/app/components/WorkspaceSuspendButton.vue +34 -158
- package/frontend-vue/app/components/WorkspaceSuspended.vue +390 -149
- package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +145 -161
- package/frontend-vue/app/composables/useBillingIdentity.ts +97 -95
- package/frontend-vue/app/composables/useBillingStatus.ts +56 -24
- package/frontend-vue/app/composables/useCurrentWorkspace.ts +15 -30
- package/frontend-vue/app/composables/useDaysLeft.ts +20 -0
- package/frontend-vue/app/composables/useExportHistory.ts +209 -120
- package/frontend-vue/app/composables/useInvitationLink.ts +39 -53
- package/frontend-vue/app/composables/useMoneyFormat.ts +64 -33
- package/frontend-vue/app/composables/useMyWorkspaces.ts +41 -32
- package/frontend-vue/app/composables/useNextInvoice.ts +20 -0
- package/frontend-vue/app/composables/usePayInvoice.ts +52 -0
- package/frontend-vue/app/composables/usePendingCheckout.ts +71 -67
- package/frontend-vue/app/composables/usePlanCatalog.ts +16 -0
- package/frontend-vue/app/composables/usePlanChangeReview.ts +115 -0
- package/frontend-vue/app/composables/usePlanComparison.ts +17 -8
- package/frontend-vue/app/composables/usePlanDowngrade.ts +25 -23
- package/frontend-vue/app/composables/usePlanFeatureFormat.ts +238 -202
- package/frontend-vue/app/composables/usePlanPriceLabel.ts +28 -0
- package/frontend-vue/app/composables/useSaasRegistration.ts +516 -301
- package/frontend-vue/app/composables/useSaasStatus.ts +81 -0
- package/frontend-vue/app/composables/useSeatQuota.ts +27 -17
- package/frontend-vue/app/composables/useServerConfirm.ts +44 -0
- package/frontend-vue/app/composables/useStripePaymentElement.ts +3 -5
- package/frontend-vue/app/composables/useTenantPlan.ts +235 -99
- package/frontend-vue/app/composables/useUpgradeAuthentication.ts +37 -0
- package/frontend-vue/app/composables/useWorkspaceFinalization.ts +4 -0
- package/frontend-vue/app/composables/useWorkspaceOverview.ts +58 -0
- package/frontend-vue/app/composables/useWorkspaceRenamed.ts +33 -0
- package/frontend-vue/app/custom-pages/auth/no-workspace.vue +391 -312
- package/frontend-vue/app/plugins/auth-links.ts +38 -17
- package/frontend-vue/app/plugins/billing-data-types.ts +111 -58
- package/frontend-vue/app/plugins/footer-links.ts +13 -33
- package/frontend-vue/app/plugins/segment-conditions-data-type.ts +45 -0
- package/frontend-vue/app/plugins/sidebar-widgets.ts +13 -10
- package/frontend-vue/app/types/runtime-config.ts +9 -4
- package/frontend-vue/dms.frontend.build.ts +7 -0
- package/frontend-vue/dms.frontend.ts +6 -13
- package/frontend-vue/i18n/locales/saas-en-GB.json +499 -1380
- package/frontend-vue/i18n/locales/saas-fr-FR.json +499 -1380
- package/frontend-vue/i18n/locales/saas-operator-billing-en-GB.json +282 -0
- package/frontend-vue/i18n/locales/saas-operator-billing-fr-FR.json +282 -0
- package/frontend-vue/i18n/locales/saas-operator-catalog-en-GB.json +597 -0
- package/frontend-vue/i18n/locales/saas-operator-catalog-fr-FR.json +597 -0
- package/frontend-vue/i18n/locales/saas-operator-users-en-GB.json +505 -0
- package/frontend-vue/i18n/locales/saas-operator-users-fr-FR.json +505 -0
- package/frontend-vue/i18n/locales/saas-operator-workspaces-en-GB.json +595 -0
- package/frontend-vue/i18n/locales/saas-operator-workspaces-fr-FR.json +595 -0
- package/frontend-vue/i18n/locales/saas-public-en-GB.json +305 -0
- package/frontend-vue/i18n/locales/saas-public-fr-FR.json +305 -0
- package/frontend-vue/i18n/locales/saas-tenant-billing-en-GB.json +434 -0
- package/frontend-vue/i18n/locales/saas-tenant-billing-fr-FR.json +434 -0
- package/frontend-vue/i18n/locales/saas-tenant-workspace-en-GB.json +252 -0
- package/frontend-vue/i18n/locales/saas-tenant-workspace-fr-FR.json +252 -0
- package/frontend-vue/package.json +1 -1
- package/package.json +10 -10
- package/frontend-vue/app/components/CardGrid.vue +0 -77
- package/frontend-vue/app/components/DeletePlanModal.vue +0 -223
- package/frontend-vue/app/components/FreeAccessBanner.vue +0 -70
- package/frontend-vue/app/components/PlanCardsDisplay.vue +0 -127
- package/frontend-vue/app/components/PlanInheritancePicker.vue +0 -329
- package/frontend-vue/app/components/RecentActivity.vue +0 -72
- package/frontend-vue/app/components/WorkspaceBillingInfo.vue +0 -68
- package/frontend-vue/app/components/WorkspaceCompAccessButton.vue +0 -198
- package/frontend-vue/app/components/WorkspaceIdentity.vue +0 -99
- package/frontend-vue/app/components/WorkspaceJoinButton.vue +0 -50
- package/frontend-vue/app/components/WorkspaceSummaryCard.vue +0 -185
- package/frontend-vue/app/composables/useDetailRefresh.ts +0 -17
- package/frontend-vue/app/composables/usePastDueBannerAction.ts +0 -20
- package/frontend-vue/app/plugins/plan-cards-display.ts +0 -16
- package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +0 -122
|
@@ -15,143 +15,78 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.SaasWorkspacesController = void 0;
|
|
16
16
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
17
|
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
18
|
-
const interface_database_1 = require("@antelopejs/interface-database");
|
|
19
18
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
20
19
|
const db_1 = require("@antelopejs/interface-dms/db");
|
|
21
20
|
const guards_1 = require("@antelopejs/interface-dms/guards");
|
|
22
21
|
const request_tenant_1 = require("@antelopejs/interface-dms/request-tenant");
|
|
23
|
-
const tenant_ownership_1 = require("@antelopejs/interface-dms/tenant-ownership");
|
|
24
22
|
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
25
|
-
const db_2 = require("@antelopejs/interface-dms/auth/db");
|
|
26
|
-
const db_3 = require("../../db");
|
|
27
23
|
const stripe_1 = require("../../stripe");
|
|
28
24
|
const config_1 = require("../../config");
|
|
29
|
-
const plans_1 = require("../../plans");
|
|
30
|
-
const utils_1 = require("../../utils");
|
|
31
25
|
const workspaces_1 = require("../../workspaces");
|
|
32
26
|
const HTTP_NOT_FOUND = 404;
|
|
33
|
-
const HTTP_CONFLICT = 409;
|
|
34
27
|
const HTTP_BAD_REQUEST = 400;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(0, workspaces_1.
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
(0, interface_api_util_1.assert)((0, workspaces_1.isFreePlan)(plan), HTTP_BAD_REQUEST, "saas.errors.workspace.payment_method_required");
|
|
42
|
-
}
|
|
43
|
-
async function buildMemberRows(members, userModel) {
|
|
44
|
-
const memberUsers = await Promise.all(members.map((m) => userModel.get(m.userId)));
|
|
45
|
-
return members.map((m, i) => ({
|
|
46
|
-
_id: m._id,
|
|
47
|
-
userId: m.userId,
|
|
48
|
-
email: memberUsers[i]?.email ?? m.userId,
|
|
49
|
-
name: memberUsers[i]?.name ?? null,
|
|
50
|
-
isTenantOwner: m.isTenantOwner,
|
|
51
|
-
joinedAt: m.joinedAt,
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
function sortByIssuedAtDesc(items) {
|
|
55
|
-
return items
|
|
56
|
-
.slice()
|
|
57
|
-
.sort((a, b) => +new Date(b.issuedAt) - +new Date(a.issuedAt));
|
|
58
|
-
}
|
|
59
|
-
async function loadWorkspaceRelations(tenantId, planModel) {
|
|
60
|
-
const tenantSubscriptionModel = (0, interface_database_decorators_1.GetModel)(db_3.TenantSubscriptionModel, tenantId);
|
|
61
|
-
const tenantBillingInfoModel = (0, interface_database_decorators_1.GetModel)(db_3.TenantBillingInfoModel, tenantId);
|
|
62
|
-
const memberModel = (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId);
|
|
63
|
-
const invoiceModel = (0, interface_database_decorators_1.GetModel)(db_3.InvoiceModel, tenantId);
|
|
64
|
-
const creditNoteModel = (0, interface_database_decorators_1.GetModel)(db_3.CreditNoteModel, tenantId);
|
|
65
|
-
const [subscription, billingInfo, members, invoices, creditNotes] = await Promise.all([
|
|
66
|
-
tenantSubscriptionModel.findOne(),
|
|
67
|
-
tenantBillingInfoModel.findOne(),
|
|
68
|
-
memberModel.listAll(),
|
|
69
|
-
invoiceModel.getAllInvoices(),
|
|
70
|
-
creditNoteModel.getAll(),
|
|
28
|
+
async function prepareSelfServeCreation(user, ctx, body, card) {
|
|
29
|
+
const workspaceName = (0, workspaces_1.normalizeWorkspaceName)(body.workspaceName);
|
|
30
|
+
const [billingProfile, freeWorkspacesPerCard] = await Promise.all([
|
|
31
|
+
(0, workspaces_1.resolveBillingProfileForNewWorkspace)(user._id, card, (0, request_tenant_1.getRequestTenantId)(ctx)),
|
|
32
|
+
(0, workspaces_1.resolveFreeWorkspacesPerCard)(),
|
|
71
33
|
]);
|
|
72
|
-
const plan =
|
|
73
|
-
|
|
74
|
-
:
|
|
75
|
-
|
|
34
|
+
const plan = await (0, workspaces_1.ensurePlanIsAvailableForCustomer)(body.planId, billingProfile.customerType);
|
|
35
|
+
const cardUse = await (0, workspaces_1.resolveSelfServeCardUse)({
|
|
36
|
+
requirement: (0, workspaces_1.cardRequirementOf)(plan, freeWorkspacesPerCard),
|
|
37
|
+
paymentMethodId: body.paymentMethodId,
|
|
38
|
+
card,
|
|
39
|
+
billingProfile,
|
|
40
|
+
freeWorkspacesPerCard,
|
|
41
|
+
});
|
|
42
|
+
return { ...cardUse, workspaceName, planId: body.planId, billingProfile };
|
|
76
43
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
44
|
+
async function provisionSelfServeWorkspace(user, input) {
|
|
45
|
+
const handles = { userId: user._id };
|
|
46
|
+
try {
|
|
47
|
+
const { tenantId } = await (0, workspaces_1.provisionWorkspace)({
|
|
48
|
+
userId: user._id,
|
|
49
|
+
ownerLanguage: user.language,
|
|
50
|
+
payload: {
|
|
51
|
+
...input.billingProfile,
|
|
52
|
+
workspaceName: input.workspaceName,
|
|
53
|
+
planId: input.planId,
|
|
54
|
+
paymentMethodId: input.paymentMethodId,
|
|
55
|
+
},
|
|
56
|
+
stripeCustomerProfile: {
|
|
57
|
+
...input.billingProfile,
|
|
58
|
+
email: user.email,
|
|
59
|
+
fallbackName: user.name,
|
|
86
60
|
},
|
|
87
|
-
|
|
61
|
+
card: input.card,
|
|
62
|
+
handles,
|
|
63
|
+
});
|
|
64
|
+
return { tenantId };
|
|
88
65
|
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
await (0, workspaces_1.rollbackWorkspaceProvisioning)(handles);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
class SaasWorkspacesController extends (0, interface_api_1.Controller)("/api/saas/workspaces") {
|
|
89
72
|
async listMine(user, ctx) {
|
|
90
|
-
|
|
91
|
-
const memberModel = (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, interface_database_1.CROSS_INSTANCE);
|
|
92
|
-
const memberships = await memberModel.listByUserWithTenantIds(user._id);
|
|
93
|
-
if (memberships.length === 0)
|
|
94
|
-
return [];
|
|
95
|
-
const tenants = await this.tenantModel.getMany(memberships.map((m) => m.tenantId));
|
|
96
|
-
const summaries = await this.resolveSubscriptionSummaries(tenants.map((tenant) => tenant._id));
|
|
97
|
-
return (tenants
|
|
98
|
-
.filter((tenant) => summaries.get(tenant._id)?.status !== CANCELLED_STATUS)
|
|
99
|
-
.map((tenant) => ({
|
|
100
|
-
_id: tenant._id,
|
|
101
|
-
name: tenant.name,
|
|
102
|
-
planName: summaries.get(tenant._id)?.planName ?? null,
|
|
103
|
-
isCurrent: tenant._id === currentTenantId,
|
|
104
|
-
})));
|
|
73
|
+
return (0, workspaces_1.listMyWorkspaces)(user._id, (0, request_tenant_1.getRequestTenantId)(ctx));
|
|
105
74
|
}
|
|
106
|
-
async createOptions(user) {
|
|
75
|
+
async createOptions(user, ctx) {
|
|
107
76
|
(0, config_1.assertAdmissionOpen)(user.owner);
|
|
77
|
+
return (0, workspaces_1.buildWorkspaceCreateOptions)(user, (0, request_tenant_1.getRequestTenantId)(ctx));
|
|
108
78
|
}
|
|
109
79
|
async setupIntent(user) {
|
|
110
80
|
(0, config_1.assertAdmissionOpen)(user.owner);
|
|
111
81
|
return (0, stripe_1.createCardSetupIntent)();
|
|
112
82
|
}
|
|
113
|
-
async
|
|
83
|
+
async createMine(user, ctx, body) {
|
|
114
84
|
(0, config_1.assertAdmissionOpen)(user.owner);
|
|
115
|
-
const workspaceName = body.workspaceName?.trim();
|
|
116
|
-
(0, interface_api_util_1.assert)(workspaceName, HTTP_BAD_REQUEST, "saas.errors.workspace.name_required");
|
|
117
85
|
const card = await (0, workspaces_1.resolveCardDetails)(body.paymentMethodId);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
workspaceName,
|
|
123
|
-
paymentMethodId: body.paymentMethodId,
|
|
124
|
-
planId: body.planId,
|
|
125
|
-
card,
|
|
126
|
-
billingProfile,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
async createMine(user, ctx, body) {
|
|
130
|
-
const input = await this.prepareSelfServeCreation(user, ctx, body);
|
|
131
|
-
const handles = { userId: user._id };
|
|
132
|
-
try {
|
|
133
|
-
const { tenantId } = await (0, workspaces_1.provisionWorkspace)({
|
|
134
|
-
userId: user._id,
|
|
135
|
-
payload: {
|
|
136
|
-
...input.billingProfile,
|
|
137
|
-
workspaceName: input.workspaceName,
|
|
138
|
-
planId: input.planId,
|
|
139
|
-
paymentMethodId: input.paymentMethodId,
|
|
140
|
-
},
|
|
141
|
-
stripeCustomerProfile: {
|
|
142
|
-
...input.billingProfile,
|
|
143
|
-
email: user.email,
|
|
144
|
-
fallbackName: user.name,
|
|
145
|
-
},
|
|
146
|
-
card: input.card,
|
|
147
|
-
handles,
|
|
148
|
-
});
|
|
149
|
-
return { tenantId };
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
await (0, workspaces_1.rollbackWorkspaceProvisioning)(handles);
|
|
153
|
-
throw error;
|
|
154
|
-
}
|
|
86
|
+
return (0, workspaces_1.withCardHold)(card.fingerprint, async () => {
|
|
87
|
+
const input = await prepareSelfServeCreation(user, ctx, body, card);
|
|
88
|
+
return provisionSelfServeWorkspace(user, input);
|
|
89
|
+
});
|
|
155
90
|
}
|
|
156
91
|
async getCurrent(_user, ctx) {
|
|
157
92
|
const tenantId = (0, request_tenant_1.getRequestTenantId)(ctx);
|
|
@@ -163,64 +98,25 @@ class SaasWorkspacesController extends (0, interface_api_1.Controller)("/api/saa
|
|
|
163
98
|
retentionDays: await (0, workspaces_1.resolveDataRetentionDays)(),
|
|
164
99
|
};
|
|
165
100
|
}
|
|
101
|
+
async getCurrentGlance(user, ctx) {
|
|
102
|
+
const view = await (0, workspaces_1.buildWorkspaceOverview)((0, request_tenant_1.getRequestTenantId)(ctx), user._id);
|
|
103
|
+
return { items: (0, workspaces_1.workspaceGlanceItems)(view) };
|
|
104
|
+
}
|
|
105
|
+
async getCurrentOverview(user, ctx) {
|
|
106
|
+
return (0, workspaces_1.buildWorkspaceOverview)((0, request_tenant_1.getRequestTenantId)(ctx), user._id);
|
|
107
|
+
}
|
|
166
108
|
async renameCurrent(_user, ctx, body) {
|
|
167
109
|
const tenantId = (0, request_tenant_1.getRequestTenantId)(ctx);
|
|
168
|
-
const name = body.name
|
|
169
|
-
(0, interface_api_util_1.assert)(name, HTTP_BAD_REQUEST, "saas.errors.workspace.name_required");
|
|
110
|
+
const name = (0, workspaces_1.normalizeWorkspaceName)(body.name);
|
|
170
111
|
await this.tenantModel.update(tenantId, { name, updatedAt: new Date() });
|
|
171
112
|
return { _id: tenantId, name };
|
|
172
113
|
}
|
|
173
|
-
async deleteCurrent(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
async getDetail(_user, id) {
|
|
177
|
-
const tenant = await this.tenantModel.get(id);
|
|
178
|
-
(0, interface_api_util_1.assert)(tenant, HTTP_NOT_FOUND, "saas.errors.workspace.not_found");
|
|
179
|
-
const { subscription, billingInfo, members, invoices, creditNotes, plan } = await loadWorkspaceRelations(id, this.planModel);
|
|
180
|
-
const [memberRows, pendingInvitationsCount, seats] = await Promise.all([
|
|
181
|
-
buildMemberRows(members, this.userModel),
|
|
182
|
-
(0, workspaces_1.countPendingInvitations)(id),
|
|
183
|
-
(0, plans_1.getSeatUsage)(id),
|
|
184
|
-
]);
|
|
185
|
-
const projection = (0, utils_1.buildWorkspaceProjection)({
|
|
186
|
-
tenant,
|
|
187
|
-
subscription,
|
|
188
|
-
billingInfo,
|
|
189
|
-
plan,
|
|
190
|
-
membersCount: members.length,
|
|
191
|
-
invoices,
|
|
192
|
-
now: new Date(),
|
|
193
|
-
});
|
|
194
|
-
return {
|
|
195
|
-
_id: projection._id,
|
|
196
|
-
name: projection.name,
|
|
197
|
-
createdAt: projection.createdAt,
|
|
198
|
-
status: projection.status,
|
|
199
|
-
planId: projection.planId,
|
|
200
|
-
planName: projection.planName,
|
|
201
|
-
currency: projection.currency,
|
|
202
|
-
mrr: projection.mrr,
|
|
203
|
-
membersCount: seats.members,
|
|
204
|
-
platformSupportCount: seats.platformSupport.length,
|
|
205
|
-
pendingInvitationsCount,
|
|
206
|
-
subscription: subscription ?? null,
|
|
207
|
-
billingInfo: billingInfo ?? null,
|
|
208
|
-
members: memberRows,
|
|
209
|
-
invoices: sortByIssuedAtDesc(invoices),
|
|
210
|
-
creditNotes: sortByIssuedAtDesc(creditNotes),
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
async joinAsMember(user, id) {
|
|
214
|
-
const tenant = await this.tenantModel.get(id);
|
|
114
|
+
async deleteCurrent(user, ctx, body) {
|
|
115
|
+
const tenantId = (0, request_tenant_1.getRequestTenantId)(ctx);
|
|
116
|
+
const tenant = await this.tenantModel.get(tenantId);
|
|
215
117
|
(0, interface_api_util_1.assert)(tenant, HTTP_NOT_FOUND, "saas.errors.workspace.not_found");
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
(0, interface_api_util_1.assert)(!existing, HTTP_CONFLICT, "saas.workspaces.join.already_member");
|
|
219
|
-
await (0, tenant_ownership_1.applyTenantOwnership)(this.userModel, user._id, id, {
|
|
220
|
-
roleIds: [],
|
|
221
|
-
isTenantOwner: false,
|
|
222
|
-
});
|
|
223
|
-
return { joined: true };
|
|
118
|
+
(0, interface_api_util_1.assert)(body.confirmName?.trim() === tenant.name.trim(), HTTP_BAD_REQUEST, "saas.errors.workspace.delete_confirmation_mismatch");
|
|
119
|
+
return (0, workspaces_1.requestWorkspaceDeletion)(tenantId, user._id);
|
|
224
120
|
}
|
|
225
121
|
}
|
|
226
122
|
exports.SaasWorkspacesController = SaasWorkspacesController;
|
|
@@ -228,14 +124,6 @@ __decorate([
|
|
|
228
124
|
(0, interface_database_decorators_1.Model)(db_1.TenantModel),
|
|
229
125
|
__metadata("design:type", db_1.TenantModel)
|
|
230
126
|
], SaasWorkspacesController.prototype, "tenantModel", void 0);
|
|
231
|
-
__decorate([
|
|
232
|
-
(0, interface_database_decorators_1.Model)(db_2.UserModel),
|
|
233
|
-
__metadata("design:type", db_2.UserModel)
|
|
234
|
-
], SaasWorkspacesController.prototype, "userModel", void 0);
|
|
235
|
-
__decorate([
|
|
236
|
-
(0, interface_database_decorators_1.Model)(db_3.PlanModel),
|
|
237
|
-
__metadata("design:type", db_3.PlanModel)
|
|
238
|
-
], SaasWorkspacesController.prototype, "planModel", void 0);
|
|
239
127
|
__decorate([
|
|
240
128
|
(0, interface_api_1.Get)("/mine"),
|
|
241
129
|
__param(0, (0, auth_1.AuthRawUser)()),
|
|
@@ -247,8 +135,9 @@ __decorate([
|
|
|
247
135
|
__decorate([
|
|
248
136
|
(0, interface_api_1.Get)("/create-options"),
|
|
249
137
|
__param(0, (0, auth_1.AuthRawUser)()),
|
|
138
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
250
139
|
__metadata("design:type", Function),
|
|
251
|
-
__metadata("design:paramtypes", [Function]),
|
|
140
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
252
141
|
__metadata("design:returntype", Promise)
|
|
253
142
|
], SaasWorkspacesController.prototype, "createOptions", null);
|
|
254
143
|
__decorate([
|
|
@@ -269,43 +158,44 @@ __decorate([
|
|
|
269
158
|
], SaasWorkspacesController.prototype, "createMine", null);
|
|
270
159
|
__decorate([
|
|
271
160
|
(0, interface_api_1.Get)("/current"),
|
|
272
|
-
__param(0, (0, guards_1.
|
|
161
|
+
__param(0, (0, guards_1.AuthTenantMember)({ bypassTenantAccessGate: true })),
|
|
273
162
|
__param(1, (0, interface_api_1.Context)()),
|
|
274
163
|
__metadata("design:type", Function),
|
|
275
164
|
__metadata("design:paramtypes", [Function, Object]),
|
|
276
165
|
__metadata("design:returntype", Promise)
|
|
277
166
|
], SaasWorkspacesController.prototype, "getCurrent", null);
|
|
278
167
|
__decorate([
|
|
279
|
-
(0, interface_api_1.
|
|
280
|
-
__param(0, (0, guards_1.
|
|
168
|
+
(0, interface_api_1.Get)("/current/glance"),
|
|
169
|
+
__param(0, (0, guards_1.AuthTenantMember)()),
|
|
281
170
|
__param(1, (0, interface_api_1.Context)()),
|
|
282
|
-
__param(2, (0, interface_api_1.JSONBody)()),
|
|
283
171
|
__metadata("design:type", Function),
|
|
284
|
-
__metadata("design:paramtypes", [Function, Object
|
|
172
|
+
__metadata("design:paramtypes", [Function, Object]),
|
|
285
173
|
__metadata("design:returntype", Promise)
|
|
286
|
-
], SaasWorkspacesController.prototype, "
|
|
174
|
+
], SaasWorkspacesController.prototype, "getCurrentGlance", null);
|
|
287
175
|
__decorate([
|
|
288
|
-
(0, interface_api_1.
|
|
176
|
+
(0, interface_api_1.Get)("/current/overview"),
|
|
289
177
|
__param(0, (0, guards_1.AuthTenantOwner)()),
|
|
290
178
|
__param(1, (0, interface_api_1.Context)()),
|
|
291
179
|
__metadata("design:type", Function),
|
|
292
180
|
__metadata("design:paramtypes", [Function, Object]),
|
|
293
181
|
__metadata("design:returntype", Promise)
|
|
294
|
-
], SaasWorkspacesController.prototype, "
|
|
182
|
+
], SaasWorkspacesController.prototype, "getCurrentOverview", null);
|
|
295
183
|
__decorate([
|
|
296
|
-
(0, interface_api_1.
|
|
297
|
-
__param(0, (0,
|
|
298
|
-
__param(1, (0, interface_api_1.
|
|
184
|
+
(0, interface_api_1.Put)("/current"),
|
|
185
|
+
__param(0, (0, guards_1.AuthTenantOwner)()),
|
|
186
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
187
|
+
__param(2, (0, interface_api_1.JSONBody)()),
|
|
299
188
|
__metadata("design:type", Function),
|
|
300
|
-
__metadata("design:paramtypes", [Function,
|
|
189
|
+
__metadata("design:paramtypes", [Function, Object, Object]),
|
|
301
190
|
__metadata("design:returntype", Promise)
|
|
302
|
-
], SaasWorkspacesController.prototype, "
|
|
191
|
+
], SaasWorkspacesController.prototype, "renameCurrent", null);
|
|
303
192
|
__decorate([
|
|
304
|
-
(0, interface_api_1.Post)("
|
|
305
|
-
__param(0, (0,
|
|
306
|
-
__param(1, (0, interface_api_1.
|
|
193
|
+
(0, interface_api_1.Post)("/current/delete"),
|
|
194
|
+
__param(0, (0, guards_1.AuthTenantOwner)()),
|
|
195
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
196
|
+
__param(2, (0, interface_api_1.JSONBody)()),
|
|
307
197
|
__metadata("design:type", Function),
|
|
308
|
-
__metadata("design:paramtypes", [Function,
|
|
198
|
+
__metadata("design:paramtypes", [Function, Object, Object]),
|
|
309
199
|
__metadata("design:returntype", Promise)
|
|
310
|
-
], SaasWorkspacesController.prototype, "
|
|
200
|
+
], SaasWorkspacesController.prototype, "deleteCurrent", null);
|
|
311
201
|
//# sourceMappingURL=workspaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/routes/tenant/workspaces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/routes/tenant/workspaces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAQmC;AACnC,uEAAwD;AACxD,6FAAkE;AAClE,qDAA2D;AAC3D,6DAG0C;AAC1C,6EAA8E;AAC9E,yDAA6D;AAG7D,yCAA2E;AAC3E,yCAAmD;AAWnD,iDAiB0B;AAE1B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AA+C7B,KAAK,UAAU,wBAAwB,CACrC,IAAU,EACV,GAAmB,EACnB,IAAyB,EACzB,IAAiB;IAEjB,MAAM,aAAa,GAAG,IAAA,mCAAsB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAC,cAAc,EAAE,qBAAqB,CAAC,GAAG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AAC,EAAE,sBAAsB,EAAE,IAAI,EAAE,CAAC,CAAA;IAClD,WAAA,IAAA,uBAAO,GAAE,CAAA;;;;0DAUX;AAIK;IADL,IAAA,mBAAG,EAAC,iBAAiB,CAAC;IAEpB,WAAA,IAAA,yBAAgB,GAAE,CAAA;IAClB,WAAA,IAAA,uBAAO,GAAE,CAAA;;;;gEAOX;AAIK;IADL,IAAA,mBAAG,EAAC,mBAAmB,CAAC;IAEtB,WAAA,IAAA,wBAAe,GAAE,CAAA;IACjB,WAAA,IAAA,uBAAO,GAAE,CAAA;;;;kEAGX;AAGK;IADL,IAAA,mBAAG,EAAC,UAAU,CAAC;IAEb,WAAA,IAAA,wBAAe,GAAE,CAAA;IACjB,WAAA,IAAA,uBAAO,GAAE,CAAA;IACT,WAAA,IAAA,wBAAQ,GAAE,CAAA;;;;6DAMZ;AAOK;IADL,IAAA,oBAAI,EAAC,iBAAiB,CAAC;IAErB,WAAA,IAAA,wBAAe,GAAE,CAAA;IACjB,WAAA,IAAA,uBAAO,GAAE,CAAA;IACT,WAAA,IAAA,wBAAQ,GAAE,CAAA;;;;6DAWZ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SegmentConditionGroup } from "../db";
|
|
2
|
+
import { type SegmentInput, type SegmentPreview } from "../utils";
|
|
3
|
+
export interface SegmentDraft {
|
|
4
|
+
_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
conditions: SegmentConditionGroup;
|
|
8
|
+
estimatedCount: number;
|
|
9
|
+
lastEvaluatedAt: Date | null;
|
|
10
|
+
lastEvaluationMs: number | null;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface SegmentEvaluation {
|
|
14
|
+
_id: string;
|
|
15
|
+
estimatedCount: number;
|
|
16
|
+
lastEvaluatedAt: Date | null;
|
|
17
|
+
evaluationFailed: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface TimedSegmentPreview extends SegmentPreview {
|
|
20
|
+
savedEvaluatedAt: Date | null;
|
|
21
|
+
evaluatedAt: Date;
|
|
22
|
+
durationMs: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function loadSegmentDraft(id: string): Promise<SegmentDraft>;
|
|
25
|
+
export declare function evaluateSegment(id: string): Promise<SegmentEvaluation>;
|
|
26
|
+
export declare function createSegment(input: SegmentInput): Promise<SegmentEvaluation>;
|
|
27
|
+
export declare function saveSegment(id: string, input: Partial<SegmentInput>): Promise<SegmentEvaluation>;
|
|
28
|
+
export declare function duplicateSegment(id: string): Promise<SegmentEvaluation>;
|
|
29
|
+
export declare function previewSegment(conditions: SegmentConditionGroup, segmentId?: string): Promise<TimedSegmentPreview>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadSegmentDraft = loadSegmentDraft;
|
|
4
|
+
exports.evaluateSegment = evaluateSegment;
|
|
5
|
+
exports.createSegment = createSegment;
|
|
6
|
+
exports.saveSegment = saveSegment;
|
|
7
|
+
exports.duplicateSegment = duplicateSegment;
|
|
8
|
+
exports.previewSegment = previewSegment;
|
|
9
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
10
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
11
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
12
|
+
const db_1 = require("../db");
|
|
13
|
+
const utils_1 = require("../utils");
|
|
14
|
+
const HTTP_NOT_FOUND = 404;
|
|
15
|
+
const HTTP_CONFLICT = 409;
|
|
16
|
+
const NOT_FOUND = "saas.errors.segments.not_found";
|
|
17
|
+
const DUPLICATE_SUFFIX = " (copy)";
|
|
18
|
+
async function requireSegment(id) {
|
|
19
|
+
const segment = await (0, interface_database_decorators_1.GetModel)(db_1.SegmentModel).get(id);
|
|
20
|
+
(0, interface_api_util_1.assert)(segment, HTTP_NOT_FOUND, NOT_FOUND);
|
|
21
|
+
return segment;
|
|
22
|
+
}
|
|
23
|
+
async function loadSegmentDraft(id) {
|
|
24
|
+
const segment = await requireSegment(id);
|
|
25
|
+
return {
|
|
26
|
+
_id: segment._id,
|
|
27
|
+
name: segment.name,
|
|
28
|
+
description: segment.description ?? "",
|
|
29
|
+
conditions: segment.conditions,
|
|
30
|
+
estimatedCount: segment.estimatedCount ?? 0,
|
|
31
|
+
lastEvaluatedAt: segment.lastEvaluatedAt ?? null,
|
|
32
|
+
lastEvaluationMs: segment.lastEvaluationMs,
|
|
33
|
+
updatedAt: segment.updatedAt,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async function evaluateSegment(id) {
|
|
37
|
+
let evaluationFailed = false;
|
|
38
|
+
try {
|
|
39
|
+
await (0, utils_1.recomputeSegmentsByIds)([id]);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
evaluationFailed = true;
|
|
43
|
+
logging_1.Logging.Error("[dms-saas] segment evaluation failed", error);
|
|
44
|
+
}
|
|
45
|
+
const segment = await requireSegment(id);
|
|
46
|
+
return {
|
|
47
|
+
_id: id,
|
|
48
|
+
estimatedCount: segment.estimatedCount ?? 0,
|
|
49
|
+
lastEvaluatedAt: segment.lastEvaluatedAt ?? null,
|
|
50
|
+
evaluationFailed,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async function createSegment(input) {
|
|
54
|
+
const [id] = await (0, interface_database_decorators_1.GetModel)(db_1.SegmentModel).insert({
|
|
55
|
+
...input,
|
|
56
|
+
estimatedCount: 0,
|
|
57
|
+
lastEvaluatedAt: null,
|
|
58
|
+
lastEvaluationMs: null,
|
|
59
|
+
countHistory: [],
|
|
60
|
+
});
|
|
61
|
+
(0, interface_api_util_1.assert)(id, HTTP_CONFLICT, "saas.errors.segments.edit_conflict");
|
|
62
|
+
(0, utils_1.invalidateSegmentNamesCache)();
|
|
63
|
+
return evaluateSegment(id);
|
|
64
|
+
}
|
|
65
|
+
async function saveSegment(id, input) {
|
|
66
|
+
await requireSegment(id);
|
|
67
|
+
try {
|
|
68
|
+
await (0, interface_database_decorators_1.GetModel)(db_1.SegmentModel).update(id, input);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
logging_1.Logging.Warn("[dms-saas] segment save refused", error);
|
|
72
|
+
(0, interface_api_util_1.assert)(false, HTTP_CONFLICT, "saas.errors.segments.edit_conflict");
|
|
73
|
+
}
|
|
74
|
+
(0, utils_1.invalidateSegmentNamesCache)();
|
|
75
|
+
return evaluateSegment(id);
|
|
76
|
+
}
|
|
77
|
+
async function duplicateSegment(id) {
|
|
78
|
+
const source = await requireSegment(id);
|
|
79
|
+
return createSegment({
|
|
80
|
+
name: `${source.name}${DUPLICATE_SUFFIX}`,
|
|
81
|
+
description: source.description ?? "",
|
|
82
|
+
conditions: source.conditions,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async function loadSavedVersion(segmentId) {
|
|
86
|
+
if (!segmentId)
|
|
87
|
+
return null;
|
|
88
|
+
const segment = await (0, interface_database_decorators_1.GetModel)(db_1.SegmentModel).get(segmentId);
|
|
89
|
+
if (!segment)
|
|
90
|
+
return null;
|
|
91
|
+
const links = await (0, interface_database_decorators_1.GetModel)(db_1.UserSegmentModel).listBySegment(segmentId);
|
|
92
|
+
return {
|
|
93
|
+
memberIds: new Set(links.map((link) => link.userId)),
|
|
94
|
+
evaluatedAt: segment.lastEvaluatedAt ?? null,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function previewSegment(conditions, segmentId) {
|
|
98
|
+
const startedAt = performance.now();
|
|
99
|
+
const evaluatedAt = new Date();
|
|
100
|
+
const [users, saved] = await Promise.all([
|
|
101
|
+
(0, utils_1.loadAllUserProjections)((0, interface_database_decorators_1.GetModel)(db_1.PlanModel), evaluatedAt),
|
|
102
|
+
loadSavedVersion(segmentId),
|
|
103
|
+
]);
|
|
104
|
+
const preview = (0, utils_1.computeSegmentPreview)({
|
|
105
|
+
conditions,
|
|
106
|
+
users,
|
|
107
|
+
savedMemberIds: saved?.memberIds ?? null,
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
...preview,
|
|
111
|
+
savedEvaluatedAt: saved?.evaluatedAt ?? null,
|
|
112
|
+
evaluatedAt,
|
|
113
|
+
durationMs: Math.round(performance.now() - startedAt),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/segments/index.ts"],"names":[],"mappings":";;AA4DA,4CAYC;AAOD,0CAeC;AAGD,sCAaC;AAMD,kCAaC;AAGD,4CAOC;AAwBD,wCAqBC;AAxLD,uEAAwD;AACxD,gEAA6D;AAC7D,6FAAqE;AACrE,8BAMe;AACf,oCAOkB;AAElB,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,SAAS,GAAG,gCAAgC,CAAC;AACnD,MAAM,gBAAgB,GAAG,SAAS,CAAC;AA+BnC,KAAK,UAAU,cAAc,CAAC,EAAU;IACtC,MAAM,OAAO,GAAG,MAAM,IAAA,wCAAQ,EAAC,iBAAY,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrD,IAAA,2BAAM,EAAC,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC;AACjB,CAAC;AAGM,KAAK,UAAU,gBAAgB,CAAC,EAAU;IAC/C,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;QACtC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,CAAC;QAC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,UAAiC,EACjC,SAAkB;IAElB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;IAC/B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvC,IAAA,8BAAsB,EAAC,IAAA,wCAAQ,EAAC,cAAS,CAAC,EAAE,WAAW,CAAC;QACxD,gBAAgB,CAAC,SAAS,CAAC;KAC5B,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,IAAA,6BAAqB,EAAC;QACpC,UAAU;QACV,KAAK;QACL,cAAc,EAAE,KAAK,EAAE,SAAS,IAAI,IAAI;KACzC,CAAC,CAAC;IACH,OAAO;QACL,GAAG,OAAO;QACV,gBAAgB,EAAE,KAAK,EAAE,WAAW,IAAI,IAAI;QAC5C,WAAW;QACX,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;KACtD,CAAC;AACJ,CAAC"}
|
package/dist/stripe/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import Stripe from "stripe";
|
|
|
2
2
|
import type { DmsSaasStripeConfig } from "../types";
|
|
3
3
|
export declare const STRIPE_API_VERSION: Stripe.LatestApiVersion;
|
|
4
4
|
export declare function initStripeClient(config: DmsSaasStripeConfig): void;
|
|
5
|
+
export declare function stripeDashboardUrl(path: string): string;
|
|
5
6
|
export declare function isStripeConfigured(): boolean;
|
|
6
7
|
export declare function getStripeClient(): Stripe;
|
|
7
8
|
export declare function getStripeWebhookSecret(): string;
|
package/dist/stripe/client.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.STRIPE_API_VERSION = void 0;
|
|
7
7
|
exports.initStripeClient = initStripeClient;
|
|
8
|
+
exports.stripeDashboardUrl = stripeDashboardUrl;
|
|
8
9
|
exports.isStripeConfigured = isStripeConfigured;
|
|
9
10
|
exports.getStripeClient = getStripeClient;
|
|
10
11
|
exports.getStripeWebhookSecret = getStripeWebhookSecret;
|
|
@@ -12,9 +13,13 @@ const stripe_1 = __importDefault(require("stripe"));
|
|
|
12
13
|
exports.STRIPE_API_VERSION = "2026-08-26.dahlia";
|
|
13
14
|
const SECRET_KEY_PREFIX = "sk_";
|
|
14
15
|
const PLACEHOLDER_MARKER = "placeholder";
|
|
16
|
+
const TEST_MODE_MARKER = "_test_";
|
|
17
|
+
const STRIPE_DASHBOARD_URL = "https://dashboard.stripe.com";
|
|
18
|
+
const TEST_MODE_DASHBOARD_PATH = "/test";
|
|
15
19
|
let stripeClient = null;
|
|
16
20
|
let stripeWebhookSecret = null;
|
|
17
21
|
let stripeConfigured = false;
|
|
22
|
+
let stripeTestMode = false;
|
|
18
23
|
function isUsableSecretKey(key) {
|
|
19
24
|
return (typeof key === "string" &&
|
|
20
25
|
key.startsWith(SECRET_KEY_PREFIX) &&
|
|
@@ -26,6 +31,12 @@ function initStripeClient(config) {
|
|
|
26
31
|
});
|
|
27
32
|
stripeWebhookSecret = config.webhookSecret;
|
|
28
33
|
stripeConfigured = isUsableSecretKey(config.secretKey);
|
|
34
|
+
stripeTestMode = config.secretKey.includes(TEST_MODE_MARKER);
|
|
35
|
+
}
|
|
36
|
+
function stripeDashboardUrl(path) {
|
|
37
|
+
const mode = stripeTestMode ? TEST_MODE_DASHBOARD_PATH : "";
|
|
38
|
+
const separator = path.startsWith("/") ? "" : "/";
|
|
39
|
+
return `${STRIPE_DASHBOARD_URL}${mode}${separator}${path}`;
|
|
29
40
|
}
|
|
30
41
|
function isStripeConfigured() {
|
|
31
42
|
return stripeConfigured;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/stripe/client.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot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,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAClD,OAAO,GAAG,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,EAAE,CAAC;AAC7D,CAAC;AAED,SAAgB,kBAAkB;IAChC,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAgB,eAAe;IAC7B,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAgB,sBAAsB;IACpC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function toStripePreferredLocales(language: string | null | undefined): string[] | undefined;
|
|
2
|
+
export declare function rememberCustomerLocale(customerId: string, language: string | null | undefined): void;
|
|
3
|
+
export declare function syncCustomerPreferredLocale(customerId: string | null | undefined, language: string | null | undefined): Promise<void>;
|