@saasicat/nest 0.22.0 → 0.22.2

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 (34) hide show
  1. package/dist/_entries.cjs +394 -263
  2. package/dist/billing/index.d.cts +6 -4
  3. package/dist/billing/index.d.ts +6 -4
  4. package/dist/billing/index.js +15 -11
  5. package/dist/catalog/index.js +5 -5
  6. package/dist/checkout-offer/index.js +3 -3
  7. package/dist/{chunk-UO64MK3Q.js → chunk-4BSSMDLL.js} +36 -22
  8. package/dist/{chunk-UFS344JD.js → chunk-FPEQPHJE.js} +196 -81
  9. package/dist/{chunk-7ZPFQXHM.js → chunk-UOWK2HYG.js} +1 -1
  10. package/dist/{define-saasicat-C99hWAUK.d.ts → define-saasicat-BK6RRWWG.d.ts} +1 -1
  11. package/dist/{define-saasicat-ByPjtKPy.d.cts → define-saasicat-D30I-WET.d.cts} +1 -1
  12. package/dist/{enforce-quota.interceptor-BrsU1UYJ.d.cts → enforce-quota.interceptor-B9QueAFf.d.ts} +4 -1
  13. package/dist/{enforce-quota.interceptor-reO-i71U.d.ts → enforce-quota.interceptor-DY6CLjoP.d.cts} +4 -1
  14. package/dist/entitlement/index.js +5 -5
  15. package/dist/index.d.cts +5 -5
  16. package/dist/index.d.ts +5 -5
  17. package/dist/index.js +155 -151
  18. package/dist/platform/index.d.cts +28 -10
  19. package/dist/platform/index.d.ts +28 -10
  20. package/dist/platform/index.js +43 -41
  21. package/dist/{saas-platform.module-HCDNZTiE.d.cts → saas-platform.module-CgalxzcT.d.cts} +1 -1
  22. package/dist/{saas-platform.module-DolE41YY.d.ts → saas-platform.module-D1mUZPrz.d.ts} +1 -1
  23. package/dist/{subscription-bundles.module-BQmoozm5.d.ts → subscription-bundles.module-BDbODWvA.d.ts} +9 -1
  24. package/dist/{subscription-bundles.module-DCpV-Pb5.d.cts → subscription-bundles.module-Cfi-lFWF.d.cts} +9 -1
  25. package/dist/{tenant-billing.controller-7o4ObzGs.d.ts → tenant-billing.controller-BSlpFqVA.d.ts} +1 -1
  26. package/dist/{tenant-billing.controller-DubP6-Md.d.cts → tenant-billing.controller-DHSUrT_N.d.cts} +1 -1
  27. package/dist/testing/index.d.cts +4 -4
  28. package/dist/testing/index.d.ts +4 -4
  29. package/dist/testing/index.js +15 -15
  30. package/package.json +3 -3
  31. package/dist/{chunk-XTVAFJ3P.js → chunk-ES5AN53A.js} +6 -6
  32. package/dist/{chunk-EWPF57AG.js → chunk-FY4EJTV4.js} +0 -0
  33. package/dist/{chunk-NNNXXUPT.js → chunk-NXD7763W.js} +13 -13
  34. package/dist/{chunk-7X5MSAIL.js → chunk-QB7MICKQ.js} +9 -9
@@ -1,6 +1,17 @@
1
1
  import {
2
- PromoCodesModule
3
- } from "./chunk-4O6R6ARQ.js";
2
+ FEATURE_GUARD_MARKER,
3
+ PublicCatalogModule,
4
+ REQUIRE_FEATURE_KEY,
5
+ SubscriptionBundleModule,
6
+ TenantBillingModule,
7
+ isPlatformFeatureGuard
8
+ } from "./chunk-4BSSMDLL.js";
9
+ import {
10
+ CheckoutOfferModule
11
+ } from "./chunk-ES5AN53A.js";
12
+ import {
13
+ CatalogModule
14
+ } from "./chunk-QB7MICKQ.js";
4
15
  import {
5
16
  AdminManifestModule,
6
17
  AdminManifestService,
@@ -11,30 +22,21 @@ import {
11
22
  SuperAdminGuard
12
23
  } from "./chunk-SN5UOC43.js";
13
24
  import {
14
- PublicCatalogModule,
15
- REQUIRE_FEATURE_KEY,
16
- SubscriptionBundleModule,
17
- TenantBillingModule
18
- } from "./chunk-UO64MK3Q.js";
25
+ DiscoveryModule
26
+ } from "./chunk-6WL6VQ7Z.js";
19
27
  import {
20
- SubscriptionContractModule
21
- } from "./chunk-B7NRY2LV.js";
28
+ EntitlementModule,
29
+ LimitExceededError
30
+ } from "./chunk-NXD7763W.js";
22
31
  import {
23
- CatalogModule
24
- } from "./chunk-7X5MSAIL.js";
32
+ ENFORCE_QUOTA_KEY
33
+ } from "./chunk-L4SUWH5B.js";
25
34
  import {
26
- CheckoutOfferModule
27
- } from "./chunk-XTVAFJ3P.js";
35
+ PromoCodesModule
36
+ } from "./chunk-4O6R6ARQ.js";
28
37
  import {
29
38
  SaaSiCatPublicRoute
30
39
  } from "./chunk-YSC46BGM.js";
31
- import {
32
- DiscoveryModule
33
- } from "./chunk-6WL6VQ7Z.js";
34
- import {
35
- EntitlementModule,
36
- LimitExceededError
37
- } from "./chunk-NNNXXUPT.js";
38
40
  import {
39
41
  PLAN_CATALOG_TOKEN,
40
42
  PlanCatalogModule
@@ -42,12 +44,12 @@ import {
42
44
  import {
43
45
  codedError
44
46
  } from "./chunk-EBJJNTW6.js";
47
+ import {
48
+ SubscriptionContractModule
49
+ } from "./chunk-B7NRY2LV.js";
45
50
  import {
46
51
  asProvider
47
52
  } from "./chunk-SABTXESR.js";
48
- import {
49
- ENFORCE_QUOTA_KEY
50
- } from "./chunk-L4SUWH5B.js";
51
53
  import {
52
54
  __name
53
55
  } from "./chunk-SHUYVCID.js";
@@ -445,10 +447,9 @@ StaticEntitlementService = _ts_decorate4([
445
447
  ])
446
448
  ], StaticEntitlementService);
447
449
 
448
- // src/platform/static-feature.guard.ts
449
- import { ForbiddenException as ForbiddenException2, Inject as Inject3, Injectable as Injectable3, Optional } from "@nestjs/common";
450
- import { Reflector } from "@nestjs/core";
451
- import { AUTH_ERROR_CODES, FEATURE_NOT_LICENSED } from "@saasicat/types";
450
+ // src/platform/feature-guard-coverage.check.ts
451
+ import { Inject as Inject3, Injectable as Injectable3, Logger } from "@nestjs/common";
452
+ import { DiscoveryService, MetadataScanner } from "@nestjs/core";
452
453
  function _ts_decorate5(decorators, target, key, desc) {
453
454
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
454
455
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -466,6 +467,115 @@ function _ts_param4(paramIndex, decorator) {
466
467
  };
467
468
  }
468
469
  __name(_ts_param4, "_ts_param");
470
+ var GUARDS_METADATA = "__guards__";
471
+ var METHOD_METADATA = "method";
472
+ var FeatureGuardCoverageCheck = class {
473
+ static {
474
+ __name(this, "FeatureGuardCoverageCheck");
475
+ }
476
+ discoveryService;
477
+ metadataScanner;
478
+ logger = new Logger("SaaSiCat");
479
+ constructor(discoveryService, metadataScanner) {
480
+ this.discoveryService = discoveryService;
481
+ this.metadataScanner = metadataScanner;
482
+ }
483
+ onApplicationBootstrap() {
484
+ const uncovered = this.findUncoveredRoutes();
485
+ if (uncovered.length === 0) return;
486
+ const list = uncovered.map((r) => ` ${r.controller}.${r.handler} \u2014 requires ${r.features.join(" or ")}`).join("\n");
487
+ this.logger.warn(`globalFeatureGuard is off and ${uncovered.length} annotated route(s) have no feature guard in front of them, so they serve unlicensed traffic:
488
+ ${list}
489
+ Bind one behind your auth guard \u2014 @UseGuards(JwtAuthGuard, StaticFeatureGuard), or FeatureGuard from @saasicat/nest/billing on the V3 entitlement path. A guard of your own that wraps either one is not recognised here; if that is what these routes use, they are covered.`);
490
+ }
491
+ /**
492
+ * Annotated handlers whose own guards and whose controller's guards contain
493
+ * no recognisable feature guard.
494
+ *
495
+ * Deliberately conservative in one direction only: an unrecognised wrapper
496
+ * is reported (and the message says so) rather than assumed safe, because
497
+ * the named route is cheap to check. The reverse — staying silent about a
498
+ * route with no guard at all — is the failure this exists to prevent.
499
+ */
500
+ findUncoveredRoutes() {
501
+ const uncovered = [];
502
+ for (const wrapper of this.discoveryService.getControllers()) {
503
+ const instance = wrapper.instance;
504
+ if (!instance || typeof instance !== "object") continue;
505
+ const ctor = instance.constructor;
506
+ if (!ctor) continue;
507
+ const classGuards = readGuards(ctor);
508
+ const prototype = Object.getPrototypeOf(instance);
509
+ for (const method of this.metadataScanner.getAllMethodNames(prototype)) {
510
+ const handler = instance[method];
511
+ if (typeof handler !== "function") continue;
512
+ if (Reflect.getMetadata(METHOD_METADATA, handler) === void 0) continue;
513
+ const features = readFeatures(handler) ?? readFeatures(ctor) ?? /* not annotated */
514
+ null;
515
+ if (!features || features.length === 0) continue;
516
+ const guards = [
517
+ ...classGuards,
518
+ ...readGuards(handler)
519
+ ];
520
+ if (guards.some(isPlatformFeatureGuard)) continue;
521
+ uncovered.push({
522
+ controller: ctor.name,
523
+ handler: method,
524
+ features
525
+ });
526
+ }
527
+ }
528
+ return uncovered;
529
+ }
530
+ };
531
+ FeatureGuardCoverageCheck = _ts_decorate5([
532
+ Injectable3(),
533
+ _ts_param4(0, Inject3(DiscoveryService)),
534
+ _ts_param4(1, Inject3(MetadataScanner)),
535
+ _ts_metadata4("design:type", Function),
536
+ _ts_metadata4("design:paramtypes", [
537
+ typeof DiscoveryService === "undefined" ? Object : DiscoveryService,
538
+ typeof MetadataScanner === "undefined" ? Object : MetadataScanner
539
+ ])
540
+ ], FeatureGuardCoverageCheck);
541
+ function readFeatures(target) {
542
+ const value = Reflect.getMetadata(REQUIRE_FEATURE_KEY, target);
543
+ return Array.isArray(value) ? value : null;
544
+ }
545
+ __name(readFeatures, "readFeatures");
546
+ function readGuards(target) {
547
+ const value = Reflect.getMetadata(GUARDS_METADATA, target);
548
+ if (!Array.isArray(value)) return [];
549
+ return value.flatMap((guard) => typeof guard === "function" ? [
550
+ guard
551
+ ] : [
552
+ guard,
553
+ guard?.constructor
554
+ ]);
555
+ }
556
+ __name(readGuards, "readGuards");
557
+
558
+ // src/platform/static-feature.guard.ts
559
+ import { ForbiddenException as ForbiddenException2, Inject as Inject4, Injectable as Injectable4, Optional } from "@nestjs/common";
560
+ import { Reflector } from "@nestjs/core";
561
+ import { AUTH_ERROR_CODES, FEATURE_NOT_LICENSED } from "@saasicat/types";
562
+ function _ts_decorate6(decorators, target, key, desc) {
563
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
564
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
565
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
566
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
567
+ }
568
+ __name(_ts_decorate6, "_ts_decorate");
569
+ function _ts_metadata5(k, v) {
570
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
571
+ }
572
+ __name(_ts_metadata5, "_ts_metadata");
573
+ function _ts_param5(paramIndex, decorator) {
574
+ return function(target, key) {
575
+ decorator(target, key, paramIndex);
576
+ };
577
+ }
578
+ __name(_ts_param5, "_ts_param");
469
579
  var STATIC_FEATURE_GUARD_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/StaticFeatureGuardConfig");
470
580
  var StaticFeatureGuard = class {
471
581
  static {
@@ -474,6 +584,8 @@ var StaticFeatureGuard = class {
474
584
  reflector;
475
585
  entitlements;
476
586
  config;
587
+ /** Lets `FeatureGuardCoverageCheck` recognise this guard across CJS entries. */
588
+ static [FEATURE_GUARD_MARKER] = true;
477
589
  constructor(reflector, entitlements, config = null) {
478
590
  this.reflector = reflector;
479
591
  this.entitlements = entitlements;
@@ -517,14 +629,14 @@ var StaticFeatureGuard = class {
517
629
  return true;
518
630
  }
519
631
  };
520
- StaticFeatureGuard = _ts_decorate5([
521
- Injectable3(),
522
- _ts_param4(0, Inject3(Reflector)),
523
- _ts_param4(1, Inject3(StaticEntitlementService)),
524
- _ts_param4(2, Optional()),
525
- _ts_param4(2, Inject3(STATIC_FEATURE_GUARD_CONFIG_TOKEN)),
526
- _ts_metadata4("design:type", Function),
527
- _ts_metadata4("design:paramtypes", [
632
+ StaticFeatureGuard = _ts_decorate6([
633
+ Injectable4(),
634
+ _ts_param5(0, Inject4(Reflector)),
635
+ _ts_param5(1, Inject4(StaticEntitlementService)),
636
+ _ts_param5(2, Optional()),
637
+ _ts_param5(2, Inject4(STATIC_FEATURE_GUARD_CONFIG_TOKEN)),
638
+ _ts_metadata5("design:type", Function),
639
+ _ts_metadata5("design:paramtypes", [
528
640
  typeof Reflector === "undefined" ? Object : Reflector,
529
641
  typeof StaticEntitlementService === "undefined" ? Object : StaticEntitlementService,
530
642
  Object
@@ -532,27 +644,27 @@ StaticFeatureGuard = _ts_decorate5([
532
644
  ], StaticFeatureGuard);
533
645
 
534
646
  // src/platform/enforce-quota.interceptor.ts
535
- import { Inject as Inject4, Injectable as Injectable4, Optional as Optional2 } from "@nestjs/common";
647
+ import { Inject as Inject5, Injectable as Injectable5, Optional as Optional2 } from "@nestjs/common";
536
648
  import { Reflector as Reflector2 } from "@nestjs/core";
537
649
  import { from } from "rxjs";
538
650
  import { switchMap } from "rxjs/operators";
539
- function _ts_decorate6(decorators, target, key, desc) {
651
+ function _ts_decorate7(decorators, target, key, desc) {
540
652
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
541
653
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
542
654
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
543
655
  return c > 3 && r && Object.defineProperty(target, key, r), r;
544
656
  }
545
- __name(_ts_decorate6, "_ts_decorate");
546
- function _ts_metadata5(k, v) {
657
+ __name(_ts_decorate7, "_ts_decorate");
658
+ function _ts_metadata6(k, v) {
547
659
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
548
660
  }
549
- __name(_ts_metadata5, "_ts_metadata");
550
- function _ts_param5(paramIndex, decorator) {
661
+ __name(_ts_metadata6, "_ts_metadata");
662
+ function _ts_param6(paramIndex, decorator) {
551
663
  return function(target, key) {
552
664
  decorator(target, key, paramIndex);
553
665
  };
554
666
  }
555
- __name(_ts_param5, "_ts_param");
667
+ __name(_ts_param6, "_ts_param");
556
668
  var QUOTA_PROVIDERS_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/QuotaProviders");
557
669
  var EnforceQuotaInterceptor = class {
558
670
  static {
@@ -595,14 +707,14 @@ var EnforceQuotaInterceptor = class {
595
707
  }
596
708
  }
597
709
  };
598
- EnforceQuotaInterceptor = _ts_decorate6([
599
- Injectable4(),
600
- _ts_param5(0, Inject4(Reflector2)),
601
- _ts_param5(1, Inject4(StaticEntitlementService)),
602
- _ts_param5(2, Optional2()),
603
- _ts_param5(2, Inject4(QUOTA_PROVIDERS_TOKEN)),
604
- _ts_metadata5("design:type", Function),
605
- _ts_metadata5("design:paramtypes", [
710
+ EnforceQuotaInterceptor = _ts_decorate7([
711
+ Injectable5(),
712
+ _ts_param6(0, Inject5(Reflector2)),
713
+ _ts_param6(1, Inject5(StaticEntitlementService)),
714
+ _ts_param6(2, Optional2()),
715
+ _ts_param6(2, Inject5(QUOTA_PROVIDERS_TOKEN)),
716
+ _ts_metadata6("design:type", Function),
717
+ _ts_metadata6("design:paramtypes", [
606
718
  typeof Reflector2 === "undefined" ? Object : Reflector2,
607
719
  typeof StaticEntitlementService === "undefined" ? Object : StaticEntitlementService,
608
720
  Object
@@ -650,18 +762,18 @@ var SubscriptionPlanResolver = class {
650
762
  };
651
763
 
652
764
  // src/platform/tenant-manifest.service.ts
653
- import { Injectable as Injectable5 } from "@nestjs/common";
654
- function _ts_decorate7(decorators, target, key, desc) {
765
+ import { Injectable as Injectable6 } from "@nestjs/common";
766
+ function _ts_decorate8(decorators, target, key, desc) {
655
767
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
656
768
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
657
769
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
658
770
  return c > 3 && r && Object.defineProperty(target, key, r), r;
659
771
  }
660
- __name(_ts_decorate7, "_ts_decorate");
661
- function _ts_metadata6(k, v) {
772
+ __name(_ts_decorate8, "_ts_decorate");
773
+ function _ts_metadata7(k, v) {
662
774
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
663
775
  }
664
- __name(_ts_metadata6, "_ts_metadata");
776
+ __name(_ts_metadata7, "_ts_metadata");
665
777
  var TenantManifestService = class {
666
778
  static {
667
779
  __name(this, "TenantManifestService");
@@ -707,10 +819,10 @@ var TenantManifestService = class {
707
819
  };
708
820
  }
709
821
  };
710
- TenantManifestService = _ts_decorate7([
711
- Injectable5(),
712
- _ts_metadata6("design:type", Function),
713
- _ts_metadata6("design:paramtypes", [
822
+ TenantManifestService = _ts_decorate8([
823
+ Injectable6(),
824
+ _ts_metadata7("design:type", Function),
825
+ _ts_metadata7("design:paramtypes", [
714
826
  typeof StaticEntitlementService === "undefined" ? Object : StaticEntitlementService
715
827
  ])
716
828
  ], TenantManifestService);
@@ -724,24 +836,24 @@ function isVisible(item, features) {
724
836
  __name(isVisible, "isVisible");
725
837
 
726
838
  // src/platform/tenant-manifest.controller.ts
727
- import { Controller as Controller2, Get as Get2, Inject as Inject5, Req, UseGuards } from "@nestjs/common";
728
- function _ts_decorate8(decorators, target, key, desc) {
839
+ import { Controller as Controller2, Get as Get2, Inject as Inject6, Req, UseGuards } from "@nestjs/common";
840
+ function _ts_decorate9(decorators, target, key, desc) {
729
841
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
730
842
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
731
843
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
732
844
  return c > 3 && r && Object.defineProperty(target, key, r), r;
733
845
  }
734
- __name(_ts_decorate8, "_ts_decorate");
735
- function _ts_metadata7(k, v) {
846
+ __name(_ts_decorate9, "_ts_decorate");
847
+ function _ts_metadata8(k, v) {
736
848
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
737
849
  }
738
- __name(_ts_metadata7, "_ts_metadata");
739
- function _ts_param6(paramIndex, decorator) {
850
+ __name(_ts_metadata8, "_ts_metadata");
851
+ function _ts_param7(paramIndex, decorator) {
740
852
  return function(target, key) {
741
853
  decorator(target, key, paramIndex);
742
854
  };
743
855
  }
744
- __name(_ts_param6, "_ts_param");
856
+ __name(_ts_param7, "_ts_param");
745
857
  function buildTenantManifestController(options) {
746
858
  const path = options.path ?? "tenant/manifest";
747
859
  let GeneratedTenantManifestController = class GeneratedTenantManifestController {
@@ -760,21 +872,21 @@ function buildTenantManifestController(options) {
760
872
  return this.svc.getManifest(tenantId);
761
873
  }
762
874
  };
763
- _ts_decorate8([
875
+ _ts_decorate9([
764
876
  Get2(),
765
- _ts_param6(0, Req()),
766
- _ts_metadata7("design:type", Function),
767
- _ts_metadata7("design:paramtypes", [
877
+ _ts_param7(0, Req()),
878
+ _ts_metadata8("design:type", Function),
879
+ _ts_metadata8("design:paramtypes", [
768
880
  typeof RequestWithUser === "undefined" ? Object : RequestWithUser
769
881
  ]),
770
- _ts_metadata7("design:returntype", Promise)
882
+ _ts_metadata8("design:returntype", Promise)
771
883
  ], GeneratedTenantManifestController.prototype, "get", null);
772
- GeneratedTenantManifestController = _ts_decorate8([
884
+ GeneratedTenantManifestController = _ts_decorate9([
773
885
  Controller2(path),
774
886
  UseGuards(...options.guards),
775
- _ts_param6(0, Inject5(TenantManifestService)),
776
- _ts_metadata7("design:type", Function),
777
- _ts_metadata7("design:paramtypes", [
887
+ _ts_param7(0, Inject6(TenantManifestService)),
888
+ _ts_metadata8("design:type", Function),
889
+ _ts_metadata8("design:paramtypes", [
778
890
  typeof TenantManifestService === "undefined" ? Object : TenantManifestService
779
891
  ])
780
892
  ], GeneratedTenantManifestController);
@@ -783,17 +895,18 @@ function buildTenantManifestController(options) {
783
895
  __name(buildTenantManifestController, "buildTenantManifestController");
784
896
 
785
897
  // src/platform/saas-platform.module.ts
786
- import { Logger, Module as Module2 } from "@nestjs/common";
898
+ import { Logger as Logger2, Module as Module2 } from "@nestjs/common";
787
899
  import { APP_GUARD, APP_INTERCEPTOR } from "@nestjs/core";
788
900
  import { assertPersistenceCapabilities } from "@saasicat/types";
789
- function _ts_decorate9(decorators, target, key, desc) {
901
+ import { DiscoveryModule as NestDiscoveryModule } from "@nestjs/core";
902
+ function _ts_decorate10(decorators, target, key, desc) {
790
903
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
791
904
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
792
905
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
793
906
  return c > 3 && r && Object.defineProperty(target, key, r), r;
794
907
  }
795
- __name(_ts_decorate9, "_ts_decorate");
796
- var PLATFORM_LOGGER = new Logger("SaaSiCat");
908
+ __name(_ts_decorate10, "_ts_decorate");
909
+ var PLATFORM_LOGGER = new Logger2("SaaSiCat");
797
910
  var PLATFORM_SUBSCRIPTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/PlatformSubscriptionRepository");
798
911
  var STANDARD_MANIFEST_REGISTRATION_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/StandardManifestRegistration");
799
912
  function buildStandardManifestContribution(catalog, adminResources, promoCodes) {
@@ -1259,7 +1372,8 @@ var SaasPlatformModule = class _SaasPlatformModule {
1259
1372
  });
1260
1373
  lightweightExports.push(PLAN_RESOLVER_PORT_TOKEN, StaticEntitlementService, StaticFeatureGuard, EnforceQuotaInterceptor, QUOTA_PROVIDERS_TOKEN);
1261
1374
  if (options.globalFeatureGuard === false) {
1262
- PLATFORM_LOGGER.warn("globalFeatureGuard is off \u2014 the platform did NOT bind StaticFeatureGuard as an APP_GUARD. @RequireFeature only blocks on routes where you bound a feature guard yourself, behind your auth guard: @UseGuards(JwtAuthGuard, StaticFeatureGuard), or FeatureGuard from @saasicat/nest/billing on the V3 entitlement path. Any annotated route without one serves unlicensed traffic.");
1375
+ lightweightProviders.push(FeatureGuardCoverageCheck);
1376
+ imports.push(NestDiscoveryModule);
1263
1377
  }
1264
1378
  } else {
1265
1379
  PLATFORM_LOGGER.warn("No plan resolver configured \u2014 @RequireFeature and @EnforceQuota are INERT. The platform registered neither StaticFeatureGuard nor EnforceQuotaInterceptor, so every annotated route serves unlicensed traffic and every quota is unlimited. Set one of: adapters.planResolver, defaultPlanId, or tenantBilling.");
@@ -1324,7 +1438,7 @@ var SaasPlatformModule = class _SaasPlatformModule {
1324
1438
  };
1325
1439
  }
1326
1440
  };
1327
- SaasPlatformModule = _ts_decorate9([
1441
+ SaasPlatformModule = _ts_decorate10([
1328
1442
  Module2({})
1329
1443
  ], SaasPlatformModule);
1330
1444
 
@@ -1337,6 +1451,7 @@ export {
1337
1451
  PLAN_RESOLVER_PORT_TOKEN,
1338
1452
  StaticPlanResolver,
1339
1453
  StaticEntitlementService,
1454
+ FeatureGuardCoverageCheck,
1340
1455
  STATIC_FEATURE_GUARD_CONFIG_TOKEN,
1341
1456
  StaticFeatureGuard,
1342
1457
  QUOTA_PROVIDERS_TOKEN,
@@ -6,7 +6,7 @@ import {
6
6
  ADVISORY_STRICT_MODE_CODES,
7
7
  validateBundleDraft,
8
8
  validatePlanDraft
9
- } from "./chunk-7X5MSAIL.js";
9
+ } from "./chunk-QB7MICKQ.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-SHUYVCID.js";
@@ -3,7 +3,7 @@ import { ExecutionContext } from '@nestjs/common';
3
3
  import { Reflector } from '@nestjs/core';
4
4
  import { SuperAdminProvisioningPort, SetupStatusResponse, SetupRequest, SetupResult, SetupConfirmMfaRequest, SetupConfirmMfaResponse } from '@saasicat/types';
5
5
  import { h as MfaService } from './admin-stats.service-Db2exT_d.js';
6
- import { f as SaasPlatformModuleOptions } from './saas-platform.module-DolE41YY.js';
6
+ import { f as SaasPlatformModuleOptions } from './saas-platform.module-D1mUZPrz.js';
7
7
 
8
8
  /**
9
9
  * Shared metadata key for endpoints that intentionally run without application
@@ -3,7 +3,7 @@ import { ExecutionContext } from '@nestjs/common';
3
3
  import { Reflector } from '@nestjs/core';
4
4
  import { SuperAdminProvisioningPort, SetupStatusResponse, SetupRequest, SetupResult, SetupConfirmMfaRequest, SetupConfirmMfaResponse } from '@saasicat/types';
5
5
  import { h as MfaService } from './admin-stats.service-HUZIU448.cjs';
6
- import { f as SaasPlatformModuleOptions } from './saas-platform.module-HCDNZTiE.cjs';
6
+ import { f as SaasPlatformModuleOptions } from './saas-platform.module-CgalxzcT.cjs';
7
7
 
8
8
  /**
9
9
  * Shared metadata key for endpoints that intentionally run without application
@@ -1,8 +1,9 @@
1
1
  import { CanActivate, ExecutionContext, NestInterceptor, CallHandler } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
+ import { F as FEATURE_GUARD_MARKER } from './subscription-bundles.module-BDbODWvA.js';
3
4
  import { Observable } from 'rxjs';
4
5
  import { PlanCatalog, QuotaProvider } from '@saasicat/types';
5
- import { p as PlanResolverPort } from './saas-platform.module-HCDNZTiE.cjs';
6
+ import { p as PlanResolverPort } from './saas-platform.module-D1mUZPrz.js';
6
7
 
7
8
  interface StaticEntitlementSnapshot {
8
9
  planId: string | null;
@@ -43,6 +44,8 @@ declare class StaticFeatureGuard implements CanActivate {
43
44
  private readonly reflector;
44
45
  private readonly entitlements;
45
46
  private readonly config;
47
+ /** Lets `FeatureGuardCoverageCheck` recognise this guard across CJS entries. */
48
+ static readonly [FEATURE_GUARD_MARKER] = true;
46
49
  constructor(reflector: Reflector, entitlements: StaticEntitlementService, config?: StaticFeatureGuardConfig | null);
47
50
  canActivate(context: ExecutionContext): Promise<boolean>;
48
51
  }
@@ -1,8 +1,9 @@
1
1
  import { CanActivate, ExecutionContext, NestInterceptor, CallHandler } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
+ import { F as FEATURE_GUARD_MARKER } from './subscription-bundles.module-Cfi-lFWF.cjs';
3
4
  import { Observable } from 'rxjs';
4
5
  import { PlanCatalog, QuotaProvider } from '@saasicat/types';
5
- import { p as PlanResolverPort } from './saas-platform.module-DolE41YY.js';
6
+ import { p as PlanResolverPort } from './saas-platform.module-CgalxzcT.cjs';
6
7
 
7
8
  interface StaticEntitlementSnapshot {
8
9
  planId: string | null;
@@ -43,6 +44,8 @@ declare class StaticFeatureGuard implements CanActivate {
43
44
  private readonly reflector;
44
45
  private readonly entitlements;
45
46
  private readonly config;
47
+ /** Lets `FeatureGuardCoverageCheck` recognise this guard across CJS entries. */
48
+ static readonly [FEATURE_GUARD_MARKER] = true;
46
49
  constructor(reflector: Reflector, entitlements: StaticEntitlementService, config?: StaticFeatureGuardConfig | null);
47
50
  canActivate(context: ExecutionContext): Promise<boolean>;
48
51
  }
@@ -19,10 +19,7 @@ import {
19
19
  mergeSubscriptionBundlesIntoLimits,
20
20
  resolveEntitlementPlan,
21
21
  toEffectiveLimitsSnapshot
22
- } from "../chunk-NNNXXUPT.js";
23
- import "../chunk-DQKCK7DX.js";
24
- import "../chunk-NYLON2VC.js";
25
- import "../chunk-EBJJNTW6.js";
22
+ } from "../chunk-NXD7763W.js";
26
23
  import {
27
24
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
28
25
  ENTITLEMENT_SERVICE_TOKEN,
@@ -31,8 +28,11 @@ import {
31
28
  TRANSACTION_RUNNER_TOKEN
32
29
  } from "../chunk-WKVBNTYC.js";
33
30
  import "../chunk-L4KTQ6CL.js";
34
- import "../chunk-SABTXESR.js";
35
31
  import "../chunk-L4SUWH5B.js";
32
+ import "../chunk-DQKCK7DX.js";
33
+ import "../chunk-EBJJNTW6.js";
34
+ import "../chunk-NYLON2VC.js";
35
+ import "../chunk-SABTXESR.js";
36
36
  import "../chunk-SHUYVCID.js";
37
37
  export {
38
38
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { P as ProviderSpec, a as asProvider } from './di-CcNeq9v-.cjs';
2
- import { S as SetupService } from './define-saasicat-ByPjtKPy.cjs';
3
- export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-ByPjtKPy.cjs';
2
+ import { S as SetupService } from './define-saasicat-D30I-WET.cjs';
3
+ export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-D30I-WET.cjs';
4
4
  export { CreatePromoCodeDto, PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN, PROMO_CODE_REPOSITORY_TOKEN, PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN, PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN, PROMO_REVENUE_DEDUCTION_AGGREGATOR_TOKEN, PROMO_SERVICE_CONFIG_TOKEN, PROMO_SUBSCRIPTION_LOOKUP_TOKEN, PROMO_TRANSACTION_RUNNER_TOKEN, PreviewPromoCodeDto, PromoCodeExpirer, PromoCodeForCalc, PromoCodePublicController, UpdatePromoCodeDto, addCycles, buildLabel, buildPromoCodeAdminController, computeDiscountGross, computeDiscountedGross, computeIncludedVat, computeRegularStartsAt, grossFromNet, round2 } from './promo/index.cjs';
5
5
  export { a as PreviewInput, b as PreviewInvalid, c as PreviewReason, d as PreviewResult, e as PreviewValid, f as PromoCodeStats, g as PromoCodesService, P as PromoServiceConfig, R as RedeemInput } from './service-D48clObR.cjs';
6
6
  export { P as PromoCodeRateLimitGuard, h as hashIp, i as ipFingerprint } from './rate-limit.guard-dntqAlfZ.cjs';
@@ -8,8 +8,8 @@ export { P as PromoCodesModule, a as PromoCodesModuleOptions } from './module-CH
8
8
  export { AjvErrorLike, CatalogBundleUpsellResolver, ConfiguratorCatalogBuilder, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, FeatureGuardConfig, LimitExceededFilter, LoadPlanCatalogOptions, MarketingFields, NextPeriodWindow, 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, PeriodRollInput, PlanCatalogBuildSettings, PlanCatalogImportDto, PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, PlanCatalogModuleOptions, PlanCatalogValidationError, PlanResponseEntry, PublicBundleEntry, PublicCatalogController, PublicCatalogModule, PublicCatalogModuleOptions, PublishValidationError, PublishablePlanVersion, REQUIRE_FEATURE_KEY, RenewalDecision, RenewalSubInput, RequireFeature, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SubscriptionContractFreezeService, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead } from './billing/index.cjs';
9
9
  import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse, PlatformErrorCode, PlatformErrorBody } from '@saasicat/types';
10
10
  export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
11
- export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, f as ContractFreezePort, g as ContractFreezeSourcePort, D as DuePendingPlanChange, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver } from './subscription-bundles.module-DCpV-Pb5.cjs';
12
- export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-DubP6-Md.cjs';
11
+ export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, f as ContractFreezePort, g as ContractFreezeSourcePort, D as DuePendingPlanChange, F as FEATURE_GUARD_MARKER, M as MarkedFeatureGuard, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver, E as isPlatformFeatureGuard } from './subscription-bundles.module-Cfi-lFWF.cjs';
12
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-DHSUrT_N.cjs';
13
13
  export { C as CustomLimitsShape, E as EffectiveLimits, a as EffectiveLimitsSnapshot, b as EnforceLimitInput, c as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, d as SubscriptionLimitsInput, e as aggregateContractLineItemEntitlements, f as aggregateLimits, g as aggregateSubscriptionBundleQuotas, h as applyCustomLimits, i as collectSubscriptionBundleFeatures, j as contractBundleVersionIds, k as contractLimits, l as filterActiveSubscriptionBundles, m as filterPlannedOnlyFeatures, n as hasAnyFeature, o as hasFeature, p as mergeSubscriptionBundlesIntoLimits, t as toEffectiveLimitsSnapshot } from './aggregation-mZ7WZROK.cjs';
14
14
  export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, ENTITLEMENT_SERVICE_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.cjs';
15
15
  export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CFCoUkrE.cjs';
@@ -17,7 +17,7 @@ export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT
17
17
  export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, g as AdminStatsSnapshot, M as MfaGuard, h as MfaService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN, R as REQUIRE_MFA_KEY, i as RequireMfa, S as SuperAdminGuard, T as TotpSetupResult, V as VerifyTotpInput } from './admin-stats.service-HUZIU448.cjs';
18
18
  export { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.cjs';
19
19
  export { A as ADMIN_MANIFEST_CONFIG, a as ADMIN_RESOURCES_PORT_TOKEN, b as AdminManifestConfig, c as AdminResourcesModule, d as AdminResourcesModuleOptions, e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions, S as SuspendTenantDto } from './admin-resources.module-DGgGSdzN.cjs';
20
- export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-HCDNZTiE.cjs';
20
+ export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-CgalxzcT.cjs';
21
21
  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_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';
22
22
  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';
23
23
  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';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { P as ProviderSpec, a as asProvider } from './di-CcNeq9v-.js';
2
- import { S as SetupService } from './define-saasicat-C99hWAUK.js';
3
- export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-C99hWAUK.js';
2
+ import { S as SetupService } from './define-saasicat-BK6RRWWG.js';
3
+ export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-BK6RRWWG.js';
4
4
  export { CreatePromoCodeDto, PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN, PROMO_CODE_REPOSITORY_TOKEN, PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN, PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN, PROMO_REVENUE_DEDUCTION_AGGREGATOR_TOKEN, PROMO_SERVICE_CONFIG_TOKEN, PROMO_SUBSCRIPTION_LOOKUP_TOKEN, PROMO_TRANSACTION_RUNNER_TOKEN, PreviewPromoCodeDto, PromoCodeExpirer, PromoCodeForCalc, PromoCodePublicController, UpdatePromoCodeDto, addCycles, buildLabel, buildPromoCodeAdminController, computeDiscountGross, computeDiscountedGross, computeIncludedVat, computeRegularStartsAt, grossFromNet, round2 } from './promo/index.js';
5
5
  export { a as PreviewInput, b as PreviewInvalid, c as PreviewReason, d as PreviewResult, e as PreviewValid, f as PromoCodeStats, g as PromoCodesService, P as PromoServiceConfig, R as RedeemInput } from './service-D48clObR.js';
6
6
  export { P as PromoCodeRateLimitGuard, h as hashIp, i as ipFingerprint } from './rate-limit.guard-dntqAlfZ.js';
@@ -8,8 +8,8 @@ export { P as PromoCodesModule, a as PromoCodesModuleOptions } from './module-BE
8
8
  export { AjvErrorLike, CatalogBundleUpsellResolver, ConfiguratorCatalogBuilder, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, FeatureGuardConfig, LimitExceededFilter, LoadPlanCatalogOptions, MarketingFields, NextPeriodWindow, 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, PeriodRollInput, PlanCatalogBuildSettings, PlanCatalogImportDto, PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, PlanCatalogModuleOptions, PlanCatalogValidationError, PlanResponseEntry, PublicBundleEntry, PublicCatalogController, PublicCatalogModule, PublicCatalogModuleOptions, PublishValidationError, PublishablePlanVersion, REQUIRE_FEATURE_KEY, RenewalDecision, RenewalSubInput, RequireFeature, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SubscriptionContractFreezeService, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead } from './billing/index.js';
9
9
  import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse, PlatformErrorCode, PlatformErrorBody } from '@saasicat/types';
10
10
  export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
11
- export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, f as ContractFreezePort, g as ContractFreezeSourcePort, D as DuePendingPlanChange, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver } from './subscription-bundles.module-BQmoozm5.js';
12
- export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-7o4ObzGs.js';
11
+ export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, f as ContractFreezePort, g as ContractFreezeSourcePort, D as DuePendingPlanChange, F as FEATURE_GUARD_MARKER, M as MarkedFeatureGuard, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver, E as isPlatformFeatureGuard } from './subscription-bundles.module-BDbODWvA.js';
12
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-BSlpFqVA.js';
13
13
  export { C as CustomLimitsShape, E as EffectiveLimits, a as EffectiveLimitsSnapshot, b as EnforceLimitInput, c as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, d as SubscriptionLimitsInput, e as aggregateContractLineItemEntitlements, f as aggregateLimits, g as aggregateSubscriptionBundleQuotas, h as applyCustomLimits, i as collectSubscriptionBundleFeatures, j as contractBundleVersionIds, k as contractLimits, l as filterActiveSubscriptionBundles, m as filterPlannedOnlyFeatures, n as hasAnyFeature, o as hasFeature, p as mergeSubscriptionBundlesIntoLimits, t as toEffectiveLimitsSnapshot } from './aggregation-DP5zfKbU.js';
14
14
  export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, ENTITLEMENT_SERVICE_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.js';
15
15
  export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CFCoUkrE.js';
@@ -17,7 +17,7 @@ export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT
17
17
  export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, g as AdminStatsSnapshot, M as MfaGuard, h as MfaService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN, R as REQUIRE_MFA_KEY, i as RequireMfa, S as SuperAdminGuard, T as TotpSetupResult, V as VerifyTotpInput } from './admin-stats.service-Db2exT_d.js';
18
18
  export { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.js';
19
19
  export { A as ADMIN_MANIFEST_CONFIG, a as ADMIN_RESOURCES_PORT_TOKEN, b as AdminManifestConfig, c as AdminResourcesModule, d as AdminResourcesModuleOptions, e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions, S as SuspendTenantDto } from './admin-resources.module-BY5r_1MG.js';
20
- export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-DolE41YY.js';
20
+ export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-D1mUZPrz.js';
21
21
  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_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';
22
22
  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';
23
23
  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';