@saasicat/nest 0.9.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 (86) hide show
  1. package/dist/_entries.cjs +17678 -0
  2. package/dist/admin/index.cjs +4 -1533
  3. package/dist/admin/index.d.cts +10 -173
  4. package/dist/admin/index.d.ts +10 -173
  5. package/dist/admin/index.js +3 -2
  6. package/dist/{admin-resources.module-BybEjZs-.d.cts → admin-resources.module-BZN_yBFj.d.cts} +1 -1
  7. package/dist/{admin-resources.module-CUCLlUAi.d.ts → admin-resources.module-Cms8MY6h.d.ts} +1 -1
  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 -5130
  11. package/dist/billing/index.d.cts +8 -437
  12. package/dist/billing/index.d.ts +8 -437
  13. package/dist/billing/index.js +4 -4
  14. package/dist/catalog/index.cjs +4 -5624
  15. package/dist/catalog/index.d.cts +5 -328
  16. package/dist/catalog/index.d.ts +5 -328
  17. package/dist/catalog/index.js +4 -4
  18. package/dist/checkout-offer/index.cjs +4 -807
  19. package/dist/checkout-offer/index.d.cts +5 -84
  20. package/dist/checkout-offer/index.d.ts +5 -84
  21. package/dist/checkout-offer/index.js +3 -2
  22. package/dist/checkout-offer.module-Y0hDOVrq.d.ts +85 -0
  23. package/dist/checkout-offer.module-ZYF5IsDY.d.cts +85 -0
  24. package/dist/{chunk-PBQRPDO2.js → chunk-33TP26MR.js} +2 -2
  25. package/dist/{chunk-CK54YKVK.js → chunk-75JABGZK.js} +16 -16
  26. package/dist/{chunk-HRU3CP57.js → chunk-BOADBIGB.js} +1 -1
  27. package/dist/chunk-DBZGV3HC.js +0 -0
  28. package/dist/{chunk-ZLUGQE5D.js → chunk-E7AJ42AB.js} +8 -8
  29. package/dist/{chunk-HXAWPPFW.js → chunk-F3VV6EXG.js} +9 -9
  30. package/dist/{chunk-3M6VLT5N.js → chunk-FVT7KTUI.js} +2 -2
  31. package/dist/{chunk-GW2I3JZD.js → chunk-GBDUH6DO.js} +1 -1
  32. package/dist/{chunk-K3OPNVFR.js → chunk-HBFU5AN3.js} +5 -9
  33. package/dist/{chunk-OFBDEO45.js → chunk-IRWZC3GC.js} +1 -1
  34. package/dist/chunk-L4KTQ6CL.js +20 -0
  35. package/dist/{chunk-WGVTXSYW.js → chunk-LZHLGUQI.js} +1 -1
  36. package/dist/{chunk-ZZMAHX22.js → chunk-PUXLPUVH.js} +15 -12
  37. package/dist/{chunk-7K5PT2LX.js → chunk-TXDH4FUA.js} +1 -1
  38. package/dist/chunk-UF53DWWR.js +0 -0
  39. package/dist/{chunk-AJ3EPELS.js → chunk-V34AA7C7.js} +1 -1
  40. package/dist/chunk-WJ6BMDL3.js +313 -0
  41. package/dist/{chunk-M6CZQYPY.js → chunk-Z3FWN3HJ.js} +2 -2
  42. package/dist/discovery/index.cjs +4 -588
  43. package/dist/discovery/index.js +3 -3
  44. package/dist/{enforce-quota.interceptor-SqrQVF91.d.cts → enforce-quota.interceptor-BhkX5nq2.d.cts} +35 -2
  45. package/dist/{enforce-quota.interceptor-B3CL5MSw.d.ts → enforce-quota.interceptor-CcqZc0Yu.d.ts} +35 -2
  46. package/dist/entitlement/index.cjs +4 -781
  47. package/dist/entitlement/index.js +2 -2
  48. package/dist/index.cjs +4 -15671
  49. package/dist/index.d.cts +21 -56
  50. package/dist/index.d.ts +21 -56
  51. package/dist/index.js +39 -334
  52. package/dist/{module-DeH_Jkcq.d.cts → module-CSN8j8Tp.d.cts} +1 -1
  53. package/dist/{module-B5m080F0.d.ts → module-DgYJur6f.d.ts} +1 -1
  54. package/dist/plan-versions.service-BB36Q1bg.d.ts +329 -0
  55. package/dist/plan-versions.service-CUR2Whyr.d.cts +329 -0
  56. package/dist/platform/index.cjs +4 -12925
  57. package/dist/platform/index.d.cts +17 -9
  58. package/dist/platform/index.d.ts +17 -9
  59. package/dist/platform/index.js +98 -14
  60. package/dist/promo/index.cjs +4 -1520
  61. package/dist/promo/index.d.cts +6 -21
  62. package/dist/promo/index.d.ts +6 -21
  63. package/dist/promo/index.js +2 -2
  64. package/dist/rate-limit.guard-dntqAlfZ.d.cts +19 -0
  65. package/dist/rate-limit.guard-dntqAlfZ.d.ts +19 -0
  66. package/dist/registration/index.cjs +4 -1655
  67. package/dist/registration/index.js +1 -1
  68. package/dist/{service-DlhMnYjW.d.ts → service-DX8KbGXl.d.cts} +1 -1
  69. package/dist/{service-DlhMnYjW.d.cts → service-DX8KbGXl.d.ts} +1 -1
  70. package/dist/setup.service-BPwJ7My_.d.cts +45 -0
  71. package/dist/setup.service-D2mrdDDB.d.ts +45 -0
  72. package/dist/subscription-bundle-preview.service-BkJXHAeP.d.cts +438 -0
  73. package/dist/subscription-bundle-preview.service-DBbrE_cw.d.ts +438 -0
  74. package/dist/subscription-contract/index.cjs +4 -471
  75. package/dist/subscription-contract/index.d.cts +5 -13
  76. package/dist/subscription-contract/index.d.ts +5 -13
  77. package/dist/subscription-contract.module-CG9fPKAr.d.cts +14 -0
  78. package/dist/subscription-contract.module-CVebZzHR.d.ts +14 -0
  79. package/dist/testing/index.cjs +4 -13888
  80. package/dist/testing/index.d.cts +5 -5
  81. package/dist/testing/index.d.ts +5 -5
  82. package/dist/testing/index.js +10 -10
  83. package/package.json +4 -4
  84. package/dist/admin-manifest.service-BMeSLRW4.d.ts +0 -33
  85. package/dist/admin-manifest.service-StAQe6QO.d.cts +0 -33
  86. package/dist/chunk-N3WANKSA.js +0 -20
@@ -1,9 +1,9 @@
1
1
  import { Type, CanActivate, DynamicModule, ForwardReference, FactoryProvider, Provider, ExecutionContext, NestInterceptor, CallHandler } from '@nestjs/common';
2
2
  import { PlanCatalog, SaasicatPersistenceAdapter, MfaPort, AuditPort, RlsBypassPort, PlanCatalogReadSink, SubscriptionRepository, PlanVersionRepository, TransactionRunner, QuotaProvider, FeatureUiRegistry, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, AdminResourcesPort, FirstTimeCustomerCheck } from '@saasicat/types';
3
3
  import { P as ProviderSpec } from './di-CcNeq9v-.js';
4
- import { A as AdminManifestConfig, d as AdminResourcesModuleOptions } from './admin-resources.module-CUCLlUAi.js';
4
+ import { b as AdminManifestConfig, d as AdminResourcesModuleOptions } from './admin-resources.module-Cms8MY6h.js';
5
5
  import { E as EntitlementResolutionConfig } from './plan-resolution-CFCoUkrE.js';
6
- import { a as PromoCodesModuleOptions } from './module-B5m080F0.js';
6
+ import { a as PromoCodesModuleOptions } from './module-DgYJur6f.js';
7
7
  import { b as DiscoveryAppInfo } from './discovery.scanner-DLgEvuoy.js';
8
8
  import { b as CatalogModuleOptions } from './catalog.module-BKObceo0.js';
9
9
  import { t as TenantBillingModuleOptions, p as SubscriptionBundleModuleOptions, n as SubscriptionBundleControllerOptions } from './subscription-bundles.module-BQmoozm5.js';
@@ -125,6 +125,15 @@ interface SaasPlatformPromoCodesOptions extends Omit<PromoCodesModuleOptions, 'p
125
125
  firstTimeCustomerCheck?: ProviderSpec<FirstTimeCustomerCheck>;
126
126
  /** Override the default controller guards + `SuperAdminGuard` chain. */
127
127
  adminGuards?: Array<Type<CanActivate>>;
128
+ /**
129
+ * Mount the SuperAdmin promo-code CRUD controller. Default `true`.
130
+ *
131
+ * Set `false` when the app serves `/admin/promo-codes` itself — two
132
+ * controllers on one path abort the boot with a duplicate-route error.
133
+ * The promo domain service stays available either way, so an app-owned
134
+ * controller can still delegate its validation to the platform.
135
+ */
136
+ adminController?: false;
128
137
  }
129
138
  interface SaasPlatformModuleOptions {
130
139
  /**
@@ -178,6 +187,16 @@ interface SaasPlatformModuleOptions {
178
187
  * `MfaGuard`). Optional.
179
188
  */
180
189
  reloadGuards?: Array<Type<CanActivate>>;
190
+ /**
191
+ * Mount the platform's `GET /admin/manifest` + `POST /admin/manifest/reload`
192
+ * controller. Default `true`.
193
+ *
194
+ * Set `false` when the app serves those routes from its own controller —
195
+ * two controllers on one path abort the boot with a duplicate-route error
196
+ * (`FST_ERR_DUPLICATED_ROUTE` under Fastify), so this is not something the
197
+ * app can simply override.
198
+ */
199
+ includeManifestController?: boolean;
181
200
  /**
182
201
  * Modules whose providers must be visible in the DI scope (typically:
183
202
  * `AuthModule` with the `JwtAuthGuard`).
@@ -265,6 +284,20 @@ interface SaasPlatformModuleOptions {
265
284
  * `controller.guards`.
266
285
  */
267
286
  tenantManifest?: true | TenantManifestControllerOptions;
287
+ /**
288
+ * Bind `StaticFeatureGuard` as a global `APP_GUARD`. Default `true`.
289
+ *
290
+ * Set `false` when the app authenticates in a controller-local guard.
291
+ * Nest runs every global guard before every controller-local one, so a
292
+ * global feature guard sees no `request.user` and rejects with 403 before
293
+ * authentication has run. Apps in that shape bind the guard themselves,
294
+ * behind their auth guard: `@UseGuards(JwtAuthGuard, FeatureGuard)`.
295
+ *
296
+ * Only the guard is affected. `EnforceQuotaInterceptor` stays global
297
+ * either way — interceptors run after all guards, so it does see the
298
+ * authenticated request.
299
+ */
300
+ globalFeatureGuard?: boolean;
268
301
  }
269
302
  /**
270
303
  * Bundles PlanCatalog + Discovery + Admin + AdminManifest (+ optionally