@lark-apaas/fullstack-nestjs-core 1.1.30 → 1.1.31

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
@@ -158,6 +158,22 @@ declare class ViewContextMiddleware implements NestMiddleware {
158
158
  use(req: Request, res: Response, next: NextFunction): Promise<void>;
159
159
  }
160
160
 
161
+ /**
162
+ * 创建旧路径兼容中间件(纯 Express 中间件)。
163
+ *
164
+ * 当 CLIENT_BASE_PATH 为新的 /app/:appId 格式时,
165
+ * 将旧路径请求映射到新路径:
166
+ * 预览态:/af/p/:appId/... → /app/:appId/...
167
+ * 运行态:/spark/faas/:appId/... → /app/:appId/...
168
+ *
169
+ * 处理策略:
170
+ * - API 路由(/api/)及内部路由(/__innerapi__/):URL rewrite,保留 HTTP 方法和请求体
171
+ * - 页面导航(GET 其他路径):302 重定向,更新浏览器地址栏
172
+ *
173
+ * 不依赖 req.userContext,直接通过正则从 URL 解析 appId。
174
+ */
175
+ declare function createLegacyPathRedirectMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
176
+
161
177
  /**
162
178
  * API 404 响应格式
163
179
  */
@@ -338,4 +354,4 @@ declare class PlatformHttpClientService {
338
354
  private registerInterceptorsForClient;
339
355
  }
340
356
 
341
- export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp };
357
+ export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp, createLegacyPathRedirectMiddleware };
package/dist/index.d.ts CHANGED
@@ -158,6 +158,22 @@ declare class ViewContextMiddleware implements NestMiddleware {
158
158
  use(req: Request, res: Response, next: NextFunction): Promise<void>;
159
159
  }
160
160
 
161
+ /**
162
+ * 创建旧路径兼容中间件(纯 Express 中间件)。
163
+ *
164
+ * 当 CLIENT_BASE_PATH 为新的 /app/:appId 格式时,
165
+ * 将旧路径请求映射到新路径:
166
+ * 预览态:/af/p/:appId/... → /app/:appId/...
167
+ * 运行态:/spark/faas/:appId/... → /app/:appId/...
168
+ *
169
+ * 处理策略:
170
+ * - API 路由(/api/)及内部路由(/__innerapi__/):URL rewrite,保留 HTTP 方法和请求体
171
+ * - 页面导航(GET 其他路径):302 重定向,更新浏览器地址栏
172
+ *
173
+ * 不依赖 req.userContext,直接通过正则从 URL 解析 appId。
174
+ */
175
+ declare function createLegacyPathRedirectMiddleware(): (req: Request, res: Response, next: NextFunction) => void;
176
+
161
177
  /**
162
178
  * API 404 响应格式
163
179
  */
@@ -338,4 +354,4 @@ declare class PlatformHttpClientService {
338
354
  private registerInterceptorsForClient;
339
355
  }
340
356
 
341
- export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp };
357
+ export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformHttpClientService, PlatformModule, type PlatformModuleOptions, StaticModule, UserContextMiddleware, ViewContextMiddleware, configureApp, createLegacyPathRedirectMiddleware };