@saasicat/nest 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/_entries.cjs +17678 -0
  2. package/dist/admin/index.cjs +4 -1274
  3. package/dist/admin/index.d.cts +10 -171
  4. package/dist/admin/index.d.ts +10 -171
  5. package/dist/admin/index.js +13 -4
  6. package/dist/admin-resources.module-BZN_yBFj.d.cts +40 -0
  7. package/dist/admin-resources.module-Cms8MY6h.d.ts +40 -0
  8. package/dist/admin-stats.module-15ac5KY3.d.ts +201 -0
  9. package/dist/admin-stats.module-v4SVvWzj.d.cts +201 -0
  10. package/dist/billing/index.cjs +4 -5128
  11. package/dist/billing/index.d.cts +8 -719
  12. package/dist/billing/index.d.ts +8 -719
  13. package/dist/billing/index.js +7 -10
  14. package/dist/catalog/index.cjs +4 -5624
  15. package/dist/catalog/index.d.cts +7 -427
  16. package/dist/catalog/index.d.ts +7 -427
  17. package/dist/catalog/index.js +14 -12
  18. package/dist/catalog.module-BKObceo0.d.ts +103 -0
  19. package/dist/catalog.module-Dw2Hrbyu.d.cts +103 -0
  20. package/dist/checkout-offer/index.cjs +4 -807
  21. package/dist/checkout-offer/index.d.cts +5 -84
  22. package/dist/checkout-offer/index.d.ts +5 -84
  23. package/dist/checkout-offer/index.js +3 -2
  24. package/dist/checkout-offer.module-Y0hDOVrq.d.ts +85 -0
  25. package/dist/checkout-offer.module-ZYF5IsDY.d.cts +85 -0
  26. package/dist/{chunk-5DDCSGZC.js → chunk-33TP26MR.js} +144 -356
  27. package/dist/{chunk-CK54YKVK.js → chunk-75JABGZK.js} +16 -16
  28. package/dist/{chunk-HRU3CP57.js → chunk-BOADBIGB.js} +1 -1
  29. package/dist/{chunk-ZLUGQE5D.js → chunk-E7AJ42AB.js} +8 -8
  30. package/dist/{chunk-6LP7CDS2.js → chunk-F3VV6EXG.js} +18 -13
  31. package/dist/{chunk-PLDHI6NA.js → chunk-FVT7KTUI.js} +258 -3
  32. package/dist/{chunk-RZU4HIAN.js → chunk-GBDUH6DO.js} +26 -23
  33. package/dist/{chunk-K3OPNVFR.js → chunk-HBFU5AN3.js} +5 -9
  34. package/dist/chunk-HWGIMNWR.js +0 -0
  35. package/dist/chunk-IRWZC3GC.js +755 -0
  36. package/dist/chunk-L4KTQ6CL.js +20 -0
  37. package/dist/{chunk-T5SXXAKG.js → chunk-LZHLGUQI.js} +1 -1
  38. package/dist/{chunk-YHHE4KDA.js → chunk-PUXLPUVH.js} +351 -21
  39. package/dist/chunk-TXDH4FUA.js +211 -0
  40. package/dist/chunk-UF53DWWR.js +0 -0
  41. package/dist/{chunk-AJ3EPELS.js → chunk-V34AA7C7.js} +1 -1
  42. package/dist/chunk-WJ6BMDL3.js +313 -0
  43. package/dist/{chunk-M6CZQYPY.js → chunk-Z3FWN3HJ.js} +2 -2
  44. package/dist/discovery/index.cjs +4 -588
  45. package/dist/discovery/index.js +3 -3
  46. package/dist/{enforce-quota.interceptor-cv7r80VM.d.cts → enforce-quota.interceptor-BhkX5nq2.d.cts} +127 -12
  47. package/dist/{enforce-quota.interceptor-Dj1Kusr5.d.ts → enforce-quota.interceptor-CcqZc0Yu.d.ts} +127 -12
  48. package/dist/entitlement/index.cjs +4 -780
  49. package/dist/entitlement/index.d.cts +3 -1
  50. package/dist/entitlement/index.d.ts +3 -1
  51. package/dist/entitlement/index.js +2 -3
  52. package/dist/index.cjs +4 -14975
  53. package/dist/index.d.cts +22 -54
  54. package/dist/index.d.ts +22 -54
  55. package/dist/index.js +88 -369
  56. package/dist/module-CSN8j8Tp.d.cts +39 -0
  57. package/dist/module-DgYJur6f.d.ts +39 -0
  58. package/dist/plan-versions.service-BB36Q1bg.d.ts +329 -0
  59. package/dist/plan-versions.service-CUR2Whyr.d.cts +329 -0
  60. package/dist/platform/index.cjs +4 -2779
  61. package/dist/platform/index.d.cts +50 -8
  62. package/dist/platform/index.d.ts +50 -8
  63. package/dist/platform/index.js +116 -12
  64. package/dist/promo/index.cjs +4 -995
  65. package/dist/promo/index.d.cts +48 -46
  66. package/dist/promo/index.d.ts +48 -46
  67. package/dist/promo/index.js +10 -2
  68. package/dist/rate-limit.guard-dntqAlfZ.d.cts +19 -0
  69. package/dist/rate-limit.guard-dntqAlfZ.d.ts +19 -0
  70. package/dist/registration/index.cjs +4 -1655
  71. package/dist/registration/index.js +1 -1
  72. package/dist/setup.service-BPwJ7My_.d.cts +45 -0
  73. package/dist/setup.service-D2mrdDDB.d.ts +45 -0
  74. package/dist/subscription-bundle-preview.service-BkJXHAeP.d.cts +438 -0
  75. package/dist/subscription-bundle-preview.service-DBbrE_cw.d.ts +438 -0
  76. package/dist/subscription-bundles.module-BQmoozm5.d.ts +291 -0
  77. package/dist/subscription-bundles.module-DCpV-Pb5.d.cts +291 -0
  78. package/dist/subscription-contract/index.cjs +4 -471
  79. package/dist/subscription-contract/index.d.cts +5 -13
  80. package/dist/subscription-contract/index.d.ts +5 -13
  81. package/dist/subscription-contract.module-CG9fPKAr.d.cts +14 -0
  82. package/dist/subscription-contract.module-CVebZzHR.d.ts +14 -0
  83. package/dist/testing/index.cjs +4 -3756
  84. package/dist/testing/index.d.cts +9 -4
  85. package/dist/testing/index.d.ts +9 -4
  86. package/dist/testing/index.js +13 -7
  87. package/package.json +5 -5
  88. package/dist/admin-manifest.config-DyrQNT7M.d.cts +0 -10
  89. package/dist/admin-manifest.config-DyrQNT7M.d.ts +0 -10
  90. package/dist/admin-manifest.service-Cp6uwvmt.d.cts +0 -33
  91. package/dist/admin-manifest.service-UGgzR1x-.d.ts +0 -33
  92. package/dist/chunk-52UTQRD3.js +0 -326
  93. package/dist/chunk-N3WANKSA.js +0 -20
  94. package/dist/chunk-Q53N43LQ.js +0 -13
  95. /package/dist/{chunk-2FR6ZL7R.js → chunk-DBZGV3HC.js} +0 -0
@@ -0,0 +1,103 @@
1
+ import { Type, CanActivate, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
2
+ import { BundleRepository, MarketingProjectionRepository, CatalogEntryRepository, PromotionRepository, MarketingSettingsRepository, PlanRepository, FeatureUiRegistry } from '@saasicat/types';
3
+ import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
4
+
5
+ interface CatalogControllerConfig {
6
+ /**
7
+ * Class-level guards for `BundlesController` and `BundleVersionsController`.
8
+ * REQUIRED — otherwise `forRoot()` throws at boot. Pass `[]` explicitly
9
+ * if the endpoints should intentionally be auth-free.
10
+ */
11
+ guards: Array<Type<CanActivate>>;
12
+ }
13
+ interface CatalogModuleOptions {
14
+ /** Adapter for `bundles` + `bundle_versions` persistence. */
15
+ bundleRepository: ProviderSpec<BundleRepository>;
16
+ /**
17
+ * Adapter for `marketing_projections` persistence. Optional — if
18
+ * omitted, MarketingProjectionsService + controller are not
19
+ * registered.
20
+ */
21
+ marketingProjectionRepository?: ProviderSpec<MarketingProjectionRepository>;
22
+ /**
23
+ * Adapter for `capability_/feature_/quota_catalog_entries` persistence
24
+ * (discovery review, SPEC_V2 §6.3). Optional — if omitted,
25
+ * CatalogEntriesService + controller are not registered.
26
+ */
27
+ catalogEntryRepository?: ProviderSpec<CatalogEntryRepository>;
28
+ /**
29
+ * Adapter for `promotions` persistence (SPEC_V2 §9a). Optional — if
30
+ * omitted, PromotionsService + controller are not registered.
31
+ */
32
+ promotionRepository?: ProviderSpec<PromotionRepository>;
33
+ /**
34
+ * Adapter for `marketing_settings` persistence (SPEC_V2 §6.5 —
35
+ * `activeLocales`). Optional.
36
+ */
37
+ marketingSettingsRepository?: ProviderSpec<MarketingSettingsRepository>;
38
+ /**
39
+ * Auth-free pricing-page endpoint `GET /public/marketing-catalog`
40
+ * (SPEC_V2 §9). Registered only when plan-, marketingProjection-
41
+ * and promotionRepository are set. `guards` is usually `[]`.
42
+ */
43
+ publicMarketingCatalog?: {
44
+ guards: Array<Type<CanActivate>>;
45
+ projectKey: string;
46
+ currency: string;
47
+ vatRate: number;
48
+ };
49
+ /**
50
+ * SPEC_V2 §11.1 M6 (Pack 1) — adapter for `plans` master-record persistence.
51
+ * Optional; if omitted, PlansService + controller are not
52
+ * registered (apps without a need for the plan editor stay unchanged).
53
+ */
54
+ planRepository?: ProviderSpec<PlanRepository>;
55
+ /**
56
+ * Controller mount for `/admin/catalog/bundles` + `/admin/catalog/bundle-versions`.
57
+ * If omitted, the endpoints are not registered — but the services remain usable via DI.
58
+ */
59
+ controller?: CatalogControllerConfig;
60
+ /**
61
+ * Strict-mode mode. `blocking` (default, #12) throws HTTP 422 on
62
+ * violations and requires a DiscoverySnapshot; `warn-only` returns them
63
+ * only as a warning (transition until 100% discovery coverage).
64
+ */
65
+ strictModeCheckMode?: 'warn-only' | 'blocking';
66
+ /**
67
+ * Discovery→catalog auto-sync at boot (#12). Default `true` — as soon as a
68
+ * `catalogEntryRepository` is wired and a DiscoverySnapshot is available,
69
+ * `CatalogEntriesService` mirrors the discovery into the DB at startup. `false`
70
+ * disables the boot sync; the manual sync endpoint remains usable.
71
+ */
72
+ autoSyncDiscoveryAtBoot?: boolean;
73
+ /**
74
+ * Feature keys the catalog is deliberately allowed to carry without them
75
+ * existing in the discovery snapshot (marketed non-code features such as
76
+ * support SLAs, e.g. `['PRIORITY_SUPPORT']`). The strict-mode check excludes
77
+ * them from BUNDLE_/PLAN_FEATURE_UNKNOWN. Use sparingly.
78
+ */
79
+ marketedOnlyFeatures?: string[];
80
+ /**
81
+ * Optional consumer-curated FeatureUiRegistry (label/description/icon
82
+ * per feature — the same one passed to `PublicCatalogModule.forRoot`). The
83
+ * discovery auto-sync seeds EMPTY `FeatureCatalogEntry` fields
84
+ * (label/description/icon) from it at boot; SuperAdmin edits stay untouched. This
85
+ * makes `FeatureCatalogEntry` the SSOT for UI metadata (SPEC_V2 §6.3 / #12).
86
+ */
87
+ featureUiRegistry?: FeatureUiRegistry;
88
+ /**
89
+ * Modules whose providers must be visible in the DI scope of this
90
+ * DynamicModule — typically: `AuthModule`/`PlatformAdminModule`, because the
91
+ * controller guards come from there.
92
+ */
93
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
94
+ /** Additional providers registered in the DynamicModule itself. */
95
+ extraProviders?: Provider[];
96
+ /** Register the module globally — default `false`. */
97
+ global?: boolean;
98
+ }
99
+ declare class CatalogModule {
100
+ static forRoot(options: CatalogModuleOptions): DynamicModule;
101
+ }
102
+
103
+ export { type CatalogControllerConfig as C, CatalogModule as a, type CatalogModuleOptions as b };