runline 0.2.0 → 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/README.md +1 -1
- 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
|
@@ -3,10 +3,30 @@ export default function mailjet(rl) {
|
|
|
3
3
|
rl.setName("mailjet");
|
|
4
4
|
rl.setVersion("0.1.0");
|
|
5
5
|
rl.setConnectionSchema({
|
|
6
|
-
apiKeyPublic: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
apiKeyPublic: {
|
|
7
|
+
type: "string",
|
|
8
|
+
required: true,
|
|
9
|
+
description: "Mailjet API key (public)",
|
|
10
|
+
env: "MAILJET_API_KEY",
|
|
11
|
+
},
|
|
12
|
+
apiKeyPrivate: {
|
|
13
|
+
type: "string",
|
|
14
|
+
required: true,
|
|
15
|
+
description: "Mailjet secret key (private)",
|
|
16
|
+
env: "MAILJET_SECRET_KEY",
|
|
17
|
+
},
|
|
18
|
+
sandboxMode: {
|
|
19
|
+
type: "boolean",
|
|
20
|
+
required: false,
|
|
21
|
+
description: "Enable sandbox mode (emails not actually sent)",
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
smsToken: {
|
|
25
|
+
type: "string",
|
|
26
|
+
required: false,
|
|
27
|
+
description: "Mailjet SMS API token (if using SMS)",
|
|
28
|
+
env: "MAILJET_SMS_TOKEN",
|
|
29
|
+
},
|
|
10
30
|
});
|
|
11
31
|
const emailAuth = (ctx) => `Basic ${btoa(`${ctx.connection.config.apiKeyPublic}:${ctx.connection.config.apiKeyPrivate}`)}`;
|
|
12
32
|
const sandbox = (ctx) => ctx.connection.config.sandboxMode ?? false;
|
|
@@ -15,25 +35,68 @@ export default function mailjet(rl) {
|
|
|
15
35
|
inputSchema: {
|
|
16
36
|
fromEmail: { type: "string", required: true },
|
|
17
37
|
fromName: { type: "string", required: false },
|
|
18
|
-
toEmail: {
|
|
38
|
+
toEmail: {
|
|
39
|
+
type: "string",
|
|
40
|
+
required: true,
|
|
41
|
+
description: "Comma-separated recipient emails",
|
|
42
|
+
},
|
|
19
43
|
subject: { type: "string", required: true },
|
|
20
44
|
htmlPart: { type: "string", required: false, description: "HTML body" },
|
|
21
|
-
textPart: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
textPart: {
|
|
46
|
+
type: "string",
|
|
47
|
+
required: false,
|
|
48
|
+
description: "Plain text body",
|
|
49
|
+
},
|
|
50
|
+
cc: {
|
|
51
|
+
type: "string",
|
|
52
|
+
required: false,
|
|
53
|
+
description: "Comma-separated CC emails",
|
|
54
|
+
},
|
|
55
|
+
bcc: {
|
|
56
|
+
type: "string",
|
|
57
|
+
required: false,
|
|
58
|
+
description: "Comma-separated BCC emails",
|
|
59
|
+
},
|
|
60
|
+
replyTo: {
|
|
61
|
+
type: "string",
|
|
62
|
+
required: false,
|
|
63
|
+
description: "Reply-to email",
|
|
64
|
+
},
|
|
65
|
+
variables: {
|
|
66
|
+
type: "object",
|
|
67
|
+
required: false,
|
|
68
|
+
description: "Template variables as key-value pairs",
|
|
69
|
+
},
|
|
70
|
+
trackOpens: {
|
|
71
|
+
type: "string",
|
|
72
|
+
required: false,
|
|
73
|
+
description: "account_default, disabled, enabled",
|
|
74
|
+
},
|
|
75
|
+
trackClicks: {
|
|
76
|
+
type: "string",
|
|
77
|
+
required: false,
|
|
78
|
+
description: "account_default, disabled, enabled",
|
|
79
|
+
},
|
|
80
|
+
templateLanguage: {
|
|
81
|
+
type: "boolean",
|
|
82
|
+
required: false,
|
|
83
|
+
description: "Enable template language in body",
|
|
84
|
+
},
|
|
85
|
+
priority: {
|
|
86
|
+
type: "number",
|
|
87
|
+
required: false,
|
|
88
|
+
description: "1-4, lower is higher priority",
|
|
89
|
+
},
|
|
30
90
|
customCampaign: { type: "string", required: false },
|
|
31
91
|
deduplicateCampaign: { type: "boolean", required: false },
|
|
32
92
|
},
|
|
33
93
|
async execute(input, ctx) {
|
|
34
94
|
const p = input;
|
|
35
95
|
const message = {
|
|
36
|
-
From: {
|
|
96
|
+
From: {
|
|
97
|
+
Email: p.fromEmail,
|
|
98
|
+
...(p.fromName ? { Name: p.fromName } : {}),
|
|
99
|
+
},
|
|
37
100
|
Subject: p.subject,
|
|
38
101
|
To: p.toEmail.split(",").map((e) => ({ Email: e.trim() })),
|
|
39
102
|
};
|
|
@@ -42,9 +105,13 @@ export default function mailjet(rl) {
|
|
|
42
105
|
if (p.textPart)
|
|
43
106
|
message.TextPart = p.textPart;
|
|
44
107
|
if (p.cc)
|
|
45
|
-
message.Cc = p.cc
|
|
108
|
+
message.Cc = p.cc
|
|
109
|
+
.split(",")
|
|
110
|
+
.map((e) => ({ Email: e.trim() }));
|
|
46
111
|
if (p.bcc)
|
|
47
|
-
message.Bcc = p.bcc
|
|
112
|
+
message.Bcc = p.bcc
|
|
113
|
+
.split(",")
|
|
114
|
+
.map((e) => ({ Email: e.trim() }));
|
|
48
115
|
if (p.replyTo)
|
|
49
116
|
message.ReplyTo = { Email: p.replyTo };
|
|
50
117
|
if (p.variables)
|
|
@@ -63,8 +130,15 @@ export default function mailjet(rl) {
|
|
|
63
130
|
message.DeduplicateCampaign = p.deduplicateCampaign;
|
|
64
131
|
const res = await fetch(`${BASE_URL}/v3.1/send`, {
|
|
65
132
|
method: "POST",
|
|
66
|
-
headers: {
|
|
67
|
-
|
|
133
|
+
headers: {
|
|
134
|
+
Authorization: emailAuth(ctx),
|
|
135
|
+
"Content-Type": "application/json",
|
|
136
|
+
Accept: "application/json",
|
|
137
|
+
},
|
|
138
|
+
body: JSON.stringify({
|
|
139
|
+
Messages: [message],
|
|
140
|
+
SandboxMode: sandbox(ctx),
|
|
141
|
+
}),
|
|
68
142
|
});
|
|
69
143
|
if (!res.ok)
|
|
70
144
|
throw new Error(`Mailjet API error ${res.status}: ${await res.text()}`);
|
|
@@ -77,10 +151,22 @@ export default function mailjet(rl) {
|
|
|
77
151
|
inputSchema: {
|
|
78
152
|
fromEmail: { type: "string", required: true },
|
|
79
153
|
fromName: { type: "string", required: false },
|
|
80
|
-
toEmail: {
|
|
154
|
+
toEmail: {
|
|
155
|
+
type: "string",
|
|
156
|
+
required: true,
|
|
157
|
+
description: "Comma-separated recipient emails",
|
|
158
|
+
},
|
|
81
159
|
subject: { type: "string", required: true },
|
|
82
|
-
templateId: {
|
|
83
|
-
|
|
160
|
+
templateId: {
|
|
161
|
+
type: "number",
|
|
162
|
+
required: true,
|
|
163
|
+
description: "Mailjet template ID",
|
|
164
|
+
},
|
|
165
|
+
variables: {
|
|
166
|
+
type: "object",
|
|
167
|
+
required: false,
|
|
168
|
+
description: "Template variables",
|
|
169
|
+
},
|
|
84
170
|
cc: { type: "string", required: false },
|
|
85
171
|
bcc: { type: "string", required: false },
|
|
86
172
|
replyTo: { type: "string", required: false },
|
|
@@ -94,7 +180,10 @@ export default function mailjet(rl) {
|
|
|
94
180
|
async execute(input, ctx) {
|
|
95
181
|
const p = input;
|
|
96
182
|
const message = {
|
|
97
|
-
From: {
|
|
183
|
+
From: {
|
|
184
|
+
Email: p.fromEmail,
|
|
185
|
+
...(p.fromName ? { Name: p.fromName } : {}),
|
|
186
|
+
},
|
|
98
187
|
Subject: p.subject,
|
|
99
188
|
To: p.toEmail.split(",").map((e) => ({ Email: e.trim() })),
|
|
100
189
|
TemplateID: p.templateId,
|
|
@@ -102,9 +191,13 @@ export default function mailjet(rl) {
|
|
|
102
191
|
if (p.variables)
|
|
103
192
|
message.Variables = p.variables;
|
|
104
193
|
if (p.cc)
|
|
105
|
-
message.Cc = p.cc
|
|
194
|
+
message.Cc = p.cc
|
|
195
|
+
.split(",")
|
|
196
|
+
.map((e) => ({ Email: e.trim() }));
|
|
106
197
|
if (p.bcc)
|
|
107
|
-
message.Bcc = p.bcc
|
|
198
|
+
message.Bcc = p.bcc
|
|
199
|
+
.split(",")
|
|
200
|
+
.map((e) => ({ Email: e.trim() }));
|
|
108
201
|
if (p.replyTo)
|
|
109
202
|
message.ReplyTo = { Email: p.replyTo };
|
|
110
203
|
if (p.trackOpens)
|
|
@@ -121,8 +214,15 @@ export default function mailjet(rl) {
|
|
|
121
214
|
message.DeduplicateCampaign = p.deduplicateCampaign;
|
|
122
215
|
const res = await fetch(`${BASE_URL}/v3.1/send`, {
|
|
123
216
|
method: "POST",
|
|
124
|
-
headers: {
|
|
125
|
-
|
|
217
|
+
headers: {
|
|
218
|
+
Authorization: emailAuth(ctx),
|
|
219
|
+
"Content-Type": "application/json",
|
|
220
|
+
Accept: "application/json",
|
|
221
|
+
},
|
|
222
|
+
body: JSON.stringify({
|
|
223
|
+
Messages: [message],
|
|
224
|
+
SandboxMode: sandbox(ctx),
|
|
225
|
+
}),
|
|
126
226
|
});
|
|
127
227
|
if (!res.ok)
|
|
128
228
|
throw new Error(`Mailjet API error ${res.status}: ${await res.text()}`);
|
|
@@ -133,8 +233,16 @@ export default function mailjet(rl) {
|
|
|
133
233
|
rl.registerAction("sms.send", {
|
|
134
234
|
description: "Send an SMS via Mailjet SMS API",
|
|
135
235
|
inputSchema: {
|
|
136
|
-
from: {
|
|
137
|
-
|
|
236
|
+
from: {
|
|
237
|
+
type: "string",
|
|
238
|
+
required: true,
|
|
239
|
+
description: "Sender name or number",
|
|
240
|
+
},
|
|
241
|
+
to: {
|
|
242
|
+
type: "string",
|
|
243
|
+
required: true,
|
|
244
|
+
description: "Recipient phone number (international format)",
|
|
245
|
+
},
|
|
138
246
|
text: { type: "string", required: true, description: "SMS message text" },
|
|
139
247
|
},
|
|
140
248
|
async execute(input, ctx) {
|
|
@@ -144,7 +252,10 @@ export default function mailjet(rl) {
|
|
|
144
252
|
throw new Error("SMS token not configured — set smsToken in connection config");
|
|
145
253
|
const res = await fetch(`${BASE_URL}/v4/sms-send`, {
|
|
146
254
|
method: "POST",
|
|
147
|
-
headers: {
|
|
255
|
+
headers: {
|
|
256
|
+
Authorization: `Bearer ${smsToken}`,
|
|
257
|
+
"Content-Type": "application/json",
|
|
258
|
+
},
|
|
148
259
|
body: JSON.stringify({ From: from, To: to, Text: text }),
|
|
149
260
|
});
|
|
150
261
|
if (!res.ok)
|
|
@@ -14,13 +14,20 @@ export default function mandrill(rl) {
|
|
|
14
14
|
rl.setName("mandrill");
|
|
15
15
|
rl.setVersion("0.1.0");
|
|
16
16
|
rl.setConnectionSchema({
|
|
17
|
-
apiKey: {
|
|
17
|
+
apiKey: {
|
|
18
|
+
type: "string",
|
|
19
|
+
required: true,
|
|
20
|
+
description: "Mandrill API key",
|
|
21
|
+
env: "MANDRILL_API_KEY",
|
|
22
|
+
},
|
|
18
23
|
});
|
|
19
24
|
const key = (ctx) => ctx.connection.config.apiKey;
|
|
20
25
|
function buildMessage(p) {
|
|
21
26
|
const message = {
|
|
22
27
|
from_email: p.fromEmail,
|
|
23
|
-
to: p.toEmail
|
|
28
|
+
to: p.toEmail
|
|
29
|
+
.split(",")
|
|
30
|
+
.map((e) => ({ email: e.trim(), type: "to" })),
|
|
24
31
|
};
|
|
25
32
|
if (p.fromName)
|
|
26
33
|
message.from_name = p.fromName;
|
|
@@ -67,7 +74,9 @@ export default function mandrill(rl) {
|
|
|
67
74
|
if (p.googleAnalyticsCampaign)
|
|
68
75
|
message.google_analytics_campaign = p.googleAnalyticsCampaign;
|
|
69
76
|
if (p.googleAnalyticsDomains)
|
|
70
|
-
message.google_analytics_domains = p.googleAnalyticsDomains
|
|
77
|
+
message.google_analytics_domains = p.googleAnalyticsDomains
|
|
78
|
+
.split(",")
|
|
79
|
+
.map((d) => d.trim());
|
|
71
80
|
if (p.mergeVars)
|
|
72
81
|
message.global_merge_vars = p.mergeVars;
|
|
73
82
|
if (p.metadata)
|
|
@@ -80,13 +89,29 @@ export default function mandrill(rl) {
|
|
|
80
89
|
}
|
|
81
90
|
const messageInputSchema = {
|
|
82
91
|
fromEmail: { type: "string", required: true },
|
|
83
|
-
toEmail: {
|
|
92
|
+
toEmail: {
|
|
93
|
+
type: "string",
|
|
94
|
+
required: true,
|
|
95
|
+
description: "Comma-separated recipient emails",
|
|
96
|
+
},
|
|
84
97
|
fromName: { type: "string", required: false },
|
|
85
98
|
subject: { type: "string", required: false },
|
|
86
|
-
html: {
|
|
87
|
-
|
|
99
|
+
html: {
|
|
100
|
+
type: "string",
|
|
101
|
+
required: false,
|
|
102
|
+
description: "HTML body",
|
|
103
|
+
},
|
|
104
|
+
text: {
|
|
105
|
+
type: "string",
|
|
106
|
+
required: false,
|
|
107
|
+
description: "Plain text body",
|
|
108
|
+
},
|
|
88
109
|
bccAddress: { type: "string", required: false },
|
|
89
|
-
tags: {
|
|
110
|
+
tags: {
|
|
111
|
+
type: "string",
|
|
112
|
+
required: false,
|
|
113
|
+
description: "Comma-separated tags",
|
|
114
|
+
},
|
|
90
115
|
subaccount: { type: "string", required: false },
|
|
91
116
|
trackOpens: { type: "boolean", required: false },
|
|
92
117
|
trackClicks: { type: "boolean", required: false },
|
|
@@ -103,12 +128,36 @@ export default function mandrill(rl) {
|
|
|
103
128
|
signingDomain: { type: "string", required: false },
|
|
104
129
|
returnPathDomain: { type: "string", required: false },
|
|
105
130
|
googleAnalyticsCampaign: { type: "string", required: false },
|
|
106
|
-
googleAnalyticsDomains: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
131
|
+
googleAnalyticsDomains: {
|
|
132
|
+
type: "string",
|
|
133
|
+
required: false,
|
|
134
|
+
description: "Comma-separated domains",
|
|
135
|
+
},
|
|
136
|
+
mergeVars: {
|
|
137
|
+
type: "array",
|
|
138
|
+
required: false,
|
|
139
|
+
description: "Array of {name, content} objects",
|
|
140
|
+
},
|
|
141
|
+
metadata: {
|
|
142
|
+
type: "object",
|
|
143
|
+
required: false,
|
|
144
|
+
description: "Key-value metadata",
|
|
145
|
+
},
|
|
146
|
+
headers: {
|
|
147
|
+
type: "object",
|
|
148
|
+
required: false,
|
|
149
|
+
description: "Extra headers",
|
|
150
|
+
},
|
|
151
|
+
attachments: {
|
|
152
|
+
type: "array",
|
|
153
|
+
required: false,
|
|
154
|
+
description: "Array of {type, name, content} (content is base64)",
|
|
155
|
+
},
|
|
156
|
+
sendAt: {
|
|
157
|
+
type: "string",
|
|
158
|
+
required: false,
|
|
159
|
+
description: "UTC datetime YYYY-MM-DD HH:mm:ss",
|
|
160
|
+
},
|
|
112
161
|
};
|
|
113
162
|
rl.registerAction("message.sendHtml", {
|
|
114
163
|
description: "Send an email with HTML/text content via Mandrill",
|
|
@@ -127,7 +176,11 @@ export default function mandrill(rl) {
|
|
|
127
176
|
rl.registerAction("message.sendTemplate", {
|
|
128
177
|
description: "Send an email using a Mandrill template",
|
|
129
178
|
inputSchema: {
|
|
130
|
-
templateName: {
|
|
179
|
+
templateName: {
|
|
180
|
+
type: "string",
|
|
181
|
+
required: true,
|
|
182
|
+
description: "Template slug",
|
|
183
|
+
},
|
|
131
184
|
...messageInputSchema,
|
|
132
185
|
},
|
|
133
186
|
async execute(input, ctx) {
|
|
@@ -30,8 +30,18 @@ export default function marketstack(rl) {
|
|
|
30
30
|
rl.setName("marketstack");
|
|
31
31
|
rl.setVersion("0.1.0");
|
|
32
32
|
rl.setConnectionSchema({
|
|
33
|
-
apiKey: {
|
|
34
|
-
|
|
33
|
+
apiKey: {
|
|
34
|
+
type: "string",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "Marketstack API access key",
|
|
37
|
+
env: "MARKETSTACK_API_KEY",
|
|
38
|
+
},
|
|
39
|
+
useHttps: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
required: false,
|
|
42
|
+
description: "Use HTTPS (requires paid plan). Default: false",
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
35
45
|
});
|
|
36
46
|
const conn = (ctx) => ({
|
|
37
47
|
apiKey: ctx.connection.config.apiKey,
|
|
@@ -41,13 +51,37 @@ export default function marketstack(rl) {
|
|
|
41
51
|
rl.registerAction("endOfDayData.list", {
|
|
42
52
|
description: "Get end-of-day stock market closing data. Must specify exactly one of: latest, specificDate, or dateFrom+dateTo.",
|
|
43
53
|
inputSchema: {
|
|
44
|
-
symbols: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
symbols: {
|
|
55
|
+
type: "string",
|
|
56
|
+
required: true,
|
|
57
|
+
description: "Comma-separated stock symbols (e.g. AAPL,MSFT)",
|
|
58
|
+
},
|
|
59
|
+
latest: {
|
|
60
|
+
type: "boolean",
|
|
61
|
+
required: false,
|
|
62
|
+
description: "Get latest EOD data",
|
|
63
|
+
},
|
|
64
|
+
specificDate: {
|
|
65
|
+
type: "string",
|
|
66
|
+
required: false,
|
|
67
|
+
description: "Specific date (YYYY-MM-DD)",
|
|
68
|
+
},
|
|
69
|
+
dateFrom: {
|
|
70
|
+
type: "string",
|
|
71
|
+
required: false,
|
|
72
|
+
description: "Start date (YYYY-MM-DD)",
|
|
73
|
+
},
|
|
74
|
+
dateTo: {
|
|
75
|
+
type: "string",
|
|
76
|
+
required: false,
|
|
77
|
+
description: "End date (YYYY-MM-DD)",
|
|
78
|
+
},
|
|
49
79
|
sort: { type: "string", required: false, description: "ASC or DESC" },
|
|
50
|
-
exchange: {
|
|
80
|
+
exchange: {
|
|
81
|
+
type: "string",
|
|
82
|
+
required: false,
|
|
83
|
+
description: "Filter by exchange MIC",
|
|
84
|
+
},
|
|
51
85
|
limit: { type: "number", required: false, description: "Max results" },
|
|
52
86
|
},
|
|
53
87
|
async execute(input, ctx) {
|
|
@@ -79,7 +113,13 @@ export default function marketstack(rl) {
|
|
|
79
113
|
// ── Exchange ────────────────────────────────────────
|
|
80
114
|
rl.registerAction("exchange.get", {
|
|
81
115
|
description: "Get details about a stock exchange",
|
|
82
|
-
inputSchema: {
|
|
116
|
+
inputSchema: {
|
|
117
|
+
exchange: {
|
|
118
|
+
type: "string",
|
|
119
|
+
required: true,
|
|
120
|
+
description: "Exchange MIC code (e.g. XNAS)",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
83
123
|
async execute(input, ctx) {
|
|
84
124
|
const { apiKey, useHttps } = conn(ctx);
|
|
85
125
|
return apiRequest(apiKey, useHttps, "GET", `/exchanges/${input.exchange}`);
|
|
@@ -88,7 +128,13 @@ export default function marketstack(rl) {
|
|
|
88
128
|
// ── Ticker ──────────────────────────────────────────
|
|
89
129
|
rl.registerAction("ticker.get", {
|
|
90
130
|
description: "Get details about a stock ticker symbol",
|
|
91
|
-
inputSchema: {
|
|
131
|
+
inputSchema: {
|
|
132
|
+
symbol: {
|
|
133
|
+
type: "string",
|
|
134
|
+
required: true,
|
|
135
|
+
description: "Ticker symbol (e.g. AAPL)",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
92
138
|
async execute(input, ctx) {
|
|
93
139
|
const { apiKey, useHttps } = conn(ctx);
|
|
94
140
|
return apiRequest(apiKey, useHttps, "GET", `/tickers/${input.symbol}`);
|
|
@@ -8,9 +8,15 @@ async function apiRequest(homeserver, token, method, endpoint, body, qs) {
|
|
|
8
8
|
}
|
|
9
9
|
const opts = {
|
|
10
10
|
method,
|
|
11
|
-
headers: {
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${token}`,
|
|
13
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
14
|
+
},
|
|
12
15
|
};
|
|
13
|
-
if (body &&
|
|
16
|
+
if (body &&
|
|
17
|
+
Object.keys(body).length > 0 &&
|
|
18
|
+
method !== "GET" &&
|
|
19
|
+
method !== "DELETE")
|
|
14
20
|
opts.body = JSON.stringify(body);
|
|
15
21
|
const res = await fetch(url.toString(), opts);
|
|
16
22
|
if (!res.ok)
|
|
@@ -24,8 +30,18 @@ export default function matrix(rl) {
|
|
|
24
30
|
rl.setName("matrix");
|
|
25
31
|
rl.setVersion("0.1.0");
|
|
26
32
|
rl.setConnectionSchema({
|
|
27
|
-
homeserverUrl: {
|
|
28
|
-
|
|
33
|
+
homeserverUrl: {
|
|
34
|
+
type: "string",
|
|
35
|
+
required: true,
|
|
36
|
+
description: "Matrix homeserver URL (e.g. https://matrix.org)",
|
|
37
|
+
env: "MATRIX_HOMESERVER_URL",
|
|
38
|
+
},
|
|
39
|
+
accessToken: {
|
|
40
|
+
type: "string",
|
|
41
|
+
required: true,
|
|
42
|
+
description: "Matrix access token",
|
|
43
|
+
env: "MATRIX_ACCESS_TOKEN",
|
|
44
|
+
},
|
|
29
45
|
});
|
|
30
46
|
const conn = (ctx) => ({
|
|
31
47
|
homeserver: ctx.connection.config.homeserverUrl.replace(/\/$/, ""),
|
|
@@ -44,8 +60,16 @@ export default function matrix(rl) {
|
|
|
44
60
|
description: "Create a new room",
|
|
45
61
|
inputSchema: {
|
|
46
62
|
name: { type: "string", required: true, description: "Room name" },
|
|
47
|
-
preset: {
|
|
48
|
-
|
|
63
|
+
preset: {
|
|
64
|
+
type: "string",
|
|
65
|
+
required: true,
|
|
66
|
+
description: "private_chat, public_chat, or trusted_private_chat",
|
|
67
|
+
},
|
|
68
|
+
roomAlias: {
|
|
69
|
+
type: "string",
|
|
70
|
+
required: false,
|
|
71
|
+
description: "Local part of room alias (without # or :server)",
|
|
72
|
+
},
|
|
49
73
|
},
|
|
50
74
|
async execute(input, ctx) {
|
|
51
75
|
const { name, preset, roomAlias } = input;
|
|
@@ -58,7 +82,13 @@ export default function matrix(rl) {
|
|
|
58
82
|
});
|
|
59
83
|
rl.registerAction("room.join", {
|
|
60
84
|
description: "Join a room",
|
|
61
|
-
inputSchema: {
|
|
85
|
+
inputSchema: {
|
|
86
|
+
roomIdOrAlias: {
|
|
87
|
+
type: "string",
|
|
88
|
+
required: true,
|
|
89
|
+
description: "Room ID (!xxx:server) or alias (#xxx:server)",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
62
92
|
async execute(input, ctx) {
|
|
63
93
|
const { homeserver, token } = conn(ctx);
|
|
64
94
|
return apiRequest(homeserver, token, "POST", `/rooms/${encodeURIComponent(input.roomIdOrAlias)}/join`);
|
|
@@ -76,7 +106,11 @@ export default function matrix(rl) {
|
|
|
76
106
|
description: "Invite a user to a room",
|
|
77
107
|
inputSchema: {
|
|
78
108
|
roomId: { type: "string", required: true },
|
|
79
|
-
userId: {
|
|
109
|
+
userId: {
|
|
110
|
+
type: "string",
|
|
111
|
+
required: true,
|
|
112
|
+
description: "Matrix user ID (@user:server)",
|
|
113
|
+
},
|
|
80
114
|
},
|
|
81
115
|
async execute(input, ctx) {
|
|
82
116
|
const { roomId, userId } = input;
|
|
@@ -89,7 +123,11 @@ export default function matrix(rl) {
|
|
|
89
123
|
inputSchema: {
|
|
90
124
|
roomId: { type: "string", required: true },
|
|
91
125
|
userId: { type: "string", required: true },
|
|
92
|
-
reason: {
|
|
126
|
+
reason: {
|
|
127
|
+
type: "string",
|
|
128
|
+
required: false,
|
|
129
|
+
description: "Reason for kicking",
|
|
130
|
+
},
|
|
93
131
|
},
|
|
94
132
|
async execute(input, ctx) {
|
|
95
133
|
const { roomId, userId, reason } = input;
|
|
@@ -105,15 +143,34 @@ export default function matrix(rl) {
|
|
|
105
143
|
description: "Send a message to a room",
|
|
106
144
|
inputSchema: {
|
|
107
145
|
roomId: { type: "string", required: true },
|
|
108
|
-
text: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
146
|
+
text: {
|
|
147
|
+
type: "string",
|
|
148
|
+
required: true,
|
|
149
|
+
description: "Message text (or HTML if format is org.matrix.custom.html)",
|
|
150
|
+
},
|
|
151
|
+
messageType: {
|
|
152
|
+
type: "string",
|
|
153
|
+
required: false,
|
|
154
|
+
description: "m.text (default), m.notice, m.emote",
|
|
155
|
+
},
|
|
156
|
+
messageFormat: {
|
|
157
|
+
type: "string",
|
|
158
|
+
required: false,
|
|
159
|
+
description: "org.matrix.custom.html for HTML messages",
|
|
160
|
+
},
|
|
161
|
+
fallbackText: {
|
|
162
|
+
type: "string",
|
|
163
|
+
required: false,
|
|
164
|
+
description: "Plain text fallback for HTML messages",
|
|
165
|
+
},
|
|
112
166
|
},
|
|
113
167
|
async execute(input, ctx) {
|
|
114
|
-
const { roomId, text, messageType = "m.text", messageFormat, fallbackText } = input;
|
|
168
|
+
const { roomId, text, messageType = "m.text", messageFormat, fallbackText, } = input;
|
|
115
169
|
const { homeserver, token } = conn(ctx);
|
|
116
|
-
const body = {
|
|
170
|
+
const body = {
|
|
171
|
+
msgtype: messageType,
|
|
172
|
+
body: text,
|
|
173
|
+
};
|
|
117
174
|
if (messageFormat === "org.matrix.custom.html") {
|
|
118
175
|
body.format = messageFormat;
|
|
119
176
|
body.formatted_body = text;
|
|
@@ -127,8 +184,16 @@ export default function matrix(rl) {
|
|
|
127
184
|
description: "Get messages from a room (newest first)",
|
|
128
185
|
inputSchema: {
|
|
129
186
|
roomId: { type: "string", required: true },
|
|
130
|
-
limit: {
|
|
131
|
-
|
|
187
|
+
limit: {
|
|
188
|
+
type: "number",
|
|
189
|
+
required: false,
|
|
190
|
+
description: "Max messages to return",
|
|
191
|
+
},
|
|
192
|
+
filter: {
|
|
193
|
+
type: "string",
|
|
194
|
+
required: false,
|
|
195
|
+
description: "JSON filter string",
|
|
196
|
+
},
|
|
132
197
|
},
|
|
133
198
|
async execute(input, ctx) {
|
|
134
199
|
const { roomId, limit, filter } = (input ?? {});
|
|
@@ -163,7 +228,11 @@ export default function matrix(rl) {
|
|
|
163
228
|
description: "Get a single event from a room",
|
|
164
229
|
inputSchema: {
|
|
165
230
|
roomId: { type: "string", required: true },
|
|
166
|
-
eventId: {
|
|
231
|
+
eventId: {
|
|
232
|
+
type: "string",
|
|
233
|
+
required: true,
|
|
234
|
+
description: "Event ID ($xxx)",
|
|
235
|
+
},
|
|
167
236
|
},
|
|
168
237
|
async execute(input, ctx) {
|
|
169
238
|
const { roomId, eventId } = input;
|
|
@@ -176,8 +245,16 @@ export default function matrix(rl) {
|
|
|
176
245
|
description: "List members of a room",
|
|
177
246
|
inputSchema: {
|
|
178
247
|
roomId: { type: "string", required: true },
|
|
179
|
-
membership: {
|
|
180
|
-
|
|
248
|
+
membership: {
|
|
249
|
+
type: "string",
|
|
250
|
+
required: false,
|
|
251
|
+
description: "Filter: join, invite, leave, ban, knock",
|
|
252
|
+
},
|
|
253
|
+
notMembership: {
|
|
254
|
+
type: "string",
|
|
255
|
+
required: false,
|
|
256
|
+
description: "Exclude membership type",
|
|
257
|
+
},
|
|
181
258
|
},
|
|
182
259
|
async execute(input, ctx) {
|
|
183
260
|
const { roomId, membership, notMembership } = (input ?? {});
|