@lark-apaas/fullstack-nestjs-core 1.0.3-alpha.1 → 1.0.3-alpha.11
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.cjs +295 -13574
- package/dist/index.d.cts +37 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +268 -13580
- package/package.json +13 -3
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
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,6 +31,11 @@ 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 {
|
|
@@ -39,7 +47,11 @@ declare class PlatformModule implements NestModule {
|
|
|
39
47
|
configure(consumer: MiddlewareConsumer): void;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
|
-
|
|
50
|
+
declare function configureApp(app: NestExpressApplication, options?: {
|
|
51
|
+
viewsDir?: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
|
|
54
|
+
interface DevToolsOptions$1 {
|
|
43
55
|
basePath?: string;
|
|
44
56
|
docsPath?: string;
|
|
45
57
|
openapiOut?: string;
|
|
@@ -55,6 +67,25 @@ interface DevToolsOptions {
|
|
|
55
67
|
}
|
|
56
68
|
|
|
57
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 {
|
|
58
89
|
static mount(app: INestApplication, opts?: DevToolsOptions): Promise<void>;
|
|
59
90
|
}
|
|
60
91
|
|
|
@@ -85,4 +116,8 @@ declare class UserContextMiddleware implements NestMiddleware {
|
|
|
85
116
|
use(req: Request, _res: Response, next: NextFunction): void;
|
|
86
117
|
}
|
|
87
118
|
|
|
88
|
-
|
|
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,6 +31,11 @@ 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 {
|
|
@@ -39,7 +47,11 @@ declare class PlatformModule implements NestModule {
|
|
|
39
47
|
configure(consumer: MiddlewareConsumer): void;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
|
-
|
|
50
|
+
declare function configureApp(app: NestExpressApplication, options?: {
|
|
51
|
+
viewsDir?: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
|
|
54
|
+
interface DevToolsOptions$1 {
|
|
43
55
|
basePath?: string;
|
|
44
56
|
docsPath?: string;
|
|
45
57
|
openapiOut?: string;
|
|
@@ -55,6 +67,25 @@ interface DevToolsOptions {
|
|
|
55
67
|
}
|
|
56
68
|
|
|
57
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 {
|
|
58
89
|
static mount(app: INestApplication, opts?: DevToolsOptions): Promise<void>;
|
|
59
90
|
}
|
|
60
91
|
|
|
@@ -85,4 +116,8 @@ declare class UserContextMiddleware implements NestMiddleware {
|
|
|
85
116
|
use(req: Request, _res: Response, next: NextFunction): void;
|
|
86
117
|
}
|
|
87
118
|
|
|
88
|
-
|
|
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 };
|