zcatalyst-cli 1.20.0 → 1.20.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.
@@ -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()
@@ -414,7 +414,9 @@ function resolveAllFnServePort(targets) {
414
414
  }
415
415
  const httpPort = yield port_resolver_1.default.getPort(curTargetType, 'http', {
416
416
  name: target.name,
417
- duplicateCheck: curTargetType === constants_1.FN_TYPE.advanced || curTargetType === constants_1.FN_TYPE.browserLogic
417
+ duplicateCheck: curTargetType === constants_1.FN_TYPE.advanced ||
418
+ curTargetType === constants_1.FN_TYPE.browserLogic,
419
+ searchSpan: constants_1.DEFAULT.serve_port.search_span.http_port
418
420
  });
419
421
  if (curTargetType === constants_1.FN_TYPE.basic) {
420
422
  runtime_store_1.default.set('context.port.http.' + constants_1.FN_TYPE.basic, httpPort);
@@ -445,7 +447,8 @@ function resolveAllFnPorts(targets) {
445
447
  case 'functions:shell': {
446
448
  if (runtime_store_1.default.get('context.port.http.' + constants_1.FN_TYPE.basic, false)) {
447
449
  const bioHttpPort = yield port_resolver_1.default.getPort('bio', 'http', {
448
- duplicateCheck: false
450
+ duplicateCheck: false,
451
+ searchSpan: constants_1.DEFAULT.serve_port.search_span.http_port
449
452
  });
450
453
  runtime_store_1.default.set('context.port.http.' + constants_1.FN_TYPE.basic, bioHttpPort);
451
454
  }
@@ -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)));
@@ -17,6 +17,7 @@ const error_1 = __importDefault(require("../../error"));
17
17
  const port_resolver_1 = __importDefault(require("../../port-resolver"));
18
18
  const runtime_store_1 = __importDefault(require("../../runtime-store"));
19
19
  const config_1 = require("../../util_modules/config");
20
+ const constants_1 = require("../../util_modules/constants");
20
21
  const logger_1 = require("../../util_modules/logger");
21
22
  exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
22
23
  const allTargets = yield config_1.appSailConfig.getAllTargetDetails();
@@ -39,7 +40,8 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
39
40
  });
40
41
  const appsailPort = yield port_resolver_1.default.getPort('appsail', 'http', {
41
42
  name: targ.name + '_proxy',
42
- server: 'service'
43
+ server: 'service',
44
+ searchSpan: constants_1.DEFAULT.serve_port.search_span.http_port
43
45
  });
44
46
  return Object.assign(Object.assign({}, targ), { port: { appsail: appsailPort, proxy: proxyPort }, trigger: { kill: false } });
45
47
  })));
@@ -55,7 +55,10 @@ function client() {
55
55
  return;
56
56
  }
57
57
  const clientName = runtime_store_1.default.get('context.client.name');
58
- const finalPort = yield port_resolver_1.default.getPort('client', 'http', { name: clientName });
58
+ const finalPort = yield port_resolver_1.default.getPort('client', 'http', {
59
+ name: clientName,
60
+ searchSpan: constants_1.DEFAULT.serve_port.search_span.http_port
61
+ });
59
62
  runtime_store_1.default.set('context.port.http.client.' + clientName, finalPort);
60
63
  });
61
64
  }
@@ -17,6 +17,7 @@ const port_resolver_1 = __importDefault(require("../../port-resolver"));
17
17
  const runtime_store_1 = __importDefault(require("../../runtime-store"));
18
18
  const slate_utils_1 = require("../../slate-utils");
19
19
  const config_1 = require("../../util_modules/config");
20
+ const constants_1 = require("../../util_modules/constants");
20
21
  const logger_1 = require("../../util_modules/logger");
21
22
  exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
22
23
  const allTargets = yield config_1.slateConfig.getAllTargetDetails();
@@ -39,7 +40,8 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
39
40
  });
40
41
  const slatePort = yield port_resolver_1.default.getPort('slate', 'http', {
41
42
  name: targ.name + '_proxy',
42
- server: 'service'
43
+ server: 'service',
44
+ searchSpan: constants_1.DEFAULT.serve_port.search_span.http_port
43
45
  });
44
46
  return Object.assign(Object.assign({}, targ), { port: { slate: slatePort, proxy: proxyPort }, trigger: { kill: false } });
45
47
  })));
@@ -32,6 +32,9 @@ exports.default = Object.freeze({
32
32
  browser_logic: 8400,
33
33
  appsail: -1,
34
34
  client: -1
35
+ },
36
+ search_span: {
37
+ http_port: 200
35
38
  }
36
39
  },
37
40
  event_bus: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcatalyst-cli",
3
- "version": "1.20.0",
3
+ "version": "1.20.2",
4
4
  "description": "Command Line Tool for CATALYST",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -7,13 +7,21 @@ 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;
10
11
 
11
12
  const INSTALL_COMMAND = `npm install -g zcatalyst-cli@${VERSION}`;
12
13
  const CHANNEL_NAMES = (process.env.CHANNEL_NAMES || '').split(',');
13
14
 
14
15
  const notify = async () => {
16
+ let text = `Hey Team, we've released a new version of [ZCatalyst-CLI](${NPM_REGISTRY_LINK}) :fireworks: \n\n *Version:* \`v${VERSION}\``;
17
+
18
+ if (MERGE_REQUEST_ID) {
19
+ text =
20
+ text +
21
+ `\n* [Pipeline status](https://git.csez.zohocorpin.com/BaaS/ZCatalyst-CLI/-/merge_requests/${MERGE_REQUEST_ID}/pipelines)`;
22
+ }
15
23
  const message = {
16
- text: `Hey Team, we've released a new version of [ZCatalyst-CLI](${NPM_REGISTRY_LINK}) :fireworks: \n\n *Version:* \`v${VERSION}\``,
24
+ text,
17
25
  bot: {
18
26
  name: 'Dx Tools Update',
19
27
  image: 'https://www.zohowebstatic.com/sites/default/files/catalyst/catalyst-logo.svg'