contentful-export 7.16.0 → 7.17.0
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/README.md +1 -1
- package/dist/index.js +8 -5
- package/dist/parseOptions.js +4 -4
- package/package.json +4 -4
- package/types.d.ts +1 -1
package/README.md
CHANGED
@@ -61,7 +61,7 @@ const contentfulExport = require('contentful-export')
|
|
61
61
|
const options = {
|
62
62
|
spaceId: '<space_id>',
|
63
63
|
managementToken: '<content_management_api_key>',
|
64
|
-
queryEntries: 'content_type=<content_type_id>'
|
64
|
+
queryEntries: ['content_type=<content_type_id>']
|
65
65
|
}
|
66
66
|
|
67
67
|
contentfulExport(options)
|
package/dist/index.js
CHANGED
@@ -19,11 +19,13 @@ var _listrUpdateRenderer = _interopRequireDefault(require("listr-update-renderer
|
|
19
19
|
|
20
20
|
var _listrVerboseRenderer = _interopRequireDefault(require("listr-verbose-renderer"));
|
21
21
|
|
22
|
-
var _lodash = require("lodash");
|
22
|
+
var _lodash = _interopRequireDefault(require("lodash.startcase"));
|
23
23
|
|
24
24
|
var _mkdirp = _interopRequireDefault(require("mkdirp"));
|
25
25
|
|
26
|
-
var
|
26
|
+
var _differenceInSeconds = _interopRequireDefault(require("date-fns/differenceInSeconds"));
|
27
|
+
|
28
|
+
var _formatDistance = _interopRequireDefault(require("date-fns/formatDistance"));
|
27
29
|
|
28
30
|
var _listr2 = require("contentful-batch-libs/dist/listr");
|
29
31
|
|
@@ -144,7 +146,7 @@ function runContentfulExport(params) {
|
|
144
146
|
content: 'Exported entities'
|
145
147
|
}]);
|
146
148
|
resultTypes.forEach(type => {
|
147
|
-
resultTable.push([(0, _lodash.
|
149
|
+
resultTable.push([(0, _lodash.default)(type), ctx.data[type].length]);
|
148
150
|
});
|
149
151
|
console.log(resultTable.toString());
|
150
152
|
} else {
|
@@ -163,8 +165,9 @@ function runContentfulExport(params) {
|
|
163
165
|
console.log(downloadsTable.toString());
|
164
166
|
}
|
165
167
|
|
166
|
-
const
|
167
|
-
const
|
168
|
+
const endTime = new Date();
|
169
|
+
const durationHuman = (0, _formatDistance.default)(endTime, options.startTime);
|
170
|
+
const durationSeconds = (0, _differenceInSeconds.default)(endTime, options.startTime);
|
168
171
|
console.log(`The export took ${durationHuman} (${durationSeconds}s)`);
|
169
172
|
|
170
173
|
if (options.saveFile) {
|
package/dist/parseOptions.js
CHANGED
@@ -7,7 +7,7 @@ exports.default = parseOptions;
|
|
7
7
|
|
8
8
|
var _path = require("path");
|
9
9
|
|
10
|
-
var
|
10
|
+
var _format = _interopRequireDefault(require("date-fns/format"));
|
11
11
|
|
12
12
|
var _headers = require("./utils/headers");
|
13
13
|
|
@@ -65,12 +65,12 @@ function parseOptions(params) {
|
|
65
65
|
throw new Error('Please provide the proxy config in the following format:\nhost:port or user:password@host:port');
|
66
66
|
}
|
67
67
|
|
68
|
-
options.startTime =
|
69
|
-
options.contentFile = options.contentFile || `contentful-export-${options.spaceId}-${options.environmentId}-${options.startTime
|
68
|
+
options.startTime = new Date();
|
69
|
+
options.contentFile = options.contentFile || `contentful-export-${options.spaceId}-${options.environmentId}-${(0, _format.default)(options.startTime, "yyyy-MM-dd'T'HH-mm-ss")}.json`;
|
70
70
|
options.logFilePath = (0, _path.resolve)(options.exportDir, options.contentFile);
|
71
71
|
|
72
72
|
if (!options.errorLogFile) {
|
73
|
-
options.errorLogFile = (0, _path.resolve)(options.exportDir, `contentful-export-error-log-${options.spaceId}-${options.environmentId}-${options.startTime
|
73
|
+
options.errorLogFile = (0, _path.resolve)(options.exportDir, `contentful-export-error-log-${options.spaceId}-${options.environmentId}-${(0, _format.default)(options.startTime, "yyyy-MM-dd'T'HH-mm-ss")}.json`);
|
74
74
|
} else {
|
75
75
|
options.errorLogFile = (0, _path.resolve)(process.cwd(), options.errorLogFile);
|
76
76
|
} // Further processing
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "contentful-export",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.17.0",
|
4
4
|
"description": "this tool allows you to export a space to a JSON dump",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "types.d.ts",
|
@@ -49,14 +49,14 @@
|
|
49
49
|
"contentful": "^9.0.0",
|
50
50
|
"contentful-batch-libs": "^9.2.1",
|
51
51
|
"contentful-management": "^10.0.0",
|
52
|
+
"date-fns": "^2.28.0",
|
52
53
|
"figures": "^3.2.0",
|
53
54
|
"jsonwebtoken": "^8.5.1",
|
54
55
|
"listr": "^0.14.1",
|
55
56
|
"listr-update-renderer": "^0.5.0",
|
56
57
|
"listr-verbose-renderer": "^0.6.0",
|
57
|
-
"lodash": "^4.
|
58
|
+
"lodash.startcase": "^4.4.0",
|
58
59
|
"mkdirp": "^1.0.3",
|
59
|
-
"moment": "^2.22.2",
|
60
60
|
"node-fetch": "^2.6.7",
|
61
61
|
"yargs": "^17.1.1"
|
62
62
|
},
|
@@ -75,7 +75,7 @@
|
|
75
75
|
"eslint": "^7.2.0",
|
76
76
|
"eslint-config-standard": "^16.0.1",
|
77
77
|
"eslint-plugin-import": "^2.12.0",
|
78
|
-
"eslint-plugin-jest": "^26.
|
78
|
+
"eslint-plugin-jest": "^26.1.5",
|
79
79
|
"eslint-plugin-node": "^11.1.0",
|
80
80
|
"eslint-plugin-promise": "^6.0.0",
|
81
81
|
"eslint-plugin-standard": "^5.0.0",
|
package/types.d.ts
CHANGED
@@ -24,7 +24,7 @@ export interface Options {
|
|
24
24
|
saveFile?: boolean;
|
25
25
|
skipContent?: boolean;
|
26
26
|
skipContentModel?: boolean;
|
27
|
-
|
27
|
+
skipEditorInterfaces?: boolean;
|
28
28
|
skipRoles?: boolean;
|
29
29
|
skipWebhooks?: boolean;
|
30
30
|
useVerboseRenderer?: boolean;
|