contentful-import 9.3.2 → 9.3.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.
@@ -0,0 +1,21 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
+ }) : x)(function(x) {
5
+ if (typeof require !== "undefined")
6
+ return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+
14
+ // package.json
15
+ var version = "0.0.0-determined-by-semantic-release";
16
+
17
+ export {
18
+ __require,
19
+ __export,
20
+ version
21
+ };
package/dist/index.mjs CHANGED
@@ -1,15 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined")
6
- return require.apply(this, arguments);
7
- throw Error('Dynamic require of "' + x + '" is not supported');
8
- });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
1
+ import {
2
+ __export,
3
+ __require,
4
+ version
5
+ } from "./chunk-MTMZXBFN.mjs";
13
6
 
14
7
  // lib/index.ts
15
8
  import Table from "cli-table3";
@@ -1110,9 +1103,6 @@ import fs2 from "fs";
1110
1103
  import { resolve } from "path";
1111
1104
  import format from "date-fns/format";
1112
1105
 
1113
- // package.json
1114
- var version = "0.0.0-determined-by-semantic-release";
1115
-
1116
1106
  // lib/utils/headers.ts
1117
1107
  function getHeadersConfig(value) {
1118
1108
  if (!value) {
@@ -0,0 +1,69 @@
1
+ declare const _default: {
2
+ [x: string]: unknown;
3
+ "space-id": string;
4
+ spaceId: string;
5
+ "environment-id": string;
6
+ environmentId: string;
7
+ "management-token": string;
8
+ managementToken: string;
9
+ "content-file": string;
10
+ contentFile: string;
11
+ "content-model-only": boolean;
12
+ contentModelOnly: boolean;
13
+ "skip-content-model": boolean;
14
+ skipContentModel: boolean;
15
+ "skip-locales": boolean;
16
+ skipLocales: boolean;
17
+ "skip-content-publishing": boolean;
18
+ skipContentPublishing: boolean;
19
+ "upload-assets": boolean;
20
+ uploadAssets: boolean;
21
+ "assets-directory": string | undefined;
22
+ assetsDirectory: string | undefined;
23
+ "error-log-file": string | undefined;
24
+ errorLogFile: string | undefined;
25
+ host: string;
26
+ proxy: string | undefined;
27
+ "raw-proxy": boolean;
28
+ rawProxy: boolean;
29
+ "rate-limit": number;
30
+ rateLimit: number;
31
+ header: string | undefined;
32
+ _: (string | number)[];
33
+ $0: string;
34
+ } | Promise<{
35
+ [x: string]: unknown;
36
+ "space-id": string;
37
+ spaceId: string;
38
+ "environment-id": string;
39
+ environmentId: string;
40
+ "management-token": string;
41
+ managementToken: string;
42
+ "content-file": string;
43
+ contentFile: string;
44
+ "content-model-only": boolean;
45
+ contentModelOnly: boolean;
46
+ "skip-content-model": boolean;
47
+ skipContentModel: boolean;
48
+ "skip-locales": boolean;
49
+ skipLocales: boolean;
50
+ "skip-content-publishing": boolean;
51
+ skipContentPublishing: boolean;
52
+ "upload-assets": boolean;
53
+ uploadAssets: boolean;
54
+ "assets-directory": string | undefined;
55
+ assetsDirectory: string | undefined;
56
+ "error-log-file": string | undefined;
57
+ errorLogFile: string | undefined;
58
+ host: string;
59
+ proxy: string | undefined;
60
+ "raw-proxy": boolean;
61
+ rawProxy: boolean;
62
+ "rate-limit": number;
63
+ rateLimit: number;
64
+ header: string | undefined;
65
+ _: (string | number)[];
66
+ $0: string;
67
+ }>;
68
+
69
+ export { _default as default };
@@ -0,0 +1,69 @@
1
+ declare const _default: {
2
+ [x: string]: unknown;
3
+ "space-id": string;
4
+ spaceId: string;
5
+ "environment-id": string;
6
+ environmentId: string;
7
+ "management-token": string;
8
+ managementToken: string;
9
+ "content-file": string;
10
+ contentFile: string;
11
+ "content-model-only": boolean;
12
+ contentModelOnly: boolean;
13
+ "skip-content-model": boolean;
14
+ skipContentModel: boolean;
15
+ "skip-locales": boolean;
16
+ skipLocales: boolean;
17
+ "skip-content-publishing": boolean;
18
+ skipContentPublishing: boolean;
19
+ "upload-assets": boolean;
20
+ uploadAssets: boolean;
21
+ "assets-directory": string | undefined;
22
+ assetsDirectory: string | undefined;
23
+ "error-log-file": string | undefined;
24
+ errorLogFile: string | undefined;
25
+ host: string;
26
+ proxy: string | undefined;
27
+ "raw-proxy": boolean;
28
+ rawProxy: boolean;
29
+ "rate-limit": number;
30
+ rateLimit: number;
31
+ header: string | undefined;
32
+ _: (string | number)[];
33
+ $0: string;
34
+ } | Promise<{
35
+ [x: string]: unknown;
36
+ "space-id": string;
37
+ spaceId: string;
38
+ "environment-id": string;
39
+ environmentId: string;
40
+ "management-token": string;
41
+ managementToken: string;
42
+ "content-file": string;
43
+ contentFile: string;
44
+ "content-model-only": boolean;
45
+ contentModelOnly: boolean;
46
+ "skip-content-model": boolean;
47
+ skipContentModel: boolean;
48
+ "skip-locales": boolean;
49
+ skipLocales: boolean;
50
+ "skip-content-publishing": boolean;
51
+ skipContentPublishing: boolean;
52
+ "upload-assets": boolean;
53
+ uploadAssets: boolean;
54
+ "assets-directory": string | undefined;
55
+ assetsDirectory: string | undefined;
56
+ "error-log-file": string | undefined;
57
+ errorLogFile: string | undefined;
58
+ host: string;
59
+ proxy: string | undefined;
60
+ "raw-proxy": boolean;
61
+ rawProxy: boolean;
62
+ "rate-limit": number;
63
+ rateLimit: number;
64
+ header: string | undefined;
65
+ _: (string | number)[];
66
+ $0: string;
67
+ }>;
68
+
69
+ export { _default as default };
@@ -0,0 +1,103 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // lib/usageParams.ts
30
+ var usageParams_exports = {};
31
+ __export(usageParams_exports, {
32
+ default: () => usageParams_default
33
+ });
34
+ module.exports = __toCommonJS(usageParams_exports);
35
+ var import_yargs = __toESM(require("yargs"));
36
+
37
+ // package.json
38
+ var version = "0.0.0-determined-by-semantic-release";
39
+
40
+ // lib/usageParams.ts
41
+ var usageParams_default = import_yargs.default.version(version || "Version only available on installed package").usage("Usage: $0 [options]").option("space-id", {
42
+ describe: "ID of the destination space",
43
+ type: "string",
44
+ demand: true
45
+ }).option("environment-id", {
46
+ describe: "ID the environment in the destination space",
47
+ type: "string",
48
+ default: "master",
49
+ demand: false
50
+ }).option("management-token", {
51
+ describe: "Contentful management API token for the destination space",
52
+ type: "string",
53
+ demand: true
54
+ }).option("content-file", {
55
+ describe: "JSON file that contains data to be import to your space",
56
+ type: "string",
57
+ demand: true
58
+ }).option("content-model-only", {
59
+ describe: "Import only content types",
60
+ type: "boolean",
61
+ default: false
62
+ }).option("skip-content-model", {
63
+ describe: "Skip importing content types and locales",
64
+ type: "boolean",
65
+ default: false
66
+ }).option("skip-locales", {
67
+ describe: "Skip importing locales",
68
+ type: "boolean",
69
+ default: false
70
+ }).option("skip-content-publishing", {
71
+ describe: "Skips content publishing. Creates content but does not publish it",
72
+ type: "boolean",
73
+ default: false
74
+ }).option("upload-assets", {
75
+ describe: "Uses local asset files and uploads them instead of pointing to the URLs of previously uploaded assets. Requires assets-directory",
76
+ type: "boolean",
77
+ default: false
78
+ }).implies("upload-assets", "assets-directory").option("assets-directory", {
79
+ describe: "Path to a directory with an asset export made using the downloadAssets option to upload those files instead of pointing to the URLs of previously uploaded assets. Requires upload-assets",
80
+ type: "string"
81
+ }).implies("assets-directory", "upload-assets").option("error-log-file", {
82
+ describe: "Full path to the error log file",
83
+ type: "string"
84
+ }).option("host", {
85
+ describe: "Management API host",
86
+ type: "string",
87
+ default: "api.contentful.com"
88
+ }).option("proxy", {
89
+ describe: "Proxy configuration in HTTP auth format: [http|https]://host:port or [http|https]://user:password@host:port",
90
+ type: "string"
91
+ }).option("raw-proxy", {
92
+ describe: "Pass proxy config to Axios instead of creating a custom httpsAgent",
93
+ type: "boolean",
94
+ default: false
95
+ }).option("rate-limit", {
96
+ describe: "Maximum requests per second used for API requests",
97
+ type: "number",
98
+ default: 7
99
+ }).option("header", {
100
+ alias: "H",
101
+ type: "string",
102
+ describe: "Pass an additional HTTP Header"
103
+ }).config("config", "An optional configuration JSON file containing all the options for a single run").argv;
@@ -0,0 +1,72 @@
1
+ import {
2
+ version
3
+ } from "./chunk-MTMZXBFN.mjs";
4
+
5
+ // lib/usageParams.ts
6
+ import yargs from "yargs";
7
+ var usageParams_default = yargs.version(version || "Version only available on installed package").usage("Usage: $0 [options]").option("space-id", {
8
+ describe: "ID of the destination space",
9
+ type: "string",
10
+ demand: true
11
+ }).option("environment-id", {
12
+ describe: "ID the environment in the destination space",
13
+ type: "string",
14
+ default: "master",
15
+ demand: false
16
+ }).option("management-token", {
17
+ describe: "Contentful management API token for the destination space",
18
+ type: "string",
19
+ demand: true
20
+ }).option("content-file", {
21
+ describe: "JSON file that contains data to be import to your space",
22
+ type: "string",
23
+ demand: true
24
+ }).option("content-model-only", {
25
+ describe: "Import only content types",
26
+ type: "boolean",
27
+ default: false
28
+ }).option("skip-content-model", {
29
+ describe: "Skip importing content types and locales",
30
+ type: "boolean",
31
+ default: false
32
+ }).option("skip-locales", {
33
+ describe: "Skip importing locales",
34
+ type: "boolean",
35
+ default: false
36
+ }).option("skip-content-publishing", {
37
+ describe: "Skips content publishing. Creates content but does not publish it",
38
+ type: "boolean",
39
+ default: false
40
+ }).option("upload-assets", {
41
+ describe: "Uses local asset files and uploads them instead of pointing to the URLs of previously uploaded assets. Requires assets-directory",
42
+ type: "boolean",
43
+ default: false
44
+ }).implies("upload-assets", "assets-directory").option("assets-directory", {
45
+ describe: "Path to a directory with an asset export made using the downloadAssets option to upload those files instead of pointing to the URLs of previously uploaded assets. Requires upload-assets",
46
+ type: "string"
47
+ }).implies("assets-directory", "upload-assets").option("error-log-file", {
48
+ describe: "Full path to the error log file",
49
+ type: "string"
50
+ }).option("host", {
51
+ describe: "Management API host",
52
+ type: "string",
53
+ default: "api.contentful.com"
54
+ }).option("proxy", {
55
+ describe: "Proxy configuration in HTTP auth format: [http|https]://host:port or [http|https]://user:password@host:port",
56
+ type: "string"
57
+ }).option("raw-proxy", {
58
+ describe: "Pass proxy config to Axios instead of creating a custom httpsAgent",
59
+ type: "boolean",
60
+ default: false
61
+ }).option("rate-limit", {
62
+ describe: "Maximum requests per second used for API requests",
63
+ type: "number",
64
+ default: 7
65
+ }).option("header", {
66
+ alias: "H",
67
+ type: "string",
68
+ describe: "Pass an additional HTTP Header"
69
+ }).config("config", "An optional configuration JSON file containing all the options for a single run").argv;
70
+ export {
71
+ usageParams_default as default
72
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-import",
3
- "version": "9.3.2",
3
+ "version": "9.3.4",
4
4
  "description": "this tool allows you to import JSON dump exported by contentful-export",
5
5
  "main": "dist/index.mjs",
6
6
  "typings": "dist/index.d.ts",
@@ -49,7 +49,8 @@
49
49
  },
50
50
  "tsup": {
51
51
  "entry": [
52
- "lib/index.ts"
52
+ "lib/index.ts",
53
+ "lib/usageParams.ts"
53
54
  ],
54
55
  "format": [
55
56
  "cjs",
@@ -63,7 +64,7 @@
63
64
  "bluebird": "^3.5.1",
64
65
  "cli-table3": "^0.6.0",
65
66
  "contentful-batch-libs": "^9.5.0",
66
- "contentful-management": "^11.0.1",
67
+ "contentful-management": "^11.1.1",
67
68
  "date-fns": "^2.30.0",
68
69
  "eslint": "^8.51.0",
69
70
  "eslint-config-standard": "^17.1.0",
@@ -78,8 +79,8 @@
78
79
  "devDependencies": {
79
80
  "@types/jest": "^29.5.5",
80
81
  "@types/node": "^20.6.3",
81
- "@typescript-eslint/eslint-plugin": "^6.7.4",
82
- "@typescript-eslint/parser": "^6.7.4",
82
+ "@typescript-eslint/eslint-plugin": "^6.7.5",
83
+ "@typescript-eslint/parser": "^6.7.5",
83
84
  "babel-jest": "^29.7.0",
84
85
  "babel-plugin-add-module-exports": "^1.0.2",
85
86
  "babel-preset-env": "^1.7.0",