@nocobase/plugin-backup-restore 2.1.0-alpha.17 → 2.1.0-alpha.19
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/externalVersion.js +6 -6
- package/dist/node_modules/@hapi/topo/package.json +1 -1
- package/dist/node_modules/archiver/package.json +1 -1
- package/dist/node_modules/decompress/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/moment/package.json +1 -1
- package/dist/node_modules/semver/package.json +1 -1
- package/dist/server/dumper.js +9 -9
- package/dist/server/restorer.js +4 -3
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@ant-design/icons": "5.6.1",
|
|
12
12
|
"@formily/antd-v5": "1.2.3",
|
|
13
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
13
|
+
"@nocobase/client": "2.1.0-alpha.19",
|
|
14
14
|
"antd": "5.24.2",
|
|
15
15
|
"file-saver": "2.0.5",
|
|
16
16
|
"react": "18.2.0",
|
|
17
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
18
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
19
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
17
|
+
"@nocobase/server": "2.1.0-alpha.19",
|
|
18
|
+
"@nocobase/utils": "2.1.0-alpha.19",
|
|
19
|
+
"@nocobase/database": "2.1.0-alpha.19",
|
|
20
20
|
"dayjs": "1.11.13",
|
|
21
|
-
"lodash": "4.
|
|
21
|
+
"lodash": "4.18.1",
|
|
22
22
|
"react-i18next": "11.18.6",
|
|
23
|
-
"@nocobase/actions": "2.1.0-alpha.
|
|
23
|
+
"@nocobase/actions": "2.1.0-alpha.19"
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-04-
|
|
1
|
+
{"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2026-04-19T04:11:54.602Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2026-04-19T04:11:52.608Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2026-04-19T04:11:54.380Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"fs-extra","version":"9.1.0","description":"fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.","engines":{"node":">=10"},"homepage":"https://github.com/jprichardson/node-fs-extra","repository":{"type":"git","url":"https://github.com/jprichardson/node-fs-extra"},"keywords":["fs","file","file system","copy","directory","extra","mkdirp","mkdir","mkdirs","recursive","json","read","write","extra","delete","remove","touch","create","text","output","move","promise"],"author":"JP Richardson <jprichardson@gmail.com>","license":"MIT","dependencies":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","klaw":"^2.1.1","klaw-sync":"^3.0.2","minimist":"^1.1.1","mocha":"^5.0.5","nyc":"^15.0.0","proxyquire":"^2.0.1","read-dir-files":"^0.1.1","standard":"^14.1.0"},"main":"./lib/index.js","files":["lib/","!lib/**/__tests__/"],"scripts":{"full-ci":"npm run lint && npm run coverage","coverage":"nyc -r lcovonly npm run unit","coveralls":"coveralls < coverage/lcov.info","lint":"standard","test-find":"find ./lib/**/__tests__ -name *.test.js | xargs mocha","test":"npm run lint && npm run unit","unit":"node test.js"},"_lastModified":"2026-04-19T04:11:53.037Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"moment","version":"2.29.4","description":"Parse, validate, manipulate, and display dates","homepage":"https://momentjs.com","author":"Iskren Ivov Chernev <iskren.chernev@gmail.com> (https://github.com/ichernev)","contributors":["Tim Wood <washwithcare@gmail.com> (http://timwoodcreates.com/)","Rocky Meza (http://rockymeza.com)","Matt Johnson <mj1856@hotmail.com> (http://codeofmatt.com)","Isaac Cambron <isaac@isaaccambron.com> (http://isaaccambron.com)","Andre Polykanine <andre@oire.org> (https://github.com/oire)"],"keywords":["moment","date","time","parse","format","validate","i18n","l10n","ender"],"main":"./moment.js","jsnext:main":"./dist/moment.js","typings":"./moment.d.ts","typesVersions":{">=3.1":{"*":["ts3.1-typings/*"]}},"engines":{"node":"*"},"repository":{"type":"git","url":"https://github.com/moment/moment.git"},"bugs":{"url":"https://github.com/moment/moment/issues"},"license":"MIT","devDependencies":{"benchmark":"latest","coveralls":"latest","cross-env":"^6.0.3","es6-promise":"latest","eslint":"~6","grunt":"latest","grunt-benchmark":"latest","grunt-cli":"latest","grunt-contrib-clean":"latest","grunt-contrib-concat":"latest","grunt-contrib-copy":"latest","grunt-contrib-uglify":"latest","grunt-contrib-watch":"latest","grunt-env":"latest","grunt-exec":"latest","grunt-karma":"latest","grunt-nuget":"latest","grunt-string-replace":"latest","karma":"latest","karma-chrome-launcher":"latest","karma-firefox-launcher":"latest","karma-qunit":"latest","karma-sauce-launcher":"4.1.4","load-grunt-tasks":"latest","lodash":">=4.17.19","node-qunit":"latest","nyc":"latest","prettier":"latest","qunit":"^2.10.0","rollup":"2.17.1","typescript":"^1.8.10","typescript3":"npm:typescript@^3.1.6","uglify-js":"latest"},"ender":"./ender.js","dojoBuild":"package.js","jspm":{"files":["moment.js","moment.d.ts","locale"],"map":{"moment":"./moment"},"buildConfig":{"uglify":true}},"scripts":{"ts3.1-typescript-test":"cross-env node_modules/typescript3/bin/tsc --project ts3.1-typing-tests","typescript-test":"cross-env node_modules/typescript/bin/tsc --project typing-tests","test":"grunt test","eslint":"eslint Gruntfile.js tasks src","prettier-check":"prettier --check Gruntfile.js tasks src","prettier-fmt":"prettier --write Gruntfile.js tasks src","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls"},"spm":{"main":"moment.js","output":["locale/*.js"]},"_lastModified":"2026-04-19T04:11:53.613Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"semver","version":"7.7.1","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"npm run eslint","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"semver","version":"7.7.1","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"npm run eslint","postlint":"template-oss-check","lintfix":"npm run eslint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""},"devDependencies":{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2026-04-19T04:11:54.898Z"}
|
package/dist/server/dumper.js
CHANGED
|
@@ -47,12 +47,13 @@ var import_fs_extra = __toESM(require("fs-extra"));
|
|
|
47
47
|
var import_promises = __toESM(require("fs/promises"));
|
|
48
48
|
var import_lodash = __toESM(require("lodash"));
|
|
49
49
|
var import_path = __toESM(require("path"));
|
|
50
|
+
var import_utils = require("@nocobase/utils");
|
|
50
51
|
var process = __toESM(require("process"));
|
|
51
52
|
var import_stream = __toESM(require("stream"));
|
|
52
53
|
var import_util = __toESM(require("util"));
|
|
53
54
|
var import_app_migrator = require("./app-migrator");
|
|
54
55
|
var import_field_value_writer = require("./field-value-writer");
|
|
55
|
-
var
|
|
56
|
+
var import_utils2 = require("./utils");
|
|
56
57
|
const finished = import_util.default.promisify(import_stream.default.finished);
|
|
57
58
|
class Dumper extends import_app_migrator.AppMigrator {
|
|
58
59
|
static dumpTasks = /* @__PURE__ */ new Map();
|
|
@@ -81,7 +82,7 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
81
82
|
return {
|
|
82
83
|
name: fileName,
|
|
83
84
|
createdAt: backupFileStat.ctime,
|
|
84
|
-
fileSize: (0,
|
|
85
|
+
fileSize: (0, import_utils2.humanFileSize)(backupFileStat.size),
|
|
85
86
|
status: "ok"
|
|
86
87
|
};
|
|
87
88
|
} else {
|
|
@@ -93,7 +94,7 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
static generateFileName() {
|
|
96
|
-
return `backup_${(0, import_dayjs.default)().format(`YYYYMMDD_HHmmss_${Math.floor(1e3 + Math.random() * 9e3)}`)}.${
|
|
97
|
+
return `backup_${(0, import_dayjs.default)().format(`YYYYMMDD_HHmmss_${Math.floor(1e3 + Math.random() * 9e3)}`)}.${import_utils2.DUMPED_EXTENSION}`;
|
|
97
98
|
}
|
|
98
99
|
writeSQLContent(key, data) {
|
|
99
100
|
this.sqlContent[key] = data;
|
|
@@ -141,11 +142,10 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
141
142
|
return Object.fromEntries(Object.entries(grouped).map(([key, value]) => [key, value.map((item) => item.name)]));
|
|
142
143
|
}
|
|
143
144
|
backUpStorageDir() {
|
|
144
|
-
const paths = [process.cwd(), "storage", "backups"];
|
|
145
145
|
if (this.app.name !== "main") {
|
|
146
|
-
|
|
146
|
+
return (0, import_utils.storagePathJoin)("backups", this.app.name);
|
|
147
147
|
}
|
|
148
|
-
return
|
|
148
|
+
return (0, import_utils.storagePathJoin)("backups");
|
|
149
149
|
}
|
|
150
150
|
async allBackUpFilePaths(options) {
|
|
151
151
|
const dirname = (options == null ? void 0 : options.dir) || this.backUpStorageDir();
|
|
@@ -158,7 +158,7 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
158
158
|
const filteredFiles = files.filter((file) => {
|
|
159
159
|
const baseName = import_path.default.basename(file);
|
|
160
160
|
const isLockFile = import_path.default.extname(file) === ".lock";
|
|
161
|
-
const isDumpFile = import_path.default.extname(file) === `.${
|
|
161
|
+
const isDumpFile = import_path.default.extname(file) === `.${import_utils2.DUMPED_EXTENSION}`;
|
|
162
162
|
return includeInProgress && isLockFile || isDumpFile && !lockFilesSet.has(baseName);
|
|
163
163
|
}).map(async (file) => {
|
|
164
164
|
const filePath = import_path.default.resolve(dirname, file);
|
|
@@ -309,7 +309,7 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
309
309
|
const dataFilePath = import_path.default.resolve(collectionDataDir, "data");
|
|
310
310
|
const dataStream = import_fs.default.createWriteStream(dataFilePath);
|
|
311
311
|
const rows = await app.db.sequelize.query(
|
|
312
|
-
(0,
|
|
312
|
+
(0, import_utils2.sqlAdapter)(
|
|
313
313
|
app.db,
|
|
314
314
|
`SELECT *
|
|
315
315
|
FROM ${collection.isParent() ? "ONLY" : ""} ${collection.quotedTableName()}`
|
|
@@ -392,7 +392,7 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
392
392
|
});
|
|
393
393
|
const onClose = new Promise((resolve, reject) => {
|
|
394
394
|
output.on("close", function() {
|
|
395
|
-
console.log("dumped file size: " + (0,
|
|
395
|
+
console.log("dumped file size: " + (0, import_utils2.humanFileSize)(archive.pointer(), true));
|
|
396
396
|
resolve(true);
|
|
397
397
|
});
|
|
398
398
|
output.on("end", function() {
|
package/dist/server/restorer.js
CHANGED
|
@@ -43,8 +43,9 @@ var import_decompress = __toESM(require("decompress"));
|
|
|
43
43
|
var import_fs = __toESM(require("fs"));
|
|
44
44
|
var import_promises = __toESM(require("fs/promises"));
|
|
45
45
|
var import_path = __toESM(require("path"));
|
|
46
|
+
var import_utils = require("@nocobase/utils");
|
|
46
47
|
var import_app_migrator = require("./app-migrator");
|
|
47
|
-
var
|
|
48
|
+
var import_utils2 = require("./utils");
|
|
48
49
|
var import_database = require("@nocobase/database");
|
|
49
50
|
var import_lodash = __toESM(require("lodash"));
|
|
50
51
|
var import_field_value_writer = require("./field-value-writer");
|
|
@@ -109,7 +110,7 @@ class Restorer extends import_app_migrator.AppMigrator {
|
|
|
109
110
|
if (import_path.default.isAbsolute(backUpFilePath)) {
|
|
110
111
|
this.backUpFilePath = backUpFilePath;
|
|
111
112
|
} else if (import_path.default.basename(backUpFilePath) === backUpFilePath) {
|
|
112
|
-
const dirname =
|
|
113
|
+
const dirname = (0, import_utils.storagePathJoin)("duplicator");
|
|
113
114
|
this.backUpFilePath = import_path.default.resolve(dirname, backUpFilePath);
|
|
114
115
|
} else {
|
|
115
116
|
this.backUpFilePath = import_path.default.resolve(process.cwd(), backUpFilePath);
|
|
@@ -273,7 +274,7 @@ class Restorer extends import_app_migrator.AppMigrator {
|
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
|
-
const rows = await (0,
|
|
277
|
+
const rows = await (0, import_utils2.readLines)(collectionDataPath);
|
|
277
278
|
if (rows.length == 0) {
|
|
278
279
|
app.logger.info(`${collectionName} has no data to import`);
|
|
279
280
|
this.importedCollections.push(collectionName);
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
|
|
7
7
|
"description.ru-RU": "Резервное копирование и восстановление приложений для задач репликации, миграции и обновления.",
|
|
8
8
|
"description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
|
|
9
|
-
"version": "2.1.0-alpha.
|
|
9
|
+
"version": "2.1.0-alpha.19",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/backup-restore",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"keywords": [
|
|
48
48
|
"System management"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "3d13700360eac1c0f9dbf6a5f167ed396a294a3c"
|
|
51
51
|
}
|