zcatalyst-cli 1.20.0 → 1.20.1

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.
@@ -49,7 +49,7 @@ exports.default = new command_1.default('ds:import [file]')
49
49
  const env = (0, option_1.getOptionValue)('production', false) ? 'Production' : 'Development';
50
50
  const configPath = (0, option_1.getOptionValue)('config', false);
51
51
  const importConfig = configPath ? yield getWriteConfigFromPath(configPath) : {};
52
- const tableId = (0, option_1.getOptionValue)('table', importConfig.table_identifier + '');
52
+ const tableId = (0, option_1.getOptionValue)('table', importConfig.table_identifier);
53
53
  if (!tableId) {
54
54
  throw new error_1.default('Table identifier missing', { exit: 0, errorId: 'IMP-1' });
55
55
  }
@@ -89,8 +89,9 @@ exports.default = new command_1.default('ds:import [file]')
89
89
  ]
90
90
  });
91
91
  }
92
+ const fileName = uploadFile ? (0, path_1.basename)(uploadFile) : '';
92
93
  try {
93
- yield bucketAPI.uploadObject(bucketName, uploadFile, fs_1.SYNC.getReadStream((0, path_1.resolve)(uploadFile)));
94
+ yield bucketAPI.uploadObject(bucketName, fileName, fs_1.SYNC.getReadStream((0, path_1.resolve)(uploadFile)));
94
95
  }
95
96
  catch (err) {
96
97
  throw new error_1.default('Error while uploading the object to the stratus. Use --verbose for error details', {
@@ -100,7 +101,7 @@ exports.default = new command_1.default('ds:import [file]')
100
101
  }
101
102
  const objDetail = {
102
103
  bucket_name: bucketName,
103
- object_key: uploadFile
104
+ object_key: fileName
104
105
  };
105
106
  importConfig.object_details = objDetail;
106
107
  }
@@ -109,7 +110,7 @@ exports.default = new command_1.default('ds:import [file]')
109
110
  }
110
111
  }
111
112
  const bulkAPI = yield (0, endpoints_1.bulkDSAPI)({ env });
112
- const writeResponse = (yield bulkAPI.write(tableId, importConfig));
113
+ const writeResponse = (yield bulkAPI.write(tableId + '', importConfig));
113
114
  (0, logger_1.info)();
114
115
  (0, logger_1.success)(`Successfully scheduled import job for table "${tableId}" with jobid "${writeResponse.job_id}"`);
115
116
  if ((0, env_1.isPrimaryShell)()) {
@@ -317,7 +317,7 @@ function pack(target) {
317
317
  const tmpDir = (0, path_1.join)((0, os_1.tmpdir)(), '.catalyst', 'python', target.name + Date.now().toString());
318
318
  yield fs_1.ASYNC.ensureDir(tmpDir);
319
319
  yield fs_1.ASYNC.emptyDir(tmpDir);
320
- yield (0, pip_install_1.installRequirements)(reqFile, tmpDir, target.stack.replace('python_', ''), (0, os_1.platform)() === 'linux');
320
+ yield (0, pip_install_1.installRequirements)(reqFile, tmpDir, target.stack.replace('python_', ''), true);
321
321
  const files = yield fs_1.ASYNC.walk(tmpDir);
322
322
  files.forEach((file) => {
323
323
  zip.add(file.path.replace(tmpDir + path_1.sep, ''), file.stats.isSymbolicLink()
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.removeRequirements = exports.validate = void 0;
39
39
  const ansi_colors_1 = require("ansi-colors");
40
- const os_1 = __importStar(require("os"));
40
+ const os_1 = require("os");
41
41
  const path_1 = __importStar(require("path"));
42
42
  const error_1 = __importDefault(require("../../error"));
43
43
  const ensure_python_1 = require("../../init/dependencies/python/ensure-python");
@@ -111,7 +111,7 @@ function removeRequirements(reqFile, target) {
111
111
  const tmpDir = (0, path_1.join)((0, os_1.tmpdir)(), '.catalyst', 'python', Date.now().toString());
112
112
  yield fs_1.ASYNC.ensureDir(tmpDir);
113
113
  yield fs_1.ASYNC.emptyDir(tmpDir);
114
- yield (0, pip_install_1.installRequirements)(reqFile, tmpDir, (_a = target.stack) === null || _a === void 0 ? void 0 : _a.replace('python_', ''), os_1.default.platform() === 'linux');
114
+ yield (0, pip_install_1.installRequirements)(reqFile, tmpDir, (_a = target.stack) === null || _a === void 0 ? void 0 : _a.replace('python_', ''), true);
115
115
  const files = yield fs_1.ASYNC.walk(tmpDir, { depth: 1, includeDirPaths: true });
116
116
  yield Promise.all(files.map((file) => __awaiter(this, void 0, void 0, function* () {
117
117
  yield fs_1.ASYNC.deleteFile((0, path_1.join)(target.source, path_1.default.basename(file.path)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcatalyst-cli",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
4
4
  "description": "Command Line Tool for CATALYST",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -7,17 +7,22 @@ const VERSION = PACKAGE_JSON.version;
7
7
  const NPM_REGISTRY_LINK = process.env.NPM_REGISTRY_LINK;
8
8
  const RELEASE_NOTES_LINK = process.env.RELEASE_NOTES_LINK;
9
9
  const API_KEY = process.env.API_KEY;
10
+ const MERGE_REQUEST_ID = process.env.CI_MERGE_REQUEST_IID;
11
+ const BOT_NAME = 'dxupdates';
10
12
 
11
13
  const INSTALL_COMMAND = `npm install -g zcatalyst-cli@${VERSION}`;
12
14
  const CHANNEL_NAMES = (process.env.CHANNEL_NAMES || '').split(',');
13
15
 
14
16
  const notify = async () => {
17
+ let text = `Hey Team, we've released a new version of [ZCatalyst-CLI](${NPM_REGISTRY_LINK}) :fireworks: \n\n *Version:* \`v${VERSION}\``;
18
+
19
+ if (MERGE_REQUEST_ID) {
20
+ text =
21
+ text +
22
+ `\n* [Pipeline status](https://git.csez.zohocorpin.com/BaaS/ZCatalyst-CLI/-/merge_requests/${MERGE_REQUEST_ID}/pipelines)`;
23
+ }
15
24
  const message = {
16
- text: `Hey Team, we've released a new version of [ZCatalyst-CLI](${NPM_REGISTRY_LINK}) :fireworks: \n\n *Version:* \`v${VERSION}\``,
17
- bot: {
18
- name: 'Dx Tools Update',
19
- image: 'https://www.zohowebstatic.com/sites/default/files/catalyst/catalyst-logo.svg'
20
- },
25
+ text,
21
26
  card: {
22
27
  title: 'Announcement',
23
28
  thumbnail: 'https://public-catlab-development.zohostratus.in/megaphone.gif',
@@ -48,7 +53,7 @@ const notify = async () => {
48
53
  try {
49
54
  const reqOpts = {
50
55
  hostname: 'cliq.zoho.com',
51
- path: `/company/64396901/api/v2/channelsbyname/${channel}/message?zapikey=${API_KEY}`,
56
+ path: `/company/64396901/api/v2/channelsbyname/${channel}/message?zapikey=${API_KEY}&bot_unique_name=${BOT_NAME}`,
52
57
  qs: {},
53
58
  method: 'POST',
54
59
  headers: {