@strapi/data-transfer 4.26.1 → 4.26.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/file/providers/source/index.d.ts.map +1 -1
- package/dist/index.js +14 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/file/providers/source/index.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAUvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAU,SAAS,EAAE,eAAe,EAAE,YAAY,EAAS,MAAM,mBAAmB,CAAC;AAejG;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,UAAU,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,WAAW,EAAE;QACX,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,YAAa,+BAA+B,4BAErF,CAAC;AAEF,cAAM,uBAAwB,YAAW,eAAe;;IACtD,IAAI,EAAE,YAAY,CAAY;IAE9B,IAAI,SAAwB;IAE5B,OAAO,EAAE,+BAA+B,CAAC;gBAM7B,OAAO,EAAE,+BAA+B;IAqBpD;;OAEG;IACG,SAAS;IA+BT,WAAW;IASX,UAAU;IAWhB,wBAAwB,IAAI,QAAQ;IAKpC,uBAAuB,IAAI,QAAQ;IAKnC,qBAAqB,IAAI,QAAQ;IAKjC,6BAA6B,IAAI,QAAQ;IAMzC,sBAAsB,IAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;CA+KvD"}
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,7 @@ const ora = require("ora");
|
|
|
28
28
|
const inquirer = require("inquirer");
|
|
29
29
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
30
30
|
function _interopNamespace(e) {
|
|
31
|
-
if (e && e.__esModule)
|
|
32
|
-
return e;
|
|
31
|
+
if (e && e.__esModule) return e;
|
|
33
32
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
34
33
|
if (e) {
|
|
35
34
|
for (const k in e) {
|
|
@@ -52,8 +51,7 @@ const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
|
|
|
52
51
|
const https__default = /* @__PURE__ */ _interopDefault(https);
|
|
53
52
|
const http__default = /* @__PURE__ */ _interopDefault(http);
|
|
54
53
|
const zip__default = /* @__PURE__ */ _interopDefault(zip);
|
|
55
|
-
const tar__default = /* @__PURE__ */ _interopDefault(tar);
|
|
56
|
-
const tar__default$1 = /* @__PURE__ */ _interopDefault(tar$1);
|
|
54
|
+
const tar__default = /* @__PURE__ */ _interopDefault(tar$1);
|
|
57
55
|
const Table__default = /* @__PURE__ */ _interopDefault(Table);
|
|
58
56
|
const strapiFactory__default = /* @__PURE__ */ _interopDefault(strapiFactory);
|
|
59
57
|
const ora__default = /* @__PURE__ */ _interopDefault(ora);
|
|
@@ -380,7 +378,6 @@ const compareSchemas = (a, b, strategy) => {
|
|
|
380
378
|
};
|
|
381
379
|
const SeverityKind = {
|
|
382
380
|
FATAL: "fatal",
|
|
383
|
-
ERROR: "error",
|
|
384
381
|
SILLY: "silly"
|
|
385
382
|
};
|
|
386
383
|
class DataTransferError extends Error {
|
|
@@ -2634,11 +2631,7 @@ const connectToWebsocket = (address, options, diagnostics) => {
|
|
|
2634
2631
|
});
|
|
2635
2632
|
server.on("message", (raw) => {
|
|
2636
2633
|
const response = JSON.parse(raw.toString());
|
|
2637
|
-
if (response.diagnostic)
|
|
2638
|
-
diagnostics?.report({
|
|
2639
|
-
...response.diagnostic
|
|
2640
|
-
});
|
|
2641
|
-
}
|
|
2634
|
+
if (response.diagnostic) ;
|
|
2642
2635
|
});
|
|
2643
2636
|
server.once("error", (err) => {
|
|
2644
2637
|
reject2(
|
|
@@ -4320,15 +4313,15 @@ class LocalFileSourceProvider {
|
|
|
4320
4313
|
stream$1.pipeline(
|
|
4321
4314
|
[
|
|
4322
4315
|
inStream,
|
|
4323
|
-
new
|
|
4316
|
+
new tar.Parser({
|
|
4324
4317
|
// find only files in the assets/uploads folder
|
|
4325
4318
|
filter(filePath, entry) {
|
|
4326
|
-
if (entry.type !== "File") {
|
|
4319
|
+
if (!("type" in entry) || entry.type !== "File") {
|
|
4327
4320
|
return false;
|
|
4328
4321
|
}
|
|
4329
4322
|
return isFilePathInDirname("assets/uploads", filePath);
|
|
4330
4323
|
},
|
|
4331
|
-
async
|
|
4324
|
+
async onReadEntry(entry) {
|
|
4332
4325
|
const { path: filePath, size = 0 } = entry;
|
|
4333
4326
|
const normalizedPath = unknownPathToPosix(filePath);
|
|
4334
4327
|
const file2 = path__default.default.basename(normalizedPath);
|
|
@@ -4378,14 +4371,14 @@ class LocalFileSourceProvider {
|
|
|
4378
4371
|
stream$1.pipeline(
|
|
4379
4372
|
[
|
|
4380
4373
|
inStream,
|
|
4381
|
-
new
|
|
4374
|
+
new tar.Parser({
|
|
4382
4375
|
filter(filePath, entry) {
|
|
4383
|
-
if (entry.type !== "File") {
|
|
4376
|
+
if (!("type" in entry) || entry.type !== "File") {
|
|
4384
4377
|
return false;
|
|
4385
4378
|
}
|
|
4386
4379
|
return isFilePathInDirname(directory, filePath);
|
|
4387
4380
|
},
|
|
4388
|
-
async
|
|
4381
|
+
async onReadEntry(entry) {
|
|
4389
4382
|
const transforms = [
|
|
4390
4383
|
// JSONL parser to read the data chunks one by one (line by line)
|
|
4391
4384
|
Parser.parser({
|
|
@@ -4427,17 +4420,17 @@ class LocalFileSourceProvider {
|
|
|
4427
4420
|
[
|
|
4428
4421
|
fileStream,
|
|
4429
4422
|
// Custom backup archive parsing
|
|
4430
|
-
new
|
|
4423
|
+
new tar.Parser({
|
|
4431
4424
|
/**
|
|
4432
4425
|
* Filter the parsed entries to only keep the one that matches the given filepath
|
|
4433
4426
|
*/
|
|
4434
4427
|
filter(entryPath, entry) {
|
|
4435
|
-
if (entry.type !== "File") {
|
|
4428
|
+
if (!("type" in entry) || entry.type !== "File") {
|
|
4436
4429
|
return false;
|
|
4437
4430
|
}
|
|
4438
4431
|
return isPathEquivalent(entryPath, filePath);
|
|
4439
4432
|
},
|
|
4440
|
-
async
|
|
4433
|
+
async onReadEntry(entry) {
|
|
4441
4434
|
const content = await entry.collect();
|
|
4442
4435
|
try {
|
|
4443
4436
|
const parsedContent = JSON.parse(Buffer.concat(content).toString());
|
|
@@ -4556,7 +4549,7 @@ class LocalFileDestinationProvider {
|
|
|
4556
4549
|
if (encryption.enabled && !encryption.key) {
|
|
4557
4550
|
throw new Error("Can't encrypt without a key");
|
|
4558
4551
|
}
|
|
4559
|
-
this.#archive.stream = tar__default
|
|
4552
|
+
this.#archive.stream = tar__default.default.pack();
|
|
4560
4553
|
const outStream = fse.createWriteStream(this.#archivePath);
|
|
4561
4554
|
outStream.on("error", (err) => {
|
|
4562
4555
|
if (err.code === "ENOSPC") {
|
|
@@ -4824,8 +4817,7 @@ const promptEncryptionKey = async (thisCommand) => {
|
|
|
4824
4817
|
message: "Please enter an encryption key",
|
|
4825
4818
|
name: "key",
|
|
4826
4819
|
validate(key) {
|
|
4827
|
-
if (key.length > 0)
|
|
4828
|
-
return true;
|
|
4820
|
+
if (key.length > 0) return true;
|
|
4829
4821
|
return "Key must be present when using the encrypt option";
|
|
4830
4822
|
}
|
|
4831
4823
|
}
|