@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,39 @@
|
|
|
1
|
+
const BILLING_STATUS_ENDPOINT = "/api/saas/billing/status";
|
|
2
|
+
const BILLING_STATUS_STATE_KEY = "saas-billing-status";
|
|
3
|
+
|
|
4
|
+
export interface PaymentMethodSummary {
|
|
5
|
+
brand: string;
|
|
6
|
+
last4: string;
|
|
7
|
+
expMonth: number;
|
|
8
|
+
expYear: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface UnpaidInvoiceRef {
|
|
12
|
+
number: string | null;
|
|
13
|
+
amount: number;
|
|
14
|
+
currency: string;
|
|
15
|
+
hostedInvoiceUrl: string | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface UnpaidInvoiceSummary extends UnpaidInvoiceRef {
|
|
19
|
+
failedAt: string | null;
|
|
20
|
+
nextRetryAt: string | null;
|
|
21
|
+
suspendAt: string | null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BillingStatusResponse {
|
|
25
|
+
hasStripeCustomer: boolean;
|
|
26
|
+
status: string | null;
|
|
27
|
+
isTenantOwner: boolean;
|
|
28
|
+
paymentMethod: PaymentMethodSummary | null;
|
|
29
|
+
unpaidInvoice: UnpaidInvoiceSummary | null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Read by the past-due alert, the payment method card and the portal button;
|
|
33
|
+
* each call reaches Stripe, so the three of them share one request. */
|
|
34
|
+
export function useBillingStatus(): SharedRequest<BillingStatusResponse> {
|
|
35
|
+
const { $authFetch } = useAuthFetch();
|
|
36
|
+
return useSharedRequest(BILLING_STATUS_STATE_KEY, () =>
|
|
37
|
+
$authFetch<BillingStatusResponse>(BILLING_STATUS_ENDPOINT),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface CurrentWorkspace {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
retentionDays: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const CURRENT_ENDPOINT = "/api/saas/workspaces/current";
|
|
8
|
+
const STATE_KEY = "saas-current-workspace";
|
|
9
|
+
|
|
10
|
+
interface CurrentWorkspaceHandle {
|
|
11
|
+
workspace: Ref<CurrentWorkspace | null>;
|
|
12
|
+
load: () => Promise<void>;
|
|
13
|
+
rename: (name: string) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Shared so the general-settings blocks read the workspace once and a rename
|
|
18
|
+
* done in one of them is immediately visible to the other and to the switcher.
|
|
19
|
+
*/
|
|
20
|
+
export function useCurrentWorkspace(): CurrentWorkspaceHandle {
|
|
21
|
+
const { $authFetch } = useAuthFetch();
|
|
22
|
+
const workspace = useDmsState<CurrentWorkspace | null>(STATE_KEY, () => null);
|
|
23
|
+
const { refresh: refreshMyWorkspaces } = useMyWorkspaces();
|
|
24
|
+
|
|
25
|
+
async function load(): Promise<void> {
|
|
26
|
+
workspace.value = await $authFetch<CurrentWorkspace>(CURRENT_ENDPOINT);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function rename(name: string): Promise<void> {
|
|
30
|
+
const updated = await $authFetch<CurrentWorkspace>(CURRENT_ENDPOINT, {
|
|
31
|
+
method: "PUT",
|
|
32
|
+
body: { name },
|
|
33
|
+
});
|
|
34
|
+
workspace.value = workspace.value
|
|
35
|
+
? { ...workspace.value, name: updated.name }
|
|
36
|
+
: null;
|
|
37
|
+
// The rename is committed at this point: a failing sidebar refresh must
|
|
38
|
+
// not make the caller report it as failed.
|
|
39
|
+
await refreshMyWorkspaces().catch(() => undefined);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return { workspace, load, rename };
|
|
43
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DetailRefresh {
|
|
2
|
+
trigger: () => void;
|
|
3
|
+
triggerRef: Ref<number>;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function useDetailRefresh(scopeKey: string): DetailRefresh {
|
|
7
|
+
// useDmsState scopes the counter to the current app instance (SSR-safe) instead
|
|
8
|
+
// of a module-level Map, which on the server would leak across requests and
|
|
9
|
+
// could replay a trigger from one request in another for the same scopeKey.
|
|
10
|
+
const counter = useDmsState<number>(`detail-refresh:${scopeKey}`, () => 0);
|
|
11
|
+
return {
|
|
12
|
+
trigger: () => {
|
|
13
|
+
counter.value++;
|
|
14
|
+
},
|
|
15
|
+
triggerRef: counter,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
|
|
3
|
+
const HISTORY_ENDPOINT = "/api/saas/data-export/history";
|
|
4
|
+
const HISTORY_PAGE_SIZE = 10;
|
|
5
|
+
const FIRST_PAGE = 1;
|
|
6
|
+
const DOWNLOAD_ENDPOINT = "/api/saas/data-export/download";
|
|
7
|
+
const FILENAME_HEADER_PATTERN = /filename="([^"]+)"/i;
|
|
8
|
+
const FALLBACK_EXTENSION = "zip";
|
|
9
|
+
|
|
10
|
+
export interface ExportJobFailure {
|
|
11
|
+
source: string;
|
|
12
|
+
error: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ExportJobResult {
|
|
16
|
+
partial: boolean;
|
|
17
|
+
failures: ExportJobFailure[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ExportHistoryEntry {
|
|
21
|
+
jobId: string;
|
|
22
|
+
scope: string;
|
|
23
|
+
status: string;
|
|
24
|
+
progress: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
filename?: string;
|
|
27
|
+
extension?: string;
|
|
28
|
+
result?: ExportJobResult;
|
|
29
|
+
/** Moment the stale export sweep drops the archive and its download link. */
|
|
30
|
+
expiresAt?: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function parseFilename(header: string | null): string | null {
|
|
35
|
+
return header?.match(FILENAME_HEADER_PATTERN)?.[1] ?? null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ExportHistoryPage {
|
|
39
|
+
items: ExportHistoryEntry[];
|
|
40
|
+
hasMore: boolean;
|
|
41
|
+
page: number;
|
|
42
|
+
pageSize: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ExportDownloadNaming {
|
|
46
|
+
filename?: string;
|
|
47
|
+
extension?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function fallbackFilename(jobId: string, naming?: ExportDownloadNaming): string {
|
|
51
|
+
const extension = naming?.extension ?? FALLBACK_EXTENSION;
|
|
52
|
+
return `${naming?.filename ?? `export-${jobId}`}.${extension}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The caller's past exports for the current workspace, and the download of a
|
|
57
|
+
* single one of them — the action both the history rows and the e-mailed link
|
|
58
|
+
* land on.
|
|
59
|
+
*/
|
|
60
|
+
export function useExportHistory() {
|
|
61
|
+
const { $authFetch } = useAuthFetch();
|
|
62
|
+
|
|
63
|
+
const entries = ref<ExportHistoryEntry[]>([]);
|
|
64
|
+
const isLoading = ref(false);
|
|
65
|
+
const hasFailed = ref(false);
|
|
66
|
+
const page = ref(FIRST_PAGE);
|
|
67
|
+
const hasMore = ref(false);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Defaults back to the first page: every caller that reloads does so because
|
|
71
|
+
* the list changed at its most recent end, which is where page one is.
|
|
72
|
+
*
|
|
73
|
+
* A page past the first that comes back empty falls back to the first rather
|
|
74
|
+
* than showing the "no export yet" state, which would be a lie — exports
|
|
75
|
+
* expiring under the reader is enough to empty the page they were on.
|
|
76
|
+
*/
|
|
77
|
+
async function load(targetPage: number = FIRST_PAGE): Promise<void> {
|
|
78
|
+
isLoading.value = true;
|
|
79
|
+
try {
|
|
80
|
+
const result = await $authFetch<ExportHistoryPage>(HISTORY_ENDPOINT, {
|
|
81
|
+
query: { page: targetPage, pageSize: HISTORY_PAGE_SIZE },
|
|
82
|
+
});
|
|
83
|
+
if (!result.items.length && result.page > FIRST_PAGE) {
|
|
84
|
+
isLoading.value = false;
|
|
85
|
+
return load(FIRST_PAGE);
|
|
86
|
+
}
|
|
87
|
+
entries.value = result.items;
|
|
88
|
+
page.value = result.page;
|
|
89
|
+
hasMore.value = result.hasMore;
|
|
90
|
+
hasFailed.value = false;
|
|
91
|
+
} catch {
|
|
92
|
+
hasFailed.value = true;
|
|
93
|
+
} finally {
|
|
94
|
+
isLoading.value = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function goToPage(targetPage: number): Promise<void> {
|
|
99
|
+
if (targetPage < FIRST_PAGE || isLoading.value) return Promise.resolve();
|
|
100
|
+
return load(targetPage);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Takes a job id rather than a history row: a link delivered by e-mail may
|
|
105
|
+
* point at an export older than the window the history lists, and refusing
|
|
106
|
+
* to download it because it is not on screen would be a lie the server never
|
|
107
|
+
* told.
|
|
108
|
+
*/
|
|
109
|
+
async function download(
|
|
110
|
+
jobId: string,
|
|
111
|
+
naming?: ExportDownloadNaming,
|
|
112
|
+
): Promise<void> {
|
|
113
|
+
// Encoded because a delivered link hands its job id straight over: an id
|
|
114
|
+
// holding a separator would otherwise address a different route.
|
|
115
|
+
const response = await $authFetch.raw(
|
|
116
|
+
`${DOWNLOAD_ENDPOINT}/${encodeURIComponent(jobId)}`,
|
|
117
|
+
{ responseType: "blob" },
|
|
118
|
+
);
|
|
119
|
+
const blob = response._data as Blob | null;
|
|
120
|
+
if (!blob) throw new Error("Empty export download");
|
|
121
|
+
|
|
122
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
123
|
+
try {
|
|
124
|
+
const filename =
|
|
125
|
+
parseFilename(response.headers.get("content-disposition")) ??
|
|
126
|
+
fallbackFilename(jobId, naming);
|
|
127
|
+
downloadFile(objectUrl, filename);
|
|
128
|
+
} finally {
|
|
129
|
+
URL.revokeObjectURL(objectUrl);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
entries,
|
|
135
|
+
isLoading,
|
|
136
|
+
hasFailed,
|
|
137
|
+
page,
|
|
138
|
+
hasMore,
|
|
139
|
+
load,
|
|
140
|
+
goToPage,
|
|
141
|
+
download,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface InvoiceLine {
|
|
2
|
+
description: string;
|
|
3
|
+
quantity: number | null;
|
|
4
|
+
amount: number;
|
|
5
|
+
currency?: string | null;
|
|
6
|
+
periodStart: string | Date | null;
|
|
7
|
+
periodEnd: string | Date | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** The mirror stores lines as an array, but the table view hands the raw column
|
|
11
|
+
* value over, which may still be its JSON form. */
|
|
12
|
+
export function parseInvoiceLines(raw: unknown): InvoiceLine[] {
|
|
13
|
+
if (!raw) return [];
|
|
14
|
+
if (Array.isArray(raw)) return raw as InvoiceLine[];
|
|
15
|
+
if (typeof raw !== "string") return [];
|
|
16
|
+
try {
|
|
17
|
+
const parsed = JSON.parse(raw);
|
|
18
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
19
|
+
} catch {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const MINOR_UNITS_PER_UNIT = 100;
|
|
2
|
+
|
|
3
|
+
const FALLBACK_CURRENCY = "EUR";
|
|
4
|
+
|
|
5
|
+
export interface MajorUnitsFormatOptions {
|
|
6
|
+
/** Render a whole amount without decimals, e.g. `€20` instead of `€20.00`. */
|
|
7
|
+
hideWholeAmountDecimals?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function formatMajorUnits(
|
|
11
|
+
amount: number | null | undefined,
|
|
12
|
+
currency: string | null | undefined,
|
|
13
|
+
locale: string,
|
|
14
|
+
options: MajorUnitsFormatOptions = {},
|
|
15
|
+
): string {
|
|
16
|
+
if (typeof amount !== "number") return "—";
|
|
17
|
+
const hasDecimalsToHide =
|
|
18
|
+
options.hideWholeAmountDecimals === true && Number.isInteger(amount);
|
|
19
|
+
return new Intl.NumberFormat(locale, {
|
|
20
|
+
style: "currency",
|
|
21
|
+
currency: (currency || FALLBACK_CURRENCY).toUpperCase(),
|
|
22
|
+
minimumFractionDigits: hasDecimalsToHide ? 0 : undefined,
|
|
23
|
+
}).format(amount);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Amounts mirrored from a payment provider are stored in minor units. */
|
|
27
|
+
export function formatMinorUnits(
|
|
28
|
+
amount: number | null | undefined,
|
|
29
|
+
currency: string | null | undefined,
|
|
30
|
+
locale: string,
|
|
31
|
+
): string {
|
|
32
|
+
if (typeof amount !== "number") return "—";
|
|
33
|
+
return formatMajorUnits(amount / MINOR_UNITS_PER_UNIT, currency, locale);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Locale-bound view of the formatters above, for use inside components. */
|
|
37
|
+
export function useMoneyFormat() {
|
|
38
|
+
const { locale } = useI18n();
|
|
39
|
+
return {
|
|
40
|
+
formatMinorUnits: (
|
|
41
|
+
amount: number | null | undefined,
|
|
42
|
+
currency: string | null | undefined,
|
|
43
|
+
) => formatMinorUnits(amount, currency, locale.value),
|
|
44
|
+
formatMajorUnits: (
|
|
45
|
+
amount: number | null | undefined,
|
|
46
|
+
currency: string | null | undefined,
|
|
47
|
+
) => formatMajorUnits(amount, currency, locale.value),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface MyWorkspace {
|
|
2
|
+
_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
planName: string | null;
|
|
5
|
+
isCurrent: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const WORKSPACES_ENDPOINT = "/api/saas/workspaces/mine";
|
|
9
|
+
const STATE_KEY = "saas-my-workspaces";
|
|
10
|
+
|
|
11
|
+
interface MyWorkspacesHandle {
|
|
12
|
+
workspaces: Ref<MyWorkspace[]>;
|
|
13
|
+
isLoaded: Ref<boolean>;
|
|
14
|
+
refresh: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Shared between the sidebar switcher and the screens that change what it
|
|
19
|
+
* displays (rename today), so a change never waits for a page reload.
|
|
20
|
+
*/
|
|
21
|
+
export function useMyWorkspaces(): MyWorkspacesHandle {
|
|
22
|
+
const { $authFetch } = useAuthFetch();
|
|
23
|
+
const { loggedIn } = useUserSession();
|
|
24
|
+
const workspaces = useDmsState<MyWorkspace[]>(STATE_KEY, () => []);
|
|
25
|
+
const isLoaded = useDmsState<boolean>(`${STATE_KEY}-loaded`, () => false);
|
|
26
|
+
|
|
27
|
+
async function refresh(): Promise<void> {
|
|
28
|
+
if (!loggedIn.value) {
|
|
29
|
+
workspaces.value = [];
|
|
30
|
+
isLoaded.value = true;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
workspaces.value = await $authFetch<MyWorkspace[]>(WORKSPACES_ENDPOINT);
|
|
36
|
+
isLoaded.value = true;
|
|
37
|
+
} catch (error) {
|
|
38
|
+
// The sidebar is no place for an error card: render nothing instead. Only
|
|
39
|
+
// the initial load may empty the list — a failed refresh keeps the entries
|
|
40
|
+
// already on screen rather than making the switcher disappear.
|
|
41
|
+
if (!isLoaded.value) workspaces.value = [];
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return { workspaces, isLoaded, refresh };
|
|
47
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const UNLIMITED_NUMERIC_VALUE = -1;
|
|
2
|
+
const EMPTY_LABEL = "—";
|
|
3
|
+
const INCLUDED_LABEL = "✓";
|
|
4
|
+
const EXCLUDED_LABEL = "–";
|
|
5
|
+
|
|
6
|
+
type FeatureValueFormatter = (
|
|
7
|
+
value: unknown,
|
|
8
|
+
unit: string | null,
|
|
9
|
+
unlimitedLabel: string,
|
|
10
|
+
) => string;
|
|
11
|
+
|
|
12
|
+
function formatBoolean(value: unknown): string {
|
|
13
|
+
return value ? INCLUDED_LABEL : EXCLUDED_LABEL;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function formatNumeric(
|
|
17
|
+
value: unknown,
|
|
18
|
+
unit: string | null,
|
|
19
|
+
unlimitedLabel: string,
|
|
20
|
+
): string {
|
|
21
|
+
const numeric = Number(value);
|
|
22
|
+
if (Number.isNaN(numeric)) return EMPTY_LABEL;
|
|
23
|
+
if (numeric === UNLIMITED_NUMERIC_VALUE) return unlimitedLabel;
|
|
24
|
+
return unit ? `${numeric} ${unit}` : String(numeric);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function formatText(value: unknown, unit: string | null): string {
|
|
28
|
+
const text = String(value).trim();
|
|
29
|
+
if (!text) return EMPTY_LABEL;
|
|
30
|
+
return unit ? `${text} ${unit}` : text;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const FORMATTERS: Record<string, FeatureValueFormatter> = {
|
|
34
|
+
boolean: (value) => formatBoolean(value),
|
|
35
|
+
number: (value, unit, unlimitedLabel) =>
|
|
36
|
+
formatNumeric(value, unit, unlimitedLabel),
|
|
37
|
+
string: (value, unit) => formatText(value, unit),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Renders a plan's feature value the way the comparison table shows it, with
|
|
42
|
+
* `-1` reading as unlimited — the same convention `maxMembers` already uses.
|
|
43
|
+
*/
|
|
44
|
+
export function usePlanFeatureFormat() {
|
|
45
|
+
const { t } = useI18n();
|
|
46
|
+
|
|
47
|
+
function formatFeatureValue(
|
|
48
|
+
feature: TenantPlanFeature,
|
|
49
|
+
value: unknown,
|
|
50
|
+
): string {
|
|
51
|
+
if (value === undefined || value === null || value === "") {
|
|
52
|
+
return EMPTY_LABEL;
|
|
53
|
+
}
|
|
54
|
+
const formatter = FORMATTERS[feature.valueType];
|
|
55
|
+
if (!formatter) return String(value);
|
|
56
|
+
return formatter(value, feature.unit, t("saas.workspace.plan.unlimited"));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return { formatFeatureValue };
|
|
60
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type PlanInterval = "month" | "year";
|
|
2
|
+
export type PlanIntervalTranslator = (key: string) => string;
|
|
3
|
+
export type PlanIntervalLabeler = (interval: PlanInterval) => string;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Translates a billing interval.
|
|
7
|
+
*
|
|
8
|
+
* @param interval Stored billing interval
|
|
9
|
+
* @param keyPrefix Translation namespace containing month and year
|
|
10
|
+
* @param translate Translation function
|
|
11
|
+
* @returns Translated interval
|
|
12
|
+
*/
|
|
13
|
+
export function formatPlanIntervalLabel(
|
|
14
|
+
interval: PlanInterval,
|
|
15
|
+
keyPrefix: string,
|
|
16
|
+
translate: PlanIntervalTranslator,
|
|
17
|
+
): string {
|
|
18
|
+
return translate(`${keyPrefix}.${interval}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Provides an interval formatter bound to the current locale.
|
|
23
|
+
*
|
|
24
|
+
* @param keyPrefix Translation namespace containing month and year
|
|
25
|
+
* @returns Formatter for a stored billing interval
|
|
26
|
+
*/
|
|
27
|
+
export function usePlanIntervalLabel(keyPrefix: string): PlanIntervalLabeler {
|
|
28
|
+
const { t } = useI18n();
|
|
29
|
+
return (interval) => formatPlanIntervalLabel(interval, keyPrefix, t);
|
|
30
|
+
}
|