@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,329 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
3
|
+
|
|
4
|
+
const { $authFetch } = useAuthFetch();
|
|
5
|
+
|
|
6
|
+
interface FeatureCatalogItem {
|
|
7
|
+
_id: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
valueType: "boolean" | "number";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface PlanCatalogItem {
|
|
13
|
+
_id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
permissions: string[];
|
|
16
|
+
features: { featureId: string; value: unknown }[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Catalog {
|
|
20
|
+
plans: PlanCatalogItem[];
|
|
21
|
+
features: FeatureCatalogItem[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface InheritanceValue {
|
|
25
|
+
parentPlanId: string | null;
|
|
26
|
+
extraPermissions: string[];
|
|
27
|
+
extraFeatures: Record<string, boolean | number>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const props = defineProps<{
|
|
31
|
+
modelValue?: InheritanceValue | string | null;
|
|
32
|
+
initialValue?: InheritanceValue | string | null;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
catalogUrl?: string;
|
|
35
|
+
permissionsTreeUrl?: string;
|
|
36
|
+
componentId?: string;
|
|
37
|
+
pageId?: string;
|
|
38
|
+
routeParams?: Record<string, string>;
|
|
39
|
+
}>();
|
|
40
|
+
|
|
41
|
+
const emit = defineEmits<{ "update:modelValue": [value: string] }>();
|
|
42
|
+
|
|
43
|
+
const CATALOG_URL = computed(() => props.catalogUrl ?? "/api/saas/plans/catalog");
|
|
44
|
+
const PERMISSIONS_URL = computed(
|
|
45
|
+
() => props.permissionsTreeUrl ?? "/api/saas/plans/permissions-tree",
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
function parseValue(
|
|
49
|
+
raw: InheritanceValue | string | null | undefined,
|
|
50
|
+
): InheritanceValue {
|
|
51
|
+
let v: Partial<InheritanceValue> | null = null;
|
|
52
|
+
if (typeof raw === "string") {
|
|
53
|
+
try {
|
|
54
|
+
v = raw ? JSON.parse(raw) : null;
|
|
55
|
+
} catch {
|
|
56
|
+
v = null;
|
|
57
|
+
}
|
|
58
|
+
} else if (raw && typeof raw === "object") {
|
|
59
|
+
v = raw;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
parentPlanId: v?.parentPlanId ?? null,
|
|
63
|
+
extraPermissions: v?.extraPermissions ? [...v.extraPermissions] : [],
|
|
64
|
+
extraFeatures: { ...(v?.extraFeatures ?? {}) },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const state = ref<InheritanceValue>(
|
|
69
|
+
parseValue(props.modelValue ?? props.initialValue),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const catalog = ref<Catalog>({ plans: [], features: [] });
|
|
73
|
+
const isLoading = ref(true);
|
|
74
|
+
const initialSnapshotDone = ref(false);
|
|
75
|
+
|
|
76
|
+
const isInheriting = ref(state.value.parentPlanId !== null);
|
|
77
|
+
|
|
78
|
+
const currentPlanId = computed(() => props.routeParams?.id);
|
|
79
|
+
|
|
80
|
+
const planOptions = computed(() =>
|
|
81
|
+
catalog.value.plans
|
|
82
|
+
.filter((p) => p._id !== currentPlanId.value)
|
|
83
|
+
.map((p) => ({ value: p._id, label: p.name })),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const parentPlan = computed(() =>
|
|
87
|
+
catalog.value.plans.find((p) => p._id === state.value.parentPlanId),
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const inheritedFeatureKeys = computed(
|
|
91
|
+
() => new Set((parentPlan.value?.features ?? []).map((f) => f.featureId)),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
function emitState(): void {
|
|
95
|
+
emit("update:modelValue", JSON.stringify(state.value));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function onPermissionsUpdate(ids: string[]): void {
|
|
99
|
+
state.value.extraPermissions = ids;
|
|
100
|
+
emitState();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function setFeatureValue(
|
|
104
|
+
feature: FeatureCatalogItem,
|
|
105
|
+
value: boolean | number,
|
|
106
|
+
): void {
|
|
107
|
+
state.value.extraFeatures = {
|
|
108
|
+
...state.value.extraFeatures,
|
|
109
|
+
[feature._id]: value,
|
|
110
|
+
};
|
|
111
|
+
emitState();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function featureModel(feature: FeatureCatalogItem): boolean | number {
|
|
115
|
+
const v = state.value.extraFeatures[feature._id];
|
|
116
|
+
if (v !== undefined) return v;
|
|
117
|
+
// Default to -1 for number features = "disabled". Admin must opt in by
|
|
118
|
+
// setting a non-negative value to activate the quota.
|
|
119
|
+
return feature.valueType === "boolean" ? false : -1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function isNumberFeatureEnabled(feature: FeatureCatalogItem): boolean {
|
|
123
|
+
const v = featureModel(feature);
|
|
124
|
+
return typeof v === "number" && v >= 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function setNumberFeatureEnabled(
|
|
128
|
+
feature: FeatureCatalogItem,
|
|
129
|
+
enabled: boolean,
|
|
130
|
+
): void {
|
|
131
|
+
setFeatureValue(feature, enabled ? 0 : -1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function toggleInherit(value: boolean | "indeterminate"): void {
|
|
135
|
+
const checked = value === true;
|
|
136
|
+
isInheriting.value = checked;
|
|
137
|
+
if (!checked) {
|
|
138
|
+
state.value.parentPlanId = null;
|
|
139
|
+
emitState();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function selectParent(planId: string | null): void {
|
|
144
|
+
state.value.parentPlanId = planId;
|
|
145
|
+
const parent = catalog.value.plans.find((p) => p._id === planId);
|
|
146
|
+
if (parent) {
|
|
147
|
+
// Permissions: union (parent always wins for additions; manual extras on
|
|
148
|
+
// the child are kept).
|
|
149
|
+
const perms = new Set([
|
|
150
|
+
...state.value.extraPermissions,
|
|
151
|
+
...parent.permissions,
|
|
152
|
+
]);
|
|
153
|
+
state.value.extraPermissions = [...perms];
|
|
154
|
+
// Features: live inheritance — overwrite with the parent's current value
|
|
155
|
+
// for any feature the parent configures. Features the parent does not
|
|
156
|
+
// configure are left untouched (purely local additions on the child).
|
|
157
|
+
const features = { ...state.value.extraFeatures };
|
|
158
|
+
for (const f of parent.features) {
|
|
159
|
+
features[f.featureId] = f.value as boolean | number;
|
|
160
|
+
}
|
|
161
|
+
state.value.extraFeatures = features;
|
|
162
|
+
}
|
|
163
|
+
emitState();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async function load(): Promise<void> {
|
|
167
|
+
isLoading.value = true;
|
|
168
|
+
try {
|
|
169
|
+
catalog.value = await $authFetch<Catalog>(CATALOG_URL.value);
|
|
170
|
+
} finally {
|
|
171
|
+
isLoading.value = false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function maybeInitialSnapshot(): void {
|
|
176
|
+
// Re-snapshot from the live parent the first time we have both the
|
|
177
|
+
// modelValue (parent id) AND the catalog loaded. Parent values win for any
|
|
178
|
+
// feature the parent configures (live inheritance).
|
|
179
|
+
if (
|
|
180
|
+
!initialSnapshotDone.value &&
|
|
181
|
+
!isLoading.value &&
|
|
182
|
+
state.value.parentPlanId
|
|
183
|
+
) {
|
|
184
|
+
initialSnapshotDone.value = true;
|
|
185
|
+
selectParent(state.value.parentPlanId);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
watch(
|
|
190
|
+
() => props.modelValue,
|
|
191
|
+
(next) => {
|
|
192
|
+
if (typeof next === "string" && next === JSON.stringify(state.value)) return;
|
|
193
|
+
state.value = parseValue(next ?? props.initialValue);
|
|
194
|
+
isInheriting.value = state.value.parentPlanId !== null;
|
|
195
|
+
maybeInitialSnapshot();
|
|
196
|
+
},
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
onMounted(async () => {
|
|
200
|
+
await load();
|
|
201
|
+
maybeInitialSnapshot();
|
|
202
|
+
if (!initialSnapshotDone.value) {
|
|
203
|
+
// Normalise the form state to a JSON string so validation passes even if
|
|
204
|
+
// the field is never touched.
|
|
205
|
+
emitState();
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
</script>
|
|
209
|
+
|
|
210
|
+
<template>
|
|
211
|
+
<div class="flex flex-col gap-4">
|
|
212
|
+
<div v-if="isLoading" class="flex items-center gap-2 text-muted">
|
|
213
|
+
<UIcon name="i-ph-spinner" class="animate-spin" />
|
|
214
|
+
<span>{{ $t("saas.plans.inheritance.loading") }}</span>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<template v-else>
|
|
218
|
+
<div class="flex flex-col gap-2">
|
|
219
|
+
<UCheckbox
|
|
220
|
+
:model-value="isInheriting"
|
|
221
|
+
:disabled="disabled"
|
|
222
|
+
:label="$t('saas.plans.inheritance.toggle')"
|
|
223
|
+
@update:model-value="toggleInherit"
|
|
224
|
+
/>
|
|
225
|
+
<USelect
|
|
226
|
+
v-if="isInheriting"
|
|
227
|
+
:model-value="state.parentPlanId ?? undefined"
|
|
228
|
+
:items="planOptions"
|
|
229
|
+
:disabled="disabled"
|
|
230
|
+
:placeholder="$t('saas.plans.inheritance.select_plan')"
|
|
231
|
+
@update:model-value="selectParent"
|
|
232
|
+
/>
|
|
233
|
+
<p
|
|
234
|
+
v-if="isInheriting && parentPlan"
|
|
235
|
+
class="text-xs text-muted"
|
|
236
|
+
>
|
|
237
|
+
{{ $t("saas.plans.inheritance.snapshot_hint") }}
|
|
238
|
+
</p>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div class="flex flex-col gap-2">
|
|
242
|
+
<div class="flex items-center gap-1.5">
|
|
243
|
+
<h4 class="text-sm font-semibold">
|
|
244
|
+
{{ $t("saas.plans.field.permissions") }}
|
|
245
|
+
</h4>
|
|
246
|
+
<UTooltip :text="$t('saas.plans.inheritance.permissions_tooltip')">
|
|
247
|
+
<UIcon name="i-ph-info" class="text-muted size-4" />
|
|
248
|
+
</UTooltip>
|
|
249
|
+
</div>
|
|
250
|
+
<DmsPermissionsTree
|
|
251
|
+
:model-value="state.extraPermissions"
|
|
252
|
+
:fetch-url="PERMISSIONS_URL"
|
|
253
|
+
:component-id="componentId ?? ''"
|
|
254
|
+
:page-id="pageId ?? ''"
|
|
255
|
+
@update:model-value="onPermissionsUpdate"
|
|
256
|
+
/>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<div class="flex flex-col gap-2">
|
|
260
|
+
<div class="flex items-center gap-1.5">
|
|
261
|
+
<h4 class="text-sm font-semibold">
|
|
262
|
+
{{ $t("saas.plans.field.features") }}
|
|
263
|
+
</h4>
|
|
264
|
+
<UTooltip :text="$t('saas.plans.inheritance.features_tooltip')">
|
|
265
|
+
<UIcon name="i-ph-info" class="text-muted size-4" />
|
|
266
|
+
</UTooltip>
|
|
267
|
+
</div>
|
|
268
|
+
<div
|
|
269
|
+
v-if="catalog.features.length === 0"
|
|
270
|
+
class="text-xs text-muted"
|
|
271
|
+
>
|
|
272
|
+
{{ $t("saas.plans.inheritance.no_features") }}
|
|
273
|
+
</div>
|
|
274
|
+
<div
|
|
275
|
+
v-else
|
|
276
|
+
class="flex flex-col gap-2 rounded-md border border-default p-3"
|
|
277
|
+
>
|
|
278
|
+
<div
|
|
279
|
+
v-for="feature in catalog.features"
|
|
280
|
+
:key="feature._id"
|
|
281
|
+
class="flex items-center justify-between gap-3"
|
|
282
|
+
>
|
|
283
|
+
<div class="flex items-center gap-2">
|
|
284
|
+
<span class="text-sm">{{ feature.displayName }}</span>
|
|
285
|
+
<UBadge
|
|
286
|
+
v-if="inheritedFeatureKeys.has(feature._id)"
|
|
287
|
+
size="xs"
|
|
288
|
+
variant="soft"
|
|
289
|
+
color="neutral"
|
|
290
|
+
>
|
|
291
|
+
{{ $t("saas.plans.inheritance.inherited") }}
|
|
292
|
+
</UBadge>
|
|
293
|
+
</div>
|
|
294
|
+
<USwitch
|
|
295
|
+
v-if="feature.valueType === 'boolean'"
|
|
296
|
+
:model-value="featureModel(feature) === true"
|
|
297
|
+
:disabled="disabled"
|
|
298
|
+
@update:model-value="(v: boolean) => setFeatureValue(feature, v)"
|
|
299
|
+
/>
|
|
300
|
+
<div
|
|
301
|
+
v-else-if="feature.valueType === 'number'"
|
|
302
|
+
class="flex items-center gap-2"
|
|
303
|
+
>
|
|
304
|
+
<USwitch
|
|
305
|
+
:model-value="isNumberFeatureEnabled(feature)"
|
|
306
|
+
:disabled="disabled"
|
|
307
|
+
@update:model-value="
|
|
308
|
+
(v: boolean) => setNumberFeatureEnabled(feature, v)
|
|
309
|
+
"
|
|
310
|
+
/>
|
|
311
|
+
<UInput
|
|
312
|
+
v-if="isNumberFeatureEnabled(feature)"
|
|
313
|
+
type="number"
|
|
314
|
+
min="0"
|
|
315
|
+
class="w-24"
|
|
316
|
+
:model-value="Number(featureModel(feature))"
|
|
317
|
+
:disabled="disabled"
|
|
318
|
+
@update:model-value="
|
|
319
|
+
(v: number) =>
|
|
320
|
+
setFeatureValue(feature, Math.max(0, Number(v) || 0))
|
|
321
|
+
"
|
|
322
|
+
/>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</template>
|
|
328
|
+
</div>
|
|
329
|
+
</template>
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
3
|
+
|
|
4
|
+
type TargetType = "user" | "workspace";
|
|
5
|
+
|
|
6
|
+
interface PlatformNote {
|
|
7
|
+
_id: string;
|
|
8
|
+
targetType: TargetType;
|
|
9
|
+
targetId: string;
|
|
10
|
+
authorId: string;
|
|
11
|
+
authorName: string | null;
|
|
12
|
+
authorEmail: string | null;
|
|
13
|
+
content: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface NotesPage {
|
|
19
|
+
items: PlatformNote[];
|
|
20
|
+
total: number;
|
|
21
|
+
page: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const MAX_CONTENT_LENGTH = 4000;
|
|
26
|
+
const PAGE_SIZE = 5;
|
|
27
|
+
|
|
28
|
+
const props = defineProps<{
|
|
29
|
+
targetType: TargetType;
|
|
30
|
+
routeParams?: Record<string, string>;
|
|
31
|
+
}>();
|
|
32
|
+
|
|
33
|
+
const { $authFetch } = useAuthFetch();
|
|
34
|
+
const { t } = useI18n();
|
|
35
|
+
const toast = useToast();
|
|
36
|
+
const { resolveServerMessage } = useApiErrorMessage();
|
|
37
|
+
|
|
38
|
+
const targetId = computed(() => props.routeParams?.id ?? "");
|
|
39
|
+
const baseUrl = computed(
|
|
40
|
+
() => `/api/saas/platform-notes/${props.targetType}/${targetId.value}`,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const notes = ref<PlatformNote[]>([]);
|
|
44
|
+
const total = ref(0);
|
|
45
|
+
const currentPage = ref(1);
|
|
46
|
+
const isLoading = ref(false);
|
|
47
|
+
const isSubmitting = ref(false);
|
|
48
|
+
const isDeleting = ref(false);
|
|
49
|
+
const draft = ref("");
|
|
50
|
+
const pendingDelete = ref<PlatformNote | null>(null);
|
|
51
|
+
const isDeleteOpen = computed({
|
|
52
|
+
get: () => pendingDelete.value !== null,
|
|
53
|
+
set: (value: boolean) => {
|
|
54
|
+
if (!value) pendingDelete.value = null;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const canSubmit = computed(
|
|
59
|
+
() =>
|
|
60
|
+
!isSubmitting.value &&
|
|
61
|
+
draft.value.trim().length > 0 &&
|
|
62
|
+
draft.value.trim().length <= MAX_CONTENT_LENGTH,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
function formatDateTime(value: string): string {
|
|
66
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
67
|
+
day: "2-digit",
|
|
68
|
+
month: "short",
|
|
69
|
+
year: "numeric",
|
|
70
|
+
hour: "2-digit",
|
|
71
|
+
minute: "2-digit",
|
|
72
|
+
}).format(new Date(value));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function authorDisplay(note: PlatformNote): string {
|
|
76
|
+
return note.authorName || note.authorEmail || note.authorId;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function fetchPage(page: number): Promise<NotesPage> {
|
|
80
|
+
const query = new URLSearchParams({
|
|
81
|
+
page: String(page),
|
|
82
|
+
pageSize: String(PAGE_SIZE),
|
|
83
|
+
});
|
|
84
|
+
return $authFetch<NotesPage>(`${baseUrl.value}?${query.toString()}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function load(page: number): Promise<void> {
|
|
88
|
+
if (!targetId.value) return;
|
|
89
|
+
isLoading.value = true;
|
|
90
|
+
try {
|
|
91
|
+
const result = await fetchPage(page);
|
|
92
|
+
notes.value = result.items;
|
|
93
|
+
total.value = result.total;
|
|
94
|
+
const totalPages = Math.max(1, Math.ceil(result.total / PAGE_SIZE));
|
|
95
|
+
if (page > totalPages) {
|
|
96
|
+
currentPage.value = totalPages;
|
|
97
|
+
const fallback = await fetchPage(totalPages);
|
|
98
|
+
notes.value = fallback.items;
|
|
99
|
+
total.value = fallback.total;
|
|
100
|
+
} else {
|
|
101
|
+
currentPage.value = page;
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
toast.add({
|
|
105
|
+
color: "error",
|
|
106
|
+
icon: "i-ph-warning",
|
|
107
|
+
title: t("saas.notes.error.load"),
|
|
108
|
+
description: resolveServerMessage(error),
|
|
109
|
+
});
|
|
110
|
+
} finally {
|
|
111
|
+
isLoading.value = false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function submit(): Promise<void> {
|
|
116
|
+
if (!canSubmit.value) return;
|
|
117
|
+
isSubmitting.value = true;
|
|
118
|
+
try {
|
|
119
|
+
await $authFetch<PlatformNote>(baseUrl.value, {
|
|
120
|
+
method: "POST",
|
|
121
|
+
body: { content: draft.value.trim() },
|
|
122
|
+
});
|
|
123
|
+
draft.value = "";
|
|
124
|
+
await load(1);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
toast.add({
|
|
127
|
+
color: "error",
|
|
128
|
+
icon: "i-ph-warning",
|
|
129
|
+
title: t("saas.notes.error.create"),
|
|
130
|
+
description: resolveServerMessage(error),
|
|
131
|
+
});
|
|
132
|
+
} finally {
|
|
133
|
+
isSubmitting.value = false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function requestDelete(note: PlatformNote): void {
|
|
138
|
+
pendingDelete.value = note;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async function confirmDelete(): Promise<void> {
|
|
142
|
+
const note = pendingDelete.value;
|
|
143
|
+
if (!note) return;
|
|
144
|
+
isDeleting.value = true;
|
|
145
|
+
try {
|
|
146
|
+
await $authFetch(`/api/saas/platform-notes/${note._id}`, {
|
|
147
|
+
method: "DELETE",
|
|
148
|
+
});
|
|
149
|
+
pendingDelete.value = null;
|
|
150
|
+
await load(currentPage.value);
|
|
151
|
+
} catch (error) {
|
|
152
|
+
toast.add({
|
|
153
|
+
color: "error",
|
|
154
|
+
icon: "i-ph-warning",
|
|
155
|
+
title: t("saas.notes.error.delete"),
|
|
156
|
+
description: resolveServerMessage(error),
|
|
157
|
+
});
|
|
158
|
+
} finally {
|
|
159
|
+
isDeleting.value = false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
watch(currentPage, (page) => {
|
|
164
|
+
load(page);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
onMounted(() => load(1));
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<template>
|
|
171
|
+
<DmsCard>
|
|
172
|
+
<div
|
|
173
|
+
class="-mx-5 sm:-mx-6 -mt-5 sm:-mt-6 mb-5 sm:mb-6 border-b border-default px-5 sm:px-6 py-4"
|
|
174
|
+
>
|
|
175
|
+
<div class="flex items-center gap-2">
|
|
176
|
+
<UIcon name="i-ph-note-pencil" />
|
|
177
|
+
<h3 class="font-semibold">{{ $t("saas.notes.title") }}</h3>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div class="flex flex-col gap-3">
|
|
182
|
+
<UTextarea
|
|
183
|
+
v-model="draft"
|
|
184
|
+
:placeholder="$t('saas.notes.placeholder')"
|
|
185
|
+
:rows="3"
|
|
186
|
+
:maxlength="MAX_CONTENT_LENGTH"
|
|
187
|
+
autoresize
|
|
188
|
+
/>
|
|
189
|
+
<div class="flex justify-end">
|
|
190
|
+
<UButton
|
|
191
|
+
size="sm"
|
|
192
|
+
color="primary"
|
|
193
|
+
icon="i-ph-plus"
|
|
194
|
+
:loading="isSubmitting"
|
|
195
|
+
:disabled="!canSubmit"
|
|
196
|
+
@click="submit"
|
|
197
|
+
>
|
|
198
|
+
{{ $t("saas.notes.add") }}
|
|
199
|
+
</UButton>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<USeparator />
|
|
203
|
+
|
|
204
|
+
<div v-if="isLoading" class="flex justify-center py-3">
|
|
205
|
+
<UIcon name="i-ph-spinner" class="animate-spin" />
|
|
206
|
+
</div>
|
|
207
|
+
<p
|
|
208
|
+
v-else-if="total === 0"
|
|
209
|
+
class="text-sm italic text-muted py-2 text-center"
|
|
210
|
+
>
|
|
211
|
+
{{ $t("saas.notes.empty") }}
|
|
212
|
+
</p>
|
|
213
|
+
<template v-else>
|
|
214
|
+
<ul class="flex flex-col gap-3">
|
|
215
|
+
<li
|
|
216
|
+
v-for="note in notes"
|
|
217
|
+
:key="note._id"
|
|
218
|
+
class="rounded-md bg-elevated/40 p-3 flex flex-col gap-2"
|
|
219
|
+
>
|
|
220
|
+
<div class="flex items-start justify-between gap-2">
|
|
221
|
+
<div class="text-xs text-muted">
|
|
222
|
+
<span class="font-medium text-default">{{
|
|
223
|
+
authorDisplay(note)
|
|
224
|
+
}}</span>
|
|
225
|
+
· {{ formatDateTime(note.createdAt) }}
|
|
226
|
+
</div>
|
|
227
|
+
<UButton
|
|
228
|
+
icon="i-ph-trash"
|
|
229
|
+
color="neutral"
|
|
230
|
+
variant="ghost"
|
|
231
|
+
size="xs"
|
|
232
|
+
:aria-label="$t('saas.notes.delete')"
|
|
233
|
+
@click="requestDelete(note)"
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
<p class="text-sm whitespace-pre-wrap break-words">
|
|
237
|
+
{{ note.content }}
|
|
238
|
+
</p>
|
|
239
|
+
</li>
|
|
240
|
+
</ul>
|
|
241
|
+
<div v-if="total > PAGE_SIZE" class="flex justify-center pt-2">
|
|
242
|
+
<UPagination
|
|
243
|
+
v-model:page="currentPage"
|
|
244
|
+
:total="total"
|
|
245
|
+
:items-per-page="PAGE_SIZE"
|
|
246
|
+
:sibling-count="1"
|
|
247
|
+
size="sm"
|
|
248
|
+
/>
|
|
249
|
+
</div>
|
|
250
|
+
</template>
|
|
251
|
+
</div>
|
|
252
|
+
</DmsCard>
|
|
253
|
+
|
|
254
|
+
<UModal v-model:open="isDeleteOpen" :title="$t('saas.notes.delete_confirm.title')">
|
|
255
|
+
<template #body>
|
|
256
|
+
<p class="text-sm">
|
|
257
|
+
{{ $t("saas.notes.delete_confirm.description") }}
|
|
258
|
+
</p>
|
|
259
|
+
<blockquote
|
|
260
|
+
v-if="pendingDelete"
|
|
261
|
+
class="mt-3 rounded-md bg-elevated/40 p-3 text-sm whitespace-pre-wrap break-words border-l-2 border-default"
|
|
262
|
+
>
|
|
263
|
+
{{ pendingDelete.content }}
|
|
264
|
+
</blockquote>
|
|
265
|
+
</template>
|
|
266
|
+
<template #footer>
|
|
267
|
+
<div class="flex justify-end gap-2">
|
|
268
|
+
<UButton
|
|
269
|
+
variant="ghost"
|
|
270
|
+
:disabled="isDeleting"
|
|
271
|
+
@click="isDeleteOpen = false"
|
|
272
|
+
>
|
|
273
|
+
{{ $t("common.cancel") }}
|
|
274
|
+
</UButton>
|
|
275
|
+
<UButton color="error" :loading="isDeleting" @click="confirmDelete">
|
|
276
|
+
{{ $t("saas.notes.delete_confirm.confirm") }}
|
|
277
|
+
</UButton>
|
|
278
|
+
</div>
|
|
279
|
+
</template>
|
|
280
|
+
</UModal>
|
|
281
|
+
</template>
|