@contentstack/cli-cm-seed 1.2.0 → 1.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Contentstack
3
+ Copyright (c) 2023 Contentstack
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -4,13 +4,13 @@ export default class SeedCommand extends Command {
4
4
  static examples: string[];
5
5
  static usage: string;
6
6
  static flags: {
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>;
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
14
  };
15
15
  static aliases: string[];
16
16
  run(): Promise<{
@@ -46,14 +46,14 @@ SeedCommand.examples = [
46
46
  ];
47
47
  SeedCommand.usage = 'cm:stacks:seed [--repo <value>] [--org <value>] [-k <value>] [-n <value>] [-y <value>] [-s <value>]';
48
48
  SeedCommand.flags = {
49
- repo: cli_command_1.flags.string({
49
+ repo: cli_utilities_1.flags.string({
50
50
  char: 'r',
51
51
  description: 'GitHub account or GitHub account/repository',
52
52
  multiple: false,
53
53
  required: false,
54
54
  parse: (0, cli_utilities_1.printFlagDeprecation)(['-r'], ['--repo']),
55
55
  }),
56
- org: cli_command_1.flags.string({
56
+ org: cli_utilities_1.flags.string({
57
57
  char: 'o',
58
58
  description: 'Provide Organization UID to create a new stack',
59
59
  multiple: false,
@@ -61,34 +61,34 @@ SeedCommand.flags = {
61
61
  exclusive: ['stack'],
62
62
  parse: (0, cli_utilities_1.printFlagDeprecation)(['-o'], ['--org']),
63
63
  }),
64
- 'stack-api-key': cli_command_1.flags.string({
64
+ 'stack-api-key': cli_utilities_1.flags.string({
65
65
  char: 'k',
66
66
  description: 'Provide stack api key to seed content to',
67
67
  multiple: false,
68
68
  required: false,
69
69
  exclusive: ['org'],
70
70
  }),
71
- 'stack-name': cli_command_1.flags.string({
71
+ 'stack-name': cli_utilities_1.flags.string({
72
72
  char: 'n',
73
73
  description: 'Name of a new stack that needs to be created.',
74
74
  multiple: false,
75
75
  required: false,
76
76
  exclusive: ['stack'],
77
77
  }),
78
- 'fetch-limit': cli_command_1.flags.string({
78
+ 'fetch-limit': cli_utilities_1.flags.string({
79
79
  char: 'l',
80
80
  description: 'Limit for number of Organizations or stacks to be fetched',
81
81
  multiple: false,
82
82
  required: false,
83
83
  hidden: true,
84
84
  }),
85
- yes: cli_command_1.flags.string({
85
+ yes: cli_utilities_1.flags.string({
86
86
  char: 'y',
87
87
  required: false,
88
88
  description: '[Optional] Skip stack confirmation',
89
89
  }),
90
90
  //To be deprecated
91
- stack: cli_command_1.flags.string({
91
+ stack: cli_utilities_1.flags.string({
92
92
  char: 's',
93
93
  description: 'Provide stack UID to seed content to',
94
94
  multiple: false,
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // @ts-nocheck
3
4
  const error_1 = require("./error");
4
5
  const cli_utilities_1 = require("@contentstack/cli-utilities");
5
6
  class ContentstackClient {
@@ -60,7 +61,15 @@ class ContentstackClient {
60
61
  async getStacks(org_uid, skip = 0, stacks = []) {
61
62
  try {
62
63
  const client = await this.instance;
63
- const response = await client.organization(org_uid).stacks({ limit: this.limit, include_count: true, skip: skip });
64
+ const response = await client
65
+ .stack({ organization_uid: org_uid })
66
+ .query({
67
+ limit: this.limit,
68
+ include_count: true,
69
+ skip: skip,
70
+ query: {}
71
+ })
72
+ .find();
64
73
  stacks = stacks.concat(response.items.map((s) => {
65
74
  return {
66
75
  uid: s.uid,
@@ -9,6 +9,6 @@ async function run(options) {
9
9
  process.chdir(options.tmpPath);
10
10
  // moving here to fix jest testing bug
11
11
  const { parametersWithAuthToken } = require('@contentstack/cli-cm-import/src/lib/util/import-flags');
12
- await parametersWithAuthToken(options.authToken, options.api_key, importPath, '', options.cmaHost, '', {});
12
+ await parametersWithAuthToken(options.api_key, importPath, '', options.cmaHost, '', {});
13
13
  }
14
14
  exports.run = run;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0",
2
+ "version": "1.4.0",
3
3
  "commands": {
4
4
  "cm:stacks:seed": {
5
5
  "id": "cm:stacks:seed",
package/package.json CHANGED
@@ -1,41 +1,42 @@
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.2.0",
4
+ "version": "1.4.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-cm-import": "^1.3.0",
9
- "@contentstack/cli-command": "^1.1.0",
10
- "@contentstack/cli-utilities": "^1.1.0",
8
+ "@contentstack/cli-cm-import": "^1.4.1",
9
+ "@contentstack/cli-command": "^1.2.1",
10
+ "@contentstack/cli-utilities": "^1.2.1",
11
11
  "@contentstack/management": "^1.6.1",
12
- "axios": "1.1.3",
12
+ "@oclif/core": "^2.3.0",
13
+ "axios": "1.3.4",
13
14
  "inquirer": "8.2.4",
14
15
  "mkdirp": "^1.0.4",
15
- "tar": "^6.0.5",
16
+ "tar": "^6.1.13",
16
17
  "tmp": "^0.2.1",
17
18
  "tslib": "^2.4.1"
18
19
  },
19
20
  "devDependencies": {
20
- "@oclif/dev-cli": "^1.26.10",
21
21
  "@oclif/plugin-help": "^5.1.19",
22
22
  "@types/inquirer": "^9.0.3",
23
23
  "@types/jest": "^26.0.15",
24
24
  "@types/mkdirp": "^1.0.1",
25
25
  "@types/node": "^14.14.32",
26
- "@types/tar": "^4.0.3",
26
+ "@types/tar": "^6.1.3",
27
27
  "@types/tmp": "^0.2.0",
28
28
  "eslint": "^8.18.0",
29
- "eslint-config-oclif": "^3.1.0",
29
+ "eslint-config-oclif": "^4.0.0",
30
30
  "eslint-config-oclif-typescript": "^0.1.0",
31
31
  "globby": "^10.0.2",
32
- "jest": "^26.6.1",
33
- "ts-jest": "^26.4.2",
32
+ "jest": "^29.4.2",
33
+ "oclif": "^3.1.2",
34
+ "ts-jest": "^29.0.5",
34
35
  "ts-node": "^8.10.2",
35
36
  "typescript": "^4.9.3"
36
37
  },
37
38
  "engines": {
38
- "node": ">=8.0.0"
39
+ "node": ">=14.0.0"
39
40
  },
40
41
  "files": [
41
42
  "/lib",
@@ -57,6 +58,10 @@
57
58
  "csdxConfig": {
58
59
  "expiredCommands": {
59
60
  "cm:seed": "csdx cm:stacks:seed"
61
+ },
62
+ "shortCommandName": {
63
+ "cm:stacks:seed": "SEED",
64
+ "cm:seed": "O-SEED"
60
65
  }
61
66
  },
62
67
  "repository": "contentstack/cli",
@@ -66,6 +71,7 @@
66
71
  "postpack": "rm -f oclif.manifest.json",
67
72
  "posttest": "eslint . --ext .ts --config .eslintrc",
68
73
  "prepack": "rm -rf lib && tsc -b && oclif manifest && oclif readme",
69
- "version": "oclif readme && git add README.md"
74
+ "version": "oclif readme && git add README.md",
75
+ "clean": "rm -rf ./node_modules tsconfig.build.tsbuildinfo"
70
76
  }
71
77
  }