@saasicat/nest 0.13.0 → 0.15.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/dist/_entries.cjs +1529 -1345
- package/dist/admin/index.d.cts +8 -6
- package/dist/admin/index.d.ts +8 -6
- package/dist/admin/index.js +13 -12
- package/dist/{admin-resources.module-Cms8MY6h.d.ts → admin-resources.module-BY5r_1MG.d.ts} +29 -3
- package/dist/{admin-resources.module-BZN_yBFj.d.cts → admin-resources.module-DGgGSdzN.d.cts} +29 -3
- package/dist/{admin-stats.module-15ac5KY3.d.ts → admin-stats.service-Db2exT_d.d.ts} +2 -23
- package/dist/{admin-stats.module-v4SVvWzj.d.cts → admin-stats.service-HUZIU448.d.cts} +2 -23
- package/dist/{aggregation-CfI0bOsQ.d.cts → aggregation-SKfXu09x.d.cts} +35 -3
- package/dist/{aggregation-BibpEO0t.d.ts → aggregation-o0LMenvl.d.ts} +35 -3
- package/dist/billing/index.d.cts +2 -2
- package/dist/billing/index.d.ts +2 -2
- package/dist/billing/index.js +4 -3
- package/dist/catalog/index.js +3 -2
- package/dist/checkout-offer/index.d.cts +2 -1
- package/dist/checkout-offer/index.d.ts +2 -1
- package/dist/checkout-offer/index.js +2 -1
- package/dist/checkout-offer.module-Ca3_TieR.d.ts +39 -0
- package/dist/checkout-offer.module-DmlpPevf.d.cts +39 -0
- package/dist/{checkout-offer.module-Y0hDOVrq.d.ts → checkout-offer.service-BX51dljL.d.cts} +1 -37
- package/dist/{checkout-offer.module-ZYF5IsDY.d.cts → checkout-offer.service-BX51dljL.d.ts} +1 -37
- package/dist/{chunk-2PNX2QL2.js → chunk-32EMXPU2.js} +1 -0
- package/dist/{chunk-DVFPKVLO.js → chunk-5KH2O4SF.js} +16 -4
- package/dist/{chunk-TXDH4FUA.js → chunk-7RRWI5LH.js} +1 -1
- package/dist/chunk-EWPF57AG.js +13 -0
- package/dist/{chunk-2WNM5THV.js → chunk-EXOLOJFZ.js} +58 -15
- package/dist/{chunk-HBFU5AN3.js → chunk-GJBXOCRZ.js} +4 -0
- package/dist/{chunk-IRWZC3GC.js → chunk-GLLCB4BP.js} +4 -0
- package/dist/{chunk-33TP26MR.js → chunk-P3DP6GJE.js} +4 -0
- package/dist/{chunk-FVT7KTUI.js → chunk-PLJEAUFU.js} +275 -61
- package/dist/{chunk-J3BMIR4W.js → chunk-YITTE646.js} +463 -83
- package/dist/chunk-YSC46BGM.js +21 -0
- package/dist/define-saasicat-CeDBX9ji.d.cts +46 -0
- package/dist/define-saasicat-Rc0rXrYG.d.ts +46 -0
- package/dist/enforce-quota.interceptor-CmbWX39L.d.ts +60 -0
- package/dist/enforce-quota.interceptor-DMw-bPyk.d.cts +60 -0
- package/dist/entitlement/index.d.cts +1 -1
- package/dist/entitlement/index.d.ts +1 -1
- package/dist/entitlement/index.js +7 -1
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +40 -19
- package/dist/platform/index.d.cts +13 -17
- package/dist/platform/index.d.ts +13 -17
- package/dist/platform/index.js +25 -26
- package/dist/promo/index.js +2 -1
- package/dist/{enforce-quota.interceptor-Dse3jSpU.d.cts → saas-platform.module-D3rUTiho.d.cts} +69 -62
- package/dist/{enforce-quota.interceptor-DMEvL-bE.d.ts → saas-platform.module-DLhoqKNA.d.ts} +69 -62
- package/dist/subscription-contract/index.d.cts +1 -1
- package/dist/subscription-contract/index.d.ts +1 -1
- package/dist/subscription-contract/index.js +1 -1
- package/dist/{subscription-contract.module-CG9fPKAr.d.cts → subscription-contract.module-B2uNvUJL.d.cts} +3 -1
- package/dist/{subscription-contract.module-CVebZzHR.d.ts → subscription-contract.module-edyhBr4n.d.ts} +3 -1
- package/dist/{subscription-bundle-preview.service-DBbrE_cw.d.ts → tenant-billing.controller-BwZRnJ3q.d.ts} +106 -106
- package/dist/{subscription-bundle-preview.service-BkJXHAeP.d.cts → tenant-billing.controller-CG4CaFUP.d.cts} +106 -106
- package/dist/testing/index.d.cts +6 -3
- package/dist/testing/index.d.ts +6 -3
- package/dist/testing/index.js +9 -7
- package/package.json +3 -3
- package/dist/chunk-LZHLGUQI.js +0 -190
- package/dist/chunk-WJ6BMDL3.js +0 -313
- package/dist/setup.service-BPwJ7My_.d.cts +0 -45
- package/dist/setup.service-D2mrdDDB.d.ts +0 -45
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as PlanResolverPort } from '../saas-platform.module-D3rUTiho.cjs';
|
|
2
|
+
export { P as PLAN_RESOLVER_PORT_TOKEN, S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions, o as StaticPlanResolver, T as TenantManifestControllerOptions, q as buildTenantManifestController } from '../saas-platform.module-D3rUTiho.cjs';
|
|
3
|
+
export { a as SAASICAT_PUBLIC_ROUTE_KEY, d as SaaSiCatPublicRoute, S as SetupService, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from '../define-saasicat-CeDBX9ji.cjs';
|
|
3
4
|
import { SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/types';
|
|
4
|
-
|
|
5
|
+
import { S as StaticEntitlementService } from '../enforce-quota.interceptor-DMw-bPyk.cjs';
|
|
6
|
+
export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-DMw-bPyk.cjs';
|
|
7
|
+
export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, M as MfaGuard, h as MfaService, S as SuperAdminGuard } from '../admin-stats.service-HUZIU448.cjs';
|
|
5
8
|
export { A as AdminAuditService } from '../admin-audit.service-9IqXMlZm.cjs';
|
|
6
|
-
export { e as AdminResourcesService } from '../admin-resources.module-
|
|
7
|
-
export { c as EntitlementService } from '../aggregation-
|
|
8
|
-
export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../
|
|
9
|
+
export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-DGgGSdzN.cjs';
|
|
10
|
+
export { c as EntitlementService } from '../aggregation-SKfXu09x.cjs';
|
|
11
|
+
export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../tenant-billing.controller-CG4CaFUP.cjs';
|
|
9
12
|
export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService, e as PublicMarketingCatalogService } from '../plan-versions.service-CUR2Whyr.cjs';
|
|
10
13
|
export { c as DiscoveryScanner } from '../discovery.scanner-DLgEvuoy.cjs';
|
|
11
14
|
export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.cjs';
|
|
12
15
|
export { f as PromoCodesService } from '../service-DX8KbGXl.cjs';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-
|
|
16
|
+
export { a as CheckoutOfferModule, b as CheckoutOfferModuleOptions } from '../checkout-offer.module-DmlpPevf.cjs';
|
|
17
|
+
export { C as CheckoutOfferService } from '../checkout-offer.service-BX51dljL.cjs';
|
|
18
|
+
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-B2uNvUJL.cjs';
|
|
16
19
|
export { S as SubscriptionContractService } from '../subscription-contract.service--cm47ZJJ.cjs';
|
|
17
20
|
import '@nestjs/common';
|
|
18
21
|
import '../di-CcNeq9v-.cjs';
|
|
@@ -23,13 +26,6 @@ import '../subscription-bundles.module-DCpV-Pb5.cjs';
|
|
|
23
26
|
import '@nestjs/core';
|
|
24
27
|
import 'rxjs';
|
|
25
28
|
|
|
26
|
-
/**
|
|
27
|
-
* Typed identity helper for the high-level SaaSiCat configuration. It keeps
|
|
28
|
-
* literal types and gives editors one place for completion without adding
|
|
29
|
-
* runtime behavior.
|
|
30
|
-
*/
|
|
31
|
-
declare function defineSaaSiCat<const T extends SaasPlatformModuleOptions>(options: T): T;
|
|
32
|
-
|
|
33
29
|
/**
|
|
34
30
|
* Standard `tenantId → planId` resolver backed by the canonical subscription
|
|
35
31
|
* repository. This removes the identical resolver class most applications
|
|
@@ -105,4 +101,4 @@ declare class TenantManifestService {
|
|
|
105
101
|
getManifest(tenantId: string): Promise<TenantManifest>;
|
|
106
102
|
}
|
|
107
103
|
|
|
108
|
-
export { PlanResolverPort, QuotaProvidersUsageSnapshot,
|
|
104
|
+
export { PlanResolverPort, QuotaProvidersUsageSnapshot, StaticEntitlementService, SubscriptionPlanResolver, type TenantManifest, TenantManifestService, type TenantNavItem };
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as PlanResolverPort } from '../saas-platform.module-DLhoqKNA.js';
|
|
2
|
+
export { P as PLAN_RESOLVER_PORT_TOKEN, S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions, o as StaticPlanResolver, T as TenantManifestControllerOptions, q as buildTenantManifestController } from '../saas-platform.module-DLhoqKNA.js';
|
|
3
|
+
export { a as SAASICAT_PUBLIC_ROUTE_KEY, d as SaaSiCatPublicRoute, S as SetupService, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from '../define-saasicat-Rc0rXrYG.js';
|
|
3
4
|
import { SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/types';
|
|
4
|
-
|
|
5
|
+
import { S as StaticEntitlementService } from '../enforce-quota.interceptor-CmbWX39L.js';
|
|
6
|
+
export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-CmbWX39L.js';
|
|
7
|
+
export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, M as MfaGuard, h as MfaService, S as SuperAdminGuard } from '../admin-stats.service-Db2exT_d.js';
|
|
5
8
|
export { A as AdminAuditService } from '../admin-audit.service-9IqXMlZm.js';
|
|
6
|
-
export { e as AdminResourcesService } from '../admin-resources.module-
|
|
7
|
-
export { c as EntitlementService } from '../aggregation-
|
|
8
|
-
export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../
|
|
9
|
+
export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-BY5r_1MG.js';
|
|
10
|
+
export { c as EntitlementService } from '../aggregation-o0LMenvl.js';
|
|
11
|
+
export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../tenant-billing.controller-BwZRnJ3q.js';
|
|
9
12
|
export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService, e as PublicMarketingCatalogService } from '../plan-versions.service-BB36Q1bg.js';
|
|
10
13
|
export { c as DiscoveryScanner } from '../discovery.scanner-DLgEvuoy.js';
|
|
11
14
|
export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.js';
|
|
12
15
|
export { f as PromoCodesService } from '../service-DX8KbGXl.js';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-
|
|
16
|
+
export { a as CheckoutOfferModule, b as CheckoutOfferModuleOptions } from '../checkout-offer.module-Ca3_TieR.js';
|
|
17
|
+
export { C as CheckoutOfferService } from '../checkout-offer.service-BX51dljL.js';
|
|
18
|
+
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-edyhBr4n.js';
|
|
16
19
|
export { S as SubscriptionContractService } from '../subscription-contract.service--cm47ZJJ.js';
|
|
17
20
|
import '@nestjs/common';
|
|
18
21
|
import '../di-CcNeq9v-.js';
|
|
@@ -23,13 +26,6 @@ import '../subscription-bundles.module-BQmoozm5.js';
|
|
|
23
26
|
import '@nestjs/core';
|
|
24
27
|
import 'rxjs';
|
|
25
28
|
|
|
26
|
-
/**
|
|
27
|
-
* Typed identity helper for the high-level SaaSiCat configuration. It keeps
|
|
28
|
-
* literal types and gives editors one place for completion without adding
|
|
29
|
-
* runtime behavior.
|
|
30
|
-
*/
|
|
31
|
-
declare function defineSaaSiCat<const T extends SaasPlatformModuleOptions>(options: T): T;
|
|
32
|
-
|
|
33
29
|
/**
|
|
34
30
|
* Standard `tenantId → planId` resolver backed by the canonical subscription
|
|
35
31
|
* repository. This removes the identical resolver class most applications
|
|
@@ -105,4 +101,4 @@ declare class TenantManifestService {
|
|
|
105
101
|
getManifest(tenantId: string): Promise<TenantManifest>;
|
|
106
102
|
}
|
|
107
103
|
|
|
108
|
-
export { PlanResolverPort, QuotaProvidersUsageSnapshot,
|
|
104
|
+
export { PlanResolverPort, QuotaProvidersUsageSnapshot, StaticEntitlementService, SubscriptionPlanResolver, type TenantManifest, TenantManifestService, type TenantNavItem };
|
package/dist/platform/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineSaaSiCat
|
|
3
|
+
} from "../chunk-EWPF57AG.js";
|
|
1
4
|
import {
|
|
2
5
|
EnforceQuotaInterceptor,
|
|
3
6
|
PLAN_RESOLVER_PORT_TOKEN,
|
|
@@ -5,34 +8,30 @@ import {
|
|
|
5
8
|
QuotaProvidersUsageSnapshot,
|
|
6
9
|
STATIC_FEATURE_GUARD_CONFIG_TOKEN,
|
|
7
10
|
SaasPlatformModule,
|
|
11
|
+
SetupModule,
|
|
12
|
+
SetupService,
|
|
8
13
|
StaticEntitlementService,
|
|
9
14
|
StaticFeatureGuard,
|
|
10
15
|
StaticPlanResolver,
|
|
11
16
|
SubscriptionPlanResolver,
|
|
12
17
|
TenantManifestService,
|
|
13
18
|
buildTenantManifestController
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import {
|
|
16
|
-
SetupModule,
|
|
17
|
-
SetupService
|
|
18
|
-
} from "../chunk-WJ6BMDL3.js";
|
|
19
|
+
} from "../chunk-YITTE646.js";
|
|
19
20
|
import {
|
|
20
21
|
PromoCodeRateLimitGuard
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import {
|
|
23
|
-
AdminStatsModule,
|
|
24
|
-
AdminStatsService
|
|
25
|
-
} from "../chunk-LZHLGUQI.js";
|
|
22
|
+
} from "../chunk-GLLCB4BP.js";
|
|
26
23
|
import {
|
|
27
24
|
AdminBypassRlsInterceptor,
|
|
28
25
|
AdminManifestModule,
|
|
29
26
|
AdminManifestService,
|
|
30
27
|
AdminModule,
|
|
31
28
|
AdminResourcesService,
|
|
29
|
+
AdminStatsModule,
|
|
30
|
+
AdminStatsService,
|
|
32
31
|
MfaGuard,
|
|
33
32
|
MfaService,
|
|
34
33
|
SuperAdminGuard
|
|
35
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-PLJEAUFU.js";
|
|
36
35
|
import {
|
|
37
36
|
ComposedTenantAuthGuard,
|
|
38
37
|
PendingPlanMaterializationService,
|
|
@@ -41,14 +40,14 @@ import {
|
|
|
41
40
|
SubscriptionBundlesService,
|
|
42
41
|
TenantAdminGuard,
|
|
43
42
|
TenantBillingController
|
|
44
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-5KH2O4SF.js";
|
|
45
44
|
import {
|
|
46
45
|
PromoCodesService
|
|
47
46
|
} from "../chunk-E7AJ42AB.js";
|
|
48
47
|
import {
|
|
49
48
|
SubscriptionContractModule,
|
|
50
49
|
SubscriptionContractService
|
|
51
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-32EMXPU2.js";
|
|
52
51
|
import {
|
|
53
52
|
BundlesService,
|
|
54
53
|
CatalogEntriesService,
|
|
@@ -58,7 +57,7 @@ import {
|
|
|
58
57
|
PlansService,
|
|
59
58
|
PromotionsService,
|
|
60
59
|
PublicMarketingCatalogService
|
|
61
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-P3DP6GJE.js";
|
|
62
61
|
import "../chunk-WPUVJRIN.js";
|
|
63
62
|
import {
|
|
64
63
|
AdminAuditService
|
|
@@ -66,30 +65,27 @@ import {
|
|
|
66
65
|
import {
|
|
67
66
|
CheckoutOfferModule,
|
|
68
67
|
CheckoutOfferService
|
|
69
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-GJBXOCRZ.js";
|
|
70
69
|
import "../chunk-MDIZUVIK.js";
|
|
70
|
+
import {
|
|
71
|
+
SAASICAT_PUBLIC_ROUTE_KEY,
|
|
72
|
+
SaaSiCatPublicRoute,
|
|
73
|
+
isSaaSiCatPublicRoute
|
|
74
|
+
} from "../chunk-YSC46BGM.js";
|
|
71
75
|
import "../chunk-V34AA7C7.js";
|
|
72
76
|
import {
|
|
73
77
|
DiscoveryScanner
|
|
74
78
|
} from "../chunk-Z3FWN3HJ.js";
|
|
75
79
|
import {
|
|
76
80
|
EntitlementService
|
|
77
|
-
} from "../chunk-
|
|
81
|
+
} from "../chunk-EXOLOJFZ.js";
|
|
78
82
|
import "../chunk-R2QOSVAA.js";
|
|
79
83
|
import "../chunk-NYLON2VC.js";
|
|
80
84
|
import "../chunk-WKVBNTYC.js";
|
|
81
85
|
import "../chunk-L4KTQ6CL.js";
|
|
82
86
|
import "../chunk-SABTXESR.js";
|
|
83
87
|
import "../chunk-L4SUWH5B.js";
|
|
84
|
-
import
|
|
85
|
-
__name
|
|
86
|
-
} from "../chunk-SHUYVCID.js";
|
|
87
|
-
|
|
88
|
-
// src/platform/define-saasicat.ts
|
|
89
|
-
function defineSaaSiCat(options) {
|
|
90
|
-
return options;
|
|
91
|
-
}
|
|
92
|
-
__name(defineSaaSiCat, "defineSaaSiCat");
|
|
88
|
+
import "../chunk-SHUYVCID.js";
|
|
93
89
|
export {
|
|
94
90
|
AdminAuditService,
|
|
95
91
|
AdminBypassRlsInterceptor,
|
|
@@ -122,8 +118,10 @@ export {
|
|
|
122
118
|
PublicMarketingCatalogService,
|
|
123
119
|
QUOTA_PROVIDERS_TOKEN,
|
|
124
120
|
QuotaProvidersUsageSnapshot,
|
|
121
|
+
SAASICAT_PUBLIC_ROUTE_KEY,
|
|
125
122
|
STATIC_FEATURE_GUARD_CONFIG_TOKEN,
|
|
126
123
|
SaasPlatformModule as SaaSiCatModule,
|
|
124
|
+
SaaSiCatPublicRoute,
|
|
127
125
|
SaasPlatformModule,
|
|
128
126
|
SetupModule,
|
|
129
127
|
SetupService,
|
|
@@ -140,5 +138,6 @@ export {
|
|
|
140
138
|
TenantBillingController,
|
|
141
139
|
TenantManifestService,
|
|
142
140
|
buildTenantManifestController,
|
|
143
|
-
defineSaaSiCat
|
|
141
|
+
defineSaaSiCat,
|
|
142
|
+
isSaaSiCatPublicRoute
|
|
144
143
|
};
|
package/dist/promo/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
buildPromoCodeAdminController,
|
|
11
11
|
hashIp,
|
|
12
12
|
ipFingerprint
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-GLLCB4BP.js";
|
|
14
14
|
import {
|
|
15
15
|
PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN,
|
|
16
16
|
PROMO_CODE_REPOSITORY_TOKEN,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
computeRegularStartsAt
|
|
29
29
|
} from "../chunk-E7AJ42AB.js";
|
|
30
30
|
import "../chunk-E56W4U2P.js";
|
|
31
|
+
import "../chunk-YSC46BGM.js";
|
|
31
32
|
import {
|
|
32
33
|
computeIncludedVat,
|
|
33
34
|
grossFromNet,
|
package/dist/{enforce-quota.interceptor-Dse3jSpU.d.cts → saas-platform.module-D3rUTiho.d.cts}
RENAMED
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { Type,
|
|
2
|
-
import { PlanCatalog, SaasicatPersistenceAdapter, MfaPort, AuditPort, RlsBypassPort, PlanCatalogReadSink, SubscriptionRepository, PlanVersionRepository, TransactionRunner, QuotaProvider, FeatureUiRegistry, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, AdminResourcesPort, FirstTimeCustomerCheck } from '@saasicat/types';
|
|
1
|
+
import { Type, DynamicModule, ForwardReference, Provider, CanActivate, FactoryProvider } from '@nestjs/common';
|
|
2
|
+
import { SuperAdminProvisioningPort, PlanCatalog, SaasicatPersistenceAdapter, MfaPort, AuditPort, RlsBypassPort, PlanCatalogReadSink, SubscriptionRepository, PlanVersionRepository, TransactionRunner, QuotaProvider, FeatureUiRegistry, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, AdminResourcesPort, FirstTimeCustomerCheck } from '@saasicat/types';
|
|
3
3
|
import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
|
|
4
|
-
import { b as AdminManifestConfig, d as AdminResourcesModuleOptions } from './admin-resources.module-
|
|
4
|
+
import { b as AdminManifestConfig, d as AdminResourcesModuleOptions, g as AdminStatsModuleOptions } from './admin-resources.module-DGgGSdzN.cjs';
|
|
5
5
|
import { E as EntitlementResolutionConfig } from './plan-resolution-CFCoUkrE.cjs';
|
|
6
|
+
import { a as SubscriptionContractModuleOptions } from './subscription-contract.module-B2uNvUJL.cjs';
|
|
6
7
|
import { a as PromoCodesModuleOptions } from './module-CSN8j8Tp.cjs';
|
|
7
8
|
import { b as DiscoveryAppInfo } from './discovery.scanner-DLgEvuoy.cjs';
|
|
8
9
|
import { b as CatalogModuleOptions } from './catalog.module-Dw2Hrbyu.cjs';
|
|
10
|
+
import { b as CheckoutOfferModuleOptions } from './checkout-offer.module-DmlpPevf.cjs';
|
|
9
11
|
import { t as TenantBillingModuleOptions, p as SubscriptionBundleModuleOptions, n as SubscriptionBundleControllerOptions } from './subscription-bundles.module-DCpV-Pb5.cjs';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
interface SetupModuleOptions {
|
|
14
|
+
/**
|
|
15
|
+
* App adapter for the existence check + creation of the first SUPER_ADMIN. A
|
|
16
|
+
* full `UserManagementPort` adapter (CLI) satisfies this contract as well, so
|
|
17
|
+
* it can be reused.
|
|
18
|
+
*/
|
|
19
|
+
provisioningPort: ProviderSpec<SuperAdminProvisioningPort>;
|
|
20
|
+
/** Env-var name of the setup token. Default `SETUP_TOKEN`. */
|
|
21
|
+
setupTokenEnvVar?: string;
|
|
22
|
+
/** Authenticator issuer for MFA enrollment. Default `SuperAdmin`. */
|
|
23
|
+
mfaIssuer?: string;
|
|
24
|
+
/** Modules that provide dependencies used by `provisioningPort`. */
|
|
25
|
+
imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
|
|
26
|
+
/** Additional providers registered in the DynamicModule itself. */
|
|
27
|
+
extraProviders?: Provider[];
|
|
28
|
+
/** Register the module globally — default `false`. */
|
|
29
|
+
global?: boolean;
|
|
30
|
+
}
|
|
31
|
+
declare class SetupModule {
|
|
32
|
+
static forRoot(options: SetupModuleOptions): DynamicModule;
|
|
33
|
+
}
|
|
12
34
|
|
|
13
35
|
declare const PLAN_RESOLVER_PORT_TOKEN: unique symbol;
|
|
14
36
|
interface PlanResolverPort {
|
|
@@ -135,6 +157,27 @@ interface SaasPlatformPromoCodesOptions extends Omit<PromoCodesModuleOptions, 'p
|
|
|
135
157
|
*/
|
|
136
158
|
adminController?: false;
|
|
137
159
|
}
|
|
160
|
+
/** First-run setup, deriving the provisioning adapter from persistence by default. */
|
|
161
|
+
interface SaasPlatformSetupOptions extends Omit<SetupModuleOptions, 'provisioningPort' | 'global'> {
|
|
162
|
+
provisioningPort?: SetupModuleOptions['provisioningPort'];
|
|
163
|
+
}
|
|
164
|
+
/** Admin dashboard statistics; the audit port can come from persistence. */
|
|
165
|
+
interface SaasPlatformAdminStatsOptions extends Omit<AdminStatsModuleOptions, 'auditStatsPort' | 'global'> {
|
|
166
|
+
auditStatsPort?: AdminStatsModuleOptions['auditStatsPort'];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Public checkout-offer flow. Catalog repositories default to the persistence
|
|
170
|
+
* bundle, while the app still supplies its checkout-offer repository.
|
|
171
|
+
*/
|
|
172
|
+
interface SaasPlatformCheckoutOfferOptions extends Omit<CheckoutOfferModuleOptions, 'bundleRepository' | 'planRepository' | 'catalogEntryRepository' | 'global'> {
|
|
173
|
+
bundleRepository?: CheckoutOfferModuleOptions['bundleRepository'];
|
|
174
|
+
planRepository?: CheckoutOfferModuleOptions['planRepository'];
|
|
175
|
+
catalogEntryRepository?: CheckoutOfferModuleOptions['catalogEntryRepository'];
|
|
176
|
+
}
|
|
177
|
+
/** Subscription-contract service, deriving its repository from persistence by default. */
|
|
178
|
+
interface SaasPlatformSubscriptionContractOptions extends Omit<SubscriptionContractModuleOptions, 'subscriptionContractRepository' | 'global'> {
|
|
179
|
+
subscriptionContractRepository?: SubscriptionContractModuleOptions['subscriptionContractRepository'];
|
|
180
|
+
}
|
|
138
181
|
interface SaasPlatformModuleOptions {
|
|
139
182
|
/**
|
|
140
183
|
* Plan catalog. Either as an already-loaded object (quickstart, comes
|
|
@@ -219,6 +262,8 @@ interface SaasPlatformModuleOptions {
|
|
|
219
262
|
* factory.
|
|
220
263
|
*/
|
|
221
264
|
adminManifestConfig?: AdminManifestConfig | Pick<FactoryProvider<AdminManifestConfig>, 'useFactory' | 'inject'>;
|
|
265
|
+
/** Providers required by `adminManifestConfig` when it uses a factory. */
|
|
266
|
+
adminManifestExtraProviders?: Provider[];
|
|
222
267
|
/**
|
|
223
268
|
* Infer manifest capabilities for platform endpoints mounted by this
|
|
224
269
|
* module. Default `true`; set `false` only when the app owns the complete
|
|
@@ -276,6 +321,21 @@ interface SaasPlatformModuleOptions {
|
|
|
276
321
|
* without the public preview endpoint; pass an object to enable preview.
|
|
277
322
|
*/
|
|
278
323
|
promoCodes?: false | true | SaasPlatformPromoCodesOptions;
|
|
324
|
+
/**
|
|
325
|
+
* First-run SuperAdmin setup. `true` uses
|
|
326
|
+
* `persistence.core.superAdminProvisioning`; an object customizes it or
|
|
327
|
+
* supplies an app-specific provisioning adapter.
|
|
328
|
+
*/
|
|
329
|
+
setup?: false | true | SaasPlatformSetupOptions;
|
|
330
|
+
/** SuperAdmin dashboard statistics with app-specific subscription/promo ports. */
|
|
331
|
+
adminStats?: false | SaasPlatformAdminStatsOptions;
|
|
332
|
+
/** Public checkout-offer flow; catalog repositories reuse `persistence.catalog`. */
|
|
333
|
+
checkoutOffer?: false | SaasPlatformCheckoutOfferOptions;
|
|
334
|
+
/**
|
|
335
|
+
* Subscription-contract service. `true` reuses
|
|
336
|
+
* `persistence.entitlement.subscriptionContractRepository`.
|
|
337
|
+
*/
|
|
338
|
+
subscriptionContract?: false | true | SaasPlatformSubscriptionContractOptions;
|
|
279
339
|
/**
|
|
280
340
|
* Enable the tenant manifest — the app UI gets a filtered manifest per
|
|
281
341
|
* tenant with features, quotas and visible navigation. Requires that
|
|
@@ -308,9 +368,9 @@ interface SaasPlatformModuleOptions {
|
|
|
308
368
|
globalFeatureGuard?: boolean;
|
|
309
369
|
}
|
|
310
370
|
/**
|
|
311
|
-
* Bundles
|
|
312
|
-
*
|
|
313
|
-
*
|
|
371
|
+
* Bundles the complete standard SaaSiCat backend stack into a single
|
|
372
|
+
* `forRoot({...})` call. Reduces AppModule boilerplate and eliminates the
|
|
373
|
+
* ordering trap.
|
|
314
374
|
*
|
|
315
375
|
* Quickstart path (Prisma + PostgreSQL on the canonical schema):
|
|
316
376
|
*
|
|
@@ -330,57 +390,4 @@ declare class SaasPlatformModule {
|
|
|
330
390
|
static forRoot(options: SaasPlatformModuleOptions): DynamicModule;
|
|
331
391
|
}
|
|
332
392
|
|
|
333
|
-
|
|
334
|
-
planId: string | null;
|
|
335
|
-
features: readonly string[];
|
|
336
|
-
/** quotaKey → limit (`-1` = unlimited). */
|
|
337
|
-
quotas: Readonly<Record<string, number>>;
|
|
338
|
-
}
|
|
339
|
-
declare class StaticEntitlementService {
|
|
340
|
-
private readonly catalog;
|
|
341
|
-
private readonly resolver;
|
|
342
|
-
constructor(catalog: PlanCatalog, resolver: PlanResolverPort);
|
|
343
|
-
/**
|
|
344
|
-
* Returns the effective features + quotas of a tenant from the
|
|
345
|
-
* plan catalog. When the plan is missing: an empty snapshot (no feature,
|
|
346
|
-
* all quotas at 0).
|
|
347
|
-
*/
|
|
348
|
-
snapshot(tenantId: string): Promise<StaticEntitlementSnapshot>;
|
|
349
|
-
/** Convenience helper for tests / synchronous checks in the UI manifest. */
|
|
350
|
-
hasFeature(tenantId: string, featureKey: string): Promise<boolean>;
|
|
351
|
-
quotaLimit(tenantId: string, quotaKey: string): Promise<number | null>;
|
|
352
|
-
private findPlan;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
declare const STATIC_FEATURE_GUARD_CONFIG_TOKEN: unique symbol;
|
|
356
|
-
interface StaticFeatureGuardConfig {
|
|
357
|
-
/**
|
|
358
|
-
* Resolver for the user role (e.g. `(user) => user.platformRole`).
|
|
359
|
-
* SUPER_ADMIN gets a bypass.
|
|
360
|
-
*/
|
|
361
|
-
userRoleResolver?: (user: unknown) => string | undefined;
|
|
362
|
-
/**
|
|
363
|
-
* Resolver for the tenant ID from the request. Default:
|
|
364
|
-
* `request.tenantId ?? request.user?.tenantId`.
|
|
365
|
-
*/
|
|
366
|
-
tenantIdResolver?: (request: unknown) => string | undefined;
|
|
367
|
-
}
|
|
368
|
-
declare class StaticFeatureGuard implements CanActivate {
|
|
369
|
-
private readonly reflector;
|
|
370
|
-
private readonly entitlements;
|
|
371
|
-
private readonly config;
|
|
372
|
-
constructor(reflector: Reflector, entitlements: StaticEntitlementService, config?: StaticFeatureGuardConfig | null);
|
|
373
|
-
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
declare const QUOTA_PROVIDERS_TOKEN: unique symbol;
|
|
377
|
-
declare class EnforceQuotaInterceptor implements NestInterceptor {
|
|
378
|
-
private readonly reflector;
|
|
379
|
-
private readonly entitlements;
|
|
380
|
-
private readonly providers;
|
|
381
|
-
constructor(reflector: Reflector, entitlements: StaticEntitlementService, providers?: ReadonlyArray<QuotaProvider> | null);
|
|
382
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
383
|
-
private check;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export { EnforceQuotaInterceptor as E, PLAN_RESOLVER_PORT_TOKEN as P, QUOTA_PROVIDERS_TOKEN as Q, type SaasPlatformAdapters as S, type TenantManifestControllerOptions as T, StaticEntitlementService as a, StaticFeatureGuard as b, StaticPlanResolver as c, type SaasPlatformModuleOptions as d, type PlanResolverPort as e, STATIC_FEATURE_GUARD_CONFIG_TOKEN as f, SaasPlatformModule as g, type SaasPlatformAdminResourcesOptions as h, type SaasPlatformCatalogOptions as i, type SaasPlatformPromoCodesOptions as j, type SaasPlatformSubscriptionBundlesOptions as k, type SaasPlatformTenantAuthGuards as l, type SaasPlatformTenantBillingOptions as m, type StaticEntitlementSnapshot as n, type StaticFeatureGuardConfig as o, buildTenantManifestController as p };
|
|
393
|
+
export { PLAN_RESOLVER_PORT_TOKEN as P, SaasPlatformModule as S, type TenantManifestControllerOptions as T, type SaasPlatformAdapters as a, type SaasPlatformAdminResourcesOptions as b, type SaasPlatformAdminStatsOptions as c, type SaasPlatformCatalogOptions as d, type SaasPlatformCheckoutOfferOptions as e, type SaasPlatformModuleOptions as f, type SaasPlatformPromoCodesOptions as g, type SaasPlatformSetupOptions as h, type SaasPlatformSubscriptionBundlesOptions as i, type SaasPlatformSubscriptionContractOptions as j, type SaasPlatformTenantAuthGuards as k, type SaasPlatformTenantBillingOptions as l, SetupModule as m, type SetupModuleOptions as n, StaticPlanResolver as o, type PlanResolverPort as p, buildTenantManifestController as q };
|
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { Type,
|
|
2
|
-
import { PlanCatalog, SaasicatPersistenceAdapter, MfaPort, AuditPort, RlsBypassPort, PlanCatalogReadSink, SubscriptionRepository, PlanVersionRepository, TransactionRunner, QuotaProvider, FeatureUiRegistry, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, AdminResourcesPort, FirstTimeCustomerCheck } from '@saasicat/types';
|
|
1
|
+
import { Type, DynamicModule, ForwardReference, Provider, CanActivate, FactoryProvider } from '@nestjs/common';
|
|
2
|
+
import { SuperAdminProvisioningPort, PlanCatalog, SaasicatPersistenceAdapter, MfaPort, AuditPort, RlsBypassPort, PlanCatalogReadSink, SubscriptionRepository, PlanVersionRepository, TransactionRunner, QuotaProvider, FeatureUiRegistry, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, AdminResourcesPort, FirstTimeCustomerCheck } from '@saasicat/types';
|
|
3
3
|
import { P as ProviderSpec } from './di-CcNeq9v-.js';
|
|
4
|
-
import { b as AdminManifestConfig, d as AdminResourcesModuleOptions } from './admin-resources.module-
|
|
4
|
+
import { b as AdminManifestConfig, d as AdminResourcesModuleOptions, g as AdminStatsModuleOptions } from './admin-resources.module-BY5r_1MG.js';
|
|
5
5
|
import { E as EntitlementResolutionConfig } from './plan-resolution-CFCoUkrE.js';
|
|
6
|
+
import { a as SubscriptionContractModuleOptions } from './subscription-contract.module-edyhBr4n.js';
|
|
6
7
|
import { a as PromoCodesModuleOptions } from './module-DgYJur6f.js';
|
|
7
8
|
import { b as DiscoveryAppInfo } from './discovery.scanner-DLgEvuoy.js';
|
|
8
9
|
import { b as CatalogModuleOptions } from './catalog.module-BKObceo0.js';
|
|
10
|
+
import { b as CheckoutOfferModuleOptions } from './checkout-offer.module-Ca3_TieR.js';
|
|
9
11
|
import { t as TenantBillingModuleOptions, p as SubscriptionBundleModuleOptions, n as SubscriptionBundleControllerOptions } from './subscription-bundles.module-BQmoozm5.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
interface SetupModuleOptions {
|
|
14
|
+
/**
|
|
15
|
+
* App adapter for the existence check + creation of the first SUPER_ADMIN. A
|
|
16
|
+
* full `UserManagementPort` adapter (CLI) satisfies this contract as well, so
|
|
17
|
+
* it can be reused.
|
|
18
|
+
*/
|
|
19
|
+
provisioningPort: ProviderSpec<SuperAdminProvisioningPort>;
|
|
20
|
+
/** Env-var name of the setup token. Default `SETUP_TOKEN`. */
|
|
21
|
+
setupTokenEnvVar?: string;
|
|
22
|
+
/** Authenticator issuer for MFA enrollment. Default `SuperAdmin`. */
|
|
23
|
+
mfaIssuer?: string;
|
|
24
|
+
/** Modules that provide dependencies used by `provisioningPort`. */
|
|
25
|
+
imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
|
|
26
|
+
/** Additional providers registered in the DynamicModule itself. */
|
|
27
|
+
extraProviders?: Provider[];
|
|
28
|
+
/** Register the module globally — default `false`. */
|
|
29
|
+
global?: boolean;
|
|
30
|
+
}
|
|
31
|
+
declare class SetupModule {
|
|
32
|
+
static forRoot(options: SetupModuleOptions): DynamicModule;
|
|
33
|
+
}
|
|
12
34
|
|
|
13
35
|
declare const PLAN_RESOLVER_PORT_TOKEN: unique symbol;
|
|
14
36
|
interface PlanResolverPort {
|
|
@@ -135,6 +157,27 @@ interface SaasPlatformPromoCodesOptions extends Omit<PromoCodesModuleOptions, 'p
|
|
|
135
157
|
*/
|
|
136
158
|
adminController?: false;
|
|
137
159
|
}
|
|
160
|
+
/** First-run setup, deriving the provisioning adapter from persistence by default. */
|
|
161
|
+
interface SaasPlatformSetupOptions extends Omit<SetupModuleOptions, 'provisioningPort' | 'global'> {
|
|
162
|
+
provisioningPort?: SetupModuleOptions['provisioningPort'];
|
|
163
|
+
}
|
|
164
|
+
/** Admin dashboard statistics; the audit port can come from persistence. */
|
|
165
|
+
interface SaasPlatformAdminStatsOptions extends Omit<AdminStatsModuleOptions, 'auditStatsPort' | 'global'> {
|
|
166
|
+
auditStatsPort?: AdminStatsModuleOptions['auditStatsPort'];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Public checkout-offer flow. Catalog repositories default to the persistence
|
|
170
|
+
* bundle, while the app still supplies its checkout-offer repository.
|
|
171
|
+
*/
|
|
172
|
+
interface SaasPlatformCheckoutOfferOptions extends Omit<CheckoutOfferModuleOptions, 'bundleRepository' | 'planRepository' | 'catalogEntryRepository' | 'global'> {
|
|
173
|
+
bundleRepository?: CheckoutOfferModuleOptions['bundleRepository'];
|
|
174
|
+
planRepository?: CheckoutOfferModuleOptions['planRepository'];
|
|
175
|
+
catalogEntryRepository?: CheckoutOfferModuleOptions['catalogEntryRepository'];
|
|
176
|
+
}
|
|
177
|
+
/** Subscription-contract service, deriving its repository from persistence by default. */
|
|
178
|
+
interface SaasPlatformSubscriptionContractOptions extends Omit<SubscriptionContractModuleOptions, 'subscriptionContractRepository' | 'global'> {
|
|
179
|
+
subscriptionContractRepository?: SubscriptionContractModuleOptions['subscriptionContractRepository'];
|
|
180
|
+
}
|
|
138
181
|
interface SaasPlatformModuleOptions {
|
|
139
182
|
/**
|
|
140
183
|
* Plan catalog. Either as an already-loaded object (quickstart, comes
|
|
@@ -219,6 +262,8 @@ interface SaasPlatformModuleOptions {
|
|
|
219
262
|
* factory.
|
|
220
263
|
*/
|
|
221
264
|
adminManifestConfig?: AdminManifestConfig | Pick<FactoryProvider<AdminManifestConfig>, 'useFactory' | 'inject'>;
|
|
265
|
+
/** Providers required by `adminManifestConfig` when it uses a factory. */
|
|
266
|
+
adminManifestExtraProviders?: Provider[];
|
|
222
267
|
/**
|
|
223
268
|
* Infer manifest capabilities for platform endpoints mounted by this
|
|
224
269
|
* module. Default `true`; set `false` only when the app owns the complete
|
|
@@ -276,6 +321,21 @@ interface SaasPlatformModuleOptions {
|
|
|
276
321
|
* without the public preview endpoint; pass an object to enable preview.
|
|
277
322
|
*/
|
|
278
323
|
promoCodes?: false | true | SaasPlatformPromoCodesOptions;
|
|
324
|
+
/**
|
|
325
|
+
* First-run SuperAdmin setup. `true` uses
|
|
326
|
+
* `persistence.core.superAdminProvisioning`; an object customizes it or
|
|
327
|
+
* supplies an app-specific provisioning adapter.
|
|
328
|
+
*/
|
|
329
|
+
setup?: false | true | SaasPlatformSetupOptions;
|
|
330
|
+
/** SuperAdmin dashboard statistics with app-specific subscription/promo ports. */
|
|
331
|
+
adminStats?: false | SaasPlatformAdminStatsOptions;
|
|
332
|
+
/** Public checkout-offer flow; catalog repositories reuse `persistence.catalog`. */
|
|
333
|
+
checkoutOffer?: false | SaasPlatformCheckoutOfferOptions;
|
|
334
|
+
/**
|
|
335
|
+
* Subscription-contract service. `true` reuses
|
|
336
|
+
* `persistence.entitlement.subscriptionContractRepository`.
|
|
337
|
+
*/
|
|
338
|
+
subscriptionContract?: false | true | SaasPlatformSubscriptionContractOptions;
|
|
279
339
|
/**
|
|
280
340
|
* Enable the tenant manifest — the app UI gets a filtered manifest per
|
|
281
341
|
* tenant with features, quotas and visible navigation. Requires that
|
|
@@ -308,9 +368,9 @@ interface SaasPlatformModuleOptions {
|
|
|
308
368
|
globalFeatureGuard?: boolean;
|
|
309
369
|
}
|
|
310
370
|
/**
|
|
311
|
-
* Bundles
|
|
312
|
-
*
|
|
313
|
-
*
|
|
371
|
+
* Bundles the complete standard SaaSiCat backend stack into a single
|
|
372
|
+
* `forRoot({...})` call. Reduces AppModule boilerplate and eliminates the
|
|
373
|
+
* ordering trap.
|
|
314
374
|
*
|
|
315
375
|
* Quickstart path (Prisma + PostgreSQL on the canonical schema):
|
|
316
376
|
*
|
|
@@ -330,57 +390,4 @@ declare class SaasPlatformModule {
|
|
|
330
390
|
static forRoot(options: SaasPlatformModuleOptions): DynamicModule;
|
|
331
391
|
}
|
|
332
392
|
|
|
333
|
-
|
|
334
|
-
planId: string | null;
|
|
335
|
-
features: readonly string[];
|
|
336
|
-
/** quotaKey → limit (`-1` = unlimited). */
|
|
337
|
-
quotas: Readonly<Record<string, number>>;
|
|
338
|
-
}
|
|
339
|
-
declare class StaticEntitlementService {
|
|
340
|
-
private readonly catalog;
|
|
341
|
-
private readonly resolver;
|
|
342
|
-
constructor(catalog: PlanCatalog, resolver: PlanResolverPort);
|
|
343
|
-
/**
|
|
344
|
-
* Returns the effective features + quotas of a tenant from the
|
|
345
|
-
* plan catalog. When the plan is missing: an empty snapshot (no feature,
|
|
346
|
-
* all quotas at 0).
|
|
347
|
-
*/
|
|
348
|
-
snapshot(tenantId: string): Promise<StaticEntitlementSnapshot>;
|
|
349
|
-
/** Convenience helper for tests / synchronous checks in the UI manifest. */
|
|
350
|
-
hasFeature(tenantId: string, featureKey: string): Promise<boolean>;
|
|
351
|
-
quotaLimit(tenantId: string, quotaKey: string): Promise<number | null>;
|
|
352
|
-
private findPlan;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
declare const STATIC_FEATURE_GUARD_CONFIG_TOKEN: unique symbol;
|
|
356
|
-
interface StaticFeatureGuardConfig {
|
|
357
|
-
/**
|
|
358
|
-
* Resolver for the user role (e.g. `(user) => user.platformRole`).
|
|
359
|
-
* SUPER_ADMIN gets a bypass.
|
|
360
|
-
*/
|
|
361
|
-
userRoleResolver?: (user: unknown) => string | undefined;
|
|
362
|
-
/**
|
|
363
|
-
* Resolver for the tenant ID from the request. Default:
|
|
364
|
-
* `request.tenantId ?? request.user?.tenantId`.
|
|
365
|
-
*/
|
|
366
|
-
tenantIdResolver?: (request: unknown) => string | undefined;
|
|
367
|
-
}
|
|
368
|
-
declare class StaticFeatureGuard implements CanActivate {
|
|
369
|
-
private readonly reflector;
|
|
370
|
-
private readonly entitlements;
|
|
371
|
-
private readonly config;
|
|
372
|
-
constructor(reflector: Reflector, entitlements: StaticEntitlementService, config?: StaticFeatureGuardConfig | null);
|
|
373
|
-
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
declare const QUOTA_PROVIDERS_TOKEN: unique symbol;
|
|
377
|
-
declare class EnforceQuotaInterceptor implements NestInterceptor {
|
|
378
|
-
private readonly reflector;
|
|
379
|
-
private readonly entitlements;
|
|
380
|
-
private readonly providers;
|
|
381
|
-
constructor(reflector: Reflector, entitlements: StaticEntitlementService, providers?: ReadonlyArray<QuotaProvider> | null);
|
|
382
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
383
|
-
private check;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export { EnforceQuotaInterceptor as E, PLAN_RESOLVER_PORT_TOKEN as P, QUOTA_PROVIDERS_TOKEN as Q, type SaasPlatformAdapters as S, type TenantManifestControllerOptions as T, StaticEntitlementService as a, StaticFeatureGuard as b, StaticPlanResolver as c, type SaasPlatformModuleOptions as d, type PlanResolverPort as e, STATIC_FEATURE_GUARD_CONFIG_TOKEN as f, SaasPlatformModule as g, type SaasPlatformAdminResourcesOptions as h, type SaasPlatformCatalogOptions as i, type SaasPlatformPromoCodesOptions as j, type SaasPlatformSubscriptionBundlesOptions as k, type SaasPlatformTenantAuthGuards as l, type SaasPlatformTenantBillingOptions as m, type StaticEntitlementSnapshot as n, type StaticFeatureGuardConfig as o, buildTenantManifestController as p };
|
|
393
|
+
export { PLAN_RESOLVER_PORT_TOKEN as P, SaasPlatformModule as S, type TenantManifestControllerOptions as T, type SaasPlatformAdapters as a, type SaasPlatformAdminResourcesOptions as b, type SaasPlatformAdminStatsOptions as c, type SaasPlatformCatalogOptions as d, type SaasPlatformCheckoutOfferOptions as e, type SaasPlatformModuleOptions as f, type SaasPlatformPromoCodesOptions as g, type SaasPlatformSetupOptions as h, type SaasPlatformSubscriptionBundlesOptions as i, type SaasPlatformSubscriptionContractOptions as j, type SaasPlatformTenantAuthGuards as k, type SaasPlatformTenantBillingOptions as l, SetupModule as m, type SetupModuleOptions as n, StaticPlanResolver as o, type PlanResolverPort as p, buildTenantManifestController as q };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from '../subscription-contract.service--cm47ZJJ.cjs';
|
|
2
|
-
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-
|
|
2
|
+
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-B2uNvUJL.cjs';
|
|
3
3
|
import '@saasicat/types';
|
|
4
4
|
import '@nestjs/common';
|
|
5
5
|
import '../di-CcNeq9v-.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from '../subscription-contract.service--cm47ZJJ.js';
|
|
2
|
-
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-
|
|
2
|
+
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-edyhBr4n.js';
|
|
3
3
|
import '@saasicat/types';
|
|
4
4
|
import '@nestjs/common';
|
|
5
5
|
import '../di-CcNeq9v-.js';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
contractLineItemToInvoiceLineItem,
|
|
5
5
|
sortContractLineItemsForInvoice,
|
|
6
6
|
subscriptionContractToInvoiceSnapshot
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-32EMXPU2.js";
|
|
8
8
|
import "../chunk-MDIZUVIK.js";
|
|
9
9
|
import {
|
|
10
10
|
SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
|