contentful-export 8.4.0 → 8.5.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 +22 -1
- package/dist/index.js +1 -0
- package/dist/parseOptions.js +2 -0
- package/dist/tasks/get-space-data.js +24 -0
- package/dist/usageParams.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ Content Delivery API.
|
|
|
186
186
|
|
|
187
187
|
#### `includeArchived` [boolean] [default: false]
|
|
188
188
|
|
|
189
|
-
Include archived entries in the exported
|
|
189
|
+
Include archived entries and assets in the exported data. This option does not include archived Releases.
|
|
190
190
|
|
|
191
191
|
#### `skipContentModel` [boolean] [default: false]
|
|
192
192
|
|
|
@@ -212,6 +212,10 @@ Skip exporting tags
|
|
|
212
212
|
|
|
213
213
|
Skip exporting webhooks
|
|
214
214
|
|
|
215
|
+
#### `skipReleases` [boolean] [default: false]
|
|
216
|
+
|
|
217
|
+
Skip exporting [Releases](https://www.contentful.com/help/releases/). See the "Releases" section below for what's exported when this is on.
|
|
218
|
+
|
|
215
219
|
#### `stripTags` [boolean] [default: false]
|
|
216
220
|
|
|
217
221
|
Untag assets and entries
|
|
@@ -339,6 +343,7 @@ This is an overview of the exported data:
|
|
|
339
343
|
"webhooks": [],
|
|
340
344
|
"roles": [],
|
|
341
345
|
"editorInterfaces": [],
|
|
346
|
+
"releases": [],
|
|
342
347
|
"designTokens": [],
|
|
343
348
|
"components": [],
|
|
344
349
|
"experienceTemplates": [],
|
|
@@ -365,6 +370,8 @@ _Note:_ Tags feature is not available for all users. If you do not have access t
|
|
|
365
370
|
|
|
366
371
|
_Note:_ `designTokens`, `components`, `experienceTemplates`, `dataAssemblies`, `experienceFragments`, and `experiences` are Experience Orchestration (ExO) entities — present by default; absent only if you explicitly set `includeExperienceOrchestration: false` — see the "Experience Orchestration (ExO) entities" section below.
|
|
367
372
|
|
|
373
|
+
_Note:_ `releases` is present by default; absent only if you explicitly set `skipReleases: true` — see the "Releases" section below. It's a separate, GA Contentful feature, not part of ExO.
|
|
374
|
+
|
|
368
375
|
## :test_tube: Experience Orchestration (ExO) entities
|
|
369
376
|
|
|
370
377
|
Experience Orchestration (ExO) is Contentful's system for composing and rendering structured page experiences. It sits above the traditional entry/content-type layer and provides six dedicated entity types — Design Tokens, Components, Experience Templates, Data Assemblies, Experience Fragments, and Experiences — that together describe how content is fetched, assembled, and laid out.
|
|
@@ -410,6 +417,20 @@ Unlike the six entity types above, variants are **not** exported as a seventh to
|
|
|
410
417
|
|
|
411
418
|
The ExO entities exported here are designed to be fed directly into [`contentful-import`](https://github.com/contentful/contentful-import), which preserves source IDs, applies dependency ordering (a topological sort for Components and Experience Fragments, since either can reference others of the same type), and upgrades entities from older, pre-rename export files automatically. See `contentful-import`'s README "Experience Orchestration (ExO) entities" section for the import-side details.
|
|
412
419
|
|
|
420
|
+
## :package: Releases
|
|
421
|
+
|
|
422
|
+
[Releases](https://www.contentful.com/help/releases/) (Timeline) is a separate, GA Contentful feature — not part of Experience Orchestration, and gated by its own organization entitlement rather than `exoM1`.
|
|
423
|
+
|
|
424
|
+
Releases export is on by default (`skipReleases: false`) — for the CLI and the module API alike. Pass `skipReleases: true` (`--skip-releases` on the CLI) to opt out.
|
|
425
|
+
|
|
426
|
+
Only releases with `sys.schemaVersion: "Release.v2"` ("Releases") are fetched. `Release.v1` ("Launch") releases are excluded by the export query itself, since [`contentful-import`](https://github.com/contentful/contentful-import) only supports `Release.v2` on the import side.
|
|
427
|
+
|
|
428
|
+
Only active Releases are exported. Archived Releases are omitted, regardless of `includeArchived`, because that option currently applies only to entries and assets.
|
|
429
|
+
|
|
430
|
+
If the source space's organization lacks the Releases entitlement, or the fetch otherwise fails, a `Skipping Releases export` warning is logged and `releases` exports as an empty array — it does not fail the export.
|
|
431
|
+
|
|
432
|
+
Round-trips into [`contentful-import`](https://github.com/contentful/contentful-import), which imports each release found in the exported data. See `contentful-import`'s README "Releases" section for the import-side details, including a real limitation worth knowing before you rely on this for repeated imports: Releases have no ID-preserving create, so re-importing the same export creates additional releases rather than updating existing ones.
|
|
433
|
+
|
|
413
434
|
## :warning: Limitations
|
|
414
435
|
|
|
415
436
|
- This tool currently does **not** support the export of space memberships.
|
package/dist/index.js
CHANGED
|
@@ -80,6 +80,7 @@ function runContentfulExport(params) {
|
|
|
80
80
|
skipWebhooks: options.skipWebhooks,
|
|
81
81
|
skipRoles: options.skipRoles,
|
|
82
82
|
skipTags: options.skipTags,
|
|
83
|
+
skipReleases: options.skipReleases,
|
|
83
84
|
stripTags: options.stripTags,
|
|
84
85
|
includeExperienceOrchestration: options.includeExperienceOrchestration,
|
|
85
86
|
includeExoVariants: options.includeExoVariants,
|
package/dist/parseOptions.js
CHANGED
|
@@ -29,6 +29,7 @@ function parseOptions(params) {
|
|
|
29
29
|
skipAssets: false,
|
|
30
30
|
skipWebhooks: false,
|
|
31
31
|
skipTags: false,
|
|
32
|
+
skipReleases: false,
|
|
32
33
|
stripTags: false,
|
|
33
34
|
maxAllowedLimit: 1000,
|
|
34
35
|
includeExperienceOrchestration: true,
|
|
@@ -88,6 +89,7 @@ function parseOptions(params) {
|
|
|
88
89
|
options.skipRoles = true;
|
|
89
90
|
options.skipContentModel = true;
|
|
90
91
|
options.skipWebhooks = true;
|
|
92
|
+
options.skipReleases = true;
|
|
91
93
|
}
|
|
92
94
|
options.application = options.managementApplication || `contentful.export/${_package.version}`;
|
|
93
95
|
options.feature = options.managementFeature || 'library-export';
|
|
@@ -33,6 +33,7 @@ function getFullSourceSpace({
|
|
|
33
33
|
skipRoles,
|
|
34
34
|
skipEditorInterfaces,
|
|
35
35
|
skipTags,
|
|
36
|
+
skipReleases,
|
|
36
37
|
stripTags,
|
|
37
38
|
includeDrafts,
|
|
38
39
|
includeArchived,
|
|
@@ -171,6 +172,29 @@ function getFullSourceSpace({
|
|
|
171
172
|
});
|
|
172
173
|
}),
|
|
173
174
|
skip: () => skipRoles || environmentId !== 'master' && 'Roles can only be exported from master environment'
|
|
175
|
+
}, {
|
|
176
|
+
title: 'Fetching Releases data',
|
|
177
|
+
task: (0, _contentfulBatchLibs.wrapTask)(async ctx => {
|
|
178
|
+
try {
|
|
179
|
+
// Excludes releases created internally by other Contentful features (rather than by a
|
|
180
|
+
// user directly), so they don't leak into a customer's export as if they were
|
|
181
|
+
// user-authored Releases.
|
|
182
|
+
const releases = await cursorPagedGet(query => client.release.query({
|
|
183
|
+
environmentId,
|
|
184
|
+
spaceId,
|
|
185
|
+
query: _objectSpread({
|
|
186
|
+
'metadata.annotations.Contentful:Timeline.type[nin]': 'Staging,Hidden',
|
|
187
|
+
'sys.schemaVersion': 'Release.v2',
|
|
188
|
+
'sys.status[in]': 'active'
|
|
189
|
+
}, query)
|
|
190
|
+
}));
|
|
191
|
+
ctx.data.releases = releases;
|
|
192
|
+
} catch (err) {
|
|
193
|
+
_contentfulBatchLibs.logEmitter.emit('warning', `Skipping Releases export: ${err.message}`);
|
|
194
|
+
ctx.data.releases = [];
|
|
195
|
+
}
|
|
196
|
+
}),
|
|
197
|
+
skip: () => skipReleases
|
|
174
198
|
}, {
|
|
175
199
|
title: 'Fetching Design Tokens data',
|
|
176
200
|
task: (0, _contentfulBatchLibs.wrapTask)(async ctx => {
|
package/dist/usageParams.js
CHANGED
|
@@ -57,6 +57,10 @@ var _default = exports.default = _yargs.default.version(_package.default.version
|
|
|
57
57
|
describe: 'Skip exporting webhooks',
|
|
58
58
|
type: 'boolean',
|
|
59
59
|
default: false
|
|
60
|
+
}).option('skip-releases', {
|
|
61
|
+
describe: 'Skip exporting Releases',
|
|
62
|
+
type: 'boolean',
|
|
63
|
+
default: false
|
|
60
64
|
}).options('strip-tags', {
|
|
61
65
|
describe: 'Untag assets and entries',
|
|
62
66
|
type: 'boolean',
|