@lark-apaas/fullstack-nestjs-core 1.1.34-alpha.2 → 1.1.34-alpha.21

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,10 +1,10 @@
1
- import { NestModule, DynamicModule, MiddlewareConsumer, NestMiddleware } from '@nestjs/common';
1
+ import { NestModule, DynamicModule, MiddlewareConsumer, OnModuleInit, NestMiddleware } from '@nestjs/common';
2
2
  import { HttpClientConfig, PlatformPluginOptions, HttpClient } from '@lark-apaas/http-client';
3
3
  import { NestExpressApplication } from '@nestjs/platform-express';
4
- export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options } from '@lark-apaas/nestjs-openapi-devtools';
5
- import { Request, Response, NextFunction } from 'express';
6
4
  import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
7
5
  export { AutoTrace } from '@lark-apaas/nestjs-common';
6
+ export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options } from '@lark-apaas/nestjs-openapi-devtools';
7
+ import { Request, Response, NextFunction } from 'express';
8
8
  import * as _lark_apaas_file_service from '@lark-apaas/file-service';
9
9
  import { FileBody, UploadOptions, FileDownloadBuilder, SearchOptions } from '@lark-apaas/file-service';
10
10
  export * from '@lark-apaas/file-service';
@@ -13,7 +13,7 @@ export * from '@lark-apaas/nestjs-capability';
13
13
  export * from '@lark-apaas/nestjs-datapaas';
14
14
  export * from '@lark-apaas/nestjs-observable';
15
15
  export * from '@lark-apaas/nestjs-trigger';
16
- export { CanRole } from '@lark-apaas/nestjs-authzpaas';
16
+ export { AddMembersParams, AuthorizationSDK, Can, CanRole, ChatSimpleDTO, CommonParam, CreateRoleParams, CreateRoleResponse, DepartmentDTO, DepartmentEntity, DepartmentSimpleDTO, FilterParams, ForceRoleDTO, I18nText, IPermissionResolver, ListMembersParams, ListMembersResponse, ListRolesParams, MemberMutationData, MemberType, PERMISSION_RESOLVER_TOKEN, PermissionRequirement, PresetGroupDTO, RemoveMembersParams, RoleMemberDTO, SearchChatEntity, SearchParams, SearchResponse, SearchResult, SearchUserEntity, UpdateRoleParams, UserSimpleDTO } from '@lark-apaas/nestjs-authzpaas';
17
17
 
18
18
  declare global {
19
19
  namespace Express {
@@ -123,6 +123,47 @@ declare function configureApp(app: NestExpressApplication, perms?: {
123
123
  declare class StaticModule {
124
124
  }
125
125
 
126
+ /**
127
+ * HTML 热更新模块
128
+ *
129
+ * 提供两个能力:
130
+ * 1. 冷启动时主动拉取最新 HTML 文件列表并替换本地文件(任务一)
131
+ * 2. 对外暴露 innerapi 接口,供 tce 服务主动触发热更新(任务二)
132
+ *
133
+ * 仅在生产环境加载(PlatformModule 中控制),两个能力默认都启用。
134
+ */
135
+ declare class HtmlHotUpdateModule {
136
+ }
137
+
138
+ interface HtmlHotUpdateResult {
139
+ updatedFiles: string[];
140
+ failedFiles: {
141
+ filePath: string;
142
+ reason: string;
143
+ }[];
144
+ }
145
+ declare class HtmlHotUpdateService implements OnModuleInit {
146
+ private readonly httpClient;
147
+ private readonly logger;
148
+ private readonly fileLock;
149
+ private readonly hotUpdateDir;
150
+ private readonly hotUpdateVersionsDir;
151
+ private readonly originalHtmlDir;
152
+ constructor(httpClient: PlatformHttpClient);
153
+ onModuleInit(): Promise<void>;
154
+ resolveHtmlPath(fileName: string): string;
155
+ getViewsDirs(): string[];
156
+ getActiveVersion(): string;
157
+ computeVersion(fileMap: Record<string, string>): string;
158
+ normalizeFilePath(filePath: string): string;
159
+ updateFromRemote(appID: string, commitID?: string): Promise<HtmlHotUpdateResult>;
160
+ writeHtmlFiles(fileMap: Record<string, string>): Promise<HtmlHotUpdateResult>;
161
+ private promoteVersionDirectory;
162
+ private cleanupOldVersions;
163
+ private fetchLatestHtmlFiles;
164
+ private getAppID;
165
+ }
166
+
126
167
  interface CsrfTokenOptions {
127
168
  cookieKey?: string;
128
169
  cookieMaxAge?: number;
@@ -354,4 +395,4 @@ declare class PlatformHttpClientService {
354
395
  private registerInterceptorsForClient;
355
396
  }
356
397
 
357
- export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp, createLegacyPathRedirectMiddleware };
398
+ export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, HtmlHotUpdateModule, HtmlHotUpdateService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp, createLegacyPathRedirectMiddleware };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { NestModule, DynamicModule, MiddlewareConsumer, NestMiddleware } from '@nestjs/common';
1
+ import { NestModule, DynamicModule, MiddlewareConsumer, OnModuleInit, NestMiddleware } from '@nestjs/common';
2
2
  import { HttpClientConfig, PlatformPluginOptions, HttpClient } from '@lark-apaas/http-client';
3
3
  import { NestExpressApplication } from '@nestjs/platform-express';
4
- export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options } from '@lark-apaas/nestjs-openapi-devtools';
5
- import { Request, Response, NextFunction } from 'express';
6
4
  import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
7
5
  export { AutoTrace } from '@lark-apaas/nestjs-common';
6
+ export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options } from '@lark-apaas/nestjs-openapi-devtools';
7
+ import { Request, Response, NextFunction } from 'express';
8
8
  import * as _lark_apaas_file_service from '@lark-apaas/file-service';
9
9
  import { FileBody, UploadOptions, FileDownloadBuilder, SearchOptions } from '@lark-apaas/file-service';
10
10
  export * from '@lark-apaas/file-service';
@@ -13,7 +13,7 @@ export * from '@lark-apaas/nestjs-capability';
13
13
  export * from '@lark-apaas/nestjs-datapaas';
14
14
  export * from '@lark-apaas/nestjs-observable';
15
15
  export * from '@lark-apaas/nestjs-trigger';
16
- export { CanRole } from '@lark-apaas/nestjs-authzpaas';
16
+ export { AddMembersParams, AuthorizationSDK, Can, CanRole, ChatSimpleDTO, CommonParam, CreateRoleParams, CreateRoleResponse, DepartmentDTO, DepartmentEntity, DepartmentSimpleDTO, FilterParams, ForceRoleDTO, I18nText, IPermissionResolver, ListMembersParams, ListMembersResponse, ListRolesParams, MemberMutationData, MemberType, PERMISSION_RESOLVER_TOKEN, PermissionRequirement, PresetGroupDTO, RemoveMembersParams, RoleMemberDTO, SearchChatEntity, SearchParams, SearchResponse, SearchResult, SearchUserEntity, UpdateRoleParams, UserSimpleDTO } from '@lark-apaas/nestjs-authzpaas';
17
17
 
18
18
  declare global {
19
19
  namespace Express {
@@ -123,6 +123,47 @@ declare function configureApp(app: NestExpressApplication, perms?: {
123
123
  declare class StaticModule {
124
124
  }
125
125
 
126
+ /**
127
+ * HTML 热更新模块
128
+ *
129
+ * 提供两个能力:
130
+ * 1. 冷启动时主动拉取最新 HTML 文件列表并替换本地文件(任务一)
131
+ * 2. 对外暴露 innerapi 接口,供 tce 服务主动触发热更新(任务二)
132
+ *
133
+ * 仅在生产环境加载(PlatformModule 中控制),两个能力默认都启用。
134
+ */
135
+ declare class HtmlHotUpdateModule {
136
+ }
137
+
138
+ interface HtmlHotUpdateResult {
139
+ updatedFiles: string[];
140
+ failedFiles: {
141
+ filePath: string;
142
+ reason: string;
143
+ }[];
144
+ }
145
+ declare class HtmlHotUpdateService implements OnModuleInit {
146
+ private readonly httpClient;
147
+ private readonly logger;
148
+ private readonly fileLock;
149
+ private readonly hotUpdateDir;
150
+ private readonly hotUpdateVersionsDir;
151
+ private readonly originalHtmlDir;
152
+ constructor(httpClient: PlatformHttpClient);
153
+ onModuleInit(): Promise<void>;
154
+ resolveHtmlPath(fileName: string): string;
155
+ getViewsDirs(): string[];
156
+ getActiveVersion(): string;
157
+ computeVersion(fileMap: Record<string, string>): string;
158
+ normalizeFilePath(filePath: string): string;
159
+ updateFromRemote(appID: string, commitID?: string): Promise<HtmlHotUpdateResult>;
160
+ writeHtmlFiles(fileMap: Record<string, string>): Promise<HtmlHotUpdateResult>;
161
+ private promoteVersionDirectory;
162
+ private cleanupOldVersions;
163
+ private fetchLatestHtmlFiles;
164
+ private getAppID;
165
+ }
166
+
126
167
  interface CsrfTokenOptions {
127
168
  cookieKey?: string;
128
169
  cookieMaxAge?: number;
@@ -354,4 +395,4 @@ declare class PlatformHttpClientService {
354
395
  private registerInterceptorsForClient;
355
396
  }
356
397
 
357
- export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp, createLegacyPathRedirectMiddleware };
398
+ export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, HtmlHotUpdateModule, HtmlHotUpdateService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp, createLegacyPathRedirectMiddleware };