@contentstack/cli-cm-seed 1.1.5 → 1.2.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/README.md +50 -9
- package/lib/commands/cm/stacks/seed.d.ts +8 -8
- package/lib/commands/cm/stacks/seed.js +2 -2
- package/lib/seed/contentstack/client.d.ts +5 -5
- package/lib/seed/contentstack/client.js +43 -59
- package/lib/seed/github/client.d.ts +1 -0
- package/lib/seed/github/client.js +28 -0
- package/lib/seed/index.js +12 -3
- package/oclif.manifest.json +97 -1
- package/package.json +10 -14
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ To import content to your stack, you can choose from the following two sources:
|
|
|
11
11
|
## Commands
|
|
12
12
|
<!-- commands -->
|
|
13
13
|
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value)
|
|
14
|
+
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]`](#csdx-cmstacksseed---repo-value---org-value--k-value--n-value--y-value--s-value-1)
|
|
14
15
|
|
|
15
16
|
## `csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]`
|
|
16
17
|
|
|
@@ -20,24 +21,64 @@ Create a stack from existing content types, entries, assets, etc
|
|
|
20
21
|
USAGE
|
|
21
22
|
$ csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
-k, --stack-api-key
|
|
25
|
-
-n, --stack-name
|
|
26
|
-
-o, --org
|
|
27
|
-
-r, --repo
|
|
28
|
-
-s, --stack
|
|
29
|
-
-y, --yes
|
|
24
|
+
FLAGS
|
|
25
|
+
-k, --stack-api-key=<value> Provide stack api key to seed content to
|
|
26
|
+
-n, --stack-name=<value> Name of a new stack that needs to be created.
|
|
27
|
+
-o, --org=<value> Provide Organization UID to create a new stack
|
|
28
|
+
-r, --repo=<value> GitHub account or GitHub account/repository
|
|
29
|
+
-s, --stack=<value> Provide stack UID to seed content to
|
|
30
|
+
-y, --yes=<value> [Optional] Skip stack confirmation
|
|
31
|
+
|
|
32
|
+
DESCRIPTION
|
|
33
|
+
Create a stack from existing content types, entries, assets, etc
|
|
30
34
|
|
|
31
35
|
ALIASES
|
|
32
36
|
$ csdx cm:seed
|
|
33
37
|
|
|
34
38
|
EXAMPLES
|
|
35
39
|
$ csdx cm:stacks:seed
|
|
40
|
+
|
|
36
41
|
$ csdx cm:stacks:seed --repo "account"
|
|
42
|
+
|
|
37
43
|
$ csdx cm:stacks:seed --repo "account/repository"
|
|
44
|
+
|
|
38
45
|
$ csdx cm:stacks:seed --repo "account/repository" --stack-api-key "stack-api-key" //seed content into specific stack
|
|
39
|
-
|
|
40
|
-
in given org uid
|
|
46
|
+
|
|
47
|
+
$ csdx cm:stacks:seed --repo "account/repository" --org "your-org-uid" --stack-name "stack-name" //create a new stack in given org uid
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## `csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]`
|
|
51
|
+
|
|
52
|
+
Create a stack from existing content types, entries, assets, etc
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
USAGE
|
|
56
|
+
$ csdx cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]
|
|
57
|
+
|
|
58
|
+
FLAGS
|
|
59
|
+
-k, --stack-api-key=<value> Provide stack api key to seed content to
|
|
60
|
+
-n, --stack-name=<value> Name of a new stack that needs to be created.
|
|
61
|
+
-o, --org=<value> Provide Organization UID to create a new stack
|
|
62
|
+
-r, --repo=<value> GitHub account or GitHub account/repository
|
|
63
|
+
-s, --stack=<value> Provide stack UID to seed content to
|
|
64
|
+
-y, --yes=<value> [Optional] Skip stack confirmation
|
|
65
|
+
|
|
66
|
+
DESCRIPTION
|
|
67
|
+
Create a stack from existing content types, entries, assets, etc
|
|
68
|
+
|
|
69
|
+
ALIASES
|
|
70
|
+
$ csdx cm:seed
|
|
71
|
+
|
|
72
|
+
EXAMPLES
|
|
73
|
+
$ csdx cm:stacks:seed
|
|
74
|
+
|
|
75
|
+
$ csdx cm:stacks:seed --repo "account"
|
|
76
|
+
|
|
77
|
+
$ csdx cm:stacks:seed --repo "account/repository"
|
|
78
|
+
|
|
79
|
+
$ csdx cm:stacks:seed --repo "account/repository" --stack-api-key "stack-api-key" //seed content into specific stack
|
|
80
|
+
|
|
81
|
+
$ csdx cm:stacks:seed --repo "account/repository" --org "your-org-uid" --stack-name "stack-name" //create a new stack in given org uid
|
|
41
82
|
```
|
|
42
83
|
|
|
43
84
|
_See code: [src/commands/cm/stacks/seed.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-seed/src/commands/cm/stacks/seed.ts)_
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Command
|
|
1
|
+
import { Command } from '@contentstack/cli-command';
|
|
2
2
|
export default class SeedCommand extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static usage: string;
|
|
6
6
|
static flags: {
|
|
7
|
-
repo:
|
|
8
|
-
org:
|
|
9
|
-
'stack-api-key':
|
|
10
|
-
'stack-name':
|
|
11
|
-
'fetch-limit':
|
|
12
|
-
yes:
|
|
13
|
-
stack:
|
|
7
|
+
repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
org: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
'stack-api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
+
'stack-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
+
'fetch-limit': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
+
yes: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
13
|
+
stack: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
14
14
|
};
|
|
15
15
|
static aliases: string[];
|
|
16
16
|
run(): Promise<{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const cli_command_1 = require("@contentstack/cli-command");
|
|
4
|
-
const seed_1 = require("../../../seed");
|
|
5
4
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
5
|
+
const seed_1 = require("../../../seed");
|
|
6
6
|
class SeedCommand extends cli_command_1.Command {
|
|
7
7
|
async run() {
|
|
8
8
|
try {
|
|
9
|
-
const { flags: seedFlags } = this.parse(SeedCommand);
|
|
9
|
+
const { flags: seedFlags } = await this.parse(SeedCommand);
|
|
10
10
|
if (!this.authToken) {
|
|
11
11
|
this.error('You need to login, first. See: auth:login --help', {
|
|
12
12
|
exit: 2,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ContentstackManagementSDK from '@contentstack/management';
|
|
2
2
|
export interface Organization {
|
|
3
3
|
uid: string;
|
|
4
4
|
name: string;
|
|
@@ -18,13 +18,13 @@ export interface CreateStackOptions {
|
|
|
18
18
|
org_uid: string;
|
|
19
19
|
}
|
|
20
20
|
export default class ContentstackClient {
|
|
21
|
-
instance:
|
|
21
|
+
instance: Promise<ContentstackManagementSDK.ContentstackClient>;
|
|
22
22
|
limit: number;
|
|
23
|
-
constructor(cmaHost: string,
|
|
23
|
+
constructor(cmaHost: string, limit: number);
|
|
24
24
|
getOrganization(org_uid: string): Promise<Organization>;
|
|
25
|
-
getOrganizations(): Promise<Organization[]>;
|
|
25
|
+
getOrganizations(skip?: number, organizations?: Organization[]): Promise<Organization[]>;
|
|
26
26
|
getStack(stackUID: string): Promise<Stack>;
|
|
27
|
-
getStacks(org_uid: string): Promise<Stack[]>;
|
|
27
|
+
getStacks(org_uid: string, skip?: number, stacks?: Stack[]): Promise<Stack[]>;
|
|
28
28
|
getContentTypeCount(api_key: string): Promise<number>;
|
|
29
29
|
createStack(options: CreateStackOptions): Promise<Stack>;
|
|
30
30
|
private buildError;
|
|
@@ -1,46 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const axios = require('axios');
|
|
4
3
|
const error_1 = require("./error");
|
|
4
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
5
5
|
class ContentstackClient {
|
|
6
|
-
constructor(cmaHost,
|
|
7
|
-
this.instance =
|
|
8
|
-
baseURL: `https://${cmaHost}/v3/`,
|
|
9
|
-
headers: {
|
|
10
|
-
authtoken: authToken,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
6
|
+
constructor(cmaHost, limit) {
|
|
7
|
+
this.instance = (0, cli_utilities_1.managementSDKClient)({ host: cmaHost });
|
|
13
8
|
this.limit = limit || 100;
|
|
14
9
|
}
|
|
15
10
|
async getOrganization(org_uid) {
|
|
16
11
|
try {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
12
|
+
const client = await this.instance;
|
|
13
|
+
const response = await client.organization(org_uid).fetch();
|
|
19
14
|
return {
|
|
20
|
-
uid:
|
|
21
|
-
name:
|
|
22
|
-
enabled:
|
|
15
|
+
uid: response.uid,
|
|
16
|
+
name: response.name,
|
|
17
|
+
enabled: response.enabled,
|
|
23
18
|
};
|
|
24
19
|
}
|
|
25
20
|
catch (error) {
|
|
26
21
|
throw this.buildError(error);
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
|
-
async getOrganizations() {
|
|
24
|
+
async getOrganizations(skip = 0, organizations = []) {
|
|
30
25
|
try {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
limit: this.limit,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return response.data.organizations.map((o) => {
|
|
26
|
+
const client = await this.instance;
|
|
27
|
+
const response = await client.organization().fetchAll({ limit: this.limit, asc: 'name', include_count: true, skip: skip });
|
|
28
|
+
organizations = organizations.concat(response.items.map((o) => {
|
|
38
29
|
return {
|
|
39
30
|
uid: o.uid,
|
|
40
31
|
name: o.name,
|
|
41
32
|
enabled: o.enabled,
|
|
42
33
|
};
|
|
43
|
-
});
|
|
34
|
+
}));
|
|
35
|
+
if (organizations.length < response.count) {
|
|
36
|
+
organizations = await this.getOrganizations(skip + this.limit);
|
|
37
|
+
}
|
|
38
|
+
return organizations;
|
|
44
39
|
}
|
|
45
40
|
catch (error) {
|
|
46
41
|
throw this.buildError(error);
|
|
@@ -48,30 +43,25 @@ class ContentstackClient {
|
|
|
48
43
|
}
|
|
49
44
|
async getStack(stackUID) {
|
|
50
45
|
try {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
const s = response.data.stack;
|
|
46
|
+
const client = await this.instance;
|
|
47
|
+
const response = await client.stack({ api_key: stackUID }).fetch();
|
|
55
48
|
return {
|
|
56
|
-
uid:
|
|
57
|
-
name:
|
|
58
|
-
master_locale:
|
|
59
|
-
api_key:
|
|
60
|
-
org_uid:
|
|
49
|
+
uid: response.uid,
|
|
50
|
+
name: response.name,
|
|
51
|
+
master_locale: response.master_locale,
|
|
52
|
+
api_key: response.api_key,
|
|
53
|
+
org_uid: response.org_uid,
|
|
61
54
|
};
|
|
62
55
|
}
|
|
63
56
|
catch (error) {
|
|
64
57
|
throw this.buildError(error);
|
|
65
58
|
}
|
|
66
59
|
}
|
|
67
|
-
async getStacks(org_uid) {
|
|
60
|
+
async getStacks(org_uid, skip = 0, stacks = []) {
|
|
68
61
|
try {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
return response.data.stacks.map((s) => {
|
|
62
|
+
const client = await this.instance;
|
|
63
|
+
const response = await client.organization(org_uid).stacks({ limit: this.limit, include_count: true, skip: skip });
|
|
64
|
+
stacks = stacks.concat(response.items.map((s) => {
|
|
75
65
|
return {
|
|
76
66
|
uid: s.uid,
|
|
77
67
|
name: s.name,
|
|
@@ -79,7 +69,11 @@ class ContentstackClient {
|
|
|
79
69
|
api_key: s.api_key,
|
|
80
70
|
org_uid: s.org_uid,
|
|
81
71
|
};
|
|
82
|
-
});
|
|
72
|
+
}));
|
|
73
|
+
if (stacks.length < response.count) {
|
|
74
|
+
stacks = await this.getStacks(org_uid, skip + this.limit, stacks);
|
|
75
|
+
}
|
|
76
|
+
return stacks;
|
|
83
77
|
}
|
|
84
78
|
catch (error) {
|
|
85
79
|
throw this.buildError(error);
|
|
@@ -87,14 +81,9 @@ class ContentstackClient {
|
|
|
87
81
|
}
|
|
88
82
|
async getContentTypeCount(api_key) {
|
|
89
83
|
try {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
include_count: true,
|
|
94
|
-
},
|
|
95
|
-
headers: { api_key },
|
|
96
|
-
});
|
|
97
|
-
return response.data.count;
|
|
84
|
+
const client = await this.instance;
|
|
85
|
+
const response = await client.stack({ api_key: api_key }).contentType().query({ include_count: true }).find();
|
|
86
|
+
return response.count;
|
|
98
87
|
}
|
|
99
88
|
catch (error) {
|
|
100
89
|
throw this.buildError(error);
|
|
@@ -102,6 +91,7 @@ class ContentstackClient {
|
|
|
102
91
|
}
|
|
103
92
|
async createStack(options) {
|
|
104
93
|
try {
|
|
94
|
+
const client = await this.instance;
|
|
105
95
|
const body = {
|
|
106
96
|
stack: {
|
|
107
97
|
name: options.name,
|
|
@@ -109,19 +99,13 @@ class ContentstackClient {
|
|
|
109
99
|
master_locale: options.master_locale,
|
|
110
100
|
},
|
|
111
101
|
};
|
|
112
|
-
const response = await
|
|
113
|
-
headers: {
|
|
114
|
-
'Content-Type': 'application/json',
|
|
115
|
-
organization_uid: options.org_uid,
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
const stack = response.data.stack;
|
|
102
|
+
const response = await client.stack().create(body, { organization_uid: options.org_uid });
|
|
119
103
|
return {
|
|
120
|
-
uid:
|
|
121
|
-
api_key:
|
|
122
|
-
master_locale:
|
|
123
|
-
name:
|
|
124
|
-
org_uid:
|
|
104
|
+
uid: response.uid,
|
|
105
|
+
api_key: response.api_key,
|
|
106
|
+
master_locale: response.master_locale,
|
|
107
|
+
name: response.name,
|
|
108
|
+
org_uid: response.org_uid,
|
|
125
109
|
};
|
|
126
110
|
}
|
|
127
111
|
catch (error) {
|
|
@@ -13,6 +13,7 @@ export default class GitHubClient {
|
|
|
13
13
|
getAllRepos(count?: number): Promise<any>;
|
|
14
14
|
getLatest(repo: string, destination: string): Promise<void>;
|
|
15
15
|
makeHeadApiCall(repo: string): Promise<any>;
|
|
16
|
+
makeGetApiCall(repo: string): Promise<any>;
|
|
16
17
|
checkIfRepoExists(repo: string): Promise<boolean>;
|
|
17
18
|
getLatestTarballUrl(repo: string): Promise<any>;
|
|
18
19
|
streamRelease(url: string): Promise<Stream>;
|
|
@@ -54,6 +54,34 @@ class GitHubClient {
|
|
|
54
54
|
https.request(options, resolve).on('error', reject).end();
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
makeGetApiCall(repo) {
|
|
58
|
+
return new Promise((resolve, reject) => {
|
|
59
|
+
const { host, pathname } = new URL(this.gitHubRepoUrl);
|
|
60
|
+
const options = {
|
|
61
|
+
host,
|
|
62
|
+
method: 'GET',
|
|
63
|
+
path: `${pathname}/${repo}/contents`,
|
|
64
|
+
headers: { 'user-agent': 'node.js' },
|
|
65
|
+
};
|
|
66
|
+
https.request(options, (response) => {
|
|
67
|
+
let responseBody = '';
|
|
68
|
+
const data = { statusCode: response.statusCode, };
|
|
69
|
+
if (data.statusCode === 403) {
|
|
70
|
+
const xRateLimitReset = response.rawHeaders[response.rawHeaders.indexOf('X-RateLimit-Reset') + 1];
|
|
71
|
+
const startDate = (new Date()).getTime() / 1000;
|
|
72
|
+
const diffInSeconds = Number(xRateLimitReset) - startDate;
|
|
73
|
+
data.statusMessage = `Exceeded requests limit. Please try again after ${(diffInSeconds / 60).toFixed(1)} minutes.`;
|
|
74
|
+
}
|
|
75
|
+
response.on('data', (chunk) => {
|
|
76
|
+
responseBody += chunk.toString();
|
|
77
|
+
});
|
|
78
|
+
response.on('end', () => {
|
|
79
|
+
const body = JSON.parse(responseBody);
|
|
80
|
+
resolve(Object.assign(Object.assign({}, data), { data: body }));
|
|
81
|
+
});
|
|
82
|
+
}).on('error', reject).end();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
57
85
|
async checkIfRepoExists(repo) {
|
|
58
86
|
try {
|
|
59
87
|
/**
|
package/lib/seed/index.js
CHANGED
|
@@ -25,7 +25,7 @@ class ContentModelSeeder {
|
|
|
25
25
|
this.ghUsername = gh.username || DEFAULT_OWNER;
|
|
26
26
|
this.ghRepo = gh.repo;
|
|
27
27
|
const limit = Number(this.options.fetchLimit);
|
|
28
|
-
this.csClient = new client_1.default(options.cmaHost,
|
|
28
|
+
this.csClient = new client_1.default(options.cmaHost, limit);
|
|
29
29
|
this.ghClient = new client_2.default(this.ghUsername, DEFAULT_STACK_PATTERN);
|
|
30
30
|
}
|
|
31
31
|
async run() {
|
|
@@ -58,9 +58,18 @@ class ContentModelSeeder {
|
|
|
58
58
|
if (!this.ghRepo) {
|
|
59
59
|
await this.inquireGitHubRepo();
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
let repoExists = false;
|
|
62
|
+
let repoResponseData = {};
|
|
63
|
+
try {
|
|
64
|
+
const repoCheckResult = await this.ghClient.makeGetApiCall(this.ghRepo);
|
|
65
|
+
repoExists = repoCheckResult.statusCode === 200;
|
|
66
|
+
repoResponseData = { status: repoCheckResult.statusCode, statusMessage: repoCheckResult.statusMessage };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
62
71
|
if (repoExists === false) {
|
|
63
|
-
cli_utilities_1.cliux.error(`Could not find GitHub repository '${this.ghPath}'.`);
|
|
72
|
+
cli_utilities_1.cliux.error(repoResponseData.status === 403 ? repoResponseData.statusMessage : `Could not find GitHub repository '${this.ghPath}'.`);
|
|
64
73
|
if (this.parent)
|
|
65
74
|
this.parent.exit(1);
|
|
66
75
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": "1.2.0",
|
|
3
|
+
"commands": {
|
|
4
|
+
"cm:stacks:seed": {
|
|
5
|
+
"id": "cm:stacks:seed",
|
|
6
|
+
"description": "Create a stack from existing content types, entries, assets, etc",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"usage": "cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]",
|
|
9
|
+
"pluginName": "@contentstack/cli-cm-seed",
|
|
10
|
+
"pluginAlias": "@contentstack/cli-cm-seed",
|
|
11
|
+
"pluginType": "core",
|
|
12
|
+
"aliases": [
|
|
13
|
+
"cm:seed"
|
|
14
|
+
],
|
|
15
|
+
"examples": [
|
|
16
|
+
"$ csdx cm:stacks:seed",
|
|
17
|
+
"$ csdx cm:stacks:seed --repo \"account\"",
|
|
18
|
+
"$ csdx cm:stacks:seed --repo \"account/repository\"",
|
|
19
|
+
"$ csdx cm:stacks:seed --repo \"account/repository\" --stack-api-key \"stack-api-key\" //seed content into specific stack",
|
|
20
|
+
"$ csdx cm:stacks:seed --repo \"account/repository\" --org \"your-org-uid\" --stack-name \"stack-name\" //create a new stack in given org uid"
|
|
21
|
+
],
|
|
22
|
+
"flags": {
|
|
23
|
+
"repo": {
|
|
24
|
+
"name": "repo",
|
|
25
|
+
"type": "option",
|
|
26
|
+
"char": "r",
|
|
27
|
+
"description": "GitHub account or GitHub account/repository",
|
|
28
|
+
"required": false,
|
|
29
|
+
"multiple": false
|
|
30
|
+
},
|
|
31
|
+
"org": {
|
|
32
|
+
"name": "org",
|
|
33
|
+
"type": "option",
|
|
34
|
+
"char": "o",
|
|
35
|
+
"description": "Provide Organization UID to create a new stack",
|
|
36
|
+
"required": false,
|
|
37
|
+
"multiple": false,
|
|
38
|
+
"exclusive": [
|
|
39
|
+
"stack"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"stack-api-key": {
|
|
43
|
+
"name": "stack-api-key",
|
|
44
|
+
"type": "option",
|
|
45
|
+
"char": "k",
|
|
46
|
+
"description": "Provide stack api key to seed content to",
|
|
47
|
+
"required": false,
|
|
48
|
+
"multiple": false,
|
|
49
|
+
"exclusive": [
|
|
50
|
+
"org"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"stack-name": {
|
|
54
|
+
"name": "stack-name",
|
|
55
|
+
"type": "option",
|
|
56
|
+
"char": "n",
|
|
57
|
+
"description": "Name of a new stack that needs to be created.",
|
|
58
|
+
"required": false,
|
|
59
|
+
"multiple": false,
|
|
60
|
+
"exclusive": [
|
|
61
|
+
"stack"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"fetch-limit": {
|
|
65
|
+
"name": "fetch-limit",
|
|
66
|
+
"type": "option",
|
|
67
|
+
"char": "l",
|
|
68
|
+
"description": "Limit for number of Organizations or stacks to be fetched",
|
|
69
|
+
"hidden": true,
|
|
70
|
+
"required": false,
|
|
71
|
+
"multiple": false
|
|
72
|
+
},
|
|
73
|
+
"yes": {
|
|
74
|
+
"name": "yes",
|
|
75
|
+
"type": "option",
|
|
76
|
+
"char": "y",
|
|
77
|
+
"description": "[Optional] Skip stack confirmation",
|
|
78
|
+
"required": false,
|
|
79
|
+
"multiple": false
|
|
80
|
+
},
|
|
81
|
+
"stack": {
|
|
82
|
+
"name": "stack",
|
|
83
|
+
"type": "option",
|
|
84
|
+
"char": "s",
|
|
85
|
+
"description": "Provide stack UID to seed content to",
|
|
86
|
+
"required": false,
|
|
87
|
+
"multiple": false,
|
|
88
|
+
"exclusive": [
|
|
89
|
+
"org",
|
|
90
|
+
"name"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"args": {}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-seed",
|
|
3
3
|
"description": "create a Stack from existing content types, entries, assets, etc.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-cm-import": "^1.
|
|
9
|
-
"@contentstack/cli-command": "^1.0
|
|
10
|
-
"@contentstack/cli-utilities": "^1.0
|
|
11
|
-
"@
|
|
12
|
-
"@oclif/config": "^1.18.3",
|
|
8
|
+
"@contentstack/cli-cm-import": "^1.3.0",
|
|
9
|
+
"@contentstack/cli-command": "^1.1.0",
|
|
10
|
+
"@contentstack/cli-utilities": "^1.1.0",
|
|
11
|
+
"@contentstack/management": "^1.6.1",
|
|
13
12
|
"axios": "1.1.3",
|
|
14
13
|
"inquirer": "8.2.4",
|
|
15
14
|
"mkdirp": "^1.0.4",
|
|
16
15
|
"tar": "^6.0.5",
|
|
17
16
|
"tmp": "^0.2.1",
|
|
18
|
-
"tslib": "^
|
|
17
|
+
"tslib": "^2.4.1"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@oclif/dev-cli": "^1.
|
|
22
|
-
"@oclif/plugin-help": "^5.1.
|
|
20
|
+
"@oclif/dev-cli": "^1.26.10",
|
|
21
|
+
"@oclif/plugin-help": "^5.1.19",
|
|
23
22
|
"@types/inquirer": "^9.0.3",
|
|
24
23
|
"@types/jest": "^26.0.15",
|
|
25
24
|
"@types/mkdirp": "^1.0.1",
|
|
@@ -53,9 +52,6 @@
|
|
|
53
52
|
"oclif": {
|
|
54
53
|
"commands": "./lib/commands",
|
|
55
54
|
"bin": "csdx",
|
|
56
|
-
"devPlugins": [
|
|
57
|
-
"@oclif/plugin-help"
|
|
58
|
-
],
|
|
59
55
|
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-seed/<%- commandPath %>"
|
|
60
56
|
},
|
|
61
57
|
"csdxConfig": {
|
|
@@ -69,7 +65,7 @@
|
|
|
69
65
|
"pack": "npm pack --dry-run",
|
|
70
66
|
"postpack": "rm -f oclif.manifest.json",
|
|
71
67
|
"posttest": "eslint . --ext .ts --config .eslintrc",
|
|
72
|
-
"prepack": "rm -rf lib && tsc -b && oclif
|
|
73
|
-
"version": "oclif
|
|
68
|
+
"prepack": "rm -rf lib && tsc -b && oclif manifest && oclif readme",
|
|
69
|
+
"version": "oclif readme && git add README.md"
|
|
74
70
|
}
|
|
75
71
|
}
|