@saasicat/nest 0.21.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.
- package/dist/_entries.cjs +409 -276
- package/dist/admin/index.js +1 -1
- package/dist/{aggregation-o0LMenvl.d.ts → aggregation-DP5zfKbU.d.ts} +3 -3
- package/dist/{aggregation-SKfXu09x.d.cts → aggregation-mZ7WZROK.d.cts} +3 -3
- package/dist/billing/index.d.cts +12 -10
- package/dist/billing/index.d.ts +12 -10
- package/dist/billing/index.js +6 -2
- package/dist/catalog/index.d.cts +10 -10
- package/dist/catalog/index.d.ts +10 -10
- package/dist/catalog/index.js +2 -2
- package/dist/{catalog.module-BKObceo0.d.ts → catalog.module-CQr1FpkI.d.ts} +6 -6
- package/dist/{catalog.module-Dw2Hrbyu.d.cts → catalog.module-D-_pQDNA.d.cts} +6 -6
- package/dist/{chunk-GC5AKN44.js → chunk-7X5MSAIL.js} +7 -7
- package/dist/{chunk-55QGAZRQ.js → chunk-7ZPFQXHM.js} +1 -1
- package/dist/{chunk-NZLAYCEX.js → chunk-A7FHAN2I.js} +17 -3
- package/dist/{chunk-ZH5PYEMI.js → chunk-LPCUHZWC.js} +180 -61
- package/dist/{chunk-3DRZ5GCP.js → chunk-MJ32VNZD.js} +1 -1
- package/dist/{chunk-AGOG5B77.js → chunk-NNNXXUPT.js} +1 -1
- package/dist/{chunk-FYWLPYBK.js → chunk-SN5UOC43.js} +3 -3
- package/dist/{define-saasicat-B20Ms8UC.d.ts → define-saasicat-BK6RRWWG.d.ts} +1 -1
- package/dist/{define-saasicat-Cf9DpEsY.d.cts → define-saasicat-D30I-WET.d.cts} +1 -1
- package/dist/discovery/index.d.cts +2 -2
- package/dist/discovery/index.d.ts +2 -2
- package/dist/{enforce-quota.interceptor-CUyfR4cQ.d.ts → enforce-quota.interceptor-B9QueAFf.d.ts} +4 -1
- package/dist/{enforce-quota.interceptor-Dtg5WdFj.d.cts → enforce-quota.interceptor-DY6CLjoP.d.cts} +4 -1
- package/dist/entitlement/index.d.cts +1 -1
- package/dist/entitlement/index.d.ts +1 -1
- package/dist/entitlement/index.js +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -8
- package/dist/{plan-versions.service-BB36Q1bg.d.ts → plan-versions.service-B-YoE4SZ.d.ts} +1 -1
- package/dist/{plan-versions.service-CUR2Whyr.d.cts → plan-versions.service-_saKzb50.d.cts} +1 -1
- package/dist/platform/index.d.cts +31 -13
- package/dist/platform/index.d.ts +31 -13
- package/dist/platform/index.js +8 -6
- package/dist/registration/index.d.cts +1 -1
- package/dist/registration/index.d.ts +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/{saas-platform.module-BfaYfL-G.d.cts → saas-platform.module-CgalxzcT.d.cts} +2 -2
- package/dist/{saas-platform.module-DChhDrR-.d.ts → saas-platform.module-D1mUZPrz.d.ts} +2 -2
- package/dist/{subscription-bundles.module-BQmoozm5.d.ts → subscription-bundles.module-BDbODWvA.d.ts} +9 -1
- package/dist/{subscription-bundles.module-DCpV-Pb5.d.cts → subscription-bundles.module-Cfi-lFWF.d.cts} +9 -1
- package/dist/{tenant-billing.controller-DT5UrnDX.d.ts → tenant-billing.controller-BSlpFqVA.d.ts} +3 -3
- package/dist/{tenant-billing.controller-BIF-mstX.d.cts → tenant-billing.controller-DHSUrT_N.d.cts} +3 -3
- package/dist/testing/index.d.cts +5 -5
- package/dist/testing/index.d.ts +5 -5
- package/dist/testing/index.js +6 -6
- package/package.json +3 -3
- /package/dist/{chunk-EWPF57AG.js → chunk-FY4EJTV4.js} +0 -0
package/dist/_entries.cjs
CHANGED
|
@@ -771,7 +771,7 @@ var PLATFORM_CORE_MANIFEST_CONTRIBUTION = {
|
|
|
771
771
|
enabled: true,
|
|
772
772
|
requiredCapability: "dashboard.read"
|
|
773
773
|
},
|
|
774
|
-
//
|
|
774
|
+
// — discovery snapshot of the running backend.
|
|
775
775
|
// Apps must set `discovery.read` in their manifest capabilities
|
|
776
776
|
// to `true` so that the NavBuilder wires the page into the
|
|
777
777
|
// sidebar; otherwise it is filtered out automatically.
|
|
@@ -779,7 +779,7 @@ var PLATFORM_CORE_MANIFEST_CONTRIBUTION = {
|
|
|
779
779
|
enabled: true,
|
|
780
780
|
requiredCapability: "discovery.read"
|
|
781
781
|
},
|
|
782
|
-
//
|
|
782
|
+
// — Bundle editor in SuperAdmin.
|
|
783
783
|
// Apps with a DB-driven catalog set `bundles.read = true`.
|
|
784
784
|
bundles: {
|
|
785
785
|
enabled: true,
|
|
@@ -789,7 +789,7 @@ var PLATFORM_CORE_MANIFEST_CONTRIBUTION = {
|
|
|
789
789
|
enabled: true,
|
|
790
790
|
requiredCapability: "plans.read"
|
|
791
791
|
},
|
|
792
|
-
//
|
|
792
|
+
// — marketing catalog (locale pivot).
|
|
793
793
|
// Apps that market a public catalog set
|
|
794
794
|
// `marketingProjections.read = true`.
|
|
795
795
|
marketingCatalog: {
|
|
@@ -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";
|
|
@@ -2539,7 +2551,7 @@ var EntitlementService = class {
|
|
|
2539
2551
|
// ---------------------------------------------------------------------
|
|
2540
2552
|
/**
|
|
2541
2553
|
* Plan fallback for TRIAL/PENDING_SALES: returns the PlanVersion active
|
|
2542
|
-
* as of `asOf
|
|
2554
|
+
* as of `asOf`. If the repo does not implement
|
|
2543
2555
|
* `findActive`, we fall back to `findLatestLive` (backward compat for
|
|
2544
2556
|
* adapters without `validFrom` columns).
|
|
2545
2557
|
*/
|
|
@@ -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;
|
|
@@ -3002,7 +3016,7 @@ function _ts_param14(paramIndex, decorator) {
|
|
|
3002
3016
|
}
|
|
3003
3017
|
__name(_ts_param14, "_ts_param");
|
|
3004
3018
|
var PLAN_CATALOG_IMPORT_SINK_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/PlanCatalogImportSink");
|
|
3005
|
-
var IMPORT_CHANGE_NOTE = "Initial import from saas.yaml
|
|
3019
|
+
var IMPORT_CHANGE_NOTE = "Initial import from saas.yaml";
|
|
3006
3020
|
var PlanCatalogImporterService = class {
|
|
3007
3021
|
static {
|
|
3008
3022
|
__name(this, "PlanCatalogImporterService");
|
|
@@ -3293,7 +3307,7 @@ var PublicCatalogController = class {
|
|
|
3293
3307
|
return merged;
|
|
3294
3308
|
}
|
|
3295
3309
|
/**
|
|
3296
|
-
*
|
|
3310
|
+
* — public catalog endpoint for bundles
|
|
3297
3311
|
* (stem list with live versions). If a `MarketingProjection` with
|
|
3298
3312
|
* `targetType=BUNDLE` + matching locale exists, it is merged in.
|
|
3299
3313
|
*/
|
|
@@ -7840,7 +7854,7 @@ var BundlesService = class _BundlesService {
|
|
|
7840
7854
|
* Publishes a draft version atomically. Steps:
|
|
7841
7855
|
* 1. Strict check on the draft definition (warn-only or blocking)
|
|
7842
7856
|
* 2. Enforce validFrom requirement + ordering against the predecessor
|
|
7843
|
-
* (
|
|
7857
|
+
* (analogous to PlanVersion)
|
|
7844
7858
|
* 3. Compute the diff against the predecessor version (latest live) →
|
|
7845
7859
|
* `publishedChanges` + `nonRegressive` via `classifyBundleVersionDiff`
|
|
7846
7860
|
* 4. Call Repository.publishDraft with the diff result + validity dates
|
|
@@ -7889,7 +7903,7 @@ var BundlesService = class _BundlesService {
|
|
|
7889
7903
|
if (!validFromInput) {
|
|
7890
7904
|
throw new import_common43.UnprocessableEntityException({
|
|
7891
7905
|
code: import_types20.CATALOG_ERROR_CODES.BUNDLE_VERSION_VALID_FROM_REQUIRED,
|
|
7892
|
-
message: "validFrom must be set when publishing (on the draft or the publish call)
|
|
7906
|
+
message: "validFrom must be set when publishing (on the draft or the publish call).."
|
|
7893
7907
|
});
|
|
7894
7908
|
}
|
|
7895
7909
|
const validFrom = new Date(validFromInput);
|
|
@@ -10125,7 +10139,7 @@ function buildPublicMarketingCatalogController(guards, projectKey, currency, vat
|
|
|
10125
10139
|
this.service = service;
|
|
10126
10140
|
}
|
|
10127
10141
|
/**
|
|
10128
|
-
* `?lang=de|tr|en` — alias `locale` accepted
|
|
10142
|
+
* `?lang=de|tr|en` — alias `locale` accepted.
|
|
10129
10143
|
* `?asOf=YYYY-MM-DD` — preview of a future or past catalog variant.
|
|
10130
10144
|
* Default = today. Returns the PlanVersion whose `validFrom`/`validUntil`
|
|
10131
10145
|
* span `asOf` inclusively by day (the validUntil day still counts,
|
|
@@ -10636,7 +10650,7 @@ var PlanVersionsService = class _PlanVersionsService {
|
|
|
10636
10650
|
if (!validFromInput) {
|
|
10637
10651
|
throw new import_common55.UnprocessableEntityException({
|
|
10638
10652
|
code: import_types26.CATALOG_ERROR_CODES.PLAN_VERSION_VALID_FROM_REQUIRED,
|
|
10639
|
-
message: "validFrom must be set when publishing (on the draft or the publish call)
|
|
10653
|
+
message: "validFrom must be set when publishing (on the draft or the publish call).."
|
|
10640
10654
|
});
|
|
10641
10655
|
}
|
|
10642
10656
|
const validFrom = new Date(validFromInput);
|
|
@@ -11153,7 +11167,7 @@ var PublishBundleVersionDto = class {
|
|
|
11153
11167
|
allowZeroPrice;
|
|
11154
11168
|
/**
|
|
11155
11169
|
* Required on publish if the draft carries no `validFrom`
|
|
11156
|
-
* (
|
|
11170
|
+
* (analogous to PublishPlanVersionDto).
|
|
11157
11171
|
* Service strictly checks > `validFrom` of the predecessor version.
|
|
11158
11172
|
*/
|
|
11159
11173
|
validFrom;
|
|
@@ -11939,7 +11953,7 @@ var CreatePlanVersionDraftDto = class {
|
|
|
11939
11953
|
marketed;
|
|
11940
11954
|
changeNote;
|
|
11941
11955
|
baseVersionId;
|
|
11942
|
-
/** Optional in the draft (required at publish). ISO date string
|
|
11956
|
+
/** Optional in the draft (required at publish). ISO date string.. */
|
|
11943
11957
|
validFrom;
|
|
11944
11958
|
/** Optional; null = unlimited. ISO date string. */
|
|
11945
11959
|
validUntil;
|
|
@@ -12114,7 +12128,7 @@ var PublishPlanVersionDto = class {
|
|
|
12114
12128
|
allowZeroPrice;
|
|
12115
12129
|
/**
|
|
12116
12130
|
* Required at publish (on the DTO or draft). The service strictly checks
|
|
12117
|
-
* `validFrom > predecessor.validFrom
|
|
12131
|
+
* `validFrom > predecessor.validFrom`..
|
|
12118
12132
|
*/
|
|
12119
12133
|
validFrom;
|
|
12120
12134
|
validUntil;
|
|
@@ -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
|
|
13728
|
-
var
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
15058
|
+
throw new import_common76.ForbiddenException(body);
|
|
14934
15059
|
}
|
|
14935
15060
|
return true;
|
|
14936
15061
|
}
|
|
14937
15062
|
};
|
|
14938
|
-
StaticFeatureGuard =
|
|
14939
|
-
(0,
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
typeof
|
|
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
|
|
14954
|
-
var
|
|
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
|
|
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(
|
|
14964
|
-
function
|
|
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(
|
|
14968
|
-
function
|
|
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(
|
|
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 =
|
|
15017
|
-
(0,
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
|
|
15024
|
-
typeof
|
|
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
|
|
15072
|
-
function
|
|
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(
|
|
15079
|
-
function
|
|
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(
|
|
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 =
|
|
15129
|
-
(0,
|
|
15130
|
-
|
|
15131
|
-
|
|
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
|
|
15146
|
-
function
|
|
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(
|
|
15153
|
-
function
|
|
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(
|
|
15157
|
-
function
|
|
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(
|
|
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
|
-
|
|
15182
|
-
(0,
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
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
|
-
|
|
15313
|
+
_ts_metadata70("design:returntype", Promise)
|
|
15189
15314
|
], GeneratedTenantManifestController.prototype, "get", null);
|
|
15190
|
-
GeneratedTenantManifestController =
|
|
15191
|
-
(0,
|
|
15192
|
-
(0,
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
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,13 +15326,14 @@ function buildTenantManifestController(options) {
|
|
|
15201
15326
|
__name(buildTenantManifestController, "buildTenantManifestController");
|
|
15202
15327
|
|
|
15203
15328
|
// src/platform/saas-platform.module.ts
|
|
15204
|
-
function
|
|
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(
|
|
15335
|
+
__name(_ts_decorate90, "_ts_decorate");
|
|
15336
|
+
var PLATFORM_LOGGER = new import_common80.Logger("SaaSiCat");
|
|
15211
15337
|
var PLATFORM_SUBSCRIPTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/PlatformSubscriptionRepository");
|
|
15212
15338
|
var STANDARD_MANIFEST_REGISTRATION_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform-nest/StandardManifestRegistration");
|
|
15213
15339
|
function buildStandardManifestContribution(catalog, adminResources, promoCodes) {
|
|
@@ -15664,14 +15790,19 @@ var SaasPlatformModule = class _SaasPlatformModule {
|
|
|
15664
15790
|
inject: options.quotaProviders ?? []
|
|
15665
15791
|
}, ...options.globalFeatureGuard === false ? [] : [
|
|
15666
15792
|
{
|
|
15667
|
-
provide:
|
|
15793
|
+
provide: import_core10.APP_GUARD,
|
|
15668
15794
|
useExisting: StaticFeatureGuard
|
|
15669
15795
|
}
|
|
15670
15796
|
], {
|
|
15671
|
-
provide:
|
|
15797
|
+
provide: import_core10.APP_INTERCEPTOR,
|
|
15672
15798
|
useExisting: EnforceQuotaInterceptor
|
|
15673
15799
|
});
|
|
15674
15800
|
lightweightExports.push(PLAN_RESOLVER_PORT_TOKEN, StaticEntitlementService, StaticFeatureGuard, EnforceQuotaInterceptor, QUOTA_PROVIDERS_TOKEN);
|
|
15801
|
+
if (options.globalFeatureGuard === false) {
|
|
15802
|
+
lightweightProviders.push(FeatureGuardCoverageCheck);
|
|
15803
|
+
}
|
|
15804
|
+
} else {
|
|
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.");
|
|
15675
15806
|
}
|
|
15676
15807
|
const tenantControllers = [];
|
|
15677
15808
|
if (options.tenantManifest) {
|
|
@@ -15733,8 +15864,8 @@ var SaasPlatformModule = class _SaasPlatformModule {
|
|
|
15733
15864
|
};
|
|
15734
15865
|
}
|
|
15735
15866
|
};
|
|
15736
|
-
SaasPlatformModule =
|
|
15737
|
-
(0,
|
|
15867
|
+
SaasPlatformModule = _ts_decorate90([
|
|
15868
|
+
(0, import_common80.Module)({})
|
|
15738
15869
|
], SaasPlatformModule);
|
|
15739
15870
|
|
|
15740
15871
|
// src/platform/define-saasicat.ts
|
|
@@ -15865,7 +15996,7 @@ var REGISTRATION_PROMO_PREVIEW_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform
|
|
|
15865
15996
|
var REGISTRATION_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/RegistrationConfig");
|
|
15866
15997
|
|
|
15867
15998
|
// src/registration/pending-registration.service.ts
|
|
15868
|
-
var
|
|
15999
|
+
var import_common81 = require("@nestjs/common");
|
|
15869
16000
|
var import_types32 = require("@saasicat/types");
|
|
15870
16001
|
var import_types33 = require("@saasicat/types");
|
|
15871
16002
|
|
|
@@ -15921,23 +16052,23 @@ function resolveModel(catalog, modelId) {
|
|
|
15921
16052
|
__name(resolveModel, "resolveModel");
|
|
15922
16053
|
|
|
15923
16054
|
// src/registration/pending-registration.service.ts
|
|
15924
|
-
function
|
|
16055
|
+
function _ts_decorate91(decorators, target, key, desc) {
|
|
15925
16056
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15926
16057
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15927
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;
|
|
15928
16059
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15929
16060
|
}
|
|
15930
|
-
__name(
|
|
15931
|
-
function
|
|
16061
|
+
__name(_ts_decorate91, "_ts_decorate");
|
|
16062
|
+
function _ts_metadata71(k, v) {
|
|
15932
16063
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15933
16064
|
}
|
|
15934
|
-
__name(
|
|
15935
|
-
function
|
|
16065
|
+
__name(_ts_metadata71, "_ts_metadata");
|
|
16066
|
+
function _ts_param57(paramIndex, decorator) {
|
|
15936
16067
|
return function(target, key) {
|
|
15937
16068
|
decorator(target, key, paramIndex);
|
|
15938
16069
|
};
|
|
15939
16070
|
}
|
|
15940
|
-
__name(
|
|
16071
|
+
__name(_ts_param57, "_ts_param");
|
|
15941
16072
|
var PendingRegistrationService = class _PendingRegistrationService {
|
|
15942
16073
|
static {
|
|
15943
16074
|
__name(this, "PendingRegistrationService");
|
|
@@ -15957,7 +16088,7 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
15957
16088
|
resumeBaseUrl;
|
|
15958
16089
|
configuratorLookup;
|
|
15959
16090
|
promoPreview;
|
|
15960
|
-
logger = new
|
|
16091
|
+
logger = new import_common81.Logger(_PendingRegistrationService.name);
|
|
15961
16092
|
constructor(repo, otpDelivery, userLookup, slugCheck, passwordHasher, planCatalog, paymentProvider, paymentEventLog, activationOrchestrator, audit, resumeTokenSigner, resumeDelivery, resumeBaseUrl, configuratorLookup, promoPreview) {
|
|
15962
16093
|
this.repo = repo;
|
|
15963
16094
|
this.otpDelivery = otpDelivery;
|
|
@@ -15995,17 +16126,17 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
15995
16126
|
async selectPlan(input, context) {
|
|
15996
16127
|
const pending = await this.repo.findById(input.pendingRegistrationId);
|
|
15997
16128
|
if (!pending) {
|
|
15998
|
-
throw new
|
|
16129
|
+
throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
|
|
15999
16130
|
}
|
|
16000
16131
|
if (pending.expiresAt.getTime() < Date.now()) {
|
|
16001
|
-
throw new
|
|
16132
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
|
|
16002
16133
|
}
|
|
16003
16134
|
if (pending.status !== "EMAIL_VERIFIED" && pending.status !== "PLAN_SELECTED" && pending.status !== "CHECKOUT_STARTED") {
|
|
16004
|
-
throw new
|
|
16135
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.INVALID_REGISTRATION_STATE));
|
|
16005
16136
|
}
|
|
16006
16137
|
const plan = await this.planCatalog.findPublicSignupPlan(input.planId);
|
|
16007
16138
|
if (!plan) {
|
|
16008
|
-
throw new
|
|
16139
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_AVAILABLE));
|
|
16009
16140
|
}
|
|
16010
16141
|
const now = /* @__PURE__ */ new Date();
|
|
16011
16142
|
const expiresAt = new Date(now.getTime() + import_types33.PENDING_ONBOARDING_TTL_DAYS * 24 * 60 * 60 * 1e3);
|
|
@@ -16028,20 +16159,20 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16028
16159
|
async startCheckout(input, context) {
|
|
16029
16160
|
const pending = await this.repo.findById(input.pendingRegistrationId);
|
|
16030
16161
|
if (!pending) {
|
|
16031
|
-
throw new
|
|
16162
|
+
throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
|
|
16032
16163
|
}
|
|
16033
16164
|
if (pending.expiresAt.getTime() < Date.now()) {
|
|
16034
|
-
throw new
|
|
16165
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
|
|
16035
16166
|
}
|
|
16036
16167
|
if (pending.status !== "PLAN_SELECTED" && pending.status !== "CHECKOUT_STARTED") {
|
|
16037
|
-
throw new
|
|
16168
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_SELECTED));
|
|
16038
16169
|
}
|
|
16039
16170
|
if (!pending.selectedPlanId) {
|
|
16040
|
-
throw new
|
|
16171
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_SELECTED));
|
|
16041
16172
|
}
|
|
16042
16173
|
const plan = await this.planCatalog.findPublicSignupPlan(pending.selectedPlanId);
|
|
16043
16174
|
if (!plan) {
|
|
16044
|
-
throw new
|
|
16175
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PLAN_NOT_AVAILABLE));
|
|
16045
16176
|
}
|
|
16046
16177
|
const session = await this.paymentProvider.createCheckoutSession({
|
|
16047
16178
|
pendingRegistrationId: pending.id,
|
|
@@ -16250,7 +16381,7 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16250
16381
|
await this.record("OTP_VERIFY_FAILED", null, context, {
|
|
16251
16382
|
reason: "unknown_email"
|
|
16252
16383
|
});
|
|
16253
|
-
throw new
|
|
16384
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
|
|
16254
16385
|
}
|
|
16255
16386
|
if (pending.status !== "PENDING_EMAIL_VERIFICATION") {
|
|
16256
16387
|
return {
|
|
@@ -16263,33 +16394,33 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16263
16394
|
await this.record("OTP_VERIFY_FAILED", pending.id, context, {
|
|
16264
16395
|
reason: "no_otp_set"
|
|
16265
16396
|
});
|
|
16266
|
-
throw new
|
|
16397
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
|
|
16267
16398
|
}
|
|
16268
16399
|
if (pending.otpExpiresAt.getTime() < Date.now()) {
|
|
16269
16400
|
await this.record("OTP_VERIFY_FAILED", pending.id, context, {
|
|
16270
16401
|
reason: "expired"
|
|
16271
16402
|
});
|
|
16272
|
-
throw new
|
|
16403
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_EXPIRED));
|
|
16273
16404
|
}
|
|
16274
16405
|
const maxAttempts = resolveOtpVerifyMaxAttempts();
|
|
16275
16406
|
if (pending.otpAttemptCount >= maxAttempts) {
|
|
16276
16407
|
await this.record("OTP_VERIFY_FAILED", pending.id, context, {
|
|
16277
16408
|
reason: "locked"
|
|
16278
16409
|
});
|
|
16279
|
-
throw new
|
|
16410
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_LOCKED));
|
|
16280
16411
|
}
|
|
16281
16412
|
const attemptCount = await this.repo.incrementOtpAttemptCount(pending.id);
|
|
16282
16413
|
if (attemptCount > maxAttempts) {
|
|
16283
16414
|
await this.record("OTP_VERIFY_FAILED", pending.id, context, {
|
|
16284
16415
|
reason: "locked"
|
|
16285
16416
|
});
|
|
16286
|
-
throw new
|
|
16417
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_LOCKED));
|
|
16287
16418
|
}
|
|
16288
16419
|
if (!verifyOtpCode(pending.otpHash, code)) {
|
|
16289
16420
|
await this.record("OTP_VERIFY_FAILED", pending.id, context, {
|
|
16290
16421
|
reason: "wrong_code"
|
|
16291
16422
|
});
|
|
16292
|
-
throw new
|
|
16423
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.OTP_INVALID));
|
|
16293
16424
|
}
|
|
16294
16425
|
const now = /* @__PURE__ */ new Date();
|
|
16295
16426
|
const updated = await this.repo.update(pending.id, {
|
|
@@ -16400,20 +16531,20 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16400
16531
|
*/
|
|
16401
16532
|
async resumeWithToken(input, context) {
|
|
16402
16533
|
if (!this.resumeTokenSigner) {
|
|
16403
|
-
throw new
|
|
16534
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_NOT_CONFIGURED));
|
|
16404
16535
|
}
|
|
16405
16536
|
let decoded;
|
|
16406
16537
|
try {
|
|
16407
16538
|
decoded = await this.resumeTokenSigner.verify(input.token);
|
|
16408
16539
|
} catch {
|
|
16409
|
-
throw new
|
|
16540
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_TOKEN_INVALID));
|
|
16410
16541
|
}
|
|
16411
16542
|
const pending = await this.repo.findById(decoded.pendingRegistrationId);
|
|
16412
16543
|
if (!pending) {
|
|
16413
|
-
throw new
|
|
16544
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.RESUME_TOKEN_INVALID));
|
|
16414
16545
|
}
|
|
16415
16546
|
if (pending.expiresAt.getTime() < Date.now()) {
|
|
16416
|
-
throw new
|
|
16547
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
|
|
16417
16548
|
}
|
|
16418
16549
|
await this.record("REGISTRATION_NEUTRAL_REPLAY", pending.id, context, {
|
|
16419
16550
|
via: "resume_token",
|
|
@@ -16441,7 +16572,7 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16441
16572
|
/** Returns the (app-specific) configurator catalog. */
|
|
16442
16573
|
async getConfiguratorCatalog() {
|
|
16443
16574
|
if (!this.configuratorLookup) {
|
|
16444
|
-
throw new
|
|
16575
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
|
|
16445
16576
|
}
|
|
16446
16577
|
return this.configuratorLookup.getCatalog();
|
|
16447
16578
|
}
|
|
@@ -16458,22 +16589,22 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16458
16589
|
*/
|
|
16459
16590
|
async saveConfiguration(input, context) {
|
|
16460
16591
|
if (!this.configuratorLookup) {
|
|
16461
|
-
throw new
|
|
16592
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
|
|
16462
16593
|
}
|
|
16463
16594
|
const pending = await this.repo.findById(input.pendingRegistrationId);
|
|
16464
16595
|
if (!pending) {
|
|
16465
|
-
throw new
|
|
16596
|
+
throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
|
|
16466
16597
|
}
|
|
16467
16598
|
if (pending.expiresAt.getTime() < Date.now()) {
|
|
16468
|
-
throw new
|
|
16599
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_EXPIRED));
|
|
16469
16600
|
}
|
|
16470
16601
|
if (pending.status !== "EMAIL_VERIFIED" && pending.status !== "PLAN_SELECTED" && pending.status !== "CHECKOUT_STARTED") {
|
|
16471
|
-
throw new
|
|
16602
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.INVALID_REGISTRATION_STATE));
|
|
16472
16603
|
}
|
|
16473
16604
|
const catalog = await this.configuratorLookup.getCatalog();
|
|
16474
16605
|
const model = catalog.models.find((m) => m.id === input.selection.modelId);
|
|
16475
16606
|
if (!model) {
|
|
16476
|
-
throw new
|
|
16607
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.MODEL_NOT_AVAILABLE));
|
|
16477
16608
|
}
|
|
16478
16609
|
let promoEval;
|
|
16479
16610
|
if (input.selection.appliedPromoCode && this.promoPreview) {
|
|
@@ -16537,20 +16668,20 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16537
16668
|
*/
|
|
16538
16669
|
async previewConfigPromo(pendingRegistrationId, code) {
|
|
16539
16670
|
if (!this.configuratorLookup) {
|
|
16540
|
-
throw new
|
|
16671
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIGURATOR_NOT_CONFIGURED));
|
|
16541
16672
|
}
|
|
16542
16673
|
const pending = await this.repo.findById(pendingRegistrationId);
|
|
16543
16674
|
if (!pending) {
|
|
16544
|
-
throw new
|
|
16675
|
+
throw new import_common81.NotFoundException(codedError(import_types32.REGISTRATION_ERROR_CODES.PENDING_REGISTRATION_NOT_FOUND));
|
|
16545
16676
|
}
|
|
16546
16677
|
const config = pending.configJson;
|
|
16547
16678
|
if (!config) {
|
|
16548
|
-
throw new
|
|
16679
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.CONFIG_NOT_SAVED));
|
|
16549
16680
|
}
|
|
16550
16681
|
const catalog = await this.configuratorLookup.getCatalog();
|
|
16551
16682
|
const model = catalog.models.find((m) => m.id === config.modelId);
|
|
16552
16683
|
if (!model) {
|
|
16553
|
-
throw new
|
|
16684
|
+
throw new import_common81.BadRequestException(codedError(import_types32.REGISTRATION_ERROR_CODES.MODEL_NOT_AVAILABLE));
|
|
16554
16685
|
}
|
|
16555
16686
|
let promoEval;
|
|
16556
16687
|
if (code && this.promoPreview) {
|
|
@@ -16611,30 +16742,30 @@ var PendingRegistrationService = class _PendingRegistrationService {
|
|
|
16611
16742
|
throw new Error(`Could not find a free slug for "${tenantName}".`);
|
|
16612
16743
|
}
|
|
16613
16744
|
};
|
|
16614
|
-
PendingRegistrationService =
|
|
16615
|
-
(0,
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16620
|
-
|
|
16621
|
-
|
|
16622
|
-
|
|
16623
|
-
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
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", [
|
|
16638
16769
|
typeof PendingRegistrationRepository === "undefined" ? Object : PendingRegistrationRepository,
|
|
16639
16770
|
typeof RegistrationOtpDelivery === "undefined" ? Object : RegistrationOtpDelivery,
|
|
16640
16771
|
typeof UserAccountLookup === "undefined" ? Object : UserAccountLookup,
|
|
@@ -16690,25 +16821,25 @@ function nullable(value) {
|
|
|
16690
16821
|
__name(nullable, "nullable");
|
|
16691
16822
|
|
|
16692
16823
|
// src/registration/cleanup.cron.ts
|
|
16693
|
-
var
|
|
16824
|
+
var import_common82 = require("@nestjs/common");
|
|
16694
16825
|
var import_schedule2 = require("@nestjs/schedule");
|
|
16695
|
-
function
|
|
16826
|
+
function _ts_decorate92(decorators, target, key, desc) {
|
|
16696
16827
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16697
16828
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16698
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;
|
|
16699
16830
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16700
16831
|
}
|
|
16701
|
-
__name(
|
|
16702
|
-
function
|
|
16832
|
+
__name(_ts_decorate92, "_ts_decorate");
|
|
16833
|
+
function _ts_metadata72(k, v) {
|
|
16703
16834
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16704
16835
|
}
|
|
16705
|
-
__name(
|
|
16836
|
+
__name(_ts_metadata72, "_ts_metadata");
|
|
16706
16837
|
var RegistrationCleanupCron = class _RegistrationCleanupCron {
|
|
16707
16838
|
static {
|
|
16708
16839
|
__name(this, "RegistrationCleanupCron");
|
|
16709
16840
|
}
|
|
16710
16841
|
service;
|
|
16711
|
-
logger = new
|
|
16842
|
+
logger = new import_common82.Logger(_RegistrationCleanupCron.name);
|
|
16712
16843
|
constructor(service) {
|
|
16713
16844
|
this.service = service;
|
|
16714
16845
|
}
|
|
@@ -16737,36 +16868,36 @@ var RegistrationCleanupCron = class _RegistrationCleanupCron {
|
|
|
16737
16868
|
}
|
|
16738
16869
|
}
|
|
16739
16870
|
};
|
|
16740
|
-
|
|
16871
|
+
_ts_decorate92([
|
|
16741
16872
|
(0, import_schedule2.Cron)("15 4 * * *", {
|
|
16742
16873
|
timeZone: "Europe/Berlin"
|
|
16743
16874
|
}),
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
|
|
16875
|
+
_ts_metadata72("design:type", Function),
|
|
16876
|
+
_ts_metadata72("design:paramtypes", []),
|
|
16877
|
+
_ts_metadata72("design:returntype", Promise)
|
|
16747
16878
|
], RegistrationCleanupCron.prototype, "runDaily", null);
|
|
16748
|
-
RegistrationCleanupCron =
|
|
16749
|
-
(0,
|
|
16750
|
-
|
|
16751
|
-
|
|
16879
|
+
RegistrationCleanupCron = _ts_decorate92([
|
|
16880
|
+
(0, import_common82.Injectable)(),
|
|
16881
|
+
_ts_metadata72("design:type", Function),
|
|
16882
|
+
_ts_metadata72("design:paramtypes", [
|
|
16752
16883
|
typeof PendingRegistrationService === "undefined" ? Object : PendingRegistrationService
|
|
16753
16884
|
])
|
|
16754
16885
|
], RegistrationCleanupCron);
|
|
16755
16886
|
|
|
16756
16887
|
// src/registration/ip-rate-limit.guard.ts
|
|
16757
|
-
var
|
|
16888
|
+
var import_common83 = require("@nestjs/common");
|
|
16758
16889
|
var import_types34 = require("@saasicat/types");
|
|
16759
|
-
function
|
|
16890
|
+
function _ts_decorate93(decorators, target, key, desc) {
|
|
16760
16891
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16761
16892
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16762
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;
|
|
16763
16894
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16764
16895
|
}
|
|
16765
|
-
__name(
|
|
16766
|
-
function
|
|
16896
|
+
__name(_ts_decorate93, "_ts_decorate");
|
|
16897
|
+
function _ts_metadata73(k, v) {
|
|
16767
16898
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16768
16899
|
}
|
|
16769
|
-
__name(
|
|
16900
|
+
__name(_ts_metadata73, "_ts_metadata");
|
|
16770
16901
|
var BaseIpRateLimitGuard = class {
|
|
16771
16902
|
static {
|
|
16772
16903
|
__name(this, "BaseIpRateLimitGuard");
|
|
@@ -16783,7 +16914,7 @@ var BaseIpRateLimitGuard = class {
|
|
|
16783
16914
|
const req = context.switchToHttp().getRequest();
|
|
16784
16915
|
const key = ipFingerprint2(req);
|
|
16785
16916
|
if (this.exceeded(key)) {
|
|
16786
|
-
throw new
|
|
16917
|
+
throw new import_common83.HttpException({
|
|
16787
16918
|
...codedError(import_types34.REGISTRATION_ERROR_CODES.RATE_LIMITED, {
|
|
16788
16919
|
retryAfterSeconds: Math.ceil(this.options.windowMs / 1e3)
|
|
16789
16920
|
}),
|
|
@@ -16792,7 +16923,7 @@ var BaseIpRateLimitGuard = class {
|
|
|
16792
16923
|
// not the code — the two emitters of RATE_LIMITED disagree
|
|
16793
16924
|
// on what `reason` means, which is why it is going away.
|
|
16794
16925
|
reason: this.options.name
|
|
16795
|
-
},
|
|
16926
|
+
}, import_common83.HttpStatus.TOO_MANY_REQUESTS);
|
|
16796
16927
|
}
|
|
16797
16928
|
return true;
|
|
16798
16929
|
}
|
|
@@ -16810,10 +16941,10 @@ var BaseIpRateLimitGuard = class {
|
|
|
16810
16941
|
return bucket.count > this.options.limit;
|
|
16811
16942
|
}
|
|
16812
16943
|
};
|
|
16813
|
-
BaseIpRateLimitGuard =
|
|
16814
|
-
(0,
|
|
16815
|
-
|
|
16816
|
-
|
|
16944
|
+
BaseIpRateLimitGuard = _ts_decorate93([
|
|
16945
|
+
(0, import_common83.Injectable)(),
|
|
16946
|
+
_ts_metadata73("design:type", Function),
|
|
16947
|
+
_ts_metadata73("design:paramtypes", [
|
|
16817
16948
|
Object
|
|
16818
16949
|
])
|
|
16819
16950
|
], BaseIpRateLimitGuard);
|
|
@@ -16825,14 +16956,14 @@ function ipFingerprint2(req) {
|
|
|
16825
16956
|
__name(ipFingerprint2, "ipFingerprint");
|
|
16826
16957
|
|
|
16827
16958
|
// src/registration/module.ts
|
|
16828
|
-
var
|
|
16829
|
-
function
|
|
16959
|
+
var import_common84 = require("@nestjs/common");
|
|
16960
|
+
function _ts_decorate94(decorators, target, key, desc) {
|
|
16830
16961
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16831
16962
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16832
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;
|
|
16833
16964
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16834
16965
|
}
|
|
16835
|
-
__name(
|
|
16966
|
+
__name(_ts_decorate94, "_ts_decorate");
|
|
16836
16967
|
var RegistrationModule = class _RegistrationModule {
|
|
16837
16968
|
static {
|
|
16838
16969
|
__name(this, "RegistrationModule");
|
|
@@ -16888,23 +17019,23 @@ var RegistrationModule = class _RegistrationModule {
|
|
|
16888
17019
|
};
|
|
16889
17020
|
}
|
|
16890
17021
|
};
|
|
16891
|
-
RegistrationModule =
|
|
16892
|
-
(0,
|
|
17022
|
+
RegistrationModule = _ts_decorate94([
|
|
17023
|
+
(0, import_common84.Module)({})
|
|
16893
17024
|
], RegistrationModule);
|
|
16894
17025
|
|
|
16895
17026
|
// src/registration/dto/register-start.dto.ts
|
|
16896
17027
|
var import_class_validator17 = require("class-validator");
|
|
16897
|
-
function
|
|
17028
|
+
function _ts_decorate95(decorators, target, key, desc) {
|
|
16898
17029
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16899
17030
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16900
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;
|
|
16901
17032
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16902
17033
|
}
|
|
16903
|
-
__name(
|
|
16904
|
-
function
|
|
17034
|
+
__name(_ts_decorate95, "_ts_decorate");
|
|
17035
|
+
function _ts_metadata74(k, v) {
|
|
16905
17036
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16906
17037
|
}
|
|
16907
|
-
__name(
|
|
17038
|
+
__name(_ts_metadata74, "_ts_metadata");
|
|
16908
17039
|
var RegisterStartDto = class {
|
|
16909
17040
|
static {
|
|
16910
17041
|
__name(this, "RegisterStartDto");
|
|
@@ -16923,78 +17054,78 @@ var RegisterStartDto = class {
|
|
|
16923
17054
|
termsAccepted;
|
|
16924
17055
|
locale;
|
|
16925
17056
|
};
|
|
16926
|
-
|
|
17057
|
+
_ts_decorate95([
|
|
16927
17058
|
(0, import_class_validator17.IsString)(),
|
|
16928
17059
|
(0, import_class_validator17.MinLength)(2),
|
|
16929
17060
|
(0, import_class_validator17.MaxLength)(120),
|
|
16930
|
-
|
|
17061
|
+
_ts_metadata74("design:type", String)
|
|
16931
17062
|
], RegisterStartDto.prototype, "tenantName", void 0);
|
|
16932
|
-
|
|
17063
|
+
_ts_decorate95([
|
|
16933
17064
|
(0, import_class_validator17.IsOptional)(),
|
|
16934
17065
|
(0, import_class_validator17.IsString)(),
|
|
16935
17066
|
(0, import_class_validator17.Matches)(/^[a-z0-9-]+$/, {
|
|
16936
17067
|
message: "tenantSlug may only contain lower-case letters, digits and hyphens."
|
|
16937
17068
|
}),
|
|
16938
17069
|
(0, import_class_validator17.MaxLength)(60),
|
|
16939
|
-
|
|
17070
|
+
_ts_metadata74("design:type", String)
|
|
16940
17071
|
], RegisterStartDto.prototype, "tenantSlug", void 0);
|
|
16941
|
-
|
|
17072
|
+
_ts_decorate95([
|
|
16942
17073
|
(0, import_class_validator17.IsOptional)(),
|
|
16943
17074
|
(0, import_class_validator17.IsString)(),
|
|
16944
17075
|
(0, import_class_validator17.MaxLength)(40),
|
|
16945
|
-
|
|
17076
|
+
_ts_metadata74("design:type", String)
|
|
16946
17077
|
], RegisterStartDto.prototype, "salutation", void 0);
|
|
16947
|
-
|
|
17078
|
+
_ts_decorate95([
|
|
16948
17079
|
(0, import_class_validator17.IsString)(),
|
|
16949
17080
|
(0, import_class_validator17.MinLength)(1),
|
|
16950
17081
|
(0, import_class_validator17.MaxLength)(60),
|
|
16951
|
-
|
|
17082
|
+
_ts_metadata74("design:type", String)
|
|
16952
17083
|
], RegisterStartDto.prototype, "firstName", void 0);
|
|
16953
|
-
|
|
17084
|
+
_ts_decorate95([
|
|
16954
17085
|
(0, import_class_validator17.IsString)(),
|
|
16955
17086
|
(0, import_class_validator17.MinLength)(1),
|
|
16956
17087
|
(0, import_class_validator17.MaxLength)(60),
|
|
16957
|
-
|
|
17088
|
+
_ts_metadata74("design:type", String)
|
|
16958
17089
|
], RegisterStartDto.prototype, "lastName", void 0);
|
|
16959
|
-
|
|
17090
|
+
_ts_decorate95([
|
|
16960
17091
|
(0, import_class_validator17.IsEmail)(),
|
|
16961
17092
|
(0, import_class_validator17.MaxLength)(160),
|
|
16962
|
-
|
|
17093
|
+
_ts_metadata74("design:type", String)
|
|
16963
17094
|
], RegisterStartDto.prototype, "email", void 0);
|
|
16964
|
-
|
|
17095
|
+
_ts_decorate95([
|
|
16965
17096
|
(0, import_class_validator17.IsString)(),
|
|
16966
17097
|
(0, import_class_validator17.MinLength)(8),
|
|
16967
17098
|
(0, import_class_validator17.MaxLength)(160),
|
|
16968
|
-
|
|
17099
|
+
_ts_metadata74("design:type", String)
|
|
16969
17100
|
], RegisterStartDto.prototype, "password", void 0);
|
|
16970
|
-
|
|
17101
|
+
_ts_decorate95([
|
|
16971
17102
|
(0, import_class_validator17.Equals)(true, {
|
|
16972
17103
|
message: "The terms of service, privacy policy and data processing agreement must be accepted."
|
|
16973
17104
|
}),
|
|
16974
|
-
|
|
17105
|
+
_ts_metadata74("design:type", Boolean)
|
|
16975
17106
|
], RegisterStartDto.prototype, "termsAccepted", void 0);
|
|
16976
|
-
|
|
17107
|
+
_ts_decorate95([
|
|
16977
17108
|
(0, import_class_validator17.IsOptional)(),
|
|
16978
17109
|
(0, import_class_validator17.IsIn)([
|
|
16979
17110
|
"de",
|
|
16980
17111
|
"tr"
|
|
16981
17112
|
]),
|
|
16982
|
-
|
|
17113
|
+
_ts_metadata74("design:type", String)
|
|
16983
17114
|
], RegisterStartDto.prototype, "locale", void 0);
|
|
16984
17115
|
|
|
16985
17116
|
// src/registration/dto/verify-registration-otp.dto.ts
|
|
16986
17117
|
var import_class_validator18 = require("class-validator");
|
|
16987
|
-
function
|
|
17118
|
+
function _ts_decorate96(decorators, target, key, desc) {
|
|
16988
17119
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16989
17120
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16990
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;
|
|
16991
17122
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16992
17123
|
}
|
|
16993
|
-
__name(
|
|
16994
|
-
function
|
|
17124
|
+
__name(_ts_decorate96, "_ts_decorate");
|
|
17125
|
+
function _ts_metadata75(k, v) {
|
|
16995
17126
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16996
17127
|
}
|
|
16997
|
-
__name(
|
|
17128
|
+
__name(_ts_metadata75, "_ts_metadata");
|
|
16998
17129
|
var VerifyRegistrationOtpDto = class {
|
|
16999
17130
|
static {
|
|
17000
17131
|
__name(this, "VerifyRegistrationOtpDto");
|
|
@@ -17002,55 +17133,55 @@ var VerifyRegistrationOtpDto = class {
|
|
|
17002
17133
|
email;
|
|
17003
17134
|
otp;
|
|
17004
17135
|
};
|
|
17005
|
-
|
|
17136
|
+
_ts_decorate96([
|
|
17006
17137
|
(0, import_class_validator18.IsEmail)(),
|
|
17007
|
-
|
|
17138
|
+
_ts_metadata75("design:type", String)
|
|
17008
17139
|
], VerifyRegistrationOtpDto.prototype, "email", void 0);
|
|
17009
|
-
|
|
17140
|
+
_ts_decorate96([
|
|
17010
17141
|
(0, import_class_validator18.IsString)(),
|
|
17011
17142
|
(0, import_class_validator18.Matches)(/^\d{6}$/, {
|
|
17012
17143
|
message: "The OTP must be 6 digits."
|
|
17013
17144
|
}),
|
|
17014
|
-
|
|
17145
|
+
_ts_metadata75("design:type", String)
|
|
17015
17146
|
], VerifyRegistrationOtpDto.prototype, "otp", void 0);
|
|
17016
17147
|
|
|
17017
17148
|
// src/registration/dto/resend-registration-otp.dto.ts
|
|
17018
17149
|
var import_class_validator19 = require("class-validator");
|
|
17019
|
-
function
|
|
17150
|
+
function _ts_decorate97(decorators, target, key, desc) {
|
|
17020
17151
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17021
17152
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17022
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;
|
|
17023
17154
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17024
17155
|
}
|
|
17025
|
-
__name(
|
|
17026
|
-
function
|
|
17156
|
+
__name(_ts_decorate97, "_ts_decorate");
|
|
17157
|
+
function _ts_metadata76(k, v) {
|
|
17027
17158
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17028
17159
|
}
|
|
17029
|
-
__name(
|
|
17160
|
+
__name(_ts_metadata76, "_ts_metadata");
|
|
17030
17161
|
var ResendRegistrationOtpDto = class {
|
|
17031
17162
|
static {
|
|
17032
17163
|
__name(this, "ResendRegistrationOtpDto");
|
|
17033
17164
|
}
|
|
17034
17165
|
email;
|
|
17035
17166
|
};
|
|
17036
|
-
|
|
17167
|
+
_ts_decorate97([
|
|
17037
17168
|
(0, import_class_validator19.IsEmail)(),
|
|
17038
|
-
|
|
17169
|
+
_ts_metadata76("design:type", String)
|
|
17039
17170
|
], ResendRegistrationOtpDto.prototype, "email", void 0);
|
|
17040
17171
|
|
|
17041
17172
|
// src/registration/dto/select-plan.dto.ts
|
|
17042
17173
|
var import_class_validator20 = require("class-validator");
|
|
17043
|
-
function
|
|
17174
|
+
function _ts_decorate98(decorators, target, key, desc) {
|
|
17044
17175
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17045
17176
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17046
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;
|
|
17047
17178
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17048
17179
|
}
|
|
17049
|
-
__name(
|
|
17050
|
-
function
|
|
17180
|
+
__name(_ts_decorate98, "_ts_decorate");
|
|
17181
|
+
function _ts_metadata77(k, v) {
|
|
17051
17182
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17052
17183
|
}
|
|
17053
|
-
__name(
|
|
17184
|
+
__name(_ts_metadata77, "_ts_metadata");
|
|
17054
17185
|
var SelectRegistrationPlanDto = class {
|
|
17055
17186
|
static {
|
|
17056
17187
|
__name(this, "SelectRegistrationPlanDto");
|
|
@@ -17058,32 +17189,32 @@ var SelectRegistrationPlanDto = class {
|
|
|
17058
17189
|
pendingRegistrationId;
|
|
17059
17190
|
planId;
|
|
17060
17191
|
};
|
|
17061
|
-
|
|
17192
|
+
_ts_decorate98([
|
|
17062
17193
|
(0, import_class_validator20.IsString)(),
|
|
17063
17194
|
(0, import_class_validator20.MinLength)(1),
|
|
17064
17195
|
(0, import_class_validator20.MaxLength)(80),
|
|
17065
|
-
|
|
17196
|
+
_ts_metadata77("design:type", String)
|
|
17066
17197
|
], SelectRegistrationPlanDto.prototype, "pendingRegistrationId", void 0);
|
|
17067
|
-
|
|
17198
|
+
_ts_decorate98([
|
|
17068
17199
|
(0, import_class_validator20.IsString)(),
|
|
17069
17200
|
(0, import_class_validator20.MinLength)(1),
|
|
17070
17201
|
(0, import_class_validator20.MaxLength)(40),
|
|
17071
|
-
|
|
17202
|
+
_ts_metadata77("design:type", String)
|
|
17072
17203
|
], SelectRegistrationPlanDto.prototype, "planId", void 0);
|
|
17073
17204
|
|
|
17074
17205
|
// src/registration/dto/start-checkout.dto.ts
|
|
17075
17206
|
var import_class_validator21 = require("class-validator");
|
|
17076
|
-
function
|
|
17207
|
+
function _ts_decorate99(decorators, target, key, desc) {
|
|
17077
17208
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17078
17209
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17079
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;
|
|
17080
17211
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17081
17212
|
}
|
|
17082
|
-
__name(
|
|
17083
|
-
function
|
|
17213
|
+
__name(_ts_decorate99, "_ts_decorate");
|
|
17214
|
+
function _ts_metadata78(k, v) {
|
|
17084
17215
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17085
17216
|
}
|
|
17086
|
-
__name(
|
|
17217
|
+
__name(_ts_metadata78, "_ts_metadata");
|
|
17087
17218
|
var StartRegistrationCheckoutDto = class {
|
|
17088
17219
|
static {
|
|
17089
17220
|
__name(this, "StartRegistrationCheckoutDto");
|
|
@@ -17092,40 +17223,40 @@ var StartRegistrationCheckoutDto = class {
|
|
|
17092
17223
|
successUrl;
|
|
17093
17224
|
cancelUrl;
|
|
17094
17225
|
};
|
|
17095
|
-
|
|
17226
|
+
_ts_decorate99([
|
|
17096
17227
|
(0, import_class_validator21.IsString)(),
|
|
17097
17228
|
(0, import_class_validator21.MinLength)(1),
|
|
17098
17229
|
(0, import_class_validator21.MaxLength)(80),
|
|
17099
|
-
|
|
17230
|
+
_ts_metadata78("design:type", String)
|
|
17100
17231
|
], StartRegistrationCheckoutDto.prototype, "pendingRegistrationId", void 0);
|
|
17101
|
-
|
|
17232
|
+
_ts_decorate99([
|
|
17102
17233
|
(0, import_class_validator21.IsUrl)({
|
|
17103
17234
|
require_tld: false
|
|
17104
17235
|
}),
|
|
17105
17236
|
(0, import_class_validator21.MaxLength)(500),
|
|
17106
|
-
|
|
17237
|
+
_ts_metadata78("design:type", String)
|
|
17107
17238
|
], StartRegistrationCheckoutDto.prototype, "successUrl", void 0);
|
|
17108
|
-
|
|
17239
|
+
_ts_decorate99([
|
|
17109
17240
|
(0, import_class_validator21.IsUrl)({
|
|
17110
17241
|
require_tld: false
|
|
17111
17242
|
}),
|
|
17112
17243
|
(0, import_class_validator21.MaxLength)(500),
|
|
17113
|
-
|
|
17244
|
+
_ts_metadata78("design:type", String)
|
|
17114
17245
|
], StartRegistrationCheckoutDto.prototype, "cancelUrl", void 0);
|
|
17115
17246
|
|
|
17116
17247
|
// src/registration/dto/payment-webhook.dto.ts
|
|
17117
17248
|
var import_class_validator22 = require("class-validator");
|
|
17118
|
-
function
|
|
17249
|
+
function _ts_decorate100(decorators, target, key, desc) {
|
|
17119
17250
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17120
17251
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17121
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;
|
|
17122
17253
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17123
17254
|
}
|
|
17124
|
-
__name(
|
|
17125
|
-
function
|
|
17255
|
+
__name(_ts_decorate100, "_ts_decorate");
|
|
17256
|
+
function _ts_metadata79(k, v) {
|
|
17126
17257
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17127
17258
|
}
|
|
17128
|
-
__name(
|
|
17259
|
+
__name(_ts_metadata79, "_ts_metadata");
|
|
17129
17260
|
var PaymentWebhookDto = class {
|
|
17130
17261
|
static {
|
|
17131
17262
|
__name(this, "PaymentWebhookDto");
|
|
@@ -17136,76 +17267,76 @@ var PaymentWebhookDto = class {
|
|
|
17136
17267
|
status;
|
|
17137
17268
|
payload;
|
|
17138
17269
|
};
|
|
17139
|
-
|
|
17270
|
+
_ts_decorate100([
|
|
17140
17271
|
(0, import_class_validator22.IsString)(),
|
|
17141
17272
|
(0, import_class_validator22.MinLength)(1),
|
|
17142
17273
|
(0, import_class_validator22.MaxLength)(120),
|
|
17143
|
-
|
|
17274
|
+
_ts_metadata79("design:type", String)
|
|
17144
17275
|
], PaymentWebhookDto.prototype, "eventId", void 0);
|
|
17145
|
-
|
|
17276
|
+
_ts_decorate100([
|
|
17146
17277
|
(0, import_class_validator22.IsOptional)(),
|
|
17147
17278
|
(0, import_class_validator22.IsString)(),
|
|
17148
17279
|
(0, import_class_validator22.MaxLength)(120),
|
|
17149
|
-
|
|
17280
|
+
_ts_metadata79("design:type", String)
|
|
17150
17281
|
], PaymentWebhookDto.prototype, "sessionId", void 0);
|
|
17151
|
-
|
|
17282
|
+
_ts_decorate100([
|
|
17152
17283
|
(0, import_class_validator22.IsString)(),
|
|
17153
17284
|
(0, import_class_validator22.MaxLength)(40),
|
|
17154
|
-
|
|
17285
|
+
_ts_metadata79("design:type", String)
|
|
17155
17286
|
], PaymentWebhookDto.prototype, "provider", void 0);
|
|
17156
|
-
|
|
17287
|
+
_ts_decorate100([
|
|
17157
17288
|
(0, import_class_validator22.IsIn)([
|
|
17158
17289
|
"SUCCEEDED",
|
|
17159
17290
|
"FAILED"
|
|
17160
17291
|
]),
|
|
17161
|
-
|
|
17292
|
+
_ts_metadata79("design:type", String)
|
|
17162
17293
|
], PaymentWebhookDto.prototype, "status", void 0);
|
|
17163
|
-
|
|
17294
|
+
_ts_decorate100([
|
|
17164
17295
|
(0, import_class_validator22.IsOptional)(),
|
|
17165
17296
|
(0, import_class_validator22.IsObject)(),
|
|
17166
|
-
|
|
17297
|
+
_ts_metadata79("design:type", typeof Record === "undefined" ? Object : Record)
|
|
17167
17298
|
], PaymentWebhookDto.prototype, "payload", void 0);
|
|
17168
17299
|
|
|
17169
17300
|
// src/registration/dto/continue-registration.dto.ts
|
|
17170
17301
|
var import_class_validator23 = require("class-validator");
|
|
17171
|
-
function
|
|
17302
|
+
function _ts_decorate101(decorators, target, key, desc) {
|
|
17172
17303
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17173
17304
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17174
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;
|
|
17175
17306
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17176
17307
|
}
|
|
17177
|
-
__name(
|
|
17178
|
-
function
|
|
17308
|
+
__name(_ts_decorate101, "_ts_decorate");
|
|
17309
|
+
function _ts_metadata80(k, v) {
|
|
17179
17310
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17180
17311
|
}
|
|
17181
|
-
__name(
|
|
17312
|
+
__name(_ts_metadata80, "_ts_metadata");
|
|
17182
17313
|
var ContinueRegistrationDto = class {
|
|
17183
17314
|
static {
|
|
17184
17315
|
__name(this, "ContinueRegistrationDto");
|
|
17185
17316
|
}
|
|
17186
17317
|
token;
|
|
17187
17318
|
};
|
|
17188
|
-
|
|
17319
|
+
_ts_decorate101([
|
|
17189
17320
|
(0, import_class_validator23.IsString)(),
|
|
17190
17321
|
(0, import_class_validator23.MinLength)(10),
|
|
17191
17322
|
(0, import_class_validator23.MaxLength)(2e3),
|
|
17192
|
-
|
|
17323
|
+
_ts_metadata80("design:type", String)
|
|
17193
17324
|
], ContinueRegistrationDto.prototype, "token", void 0);
|
|
17194
17325
|
|
|
17195
17326
|
// src/registration/dto/save-configuration.dto.ts
|
|
17196
17327
|
var import_class_validator24 = require("class-validator");
|
|
17197
17328
|
var import_class_transformer2 = require("class-transformer");
|
|
17198
|
-
function
|
|
17329
|
+
function _ts_decorate102(decorators, target, key, desc) {
|
|
17199
17330
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17200
17331
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17201
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;
|
|
17202
17333
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17203
17334
|
}
|
|
17204
|
-
__name(
|
|
17205
|
-
function
|
|
17335
|
+
__name(_ts_decorate102, "_ts_decorate");
|
|
17336
|
+
function _ts_metadata81(k, v) {
|
|
17206
17337
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17207
17338
|
}
|
|
17208
|
-
__name(
|
|
17339
|
+
__name(_ts_metadata81, "_ts_metadata");
|
|
17209
17340
|
var SaveRegistrationConfigSelectionDto = class {
|
|
17210
17341
|
static {
|
|
17211
17342
|
__name(this, "SaveRegistrationConfigSelectionDto");
|
|
@@ -17214,7 +17345,7 @@ var SaveRegistrationConfigSelectionDto = class {
|
|
|
17214
17345
|
billingCycle;
|
|
17215
17346
|
appliedPromoCode;
|
|
17216
17347
|
/**
|
|
17217
|
-
*
|
|
17348
|
+
* — Bundle consistency. ID of the `CheckoutOffer` that was
|
|
17218
17349
|
* created on the pricing page (`<app>/register?offer=<id>`). Passed
|
|
17219
17350
|
* through unchanged in `configJson`; the ActivationOrchestrator freezes it
|
|
17220
17351
|
* as `packageSnapshot` when the subscription is created and sets the offer
|
|
@@ -17222,30 +17353,30 @@ var SaveRegistrationConfigSelectionDto = class {
|
|
|
17222
17353
|
*/
|
|
17223
17354
|
offerId;
|
|
17224
17355
|
};
|
|
17225
|
-
|
|
17356
|
+
_ts_decorate102([
|
|
17226
17357
|
(0, import_class_validator24.IsString)(),
|
|
17227
17358
|
(0, import_class_validator24.MinLength)(1),
|
|
17228
17359
|
(0, import_class_validator24.MaxLength)(40),
|
|
17229
|
-
|
|
17360
|
+
_ts_metadata81("design:type", String)
|
|
17230
17361
|
], SaveRegistrationConfigSelectionDto.prototype, "modelId", void 0);
|
|
17231
|
-
|
|
17362
|
+
_ts_decorate102([
|
|
17232
17363
|
(0, import_class_validator24.IsIn)([
|
|
17233
17364
|
"MONTHLY",
|
|
17234
17365
|
"YEARLY"
|
|
17235
17366
|
]),
|
|
17236
|
-
|
|
17367
|
+
_ts_metadata81("design:type", String)
|
|
17237
17368
|
], SaveRegistrationConfigSelectionDto.prototype, "billingCycle", void 0);
|
|
17238
|
-
|
|
17369
|
+
_ts_decorate102([
|
|
17239
17370
|
(0, import_class_validator24.IsOptional)(),
|
|
17240
17371
|
(0, import_class_validator24.IsString)(),
|
|
17241
17372
|
(0, import_class_validator24.MaxLength)(60),
|
|
17242
|
-
|
|
17373
|
+
_ts_metadata81("design:type", Object)
|
|
17243
17374
|
], SaveRegistrationConfigSelectionDto.prototype, "appliedPromoCode", void 0);
|
|
17244
|
-
|
|
17375
|
+
_ts_decorate102([
|
|
17245
17376
|
(0, import_class_validator24.IsOptional)(),
|
|
17246
17377
|
(0, import_class_validator24.ValidateIf)((_o, value) => value !== null),
|
|
17247
17378
|
(0, import_class_validator24.IsUUID)(),
|
|
17248
|
-
|
|
17379
|
+
_ts_metadata81("design:type", Object)
|
|
17249
17380
|
], SaveRegistrationConfigSelectionDto.prototype, "offerId", void 0);
|
|
17250
17381
|
var SaveRegistrationConfigDto = class {
|
|
17251
17382
|
static {
|
|
@@ -17254,31 +17385,31 @@ var SaveRegistrationConfigDto = class {
|
|
|
17254
17385
|
pendingRegistrationId;
|
|
17255
17386
|
selection;
|
|
17256
17387
|
};
|
|
17257
|
-
|
|
17388
|
+
_ts_decorate102([
|
|
17258
17389
|
(0, import_class_validator24.IsString)(),
|
|
17259
17390
|
(0, import_class_validator24.MinLength)(1),
|
|
17260
17391
|
(0, import_class_validator24.MaxLength)(80),
|
|
17261
|
-
|
|
17392
|
+
_ts_metadata81("design:type", String)
|
|
17262
17393
|
], SaveRegistrationConfigDto.prototype, "pendingRegistrationId", void 0);
|
|
17263
|
-
|
|
17394
|
+
_ts_decorate102([
|
|
17264
17395
|
(0, import_class_validator24.ValidateNested)(),
|
|
17265
17396
|
(0, import_class_transformer2.Type)(() => SaveRegistrationConfigSelectionDto),
|
|
17266
|
-
|
|
17397
|
+
_ts_metadata81("design:type", typeof SaveRegistrationConfigSelectionDto === "undefined" ? Object : SaveRegistrationConfigSelectionDto)
|
|
17267
17398
|
], SaveRegistrationConfigDto.prototype, "selection", void 0);
|
|
17268
17399
|
|
|
17269
17400
|
// src/registration/dto/preview-promo.dto.ts
|
|
17270
17401
|
var import_class_validator25 = require("class-validator");
|
|
17271
|
-
function
|
|
17402
|
+
function _ts_decorate103(decorators, target, key, desc) {
|
|
17272
17403
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17273
17404
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17274
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;
|
|
17275
17406
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17276
17407
|
}
|
|
17277
|
-
__name(
|
|
17278
|
-
function
|
|
17408
|
+
__name(_ts_decorate103, "_ts_decorate");
|
|
17409
|
+
function _ts_metadata82(k, v) {
|
|
17279
17410
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17280
17411
|
}
|
|
17281
|
-
__name(
|
|
17412
|
+
__name(_ts_metadata82, "_ts_metadata");
|
|
17282
17413
|
var PreviewRegistrationPromoDto = class {
|
|
17283
17414
|
static {
|
|
17284
17415
|
__name(this, "PreviewRegistrationPromoDto");
|
|
@@ -17286,17 +17417,17 @@ var PreviewRegistrationPromoDto = class {
|
|
|
17286
17417
|
pendingRegistrationId;
|
|
17287
17418
|
code;
|
|
17288
17419
|
};
|
|
17289
|
-
|
|
17420
|
+
_ts_decorate103([
|
|
17290
17421
|
(0, import_class_validator25.IsString)(),
|
|
17291
17422
|
(0, import_class_validator25.MinLength)(1),
|
|
17292
17423
|
(0, import_class_validator25.MaxLength)(80),
|
|
17293
|
-
|
|
17424
|
+
_ts_metadata82("design:type", String)
|
|
17294
17425
|
], PreviewRegistrationPromoDto.prototype, "pendingRegistrationId", void 0);
|
|
17295
|
-
|
|
17426
|
+
_ts_decorate103([
|
|
17296
17427
|
(0, import_class_validator25.IsOptional)(),
|
|
17297
17428
|
(0, import_class_validator25.IsString)(),
|
|
17298
17429
|
(0, import_class_validator25.MaxLength)(60),
|
|
17299
|
-
|
|
17430
|
+
_ts_metadata82("design:type", String)
|
|
17300
17431
|
], PreviewRegistrationPromoDto.prototype, "code", void 0);
|
|
17301
17432
|
|
|
17302
17433
|
// src/index.ts
|
|
@@ -17365,6 +17496,7 @@ __export(src_exports, {
|
|
|
17365
17496
|
EntitlementModule: () => EntitlementModule,
|
|
17366
17497
|
EntitlementService: () => EntitlementService,
|
|
17367
17498
|
FEATURE_GUARD_CONFIG_TOKEN: () => FEATURE_GUARD_CONFIG_TOKEN,
|
|
17499
|
+
FEATURE_GUARD_MARKER: () => FEATURE_GUARD_MARKER,
|
|
17368
17500
|
FEATURE_UI_REGISTRY_TOKEN: () => FEATURE_UI_REGISTRY_TOKEN2,
|
|
17369
17501
|
FeatureGuard: () => FeatureGuard,
|
|
17370
17502
|
IMPLEMENTS_CAPABILITY_KEY: () => IMPLEMENTS_CAPABILITY_KEY,
|
|
@@ -17583,6 +17715,7 @@ __export(src_exports, {
|
|
|
17583
17715
|
isFeatureInPlan: () => isFeatureInPlan,
|
|
17584
17716
|
isFeaturePlannedOnly: () => isFeaturePlannedOnly,
|
|
17585
17717
|
isLimitExceededError: () => isLimitExceededError,
|
|
17718
|
+
isPlatformFeatureGuard: () => isPlatformFeatureGuard,
|
|
17586
17719
|
isSaaSiCatPublicRoute: () => isSaaSiCatPublicRoute,
|
|
17587
17720
|
loadApprovedCatalogKeys: () => loadApprovedCatalogKeys,
|
|
17588
17721
|
loadDiscoverySnapshotFromFile: () => loadDiscoverySnapshotFromFile,
|
|
@@ -18354,7 +18487,7 @@ var FakePlanRepository = class {
|
|
|
18354
18487
|
if (v.planId === existing.planKey) this.versions.delete(id);
|
|
18355
18488
|
}
|
|
18356
18489
|
}
|
|
18357
|
-
// ─── Lifecycle
|
|
18490
|
+
// ─── Lifecycle ───
|
|
18358
18491
|
// Binding Plan ↔ PlanVersion: PlanVersion.planId === Plan.planKey
|
|
18359
18492
|
// (soft string reference). Lifecycle methods take planKey
|
|
18360
18493
|
// as input — the service resolves the plan UUID beforehand.
|
|
@@ -18524,14 +18657,14 @@ var FakePlanRepository = class {
|
|
|
18524
18657
|
};
|
|
18525
18658
|
|
|
18526
18659
|
// src/testing/create-saas-platform-test-module.ts
|
|
18527
|
-
var
|
|
18528
|
-
function
|
|
18660
|
+
var import_common85 = require("@nestjs/common");
|
|
18661
|
+
function _ts_decorate104(decorators, target, key, desc) {
|
|
18529
18662
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18530
18663
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18531
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;
|
|
18532
18665
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18533
18666
|
}
|
|
18534
|
-
__name(
|
|
18667
|
+
__name(_ts_decorate104, "_ts_decorate");
|
|
18535
18668
|
var StubMfaPort = class {
|
|
18536
18669
|
static {
|
|
18537
18670
|
__name(this, "StubMfaPort");
|
|
@@ -18572,8 +18705,8 @@ function createSaasPlatformTestModule(options) {
|
|
|
18572
18705
|
__name(this, "SaasPlatformTestHost");
|
|
18573
18706
|
}
|
|
18574
18707
|
};
|
|
18575
|
-
SaasPlatformTestHost =
|
|
18576
|
-
(0,
|
|
18708
|
+
SaasPlatformTestHost = _ts_decorate104([
|
|
18709
|
+
(0, import_common85.Module)({
|
|
18577
18710
|
imports: [
|
|
18578
18711
|
SaasPlatformModule.forRoot({
|
|
18579
18712
|
planCatalog: options.planCatalog,
|