@tachybase/module-backup 0.23.8
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/.turbo/turbo-build.log +12 -0
- package/README.md +118 -0
- package/README.zh-CN.md +118 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/Configuration.d.ts +2 -0
- package/dist/client/DuplicatorProvider.d.ts +5 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +1 -0
- package/dist/client/locale/index.d.ts +4 -0
- package/dist/externalVersion.js +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +44 -0
- package/dist/locale/ja-JP.d.ts +25 -0
- package/dist/locale/ja-JP.js +46 -0
- package/dist/locale/ko_KR.json +50 -0
- package/dist/locale/pt-BR.d.ts +26 -0
- package/dist/locale/pt-BR.js +48 -0
- package/dist/locale/zh-CN.json +50 -0
- package/dist/node_modules/@hapi/topo/lib/index.d.ts +60 -0
- package/dist/node_modules/@hapi/topo/lib/index.js +1 -0
- package/dist/node_modules/@hapi/topo/package.json +1 -0
- package/dist/node_modules/archiver/LICENSE +22 -0
- package/dist/node_modules/archiver/index.js +68 -0
- package/dist/node_modules/archiver/lib/core.js +974 -0
- package/dist/node_modules/archiver/lib/error.js +40 -0
- package/dist/node_modules/archiver/lib/plugins/json.js +110 -0
- package/dist/node_modules/archiver/lib/plugins/tar.js +167 -0
- package/dist/node_modules/archiver/lib/plugins/zip.js +120 -0
- package/dist/node_modules/archiver/package.json +1 -0
- package/dist/node_modules/decompress/index.js +16 -0
- package/dist/node_modules/decompress/license +9 -0
- package/dist/node_modules/decompress/package.json +1 -0
- package/dist/node_modules/mkdirp/LICENSE +21 -0
- package/dist/node_modules/mkdirp/bin/cmd.js +68 -0
- package/dist/node_modules/mkdirp/index.js +1 -0
- package/dist/node_modules/mkdirp/lib/find-made.js +29 -0
- package/dist/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
- package/dist/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
- package/dist/node_modules/mkdirp/lib/opts-arg.js +23 -0
- package/dist/node_modules/mkdirp/lib/path-arg.js +29 -0
- package/dist/node_modules/mkdirp/lib/use-native.js +10 -0
- package/dist/node_modules/mkdirp/package.json +1 -0
- package/dist/node_modules/mkdirp/readme.markdown +266 -0
- package/dist/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/semver/bin/semver.js +188 -0
- package/dist/node_modules/semver/classes/comparator.js +141 -0
- package/dist/node_modules/semver/classes/index.js +5 -0
- package/dist/node_modules/semver/classes/range.js +554 -0
- package/dist/node_modules/semver/classes/semver.js +302 -0
- package/dist/node_modules/semver/functions/clean.js +6 -0
- package/dist/node_modules/semver/functions/cmp.js +52 -0
- package/dist/node_modules/semver/functions/coerce.js +60 -0
- package/dist/node_modules/semver/functions/compare-build.js +7 -0
- package/dist/node_modules/semver/functions/compare-loose.js +3 -0
- package/dist/node_modules/semver/functions/compare.js +5 -0
- package/dist/node_modules/semver/functions/diff.js +65 -0
- package/dist/node_modules/semver/functions/eq.js +3 -0
- package/dist/node_modules/semver/functions/gt.js +3 -0
- package/dist/node_modules/semver/functions/gte.js +3 -0
- package/dist/node_modules/semver/functions/inc.js +19 -0
- package/dist/node_modules/semver/functions/lt.js +3 -0
- package/dist/node_modules/semver/functions/lte.js +3 -0
- package/dist/node_modules/semver/functions/major.js +3 -0
- package/dist/node_modules/semver/functions/minor.js +3 -0
- package/dist/node_modules/semver/functions/neq.js +3 -0
- package/dist/node_modules/semver/functions/parse.js +16 -0
- package/dist/node_modules/semver/functions/patch.js +3 -0
- package/dist/node_modules/semver/functions/prerelease.js +6 -0
- package/dist/node_modules/semver/functions/rcompare.js +3 -0
- package/dist/node_modules/semver/functions/rsort.js +3 -0
- package/dist/node_modules/semver/functions/satisfies.js +10 -0
- package/dist/node_modules/semver/functions/sort.js +3 -0
- package/dist/node_modules/semver/functions/valid.js +6 -0
- package/dist/node_modules/semver/index.js +1 -0
- package/dist/node_modules/semver/internal/constants.js +35 -0
- package/dist/node_modules/semver/internal/debug.js +9 -0
- package/dist/node_modules/semver/internal/identifiers.js +23 -0
- package/dist/node_modules/semver/internal/lrucache.js +40 -0
- package/dist/node_modules/semver/internal/parse-options.js +15 -0
- package/dist/node_modules/semver/internal/re.js +217 -0
- package/dist/node_modules/semver/package.json +1 -0
- package/dist/node_modules/semver/preload.js +2 -0
- package/dist/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/semver/ranges/gtr.js +4 -0
- package/dist/node_modules/semver/ranges/intersects.js +7 -0
- package/dist/node_modules/semver/ranges/ltr.js +4 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/dist/node_modules/semver/ranges/min-version.js +61 -0
- package/dist/node_modules/semver/ranges/outside.js +80 -0
- package/dist/node_modules/semver/ranges/simplify.js +47 -0
- package/dist/node_modules/semver/ranges/subset.js +247 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +8 -0
- package/dist/node_modules/semver/ranges/valid.js +11 -0
- package/dist/server/app-migrator.d.ts +16 -0
- package/dist/server/app-migrator.js +61 -0
- package/dist/server/collection-group-manager.d.ts +4 -0
- package/dist/server/collection-group-manager.js +29 -0
- package/dist/server/commands/restore-command.d.ts +2 -0
- package/dist/server/commands/restore-command.js +67 -0
- package/dist/server/dumper.d.ts +71 -0
- package/dist/server/dumper.js +421 -0
- package/dist/server/errors/restore-check-error.d.ts +3 -0
- package/dist/server/errors/restore-check-error.js +32 -0
- package/dist/server/field-value-writer.d.ts +9 -0
- package/dist/server/field-value-writer.js +99 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/locale/zh-CN.d.ts +9 -0
- package/dist/server/locale/zh-CN.js +30 -0
- package/dist/server/resourcers/backup-files.d.ts +25 -0
- package/dist/server/resourcers/backup-files.js +206 -0
- package/dist/server/restorer.d.ts +35 -0
- package/dist/server/restorer.js +320 -0
- package/dist/server/server.d.ts +8 -0
- package/dist/server/server.js +52 -0
- package/dist/server/utils.d.ts +5 -0
- package/dist/server/utils.js +78 -0
- package/dist/swagger/index.d.ts +392 -0
- package/dist/swagger/index.js +447 -0
- package/package.json +48 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archiver Core
|
|
3
|
+
*
|
|
4
|
+
* @ignore
|
|
5
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
6
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var util = require('util');
|
|
10
|
+
|
|
11
|
+
const ERROR_CODES = {
|
|
12
|
+
'ABORTED': 'archive was aborted',
|
|
13
|
+
'DIRECTORYDIRPATHREQUIRED': 'diretory dirpath argument must be a non-empty string value',
|
|
14
|
+
'DIRECTORYFUNCTIONINVALIDDATA': 'invalid data returned by directory custom data function',
|
|
15
|
+
'ENTRYNAMEREQUIRED': 'entry name must be a non-empty string value',
|
|
16
|
+
'FILEFILEPATHREQUIRED': 'file filepath argument must be a non-empty string value',
|
|
17
|
+
'FINALIZING': 'archive already finalizing',
|
|
18
|
+
'QUEUECLOSED': 'queue closed',
|
|
19
|
+
'NOENDMETHOD': 'no suitable finalize/end method defined by module',
|
|
20
|
+
'DIRECTORYNOTSUPPORTED': 'support for directory entries not defined by module',
|
|
21
|
+
'FORMATSET': 'archive format already set',
|
|
22
|
+
'INPUTSTEAMBUFFERREQUIRED': 'input source must be valid Stream or Buffer instance',
|
|
23
|
+
'MODULESET': 'module already set',
|
|
24
|
+
'SYMLINKNOTSUPPORTED': 'support for symlink entries not defined by module',
|
|
25
|
+
'SYMLINKFILEPATHREQUIRED': 'symlink filepath argument must be a non-empty string value',
|
|
26
|
+
'SYMLINKTARGETREQUIRED': 'symlink target argument must be a non-empty string value',
|
|
27
|
+
'ENTRYNOTSUPPORTED': 'entry not supported'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function ArchiverError(code, data) {
|
|
31
|
+
Error.captureStackTrace(this, this.constructor);
|
|
32
|
+
//this.name = this.constructor.name;
|
|
33
|
+
this.message = ERROR_CODES[code] || code;
|
|
34
|
+
this.code = code;
|
|
35
|
+
this.data = data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
util.inherits(ArchiverError, Error);
|
|
39
|
+
|
|
40
|
+
exports = module.exports = ArchiverError;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Format Plugin
|
|
3
|
+
*
|
|
4
|
+
* @module plugins/json
|
|
5
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
6
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
7
|
+
*/
|
|
8
|
+
var inherits = require('util').inherits;
|
|
9
|
+
var Transform = require('readable-stream').Transform;
|
|
10
|
+
|
|
11
|
+
var crc32 = require('buffer-crc32');
|
|
12
|
+
var util = require('archiver-utils');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @constructor
|
|
16
|
+
* @param {(JsonOptions|TransformOptions)} options
|
|
17
|
+
*/
|
|
18
|
+
var Json = function(options) {
|
|
19
|
+
if (!(this instanceof Json)) {
|
|
20
|
+
return new Json(options);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
options = this.options = util.defaults(options, {});
|
|
24
|
+
|
|
25
|
+
Transform.call(this, options);
|
|
26
|
+
|
|
27
|
+
this.supports = {
|
|
28
|
+
directory: true,
|
|
29
|
+
symlink: true
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
this.files = [];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
inherits(Json, Transform);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* [_transform description]
|
|
39
|
+
*
|
|
40
|
+
* @private
|
|
41
|
+
* @param {Buffer} chunk
|
|
42
|
+
* @param {String} encoding
|
|
43
|
+
* @param {Function} callback
|
|
44
|
+
* @return void
|
|
45
|
+
*/
|
|
46
|
+
Json.prototype._transform = function(chunk, encoding, callback) {
|
|
47
|
+
callback(null, chunk);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* [_writeStringified description]
|
|
52
|
+
*
|
|
53
|
+
* @private
|
|
54
|
+
* @return void
|
|
55
|
+
*/
|
|
56
|
+
Json.prototype._writeStringified = function() {
|
|
57
|
+
var fileString = JSON.stringify(this.files);
|
|
58
|
+
this.write(fileString);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* [append description]
|
|
63
|
+
*
|
|
64
|
+
* @param {(Buffer|Stream)} source
|
|
65
|
+
* @param {EntryData} data
|
|
66
|
+
* @param {Function} callback
|
|
67
|
+
* @return void
|
|
68
|
+
*/
|
|
69
|
+
Json.prototype.append = function(source, data, callback) {
|
|
70
|
+
var self = this;
|
|
71
|
+
|
|
72
|
+
data.crc32 = 0;
|
|
73
|
+
|
|
74
|
+
function onend(err, sourceBuffer) {
|
|
75
|
+
if (err) {
|
|
76
|
+
callback(err);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
data.size = sourceBuffer.length || 0;
|
|
81
|
+
data.crc32 = crc32.unsigned(sourceBuffer);
|
|
82
|
+
|
|
83
|
+
self.files.push(data);
|
|
84
|
+
|
|
85
|
+
callback(null, data);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (data.sourceType === 'buffer') {
|
|
89
|
+
onend(null, source);
|
|
90
|
+
} else if (data.sourceType === 'stream') {
|
|
91
|
+
util.collectStream(source, onend);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* [finalize description]
|
|
97
|
+
*
|
|
98
|
+
* @return void
|
|
99
|
+
*/
|
|
100
|
+
Json.prototype.finalize = function() {
|
|
101
|
+
this._writeStringified();
|
|
102
|
+
this.end();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
module.exports = Json;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @typedef {Object} JsonOptions
|
|
109
|
+
* @global
|
|
110
|
+
*/
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TAR Format Plugin
|
|
3
|
+
*
|
|
4
|
+
* @module plugins/tar
|
|
5
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
6
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
7
|
+
*/
|
|
8
|
+
var zlib = require('zlib');
|
|
9
|
+
|
|
10
|
+
var engine = require('tar-stream');
|
|
11
|
+
var util = require('archiver-utils');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {TarOptions} options
|
|
16
|
+
*/
|
|
17
|
+
var Tar = function(options) {
|
|
18
|
+
if (!(this instanceof Tar)) {
|
|
19
|
+
return new Tar(options);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
options = this.options = util.defaults(options, {
|
|
23
|
+
gzip: false
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
if (typeof options.gzipOptions !== 'object') {
|
|
27
|
+
options.gzipOptions = {};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
this.supports = {
|
|
31
|
+
directory: true,
|
|
32
|
+
symlink: true
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
this.engine = engine.pack(options);
|
|
36
|
+
this.compressor = false;
|
|
37
|
+
|
|
38
|
+
if (options.gzip) {
|
|
39
|
+
this.compressor = zlib.createGzip(options.gzipOptions);
|
|
40
|
+
this.compressor.on('error', this._onCompressorError.bind(this));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* [_onCompressorError description]
|
|
46
|
+
*
|
|
47
|
+
* @private
|
|
48
|
+
* @param {Error} err
|
|
49
|
+
* @return void
|
|
50
|
+
*/
|
|
51
|
+
Tar.prototype._onCompressorError = function(err) {
|
|
52
|
+
this.engine.emit('error', err);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* [append description]
|
|
57
|
+
*
|
|
58
|
+
* @param {(Buffer|Stream)} source
|
|
59
|
+
* @param {TarEntryData} data
|
|
60
|
+
* @param {Function} callback
|
|
61
|
+
* @return void
|
|
62
|
+
*/
|
|
63
|
+
Tar.prototype.append = function(source, data, callback) {
|
|
64
|
+
var self = this;
|
|
65
|
+
|
|
66
|
+
data.mtime = data.date;
|
|
67
|
+
|
|
68
|
+
function append(err, sourceBuffer) {
|
|
69
|
+
if (err) {
|
|
70
|
+
callback(err);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
self.engine.entry(data, sourceBuffer, function(err) {
|
|
75
|
+
callback(err, data);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (data.sourceType === 'buffer') {
|
|
80
|
+
append(null, source);
|
|
81
|
+
} else if (data.sourceType === 'stream' && data.stats) {
|
|
82
|
+
data.size = data.stats.size;
|
|
83
|
+
|
|
84
|
+
var entry = self.engine.entry(data, function(err) {
|
|
85
|
+
callback(err, data);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
source.pipe(entry);
|
|
89
|
+
} else if (data.sourceType === 'stream') {
|
|
90
|
+
util.collectStream(source, append);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* [finalize description]
|
|
96
|
+
*
|
|
97
|
+
* @return void
|
|
98
|
+
*/
|
|
99
|
+
Tar.prototype.finalize = function() {
|
|
100
|
+
this.engine.finalize();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* [on description]
|
|
105
|
+
*
|
|
106
|
+
* @return this.engine
|
|
107
|
+
*/
|
|
108
|
+
Tar.prototype.on = function() {
|
|
109
|
+
return this.engine.on.apply(this.engine, arguments);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* [pipe description]
|
|
114
|
+
*
|
|
115
|
+
* @param {String} destination
|
|
116
|
+
* @param {Object} options
|
|
117
|
+
* @return this.engine
|
|
118
|
+
*/
|
|
119
|
+
Tar.prototype.pipe = function(destination, options) {
|
|
120
|
+
if (this.compressor) {
|
|
121
|
+
return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options);
|
|
122
|
+
} else {
|
|
123
|
+
return this.engine.pipe.apply(this.engine, arguments);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* [unpipe description]
|
|
129
|
+
*
|
|
130
|
+
* @return this.engine
|
|
131
|
+
*/
|
|
132
|
+
Tar.prototype.unpipe = function() {
|
|
133
|
+
if (this.compressor) {
|
|
134
|
+
return this.compressor.unpipe.apply(this.compressor, arguments);
|
|
135
|
+
} else {
|
|
136
|
+
return this.engine.unpipe.apply(this.engine, arguments);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
module.exports = Tar;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @typedef {Object} TarOptions
|
|
144
|
+
* @global
|
|
145
|
+
* @property {Boolean} [gzip=false] Compress the tar archive using gzip.
|
|
146
|
+
* @property {Object} [gzipOptions] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
|
147
|
+
* to control compression.
|
|
148
|
+
* @property {*} [*] See [tar-stream]{@link https://github.com/mafintosh/tar-stream} documentation for additional properties.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @typedef {Object} TarEntryData
|
|
153
|
+
* @global
|
|
154
|
+
* @property {String} name Sets the entry name including internal path.
|
|
155
|
+
* @property {(String|Date)} [date=NOW()] Sets the entry date.
|
|
156
|
+
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
|
|
157
|
+
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
|
|
158
|
+
* when working with methods like `directory` or `glob`.
|
|
159
|
+
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
|
|
160
|
+
* for reduction of fs stat calls when stat data is already known.
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* TarStream Module
|
|
165
|
+
* @external TarStream
|
|
166
|
+
* @see {@link https://github.com/mafintosh/tar-stream}
|
|
167
|
+
*/
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZIP Format Plugin
|
|
3
|
+
*
|
|
4
|
+
* @module plugins/zip
|
|
5
|
+
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|
6
|
+
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|
7
|
+
*/
|
|
8
|
+
var engine = require('zip-stream');
|
|
9
|
+
var util = require('archiver-utils');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @constructor
|
|
13
|
+
* @param {ZipOptions} [options]
|
|
14
|
+
* @param {String} [options.comment] Sets the zip archive comment.
|
|
15
|
+
* @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
|
|
16
|
+
* @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
|
|
17
|
+
* @param {Boolean} [options.namePrependSlash=false] Prepends a forward slash to archive file paths.
|
|
18
|
+
* @param {Boolean} [options.store=false] Sets the compression method to STORE.
|
|
19
|
+
* @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
|
20
|
+
*/
|
|
21
|
+
var Zip = function(options) {
|
|
22
|
+
if (!(this instanceof Zip)) {
|
|
23
|
+
return new Zip(options);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
options = this.options = util.defaults(options, {
|
|
27
|
+
comment: '',
|
|
28
|
+
forceUTC: false,
|
|
29
|
+
namePrependSlash: false,
|
|
30
|
+
store: false
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
this.supports = {
|
|
34
|
+
directory: true,
|
|
35
|
+
symlink: true
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
this.engine = new engine(options);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {(Buffer|Stream)} source
|
|
43
|
+
* @param {ZipEntryData} data
|
|
44
|
+
* @param {String} data.name Sets the entry name including internal path.
|
|
45
|
+
* @param {(String|Date)} [data.date=NOW()] Sets the entry date.
|
|
46
|
+
* @param {Number} [data.mode=D:0755/F:0644] Sets the entry permissions.
|
|
47
|
+
* @param {String} [data.prefix] Sets a path prefix for the entry name. Useful
|
|
48
|
+
* when working with methods like `directory` or `glob`.
|
|
49
|
+
* @param {fs.Stats} [data.stats] Sets the fs stat data for this entry allowing
|
|
50
|
+
* for reduction of fs stat calls when stat data is already known.
|
|
51
|
+
* @param {Boolean} [data.store=ZipOptions.store] Sets the compression method to STORE.
|
|
52
|
+
* @param {Function} callback
|
|
53
|
+
* @return void
|
|
54
|
+
*/
|
|
55
|
+
Zip.prototype.append = function(source, data, callback) {
|
|
56
|
+
this.engine.entry(source, data, callback);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @return void
|
|
61
|
+
*/
|
|
62
|
+
Zip.prototype.finalize = function() {
|
|
63
|
+
this.engine.finalize();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @return this.engine
|
|
68
|
+
*/
|
|
69
|
+
Zip.prototype.on = function() {
|
|
70
|
+
return this.engine.on.apply(this.engine, arguments);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @return this.engine
|
|
75
|
+
*/
|
|
76
|
+
Zip.prototype.pipe = function() {
|
|
77
|
+
return this.engine.pipe.apply(this.engine, arguments);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @return this.engine
|
|
82
|
+
*/
|
|
83
|
+
Zip.prototype.unpipe = function() {
|
|
84
|
+
return this.engine.unpipe.apply(this.engine, arguments);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
module.exports = Zip;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @typedef {Object} ZipOptions
|
|
91
|
+
* @global
|
|
92
|
+
* @property {String} [comment] Sets the zip archive comment.
|
|
93
|
+
* @property {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
|
|
94
|
+
* @property {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.
|
|
95
|
+
* @prpperty {Boolean} [namePrependSlash=false] Prepends a forward slash to archive file paths.
|
|
96
|
+
* @property {Boolean} [store=false] Sets the compression method to STORE.
|
|
97
|
+
* @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
|
|
98
|
+
* to control compression.
|
|
99
|
+
* @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for current list of properties.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @typedef {Object} ZipEntryData
|
|
104
|
+
* @global
|
|
105
|
+
* @property {String} name Sets the entry name including internal path.
|
|
106
|
+
* @property {(String|Date)} [date=NOW()] Sets the entry date.
|
|
107
|
+
* @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
|
|
108
|
+
* @property {Boolean} [namePrependSlash=ZipOptions.namePrependSlash] Prepends a forward slash to archive file paths.
|
|
109
|
+
* @property {String} [prefix] Sets a path prefix for the entry name. Useful
|
|
110
|
+
* when working with methods like `directory` or `glob`.
|
|
111
|
+
* @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
|
|
112
|
+
* for reduction of fs stat calls when stat data is already known.
|
|
113
|
+
* @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* ZipStream Module
|
|
118
|
+
* @external ZipStream
|
|
119
|
+
* @see {@link https://www.archiverjs.com/zip-stream/ZipStream.html}
|
|
120
|
+
*/
|
|
@@ -0,0 +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":"2024-12-22T16:01:08.024Z"}
|