|
1 | 1 | import { ConfigSource } from '@growi/core'; |
2 | 2 | import type { IUser } from '@growi/core/dist/interfaces'; |
| 3 | +// biome-ignore lint/style/noRestrictedImports: TODO: check effects of using custom axios |
3 | 4 | import rawAxios, { type AxiosRequestConfig } from 'axios'; |
4 | 5 | import FormData from 'form-data'; |
5 | 6 | import type { ReadStream } from 'fs'; |
6 | 7 | import { createReadStream } from 'fs'; |
7 | | -import mongoose, { Types as MongooseTypes } from 'mongoose'; |
| 8 | +import mongoose, { |
| 9 | + type HydratedDocument, |
| 10 | + Types as MongooseTypes, |
| 11 | +} from 'mongoose'; |
8 | 12 | import { basename } from 'path'; |
9 | 13 | import type { Readable } from 'stream'; |
10 | 14 |
|
11 | 15 | import { G2G_PROGRESS_STATUS } from '~/interfaces/g2g-transfer'; |
| 16 | +import type { ITransferKey } from '~/interfaces/transfer-key'; |
12 | 17 | import { GrowiArchiveImportOption } from '~/models/admin/growi-archive-import-option'; |
13 | 18 | import { ImportMode } from '~/models/admin/import-mode'; |
14 | 19 | import TransferKeyModel from '~/server/models/transfer-key'; |
@@ -422,7 +427,7 @@ export class G2GTransferPusherService implements Pusher { |
422 | 427 | for await (const attachmentBatch of attachmentsCursor.pipe(batchStream)) { |
423 | 428 | for await (const attachment of attachmentBatch) { |
424 | 429 | logger.debug(`processing attachment: ${attachment}`); |
425 | | - let fileStream; |
| 430 | + let fileStream: Readable; |
426 | 431 | try { |
427 | 432 | // get read stream of each attachment |
428 | 433 | fileStream = await fileUploadService.findDeliveryFile(attachment); |
@@ -672,7 +677,7 @@ export class G2GTransferReceiverService implements Receiver { |
672 | 677 | ); |
673 | 678 |
|
674 | 679 | // Save TransferKey document |
675 | | - let tkd; |
| 680 | + let tkd: HydratedDocument<ITransferKey>; |
676 | 681 | try { |
677 | 682 | tkd = await TransferKeyModel.create({ |
678 | 683 | _id: uuid, |
|
0 commit comments