@saasicat/nest 0.22.0 → 0.22.1

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