@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
@@ -1,143 +1,24 @@
1
- import { CanActivate, ExecutionContext, NestInterceptor, CallHandler, DynamicModule, FactoryProvider, Type, ForwardReference, Provider } from '@nestjs/common';
2
- import { Reflector } from '@nestjs/core';
3
- import { MfaPort, RlsBypassPort, AuditPort, PublicBootResponse, ManifestContribution, SubscriptionStatsPort, PromoCodeStatsPort, AuditStatsPort, SubscriptionStatsSnapshot, PromoCodeStatsSnapshot, AuditStatsSnapshot } from '@saasicat/types';
1
+ import { h as AdminStatsService, i as AdminStatsSnapshot } from '../admin-stats.module-v4SVvWzj.cjs';
2
+ export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsModule, g as AdminStatsModuleOptions, M as MfaGuard, j as MfaService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN, R as REQUIRE_MFA_KEY, k as RequireMfa, S as SuperAdminGuard, T as TotpSetupResult, V as VerifyTotpInput } from '../admin-stats.module-v4SVvWzj.cjs';
4
3
  export { A as AdminAuditService } from '../admin-audit.service-9IqXMlZm.cjs';
5
- import { Observable } from 'rxjs';
6
- import { P as ProviderSpec } from '../di-CcNeq9v-.cjs';
7
- import { A as AdminManifestConfig } from '../admin-manifest.config-DyrQNT7M.cjs';
8
- export { a as ADMIN_MANIFEST_CONFIG } from '../admin-manifest.config-DyrQNT7M.cjs';
9
- export { A as AdminManifestService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN } from '../admin-manifest.service-Cp6uwvmt.cjs';
4
+ import { b as AdminManifestConfig } from '../admin-resources.module-BZN_yBFj.cjs';
5
+ export { A as ADMIN_MANIFEST_CONFIG, a as ADMIN_RESOURCES_PORT_TOKEN, c as AdminResourcesModule, d as AdminResourcesModuleOptions, e as AdminResourcesService, S as SuspendTenantDto } from '../admin-resources.module-BZN_yBFj.cjs';
6
+ import { PublicBootResponse, ManifestContribution } from '@saasicat/types';
7
+ import '@nestjs/common';
8
+ import '@nestjs/core';
9
+ import 'rxjs';
10
+ import '../di-CcNeq9v-.cjs';
10
11
 
11
12
  declare const MFA_PORT_TOKEN: unique symbol;
12
13
  declare const AUDIT_PORT_TOKEN: unique symbol;
13
14
  declare const RLS_BYPASS_PORT_TOKEN: unique symbol;
14
15
 
15
- declare class SuperAdminGuard implements CanActivate {
16
- canActivate(context: ExecutionContext): boolean;
17
- }
18
-
19
- interface TotpSetupResult {
20
- /** Base32-encoded TOTP secret (persisted in the MfaPort). */
21
- secret: string;
22
- /** otpauth:// URI for the QR code generator (authenticator app). */
23
- otpauthUri: string;
24
- }
25
- interface VerifyTotpInput {
26
- userId: string;
27
- code: string;
28
- }
29
- declare class MfaService {
30
- private readonly mfa;
31
- private readonly logger;
32
- constructor(mfa: MfaPort);
33
- /**
34
- * Generates a new TOTP secret, persists it via `MfaPort.setSecret`
35
- * and returns the secret + the otpauth URI for the QR code.
36
- *
37
- * `issuer` and `label` shape the display in the authenticator (e.g.
38
- * "DemoApp:taci@example.com").
39
- */
40
- setup(userId: string, label: string, issuer: string): Promise<TotpSetupResult>;
41
- /**
42
- * Verifies the entered code against the stored secret,
43
- * clock-drift-tolerant by ±1 time step.
44
- */
45
- verify(input: VerifyTotpInput): Promise<boolean>;
46
- /**
47
- * Deletes a user's secret — used by `ahp admin mfa-reset`.
48
- */
49
- disable(userId: string): Promise<void>;
50
- /** Delegates to `MfaPort.isEnabled`. */
51
- isEnabled(userId: string): Promise<boolean>;
52
- }
53
-
54
- declare const REQUIRE_MFA_KEY = "saas-platform/require-mfa";
55
- /**
56
- * Marks an endpoint as MFA-required. The frontend sends the TOTP code
57
- * in the `X-Mfa-Code` header.
58
- */
59
- declare const RequireMfa: () => MethodDecorator & ClassDecorator;
60
- declare class MfaGuard implements CanActivate {
61
- private readonly reflector;
62
- private readonly mfaService;
63
- private readonly logger;
64
- constructor(reflector: Reflector, mfaService: MfaService);
65
- canActivate(context: ExecutionContext): Promise<boolean>;
66
- }
67
-
68
- declare class AdminBypassRlsInterceptor implements NestInterceptor {
69
- private readonly port;
70
- constructor(port: RlsBypassPort);
71
- intercept(_context: ExecutionContext, next: CallHandler): Observable<unknown>;
72
- }
73
-
74
- interface AdminModuleOptions {
75
- mfaPort: ProviderSpec<MfaPort>;
76
- auditPort: ProviderSpec<AuditPort>;
77
- rlsBypassPort: ProviderSpec<RlsBypassPort>;
78
- /** Register the module globally — default `false`. */
79
- global?: boolean;
80
- }
81
- declare class AdminModule {
82
- static forRoot(options: AdminModuleOptions): DynamicModule;
83
- }
84
-
85
16
  declare class AdminPublicBootController {
86
17
  private readonly config;
87
18
  constructor(config: AdminManifestConfig);
88
19
  getBoot(): PublicBootResponse;
89
20
  }
90
21
 
91
- type ConfigSpec = AdminManifestConfig | Pick<FactoryProvider<AdminManifestConfig>, 'useFactory' | 'inject'>;
92
- interface AdminManifestModuleOptions {
93
- /** AdminManifestConfig as a value or via a factory (e.g. with a PLAN_CATALOG_TOKEN inject). */
94
- config: ConfigSpec;
95
- /**
96
- * Default `true`. Set to `false` when the consumer registers its own
97
- * manifest controller with app-specific guards entirely on its own.
98
- */
99
- includeManifestController?: boolean;
100
- /**
101
- * Class-level guards for GET /admin/manifest and POST /admin/manifest/reload,
102
- * when `includeManifestController === true`. REQUIRED — otherwise
103
- * `forRoot()` throws at boot.
104
- *
105
- * Pass `[]` explicitly when the endpoint should intentionally be auth-free
106
- * (e.g. CI smoke tests, public demo). This makes the choice visible in the
107
- * code rather than a silent default.
108
- */
109
- guards?: Array<Type<CanActivate>>;
110
- /**
111
- * Additional guards that apply ONLY to POST /admin/manifest/reload
112
- * (typically `MfaGuard`). Placed after `guards` in the chain. Must be made
113
- * available by the consumer as a provider.
114
- */
115
- reloadGuards?: Array<Type<CanActivate>>;
116
- /**
117
- * Default `true`. When active, the module automatically hooks
118
- * `PLATFORM_CORE_MANIFEST_CONTRIBUTION` (StandardPage spine, generic tenant
119
- * actions, platform audit action labels) into the `AdminManifestService` —
120
- * before all app `register()` calls from `onModuleInit`. Consumers without
121
- * a SuperAdmin need set this to `false`.
122
- */
123
- registerPlatformCore?: boolean;
124
- /**
125
- * Modules whose providers must be visible in the DI scope of this
126
- * DynamicModule — typically: the app module that registers the
127
- * factory-inject provider (e.g. `AdminManifestConfigFactory`). Without this
128
- * entry, NestJS 11.1.19 cannot resolve the `inject:[...]` of the config
129
- * factory (UnknownDependenciesException for ADMIN_MANIFEST_CONFIG).
130
- */
131
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
132
- /** Additional providers that are registered in the DynamicModule itself. */
133
- extraProviders?: Provider[];
134
- /** Register the module globally — default `false`. */
135
- global?: boolean;
136
- }
137
- declare class AdminManifestModule {
138
- static forRoot(options: AdminManifestModuleOptions): DynamicModule;
139
- }
140
-
141
22
  declare const PLATFORM_CORE_MANIFEST_CONTRIBUTION: ManifestContribution;
142
23
 
143
24
  declare const SUBSCRIPTION_STATS_PORT_TOKEN: unique symbol;
@@ -146,52 +27,10 @@ declare const AUDIT_STATS_PORT_TOKEN: unique symbol;
146
27
  /** Default audit window in days for the dashboard KPI. Override via forRoot. */
147
28
  declare const ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN: unique symbol;
148
29
 
149
- /**
150
- * Platform stats for the SuperAdmin dashboard page.
151
- *
152
- * Contains subscription/promo/audit aggregates that are equally meaningful
153
- * across all consuming apps. App-specific KPIs (e.g. DATEV or Bundles/Members)
154
- * remain extra endpoints in the respective app.
155
- */
156
- interface AdminStatsSnapshot {
157
- subscriptions: SubscriptionStatsSnapshot;
158
- promos: PromoCodeStatsSnapshot;
159
- audit: AuditStatsSnapshot;
160
- }
161
- declare class AdminStatsService {
162
- private readonly subscriptions;
163
- private readonly promos;
164
- private readonly audit;
165
- private readonly auditWindowDays;
166
- constructor(subscriptions: SubscriptionStatsPort, promos: PromoCodeStatsPort, audit: AuditStatsPort, auditWindowDays?: number);
167
- getSnapshot(): Promise<AdminStatsSnapshot>;
168
- }
169
-
170
30
  declare class AdminStatsController {
171
31
  private readonly stats;
172
32
  constructor(stats: AdminStatsService);
173
33
  getDashboardSnapshot(): Promise<AdminStatsSnapshot>;
174
34
  }
175
35
 
176
- interface AdminStatsModuleOptions {
177
- subscriptionStatsPort: ProviderSpec<SubscriptionStatsPort>;
178
- promoCodeStatsPort: ProviderSpec<PromoCodeStatsPort>;
179
- auditStatsPort: ProviderSpec<AuditStatsPort>;
180
- /** Audit window in days for the "last N days" KPI. Default 7. */
181
- auditWindowDays?: number;
182
- /**
183
- * Modules whose providers must be visible in the DI scope of this
184
- * DynamicModule — e.g. the app module that registers the adapter classes
185
- * referenced by the factory `inject` lists.
186
- */
187
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
188
- /** Additional providers registered in the DynamicModule itself. */
189
- extraProviders?: Provider[];
190
- /** Register the module globally — default `false`. */
191
- global?: boolean;
192
- }
193
- declare class AdminStatsModule {
194
- static forRoot(options: AdminStatsModuleOptions): DynamicModule;
195
- }
196
-
197
- export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT_TOKEN, AdminBypassRlsInterceptor, AdminManifestConfig, AdminManifestModule, type AdminManifestModuleOptions, AdminModule, type AdminModuleOptions, AdminPublicBootController, AdminStatsController, AdminStatsModule, type AdminStatsModuleOptions, AdminStatsService, type AdminStatsSnapshot, MFA_PORT_TOKEN, MfaGuard, MfaService, PLATFORM_CORE_MANIFEST_CONTRIBUTION, PROMO_CODE_STATS_PORT_TOKEN, REQUIRE_MFA_KEY, RLS_BYPASS_PORT_TOKEN, RequireMfa, SUBSCRIPTION_STATS_PORT_TOKEN, SuperAdminGuard, type TotpSetupResult, type VerifyTotpInput };
36
+ export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT_TOKEN, AdminManifestConfig, AdminPublicBootController, AdminStatsController, AdminStatsService, AdminStatsSnapshot, MFA_PORT_TOKEN, PLATFORM_CORE_MANIFEST_CONTRIBUTION, PROMO_CODE_STATS_PORT_TOKEN, RLS_BYPASS_PORT_TOKEN, SUBSCRIPTION_STATS_PORT_TOKEN };
@@ -1,143 +1,24 @@
1
- import { CanActivate, ExecutionContext, NestInterceptor, CallHandler, DynamicModule, FactoryProvider, Type, ForwardReference, Provider } from '@nestjs/common';
2
- import { Reflector } from '@nestjs/core';
3
- import { MfaPort, RlsBypassPort, AuditPort, PublicBootResponse, ManifestContribution, SubscriptionStatsPort, PromoCodeStatsPort, AuditStatsPort, SubscriptionStatsSnapshot, PromoCodeStatsSnapshot, AuditStatsSnapshot } from '@saasicat/types';
1
+ import { h as AdminStatsService, i as AdminStatsSnapshot } from '../admin-stats.module-15ac5KY3.js';
2
+ export { A as AdminBypassRlsInterceptor, a as AdminManifestModule, b as AdminManifestModuleOptions, c as AdminManifestService, d as AdminModule, e as AdminModuleOptions, f as AdminStatsModule, g as AdminStatsModuleOptions, M as MfaGuard, j as MfaService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN, R as REQUIRE_MFA_KEY, k as RequireMfa, S as SuperAdminGuard, T as TotpSetupResult, V as VerifyTotpInput } from '../admin-stats.module-15ac5KY3.js';
4
3
  export { A as AdminAuditService } from '../admin-audit.service-9IqXMlZm.js';
5
- import { Observable } from 'rxjs';
6
- import { P as ProviderSpec } from '../di-CcNeq9v-.js';
7
- import { A as AdminManifestConfig } from '../admin-manifest.config-DyrQNT7M.js';
8
- export { a as ADMIN_MANIFEST_CONFIG } from '../admin-manifest.config-DyrQNT7M.js';
9
- export { A as AdminManifestService, P as PLATFORM_CORE_CONTRIBUTION_TOKEN } from '../admin-manifest.service-UGgzR1x-.js';
4
+ import { b as AdminManifestConfig } from '../admin-resources.module-Cms8MY6h.js';
5
+ export { A as ADMIN_MANIFEST_CONFIG, a as ADMIN_RESOURCES_PORT_TOKEN, c as AdminResourcesModule, d as AdminResourcesModuleOptions, e as AdminResourcesService, S as SuspendTenantDto } from '../admin-resources.module-Cms8MY6h.js';
6
+ import { PublicBootResponse, ManifestContribution } from '@saasicat/types';
7
+ import '@nestjs/common';
8
+ import '@nestjs/core';
9
+ import 'rxjs';
10
+ import '../di-CcNeq9v-.js';
10
11
 
11
12
  declare const MFA_PORT_TOKEN: unique symbol;
12
13
  declare const AUDIT_PORT_TOKEN: unique symbol;
13
14
  declare const RLS_BYPASS_PORT_TOKEN: unique symbol;
14
15
 
15
- declare class SuperAdminGuard implements CanActivate {
16
- canActivate(context: ExecutionContext): boolean;
17
- }
18
-
19
- interface TotpSetupResult {
20
- /** Base32-encoded TOTP secret (persisted in the MfaPort). */
21
- secret: string;
22
- /** otpauth:// URI for the QR code generator (authenticator app). */
23
- otpauthUri: string;
24
- }
25
- interface VerifyTotpInput {
26
- userId: string;
27
- code: string;
28
- }
29
- declare class MfaService {
30
- private readonly mfa;
31
- private readonly logger;
32
- constructor(mfa: MfaPort);
33
- /**
34
- * Generates a new TOTP secret, persists it via `MfaPort.setSecret`
35
- * and returns the secret + the otpauth URI for the QR code.
36
- *
37
- * `issuer` and `label` shape the display in the authenticator (e.g.
38
- * "DemoApp:taci@example.com").
39
- */
40
- setup(userId: string, label: string, issuer: string): Promise<TotpSetupResult>;
41
- /**
42
- * Verifies the entered code against the stored secret,
43
- * clock-drift-tolerant by ±1 time step.
44
- */
45
- verify(input: VerifyTotpInput): Promise<boolean>;
46
- /**
47
- * Deletes a user's secret — used by `ahp admin mfa-reset`.
48
- */
49
- disable(userId: string): Promise<void>;
50
- /** Delegates to `MfaPort.isEnabled`. */
51
- isEnabled(userId: string): Promise<boolean>;
52
- }
53
-
54
- declare const REQUIRE_MFA_KEY = "saas-platform/require-mfa";
55
- /**
56
- * Marks an endpoint as MFA-required. The frontend sends the TOTP code
57
- * in the `X-Mfa-Code` header.
58
- */
59
- declare const RequireMfa: () => MethodDecorator & ClassDecorator;
60
- declare class MfaGuard implements CanActivate {
61
- private readonly reflector;
62
- private readonly mfaService;
63
- private readonly logger;
64
- constructor(reflector: Reflector, mfaService: MfaService);
65
- canActivate(context: ExecutionContext): Promise<boolean>;
66
- }
67
-
68
- declare class AdminBypassRlsInterceptor implements NestInterceptor {
69
- private readonly port;
70
- constructor(port: RlsBypassPort);
71
- intercept(_context: ExecutionContext, next: CallHandler): Observable<unknown>;
72
- }
73
-
74
- interface AdminModuleOptions {
75
- mfaPort: ProviderSpec<MfaPort>;
76
- auditPort: ProviderSpec<AuditPort>;
77
- rlsBypassPort: ProviderSpec<RlsBypassPort>;
78
- /** Register the module globally — default `false`. */
79
- global?: boolean;
80
- }
81
- declare class AdminModule {
82
- static forRoot(options: AdminModuleOptions): DynamicModule;
83
- }
84
-
85
16
  declare class AdminPublicBootController {
86
17
  private readonly config;
87
18
  constructor(config: AdminManifestConfig);
88
19
  getBoot(): PublicBootResponse;
89
20
  }
90
21
 
91
- type ConfigSpec = AdminManifestConfig | Pick<FactoryProvider<AdminManifestConfig>, 'useFactory' | 'inject'>;
92
- interface AdminManifestModuleOptions {
93
- /** AdminManifestConfig as a value or via a factory (e.g. with a PLAN_CATALOG_TOKEN inject). */
94
- config: ConfigSpec;
95
- /**
96
- * Default `true`. Set to `false` when the consumer registers its own
97
- * manifest controller with app-specific guards entirely on its own.
98
- */
99
- includeManifestController?: boolean;
100
- /**
101
- * Class-level guards for GET /admin/manifest and POST /admin/manifest/reload,
102
- * when `includeManifestController === true`. REQUIRED — otherwise
103
- * `forRoot()` throws at boot.
104
- *
105
- * Pass `[]` explicitly when the endpoint should intentionally be auth-free
106
- * (e.g. CI smoke tests, public demo). This makes the choice visible in the
107
- * code rather than a silent default.
108
- */
109
- guards?: Array<Type<CanActivate>>;
110
- /**
111
- * Additional guards that apply ONLY to POST /admin/manifest/reload
112
- * (typically `MfaGuard`). Placed after `guards` in the chain. Must be made
113
- * available by the consumer as a provider.
114
- */
115
- reloadGuards?: Array<Type<CanActivate>>;
116
- /**
117
- * Default `true`. When active, the module automatically hooks
118
- * `PLATFORM_CORE_MANIFEST_CONTRIBUTION` (StandardPage spine, generic tenant
119
- * actions, platform audit action labels) into the `AdminManifestService` —
120
- * before all app `register()` calls from `onModuleInit`. Consumers without
121
- * a SuperAdmin need set this to `false`.
122
- */
123
- registerPlatformCore?: boolean;
124
- /**
125
- * Modules whose providers must be visible in the DI scope of this
126
- * DynamicModule — typically: the app module that registers the
127
- * factory-inject provider (e.g. `AdminManifestConfigFactory`). Without this
128
- * entry, NestJS 11.1.19 cannot resolve the `inject:[...]` of the config
129
- * factory (UnknownDependenciesException for ADMIN_MANIFEST_CONFIG).
130
- */
131
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
132
- /** Additional providers that are registered in the DynamicModule itself. */
133
- extraProviders?: Provider[];
134
- /** Register the module globally — default `false`. */
135
- global?: boolean;
136
- }
137
- declare class AdminManifestModule {
138
- static forRoot(options: AdminManifestModuleOptions): DynamicModule;
139
- }
140
-
141
22
  declare const PLATFORM_CORE_MANIFEST_CONTRIBUTION: ManifestContribution;
142
23
 
143
24
  declare const SUBSCRIPTION_STATS_PORT_TOKEN: unique symbol;
@@ -146,52 +27,10 @@ declare const AUDIT_STATS_PORT_TOKEN: unique symbol;
146
27
  /** Default audit window in days for the dashboard KPI. Override via forRoot. */
147
28
  declare const ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN: unique symbol;
148
29
 
149
- /**
150
- * Platform stats for the SuperAdmin dashboard page.
151
- *
152
- * Contains subscription/promo/audit aggregates that are equally meaningful
153
- * across all consuming apps. App-specific KPIs (e.g. DATEV or Bundles/Members)
154
- * remain extra endpoints in the respective app.
155
- */
156
- interface AdminStatsSnapshot {
157
- subscriptions: SubscriptionStatsSnapshot;
158
- promos: PromoCodeStatsSnapshot;
159
- audit: AuditStatsSnapshot;
160
- }
161
- declare class AdminStatsService {
162
- private readonly subscriptions;
163
- private readonly promos;
164
- private readonly audit;
165
- private readonly auditWindowDays;
166
- constructor(subscriptions: SubscriptionStatsPort, promos: PromoCodeStatsPort, audit: AuditStatsPort, auditWindowDays?: number);
167
- getSnapshot(): Promise<AdminStatsSnapshot>;
168
- }
169
-
170
30
  declare class AdminStatsController {
171
31
  private readonly stats;
172
32
  constructor(stats: AdminStatsService);
173
33
  getDashboardSnapshot(): Promise<AdminStatsSnapshot>;
174
34
  }
175
35
 
176
- interface AdminStatsModuleOptions {
177
- subscriptionStatsPort: ProviderSpec<SubscriptionStatsPort>;
178
- promoCodeStatsPort: ProviderSpec<PromoCodeStatsPort>;
179
- auditStatsPort: ProviderSpec<AuditStatsPort>;
180
- /** Audit window in days for the "last N days" KPI. Default 7. */
181
- auditWindowDays?: number;
182
- /**
183
- * Modules whose providers must be visible in the DI scope of this
184
- * DynamicModule — e.g. the app module that registers the adapter classes
185
- * referenced by the factory `inject` lists.
186
- */
187
- imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
188
- /** Additional providers registered in the DynamicModule itself. */
189
- extraProviders?: Provider[];
190
- /** Register the module globally — default `false`. */
191
- global?: boolean;
192
- }
193
- declare class AdminStatsModule {
194
- static forRoot(options: AdminStatsModuleOptions): DynamicModule;
195
- }
196
-
197
- export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT_TOKEN, AdminBypassRlsInterceptor, AdminManifestConfig, AdminManifestModule, type AdminManifestModuleOptions, AdminModule, type AdminModuleOptions, AdminPublicBootController, AdminStatsController, AdminStatsModule, type AdminStatsModuleOptions, AdminStatsService, type AdminStatsSnapshot, MFA_PORT_TOKEN, MfaGuard, MfaService, PLATFORM_CORE_MANIFEST_CONTRIBUTION, PROMO_CODE_STATS_PORT_TOKEN, REQUIRE_MFA_KEY, RLS_BYPASS_PORT_TOKEN, RequireMfa, SUBSCRIPTION_STATS_PORT_TOKEN, SuperAdminGuard, type TotpSetupResult, type VerifyTotpInput };
36
+ export { ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN, AUDIT_PORT_TOKEN, AUDIT_STATS_PORT_TOKEN, AdminManifestConfig, AdminPublicBootController, AdminStatsController, AdminStatsService, AdminStatsSnapshot, MFA_PORT_TOKEN, PLATFORM_CORE_MANIFEST_CONTRIBUTION, PROMO_CODE_STATS_PORT_TOKEN, RLS_BYPASS_PORT_TOKEN, SUBSCRIPTION_STATS_PORT_TOKEN };
@@ -1,3 +1,4 @@
1
+ import "../chunk-UF53DWWR.js";
1
2
  import {
2
3
  ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN,
3
4
  AUDIT_STATS_PORT_TOKEN,
@@ -6,22 +7,26 @@ import {
6
7
  AdminStatsService,
7
8
  PROMO_CODE_STATS_PORT_TOKEN,
8
9
  SUBSCRIPTION_STATS_PORT_TOKEN
9
- } from "../chunk-T5SXXAKG.js";
10
+ } from "../chunk-LZHLGUQI.js";
10
11
  import {
11
12
  ADMIN_MANIFEST_CONFIG,
13
+ ADMIN_RESOURCES_PORT_TOKEN,
12
14
  AdminBypassRlsInterceptor,
13
15
  AdminManifestModule,
14
16
  AdminManifestService,
15
17
  AdminModule,
16
18
  AdminPublicBootController,
19
+ AdminResourcesModule,
20
+ AdminResourcesService,
17
21
  MfaGuard,
18
22
  MfaService,
19
23
  PLATFORM_CORE_CONTRIBUTION_TOKEN,
20
24
  PLATFORM_CORE_MANIFEST_CONTRIBUTION,
21
25
  REQUIRE_MFA_KEY,
22
26
  RequireMfa,
23
- SuperAdminGuard
24
- } from "../chunk-PLDHI6NA.js";
27
+ SuperAdminGuard,
28
+ SuspendTenantDto
29
+ } from "../chunk-FVT7KTUI.js";
25
30
  import {
26
31
  AUDIT_PORT_TOKEN,
27
32
  AdminAuditService,
@@ -32,6 +37,7 @@ import "../chunk-SABTXESR.js";
32
37
  import "../chunk-SHUYVCID.js";
33
38
  export {
34
39
  ADMIN_MANIFEST_CONFIG,
40
+ ADMIN_RESOURCES_PORT_TOKEN,
35
41
  ADMIN_STATS_AUDIT_WINDOW_DAYS_TOKEN,
36
42
  AUDIT_PORT_TOKEN,
37
43
  AUDIT_STATS_PORT_TOKEN,
@@ -41,6 +47,8 @@ export {
41
47
  AdminManifestService,
42
48
  AdminModule,
43
49
  AdminPublicBootController,
50
+ AdminResourcesModule,
51
+ AdminResourcesService,
44
52
  AdminStatsController,
45
53
  AdminStatsModule,
46
54
  AdminStatsService,
@@ -54,5 +62,6 @@ export {
54
62
  RLS_BYPASS_PORT_TOKEN,
55
63
  RequireMfa,
56
64
  SUBSCRIPTION_STATS_PORT_TOKEN,
57
- SuperAdminGuard
65
+ SuperAdminGuard,
66
+ SuspendTenantDto
58
67
  };
@@ -0,0 +1,40 @@
1
+ import { AdminManifest, AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, AdminActor, AdminTenantStateResult } from '@saasicat/types';
2
+ import { Type, CanActivate, DynamicModule, ForwardReference } from '@nestjs/common';
3
+ import { P as ProviderSpec } from './di-CcNeq9v-.cjs';
4
+ import { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.cjs';
5
+
6
+ declare const ADMIN_MANIFEST_CONFIG: unique symbol;
7
+ interface AdminManifestConfig {
8
+ project: AdminManifest['project'];
9
+ build: Omit<AdminManifest['build'], 'manifestHash'>;
10
+ planCatalogSnapshot: AdminManifest['planCatalogSnapshot'];
11
+ }
12
+
13
+ declare const ADMIN_RESOURCES_PORT_TOKEN: unique symbol;
14
+ declare class SuspendTenantDto {
15
+ reason?: string;
16
+ }
17
+ declare class AdminResourcesService {
18
+ private readonly resources;
19
+ private readonly audit;
20
+ constructor(resources: AdminResourcesPort, audit: AdminAuditService);
21
+ listTenants(filter: AdminTenantListFilter): Promise<AdminTenantListRow[]>;
22
+ getTenantDetail(slug: string): Promise<AdminTenantDetail>;
23
+ listUsers(filter: AdminUserListFilter): Promise<AdminUserListRow[]>;
24
+ listAudit(filter: AdminAuditListFilter): Promise<AuditEntry[]>;
25
+ listSubscriptions(): Promise<AdminSubscriptionListRow[]>;
26
+ suspendTenant(slug: string, reason: string | undefined, actor: AdminActor): Promise<AdminTenantStateResult>;
27
+ reactivateTenant(slug: string, actor: AdminActor): Promise<AdminTenantStateResult>;
28
+ private setTenantActive;
29
+ }
30
+ interface AdminResourcesModuleOptions {
31
+ resources: ProviderSpec<AdminResourcesPort>;
32
+ guards: Array<Type<CanActivate>>;
33
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
34
+ global?: boolean;
35
+ }
36
+ declare class AdminResourcesModule {
37
+ static forRoot(options: AdminResourcesModuleOptions): DynamicModule;
38
+ }
39
+
40
+ export { ADMIN_MANIFEST_CONFIG as A, SuspendTenantDto as S, ADMIN_RESOURCES_PORT_TOKEN as a, type AdminManifestConfig as b, AdminResourcesModule as c, type AdminResourcesModuleOptions as d, AdminResourcesService as e };
@@ -0,0 +1,40 @@
1
+ import { AdminManifest, AdminResourcesPort, AdminTenantListFilter, AdminTenantListRow, AdminTenantDetail, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow, AdminActor, AdminTenantStateResult } from '@saasicat/types';
2
+ import { Type, CanActivate, DynamicModule, ForwardReference } from '@nestjs/common';
3
+ import { P as ProviderSpec } from './di-CcNeq9v-.js';
4
+ import { A as AdminAuditService } from './admin-audit.service-9IqXMlZm.js';
5
+
6
+ declare const ADMIN_MANIFEST_CONFIG: unique symbol;
7
+ interface AdminManifestConfig {
8
+ project: AdminManifest['project'];
9
+ build: Omit<AdminManifest['build'], 'manifestHash'>;
10
+ planCatalogSnapshot: AdminManifest['planCatalogSnapshot'];
11
+ }
12
+
13
+ declare const ADMIN_RESOURCES_PORT_TOKEN: unique symbol;
14
+ declare class SuspendTenantDto {
15
+ reason?: string;
16
+ }
17
+ declare class AdminResourcesService {
18
+ private readonly resources;
19
+ private readonly audit;
20
+ constructor(resources: AdminResourcesPort, audit: AdminAuditService);
21
+ listTenants(filter: AdminTenantListFilter): Promise<AdminTenantListRow[]>;
22
+ getTenantDetail(slug: string): Promise<AdminTenantDetail>;
23
+ listUsers(filter: AdminUserListFilter): Promise<AdminUserListRow[]>;
24
+ listAudit(filter: AdminAuditListFilter): Promise<AuditEntry[]>;
25
+ listSubscriptions(): Promise<AdminSubscriptionListRow[]>;
26
+ suspendTenant(slug: string, reason: string | undefined, actor: AdminActor): Promise<AdminTenantStateResult>;
27
+ reactivateTenant(slug: string, actor: AdminActor): Promise<AdminTenantStateResult>;
28
+ private setTenantActive;
29
+ }
30
+ interface AdminResourcesModuleOptions {
31
+ resources: ProviderSpec<AdminResourcesPort>;
32
+ guards: Array<Type<CanActivate>>;
33
+ imports?: Array<Type<unknown> | DynamicModule | Promise<DynamicModule> | ForwardReference>;
34
+ global?: boolean;
35
+ }
36
+ declare class AdminResourcesModule {
37
+ static forRoot(options: AdminResourcesModuleOptions): DynamicModule;
38
+ }
39
+
40
+ export { ADMIN_MANIFEST_CONFIG as A, SuspendTenantDto as S, ADMIN_RESOURCES_PORT_TOKEN as a, type AdminManifestConfig as b, AdminResourcesModule as c, type AdminResourcesModuleOptions as d, AdminResourcesService as e };