Ryu Sato 2 лет назад
Родитель
Сommit
33dc0787e4
1 измененных файлов с 13 добавлено и 2 удалено
  1. 13 2
      apps/app/src/server/service/growi-bridge.ts

+ 13 - 2
apps/app/src/server/service/growi-bridge.ts

@@ -1,3 +1,6 @@
+import {
+  Model,
+} from 'mongoose';
 import unzipStream from 'unzip-stream';
 import unzipStream from 'unzip-stream';
 
 
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
@@ -15,6 +18,14 @@ const logger = loggerFactory('growi:services:GrowiBridgeService'); // eslint-dis
  */
  */
 class GrowiBridgeService {
 class GrowiBridgeService {
 
 
+  crowi: any;
+
+  encoding: string;
+
+  metaFileName: string;
+
+  baseDir: null;
+
   constructor(crowi) {
   constructor(crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
     this.encoding = 'utf-8';
     this.encoding = 'utf-8';
@@ -49,7 +60,7 @@ class GrowiBridgeService {
    * @return {object} instance of mongoose model
    * @return {object} instance of mongoose model
    */
    */
   getModelFromCollectionName(collectionName) {
   getModelFromCollectionName(collectionName) {
-    const Model = Object.values(this.crowi.models).find((m) => {
+    const Model = Object.values(this.crowi.models).find((m: Model<any>) => {
       return m.collection != null && m.collection.name === collectionName;
       return m.collection != null && m.collection.name === collectionName;
     });
     });
 
 
@@ -86,7 +97,7 @@ class GrowiBridgeService {
    */
    */
   async parseZipFile(zipFile) {
   async parseZipFile(zipFile) {
     const fileStat = fs.statSync(zipFile);
     const fileStat = fs.statSync(zipFile);
-    const innerFileStats = [];
+    const innerFileStats: Array<{ fileName: string, collectionName: string, size: number }> = [];
     let meta = {};
     let meta = {};
 
 
     const readStream = fs.createReadStream(zipFile);
     const readStream = fs.createReadStream(zipFile);