contentful-import 10.2.0 → 10.2.2

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 CHANGED
@@ -235,7 +235,7 @@ contentfulImport({
235
235
 
236
236
  ### Embargoed Assets
237
237
 
238
- 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 ([using `contentful-export`](https://github.com/contentful/contentful-export)), the `downloadAssets` option must be set to `true`. This will download the asset files to your local machine. Then, when importing content, 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.
238
+ If a space is configured to use the [embargoed assets feature](https://www.contentful.com/help/media/embargoed-assets/), export with `downloadAssets: true` and import with `uploadAssets: true` and `assetsDirectory` pointing to the directory generated by the export. Embargoed asset URLs cannot be processed directly during import; the importer now fails before making API calls and prints the required options when the local upload options are missing.
239
239
 
240
240
  ```javascript
241
241
  const contentfulImport = require('contentful-import')
@@ -245,7 +245,7 @@ const options = {
245
245
  spaceId: '<space_id>',
246
246
  managementToken: '<content_management_api_key>',
247
247
  uploadAssets: true,
248
- assetsDirectory: '/path/to/exported/assets.json'
248
+ assetsDirectory: '/path/to/exported-assets'
249
249
  }
250
250
 
251
251
  contentfulImport(options)
@@ -1,14 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  const runContentfulImport = require('../dist/index')
3
- const usageParams = require('../dist/usageParams').default
3
+ const usageParams = require('../dist/usageParams')
4
4
  console.log('We moved the CLI version of this tool into our Contentful CLI.\nThis allows our users to use and install only one single CLI tool to get the full Contentful experience.\nFor more info please visit https://github.com/contentful/contentful-cli/tree/master/docs/space/import')
5
- runContentfulImport(usageParams)
6
- .then(() => {
5
+
6
+ async function main () {
7
+ try {
8
+ await runContentfulImport(usageParams)
7
9
  process.exit(0)
8
- })
9
- .catch(function (err) {
10
+ } catch (err) {
10
11
  if (err.name !== 'ContentfulMultiError') {
11
12
  console.error(err)
12
13
  }
13
14
  process.exit(1)
14
- })
15
+ }
16
+ }
17
+
18
+ main()
@@ -0,0 +1,53 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
17
+ var __commonJS = (cb, mod) => function __require2() {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
+ // If the importer is in node compatibility mode or this is not an ESM
34
+ // file that has been converted to a CommonJS file using a Babel-
35
+ // compatible transform (i.e. "__esModule" has not been set), then set
36
+ // "default" to the CommonJS "module.exports" for node compatibility.
37
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
38
+ mod
39
+ ));
40
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
41
+
42
+ // package.json
43
+ var version = "0.0.0-determined-by-semantic-release";
44
+
45
+ export {
46
+ __require,
47
+ __esm,
48
+ __commonJS,
49
+ __export,
50
+ __toESM,
51
+ __toCommonJS,
52
+ version
53
+ };
package/dist/index.d.ts CHANGED
@@ -26,4 +26,4 @@ type RunContentfulImportParams = {
26
26
  };
27
27
  declare function runContentfulImport(params: RunContentfulImportParams): Promise<any>;
28
28
 
29
- export { runContentfulImport as default };
29
+ export = runContentfulImport;