@magnet-cms/core 1.0.3 → 3.0.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 (39) hide show
  1. package/dist/cache.settings-WVD3J7KS.js +5 -0
  2. package/dist/{chunk-VRD3SNTH.js → chunk-4KTI5N3Y.js} +5 -5
  3. package/dist/{chunk-2G3SJVME.js → chunk-57BXP7WT.js} +3 -3
  4. package/dist/{chunk-GRTSRYQ3.js → chunk-5ZNZ457Y.js} +1 -1
  5. package/dist/{chunk-UPVWRKGL.js → chunk-BLOJL7F5.js} +1 -1
  6. package/dist/{chunk-IRYV6KDU.js → chunk-D3C3IDJE.js} +1806 -2919
  7. package/dist/chunk-FPVW2XEK.js +77 -0
  8. package/dist/{chunk-VPQMUAKT.js → chunk-L5S66O2C.js} +2945 -1418
  9. package/dist/{chunk-5KKPPI6S.js → chunk-LSFWCRI6.js} +3 -3
  10. package/dist/{dist-es-EKS5UN6W.js → dist-es-FN4ZDH7H.js} +3 -3
  11. package/dist/dist-es-IFKE2QTH.js +1 -1
  12. package/dist/{dist-es-J4ID6CFE.js → dist-es-JOTZAW56.js} +3 -3
  13. package/dist/{dist-es-SH3IYNFH.js → dist-es-UU6EFY2O.js} +2 -2
  14. package/dist/index.cjs +62120 -8608
  15. package/dist/index.d.cts +22 -7
  16. package/dist/index.d.ts +22 -7
  17. package/dist/index.js +53223 -193
  18. package/dist/{loadCognitoIdentity-IDLT73F5.js → loadCognitoIdentity-VHCOBTS2.js} +4 -4
  19. package/dist/{loadSso-VKQ2MGWC.js → loadSso-5XNIYOZP.js} +4 -4
  20. package/dist/{loadSts-CDV5EIAC.js → loadSts-IC4PURXF.js} +6 -6
  21. package/dist/magnet-module-imports.cjs +3864 -3393
  22. package/dist/magnet-module-imports.d.cts +6 -2
  23. package/dist/magnet-module-imports.d.ts +6 -2
  24. package/dist/magnet-module-imports.js +12 -11
  25. package/dist/modules.cjs +3921 -2174
  26. package/dist/modules.d.cts +298 -618
  27. package/dist/modules.d.ts +298 -618
  28. package/dist/modules.js +179 -15
  29. package/dist/permission.guard-B8HLjHP2.d.cts +912 -0
  30. package/dist/permission.guard-B8HLjHP2.d.ts +912 -0
  31. package/dist/{settings.module-CS9n15pg.d.cts → settings.module-CX5Cs5fA.d.cts} +29 -3
  32. package/dist/{settings.module-CS9n15pg.d.ts → settings.module-CX5Cs5fA.d.ts} +29 -3
  33. package/dist/{signin-OTF7SOKV.js → signin-TXX6BWCZ.js} +4 -4
  34. package/dist/{sso-oidc-IU7NSPWD.js → sso-oidc-CMVLR2KO.js} +4 -4
  35. package/dist/{sts-IGHPXD4X.js → sts-MASJMUF3.js} +6 -6
  36. package/package.json +3 -3
  37. package/dist/auth-strategy.factory-D2p1hfeq.d.cts +0 -303
  38. package/dist/auth-strategy.factory-D2p1hfeq.d.ts +0 -303
  39. package/dist/{chunk-ISB33RLS.js → chunk-47RGXMWN.js} +3 -3
package/dist/index.d.cts CHANGED
@@ -1,13 +1,16 @@
1
1
  import { MagnetProvider, MagnetGlobalOptions, DatabaseAdapter, DBConfig } from '@magnet-cms/common';
2
2
  import * as _nestjs_common from '@nestjs/common';
3
3
  import { DynamicModule, Type, OnModuleInit, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
4
- import { E as EventService, M as MagnetLogger } from './auth-strategy.factory-D2p1hfeq.cjs';
5
- export { A as AuthStrategyFactory, H as Hook, I as InjectPluginOptions, P as Plugin, a as PluginDecoratorOptions } from './auth-strategy.factory-D2p1hfeq.cjs';
4
+ import { E as EventService, M as MagnetLogger } from './permission.guard-B8HLjHP2.cjs';
5
+ export { A as AuthStrategyFactory, H as Hook, I as InjectPluginOptions, b as PermissionGuard, P as Plugin, a as PluginDecoratorOptions } from './permission.guard-B8HLjHP2.cjs';
6
6
  import { DiscoveryService, MetadataScanner, Reflector } from '@nestjs/core';
7
7
  import { AsyncLocalStorage } from 'node:async_hooks';
8
+ import * as rxjs from 'rxjs';
8
9
  import { Observable } from 'rxjs';
9
10
  import * as _nestjs_terminus from '@nestjs/terminus';
10
11
  import { HealthCheckService, MemoryHealthIndicator, DiskHealthIndicator } from '@nestjs/terminus';
12
+ import * as _nestjs_passport from '@nestjs/passport';
13
+ import '@nestjs/core/injector/instance-wrapper';
11
14
 
12
15
  declare class MagnetModule {
13
16
  /**
@@ -17,7 +20,7 @@ declare class MagnetModule {
17
20
  * Environment variables are validated upfront before NestJS bootstraps.
18
21
  *
19
22
  * @param providers - Array of MagnetProvider objects from adapter/plugin `.forRoot()` calls
20
- * @param globalOptions - Cross-cutting options (JWT, admin, RBAC, i18n)
23
+ * @param globalOptions - Cross-cutting options (JWT, admin, RBAC, i18n). Admin UI serving is on by default; pass `{ admin: false }` for API-only mode.
21
24
  *
22
25
  * @example
23
26
  * ```typescript
@@ -27,7 +30,7 @@ declare class MagnetModule {
27
30
  * MagnetModule.forRoot([
28
31
  * MongooseDatabaseAdapter.forRoot(),
29
32
  * StripePlugin.forRoot({ currency: 'usd' }),
30
- * ], { admin: true })
33
+ * ])
31
34
  * ```
32
35
  */
33
36
  static forRoot(providers: MagnetProvider[], globalOptions?: MagnetGlobalOptions): DynamicModule;
@@ -35,8 +38,6 @@ declare class MagnetModule {
35
38
  }
36
39
 
37
40
  declare class DatabaseModule {
38
- /** Cached adapter instance set during register(), used by forFeature() */
39
- private static adapter;
40
41
  /**
41
42
  * Register the database module with an adapter and config.
42
43
  *
@@ -44,6 +45,15 @@ declare class DatabaseModule {
44
45
  * @param config - Resolved database config (from provider.config)
45
46
  */
46
47
  static register(adapter: DatabaseAdapter, config: DBConfig): DynamicModule;
48
+ /**
49
+ * Register schemas for database access.
50
+ *
51
+ * Nest’s compiled CJS output often `require()`s feature modules before the
52
+ * `AppModule` decorator runs `MagnetModule.forRoot()`, so `register()` may
53
+ * not have run yet. In that case we fall back to the adapter singleton
54
+ * registered by the official DB packages via
55
+ * `registerDatabaseAdapterSingletonForFeature()` (same instance as `forRoot()`).
56
+ */
47
57
  static forFeature(schemas: Type | Type[]): DynamicModule;
48
58
  }
49
59
 
@@ -265,4 +275,9 @@ declare class LoggingModule {
265
275
  declare const IS_RESTRICTED_ROUTE = "IS_RESTRICTED_ROUTE";
266
276
  declare function RestrictedRoute(): _nestjs_common.CustomDecorator<string>;
267
277
 
268
- export { DatabaseModule, DiscoveryModule, type EventContext, EventContextInterceptor, EventHandlerDiscoveryService, EventService, EventsModule, HealthController, HealthModule, IS_RESTRICTED_ROUTE, LoggingInterceptor, LoggingModule, MagnetLogger, MagnetModule, RestrictedRoute, createEventContext, eventContextStorage, getEventContext };
278
+ declare const JwtAuthGuard_base: _nestjs_passport.Type<_nestjs_passport.IAuthGuard>;
279
+ declare class JwtAuthGuard extends JwtAuthGuard_base {
280
+ canActivate(context: ExecutionContext): boolean | Promise<boolean> | rxjs.Observable<boolean>;
281
+ }
282
+
283
+ export { DatabaseModule, DiscoveryModule, type EventContext, EventContextInterceptor, EventHandlerDiscoveryService, EventService, EventsModule, HealthController, HealthModule, IS_RESTRICTED_ROUTE, JwtAuthGuard, LoggingInterceptor, LoggingModule, MagnetLogger, MagnetModule, RestrictedRoute, createEventContext, eventContextStorage, getEventContext };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,16 @@
1
1
  import { MagnetProvider, MagnetGlobalOptions, DatabaseAdapter, DBConfig } from '@magnet-cms/common';
2
2
  import * as _nestjs_common from '@nestjs/common';
3
3
  import { DynamicModule, Type, OnModuleInit, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
4
- import { E as EventService, M as MagnetLogger } from './auth-strategy.factory-D2p1hfeq.js';
5
- export { A as AuthStrategyFactory, H as Hook, I as InjectPluginOptions, P as Plugin, a as PluginDecoratorOptions } from './auth-strategy.factory-D2p1hfeq.js';
4
+ import { E as EventService, M as MagnetLogger } from './permission.guard-B8HLjHP2.js';
5
+ export { A as AuthStrategyFactory, H as Hook, I as InjectPluginOptions, b as PermissionGuard, P as Plugin, a as PluginDecoratorOptions } from './permission.guard-B8HLjHP2.js';
6
6
  import { DiscoveryService, MetadataScanner, Reflector } from '@nestjs/core';
7
7
  import { AsyncLocalStorage } from 'node:async_hooks';
8
+ import * as rxjs from 'rxjs';
8
9
  import { Observable } from 'rxjs';
9
10
  import * as _nestjs_terminus from '@nestjs/terminus';
10
11
  import { HealthCheckService, MemoryHealthIndicator, DiskHealthIndicator } from '@nestjs/terminus';
12
+ import * as _nestjs_passport from '@nestjs/passport';
13
+ import '@nestjs/core/injector/instance-wrapper';
11
14
 
12
15
  declare class MagnetModule {
13
16
  /**
@@ -17,7 +20,7 @@ declare class MagnetModule {
17
20
  * Environment variables are validated upfront before NestJS bootstraps.
18
21
  *
19
22
  * @param providers - Array of MagnetProvider objects from adapter/plugin `.forRoot()` calls
20
- * @param globalOptions - Cross-cutting options (JWT, admin, RBAC, i18n)
23
+ * @param globalOptions - Cross-cutting options (JWT, admin, RBAC, i18n). Admin UI serving is on by default; pass `{ admin: false }` for API-only mode.
21
24
  *
22
25
  * @example
23
26
  * ```typescript
@@ -27,7 +30,7 @@ declare class MagnetModule {
27
30
  * MagnetModule.forRoot([
28
31
  * MongooseDatabaseAdapter.forRoot(),
29
32
  * StripePlugin.forRoot({ currency: 'usd' }),
30
- * ], { admin: true })
33
+ * ])
31
34
  * ```
32
35
  */
33
36
  static forRoot(providers: MagnetProvider[], globalOptions?: MagnetGlobalOptions): DynamicModule;
@@ -35,8 +38,6 @@ declare class MagnetModule {
35
38
  }
36
39
 
37
40
  declare class DatabaseModule {
38
- /** Cached adapter instance set during register(), used by forFeature() */
39
- private static adapter;
40
41
  /**
41
42
  * Register the database module with an adapter and config.
42
43
  *
@@ -44,6 +45,15 @@ declare class DatabaseModule {
44
45
  * @param config - Resolved database config (from provider.config)
45
46
  */
46
47
  static register(adapter: DatabaseAdapter, config: DBConfig): DynamicModule;
48
+ /**
49
+ * Register schemas for database access.
50
+ *
51
+ * Nest’s compiled CJS output often `require()`s feature modules before the
52
+ * `AppModule` decorator runs `MagnetModule.forRoot()`, so `register()` may
53
+ * not have run yet. In that case we fall back to the adapter singleton
54
+ * registered by the official DB packages via
55
+ * `registerDatabaseAdapterSingletonForFeature()` (same instance as `forRoot()`).
56
+ */
47
57
  static forFeature(schemas: Type | Type[]): DynamicModule;
48
58
  }
49
59
 
@@ -265,4 +275,9 @@ declare class LoggingModule {
265
275
  declare const IS_RESTRICTED_ROUTE = "IS_RESTRICTED_ROUTE";
266
276
  declare function RestrictedRoute(): _nestjs_common.CustomDecorator<string>;
267
277
 
268
- export { DatabaseModule, DiscoveryModule, type EventContext, EventContextInterceptor, EventHandlerDiscoveryService, EventService, EventsModule, HealthController, HealthModule, IS_RESTRICTED_ROUTE, LoggingInterceptor, LoggingModule, MagnetLogger, MagnetModule, RestrictedRoute, createEventContext, eventContextStorage, getEventContext };
278
+ declare const JwtAuthGuard_base: _nestjs_passport.Type<_nestjs_passport.IAuthGuard>;
279
+ declare class JwtAuthGuard extends JwtAuthGuard_base {
280
+ canActivate(context: ExecutionContext): boolean | Promise<boolean> | rxjs.Observable<boolean>;
281
+ }
282
+
283
+ export { DatabaseModule, DiscoveryModule, type EventContext, EventContextInterceptor, EventHandlerDiscoveryService, EventService, EventsModule, HealthController, HealthModule, IS_RESTRICTED_ROUTE, JwtAuthGuard, LoggingInterceptor, LoggingModule, MagnetLogger, MagnetModule, RestrictedRoute, createEventContext, eventContextStorage, getEventContext };