contentful-export 7.19.143 → 7.19.145
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 +0 -3
- package/dist/index.js +4 -4
- package/dist/parseOptions.js +3 -3
- package/example-config.json +2 -2
- package/package.json +5 -2
package/README.md
CHANGED
@@ -213,9 +213,6 @@ Pass proxy config to Axios instead of creating a custom httpsAgent
|
|
213
213
|
#### `maxAllowedLimit` [number] [default: 1000]
|
214
214
|
The number of items per page per request
|
215
215
|
|
216
|
-
#### `limit` [number]
|
217
|
-
The total number of items to return. Can be used with entries or assets. If not provided, then all entries or assets will be returned. The entries or assets will be ordered using: `sys.createdAt,sys.id`.
|
218
|
-
|
219
216
|
#### `headers` [object]
|
220
217
|
Additional headers to attach to the requests.
|
221
218
|
|
package/dist/index.js
CHANGED
@@ -13,8 +13,8 @@ var _listrUpdateRenderer = _interopRequireDefault(require("listr-update-renderer
|
|
13
13
|
var _listrVerboseRenderer = _interopRequireDefault(require("listr-verbose-renderer"));
|
14
14
|
var _lodash = _interopRequireDefault(require("lodash.startcase"));
|
15
15
|
var _mkdirp = _interopRequireDefault(require("mkdirp"));
|
16
|
-
var _differenceInSeconds =
|
17
|
-
var _formatDistance =
|
16
|
+
var _differenceInSeconds = require("date-fns/differenceInSeconds");
|
17
|
+
var _formatDistance = require("date-fns/formatDistance");
|
18
18
|
var _contentfulBatchLibs = require("contentful-batch-libs");
|
19
19
|
var _downloadAssets = _interopRequireDefault(require("./tasks/download-assets"));
|
20
20
|
var _getSpaceData = _interopRequireDefault(require("./tasks/get-space-data"));
|
@@ -148,8 +148,8 @@ function runContentfulExport(params) {
|
|
148
148
|
console.log(downloadsTable.toString());
|
149
149
|
}
|
150
150
|
const endTime = new Date();
|
151
|
-
const durationHuman = (0, _formatDistance.
|
152
|
-
const durationSeconds = (0, _differenceInSeconds.
|
151
|
+
const durationHuman = (0, _formatDistance.formatDistance)(endTime, options.startTime);
|
152
|
+
const durationSeconds = (0, _differenceInSeconds.differenceInSeconds)(endTime, options.startTime);
|
153
153
|
console.log(`The export took ${durationHuman} (${durationSeconds}s)`);
|
154
154
|
if (options.saveFile) {
|
155
155
|
console.log(`\nStored space data to json file at: ${options.logFilePath}`);
|
package/dist/parseOptions.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = parseOptions;
|
7
7
|
var _contentfulBatchLibs = require("contentful-batch-libs");
|
8
|
-
var _format =
|
8
|
+
var _format = require("date-fns/format");
|
9
9
|
var _path = require("path");
|
10
10
|
var _querystring = _interopRequireDefault(require("querystring"));
|
11
11
|
var _package = require("../package");
|
@@ -52,10 +52,10 @@ function parseOptions(params) {
|
|
52
52
|
throw new Error('Please provide the proxy config in the following format:\nhost:port or user:password@host:port');
|
53
53
|
}
|
54
54
|
options.startTime = new Date();
|
55
|
-
options.contentFile = options.contentFile || `contentful-export-${options.spaceId}-${options.environmentId}-${(0, _format.
|
55
|
+
options.contentFile = options.contentFile || `contentful-export-${options.spaceId}-${options.environmentId}-${(0, _format.format)(options.startTime, "yyyy-MM-dd'T'HH-mm-ss")}.json`;
|
56
56
|
options.logFilePath = (0, _path.resolve)(options.exportDir, options.contentFile);
|
57
57
|
if (!options.errorLogFile) {
|
58
|
-
options.errorLogFile = (0, _path.resolve)(options.exportDir, `contentful-export-error-log-${options.spaceId}-${options.environmentId}-${(0, _format.
|
58
|
+
options.errorLogFile = (0, _path.resolve)(options.exportDir, `contentful-export-error-log-${options.spaceId}-${options.environmentId}-${(0, _format.format)(options.startTime, "yyyy-MM-dd'T'HH-mm-ss")}.json`);
|
59
59
|
} else {
|
60
60
|
options.errorLogFile = (0, _path.resolve)(process.cwd(), options.errorLogFile);
|
61
61
|
}
|
package/example-config.json
CHANGED
@@ -16,7 +16,8 @@
|
|
16
16
|
"contentOnly": false,
|
17
17
|
"queryEntries": [
|
18
18
|
"content_type=<content_type_id>",
|
19
|
-
"sys.id=<entry_id>"
|
19
|
+
"sys.id=<entry_id>",
|
20
|
+
"limit=1000"
|
20
21
|
],
|
21
22
|
"queryAssets": [
|
22
23
|
"fields.title=Example"
|
@@ -26,7 +27,6 @@
|
|
26
27
|
"proxy": "https://user:password@host:port",
|
27
28
|
"rawProxy": false,
|
28
29
|
"maxAllowedLimit": 1000,
|
29
|
-
"limit": 25000,
|
30
30
|
"errorLogFile": "/path/to/error.log",
|
31
31
|
"useVerboseRenderer": false
|
32
32
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "contentful-export",
|
3
|
-
"version": "7.19.
|
3
|
+
"version": "7.19.145",
|
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,7 +49,7 @@
|
|
49
49
|
"contentful": "^10.6.9",
|
50
50
|
"contentful-batch-libs": "^9.4.1",
|
51
51
|
"contentful-management": "^11.0.1",
|
52
|
-
"date-fns": "^
|
52
|
+
"date-fns": "^3.6.0",
|
53
53
|
"figures": "^3.2.0",
|
54
54
|
"jsonwebtoken": "^9.0.0",
|
55
55
|
"listr": "^0.14.1",
|
@@ -101,6 +101,9 @@
|
|
101
101
|
}
|
102
102
|
},
|
103
103
|
"release": {
|
104
|
+
"branches": [
|
105
|
+
"main"
|
106
|
+
],
|
104
107
|
"plugins": [
|
105
108
|
[
|
106
109
|
"@semantic-release/commit-analyzer",
|