@contentstack/apps-cli 1.3.2 → 1.3.3

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
@@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli
20
20
  $ csdx COMMAND
21
21
  running command...
22
22
  $ csdx (--version|-v)
23
- @contentstack/apps-cli/1.3.2 darwin-arm64 node-v18.20.2
23
+ @contentstack/apps-cli/1.3.3 darwin-arm64 node-v18.12.1
24
24
  $ csdx --help [COMMAND]
25
25
  USAGE
26
26
  $ csdx COMMAND
@@ -69,7 +69,7 @@ EXAMPLES
69
69
  $ csdx app:update
70
70
  ```
71
71
 
72
- _See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/index.ts)_
72
+ _See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/index.ts)_
73
73
 
74
74
  ## `csdx app:create`
75
75
 
@@ -109,7 +109,7 @@ EXAMPLES
109
109
  $ csdx app:create --name App-4 --app-type organization --org <UID> --boilerplate <Ecommerce App Boilerplate>
110
110
  ```
111
111
 
112
- _See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/create.ts)_
112
+ _See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/create.ts)_
113
113
 
114
114
  ## `csdx app:delete`
115
115
 
@@ -134,7 +134,7 @@ EXAMPLES
134
134
  $ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
135
135
  ```
136
136
 
137
- _See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/delete.ts)_
137
+ _See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/delete.ts)_
138
138
 
139
139
  ## `csdx app:deploy`
140
140
 
@@ -172,7 +172,7 @@ EXAMPLES
172
172
  $ csdx app:deploy --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <new> --config <config-path>
173
173
  ```
174
174
 
175
- _See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/deploy.ts)_
175
+ _See code: [src/commands/app/deploy.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/deploy.ts)_
176
176
 
177
177
  ## `csdx app:get`
178
178
 
@@ -202,7 +202,7 @@ EXAMPLES
202
202
  $ csdx app:get --org <value> --app-uid <value> --app-type organization
203
203
  ```
204
204
 
205
- _See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/get.ts)_
205
+ _See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/get.ts)_
206
206
 
207
207
  ## `csdx app:install`
208
208
 
@@ -228,7 +228,7 @@ EXAMPLES
228
228
  $ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
229
229
  ```
230
230
 
231
- _See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/install.ts)_
231
+ _See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/install.ts)_
232
232
 
233
233
  ## `csdx app:reinstall`
234
234
 
@@ -254,7 +254,7 @@ EXAMPLES
254
254
  $ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
255
255
  ```
256
256
 
257
- _See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/reinstall.ts)_
257
+ _See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/reinstall.ts)_
258
258
 
259
259
  ## `csdx app:uninstall`
260
260
 
@@ -281,7 +281,7 @@ EXAMPLES
281
281
  $ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
282
282
  ```
283
283
 
284
- _See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/uninstall.ts)_
284
+ _See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/uninstall.ts)_
285
285
 
286
286
  ## `csdx app:update`
287
287
 
@@ -304,5 +304,5 @@ EXAMPLES
304
304
  $ csdx app:update --app-manifest ./boilerplate/manifest.json
305
305
  ```
306
306
 
307
- _See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.3.2/src/commands/app/update.ts)_
307
+ _See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.3.3/src/commands/app/update.ts)_
308
308
  <!-- commandsstop -->
@@ -96,8 +96,7 @@ class Deploy extends app_cli_base_command_1.AppCLIBaseCommand {
96
96
  * @returns {Promise<ApolloClient>} The Apollo Client instance.
97
97
  */
98
98
  async getApolloClient(projectUid = "") {
99
- const baseUrl = config_1.default.launchBaseUrl ||
100
- config_1.default.launchHubUrls[this.cmaAPIUrl];
99
+ const baseUrl = config_1.default.launchBaseUrl || (0, util_2.getLaunchHubUrl)();
101
100
  const manageApiBaseUrl = `${baseUrl}/${config_1.default.manageApiEndpoint}`;
102
101
  return await new util_1.GraphqlApiClient({
103
102
  headers: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.apiRequestHandler = void 0;
3
+ exports.apiRequestHandler = apiRequestHandler;
4
4
  const cli_utilities_1 = require("@contentstack/cli-utilities");
5
5
  const error_helper_1 = require("./error-helper");
6
6
  async function apiRequestHandler(params) {
@@ -49,4 +49,3 @@ async function apiRequestHandler(params) {
49
49
  throw error;
50
50
  }
51
51
  }
52
- exports.apiRequestHandler = apiRequestHandler;
@@ -1,6 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateBoilerplate = exports.fetchBoilerplateDetails = exports.handleProjectNameConflict = exports.formatUrl = exports.disconnectApp = exports.setupConfig = exports.getManifestDetails = exports.getProjects = exports.updateApp = exports.sanitizePath = exports.reinstallApp = exports.fetchInstalledApps = exports.uninstallApp = exports.fetchStack = exports.getStacks = exports.installApp = exports.deleteApp = exports.fetchAppInstallations = exports.fetchApp = exports.fetchApps = exports.getOrgAppUiLocation = exports.getOrganizations = void 0;
3
+ exports.handleProjectNameConflict = exports.sanitizePath = void 0;
4
+ exports.getOrganizations = getOrganizations;
5
+ exports.getOrgAppUiLocation = getOrgAppUiLocation;
6
+ exports.fetchApps = fetchApps;
7
+ exports.fetchApp = fetchApp;
8
+ exports.fetchAppInstallations = fetchAppInstallations;
9
+ exports.deleteApp = deleteApp;
10
+ exports.installApp = installApp;
11
+ exports.getStacks = getStacks;
12
+ exports.fetchStack = fetchStack;
13
+ exports.uninstallApp = uninstallApp;
14
+ exports.fetchInstalledApps = fetchInstalledApps;
15
+ exports.reinstallApp = reinstallApp;
16
+ exports.updateApp = updateApp;
17
+ exports.getProjects = getProjects;
18
+ exports.getManifestDetails = getManifestDetails;
19
+ exports.setupConfig = setupConfig;
20
+ exports.disconnectApp = disconnectApp;
21
+ exports.formatUrl = formatUrl;
22
+ exports.fetchBoilerplateDetails = fetchBoilerplateDetails;
23
+ exports.validateBoilerplate = validateBoilerplate;
4
24
  const tslib_1 = require("tslib");
5
25
  const map_1 = tslib_1.__importDefault(require("lodash/map"));
6
26
  const cli_utilities_1 = require("@contentstack/cli-utilities");
@@ -28,7 +48,6 @@ async function getOrganizations(options, skip = 0, organizations = []) {
28
48
  }
29
49
  return organizations;
30
50
  }
31
- exports.getOrganizations = getOrganizations;
32
51
  function getOrgAppUiLocation() {
33
52
  const orgConfigLocation = {
34
53
  type: types_1.AppLocation.ORG_CONFIG,
@@ -42,7 +61,6 @@ function getOrgAppUiLocation() {
42
61
  };
43
62
  return [orgConfigLocation];
44
63
  }
45
- exports.getOrgAppUiLocation = getOrgAppUiLocation;
46
64
  async function fetchApps(flags, orgUid, options, skip = 0, apps = []) {
47
65
  const { log, marketplaceSdk } = options;
48
66
  const response = await marketplaceSdk
@@ -67,7 +85,6 @@ async function fetchApps(flags, orgUid, options, skip = 0, apps = []) {
67
85
  }
68
86
  return apps;
69
87
  }
70
- exports.fetchApps = fetchApps;
71
88
  function fetchApp(flags, orgUid, options) {
72
89
  const { marketplaceSdk } = options;
73
90
  const app = flags["app-uid"];
@@ -76,7 +93,6 @@ function fetchApp(flags, orgUid, options) {
76
93
  .app(app)
77
94
  .fetch();
78
95
  }
79
- exports.fetchApp = fetchApp;
80
96
  function fetchAppInstallations(flags, orgUid, options) {
81
97
  const { managementSdk } = options;
82
98
  const app = flags["app-uid"];
@@ -92,7 +108,6 @@ function fetchAppInstallations(flags, orgUid, options) {
92
108
  throw error; // throwing error here instead of removing the catch block, as the loader needs to stopped in case there is an error.
93
109
  });
94
110
  }
95
- exports.fetchAppInstallations = fetchAppInstallations;
96
111
  function deleteApp(flags, orgUid, options) {
97
112
  const { marketplaceSdk } = options;
98
113
  const app = flags["app-uid"];
@@ -101,7 +116,6 @@ function deleteApp(flags, orgUid, options) {
101
116
  .app(app)
102
117
  .delete();
103
118
  }
104
- exports.deleteApp = deleteApp;
105
119
  function installApp(flags, orgUid, type, options) {
106
120
  const { marketplaceSdk } = options;
107
121
  return marketplaceSdk
@@ -112,7 +126,6 @@ function installApp(flags, orgUid, type, options) {
112
126
  targetType: type,
113
127
  });
114
128
  }
115
- exports.installApp = installApp;
116
129
  function reinstallApp(flags, orgUid, type, options) {
117
130
  const { marketplaceSdk } = options;
118
131
  return marketplaceSdk
@@ -123,14 +136,12 @@ function reinstallApp(flags, orgUid, type, options) {
123
136
  targetType: type,
124
137
  });
125
138
  }
126
- exports.reinstallApp = reinstallApp;
127
139
  function fetchStack(flags, options) {
128
140
  const { managementSdk } = options;
129
141
  return managementSdk
130
142
  .stack({ api_key: flags["stack-api-key"] })
131
143
  .fetch();
132
144
  }
133
- exports.fetchStack = fetchStack;
134
145
  async function getStacks(options, orgUid, skip = 0, stacks = []) {
135
146
  const { log, managementSdk } = options;
136
147
  const response = await managementSdk
@@ -150,7 +161,6 @@ async function getStacks(options, orgUid, skip = 0, stacks = []) {
150
161
  }
151
162
  return stacks;
152
163
  }
153
- exports.getStacks = getStacks;
154
164
  function uninstallApp(flags, orgUid, options, installationUid) {
155
165
  const { managementSdk } = options;
156
166
  const app = flags["app-uid"];
@@ -160,7 +170,6 @@ function uninstallApp(flags, orgUid, options, installationUid) {
160
170
  .installation(installationUid)
161
171
  .uninstall();
162
172
  }
163
- exports.uninstallApp = uninstallApp;
164
173
  async function fetchInstalledApps(flags, orgUid, options) {
165
174
  const { marketplaceSdk, log } = options;
166
175
  const apps = (await fetchApps(flags, orgUid, options)) || [];
@@ -198,7 +207,6 @@ async function fetchInstalledApps(flags, orgUid, options) {
198
207
  }
199
208
  return batchRequests.flat();
200
209
  }
201
- exports.fetchInstalledApps = fetchInstalledApps;
202
210
  // To remove the relative path
203
211
  const sanitizePath = (str) => str === null || str === void 0 ? void 0 : str.replace(/^(\.\.(\/|\\|$))+/, "");
204
212
  exports.sanitizePath = sanitizePath;
@@ -213,7 +221,6 @@ async function updateApp(flags, orgUid, options, updateReqPayload) {
213
221
  app = Object.assign(app, payload);
214
222
  await app.update();
215
223
  }
216
- exports.updateApp = updateApp;
217
224
  async function getProjects(apolloClient) {
218
225
  const projects = await apolloClient
219
226
  .query({ query: queries_1.projectsQuery, variables: { query: {} } })
@@ -229,7 +236,6 @@ async function getProjects(apolloClient) {
229
236
  });
230
237
  });
231
238
  }
232
- exports.getProjects = getProjects;
233
239
  function getManifestDetails(flags, orgUid, options) {
234
240
  const { managementSdk } = options;
235
241
  const app = flags["app-uid"];
@@ -238,7 +244,6 @@ function getManifestDetails(flags, orgUid, options) {
238
244
  .app(app)
239
245
  .hosting();
240
246
  }
241
- exports.getManifestDetails = getManifestDetails;
242
247
  function setupConfig(configPath) {
243
248
  const configDetails = {};
244
249
  if (configPath) {
@@ -253,7 +258,6 @@ function setupConfig(configPath) {
253
258
  }
254
259
  return configDetails;
255
260
  }
256
- exports.setupConfig = setupConfig;
257
261
  async function disconnectApp(flags, orgUid, options) {
258
262
  const { marketplaceSdk } = options;
259
263
  return marketplaceSdk
@@ -262,11 +266,9 @@ async function disconnectApp(flags, orgUid, options) {
262
266
  .hosting()
263
267
  .disconnect({ provider: "launch" });
264
268
  }
265
- exports.disconnectApp = disconnectApp;
266
269
  function formatUrl(url) {
267
270
  return url ? (url.startsWith("https") ? url : `https://${url}`) : "";
268
271
  }
269
- exports.formatUrl = formatUrl;
270
272
  const handleProjectNameConflict = async (projectName, projects, retry = 1) => {
271
273
  if (retry > 3) {
272
274
  throw new Error(messages_1.deployAppMsg.PROJECT_NAME_CONFLICT_FAILED);
@@ -289,7 +291,6 @@ async function fetchBoilerplateDetails() {
289
291
  throw error;
290
292
  }
291
293
  }
292
- exports.fetchBoilerplateDetails = fetchBoilerplateDetails;
293
294
  async function validateBoilerplate(boilerplateName) {
294
295
  const boilerplates = await fetchBoilerplateDetails();
295
296
  const boilerplate = (0, find_1.default)(boilerplates, (boilerplate) => boilerplate.name === boilerplateName);
@@ -298,4 +299,3 @@ async function validateBoilerplate(boilerplateName) {
298
299
  }
299
300
  return boilerplate;
300
301
  }
301
- exports.validateBoilerplate = validateBoilerplate;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatErrors = void 0;
3
+ exports.formatErrors = formatErrors;
4
4
  function formatErrors(errors) {
5
5
  let errorMessage = "";
6
6
  if (errors.message) {
@@ -8,4 +8,3 @@ function formatErrors(errors) {
8
8
  }
9
9
  return errorMessage;
10
10
  }
11
- exports.formatErrors = formatErrors;
package/lib/util/fs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeFile = void 0;
3
+ exports.writeFile = writeFile;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_1 = require("fs");
6
6
  const path_1 = require("path");
@@ -26,7 +26,6 @@ async function writeFile(dir = process.cwd(), force = false, data = {}, log = co
26
26
  await (0, fs_1.writeFileSync)(target, JSON.stringify(data));
27
27
  log((0, messages_1.$t)(messages_1.default.FILE_WRITTEN_SUCCESS, { file: target }), "info");
28
28
  }
29
- exports.writeFile = writeFile;
30
29
  async function ensureDirectoryExists(dir) {
31
30
  if (!(0, fs_1.existsSync)(dir)) {
32
31
  await (0, fs_1.mkdirSync)(dir, { recursive: true });
@@ -41,4 +41,5 @@ declare function askConfirmation(): Promise<boolean>;
41
41
  declare const askProjectName: (projectName: string) => Promise<string>;
42
42
  declare const selectedBoilerplate: () => Promise<any>;
43
43
  declare const validateAppName: (name: string) => void;
44
- export { getOrg, getAppName, getDirName, getDeveloperHubUrl, getApp, getInstalledApps, getStack, getInstallation, getHostingType, getAppUrl, askProjectType, askConfirmation, selectProject, askProjectName, selectedBoilerplate, validateAppName, };
44
+ declare function getLaunchHubUrl(): string;
45
+ export { getOrg, getAppName, getDirName, getDeveloperHubUrl, getApp, getInstalledApps, getStack, getInstallation, getHostingType, getAppUrl, askProjectType, askConfirmation, selectProject, askProjectName, selectedBoilerplate, validateAppName, getLaunchHubUrl, };
@@ -1,6 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateAppName = exports.selectedBoilerplate = exports.askProjectName = exports.selectProject = exports.askConfirmation = exports.askProjectType = exports.getAppUrl = exports.getHostingType = exports.getInstallation = exports.getStack = exports.getInstalledApps = exports.getApp = exports.getDeveloperHubUrl = exports.getDirName = exports.getAppName = exports.getOrg = void 0;
3
+ exports.validateAppName = exports.selectedBoilerplate = exports.askProjectName = exports.askProjectType = void 0;
4
+ exports.getOrg = getOrg;
5
+ exports.getAppName = getAppName;
6
+ exports.getDirName = getDirName;
7
+ exports.getDeveloperHubUrl = getDeveloperHubUrl;
8
+ exports.getApp = getApp;
9
+ exports.getInstalledApps = getInstalledApps;
10
+ exports.getStack = getStack;
11
+ exports.getInstallation = getInstallation;
12
+ exports.getHostingType = getHostingType;
13
+ exports.getAppUrl = getAppUrl;
14
+ exports.askConfirmation = askConfirmation;
15
+ exports.selectProject = selectProject;
16
+ exports.getLaunchHubUrl = getLaunchHubUrl;
4
17
  const tslib_1 = require("tslib");
5
18
  const find_1 = tslib_1.__importDefault(require("lodash/find"));
6
19
  const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
@@ -28,7 +41,6 @@ async function getAppName(defaultName = "") {
28
41
  },
29
42
  });
30
43
  }
31
- exports.getAppName = getAppName;
32
44
  /**
33
45
  * @method getDirName
34
46
  *
@@ -56,7 +68,6 @@ async function getDirName(path) {
56
68
  })
57
69
  .then((name) => (0, path_1.join)((0, common_utils_1.sanitizePath)(basePath), (0, common_utils_1.sanitizePath)(name)));
58
70
  }
59
- exports.getDirName = getDirName;
60
71
  /**
61
72
  * @method getOrg
62
73
  *
@@ -82,7 +93,6 @@ async function getOrg(flags, options) {
82
93
  }
83
94
  return orgUid;
84
95
  }
85
- exports.getOrg = getOrg;
86
96
  async function getApp(flags, orgUid, options) {
87
97
  cli_utilities_1.cliux.loader("Loading Apps");
88
98
  const apps = await (0, common_utils_1.fetchApps)(flags, orgUid, options);
@@ -100,7 +110,6 @@ async function getApp(flags, orgUid, options) {
100
110
  .then((name) => { var _a; return (_a = apps.find((app) => app.name === name)) === null || _a === void 0 ? void 0 : _a.uid; });
101
111
  return apps.find((app) => app.uid === flags.app);
102
112
  }
103
- exports.getApp = getApp;
104
113
  async function getInstalledApps(flags, orgUid, options) {
105
114
  cli_utilities_1.cliux.loader("Loading Apps");
106
115
  const apps = await (0, common_utils_1.fetchInstalledApps)(flags, orgUid, options);
@@ -118,7 +127,6 @@ async function getInstalledApps(flags, orgUid, options) {
118
127
  .then((name) => { var _a; return (_a = apps.find((app) => app.name === name)) === null || _a === void 0 ? void 0 : _a.uid; });
119
128
  return apps.find((app) => app.uid === flags.app);
120
129
  }
121
- exports.getInstalledApps = getInstalledApps;
122
130
  /**
123
131
  * @method getDeveloperHubUrl
124
132
  *
@@ -141,7 +149,6 @@ function getDeveloperHubUrl() {
141
149
  : developerHubBaseUrl;
142
150
  return developerHubBaseUrl;
143
151
  }
144
- exports.getDeveloperHubUrl = getDeveloperHubUrl;
145
152
  async function getStack(orgUid, options) {
146
153
  cli_utilities_1.cliux.loader("Loading Stacks");
147
154
  const stacks = (await (0, common_utils_1.getStacks)(options, orgUid)) || [];
@@ -160,7 +167,6 @@ async function getStack(orgUid, options) {
160
167
  .then((name) => stacks.find((stack) => stack.name === name));
161
168
  return selectedStack;
162
169
  }
163
- exports.getStack = getStack;
164
170
  async function getInstallation(flags, orgUid, managementSdkForStacks, appType, options, uninstallAll) {
165
171
  var _a;
166
172
  const { log } = options;
@@ -207,7 +213,6 @@ async function getInstallation(flags, orgUid, managementSdkForStacks, appType, o
207
213
  }), "info");
208
214
  return selectedInstallation;
209
215
  }
210
- exports.getInstallation = getInstallation;
211
216
  function populateMissingDataInInstallations(installations, stacks) {
212
217
  let result = installations.map((installation) => {
213
218
  var _a;
@@ -234,7 +239,6 @@ async function getHostingType() {
234
239
  choices: hostingTypes,
235
240
  });
236
241
  }
237
- exports.getHostingType = getHostingType;
238
242
  async function getAppUrl(defaultUrl = "") {
239
243
  return cli_utilities_1.cliux.inquire({
240
244
  type: "input",
@@ -253,7 +257,6 @@ async function getAppUrl(defaultUrl = "") {
253
257
  },
254
258
  });
255
259
  }
256
- exports.getAppUrl = getAppUrl;
257
260
  async function selectProject(projects) {
258
261
  return await cli_utilities_1.cliux
259
262
  .inquire({
@@ -264,7 +267,6 @@ async function selectProject(projects) {
264
267
  })
265
268
  .then((name) => (0, find_1.default)(projects, { name }));
266
269
  }
267
- exports.selectProject = selectProject;
268
270
  const askProjectType = async () => {
269
271
  return await cli_utilities_1.cliux.inquire({
270
272
  type: "list",
@@ -284,7 +286,6 @@ async function askConfirmation() {
284
286
  name: "disconnect_launch_confirmation",
285
287
  });
286
288
  }
287
- exports.askConfirmation = askConfirmation;
288
289
  const askProjectName = async (projectName) => {
289
290
  return await cli_utilities_1.cliux.inquire({
290
291
  type: "input",
@@ -320,3 +321,16 @@ const validateAppName = (name) => {
320
321
  }
321
322
  };
322
323
  exports.validateAppName = validateAppName;
324
+ function getLaunchHubUrl() {
325
+ const { cma } = cli_utilities_1.configHandler.get('region') || {};
326
+ if (!cma) {
327
+ throw new Error('Region not configured. Please set the region with command $ csdx config:set:region');
328
+ }
329
+ let launchHubBaseUrl = cma.replace('api', 'launch-api');
330
+ if (launchHubBaseUrl.startsWith('http')) {
331
+ launchHubBaseUrl = launchHubBaseUrl.split('//')[1];
332
+ }
333
+ launchHubBaseUrl = launchHubBaseUrl.startsWith('dev11') ? launchHubBaseUrl.replace('dev11', 'dev') : launchHubBaseUrl;
334
+ launchHubBaseUrl = launchHubBaseUrl.endsWith('io') ? launchHubBaseUrl.replace('io', 'com') : launchHubBaseUrl;
335
+ return `https://${launchHubBaseUrl}`;
336
+ }
package/lib/util/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.print = void 0;
3
+ exports.print = print;
4
4
  const tslib_1 = require("tslib");
5
5
  const map_1 = tslib_1.__importDefault(require("lodash/map"));
6
6
  const winston_1 = tslib_1.__importDefault(require("winston"));
@@ -147,4 +147,3 @@ function print(printInput) {
147
147
  }).join(" ");
148
148
  cli_utilities_1.cliux.print(str);
149
149
  }
150
- exports.print = print;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentstack/apps-cli",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "App ClI",
5
5
  "author": "Contentstack CLI",
6
6
  "homepage": "https://github.com/contentstack/contentstack-apps-cli",
@@ -21,16 +21,15 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.7.9",
24
- "@contentstack/cli-command": "^1.2.18",
25
- "@contentstack/cli-launch": "^1.0.18",
26
- "@contentstack/cli-utilities": "^1.7.0",
27
- "adm-zip": "^0.5.10",
24
+ "@contentstack/cli-command": "~1.2.19",
25
+ "@contentstack/cli-launch": "~1.2.0",
26
+ "@contentstack/cli-utilities": "~1.7.0",
27
+ "adm-zip": "^0.5.15",
28
28
  "chalk": "^4.1.2",
29
29
  "lodash": "^4.17.21",
30
- "open": "^9.1.0",
31
30
  "shelljs": "^0.8.5",
32
- "tmp": "^0.2.2",
33
- "winston": "^3.11.0"
31
+ "tmp": "^0.2.3",
32
+ "winston": "^3.12.0"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@oclif/test": "^2.5.6",
@@ -38,13 +37,13 @@
38
37
  "@types/chai": "^4.3.11",
39
38
  "@types/lodash": "^4.17.4",
40
39
  "@types/mocha": "^10.0.6",
41
- "@types/node": "^20.10.7",
40
+ "@types/node": "^20.15.0",
42
41
  "@types/shelljs": "^0.8.15",
43
42
  "@types/tmp": "^0.2.6",
44
- "axios": "^1.6.5",
43
+ "axios": "^1.7.4",
45
44
  "chai": "^4.3.10",
46
- "dotenv": "^16.3.1",
47
- "eslint": "^8.56.0",
45
+ "dotenv": "^16.4.5",
46
+ "eslint": "^8.57.0",
48
47
  "eslint-config-oclif": "^5.0.0",
49
48
  "eslint-config-oclif-typescript": "^3.1.0",
50
49
  "mocha": "^10.2.0",