@baruk/core 0.1.0 → 0.3.0
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/CHANGELOG.md +59 -0
- package/dist/auth/password-reset.d.ts.map +1 -1
- package/dist/auth/password-reset.js +2 -4
- package/dist/auth/password-reset.js.map +1 -1
- package/dist/auth/password.d.ts +2 -18
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password.js +12 -51
- package/dist/auth/password.js.map +1 -1
- package/dist/auth/service.d.ts +0 -12
- package/dist/auth/service.d.ts.map +1 -1
- package/dist/auth/service.js +3 -36
- package/dist/auth/service.js.map +1 -1
- package/dist/auth/session-token.d.ts +5 -2
- package/dist/auth/session-token.d.ts.map +1 -1
- package/dist/auth/session-token.js +7 -12
- package/dist/auth/session-token.js.map +1 -1
- package/dist/billing/dunning.d.ts +33 -0
- package/dist/billing/dunning.d.ts.map +1 -0
- package/dist/billing/dunning.js +49 -0
- package/dist/billing/dunning.js.map +1 -0
- package/dist/billing/provider/asaas.d.ts +15 -0
- package/dist/billing/provider/asaas.d.ts.map +1 -0
- package/dist/billing/provider/asaas.js +121 -0
- package/dist/billing/provider/asaas.js.map +1 -0
- package/dist/billing/provider/manual.d.ts +14 -0
- package/dist/billing/provider/manual.d.ts.map +1 -0
- package/dist/billing/provider/manual.js +24 -0
- package/dist/billing/provider/manual.js.map +1 -0
- package/dist/billing/provider/registry.d.ts +12 -0
- package/dist/billing/provider/registry.d.ts.map +1 -0
- package/dist/billing/provider/registry.js +22 -0
- package/dist/billing/provider/registry.js.map +1 -0
- package/dist/billing/provider/types.d.ts +76 -0
- package/dist/billing/provider/types.d.ts.map +1 -0
- package/dist/billing/provider/types.js +9 -0
- package/dist/billing/provider/types.js.map +1 -0
- package/dist/billing/receivable.d.ts +108 -0
- package/dist/billing/receivable.d.ts.map +1 -0
- package/dist/billing/receivable.js +2 -0
- package/dist/billing/receivable.js.map +1 -0
- package/dist/billing/repository.d.ts +97 -0
- package/dist/billing/repository.d.ts.map +1 -0
- package/dist/billing/repository.js +167 -0
- package/dist/billing/repository.js.map +1 -0
- package/dist/cjs/audit/audit.js +31 -0
- package/dist/cjs/audit/audit.js.map +1 -0
- package/dist/cjs/audit/repository.js +32 -0
- package/dist/cjs/audit/repository.js.map +1 -0
- package/dist/cjs/auth/password-reset.js +58 -0
- package/dist/cjs/auth/password-reset.js.map +1 -0
- package/dist/cjs/auth/password.js +32 -0
- package/dist/cjs/auth/password.js.map +1 -0
- package/dist/cjs/auth/service.js +191 -0
- package/dist/cjs/auth/service.js.map +1 -0
- package/dist/cjs/auth/session-token.js +18 -0
- package/dist/cjs/auth/session-token.js.map +1 -0
- package/dist/cjs/billing/dunning.js +54 -0
- package/dist/cjs/billing/dunning.js.map +1 -0
- package/dist/cjs/billing/provider/asaas.js +125 -0
- package/dist/cjs/billing/provider/asaas.js.map +1 -0
- package/dist/cjs/billing/provider/manual.js +28 -0
- package/dist/cjs/billing/provider/manual.js.map +1 -0
- package/dist/cjs/billing/provider/registry.js +27 -0
- package/dist/cjs/billing/provider/registry.js.map +1 -0
- package/dist/cjs/billing/provider/types.js +10 -0
- package/dist/cjs/billing/provider/types.js.map +1 -0
- package/dist/cjs/billing/receivable.js +3 -0
- package/dist/cjs/billing/receivable.js.map +1 -0
- package/dist/cjs/billing/repository.js +180 -0
- package/dist/cjs/billing/repository.js.map +1 -0
- package/dist/cjs/clients/repository.js +123 -0
- package/dist/cjs/clients/repository.js.map +1 -0
- package/dist/cjs/commercial-catalog/catalog.js +108 -0
- package/dist/cjs/commercial-catalog/catalog.js.map +1 -0
- package/dist/cjs/commercial-catalog/consumption-contracts.js +10 -0
- package/dist/cjs/commercial-catalog/consumption-contracts.js.map +1 -0
- package/dist/cjs/commercial-catalog/coupon.js +63 -0
- package/dist/cjs/commercial-catalog/coupon.js.map +1 -0
- package/dist/cjs/commercial-catalog/index.js +16 -0
- package/dist/cjs/commercial-catalog/index.js.map +1 -0
- package/dist/cjs/commercial-catalog/offer-application.js +53 -0
- package/dist/cjs/commercial-catalog/offer-application.js.map +1 -0
- package/dist/cjs/commercial-catalog/types.js +26 -0
- package/dist/cjs/commercial-catalog/types.js.map +1 -0
- package/dist/cjs/crm/repository.js +195 -0
- package/dist/cjs/crm/repository.js.map +1 -0
- package/dist/cjs/dashboard/repository.js +39 -0
- package/dist/cjs/dashboard/repository.js.map +1 -0
- package/dist/cjs/db/client.js +27 -0
- package/dist/cjs/db/client.js.map +1 -0
- package/dist/cjs/db/context.js +43 -0
- package/dist/cjs/db/context.js.map +1 -0
- package/dist/cjs/db/load-env.js +47 -0
- package/dist/cjs/db/load-env.js.map +1 -0
- package/dist/cjs/db/seed.js +69 -0
- package/dist/cjs/db/seed.js.map +1 -0
- package/dist/cjs/entitlements/decision.js +203 -0
- package/dist/cjs/entitlements/decision.js.map +1 -0
- package/dist/cjs/entitlements/derive.js +46 -0
- package/dist/cjs/entitlements/derive.js.map +1 -0
- package/dist/cjs/entitlements/index.js +23 -0
- package/dist/cjs/entitlements/index.js.map +1 -0
- package/dist/cjs/entitlements/sources.js +60 -0
- package/dist/cjs/entitlements/sources.js.map +1 -0
- package/dist/cjs/entitlements/standing.js +42 -0
- package/dist/cjs/entitlements/standing.js.map +1 -0
- package/dist/cjs/entitlements/types.js +16 -0
- package/dist/cjs/entitlements/types.js.map +1 -0
- package/dist/cjs/import/clients-import.js +147 -0
- package/dist/cjs/import/clients-import.js.map +1 -0
- package/dist/cjs/index.js +335 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/mail/dedup-store.js +56 -0
- package/dist/cjs/mail/dedup-store.js.map +1 -0
- package/dist/cjs/mail/index.js +24 -0
- package/dist/cjs/mail/index.js.map +1 -0
- package/dist/cjs/mail/provider.js +251 -0
- package/dist/cjs/mail/provider.js.map +1 -0
- package/dist/cjs/mail/resend-client.js +103 -0
- package/dist/cjs/mail/resend-client.js.map +1 -0
- package/dist/cjs/mail/resend.js +21 -0
- package/dist/cjs/mail/resend.js.map +1 -0
- package/dist/cjs/mail/sanitize.js +56 -0
- package/dist/cjs/mail/sanitize.js.map +1 -0
- package/dist/cjs/mail/sender-resolver.js +15 -0
- package/dist/cjs/mail/sender-resolver.js.map +1 -0
- package/dist/cjs/mail/template-renderer.js +21 -0
- package/dist/cjs/mail/template-renderer.js.map +1 -0
- package/dist/cjs/mail/types.js +38 -0
- package/dist/cjs/mail/types.js.map +1 -0
- package/dist/cjs/notifications/repository.js +49 -0
- package/dist/cjs/notifications/repository.js.map +1 -0
- package/dist/cjs/onboarding/domain.js +370 -0
- package/dist/cjs/onboarding/domain.js.map +1 -0
- package/dist/cjs/onboarding/interaction-review.js +425 -0
- package/dist/cjs/onboarding/interaction-review.js.map +1 -0
- package/dist/cjs/onboarding/persistence.js +444 -0
- package/dist/cjs/onboarding/persistence.js.map +1 -0
- package/dist/cjs/onboarding/portal-actions.js +157 -0
- package/dist/cjs/onboarding/portal-actions.js.map +1 -0
- package/dist/cjs/onboarding/portal.js +177 -0
- package/dist/cjs/onboarding/portal.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/portal/repository.js +37 -0
- package/dist/cjs/portal/repository.js.map +1 -0
- package/dist/cjs/pricing-engine/bundle.js +49 -0
- package/dist/cjs/pricing-engine/bundle.js.map +1 -0
- package/dist/cjs/pricing-engine/errors.js +48 -0
- package/dist/cjs/pricing-engine/errors.js.map +1 -0
- package/dist/cjs/pricing-engine/index.js +30 -0
- package/dist/cjs/pricing-engine/index.js.map +1 -0
- package/dist/cjs/pricing-engine/money.js +69 -0
- package/dist/cjs/pricing-engine/money.js.map +1 -0
- package/dist/cjs/pricing-engine/pipeline.js +330 -0
- package/dist/cjs/pricing-engine/pipeline.js.map +1 -0
- package/dist/cjs/pricing-engine/proration.js +53 -0
- package/dist/cjs/pricing-engine/proration.js.map +1 -0
- package/dist/cjs/pricing-engine/shadow.js +58 -0
- package/dist/cjs/pricing-engine/shadow.js.map +1 -0
- package/dist/cjs/pricing-engine/types.js +34 -0
- package/dist/cjs/pricing-engine/types.js.map +1 -0
- package/dist/cjs/products/catalog.js +10 -0
- package/dist/cjs/products/catalog.js.map +1 -0
- package/dist/cjs/products/repository.js +61 -0
- package/dist/cjs/products/repository.js.map +1 -0
- package/dist/cjs/rbac/authorize.js +36 -0
- package/dist/cjs/rbac/authorize.js.map +1 -0
- package/dist/cjs/rbac/catalog.js +455 -0
- package/dist/cjs/rbac/catalog.js.map +1 -0
- package/dist/cjs/requests/repository.js +114 -0
- package/dist/cjs/requests/repository.js.map +1 -0
- package/dist/cjs/subscription-billing/dunning.js +26 -0
- package/dist/cjs/subscription-billing/dunning.js.map +1 -0
- package/dist/cjs/subscription-billing/events.js +45 -0
- package/dist/cjs/subscription-billing/events.js.map +1 -0
- package/dist/cjs/subscription-billing/index.js +62 -0
- package/dist/cjs/subscription-billing/index.js.map +1 -0
- package/dist/cjs/subscription-billing/plans.js +88 -0
- package/dist/cjs/subscription-billing/plans.js.map +1 -0
- package/dist/cjs/subscription-billing/product-config.js +54 -0
- package/dist/cjs/subscription-billing/product-config.js.map +1 -0
- package/dist/cjs/subscription-billing/provider/asaas.js +233 -0
- package/dist/cjs/subscription-billing/provider/asaas.js.map +1 -0
- package/dist/cjs/subscription-billing/provider/disabled.js +46 -0
- package/dist/cjs/subscription-billing/provider/disabled.js.map +1 -0
- package/dist/cjs/subscription-billing/provider/registry.js +29 -0
- package/dist/cjs/subscription-billing/provider/registry.js.map +1 -0
- package/dist/cjs/subscription-billing/reconcile.js +198 -0
- package/dist/cjs/subscription-billing/reconcile.js.map +1 -0
- package/dist/cjs/subscription-billing/repository.js +359 -0
- package/dist/cjs/subscription-billing/repository.js.map +1 -0
- package/dist/cjs/subscription-billing/service.js +838 -0
- package/dist/cjs/subscription-billing/service.js.map +1 -0
- package/dist/cjs/subscription-billing/types.js +28 -0
- package/dist/cjs/subscription-billing/types.js.map +1 -0
- package/dist/cjs/tenancy/provisioning.js +126 -0
- package/dist/cjs/tenancy/provisioning.js.map +1 -0
- package/dist/cjs/users/repository.js +83 -0
- package/dist/cjs/users/repository.js.map +1 -0
- package/dist/cjs/vault/crypto.js +94 -0
- package/dist/cjs/vault/crypto.js.map +1 -0
- package/dist/cjs/vault/repository.js +120 -0
- package/dist/cjs/vault/repository.js.map +1 -0
- package/dist/commercial-catalog/catalog.d.ts +27 -0
- package/dist/commercial-catalog/catalog.d.ts.map +1 -0
- package/dist/commercial-catalog/catalog.js +104 -0
- package/dist/commercial-catalog/catalog.js.map +1 -0
- package/dist/commercial-catalog/consumption-contracts.d.ts +33 -0
- package/dist/commercial-catalog/consumption-contracts.d.ts.map +1 -0
- package/dist/commercial-catalog/consumption-contracts.js +9 -0
- package/dist/commercial-catalog/consumption-contracts.js.map +1 -0
- package/dist/commercial-catalog/coupon.d.ts +43 -0
- package/dist/commercial-catalog/coupon.d.ts.map +1 -0
- package/dist/commercial-catalog/coupon.js +57 -0
- package/dist/commercial-catalog/coupon.js.map +1 -0
- package/dist/commercial-catalog/index.d.ts +10 -0
- package/dist/commercial-catalog/index.d.ts.map +1 -0
- package/dist/commercial-catalog/index.js +5 -0
- package/dist/commercial-catalog/index.js.map +1 -0
- package/dist/commercial-catalog/offer-application.d.ts +39 -0
- package/dist/commercial-catalog/offer-application.d.ts.map +1 -0
- package/dist/commercial-catalog/offer-application.js +50 -0
- package/dist/commercial-catalog/offer-application.js.map +1 -0
- package/dist/commercial-catalog/types.d.ts +175 -0
- package/dist/commercial-catalog/types.d.ts.map +1 -0
- package/dist/commercial-catalog/types.js +23 -0
- package/dist/commercial-catalog/types.js.map +1 -0
- package/dist/crm/repository.d.ts +109 -0
- package/dist/crm/repository.d.ts.map +1 -0
- package/dist/crm/repository.js +181 -0
- package/dist/crm/repository.js.map +1 -0
- package/dist/db/context.d.ts +2 -0
- package/dist/db/context.d.ts.map +1 -1
- package/dist/db/context.js +3 -0
- package/dist/db/context.js.map +1 -1
- package/dist/db/migrate.js +7 -2
- package/dist/db/migrate.js.map +1 -1
- package/dist/db/seed.js +4 -1
- package/dist/db/seed.js.map +1 -1
- package/dist/entitlements/decision.d.ts +86 -0
- package/dist/entitlements/decision.d.ts.map +1 -0
- package/dist/entitlements/decision.js +196 -0
- package/dist/entitlements/decision.js.map +1 -0
- package/dist/entitlements/derive.d.ts +30 -0
- package/dist/entitlements/derive.d.ts.map +1 -0
- package/dist/entitlements/derive.js +42 -0
- package/dist/entitlements/derive.js.map +1 -0
- package/dist/entitlements/index.d.ts +10 -0
- package/dist/entitlements/index.d.ts.map +1 -0
- package/dist/entitlements/index.js +7 -0
- package/dist/entitlements/index.js.map +1 -0
- package/dist/entitlements/sources.d.ts +30 -0
- package/dist/entitlements/sources.d.ts.map +1 -0
- package/dist/entitlements/sources.js +55 -0
- package/dist/entitlements/sources.js.map +1 -0
- package/dist/entitlements/standing.d.ts +22 -0
- package/dist/entitlements/standing.d.ts.map +1 -0
- package/dist/entitlements/standing.js +38 -0
- package/dist/entitlements/standing.js.map +1 -0
- package/dist/entitlements/types.d.ts +26 -0
- package/dist/entitlements/types.d.ts.map +1 -0
- package/dist/entitlements/types.js +15 -0
- package/dist/entitlements/types.js.map +1 -0
- package/dist/index.d.ts +74 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -4
- package/dist/index.js.map +1 -1
- package/dist/mail/dedup-store.d.ts +25 -0
- package/dist/mail/dedup-store.d.ts.map +1 -0
- package/dist/mail/dedup-store.js +51 -0
- package/dist/mail/dedup-store.js.map +1 -0
- package/dist/mail/index.d.ts +10 -0
- package/dist/mail/index.d.ts.map +1 -0
- package/dist/mail/index.js +9 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/provider.d.ts +31 -0
- package/dist/mail/provider.d.ts.map +1 -0
- package/dist/mail/provider.js +248 -0
- package/dist/mail/provider.js.map +1 -0
- package/dist/mail/resend-client.d.ts +16 -0
- package/dist/mail/resend-client.d.ts.map +1 -0
- package/dist/mail/resend-client.js +100 -0
- package/dist/mail/resend-client.js.map +1 -0
- package/dist/mail/resend.d.ts.map +1 -1
- package/dist/mail/resend.js +2 -0
- package/dist/mail/resend.js.map +1 -1
- package/dist/mail/sanitize.d.ts +17 -0
- package/dist/mail/sanitize.d.ts.map +1 -0
- package/dist/mail/sanitize.js +51 -0
- package/dist/mail/sanitize.js.map +1 -0
- package/dist/mail/sender-resolver.d.ts +8 -0
- package/dist/mail/sender-resolver.d.ts.map +1 -0
- package/dist/mail/sender-resolver.js +11 -0
- package/dist/mail/sender-resolver.js.map +1 -0
- package/dist/mail/template-renderer.d.ts +10 -0
- package/dist/mail/template-renderer.d.ts.map +1 -0
- package/dist/mail/template-renderer.js +17 -0
- package/dist/mail/template-renderer.js.map +1 -0
- package/dist/mail/types.d.ts +143 -0
- package/dist/mail/types.d.ts.map +1 -0
- package/dist/mail/types.js +34 -0
- package/dist/mail/types.js.map +1 -0
- package/dist/onboarding/domain.d.ts +146 -0
- package/dist/onboarding/domain.d.ts.map +1 -0
- package/dist/onboarding/domain.js +348 -0
- package/dist/onboarding/domain.js.map +1 -0
- package/dist/onboarding/interaction-review.d.ts +123 -0
- package/dist/onboarding/interaction-review.d.ts.map +1 -0
- package/dist/onboarding/interaction-review.js +413 -0
- package/dist/onboarding/interaction-review.js.map +1 -0
- package/dist/onboarding/persistence.d.ts +106 -0
- package/dist/onboarding/persistence.d.ts.map +1 -0
- package/dist/onboarding/persistence.js +430 -0
- package/dist/onboarding/persistence.js.map +1 -0
- package/dist/onboarding/portal-actions.d.ts +48 -0
- package/dist/onboarding/portal-actions.d.ts.map +1 -0
- package/dist/onboarding/portal-actions.js +153 -0
- package/dist/onboarding/portal-actions.js.map +1 -0
- package/dist/onboarding/portal.d.ts +58 -0
- package/dist/onboarding/portal.d.ts.map +1 -0
- package/dist/onboarding/portal.js +170 -0
- package/dist/onboarding/portal.js.map +1 -0
- package/dist/pricing-engine/bundle.d.ts +22 -0
- package/dist/pricing-engine/bundle.d.ts.map +1 -0
- package/dist/pricing-engine/bundle.js +44 -0
- package/dist/pricing-engine/bundle.js.map +1 -0
- package/dist/pricing-engine/errors.d.ts +32 -0
- package/dist/pricing-engine/errors.d.ts.map +1 -0
- package/dist/pricing-engine/errors.js +44 -0
- package/dist/pricing-engine/errors.js.map +1 -0
- package/dist/pricing-engine/index.d.ts +12 -0
- package/dist/pricing-engine/index.d.ts.map +1 -0
- package/dist/pricing-engine/index.js +8 -0
- package/dist/pricing-engine/index.js.map +1 -0
- package/dist/pricing-engine/money.d.ts +32 -0
- package/dist/pricing-engine/money.d.ts.map +1 -0
- package/dist/pricing-engine/money.js +58 -0
- package/dist/pricing-engine/money.js.map +1 -0
- package/dist/pricing-engine/pipeline.d.ts +3 -0
- package/dist/pricing-engine/pipeline.d.ts.map +1 -0
- package/dist/pricing-engine/pipeline.js +327 -0
- package/dist/pricing-engine/pipeline.js.map +1 -0
- package/dist/pricing-engine/proration.d.ts +3 -0
- package/dist/pricing-engine/proration.d.ts.map +1 -0
- package/dist/pricing-engine/proration.js +50 -0
- package/dist/pricing-engine/proration.js.map +1 -0
- package/dist/pricing-engine/shadow.d.ts +51 -0
- package/dist/pricing-engine/shadow.d.ts.map +1 -0
- package/dist/pricing-engine/shadow.js +54 -0
- package/dist/pricing-engine/shadow.js.map +1 -0
- package/dist/pricing-engine/types.d.ts +184 -0
- package/dist/pricing-engine/types.d.ts.map +1 -0
- package/dist/pricing-engine/types.js +31 -0
- package/dist/pricing-engine/types.js.map +1 -0
- package/dist/rbac/authorize.d.ts +3 -6
- package/dist/rbac/authorize.d.ts.map +1 -1
- package/dist/rbac/authorize.js +4 -8
- package/dist/rbac/authorize.js.map +1 -1
- package/dist/rbac/catalog.d.ts.map +1 -1
- package/dist/rbac/catalog.js +414 -21
- package/dist/rbac/catalog.js.map +1 -1
- package/dist/subscription-billing/dunning.d.ts +18 -0
- package/dist/subscription-billing/dunning.d.ts.map +1 -0
- package/dist/subscription-billing/dunning.js +28 -0
- package/dist/subscription-billing/dunning.js.map +1 -0
- package/dist/subscription-billing/events.d.ts +58 -0
- package/dist/subscription-billing/events.d.ts.map +1 -0
- package/dist/subscription-billing/events.js +38 -0
- package/dist/subscription-billing/events.js.map +1 -0
- package/dist/subscription-billing/index.d.ts +18 -0
- package/dist/subscription-billing/index.d.ts.map +1 -0
- package/dist/subscription-billing/index.js +16 -0
- package/dist/subscription-billing/index.js.map +1 -0
- package/dist/subscription-billing/plans.d.ts +34 -0
- package/dist/subscription-billing/plans.d.ts.map +1 -0
- package/dist/subscription-billing/plans.js +85 -0
- package/dist/subscription-billing/plans.js.map +1 -0
- package/dist/subscription-billing/product-config.d.ts +61 -0
- package/dist/subscription-billing/product-config.d.ts.map +1 -0
- package/dist/subscription-billing/product-config.js +50 -0
- package/dist/subscription-billing/product-config.js.map +1 -0
- package/dist/subscription-billing/provider/asaas.d.ts +26 -0
- package/dist/subscription-billing/provider/asaas.d.ts.map +1 -0
- package/dist/subscription-billing/provider/asaas.js +229 -0
- package/dist/subscription-billing/provider/asaas.js.map +1 -0
- package/dist/subscription-billing/provider/disabled.d.ts +30 -0
- package/dist/subscription-billing/provider/disabled.d.ts.map +1 -0
- package/dist/subscription-billing/provider/disabled.js +42 -0
- package/dist/subscription-billing/provider/disabled.js.map +1 -0
- package/dist/subscription-billing/provider/registry.d.ts +10 -0
- package/dist/subscription-billing/provider/registry.d.ts.map +1 -0
- package/dist/subscription-billing/provider/registry.js +26 -0
- package/dist/subscription-billing/provider/registry.js.map +1 -0
- package/dist/subscription-billing/reconcile.d.ts +45 -0
- package/dist/subscription-billing/reconcile.d.ts.map +1 -0
- package/dist/subscription-billing/reconcile.js +192 -0
- package/dist/subscription-billing/reconcile.js.map +1 -0
- package/dist/subscription-billing/repository.d.ts +168 -0
- package/dist/subscription-billing/repository.d.ts.map +1 -0
- package/dist/subscription-billing/repository.js +336 -0
- package/dist/subscription-billing/repository.js.map +1 -0
- package/dist/subscription-billing/service.d.ts +175 -0
- package/dist/subscription-billing/service.d.ts.map +1 -0
- package/dist/subscription-billing/service.js +818 -0
- package/dist/subscription-billing/service.js.map +1 -0
- package/dist/subscription-billing/types.d.ts +161 -0
- package/dist/subscription-billing/types.d.ts.map +1 -0
- package/dist/subscription-billing/types.js +24 -0
- package/dist/subscription-billing/types.js.map +1 -0
- package/dist/vault/crypto.d.ts +22 -0
- package/dist/vault/crypto.d.ts.map +1 -0
- package/dist/vault/crypto.js +88 -0
- package/dist/vault/crypto.js.map +1 -0
- package/dist/vault/repository.d.ts +45 -0
- package/dist/vault/repository.d.ts.map +1 -0
- package/dist/vault/repository.js +111 -0
- package/dist/vault/repository.js.map +1 -0
- package/package.json +23 -13
- package/src/db/migrations/0012_vault.sql +51 -0
- package/src/db/migrations/0013_crm.sql +67 -0
- package/src/db/migrations/0014_billing.sql +146 -0
- package/src/db/migrations/0015_merchant_billing_ar.sql +201 -0
- package/src/db/migrations/0016_office_onboarding.sql +162 -0
- package/src/db/migrations/0017_office_onboarding_api.sql +21 -0
- package/src/db/migrations/0018_office_onboarding_portal_actions.sql +60 -0
- package/src/db/migrations/0019_office_onboarding_interaction_review.sql +134 -0
- package/src/db/migrations/0020_saas_billing.sql +157 -0
- package/src/db/migrations/0021_saas_billing_indexes.sql +23 -0
- package/src/db/migrations/0022_saas_billing_multi_product.sql +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients-import.js","sourceRoot":"","sources":["../../../src/import/clients-import.ts"],"names":[],"mappings":";;AAgFA,0CA0CC;AAED,gCAsBC;AAQD,oCAiBC;AA1KD,4DAAgF;AA6BhF,MAAM,cAAc,GAAwD;IAC1E,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,aAAa;IAC3B,YAAY,EAAE,aAAa;IAC3B,SAAS,EAAE,gBAAgB;IAC3B,eAAe,EAAE,gBAAgB;IACjC,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,gBAAgB;IACrB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,OAAO;IACj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strict";
|
|
2
|
+
// @baruk/core — o motor agnóstico da plataforma. NÃO conhece contabilidade.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.renameClient = exports.getClient = exports.listClientsPaged = exports.listClients = exports.createClient = exports.listAudit = exports.appendAudit = exports.isRetryableError = exports.TRANSACTIONAL_EMAIL_CONTRACT_VERSION = exports.MIN_DEDUP_WINDOW_MS = exports.DEFAULT_TIMEOUT_MS = exports.PassthroughTemplateRenderer = exports.StaticSenderResolver = exports.buildDedupKey = exports.InMemoryDedupStore = exports.createTransactionalEmailProvider = exports.sendEmail = exports.resetPassword = exports.requestPasswordReset = exports.hashToken = exports.generateSessionToken = exports.verifyPassword = exports.hashPassword = exports.PRODUCTS = exports.ensureTenantProduct = exports.ensureProductCatalog = exports.listProductsForUser = exports.upsertUserWithPassword = exports.sessionProducts = exports.sessionMemberships = exports.listMemberships = exports.selectTenant = exports.authenticate = exports.logout = exports.login = exports.loadUserPermissions = exports.assertPermission = exports.canDo = exports.ALL_PERMISSION_KEYS = exports.SYSTEM_ROLES = exports.PERMISSIONS = exports.assignSystemRole = exports.ensureMembership = exports.ensureOrganization = exports.ensureTenant = exports.ensureRbacCatalog = exports.loadEnv = exports.withTenant = exports.withContext = exports.createDb = void 0;
|
|
19
|
+
exports.commitImport = exports.planImport = exports.parseClientsCsv = exports.getCoreStats = exports.setMembershipStatus = exports.setUserRole = exports.listTenantMembers = exports.createPublicReply = exports.addInternalNote = exports.resolveReview = exports.requestClarification = exports.acceptReview = exports.assignInteraction = exports.startReview = exports.getAdminInteractionReview = exports.getAdminInteractionMetrics = exports.listAdminInteractionReviews = exports.listPortalInteractions = exports.createPortalInteraction = exports.listPortalUserIds = exports.ensurePortalAccess = exports.getPortalClientId = exports.markNotificationRead = exports.unreadCount = exports.listNotifications = exports.createNotification = exports.listComments = exports.addComment = exports.updateRequestStatus = exports.getRequest = exports.listRequests = exports.createRequest = exports.PortalOnboardingFeatureDisabledError = exports.listPortalTimeline = exports.listPortalOnboardings = exports.getPortalOnboarding = exports.OnboardingConcurrencyError = exports.OnboardingFeatureDisabledError = exports.onboardingEnabledForTests = exports.onboardingDisabledByDefault = exports.releaseOnboardingApiIdempotency = exports.completeOnboardingApiIdempotency = exports.reserveOnboardingApiIdempotency = exports.listOnboardingTimeline = exports.listOnboardings = exports.getOnboarding = exports.createOnboardingApplication = exports.findClientIdByDocument = exports.softDeleteClient = exports.updateClient = void 0;
|
|
20
|
+
exports.InMemoryEventPublisher = exports.NoopEventPublisher = exports.MANDATORY_EVENT_TYPES = exports.isMandatoryEvent = exports.createDomainEvent = exports.SUBSCRIPTION_BILLING_CONTRACT_VERSION = exports.CANONICAL_PROVIDER_ERROR_MESSAGES = exports.isRetryableProviderError = exports.stepKey = exports.dueDunningSteps = exports.DEFAULT_DUNNING_STEPS = exports.AsaasProvider = exports.ManualProvider = exports.availableProviders = exports.registerBillingProvider = exports.resolveBillingProvider = exports.listOpenCharges = exports.billingSummary = exports.setChargeStatus = exports.markChargePaidByExternal = exports.markChargePaid = exports.getCharge = exports.listCharges = exports.createCharge = exports.setFeeStatus = exports.listFeeAgreements = exports.createFeeAgreement = exports.pipelineSummary = exports.completeTask = exports.listActivities = exports.addActivity = exports.softDeleteLead = exports.linkLeadToClient = exports.moveLeadStage = exports.updateLead = exports.getLead = exports.listLeads = exports.createLead = exports.CRM_STAGES = exports.decryptSecret = exports.encryptSecret = exports.parseKeyring = exports.loadVaultKeyring = exports.listExpiringCredentials = exports.softDeleteCredential = exports.rotateSecret = exports.revealSecret = exports.getCredentialMeta = exports.listCredentials = exports.createCredential = void 0;
|
|
21
|
+
exports.normalizeCanonicalQuote = exports.computePricingQuote = exports.computeProration = exports.resolveBundleDiscount = exports.freeModuleCodesForBundle = exports.assertBundleModulesCovered = exports.PRICING_RULE_STEPS_IN_ORDER = exports.PRICING_ENGINE_VERSION = exports.PricingEngineError = exports.clampNonNegative = exports.prorateByDays = exports.applyPercent = exports.multiplyByQuantity = exports.subtractCents = exports.addCents = exports.centsToReais = exports.reaisToCents = exports.roundHalfEven = exports.getLimits = exports.getEffectiveEntitlements = exports.explainDecision = exports.canEntitlement = exports.ENTITLEMENTS_CONTRACT_VERSION = exports.isStandingOk = exports.normalizeSubscriptionStanding = exports.sourcePrecedence = exports.normalizeEntitlementSource = exports.LEGACY_SOURCE_ALIAS = exports.CANONICAL_ENTITLEMENT_SOURCES = exports.hasActiveEntitlement = exports.deriveEntitlements = exports.applyOffer = exports.couponFreeModule = exports.couponTrialExtensionDays = exports.applyCouponToQuote = exports.validateCoupon = exports.resolvePriceQuote = exports.validateOffer = exports.KNOWN_ACTIVE_PRODUCT_LINES = exports.DisabledSubscriptionProvider = exports.AsaasSubscriptionProvider = exports.resolveSubscriptionBillingProvider = exports.DEFAULT_PRODUCT_KEY = exports.singleProductRegistry = exports.createProductBillingRegistry = exports.dunningStepsAsEvents = exports.startTrial = exports.cancelSubscription = exports.changePlan = exports.applySubscriptionEvent = void 0;
|
|
22
|
+
exports.runBillingCron = exports.retryFailedWebhookEvents = exports.backofficeActivateSubscription = exports.backofficeListWebhookEvents = exports.backofficeOverview = exports.backofficeListSubscriptions = exports.reactivateForTenant = exports.cancelForTenant = exports.changePlanForTenant = exports.processSaasWebhook = exports.startSaasCheckout = exports.entitlementsForPlan = exports.standingFor = exports.subscriptionOverview = exports.signupSelfService = exports.seedSaasPlans = exports.withOperatorContext = exports.listSaasBillingEvents = exports.listSaasInvoices = exports.getSaasSubscriptionByTenant = exports.getSaasSubscription = exports.getSaasPlan = exports.listPublicPlans = exports.ensureSaasPlanCatalog = exports.DEFAULT_TRIAL_DAYS = exports.SAAS_PLANS = exports.compareQuotes = void 0;
|
|
23
|
+
// Banco / contexto de tenant (RLS)
|
|
24
|
+
var client_js_1 = require("./db/client.js");
|
|
25
|
+
Object.defineProperty(exports, "createDb", { enumerable: true, get: function () { return client_js_1.createDb; } });
|
|
26
|
+
var context_js_1 = require("./db/context.js");
|
|
27
|
+
Object.defineProperty(exports, "withContext", { enumerable: true, get: function () { return context_js_1.withContext; } });
|
|
28
|
+
Object.defineProperty(exports, "withTenant", { enumerable: true, get: function () { return context_js_1.withTenant; } });
|
|
29
|
+
var load_env_js_1 = require("./db/load-env.js");
|
|
30
|
+
Object.defineProperty(exports, "loadEnv", { enumerable: true, get: function () { return load_env_js_1.loadEnv; } });
|
|
31
|
+
// Tenancy / provisionamento
|
|
32
|
+
var provisioning_js_1 = require("./tenancy/provisioning.js");
|
|
33
|
+
Object.defineProperty(exports, "ensureRbacCatalog", { enumerable: true, get: function () { return provisioning_js_1.ensureRbacCatalog; } });
|
|
34
|
+
Object.defineProperty(exports, "ensureTenant", { enumerable: true, get: function () { return provisioning_js_1.ensureTenant; } });
|
|
35
|
+
Object.defineProperty(exports, "ensureOrganization", { enumerable: true, get: function () { return provisioning_js_1.ensureOrganization; } });
|
|
36
|
+
Object.defineProperty(exports, "ensureMembership", { enumerable: true, get: function () { return provisioning_js_1.ensureMembership; } });
|
|
37
|
+
Object.defineProperty(exports, "assignSystemRole", { enumerable: true, get: function () { return provisioning_js_1.assignSystemRole; } });
|
|
38
|
+
// RBAC
|
|
39
|
+
var catalog_js_1 = require("./rbac/catalog.js");
|
|
40
|
+
Object.defineProperty(exports, "PERMISSIONS", { enumerable: true, get: function () { return catalog_js_1.PERMISSIONS; } });
|
|
41
|
+
Object.defineProperty(exports, "SYSTEM_ROLES", { enumerable: true, get: function () { return catalog_js_1.SYSTEM_ROLES; } });
|
|
42
|
+
Object.defineProperty(exports, "ALL_PERMISSION_KEYS", { enumerable: true, get: function () { return catalog_js_1.ALL_PERMISSION_KEYS; } });
|
|
43
|
+
var authorize_js_1 = require("./rbac/authorize.js");
|
|
44
|
+
Object.defineProperty(exports, "canDo", { enumerable: true, get: function () { return authorize_js_1.canDo; } });
|
|
45
|
+
Object.defineProperty(exports, "assertPermission", { enumerable: true, get: function () { return authorize_js_1.assertPermission; } });
|
|
46
|
+
Object.defineProperty(exports, "loadUserPermissions", { enumerable: true, get: function () { return authorize_js_1.loadUserPermissions; } });
|
|
47
|
+
// Auth
|
|
48
|
+
var service_js_1 = require("./auth/service.js");
|
|
49
|
+
Object.defineProperty(exports, "login", { enumerable: true, get: function () { return service_js_1.login; } });
|
|
50
|
+
Object.defineProperty(exports, "logout", { enumerable: true, get: function () { return service_js_1.logout; } });
|
|
51
|
+
Object.defineProperty(exports, "authenticate", { enumerable: true, get: function () { return service_js_1.authenticate; } });
|
|
52
|
+
Object.defineProperty(exports, "selectTenant", { enumerable: true, get: function () { return service_js_1.selectTenant; } });
|
|
53
|
+
Object.defineProperty(exports, "listMemberships", { enumerable: true, get: function () { return service_js_1.listMemberships; } });
|
|
54
|
+
Object.defineProperty(exports, "sessionMemberships", { enumerable: true, get: function () { return service_js_1.sessionMemberships; } });
|
|
55
|
+
Object.defineProperty(exports, "sessionProducts", { enumerable: true, get: function () { return service_js_1.sessionProducts; } });
|
|
56
|
+
Object.defineProperty(exports, "upsertUserWithPassword", { enumerable: true, get: function () { return service_js_1.upsertUserWithPassword; } });
|
|
57
|
+
// Produtos / entitlements (IAM multiproduto)
|
|
58
|
+
var repository_js_1 = require("./products/repository.js");
|
|
59
|
+
Object.defineProperty(exports, "listProductsForUser", { enumerable: true, get: function () { return repository_js_1.listProductsForUser; } });
|
|
60
|
+
Object.defineProperty(exports, "ensureProductCatalog", { enumerable: true, get: function () { return repository_js_1.ensureProductCatalog; } });
|
|
61
|
+
Object.defineProperty(exports, "ensureTenantProduct", { enumerable: true, get: function () { return repository_js_1.ensureTenantProduct; } });
|
|
62
|
+
var catalog_js_2 = require("./products/catalog.js");
|
|
63
|
+
Object.defineProperty(exports, "PRODUCTS", { enumerable: true, get: function () { return catalog_js_2.PRODUCTS; } });
|
|
64
|
+
var password_js_1 = require("./auth/password.js");
|
|
65
|
+
Object.defineProperty(exports, "hashPassword", { enumerable: true, get: function () { return password_js_1.hashPassword; } });
|
|
66
|
+
Object.defineProperty(exports, "verifyPassword", { enumerable: true, get: function () { return password_js_1.verifyPassword; } });
|
|
67
|
+
var session_token_js_1 = require("./auth/session-token.js");
|
|
68
|
+
Object.defineProperty(exports, "generateSessionToken", { enumerable: true, get: function () { return session_token_js_1.generateSessionToken; } });
|
|
69
|
+
Object.defineProperty(exports, "hashToken", { enumerable: true, get: function () { return session_token_js_1.hashToken; } });
|
|
70
|
+
var password_reset_js_1 = require("./auth/password-reset.js");
|
|
71
|
+
Object.defineProperty(exports, "requestPasswordReset", { enumerable: true, get: function () { return password_reset_js_1.requestPasswordReset; } });
|
|
72
|
+
Object.defineProperty(exports, "resetPassword", { enumerable: true, get: function () { return password_reset_js_1.resetPassword; } });
|
|
73
|
+
var resend_js_1 = require("./mail/resend.js");
|
|
74
|
+
Object.defineProperty(exports, "sendEmail", { enumerable: true, get: function () { return resend_js_1.sendEmail; } });
|
|
75
|
+
// cap.communication.transactional-email — Provider canônico (RFC-CAPABILITY-TRANSACTIONAL-EMAIL-001 v0.2)
|
|
76
|
+
var index_js_1 = require("./mail/index.js");
|
|
77
|
+
Object.defineProperty(exports, "createTransactionalEmailProvider", { enumerable: true, get: function () { return index_js_1.createTransactionalEmailProvider; } });
|
|
78
|
+
Object.defineProperty(exports, "InMemoryDedupStore", { enumerable: true, get: function () { return index_js_1.InMemoryDedupStore; } });
|
|
79
|
+
Object.defineProperty(exports, "buildDedupKey", { enumerable: true, get: function () { return index_js_1.buildDedupKey; } });
|
|
80
|
+
Object.defineProperty(exports, "StaticSenderResolver", { enumerable: true, get: function () { return index_js_1.StaticSenderResolver; } });
|
|
81
|
+
Object.defineProperty(exports, "PassthroughTemplateRenderer", { enumerable: true, get: function () { return index_js_1.PassthroughTemplateRenderer; } });
|
|
82
|
+
Object.defineProperty(exports, "DEFAULT_TIMEOUT_MS", { enumerable: true, get: function () { return index_js_1.DEFAULT_TIMEOUT_MS; } });
|
|
83
|
+
Object.defineProperty(exports, "MIN_DEDUP_WINDOW_MS", { enumerable: true, get: function () { return index_js_1.MIN_DEDUP_WINDOW_MS; } });
|
|
84
|
+
Object.defineProperty(exports, "TRANSACTIONAL_EMAIL_CONTRACT_VERSION", { enumerable: true, get: function () { return index_js_1.TRANSACTIONAL_EMAIL_CONTRACT_VERSION; } });
|
|
85
|
+
Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return index_js_1.isRetryableError; } });
|
|
86
|
+
// Auditoria
|
|
87
|
+
var audit_js_1 = require("./audit/audit.js");
|
|
88
|
+
Object.defineProperty(exports, "appendAudit", { enumerable: true, get: function () { return audit_js_1.appendAudit; } });
|
|
89
|
+
var repository_js_2 = require("./audit/repository.js");
|
|
90
|
+
Object.defineProperty(exports, "listAudit", { enumerable: true, get: function () { return repository_js_2.listAudit; } });
|
|
91
|
+
// Clientes (entidade de negócio tenant-scoped)
|
|
92
|
+
var repository_js_3 = require("./clients/repository.js");
|
|
93
|
+
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return repository_js_3.createClient; } });
|
|
94
|
+
Object.defineProperty(exports, "listClients", { enumerable: true, get: function () { return repository_js_3.listClients; } });
|
|
95
|
+
Object.defineProperty(exports, "listClientsPaged", { enumerable: true, get: function () { return repository_js_3.listClientsPaged; } });
|
|
96
|
+
Object.defineProperty(exports, "getClient", { enumerable: true, get: function () { return repository_js_3.getClient; } });
|
|
97
|
+
Object.defineProperty(exports, "renameClient", { enumerable: true, get: function () { return repository_js_3.renameClient; } });
|
|
98
|
+
Object.defineProperty(exports, "updateClient", { enumerable: true, get: function () { return repository_js_3.updateClient; } });
|
|
99
|
+
Object.defineProperty(exports, "softDeleteClient", { enumerable: true, get: function () { return repository_js_3.softDeleteClient; } });
|
|
100
|
+
Object.defineProperty(exports, "findClientIdByDocument", { enumerable: true, get: function () { return repository_js_3.findClientIdByDocument; } });
|
|
101
|
+
// Office — Client Onboarding (persistência e application layer)
|
|
102
|
+
var persistence_js_1 = require("./onboarding/persistence.js");
|
|
103
|
+
Object.defineProperty(exports, "createOnboardingApplication", { enumerable: true, get: function () { return persistence_js_1.createOnboardingApplication; } });
|
|
104
|
+
Object.defineProperty(exports, "getOnboarding", { enumerable: true, get: function () { return persistence_js_1.getOnboarding; } });
|
|
105
|
+
Object.defineProperty(exports, "listOnboardings", { enumerable: true, get: function () { return persistence_js_1.listOnboardings; } });
|
|
106
|
+
Object.defineProperty(exports, "listOnboardingTimeline", { enumerable: true, get: function () { return persistence_js_1.listOnboardingTimeline; } });
|
|
107
|
+
Object.defineProperty(exports, "reserveOnboardingApiIdempotency", { enumerable: true, get: function () { return persistence_js_1.reserveOnboardingApiIdempotency; } });
|
|
108
|
+
Object.defineProperty(exports, "completeOnboardingApiIdempotency", { enumerable: true, get: function () { return persistence_js_1.completeOnboardingApiIdempotency; } });
|
|
109
|
+
Object.defineProperty(exports, "releaseOnboardingApiIdempotency", { enumerable: true, get: function () { return persistence_js_1.releaseOnboardingApiIdempotency; } });
|
|
110
|
+
Object.defineProperty(exports, "onboardingDisabledByDefault", { enumerable: true, get: function () { return persistence_js_1.onboardingDisabledByDefault; } });
|
|
111
|
+
Object.defineProperty(exports, "onboardingEnabledForTests", { enumerable: true, get: function () { return persistence_js_1.onboardingEnabledForTests; } });
|
|
112
|
+
Object.defineProperty(exports, "OnboardingFeatureDisabledError", { enumerable: true, get: function () { return persistence_js_1.OnboardingFeatureDisabledError; } });
|
|
113
|
+
Object.defineProperty(exports, "OnboardingConcurrencyError", { enumerable: true, get: function () { return persistence_js_1.OnboardingConcurrencyError; } });
|
|
114
|
+
__exportStar(require("./onboarding/domain.js"), exports);
|
|
115
|
+
var portal_js_1 = require("./onboarding/portal.js");
|
|
116
|
+
Object.defineProperty(exports, "getPortalOnboarding", { enumerable: true, get: function () { return portal_js_1.getPortalOnboarding; } });
|
|
117
|
+
Object.defineProperty(exports, "listPortalOnboardings", { enumerable: true, get: function () { return portal_js_1.listPortalOnboardings; } });
|
|
118
|
+
Object.defineProperty(exports, "listPortalTimeline", { enumerable: true, get: function () { return portal_js_1.listPortalTimeline; } });
|
|
119
|
+
Object.defineProperty(exports, "PortalOnboardingFeatureDisabledError", { enumerable: true, get: function () { return portal_js_1.PortalOnboardingFeatureDisabledError; } });
|
|
120
|
+
// Solicitações (ciclo operacional escritório↔cliente)
|
|
121
|
+
var repository_js_4 = require("./requests/repository.js");
|
|
122
|
+
Object.defineProperty(exports, "createRequest", { enumerable: true, get: function () { return repository_js_4.createRequest; } });
|
|
123
|
+
Object.defineProperty(exports, "listRequests", { enumerable: true, get: function () { return repository_js_4.listRequests; } });
|
|
124
|
+
Object.defineProperty(exports, "getRequest", { enumerable: true, get: function () { return repository_js_4.getRequest; } });
|
|
125
|
+
Object.defineProperty(exports, "updateRequestStatus", { enumerable: true, get: function () { return repository_js_4.updateRequestStatus; } });
|
|
126
|
+
Object.defineProperty(exports, "addComment", { enumerable: true, get: function () { return repository_js_4.addComment; } });
|
|
127
|
+
Object.defineProperty(exports, "listComments", { enumerable: true, get: function () { return repository_js_4.listComments; } });
|
|
128
|
+
// Notificações
|
|
129
|
+
var repository_js_5 = require("./notifications/repository.js");
|
|
130
|
+
Object.defineProperty(exports, "createNotification", { enumerable: true, get: function () { return repository_js_5.createNotification; } });
|
|
131
|
+
Object.defineProperty(exports, "listNotifications", { enumerable: true, get: function () { return repository_js_5.listNotifications; } });
|
|
132
|
+
Object.defineProperty(exports, "unreadCount", { enumerable: true, get: function () { return repository_js_5.unreadCount; } });
|
|
133
|
+
Object.defineProperty(exports, "markNotificationRead", { enumerable: true, get: function () { return repository_js_5.markNotificationRead; } });
|
|
134
|
+
// Portal do cliente
|
|
135
|
+
var repository_js_6 = require("./portal/repository.js");
|
|
136
|
+
Object.defineProperty(exports, "getPortalClientId", { enumerable: true, get: function () { return repository_js_6.getPortalClientId; } });
|
|
137
|
+
Object.defineProperty(exports, "ensurePortalAccess", { enumerable: true, get: function () { return repository_js_6.ensurePortalAccess; } });
|
|
138
|
+
Object.defineProperty(exports, "listPortalUserIds", { enumerable: true, get: function () { return repository_js_6.listPortalUserIds; } });
|
|
139
|
+
var portal_actions_js_1 = require("./onboarding/portal-actions.js");
|
|
140
|
+
Object.defineProperty(exports, "createPortalInteraction", { enumerable: true, get: function () { return portal_actions_js_1.createPortalInteraction; } });
|
|
141
|
+
Object.defineProperty(exports, "listPortalInteractions", { enumerable: true, get: function () { return portal_actions_js_1.listPortalInteractions; } });
|
|
142
|
+
var interaction_review_js_1 = require("./onboarding/interaction-review.js");
|
|
143
|
+
Object.defineProperty(exports, "listAdminInteractionReviews", { enumerable: true, get: function () { return interaction_review_js_1.listAdminInteractionReviews; } });
|
|
144
|
+
Object.defineProperty(exports, "getAdminInteractionMetrics", { enumerable: true, get: function () { return interaction_review_js_1.getAdminInteractionMetrics; } });
|
|
145
|
+
Object.defineProperty(exports, "getAdminInteractionReview", { enumerable: true, get: function () { return interaction_review_js_1.getAdminInteractionReview; } });
|
|
146
|
+
Object.defineProperty(exports, "startReview", { enumerable: true, get: function () { return interaction_review_js_1.startReview; } });
|
|
147
|
+
Object.defineProperty(exports, "assignInteraction", { enumerable: true, get: function () { return interaction_review_js_1.assignInteraction; } });
|
|
148
|
+
Object.defineProperty(exports, "acceptReview", { enumerable: true, get: function () { return interaction_review_js_1.acceptReview; } });
|
|
149
|
+
Object.defineProperty(exports, "requestClarification", { enumerable: true, get: function () { return interaction_review_js_1.requestClarification; } });
|
|
150
|
+
Object.defineProperty(exports, "resolveReview", { enumerable: true, get: function () { return interaction_review_js_1.resolveReview; } });
|
|
151
|
+
Object.defineProperty(exports, "addInternalNote", { enumerable: true, get: function () { return interaction_review_js_1.addInternalNote; } });
|
|
152
|
+
Object.defineProperty(exports, "createPublicReply", { enumerable: true, get: function () { return interaction_review_js_1.createPublicReply; } });
|
|
153
|
+
// Usuários / memberships
|
|
154
|
+
var repository_js_7 = require("./users/repository.js");
|
|
155
|
+
Object.defineProperty(exports, "listTenantMembers", { enumerable: true, get: function () { return repository_js_7.listTenantMembers; } });
|
|
156
|
+
Object.defineProperty(exports, "setUserRole", { enumerable: true, get: function () { return repository_js_7.setUserRole; } });
|
|
157
|
+
Object.defineProperty(exports, "setMembershipStatus", { enumerable: true, get: function () { return repository_js_7.setMembershipStatus; } });
|
|
158
|
+
// Dashboard (stats agnósticas)
|
|
159
|
+
var repository_js_8 = require("./dashboard/repository.js");
|
|
160
|
+
Object.defineProperty(exports, "getCoreStats", { enumerable: true, get: function () { return repository_js_8.getCoreStats; } });
|
|
161
|
+
// Importação de clientes (CSV)
|
|
162
|
+
var clients_import_js_1 = require("./import/clients-import.js");
|
|
163
|
+
Object.defineProperty(exports, "parseClientsCsv", { enumerable: true, get: function () { return clients_import_js_1.parseClientsCsv; } });
|
|
164
|
+
Object.defineProperty(exports, "planImport", { enumerable: true, get: function () { return clients_import_js_1.planImport; } });
|
|
165
|
+
Object.defineProperty(exports, "commitImport", { enumerable: true, get: function () { return clients_import_js_1.commitImport; } });
|
|
166
|
+
// ── Office Engines (Sprint Platinum) ─────────────────────────────────────────
|
|
167
|
+
// Vault Engine — cofre de credenciais criptografado (AES-256-GCM).
|
|
168
|
+
var repository_js_9 = require("./vault/repository.js");
|
|
169
|
+
Object.defineProperty(exports, "createCredential", { enumerable: true, get: function () { return repository_js_9.createCredential; } });
|
|
170
|
+
Object.defineProperty(exports, "listCredentials", { enumerable: true, get: function () { return repository_js_9.listCredentials; } });
|
|
171
|
+
Object.defineProperty(exports, "getCredentialMeta", { enumerable: true, get: function () { return repository_js_9.getCredentialMeta; } });
|
|
172
|
+
Object.defineProperty(exports, "revealSecret", { enumerable: true, get: function () { return repository_js_9.revealSecret; } });
|
|
173
|
+
Object.defineProperty(exports, "rotateSecret", { enumerable: true, get: function () { return repository_js_9.rotateSecret; } });
|
|
174
|
+
Object.defineProperty(exports, "softDeleteCredential", { enumerable: true, get: function () { return repository_js_9.softDeleteCredential; } });
|
|
175
|
+
Object.defineProperty(exports, "listExpiringCredentials", { enumerable: true, get: function () { return repository_js_9.listExpiringCredentials; } });
|
|
176
|
+
var crypto_js_1 = require("./vault/crypto.js");
|
|
177
|
+
Object.defineProperty(exports, "loadVaultKeyring", { enumerable: true, get: function () { return crypto_js_1.loadVaultKeyring; } });
|
|
178
|
+
Object.defineProperty(exports, "parseKeyring", { enumerable: true, get: function () { return crypto_js_1.parseKeyring; } });
|
|
179
|
+
Object.defineProperty(exports, "encryptSecret", { enumerable: true, get: function () { return crypto_js_1.encryptSecret; } });
|
|
180
|
+
Object.defineProperty(exports, "decryptSecret", { enumerable: true, get: function () { return crypto_js_1.decryptSecret; } });
|
|
181
|
+
// CRM Engine — funil comercial (leads, pipeline, timeline).
|
|
182
|
+
var repository_js_10 = require("./crm/repository.js");
|
|
183
|
+
Object.defineProperty(exports, "CRM_STAGES", { enumerable: true, get: function () { return repository_js_10.CRM_STAGES; } });
|
|
184
|
+
Object.defineProperty(exports, "createLead", { enumerable: true, get: function () { return repository_js_10.createLead; } });
|
|
185
|
+
Object.defineProperty(exports, "listLeads", { enumerable: true, get: function () { return repository_js_10.listLeads; } });
|
|
186
|
+
Object.defineProperty(exports, "getLead", { enumerable: true, get: function () { return repository_js_10.getLead; } });
|
|
187
|
+
Object.defineProperty(exports, "updateLead", { enumerable: true, get: function () { return repository_js_10.updateLead; } });
|
|
188
|
+
Object.defineProperty(exports, "moveLeadStage", { enumerable: true, get: function () { return repository_js_10.moveLeadStage; } });
|
|
189
|
+
Object.defineProperty(exports, "linkLeadToClient", { enumerable: true, get: function () { return repository_js_10.linkLeadToClient; } });
|
|
190
|
+
Object.defineProperty(exports, "softDeleteLead", { enumerable: true, get: function () { return repository_js_10.softDeleteLead; } });
|
|
191
|
+
Object.defineProperty(exports, "addActivity", { enumerable: true, get: function () { return repository_js_10.addActivity; } });
|
|
192
|
+
Object.defineProperty(exports, "listActivities", { enumerable: true, get: function () { return repository_js_10.listActivities; } });
|
|
193
|
+
Object.defineProperty(exports, "completeTask", { enumerable: true, get: function () { return repository_js_10.completeTask; } });
|
|
194
|
+
Object.defineProperty(exports, "pipelineSummary", { enumerable: true, get: function () { return repository_js_10.pipelineSummary; } });
|
|
195
|
+
// Billing Engine — honorários, cobranças, assinaturas (Provider Pattern).
|
|
196
|
+
var repository_js_11 = require("./billing/repository.js");
|
|
197
|
+
Object.defineProperty(exports, "createFeeAgreement", { enumerable: true, get: function () { return repository_js_11.createFeeAgreement; } });
|
|
198
|
+
Object.defineProperty(exports, "listFeeAgreements", { enumerable: true, get: function () { return repository_js_11.listFeeAgreements; } });
|
|
199
|
+
Object.defineProperty(exports, "setFeeStatus", { enumerable: true, get: function () { return repository_js_11.setFeeStatus; } });
|
|
200
|
+
Object.defineProperty(exports, "createCharge", { enumerable: true, get: function () { return repository_js_11.createCharge; } });
|
|
201
|
+
Object.defineProperty(exports, "listCharges", { enumerable: true, get: function () { return repository_js_11.listCharges; } });
|
|
202
|
+
Object.defineProperty(exports, "getCharge", { enumerable: true, get: function () { return repository_js_11.getCharge; } });
|
|
203
|
+
Object.defineProperty(exports, "markChargePaid", { enumerable: true, get: function () { return repository_js_11.markChargePaid; } });
|
|
204
|
+
Object.defineProperty(exports, "markChargePaidByExternal", { enumerable: true, get: function () { return repository_js_11.markChargePaidByExternal; } });
|
|
205
|
+
Object.defineProperty(exports, "setChargeStatus", { enumerable: true, get: function () { return repository_js_11.setChargeStatus; } });
|
|
206
|
+
Object.defineProperty(exports, "billingSummary", { enumerable: true, get: function () { return repository_js_11.billingSummary; } });
|
|
207
|
+
Object.defineProperty(exports, "listOpenCharges", { enumerable: true, get: function () { return repository_js_11.listOpenCharges; } });
|
|
208
|
+
var registry_js_1 = require("./billing/provider/registry.js");
|
|
209
|
+
Object.defineProperty(exports, "resolveBillingProvider", { enumerable: true, get: function () { return registry_js_1.resolveBillingProvider; } });
|
|
210
|
+
Object.defineProperty(exports, "registerBillingProvider", { enumerable: true, get: function () { return registry_js_1.registerBillingProvider; } });
|
|
211
|
+
Object.defineProperty(exports, "availableProviders", { enumerable: true, get: function () { return registry_js_1.availableProviders; } });
|
|
212
|
+
var manual_js_1 = require("./billing/provider/manual.js");
|
|
213
|
+
Object.defineProperty(exports, "ManualProvider", { enumerable: true, get: function () { return manual_js_1.ManualProvider; } });
|
|
214
|
+
var asaas_js_1 = require("./billing/provider/asaas.js");
|
|
215
|
+
Object.defineProperty(exports, "AsaasProvider", { enumerable: true, get: function () { return asaas_js_1.AsaasProvider; } });
|
|
216
|
+
var dunning_js_1 = require("./billing/dunning.js");
|
|
217
|
+
Object.defineProperty(exports, "DEFAULT_DUNNING_STEPS", { enumerable: true, get: function () { return dunning_js_1.DEFAULT_DUNNING_STEPS; } });
|
|
218
|
+
Object.defineProperty(exports, "dueDunningSteps", { enumerable: true, get: function () { return dunning_js_1.dueDunningSteps; } });
|
|
219
|
+
Object.defineProperty(exports, "stepKey", { enumerable: true, get: function () { return dunning_js_1.stepKey; } });
|
|
220
|
+
var types_js_1 = require("./subscription-billing/types.js");
|
|
221
|
+
Object.defineProperty(exports, "isRetryableProviderError", { enumerable: true, get: function () { return types_js_1.isRetryableProviderError; } });
|
|
222
|
+
Object.defineProperty(exports, "CANONICAL_PROVIDER_ERROR_MESSAGES", { enumerable: true, get: function () { return types_js_1.CANONICAL_PROVIDER_ERROR_MESSAGES; } });
|
|
223
|
+
Object.defineProperty(exports, "SUBSCRIPTION_BILLING_CONTRACT_VERSION", { enumerable: true, get: function () { return types_js_1.SUBSCRIPTION_BILLING_CONTRACT_VERSION; } });
|
|
224
|
+
var events_js_1 = require("./subscription-billing/events.js");
|
|
225
|
+
Object.defineProperty(exports, "createDomainEvent", { enumerable: true, get: function () { return events_js_1.createDomainEvent; } });
|
|
226
|
+
Object.defineProperty(exports, "isMandatoryEvent", { enumerable: true, get: function () { return events_js_1.isMandatoryEvent; } });
|
|
227
|
+
Object.defineProperty(exports, "MANDATORY_EVENT_TYPES", { enumerable: true, get: function () { return events_js_1.MANDATORY_EVENT_TYPES; } });
|
|
228
|
+
Object.defineProperty(exports, "NoopEventPublisher", { enumerable: true, get: function () { return events_js_1.NoopEventPublisher; } });
|
|
229
|
+
Object.defineProperty(exports, "InMemoryEventPublisher", { enumerable: true, get: function () { return events_js_1.InMemoryEventPublisher; } });
|
|
230
|
+
var reconcile_js_1 = require("./subscription-billing/reconcile.js");
|
|
231
|
+
Object.defineProperty(exports, "applySubscriptionEvent", { enumerable: true, get: function () { return reconcile_js_1.applySubscriptionEvent; } });
|
|
232
|
+
Object.defineProperty(exports, "changePlan", { enumerable: true, get: function () { return reconcile_js_1.changePlan; } });
|
|
233
|
+
Object.defineProperty(exports, "cancelSubscription", { enumerable: true, get: function () { return reconcile_js_1.cancelSubscription; } });
|
|
234
|
+
Object.defineProperty(exports, "startTrial", { enumerable: true, get: function () { return reconcile_js_1.startTrial; } });
|
|
235
|
+
var dunning_js_2 = require("./subscription-billing/dunning.js");
|
|
236
|
+
Object.defineProperty(exports, "dunningStepsAsEvents", { enumerable: true, get: function () { return dunning_js_2.dunningStepsAsEvents; } });
|
|
237
|
+
var product_config_js_1 = require("./subscription-billing/product-config.js");
|
|
238
|
+
Object.defineProperty(exports, "createProductBillingRegistry", { enumerable: true, get: function () { return product_config_js_1.createProductBillingRegistry; } });
|
|
239
|
+
Object.defineProperty(exports, "singleProductRegistry", { enumerable: true, get: function () { return product_config_js_1.singleProductRegistry; } });
|
|
240
|
+
var plans_js_1 = require("./subscription-billing/plans.js");
|
|
241
|
+
Object.defineProperty(exports, "DEFAULT_PRODUCT_KEY", { enumerable: true, get: function () { return plans_js_1.DEFAULT_PRODUCT_KEY; } });
|
|
242
|
+
var registry_js_2 = require("./subscription-billing/provider/registry.js");
|
|
243
|
+
Object.defineProperty(exports, "resolveSubscriptionBillingProvider", { enumerable: true, get: function () { return registry_js_2.resolveSubscriptionBillingProvider; } });
|
|
244
|
+
var asaas_js_2 = require("./subscription-billing/provider/asaas.js");
|
|
245
|
+
Object.defineProperty(exports, "AsaasSubscriptionProvider", { enumerable: true, get: function () { return asaas_js_2.AsaasSubscriptionProvider; } });
|
|
246
|
+
var disabled_js_1 = require("./subscription-billing/provider/disabled.js");
|
|
247
|
+
Object.defineProperty(exports, "DisabledSubscriptionProvider", { enumerable: true, get: function () { return disabled_js_1.DisabledSubscriptionProvider; } });
|
|
248
|
+
var types_js_2 = require("./commercial-catalog/types.js");
|
|
249
|
+
Object.defineProperty(exports, "KNOWN_ACTIVE_PRODUCT_LINES", { enumerable: true, get: function () { return types_js_2.KNOWN_ACTIVE_PRODUCT_LINES; } });
|
|
250
|
+
var catalog_js_3 = require("./commercial-catalog/catalog.js");
|
|
251
|
+
Object.defineProperty(exports, "validateOffer", { enumerable: true, get: function () { return catalog_js_3.validateOffer; } });
|
|
252
|
+
Object.defineProperty(exports, "resolvePriceQuote", { enumerable: true, get: function () { return catalog_js_3.resolvePriceQuote; } });
|
|
253
|
+
var coupon_js_1 = require("./commercial-catalog/coupon.js");
|
|
254
|
+
Object.defineProperty(exports, "validateCoupon", { enumerable: true, get: function () { return coupon_js_1.validateCoupon; } });
|
|
255
|
+
Object.defineProperty(exports, "applyCouponToQuote", { enumerable: true, get: function () { return coupon_js_1.applyCouponToQuote; } });
|
|
256
|
+
Object.defineProperty(exports, "couponTrialExtensionDays", { enumerable: true, get: function () { return coupon_js_1.couponTrialExtensionDays; } });
|
|
257
|
+
Object.defineProperty(exports, "couponFreeModule", { enumerable: true, get: function () { return coupon_js_1.couponFreeModule; } });
|
|
258
|
+
var offer_application_js_1 = require("./commercial-catalog/offer-application.js");
|
|
259
|
+
Object.defineProperty(exports, "applyOffer", { enumerable: true, get: function () { return offer_application_js_1.applyOffer; } });
|
|
260
|
+
var derive_js_1 = require("./entitlements/derive.js");
|
|
261
|
+
Object.defineProperty(exports, "deriveEntitlements", { enumerable: true, get: function () { return derive_js_1.deriveEntitlements; } });
|
|
262
|
+
Object.defineProperty(exports, "hasActiveEntitlement", { enumerable: true, get: function () { return derive_js_1.hasActiveEntitlement; } });
|
|
263
|
+
// Contrato canônico 1.0.0 do cap.entitlements.access — extensão ADITIVA sobre o
|
|
264
|
+
// bloco acima (nada anterior mudou). Trazido de `eco/r1-core-identity-convergence`
|
|
265
|
+
// para o release 0.2.0: o consumidor Baruk Rep/Ind já integrou este contrato em
|
|
266
|
+
// shadow, e sem estes símbolos o pacote publicado não resolve os imports dele.
|
|
267
|
+
var sources_js_1 = require("./entitlements/sources.js");
|
|
268
|
+
Object.defineProperty(exports, "CANONICAL_ENTITLEMENT_SOURCES", { enumerable: true, get: function () { return sources_js_1.CANONICAL_ENTITLEMENT_SOURCES; } });
|
|
269
|
+
Object.defineProperty(exports, "LEGACY_SOURCE_ALIAS", { enumerable: true, get: function () { return sources_js_1.LEGACY_SOURCE_ALIAS; } });
|
|
270
|
+
Object.defineProperty(exports, "normalizeEntitlementSource", { enumerable: true, get: function () { return sources_js_1.normalizeEntitlementSource; } });
|
|
271
|
+
Object.defineProperty(exports, "sourcePrecedence", { enumerable: true, get: function () { return sources_js_1.sourcePrecedence; } });
|
|
272
|
+
var standing_js_1 = require("./entitlements/standing.js");
|
|
273
|
+
Object.defineProperty(exports, "normalizeSubscriptionStanding", { enumerable: true, get: function () { return standing_js_1.normalizeSubscriptionStanding; } });
|
|
274
|
+
Object.defineProperty(exports, "isStandingOk", { enumerable: true, get: function () { return standing_js_1.isStandingOk; } });
|
|
275
|
+
var decision_js_1 = require("./entitlements/decision.js");
|
|
276
|
+
Object.defineProperty(exports, "ENTITLEMENTS_CONTRACT_VERSION", { enumerable: true, get: function () { return decision_js_1.ENTITLEMENTS_CONTRACT_VERSION; } });
|
|
277
|
+
Object.defineProperty(exports, "canEntitlement", { enumerable: true, get: function () { return decision_js_1.can; } });
|
|
278
|
+
Object.defineProperty(exports, "explainDecision", { enumerable: true, get: function () { return decision_js_1.explainDecision; } });
|
|
279
|
+
Object.defineProperty(exports, "getEffectiveEntitlements", { enumerable: true, get: function () { return decision_js_1.getEffectiveEntitlements; } });
|
|
280
|
+
Object.defineProperty(exports, "getLimits", { enumerable: true, get: function () { return decision_js_1.getLimits; } });
|
|
281
|
+
var money_js_1 = require("./pricing-engine/money.js");
|
|
282
|
+
Object.defineProperty(exports, "roundHalfEven", { enumerable: true, get: function () { return money_js_1.roundHalfEven; } });
|
|
283
|
+
Object.defineProperty(exports, "reaisToCents", { enumerable: true, get: function () { return money_js_1.reaisToCents; } });
|
|
284
|
+
Object.defineProperty(exports, "centsToReais", { enumerable: true, get: function () { return money_js_1.centsToReais; } });
|
|
285
|
+
Object.defineProperty(exports, "addCents", { enumerable: true, get: function () { return money_js_1.addCents; } });
|
|
286
|
+
Object.defineProperty(exports, "subtractCents", { enumerable: true, get: function () { return money_js_1.subtractCents; } });
|
|
287
|
+
Object.defineProperty(exports, "multiplyByQuantity", { enumerable: true, get: function () { return money_js_1.multiplyByQuantity; } });
|
|
288
|
+
Object.defineProperty(exports, "applyPercent", { enumerable: true, get: function () { return money_js_1.applyPercent; } });
|
|
289
|
+
Object.defineProperty(exports, "prorateByDays", { enumerable: true, get: function () { return money_js_1.prorateByDays; } });
|
|
290
|
+
Object.defineProperty(exports, "clampNonNegative", { enumerable: true, get: function () { return money_js_1.clampNonNegative; } });
|
|
291
|
+
var errors_js_1 = require("./pricing-engine/errors.js");
|
|
292
|
+
Object.defineProperty(exports, "PricingEngineError", { enumerable: true, get: function () { return errors_js_1.PricingEngineError; } });
|
|
293
|
+
var types_js_3 = require("./pricing-engine/types.js");
|
|
294
|
+
Object.defineProperty(exports, "PRICING_ENGINE_VERSION", { enumerable: true, get: function () { return types_js_3.PRICING_ENGINE_VERSION; } });
|
|
295
|
+
Object.defineProperty(exports, "PRICING_RULE_STEPS_IN_ORDER", { enumerable: true, get: function () { return types_js_3.PRICING_RULE_STEPS_IN_ORDER; } });
|
|
296
|
+
var bundle_js_1 = require("./pricing-engine/bundle.js");
|
|
297
|
+
Object.defineProperty(exports, "assertBundleModulesCovered", { enumerable: true, get: function () { return bundle_js_1.assertBundleModulesCovered; } });
|
|
298
|
+
Object.defineProperty(exports, "freeModuleCodesForBundle", { enumerable: true, get: function () { return bundle_js_1.freeModuleCodesForBundle; } });
|
|
299
|
+
Object.defineProperty(exports, "resolveBundleDiscount", { enumerable: true, get: function () { return bundle_js_1.resolveBundleDiscount; } });
|
|
300
|
+
var proration_js_1 = require("./pricing-engine/proration.js");
|
|
301
|
+
Object.defineProperty(exports, "computeProration", { enumerable: true, get: function () { return proration_js_1.computeProration; } });
|
|
302
|
+
var pipeline_js_1 = require("./pricing-engine/pipeline.js");
|
|
303
|
+
Object.defineProperty(exports, "computePricingQuote", { enumerable: true, get: function () { return pipeline_js_1.computePricingQuote; } });
|
|
304
|
+
var shadow_js_1 = require("./pricing-engine/shadow.js");
|
|
305
|
+
Object.defineProperty(exports, "normalizeCanonicalQuote", { enumerable: true, get: function () { return shadow_js_1.normalizeCanonicalQuote; } });
|
|
306
|
+
Object.defineProperty(exports, "compareQuotes", { enumerable: true, get: function () { return shadow_js_1.compareQuotes; } });
|
|
307
|
+
// BILL-01 (Fase 17) — Billing SaaS: persistência, serviço, backoffice e cron.
|
|
308
|
+
var index_js_2 = require("./subscription-billing/index.js");
|
|
309
|
+
Object.defineProperty(exports, "SAAS_PLANS", { enumerable: true, get: function () { return index_js_2.SAAS_PLANS; } });
|
|
310
|
+
Object.defineProperty(exports, "DEFAULT_TRIAL_DAYS", { enumerable: true, get: function () { return index_js_2.DEFAULT_TRIAL_DAYS; } });
|
|
311
|
+
Object.defineProperty(exports, "ensureSaasPlanCatalog", { enumerable: true, get: function () { return index_js_2.ensureSaasPlanCatalog; } });
|
|
312
|
+
Object.defineProperty(exports, "listPublicPlans", { enumerable: true, get: function () { return index_js_2.listPublicPlans; } });
|
|
313
|
+
Object.defineProperty(exports, "getSaasPlan", { enumerable: true, get: function () { return index_js_2.getPlan; } });
|
|
314
|
+
Object.defineProperty(exports, "getSaasSubscription", { enumerable: true, get: function () { return index_js_2.getSubscription; } });
|
|
315
|
+
Object.defineProperty(exports, "getSaasSubscriptionByTenant", { enumerable: true, get: function () { return index_js_2.getSubscriptionByTenant; } });
|
|
316
|
+
Object.defineProperty(exports, "listSaasInvoices", { enumerable: true, get: function () { return index_js_2.listInvoices; } });
|
|
317
|
+
Object.defineProperty(exports, "listSaasBillingEvents", { enumerable: true, get: function () { return index_js_2.listBillingEvents; } });
|
|
318
|
+
Object.defineProperty(exports, "withOperatorContext", { enumerable: true, get: function () { return index_js_2.withOperatorContext; } });
|
|
319
|
+
Object.defineProperty(exports, "seedSaasPlans", { enumerable: true, get: function () { return index_js_2.seedSaasPlans; } });
|
|
320
|
+
Object.defineProperty(exports, "signupSelfService", { enumerable: true, get: function () { return index_js_2.signupSelfService; } });
|
|
321
|
+
Object.defineProperty(exports, "subscriptionOverview", { enumerable: true, get: function () { return index_js_2.subscriptionOverview; } });
|
|
322
|
+
Object.defineProperty(exports, "standingFor", { enumerable: true, get: function () { return index_js_2.standingFor; } });
|
|
323
|
+
Object.defineProperty(exports, "entitlementsForPlan", { enumerable: true, get: function () { return index_js_2.entitlementsForPlan; } });
|
|
324
|
+
Object.defineProperty(exports, "startSaasCheckout", { enumerable: true, get: function () { return index_js_2.startCheckout; } });
|
|
325
|
+
Object.defineProperty(exports, "processSaasWebhook", { enumerable: true, get: function () { return index_js_2.processWebhook; } });
|
|
326
|
+
Object.defineProperty(exports, "changePlanForTenant", { enumerable: true, get: function () { return index_js_2.changePlanForTenant; } });
|
|
327
|
+
Object.defineProperty(exports, "cancelForTenant", { enumerable: true, get: function () { return index_js_2.cancelForTenant; } });
|
|
328
|
+
Object.defineProperty(exports, "reactivateForTenant", { enumerable: true, get: function () { return index_js_2.reactivateForTenant; } });
|
|
329
|
+
Object.defineProperty(exports, "backofficeListSubscriptions", { enumerable: true, get: function () { return index_js_2.backofficeListSubscriptions; } });
|
|
330
|
+
Object.defineProperty(exports, "backofficeOverview", { enumerable: true, get: function () { return index_js_2.backofficeOverview; } });
|
|
331
|
+
Object.defineProperty(exports, "backofficeListWebhookEvents", { enumerable: true, get: function () { return index_js_2.backofficeListWebhookEvents; } });
|
|
332
|
+
Object.defineProperty(exports, "backofficeActivateSubscription", { enumerable: true, get: function () { return index_js_2.backofficeActivateSubscription; } });
|
|
333
|
+
Object.defineProperty(exports, "retryFailedWebhookEvents", { enumerable: true, get: function () { return index_js_2.retryFailedWebhookEvents; } });
|
|
334
|
+
Object.defineProperty(exports, "runBillingCron", { enumerable: true, get: function () { return index_js_2.runBillingCron; } });
|
|
335
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,4EAA4E;;;;;;;;;;;;;;;;;;;;;AAE5E,mCAAmC;AACnC,4CAA0C;AAAjC,qGAAA,QAAQ,OAAA;AAEjB,8CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,wGAAA,UAAU,OAAA;AAEhC,gDAA2C;AAAlC,sGAAA,OAAO,OAAA;AAEhB,4BAA4B;AAC5B,6DAMmC;AALjC,oHAAA,iBAAiB,OAAA;AACjB,+GAAA,YAAY,OAAA;AACZ,qHAAA,kBAAkB,OAAA;AAClB,mHAAA,gBAAgB,OAAA;AAChB,mHAAA,gBAAgB,OAAA;AAIlB,OAAO;AACP,gDAAmF;AAA1E,yGAA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4DAAmE;AAA1D,kHAAA,mBAAmB,OAAA;AAO5B,wDAAoF;AAA3E,oHAAA,uBAAuB,OAAA;AAAE,0GAAA,aAAa,OAAA;AAE/C,8EAA8E;AAC9E,4DA2ByC;AA1BvC,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,iHAAA,qBAAqB,OAAA;AACrB,2GAAA,eAAe,OAAA;AACf,uGAAA,OAAO,OAAe;AACtB,+GAAA,eAAe,OAAuB;AACtC,uHAAA,uBAAuB,OAA+B;AACtD,4GAAA,YAAY,OAAoB;AAChC,iHAAA,iBAAiB,OAAyB;AAC1C,+GAAA,mBAAmB,OAAA;AACnB,yGAAA,aAAa,OAAA;AACb,6GAAA,iBAAiB,OAAA;AACjB,gHAAA,oBAAoB,OAAA;AACpB,uGAAA,WAAW,OAAA;AACX,+GAAA,mBAAmB,OAAA;AACnB,6GAAA,aAAa,OAAqB;AAClC,8GAAA,cAAc,OAAsB;AACpC,+GAAA,mBAAmB,OAAA;AACnB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,uHAAA,2BAA2B,OAAA;AAC3B,8GAAA,kBAAkB,OAAA;AAClB,uHAAA,2BAA2B,OAAA;AAC3B,0HAAA,8BAA8B,OAAA;AAC9B,oHAAA,wBAAwB,OAAA;AACxB,0GAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryDedupStore = void 0;
|
|
4
|
+
exports.buildDedupKey = buildDedupKey;
|
|
5
|
+
/**
|
|
6
|
+
* Implementação default — cache local por instância.
|
|
7
|
+
* `mode: 'in-memory'` é declarado explicitamente para que nenhum consumidor assuma
|
|
8
|
+
* dedup garantido sob múltiplas réplicas (RFC §4.2, G2). Um deploy horizontalmente
|
|
9
|
+
* escalado que precise da garantia real deve fornecer um DedupStore com
|
|
10
|
+
* `mode: 'shared'` (ex.: Redis/Postgres) via `TransactionalEmailProviderConfig.dedupStore`.
|
|
11
|
+
*
|
|
12
|
+
* `reserve` (Bloqueador 2) é atômico dentro deste processo: `get`/`has`/`add` sobre os
|
|
13
|
+
* `Map`/`Set` internos são chamadas síncronas — o motor JS executa cada uma até o fim
|
|
14
|
+
* sem interleaving, então duas chamadas concorrentes (`Promise.all`) nunca observam um
|
|
15
|
+
* estado intermediário. A garantia NÃO se estende a múltiplas réplicas/processos —
|
|
16
|
+
* exatamente o que `mode: 'in-memory'` já declara.
|
|
17
|
+
*/
|
|
18
|
+
class InMemoryDedupStore {
|
|
19
|
+
mode = 'in-memory';
|
|
20
|
+
entries = new Map();
|
|
21
|
+
/** Reservas em andamento (sem resultado ainda) — chave -> instante em que a reserva expira caso órfã. */
|
|
22
|
+
reservationsInFlight = new Map();
|
|
23
|
+
get(key) {
|
|
24
|
+
const entry = this.entries.get(key);
|
|
25
|
+
if (!entry)
|
|
26
|
+
return null;
|
|
27
|
+
if (entry.expiresAt <= Date.now()) {
|
|
28
|
+
this.entries.delete(key);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return entry;
|
|
32
|
+
}
|
|
33
|
+
set(key, entry) {
|
|
34
|
+
this.entries.set(key, entry);
|
|
35
|
+
this.reservationsInFlight.delete(key);
|
|
36
|
+
}
|
|
37
|
+
reserve(key, ttlMs) {
|
|
38
|
+
const existing = this.get(key);
|
|
39
|
+
if (existing) {
|
|
40
|
+
return { acquired: false, entry: existing };
|
|
41
|
+
}
|
|
42
|
+
const reservationExpiresAt = this.reservationsInFlight.get(key);
|
|
43
|
+
// Reserva órfã (processo anterior morreu antes de chamar `set`) — expira e libera a chave
|
|
44
|
+
// em vez de bloquear envios para sempre; não é o mecanismo de dedup em si, só limpeza.
|
|
45
|
+
if (reservationExpiresAt !== undefined && reservationExpiresAt > Date.now()) {
|
|
46
|
+
return { acquired: false, entry: null };
|
|
47
|
+
}
|
|
48
|
+
this.reservationsInFlight.set(key, Date.now() + ttlMs);
|
|
49
|
+
return { acquired: true };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.InMemoryDedupStore = InMemoryDedupStore;
|
|
53
|
+
function buildDedupKey(to, template, idempotencyKey) {
|
|
54
|
+
return `${to}::${template}::${idempotencyKey}`;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=dedup-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dedup-store.js","sourceRoot":"","sources":["../../../src/mail/dedup-store.ts"],"names":[],"mappings":";;;AAsDA,sCAEC;AAtDD;;;;;;;;;;;;GAYG;AACH,MAAa,kBAAkB;IACpB,IAAI,GAAG,WAAoB,CAAC;IACpB,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IACzD,yGAAyG;IACxF,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElE,GAAG,CAAC,GAAW;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,IAAI,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YAClC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,KAAiB;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CAAC,GAAW,EAAE,KAAa;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAC9C,CAAC;QAED,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChE,0FAA0F;QAC1F,uFAAuF;QACvF,IAAI,oBAAoB,KAAK,SAAS,IAAI,oBAAoB,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YAC5E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAC1C,CAAC;QAED,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;QACvD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;CACF;AArCD,gDAqCC;AAED,SAAgB,aAAa,CAAC,EAAU,EAAE,QAAgB,EAAE,cAAsB;IAChF,OAAO,GAAG,EAAE,KAAK,QAAQ,KAAK,cAAc,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRetryableError = exports.TRANSACTIONAL_EMAIL_CONTRACT_VERSION = exports.MIN_DEDUP_WINDOW_MS = exports.DEFAULT_TIMEOUT_MS = exports.DEFAULT_REMOTE_RESERVATION_POLL_INTERVAL_MS = exports.DEFAULT_REMOTE_RESERVATION_MAX_WAIT_MS = exports.PassthroughTemplateRenderer = exports.StaticSenderResolver = exports.buildDedupKey = exports.InMemoryDedupStore = exports.createTransactionalEmailProvider = exports.sendEmail = void 0;
|
|
4
|
+
// Wrapper mínimo original (mantido — consumido hoje por apps/api/src/routes/auth.ts).
|
|
5
|
+
var resend_js_1 = require("./resend.js");
|
|
6
|
+
Object.defineProperty(exports, "sendEmail", { enumerable: true, get: function () { return resend_js_1.sendEmail; } });
|
|
7
|
+
// cap.communication.transactional-email — Provider canônico (RFC-CAPABILITY-TRANSACTIONAL-EMAIL-001 v0.2).
|
|
8
|
+
var provider_js_1 = require("./provider.js");
|
|
9
|
+
Object.defineProperty(exports, "createTransactionalEmailProvider", { enumerable: true, get: function () { return provider_js_1.createTransactionalEmailProvider; } });
|
|
10
|
+
var dedup_store_js_1 = require("./dedup-store.js");
|
|
11
|
+
Object.defineProperty(exports, "InMemoryDedupStore", { enumerable: true, get: function () { return dedup_store_js_1.InMemoryDedupStore; } });
|
|
12
|
+
Object.defineProperty(exports, "buildDedupKey", { enumerable: true, get: function () { return dedup_store_js_1.buildDedupKey; } });
|
|
13
|
+
var sender_resolver_js_1 = require("./sender-resolver.js");
|
|
14
|
+
Object.defineProperty(exports, "StaticSenderResolver", { enumerable: true, get: function () { return sender_resolver_js_1.StaticSenderResolver; } });
|
|
15
|
+
var template_renderer_js_1 = require("./template-renderer.js");
|
|
16
|
+
Object.defineProperty(exports, "PassthroughTemplateRenderer", { enumerable: true, get: function () { return template_renderer_js_1.PassthroughTemplateRenderer; } });
|
|
17
|
+
var types_js_1 = require("./types.js");
|
|
18
|
+
Object.defineProperty(exports, "DEFAULT_REMOTE_RESERVATION_MAX_WAIT_MS", { enumerable: true, get: function () { return types_js_1.DEFAULT_REMOTE_RESERVATION_MAX_WAIT_MS; } });
|
|
19
|
+
Object.defineProperty(exports, "DEFAULT_REMOTE_RESERVATION_POLL_INTERVAL_MS", { enumerable: true, get: function () { return types_js_1.DEFAULT_REMOTE_RESERVATION_POLL_INTERVAL_MS; } });
|
|
20
|
+
Object.defineProperty(exports, "DEFAULT_TIMEOUT_MS", { enumerable: true, get: function () { return types_js_1.DEFAULT_TIMEOUT_MS; } });
|
|
21
|
+
Object.defineProperty(exports, "MIN_DEDUP_WINDOW_MS", { enumerable: true, get: function () { return types_js_1.MIN_DEDUP_WINDOW_MS; } });
|
|
22
|
+
Object.defineProperty(exports, "TRANSACTIONAL_EMAIL_CONTRACT_VERSION", { enumerable: true, get: function () { return types_js_1.TRANSACTIONAL_EMAIL_CONTRACT_VERSION; } });
|
|
23
|
+
Object.defineProperty(exports, "isRetryableError", { enumerable: true, get: function () { return types_js_1.isRetryableError; } });
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mail/index.ts"],"names":[],"mappings":";;;AAAA,sFAAsF;AACtF,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAGlB,2GAA2G;AAC3G,6CAAiE;AAAxD,+HAAA,gCAAgC,OAAA;AAGzC,mDAAqE;AAA5D,oHAAA,kBAAkB,OAAA;AAAE,+GAAA,aAAa,OAAA;AAC1C,2DAA4D;AAAnD,0HAAA,oBAAoB,OAAA;AAC7B,+DAAqE;AAA5D,mIAAA,2BAA2B,OAAA;AAkBpC,uCAOoB;AANlB,kIAAA,sCAAsC,OAAA;AACtC,uIAAA,2CAA2C,OAAA;AAC3C,8GAAA,kBAAkB,OAAA;AAClB,+GAAA,mBAAmB,OAAA;AACnB,gIAAA,oCAAoC,OAAA;AACpC,4GAAA,gBAAgB,OAAA"}
|