contentful-export 7.16.2 → 7.17.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/index.js CHANGED
@@ -23,7 +23,9 @@ var _lodash = _interopRequireDefault(require("lodash.startcase"));
23
23
 
24
24
  var _mkdirp = _interopRequireDefault(require("mkdirp"));
25
25
 
26
- var _moment = _interopRequireDefault(require("moment"));
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
 
@@ -163,8 +165,9 @@ function runContentfulExport(params) {
163
165
  console.log(downloadsTable.toString());
164
166
  }
165
167
 
166
- const durationHuman = options.startTime.fromNow(true);
167
- const durationSeconds = (0, _moment.default)().diff(options.startTime, 'seconds');
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) {
@@ -7,7 +7,7 @@ exports.default = parseOptions;
7
7
 
8
8
  var _path = require("path");
9
9
 
10
- var _moment = _interopRequireDefault(require("moment"));
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 = (0, _moment.default)();
69
- options.contentFile = options.contentFile || `contentful-export-${options.spaceId}-${options.environmentId}-${options.startTime.format('YYYY-MM-DDTHH-mm-SS')}.json`;
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.format('YYYY-MM-DDTHH-mm-SS')}.json`);
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.16.2",
3
+ "version": "7.17.2",
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,6 +49,7 @@
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",
@@ -56,7 +57,6 @@
56
57
  "listr-verbose-renderer": "^0.6.0",
57
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
  },
package/types.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export interface Options {
2
2
  managementToken: string;
3
3
  spaceId: string;
4
-
5
4
  contentFile?: string;
6
5
  contentOnly?: boolean;
7
6
  deliveryToken?: string;
@@ -16,7 +15,7 @@ export interface Options {
16
15
  limit?: number;
17
16
  managementApplication?: string;
18
17
  managementFeature?: string;
19
- maxAllowedLimit?: boolean;
18
+ maxAllowedLimit?: number;
20
19
  proxy?: string;
21
20
  queryEntries?: string[];
22
21
  queryAssets?: string[];