@lark-apaas/fullstack-nestjs-core 1.0.3-alpha.0 → 1.0.3-alpha.10

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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { NestModule, DynamicModule, MiddlewareConsumer, INestApplication, NestMiddleware } from '@nestjs/common';
2
+ import { NestExpressApplication } from '@nestjs/platform-express';
2
3
  import { Request, Response, NextFunction } from 'express';
4
+ export * from '@lark-apaas/nestjs-authnpaas';
5
+ export * from '@lark-apaas/nestjs-datapaas';
3
6
 
4
7
  declare global {
5
8
  namespace Express {
@@ -28,11 +31,15 @@ interface PlatformModuleOptions {
28
31
  * 默认: '/api/*'
29
32
  */
30
33
  csrfRoutes?: string | string[];
34
+ /**
35
+ * AuthN 能力,是否全部依赖登录
36
+ * 默认:true
37
+ */
38
+ alwaysNeedLogin?: boolean;
31
39
  }
32
40
 
33
41
  declare class PlatformModule implements NestModule {
34
- private readonly options;
35
- constructor(options: PlatformModuleOptions);
42
+ private static moduleOptions;
36
43
  static forRoot(options?: PlatformModuleOptions): DynamicModule;
37
44
  /**
38
45
  * 配置中间件
@@ -40,7 +47,11 @@ declare class PlatformModule implements NestModule {
40
47
  configure(consumer: MiddlewareConsumer): void;
41
48
  }
42
49
 
43
- interface DevToolsOptions {
50
+ declare function configureApp(app: NestExpressApplication, options?: {
51
+ viewsDir?: string;
52
+ }): Promise<void>;
53
+
54
+ interface DevToolsOptions$1 {
44
55
  basePath?: string;
45
56
  docsPath?: string;
46
57
  openapiOut?: string;
@@ -56,6 +67,25 @@ interface DevToolsOptions {
56
67
  }
57
68
 
58
69
  declare class DevToolsModule {
70
+ static mount(app: INestApplication, opts?: DevToolsOptions$1): Promise<void>;
71
+ }
72
+
73
+ interface DevToolsOptions {
74
+ basePath?: string;
75
+ docsPath?: string;
76
+ openapiOut?: string;
77
+ needSetupServer?: boolean;
78
+ needGenerateClientSdk?: boolean;
79
+ clientSdkOut?: string;
80
+ swaggerOptions?: {
81
+ title?: string;
82
+ version?: string;
83
+ customSiteTitle?: string;
84
+ customCss?: string;
85
+ };
86
+ }
87
+
88
+ declare class DevToolsV2Module {
59
89
  static mount(app: INestApplication, opts?: DevToolsOptions): Promise<void>;
60
90
  }
61
91
 
@@ -86,4 +116,8 @@ declare class UserContextMiddleware implements NestMiddleware {
86
116
  use(req: Request, _res: Response, next: NextFunction): void;
87
117
  }
88
118
 
89
- export { CsrfMiddleware, CsrfTokenMiddleware, DevToolsModule, PlatformModule, type PlatformModuleOptions, UserContextMiddleware };
119
+ declare class ViewContextMiddleware implements NestMiddleware {
120
+ use(req: Request, res: Response, next: NextFunction): void;
121
+ }
122
+
123
+ export { CsrfMiddleware, CsrfTokenMiddleware, DevToolsModule, DevToolsV2Module, PlatformModule, type PlatformModuleOptions, UserContextMiddleware, ViewContextMiddleware, configureApp };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { NestModule, DynamicModule, MiddlewareConsumer, INestApplication, NestMiddleware } from '@nestjs/common';
2
+ import { NestExpressApplication } from '@nestjs/platform-express';
2
3
  import { Request, Response, NextFunction } from 'express';
4
+ export * from '@lark-apaas/nestjs-authnpaas';
5
+ export * from '@lark-apaas/nestjs-datapaas';
3
6
 
4
7
  declare global {
5
8
  namespace Express {
@@ -28,11 +31,15 @@ interface PlatformModuleOptions {
28
31
  * 默认: '/api/*'
29
32
  */
30
33
  csrfRoutes?: string | string[];
34
+ /**
35
+ * AuthN 能力,是否全部依赖登录
36
+ * 默认:true
37
+ */
38
+ alwaysNeedLogin?: boolean;
31
39
  }
32
40
 
33
41
  declare class PlatformModule implements NestModule {
34
- private readonly options;
35
- constructor(options: PlatformModuleOptions);
42
+ private static moduleOptions;
36
43
  static forRoot(options?: PlatformModuleOptions): DynamicModule;
37
44
  /**
38
45
  * 配置中间件
@@ -40,7 +47,11 @@ declare class PlatformModule implements NestModule {
40
47
  configure(consumer: MiddlewareConsumer): void;
41
48
  }
42
49
 
43
- interface DevToolsOptions {
50
+ declare function configureApp(app: NestExpressApplication, options?: {
51
+ viewsDir?: string;
52
+ }): Promise<void>;
53
+
54
+ interface DevToolsOptions$1 {
44
55
  basePath?: string;
45
56
  docsPath?: string;
46
57
  openapiOut?: string;
@@ -56,6 +67,25 @@ interface DevToolsOptions {
56
67
  }
57
68
 
58
69
  declare class DevToolsModule {
70
+ static mount(app: INestApplication, opts?: DevToolsOptions$1): Promise<void>;
71
+ }
72
+
73
+ interface DevToolsOptions {
74
+ basePath?: string;
75
+ docsPath?: string;
76
+ openapiOut?: string;
77
+ needSetupServer?: boolean;
78
+ needGenerateClientSdk?: boolean;
79
+ clientSdkOut?: string;
80
+ swaggerOptions?: {
81
+ title?: string;
82
+ version?: string;
83
+ customSiteTitle?: string;
84
+ customCss?: string;
85
+ };
86
+ }
87
+
88
+ declare class DevToolsV2Module {
59
89
  static mount(app: INestApplication, opts?: DevToolsOptions): Promise<void>;
60
90
  }
61
91
 
@@ -86,4 +116,8 @@ declare class UserContextMiddleware implements NestMiddleware {
86
116
  use(req: Request, _res: Response, next: NextFunction): void;
87
117
  }
88
118
 
89
- export { CsrfMiddleware, CsrfTokenMiddleware, DevToolsModule, PlatformModule, type PlatformModuleOptions, UserContextMiddleware };
119
+ declare class ViewContextMiddleware implements NestMiddleware {
120
+ use(req: Request, res: Response, next: NextFunction): void;
121
+ }
122
+
123
+ export { CsrfMiddleware, CsrfTokenMiddleware, DevToolsModule, DevToolsV2Module, PlatformModule, type PlatformModuleOptions, UserContextMiddleware, ViewContextMiddleware, configureApp };