@saasicat/nest 0.26.1 → 1.0.0-rc.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 (76) hide show
  1. package/LICENSE +90 -201
  2. package/dist/.build-stamp +1 -0
  3. package/dist/_entries.cjs +3175 -2756
  4. package/dist/admin/index.d.cts +2 -2
  5. package/dist/admin/index.d.ts +2 -2
  6. package/dist/admin/index.js +2 -2
  7. package/dist/{admin-stats.service-HUZIU448.d.cts → admin-stats.service-BroyovpL.d.cts} +1 -1
  8. package/dist/{admin-stats.service-Db2exT_d.d.ts → admin-stats.service-G53IEkkt.d.ts} +1 -1
  9. package/dist/billing/index.d.cts +7 -7
  10. package/dist/billing/index.d.ts +7 -7
  11. package/dist/billing/index.js +38 -36
  12. package/dist/catalog/index.d.cts +13 -1
  13. package/dist/catalog/index.d.ts +13 -1
  14. package/dist/catalog/index.js +10 -8
  15. package/dist/checkout-offer/index.js +2 -2
  16. package/dist/chunk-2FR6ZL7R.js +0 -0
  17. package/dist/chunk-2SLTRKXC.js +0 -0
  18. package/dist/{chunk-7ZPFQXHM.js → chunk-3UZW7TU4.js} +1 -1
  19. package/dist/{chunk-XTVAFJ3P.js → chunk-AEEK64XD.js} +3 -3
  20. package/dist/chunk-AOQJEYOL.js +20 -0
  21. package/dist/chunk-H3W6QDQH.js +85 -0
  22. package/dist/{chunk-YYUXKLXK.js → chunk-I7GTA3RX.js} +2 -2
  23. package/dist/{chunk-SN5UOC43.js → chunk-IPOLCDKN.js} +11 -11
  24. package/dist/{chunk-B7NRY2LV.js → chunk-IVEA6M3B.js} +2 -40
  25. package/dist/chunk-JCAZT727.js +1883 -0
  26. package/dist/chunk-JTLKWP3Q.js +792 -0
  27. package/dist/{chunk-E56W4U2P.js → chunk-O2J2HDXA.js} +4 -4
  28. package/dist/{chunk-WKVBNTYC.js → chunk-OUDSQ3PU.js} +6 -6
  29. package/dist/{chunk-MJ32VNZD.js → chunk-P5D5CYO2.js} +18 -18
  30. package/dist/{chunk-L4SUWH5B.js → chunk-QUZU2M33.js} +2 -2
  31. package/dist/{chunk-WPUVJRIN.js → chunk-S6BAD5XM.js} +10 -10
  32. package/dist/{chunk-7X5MSAIL.js → chunk-SH7J5IU7.js} +9 -9
  33. package/dist/{chunk-37HEKVDH.js → chunk-V4OJ43K2.js} +10 -10
  34. package/dist/{chunk-NYLON2VC.js → chunk-VBRYPU7V.js} +2 -2
  35. package/dist/{chunk-B6IWLV7R.js → chunk-VTMCMVYQ.js} +6 -6
  36. package/dist/{chunk-YWDLYOFN.js → chunk-WSPHIIGS.js} +429 -1205
  37. package/dist/{chunk-5ZXBXYXU.js → chunk-WXYJHZCN.js} +3 -3
  38. package/dist/{chunk-6WL6VQ7Z.js → chunk-XBYAFEOR.js} +2 -2
  39. package/dist/{chunk-NNNXXUPT.js → chunk-XEW6YXL5.js} +28 -93
  40. package/dist/chunk-Y43SGD5J.js +50 -0
  41. package/dist/{define-saasicat-BK6RRWWG.d.ts → define-saasicat-BFgeoVG9.d.ts} +28 -5
  42. package/dist/{define-saasicat-D30I-WET.d.cts → define-saasicat-CNUWjfNK.d.cts} +28 -5
  43. package/dist/discovery/index.js +4 -4
  44. package/dist/{enforce-quota.interceptor-B9QueAFf.d.ts → enforce-quota.interceptor-BYqmdFB5.d.ts} +3 -3
  45. package/dist/{enforce-quota.interceptor-DY6CLjoP.d.cts → enforce-quota.interceptor-BxIR63Wn.d.cts} +3 -3
  46. package/dist/entitlement/index.js +9 -6
  47. package/dist/index.d.cts +10 -10
  48. package/dist/index.d.ts +10 -10
  49. package/dist/index.js +61 -52
  50. package/dist/{saas-platform.module-D1mUZPrz.d.ts → module-options-BymIkAsh.d.ts} +68 -55
  51. package/dist/{saas-platform.module-CgalxzcT.d.cts → module-options-DgwBKVpC.d.cts} +68 -55
  52. package/dist/platform/index.d.cts +204 -22
  53. package/dist/platform/index.d.ts +204 -22
  54. package/dist/platform/index.js +49 -25
  55. package/dist/promo/index.d.cts +3 -3
  56. package/dist/promo/index.d.ts +3 -3
  57. package/dist/promo/index.js +3 -3
  58. package/dist/{module-BE17XFLg.d.ts → promo.module-CnzddtJ0.d.ts} +1 -1
  59. package/dist/{module-CHMIyWlf.d.cts → promo.module-DokmUGmm.d.cts} +1 -1
  60. package/dist/registration/index.d.cts +1 -1
  61. package/dist/registration/index.d.ts +1 -1
  62. package/dist/registration/index.js +1 -1
  63. package/dist/subscription-contract/index.js +6 -3
  64. package/dist/{tenant-billing.controller-BSlpFqVA.d.ts → tenant-billing.controller-BQPy5yXh.d.ts} +2 -2
  65. package/dist/{tenant-billing.controller-DHSUrT_N.d.cts → tenant-billing.controller-CODIYzlI.d.cts} +2 -2
  66. package/dist/{subscription-bundles.module-BDbODWvA.d.ts → tenant-billing.module-B0stLoJn.d.ts} +51 -51
  67. package/dist/{subscription-bundles.module-Cfi-lFWF.d.cts → tenant-billing.module-BxJS6fX4.d.cts} +51 -51
  68. package/dist/testing/index.d.cts +14 -14
  69. package/dist/testing/index.d.ts +14 -14
  70. package/dist/testing/index.js +31 -29
  71. package/package.json +6 -6
  72. package/dist/chunk-L4KTQ6CL.js +0 -20
  73. package/dist/chunk-TCBYOFAC.js +0 -1464
  74. /package/dist/{chunk-FY4EJTV4.js → chunk-OYNHOY45.js} +0 -0
  75. /package/dist/{service-D48clObR.d.cts → promo.service-D48clObR.d.cts} +0 -0
  76. /package/dist/{service-D48clObR.d.ts → promo.service-D48clObR.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { CanActivate, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
2
+ import { NewContractLineItemData, BillingCycle, SubscriptionUsagePort, SubscriptionBundleRepository, BundleRepository, UsageSnapshotPort, TenantSubscriptionWritePort, SubscriptionContractRepository } from '@saasicat/types';
2
3
  import { P as ProviderSpec } from './di-CcNeq9v-.js';
3
- import { NewContractLineItemData, BillingCycle, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, SubscriptionContractRepository, SubscriptionBundleRepository, BundleRepository } from '@saasicat/types';
4
4
 
5
5
  declare const FEATURE_GUARD_MARKER: unique symbol;
6
6
  /** A guard class or instance carrying the platform's marker. */
@@ -157,6 +157,56 @@ interface ContractFreezeSourcePort {
157
157
  loadBookedBundles(tenantId: string, cycle: 'monthly' | 'yearly', vatRate: number): Promise<ContractFreezeBundleSnapshot>;
158
158
  }
159
159
 
160
+ interface SubscriptionBundleControllerOptions {
161
+ extraGuards?: Array<Type<CanActivate>>;
162
+ /**
163
+ * Auth guard list analogous to `TenantBillingModule.forRoot.authGuards`.
164
+ * Without this list, `ComposedTenantAuthGuard` blocks fail-closed.
165
+ */
166
+ authGuards?: ProviderSpec<ReadonlyArray<CanActivate>>;
167
+ /**
168
+ * Usage port for subscription lookup and current plan compatibility.
169
+ * If not set, an imported module must export the token.
170
+ */
171
+ subscriptionUsagePort?: ProviderSpec<SubscriptionUsagePort>;
172
+ /** Optional tenant-ID resolver. Default: `req.user.tenantId`. */
173
+ tenantIdResolver?: TenantIdResolver;
174
+ }
175
+ interface SubscriptionBundleModuleOptions {
176
+ subscriptionBundleRepository: ProviderSpec<SubscriptionBundleRepository>;
177
+ /**
178
+ * Optional — if omitted, `BUNDLE_REPOSITORY_TOKEN` is expected via
179
+ * default inject from the DI scope (typically via an imported
180
+ * `CatalogModule`).
181
+ */
182
+ bundleRepository?: ProviderSpec<BundleRepository>;
183
+ /** Default minimum term (months). Default = 12. */
184
+ defaultMinimumTermMonths?: number;
185
+ /**
186
+ * Self-service policy (#37): bundles that are only bookable via sales.
187
+ * Applies in `addBundleToSubscription` (422 BUNDLE_NOT_SELF_SERVICE)
188
+ * and in the preview (blocker).
189
+ */
190
+ selfServiceBlockedBundles?: SelfServiceBlockedBundles;
191
+ /**
192
+ * If set: the tenant self-service controller is mounted at
193
+ * `/billing/subscription-bundles` (GET/POST/DELETE). The
194
+ * `extraGuards` are applied in addition to the platform default
195
+ * `ComposedTenantAuthGuard` (role/MFA guards).
196
+ *
197
+ * Prerequisite: the consumer has already registered `TenantBillingModule`
198
+ * — the controller needs `SUBSCRIPTION_USAGE_PORT_TOKEN`
199
+ * + `TENANT_ID_RESOLVER_TOKEN` in the same DI scope.
200
+ */
201
+ controller?: SubscriptionBundleControllerOptions;
202
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
203
+ extraProviders?: Provider[];
204
+ global?: boolean;
205
+ }
206
+ declare class SubscriptionBundleModule {
207
+ static forRoot(options: SubscriptionBundleModuleOptions): DynamicModule;
208
+ }
209
+
160
210
  interface TenantBillingModuleOptions {
161
211
  /**
162
212
  * App guards in the order in which they should be executed
@@ -246,54 +296,4 @@ declare class TenantBillingModule {
246
296
  static forRoot(options: TenantBillingModuleOptions): DynamicModule;
247
297
  }
248
298
 
249
- interface SubscriptionBundleControllerOptions {
250
- extraGuards?: Array<Type<CanActivate>>;
251
- /**
252
- * Auth guard list analogous to `TenantBillingModule.forRoot.authGuards`.
253
- * Without this list, `ComposedTenantAuthGuard` blocks fail-closed.
254
- */
255
- authGuards?: ProviderSpec<ReadonlyArray<CanActivate>>;
256
- /**
257
- * Usage port for subscription lookup and current plan compatibility.
258
- * If not set, an imported module must export the token.
259
- */
260
- subscriptionUsagePort?: ProviderSpec<SubscriptionUsagePort>;
261
- /** Optional tenant-ID resolver. Default: `req.user.tenantId`. */
262
- tenantIdResolver?: TenantIdResolver;
263
- }
264
- interface SubscriptionBundleModuleOptions {
265
- subscriptionBundleRepository: ProviderSpec<SubscriptionBundleRepository>;
266
- /**
267
- * Optional — if omitted, `BUNDLE_REPOSITORY_TOKEN` is expected via
268
- * default inject from the DI scope (typically via an imported
269
- * `CatalogModule`).
270
- */
271
- bundleRepository?: ProviderSpec<BundleRepository>;
272
- /** Default minimum term (months). Default = 12. */
273
- defaultMinimumTermMonths?: number;
274
- /**
275
- * Self-service policy (#37): bundles that are only bookable via sales.
276
- * Applies in `addBundleToSubscription` (422 BUNDLE_NOT_SELF_SERVICE)
277
- * and in the preview (blocker).
278
- */
279
- selfServiceBlockedBundles?: SelfServiceBlockedBundles;
280
- /**
281
- * If set: the tenant self-service controller is mounted at
282
- * `/billing/subscription-bundles` (GET/POST/DELETE). The
283
- * `extraGuards` are applied in addition to the platform default
284
- * `ComposedTenantAuthGuard` (role/MFA guards).
285
- *
286
- * Prerequisite: the consumer has already registered `TenantBillingModule`
287
- * — the controller needs `SUBSCRIPTION_USAGE_PORT_TOKEN`
288
- * + `TENANT_ID_RESOLVER_TOKEN` in the same DI scope.
289
- */
290
- controller?: SubscriptionBundleControllerOptions;
291
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
292
- extraProviders?: Provider[];
293
- global?: boolean;
294
- }
295
- declare class SubscriptionBundleModule {
296
- static forRoot(options: SubscriptionBundleModuleOptions): DynamicModule;
297
- }
298
-
299
299
  export { AUDIT_CONTEXT_RESOLVER_TOKEN as A, type UserIdResolver as B, CONTRACT_FREEZE_PORT_TOKEN as C, type DuePendingPlanChange as D, isPlatformFeatureGuard as E, FEATURE_GUARD_MARKER as F, type MarkedFeatureGuard as M, PENDING_PLAN_QUERY_PORT_TOKEN as P, SELF_SERVICE_BLOCKED_BUNDLES_TOKEN as S, TENANT_AUTH_GUARDS_TOKEN as T, USAGE_SNAPSHOT_PORT_TOKEN as U, type AuditContextResolver as a, type AuthGuardList as b, CONTRACT_FREEZE_PROJECT_KEY_TOKEN as c, CONTRACT_FREEZE_SOURCE_PORT_TOKEN as d, type ContractFreezeBundleSnapshot as e, type ContractFreezePort as f, type ContractFreezeSourcePort as g, type PendingPlanQueryPort as h, SELF_SERVICE_BLOCKED_PLANS_TOKEN as i, SUBSCRIPTION_USAGE_PORT_TOKEN as j, SUBSCRIPTION_WRITE_PORT_TOKEN as k, type SelfServiceBlockedBundles as l, type SelfServiceBlockedPlans as m, type SubscriptionBundleControllerOptions as n, SubscriptionBundleModule as o, type SubscriptionBundleModuleOptions as p, TENANT_ID_RESOLVER_TOKEN as q, TRIAL_PROJECTION_PORT_TOKEN as r, TenantBillingModule as s, type TenantBillingModuleOptions as t, type TenantIdResolver as u, type TrialProjectionInput as v, type TrialProjectionPort as w, USER_EMAIL_RESOLVER_TOKEN as x, USER_ID_RESOLVER_TOKEN as y, type UserEmailResolver as z };
@@ -1,6 +1,6 @@
1
1
  import { CanActivate, Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';
2
+ import { NewContractLineItemData, BillingCycle, SubscriptionUsagePort, SubscriptionBundleRepository, BundleRepository, UsageSnapshotPort, TenantSubscriptionWritePort, SubscriptionContractRepository } from '@saasicat/types';
2
3
  import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
3
- import { NewContractLineItemData, BillingCycle, SubscriptionUsagePort, UsageSnapshotPort, TenantSubscriptionWritePort, SubscriptionContractRepository, SubscriptionBundleRepository, BundleRepository } from '@saasicat/types';
4
4
 
5
5
  declare const FEATURE_GUARD_MARKER: unique symbol;
6
6
  /** A guard class or instance carrying the platform's marker. */
@@ -157,6 +157,56 @@ interface ContractFreezeSourcePort {
157
157
  loadBookedBundles(tenantId: string, cycle: 'monthly' | 'yearly', vatRate: number): Promise<ContractFreezeBundleSnapshot>;
158
158
  }
159
159
 
160
+ interface SubscriptionBundleControllerOptions {
161
+ extraGuards?: Array<Type<CanActivate>>;
162
+ /**
163
+ * Auth guard list analogous to `TenantBillingModule.forRoot.authGuards`.
164
+ * Without this list, `ComposedTenantAuthGuard` blocks fail-closed.
165
+ */
166
+ authGuards?: ProviderSpec<ReadonlyArray<CanActivate>>;
167
+ /**
168
+ * Usage port for subscription lookup and current plan compatibility.
169
+ * If not set, an imported module must export the token.
170
+ */
171
+ subscriptionUsagePort?: ProviderSpec<SubscriptionUsagePort>;
172
+ /** Optional tenant-ID resolver. Default: `req.user.tenantId`. */
173
+ tenantIdResolver?: TenantIdResolver;
174
+ }
175
+ interface SubscriptionBundleModuleOptions {
176
+ subscriptionBundleRepository: ProviderSpec<SubscriptionBundleRepository>;
177
+ /**
178
+ * Optional — if omitted, `BUNDLE_REPOSITORY_TOKEN` is expected via
179
+ * default inject from the DI scope (typically via an imported
180
+ * `CatalogModule`).
181
+ */
182
+ bundleRepository?: ProviderSpec<BundleRepository>;
183
+ /** Default minimum term (months). Default = 12. */
184
+ defaultMinimumTermMonths?: number;
185
+ /**
186
+ * Self-service policy (#37): bundles that are only bookable via sales.
187
+ * Applies in `addBundleToSubscription` (422 BUNDLE_NOT_SELF_SERVICE)
188
+ * and in the preview (blocker).
189
+ */
190
+ selfServiceBlockedBundles?: SelfServiceBlockedBundles;
191
+ /**
192
+ * If set: the tenant self-service controller is mounted at
193
+ * `/billing/subscription-bundles` (GET/POST/DELETE). The
194
+ * `extraGuards` are applied in addition to the platform default
195
+ * `ComposedTenantAuthGuard` (role/MFA guards).
196
+ *
197
+ * Prerequisite: the consumer has already registered `TenantBillingModule`
198
+ * — the controller needs `SUBSCRIPTION_USAGE_PORT_TOKEN`
199
+ * + `TENANT_ID_RESOLVER_TOKEN` in the same DI scope.
200
+ */
201
+ controller?: SubscriptionBundleControllerOptions;
202
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
203
+ extraProviders?: Provider[];
204
+ global?: boolean;
205
+ }
206
+ declare class SubscriptionBundleModule {
207
+ static forRoot(options: SubscriptionBundleModuleOptions): DynamicModule;
208
+ }
209
+
160
210
  interface TenantBillingModuleOptions {
161
211
  /**
162
212
  * App guards in the order in which they should be executed
@@ -246,54 +296,4 @@ declare class TenantBillingModule {
246
296
  static forRoot(options: TenantBillingModuleOptions): DynamicModule;
247
297
  }
248
298
 
249
- interface SubscriptionBundleControllerOptions {
250
- extraGuards?: Array<Type<CanActivate>>;
251
- /**
252
- * Auth guard list analogous to `TenantBillingModule.forRoot.authGuards`.
253
- * Without this list, `ComposedTenantAuthGuard` blocks fail-closed.
254
- */
255
- authGuards?: ProviderSpec<ReadonlyArray<CanActivate>>;
256
- /**
257
- * Usage port for subscription lookup and current plan compatibility.
258
- * If not set, an imported module must export the token.
259
- */
260
- subscriptionUsagePort?: ProviderSpec<SubscriptionUsagePort>;
261
- /** Optional tenant-ID resolver. Default: `req.user.tenantId`. */
262
- tenantIdResolver?: TenantIdResolver;
263
- }
264
- interface SubscriptionBundleModuleOptions {
265
- subscriptionBundleRepository: ProviderSpec<SubscriptionBundleRepository>;
266
- /**
267
- * Optional — if omitted, `BUNDLE_REPOSITORY_TOKEN` is expected via
268
- * default inject from the DI scope (typically via an imported
269
- * `CatalogModule`).
270
- */
271
- bundleRepository?: ProviderSpec<BundleRepository>;
272
- /** Default minimum term (months). Default = 12. */
273
- defaultMinimumTermMonths?: number;
274
- /**
275
- * Self-service policy (#37): bundles that are only bookable via sales.
276
- * Applies in `addBundleToSubscription` (422 BUNDLE_NOT_SELF_SERVICE)
277
- * and in the preview (blocker).
278
- */
279
- selfServiceBlockedBundles?: SelfServiceBlockedBundles;
280
- /**
281
- * If set: the tenant self-service controller is mounted at
282
- * `/billing/subscription-bundles` (GET/POST/DELETE). The
283
- * `extraGuards` are applied in addition to the platform default
284
- * `ComposedTenantAuthGuard` (role/MFA guards).
285
- *
286
- * Prerequisite: the consumer has already registered `TenantBillingModule`
287
- * — the controller needs `SUBSCRIPTION_USAGE_PORT_TOKEN`
288
- * + `TENANT_ID_RESOLVER_TOKEN` in the same DI scope.
289
- */
290
- controller?: SubscriptionBundleControllerOptions;
291
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
292
- extraProviders?: Provider[];
293
- global?: boolean;
294
- }
295
- declare class SubscriptionBundleModule {
296
- static forRoot(options: SubscriptionBundleModuleOptions): DynamicModule;
297
- }
298
-
299
299
  export { AUDIT_CONTEXT_RESOLVER_TOKEN as A, type UserIdResolver as B, CONTRACT_FREEZE_PORT_TOKEN as C, type DuePendingPlanChange as D, isPlatformFeatureGuard as E, FEATURE_GUARD_MARKER as F, type MarkedFeatureGuard as M, PENDING_PLAN_QUERY_PORT_TOKEN as P, SELF_SERVICE_BLOCKED_BUNDLES_TOKEN as S, TENANT_AUTH_GUARDS_TOKEN as T, USAGE_SNAPSHOT_PORT_TOKEN as U, type AuditContextResolver as a, type AuthGuardList as b, CONTRACT_FREEZE_PROJECT_KEY_TOKEN as c, CONTRACT_FREEZE_SOURCE_PORT_TOKEN as d, type ContractFreezeBundleSnapshot as e, type ContractFreezePort as f, type ContractFreezeSourcePort as g, type PendingPlanQueryPort as h, SELF_SERVICE_BLOCKED_PLANS_TOKEN as i, SUBSCRIPTION_USAGE_PORT_TOKEN as j, SUBSCRIPTION_WRITE_PORT_TOKEN as k, type SelfServiceBlockedBundles as l, type SelfServiceBlockedPlans as m, type SubscriptionBundleControllerOptions as n, SubscriptionBundleModule as o, type SubscriptionBundleModuleOptions as p, TENANT_ID_RESOLVER_TOKEN as q, TRIAL_PROJECTION_PORT_TOKEN as r, TenantBillingModule as s, type TenantBillingModuleOptions as t, type TenantIdResolver as u, type TrialProjectionInput as v, type TrialProjectionPort as w, USER_EMAIL_RESOLVER_TOKEN as x, USER_ID_RESOLVER_TOKEN as y, type UserEmailResolver as z };
@@ -1,20 +1,20 @@
1
1
  import { BundleRepository, BundleRow, BundleVersionRow, BundleListFilter, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, MarketingProjectionRepository, MarketingProjectionRow, MarketingProjectionFilter, CreateMarketingProjectionData, UpdateMarketingProjectionData, PlanRepository, PlanRow, PlanVersionRow, PlanListFilter, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, PlanVersionRepository, PlanVersionRecord, TransactionContext, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, CreateSubscriptionContractData, TerminateSubscriptionContractData, SubscriptionRepository, SubscriptionRecord, TransactionRunner, PlanCatalog, QuotaProvider } from '@saasicat/types';
2
2
  import { Type, DynamicModule } from '@nestjs/common';
3
- import { a as SaasPlatformAdapters } from '../saas-platform.module-CgalxzcT.cjs';
4
- export { P as PLAN_RESOLVER_PORT_TOKEN, o as StaticPlanResolver } from '../saas-platform.module-CgalxzcT.cjs';
5
- export { E as EnforceQuotaInterceptor, S as StaticEntitlementService, a as StaticFeatureGuard } from '../enforce-quota.interceptor-DY6CLjoP.cjs';
3
+ import { S as SaaSiCatAdapters } from '../module-options-DgwBKVpC.cjs';
4
+ export { P as PLAN_RESOLVER_PORT_TOKEN, n as StaticPlanResolver } from '../module-options-DgwBKVpC.cjs';
5
+ export { E as EnforceQuotaInterceptor, S as StaticEntitlementService, a as StaticFeatureGuard } from '../enforce-quota.interceptor-BxIR63Wn.cjs';
6
6
  import '../di-CcNeq9v-.cjs';
7
7
  import '../admin-resources.module-DGgGSdzN.cjs';
8
8
  import '../admin-audit.service-9IqXMlZm.cjs';
9
- import '../plan-resolution-CFCoUkrE.cjs';
10
- import '../subscription-contract.module-B2uNvUJL.cjs';
11
- import '../module-CHMIyWlf.cjs';
12
- import '../service-D48clObR.cjs';
9
+ import '../tenant-billing.module-BxJS6fX4.cjs';
10
+ import '../catalog.module-D-_pQDNA.cjs';
13
11
  import '../discovery.scanner-DLgEvuoy.cjs';
14
12
  import '@nestjs/core';
15
- import '../catalog.module-D-_pQDNA.cjs';
13
+ import '../plan-resolution-CFCoUkrE.cjs';
14
+ import '../promo.module-DokmUGmm.cjs';
15
+ import '../promo.service-D48clObR.cjs';
16
16
  import '../checkout-offer.module-DmlpPevf.cjs';
17
- import '../subscription-bundles.module-Cfi-lFWF.cjs';
17
+ import '../subscription-contract.module-B2uNvUJL.cjs';
18
18
  import 'rxjs';
19
19
 
20
20
  /**
@@ -234,20 +234,20 @@ declare class StubAuditPort {
234
234
  declare class StubRlsBypassPort {
235
235
  runWithBypass<T>(fn: () => Promise<T>): Promise<T>;
236
236
  }
237
- interface CreateSaasPlatformTestModuleOptions {
237
+ interface CreateSaaSiCatTestModuleOptions {
238
238
  planCatalog: PlanCatalog;
239
239
  /** Default `'starter'` if the catalog has at least one plan. */
240
240
  defaultPlanId?: string;
241
241
  /** QuotaProvider classes for the `EnforceQuotaInterceptor`. */
242
242
  quotaProviders?: Array<Type<QuotaProvider>>;
243
243
  /** Overrides — if the test needs a different adapter. */
244
- overrides?: Partial<Pick<SaasPlatformAdapters, 'mfa' | 'audit' | 'rlsBypass'>>;
244
+ overrides?: Partial<Pick<SaaSiCatAdapters, 'mfa' | 'audit' | 'rlsBypass'>>;
245
245
  }
246
246
  /**
247
- * Returns a `DynamicModule` that sets up the SaasPlatformModule with stub
247
+ * Returns a `DynamicModule` that sets up the SaaSiCatModule with stub
248
248
  * adapters + the given PlanCatalog in static entitlement mode.
249
249
  * Tests can drop this into `Test.createTestingModule({ imports: [...] })`.
250
250
  */
251
- declare function createSaasPlatformTestModule(options: CreateSaasPlatformTestModuleOptions): DynamicModule;
251
+ declare function createSaaSiCatTestModule(options: CreateSaaSiCatTestModuleOptions): DynamicModule;
252
252
 
253
- export { type CreateSaasPlatformTestModuleOptions, FakeBundleRepository, FakeMarketingProjectionRepository, FakePlanRepository, FakePlanVersionRepository, FakeSubscriptionBundleRepository, FakeSubscriptionContractRepository, FakeSubscriptionRepository, FakeTransactionRunner, StubAuditPort, StubMfaPort, StubRlsBypassPort, createSaasPlatformTestModule };
253
+ export { type CreateSaaSiCatTestModuleOptions, FakeBundleRepository, FakeMarketingProjectionRepository, FakePlanRepository, FakePlanVersionRepository, FakeSubscriptionBundleRepository, FakeSubscriptionContractRepository, FakeSubscriptionRepository, FakeTransactionRunner, StubAuditPort, StubMfaPort, StubRlsBypassPort, createSaaSiCatTestModule };
@@ -1,20 +1,20 @@
1
1
  import { BundleRepository, BundleRow, BundleVersionRow, BundleListFilter, CreateBundleData, UpdateBundleData, CreateBundleVersionDraftData, UpdateBundleVersionDraftData, VersionChange, MarketingProjectionRepository, MarketingProjectionRow, MarketingProjectionFilter, CreateMarketingProjectionData, UpdateMarketingProjectionData, PlanRepository, PlanRow, PlanVersionRow, PlanListFilter, CreatePlanData, UpdatePlanData, CreatePlanVersionDraftData, UpdatePlanVersionDraftData, PlanVersionRepository, PlanVersionRecord, TransactionContext, SubscriptionBundleRepository, SubscriptionBundleRecord, CreateSubscriptionBundleData, CancelSubscriptionBundleData, SubscriptionContractRepository, SubscriptionContractFilter, SubscriptionContractRecord, CreateSubscriptionContractData, TerminateSubscriptionContractData, SubscriptionRepository, SubscriptionRecord, TransactionRunner, PlanCatalog, QuotaProvider } from '@saasicat/types';
2
2
  import { Type, DynamicModule } from '@nestjs/common';
3
- import { a as SaasPlatformAdapters } from '../saas-platform.module-D1mUZPrz.js';
4
- export { P as PLAN_RESOLVER_PORT_TOKEN, o as StaticPlanResolver } from '../saas-platform.module-D1mUZPrz.js';
5
- export { E as EnforceQuotaInterceptor, S as StaticEntitlementService, a as StaticFeatureGuard } from '../enforce-quota.interceptor-B9QueAFf.js';
3
+ import { S as SaaSiCatAdapters } from '../module-options-BymIkAsh.js';
4
+ export { P as PLAN_RESOLVER_PORT_TOKEN, n as StaticPlanResolver } from '../module-options-BymIkAsh.js';
5
+ export { E as EnforceQuotaInterceptor, S as StaticEntitlementService, a as StaticFeatureGuard } from '../enforce-quota.interceptor-BYqmdFB5.js';
6
6
  import '../di-CcNeq9v-.js';
7
7
  import '../admin-resources.module-BY5r_1MG.js';
8
8
  import '../admin-audit.service-9IqXMlZm.js';
9
- import '../plan-resolution-CFCoUkrE.js';
10
- import '../subscription-contract.module-edyhBr4n.js';
11
- import '../module-BE17XFLg.js';
12
- import '../service-D48clObR.js';
9
+ import '../tenant-billing.module-B0stLoJn.js';
10
+ import '../catalog.module-CQr1FpkI.js';
13
11
  import '../discovery.scanner-DLgEvuoy.js';
14
12
  import '@nestjs/core';
15
- import '../catalog.module-CQr1FpkI.js';
13
+ import '../plan-resolution-CFCoUkrE.js';
14
+ import '../promo.module-CnzddtJ0.js';
15
+ import '../promo.service-D48clObR.js';
16
16
  import '../checkout-offer.module-Ca3_TieR.js';
17
- import '../subscription-bundles.module-BDbODWvA.js';
17
+ import '../subscription-contract.module-edyhBr4n.js';
18
18
  import 'rxjs';
19
19
 
20
20
  /**
@@ -234,20 +234,20 @@ declare class StubAuditPort {
234
234
  declare class StubRlsBypassPort {
235
235
  runWithBypass<T>(fn: () => Promise<T>): Promise<T>;
236
236
  }
237
- interface CreateSaasPlatformTestModuleOptions {
237
+ interface CreateSaaSiCatTestModuleOptions {
238
238
  planCatalog: PlanCatalog;
239
239
  /** Default `'starter'` if the catalog has at least one plan. */
240
240
  defaultPlanId?: string;
241
241
  /** QuotaProvider classes for the `EnforceQuotaInterceptor`. */
242
242
  quotaProviders?: Array<Type<QuotaProvider>>;
243
243
  /** Overrides — if the test needs a different adapter. */
244
- overrides?: Partial<Pick<SaasPlatformAdapters, 'mfa' | 'audit' | 'rlsBypass'>>;
244
+ overrides?: Partial<Pick<SaaSiCatAdapters, 'mfa' | 'audit' | 'rlsBypass'>>;
245
245
  }
246
246
  /**
247
- * Returns a `DynamicModule` that sets up the SaasPlatformModule with stub
247
+ * Returns a `DynamicModule` that sets up the SaaSiCatModule with stub
248
248
  * adapters + the given PlanCatalog in static entitlement mode.
249
249
  * Tests can drop this into `Test.createTestingModule({ imports: [...] })`.
250
250
  */
251
- declare function createSaasPlatformTestModule(options: CreateSaasPlatformTestModuleOptions): DynamicModule;
251
+ declare function createSaaSiCatTestModule(options: CreateSaaSiCatTestModuleOptions): DynamicModule;
252
252
 
253
- export { type CreateSaasPlatformTestModuleOptions, FakeBundleRepository, FakeMarketingProjectionRepository, FakePlanRepository, FakePlanVersionRepository, FakeSubscriptionBundleRepository, FakeSubscriptionContractRepository, FakeSubscriptionRepository, FakeTransactionRunner, StubAuditPort, StubMfaPort, StubRlsBypassPort, createSaasPlatformTestModule };
253
+ export { type CreateSaaSiCatTestModuleOptions, FakeBundleRepository, FakeMarketingProjectionRepository, FakePlanRepository, FakePlanVersionRepository, FakeSubscriptionBundleRepository, FakeSubscriptionContractRepository, FakeSubscriptionRepository, FakeTransactionRunner, StubAuditPort, StubMfaPort, StubRlsBypassPort, createSaaSiCatTestModule };
@@ -1,32 +1,34 @@
1
1
  import {
2
2
  EnforceQuotaInterceptor,
3
3
  PLAN_RESOLVER_PORT_TOKEN,
4
- SaasPlatformModule,
4
+ SaaSiCatModule,
5
5
  StaticEntitlementService,
6
6
  StaticFeatureGuard,
7
7
  StaticPlanResolver
8
- } from "../chunk-TCBYOFAC.js";
9
- import "../chunk-B6IWLV7R.js";
10
- import "../chunk-SN5UOC43.js";
11
- import "../chunk-YWDLYOFN.js";
12
- import "../chunk-37HEKVDH.js";
13
- import "../chunk-B7NRY2LV.js";
14
- import "../chunk-7X5MSAIL.js";
15
- import "../chunk-WPUVJRIN.js";
16
- import "../chunk-E56W4U2P.js";
17
- import "../chunk-XTVAFJ3P.js";
8
+ } from "../chunk-JCAZT727.js";
9
+ import "../chunk-VTMCMVYQ.js";
10
+ import "../chunk-Y43SGD5J.js";
11
+ import "../chunk-IPOLCDKN.js";
12
+ import "../chunk-WSPHIIGS.js";
13
+ import "../chunk-V4OJ43K2.js";
14
+ import "../chunk-IVEA6M3B.js";
15
+ import "../chunk-SH7J5IU7.js";
16
+ import "../chunk-S6BAD5XM.js";
17
+ import "../chunk-O2J2HDXA.js";
18
+ import "../chunk-AEEK64XD.js";
18
19
  import "../chunk-BSK6YBLI.js";
19
20
  import "../chunk-YSC46BGM.js";
20
- import "../chunk-6WL6VQ7Z.js";
21
- import "../chunk-5ZXBXYXU.js";
22
- import "../chunk-NNNXXUPT.js";
21
+ import "../chunk-XBYAFEOR.js";
22
+ import "../chunk-WXYJHZCN.js";
23
+ import "../chunk-H3W6QDQH.js";
24
+ import "../chunk-XEW6YXL5.js";
23
25
  import "../chunk-DQKCK7DX.js";
24
- import "../chunk-NYLON2VC.js";
26
+ import "../chunk-VBRYPU7V.js";
25
27
  import "../chunk-EBJJNTW6.js";
26
- import "../chunk-WKVBNTYC.js";
27
- import "../chunk-L4KTQ6CL.js";
28
+ import "../chunk-OUDSQ3PU.js";
29
+ import "../chunk-AOQJEYOL.js";
28
30
  import "../chunk-SABTXESR.js";
29
- import "../chunk-L4SUWH5B.js";
31
+ import "../chunk-QUZU2M33.js";
30
32
  import {
31
33
  __name
32
34
  } from "../chunk-SHUYVCID.js";
@@ -339,7 +341,7 @@ var FakeTransactionRunner = class _FakeTransactionRunner {
339
341
  __name(this, "FakeTransactionRunner");
340
342
  }
341
343
  /** Sentinel value passed through as the TransactionContext. */
342
- static TX_SENTINEL = /* @__PURE__ */ Symbol.for("FakeTransactionRunner.tx");
344
+ static TX_SENTINEL = /* @__PURE__ */ Symbol.for("saasicat/nest/FakeTransactionRunner.tx");
343
345
  runCount = 0;
344
346
  async run(fn) {
345
347
  this.runCount += 1;
@@ -920,7 +922,7 @@ var FakePlanRepository = class {
920
922
  }
921
923
  };
922
924
 
923
- // src/testing/create-saas-platform-test-module.ts
925
+ // src/testing/create-saasicat-test-module.ts
924
926
  import { Module } from "@nestjs/common";
925
927
  function _ts_decorate(decorators, target, key, desc) {
926
928
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -962,17 +964,17 @@ var StubRlsBypassPort = class {
962
964
  return fn();
963
965
  }
964
966
  };
965
- function createSaasPlatformTestModule(options) {
967
+ function createSaaSiCatTestModule(options) {
966
968
  const defaultPlanId = options.defaultPlanId ?? options.planCatalog.plans?.[0]?.id;
967
- let SaasPlatformTestHost = class SaasPlatformTestHost {
969
+ let SaaSiCatTestHost = class SaaSiCatTestHost {
968
970
  static {
969
- __name(this, "SaasPlatformTestHost");
971
+ __name(this, "SaaSiCatTestHost");
970
972
  }
971
973
  };
972
- SaasPlatformTestHost = _ts_decorate([
974
+ SaaSiCatTestHost = _ts_decorate([
973
975
  Module({
974
976
  imports: [
975
- SaasPlatformModule.forRoot({
977
+ SaaSiCatModule.forRoot({
976
978
  planCatalog: options.planCatalog,
977
979
  controller: {
978
980
  guards: []
@@ -987,12 +989,12 @@ function createSaasPlatformTestModule(options) {
987
989
  })
988
990
  ]
989
991
  })
990
- ], SaasPlatformTestHost);
992
+ ], SaaSiCatTestHost);
991
993
  return {
992
- module: SaasPlatformTestHost
994
+ module: SaaSiCatTestHost
993
995
  };
994
996
  }
995
- __name(createSaasPlatformTestModule, "createSaasPlatformTestModule");
997
+ __name(createSaaSiCatTestModule, "createSaaSiCatTestModule");
996
998
  export {
997
999
  EnforceQuotaInterceptor,
998
1000
  FakeBundleRepository,
@@ -1010,5 +1012,5 @@ export {
1010
1012
  StubAuditPort,
1011
1013
  StubMfaPort,
1012
1014
  StubRlsBypassPort,
1013
- createSaasPlatformTestModule
1015
+ createSaaSiCatTestModule
1014
1016
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasicat/nest",
3
- "version": "0.26.1",
3
+ "version": "1.0.0-rc.0",
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",
@@ -137,8 +137,8 @@
137
137
  "js-yaml": "^4.3.1",
138
138
  "otplib": "^13.4.1",
139
139
  "qrcode": "^1.5.4",
140
- "@saasicat/spec": "^0.26.1",
141
- "@saasicat/types": "^0.26.1"
140
+ "@saasicat/spec": "^1.0.0-rc.0",
141
+ "@saasicat/types": "^1.0.0-rc.0"
142
142
  },
143
143
  "peerDependencies": {
144
144
  "@nestjs/common": "^11.0.0",
@@ -165,13 +165,13 @@
165
165
  "typescript": "^6.0.0",
166
166
  "unplugin-swc": "^1.5.9"
167
167
  },
168
- "license": "Apache-2.0",
168
+ "license": "PolyForm-Shield-1.0.0",
169
169
  "author": "Taci Uelker",
170
170
  "homepage": "https://github.com/uelker70/saasicat",
171
171
  "repository": {
172
172
  "type": "git",
173
173
  "url": "https://github.com/uelker70/saasicat.git",
174
- "directory": "packages/saas-platform-nest"
174
+ "directory": "packages/nest"
175
175
  },
176
176
  "bugs": {
177
177
  "url": "https://github.com/uelker70/saasicat/issues"
@@ -182,6 +182,6 @@
182
182
  "scripts": {
183
183
  "build": "node ../../scripts/build-and-prune.mjs \"tsup && tsup --config tsup.cjs.config.ts && node scripts/build-cjs-stubs.mjs\"",
184
184
  "pretest": "pnpm run build",
185
- "test": "node --test tests/**/*.test.js"
185
+ "test": "node --test 'tests/*.test.js'"
186
186
  }
187
187
  }
@@ -1,20 +0,0 @@
1
- // src/catalog/tokens.ts
2
- var PLAN_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/PlanRepository");
3
- var BUNDLE_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/BundleRepository");
4
- var MARKETING_PROJECTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/MarketingProjectionRepository");
5
- var CATALOG_ENTRY_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/CatalogEntryRepository");
6
- var PROMOTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/PromotionRepository");
7
- var MARKETING_SETTINGS_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/MarketingSettingsRepository");
8
- var CATALOG_SERVICE_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/CatalogServiceConfig");
9
- var FEATURE_UI_REGISTRY_TOKEN = /* @__PURE__ */ Symbol.for("saas-platform/CatalogFeatureUiRegistry");
10
-
11
- export {
12
- PLAN_REPOSITORY_TOKEN,
13
- BUNDLE_REPOSITORY_TOKEN,
14
- MARKETING_PROJECTION_REPOSITORY_TOKEN,
15
- CATALOG_ENTRY_REPOSITORY_TOKEN,
16
- PROMOTION_REPOSITORY_TOKEN,
17
- MARKETING_SETTINGS_REPOSITORY_TOKEN,
18
- CATALOG_SERVICE_CONFIG_TOKEN,
19
- FEATURE_UI_REGISTRY_TOKEN
20
- };