@lark-apaas/fullstack-nestjs-core 1.1.16-alpha.6 → 1.1.16-alpha.7

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
@@ -3,8 +3,11 @@ import { HttpClientConfig, PlatformPluginOptions } from '@lark-apaas/http-client
3
3
  import { NestExpressApplication } from '@nestjs/platform-express';
4
4
  export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options } from '@lark-apaas/nestjs-openapi-devtools';
5
5
  import { Request, Response, NextFunction } from 'express';
6
- import { PlatformHttpClient } from '@lark-apaas/nestjs-common';
6
+ import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
7
7
  export { AutoTrace } from '@lark-apaas/nestjs-common';
8
+ import * as _lark_apaas_file_service from '@lark-apaas/file-service';
9
+ import { FileBody, UploadOptions, FileDownloadBuilder, SearchOptions } from '@lark-apaas/file-service';
10
+ export * from '@lark-apaas/file-service';
8
11
  export * from '@lark-apaas/nestjs-authnpaas';
9
12
  export * from '@lark-apaas/nestjs-capability';
10
13
  export * from '@lark-apaas/nestjs-datapaas';
@@ -135,4 +138,33 @@ interface ApiNotFoundResponse {
135
138
  timestamp: string;
136
139
  }
137
140
 
138
- export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, type PlatformHttpClientOptions, PlatformModule, type PlatformModuleOptions, UserContextMiddleware, ViewContextMiddleware, configureApp };
141
+ type BucketScopedFileService = Pick<FileService, 'upload' | 'download' | 'list' | 'remove' | 'createSignedUrl' | 'getFileMetadata'>;
142
+ declare class FileService {
143
+ private readonly requestContextService;
144
+ private readonly httpClient;
145
+ private readonly observable;
146
+ private readonly fileServiceCore;
147
+ private readonly nestLogger;
148
+ constructor(requestContextService: RequestContextService, httpClient: PlatformHttpClient, observable: ObservableService);
149
+ /**
150
+ * 返回一个绑定了指定 bucket 的代理对象
151
+ * 不会修改 context,避免副作用
152
+ */
153
+ from(bucket: string): BucketScopedFileService;
154
+ upload(file: FileBody, options?: UploadOptions): Promise<_lark_apaas_file_service.FileMeta>;
155
+ download(path: string): FileDownloadBuilder;
156
+ list(prefix: string, searchOptions?: SearchOptions): Promise<_lark_apaas_file_service.ListResponse>;
157
+ remove(filePaths: string[]): Promise<_lark_apaas_file_service.FileMeta[]>;
158
+ createSignedUrl(path: string, expiresIn: number): Promise<string>;
159
+ getFileMetadata(filePath: string): Promise<_lark_apaas_file_service.FileMeta | null>;
160
+ getDefaultBucket(): Promise<string>;
161
+ private getAppId;
162
+ private _upload;
163
+ private _download;
164
+ private _list;
165
+ private _remove;
166
+ private _createSignedUrl;
167
+ private _getFileMetadata;
168
+ }
169
+
170
+ export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformModule, type PlatformModuleOptions, UserContextMiddleware, ViewContextMiddleware, configureApp };
package/dist/index.d.ts CHANGED
@@ -3,8 +3,11 @@ import { HttpClientConfig, PlatformPluginOptions } from '@lark-apaas/http-client
3
3
  import { NestExpressApplication } from '@nestjs/platform-express';
4
4
  export { DevToolsModule, DevToolsOptions, DevToolsV2Module, DevToolsV2Options } from '@lark-apaas/nestjs-openapi-devtools';
5
5
  import { Request, Response, NextFunction } from 'express';
6
- import { PlatformHttpClient } from '@lark-apaas/nestjs-common';
6
+ import { PlatformHttpClient, RequestContextService, ObservableService } from '@lark-apaas/nestjs-common';
7
7
  export { AutoTrace } from '@lark-apaas/nestjs-common';
8
+ import * as _lark_apaas_file_service from '@lark-apaas/file-service';
9
+ import { FileBody, UploadOptions, FileDownloadBuilder, SearchOptions } from '@lark-apaas/file-service';
10
+ export * from '@lark-apaas/file-service';
8
11
  export * from '@lark-apaas/nestjs-authnpaas';
9
12
  export * from '@lark-apaas/nestjs-capability';
10
13
  export * from '@lark-apaas/nestjs-datapaas';
@@ -135,4 +138,33 @@ interface ApiNotFoundResponse {
135
138
  timestamp: string;
136
139
  }
137
140
 
138
- export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, type PlatformHttpClientOptions, PlatformModule, type PlatformModuleOptions, UserContextMiddleware, ViewContextMiddleware, configureApp };
141
+ type BucketScopedFileService = Pick<FileService, 'upload' | 'download' | 'list' | 'remove' | 'createSignedUrl' | 'getFileMetadata'>;
142
+ declare class FileService {
143
+ private readonly requestContextService;
144
+ private readonly httpClient;
145
+ private readonly observable;
146
+ private readonly fileServiceCore;
147
+ private readonly nestLogger;
148
+ constructor(requestContextService: RequestContextService, httpClient: PlatformHttpClient, observable: ObservableService);
149
+ /**
150
+ * 返回一个绑定了指定 bucket 的代理对象
151
+ * 不会修改 context,避免副作用
152
+ */
153
+ from(bucket: string): BucketScopedFileService;
154
+ upload(file: FileBody, options?: UploadOptions): Promise<_lark_apaas_file_service.FileMeta>;
155
+ download(path: string): FileDownloadBuilder;
156
+ list(prefix: string, searchOptions?: SearchOptions): Promise<_lark_apaas_file_service.ListResponse>;
157
+ remove(filePaths: string[]): Promise<_lark_apaas_file_service.FileMeta[]>;
158
+ createSignedUrl(path: string, expiresIn: number): Promise<string>;
159
+ getFileMetadata(filePath: string): Promise<_lark_apaas_file_service.FileMeta | null>;
160
+ getDefaultBucket(): Promise<string>;
161
+ private getAppId;
162
+ private _upload;
163
+ private _download;
164
+ private _list;
165
+ private _remove;
166
+ private _createSignedUrl;
167
+ private _getFileMetadata;
168
+ }
169
+
170
+ export { type ApiNotFoundResponse, CsrfMiddleware, CsrfTokenMiddleware, FileService, type PlatformHttpClientOptions, PlatformModule, type PlatformModuleOptions, UserContextMiddleware, ViewContextMiddleware, configureApp };