@contentstack/cli-cm-seed 1.4.0 → 1.4.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.
@@ -1,17 +1,10 @@
1
1
  import { Command } from '@contentstack/cli-command';
2
+ import { FlagInput } from '@contentstack/cli-utilities';
2
3
  export default class SeedCommand extends Command {
3
4
  static description: string;
4
5
  static examples: string[];
5
6
  static usage: string;
6
- static flags: {
7
- repo: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- org: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- 'stack-api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- 'stack-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- 'fetch-limit': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- yes: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- stack: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- };
7
+ static flags: FlagInput;
15
8
  static aliases: string[];
16
9
  run(): Promise<{
17
10
  api_key: string;
@@ -7,7 +7,7 @@ class SeedCommand extends cli_command_1.Command {
7
7
  async run() {
8
8
  try {
9
9
  const { flags: seedFlags } = await this.parse(SeedCommand);
10
- if (!this.authToken) {
10
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
11
11
  this.error('You need to login, first. See: auth:login --help', {
12
12
  exit: 2,
13
13
  suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/'],
@@ -17,13 +17,13 @@ class SeedCommand extends cli_command_1.Command {
17
17
  parent: this,
18
18
  cdaHost: this.cdaHost,
19
19
  cmaHost: this.cmaHost,
20
- authToken: this.authToken,
21
20
  gitHubPath: seedFlags.repo,
22
21
  orgUid: seedFlags.org,
23
22
  stackUid: seedFlags['stack-api-key'] || seedFlags.stack,
24
23
  stackName: seedFlags['stack-name'],
25
24
  fetchLimit: seedFlags['fetch-limit'],
26
25
  skipStackConfirmation: seedFlags['yes'],
26
+ isAuthenticated: await (0, cli_utilities_1.isAuthenticated)(),
27
27
  };
28
28
  const seeder = new seed_1.default(options);
29
29
  const result = await seeder.run();
@@ -1,9 +1,9 @@
1
1
  export interface ImporterOptions {
2
2
  master_locale: string;
3
- authToken: string;
4
3
  api_key: string;
5
4
  tmpPath: string;
6
5
  cmaHost: string;
7
6
  cdaHost: string;
7
+ isAuthenticated: boolean;
8
8
  }
9
9
  export declare function run(options: ImporterOptions): Promise<void>;
@@ -5,13 +5,13 @@ export interface ContentModelSeederOptions {
5
5
  parent?: any;
6
6
  cdaHost: string;
7
7
  cmaHost: string;
8
- authToken: string;
9
8
  gitHubPath: string | undefined;
10
9
  orgUid: string | undefined;
11
10
  stackUid: string | undefined;
12
11
  stackName: string | undefined;
13
12
  fetchLimit: string | undefined;
14
13
  skipStackConfirmation: string | undefined;
14
+ isAuthenticated: boolean | false;
15
15
  }
16
16
  export default class ContentModelSeeder {
17
17
  options: ContentModelSeederOptions;
package/lib/seed/index.js CHANGED
@@ -46,11 +46,11 @@ class ContentModelSeeder {
46
46
  cli_utilities_1.cliux.print(`Importing into '${stackResponse.name}'.`);
47
47
  await importer.run({
48
48
  api_key: api_key,
49
- authToken: this.options.authToken,
50
49
  cdaHost: this.options.cdaHost,
51
50
  cmaHost: this.options.cmaHost,
52
51
  master_locale: exports.ENGLISH_LOCALE,
53
52
  tmpPath: tmpPath,
53
+ isAuthenticated: this.options.isAuthenticated,
54
54
  });
55
55
  return { api_key };
56
56
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.0",
2
+ "version": "1.4.2",
3
3
  "commands": {
4
4
  "cm:stacks:seed": {
5
5
  "id": "cm:stacks:seed",
package/package.json CHANGED
@@ -1,14 +1,13 @@
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.0",
4
+ "version": "1.4.2",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-cm-import": "^1.4.1",
9
- "@contentstack/cli-command": "^1.2.1",
10
- "@contentstack/cli-utilities": "^1.2.1",
11
- "@contentstack/management": "^1.6.1",
8
+ "@contentstack/cli-cm-import": "^1.5.2",
9
+ "@contentstack/cli-command": "^1.2.3",
10
+ "@contentstack/cli-utilities": "^1.4.0",
12
11
  "@oclif/core": "^2.3.0",
13
12
  "axios": "1.3.4",
14
13
  "inquirer": "8.2.4",
@@ -30,7 +29,7 @@
30
29
  "eslint-config-oclif-typescript": "^0.1.0",
31
30
  "globby": "^10.0.2",
32
31
  "jest": "^29.4.2",
33
- "oclif": "^3.1.2",
32
+ "oclif": "^3.8.1",
34
33
  "ts-jest": "^29.0.5",
35
34
  "ts-node": "^8.10.2",
36
35
  "typescript": "^4.9.3"
@@ -74,4 +73,4 @@
74
73
  "version": "oclif readme && git add README.md",
75
74
  "clean": "rm -rf ./node_modules tsconfig.build.tsbuildinfo"
76
75
  }
77
- }
76
+ }