runline 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/dist/commands/auth.d.ts +7 -0
  2. package/dist/commands/auth.js +96 -0
  3. package/dist/config/loader.d.ts +11 -0
  4. package/dist/config/loader.js +46 -0
  5. package/dist/core/engine.js +7 -1
  6. package/dist/core/oauth.d.ts +46 -0
  7. package/dist/core/oauth.js +145 -0
  8. package/dist/index.d.ts +4 -2
  9. package/dist/index.js +2 -1
  10. package/dist/main.js +28 -0
  11. package/dist/plugin/api.d.ts +7 -1
  12. package/dist/plugin/api.js +7 -0
  13. package/dist/plugin/types.d.ts +47 -0
  14. package/dist/plugins/actionNetwork/src/index.js +118 -25
  15. package/dist/plugins/activeCampaign/src/index.js +184 -38
  16. package/dist/plugins/adalo/src/index.js +40 -8
  17. package/dist/plugins/affinity/src/index.js +100 -20
  18. package/dist/plugins/agileCrm/src/index.js +115 -27
  19. package/dist/plugins/airtable/src/index.js +94 -19
  20. package/dist/plugins/airtop/src/index.js +266 -62
  21. package/dist/plugins/apiTemplateIo/src/index.js +25 -5
  22. package/dist/plugins/asana/src/index.js +195 -41
  23. package/dist/plugins/autopilot/src/index.js +39 -8
  24. package/dist/plugins/bambooHr/src/index.js +109 -22
  25. package/dist/plugins/bannerbear/src/index.js +36 -8
  26. package/dist/plugins/baserow/src/index.js +35 -7
  27. package/dist/plugins/beeminder/src/index.js +198 -40
  28. package/dist/plugins/bitly/src/index.js +46 -10
  29. package/dist/plugins/bitwarden/src/index.js +167 -36
  30. package/dist/plugins/box/src/index.js +172 -37
  31. package/dist/plugins/brandfetch/src/index.js +5 -1
  32. package/dist/plugins/brevo/src/index.js +136 -29
  33. package/dist/plugins/bubble/src/index.js +76 -17
  34. package/dist/plugins/chargebee/src/index.js +35 -7
  35. package/dist/plugins/circleci/src/index.js +50 -10
  36. package/dist/plugins/ciscoWebex/src/index.js +131 -27
  37. package/dist/plugins/clearbit/src/index.js +76 -17
  38. package/dist/plugins/clickup/src/index.js +500 -107
  39. package/dist/plugins/clockify/src/index.js +229 -47
  40. package/dist/plugins/cloudflare/src/index.js +28 -6
  41. package/dist/plugins/cockpit/src/index.js +54 -12
  42. package/dist/plugins/coda/src/index.js +81 -19
  43. package/dist/plugins/coingecko/src/index.js +157 -33
  44. package/dist/plugins/contentful/src/index.js +85 -17
  45. package/dist/plugins/convertkit/src/index.js +74 -18
  46. package/dist/plugins/copper/src/index.js +59 -11
  47. package/dist/plugins/cortex/src/index.js +55 -13
  48. package/dist/plugins/currents/src/index.js +310 -71
  49. package/dist/plugins/customerIo/src/index.js +112 -23
  50. package/dist/plugins/databricks/src/index.js +549 -115
  51. package/dist/plugins/deepl/src/index.js +26 -6
  52. package/dist/plugins/demio/src/index.js +56 -11
  53. package/dist/plugins/dhl/src/index.js +16 -3
  54. package/dist/plugins/discord/src/index.js +141 -31
  55. package/dist/plugins/discourse/src/index.js +136 -31
  56. package/dist/plugins/disqus/src/index.js +96 -20
  57. package/dist/plugins/docker/src/index.js +20 -4
  58. package/dist/plugins/drift/src/index.js +19 -5
  59. package/dist/plugins/dropbox/src/index.js +139 -30
  60. package/dist/plugins/dropcontact/src/index.js +21 -4
  61. package/dist/plugins/egoi/src/index.js +61 -15
  62. package/dist/plugins/elasticsearch/src/index.js +59 -13
  63. package/dist/plugins/emelia/src/index.js +95 -19
  64. package/dist/plugins/erpnext/src/index.js +74 -15
  65. package/dist/plugins/facebookGraph/src/index.js +52 -11
  66. package/dist/plugins/freshdesk/src/index.js +220 -48
  67. package/dist/plugins/freshservice/src/index.js +39 -9
  68. package/dist/plugins/freshworksCrm/src/index.js +58 -12
  69. package/dist/plugins/getresponse/src/index.js +87 -18
  70. package/dist/plugins/ghost/src/index.js +114 -26
  71. package/dist/plugins/github/src/index.js +483 -109
  72. package/dist/plugins/gitlab/src/index.js +193 -45
  73. package/dist/plugins/gmail/src/index.js +1075 -0
  74. package/dist/plugins/gong/src/index.js +68 -14
  75. package/dist/plugins/gotify/src/index.js +43 -9
  76. package/dist/plugins/gotowebinar/src/index.js +233 -47
  77. package/dist/plugins/grafana/src/index.js +92 -21
  78. package/dist/plugins/graphql/src/index.js +38 -8
  79. package/dist/plugins/grist/src/index.js +52 -10
  80. package/dist/plugins/hackernews/src/index.js +32 -6
  81. package/dist/plugins/halopsa/src/index.js +131 -26
  82. package/dist/plugins/harvest/src/index.js +182 -42
  83. package/dist/plugins/helpscout/src/index.js +153 -31
  84. package/dist/plugins/highlevel/src/index.js +291 -58
  85. package/dist/plugins/homeAssistant/src/index.js +124 -26
  86. package/dist/plugins/hubspot/src/index.js +163 -29
  87. package/dist/plugins/humanticAi/src/index.js +54 -5
  88. package/dist/plugins/hunter/src/index.js +21 -4
  89. package/dist/plugins/intercom/src/index.js +95 -20
  90. package/dist/plugins/iterable/src/index.js +96 -20
  91. package/dist/plugins/jenkins/src/index.js +75 -17
  92. package/dist/plugins/jira/src/index.js +193 -43
  93. package/dist/plugins/keap/src/index.js +222 -56
  94. package/dist/plugins/kobotoolbox/src/index.js +113 -25
  95. package/dist/plugins/lemlist/src/index.js +79 -18
  96. package/dist/plugins/linear/src/index.js +86 -19
  97. package/dist/plugins/lingvanex/src/index.js +38 -8
  98. package/dist/plugins/linkedin/src/index.js +37 -8
  99. package/dist/plugins/lonescale/src/index.js +41 -9
  100. package/dist/plugins/magento/src/index.js +98 -27
  101. package/dist/plugins/mailcheck/src/index.js +11 -2
  102. package/dist/plugins/mailchimp/src/index.js +193 -42
  103. package/dist/plugins/mailerlite/src/index.js +61 -12
  104. package/dist/plugins/mailgun/src/index.js +39 -7
  105. package/dist/plugins/mailjet/src/index.js +141 -30
  106. package/dist/plugins/mandrill/src/index.js +67 -14
  107. package/dist/plugins/marketstack/src/index.js +56 -10
  108. package/dist/plugins/matrix/src/index.js +97 -20
  109. package/dist/plugins/mattermost/src/index.js +124 -26
  110. package/dist/plugins/mautic/src/index.js +129 -26
  111. package/dist/plugins/medium/src/index.js +64 -13
  112. package/dist/plugins/messagebird/src/index.js +80 -15
  113. package/dist/plugins/metabase/src/index.js +57 -12
  114. package/dist/plugins/misp/src/index.js +135 -33
  115. package/dist/plugins/mocean/src/index.js +33 -7
  116. package/dist/plugins/monday/src/index.js +97 -23
  117. package/dist/plugins/monicaCrm/src/index.js +112 -23
  118. package/dist/plugins/msg91/src/index.js +11 -2
  119. package/dist/plugins/nasa/src/index.js +108 -21
  120. package/dist/plugins/netlify/src/index.js +28 -6
  121. package/dist/plugins/netscalerAdc/src/index.js +144 -29
  122. package/dist/plugins/nextcloud/src/index.js +103 -20
  123. package/dist/plugins/nocodb/src/index.js +57 -11
  124. package/dist/plugins/notion/src/index.js +148 -37
  125. package/dist/plugins/npm/src/index.js +59 -12
  126. package/dist/plugins/odoo/src/index.js +102 -20
  127. package/dist/plugins/okta/src/index.js +50 -10
  128. package/dist/plugins/oneSimpleApi/src/index.js +84 -17
  129. package/dist/plugins/onfleet/src/index.js +139 -32
  130. package/dist/plugins/openThesaurus/src/index.js +46 -9
  131. package/dist/plugins/openweathermap/src/index.js +31 -6
  132. package/dist/plugins/oura/src/index.js +36 -7
  133. package/dist/plugins/paddle/src/index.js +80 -17
  134. package/dist/plugins/pagerduty/src/index.js +53 -12
  135. package/dist/plugins/paypal/src/index.js +51 -11
  136. package/dist/plugins/peekalink/src/index.js +12 -3
  137. package/dist/plugins/phantombuster/src/index.js +39 -8
  138. package/dist/plugins/philipsHue/src/index.js +64 -13
  139. package/dist/plugins/pipedrive/src/index.js +167 -45
  140. package/dist/plugins/plivo/src/index.js +43 -8
  141. package/dist/plugins/postbin/src/index.js +9 -2
  142. package/dist/plugins/posthog/src/index.js +50 -13
  143. package/dist/plugins/profitwell/src/index.js +24 -5
  144. package/dist/plugins/pushbullet/src/index.js +45 -9
  145. package/dist/plugins/pushcut/src/index.js +31 -6
  146. package/dist/plugins/pushover/src/index.js +51 -10
  147. package/dist/plugins/quickbase/src/index.js +66 -13
  148. package/dist/plugins/quickbooks/src/index.js +86 -19
  149. package/dist/plugins/quickchart/src/index.js +35 -7
  150. package/dist/plugins/raindrop/src/index.js +54 -13
  151. package/dist/plugins/reddit/src/index.js +73 -18
  152. package/dist/plugins/rocketchat/src/index.js +47 -9
  153. package/dist/plugins/rundeck/src/index.js +26 -5
  154. package/dist/plugins/salesforce/src/index.js +161 -31
  155. package/dist/plugins/salesmate/src/index.js +75 -16
  156. package/dist/plugins/securityScorecard/src/index.js +73 -15
  157. package/dist/plugins/segment/src/index.js +21 -4
  158. package/dist/plugins/sendgrid/src/index.js +102 -24
  159. package/dist/plugins/sendy/src/index.js +54 -11
  160. package/dist/plugins/sentry/src/index.js +174 -34
  161. package/dist/plugins/servicenow/src/index.js +120 -27
  162. package/dist/plugins/shopify/src/index.js +53 -12
  163. package/dist/plugins/signl4/src/index.js +16 -3
  164. package/dist/plugins/slack/src/index.js +407 -105
  165. package/dist/plugins/sms77/src/index.js +26 -5
  166. package/dist/plugins/splunk/src/index.js +186 -45
  167. package/dist/plugins/spotify/src/index.js +265 -66
  168. package/dist/plugins/stackby/src/index.js +18 -6
  169. package/dist/plugins/storyblok/src/index.js +57 -11
  170. package/dist/plugins/strapi/src/index.js +63 -12
  171. package/dist/plugins/strava/src/index.js +58 -13
  172. package/dist/plugins/stripe/src/index.js +143 -30
  173. package/dist/plugins/supabase/src/index.js +49 -10
  174. package/dist/plugins/syncromsp/src/index.js +245 -67
  175. package/dist/plugins/tapfiliate/src/index.js +57 -14
  176. package/dist/plugins/telegram/src/index.js +202 -39
  177. package/dist/plugins/thehive/src/index.js +271 -66
  178. package/dist/plugins/thehiveProject/src/index.js +457 -89
  179. package/dist/plugins/todoist/src/index.js +326 -77
  180. package/dist/plugins/travisci/src/index.js +35 -8
  181. package/dist/plugins/trello/src/index.js +204 -46
  182. package/dist/plugins/twake/src/index.js +10 -2
  183. package/dist/plugins/twilio/src/index.js +56 -11
  184. package/dist/plugins/twist/src/index.js +241 -48
  185. package/dist/plugins/twitter/src/index.js +128 -30
  186. package/dist/plugins/unleashedSoftware/src/index.js +30 -6
  187. package/dist/plugins/uplead/src/index.js +9 -2
  188. package/dist/plugins/uproc/src/index.js +31 -6
  189. package/dist/plugins/uptimerobot/src/index.js +119 -25
  190. package/dist/plugins/urlscanio/src/index.js +25 -6
  191. package/dist/plugins/vero/src/index.js +68 -13
  192. package/dist/plugins/vonage/src/index.js +32 -6
  193. package/dist/plugins/wekan/src/index.js +297 -52
  194. package/dist/plugins/woocommerce/src/index.js +57 -12
  195. package/dist/plugins/wordpress/src/index.js +94 -18
  196. package/dist/plugins/xero/src/index.js +79 -13
  197. package/dist/plugins/yourls/src/index.js +33 -6
  198. package/dist/plugins/zammad/src/index.js +139 -36
  199. package/dist/plugins/zendesk/src/index.js +201 -48
  200. package/dist/plugins/zoho/src/index.js +88 -21
  201. package/dist/plugins/zoom/src/index.js +41 -7
  202. package/dist/plugins/zulip/src/index.js +101 -20
  203. package/package.json +3 -1
@@ -8,7 +8,10 @@ async function apiRequest(baseUrl, token, method, endpoint, body, qs) {
8
8
  }
9
9
  const opts = {
10
10
  method,
11
- headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json; charset=utf-8" },
11
+ headers: {
12
+ Authorization: `Bearer ${token}`,
13
+ "Content-Type": "application/json; charset=utf-8",
14
+ },
12
15
  };
13
16
  if (body !== undefined && method !== "GET" && method !== "DELETE") {
14
17
  opts.body = typeof body === "string" ? body : JSON.stringify(body);
@@ -36,8 +39,18 @@ export default function mattermost(rl) {
36
39
  rl.setName("mattermost");
37
40
  rl.setVersion("0.1.0");
38
41
  rl.setConnectionSchema({
39
- baseUrl: { type: "string", required: true, description: "Mattermost server URL (e.g. https://mattermost.example.com)", env: "MATTERMOST_URL" },
40
- accessToken: { type: "string", required: true, description: "Personal access token or bot token", env: "MATTERMOST_TOKEN" },
42
+ baseUrl: {
43
+ type: "string",
44
+ required: true,
45
+ description: "Mattermost server URL (e.g. https://mattermost.example.com)",
46
+ env: "MATTERMOST_URL",
47
+ },
48
+ accessToken: {
49
+ type: "string",
50
+ required: true,
51
+ description: "Personal access token or bot token",
52
+ env: "MATTERMOST_TOKEN",
53
+ },
41
54
  });
42
55
  const conn = (ctx) => ({
43
56
  baseUrl: ctx.connection.config.baseUrl.replace(/\/$/, ""),
@@ -48,15 +61,30 @@ export default function mattermost(rl) {
48
61
  description: "Create a channel",
49
62
  inputSchema: {
50
63
  teamId: { type: "string", required: true },
51
- displayName: { type: "string", required: true, description: "Display name" },
52
- name: { type: "string", required: true, description: "URL-safe channel name" },
53
- type: { type: "string", required: true, description: "'public' or 'private'" },
64
+ displayName: {
65
+ type: "string",
66
+ required: true,
67
+ description: "Display name",
68
+ },
69
+ name: {
70
+ type: "string",
71
+ required: true,
72
+ description: "URL-safe channel name",
73
+ },
74
+ type: {
75
+ type: "string",
76
+ required: true,
77
+ description: "'public' or 'private'",
78
+ },
54
79
  },
55
80
  async execute(input, ctx) {
56
81
  const { teamId, displayName, name, type } = input;
57
82
  const { baseUrl, token } = conn(ctx);
58
83
  return apiRequest(baseUrl, token, "POST", "channels", {
59
- team_id: teamId, display_name: displayName, name, type: type === "public" ? "O" : "P",
84
+ team_id: teamId,
85
+ display_name: displayName,
86
+ name,
87
+ type: type === "public" ? "O" : "P",
60
88
  });
61
89
  },
62
90
  });
@@ -70,7 +98,10 @@ export default function mattermost(rl) {
70
98
  });
71
99
  rl.registerAction("channel.addUser", {
72
100
  description: "Add a user to a channel",
73
- inputSchema: { channelId: { type: "string", required: true }, userId: { type: "string", required: true } },
101
+ inputSchema: {
102
+ channelId: { type: "string", required: true },
103
+ userId: { type: "string", required: true },
104
+ },
74
105
  async execute(input, ctx) {
75
106
  const { channelId, userId } = input;
76
107
  const { baseUrl, token } = conn(ctx);
@@ -82,7 +113,11 @@ export default function mattermost(rl) {
82
113
  inputSchema: {
83
114
  channelId: { type: "string", required: true },
84
115
  limit: { type: "number", required: false },
85
- resolveData: { type: "boolean", required: false, description: "Resolve user IDs to full user objects" },
116
+ resolveData: {
117
+ type: "boolean",
118
+ required: false,
119
+ description: "Resolve user IDs to full user objects",
120
+ },
86
121
  },
87
122
  async execute(input, ctx) {
88
123
  const { channelId, limit, resolveData } = (input ?? {});
@@ -139,8 +174,16 @@ export default function mattermost(rl) {
139
174
  inputSchema: {
140
175
  channelId: { type: "string", required: true },
141
176
  message: { type: "string", required: true },
142
- attachments: { type: "array", required: false, description: "Array of Mattermost attachment objects" },
143
- rootId: { type: "string", required: false, description: "Post ID to reply to (thread)" },
177
+ attachments: {
178
+ type: "array",
179
+ required: false,
180
+ description: "Array of Mattermost attachment objects",
181
+ },
182
+ rootId: {
183
+ type: "string",
184
+ required: false,
185
+ description: "Post ID to reply to (thread)",
186
+ },
144
187
  },
145
188
  async execute(input, ctx) {
146
189
  const { channelId, message, attachments, rootId } = input;
@@ -165,7 +208,11 @@ export default function mattermost(rl) {
165
208
  description: "Post an ephemeral message (visible only to one user)",
166
209
  inputSchema: {
167
210
  channelId: { type: "string", required: true },
168
- userId: { type: "string", required: true, description: "User who will see the message" },
211
+ userId: {
212
+ type: "string",
213
+ required: true,
214
+ description: "User who will see the message",
215
+ },
169
216
  message: { type: "string", required: true },
170
217
  },
171
218
  async execute(input, ctx) {
@@ -183,7 +230,11 @@ export default function mattermost(rl) {
183
230
  inputSchema: {
184
231
  userId: { type: "string", required: true },
185
232
  postId: { type: "string", required: true },
186
- emojiName: { type: "string", required: true, description: "Emoji name without colons (e.g. 'thumbsup')" },
233
+ emojiName: {
234
+ type: "string",
235
+ required: true,
236
+ description: "Emoji name without colons (e.g. 'thumbsup')",
237
+ },
187
238
  },
188
239
  async execute(input, ctx) {
189
240
  const { userId, postId, emojiName } = input;
@@ -232,16 +283,39 @@ export default function mattermost(rl) {
232
283
  description: "Create a user",
233
284
  inputSchema: {
234
285
  username: { type: "string", required: true },
235
- authService: { type: "string", required: true, description: "'email' for email/password, or an SSO service name" },
236
- email: { type: "string", required: false, description: "Required if authService is 'email'" },
237
- password: { type: "string", required: false, description: "Required if authService is 'email'" },
238
- authData: { type: "string", required: false, description: "Required if authService is not 'email'" },
239
- additionalFields: { type: "object", required: false, description: "first_name, last_name, nickname, locale, position, etc." },
286
+ authService: {
287
+ type: "string",
288
+ required: true,
289
+ description: "'email' for email/password, or an SSO service name",
290
+ },
291
+ email: {
292
+ type: "string",
293
+ required: false,
294
+ description: "Required if authService is 'email'",
295
+ },
296
+ password: {
297
+ type: "string",
298
+ required: false,
299
+ description: "Required if authService is 'email'",
300
+ },
301
+ authData: {
302
+ type: "string",
303
+ required: false,
304
+ description: "Required if authService is not 'email'",
305
+ },
306
+ additionalFields: {
307
+ type: "object",
308
+ required: false,
309
+ description: "first_name, last_name, nickname, locale, position, etc.",
310
+ },
240
311
  },
241
312
  async execute(input, ctx) {
242
- const { username, authService, email, password, authData, additionalFields } = input;
313
+ const { username, authService, email, password, authData, additionalFields, } = input;
243
314
  const { baseUrl, token } = conn(ctx);
244
- const body = { username, auth_service: authService };
315
+ const body = {
316
+ username,
317
+ auth_service: authService,
318
+ };
245
319
  if (authService === "email") {
246
320
  body.email = email;
247
321
  body.password = password;
@@ -266,11 +340,23 @@ export default function mattermost(rl) {
266
340
  description: "List users",
267
341
  inputSchema: {
268
342
  limit: { type: "number", required: false },
269
- inTeam: { type: "string", required: false, description: "Filter by team ID" },
343
+ inTeam: {
344
+ type: "string",
345
+ required: false,
346
+ description: "Filter by team ID",
347
+ },
270
348
  notInTeam: { type: "string", required: false },
271
- inChannel: { type: "string", required: false, description: "Filter by channel ID" },
349
+ inChannel: {
350
+ type: "string",
351
+ required: false,
352
+ description: "Filter by channel ID",
353
+ },
272
354
  notInChannel: { type: "string", required: false },
273
- sort: { type: "string", required: false, description: "last_activity_at, created_at, username, status" },
355
+ sort: {
356
+ type: "string",
357
+ required: false,
358
+ description: "last_activity_at, created_at, username, status",
359
+ },
274
360
  },
275
361
  async execute(input, ctx) {
276
362
  const p = (input ?? {});
@@ -304,8 +390,16 @@ export default function mattermost(rl) {
304
390
  rl.registerAction("user.getByIds", {
305
391
  description: "Get users by IDs",
306
392
  inputSchema: {
307
- userIds: { type: "array", required: true, description: "Array of user IDs" },
308
- since: { type: "string", required: false, description: "ISO datetime — only return users updated since" },
393
+ userIds: {
394
+ type: "array",
395
+ required: true,
396
+ description: "Array of user IDs",
397
+ },
398
+ since: {
399
+ type: "string",
400
+ required: false,
401
+ description: "ISO datetime — only return users updated since",
402
+ },
309
403
  },
310
404
  async execute(input, ctx) {
311
405
  const { userIds, since } = input;
@@ -320,7 +414,11 @@ export default function mattermost(rl) {
320
414
  description: "Invite users to a team by email",
321
415
  inputSchema: {
322
416
  teamId: { type: "string", required: true },
323
- emails: { type: "array", required: true, description: "Array of email addresses" },
417
+ emails: {
418
+ type: "array",
419
+ required: true,
420
+ description: "Array of email addresses",
421
+ },
324
422
  },
325
423
  async execute(input, ctx) {
326
424
  const { teamId, emails } = input;
@@ -8,9 +8,15 @@ async function apiRequest(baseUrl, username, password, method, endpoint, body, q
8
8
  }
9
9
  const opts = {
10
10
  method,
11
- headers: { Authorization: `Basic ${btoa(`${username}:${password}`)}`, "Content-Type": "application/json" },
11
+ headers: {
12
+ Authorization: `Basic ${btoa(`${username}:${password}`)}`,
13
+ "Content-Type": "application/json",
14
+ },
12
15
  };
13
- if (body && Object.keys(body).length > 0 && method !== "GET" && method !== "DELETE")
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)
@@ -30,16 +36,32 @@ async function paginateAll(baseUrl, username, password, propertyName, endpoint,
30
36
  const values = Object.values((data[propertyName] ?? {}));
31
37
  all.push(...values);
32
38
  qs.start += qs.limit;
33
- } while (data.total !== undefined && all.length < Number.parseInt(data.total, 10));
39
+ } while (data.total !== undefined &&
40
+ all.length < Number.parseInt(data.total, 10));
34
41
  return all;
35
42
  }
36
43
  export default function mautic(rl) {
37
44
  rl.setName("mautic");
38
45
  rl.setVersion("0.1.0");
39
46
  rl.setConnectionSchema({
40
- url: { type: "string", required: true, description: "Mautic instance URL (e.g. https://mautic.example.com)", env: "MAUTIC_URL" },
41
- username: { type: "string", required: true, description: "Mautic username", env: "MAUTIC_USERNAME" },
42
- password: { type: "string", required: true, description: "Mautic password", env: "MAUTIC_PASSWORD" },
47
+ url: {
48
+ type: "string",
49
+ required: true,
50
+ description: "Mautic instance URL (e.g. https://mautic.example.com)",
51
+ env: "MAUTIC_URL",
52
+ },
53
+ username: {
54
+ type: "string",
55
+ required: true,
56
+ description: "Mautic username",
57
+ env: "MAUTIC_USERNAME",
58
+ },
59
+ password: {
60
+ type: "string",
61
+ required: true,
62
+ description: "Mautic password",
63
+ env: "MAUTIC_PASSWORD",
64
+ },
43
65
  });
44
66
  const conn = (ctx) => ({
45
67
  baseUrl: ctx.connection.config.url.replace(/\/$/, ""),
@@ -59,7 +81,11 @@ export default function mautic(rl) {
59
81
  description: "Create a company",
60
82
  inputSchema: {
61
83
  companyname: { type: "string", required: true },
62
- additionalFields: { type: "object", required: false, description: "companyemail, companyfax, companyindustry, companyphone, companywebsite, companyannual_revenue, companydescription, companynumber_of_employees, companyaddress1, companyaddress2, companycity, companystate, companycountry, companyzipcode, custom fields" },
84
+ additionalFields: {
85
+ type: "object",
86
+ required: false,
87
+ description: "companyemail, companyfax, companyindustry, companyphone, companywebsite, companyannual_revenue, companydescription, companynumber_of_employees, companyaddress1, companyaddress2, companycity, companystate, companycountry, companyzipcode, custom fields",
88
+ },
63
89
  },
64
90
  async execute(input, ctx) {
65
91
  const { companyname, additionalFields } = input;
@@ -74,7 +100,11 @@ export default function mautic(rl) {
74
100
  description: "Update a company",
75
101
  inputSchema: {
76
102
  companyId: { type: "string", required: true },
77
- updateFields: { type: "object", required: true, description: "Fields to update (same keys as create)" },
103
+ updateFields: {
104
+ type: "object",
105
+ required: true,
106
+ description: "Fields to update (same keys as create)",
107
+ },
78
108
  },
79
109
  async execute(input, ctx) {
80
110
  const { companyId, updateFields } = input;
@@ -92,7 +122,16 @@ export default function mautic(rl) {
92
122
  });
93
123
  rl.registerAction("company.list", {
94
124
  description: "List companies",
95
- inputSchema: { limit: { type: "number", required: false }, search: { type: "string", required: false }, orderBy: { type: "string", required: false }, orderByDir: { type: "string", required: false, description: "ASC or DESC" } },
125
+ inputSchema: {
126
+ limit: { type: "number", required: false },
127
+ search: { type: "string", required: false },
128
+ orderBy: { type: "string", required: false },
129
+ orderByDir: {
130
+ type: "string",
131
+ required: false,
132
+ description: "ASC or DESC",
133
+ },
134
+ },
96
135
  async execute(input, ctx) {
97
136
  const p = (input ?? {});
98
137
  const qs = {};
@@ -132,11 +171,19 @@ export default function mautic(rl) {
132
171
  phone: { type: "string", required: false },
133
172
  mobile: { type: "string", required: false },
134
173
  website: { type: "string", required: false },
135
- tags: { type: "string", required: false, description: "Comma-separated tags" },
174
+ tags: {
175
+ type: "string",
176
+ required: false,
177
+ description: "Comma-separated tags",
178
+ },
136
179
  stage: { type: "string", required: false, description: "Stage ID" },
137
180
  owner: { type: "string", required: false, description: "Owner user ID" },
138
181
  ipAddress: { type: "string", required: false },
139
- additionalFields: { type: "object", required: false, description: "Custom fields, address fields (address1, address2, city, state, country, zipcode), social (facebook, twitter, linkedin, skype, instagram, foursquare)" },
182
+ additionalFields: {
183
+ type: "object",
184
+ required: false,
185
+ description: "Custom fields, address fields (address1, address2, city, state, country, zipcode), social (facebook, twitter, linkedin, skype, instagram, foursquare)",
186
+ },
140
187
  },
141
188
  async execute(input, ctx) {
142
189
  const { additionalFields, ...rest } = input;
@@ -155,7 +202,11 @@ export default function mautic(rl) {
155
202
  description: "Update a contact",
156
203
  inputSchema: {
157
204
  contactId: { type: "string", required: true },
158
- updateFields: { type: "object", required: true, description: "Fields to update (email, firstname, lastname, company, position, title, phone, mobile, address fields, social fields, custom fields, tags, stage, owner, etc.)" },
205
+ updateFields: {
206
+ type: "object",
207
+ required: true,
208
+ description: "Fields to update (email, firstname, lastname, company, position, title, phone, mobile, address fields, social fields, custom fields, tags, stage, owner, etc.)",
209
+ },
159
210
  },
160
211
  async execute(input, ctx) {
161
212
  const { contactId, updateFields } = input;
@@ -176,8 +227,16 @@ export default function mautic(rl) {
176
227
  inputSchema: {
177
228
  limit: { type: "number", required: false },
178
229
  search: { type: "string", required: false },
179
- orderBy: { type: "string", required: false, description: "Field to order by (snake_case)" },
180
- orderByDir: { type: "string", required: false, description: "ASC or DESC" },
230
+ orderBy: {
231
+ type: "string",
232
+ required: false,
233
+ description: "Field to order by (snake_case)",
234
+ },
235
+ orderByDir: {
236
+ type: "string",
237
+ required: false,
238
+ description: "ASC or DESC",
239
+ },
181
240
  },
182
241
  async execute(input, ctx) {
183
242
  const p = (input ?? {});
@@ -209,7 +268,11 @@ export default function mautic(rl) {
209
268
  description: "Send a campaign/template email to a contact",
210
269
  inputSchema: {
211
270
  contactId: { type: "string", required: true },
212
- emailId: { type: "string", required: true, description: "Campaign email ID (template type)" },
271
+ emailId: {
272
+ type: "string",
273
+ required: true,
274
+ description: "Campaign email ID (template type)",
275
+ },
213
276
  },
214
277
  async execute(input, ctx) {
215
278
  const { contactId, emailId } = input;
@@ -220,9 +283,21 @@ export default function mautic(rl) {
220
283
  description: "Add or remove a contact from the Do Not Contact list",
221
284
  inputSchema: {
222
285
  contactId: { type: "string", required: true },
223
- channel: { type: "string", required: true, description: "email, sms, etc." },
224
- action: { type: "string", required: true, description: "'add' or 'remove'" },
225
- reason: { type: "number", required: false, description: "DNC reason (1=contacted, 2=unsubscribed, 3=bounced, 4=manual)" },
286
+ channel: {
287
+ type: "string",
288
+ required: true,
289
+ description: "email, sms, etc.",
290
+ },
291
+ action: {
292
+ type: "string",
293
+ required: true,
294
+ description: "'add' or 'remove'",
295
+ },
296
+ reason: {
297
+ type: "number",
298
+ required: false,
299
+ description: "DNC reason (1=contacted, 2=unsubscribed, 3=bounced, 4=manual)",
300
+ },
226
301
  comments: { type: "string", required: false },
227
302
  },
228
303
  async execute(input, ctx) {
@@ -240,7 +315,11 @@ export default function mautic(rl) {
240
315
  description: "Add or subtract points from a contact",
241
316
  inputSchema: {
242
317
  contactId: { type: "string", required: true },
243
- action: { type: "string", required: true, description: "'add' or 'subtract'" },
318
+ action: {
319
+ type: "string",
320
+ required: true,
321
+ description: "'add' or 'subtract'",
322
+ },
244
323
  points: { type: "number", required: true },
245
324
  },
246
325
  async execute(input, ctx) {
@@ -252,7 +331,10 @@ export default function mautic(rl) {
252
331
  // ── Contact Segment ─────────────────────────────────
253
332
  rl.registerAction("contactSegment.add", {
254
333
  description: "Add a contact to a segment",
255
- inputSchema: { segmentId: { type: "string", required: true }, contactId: { type: "string", required: true } },
334
+ inputSchema: {
335
+ segmentId: { type: "string", required: true },
336
+ contactId: { type: "string", required: true },
337
+ },
256
338
  async execute(input, ctx) {
257
339
  const { segmentId, contactId } = input;
258
340
  return req(ctx, "POST", `/segments/${segmentId}/contact/${contactId}/add`);
@@ -260,7 +342,10 @@ export default function mautic(rl) {
260
342
  });
261
343
  rl.registerAction("contactSegment.remove", {
262
344
  description: "Remove a contact from a segment",
263
- inputSchema: { segmentId: { type: "string", required: true }, contactId: { type: "string", required: true } },
345
+ inputSchema: {
346
+ segmentId: { type: "string", required: true },
347
+ contactId: { type: "string", required: true },
348
+ },
264
349
  async execute(input, ctx) {
265
350
  const { segmentId, contactId } = input;
266
351
  return req(ctx, "POST", `/segments/${segmentId}/contact/${contactId}/remove`);
@@ -269,7 +354,10 @@ export default function mautic(rl) {
269
354
  // ── Campaign Contact ────────────────────────────────
270
355
  rl.registerAction("campaignContact.add", {
271
356
  description: "Add a contact to a campaign",
272
- inputSchema: { campaignId: { type: "string", required: true }, contactId: { type: "string", required: true } },
357
+ inputSchema: {
358
+ campaignId: { type: "string", required: true },
359
+ contactId: { type: "string", required: true },
360
+ },
273
361
  async execute(input, ctx) {
274
362
  const { campaignId, contactId } = input;
275
363
  return req(ctx, "POST", `/campaigns/${campaignId}/contact/${contactId}/add`);
@@ -277,7 +365,10 @@ export default function mautic(rl) {
277
365
  });
278
366
  rl.registerAction("campaignContact.remove", {
279
367
  description: "Remove a contact from a campaign",
280
- inputSchema: { campaignId: { type: "string", required: true }, contactId: { type: "string", required: true } },
368
+ inputSchema: {
369
+ campaignId: { type: "string", required: true },
370
+ contactId: { type: "string", required: true },
371
+ },
281
372
  async execute(input, ctx) {
282
373
  const { campaignId, contactId } = input;
283
374
  return req(ctx, "POST", `/campaigns/${campaignId}/contact/${contactId}/remove`);
@@ -286,7 +377,10 @@ export default function mautic(rl) {
286
377
  // ── Company Contact ─────────────────────────────────
287
378
  rl.registerAction("companyContact.add", {
288
379
  description: "Add a contact to a company",
289
- inputSchema: { companyId: { type: "string", required: true }, contactId: { type: "string", required: true } },
380
+ inputSchema: {
381
+ companyId: { type: "string", required: true },
382
+ contactId: { type: "string", required: true },
383
+ },
290
384
  async execute(input, ctx) {
291
385
  const { companyId, contactId } = input;
292
386
  return req(ctx, "POST", `/companies/${companyId}/contact/${contactId}/add`);
@@ -294,7 +388,10 @@ export default function mautic(rl) {
294
388
  });
295
389
  rl.registerAction("companyContact.remove", {
296
390
  description: "Remove a contact from a company",
297
- inputSchema: { companyId: { type: "string", required: true }, contactId: { type: "string", required: true } },
391
+ inputSchema: {
392
+ companyId: { type: "string", required: true },
393
+ contactId: { type: "string", required: true },
394
+ },
298
395
  async execute(input, ctx) {
299
396
  const { companyId, contactId } = input;
300
397
  return req(ctx, "POST", `/companies/${companyId}/contact/${contactId}/remove`);
@@ -303,7 +400,13 @@ export default function mautic(rl) {
303
400
  // ── Segment Email ───────────────────────────────────
304
401
  rl.registerAction("segmentEmail.send", {
305
402
  description: "Send a segment (list) email",
306
- inputSchema: { emailId: { type: "string", required: true, description: "Segment email ID" } },
403
+ inputSchema: {
404
+ emailId: {
405
+ type: "string",
406
+ required: true,
407
+ description: "Segment email ID",
408
+ },
409
+ },
307
410
  async execute(input, ctx) {
308
411
  return req(ctx, "POST", `/emails/${input.emailId}/send`);
309
412
  },
@@ -2,7 +2,12 @@ const BASE_URL = "https://api.medium.com/v1";
2
2
  async function apiRequest(token, method, endpoint, body) {
3
3
  const opts = {
4
4
  method,
5
- headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json", Accept: "application/json", "Accept-Charset": "utf-8" },
5
+ headers: {
6
+ Authorization: `Bearer ${token}`,
7
+ "Content-Type": "application/json",
8
+ Accept: "application/json",
9
+ "Accept-Charset": "utf-8",
10
+ },
6
11
  };
7
12
  if (body && Object.keys(body).length > 0 && method !== "GET")
8
13
  opts.body = JSON.stringify(body);
@@ -15,25 +20,71 @@ export default function medium(rl) {
15
20
  rl.setName("medium");
16
21
  rl.setVersion("0.1.0");
17
22
  rl.setConnectionSchema({
18
- accessToken: { type: "string", required: true, description: "Medium integration token", env: "MEDIUM_ACCESS_TOKEN" },
23
+ accessToken: {
24
+ type: "string",
25
+ required: true,
26
+ description: "Medium integration token",
27
+ env: "MEDIUM_ACCESS_TOKEN",
28
+ },
19
29
  });
20
30
  const tok = (ctx) => ctx.connection.config.accessToken;
21
31
  rl.registerAction("post.create", {
22
32
  description: "Create a post on Medium. Posts under the authenticated user by default, or under a publication if publicationId is provided.",
23
33
  inputSchema: {
24
- title: { type: "string", required: true, description: "Post title (max 100 chars)" },
25
- contentFormat: { type: "string", required: true, description: "'html' or 'markdown'" },
26
- content: { type: "string", required: true, description: "Post body in the specified format" },
27
- publicationId: { type: "string", required: false, description: "Publication ID to post under (omit for personal post)" },
28
- tags: { type: "array", required: false, description: "Array of tag strings (max 5, each max 25 chars)" },
29
- canonicalUrl: { type: "string", required: false, description: "Original URL if cross-posting" },
30
- publishStatus: { type: "string", required: false, description: "'public' (default), 'draft', or 'unlisted'" },
31
- license: { type: "string", required: false, description: "License: all-rights-reserved, cc-40-by, cc-40-by-nc, cc-40-by-nc-nd, cc-40-by-nc-sa, cc-40-by-nd, cc-40-by-sa, cc-40-zero, public-domain" },
32
- notifyFollowers: { type: "boolean", required: false, description: "Notify followers" },
34
+ title: {
35
+ type: "string",
36
+ required: true,
37
+ description: "Post title (max 100 chars)",
38
+ },
39
+ contentFormat: {
40
+ type: "string",
41
+ required: true,
42
+ description: "'html' or 'markdown'",
43
+ },
44
+ content: {
45
+ type: "string",
46
+ required: true,
47
+ description: "Post body in the specified format",
48
+ },
49
+ publicationId: {
50
+ type: "string",
51
+ required: false,
52
+ description: "Publication ID to post under (omit for personal post)",
53
+ },
54
+ tags: {
55
+ type: "array",
56
+ required: false,
57
+ description: "Array of tag strings (max 5, each max 25 chars)",
58
+ },
59
+ canonicalUrl: {
60
+ type: "string",
61
+ required: false,
62
+ description: "Original URL if cross-posting",
63
+ },
64
+ publishStatus: {
65
+ type: "string",
66
+ required: false,
67
+ description: "'public' (default), 'draft', or 'unlisted'",
68
+ },
69
+ license: {
70
+ type: "string",
71
+ required: false,
72
+ description: "License: all-rights-reserved, cc-40-by, cc-40-by-nc, cc-40-by-nc-nd, cc-40-by-nc-sa, cc-40-by-nd, cc-40-by-sa, cc-40-zero, public-domain",
73
+ },
74
+ notifyFollowers: {
75
+ type: "boolean",
76
+ required: false,
77
+ description: "Notify followers",
78
+ },
33
79
  },
34
80
  async execute(input, ctx) {
35
- const { title, contentFormat, content, publicationId, tags, canonicalUrl, publishStatus, license, notifyFollowers } = input;
36
- const body = { title, contentFormat, content, tags: tags ?? [] };
81
+ const { title, contentFormat, content, publicationId, tags, canonicalUrl, publishStatus, license, notifyFollowers, } = input;
82
+ const body = {
83
+ title,
84
+ contentFormat,
85
+ content,
86
+ tags: tags ?? [],
87
+ };
37
88
  if (canonicalUrl)
38
89
  body.canonicalUrl = canonicalUrl;
39
90
  if (publishStatus)