contentful-import 9.3.3 → 9.4.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/dist/chunk-MTMZXBFN.mjs +21 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +7 -15
- package/dist/usageParams.d.mts +69 -0
- package/dist/usageParams.d.ts +69 -0
- package/dist/usageParams.js +103 -0
- package/dist/usageParams.mjs +72 -0
- package/package.json +4 -3
|
@@ -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.js
CHANGED
|
@@ -642,6 +642,8 @@ function pushToSpace({
|
|
|
642
642
|
ctEditorInterface.controls = editorInterface.controls;
|
|
643
643
|
ctEditorInterface.groupControls = editorInterface.groupControls;
|
|
644
644
|
ctEditorInterface.editorLayout = editorInterface.editorLayout;
|
|
645
|
+
ctEditorInterface.sidebar = editorInterface.sidebar;
|
|
646
|
+
ctEditorInterface.editors = editorInterface.editors;
|
|
645
647
|
const updatedEditorInterface = await requestQueue.add(() => ctEditorInterface.update());
|
|
646
648
|
return updatedEditorInterface;
|
|
647
649
|
} catch (err) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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";
|
|
@@ -622,6 +615,8 @@ function pushToSpace({
|
|
|
622
615
|
ctEditorInterface.controls = editorInterface.controls;
|
|
623
616
|
ctEditorInterface.groupControls = editorInterface.groupControls;
|
|
624
617
|
ctEditorInterface.editorLayout = editorInterface.editorLayout;
|
|
618
|
+
ctEditorInterface.sidebar = editorInterface.sidebar;
|
|
619
|
+
ctEditorInterface.editors = editorInterface.editors;
|
|
625
620
|
const updatedEditorInterface = await requestQueue.add(() => ctEditorInterface.update());
|
|
626
621
|
return updatedEditorInterface;
|
|
627
622
|
} catch (err) {
|
|
@@ -1110,9 +1105,6 @@ import fs2 from "fs";
|
|
|
1110
1105
|
import { resolve } from "path";
|
|
1111
1106
|
import format from "date-fns/format";
|
|
1112
1107
|
|
|
1113
|
-
// package.json
|
|
1114
|
-
var version = "0.0.0-determined-by-semantic-release";
|
|
1115
|
-
|
|
1116
1108
|
// lib/utils/headers.ts
|
|
1117
1109
|
function getHeadersConfig(value) {
|
|
1118
1110
|
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
|
+
"version": "9.4.0",
|
|
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",
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"devDependencies": {
|
|
79
80
|
"@types/jest": "^29.5.5",
|
|
80
81
|
"@types/node": "^20.6.3",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^6.7.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
|
82
83
|
"@typescript-eslint/parser": "^6.7.5",
|
|
83
84
|
"babel-jest": "^29.7.0",
|
|
84
85
|
"babel-plugin-add-module-exports": "^1.0.2",
|