@saasicat/nest 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_entries.cjs +337 -376
- package/dist/admin/index.js +2 -1
- package/dist/billing/index.d.cts +7 -6
- package/dist/billing/index.d.ts +7 -6
- package/dist/billing/index.js +4 -3
- package/dist/catalog/index.js +2 -2
- package/dist/checkout-offer/index.js +1 -1
- package/dist/{chunk-6WA4X5U3.js → chunk-3DRZ5GCP.js} +40 -90
- package/dist/{chunk-EUU3B6NB.js → chunk-4O6R6ARQ.js} +12 -6
- package/dist/{chunk-AFK2IE2L.js → chunk-55QGAZRQ.js} +1 -1
- package/dist/{chunk-F6DCLVBB.js → chunk-AGOG5B77.js} +8 -2
- package/dist/chunk-EBJJNTW6.js +22 -0
- package/dist/{chunk-7JIHG53V.js → chunk-FYWLPYBK.js} +4 -1
- package/dist/{chunk-LXUBCLRK.js → chunk-GC5AKN44.js} +9 -8
- package/dist/{chunk-I77VS3YH.js → chunk-NZLAYCEX.js} +16 -22
- package/dist/{chunk-QLJHIIOY.js → chunk-VQQWF7MW.js} +7 -3
- package/dist/{chunk-ORWIGSNN.js → chunk-XTVAFJ3P.js} +2 -1
- package/dist/{chunk-KUDKD7ZG.js → chunk-ZH5PYEMI.js} +19 -21
- package/dist/{define-saasicat-CqkhnHn-.d.ts → define-saasicat-B20Ms8UC.d.ts} +1 -1
- package/dist/{define-saasicat-D8c6Bs4T.d.cts → define-saasicat-Cf9DpEsY.d.cts} +1 -1
- package/dist/{enforce-quota.interceptor-Dp8wTYro.d.ts → enforce-quota.interceptor-CUyfR4cQ.d.ts} +1 -1
- package/dist/{enforce-quota.interceptor-Dk0eEtzV.d.cts → enforce-quota.interceptor-Dtg5WdFj.d.cts} +1 -1
- package/dist/entitlement/index.js +2 -1
- package/dist/index.d.cts +27 -8
- package/dist/index.d.ts +27 -8
- package/dist/index.js +14 -10
- package/dist/{module-BwD-wAor.d.ts → module-BE17XFLg.d.ts} +1 -1
- package/dist/{module-DsDkbawm.d.cts → module-CHMIyWlf.d.cts} +1 -1
- package/dist/platform/index.d.cts +8 -8
- package/dist/platform/index.d.ts +8 -8
- package/dist/platform/index.js +9 -8
- package/dist/promo/index.d.cts +3 -3
- package/dist/promo/index.d.ts +3 -3
- package/dist/promo/index.js +3 -2
- package/dist/registration/index.js +2 -1
- package/dist/{saas-platform.module-DducnQ9s.d.cts → saas-platform.module-BfaYfL-G.d.cts} +1 -1
- package/dist/{saas-platform.module-BQmrDGVU.d.ts → saas-platform.module-DChhDrR-.d.ts} +1 -1
- package/dist/{service-DPZ2W1E-.d.ts → service-D48clObR.d.cts} +1 -1
- package/dist/{service-DPZ2W1E-.d.cts → service-D48clObR.d.ts} +1 -1
- package/dist/{tenant-billing.controller-m42YQ_Ei.d.cts → tenant-billing.controller-BIF-mstX.d.cts} +1 -1
- package/dist/{tenant-billing.controller-b1G1yB09.d.ts → tenant-billing.controller-DT5UrnDX.d.ts} +1 -1
- package/dist/testing/index.d.cts +5 -5
- package/dist/testing/index.d.ts +5 -5
- package/dist/testing/index.js +9 -8
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromoCodesService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VQQWF7MW.js";
|
|
4
4
|
import {
|
|
5
5
|
SubscriptionContractService
|
|
6
6
|
} from "./chunk-B7NRY2LV.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN,
|
|
29
29
|
isLimitExceededError,
|
|
30
30
|
toEffectiveLimitsSnapshot
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-AGOG5B77.js";
|
|
32
32
|
import {
|
|
33
33
|
PLAN_CATALOG_TOKEN,
|
|
34
34
|
findPlan,
|
|
@@ -38,6 +38,9 @@ import {
|
|
|
38
38
|
import {
|
|
39
39
|
SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
|
|
40
40
|
} from "./chunk-NYLON2VC.js";
|
|
41
|
+
import {
|
|
42
|
+
codedError
|
|
43
|
+
} from "./chunk-EBJJNTW6.js";
|
|
41
44
|
import {
|
|
42
45
|
ENTITLEMENT_SERVICE_TOKEN
|
|
43
46
|
} from "./chunk-WKVBNTYC.js";
|
|
@@ -253,10 +256,11 @@ var FeatureGuard = class _FeatureGuard {
|
|
|
253
256
|
return true;
|
|
254
257
|
}
|
|
255
258
|
/**
|
|
256
|
-
* Upsell response (#36):
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* `
|
|
259
|
+
* Upsell response (#36): the 403 body is always the full
|
|
260
|
+
* `FeatureNotLicensedBody`, so a consumer that matches on `code` can read
|
|
261
|
+
* `featureKey`/`offers` unconditionally. Without a registered
|
|
262
|
+
* `UpsellOfferResolver` there is simply nothing to offer — `offers` is
|
|
263
|
+
* empty, the same degradation a failing resolver produces.
|
|
260
264
|
*
|
|
261
265
|
* Deliberately 403 + `code` field instead of 402 — rationale in
|
|
262
266
|
* `@saasicat/types` upsell.types.ts (402 is reserved / inconsistently
|
|
@@ -267,22 +271,12 @@ var FeatureGuard = class _FeatureGuard {
|
|
|
267
271
|
* classify the response by that prefix.
|
|
268
272
|
*/
|
|
269
273
|
async buildNotLicensedException(required, tenantId) {
|
|
270
|
-
const message = `Feature ${required.join(" / ")} is not included in the current plan.`;
|
|
271
|
-
if (!this.upsellResolver) {
|
|
272
|
-
return new ForbiddenException({
|
|
273
|
-
code: FEATURE_NOT_LICENSED,
|
|
274
|
-
message,
|
|
275
|
-
params: {
|
|
276
|
-
featureKeys: required
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
274
|
const body = {
|
|
281
275
|
code: FEATURE_NOT_LICENSED,
|
|
282
276
|
featureKey: required[0],
|
|
283
277
|
featureKeys: required,
|
|
284
|
-
offers: await this.resolveOffersSafe(required, tenantId),
|
|
285
|
-
message
|
|
278
|
+
offers: this.upsellResolver ? await this.resolveOffersSafe(required, tenantId) : [],
|
|
279
|
+
message: `Feature ${required.join(" / ")} is not included in the current plan.`
|
|
286
280
|
};
|
|
287
281
|
return new ForbiddenException(body);
|
|
288
282
|
}
|
|
@@ -1912,7 +1906,7 @@ var SubscriptionBundlesService = class {
|
|
|
1912
1906
|
}
|
|
1913
1907
|
if (existing.canceledAt !== null) {
|
|
1914
1908
|
throw new UnprocessableEntityException({
|
|
1915
|
-
code: BILLING_ERROR_CODES3.
|
|
1909
|
+
code: BILLING_ERROR_CODES3.SUBSCRIPTION_BUNDLE_ALREADY_CANCELLED,
|
|
1916
1910
|
message: `SubscriptionBundle '${input.subscriptionBundleId}' is already cancelled.`,
|
|
1917
1911
|
params: {
|
|
1918
1912
|
subscriptionBundleId: input.subscriptionBundleId
|
|
@@ -1947,7 +1941,7 @@ var SubscriptionBundlesService = class {
|
|
|
1947
1941
|
}
|
|
1948
1942
|
if (existing.canceledAt === null) {
|
|
1949
1943
|
throw new UnprocessableEntityException({
|
|
1950
|
-
code: BILLING_ERROR_CODES3.
|
|
1944
|
+
code: BILLING_ERROR_CODES3.SUBSCRIPTION_BUNDLE_NOT_CANCELLED,
|
|
1951
1945
|
message: `SubscriptionBundle '${subscriptionBundleId}' is not cancelled.`,
|
|
1952
1946
|
params: {
|
|
1953
1947
|
subscriptionBundleId
|
|
@@ -2910,7 +2904,7 @@ var SubscriptionBundlePreviewService = class {
|
|
|
2910
2904
|
const warnings = [];
|
|
2911
2905
|
if (existing.canceledAt !== null) {
|
|
2912
2906
|
blockers.push({
|
|
2913
|
-
code:
|
|
2907
|
+
code: BILLING_ERROR_CODES5.SUBSCRIPTION_BUNDLE_ALREADY_CANCELLED,
|
|
2914
2908
|
message: "This bundle booking is already cancelled."
|
|
2915
2909
|
});
|
|
2916
2910
|
}
|
|
@@ -3262,7 +3256,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
|
|
|
3262
3256
|
}
|
|
3263
3257
|
requireSubscriptionPk(sub) {
|
|
3264
3258
|
if (!sub.id) {
|
|
3265
|
-
throw new NotFoundException5(
|
|
3259
|
+
throw new NotFoundException5(codedError(BILLING_ERROR_CODES6.SUBSCRIPTION_PK_MISSING));
|
|
3266
3260
|
}
|
|
3267
3261
|
return sub.id;
|
|
3268
3262
|
}
|
|
@@ -261,7 +261,8 @@ var PromoCodesService = class {
|
|
|
261
261
|
code: PROMO_ERROR_CODES.PROMO_CODE_NOT_FOUND,
|
|
262
262
|
message: "Code not found",
|
|
263
263
|
params: {
|
|
264
|
-
promoCodeId: id
|
|
264
|
+
promoCodeId: id,
|
|
265
|
+
promoCode: null
|
|
265
266
|
}
|
|
266
267
|
});
|
|
267
268
|
}
|
|
@@ -305,7 +306,8 @@ var PromoCodesService = class {
|
|
|
305
306
|
code: PROMO_ERROR_CODES.PROMO_CODE_NOT_FOUND,
|
|
306
307
|
message: "Code not found",
|
|
307
308
|
params: {
|
|
308
|
-
promoCodeId: id
|
|
309
|
+
promoCodeId: id,
|
|
310
|
+
promoCode: null
|
|
309
311
|
}
|
|
310
312
|
});
|
|
311
313
|
}
|
|
@@ -438,8 +440,10 @@ var PromoCodesService = class {
|
|
|
438
440
|
if (!promo || promo.deletedAt) {
|
|
439
441
|
throw new BadRequestException({
|
|
440
442
|
code: PROMO_ERROR_CODES.PROMO_CODE_NOT_FOUND,
|
|
443
|
+
// The lookup runs on the code string, so there is no id to report.
|
|
441
444
|
message: "Code not found",
|
|
442
445
|
params: {
|
|
446
|
+
promoCodeId: null,
|
|
443
447
|
promoCode: code
|
|
444
448
|
}
|
|
445
449
|
});
|
|
@@ -450,7 +454,7 @@ var PromoCodesService = class {
|
|
|
450
454
|
code: BILLING_ERROR_CODES.SUBSCRIPTION_NOT_FOUND,
|
|
451
455
|
message: "Subscription not found",
|
|
452
456
|
params: {
|
|
453
|
-
|
|
457
|
+
tenantId: input.tenantId
|
|
454
458
|
}
|
|
455
459
|
});
|
|
456
460
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromoCodesModule
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4O6R6ARQ.js";
|
|
4
4
|
import {
|
|
5
5
|
AdminManifestModule,
|
|
6
6
|
AdminManifestService,
|
|
@@ -9,22 +9,22 @@ import {
|
|
|
9
9
|
AdminStatsModule,
|
|
10
10
|
MfaService,
|
|
11
11
|
SuperAdminGuard
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FYWLPYBK.js";
|
|
13
13
|
import {
|
|
14
14
|
PublicCatalogModule,
|
|
15
15
|
REQUIRE_FEATURE_KEY,
|
|
16
16
|
SubscriptionBundleModule,
|
|
17
17
|
TenantBillingModule
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NZLAYCEX.js";
|
|
19
19
|
import {
|
|
20
20
|
SubscriptionContractModule
|
|
21
21
|
} from "./chunk-B7NRY2LV.js";
|
|
22
22
|
import {
|
|
23
23
|
CatalogModule
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GC5AKN44.js";
|
|
25
25
|
import {
|
|
26
26
|
CheckoutOfferModule
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-XTVAFJ3P.js";
|
|
28
28
|
import {
|
|
29
29
|
SaaSiCatPublicRoute
|
|
30
30
|
} from "./chunk-YSC46BGM.js";
|
|
@@ -34,11 +34,14 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
EntitlementModule,
|
|
36
36
|
LimitExceededError
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-AGOG5B77.js";
|
|
38
38
|
import {
|
|
39
39
|
PLAN_CATALOG_TOKEN,
|
|
40
40
|
PlanCatalogModule
|
|
41
41
|
} from "./chunk-DQKCK7DX.js";
|
|
42
|
+
import {
|
|
43
|
+
codedError
|
|
44
|
+
} from "./chunk-EBJJNTW6.js";
|
|
42
45
|
import {
|
|
43
46
|
asProvider
|
|
44
47
|
} from "./chunk-SABTXESR.js";
|
|
@@ -105,9 +108,7 @@ var SetupService = class {
|
|
|
105
108
|
await this.assertNoSuperAdmin();
|
|
106
109
|
const email = req.email.trim().toLowerCase();
|
|
107
110
|
if (!email.includes("@")) {
|
|
108
|
-
throw new BadRequestException(
|
|
109
|
-
code: SETUP_ERROR_CODES.INVALID_EMAIL
|
|
110
|
-
});
|
|
111
|
+
throw new BadRequestException(codedError(SETUP_ERROR_CODES.INVALID_EMAIL));
|
|
111
112
|
}
|
|
112
113
|
const generated = !req.password;
|
|
113
114
|
const password = req.password ?? randomBytes(GENERATED_PASSWORD_BYTES).toString("base64url");
|
|
@@ -164,16 +165,12 @@ var SetupService = class {
|
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
167
|
if (!token || !timingSafeEqualStr(token, expected)) {
|
|
167
|
-
throw new UnauthorizedException(
|
|
168
|
-
code: SETUP_ERROR_CODES.INVALID_SETUP_TOKEN
|
|
169
|
-
});
|
|
168
|
+
throw new UnauthorizedException(codedError(SETUP_ERROR_CODES.INVALID_SETUP_TOKEN));
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
171
|
async assertNoSuperAdmin() {
|
|
173
172
|
if (await this.users.countSuperAdmins() > 0) {
|
|
174
|
-
throw new ConflictException(
|
|
175
|
-
code: SETUP_ERROR_CODES.SETUP_ALREADY_DONE
|
|
176
|
-
});
|
|
173
|
+
throw new ConflictException(codedError(SETUP_ERROR_CODES.SETUP_ALREADY_DONE));
|
|
177
174
|
}
|
|
178
175
|
}
|
|
179
176
|
};
|
|
@@ -508,13 +505,14 @@ var StaticFeatureGuard = class {
|
|
|
508
505
|
const snap = await this.entitlements.snapshot(tenantId);
|
|
509
506
|
const allowed = required.some((f) => snap.features.includes(f));
|
|
510
507
|
if (!allowed) {
|
|
511
|
-
|
|
508
|
+
const body = {
|
|
512
509
|
code: FEATURE_NOT_LICENSED,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
}
|
|
510
|
+
featureKey: required[0],
|
|
511
|
+
featureKeys: required,
|
|
512
|
+
offers: [],
|
|
513
|
+
message: `Feature ${required.join(" / ")} is not included in the current plan.`
|
|
514
|
+
};
|
|
515
|
+
throw new ForbiddenException2(body);
|
|
518
516
|
}
|
|
519
517
|
return true;
|
|
520
518
|
}
|
|
@@ -3,7 +3,7 @@ import { ExecutionContext } from '@nestjs/common';
|
|
|
3
3
|
import { Reflector } from '@nestjs/core';
|
|
4
4
|
import { SuperAdminProvisioningPort, SetupStatusResponse, SetupRequest, SetupResult, SetupConfirmMfaRequest, SetupConfirmMfaResponse } from '@saasicat/types';
|
|
5
5
|
import { h as MfaService } from './admin-stats.service-Db2exT_d.js';
|
|
6
|
-
import { f as SaasPlatformModuleOptions } from './saas-platform.module-
|
|
6
|
+
import { f as SaasPlatformModuleOptions } from './saas-platform.module-DChhDrR-.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Shared metadata key for endpoints that intentionally run without application
|
|
@@ -3,7 +3,7 @@ import { ExecutionContext } from '@nestjs/common';
|
|
|
3
3
|
import { Reflector } from '@nestjs/core';
|
|
4
4
|
import { SuperAdminProvisioningPort, SetupStatusResponse, SetupRequest, SetupResult, SetupConfirmMfaRequest, SetupConfirmMfaResponse } from '@saasicat/types';
|
|
5
5
|
import { h as MfaService } from './admin-stats.service-HUZIU448.cjs';
|
|
6
|
-
import { f as SaasPlatformModuleOptions } from './saas-platform.module-
|
|
6
|
+
import { f as SaasPlatformModuleOptions } from './saas-platform.module-BfaYfL-G.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Shared metadata key for endpoints that intentionally run without application
|
package/dist/{enforce-quota.interceptor-Dp8wTYro.d.ts → enforce-quota.interceptor-CUyfR4cQ.d.ts}
RENAMED
|
@@ -2,7 +2,7 @@ import { CanActivate, ExecutionContext, NestInterceptor, CallHandler } from '@ne
|
|
|
2
2
|
import { Reflector } from '@nestjs/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { PlanCatalog, QuotaProvider } from '@saasicat/types';
|
|
5
|
-
import { p as PlanResolverPort } from './saas-platform.module-
|
|
5
|
+
import { p as PlanResolverPort } from './saas-platform.module-DChhDrR-.js';
|
|
6
6
|
|
|
7
7
|
interface StaticEntitlementSnapshot {
|
|
8
8
|
planId: string | null;
|
package/dist/{enforce-quota.interceptor-Dk0eEtzV.d.cts → enforce-quota.interceptor-Dtg5WdFj.d.cts}
RENAMED
|
@@ -2,7 +2,7 @@ import { CanActivate, ExecutionContext, NestInterceptor, CallHandler } from '@ne
|
|
|
2
2
|
import { Reflector } from '@nestjs/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { PlanCatalog, QuotaProvider } from '@saasicat/types';
|
|
5
|
-
import { p as PlanResolverPort } from './saas-platform.module-
|
|
5
|
+
import { p as PlanResolverPort } from './saas-platform.module-BfaYfL-G.cjs';
|
|
6
6
|
|
|
7
7
|
interface StaticEntitlementSnapshot {
|
|
8
8
|
planId: string | null;
|
|
@@ -19,9 +19,10 @@ import {
|
|
|
19
19
|
mergeSubscriptionBundlesIntoLimits,
|
|
20
20
|
resolveEntitlementPlan,
|
|
21
21
|
toEffectiveLimitsSnapshot
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-AGOG5B77.js";
|
|
23
23
|
import "../chunk-DQKCK7DX.js";
|
|
24
24
|
import "../chunk-NYLON2VC.js";
|
|
25
|
+
import "../chunk-EBJJNTW6.js";
|
|
25
26
|
import {
|
|
26
27
|
ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
|
|
27
28
|
ENTITLEMENT_SERVICE_TOKEN,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { P as ProviderSpec, a as asProvider } from './di-CcNeq9v-.cjs';
|
|
2
|
-
import { S as SetupService } from './define-saasicat-
|
|
3
|
-
export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-
|
|
2
|
+
import { S as SetupService } from './define-saasicat-Cf9DpEsY.cjs';
|
|
3
|
+
export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-Cf9DpEsY.cjs';
|
|
4
4
|
export { CreatePromoCodeDto, PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN, PROMO_CODE_REPOSITORY_TOKEN, PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN, PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN, PROMO_REVENUE_DEDUCTION_AGGREGATOR_TOKEN, PROMO_SERVICE_CONFIG_TOKEN, PROMO_SUBSCRIPTION_LOOKUP_TOKEN, PROMO_TRANSACTION_RUNNER_TOKEN, PreviewPromoCodeDto, PromoCodeExpirer, PromoCodeForCalc, PromoCodePublicController, UpdatePromoCodeDto, addCycles, buildLabel, buildPromoCodeAdminController, computeDiscountGross, computeDiscountedGross, computeIncludedVat, computeRegularStartsAt, grossFromNet, round2 } from './promo/index.cjs';
|
|
5
|
-
export {
|
|
5
|
+
export { a as PreviewInput, b as PreviewInvalid, c as PreviewReason, d as PreviewResult, e as PreviewValid, f as PromoCodeStats, g as PromoCodesService, P as PromoServiceConfig, R as RedeemInput } from './service-D48clObR.cjs';
|
|
6
6
|
export { P as PromoCodeRateLimitGuard, h as hashIp, i as ipFingerprint } from './rate-limit.guard-dntqAlfZ.cjs';
|
|
7
|
-
export { P as PromoCodesModule, a as PromoCodesModuleOptions } from './module-
|
|
7
|
+
export { P as PromoCodesModule, a as PromoCodesModuleOptions } from './module-CHMIyWlf.cjs';
|
|
8
8
|
export { AjvErrorLike, CatalogBundleUpsellResolver, ConfiguratorCatalogBuilder, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, FeatureGuardConfig, LimitExceededFilter, LoadPlanCatalogOptions, MarketingFields, NextPeriodWindow, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PeriodRollInput, PlanCatalogBuildSettings, PlanCatalogImportDto, PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, PlanCatalogModuleOptions, PlanCatalogValidationError, PlanResponseEntry, PublicBundleEntry, PublicCatalogController, PublicCatalogModule, PublicCatalogModuleOptions, PublishValidationError, PublishablePlanVersion, REQUIRE_FEATURE_KEY, RenewalDecision, RenewalSubInput, RequireFeature, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SubscriptionContractFreezeService, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead } from './billing/index.cjs';
|
|
9
|
-
import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse } from '@saasicat/types';
|
|
9
|
+
import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse, PlatformErrorCode, PlatformErrorBody } from '@saasicat/types';
|
|
10
10
|
export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
|
|
11
11
|
export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, f as ContractFreezePort, g as ContractFreezeSourcePort, D as DuePendingPlanChange, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver } from './subscription-bundles.module-DCpV-Pb5.cjs';
|
|
12
|
-
export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-
|
|
12
|
+
export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-BIF-mstX.cjs';
|
|
13
13
|
export { C as CustomLimitsShape, E as EffectiveLimits, a as EffectiveLimitsSnapshot, b as EnforceLimitInput, c as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, d as SubscriptionLimitsInput, e as aggregateContractLineItemEntitlements, f as aggregateLimits, g as aggregateSubscriptionBundleQuotas, h as applyCustomLimits, i as collectSubscriptionBundleFeatures, j as contractBundleVersionIds, k as contractLimits, l as filterActiveSubscriptionBundles, m as filterPlannedOnlyFeatures, n as hasAnyFeature, o as hasFeature, p as mergeSubscriptionBundlesIntoLimits, t as toEffectiveLimitsSnapshot } from './aggregation-SKfXu09x.cjs';
|
|
14
14
|
export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, ENTITLEMENT_SERVICE_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.cjs';
|
|
15
15
|
export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CFCoUkrE.cjs';
|
|
@@ -17,7 +17,7 @@ export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT
|
|
|
17
17
|
export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, g as AdminStatsSnapshot, M as MfaGuard, h as MfaService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN, R as REQUIRE_MFA_KEY, i as RequireMfa, S as SuperAdminGuard, T as TotpSetupResult, V as VerifyTotpInput } from './admin-stats.service-HUZIU448.cjs';
|
|
18
18
|
export { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.cjs';
|
|
19
19
|
export { A as ADMIN_MANIFEST_CONFIG, a as ADMIN_RESOURCES_PORT_TOKEN, b as AdminManifestConfig, c as AdminResourcesModule, d as AdminResourcesModuleOptions, e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions, S as SuspendTenantDto } from './admin-resources.module-DGgGSdzN.cjs';
|
|
20
|
-
export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-
|
|
20
|
+
export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-BfaYfL-G.cjs';
|
|
21
21
|
export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PAYMENT_EVENT_LOG_TOKEN, PAYMENT_PROVIDER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PaymentWebhookDto, PendingRegistrationService, PreviewRegistrationPromoDto, PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationCleanupCron, RegistrationModule, RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode } from './registration/index.cjs';
|
|
22
22
|
export { DEFINES_QUOTA_KEY, DISCOVERY_SNAPSHOT_TOKEN, DefinesQuota, DefinesQuotaOptions, DiscoveryControllerConfig, DiscoveryModule, DiscoveryModuleOptions, DiscoverySnapshotNotFoundError, ENFORCE_QUOTA_KEY, EnforceQuota, EnforceQuotaMetadata, EnforceQuotaOptions, HeadlessScanOptions, IMPLEMENTS_CAPABILITY_KEY, ImplementsCapability, ImplementsCapabilityMetadata, ImplementsCapabilityOptions, REQUIRES_CAPABILITY_KEY, RequiresCapability, RequiresCapabilityKeys, buildDiscoveryController, loadDiscoverySnapshotFromFile, runHeadlessDiscoveryScan } from './discovery/index.cjs';
|
|
23
23
|
export { D as DISCOVERY_APP_INFO_TOKEN, a as DISCOVERY_SNAPSHOT_PATH_TOKEN, b as DiscoveryAppInfo, c as DiscoveryScanner, d as computeSnapshotHash } from './discovery.scanner-DLgEvuoy.cjs';
|
|
@@ -53,4 +53,23 @@ declare class SetupController {
|
|
|
53
53
|
confirm(dto: SetupConfirmMfaDto): Promise<SetupConfirmMfaResponse>;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Builds the body of a coded exception.
|
|
58
|
+
*
|
|
59
|
+
* `PlatformErrorBody` declares `message` as required, but a throw site that
|
|
60
|
+
* passes only `{ code }` produces a body without one — NestJS hands an object
|
|
61
|
+
* argument through verbatim. A consumer typing the response then reads
|
|
62
|
+
* `undefined` where a string was promised, and `body.message.includes(...)`
|
|
63
|
+
* throws. Deriving the message from the shipped English catalogue closes that
|
|
64
|
+
* gap, and keeps the fallback text identical to the shipped default by
|
|
65
|
+
* construction.
|
|
66
|
+
*
|
|
67
|
+
* Use it wherever there is no reason to word the message differently from the
|
|
68
|
+
* catalogue:
|
|
69
|
+
*
|
|
70
|
+
* throw new BadRequestException(codedError(REGISTRATION_ERROR_CODES.OTP_INVALID));
|
|
71
|
+
* throw new NotFoundException(codedError(BILLING_ERROR_CODES.TENANT_NOT_FOUND, { slug }));
|
|
72
|
+
*/
|
|
73
|
+
declare function codedError(code: PlatformErrorCode, params?: Record<string, unknown>): PlatformErrorBody;
|
|
74
|
+
|
|
75
|
+
export { SetupController, SetupService, codedError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export { P as ProviderSpec, a as asProvider } from './di-CcNeq9v-.js';
|
|
2
|
-
import { S as SetupService } from './define-saasicat-
|
|
3
|
-
export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-
|
|
2
|
+
import { S as SetupService } from './define-saasicat-B20Ms8UC.js';
|
|
3
|
+
export { a as SAASICAT_PUBLIC_ROUTE_KEY, b as SETUP_CONFIG_TOKEN, c as SETUP_PROVISIONING_PORT_TOKEN, d as SaaSiCatPublicRoute, e as SetupConfig, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from './define-saasicat-B20Ms8UC.js';
|
|
4
4
|
export { CreatePromoCodeDto, PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN, PROMO_CODE_REPOSITORY_TOKEN, PROMO_CODE_VALIDATION_LOG_REPOSITORY_TOKEN, PROMO_FIRST_TIME_CUSTOMER_CHECK_TOKEN, PROMO_REVENUE_DEDUCTION_AGGREGATOR_TOKEN, PROMO_SERVICE_CONFIG_TOKEN, PROMO_SUBSCRIPTION_LOOKUP_TOKEN, PROMO_TRANSACTION_RUNNER_TOKEN, PreviewPromoCodeDto, PromoCodeExpirer, PromoCodeForCalc, PromoCodePublicController, UpdatePromoCodeDto, addCycles, buildLabel, buildPromoCodeAdminController, computeDiscountGross, computeDiscountedGross, computeIncludedVat, computeRegularStartsAt, grossFromNet, round2 } from './promo/index.js';
|
|
5
|
-
export {
|
|
5
|
+
export { a as PreviewInput, b as PreviewInvalid, c as PreviewReason, d as PreviewResult, e as PreviewValid, f as PromoCodeStats, g as PromoCodesService, P as PromoServiceConfig, R as RedeemInput } from './service-D48clObR.js';
|
|
6
6
|
export { P as PromoCodeRateLimitGuard, h as hashIp, i as ipFingerprint } from './rate-limit.guard-dntqAlfZ.js';
|
|
7
|
-
export { P as PromoCodesModule, a as PromoCodesModuleOptions } from './module-
|
|
7
|
+
export { P as PromoCodesModule, a as PromoCodesModuleOptions } from './module-BE17XFLg.js';
|
|
8
8
|
export { AjvErrorLike, CatalogBundleUpsellResolver, ConfiguratorCatalogBuilder, FEATURE_GUARD_CONFIG_TOKEN, FEATURE_UI_REGISTRY_TOKEN, FeatureGuard, FeatureGuardConfig, LimitExceededFilter, LoadPlanCatalogOptions, MarketingFields, NextPeriodWindow, PLAN_CATALOG_IMPORT_SINK_TOKEN, PLAN_CATALOG_READ_SINK_TOKEN, PLAN_CATALOG_TOKEN, PUBLIC_CATALOG_BUNDLE_REPOSITORY_TOKEN, PUBLIC_CATALOG_MARKETING_REPOSITORY_TOKEN, PUBLIC_CATALOG_PROJECT_KEY_TOKEN, PeriodRollInput, PlanCatalogBuildSettings, PlanCatalogImportDto, PlanCatalogImporterControllerConfig, PlanCatalogImporterModule, PlanCatalogImporterModuleOptions, PlanCatalogImporterService, PlanCatalogModule, PlanCatalogModuleOptions, PlanCatalogValidationError, PlanResponseEntry, PublicBundleEntry, PublicCatalogController, PublicCatalogModule, PublicCatalogModuleOptions, PublishValidationError, PublishablePlanVersion, REQUIRE_FEATURE_KEY, RenewalDecision, RenewalSubInput, RequireFeature, SUBSCRIPTION_BUNDLE_CONFIG_TOKEN, SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN, SubscriptionContractFreezeService, UPSELL_OFFER_CURRENCY_TOKEN, UPSELL_OFFER_RESOLVER_TOKEN, assertBaseVersionFresh, assertChangeNote, assertDraftPublishable, assertOptimisticLockHeld, buildPlanCatalogFromSnapshot, buildPlanCatalogImporterController, buildTenantSubscriptionBundlesController, clearPendingPlanVersionFields, computeCarriedTrialEndsAt, computeNextPeriod, decideRenewal, findPlan, getActiveFeatureKeys, getMarketedPlans, getPlanOrThrow, getPlanPriceGross, getPlanPriceNet, getPlanQuota, initialPeriodWindow, isFeatureInPlan, isFeaturePlannedOnly, loadPlanCatalogFromFile, loadPlanCatalogFromString, periodEndAfter, periodEndWithMinLead } from './billing/index.js';
|
|
9
|
-
import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse } from '@saasicat/types';
|
|
9
|
+
import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse, PlatformErrorCode, PlatformErrorBody } from '@saasicat/types';
|
|
10
10
|
export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/types';
|
|
11
11
|
export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CONTRACT_FREEZE_PORT_TOKEN, c as CONTRACT_FREEZE_PROJECT_KEY_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as ContractFreezeBundleSnapshot, f as ContractFreezePort, g as ContractFreezeSourcePort, D as DuePendingPlanChange, P as PENDING_PLAN_QUERY_PORT_TOKEN, h as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, i as SELF_SERVICE_BLOCKED_PLANS_TOKEN, j as SUBSCRIPTION_USAGE_PORT_TOKEN, k as SUBSCRIPTION_WRITE_PORT_TOKEN, l as SelfServiceBlockedBundles, m as SelfServiceBlockedPlans, n as SubscriptionBundleControllerOptions, o as SubscriptionBundleModule, p as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, q as TENANT_ID_RESOLVER_TOKEN, r as TRIAL_PROJECTION_PORT_TOKEN, s as TenantBillingModule, t as TenantBillingModuleOptions, u as TenantIdResolver, v as TrialProjectionInput, w as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, x as USER_EMAIL_RESOLVER_TOKEN, y as USER_ID_RESOLVER_TOKEN, z as UserEmailResolver, B as UserIdResolver } from './subscription-bundles.module-BQmoozm5.js';
|
|
12
|
-
export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-
|
|
12
|
+
export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, L as LimitsCheckRow, P as PendingPlanMaterializationService, e as PlanChangeContext, f as PlanChangePreviewDto, g as PlanChangePreviewIssue, h as PlanChangePreviewService, i as PlanChangeType, j as PlanSnapshotDto, k as PreviewPlanChangeDto, l as ProrationDto, m as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, n as SubscriptionBundleCancelPreviewDto, o as SubscriptionBundleConfig, p as SubscriptionBundlePreviewContext, q as SubscriptionBundlePreviewIssue, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController, U as UsageResponse, u as addMonths, v as computeProration, w as resolveBundleCancelEffectiveAt, x as resolveBundlePriceNet } from './tenant-billing.controller-DT5UrnDX.js';
|
|
13
13
|
export { C as CustomLimitsShape, E as EffectiveLimits, a as EffectiveLimitsSnapshot, b as EnforceLimitInput, c as EntitlementService, P as PlanVersionSnapshot, S as SubscriptionBundleSnapshot, d as SubscriptionLimitsInput, e as aggregateContractLineItemEntitlements, f as aggregateLimits, g as aggregateSubscriptionBundleQuotas, h as applyCustomLimits, i as collectSubscriptionBundleFeatures, j as contractBundleVersionIds, k as contractLimits, l as filterActiveSubscriptionBundles, m as filterPlannedOnlyFeatures, n as hasAnyFeature, o as hasFeature, p as mergeSubscriptionBundlesIntoLimits, t as toEffectiveLimitsSnapshot } from './aggregation-o0LMenvl.js';
|
|
14
14
|
export { ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, ENTITLEMENT_SERVICE_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.js';
|
|
15
15
|
export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CFCoUkrE.js';
|
|
@@ -17,7 +17,7 @@ export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT
|
|
|
17
17
|
export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, g as AdminStatsSnapshot, M as MfaGuard, h as MfaService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN, R as REQUIRE_MFA_KEY, i as RequireMfa, S as SuperAdminGuard, T as TotpSetupResult, V as VerifyTotpInput } from './admin-stats.service-Db2exT_d.js';
|
|
18
18
|
export { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.js';
|
|
19
19
|
export { A as ADMIN_MANIFEST_CONFIG, a as ADMIN_RESOURCES_PORT_TOKEN, b as AdminManifestConfig, c as AdminResourcesModule, d as AdminResourcesModuleOptions, e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions, S as SuspendTenantDto } from './admin-resources.module-BY5r_1MG.js';
|
|
20
|
-
export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-
|
|
20
|
+
export { S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions } from './saas-platform.module-DChhDrR-.js';
|
|
21
21
|
export { ACTIVATION_ORCHESTRATOR_TOKEN, BaseIpRateLimitGuard, ContinueRegistrationDto, PASSWORD_HASHER_TOKEN, PAYMENT_EVENT_LOG_TOKEN, PAYMENT_PROVIDER_TOKEN, PENDING_REGISTRATION_REPOSITORY_TOKEN, PLAN_CATALOG_LOOKUP_TOKEN, PaymentWebhookDto, PendingRegistrationService, PreviewRegistrationPromoDto, PromoEvaluation, REGISTRATION_AUDIT_LOGGER_TOKEN, REGISTRATION_CONFIGURATOR_LOOKUP_TOKEN, REGISTRATION_CONFIG_TOKEN, REGISTRATION_OTP_DELIVERY_TOKEN, REGISTRATION_PROMO_PREVIEW_TOKEN, REGISTRATION_RESUME_BASE_URL_TOKEN, REGISTRATION_RESUME_DELIVERY_TOKEN, REGISTRATION_RESUME_TOKEN_SIGNER_TOKEN, RegisterStartDto, RegistrationCleanupCron, RegistrationModule, RegistrationModuleOptions, ResendRegistrationOtpDto, SLUG_AVAILABILITY_CHECK_TOKEN, SaveRegistrationConfigDto, SaveRegistrationConfigSelectionDto, SelectRegistrationPlanDto, StartRegistrationCheckoutDto, USER_ACCOUNT_LOOKUP_TOKEN, VerifyRegistrationOtpDto, computeBreakdown, generateOtpCode, hashOtpCode, resolveModel, slugify, verifyOtpCode } from './registration/index.js';
|
|
22
22
|
export { DEFINES_QUOTA_KEY, DISCOVERY_SNAPSHOT_TOKEN, DefinesQuota, DefinesQuotaOptions, DiscoveryControllerConfig, DiscoveryModule, DiscoveryModuleOptions, DiscoverySnapshotNotFoundError, ENFORCE_QUOTA_KEY, EnforceQuota, EnforceQuotaMetadata, EnforceQuotaOptions, HeadlessScanOptions, IMPLEMENTS_CAPABILITY_KEY, ImplementsCapability, ImplementsCapabilityMetadata, ImplementsCapabilityOptions, REQUIRES_CAPABILITY_KEY, RequiresCapability, RequiresCapabilityKeys, buildDiscoveryController, loadDiscoverySnapshotFromFile, runHeadlessDiscoveryScan } from './discovery/index.js';
|
|
23
23
|
export { D as DISCOVERY_APP_INFO_TOKEN, a as DISCOVERY_SNAPSHOT_PATH_TOKEN, b as DiscoveryAppInfo, c as DiscoveryScanner, d as computeSnapshotHash } from './discovery.scanner-DLgEvuoy.js';
|
|
@@ -53,4 +53,23 @@ declare class SetupController {
|
|
|
53
53
|
confirm(dto: SetupConfirmMfaDto): Promise<SetupConfirmMfaResponse>;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Builds the body of a coded exception.
|
|
58
|
+
*
|
|
59
|
+
* `PlatformErrorBody` declares `message` as required, but a throw site that
|
|
60
|
+
* passes only `{ code }` produces a body without one — NestJS hands an object
|
|
61
|
+
* argument through verbatim. A consumer typing the response then reads
|
|
62
|
+
* `undefined` where a string was promised, and `body.message.includes(...)`
|
|
63
|
+
* throws. Deriving the message from the shipped English catalogue closes that
|
|
64
|
+
* gap, and keeps the fallback text identical to the shipped default by
|
|
65
|
+
* construction.
|
|
66
|
+
*
|
|
67
|
+
* Use it wherever there is no reason to word the message differently from the
|
|
68
|
+
* catalogue:
|
|
69
|
+
*
|
|
70
|
+
* throw new BadRequestException(codedError(REGISTRATION_ERROR_CODES.OTP_INVALID));
|
|
71
|
+
* throw new NotFoundException(codedError(BILLING_ERROR_CODES.TENANT_NOT_FOUND, { slug }));
|
|
72
|
+
*/
|
|
73
|
+
declare function codedError(code: PlatformErrorCode, params?: Record<string, unknown>): PlatformErrorBody;
|
|
74
|
+
|
|
75
|
+
export { SetupController, SetupService, codedError };
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
resolveModel,
|
|
38
38
|
slugify,
|
|
39
39
|
verifyOtpCode
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3DRZ5GCP.js";
|
|
41
41
|
import "./chunk-UF53DWWR.js";
|
|
42
42
|
import {
|
|
43
43
|
formatPreflightReport,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
runSeedGateFromFile,
|
|
48
48
|
seedGateExitCode,
|
|
49
49
|
validateSeedAgainstSnapshot
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-55QGAZRQ.js";
|
|
51
51
|
import "./chunk-DBZGV3HC.js";
|
|
52
52
|
import {
|
|
53
53
|
DefinesQuota,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
SetupController,
|
|
71
71
|
SetupModule,
|
|
72
72
|
SetupService
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-ZH5PYEMI.js";
|
|
74
74
|
import {
|
|
75
75
|
CreatePromoCodeDto,
|
|
76
76
|
PreviewPromoCodeDto,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
buildPromoCodeAdminController,
|
|
83
83
|
hashIp,
|
|
84
84
|
ipFingerprint
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-4O6R6ARQ.js";
|
|
86
86
|
import {
|
|
87
87
|
ADMIN_MANIFEST_CONFIG,
|
|
88
88
|
ADMIN_RESOURCES_PORT_TOKEN,
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
SuperAdminGuard,
|
|
110
110
|
SuspendTenantDto,
|
|
111
111
|
buildAdminStatsController
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-FYWLPYBK.js";
|
|
113
113
|
import {
|
|
114
114
|
CONTRACT_FREEZE_PORT_TOKEN,
|
|
115
115
|
CONTRACT_FREEZE_PROJECT_KEY_TOKEN,
|
|
@@ -170,7 +170,7 @@ import {
|
|
|
170
170
|
periodEndWithMinLead,
|
|
171
171
|
resolveBundleCancelEffectiveAt,
|
|
172
172
|
resolveBundlePriceNet
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-NZLAYCEX.js";
|
|
174
174
|
import {
|
|
175
175
|
PROMO_CODE_REDEMPTION_REPOSITORY_TOKEN,
|
|
176
176
|
PROMO_CODE_REPOSITORY_TOKEN,
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
computeDiscountGross,
|
|
187
187
|
computeDiscountedGross,
|
|
188
188
|
computeRegularStartsAt
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-VQQWF7MW.js";
|
|
190
190
|
import {
|
|
191
191
|
SubscriptionContractModule,
|
|
192
192
|
SubscriptionContractService,
|
|
@@ -242,7 +242,7 @@ import {
|
|
|
242
242
|
quotaApprovalSignature,
|
|
243
243
|
validateBundleDraft,
|
|
244
244
|
validatePlanDraft
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-GC5AKN44.js";
|
|
246
246
|
import {
|
|
247
247
|
AUDIT_CONTEXT_RESOLVER_TOKEN,
|
|
248
248
|
PENDING_PLAN_QUERY_PORT_TOKEN,
|
|
@@ -270,7 +270,7 @@ import {
|
|
|
270
270
|
CreateCheckoutOfferDto,
|
|
271
271
|
UpdateCheckoutOfferDto,
|
|
272
272
|
buildCheckoutOfferController
|
|
273
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-XTVAFJ3P.js";
|
|
274
274
|
import "./chunk-BSK6YBLI.js";
|
|
275
275
|
import {
|
|
276
276
|
SAASICAT_PUBLIC_ROUTE_KEY,
|
|
@@ -310,7 +310,7 @@ import {
|
|
|
310
310
|
mergeSubscriptionBundlesIntoLimits,
|
|
311
311
|
resolveEntitlementPlan,
|
|
312
312
|
toEffectiveLimitsSnapshot
|
|
313
|
-
} from "./chunk-
|
|
313
|
+
} from "./chunk-AGOG5B77.js";
|
|
314
314
|
import {
|
|
315
315
|
PLAN_CATALOG_READ_SINK_TOKEN,
|
|
316
316
|
PLAN_CATALOG_TOKEN,
|
|
@@ -332,6 +332,9 @@ import {
|
|
|
332
332
|
import {
|
|
333
333
|
SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
|
|
334
334
|
} from "./chunk-NYLON2VC.js";
|
|
335
|
+
import {
|
|
336
|
+
codedError
|
|
337
|
+
} from "./chunk-EBJJNTW6.js";
|
|
335
338
|
import {
|
|
336
339
|
ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
|
|
337
340
|
ENTITLEMENT_SERVICE_TOKEN,
|
|
@@ -601,6 +604,7 @@ export {
|
|
|
601
604
|
classifyBundleVersionDiff,
|
|
602
605
|
classifyPlanDiff,
|
|
603
606
|
clearPendingPlanVersionFields,
|
|
607
|
+
codedError,
|
|
604
608
|
collectSubscriptionBundleFeatures,
|
|
605
609
|
computeBreakdown,
|
|
606
610
|
computeCarriedTrialEndsAt,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, CanActivate, DynamicModule, ForwardReference } from '@nestjs/common';
|
|
2
2
|
import { PromoCodeRepository, PromoCodeRedemptionRepository, PromoCodeValidationLogRepository, FirstTimeCustomerCheck, PromoSubscriptionLookup, PromoRevenueDeductionAggregator, TransactionRunner } from '@saasicat/types';
|
|
3
3
|
import { P as ProviderSpec } from './di-CcNeq9v-.js';
|
|
4
|
-
import {
|
|
4
|
+
import { P as PromoServiceConfig } from './service-D48clObR.js';
|
|
5
5
|
|
|
6
6
|
interface PromoCodesModuleOptions {
|
|
7
7
|
promoCodeRepository: ProviderSpec<PromoCodeRepository>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, CanActivate, DynamicModule, ForwardReference } from '@nestjs/common';
|
|
2
2
|
import { PromoCodeRepository, PromoCodeRedemptionRepository, PromoCodeValidationLogRepository, FirstTimeCustomerCheck, PromoSubscriptionLookup, PromoRevenueDeductionAggregator, TransactionRunner } from '@saasicat/types';
|
|
3
3
|
import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
|
|
4
|
-
import {
|
|
4
|
+
import { P as PromoServiceConfig } from './service-D48clObR.cjs';
|
|
5
5
|
|
|
6
6
|
interface PromoCodesModuleOptions {
|
|
7
7
|
promoCodeRepository: ProviderSpec<PromoCodeRepository>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { p as PlanResolverPort } from '../saas-platform.module-
|
|
2
|
-
export { P as PLAN_RESOLVER_PORT_TOKEN, S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions, o as StaticPlanResolver, T as TenantManifestControllerOptions, q as buildTenantManifestController } from '../saas-platform.module-
|
|
3
|
-
export { a as SAASICAT_PUBLIC_ROUTE_KEY, d as SaaSiCatPublicRoute, S as SetupService, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from '../define-saasicat-
|
|
1
|
+
import { p as PlanResolverPort } from '../saas-platform.module-BfaYfL-G.cjs';
|
|
2
|
+
export { P as PLAN_RESOLVER_PORT_TOKEN, S as SaaSiCatModule, a as SaasPlatformAdapters, b as SaasPlatformAdminResourcesOptions, c as SaasPlatformAdminStatsOptions, d as SaasPlatformCatalogOptions, e as SaasPlatformCheckoutOfferOptions, S as SaasPlatformModule, f as SaasPlatformModuleOptions, g as SaasPlatformPromoCodesOptions, h as SaasPlatformSetupOptions, i as SaasPlatformSubscriptionBundlesOptions, j as SaasPlatformSubscriptionContractOptions, k as SaasPlatformTenantAuthGuards, l as SaasPlatformTenantBillingOptions, m as SetupModule, n as SetupModuleOptions, o as StaticPlanResolver, T as TenantManifestControllerOptions, q as buildTenantManifestController } from '../saas-platform.module-BfaYfL-G.cjs';
|
|
3
|
+
export { a as SAASICAT_PUBLIC_ROUTE_KEY, d as SaaSiCatPublicRoute, S as SetupService, f as defineSaaSiCat, i as isSaaSiCatPublicRoute } from '../define-saasicat-Cf9DpEsY.cjs';
|
|
4
4
|
import { SubscriptionRepository, UsageSnapshotPort, QuotaProvider } from '@saasicat/types';
|
|
5
|
-
import { S as StaticEntitlementService } from '../enforce-quota.interceptor-
|
|
6
|
-
export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-
|
|
5
|
+
import { S as StaticEntitlementService } from '../enforce-quota.interceptor-Dtg5WdFj.cjs';
|
|
6
|
+
export { E as EnforceQuotaInterceptor, Q as QUOTA_PROVIDERS_TOKEN, b as STATIC_FEATURE_GUARD_CONFIG_TOKEN, c as StaticEntitlementSnapshot, a as StaticFeatureGuard, d as StaticFeatureGuardConfig } from '../enforce-quota.interceptor-Dtg5WdFj.cjs';
|
|
7
7
|
export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsService, M as MfaGuard, h as MfaService, S as SuperAdminGuard } from '../admin-stats.service-HUZIU448.cjs';
|
|
8
8
|
export { A as AdminAuditService } from '../admin-audit.service-9IqXMlZm.cjs';
|
|
9
9
|
export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-DGgGSdzN.cjs';
|
|
10
10
|
export { c as EntitlementService } from '../aggregation-SKfXu09x.cjs';
|
|
11
|
-
export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../tenant-billing.controller-
|
|
11
|
+
export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, h as PlanChangePreviewService, r as SubscriptionBundlePreviewService, s as SubscriptionBundlesService, T as TenantAdminGuard, t as TenantBillingController } from '../tenant-billing.controller-BIF-mstX.cjs';
|
|
12
12
|
export { B as BundlesService, C as CatalogEntriesService, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService, e as PublicMarketingCatalogService } from '../plan-versions.service-CUR2Whyr.cjs';
|
|
13
13
|
export { c as DiscoveryScanner } from '../discovery.scanner-DLgEvuoy.cjs';
|
|
14
14
|
export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.cjs';
|
|
15
|
-
export {
|
|
15
|
+
export { g as PromoCodesService } from '../service-D48clObR.cjs';
|
|
16
16
|
export { a as CheckoutOfferModule, b as CheckoutOfferModuleOptions } from '../checkout-offer.module-DmlpPevf.cjs';
|
|
17
17
|
export { C as CheckoutOfferService } from '../checkout-offer.service-BX51dljL.cjs';
|
|
18
18
|
export { S as SubscriptionContractModule, a as SubscriptionContractModuleOptions } from '../subscription-contract.module-B2uNvUJL.cjs';
|
|
@@ -20,7 +20,7 @@ export { S as SubscriptionContractService } from '../subscription-contract.servi
|
|
|
20
20
|
import '@nestjs/common';
|
|
21
21
|
import '../di-CcNeq9v-.cjs';
|
|
22
22
|
import '../plan-resolution-CFCoUkrE.cjs';
|
|
23
|
-
import '../module-
|
|
23
|
+
import '../module-CHMIyWlf.cjs';
|
|
24
24
|
import '../catalog.module-Dw2Hrbyu.cjs';
|
|
25
25
|
import '../subscription-bundles.module-DCpV-Pb5.cjs';
|
|
26
26
|
import '@nestjs/core';
|