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.
Files changed (189) hide show
  1. package/dist/plugins/actionNetwork/src/index.js +118 -25
  2. package/dist/plugins/activeCampaign/src/index.js +184 -38
  3. package/dist/plugins/adalo/src/index.js +40 -8
  4. package/dist/plugins/affinity/src/index.js +100 -20
  5. package/dist/plugins/agileCrm/src/index.js +115 -27
  6. package/dist/plugins/airtable/src/index.js +94 -19
  7. package/dist/plugins/airtop/src/index.js +266 -62
  8. package/dist/plugins/apiTemplateIo/src/index.js +25 -5
  9. package/dist/plugins/asana/src/index.js +195 -41
  10. package/dist/plugins/autopilot/src/index.js +39 -8
  11. package/dist/plugins/bambooHr/src/index.js +109 -22
  12. package/dist/plugins/bannerbear/src/index.js +36 -8
  13. package/dist/plugins/baserow/src/index.js +35 -7
  14. package/dist/plugins/beeminder/src/index.js +198 -40
  15. package/dist/plugins/bitly/src/index.js +46 -10
  16. package/dist/plugins/bitwarden/src/index.js +167 -36
  17. package/dist/plugins/box/src/index.js +172 -37
  18. package/dist/plugins/brandfetch/src/index.js +5 -1
  19. package/dist/plugins/brevo/src/index.js +136 -29
  20. package/dist/plugins/bubble/src/index.js +76 -17
  21. package/dist/plugins/chargebee/src/index.js +35 -7
  22. package/dist/plugins/circleci/src/index.js +50 -10
  23. package/dist/plugins/ciscoWebex/src/index.js +131 -27
  24. package/dist/plugins/clearbit/src/index.js +76 -17
  25. package/dist/plugins/clickup/src/index.js +500 -107
  26. package/dist/plugins/clockify/src/index.js +229 -47
  27. package/dist/plugins/cloudflare/src/index.js +28 -6
  28. package/dist/plugins/cockpit/src/index.js +54 -12
  29. package/dist/plugins/coda/src/index.js +81 -19
  30. package/dist/plugins/coingecko/src/index.js +157 -33
  31. package/dist/plugins/contentful/src/index.js +85 -17
  32. package/dist/plugins/convertkit/src/index.js +74 -18
  33. package/dist/plugins/copper/src/index.js +59 -11
  34. package/dist/plugins/cortex/src/index.js +55 -13
  35. package/dist/plugins/currents/src/index.js +310 -71
  36. package/dist/plugins/customerIo/src/index.js +112 -23
  37. package/dist/plugins/databricks/src/index.js +549 -115
  38. package/dist/plugins/deepl/src/index.js +26 -6
  39. package/dist/plugins/demio/src/index.js +56 -11
  40. package/dist/plugins/dhl/src/index.js +16 -3
  41. package/dist/plugins/discord/src/index.js +141 -31
  42. package/dist/plugins/discourse/src/index.js +136 -31
  43. package/dist/plugins/disqus/src/index.js +96 -20
  44. package/dist/plugins/docker/src/index.js +20 -4
  45. package/dist/plugins/drift/src/index.js +19 -5
  46. package/dist/plugins/dropbox/src/index.js +139 -30
  47. package/dist/plugins/dropcontact/src/index.js +21 -4
  48. package/dist/plugins/egoi/src/index.js +61 -15
  49. package/dist/plugins/elasticsearch/src/index.js +59 -13
  50. package/dist/plugins/emelia/src/index.js +95 -19
  51. package/dist/plugins/erpnext/src/index.js +74 -15
  52. package/dist/plugins/facebookGraph/src/index.js +52 -11
  53. package/dist/plugins/freshdesk/src/index.js +220 -48
  54. package/dist/plugins/freshservice/src/index.js +39 -9
  55. package/dist/plugins/freshworksCrm/src/index.js +58 -12
  56. package/dist/plugins/getresponse/src/index.js +87 -18
  57. package/dist/plugins/ghost/src/index.js +114 -26
  58. package/dist/plugins/github/src/index.js +483 -109
  59. package/dist/plugins/gitlab/src/index.js +193 -45
  60. package/dist/plugins/gong/src/index.js +68 -14
  61. package/dist/plugins/gotify/src/index.js +43 -9
  62. package/dist/plugins/gotowebinar/src/index.js +233 -47
  63. package/dist/plugins/grafana/src/index.js +92 -21
  64. package/dist/plugins/graphql/src/index.js +38 -8
  65. package/dist/plugins/grist/src/index.js +52 -10
  66. package/dist/plugins/hackernews/src/index.js +32 -6
  67. package/dist/plugins/halopsa/src/index.js +131 -26
  68. package/dist/plugins/harvest/src/index.js +182 -42
  69. package/dist/plugins/helpscout/src/index.js +153 -31
  70. package/dist/plugins/highlevel/src/index.js +291 -58
  71. package/dist/plugins/homeAssistant/src/index.js +124 -26
  72. package/dist/plugins/hubspot/src/index.js +163 -29
  73. package/dist/plugins/humanticAi/src/index.js +54 -5
  74. package/dist/plugins/hunter/src/index.js +21 -4
  75. package/dist/plugins/intercom/src/index.js +95 -20
  76. package/dist/plugins/iterable/src/index.js +96 -20
  77. package/dist/plugins/jenkins/src/index.js +75 -17
  78. package/dist/plugins/jira/src/index.js +193 -43
  79. package/dist/plugins/keap/src/index.js +222 -56
  80. package/dist/plugins/kobotoolbox/src/index.js +113 -25
  81. package/dist/plugins/lemlist/src/index.js +79 -18
  82. package/dist/plugins/linear/src/index.js +86 -19
  83. package/dist/plugins/lingvanex/src/index.js +38 -8
  84. package/dist/plugins/linkedin/src/index.js +37 -8
  85. package/dist/plugins/lonescale/src/index.js +41 -9
  86. package/dist/plugins/magento/src/index.js +98 -27
  87. package/dist/plugins/mailcheck/src/index.js +11 -2
  88. package/dist/plugins/mailchimp/src/index.js +193 -42
  89. package/dist/plugins/mailerlite/src/index.js +61 -12
  90. package/dist/plugins/mailgun/src/index.js +39 -7
  91. package/dist/plugins/mailjet/src/index.js +141 -30
  92. package/dist/plugins/mandrill/src/index.js +67 -14
  93. package/dist/plugins/marketstack/src/index.js +56 -10
  94. package/dist/plugins/matrix/src/index.js +97 -20
  95. package/dist/plugins/mattermost/src/index.js +124 -26
  96. package/dist/plugins/mautic/src/index.js +129 -26
  97. package/dist/plugins/medium/src/index.js +64 -13
  98. package/dist/plugins/messagebird/src/index.js +80 -15
  99. package/dist/plugins/metabase/src/index.js +57 -12
  100. package/dist/plugins/misp/src/index.js +135 -33
  101. package/dist/plugins/mocean/src/index.js +33 -7
  102. package/dist/plugins/monday/src/index.js +97 -23
  103. package/dist/plugins/monicaCrm/src/index.js +112 -23
  104. package/dist/plugins/msg91/src/index.js +11 -2
  105. package/dist/plugins/nasa/src/index.js +108 -21
  106. package/dist/plugins/netlify/src/index.js +28 -6
  107. package/dist/plugins/netscalerAdc/src/index.js +144 -29
  108. package/dist/plugins/nextcloud/src/index.js +103 -20
  109. package/dist/plugins/nocodb/src/index.js +57 -11
  110. package/dist/plugins/notion/src/index.js +148 -37
  111. package/dist/plugins/npm/src/index.js +59 -12
  112. package/dist/plugins/odoo/src/index.js +102 -20
  113. package/dist/plugins/okta/src/index.js +50 -10
  114. package/dist/plugins/oneSimpleApi/src/index.js +84 -17
  115. package/dist/plugins/onfleet/src/index.js +139 -32
  116. package/dist/plugins/openThesaurus/src/index.js +46 -9
  117. package/dist/plugins/openweathermap/src/index.js +31 -6
  118. package/dist/plugins/oura/src/index.js +36 -7
  119. package/dist/plugins/paddle/src/index.js +80 -17
  120. package/dist/plugins/pagerduty/src/index.js +53 -12
  121. package/dist/plugins/paypal/src/index.js +51 -11
  122. package/dist/plugins/peekalink/src/index.js +12 -3
  123. package/dist/plugins/phantombuster/src/index.js +39 -8
  124. package/dist/plugins/philipsHue/src/index.js +64 -13
  125. package/dist/plugins/pipedrive/src/index.js +167 -45
  126. package/dist/plugins/plivo/src/index.js +43 -8
  127. package/dist/plugins/postbin/src/index.js +9 -2
  128. package/dist/plugins/posthog/src/index.js +50 -13
  129. package/dist/plugins/profitwell/src/index.js +24 -5
  130. package/dist/plugins/pushbullet/src/index.js +45 -9
  131. package/dist/plugins/pushcut/src/index.js +31 -6
  132. package/dist/plugins/pushover/src/index.js +51 -10
  133. package/dist/plugins/quickbase/src/index.js +66 -13
  134. package/dist/plugins/quickbooks/src/index.js +86 -19
  135. package/dist/plugins/quickchart/src/index.js +35 -7
  136. package/dist/plugins/raindrop/src/index.js +54 -13
  137. package/dist/plugins/reddit/src/index.js +73 -18
  138. package/dist/plugins/rocketchat/src/index.js +47 -9
  139. package/dist/plugins/rundeck/src/index.js +26 -5
  140. package/dist/plugins/salesforce/src/index.js +161 -31
  141. package/dist/plugins/salesmate/src/index.js +75 -16
  142. package/dist/plugins/securityScorecard/src/index.js +73 -15
  143. package/dist/plugins/segment/src/index.js +21 -4
  144. package/dist/plugins/sendgrid/src/index.js +102 -24
  145. package/dist/plugins/sendy/src/index.js +54 -11
  146. package/dist/plugins/sentry/src/index.js +174 -34
  147. package/dist/plugins/servicenow/src/index.js +120 -27
  148. package/dist/plugins/shopify/src/index.js +53 -12
  149. package/dist/plugins/signl4/src/index.js +16 -3
  150. package/dist/plugins/slack/src/index.js +407 -105
  151. package/dist/plugins/sms77/src/index.js +26 -5
  152. package/dist/plugins/splunk/src/index.js +186 -45
  153. package/dist/plugins/spotify/src/index.js +265 -66
  154. package/dist/plugins/stackby/src/index.js +18 -6
  155. package/dist/plugins/storyblok/src/index.js +57 -11
  156. package/dist/plugins/strapi/src/index.js +63 -12
  157. package/dist/plugins/strava/src/index.js +58 -13
  158. package/dist/plugins/stripe/src/index.js +143 -30
  159. package/dist/plugins/supabase/src/index.js +49 -10
  160. package/dist/plugins/syncromsp/src/index.js +245 -67
  161. package/dist/plugins/tapfiliate/src/index.js +57 -14
  162. package/dist/plugins/telegram/src/index.js +202 -39
  163. package/dist/plugins/thehive/src/index.js +271 -66
  164. package/dist/plugins/thehiveProject/src/index.js +457 -89
  165. package/dist/plugins/todoist/src/index.js +326 -77
  166. package/dist/plugins/travisci/src/index.js +35 -8
  167. package/dist/plugins/trello/src/index.js +204 -46
  168. package/dist/plugins/twake/src/index.js +10 -2
  169. package/dist/plugins/twilio/src/index.js +56 -11
  170. package/dist/plugins/twist/src/index.js +241 -48
  171. package/dist/plugins/twitter/src/index.js +128 -30
  172. package/dist/plugins/unleashedSoftware/src/index.js +30 -6
  173. package/dist/plugins/uplead/src/index.js +9 -2
  174. package/dist/plugins/uproc/src/index.js +31 -6
  175. package/dist/plugins/uptimerobot/src/index.js +119 -25
  176. package/dist/plugins/urlscanio/src/index.js +25 -6
  177. package/dist/plugins/vero/src/index.js +68 -13
  178. package/dist/plugins/vonage/src/index.js +32 -6
  179. package/dist/plugins/wekan/src/index.js +297 -52
  180. package/dist/plugins/woocommerce/src/index.js +57 -12
  181. package/dist/plugins/wordpress/src/index.js +94 -18
  182. package/dist/plugins/xero/src/index.js +79 -13
  183. package/dist/plugins/yourls/src/index.js +33 -6
  184. package/dist/plugins/zammad/src/index.js +139 -36
  185. package/dist/plugins/zendesk/src/index.js +201 -48
  186. package/dist/plugins/zoho/src/index.js +88 -21
  187. package/dist/plugins/zoom/src/index.js +41 -7
  188. package/dist/plugins/zulip/src/index.js +101 -20
  189. package/package.json +1 -1
@@ -8,7 +8,13 @@ async function api(token, method, endpoint, body, qs) {
8
8
  url.searchParams.set(k, String(v));
9
9
  }
10
10
  }
11
- const init = { method, headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" } };
11
+ const init = {
12
+ method,
13
+ headers: {
14
+ Authorization: `Bearer ${token}`,
15
+ "Content-Type": "application/json",
16
+ },
17
+ };
12
18
  if (body && Object.keys(body).length > 0)
13
19
  init.body = JSON.stringify(body);
14
20
  const res = await fetch(url.toString(), init);
@@ -21,7 +27,11 @@ async function api(token, method, endpoint, body, qs) {
21
27
  }
22
28
  async function syncApi(token, body) {
23
29
  const res = await fetch(`${SYNC_BASE}/sync`, {
24
- method: "POST", headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
30
+ method: "POST",
31
+ headers: {
32
+ Authorization: `Bearer ${token}`,
33
+ "Content-Type": "application/json",
34
+ },
25
35
  body: JSON.stringify(body),
26
36
  });
27
37
  if (!res.ok)
@@ -30,7 +40,11 @@ async function syncApi(token, body) {
30
40
  }
31
41
  async function quickAdd(token, body) {
32
42
  const res = await fetch(`${SYNC_BASE}/quick/add`, {
33
- method: "POST", headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
43
+ method: "POST",
44
+ headers: {
45
+ Authorization: `Bearer ${token}`,
46
+ "Content-Type": "application/json",
47
+ },
34
48
  body: JSON.stringify(body),
35
49
  });
36
50
  if (!res.ok)
@@ -40,11 +54,38 @@ async function quickAdd(token, body) {
40
54
  export default function todoist(rl) {
41
55
  rl.setName("todoist");
42
56
  rl.setVersion("0.1.0");
43
- rl.setConnectionSchema({ apiToken: { type: "string", required: true, description: "Todoist API token", env: "TODOIST_API_TOKEN" } });
57
+ rl.setConnectionSchema({
58
+ apiToken: {
59
+ type: "string",
60
+ required: true,
61
+ description: "Todoist API token",
62
+ env: "TODOIST_API_TOKEN",
63
+ },
64
+ });
44
65
  const t = (ctx) => ctx.connection.config.apiToken;
45
66
  // ── Task ────────────────────────────────────────────
46
- rl.registerAction("task.create", { description: "Create a task",
47
- inputSchema: { content: { type: "string", required: true }, projectId: { type: "string", required: false }, description: { type: "string", required: false }, priority: { type: "number", required: false, description: "1 (normal) to 4 (urgent)" }, dueString: { type: "string", required: false }, dueDate: { type: "string", required: false, description: "YYYY-MM-DD" }, labels: { type: "object", required: false, description: "Array of label names" }, sectionId: { type: "string", required: false }, parentId: { type: "string", required: false }, assigneeId: { type: "string", required: false } },
67
+ rl.registerAction("task.create", {
68
+ description: "Create a task",
69
+ inputSchema: {
70
+ content: { type: "string", required: true },
71
+ projectId: { type: "string", required: false },
72
+ description: { type: "string", required: false },
73
+ priority: {
74
+ type: "number",
75
+ required: false,
76
+ description: "1 (normal) to 4 (urgent)",
77
+ },
78
+ dueString: { type: "string", required: false },
79
+ dueDate: { type: "string", required: false, description: "YYYY-MM-DD" },
80
+ labels: {
81
+ type: "object",
82
+ required: false,
83
+ description: "Array of label names",
84
+ },
85
+ sectionId: { type: "string", required: false },
86
+ parentId: { type: "string", required: false },
87
+ assigneeId: { type: "string", required: false },
88
+ },
48
89
  async execute(input, ctx) {
49
90
  const p = input;
50
91
  const body = { content: p.content };
@@ -67,11 +108,24 @@ export default function todoist(rl) {
67
108
  if (p.assigneeId)
68
109
  body.assignee_id = p.assigneeId;
69
110
  return api(t(ctx), "POST", "/tasks", body);
70
- } });
71
- rl.registerAction("task.get", { description: "Get a task by ID", inputSchema: { id: { type: "string", required: true } },
72
- async execute(input, ctx) { return api(t(ctx), "GET", `/tasks/${input.id}`); } });
73
- rl.registerAction("task.list", { description: "List tasks",
74
- inputSchema: { projectId: { type: "string", required: false }, sectionId: { type: "string", required: false }, label: { type: "string", required: false }, filter: { type: "string", required: false }, limit: { type: "number", required: false } },
111
+ },
112
+ });
113
+ rl.registerAction("task.get", {
114
+ description: "Get a task by ID",
115
+ inputSchema: { id: { type: "string", required: true } },
116
+ async execute(input, ctx) {
117
+ return api(t(ctx), "GET", `/tasks/${input.id}`);
118
+ },
119
+ });
120
+ rl.registerAction("task.list", {
121
+ description: "List tasks",
122
+ inputSchema: {
123
+ projectId: { type: "string", required: false },
124
+ sectionId: { type: "string", required: false },
125
+ label: { type: "string", required: false },
126
+ filter: { type: "string", required: false },
127
+ limit: { type: "number", required: false },
128
+ },
75
129
  async execute(input, ctx) {
76
130
  const p = (input ?? {});
77
131
  const qs = {};
@@ -85,9 +139,20 @@ export default function todoist(rl) {
85
139
  qs.filter = p.filter;
86
140
  const data = (await api(t(ctx), "GET", "/tasks", undefined, qs));
87
141
  return p.limit ? data.slice(0, p.limit) : data;
88
- } });
89
- rl.registerAction("task.update", { description: "Update a task",
90
- inputSchema: { id: { type: "string", required: true }, content: { type: "string", required: false }, description: { type: "string", required: false }, priority: { type: "number", required: false }, dueString: { type: "string", required: false }, dueDate: { type: "string", required: false }, labels: { type: "object", required: false }, assigneeId: { type: "string", required: false } },
142
+ },
143
+ });
144
+ rl.registerAction("task.update", {
145
+ description: "Update a task",
146
+ inputSchema: {
147
+ id: { type: "string", required: true },
148
+ content: { type: "string", required: false },
149
+ description: { type: "string", required: false },
150
+ priority: { type: "number", required: false },
151
+ dueString: { type: "string", required: false },
152
+ dueDate: { type: "string", required: false },
153
+ labels: { type: "object", required: false },
154
+ assigneeId: { type: "string", required: false },
155
+ },
91
156
  async execute(input, ctx) {
92
157
  const { id, ...fields } = input;
93
158
  const body = {};
@@ -106,15 +171,43 @@ export default function todoist(rl) {
106
171
  if (fields.assigneeId)
107
172
  body.assignee_id = fields.assigneeId;
108
173
  return api(t(ctx), "POST", `/tasks/${id}`, body);
109
- } });
110
- rl.registerAction("task.close", { description: "Close (complete) a task", inputSchema: { id: { type: "string", required: true } },
111
- async execute(input, ctx) { await api(t(ctx), "POST", `/tasks/${input.id}/close`); return { success: true }; } });
112
- rl.registerAction("task.reopen", { description: "Reopen a task", inputSchema: { id: { type: "string", required: true } },
113
- async execute(input, ctx) { await api(t(ctx), "POST", `/tasks/${input.id}/reopen`); return { success: true }; } });
114
- rl.registerAction("task.delete", { description: "Delete a task", inputSchema: { id: { type: "string", required: true } },
115
- async execute(input, ctx) { await api(t(ctx), "DELETE", `/tasks/${input.id}`); return { success: true }; } });
116
- rl.registerAction("task.quickAdd", { description: "Quick add a task using natural language",
117
- inputSchema: { text: { type: "string", required: true, description: 'e.g. "Buy milk @Grocery #shopping tomorrow"' }, note: { type: "string", required: false }, reminder: { type: "string", required: false } },
174
+ },
175
+ });
176
+ rl.registerAction("task.close", {
177
+ description: "Close (complete) a task",
178
+ inputSchema: { id: { type: "string", required: true } },
179
+ async execute(input, ctx) {
180
+ await api(t(ctx), "POST", `/tasks/${input.id}/close`);
181
+ return { success: true };
182
+ },
183
+ });
184
+ rl.registerAction("task.reopen", {
185
+ description: "Reopen a task",
186
+ inputSchema: { id: { type: "string", required: true } },
187
+ async execute(input, ctx) {
188
+ await api(t(ctx), "POST", `/tasks/${input.id}/reopen`);
189
+ return { success: true };
190
+ },
191
+ });
192
+ rl.registerAction("task.delete", {
193
+ description: "Delete a task",
194
+ inputSchema: { id: { type: "string", required: true } },
195
+ async execute(input, ctx) {
196
+ await api(t(ctx), "DELETE", `/tasks/${input.id}`);
197
+ return { success: true };
198
+ },
199
+ });
200
+ rl.registerAction("task.quickAdd", {
201
+ description: "Quick add a task using natural language",
202
+ inputSchema: {
203
+ text: {
204
+ type: "string",
205
+ required: true,
206
+ description: 'e.g. "Buy milk @Grocery #shopping tomorrow"',
207
+ },
208
+ note: { type: "string", required: false },
209
+ reminder: { type: "string", required: false },
210
+ },
118
211
  async execute(input, ctx) {
119
212
  const p = input;
120
213
  const body = { text: p.text };
@@ -123,10 +216,22 @@ export default function todoist(rl) {
123
216
  if (p.reminder)
124
217
  body.reminder = p.reminder;
125
218
  return quickAdd(t(ctx), body);
126
- } });
219
+ },
220
+ });
127
221
  // ── Project ─────────────────────────────────────────
128
- rl.registerAction("project.create", { description: "Create a project",
129
- inputSchema: { name: { type: "string", required: true }, color: { type: "string", required: false }, isFavorite: { type: "boolean", required: false }, parentId: { type: "string", required: false }, viewStyle: { type: "string", required: false, description: "list or board" } },
222
+ rl.registerAction("project.create", {
223
+ description: "Create a project",
224
+ inputSchema: {
225
+ name: { type: "string", required: true },
226
+ color: { type: "string", required: false },
227
+ isFavorite: { type: "boolean", required: false },
228
+ parentId: { type: "string", required: false },
229
+ viewStyle: {
230
+ type: "string",
231
+ required: false,
232
+ description: "list or board",
233
+ },
234
+ },
130
235
  async execute(input, ctx) {
131
236
  const p = input;
132
237
  const body = { name: p.name };
@@ -139,13 +244,31 @@ export default function todoist(rl) {
139
244
  if (p.viewStyle)
140
245
  body.view_style = p.viewStyle;
141
246
  return api(t(ctx), "POST", "/projects", body);
142
- } });
143
- rl.registerAction("project.get", { description: "Get a project", inputSchema: { id: { type: "string", required: true } },
144
- async execute(input, ctx) { return api(t(ctx), "GET", `/projects/${input.id}`); } });
145
- rl.registerAction("project.list", { description: "List all projects", inputSchema: {},
146
- async execute(_input, ctx) { return api(t(ctx), "GET", "/projects"); } });
147
- rl.registerAction("project.update", { description: "Update a project",
148
- inputSchema: { id: { type: "string", required: true }, name: { type: "string", required: false }, color: { type: "string", required: false }, isFavorite: { type: "boolean", required: false }, viewStyle: { type: "string", required: false } },
247
+ },
248
+ });
249
+ rl.registerAction("project.get", {
250
+ description: "Get a project",
251
+ inputSchema: { id: { type: "string", required: true } },
252
+ async execute(input, ctx) {
253
+ return api(t(ctx), "GET", `/projects/${input.id}`);
254
+ },
255
+ });
256
+ rl.registerAction("project.list", {
257
+ description: "List all projects",
258
+ inputSchema: {},
259
+ async execute(_input, ctx) {
260
+ return api(t(ctx), "GET", "/projects");
261
+ },
262
+ });
263
+ rl.registerAction("project.update", {
264
+ description: "Update a project",
265
+ inputSchema: {
266
+ id: { type: "string", required: true },
267
+ name: { type: "string", required: false },
268
+ color: { type: "string", required: false },
269
+ isFavorite: { type: "boolean", required: false },
270
+ viewStyle: { type: "string", required: false },
271
+ },
149
272
  async execute(input, ctx) {
150
273
  const { id, ...fields } = input;
151
274
  const body = {};
@@ -158,41 +281,120 @@ export default function todoist(rl) {
158
281
  if (fields.viewStyle)
159
282
  body.view_style = fields.viewStyle;
160
283
  return api(t(ctx), "POST", `/projects/${id}`, body);
161
- } });
162
- rl.registerAction("project.delete", { description: "Delete a project", inputSchema: { id: { type: "string", required: true } },
163
- async execute(input, ctx) { await api(t(ctx), "DELETE", `/projects/${input.id}`); return { success: true }; } });
164
- rl.registerAction("project.archive", { description: "Archive a project", inputSchema: { id: { type: "string", required: true } },
165
- async execute(input, ctx) { await api(t(ctx), "POST", `/projects/${input.id}/archive`); return { success: true }; } });
166
- rl.registerAction("project.unarchive", { description: "Unarchive a project", inputSchema: { id: { type: "string", required: true } },
167
- async execute(input, ctx) { await api(t(ctx), "POST", `/projects/${input.id}/unarchive`); return { success: true }; } });
168
- rl.registerAction("project.getCollaborators", { description: "Get project collaborators", inputSchema: { id: { type: "string", required: true } },
169
- async execute(input, ctx) { return api(t(ctx), "GET", `/projects/${input.id}/collaborators`); } });
284
+ },
285
+ });
286
+ rl.registerAction("project.delete", {
287
+ description: "Delete a project",
288
+ inputSchema: { id: { type: "string", required: true } },
289
+ async execute(input, ctx) {
290
+ await api(t(ctx), "DELETE", `/projects/${input.id}`);
291
+ return { success: true };
292
+ },
293
+ });
294
+ rl.registerAction("project.archive", {
295
+ description: "Archive a project",
296
+ inputSchema: { id: { type: "string", required: true } },
297
+ async execute(input, ctx) {
298
+ await api(t(ctx), "POST", `/projects/${input.id}/archive`);
299
+ return { success: true };
300
+ },
301
+ });
302
+ rl.registerAction("project.unarchive", {
303
+ description: "Unarchive a project",
304
+ inputSchema: { id: { type: "string", required: true } },
305
+ async execute(input, ctx) {
306
+ await api(t(ctx), "POST", `/projects/${input.id}/unarchive`);
307
+ return { success: true };
308
+ },
309
+ });
310
+ rl.registerAction("project.getCollaborators", {
311
+ description: "Get project collaborators",
312
+ inputSchema: { id: { type: "string", required: true } },
313
+ async execute(input, ctx) {
314
+ return api(t(ctx), "GET", `/projects/${input.id}/collaborators`);
315
+ },
316
+ });
170
317
  // ── Section ─────────────────────────────────────────
171
- rl.registerAction("section.create", { description: "Create a section",
172
- inputSchema: { projectId: { type: "string", required: true }, name: { type: "string", required: true }, order: { type: "number", required: false } },
173
- async execute(input, ctx) { const p = input; return api(t(ctx), "POST", "/sections", { project_id: p.projectId, name: p.name, ...(p.order ? { order: p.order } : {}) }); } });
174
- rl.registerAction("section.get", { description: "Get a section", inputSchema: { id: { type: "string", required: true } },
175
- async execute(input, ctx) { return api(t(ctx), "GET", `/sections/${input.id}`); } });
176
- rl.registerAction("section.list", { description: "List sections",
318
+ rl.registerAction("section.create", {
319
+ description: "Create a section",
320
+ inputSchema: {
321
+ projectId: { type: "string", required: true },
322
+ name: { type: "string", required: true },
323
+ order: { type: "number", required: false },
324
+ },
325
+ async execute(input, ctx) {
326
+ const p = input;
327
+ return api(t(ctx), "POST", "/sections", {
328
+ project_id: p.projectId,
329
+ name: p.name,
330
+ ...(p.order ? { order: p.order } : {}),
331
+ });
332
+ },
333
+ });
334
+ rl.registerAction("section.get", {
335
+ description: "Get a section",
336
+ inputSchema: { id: { type: "string", required: true } },
337
+ async execute(input, ctx) {
338
+ return api(t(ctx), "GET", `/sections/${input.id}`);
339
+ },
340
+ });
341
+ rl.registerAction("section.list", {
342
+ description: "List sections",
177
343
  inputSchema: { projectId: { type: "string", required: false } },
178
344
  async execute(input, ctx) {
179
345
  const qs = {};
180
346
  if (input?.projectId)
181
347
  qs.project_id = input.projectId;
182
348
  return api(t(ctx), "GET", "/sections", undefined, qs);
183
- } });
184
- rl.registerAction("section.update", { description: "Update a section", inputSchema: { id: { type: "string", required: true }, name: { type: "string", required: true } },
185
- async execute(input, ctx) { const p = input; return api(t(ctx), "POST", `/sections/${p.id}`, { name: p.name }); } });
186
- rl.registerAction("section.delete", { description: "Delete a section", inputSchema: { id: { type: "string", required: true } },
187
- async execute(input, ctx) { await api(t(ctx), "DELETE", `/sections/${input.id}`); return { success: true }; } });
349
+ },
350
+ });
351
+ rl.registerAction("section.update", {
352
+ description: "Update a section",
353
+ inputSchema: {
354
+ id: { type: "string", required: true },
355
+ name: { type: "string", required: true },
356
+ },
357
+ async execute(input, ctx) {
358
+ const p = input;
359
+ return api(t(ctx), "POST", `/sections/${p.id}`, { name: p.name });
360
+ },
361
+ });
362
+ rl.registerAction("section.delete", {
363
+ description: "Delete a section",
364
+ inputSchema: { id: { type: "string", required: true } },
365
+ async execute(input, ctx) {
366
+ await api(t(ctx), "DELETE", `/sections/${input.id}`);
367
+ return { success: true };
368
+ },
369
+ });
188
370
  // ── Comment ─────────────────────────────────────────
189
- rl.registerAction("comment.create", { description: "Create a comment on a task",
190
- inputSchema: { taskId: { type: "string", required: true }, content: { type: "string", required: true } },
191
- async execute(input, ctx) { const p = input; return api(t(ctx), "POST", "/comments", { task_id: p.taskId, content: p.content }); } });
192
- rl.registerAction("comment.get", { description: "Get a comment", inputSchema: { id: { type: "string", required: true } },
193
- async execute(input, ctx) { return api(t(ctx), "GET", `/comments/${input.id}`); } });
194
- rl.registerAction("comment.list", { description: "List comments",
195
- inputSchema: { taskId: { type: "string", required: false }, projectId: { type: "string", required: false } },
371
+ rl.registerAction("comment.create", {
372
+ description: "Create a comment on a task",
373
+ inputSchema: {
374
+ taskId: { type: "string", required: true },
375
+ content: { type: "string", required: true },
376
+ },
377
+ async execute(input, ctx) {
378
+ const p = input;
379
+ return api(t(ctx), "POST", "/comments", {
380
+ task_id: p.taskId,
381
+ content: p.content,
382
+ });
383
+ },
384
+ });
385
+ rl.registerAction("comment.get", {
386
+ description: "Get a comment",
387
+ inputSchema: { id: { type: "string", required: true } },
388
+ async execute(input, ctx) {
389
+ return api(t(ctx), "GET", `/comments/${input.id}`);
390
+ },
391
+ });
392
+ rl.registerAction("comment.list", {
393
+ description: "List comments",
394
+ inputSchema: {
395
+ taskId: { type: "string", required: false },
396
+ projectId: { type: "string", required: false },
397
+ },
196
398
  async execute(input, ctx) {
197
399
  const p = (input ?? {});
198
400
  const qs = {};
@@ -201,14 +403,36 @@ export default function todoist(rl) {
201
403
  if (p.projectId)
202
404
  qs.project_id = p.projectId;
203
405
  return api(t(ctx), "GET", "/comments", undefined, qs);
204
- } });
205
- rl.registerAction("comment.update", { description: "Update a comment", inputSchema: { id: { type: "string", required: true }, content: { type: "string", required: true } },
206
- async execute(input, ctx) { const p = input; return api(t(ctx), "POST", `/comments/${p.id}`, { content: p.content }); } });
207
- rl.registerAction("comment.delete", { description: "Delete a comment", inputSchema: { id: { type: "string", required: true } },
208
- async execute(input, ctx) { await api(t(ctx), "DELETE", `/comments/${input.id}`); return { success: true }; } });
406
+ },
407
+ });
408
+ rl.registerAction("comment.update", {
409
+ description: "Update a comment",
410
+ inputSchema: {
411
+ id: { type: "string", required: true },
412
+ content: { type: "string", required: true },
413
+ },
414
+ async execute(input, ctx) {
415
+ const p = input;
416
+ return api(t(ctx), "POST", `/comments/${p.id}`, { content: p.content });
417
+ },
418
+ });
419
+ rl.registerAction("comment.delete", {
420
+ description: "Delete a comment",
421
+ inputSchema: { id: { type: "string", required: true } },
422
+ async execute(input, ctx) {
423
+ await api(t(ctx), "DELETE", `/comments/${input.id}`);
424
+ return { success: true };
425
+ },
426
+ });
209
427
  // ── Label ───────────────────────────────────────────
210
- rl.registerAction("label.create", { description: "Create a label",
211
- inputSchema: { name: { type: "string", required: true }, color: { type: "string", required: false }, order: { type: "number", required: false }, isFavorite: { type: "boolean", required: false } },
428
+ rl.registerAction("label.create", {
429
+ description: "Create a label",
430
+ inputSchema: {
431
+ name: { type: "string", required: true },
432
+ color: { type: "string", required: false },
433
+ order: { type: "number", required: false },
434
+ isFavorite: { type: "boolean", required: false },
435
+ },
212
436
  async execute(input, ctx) {
213
437
  const p = input;
214
438
  const body = { name: p.name };
@@ -219,13 +443,31 @@ export default function todoist(rl) {
219
443
  if (p.isFavorite)
220
444
  body.is_favorite = true;
221
445
  return api(t(ctx), "POST", "/labels", body);
222
- } });
223
- rl.registerAction("label.get", { description: "Get a label", inputSchema: { id: { type: "string", required: true } },
224
- async execute(input, ctx) { return api(t(ctx), "GET", `/labels/${input.id}`); } });
225
- rl.registerAction("label.list", { description: "List all labels", inputSchema: {},
226
- async execute(_input, ctx) { return api(t(ctx), "GET", "/labels"); } });
227
- rl.registerAction("label.update", { description: "Update a label",
228
- inputSchema: { id: { type: "string", required: true }, name: { type: "string", required: false }, color: { type: "string", required: false }, order: { type: "number", required: false }, isFavorite: { type: "boolean", required: false } },
446
+ },
447
+ });
448
+ rl.registerAction("label.get", {
449
+ description: "Get a label",
450
+ inputSchema: { id: { type: "string", required: true } },
451
+ async execute(input, ctx) {
452
+ return api(t(ctx), "GET", `/labels/${input.id}`);
453
+ },
454
+ });
455
+ rl.registerAction("label.list", {
456
+ description: "List all labels",
457
+ inputSchema: {},
458
+ async execute(_input, ctx) {
459
+ return api(t(ctx), "GET", "/labels");
460
+ },
461
+ });
462
+ rl.registerAction("label.update", {
463
+ description: "Update a label",
464
+ inputSchema: {
465
+ id: { type: "string", required: true },
466
+ name: { type: "string", required: false },
467
+ color: { type: "string", required: false },
468
+ order: { type: "number", required: false },
469
+ isFavorite: { type: "boolean", required: false },
470
+ },
229
471
  async execute(input, ctx) {
230
472
  const { id, ...fields } = input;
231
473
  const body = {};
@@ -238,7 +480,14 @@ export default function todoist(rl) {
238
480
  if (fields.isFavorite !== undefined)
239
481
  body.is_favorite = fields.isFavorite;
240
482
  return api(t(ctx), "POST", `/labels/${id}`, body);
241
- } });
242
- rl.registerAction("label.delete", { description: "Delete a label", inputSchema: { id: { type: "string", required: true } },
243
- async execute(input, ctx) { await api(t(ctx), "DELETE", `/labels/${input.id}`); return { success: true }; } });
483
+ },
484
+ });
485
+ rl.registerAction("label.delete", {
486
+ description: "Delete a label",
487
+ inputSchema: { id: { type: "string", required: true } },
488
+ async execute(input, ctx) {
489
+ await api(t(ctx), "DELETE", `/labels/${input.id}`);
490
+ return { success: true };
491
+ },
492
+ });
244
493
  }
@@ -9,7 +9,12 @@ async function apiRequest(token, method, endpoint, body, qs) {
9
9
  }
10
10
  const init = {
11
11
  method,
12
- headers: { Authorization: `token ${token}`, "Travis-API-Version": "3", Accept: "application/json", "Content-Type": "application/json" },
12
+ headers: {
13
+ Authorization: `token ${token}`,
14
+ "Travis-API-Version": "3",
15
+ Accept: "application/json",
16
+ "Content-Type": "application/json",
17
+ },
13
18
  };
14
19
  if (body !== undefined)
15
20
  init.body = typeof body === "string" ? body : JSON.stringify(body);
@@ -21,16 +26,28 @@ async function apiRequest(token, method, endpoint, body, qs) {
21
26
  export default function travisci(rl) {
22
27
  rl.setName("travisci");
23
28
  rl.setVersion("0.1.0");
24
- rl.setConnectionSchema({ apiToken: { type: "string", required: true, description: "Travis CI API token", env: "TRAVISCI_API_TOKEN" } });
29
+ rl.setConnectionSchema({
30
+ apiToken: {
31
+ type: "string",
32
+ required: true,
33
+ description: "Travis CI API token",
34
+ env: "TRAVISCI_API_TOKEN",
35
+ },
36
+ });
25
37
  const key = (ctx) => ctx.connection.config.apiToken;
26
38
  rl.registerAction("build.get", {
27
39
  description: "Get a build by ID",
28
40
  inputSchema: { buildId: { type: "string", required: true } },
29
- async execute(input, ctx) { return apiRequest(key(ctx), "GET", `/build/${input.buildId}`); },
41
+ async execute(input, ctx) {
42
+ return apiRequest(key(ctx), "GET", `/build/${input.buildId}`);
43
+ },
30
44
  });
31
45
  rl.registerAction("build.list", {
32
46
  description: "List builds for the current user",
33
- inputSchema: { limit: { type: "number", required: false }, sortBy: { type: "string", required: false } },
47
+ inputSchema: {
48
+ limit: { type: "number", required: false },
49
+ sortBy: { type: "string", required: false },
50
+ },
34
51
  async execute(input, ctx) {
35
52
  const p = (input ?? {});
36
53
  const qs = {};
@@ -45,17 +62,25 @@ export default function travisci(rl) {
45
62
  rl.registerAction("build.cancel", {
46
63
  description: "Cancel a build",
47
64
  inputSchema: { buildId: { type: "string", required: true } },
48
- async execute(input, ctx) { return apiRequest(key(ctx), "POST", `/build/${input.buildId}/cancel`); },
65
+ async execute(input, ctx) {
66
+ return apiRequest(key(ctx), "POST", `/build/${input.buildId}/cancel`);
67
+ },
49
68
  });
50
69
  rl.registerAction("build.restart", {
51
70
  description: "Restart a build",
52
71
  inputSchema: { buildId: { type: "string", required: true } },
53
- async execute(input, ctx) { return apiRequest(key(ctx), "POST", `/build/${input.buildId}/restart`); },
72
+ async execute(input, ctx) {
73
+ return apiRequest(key(ctx), "POST", `/build/${input.buildId}/restart`);
74
+ },
54
75
  });
55
76
  rl.registerAction("build.trigger", {
56
77
  description: "Trigger a build for a repository",
57
78
  inputSchema: {
58
- slug: { type: "string", required: true, description: "Repository slug (owner/name)" },
79
+ slug: {
80
+ type: "string",
81
+ required: true,
82
+ description: "Repository slug (owner/name)",
83
+ },
59
84
  branch: { type: "string", required: true },
60
85
  message: { type: "string", required: false },
61
86
  },
@@ -65,7 +90,9 @@ export default function travisci(rl) {
65
90
  const request = { branch: p.branch };
66
91
  if (p.message)
67
92
  request.message = p.message;
68
- return apiRequest(key(ctx), "POST", `/repo/${slug}/requests`, { request });
93
+ return apiRequest(key(ctx), "POST", `/repo/${slug}/requests`, {
94
+ request,
95
+ });
69
96
  },
70
97
  });
71
98
  }