zcatalyst-cli 1.10.1 → 1.12.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.
- package/docs/.DS_Store +0 -0
- package/docs/client-utils.toml +5 -0
- package/docs/command_needs/auth.toml +1 -1
- package/docs/optional-import.toml +10 -0
- package/docs/plugin-loader.toml +4 -0
- package/docs/serve/server/index.toml +4 -0
- package/docs/serve/server/lib/web_client/server.toml +4 -0
- package/lib/apig-utils.js +2 -1
- package/lib/authentication/login.js +10 -12
- package/lib/client-utils.js +8 -6
- package/lib/command_needs/auth.js +2 -2
- package/lib/commands/client/delete.js +2 -1
- package/lib/commands/ds/status.js +5 -5
- package/lib/commands/event/generate/index.js +4 -13
- package/lib/commands/functions/delete.js +2 -2
- package/lib/commands/functions/shell.js +5 -2
- package/lib/commands/iac/import.js +37 -10
- package/lib/commands/init.js +1 -1
- package/lib/commands/pull.js +1 -1
- package/lib/commands/serve.js +2 -1
- package/lib/endpoints/lib/sdk.js +2 -2
- package/lib/error.js +16 -13
- package/lib/errorOut.js +2 -2
- package/lib/fn-utils/lib/common.js +4 -4
- package/lib/fn-utils/lib/java.js +6 -4
- package/lib/fn-utils/lib/node.js +2 -2
- package/lib/init/dependencies/npm-install.js +10 -10
- package/lib/init/features/client/index.js +47 -0
- package/lib/init/features/client/initializers/angular.js +104 -0
- package/lib/init/features/client/initializers/basic.js +50 -0
- package/lib/init/features/client/initializers/lyte.js +56 -0
- package/lib/init/features/client/initializers/react.js +78 -0
- package/lib/init/features/functions/index.js +14 -5
- package/lib/init/features/functions/languages/node.js +3 -1
- package/lib/init/features/index.js +10 -3
- package/lib/init/features/project.js +1 -1
- package/lib/init/util/client.js +89 -4
- package/lib/internal/command.js +4 -1
- package/lib/internal/config.js +2 -1
- package/lib/optional-import.js +27 -26
- package/lib/plugin-loader.js +27 -10
- package/lib/port-resolver.js +4 -2
- package/lib/prompt/index.js +1 -1
- package/lib/pull/features/functions/index.js +1 -1
- package/lib/serve/index.js +6 -1
- package/lib/serve/server/index.js +52 -8
- package/lib/serve/server/lib/java/JavaaioServer.java +3 -2
- package/lib/serve/server/lib/master.js +22 -24
- package/lib/serve/server/lib/web_client/index.js +30 -0
- package/lib/serve/server/lib/web_client/server.js +174 -0
- package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +7 -1
- package/lib/shell/dependencies/invoker/bio/node.js +5 -2
- package/lib/shell/index.js +10 -6
- package/lib/util_modules/char.js +1 -1
- package/lib/util_modules/config/lib/apig.js +2 -1
- package/lib/util_modules/config/lib/client.js +18 -21
- package/lib/util_modules/constants/index.js +3 -1
- package/lib/util_modules/constants/lib/placeholders.js +1 -0
- package/lib/util_modules/constants/lib/plugin.js +28 -0
- package/lib/util_modules/constants/lib/template.js +11 -1
- package/lib/util_modules/constants/lib/urls.js +29 -13
- package/lib/util_modules/{contextHelp.js → context-help.js} +0 -0
- package/lib/util_modules/env.js +13 -12
- package/lib/util_modules/fs/index.js +1 -9
- package/lib/util_modules/fs/lib/async.js +3 -3
- package/lib/util_modules/fs/utils.js +8 -0
- package/lib/util_modules/global-space.js +2 -0
- package/lib/util_modules/option.js +5 -1
- package/lib/util_modules/server.js +53 -0
- package/lib/util_modules/shell.js +10 -6
- package/lib/winston.js +1 -1
- package/package.json +8 -5
- package/templates/.DS_Store +0 -0
- package/templates/init/.DS_Store +0 -0
- package/templates/init/client/.DS_Store +0 -0
- package/templates/init/client/{client-package.json → basic/client-package.json} +0 -0
- package/templates/init/client/{index.html → basic/index.html} +0 -0
- package/templates/init/client/{main.css → basic/main.css} +0 -0
- package/templates/init/client/{main.js → basic/main.js} +0 -0
- package/templates/init/client/lyte/build/build.js +301 -0
- package/templates/init/client/lyte/build/scripts/cliDownloadScript.js +54 -0
- package/templates/init/client/lyte/client-package.json +5 -0
- package/templates/init/client/lyte/components/javascript/welcome-comp.js +13 -0
- package/templates/init/client/lyte/components/styles/welcome-comp.css +0 -0
- package/templates/init/client/lyte/components/templates/welcome-comp.html +8 -0
- package/templates/init/client/lyte/data-store/adapters/.gitkeep +0 -0
- package/templates/init/client/lyte/data-store/models/.gitkeep +0 -0
- package/templates/init/client/lyte/data-store/serializers/.gitkeep +0 -0
- package/templates/init/client/lyte/index.html +17 -0
- package/templates/init/client/lyte/package.json +12 -0
- package/templates/init/client/lyte/router.js +14 -0
- package/templates/init/client/lyte/routes/index.js +54 -0
- package/templates/init/client/react/.DS_Store +0 -0
- package/templates/init/client/react/react_js/package.json +11 -0
- package/templates/init/client/react/react_js/template/README.md +70 -0
- package/templates/init/client/react/react_js/template/client-package.json +5 -0
- package/templates/init/client/react/react_js/template/gitignore +23 -0
- package/templates/init/client/react/react_js/template/public/favicon.ico +0 -0
- package/templates/init/client/react/react_js/template/public/index.html +43 -0
- package/templates/init/client/react/react_js/template/public/logo192.png +0 -0
- package/templates/init/client/react/react_js/template/public/logo512.png +0 -0
- package/templates/init/client/react/react_js/template/public/manifest.json +25 -0
- package/templates/init/client/react/react_js/template/public/robots.txt +3 -0
- package/templates/init/client/react/react_js/template/src/App.css +38 -0
- package/templates/init/client/react/react_js/template/src/App.js +25 -0
- package/templates/init/client/react/react_js/template/src/App.test.js +8 -0
- package/templates/init/client/react/react_js/template/src/index.css +13 -0
- package/templates/init/client/react/react_js/template/src/index.js +17 -0
- package/templates/init/client/react/react_js/template/src/logo.svg +1 -0
- package/templates/init/client/react/react_js/template/src/reportWebVitals.js +13 -0
- package/templates/init/client/react/react_js/template/src/setupTests.js +5 -0
- package/templates/init/client/react/react_js/template.json +13 -0
- package/templates/init/client/react/react_ts/package.json +11 -0
- package/templates/init/client/react/react_ts/template/README.md +46 -0
- package/templates/init/client/react/react_ts/template/client-package.json +5 -0
- package/templates/init/client/react/react_ts/template/gitignore +23 -0
- package/templates/init/client/react/react_ts/template/public/favicon.ico +0 -0
- package/templates/init/client/react/react_ts/template/public/index.html +43 -0
- package/templates/init/client/react/react_ts/template/public/logo192.png +0 -0
- package/templates/init/client/react/react_ts/template/public/logo512.png +0 -0
- package/templates/init/client/react/react_ts/template/public/manifest.json +25 -0
- package/templates/init/client/react/react_ts/template/public/robots.txt +3 -0
- package/templates/init/client/react/react_ts/template/src/App.css +38 -0
- package/templates/init/client/react/react_ts/template/src/App.test.tsx +9 -0
- package/templates/init/client/react/react_ts/template/src/App.tsx +26 -0
- package/templates/init/client/react/react_ts/template/src/index.css +13 -0
- package/templates/init/client/react/react_ts/template/src/index.tsx +17 -0
- package/templates/init/client/react/react_ts/template/src/logo.svg +1 -0
- package/templates/init/client/react/react_ts/template/src/reportWebVitals.ts +15 -0
- package/templates/init/client/react/react_ts/template/src/setupTests.ts +5 -0
- package/templates/init/client/react/react_ts/template.json +18 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/BotHandler.java +116 -113
- package/templates/init/functions/java/integ/cliq/com/handlers/CommandHandler.java +20 -27
- package/templates/init/functions/java/integ/cliq/com/handlers/FunctionHandler.java +143 -112
- package/templates/init/functions/java/integ/cliq/com/handlers/InstallationHandler.java +4 -7
- package/templates/init/functions/java/integ/cliq/com/handlers/InstallationValidator.java +4 -7
- package/templates/init/functions/java/integ/cliq/com/handlers/MessageActionHandler.java +10 -12
- package/templates/init/functions/java/integ/cliq/com/handlers/WidgetHandler.java +100 -66
- package/templates/init/functions/java/integ/cliq/sample.java +5 -7
- package/templates/init/functions/node/integ/cliq/.DS_Store +0 -0
- package/templates/init/functions/node/integ/cliq/handlers/bot-handler.js +23 -8
- package/templates/init/functions/node/integ/cliq/handlers/command-handler.js +3 -4
- package/templates/init/functions/node/integ/cliq/handlers/function-handler.js +46 -0
- package/templates/init/functions/node/integ/cliq/handlers/widget-handler.js +31 -0
- package/templates/init/functions/node/integ/cliq/package.json +2 -1
- package/templates/init/functions/node/integ/cliq/sample.js +3 -1
- package/templates/web-socket.txt +21 -0
- package/lib/init/features/client.js +0 -50
- package/lib/serve/server/lib/client.js +0 -30
|
@@ -12,38 +12,39 @@ import com.zc.cliq.enums.SYSTEM_API_ACTION;
|
|
|
12
12
|
import com.zc.cliq.enums.WIDGET_DATATYPE;
|
|
13
13
|
import com.zc.cliq.enums.WIDGET_ELEMENT_TYPE;
|
|
14
14
|
import com.zc.cliq.enums.WIDGET_EVENT;
|
|
15
|
+
import com.zc.cliq.enums.WIDGET_NAVIGATION;
|
|
15
16
|
import com.zc.cliq.enums.WIDGET_TYPE;
|
|
16
17
|
import com.zc.cliq.objects.WidgetButton;
|
|
17
18
|
import com.zc.cliq.objects.WidgetElement;
|
|
19
|
+
import com.zc.cliq.objects.WidgetFooter;
|
|
20
|
+
import com.zc.cliq.objects.WidgetHeader;
|
|
18
21
|
import com.zc.cliq.objects.WidgetInfo;
|
|
19
22
|
import com.zc.cliq.objects.WidgetResponse;
|
|
20
23
|
import com.zc.cliq.objects.WidgetSection;
|
|
21
24
|
import com.zc.cliq.objects.WidgetTab;
|
|
22
25
|
import com.zc.cliq.requests.WidgetExecutionHandlerRequest;
|
|
23
26
|
|
|
24
|
-
public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler
|
|
25
|
-
{
|
|
27
|
+
public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler {
|
|
26
28
|
Logger LOGGER = Logger.getLogger(WidgetHandler.class.getName());
|
|
27
|
-
|
|
29
|
+
|
|
28
30
|
@Override
|
|
29
|
-
public WidgetResponse viewHandler(WidgetExecutionHandlerRequest req) throws Exception
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
public WidgetResponse viewHandler(WidgetExecutionHandlerRequest req) throws Exception {
|
|
32
|
+
|
|
32
33
|
WidgetResponse widgetResp = WidgetResponse.getInstance();
|
|
33
34
|
widgetResp.setType(WIDGET_TYPE.APPLET);
|
|
34
35
|
WidgetTab catalystTab = WidgetTab.getInstance("catalystTab", "Zoho Catalyst");
|
|
35
36
|
WidgetTab cliqTab = WidgetTab.getInstance("cliqTab", "Zoho Cliq");
|
|
36
37
|
WidgetTab infotab = WidgetTab.getInstance("infoTab", "Empty view");
|
|
37
38
|
WidgetTab buttonTab = WidgetTab.getInstance("buttonTab", "Button types");
|
|
38
|
-
|
|
39
|
-
widgetResp.addTabs(catalystTab,cliqTab,infotab,buttonTab);
|
|
39
|
+
|
|
40
|
+
widgetResp.addTabs(catalystTab, cliqTab, infotab, buttonTab);
|
|
40
41
|
widgetResp.setActiveTab(catalystTab);
|
|
41
|
-
|
|
42
|
-
if(req.getEvent().equals(WIDGET_EVENT.LOAD) || (req.getEvent().equals(WIDGET_EVENT.TAB_CLICK) && req.getTarget().getId().equals("catalystTab")) || (req.getEvent().equals(WIDGET_EVENT.REFRESH) && req.getTarget().getId().equals("catalystTab"))){
|
|
43
|
-
|
|
42
|
+
|
|
43
|
+
if (req.getEvent().equals(WIDGET_EVENT.LOAD) || (req.getEvent().equals(WIDGET_EVENT.TAB_CLICK) && req.getTarget().getId().equals("catalystTab")) || (req.getEvent().equals(WIDGET_EVENT.REFRESH) && req.getTarget().getId().equals("catalystTab"))) {
|
|
44
|
+
|
|
44
45
|
WidgetElement divider = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.DIVIDER);
|
|
45
|
-
|
|
46
|
-
//Datastore
|
|
46
|
+
|
|
47
|
+
// Datastore
|
|
47
48
|
WidgetElement dsTitle = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
48
49
|
dsTitle.setText("Datastore");
|
|
49
50
|
WidgetButton dsButton = new WidgetButton();
|
|
@@ -55,10 +56,10 @@ public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler
|
|
|
55
56
|
dsText.setText("The Data Store in Catalyst is a cloud-based relational database management system which stores the persistent data of your application.");
|
|
56
57
|
WidgetSection datastoreSection = WidgetSection.getInstance();
|
|
57
58
|
datastoreSection.setId("1");
|
|
58
|
-
datastoreSection.addElements(dsTitle,dsText,divider);
|
|
59
|
+
datastoreSection.addElements(dsTitle, dsText, divider);
|
|
59
60
|
widgetResp.addSection(datastoreSection);
|
|
60
|
-
|
|
61
|
-
//Functions
|
|
61
|
+
|
|
62
|
+
// Functions
|
|
62
63
|
WidgetElement fnTitle = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
63
64
|
fnTitle.setText("Functions");
|
|
64
65
|
WidgetButton fnButton = new WidgetButton();
|
|
@@ -70,28 +71,27 @@ public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler
|
|
|
70
71
|
WidgetElement fnText = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TEXT);
|
|
71
72
|
fnText.setText("Catalyst Functions are custom-built coding structures which contain the intense business logic of your application.");
|
|
72
73
|
WidgetSection functionsSection = WidgetSection.getInstance();
|
|
73
|
-
functionsSection.addElements(fnTitle,fnText,divider);
|
|
74
|
+
functionsSection.addElements(fnTitle, fnText, divider);
|
|
74
75
|
functionsSection.setId("2");
|
|
75
76
|
widgetResp.addSection(functionsSection);
|
|
76
|
-
|
|
77
|
-
//AutoML
|
|
77
|
+
|
|
78
|
+
// AutoML
|
|
78
79
|
WidgetElement automlTitle = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
79
80
|
WidgetElement automlText = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TEXT);
|
|
80
81
|
automlTitle.setText("AutoML");
|
|
81
82
|
automlText.setText("AutoML (Automated Machine Learning) is the process of automating the end-to-end traditional machine learning model and applying it to solve the real-world problems.");
|
|
82
83
|
WidgetSection autoMLSection = WidgetSection.getInstance();
|
|
83
|
-
autoMLSection.addElements(automlTitle,automlText);
|
|
84
|
+
autoMLSection.addElements(automlTitle, automlText);
|
|
84
85
|
autoMLSection.setId("3");
|
|
85
86
|
widgetResp.addSection(autoMLSection);
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
|
|
88
|
+
} else if (req.getEvent().equals(WIDGET_EVENT.REFRESH) || req.getEvent().equals(WIDGET_EVENT.TAB_CLICK)) {
|
|
89
|
+
|
|
90
90
|
String target = req.getTarget().getId();
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
widgetResp.setActiveTab(target);
|
|
93
|
-
if(target.equals("infoTab")){
|
|
94
|
-
|
|
93
|
+
if (target.equals("infoTab")) {
|
|
94
|
+
|
|
95
95
|
widgetResp.setDataType(WIDGET_DATATYPE.INFO);
|
|
96
96
|
WidgetInfo info = new WidgetInfo();
|
|
97
97
|
info.setTitle("Sorry! No tables found.");
|
|
@@ -103,46 +103,45 @@ public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler
|
|
|
103
103
|
linkBtn.setUrl("https://console.catalyst.zoho.com");
|
|
104
104
|
info.setButton(linkBtn);
|
|
105
105
|
widgetResp.setInfo(info);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
else if(target.equals("cliqTab")){
|
|
109
|
-
|
|
106
|
+
|
|
107
|
+
return widgetResp;
|
|
108
|
+
} else if (target.equals("cliqTab")) {
|
|
109
|
+
|
|
110
110
|
WidgetElement divider = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.DIVIDER);
|
|
111
|
-
|
|
112
|
-
//Bot
|
|
111
|
+
|
|
112
|
+
// Bot
|
|
113
113
|
WidgetElement botTitle = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
114
114
|
WidgetElement botText = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TEXT);
|
|
115
115
|
botTitle.setText("Bot");
|
|
116
116
|
botText.setText("Bot is your system powered contact or your colleague with which you can interact with as you do with any other person. The bot can be programmed to respond to your queries, to perform action on your behalf and to notify you for any important event.");
|
|
117
117
|
WidgetSection botSection = WidgetSection.getInstance();
|
|
118
|
-
botSection.addElements(botTitle,botText,divider);
|
|
118
|
+
botSection.addElements(botTitle, botText, divider);
|
|
119
119
|
botSection.setId("4");
|
|
120
120
|
widgetResp.addSection(botSection);
|
|
121
|
-
|
|
122
|
-
//Widgets
|
|
121
|
+
|
|
122
|
+
// Widgets
|
|
123
123
|
WidgetElement widgetTitle = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
124
124
|
WidgetElement widgetText = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TEXT);
|
|
125
125
|
widgetTitle.setText("Widgets");
|
|
126
126
|
widgetText.setText("Widgets are a great way to customize your Cliq home screen. Imagine having a custom view of all the important data and functionality from the different apps that you use every day.");
|
|
127
127
|
WidgetSection widgetsSection = WidgetSection.getInstance();
|
|
128
|
-
widgetsSection.addElements(widgetTitle,widgetText,divider);
|
|
128
|
+
widgetsSection.addElements(widgetTitle, widgetText, divider);
|
|
129
129
|
widgetsSection.setId("5");
|
|
130
130
|
widgetResp.addSection(widgetsSection);
|
|
131
|
-
|
|
132
|
-
//Connections
|
|
131
|
+
|
|
132
|
+
// Connections
|
|
133
133
|
WidgetElement connTitle = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
134
134
|
WidgetElement connText = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TEXT);
|
|
135
135
|
connTitle.setText("Connections");
|
|
136
136
|
connText.setText("Connections is an interface to integrate third party services with your Zoho Service, in this case, Cliq. These connections are used in an URL invocation task to access authenticated data. To establish a connection, it is necessary to provide a Connection Name, Authentication Type amongst other details.");
|
|
137
137
|
WidgetSection connectionsSection = WidgetSection.getInstance();
|
|
138
|
-
connectionsSection.addElements(connTitle,connText);
|
|
138
|
+
connectionsSection.addElements(connTitle, connText);
|
|
139
139
|
connectionsSection.setId("6");
|
|
140
140
|
widgetResp.addSection(connectionsSection);
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
//Time
|
|
141
|
+
|
|
142
|
+
} else if (target.equals("buttonTab")) {
|
|
143
|
+
|
|
144
|
+
// Time
|
|
146
145
|
WidgetElement time = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.SUBTEXT);
|
|
147
146
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
148
147
|
time.setText("Target:buttons\nTime : " + sdf.format(new Date()));
|
|
@@ -150,44 +149,44 @@ public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler
|
|
|
150
149
|
titleSection.setId("100");
|
|
151
150
|
titleSection.addElement(time);
|
|
152
151
|
widgetResp.addSection(titleSection);
|
|
153
|
-
|
|
152
|
+
|
|
154
153
|
WidgetSection buttonSection = WidgetSection.getInstance();
|
|
155
|
-
|
|
156
|
-
//Buttons - Row1
|
|
154
|
+
|
|
155
|
+
// Buttons - Row1
|
|
157
156
|
WidgetElement title = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.TITLE);
|
|
158
157
|
title.setText("Buttons");
|
|
159
|
-
|
|
158
|
+
|
|
160
159
|
WidgetElement buttonElement1 = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.BUTTONS);
|
|
161
160
|
List<WidgetButton> buttonsList1 = new ArrayList<WidgetButton>();
|
|
162
161
|
WidgetButton button1 = new WidgetButton();
|
|
163
162
|
button1.setLabel("Link");
|
|
164
163
|
button1.setType(ACTION_TYPE.OPEN_URL);
|
|
165
164
|
button1.setUrl("https://www.zoho.com");
|
|
166
|
-
|
|
165
|
+
|
|
167
166
|
WidgetButton button2 = new WidgetButton();
|
|
168
167
|
button2.setLabel("Applet Button");
|
|
169
168
|
button2.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
170
169
|
button2.setName("appletFunction");
|
|
171
170
|
button2.setId("banner");
|
|
172
|
-
|
|
171
|
+
|
|
173
172
|
WidgetButton button3 = new WidgetButton();
|
|
174
173
|
button3.setLabel("Open Channel");
|
|
175
174
|
button3.setType(ACTION_TYPE.SYSTEM_API);
|
|
176
175
|
button3.setApi(SYSTEM_API_ACTION.JOIN_CHANNEL, "CD_1283959962893705602_14598233");// ** ENTER YOUR CHANNEL ID HERE **
|
|
177
|
-
|
|
176
|
+
|
|
178
177
|
WidgetButton button4 = new WidgetButton();
|
|
179
178
|
button4.setLabel("Preview");
|
|
180
179
|
button4.setType(ACTION_TYPE.PREVIEW_URL);
|
|
181
180
|
button4.setUrl("https://www.zoho.com/catalyst/features.html");
|
|
182
|
-
|
|
181
|
+
|
|
183
182
|
buttonsList1.add(button1);
|
|
184
183
|
buttonsList1.add(button2);
|
|
185
184
|
buttonsList1.add(button3);
|
|
186
185
|
buttonsList1.add(button4);
|
|
187
|
-
|
|
186
|
+
|
|
188
187
|
buttonElement1.setButtons(buttonsList1);
|
|
189
|
-
|
|
190
|
-
//Buttons - Row2
|
|
188
|
+
|
|
189
|
+
// Buttons - Row2
|
|
191
190
|
WidgetElement buttonElement2 = WidgetElement.getInstance(WIDGET_ELEMENT_TYPE.BUTTONS);
|
|
192
191
|
List<WidgetButton> buttonsList2 = new ArrayList<WidgetButton>();
|
|
193
192
|
WidgetButton button5 = new WidgetButton();
|
|
@@ -195,49 +194,84 @@ public class WidgetHandler implements com.zc.cliq.interfaces.WidgetHandler
|
|
|
195
194
|
button5.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
196
195
|
button5.setName("appletFunction");
|
|
197
196
|
button5.setId("section");
|
|
198
|
-
|
|
197
|
+
|
|
199
198
|
WidgetButton button6 = new WidgetButton();
|
|
200
199
|
button6.setLabel("Form Edit Section");
|
|
201
200
|
button6.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
202
201
|
button6.setName("appletFunction");
|
|
203
202
|
button6.setId("formsection");
|
|
204
|
-
|
|
203
|
+
|
|
205
204
|
WidgetButton button7 = new WidgetButton();
|
|
206
205
|
button7.setLabel("Banner");
|
|
207
206
|
button7.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
208
207
|
button7.setName("appletFunction");
|
|
209
208
|
button7.setId("banner");
|
|
210
|
-
|
|
209
|
+
|
|
211
210
|
WidgetButton button8 = new WidgetButton();
|
|
212
211
|
button8.setLabel("Edit Whole Tab");
|
|
213
212
|
button8.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
214
213
|
button8.setName("appletFunction");
|
|
215
214
|
button8.setId("tab");
|
|
216
|
-
|
|
215
|
+
|
|
217
216
|
WidgetButton button9 = new WidgetButton();
|
|
218
217
|
button9.setLabel("Form Edit Tab");
|
|
219
218
|
button9.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
220
219
|
button9.setName("appletFunction");
|
|
221
220
|
button9.setId("formtab");
|
|
222
|
-
|
|
221
|
+
|
|
223
222
|
buttonsList2.add(button5);
|
|
224
223
|
buttonsList2.add(button6);
|
|
225
224
|
buttonsList2.add(button7);
|
|
226
225
|
buttonsList2.add(button8);
|
|
227
226
|
buttonsList2.add(button9);
|
|
228
|
-
|
|
227
|
+
|
|
229
228
|
buttonElement2.setButtons(buttonsList2);
|
|
230
|
-
|
|
229
|
+
|
|
231
230
|
buttonSection.addElement(title);
|
|
232
231
|
buttonSection.addElement(buttonElement1);
|
|
233
232
|
buttonSection.addElement(buttonElement2);
|
|
234
233
|
buttonSection.setId("101");
|
|
235
|
-
|
|
234
|
+
|
|
236
235
|
widgetResp.addSection(buttonSection);
|
|
237
236
|
}
|
|
238
|
-
|
|
237
|
+
|
|
239
238
|
}
|
|
240
|
-
|
|
239
|
+
|
|
240
|
+
WidgetButton fistNav = new WidgetButton();
|
|
241
|
+
fistNav.setLabel("Page : 1");
|
|
242
|
+
fistNav.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
243
|
+
fistNav.setName("appletFunction");
|
|
244
|
+
fistNav.setId("breadcrumbs");
|
|
245
|
+
|
|
246
|
+
WidgetButton linkButton = new WidgetButton();
|
|
247
|
+
linkButton.setLabel("Link");
|
|
248
|
+
linkButton.setType(ACTION_TYPE.OPEN_URL);
|
|
249
|
+
linkButton.setUrl("https://www.zoho.com");
|
|
250
|
+
|
|
251
|
+
WidgetButton bannerBtn = new WidgetButton();
|
|
252
|
+
bannerBtn.setLabel("Banner");
|
|
253
|
+
bannerBtn.setType(ACTION_TYPE.INVOKE_FUNCTION);
|
|
254
|
+
bannerBtn.setName("appletFunction");
|
|
255
|
+
bannerBtn.setId("banner");
|
|
256
|
+
|
|
257
|
+
WidgetHeader header = WidgetHeader.getInstance();
|
|
258
|
+
header.setTitle("Header 1");
|
|
259
|
+
header.setNavigation(WIDGET_NAVIGATION.NEW);
|
|
260
|
+
List<WidgetButton> headerButtons = new ArrayList<WidgetButton>();
|
|
261
|
+
headerButtons.add(fistNav);
|
|
262
|
+
headerButtons.add(bannerBtn);
|
|
263
|
+
headerButtons.add(linkButton);
|
|
264
|
+
header.setButtons(headerButtons);
|
|
265
|
+
widgetResp.setHeader(header);
|
|
266
|
+
|
|
267
|
+
WidgetFooter footer = WidgetFooter.getInstance();
|
|
268
|
+
footer.setText("Footer Text");
|
|
269
|
+
List<WidgetButton> footerButtons = new ArrayList<WidgetButton>();
|
|
270
|
+
footerButtons.add(bannerBtn);
|
|
271
|
+
footerButtons.add(linkButton);
|
|
272
|
+
footer.setButtons(footerButtons);
|
|
273
|
+
widgetResp.setFooter(footer);
|
|
274
|
+
|
|
241
275
|
return widgetResp;
|
|
242
276
|
}
|
|
243
277
|
}
|
|
@@ -5,17 +5,15 @@ import com.catalyst.integ.ZCIntegRequest;
|
|
|
5
5
|
import com.catalyst.integ.ZCIntegResponse;
|
|
6
6
|
import com.zc.cliq.util.ZCCliqUtil;
|
|
7
7
|
|
|
8
|
-
public class {{_CLASS_}} implements CatalystIntegFunctionHandler
|
|
9
|
-
{
|
|
8
|
+
public class {{_CLASS_}} implements CatalystIntegFunctionHandler {
|
|
10
9
|
Logger LOGGER = Logger.getLogger({{_CLASS_}}.class.getName());
|
|
10
|
+
|
|
11
11
|
@Override
|
|
12
|
-
public ZCIntegResponse runner(ZCIntegRequest req) throws Exception
|
|
13
|
-
|
|
14
|
-
try{
|
|
12
|
+
public ZCIntegResponse runner(ZCIntegRequest req) throws Exception {
|
|
13
|
+
try {
|
|
15
14
|
ZCIntegResponse resp = ZCCliqUtil.executeHandler(req);
|
|
16
15
|
return resp;
|
|
17
|
-
}
|
|
18
|
-
catch(Exception ex){
|
|
16
|
+
} catch(Exception ex) {
|
|
19
17
|
LOGGER.severe("Exception while executing handler.");
|
|
20
18
|
throw ex;
|
|
21
19
|
}
|
|
Binary file
|
|
@@ -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
|
-
|
|
84
|
-
|
|
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(
|
|
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://
|
|
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();
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const cliq = require('zcatalyst-integ-cliq');
|
|
4
4
|
const command = cliq.command();
|
|
5
|
-
const https = require('https');
|
|
6
5
|
|
|
7
6
|
command.executionHandler(async (req, res) => {
|
|
8
7
|
let text;
|
|
@@ -37,17 +36,17 @@ command.executionHandler(async (req, res) => {
|
|
|
37
36
|
|
|
38
37
|
command.suggestionHandler(async (req, res) => {
|
|
39
38
|
if(comp(req.name,'catalystresource')) {
|
|
40
|
-
const suggestion1 = command.
|
|
39
|
+
const suggestion1 = command.newCommandSuggestion();
|
|
41
40
|
suggestion1.title = 'API doc';
|
|
42
41
|
suggestion1.description = 'Catalyst API documentation';
|
|
43
42
|
suggestion1.imageurl = 'https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png';
|
|
44
43
|
|
|
45
|
-
const suggestion2 = command.
|
|
44
|
+
const suggestion2 = command.newCommandSuggestion();
|
|
46
45
|
suggestion2.title = 'CLI doc';
|
|
47
46
|
suggestion2.description = 'Catalyst CLI documentation';
|
|
48
47
|
suggestion2.imageurl = 'https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png';
|
|
49
48
|
|
|
50
|
-
const suggestion3 = command.
|
|
49
|
+
const suggestion3 = command.newCommandSuggestion();
|
|
51
50
|
suggestion3.title = 'Help docs';
|
|
52
51
|
suggestion3.description = 'Catalyst help documentation';
|
|
53
52
|
suggestion3.imageurl = 'https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png';
|
|
@@ -273,6 +273,52 @@ functionHandler.widgetButtonHandler(async (req, res) => {
|
|
|
273
273
|
form.action = form.newFormAction('appletForm');// ** ENTER YOUR FORM FUNCTION NAME HERE **
|
|
274
274
|
return form;
|
|
275
275
|
}
|
|
276
|
+
case 'breadcrumbs': {
|
|
277
|
+
const page = parseInt(req.target.label.split("Page : ")[1].trim()) + 1;
|
|
278
|
+
|
|
279
|
+
const section = res.newWidgetSection();
|
|
280
|
+
section.id = '12345';
|
|
281
|
+
|
|
282
|
+
const elem = section.newWidgetElement();
|
|
283
|
+
elem.type = 'subtext';
|
|
284
|
+
elem.text = 'Page : ' + page;
|
|
285
|
+
section.addElement(elem);
|
|
286
|
+
res.addSection(section);
|
|
287
|
+
|
|
288
|
+
const firstNav = {
|
|
289
|
+
label: 'Page : ' + page,
|
|
290
|
+
type: 'invoke.function',
|
|
291
|
+
name: 'appletFunction',
|
|
292
|
+
id: 'breadcrumbs'
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const linkButton = {
|
|
296
|
+
label: 'Link',
|
|
297
|
+
type: 'open.url',
|
|
298
|
+
url: 'https://www.zoho.com'
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
const bannerButton = {
|
|
302
|
+
label: 'Banner',
|
|
303
|
+
type: 'invoke.function',
|
|
304
|
+
name: 'appletFunction',
|
|
305
|
+
id: 'banner'
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
res.header = {
|
|
309
|
+
title : 'Header ' + page,
|
|
310
|
+
navigation : 'continue',
|
|
311
|
+
buttons : [firstNav, linkButton, bannerButton]
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
res.footer = {
|
|
315
|
+
text : 'Footer text',
|
|
316
|
+
buttons : [linkButton, bannerButton]
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
res.type = 'applet';
|
|
320
|
+
return res;
|
|
321
|
+
}
|
|
276
322
|
default: {
|
|
277
323
|
const msg = functionHandler.newHandlerResponse().newMessage();
|
|
278
324
|
msg.text = 'Applet Button executed successfully';
|
|
@@ -93,6 +93,7 @@ widget.viewHandler(async (req, res) => {
|
|
|
93
93
|
linkBtn.url = 'https://console.catalyst.zoho.com';
|
|
94
94
|
info.button = linkBtn;
|
|
95
95
|
res.info = info;
|
|
96
|
+
return res;
|
|
96
97
|
}
|
|
97
98
|
else if (comp(target, 'cliqTab')) {
|
|
98
99
|
|
|
@@ -238,6 +239,36 @@ widget.viewHandler(async (req, res) => {
|
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
241
|
|
|
242
|
+
const firstNav = {
|
|
243
|
+
label: 'Page : 1',
|
|
244
|
+
type: 'invoke.function',
|
|
245
|
+
name: 'appletFunction',
|
|
246
|
+
id: 'breadcrumbs'
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const linkButton = {
|
|
250
|
+
label: 'Link',
|
|
251
|
+
type: 'open.url',
|
|
252
|
+
url: 'https://www.zoho.com'
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const bannerButton = {
|
|
256
|
+
label: 'Banner',
|
|
257
|
+
type: 'invoke.function',
|
|
258
|
+
name: 'appletFunction',
|
|
259
|
+
id: 'banner'
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
res.header = {
|
|
263
|
+
title : 'Header 1',
|
|
264
|
+
navigation : 'new',
|
|
265
|
+
buttons : [firstNav, linkButton, bannerButton]
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
res.footer = {
|
|
269
|
+
text : 'Footer text',
|
|
270
|
+
buttons : [linkButton, bannerButton]
|
|
271
|
+
};
|
|
241
272
|
return res;
|
|
242
273
|
});
|
|
243
274
|
|
|
@@ -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
|
|
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);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const reloadSocket = new WebSocket('ws://localhost:{{_PORT_}}/client-reload');
|
|
2
|
+
|
|
3
|
+
reloadSocket.onopen = () => {
|
|
4
|
+
console.log('Connection established with the server');
|
|
5
|
+
reloadSocket.send('connected');
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
reloadSocket.onmessage = (message) => {
|
|
9
|
+
if (message.data === 'reload') {
|
|
10
|
+
reloadSocket.close();
|
|
11
|
+
window.location.reload();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
reloadSocket.onclose = () => {
|
|
16
|
+
console.log('connection closed');
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
reloadSocket.onerror = (err) => {
|
|
20
|
+
console.error('Reload error: ', err);
|
|
21
|
+
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const ansi_colors_1 = require("ansi-colors");
|
|
16
|
-
const prompt_1 = __importDefault(require("../../prompt"));
|
|
17
|
-
const constants_1 = require("../../util_modules/constants");
|
|
18
|
-
const fs_1 = require("../../util_modules/fs");
|
|
19
|
-
const logger_1 = require("../../util_modules/logger");
|
|
20
|
-
const project_1 = require("../../util_modules/project");
|
|
21
|
-
const client_1 = require("../util/client");
|
|
22
|
-
exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
logger_1.message('A directory ' + ansi_colors_1.cyan.bold('client') + ' will be created with a webapp pre-configured.');
|
|
24
|
-
const clientDirPath = project_1.resolveProjectPath(constants_1.FOLDERNAME.client);
|
|
25
|
-
const foldeExists = yield fs_1.ASYNC.dirExists(clientDirPath);
|
|
26
|
-
const overwriteAns = foldeExists
|
|
27
|
-
? yield prompt_1.default.ask(prompt_1.default.question('overwrite', 'Directory ' + ansi_colors_1.underline(constants_1.FOLDERNAME.client) + ' already exists. Overwrite ?', {
|
|
28
|
-
type: 'confirm',
|
|
29
|
-
defaultAns: false
|
|
30
|
-
}))
|
|
31
|
-
: { overwrite: true };
|
|
32
|
-
if (!overwriteAns.overwrite) {
|
|
33
|
-
logger_1.message('Skipping client setup...');
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
yield fs_1.ASYNC.deleteDir(clientDirPath).catch();
|
|
37
|
-
yield fs_1.ASYNC.ensureDir(clientDirPath);
|
|
38
|
-
yield fs_1.ASYNC.copyDir(constants_1.TEMPLATE.client, clientDirPath);
|
|
39
|
-
const clientNameAns = yield prompt_1.default.ask(prompt_1.default.question('clientName', 'How do you want to address the client ?', {
|
|
40
|
-
defaultAns: 'sampleApp',
|
|
41
|
-
validate: (ans) => {
|
|
42
|
-
if (ans.match(constants_1.REGEX.client.package_name)) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
return 'Invalid client name';
|
|
46
|
-
}
|
|
47
|
-
}));
|
|
48
|
-
yield fs_1.ASYNC.findAndReplace(clientDirPath)(constants_1.PLACEHOLDER.client.package.name, clientNameAns.clientName);
|
|
49
|
-
return client_1.fillClientInitPayload(project_1.resolveProjectPath(constants_1.FOLDERNAME.client), clientNameAns.clientName);
|
|
50
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
const express_1 = __importStar(require("express"));
|
|
23
|
-
const args = process.argv.slice(2);
|
|
24
|
-
const listenPort = parseInt(args[0], 10);
|
|
25
|
-
const clientDetails = JSON.parse(args[1]);
|
|
26
|
-
const app = express_1.default();
|
|
27
|
-
app.use('/app', express_1.static(clientDetails.source, { index: clientDetails.homepage }));
|
|
28
|
-
app.listen(listenPort).on('error', (err) => {
|
|
29
|
-
console.error(err);
|
|
30
|
-
});
|