@nocobase/plugin-backup-restore 1.9.0-beta.8 → 2.0.0-alpha.2
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/client/e4f348aa71db3614.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +5 -5
- package/dist/node_modules/@hapi/topo/lib/index.js +1 -1
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/applyToDefaults.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/applyToDefaults.js +102 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/assert.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/assert.js +30 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/assertError.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/assertError.js +18 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/bench.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/bench.js +29 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/block.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/block.js +12 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/clone.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/clone.js +174 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/contain.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/contain.js +307 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/deepEqual.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/deepEqual.js +317 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js +16 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeHtml.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeHtml.js +87 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeJson.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeJson.js +28 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeRegex.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/escapeRegex.js +11 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/flatten.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/flatten.js +20 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/ignore.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/ignore.js +6 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/index.d.ts +480 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/index.js +45 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/intersect.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/intersect.js +41 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/isPromise.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/isPromise.js +9 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/merge.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/merge.js +78 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/once.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/once.js +25 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/reach.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/reach.js +76 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/reachTemplate.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/reachTemplate.js +16 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/stringify.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/stringify.js +14 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/types.js +57 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/utils.js +9 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/wait.d.ts +3 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/lib/wait.js +37 -0
- package/dist/node_modules/@hapi/topo/node_modules/@hapi/hoek/package.json +60 -0
- 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/package.json +8 -8
- package/dist/client/74239cd02b87724f.js +0 -10
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const internals = {};
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
module.exports = function (array1, array2, options = {}) {
|
|
7
|
+
|
|
8
|
+
if (!array1 ||
|
|
9
|
+
!array2) {
|
|
10
|
+
|
|
11
|
+
return (options.first ? null : []);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const common = [];
|
|
15
|
+
const hash = (Array.isArray(array1) ? new Set(array1) : array1);
|
|
16
|
+
const found = new Set();
|
|
17
|
+
for (const value of array2) {
|
|
18
|
+
if (internals.has(hash, value) &&
|
|
19
|
+
!found.has(value)) {
|
|
20
|
+
|
|
21
|
+
if (options.first) {
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
common.push(value);
|
|
26
|
+
found.add(value);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (options.first ? null : common);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
internals.has = function (ref, key) {
|
|
35
|
+
|
|
36
|
+
if (typeof ref.has === 'function') {
|
|
37
|
+
return ref.has(key);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return ref[key] !== undefined;
|
|
41
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const Assert = require('./assert');
|
|
4
|
+
const Clone = require('./clone');
|
|
5
|
+
const Utils = require('./utils');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const internals = {};
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
module.exports = internals.merge = function (target, source, options) {
|
|
12
|
+
|
|
13
|
+
Assert(target && typeof target === 'object', 'Invalid target value: must be an object');
|
|
14
|
+
Assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
|
|
15
|
+
|
|
16
|
+
if (!source) {
|
|
17
|
+
return target;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
options = Object.assign({ nullOverride: true, mergeArrays: true }, options);
|
|
21
|
+
|
|
22
|
+
if (Array.isArray(source)) {
|
|
23
|
+
Assert(Array.isArray(target), 'Cannot merge array onto an object');
|
|
24
|
+
if (!options.mergeArrays) {
|
|
25
|
+
target.length = 0; // Must not change target assignment
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
for (let i = 0; i < source.length; ++i) {
|
|
29
|
+
target.push(Clone(source[i], { symbols: options.symbols }));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return target;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const keys = Utils.keys(source, options);
|
|
36
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
37
|
+
const key = keys[i];
|
|
38
|
+
if (key === '__proto__' ||
|
|
39
|
+
!Object.prototype.propertyIsEnumerable.call(source, key)) {
|
|
40
|
+
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const value = source[key];
|
|
45
|
+
if (value &&
|
|
46
|
+
typeof value === 'object') {
|
|
47
|
+
|
|
48
|
+
if (target[key] === value) {
|
|
49
|
+
continue; // Can occur for shallow merges
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!target[key] ||
|
|
53
|
+
typeof target[key] !== 'object' ||
|
|
54
|
+
(Array.isArray(target[key]) !== Array.isArray(value)) ||
|
|
55
|
+
value instanceof Date ||
|
|
56
|
+
(Buffer && Buffer.isBuffer(value)) || // $lab:coverage:ignore$
|
|
57
|
+
value instanceof RegExp) {
|
|
58
|
+
|
|
59
|
+
target[key] = Clone(value, { symbols: options.symbols });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
internals.merge(target[key], value, options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
if (value !== null &&
|
|
67
|
+
value !== undefined) { // Explicit to preserve empty strings
|
|
68
|
+
|
|
69
|
+
target[key] = value;
|
|
70
|
+
}
|
|
71
|
+
else if (options.nullOverride) {
|
|
72
|
+
target[key] = value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return target;
|
|
78
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const internals = {
|
|
4
|
+
wrapped: Symbol('wrapped')
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = function (method) {
|
|
9
|
+
|
|
10
|
+
if (method[internals.wrapped]) {
|
|
11
|
+
return method;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let once = false;
|
|
15
|
+
const wrappedFn = function (...args) {
|
|
16
|
+
|
|
17
|
+
if (!once) {
|
|
18
|
+
once = true;
|
|
19
|
+
method(...args);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
wrappedFn[internals.wrapped] = true;
|
|
24
|
+
return wrappedFn;
|
|
25
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const Assert = require('./assert');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const internals = {};
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = function (obj, chain, options) {
|
|
10
|
+
|
|
11
|
+
if (chain === false ||
|
|
12
|
+
chain === null ||
|
|
13
|
+
chain === undefined) {
|
|
14
|
+
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
options = options || {};
|
|
19
|
+
if (typeof options === 'string') {
|
|
20
|
+
options = { separator: options };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const isChainArray = Array.isArray(chain);
|
|
24
|
+
|
|
25
|
+
Assert(!isChainArray || !options.separator, 'Separator option is not valid for array-based chain');
|
|
26
|
+
|
|
27
|
+
const path = isChainArray ? chain : chain.split(options.separator || '.');
|
|
28
|
+
let ref = obj;
|
|
29
|
+
for (let i = 0; i < path.length; ++i) {
|
|
30
|
+
let key = path[i];
|
|
31
|
+
const type = options.iterables && internals.iterables(ref);
|
|
32
|
+
|
|
33
|
+
if (Array.isArray(ref) ||
|
|
34
|
+
type === 'set') {
|
|
35
|
+
|
|
36
|
+
const number = Number(key);
|
|
37
|
+
if (Number.isInteger(number)) {
|
|
38
|
+
key = number < 0 ? ref.length + number : number;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!ref ||
|
|
43
|
+
typeof ref === 'function' && options.functions === false || // Defaults to true
|
|
44
|
+
!type && ref[key] === undefined) {
|
|
45
|
+
|
|
46
|
+
Assert(!options.strict || i + 1 === path.length, 'Missing segment', key, 'in reach path ', chain);
|
|
47
|
+
Assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
|
|
48
|
+
ref = options.default;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (!type) {
|
|
53
|
+
ref = ref[key];
|
|
54
|
+
}
|
|
55
|
+
else if (type === 'set') {
|
|
56
|
+
ref = [...ref][key];
|
|
57
|
+
}
|
|
58
|
+
else { // type === 'map'
|
|
59
|
+
ref = ref.get(key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return ref;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
internals.iterables = function (ref) {
|
|
68
|
+
|
|
69
|
+
if (ref instanceof Set) {
|
|
70
|
+
return 'set';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (ref instanceof Map) {
|
|
74
|
+
return 'map';
|
|
75
|
+
}
|
|
76
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const Reach = require('./reach');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const internals = {};
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
module.exports = function (obj, template, options) {
|
|
10
|
+
|
|
11
|
+
return template.replace(/{([^{}]+)}/g, ($0, chain) => {
|
|
12
|
+
|
|
13
|
+
const value = Reach(obj, chain, options);
|
|
14
|
+
return value ?? '';
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const internals = {};
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
exports = module.exports = {
|
|
7
|
+
array: Array.prototype,
|
|
8
|
+
buffer: Buffer && Buffer.prototype, // $lab:coverage:ignore$
|
|
9
|
+
date: Date.prototype,
|
|
10
|
+
error: Error.prototype,
|
|
11
|
+
generic: Object.prototype,
|
|
12
|
+
map: Map.prototype,
|
|
13
|
+
promise: Promise.prototype,
|
|
14
|
+
regex: RegExp.prototype,
|
|
15
|
+
set: Set.prototype,
|
|
16
|
+
url: URL.prototype,
|
|
17
|
+
weakMap: WeakMap.prototype,
|
|
18
|
+
weakSet: WeakSet.prototype
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
internals.typeMap = new Map([
|
|
23
|
+
['[object Error]', exports.error],
|
|
24
|
+
['[object Map]', exports.map],
|
|
25
|
+
['[object Promise]', exports.promise],
|
|
26
|
+
['[object Set]', exports.set],
|
|
27
|
+
['[object URL]', exports.url],
|
|
28
|
+
['[object WeakMap]', exports.weakMap],
|
|
29
|
+
['[object WeakSet]', exports.weakSet]
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.getInternalProto = function (obj) {
|
|
34
|
+
|
|
35
|
+
if (Array.isArray(obj)) {
|
|
36
|
+
return exports.array;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (Buffer && obj instanceof Buffer) { // $lab:coverage:ignore$
|
|
40
|
+
return exports.buffer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (obj instanceof Date) {
|
|
44
|
+
return exports.date;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (obj instanceof RegExp) {
|
|
48
|
+
return exports.regex;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (obj instanceof Error) {
|
|
52
|
+
return exports.error;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const objName = Object.prototype.toString.call(obj);
|
|
56
|
+
return internals.typeMap.get(objName) || exports.generic;
|
|
57
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const internals = {
|
|
4
|
+
maxTimer: 2 ** 31 - 1 // ~25 days
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = function (timeout, returnValue, options) {
|
|
9
|
+
|
|
10
|
+
if (typeof timeout === 'bigint') {
|
|
11
|
+
timeout = Number(timeout);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (timeout >= Number.MAX_SAFE_INTEGER) { // Thousands of years
|
|
15
|
+
timeout = Infinity;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof timeout !== 'number' && timeout !== undefined) {
|
|
19
|
+
throw new TypeError('Timeout must be a number or bigint');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return new Promise((resolve) => {
|
|
23
|
+
|
|
24
|
+
const _setTimeout = options ? options.setTimeout : setTimeout;
|
|
25
|
+
|
|
26
|
+
const activate = () => {
|
|
27
|
+
|
|
28
|
+
const time = Math.min(timeout, internals.maxTimer);
|
|
29
|
+
timeout -= time;
|
|
30
|
+
_setTimeout(() => (timeout > 0 ? activate() : resolve(returnValue)), time);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
if (timeout !== Infinity) {
|
|
34
|
+
activate();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hapi/hoek",
|
|
3
|
+
"description": "General purpose node utilities",
|
|
4
|
+
"version": "11.0.4",
|
|
5
|
+
"repository": "git://github.com/hapijs/hoek",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./lib/index.mjs",
|
|
11
|
+
"require": "./lib/index.js",
|
|
12
|
+
"types": "./lib/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./applyToDefaults": "./lib/applyToDefaults.js",
|
|
15
|
+
"./assert": "./lib/assert.js",
|
|
16
|
+
"./assertError": "./lib/assertError.js",
|
|
17
|
+
"./bench": "./lib/bench.js",
|
|
18
|
+
"./block": "./lib/block.js",
|
|
19
|
+
"./clone": "./lib/clone.js",
|
|
20
|
+
"./contain": "./lib/contain.js",
|
|
21
|
+
"./deepEqual": "./lib/deepEqual.js",
|
|
22
|
+
"./escapeHeaderAttribute": "./lib/escapeHeaderAttribute.js",
|
|
23
|
+
"./escapeHtml": "./lib/escapeHtml.js",
|
|
24
|
+
"./escapeJson": "./lib/escapeJson.js",
|
|
25
|
+
"./escapeRegex": "./lib/escapeRegex.js",
|
|
26
|
+
"./flatten": "./lib/flatten.js",
|
|
27
|
+
"./ignore": "./lib/ignore.js",
|
|
28
|
+
"./intersect": "./lib/intersect.js",
|
|
29
|
+
"./isPromise": "./lib/isPromise.js",
|
|
30
|
+
"./merge": "./lib/merge.js",
|
|
31
|
+
"./once": "./lib/once.js",
|
|
32
|
+
"./reach": "./lib/reach.js",
|
|
33
|
+
"./reachTemplate": "./lib/reachTemplate.js",
|
|
34
|
+
"./stringify": "./lib/stringify.js",
|
|
35
|
+
"./wait": "./lib/wait.js"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"utilities"
|
|
39
|
+
],
|
|
40
|
+
"files": [
|
|
41
|
+
"lib"
|
|
42
|
+
],
|
|
43
|
+
"eslintConfig": {
|
|
44
|
+
"extends": [
|
|
45
|
+
"plugin:@hapi/module"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@hapi/code": "^9.0.0",
|
|
50
|
+
"@hapi/eslint-plugin": "*",
|
|
51
|
+
"@hapi/lab": "^25.0.1",
|
|
52
|
+
"@types/node": "^17.0.30",
|
|
53
|
+
"typescript": "~4.6.4"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"test": "lab -a @hapi/code -t 100 -L -Y",
|
|
57
|
+
"test-cov-html": "lab -a @hapi/code -t 100 -L -r html -o coverage.html"
|
|
58
|
+
},
|
|
59
|
+
"license": "BSD-3-Clause"
|
|
60
|
+
}
|
|
@@ -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":"2025-09-
|
|
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":"2025-09-30T13:18:09.659Z"}
|
|
@@ -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":"2025-09-
|
|
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":"2025-09-30T13:18:07.877Z"}
|
|
@@ -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":"2025-09-
|
|
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":"2025-09-30T13:18:09.454Z"}
|
|
@@ -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":"2025-09-
|
|
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":"2025-09-30T13:18:08.188Z"}
|
|
@@ -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":"2025-09-
|
|
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":"2025-09-30T13:18:08.708Z"}
|
|
@@ -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":"2025-09-
|
|
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":"2025-09-30T13:18:09.937Z"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "应用的备份与还原(废弃)",
|
|
5
5
|
"description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
|
|
6
6
|
"description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "2.0.0-alpha.2",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/backup-restore",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"tar": "^7.4.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@nocobase/actions": "
|
|
35
|
-
"@nocobase/client": "
|
|
36
|
-
"@nocobase/database": "
|
|
37
|
-
"@nocobase/server": "
|
|
38
|
-
"@nocobase/test": "
|
|
39
|
-
"@nocobase/utils": "
|
|
34
|
+
"@nocobase/actions": "2.x",
|
|
35
|
+
"@nocobase/client": "2.x",
|
|
36
|
+
"@nocobase/database": "2.x",
|
|
37
|
+
"@nocobase/server": "2.x",
|
|
38
|
+
"@nocobase/test": "2.x",
|
|
39
|
+
"@nocobase/utils": "2.x"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"System management"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "1322f486b248bef53ed8c8f42f0a39dfd02125fd"
|
|
45
45
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_backup_restore=self.webpackChunk_nocobase_plugin_backup_restore||[]).push([["276"],{621:function(e,t,n){n.r(t),n.d(t,{BackupAndRestoreList:function(){return C}});var r=n(482),l=n(632),a=n(772),o=n(721),i=n(346),u=n(156),c=n.n(u),s=n(748);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,l,a,o){try{var i=e[a](o),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,l)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,l){var a=e.apply(t,n);function o(e){p(a,r,l,o,i,"next",e)}function i(e){p(a,r,l,o,i,"throw",e)}o(void 0)})}}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a=[],o=!0,i=!1;try{for(l=l.call(e);!(o=(n=l.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){var n,r,l,a,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){var u=[a,i];if(n)throw TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var g=o.Upload.Dragger,v=function(e){var t,n=e.collectionsData,r=(0,s.lV)().t,l=y((0,u.useState)(!1),2),i=l[0],f=l[1],p=y((0,u.useState)(n),2),m=p[0],b=p[1];(0,u.useEffect)(function(){b(n)},[n]);var g=(0,a.useAPIClient)(),v=(0,a.useCompile)(),k=(0,u.useMemo)(function(){return g.resource("backupFiles")},[g]),E=(t=d(function(){var t;return h(this,function(n){switch(n.label){case 0:if(!e.isBackup)return[3,2];return[4,k.dumpableCollections()];case 1:b(null==(t=n.sent())?void 0:t.data),f(!0),n.label=2;case 2:return f(!0),[2]}})}),function(){return t.apply(this,arguments)}),w=[{title:r("Collection"),dataIndex:"collection",key:"collection",render:function(e,t){var n=v(t.title);return t.name===n?n:c().createElement("div",null,t.name," ",c().createElement("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"}},"(",v(t.title),")"))}},{title:r("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],C=Object.keys(m||{}).map(function(e){return{key:e,label:r("".concat(e,".title")),children:c().createElement(c().Fragment,null,c().createElement(o.Alert,{style:{marginBottom:16},message:r("".concat(e,".description"))}),c().createElement(o.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:m[e],columns:w,scroll:{y:400}}))}});return c().createElement(c().Fragment,null,c().createElement("a",{onClick:E},r("Learn more")),c().createElement(o.Modal,{title:r("Backup instructions"),width:"80vw",open:i,footer:null,onOk:function(){f(!1)},onCancel:function(){f(!1)}},c().createElement(o.Tabs,{defaultActiveKey:"required",items:C})))},k=function(e){var t,n=e.ButtonComponent,r=void 0===n?o.Button:n,i=e.title,f=e.upload,p=void 0!==f&&f,m=e.fileData,b=(0,s.lV)().t,g=y((0,u.useState)(["required"]),2),k=g[0],E=g[1],C=y((0,u.useState)(!1),2),S=C[0],O=C[1],P=y((0,u.useState)(null),2),B=P[0],x=P[1],j=y((0,u.useState)(!1),2),D=j[0],A=j[1],F=(0,a.useAPIClient)(),I=(0,u.useMemo)(function(){return F.resource("backupFiles")},[F]),T=y((0,u.useState)([]),2),q=T[0],R=T[1];(0,u.useEffect)(function(){R(Object.keys((null==B?void 0:B.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:b("".concat(e,".title")),disabled:["required","skipped"].includes(e)}}))},[B]);var G=(t=d(function(){var e,t,n,r;return h(this,function(l){switch(l.label){case 0:if(O(!0),p)return[3,2];return A(!0),[4,I.get({filterByTk:m.name})];case 1:R(Object.keys((null==(r=l.sent().data)||null==(t=r.data)||null==(e=t.meta)?void 0:e.dumpableCollectionsGroupByGroup)||[]).map(function(e){return{value:e,label:b("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),x(null==r||null==(n=r.data)?void 0:n.meta),A(!1),l.label=2;case 2:return[2]}})}),function(){return t.apply(this,arguments)});return c().createElement(c().Fragment,null,c().createElement(r,{onClick:G},i),c().createElement(o.Modal,{title:b("Restore"),width:800,footer:p&&!B?null:void 0,open:S,onOk:function(){I.restore({values:{dataTypes:k,filterByTk:null==m?void 0:m.name,key:null==B?void 0:B.key}}),O(!1)},onCancel:function(){O(!1),x(null),E(["required"])}},c().createElement(o.Spin,{spinning:D},p&&!B&&c().createElement(w,{setRestoreData:x}),(!p||B)&&[c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},key:"info"},b("Select the data to be restored")," (",c().createElement(v,{collectionsData:null==B?void 0:B.dumpableCollectionsGroupByGroup}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8},key:"dataType"},c().createElement(l.FormItem,null,c().createElement(a.Checkbox.Group,{options:q,style:{flexDirection:"column"},value:k,onChange:function(e){return E(e)}})))])))},E=function(e){var t,n=e.ButtonComponent,l=void 0===n?o.Button:n,i=e.refresh,f=(0,s.lV)().t,p=y((0,u.useState)(!1),2),m=p[0],b=p[1],g=y((0,u.useState)(["required"]),2),k=g[0],E=g[1],w=(0,a.useAPIClient)(),C=y((0,u.useState)([]),2),S=C[0],O=C[1],P=(t=d(function(){return h(this,function(e){switch(e.label){case 0:return[4,w.resource("backupFiles").dumpableCollections()];case 1:return O(Object.keys(e.sent().data||[]).map(function(e){return{value:e,label:f("".concat(e,".title")),disabled:["required","skipped"].includes(e)}})),b(!0),[2]}})}),function(){return t.apply(this,arguments)});return c().createElement(c().Fragment,null,c().createElement(l,{icon:c().createElement(r.PlusOutlined,null),type:"primary",onClick:P},f("New backup")),c().createElement(o.Modal,{title:f("New backup"),width:800,open:m,onOk:function(){w.request({url:"backupFiles:create",method:"post",data:{dataTypes:k}}),b(!1),E(["required"]),setTimeout(function(){i()},500)},onCancel:function(){b(!1),E(["required"])}},c().createElement("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"}},f("Select the data to be backed up")," (",c().createElement(v,{isBackup:!0}),"):"),c().createElement("div",{style:{lineHeight:2,marginBottom:8}},c().createElement(a.Checkbox.Group,{options:S,style:{flexDirection:"column"},onChange:function(e){return E(e)},value:k}))))},w=function(e){var t,n,l=(0,s.lV)().t;return c().createElement(g,(t={multiple:!1,action:"/backupFiles:upload",onChange:function(t){t.fileList.length>1&&t.fileList.splice(0,t.fileList.length-1);var n,r,a,i=t.file.status;"done"===i?(o.message.success("".concat(t.file.name," ")+l("file uploaded successfully")),e.setRestoreData(b(m({},null==(r=t.file.response)||null==(n=r.data)?void 0:n.meta),{key:null==(a=t.file.response)?void 0:a.data.key}))):"error"===i&&o.message.error("".concat(t.file.name," ")+l("file upload failed"))},onDrop:function(e){console.log("Dropped files",e.dataTransfer.files)}},n=(0,a.useAPIClient)(),b(m({},t),{customRequest:function(e){var t=e.action,r=e.data,l=e.file,a=e.filename,o=e.headers,i=e.onError,u=e.onProgress,c=e.onSuccess,s=e.withCredentials,f=new FormData;return r&&Object.keys(r).forEach(function(e){f.append(e,r[e])}),f.append(a,l),n.axios.post(t,f,{withCredentials:s,headers:o,onUploadProgress:function(e){var t=e.total;u({percent:Math.round(e.loaded/t*100).toFixed(2)},l)}}).then(function(e){c(e.data,l)}).catch(i).finally(function(){}),{abort:function(){console.log("upload progress is aborted.")}}},onChange:function(e){var n;null==(n=t.onChange)||n.call(t,e)}})),c().createElement("p",{className:"ant-upload-drag-icon"},c().createElement(r.InboxOutlined,null)),c().createElement("p",{className:"ant-upload-text"}," ",l("Click or drag file to this area to upload")))},C=function(){var e,t,n,l=(0,s.lV)().t,f=(0,a.useAPIClient)(),p=y((0,u.useState)([]),2),m=p[0],b=p[1],g=y((0,u.useState)(!1),2),v=g[0],w=g[1],C=y((0,u.useState)(!1),2),S=(C[0],C[1]),O=o.App.useApp().modal,P=(0,u.useMemo)(function(){return f.resource("backupFiles")},[f]);(0,u.useEffect)(function(){B()},[]);var B=(e=d(function(){return h(this,function(e){switch(e.label){case 0:return w(!0),[4,P.list()];case 1:return b(e.sent().data.data),w(!1),[2]}})}),function(){return e.apply(this,arguments)}),x=(t=d(function(e){var t,n;return h(this,function(r){switch(r.label){case 0:return S(e.name),[4,f.request({url:"backupFiles:download",method:"get",params:{filterByTk:e.name},responseType:"blob"})];case 1:return t=r.sent(),S(!1),n=new Blob([t.data]),(0,i.saveAs)(n,e.name),[2]}})}),function(e){return t.apply(this,arguments)}),j=(n=d(function(){return h(this,function(e){switch(e.label){case 0:return[4,B()];case 1:return e.sent(),[2]}})}),function(){return n.apply(this,arguments)}),D=function(e){O.confirm({title:l("Delete record",{ns:"client"}),content:l("Are you sure you want to delete it?",{ns:"client"}),onOk:d(function(){return h(this,function(t){switch(t.label){case 0:return[4,P.destroy({filterByTk:e.name})];case 1:return t.sent(),[4,B()];case 2:return t.sent(),o.message.success(l("Deleted successfully")),[2]}})})})};return c().createElement("div",null,c().createElement(o.Card,{bordered:!1},c().createElement(o.Space,{style:{float:"right",marginBottom:16}},c().createElement(o.Button,{onClick:j,icon:c().createElement(r.ReloadOutlined,null)},l("Refresh")),c().createElement(k,{upload:!0,title:c().createElement(c().Fragment,null,c().createElement(r.UploadOutlined,null)," ",l("Restore backup from local"))}),c().createElement(E,{refresh:j})),c().createElement(o.Table,{dataSource:m,loading:v,columns:[{title:l("Backup file"),dataIndex:"name",width:400,onCell:function(e){return e.inProgress?{colSpan:4}:{}},render:function(e,t){return t.inProgress?c().createElement("div",{style:{color:"rgba(0, 0, 0, 0.88)"}},e,"(",l("Backing up"),"...)"):c().createElement("div",null,e)}},{title:l("File size"),dataIndex:"fileSize",onCell:function(e){return e.inProgress?{colSpan:0}:{}}},{title:l("Created at",{ns:"client"}),dataIndex:"createdAt",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e){return c().createElement(a.DatePicker.ReadPretty,{value:e,showTime:!0})}},{title:l("Actions",{ns:"client"}),dataIndex:"actions",onCell:function(e){return e.inProgress?{colSpan:0}:{}},render:function(e,t){return c().createElement(o.Space,{split:c().createElement(o.Divider,{type:"vertical"})},c().createElement(k,{ButtonComponent:"a",title:l("Restore"),fileData:t}),c().createElement("a",{type:"link",onClick:function(){return x(t)}},l("Download")),c().createElement("a",{onClick:function(){return D(t)}},l("Delete")))}}]})))}}}]);
|