contentful-export 7.18.28 → 7.19.1
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 +6 -0
- package/dist/index.js +2 -0
- package/dist/parseOptions.js +2 -0
- package/dist/tasks/get-space-data.js +17 -3
- package/dist/usageParams.js +8 -0
- package/package.json +3 -3
package/README.md
CHANGED
@@ -178,9 +178,15 @@ Skip exporting assets and entries.
|
|
178
178
|
#### `skipRoles` [boolean] [default: false]
|
179
179
|
Skip exporting roles and permissions
|
180
180
|
|
181
|
+
#### `skipTags` [boolean] [default: false]
|
182
|
+
Skip exporting tags
|
183
|
+
|
181
184
|
#### `skipWebhooks` [boolean] [default: false]
|
182
185
|
Skip exporting webhooks
|
183
186
|
|
187
|
+
#### `stripTags` [boolean] [default: false]
|
188
|
+
Untag assets and entries
|
189
|
+
|
184
190
|
#### `contentOnly` [boolean] [default: false]
|
185
191
|
Only export entries and assets
|
186
192
|
|
package/dist/index.js
CHANGED
@@ -71,6 +71,8 @@ function runContentfulExport(params) {
|
|
71
71
|
skipContent: options.skipContent,
|
72
72
|
skipWebhooks: options.skipWebhooks,
|
73
73
|
skipRoles: options.skipRoles,
|
74
|
+
skipTags: options.skipTags,
|
75
|
+
stripTags: options.stripTags,
|
74
76
|
listrOptions,
|
75
77
|
queryEntries: options.queryEntries,
|
76
78
|
queryAssets: options.queryAssets
|
package/dist/parseOptions.js
CHANGED
@@ -26,6 +26,8 @@ function getFullSourceSpace({
|
|
26
26
|
skipWebhooks,
|
27
27
|
skipRoles,
|
28
28
|
skipEditorInterfaces,
|
29
|
+
skipTags,
|
30
|
+
stripTags,
|
29
31
|
includeDrafts,
|
30
32
|
includeArchived,
|
31
33
|
maxAllowedLimit,
|
@@ -69,7 +71,8 @@ function getFullSourceSpace({
|
|
69
71
|
}).catch(() => {
|
70
72
|
ctx.data.tags = [];
|
71
73
|
});
|
72
|
-
})
|
74
|
+
}),
|
75
|
+
skip: () => skipTags
|
73
76
|
}, {
|
74
77
|
title: 'Fetching editor interfaces data',
|
75
78
|
task: (0, _contentfulBatchLibs.wrapTask)(ctx => {
|
@@ -94,7 +97,7 @@ function getFullSourceSpace({
|
|
94
97
|
source,
|
95
98
|
method: 'getEntries',
|
96
99
|
query: queryEntries
|
97
|
-
}).then(extractItems).then(items => filterDrafts(items, includeDrafts, cdaClient)).then(items => filterArchived(items, includeArchived)).then(items => {
|
100
|
+
}).then(extractItems).then(items => filterDrafts(items, includeDrafts, cdaClient)).then(items => filterArchived(items, includeArchived)).then(items => removeTags(items, stripTags)).then(items => {
|
98
101
|
ctx.data.entries = items;
|
99
102
|
});
|
100
103
|
}),
|
@@ -109,7 +112,7 @@ function getFullSourceSpace({
|
|
109
112
|
source,
|
110
113
|
method: 'getAssets',
|
111
114
|
query: queryAssets
|
112
|
-
}).then(extractItems).then(items => filterDrafts(items, includeDrafts, cdaClient)).then(items => filterArchived(items, includeArchived)).then(items => {
|
115
|
+
}).then(extractItems).then(items => filterDrafts(items, includeDrafts, cdaClient)).then(items => filterArchived(items, includeArchived)).then(items => removeTags(items, stripTags)).then(items => {
|
113
116
|
ctx.data.assets = items;
|
114
117
|
});
|
115
118
|
}),
|
@@ -222,4 +225,15 @@ function filterDrafts(items, includeDrafts, cdaClient) {
|
|
222
225
|
function filterArchived(items, includeArchived) {
|
223
226
|
return includeArchived ? items : items.filter(item => !item.sys.archivedVersion);
|
224
227
|
}
|
228
|
+
function removeTags(items, stripTags) {
|
229
|
+
if (stripTags) {
|
230
|
+
items.forEach(item => {
|
231
|
+
var _item$metadata;
|
232
|
+
if ((_item$metadata = item.metadata) !== null && _item$metadata !== void 0 && _item$metadata.tags) {
|
233
|
+
item.metadata.tags = [];
|
234
|
+
}
|
235
|
+
});
|
236
|
+
}
|
237
|
+
return items;
|
238
|
+
}
|
225
239
|
module.exports = exports.default;
|
package/dist/usageParams.js
CHANGED
@@ -45,10 +45,18 @@ var _default = _yargs.default.version(_package.default.version || 'Version only
|
|
45
45
|
describe: 'Skip exporting roles and permissions',
|
46
46
|
type: 'boolean',
|
47
47
|
default: false
|
48
|
+
}).options('skip-tags', {
|
49
|
+
describe: 'Skip exporting tags',
|
50
|
+
type: 'boolean',
|
51
|
+
default: false
|
48
52
|
}).option('skip-webhooks', {
|
49
53
|
describe: 'Skip exporting webhooks',
|
50
54
|
type: 'boolean',
|
51
55
|
default: false
|
56
|
+
}).options('strip-tags', {
|
57
|
+
describe: 'Untag assets and entries',
|
58
|
+
type: 'boolean',
|
59
|
+
default: false
|
52
60
|
}).option('content-only', {
|
53
61
|
describe: 'only export entries and assets',
|
54
62
|
type: 'boolean',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "contentful-export",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.19.1",
|
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",
|
@@ -72,8 +72,8 @@
|
|
72
72
|
"babel-jest": "^29.0.0",
|
73
73
|
"babel-plugin-add-module-exports": "^1.0.2",
|
74
74
|
"cz-conventional-changelog": "^3.3.0",
|
75
|
-
"eslint": "^
|
76
|
-
"eslint-config-standard": "^
|
75
|
+
"eslint": "^8.27.0",
|
76
|
+
"eslint-config-standard": "^17.0.0",
|
77
77
|
"eslint-plugin-import": "^2.12.0",
|
78
78
|
"eslint-plugin-jest": "^27.0.1",
|
79
79
|
"eslint-plugin-node": "^11.1.0",
|