@saasicat/nest 0.3.0 → 0.5.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.
Files changed (38) hide show
  1. package/dist/admin/index.d.cts +2 -2
  2. package/dist/admin/index.d.ts +2 -2
  3. package/dist/{admin-manifest.config-DyrQNT7M.d.cts → admin-manifest.config-DxTfZ8-L.d.cts} +1 -1
  4. package/dist/{admin-manifest.config-DyrQNT7M.d.ts → admin-manifest.config-DxTfZ8-L.d.ts} +1 -1
  5. package/dist/{aggregation-CJ3qQf92.d.cts → aggregation-Bt1i_whS.d.cts} +1 -8
  6. package/dist/{aggregation-Dvz9e8X2.d.ts → aggregation-DGCyoN5d.d.ts} +1 -8
  7. package/dist/billing/index.cjs +13 -2
  8. package/dist/billing/index.d.cts +5 -5
  9. package/dist/billing/index.d.ts +5 -5
  10. package/dist/billing/index.js +2 -2
  11. package/dist/catalog/index.d.cts +1 -1
  12. package/dist/catalog/index.d.ts +1 -1
  13. package/dist/{chunk-YXGHPILG.js → chunk-NFOSITWB.js} +7 -0
  14. package/dist/{chunk-47JT54VW.js → chunk-NWLOILP6.js} +4 -3
  15. package/dist/{chunk-RIGLQ4BV.js → chunk-S2OZ5RIM.js} +9 -4
  16. package/dist/discovery/index.d.cts +2 -2
  17. package/dist/discovery/index.d.ts +2 -2
  18. package/dist/{discovery.scanner-CUYLKlYT.d.cts → discovery.scanner-DLgEvuoy.d.cts} +1 -1
  19. package/dist/{discovery.scanner-CUYLKlYT.d.ts → discovery.scanner-DLgEvuoy.d.ts} +1 -1
  20. package/dist/{saas-platform.module-k1DQg4De.d.ts → enforce-quota.interceptor-3HmbeHTM.d.ts} +59 -4
  21. package/dist/{saas-platform.module-C7-H9eYB.d.cts → enforce-quota.interceptor-HmdZFg41.d.cts} +59 -4
  22. package/dist/entitlement/index.cjs +8 -0
  23. package/dist/entitlement/index.d.cts +18 -2
  24. package/dist/entitlement/index.d.ts +18 -2
  25. package/dist/entitlement/index.js +3 -1
  26. package/dist/index.cjs +29 -16
  27. package/dist/index.d.cts +4 -4
  28. package/dist/index.d.ts +4 -4
  29. package/dist/index.js +4 -2
  30. package/dist/platform/index.cjs +5 -1
  31. package/dist/platform/index.d.cts +9 -62
  32. package/dist/platform/index.d.ts +9 -62
  33. package/dist/platform/index.js +2 -2
  34. package/dist/testing/index.cjs +15 -1
  35. package/dist/testing/index.d.cts +5 -3
  36. package/dist/testing/index.d.ts +5 -3
  37. package/dist/testing/index.js +13 -3
  38. package/package.json +5 -3
@@ -1,4 +1,4 @@
1
- export { B as BundleVersionSnapshot, a as BusinessTypeVersionSnapshot, C as CustomLimitsShape, E as EffectiveLimits, b as EffectiveLimitsSnapshot, c as EnforceLimitInput, d as EntitlementService, L as LimitExceededError, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, e as SubscriptionLimitsInput, f as aggregateBusinessTypeQuotas, g as aggregateContractLineItemEntitlements, h as aggregateLimits, i as aggregateSubscriptionBundleQuotas, j as applyCustomLimits, k as collectBusinessTypeFeatures, l as collectSubscriptionBundleFeatures, m as filterActiveSubscriptionBundles, n as filterPlannedOnlyFeatures, o as hasAnyFeature, p as hasFeature, t as toEffectiveLimitsSnapshot } from '../aggregation-Dvz9e8X2.js';
1
+ export { B as BundleVersionSnapshot, a as BusinessTypeVersionSnapshot, C as CustomLimitsShape, E as EffectiveLimits, b as EffectiveLimitsSnapshot, c as EnforceLimitInput, d as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, e as SubscriptionLimitsInput, f as aggregateBusinessTypeQuotas, g as aggregateContractLineItemEntitlements, h as aggregateLimits, i as aggregateSubscriptionBundleQuotas, j as applyCustomLimits, k as collectBusinessTypeFeatures, l as collectSubscriptionBundleFeatures, m as filterActiveSubscriptionBundles, n as filterPlannedOnlyFeatures, o as hasAnyFeature, p as hasFeature, t as toEffectiveLimitsSnapshot } from '../aggregation-DGCyoN5d.js';
2
2
  import { DiscoveredFeature, SubscriptionRepository, PlanVersionRepository, TransactionRunner, SubscriptionContractRepository, SubscriptionBundleRepository, BundleRepository } from '@saasicat/types';
3
3
  import { E as EntitlementResolutionConfig } from '../plan-resolution-CFCoUkrE.js';
4
4
  export { a as EntitlementResolutionInput, r as resolveEntitlementPlan } from '../plan-resolution-CFCoUkrE.js';
@@ -24,6 +24,22 @@ declare function buildReplacedByIndex(features: readonly FeatureReplacesSource[]
24
24
  */
25
25
  declare function expandReplacedFeatures(granted: ReadonlySet<string>, index: ReplacedByIndex): Set<string>;
26
26
 
27
+ declare class LimitExceededError extends Error {
28
+ readonly dimension: string;
29
+ readonly max: number;
30
+ readonly used: number;
31
+ readonly code = "LIMIT_EXCEEDED";
32
+ constructor(dimension: string, max: number, used: number);
33
+ }
34
+ /**
35
+ * Realm-safe type guard (checks `code` instead of `instanceof`). The tsup
36
+ * multi-entry build duplicates this class into every sub-bundle
37
+ * (platform/billing/entitlement), so an `instanceof` between thrower and
38
+ * catcher from different entries is false — same hazard the token registry
39
+ * solves with `Symbol.for` and `isPlatformUserExistsError` solves for types.
40
+ */
41
+ declare function isLimitExceededError(err: unknown): err is LimitExceededError;
42
+
27
43
  interface EntitlementModuleOptions {
28
44
  /** Consumer implementation of the `SubscriptionRepository` interface. */
29
45
  subscriptionRepository: ProviderSpec<SubscriptionRepository>;
@@ -57,4 +73,4 @@ declare const PLAN_VERSION_REPOSITORY_TOKEN: unique symbol;
57
73
  declare const TRANSACTION_RUNNER_TOKEN: unique symbol;
58
74
  declare const ENTITLEMENT_RESOLUTION_CONFIG_TOKEN: unique symbol;
59
75
 
60
- export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, EntitlementModule, type EntitlementModuleOptions, EntitlementResolutionConfig, PLAN_VERSION_REPOSITORY_TOKEN, type ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures };
76
+ export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, EntitlementModule, type EntitlementModuleOptions, EntitlementResolutionConfig, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, type ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError };
@@ -16,9 +16,10 @@ import {
16
16
  filterPlannedOnlyFeatures,
17
17
  hasAnyFeature,
18
18
  hasFeature,
19
+ isLimitExceededError,
19
20
  resolveEntitlementPlan,
20
21
  toEffectiveLimitsSnapshot
21
- } from "../chunk-YXGHPILG.js";
22
+ } from "../chunk-NFOSITWB.js";
22
23
  import "../chunk-MV6LW5UB.js";
23
24
  import "../chunk-NYLON2VC.js";
24
25
  import {
@@ -52,6 +53,7 @@ export {
52
53
  filterPlannedOnlyFeatures,
53
54
  hasAnyFeature,
54
55
  hasFeature,
56
+ isLimitExceededError,
55
57
  resolveEntitlementPlan,
56
58
  toEffectiveLimitsSnapshot
57
59
  };
package/dist/index.cjs CHANGED
@@ -308,6 +308,7 @@ __export(index_exports, {
308
308
  ipFingerprint: () => ipFingerprint,
309
309
  isFeatureInPlan: () => isFeatureInPlan,
310
310
  isFeaturePlannedOnly: () => isFeaturePlannedOnly,
311
+ isLimitExceededError: () => isLimitExceededError,
311
312
  loadApprovedCatalogKeys: () => loadApprovedCatalogKeys,
312
313
  loadDiscoverySnapshotFromFile: () => loadDiscoverySnapshotFromFile,
313
314
  loadPlanCatalogFromFile: () => loadPlanCatalogFromFile,
@@ -1683,6 +1684,7 @@ function assertNoReplacesCycle(index) {
1683
1684
  __name(assertNoReplacesCycle, "assertNoReplacesCycle");
1684
1685
 
1685
1686
  // src/entitlement/limit-exceeded-error.ts
1687
+ var LIMIT_EXCEEDED = "LIMIT_EXCEEDED";
1686
1688
  var LimitExceededError = class extends Error {
1687
1689
  static {
1688
1690
  __name(this, "LimitExceededError");
@@ -1690,11 +1692,16 @@ var LimitExceededError = class extends Error {
1690
1692
  dimension;
1691
1693
  max;
1692
1694
  used;
1695
+ code = LIMIT_EXCEEDED;
1693
1696
  constructor(dimension, max, used) {
1694
1697
  super(`Limit f\xFCr ${dimension} erreicht: ${used}/${max}.`), this.dimension = dimension, this.max = max, this.used = used;
1695
1698
  this.name = "LimitExceededError";
1696
1699
  }
1697
1700
  };
1701
+ function isLimitExceededError(err) {
1702
+ return err instanceof Error && err.code === LIMIT_EXCEEDED;
1703
+ }
1704
+ __name(isLimitExceededError, "isLimitExceededError");
1698
1705
 
1699
1706
  // src/entitlement/plan-resolution.ts
1700
1707
  function resolveEntitlementPlan(input, config, now) {
@@ -2209,6 +2216,7 @@ __name(compareRankedOffers, "compareRankedOffers");
2209
2216
 
2210
2217
  // src/billing/limit-exceeded.filter.ts
2211
2218
  var import_common11 = require("@nestjs/common");
2219
+ var import_core2 = require("@nestjs/core");
2212
2220
  function _ts_decorate11(decorators, target, key, desc) {
2213
2221
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2214
2222
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -2216,12 +2224,16 @@ function _ts_decorate11(decorators, target, key, desc) {
2216
2224
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2217
2225
  }
2218
2226
  __name(_ts_decorate11, "_ts_decorate");
2219
- var LimitExceededFilter = class _LimitExceededFilter {
2227
+ var LimitExceededFilter = class _LimitExceededFilter extends import_core2.BaseExceptionFilter {
2220
2228
  static {
2221
2229
  __name(this, "LimitExceededFilter");
2222
2230
  }
2223
2231
  logger = new import_common11.Logger(_LimitExceededFilter.name);
2224
2232
  catch(exception, host) {
2233
+ if (!isLimitExceededError(exception)) {
2234
+ super.catch(exception, host);
2235
+ return;
2236
+ }
2225
2237
  const ctx = host.switchToHttp();
2226
2238
  const response = ctx.getResponse();
2227
2239
  const request = ctx.getRequest();
@@ -2238,7 +2250,7 @@ var LimitExceededFilter = class _LimitExceededFilter {
2238
2250
  }
2239
2251
  };
2240
2252
  LimitExceededFilter = _ts_decorate11([
2241
- (0, import_common11.Catch)(LimitExceededError)
2253
+ (0, import_common11.Catch)()
2242
2254
  ], LimitExceededFilter);
2243
2255
 
2244
2256
  // src/billing/plan-catalog-loader.ts
@@ -5681,7 +5693,7 @@ SuperAdminGuard = _ts_decorate36([
5681
5693
 
5682
5694
  // src/admin/mfa.guard.ts
5683
5695
  var import_common35 = require("@nestjs/common");
5684
- var import_core2 = require("@nestjs/core");
5696
+ var import_core3 = require("@nestjs/core");
5685
5697
 
5686
5698
  // src/admin/mfa.ts
5687
5699
  var import_common34 = require("@nestjs/common");
@@ -5860,10 +5872,10 @@ var MfaGuard = class _MfaGuard {
5860
5872
  };
5861
5873
  MfaGuard = _ts_decorate38([
5862
5874
  (0, import_common35.Injectable)(),
5863
- _ts_param21(0, (0, import_common35.Inject)(import_core2.Reflector)),
5875
+ _ts_param21(0, (0, import_common35.Inject)(import_core3.Reflector)),
5864
5876
  _ts_metadata25("design:type", Function),
5865
5877
  _ts_metadata25("design:paramtypes", [
5866
- typeof import_core2.Reflector === "undefined" ? Object : import_core2.Reflector,
5878
+ typeof import_core3.Reflector === "undefined" ? Object : import_core3.Reflector,
5867
5879
  typeof MfaService === "undefined" ? Object : MfaService
5868
5880
  ])
5869
5881
  ], MfaGuard);
@@ -8636,7 +8648,7 @@ var import_node_crypto4 = require("crypto");
8636
8648
  var import_node_fs2 = require("fs");
8637
8649
  var import_node_path2 = require("path");
8638
8650
  var import_common52 = require("@nestjs/common");
8639
- var import_core3 = require("@nestjs/core");
8651
+ var import_core4 = require("@nestjs/core");
8640
8652
  function _ts_decorate63(decorators, target, key, desc) {
8641
8653
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8642
8654
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8821,18 +8833,18 @@ var DiscoveryScanner = class _DiscoveryScanner {
8821
8833
  };
8822
8834
  DiscoveryScanner = _ts_decorate63([
8823
8835
  (0, import_common52.Injectable)(),
8824
- _ts_param31(0, (0, import_common52.Inject)(import_core3.DiscoveryService)),
8825
- _ts_param31(1, (0, import_common52.Inject)(import_core3.MetadataScanner)),
8826
- _ts_param31(2, (0, import_common52.Inject)(import_core3.Reflector)),
8836
+ _ts_param31(0, (0, import_common52.Inject)(import_core4.DiscoveryService)),
8837
+ _ts_param31(1, (0, import_common52.Inject)(import_core4.MetadataScanner)),
8838
+ _ts_param31(2, (0, import_common52.Inject)(import_core4.Reflector)),
8827
8839
  _ts_param31(3, (0, import_common52.Optional)()),
8828
8840
  _ts_param31(3, (0, import_common52.Inject)(DISCOVERY_APP_INFO_TOKEN)),
8829
8841
  _ts_param31(4, (0, import_common52.Optional)()),
8830
8842
  _ts_param31(4, (0, import_common52.Inject)(DISCOVERY_SNAPSHOT_PATH_TOKEN)),
8831
8843
  _ts_metadata46("design:type", Function),
8832
8844
  _ts_metadata46("design:paramtypes", [
8833
- typeof import_core3.DiscoveryService === "undefined" ? Object : import_core3.DiscoveryService,
8834
- typeof import_core3.MetadataScanner === "undefined" ? Object : import_core3.MetadataScanner,
8835
- typeof import_core3.Reflector === "undefined" ? Object : import_core3.Reflector,
8845
+ typeof import_core4.DiscoveryService === "undefined" ? Object : import_core4.DiscoveryService,
8846
+ typeof import_core4.MetadataScanner === "undefined" ? Object : import_core4.MetadataScanner,
8847
+ typeof import_core4.Reflector === "undefined" ? Object : import_core4.Reflector,
8836
8848
  typeof DiscoveryAppInfo === "undefined" ? Object : DiscoveryAppInfo,
8837
8849
  Object
8838
8850
  ])
@@ -8932,7 +8944,7 @@ __name(canonicalStringify, "canonicalStringify");
8932
8944
 
8933
8945
  // src/discovery/discovery.module.ts
8934
8946
  var import_common54 = require("@nestjs/common");
8935
- var import_core4 = require("@nestjs/core");
8947
+ var import_core5 = require("@nestjs/core");
8936
8948
 
8937
8949
  // src/discovery/discovery.controller.ts
8938
8950
  var import_common53 = require("@nestjs/common");
@@ -9056,7 +9068,7 @@ var DiscoveryModule = class _DiscoveryModule {
9056
9068
  return {
9057
9069
  module: _DiscoveryModule,
9058
9070
  imports: [
9059
- import_core4.DiscoveryModule,
9071
+ import_core5.DiscoveryModule,
9060
9072
  ...options.imports ?? []
9061
9073
  ],
9062
9074
  controllers,
@@ -9097,11 +9109,11 @@ function loadDiscoverySnapshotFromFile(path) {
9097
9109
  __name(loadDiscoverySnapshotFromFile, "loadDiscoverySnapshotFromFile");
9098
9110
 
9099
9111
  // src/discovery/headless-scan.ts
9100
- var import_core5 = require("@nestjs/core");
9112
+ var import_core6 = require("@nestjs/core");
9101
9113
  async function runHeadlessDiscoveryScan(appModule, options = {}) {
9102
9114
  const exit = options.exit ?? ((code) => process.exit(code));
9103
9115
  try {
9104
- const app = await import_core5.NestFactory.createApplicationContext(appModule, {
9116
+ const app = await import_core6.NestFactory.createApplicationContext(appModule, {
9105
9117
  logger: options.logger ?? [
9106
9118
  "error",
9107
9119
  "warn",
@@ -15889,6 +15901,7 @@ CheckoutOfferModule = _ts_decorate96([
15889
15901
  ipFingerprint,
15890
15902
  isFeatureInPlan,
15891
15903
  isFeaturePlannedOnly,
15904
+ isLimitExceededError,
15892
15905
  loadApprovedCatalogKeys,
15893
15906
  loadDiscoverySnapshotFromFile,
15894
15907
  loadPlanCatalogFromFile,
package/dist/index.d.cts CHANGED
@@ -5,18 +5,18 @@ export { P as PreviewInput, a as PreviewInvalid, b as PreviewReason, c as Previe
5
5
  export { AUDIT_CONTEXT_RESOLVER_TOKEN, AddBundleToSubscriptionInput, AjvErrorLike, AuditContextResolver, AuthGuardList, BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, ContractFreezeBundleSnapshot, ContractFreezePort, ContractFreezeSourcePort, DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, FeatureGuardConfig, LimitExceededFilter, LimitsCheckRow, LoadPlanCatalogOptions, MarketingFields, 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_BUSINESS_TYPE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PendingPlanMaterializationService, PendingPlanQueryPort, PeriodRollInput, PlanCatalogBuildSettings, PlanCatalogImportDto, PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, PlanCatalogModuleOptions, PlanCatalogValidationError, PlanChangeContext, PlanChangePreviewDto, PlanChangePreviewIssue, PlanChangePreviewService, PlanChangeType, PlanResponseEntry, PlanSnapshotDto, PreviewPlanChangeDto, ProrationDto, ProrationInput, PublicBundleEntry, PublicBusinessTypeEntry, PublicCatalogController, PublicCatalogModule, PublicCatalogModuleOptions, PublishValidationError, PublishablePlanVersion, REQUIRE_FEATURE_KEY, RedundantFeatureHint, RenewalDecision, 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, SelfServiceBlockedBundles, SelfServiceBlockedPlans, SubscriptionBundleAddPreviewDto, SubscriptionBundleCancelPreviewDto, SubscriptionBundleConfig, SubscriptionBundleControllerOptions, SubscriptionBundleModule, SubscriptionBundleModuleOptions, SubscriptionBundlePreviewContext, SubscriptionBundlePreviewIssue, SubscriptionBundlePreviewService, SubscriptionBundlesService, SubscriptionContractFreezeService, TENANT_AUTH_GUARDS_TOKEN, TENANT_ID_RESOLVER_TOKEN, TRIAL_PROJECTION_PORT_TOKEN, TenantAdminGuard, TenantBillingController, TenantBillingModule, TenantBillingModuleOptions, TenantIdResolver, TrialProjectionInput, TrialProjectionPort, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, USAGE_SNAPSHOT_PORT_TOKEN, USER_EMAIL_RESOLVER_TOKEN, USER_ID_RESOLVER_TOKEN, UsageResponse, UserEmailResolver, 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 } from './billing/index.cjs';
6
6
  import { SuperAdminProvisioningPort, SetupStatusResponse, SetupRequest, SetupResult, SetupConfirmMfaRequest, SetupConfirmMfaResponse } from '@saasicat/types';
7
7
  export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
8
- export { B as BundleVersionSnapshot, a as BusinessTypeVersionSnapshot, C as CustomLimitsShape, E as EffectiveLimits, b as EffectiveLimitsSnapshot, c as EnforceLimitInput, d as EntitlementService, L as LimitExceededError, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, e as SubscriptionLimitsInput, f as aggregateBusinessTypeQuotas, g as aggregateContractLineItemEntitlements, h as aggregateLimits, i as aggregateSubscriptionBundleQuotas, j as applyCustomLimits, k as collectBusinessTypeFeatures, l as collectSubscriptionBundleFeatures, m as filterActiveSubscriptionBundles, n as filterPlannedOnlyFeatures, o as hasAnyFeature, p as hasFeature, t as toEffectiveLimitsSnapshot } from './aggregation-CJ3qQf92.cjs';
9
- export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, EntitlementModule, EntitlementModuleOptions, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures } from './entitlement/index.cjs';
8
+ export { B as BundleVersionSnapshot, a as BusinessTypeVersionSnapshot, C as CustomLimitsShape, E as EffectiveLimits, b as EffectiveLimitsSnapshot, c as EnforceLimitInput, d as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, e as SubscriptionLimitsInput, f as aggregateBusinessTypeQuotas, g as aggregateContractLineItemEntitlements, h as aggregateLimits, i as aggregateSubscriptionBundleQuotas, j as applyCustomLimits, k as collectBusinessTypeFeatures, l as collectSubscriptionBundleFeatures, m as filterActiveSubscriptionBundles, n as filterPlannedOnlyFeatures, o as hasAnyFeature, p as hasFeature, t as toEffectiveLimitsSnapshot } from './aggregation-Bt1i_whS.cjs';
9
+ export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.cjs';
10
10
  export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CFCoUkrE.cjs';
11
11
  import { MfaService } from './admin/index.cjs';
12
12
  export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT_TOKEN, AdminBypassRlsInterceptor, AdminManifestModule, AdminManifestModuleOptions, AdminManifestService, AdminModule, AdminModuleOptions, AdminPublicBootController, AdminStatsController, AdminStatsModule, AdminStatsModuleOptions, AdminStatsService, AdminStatsSnapshot, MFA_PORT_TOKEN, MfaGuard, PLATFORM_CORE_CONTRIBUTION_TOKEN, PLATFORM_CORE_MANIFEST_CONTRIBUTION, PROMO_CODE_STATS_PORT_TOKEN, REQUIRE_MFA_KEY, RLS_BYPASS_PORT_TOKEN, RequireMfa, SUBSCRIPTION_STATS_PORT_TOKEN, SuperAdminGuard, TotpSetupResult, VerifyTotpInput } from './admin/index.cjs';
13
13
  export { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.cjs';
14
- export { a as ADMIN_MANIFEST_CONFIG, A as AdminManifestConfig } from './admin-manifest.config-DyrQNT7M.cjs';
14
+ export { A as ADMIN_MANIFEST_CONFIG, a as AdminManifestConfig } from './admin-manifest.config-DxTfZ8-L.cjs';
15
15
  import { DynamicModule } from '@nestjs/common';
16
16
  export { Type as NestType } from '@nestjs/common';
17
17
  export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PAYMENT_EVENT_LOG_TOKEN, PAYMENT_PROVIDER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PaymentWebhookDto, PendingRegistrationService, PreviewRegistrationPromoDto, PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_BUSINESS_TYPE_LOOKUP_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationCleanupCron, RegistrationModule, RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode } from './registration/index.cjs';
18
18
  export { DEFINES_QUOTA_KEY, DISCOVERY_SNAPSHOT_TOKEN, DefinesQuota, DefinesQuotaOptions, DiscoveryControllerConfig, DiscoveryModule, DiscoveryModuleOptions, DiscoverySnapshotNotFoundError, ENFORCE_QUOTA_KEY, EnforceQuota, EnforceQuotaMetadata, EnforceQuotaOptions, HeadlessScanOptions, IMPLEMENTS_CAPABILITY_KEY, ImplementsCapability, ImplementsCapabilityMetadata, ImplementsCapabilityOptions, REQUIRES_CAPABILITY_KEY, RequiresCapability, RequiresCapabilityKeys, buildDiscoveryController, loadDiscoverySnapshotFromFile, runHeadlessDiscoveryScan } from './discovery/index.cjs';
19
- export { a as DISCOVERY_APP_INFO_TOKEN, b as DISCOVERY_SNAPSHOT_PATH_TOKEN, D as DiscoveryAppInfo, c as DiscoveryScanner, d as computeSnapshotHash } from './discovery.scanner-CUYLKlYT.cjs';
19
+ export { D as DISCOVERY_APP_INFO_TOKEN, a as DISCOVERY_SNAPSHOT_PATH_TOKEN, b as DiscoveryAppInfo, c as DiscoveryScanner, d as computeSnapshotHash } from './discovery.scanner-DLgEvuoy.cjs';
20
20
  export { ADVISORY_STRICT_MODE_CODES, BUNDLE_REPOSITORY_TOKEN, BUSINESS_TYPE_REPOSITORY_TOKEN, BundlesService, BusinessTypeBundleInputDto, BusinessTypesService, CATALOG_ENTRY_REPOSITORY_TOKEN, CATALOG_SERVICE_CONFIG_TOKEN, CatalogControllerConfig, CatalogEntriesService, CatalogModule, CatalogModuleOptions, CatalogServiceConfig, CreateBundleDto, CreateBundleVersionDraftDto, CreateBusinessTypeDto, CreateBusinessTypeVersionDraftDto, CreateMarketingProjectionDto, CreatePlanDto, CreatePlanVersionDraftDto, CreatePromotionDto, ListCatalogEntriesQueryDto, ListMarketingProjectionsQueryDto, ListMarketingSettingsQueryDto, ListPromotionsQueryDto, MARKETING_PROJECTION_REPOSITORY_TOKEN, MARKETING_SETTINGS_REPOSITORY_TOKEN, MarketingProjectionsService, MarketingSettingsService, PLAN_REPOSITORY_TOKEN, PROMOTION_REPOSITORY_TOKEN, PlanVersionsService, PlansService, PreflightFinding, PreflightInput, PreflightReport, PromotionsService, PublicMarketingCatalogService, PublishBundleVersionDto, PublishBusinessTypeVersionDto, PublishPlanVersionDto, ReviewCatalogEntryDto, SeedBundleDraft, SeedGateFinding, SeedGateInput, SeedGateMode, SeedGateReport, SeedGateRunOptions, SeedPlanDraft, SyncDiscoveryDto, UpdateBundleDto, UpdateBundleVersionDraftDto, UpdateBusinessTypeDto, UpdateBusinessTypeVersionDraftDto, UpdateCatalogEntryI18nDto, UpdateMarketingProjectionDto, UpdateMarketingSettingsDto, UpdatePlanDto, UpdatePlanVersionDraftDto, UpdatePromotionDto, blockingStrictModeWarnings, buildBundleVersionsController, buildBundlesController, buildBusinessTypeVersionsController, buildBusinessTypesController, buildCatalogEntriesController, buildMarketingProjectionsController, buildMarketingSettingsController, buildPlanVersionsController, buildPlansController, buildPromotionsController, buildPublicMarketingCatalogController, featureApprovalSignature, formatPreflightReport, formatSeedGateReport, loadApprovedCatalogKeys, preflightExitCode, quotaApprovalSignature, runPreflight, runSeedGateFromFile, seedGateExitCode, validateBundleDraft, validateBusinessTypeDraft, validatePlanDraft, validateSeedAgainstSnapshot } from './catalog/index.cjs';
21
21
  export { CHECKOUT_OFFER_REPOSITORY_TOKEN, CheckoutOfferControllerConfig, CheckoutOfferModule, CheckoutOfferModuleOptions, CheckoutOfferService, CreateCheckoutOfferDto, UpdateCheckoutOfferDto, buildCheckoutOfferController } from './checkout-offer/index.cjs';
22
22
  export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from './subscription-contract.service--cm47ZJJ.cjs';
package/dist/index.d.ts CHANGED
@@ -5,18 +5,18 @@ export { P as PreviewInput, a as PreviewInvalid, b as PreviewReason, c as Previe
5
5
  export { AUDIT_CONTEXT_RESOLVER_TOKEN, AddBundleToSubscriptionInput, AjvErrorLike, AuditContextResolver, AuthGuardList, BundlePreviewSnapshot, CONTRACT_FREEZE_PORT_TOKEN, CONTRACT_FREEZE_PROJECT_KEY_TOKEN, CONTRACT_FREEZE_SOURCE_PORT_TOKEN, CancelBundleFromSubscriptionInput, CancelSubscriptionDto, CatalogBundleUpsellResolver, ChangePlanDto, CompleteOnboardingSubscriptionDto, ComposedTenantAuthGuard, ConfiguratorCatalogBuilder, ContractFreezeBundleSnapshot, ContractFreezePort, ContractFreezeSourcePort, DuePendingPlanChange, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, FeatureGuardConfig, LimitExceededFilter, LimitsCheckRow, LoadPlanCatalogOptions, MarketingFields, 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_BUSINESS_TYPE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PendingPlanMaterializationService, PendingPlanQueryPort, PeriodRollInput, PlanCatalogBuildSettings, PlanCatalogImportDto, PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, PlanCatalogModuleOptions, PlanCatalogValidationError, PlanChangeContext, PlanChangePreviewDto, PlanChangePreviewIssue, PlanChangePreviewService, PlanChangeType, PlanResponseEntry, PlanSnapshotDto, PreviewPlanChangeDto, ProrationDto, ProrationInput, PublicBundleEntry, PublicBusinessTypeEntry, PublicCatalogController, PublicCatalogModule, PublicCatalogModuleOptions, PublishValidationError, PublishablePlanVersion, REQUIRE_FEATURE_KEY, RedundantFeatureHint, RenewalDecision, 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, SelfServiceBlockedBundles, SelfServiceBlockedPlans, SubscriptionBundleAddPreviewDto, SubscriptionBundleCancelPreviewDto, SubscriptionBundleConfig, SubscriptionBundleControllerOptions, SubscriptionBundleModule, SubscriptionBundleModuleOptions, SubscriptionBundlePreviewContext, SubscriptionBundlePreviewIssue, SubscriptionBundlePreviewService, SubscriptionBundlesService, SubscriptionContractFreezeService, TENANT_AUTH_GUARDS_TOKEN, TENANT_ID_RESOLVER_TOKEN, TRIAL_PROJECTION_PORT_TOKEN, TenantAdminGuard, TenantBillingController, TenantBillingModule, TenantBillingModuleOptions, TenantIdResolver, TrialProjectionInput, TrialProjectionPort, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, USAGE_SNAPSHOT_PORT_TOKEN, USER_EMAIL_RESOLVER_TOKEN, USER_ID_RESOLVER_TOKEN, UsageResponse, UserEmailResolver, 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 } from './billing/index.js';
6
6
  import { SuperAdminProvisioningPort, SetupStatusResponse, SetupRequest, SetupResult, SetupConfirmMfaRequest, SetupConfirmMfaResponse } from '@saasicat/types';
7
7
  export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
8
- export { B as BundleVersionSnapshot, a as BusinessTypeVersionSnapshot, C as CustomLimitsShape, E as EffectiveLimits, b as EffectiveLimitsSnapshot, c as EnforceLimitInput, d as EntitlementService, L as LimitExceededError, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, e as SubscriptionLimitsInput, f as aggregateBusinessTypeQuotas, g as aggregateContractLineItemEntitlements, h as aggregateLimits, i as aggregateSubscriptionBundleQuotas, j as applyCustomLimits, k as collectBusinessTypeFeatures, l as collectSubscriptionBundleFeatures, m as filterActiveSubscriptionBundles, n as filterPlannedOnlyFeatures, o as hasAnyFeature, p as hasFeature, t as toEffectiveLimitsSnapshot } from './aggregation-Dvz9e8X2.js';
9
- export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, EntitlementModule, EntitlementModuleOptions, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures } from './entitlement/index.js';
8
+ export { B as BundleVersionSnapshot, a as BusinessTypeVersionSnapshot, C as CustomLimitsShape, E as EffectiveLimits, b as EffectiveLimitsSnapshot, c as EnforceLimitInput, d as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, e as SubscriptionLimitsInput, f as aggregateBusinessTypeQuotas, g as aggregateContractLineItemEntitlements, h as aggregateLimits, i as aggregateSubscriptionBundleQuotas, j as applyCustomLimits, k as collectBusinessTypeFeatures, l as collectSubscriptionBundleFeatures, m as filterActiveSubscriptionBundles, n as filterPlannedOnlyFeatures, o as hasAnyFeature, p as hasFeature, t as toEffectiveLimitsSnapshot } from './aggregation-DGCyoN5d.js';
9
+ export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.js';
10
10
  export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CFCoUkrE.js';
11
11
  import { MfaService } from './admin/index.js';
12
12
  export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT_TOKEN, AdminBypassRlsInterceptor, AdminManifestModule, AdminManifestModuleOptions, AdminManifestService, AdminModule, AdminModuleOptions, AdminPublicBootController, AdminStatsController, AdminStatsModule, AdminStatsModuleOptions, AdminStatsService, AdminStatsSnapshot, MFA_PORT_TOKEN, MfaGuard, PLATFORM_CORE_CONTRIBUTION_TOKEN, PLATFORM_CORE_MANIFEST_CONTRIBUTION, PROMO_CODE_STATS_PORT_TOKEN, REQUIRE_MFA_KEY, RLS_BYPASS_PORT_TOKEN, RequireMfa, SUBSCRIPTION_STATS_PORT_TOKEN, SuperAdminGuard, TotpSetupResult, VerifyTotpInput } from './admin/index.js';
13
13
  export { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.js';
14
- export { a as ADMIN_MANIFEST_CONFIG, A as AdminManifestConfig } from './admin-manifest.config-DyrQNT7M.js';
14
+ export { A as ADMIN_MANIFEST_CONFIG, a as AdminManifestConfig } from './admin-manifest.config-DxTfZ8-L.js';
15
15
  import { DynamicModule } from '@nestjs/common';
16
16
  export { Type as NestType } from '@nestjs/common';
17
17
  export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PAYMENT_EVENT_LOG_TOKEN, PAYMENT_PROVIDER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PaymentWebhookDto, PendingRegistrationService, PreviewRegistrationPromoDto, PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_BUSINESS_TYPE_LOOKUP_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationCleanupCron, RegistrationModule, RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode } from './registration/index.js';
18
18
  export { DEFINES_QUOTA_KEY, DISCOVERY_SNAPSHOT_TOKEN, DefinesQuota, DefinesQuotaOptions, DiscoveryControllerConfig, DiscoveryModule, DiscoveryModuleOptions, DiscoverySnapshotNotFoundError, ENFORCE_QUOTA_KEY, EnforceQuota, EnforceQuotaMetadata, EnforceQuotaOptions, HeadlessScanOptions, IMPLEMENTS_CAPABILITY_KEY, ImplementsCapability, ImplementsCapabilityMetadata, ImplementsCapabilityOptions, REQUIRES_CAPABILITY_KEY, RequiresCapability, RequiresCapabilityKeys, buildDiscoveryController, loadDiscoverySnapshotFromFile, runHeadlessDiscoveryScan } from './discovery/index.js';
19
- export { a as DISCOVERY_APP_INFO_TOKEN, b as DISCOVERY_SNAPSHOT_PATH_TOKEN, D as DiscoveryAppInfo, c as DiscoveryScanner, d as computeSnapshotHash } from './discovery.scanner-CUYLKlYT.js';
19
+ export { D as DISCOVERY_APP_INFO_TOKEN, a as DISCOVERY_SNAPSHOT_PATH_TOKEN, b as DiscoveryAppInfo, c as DiscoveryScanner, d as computeSnapshotHash } from './discovery.scanner-DLgEvuoy.js';
20
20
  export { ADVISORY_STRICT_MODE_CODES, BUNDLE_REPOSITORY_TOKEN, BUSINESS_TYPE_REPOSITORY_TOKEN, BundlesService, BusinessTypeBundleInputDto, BusinessTypesService, CATALOG_ENTRY_REPOSITORY_TOKEN, CATALOG_SERVICE_CONFIG_TOKEN, CatalogControllerConfig, CatalogEntriesService, CatalogModule, CatalogModuleOptions, CatalogServiceConfig, CreateBundleDto, CreateBundleVersionDraftDto, CreateBusinessTypeDto, CreateBusinessTypeVersionDraftDto, CreateMarketingProjectionDto, CreatePlanDto, CreatePlanVersionDraftDto, CreatePromotionDto, ListCatalogEntriesQueryDto, ListMarketingProjectionsQueryDto, ListMarketingSettingsQueryDto, ListPromotionsQueryDto, MARKETING_PROJECTION_REPOSITORY_TOKEN, MARKETING_SETTINGS_REPOSITORY_TOKEN, MarketingProjectionsService, MarketingSettingsService, PLAN_REPOSITORY_TOKEN, PROMOTION_REPOSITORY_TOKEN, PlanVersionsService, PlansService, PreflightFinding, PreflightInput, PreflightReport, PromotionsService, PublicMarketingCatalogService, PublishBundleVersionDto, PublishBusinessTypeVersionDto, PublishPlanVersionDto, ReviewCatalogEntryDto, SeedBundleDraft, SeedGateFinding, SeedGateInput, SeedGateMode, SeedGateReport, SeedGateRunOptions, SeedPlanDraft, SyncDiscoveryDto, UpdateBundleDto, UpdateBundleVersionDraftDto, UpdateBusinessTypeDto, UpdateBusinessTypeVersionDraftDto, UpdateCatalogEntryI18nDto, UpdateMarketingProjectionDto, UpdateMarketingSettingsDto, UpdatePlanDto, UpdatePlanVersionDraftDto, UpdatePromotionDto, blockingStrictModeWarnings, buildBundleVersionsController, buildBundlesController, buildBusinessTypeVersionsController, buildBusinessTypesController, buildCatalogEntriesController, buildMarketingProjectionsController, buildMarketingSettingsController, buildPlanVersionsController, buildPlansController, buildPromotionsController, buildPublicMarketingCatalogController, featureApprovalSignature, formatPreflightReport, formatSeedGateReport, loadApprovedCatalogKeys, preflightExitCode, quotaApprovalSignature, runPreflight, runSeedGateFromFile, seedGateExitCode, validateBundleDraft, validateBusinessTypeDraft, validatePlanDraft, validateSeedAgainstSnapshot } from './catalog/index.js';
21
21
  export { CHECKOUT_OFFER_REPOSITORY_TOKEN, CheckoutOfferControllerConfig, CheckoutOfferModule, CheckoutOfferModuleOptions, CheckoutOfferService, CreateCheckoutOfferDto, UpdateCheckoutOfferDto, buildCheckoutOfferController } from './checkout-offer/index.js';
22
22
  export { C as CreateContractFromOfferOptions, S as SubscriptionContractService, c as contractLineItemToInvoiceLineItem, s as sortContractLineItemsForInvoice, a as subscriptionContractToInvoiceSnapshot } from './subscription-contract.service--cm47ZJJ.js';
package/dist/index.js CHANGED
@@ -115,7 +115,7 @@ import {
115
115
  periodEndWithMinLead,
116
116
  resolveBundleCancelEffectiveAt,
117
117
  resolveBundlePriceNet
118
- } from "./chunk-RIGLQ4BV.js";
118
+ } from "./chunk-S2OZ5RIM.js";
119
119
  import {
120
120
  PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN,
121
121
  PROMO_CODE_REPOSITORY_TOKEN,
@@ -294,9 +294,10 @@ import {
294
294
  filterPlannedOnlyFeatures,
295
295
  hasAnyFeature,
296
296
  hasFeature,
297
+ isLimitExceededError,
297
298
  resolveEntitlementPlan,
298
299
  toEffectiveLimitsSnapshot
299
- } from "./chunk-YXGHPILG.js";
300
+ } from "./chunk-NFOSITWB.js";
300
301
  import {
301
302
  PLAN_CATALOG_READ_SINK_TOKEN,
302
303
  PLAN_CATALOG_TOKEN,
@@ -927,6 +928,7 @@ export {
927
928
  ipFingerprint,
928
929
  isFeatureInPlan,
929
930
  isFeaturePlannedOnly,
931
+ isLimitExceededError,
930
932
  loadApprovedCatalogKeys,
931
933
  loadDiscoverySnapshotFromFile,
932
934
  loadPlanCatalogFromFile,
@@ -1890,6 +1890,7 @@ function assertNoReplacesCycle(index) {
1890
1890
  __name(assertNoReplacesCycle, "assertNoReplacesCycle");
1891
1891
 
1892
1892
  // src/entitlement/limit-exceeded-error.ts
1893
+ var LIMIT_EXCEEDED = "LIMIT_EXCEEDED";
1893
1894
  var LimitExceededError = class extends Error {
1894
1895
  static {
1895
1896
  __name(this, "LimitExceededError");
@@ -1897,6 +1898,7 @@ var LimitExceededError = class extends Error {
1897
1898
  dimension;
1898
1899
  max;
1899
1900
  used;
1901
+ code = LIMIT_EXCEEDED;
1900
1902
  constructor(dimension, max, used) {
1901
1903
  super(`Limit f\xFCr ${dimension} erreicht: ${used}/${max}.`), this.dimension = dimension, this.max = max, this.used = used;
1902
1904
  this.name = "LimitExceededError";
@@ -2776,11 +2778,13 @@ var SaasPlatformModule = class _SaasPlatformModule {
2776
2778
  PlanCatalogModule,
2777
2779
  DiscoveryModule,
2778
2780
  AdminModule,
2781
+ // ADMIN_MANIFEST_CONFIG travels transitively: re-exporting an
2782
+ // imported module's token directly is an UnknownExportException
2783
+ // at boot — the module export below already carries it.
2779
2784
  AdminManifestModule,
2780
2785
  ...options.entitlement ? [
2781
2786
  EntitlementModule
2782
2787
  ] : [],
2783
- ADMIN_MANIFEST_CONFIG,
2784
2788
  ...lightweightExports
2785
2789
  ],
2786
2790
  global: true
@@ -1,66 +1,13 @@
1
- import { P as PlanResolverPort } from '../saas-platform.module-C7-H9eYB.cjs';
2
- export { a as PLAN_RESOLVER_PORT_TOKEN, S as SaasPlatformAdapters, b as SaasPlatformModule, c as SaasPlatformModuleOptions, d as StaticPlanResolver, T as TenantManifestControllerOptions, e as buildTenantManifestController } from '../saas-platform.module-C7-H9eYB.cjs';
3
- import { PlanCatalog, QuotaProvider } from '@saasicat/types';
4
- import { CanActivate, ExecutionContext, NestInterceptor, CallHandler } from '@nestjs/common';
5
- import { Reflector } from '@nestjs/core';
6
- import { Observable } from 'rxjs';
1
+ import { S as StaticEntitlementService } from '../enforce-quota.interceptor-HmdZFg41.cjs';
2
+ export { E as EnforceQuotaInterceptor, P as PLAN_RESOLVER_PORT_TOKEN, a as PlanResolverPort, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as SaasPlatformAdapters, d as SaasPlatformModule, e as SaasPlatformModuleOptions, f as StaticEntitlementSnapshot, g as StaticFeatureGuard, h as StaticFeatureGuardConfig, i as StaticPlanResolver, T as TenantManifestControllerOptions, j as buildTenantManifestController } from '../enforce-quota.interceptor-HmdZFg41.cjs';
3
+ import '@nestjs/common';
4
+ import '@saasicat/types';
7
5
  import '../di-CcNeq9v-.cjs';
8
- import '../admin-manifest.config-DyrQNT7M.cjs';
9
- import '../discovery.scanner-CUYLKlYT.cjs';
6
+ import '../admin-manifest.config-DxTfZ8-L.cjs';
7
+ import '../discovery.scanner-DLgEvuoy.cjs';
8
+ import '@nestjs/core';
10
9
  import '../plan-resolution-CFCoUkrE.cjs';
11
-
12
- interface StaticEntitlementSnapshot {
13
- planId: string | null;
14
- features: readonly string[];
15
- /** quotaKey → limit (`-1` = unlimited). */
16
- quotas: Readonly<Record<string, number>>;
17
- }
18
- declare class StaticEntitlementService {
19
- private readonly catalog;
20
- private readonly resolver;
21
- constructor(catalog: PlanCatalog, resolver: PlanResolverPort);
22
- /**
23
- * Returns the effective features + quotas of a tenant from the
24
- * plan catalog. When the plan is missing: an empty snapshot (no feature,
25
- * all quotas at 0).
26
- */
27
- snapshot(tenantId: string): Promise<StaticEntitlementSnapshot>;
28
- /** Convenience helper for tests / synchronous checks in the UI manifest. */
29
- hasFeature(tenantId: string, featureKey: string): Promise<boolean>;
30
- quotaLimit(tenantId: string, quotaKey: string): Promise<number | null>;
31
- private findPlan;
32
- }
33
-
34
- declare const STATIC_FEATURE_GUARD_CONFIG_TOKEN: unique symbol;
35
- interface StaticFeatureGuardConfig {
36
- /**
37
- * Resolver for the user role (e.g. `(user) => user.platformRole`).
38
- * SUPER_ADMIN gets a bypass.
39
- */
40
- userRoleResolver?: (user: unknown) => string | undefined;
41
- /**
42
- * Resolver for the tenant ID from the request. Default:
43
- * `request.tenantId ?? request.user?.tenantId`.
44
- */
45
- tenantIdResolver?: (request: unknown) => string | undefined;
46
- }
47
- declare class StaticFeatureGuard implements CanActivate {
48
- private readonly reflector;
49
- private readonly entitlements;
50
- private readonly config;
51
- constructor(reflector: Reflector, entitlements: StaticEntitlementService, config?: StaticFeatureGuardConfig | null);
52
- canActivate(context: ExecutionContext): Promise<boolean>;
53
- }
54
-
55
- declare const QUOTA_PROVIDERS_TOKEN: unique symbol;
56
- declare class EnforceQuotaInterceptor implements NestInterceptor {
57
- private readonly reflector;
58
- private readonly entitlements;
59
- private readonly providers;
60
- constructor(reflector: Reflector, entitlements: StaticEntitlementService, providers?: ReadonlyArray<QuotaProvider> | null);
61
- intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
62
- private check;
63
- }
10
+ import 'rxjs';
64
11
 
65
12
  interface TenantNavItem {
66
13
  /** Unique slug, e.g. "notes", "billing", "settings". */
@@ -115,4 +62,4 @@ declare class TenantManifestService {
115
62
  getManifest(tenantId: string): Promise<TenantManifest>;
116
63
  }
117
64
 
118
- export { EnforceQuotaInterceptor, PlanResolverPort, QUOTA_PROVIDERS_TOKEN, STATIC_FEATURE_GUARD_CONFIG_TOKEN, StaticEntitlementService, type StaticEntitlementSnapshot, StaticFeatureGuard, type StaticFeatureGuardConfig, type TenantManifest, TenantManifestService, type TenantNavItem };
65
+ export { StaticEntitlementService, type TenantManifest, TenantManifestService, type TenantNavItem };
@@ -1,66 +1,13 @@
1
- import { P as PlanResolverPort } from '../saas-platform.module-k1DQg4De.js';
2
- export { a as PLAN_RESOLVER_PORT_TOKEN, S as SaasPlatformAdapters, b as SaasPlatformModule, c as SaasPlatformModuleOptions, d as StaticPlanResolver, T as TenantManifestControllerOptions, e as buildTenantManifestController } from '../saas-platform.module-k1DQg4De.js';
3
- import { PlanCatalog, QuotaProvider } from '@saasicat/types';
4
- import { CanActivate, ExecutionContext, NestInterceptor, CallHandler } from '@nestjs/common';
5
- import { Reflector } from '@nestjs/core';
6
- import { Observable } from 'rxjs';
1
+ import { S as StaticEntitlementService } from '../enforce-quota.interceptor-3HmbeHTM.js';
2
+ export { E as EnforceQuotaInterceptor, P as PLAN_RESOLVER_PORT_TOKEN, a as PlanResolverPort, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as SaasPlatformAdapters, d as SaasPlatformModule, e as SaasPlatformModuleOptions, f as StaticEntitlementSnapshot, g as StaticFeatureGuard, h as StaticFeatureGuardConfig, i as StaticPlanResolver, T as TenantManifestControllerOptions, j as buildTenantManifestController } from '../enforce-quota.interceptor-3HmbeHTM.js';
3
+ import '@nestjs/common';
4
+ import '@saasicat/types';
7
5
  import '../di-CcNeq9v-.js';
8
- import '../admin-manifest.config-DyrQNT7M.js';
9
- import '../discovery.scanner-CUYLKlYT.js';
6
+ import '../admin-manifest.config-DxTfZ8-L.js';
7
+ import '../discovery.scanner-DLgEvuoy.js';
8
+ import '@nestjs/core';
10
9
  import '../plan-resolution-CFCoUkrE.js';
11
-
12
- interface StaticEntitlementSnapshot {
13
- planId: string | null;
14
- features: readonly string[];
15
- /** quotaKey → limit (`-1` = unlimited). */
16
- quotas: Readonly<Record<string, number>>;
17
- }
18
- declare class StaticEntitlementService {
19
- private readonly catalog;
20
- private readonly resolver;
21
- constructor(catalog: PlanCatalog, resolver: PlanResolverPort);
22
- /**
23
- * Returns the effective features + quotas of a tenant from the
24
- * plan catalog. When the plan is missing: an empty snapshot (no feature,
25
- * all quotas at 0).
26
- */
27
- snapshot(tenantId: string): Promise<StaticEntitlementSnapshot>;
28
- /** Convenience helper for tests / synchronous checks in the UI manifest. */
29
- hasFeature(tenantId: string, featureKey: string): Promise<boolean>;
30
- quotaLimit(tenantId: string, quotaKey: string): Promise<number | null>;
31
- private findPlan;
32
- }
33
-
34
- declare const STATIC_FEATURE_GUARD_CONFIG_TOKEN: unique symbol;
35
- interface StaticFeatureGuardConfig {
36
- /**
37
- * Resolver for the user role (e.g. `(user) => user.platformRole`).
38
- * SUPER_ADMIN gets a bypass.
39
- */
40
- userRoleResolver?: (user: unknown) => string | undefined;
41
- /**
42
- * Resolver for the tenant ID from the request. Default:
43
- * `request.tenantId ?? request.user?.tenantId`.
44
- */
45
- tenantIdResolver?: (request: unknown) => string | undefined;
46
- }
47
- declare class StaticFeatureGuard implements CanActivate {
48
- private readonly reflector;
49
- private readonly entitlements;
50
- private readonly config;
51
- constructor(reflector: Reflector, entitlements: StaticEntitlementService, config?: StaticFeatureGuardConfig | null);
52
- canActivate(context: ExecutionContext): Promise<boolean>;
53
- }
54
-
55
- declare const QUOTA_PROVIDERS_TOKEN: unique symbol;
56
- declare class EnforceQuotaInterceptor implements NestInterceptor {
57
- private readonly reflector;
58
- private readonly entitlements;
59
- private readonly providers;
60
- constructor(reflector: Reflector, entitlements: StaticEntitlementService, providers?: ReadonlyArray<QuotaProvider> | null);
61
- intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
62
- private check;
63
- }
10
+ import 'rxjs';
64
11
 
65
12
  interface TenantNavItem {
66
13
  /** Unique slug, e.g. "notes", "billing", "settings". */
@@ -115,4 +62,4 @@ declare class TenantManifestService {
115
62
  getManifest(tenantId: string): Promise<TenantManifest>;
116
63
  }
117
64
 
118
- export { EnforceQuotaInterceptor, PlanResolverPort, QUOTA_PROVIDERS_TOKEN, STATIC_FEATURE_GUARD_CONFIG_TOKEN, StaticEntitlementService, type StaticEntitlementSnapshot, StaticFeatureGuard, type StaticFeatureGuardConfig, type TenantManifest, TenantManifestService, type TenantNavItem };
65
+ export { StaticEntitlementService, type TenantManifest, TenantManifestService, type TenantNavItem };
@@ -9,13 +9,13 @@ import {
9
9
  StaticPlanResolver,
10
10
  TenantManifestService,
11
11
  buildTenantManifestController
12
- } from "../chunk-47JT54VW.js";
12
+ } from "../chunk-NWLOILP6.js";
13
13
  import "../chunk-P6MYZMXQ.js";
14
14
  import "../chunk-Q53N43LQ.js";
15
15
  import "../chunk-E56W4U2P.js";
16
16
  import "../chunk-AJ3EPELS.js";
17
17
  import "../chunk-M6CZQYPY.js";
18
- import "../chunk-YXGHPILG.js";
18
+ import "../chunk-NFOSITWB.js";
19
19
  import "../chunk-MV6LW5UB.js";
20
20
  import "../chunk-NYLON2VC.js";
21
21
  import "../chunk-7MLGHWKO.js";
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/testing/index.ts
32
32
  var testing_exports = {};
33
33
  __export(testing_exports, {
34
+ EnforceQuotaInterceptor: () => EnforceQuotaInterceptor,
34
35
  FakeBundleRepository: () => FakeBundleRepository,
35
36
  FakeBusinessTypeRepository: () => FakeBusinessTypeRepository,
36
37
  FakeMarketingProjectionRepository: () => FakeMarketingProjectionRepository,
@@ -40,6 +41,10 @@ __export(testing_exports, {
40
41
  FakeSubscriptionContractRepository: () => FakeSubscriptionContractRepository,
41
42
  FakeSubscriptionRepository: () => FakeSubscriptionRepository,
42
43
  FakeTransactionRunner: () => FakeTransactionRunner,
44
+ PLAN_RESOLVER_PORT_TOKEN: () => PLAN_RESOLVER_PORT_TOKEN,
45
+ StaticEntitlementService: () => StaticEntitlementService,
46
+ StaticFeatureGuard: () => StaticFeatureGuard,
47
+ StaticPlanResolver: () => StaticPlanResolver,
43
48
  StubAuditPort: () => StubAuditPort,
44
49
  StubMfaPort: () => StubMfaPort,
45
50
  StubRlsBypassPort: () => StubRlsBypassPort,
@@ -2984,6 +2989,7 @@ function assertNoReplacesCycle(index) {
2984
2989
  __name(assertNoReplacesCycle, "assertNoReplacesCycle");
2985
2990
 
2986
2991
  // src/entitlement/limit-exceeded-error.ts
2992
+ var LIMIT_EXCEEDED = "LIMIT_EXCEEDED";
2987
2993
  var LimitExceededError = class extends Error {
2988
2994
  static {
2989
2995
  __name(this, "LimitExceededError");
@@ -2991,6 +2997,7 @@ var LimitExceededError = class extends Error {
2991
2997
  dimension;
2992
2998
  max;
2993
2999
  used;
3000
+ code = LIMIT_EXCEEDED;
2994
3001
  constructor(dimension, max, used) {
2995
3002
  super(`Limit f\xFCr ${dimension} erreicht: ${used}/${max}.`), this.dimension = dimension, this.max = max, this.used = used;
2996
3003
  this.name = "LimitExceededError";
@@ -3870,11 +3877,13 @@ var SaasPlatformModule = class _SaasPlatformModule {
3870
3877
  PlanCatalogModule,
3871
3878
  DiscoveryModule,
3872
3879
  AdminModule,
3880
+ // ADMIN_MANIFEST_CONFIG travels transitively: re-exporting an
3881
+ // imported module's token directly is an UnknownExportException
3882
+ // at boot — the module export below already carries it.
3873
3883
  AdminManifestModule,
3874
3884
  ...options.entitlement ? [
3875
3885
  EntitlementModule
3876
3886
  ] : [],
3877
- ADMIN_MANIFEST_CONFIG,
3878
3887
  ...lightweightExports
3879
3888
  ],
3880
3889
  global: true
@@ -3959,6 +3968,7 @@ function createSaasPlatformTestModule(options) {
3959
3968
  __name(createSaasPlatformTestModule, "createSaasPlatformTestModule");
3960
3969
  // Annotate the CommonJS export names for ESM import in node:
3961
3970
  0 && (module.exports = {
3971
+ EnforceQuotaInterceptor,
3962
3972
  FakeBundleRepository,
3963
3973
  FakeBusinessTypeRepository,
3964
3974
  FakeMarketingProjectionRepository,
@@ -3968,6 +3978,10 @@ __name(createSaasPlatformTestModule, "createSaasPlatformTestModule");
3968
3978
  FakeSubscriptionContractRepository,
3969
3979
  FakeSubscriptionRepository,
3970
3980
  FakeTransactionRunner,
3981
+ PLAN_RESOLVER_PORT_TOKEN,
3982
+ StaticEntitlementService,
3983
+ StaticFeatureGuard,
3984
+ StaticPlanResolver,
3971
3985
  StubAuditPort,
3972
3986
  StubMfaPort,
3973
3987
  StubRlsBypassPort,
@@ -1,11 +1,13 @@
1
1
  import { BundleRepository, BundleRow, BundleVersionRow, BundleListFilter, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, BusinessTypeRepository, BusinessTypeRow, BusinessTypeVersionRow, BusinessTypeListFilter, CreateBusinessTypeData, UpdateBusinessTypeData, CreateBusinessTypeVersionDraftData, UpdateBusinessTypeVersionDraftData, MarketingProjectionRepository, MarketingProjectionRow, MarketingProjectionFilter, CreateMarketingProjectionData, UpdateMarketingProjectionData, PlanRepository, PlanRow, PlanVersionRow, PlanListFilter, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, PlanVersionRepository, PlanVersionRecord, TransactionContext, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, CreateSubscriptionContractData, TerminateSubscriptionContractData, SubscriptionRepository, SubscriptionRecord, TransactionRunner, PlanCatalog, QuotaProvider } from '@saasicat/types';
2
2
  import { Type, DynamicModule } from '@nestjs/common';
3
- import { S as SaasPlatformAdapters } from '../saas-platform.module-C7-H9eYB.cjs';
3
+ import { c as SaasPlatformAdapters } from '../enforce-quota.interceptor-HmdZFg41.cjs';
4
+ export { E as EnforceQuotaInterceptor, P as PLAN_RESOLVER_PORT_TOKEN, S as StaticEntitlementService, g as StaticFeatureGuard, i as StaticPlanResolver } from '../enforce-quota.interceptor-HmdZFg41.cjs';
4
5
  import '../di-CcNeq9v-.cjs';
5
- import '../admin-manifest.config-DyrQNT7M.cjs';
6
- import '../discovery.scanner-CUYLKlYT.cjs';
6
+ import '../admin-manifest.config-DxTfZ8-L.cjs';
7
+ import '../discovery.scanner-DLgEvuoy.cjs';
7
8
  import '@nestjs/core';
8
9
  import '../plan-resolution-CFCoUkrE.cjs';
10
+ import 'rxjs';
9
11
 
10
12
  /**
11
13
  * In-memory FakeSubscriptionRepository — stores subscriptions by