@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 @@
|
|
|
1
|
+
{"version":3,"file":"provisioning.js","sourceRoot":"","sources":["../../src/workspaces/provisioning.ts"],"names":[],"mappings":";;;AAwIA,oDAQC;AAED,4EAgBC;AAMD,gDAmBC;AA+PD,gDAiBC;AA3cD,uEAAwD;AACxD,6FAAqE;AACrE,qDAA2D;AAC3D,iFAAkF;AAClF,iFAAyF;AACzF,0DAA8D;AAE9D,oDAA+D;AAM/D,8BAKe;AACf,sEAA0E;AAC1E,2EAK8C;AAC9C,sCAKmB;AACnB,oCAA0D;AAC1D,6DAI8B;AAC9B,iEAAwE;AAA/D,sIAAA,6BAA6B,OAAA;AAEtC,MAAM,gBAAgB,GAAG,GAAG,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mB,CAAC;QAClB,QAAQ;QACR,MAAM;QACN,OAAO;QACP,gBAAgB;QAChB,eAAe,EAAE,IAAI,CAAC,WAAW;QACjC,YAAY;QACZ,YAAY,EAAE,qBAAqB,CAAC,KAAK;KAC1C,CAAC,CACH,CAAC;IAQF,MAAM,IAAA,gDAA0B,EAAC;QAC/B,QAAQ;QACR,MAAM;QACN,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,MAAM,yBAAyB,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjE,MAAM,IAAA,0CAAuB,EAAC,QAAQ,CAAC,CAAC;IAExC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,UAAU,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertRegistrationExtras(extras: unknown): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertRegistrationExtras = assertRegistrationExtras;
|
|
4
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
5
|
+
const registration_1 = require("@antelopejs/interface-dms-saas/registration");
|
|
6
|
+
const HTTP_BAD_REQUEST = 400;
|
|
7
|
+
const MAX_SERIALISED_BYTES = registration_1.REGISTRATION_EXTRAS_LIMITS.maxSerialisedBytes;
|
|
8
|
+
const MAX_KEYS = registration_1.REGISTRATION_EXTRAS_LIMITS.maxKeys;
|
|
9
|
+
const MAX_DEPTH = registration_1.REGISTRATION_EXTRAS_LIMITS.maxDepth;
|
|
10
|
+
const FORBIDDEN_KEYS = ["__proto__", "constructor", "prototype"];
|
|
11
|
+
const INVALID_ERROR = "saas.errors.registration.extras_invalid";
|
|
12
|
+
const TOO_LARGE_ERROR = "saas.errors.registration.extras_too_large";
|
|
13
|
+
const TOO_COMPLEX_ERROR = "saas.errors.registration.extras_too_complex";
|
|
14
|
+
const EMPTY_SHAPE = { keys: 0, depth: 0, hasForbiddenKey: false };
|
|
15
|
+
function isPlainObject(value) {
|
|
16
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17
|
+
}
|
|
18
|
+
function mergeShapes(left, right) {
|
|
19
|
+
return {
|
|
20
|
+
keys: left.keys + right.keys,
|
|
21
|
+
depth: Math.max(left.depth, right.depth),
|
|
22
|
+
hasForbiddenKey: left.hasForbiddenKey || right.hasForbiddenKey,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function inspect(value, depth) {
|
|
26
|
+
if (Array.isArray(value)) {
|
|
27
|
+
return value
|
|
28
|
+
.map((entry) => inspect(entry, depth + 1))
|
|
29
|
+
.reduce(mergeShapes, { ...EMPTY_SHAPE, depth });
|
|
30
|
+
}
|
|
31
|
+
if (!isPlainObject(value))
|
|
32
|
+
return EMPTY_SHAPE;
|
|
33
|
+
return Object.entries(value)
|
|
34
|
+
.map(([key, nested]) => mergeShapes(inspect(nested, depth + 1), {
|
|
35
|
+
keys: 1,
|
|
36
|
+
depth,
|
|
37
|
+
hasForbiddenKey: FORBIDDEN_KEYS.includes(key),
|
|
38
|
+
}))
|
|
39
|
+
.reduce(mergeShapes, { ...EMPTY_SHAPE, depth });
|
|
40
|
+
}
|
|
41
|
+
function assertRegistrationExtras(extras) {
|
|
42
|
+
if (extras === undefined || extras === null)
|
|
43
|
+
return;
|
|
44
|
+
(0, interface_api_util_1.assert)(isPlainObject(extras), HTTP_BAD_REQUEST, INVALID_ERROR);
|
|
45
|
+
(0, interface_api_util_1.assert)(Buffer.byteLength(JSON.stringify(extras), "utf8") <= MAX_SERIALISED_BYTES, HTTP_BAD_REQUEST, TOO_LARGE_ERROR);
|
|
46
|
+
const shape = inspect(extras, 1);
|
|
47
|
+
(0, interface_api_util_1.assert)(!shape.hasForbiddenKey, HTTP_BAD_REQUEST, INVALID_ERROR);
|
|
48
|
+
(0, interface_api_util_1.assert)(shape.keys <= MAX_KEYS && shape.depth <= MAX_DEPTH, HTTP_BAD_REQUEST, TOO_COMPLEX_ERROR);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=registration-extras.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration-extras.js","sourceRoot":"","sources":["../../src/workspaces/registration-extras.ts"],"names":[],"mappings":";;AA0EA,4DAgBC;AA1FD,uEAAwD;AACxD,8EAAyF;AAEzF,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAU7B,MAAM,oBAAoB,GAAG,yCAA0B,CAAC,kBAAkB,CAAC;AAC3E,MAAM,QAAQ,GAAG,yCAA0B,CAAC,OAAO,CAAC;AACpD,MAAM,SAAS,GAAG,yCAA0B,CAAC,QAAQ,CAAC;AAGtD,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AAEjE,MAAM,aAAa,GAAG,yCAAyC,CAAC;AAChE,MAAM,eAAe,GAAG,2CAA2C,CAAC;AACpE,MAAM,iBAAiB,GAAG,6CAA6C,CAAC;AAQxE,MAAM,WAAW,GAAgB,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AAE/E,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,IAAiB,EAAE,KAAkB;IACxD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;QAC5B,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;QACxC,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe;KAC/D,CAAC;AACJ,CAAC;AAGD,SA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E,aAAa,CAAC,CAAC;IAChE,IAAA,2BAAM,EACJ,KAAK,CAAC,IAAI,IAAI,QAAQ,IAAI,KAAK,CAAC,KAAK,IAAI,SAAS,EAClD,gBAAgB,EAChB,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TenantSubscriptionStatus } from "../db";
|
|
2
|
+
export interface WorkspaceSuspensionEffectInput {
|
|
3
|
+
tenantId: string;
|
|
4
|
+
operationId: string;
|
|
5
|
+
requestedAt: Date;
|
|
6
|
+
attemptCount: number;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspaceSuspensionEffectResult {
|
|
9
|
+
status: TenantSubscriptionStatus;
|
|
10
|
+
effectiveAt: Date;
|
|
11
|
+
}
|
|
12
|
+
export declare function applyWorkspaceSuspension(input: WorkspaceSuspensionEffectInput): Promise<WorkspaceSuspensionEffectResult>;
|
|
13
|
+
export declare function applyWorkspaceReactivation(input: WorkspaceSuspensionEffectInput): Promise<WorkspaceSuspensionEffectResult>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyWorkspaceSuspension = applyWorkspaceSuspension;
|
|
4
|
+
exports.applyWorkspaceReactivation = applyWorkspaceReactivation;
|
|
5
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
6
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
7
|
+
const billing_state_1 = require("../billing-state");
|
|
8
|
+
const db_1 = require("../db");
|
|
9
|
+
const notifications_1 = require("../notifications");
|
|
10
|
+
const lifecycle_outbox_1 = require("../operator-actions/lifecycle-outbox");
|
|
11
|
+
const client_1 = require("../stripe/client");
|
|
12
|
+
const HTTP_NOT_FOUND = 404;
|
|
13
|
+
const HTTP_BAD_REQUEST = 400;
|
|
14
|
+
const HTTP_CONFLICT = 409;
|
|
15
|
+
const ACTIVE_STATUS = "active";
|
|
16
|
+
const SUSPENDED_STATUS = "suspended";
|
|
17
|
+
const CANCELLED_STATUS = "cancelled";
|
|
18
|
+
const PAUSE_BEHAVIOR = "void";
|
|
19
|
+
const SUSPEND_ICON = "i-ph-prohibit";
|
|
20
|
+
const REACTIVATE_ICON = "i-ph-play";
|
|
21
|
+
const NOTIF_SUSPEND_TITLE = "$saas.notifications.payload.workspace_suspended_admin.title";
|
|
22
|
+
const NOTIF_SUSPEND_DESC = "$saas.notifications.payload.workspace_suspended_admin.description";
|
|
23
|
+
const NOTIF_REACTIVATE_TITLE = "$saas.notifications.payload.workspace_reactivated.title";
|
|
24
|
+
const NOTIF_REACTIVATE_DESC = "$saas.notifications.payload.workspace_reactivated.description";
|
|
25
|
+
async function pauseStripeCollection(stripeSubscriptionId, operationId) {
|
|
26
|
+
await (0, client_1.getStripeClient)().subscriptions.update(stripeSubscriptionId, { pause_collection: { behavior: PAUSE_BEHAVIOR } }, { idempotencyKey: `operator-suspend:${operationId}` });
|
|
27
|
+
}
|
|
28
|
+
async function resumeStripeCollection(stripeSubscriptionId, operationId) {
|
|
29
|
+
await (0, client_1.getStripeClient)().subscriptions.update(stripeSubscriptionId, { pause_collection: null }, { idempotencyKey: `operator-unsuspend:${operationId}` });
|
|
30
|
+
}
|
|
31
|
+
async function ensureTenantSubscription(tenantId) {
|
|
32
|
+
const sub = await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, tenantId).findOne();
|
|
33
|
+
(0, interface_api_util_1.assert)(sub, HTTP_NOT_FOUND, "saas.errors.workspace.no_active_subscription");
|
|
34
|
+
return sub;
|
|
35
|
+
}
|
|
36
|
+
function assertCanSuspend(input, sub) {
|
|
37
|
+
if (sub.status === SUSPENDED_STATUS) {
|
|
38
|
+
(0, interface_api_util_1.assert)(input.attemptCount > 1, HTTP_CONFLICT, "saas.errors.workspace.already_suspended");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
(0, interface_api_util_1.assert)(sub.status !== CANCELLED_STATUS, HTTP_BAD_REQUEST, "saas.errors.workspace.is_cancelled");
|
|
42
|
+
}
|
|
43
|
+
async function closeWorkspaceAccess(input, sub) {
|
|
44
|
+
if (sub.status === SUSPENDED_STATUS) {
|
|
45
|
+
await (0, billing_state_1.recomputeTenantBillingState)(input.tenantId);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, input.tenantId).updateDuringTransition(sub._id, input.operationId, {
|
|
49
|
+
status: SUSPENDED_STATUS,
|
|
50
|
+
updatedAt: new Date(),
|
|
51
|
+
});
|
|
52
|
+
await (0, billing_state_1.recomputeTenantBillingState)(input.tenantId);
|
|
53
|
+
}
|
|
54
|
+
async function notifySuspended(tenantId, operationId) {
|
|
55
|
+
await (0, notifications_1.notifyTenantOwners)(tenantId, notifications_1.workspaceSuspendedSubject, {
|
|
56
|
+
eventId: `operator-suspended:${operationId}`,
|
|
57
|
+
icon: SUSPEND_ICON,
|
|
58
|
+
title: NOTIF_SUSPEND_TITLE,
|
|
59
|
+
description: NOTIF_SUSPEND_DESC,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async function notifyReactivated(tenantId, operationId) {
|
|
63
|
+
await (0, notifications_1.notifyTenantOwners)(tenantId, notifications_1.workspaceReactivatedSubject, {
|
|
64
|
+
eventId: `operator-reactivated:${operationId}`,
|
|
65
|
+
icon: REACTIVATE_ICON,
|
|
66
|
+
title: NOTIF_REACTIVATE_TITLE,
|
|
67
|
+
description: NOTIF_REACTIVATE_DESC,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async function applyWorkspaceSuspension(input) {
|
|
71
|
+
const sub = await ensureTenantSubscription(input.tenantId);
|
|
72
|
+
assertCanSuspend(input, sub);
|
|
73
|
+
await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, input.tenantId).beginTransition(sub, {
|
|
74
|
+
operationId: input.operationId,
|
|
75
|
+
kind: "suspend",
|
|
76
|
+
targetPlanId: null,
|
|
77
|
+
requestedAt: input.requestedAt,
|
|
78
|
+
});
|
|
79
|
+
await closeWorkspaceAccess(input, sub);
|
|
80
|
+
if (sub.stripeSubscriptionId) {
|
|
81
|
+
await pauseStripeCollection(sub.stripeSubscriptionId, input.operationId);
|
|
82
|
+
}
|
|
83
|
+
await (0, lifecycle_outbox_1.dispatchWorkspaceLifecycle)({
|
|
84
|
+
tenantId: input.tenantId,
|
|
85
|
+
operationId: input.operationId,
|
|
86
|
+
transition: "suspended",
|
|
87
|
+
requestedAt: input.requestedAt,
|
|
88
|
+
});
|
|
89
|
+
await notifySuspended(input.tenantId, input.operationId);
|
|
90
|
+
return { status: SUSPENDED_STATUS, effectiveAt: new Date() };
|
|
91
|
+
}
|
|
92
|
+
async function openWorkspaceAccess(tenantId, sub, mustUpdateSubscription, operationId) {
|
|
93
|
+
if (mustUpdateSubscription) {
|
|
94
|
+
await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, tenantId).updateDuringTransition(sub._id, operationId, {
|
|
95
|
+
status: ACTIVE_STATUS,
|
|
96
|
+
updatedAt: new Date(),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
await (0, billing_state_1.recomputeTenantBillingState)(tenantId);
|
|
100
|
+
}
|
|
101
|
+
async function applyWorkspaceReactivation(input) {
|
|
102
|
+
const sub = await ensureTenantSubscription(input.tenantId);
|
|
103
|
+
const alreadyApplied = sub.status === ACTIVE_STATUS && input.attemptCount > 1;
|
|
104
|
+
(0, interface_api_util_1.assert)(sub.status === SUSPENDED_STATUS || alreadyApplied, HTTP_CONFLICT, "saas.errors.workspace.not_suspended");
|
|
105
|
+
await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, input.tenantId).beginTransition(sub, {
|
|
106
|
+
operationId: input.operationId,
|
|
107
|
+
kind: "reactivate",
|
|
108
|
+
targetPlanId: null,
|
|
109
|
+
requestedAt: input.requestedAt,
|
|
110
|
+
});
|
|
111
|
+
await (0, lifecycle_outbox_1.dispatchWorkspaceLifecycle)({
|
|
112
|
+
tenantId: input.tenantId,
|
|
113
|
+
operationId: input.operationId,
|
|
114
|
+
transition: "reactivation_requested",
|
|
115
|
+
requestedAt: input.requestedAt,
|
|
116
|
+
});
|
|
117
|
+
if (sub.stripeSubscriptionId) {
|
|
118
|
+
await resumeStripeCollection(sub.stripeSubscriptionId, input.operationId);
|
|
119
|
+
}
|
|
120
|
+
await openWorkspaceAccess(input.tenantId, sub, !alreadyApplied, input.operationId);
|
|
121
|
+
await notifyReactivated(input.tenantId, input.operationId);
|
|
122
|
+
return { status: ACTIVE_STATUS, effectiveAt: new Date() };
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=suspension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suspension.js","sourceRoot":"","sources":["../../src/workspaces/suspension.ts"],"names":[],"mappings":";;AA4IA,4DAuBC;AAqBD,gEAiCC;AAzND,uEAAwD;AACxD,6FAAqE;AACrE,oDAA+D;AAC/D,8BAIe;AACf,oDAI0B;AAC1B,2EAAkF;AAClF,6CAAmD;AAEnD,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,aAAa,GAA6B,QAAQ,CAAC;AACzD,MAAM,gBAAgB,GAA6B,WAAW,CAAC;AAC/D,MAAM,gBAAgB,GAA6B,WAAW,CAAC;AAE/D,MAAM,cAAc,GAAG,MAAe,CAAC;AACvC,MAAM,YAAY,GAAG,eAAe,CAAC;AACrC,MAAM,eAAe,GAAG,WAAW,CAAC;AAEpC,MAAM,mBAAmB,GACvB,6DAA6D,CAAC;AAChE,MAAM,kBAAkB,GACtB,mEAAmE,CAAC;AACtE,MAAM,sBAAsB,GAC1B,yDAAyD,CAAC;AAC5D,MAAM,qBAAqB,GACzB,+DAA+D,CAAC;AAclE,KA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,MAAM,KAAK,gBAAgB,IAAI,cAAc,EACjD,aAAa,EACb,qCAAqC,CACtC,CAAC;IACF,MAAM,IAAA,wCAAQ,EAAC,4BAAuB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,GAAG,EAAE;QAC3E,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC,CAAC;IACH,MAAM,IAAA,6CAA0B,EAAC;QAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,UAAU,EAAE,wBAAwB;QACpC,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,oBAAoB,EAAE,CAAC;QAC7B,MAAM,sBAAsB,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,mBAAmB,CACvB,KAAK,CAAC,QAAQ,EACd,GAAG,EACH,CAAC,cAAc,EACf,KAAK,CAAC,WAAW,CAClB,CAAC;IACF,MAAM,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC3D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;AAC5D,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts" generic="T extends { _id: string }">
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_PAGE_SIZE = 24;
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
items: T[];
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
draggable?: boolean;
|
|
10
|
+
}>();
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits<{
|
|
13
|
+
reorder: [items: T[]];
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const visibleCount = ref(props.pageSize ?? DEFAULT_PAGE_SIZE);
|
|
17
|
+
const draggedIndex = ref<number | null>(null);
|
|
18
|
+
|
|
19
|
+
const visibleItems = computed<T[]>(() =>
|
|
20
|
+
props.items.slice(0, visibleCount.value),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
function loadMore(): void {
|
|
24
|
+
visibleCount.value += props.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onDragStart(index: number): void {
|
|
28
|
+
draggedIndex.value = index;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function onDrop(targetIndex: number): void {
|
|
32
|
+
if (draggedIndex.value === null || draggedIndex.value === targetIndex) {
|
|
33
|
+
draggedIndex.value = null;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const reordered = [...props.items];
|
|
37
|
+
const [moved] = reordered.splice(draggedIndex.value, 1);
|
|
38
|
+
if (moved === undefined) {
|
|
39
|
+
draggedIndex.value = null;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
reordered.splice(targetIndex, 0, moved);
|
|
43
|
+
draggedIndex.value = null;
|
|
44
|
+
emit("reorder", reordered);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function onDragOver(event: DragEvent): void {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<div class="flex flex-col gap-4">
|
|
54
|
+
<div class="grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4">
|
|
55
|
+
<div
|
|
56
|
+
v-for="(item, index) in visibleItems"
|
|
57
|
+
:key="item._id"
|
|
58
|
+
:draggable="draggable"
|
|
59
|
+
class="cursor-grab"
|
|
60
|
+
:class="{ 'opacity-50': draggedIndex === index }"
|
|
61
|
+
@dragstart="onDragStart(index)"
|
|
62
|
+
@dragover="onDragOver"
|
|
63
|
+
@drop="onDrop(index)"
|
|
64
|
+
>
|
|
65
|
+
<slot name="card" :item="item" />
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div
|
|
69
|
+
v-if="visibleItems.length < items.length"
|
|
70
|
+
class="flex justify-center"
|
|
71
|
+
>
|
|
72
|
+
<UButton variant="soft" @click="loadMore">
|
|
73
|
+
{{ $t("common.load_more") }}
|
|
74
|
+
</UButton>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const PORTAL_ENDPOINT = "/api/saas/billing/portal-session";
|
|
5
|
+
|
|
6
|
+
const { $authFetch } = useAuthFetch();
|
|
7
|
+
const { data, load } = useBillingStatus();
|
|
8
|
+
const isLoading = ref(false);
|
|
9
|
+
|
|
10
|
+
const isAvailable = computed(
|
|
11
|
+
() => !!data.value?.hasStripeCustomer && !!data.value?.isTenantOwner,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
async function openCustomerPortal(): Promise<void> {
|
|
15
|
+
isLoading.value = true;
|
|
16
|
+
try {
|
|
17
|
+
const result = await $authFetch<{ url: string }>(PORTAL_ENDPOINT, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
body: {
|
|
20
|
+
returnUrl: typeof window !== "undefined" ? window.location.href : "/",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
if (typeof window !== "undefined") {
|
|
24
|
+
window.location.href = result.url;
|
|
25
|
+
}
|
|
26
|
+
} finally {
|
|
27
|
+
isLoading.value = false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
onMounted(load);
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<UButton
|
|
36
|
+
v-if="isAvailable"
|
|
37
|
+
color="neutral"
|
|
38
|
+
variant="subtle"
|
|
39
|
+
icon="i-ph-arrow-square-out"
|
|
40
|
+
:loading="isLoading"
|
|
41
|
+
@click="openCustomerPortal"
|
|
42
|
+
>
|
|
43
|
+
{{ $t("saas.workspace.billing.manage") }}
|
|
44
|
+
</UButton>
|
|
45
|
+
</template>
|