@saasicat/nest 0.5.0 → 0.7.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/admin/index.cjs +3 -8
- package/dist/admin/index.d.cts +5 -33
- package/dist/admin/index.d.ts +5 -33
- package/dist/admin/index.js +2 -2
- package/dist/{admin-manifest.config-DxTfZ8-L.d.cts → admin-manifest.config-DyrQNT7M.d.cts} +1 -1
- package/dist/{admin-manifest.config-DxTfZ8-L.d.ts → admin-manifest.config-DyrQNT7M.d.ts} +1 -1
- package/dist/admin-manifest.service-Cp6uwvmt.d.cts +33 -0
- package/dist/admin-manifest.service-UGgzR1x-.d.ts +33 -0
- package/dist/{aggregation-DGCyoN5d.d.ts → aggregation-BibpEO0t.d.ts} +6 -59
- package/dist/{aggregation-Bt1i_whS.d.cts → aggregation-CfI0bOsQ.d.cts} +6 -59
- package/dist/billing/index.cjs +19 -107
- package/dist/billing/index.d.cts +8 -30
- package/dist/billing/index.d.ts +8 -30
- package/dist/billing/index.js +6 -8
- package/dist/catalog/index.cjs +1160 -1985
- package/dist/catalog/index.d.cts +9 -124
- package/dist/catalog/index.d.ts +9 -124
- package/dist/catalog/index.js +3 -25
- package/dist/checkout-offer/index.js +2 -2
- package/dist/{chunk-2VNZYRDV.js → chunk-52UTQRD3.js} +1 -1
- package/dist/{chunk-V7HUZ6UQ.js → chunk-5DDCSGZC.js} +1106 -1919
- package/dist/{chunk-S2OZ5RIM.js → chunk-6LP7CDS2.js} +15 -68
- package/dist/{chunk-NWLOILP6.js → chunk-A2QBXDJC.js} +15 -7
- package/dist/{chunk-XSGU2Y2O.js → chunk-CK54YKVK.js} +2 -33
- package/dist/{chunk-SYEVGPFC.js → chunk-K3OPNVFR.js} +1 -1
- package/dist/{chunk-XCZ3TTFK.js → chunk-N3WANKSA.js} +0 -2
- package/dist/{chunk-MV6LW5UB.js → chunk-R2QOSVAA.js} +2 -2
- package/dist/{chunk-NFOSITWB.js → chunk-RZU4HIAN.js} +12 -45
- package/dist/{chunk-YNEW3L63.js → chunk-SD3TT2BR.js} +1 -1
- package/dist/{chunk-P6MYZMXQ.js → chunk-U6HT27J7.js} +3 -8
- package/dist/{chunk-7MLGHWKO.js → chunk-WKVBNTYC.js} +2 -0
- package/dist/{chunk-ZL4LLE2Z.js → chunk-ZLUGQE5D.js} +1 -1
- package/dist/{enforce-quota.interceptor-3HmbeHTM.d.ts → enforce-quota.interceptor-Dj1Kusr5.d.ts} +9 -4
- package/dist/{enforce-quota.interceptor-HmdZFg41.d.cts → enforce-quota.interceptor-cv7r80VM.d.cts} +9 -4
- package/dist/entitlement/index.cjs +13 -46
- package/dist/entitlement/index.d.cts +4 -3
- package/dist/entitlement/index.d.ts +4 -3
- package/dist/entitlement/index.js +6 -8
- package/dist/index.cjs +1348 -2300
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +14 -42
- package/dist/platform/index.cjs +28 -54
- package/dist/platform/index.d.cts +4 -3
- package/dist/platform/index.d.ts +4 -3
- package/dist/platform/index.js +9 -6
- package/dist/promo/index.cjs +2 -2
- package/dist/promo/index.js +3 -3
- package/dist/registration/index.cjs +2 -34
- package/dist/registration/index.d.cts +3 -21
- package/dist/registration/index.d.ts +3 -21
- package/dist/registration/index.js +1 -3
- package/dist/testing/index.cjs +26 -255
- package/dist/testing/index.d.cts +5 -37
- package/dist/testing/index.d.ts +5 -37
- package/dist/testing/index.js +6 -206
- package/package.json +3 -3
package/dist/billing/index.cjs
CHANGED
|
@@ -50,7 +50,6 @@ __export(billing_exports, {
|
|
|
50
50
|
PLAN_CATALOG_READ_SINK_TOKEN: () => PLAN_CATALOG_READ_SINK_TOKEN,
|
|
51
51
|
PLAN_CATALOG_TOKEN: () => PLAN_CATALOG_TOKEN,
|
|
52
52
|
PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN: () => PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
|
|
53
|
-
PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN: () => PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN,
|
|
54
53
|
PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN: () => PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN,
|
|
55
54
|
PUBLIC_CATALOG_PROJECT_KEY_TOKEN: () => PUBLIC_CATALOG_PROJECT_KEY_TOKEN,
|
|
56
55
|
PendingPlanMaterializationService: () => PendingPlanMaterializationService,
|
|
@@ -346,8 +345,8 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
346
345
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
347
346
|
}
|
|
348
347
|
__name(_ts_decorate, "_ts_decorate");
|
|
349
|
-
var PLAN_CATALOG_TOKEN = /* @__PURE__ */ Symbol("PLAN_CATALOG");
|
|
350
|
-
var PLAN_CATALOG_READ_SINK_TOKEN = /* @__PURE__ */ Symbol("PLAN_CATALOG_READ_SINK");
|
|
348
|
+
var PLAN_CATALOG_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/PLAN_CATALOG");
|
|
349
|
+
var PLAN_CATALOG_READ_SINK_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/PLAN_CATALOG_READ_SINK");
|
|
351
350
|
var PlanCatalogModule = class _PlanCatalogModule {
|
|
352
351
|
static {
|
|
353
352
|
__name(this, "PlanCatalogModule");
|
|
@@ -481,25 +480,6 @@ function isFeaturePlannedOnly(catalog, featureKey) {
|
|
|
481
480
|
__name(isFeaturePlannedOnly, "isFeaturePlannedOnly");
|
|
482
481
|
|
|
483
482
|
// src/entitlement/aggregation.ts
|
|
484
|
-
function aggregateBusinessTypeQuotas(snapshot) {
|
|
485
|
-
const sums = {};
|
|
486
|
-
for (const bundle of snapshot.bundles) {
|
|
487
|
-
for (const [key, value] of Object.entries(bundle.quotas)) {
|
|
488
|
-
if (sums[key] === -1 || value === -1) {
|
|
489
|
-
sums[key] = -1;
|
|
490
|
-
} else {
|
|
491
|
-
sums[key] = (sums[key] ?? 0) + value;
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
for (const [key, value] of Object.entries(snapshot.quotaOverrides)) {
|
|
496
|
-
if (value !== void 0) {
|
|
497
|
-
sums[key] = value;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return sums;
|
|
501
|
-
}
|
|
502
|
-
__name(aggregateBusinessTypeQuotas, "aggregateBusinessTypeQuotas");
|
|
503
483
|
function filterActiveSubscriptionBundles(bundles, now) {
|
|
504
484
|
return bundles.filter((b) => b.canceledEffectiveAt === null || b.canceledEffectiveAt > now);
|
|
505
485
|
}
|
|
@@ -550,16 +530,6 @@ function aggregateContractLineItemEntitlements(lineItems, fallbackPlan = "UNKNOW
|
|
|
550
530
|
};
|
|
551
531
|
}
|
|
552
532
|
__name(aggregateContractLineItemEntitlements, "aggregateContractLineItemEntitlements");
|
|
553
|
-
function collectBusinessTypeFeatures(snapshot) {
|
|
554
|
-
const set = /* @__PURE__ */ new Set();
|
|
555
|
-
for (const bundle of snapshot.bundles) {
|
|
556
|
-
for (const f of bundle.features) {
|
|
557
|
-
set.add(f);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
return Array.from(set);
|
|
561
|
-
}
|
|
562
|
-
__name(collectBusinessTypeFeatures, "collectBusinessTypeFeatures");
|
|
563
533
|
function filterPlannedOnlyFeatures(features, catalog) {
|
|
564
534
|
const out = /* @__PURE__ */ new Set();
|
|
565
535
|
for (const f of features) {
|
|
@@ -592,8 +562,6 @@ function applyCustomLimits(base, custom) {
|
|
|
592
562
|
}
|
|
593
563
|
__name(applyCustomLimits, "applyCustomLimits");
|
|
594
564
|
function aggregateLimits(input, catalog, now) {
|
|
595
|
-
const businessTypeQuotas = input.businessTypeVersion ? aggregateBusinessTypeQuotas(input.businessTypeVersion) : {};
|
|
596
|
-
const businessTypeFeatures = input.businessTypeVersion ? collectBusinessTypeFeatures(input.businessTypeVersion) : [];
|
|
597
565
|
const activeBundles = filterActiveSubscriptionBundles(input.subscriptionBundles ?? [], now);
|
|
598
566
|
const subBundleQuotas = aggregateSubscriptionBundleQuotas(activeBundles);
|
|
599
567
|
const subBundleFeatures = collectSubscriptionBundleFeatures(activeBundles);
|
|
@@ -601,13 +569,6 @@ function aggregateLimits(input, catalog, now) {
|
|
|
601
569
|
for (const [k, v] of Object.entries(input.planVersion.quotas)) {
|
|
602
570
|
quotas[k] = v;
|
|
603
571
|
}
|
|
604
|
-
for (const [k, v] of Object.entries(businessTypeQuotas)) {
|
|
605
|
-
if (quotas[k] === -1 || v === -1) {
|
|
606
|
-
quotas[k] = -1;
|
|
607
|
-
} else {
|
|
608
|
-
quotas[k] = (quotas[k] ?? 0) + v;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
572
|
for (const [k, v] of Object.entries(subBundleQuotas)) {
|
|
612
573
|
if (quotas[k] === -1 || v === -1) {
|
|
613
574
|
quotas[k] = -1;
|
|
@@ -617,7 +578,6 @@ function aggregateLimits(input, catalog, now) {
|
|
|
617
578
|
}
|
|
618
579
|
const features = /* @__PURE__ */ new Set([
|
|
619
580
|
...input.planVersion.features,
|
|
620
|
-
...businessTypeFeatures,
|
|
621
581
|
...subBundleFeatures
|
|
622
582
|
]);
|
|
623
583
|
const withCustom = applyCustomLimits({
|
|
@@ -743,6 +703,7 @@ function resolveEntitlementPlan(input, config, now) {
|
|
|
743
703
|
__name(resolveEntitlementPlan, "resolveEntitlementPlan");
|
|
744
704
|
|
|
745
705
|
// src/entitlement/tokens.ts
|
|
706
|
+
var ENTITLEMENT_SERVICE_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/EntitlementService");
|
|
746
707
|
var SUBSCRIPTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/SubscriptionRepository");
|
|
747
708
|
var PLAN_VERSION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/PlanVersionRepository");
|
|
748
709
|
var TRANSACTION_RUNNER_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/TransactionRunner");
|
|
@@ -1092,7 +1053,7 @@ var FeatureGuard = class _FeatureGuard {
|
|
|
1092
1053
|
FeatureGuard = _ts_decorate3([
|
|
1093
1054
|
(0, import_common4.Injectable)(),
|
|
1094
1055
|
_ts_param2(0, (0, import_common4.Inject)(import_core.Reflector)),
|
|
1095
|
-
_ts_param2(1, (0, import_common4.Inject)(
|
|
1056
|
+
_ts_param2(1, (0, import_common4.Inject)(ENTITLEMENT_SERVICE_TOKEN)),
|
|
1096
1057
|
_ts_param2(2, (0, import_common4.Optional)()),
|
|
1097
1058
|
_ts_param2(2, (0, import_common4.Inject)(FEATURE_GUARD_CONFIG_TOKEN)),
|
|
1098
1059
|
_ts_param2(3, (0, import_common4.Optional)()),
|
|
@@ -1113,7 +1074,6 @@ var import_types3 = require("@saasicat/types");
|
|
|
1113
1074
|
// src/billing/public-catalog.tokens.ts
|
|
1114
1075
|
var PUBLIC_CATALOG_PROJECT_KEY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_PROJECT_KEY");
|
|
1115
1076
|
var PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_BUNDLE_REPOSITORY");
|
|
1116
|
-
var PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY");
|
|
1117
1077
|
var PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_MARKETING_REPOSITORY");
|
|
1118
1078
|
var PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol("PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY");
|
|
1119
1079
|
|
|
@@ -1601,15 +1561,13 @@ var PublicCatalogController = class {
|
|
|
1601
1561
|
projectKey;
|
|
1602
1562
|
marketingRepo;
|
|
1603
1563
|
bundleRepo;
|
|
1604
|
-
businessTypeRepo;
|
|
1605
1564
|
catalogEntryRepo;
|
|
1606
|
-
constructor(planCatalog, featureRegistry, projectKey = null, marketingRepo = null, bundleRepo = null,
|
|
1565
|
+
constructor(planCatalog, featureRegistry, projectKey = null, marketingRepo = null, bundleRepo = null, catalogEntryRepo = null) {
|
|
1607
1566
|
this.planCatalog = planCatalog;
|
|
1608
1567
|
this.featureRegistry = featureRegistry;
|
|
1609
1568
|
this.projectKey = projectKey;
|
|
1610
1569
|
this.marketingRepo = marketingRepo;
|
|
1611
1570
|
this.bundleRepo = bundleRepo;
|
|
1612
|
-
this.businessTypeRepo = businessTypeRepo;
|
|
1613
1571
|
this.catalogEntryRepo = catalogEntryRepo;
|
|
1614
1572
|
}
|
|
1615
1573
|
async listPlans(lang, localeParam = "de") {
|
|
@@ -1701,41 +1659,6 @@ var PublicCatalogController = class {
|
|
|
1701
1659
|
return /* @__PURE__ */ new Map();
|
|
1702
1660
|
}
|
|
1703
1661
|
}
|
|
1704
|
-
/**
|
|
1705
|
-
* SPEC_V2 §11.1 M6 Pack 2c — public catalog endpoint for BusinessTypes
|
|
1706
|
-
* (stem list with live versions + bundle composition + marketing).
|
|
1707
|
-
*/
|
|
1708
|
-
async listBusinessTypes(lang, localeParam = "de") {
|
|
1709
|
-
const locale = lang || localeParam;
|
|
1710
|
-
if (!this.businessTypeRepo || !this.bundleRepo || !this.projectKey) return [];
|
|
1711
|
-
const stems = await this.businessTypeRepo.list({
|
|
1712
|
-
projectKey: this.projectKey
|
|
1713
|
-
});
|
|
1714
|
-
const out = [];
|
|
1715
|
-
for (const stem of stems) {
|
|
1716
|
-
const versions = await this.businessTypeRepo.listVersions(stem.id);
|
|
1717
|
-
const live = versions.find((v) => v.publishedAt !== null && v.supersededAt === null);
|
|
1718
|
-
if (!live) continue;
|
|
1719
|
-
const bundleKeys = [];
|
|
1720
|
-
for (const ref of live.bundles) {
|
|
1721
|
-
const bv = await this.bundleRepo.findVersionById(ref.bundleVersionId);
|
|
1722
|
-
if (bv) bundleKeys.push(bv.bundleKey);
|
|
1723
|
-
}
|
|
1724
|
-
const marketing = await this.lookupMarketing("BUSINESS_TYPE", live.id, locale);
|
|
1725
|
-
out.push({
|
|
1726
|
-
businessTypeVersionId: live.id,
|
|
1727
|
-
businessTypeKey: stem.businessTypeKey,
|
|
1728
|
-
label: stem.label,
|
|
1729
|
-
description: stem.description ?? null,
|
|
1730
|
-
monthlyNet: live.monthlyNet,
|
|
1731
|
-
yearlyNet: live.yearlyNet,
|
|
1732
|
-
bundleKeys,
|
|
1733
|
-
quotaOverrides: live.quotaOverrides,
|
|
1734
|
-
marketing
|
|
1735
|
-
});
|
|
1736
|
-
}
|
|
1737
|
-
return out;
|
|
1738
|
-
}
|
|
1739
1662
|
async lookupMarketing(targetType, targetVersionId, locale) {
|
|
1740
1663
|
if (!this.marketingRepo || !this.projectKey) return void 0;
|
|
1741
1664
|
const rows = await this.marketingRepo.list({
|
|
@@ -1804,17 +1727,6 @@ _ts_decorate9([
|
|
|
1804
1727
|
]),
|
|
1805
1728
|
_ts_metadata6("design:returntype", Promise)
|
|
1806
1729
|
], PublicCatalogController.prototype, "listBundles", null);
|
|
1807
|
-
_ts_decorate9([
|
|
1808
|
-
(0, import_common10.Get)("business-types"),
|
|
1809
|
-
_ts_param6(0, (0, import_common10.Query)("lang")),
|
|
1810
|
-
_ts_param6(1, (0, import_common10.Query)("locale")),
|
|
1811
|
-
_ts_metadata6("design:type", Function),
|
|
1812
|
-
_ts_metadata6("design:paramtypes", [
|
|
1813
|
-
String,
|
|
1814
|
-
void 0
|
|
1815
|
-
]),
|
|
1816
|
-
_ts_metadata6("design:returntype", Promise)
|
|
1817
|
-
], PublicCatalogController.prototype, "listBusinessTypes", null);
|
|
1818
1730
|
PublicCatalogController = _ts_decorate9([
|
|
1819
1731
|
(0, import_common10.Controller)("billing"),
|
|
1820
1732
|
_ts_param6(0, (0, import_common10.Inject)(PLAN_CATALOG_TOKEN)),
|
|
@@ -1826,9 +1738,7 @@ PublicCatalogController = _ts_decorate9([
|
|
|
1826
1738
|
_ts_param6(4, (0, import_common10.Optional)()),
|
|
1827
1739
|
_ts_param6(4, (0, import_common10.Inject)(PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN)),
|
|
1828
1740
|
_ts_param6(5, (0, import_common10.Optional)()),
|
|
1829
|
-
_ts_param6(5, (0, import_common10.Inject)(
|
|
1830
|
-
_ts_param6(6, (0, import_common10.Optional)()),
|
|
1831
|
-
_ts_param6(6, (0, import_common10.Inject)(PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN)),
|
|
1741
|
+
_ts_param6(5, (0, import_common10.Inject)(PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN)),
|
|
1832
1742
|
_ts_metadata6("design:type", Function),
|
|
1833
1743
|
_ts_metadata6("design:paramtypes", [
|
|
1834
1744
|
typeof PlanCatalog === "undefined" ? Object : PlanCatalog,
|
|
@@ -1836,7 +1746,6 @@ PublicCatalogController = _ts_decorate9([
|
|
|
1836
1746
|
Object,
|
|
1837
1747
|
Object,
|
|
1838
1748
|
Object,
|
|
1839
|
-
Object,
|
|
1840
1749
|
Object
|
|
1841
1750
|
])
|
|
1842
1751
|
], PublicCatalogController);
|
|
@@ -1871,9 +1780,6 @@ var PublicCatalogModule = class _PublicCatalogModule {
|
|
|
1871
1780
|
if (options.bundleRepository) {
|
|
1872
1781
|
providers.push(asProvider(PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, options.bundleRepository));
|
|
1873
1782
|
}
|
|
1874
|
-
if (options.businessTypeRepository) {
|
|
1875
|
-
providers.push(asProvider(PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN, options.businessTypeRepository));
|
|
1876
|
-
}
|
|
1877
1783
|
if (options.marketingRepository) {
|
|
1878
1784
|
providers.push(asProvider(PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, options.marketingRepository));
|
|
1879
1785
|
}
|
|
@@ -2038,7 +1944,13 @@ var EntitlementModule = class _EntitlementModule {
|
|
|
2038
1944
|
asProvider(SUBSCRIPTION_REPOSITORY_TOKEN, options.subscriptionRepository),
|
|
2039
1945
|
asProvider(PLAN_VERSION_REPOSITORY_TOKEN, options.planVersionRepository),
|
|
2040
1946
|
asProvider(TRANSACTION_RUNNER_TOKEN, options.transactionRunner),
|
|
2041
|
-
EntitlementService
|
|
1947
|
+
EntitlementService,
|
|
1948
|
+
// Cross-bundle-stable alias so consumers in other subpath bundles
|
|
1949
|
+
// (billing/TenantBillingModule) can inject the same instance.
|
|
1950
|
+
{
|
|
1951
|
+
provide: ENTITLEMENT_SERVICE_TOKEN,
|
|
1952
|
+
useExisting: EntitlementService
|
|
1953
|
+
}
|
|
2042
1954
|
];
|
|
2043
1955
|
if (options.resolutionConfig) {
|
|
2044
1956
|
providers.push({
|
|
@@ -2061,6 +1973,7 @@ var EntitlementModule = class _EntitlementModule {
|
|
|
2061
1973
|
providers,
|
|
2062
1974
|
exports: [
|
|
2063
1975
|
EntitlementService,
|
|
1976
|
+
ENTITLEMENT_SERVICE_TOKEN,
|
|
2064
1977
|
SUBSCRIPTION_REPOSITORY_TOKEN
|
|
2065
1978
|
]
|
|
2066
1979
|
};
|
|
@@ -2277,7 +2190,7 @@ var PlanChangePreviewService = class {
|
|
|
2277
2190
|
PlanChangePreviewService = _ts_decorate14([
|
|
2278
2191
|
(0, import_common15.Injectable)(),
|
|
2279
2192
|
_ts_param8(0, (0, import_common15.Inject)(PLAN_CATALOG_TOKEN)),
|
|
2280
|
-
_ts_param8(1, (0, import_common15.Inject)(
|
|
2193
|
+
_ts_param8(1, (0, import_common15.Inject)(ENTITLEMENT_SERVICE_TOKEN)),
|
|
2281
2194
|
_ts_param8(2, (0, import_common15.Inject)(SUBSCRIPTION_USAGE_PORT_TOKEN)),
|
|
2282
2195
|
_ts_param8(3, (0, import_common15.Inject)(USAGE_SNAPSHOT_PORT_TOKEN)),
|
|
2283
2196
|
_ts_param8(4, (0, import_common15.Optional)()),
|
|
@@ -2916,7 +2829,7 @@ var SubscriptionContractFreezeService = class {
|
|
|
2916
2829
|
SubscriptionContractFreezeService = _ts_decorate18([
|
|
2917
2830
|
(0, import_common19.Injectable)(),
|
|
2918
2831
|
_ts_param11(0, (0, import_common19.Inject)(PLAN_CATALOG_TOKEN)),
|
|
2919
|
-
_ts_param11(1, (0, import_common19.Inject)(
|
|
2832
|
+
_ts_param11(1, (0, import_common19.Inject)(ENTITLEMENT_SERVICE_TOKEN)),
|
|
2920
2833
|
_ts_param11(2, (0, import_common19.Inject)(SubscriptionContractService)),
|
|
2921
2834
|
_ts_param11(3, (0, import_common19.Inject)(CONTRACT_FREEZE_PROJECT_KEY_TOKEN)),
|
|
2922
2835
|
_ts_param11(4, (0, import_common19.Inject)(CONTRACT_FREEZE_SOURCE_PORT_TOKEN)),
|
|
@@ -4010,7 +3923,6 @@ var TenantBillingController = class _TenantBillingController {
|
|
|
4010
3923
|
periodEnd: period?.end ?? null,
|
|
4011
3924
|
nextStatus: wasTrial ? null : "ACTIVE"
|
|
4012
3925
|
});
|
|
4013
|
-
await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
|
|
4014
3926
|
if (dto.promoCode) {
|
|
4015
3927
|
if (!this.promoCodes) {
|
|
4016
3928
|
warnings.push("Promo-Code wurde gesendet, aber PromoCodesModule ist nicht geladen \u2014 der Code wurde NICHT eingel\xF6st.");
|
|
@@ -4032,6 +3944,7 @@ var TenantBillingController = class _TenantBillingController {
|
|
|
4032
3944
|
}
|
|
4033
3945
|
}
|
|
4034
3946
|
}
|
|
3947
|
+
await this.tryFreezeOnPlanChange(tenantId, dto.plan, dto.billingCycle, wasTrial);
|
|
4035
3948
|
this.entitlements.invalidateTenant(tenantId);
|
|
4036
3949
|
await this.auditLog(req, userId, "Subscription", tenantId, "COMPLETE_ONBOARDING_SUBSCRIPTION", {
|
|
4037
3950
|
plan: planResult.plan,
|
|
@@ -4291,7 +4204,7 @@ _ts_decorate24([
|
|
|
4291
4204
|
TenantBillingController = _ts_decorate24([
|
|
4292
4205
|
(0, import_common23.Controller)("billing"),
|
|
4293
4206
|
(0, import_common23.UseGuards)(ComposedTenantAuthGuard),
|
|
4294
|
-
_ts_param15(0, (0, import_common23.Inject)(
|
|
4207
|
+
_ts_param15(0, (0, import_common23.Inject)(ENTITLEMENT_SERVICE_TOKEN)),
|
|
4295
4208
|
_ts_param15(1, (0, import_common23.Inject)(PlanChangePreviewService)),
|
|
4296
4209
|
_ts_param15(2, (0, import_common23.Inject)(SUBSCRIPTION_USAGE_PORT_TOKEN)),
|
|
4297
4210
|
_ts_param15(3, (0, import_common23.Inject)(USAGE_SNAPSHOT_PORT_TOKEN)),
|
|
@@ -4737,7 +4650,7 @@ SubscriptionBundlePreviewService = _ts_decorate27([
|
|
|
4737
4650
|
])
|
|
4738
4651
|
], SubscriptionBundlePreviewService);
|
|
4739
4652
|
function resolveBundlePriceNet(bundleVersion, planKey, billingCycle) {
|
|
4740
|
-
const override = (bundleVersion.pricingOverrides ?? []).find((o) => o.planId === planKey
|
|
4653
|
+
const override = (bundleVersion.pricingOverrides ?? []).find((o) => o.planId === planKey);
|
|
4741
4654
|
const yearly = billingCycle === "YEARLY";
|
|
4742
4655
|
const raw = yearly ? override?.yearlyNet !== void 0 ? override.yearlyNet : bundleVersion.yearlyNet : override?.monthlyNet !== void 0 ? override.monthlyNet : bundleVersion.monthlyNet;
|
|
4743
4656
|
if (raw === null || raw === void 0) return null;
|
|
@@ -5145,7 +5058,6 @@ SubscriptionBundleModule = _ts_decorate30([
|
|
|
5145
5058
|
PLAN_CATALOG_READ_SINK_TOKEN,
|
|
5146
5059
|
PLAN_CATALOG_TOKEN,
|
|
5147
5060
|
PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
|
|
5148
|
-
PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN,
|
|
5149
5061
|
PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN,
|
|
5150
5062
|
PUBLIC_CATALOG_PROJECT_KEY_TOKEN,
|
|
5151
5063
|
PendingPlanMaterializationService,
|
package/dist/billing/index.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BillingCycle, FeatureKey, UpsellOfferResolver, BundleRepository, CatalogEntryRepository, UpsellOffer, PlanCatalog, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, PlanCatalogImportReport, PlanId, PlanDef, QuotaKey, MarketingTopFeature, FeatureUiRegistry, MarketingProjectionRepository,
|
|
1
|
+
import { BillingCycle, FeatureKey, UpsellOfferResolver, BundleRepository, CatalogEntryRepository, UpsellOffer, PlanCatalog, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, PlanCatalogImportReport, PlanId, PlanDef, QuotaKey, MarketingTopFeature, FeatureUiRegistry, MarketingProjectionRepository, SubscriptionUsagePort, UsageSnapshotPort, NewContractLineItemData, TenantSubscriptionWritePort, SubscriptionBundleRepository, SubscriptionBundleView, SubscriptionBundleRecord, SubscriptionUsageRecord, OnboardingSelectionResponse, SubscriptionContractRepository, ConfiguratorSourcesLookup, ConfiguratorMarketingProvider, ConfiguratorCatalog, PlanRepository, BundleVersionRow } from '@saasicat/types';
|
|
2
2
|
export { BundleVersionFields, ChangeDirection, DiffResult, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
|
|
3
3
|
import * as _nestjs_common from '@nestjs/common';
|
|
4
4
|
import { CanActivate, ExecutionContext, ArgumentsHost, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
|
|
5
5
|
export { Type as NestType } from '@nestjs/common';
|
|
6
6
|
import { Reflector, BaseExceptionFilter } from '@nestjs/core';
|
|
7
|
-
import {
|
|
7
|
+
import { c as EntitlementService, a as EffectiveLimitsSnapshot, t as toEffectiveLimitsSnapshot } from '../aggregation-CfI0bOsQ.cjs';
|
|
8
8
|
import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
|
|
9
9
|
import { S as SubscriptionContractService } from '../subscription-contract.service--cm47ZJJ.cjs';
|
|
10
10
|
import { f as PromoCodesService } from '../service-DX8KbGXl.cjs';
|
|
@@ -482,26 +482,14 @@ interface PublicBundleEntry {
|
|
|
482
482
|
requiresFeatures: string[];
|
|
483
483
|
marketing?: MarketingFields;
|
|
484
484
|
}
|
|
485
|
-
interface PublicBusinessTypeEntry {
|
|
486
|
-
businessTypeVersionId: string;
|
|
487
|
-
businessTypeKey: string;
|
|
488
|
-
label: string;
|
|
489
|
-
description: string | null;
|
|
490
|
-
monthlyNet: string | null;
|
|
491
|
-
yearlyNet: string | null;
|
|
492
|
-
bundleKeys: string[];
|
|
493
|
-
quotaOverrides: Record<string, number>;
|
|
494
|
-
marketing?: MarketingFields;
|
|
495
|
-
}
|
|
496
485
|
declare class PublicCatalogController {
|
|
497
486
|
private readonly planCatalog;
|
|
498
487
|
private readonly featureRegistry;
|
|
499
488
|
private readonly projectKey;
|
|
500
489
|
private readonly marketingRepo;
|
|
501
490
|
private readonly bundleRepo;
|
|
502
|
-
private readonly businessTypeRepo;
|
|
503
491
|
private readonly catalogEntryRepo;
|
|
504
|
-
constructor(planCatalog: PlanCatalog, featureRegistry: FeatureUiRegistry, projectKey?: string | null, marketingRepo?: MarketingProjectionRepository | null, bundleRepo?: BundleRepository | null,
|
|
492
|
+
constructor(planCatalog: PlanCatalog, featureRegistry: FeatureUiRegistry, projectKey?: string | null, marketingRepo?: MarketingProjectionRepository | null, bundleRepo?: BundleRepository | null, catalogEntryRepo?: CatalogEntryRepository | null);
|
|
505
493
|
listPlans(lang?: string, localeParam?: string): Promise<PlanResponseEntry[]>;
|
|
506
494
|
listFeatureRegistry(): Promise<FeatureUiRegistry>;
|
|
507
495
|
/**
|
|
@@ -517,11 +505,6 @@ declare class PublicCatalogController {
|
|
|
517
505
|
* `requiresFeatures` then stays conservatively empty.
|
|
518
506
|
*/
|
|
519
507
|
private loadFeatureRequiresIndex;
|
|
520
|
-
/**
|
|
521
|
-
* SPEC_V2 §11.1 M6 Pack 2c — public catalog endpoint for BusinessTypes
|
|
522
|
-
* (stem list with live versions + bundle composition + marketing).
|
|
523
|
-
*/
|
|
524
|
-
listBusinessTypes(lang?: string, localeParam?: string): Promise<PublicBusinessTypeEntry[]>;
|
|
525
508
|
private lookupMarketing;
|
|
526
509
|
private toBundleEntry;
|
|
527
510
|
}
|
|
@@ -531,7 +514,7 @@ interface PublicCatalogModuleOptions {
|
|
|
531
514
|
featureUiRegistry: FeatureUiRegistry;
|
|
532
515
|
/**
|
|
533
516
|
* SPEC_V2 §11.1 M6 Pack 2c — app identity (e.g. "clubapp"). Used
|
|
534
|
-
* for marketing lookups +
|
|
517
|
+
* for marketing lookups + bundle filters.
|
|
535
518
|
* Optional; if omitted, the new endpoints return empty lists.
|
|
536
519
|
*/
|
|
537
520
|
projectKey?: string;
|
|
@@ -539,13 +522,9 @@ interface PublicCatalogModuleOptions {
|
|
|
539
522
|
* Optional. When set, `/billing/bundles` is active.
|
|
540
523
|
*/
|
|
541
524
|
bundleRepository?: ProviderSpec<BundleRepository>;
|
|
542
|
-
/**
|
|
543
|
-
* Optional. When set, `/billing/business-types` is active.
|
|
544
|
-
*/
|
|
545
|
-
businessTypeRepository?: ProviderSpec<BusinessTypeRepository>;
|
|
546
525
|
/**
|
|
547
526
|
* Optional. When set, marketing texts are merged into /billing/bundles
|
|
548
|
-
*
|
|
527
|
+
* (locale filter).
|
|
549
528
|
*/
|
|
550
529
|
marketingRepository?: ProviderSpec<MarketingProjectionRepository>;
|
|
551
530
|
/**
|
|
@@ -567,7 +546,6 @@ declare class PublicCatalogModule {
|
|
|
567
546
|
|
|
568
547
|
declare const PUBLIC_CATALOG_PROJECT_KEY_TOKEN: unique symbol;
|
|
569
548
|
declare const PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN: unique symbol;
|
|
570
|
-
declare const PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN: unique symbol;
|
|
571
549
|
declare const PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN: unique symbol;
|
|
572
550
|
|
|
573
551
|
/**
|
|
@@ -1261,8 +1239,8 @@ declare class SubscriptionBundlePreviewService {
|
|
|
1261
1239
|
}
|
|
1262
1240
|
/**
|
|
1263
1241
|
* List price (net) for the billing cycle including plan-specific
|
|
1264
|
-
* pricing override (BundlePricingOverride with `planId
|
|
1265
|
-
*
|
|
1242
|
+
* pricing override (BundlePricingOverride with `planId`). null = no price
|
|
1243
|
+
* maintained for the cycle.
|
|
1266
1244
|
*/
|
|
1267
1245
|
declare function resolveBundlePriceNet(bundleVersion: BundleVersionRow, planKey: string, billingCycle: string): number | null;
|
|
1268
1246
|
|
|
@@ -1323,4 +1301,4 @@ declare class SubscriptionBundleModule {
|
|
|
1323
1301
|
*/
|
|
1324
1302
|
declare function buildTenantSubscriptionBundlesController(extraGuards?: Array<Type<CanActivate>>): Type;
|
|
1325
1303
|
|
|
1326
|
-
export { AUDIT_CONTEXT_RESOLVER_TOKEN, type AddBundleToSubscriptionInput, type AjvErrorLike, type AuditContextResolver, type AuthGuardList, type BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, type CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, type ContractFreezeBundleSnapshot, type ContractFreezePort, type ContractFreezeSourcePort, type DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, type FeatureGuardConfig, LimitExceededFilter, type LimitsCheckRow, type LoadPlanCatalogOptions, type MarketingFields, type NextPeriodWindow, PENDING_PLAN_QUERY_PORT_TOKEN, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
|
|
1304
|
+
export { AUDIT_CONTEXT_RESOLVER_TOKEN, type AddBundleToSubscriptionInput, type AjvErrorLike, type AuditContextResolver, type AuthGuardList, type BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, type CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, type ContractFreezeBundleSnapshot, type ContractFreezePort, type ContractFreezeSourcePort, type DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, type FeatureGuardConfig, LimitExceededFilter, type LimitsCheckRow, type LoadPlanCatalogOptions, type MarketingFields, type NextPeriodWindow, PENDING_PLAN_QUERY_PORT_TOKEN, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PendingPlanMaterializationService, type PendingPlanQueryPort, type PeriodRollInput, type PlanCatalogBuildSettings, PlanCatalogImportDto, type PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, type PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, type PlanCatalogModuleOptions, PlanCatalogValidationError, type PlanChangeContext, type PlanChangePreviewDto, type PlanChangePreviewIssue, PlanChangePreviewService, type PlanChangeType, type PlanResponseEntry, type PlanSnapshotDto, PreviewPlanChangeDto, type ProrationDto, type ProrationInput, type PublicBundleEntry, PublicCatalogController, PublicCatalogModule, type PublicCatalogModuleOptions, PublishValidationError, type PublishablePlanVersion, REQUIRE_FEATURE_KEY, type RedundantFeatureHint, type RenewalDecision, type RenewalSubInput, RequireFeature, SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, SELF_SERVICE_BLOCKED_PLANS_TOKEN, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SUBSCRIPTION_USAGE_PORT_TOKEN, SUBSCRIPTION_WRITE_PORT_TOKEN, type SelfServiceBlockedBundles, type SelfServiceBlockedPlans, type SubscriptionBundleAddPreviewDto, type SubscriptionBundleCancelPreviewDto, type SubscriptionBundleConfig, type SubscriptionBundleControllerOptions, SubscriptionBundleModule, type SubscriptionBundleModuleOptions, type SubscriptionBundlePreviewContext, type SubscriptionBundlePreviewIssue, SubscriptionBundlePreviewService, SubscriptionBundlesService, SubscriptionContractFreezeService, TENANT_AUTH_GUARDS_TOKEN, TENANT_ID_RESOLVER_TOKEN, TRIAL_PROJECTION_PORT_TOKEN, TenantAdminGuard, TenantBillingController, TenantBillingModule, type TenantBillingModuleOptions, type TenantIdResolver, type TrialProjectionInput, type TrialProjectionPort, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, USAGE_SNAPSHOT_PORT_TOKEN, USER_EMAIL_RESOLVER_TOKEN, USER_ID_RESOLVER_TOKEN, type UsageResponse, type UserEmailResolver, type UserIdResolver, addMonths, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, computeProration, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead, resolveBundleCancelEffectiveAt, resolveBundlePriceNet };
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BillingCycle, FeatureKey, UpsellOfferResolver, BundleRepository, CatalogEntryRepository, UpsellOffer, PlanCatalog, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, PlanCatalogImportReport, PlanId, PlanDef, QuotaKey, MarketingTopFeature, FeatureUiRegistry, MarketingProjectionRepository,
|
|
1
|
+
import { BillingCycle, FeatureKey, UpsellOfferResolver, BundleRepository, CatalogEntryRepository, UpsellOffer, PlanCatalog, PlanCatalogReadSink, PlanCatalogReadSnapshot, PlanCatalogImportSink, PlanCatalogImportReport, PlanId, PlanDef, QuotaKey, MarketingTopFeature, FeatureUiRegistry, MarketingProjectionRepository, SubscriptionUsagePort, UsageSnapshotPort, NewContractLineItemData, TenantSubscriptionWritePort, SubscriptionBundleRepository, SubscriptionBundleView, SubscriptionBundleRecord, SubscriptionUsageRecord, OnboardingSelectionResponse, SubscriptionContractRepository, ConfiguratorSourcesLookup, ConfiguratorMarketingProvider, ConfiguratorCatalog, PlanRepository, BundleVersionRow } from '@saasicat/types';
|
|
2
2
|
export { BundleVersionFields, ChangeDirection, DiffResult, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
|
|
3
3
|
import * as _nestjs_common from '@nestjs/common';
|
|
4
4
|
import { CanActivate, ExecutionContext, ArgumentsHost, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
|
|
5
5
|
export { Type as NestType } from '@nestjs/common';
|
|
6
6
|
import { Reflector, BaseExceptionFilter } from '@nestjs/core';
|
|
7
|
-
import {
|
|
7
|
+
import { c as EntitlementService, a as EffectiveLimitsSnapshot, t as toEffectiveLimitsSnapshot } from '../aggregation-BibpEO0t.js';
|
|
8
8
|
import { P as ProviderSpec } from '../di-CcNeq9v-.js';
|
|
9
9
|
import { S as SubscriptionContractService } from '../subscription-contract.service--cm47ZJJ.js';
|
|
10
10
|
import { f as PromoCodesService } from '../service-DX8KbGXl.js';
|
|
@@ -482,26 +482,14 @@ interface PublicBundleEntry {
|
|
|
482
482
|
requiresFeatures: string[];
|
|
483
483
|
marketing?: MarketingFields;
|
|
484
484
|
}
|
|
485
|
-
interface PublicBusinessTypeEntry {
|
|
486
|
-
businessTypeVersionId: string;
|
|
487
|
-
businessTypeKey: string;
|
|
488
|
-
label: string;
|
|
489
|
-
description: string | null;
|
|
490
|
-
monthlyNet: string | null;
|
|
491
|
-
yearlyNet: string | null;
|
|
492
|
-
bundleKeys: string[];
|
|
493
|
-
quotaOverrides: Record<string, number>;
|
|
494
|
-
marketing?: MarketingFields;
|
|
495
|
-
}
|
|
496
485
|
declare class PublicCatalogController {
|
|
497
486
|
private readonly planCatalog;
|
|
498
487
|
private readonly featureRegistry;
|
|
499
488
|
private readonly projectKey;
|
|
500
489
|
private readonly marketingRepo;
|
|
501
490
|
private readonly bundleRepo;
|
|
502
|
-
private readonly businessTypeRepo;
|
|
503
491
|
private readonly catalogEntryRepo;
|
|
504
|
-
constructor(planCatalog: PlanCatalog, featureRegistry: FeatureUiRegistry, projectKey?: string | null, marketingRepo?: MarketingProjectionRepository | null, bundleRepo?: BundleRepository | null,
|
|
492
|
+
constructor(planCatalog: PlanCatalog, featureRegistry: FeatureUiRegistry, projectKey?: string | null, marketingRepo?: MarketingProjectionRepository | null, bundleRepo?: BundleRepository | null, catalogEntryRepo?: CatalogEntryRepository | null);
|
|
505
493
|
listPlans(lang?: string, localeParam?: string): Promise<PlanResponseEntry[]>;
|
|
506
494
|
listFeatureRegistry(): Promise<FeatureUiRegistry>;
|
|
507
495
|
/**
|
|
@@ -517,11 +505,6 @@ declare class PublicCatalogController {
|
|
|
517
505
|
* `requiresFeatures` then stays conservatively empty.
|
|
518
506
|
*/
|
|
519
507
|
private loadFeatureRequiresIndex;
|
|
520
|
-
/**
|
|
521
|
-
* SPEC_V2 §11.1 M6 Pack 2c — public catalog endpoint for BusinessTypes
|
|
522
|
-
* (stem list with live versions + bundle composition + marketing).
|
|
523
|
-
*/
|
|
524
|
-
listBusinessTypes(lang?: string, localeParam?: string): Promise<PublicBusinessTypeEntry[]>;
|
|
525
508
|
private lookupMarketing;
|
|
526
509
|
private toBundleEntry;
|
|
527
510
|
}
|
|
@@ -531,7 +514,7 @@ interface PublicCatalogModuleOptions {
|
|
|
531
514
|
featureUiRegistry: FeatureUiRegistry;
|
|
532
515
|
/**
|
|
533
516
|
* SPEC_V2 §11.1 M6 Pack 2c — app identity (e.g. "clubapp"). Used
|
|
534
|
-
* for marketing lookups +
|
|
517
|
+
* for marketing lookups + bundle filters.
|
|
535
518
|
* Optional; if omitted, the new endpoints return empty lists.
|
|
536
519
|
*/
|
|
537
520
|
projectKey?: string;
|
|
@@ -539,13 +522,9 @@ interface PublicCatalogModuleOptions {
|
|
|
539
522
|
* Optional. When set, `/billing/bundles` is active.
|
|
540
523
|
*/
|
|
541
524
|
bundleRepository?: ProviderSpec<BundleRepository>;
|
|
542
|
-
/**
|
|
543
|
-
* Optional. When set, `/billing/business-types` is active.
|
|
544
|
-
*/
|
|
545
|
-
businessTypeRepository?: ProviderSpec<BusinessTypeRepository>;
|
|
546
525
|
/**
|
|
547
526
|
* Optional. When set, marketing texts are merged into /billing/bundles
|
|
548
|
-
*
|
|
527
|
+
* (locale filter).
|
|
549
528
|
*/
|
|
550
529
|
marketingRepository?: ProviderSpec<MarketingProjectionRepository>;
|
|
551
530
|
/**
|
|
@@ -567,7 +546,6 @@ declare class PublicCatalogModule {
|
|
|
567
546
|
|
|
568
547
|
declare const PUBLIC_CATALOG_PROJECT_KEY_TOKEN: unique symbol;
|
|
569
548
|
declare const PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN: unique symbol;
|
|
570
|
-
declare const PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN: unique symbol;
|
|
571
549
|
declare const PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN: unique symbol;
|
|
572
550
|
|
|
573
551
|
/**
|
|
@@ -1261,8 +1239,8 @@ declare class SubscriptionBundlePreviewService {
|
|
|
1261
1239
|
}
|
|
1262
1240
|
/**
|
|
1263
1241
|
* List price (net) for the billing cycle including plan-specific
|
|
1264
|
-
* pricing override (BundlePricingOverride with `planId
|
|
1265
|
-
*
|
|
1242
|
+
* pricing override (BundlePricingOverride with `planId`). null = no price
|
|
1243
|
+
* maintained for the cycle.
|
|
1266
1244
|
*/
|
|
1267
1245
|
declare function resolveBundlePriceNet(bundleVersion: BundleVersionRow, planKey: string, billingCycle: string): number | null;
|
|
1268
1246
|
|
|
@@ -1323,4 +1301,4 @@ declare class SubscriptionBundleModule {
|
|
|
1323
1301
|
*/
|
|
1324
1302
|
declare function buildTenantSubscriptionBundlesController(extraGuards?: Array<Type<CanActivate>>): Type;
|
|
1325
1303
|
|
|
1326
|
-
export { AUDIT_CONTEXT_RESOLVER_TOKEN, type AddBundleToSubscriptionInput, type AjvErrorLike, type AuditContextResolver, type AuthGuardList, type BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, type CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, type ContractFreezeBundleSnapshot, type ContractFreezePort, type ContractFreezeSourcePort, type DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, type FeatureGuardConfig, LimitExceededFilter, type LimitsCheckRow, type LoadPlanCatalogOptions, type MarketingFields, type NextPeriodWindow, PENDING_PLAN_QUERY_PORT_TOKEN, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
|
|
1304
|
+
export { AUDIT_CONTEXT_RESOLVER_TOKEN, type AddBundleToSubscriptionInput, type AjvErrorLike, type AuditContextResolver, type AuthGuardList, type BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, type CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, type ContractFreezeBundleSnapshot, type ContractFreezePort, type ContractFreezeSourcePort, type DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, type FeatureGuardConfig, LimitExceededFilter, type LimitsCheckRow, type LoadPlanCatalogOptions, type MarketingFields, type NextPeriodWindow, PENDING_PLAN_QUERY_PORT_TOKEN, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PendingPlanMaterializationService, type PendingPlanQueryPort, type PeriodRollInput, type PlanCatalogBuildSettings, PlanCatalogImportDto, type PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, type PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, type PlanCatalogModuleOptions, PlanCatalogValidationError, type PlanChangeContext, type PlanChangePreviewDto, type PlanChangePreviewIssue, PlanChangePreviewService, type PlanChangeType, type PlanResponseEntry, type PlanSnapshotDto, PreviewPlanChangeDto, type ProrationDto, type ProrationInput, type PublicBundleEntry, PublicCatalogController, PublicCatalogModule, type PublicCatalogModuleOptions, PublishValidationError, type PublishablePlanVersion, REQUIRE_FEATURE_KEY, type RedundantFeatureHint, type RenewalDecision, type RenewalSubInput, RequireFeature, SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, SELF_SERVICE_BLOCKED_PLANS_TOKEN, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SUBSCRIPTION_USAGE_PORT_TOKEN, SUBSCRIPTION_WRITE_PORT_TOKEN, type SelfServiceBlockedBundles, type SelfServiceBlockedPlans, type SubscriptionBundleAddPreviewDto, type SubscriptionBundleCancelPreviewDto, type SubscriptionBundleConfig, type SubscriptionBundleControllerOptions, SubscriptionBundleModule, type SubscriptionBundleModuleOptions, type SubscriptionBundlePreviewContext, type SubscriptionBundlePreviewIssue, SubscriptionBundlePreviewService, SubscriptionBundlesService, SubscriptionContractFreezeService, TENANT_AUTH_GUARDS_TOKEN, TENANT_ID_RESOLVER_TOKEN, TRIAL_PROJECTION_PORT_TOKEN, TenantAdminGuard, TenantBillingController, TenantBillingModule, type TenantBillingModuleOptions, type TenantIdResolver, type TrialProjectionInput, type TrialProjectionPort, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, USAGE_SNAPSHOT_PORT_TOKEN, USER_EMAIL_RESOLVER_TOKEN, USER_ID_RESOLVER_TOKEN, type UsageResponse, type UserEmailResolver, type UserIdResolver, addMonths, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, computeProration, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead, resolveBundleCancelEffectiveAt, resolveBundlePriceNet };
|
package/dist/billing/index.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
LimitExceededFilter,
|
|
15
15
|
PLAN_CATALOG_IMPORT_SINK_TOKEN,
|
|
16
16
|
PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
|
|
17
|
-
PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN,
|
|
18
17
|
PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN,
|
|
19
18
|
PUBLIC_CATALOG_PROJECT_KEY_TOKEN,
|
|
20
19
|
PendingPlanMaterializationService,
|
|
@@ -57,8 +56,8 @@ import {
|
|
|
57
56
|
periodEndWithMinLead,
|
|
58
57
|
resolveBundleCancelEffectiveAt,
|
|
59
58
|
resolveBundlePriceNet
|
|
60
|
-
} from "../chunk-
|
|
61
|
-
import "../chunk-
|
|
59
|
+
} from "../chunk-6LP7CDS2.js";
|
|
60
|
+
import "../chunk-ZLUGQE5D.js";
|
|
62
61
|
import "../chunk-2PNX2QL2.js";
|
|
63
62
|
import {
|
|
64
63
|
AUDIT_CONTEXT_RESOLVER_TOKEN,
|
|
@@ -84,7 +83,7 @@ import "../chunk-E56W4U2P.js";
|
|
|
84
83
|
import {
|
|
85
84
|
SUBSCRIPTION_BUNDLE_CONFIG_TOKEN,
|
|
86
85
|
SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN
|
|
87
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-RZU4HIAN.js";
|
|
88
87
|
import {
|
|
89
88
|
PLAN_CATALOG_READ_SINK_TOKEN,
|
|
90
89
|
PLAN_CATALOG_TOKEN,
|
|
@@ -99,10 +98,10 @@ import {
|
|
|
99
98
|
getPlanQuota,
|
|
100
99
|
isFeatureInPlan,
|
|
101
100
|
isFeaturePlannedOnly
|
|
102
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-R2QOSVAA.js";
|
|
103
102
|
import "../chunk-NYLON2VC.js";
|
|
104
|
-
import "../chunk-
|
|
105
|
-
import "../chunk-
|
|
103
|
+
import "../chunk-WKVBNTYC.js";
|
|
104
|
+
import "../chunk-N3WANKSA.js";
|
|
106
105
|
import "../chunk-SABTXESR.js";
|
|
107
106
|
import "../chunk-L4SUWH5B.js";
|
|
108
107
|
import "../chunk-SHUYVCID.js";
|
|
@@ -126,7 +125,6 @@ export {
|
|
|
126
125
|
PLAN_CATALOG_READ_SINK_TOKEN,
|
|
127
126
|
PLAN_CATALOG_TOKEN,
|
|
128
127
|
PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN,
|
|
129
|
-
PUBLIC_CATALOG_BUSINESS_TYPE_REPOSITORY_TOKEN,
|
|
130
128
|
PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN,
|
|
131
129
|
PUBLIC_CATALOG_PROJECT_KEY_TOKEN,
|
|
132
130
|
PendingPlanMaterializationService,
|