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
@@ -12,7 +12,10 @@ async function api(base, apiKey, method, endpoint, body, qs) {
12
12
  url.searchParams.set(k, String(v));
13
13
  }
14
14
  }
15
- const init = { method, headers: { "Content-Type": "application/json" } };
15
+ const init = {
16
+ method,
17
+ headers: { "Content-Type": "application/json" },
18
+ };
16
19
  if (body && Object.keys(body).length > 0)
17
20
  init.body = JSON.stringify(body);
18
21
  const res = await fetch(url.toString(), init);
@@ -27,7 +30,7 @@ async function paginate(base, apiKey, endpoint, key, qs = {}) {
27
30
  let batch;
28
31
  do {
29
32
  qs.page = page;
30
- const res = await api(base, apiKey, "GET", endpoint, undefined, qs);
33
+ const res = (await api(base, apiKey, "GET", endpoint, undefined, qs));
31
34
  batch = (res[key] ?? []);
32
35
  results.push(...batch);
33
36
  page++;
@@ -38,12 +41,34 @@ export default function syncromsp(rl) {
38
41
  rl.setName("syncromsp");
39
42
  rl.setVersion("0.1.0");
40
43
  rl.setConnectionSchema({
41
- subdomain: { type: "string", required: true, description: "SyncroMSP subdomain", env: "SYNCROMSP_SUBDOMAIN" },
42
- apiKey: { type: "string", required: true, description: "API key", env: "SYNCROMSP_API_KEY" },
44
+ subdomain: {
45
+ type: "string",
46
+ required: true,
47
+ description: "SyncroMSP subdomain",
48
+ env: "SYNCROMSP_SUBDOMAIN",
49
+ },
50
+ apiKey: {
51
+ type: "string",
52
+ required: true,
53
+ description: "API key",
54
+ env: "SYNCROMSP_API_KEY",
55
+ },
43
56
  });
44
57
  // ── Customer ────────────────────────────────────────
45
- rl.registerAction("customer.create", { description: "Create a customer",
46
- inputSchema: { email: { type: "string", required: true }, businessName: { type: "string", required: false }, firstName: { type: "string", required: false }, lastname: { type: "string", required: false }, phone: { type: "string", required: false }, notes: { type: "string", required: false }, address: { type: "string", required: false }, city: { type: "string", required: false }, state: { type: "string", required: false }, zip: { type: "string", required: false } },
58
+ rl.registerAction("customer.create", {
59
+ description: "Create a customer",
60
+ inputSchema: {
61
+ email: { type: "string", required: true },
62
+ businessName: { type: "string", required: false },
63
+ firstName: { type: "string", required: false },
64
+ lastname: { type: "string", required: false },
65
+ phone: { type: "string", required: false },
66
+ notes: { type: "string", required: false },
67
+ address: { type: "string", required: false },
68
+ city: { type: "string", required: false },
69
+ state: { type: "string", required: false },
70
+ zip: { type: "string", required: false },
71
+ },
47
72
  async execute(input, ctx) {
48
73
  const { base, apiKey } = getConn(ctx);
49
74
  const p = input;
@@ -66,13 +91,26 @@ export default function syncromsp(rl) {
66
91
  body.state = p.state;
67
92
  if (p.zip)
68
93
  body.zip = p.zip;
69
- const res = await api(base, apiKey, "POST", "customers", body);
94
+ const res = (await api(base, apiKey, "POST", "customers", body));
70
95
  return res.customer ?? res;
71
- } });
72
- rl.registerAction("customer.get", { description: "Get a customer", inputSchema: { id: { type: "string", required: true } },
73
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); const res = await api(base, apiKey, "GET", `customers/${input.id}`); return res.customer ?? res; } });
74
- rl.registerAction("customer.list", { description: "List customers",
75
- inputSchema: { limit: { type: "number", required: false }, businessName: { type: "string", required: false }, includeDisabled: { type: "boolean", required: false } },
96
+ },
97
+ });
98
+ rl.registerAction("customer.get", {
99
+ description: "Get a customer",
100
+ inputSchema: { id: { type: "string", required: true } },
101
+ async execute(input, ctx) {
102
+ const { base, apiKey } = getConn(ctx);
103
+ const res = (await api(base, apiKey, "GET", `customers/${input.id}`));
104
+ return res.customer ?? res;
105
+ },
106
+ });
107
+ rl.registerAction("customer.list", {
108
+ description: "List customers",
109
+ inputSchema: {
110
+ limit: { type: "number", required: false },
111
+ businessName: { type: "string", required: false },
112
+ includeDisabled: { type: "boolean", required: false },
113
+ },
76
114
  async execute(input, ctx) {
77
115
  const { base, apiKey } = getConn(ctx);
78
116
  const p = (input ?? {});
@@ -83,13 +121,23 @@ export default function syncromsp(rl) {
83
121
  qs.include_disabled = true;
84
122
  if (p.limit) {
85
123
  qs.per_page = p.limit;
86
- const res = await api(base, apiKey, "GET", "customers", undefined, qs);
124
+ const res = (await api(base, apiKey, "GET", "customers", undefined, qs));
87
125
  return res.customers ?? res;
88
126
  }
89
127
  return paginate(base, apiKey, "customers", "customers", qs);
90
- } });
91
- rl.registerAction("customer.update", { description: "Update a customer",
92
- inputSchema: { id: { type: "string", required: true }, email: { type: "string", required: false }, businessName: { type: "string", required: false }, firstName: { type: "string", required: false }, lastname: { type: "string", required: false }, phone: { type: "string", required: false }, notes: { type: "string", required: false } },
128
+ },
129
+ });
130
+ rl.registerAction("customer.update", {
131
+ description: "Update a customer",
132
+ inputSchema: {
133
+ id: { type: "string", required: true },
134
+ email: { type: "string", required: false },
135
+ businessName: { type: "string", required: false },
136
+ firstName: { type: "string", required: false },
137
+ lastname: { type: "string", required: false },
138
+ phone: { type: "string", required: false },
139
+ notes: { type: "string", required: false },
140
+ },
93
141
  async execute(input, ctx) {
94
142
  const { base, apiKey } = getConn(ctx);
95
143
  const { id, ...fields } = input;
@@ -106,18 +154,36 @@ export default function syncromsp(rl) {
106
154
  body.phone = fields.phone;
107
155
  if (fields.notes)
108
156
  body.notes = fields.notes;
109
- const res = await api(base, apiKey, "PUT", `customers/${id}`, body);
157
+ const res = (await api(base, apiKey, "PUT", `customers/${id}`, body));
110
158
  return res.customer ?? res;
111
- } });
112
- rl.registerAction("customer.delete", { description: "Delete a customer", inputSchema: { id: { type: "string", required: true } },
113
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); await api(base, apiKey, "DELETE", `customers/${input.id}`); return { success: true }; } });
159
+ },
160
+ });
161
+ rl.registerAction("customer.delete", {
162
+ description: "Delete a customer",
163
+ inputSchema: { id: { type: "string", required: true } },
164
+ async execute(input, ctx) {
165
+ const { base, apiKey } = getConn(ctx);
166
+ await api(base, apiKey, "DELETE", `customers/${input.id}`);
167
+ return { success: true };
168
+ },
169
+ });
114
170
  // ── Contact ─────────────────────────────────────────
115
- rl.registerAction("contact.create", { description: "Create a contact",
116
- inputSchema: { customerId: { type: "string", required: true }, email: { type: "string", required: true }, name: { type: "string", required: false }, phone: { type: "string", required: false }, notes: { type: "string", required: false } },
171
+ rl.registerAction("contact.create", {
172
+ description: "Create a contact",
173
+ inputSchema: {
174
+ customerId: { type: "string", required: true },
175
+ email: { type: "string", required: true },
176
+ name: { type: "string", required: false },
177
+ phone: { type: "string", required: false },
178
+ notes: { type: "string", required: false },
179
+ },
117
180
  async execute(input, ctx) {
118
181
  const { base, apiKey } = getConn(ctx);
119
182
  const p = input;
120
- const body = { customer_id: p.customerId, email: p.email };
183
+ const body = {
184
+ customer_id: p.customerId,
185
+ email: p.email,
186
+ };
121
187
  if (p.name)
122
188
  body.name = p.name;
123
189
  if (p.phone)
@@ -125,22 +191,39 @@ export default function syncromsp(rl) {
125
191
  if (p.notes)
126
192
  body.notes = p.notes;
127
193
  return api(base, apiKey, "POST", "contacts", body);
128
- } });
129
- rl.registerAction("contact.get", { description: "Get a contact", inputSchema: { id: { type: "string", required: true } },
130
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); return api(base, apiKey, "GET", `contacts/${input.id}`); } });
131
- rl.registerAction("contact.list", { description: "List contacts",
194
+ },
195
+ });
196
+ rl.registerAction("contact.get", {
197
+ description: "Get a contact",
198
+ inputSchema: { id: { type: "string", required: true } },
199
+ async execute(input, ctx) {
200
+ const { base, apiKey } = getConn(ctx);
201
+ return api(base, apiKey, "GET", `contacts/${input.id}`);
202
+ },
203
+ });
204
+ rl.registerAction("contact.list", {
205
+ description: "List contacts",
132
206
  inputSchema: { limit: { type: "number", required: false } },
133
207
  async execute(input, ctx) {
134
208
  const { base, apiKey } = getConn(ctx);
135
209
  const p = (input ?? {});
136
210
  if (p.limit) {
137
- const res = await api(base, apiKey, "GET", "contacts");
211
+ const res = (await api(base, apiKey, "GET", "contacts"));
138
212
  return (res.contacts ?? []).slice(0, p.limit);
139
213
  }
140
214
  return paginate(base, apiKey, "contacts", "contacts");
141
- } });
142
- rl.registerAction("contact.update", { description: "Update a contact",
143
- inputSchema: { id: { type: "string", required: true }, customerId: { type: "string", required: false }, email: { type: "string", required: false }, name: { type: "string", required: false }, phone: { type: "string", required: false }, notes: { type: "string", required: false } },
215
+ },
216
+ });
217
+ rl.registerAction("contact.update", {
218
+ description: "Update a contact",
219
+ inputSchema: {
220
+ id: { type: "string", required: true },
221
+ customerId: { type: "string", required: false },
222
+ email: { type: "string", required: false },
223
+ name: { type: "string", required: false },
224
+ phone: { type: "string", required: false },
225
+ notes: { type: "string", required: false },
226
+ },
144
227
  async execute(input, ctx) {
145
228
  const { base, apiKey } = getConn(ctx);
146
229
  const { id, ...fields } = input;
@@ -156,16 +239,35 @@ export default function syncromsp(rl) {
156
239
  if (fields.notes)
157
240
  body.notes = fields.notes;
158
241
  return api(base, apiKey, "PUT", `contacts/${id}`, body);
159
- } });
160
- rl.registerAction("contact.delete", { description: "Delete a contact", inputSchema: { id: { type: "string", required: true } },
161
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); await api(base, apiKey, "DELETE", `contacts/${input.id}`); return { success: true }; } });
242
+ },
243
+ });
244
+ rl.registerAction("contact.delete", {
245
+ description: "Delete a contact",
246
+ inputSchema: { id: { type: "string", required: true } },
247
+ async execute(input, ctx) {
248
+ const { base, apiKey } = getConn(ctx);
249
+ await api(base, apiKey, "DELETE", `contacts/${input.id}`);
250
+ return { success: true };
251
+ },
252
+ });
162
253
  // ── Ticket ──────────────────────────────────────────
163
- rl.registerAction("ticket.create", { description: "Create a ticket",
164
- inputSchema: { customerId: { type: "string", required: true }, subject: { type: "string", required: true }, issueType: { type: "string", required: false }, status: { type: "string", required: false }, assetId: { type: "string", required: false }, contactId: { type: "string", required: false } },
254
+ rl.registerAction("ticket.create", {
255
+ description: "Create a ticket",
256
+ inputSchema: {
257
+ customerId: { type: "string", required: true },
258
+ subject: { type: "string", required: true },
259
+ issueType: { type: "string", required: false },
260
+ status: { type: "string", required: false },
261
+ assetId: { type: "string", required: false },
262
+ contactId: { type: "string", required: false },
263
+ },
165
264
  async execute(input, ctx) {
166
265
  const { base, apiKey } = getConn(ctx);
167
266
  const p = input;
168
- const body = { customer_id: p.customerId, subject: p.subject };
267
+ const body = {
268
+ customer_id: p.customerId,
269
+ subject: p.subject,
270
+ };
169
271
  if (p.issueType)
170
272
  body.problem_type = p.issueType;
171
273
  if (p.status)
@@ -174,13 +276,25 @@ export default function syncromsp(rl) {
174
276
  body.asset_id = p.assetId;
175
277
  if (p.contactId)
176
278
  body.contact_id = p.contactId;
177
- const res = await api(base, apiKey, "POST", "tickets", body);
279
+ const res = (await api(base, apiKey, "POST", "tickets", body));
178
280
  return res.ticket ?? res;
179
- } });
180
- rl.registerAction("ticket.get", { description: "Get a ticket", inputSchema: { id: { type: "string", required: true } },
181
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); const res = await api(base, apiKey, "GET", `tickets/${input.id}`); return res.ticket ?? res; } });
182
- rl.registerAction("ticket.list", { description: "List tickets",
183
- inputSchema: { limit: { type: "number", required: false }, status: { type: "string", required: false } },
281
+ },
282
+ });
283
+ rl.registerAction("ticket.get", {
284
+ description: "Get a ticket",
285
+ inputSchema: { id: { type: "string", required: true } },
286
+ async execute(input, ctx) {
287
+ const { base, apiKey } = getConn(ctx);
288
+ const res = (await api(base, apiKey, "GET", `tickets/${input.id}`));
289
+ return res.ticket ?? res;
290
+ },
291
+ });
292
+ rl.registerAction("ticket.list", {
293
+ description: "List tickets",
294
+ inputSchema: {
295
+ limit: { type: "number", required: false },
296
+ status: { type: "string", required: false },
297
+ },
184
298
  async execute(input, ctx) {
185
299
  const { base, apiKey } = getConn(ctx);
186
300
  const p = (input ?? {});
@@ -189,13 +303,24 @@ export default function syncromsp(rl) {
189
303
  qs.status = p.status;
190
304
  if (p.limit) {
191
305
  qs.per_page = p.limit;
192
- const res = await api(base, apiKey, "GET", "tickets", undefined, qs);
306
+ const res = (await api(base, apiKey, "GET", "tickets", undefined, qs));
193
307
  return res.tickets ?? res;
194
308
  }
195
309
  return paginate(base, apiKey, "tickets", "tickets", qs);
196
- } });
197
- rl.registerAction("ticket.update", { description: "Update a ticket",
198
- inputSchema: { id: { type: "string", required: true }, subject: { type: "string", required: false }, status: { type: "string", required: false }, issueType: { type: "string", required: false }, customerId: { type: "string", required: false }, assetId: { type: "string", required: false }, dueDate: { type: "string", required: false }, contactId: { type: "string", required: false } },
310
+ },
311
+ });
312
+ rl.registerAction("ticket.update", {
313
+ description: "Update a ticket",
314
+ inputSchema: {
315
+ id: { type: "string", required: true },
316
+ subject: { type: "string", required: false },
317
+ status: { type: "string", required: false },
318
+ issueType: { type: "string", required: false },
319
+ customerId: { type: "string", required: false },
320
+ assetId: { type: "string", required: false },
321
+ dueDate: { type: "string", required: false },
322
+ contactId: { type: "string", required: false },
323
+ },
199
324
  async execute(input, ctx) {
200
325
  const { base, apiKey } = getConn(ctx);
201
326
  const { id, ...fields } = input;
@@ -214,42 +339,95 @@ export default function syncromsp(rl) {
214
339
  body.due_date = fields.dueDate;
215
340
  if (fields.contactId)
216
341
  body.contact_id = fields.contactId;
217
- const res = await api(base, apiKey, "PUT", `tickets/${id}`, body);
342
+ const res = (await api(base, apiKey, "PUT", `tickets/${id}`, body));
218
343
  return res.ticket ?? res;
219
- } });
220
- rl.registerAction("ticket.delete", { description: "Delete a ticket", inputSchema: { id: { type: "string", required: true } },
221
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); await api(base, apiKey, "DELETE", `tickets/${input.id}`); return { success: true }; } });
344
+ },
345
+ });
346
+ rl.registerAction("ticket.delete", {
347
+ description: "Delete a ticket",
348
+ inputSchema: { id: { type: "string", required: true } },
349
+ async execute(input, ctx) {
350
+ const { base, apiKey } = getConn(ctx);
351
+ await api(base, apiKey, "DELETE", `tickets/${input.id}`);
352
+ return { success: true };
353
+ },
354
+ });
222
355
  // ── RMM Alerts ──────────────────────────────────────
223
- rl.registerAction("rmmAlert.create", { description: "Create an RMM alert",
224
- inputSchema: { customerId: { type: "string", required: true }, assetId: { type: "string", required: true }, description: { type: "string", required: true } },
356
+ rl.registerAction("rmmAlert.create", {
357
+ description: "Create an RMM alert",
358
+ inputSchema: {
359
+ customerId: { type: "string", required: true },
360
+ assetId: { type: "string", required: true },
361
+ description: { type: "string", required: true },
362
+ },
225
363
  async execute(input, ctx) {
226
364
  const { base, apiKey } = getConn(ctx);
227
365
  const p = input;
228
- const res = await api(base, apiKey, "POST", "rmm_alerts", { customer_id: p.customerId, asset_id: p.assetId, description: p.description });
366
+ const res = (await api(base, apiKey, "POST", "rmm_alerts", {
367
+ customer_id: p.customerId,
368
+ asset_id: p.assetId,
369
+ description: p.description,
370
+ }));
229
371
  return res.alert ?? res;
230
- } });
231
- rl.registerAction("rmmAlert.get", { description: "Get an RMM alert", inputSchema: { id: { type: "string", required: true } },
232
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); const res = await api(base, apiKey, "GET", `rmm_alerts/${input.id}`); return res.rmm_alert ?? res; } });
233
- rl.registerAction("rmmAlert.list", { description: "List RMM alerts",
234
- inputSchema: { limit: { type: "number", required: false }, status: { type: "string", required: false, description: "all, active, or resolved" } },
372
+ },
373
+ });
374
+ rl.registerAction("rmmAlert.get", {
375
+ description: "Get an RMM alert",
376
+ inputSchema: { id: { type: "string", required: true } },
377
+ async execute(input, ctx) {
378
+ const { base, apiKey } = getConn(ctx);
379
+ const res = (await api(base, apiKey, "GET", `rmm_alerts/${input.id}`));
380
+ return res.rmm_alert ?? res;
381
+ },
382
+ });
383
+ rl.registerAction("rmmAlert.list", {
384
+ description: "List RMM alerts",
385
+ inputSchema: {
386
+ limit: { type: "number", required: false },
387
+ status: {
388
+ type: "string",
389
+ required: false,
390
+ description: "all, active, or resolved",
391
+ },
392
+ },
235
393
  async execute(input, ctx) {
236
394
  const { base, apiKey } = getConn(ctx);
237
395
  const p = (input ?? {});
238
396
  const qs = { status: p.status ?? "all" };
239
397
  if (p.limit) {
240
398
  qs.per_page = p.limit;
241
- const res = await api(base, apiKey, "GET", "rmm_alerts", undefined, qs);
399
+ const res = (await api(base, apiKey, "GET", "rmm_alerts", undefined, qs));
242
400
  return res.rmm_alerts ?? res;
243
401
  }
244
402
  return paginate(base, apiKey, "rmm_alerts", "rmm_alerts", qs);
245
- } });
246
- rl.registerAction("rmmAlert.delete", { description: "Delete an RMM alert", inputSchema: { id: { type: "string", required: true } },
247
- async execute(input, ctx) { const { base, apiKey } = getConn(ctx); await api(base, apiKey, "DELETE", `rmm_alerts/${input.id}`); return { success: true }; } });
248
- rl.registerAction("rmmAlert.mute", { description: "Mute an RMM alert",
249
- inputSchema: { id: { type: "string", required: true }, muteFor: { type: "string", required: true, description: "Duration to mute, e.g. 1_hour, 1_day, forever" } },
403
+ },
404
+ });
405
+ rl.registerAction("rmmAlert.delete", {
406
+ description: "Delete an RMM alert",
407
+ inputSchema: { id: { type: "string", required: true } },
408
+ async execute(input, ctx) {
409
+ const { base, apiKey } = getConn(ctx);
410
+ await api(base, apiKey, "DELETE", `rmm_alerts/${input.id}`);
411
+ return { success: true };
412
+ },
413
+ });
414
+ rl.registerAction("rmmAlert.mute", {
415
+ description: "Mute an RMM alert",
416
+ inputSchema: {
417
+ id: { type: "string", required: true },
418
+ muteFor: {
419
+ type: "string",
420
+ required: true,
421
+ description: "Duration to mute, e.g. 1_hour, 1_day, forever",
422
+ },
423
+ },
250
424
  async execute(input, ctx) {
251
425
  const { base, apiKey } = getConn(ctx);
252
426
  const p = input;
253
- return api(base, apiKey, "POST", `rmm_alerts/${p.id}/mute`, { id: p.id, mute_for: p.muteFor });
254
- } });
427
+ return api(base, apiKey, "POST", `rmm_alerts/${p.id}/mute`, {
428
+ id: p.id,
429
+ mute_for: p.muteFor,
430
+ });
431
+ },
432
+ });
255
433
  }
@@ -7,7 +7,10 @@ async function apiRequest(apiKey, method, endpoint, body, qs) {
7
7
  url.searchParams.set(k, String(v));
8
8
  }
9
9
  }
10
- const init = { method, headers: { "Api-Key": apiKey, "Content-Type": "application/json" } };
10
+ const init = {
11
+ method,
12
+ headers: { "Api-Key": apiKey, "Content-Type": "application/json" },
13
+ };
11
14
  if (body && Object.keys(body).length > 0)
12
15
  init.body = JSON.stringify(body);
13
16
  const res = await fetch(url.toString(), init);
@@ -19,18 +22,31 @@ async function apiRequest(apiKey, method, endpoint, body, qs) {
19
22
  export default function tapfiliate(rl) {
20
23
  rl.setName("tapfiliate");
21
24
  rl.setVersion("0.1.0");
22
- rl.setConnectionSchema({ apiKey: { type: "string", required: true, description: "Tapfiliate API key", env: "TAPFILIATE_API_KEY" } });
25
+ rl.setConnectionSchema({
26
+ apiKey: {
27
+ type: "string",
28
+ required: true,
29
+ description: "Tapfiliate API key",
30
+ env: "TAPFILIATE_API_KEY",
31
+ },
32
+ });
23
33
  const key = (ctx) => ctx.connection.config.apiKey;
24
34
  // ── Affiliate ───────────────────────────────────────
25
35
  rl.registerAction("affiliate.create", {
26
36
  description: "Create an affiliate",
27
37
  inputSchema: {
28
- firstname: { type: "string", required: true }, lastname: { type: "string", required: true },
29
- email: { type: "string", required: true }, companyName: { type: "string", required: false },
38
+ firstname: { type: "string", required: true },
39
+ lastname: { type: "string", required: true },
40
+ email: { type: "string", required: true },
41
+ companyName: { type: "string", required: false },
30
42
  },
31
43
  async execute(input, ctx) {
32
44
  const p = input;
33
- const body = { firstname: p.firstname, lastname: p.lastname, email: p.email };
45
+ const body = {
46
+ firstname: p.firstname,
47
+ lastname: p.lastname,
48
+ email: p.email,
49
+ };
34
50
  if (p.companyName)
35
51
  body.company = { name: p.companyName };
36
52
  return apiRequest(key(ctx), "POST", "/affiliates/", body);
@@ -39,11 +55,16 @@ export default function tapfiliate(rl) {
39
55
  rl.registerAction("affiliate.get", {
40
56
  description: "Get an affiliate by ID",
41
57
  inputSchema: { affiliateId: { type: "string", required: true } },
42
- async execute(input, ctx) { return apiRequest(key(ctx), "GET", `/affiliates/${input.affiliateId}/`); },
58
+ async execute(input, ctx) {
59
+ return apiRequest(key(ctx), "GET", `/affiliates/${input.affiliateId}/`);
60
+ },
43
61
  });
44
62
  rl.registerAction("affiliate.list", {
45
63
  description: "List affiliates",
46
- inputSchema: { limit: { type: "number", required: false }, email: { type: "string", required: false } },
64
+ inputSchema: {
65
+ limit: { type: "number", required: false },
66
+ email: { type: "string", required: false },
67
+ },
47
68
  async execute(input, ctx) {
48
69
  const p = (input ?? {});
49
70
  const qs = {};
@@ -64,7 +85,11 @@ export default function tapfiliate(rl) {
64
85
  // ── Affiliate Metadata ──────────────────────────────
65
86
  rl.registerAction("affiliateMetadata.set", {
66
87
  description: "Set metadata key-value on an affiliate",
67
- inputSchema: { affiliateId: { type: "string", required: true }, key: { type: "string", required: true }, value: { type: "string", required: true } },
88
+ inputSchema: {
89
+ affiliateId: { type: "string", required: true },
90
+ key: { type: "string", required: true },
91
+ value: { type: "string", required: true },
92
+ },
68
93
  async execute(input, ctx) {
69
94
  const p = input;
70
95
  return apiRequest(key(ctx), "PUT", `/affiliates/${p.affiliateId}/meta-data/${p.key}/`, { value: p.value });
@@ -72,7 +97,10 @@ export default function tapfiliate(rl) {
72
97
  });
73
98
  rl.registerAction("affiliateMetadata.delete", {
74
99
  description: "Delete a metadata key from an affiliate",
75
- inputSchema: { affiliateId: { type: "string", required: true }, key: { type: "string", required: true } },
100
+ inputSchema: {
101
+ affiliateId: { type: "string", required: true },
102
+ key: { type: "string", required: true },
103
+ },
76
104
  async execute(input, ctx) {
77
105
  const p = input;
78
106
  await apiRequest(key(ctx), "DELETE", `/affiliates/${p.affiliateId}/meta-data/${p.key}/`);
@@ -82,7 +110,10 @@ export default function tapfiliate(rl) {
82
110
  // ── Program Affiliate ───────────────────────────────
83
111
  rl.registerAction("programAffiliate.add", {
84
112
  description: "Add an affiliate to a program",
85
- inputSchema: { programId: { type: "string", required: true }, affiliateId: { type: "string", required: true } },
113
+ inputSchema: {
114
+ programId: { type: "string", required: true },
115
+ affiliateId: { type: "string", required: true },
116
+ },
86
117
  async execute(input, ctx) {
87
118
  const p = input;
88
119
  return apiRequest(key(ctx), "POST", `/programs/${p.programId}/affiliates/`, { affiliate: { id: p.affiliateId } });
@@ -90,7 +121,10 @@ export default function tapfiliate(rl) {
90
121
  });
91
122
  rl.registerAction("programAffiliate.approve", {
92
123
  description: "Approve an affiliate for a program",
93
- inputSchema: { programId: { type: "string", required: true }, affiliateId: { type: "string", required: true } },
124
+ inputSchema: {
125
+ programId: { type: "string", required: true },
126
+ affiliateId: { type: "string", required: true },
127
+ },
94
128
  async execute(input, ctx) {
95
129
  const p = input;
96
130
  return apiRequest(key(ctx), "PUT", `/programs/${p.programId}/affiliates/${p.affiliateId}/approved/`);
@@ -98,7 +132,10 @@ export default function tapfiliate(rl) {
98
132
  });
99
133
  rl.registerAction("programAffiliate.disapprove", {
100
134
  description: "Disapprove an affiliate for a program",
101
- inputSchema: { programId: { type: "string", required: true }, affiliateId: { type: "string", required: true } },
135
+ inputSchema: {
136
+ programId: { type: "string", required: true },
137
+ affiliateId: { type: "string", required: true },
138
+ },
102
139
  async execute(input, ctx) {
103
140
  const p = input;
104
141
  await apiRequest(key(ctx), "DELETE", `/programs/${p.programId}/affiliates/${p.affiliateId}/approved/`);
@@ -107,7 +144,10 @@ export default function tapfiliate(rl) {
107
144
  });
108
145
  rl.registerAction("programAffiliate.get", {
109
146
  description: "Get an affiliate in a program",
110
- inputSchema: { programId: { type: "string", required: true }, affiliateId: { type: "string", required: true } },
147
+ inputSchema: {
148
+ programId: { type: "string", required: true },
149
+ affiliateId: { type: "string", required: true },
150
+ },
111
151
  async execute(input, ctx) {
112
152
  const p = input;
113
153
  return apiRequest(key(ctx), "GET", `/programs/${p.programId}/affiliates/${p.affiliateId}/`);
@@ -115,7 +155,10 @@ export default function tapfiliate(rl) {
115
155
  });
116
156
  rl.registerAction("programAffiliate.list", {
117
157
  description: "List affiliates in a program",
118
- inputSchema: { programId: { type: "string", required: true }, limit: { type: "number", required: false } },
158
+ inputSchema: {
159
+ programId: { type: "string", required: true },
160
+ limit: { type: "number", required: false },
161
+ },
119
162
  async execute(input, ctx) {
120
163
  const p = input;
121
164
  const data = (await apiRequest(key(ctx), "GET", `/programs/${p.programId}/affiliates/`));