@saasicat/nest 1.0.0-rc.7 → 1.0.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/_entries.cjs +60 -17
  3. package/dist/admin/index.js +2 -2
  4. package/dist/billing/index.d.cts +2 -3
  5. package/dist/billing/index.d.ts +2 -3
  6. package/dist/billing/index.js +7 -7
  7. package/dist/catalog/index.js +4 -4
  8. package/dist/{chunk-RCZ7ZGKU.js → chunk-2BNZK22P.js} +16 -16
  9. package/dist/{chunk-DRMSHMOB.js → chunk-DQW3DHSD.js} +1 -1
  10. package/dist/{chunk-E74DRQJM.js → chunk-GG5NHRH5.js} +1 -1
  11. package/dist/{chunk-BYINBUNY.js → chunk-GHIECNF3.js} +2 -2
  12. package/dist/{chunk-MEVY2ZZG.js → chunk-L4VVZ4O5.js} +1 -1
  13. package/dist/{chunk-NT4ZGXPA.js → chunk-TJ5E42WX.js} +65 -22
  14. package/dist/entitlement/index.js +3 -3
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +33 -33
  18. package/dist/platform/index.d.cts +1 -1
  19. package/dist/platform/index.d.ts +1 -1
  20. package/dist/platform/index.js +20 -20
  21. package/dist/promo/index.js +2 -2
  22. package/dist/subscription-contract/index.js +3 -3
  23. package/dist/{tenant-billing.controller-D9rtguyx.d.ts → tenant-billing.controller-CVDMTGx6.d.ts} +16 -0
  24. package/dist/{tenant-billing.controller-CGfCLtzu.d.cts → tenant-billing.controller-DElYt3Aa.d.cts} +16 -0
  25. package/dist/testing/index.js +13 -13
  26. package/package.json +3 -3
  27. package/dist/{chunk-L33BM4EN.js → chunk-DFQETRBL.js} +6 -6
  28. package/dist/{chunk-65ADCLHU.js → chunk-F7P2X2DR.js} +3 -3
  29. package/dist/{chunk-SO2NH2A6.js → chunk-IW5XGOEU.js} +3 -3
  30. package/dist/{chunk-EASFDWXV.js → chunk-JNONSUP3.js} +3 -3
  31. package/dist/{chunk-3Y4USRJS.js → chunk-LTT736P3.js} +3 -3
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- d2641f050887af0afe7e26844778e4a66660b2f17d7ded07dc67cb60d62c29b0
1
+ 89d783a28230b3a9b77ff0cb7706f96197daa84bc359f5d1d8f0d643d33beffc
package/dist/_entries.cjs CHANGED
@@ -4023,12 +4023,12 @@ var PlanChangePreviewService = class {
4023
4023
  const landsAt = ctx.canceledEffectiveAt ?? ctx.canceledAt;
4024
4024
  if (landsAt !== null && landsAt <= now) {
4025
4025
  blockers.push({
4026
- code: "SUBSCRIPTION_ENDED",
4026
+ code: import_core17.BILLING_ERROR_CODES.SUBSCRIPTION_ENDED,
4027
4027
  message: "This subscription has ended. Its plan can no longer be changed."
4028
4028
  });
4029
4029
  } else if (landsAt !== null && cycleDirection !== "SAME") {
4030
4030
  blockers.push({
4031
- code: "CANCELLATION_LOCKS_THE_CYCLE",
4031
+ code: import_core17.BILLING_ERROR_CODES.CANCELLATION_LOCKS_THE_CYCLE,
4032
4032
  message: "This subscription is cancelled, so its billing cycle cannot change. The plan can."
4033
4033
  });
4034
4034
  }
@@ -4036,47 +4036,74 @@ var PlanChangePreviewService = class {
4036
4036
  const blockedSources = this.blockedPlans?.asSource ?? [];
4037
4037
  if (blockedTargets.includes(targetPlan)) {
4038
4038
  blockers.push({
4039
- code: `${targetPlan}_NOT_SELF_SERVICE`,
4040
- message: `${targetSnap.name} is only activated via a special contract. Please contact the contract manager.`
4039
+ code: import_core17.BILLING_ERROR_CODES.PLAN_NOT_SELF_SERVICE,
4040
+ message: `${targetSnap.name} is only activated via a special contract. Please contact the contract manager.`,
4041
+ params: {
4042
+ planName: targetSnap.name,
4043
+ planKey: targetPlan
4044
+ }
4041
4045
  });
4042
4046
  }
4043
4047
  if (blockedSources.includes(sub.plan)) {
4044
4048
  blockers.push({
4045
- code: `${sub.plan}_LOCKED`,
4046
- message: `Active ${currentSnap.name} special contract \u2014 please contact the contract manager to change plans.`
4049
+ code: import_core17.BILLING_ERROR_CODES.PLAN_LOCKED,
4050
+ message: `Active ${currentSnap.name} special contract \u2014 please contact the contract manager to change plans.`,
4051
+ params: {
4052
+ planName: currentSnap.name,
4053
+ planKey: sub.plan
4054
+ }
4047
4055
  });
4048
4056
  }
4049
4057
  for (const [key, row] of Object.entries(limitsCheck)) {
4050
4058
  if (!row.exceeded) continue;
4051
4059
  const usedDisplay = isFloatQuota(key) ? row.used.toFixed(1) : row.used.toString();
4052
4060
  blockers.push({
4053
- code: `${key.toUpperCase()}_OVER_TARGET`,
4054
- message: `Current usage ${usedDisplay} exceeds the target limit ${row.targetMax} (${key}) in the ${targetSnap.name} plan. Please reduce usage first.`
4061
+ code: import_core17.BILLING_ERROR_CODES.QUOTA_OVER_TARGET,
4062
+ message: `Current usage ${usedDisplay} exceeds the target limit ${row.targetMax} (${key}) in the ${targetSnap.name} plan. Please reduce usage first.`,
4063
+ params: {
4064
+ used: usedDisplay,
4065
+ targetMax: row.targetMax,
4066
+ quotaKey: key,
4067
+ planName: targetSnap.name
4068
+ }
4055
4069
  });
4056
4070
  }
4057
4071
  if (featuresLost.length > 0) {
4058
4072
  warnings.push({
4059
- code: "FEATURES_LOST",
4060
- message: `Switching means losing access to ${featuresLost.length} feature${featuresLost.length === 1 ? "" : "s"}. Existing data is retained and never deleted \u2014 upgrading again unlocks it.`
4073
+ code: featuresLost.length === 1 ? import_core17.BILLING_ERROR_CODES.FEATURE_LOST : import_core17.BILLING_ERROR_CODES.FEATURES_LOST,
4074
+ message: `Switching means losing access to ${featuresLost.length} feature${featuresLost.length === 1 ? "" : "s"}. Existing data is retained and never deleted \u2014 upgrading again unlocks it.`,
4075
+ params: {
4076
+ count: featuresLost.length
4077
+ }
4061
4078
  });
4062
4079
  }
4063
4080
  if (changeType === "NOOP") {
4064
4081
  warnings.push({
4065
- code: "NO_CHANGE",
4082
+ code: import_core17.BILLING_ERROR_CODES.NO_CHANGE,
4066
4083
  message: "Target plan and billing cycle already match the current state."
4067
4084
  });
4068
4085
  }
4069
4086
  if (planDirection === "UP" && cycleDirection === "SHORTER") {
4070
4087
  warnings.push({
4071
- code: "CYCLE_SHORTENS_AT_TERM_END",
4072
- message: `A ${targetCycle.toLowerCase()} ${targetSnap.name} cannot start inside the ${sub.billingCycle.toLowerCase()} term you are in. The upgrade takes effect when that term ends; to have it today, keep the ${sub.billingCycle.toLowerCase()} cycle.`
4088
+ code: import_core17.BILLING_ERROR_CODES.CYCLE_SHORTENS_AT_TERM_END,
4089
+ message: `A ${targetCycle.toLowerCase()} ${targetSnap.name} cannot start inside the ${sub.billingCycle.toLowerCase()} term you are in. The upgrade takes effect when that term ends; to have it today, keep the ${sub.billingCycle.toLowerCase()} cycle.`,
4090
+ params: {
4091
+ targetCycle: targetCycle.toLowerCase(),
4092
+ currentCycle: sub.billingCycle.toLowerCase(),
4093
+ planName: targetSnap.name
4094
+ }
4073
4095
  });
4074
4096
  }
4075
4097
  const changeLandsAt = effectiveAt ?? now;
4076
4098
  for (const booking of await this.bookingsOutlastingCycle(sub, targetCycle, changeLandsAt)) {
4077
4099
  blockers.push({
4078
- code: import_core17.BILLING_ERROR_CODES.BUNDLE_CYCLE_EXCEEDS_PLAN,
4079
- message: `A yearly add-on is booked until ${booking.until}. A ${targetCycle.toLowerCase()} plan cannot carry it \u2014 cancel the add-on first, or keep the yearly cycle.`
4100
+ code: import_core17.BILLING_ERROR_CODES.BUNDLE_BOOKING_OUTLASTS_TARGET_CYCLE,
4101
+ message: `A yearly bundle is booked until ${booking.until}. A monthly plan cannot carry it \u2014 cancel the bundle first, or keep the yearly cycle.`,
4102
+ params: {
4103
+ billingCycle: "yearly",
4104
+ planCycle: targetCycle.toLowerCase(),
4105
+ until: booking.until
4106
+ }
4080
4107
  });
4081
4108
  }
4082
4109
  const projectedTrialEndsAt = this.trialProjection && sub.status === "TRIAL" ? await this.trialProjection.projectTrialEndsAt({
@@ -6210,8 +6237,19 @@ var TenantBillingController = class _TenantBillingController {
6210
6237
  if (blockedTargets.includes(dto.plan)) {
6211
6238
  throw new import_common34.ForbiddenException({
6212
6239
  code: import_core22.BILLING_ERROR_CODES.PLAN_NOT_SELF_SERVICE,
6213
- message: `${dto.plan} is not activated via self-service.`,
6240
+ // Says what the shipped catalogue says, so an app that has not
6241
+ // translated this code and one that has do not refuse in two
6242
+ // different sentences.
6243
+ message: `${dto.plan} is only activated via a special contract. Please contact the contract manager.`,
6244
+ // `planName` is the key here, and that is the best label this
6245
+ // check has: it decides before any catalogue is read, from
6246
+ // nothing but the key the request sent. The plan-change
6247
+ // preview does have a catalogue and passes the real name,
6248
+ // which is the one a tenant recognises. Either way the
6249
+ // template's `{planName}` resolves to a word rather than a
6250
+ // brace — `error-params-contract.test.js` holds that.
6214
6251
  params: {
6252
+ planName: dto.plan,
6215
6253
  planKey: dto.plan
6216
6254
  }
6217
6255
  });
@@ -6345,8 +6383,10 @@ var TenantBillingController = class _TenantBillingController {
6345
6383
  if (blockedTargets.includes(dto.plan)) {
6346
6384
  throw new import_common34.ForbiddenException({
6347
6385
  code: import_core22.BILLING_ERROR_CODES.PLAN_NOT_SELF_SERVICE,
6348
- message: `${dto.plan} is not activated via self-service.`,
6386
+ message: `${dto.plan} is only activated via a special contract. Please contact the contract manager.`,
6387
+ // The key as the label — see the note on the plan-change route.
6349
6388
  params: {
6389
+ planName: dto.plan,
6350
6390
  planKey: dto.plan
6351
6391
  }
6352
6392
  });
@@ -7616,6 +7656,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
7616
7656
  ], GeneratedTenantSubscriptionBundlesController.prototype, "prices", null);
7617
7657
  _ts_decorate39([
7618
7658
  (0, import_common38.Post)(),
7659
+ (0, import_common38.UseGuards)(TenantAdminGuard),
7619
7660
  _ts_param26(0, (0, import_common38.Req)()),
7620
7661
  _ts_param26(1, (0, import_common38.Body)()),
7621
7662
  _ts_metadata29("design:type", Function),
@@ -7639,6 +7680,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
7639
7680
  ], GeneratedTenantSubscriptionBundlesController.prototype, "preview", null);
7640
7681
  _ts_decorate39([
7641
7682
  (0, import_common38.Delete)(":id"),
7683
+ (0, import_common38.UseGuards)(TenantAdminGuard),
7642
7684
  (0, import_common38.HttpCode)(import_common38.HttpStatus.OK),
7643
7685
  _ts_param26(0, (0, import_common38.Req)()),
7644
7686
  _ts_param26(1, (0, import_common38.Param)("id", new import_common38.ParseUUIDPipe())),
@@ -7653,6 +7695,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
7653
7695
  ], GeneratedTenantSubscriptionBundlesController.prototype, "cancel", null);
7654
7696
  _ts_decorate39([
7655
7697
  (0, import_common38.Post)(":id/reactivate"),
7698
+ (0, import_common38.UseGuards)(TenantAdminGuard),
7656
7699
  (0, import_common38.HttpCode)(import_common38.HttpStatus.OK),
7657
7700
  _ts_param26(0, (0, import_common38.Req)()),
7658
7701
  _ts_param26(1, (0, import_common38.Param)("id", new import_common38.ParseUUIDPipe())),
@@ -25,15 +25,15 @@ import {
25
25
  SuperAdminGuard,
26
26
  SuspendTenantDto,
27
27
  buildAdminStatsController
28
- } from "../chunk-3Y4USRJS.js";
28
+ } from "../chunk-LTT736P3.js";
29
29
  import {
30
30
  AUDIT_PORT_TOKEN,
31
31
  AdminAuditService,
32
32
  MFA_PORT_TOKEN,
33
33
  RLS_BYPASS_PORT_TOKEN
34
34
  } from "../chunk-O2J2HDXA.js";
35
- import "../chunk-57V6ZTI6.js";
36
35
  import "../chunk-YSC46BGM.js";
36
+ import "../chunk-57V6ZTI6.js";
37
37
  import "../chunk-SABTXESR.js";
38
38
  import "../chunk-SHUYVCID.js";
39
39
  export {
@@ -8,7 +8,7 @@ export { Type as NestType } from '@nestjs/common';
8
8
  import { Reflector, BaseExceptionFilter } from '@nestjs/core';
9
9
  import { c as EntitlementService } from '../aggregation-Bsg1g9Q0.cjs';
10
10
  import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
11
- export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from '../tenant-billing.controller-CGfCLtzu.cjs';
11
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from '../tenant-billing.controller-DElYt3Aa.cjs';
12
12
  import { S as SubscriptionContractService } from '../subscription-contract.service-hD87MKyg.cjs';
13
13
  import '../plan-resolution-CwUy_OqC.cjs';
14
14
  import '../promo.service-BJbKAmw3.cjs';
@@ -941,8 +941,7 @@ declare const SUBSCRIPTION_BUNDLE_CONFIG_TOKEN: unique symbol;
941
941
 
942
942
  /**
943
943
  * Factory analogous to `buildBundlesController` etc. — the consumer can pass
944
- * additional guards (e.g. RoleGuard) in addition to the platform default
945
- * `ComposedTenantAuthGuard`.
944
+ * additional guards (e.g. RoleGuard) in addition to the platform defaults.
946
945
  */
947
946
  declare function buildTenantSubscriptionBundlesController(extraGuards?: Array<Type<CanActivate>>): Type;
948
947
 
@@ -8,7 +8,7 @@ export { Type as NestType } from '@nestjs/common';
8
8
  import { Reflector, BaseExceptionFilter } from '@nestjs/core';
9
9
  import { c as EntitlementService } from '../aggregation-53yv4-rr.js';
10
10
  import { P as ProviderSpec } from '../di-CcNeq9v-.js';
11
- export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from '../tenant-billing.controller-D9rtguyx.js';
11
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from '../tenant-billing.controller-CVDMTGx6.js';
12
12
  import { S as SubscriptionContractService } from '../subscription-contract.service-hD87MKyg.js';
13
13
  import '../plan-resolution-CwUy_OqC.js';
14
14
  import '../promo.service-BJbKAmw3.js';
@@ -941,8 +941,7 @@ declare const SUBSCRIPTION_BUNDLE_CONFIG_TOKEN: unique symbol;
941
941
 
942
942
  /**
943
943
  * Factory analogous to `buildBundlesController` etc. — the consumer can pass
944
- * additional guards (e.g. RoleGuard) in addition to the platform default
945
- * `ComposedTenantAuthGuard`.
944
+ * additional guards (e.g. RoleGuard) in addition to the platform defaults.
946
945
  */
947
946
  declare function buildTenantSubscriptionBundlesController(extraGuards?: Array<Type<CanActivate>>): Type;
948
947
 
@@ -24,7 +24,7 @@ import {
24
24
  decideRenewal,
25
25
  loadPlanCatalogFromFile,
26
26
  loadPlanCatalogFromString
27
- } from "../chunk-BYINBUNY.js";
27
+ } from "../chunk-GHIECNF3.js";
28
28
  import {
29
29
  AddSubscriptionBundleDto,
30
30
  BILLING_FEATURE_UI_REGISTRY_TOKEN,
@@ -78,9 +78,9 @@ import {
78
78
  resolveBundleCancelEffectiveAt,
79
79
  resolvePlanAnchorDay,
80
80
  retreatOneCycle
81
- } from "../chunk-NT4ZGXPA.js";
81
+ } from "../chunk-TJ5E42WX.js";
82
82
  import "../chunk-7JEXCHMU.js";
83
- import "../chunk-65ADCLHU.js";
83
+ import "../chunk-F7P2X2DR.js";
84
84
  import {
85
85
  AUDIT_CONTEXT_RESOLVER_TOKEN,
86
86
  CANCELLATION_NOTICE_DAYS_TOKEN,
@@ -99,10 +99,12 @@ import {
99
99
  resolveBundlePriceNet
100
100
  } from "../chunk-X7CWHRSK.js";
101
101
  import "../chunk-O2J2HDXA.js";
102
+ import "../chunk-BSK6YBLI.js";
103
+ import "../chunk-YSC46BGM.js";
102
104
  import {
103
105
  SUBSCRIPTION_BUNDLE_CONFIG_TOKEN,
104
106
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN
105
- } from "../chunk-SO2NH2A6.js";
107
+ } from "../chunk-IW5XGOEU.js";
106
108
  import {
107
109
  PLAN_CATALOG_READ_SINK_TOKEN,
108
110
  PLAN_CATALOG_TOKEN,
@@ -121,11 +123,9 @@ import {
121
123
  import "../chunk-VBRYPU7V.js";
122
124
  import "../chunk-57V6ZTI6.js";
123
125
  import "../chunk-OUDSQ3PU.js";
124
- import "../chunk-QUZU2M33.js";
125
- import "../chunk-BSK6YBLI.js";
126
- import "../chunk-YSC46BGM.js";
127
126
  import "../chunk-AOQJEYOL.js";
128
127
  import "../chunk-SABTXESR.js";
128
+ import "../chunk-QUZU2M33.js";
129
129
  import "../chunk-SHUYVCID.js";
130
130
  export {
131
131
  AUDIT_CONTEXT_RESOLVER_TOKEN,
@@ -6,7 +6,7 @@ import {
6
6
  runSeedGateFromFile,
7
7
  seedGateExitCode,
8
8
  validateSeedAgainstSnapshot
9
- } from "../chunk-E74DRQJM.js";
9
+ } from "../chunk-GG5NHRH5.js";
10
10
  import "../chunk-74SCJ4HF.js";
11
11
  import {
12
12
  ADVISORY_STRICT_MODE_CODES,
@@ -57,13 +57,12 @@ import {
57
57
  resolveValidityWindow,
58
58
  validateBundleDraft,
59
59
  validatePlanDraft
60
- } from "../chunk-L33BM4EN.js";
60
+ } from "../chunk-DFQETRBL.js";
61
61
  import "../chunk-X7CWHRSK.js";
62
62
  import "../chunk-O2J2HDXA.js";
63
+ import "../chunk-YSC46BGM.js";
63
64
  import "../chunk-WXYJHZCN.js";
64
65
  import "../chunk-OUDSQ3PU.js";
65
- import "../chunk-QUZU2M33.js";
66
- import "../chunk-YSC46BGM.js";
67
66
  import {
68
67
  BUNDLE_REPOSITORY_TOKEN,
69
68
  CATALOG_ENTRY_REPOSITORY_TOKEN,
@@ -75,6 +74,7 @@ import {
75
74
  PROMOTION_REPOSITORY_TOKEN
76
75
  } from "../chunk-AOQJEYOL.js";
77
76
  import "../chunk-SABTXESR.js";
77
+ import "../chunk-QUZU2M33.js";
78
78
  import "../chunk-SHUYVCID.js";
79
79
  export {
80
80
  ADVISORY_STRICT_MODE_CODES,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  PromoCodesModule
3
- } from "./chunk-EASFDWXV.js";
3
+ } from "./chunk-JNONSUP3.js";
4
4
  import {
5
5
  SubscriptionContractModule
6
- } from "./chunk-MEVY2ZZG.js";
6
+ } from "./chunk-L4VVZ4O5.js";
7
7
  import {
8
8
  AdminManifestModule,
9
9
  AdminManifestService,
@@ -12,7 +12,7 @@ import {
12
12
  AdminStatsModule,
13
13
  MfaService,
14
14
  SuperAdminGuard
15
- } from "./chunk-3Y4USRJS.js";
15
+ } from "./chunk-LTT736P3.js";
16
16
  import {
17
17
  FEATURE_GUARD_MARKER,
18
18
  PublicCatalogModule,
@@ -20,20 +20,26 @@ import {
20
20
  SubscriptionBundleModule,
21
21
  TenantBillingModule,
22
22
  isPlatformFeatureGuard
23
- } from "./chunk-NT4ZGXPA.js";
23
+ } from "./chunk-TJ5E42WX.js";
24
24
  import {
25
25
  CatalogModule
26
- } from "./chunk-L33BM4EN.js";
26
+ } from "./chunk-DFQETRBL.js";
27
+ import {
28
+ CheckoutOfferModule
29
+ } from "./chunk-RUTPEAZL.js";
30
+ import {
31
+ SaaSiCatPublicRoute
32
+ } from "./chunk-YSC46BGM.js";
27
33
  import {
28
34
  DiscoveryModule
29
35
  } from "./chunk-XBYAFEOR.js";
30
36
  import {
31
37
  EntitlementModule
32
- } from "./chunk-DRMSHMOB.js";
38
+ } from "./chunk-DQW3DHSD.js";
33
39
  import {
34
40
  LimitExceededError,
35
41
  cancellationHasLanded
36
- } from "./chunk-SO2NH2A6.js";
42
+ } from "./chunk-IW5XGOEU.js";
37
43
  import {
38
44
  PLAN_CATALOG_TOKEN,
39
45
  PlanCatalogModule
@@ -41,18 +47,12 @@ import {
41
47
  import {
42
48
  codedError
43
49
  } from "./chunk-57V6ZTI6.js";
44
- import {
45
- ENFORCE_QUOTA_KEY
46
- } from "./chunk-QUZU2M33.js";
47
- import {
48
- CheckoutOfferModule
49
- } from "./chunk-RUTPEAZL.js";
50
- import {
51
- SaaSiCatPublicRoute
52
- } from "./chunk-YSC46BGM.js";
53
50
  import {
54
51
  asProvider
55
52
  } from "./chunk-SABTXESR.js";
53
+ import {
54
+ ENFORCE_QUOTA_KEY
55
+ } from "./chunk-QUZU2M33.js";
56
56
  import {
57
57
  __name
58
58
  } from "./chunk-SHUYVCID.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EntitlementService,
3
3
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN
4
- } from "./chunk-SO2NH2A6.js";
4
+ } from "./chunk-IW5XGOEU.js";
5
5
  import {
6
6
  SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
7
7
  } from "./chunk-VBRYPU7V.js";
@@ -6,7 +6,7 @@ import {
6
6
  ADVISORY_STRICT_MODE_CODES,
7
7
  validateBundleDraft,
8
8
  validatePlanDraft
9
- } from "./chunk-L33BM4EN.js";
9
+ } from "./chunk-DFQETRBL.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-SHUYVCID.js";
@@ -4,11 +4,11 @@ import {
4
4
  PUBLIC_CATALOG_CATALOG_ENTRY_REPOSITORY_TOKEN,
5
5
  REQUIRE_FEATURE_KEY,
6
6
  periodEndAfter
7
- } from "./chunk-NT4ZGXPA.js";
7
+ } from "./chunk-TJ5E42WX.js";
8
8
  import {
9
9
  EntitlementService,
10
10
  isLimitExceededError
11
- } from "./chunk-SO2NH2A6.js";
11
+ } from "./chunk-IW5XGOEU.js";
12
12
  import {
13
13
  ENTITLEMENT_SERVICE_TOKEN
14
14
  } from "./chunk-OUDSQ3PU.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SubscriptionContractService
3
- } from "./chunk-65ADCLHU.js";
3
+ } from "./chunk-F7P2X2DR.js";
4
4
  import {
5
5
  SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
6
6
  } from "./chunk-VBRYPU7V.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7JEXCHMU.js";
4
4
  import {
5
5
  SubscriptionContractService
6
- } from "./chunk-65ADCLHU.js";
6
+ } from "./chunk-F7P2X2DR.js";
7
7
  import {
8
8
  AUDIT_CONTEXT_RESOLVER_TOKEN,
9
9
  CANCELLATION_NOTICE_DAYS_TOKEN,
@@ -21,13 +21,16 @@ import {
21
21
  import {
22
22
  AdminAuditService
23
23
  } from "./chunk-O2J2HDXA.js";
24
+ import {
25
+ SaaSiCatPublicRoute
26
+ } from "./chunk-YSC46BGM.js";
24
27
  import {
25
28
  EntitlementService,
26
29
  SUBSCRIPTION_BUNDLE_CONFIG_TOKEN,
27
30
  SUBSCRIPTION_BUNDLE_REPOSITORY_TOKEN,
28
31
  cancellationHasLanded,
29
32
  toEffectiveLimitsSnapshot
30
- } from "./chunk-SO2NH2A6.js";
33
+ } from "./chunk-IW5XGOEU.js";
31
34
  import {
32
35
  PLAN_CATALOG_TOKEN,
33
36
  findPlan,
@@ -43,9 +46,6 @@ import {
43
46
  import {
44
47
  ENTITLEMENT_SERVICE_TOKEN
45
48
  } from "./chunk-OUDSQ3PU.js";
46
- import {
47
- SaaSiCatPublicRoute
48
- } from "./chunk-YSC46BGM.js";
49
49
  import {
50
50
  BUNDLE_REPOSITORY_TOKEN,
51
51
  CATALOG_ENTRY_REPOSITORY_TOKEN,
@@ -810,12 +810,12 @@ var PlanChangePreviewService = class {
810
810
  const landsAt = ctx.canceledEffectiveAt ?? ctx.canceledAt;
811
811
  if (landsAt !== null && landsAt <= now) {
812
812
  blockers.push({
813
- code: "SUBSCRIPTION_ENDED",
813
+ code: BILLING_ERROR_CODES.SUBSCRIPTION_ENDED,
814
814
  message: "This subscription has ended. Its plan can no longer be changed."
815
815
  });
816
816
  } else if (landsAt !== null && cycleDirection !== "SAME") {
817
817
  blockers.push({
818
- code: "CANCELLATION_LOCKS_THE_CYCLE",
818
+ code: BILLING_ERROR_CODES.CANCELLATION_LOCKS_THE_CYCLE,
819
819
  message: "This subscription is cancelled, so its billing cycle cannot change. The plan can."
820
820
  });
821
821
  }
@@ -823,47 +823,74 @@ var PlanChangePreviewService = class {
823
823
  const blockedSources = this.blockedPlans?.asSource ?? [];
824
824
  if (blockedTargets.includes(targetPlan)) {
825
825
  blockers.push({
826
- code: `${targetPlan}_NOT_SELF_SERVICE`,
827
- message: `${targetSnap.name} is only activated via a special contract. Please contact the contract manager.`
826
+ code: BILLING_ERROR_CODES.PLAN_NOT_SELF_SERVICE,
827
+ message: `${targetSnap.name} is only activated via a special contract. Please contact the contract manager.`,
828
+ params: {
829
+ planName: targetSnap.name,
830
+ planKey: targetPlan
831
+ }
828
832
  });
829
833
  }
830
834
  if (blockedSources.includes(sub.plan)) {
831
835
  blockers.push({
832
- code: `${sub.plan}_LOCKED`,
833
- message: `Active ${currentSnap.name} special contract \u2014 please contact the contract manager to change plans.`
836
+ code: BILLING_ERROR_CODES.PLAN_LOCKED,
837
+ message: `Active ${currentSnap.name} special contract \u2014 please contact the contract manager to change plans.`,
838
+ params: {
839
+ planName: currentSnap.name,
840
+ planKey: sub.plan
841
+ }
834
842
  });
835
843
  }
836
844
  for (const [key, row] of Object.entries(limitsCheck)) {
837
845
  if (!row.exceeded) continue;
838
846
  const usedDisplay = isFloatQuota(key) ? row.used.toFixed(1) : row.used.toString();
839
847
  blockers.push({
840
- code: `${key.toUpperCase()}_OVER_TARGET`,
841
- message: `Current usage ${usedDisplay} exceeds the target limit ${row.targetMax} (${key}) in the ${targetSnap.name} plan. Please reduce usage first.`
848
+ code: BILLING_ERROR_CODES.QUOTA_OVER_TARGET,
849
+ message: `Current usage ${usedDisplay} exceeds the target limit ${row.targetMax} (${key}) in the ${targetSnap.name} plan. Please reduce usage first.`,
850
+ params: {
851
+ used: usedDisplay,
852
+ targetMax: row.targetMax,
853
+ quotaKey: key,
854
+ planName: targetSnap.name
855
+ }
842
856
  });
843
857
  }
844
858
  if (featuresLost.length > 0) {
845
859
  warnings.push({
846
- code: "FEATURES_LOST",
847
- message: `Switching means losing access to ${featuresLost.length} feature${featuresLost.length === 1 ? "" : "s"}. Existing data is retained and never deleted \u2014 upgrading again unlocks it.`
860
+ code: featuresLost.length === 1 ? BILLING_ERROR_CODES.FEATURE_LOST : BILLING_ERROR_CODES.FEATURES_LOST,
861
+ message: `Switching means losing access to ${featuresLost.length} feature${featuresLost.length === 1 ? "" : "s"}. Existing data is retained and never deleted \u2014 upgrading again unlocks it.`,
862
+ params: {
863
+ count: featuresLost.length
864
+ }
848
865
  });
849
866
  }
850
867
  if (changeType === "NOOP") {
851
868
  warnings.push({
852
- code: "NO_CHANGE",
869
+ code: BILLING_ERROR_CODES.NO_CHANGE,
853
870
  message: "Target plan and billing cycle already match the current state."
854
871
  });
855
872
  }
856
873
  if (planDirection === "UP" && cycleDirection === "SHORTER") {
857
874
  warnings.push({
858
- code: "CYCLE_SHORTENS_AT_TERM_END",
859
- message: `A ${targetCycle.toLowerCase()} ${targetSnap.name} cannot start inside the ${sub.billingCycle.toLowerCase()} term you are in. The upgrade takes effect when that term ends; to have it today, keep the ${sub.billingCycle.toLowerCase()} cycle.`
875
+ code: BILLING_ERROR_CODES.CYCLE_SHORTENS_AT_TERM_END,
876
+ message: `A ${targetCycle.toLowerCase()} ${targetSnap.name} cannot start inside the ${sub.billingCycle.toLowerCase()} term you are in. The upgrade takes effect when that term ends; to have it today, keep the ${sub.billingCycle.toLowerCase()} cycle.`,
877
+ params: {
878
+ targetCycle: targetCycle.toLowerCase(),
879
+ currentCycle: sub.billingCycle.toLowerCase(),
880
+ planName: targetSnap.name
881
+ }
860
882
  });
861
883
  }
862
884
  const changeLandsAt = effectiveAt ?? now;
863
885
  for (const booking of await this.bookingsOutlastingCycle(sub, targetCycle, changeLandsAt)) {
864
886
  blockers.push({
865
- code: BILLING_ERROR_CODES.BUNDLE_CYCLE_EXCEEDS_PLAN,
866
- message: `A yearly add-on is booked until ${booking.until}. A ${targetCycle.toLowerCase()} plan cannot carry it \u2014 cancel the add-on first, or keep the yearly cycle.`
887
+ code: BILLING_ERROR_CODES.BUNDLE_BOOKING_OUTLASTS_TARGET_CYCLE,
888
+ message: `A yearly bundle is booked until ${booking.until}. A monthly plan cannot carry it \u2014 cancel the bundle first, or keep the yearly cycle.`,
889
+ params: {
890
+ billingCycle: "yearly",
891
+ planCycle: targetCycle.toLowerCase(),
892
+ until: booking.until
893
+ }
867
894
  });
868
895
  }
869
896
  const projectedTrialEndsAt = this.trialProjection && sub.status === "TRIAL" ? await this.trialProjection.projectTrialEndsAt({
@@ -1971,8 +1998,19 @@ var TenantBillingController = class _TenantBillingController {
1971
1998
  if (blockedTargets.includes(dto.plan)) {
1972
1999
  throw new ForbiddenException3({
1973
2000
  code: BILLING_ERROR_CODES3.PLAN_NOT_SELF_SERVICE,
1974
- message: `${dto.plan} is not activated via self-service.`,
2001
+ // Says what the shipped catalogue says, so an app that has not
2002
+ // translated this code and one that has do not refuse in two
2003
+ // different sentences.
2004
+ message: `${dto.plan} is only activated via a special contract. Please contact the contract manager.`,
2005
+ // `planName` is the key here, and that is the best label this
2006
+ // check has: it decides before any catalogue is read, from
2007
+ // nothing but the key the request sent. The plan-change
2008
+ // preview does have a catalogue and passes the real name,
2009
+ // which is the one a tenant recognises. Either way the
2010
+ // template's `{planName}` resolves to a word rather than a
2011
+ // brace — `error-params-contract.test.js` holds that.
1975
2012
  params: {
2013
+ planName: dto.plan,
1976
2014
  planKey: dto.plan
1977
2015
  }
1978
2016
  });
@@ -2106,8 +2144,10 @@ var TenantBillingController = class _TenantBillingController {
2106
2144
  if (blockedTargets.includes(dto.plan)) {
2107
2145
  throw new ForbiddenException3({
2108
2146
  code: BILLING_ERROR_CODES3.PLAN_NOT_SELF_SERVICE,
2109
- message: `${dto.plan} is not activated via self-service.`,
2147
+ message: `${dto.plan} is only activated via a special contract. Please contact the contract manager.`,
2148
+ // The key as the label — see the note on the plan-change route.
2110
2149
  params: {
2150
+ planName: dto.plan,
2111
2151
  planKey: dto.plan
2112
2152
  }
2113
2153
  });
@@ -3313,6 +3353,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
3313
3353
  ], GeneratedTenantSubscriptionBundlesController.prototype, "prices", null);
3314
3354
  _ts_decorate15([
3315
3355
  Post2(),
3356
+ UseGuards2(TenantAdminGuard),
3316
3357
  _ts_param9(0, Req2()),
3317
3358
  _ts_param9(1, Body2()),
3318
3359
  _ts_metadata12("design:type", Function),
@@ -3336,6 +3377,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
3336
3377
  ], GeneratedTenantSubscriptionBundlesController.prototype, "preview", null);
3337
3378
  _ts_decorate15([
3338
3379
  Delete(":id"),
3380
+ UseGuards2(TenantAdminGuard),
3339
3381
  HttpCode2(HttpStatus2.OK),
3340
3382
  _ts_param9(0, Req2()),
3341
3383
  _ts_param9(1, Param("id", new ParseUUIDPipe())),
@@ -3350,6 +3392,7 @@ function buildTenantSubscriptionBundlesController(extraGuards = []) {
3350
3392
  ], GeneratedTenantSubscriptionBundlesController.prototype, "cancel", null);
3351
3393
  _ts_decorate15([
3352
3394
  Post2(":id/reactivate"),
3395
+ UseGuards2(TenantAdminGuard),
3353
3396
  HttpCode2(HttpStatus2.OK),
3354
3397
  _ts_param9(0, Req2()),
3355
3398
  _ts_param9(1, Param("id", new ParseUUIDPipe())),
@@ -1,7 +1,7 @@
1
1
  import "../chunk-G7RQO2XO.js";
2
2
  import {
3
3
  EntitlementModule
4
- } from "../chunk-DRMSHMOB.js";
4
+ } from "../chunk-DQW3DHSD.js";
5
5
  import {
6
6
  EntitlementService,
7
7
  LimitExceededError,
@@ -24,7 +24,7 @@ import {
24
24
  mergeSubscriptionBundlesIntoLimits,
25
25
  resolveEntitlementPlan,
26
26
  toEffectiveLimitsSnapshot
27
- } from "../chunk-SO2NH2A6.js";
27
+ } from "../chunk-IW5XGOEU.js";
28
28
  import "../chunk-UUFUSKX2.js";
29
29
  import "../chunk-VBRYPU7V.js";
30
30
  import "../chunk-57V6ZTI6.js";
@@ -35,9 +35,9 @@ import {
35
35
  SUBSCRIPTION_REPOSITORY_TOKEN,
36
36
  TRANSACTION_RUNNER_TOKEN
37
37
  } from "../chunk-OUDSQ3PU.js";
38
- import "../chunk-QUZU2M33.js";
39
38
  import "../chunk-AOQJEYOL.js";
40
39
  import "../chunk-SABTXESR.js";
40
+ import "../chunk-QUZU2M33.js";
41
41
  import "../chunk-SHUYVCID.js";
42
42
  export {
43
43
  ENTITLEMENT_RESOLUTION_CONFIG_TOKEN,
package/dist/index.d.cts CHANGED
@@ -9,7 +9,7 @@ export { AddSubscriptionBundleDto, AjvErrorLike, BILLING_FEATURE_UI_REGISTRY_TOK
9
9
  export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CANCELLATION_NOTICE_DAYS_TOKEN, c as CONTRACT_FREEZE_PORT_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as CancellableSubscription, f as CancellationDecision, g as CancellationInput, h as CancellationNoticePeriods, i as ContractFreezeBundleSnapshot, j as ContractFreezePort, k as ContractFreezeSourcePort, D as DuePendingPlanChange, F as FEATURE_GUARD_MARKER, M as MarkedFeatureGuard, P as PENDING_PLAN_QUERY_PORT_TOKEN, l as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, m as SELF_SERVICE_BLOCKED_PLANS_TOKEN, n as SUBSCRIPTION_USAGE_PORT_TOKEN, o as SUBSCRIPTION_WRITE_PORT_TOKEN, p as SelfServiceBlockedBundles, q as SelfServiceBlockedPlans, r as SubscriptionBundleControllerOptions, s as SubscriptionBundleModule, t as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, u as TENANT_ID_RESOLVER_TOKEN, v as TRIAL_PROJECTION_PORT_TOKEN, w as TenantBillingModule, x as TenantBillingModuleOptions, y as TenantIdResolver, z as TrialProjectionInput, B as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, E as USER_EMAIL_RESOLVER_TOKEN, G as USER_ID_RESOLVER_TOKEN, H as UserEmailResolver, I as UserIdResolver, J as decideCancellation, K as decideCancellationFor, L as isPlatformFeatureGuard, N as noticeDaysFor } from './tenant-billing.module-BVXDucZj.cjs';
10
10
  import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse, PlatformErrorCode, PlatformErrorBody } from '@saasicat/core';
11
11
  export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/core';
12
- export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from './tenant-billing.controller-CGfCLtzu.cjs';
12
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from './tenant-billing.controller-DElYt3Aa.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-Bsg1g9Q0.cjs';
14
14
  export { CancellationDates, ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, ENTITLEMENT_SERVICE_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, cancellationHasLanded, cancellationLandsAt, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.cjs';
15
15
  export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CwUy_OqC.cjs';
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { AddSubscriptionBundleDto, AjvErrorLike, BILLING_FEATURE_UI_REGISTRY_TOK
9
9
  export { A as AUDIT_CONTEXT_RESOLVER_TOKEN, a as AuditContextResolver, b as AuthGuardList, C as CANCELLATION_NOTICE_DAYS_TOKEN, c as CONTRACT_FREEZE_PORT_TOKEN, d as CONTRACT_FREEZE_SOURCE_PORT_TOKEN, e as CancellableSubscription, f as CancellationDecision, g as CancellationInput, h as CancellationNoticePeriods, i as ContractFreezeBundleSnapshot, j as ContractFreezePort, k as ContractFreezeSourcePort, D as DuePendingPlanChange, F as FEATURE_GUARD_MARKER, M as MarkedFeatureGuard, P as PENDING_PLAN_QUERY_PORT_TOKEN, l as PendingPlanQueryPort, S as SELF_SERVICE_BLOCKED_BUNDLES_TOKEN, m as SELF_SERVICE_BLOCKED_PLANS_TOKEN, n as SUBSCRIPTION_USAGE_PORT_TOKEN, o as SUBSCRIPTION_WRITE_PORT_TOKEN, p as SelfServiceBlockedBundles, q as SelfServiceBlockedPlans, r as SubscriptionBundleControllerOptions, s as SubscriptionBundleModule, t as SubscriptionBundleModuleOptions, T as TENANT_AUTH_GUARDS_TOKEN, u as TENANT_ID_RESOLVER_TOKEN, v as TRIAL_PROJECTION_PORT_TOKEN, w as TenantBillingModule, x as TenantBillingModuleOptions, y as TenantIdResolver, z as TrialProjectionInput, B as TrialProjectionPort, U as USAGE_SNAPSHOT_PORT_TOKEN, E as USER_EMAIL_RESOLVER_TOKEN, G as USER_ID_RESOLVER_TOKEN, H as UserEmailResolver, I as UserIdResolver, J as decideCancellation, K as decideCancellationFor, L as isPlatformFeatureGuard, N as noticeDaysFor } from './tenant-billing.module-C7rgy1jA.js';
10
10
  import { SetupStatusResponse, SetupResult, SetupConfirmMfaResponse, PlatformErrorCode, PlatformErrorBody } from '@saasicat/core';
11
11
  export { BundleVersionFields, ChangeDirection, DiffResult, DiscoveredCapability, DiscoveredFeature, DiscoveredQuota, DiscoverySnapshot, PasswordHasher, PlanVersionFields, VersionChange, VersionChangeDirection, classifyBundleVersionDiff, classifyPlanDiff } from '@saasicat/core';
12
- export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from './tenant-billing.controller-D9rtguyx.js';
12
+ export { A as AddBundleToSubscriptionInput, B as BundlePreviewSnapshot, C as CancelBundleFromSubscriptionInput, a as CancelSubscriptionDto, b as ChangePlanDto, c as CompleteOnboardingSubscriptionDto, d as ComposedTenantAuthGuard, e as CycleDirection, L as LimitsCheckRow, P as PendingPlanMaterializationService, f as PlanChangeContext, g as PlanChangePreviewDto, h as PlanChangePreviewIssue, i as PlanChangePreviewService, j as PlanChangeType, k as PlanDirection, l as PlanSnapshotDto, m as PreviewPlanChangeDto, n as ProrationDto, o as ProrationInput, R as RedundantFeatureHint, S as SubscriptionBundleAddPreviewDto, p as SubscriptionBundleCancelPreviewDto, q as SubscriptionBundleConfig, r as SubscriptionBundlePreviewContext, s as SubscriptionBundlePreviewIssue, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController, U as UsageResponse, w as addMonths, x as clampToParent, y as computeProration, z as resolveBundleCancelEffectiveAt } from './tenant-billing.controller-CVDMTGx6.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-53yv4-rr.js';
14
14
  export { CancellationDates, ENTITLEMENT_RESOLUTION_CONFIG_TOKEN, ENTITLEMENT_SERVICE_TOKEN, EntitlementModule, EntitlementModuleOptions, LimitExceededError, PLAN_VERSION_REPOSITORY_TOKEN, ReplacedByIndex, SUBSCRIPTION_REPOSITORY_TOKEN, TRANSACTION_RUNNER_TOKEN, buildReplacedByIndex, cancellationHasLanded, cancellationLandsAt, expandReplacedFeatures, isLimitExceededError } from './entitlement/index.js';
15
15
  export { E as EntitlementResolutionConfig, a as EntitlementResolutionInput, r as resolveEntitlementPlan } from './plan-resolution-CwUy_OqC.js';
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ import {
66
66
  decideRenewal,
67
67
  loadPlanCatalogFromFile,
68
68
  loadPlanCatalogFromString
69
- } from "./chunk-BYINBUNY.js";
69
+ } from "./chunk-GHIECNF3.js";
70
70
  import {
71
71
  formatPreflightReport,
72
72
  formatSeedGateReport,
@@ -75,7 +75,8 @@ import {
75
75
  runSeedGateFromFile,
76
76
  seedGateExitCode,
77
77
  validateSeedAgainstSnapshot
78
- } from "./chunk-E74DRQJM.js";
78
+ } from "./chunk-GG5NHRH5.js";
79
+ import "./chunk-DBZGV3HC.js";
79
80
  import {
80
81
  DefinesQuota,
81
82
  EnforceQuota,
@@ -88,7 +89,6 @@ import {
88
89
  loadDiscoverySnapshotFromFile
89
90
  } from "./chunk-74SCJ4HF.js";
90
91
  import "./chunk-G7RQO2XO.js";
91
- import "./chunk-DBZGV3HC.js";
92
92
  import {
93
93
  defineSaaSiCat
94
94
  } from "./chunk-OYNHOY45.js";
@@ -99,7 +99,7 @@ import {
99
99
  SetupController,
100
100
  SetupModule,
101
101
  SetupService
102
- } from "./chunk-RCZ7ZGKU.js";
102
+ } from "./chunk-2BNZK22P.js";
103
103
  import {
104
104
  CreatePromoCodeDto,
105
105
  PreviewPromoCodeDto,
@@ -111,10 +111,10 @@ import {
111
111
  buildPromoCodeAdminController,
112
112
  hashIp,
113
113
  ipFingerprint
114
- } from "./chunk-EASFDWXV.js";
114
+ } from "./chunk-JNONSUP3.js";
115
115
  import {
116
116
  SubscriptionContractModule
117
- } from "./chunk-MEVY2ZZG.js";
117
+ } from "./chunk-L4VVZ4O5.js";
118
118
  import {
119
119
  ADMIN_MANIFEST_CONFIG,
120
120
  ADMIN_RESOURCES_PORT_TOKEN,
@@ -141,7 +141,7 @@ import {
141
141
  SuperAdminGuard,
142
142
  SuspendTenantDto,
143
143
  buildAdminStatsController
144
- } from "./chunk-3Y4USRJS.js";
144
+ } from "./chunk-LTT736P3.js";
145
145
  import {
146
146
  AddSubscriptionBundleDto,
147
147
  BILLING_FEATURE_UI_REGISTRY_TOKEN,
@@ -195,7 +195,7 @@ import {
195
195
  resolveBundleCancelEffectiveAt,
196
196
  resolvePlanAnchorDay,
197
197
  retreatOneCycle
198
- } from "./chunk-NT4ZGXPA.js";
198
+ } from "./chunk-TJ5E42WX.js";
199
199
  import {
200
200
  CODE_MAX_LENGTH,
201
201
  CODE_MIN_LENGTH,
@@ -220,7 +220,7 @@ import {
220
220
  contractLineItemToInvoiceLineItem,
221
221
  sortContractLineItemsForInvoice,
222
222
  subscriptionContractToInvoiceSnapshot
223
- } from "./chunk-65ADCLHU.js";
223
+ } from "./chunk-F7P2X2DR.js";
224
224
  import {
225
225
  ADVISORY_STRICT_MODE_CODES,
226
226
  BUNDLE_VERSION_WINDOW_CODES,
@@ -270,7 +270,7 @@ import {
270
270
  resolveValidityWindow,
271
271
  validateBundleDraft,
272
272
  validatePlanDraft
273
- } from "./chunk-L33BM4EN.js";
273
+ } from "./chunk-DFQETRBL.js";
274
274
  import {
275
275
  AUDIT_CONTEXT_RESOLVER_TOKEN,
276
276
  CANCELLATION_NOTICE_DAYS_TOKEN,
@@ -294,6 +294,20 @@ import {
294
294
  MFA_PORT_TOKEN,
295
295
  RLS_BYPASS_PORT_TOKEN
296
296
  } from "./chunk-O2J2HDXA.js";
297
+ import {
298
+ CHECKOUT_OFFER_REPOSITORY_TOKEN,
299
+ CheckoutOfferModule,
300
+ CheckoutOfferService,
301
+ CreateCheckoutOfferDto,
302
+ UpdateCheckoutOfferDto,
303
+ buildCheckoutOfferController
304
+ } from "./chunk-RUTPEAZL.js";
305
+ import "./chunk-BSK6YBLI.js";
306
+ import {
307
+ SAASICAT_PUBLIC_ROUTE_KEY,
308
+ SaaSiCatPublicRoute,
309
+ isSaaSiCatPublicRoute
310
+ } from "./chunk-YSC46BGM.js";
297
311
  import {
298
312
  DiscoveryModule,
299
313
  buildDiscoveryController
@@ -306,7 +320,7 @@ import {
306
320
  } from "./chunk-WXYJHZCN.js";
307
321
  import {
308
322
  EntitlementModule
309
- } from "./chunk-DRMSHMOB.js";
323
+ } from "./chunk-DQW3DHSD.js";
310
324
  import {
311
325
  EntitlementService,
312
326
  LimitExceededError,
@@ -331,7 +345,7 @@ import {
331
345
  mergeSubscriptionBundlesIntoLimits,
332
346
  resolveEntitlementPlan,
333
347
  toEffectiveLimitsSnapshot
334
- } from "./chunk-SO2NH2A6.js";
348
+ } from "./chunk-IW5XGOEU.js";
335
349
  import {
336
350
  PLAN_CATALOG_READ_SINK_TOKEN,
337
351
  PLAN_CATALOG_TOKEN,
@@ -363,27 +377,6 @@ import {
363
377
  SUBSCRIPTION_REPOSITORY_TOKEN,
364
378
  TRANSACTION_RUNNER_TOKEN
365
379
  } from "./chunk-OUDSQ3PU.js";
366
- import {
367
- DEFINES_QUOTA_KEY,
368
- DISCOVERY_SNAPSHOT_TOKEN,
369
- ENFORCE_QUOTA_KEY,
370
- IMPLEMENTS_CAPABILITY_KEY,
371
- REQUIRES_CAPABILITY_KEY
372
- } from "./chunk-QUZU2M33.js";
373
- import {
374
- CHECKOUT_OFFER_REPOSITORY_TOKEN,
375
- CheckoutOfferModule,
376
- CheckoutOfferService,
377
- CreateCheckoutOfferDto,
378
- UpdateCheckoutOfferDto,
379
- buildCheckoutOfferController
380
- } from "./chunk-RUTPEAZL.js";
381
- import "./chunk-BSK6YBLI.js";
382
- import {
383
- SAASICAT_PUBLIC_ROUTE_KEY,
384
- SaaSiCatPublicRoute,
385
- isSaaSiCatPublicRoute
386
- } from "./chunk-YSC46BGM.js";
387
380
  import {
388
381
  BUNDLE_REPOSITORY_TOKEN,
389
382
  CATALOG_ENTRY_REPOSITORY_TOKEN,
@@ -397,6 +390,13 @@ import {
397
390
  import {
398
391
  asProvider
399
392
  } from "./chunk-SABTXESR.js";
393
+ import {
394
+ DEFINES_QUOTA_KEY,
395
+ DISCOVERY_SNAPSHOT_TOKEN,
396
+ ENFORCE_QUOTA_KEY,
397
+ IMPLEMENTS_CAPABILITY_KEY,
398
+ REQUIRES_CAPABILITY_KEY
399
+ } from "./chunk-QUZU2M33.js";
400
400
  import "./chunk-SHUYVCID.js";
401
401
  export {
402
402
  ACTIVATION_ORCHESTRATOR_TOKEN,
@@ -13,7 +13,7 @@ export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminMan
13
13
  export { A as AdminAuditService } from '../admin-audit.service-4P3Djdxk.cjs';
14
14
  export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-CpvzcfCc.cjs';
15
15
  export { c as EntitlementService } from '../aggregation-Bsg1g9Q0.cjs';
16
- export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, i as PlanChangePreviewService, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController } from '../tenant-billing.controller-CGfCLtzu.cjs';
16
+ export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, i as PlanChangePreviewService, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController } from '../tenant-billing.controller-DElYt3Aa.cjs';
17
17
  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-7z7fbLFe.cjs';
18
18
  export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.cjs';
19
19
  export { i as PromoCodesService } from '../promo.service-BJbKAmw3.cjs';
@@ -13,7 +13,7 @@ export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminMan
13
13
  export { A as AdminAuditService } from '../admin-audit.service-4P3Djdxk.js';
14
14
  export { e as AdminResourcesService, f as AdminStatsModule, g as AdminStatsModuleOptions } from '../admin-resources.module-DF5_Q7RD.js';
15
15
  export { c as EntitlementService } from '../aggregation-53yv4-rr.js';
16
- export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, i as PlanChangePreviewService, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController } from '../tenant-billing.controller-D9rtguyx.js';
16
+ export { d as ComposedTenantAuthGuard, P as PendingPlanMaterializationService, i as PlanChangePreviewService, t as SubscriptionBundlePreviewService, u as SubscriptionBundlesService, T as TenantAdminGuard, v as TenantBillingController } from '../tenant-billing.controller-CVDMTGx6.js';
17
17
  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-tlRtuf2o.js';
18
18
  export { P as PromoCodeRateLimitGuard } from '../rate-limit.guard-dntqAlfZ.js';
19
19
  export { i as PromoCodesService } from '../promo.service-BJbKAmw3.js';
@@ -28,13 +28,13 @@ import {
28
28
  docsUrlFor,
29
29
  findViolations,
30
30
  headingSlug
31
- } from "../chunk-RCZ7ZGKU.js";
31
+ } from "../chunk-2BNZK22P.js";
32
32
  import {
33
33
  PromoCodeRateLimitGuard
34
- } from "../chunk-EASFDWXV.js";
34
+ } from "../chunk-JNONSUP3.js";
35
35
  import {
36
36
  SubscriptionContractModule
37
- } from "../chunk-MEVY2ZZG.js";
37
+ } from "../chunk-L4VVZ4O5.js";
38
38
  import {
39
39
  AdminBypassRlsInterceptor,
40
40
  AdminManifestModule,
@@ -46,7 +46,7 @@ import {
46
46
  MfaGuard,
47
47
  MfaService,
48
48
  SuperAdminGuard
49
- } from "../chunk-3Y4USRJS.js";
49
+ } from "../chunk-LTT736P3.js";
50
50
  import {
51
51
  ComposedTenantAuthGuard,
52
52
  PendingPlanMaterializationService,
@@ -55,13 +55,13 @@ import {
55
55
  SubscriptionBundlesService,
56
56
  TenantAdminGuard,
57
57
  TenantBillingController
58
- } from "../chunk-NT4ZGXPA.js";
58
+ } from "../chunk-TJ5E42WX.js";
59
59
  import {
60
60
  PromoCodesService
61
61
  } from "../chunk-7JEXCHMU.js";
62
62
  import {
63
63
  SubscriptionContractService
64
- } from "../chunk-65ADCLHU.js";
64
+ } from "../chunk-F7P2X2DR.js";
65
65
  import {
66
66
  BundlesService,
67
67
  CatalogEntriesService,
@@ -71,24 +71,11 @@ import {
71
71
  PlansService,
72
72
  PromotionsService,
73
73
  PublicMarketingCatalogService
74
- } from "../chunk-L33BM4EN.js";
74
+ } from "../chunk-DFQETRBL.js";
75
75
  import "../chunk-X7CWHRSK.js";
76
76
  import {
77
77
  AdminAuditService
78
78
  } from "../chunk-O2J2HDXA.js";
79
- import "../chunk-XBYAFEOR.js";
80
- import {
81
- DiscoveryScanner
82
- } from "../chunk-WXYJHZCN.js";
83
- import "../chunk-DRMSHMOB.js";
84
- import {
85
- EntitlementService
86
- } from "../chunk-SO2NH2A6.js";
87
- import "../chunk-UUFUSKX2.js";
88
- import "../chunk-VBRYPU7V.js";
89
- import "../chunk-57V6ZTI6.js";
90
- import "../chunk-OUDSQ3PU.js";
91
- import "../chunk-QUZU2M33.js";
92
79
  import {
93
80
  CheckoutOfferModule,
94
81
  CheckoutOfferService
@@ -99,8 +86,21 @@ import {
99
86
  SaaSiCatPublicRoute,
100
87
  isSaaSiCatPublicRoute
101
88
  } from "../chunk-YSC46BGM.js";
89
+ import "../chunk-XBYAFEOR.js";
90
+ import {
91
+ DiscoveryScanner
92
+ } from "../chunk-WXYJHZCN.js";
93
+ import "../chunk-DQW3DHSD.js";
94
+ import {
95
+ EntitlementService
96
+ } from "../chunk-IW5XGOEU.js";
97
+ import "../chunk-UUFUSKX2.js";
98
+ import "../chunk-VBRYPU7V.js";
99
+ import "../chunk-57V6ZTI6.js";
100
+ import "../chunk-OUDSQ3PU.js";
102
101
  import "../chunk-AOQJEYOL.js";
103
102
  import "../chunk-SABTXESR.js";
103
+ import "../chunk-QUZU2M33.js";
104
104
  import "../chunk-SHUYVCID.js";
105
105
  export {
106
106
  AdminAuditService,
@@ -10,7 +10,7 @@ import {
10
10
  buildPromoCodeAdminController,
11
11
  hashIp,
12
12
  ipFingerprint
13
- } from "../chunk-EASFDWXV.js";
13
+ } from "../chunk-JNONSUP3.js";
14
14
  import {
15
15
  CODE_MAX_LENGTH,
16
16
  CODE_MIN_LENGTH,
@@ -31,13 +31,13 @@ import {
31
31
  computeRegularStartsAt
32
32
  } from "../chunk-7JEXCHMU.js";
33
33
  import "../chunk-O2J2HDXA.js";
34
+ import "../chunk-YSC46BGM.js";
34
35
  import {
35
36
  computeIncludedVat,
36
37
  grossFromNet,
37
38
  round2
38
39
  } from "../chunk-UUFUSKX2.js";
39
40
  import "../chunk-57V6ZTI6.js";
40
- import "../chunk-YSC46BGM.js";
41
41
  import "../chunk-SABTXESR.js";
42
42
  import "../chunk-SHUYVCID.js";
43
43
  export {
@@ -1,17 +1,17 @@
1
1
  import "../chunk-2SLTRKXC.js";
2
2
  import {
3
3
  SubscriptionContractModule
4
- } from "../chunk-MEVY2ZZG.js";
4
+ } from "../chunk-L4VVZ4O5.js";
5
5
  import {
6
6
  SubscriptionContractService,
7
7
  contractLineItemToInvoiceLineItem,
8
8
  sortContractLineItemsForInvoice,
9
9
  subscriptionContractToInvoiceSnapshot
10
- } from "../chunk-65ADCLHU.js";
10
+ } from "../chunk-F7P2X2DR.js";
11
+ import "../chunk-BSK6YBLI.js";
11
12
  import {
12
13
  SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
13
14
  } from "../chunk-VBRYPU7V.js";
14
- import "../chunk-BSK6YBLI.js";
15
15
  import "../chunk-SABTXESR.js";
16
16
  import "../chunk-SHUYVCID.js";
17
17
  export {
@@ -90,7 +90,23 @@ interface LimitsCheckRow {
90
90
  }
91
91
  interface PlanChangePreviewIssue {
92
92
  code: string;
93
+ /**
94
+ * English display text, and the last rung of the ladder rather than the
95
+ * first: `resolveErrorMessage` prefers the reader's catalogue and reaches
96
+ * this only for a code nobody has translated. It stays on the wire because
97
+ * a blocker that renders as an empty line leaves someone with a disabled
98
+ * button and no reason.
99
+ */
93
100
  message: string;
101
+ /**
102
+ * The values the sentence needs, beside it rather than inside it.
103
+ *
104
+ * Without these a client holding the code still cannot rebuild the
105
+ * sentence — it would have to parse English prose for the numbers. Every
106
+ * template in the shipped catalogues names only what appears here, and
107
+ * `preview-issues-are-translatable.test.js` holds that.
108
+ */
109
+ params?: Record<string, string | number>;
94
110
  }
95
111
  interface PlanChangePreviewDto {
96
112
  changeType: PlanChangeType;
@@ -90,7 +90,23 @@ interface LimitsCheckRow {
90
90
  }
91
91
  interface PlanChangePreviewIssue {
92
92
  code: string;
93
+ /**
94
+ * English display text, and the last rung of the ladder rather than the
95
+ * first: `resolveErrorMessage` prefers the reader's catalogue and reaches
96
+ * this only for a code nobody has translated. It stays on the wire because
97
+ * a blocker that renders as an empty line leaves someone with a disabled
98
+ * button and no reason.
99
+ */
93
100
  message: string;
101
+ /**
102
+ * The values the sentence needs, beside it rather than inside it.
103
+ *
104
+ * Without these a client holding the code still cannot rebuild the
105
+ * sentence — it would have to parse English prose for the numbers. Every
106
+ * template in the shipped catalogues names only what appears here, and
107
+ * `preview-issues-are-translatable.test.js` holds that.
108
+ */
109
+ params?: Record<string, string | number>;
94
110
  }
95
111
  interface PlanChangePreviewDto {
96
112
  changeType: PlanChangeType;
@@ -5,30 +5,30 @@ import {
5
5
  StaticEntitlementService,
6
6
  StaticFeatureGuard,
7
7
  StaticPlanResolver
8
- } from "../chunk-RCZ7ZGKU.js";
9
- import "../chunk-EASFDWXV.js";
10
- import "../chunk-MEVY2ZZG.js";
11
- import "../chunk-3Y4USRJS.js";
12
- import "../chunk-NT4ZGXPA.js";
8
+ } from "../chunk-2BNZK22P.js";
9
+ import "../chunk-JNONSUP3.js";
10
+ import "../chunk-L4VVZ4O5.js";
11
+ import "../chunk-LTT736P3.js";
12
+ import "../chunk-TJ5E42WX.js";
13
13
  import "../chunk-7JEXCHMU.js";
14
- import "../chunk-65ADCLHU.js";
15
- import "../chunk-L33BM4EN.js";
14
+ import "../chunk-F7P2X2DR.js";
15
+ import "../chunk-DFQETRBL.js";
16
16
  import "../chunk-X7CWHRSK.js";
17
17
  import "../chunk-O2J2HDXA.js";
18
+ import "../chunk-RUTPEAZL.js";
19
+ import "../chunk-BSK6YBLI.js";
20
+ import "../chunk-YSC46BGM.js";
18
21
  import "../chunk-XBYAFEOR.js";
19
22
  import "../chunk-WXYJHZCN.js";
20
- import "../chunk-DRMSHMOB.js";
21
- import "../chunk-SO2NH2A6.js";
23
+ import "../chunk-DQW3DHSD.js";
24
+ import "../chunk-IW5XGOEU.js";
22
25
  import "../chunk-UUFUSKX2.js";
23
26
  import "../chunk-VBRYPU7V.js";
24
27
  import "../chunk-57V6ZTI6.js";
25
28
  import "../chunk-OUDSQ3PU.js";
26
- import "../chunk-QUZU2M33.js";
27
- import "../chunk-RUTPEAZL.js";
28
- import "../chunk-BSK6YBLI.js";
29
- import "../chunk-YSC46BGM.js";
30
29
  import "../chunk-AOQJEYOL.js";
31
30
  import "../chunk-SABTXESR.js";
31
+ import "../chunk-QUZU2M33.js";
32
32
  import {
33
33
  __name
34
34
  } from "../chunk-SHUYVCID.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasicat/nest",
3
- "version": "1.0.0-rc.7",
3
+ "version": "1.0.0-rc.8",
4
4
  "description": "NestJS implementation of SaaSiCat: capability discovery, catalog packaging, contracts, entitlement enforcement, billing and admin APIs.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -138,8 +138,8 @@
138
138
  "js-yaml": "^4.3.1",
139
139
  "otplib": "^13.4.1",
140
140
  "qrcode": "^1.5.4",
141
- "@saasicat/spec": "^1.0.0-rc.7",
142
- "@saasicat/core": "^1.0.0-rc.7"
141
+ "@saasicat/spec": "^1.0.0-rc.8",
142
+ "@saasicat/core": "^1.0.0-rc.8"
143
143
  },
144
144
  "peerDependencies": {
145
145
  "@nestjs/common": "^11.0.0",
@@ -10,18 +10,15 @@ import {
10
10
  import {
11
11
  AdminAuditService
12
12
  } from "./chunk-O2J2HDXA.js";
13
+ import {
14
+ SaaSiCatPublicRoute
15
+ } from "./chunk-YSC46BGM.js";
13
16
  import {
14
17
  DiscoveryScanner
15
18
  } from "./chunk-WXYJHZCN.js";
16
19
  import {
17
20
  SUBSCRIPTION_REPOSITORY_TOKEN
18
21
  } from "./chunk-OUDSQ3PU.js";
19
- import {
20
- DISCOVERY_SNAPSHOT_TOKEN
21
- } from "./chunk-QUZU2M33.js";
22
- import {
23
- SaaSiCatPublicRoute
24
- } from "./chunk-YSC46BGM.js";
25
22
  import {
26
23
  BUNDLE_REPOSITORY_TOKEN,
27
24
  CATALOG_ENTRY_REPOSITORY_TOKEN,
@@ -35,6 +32,9 @@ import {
35
32
  import {
36
33
  asProvider
37
34
  } from "./chunk-SABTXESR.js";
35
+ import {
36
+ DISCOVERY_SNAPSHOT_TOKEN
37
+ } from "./chunk-QUZU2M33.js";
38
38
  import {
39
39
  __name
40
40
  } from "./chunk-SHUYVCID.js";
@@ -1,9 +1,9 @@
1
- import {
2
- SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
3
- } from "./chunk-VBRYPU7V.js";
4
1
  import {
5
2
  appendImplicitDiscountLineItem
6
3
  } from "./chunk-BSK6YBLI.js";
4
+ import {
5
+ SUBSCRIPTION_CONTRACT_REPOSITORY_TOKEN
6
+ } from "./chunk-VBRYPU7V.js";
7
7
  import {
8
8
  __name
9
9
  } from "./chunk-SHUYVCID.js";
@@ -14,12 +14,12 @@ import {
14
14
  SUBSCRIPTION_REPOSITORY_TOKEN,
15
15
  TRANSACTION_RUNNER_TOKEN
16
16
  } from "./chunk-OUDSQ3PU.js";
17
- import {
18
- DISCOVERY_SNAPSHOT_TOKEN
19
- } from "./chunk-QUZU2M33.js";
20
17
  import {
21
18
  BUNDLE_REPOSITORY_TOKEN
22
19
  } from "./chunk-AOQJEYOL.js";
20
+ import {
21
+ DISCOVERY_SNAPSHOT_TOKEN
22
+ } from "./chunk-QUZU2M33.js";
23
23
  import {
24
24
  __name
25
25
  } from "./chunk-SHUYVCID.js";
@@ -12,12 +12,12 @@ import {
12
12
  import {
13
13
  AdminAuditService
14
14
  } from "./chunk-O2J2HDXA.js";
15
- import {
16
- codedError
17
- } from "./chunk-57V6ZTI6.js";
18
15
  import {
19
16
  SaaSiCatPublicRoute
20
17
  } from "./chunk-YSC46BGM.js";
18
+ import {
19
+ codedError
20
+ } from "./chunk-57V6ZTI6.js";
21
21
  import {
22
22
  asProvider
23
23
  } from "./chunk-SABTXESR.js";
@@ -4,12 +4,12 @@ import {
4
4
  MFA_PORT_TOKEN,
5
5
  RLS_BYPASS_PORT_TOKEN
6
6
  } from "./chunk-O2J2HDXA.js";
7
- import {
8
- codedError
9
- } from "./chunk-57V6ZTI6.js";
10
7
  import {
11
8
  SaaSiCatPublicRoute
12
9
  } from "./chunk-YSC46BGM.js";
10
+ import {
11
+ codedError
12
+ } from "./chunk-57V6ZTI6.js";
13
13
  import {
14
14
  asProvider
15
15
  } from "./chunk-SABTXESR.js";