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
@@ -1,7 +1,11 @@
1
1
  async function gql(token, query, variables = {}) {
2
2
  const res = await fetch("https://api.monday.com/v2/", {
3
3
  method: "POST",
4
- headers: { Authorization: token, "API-Version": "2023-10", "Content-Type": "application/json" },
4
+ headers: {
5
+ Authorization: token,
6
+ "API-Version": "2023-10",
7
+ "Content-Type": "application/json",
8
+ },
5
9
  body: JSON.stringify({ query, variables }),
6
10
  });
7
11
  if (!res.ok)
@@ -15,7 +19,12 @@ export default function monday(rl) {
15
19
  rl.setName("monday");
16
20
  rl.setVersion("0.1.0");
17
21
  rl.setConnectionSchema({
18
- apiToken: { type: "string", required: true, description: "Monday.com API token (v2)", env: "MONDAY_API_TOKEN" },
22
+ apiToken: {
23
+ type: "string",
24
+ required: true,
25
+ description: "Monday.com API token (v2)",
26
+ env: "MONDAY_API_TOKEN",
27
+ },
19
28
  });
20
29
  const tok = (ctx) => ctx.connection.config.apiToken;
21
30
  // ── Board ───────────────────────────────────────────
@@ -23,7 +32,11 @@ export default function monday(rl) {
23
32
  description: "Create a board",
24
33
  inputSchema: {
25
34
  name: { type: "string", required: true },
26
- kind: { type: "string", required: true, description: "public, private, or share" },
35
+ kind: {
36
+ type: "string",
37
+ required: true,
38
+ description: "public, private, or share",
39
+ },
27
40
  templateId: { type: "number", required: false },
28
41
  },
29
42
  async execute(input, ctx) {
@@ -66,8 +79,16 @@ export default function monday(rl) {
66
79
  inputSchema: {
67
80
  boardId: { type: "string", required: true },
68
81
  title: { type: "string", required: true },
69
- columnType: { type: "string", required: true, description: "Column type (status, text, numbers, date, etc.) in snake_case" },
70
- defaults: { type: "string", required: false, description: "Default values as JSON string" },
82
+ columnType: {
83
+ type: "string",
84
+ required: true,
85
+ description: "Column type (status, text, numbers, date, etc.) in snake_case",
86
+ },
87
+ defaults: {
88
+ type: "string",
89
+ required: false,
90
+ description: "Default values as JSON string",
91
+ },
71
92
  },
72
93
  async execute(input, ctx) {
73
94
  const { boardId, title, columnType, defaults } = input;
@@ -89,7 +110,10 @@ export default function monday(rl) {
89
110
  // ── Board Group ─────────────────────────────────────
90
111
  rl.registerAction("boardGroup.create", {
91
112
  description: "Create a group on a board",
92
- inputSchema: { boardId: { type: "string", required: true }, name: { type: "string", required: true } },
113
+ inputSchema: {
114
+ boardId: { type: "string", required: true },
115
+ name: { type: "string", required: true },
116
+ },
93
117
  async execute(input, ctx) {
94
118
  const { boardId, name } = input;
95
119
  const data = await gql(tok(ctx), `mutation ($boardId: ID!, $groupName: String!) { create_group (board_id: $boardId, group_name: $groupName) { id } }`, { boardId, groupName: name });
@@ -98,7 +122,10 @@ export default function monday(rl) {
98
122
  });
99
123
  rl.registerAction("boardGroup.delete", {
100
124
  description: "Delete a group from a board",
101
- inputSchema: { boardId: { type: "string", required: true }, groupId: { type: "string", required: true } },
125
+ inputSchema: {
126
+ boardId: { type: "string", required: true },
127
+ groupId: { type: "string", required: true },
128
+ },
102
129
  async execute(input, ctx) {
103
130
  const { boardId, groupId } = input;
104
131
  const data = await gql(tok(ctx), `mutation ($boardId: ID!, $groupId: String!) { delete_group (board_id: $boardId, group_id: $groupId) { id } }`, { boardId, groupId });
@@ -120,11 +147,19 @@ export default function monday(rl) {
120
147
  boardId: { type: "string", required: true },
121
148
  groupId: { type: "string", required: true },
122
149
  name: { type: "string", required: true, description: "Item name" },
123
- columnValues: { type: "string", required: false, description: "Column values as JSON string" },
150
+ columnValues: {
151
+ type: "string",
152
+ required: false,
153
+ description: "Column values as JSON string",
154
+ },
124
155
  },
125
156
  async execute(input, ctx) {
126
157
  const { boardId, groupId, name, columnValues } = input;
127
- const vars = { boardId, groupId, itemName: name };
158
+ const vars = {
159
+ boardId,
160
+ groupId,
161
+ itemName: name,
162
+ };
128
163
  if (columnValues)
129
164
  vars.columnValues = JSON.stringify(JSON.parse(columnValues));
130
165
  const data = await gql(tok(ctx), `mutation ($boardId: ID!, $groupId: String!, $itemName: String!, $columnValues: JSON) { create_item (board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) { id } }`, vars);
@@ -133,9 +168,17 @@ export default function monday(rl) {
133
168
  });
134
169
  rl.registerAction("boardItem.get", {
135
170
  description: "Get item(s) by ID",
136
- inputSchema: { itemIds: { type: "string", required: true, description: "Comma-separated item IDs" } },
171
+ inputSchema: {
172
+ itemIds: {
173
+ type: "string",
174
+ required: true,
175
+ description: "Comma-separated item IDs",
176
+ },
177
+ },
137
178
  async execute(input, ctx) {
138
- const ids = input.itemIds.split(",").map((s) => s.trim());
179
+ const ids = input.itemIds
180
+ .split(",")
181
+ .map((s) => s.trim());
139
182
  const data = await gql(tok(ctx), `query ($itemId: [ID!]) { items (ids: $itemId) { id name created_at state column_values { id text type value column { title archived description settings_str } } } }`, { itemId: ids });
140
183
  return data.items;
141
184
  },
@@ -148,13 +191,16 @@ export default function monday(rl) {
148
191
  limit: { type: "number", required: false },
149
192
  },
150
193
  async execute(input, ctx) {
151
- const { boardId, groupId, limit = 100 } = input;
194
+ const { boardId, groupId, limit = 100, } = input;
152
195
  const data = await gql(tok(ctx), `query ($boardId: [ID!], $groupId: [String], $limit: Int) { boards(ids: $boardId) { groups(ids: $groupId) { id items_page(limit: $limit) { cursor items { id name created_at state column_values { id text type value column { title archived description settings_str } } } } } } }`, { boardId, groupId, limit });
153
196
  return data.boards?.[0]
154
197
  ? data.boards[0].groups?.[0]
155
- ? data.boards[0].groups[0]
156
- ? data.boards[0].groups[0].items_page
157
- ? data.boards[0].groups[0].items_page
198
+ ? data.boards[0]
199
+ .groups[0]
200
+ ? data.boards[0]
201
+ .groups[0].items_page
202
+ ? data.boards[0]
203
+ .groups[0].items_page
158
204
  : []
159
205
  : []
160
206
  : []
@@ -171,7 +217,10 @@ export default function monday(rl) {
171
217
  });
172
218
  rl.registerAction("boardItem.move", {
173
219
  description: "Move an item to a different group",
174
- inputSchema: { itemId: { type: "string", required: true }, groupId: { type: "string", required: true } },
220
+ inputSchema: {
221
+ itemId: { type: "string", required: true },
222
+ groupId: { type: "string", required: true },
223
+ },
175
224
  async execute(input, ctx) {
176
225
  const { itemId, groupId } = input;
177
226
  const data = await gql(tok(ctx), `mutation ($groupId: String!, $itemId: ID!) { move_item_to_group (group_id: $groupId, item_id: $itemId) { id } }`, { groupId, itemId });
@@ -180,7 +229,14 @@ export default function monday(rl) {
180
229
  });
181
230
  rl.registerAction("boardItem.addUpdate", {
182
231
  description: "Add an update (comment) to an item",
183
- inputSchema: { itemId: { type: "string", required: true }, value: { type: "string", required: true, description: "Update body text" } },
232
+ inputSchema: {
233
+ itemId: { type: "string", required: true },
234
+ value: {
235
+ type: "string",
236
+ required: true,
237
+ description: "Update body text",
238
+ },
239
+ },
184
240
  async execute(input, ctx) {
185
241
  const { itemId, value } = input;
186
242
  const data = await gql(tok(ctx), `mutation ($itemId: ID!, $value: String!) { create_update (item_id: $itemId, body: $value) { id } }`, { itemId, value });
@@ -193,11 +249,20 @@ export default function monday(rl) {
193
249
  boardId: { type: "string", required: true },
194
250
  itemId: { type: "string", required: true },
195
251
  columnId: { type: "string", required: true },
196
- value: { type: "string", required: true, description: "Column value as JSON string" },
252
+ value: {
253
+ type: "string",
254
+ required: true,
255
+ description: "Column value as JSON string",
256
+ },
197
257
  },
198
258
  async execute(input, ctx) {
199
259
  const { boardId, itemId, columnId, value } = input;
200
- const data = await gql(tok(ctx), `mutation ($boardId: ID!, $itemId: ID!, $columnId: String!, $value: JSON!) { change_column_value (board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) { id } }`, { boardId, itemId, columnId, value: JSON.stringify(JSON.parse(value)) });
260
+ const data = await gql(tok(ctx), `mutation ($boardId: ID!, $itemId: ID!, $columnId: String!, $value: JSON!) { change_column_value (board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) { id } }`, {
261
+ boardId,
262
+ itemId,
263
+ columnId,
264
+ value: JSON.stringify(JSON.parse(value)),
265
+ });
201
266
  return data.change_column_value;
202
267
  },
203
268
  });
@@ -206,11 +271,19 @@ export default function monday(rl) {
206
271
  inputSchema: {
207
272
  boardId: { type: "string", required: true },
208
273
  itemId: { type: "string", required: true },
209
- columnValues: { type: "string", required: true, description: "Column values as JSON string" },
274
+ columnValues: {
275
+ type: "string",
276
+ required: true,
277
+ description: "Column values as JSON string",
278
+ },
210
279
  },
211
280
  async execute(input, ctx) {
212
281
  const { boardId, itemId, columnValues } = input;
213
- const data = await gql(tok(ctx), `mutation ($boardId: ID!, $itemId: ID!, $columnValues: JSON!) { change_multiple_column_values (board_id: $boardId, item_id: $itemId, column_values: $columnValues) { id } }`, { boardId, itemId, columnValues: JSON.stringify(JSON.parse(columnValues)) });
282
+ const data = await gql(tok(ctx), `mutation ($boardId: ID!, $itemId: ID!, $columnValues: JSON!) { change_multiple_column_values (board_id: $boardId, item_id: $itemId, column_values: $columnValues) { id } }`, {
283
+ boardId,
284
+ itemId,
285
+ columnValues: JSON.stringify(JSON.parse(columnValues)),
286
+ });
214
287
  return data.change_multiple_column_values;
215
288
  },
216
289
  });
@@ -223,9 +296,10 @@ export default function monday(rl) {
223
296
  limit: { type: "number", required: false },
224
297
  },
225
298
  async execute(input, ctx) {
226
- const { boardId, columnId, columnValue, limit = 100 } = input;
299
+ const { boardId, columnId, columnValue, limit = 100, } = input;
227
300
  const data = await gql(tok(ctx), `query ($boardId: ID!, $columnId: String!, $columnValue: String!, $limit: Int) { items_page_by_column_values (limit: $limit, board_id: $boardId, columns: [{column_id: $columnId, column_values: [$columnValue]}]) { cursor items { id name created_at state board { id } column_values { id text type value column { title archived description settings_str } } } } }`, { boardId, columnId, columnValue, limit });
228
- return data.items_page_by_column_values?.items;
301
+ return data.items_page_by_column_values
302
+ ?.items;
229
303
  },
230
304
  });
231
305
  }
@@ -11,7 +11,13 @@ async function api(conn, method, endpoint, body, qs) {
11
11
  url.searchParams.set(k, String(v));
12
12
  }
13
13
  }
14
- const init = { method, headers: { Authorization: `Bearer ${conn.token}`, "Content-Type": "application/json" } };
14
+ const init = {
15
+ method,
16
+ headers: {
17
+ Authorization: `Bearer ${conn.token}`,
18
+ "Content-Type": "application/json",
19
+ },
20
+ };
15
21
  if (body && Object.keys(body).length > 0)
16
22
  init.body = JSON.stringify(body);
17
23
  const res = await fetch(url.toString(), init);
@@ -22,31 +28,114 @@ async function api(conn, method, endpoint, body, qs) {
22
28
  return res.json();
23
29
  }
24
30
  function registerCrud(rl, resource, plural, conn, createSchema) {
25
- rl.registerAction(`${resource}.create`, { description: `Create a ${resource}`, inputSchema: createSchema,
26
- async execute(input, ctx) { const data = (await api(conn(ctx), "POST", `/${plural}`, input)); return data.data; } });
27
- rl.registerAction(`${resource}.get`, { description: `Get a ${resource}`, inputSchema: { id: { type: "string", required: true } },
28
- async execute(input, ctx) { const data = (await api(conn(ctx), "GET", `/${plural}/${input.id}`)); return data.data; } });
29
- rl.registerAction(`${resource}.list`, { description: `List ${plural}`, inputSchema: { limit: { type: "number", required: false } },
30
- async execute(input, ctx) { const qs = { limit: (input ?? {}).limit ?? 100 }; const data = (await api(conn(ctx), "GET", `/${plural}`, undefined, qs)); return data.data; } });
31
- rl.registerAction(`${resource}.update`, { description: `Update a ${resource}`, inputSchema: { id: { type: "string", required: true }, data: { type: "object", required: true } },
32
- async execute(input, ctx) { const p = input; const data = (await api(conn(ctx), "PUT", `/${plural}/${p.id}`, p.data)); return data.data; } });
33
- rl.registerAction(`${resource}.delete`, { description: `Delete a ${resource}`, inputSchema: { id: { type: "string", required: true } },
34
- async execute(input, ctx) { await api(conn(ctx), "DELETE", `/${plural}/${input.id}`); return { success: true }; } });
31
+ rl.registerAction(`${resource}.create`, {
32
+ description: `Create a ${resource}`,
33
+ inputSchema: createSchema,
34
+ async execute(input, ctx) {
35
+ const data = (await api(conn(ctx), "POST", `/${plural}`, input));
36
+ return data.data;
37
+ },
38
+ });
39
+ rl.registerAction(`${resource}.get`, {
40
+ description: `Get a ${resource}`,
41
+ inputSchema: { id: { type: "string", required: true } },
42
+ async execute(input, ctx) {
43
+ const data = (await api(conn(ctx), "GET", `/${plural}/${input.id}`));
44
+ return data.data;
45
+ },
46
+ });
47
+ rl.registerAction(`${resource}.list`, {
48
+ description: `List ${plural}`,
49
+ inputSchema: { limit: { type: "number", required: false } },
50
+ async execute(input, ctx) {
51
+ const qs = {
52
+ limit: (input ?? {}).limit ?? 100,
53
+ };
54
+ const data = (await api(conn(ctx), "GET", `/${plural}`, undefined, qs));
55
+ return data.data;
56
+ },
57
+ });
58
+ rl.registerAction(`${resource}.update`, {
59
+ description: `Update a ${resource}`,
60
+ inputSchema: {
61
+ id: { type: "string", required: true },
62
+ data: { type: "object", required: true },
63
+ },
64
+ async execute(input, ctx) {
65
+ const p = input;
66
+ const data = (await api(conn(ctx), "PUT", `/${plural}/${p.id}`, p.data));
67
+ return data.data;
68
+ },
69
+ });
70
+ rl.registerAction(`${resource}.delete`, {
71
+ description: `Delete a ${resource}`,
72
+ inputSchema: { id: { type: "string", required: true } },
73
+ async execute(input, ctx) {
74
+ await api(conn(ctx), "DELETE", `/${plural}/${input.id}`);
75
+ return { success: true };
76
+ },
77
+ });
35
78
  }
36
79
  export default function monicaCrm(rl) {
37
80
  rl.setName("monicaCrm");
38
81
  rl.setVersion("0.1.0");
39
82
  rl.setConnectionSchema({
40
- apiToken: { type: "string", required: true, description: "Monica API token", env: "MONICA_API_TOKEN" },
41
- url: { type: "string", required: false, description: "Monica URL (default: https://app.monicahq.com)", env: "MONICA_URL" },
42
- });
43
- registerCrud(rl, "contact", "contacts", getConn, { first_name: { type: "string", required: true }, last_name: { type: "string", required: false }, gender_id: { type: "number", required: false } });
44
- registerCrud(rl, "activity", "activities", getConn, { summary: { type: "string", required: true }, description: { type: "string", required: false }, activity_type_id: { type: "number", required: false } });
45
- registerCrud(rl, "note", "notes", getConn, { contact_id: { type: "number", required: true }, body: { type: "string", required: true } });
46
- registerCrud(rl, "task", "tasks", getConn, { title: { type: "string", required: true }, contact_id: { type: "number", required: false } });
47
- registerCrud(rl, "tag", "tags", getConn, { name: { type: "string", required: true } });
48
- registerCrud(rl, "journalEntry", "journal", getConn, { title: { type: "string", required: true }, post: { type: "string", required: true } });
49
- registerCrud(rl, "reminder", "reminders", getConn, { contact_id: { type: "number", required: true }, title: { type: "string", required: true }, initial_date: { type: "string", required: true }, frequency_type: { type: "string", required: true, description: "one_time, week, month, year" } });
50
- registerCrud(rl, "call", "calls", getConn, { contact_id: { type: "number", required: true }, content: { type: "string", required: false }, called_at: { type: "string", required: false } });
51
- registerCrud(rl, "conversation", "conversations", getConn, { contact_id: { type: "number", required: true }, contact_field_type_id: { type: "number", required: true }, happened_at: { type: "string", required: true } });
83
+ apiToken: {
84
+ type: "string",
85
+ required: true,
86
+ description: "Monica API token",
87
+ env: "MONICA_API_TOKEN",
88
+ },
89
+ url: {
90
+ type: "string",
91
+ required: false,
92
+ description: "Monica URL (default: https://app.monicahq.com)",
93
+ env: "MONICA_URL",
94
+ },
95
+ });
96
+ registerCrud(rl, "contact", "contacts", getConn, {
97
+ first_name: { type: "string", required: true },
98
+ last_name: { type: "string", required: false },
99
+ gender_id: { type: "number", required: false },
100
+ });
101
+ registerCrud(rl, "activity", "activities", getConn, {
102
+ summary: { type: "string", required: true },
103
+ description: { type: "string", required: false },
104
+ activity_type_id: { type: "number", required: false },
105
+ });
106
+ registerCrud(rl, "note", "notes", getConn, {
107
+ contact_id: { type: "number", required: true },
108
+ body: { type: "string", required: true },
109
+ });
110
+ registerCrud(rl, "task", "tasks", getConn, {
111
+ title: { type: "string", required: true },
112
+ contact_id: { type: "number", required: false },
113
+ });
114
+ registerCrud(rl, "tag", "tags", getConn, {
115
+ name: { type: "string", required: true },
116
+ });
117
+ registerCrud(rl, "journalEntry", "journal", getConn, {
118
+ title: { type: "string", required: true },
119
+ post: { type: "string", required: true },
120
+ });
121
+ registerCrud(rl, "reminder", "reminders", getConn, {
122
+ contact_id: { type: "number", required: true },
123
+ title: { type: "string", required: true },
124
+ initial_date: { type: "string", required: true },
125
+ frequency_type: {
126
+ type: "string",
127
+ required: true,
128
+ description: "one_time, week, month, year",
129
+ },
130
+ });
131
+ registerCrud(rl, "call", "calls", getConn, {
132
+ contact_id: { type: "number", required: true },
133
+ content: { type: "string", required: false },
134
+ called_at: { type: "string", required: false },
135
+ });
136
+ registerCrud(rl, "conversation", "conversations", getConn, {
137
+ contact_id: { type: "number", required: true },
138
+ contact_field_type_id: { type: "number", required: true },
139
+ happened_at: { type: "string", required: true },
140
+ });
52
141
  }
@@ -2,13 +2,22 @@ export default function msg91(rl) {
2
2
  rl.setName("msg91");
3
3
  rl.setVersion("0.1.0");
4
4
  rl.setConnectionSchema({
5
- authkey: { type: "string", required: true, description: "MSG91 auth key", env: "MSG91_AUTHKEY" },
5
+ authkey: {
6
+ type: "string",
7
+ required: true,
8
+ description: "MSG91 auth key",
9
+ env: "MSG91_AUTHKEY",
10
+ },
6
11
  });
7
12
  rl.registerAction("sms.send", {
8
13
  description: "Send a transactional SMS via MSG91",
9
14
  inputSchema: {
10
15
  from: { type: "string", required: true, description: "Sender ID" },
11
- to: { type: "string", required: true, description: "Recipient number with country code" },
16
+ to: {
17
+ type: "string",
18
+ required: true,
19
+ description: "Recipient number with country code",
20
+ },
12
21
  message: { type: "string", required: true },
13
22
  },
14
23
  async execute(input, ctx) {
@@ -23,22 +23,43 @@ export default function nasa(rl) {
23
23
  rl.setName("nasa");
24
24
  rl.setVersion("0.1.0");
25
25
  rl.setConnectionSchema({
26
- apiKey: { type: "string", required: true, description: "NASA API key (get one at https://api.nasa.gov)", env: "NASA_API_KEY" },
26
+ apiKey: {
27
+ type: "string",
28
+ required: true,
29
+ description: "NASA API key (get one at https://api.nasa.gov)",
30
+ env: "NASA_API_KEY",
31
+ },
27
32
  });
28
33
  const key = (ctx) => ctx.connection.config.apiKey;
29
34
  rl.registerAction("apod.get", {
30
35
  description: "Get the Astronomy Picture of the Day (returns metadata; image URL in 'hdurl' field)",
31
- inputSchema: { date: { type: "string", required: false, description: "Date (YYYY-MM-DD), defaults to today" } },
36
+ inputSchema: {
37
+ date: {
38
+ type: "string",
39
+ required: false,
40
+ description: "Date (YYYY-MM-DD), defaults to today",
41
+ },
42
+ },
32
43
  async execute(input, ctx) {
33
- const qs = { date: formatDate(input?.date) ?? today() };
44
+ const qs = {
45
+ date: formatDate(input?.date) ?? today(),
46
+ };
34
47
  return apiRequest(key(ctx), "/planetary/apod", qs);
35
48
  },
36
49
  });
37
50
  rl.registerAction("asteroidNeoFeed.get", {
38
51
  description: "Get a list of asteroids based on closest approach date to Earth",
39
52
  inputSchema: {
40
- startDate: { type: "string", required: false, description: "Start date (YYYY-MM-DD), defaults to today" },
41
- endDate: { type: "string", required: false, description: "End date (YYYY-MM-DD), defaults to today" },
53
+ startDate: {
54
+ type: "string",
55
+ required: false,
56
+ description: "Start date (YYYY-MM-DD), defaults to today",
57
+ },
58
+ endDate: {
59
+ type: "string",
60
+ required: false,
61
+ description: "End date (YYYY-MM-DD), defaults to today",
62
+ },
42
63
  },
43
64
  async execute(input, ctx) {
44
65
  const p = (input ?? {});
@@ -54,7 +75,11 @@ export default function nasa(rl) {
54
75
  description: "Look up an asteroid by its NASA SPK-ID",
55
76
  inputSchema: {
56
77
  asteroidId: { type: "string", required: true },
57
- includeCloseApproachData: { type: "boolean", required: false, description: "Include close approach data (default false)" },
78
+ includeCloseApproachData: {
79
+ type: "boolean",
80
+ required: false,
81
+ description: "Include close approach data (default false)",
82
+ },
58
83
  },
59
84
  async execute(input, ctx) {
60
85
  const { asteroidId, includeCloseApproachData } = input;
@@ -66,7 +91,13 @@ export default function nasa(rl) {
66
91
  });
67
92
  rl.registerAction("asteroidNeoBrowse.list", {
68
93
  description: "Browse the overall asteroid dataset",
69
- inputSchema: { limit: { type: "number", required: false, description: "Max results (default 20)" } },
94
+ inputSchema: {
95
+ limit: {
96
+ type: "number",
97
+ required: false,
98
+ description: "Max results (default 20)",
99
+ },
100
+ },
70
101
  async execute(input, ctx) {
71
102
  const qs = {};
72
103
  if (input?.limit)
@@ -77,21 +108,61 @@ export default function nasa(rl) {
77
108
  });
78
109
  // ── DONKI endpoints ─────────────────────────────────
79
110
  const donkiEndpoints = [
80
- { name: "coronalMassEjection", path: "/DONKI/CME", description: "DONKI Coronal Mass Ejection data" },
81
- { name: "solarFlare", path: "/DONKI/FLR", description: "DONKI Solar Flare data" },
82
- { name: "solarEnergeticParticle", path: "/DONKI/SEP", description: "DONKI Solar Energetic Particle data" },
83
- { name: "magnetopauseCrossing", path: "/DONKI/MPC", description: "DONKI Magnetopause Crossing data" },
84
- { name: "radiationBeltEnhancement", path: "/DONKI/RBE", description: "DONKI Radiation Belt Enhancement data" },
85
- { name: "highSpeedStream", path: "/DONKI/HSS", description: "DONKI High Speed Stream data" },
86
- { name: "wsaEnlilSimulation", path: "/DONKI/WSAEnlilSimulations", description: "DONKI WSA+Enlil Simulation data" },
87
- { name: "notifications", path: "/DONKI/notifications", description: "DONKI Notifications data" },
111
+ {
112
+ name: "coronalMassEjection",
113
+ path: "/DONKI/CME",
114
+ description: "DONKI Coronal Mass Ejection data",
115
+ },
116
+ {
117
+ name: "solarFlare",
118
+ path: "/DONKI/FLR",
119
+ description: "DONKI Solar Flare data",
120
+ },
121
+ {
122
+ name: "solarEnergeticParticle",
123
+ path: "/DONKI/SEP",
124
+ description: "DONKI Solar Energetic Particle data",
125
+ },
126
+ {
127
+ name: "magnetopauseCrossing",
128
+ path: "/DONKI/MPC",
129
+ description: "DONKI Magnetopause Crossing data",
130
+ },
131
+ {
132
+ name: "radiationBeltEnhancement",
133
+ path: "/DONKI/RBE",
134
+ description: "DONKI Radiation Belt Enhancement data",
135
+ },
136
+ {
137
+ name: "highSpeedStream",
138
+ path: "/DONKI/HSS",
139
+ description: "DONKI High Speed Stream data",
140
+ },
141
+ {
142
+ name: "wsaEnlilSimulation",
143
+ path: "/DONKI/WSAEnlilSimulations",
144
+ description: "DONKI WSA+Enlil Simulation data",
145
+ },
146
+ {
147
+ name: "notifications",
148
+ path: "/DONKI/notifications",
149
+ description: "DONKI Notifications data",
150
+ },
88
151
  ];
89
152
  for (const ep of donkiEndpoints) {
90
153
  rl.registerAction(`donki.${ep.name}`, {
91
154
  description: ep.description,
92
155
  inputSchema: {
93
- startDate: { type: "string", required: false, description: "Start date (YYYY-MM-DD), defaults to 30 days ago" },
94
- endDate: { type: "string", required: false, description: "End date (YYYY-MM-DD), defaults to today" },
156
+ startDate: {
157
+ type: "string",
158
+ required: false,
159
+ description: "Start date (YYYY-MM-DD), defaults to 30 days ago",
160
+ },
161
+ endDate: {
162
+ type: "string",
163
+ required: false,
164
+ description: "End date (YYYY-MM-DD), defaults to today",
165
+ },
95
166
  },
96
167
  async execute(input, ctx) {
97
168
  const p = (input ?? {});
@@ -109,8 +180,16 @@ export default function nasa(rl) {
109
180
  inputSchema: {
110
181
  startDate: { type: "string", required: false },
111
182
  endDate: { type: "string", required: false },
112
- location: { type: "string", required: false, description: "ALL (default), earth, MESSENGER, STEREO A, STEREO B" },
113
- catalog: { type: "string", required: false, description: "ALL (default), SWRC_CATALOG, WINSLOW_MESSENGER_ICME_CATALOG" },
183
+ location: {
184
+ type: "string",
185
+ required: false,
186
+ description: "ALL (default), earth, MESSENGER, STEREO A, STEREO B",
187
+ },
188
+ catalog: {
189
+ type: "string",
190
+ required: false,
191
+ description: "ALL (default), SWRC_CATALOG, WINSLOW_MESSENGER_ICME_CATALOG",
192
+ },
114
193
  },
115
194
  async execute(input, ctx) {
116
195
  const p = (input ?? {});
@@ -132,8 +211,16 @@ export default function nasa(rl) {
132
211
  inputSchema: {
133
212
  lat: { type: "number", required: true, description: "Latitude" },
134
213
  lon: { type: "number", required: true, description: "Longitude" },
135
- date: { type: "string", required: false, description: "Date (YYYY-MM-DD)" },
136
- dim: { type: "number", required: false, description: "Width/height in degrees (default 0.025)" },
214
+ date: {
215
+ type: "string",
216
+ required: false,
217
+ description: "Date (YYYY-MM-DD)",
218
+ },
219
+ dim: {
220
+ type: "number",
221
+ required: false,
222
+ description: "Width/height in degrees (default 0.025)",
223
+ },
137
224
  },
138
225
  async execute(input, ctx) {
139
226
  const { lat, lon, date, dim } = input;