zcatalyst-cli 1.18.0-beta.9 → 1.18.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/README.md +11 -6
- package/docs/commands/slate/unlink.toml +9 -0
- package/docs/endpoints/lib/env.toml +3 -1
- package/docs/endpoints/lib/slate.toml +3 -0
- package/docs/serve/server/lib/slate/index.toml +14 -0
- package/docs/slate-utils.toml +4 -0
- package/docs/util_modules/config/lib/slate.toml +4 -0
- package/lib/archiver.js +18 -9
- package/lib/authentication/login.js +6 -5
- package/lib/code-deck.js +5 -6
- package/lib/command_needs/auth.js +1 -1
- package/lib/command_needs/rc.js +40 -3
- package/lib/commands/codelib/install.js +1 -0
- package/lib/commands/deploy/index.js +4 -0
- package/lib/commands/deploy/slate.js +58 -0
- package/lib/commands/index.js +2 -3
- package/lib/commands/init.js +0 -10
- package/lib/commands/slate/create.js +59 -0
- package/lib/commands/slate/link.js +59 -0
- package/lib/commands/slate/unlink.js +75 -0
- package/lib/commands/zest/generate/index.js +1 -6
- package/lib/config-store.js +2 -1
- package/lib/deploy/features/index.js +3 -0
- package/lib/deploy/features/slate.js +123 -0
- package/lib/endpoints/index.js +8 -1
- package/lib/endpoints/lib/env.js +2 -1
- package/lib/endpoints/lib/sdk.js +2 -2
- package/lib/endpoints/lib/slate.js +107 -0
- package/lib/fn-utils/lib/common.js +1 -1
- package/lib/iac/status/deploy.js +1 -5
- package/lib/index.js +1 -1
- package/lib/init/features/appsail/index.js +2 -3
- package/lib/init/features/index.js +13 -1
- package/lib/init/features/project.js +1 -1
- package/lib/init/features/slate/index.js +313 -0
- package/lib/internal/api.js +1 -1
- package/lib/internal/command.js +10 -6
- package/lib/port-resolver.js +7 -0
- package/lib/prompt/index.js +22 -6
- package/lib/prompt/types/file-path.js +10 -7
- package/lib/serve/features/index.js +8 -1
- package/lib/serve/features/slate.js +47 -0
- package/lib/serve/server/index.js +61 -1
- package/lib/serve/server/lib/appsail/index.js +1 -1
- package/lib/serve/server/lib/master/index.js +25 -21
- package/lib/serve/server/lib/master/slate.js +45 -0
- package/lib/serve/server/lib/master/utils.js +9 -3
- package/lib/serve/server/lib/slate/index.js +115 -0
- package/lib/serve/server/lib/slate/static-server.js +194 -0
- package/lib/serve/server/lib/web_client/server.js +2 -1
- package/lib/slate-utils.js +212 -0
- package/lib/util_modules/config/index.js +3 -1
- package/lib/util_modules/config/lib/slate.js +98 -0
- package/lib/util_modules/constants/lib/cliq-handlers.js +18 -10
- package/lib/util_modules/constants/lib/dc-type.js +8 -0
- package/lib/util_modules/constants/lib/default.js +4 -0
- package/lib/util_modules/constants/lib/file-names.js +7 -1
- package/lib/util_modules/constants/lib/folder-names.js +1 -0
- package/lib/util_modules/constants/lib/placeholders.js +2 -1
- package/lib/util_modules/constants/lib/scopes.js +1 -6
- package/lib/util_modules/context-help.js +2 -2
- package/lib/util_modules/fs/lib/async.js +14 -3
- package/lib/util_modules/fs/lib/sync.js +6 -1
- package/lib/util_modules/parser/toml.js +20 -5
- package/package.json +3 -3
- package/templates/event/integ/cliq/bot/action_handler.json +13 -4
- package/templates/event/integ/cliq/bot/call_handler.json +41 -0
- package/templates/event/integ/cliq/bot/context_handler.json +11 -3
- package/templates/event/integ/cliq/bot/incomingwebhook_handler.json +11 -3
- package/templates/event/integ/cliq/bot/mention_handler.json +12 -4
- package/templates/event/integ/cliq/bot/message_handler.json +13 -4
- package/templates/event/integ/cliq/bot/participation_handler.json +13 -3
- package/templates/event/integ/cliq/bot/welcome_handler.json +12 -8
- package/templates/event/integ/cliq/command/execution_handler.json +12 -3
- package/templates/event/integ/cliq/command/suggestion_handler.json +18 -4
- package/templates/event/integ/cliq/{installation → extension}/installation_handler.json +13 -4
- package/templates/event/integ/cliq/{installation → extension}/installation_validator.json +13 -5
- package/templates/event/integ/cliq/extension/uninstallation_handler.json +37 -0
- package/templates/event/integ/cliq/function/button_handler.json +13 -5
- package/templates/event/integ/cliq/function/form_change_handler.json +9 -3
- package/templates/event/integ/cliq/function/form_handler.json +11 -3
- package/templates/event/integ/cliq/function/form_values_handler.json +9 -3
- package/templates/event/integ/cliq/function/form_view_handler.json +26 -0
- package/templates/event/integ/cliq/function/widget_button_handler.json +14 -5
- package/templates/event/integ/cliq/link_preview/action_handler.json +54 -0
- package/templates/event/integ/cliq/link_preview/after_send_handler.json +47 -0
- package/templates/event/integ/cliq/link_preview/menu_handler.json +47 -0
- package/templates/event/integ/cliq/link_preview/preview_handler.json +47 -0
- package/templates/event/integ/cliq/messageaction/execution_handler.json +11 -3
- package/templates/event/integ/cliq/widget/view_handler.json +12 -4
- package/templates/init/client/react/react_js/template/src/index.js +3 -3
- package/templates/init/client/react/react_ts/template/src/index.tsx +3 -3
- package/templates/init/client/react/react_ts/template.json +3 -3
- package/templates/init/functions/java/event/sample.java +4 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/BotHandler.java +29 -23
- package/templates/init/functions/java/integ/cliq/com/handlers/CommandHandler.java +14 -17
- package/templates/init/functions/java/integ/cliq/com/handlers/ExtensionHandler.java +41 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/FunctionHandler.java +74 -22
- package/templates/init/functions/java/integ/cliq/com/handlers/LinkPreviewHandler.java +108 -0
- package/templates/init/functions/java/integ/cliq/com/handlers/MessageActionHandler.java +6 -8
- package/templates/init/functions/java/integ/cliq/sample.java +10 -0
- package/templates/init/functions/node/aio/package.json +1 -1
- package/templates/init/functions/node/bio/package.json +1 -1
- package/templates/init/functions/node/cron/package.json +1 -1
- package/templates/init/functions/node/event/package.json +1 -1
- package/templates/init/functions/node/event/sample.js +1 -0
- package/templates/init/functions/node/event/types/event.d.ts +7 -0
- package/templates/init/functions/node/integ/cliq/handlers/bot-handler.js +4 -0
- package/templates/init/functions/node/integ/cliq/handlers/command-handler.js +3 -5
- package/templates/init/functions/node/integ/cliq/handlers/{installation-validator.js → extension-handler.js} +20 -3
- package/templates/init/functions/node/integ/cliq/handlers/function-handler.js +42 -0
- package/templates/init/functions/node/integ/cliq/handlers/link-preview-handler.js +73 -0
- package/templates/init/functions/node/integ/cliq/package.json +1 -1
- package/templates/init/functions/node/integ/convokraft/package.json +1 -1
- package/templates/init/functions/node/job/package.json +1 -1
- package/templates/init/functions/python/event/sample.py +9 -5
- package/templates/init/functions/python/integ/cliq/handlers/bot_handler.py +13 -3
- package/templates/init/functions/python/integ/cliq/handlers/command_handler.py +7 -7
- package/templates/init/functions/python/integ/cliq/handlers/extension_handler.py +25 -0
- package/templates/init/functions/python/integ/cliq/handlers/function_handler.py +54 -10
- package/templates/init/functions/python/integ/cliq/handlers/link_preview_handler.py +76 -0
- package/templates/init/functions/python/integ/cliq/handlers/widget_handler.py +10 -9
- package/templates/init/functions/python/integ/cliq/sample.py +2 -2
- package/templates/init.txt +2 -1
- package/templates/init/functions/java/integ/cliq/com/handlers/InstallationHandler.java +0 -20
- package/templates/init/functions/java/integ/cliq/com/handlers/InstallationValidator.java +0 -22
- package/templates/init/functions/node/integ/cliq/handlers/installation-handler.js +0 -15
- package/templates/init/functions/python/integ/cliq/handlers/installation_handler.py +0 -12
- package/templates/init/functions/python/integ/cliq/handlers/installation_validator.py +0 -16
|
@@ -7,10 +7,17 @@
|
|
|
7
7
|
"timestamp": 1569520690703,
|
|
8
8
|
"params" : {
|
|
9
9
|
"environment" : {
|
|
10
|
-
|
|
10
|
+
"tld": ".com",
|
|
11
|
+
"data_center": "US",
|
|
12
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
11
13
|
},
|
|
12
|
-
"access":
|
|
13
|
-
"user_id": "
|
|
14
|
+
"access": {
|
|
15
|
+
"user_id": "130720038",
|
|
16
|
+
"zoho_user_id": "130720038",
|
|
17
|
+
"organization": {
|
|
18
|
+
"type": "company",
|
|
19
|
+
"id": "123456456"
|
|
20
|
+
},
|
|
14
21
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
15
22
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
16
23
|
},
|
|
@@ -23,12 +30,14 @@
|
|
|
23
30
|
"id": "123456",
|
|
24
31
|
"email": "scott.fisher@zylcal.com",
|
|
25
32
|
"admin" : true,
|
|
26
|
-
"organization_id" : "123456456"
|
|
33
|
+
"organization_id" : "123456456",
|
|
34
|
+
"zoho_user_id": "130720038"
|
|
27
35
|
},
|
|
28
36
|
"target": {
|
|
29
37
|
"label": "click",
|
|
30
38
|
"section_id": "1",
|
|
31
|
-
"id": ""
|
|
39
|
+
"id": "",
|
|
40
|
+
"tab_id":""
|
|
32
41
|
}
|
|
33
42
|
}
|
|
34
43
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"handler": {
|
|
3
|
+
"type": "unfurl_button_action_handler"
|
|
4
|
+
},
|
|
5
|
+
"type": "link_preview",
|
|
6
|
+
"timestamp": 1569520690703,
|
|
7
|
+
"params" : {
|
|
8
|
+
"url": "https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png",
|
|
9
|
+
"domain": "zohowebstatic.com",
|
|
10
|
+
"environment" : {
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
14
|
+
},
|
|
15
|
+
"access": {
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
},
|
|
22
|
+
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
23
|
+
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
24
|
+
},
|
|
25
|
+
"user": {
|
|
26
|
+
"country": "us",
|
|
27
|
+
"timezone": "Asia/calcutta",
|
|
28
|
+
"last_name": "Fisher",
|
|
29
|
+
"first_name": "Scott",
|
|
30
|
+
"language": "en",
|
|
31
|
+
"id": "123456",
|
|
32
|
+
"email": "scott.fisher@zylcal.com",
|
|
33
|
+
"admin" : true,
|
|
34
|
+
"organization_id" : "123456456",
|
|
35
|
+
"zoho_user_id": "130720038"
|
|
36
|
+
},
|
|
37
|
+
"chat": {
|
|
38
|
+
"owner": "123456",
|
|
39
|
+
"chat_type": "channel",
|
|
40
|
+
"id": "CD_1256246524399772951_1741337",
|
|
41
|
+
"channel_id":"O3261041256000451268",
|
|
42
|
+
"type": "channel",
|
|
43
|
+
"channel_unique_name": "sample",
|
|
44
|
+
"title": "Sample"
|
|
45
|
+
},
|
|
46
|
+
"target": {
|
|
47
|
+
"label": "Delete",
|
|
48
|
+
"params": {
|
|
49
|
+
"action": "delete_note"
|
|
50
|
+
},
|
|
51
|
+
"hint": "Delete"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"handler": {
|
|
3
|
+
"type": "unfurl_post_message_handler"
|
|
4
|
+
},
|
|
5
|
+
"type": "link_preview",
|
|
6
|
+
"timestamp": 1569520690703,
|
|
7
|
+
"params" : {
|
|
8
|
+
"url": "https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png",
|
|
9
|
+
"domain": "zohowebstatic.com",
|
|
10
|
+
"environment" : {
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
14
|
+
},
|
|
15
|
+
"access": {
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
},
|
|
22
|
+
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
23
|
+
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
24
|
+
},
|
|
25
|
+
"user": {
|
|
26
|
+
"country": "us",
|
|
27
|
+
"timezone": "Asia/calcutta",
|
|
28
|
+
"last_name": "Fisher",
|
|
29
|
+
"first_name": "Scott",
|
|
30
|
+
"language": "en",
|
|
31
|
+
"id": "123456",
|
|
32
|
+
"email": "scott.fisher@zylcal.com",
|
|
33
|
+
"admin" : true,
|
|
34
|
+
"organization_id" : "123456456",
|
|
35
|
+
"zoho_user_id": "130720038"
|
|
36
|
+
},
|
|
37
|
+
"chat": {
|
|
38
|
+
"owner": "123456",
|
|
39
|
+
"chat_type": "channel",
|
|
40
|
+
"id": "CD_1256246524399772951_1741337",
|
|
41
|
+
"channel_id":"O3261041256000451268",
|
|
42
|
+
"type": "channel",
|
|
43
|
+
"channel_unique_name": "sample",
|
|
44
|
+
"title": "Sample"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"handler": {
|
|
3
|
+
"type": "unfurl_dynamic_action_handler"
|
|
4
|
+
},
|
|
5
|
+
"type": "link_preview",
|
|
6
|
+
"timestamp": 1569520690703,
|
|
7
|
+
"params" : {
|
|
8
|
+
"url": "https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png",
|
|
9
|
+
"domain": "zohowebstatic.com",
|
|
10
|
+
"environment" : {
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
14
|
+
},
|
|
15
|
+
"access": {
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
},
|
|
22
|
+
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
23
|
+
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
24
|
+
},
|
|
25
|
+
"user": {
|
|
26
|
+
"country": "us",
|
|
27
|
+
"timezone": "Asia/calcutta",
|
|
28
|
+
"last_name": "Fisher",
|
|
29
|
+
"first_name": "Scott",
|
|
30
|
+
"language": "en",
|
|
31
|
+
"id": "123456",
|
|
32
|
+
"email": "scott.fisher@zylcal.com",
|
|
33
|
+
"admin" : true,
|
|
34
|
+
"organization_id" : "123456456",
|
|
35
|
+
"zoho_user_id": "130720038"
|
|
36
|
+
},
|
|
37
|
+
"chat": {
|
|
38
|
+
"owner": "123456",
|
|
39
|
+
"chat_type": "channel",
|
|
40
|
+
"id": "CD_1256246524399772951_1741337",
|
|
41
|
+
"channel_id":"O3261041256000451268",
|
|
42
|
+
"type": "channel",
|
|
43
|
+
"channel_unique_name": "sample",
|
|
44
|
+
"title": "Sample"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"handler": {
|
|
3
|
+
"type": "unfurl_handler"
|
|
4
|
+
},
|
|
5
|
+
"type": "link_preview",
|
|
6
|
+
"timestamp": 1569520690703,
|
|
7
|
+
"params" : {
|
|
8
|
+
"url": "https://www.zohowebstatic.com/sites/default/files/styles/product-home-page/public/catalyst-icon.png",
|
|
9
|
+
"domain": "zohowebstatic.com",
|
|
10
|
+
"environment" : {
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
14
|
+
},
|
|
15
|
+
"access": {
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
},
|
|
22
|
+
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
23
|
+
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
24
|
+
},
|
|
25
|
+
"user": {
|
|
26
|
+
"country": "us",
|
|
27
|
+
"timezone": "Asia/calcutta",
|
|
28
|
+
"last_name": "Fisher",
|
|
29
|
+
"first_name": "Scott",
|
|
30
|
+
"language": "en",
|
|
31
|
+
"id": "123456",
|
|
32
|
+
"email": "scott.fisher@zylcal.com",
|
|
33
|
+
"admin" : true,
|
|
34
|
+
"organization_id" : "123456456",
|
|
35
|
+
"zoho_user_id": "130720038"
|
|
36
|
+
},
|
|
37
|
+
"chat": {
|
|
38
|
+
"owner": "123456",
|
|
39
|
+
"chat_type": "channel",
|
|
40
|
+
"id": "CD_1256246524399772951_1741337",
|
|
41
|
+
"channel_id":"O3261041256000451268",
|
|
42
|
+
"type": "channel",
|
|
43
|
+
"channel_unique_name": "sample",
|
|
44
|
+
"title": "Sample"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -8,10 +8,17 @@
|
|
|
8
8
|
"timestamp": 1569520690703,
|
|
9
9
|
"params" : {
|
|
10
10
|
"environment" : {
|
|
11
|
-
|
|
11
|
+
"tld": ".com",
|
|
12
|
+
"data_center": "US",
|
|
13
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
12
14
|
},
|
|
13
15
|
"access": {
|
|
14
|
-
"user_id": "
|
|
16
|
+
"user_id": "130720038",
|
|
17
|
+
"zoho_user_id": "130720038",
|
|
18
|
+
"organization": {
|
|
19
|
+
"type": "company",
|
|
20
|
+
"id": "123456456"
|
|
21
|
+
},
|
|
15
22
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
16
23
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
17
24
|
},
|
|
@@ -44,7 +51,8 @@
|
|
|
44
51
|
"id": "123456",
|
|
45
52
|
"email": "scott.fisher@zylcal.com",
|
|
46
53
|
"admin" : true,
|
|
47
|
-
"organization_id" : "123456456"
|
|
54
|
+
"organization_id" : "123456456",
|
|
55
|
+
"zoho_user_id": "130720038"
|
|
48
56
|
},
|
|
49
57
|
"mentions": [],
|
|
50
58
|
"message": {
|
|
@@ -7,14 +7,21 @@
|
|
|
7
7
|
"timestamp": 1569520690703,
|
|
8
8
|
"params" : {
|
|
9
9
|
"environment" : {
|
|
10
|
-
|
|
10
|
+
"tld": ".com",
|
|
11
|
+
"data_center": "US",
|
|
12
|
+
"base_url": "https://cliq.zoho.com/company/123456456"
|
|
11
13
|
},
|
|
12
14
|
"access": {
|
|
13
|
-
"user_id": "
|
|
15
|
+
"user_id": "130720038",
|
|
16
|
+
"zoho_user_id": "130720038",
|
|
17
|
+
"organization": {
|
|
18
|
+
"type": "company",
|
|
19
|
+
"id": "123456456"
|
|
20
|
+
},
|
|
14
21
|
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0",
|
|
15
22
|
"chat_id": "CT_2243226337559778047_661211447-B2"
|
|
16
23
|
},
|
|
17
|
-
"user":
|
|
24
|
+
"user": {
|
|
18
25
|
"country": "us",
|
|
19
26
|
"timezone": "Asia/calcutta",
|
|
20
27
|
"last_name": "Fisher",
|
|
@@ -23,7 +30,8 @@
|
|
|
23
30
|
"id": "123456",
|
|
24
31
|
"email": "scott.fisher@zylcal.com",
|
|
25
32
|
"admin" : true,
|
|
26
|
-
"organization_id" : "123456456"
|
|
33
|
+
"organization_id" : "123456456",
|
|
34
|
+
"zoho_user_id": "130720038"
|
|
27
35
|
},
|
|
28
36
|
"target": {},
|
|
29
37
|
"event": "load",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
3
|
import './index.css';
|
|
4
4
|
import App from './App';
|
|
5
5
|
import reportWebVitals from './reportWebVitals';
|
|
6
6
|
|
|
7
|
-
ReactDOM.
|
|
7
|
+
const root = ReactDOM.createRoot(document.getElementById('root'));
|
|
8
|
+
root.render(
|
|
8
9
|
<React.StrictMode>
|
|
9
10
|
<App />
|
|
10
11
|
</React.StrictMode>,
|
|
11
|
-
document.getElementById('root')
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
// If you want to start measuring performance in your app, pass a function
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
2
|
+
import ReactDOM, { Container } from 'react-dom/client';
|
|
3
3
|
import './index.css';
|
|
4
4
|
import App from './App';
|
|
5
5
|
import reportWebVitals from './reportWebVitals';
|
|
6
6
|
|
|
7
|
-
ReactDOM.
|
|
7
|
+
const root = ReactDOM.createRoot(document.getElementById('root') as Container);
|
|
8
|
+
root.render(
|
|
8
9
|
<React.StrictMode>
|
|
9
10
|
<App />
|
|
10
11
|
</React.StrictMode>,
|
|
11
|
-
document.getElementById('root')
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
// If you want to start measuring performance in your app, pass a function
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"@testing-library/jest-dom": "^5.11.4",
|
|
5
5
|
"@testing-library/react": "^11.1.0",
|
|
6
6
|
"@testing-library/user-event": "^12.1.10",
|
|
7
|
-
"@types/node": "
|
|
8
|
-
"@types/react": "
|
|
9
|
-
"@types/react-dom": "
|
|
7
|
+
"@types/node": "latest",
|
|
8
|
+
"@types/react": "latest",
|
|
9
|
+
"@types/react-dom": "latest",
|
|
10
10
|
"@types/jest": "^26.0.15",
|
|
11
11
|
"typescript": "^4.1.2",
|
|
12
12
|
"web-vitals": "^1.0.1"
|
|
@@ -24,6 +24,10 @@ public class {{_CLASS_}} implements CatalystEventHandler{
|
|
|
24
24
|
ZCProject.initProject();
|
|
25
25
|
Object eventData = paramEventRequest.getData();
|
|
26
26
|
LOGGER.log(Level.SEVERE,"Data is "+eventData.toString());
|
|
27
|
+
|
|
28
|
+
Object rawData = paramEventRequest.getRawData();
|
|
29
|
+
LOGGER.log(Level.SEVERE,"Raw Data is "+rawData.toString());
|
|
30
|
+
|
|
27
31
|
ZCCache.getInstance().putCacheValue("{{_CLASS_}}", "Working", 1l);
|
|
28
32
|
LOGGER.log(Level.SEVERE,"Project Details "+paramEventRequest.getProjectDetails().toString());
|
|
29
33
|
}
|
|
@@ -23,6 +23,7 @@ import com.zc.cliq.objects.ButtonObject;
|
|
|
23
23
|
import com.zc.cliq.objects.CardDetails;
|
|
24
24
|
import com.zc.cliq.objects.Message;
|
|
25
25
|
import com.zc.cliq.objects.Slide;
|
|
26
|
+
import com.zc.cliq.requests.BotCallHandlerRequest;
|
|
26
27
|
import com.zc.cliq.requests.BotContextHandlerRequest;
|
|
27
28
|
import com.zc.cliq.requests.BotMentionHandlerRequest;
|
|
28
29
|
import com.zc.cliq.requests.BotMenuActionHandlerRequest;
|
|
@@ -30,6 +31,8 @@ import com.zc.cliq.requests.BotMessageHandlerRequest;
|
|
|
30
31
|
import com.zc.cliq.requests.BotParticipationHandlerRequest;
|
|
31
32
|
import com.zc.cliq.requests.BotWebhookHandlerRequest;
|
|
32
33
|
import com.zc.cliq.requests.BotWelcomeHandlerRequest;
|
|
34
|
+
import com.zc.cliq.responses.CoreResponse;
|
|
35
|
+
import com.zc.cliq.responses.WebhookHandlerResponse;
|
|
33
36
|
import com.zc.cliq.util.ZCCliqUtil;
|
|
34
37
|
import com.zc.component.cache.ZCCache;
|
|
35
38
|
|
|
@@ -37,18 +40,18 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
37
40
|
Logger LOGGER = Logger.getLogger(BotHandler.class.getName());
|
|
38
41
|
|
|
39
42
|
@Override
|
|
40
|
-
public
|
|
43
|
+
public Message welcomeHandler(BotWelcomeHandlerRequest req) {
|
|
41
44
|
String uName = req.getUser() != null ? req.getUser().getFirstName() : "user";
|
|
42
45
|
String text = "Hello " + uName + ". Thank you for subscribing :smile:";
|
|
43
46
|
Message msg = Message.getInstance(text);
|
|
44
|
-
return
|
|
47
|
+
return msg;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
@Override
|
|
48
|
-
public
|
|
51
|
+
public CoreResponse messageHandler(BotMessageHandlerRequest req) throws Exception {
|
|
49
52
|
try {
|
|
50
53
|
String message = req.getMessage();
|
|
51
|
-
|
|
54
|
+
Message resp = Message.getInstance();
|
|
52
55
|
|
|
53
56
|
String text;
|
|
54
57
|
if (message == null) {
|
|
@@ -60,7 +63,7 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
60
63
|
suggestion.addSuggestion("Not bad");
|
|
61
64
|
suggestion.addSuggestion("Meh");
|
|
62
65
|
suggestion.addSuggestion("Worst");
|
|
63
|
-
resp.
|
|
66
|
+
resp.setSuggestion(suggestion);
|
|
64
67
|
} else if (message.equalsIgnoreCase("Good") || message.equalsIgnoreCase("Not bad")) {
|
|
65
68
|
text = "That's glad to hear :smile:";
|
|
66
69
|
} else if (message.equalsIgnoreCase("Meh") || message.equalsIgnoreCase("Worst")) {
|
|
@@ -90,7 +93,7 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
90
93
|
param3.addSuggestion("NO");
|
|
91
94
|
|
|
92
95
|
context.setParams(param1, param2, param3);
|
|
93
|
-
resp.
|
|
96
|
+
resp.setContext(context);
|
|
94
97
|
} else if (message.equalsIgnoreCase("button")) {
|
|
95
98
|
|
|
96
99
|
Message msg = Message.getInstance("Here's your button");
|
|
@@ -104,12 +107,12 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
104
107
|
action.setData(actionData);
|
|
105
108
|
btnObj.setAction(action);
|
|
106
109
|
msg.addButton(btnObj);
|
|
107
|
-
return
|
|
110
|
+
return msg;
|
|
108
111
|
} else {
|
|
109
112
|
text = "Sorry, I'm not programmed yet to do this :sad:";
|
|
110
113
|
}
|
|
111
114
|
|
|
112
|
-
resp.
|
|
115
|
+
resp.setText(text);
|
|
113
116
|
return resp;
|
|
114
117
|
|
|
115
118
|
} catch (Exception ex) {
|
|
@@ -119,8 +122,8 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
@Override
|
|
122
|
-
public
|
|
123
|
-
|
|
125
|
+
public CoreResponse contextHandler(BotContextHandlerRequest req) throws Exception {
|
|
126
|
+
JSONObject resp = new JSONObject();
|
|
124
127
|
if (req.getContextId().equals("personal_details")) {
|
|
125
128
|
Map<String, String> answers = req.getAnswers();
|
|
126
129
|
StringBuilder str = new StringBuilder();
|
|
@@ -140,20 +143,18 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
140
143
|
|
|
141
144
|
resp.put("text", "Nice ! I have collected your info: \n" + str.toString());
|
|
142
145
|
}
|
|
143
|
-
return resp;
|
|
146
|
+
return ZCCliqUtil.mapper.readValue(resp.toString(), Message.class);
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
@Override
|
|
147
|
-
public
|
|
150
|
+
public CoreResponse mentionHandler(BotMentionHandlerRequest req) {
|
|
148
151
|
String text = "Hey *" + req.getUser().getFirstName() + "*, thanks for mentioning me here. I'm from Catalyst city";
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return resp;
|
|
152
|
+
Message msg = Message.getInstance(text);
|
|
153
|
+
return msg;
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
@Override
|
|
155
|
-
public
|
|
156
|
-
Map<String, Object> resp = new HashMap<String, Object>();
|
|
157
|
+
public CoreResponse menuActionHandler(BotMenuActionHandlerRequest req) {
|
|
157
158
|
String text;
|
|
158
159
|
if (req.getActionName().equals("Say Hi")) {
|
|
159
160
|
text = "Hi";
|
|
@@ -162,12 +163,12 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
162
163
|
} else {
|
|
163
164
|
text = "Menu action triggered :fist:";
|
|
164
165
|
}
|
|
165
|
-
|
|
166
|
-
return
|
|
166
|
+
Message msg = Message.getInstance(text);
|
|
167
|
+
return msg;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
@Override
|
|
170
|
-
public
|
|
171
|
+
public WebhookHandlerResponse webhookHandler(BotWebhookHandlerRequest req) throws Exception {
|
|
171
172
|
// Sample handler class for incoming mails in ZohoMail
|
|
172
173
|
// Please configure the bot in ZohoMail's outgoing webhooks
|
|
173
174
|
JSONObject reqBody = req.getBody();
|
|
@@ -205,11 +206,11 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
205
206
|
|
|
206
207
|
msg.addSlide(gifSlide);
|
|
207
208
|
|
|
208
|
-
return
|
|
209
|
+
return msg;
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
@Override
|
|
212
|
-
public
|
|
213
|
+
public CoreResponse participationHandler(BotParticipationHandlerRequest req) throws Exception {
|
|
213
214
|
String text;
|
|
214
215
|
if (req.getOperation().equals(CHANNEL_OPERATION.ADDED)) {
|
|
215
216
|
text = "Hi. Thanks for adding me to the channel :smile:";
|
|
@@ -219,6 +220,11 @@ public class BotHandler implements com.zc.cliq.interfaces.BotHandler {
|
|
|
219
220
|
text = "I'm too a participant of this chat :wink:";
|
|
220
221
|
}
|
|
221
222
|
Message msg = Message.getInstance(text);
|
|
222
|
-
return
|
|
223
|
+
return msg;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@Override
|
|
227
|
+
public void callHandler(BotCallHandlerRequest req) throws Exception {
|
|
228
|
+
// Logic for bot call post handling
|
|
223
229
|
}
|
|
224
230
|
}
|
|
@@ -2,24 +2,23 @@
|
|
|
2
2
|
package com.handlers;
|
|
3
3
|
|
|
4
4
|
import java.util.ArrayList;
|
|
5
|
-
import java.util.HashMap;
|
|
6
5
|
import java.util.List;
|
|
7
|
-
|
|
6
|
+
|
|
8
7
|
import com.zc.cliq.enums.FORM_FIELD_TEXT_FORMAT;
|
|
9
8
|
import com.zc.cliq.enums.FORM_FIELD_TYPE;
|
|
10
9
|
import com.zc.cliq.objects.CommandSuggestion;
|
|
11
10
|
import com.zc.cliq.objects.Form;
|
|
12
|
-
import com.zc.cliq.objects.
|
|
11
|
+
import com.zc.cliq.objects.FormAction;
|
|
13
12
|
import com.zc.cliq.objects.FormInput;
|
|
14
13
|
import com.zc.cliq.objects.FormValue;
|
|
14
|
+
import com.zc.cliq.objects.Message;
|
|
15
15
|
import com.zc.cliq.requests.CommandHandlerRequest;
|
|
16
|
-
import com.zc.cliq.
|
|
16
|
+
import com.zc.cliq.responses.CoreResponse;
|
|
17
17
|
|
|
18
18
|
public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
19
19
|
@Override
|
|
20
|
-
public
|
|
20
|
+
public CoreResponse executionHandler(CommandHandlerRequest req) throws Exception {
|
|
21
21
|
|
|
22
|
-
Map<String, Object> resp = new HashMap<String, Object>();
|
|
23
22
|
String text;
|
|
24
23
|
String commandName = req.getName();
|
|
25
24
|
if (commandName.equals("catalystresource")) {
|
|
@@ -42,8 +41,8 @@ public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
|
42
41
|
text = "Command executed successfully!";
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
return
|
|
44
|
+
Message msg = Message.getInstance(text);
|
|
45
|
+
return msg;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
@Override
|
|
@@ -60,7 +59,7 @@ public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
|
60
59
|
return suggestionList;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
private static
|
|
62
|
+
private static Form getForm() {
|
|
64
63
|
Form form = Form.getInstance();
|
|
65
64
|
form.setTitle("Asset Request");
|
|
66
65
|
form.setHint("Raise your asset request");
|
|
@@ -68,12 +67,10 @@ public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
|
68
67
|
form.setButtonLabel("Raise Request");
|
|
69
68
|
form.setVersion(1);
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
form.setActions(actions);
|
|
70
|
+
FormAction action = FormAction.getInstance("formFunctionLatest"); // ** ENTER YOUR FORM FUNCTION NAME HERE **
|
|
71
|
+
form.setAction(action);
|
|
75
72
|
|
|
76
|
-
FormInput username = FormInput.
|
|
73
|
+
FormInput username = FormInput.getInstance();
|
|
77
74
|
username.setType(FORM_FIELD_TYPE.TEXT);
|
|
78
75
|
username.setName("username");
|
|
79
76
|
username.setLabel("Name");
|
|
@@ -83,7 +80,7 @@ public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
|
83
80
|
username.setValue("Harold Finch");
|
|
84
81
|
form.addFormInput(username);
|
|
85
82
|
|
|
86
|
-
FormInput email = FormInput.
|
|
83
|
+
FormInput email = FormInput.getInstance();
|
|
87
84
|
email.setType(FORM_FIELD_TYPE.TEXT);
|
|
88
85
|
email.setFormat(FORM_FIELD_TEXT_FORMAT.EMAIL);
|
|
89
86
|
email.setName("email");
|
|
@@ -94,7 +91,7 @@ public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
|
94
91
|
email.setValue("haroldfinch@samaritan.com");
|
|
95
92
|
form.addFormInput(email);
|
|
96
93
|
|
|
97
|
-
FormInput assetType = FormInput.
|
|
94
|
+
FormInput assetType = FormInput.getInstance();
|
|
98
95
|
assetType.setType(FORM_FIELD_TYPE.SELECT);
|
|
99
96
|
assetType.setTriggerOnChange(true);
|
|
100
97
|
assetType.setName("asset-type");
|
|
@@ -106,6 +103,6 @@ public class CommandHandler implements com.zc.cliq.interfaces.CommandHandler {
|
|
|
106
103
|
assetType.addOption(new FormValue("Mobile", "mobile"));
|
|
107
104
|
form.addFormInput(assetType);
|
|
108
105
|
|
|
109
|
-
return
|
|
106
|
+
return form;
|
|
110
107
|
}
|
|
111
108
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//$Id$
|
|
2
|
+
package com.handlers;
|
|
3
|
+
|
|
4
|
+
import com.zc.cliq.enums.EXTENSION_TYPE;
|
|
5
|
+
import com.zc.cliq.enums.STATUS;
|
|
6
|
+
import com.zc.cliq.objects.InstallationResponse;
|
|
7
|
+
import com.zc.cliq.requests.ExtensionHandlerRequest;
|
|
8
|
+
|
|
9
|
+
public class ExtensionHandler implements com.zc.cliq.interfaces.ExtensionHandler{
|
|
10
|
+
|
|
11
|
+
@Override
|
|
12
|
+
public InstallationResponse validateInstallation(ExtensionHandlerRequest req) throws Exception {
|
|
13
|
+
InstallationResponse resp = InstallationResponse.getInstance();
|
|
14
|
+
if (req.getUser().getFirstName().equals("**INVALID_USER**") && req.getAppInfo().getType().equals(EXTENSION_TYPE.UPGRADE)) {
|
|
15
|
+
resp.setStatus(STATUS.FAILURE);
|
|
16
|
+
resp.setTitle("Update not allowed !");
|
|
17
|
+
resp.setMessage("Sorry. Update not allowed for the current app. Please contact admin.");
|
|
18
|
+
} else {
|
|
19
|
+
resp.setStatus(STATUS.SUCCESS);
|
|
20
|
+
}
|
|
21
|
+
return resp;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public InstallationResponse handleInstallation(ExtensionHandlerRequest req) throws Exception {
|
|
26
|
+
InstallationResponse resp = InstallationResponse.getInstance();
|
|
27
|
+
/*
|
|
28
|
+
* // Logic for installation post handling {
|
|
29
|
+
*
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
resp.setStatus(STATUS.SUCCESS);
|
|
33
|
+
return resp;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Override
|
|
37
|
+
public void handleUninstallation(ExtensionHandlerRequest req) throws Exception {
|
|
38
|
+
// Logic for uninstallation post handling
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|