@saasicat/nest 1.0.0-rc.2 → 1.0.0-rc.21
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/README.md +44 -8
- package/dist/.build-stamp +1 -1
- package/dist/_entries.cjs +10214 -4796
- package/dist/admin/index.d.cts +5 -4
- package/dist/admin/index.d.ts +5 -4
- package/dist/admin/index.js +13 -9
- package/dist/{admin-resources.module-CpvzcfCc.d.cts → admin-resources.module-B4XNvdH-.d.cts} +1 -2
- package/dist/{admin-resources.module-DF5_Q7RD.d.ts → admin-resources.module-CWqdI9BV.d.ts} +1 -2
- package/dist/{admin-stats.service-TYiSUwIR.d.ts → admin-stats.service-CsLNt19Z.d.ts} +11 -7
- package/dist/{admin-stats.service-DfKupywR.d.cts → admin-stats.service-DrZrU8IJ.d.cts} +11 -7
- package/dist/{aggregation-B3CD0v_d.d.cts → aggregation-ChpZDh0g.d.ts} +39 -6
- package/dist/{aggregation-BFzW07DE.d.ts → aggregation-OpnhwzF5.d.cts} +39 -6
- package/dist/billing/index.d.cts +448 -108
- package/dist/billing/index.d.ts +448 -108
- package/dist/billing/index.js +108 -41
- package/dist/catalog/index.d.cts +74 -45
- package/dist/catalog/index.d.ts +74 -45
- package/dist/catalog/index.js +21 -13
- package/dist/catalog.module-C9O7BxRq.d.ts +180 -0
- package/dist/catalog.module-T-I5Ricz.d.cts +180 -0
- package/dist/checkout-offer/index.d.cts +17 -22
- package/dist/checkout-offer/index.d.ts +17 -22
- package/dist/checkout-offer/index.js +21 -7
- package/dist/checkout-offer.module-DFhGy6JO.d.cts +58 -0
- package/dist/checkout-offer.module-x7SP_dX4.d.ts +58 -0
- package/dist/checkout-offer.service-BeHgYikI.d.ts +242 -0
- package/dist/checkout-offer.service-CCVxG9b2.d.cts +242 -0
- package/dist/chunk-34XVPR6P.js +222 -0
- package/dist/{chunk-AOQJEYOL.js → chunk-3QVGA6JX.js} +3 -1
- package/dist/chunk-3RLWML2S.js +896 -0
- package/dist/{chunk-TXC3LHHB.js → chunk-4SDSYV4A.js} +21 -13
- package/dist/chunk-55QEDAMX.js +946 -0
- package/dist/chunk-5CKC7O52.js +140 -0
- package/dist/chunk-6PJE7EWO.js +185 -0
- package/dist/chunk-7NJKVC5X.js +353 -0
- package/dist/{chunk-RUNZ3X4C.js → chunk-AOS2JPDD.js} +1263 -185
- package/dist/{chunk-WOVQPXV4.js → chunk-CQ2ZZMTD.js} +702 -725
- package/dist/{chunk-NA6O63B7.js → chunk-F5X66HF5.js} +5 -5
- package/dist/chunk-FEQZCWUL.js +174 -0
- package/dist/{chunk-VIJ5NJWC.js → chunk-G6EZWECL.js} +107 -31
- package/dist/chunk-G7RQO2XO.js +0 -0
- package/dist/{chunk-N3L3AICU.js → chunk-GPQWGA6B.js} +5 -6
- package/dist/chunk-GZTL64QK.js +7 -0
- package/dist/{chunk-SABTXESR.js → chunk-J7NJRK3K.js} +17 -1
- package/dist/{chunk-SEPN52AD.js → chunk-JBCC6C3M.js} +566 -307
- package/dist/{chunk-I7GTA3RX.js → chunk-JQRA724W.js} +1 -1
- package/dist/{chunk-WXYJHZCN.js → chunk-JVAEKTJ4.js} +2 -14
- package/dist/chunk-KPEMTBOP.js +26 -0
- package/dist/chunk-LF6J4YYN.js +301 -0
- package/dist/{chunk-LTT736P3.js → chunk-LLYVYRGJ.js} +228 -387
- package/dist/{chunk-6Z7JR4EW.js → chunk-M47BNEY2.js} +1897 -633
- package/dist/{chunk-KFT5AIIH.js → chunk-NDLC5GYK.js} +206 -24
- package/dist/{chunk-O2J2HDXA.js → chunk-OOTEXP47.js} +3 -8
- package/dist/chunk-QPVDCKYS.js +702 -0
- package/dist/{chunk-NHVDCYK5.js → chunk-R5YCJBHY.js} +71 -106
- package/dist/{chunk-XBYAFEOR.js → chunk-S33SO5XX.js} +1 -1
- package/dist/chunk-SZ7RFPXA.js +10 -0
- package/dist/chunk-TBBZWZQT.js +98 -0
- package/dist/chunk-TOEFN7DN.js +295 -0
- package/dist/{chunk-7ZEGFL42.js → chunk-WHJSYKNC.js} +6 -6
- package/dist/chunk-WOEJ6K7M.js +55 -0
- package/dist/{chunk-AU3OOREM.js → chunk-XSSWYPP5.js} +16 -3
- package/dist/contract-line-item-money-B0Z3Ogur.d.cts +43 -0
- package/dist/contract-line-item-money-B0Z3Ogur.d.ts +43 -0
- package/dist/discovery/index.d.cts +2 -2
- package/dist/discovery/index.d.ts +2 -2
- package/dist/discovery/index.js +6 -6
- package/dist/{discovery.scanner-9cMqF95o.d.cts → discovery.scanner-DXKc6JkV.d.cts} +1 -1
- package/dist/{discovery.scanner-9cMqF95o.d.ts → discovery.scanner-DXKc6JkV.d.ts} +1 -1
- package/dist/{enforce-quota.interceptor-Df0e3OWe.d.cts → enforce-quota.interceptor-BFyVdWe8.d.cts} +6 -6
- package/dist/{enforce-quota.interceptor-DW3etVyI.d.ts → enforce-quota.interceptor-GaBXboGx.d.ts} +6 -6
- package/dist/entitlement/index.d.cts +27 -4
- package/dist/entitlement/index.d.ts +27 -4
- package/dist/entitlement/index.js +13 -8
- package/dist/index.d.cts +209 -28
- package/dist/index.d.ts +209 -28
- package/dist/index.js +285 -163
- package/dist/issuer-identity.check-CBO0vcsq.d.cts +197 -0
- package/dist/issuer-identity.check-Cz9CEMkZ.d.ts +197 -0
- package/dist/{module-options-COSEb0VW.d.ts → module-options-DmQ3G4sZ.d.ts} +135 -41
- package/dist/{module-options-BG3MzQva.d.cts → module-options-qAOwinHR.d.cts} +135 -41
- package/dist/payment-callback.service-CR84Xw1Z.d.cts +125 -0
- package/dist/payment-callback.service-CR84Xw1Z.d.ts +125 -0
- package/dist/payments/index.cjs +4 -0
- package/dist/payments/index.d.cts +187 -0
- package/dist/payments/index.d.ts +187 -0
- package/dist/payments/index.js +141 -0
- package/dist/payments.module-BdUq9ot_.d.cts +57 -0
- package/dist/payments.module-CQGv_VG7.d.ts +57 -0
- package/dist/plan-catalog-source-DWe-BGY1.d.cts +21 -0
- package/dist/plan-catalog-source-DWe-BGY1.d.ts +21 -0
- package/dist/{plan-resolution-Cgo_TR1H.d.cts → plan-resolution-CwUy_OqC.d.cts} +14 -0
- package/dist/{plan-resolution-Cgo_TR1H.d.ts → plan-resolution-CwUy_OqC.d.ts} +14 -0
- package/dist/{plan-versions.service-DChhbK6h.d.ts → plan-versions.service-C0N-Em2W.d.ts} +38 -64
- package/dist/{plan-versions.service-TPEtbN0r.d.cts → plan-versions.service-DARLh-qI.d.cts} +38 -64
- package/dist/platform/index.d.cts +52 -23
- package/dist/platform/index.d.ts +52 -23
- package/dist/platform/index.js +57 -36
- package/dist/promo/index.d.cts +23 -8
- package/dist/promo/index.d.ts +23 -8
- package/dist/promo/index.js +15 -7
- package/dist/{promo.module-DtvIycpt.d.cts → promo.module-CKkECmU8.d.cts} +9 -3
- package/dist/{promo.module-Z8h1PNX-.d.ts → promo.module-DuIJdK3U.d.ts} +9 -3
- package/dist/promo.service-BYBu6dy3.d.cts +215 -0
- package/dist/promo.service-CFjfF0Xm.d.ts +215 -0
- package/dist/registration/index.d.cts +104 -47
- package/dist/registration/index.d.ts +104 -47
- package/dist/registration/index.js +15 -9
- package/dist/subscriber/index.cjs +4 -0
- package/dist/subscriber/index.d.cts +28 -0
- package/dist/subscriber/index.d.ts +28 -0
- package/dist/subscriber/index.js +16 -0
- package/dist/subscriber.service-5W6Gi-1B.d.cts +68 -0
- package/dist/subscriber.service-5W6Gi-1B.d.ts +68 -0
- package/dist/subscription-contract/index.d.cts +4 -2
- package/dist/subscription-contract/index.d.ts +4 -2
- package/dist/subscription-contract/index.js +13 -5
- package/dist/{subscription-contract.module-fDFdQ0jm.d.ts → subscription-contract.module-BfIRpc1o.d.ts} +8 -2
- package/dist/{subscription-contract.module-CEK8HS5-.d.cts → subscription-contract.module-DTMuUJYd.d.cts} +8 -2
- package/dist/{subscription-contract.service-hD87MKyg.d.cts → subscription-contract.service-CPZrTM9C.d.ts} +32 -3
- package/dist/{subscription-contract.service-hD87MKyg.d.ts → subscription-contract.service-CfNApLuP.d.cts} +32 -3
- package/dist/tenant-billing.controller-BLqbsONe.d.ts +812 -0
- package/dist/tenant-billing.controller-DKbAqTbM.d.cts +812 -0
- package/dist/tenant-billing.module-ClbjzocC.d.cts +364 -0
- package/dist/tenant-billing.module-DohgJJ2m.d.ts +364 -0
- package/dist/tenant-billing.tokens-G-1xOlMr.d.cts +129 -0
- package/dist/tenant-billing.tokens-G-1xOlMr.d.ts +129 -0
- package/dist/testing/index.d.cts +44 -17
- package/dist/testing/index.d.ts +44 -17
- package/dist/testing/index.js +189 -40
- package/package.json +24 -4
- package/dist/catalog.module-BDDO6iwq.d.cts +0 -103
- package/dist/catalog.module-BTnMsE6u.d.ts +0 -103
- package/dist/checkout-offer.module-CMtiQJTT.d.ts +0 -39
- package/dist/checkout-offer.module-CVpWrzbe.d.cts +0 -39
- package/dist/checkout-offer.service-BLOv2HOo.d.cts +0 -49
- package/dist/checkout-offer.service-BLOv2HOo.d.ts +0 -49
- package/dist/chunk-57V6ZTI6.js +0 -22
- package/dist/chunk-BSK6YBLI.js +0 -87
- package/dist/chunk-DQKCK7DX.js +0 -217
- package/dist/chunk-VXEYLNIB.js +0 -632
- package/dist/chunk-WUDYIPYH.js +0 -715
- package/dist/define-saasicat-DROBe-b1.d.ts +0 -69
- package/dist/define-saasicat-vGBCkFys.d.cts +0 -69
- package/dist/promo.service-BJbKAmw3.d.cts +0 -112
- package/dist/promo.service-BJbKAmw3.d.ts +0 -112
- package/dist/tenant-billing.controller-BQ67mlmI.d.ts +0 -438
- package/dist/tenant-billing.controller-DS8kB8a7.d.cts +0 -438
- package/dist/tenant-billing.module-BznC3XtW.d.cts +0 -299
- package/dist/tenant-billing.module-wUbsQSFG.d.ts +0 -299
- /package/dist/{chunk-2FR6ZL7R.js → chunk-BHZOH2DY.js} +0 -0
- /package/dist/{chunk-2SLTRKXC.js → chunk-DFOW3JVO.js} +0 -0
- /package/dist/{chunk-DBZGV3HC.js → chunk-DU56UKEH.js} +0 -0
- /package/dist/{chunk-OYNHOY45.js → chunk-GAUEVIAE.js} +0 -0
package/dist/catalog/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { B as BundlesService, C as CatalogEntriesService, a as CatalogServiceConfig, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService
|
|
1
|
+
export { B as BundlesService, C as CatalogEntriesService, a as CatalogServiceConfig, M as MarketingProjectionsService, b as MarketingSettingsService, P as PlanVersionsService, c as PlansService, d as PromotionsService } from '../plan-versions.service-C0N-Em2W.js';
|
|
2
2
|
import { Type, CanActivate } from '@nestjs/common';
|
|
3
|
-
export {
|
|
3
|
+
export { a as CatalogControllerConfig, b as CatalogModule, C as CatalogModuleOptions, N as NewPaymentMethodsSource, P as PublicMarketingCatalogOptions, c as PublicMarketingCatalogService } from '../catalog.module-C9O7BxRq.js';
|
|
4
4
|
import { StrictModeWarningCode, StrictModeWarning, DiscoverySnapshot, ApprovedCatalogKeys, DiscoveredQuota, CatalogEntryRepository, PlanVersionRow, BundleVersionRow, DiscoveryStatus, CatalogEntryI18n, PromotionType, PromotionValue, PromotionTargetType, PromotionBillingCycle, PromotionI18n } from '@saasicat/core';
|
|
5
|
-
import '../discovery.scanner-
|
|
5
|
+
import '../discovery.scanner-DXKc6JkV.js';
|
|
6
6
|
import '@nestjs/core';
|
|
7
7
|
import '../di-CcNeq9v-.js';
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ declare function buildPromotionsController(guards: Array<Type<CanActivate>>): Ty
|
|
|
12
12
|
|
|
13
13
|
declare function buildMarketingSettingsController(guards: Array<Type<CanActivate>>): Type;
|
|
14
14
|
|
|
15
|
-
declare function buildPublicMarketingCatalogController(guards: Array<Type<CanActivate>>,
|
|
15
|
+
declare function buildPublicMarketingCatalogController(guards: Array<Type<CanActivate>>, currency: string, vatRate: number): Type;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Builds the controller class at boot time with the guards configured by the
|
|
@@ -68,6 +68,13 @@ declare const CATALOG_SERVICE_CONFIG_TOKEN: unique symbol;
|
|
|
68
68
|
* is namespaced accordingly so the two never collide.
|
|
69
69
|
*/
|
|
70
70
|
declare const CATALOG_FEATURE_UI_REGISTRY_TOKEN: unique symbol;
|
|
71
|
+
/**
|
|
72
|
+
* Where the public catalogue reads what a new payment method is taken with —
|
|
73
|
+
* `PaymentGatewayRegistry` where the application wired payments, and `null`
|
|
74
|
+
* where it did not. Always provided, so a catalogue that answers the question
|
|
75
|
+
* cannot be wired without an answer to it.
|
|
76
|
+
*/
|
|
77
|
+
declare const NEW_PAYMENT_METHODS_SOURCE_TOKEN: unique symbol;
|
|
71
78
|
|
|
72
79
|
/**
|
|
73
80
|
* Advisory warnings (#35): they inform but never block — not even in
|
|
@@ -164,7 +171,7 @@ declare function featureApprovalSignature(featureKey: string, snapshot: Discover
|
|
|
164
171
|
*/
|
|
165
172
|
declare function quotaApprovalSignature(quota: DiscoveredQuota): string;
|
|
166
173
|
|
|
167
|
-
declare function loadApprovedCatalogKeys(repo: CatalogEntryRepository | null
|
|
174
|
+
declare function loadApprovedCatalogKeys(repo: CatalogEntryRepository | null): Promise<ApprovedCatalogKeys | null>;
|
|
168
175
|
|
|
169
176
|
interface PreflightInput {
|
|
170
177
|
snapshot: DiscoverySnapshot;
|
|
@@ -288,8 +295,41 @@ interface SeedGateRunOptions {
|
|
|
288
295
|
*/
|
|
289
296
|
declare function runSeedGateFromFile(options: SeedGateRunOptions): SeedGateReport | null;
|
|
290
297
|
|
|
298
|
+
/** What a caller may say about a version's window when publishing it. */
|
|
299
|
+
interface ValidityWindowInput {
|
|
300
|
+
validFrom?: string | null;
|
|
301
|
+
validUntil?: string | null;
|
|
302
|
+
}
|
|
303
|
+
/** The predecessor this version succeeds, or `null` for the first one. */
|
|
304
|
+
interface PreviousWindow {
|
|
305
|
+
validFrom?: string | null;
|
|
306
|
+
validUntil?: string | null;
|
|
307
|
+
}
|
|
308
|
+
/** The five refusals, named per entity so the caller keeps its own codes. */
|
|
309
|
+
interface ValidityWindowCodes {
|
|
310
|
+
readonly validFromRequired: string;
|
|
311
|
+
readonly validFromInvalid: string;
|
|
312
|
+
readonly validFromNotAfterPrevious: string;
|
|
313
|
+
readonly validFromNotGapless: string;
|
|
314
|
+
readonly validUntilInvalid: string;
|
|
315
|
+
readonly validUntilBeforeFrom: string;
|
|
316
|
+
}
|
|
317
|
+
declare const PLAN_VERSION_WINDOW_CODES: ValidityWindowCodes;
|
|
318
|
+
declare const BUNDLE_VERSION_WINDOW_CODES: ValidityWindowCodes;
|
|
319
|
+
/**
|
|
320
|
+
* Resolves the window a version is published with, or refuses the publish.
|
|
321
|
+
*
|
|
322
|
+
* `publishMeta` and `draft` are read differently on purpose. A start falls back
|
|
323
|
+
* to the draft's when the call does not carry one, but an END does so only when
|
|
324
|
+
* the call is SILENT about it: an explicit `null` there means "unbounded", and
|
|
325
|
+
* `??` would read that as "no answer" and take the draft's end instead.
|
|
326
|
+
*/
|
|
327
|
+
declare function resolveValidityWindow(publishMeta: ValidityWindowInput, draft: ValidityWindowInput, previous: PreviousWindow | null, codes: ValidityWindowCodes): {
|
|
328
|
+
validFrom: Date;
|
|
329
|
+
validUntil: Date | null;
|
|
330
|
+
};
|
|
331
|
+
|
|
291
332
|
declare class CreateBundleDto {
|
|
292
|
-
projectKey: string;
|
|
293
333
|
bundleKey: string;
|
|
294
334
|
label: string;
|
|
295
335
|
description?: string;
|
|
@@ -312,43 +352,45 @@ declare class UpdateBundleDto {
|
|
|
312
352
|
description?: string;
|
|
313
353
|
}>;
|
|
314
354
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
compatibility?: {
|
|
319
|
-
planIds?: string[];
|
|
320
|
-
};
|
|
321
|
-
pricingOverrides?: Array<{
|
|
322
|
-
planId?: string;
|
|
323
|
-
monthlyNet?: string | null;
|
|
324
|
-
yearlyNet?: string | null;
|
|
325
|
-
}>;
|
|
355
|
+
/** One plan's own price for a bundle version, in `pricingOverrides`. */
|
|
356
|
+
declare class BundlePricingOverrideDto {
|
|
357
|
+
planId?: string;
|
|
326
358
|
monthlyNet?: string | null;
|
|
327
359
|
yearlyNet?: string | null;
|
|
328
|
-
marketed?: boolean;
|
|
329
|
-
changeNote?: string;
|
|
330
|
-
baseVersionId?: string | null;
|
|
331
|
-
validFrom?: string | null;
|
|
332
|
-
validUntil?: string | null;
|
|
333
360
|
}
|
|
334
|
-
|
|
335
|
-
|
|
361
|
+
/**
|
|
362
|
+
* Everything a version draft may carry apart from its feature list.
|
|
363
|
+
*
|
|
364
|
+
* A base class rather than two copies, and the split is where the pair actually
|
|
365
|
+
* differs: a create needs features, an update may leave them alone. Everything
|
|
366
|
+
* else — quotas, compatibility, prices, the window — is optional on both, and
|
|
367
|
+
* was written out twice.
|
|
368
|
+
*
|
|
369
|
+
* `features` is deliberately NOT here. Declared in the base as optional, the
|
|
370
|
+
* inherited `@IsOptional()` would follow into the create DTO and make the one
|
|
371
|
+
* required field of that request optional again; class-validator reads the
|
|
372
|
+
* whole prototype chain.
|
|
373
|
+
*/
|
|
374
|
+
declare class BundleVersionDraftFieldsDto {
|
|
336
375
|
quotas?: Record<string, number>;
|
|
337
376
|
compatibility?: {
|
|
338
377
|
planIds?: string[];
|
|
339
378
|
};
|
|
340
|
-
pricingOverrides?:
|
|
341
|
-
planId?: string;
|
|
342
|
-
monthlyNet?: string | null;
|
|
343
|
-
yearlyNet?: string | null;
|
|
344
|
-
}>;
|
|
379
|
+
pricingOverrides?: BundlePricingOverrideDto[];
|
|
345
380
|
monthlyNet?: string | null;
|
|
346
381
|
yearlyNet?: string | null;
|
|
347
382
|
marketed?: boolean;
|
|
348
383
|
changeNote?: string;
|
|
384
|
+
baseVersionId?: string | null;
|
|
349
385
|
validFrom?: string | null;
|
|
350
386
|
validUntil?: string | null;
|
|
351
387
|
}
|
|
388
|
+
declare class CreateBundleVersionDraftDto extends BundleVersionDraftFieldsDto {
|
|
389
|
+
features: string[];
|
|
390
|
+
}
|
|
391
|
+
declare class UpdateBundleVersionDraftDto extends BundleVersionDraftFieldsDto {
|
|
392
|
+
features?: string[];
|
|
393
|
+
}
|
|
352
394
|
declare class PublishBundleVersionDto {
|
|
353
395
|
forceRegressive?: boolean;
|
|
354
396
|
/**
|
|
@@ -375,7 +417,6 @@ declare class MarketingTopFeatureDto {
|
|
|
375
417
|
strong: string;
|
|
376
418
|
}
|
|
377
419
|
declare class CreateMarketingProjectionDto {
|
|
378
|
-
projectKey: string;
|
|
379
420
|
targetType: 'PLAN' | 'BUNDLE';
|
|
380
421
|
targetVersionId: string;
|
|
381
422
|
locale?: string;
|
|
@@ -405,14 +446,12 @@ declare class UpdateMarketingProjectionDto {
|
|
|
405
446
|
highlight?: boolean;
|
|
406
447
|
}
|
|
407
448
|
declare class ListMarketingProjectionsQueryDto {
|
|
408
|
-
projectKey: string;
|
|
409
449
|
targetType?: 'PLAN' | 'BUNDLE';
|
|
410
450
|
targetVersionId?: string;
|
|
411
451
|
locale?: string;
|
|
412
452
|
}
|
|
413
453
|
|
|
414
454
|
declare class ListCatalogEntriesQueryDto {
|
|
415
|
-
projectKey: string;
|
|
416
455
|
/** Filter for features/quotas (approval lifecycle). */
|
|
417
456
|
discoveryStatus?: string;
|
|
418
457
|
/** Filter for capabilities (read-only code facts). */
|
|
@@ -431,19 +470,14 @@ declare class UpdateCatalogEntryI18nDto {
|
|
|
431
470
|
}
|
|
432
471
|
/**
|
|
433
472
|
* Body of `POST …/discovery/sync` — the discovery snapshot the UI
|
|
434
|
-
* previously loaded from `GET /admin/discovery`.
|
|
435
|
-
*
|
|
436
|
-
* SuperAdmin guard secures the source.
|
|
473
|
+
* previously loaded from `GET /admin/discovery`. Deep validation is not needed
|
|
474
|
+
* because the SuperAdmin guard secures the source.
|
|
437
475
|
*/
|
|
438
476
|
declare class SyncDiscoveryDto {
|
|
439
477
|
snapshot: DiscoverySnapshot;
|
|
440
478
|
}
|
|
441
479
|
|
|
442
|
-
declare class ListPromotionsQueryDto {
|
|
443
|
-
projectKey: string;
|
|
444
|
-
}
|
|
445
480
|
declare class CreatePromotionDto {
|
|
446
|
-
projectKey: string;
|
|
447
481
|
internalLabel: string;
|
|
448
482
|
type: PromotionType;
|
|
449
483
|
/** Type-dependent: number | { price, months }. */
|
|
@@ -477,17 +511,12 @@ declare class UpdatePromotionDto {
|
|
|
477
511
|
i18n?: PromotionI18n;
|
|
478
512
|
}
|
|
479
513
|
|
|
480
|
-
declare class ListMarketingSettingsQueryDto {
|
|
481
|
-
projectKey: string;
|
|
482
|
-
}
|
|
483
514
|
/** Body of `PUT /admin/catalog/marketing-settings`. */
|
|
484
515
|
declare class UpdateMarketingSettingsDto {
|
|
485
|
-
projectKey: string;
|
|
486
516
|
activeLocales: string[];
|
|
487
517
|
}
|
|
488
518
|
|
|
489
519
|
declare class CreatePlanDto {
|
|
490
|
-
projectKey: string;
|
|
491
520
|
planKey: string;
|
|
492
521
|
label: string;
|
|
493
522
|
description?: string;
|
|
@@ -547,4 +576,4 @@ declare class PublishPlanVersionDto {
|
|
|
547
576
|
validUntil?: string | null;
|
|
548
577
|
}
|
|
549
578
|
|
|
550
|
-
export { ADVISORY_STRICT_MODE_CODES, BUNDLE_REPOSITORY_TOKEN, CATALOG_ENTRY_REPOSITORY_TOKEN, CATALOG_FEATURE_UI_REGISTRY_TOKEN, CATALOG_SERVICE_CONFIG_TOKEN, CreateBundleDto, CreateBundleVersionDraftDto, CreateMarketingProjectionDto, CreatePlanDto, CreatePlanVersionDraftDto, CreatePromotionDto, ListCatalogEntriesQueryDto, ListMarketingProjectionsQueryDto,
|
|
579
|
+
export { ADVISORY_STRICT_MODE_CODES, BUNDLE_REPOSITORY_TOKEN, BUNDLE_VERSION_WINDOW_CODES, CATALOG_ENTRY_REPOSITORY_TOKEN, CATALOG_FEATURE_UI_REGISTRY_TOKEN, CATALOG_SERVICE_CONFIG_TOKEN, CreateBundleDto, CreateBundleVersionDraftDto, CreateMarketingProjectionDto, CreatePlanDto, CreatePlanVersionDraftDto, CreatePromotionDto, ListCatalogEntriesQueryDto, ListMarketingProjectionsQueryDto, MARKETING_PROJECTION_REPOSITORY_TOKEN, MARKETING_SETTINGS_REPOSITORY_TOKEN, NEW_PAYMENT_METHODS_SOURCE_TOKEN, PLAN_REPOSITORY_TOKEN, PLAN_VERSION_WINDOW_CODES, PROMOTION_REPOSITORY_TOKEN, type PreflightFinding, type PreflightInput, type PreflightReport, type PreviousWindow, PublishBundleVersionDto, PublishPlanVersionDto, ReviewCatalogEntryDto, type SeedBundleDraft, type SeedGateFinding, type SeedGateInput, type SeedGateMode, type SeedGateReport, type SeedGateRunOptions, type SeedPlanDraft, SyncDiscoveryDto, UpdateBundleDto, UpdateBundleVersionDraftDto, UpdateCatalogEntryI18nDto, UpdateMarketingProjectionDto, UpdateMarketingSettingsDto, UpdatePlanDto, UpdatePlanVersionDraftDto, UpdatePromotionDto, type ValidityWindowCodes, type ValidityWindowInput, blockingStrictModeWarnings, buildBundleVersionsController, buildBundlesController, buildCatalogEntriesController, buildMarketingProjectionsController, buildMarketingSettingsController, buildPlanVersionsController, buildPlansController, buildPromotionsController, buildPublicMarketingCatalogController, featureApprovalSignature, formatPreflightReport, formatSeedGateReport, loadApprovedCatalogKeys, preflightExitCode, quotaApprovalSignature, resolveValidityWindow, runPreflight, runSeedGateFromFile, seedGateExitCode, validateBundleDraft, validatePlanDraft, validateSeedAgainstSnapshot };
|
package/dist/catalog/index.js
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
runSeedGateFromFile,
|
|
7
7
|
seedGateExitCode,
|
|
8
8
|
validateSeedAgainstSnapshot
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-74SCJ4HF.js";
|
|
9
|
+
} from "../chunk-F5X66HF5.js";
|
|
11
10
|
import {
|
|
12
11
|
ADVISORY_STRICT_MODE_CODES,
|
|
12
|
+
BUNDLE_VERSION_WINDOW_CODES,
|
|
13
13
|
BundlesService,
|
|
14
14
|
CatalogEntriesService,
|
|
15
15
|
CatalogModule,
|
|
@@ -21,10 +21,9 @@ import {
|
|
|
21
21
|
CreatePromotionDto,
|
|
22
22
|
ListCatalogEntriesQueryDto,
|
|
23
23
|
ListMarketingProjectionsQueryDto,
|
|
24
|
-
ListMarketingSettingsQueryDto,
|
|
25
|
-
ListPromotionsQueryDto,
|
|
26
24
|
MarketingProjectionsService,
|
|
27
25
|
MarketingSettingsService,
|
|
26
|
+
PLAN_VERSION_WINDOW_CODES,
|
|
28
27
|
PlanVersionsService,
|
|
29
28
|
PlansService,
|
|
30
29
|
PromotionsService,
|
|
@@ -54,12 +53,16 @@ import {
|
|
|
54
53
|
featureApprovalSignature,
|
|
55
54
|
loadApprovedCatalogKeys,
|
|
56
55
|
quotaApprovalSignature,
|
|
56
|
+
resolveValidityWindow,
|
|
57
57
|
validateBundleDraft,
|
|
58
58
|
validatePlanDraft
|
|
59
|
-
} from "../chunk-
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-
|
|
62
|
-
import "../chunk-
|
|
59
|
+
} from "../chunk-CQ2ZZMTD.js";
|
|
60
|
+
import "../chunk-GZTL64QK.js";
|
|
61
|
+
import "../chunk-34XVPR6P.js";
|
|
62
|
+
import "../chunk-OOTEXP47.js";
|
|
63
|
+
import "../chunk-KPEMTBOP.js";
|
|
64
|
+
import "../chunk-74SCJ4HF.js";
|
|
65
|
+
import "../chunk-JVAEKTJ4.js";
|
|
63
66
|
import "../chunk-OUDSQ3PU.js";
|
|
64
67
|
import {
|
|
65
68
|
BUNDLE_REPOSITORY_TOKEN,
|
|
@@ -68,16 +71,20 @@ import {
|
|
|
68
71
|
CATALOG_SERVICE_CONFIG_TOKEN,
|
|
69
72
|
MARKETING_PROJECTION_REPOSITORY_TOKEN,
|
|
70
73
|
MARKETING_SETTINGS_REPOSITORY_TOKEN,
|
|
74
|
+
NEW_PAYMENT_METHODS_SOURCE_TOKEN,
|
|
71
75
|
PLAN_REPOSITORY_TOKEN,
|
|
72
76
|
PROMOTION_REPOSITORY_TOKEN
|
|
73
|
-
} from "../chunk-
|
|
74
|
-
import "../chunk-SABTXESR.js";
|
|
75
|
-
import "../chunk-WXYJHZCN.js";
|
|
77
|
+
} from "../chunk-3QVGA6JX.js";
|
|
76
78
|
import "../chunk-QUZU2M33.js";
|
|
79
|
+
import "../chunk-GPQWGA6B.js";
|
|
80
|
+
import "../chunk-SZ7RFPXA.js";
|
|
81
|
+
import "../chunk-YSC46BGM.js";
|
|
82
|
+
import "../chunk-J7NJRK3K.js";
|
|
77
83
|
import "../chunk-SHUYVCID.js";
|
|
78
84
|
export {
|
|
79
85
|
ADVISORY_STRICT_MODE_CODES,
|
|
80
86
|
BUNDLE_REPOSITORY_TOKEN,
|
|
87
|
+
BUNDLE_VERSION_WINDOW_CODES,
|
|
81
88
|
BundlesService,
|
|
82
89
|
CATALOG_ENTRY_REPOSITORY_TOKEN,
|
|
83
90
|
CATALOG_FEATURE_UI_REGISTRY_TOKEN,
|
|
@@ -92,13 +99,13 @@ export {
|
|
|
92
99
|
CreatePromotionDto,
|
|
93
100
|
ListCatalogEntriesQueryDto,
|
|
94
101
|
ListMarketingProjectionsQueryDto,
|
|
95
|
-
ListMarketingSettingsQueryDto,
|
|
96
|
-
ListPromotionsQueryDto,
|
|
97
102
|
MARKETING_PROJECTION_REPOSITORY_TOKEN,
|
|
98
103
|
MARKETING_SETTINGS_REPOSITORY_TOKEN,
|
|
99
104
|
MarketingProjectionsService,
|
|
100
105
|
MarketingSettingsService,
|
|
106
|
+
NEW_PAYMENT_METHODS_SOURCE_TOKEN,
|
|
101
107
|
PLAN_REPOSITORY_TOKEN,
|
|
108
|
+
PLAN_VERSION_WINDOW_CODES,
|
|
102
109
|
PROMOTION_REPOSITORY_TOKEN,
|
|
103
110
|
PlanVersionsService,
|
|
104
111
|
PlansService,
|
|
@@ -132,6 +139,7 @@ export {
|
|
|
132
139
|
loadApprovedCatalogKeys,
|
|
133
140
|
preflightExitCode,
|
|
134
141
|
quotaApprovalSignature,
|
|
142
|
+
resolveValidityWindow,
|
|
135
143
|
runPreflight,
|
|
136
144
|
runSeedGateFromFile,
|
|
137
145
|
seedGateExitCode,
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
|
|
2
|
+
import { PaymentMethodType, PlanRepository, MarketingProjectionRepository, PromotionRepository, CatalogEntryRepository, BundleRepository, PublicMarketingCatalogResponse, MarketingSettingsRepository, FeatureUiRegistry } from '@saasicat/core';
|
|
3
|
+
import { P as ProviderSpec } from './di-CcNeq9v-.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* What the catalogue needs of whatever knows the payment accounts: the account
|
|
7
|
+
* new payment methods are taken at, or `null` where none takes them.
|
|
8
|
+
* `PaymentGatewayRegistry` satisfies it; the shape keeps this module free of a
|
|
9
|
+
* dependency on the payments module.
|
|
10
|
+
*/
|
|
11
|
+
interface NewPaymentMethodsSource {
|
|
12
|
+
forNewPaymentMethods(): {
|
|
13
|
+
methods: readonly PaymentMethodType[];
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
16
|
+
declare class PublicMarketingCatalogService {
|
|
17
|
+
private readonly planRepo;
|
|
18
|
+
private readonly marketingRepo;
|
|
19
|
+
private readonly promotionRepo;
|
|
20
|
+
private readonly catalogEntryRepo;
|
|
21
|
+
private readonly bundleRepo;
|
|
22
|
+
private readonly newPaymentMethodsSource;
|
|
23
|
+
constructor(planRepo: PlanRepository, marketingRepo: MarketingProjectionRepository, promotionRepo: PromotionRepository, catalogEntryRepo: (CatalogEntryRepository | null) | undefined, bundleRepo: (BundleRepository | null) | undefined, newPaymentMethodsSource: NewPaymentMethodsSource | null);
|
|
24
|
+
/** What a new payment method is taken with here, for the page that offers the plans. */
|
|
25
|
+
private newPaymentMethods;
|
|
26
|
+
getCatalog(locale: string, currency: string, vatRate: number, asOf?: Date): Promise<PublicMarketingCatalogResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Loads all published-and-live bundle versions and filters on
|
|
29
|
+
* `marketed === true`. Without a registered `BundleRepository` (apps
|
|
30
|
+
* without the SuperAdmin bundle editor) the list is empty — the public
|
|
31
|
+
* catalog stays plan-only.
|
|
32
|
+
*/
|
|
33
|
+
private loadMarketedBundles;
|
|
34
|
+
/**
|
|
35
|
+
* Maps BundleVersionRow → PublicMarketingBundle. Locale resolution
|
|
36
|
+
* runs via `MarketingProjectionRepository.findByTarget('BUNDLE',
|
|
37
|
+
* bundleVersionId, locale)` — on a miss it falls back to
|
|
38
|
+
* `DEFAULT_LOCALE`. If the fallback is missing too, label/description
|
|
39
|
+
* come directly from the bundle root (denormalized in `BundleVersionRow`).
|
|
40
|
+
*
|
|
41
|
+
* If the marketing projection is `visible === false`, the bundle is
|
|
42
|
+
* hidden from the public response (preparation phase).
|
|
43
|
+
*/
|
|
44
|
+
private toPublicBundle;
|
|
45
|
+
/**
|
|
46
|
+
* Labels for bundle features ∪ their requires (#48): `comparison.features`
|
|
47
|
+
* only covers the plan-feature union — bundle-only features would
|
|
48
|
+
* otherwise get no label in the public payload. Curated keys only;
|
|
49
|
+
* without a CatalogEntryRepository the map stays empty (frontends fall
|
|
50
|
+
* back to the key).
|
|
51
|
+
*/
|
|
52
|
+
private resolveBundleFeatureLabels;
|
|
53
|
+
/** Loads the translated feature/quota labels (+ sortOrder) for a locale. */
|
|
54
|
+
private loadLabelMeta;
|
|
55
|
+
/**
|
|
56
|
+
* Resolves the displayed label of a top feature: the `label` override
|
|
57
|
+
* wins; otherwise the translated label of the referenced `key`.
|
|
58
|
+
*/
|
|
59
|
+
private resolveTopFeature;
|
|
60
|
+
/** Row definitions of the comparison matrix (feature/quota union + labels). */
|
|
61
|
+
private buildComparison;
|
|
62
|
+
private resolvePromo;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** What the auth-free pricing-page endpoint is mounted with. */
|
|
66
|
+
interface PublicMarketingCatalogOptions {
|
|
67
|
+
guards: Array<Type<CanActivate>>;
|
|
68
|
+
currency: string;
|
|
69
|
+
vatRate: number;
|
|
70
|
+
/**
|
|
71
|
+
* Where the catalogue reads what a new payment method is taken with —
|
|
72
|
+
* `PaymentGatewayRegistry` from `@saasicat/nest/payments` where the
|
|
73
|
+
* application wired payments, and `null` where nothing takes them.
|
|
74
|
+
*
|
|
75
|
+
* Required and nullable rather than optional, because leaving it out is not
|
|
76
|
+
* silence: the endpoint would publish that no payment method is taken,
|
|
77
|
+
* which is a claim, and an application whose form takes one would publish
|
|
78
|
+
* the opposite of what it does. `SaaSiCatModule` fills it from `payments`.
|
|
79
|
+
*/
|
|
80
|
+
newPaymentMethodsFrom: Type<NewPaymentMethodsSource> | null;
|
|
81
|
+
}
|
|
82
|
+
interface CatalogControllerConfig {
|
|
83
|
+
/**
|
|
84
|
+
* Class-level guards for `BundlesController` and `BundleVersionsController`.
|
|
85
|
+
* REQUIRED — otherwise `forRoot()` throws at boot. Pass `[]` explicitly
|
|
86
|
+
* if the endpoints should intentionally be auth-free.
|
|
87
|
+
*
|
|
88
|
+
* Publishing a plan or bundle version, ending a plan version and purging a
|
|
89
|
+
* plan require the second factor whatever this list holds: the check sits
|
|
90
|
+
* on those handlers, so `MfaService` has to be resolvable — through
|
|
91
|
+
* `AdminModule`, which `SaaSiCatModule.forRoot` always registers.
|
|
92
|
+
*/
|
|
93
|
+
guards: Array<Type<CanActivate>>;
|
|
94
|
+
}
|
|
95
|
+
interface CatalogModuleOptions {
|
|
96
|
+
/** Adapter for `bundles` + `bundle_versions` persistence. */
|
|
97
|
+
bundleRepository: ProviderSpec<BundleRepository>;
|
|
98
|
+
/**
|
|
99
|
+
* Adapter for `marketing_projections` persistence. Optional — if
|
|
100
|
+
* omitted, MarketingProjectionsService + controller are not
|
|
101
|
+
* registered.
|
|
102
|
+
*/
|
|
103
|
+
marketingProjectionRepository?: ProviderSpec<MarketingProjectionRepository>;
|
|
104
|
+
/**
|
|
105
|
+
* Adapter for `capability_/feature_/quota_catalog_entries` persistence
|
|
106
|
+
* (discovery review). Optional — if omitted,
|
|
107
|
+
* CatalogEntriesService + controller are not registered.
|
|
108
|
+
*/
|
|
109
|
+
catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
|
|
110
|
+
/**
|
|
111
|
+
* Adapter for `promotions` persistence. Optional — if
|
|
112
|
+
* omitted, PromotionsService + controller are not registered.
|
|
113
|
+
*/
|
|
114
|
+
promotionRepository?: ProviderSpec<PromotionRepository>;
|
|
115
|
+
/**
|
|
116
|
+
* Adapter for `marketing_settings` persistence (
|
|
117
|
+
* `activeLocales`). Optional.
|
|
118
|
+
*/
|
|
119
|
+
marketingSettingsRepository?: ProviderSpec<MarketingSettingsRepository>;
|
|
120
|
+
/**
|
|
121
|
+
* Auth-free pricing-page endpoint `GET /public/marketing-catalog`
|
|
122
|
+
*. Registered only when plan-, marketingProjection-
|
|
123
|
+
* and promotionRepository are set. `guards` is usually `[]`.
|
|
124
|
+
*/
|
|
125
|
+
publicMarketingCatalog?: PublicMarketingCatalogOptions;
|
|
126
|
+
/**
|
|
127
|
+
* — adapter for `plans` master-record persistence.
|
|
128
|
+
* Optional; if omitted, PlansService + controller are not
|
|
129
|
+
* registered (apps without a need for the plan editor stay unchanged).
|
|
130
|
+
*/
|
|
131
|
+
planRepository?: ProviderSpec<PlanRepository>;
|
|
132
|
+
/**
|
|
133
|
+
* Controller mount for `/admin/catalog/bundles` + `/admin/catalog/bundle-versions`.
|
|
134
|
+
* If omitted, the endpoints are not registered — but the services remain usable via DI.
|
|
135
|
+
*/
|
|
136
|
+
controller?: CatalogControllerConfig;
|
|
137
|
+
/**
|
|
138
|
+
* Strict-mode mode. `blocking` (default, #12) throws HTTP 422 on
|
|
139
|
+
* violations and requires a DiscoverySnapshot; `warn-only` returns them
|
|
140
|
+
* only as a warning (transition until 100% discovery coverage).
|
|
141
|
+
*/
|
|
142
|
+
strictModeCheckMode?: 'warn-only' | 'blocking';
|
|
143
|
+
/**
|
|
144
|
+
* Discovery→catalog auto-sync at boot (#12). Default `true` — as soon as a
|
|
145
|
+
* `catalogEntryRepository` is wired and a DiscoverySnapshot is available,
|
|
146
|
+
* `CatalogEntriesService` mirrors the discovery into the DB at startup. `false`
|
|
147
|
+
* disables the boot sync; the manual sync endpoint remains usable.
|
|
148
|
+
*/
|
|
149
|
+
autoSyncDiscoveryAtBoot?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Feature keys the catalog is deliberately allowed to carry without them
|
|
152
|
+
* existing in the discovery snapshot (marketed non-code features such as
|
|
153
|
+
* support SLAs, e.g. `['PRIORITY_SUPPORT']`). The strict-mode check excludes
|
|
154
|
+
* them from BUNDLE_/PLAN_FEATURE_UNKNOWN. Use sparingly.
|
|
155
|
+
*/
|
|
156
|
+
marketedOnlyFeatures?: string[];
|
|
157
|
+
/**
|
|
158
|
+
* Optional consumer-curated FeatureUiRegistry (label/description/icon
|
|
159
|
+
* per feature — the same one passed to `PublicCatalogModule.forRoot`). The
|
|
160
|
+
* discovery auto-sync seeds EMPTY `FeatureCatalogEntry` fields
|
|
161
|
+
* (label/description/icon) from it at boot; SuperAdmin edits stay untouched. This
|
|
162
|
+
* makes `FeatureCatalogEntry` the SSOT for UI metadata.
|
|
163
|
+
*/
|
|
164
|
+
featureUiRegistry?: FeatureUiRegistry;
|
|
165
|
+
/**
|
|
166
|
+
* Modules whose providers must be visible in the DI scope of this
|
|
167
|
+
* DynamicModule — typically: `AuthModule`/`PlatformAdminModule`, because the
|
|
168
|
+
* controller guards come from there.
|
|
169
|
+
*/
|
|
170
|
+
imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
|
|
171
|
+
/** Additional providers registered in the DynamicModule itself. */
|
|
172
|
+
extraProviders?: Provider[];
|
|
173
|
+
/** Register the module globally — default `false`. */
|
|
174
|
+
global?: boolean;
|
|
175
|
+
}
|
|
176
|
+
declare class CatalogModule {
|
|
177
|
+
static forRoot(options: CatalogModuleOptions): DynamicModule;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export { type CatalogModuleOptions as C, type NewPaymentMethodsSource as N, type PublicMarketingCatalogOptions as P, type CatalogControllerConfig as a, CatalogModule as b, PublicMarketingCatalogService as c };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
|
|
2
|
+
import { PaymentMethodType, PlanRepository, MarketingProjectionRepository, PromotionRepository, CatalogEntryRepository, BundleRepository, PublicMarketingCatalogResponse, MarketingSettingsRepository, FeatureUiRegistry } from '@saasicat/core';
|
|
3
|
+
import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* What the catalogue needs of whatever knows the payment accounts: the account
|
|
7
|
+
* new payment methods are taken at, or `null` where none takes them.
|
|
8
|
+
* `PaymentGatewayRegistry` satisfies it; the shape keeps this module free of a
|
|
9
|
+
* dependency on the payments module.
|
|
10
|
+
*/
|
|
11
|
+
interface NewPaymentMethodsSource {
|
|
12
|
+
forNewPaymentMethods(): {
|
|
13
|
+
methods: readonly PaymentMethodType[];
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
16
|
+
declare class PublicMarketingCatalogService {
|
|
17
|
+
private readonly planRepo;
|
|
18
|
+
private readonly marketingRepo;
|
|
19
|
+
private readonly promotionRepo;
|
|
20
|
+
private readonly catalogEntryRepo;
|
|
21
|
+
private readonly bundleRepo;
|
|
22
|
+
private readonly newPaymentMethodsSource;
|
|
23
|
+
constructor(planRepo: PlanRepository, marketingRepo: MarketingProjectionRepository, promotionRepo: PromotionRepository, catalogEntryRepo: (CatalogEntryRepository | null) | undefined, bundleRepo: (BundleRepository | null) | undefined, newPaymentMethodsSource: NewPaymentMethodsSource | null);
|
|
24
|
+
/** What a new payment method is taken with here, for the page that offers the plans. */
|
|
25
|
+
private newPaymentMethods;
|
|
26
|
+
getCatalog(locale: string, currency: string, vatRate: number, asOf?: Date): Promise<PublicMarketingCatalogResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Loads all published-and-live bundle versions and filters on
|
|
29
|
+
* `marketed === true`. Without a registered `BundleRepository` (apps
|
|
30
|
+
* without the SuperAdmin bundle editor) the list is empty — the public
|
|
31
|
+
* catalog stays plan-only.
|
|
32
|
+
*/
|
|
33
|
+
private loadMarketedBundles;
|
|
34
|
+
/**
|
|
35
|
+
* Maps BundleVersionRow → PublicMarketingBundle. Locale resolution
|
|
36
|
+
* runs via `MarketingProjectionRepository.findByTarget('BUNDLE',
|
|
37
|
+
* bundleVersionId, locale)` — on a miss it falls back to
|
|
38
|
+
* `DEFAULT_LOCALE`. If the fallback is missing too, label/description
|
|
39
|
+
* come directly from the bundle root (denormalized in `BundleVersionRow`).
|
|
40
|
+
*
|
|
41
|
+
* If the marketing projection is `visible === false`, the bundle is
|
|
42
|
+
* hidden from the public response (preparation phase).
|
|
43
|
+
*/
|
|
44
|
+
private toPublicBundle;
|
|
45
|
+
/**
|
|
46
|
+
* Labels for bundle features ∪ their requires (#48): `comparison.features`
|
|
47
|
+
* only covers the plan-feature union — bundle-only features would
|
|
48
|
+
* otherwise get no label in the public payload. Curated keys only;
|
|
49
|
+
* without a CatalogEntryRepository the map stays empty (frontends fall
|
|
50
|
+
* back to the key).
|
|
51
|
+
*/
|
|
52
|
+
private resolveBundleFeatureLabels;
|
|
53
|
+
/** Loads the translated feature/quota labels (+ sortOrder) for a locale. */
|
|
54
|
+
private loadLabelMeta;
|
|
55
|
+
/**
|
|
56
|
+
* Resolves the displayed label of a top feature: the `label` override
|
|
57
|
+
* wins; otherwise the translated label of the referenced `key`.
|
|
58
|
+
*/
|
|
59
|
+
private resolveTopFeature;
|
|
60
|
+
/** Row definitions of the comparison matrix (feature/quota union + labels). */
|
|
61
|
+
private buildComparison;
|
|
62
|
+
private resolvePromo;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** What the auth-free pricing-page endpoint is mounted with. */
|
|
66
|
+
interface PublicMarketingCatalogOptions {
|
|
67
|
+
guards: Array<Type<CanActivate>>;
|
|
68
|
+
currency: string;
|
|
69
|
+
vatRate: number;
|
|
70
|
+
/**
|
|
71
|
+
* Where the catalogue reads what a new payment method is taken with —
|
|
72
|
+
* `PaymentGatewayRegistry` from `@saasicat/nest/payments` where the
|
|
73
|
+
* application wired payments, and `null` where nothing takes them.
|
|
74
|
+
*
|
|
75
|
+
* Required and nullable rather than optional, because leaving it out is not
|
|
76
|
+
* silence: the endpoint would publish that no payment method is taken,
|
|
77
|
+
* which is a claim, and an application whose form takes one would publish
|
|
78
|
+
* the opposite of what it does. `SaaSiCatModule` fills it from `payments`.
|
|
79
|
+
*/
|
|
80
|
+
newPaymentMethodsFrom: Type<NewPaymentMethodsSource> | null;
|
|
81
|
+
}
|
|
82
|
+
interface CatalogControllerConfig {
|
|
83
|
+
/**
|
|
84
|
+
* Class-level guards for `BundlesController` and `BundleVersionsController`.
|
|
85
|
+
* REQUIRED — otherwise `forRoot()` throws at boot. Pass `[]` explicitly
|
|
86
|
+
* if the endpoints should intentionally be auth-free.
|
|
87
|
+
*
|
|
88
|
+
* Publishing a plan or bundle version, ending a plan version and purging a
|
|
89
|
+
* plan require the second factor whatever this list holds: the check sits
|
|
90
|
+
* on those handlers, so `MfaService` has to be resolvable — through
|
|
91
|
+
* `AdminModule`, which `SaaSiCatModule.forRoot` always registers.
|
|
92
|
+
*/
|
|
93
|
+
guards: Array<Type<CanActivate>>;
|
|
94
|
+
}
|
|
95
|
+
interface CatalogModuleOptions {
|
|
96
|
+
/** Adapter for `bundles` + `bundle_versions` persistence. */
|
|
97
|
+
bundleRepository: ProviderSpec<BundleRepository>;
|
|
98
|
+
/**
|
|
99
|
+
* Adapter for `marketing_projections` persistence. Optional — if
|
|
100
|
+
* omitted, MarketingProjectionsService + controller are not
|
|
101
|
+
* registered.
|
|
102
|
+
*/
|
|
103
|
+
marketingProjectionRepository?: ProviderSpec<MarketingProjectionRepository>;
|
|
104
|
+
/**
|
|
105
|
+
* Adapter for `capability_/feature_/quota_catalog_entries` persistence
|
|
106
|
+
* (discovery review). Optional — if omitted,
|
|
107
|
+
* CatalogEntriesService + controller are not registered.
|
|
108
|
+
*/
|
|
109
|
+
catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
|
|
110
|
+
/**
|
|
111
|
+
* Adapter for `promotions` persistence. Optional — if
|
|
112
|
+
* omitted, PromotionsService + controller are not registered.
|
|
113
|
+
*/
|
|
114
|
+
promotionRepository?: ProviderSpec<PromotionRepository>;
|
|
115
|
+
/**
|
|
116
|
+
* Adapter for `marketing_settings` persistence (
|
|
117
|
+
* `activeLocales`). Optional.
|
|
118
|
+
*/
|
|
119
|
+
marketingSettingsRepository?: ProviderSpec<MarketingSettingsRepository>;
|
|
120
|
+
/**
|
|
121
|
+
* Auth-free pricing-page endpoint `GET /public/marketing-catalog`
|
|
122
|
+
*. Registered only when plan-, marketingProjection-
|
|
123
|
+
* and promotionRepository are set. `guards` is usually `[]`.
|
|
124
|
+
*/
|
|
125
|
+
publicMarketingCatalog?: PublicMarketingCatalogOptions;
|
|
126
|
+
/**
|
|
127
|
+
* — adapter for `plans` master-record persistence.
|
|
128
|
+
* Optional; if omitted, PlansService + controller are not
|
|
129
|
+
* registered (apps without a need for the plan editor stay unchanged).
|
|
130
|
+
*/
|
|
131
|
+
planRepository?: ProviderSpec<PlanRepository>;
|
|
132
|
+
/**
|
|
133
|
+
* Controller mount for `/admin/catalog/bundles` + `/admin/catalog/bundle-versions`.
|
|
134
|
+
* If omitted, the endpoints are not registered — but the services remain usable via DI.
|
|
135
|
+
*/
|
|
136
|
+
controller?: CatalogControllerConfig;
|
|
137
|
+
/**
|
|
138
|
+
* Strict-mode mode. `blocking` (default, #12) throws HTTP 422 on
|
|
139
|
+
* violations and requires a DiscoverySnapshot; `warn-only` returns them
|
|
140
|
+
* only as a warning (transition until 100% discovery coverage).
|
|
141
|
+
*/
|
|
142
|
+
strictModeCheckMode?: 'warn-only' | 'blocking';
|
|
143
|
+
/**
|
|
144
|
+
* Discovery→catalog auto-sync at boot (#12). Default `true` — as soon as a
|
|
145
|
+
* `catalogEntryRepository` is wired and a DiscoverySnapshot is available,
|
|
146
|
+
* `CatalogEntriesService` mirrors the discovery into the DB at startup. `false`
|
|
147
|
+
* disables the boot sync; the manual sync endpoint remains usable.
|
|
148
|
+
*/
|
|
149
|
+
autoSyncDiscoveryAtBoot?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Feature keys the catalog is deliberately allowed to carry without them
|
|
152
|
+
* existing in the discovery snapshot (marketed non-code features such as
|
|
153
|
+
* support SLAs, e.g. `['PRIORITY_SUPPORT']`). The strict-mode check excludes
|
|
154
|
+
* them from BUNDLE_/PLAN_FEATURE_UNKNOWN. Use sparingly.
|
|
155
|
+
*/
|
|
156
|
+
marketedOnlyFeatures?: string[];
|
|
157
|
+
/**
|
|
158
|
+
* Optional consumer-curated FeatureUiRegistry (label/description/icon
|
|
159
|
+
* per feature — the same one passed to `PublicCatalogModule.forRoot`). The
|
|
160
|
+
* discovery auto-sync seeds EMPTY `FeatureCatalogEntry` fields
|
|
161
|
+
* (label/description/icon) from it at boot; SuperAdmin edits stay untouched. This
|
|
162
|
+
* makes `FeatureCatalogEntry` the SSOT for UI metadata.
|
|
163
|
+
*/
|
|
164
|
+
featureUiRegistry?: FeatureUiRegistry;
|
|
165
|
+
/**
|
|
166
|
+
* Modules whose providers must be visible in the DI scope of this
|
|
167
|
+
* DynamicModule — typically: `AuthModule`/`PlatformAdminModule`, because the
|
|
168
|
+
* controller guards come from there.
|
|
169
|
+
*/
|
|
170
|
+
imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
|
|
171
|
+
/** Additional providers registered in the DynamicModule itself. */
|
|
172
|
+
extraProviders?: Provider[];
|
|
173
|
+
/** Register the module globally — default `false`. */
|
|
174
|
+
global?: boolean;
|
|
175
|
+
}
|
|
176
|
+
declare class CatalogModule {
|
|
177
|
+
static forRoot(options: CatalogModuleOptions): DynamicModule;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export { type CatalogModuleOptions as C, type NewPaymentMethodsSource as N, type PublicMarketingCatalogOptions as P, type CatalogControllerConfig as a, CatalogModule as b, PublicMarketingCatalogService as c };
|