runline 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/actionNetwork/src/index.js +118 -25
- package/dist/plugins/activeCampaign/src/index.js +184 -38
- package/dist/plugins/adalo/src/index.js +40 -8
- package/dist/plugins/affinity/src/index.js +100 -20
- package/dist/plugins/agileCrm/src/index.js +115 -27
- package/dist/plugins/airtable/src/index.js +94 -19
- package/dist/plugins/airtop/src/index.js +266 -62
- package/dist/plugins/apiTemplateIo/src/index.js +25 -5
- package/dist/plugins/asana/src/index.js +195 -41
- package/dist/plugins/autopilot/src/index.js +39 -8
- package/dist/plugins/bambooHr/src/index.js +109 -22
- package/dist/plugins/bannerbear/src/index.js +36 -8
- package/dist/plugins/baserow/src/index.js +35 -7
- package/dist/plugins/beeminder/src/index.js +198 -40
- package/dist/plugins/bitly/src/index.js +46 -10
- package/dist/plugins/bitwarden/src/index.js +167 -36
- package/dist/plugins/box/src/index.js +172 -37
- package/dist/plugins/brandfetch/src/index.js +5 -1
- package/dist/plugins/brevo/src/index.js +136 -29
- package/dist/plugins/bubble/src/index.js +76 -17
- package/dist/plugins/chargebee/src/index.js +35 -7
- package/dist/plugins/circleci/src/index.js +50 -10
- package/dist/plugins/ciscoWebex/src/index.js +131 -27
- package/dist/plugins/clearbit/src/index.js +76 -17
- package/dist/plugins/clickup/src/index.js +500 -107
- package/dist/plugins/clockify/src/index.js +229 -47
- package/dist/plugins/cloudflare/src/index.js +28 -6
- package/dist/plugins/cockpit/src/index.js +54 -12
- package/dist/plugins/coda/src/index.js +81 -19
- package/dist/plugins/coingecko/src/index.js +157 -33
- package/dist/plugins/contentful/src/index.js +85 -17
- package/dist/plugins/convertkit/src/index.js +74 -18
- package/dist/plugins/copper/src/index.js +59 -11
- package/dist/plugins/cortex/src/index.js +55 -13
- package/dist/plugins/currents/src/index.js +310 -71
- package/dist/plugins/customerIo/src/index.js +112 -23
- package/dist/plugins/databricks/src/index.js +549 -115
- package/dist/plugins/deepl/src/index.js +26 -6
- package/dist/plugins/demio/src/index.js +56 -11
- package/dist/plugins/dhl/src/index.js +16 -3
- package/dist/plugins/discord/src/index.js +141 -31
- package/dist/plugins/discourse/src/index.js +136 -31
- package/dist/plugins/disqus/src/index.js +96 -20
- package/dist/plugins/docker/src/index.js +20 -4
- package/dist/plugins/drift/src/index.js +19 -5
- package/dist/plugins/dropbox/src/index.js +139 -30
- package/dist/plugins/dropcontact/src/index.js +21 -4
- package/dist/plugins/egoi/src/index.js +61 -15
- package/dist/plugins/elasticsearch/src/index.js +59 -13
- package/dist/plugins/emelia/src/index.js +95 -19
- package/dist/plugins/erpnext/src/index.js +74 -15
- package/dist/plugins/facebookGraph/src/index.js +52 -11
- package/dist/plugins/freshdesk/src/index.js +220 -48
- package/dist/plugins/freshservice/src/index.js +39 -9
- package/dist/plugins/freshworksCrm/src/index.js +58 -12
- package/dist/plugins/getresponse/src/index.js +87 -18
- package/dist/plugins/ghost/src/index.js +114 -26
- package/dist/plugins/github/src/index.js +483 -109
- package/dist/plugins/gitlab/src/index.js +193 -45
- package/dist/plugins/gong/src/index.js +68 -14
- package/dist/plugins/gotify/src/index.js +43 -9
- package/dist/plugins/gotowebinar/src/index.js +233 -47
- package/dist/plugins/grafana/src/index.js +92 -21
- package/dist/plugins/graphql/src/index.js +38 -8
- package/dist/plugins/grist/src/index.js +52 -10
- package/dist/plugins/hackernews/src/index.js +32 -6
- package/dist/plugins/halopsa/src/index.js +131 -26
- package/dist/plugins/harvest/src/index.js +182 -42
- package/dist/plugins/helpscout/src/index.js +153 -31
- package/dist/plugins/highlevel/src/index.js +291 -58
- package/dist/plugins/homeAssistant/src/index.js +124 -26
- package/dist/plugins/hubspot/src/index.js +163 -29
- package/dist/plugins/humanticAi/src/index.js +54 -5
- package/dist/plugins/hunter/src/index.js +21 -4
- package/dist/plugins/intercom/src/index.js +95 -20
- package/dist/plugins/iterable/src/index.js +96 -20
- package/dist/plugins/jenkins/src/index.js +75 -17
- package/dist/plugins/jira/src/index.js +193 -43
- package/dist/plugins/keap/src/index.js +222 -56
- package/dist/plugins/kobotoolbox/src/index.js +113 -25
- package/dist/plugins/lemlist/src/index.js +79 -18
- package/dist/plugins/linear/src/index.js +86 -19
- package/dist/plugins/lingvanex/src/index.js +38 -8
- package/dist/plugins/linkedin/src/index.js +37 -8
- package/dist/plugins/lonescale/src/index.js +41 -9
- package/dist/plugins/magento/src/index.js +98 -27
- package/dist/plugins/mailcheck/src/index.js +11 -2
- package/dist/plugins/mailchimp/src/index.js +193 -42
- package/dist/plugins/mailerlite/src/index.js +61 -12
- package/dist/plugins/mailgun/src/index.js +39 -7
- package/dist/plugins/mailjet/src/index.js +141 -30
- package/dist/plugins/mandrill/src/index.js +67 -14
- package/dist/plugins/marketstack/src/index.js +56 -10
- package/dist/plugins/matrix/src/index.js +97 -20
- package/dist/plugins/mattermost/src/index.js +124 -26
- package/dist/plugins/mautic/src/index.js +129 -26
- package/dist/plugins/medium/src/index.js +64 -13
- package/dist/plugins/messagebird/src/index.js +80 -15
- package/dist/plugins/metabase/src/index.js +57 -12
- package/dist/plugins/misp/src/index.js +135 -33
- package/dist/plugins/mocean/src/index.js +33 -7
- package/dist/plugins/monday/src/index.js +97 -23
- package/dist/plugins/monicaCrm/src/index.js +112 -23
- package/dist/plugins/msg91/src/index.js +11 -2
- package/dist/plugins/nasa/src/index.js +108 -21
- package/dist/plugins/netlify/src/index.js +28 -6
- package/dist/plugins/netscalerAdc/src/index.js +144 -29
- package/dist/plugins/nextcloud/src/index.js +103 -20
- package/dist/plugins/nocodb/src/index.js +57 -11
- package/dist/plugins/notion/src/index.js +148 -37
- package/dist/plugins/npm/src/index.js +59 -12
- package/dist/plugins/odoo/src/index.js +102 -20
- package/dist/plugins/okta/src/index.js +50 -10
- package/dist/plugins/oneSimpleApi/src/index.js +84 -17
- package/dist/plugins/onfleet/src/index.js +139 -32
- package/dist/plugins/openThesaurus/src/index.js +46 -9
- package/dist/plugins/openweathermap/src/index.js +31 -6
- package/dist/plugins/oura/src/index.js +36 -7
- package/dist/plugins/paddle/src/index.js +80 -17
- package/dist/plugins/pagerduty/src/index.js +53 -12
- package/dist/plugins/paypal/src/index.js +51 -11
- package/dist/plugins/peekalink/src/index.js +12 -3
- package/dist/plugins/phantombuster/src/index.js +39 -8
- package/dist/plugins/philipsHue/src/index.js +64 -13
- package/dist/plugins/pipedrive/src/index.js +167 -45
- package/dist/plugins/plivo/src/index.js +43 -8
- package/dist/plugins/postbin/src/index.js +9 -2
- package/dist/plugins/posthog/src/index.js +50 -13
- package/dist/plugins/profitwell/src/index.js +24 -5
- package/dist/plugins/pushbullet/src/index.js +45 -9
- package/dist/plugins/pushcut/src/index.js +31 -6
- package/dist/plugins/pushover/src/index.js +51 -10
- package/dist/plugins/quickbase/src/index.js +66 -13
- package/dist/plugins/quickbooks/src/index.js +86 -19
- package/dist/plugins/quickchart/src/index.js +35 -7
- package/dist/plugins/raindrop/src/index.js +54 -13
- package/dist/plugins/reddit/src/index.js +73 -18
- package/dist/plugins/rocketchat/src/index.js +47 -9
- package/dist/plugins/rundeck/src/index.js +26 -5
- package/dist/plugins/salesforce/src/index.js +161 -31
- package/dist/plugins/salesmate/src/index.js +75 -16
- package/dist/plugins/securityScorecard/src/index.js +73 -15
- package/dist/plugins/segment/src/index.js +21 -4
- package/dist/plugins/sendgrid/src/index.js +102 -24
- package/dist/plugins/sendy/src/index.js +54 -11
- package/dist/plugins/sentry/src/index.js +174 -34
- package/dist/plugins/servicenow/src/index.js +120 -27
- package/dist/plugins/shopify/src/index.js +53 -12
- package/dist/plugins/signl4/src/index.js +16 -3
- package/dist/plugins/slack/src/index.js +407 -105
- package/dist/plugins/sms77/src/index.js +26 -5
- package/dist/plugins/splunk/src/index.js +186 -45
- package/dist/plugins/spotify/src/index.js +265 -66
- package/dist/plugins/stackby/src/index.js +18 -6
- package/dist/plugins/storyblok/src/index.js +57 -11
- package/dist/plugins/strapi/src/index.js +63 -12
- package/dist/plugins/strava/src/index.js +58 -13
- package/dist/plugins/stripe/src/index.js +143 -30
- package/dist/plugins/supabase/src/index.js +49 -10
- package/dist/plugins/syncromsp/src/index.js +245 -67
- package/dist/plugins/tapfiliate/src/index.js +57 -14
- package/dist/plugins/telegram/src/index.js +202 -39
- package/dist/plugins/thehive/src/index.js +271 -66
- package/dist/plugins/thehiveProject/src/index.js +457 -89
- package/dist/plugins/todoist/src/index.js +326 -77
- package/dist/plugins/travisci/src/index.js +35 -8
- package/dist/plugins/trello/src/index.js +204 -46
- package/dist/plugins/twake/src/index.js +10 -2
- package/dist/plugins/twilio/src/index.js +56 -11
- package/dist/plugins/twist/src/index.js +241 -48
- package/dist/plugins/twitter/src/index.js +128 -30
- package/dist/plugins/unleashedSoftware/src/index.js +30 -6
- package/dist/plugins/uplead/src/index.js +9 -2
- package/dist/plugins/uproc/src/index.js +31 -6
- package/dist/plugins/uptimerobot/src/index.js +119 -25
- package/dist/plugins/urlscanio/src/index.js +25 -6
- package/dist/plugins/vero/src/index.js +68 -13
- package/dist/plugins/vonage/src/index.js +32 -6
- package/dist/plugins/wekan/src/index.js +297 -52
- package/dist/plugins/woocommerce/src/index.js +57 -12
- package/dist/plugins/wordpress/src/index.js +94 -18
- package/dist/plugins/xero/src/index.js +79 -13
- package/dist/plugins/yourls/src/index.js +33 -6
- package/dist/plugins/zammad/src/index.js +139 -36
- package/dist/plugins/zendesk/src/index.js +201 -48
- package/dist/plugins/zoho/src/index.js +88 -21
- package/dist/plugins/zoom/src/index.js +41 -7
- package/dist/plugins/zulip/src/index.js +101 -20
- package/package.json +1 -1
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
const STATUS = {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const STATUS = {
|
|
2
|
+
open: 2,
|
|
3
|
+
pending: 3,
|
|
4
|
+
resolved: 4,
|
|
5
|
+
closed: 5,
|
|
6
|
+
};
|
|
7
|
+
const PRIORITY = {
|
|
8
|
+
low: 1,
|
|
9
|
+
medium: 2,
|
|
10
|
+
high: 3,
|
|
11
|
+
urgent: 4,
|
|
12
|
+
};
|
|
13
|
+
const SOURCE = {
|
|
14
|
+
email: 1,
|
|
15
|
+
portal: 2,
|
|
16
|
+
phone: 3,
|
|
17
|
+
chat: 7,
|
|
18
|
+
mobihelp: 8,
|
|
19
|
+
feedbackWidget: 9,
|
|
20
|
+
outboundEmail: 10,
|
|
21
|
+
};
|
|
4
22
|
async function apiRequest(domain, apiKey, method, endpoint, body, qs) {
|
|
5
23
|
const url = new URL(`https://${domain}.freshdesk.com/api/v2${endpoint}`);
|
|
6
24
|
if (qs) {
|
|
@@ -16,7 +34,10 @@ async function apiRequest(domain, apiKey, method, endpoint, body, qs) {
|
|
|
16
34
|
"Content-Type": "application/json",
|
|
17
35
|
},
|
|
18
36
|
};
|
|
19
|
-
if (body &&
|
|
37
|
+
if (body &&
|
|
38
|
+
Object.keys(body).length > 0 &&
|
|
39
|
+
method !== "GET" &&
|
|
40
|
+
method !== "DELETE") {
|
|
20
41
|
opts.body = JSON.stringify(body);
|
|
21
42
|
}
|
|
22
43
|
const res = await fetch(url.toString(), opts);
|
|
@@ -40,31 +61,93 @@ export default function freshdesk(rl) {
|
|
|
40
61
|
rl.setName("freshdesk");
|
|
41
62
|
rl.setVersion("0.1.0");
|
|
42
63
|
rl.setConnectionSchema({
|
|
43
|
-
domain: {
|
|
44
|
-
|
|
64
|
+
domain: {
|
|
65
|
+
type: "string",
|
|
66
|
+
required: true,
|
|
67
|
+
description: "Freshdesk subdomain (e.g. 'mycompany' for mycompany.freshdesk.com)",
|
|
68
|
+
env: "FRESHDESK_DOMAIN",
|
|
69
|
+
},
|
|
70
|
+
apiKey: {
|
|
71
|
+
type: "string",
|
|
72
|
+
required: true,
|
|
73
|
+
description: "Freshdesk API key",
|
|
74
|
+
env: "FRESHDESK_API_KEY",
|
|
75
|
+
},
|
|
45
76
|
});
|
|
46
77
|
// ── Ticket ──────────────────────────────────────────
|
|
47
78
|
rl.registerAction("ticket.create", {
|
|
48
79
|
description: "Create a ticket",
|
|
49
80
|
inputSchema: {
|
|
50
|
-
email: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
email: {
|
|
82
|
+
type: "string",
|
|
83
|
+
required: false,
|
|
84
|
+
description: "Requester email",
|
|
85
|
+
},
|
|
86
|
+
requesterId: {
|
|
87
|
+
type: "number",
|
|
88
|
+
required: false,
|
|
89
|
+
description: "Requester user ID",
|
|
90
|
+
},
|
|
91
|
+
phone: {
|
|
92
|
+
type: "string",
|
|
93
|
+
required: false,
|
|
94
|
+
description: "Requester phone",
|
|
95
|
+
},
|
|
96
|
+
subject: {
|
|
97
|
+
type: "string",
|
|
98
|
+
required: false,
|
|
99
|
+
description: "Ticket subject",
|
|
100
|
+
},
|
|
101
|
+
description: {
|
|
102
|
+
type: "string",
|
|
103
|
+
required: false,
|
|
104
|
+
description: "Ticket description (HTML)",
|
|
105
|
+
},
|
|
106
|
+
status: {
|
|
107
|
+
type: "string",
|
|
108
|
+
required: true,
|
|
109
|
+
description: "open, pending, resolved, closed",
|
|
110
|
+
},
|
|
111
|
+
priority: {
|
|
112
|
+
type: "string",
|
|
113
|
+
required: true,
|
|
114
|
+
description: "low, medium, high, urgent",
|
|
115
|
+
},
|
|
116
|
+
source: {
|
|
117
|
+
type: "string",
|
|
118
|
+
required: false,
|
|
119
|
+
description: "email, portal, phone, chat, feedbackWidget, mobihelp, outboundEmail",
|
|
120
|
+
},
|
|
121
|
+
type: {
|
|
122
|
+
type: "string",
|
|
123
|
+
required: false,
|
|
124
|
+
description: "Question, Incident, Problem, Feature Request, Refund",
|
|
125
|
+
},
|
|
59
126
|
responderId: { type: "number", required: false, description: "Agent ID" },
|
|
60
127
|
groupId: { type: "number", required: false, description: "Group ID" },
|
|
61
128
|
productId: { type: "number", required: false, description: "Product ID" },
|
|
62
129
|
companyId: { type: "number", required: false, description: "Company ID" },
|
|
63
130
|
tags: { type: "array", required: false, description: "Tags" },
|
|
64
|
-
ccEmails: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
131
|
+
ccEmails: {
|
|
132
|
+
type: "array",
|
|
133
|
+
required: false,
|
|
134
|
+
description: "CC email addresses",
|
|
135
|
+
},
|
|
136
|
+
dueBy: {
|
|
137
|
+
type: "string",
|
|
138
|
+
required: false,
|
|
139
|
+
description: "Due date (ISO 8601)",
|
|
140
|
+
},
|
|
141
|
+
frDueBy: {
|
|
142
|
+
type: "string",
|
|
143
|
+
required: false,
|
|
144
|
+
description: "First response due date",
|
|
145
|
+
},
|
|
146
|
+
customFields: {
|
|
147
|
+
type: "object",
|
|
148
|
+
required: false,
|
|
149
|
+
description: "Custom fields as key-value pairs",
|
|
150
|
+
},
|
|
68
151
|
},
|
|
69
152
|
async execute(input, ctx) {
|
|
70
153
|
const i = input;
|
|
@@ -109,7 +192,9 @@ export default function freshdesk(rl) {
|
|
|
109
192
|
});
|
|
110
193
|
rl.registerAction("ticket.get", {
|
|
111
194
|
description: "Get a ticket by ID",
|
|
112
|
-
inputSchema: {
|
|
195
|
+
inputSchema: {
|
|
196
|
+
ticketId: { type: "string", required: true, description: "Ticket ID" },
|
|
197
|
+
},
|
|
113
198
|
async execute(input, ctx) {
|
|
114
199
|
return req(ctx, "GET", `/tickets/${input.ticketId}`);
|
|
115
200
|
},
|
|
@@ -117,17 +202,49 @@ export default function freshdesk(rl) {
|
|
|
117
202
|
rl.registerAction("ticket.list", {
|
|
118
203
|
description: "List tickets",
|
|
119
204
|
inputSchema: {
|
|
120
|
-
limit: {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
205
|
+
limit: {
|
|
206
|
+
type: "number",
|
|
207
|
+
required: false,
|
|
208
|
+
description: "Max results (default: 30)",
|
|
209
|
+
},
|
|
210
|
+
requesterId: {
|
|
211
|
+
type: "string",
|
|
212
|
+
required: false,
|
|
213
|
+
description: "Filter by requester ID",
|
|
214
|
+
},
|
|
215
|
+
requesterEmail: {
|
|
216
|
+
type: "string",
|
|
217
|
+
required: false,
|
|
218
|
+
description: "Filter by requester email",
|
|
219
|
+
},
|
|
220
|
+
companyId: {
|
|
221
|
+
type: "string",
|
|
222
|
+
required: false,
|
|
223
|
+
description: "Filter by company ID",
|
|
224
|
+
},
|
|
225
|
+
updatedSince: {
|
|
226
|
+
type: "string",
|
|
227
|
+
required: false,
|
|
228
|
+
description: "Filter by updated since (ISO 8601)",
|
|
229
|
+
},
|
|
230
|
+
orderBy: {
|
|
231
|
+
type: "string",
|
|
232
|
+
required: false,
|
|
233
|
+
description: "created_at, due_by, updated_at",
|
|
234
|
+
},
|
|
235
|
+
orderType: {
|
|
236
|
+
type: "string",
|
|
237
|
+
required: false,
|
|
238
|
+
description: "asc or desc",
|
|
239
|
+
},
|
|
240
|
+
include: {
|
|
241
|
+
type: "string",
|
|
242
|
+
required: false,
|
|
243
|
+
description: "Comma-separated: requester, company, stats, description",
|
|
244
|
+
},
|
|
128
245
|
},
|
|
129
246
|
async execute(input, ctx) {
|
|
130
|
-
const { limit, requesterId, requesterEmail, companyId, updatedSince, orderBy, orderType, include } = (input ?? {});
|
|
247
|
+
const { limit, requesterId, requesterEmail, companyId, updatedSince, orderBy, orderType, include, } = (input ?? {});
|
|
131
248
|
const qs = {};
|
|
132
249
|
if (limit)
|
|
133
250
|
qs.per_page = limit;
|
|
@@ -152,8 +269,16 @@ export default function freshdesk(rl) {
|
|
|
152
269
|
description: "Update a ticket",
|
|
153
270
|
inputSchema: {
|
|
154
271
|
ticketId: { type: "string", required: true, description: "Ticket ID" },
|
|
155
|
-
status: {
|
|
156
|
-
|
|
272
|
+
status: {
|
|
273
|
+
type: "string",
|
|
274
|
+
required: false,
|
|
275
|
+
description: "open, pending, resolved, closed",
|
|
276
|
+
},
|
|
277
|
+
priority: {
|
|
278
|
+
type: "string",
|
|
279
|
+
required: false,
|
|
280
|
+
description: "low, medium, high, urgent",
|
|
281
|
+
},
|
|
157
282
|
source: { type: "string", required: false, description: "Source" },
|
|
158
283
|
type: { type: "string", required: false, description: "Ticket type" },
|
|
159
284
|
responderId: { type: "number", required: false, description: "Agent ID" },
|
|
@@ -162,11 +287,19 @@ export default function freshdesk(rl) {
|
|
|
162
287
|
companyId: { type: "number", required: false, description: "Company ID" },
|
|
163
288
|
tags: { type: "array", required: false, description: "Tags" },
|
|
164
289
|
dueBy: { type: "string", required: false, description: "Due date" },
|
|
165
|
-
frDueBy: {
|
|
166
|
-
|
|
290
|
+
frDueBy: {
|
|
291
|
+
type: "string",
|
|
292
|
+
required: false,
|
|
293
|
+
description: "First response due",
|
|
294
|
+
},
|
|
295
|
+
customFields: {
|
|
296
|
+
type: "object",
|
|
297
|
+
required: false,
|
|
298
|
+
description: "Custom fields",
|
|
299
|
+
},
|
|
167
300
|
},
|
|
168
301
|
async execute(input, ctx) {
|
|
169
|
-
const { ticketId, status, priority, source, type, responderId, groupId, productId, companyId, tags, dueBy, frDueBy, customFields } = input;
|
|
302
|
+
const { ticketId, status, priority, source, type, responderId, groupId, productId, companyId, tags, dueBy, frDueBy, customFields, } = input;
|
|
170
303
|
const body = {};
|
|
171
304
|
if (status)
|
|
172
305
|
body.status = STATUS[status];
|
|
@@ -197,7 +330,9 @@ export default function freshdesk(rl) {
|
|
|
197
330
|
});
|
|
198
331
|
rl.registerAction("ticket.delete", {
|
|
199
332
|
description: "Delete a ticket",
|
|
200
|
-
inputSchema: {
|
|
333
|
+
inputSchema: {
|
|
334
|
+
ticketId: { type: "string", required: true, description: "Ticket ID" },
|
|
335
|
+
},
|
|
201
336
|
async execute(input, ctx) {
|
|
202
337
|
await req(ctx, "DELETE", `/tickets/${input.ticketId}`);
|
|
203
338
|
return { success: true };
|
|
@@ -212,14 +347,22 @@ export default function freshdesk(rl) {
|
|
|
212
347
|
phone: { type: "string", required: false, description: "Phone number" },
|
|
213
348
|
mobile: { type: "string", required: false, description: "Mobile number" },
|
|
214
349
|
address: { type: "string", required: false, description: "Address" },
|
|
215
|
-
description: {
|
|
350
|
+
description: {
|
|
351
|
+
type: "string",
|
|
352
|
+
required: false,
|
|
353
|
+
description: "Description",
|
|
354
|
+
},
|
|
216
355
|
jobTitle: { type: "string", required: false, description: "Job title" },
|
|
217
356
|
tags: { type: "array", required: false, description: "Tags" },
|
|
218
357
|
companyId: { type: "number", required: false, description: "Company ID" },
|
|
219
|
-
customFields: {
|
|
358
|
+
customFields: {
|
|
359
|
+
type: "object",
|
|
360
|
+
required: false,
|
|
361
|
+
description: "Custom fields",
|
|
362
|
+
},
|
|
220
363
|
},
|
|
221
364
|
async execute(input, ctx) {
|
|
222
|
-
const { name, email, phone, mobile, address, description: desc, jobTitle, tags, companyId, customFields } = input;
|
|
365
|
+
const { name, email, phone, mobile, address, description: desc, jobTitle, tags, companyId, customFields, } = input;
|
|
223
366
|
const body = { name };
|
|
224
367
|
if (email)
|
|
225
368
|
body.email = email;
|
|
@@ -244,7 +387,9 @@ export default function freshdesk(rl) {
|
|
|
244
387
|
});
|
|
245
388
|
rl.registerAction("contact.get", {
|
|
246
389
|
description: "Get a contact by ID",
|
|
247
|
-
inputSchema: {
|
|
390
|
+
inputSchema: {
|
|
391
|
+
contactId: { type: "string", required: true, description: "Contact ID" },
|
|
392
|
+
},
|
|
248
393
|
async execute(input, ctx) {
|
|
249
394
|
return req(ctx, "GET", `/contacts/${input.contactId}`);
|
|
250
395
|
},
|
|
@@ -252,14 +397,35 @@ export default function freshdesk(rl) {
|
|
|
252
397
|
rl.registerAction("contact.list", {
|
|
253
398
|
description: "List contacts",
|
|
254
399
|
inputSchema: {
|
|
255
|
-
email: {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
400
|
+
email: {
|
|
401
|
+
type: "string",
|
|
402
|
+
required: false,
|
|
403
|
+
description: "Filter by email",
|
|
404
|
+
},
|
|
405
|
+
phone: {
|
|
406
|
+
type: "string",
|
|
407
|
+
required: false,
|
|
408
|
+
description: "Filter by phone",
|
|
409
|
+
},
|
|
410
|
+
mobile: {
|
|
411
|
+
type: "string",
|
|
412
|
+
required: false,
|
|
413
|
+
description: "Filter by mobile",
|
|
414
|
+
},
|
|
415
|
+
companyId: {
|
|
416
|
+
type: "string",
|
|
417
|
+
required: false,
|
|
418
|
+
description: "Filter by company ID",
|
|
419
|
+
},
|
|
420
|
+
state: {
|
|
421
|
+
type: "string",
|
|
422
|
+
required: false,
|
|
423
|
+
description: "verified, unverified, blocked, deleted",
|
|
424
|
+
},
|
|
260
425
|
},
|
|
261
426
|
async execute(input, ctx) {
|
|
262
|
-
const { email, phone, mobile, companyId, state } = (input ??
|
|
427
|
+
const { email, phone, mobile, companyId, state } = (input ??
|
|
428
|
+
{});
|
|
263
429
|
const qs = {};
|
|
264
430
|
if (email)
|
|
265
431
|
qs.email = email;
|
|
@@ -285,10 +451,14 @@ export default function freshdesk(rl) {
|
|
|
285
451
|
address: { type: "string", required: false, description: "Address" },
|
|
286
452
|
jobTitle: { type: "string", required: false, description: "Job title" },
|
|
287
453
|
tags: { type: "array", required: false, description: "Tags" },
|
|
288
|
-
customFields: {
|
|
454
|
+
customFields: {
|
|
455
|
+
type: "object",
|
|
456
|
+
required: false,
|
|
457
|
+
description: "Custom fields",
|
|
458
|
+
},
|
|
289
459
|
},
|
|
290
460
|
async execute(input, ctx) {
|
|
291
|
-
const { contactId, name, email, phone, mobile, address, jobTitle, tags, customFields } = input;
|
|
461
|
+
const { contactId, name, email, phone, mobile, address, jobTitle, tags, customFields, } = input;
|
|
292
462
|
const body = {};
|
|
293
463
|
if (name)
|
|
294
464
|
body.name = name;
|
|
@@ -311,7 +481,9 @@ export default function freshdesk(rl) {
|
|
|
311
481
|
});
|
|
312
482
|
rl.registerAction("contact.delete", {
|
|
313
483
|
description: "Delete a contact",
|
|
314
|
-
inputSchema: {
|
|
484
|
+
inputSchema: {
|
|
485
|
+
contactId: { type: "string", required: true, description: "Contact ID" },
|
|
486
|
+
},
|
|
315
487
|
async execute(input, ctx) {
|
|
316
488
|
await req(ctx, "DELETE", `/contacts/${input.contactId}`);
|
|
317
489
|
return { success: true };
|
|
@@ -13,7 +13,10 @@ async function apiRequest(domain, apiKey, method, endpoint, body, qs) {
|
|
|
13
13
|
"Content-Type": "application/json",
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
|
-
if (body &&
|
|
16
|
+
if (body &&
|
|
17
|
+
Object.keys(body).length > 0 &&
|
|
18
|
+
method !== "GET" &&
|
|
19
|
+
method !== "DELETE") {
|
|
17
20
|
opts.body = JSON.stringify(body);
|
|
18
21
|
}
|
|
19
22
|
const res = await fetch(url.toString(), opts);
|
|
@@ -24,7 +27,10 @@ async function apiRequest(domain, apiKey, method, endpoint, body, qs) {
|
|
|
24
27
|
return res.json();
|
|
25
28
|
}
|
|
26
29
|
function getConn(ctx) {
|
|
27
|
-
return {
|
|
30
|
+
return {
|
|
31
|
+
domain: ctx.connection.config.domain,
|
|
32
|
+
apiKey: ctx.connection.config.apiKey,
|
|
33
|
+
};
|
|
28
34
|
}
|
|
29
35
|
function req(ctx, method, endpoint, body, qs) {
|
|
30
36
|
const { domain, apiKey } = getConn(ctx);
|
|
@@ -43,7 +49,11 @@ function registerCrud(rl, resource, apiPath, singularKey, opts) {
|
|
|
43
49
|
description: `Create a ${resource}`,
|
|
44
50
|
inputSchema: {
|
|
45
51
|
...(opts?.extraCreateFields ?? {}),
|
|
46
|
-
properties: {
|
|
52
|
+
properties: {
|
|
53
|
+
type: "object",
|
|
54
|
+
required: true,
|
|
55
|
+
description: `${resource} properties as key-value pairs`,
|
|
56
|
+
},
|
|
47
57
|
},
|
|
48
58
|
async execute(input, ctx) {
|
|
49
59
|
const { properties, ...rest } = input;
|
|
@@ -53,7 +63,9 @@ function registerCrud(rl, resource, apiPath, singularKey, opts) {
|
|
|
53
63
|
});
|
|
54
64
|
rl.registerAction(`${resource}.get`, {
|
|
55
65
|
description: `Get a ${resource} by ID`,
|
|
56
|
-
inputSchema: {
|
|
66
|
+
inputSchema: {
|
|
67
|
+
id: { type: "number", required: true, description: `${resource} ID` },
|
|
68
|
+
},
|
|
57
69
|
async execute(input, ctx) {
|
|
58
70
|
return unwrap(await req(ctx, "GET", `${apiPath}/${input.id}`));
|
|
59
71
|
},
|
|
@@ -78,7 +90,11 @@ function registerCrud(rl, resource, apiPath, singularKey, opts) {
|
|
|
78
90
|
description: `Update a ${resource}`,
|
|
79
91
|
inputSchema: {
|
|
80
92
|
id: { type: "number", required: true, description: `${resource} ID` },
|
|
81
|
-
properties: {
|
|
93
|
+
properties: {
|
|
94
|
+
type: "object",
|
|
95
|
+
required: true,
|
|
96
|
+
description: "Fields to update",
|
|
97
|
+
},
|
|
82
98
|
},
|
|
83
99
|
async execute(input, ctx) {
|
|
84
100
|
const { id, properties } = input;
|
|
@@ -88,7 +104,9 @@ function registerCrud(rl, resource, apiPath, singularKey, opts) {
|
|
|
88
104
|
if (!opts?.noDelete) {
|
|
89
105
|
rl.registerAction(`${resource}.delete`, {
|
|
90
106
|
description: `Delete a ${resource}`,
|
|
91
|
-
inputSchema: {
|
|
107
|
+
inputSchema: {
|
|
108
|
+
id: { type: "number", required: true, description: `${resource} ID` },
|
|
109
|
+
},
|
|
92
110
|
async execute(input, ctx) {
|
|
93
111
|
await req(ctx, "DELETE", `${apiPath}/${input.id}`);
|
|
94
112
|
return { success: true };
|
|
@@ -100,8 +118,18 @@ export default function freshservice(rl) {
|
|
|
100
118
|
rl.setName("freshservice");
|
|
101
119
|
rl.setVersion("0.1.0");
|
|
102
120
|
rl.setConnectionSchema({
|
|
103
|
-
domain: {
|
|
104
|
-
|
|
121
|
+
domain: {
|
|
122
|
+
type: "string",
|
|
123
|
+
required: true,
|
|
124
|
+
description: "Freshservice subdomain (e.g. 'mycompany')",
|
|
125
|
+
env: "FRESHSERVICE_DOMAIN",
|
|
126
|
+
},
|
|
127
|
+
apiKey: {
|
|
128
|
+
type: "string",
|
|
129
|
+
required: true,
|
|
130
|
+
description: "Freshservice API key",
|
|
131
|
+
env: "FRESHSERVICE_API_KEY",
|
|
132
|
+
},
|
|
105
133
|
});
|
|
106
134
|
// 16 resources, all CRUD
|
|
107
135
|
registerCrud(rl, "agent", "/agents", "agent");
|
|
@@ -122,7 +150,9 @@ export default function freshservice(rl) {
|
|
|
122
150
|
// agentRole is read-only (get + list only)
|
|
123
151
|
rl.registerAction("agentRole.get", {
|
|
124
152
|
description: "Get an agent role by ID",
|
|
125
|
-
inputSchema: {
|
|
153
|
+
inputSchema: {
|
|
154
|
+
id: { type: "number", required: true, description: "Role ID" },
|
|
155
|
+
},
|
|
126
156
|
async execute(input, ctx) {
|
|
127
157
|
return unwrap(await req(ctx, "GET", `/roles/${input.id}`));
|
|
128
158
|
},
|
|
@@ -13,7 +13,10 @@ async function apiRequest(domain, apiKey, method, endpoint, body, qs) {
|
|
|
13
13
|
"Content-Type": "application/json",
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
|
-
if (body &&
|
|
16
|
+
if (body &&
|
|
17
|
+
Object.keys(body).length > 0 &&
|
|
18
|
+
method !== "GET" &&
|
|
19
|
+
method !== "DELETE") {
|
|
17
20
|
opts.body = JSON.stringify(body);
|
|
18
21
|
}
|
|
19
22
|
const res = await fetch(url.toString(), opts);
|
|
@@ -24,7 +27,10 @@ async function apiRequest(domain, apiKey, method, endpoint, body, qs) {
|
|
|
24
27
|
return res.json();
|
|
25
28
|
}
|
|
26
29
|
function getConn(ctx) {
|
|
27
|
-
return {
|
|
30
|
+
return {
|
|
31
|
+
domain: ctx.connection.config.domain,
|
|
32
|
+
apiKey: ctx.connection.config.apiKey,
|
|
33
|
+
};
|
|
28
34
|
}
|
|
29
35
|
function req(ctx, method, endpoint, body, qs) {
|
|
30
36
|
const { domain, apiKey } = getConn(ctx);
|
|
@@ -41,7 +47,13 @@ function unwrap(data) {
|
|
|
41
47
|
function registerCrud(rl, resource, apiPath, wrapKey, opts) {
|
|
42
48
|
rl.registerAction(`${resource}.create`, {
|
|
43
49
|
description: `Create a ${resource}`,
|
|
44
|
-
inputSchema: {
|
|
50
|
+
inputSchema: {
|
|
51
|
+
properties: {
|
|
52
|
+
type: "object",
|
|
53
|
+
required: true,
|
|
54
|
+
description: `${resource} properties`,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
45
57
|
async execute(input, ctx) {
|
|
46
58
|
const { properties } = input;
|
|
47
59
|
return unwrap(await req(ctx, "POST", apiPath, { [wrapKey]: properties }));
|
|
@@ -50,7 +62,9 @@ function registerCrud(rl, resource, apiPath, wrapKey, opts) {
|
|
|
50
62
|
if (!opts?.noGet) {
|
|
51
63
|
rl.registerAction(`${resource}.get`, {
|
|
52
64
|
description: `Get a ${resource} by ID`,
|
|
53
|
-
inputSchema: {
|
|
65
|
+
inputSchema: {
|
|
66
|
+
id: { type: "number", required: true, description: `${resource} ID` },
|
|
67
|
+
},
|
|
54
68
|
async execute(input, ctx) {
|
|
55
69
|
return unwrap(await req(ctx, "GET", `${apiPath}/${input.id}`));
|
|
56
70
|
},
|
|
@@ -78,7 +92,11 @@ function registerCrud(rl, resource, apiPath, wrapKey, opts) {
|
|
|
78
92
|
description: `Update a ${resource}`,
|
|
79
93
|
inputSchema: {
|
|
80
94
|
id: { type: "number", required: true, description: `${resource} ID` },
|
|
81
|
-
properties: {
|
|
95
|
+
properties: {
|
|
96
|
+
type: "object",
|
|
97
|
+
required: true,
|
|
98
|
+
description: "Fields to update",
|
|
99
|
+
},
|
|
82
100
|
},
|
|
83
101
|
async execute(input, ctx) {
|
|
84
102
|
const { id, properties } = input;
|
|
@@ -88,7 +106,9 @@ function registerCrud(rl, resource, apiPath, wrapKey, opts) {
|
|
|
88
106
|
if (!opts?.noDelete) {
|
|
89
107
|
rl.registerAction(`${resource}.delete`, {
|
|
90
108
|
description: `Delete a ${resource}`,
|
|
91
|
-
inputSchema: {
|
|
109
|
+
inputSchema: {
|
|
110
|
+
id: { type: "number", required: true, description: `${resource} ID` },
|
|
111
|
+
},
|
|
92
112
|
async execute(input, ctx) {
|
|
93
113
|
await req(ctx, "DELETE", `${apiPath}/${input.id}`);
|
|
94
114
|
return { success: true };
|
|
@@ -100,8 +120,18 @@ export default function freshworksCrm(rl) {
|
|
|
100
120
|
rl.setName("freshworksCrm");
|
|
101
121
|
rl.setVersion("0.1.0");
|
|
102
122
|
rl.setConnectionSchema({
|
|
103
|
-
domain: {
|
|
104
|
-
|
|
123
|
+
domain: {
|
|
124
|
+
type: "string",
|
|
125
|
+
required: true,
|
|
126
|
+
description: "Freshworks CRM subdomain",
|
|
127
|
+
env: "FRESHWORKS_CRM_DOMAIN",
|
|
128
|
+
},
|
|
129
|
+
apiKey: {
|
|
130
|
+
type: "string",
|
|
131
|
+
required: true,
|
|
132
|
+
description: "Freshworks CRM API key",
|
|
133
|
+
env: "FRESHWORKS_CRM_API_KEY",
|
|
134
|
+
},
|
|
105
135
|
});
|
|
106
136
|
registerCrud(rl, "account", "/sales_accounts", "sales_account");
|
|
107
137
|
registerCrud(rl, "appointment", "/appointments", "appointment");
|
|
@@ -115,8 +145,16 @@ export default function freshworksCrm(rl) {
|
|
|
115
145
|
description: "Search across entities using a query string",
|
|
116
146
|
inputSchema: {
|
|
117
147
|
query: { type: "string", required: true, description: "Search query" },
|
|
118
|
-
entities: {
|
|
119
|
-
|
|
148
|
+
entities: {
|
|
149
|
+
type: "string",
|
|
150
|
+
required: false,
|
|
151
|
+
description: "Comma-separated entities to search (contact, deal, sales_account)",
|
|
152
|
+
},
|
|
153
|
+
perPage: {
|
|
154
|
+
type: "number",
|
|
155
|
+
required: false,
|
|
156
|
+
description: "Results per page",
|
|
157
|
+
},
|
|
120
158
|
page: { type: "number", required: false, description: "Page number" },
|
|
121
159
|
},
|
|
122
160
|
async execute(input, ctx) {
|
|
@@ -135,8 +173,16 @@ export default function freshworksCrm(rl) {
|
|
|
135
173
|
description: "Lookup a record by field value",
|
|
136
174
|
inputSchema: {
|
|
137
175
|
query: { type: "string", required: true, description: "Value to search" },
|
|
138
|
-
field: {
|
|
139
|
-
|
|
176
|
+
field: {
|
|
177
|
+
type: "string",
|
|
178
|
+
required: true,
|
|
179
|
+
description: "Field to search (e.g. email, name)",
|
|
180
|
+
},
|
|
181
|
+
entities: {
|
|
182
|
+
type: "string",
|
|
183
|
+
required: false,
|
|
184
|
+
description: "Entity type to search",
|
|
185
|
+
},
|
|
140
186
|
},
|
|
141
187
|
async execute(input, ctx) {
|
|
142
188
|
const { query, field, entities } = input;
|