@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
package/dist/_entries.cjs CHANGED
@@ -1631,6 +1631,7 @@ __export(billing_exports, {
1631
1631
  ComposedTenantAuthGuard: () => ComposedTenantAuthGuard,
1632
1632
  ConfiguratorCatalogBuilder: () => ConfiguratorCatalogBuilder,
1633
1633
  FEATURE_GUARD_CONFIG_TOKEN: () => FEATURE_GUARD_CONFIG_TOKEN,
1634
+ FEATURE_GUARD_MARKER: () => FEATURE_GUARD_MARKER,
1634
1635
  FEATURE_UI_REGISTRY_TOKEN: () => FEATURE_UI_REGISTRY_TOKEN2,
1635
1636
  FeatureGuard: () => FeatureGuard,
1636
1637
  LimitExceededFilter: () => LimitExceededFilter,
@@ -1700,6 +1701,7 @@ __export(billing_exports, {
1700
1701
  initialPeriodWindow: () => initialPeriodWindow,
1701
1702
  isFeatureInPlan: () => isFeatureInPlan,
1702
1703
  isFeaturePlannedOnly: () => isFeaturePlannedOnly,
1704
+ isPlatformFeatureGuard: () => isPlatformFeatureGuard,
1703
1705
  loadPlanCatalogFromFile: () => loadPlanCatalogFromFile,
1704
1706
  loadPlanCatalogFromString: () => loadPlanCatalogFromString,
1705
1707
  periodEndAfter: () => periodEndAfter,
@@ -1829,6 +1831,16 @@ function computeNextPeriod(sub, now) {
1829
1831
  }
1830
1832
  __name(computeNextPeriod, "computeNextPeriod");
1831
1833
 
1834
+ // src/billing/feature-guard-marker.ts
1835
+ var FEATURE_GUARD_MARKER = /* @__PURE__ */ Symbol.for("saasicat/nest/feature-guard");
1836
+ function isPlatformFeatureGuard(target) {
1837
+ if (target === null || typeof target !== "function" && typeof target !== "object") {
1838
+ return false;
1839
+ }
1840
+ return target[FEATURE_GUARD_MARKER] === true;
1841
+ }
1842
+ __name(isPlatformFeatureGuard, "isPlatformFeatureGuard");
1843
+
1832
1844
  // src/billing/require-feature.decorator.ts
1833
1845
  var import_common15 = require("@nestjs/common");
1834
1846
  var REQUIRE_FEATURE_KEY = "require-feature";
@@ -2642,6 +2654,8 @@ var FeatureGuard = class _FeatureGuard {
2642
2654
  entitlements;
2643
2655
  config;
2644
2656
  upsellResolver;
2657
+ /** Lets `FeatureGuardCoverageCheck` recognise this guard across CJS entries. */
2658
+ static [FEATURE_GUARD_MARKER] = true;
2645
2659
  logger = new import_common18.Logger(_FeatureGuard.name);
2646
2660
  constructor(reflector, entitlements, config = null, upsellResolver = null) {
2647
2661
  this.reflector = reflector;
@@ -13684,6 +13698,7 @@ __export(platform_exports, {
13684
13698
  DiscoveryScanner: () => DiscoveryScanner,
13685
13699
  EnforceQuotaInterceptor: () => EnforceQuotaInterceptor,
13686
13700
  EntitlementService: () => EntitlementService,
13701
+ FeatureGuardCoverageCheck: () => FeatureGuardCoverageCheck,
13687
13702
  MarketingProjectionsService: () => MarketingProjectionsService,
13688
13703
  MarketingSettingsService: () => MarketingSettingsService,
13689
13704
  MfaGuard: () => MfaGuard,
@@ -13724,8 +13739,8 @@ __export(platform_exports, {
13724
13739
  });
13725
13740
 
13726
13741
  // src/platform/saas-platform.module.ts
13727
- var import_common79 = require("@nestjs/common");
13728
- var import_core9 = require("@nestjs/core");
13742
+ var import_common80 = require("@nestjs/common");
13743
+ var import_core10 = require("@nestjs/core");
13729
13744
  var import_types31 = require("@saasicat/types");
13730
13745
 
13731
13746
  // src/promo/module.ts
@@ -14863,10 +14878,12 @@ StaticEntitlementService = _ts_decorate84([
14863
14878
  ])
14864
14879
  ], StaticEntitlementService);
14865
14880
 
14866
- // src/platform/static-feature.guard.ts
14881
+ // src/platform/saas-platform.module.ts
14882
+ var import_core11 = require("@nestjs/core");
14883
+
14884
+ // src/platform/feature-guard-coverage.check.ts
14867
14885
  var import_common75 = require("@nestjs/common");
14868
14886
  var import_core7 = require("@nestjs/core");
14869
- var import_types30 = require("@saasicat/types");
14870
14887
  function _ts_decorate85(decorators, target, key, desc) {
14871
14888
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14872
14889
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -14884,6 +14901,115 @@ function _ts_param53(paramIndex, decorator) {
14884
14901
  };
14885
14902
  }
14886
14903
  __name(_ts_param53, "_ts_param");
14904
+ var GUARDS_METADATA = "__guards__";
14905
+ var METHOD_METADATA = "method";
14906
+ var FeatureGuardCoverageCheck = class {
14907
+ static {
14908
+ __name(this, "FeatureGuardCoverageCheck");
14909
+ }
14910
+ discoveryService;
14911
+ metadataScanner;
14912
+ logger = new import_common75.Logger("SaaSiCat");
14913
+ constructor(discoveryService, metadataScanner) {
14914
+ this.discoveryService = discoveryService;
14915
+ this.metadataScanner = metadataScanner;
14916
+ }
14917
+ onApplicationBootstrap() {
14918
+ const uncovered = this.findUncoveredRoutes();
14919
+ if (uncovered.length === 0) return;
14920
+ const list = uncovered.map((r) => ` ${r.controller}.${r.handler} \u2014 requires ${r.features.join(" or ")}`).join("\n");
14921
+ 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:
14922
+ ${list}
14923
+ 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.`);
14924
+ }
14925
+ /**
14926
+ * Annotated handlers whose own guards and whose controller's guards contain
14927
+ * no recognisable feature guard.
14928
+ *
14929
+ * Deliberately conservative in one direction only: an unrecognised wrapper
14930
+ * is reported (and the message says so) rather than assumed safe, because
14931
+ * the named route is cheap to check. The reverse — staying silent about a
14932
+ * route with no guard at all — is the failure this exists to prevent.
14933
+ */
14934
+ findUncoveredRoutes() {
14935
+ const uncovered = [];
14936
+ for (const wrapper of this.discoveryService.getControllers()) {
14937
+ const instance = wrapper.instance;
14938
+ if (!instance || typeof instance !== "object") continue;
14939
+ const ctor = instance.constructor;
14940
+ if (!ctor) continue;
14941
+ const classGuards = readGuards(ctor);
14942
+ const prototype = Object.getPrototypeOf(instance);
14943
+ for (const method of this.metadataScanner.getAllMethodNames(prototype)) {
14944
+ const handler = instance[method];
14945
+ if (typeof handler !== "function") continue;
14946
+ if (Reflect.getMetadata(METHOD_METADATA, handler) === void 0) continue;
14947
+ const features = readFeatures(handler) ?? readFeatures(ctor) ?? /* not annotated */
14948
+ null;
14949
+ if (!features || features.length === 0) continue;
14950
+ const guards = [
14951
+ ...classGuards,
14952
+ ...readGuards(handler)
14953
+ ];
14954
+ if (guards.some(isPlatformFeatureGuard)) continue;
14955
+ uncovered.push({
14956
+ controller: ctor.name,
14957
+ handler: method,
14958
+ features
14959
+ });
14960
+ }
14961
+ }
14962
+ return uncovered;
14963
+ }
14964
+ };
14965
+ FeatureGuardCoverageCheck = _ts_decorate85([
14966
+ (0, import_common75.Injectable)(),
14967
+ _ts_param53(0, (0, import_common75.Inject)(import_core7.DiscoveryService)),
14968
+ _ts_param53(1, (0, import_common75.Inject)(import_core7.MetadataScanner)),
14969
+ _ts_metadata66("design:type", Function),
14970
+ _ts_metadata66("design:paramtypes", [
14971
+ typeof import_core7.DiscoveryService === "undefined" ? Object : import_core7.DiscoveryService,
14972
+ typeof import_core7.MetadataScanner === "undefined" ? Object : import_core7.MetadataScanner
14973
+ ])
14974
+ ], FeatureGuardCoverageCheck);
14975
+ function readFeatures(target) {
14976
+ const value = Reflect.getMetadata(REQUIRE_FEATURE_KEY, target);
14977
+ return Array.isArray(value) ? value : null;
14978
+ }
14979
+ __name(readFeatures, "readFeatures");
14980
+ function readGuards(target) {
14981
+ const value = Reflect.getMetadata(GUARDS_METADATA, target);
14982
+ if (!Array.isArray(value)) return [];
14983
+ return value.flatMap((guard) => typeof guard === "function" ? [
14984
+ guard
14985
+ ] : [
14986
+ guard,
14987
+ guard?.constructor
14988
+ ]);
14989
+ }
14990
+ __name(readGuards, "readGuards");
14991
+
14992
+ // src/platform/static-feature.guard.ts
14993
+ var import_common76 = require("@nestjs/common");
14994
+ var import_core8 = require("@nestjs/core");
14995
+ var import_types30 = require("@saasicat/types");
14996
+ function _ts_decorate86(decorators, target, key, desc) {
14997
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14998
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14999
+ 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;
15000
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15001
+ }
15002
+ __name(_ts_decorate86, "_ts_decorate");
15003
+ function _ts_metadata67(k, v) {
15004
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15005
+ }
15006
+ __name(_ts_metadata67, "_ts_metadata");
15007
+ function _ts_param54(paramIndex, decorator) {
15008
+ return function(target, key) {
15009
+ decorator(target, key, paramIndex);
15010
+ };
15011
+ }
15012
+ __name(_ts_param54, "_ts_param");
14887
15013
  var STATIC_FEATURE_GUARD_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/StaticFeatureGuardConfig");
14888
15014
  var StaticFeatureGuard = class {
14889
15015
  static {
@@ -14892,6 +15018,8 @@ var StaticFeatureGuard = class {
14892
15018
  reflector;
14893
15019
  entitlements;
14894
15020
  config;
15021
+ /** Lets `FeatureGuardCoverageCheck` recognise this guard across CJS entries. */
15022
+ static [FEATURE_GUARD_MARKER] = true;
14895
15023
  constructor(reflector, entitlements, config = null) {
14896
15024
  this.reflector = reflector;
14897
15025
  this.entitlements = entitlements;
@@ -14906,7 +15034,7 @@ var StaticFeatureGuard = class {
14906
15034
  const request = context.switchToHttp().getRequest();
14907
15035
  const user = request.user;
14908
15036
  if (!user) {
14909
- throw new import_common75.ForbiddenException({
15037
+ throw new import_common76.ForbiddenException({
14910
15038
  code: import_types30.AUTH_ERROR_CODES.NOT_AUTHENTICATED,
14911
15039
  message: "Not authenticated"
14912
15040
  });
@@ -14915,7 +15043,7 @@ var StaticFeatureGuard = class {
14915
15043
  if (role === "SUPER_ADMIN") return true;
14916
15044
  const tenantId = this.config?.tenantIdResolver ? this.config.tenantIdResolver(request) : request.tenantId ?? user.tenantId;
14917
15045
  if (!tenantId) {
14918
- throw new import_common75.ForbiddenException({
15046
+ throw new import_common76.ForbiddenException({
14919
15047
  code: import_types30.AUTH_ERROR_CODES.NO_TENANT_ASSIGNED,
14920
15048
  message: "No tenant assigned"
14921
15049
  });
@@ -14930,47 +15058,47 @@ var StaticFeatureGuard = class {
14930
15058
  offers: [],
14931
15059
  message: `Feature ${required.join(" / ")} is not included in the current plan.`
14932
15060
  };
14933
- throw new import_common75.ForbiddenException(body);
15061
+ throw new import_common76.ForbiddenException(body);
14934
15062
  }
14935
15063
  return true;
14936
15064
  }
14937
15065
  };
14938
- StaticFeatureGuard = _ts_decorate85([
14939
- (0, import_common75.Injectable)(),
14940
- _ts_param53(0, (0, import_common75.Inject)(import_core7.Reflector)),
14941
- _ts_param53(1, (0, import_common75.Inject)(StaticEntitlementService)),
14942
- _ts_param53(2, (0, import_common75.Optional)()),
14943
- _ts_param53(2, (0, import_common75.Inject)(STATIC_FEATURE_GUARD_CONFIG_TOKEN)),
14944
- _ts_metadata66("design:type", Function),
14945
- _ts_metadata66("design:paramtypes", [
14946
- typeof import_core7.Reflector === "undefined" ? Object : import_core7.Reflector,
15066
+ StaticFeatureGuard = _ts_decorate86([
15067
+ (0, import_common76.Injectable)(),
15068
+ _ts_param54(0, (0, import_common76.Inject)(import_core8.Reflector)),
15069
+ _ts_param54(1, (0, import_common76.Inject)(StaticEntitlementService)),
15070
+ _ts_param54(2, (0, import_common76.Optional)()),
15071
+ _ts_param54(2, (0, import_common76.Inject)(STATIC_FEATURE_GUARD_CONFIG_TOKEN)),
15072
+ _ts_metadata67("design:type", Function),
15073
+ _ts_metadata67("design:paramtypes", [
15074
+ typeof import_core8.Reflector === "undefined" ? Object : import_core8.Reflector,
14947
15075
  typeof StaticEntitlementService === "undefined" ? Object : StaticEntitlementService,
14948
15076
  Object
14949
15077
  ])
14950
15078
  ], StaticFeatureGuard);
14951
15079
 
14952
15080
  // src/platform/enforce-quota.interceptor.ts
14953
- var import_common76 = require("@nestjs/common");
14954
- var import_core8 = require("@nestjs/core");
15081
+ var import_common77 = require("@nestjs/common");
15082
+ var import_core9 = require("@nestjs/core");
14955
15083
  var import_rxjs2 = require("rxjs");
14956
15084
  var import_operators2 = require("rxjs/operators");
14957
- function _ts_decorate86(decorators, target, key, desc) {
15085
+ function _ts_decorate87(decorators, target, key, desc) {
14958
15086
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14959
15087
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14960
15088
  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;
14961
15089
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14962
15090
  }
14963
- __name(_ts_decorate86, "_ts_decorate");
14964
- function _ts_metadata67(k, v) {
15091
+ __name(_ts_decorate87, "_ts_decorate");
15092
+ function _ts_metadata68(k, v) {
14965
15093
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
14966
15094
  }
14967
- __name(_ts_metadata67, "_ts_metadata");
14968
- function _ts_param54(paramIndex, decorator) {
15095
+ __name(_ts_metadata68, "_ts_metadata");
15096
+ function _ts_param55(paramIndex, decorator) {
14969
15097
  return function(target, key) {
14970
15098
  decorator(target, key, paramIndex);
14971
15099
  };
14972
15100
  }
14973
- __name(_ts_param54, "_ts_param");
15101
+ __name(_ts_param55, "_ts_param");
14974
15102
  var QUOTA_PROVIDERS_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/QuotaProviders");
14975
15103
  var EnforceQuotaInterceptor = class {
14976
15104
  static {
@@ -15013,15 +15141,15 @@ var EnforceQuotaInterceptor = class {
15013
15141
  }
15014
15142
  }
15015
15143
  };
15016
- EnforceQuotaInterceptor = _ts_decorate86([
15017
- (0, import_common76.Injectable)(),
15018
- _ts_param54(0, (0, import_common76.Inject)(import_core8.Reflector)),
15019
- _ts_param54(1, (0, import_common76.Inject)(StaticEntitlementService)),
15020
- _ts_param54(2, (0, import_common76.Optional)()),
15021
- _ts_param54(2, (0, import_common76.Inject)(QUOTA_PROVIDERS_TOKEN)),
15022
- _ts_metadata67("design:type", Function),
15023
- _ts_metadata67("design:paramtypes", [
15024
- typeof import_core8.Reflector === "undefined" ? Object : import_core8.Reflector,
15144
+ EnforceQuotaInterceptor = _ts_decorate87([
15145
+ (0, import_common77.Injectable)(),
15146
+ _ts_param55(0, (0, import_common77.Inject)(import_core9.Reflector)),
15147
+ _ts_param55(1, (0, import_common77.Inject)(StaticEntitlementService)),
15148
+ _ts_param55(2, (0, import_common77.Optional)()),
15149
+ _ts_param55(2, (0, import_common77.Inject)(QUOTA_PROVIDERS_TOKEN)),
15150
+ _ts_metadata68("design:type", Function),
15151
+ _ts_metadata68("design:paramtypes", [
15152
+ typeof import_core9.Reflector === "undefined" ? Object : import_core9.Reflector,
15025
15153
  typeof StaticEntitlementService === "undefined" ? Object : StaticEntitlementService,
15026
15154
  Object
15027
15155
  ])
@@ -15068,18 +15196,18 @@ var SubscriptionPlanResolver = class {
15068
15196
  };
15069
15197
 
15070
15198
  // src/platform/tenant-manifest.service.ts
15071
- var import_common77 = require("@nestjs/common");
15072
- function _ts_decorate87(decorators, target, key, desc) {
15199
+ var import_common78 = require("@nestjs/common");
15200
+ function _ts_decorate88(decorators, target, key, desc) {
15073
15201
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15074
15202
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15075
15203
  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;
15076
15204
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15077
15205
  }
15078
- __name(_ts_decorate87, "_ts_decorate");
15079
- function _ts_metadata68(k, v) {
15206
+ __name(_ts_decorate88, "_ts_decorate");
15207
+ function _ts_metadata69(k, v) {
15080
15208
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15081
15209
  }
15082
- __name(_ts_metadata68, "_ts_metadata");
15210
+ __name(_ts_metadata69, "_ts_metadata");
15083
15211
  var TenantManifestService = class {
15084
15212
  static {
15085
15213
  __name(this, "TenantManifestService");
@@ -15125,10 +15253,10 @@ var TenantManifestService = class {
15125
15253
  };
15126
15254
  }
15127
15255
  };
15128
- TenantManifestService = _ts_decorate87([
15129
- (0, import_common77.Injectable)(),
15130
- _ts_metadata68("design:type", Function),
15131
- _ts_metadata68("design:paramtypes", [
15256
+ TenantManifestService = _ts_decorate88([
15257
+ (0, import_common78.Injectable)(),
15258
+ _ts_metadata69("design:type", Function),
15259
+ _ts_metadata69("design:paramtypes", [
15132
15260
  typeof StaticEntitlementService === "undefined" ? Object : StaticEntitlementService
15133
15261
  ])
15134
15262
  ], TenantManifestService);
@@ -15142,24 +15270,24 @@ function isVisible(item, features) {
15142
15270
  __name(isVisible, "isVisible");
15143
15271
 
15144
15272
  // src/platform/tenant-manifest.controller.ts
15145
- var import_common78 = require("@nestjs/common");
15146
- function _ts_decorate88(decorators, target, key, desc) {
15273
+ var import_common79 = require("@nestjs/common");
15274
+ function _ts_decorate89(decorators, target, key, desc) {
15147
15275
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15148
15276
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15149
15277
  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;
15150
15278
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15151
15279
  }
15152
- __name(_ts_decorate88, "_ts_decorate");
15153
- function _ts_metadata69(k, v) {
15280
+ __name(_ts_decorate89, "_ts_decorate");
15281
+ function _ts_metadata70(k, v) {
15154
15282
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15155
15283
  }
15156
- __name(_ts_metadata69, "_ts_metadata");
15157
- function _ts_param55(paramIndex, decorator) {
15284
+ __name(_ts_metadata70, "_ts_metadata");
15285
+ function _ts_param56(paramIndex, decorator) {
15158
15286
  return function(target, key) {
15159
15287
  decorator(target, key, paramIndex);
15160
15288
  };
15161
15289
  }
15162
- __name(_ts_param55, "_ts_param");
15290
+ __name(_ts_param56, "_ts_param");
15163
15291
  function buildTenantManifestController(options) {
15164
15292
  const path = options.path ?? "tenant/manifest";
15165
15293
  let GeneratedTenantManifestController = class GeneratedTenantManifestController {
@@ -15178,21 +15306,21 @@ function buildTenantManifestController(options) {
15178
15306
  return this.svc.getManifest(tenantId);
15179
15307
  }
15180
15308
  };
15181
- _ts_decorate88([
15182
- (0, import_common78.Get)(),
15183
- _ts_param55(0, (0, import_common78.Req)()),
15184
- _ts_metadata69("design:type", Function),
15185
- _ts_metadata69("design:paramtypes", [
15309
+ _ts_decorate89([
15310
+ (0, import_common79.Get)(),
15311
+ _ts_param56(0, (0, import_common79.Req)()),
15312
+ _ts_metadata70("design:type", Function),
15313
+ _ts_metadata70("design:paramtypes", [
15186
15314
  typeof RequestWithUser === "undefined" ? Object : RequestWithUser
15187
15315
  ]),
15188
- _ts_metadata69("design:returntype", Promise)
15316
+ _ts_metadata70("design:returntype", Promise)
15189
15317
  ], GeneratedTenantManifestController.prototype, "get", null);
15190
- GeneratedTenantManifestController = _ts_decorate88([
15191
- (0, import_common78.Controller)(path),
15192
- (0, import_common78.UseGuards)(...options.guards),
15193
- _ts_param55(0, (0, import_common78.Inject)(TenantManifestService)),
15194
- _ts_metadata69("design:type", Function),
15195
- _ts_metadata69("design:paramtypes", [
15318
+ GeneratedTenantManifestController = _ts_decorate89([
15319
+ (0, import_common79.Controller)(path),
15320
+ (0, import_common79.UseGuards)(...options.guards),
15321
+ _ts_param56(0, (0, import_common79.Inject)(TenantManifestService)),
15322
+ _ts_metadata70("design:type", Function),
15323
+ _ts_metadata70("design:paramtypes", [
15196
15324
  typeof TenantManifestService === "undefined" ? Object : TenantManifestService
15197
15325
  ])
15198
15326
  ], GeneratedTenantManifestController);
@@ -15201,14 +15329,14 @@ function buildTenantManifestController(options) {
15201
15329
  __name(buildTenantManifestController, "buildTenantManifestController");
15202
15330
 
15203
15331
  // src/platform/saas-platform.module.ts
15204
- function _ts_decorate89(decorators, target, key, desc) {
15332
+ function _ts_decorate90(decorators, target, key, desc) {
15205
15333
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15206
15334
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15207
15335
  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;
15208
15336
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15209
15337
  }
15210
- __name(_ts_decorate89, "_ts_decorate");
15211
- var PLATFORM_LOGGER = new import_common79.Logger("SaaSiCat");
15338
+ __name(_ts_decorate90, "_ts_decorate");
15339
+ var PLATFORM_LOGGER = new import_common80.Logger("SaaSiCat");
15212
15340
  var PLATFORM_SUBSCRIPTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/PlatformSubscriptionRepository");
15213
15341
  var STANDARD_MANIFEST_REGISTRATION_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/StandardManifestRegistration");
15214
15342
  function buildStandardManifestContribution(catalog, adminResources, promoCodes) {
@@ -15665,16 +15793,17 @@ var SaasPlatformModule = class _SaasPlatformModule {
15665
15793
  inject: options.quotaProviders ?? []
15666
15794
  }, ...options.globalFeatureGuard === false ? [] : [
15667
15795
  {
15668
- provide: import_core9.APP_GUARD,
15796
+ provide: import_core10.APP_GUARD,
15669
15797
  useExisting: StaticFeatureGuard
15670
15798
  }
15671
15799
  ], {
15672
- provide: import_core9.APP_INTERCEPTOR,
15800
+ provide: import_core10.APP_INTERCEPTOR,
15673
15801
  useExisting: EnforceQuotaInterceptor
15674
15802
  });
15675
15803
  lightweightExports.push(PLAN_RESOLVER_PORT_TOKEN, StaticEntitlementService, StaticFeatureGuard, EnforceQuotaInterceptor, QUOTA_PROVIDERS_TOKEN);
15676
15804
  if (options.globalFeatureGuard === false) {
15677
- 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.");
15805
+ lightweightProviders.push(FeatureGuardCoverageCheck);
15806
+ imports.push(import_core11.DiscoveryModule);
15678
15807
  }
15679
15808
  } else {
15680
15809
  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.");
@@ -15739,8 +15868,8 @@ var SaasPlatformModule = class _SaasPlatformModule {
15739
15868
  };
15740
15869
  }
15741
15870
  };
15742
- SaasPlatformModule = _ts_decorate89([
15743
- (0, import_common79.Module)({})
15871
+ SaasPlatformModule = _ts_decorate90([
15872
+ (0, import_common80.Module)({})
15744
15873
  ], SaasPlatformModule);
15745
15874
 
15746
15875
  // src/platform/define-saasicat.ts
@@ -15871,7 +16000,7 @@ var REGISTRATION_PROMO_PREVIEW_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform
15871
16000
  var REGISTRATION_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/RegistrationConfig");
15872
16001
 
15873
16002
  // src/registration/pending-registration.service.ts
15874
- var import_common80 = require("@nestjs/common");
16003
+ var import_common81 = require("@nestjs/common");
15875
16004
  var import_types32 = require("@saasicat/types");
15876
16005
  var import_types33 = require("@saasicat/types");
15877
16006
 
@@ -15927,23 +16056,23 @@ function resolveModel(catalog, modelId) {
15927
16056
  __name(resolveModel, "resolveModel");
15928
16057
 
15929
16058
  // src/registration/pending-registration.service.ts
15930
- function _ts_decorate90(decorators, target, key, desc) {
16059
+ function _ts_decorate91(decorators, target, key, desc) {
15931
16060
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15932
16061
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15933
16062
  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;
15934
16063
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15935
16064
  }
15936
- __name(_ts_decorate90, "_ts_decorate");
15937
- function _ts_metadata70(k, v) {
16065
+ __name(_ts_decorate91, "_ts_decorate");
16066
+ function _ts_metadata71(k, v) {
15938
16067
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15939
16068
  }
15940
- __name(_ts_metadata70, "_ts_metadata");
15941
- function _ts_param56(paramIndex, decorator) {
16069
+ __name(_ts_metadata71, "_ts_metadata");
16070
+ function _ts_param57(paramIndex, decorator) {
15942
16071
  return function(target, key) {
15943
16072
  decorator(target, key, paramIndex);
15944
16073
  };
15945
16074
  }
15946
- __name(_ts_param56, "_ts_param");
16075
+ __name(_ts_param57, "_ts_param");
15947
16076
  var PendingRegistrationService = class _PendingRegistrationService {
15948
16077
  static {
15949
16078
  __name(this, "PendingRegistrationService");
@@ -15963,7 +16092,7 @@ var PendingRegistrationService = class _PendingRegistrationService {
15963
16092
  resumeBaseUrl;
15964
16093
  configuratorLookup;
15965
16094
  promoPreview;
15966
- logger = new import_common80.Logger(_PendingRegistrationService.name);
16095
+ logger = new import_common81.Logger(_PendingRegistrationService.name);
15967
16096
  constructor(repo, otpDelivery, userLookup, slugCheck, passwordHasher, planCatalog, paymentProvider, paymentEventLog, activationOrchestrator, audit, resumeTokenSigner, resumeDelivery, resumeBaseUrl, configuratorLookup, promoPreview) {
15968
16097
  this.repo = repo;
15969
16098
  this.otpDelivery = otpDelivery;
@@ -16001,17 +16130,17 @@ var PendingRegistrationService = class _PendingRegistrationService {
16001
16130
  async selectPlan(input, context) {
16002
16131
  const pending = await this.repo.findById(input.pendingRegistrationId);
16003
16132
  if (!pending) {
16004
- throw new import_common80.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16133
+ throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16005
16134
  }
16006
16135
  if (pending.expiresAt.getTime() < Date.now()) {
16007
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16136
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16008
16137
  }
16009
16138
  if (pending.status !== "EMAIL_VERIFIED" && pending.status !== "PLAN_SELECTED" && pending.status !== "CHECKOUT_STARTED") {
16010
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.INVALID_REGISTRATION_STATE));
16139
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.INVALID_REGISTRATION_STATE));
16011
16140
  }
16012
16141
  const plan = await this.planCatalog.findPublicSignupPlan(input.planId);
16013
16142
  if (!plan) {
16014
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_AVAILABLE));
16143
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_AVAILABLE));
16015
16144
  }
16016
16145
  const now = /* @__PURE__ */ new Date();
16017
16146
  const expiresAt = new Date(now.getTime() + import_types33.PENDING_ONBOARDING_TTL_DAYS * 24 * 60 * 60 * 1e3);
@@ -16034,20 +16163,20 @@ var PendingRegistrationService = class _PendingRegistrationService {
16034
16163
  async startCheckout(input, context) {
16035
16164
  const pending = await this.repo.findById(input.pendingRegistrationId);
16036
16165
  if (!pending) {
16037
- throw new import_common80.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16166
+ throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16038
16167
  }
16039
16168
  if (pending.expiresAt.getTime() < Date.now()) {
16040
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16169
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16041
16170
  }
16042
16171
  if (pending.status !== "PLAN_SELECTED" && pending.status !== "CHECKOUT_STARTED") {
16043
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_SELECTED));
16172
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_SELECTED));
16044
16173
  }
16045
16174
  if (!pending.selectedPlanId) {
16046
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_SELECTED));
16175
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_SELECTED));
16047
16176
  }
16048
16177
  const plan = await this.planCatalog.findPublicSignupPlan(pending.selectedPlanId);
16049
16178
  if (!plan) {
16050
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_AVAILABLE));
16179
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_AVAILABLE));
16051
16180
  }
16052
16181
  const session = await this.paymentProvider.createCheckoutSession({
16053
16182
  pendingRegistrationId: pending.id,
@@ -16256,7 +16385,7 @@ var PendingRegistrationService = class _PendingRegistrationService {
16256
16385
  await this.record("OTP_VERIFY_FAILED", null, context, {
16257
16386
  reason: "unknown_email"
16258
16387
  });
16259
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
16388
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
16260
16389
  }
16261
16390
  if (pending.status !== "PENDING_EMAIL_VERIFICATION") {
16262
16391
  return {
@@ -16269,33 +16398,33 @@ var PendingRegistrationService = class _PendingRegistrationService {
16269
16398
  await this.record("OTP_VERIFY_FAILED", pending.id, context, {
16270
16399
  reason: "no_otp_set"
16271
16400
  });
16272
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
16401
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
16273
16402
  }
16274
16403
  if (pending.otpExpiresAt.getTime() < Date.now()) {
16275
16404
  await this.record("OTP_VERIFY_FAILED", pending.id, context, {
16276
16405
  reason: "expired"
16277
16406
  });
16278
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_EXPIRED));
16407
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_EXPIRED));
16279
16408
  }
16280
16409
  const maxAttempts = resolveOtpVerifyMaxAttempts();
16281
16410
  if (pending.otpAttemptCount >= maxAttempts) {
16282
16411
  await this.record("OTP_VERIFY_FAILED", pending.id, context, {
16283
16412
  reason: "locked"
16284
16413
  });
16285
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_LOCKED));
16414
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_LOCKED));
16286
16415
  }
16287
16416
  const attemptCount = await this.repo.incrementOtpAttemptCount(pending.id);
16288
16417
  if (attemptCount > maxAttempts) {
16289
16418
  await this.record("OTP_VERIFY_FAILED", pending.id, context, {
16290
16419
  reason: "locked"
16291
16420
  });
16292
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_LOCKED));
16421
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_LOCKED));
16293
16422
  }
16294
16423
  if (!verifyOtpCode(pending.otpHash, code)) {
16295
16424
  await this.record("OTP_VERIFY_FAILED", pending.id, context, {
16296
16425
  reason: "wrong_code"
16297
16426
  });
16298
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
16427
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
16299
16428
  }
16300
16429
  const now = /* @__PURE__ */ new Date();
16301
16430
  const updated = await this.repo.update(pending.id, {
@@ -16406,20 +16535,20 @@ var PendingRegistrationService = class _PendingRegistrationService {
16406
16535
  */
16407
16536
  async resumeWithToken(input, context) {
16408
16537
  if (!this.resumeTokenSigner) {
16409
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_NOT_CONFIGURED));
16538
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_NOT_CONFIGURED));
16410
16539
  }
16411
16540
  let decoded;
16412
16541
  try {
16413
16542
  decoded = await this.resumeTokenSigner.verify(input.token);
16414
16543
  } catch {
16415
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_TOKEN_INVALID));
16544
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_TOKEN_INVALID));
16416
16545
  }
16417
16546
  const pending = await this.repo.findById(decoded.pendingRegistrationId);
16418
16547
  if (!pending) {
16419
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_TOKEN_INVALID));
16548
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_TOKEN_INVALID));
16420
16549
  }
16421
16550
  if (pending.expiresAt.getTime() < Date.now()) {
16422
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16551
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16423
16552
  }
16424
16553
  await this.record("REGISTRATION_NEUTRAL_REPLAY", pending.id, context, {
16425
16554
  via: "resume_token",
@@ -16447,7 +16576,7 @@ var PendingRegistrationService = class _PendingRegistrationService {
16447
16576
  /** Returns the (app-specific) configurator catalog. */
16448
16577
  async getConfiguratorCatalog() {
16449
16578
  if (!this.configuratorLookup) {
16450
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
16579
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
16451
16580
  }
16452
16581
  return this.configuratorLookup.getCatalog();
16453
16582
  }
@@ -16464,22 +16593,22 @@ var PendingRegistrationService = class _PendingRegistrationService {
16464
16593
  */
16465
16594
  async saveConfiguration(input, context) {
16466
16595
  if (!this.configuratorLookup) {
16467
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
16596
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
16468
16597
  }
16469
16598
  const pending = await this.repo.findById(input.pendingRegistrationId);
16470
16599
  if (!pending) {
16471
- throw new import_common80.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16600
+ throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16472
16601
  }
16473
16602
  if (pending.expiresAt.getTime() < Date.now()) {
16474
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16603
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
16475
16604
  }
16476
16605
  if (pending.status !== "EMAIL_VERIFIED" && pending.status !== "PLAN_SELECTED" && pending.status !== "CHECKOUT_STARTED") {
16477
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.INVALID_REGISTRATION_STATE));
16606
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.INVALID_REGISTRATION_STATE));
16478
16607
  }
16479
16608
  const catalog = await this.configuratorLookup.getCatalog();
16480
16609
  const model = catalog.models.find((m) => m.id === input.selection.modelId);
16481
16610
  if (!model) {
16482
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.MODEL_NOT_AVAILABLE));
16611
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.MODEL_NOT_AVAILABLE));
16483
16612
  }
16484
16613
  let promoEval;
16485
16614
  if (input.selection.appliedPromoCode && this.promoPreview) {
@@ -16543,20 +16672,20 @@ var PendingRegistrationService = class _PendingRegistrationService {
16543
16672
  */
16544
16673
  async previewConfigPromo(pendingRegistrationId, code) {
16545
16674
  if (!this.configuratorLookup) {
16546
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
16675
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
16547
16676
  }
16548
16677
  const pending = await this.repo.findById(pendingRegistrationId);
16549
16678
  if (!pending) {
16550
- throw new import_common80.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16679
+ throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
16551
16680
  }
16552
16681
  const config = pending.configJson;
16553
16682
  if (!config) {
16554
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIG_NOT_SAVED));
16683
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIG_NOT_SAVED));
16555
16684
  }
16556
16685
  const catalog = await this.configuratorLookup.getCatalog();
16557
16686
  const model = catalog.models.find((m) => m.id === config.modelId);
16558
16687
  if (!model) {
16559
- throw new import_common80.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.MODEL_NOT_AVAILABLE));
16688
+ throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.MODEL_NOT_AVAILABLE));
16560
16689
  }
16561
16690
  let promoEval;
16562
16691
  if (code && this.promoPreview) {
@@ -16617,30 +16746,30 @@ var PendingRegistrationService = class _PendingRegistrationService {
16617
16746
  throw new Error(`Could not find a free slug for "${tenantName}".`);
16618
16747
  }
16619
16748
  };
16620
- PendingRegistrationService = _ts_decorate90([
16621
- (0, import_common80.Injectable)(),
16622
- _ts_param56(0, (0, import_common80.Inject)(PENDING_REGISTRATION_REPOSITORY_TOKEN)),
16623
- _ts_param56(1, (0, import_common80.Inject)(REGISTRATION_OTP_DELIVERY_TOKEN)),
16624
- _ts_param56(2, (0, import_common80.Inject)(USER_ACCOUNT_LOOKUP_TOKEN)),
16625
- _ts_param56(3, (0, import_common80.Inject)(SLUG_AVAILABILITY_CHECK_TOKEN)),
16626
- _ts_param56(4, (0, import_common80.Inject)(PASSWORD_HASHER_TOKEN)),
16627
- _ts_param56(5, (0, import_common80.Inject)(PLAN_CATALOG_LOOKUP_TOKEN)),
16628
- _ts_param56(6, (0, import_common80.Inject)(PAYMENT_PROVIDER_TOKEN)),
16629
- _ts_param56(7, (0, import_common80.Inject)(PAYMENT_EVENT_LOG_TOKEN)),
16630
- _ts_param56(8, (0, import_common80.Inject)(ACTIVATION_ORCHESTRATOR_TOKEN)),
16631
- _ts_param56(9, (0, import_common80.Inject)(REGISTRATION_AUDIT_LOGGER_TOKEN)),
16632
- _ts_param56(10, (0, import_common80.Optional)()),
16633
- _ts_param56(10, (0, import_common80.Inject)(REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN)),
16634
- _ts_param56(11, (0, import_common80.Optional)()),
16635
- _ts_param56(11, (0, import_common80.Inject)(REGISTRATION_RESUME_DELIVERY_TOKEN)),
16636
- _ts_param56(12, (0, import_common80.Optional)()),
16637
- _ts_param56(12, (0, import_common80.Inject)(REGISTRATION_RESUME_BASE_URL_TOKEN)),
16638
- _ts_param56(13, (0, import_common80.Optional)()),
16639
- _ts_param56(13, (0, import_common80.Inject)(REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN)),
16640
- _ts_param56(14, (0, import_common80.Optional)()),
16641
- _ts_param56(14, (0, import_common80.Inject)(REGISTRATION_PROMO_PREVIEW_TOKEN)),
16642
- _ts_metadata70("design:type", Function),
16643
- _ts_metadata70("design:paramtypes", [
16749
+ PendingRegistrationService = _ts_decorate91([
16750
+ (0, import_common81.Injectable)(),
16751
+ _ts_param57(0, (0, import_common81.Inject)(PENDING_REGISTRATION_REPOSITORY_TOKEN)),
16752
+ _ts_param57(1, (0, import_common81.Inject)(REGISTRATION_OTP_DELIVERY_TOKEN)),
16753
+ _ts_param57(2, (0, import_common81.Inject)(USER_ACCOUNT_LOOKUP_TOKEN)),
16754
+ _ts_param57(3, (0, import_common81.Inject)(SLUG_AVAILABILITY_CHECK_TOKEN)),
16755
+ _ts_param57(4, (0, import_common81.Inject)(PASSWORD_HASHER_TOKEN)),
16756
+ _ts_param57(5, (0, import_common81.Inject)(PLAN_CATALOG_LOOKUP_TOKEN)),
16757
+ _ts_param57(6, (0, import_common81.Inject)(PAYMENT_PROVIDER_TOKEN)),
16758
+ _ts_param57(7, (0, import_common81.Inject)(PAYMENT_EVENT_LOG_TOKEN)),
16759
+ _ts_param57(8, (0, import_common81.Inject)(ACTIVATION_ORCHESTRATOR_TOKEN)),
16760
+ _ts_param57(9, (0, import_common81.Inject)(REGISTRATION_AUDIT_LOGGER_TOKEN)),
16761
+ _ts_param57(10, (0, import_common81.Optional)()),
16762
+ _ts_param57(10, (0, import_common81.Inject)(REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN)),
16763
+ _ts_param57(11, (0, import_common81.Optional)()),
16764
+ _ts_param57(11, (0, import_common81.Inject)(REGISTRATION_RESUME_DELIVERY_TOKEN)),
16765
+ _ts_param57(12, (0, import_common81.Optional)()),
16766
+ _ts_param57(12, (0, import_common81.Inject)(REGISTRATION_RESUME_BASE_URL_TOKEN)),
16767
+ _ts_param57(13, (0, import_common81.Optional)()),
16768
+ _ts_param57(13, (0, import_common81.Inject)(REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN)),
16769
+ _ts_param57(14, (0, import_common81.Optional)()),
16770
+ _ts_param57(14, (0, import_common81.Inject)(REGISTRATION_PROMO_PREVIEW_TOKEN)),
16771
+ _ts_metadata71("design:type", Function),
16772
+ _ts_metadata71("design:paramtypes", [
16644
16773
  typeof PendingRegistrationRepository === "undefined" ? Object : PendingRegistrationRepository,
16645
16774
  typeof RegistrationOtpDelivery === "undefined" ? Object : RegistrationOtpDelivery,
16646
16775
  typeof UserAccountLookup === "undefined" ? Object : UserAccountLookup,
@@ -16696,25 +16825,25 @@ function nullable(value) {
16696
16825
  __name(nullable, "nullable");
16697
16826
 
16698
16827
  // src/registration/cleanup.cron.ts
16699
- var import_common81 = require("@nestjs/common");
16828
+ var import_common82 = require("@nestjs/common");
16700
16829
  var import_schedule2 = require("@nestjs/schedule");
16701
- function _ts_decorate91(decorators, target, key, desc) {
16830
+ function _ts_decorate92(decorators, target, key, desc) {
16702
16831
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16703
16832
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16704
16833
  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;
16705
16834
  return c > 3 && r && Object.defineProperty(target, key, r), r;
16706
16835
  }
16707
- __name(_ts_decorate91, "_ts_decorate");
16708
- function _ts_metadata71(k, v) {
16836
+ __name(_ts_decorate92, "_ts_decorate");
16837
+ function _ts_metadata72(k, v) {
16709
16838
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16710
16839
  }
16711
- __name(_ts_metadata71, "_ts_metadata");
16840
+ __name(_ts_metadata72, "_ts_metadata");
16712
16841
  var RegistrationCleanupCron = class _RegistrationCleanupCron {
16713
16842
  static {
16714
16843
  __name(this, "RegistrationCleanupCron");
16715
16844
  }
16716
16845
  service;
16717
- logger = new import_common81.Logger(_RegistrationCleanupCron.name);
16846
+ logger = new import_common82.Logger(_RegistrationCleanupCron.name);
16718
16847
  constructor(service) {
16719
16848
  this.service = service;
16720
16849
  }
@@ -16743,36 +16872,36 @@ var RegistrationCleanupCron = class _RegistrationCleanupCron {
16743
16872
  }
16744
16873
  }
16745
16874
  };
16746
- _ts_decorate91([
16875
+ _ts_decorate92([
16747
16876
  (0, import_schedule2.Cron)("15 4 * * *", {
16748
16877
  timeZone: "Europe/Berlin"
16749
16878
  }),
16750
- _ts_metadata71("design:type", Function),
16751
- _ts_metadata71("design:paramtypes", []),
16752
- _ts_metadata71("design:returntype", Promise)
16879
+ _ts_metadata72("design:type", Function),
16880
+ _ts_metadata72("design:paramtypes", []),
16881
+ _ts_metadata72("design:returntype", Promise)
16753
16882
  ], RegistrationCleanupCron.prototype, "runDaily", null);
16754
- RegistrationCleanupCron = _ts_decorate91([
16755
- (0, import_common81.Injectable)(),
16756
- _ts_metadata71("design:type", Function),
16757
- _ts_metadata71("design:paramtypes", [
16883
+ RegistrationCleanupCron = _ts_decorate92([
16884
+ (0, import_common82.Injectable)(),
16885
+ _ts_metadata72("design:type", Function),
16886
+ _ts_metadata72("design:paramtypes", [
16758
16887
  typeof PendingRegistrationService === "undefined" ? Object : PendingRegistrationService
16759
16888
  ])
16760
16889
  ], RegistrationCleanupCron);
16761
16890
 
16762
16891
  // src/registration/ip-rate-limit.guard.ts
16763
- var import_common82 = require("@nestjs/common");
16892
+ var import_common83 = require("@nestjs/common");
16764
16893
  var import_types34 = require("@saasicat/types");
16765
- function _ts_decorate92(decorators, target, key, desc) {
16894
+ function _ts_decorate93(decorators, target, key, desc) {
16766
16895
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16767
16896
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16768
16897
  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;
16769
16898
  return c > 3 && r && Object.defineProperty(target, key, r), r;
16770
16899
  }
16771
- __name(_ts_decorate92, "_ts_decorate");
16772
- function _ts_metadata72(k, v) {
16900
+ __name(_ts_decorate93, "_ts_decorate");
16901
+ function _ts_metadata73(k, v) {
16773
16902
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16774
16903
  }
16775
- __name(_ts_metadata72, "_ts_metadata");
16904
+ __name(_ts_metadata73, "_ts_metadata");
16776
16905
  var BaseIpRateLimitGuard = class {
16777
16906
  static {
16778
16907
  __name(this, "BaseIpRateLimitGuard");
@@ -16789,7 +16918,7 @@ var BaseIpRateLimitGuard = class {
16789
16918
  const req = context.switchToHttp().getRequest();
16790
16919
  const key = ipFingerprint2(req);
16791
16920
  if (this.exceeded(key)) {
16792
- throw new import_common82.HttpException({
16921
+ throw new import_common83.HttpException({
16793
16922
  ...codedError(import_types34.REGISTRATION_ERROR_CODES.RATE_LIMITED, {
16794
16923
  retryAfterSeconds: Math.ceil(this.options.windowMs / 1e3)
16795
16924
  }),
@@ -16798,7 +16927,7 @@ var BaseIpRateLimitGuard = class {
16798
16927
  // not the code — the two emitters of RATE_LIMITED disagree
16799
16928
  // on what `reason` means, which is why it is going away.
16800
16929
  reason: this.options.name
16801
- }, import_common82.HttpStatus.TOO_MANY_REQUESTS);
16930
+ }, import_common83.HttpStatus.TOO_MANY_REQUESTS);
16802
16931
  }
16803
16932
  return true;
16804
16933
  }
@@ -16816,10 +16945,10 @@ var BaseIpRateLimitGuard = class {
16816
16945
  return bucket.count > this.options.limit;
16817
16946
  }
16818
16947
  };
16819
- BaseIpRateLimitGuard = _ts_decorate92([
16820
- (0, import_common82.Injectable)(),
16821
- _ts_metadata72("design:type", Function),
16822
- _ts_metadata72("design:paramtypes", [
16948
+ BaseIpRateLimitGuard = _ts_decorate93([
16949
+ (0, import_common83.Injectable)(),
16950
+ _ts_metadata73("design:type", Function),
16951
+ _ts_metadata73("design:paramtypes", [
16823
16952
  Object
16824
16953
  ])
16825
16954
  ], BaseIpRateLimitGuard);
@@ -16831,14 +16960,14 @@ function ipFingerprint2(req) {
16831
16960
  __name(ipFingerprint2, "ipFingerprint");
16832
16961
 
16833
16962
  // src/registration/module.ts
16834
- var import_common83 = require("@nestjs/common");
16835
- function _ts_decorate93(decorators, target, key, desc) {
16963
+ var import_common84 = require("@nestjs/common");
16964
+ function _ts_decorate94(decorators, target, key, desc) {
16836
16965
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16837
16966
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16838
16967
  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;
16839
16968
  return c > 3 && r && Object.defineProperty(target, key, r), r;
16840
16969
  }
16841
- __name(_ts_decorate93, "_ts_decorate");
16970
+ __name(_ts_decorate94, "_ts_decorate");
16842
16971
  var RegistrationModule = class _RegistrationModule {
16843
16972
  static {
16844
16973
  __name(this, "RegistrationModule");
@@ -16894,23 +17023,23 @@ var RegistrationModule = class _RegistrationModule {
16894
17023
  };
16895
17024
  }
16896
17025
  };
16897
- RegistrationModule = _ts_decorate93([
16898
- (0, import_common83.Module)({})
17026
+ RegistrationModule = _ts_decorate94([
17027
+ (0, import_common84.Module)({})
16899
17028
  ], RegistrationModule);
16900
17029
 
16901
17030
  // src/registration/dto/register-start.dto.ts
16902
17031
  var import_class_validator17 = require("class-validator");
16903
- function _ts_decorate94(decorators, target, key, desc) {
17032
+ function _ts_decorate95(decorators, target, key, desc) {
16904
17033
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16905
17034
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16906
17035
  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;
16907
17036
  return c > 3 && r && Object.defineProperty(target, key, r), r;
16908
17037
  }
16909
- __name(_ts_decorate94, "_ts_decorate");
16910
- function _ts_metadata73(k, v) {
17038
+ __name(_ts_decorate95, "_ts_decorate");
17039
+ function _ts_metadata74(k, v) {
16911
17040
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16912
17041
  }
16913
- __name(_ts_metadata73, "_ts_metadata");
17042
+ __name(_ts_metadata74, "_ts_metadata");
16914
17043
  var RegisterStartDto = class {
16915
17044
  static {
16916
17045
  __name(this, "RegisterStartDto");
@@ -16929,78 +17058,78 @@ var RegisterStartDto = class {
16929
17058
  termsAccepted;
16930
17059
  locale;
16931
17060
  };
16932
- _ts_decorate94([
17061
+ _ts_decorate95([
16933
17062
  (0, import_class_validator17.IsString)(),
16934
17063
  (0, import_class_validator17.MinLength)(2),
16935
17064
  (0, import_class_validator17.MaxLength)(120),
16936
- _ts_metadata73("design:type", String)
17065
+ _ts_metadata74("design:type", String)
16937
17066
  ], RegisterStartDto.prototype, "tenantName", void 0);
16938
- _ts_decorate94([
17067
+ _ts_decorate95([
16939
17068
  (0, import_class_validator17.IsOptional)(),
16940
17069
  (0, import_class_validator17.IsString)(),
16941
17070
  (0, import_class_validator17.Matches)(/^[a-z0-9-]+$/, {
16942
17071
  message: "tenantSlug may only contain lower-case letters, digits and hyphens."
16943
17072
  }),
16944
17073
  (0, import_class_validator17.MaxLength)(60),
16945
- _ts_metadata73("design:type", String)
17074
+ _ts_metadata74("design:type", String)
16946
17075
  ], RegisterStartDto.prototype, "tenantSlug", void 0);
16947
- _ts_decorate94([
17076
+ _ts_decorate95([
16948
17077
  (0, import_class_validator17.IsOptional)(),
16949
17078
  (0, import_class_validator17.IsString)(),
16950
17079
  (0, import_class_validator17.MaxLength)(40),
16951
- _ts_metadata73("design:type", String)
17080
+ _ts_metadata74("design:type", String)
16952
17081
  ], RegisterStartDto.prototype, "salutation", void 0);
16953
- _ts_decorate94([
17082
+ _ts_decorate95([
16954
17083
  (0, import_class_validator17.IsString)(),
16955
17084
  (0, import_class_validator17.MinLength)(1),
16956
17085
  (0, import_class_validator17.MaxLength)(60),
16957
- _ts_metadata73("design:type", String)
17086
+ _ts_metadata74("design:type", String)
16958
17087
  ], RegisterStartDto.prototype, "firstName", void 0);
16959
- _ts_decorate94([
17088
+ _ts_decorate95([
16960
17089
  (0, import_class_validator17.IsString)(),
16961
17090
  (0, import_class_validator17.MinLength)(1),
16962
17091
  (0, import_class_validator17.MaxLength)(60),
16963
- _ts_metadata73("design:type", String)
17092
+ _ts_metadata74("design:type", String)
16964
17093
  ], RegisterStartDto.prototype, "lastName", void 0);
16965
- _ts_decorate94([
17094
+ _ts_decorate95([
16966
17095
  (0, import_class_validator17.IsEmail)(),
16967
17096
  (0, import_class_validator17.MaxLength)(160),
16968
- _ts_metadata73("design:type", String)
17097
+ _ts_metadata74("design:type", String)
16969
17098
  ], RegisterStartDto.prototype, "email", void 0);
16970
- _ts_decorate94([
17099
+ _ts_decorate95([
16971
17100
  (0, import_class_validator17.IsString)(),
16972
17101
  (0, import_class_validator17.MinLength)(8),
16973
17102
  (0, import_class_validator17.MaxLength)(160),
16974
- _ts_metadata73("design:type", String)
17103
+ _ts_metadata74("design:type", String)
16975
17104
  ], RegisterStartDto.prototype, "password", void 0);
16976
- _ts_decorate94([
17105
+ _ts_decorate95([
16977
17106
  (0, import_class_validator17.Equals)(true, {
16978
17107
  message: "The terms of service, privacy policy and data processing agreement must be accepted."
16979
17108
  }),
16980
- _ts_metadata73("design:type", Boolean)
17109
+ _ts_metadata74("design:type", Boolean)
16981
17110
  ], RegisterStartDto.prototype, "termsAccepted", void 0);
16982
- _ts_decorate94([
17111
+ _ts_decorate95([
16983
17112
  (0, import_class_validator17.IsOptional)(),
16984
17113
  (0, import_class_validator17.IsIn)([
16985
17114
  "de",
16986
17115
  "tr"
16987
17116
  ]),
16988
- _ts_metadata73("design:type", String)
17117
+ _ts_metadata74("design:type", String)
16989
17118
  ], RegisterStartDto.prototype, "locale", void 0);
16990
17119
 
16991
17120
  // src/registration/dto/verify-registration-otp.dto.ts
16992
17121
  var import_class_validator18 = require("class-validator");
16993
- function _ts_decorate95(decorators, target, key, desc) {
17122
+ function _ts_decorate96(decorators, target, key, desc) {
16994
17123
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16995
17124
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16996
17125
  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;
16997
17126
  return c > 3 && r && Object.defineProperty(target, key, r), r;
16998
17127
  }
16999
- __name(_ts_decorate95, "_ts_decorate");
17000
- function _ts_metadata74(k, v) {
17128
+ __name(_ts_decorate96, "_ts_decorate");
17129
+ function _ts_metadata75(k, v) {
17001
17130
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17002
17131
  }
17003
- __name(_ts_metadata74, "_ts_metadata");
17132
+ __name(_ts_metadata75, "_ts_metadata");
17004
17133
  var VerifyRegistrationOtpDto = class {
17005
17134
  static {
17006
17135
  __name(this, "VerifyRegistrationOtpDto");
@@ -17008,55 +17137,55 @@ var VerifyRegistrationOtpDto = class {
17008
17137
  email;
17009
17138
  otp;
17010
17139
  };
17011
- _ts_decorate95([
17140
+ _ts_decorate96([
17012
17141
  (0, import_class_validator18.IsEmail)(),
17013
- _ts_metadata74("design:type", String)
17142
+ _ts_metadata75("design:type", String)
17014
17143
  ], VerifyRegistrationOtpDto.prototype, "email", void 0);
17015
- _ts_decorate95([
17144
+ _ts_decorate96([
17016
17145
  (0, import_class_validator18.IsString)(),
17017
17146
  (0, import_class_validator18.Matches)(/^\d{6}$/, {
17018
17147
  message: "The OTP must be 6 digits."
17019
17148
  }),
17020
- _ts_metadata74("design:type", String)
17149
+ _ts_metadata75("design:type", String)
17021
17150
  ], VerifyRegistrationOtpDto.prototype, "otp", void 0);
17022
17151
 
17023
17152
  // src/registration/dto/resend-registration-otp.dto.ts
17024
17153
  var import_class_validator19 = require("class-validator");
17025
- function _ts_decorate96(decorators, target, key, desc) {
17154
+ function _ts_decorate97(decorators, target, key, desc) {
17026
17155
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17027
17156
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17028
17157
  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;
17029
17158
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17030
17159
  }
17031
- __name(_ts_decorate96, "_ts_decorate");
17032
- function _ts_metadata75(k, v) {
17160
+ __name(_ts_decorate97, "_ts_decorate");
17161
+ function _ts_metadata76(k, v) {
17033
17162
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17034
17163
  }
17035
- __name(_ts_metadata75, "_ts_metadata");
17164
+ __name(_ts_metadata76, "_ts_metadata");
17036
17165
  var ResendRegistrationOtpDto = class {
17037
17166
  static {
17038
17167
  __name(this, "ResendRegistrationOtpDto");
17039
17168
  }
17040
17169
  email;
17041
17170
  };
17042
- _ts_decorate96([
17171
+ _ts_decorate97([
17043
17172
  (0, import_class_validator19.IsEmail)(),
17044
- _ts_metadata75("design:type", String)
17173
+ _ts_metadata76("design:type", String)
17045
17174
  ], ResendRegistrationOtpDto.prototype, "email", void 0);
17046
17175
 
17047
17176
  // src/registration/dto/select-plan.dto.ts
17048
17177
  var import_class_validator20 = require("class-validator");
17049
- function _ts_decorate97(decorators, target, key, desc) {
17178
+ function _ts_decorate98(decorators, target, key, desc) {
17050
17179
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17051
17180
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17052
17181
  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;
17053
17182
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17054
17183
  }
17055
- __name(_ts_decorate97, "_ts_decorate");
17056
- function _ts_metadata76(k, v) {
17184
+ __name(_ts_decorate98, "_ts_decorate");
17185
+ function _ts_metadata77(k, v) {
17057
17186
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17058
17187
  }
17059
- __name(_ts_metadata76, "_ts_metadata");
17188
+ __name(_ts_metadata77, "_ts_metadata");
17060
17189
  var SelectRegistrationPlanDto = class {
17061
17190
  static {
17062
17191
  __name(this, "SelectRegistrationPlanDto");
@@ -17064,32 +17193,32 @@ var SelectRegistrationPlanDto = class {
17064
17193
  pendingRegistrationId;
17065
17194
  planId;
17066
17195
  };
17067
- _ts_decorate97([
17196
+ _ts_decorate98([
17068
17197
  (0, import_class_validator20.IsString)(),
17069
17198
  (0, import_class_validator20.MinLength)(1),
17070
17199
  (0, import_class_validator20.MaxLength)(80),
17071
- _ts_metadata76("design:type", String)
17200
+ _ts_metadata77("design:type", String)
17072
17201
  ], SelectRegistrationPlanDto.prototype, "pendingRegistrationId", void 0);
17073
- _ts_decorate97([
17202
+ _ts_decorate98([
17074
17203
  (0, import_class_validator20.IsString)(),
17075
17204
  (0, import_class_validator20.MinLength)(1),
17076
17205
  (0, import_class_validator20.MaxLength)(40),
17077
- _ts_metadata76("design:type", String)
17206
+ _ts_metadata77("design:type", String)
17078
17207
  ], SelectRegistrationPlanDto.prototype, "planId", void 0);
17079
17208
 
17080
17209
  // src/registration/dto/start-checkout.dto.ts
17081
17210
  var import_class_validator21 = require("class-validator");
17082
- function _ts_decorate98(decorators, target, key, desc) {
17211
+ function _ts_decorate99(decorators, target, key, desc) {
17083
17212
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17084
17213
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17085
17214
  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;
17086
17215
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17087
17216
  }
17088
- __name(_ts_decorate98, "_ts_decorate");
17089
- function _ts_metadata77(k, v) {
17217
+ __name(_ts_decorate99, "_ts_decorate");
17218
+ function _ts_metadata78(k, v) {
17090
17219
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17091
17220
  }
17092
- __name(_ts_metadata77, "_ts_metadata");
17221
+ __name(_ts_metadata78, "_ts_metadata");
17093
17222
  var StartRegistrationCheckoutDto = class {
17094
17223
  static {
17095
17224
  __name(this, "StartRegistrationCheckoutDto");
@@ -17098,40 +17227,40 @@ var StartRegistrationCheckoutDto = class {
17098
17227
  successUrl;
17099
17228
  cancelUrl;
17100
17229
  };
17101
- _ts_decorate98([
17230
+ _ts_decorate99([
17102
17231
  (0, import_class_validator21.IsString)(),
17103
17232
  (0, import_class_validator21.MinLength)(1),
17104
17233
  (0, import_class_validator21.MaxLength)(80),
17105
- _ts_metadata77("design:type", String)
17234
+ _ts_metadata78("design:type", String)
17106
17235
  ], StartRegistrationCheckoutDto.prototype, "pendingRegistrationId", void 0);
17107
- _ts_decorate98([
17236
+ _ts_decorate99([
17108
17237
  (0, import_class_validator21.IsUrl)({
17109
17238
  require_tld: false
17110
17239
  }),
17111
17240
  (0, import_class_validator21.MaxLength)(500),
17112
- _ts_metadata77("design:type", String)
17241
+ _ts_metadata78("design:type", String)
17113
17242
  ], StartRegistrationCheckoutDto.prototype, "successUrl", void 0);
17114
- _ts_decorate98([
17243
+ _ts_decorate99([
17115
17244
  (0, import_class_validator21.IsUrl)({
17116
17245
  require_tld: false
17117
17246
  }),
17118
17247
  (0, import_class_validator21.MaxLength)(500),
17119
- _ts_metadata77("design:type", String)
17248
+ _ts_metadata78("design:type", String)
17120
17249
  ], StartRegistrationCheckoutDto.prototype, "cancelUrl", void 0);
17121
17250
 
17122
17251
  // src/registration/dto/payment-webhook.dto.ts
17123
17252
  var import_class_validator22 = require("class-validator");
17124
- function _ts_decorate99(decorators, target, key, desc) {
17253
+ function _ts_decorate100(decorators, target, key, desc) {
17125
17254
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17126
17255
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17127
17256
  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;
17128
17257
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17129
17258
  }
17130
- __name(_ts_decorate99, "_ts_decorate");
17131
- function _ts_metadata78(k, v) {
17259
+ __name(_ts_decorate100, "_ts_decorate");
17260
+ function _ts_metadata79(k, v) {
17132
17261
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17133
17262
  }
17134
- __name(_ts_metadata78, "_ts_metadata");
17263
+ __name(_ts_metadata79, "_ts_metadata");
17135
17264
  var PaymentWebhookDto = class {
17136
17265
  static {
17137
17266
  __name(this, "PaymentWebhookDto");
@@ -17142,76 +17271,76 @@ var PaymentWebhookDto = class {
17142
17271
  status;
17143
17272
  payload;
17144
17273
  };
17145
- _ts_decorate99([
17274
+ _ts_decorate100([
17146
17275
  (0, import_class_validator22.IsString)(),
17147
17276
  (0, import_class_validator22.MinLength)(1),
17148
17277
  (0, import_class_validator22.MaxLength)(120),
17149
- _ts_metadata78("design:type", String)
17278
+ _ts_metadata79("design:type", String)
17150
17279
  ], PaymentWebhookDto.prototype, "eventId", void 0);
17151
- _ts_decorate99([
17280
+ _ts_decorate100([
17152
17281
  (0, import_class_validator22.IsOptional)(),
17153
17282
  (0, import_class_validator22.IsString)(),
17154
17283
  (0, import_class_validator22.MaxLength)(120),
17155
- _ts_metadata78("design:type", String)
17284
+ _ts_metadata79("design:type", String)
17156
17285
  ], PaymentWebhookDto.prototype, "sessionId", void 0);
17157
- _ts_decorate99([
17286
+ _ts_decorate100([
17158
17287
  (0, import_class_validator22.IsString)(),
17159
17288
  (0, import_class_validator22.MaxLength)(40),
17160
- _ts_metadata78("design:type", String)
17289
+ _ts_metadata79("design:type", String)
17161
17290
  ], PaymentWebhookDto.prototype, "provider", void 0);
17162
- _ts_decorate99([
17291
+ _ts_decorate100([
17163
17292
  (0, import_class_validator22.IsIn)([
17164
17293
  "SUCCEEDED",
17165
17294
  "FAILED"
17166
17295
  ]),
17167
- _ts_metadata78("design:type", String)
17296
+ _ts_metadata79("design:type", String)
17168
17297
  ], PaymentWebhookDto.prototype, "status", void 0);
17169
- _ts_decorate99([
17298
+ _ts_decorate100([
17170
17299
  (0, import_class_validator22.IsOptional)(),
17171
17300
  (0, import_class_validator22.IsObject)(),
17172
- _ts_metadata78("design:type", typeof Record === "undefined" ? Object : Record)
17301
+ _ts_metadata79("design:type", typeof Record === "undefined" ? Object : Record)
17173
17302
  ], PaymentWebhookDto.prototype, "payload", void 0);
17174
17303
 
17175
17304
  // src/registration/dto/continue-registration.dto.ts
17176
17305
  var import_class_validator23 = require("class-validator");
17177
- function _ts_decorate100(decorators, target, key, desc) {
17306
+ function _ts_decorate101(decorators, target, key, desc) {
17178
17307
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17179
17308
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17180
17309
  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;
17181
17310
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17182
17311
  }
17183
- __name(_ts_decorate100, "_ts_decorate");
17184
- function _ts_metadata79(k, v) {
17312
+ __name(_ts_decorate101, "_ts_decorate");
17313
+ function _ts_metadata80(k, v) {
17185
17314
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17186
17315
  }
17187
- __name(_ts_metadata79, "_ts_metadata");
17316
+ __name(_ts_metadata80, "_ts_metadata");
17188
17317
  var ContinueRegistrationDto = class {
17189
17318
  static {
17190
17319
  __name(this, "ContinueRegistrationDto");
17191
17320
  }
17192
17321
  token;
17193
17322
  };
17194
- _ts_decorate100([
17323
+ _ts_decorate101([
17195
17324
  (0, import_class_validator23.IsString)(),
17196
17325
  (0, import_class_validator23.MinLength)(10),
17197
17326
  (0, import_class_validator23.MaxLength)(2e3),
17198
- _ts_metadata79("design:type", String)
17327
+ _ts_metadata80("design:type", String)
17199
17328
  ], ContinueRegistrationDto.prototype, "token", void 0);
17200
17329
 
17201
17330
  // src/registration/dto/save-configuration.dto.ts
17202
17331
  var import_class_validator24 = require("class-validator");
17203
17332
  var import_class_transformer2 = require("class-transformer");
17204
- function _ts_decorate101(decorators, target, key, desc) {
17333
+ function _ts_decorate102(decorators, target, key, desc) {
17205
17334
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17206
17335
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17207
17336
  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;
17208
17337
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17209
17338
  }
17210
- __name(_ts_decorate101, "_ts_decorate");
17211
- function _ts_metadata80(k, v) {
17339
+ __name(_ts_decorate102, "_ts_decorate");
17340
+ function _ts_metadata81(k, v) {
17212
17341
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17213
17342
  }
17214
- __name(_ts_metadata80, "_ts_metadata");
17343
+ __name(_ts_metadata81, "_ts_metadata");
17215
17344
  var SaveRegistrationConfigSelectionDto = class {
17216
17345
  static {
17217
17346
  __name(this, "SaveRegistrationConfigSelectionDto");
@@ -17228,30 +17357,30 @@ var SaveRegistrationConfigSelectionDto = class {
17228
17357
  */
17229
17358
  offerId;
17230
17359
  };
17231
- _ts_decorate101([
17360
+ _ts_decorate102([
17232
17361
  (0, import_class_validator24.IsString)(),
17233
17362
  (0, import_class_validator24.MinLength)(1),
17234
17363
  (0, import_class_validator24.MaxLength)(40),
17235
- _ts_metadata80("design:type", String)
17364
+ _ts_metadata81("design:type", String)
17236
17365
  ], SaveRegistrationConfigSelectionDto.prototype, "modelId", void 0);
17237
- _ts_decorate101([
17366
+ _ts_decorate102([
17238
17367
  (0, import_class_validator24.IsIn)([
17239
17368
  "MONTHLY",
17240
17369
  "YEARLY"
17241
17370
  ]),
17242
- _ts_metadata80("design:type", String)
17371
+ _ts_metadata81("design:type", String)
17243
17372
  ], SaveRegistrationConfigSelectionDto.prototype, "billingCycle", void 0);
17244
- _ts_decorate101([
17373
+ _ts_decorate102([
17245
17374
  (0, import_class_validator24.IsOptional)(),
17246
17375
  (0, import_class_validator24.IsString)(),
17247
17376
  (0, import_class_validator24.MaxLength)(60),
17248
- _ts_metadata80("design:type", Object)
17377
+ _ts_metadata81("design:type", Object)
17249
17378
  ], SaveRegistrationConfigSelectionDto.prototype, "appliedPromoCode", void 0);
17250
- _ts_decorate101([
17379
+ _ts_decorate102([
17251
17380
  (0, import_class_validator24.IsOptional)(),
17252
17381
  (0, import_class_validator24.ValidateIf)((_o, value) => value !== null),
17253
17382
  (0, import_class_validator24.IsUUID)(),
17254
- _ts_metadata80("design:type", Object)
17383
+ _ts_metadata81("design:type", Object)
17255
17384
  ], SaveRegistrationConfigSelectionDto.prototype, "offerId", void 0);
17256
17385
  var SaveRegistrationConfigDto = class {
17257
17386
  static {
@@ -17260,31 +17389,31 @@ var SaveRegistrationConfigDto = class {
17260
17389
  pendingRegistrationId;
17261
17390
  selection;
17262
17391
  };
17263
- _ts_decorate101([
17392
+ _ts_decorate102([
17264
17393
  (0, import_class_validator24.IsString)(),
17265
17394
  (0, import_class_validator24.MinLength)(1),
17266
17395
  (0, import_class_validator24.MaxLength)(80),
17267
- _ts_metadata80("design:type", String)
17396
+ _ts_metadata81("design:type", String)
17268
17397
  ], SaveRegistrationConfigDto.prototype, "pendingRegistrationId", void 0);
17269
- _ts_decorate101([
17398
+ _ts_decorate102([
17270
17399
  (0, import_class_validator24.ValidateNested)(),
17271
17400
  (0, import_class_transformer2.Type)(() => SaveRegistrationConfigSelectionDto),
17272
- _ts_metadata80("design:type", typeof SaveRegistrationConfigSelectionDto === "undefined" ? Object : SaveRegistrationConfigSelectionDto)
17401
+ _ts_metadata81("design:type", typeof SaveRegistrationConfigSelectionDto === "undefined" ? Object : SaveRegistrationConfigSelectionDto)
17273
17402
  ], SaveRegistrationConfigDto.prototype, "selection", void 0);
17274
17403
 
17275
17404
  // src/registration/dto/preview-promo.dto.ts
17276
17405
  var import_class_validator25 = require("class-validator");
17277
- function _ts_decorate102(decorators, target, key, desc) {
17406
+ function _ts_decorate103(decorators, target, key, desc) {
17278
17407
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17279
17408
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17280
17409
  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;
17281
17410
  return c > 3 && r && Object.defineProperty(target, key, r), r;
17282
17411
  }
17283
- __name(_ts_decorate102, "_ts_decorate");
17284
- function _ts_metadata81(k, v) {
17412
+ __name(_ts_decorate103, "_ts_decorate");
17413
+ function _ts_metadata82(k, v) {
17285
17414
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17286
17415
  }
17287
- __name(_ts_metadata81, "_ts_metadata");
17416
+ __name(_ts_metadata82, "_ts_metadata");
17288
17417
  var PreviewRegistrationPromoDto = class {
17289
17418
  static {
17290
17419
  __name(this, "PreviewRegistrationPromoDto");
@@ -17292,17 +17421,17 @@ var PreviewRegistrationPromoDto = class {
17292
17421
  pendingRegistrationId;
17293
17422
  code;
17294
17423
  };
17295
- _ts_decorate102([
17424
+ _ts_decorate103([
17296
17425
  (0, import_class_validator25.IsString)(),
17297
17426
  (0, import_class_validator25.MinLength)(1),
17298
17427
  (0, import_class_validator25.MaxLength)(80),
17299
- _ts_metadata81("design:type", String)
17428
+ _ts_metadata82("design:type", String)
17300
17429
  ], PreviewRegistrationPromoDto.prototype, "pendingRegistrationId", void 0);
17301
- _ts_decorate102([
17430
+ _ts_decorate103([
17302
17431
  (0, import_class_validator25.IsOptional)(),
17303
17432
  (0, import_class_validator25.IsString)(),
17304
17433
  (0, import_class_validator25.MaxLength)(60),
17305
- _ts_metadata81("design:type", String)
17434
+ _ts_metadata82("design:type", String)
17306
17435
  ], PreviewRegistrationPromoDto.prototype, "code", void 0);
17307
17436
 
17308
17437
  // src/index.ts
@@ -17371,6 +17500,7 @@ __export(src_exports, {
17371
17500
  EntitlementModule: () => EntitlementModule,
17372
17501
  EntitlementService: () => EntitlementService,
17373
17502
  FEATURE_GUARD_CONFIG_TOKEN: () => FEATURE_GUARD_CONFIG_TOKEN,
17503
+ FEATURE_GUARD_MARKER: () => FEATURE_GUARD_MARKER,
17374
17504
  FEATURE_UI_REGISTRY_TOKEN: () => FEATURE_UI_REGISTRY_TOKEN2,
17375
17505
  FeatureGuard: () => FeatureGuard,
17376
17506
  IMPLEMENTS_CAPABILITY_KEY: () => IMPLEMENTS_CAPABILITY_KEY,
@@ -17589,6 +17719,7 @@ __export(src_exports, {
17589
17719
  isFeatureInPlan: () => isFeatureInPlan,
17590
17720
  isFeaturePlannedOnly: () => isFeaturePlannedOnly,
17591
17721
  isLimitExceededError: () => isLimitExceededError,
17722
+ isPlatformFeatureGuard: () => isPlatformFeatureGuard,
17592
17723
  isSaaSiCatPublicRoute: () => isSaaSiCatPublicRoute,
17593
17724
  loadApprovedCatalogKeys: () => loadApprovedCatalogKeys,
17594
17725
  loadDiscoverySnapshotFromFile: () => loadDiscoverySnapshotFromFile,
@@ -18530,14 +18661,14 @@ var FakePlanRepository = class {
18530
18661
  };
18531
18662
 
18532
18663
  // src/testing/create-saas-platform-test-module.ts
18533
- var import_common84 = require("@nestjs/common");
18534
- function _ts_decorate103(decorators, target, key, desc) {
18664
+ var import_common85 = require("@nestjs/common");
18665
+ function _ts_decorate104(decorators, target, key, desc) {
18535
18666
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18536
18667
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
18537
18668
  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;
18538
18669
  return c > 3 && r && Object.defineProperty(target, key, r), r;
18539
18670
  }
18540
- __name(_ts_decorate103, "_ts_decorate");
18671
+ __name(_ts_decorate104, "_ts_decorate");
18541
18672
  var StubMfaPort = class {
18542
18673
  static {
18543
18674
  __name(this, "StubMfaPort");
@@ -18578,8 +18709,8 @@ function createSaasPlatformTestModule(options) {
18578
18709
  __name(this, "SaasPlatformTestHost");
18579
18710
  }
18580
18711
  };
18581
- SaasPlatformTestHost = _ts_decorate103([
18582
- (0, import_common84.Module)({
18712
+ SaasPlatformTestHost = _ts_decorate104([
18713
+ (0, import_common85.Module)({
18583
18714
  imports: [
18584
18715
  SaasPlatformModule.forRoot({
18585
18716
  planCatalog: options.planCatalog,