contentful-import 10.1.0-exo.8 → 10.1.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 +60 -1
- package/dist/index.js +747 -120
- package/dist/index.mjs +743 -116
- package/dist/usageParams.js +1 -1
- package/dist/usageParams.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -213,6 +213,12 @@ Display progress in new lines instead of displaying a busy spinner and the statu
|
|
|
213
213
|
|
|
214
214
|
Path to a JSON file with the configuration options. This file will be merged with the options passed to the function. The options passed to the function will take precedence over the ones in the config file.
|
|
215
215
|
|
|
216
|
+
### Experience Orchestration
|
|
217
|
+
|
|
218
|
+
#### `includeExperienceOrchestration` [boolean] [default: true]
|
|
219
|
+
|
|
220
|
+
Flag controlling whether Experience Orchestration (ExO) entities — Design Tokens, Components, Experience Templates, Experience Fragments, Data Assemblies, and Experiences — are imported when present in the source content. Requires the `exoM1` entitlement on the destination space's organization. Set to `false` to opt out. See the "Experience Orchestration (ExO) entities" section below for what happens when the destination isn't entitled.
|
|
221
|
+
|
|
216
222
|
## :rescue_worker_helmet: Troubleshooting
|
|
217
223
|
|
|
218
224
|
### Proxy
|
|
@@ -258,12 +264,65 @@ The data to import should be structured like this:
|
|
|
258
264
|
"webhooks": [],
|
|
259
265
|
"roles": [],
|
|
260
266
|
"tags": [],
|
|
261
|
-
"editorInterfaces": []
|
|
267
|
+
"editorInterfaces": [],
|
|
268
|
+
"designTokens": [],
|
|
269
|
+
"components": [],
|
|
270
|
+
"experienceTemplates": [],
|
|
271
|
+
"dataAssemblies": [],
|
|
272
|
+
"experienceFragments": [],
|
|
273
|
+
"experiences": []
|
|
262
274
|
}
|
|
263
275
|
```
|
|
264
276
|
|
|
265
277
|
Note: `tags` are not available for all users. If you do not have access to this feature, any tags included in your import data will be skipped.
|
|
266
278
|
|
|
279
|
+
The `designTokens`, `components`, `experienceTemplates`, `dataAssemblies`, `experienceFragments`, and `experiences` keys are Experience Orchestration (ExO) entities — see the "Experience Orchestration (ExO) entities" section below.
|
|
280
|
+
|
|
281
|
+
## :test_tube: Experience Orchestration (ExO) entities
|
|
282
|
+
|
|
283
|
+
> **Experimental:** ExO entities (`designTokens`, `components`, `experienceTemplates`, `dataAssemblies`, `experienceFragments`, `experiences`) are `@internal` and considered experimental. Their shape and import behavior are subject to change without notice.
|
|
284
|
+
|
|
285
|
+
ExO import is on by default (`includeExperienceOrchestration: true`) — for the CLI and the module API alike. Pass `includeExperienceOrchestration: false` (`--include-experience-orchestration=false` on the CLI) to opt out.
|
|
286
|
+
|
|
287
|
+
```javascript
|
|
288
|
+
import contentfulImport from 'contentful-import'
|
|
289
|
+
|
|
290
|
+
const options = {
|
|
291
|
+
contentFile: '/path/to/result/of/contentful-export.json',
|
|
292
|
+
spaceId: '<space_id>',
|
|
293
|
+
managementToken: '<content_management_api_key>',
|
|
294
|
+
includeExperienceOrchestration: false, // opt out; omit to import ExO entities when present (the default)
|
|
295
|
+
...
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
await contentfulImport(options)
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
If your source content has no ExO entities at all — true for anyone not using ExO — this default is a complete no-op. The destination-entitlement check in `lib/tasks/get-destination-data.ts` only runs if the source data actually contains ExO entities (`sourceData.designTokens?.length`, etc.); with nothing to check, no extra API calls happen and nothing extra gets logged. Behavior is identical either way for imports that don't involve ExO content.
|
|
302
|
+
|
|
303
|
+
Requires the `exoM1` entitlement on the destination space's organization. [contentful-cli](https://github.com/contentful/contentful-cli)'s `space import` command doesn't expose this option at all yet, so ExO import isn't reachable through that separate CLI regardless of default.
|
|
304
|
+
|
|
305
|
+
If the destination space isn't entitled and the source data does contain ExO entities, ExO import for that space is skipped and the rest of the content (content types, entries, assets, etc.) still imports normally — but the missing-entitlement notice is logged at error level, not warning. That means `contentfulImport()` still rejects with a `ContentfulMultiError` at the end, even though the non-ExO content imported successfully. Don't treat a rejected promise as proof the whole import failed — check `err.errors` (or the `errorLogFile`) for `Experience Orchestration (ExO) is not enabled for this space` before assuming something is actually broken.
|
|
306
|
+
|
|
307
|
+
### Import order
|
|
308
|
+
|
|
309
|
+
ExO entities are created and published in dependency order, then unpublished in reverse order once every other import step has finished:
|
|
310
|
+
|
|
311
|
+
1. Data Assemblies — create, then publish
|
|
312
|
+
2. Design Tokens — create only (no publish/unpublish step; a Design Token is live as soon as it's created or updated)
|
|
313
|
+
3. Components — create, then publish
|
|
314
|
+
4. Experience Templates — create, then publish
|
|
315
|
+
5. Experience Fragments — create, then publish
|
|
316
|
+
6. Experiences — create, then publish
|
|
317
|
+
7. Unpublish pass, in reverse: Experiences → Experience Fragments → Experience Templates → Components → Data Assemblies
|
|
318
|
+
|
|
319
|
+
An entity that's published in the source is published in the destination on import. An entity that's unpublished (or removed) in the source but still published in the destination is unpublished on re-import — this propagates in both directions, so reverting a published ExO entity back to draft in the source and re-running the import will unpublish it in the destination too.
|
|
320
|
+
|
|
321
|
+
### URN rewriting / backward compatibility
|
|
322
|
+
|
|
323
|
+
- Export files taken before the ExO entity rename (`ComponentType` → `Component`, `Fragment` → `ExperienceFragment`, `Template` → `ExperienceTemplate`) are upgraded automatically on import, including the corresponding resource-link `linkType`s and URN path segments. This upgrade is upgrade-only (there's no downgrade path) and idempotent, so it's safe to run against already-upgraded data.
|
|
324
|
+
- Export files that predate ExO entirely (no ExO keys, or empty ExO arrays) import unchanged — no extra configuration is needed to import older export files.
|
|
325
|
+
|
|
267
326
|
## :bulb: Importing to a space with existing content
|
|
268
327
|
|
|
269
328
|
- Both source space and destination space must share the same content model structure. In order to achieve that, please use [contentful-migration](https://www.npmjs.com/package/contentful-migration).
|