zcatalyst-cli 1.13.3 → 1.14.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.
Files changed (162) hide show
  1. package/docs/client-utils.toml +6 -1
  2. package/docs/commands/ds/import.toml +5 -0
  3. package/docs/fn-utils/lib/python.toml +4 -0
  4. package/docs/init/dependencies/python/ensure-python.toml +12 -0
  5. package/docs/init/dependencies/python/pip-install.toml +4 -0
  6. package/docs/serve/index.toml +5 -0
  7. package/lib/authentication/login.js +2 -1
  8. package/lib/cli_table/index.js +26 -2
  9. package/lib/cli_table/src/cell.js +359 -267
  10. package/lib/cli_table/src/layout-manager.js +231 -209
  11. package/lib/cli_table/src/table.js +76 -60
  12. package/lib/cli_table/src/utils.js +259 -224
  13. package/lib/client-utils.js +18 -4
  14. package/lib/command_needs/rc.js +57 -8
  15. package/lib/commands/config/delete.js +23 -0
  16. package/lib/commands/config/get.js +23 -0
  17. package/lib/commands/config/list.js +23 -0
  18. package/lib/commands/config/set.js +29 -0
  19. package/lib/commands/console/cache.js +31 -1
  20. package/lib/commands/console/queue.js +31 -1
  21. package/lib/commands/console/zcql.js +27 -1
  22. package/lib/commands/ds/export.js +2 -2
  23. package/lib/commands/ds/import.js +25 -5
  24. package/lib/commands/ds/status.js +2 -2
  25. package/lib/commands/iac/export.js +1 -1
  26. package/lib/commands/iac/import.js +1 -1
  27. package/lib/commands/iac/pack.js +16 -5
  28. package/lib/commands/iac/status.js +1 -1
  29. package/lib/commands/index.js +4 -0
  30. package/lib/commands/project/list.js +1 -1
  31. package/lib/commands/project/use.js +1 -1
  32. package/lib/deploy/features/client.js +2 -2
  33. package/lib/deploy/features/functions/index.js +13 -3
  34. package/lib/deploy/features/functions/languages/index.js +19 -2
  35. package/lib/endpoints/index.js +12 -5
  36. package/lib/endpoints/lib/env.js +5 -2
  37. package/lib/endpoints/lib/functions.js +30 -0
  38. package/lib/endpoints/lib/org.js +35 -0
  39. package/lib/endpoints/lib/project.js +7 -3
  40. package/lib/express_middlewares/unknownReqProxy.js +4 -1
  41. package/lib/fn-utils/index.js +2 -0
  42. package/lib/fn-utils/lib/common.js +68 -7
  43. package/lib/fn-utils/lib/integ.js +15 -11
  44. package/lib/fn-utils/lib/java.js +7 -3
  45. package/lib/fn-utils/lib/python.js +121 -0
  46. package/lib/fn-watcher.js +10 -2
  47. package/lib/index.js +2 -1
  48. package/lib/init/dependencies/python/ensure-python.js +151 -0
  49. package/lib/init/dependencies/python/pip-install.js +189 -0
  50. package/lib/init/features/functions/index.js +50 -29
  51. package/lib/init/features/functions/languages/index.js +3 -1
  52. package/lib/init/features/functions/languages/python.js +115 -0
  53. package/lib/init/features/index.js +2 -2
  54. package/lib/init/features/project.js +26 -6
  55. package/lib/init/util/project.js +2 -2
  56. package/lib/internal/api.js +2 -0
  57. package/lib/internal/command.js +1 -1
  58. package/lib/internal/rc.js +2 -0
  59. package/lib/port-resolver.js +4 -3
  60. package/lib/prompt/types/file-path.js +1 -1
  61. package/lib/pull/features/functions/index.js +35 -2
  62. package/lib/pull/features/functions/languages.js +8 -1
  63. package/lib/readLineUtils.js +37 -1
  64. package/lib/readline/features/cache.js +175 -1
  65. package/lib/readline/features/index.js +7 -1
  66. package/lib/readline/features/queue.js +209 -1
  67. package/lib/readline/features/zcql.js +237 -1
  68. package/lib/readline/index.js +30 -1
  69. package/lib/serve/index.js +48 -7
  70. package/lib/serve/server/index.js +118 -44
  71. package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
  72. package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
  73. package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
  74. package/lib/serve/server/lib/master.js +18 -5
  75. package/lib/serve/server/lib/node.mjs +41 -0
  76. package/lib/serve/server/lib/web_client/index.js +7 -3
  77. package/lib/serve/server/lib/web_client/server.js +31 -15
  78. package/lib/shell/dependencies/http-functions.js +57 -21
  79. package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +1 -2
  80. package/lib/shell/dependencies/invoker/bio/node.mjs +127 -0
  81. package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +1 -1
  82. package/lib/shell/dependencies/invoker/cron/node.mjs +87 -0
  83. package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +3 -3
  84. package/lib/shell/dependencies/invoker/event/node.mjs +84 -0
  85. package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +1 -1
  86. package/lib/shell/dependencies/invoker/integ/node.mjs +88 -0
  87. package/lib/shell/dependencies/local-function.js +74 -22
  88. package/lib/shell/index.js +11 -2
  89. package/lib/shell/prepare/index.js +21 -0
  90. package/lib/shell/prepare/languages/index.js +8 -2
  91. package/lib/shell/prepare/languages/java.js +39 -2
  92. package/lib/shell/prepare/languages/node.js +21 -2
  93. package/lib/shell/prepare/languages/python.js +65 -0
  94. package/lib/throbber/index.js +3 -1
  95. package/lib/userConfig.js +48 -0
  96. package/lib/util_modules/constants/index.js +3 -1
  97. package/lib/util_modules/constants/lib/apig-rules.js +8 -0
  98. package/lib/util_modules/constants/lib/cliq-handlers.js +17 -1
  99. package/lib/util_modules/constants/lib/dc-type.js +8 -0
  100. package/lib/util_modules/constants/lib/default.js +2 -2
  101. package/lib/util_modules/constants/lib/env-path.js +12 -0
  102. package/lib/util_modules/constants/lib/file-names.js +4 -1
  103. package/lib/util_modules/constants/lib/folder-names.js +3 -1
  104. package/lib/util_modules/constants/lib/placeholders.js +6 -1
  105. package/lib/util_modules/constants/lib/runtime.js +2 -1
  106. package/lib/util_modules/constants/lib/scopes.js +1 -0
  107. package/lib/util_modules/constants/lib/template.js +9 -0
  108. package/lib/util_modules/constants/lib/urls.js +2 -6
  109. package/lib/util_modules/context-help.js +2 -0
  110. package/lib/util_modules/fs/lib/async.js +35 -11
  111. package/lib/util_modules/project.js +20 -1
  112. package/package.json +2 -1
  113. package/templates/init/functions/java/aio/catalyst-config.json +3 -2
  114. package/templates/init/functions/java/bio/catalyst-config.json +3 -2
  115. package/templates/init/functions/java/cron/catalyst-config.json +3 -2
  116. package/templates/init/functions/java/event/catalyst-config.json +3 -2
  117. package/templates/init/functions/java/integ/cliq/catalyst-config.json +1 -0
  118. package/templates/init/functions/node/aio/catalyst-config.json +3 -2
  119. package/templates/init/functions/node/bio/catalyst-config.json +3 -2
  120. package/templates/init/functions/node/cron/catalyst-config.json +3 -2
  121. package/templates/init/functions/node/event/catalyst-config.json +3 -2
  122. package/templates/init/functions/node/integ/cliq/catalyst-config.json +1 -0
  123. package/templates/init/functions/node/integ/cliq/handlers/bot-handler.js +2 -2
  124. package/templates/init/functions/node/integ/cliq/handlers/command-handler.js +1 -2
  125. package/templates/init/functions/node/integ/cliq/handlers/function-handler.js +1 -1
  126. package/templates/init/functions/node/integ/cliq/handlers/installation-handler.js +1 -1
  127. package/templates/init/functions/node/integ/cliq/handlers/installation-validator.js +1 -1
  128. package/templates/init/functions/node/integ/cliq/handlers/message-action-handler.js +1 -1
  129. package/templates/init/functions/node/integ/cliq/handlers/widget-handler.js +1 -1
  130. package/templates/init/functions/node/integ/cliq/sample.js +4 -4
  131. package/templates/init/functions/python/aio/catalyst-config.json +11 -0
  132. package/templates/init/functions/python/aio/requirements.txt +1 -0
  133. package/templates/init/functions/python/aio/sample.py +26 -0
  134. package/templates/init/functions/python/bio/catalyst-config.json +11 -0
  135. package/templates/init/functions/python/bio/requirements.txt +1 -0
  136. package/templates/init/functions/python/bio/sample.py +6 -0
  137. package/templates/init/functions/python/cron/catalyst-config.json +11 -0
  138. package/templates/init/functions/python/cron/requirements.txt +1 -0
  139. package/templates/init/functions/python/cron/sample.py +18 -0
  140. package/templates/init/functions/python/event/catalyst-config.json +11 -0
  141. package/templates/init/functions/python/event/requirements.txt +1 -0
  142. package/templates/init/functions/python/event/sample.py +21 -0
  143. package/templates/init/functions/python/integ/cliq/catalyst-config.json +11 -0
  144. package/templates/init/functions/python/integ/cliq/handlers/bot_handler.py +174 -0
  145. package/templates/init/functions/python/integ/cliq/handlers/command_handler.py +102 -0
  146. package/templates/init/functions/python/integ/cliq/handlers/function_handler.py +409 -0
  147. package/templates/init/functions/python/integ/cliq/handlers/installation_handler.py +12 -0
  148. package/templates/init/functions/python/integ/cliq/handlers/installation_validator.py +16 -0
  149. package/templates/init/functions/python/integ/cliq/handlers/message_action_handler.py +18 -0
  150. package/templates/init/functions/python/integ/cliq/handlers/widget_handler.py +269 -0
  151. package/templates/init/functions/python/integ/cliq/requirements.txt +1 -0
  152. package/templates/init/functions/python/integ/cliq/sample.py +21 -0
  153. package/lib/serve/server/lib/node.js +0 -62
  154. package/lib/shell/dependencies/invoker/bio/node.js +0 -80
  155. package/lib/shell/dependencies/invoker/cron/node.js +0 -54
  156. package/lib/shell/dependencies/invoker/event/node.js +0 -56
  157. package/lib/shell/dependencies/invoker/integ/node.js +0 -79
  158. package/templates/.DS_Store +0 -0
  159. package/templates/init/.DS_Store +0 -0
  160. package/templates/init/client/.DS_Store +0 -0
  161. package/templates/init/client/react/.DS_Store +0 -0
  162. package/templates/init/functions/node/integ/cliq/.DS_Store +0 -0
@@ -15,7 +15,7 @@ link = 'https://www.zoho.com/catalyst/help/project-directory-structure.html#Clie
15
15
 
16
16
  [CLIENT-UTILS-4]
17
17
  context = '''The ${arg[0]} file seems to be corrupted.'''
18
- aid = '''Please ensure that, the values supplied with ${arg[1]} and ${arg[2]} are valid.'''
18
+ aid = '''Please ensure that, the values supplied with ${arg[1]} is valid.'''
19
19
  link = 'https://www.zoho.com/catalyst/help/project-directory-structure.html#Client'
20
20
 
21
21
  [CLIENT-UTILS-5]
@@ -27,3 +27,8 @@ link = ''
27
27
  context = '''Client Setup Skipped: Since the consent to overwrite the existing directory was not given.'''
28
28
  aid = '''Existing directory: ${arg[0]}'''
29
29
  link = ''
30
+
31
+ [CLIENT-UTILS-7]
32
+ context = '''${arg[0]} cannot be same as the ${arg[1]} page: ${arg[2]}'''
33
+ aid = '''Please configure a differnet value for ${arg[0]} page.'''
34
+ link = ''
@@ -13,3 +13,8 @@ link = 'https://www.zoho.com/catalyst/help/cli-import-export.html#CSV'
13
13
  context = '''No Folders present in the File Store! You must have atleast one folder in the File Store to upload the CSV file.'''
14
14
  aid = '''Please create atleast one folder in the Catalyst File Store to proceed.'''
15
15
  link = 'https://www.zoho.com/catalyst/help/file-store.html#Creating'
16
+
17
+ [IMP-4]
18
+ context = '''The folder ${arg[0]} specified in the ${arg[1]} config file does not exists in the Catalyst file store.'''
19
+ aid = '''Please specify the name of a folder that's already present in Catalyst file store. Alternatively, you can try uploading the ${arg[2]} file to a folder in the Catalyst file store and specify it's ${arg[3]} as ${arg[4]} in the ${arg[1]} config file.'''
20
+ link = 'https://catalyst.zoho.com/help/cli-import-export.html#Import_File_Format'
@@ -0,0 +1,4 @@
1
+ [PYTHON-1]
2
+ context = '''The main file ${arg[0]} mentioned in the ${arg[1]} file does not exists in the function(${arg[2]}) directory.'''
3
+ aid = '''Please specify a valid main file in the ${arg[1]} file.'''
4
+ link = 'https://www.zoho.com/catalyst/help/project-directory-structure.html#Python'
@@ -0,0 +1,12 @@
1
+ [PY-1]
2
+ context = '''unable to locate python${arg[0]} with the given path ${arg[1]}'''
3
+ aid = '''Please provide the valid binary path to spawn python${arg[0]}'''
4
+
5
+ [PIP]
6
+ context = '''unable to ensure pip for python${arg[0]}'''
7
+ aid = '''Please ensure whether pip installed in your system for python${arg[0]}'''
8
+ link = 'https://pip.pypa.io/en/stable/installation/#'
9
+
10
+ [PY-2]
11
+ context = '''unable to locate python${arg[0]} in your system'''
12
+ aid = '''kindly ensure python${arg[0]} and update its binary path with the command "${arg[1]}"'''
@@ -0,0 +1,4 @@
1
+ [P-1]
2
+ context = '''Unable to ensure pip for python${arg[0]}'''
3
+ aid = '''Please ensure whether pip installed in your system for python${arg[0]}'''
4
+ link = 'https://pip.pypa.io/en/stable/installation/#'
@@ -2,3 +2,8 @@
2
2
  context = '''No valid components to serve!'''
3
3
  aid = '''Please rectify the above errors, if any and try once again.'''
4
4
  link = 'https://www.zoho.com/catalyst/help/cli-serve.html'
5
+
6
+ [SERVE-2]
7
+ context = '''Error in running the pre cleanup process: unable to cleanup the ${arg[0]} directory.'''
8
+ aid = '''Please delete the ${arg[1]} directory, with administrator privilege if necessary.'''
9
+ link = ''
@@ -292,7 +292,8 @@ class Login {
292
292
  const queryParamsObj = new url_1.URL(req.url, `http://${req.headers.host}`)
293
293
  .searchParams;
294
294
  const code = queryParamsObj !== undefined && queryParamsObj.get('code');
295
- const location = queryParamsObj !== undefined && queryParamsObj.get('location');
295
+ const _location = queryParamsObj !== undefined && queryParamsObj.get('location');
296
+ const location = _location === 'dev' ? 'us' : _location;
296
297
  if (processReq && typeof code === 'string') {
297
298
  yield this._respondWithFile(req, res, 200, '../../templates/loginSuccess.html');
298
299
  if (dcRef !== undefined &&
@@ -1,2 +1,26 @@
1
- "use strict";
2
- module.exports = require('./src/table');
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ const CliTable3 = require('./src/table');
3
+ function getCustomColourTable(colour) {
4
+ return new CliTable3({
5
+ chars: {
6
+ top: colour('─'),
7
+ 'top-mid': colour('┬'),
8
+ 'top-left': colour('┌'),
9
+ 'top-right': colour('┐'),
10
+ bottom: colour('─'),
11
+ 'bottom-mid': colour('┴'),
12
+ 'bottom-left': colour('└'),
13
+ 'bottom-right': colour('┘'),
14
+ left: colour('│'),
15
+ 'left-mid': colour('├'),
16
+ mid: colour('─'),
17
+ 'mid-mid': colour('┼'),
18
+ right: colour('│'),
19
+ 'right-mid': colour('┤'),
20
+ middle: colour('│')
21
+ }
22
+ });
23
+ }
24
+
25
+ module.exports = CliTable3;
26
+ module.exports.getCustomColourTable = getCustomColourTable;