@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,36 @@
|
|
|
1
|
+
import { TenantModel } from "@antelopejs/interface-dms/db";
|
|
2
|
+
import { type User, UserModel } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
import { PlatformNoteModel, type PlatformNoteTargetType } from "../../db";
|
|
4
|
+
interface CreateNoteBody {
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
interface PlatformNoteWithAuthor {
|
|
8
|
+
_id: string;
|
|
9
|
+
targetType: PlatformNoteTargetType;
|
|
10
|
+
targetId: string;
|
|
11
|
+
authorId: string;
|
|
12
|
+
authorName: string | null;
|
|
13
|
+
authorEmail: string | null;
|
|
14
|
+
content: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
}
|
|
18
|
+
interface ListNotesResponse {
|
|
19
|
+
items: PlatformNoteWithAuthor[];
|
|
20
|
+
total: number;
|
|
21
|
+
page: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
}
|
|
24
|
+
interface DeletedNoteResult {
|
|
25
|
+
_id: string;
|
|
26
|
+
}
|
|
27
|
+
declare const SaasPlatformNotesController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
28
|
+
export declare class SaasPlatformNotesController extends SaasPlatformNotesController_base {
|
|
29
|
+
noteModel: PlatformNoteModel;
|
|
30
|
+
userModel: UserModel;
|
|
31
|
+
tenantModel: TenantModel;
|
|
32
|
+
list(_user: User, targetType: string, targetId: string, page?: string, pageSize?: string): Promise<ListNotesResponse>;
|
|
33
|
+
create(author: User, targetType: string, targetId: string, body: CreateNoteBody): Promise<PlatformNoteWithAuthor>;
|
|
34
|
+
remove(actor: User, id: string): Promise<DeletedNoteResult>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SaasPlatformNotesController = void 0;
|
|
16
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
18
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
19
|
+
const db_1 = require("@antelopejs/interface-dms/db");
|
|
20
|
+
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
21
|
+
const db_2 = require("@antelopejs/interface-dms/auth/db");
|
|
22
|
+
const db_3 = require("../../db");
|
|
23
|
+
const utils_1 = require("../../utils");
|
|
24
|
+
const HTTP_BAD_REQUEST = 400;
|
|
25
|
+
const HTTP_NOT_FOUND = 404;
|
|
26
|
+
const HTTP_FORBIDDEN = 403;
|
|
27
|
+
const MAX_CONTENT_LENGTH = 4000;
|
|
28
|
+
const VALID_TARGET_TYPES = new Set(db_3.PLATFORM_NOTE_TARGET_TYPES);
|
|
29
|
+
function assertTargetType(value) {
|
|
30
|
+
(0, interface_api_util_1.assert)(VALID_TARGET_TYPES.has(value), HTTP_BAD_REQUEST, "saas.errors.platform_notes.invalid_target");
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
async function ensureTargetExists(targetType, targetId, userModel, tenantModel) {
|
|
34
|
+
const lookups = {
|
|
35
|
+
user: () => userModel.get(targetId),
|
|
36
|
+
workspace: () => tenantModel.get(targetId),
|
|
37
|
+
};
|
|
38
|
+
const target = await lookups[targetType]();
|
|
39
|
+
(0, interface_api_util_1.assert)(target, HTTP_NOT_FOUND, "saas.errors.platform_notes.target_not_found");
|
|
40
|
+
}
|
|
41
|
+
async function decorateWithAuthors(notes, userModel) {
|
|
42
|
+
const uniqueAuthorIds = Array.from(new Set(notes.map((n) => n.authorId)));
|
|
43
|
+
const authors = await Promise.all(uniqueAuthorIds.map((id) => userModel.get(id)));
|
|
44
|
+
const authorsById = new Map(authors
|
|
45
|
+
.filter((author) => !!author)
|
|
46
|
+
.map((author) => [author._id, author]));
|
|
47
|
+
return notes.map((note) => {
|
|
48
|
+
const author = authorsById.get(note.authorId);
|
|
49
|
+
return {
|
|
50
|
+
_id: note._id,
|
|
51
|
+
targetType: note.targetType,
|
|
52
|
+
targetId: note.targetId,
|
|
53
|
+
authorId: note.authorId,
|
|
54
|
+
authorName: author?.name ?? null,
|
|
55
|
+
authorEmail: author?.email ?? null,
|
|
56
|
+
content: note.content,
|
|
57
|
+
createdAt: note.createdAt,
|
|
58
|
+
updatedAt: note.updatedAt,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
class SaasPlatformNotesController extends (0, interface_api_1.Controller)("/api/saas/platform-notes") {
|
|
63
|
+
async list(_user, targetType, targetId, page, pageSize) {
|
|
64
|
+
const type = assertTargetType(targetType);
|
|
65
|
+
await ensureTargetExists(type, targetId, this.userModel, this.tenantModel);
|
|
66
|
+
const result = await this.noteModel.listByTarget(type, targetId, {
|
|
67
|
+
page: (0, utils_1.parsePositiveInt)(page),
|
|
68
|
+
pageSize: (0, utils_1.parsePositiveInt)(pageSize),
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
items: await decorateWithAuthors(result.items, this.userModel),
|
|
72
|
+
total: result.total,
|
|
73
|
+
page: result.page,
|
|
74
|
+
pageSize: result.pageSize,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async create(author, targetType, targetId, body) {
|
|
78
|
+
const type = assertTargetType(targetType);
|
|
79
|
+
const content = (body.content ?? "").trim();
|
|
80
|
+
(0, interface_api_util_1.assert)(content.length > 0 && content.length <= MAX_CONTENT_LENGTH, HTTP_BAD_REQUEST, "saas.errors.platform_notes.invalid_content");
|
|
81
|
+
await ensureTargetExists(type, targetId, this.userModel, this.tenantModel);
|
|
82
|
+
const now = new Date();
|
|
83
|
+
const inserted = await this.noteModel.insert([
|
|
84
|
+
{
|
|
85
|
+
targetType: type,
|
|
86
|
+
targetId,
|
|
87
|
+
authorId: author._id,
|
|
88
|
+
content,
|
|
89
|
+
createdAt: now,
|
|
90
|
+
updatedAt: now,
|
|
91
|
+
},
|
|
92
|
+
]);
|
|
93
|
+
const created = await this.noteModel.get(inserted[0]);
|
|
94
|
+
(0, interface_api_util_1.assert)(created, HTTP_NOT_FOUND, "saas.errors.platform_notes.creation_failed");
|
|
95
|
+
const [decorated] = await decorateWithAuthors([created], this.userModel);
|
|
96
|
+
return decorated;
|
|
97
|
+
}
|
|
98
|
+
async remove(actor, id) {
|
|
99
|
+
const note = await this.noteModel.get(id);
|
|
100
|
+
(0, interface_api_util_1.assert)(note, HTTP_NOT_FOUND, "saas.errors.platform_notes.not_found");
|
|
101
|
+
const canDelete = note.authorId === actor._id || actor.owner;
|
|
102
|
+
(0, interface_api_util_1.assert)(canDelete, HTTP_FORBIDDEN, "saas.errors.platform_notes.forbidden");
|
|
103
|
+
await this.noteModel.delete(id);
|
|
104
|
+
return { _id: id };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.SaasPlatformNotesController = SaasPlatformNotesController;
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, interface_database_decorators_1.Model)(db_3.PlatformNoteModel),
|
|
110
|
+
__metadata("design:type", db_3.PlatformNoteModel)
|
|
111
|
+
], SaasPlatformNotesController.prototype, "noteModel", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, interface_database_decorators_1.Model)(db_2.UserModel),
|
|
114
|
+
__metadata("design:type", db_2.UserModel)
|
|
115
|
+
], SaasPlatformNotesController.prototype, "userModel", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, interface_database_decorators_1.Model)(db_1.TenantModel),
|
|
118
|
+
__metadata("design:type", db_1.TenantModel)
|
|
119
|
+
], SaasPlatformNotesController.prototype, "tenantModel", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, interface_api_1.Get)("/:targetType/:targetId"),
|
|
122
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
123
|
+
__param(1, (0, interface_api_1.Parameter)("targetType")),
|
|
124
|
+
__param(2, (0, interface_api_1.Parameter)("targetId")),
|
|
125
|
+
__param(3, (0, interface_api_1.Parameter)("page", "query")),
|
|
126
|
+
__param(4, (0, interface_api_1.Parameter)("pageSize", "query")),
|
|
127
|
+
__metadata("design:type", Function),
|
|
128
|
+
__metadata("design:paramtypes", [Function, String, String, String, String]),
|
|
129
|
+
__metadata("design:returntype", Promise)
|
|
130
|
+
], SaasPlatformNotesController.prototype, "list", null);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, interface_api_1.Post)("/:targetType/:targetId"),
|
|
133
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
134
|
+
__param(1, (0, interface_api_1.Parameter)("targetType")),
|
|
135
|
+
__param(2, (0, interface_api_1.Parameter)("targetId")),
|
|
136
|
+
__param(3, (0, interface_api_1.JSONBody)()),
|
|
137
|
+
__metadata("design:type", Function),
|
|
138
|
+
__metadata("design:paramtypes", [Function, String, String, Object]),
|
|
139
|
+
__metadata("design:returntype", Promise)
|
|
140
|
+
], SaasPlatformNotesController.prototype, "create", null);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, interface_api_1.Delete)("/:id"),
|
|
143
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
144
|
+
__param(1, (0, interface_api_1.Parameter)("id")),
|
|
145
|
+
__metadata("design:type", Function),
|
|
146
|
+
__metadata("design:paramtypes", [Function, String]),
|
|
147
|
+
__metadata("design:returntype", Promise)
|
|
148
|
+
], SaasPlatformNotesController.prototype, "remove", null);
|
|
149
|
+
//# sourceMappingURL=platform-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-notes.js","sourceRoot":"","sources":["../../../src/routes/platformOwner/platform-notes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAOmC;AACnC,uEAA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AAA;;;;uDAchC;AAGK;IADL,IAAA,oBAAI,EAAC,wBAAwB,CAAC;IAE5B,WAAA,IAAA,oBAAa,GAAE,CAAA;IACf,WAAA,IAAA,yBAAS,EAAC,YAAY,CAAC,CAAA;IACvB,WAAA,IAAA,yBAAS,EAAC,UAAU,CAAC,CAAA;IACrB,WAAA,IAAA,wBAAQ,GAAE,CAAA;;;;yDA6BZ;AAGK;IADL,IAAA,sBAAM,EAAC,MAAM,CAAC;IAEZ,WAAA,IAAA,oBAAa,GAAE,CAAA;IACf,WAAA,IAAA,yBAAS,EAAC,IAAI,CAAC,CAAA;;;;yDAQjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type User, UserModel } from "@antelopejs/interface-dms/auth/db";
|
|
2
|
+
declare const SaasPlatformOwnersController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
3
|
+
export declare class SaasPlatformOwnersController extends SaasPlatformOwnersController_base {
|
|
4
|
+
userModel: UserModel;
|
|
5
|
+
promote(_actor: User, userId: string): Promise<{
|
|
6
|
+
userId: string;
|
|
7
|
+
}>;
|
|
8
|
+
demote(actor: User, userId: string): Promise<{
|
|
9
|
+
userId: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SaasPlatformOwnersController = void 0;
|
|
16
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
17
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
18
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
19
|
+
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
20
|
+
const db_1 = require("@antelopejs/interface-dms/auth/db");
|
|
21
|
+
const notifications_1 = require("../../notifications");
|
|
22
|
+
const HTTP_BAD_REQUEST = 400;
|
|
23
|
+
const HTTP_NOT_FOUND = 404;
|
|
24
|
+
const HTTP_CONFLICT = 409;
|
|
25
|
+
const ADDED_ICON = "i-ph-user-plus";
|
|
26
|
+
const REMOVED_ICON = "i-ph-user-minus";
|
|
27
|
+
class SaasPlatformOwnersController extends (0, interface_api_1.Controller)("/api/saas/platform-owners") {
|
|
28
|
+
async promote(_actor, userId) {
|
|
29
|
+
const target = await this.userModel.get(userId);
|
|
30
|
+
(0, interface_api_util_1.assert)(target, HTTP_NOT_FOUND, "saas.errors.user.not_found");
|
|
31
|
+
(0, interface_api_util_1.assert)(!target.owner, HTTP_CONFLICT, "saas.errors.platform_owner.already_owner");
|
|
32
|
+
await this.userModel.update(userId, { owner: true });
|
|
33
|
+
await (0, notifications_1.notifyAllPlatformOwners)(notifications_1.platformOwnerAddedSubject, {
|
|
34
|
+
icon: ADDED_ICON,
|
|
35
|
+
title: "Platform owner added",
|
|
36
|
+
description: `${target.email} is now a platform owner.`,
|
|
37
|
+
}, userId);
|
|
38
|
+
return { userId };
|
|
39
|
+
}
|
|
40
|
+
async demote(actor, userId) {
|
|
41
|
+
(0, interface_api_util_1.assert)(userId !== actor._id, HTTP_BAD_REQUEST, "saas.errors.platform_owner.cannot_demote_self");
|
|
42
|
+
const target = await this.userModel.get(userId);
|
|
43
|
+
(0, interface_api_util_1.assert)(target, HTTP_NOT_FOUND, "saas.errors.user.not_found");
|
|
44
|
+
(0, interface_api_util_1.assert)(target.owner, HTTP_CONFLICT, "saas.errors.platform_owner.not_owner");
|
|
45
|
+
const otherOwners = await this.userModel.countOwnersExcluding([userId]);
|
|
46
|
+
(0, interface_api_util_1.assert)(otherOwners >= 1, HTTP_BAD_REQUEST, "saas.errors.platform_owner.cannot_demote_last_owner");
|
|
47
|
+
await this.userModel.update(userId, { owner: false });
|
|
48
|
+
await (0, notifications_1.notifyAllPlatformOwners)(notifications_1.platformOwnerRemovedSubject, {
|
|
49
|
+
icon: REMOVED_ICON,
|
|
50
|
+
title: "Platform owner removed",
|
|
51
|
+
description: `${target.email} is no longer a platform owner.`,
|
|
52
|
+
});
|
|
53
|
+
return { userId };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.SaasPlatformOwnersController = SaasPlatformOwnersController;
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, interface_database_decorators_1.Model)(db_1.UserModel),
|
|
59
|
+
__metadata("design:type", db_1.UserModel)
|
|
60
|
+
], SaasPlatformOwnersController.prototype, "userModel", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, interface_api_1.Post)("/:userId/promote"),
|
|
63
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
64
|
+
__param(1, (0, interface_api_1.Parameter)("userId", "param")),
|
|
65
|
+
__metadata("design:type", Function),
|
|
66
|
+
__metadata("design:paramtypes", [Function, String]),
|
|
67
|
+
__metadata("design:returntype", Promise)
|
|
68
|
+
], SaasPlatformOwnersController.prototype, "promote", null);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, interface_api_1.Post)("/:userId/demote"),
|
|
71
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
72
|
+
__param(1, (0, interface_api_1.Parameter)("userId", "param")),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [Function, String]),
|
|
75
|
+
__metadata("design:returntype", Promise)
|
|
76
|
+
], SaasPlatformOwnersController.prototype, "demote", null);
|
|
77
|
+
//# sourceMappingURL=platform-owners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-owners.js","sourceRoot":"","sources":["../../../src/routes/platformOwner/platform-owners.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAAwE;AACxE,uEAAwD;AACxD,6FAAkE;AAClE,yDAA+D;AAC/D,0DAAyE;AACzE,uDAI6B;AAE7B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAEvC,MAAa,4BAA6B,SAAQ,IAAA,0BAAU,EAC1D,2BAA2B,CAC5B;IAKO,AAAN,KAAK,CAAC,OAAO,CACM,MAAY,EACC,MAAc;QAE5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAChD,IAAA,2BAAM,EAAC,MAAM,EAAE,cAAc,EAAE,4BAA4B,CAAC,CAAC;QAC7D,IAAA,2BAAM,EACJ,CAAC,MAAM,CAAC,KAAK,EACb,aAAa,EACb,0CAA0C,CAC3C,CAAC;QACF,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,IAAA,uCAAuB,EAC3B,yCAAyB,EACzB;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAA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B9B;AAGK;IADL,IAAA,oBAAI,EAAC,iBAAiB,CAAC;IAErB,WAAA,IAAA,oBAAa,GAAE,CAAA;IACf,WAAA,IAAA,yBAAS,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;;;;0DAuB9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RequestContext } from "@antelopejs/interface-api";
|
|
2
|
+
import type { User } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
import { type ExportJobStatus } from "@antelopejs/interface-dms/base";
|
|
4
|
+
import { PlanModel, SegmentModel } from "../../db";
|
|
5
|
+
import { SEGMENT_FIELDS, USER_SEGMENT_FIELDS } from "../../utils";
|
|
6
|
+
interface PlanOption {
|
|
7
|
+
_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
interface SegmentFieldsCatalog {
|
|
11
|
+
fields: typeof SEGMENT_FIELDS;
|
|
12
|
+
userFields: typeof USER_SEGMENT_FIELDS;
|
|
13
|
+
plans: PlanOption[];
|
|
14
|
+
}
|
|
15
|
+
declare const SaasSegmentsApiController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
16
|
+
export declare class SaasSegmentsApiController extends SaasSegmentsApiController_base {
|
|
17
|
+
segmentModel: SegmentModel;
|
|
18
|
+
planModel: PlanModel;
|
|
19
|
+
fields(_user: User): Promise<SegmentFieldsCatalog>;
|
|
20
|
+
startOwnersExport(user: User, ctx: RequestContext, id: string): Promise<import("@antelopejs/interface-dms/dist/base").ExportJobTicket>;
|
|
21
|
+
getOwnersExportStatus(user: User, ctx: RequestContext, id: string, jobId: string): Promise<ExportJobStatus>;
|
|
22
|
+
downloadOwnersExport(user: User, ctx: RequestContext, id: string, jobId: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.SaasSegmentsApiController = void 0;
|
|
19
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
20
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
21
|
+
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
22
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
23
|
+
const auth_1 = require("@antelopejs/interface-dms/auth");
|
|
24
|
+
const base_1 = require("@antelopejs/interface-dms/base");
|
|
25
|
+
const db_1 = require("../../db");
|
|
26
|
+
const utils_1 = require("../../utils");
|
|
27
|
+
const HTTP_NOT_FOUND = 404;
|
|
28
|
+
const OWNERS_EXPORT_SCOPE = "saas-segment-owners";
|
|
29
|
+
const FORMULA_PREFIXES = new Set(["=", "+", "-", "@"]);
|
|
30
|
+
const CSV_BOM = "";
|
|
31
|
+
const MAX_GENERATE_PROGRESS = 99;
|
|
32
|
+
function ownersExportAccessForSegment(segmentId) {
|
|
33
|
+
return {
|
|
34
|
+
scope: OWNERS_EXPORT_SCOPE,
|
|
35
|
+
isOwnedBy: (_record, context) => context?.segmentId === segmentId,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function slugify(value) {
|
|
39
|
+
return value
|
|
40
|
+
.toLowerCase()
|
|
41
|
+
.normalize("NFD")
|
|
42
|
+
.replace(/[̀-ͯ]/g, "")
|
|
43
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
44
|
+
.replace(/^-+|-+$/g, "");
|
|
45
|
+
}
|
|
46
|
+
function csvEscape(value) {
|
|
47
|
+
let str = value;
|
|
48
|
+
const first = str.charAt(0);
|
|
49
|
+
if (first && FORMULA_PREFIXES.has(first))
|
|
50
|
+
str = `'${str}`;
|
|
51
|
+
if (/[",\r\n]/.test(str))
|
|
52
|
+
return `"${str.replace(/"/g, '""')}"`;
|
|
53
|
+
return str;
|
|
54
|
+
}
|
|
55
|
+
function appendCsvRow(filePath, row) {
|
|
56
|
+
node_fs_1.default.appendFileSync(filePath, `${row.map(csvEscape).join(",")}\r\n`);
|
|
57
|
+
}
|
|
58
|
+
let SaasSegmentsApiController = class SaasSegmentsApiController extends (0, interface_api_1.Controller)("/api/saas/segments") {
|
|
59
|
+
async fields(_user) {
|
|
60
|
+
const plans = await this.planModel.getAll();
|
|
61
|
+
return {
|
|
62
|
+
fields: utils_1.SEGMENT_FIELDS,
|
|
63
|
+
userFields: utils_1.USER_SEGMENT_FIELDS,
|
|
64
|
+
plans: plans
|
|
65
|
+
.filter((p) => !p.isDeleted)
|
|
66
|
+
.map((p) => ({ _id: p._id, name: p.name })),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async startOwnersExport(user, ctx, id) {
|
|
70
|
+
const segment = await this.segmentModel.get(id);
|
|
71
|
+
(0, interface_api_util_1.assert)(segment, HTTP_NOT_FOUND, "saas.errors.segments.not_found");
|
|
72
|
+
const planModel = this.planModel;
|
|
73
|
+
const segmentName = segment.name;
|
|
74
|
+
const segmentConditions = segment.conditions;
|
|
75
|
+
return (0, base_1.runExportJob)({
|
|
76
|
+
ctx,
|
|
77
|
+
user,
|
|
78
|
+
scope: OWNERS_EXPORT_SCOPE,
|
|
79
|
+
context: { segmentId: id },
|
|
80
|
+
filename: `segment-${slugify(segmentName) || id}-users`,
|
|
81
|
+
extension: "csv",
|
|
82
|
+
contentType: "text/csv; charset=utf-8",
|
|
83
|
+
generate: async ({ localPath, reportProgress }) => {
|
|
84
|
+
node_fs_1.default.writeFileSync(localPath, CSV_BOM);
|
|
85
|
+
appendCsvRow(localPath, [
|
|
86
|
+
"user_id",
|
|
87
|
+
"email",
|
|
88
|
+
"name",
|
|
89
|
+
"language",
|
|
90
|
+
"created_at",
|
|
91
|
+
"is_validated",
|
|
92
|
+
"workspaces_count",
|
|
93
|
+
]);
|
|
94
|
+
const now = new Date();
|
|
95
|
+
const userProjections = await (0, utils_1.loadAllUserProjections)(planModel, now);
|
|
96
|
+
const matched = userProjections.filter((projection) => (0, utils_1.evaluateSegmentGroup)(segmentConditions, projection));
|
|
97
|
+
matched.sort((a, b) => a.email.localeCompare(b.email));
|
|
98
|
+
if (matched.length === 0) {
|
|
99
|
+
await reportProgress(100);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let done = 0;
|
|
103
|
+
for (const projection of matched) {
|
|
104
|
+
appendCsvRow(localPath, [
|
|
105
|
+
projection._id,
|
|
106
|
+
projection.email,
|
|
107
|
+
projection.name,
|
|
108
|
+
projection.language,
|
|
109
|
+
new Date(projection.createdAt).toISOString(),
|
|
110
|
+
projection.isValidated ? "true" : "false",
|
|
111
|
+
String(projection.workspacesCount),
|
|
112
|
+
]);
|
|
113
|
+
done++;
|
|
114
|
+
await reportProgress(Math.floor((done / matched.length) * MAX_GENERATE_PROGRESS));
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async getOwnersExportStatus(user, ctx, id, jobId) {
|
|
120
|
+
return (0, base_1.getExportJobStatus)(ctx, user, jobId, ownersExportAccessForSegment(id));
|
|
121
|
+
}
|
|
122
|
+
async downloadOwnersExport(user, ctx, id, jobId) {
|
|
123
|
+
await (0, base_1.downloadExportJob)(ctx, user, jobId, ownersExportAccessForSegment(id));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.SaasSegmentsApiController = SaasSegmentsApiController;
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, interface_database_decorators_1.Model)(db_1.SegmentModel),
|
|
129
|
+
__metadata("design:type", db_1.SegmentModel)
|
|
130
|
+
], SaasSegmentsApiController.prototype, "segmentModel", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, interface_database_decorators_1.Model)(db_1.PlanModel),
|
|
133
|
+
__metadata("design:type", db_1.PlanModel)
|
|
134
|
+
], SaasSegmentsApiController.prototype, "planModel", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, interface_api_1.Get)("/fields"),
|
|
137
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
138
|
+
__metadata("design:type", Function),
|
|
139
|
+
__metadata("design:paramtypes", [Function]),
|
|
140
|
+
__metadata("design:returntype", Promise)
|
|
141
|
+
], SaasSegmentsApiController.prototype, "fields", null);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, interface_api_1.Post)("/:id/owners-export/start"),
|
|
144
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
145
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
146
|
+
__param(2, (0, interface_api_1.Parameter)("id")),
|
|
147
|
+
__metadata("design:type", Function),
|
|
148
|
+
__metadata("design:paramtypes", [Function, Object, String]),
|
|
149
|
+
__metadata("design:returntype", Promise)
|
|
150
|
+
], SaasSegmentsApiController.prototype, "startOwnersExport", null);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, interface_api_1.Get)("/:id/owners-export/status/:jobId"),
|
|
153
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
154
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
155
|
+
__param(2, (0, interface_api_1.Parameter)("id")),
|
|
156
|
+
__param(3, (0, interface_api_1.Parameter)("jobId")),
|
|
157
|
+
__metadata("design:type", Function),
|
|
158
|
+
__metadata("design:paramtypes", [Function, Object, String, String]),
|
|
159
|
+
__metadata("design:returntype", Promise)
|
|
160
|
+
], SaasSegmentsApiController.prototype, "getOwnersExportStatus", null);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, interface_api_1.Get)("/:id/owners-export/download/:jobId"),
|
|
163
|
+
__param(0, (0, auth_1.AuthOwnerOnly)()),
|
|
164
|
+
__param(1, (0, interface_api_1.Context)()),
|
|
165
|
+
__param(2, (0, interface_api_1.Parameter)("id")),
|
|
166
|
+
__param(3, (0, interface_api_1.Parameter)("jobId")),
|
|
167
|
+
__metadata("design:type", Function),
|
|
168
|
+
__metadata("design:paramtypes", [Function, Object, String, String]),
|
|
169
|
+
__metadata("design:returntype", Promise)
|
|
170
|
+
], SaasSegmentsApiController.prototype, "downloadOwnersExport", null);
|
|
171
|
+
exports.SaasSegmentsApiController = SaasSegmentsApiController = __decorate([
|
|
172
|
+
(0, auth_1.AuthOwnerOnly)()
|
|
173
|
+
], SaasSegmentsApiController);
|
|
174
|
+
//# sourceMappingURL=segments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../../src/routes/platformOwner/segments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sDAAyB;AACzB,6DAOmC;AACnC,uEAAwD;AACxD,6FAAkE;AAClE,yDAA+D;AAE/D,yDAMwC;AACxC,iCAAmD;AACnD,uCAKqB;AAErB,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG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AAC,CAAA;IACf,WAAA,IAAA,yBAAS,EAAC,OAAO,CAAC,CAAA;;;;qEAGpB;oCA7GU,yBAAyB;IADrC,IAAA,oBAAa,GAAE;GACH,yBAAyB,CA8GrC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TenantModel } from "@antelopejs/interface-dms/db";
|
|
2
|
+
import { type User, UserModel } from "@antelopejs/interface-dms/auth/db";
|
|
3
|
+
import { type SupportMessage, type SupportTicket } from "../../db";
|
|
4
|
+
import { type SupportAttachmentMetadata } from "../../support";
|
|
5
|
+
import { type SupportRecoveryPage } from "../../support/recovery";
|
|
6
|
+
interface PlatformSupportDetail {
|
|
7
|
+
ticket: SupportTicket;
|
|
8
|
+
tenantId: string;
|
|
9
|
+
tenantName: string;
|
|
10
|
+
}
|
|
11
|
+
declare const SaasPlatformSupportController_base: import("@antelopejs/interface-api").ControllerClass<object>;
|
|
12
|
+
export declare class SaasPlatformSupportController extends SaasPlatformSupportController_base {
|
|
13
|
+
tenantModel: TenantModel;
|
|
14
|
+
userModel: UserModel;
|
|
15
|
+
reconcile(_user: User, tenantId: string, after?: string): Promise<SupportRecoveryPage>;
|
|
16
|
+
detail(_user: User, tenantId: string, ticketId: string): Promise<PlatformSupportDetail>;
|
|
17
|
+
reply(user: User, tenantId: string, ticketId: string, body: unknown): Promise<SupportMessage>;
|
|
18
|
+
update(user: User, tenantId: string, ticketId: string, body: unknown): Promise<SupportTicket>;
|
|
19
|
+
attachment(_user: User, tenantId: string, ticketId: string, resourceKey: string): Promise<SupportAttachmentMetadata>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|