@antelopejs/dms-saas 0.0.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/LICENSE +190 -0
- package/README.md +658 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +20 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth-entry.d.ts +5 -0
- package/dist/auth/oauth-entry.js +10 -0
- package/dist/auth/oauth-entry.js.map +1 -0
- package/dist/auth/plan-permissions-resolver.d.ts +1 -0
- package/dist/auth/plan-permissions-resolver.js +44 -0
- package/dist/auth/plan-permissions-resolver.js.map +1 -0
- package/dist/auth/subscription-access-gate.d.ts +8 -0
- package/dist/auth/subscription-access-gate.js +38 -0
- package/dist/auth/subscription-access-gate.js.map +1 -0
- package/dist/automation/index.d.ts +44 -0
- package/dist/automation/index.js +209 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/billing-state/index.d.ts +5 -0
- package/dist/billing-state/index.js +58 -0
- package/dist/billing-state/index.js.map +1 -0
- package/dist/billing-state/recovery.d.ts +22 -0
- package/dist/billing-state/recovery.js +81 -0
- package/dist/billing-state/recovery.js.map +1 -0
- package/dist/config/dev-mode.d.ts +3 -0
- package/dist/config/dev-mode.js +27 -0
- package/dist/config/dev-mode.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +19 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/runtime.d.ts +6 -0
- package/dist/config/runtime.js +54 -0
- package/dist/config/runtime.js.map +1 -0
- package/dist/crons/auto-suspend-past-due.d.ts +2 -0
- package/dist/crons/auto-suspend-past-due.js +43 -0
- package/dist/crons/auto-suspend-past-due.js.map +1 -0
- package/dist/crons/cleanup-stripe-webhook-events.d.ts +2 -0
- package/dist/crons/cleanup-stripe-webhook-events.js +27 -0
- package/dist/crons/cleanup-stripe-webhook-events.js.map +1 -0
- package/dist/crons/expire-free-workspaces.d.ts +2 -0
- package/dist/crons/expire-free-workspaces.js +36 -0
- package/dist/crons/expire-free-workspaces.js.map +1 -0
- package/dist/crons/hard-delete-cancelled.d.ts +2 -0
- package/dist/crons/hard-delete-cancelled.js +55 -0
- package/dist/crons/hard-delete-cancelled.js.map +1 -0
- package/dist/crons/index.d.ts +8 -0
- package/dist/crons/index.js +25 -0
- package/dist/crons/index.js.map +1 -0
- package/dist/crons/notify-free-workspaces-ending-soon.d.ts +2 -0
- package/dist/crons/notify-free-workspaces-ending-soon.js +69 -0
- package/dist/crons/notify-free-workspaces-ending-soon.js.map +1 -0
- package/dist/crons/recompute-billing-state.d.ts +2 -0
- package/dist/crons/recompute-billing-state.js +19 -0
- package/dist/crons/recompute-billing-state.js.map +1 -0
- package/dist/crons/recompute-segments.d.ts +2 -0
- package/dist/crons/recompute-segments.js +19 -0
- package/dist/crons/recompute-segments.js.map +1 -0
- package/dist/crons/reconcile-workspace-lifecycle.d.ts +2 -0
- package/dist/crons/reconcile-workspace-lifecycle.js +19 -0
- package/dist/crons/reconcile-workspace-lifecycle.js.map +1 -0
- package/dist/crons/register.d.ts +2 -0
- package/dist/crons/register.js +24 -0
- package/dist/crons/register.js.map +1 -0
- package/dist/crons/subscription-notifications.d.ts +2 -0
- package/dist/crons/subscription-notifications.js +55 -0
- package/dist/crons/subscription-notifications.js.map +1 -0
- package/dist/data-api/index.d.ts +2 -0
- package/dist/data-api/index.js +19 -0
- package/dist/data-api/index.js.map +1 -0
- package/dist/data-api/platformOwner/admin-user-invoices.d.ts +27 -0
- package/dist/data-api/platformOwner/admin-user-invoices.js +158 -0
- package/dist/data-api/platformOwner/admin-user-invoices.js.map +1 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.d.ts +22 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.js +97 -0
- package/dist/data-api/platformOwner/admin-user-workspaces.js.map +1 -0
- package/dist/data-api/platformOwner/credit-notes.d.ts +24 -0
- package/dist/data-api/platformOwner/credit-notes.js +133 -0
- package/dist/data-api/platformOwner/credit-notes.js.map +1 -0
- package/dist/data-api/platformOwner/features.d.ts +30 -0
- package/dist/data-api/platformOwner/features.js +141 -0
- package/dist/data-api/platformOwner/features.js.map +1 -0
- package/dist/data-api/platformOwner/hidden-filter.d.ts +1 -0
- package/dist/data-api/platformOwner/hidden-filter.js +18 -0
- package/dist/data-api/platformOwner/hidden-filter.js.map +1 -0
- package/dist/data-api/platformOwner/index.d.ts +12 -0
- package/dist/data-api/platformOwner/index.js +29 -0
- package/dist/data-api/platformOwner/index.js.map +1 -0
- package/dist/data-api/platformOwner/invoice-options.d.ts +7 -0
- package/dist/data-api/platformOwner/invoice-options.js +14 -0
- package/dist/data-api/platformOwner/invoice-options.js.map +1 -0
- package/dist/data-api/platformOwner/invoices.d.ts +26 -0
- package/dist/data-api/platformOwner/invoices.js +147 -0
- package/dist/data-api/platformOwner/invoices.js.map +1 -0
- package/dist/data-api/platformOwner/members.d.ts +24 -0
- package/dist/data-api/platformOwner/members.js +125 -0
- package/dist/data-api/platformOwner/members.js.map +1 -0
- package/dist/data-api/platformOwner/plan-migrations.d.ts +24 -0
- package/dist/data-api/platformOwner/plan-migrations.js +138 -0
- package/dist/data-api/platformOwner/plan-migrations.js.map +1 -0
- package/dist/data-api/platformOwner/plans.d.ts +30 -0
- package/dist/data-api/platformOwner/plans.js +228 -0
- package/dist/data-api/platformOwner/plans.js.map +1 -0
- package/dist/data-api/platformOwner/segments.d.ts +29 -0
- package/dist/data-api/platformOwner/segments.js +223 -0
- package/dist/data-api/platformOwner/segments.js.map +1 -0
- package/dist/data-api/platformOwner/support.d.ts +58 -0
- package/dist/data-api/platformOwner/support.js +111 -0
- package/dist/data-api/platformOwner/support.js.map +1 -0
- package/dist/data-api/platformOwner/users.d.ts +22 -0
- package/dist/data-api/platformOwner/users.js +128 -0
- package/dist/data-api/platformOwner/users.js.map +1 -0
- package/dist/data-api/platformOwner/workspaces.d.ts +22 -0
- package/dist/data-api/platformOwner/workspaces.js +153 -0
- package/dist/data-api/platformOwner/workspaces.js.map +1 -0
- package/dist/data-api/support-fields.d.ts +49 -0
- package/dist/data-api/support-fields.js +166 -0
- package/dist/data-api/support-fields.js.map +1 -0
- package/dist/data-api/support-routes.d.ts +10 -0
- package/dist/data-api/support-routes.js +71 -0
- package/dist/data-api/support-routes.js.map +1 -0
- package/dist/data-api/tenant/index.d.ts +2 -0
- package/dist/data-api/tenant/index.js +19 -0
- package/dist/data-api/tenant/index.js.map +1 -0
- package/dist/data-api/tenant/support.d.ts +39 -0
- package/dist/data-api/tenant/support.js +53 -0
- package/dist/data-api/tenant/support.js.map +1 -0
- package/dist/data-api/tenant/tenant-invoices.d.ts +37 -0
- package/dist/data-api/tenant/tenant-invoices.js +242 -0
- package/dist/data-api/tenant/tenant-invoices.js.map +1 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.js +18 -0
- package/dist/db/index.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +20 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/register.d.ts +1 -0
- package/dist/hooks/register.js +57 -0
- package/dist/hooks/register.js.map +1 -0
- package/dist/hooks/tenant-export.d.ts +2 -0
- package/dist/hooks/tenant-export.js +64 -0
- package/dist/hooks/tenant-export.js.map +1 -0
- package/dist/hooks/tenant-provisioning.d.ts +3 -0
- package/dist/hooks/tenant-provisioning.js +12 -0
- package/dist/hooks/tenant-provisioning.js.map +1 -0
- package/dist/implementations/dms-saas/billing.d.ts +2 -0
- package/dist/implementations/dms-saas/billing.js +49 -0
- package/dist/implementations/dms-saas/billing.js.map +1 -0
- package/dist/implementations/dms-saas/invoice-line-items.d.ts +11 -0
- package/dist/implementations/dms-saas/invoice-line-items.js +24 -0
- package/dist/implementations/dms-saas/invoice-line-items.js.map +1 -0
- package/dist/implementations/dms-saas/pages.d.ts +3 -0
- package/dist/implementations/dms-saas/pages.js +12 -0
- package/dist/implementations/dms-saas/pages.js.map +1 -0
- package/dist/implementations/dms-saas/workspace-lifecycle.d.ts +2 -0
- package/dist/implementations/dms-saas/workspace-lifecycle.js +23 -0
- package/dist/implementations/dms-saas/workspace-lifecycle.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/invoice-line-items/billing-window.d.ts +3 -0
- package/dist/invoice-line-items/billing-window.js +19 -0
- package/dist/invoice-line-items/billing-window.js.map +1 -0
- package/dist/invoice-line-items/index.d.ts +1 -0
- package/dist/invoice-line-items/index.js +18 -0
- package/dist/invoice-line-items/index.js.map +1 -0
- package/dist/invoice-line-items/injection.d.ts +2 -0
- package/dist/invoice-line-items/injection.js +171 -0
- package/dist/invoice-line-items/injection.js.map +1 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +19 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/recipients.d.ts +14 -0
- package/dist/notifications/recipients.js +87 -0
- package/dist/notifications/recipients.js.map +1 -0
- package/dist/notifications/subjects.d.ts +21 -0
- package/dist/notifications/subjects.js +121 -0
- package/dist/notifications/subjects.js.map +1 -0
- package/dist/operator-actions/commands.d.ts +41 -0
- package/dist/operator-actions/commands.js +233 -0
- package/dist/operator-actions/commands.js.map +1 -0
- package/dist/operator-actions/db/index.d.ts +4 -0
- package/dist/operator-actions/db/index.js +21 -0
- package/dist/operator-actions/db/index.js.map +1 -0
- package/dist/operator-actions/db/lifecycle-delivery.model.d.ts +29 -0
- package/dist/operator-actions/db/lifecycle-delivery.model.js +85 -0
- package/dist/operator-actions/db/lifecycle-delivery.model.js.map +1 -0
- package/dist/operator-actions/db/lifecycle-delivery.table.d.ts +26 -0
- package/dist/operator-actions/db/lifecycle-delivery.table.js +107 -0
- package/dist/operator-actions/db/lifecycle-delivery.table.js.map +1 -0
- package/dist/operator-actions/db/operator-action.model.d.ts +33 -0
- package/dist/operator-actions/db/operator-action.model.js +63 -0
- package/dist/operator-actions/db/operator-action.model.js.map +1 -0
- package/dist/operator-actions/db/operator-action.table.d.ts +21 -0
- package/dist/operator-actions/db/operator-action.table.js +95 -0
- package/dist/operator-actions/db/operator-action.table.js.map +1 -0
- package/dist/operator-actions/index.d.ts +3 -0
- package/dist/operator-actions/index.js +20 -0
- package/dist/operator-actions/index.js.map +1 -0
- package/dist/operator-actions/journal.d.ts +22 -0
- package/dist/operator-actions/journal.js +183 -0
- package/dist/operator-actions/journal.js.map +1 -0
- package/dist/operator-actions/lifecycle-consumers.d.ts +12 -0
- package/dist/operator-actions/lifecycle-consumers.js +28 -0
- package/dist/operator-actions/lifecycle-consumers.js.map +1 -0
- package/dist/operator-actions/lifecycle-outbox.d.ts +19 -0
- package/dist/operator-actions/lifecycle-outbox.js +229 -0
- package/dist/operator-actions/lifecycle-outbox.js.map +1 -0
- package/dist/operator-actions/types.d.ts +11 -0
- package/dist/operator-actions/types.js +3 -0
- package/dist/operator-actions/types.js.map +1 -0
- package/dist/pages/definitions.d.ts +1 -0
- package/dist/pages/definitions.js +18 -0
- package/dist/pages/definitions.js.map +1 -0
- package/dist/pages/index.d.ts +4 -0
- package/dist/pages/index.js +21 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/pages/module.d.ts +5 -0
- package/dist/pages/module.js +15 -0
- package/dist/pages/module.js.map +1 -0
- package/dist/pages/platform/categories.d.ts +6 -0
- package/dist/pages/platform/categories.js +48 -0
- package/dist/pages/platform/categories.js.map +1 -0
- package/dist/pages/platform/credit-notes.d.ts +9 -0
- package/dist/pages/platform/credit-notes.js +40 -0
- package/dist/pages/platform/credit-notes.js.map +1 -0
- package/dist/pages/platform/dashboard.d.ts +10 -0
- package/dist/pages/platform/dashboard.js +95 -0
- package/dist/pages/platform/dashboard.js.map +1 -0
- package/dist/pages/platform/features.d.ts +9 -0
- package/dist/pages/platform/features.js +42 -0
- package/dist/pages/platform/features.js.map +1 -0
- package/dist/pages/platform/index.d.ts +15 -0
- package/dist/pages/platform/index.js +32 -0
- package/dist/pages/platform/index.js.map +1 -0
- package/dist/pages/platform/invoices.d.ts +9 -0
- package/dist/pages/platform/invoices.js +63 -0
- package/dist/pages/platform/invoices.js.map +1 -0
- package/dist/pages/platform/plans/edit.d.ts +17 -0
- package/dist/pages/platform/plans/edit.js +213 -0
- package/dist/pages/platform/plans/edit.js.map +1 -0
- package/dist/pages/platform/plans/index.d.ts +9 -0
- package/dist/pages/platform/plans/index.js +99 -0
- package/dist/pages/platform/plans/index.js.map +1 -0
- package/dist/pages/platform/plans/migrations.d.ts +9 -0
- package/dist/pages/platform/plans/migrations.js +38 -0
- package/dist/pages/platform/plans/migrations.js.map +1 -0
- package/dist/pages/platform/segments/index.d.ts +9 -0
- package/dist/pages/platform/segments/index.js +59 -0
- package/dist/pages/platform/segments/index.js.map +1 -0
- package/dist/pages/platform/settings.d.ts +9 -0
- package/dist/pages/platform/settings.js +147 -0
- package/dist/pages/platform/settings.js.map +1 -0
- package/dist/pages/platform/support.d.ts +9 -0
- package/dist/pages/platform/support.js +29 -0
- package/dist/pages/platform/support.js.map +1 -0
- package/dist/pages/platform/users/detail.d.ts +9 -0
- package/dist/pages/platform/users/detail.js +78 -0
- package/dist/pages/platform/users/detail.js.map +1 -0
- package/dist/pages/platform/users/index.d.ts +9 -0
- package/dist/pages/platform/users/index.js +77 -0
- package/dist/pages/platform/users/index.js.map +1 -0
- package/dist/pages/platform/workspaces/detail.d.ts +9 -0
- package/dist/pages/platform/workspaces/detail.js +120 -0
- package/dist/pages/platform/workspaces/detail.js.map +1 -0
- package/dist/pages/platform/workspaces/index.d.ts +35 -0
- package/dist/pages/platform/workspaces/index.js +300 -0
- package/dist/pages/platform/workspaces/index.js.map +1 -0
- package/dist/pages/public/auth/index.d.ts +1 -0
- package/dist/pages/public/auth/index.js +18 -0
- package/dist/pages/public/auth/index.js.map +1 -0
- package/dist/pages/public/auth/no-workspace.d.ts +9 -0
- package/dist/pages/public/auth/no-workspace.js +26 -0
- package/dist/pages/public/auth/no-workspace.js.map +1 -0
- package/dist/pages/public/index.d.ts +3 -0
- package/dist/pages/public/index.js +20 -0
- package/dist/pages/public/index.js.map +1 -0
- package/dist/pages/public/legal/index.d.ts +3 -0
- package/dist/pages/public/legal/index.js +20 -0
- package/dist/pages/public/legal/index.js.map +1 -0
- package/dist/pages/public/legal/privacy-policy.d.ts +9 -0
- package/dist/pages/public/legal/privacy-policy.js +29 -0
- package/dist/pages/public/legal/privacy-policy.js.map +1 -0
- package/dist/pages/public/legal/terms-and-conditions.d.ts +9 -0
- package/dist/pages/public/legal/terms-and-conditions.js +29 -0
- package/dist/pages/public/legal/terms-and-conditions.js.map +1 -0
- package/dist/pages/public/legal/terms-of-use.d.ts +9 -0
- package/dist/pages/public/legal/terms-of-use.js +29 -0
- package/dist/pages/public/legal/terms-of-use.js.map +1 -0
- package/dist/pages/public/register.d.ts +9 -0
- package/dist/pages/public/register.js +29 -0
- package/dist/pages/public/register.js.map +1 -0
- package/dist/pages/public/screens.d.ts +3 -0
- package/dist/pages/public/screens.js +50 -0
- package/dist/pages/public/screens.js.map +1 -0
- package/dist/pages/tenant/billing.d.ts +15 -0
- package/dist/pages/tenant/billing.js +87 -0
- package/dist/pages/tenant/billing.js.map +1 -0
- package/dist/pages/tenant/data-export.d.ts +10 -0
- package/dist/pages/tenant/data-export.js +32 -0
- package/dist/pages/tenant/data-export.js.map +1 -0
- package/dist/pages/tenant/general.d.ts +10 -0
- package/dist/pages/tenant/general.js +33 -0
- package/dist/pages/tenant/general.js.map +1 -0
- package/dist/pages/tenant/index.d.ts +6 -0
- package/dist/pages/tenant/index.js +23 -0
- package/dist/pages/tenant/index.js.map +1 -0
- package/dist/pages/tenant/members-seat-quota.d.ts +3 -0
- package/dist/pages/tenant/members-seat-quota.js +25 -0
- package/dist/pages/tenant/members-seat-quota.js.map +1 -0
- package/dist/pages/tenant/support.d.ts +9 -0
- package/dist/pages/tenant/support.js +27 -0
- package/dist/pages/tenant/support.js.map +1 -0
- package/dist/pages/tenant/workspace-suspended.d.ts +9 -0
- package/dist/pages/tenant/workspace-suspended.js +26 -0
- package/dist/pages/tenant/workspace-suspended.js.map +1 -0
- package/dist/plan-changes/deferred.d.ts +18 -0
- package/dist/plan-changes/deferred.js +225 -0
- package/dist/plan-changes/deferred.js.map +1 -0
- package/dist/plan-changes/index.d.ts +1 -0
- package/dist/plan-changes/index.js +18 -0
- package/dist/plan-changes/index.js.map +1 -0
- package/dist/plans/index.d.ts +4 -0
- package/dist/plans/index.js +21 -0
- package/dist/plans/index.js.map +1 -0
- package/dist/plans/seat-capacity.d.ts +9 -0
- package/dist/plans/seat-capacity.js +38 -0
- package/dist/plans/seat-capacity.js.map +1 -0
- package/dist/plans/seat-hooks.d.ts +1 -0
- package/dist/plans/seat-hooks.js +80 -0
- package/dist/plans/seat-hooks.js.map +1 -0
- package/dist/plans/seat-sync.d.ts +10 -0
- package/dist/plans/seat-sync.js +23 -0
- package/dist/plans/seat-sync.js.map +1 -0
- package/dist/routes/index.d.ts +3 -0
- package/dist/routes/index.js +20 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/platformOwner/billing-settings.d.ts +20 -0
- package/dist/routes/platformOwner/billing-settings.js +98 -0
- package/dist/routes/platformOwner/billing-settings.js.map +1 -0
- package/dist/routes/platformOwner/credit-notes-issue.d.ts +16 -0
- package/dist/routes/platformOwner/credit-notes-issue.js +56 -0
- package/dist/routes/platformOwner/credit-notes-issue.js.map +1 -0
- package/dist/routes/platformOwner/dashboard.d.ts +62 -0
- package/dist/routes/platformOwner/dashboard.js +310 -0
- package/dist/routes/platformOwner/dashboard.js.map +1 -0
- package/dist/routes/platformOwner/index.d.ts +12 -0
- package/dist/routes/platformOwner/index.js +29 -0
- package/dist/routes/platformOwner/index.js.map +1 -0
- package/dist/routes/platformOwner/plan-deletion.d.ts +30 -0
- package/dist/routes/platformOwner/plan-deletion.js +156 -0
- package/dist/routes/platformOwner/plan-deletion.js.map +1 -0
- package/dist/routes/platformOwner/plans.d.ts +99 -0
- package/dist/routes/platformOwner/plans.js +376 -0
- package/dist/routes/platformOwner/plans.js.map +1 -0
- package/dist/routes/platformOwner/platform-notes.d.ts +36 -0
- package/dist/routes/platformOwner/platform-notes.js +149 -0
- package/dist/routes/platformOwner/platform-notes.js.map +1 -0
- package/dist/routes/platformOwner/platform-owners.d.ts +12 -0
- package/dist/routes/platformOwner/platform-owners.js +77 -0
- package/dist/routes/platformOwner/platform-owners.js.map +1 -0
- package/dist/routes/platformOwner/segments.d.ts +24 -0
- package/dist/routes/platformOwner/segments.js +174 -0
- package/dist/routes/platformOwner/segments.js.map +1 -0
- package/dist/routes/platformOwner/support.d.ts +21 -0
- package/dist/routes/platformOwner/support.js +180 -0
- package/dist/routes/platformOwner/support.js.map +1 -0
- package/dist/routes/platformOwner/users-detail.d.ts +26 -0
- package/dist/routes/platformOwner/users-detail.js +82 -0
- package/dist/routes/platformOwner/users-detail.js.map +1 -0
- package/dist/routes/platformOwner/workspace-operator-actions.d.ts +34 -0
- package/dist/routes/platformOwner/workspace-operator-actions.js +183 -0
- package/dist/routes/platformOwner/workspace-operator-actions.js.map +1 -0
- package/dist/routes/platformOwner/workspaces-admin.d.ts +27 -0
- package/dist/routes/platformOwner/workspaces-admin.js +140 -0
- package/dist/routes/platformOwner/workspaces-admin.js.map +1 -0
- package/dist/routes/public/index.d.ts +3 -0
- package/dist/routes/public/index.js +20 -0
- package/dist/routes/public/index.js.map +1 -0
- package/dist/routes/public/legal-documents.d.ts +15 -0
- package/dist/routes/public/legal-documents.js +72 -0
- package/dist/routes/public/legal-documents.js.map +1 -0
- package/dist/routes/public/register.d.ts +48 -0
- package/dist/routes/public/register.js +193 -0
- package/dist/routes/public/register.js.map +1 -0
- package/dist/routes/public/webhooks/index.d.ts +1 -0
- package/dist/routes/public/webhooks/index.js +18 -0
- package/dist/routes/public/webhooks/index.js.map +1 -0
- package/dist/routes/public/webhooks/stripe.d.ts +7 -0
- package/dist/routes/public/webhooks/stripe.js +41 -0
- package/dist/routes/public/webhooks/stripe.js.map +1 -0
- package/dist/routes/tenant/billing-portal.d.ts +31 -0
- package/dist/routes/tenant/billing-portal.js +117 -0
- package/dist/routes/tenant/billing-portal.js.map +1 -0
- package/dist/routes/tenant/billing-self-refund.d.ts +18 -0
- package/dist/routes/tenant/billing-self-refund.js +199 -0
- package/dist/routes/tenant/billing-self-refund.js.map +1 -0
- package/dist/routes/tenant/data-export.d.ts +16 -0
- package/dist/routes/tenant/data-export.js +102 -0
- package/dist/routes/tenant/data-export.js.map +1 -0
- package/dist/routes/tenant/index.d.ts +9 -0
- package/dist/routes/tenant/index.js +26 -0
- package/dist/routes/tenant/index.js.map +1 -0
- package/dist/routes/tenant/support.d.ts +27 -0
- package/dist/routes/tenant/support.js +185 -0
- package/dist/routes/tenant/support.js.map +1 -0
- package/dist/routes/tenant/tenant-billing.d.ts +26 -0
- package/dist/routes/tenant/tenant-billing.js +148 -0
- package/dist/routes/tenant/tenant-billing.js.map +1 -0
- package/dist/routes/tenant/tenant-plan-ops.d.ts +57 -0
- package/dist/routes/tenant/tenant-plan-ops.js +244 -0
- package/dist/routes/tenant/tenant-plan-ops.js.map +1 -0
- package/dist/routes/tenant/tenant-plan.d.ts +19 -0
- package/dist/routes/tenant/tenant-plan.js +172 -0
- package/dist/routes/tenant/tenant-plan.js.map +1 -0
- package/dist/routes/tenant/tenant-seats.d.ts +17 -0
- package/dist/routes/tenant/tenant-seats.js +58 -0
- package/dist/routes/tenant/tenant-seats.js.map +1 -0
- package/dist/routes/tenant/workspaces.d.ts +78 -0
- package/dist/routes/tenant/workspaces.js +301 -0
- package/dist/routes/tenant/workspaces.js.map +1 -0
- package/dist/stripe/client.d.ts +6 -0
- package/dist/stripe/client.js +44 -0
- package/dist/stripe/client.js.map +1 -0
- package/dist/stripe/customer-balance.d.ts +12 -0
- package/dist/stripe/customer-balance.js +16 -0
- package/dist/stripe/customer-balance.js.map +1 -0
- package/dist/stripe/customer-billing.d.ts +33 -0
- package/dist/stripe/customer-billing.js +140 -0
- package/dist/stripe/customer-billing.js.map +1 -0
- package/dist/stripe/index.d.ts +11 -0
- package/dist/stripe/index.js +28 -0
- package/dist/stripe/index.js.map +1 -0
- package/dist/stripe/plan-schedule.d.ts +9 -0
- package/dist/stripe/plan-schedule.js +83 -0
- package/dist/stripe/plan-schedule.js.map +1 -0
- package/dist/stripe/proration.d.ts +2 -0
- package/dist/stripe/proration.js +19 -0
- package/dist/stripe/proration.js.map +1 -0
- package/dist/stripe/sync-plan.d.ts +2 -0
- package/dist/stripe/sync-plan.js +66 -0
- package/dist/stripe/sync-plan.js.map +1 -0
- package/dist/stripe/webhook-checkout.d.ts +3 -0
- package/dist/stripe/webhook-checkout.js +157 -0
- package/dist/stripe/webhook-checkout.js.map +1 -0
- package/dist/stripe/webhook-credit-notes.d.ts +3 -0
- package/dist/stripe/webhook-credit-notes.js +192 -0
- package/dist/stripe/webhook-credit-notes.js.map +1 -0
- package/dist/stripe/webhook-dispatch.d.ts +2 -0
- package/dist/stripe/webhook-dispatch.js +45 -0
- package/dist/stripe/webhook-dispatch.js.map +1 -0
- package/dist/stripe/webhook-handlers.d.ts +11 -0
- package/dist/stripe/webhook-handlers.js +318 -0
- package/dist/stripe/webhook-handlers.js.map +1 -0
- package/dist/stripe/webhook-shared.d.ts +28 -0
- package/dist/stripe/webhook-shared.js +126 -0
- package/dist/stripe/webhook-shared.js.map +1 -0
- package/dist/stripe/workspace-checkout.d.ts +29 -0
- package/dist/stripe/workspace-checkout.js +106 -0
- package/dist/stripe/workspace-checkout.js.map +1 -0
- package/dist/support/admissions.d.ts +36 -0
- package/dist/support/admissions.js +136 -0
- package/dist/support/admissions.js.map +1 -0
- package/dist/support/attachments.d.ts +12 -0
- package/dist/support/attachments.js +56 -0
- package/dist/support/attachments.js.map +1 -0
- package/dist/support/config.d.ts +19 -0
- package/dist/support/config.js +75 -0
- package/dist/support/config.js.map +1 -0
- package/dist/support/index.d.ts +6 -0
- package/dist/support/index.js +23 -0
- package/dist/support/index.js.map +1 -0
- package/dist/support/operations.d.ts +51 -0
- package/dist/support/operations.js +109 -0
- package/dist/support/operations.js.map +1 -0
- package/dist/support/plans.d.ts +6 -0
- package/dist/support/plans.js +130 -0
- package/dist/support/plans.js.map +1 -0
- package/dist/support/publications.d.ts +8 -0
- package/dist/support/publications.js +106 -0
- package/dist/support/publications.js.map +1 -0
- package/dist/support/recovery.d.ts +7 -0
- package/dist/support/recovery.js +43 -0
- package/dist/support/recovery.js.map +1 -0
- package/dist/support/service.d.ts +51 -0
- package/dist/support/service.js +143 -0
- package/dist/support/service.js.map +1 -0
- package/dist/support/transitions.d.ts +4 -0
- package/dist/support/transitions.js +29 -0
- package/dist/support/transitions.js.map +1 -0
- package/dist/support/uploads.d.ts +39 -0
- package/dist/support/uploads.js +115 -0
- package/dist/support/uploads.js.map +1 -0
- package/dist/support/validation.d.ts +15 -0
- package/dist/support/validation.js +54 -0
- package/dist/support/validation.js.map +1 -0
- package/dist/types/config.d.ts +16 -0
- package/dist/types/config.js +3 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/billing-document-type.d.ts +3 -0
- package/dist/utils/billing-document-type.js +18 -0
- package/dist/utils/billing-document-type.js.map +1 -0
- package/dist/utils/billing-period-type.d.ts +3 -0
- package/dist/utils/billing-period-type.js +18 -0
- package/dist/utils/billing-period-type.js.map +1 -0
- package/dist/utils/email-hash.d.ts +1 -0
- package/dist/utils/email-hash.js +8 -0
- package/dist/utils/email-hash.js.map +1 -0
- package/dist/utils/export-dataset-stream.d.ts +19 -0
- package/dist/utils/export-dataset-stream.js +40 -0
- package/dist/utils/export-dataset-stream.js.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.js +32 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/invoice-lines-type.d.ts +27 -0
- package/dist/utils/invoice-lines-type.js +34 -0
- package/dist/utils/invoice-lines-type.js.map +1 -0
- package/dist/utils/money-cents-type.d.ts +3 -0
- package/dist/utils/money-cents-type.js +18 -0
- package/dist/utils/money-cents-type.js.map +1 -0
- package/dist/utils/pagination.d.ts +22 -0
- package/dist/utils/pagination.js +35 -0
- package/dist/utils/pagination.js.map +1 -0
- package/dist/utils/parse-future-date.d.ts +1 -0
- package/dist/utils/parse-future-date.js +15 -0
- package/dist/utils/parse-future-date.js.map +1 -0
- package/dist/utils/row-instance.d.ts +1 -0
- package/dist/utils/row-instance.js +8 -0
- package/dist/utils/row-instance.js.map +1 -0
- package/dist/utils/segment-conditions-type.d.ts +33 -0
- package/dist/utils/segment-conditions-type.js +86 -0
- package/dist/utils/segment-conditions-type.js.map +1 -0
- package/dist/utils/segment-evaluator.d.ts +3 -0
- package/dist/utils/segment-evaluator.js +117 -0
- package/dist/utils/segment-evaluator.js.map +1 -0
- package/dist/utils/segment-fields.d.ts +19 -0
- package/dist/utils/segment-fields.js +212 -0
- package/dist/utils/segment-fields.js.map +1 -0
- package/dist/utils/segment-matching.d.ts +56 -0
- package/dist/utils/segment-matching.js +200 -0
- package/dist/utils/segment-matching.js.map +1 -0
- package/dist/utils/segment-name-cache.d.ts +2 -0
- package/dist/utils/segment-name-cache.js +22 -0
- package/dist/utils/segment-name-cache.js.map +1 -0
- package/dist/utils/time.d.ts +3 -0
- package/dist/utils/time.js +10 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/workers/index.d.ts +1 -0
- package/dist/workers/index.js +18 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/plan-migration.d.ts +4 -0
- package/dist/workers/plan-migration.js +206 -0
- package/dist/workers/plan-migration.js.map +1 -0
- package/dist/workspaces/billing-profile.d.ts +3 -0
- package/dist/workspaces/billing-profile.js +55 -0
- package/dist/workspaces/billing-profile.js.map +1 -0
- package/dist/workspaces/complimentary.d.ts +7 -0
- package/dist/workspaces/complimentary.js +47 -0
- package/dist/workspaces/complimentary.js.map +1 -0
- package/dist/workspaces/db/card-capacity.model.d.ts +30 -0
- package/dist/workspaces/db/card-capacity.model.js +98 -0
- package/dist/workspaces/db/card-capacity.model.js.map +1 -0
- package/dist/workspaces/db/card-capacity.table.d.ts +11 -0
- package/dist/workspaces/db/card-capacity.table.js +34 -0
- package/dist/workspaces/db/card-capacity.table.js.map +1 -0
- package/dist/workspaces/db/provisioning-attempt.model.d.ts +24 -0
- package/dist/workspaces/db/provisioning-attempt.model.js +33 -0
- package/dist/workspaces/db/provisioning-attempt.model.js.map +1 -0
- package/dist/workspaces/db/provisioning-attempt.table.d.ts +18 -0
- package/dist/workspaces/db/provisioning-attempt.table.js +77 -0
- package/dist/workspaces/db/provisioning-attempt.table.js.map +1 -0
- package/dist/workspaces/db/trial-identity.model.d.ts +25 -0
- package/dist/workspaces/db/trial-identity.model.js +62 -0
- package/dist/workspaces/db/trial-identity.model.js.map +1 -0
- package/dist/workspaces/db/trial-identity.table.d.ts +7 -0
- package/dist/workspaces/db/trial-identity.table.js +34 -0
- package/dist/workspaces/db/trial-identity.table.js.map +1 -0
- package/dist/workspaces/deletion.d.ts +8 -0
- package/dist/workspaces/deletion.js +75 -0
- package/dist/workspaces/deletion.js.map +1 -0
- package/dist/workspaces/free-workspace-guard.d.ts +11 -0
- package/dist/workspaces/free-workspace-guard.js +96 -0
- package/dist/workspaces/free-workspace-guard.js.map +1 -0
- package/dist/workspaces/index.d.ts +6 -0
- package/dist/workspaces/index.js +23 -0
- package/dist/workspaces/index.js.map +1 -0
- package/dist/workspaces/provisioning-rollback.d.ts +2 -0
- package/dist/workspaces/provisioning-rollback.js +78 -0
- package/dist/workspaces/provisioning-rollback.js.map +1 -0
- package/dist/workspaces/provisioning-state.d.ts +6 -0
- package/dist/workspaces/provisioning-state.js +91 -0
- package/dist/workspaces/provisioning-state.js.map +1 -0
- package/dist/workspaces/provisioning.d.ts +49 -0
- package/dist/workspaces/provisioning.js +263 -0
- package/dist/workspaces/provisioning.js.map +1 -0
- package/dist/workspaces/registration-extras.d.ts +1 -0
- package/dist/workspaces/registration-extras.js +50 -0
- package/dist/workspaces/registration-extras.js.map +1 -0
- package/dist/workspaces/suspension.d.ts +13 -0
- package/dist/workspaces/suspension.js +124 -0
- package/dist/workspaces/suspension.js.map +1 -0
- package/frontend-vue/.editorconfig +12 -0
- package/frontend-vue/.prettierrc +11 -0
- package/frontend-vue/app/build/.gitkeep +0 -0
- package/frontend-vue/app/components/CardGrid.vue +77 -0
- package/frontend-vue/app/components/CustomerPortalButton.vue +45 -0
- package/frontend-vue/app/components/DataExport.vue +300 -0
- package/frontend-vue/app/components/DeletePlanModal.vue +223 -0
- package/frontend-vue/app/components/FreeAccessBanner.vue +70 -0
- package/frontend-vue/app/components/InvoiceLines.vue +57 -0
- package/frontend-vue/app/components/IssueCreditNoteModal.vue +128 -0
- package/frontend-vue/app/components/LegalLayout.vue +63 -0
- package/frontend-vue/app/components/LoadFailure.vue +25 -0
- package/frontend-vue/app/components/PastDueAlert.vue +96 -0
- package/frontend-vue/app/components/PaymentMethodCard.vue +86 -0
- package/frontend-vue/app/components/PlanCard.vue +294 -0
- package/frontend-vue/app/components/PlanCardPublic.vue +59 -0
- package/frontend-vue/app/components/PlanCardsDisplay.vue +127 -0
- package/frontend-vue/app/components/PlanComparisonModal.vue +213 -0
- package/frontend-vue/app/components/PlanInheritancePicker.vue +329 -0
- package/frontend-vue/app/components/PlatformNotes.vue +281 -0
- package/frontend-vue/app/components/PlatformSupport.vue +461 -0
- package/frontend-vue/app/components/RecentActivity.vue +72 -0
- package/frontend-vue/app/components/RefundButton.vue +126 -0
- package/frontend-vue/app/components/Register.vue +174 -0
- package/frontend-vue/app/components/RegistrationClosed.vue +15 -0
- package/frontend-vue/app/components/SeatQuotaBanner.vue +78 -0
- package/frontend-vue/app/components/SegmentConditionsBuilder.vue +176 -0
- package/frontend-vue/app/components/SegmentConditionsGroup.vue +494 -0
- package/frontend-vue/app/components/SupportAttachmentUpload.vue +140 -0
- package/frontend-vue/app/components/SupportThreadHistory.vue +139 -0
- package/frontend-vue/app/components/TenantBillingForm.vue +208 -0
- package/frontend-vue/app/components/TenantPlanCard.vue +223 -0
- package/frontend-vue/app/components/TenantSupport.vue +415 -0
- package/frontend-vue/app/components/UserSummaryCard.vue +166 -0
- package/frontend-vue/app/components/WorkspaceBillingInfo.vue +68 -0
- package/frontend-vue/app/components/WorkspaceCompAccessButton.vue +198 -0
- package/frontend-vue/app/components/WorkspaceCreateModal.vue +256 -0
- package/frontend-vue/app/components/WorkspaceDangerZone.vue +146 -0
- package/frontend-vue/app/components/WorkspaceDetailHeader.vue +24 -0
- package/frontend-vue/app/components/WorkspaceIdentity.vue +99 -0
- package/frontend-vue/app/components/WorkspaceJoinButton.vue +50 -0
- package/frontend-vue/app/components/WorkspaceOperatorActions.vue +340 -0
- package/frontend-vue/app/components/WorkspaceSummaryCard.vue +161 -0
- package/frontend-vue/app/components/WorkspaceSuspendButton.vue +167 -0
- package/frontend-vue/app/components/WorkspaceSuspended.vue +164 -0
- package/frontend-vue/app/components/WorkspaceSwitcherWidget.vue +247 -0
- package/frontend-vue/app/composables/useApiErrorMessage.ts +35 -0
- package/frontend-vue/app/composables/useBillingCountries.ts +54 -0
- package/frontend-vue/app/composables/useBillingDocumentType.ts +7 -0
- package/frontend-vue/app/composables/useBillingStatus.ts +39 -0
- package/frontend-vue/app/composables/useCurrentWorkspace.ts +43 -0
- package/frontend-vue/app/composables/useDetailRefresh.ts +17 -0
- package/frontend-vue/app/composables/useExportHistory.ts +143 -0
- package/frontend-vue/app/composables/useInvoiceLines.ts +22 -0
- package/frontend-vue/app/composables/useMoneyFormat.ts +49 -0
- package/frontend-vue/app/composables/useMyWorkspaces.ts +47 -0
- package/frontend-vue/app/composables/usePlanFeatureFormat.ts +60 -0
- package/frontend-vue/app/composables/usePlanIntervalLabel.ts +30 -0
- package/frontend-vue/app/composables/useSaasRegistration.ts +522 -0
- package/frontend-vue/app/composables/useSeatQuota.ts +18 -0
- package/frontend-vue/app/composables/useSharedRequest.ts +54 -0
- package/frontend-vue/app/composables/useStripePaymentElement.ts +74 -0
- package/frontend-vue/app/composables/useSubscriptionAccess.ts +12 -0
- package/frontend-vue/app/composables/useSupportRequest.ts +74 -0
- package/frontend-vue/app/composables/useTenantPlan.ts +95 -0
- package/frontend-vue/app/composables/useTenantSwitch.ts +22 -0
- package/frontend-vue/app/composables/useWorkspaceAccessCache.ts +25 -0
- package/frontend-vue/app/custom-pages/auth/no-workspace.vue +495 -0
- package/frontend-vue/app/middleware/workspace-suspended.global.ts +56 -0
- package/frontend-vue/app/plugins/auth-links.ts +24 -0
- package/frontend-vue/app/plugins/billing-data-types.ts +62 -0
- package/frontend-vue/app/plugins/footer-links.ts +36 -0
- package/frontend-vue/app/plugins/plan-cards-display.client.ts +16 -0
- package/frontend-vue/app/plugins/segment-conditions-data-type.client.ts +122 -0
- package/frontend-vue/app/plugins/sidebar-widgets.ts +13 -0
- package/frontend-vue/app/types/support.ts +123 -0
- package/frontend-vue/dms.frontend.ts +68 -0
- package/frontend-vue/eslint.config.mjs +13 -0
- package/frontend-vue/i18n/locales/saas-en-GB.json +1285 -0
- package/frontend-vue/i18n/locales/saas-fr-FR.json +1285 -0
- package/frontend-vue/package.json +27 -0
- package/frontend-vue/pnpm-lock.yaml +4948 -0
- package/frontend-vue/pnpm-workspace.yaml +2 -0
- package/frontend-vue/server/routes/auth/finalize-workspace.post.ts +61 -0
- package/package.json +91 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const START_ENDPOINT = "/api/saas/data-export/start";
|
|
5
|
+
/** Query parameter a delivered export link carries, set by dms-base. */
|
|
6
|
+
const EXPORT_JOB_QUERY_PARAM = "exportJob";
|
|
7
|
+
|
|
8
|
+
const HISTORY_ERROR_DOWNLOAD_KEY =
|
|
9
|
+
"saas.workspace.data_export.history.error_download";
|
|
10
|
+
const HISTORY_ERROR_EXPIRED_KEY =
|
|
11
|
+
"saas.workspace.data_export.history.error_expired";
|
|
12
|
+
|
|
13
|
+
/** Statuses saying the archive is gone for good, not momentarily unreachable. */
|
|
14
|
+
const GONE_STATUSES = new Set([404, 410]);
|
|
15
|
+
|
|
16
|
+
const STATUS_COLORS: Record<string, SemanticColor> = {
|
|
17
|
+
completed: "success",
|
|
18
|
+
failed: "error",
|
|
19
|
+
pending: "info",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const DATE_FORMAT: Intl.DateTimeFormatOptions = {
|
|
23
|
+
day: "numeric",
|
|
24
|
+
month: "short",
|
|
25
|
+
year: "numeric",
|
|
26
|
+
hour: "2-digit",
|
|
27
|
+
minute: "2-digit",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const { runJob } = useExportJob();
|
|
31
|
+
const {
|
|
32
|
+
entries,
|
|
33
|
+
isLoading: isHistoryLoading,
|
|
34
|
+
hasFailed,
|
|
35
|
+
page,
|
|
36
|
+
hasMore,
|
|
37
|
+
load,
|
|
38
|
+
goToPage,
|
|
39
|
+
download,
|
|
40
|
+
} = useExportHistory();
|
|
41
|
+
const { resolveApiError } = useApiErrorMessage();
|
|
42
|
+
const { t, locale } = useI18n();
|
|
43
|
+
const route = useDmsRoute();
|
|
44
|
+
const router = useDmsRouter();
|
|
45
|
+
const toast = useToast();
|
|
46
|
+
|
|
47
|
+
const isStarting = ref(false);
|
|
48
|
+
const downloadingJobId = ref<string | null>(null);
|
|
49
|
+
|
|
50
|
+
function statusColor(entry: ExportHistoryEntry): SemanticColor {
|
|
51
|
+
return STATUS_COLORS[entry.status] ?? "neutral";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function statusLabel(entry: ExportHistoryEntry): string {
|
|
55
|
+
if (entry.status === "completed" && entry.result?.partial) {
|
|
56
|
+
return t("saas.workspace.data_export.history.status_partial");
|
|
57
|
+
}
|
|
58
|
+
return t(`saas.workspace.data_export.history.status_${entry.status}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function formatMoment(value?: string): string {
|
|
62
|
+
return formatDateTime(value, locale.value, DATE_FORMAT) ?? "—";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isExpired(entry: ExportHistoryEntry): boolean {
|
|
66
|
+
return !!entry.expiresAt && new Date(entry.expiresAt).getTime() <= Date.now();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function isDownloadable(entry: ExportHistoryEntry): boolean {
|
|
70
|
+
return entry.status === "completed" && !isExpired(entry);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** One archive at a time, and the other rows say so rather than ignoring a click. */
|
|
74
|
+
function isDownloadBlocked(entry: ExportHistoryEntry): boolean {
|
|
75
|
+
return (
|
|
76
|
+
downloadingJobId.value !== null && downloadingJobId.value !== entry.jobId
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function startExport(): Promise<void> {
|
|
81
|
+
if (isStarting.value) return;
|
|
82
|
+
isStarting.value = true;
|
|
83
|
+
try {
|
|
84
|
+
await runJob({
|
|
85
|
+
startUrl: START_ENDPOINT,
|
|
86
|
+
startMethod: "POST",
|
|
87
|
+
labels: {
|
|
88
|
+
title: t("saas.workspace.data_export.title"),
|
|
89
|
+
successTitle: t("saas.workspace.data_export.success_title"),
|
|
90
|
+
successMessage: t("saas.workspace.data_export.success_message"),
|
|
91
|
+
errorTitle: t("saas.workspace.data_export.error_title"),
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
} finally {
|
|
95
|
+
isStarting.value = false;
|
|
96
|
+
await load();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface DownloadOutcome {
|
|
101
|
+
ok: boolean;
|
|
102
|
+
/** HTTP status of the failure, when the server sent one. */
|
|
103
|
+
status?: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface HttpErrorLike {
|
|
107
|
+
statusCode?: unknown;
|
|
108
|
+
status?: unknown;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function errorStatus(error: unknown): number | undefined {
|
|
112
|
+
const candidate = error as HttpErrorLike | null;
|
|
113
|
+
const status = candidate?.statusCode ?? candidate?.status;
|
|
114
|
+
return typeof status === "number" ? status : undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function isGone(status?: number): boolean {
|
|
118
|
+
return status !== undefined && GONE_STATUSES.has(status);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function runDownload(
|
|
122
|
+
jobId: string,
|
|
123
|
+
errorKey: (status?: number) => string,
|
|
124
|
+
naming?: ExportDownloadNaming,
|
|
125
|
+
): Promise<DownloadOutcome> {
|
|
126
|
+
if (downloadingJobId.value) return { ok: false };
|
|
127
|
+
downloadingJobId.value = jobId;
|
|
128
|
+
try {
|
|
129
|
+
await download(jobId, naming);
|
|
130
|
+
return { ok: true };
|
|
131
|
+
} catch (error) {
|
|
132
|
+
const status = errorStatus(error);
|
|
133
|
+
toast.add({
|
|
134
|
+
title: resolveApiError(error, errorKey(status)),
|
|
135
|
+
color: "error",
|
|
136
|
+
icon: "i-ph-warning-circle",
|
|
137
|
+
});
|
|
138
|
+
return { ok: false, status };
|
|
139
|
+
} finally {
|
|
140
|
+
downloadingJobId.value = null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function downloadEntry(entry: ExportHistoryEntry): Promise<DownloadOutcome> {
|
|
145
|
+
return runDownload(entry.jobId, () => HISTORY_ERROR_DOWNLOAD_KEY, entry);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* "Expired" is only claimed when the server said the archive is gone; a
|
|
150
|
+
* network failure or a 500 gets the generic download error instead.
|
|
151
|
+
*/
|
|
152
|
+
function deliveredLinkErrorKey(status?: number): string {
|
|
153
|
+
return isGone(status)
|
|
154
|
+
? HISTORY_ERROR_EXPIRED_KEY
|
|
155
|
+
: HISTORY_ERROR_DOWNLOAD_KEY;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function clearDeliveredLink(): Promise<void> {
|
|
159
|
+
const { [EXPORT_JOB_QUERY_PARAM]: _consumed, ...query } = route.query;
|
|
160
|
+
await router.replace({ query });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The link mailed on completion lands here carrying its job id. The archive is
|
|
165
|
+
* behind an authenticated route, so the page downloads it on the visitor's
|
|
166
|
+
* behalf rather than the link resolving to the file directly.
|
|
167
|
+
*
|
|
168
|
+
* The query parameter is what makes the link retryable: it is dropped once the
|
|
169
|
+
* download succeeded or the archive is gone for good, and kept on a transient
|
|
170
|
+
* failure so reloading the page tries the download again.
|
|
171
|
+
*/
|
|
172
|
+
async function consumeDeliveredLink(): Promise<void> {
|
|
173
|
+
const jobId = route.query[EXPORT_JOB_QUERY_PARAM];
|
|
174
|
+
if (typeof jobId !== "string" || !jobId) return;
|
|
175
|
+
|
|
176
|
+
const outcome = await runDownload(
|
|
177
|
+
jobId,
|
|
178
|
+
deliveredLinkErrorKey,
|
|
179
|
+
entries.value.find((candidate) => candidate.jobId === jobId),
|
|
180
|
+
);
|
|
181
|
+
if (outcome.ok || isGone(outcome.status)) await clearDeliveredLink();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
onMounted(async () => {
|
|
185
|
+
await load();
|
|
186
|
+
await consumeDeliveredLink();
|
|
187
|
+
});
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
<template>
|
|
191
|
+
<div class="flex flex-col gap-6">
|
|
192
|
+
<div class="flex flex-col gap-3">
|
|
193
|
+
<p class="text-sm text-muted">
|
|
194
|
+
{{ $t("saas.workspace.data_export.intro") }}
|
|
195
|
+
</p>
|
|
196
|
+
<div>
|
|
197
|
+
<UButton
|
|
198
|
+
color="primary"
|
|
199
|
+
icon="i-ph-download-simple"
|
|
200
|
+
:loading="isStarting"
|
|
201
|
+
@click="startExport"
|
|
202
|
+
>
|
|
203
|
+
{{ $t("saas.workspace.data_export.download") }}
|
|
204
|
+
</UButton>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
<div class="flex flex-col gap-3">
|
|
209
|
+
<h3 class="text-sm font-semibold">
|
|
210
|
+
{{ $t("saas.workspace.data_export.history.title") }}
|
|
211
|
+
</h3>
|
|
212
|
+
|
|
213
|
+
<USkeleton v-if="isHistoryLoading" class="h-20 w-full" />
|
|
214
|
+
|
|
215
|
+
<UAlert
|
|
216
|
+
v-else-if="hasFailed"
|
|
217
|
+
color="error"
|
|
218
|
+
variant="subtle"
|
|
219
|
+
icon="i-ph-warning-circle"
|
|
220
|
+
:title="$t('saas.workspace.data_export.history.error_load')"
|
|
221
|
+
/>
|
|
222
|
+
|
|
223
|
+
<p v-else-if="!entries.length" class="text-muted text-sm">
|
|
224
|
+
{{ $t("saas.workspace.data_export.history.empty") }}
|
|
225
|
+
</p>
|
|
226
|
+
|
|
227
|
+
<div
|
|
228
|
+
v-else
|
|
229
|
+
class="border-default divide-default divide-y rounded-lg border"
|
|
230
|
+
>
|
|
231
|
+
<div
|
|
232
|
+
v-for="entry in entries"
|
|
233
|
+
:key="entry.jobId"
|
|
234
|
+
class="flex flex-wrap items-center gap-3 p-3 text-sm"
|
|
235
|
+
>
|
|
236
|
+
<div class="min-w-40 grow">
|
|
237
|
+
<p class="tabular-nums">{{ formatMoment(entry.createdAt) }}</p>
|
|
238
|
+
<p class="text-muted text-xs">
|
|
239
|
+
{{ $t("saas.workspace.data_export.history.scope") }}
|
|
240
|
+
</p>
|
|
241
|
+
</div>
|
|
242
|
+
<UBadge :color="statusColor(entry)" variant="subtle" size="sm">
|
|
243
|
+
{{ statusLabel(entry) }}
|
|
244
|
+
</UBadge>
|
|
245
|
+
<span class="text-muted min-w-40 text-xs">
|
|
246
|
+
{{
|
|
247
|
+
isExpired(entry)
|
|
248
|
+
? $t("saas.workspace.data_export.history.expired")
|
|
249
|
+
: $t("saas.workspace.data_export.history.expires_at", {
|
|
250
|
+
date: formatMoment(entry.expiresAt),
|
|
251
|
+
})
|
|
252
|
+
}}
|
|
253
|
+
</span>
|
|
254
|
+
<UButton
|
|
255
|
+
v-if="isDownloadable(entry)"
|
|
256
|
+
color="neutral"
|
|
257
|
+
variant="outline"
|
|
258
|
+
size="sm"
|
|
259
|
+
icon="i-ph-download-simple"
|
|
260
|
+
:loading="downloadingJobId === entry.jobId"
|
|
261
|
+
:disabled="isDownloadBlocked(entry)"
|
|
262
|
+
@click="downloadEntry(entry)"
|
|
263
|
+
>
|
|
264
|
+
{{ $t("saas.workspace.data_export.history.download") }}
|
|
265
|
+
</UButton>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
<div
|
|
270
|
+
v-if="!isHistoryLoading && !hasFailed && (page > 1 || hasMore)"
|
|
271
|
+
class="flex items-center justify-between gap-3"
|
|
272
|
+
>
|
|
273
|
+
<UButton
|
|
274
|
+
color="neutral"
|
|
275
|
+
variant="ghost"
|
|
276
|
+
size="sm"
|
|
277
|
+
icon="i-ph-caret-left"
|
|
278
|
+
:disabled="page <= 1"
|
|
279
|
+
@click="goToPage(page - 1)"
|
|
280
|
+
>
|
|
281
|
+
{{ $t("saas.workspace.data_export.history.previous") }}
|
|
282
|
+
</UButton>
|
|
283
|
+
<span class="text-muted text-xs tabular-nums">
|
|
284
|
+
{{ $t("saas.workspace.data_export.history.page", { page }) }}
|
|
285
|
+
</span>
|
|
286
|
+
<UButton
|
|
287
|
+
color="neutral"
|
|
288
|
+
variant="ghost"
|
|
289
|
+
size="sm"
|
|
290
|
+
icon="i-ph-caret-right"
|
|
291
|
+
trailing
|
|
292
|
+
:disabled="!hasMore"
|
|
293
|
+
@click="goToPage(page + 1)"
|
|
294
|
+
>
|
|
295
|
+
{{ $t("saas.workspace.data_export.history.next") }}
|
|
296
|
+
</UButton>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
</template>
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
3
|
+
|
|
4
|
+
interface PlanRowData {
|
|
5
|
+
_id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
workspaceCount?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface PlanOption {
|
|
11
|
+
_id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
isDeleted: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface DeletionPreparePayload {
|
|
18
|
+
affectedTenantsCount: number;
|
|
19
|
+
removedPermissions: string[];
|
|
20
|
+
addedPermissions: string[];
|
|
21
|
+
unchangedPermissions: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const PLANS_ENDPOINT = "/api/saas/plans";
|
|
25
|
+
const DELETE_ENDPOINT = "/api/saas/plans-deletion";
|
|
26
|
+
|
|
27
|
+
const props = defineProps<{
|
|
28
|
+
rowData?: PlanRowData;
|
|
29
|
+
onSuccessCallback?: () => void;
|
|
30
|
+
}>();
|
|
31
|
+
|
|
32
|
+
const { t } = useI18n();
|
|
33
|
+
const toast = useToast();
|
|
34
|
+
const { $authFetch } = useAuthFetch();
|
|
35
|
+
const { resolveApiError } = useApiErrorMessage();
|
|
36
|
+
|
|
37
|
+
const planId = computed(() => props.rowData?._id ?? "");
|
|
38
|
+
const planName = computed(() => props.rowData?.name ?? "");
|
|
39
|
+
const requiresMigration = computed(
|
|
40
|
+
() => (props.rowData?.workspaceCount ?? 0) > 0,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const availablePlans = ref<PlanOption[]>([]);
|
|
44
|
+
const targetPlanId = ref<string | undefined>(undefined);
|
|
45
|
+
const notifyMembers = ref(true);
|
|
46
|
+
const preparing = ref(false);
|
|
47
|
+
const submitting = ref(false);
|
|
48
|
+
const errorMessage = ref<string | null>(null);
|
|
49
|
+
const preview = ref<DeletionPreparePayload | null>(null);
|
|
50
|
+
|
|
51
|
+
const targetOptions = computed(() =>
|
|
52
|
+
availablePlans.value
|
|
53
|
+
.filter((p) => p._id !== planId.value && p.isActive && !p.isDeleted)
|
|
54
|
+
.map((p) => ({ value: p._id, label: p.name })),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
async function loadPlans(): Promise<void> {
|
|
58
|
+
if (!requiresMigration.value) return;
|
|
59
|
+
availablePlans.value = await $authFetch<PlanOption[]>(PLANS_ENDPOINT);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function loadPreview(): Promise<void> {
|
|
63
|
+
if (!targetPlanId.value) {
|
|
64
|
+
preview.value = null;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
preparing.value = true;
|
|
68
|
+
try {
|
|
69
|
+
preview.value = await $authFetch<DeletionPreparePayload>(
|
|
70
|
+
`${DELETE_ENDPOINT}/${planId.value}/prepare/${targetPlanId.value}`,
|
|
71
|
+
);
|
|
72
|
+
} finally {
|
|
73
|
+
preparing.value = false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function notifySuccess(): void {
|
|
78
|
+
toast.add({
|
|
79
|
+
title: t(
|
|
80
|
+
requiresMigration.value
|
|
81
|
+
? "saas.plans.delete.migration_started"
|
|
82
|
+
: "saas.plans.delete.success",
|
|
83
|
+
),
|
|
84
|
+
color: "success",
|
|
85
|
+
icon: "i-ph-check-circle",
|
|
86
|
+
});
|
|
87
|
+
props.onSuccessCallback?.();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function deleteSimple(): Promise<void> {
|
|
91
|
+
submitting.value = true;
|
|
92
|
+
errorMessage.value = null;
|
|
93
|
+
try {
|
|
94
|
+
await $authFetch(`${PLANS_ENDPOINT}/${planId.value}`, { method: "DELETE" });
|
|
95
|
+
notifySuccess();
|
|
96
|
+
} catch (error) {
|
|
97
|
+
errorMessage.value = resolveApiError(error, "saas.plans.delete.failed");
|
|
98
|
+
} finally {
|
|
99
|
+
submitting.value = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function deleteWithMigration(): Promise<void> {
|
|
104
|
+
if (!targetPlanId.value) {
|
|
105
|
+
errorMessage.value = t("saas.plans.delete.no_target");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
submitting.value = true;
|
|
109
|
+
errorMessage.value = null;
|
|
110
|
+
try {
|
|
111
|
+
await $authFetch(`${DELETE_ENDPOINT}/${planId.value}/migrate-and-delete`, {
|
|
112
|
+
method: "POST",
|
|
113
|
+
body: {
|
|
114
|
+
targetPlanId: targetPlanId.value,
|
|
115
|
+
notifyMembers: notifyMembers.value,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
notifySuccess();
|
|
119
|
+
} catch (error) {
|
|
120
|
+
errorMessage.value = resolveApiError(error, "saas.plans.delete.failed");
|
|
121
|
+
} finally {
|
|
122
|
+
submitting.value = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function submit(): Promise<void> {
|
|
127
|
+
return requiresMigration.value ? deleteWithMigration() : deleteSimple();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
watch(planId, () => {
|
|
131
|
+
targetPlanId.value = undefined;
|
|
132
|
+
preview.value = null;
|
|
133
|
+
errorMessage.value = null;
|
|
134
|
+
void loadPlans();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
watch(targetPlanId, () => {
|
|
138
|
+
void loadPreview();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
onMounted(loadPlans);
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<template>
|
|
145
|
+
<div class="flex flex-col gap-4">
|
|
146
|
+
<p class="font-medium">
|
|
147
|
+
{{
|
|
148
|
+
$t(
|
|
149
|
+
requiresMigration
|
|
150
|
+
? "saas.plans.delete.migration_title"
|
|
151
|
+
: "saas.plans.delete.simple_title",
|
|
152
|
+
{ name: planName },
|
|
153
|
+
)
|
|
154
|
+
}}
|
|
155
|
+
</p>
|
|
156
|
+
|
|
157
|
+
<template v-if="requiresMigration">
|
|
158
|
+
<p class="text-muted text-sm">
|
|
159
|
+
{{
|
|
160
|
+
$t("saas.plans.delete.migrate_intro", {
|
|
161
|
+
count: rowData?.workspaceCount ?? 0,
|
|
162
|
+
})
|
|
163
|
+
}}
|
|
164
|
+
</p>
|
|
165
|
+
<UFormField :label="$t('saas.plans.delete.target_label')">
|
|
166
|
+
<USelect
|
|
167
|
+
v-model="targetPlanId"
|
|
168
|
+
:items="targetOptions"
|
|
169
|
+
:placeholder="$t('saas.plans.delete.target_placeholder')"
|
|
170
|
+
class="w-full"
|
|
171
|
+
/>
|
|
172
|
+
</UFormField>
|
|
173
|
+
<UCheckbox
|
|
174
|
+
v-model="notifyMembers"
|
|
175
|
+
:label="$t('saas.plans.delete.notify_members')"
|
|
176
|
+
/>
|
|
177
|
+
<div v-if="preparing" class="text-muted text-sm">
|
|
178
|
+
{{ $t("saas.plans.delete.computing_diff") }}
|
|
179
|
+
</div>
|
|
180
|
+
<UCard v-else-if="preview">
|
|
181
|
+
<p class="font-semibold">
|
|
182
|
+
{{
|
|
183
|
+
$t("saas.plans.delete.affected_count", {
|
|
184
|
+
count: preview.affectedTenantsCount,
|
|
185
|
+
})
|
|
186
|
+
}}
|
|
187
|
+
</p>
|
|
188
|
+
<div v-if="preview.removedPermissions.length" class="mt-2">
|
|
189
|
+
<p class="text-muted text-sm">
|
|
190
|
+
{{ $t("saas.plans.delete.permissions_removed") }}
|
|
191
|
+
</p>
|
|
192
|
+
<ul class="list-disc pl-5 text-sm">
|
|
193
|
+
<li v-for="perm in preview.removedPermissions" :key="perm">
|
|
194
|
+
{{ perm }}
|
|
195
|
+
</li>
|
|
196
|
+
</ul>
|
|
197
|
+
</div>
|
|
198
|
+
</UCard>
|
|
199
|
+
</template>
|
|
200
|
+
|
|
201
|
+
<p v-else class="text-muted text-sm">
|
|
202
|
+
{{ $t("saas.plans.delete.simple_warning") }}
|
|
203
|
+
</p>
|
|
204
|
+
|
|
205
|
+
<p v-if="errorMessage" class="text-error">{{ errorMessage }}</p>
|
|
206
|
+
|
|
207
|
+
<div class="flex justify-end">
|
|
208
|
+
<UButton
|
|
209
|
+
color="error"
|
|
210
|
+
:loading="submitting"
|
|
211
|
+
:disabled="requiresMigration && (!targetPlanId || preparing)"
|
|
212
|
+
:icon="requiresMigration ? 'i-ph-arrows-clockwise' : 'i-ph-trash'"
|
|
213
|
+
@click="submit"
|
|
214
|
+
>
|
|
215
|
+
{{
|
|
216
|
+
requiresMigration
|
|
217
|
+
? $t("saas.plans.delete.confirm")
|
|
218
|
+
: $t("saas.plans.delete.simple_confirm")
|
|
219
|
+
}}
|
|
220
|
+
</UButton>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</template>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted } from "vue";
|
|
3
|
+
|
|
4
|
+
const BLOCKING_STATUSES = new Set(["pending_payment", "suspended", "cancelled"]);
|
|
5
|
+
|
|
6
|
+
// Bound to the shared state, not a snapshot: a plan change made from the
|
|
7
|
+
// sibling plan card must update the banner without a remount.
|
|
8
|
+
const { data, load } = useTenantPlan();
|
|
9
|
+
|
|
10
|
+
onMounted(() => {
|
|
11
|
+
void load();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const freeUntilDate = computed<Date | null>(() => {
|
|
15
|
+
if (!data.value?.freeUntil) return null;
|
|
16
|
+
const parsed = new Date(data.value.freeUntil);
|
|
17
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const isExpired = computed(() => {
|
|
21
|
+
return (
|
|
22
|
+
data.value?.status !== null &&
|
|
23
|
+
BLOCKING_STATUSES.has(data.value?.status ?? "")
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const showBanner = computed(() => {
|
|
28
|
+
if (!data.value?.isComplimentary) return false;
|
|
29
|
+
return true;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function formatDate(date: Date): string {
|
|
33
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
34
|
+
year: "numeric",
|
|
35
|
+
month: "long",
|
|
36
|
+
day: "numeric",
|
|
37
|
+
}).format(date);
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<UAlert
|
|
43
|
+
v-if="showBanner && isExpired"
|
|
44
|
+
color="error"
|
|
45
|
+
variant="subtle"
|
|
46
|
+
:title="$t('saas.workspace.free_access.expired_title')"
|
|
47
|
+
:description="$t('saas.workspace.free_access.expired_description')"
|
|
48
|
+
icon="i-ph-warning"
|
|
49
|
+
/>
|
|
50
|
+
<UAlert
|
|
51
|
+
v-else-if="showBanner && freeUntilDate"
|
|
52
|
+
color="warning"
|
|
53
|
+
variant="subtle"
|
|
54
|
+
:title="$t('saas.workspace.free_access.banner_title')"
|
|
55
|
+
:description="
|
|
56
|
+
$t('saas.workspace.free_access.banner_description', {
|
|
57
|
+
date: formatDate(freeUntilDate),
|
|
58
|
+
})
|
|
59
|
+
"
|
|
60
|
+
icon="i-ph-hourglass"
|
|
61
|
+
/>
|
|
62
|
+
<UAlert
|
|
63
|
+
v-else-if="showBanner"
|
|
64
|
+
color="info"
|
|
65
|
+
variant="subtle"
|
|
66
|
+
:title="$t('saas.workspace.free_access.indefinite_title')"
|
|
67
|
+
:description="$t('saas.workspace.free_access.indefinite_description')"
|
|
68
|
+
icon="i-ph-gift"
|
|
69
|
+
/>
|
|
70
|
+
</template>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
|
|
4
|
+
const LINE_PERIOD_FORMAT: Intl.DateTimeFormatOptions = {
|
|
5
|
+
day: "numeric",
|
|
6
|
+
month: "short",
|
|
7
|
+
year: "numeric",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
modelValue?: InvoiceLine[] | string | null;
|
|
12
|
+
initialValue?: InvoiceLine[] | string | null;
|
|
13
|
+
}>();
|
|
14
|
+
|
|
15
|
+
const { formatMinorUnits } = useMoneyFormat();
|
|
16
|
+
const { locale } = useI18n();
|
|
17
|
+
|
|
18
|
+
const lines = computed(() =>
|
|
19
|
+
parseInvoiceLines(props.modelValue ?? props.initialValue),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
function formatPeriod(line: InvoiceLine): string | null {
|
|
23
|
+
const start = formatDate(line.periodStart, locale.value, LINE_PERIOD_FORMAT);
|
|
24
|
+
if (!start) return null;
|
|
25
|
+
const end = formatDate(line.periodEnd, locale.value, LINE_PERIOD_FORMAT);
|
|
26
|
+
return end ? `${start} → ${end}` : start;
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div
|
|
32
|
+
v-if="lines.length"
|
|
33
|
+
class="border-default divide-default divide-y rounded-lg border"
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
v-for="(line, index) in lines"
|
|
37
|
+
:key="index"
|
|
38
|
+
class="flex flex-wrap items-baseline gap-2 p-3 text-sm"
|
|
39
|
+
>
|
|
40
|
+
<div class="min-w-40 grow">
|
|
41
|
+
<p>{{ line.description || "—" }}</p>
|
|
42
|
+
<p v-if="formatPeriod(line)" class="text-muted text-xs">
|
|
43
|
+
{{ formatPeriod(line) }}
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
<span v-if="line.quantity && line.quantity > 1" class="text-muted text-xs">
|
|
47
|
+
× {{ line.quantity }}
|
|
48
|
+
</span>
|
|
49
|
+
<span class="tabular-nums">
|
|
50
|
+
{{ formatMinorUnits(line.amount, line.currency ?? null) }}
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<p v-else class="text-muted text-sm">
|
|
55
|
+
{{ $t("saas.invoices.lines.empty") }}
|
|
56
|
+
</p>
|
|
57
|
+
</template>
|