mizozobu 6 лет назад
Родитель
Сommit
03c2b2d196
2 измененных файлов с 7 добавлено и 6 удалено
  1. 4 4
      src/server/service/export.js
  2. 3 2
      src/server/service/import.js

+ 4 - 4
src/server/service/export.js

@@ -144,7 +144,7 @@ class ExportService {
    * export multiple collections
    *
    * @memberOf ExportService
-   * @param {number} models number of items exported
+   * @param {Array.<object>} models array of instances of mongoose model
    * @return {Array.<string>} paths to json files created
    */
   async exportMultipleCollectionsToJsons(models) {
@@ -179,8 +179,8 @@ class ExportService {
    * zip files into one zip file
    *
    * @memberOf ExportService
-   * @param {object|array<object>} configs array of object { from: "path to source file", as: "file name after unzipped" }
-   * @return {string} path to zip file
+   * @param {object|array<object>} configs object or array of object { from: "path to source file", as: "file name after unzipped" }
+   * @return {string} absolute path to the zip file
    * @see https://www.archiverjs.com/#quick-start
    */
   async zipFiles(_configs) {
@@ -257,7 +257,7 @@ class ExportService {
    * get a model from collection name
    *
    * @memberOf ExportService
-   * @param {object} collectionName collection name
+   * @param {string} collectionName collection name
    * @return {object} instance of mongoose model
    */
   getModelFromCollectionName(collectionName) {

+ 3 - 2
src/server/service/import.js

@@ -81,6 +81,7 @@ class ImportService {
    *
    * @memberOf ImportService
    * @param {object} Model instance of mongoose model
+   * @param {string} jsonFile absolute path to the jsonFile being imported
    * @param {object} overwriteParams overwrite each document with unrelated value. e.g. { creator: req.user }
    */
   async import(Model, jsonFile, overwriteParams = {}) {
@@ -143,7 +144,7 @@ class ImportService {
    * extract a zip file
    *
    * @memberOf ImportService
-   * @param {string} zipFile path to zip file
+   * @param {string} zipFile absolute path to zip file
    * @return {Array.<string>} array of absolute paths to extracted files
    */
   async unzip(zipFile) {
@@ -286,7 +287,7 @@ class ImportService {
   /**
    * validate using meta.json
    * to pass validation, all the criteria must be met
-   * - ${version of this growi} === ${version of growi that exported data}
+   *   - ${version of this growi} === ${version of growi that exported data}
    *
    * @memberOf ImportService
    * @param {object} meta meta data from meta.json