zcatalyst-cli 1.11.1 → 1.13.0

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 (188) hide show
  1. package/docs/optional-import.toml +10 -0
  2. package/lib/apig-utils.js +39 -39
  3. package/lib/archiver.js +13 -9
  4. package/lib/authentication/index.js +22 -18
  5. package/lib/authentication/login.js +37 -39
  6. package/lib/bin/catalyst.js +15 -15
  7. package/lib/cli_table/src/cell.js +26 -26
  8. package/lib/cli_table/src/layout-manager.js +44 -45
  9. package/lib/cli_table/src/table.js +9 -9
  10. package/lib/cli_table/src/utils.js +35 -36
  11. package/lib/client-utils.js +18 -18
  12. package/lib/client.js +1 -1
  13. package/lib/command_needs/auth.js +7 -7
  14. package/lib/command_needs/rc.js +24 -24
  15. package/lib/commands/apig/disable.js +5 -5
  16. package/lib/commands/apig/enable.js +5 -5
  17. package/lib/commands/apig/status.js +9 -9
  18. package/lib/commands/client/delete.js +19 -19
  19. package/lib/commands/client/setup.js +8 -4
  20. package/lib/commands/deploy.js +18 -14
  21. package/lib/commands/ds/export.js +11 -11
  22. package/lib/commands/ds/import.js +12 -12
  23. package/lib/commands/ds/status.js +15 -15
  24. package/lib/commands/event/generate/index.js +21 -17
  25. package/lib/commands/event/generate/integ.js +7 -3
  26. package/lib/commands/functions/add.js +8 -4
  27. package/lib/commands/functions/config.js +5 -5
  28. package/lib/commands/functions/delete.js +22 -22
  29. package/lib/commands/functions/setup.js +8 -4
  30. package/lib/commands/functions/shell.js +12 -5
  31. package/lib/commands/help.js +4 -4
  32. package/lib/commands/iac/export.js +8 -8
  33. package/lib/commands/iac/import.js +29 -21
  34. package/lib/commands/iac/pack.js +15 -11
  35. package/lib/commands/iac/status.js +6 -2
  36. package/lib/commands/index.js +5 -1
  37. package/lib/commands/init.js +14 -10
  38. package/lib/commands/login.js +5 -1
  39. package/lib/commands/logout.js +5 -1
  40. package/lib/commands/project/list.js +14 -10
  41. package/lib/commands/project/reset.js +5 -5
  42. package/lib/commands/project/use.js +9 -9
  43. package/lib/commands/pull.js +18 -14
  44. package/lib/commands/run.js +13 -9
  45. package/lib/commands/serve.js +5 -1
  46. package/lib/commands/token/generate.js +6 -2
  47. package/lib/commands/token/list.js +7 -3
  48. package/lib/commands/token/revoke.js +6 -2
  49. package/lib/commands/whoami.js +3 -3
  50. package/lib/dc.js +2 -2
  51. package/lib/deploy/features/apig.js +6 -6
  52. package/lib/deploy/features/client.js +1 -1
  53. package/lib/deploy/features/functions/index.js +9 -9
  54. package/lib/deploy/features/index.js +5 -1
  55. package/lib/deploy/index.js +2 -2
  56. package/lib/endpoints/index.js +17 -13
  57. package/lib/endpoints/lib/apig.js +5 -5
  58. package/lib/endpoints/lib/applogic.js +4 -4
  59. package/lib/endpoints/lib/cache.js +3 -3
  60. package/lib/endpoints/lib/catalyst-details.js +1 -1
  61. package/lib/endpoints/lib/client.js +5 -5
  62. package/lib/endpoints/lib/datastore.js +2 -2
  63. package/lib/endpoints/lib/ds-bulk.js +5 -5
  64. package/lib/endpoints/lib/env.js +1 -1
  65. package/lib/endpoints/lib/event-bus.js +1 -1
  66. package/lib/endpoints/lib/filestore.js +2 -2
  67. package/lib/endpoints/lib/functions.js +4 -4
  68. package/lib/endpoints/lib/iac.js +10 -10
  69. package/lib/endpoints/lib/project.js +20 -5
  70. package/lib/endpoints/lib/queue.js +3 -3
  71. package/lib/endpoints/lib/sdk.js +1 -1
  72. package/lib/endpoints/lib/zcql.js +1 -1
  73. package/lib/error.js +11 -9
  74. package/lib/errorOut.js +2 -2
  75. package/lib/event_generate/cache.js +5 -5
  76. package/lib/event_generate/custom.js +2 -2
  77. package/lib/event_generate/datastore.js +5 -5
  78. package/lib/event_generate/filestore.js +5 -5
  79. package/lib/event_generate/integration/cliq.js +3 -3
  80. package/lib/event_generate/user.js +1 -1
  81. package/lib/event_generate/webapp.js +5 -5
  82. package/lib/execute-script.js +19 -15
  83. package/lib/express_middlewares/authenticator.js +32 -5
  84. package/lib/express_middlewares/logger.js +2 -2
  85. package/lib/express_middlewares/unknownReqProxy.js +1 -1
  86. package/lib/fn-utils/index.js +5 -1
  87. package/lib/fn-utils/lib/common.js +44 -44
  88. package/lib/fn-utils/lib/integ.js +9 -9
  89. package/lib/fn-utils/lib/java.js +48 -46
  90. package/lib/fn-utils/lib/node.js +8 -8
  91. package/lib/fn-watcher.js +9 -11
  92. package/lib/iac/status/bundle.js +5 -5
  93. package/lib/iac/status/deploy.js +4 -4
  94. package/lib/index.js +2 -2
  95. package/lib/init/dependencies/npm-install.js +8 -1
  96. package/lib/init/dependencies/package-json.js +6 -6
  97. package/lib/init/features/client/index.js +5 -1
  98. package/lib/init/features/client/initializers/angular.js +29 -27
  99. package/lib/init/features/client/initializers/basic.js +10 -6
  100. package/lib/init/features/client/initializers/lyte.js +12 -13
  101. package/lib/init/features/client/initializers/react.js +23 -18
  102. package/lib/init/features/functions/index.js +23 -14
  103. package/lib/init/features/functions/languages/java.js +10 -10
  104. package/lib/init/features/functions/languages/node.js +9 -9
  105. package/lib/init/features/index.js +12 -8
  106. package/lib/init/features/project.js +20 -20
  107. package/lib/init/index.js +2 -2
  108. package/lib/init/util/client.js +12 -7
  109. package/lib/init/util/functions.js +1 -1
  110. package/lib/init/util/project.js +4 -4
  111. package/lib/internal/api.js +19 -19
  112. package/lib/internal/command.js +20 -16
  113. package/lib/internal/config.js +5 -5
  114. package/lib/internal/credential.js +10 -10
  115. package/lib/internal/crypt.js +5 -5
  116. package/lib/internal/rc.js +5 -5
  117. package/lib/migration/global/1.6.2.js +3 -3
  118. package/lib/migration/index.js +22 -18
  119. package/lib/option-filter.js +34 -30
  120. package/lib/optional-import.js +30 -11
  121. package/lib/plugin-loader.js +28 -13
  122. package/lib/port-resolver.js +4 -4
  123. package/lib/progress.js +2 -2
  124. package/lib/prompt/index.js +6 -2
  125. package/lib/prompt/types/file-path.js +1 -1
  126. package/lib/pull/features/apig.js +9 -9
  127. package/lib/pull/features/client.js +7 -7
  128. package/lib/pull/features/functions/index.js +15 -15
  129. package/lib/pull/features/index.js +5 -1
  130. package/lib/pull/index.js +4 -4
  131. package/lib/repl-server.js +2 -2
  132. package/lib/serve/features/apig.js +1 -1
  133. package/lib/serve/features/index.js +8 -4
  134. package/lib/serve/index.js +15 -11
  135. package/lib/serve/server/index.js +34 -27
  136. package/lib/serve/server/lib/java/JavaaioServer.java +5 -3
  137. package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
  138. package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
  139. package/lib/serve/server/lib/java/lib/zip4j-2.5.0.jar +0 -0
  140. package/lib/serve/server/lib/master.js +33 -36
  141. package/lib/serve/server/lib/node.js +7 -3
  142. package/lib/serve/server/lib/web_client/index.js +3 -3
  143. package/lib/serve/server/lib/web_client/server.js +33 -30
  144. package/lib/shell/dependencies/http-functions.js +38 -33
  145. package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +14 -3
  146. package/lib/shell/dependencies/invoker/bio/node.js +5 -2
  147. package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +7 -2
  148. package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +7 -2
  149. package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +7 -2
  150. package/lib/shell/dependencies/invoker/integ/node.js +8 -4
  151. package/lib/shell/dependencies/local-function.js +44 -40
  152. package/lib/shell/index.js +16 -12
  153. package/lib/shell/prepare/index.js +2 -2
  154. package/lib/shell/prepare/languages/index.js +5 -1
  155. package/lib/shell/prepare/languages/java.js +1 -1
  156. package/lib/throbber/index.js +17 -17
  157. package/lib/throbber/utils.js +9 -9
  158. package/lib/track.js +7 -7
  159. package/lib/util_modules/config/index.js +5 -1
  160. package/lib/util_modules/config/lib/client.js +18 -21
  161. package/lib/util_modules/constants/lib/auth.js +6 -6
  162. package/lib/util_modules/constants/lib/cliq-handlers.js +2 -2
  163. package/lib/util_modules/constants/lib/template.js +21 -21
  164. package/lib/util_modules/constants/lib/urls.js +20 -12
  165. package/lib/util_modules/context-help.js +15 -15
  166. package/lib/util_modules/fs/index.js +5 -1
  167. package/lib/util_modules/fs/lib/async.js +4 -4
  168. package/lib/util_modules/fs/utils.js +1 -1
  169. package/lib/util_modules/global-space.js +0 -97
  170. package/lib/util_modules/logger.js +2 -2
  171. package/lib/util_modules/parser/toml.js +1 -1
  172. package/lib/util_modules/project.js +6 -6
  173. package/lib/util_modules/server.js +53 -0
  174. package/lib/util_modules/shell.js +4 -4
  175. package/lib/winston.js +5 -5
  176. package/package.json +40 -40
  177. package/scripts/postInstall.js +7 -6
  178. package/templates/init/functions/java/integ/cliq/com/handlers/BotHandler.java +23 -5
  179. package/templates/init/functions/node/integ/cliq/handlers/bot-handler.js +23 -8
  180. package/templates/init/functions/node/integ/cliq/handlers/command-handler.js +3 -3
  181. package/templates/init/functions/node/integ/cliq/package.json +2 -1
  182. package/templates/init/functions/node/integ/cliq/sample.js +3 -1
  183. package/docs/.DS_Store +0 -0
  184. package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
  185. package/templates/.DS_Store +0 -0
  186. package/templates/init/.DS_Store +0 -0
  187. package/templates/init/client/.DS_Store +0 -0
  188. package/templates/init/client/react/.DS_Store +0 -0
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "zcatalyst-cli",
3
- "version": "1.11.1",
3
+ "version": "1.13.0",
4
4
  "description": "Command Line Tool for CATALYST",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
7
7
  "catalyst": "./lib/bin/catalyst.js"
8
8
  },
9
9
  "engines": {
10
- "node": ">=12.0.0"
10
+ "node": ">=14.0.0"
11
11
  },
12
12
  "preferGlobal": true,
13
13
  "keywords": [
@@ -28,65 +28,65 @@
28
28
  "ansi-colors": "^4.1.1",
29
29
  "app-module-path": "^2.2.0",
30
30
  "better-queue": "^3.8.10",
31
- "chokidar": "^3.5.2",
31
+ "chokidar": "^3.5.3",
32
32
  "cli-cursor": "^3.1.0",
33
- "cli-table3": "^0.6.0",
34
- "commander": "^8.2.0",
35
- "conf": "^10.0.2",
33
+ "commander": "^9.2.0",
34
+ "conf": "^10.1.2",
36
35
  "cross-spawn": "^7.0.3",
37
- "express": "^4.17.1",
38
- "fs-extra": "^10.0.0",
36
+ "express": "^4.17.3",
37
+ "fs-extra": "^10.1.0",
39
38
  "fuzzy": "^0.1.3",
40
39
  "http-proxy": "^1.18.1",
41
- "inquirer": "^8.1.2",
42
- "inquirer-autocomplete-prompt": "^1.4.0",
43
- "jszip": "^3.7.1",
40
+ "inquirer": "^8.2.2",
41
+ "inquirer-autocomplete-prompt": "^2.0.0",
42
+ "jszip": "^3.9.1",
44
43
  "lodash": "^4.17.21",
45
- "minimatch": "^3.0.4",
46
- "moment": "^2.29.1",
47
- "open": "^8.2.1",
44
+ "minimatch": "^5.0.1",
45
+ "moment": "^2.29.3",
46
+ "open": "^8.4.0",
48
47
  "portfinder": "^1.0.28",
49
48
  "pretty-ms": "^7.0.1",
50
49
  "request": "^2.88.2",
51
- "semver": "^7.3.5",
52
- "strip-ansi": "^6.0.0",
50
+ "semver": "^7.3.7",
51
+ "string-width": "^4.2.3",
52
+ "strip-ansi": "^6.0.1",
53
53
  "toml": "^3.0.0",
54
54
  "update-notifier": "^5.1.0",
55
- "winston": "^3.3.3",
56
- "ws": "^8.2.3",
55
+ "winston": "^3.7.2",
56
+ "ws": "^8.5.0",
57
57
  "xml2js": "^0.4.23",
58
- "yaml": "^1.10.2",
59
- "zcatalyst-angular-schematics": "^0.0.1"
58
+ "yaml": "^2.0.1",
59
+ "zcatalyst-angular-schematics": "^0.1.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/app-module-path": "^2.2.0",
63
63
  "@types/better-queue": "^3.8.3",
64
64
  "@types/cross-spawn": "^6.0.2",
65
65
  "@types/express": "^4.17.13",
66
- "@types/fs-extra": "^9.0.12",
67
- "@types/http-proxy": "^1.17.7",
68
- "@types/inquirer": "^7.3.3",
69
- "@types/inquirer-autocomplete-prompt": "^1.3.3",
70
- "@types/jest": "^26.0.24",
71
- "@types/lodash": "^4.14.172",
66
+ "@types/fs-extra": "^9.0.13",
67
+ "@types/http-proxy": "^1.17.8",
68
+ "@types/inquirer": "^8.2.1",
69
+ "@types/inquirer-autocomplete-prompt": "^1.3.4",
70
+ "@types/jest": "^27.4.1",
71
+ "@types/lodash": "^4.14.182",
72
72
  "@types/minimatch": "^3.0.5",
73
- "@types/node": "^16.6.0",
74
- "@types/request": "^2.48.7",
75
- "@types/semver": "^7.3.8",
73
+ "@types/node": "^17.0.25",
74
+ "@types/request": "^2.48.8",
75
+ "@types/semver": "^7.3.9",
76
76
  "@types/update-notifier": "^5.1.0",
77
- "@types/ws": "^8.2.0",
78
- "@types/xml2js": "^0.4.9",
79
- "@typescript-eslint/eslint-plugin": "^4.29.1",
80
- "@typescript-eslint/parser": "^4.29.1",
81
- "eslint": "^7.32.0",
82
- "eslint-config-prettier": "^8.3.0",
83
- "eslint-plugin-prettier": "^3.4.0",
77
+ "@types/ws": "^8.5.3",
78
+ "@types/xml2js": "^0.4.11",
79
+ "@typescript-eslint/eslint-plugin": "^5.20.0",
80
+ "@typescript-eslint/parser": "^5.20.0",
81
+ "eslint": "^8.13.0",
82
+ "eslint-config-prettier": "^8.5.0",
83
+ "eslint-plugin-prettier": "^4.0.0",
84
84
  "gulp": "^4.0.2",
85
- "jest": "^27.0.6",
85
+ "jest": "^27.5.1",
86
86
  "npm-run-all": "^4.1.5",
87
- "prettier": "^2.3.2",
88
- "ts-jest": "^27.0.4",
89
- "typescript": "^4.3.5"
87
+ "prettier": "^2.6.2",
88
+ "ts-jest": "^27.1.4",
89
+ "typescript": "^4.6.3"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "gulp build",
@@ -7,12 +7,12 @@
7
7
  try {
8
8
  const semver = require('semver');
9
9
  const ansi = require('ansi-colors');
10
- const cliTable = require('cli-table3');
10
+ const cliTable = require('../lib/cli_table');
11
11
  const packageJson = require('../package.json');
12
12
 
13
13
  if (semver.satisfies(process.version, packageJson.engines.node)) {
14
14
  console.log(ansi.green.bold('Installation successful.'));
15
- return;
15
+ process.exit(0);
16
16
  }
17
17
 
18
18
  const table = new cliTable({ style: { border: [], header: [] } });
@@ -24,8 +24,9 @@ try {
24
24
  'Compatible version: ': [ansi.green(packageJson.engines.node)]
25
25
  }
26
26
  );
27
- console.log(ansi.red('Node.js version is incompatible !!!'));
28
- console.log(table.toString());
29
- console.log('\n' + ansi.yellow.bold('Please update Node.js to a compatible version.'));
30
- console.log(ansi.bold('Reference: ') + ansi.underline('https://nodejs.org/') + '\n');
27
+ console.error(ansi.red('Node.js version is incompatible !!!'));
28
+ console.error(table.toString());
29
+ console.error('\n' + ansi.yellow.bold('Please update Node.js to a compatible version.'));
30
+ console.error(ansi.bold('Reference: ') + ansi.underline('https://nodejs.org/') + '\n');
31
+ process.exit(1);
31
32
  } catch (err) {}
@@ -31,6 +31,7 @@ import com.zc.cliq.requests.BotParticipationHandlerRequest;
31
31
  import com.zc.cliq.requests.BotWebhookHandlerRequest;
32
32
  import com.zc.cliq.requests.BotWelcomeHandlerRequest;
33
33
  import com.zc.cliq.util.ZCCliqUtil;
34
+ import com.zc.component.cache.ZCCache;
34
35
 
35
36
  public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
36
37
  Logger LOGGER = Logger.getLogger(BotHandler.class.getName());
@@ -82,7 +83,13 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
82
83
  param2.addSuggestion("IT");
83
84
  param2.addSuggestion("MECH");
84
85
 
85
- context.setParams(param1, param2);
86
+ BotContextParam param3 = BotContextParam.getInstance();
87
+ param3.setName("cache");
88
+ param3.setQuestion("Do you wish to put this detail in Catalyst Cache ?");
89
+ param3.addSuggestion("YES");
90
+ param3.addSuggestion("NO");
91
+
92
+ context.setParams(param1, param2, param3);
86
93
  resp.put("context", context);
87
94
  } else if (message.equalsIgnoreCase("button")) {
88
95
 
@@ -117,8 +124,19 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
117
124
  if (req.getContextId().equals("personal_details")) {
118
125
  Map<String, String> answers = req.getAnswers();
119
126
  StringBuilder str = new StringBuilder();
120
- str.append("Name: ").append(answers.get("name")).append("\n");
121
- str.append("Department: ").append(answers.get("dept")).append("\n");
127
+ str.append("*Name*: ").append(answers.get("name")).append("\n");
128
+ str.append("*Department*: ").append(answers.get("dept")).append("\n");
129
+
130
+ if(answers.get("cache").equals("YES")) {
131
+ try {
132
+ ZCCache cache = ZCCache.getInstance();
133
+ cache.putCacheValue("Name", answers.get("name"), 1L);
134
+ cache.putCacheValue("Department", answers.get("dept"), 1L);
135
+ str.append("This data is now available in Catalyst Cache's default segment.");
136
+ } catch(Exception ex) {
137
+ System.out.print("Error putting the value to cache: " + ex.toString());
138
+ }
139
+ }
122
140
 
123
141
  resp.put("text", "Nice ! I have collected your info: \n" + str.toString());
124
142
  }
@@ -156,10 +174,10 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
156
174
  String summary;
157
175
  String bodyStr = new StringBuilder("*From*: ").append(reqBody.getString("fromAddress")).append("\n*Subject*: ").append(reqBody.getString("subject")).append("\n*Content*: ").append((summary = reqBody.getString("summary")).length() > 100 ? summary.substring(0, 100) : summary).toString();
158
176
  Message msg = Message.getInstance(bodyStr);
159
- msg.setBot("PostPerson", "https://previews.123rf.com/images/nastyatrel/nastyatrel2006/nastyatrel200600035/149438272-flat-vector-illustration-chat-bot-icon-flat-line-style-vector-.jpg");
177
+ msg.setBot("PostPerson", "https://www.zoho.com/sites/default/files/catalyst/functions-images/icon-robot.jpg");
160
178
  CardDetails card = CardDetails.getInstance();
161
179
  card.setTitle("New Mail");
162
- card.setThumbnail("https://seekicon.com/free-icon-download/mail-icon_18.svg");
180
+ card.setThumbnail("https://www.zoho.com/sites/default/files/catalyst/functions-images/mail.svg");
163
181
  msg.setCard(card);
164
182
 
165
183
  ButtonObject button = new ButtonObject();
@@ -46,8 +46,14 @@ botHandler.messageHandler(async (req, res) => {
46
46
  param2.addSuggestion('CSE');
47
47
  param2.addSuggestion('IT');
48
48
  param2.addSuggestion('MECH');
49
+
50
+ const param3 = context.newParam();
51
+ param3.name = 'cache';
52
+ param3.question = "Do you wish to put this detail in Catalyst Cache ?"
53
+ param3.addSuggestion('YES');
54
+ param3.addSuggestion('NO');
49
55
 
50
- context.addParams(param1, param2);
56
+ context.addParams(param1, param2, param3);
51
57
  res.context = context;
52
58
  }
53
59
  else if (comp(msg, 'button')) {
@@ -77,13 +83,23 @@ botHandler.messageHandler(async (req, res) => {
77
83
  }
78
84
  });
79
85
 
80
- botHandler.contextHandler(async (req, res) => {
86
+ botHandler.contextHandler(async (req, res, app) => {
81
87
  if(req.context_id === 'personal_details') {
82
88
  const answer = req.answers;
83
- const department = answer.dept.text;
84
- const str = `Name: ${answer.name.text}\nDepartment: ${department}\n`;
89
+ let text = `Nice! I have collected your info: \n*Name*: ${answer.name.text} \n*Department*: ${answer.dept.text}`
90
+
91
+ if(answer.cache.text === 'YES') {
92
+ try {
93
+ const segment = app.cache().segment();
94
+ await segment.put('Name', answer.name.text);
95
+ await segment.put('Department', answer.dept.text);
96
+ text += '\nThis data is now available in Catalyst Cache\'s default segment.'
97
+ } catch(err) {
98
+ console.error('Error putting value in cache', err);
99
+ }
100
+ }
85
101
 
86
- res.setText('Nice ! I have collected your info: \n' + str);
102
+ res.setText(text);
87
103
  }
88
104
  return res;
89
105
  });
@@ -117,12 +133,11 @@ botHandler.webHookHandler(async (req, res) => {
117
133
  const summary = reqBody.summary || '';
118
134
  const bodyStr = `*From*: ${reqBody.fromAddress} \n *Subject*: ${reqBody.subject} \n *Content*: ${ summary.length > 100 ? summary.substring(0, 100): summary}`;
119
135
 
120
- res.bot = res.newBotDetails('PostPerson',
121
- 'https://previews.123rf.com/images/nastyatrel/nastyatrel2006/nastyatrel200600035/149438272-flat-vector-illustration-chat-bot-icon-flat-line-style-vector-.jpg');
136
+ res.bot = res.newBotDetails('PostPerson', 'https://www.zoho.com/sites/default/files/catalyst/functions-images/icon-robot.jpg');
122
137
 
123
138
  const card = res.newCard();
124
139
  card.title = 'New Mail';
125
- card.thumbnail = 'https://seekicon.com/free-icon-download/mail-icon_18.svg';
140
+ card.thumbnail = 'https://www.zoho.com/sites/default/files/catalyst/functions-images/mail.svg';
126
141
  res.card = card;
127
142
 
128
143
  const button = res.newButton();
@@ -36,17 +36,17 @@ command.executionHandler(async (req, res) => {
36
36
 
37
37
  command.suggestionHandler(async (req, res) => {
38
38
  if(comp(req.name,'catalystresource')) {
39
- const suggestion1 = command.newCommandSugestion();
39
+ const suggestion1 = command.newCommandSuggestion();
40
40
  suggestion1.title = 'API doc';
41
41
  suggestion1.description = 'Catalyst API documentation';
42
42
  suggestion1.imageurl = 'https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png';
43
43
 
44
- const suggestion2 = command.newCommandSugestion();
44
+ const suggestion2 = command.newCommandSuggestion();
45
45
  suggestion2.title = 'CLI doc';
46
46
  suggestion2.description = 'Catalyst CLI documentation';
47
47
  suggestion2.imageurl = 'https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png';
48
48
 
49
- const suggestion3 = command.newCommandSugestion();
49
+ const suggestion3 = command.newCommandSuggestion();
50
50
  suggestion3.title = 'Help docs';
51
51
  suggestion3.description = 'Catalyst help documentation';
52
52
  suggestion3.imageurl = 'https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png';
@@ -4,6 +4,7 @@
4
4
  "main": "{{_MAIN_}}",
5
5
  "author": "{{_AUTHOR_}}",
6
6
  "dependencies": {
7
- "zcatalyst-integ-cliq": "latest"
7
+ "zcatalyst-integ-cliq": "latest",
8
+ "zcatalyst-sdk-node": "^2.1.0"
8
9
  }
9
10
  }
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
2
  const Cliq = require('zcatalyst-integ-cliq');
3
+ const catalyst = require('zcatalyst-sdk-node');
3
4
 
4
5
  module.exports = async (request, response) => {
5
6
  try {
6
- const handlerResponse = await Cliq.default(request);
7
+ const app = catalyst.initialize(request);
8
+ const handlerResponse = await Cliq.default(request, app);
7
9
  response.end(handlerResponse);
8
10
  } catch (err) {
9
11
  console.log('Error while executing handler. ', err);
package/docs/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file