@contentstack/cli-cm-seed 1.0.11 → 1.0.12

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
@@ -34,7 +34,7 @@ EXAMPLES
34
34
  $ csdx cm:seed -r "account/repository" -o "your-org-uid" -n "stack-name" //create a new stack in given org uid
35
35
  ```
36
36
 
37
- _See code: [src/commands/cm/seed.ts](https://github.com/contentstack/cli/blob/v1.0.11/src/commands/cm/seed.ts)_
37
+ _See code: [src/commands/cm/seed.ts](https://github.com/contentstack/cli/blob/v1.0.12/src/commands/cm/seed.ts)_
38
38
  <!-- commandsstop -->
39
39
 
40
40
  ## Advanced Flags
@@ -5,19 +5,24 @@ const seed_1 = require("../../seed");
5
5
  class SeedCommand extends cli_command_1.Command {
6
6
  async run() {
7
7
  try {
8
- const { flags } = this.parse(SeedCommand);
8
+ const { flags: seedFlags } = this.parse(SeedCommand);
9
9
  if (!this.authToken) {
10
- this.error('You need to login, first. See: auth:login --help', { exit: 2, suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/'] });
10
+ this.error("You need to login, first. See: auth:login --help", {
11
+ exit: 2,
12
+ suggestions: [
13
+ "https://www.contentstack.com/docs/developers/cli/authentication/",
14
+ ],
15
+ });
11
16
  }
12
17
  const options = {
13
18
  cdaHost: this.cdaHost,
14
19
  cmaHost: this.cmaHost,
15
20
  authToken: this.authToken,
16
- gitHubPath: flags.repo,
17
- orgUid: flags.org,
18
- stackUid: flags.stack,
19
- stackName: flags['stack-name'],
20
- fetchLimit: flags['fetch-limit'],
21
+ gitHubPath: seedFlags.repo,
22
+ orgUid: seedFlags.org,
23
+ stackUid: seedFlags.stack,
24
+ stackName: seedFlags["stack-name"],
25
+ fetchLimit: seedFlags["fetch-limit"],
21
26
  };
22
27
  const seeder = new seed_1.default(options);
23
28
  const result = await seeder.run();
package/lib/seed/index.js CHANGED
@@ -70,7 +70,7 @@ class ContentModelSeeder {
70
70
  if (!organizations || organizations.length === 0) {
71
71
  throw new Error('You do not have access to any organizations. Please try again or ask an Administrator for assistance.');
72
72
  }
73
- organizationResponse = await interactive_1.inquireOrganization(organizations);
73
+ organizationResponse = await (0, interactive_1.inquireOrganization)(organizations);
74
74
  }
75
75
  if (this.options.stackUid) {
76
76
  const stack = await this.csClient.getStack(this.options.stackUid);
@@ -83,7 +83,7 @@ class ContentModelSeeder {
83
83
  }
84
84
  else {
85
85
  const stacks = await this.csClient.getStacks(organizationResponse.uid);
86
- stackResponse = await interactive_1.inquireStack(stacks, this.options.stackName);
86
+ stackResponse = await (0, interactive_1.inquireStack)(stacks, this.options.stackName);
87
87
  }
88
88
  return { organizationResponse, stackResponse };
89
89
  }
@@ -103,7 +103,7 @@ class ContentModelSeeder {
103
103
  async shouldProceed(api_key) {
104
104
  const count = await this.csClient.getContentTypeCount(api_key);
105
105
  if (count > 0) {
106
- const proceed = await interactive_1.inquireProceed();
106
+ const proceed = await (0, interactive_1.inquireProceed)();
107
107
  if (!proceed) {
108
108
  return false;
109
109
  }
@@ -135,7 +135,7 @@ class ContentModelSeeder {
135
135
  try {
136
136
  const allRepos = await this.ghClient.getAllRepos();
137
137
  const stackRepos = allRepos.filter((repo) => repo.name.startsWith(DEFAULT_STACK_PATTERN));
138
- const repoResponse = await interactive_1.inquireRepo(stackRepos);
138
+ const repoResponse = await (0, interactive_1.inquireRepo)(stackRepos);
139
139
  this.ghRepo = repoResponse.choice;
140
140
  }
141
141
  catch (error) {
@@ -1 +1 @@
1
- {"version":"1.0.11","commands":{"cm:seed":{"id":"cm:seed","description":"Create a Stack from existing content types, entries, assets, etc","pluginName":"@contentstack/cli-cm-seed","pluginType":"core","aliases":[],"examples":["$ csdx cm:seed","$ csdx cm:seed -r \"account\"","$ csdx cm:seed -r \"account/repository\"","$ csdx cm:seed -r \"account/repository\" -s \"stack-uid\" //seed content into specific stack","$ csdx cm:seed -r \"account/repository\" -o \"your-org-uid\" -n \"stack-name\" //create a new stack in given org uid"],"flags":{"repo":{"name":"repo","type":"option","char":"r","description":"GitHub account or GitHub account/repository","required":false},"org":{"name":"org","type":"option","char":"o","description":"Provide Organization UID to create a new stack","required":false},"stack":{"name":"stack","type":"option","char":"s","description":"Provide stack UID to seed content to","required":false},"stack-name":{"name":"stack-name","type":"option","char":"n","description":"Name of a new stack that needs to be created.","required":false},"fetch-limit":{"name":"fetch-limit","type":"option","char":"l","description":"Limit for number of Organizations or stacks to be fetched","hidden":true,"required":false}},"args":[]}}}
1
+ {"version":"1.0.12","commands":{"cm:seed":{"id":"cm:seed","description":"Create a Stack from existing content types, entries, assets, etc","pluginName":"@contentstack/cli-cm-seed","pluginType":"core","aliases":[],"examples":["$ csdx cm:seed","$ csdx cm:seed -r \"account\"","$ csdx cm:seed -r \"account/repository\"","$ csdx cm:seed -r \"account/repository\" -s \"stack-uid\" //seed content into specific stack","$ csdx cm:seed -r \"account/repository\" -o \"your-org-uid\" -n \"stack-name\" //create a new stack in given org uid"],"flags":{"repo":{"name":"repo","type":"option","char":"r","description":"GitHub account or GitHub account/repository","required":false},"org":{"name":"org","type":"option","char":"o","description":"Provide Organization UID to create a new stack","required":false},"stack":{"name":"stack","type":"option","char":"s","description":"Provide stack UID to seed content to","required":false},"stack-name":{"name":"stack-name","type":"option","char":"n","description":"Name of a new stack that needs to be created.","required":false},"fetch-limit":{"name":"fetch-limit","type":"option","char":"l","description":"Limit for number of Organizations or stacks to be fetched","hidden":true,"required":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.0.11",
4
+ "version": "1.0.12",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
@@ -33,7 +33,7 @@
33
33
  "jest": "^26.6.1",
34
34
  "ts-jest": "^26.4.2",
35
35
  "ts-node": "^8.10.2",
36
- "typescript": "^3.9.7"
36
+ "typescript": "^4.7.4"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=8.0.0"