contentful-export 7.22.2 → 7.22.4
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 +57 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
# Contentful export tool
|
|
2
2
|
|
|
3
|
-
[](https://david-dm.org/contentful/contentful-export)
|
|
6
|
-
[](https://david-dm.org/contentful/contentful-export#info=devDependencies)
|
|
7
|
-
|
|
8
|
-
[](https://github.com/semantic-release/semantic-release) [](http://standardjs.com/)
|
|
3
|
+
[](https://github.com/contentful/contentful-export/actions/workflows/main.yaml)
|
|
4
|
+
[](https://www.npmjs.com/package/contentful-export) [](https://github.com/semantic-release/semantic-release)
|
|
9
5
|
|
|
10
6
|
[Contentful](https://www.contentful.com) provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.
|
|
11
7
|
|
|
@@ -14,11 +10,11 @@ This is a library that helps you backup your Content Model, Content and Assets o
|
|
|
14
10
|
To import your exported data, please refer to the [contentful-import](https://github.com/contentful/contentful-import) repository.
|
|
15
11
|
|
|
16
12
|
## :exclamation: Usage as CLI
|
|
13
|
+
|
|
17
14
|
> We moved the CLI version of this tool into our [Contentful CLI](https://github.com/contentful/contentful-cli). This allows our users to use and install only one single CLI tool to get the full Contentful experience.
|
|
18
15
|
>
|
|
19
16
|
> Please have a look at the [Contentful CLI export command documentation](https://github.com/contentful/contentful-cli/tree/master/docs/space/export) to learn more about how to use this as command line tool.
|
|
20
17
|
|
|
21
|
-
|
|
22
18
|
## :cloud: Pre-requisites && Installation
|
|
23
19
|
|
|
24
20
|
### Pre-requisites
|
|
@@ -33,6 +29,8 @@ npm install contentful-export
|
|
|
33
29
|
|
|
34
30
|
## :hand: Usage
|
|
35
31
|
|
|
32
|
+
### CommonJS
|
|
33
|
+
|
|
36
34
|
```javascript
|
|
37
35
|
const contentfulExport = require('contentful-export')
|
|
38
36
|
|
|
@@ -51,6 +49,21 @@ contentfulExport(options)
|
|
|
51
49
|
})
|
|
52
50
|
```
|
|
53
51
|
|
|
52
|
+
### ESM
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
import contentfulExport from 'contentful-export'
|
|
56
|
+
|
|
57
|
+
const options = {
|
|
58
|
+
spaceId: '<space_id>',
|
|
59
|
+
managementToken: '<content_management_api_key>',
|
|
60
|
+
...
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// contentfulExport returns a Promise so you can use async/await, etc.
|
|
64
|
+
await contentfulExport(options)
|
|
65
|
+
```
|
|
66
|
+
|
|
54
67
|
### Querying
|
|
55
68
|
|
|
56
69
|
To scope your export, you are able to pass query parameters. All search parameters of our API are supported as documented in our [API documentation](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters).
|
|
@@ -108,15 +121,19 @@ contentfulExport(options)
|
|
|
108
121
|
### Basics
|
|
109
122
|
|
|
110
123
|
#### `spaceId` [string] [required]
|
|
124
|
+
|
|
111
125
|
ID of the space with source data
|
|
112
126
|
|
|
113
127
|
#### `environmentId` [string] [default: 'master']
|
|
128
|
+
|
|
114
129
|
ID of the environment in the source space
|
|
115
130
|
|
|
116
131
|
#### `managementToken` [string] [required]
|
|
132
|
+
|
|
117
133
|
Contentful management API token for the space to be exported
|
|
118
134
|
|
|
119
135
|
#### `deliveryToken` [string]
|
|
136
|
+
|
|
120
137
|
Contentful Content Delivery API (CDA) token for the space to be exported.
|
|
121
138
|
|
|
122
139
|
Providing `deliveryToken` will export both entries and assets from the
|
|
@@ -145,17 +162,21 @@ Note: Tags are only available on the Contentful Management API, so they will not
|
|
|
145
162
|
### Output
|
|
146
163
|
|
|
147
164
|
#### `exportDir` [string] [default: current process working directory]
|
|
165
|
+
|
|
148
166
|
Defines the path for storing the export JSON file
|
|
149
167
|
|
|
150
168
|
#### `saveFile` [boolean] [default: true]
|
|
169
|
+
|
|
151
170
|
Save the export as a JSON file
|
|
152
171
|
|
|
153
172
|
#### `contentFile` [string]
|
|
173
|
+
|
|
154
174
|
The filename for the exported data
|
|
155
175
|
|
|
156
176
|
### Filtering
|
|
157
177
|
|
|
158
178
|
#### `includeDrafts` [boolean] [default: false]
|
|
179
|
+
|
|
159
180
|
Include drafts in the exported entries.
|
|
160
181
|
|
|
161
182
|
The `deliveryToken` option is ignored
|
|
@@ -164,67 +185,87 @@ If you want to include drafts, there's no point of getting them through the
|
|
|
164
185
|
Content Delivery API.
|
|
165
186
|
|
|
166
187
|
#### `includeArchived` [boolean] [default: false]
|
|
188
|
+
|
|
167
189
|
Include archived entries in the exported entries
|
|
168
190
|
|
|
169
191
|
#### `skipContentModel` [boolean] [default: false]
|
|
192
|
+
|
|
170
193
|
Skip exporting content models
|
|
171
194
|
|
|
172
195
|
#### `skipEditorInterfaces` [boolean] [default: false]
|
|
196
|
+
|
|
173
197
|
Skip exporting editor interfaces
|
|
174
198
|
|
|
175
199
|
#### `skipContent` [boolean] [default: false]
|
|
200
|
+
|
|
176
201
|
Skip exporting assets and entries.
|
|
177
202
|
|
|
178
203
|
#### `skipRoles` [boolean] [default: false]
|
|
204
|
+
|
|
179
205
|
Skip exporting roles and permissions
|
|
180
206
|
|
|
181
207
|
#### `skipTags` [boolean] [default: false]
|
|
208
|
+
|
|
182
209
|
Skip exporting tags
|
|
183
210
|
|
|
184
211
|
#### `skipWebhooks` [boolean] [default: false]
|
|
212
|
+
|
|
185
213
|
Skip exporting webhooks
|
|
186
214
|
|
|
187
215
|
#### `stripTags` [boolean] [default: false]
|
|
216
|
+
|
|
188
217
|
Untag assets and entries
|
|
189
218
|
|
|
190
219
|
#### `contentOnly` [boolean] [default: false]
|
|
220
|
+
|
|
191
221
|
Only export entries and assets
|
|
192
222
|
|
|
193
223
|
#### `queryEntries` [array]
|
|
224
|
+
|
|
194
225
|
Only export entries that match these queries
|
|
195
226
|
|
|
196
227
|
#### `queryAssets` [array]
|
|
228
|
+
|
|
197
229
|
Only export assets that match these queries
|
|
198
230
|
|
|
199
231
|
#### `downloadAssets` [boolean]
|
|
232
|
+
|
|
200
233
|
Download actual asset files
|
|
201
234
|
|
|
202
235
|
### Connection
|
|
203
236
|
|
|
204
237
|
#### `host` [string] [default: 'api.contentful.com']
|
|
238
|
+
|
|
205
239
|
The Management API host
|
|
206
240
|
|
|
207
241
|
#### `hostDelivery` [string] [default: 'cdn.contentful.com']
|
|
242
|
+
|
|
208
243
|
The Delivery API host
|
|
209
244
|
|
|
210
245
|
#### `proxy` [string]
|
|
246
|
+
|
|
211
247
|
Proxy configuration in HTTP auth format: `host:port` or `user:password@host:port`
|
|
212
248
|
|
|
213
249
|
#### `rawProxy` [boolean]
|
|
250
|
+
|
|
214
251
|
Pass proxy config to Axios instead of creating a custom httpsAgent
|
|
215
252
|
|
|
216
253
|
#### `maxAllowedLimit` [number] [default: 1000]
|
|
254
|
+
|
|
217
255
|
The number of items per page per request
|
|
218
256
|
|
|
219
257
|
#### `headers` [object]
|
|
220
|
-
|
|
258
|
+
|
|
259
|
+
Additional headers to attach to the requests.
|
|
221
260
|
|
|
222
261
|
### Other
|
|
223
262
|
|
|
224
263
|
#### `errorLogFile` [string]
|
|
264
|
+
|
|
225
265
|
Full path to the error log file
|
|
226
266
|
|
|
227
267
|
#### `useVerboseRenderer` [boolean] [default: false]
|
|
268
|
+
|
|
228
269
|
Display progress in new lines instead of displaying a busy spinner and the status in the same line. Useful for CI.
|
|
229
270
|
|
|
230
271
|
## :rescue_worker_helmet: Troubleshooting
|
|
@@ -259,15 +300,15 @@ contentfulExport({
|
|
|
259
300
|
If a space is configured to use the [embargoed assets feature](https://www.contentful.com/help/media/embargoed-assets/), certain options will need to be set to use the export/import tooling. When exporting content, the `downloadAssets` option must be set to `true`. This will download the asset files to your local machine. Then, when importing content ([using `contentful-import`](https://github.com/contentful/contentful-import)), the `uploadAssets` option must be set to `true` and the `assetsDirectory` must be set to the directory that contains all of the exported asset folders.
|
|
260
301
|
|
|
261
302
|
```javascript
|
|
262
|
-
const contentfulExport = require(
|
|
303
|
+
const contentfulExport = require("contentful-export");
|
|
263
304
|
|
|
264
305
|
const options = {
|
|
265
|
-
spaceId:
|
|
266
|
-
managementToken:
|
|
267
|
-
downloadAssets: true
|
|
268
|
-
}
|
|
306
|
+
spaceId: "<space_id>",
|
|
307
|
+
managementToken: "<content_management_api_key>",
|
|
308
|
+
downloadAssets: true,
|
|
309
|
+
};
|
|
269
310
|
|
|
270
|
-
contentfulExport(options)
|
|
311
|
+
contentfulExport(options);
|
|
271
312
|
```
|
|
272
313
|
|
|
273
314
|
## :card_file_box: Exported data structure
|
|
@@ -287,7 +328,7 @@ This is an overview of the exported data:
|
|
|
287
328
|
}
|
|
288
329
|
```
|
|
289
330
|
|
|
290
|
-
|
|
331
|
+
_Note:_ Tags feature is not available for all users. If you do not have access to this feature, the tags array will always be empty.
|
|
291
332
|
|
|
292
333
|
## :warning: Limitations
|
|
293
334
|
|
|
@@ -300,7 +341,7 @@ This is an overview of the exported data:
|
|
|
300
341
|
Read the [releases](https://github.com/contentful/contentful-export/releases) page for more information.
|
|
301
342
|
|
|
302
343
|
## :scroll: License
|
|
303
|
-
|
|
344
|
+
|
|
304
345
|
This project is licensed under MIT license
|
|
305
346
|
|
|
306
347
|
[1]: https://www.contentful.com
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentful-export",
|
|
3
|
-
"version": "7.22.
|
|
3
|
+
"version": "7.22.4",
|
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"axios": "^1.13.5",
|
|
49
|
-
"bfj": "^
|
|
49
|
+
"bfj": "^9.1.3",
|
|
50
50
|
"bluebird": "^3.3.3",
|
|
51
51
|
"cli-table3": "^0.6.0",
|
|
52
52
|
"contentful": "^11.5.10",
|