@contentstack/apps-cli 1.6.0 → 1.6.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.
package/README.md CHANGED
@@ -16,34 +16,31 @@ $ csdx plugins:install @contentstack/apps-cli
16
16
  This plugin requires you to be authenticated using [csdx auth:login](https://www.contentstack.com/docs/developers/cli/authenticate-with-the-cli/).
17
17
 
18
18
  <!-- usage -->
19
-
20
19
  ```sh-session
21
20
  $ npm install -g @contentstack/apps-cli
22
21
  $ csdx COMMAND
23
22
  running command...
24
23
  $ csdx (--version|-v)
25
- @contentstack/apps-cli/1.6.0 darwin-arm64 node-v22.13.1
24
+ @contentstack/apps-cli/1.6.1 darwin-arm64 node-v18.20.2
26
25
  $ csdx --help [COMMAND]
27
26
  USAGE
28
27
  $ csdx COMMAND
29
28
  ...
30
29
  ```
31
-
32
30
  <!-- usagestop -->
33
31
 
34
32
  # Commands
35
33
 
36
34
  <!-- commands -->
37
-
38
- - [`csdx app`](#csdx-app)
39
- - [`csdx app:create`](#csdx-appcreate)
40
- - [`csdx app:delete`](#csdx-appdelete)
41
- - [`csdx app:deploy`](#csdx-appdeploy)
42
- - [`csdx app:get`](#csdx-appget)
43
- - [`csdx app:install`](#csdx-appinstall)
44
- - [`csdx app:reinstall`](#csdx-appreinstall)
45
- - [`csdx app:uninstall`](#csdx-appuninstall)
46
- - [`csdx app:update`](#csdx-appupdate)
35
+ * [`csdx app`](#csdx-app)
36
+ * [`csdx app:create`](#csdx-appcreate)
37
+ * [`csdx app:delete`](#csdx-appdelete)
38
+ * [`csdx app:deploy`](#csdx-appdeploy)
39
+ * [`csdx app:get`](#csdx-appget)
40
+ * [`csdx app:install`](#csdx-appinstall)
41
+ * [`csdx app:reinstall`](#csdx-appreinstall)
42
+ * [`csdx app:uninstall`](#csdx-appuninstall)
43
+ * [`csdx app:update`](#csdx-appupdate)
47
44
 
48
45
  ## `csdx app`
49
46
 
@@ -74,7 +71,7 @@ EXAMPLES
74
71
  $ csdx app:update
75
72
  ```
76
73
 
77
- _See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/index.ts)_
74
+ _See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/index.ts)_
78
75
 
79
76
  ## `csdx app:create`
80
77
 
@@ -114,7 +111,7 @@ EXAMPLES
114
111
  $ csdx app:create --name App-4 --app-type organization --org <UID> --boilerplate <Ecommerce App Boilerplate>
115
112
  ```
116
113
 
117
- _See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/create.ts)_
114
+ _See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/create.ts)_
118
115
 
119
116
  ## `csdx app:delete`
120
117
 
@@ -139,7 +136,7 @@ EXAMPLES
139
136
  $ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
140
137
  ```
141
138
 
142
- _See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/delete.ts)_
139
+ _See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/delete.ts)_
143
140
 
144
141
  ## `csdx app:deploy`
145
142
 
@@ -177,7 +174,7 @@ EXAMPLES
177
174
  $ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <hosting-with-launch> --launch-project <new> --config <config-path>
178
175
  ```
179
176
 
180
- _See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/deploy.ts)_
177
+ _See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/deploy.ts)_
181
178
 
182
179
  ## `csdx app:get`
183
180
 
@@ -207,7 +204,7 @@ EXAMPLES
207
204
  $ csdx app:get --org <value> --app-uid <value> --app-type organization
208
205
  ```
209
206
 
210
- _See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/get.ts)_
207
+ _See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/get.ts)_
211
208
 
212
209
  ## `csdx app:install`
213
210
 
@@ -233,7 +230,7 @@ EXAMPLES
233
230
  $ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
234
231
  ```
235
232
 
236
- _See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/install.ts)_
233
+ _See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/install.ts)_
237
234
 
238
235
  ## `csdx app:reinstall`
239
236
 
@@ -259,7 +256,7 @@ EXAMPLES
259
256
  $ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
260
257
  ```
261
258
 
262
- _See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/reinstall.ts)_
259
+ _See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/reinstall.ts)_
263
260
 
264
261
  ## `csdx app:uninstall`
265
262
 
@@ -286,7 +283,7 @@ EXAMPLES
286
283
  $ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
287
284
  ```
288
285
 
289
- _See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/uninstall.ts)_
286
+ _See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/uninstall.ts)_
290
287
 
291
288
  ## `csdx app:update`
292
289
 
@@ -309,6 +306,5 @@ EXAMPLES
309
306
  $ csdx app:update --app-manifest ./boilerplate/manifest.json
310
307
  ```
311
308
 
312
- _See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.6.0/src/commands/app/update.ts)_
313
-
309
+ _See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.6.1/src/commands/app/update.ts)_
314
310
  <!-- commandsstop -->
@@ -92,9 +92,6 @@ class Create extends base_command_1.BaseCommand {
92
92
  */
93
93
  async flagsPromptQueue() {
94
94
  var _a;
95
- if (this.sharedConfig.appName) {
96
- (0, util_1.validateAppName)(this.sharedConfig.appName);
97
- }
98
95
  let boilerplate = null;
99
96
  if ((0, isEmpty_1.default)(this.sharedConfig.boilerplateName)) {
100
97
  boilerplate = await (0, util_1.selectedBoilerplate)();
@@ -103,13 +100,20 @@ class Create extends base_command_1.BaseCommand {
103
100
  boilerplate = (await (0, util_1.validateBoilerplate)(this.sharedConfig.boilerplateName));
104
101
  }
105
102
  if (boilerplate) {
106
- let boilerplateName = this.sharedConfig.appName || boilerplate.name;
107
- if ((0, isEmpty_1.default)(this.sharedConfig.appName)) {
108
- boilerplateName = boilerplateName
109
- .toLowerCase()
110
- .replace(/ /g, "-")
111
- .substring(0, 20);
103
+ let appName = this.sharedConfig.appName;
104
+ if (!appName) {
105
+ appName = await cli_utilities_1.cliux.inquire({
106
+ type: "input",
107
+ name: "appName",
108
+ message: "Enter App Name",
109
+ default: boilerplate.name,
110
+ });
112
111
  }
112
+ (0, util_1.validateAppName)(appName);
113
+ const boilerplateName = appName
114
+ .toLowerCase()
115
+ .replace(/ /g, "-")
116
+ .substring(0, 20);
113
117
  this.sharedConfig.boilerplateName = boilerplateName;
114
118
  this.sharedConfig.appBoilerplateGithubUrl = boilerplate.link;
115
119
  this.sharedConfig.appName = boilerplateName;
@@ -37,7 +37,7 @@ class Deploy extends app_cli_base_command_1.AppCLIBaseCommand {
37
37
  await this.handleHostingWithLaunch(config, updateHostingPayload, projects);
38
38
  break;
39
39
  default:
40
- this.log("Please provide a valid Hosting Type.", "error");
40
+ this.log("Provide a valid hosting type.", "error");
41
41
  return;
42
42
  }
43
43
  if (this.flags["app-uid"]) {
@@ -125,7 +125,7 @@ class Deploy extends app_cli_base_command_1.AppCLIBaseCommand {
125
125
  url = await this.handleNewProject(config, updateHostingPayload);
126
126
  }
127
127
  else {
128
- this.log("Please provide a valid launch project.", "error");
128
+ this.log("Provide a valid Launch project.", "error");
129
129
  return;
130
130
  }
131
131
  this.flags["app-url"] = (0, util_1.formatUrl)(url);
@@ -130,8 +130,8 @@ class Update extends app_cli_base_command_1.AppCLIBaseCommand {
130
130
  * @memberof Create
131
131
  */
132
132
  async updateAppOnDeveloperHub() {
133
- let app = this.managementAppSdk
134
- .organization(this.orgUid)
133
+ let app = this.marketplaceAppSdk
134
+ .marketplace(this.orgUid)
135
135
  .app(this.manifestData.uid);
136
136
  app = Object.assign(app, this.manifestData);
137
137
  await app
@@ -2,21 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deployAppMsg = exports.reinstallAppMsg = exports.uninstallAppMsg = exports.installAppMsg = exports.deleteAppMsg = exports.getAppMsg = exports.appUpdate = exports.appCreate = exports.commonMsg = exports.errors = exports.$t = void 0;
4
4
  const errors = {
5
- NOT_EMPTY: "{value} cannot be empty.",
6
- INVALID_APP_ID: "Please enter a valid app UID.",
5
+ NOT_EMPTY: "{value} is required and cannot be empty.",
6
+ INVALID_APP_ID: "Enter a valid app UID.",
7
7
  ORG_UID_NOT_FOUND: "Organization UID not found. Please enter a valid organization UID.",
8
- BASE_URL_EMPTY: "Developer Hub URL cannot be empty.",
9
- INVALID_ORG_UID: "Please enter a valid organization UID.",
10
- PATH_NOT_FOUND: "Failed to locate the provided path '{path}'. Please enter a valid path.",
11
- INVALID_NAME: "Please enter a valid name that is {min} to {max} characters long.",
12
- FILE_GENERATION_FAILURE: "Failed to generate the file! Please try running the command again.",
13
- APP_CREATION_FAILURE: "App could not be registered on Developer Hub.",
14
- APP_UID_NOT_MATCH: "Provided app UID is not matching with the app manifest.json app UID",
15
- APP_CREATION_CONSTRAINT_FAILURE: "App could not be registered. Please go through the constraints on the app name and try running the command again.",
16
- APP_CREATE_FAILURE_AND_ROLLBACK: "App creation should fail and rollback",
17
- APP_INVALID_ORG: "App could not be registered. Please verify the inputs and try again.",
18
- DUPLICATE_APP_NAME: "The {appName} app already exists. Please create an app with a different name.",
19
- INVALID_URL: "Please enter a valid URL. The URL should start with http:// or https://",
8
+ BASE_URL_EMPTY: "Developer Hub URL is required.",
9
+ INVALID_ORG_UID: "Enter a valid organization UID.",
10
+ PATH_NOT_FOUND: "Path {path} not found. Enter a valid path.",
11
+ INVALID_NAME: "Name must be between {min} and {max} characters.",
12
+ FILE_GENERATION_FAILURE: "File generation failed. Try running the command again.",
13
+ APP_CREATION_FAILURE: "Failed to register app on Developer Hub.",
14
+ APP_UID_NOT_MATCH: "App UID doesn't match the value in manifest.json.",
15
+ APP_CREATION_CONSTRAINT_FAILURE: "App registration failed. Check the name constraints and try again.",
16
+ APP_CREATE_FAILURE_AND_ROLLBACK: "App creation failed. Changes have been rolled back.",
17
+ APP_INVALID_ORG: "App registration failed. Verify the inputs and try again.",
18
+ DUPLICATE_APP_NAME: "App {appName} already exists. Use a different name.",
19
+ INVALID_URL: "Enter a valid URL starting with http:// or https://.",
20
20
  };
21
21
  exports.errors = errors;
22
22
  const commonMsg = {
@@ -29,10 +29,10 @@ const commonMsg = {
29
29
  DEVELOPER_HUB_URL_PROMPT: "Enter the Developer Hub Base URL for the {name} region: ",
30
30
  APP_UID: "Provide the app UID of an existing app.",
31
31
  APP_TYPE_DESCRIPTION: "Type of app",
32
- CONTACT_SUPPORT: "Please contact the support team.",
32
+ CONTACT_SUPPORT: "Contact the support team for help.",
33
33
  STACK_API_KEY: "API key of the stack where the app operation is to be performed.",
34
34
  USER_TERMINATION: "Process terminated by the user.",
35
- CLI_APP_CLI_LOGIN_FAILED: 'You are not logged in. Please login with command $ csdx auth:login'
35
+ CLI_APP_CLI_LOGIN_FAILED: "You're not logged in. Run $ csdx auth:login to continue."
36
36
  };
37
37
  exports.commonMsg = commonMsg;
38
38
  const appCreate = {
@@ -118,7 +118,7 @@ const deployAppMsg = {
118
118
  HOSTING_TYPE: "Choose a valid Hosting Type.",
119
119
  CONFIG_FILE: "[optional] Please enter the path of the config file.",
120
120
  APP_UPDATE_TERMINATION_MSG: "The app is already connected to the Launch project. Skipping the app hosting updates process.",
121
- DISCONNECT_PROJECT: "Are you sure you wan to disconnect the Launch project?",
121
+ DISCONNECT_PROJECT: "Disconnect the Launch project? This action can't be undone.",
122
122
  PROJECT_NOT_FOUND: "We couldn't find the project. Please enter a valid project name.",
123
123
  PROJECT_NAME_CONFLICT_FAILED: "Unable to resolve the project name conflict."
124
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/apps-cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "App ClI",
5
5
  "author": "Contentstack CLI",
6
6
  "homepage": "https://github.com/contentstack/contentstack-apps-cli",
@@ -84,7 +84,8 @@
84
84
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
85
85
  "version": "oclif readme && git add README.md",
86
86
  "clean": "rm -rf ./lib tsconfig.tsbuildinfo oclif.manifest.json",
87
- "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
87
+ "test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"",
88
+ "test:unit:report:json": "mocha --reporter json --reporter-options output=report.json --forbid-only \"test/unit/**/*.test.ts\" && nyc --reporter=clover --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
88
89
  },
89
90
  "engines": {
90
91
  "node": ">=16"