contentful-export 7.22.3 → 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.
Files changed (2) hide show
  1. package/README.md +55 -10
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -10,11 +10,11 @@ This is a library that helps you backup your Content Model, Content and Assets o
10
10
  To import your exported data, please refer to the [contentful-import](https://github.com/contentful/contentful-import) repository.
11
11
 
12
12
  ## :exclamation: Usage as CLI
13
+
13
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.
14
15
  >
15
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.
16
17
 
17
-
18
18
  ## :cloud: Pre-requisites && Installation
19
19
 
20
20
  ### Pre-requisites
@@ -29,6 +29,8 @@ npm install contentful-export
29
29
 
30
30
  ## :hand: Usage
31
31
 
32
+ ### CommonJS
33
+
32
34
  ```javascript
33
35
  const contentfulExport = require('contentful-export')
34
36
 
@@ -47,6 +49,21 @@ contentfulExport(options)
47
49
  })
48
50
  ```
49
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
+
50
67
  ### Querying
51
68
 
52
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).
@@ -104,15 +121,19 @@ contentfulExport(options)
104
121
  ### Basics
105
122
 
106
123
  #### `spaceId` [string] [required]
124
+
107
125
  ID of the space with source data
108
126
 
109
127
  #### `environmentId` [string] [default: 'master']
128
+
110
129
  ID of the environment in the source space
111
130
 
112
131
  #### `managementToken` [string] [required]
132
+
113
133
  Contentful management API token for the space to be exported
114
134
 
115
135
  #### `deliveryToken` [string]
136
+
116
137
  Contentful Content Delivery API (CDA) token for the space to be exported.
117
138
 
118
139
  Providing `deliveryToken` will export both entries and assets from the
@@ -141,17 +162,21 @@ Note: Tags are only available on the Contentful Management API, so they will not
141
162
  ### Output
142
163
 
143
164
  #### `exportDir` [string] [default: current process working directory]
165
+
144
166
  Defines the path for storing the export JSON file
145
167
 
146
168
  #### `saveFile` [boolean] [default: true]
169
+
147
170
  Save the export as a JSON file
148
171
 
149
172
  #### `contentFile` [string]
173
+
150
174
  The filename for the exported data
151
175
 
152
176
  ### Filtering
153
177
 
154
178
  #### `includeDrafts` [boolean] [default: false]
179
+
155
180
  Include drafts in the exported entries.
156
181
 
157
182
  The `deliveryToken` option is ignored
@@ -160,67 +185,87 @@ If you want to include drafts, there's no point of getting them through the
160
185
  Content Delivery API.
161
186
 
162
187
  #### `includeArchived` [boolean] [default: false]
188
+
163
189
  Include archived entries in the exported entries
164
190
 
165
191
  #### `skipContentModel` [boolean] [default: false]
192
+
166
193
  Skip exporting content models
167
194
 
168
195
  #### `skipEditorInterfaces` [boolean] [default: false]
196
+
169
197
  Skip exporting editor interfaces
170
198
 
171
199
  #### `skipContent` [boolean] [default: false]
200
+
172
201
  Skip exporting assets and entries.
173
202
 
174
203
  #### `skipRoles` [boolean] [default: false]
204
+
175
205
  Skip exporting roles and permissions
176
206
 
177
207
  #### `skipTags` [boolean] [default: false]
208
+
178
209
  Skip exporting tags
179
210
 
180
211
  #### `skipWebhooks` [boolean] [default: false]
212
+
181
213
  Skip exporting webhooks
182
214
 
183
215
  #### `stripTags` [boolean] [default: false]
216
+
184
217
  Untag assets and entries
185
218
 
186
219
  #### `contentOnly` [boolean] [default: false]
220
+
187
221
  Only export entries and assets
188
222
 
189
223
  #### `queryEntries` [array]
224
+
190
225
  Only export entries that match these queries
191
226
 
192
227
  #### `queryAssets` [array]
228
+
193
229
  Only export assets that match these queries
194
230
 
195
231
  #### `downloadAssets` [boolean]
232
+
196
233
  Download actual asset files
197
234
 
198
235
  ### Connection
199
236
 
200
237
  #### `host` [string] [default: 'api.contentful.com']
238
+
201
239
  The Management API host
202
240
 
203
241
  #### `hostDelivery` [string] [default: 'cdn.contentful.com']
242
+
204
243
  The Delivery API host
205
244
 
206
245
  #### `proxy` [string]
246
+
207
247
  Proxy configuration in HTTP auth format: `host:port` or `user:password@host:port`
208
248
 
209
249
  #### `rawProxy` [boolean]
250
+
210
251
  Pass proxy config to Axios instead of creating a custom httpsAgent
211
252
 
212
253
  #### `maxAllowedLimit` [number] [default: 1000]
254
+
213
255
  The number of items per page per request
214
256
 
215
257
  #### `headers` [object]
216
- Additional headers to attach to the requests.
258
+
259
+ Additional headers to attach to the requests.
217
260
 
218
261
  ### Other
219
262
 
220
263
  #### `errorLogFile` [string]
264
+
221
265
  Full path to the error log file
222
266
 
223
267
  #### `useVerboseRenderer` [boolean] [default: false]
268
+
224
269
  Display progress in new lines instead of displaying a busy spinner and the status in the same line. Useful for CI.
225
270
 
226
271
  ## :rescue_worker_helmet: Troubleshooting
@@ -255,15 +300,15 @@ contentfulExport({
255
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.
256
301
 
257
302
  ```javascript
258
- const contentfulExport = require('contentful-export')
303
+ const contentfulExport = require("contentful-export");
259
304
 
260
305
  const options = {
261
- spaceId: '<space_id>',
262
- managementToken: '<content_management_api_key>',
263
- downloadAssets: true
264
- }
306
+ spaceId: "<space_id>",
307
+ managementToken: "<content_management_api_key>",
308
+ downloadAssets: true,
309
+ };
265
310
 
266
- contentfulExport(options)
311
+ contentfulExport(options);
267
312
  ```
268
313
 
269
314
  ## :card_file_box: Exported data structure
@@ -283,7 +328,7 @@ This is an overview of the exported data:
283
328
  }
284
329
  ```
285
330
 
286
- *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.
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.
287
332
 
288
333
  ## :warning: Limitations
289
334
 
@@ -296,7 +341,7 @@ This is an overview of the exported data:
296
341
  Read the [releases](https://github.com/contentful/contentful-export/releases) page for more information.
297
342
 
298
343
  ## :scroll: License
299
-
344
+
300
345
  This project is licensed under MIT license
301
346
 
302
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",
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": "^8.0.0",
49
+ "bfj": "^9.1.3",
50
50
  "bluebird": "^3.3.3",
51
51
  "cli-table3": "^0.6.0",
52
52
  "contentful": "^11.5.10",