@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
package/dist/index.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.construct = construct;
|
|
40
|
+
exports.start = start;
|
|
41
|
+
exports.stop = stop;
|
|
42
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
43
|
+
const interface_core_1 = require("@antelopejs/interface-core");
|
|
44
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
45
|
+
const page_1 = require("@antelopejs/interface-dms/page");
|
|
46
|
+
const billingInterface = __importStar(require("@antelopejs/interface-dms-saas/billing"));
|
|
47
|
+
const invoiceLineItemsInterface = __importStar(require("@antelopejs/interface-dms-saas/invoice-line-items"));
|
|
48
|
+
const pagesInterface = __importStar(require("@antelopejs/interface-dms-saas/pages"));
|
|
49
|
+
const workspaceLifecycleInterface = __importStar(require("@antelopejs/interface-dms-saas/workspace-lifecycle"));
|
|
50
|
+
const auth_1 = require("./auth");
|
|
51
|
+
const automation_1 = require("./automation");
|
|
52
|
+
const config_1 = require("./config");
|
|
53
|
+
const crons_1 = require("./crons");
|
|
54
|
+
const hooks_1 = require("./hooks");
|
|
55
|
+
const billingImplementation = __importStar(require("./implementations/dms-saas/billing"));
|
|
56
|
+
const invoiceLineItemsImplementation = __importStar(require("./implementations/dms-saas/invoice-line-items"));
|
|
57
|
+
const pagesImplementation = __importStar(require("./implementations/dms-saas/pages"));
|
|
58
|
+
const workspaceLifecycleImplementation = __importStar(require("./implementations/dms-saas/workspace-lifecycle"));
|
|
59
|
+
const pages_1 = require("./pages");
|
|
60
|
+
const plans_1 = require("./plans");
|
|
61
|
+
const stripe_1 = require("./stripe");
|
|
62
|
+
require("./data-api");
|
|
63
|
+
require("./db");
|
|
64
|
+
require("./notifications");
|
|
65
|
+
require("./routes");
|
|
66
|
+
let registeredCronTasks = [];
|
|
67
|
+
async function construct(config) {
|
|
68
|
+
(0, config_1.setRuntimeConfig)(config);
|
|
69
|
+
await (0, config_1.resolveDevMode)();
|
|
70
|
+
(0, stripe_1.initStripeClient)(config.stripe);
|
|
71
|
+
(0, hooks_1.registerSaasHookListeners)();
|
|
72
|
+
(0, auth_1.registerPlanPermissionsResolver)();
|
|
73
|
+
(0, auth_1.registerSubscriptionAccessGate)();
|
|
74
|
+
(0, plans_1.registerSeatHooks)();
|
|
75
|
+
(0, interface_core_1.ImplementInterface)(billingInterface, billingImplementation);
|
|
76
|
+
(0, interface_core_1.ImplementInterface)(invoiceLineItemsInterface, invoiceLineItemsImplementation);
|
|
77
|
+
(0, interface_core_1.ImplementInterface)(pagesInterface, pagesImplementation);
|
|
78
|
+
(0, interface_core_1.ImplementInterface)(workspaceLifecycleInterface, workspaceLifecycleImplementation);
|
|
79
|
+
await (0, pages_1.registerPublicScreens)(config);
|
|
80
|
+
await (0, page_1.AddFrontendModule)({
|
|
81
|
+
name: "@antelopejs/dms-saas-frontend-vue",
|
|
82
|
+
sourcePath: node_path_1.default.join(__dirname, "../frontend-vue"),
|
|
83
|
+
renderer: { name: "vue", version: "3" },
|
|
84
|
+
priority: 0,
|
|
85
|
+
options: {
|
|
86
|
+
dmsSaas: {
|
|
87
|
+
stripePublishableKey: config.stripe.publishableKey,
|
|
88
|
+
admissionMode: config.admissionMode ?? "open",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function start() {
|
|
94
|
+
registeredCronTasks = (0, crons_1.registerSaasCrons)();
|
|
95
|
+
(0, automation_1.registerAutomationNodes)();
|
|
96
|
+
}
|
|
97
|
+
async function stop() {
|
|
98
|
+
const teardowns = await Promise.allSettled(registeredCronTasks.map(async (task) => task.destroy()));
|
|
99
|
+
for (const teardown of teardowns) {
|
|
100
|
+
if (teardown.status === "rejected") {
|
|
101
|
+
logging_1.Logging.Error("A cron task failed to stop", teardown.reason);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
registeredCronTasks = [];
|
|
105
|
+
(0, automation_1.unregisterAutomationNodes)();
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,8BA6BC;AAED,sBAGC;AAED,oBAWC;AAnFD,0DAA6B;AAC7B,+DAAgE;AAChE,gEAA6D;AAC7D,yDAAmE;AACnE,yFAA2E;AAC3E,6GAA+F;AAC/F,qFAAuE;AACvE,gHAAkG;AAElG,iCAGgB;AAChB,6CAGsB;AACtB,qCAA4D;AAC5D,mCAA4C;AAC5C,mCAAoD;AACpD,0FAA4E;AAC5E,8GAAgG;AAChG,sFAAwE;AACxE,iHAAmG;AACnG,mCAA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E,CAAC;AAC5B,CAAC;AAEM,KAAK,UAAU,IAAI;IACxB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,UAAU,CACxC,mBAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CACxD,CAAC;IACF,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACnC,iBAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,mBAAmB,GAAG,EAAE,CAAC;IACzB,IAAA,sCAAyB,GAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { InvoiceLineItemsContext } from "@antelopejs/interface-dms-saas/invoice-line-items";
|
|
2
|
+
import type { TenantSubscription } from "../db";
|
|
3
|
+
export declare function clipInvoiceUsageWindow(context: InvoiceLineItemsContext, subscription: TenantSubscription | undefined, stripeSubscriptionId: string | null): InvoiceLineItemsContext | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clipInvoiceUsageWindow = clipInvoiceUsageWindow;
|
|
4
|
+
const complimentary_1 = require("../workspaces/complimentary");
|
|
5
|
+
function clipInvoiceUsageWindow(context, subscription, stripeSubscriptionId) {
|
|
6
|
+
if ((0, complimentary_1.isComplimentarySubscription)(subscription))
|
|
7
|
+
return null;
|
|
8
|
+
if (!subscription?.paidUsagePeriods)
|
|
9
|
+
return context;
|
|
10
|
+
const period = subscription.paidUsagePeriods.find((candidate) => candidate.stripeSubscriptionId === stripeSubscriptionId);
|
|
11
|
+
if (!period)
|
|
12
|
+
return null;
|
|
13
|
+
const periodStart = new Date(Math.max(context.periodStart.getTime(), new Date(period.start).getTime()));
|
|
14
|
+
const periodEnd = new Date(Math.min(context.periodEnd.getTime(), period.end ? new Date(period.end).getTime() : context.periodEnd.getTime()));
|
|
15
|
+
if (periodStart >= periodEnd)
|
|
16
|
+
return null;
|
|
17
|
+
return { ...context, periodStart, periodEnd };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=billing-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-window.js","sourceRoot":"","sources":["../../src/invoice-line-items/billing-window.ts"],"names":[],"mappings":";;AAKA,wDAsBC;AAzBD,+DAA0E;AAG1E,SAAgB,sBAAsB,CACpC,OAAgC,EAChC,YAA4C,EAC5C,oBAAmC;IAEnC,IAAI,IAAA,2CAA2B,EAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,IAAI,CAAC,YAAY,EAAE,gBAAgB;QAAE,OAAO,OAAO,CAAC;IACpD,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAC/C,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,oBAAoB,KAAK,oBAAoB,CACvE,CAAC;IACF,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,WAAW,GAAG,IAAI,IAAI,CAC1B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAC1E,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,IAAI,CACxB,IAAI,CAAC,GAAG,CACN,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,EAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAC1E,CACF,CAAC;IACF,IAAI,WAAW,IAAI,SAAS;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./injection";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./injection"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/invoice-line-items/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.injectProvidedInvoiceLineItems = injectProvidedInvoiceLineItems;
|
|
4
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
5
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
6
|
+
const invoice_line_items_1 = require("@antelopejs/interface-dms-saas/invoice-line-items");
|
|
7
|
+
const invoice_line_items_2 = require("../implementations/dms-saas/invoice-line-items");
|
|
8
|
+
const client_1 = require("../stripe/client");
|
|
9
|
+
const db_1 = require("../db");
|
|
10
|
+
const billing_window_1 = require("./billing-window");
|
|
11
|
+
const LINE_KEY_METADATA = "saasLineKey";
|
|
12
|
+
const LINE_PROVIDER_METADATA = "saasLineProvider";
|
|
13
|
+
const LINE_QUANTITY_METADATA = "saasLineQuantity";
|
|
14
|
+
const LINE_UNIT_METADATA = "saasLineUnit";
|
|
15
|
+
const IDEMPOTENCY_KEY_PREFIX = "saas-invoice-line";
|
|
16
|
+
const CYCLE_RENEWAL_BILLING_REASON = "subscription_cycle";
|
|
17
|
+
const DRAFT_INVOICE_STATUS = "draft";
|
|
18
|
+
const INVOICE_ITEMS_PAGE_SIZE = 100;
|
|
19
|
+
const INVOICE_ITEMS_HARD_CAP = 250;
|
|
20
|
+
const CREATE_ATTEMPTS = 3;
|
|
21
|
+
const RETRY_DELAY_MS = 250;
|
|
22
|
+
const MS_PER_SECOND = 1000;
|
|
23
|
+
const LOG_PREFIX = "[dms-saas:invoice-line-items]";
|
|
24
|
+
const REPORTED_SKIP_REASONS = new Set([
|
|
25
|
+
"invalid",
|
|
26
|
+
"duplicate_key",
|
|
27
|
+
]);
|
|
28
|
+
function canInjectIntoInvoice(invoice) {
|
|
29
|
+
if (invoice.billing_reason !== CYCLE_RENEWAL_BILLING_REASON)
|
|
30
|
+
return false;
|
|
31
|
+
if (invoice.status === DRAFT_INVOICE_STATUS)
|
|
32
|
+
return true;
|
|
33
|
+
logging_1.Logging.Warn(`${LOG_PREFIX} invoice ${invoice.id} was already '${invoice.status}' when the event was handled: this cycle's usage lines can no longer be added and will not be billed`);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
function stripeSecondsToDate(seconds) {
|
|
37
|
+
return new Date(seconds * MS_PER_SECOND);
|
|
38
|
+
}
|
|
39
|
+
function toStripeSeconds(date) {
|
|
40
|
+
return Math.floor(date.getTime() / MS_PER_SECOND);
|
|
41
|
+
}
|
|
42
|
+
async function buildInjectionTarget(invoice, tenantId, customerId) {
|
|
43
|
+
const subscription = await (0, interface_database_decorators_1.GetModel)(db_1.TenantSubscriptionModel, tenantId).findOne();
|
|
44
|
+
const context = (0, billing_window_1.clipInvoiceUsageWindow)({
|
|
45
|
+
tenantId,
|
|
46
|
+
invoiceId: invoice.id,
|
|
47
|
+
currency: invoice.currency,
|
|
48
|
+
periodStart: stripeSecondsToDate(invoice.period_start),
|
|
49
|
+
periodEnd: stripeSecondsToDate(invoice.period_end),
|
|
50
|
+
}, subscription, typeof invoice.subscription === "string"
|
|
51
|
+
? invoice.subscription
|
|
52
|
+
: (invoice.subscription?.id ?? null));
|
|
53
|
+
return context ? { customerId, context } : null;
|
|
54
|
+
}
|
|
55
|
+
async function fetchInjectedLineKeys(invoiceId) {
|
|
56
|
+
const stripe = (0, client_1.getStripeClient)();
|
|
57
|
+
const items = await stripe.invoiceItems
|
|
58
|
+
.list({ invoice: invoiceId, limit: INVOICE_ITEMS_PAGE_SIZE })
|
|
59
|
+
.autoPagingToArray({ limit: INVOICE_ITEMS_HARD_CAP });
|
|
60
|
+
const keys = items
|
|
61
|
+
.map((item) => item.metadata?.[LINE_KEY_METADATA])
|
|
62
|
+
.filter((key) => typeof key === "string");
|
|
63
|
+
return new Set(keys);
|
|
64
|
+
}
|
|
65
|
+
async function resolveProviderLineItems(provider, context) {
|
|
66
|
+
try {
|
|
67
|
+
const lineItems = await provider.resolve(context);
|
|
68
|
+
return {
|
|
69
|
+
lineItems: Array.isArray(lineItems) ? lineItems : [],
|
|
70
|
+
failures: 0,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
logging_1.Logging.Error(`${LOG_PREFIX} provider '${provider.id}' failed on invoice ${context.invoiceId}`, error);
|
|
75
|
+
return { lineItems: [], failures: 1 };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function reportSkippedLineItems(providerId, invoiceId, skipped) {
|
|
79
|
+
for (const line of skipped) {
|
|
80
|
+
if (!REPORTED_SKIP_REASONS.has(line.reason))
|
|
81
|
+
continue;
|
|
82
|
+
logging_1.Logging.Warn(`${LOG_PREFIX} provider '${providerId}' returned an unusable line '${line.lineKey}' on invoice ${invoiceId} (${line.reason})`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function buildLineItemMetadata(providerId, prepared) {
|
|
86
|
+
const metadata = {
|
|
87
|
+
...prepared.item.metadata,
|
|
88
|
+
};
|
|
89
|
+
if (prepared.item.quantity !== undefined) {
|
|
90
|
+
metadata[LINE_QUANTITY_METADATA] = String(prepared.item.quantity);
|
|
91
|
+
}
|
|
92
|
+
if (prepared.item.unit !== undefined) {
|
|
93
|
+
metadata[LINE_UNIT_METADATA] = prepared.item.unit;
|
|
94
|
+
}
|
|
95
|
+
metadata[LINE_PROVIDER_METADATA] = providerId;
|
|
96
|
+
metadata[LINE_KEY_METADATA] = prepared.lineKey;
|
|
97
|
+
return metadata;
|
|
98
|
+
}
|
|
99
|
+
async function createInvoiceLineItem(providerId, target, prepared) {
|
|
100
|
+
const { context } = target;
|
|
101
|
+
const stripe = (0, client_1.getStripeClient)();
|
|
102
|
+
await stripe.invoiceItems.create({
|
|
103
|
+
customer: target.customerId,
|
|
104
|
+
invoice: context.invoiceId,
|
|
105
|
+
currency: context.currency,
|
|
106
|
+
amount: prepared.item.amountCents,
|
|
107
|
+
description: prepared.item.description,
|
|
108
|
+
period: {
|
|
109
|
+
start: toStripeSeconds(context.periodStart),
|
|
110
|
+
end: toStripeSeconds(context.periodEnd),
|
|
111
|
+
},
|
|
112
|
+
metadata: buildLineItemMetadata(providerId, prepared),
|
|
113
|
+
}, {
|
|
114
|
+
idempotencyKey: `${IDEMPOTENCY_KEY_PREFIX}:${context.invoiceId}:${prepared.lineKey}`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function delay(milliseconds) {
|
|
118
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
119
|
+
}
|
|
120
|
+
async function createInvoiceLineItemWithRetries(providerId, target, prepared) {
|
|
121
|
+
for (let attempt = 1; attempt <= CREATE_ATTEMPTS; attempt += 1) {
|
|
122
|
+
try {
|
|
123
|
+
await createInvoiceLineItem(providerId, target, prepared);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
if (attempt === CREATE_ATTEMPTS)
|
|
128
|
+
throw error;
|
|
129
|
+
logging_1.Logging.Warn(`${LOG_PREFIX} retrying line '${prepared.lineKey}' on invoice ${target.context.invoiceId}`, error);
|
|
130
|
+
await delay(RETRY_DELAY_MS);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function injectProviderLineItems(provider, target, injectedKeys) {
|
|
135
|
+
const { context } = target;
|
|
136
|
+
const resolution = await resolveProviderLineItems(provider, context);
|
|
137
|
+
const selection = (0, invoice_line_items_1.selectInvoiceLineItemsToCreate)(provider.id, resolution.lineItems, injectedKeys);
|
|
138
|
+
reportSkippedLineItems(provider.id, context.invoiceId, selection.skipped);
|
|
139
|
+
const invalidLines = selection.skipped.filter((line) => line.reason === "invalid").length;
|
|
140
|
+
let failures = resolution.failures + invalidLines;
|
|
141
|
+
for (const prepared of selection.accepted) {
|
|
142
|
+
try {
|
|
143
|
+
await createInvoiceLineItemWithRetries(provider.id, target, prepared);
|
|
144
|
+
injectedKeys.add(prepared.lineKey);
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
failures += 1;
|
|
148
|
+
logging_1.Logging.Error(`${LOG_PREFIX} could not invoice line '${prepared.lineKey}' on invoice ${context.invoiceId}`, error);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return failures;
|
|
152
|
+
}
|
|
153
|
+
async function injectProvidedInvoiceLineItems(invoice, tenantId, customerId) {
|
|
154
|
+
const providers = (0, invoice_line_items_2.getInvoiceLineItemsProviders)();
|
|
155
|
+
if (providers.length === 0)
|
|
156
|
+
return;
|
|
157
|
+
if (!canInjectIntoInvoice(invoice))
|
|
158
|
+
return;
|
|
159
|
+
const target = await buildInjectionTarget(invoice, tenantId, customerId);
|
|
160
|
+
if (!target)
|
|
161
|
+
return;
|
|
162
|
+
const injectedKeys = await fetchInjectedLineKeys(target.context.invoiceId);
|
|
163
|
+
let failures = 0;
|
|
164
|
+
for (const provider of providers) {
|
|
165
|
+
failures += await injectProviderLineItems(provider, target, injectedKeys);
|
|
166
|
+
}
|
|
167
|
+
if (failures > 0) {
|
|
168
|
+
throw new Error(`${failures} usage line(s) could not be invoiced on ${target.context.invoiceId}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=injection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injection.js","sourceRoot":"","sources":["../../src/invoice-line-items/injection.ts"],"names":[],"mappings":";;AAuPA,wEAoBC;AA3QD,gEAA6D;AAC7D,6FAAqE;AASrE,0FAAmG;AAEnG,uFAA8F;AAC9F,6CAAmD;AACnD,8BAAgD;AAChD,qDAA0D;AAE1D,MAAM,iBAAiB,GAAG,aAAa,CAAC;AACxC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAClD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAClD,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAC1C,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,4BAA4B,GAAG,oBAAoB,CAAC;AAC1D,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,UAAU,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;QAAE,OAAO;IACnC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;QAAE,OAAO;IAC3C,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,MAAM,YAAY,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3E,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,QAAQ,IAAI,MAAM,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,GAAG,QAAQ,2CAA2C,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CACjF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./recipients"), exports);
|
|
18
|
+
__exportStar(require("./subjects"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NotificationSubjectInfo } from "./subjects";
|
|
2
|
+
export interface SaasNotificationPayload {
|
|
3
|
+
icon: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
linkTo?: string;
|
|
7
|
+
eventId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveTenantMemberRecipients(tenantId: string): Promise<string[]>;
|
|
10
|
+
export declare function resolveTenantOwners(tenantId: string): Promise<string[]>;
|
|
11
|
+
export declare function notifyTenantMembers(tenantId: string, subject: NotificationSubjectInfo, payload: SaasNotificationPayload): Promise<void>;
|
|
12
|
+
export declare function notifyTenantOwners(tenantId: string, subject: NotificationSubjectInfo, payload: SaasNotificationPayload): Promise<void>;
|
|
13
|
+
export declare function resolvePlatformOwners(excludeUserId?: string): Promise<string[]>;
|
|
14
|
+
export declare function notifyAllPlatformOwners(subject: NotificationSubjectInfo, payload: SaasNotificationPayload, excludeUserId?: string): Promise<void>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveTenantMemberRecipients = resolveTenantMemberRecipients;
|
|
4
|
+
exports.resolveTenantOwners = resolveTenantOwners;
|
|
5
|
+
exports.notifyTenantMembers = notifyTenantMembers;
|
|
6
|
+
exports.notifyTenantOwners = notifyTenantOwners;
|
|
7
|
+
exports.resolvePlatformOwners = resolvePlatformOwners;
|
|
8
|
+
exports.notifyAllPlatformOwners = notifyAllPlatformOwners;
|
|
9
|
+
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
10
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
11
|
+
const db_1 = require("@antelopejs/interface-dms/db");
|
|
12
|
+
const db_2 = require("@antelopejs/interface-dms/auth/db");
|
|
13
|
+
const notifications_1 = require("@antelopejs/interface-dms/notifications");
|
|
14
|
+
async function sendIdempotently(recipients, subject, payload, eventId) {
|
|
15
|
+
const builder = (0, notifications_1.Notification)()
|
|
16
|
+
.icon(payload.icon)
|
|
17
|
+
.title(payload.title)
|
|
18
|
+
.description(payload.description)
|
|
19
|
+
.subject(subject);
|
|
20
|
+
if (payload.linkTo)
|
|
21
|
+
builder.linkTo(payload.linkTo);
|
|
22
|
+
await builder.build().toUsersIdempotently(recipients, eventId);
|
|
23
|
+
}
|
|
24
|
+
async function sendOne(userId, subject, payload) {
|
|
25
|
+
const base = (0, notifications_1.Notification)()
|
|
26
|
+
.icon(payload.icon)
|
|
27
|
+
.title(payload.title)
|
|
28
|
+
.description(payload.description)
|
|
29
|
+
.subject(subject);
|
|
30
|
+
if (payload.linkTo) {
|
|
31
|
+
await base.linkTo(payload.linkTo).build().toUser(userId);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
await base.build().toUser(userId);
|
|
35
|
+
}
|
|
36
|
+
async function sendAll(recipients, subject, payload) {
|
|
37
|
+
const results = await Promise.allSettled(recipients.map((userId) => sendOne(userId, subject, payload)));
|
|
38
|
+
const failures = results.flatMap((result) => result.status === "rejected" ? [result.reason] : []);
|
|
39
|
+
if (failures.length > 0) {
|
|
40
|
+
logging_1.Logging.Error(`[dms-saas:notifications] ${failures.length} delivery attempt(s) failed`, new AggregateError(failures));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function deliverNotification(resolveRecipients, subject, payload) {
|
|
44
|
+
if (payload.eventId !== undefined) {
|
|
45
|
+
await sendIdempotently(await resolveRecipients(), subject, payload, payload.eventId);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
await sendAll(await resolveRecipients(), subject, payload);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
logging_1.Logging.Error("[dms-saas:notifications] recipient resolution failed", error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function resolveTenantMemberRecipients(tenantId) {
|
|
56
|
+
const memberModel = (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId);
|
|
57
|
+
const members = await memberModel.listAll();
|
|
58
|
+
return members.map((m) => m.userId);
|
|
59
|
+
}
|
|
60
|
+
async function resolveTenantOwners(tenantId) {
|
|
61
|
+
const memberModel = (0, interface_database_decorators_1.GetModel)(db_1.TenantMemberModel, tenantId);
|
|
62
|
+
const owners = await memberModel.listOwners();
|
|
63
|
+
return owners.map((m) => m.userId);
|
|
64
|
+
}
|
|
65
|
+
async function notifyTenantMembers(tenantId, subject, payload) {
|
|
66
|
+
await deliverNotification(() => resolveTenantMemberRecipients(tenantId), subject, payload);
|
|
67
|
+
}
|
|
68
|
+
async function notifyTenantOwners(tenantId, subject, payload) {
|
|
69
|
+
await deliverNotification(() => resolveTenantOwners(tenantId), subject, payload);
|
|
70
|
+
}
|
|
71
|
+
async function resolvePlatformOwners(excludeUserId) {
|
|
72
|
+
const userModel = (0, interface_database_decorators_1.GetModel)(db_2.UserModel);
|
|
73
|
+
const rows = await userModel.table
|
|
74
|
+
.filter((user) => user.key("owner").eq(true))
|
|
75
|
+
.run();
|
|
76
|
+
const ids = [];
|
|
77
|
+
for (const row of rows) {
|
|
78
|
+
const user = db_2.UserModel.fromDatabase(row);
|
|
79
|
+
if (user && user._id !== excludeUserId)
|
|
80
|
+
ids.push(user._id);
|
|
81
|
+
}
|
|
82
|
+
return ids;
|
|
83
|
+
}
|
|
84
|
+
async function notifyAllPlatformOwners(subject, payload, excludeUserId) {
|
|
85
|
+
await deliverNotification(() => resolvePlatformOwners(excludeUserId), subject, payload);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=recipients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipients.js","sourceRoot":"","sources":["../../src/notifications/recipients.ts"],"names":[],"mappings":";;AA6FA,sEAMC;AAED,kDAIC;AAOD,kDAUC;AAGD,gDAUC;AAED,sDAaC;AAED,0DAUC;AAlKD,gEAA6D;AAC7D,6FAAqE;AACrE,qDAAiE;AACjE,0DAA8D;AAC9D,2EAAuE;AAYvE,KAAK,UAAU,gBAAgB,CAC7B,UAAoB,EACpB,OAAgC,EAChC,OAAgC,EAChC,OAAe;IAEf,MAAM,OAAO,GAAG,IAAA,4BAAY,GAAE;SAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;SAClB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;SACpB,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC;SAChC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,IAAI,OAAO,CAAC,MAAM;QAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,KAAK,UAAU,OAAO,CACpB,MAAc,EACd,OAAgC,EAChC,OAAgC;IAEhC,MAAM,IAAI,GAAG,IAAA,4BAAY,GAAE;SACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;SAClB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;SACpB,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC;SAChC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO;IACT,CAAC;IACD,MA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AAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,cAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,aAAa;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,OAAgC,EAChC,OAAgC,EAChC,aAAsB;IAEtB,MAAM,mBAAmB,CACvB,GAAG,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAC1C,OAAO,EACP,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NotificationSubject } from "@antelopejs/interface-dms/notifications";
|
|
2
|
+
export type NotificationSubjectInfo = ReturnType<typeof NotificationSubject>;
|
|
3
|
+
export declare const SaasCategory: import("@antelopejs/interface-dms/dist/notifications/types").NotificationCategoryInfo;
|
|
4
|
+
export declare const planMigratedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
5
|
+
export declare const trialEndingSoonSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
6
|
+
export declare const trialEndedBlockedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
7
|
+
export declare const paymentFailedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
8
|
+
export declare const workspaceSuspendedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
9
|
+
export declare const freeWorkspaceExpiredSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
10
|
+
export declare const freeWorkspaceEndingSoonSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
11
|
+
export declare const subscriptionCancelledSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
12
|
+
export declare const creditNoteIssuedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
13
|
+
export declare const refundProcessedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
14
|
+
export declare const platformOwnerAddedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
15
|
+
export declare const platformOwnerRemovedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
16
|
+
export declare const workspaceReactivatedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
17
|
+
export declare const seatOverageSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
18
|
+
export declare const supportNewMessageSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
19
|
+
export declare const supportStatusChangedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
20
|
+
export declare const complimentaryAccessGrantedSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
21
|
+
export declare const automationNotificationSubject: import("@antelopejs/interface-dms/dist/notifications/types").NotificationSubjectInfo;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.automationNotificationSubject = exports.complimentaryAccessGrantedSubject = exports.supportStatusChangedSubject = exports.supportNewMessageSubject = exports.seatOverageSubject = exports.workspaceReactivatedSubject = exports.platformOwnerRemovedSubject = exports.platformOwnerAddedSubject = exports.refundProcessedSubject = exports.creditNoteIssuedSubject = exports.subscriptionCancelledSubject = exports.freeWorkspaceEndingSoonSubject = exports.freeWorkspaceExpiredSubject = exports.workspaceSuspendedSubject = exports.paymentFailedSubject = exports.trialEndedBlockedSubject = exports.trialEndingSoonSubject = exports.planMigratedSubject = exports.SaasCategory = void 0;
|
|
4
|
+
const notifications_1 = require("@antelopejs/interface-dms/notifications");
|
|
5
|
+
exports.SaasCategory = (0, notifications_1.NotificationCategory)("saas", {
|
|
6
|
+
labelKey: "saas.notifications.category.label",
|
|
7
|
+
descriptionKey: "saas.notifications.category.description",
|
|
8
|
+
icon: "i-ph-buildings",
|
|
9
|
+
togglePermission: "default",
|
|
10
|
+
});
|
|
11
|
+
const SUBJECT_KEYS = {
|
|
12
|
+
planMigrated: "saas.notifications.subjects.plan_migrated",
|
|
13
|
+
trialEndingSoon: "saas.notifications.subjects.trial_ending_soon",
|
|
14
|
+
trialEndedBlocked: "saas.notifications.subjects.trial_ended_blocked",
|
|
15
|
+
paymentFailed: "saas.notifications.subjects.payment_failed",
|
|
16
|
+
workspaceSuspended: "saas.notifications.subjects.workspace_suspended",
|
|
17
|
+
subscriptionCancelled: "saas.notifications.subjects.subscription_cancelled",
|
|
18
|
+
creditNoteIssued: "saas.notifications.subjects.credit_note_issued",
|
|
19
|
+
refundProcessed: "saas.notifications.subjects.refund_processed",
|
|
20
|
+
platformOwnerAdded: "saas.notifications.subjects.platform_owner_added",
|
|
21
|
+
platformOwnerRemoved: "saas.notifications.subjects.platform_owner_removed",
|
|
22
|
+
freeWorkspaceExpired: "saas.notifications.subjects.free_workspace_expired",
|
|
23
|
+
freeWorkspaceEndingSoon: "saas.notifications.subjects.free_workspace_ending_soon",
|
|
24
|
+
workspaceReactivated: "saas.notifications.subjects.workspace_reactivated",
|
|
25
|
+
seatOverage: "saas.notifications.subjects.seat_overage",
|
|
26
|
+
supportNewMessage: "saas.notifications.subjects.support_new_message",
|
|
27
|
+
supportStatusChanged: "saas.notifications.subjects.support_status_changed",
|
|
28
|
+
complimentaryAccessGranted: "saas.notifications.subjects.complimentary_access_granted",
|
|
29
|
+
automation: "saas.notifications.subjects.automation",
|
|
30
|
+
};
|
|
31
|
+
exports.planMigratedSubject = (0, notifications_1.NotificationSubject)("saas.plan_migrated", {
|
|
32
|
+
category: exports.SaasCategory,
|
|
33
|
+
labelKey: SUBJECT_KEYS.planMigrated,
|
|
34
|
+
togglePermission: "default",
|
|
35
|
+
});
|
|
36
|
+
exports.trialEndingSoonSubject = (0, notifications_1.NotificationSubject)("saas.trial_ending_soon", {
|
|
37
|
+
category: exports.SaasCategory,
|
|
38
|
+
labelKey: SUBJECT_KEYS.trialEndingSoon,
|
|
39
|
+
togglePermission: "default",
|
|
40
|
+
});
|
|
41
|
+
exports.trialEndedBlockedSubject = (0, notifications_1.NotificationSubject)("saas.trial_ended_blocked", {
|
|
42
|
+
category: exports.SaasCategory,
|
|
43
|
+
labelKey: SUBJECT_KEYS.trialEndedBlocked,
|
|
44
|
+
togglePermission: "forbidden",
|
|
45
|
+
});
|
|
46
|
+
exports.paymentFailedSubject = (0, notifications_1.NotificationSubject)("saas.payment_failed", {
|
|
47
|
+
category: exports.SaasCategory,
|
|
48
|
+
labelKey: SUBJECT_KEYS.paymentFailed,
|
|
49
|
+
togglePermission: "forbidden",
|
|
50
|
+
});
|
|
51
|
+
exports.workspaceSuspendedSubject = (0, notifications_1.NotificationSubject)("saas.workspace_suspended", {
|
|
52
|
+
category: exports.SaasCategory,
|
|
53
|
+
labelKey: SUBJECT_KEYS.workspaceSuspended,
|
|
54
|
+
togglePermission: "forbidden",
|
|
55
|
+
});
|
|
56
|
+
exports.freeWorkspaceExpiredSubject = (0, notifications_1.NotificationSubject)("saas.free_workspace_expired", {
|
|
57
|
+
category: exports.SaasCategory,
|
|
58
|
+
labelKey: SUBJECT_KEYS.freeWorkspaceExpired,
|
|
59
|
+
togglePermission: "forbidden",
|
|
60
|
+
});
|
|
61
|
+
exports.freeWorkspaceEndingSoonSubject = (0, notifications_1.NotificationSubject)("saas.free_workspace_ending_soon", {
|
|
62
|
+
category: exports.SaasCategory,
|
|
63
|
+
labelKey: SUBJECT_KEYS.freeWorkspaceEndingSoon,
|
|
64
|
+
togglePermission: "default",
|
|
65
|
+
});
|
|
66
|
+
exports.subscriptionCancelledSubject = (0, notifications_1.NotificationSubject)("saas.subscription_cancelled", {
|
|
67
|
+
category: exports.SaasCategory,
|
|
68
|
+
labelKey: SUBJECT_KEYS.subscriptionCancelled,
|
|
69
|
+
togglePermission: "forbidden",
|
|
70
|
+
});
|
|
71
|
+
exports.creditNoteIssuedSubject = (0, notifications_1.NotificationSubject)("saas.credit_note_issued", {
|
|
72
|
+
category: exports.SaasCategory,
|
|
73
|
+
labelKey: SUBJECT_KEYS.creditNoteIssued,
|
|
74
|
+
togglePermission: "default",
|
|
75
|
+
});
|
|
76
|
+
exports.refundProcessedSubject = (0, notifications_1.NotificationSubject)("saas.refund_processed", {
|
|
77
|
+
category: exports.SaasCategory,
|
|
78
|
+
labelKey: SUBJECT_KEYS.refundProcessed,
|
|
79
|
+
togglePermission: "default",
|
|
80
|
+
});
|
|
81
|
+
exports.platformOwnerAddedSubject = (0, notifications_1.NotificationSubject)("saas.platform_owner_added", {
|
|
82
|
+
category: exports.SaasCategory,
|
|
83
|
+
labelKey: SUBJECT_KEYS.platformOwnerAdded,
|
|
84
|
+
togglePermission: "default",
|
|
85
|
+
});
|
|
86
|
+
exports.platformOwnerRemovedSubject = (0, notifications_1.NotificationSubject)("saas.platform_owner_removed", {
|
|
87
|
+
category: exports.SaasCategory,
|
|
88
|
+
labelKey: SUBJECT_KEYS.platformOwnerRemoved,
|
|
89
|
+
togglePermission: "default",
|
|
90
|
+
});
|
|
91
|
+
exports.workspaceReactivatedSubject = (0, notifications_1.NotificationSubject)("saas.workspace_reactivated", {
|
|
92
|
+
category: exports.SaasCategory,
|
|
93
|
+
labelKey: SUBJECT_KEYS.workspaceReactivated,
|
|
94
|
+
togglePermission: "default",
|
|
95
|
+
});
|
|
96
|
+
exports.seatOverageSubject = (0, notifications_1.NotificationSubject)("saas.seat_overage", {
|
|
97
|
+
category: exports.SaasCategory,
|
|
98
|
+
labelKey: SUBJECT_KEYS.seatOverage,
|
|
99
|
+
togglePermission: "default",
|
|
100
|
+
});
|
|
101
|
+
exports.supportNewMessageSubject = (0, notifications_1.NotificationSubject)("saas.support_new_message", {
|
|
102
|
+
category: exports.SaasCategory,
|
|
103
|
+
labelKey: SUBJECT_KEYS.supportNewMessage,
|
|
104
|
+
togglePermission: "default",
|
|
105
|
+
});
|
|
106
|
+
exports.supportStatusChangedSubject = (0, notifications_1.NotificationSubject)("saas.support_status_changed", {
|
|
107
|
+
category: exports.SaasCategory,
|
|
108
|
+
labelKey: SUBJECT_KEYS.supportStatusChanged,
|
|
109
|
+
togglePermission: "default",
|
|
110
|
+
});
|
|
111
|
+
exports.complimentaryAccessGrantedSubject = (0, notifications_1.NotificationSubject)("saas.complimentary_access_granted", {
|
|
112
|
+
category: exports.SaasCategory,
|
|
113
|
+
labelKey: SUBJECT_KEYS.complimentaryAccessGranted,
|
|
114
|
+
togglePermission: "default",
|
|
115
|
+
});
|
|
116
|
+
exports.automationNotificationSubject = (0, notifications_1.NotificationSubject)("saas.automation", {
|
|
117
|
+
category: exports.SaasCategory,
|
|
118
|
+
labelKey: SUBJECT_KEYS.automation,
|
|
119
|
+
togglePermission: "default",
|
|
120
|
+
});
|
|
121
|
+
//# sourceMappingURL=subjects.js.map
|