@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":"subjects.js","sourceRoot":"","sources":["../../src/notifications/subjects.ts"],"names":[],"mappings":";;;AAAA,2EAGiD;AAIpC,QAAA,YAAY,GAAG,IAAA,oCAAoB,EAAC,MAAM,EAAE;IACvD,QAAQ,EAAE,mCAAmC;IAC7C,cAAc,EAAE,yCAAyC;IACzD,IAAI,EAAE,gBAAgB;IACtB,gBAAgB,EAAE,SAAS;CAC5B,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG;IACnB,YAAY,EAAE,2CAA2C;IACzD,eAAe,EAAE,+CAA+C;IAChE,iBAAiB,EAAE,iDAAiD;IACpE,aAAa,EAAE,4CAA4C;I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F,CAAC;AACW,QAAA,2BAA2B,GAAG,IAAA,mCAAmB,EAC5D,4BAA4B,EAC5B;IACE,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAE,YAAY,CAAC,oBAAoB;IAC3C,gBAAgB,EAAE,SAAS;CAC5B,CACF,CAAC;AACW,QAAA,kBAAkB,GAAG,IAAA,mCAAmB,EAAC,mBAAmB,EAAE;IACzE,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAE,YAAY,CAAC,WAAW;IAClC,gBAAgB,EAAE,SAAS;CAC5B,CAAC,CAAC;AACU,QAAA,wBAAwB,GAAG,IAAA,mCAAmB,EACzD,0BAA0B,EAC1B;IACE,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAE,YAAY,CAAC,iBAAiB;IACxC,gBAAgB,EAAE,SAAS;CAC5B,CACF,CAAC;AACW,QAAA,2BAA2B,GAAG,IAAA,mCAAmB,EAC5D,6BAA6B,EAC7B;IACE,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAE,YAAY,CAAC,oBAAoB;IAC3C,gBAAgB,EAAE,SAAS;CAC5B,CACF,CAAC;AACW,QAAA,iCAAiC,GAAG,IAAA,mCAAmB,EAClE,mCAAmC,EACnC;IACE,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAE,YAAY,CAAC,0BAA0B;IACjD,gBAAgB,EAAE,SAAS;CAC5B,CACF,CAAC;AACW,QAAA,6BAA6B,GAAG,IAAA,mCAAmB,EAC9D,iBAAiB,EACjB;IACE,QAAQ,EAAE,oBAAY;IACtB,QAAQ,EAAE,YAAY,CAAC,UAAU;IACjC,gBAAgB,EAAE,SAAS;CAC5B,CACF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
import { type Plan } from "../db";
|
|
3
|
+
import { type OperatorActor } from "./journal";
|
|
4
|
+
import type { OperatorCommandResult } from "./types";
|
|
5
|
+
export interface WorkspaceCommandInput {
|
|
6
|
+
tenantId: string;
|
|
7
|
+
operationId: string;
|
|
8
|
+
actor: OperatorActor;
|
|
9
|
+
}
|
|
10
|
+
export interface ManualUpgradeCommandInput extends WorkspaceCommandInput {
|
|
11
|
+
targetPlanId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BalanceCreditCommandInput extends WorkspaceCommandInput {
|
|
14
|
+
amountCents: number;
|
|
15
|
+
reason: string;
|
|
16
|
+
}
|
|
17
|
+
export interface EligibleUpgradePlan {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
price: number;
|
|
21
|
+
currency: string;
|
|
22
|
+
interval: string;
|
|
23
|
+
maxMembers: number;
|
|
24
|
+
}
|
|
25
|
+
export interface WorkspaceOperatorOptions {
|
|
26
|
+
currentPlanId: string | null;
|
|
27
|
+
currentPlanName: string | null;
|
|
28
|
+
currency: string | null;
|
|
29
|
+
customerBalanceCents: number | null;
|
|
30
|
+
hasStripeCustomer: boolean;
|
|
31
|
+
hasStripeSubscription: boolean;
|
|
32
|
+
eligibleUpgradePlans: EligibleUpgradePlan[];
|
|
33
|
+
}
|
|
34
|
+
export declare function operatorActorOf(user: User): OperatorActor;
|
|
35
|
+
export declare function suspendWorkspaceCommand(input: WorkspaceCommandInput): Promise<OperatorCommandResult>;
|
|
36
|
+
export declare function reactivateWorkspaceCommand(input: WorkspaceCommandInput): Promise<OperatorCommandResult>;
|
|
37
|
+
export declare function isEligibleManualUpgradeTarget(target: Plan, current: Plan, customerType: string | null | undefined, occupiedSeats: number): boolean;
|
|
38
|
+
export declare function manuallyUpgradeWorkspaceCommand(input: ManualUpgradeCommandInput): Promise<OperatorCommandResult>;
|
|
39
|
+
export declare function validateBalanceCreditInput(amountCents: number, reason: string): void;
|
|
40
|
+
export declare function grantBalanceCreditCommand(input: BalanceCreditCommandInput): Promise<OperatorCommandResult>;
|
|
41
|
+
export declare function getWorkspaceOperatorOptions(tenantId: string): Promise<WorkspaceOperatorOptions>;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.operatorActorOf = operatorActorOf;
|
|
4
|
+
exports.suspendWorkspaceCommand = suspendWorkspaceCommand;
|
|
5
|
+
exports.reactivateWorkspaceCommand = reactivateWorkspaceCommand;
|
|
6
|
+
exports.isEligibleManualUpgradeTarget = isEligibleManualUpgradeTarget;
|
|
7
|
+
exports.manuallyUpgradeWorkspaceCommand = manuallyUpgradeWorkspaceCommand;
|
|
8
|
+
exports.validateBalanceCreditInput = validateBalanceCreditInput;
|
|
9
|
+
exports.grantBalanceCreditCommand = grantBalanceCreditCommand;
|
|
10
|
+
exports.getWorkspaceOperatorOptions = getWorkspaceOperatorOptions;
|
|
11
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
12
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
13
|
+
const db_1 = require("../db");
|
|
14
|
+
const plans_1 = require("../plans");
|
|
15
|
+
const seat_capacity_1 = require("../plans/seat-capacity");
|
|
16
|
+
const tenant_plan_ops_1 = require("../routes/tenant/tenant-plan-ops");
|
|
17
|
+
const client_1 = require("../stripe/client");
|
|
18
|
+
const customer_balance_1 = require("../stripe/customer-balance");
|
|
19
|
+
const utils_1 = require("../utils");
|
|
20
|
+
const suspension_1 = require("../workspaces/suspension");
|
|
21
|
+
const journal_1 = require("./journal");
|
|
22
|
+
const HTTP_BAD_REQUEST = 400;
|
|
23
|
+
const HTTP_NOT_FOUND = 404;
|
|
24
|
+
const HTTP_CONFLICT = 409;
|
|
25
|
+
const CREDIT_REASON_MAX_LENGTH = 500;
|
|
26
|
+
const CANCELLED_STATUS = "cancelled";
|
|
27
|
+
function hasEligibleStripeSubscription(subscription) {
|
|
28
|
+
return (!!subscription?.stripeSubscriptionId &&
|
|
29
|
+
subscription.status !== CANCELLED_STATUS);
|
|
30
|
+
}
|
|
31
|
+
function actorOf(user) {
|
|
32
|
+
return { id: user._id, email: user.email };
|
|
33
|
+
}
|
|
34
|
+
function operatorActorOf(user) {
|
|
35
|
+
return actorOf(user);
|
|
36
|
+
}
|
|
37
|
+
function mergeDetails(action, patch) {
|
|
38
|
+
return { ...action.details, ...patch };
|
|
39
|
+
}
|
|
40
|
+
async function executeSuspensionCommand(input, actionName) {
|
|
41
|
+
const action = await (0, journal_1.executeOperatorAction)({ ...input, action: actionName, details: {} }, async (running) => {
|
|
42
|
+
const effectInput = {
|
|
43
|
+
tenantId: input.tenantId,
|
|
44
|
+
operationId: input.operationId,
|
|
45
|
+
requestedAt: running.createdAt,
|
|
46
|
+
attemptCount: running.attemptCount,
|
|
47
|
+
};
|
|
48
|
+
const result = actionName === "workspace.suspend"
|
|
49
|
+
? await (0, suspension_1.applyWorkspaceSuspension)(effectInput)
|
|
50
|
+
: await (0, suspension_1.applyWorkspaceReactivation)(effectInput);
|
|
51
|
+
return {
|
|
52
|
+
details: mergeDetails(running, { status: result.status }),
|
|
53
|
+
effectiveAt: result.effectiveAt,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
return (0, journal_1.toOperatorCommandResult)(action);
|
|
57
|
+
}
|
|
58
|
+
async function suspendWorkspaceCommand(input) {
|
|
59
|
+
return executeSuspensionCommand(input, "workspace.suspend");
|
|
60
|
+
}
|
|
61
|
+
async function reactivateWorkspaceCommand(input) {
|
|
62
|
+
return executeSuspensionCommand(input, "workspace.unsuspend");
|
|
63
|
+
}
|
|
64
|
+
function isEligibleManualUpgradeTarget(target, current, customerType, occupiedSeats) {
|
|
65
|
+
const hasAudience = !!customerType &&
|
|
66
|
+
(target.audience === "any" || target.audience === customerType);
|
|
67
|
+
return (target._id !== current._id &&
|
|
68
|
+
target.isActive &&
|
|
69
|
+
!target.isDeleted &&
|
|
70
|
+
target.price > 0 &&
|
|
71
|
+
(0, tenant_plan_ops_1.isPaidPlan)(target) &&
|
|
72
|
+
hasAudience &&
|
|
73
|
+
!(0, plans_1.isDowngrade)(current, target) &&
|
|
74
|
+
(0, seat_capacity_1.fitsWithinSeatLimit)(target.maxMembers, occupiedSeats));
|
|
75
|
+
}
|
|
76
|
+
async function loadUpgradeContext(input) {
|
|
77
|
+
const subscription = await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, input.tenantId).findOne();
|
|
78
|
+
(0, interface_api_util_1.assert)(hasEligibleStripeSubscription(subscription), HTTP_BAD_REQUEST, "saas.errors.operator.stripe_subscription_required");
|
|
79
|
+
const currentPlan = subscription.planId
|
|
80
|
+
? await (0, interface_database_decorators_1.GetModel)(db_1.PlanModel).get(subscription.planId)
|
|
81
|
+
: undefined;
|
|
82
|
+
(0, interface_api_util_1.assert)(currentPlan, HTTP_NOT_FOUND, "saas.errors.plan.invalid");
|
|
83
|
+
const billingInfo = await (0, interface_database_decorators_1.GetModel)(db_1.TenantBillingInfoModel, input.tenantId).findOne();
|
|
84
|
+
const targetPlan = await (0, tenant_plan_ops_1.loadAndValidateTargetPlan)((0, interface_database_decorators_1.GetModel)(db_1.PlanModel), input.targetPlanId, billingInfo?.customerType);
|
|
85
|
+
return { subscription, currentPlan, targetPlan };
|
|
86
|
+
}
|
|
87
|
+
async function executeManualUpgradeEffect(input, action) {
|
|
88
|
+
const context = await loadUpgradeContext(input);
|
|
89
|
+
await applyManualUpgrade(input, action, context);
|
|
90
|
+
return {
|
|
91
|
+
details: mergeDetails(action, {
|
|
92
|
+
previousPlanId: action.details.previousPlanId ?? context.currentPlan._id,
|
|
93
|
+
previousPlanName: action.details.previousPlanName ?? context.currentPlan.name,
|
|
94
|
+
targetPlanId: context.targetPlan._id,
|
|
95
|
+
targetPlanName: context.targetPlan.name,
|
|
96
|
+
}),
|
|
97
|
+
effectiveAt: new Date(),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function assertManualUpgrade(context) {
|
|
101
|
+
(0, interface_api_util_1.assert)(context.subscription.planId !== context.targetPlan._id, HTTP_CONFLICT, "saas.errors.operator.plan_already_applied");
|
|
102
|
+
(0, interface_api_util_1.assert)(context.targetPlan.price > 0 && (0, tenant_plan_ops_1.isPaidPlan)(context.targetPlan), HTTP_BAD_REQUEST, "saas.errors.operator.paid_plan_required");
|
|
103
|
+
(0, interface_api_util_1.assert)(!(0, plans_1.isDowngrade)(context.currentPlan, context.targetPlan), HTTP_BAD_REQUEST, "saas.errors.operator.upgrade_only");
|
|
104
|
+
}
|
|
105
|
+
async function applyManualUpgrade(input, action, context) {
|
|
106
|
+
assertManualUpgrade(context);
|
|
107
|
+
await (0, tenant_plan_ops_1.assertSeatLimit)(input.tenantId, context.targetPlan);
|
|
108
|
+
await (0, journal_1.checkpointOperatorActionDetails)(action, {
|
|
109
|
+
previousPlanId: context.currentPlan._id,
|
|
110
|
+
previousPlanName: context.currentPlan.name,
|
|
111
|
+
targetPlanId: context.targetPlan._id,
|
|
112
|
+
targetPlanName: context.targetPlan.name,
|
|
113
|
+
});
|
|
114
|
+
await (0, tenant_plan_ops_1.applyImmediateChange)(input.tenantId, context.subscription, context.targetPlan, (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, input.tenantId), {
|
|
115
|
+
operationId: input.operationId,
|
|
116
|
+
kind: "change_plan",
|
|
117
|
+
targetPlanId: input.targetPlanId,
|
|
118
|
+
requestedAt: action.createdAt,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async function manuallyUpgradeWorkspaceCommand(input) {
|
|
122
|
+
const action = await (0, journal_1.executeOperatorAction)({
|
|
123
|
+
...input,
|
|
124
|
+
action: "subscription.upgrade",
|
|
125
|
+
details: { targetPlanId: input.targetPlanId },
|
|
126
|
+
}, (running) => executeManualUpgradeEffect(input, running));
|
|
127
|
+
return (0, journal_1.toOperatorCommandResult)(action);
|
|
128
|
+
}
|
|
129
|
+
function validateBalanceCreditInput(amountCents, reason) {
|
|
130
|
+
(0, interface_api_util_1.assert)(Number.isSafeInteger(amountCents) && amountCents > 0, HTTP_BAD_REQUEST, "saas.errors.operator.invalid_credit_amount");
|
|
131
|
+
const normalizedReason = reason.trim();
|
|
132
|
+
(0, interface_api_util_1.assert)(normalizedReason.length > 0 &&
|
|
133
|
+
normalizedReason.length <= CREDIT_REASON_MAX_LENGTH, HTTP_BAD_REQUEST, "saas.errors.operator.invalid_credit_reason");
|
|
134
|
+
}
|
|
135
|
+
async function loadCreditAccount(tenantId) {
|
|
136
|
+
const subscription = await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, tenantId).findOne();
|
|
137
|
+
(0, interface_api_util_1.assert)(subscription?.stripeCustomerId, HTTP_BAD_REQUEST, "saas.errors.workspace.no_stripe_customer");
|
|
138
|
+
const plan = subscription.planId
|
|
139
|
+
? await (0, interface_database_decorators_1.GetModel)(db_1.PlanModel).get(subscription.planId)
|
|
140
|
+
: undefined;
|
|
141
|
+
(0, interface_api_util_1.assert)(plan?.currency, HTTP_BAD_REQUEST, "saas.errors.plan.invalid");
|
|
142
|
+
return { customerId: subscription.stripeCustomerId, currency: plan.currency };
|
|
143
|
+
}
|
|
144
|
+
async function createBalanceCredit(input, action) {
|
|
145
|
+
const account = await creditAccountForAction(input.tenantId, action);
|
|
146
|
+
const transaction = await (0, client_1.getStripeClient)().customers.createBalanceTransaction(account.customerId, {
|
|
147
|
+
amount: -input.amountCents,
|
|
148
|
+
currency: account.currency.toLowerCase(),
|
|
149
|
+
description: input.reason,
|
|
150
|
+
}, { idempotencyKey: `saas-operator-credit:${input.operationId}` });
|
|
151
|
+
return {
|
|
152
|
+
details: mergeDetails(action, {
|
|
153
|
+
amountCents: input.amountCents,
|
|
154
|
+
reason: input.reason,
|
|
155
|
+
currency: account.currency,
|
|
156
|
+
stripeTransactionId: transaction.id,
|
|
157
|
+
endingBalanceCents: transaction.ending_balance,
|
|
158
|
+
}),
|
|
159
|
+
effectiveAt: (0, utils_1.stripeSecondsToDate)(transaction.created) ?? new Date(),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
async function creditAccountForAction(tenantId, action) {
|
|
163
|
+
const { stripeCustomerId, currency } = action.details;
|
|
164
|
+
if (typeof stripeCustomerId === "string" && typeof currency === "string")
|
|
165
|
+
return { customerId: stripeCustomerId, currency };
|
|
166
|
+
const account = await loadCreditAccount(tenantId);
|
|
167
|
+
await (0, journal_1.checkpointOperatorActionDetails)(action, {
|
|
168
|
+
stripeCustomerId: account.customerId,
|
|
169
|
+
currency: account.currency,
|
|
170
|
+
});
|
|
171
|
+
return account;
|
|
172
|
+
}
|
|
173
|
+
async function grantBalanceCreditCommand(input) {
|
|
174
|
+
const normalized = { ...input, reason: input.reason.trim() };
|
|
175
|
+
validateBalanceCreditInput(normalized.amountCents, normalized.reason);
|
|
176
|
+
const action = await (0, journal_1.executeOperatorAction)({
|
|
177
|
+
...normalized,
|
|
178
|
+
action: "customer_balance.credit",
|
|
179
|
+
details: {
|
|
180
|
+
amountCents: normalized.amountCents,
|
|
181
|
+
reason: normalized.reason,
|
|
182
|
+
},
|
|
183
|
+
}, (running) => createBalanceCredit(normalized, running));
|
|
184
|
+
return (0, journal_1.toOperatorCommandResult)(action);
|
|
185
|
+
}
|
|
186
|
+
function toEligiblePlan(plan) {
|
|
187
|
+
return {
|
|
188
|
+
id: plan._id,
|
|
189
|
+
name: plan.name,
|
|
190
|
+
price: plan.price,
|
|
191
|
+
currency: plan.currency,
|
|
192
|
+
interval: plan.interval,
|
|
193
|
+
maxMembers: plan.maxMembers,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async function retrieveCustomerBalance(subscription) {
|
|
197
|
+
if (!subscription?.stripeCustomerId)
|
|
198
|
+
return null;
|
|
199
|
+
const balance = await (0, customer_balance_1.retrieveStripeCustomerBalance)(subscription.stripeCustomerId).catch(() => null);
|
|
200
|
+
if (!balance || balance.status === "deleted")
|
|
201
|
+
return null;
|
|
202
|
+
return balance.balanceMinorUnits;
|
|
203
|
+
}
|
|
204
|
+
async function findEligibleUpgradePlans(tenantId, current, customerType) {
|
|
205
|
+
if (!current)
|
|
206
|
+
return [];
|
|
207
|
+
const occupiedSeats = await (0, seat_capacity_1.countOccupiedSeats)(tenantId);
|
|
208
|
+
const plans = await (0, interface_database_decorators_1.GetModel)(db_1.PlanModel).findActiveNotDeleted();
|
|
209
|
+
return plans
|
|
210
|
+
.filter((plan) => isEligibleManualUpgradeTarget(plan, current, customerType, occupiedSeats))
|
|
211
|
+
.map(toEligiblePlan);
|
|
212
|
+
}
|
|
213
|
+
async function getWorkspaceOperatorOptions(tenantId) {
|
|
214
|
+
const subscription = await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, tenantId).findOne();
|
|
215
|
+
const current = subscription?.planId
|
|
216
|
+
? await (0, interface_database_decorators_1.GetModel)(db_1.PlanModel).get(subscription.planId)
|
|
217
|
+
: undefined;
|
|
218
|
+
const billingInfo = await (0, interface_database_decorators_1.GetModel)(db_1.TenantBillingInfoModel, tenantId).findOne();
|
|
219
|
+
const hasStripeSubscription = hasEligibleStripeSubscription(subscription);
|
|
220
|
+
const eligible = hasStripeSubscription
|
|
221
|
+
? await findEligibleUpgradePlans(tenantId, current, billingInfo?.customerType)
|
|
222
|
+
: [];
|
|
223
|
+
return {
|
|
224
|
+
currentPlanId: current?._id ?? null,
|
|
225
|
+
currentPlanName: current?.name ?? null,
|
|
226
|
+
currency: current?.currency ?? null,
|
|
227
|
+
customerBalanceCents: await retrieveCustomerBalance(subscription),
|
|
228
|
+
hasStripeCustomer: !!subscription?.stripeCustomerId,
|
|
229
|
+
hasStripeSubscription,
|
|
230
|
+
eligibleUpgradePlans: eligible,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/operator-actions/commands.ts"],"names":[],"mappings":";;AA4GA,0CAEC;AAmCD,0DAIC;AAED,gEAIC;AAED,sEAmBC;AA6FD,0EAYC;AAED,gEAgBC;AA6DD,8DAiBC;AAuCD,kEA+BC;A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A6B,CAAC,YAAY,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,qBAAqB;QACpC,CAAC,CAAC,MAAM,wBAAwB,CAC5B,QAAQ,EACR,OAAO,EACP,WAAW,EAAE,YAAY,CAC1B;QACH,CAAC,CAAC,EAAE,CAAC;IACP,OAAO;QACL,aAAa,EAAE,OAAO,EAAE,GAAG,IAAI,IAAI;QACnC,eAAe,EAAE,OAAO,EAAE,IAAI,IAAI,IAAI;QACtC,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,IAAI;QACnC,oBAAoB,EAAE,MAAM,uBAAuB,CAAC,YAAY,CAAC;QACjE,iBAAiB,EAAE,CAAC,CAAC,YAAY,EAAE,gBAAgB;QACnD,qBAAqB;QACrB,oBAAoB,EAAE,QAAQ;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lifecycle-delivery.model"), exports);
|
|
18
|
+
__exportStar(require("./lifecycle-delivery.table"), exports);
|
|
19
|
+
__exportStar(require("./operator-action.model"), exports);
|
|
20
|
+
__exportStar(require("./operator-action.table"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/operator-actions/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,6DAA2C;AAC3C,0DAAwC;AACxC,0DAAwC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WorkspaceLifecycleReceipt } from "@antelopejs/interface-dms-saas/workspace-lifecycle";
|
|
2
|
+
import { LifecycleDelivery, type WorkspaceProvisioningState } from "./lifecycle-delivery.table";
|
|
3
|
+
declare const LifecycleDeliveryModel_base: {
|
|
4
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
5
|
+
readonly table: import("@antelopejs/interface-database").Table<LifecycleDelivery>;
|
|
6
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
7
|
+
get(id: string): PromiseLike<LifecycleDelivery | undefined>;
|
|
8
|
+
getBy(index: keyof LifecycleDelivery, ...keys: any[]): PromiseLike<LifecycleDelivery[]>;
|
|
9
|
+
getAll(): PromiseLike<LifecycleDelivery[]>;
|
|
10
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<LifecycleDelivery> | import("@antelopejs/interface-database-decorators").DeepPartial<LifecycleDelivery>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
11
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<LifecycleDelivery>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<LifecycleDelivery>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
13
|
+
delete(id: string): Promise<number>;
|
|
14
|
+
};
|
|
15
|
+
readonly schemaName: string;
|
|
16
|
+
fromPlainData(obj: any): LifecycleDelivery;
|
|
17
|
+
fromDatabase(obj: any): LifecycleDelivery | undefined;
|
|
18
|
+
toDatabase(obj: any): Record<string, any>;
|
|
19
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
20
|
+
};
|
|
21
|
+
export declare class LifecycleDeliveryModel extends LifecycleDeliveryModel_base {
|
|
22
|
+
transitionProvisioning(id: string, expected: WorkspaceProvisioningState, next: WorkspaceProvisioningState, invoiceId?: string | null): Promise<void>;
|
|
23
|
+
findByOperation(operationId: string): Promise<LifecycleDelivery[]>;
|
|
24
|
+
findReplayable(): Promise<LifecycleDelivery[]>;
|
|
25
|
+
markSucceeded(delivery: LifecycleDelivery, receipt: WorkspaceLifecycleReceipt): Promise<void>;
|
|
26
|
+
markFailed(delivery: LifecycleDelivery): Promise<void>;
|
|
27
|
+
private mutate;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LifecycleDeliveryModel = void 0;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
6
|
+
const lifecycle_delivery_table_1 = require("./lifecycle-delivery.table");
|
|
7
|
+
class LifecycleDeliveryModel extends (0, interface_database_decorators_1.BasicDataModel)(lifecycle_delivery_table_1.LifecycleDelivery, lifecycle_delivery_table_1.lifecycleDeliveriesTableName) {
|
|
8
|
+
async transitionProvisioning(id, expected, next, invoiceId) {
|
|
9
|
+
const current = await this.get(id);
|
|
10
|
+
if (!current)
|
|
11
|
+
throw new Error("Workspace provisioning state is missing");
|
|
12
|
+
if (current.provisioningState === next &&
|
|
13
|
+
(invoiceId === undefined || invoiceId === current.provisioningInvoiceId))
|
|
14
|
+
return;
|
|
15
|
+
if (current.provisioningState !== expected)
|
|
16
|
+
throw new Error("Workspace provisioning state changed");
|
|
17
|
+
const patch = { provisioningState: next };
|
|
18
|
+
if (invoiceId !== undefined)
|
|
19
|
+
patch.provisioningInvoiceId = invoiceId;
|
|
20
|
+
if (next === "cancelled")
|
|
21
|
+
patch.status = "succeeded";
|
|
22
|
+
const outcome = await this.mutate(current, patch);
|
|
23
|
+
if (outcome !== "applied")
|
|
24
|
+
throw new Error(`Workspace provisioning ${outcome}; reconcile before retry`);
|
|
25
|
+
}
|
|
26
|
+
async findByOperation(operationId) {
|
|
27
|
+
return this.getBy("operationId", operationId);
|
|
28
|
+
}
|
|
29
|
+
async findReplayable() {
|
|
30
|
+
const rows = await this.table.getAll(["pending", "failed"], "status").run();
|
|
31
|
+
return rows
|
|
32
|
+
.map((row) => LifecycleDeliveryModel.fromDatabase(row))
|
|
33
|
+
.filter((row) => !!row);
|
|
34
|
+
}
|
|
35
|
+
async markSucceeded(delivery, receipt) {
|
|
36
|
+
const current = await this.get(delivery._id);
|
|
37
|
+
if (!current)
|
|
38
|
+
throw new Error("Workspace lifecycle delivery is missing");
|
|
39
|
+
if (current.status === "succeeded")
|
|
40
|
+
return;
|
|
41
|
+
const now = new Date();
|
|
42
|
+
const outcome = await this.mutate(current, {
|
|
43
|
+
status: "succeeded",
|
|
44
|
+
receiptId: receipt.receiptId,
|
|
45
|
+
acceptedAt: now,
|
|
46
|
+
effectiveAt: receipt.effectiveAt ?? now,
|
|
47
|
+
completedAt: now,
|
|
48
|
+
attemptCount: current.attemptCount + 1,
|
|
49
|
+
});
|
|
50
|
+
if (outcome === "applied")
|
|
51
|
+
return;
|
|
52
|
+
if (outcome === "unknown")
|
|
53
|
+
throw new Error("Workspace lifecycle receipt unknown; reconcile before retry");
|
|
54
|
+
const latest = await this.get(delivery._id);
|
|
55
|
+
if (latest?.status !== "succeeded")
|
|
56
|
+
throw new Error("Workspace lifecycle receipt changed; retry delivery");
|
|
57
|
+
}
|
|
58
|
+
async markFailed(delivery) {
|
|
59
|
+
if (delivery.status === "succeeded")
|
|
60
|
+
return;
|
|
61
|
+
const outcome = await this.mutate(delivery, {
|
|
62
|
+
status: "failed",
|
|
63
|
+
lastErrorCode: "saas.errors.lifecycle.consumer_failed",
|
|
64
|
+
completedAt: new Date(),
|
|
65
|
+
attemptCount: delivery.attemptCount + 1,
|
|
66
|
+
});
|
|
67
|
+
if (outcome === "unknown")
|
|
68
|
+
throw new Error("Workspace lifecycle failure outcome unknown");
|
|
69
|
+
}
|
|
70
|
+
mutate(current, patch) {
|
|
71
|
+
return this.table
|
|
72
|
+
.atomicMutation(current._id, {
|
|
73
|
+
type: "update",
|
|
74
|
+
revisionField: "revision",
|
|
75
|
+
expectedRevision: current.revision === undefined
|
|
76
|
+
? { kind: "missing" }
|
|
77
|
+
: current.revision,
|
|
78
|
+
nextRevision: (0, node_crypto_1.randomUUID)(),
|
|
79
|
+
patch: { ...patch, updatedAt: new Date() },
|
|
80
|
+
})
|
|
81
|
+
.run();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.LifecycleDeliveryModel = LifecycleDeliveryModel;
|
|
85
|
+
//# sourceMappingURL=lifecycle-delivery.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-delivery.model.js","sourceRoot":"","sources":["../../../src/operator-actions/db/lifecycle-delivery.model.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,6FAA2E;AAE3E,yEAIoC;AAGpC,MAAa,sBAAuB,SAAQ,IAAA,8CAAc,EACxD,4CAAiB,EACjB,uDAA4B,CAC7B;IAEC,KAAK,CAAC,sBAAsB,CAC1B,EAAU,EACV,QAAoC,EACpC,IAAgC,EAChC,SAAyB;QAEzB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACzE,IACE,O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QAEjC,OAAO,IAAI,CAAC,KAAK;aACd,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE;YAC3B,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,UAAU;YACzB,gBAAgB,EACd,OAAO,CAAC,QAAQ,KAAK,SAAS;gBAC5B,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;gBACrB,CAAC,CAAC,OAAO,CAAC,QAAQ;YACtB,YAAY,EAAE,IAAA,wBAAU,GAAE;YAC1B,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE;SAC3C,CAAC;aACD,GAAG,EAAE,CAAC;IACX,CAAC;CACF;AAlGD,wDAkGC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Table } from "@antelopejs/interface-database-decorators";
|
|
2
|
+
import type { WorkspaceLifecycleTransition } from "@antelopejs/interface-dms-saas/workspace-lifecycle";
|
|
3
|
+
import type { OperatorActionStatus } from "../types";
|
|
4
|
+
export declare const lifecycleDeliveriesTableName = "saas_lifecycle_deliveries";
|
|
5
|
+
export type WorkspaceProvisioningState = "preparing" | "awaiting_payment" | "committed" | "cancelled";
|
|
6
|
+
export declare class LifecycleDelivery extends Table {
|
|
7
|
+
_id: string;
|
|
8
|
+
operationId: string;
|
|
9
|
+
tenantId: string;
|
|
10
|
+
consumer: string;
|
|
11
|
+
transition: WorkspaceLifecycleTransition;
|
|
12
|
+
provisioningInvoiceId: string | null;
|
|
13
|
+
provisioningState: WorkspaceProvisioningState | null;
|
|
14
|
+
status: OperatorActionStatus;
|
|
15
|
+
attemptCount: number;
|
|
16
|
+
revision?: string;
|
|
17
|
+
receiptId: string | null;
|
|
18
|
+
acceptedAt: Date | null;
|
|
19
|
+
effectiveAt: Date | null;
|
|
20
|
+
lastErrorCode: string | null;
|
|
21
|
+
requestedAt: Date;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
startedAt: Date | null;
|
|
24
|
+
completedAt: Date | null;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LifecycleDelivery = exports.lifecycleDeliveriesTableName = void 0;
|
|
13
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
14
|
+
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
15
|
+
const tenants_table_1 = require("@antelopejs/interface-dms/db/tables/tenants.table");
|
|
16
|
+
exports.lifecycleDeliveriesTableName = "saas_lifecycle_deliveries";
|
|
17
|
+
let LifecycleDelivery = class LifecycleDelivery extends interface_database_decorators_1.Table {
|
|
18
|
+
};
|
|
19
|
+
exports.LifecycleDelivery = LifecycleDelivery;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], LifecycleDelivery.prototype, "_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, interface_database_decorators_1.Index)(),
|
|
26
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], LifecycleDelivery.prototype, "operationId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, interface_database_decorators_1.Index)(),
|
|
31
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
32
|
+
(0, interface_database_decorators_1.Relation)({ to: () => tenants_table_1.Tenant }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], LifecycleDelivery.prototype, "tenantId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, interface_database_decorators_1.Index)(),
|
|
37
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], LifecycleDelivery.prototype, "consumer", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], LifecycleDelivery.prototype, "transition", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], LifecycleDelivery.prototype, "provisioningInvoiceId", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], LifecycleDelivery.prototype, "provisioningState", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, interface_database_decorators_1.Index)(),
|
|
54
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], LifecycleDelivery.prototype, "status", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, interface_database_decorators_1.Field)("number"),
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], LifecycleDelivery.prototype, "attemptCount", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], LifecycleDelivery.prototype, "revision", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], LifecycleDelivery.prototype, "receiptId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], LifecycleDelivery.prototype, "acceptedAt", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], LifecycleDelivery.prototype, "effectiveAt", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, interface_database_decorators_1.Field)("string"),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], LifecycleDelivery.prototype, "lastErrorCode", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
83
|
+
__metadata("design:type", Date)
|
|
84
|
+
], LifecycleDelivery.prototype, "requestedAt", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, interface_database_decorators_1.CreationTime)(),
|
|
87
|
+
(0, interface_database_decorators_1.Index)(),
|
|
88
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
89
|
+
__metadata("design:type", Date)
|
|
90
|
+
], LifecycleDelivery.prototype, "createdAt", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
93
|
+
__metadata("design:type", Object)
|
|
94
|
+
], LifecycleDelivery.prototype, "startedAt", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
97
|
+
__metadata("design:type", Object)
|
|
98
|
+
], LifecycleDelivery.prototype, "completedAt", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, interface_database_decorators_1.UpdateTime)(),
|
|
101
|
+
(0, interface_database_decorators_1.Field)("date"),
|
|
102
|
+
__metadata("design:type", Date)
|
|
103
|
+
], LifecycleDelivery.prototype, "updatedAt", void 0);
|
|
104
|
+
exports.LifecycleDelivery = LifecycleDelivery = __decorate([
|
|
105
|
+
(0, interface_database_decorators_1.RegisterTable)(exports.lifecycleDeliveriesTableName, constants_1.CORE_SCHEMA_NAME)
|
|
106
|
+
], LifecycleDelivery);
|
|
107
|
+
//# sourceMappingURL=lifecycle-delivery.table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-delivery.table.js","sourceRoot":"","sources":["../../../src/operator-actions/db/lifecycle-delivery.table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAQmD;AACnD,mEAAuE;AACvE,qFAA2E;AAI9D,QAAA,4BAA4B,GAAG,2BAA2B,CAAC;AASjE,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,qCAAK;CAiE3C,CAAA;AAjEY,8CAAiB;AAEpB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;8CACI;AAIZ;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;sDACY;AAKpB;IAHP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;IACf,IAAA,wCAAQ,EAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,sBAAM,EAAE,CAAC;;mDACN;AAIjB;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mDACS;AAGjB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;qDACiC;AAGzC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;gEAC6B;AAGrC;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;4DAC6C;AAIrD;IAFP,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;iDACqB;AAG7B;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;uDACa;AAGrB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;mDACU;AAGlB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;oDACiB;AAGzB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;qDACkB;AAGxB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;sDACmB;AAGzB;IADP,IAAA,qCAAK,EAAC,QAAQ,CAAC;;wDACqB;AAG7B;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACO,IAAI;sDAAC;AAKlB;IAHP,IAAA,4CAAY,GAAE;IACd,IAAA,qCAAK,GAAE;IACP,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;oDAAC;AAGhB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;oDACiB;AAGvB;IADP,IAAA,qCAAK,EAAC,MAAM,CAAC;;sDACmB;AAIzB;IAFP,IAAA,0CAAU,GAAE;IACZ,IAAA,qCAAK,EAAC,MAAM,CAAC;8BACK,IAAI;oDAAC;4BAhEb,iBAAiB;IAD7B,IAAA,6CAAa,EAAC,oCAA4B,EAAE,4BAAgB,CAAC;GACjD,iBAAiB,CAiE7B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { OperatorActionDetails } from "../types";
|
|
2
|
+
import { OperatorAction } from "./operator-action.table";
|
|
3
|
+
export interface OperatorActionSuccess {
|
|
4
|
+
details: OperatorActionDetails;
|
|
5
|
+
effectiveAt: Date;
|
|
6
|
+
}
|
|
7
|
+
declare const OperatorActionModel_base: {
|
|
8
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
9
|
+
readonly table: import("@antelopejs/interface-database").Table<OperatorAction>;
|
|
10
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
11
|
+
get(id: string): PromiseLike<OperatorAction | undefined>;
|
|
12
|
+
getBy(index: keyof OperatorAction, ...keys: any[]): PromiseLike<OperatorAction[]>;
|
|
13
|
+
getAll(): PromiseLike<OperatorAction[]>;
|
|
14
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<OperatorAction> | import("@antelopejs/interface-database-decorators").DeepPartial<OperatorAction>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
15
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<OperatorAction>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
16
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<OperatorAction>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
17
|
+
delete(id: string): Promise<number>;
|
|
18
|
+
};
|
|
19
|
+
readonly schemaName: string;
|
|
20
|
+
fromPlainData(obj: any): OperatorAction;
|
|
21
|
+
fromDatabase(obj: any): OperatorAction | undefined;
|
|
22
|
+
toDatabase(obj: any): Record<string, any>;
|
|
23
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
24
|
+
};
|
|
25
|
+
export declare class OperatorActionModel extends OperatorActionModel_base {
|
|
26
|
+
beginAttempt(current: OperatorAction): Promise<OperatorAction>;
|
|
27
|
+
markSucceeded(current: OperatorAction, outcome: OperatorActionSuccess): Promise<OperatorAction>;
|
|
28
|
+
markFailed(current: OperatorAction, errorCode: string): Promise<OperatorAction>;
|
|
29
|
+
markReconciliationRequired(current: OperatorAction, errorCode: string): Promise<OperatorAction>;
|
|
30
|
+
updateDetails(current: OperatorAction, details: OperatorActionDetails): Promise<OperatorAction>;
|
|
31
|
+
private mutate;
|
|
32
|
+
}
|
|
33
|
+
export {};
|