runline 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +1 -1
  2. package/dist/plugins/actionNetwork/src/index.js +118 -25
  3. package/dist/plugins/activeCampaign/src/index.js +184 -38
  4. package/dist/plugins/adalo/src/index.js +40 -8
  5. package/dist/plugins/affinity/src/index.js +100 -20
  6. package/dist/plugins/agileCrm/src/index.js +115 -27
  7. package/dist/plugins/airtable/src/index.js +94 -19
  8. package/dist/plugins/airtop/src/index.js +266 -62
  9. package/dist/plugins/apiTemplateIo/src/index.js +25 -5
  10. package/dist/plugins/asana/src/index.js +195 -41
  11. package/dist/plugins/autopilot/src/index.js +39 -8
  12. package/dist/plugins/bambooHr/src/index.js +109 -22
  13. package/dist/plugins/bannerbear/src/index.js +36 -8
  14. package/dist/plugins/baserow/src/index.js +35 -7
  15. package/dist/plugins/beeminder/src/index.js +198 -40
  16. package/dist/plugins/bitly/src/index.js +46 -10
  17. package/dist/plugins/bitwarden/src/index.js +167 -36
  18. package/dist/plugins/box/src/index.js +172 -37
  19. package/dist/plugins/brandfetch/src/index.js +5 -1
  20. package/dist/plugins/brevo/src/index.js +136 -29
  21. package/dist/plugins/bubble/src/index.js +76 -17
  22. package/dist/plugins/chargebee/src/index.js +35 -7
  23. package/dist/plugins/circleci/src/index.js +50 -10
  24. package/dist/plugins/ciscoWebex/src/index.js +131 -27
  25. package/dist/plugins/clearbit/src/index.js +76 -17
  26. package/dist/plugins/clickup/src/index.js +500 -107
  27. package/dist/plugins/clockify/src/index.js +229 -47
  28. package/dist/plugins/cloudflare/src/index.js +28 -6
  29. package/dist/plugins/cockpit/src/index.js +54 -12
  30. package/dist/plugins/coda/src/index.js +81 -19
  31. package/dist/plugins/coingecko/src/index.js +157 -33
  32. package/dist/plugins/contentful/src/index.js +85 -17
  33. package/dist/plugins/convertkit/src/index.js +74 -18
  34. package/dist/plugins/copper/src/index.js +59 -11
  35. package/dist/plugins/cortex/src/index.js +55 -13
  36. package/dist/plugins/currents/src/index.js +310 -71
  37. package/dist/plugins/customerIo/src/index.js +112 -23
  38. package/dist/plugins/databricks/src/index.js +549 -115
  39. package/dist/plugins/deepl/src/index.js +26 -6
  40. package/dist/plugins/demio/src/index.js +56 -11
  41. package/dist/plugins/dhl/src/index.js +16 -3
  42. package/dist/plugins/discord/src/index.js +141 -31
  43. package/dist/plugins/discourse/src/index.js +136 -31
  44. package/dist/plugins/disqus/src/index.js +96 -20
  45. package/dist/plugins/docker/src/index.js +20 -4
  46. package/dist/plugins/drift/src/index.js +19 -5
  47. package/dist/plugins/dropbox/src/index.js +139 -30
  48. package/dist/plugins/dropcontact/src/index.js +21 -4
  49. package/dist/plugins/egoi/src/index.js +61 -15
  50. package/dist/plugins/elasticsearch/src/index.js +59 -13
  51. package/dist/plugins/emelia/src/index.js +95 -19
  52. package/dist/plugins/erpnext/src/index.js +74 -15
  53. package/dist/plugins/facebookGraph/src/index.js +52 -11
  54. package/dist/plugins/freshdesk/src/index.js +220 -48
  55. package/dist/plugins/freshservice/src/index.js +39 -9
  56. package/dist/plugins/freshworksCrm/src/index.js +58 -12
  57. package/dist/plugins/getresponse/src/index.js +87 -18
  58. package/dist/plugins/ghost/src/index.js +114 -26
  59. package/dist/plugins/github/src/index.js +483 -109
  60. package/dist/plugins/gitlab/src/index.js +193 -45
  61. package/dist/plugins/gong/src/index.js +68 -14
  62. package/dist/plugins/gotify/src/index.js +43 -9
  63. package/dist/plugins/gotowebinar/src/index.js +233 -47
  64. package/dist/plugins/grafana/src/index.js +92 -21
  65. package/dist/plugins/graphql/src/index.js +38 -8
  66. package/dist/plugins/grist/src/index.js +52 -10
  67. package/dist/plugins/hackernews/src/index.js +32 -6
  68. package/dist/plugins/halopsa/src/index.js +131 -26
  69. package/dist/plugins/harvest/src/index.js +182 -42
  70. package/dist/plugins/helpscout/src/index.js +153 -31
  71. package/dist/plugins/highlevel/src/index.js +291 -58
  72. package/dist/plugins/homeAssistant/src/index.js +124 -26
  73. package/dist/plugins/hubspot/src/index.js +163 -29
  74. package/dist/plugins/humanticAi/src/index.js +54 -5
  75. package/dist/plugins/hunter/src/index.js +21 -4
  76. package/dist/plugins/intercom/src/index.js +95 -20
  77. package/dist/plugins/iterable/src/index.js +96 -20
  78. package/dist/plugins/jenkins/src/index.js +75 -17
  79. package/dist/plugins/jira/src/index.js +193 -43
  80. package/dist/plugins/keap/src/index.js +222 -56
  81. package/dist/plugins/kobotoolbox/src/index.js +113 -25
  82. package/dist/plugins/lemlist/src/index.js +79 -18
  83. package/dist/plugins/linear/src/index.js +86 -19
  84. package/dist/plugins/lingvanex/src/index.js +38 -8
  85. package/dist/plugins/linkedin/src/index.js +37 -8
  86. package/dist/plugins/lonescale/src/index.js +41 -9
  87. package/dist/plugins/magento/src/index.js +98 -27
  88. package/dist/plugins/mailcheck/src/index.js +11 -2
  89. package/dist/plugins/mailchimp/src/index.js +193 -42
  90. package/dist/plugins/mailerlite/src/index.js +61 -12
  91. package/dist/plugins/mailgun/src/index.js +39 -7
  92. package/dist/plugins/mailjet/src/index.js +141 -30
  93. package/dist/plugins/mandrill/src/index.js +67 -14
  94. package/dist/plugins/marketstack/src/index.js +56 -10
  95. package/dist/plugins/matrix/src/index.js +97 -20
  96. package/dist/plugins/mattermost/src/index.js +124 -26
  97. package/dist/plugins/mautic/src/index.js +129 -26
  98. package/dist/plugins/medium/src/index.js +64 -13
  99. package/dist/plugins/messagebird/src/index.js +80 -15
  100. package/dist/plugins/metabase/src/index.js +57 -12
  101. package/dist/plugins/misp/src/index.js +135 -33
  102. package/dist/plugins/mocean/src/index.js +33 -7
  103. package/dist/plugins/monday/src/index.js +97 -23
  104. package/dist/plugins/monicaCrm/src/index.js +112 -23
  105. package/dist/plugins/msg91/src/index.js +11 -2
  106. package/dist/plugins/nasa/src/index.js +108 -21
  107. package/dist/plugins/netlify/src/index.js +28 -6
  108. package/dist/plugins/netscalerAdc/src/index.js +144 -29
  109. package/dist/plugins/nextcloud/src/index.js +103 -20
  110. package/dist/plugins/nocodb/src/index.js +57 -11
  111. package/dist/plugins/notion/src/index.js +148 -37
  112. package/dist/plugins/npm/src/index.js +59 -12
  113. package/dist/plugins/odoo/src/index.js +102 -20
  114. package/dist/plugins/okta/src/index.js +50 -10
  115. package/dist/plugins/oneSimpleApi/src/index.js +84 -17
  116. package/dist/plugins/onfleet/src/index.js +139 -32
  117. package/dist/plugins/openThesaurus/src/index.js +46 -9
  118. package/dist/plugins/openweathermap/src/index.js +31 -6
  119. package/dist/plugins/oura/src/index.js +36 -7
  120. package/dist/plugins/paddle/src/index.js +80 -17
  121. package/dist/plugins/pagerduty/src/index.js +53 -12
  122. package/dist/plugins/paypal/src/index.js +51 -11
  123. package/dist/plugins/peekalink/src/index.js +12 -3
  124. package/dist/plugins/phantombuster/src/index.js +39 -8
  125. package/dist/plugins/philipsHue/src/index.js +64 -13
  126. package/dist/plugins/pipedrive/src/index.js +167 -45
  127. package/dist/plugins/plivo/src/index.js +43 -8
  128. package/dist/plugins/postbin/src/index.js +9 -2
  129. package/dist/plugins/posthog/src/index.js +50 -13
  130. package/dist/plugins/profitwell/src/index.js +24 -5
  131. package/dist/plugins/pushbullet/src/index.js +45 -9
  132. package/dist/plugins/pushcut/src/index.js +31 -6
  133. package/dist/plugins/pushover/src/index.js +51 -10
  134. package/dist/plugins/quickbase/src/index.js +66 -13
  135. package/dist/plugins/quickbooks/src/index.js +86 -19
  136. package/dist/plugins/quickchart/src/index.js +35 -7
  137. package/dist/plugins/raindrop/src/index.js +54 -13
  138. package/dist/plugins/reddit/src/index.js +73 -18
  139. package/dist/plugins/rocketchat/src/index.js +47 -9
  140. package/dist/plugins/rundeck/src/index.js +26 -5
  141. package/dist/plugins/salesforce/src/index.js +161 -31
  142. package/dist/plugins/salesmate/src/index.js +75 -16
  143. package/dist/plugins/securityScorecard/src/index.js +73 -15
  144. package/dist/plugins/segment/src/index.js +21 -4
  145. package/dist/plugins/sendgrid/src/index.js +102 -24
  146. package/dist/plugins/sendy/src/index.js +54 -11
  147. package/dist/plugins/sentry/src/index.js +174 -34
  148. package/dist/plugins/servicenow/src/index.js +120 -27
  149. package/dist/plugins/shopify/src/index.js +53 -12
  150. package/dist/plugins/signl4/src/index.js +16 -3
  151. package/dist/plugins/slack/src/index.js +407 -105
  152. package/dist/plugins/sms77/src/index.js +26 -5
  153. package/dist/plugins/splunk/src/index.js +186 -45
  154. package/dist/plugins/spotify/src/index.js +265 -66
  155. package/dist/plugins/stackby/src/index.js +18 -6
  156. package/dist/plugins/storyblok/src/index.js +57 -11
  157. package/dist/plugins/strapi/src/index.js +63 -12
  158. package/dist/plugins/strava/src/index.js +58 -13
  159. package/dist/plugins/stripe/src/index.js +143 -30
  160. package/dist/plugins/supabase/src/index.js +49 -10
  161. package/dist/plugins/syncromsp/src/index.js +245 -67
  162. package/dist/plugins/tapfiliate/src/index.js +57 -14
  163. package/dist/plugins/telegram/src/index.js +202 -39
  164. package/dist/plugins/thehive/src/index.js +271 -66
  165. package/dist/plugins/thehiveProject/src/index.js +457 -89
  166. package/dist/plugins/todoist/src/index.js +326 -77
  167. package/dist/plugins/travisci/src/index.js +35 -8
  168. package/dist/plugins/trello/src/index.js +204 -46
  169. package/dist/plugins/twake/src/index.js +10 -2
  170. package/dist/plugins/twilio/src/index.js +56 -11
  171. package/dist/plugins/twist/src/index.js +241 -48
  172. package/dist/plugins/twitter/src/index.js +128 -30
  173. package/dist/plugins/unleashedSoftware/src/index.js +30 -6
  174. package/dist/plugins/uplead/src/index.js +9 -2
  175. package/dist/plugins/uproc/src/index.js +31 -6
  176. package/dist/plugins/uptimerobot/src/index.js +119 -25
  177. package/dist/plugins/urlscanio/src/index.js +25 -6
  178. package/dist/plugins/vero/src/index.js +68 -13
  179. package/dist/plugins/vonage/src/index.js +32 -6
  180. package/dist/plugins/wekan/src/index.js +297 -52
  181. package/dist/plugins/woocommerce/src/index.js +57 -12
  182. package/dist/plugins/wordpress/src/index.js +94 -18
  183. package/dist/plugins/xero/src/index.js +79 -13
  184. package/dist/plugins/yourls/src/index.js +33 -6
  185. package/dist/plugins/zammad/src/index.js +139 -36
  186. package/dist/plugins/zendesk/src/index.js +201 -48
  187. package/dist/plugins/zoho/src/index.js +88 -21
  188. package/dist/plugins/zoom/src/index.js +41 -7
  189. package/dist/plugins/zulip/src/index.js +101 -20
  190. package/package.json +1 -1
@@ -1,9 +1,19 @@
1
1
  function getConn(ctx) {
2
2
  const c = ctx.connection.config;
3
- return { url: c.url.replace(/\/$/, ""), token: c.token };
3
+ return {
4
+ url: c.url.replace(/\/$/, ""),
5
+ token: c.token,
6
+ };
4
7
  }
5
8
  async function api(conn, method, endpoint, body) {
6
- const init = { method, headers: { Authorization: `Bearer ${conn.token}`, "Content-Type": "application/json", Accept: "application/json" } };
9
+ const init = {
10
+ method,
11
+ headers: {
12
+ Authorization: `Bearer ${conn.token}`,
13
+ "Content-Type": "application/json",
14
+ Accept: "application/json",
15
+ },
16
+ };
7
17
  if (body && Object.keys(body).length > 0)
8
18
  init.body = JSON.stringify(body);
9
19
  const res = await fetch(`${conn.url}/api/${endpoint}`, init);
@@ -16,76 +26,311 @@ export default function wekan(rl) {
16
26
  rl.setName("wekan");
17
27
  rl.setVersion("0.1.0");
18
28
  rl.setConnectionSchema({
19
- url: { type: "string", required: true, description: "Wekan server URL", env: "WEKAN_URL" },
20
- token: { type: "string", required: true, description: "Wekan API token", env: "WEKAN_TOKEN" },
29
+ url: {
30
+ type: "string",
31
+ required: true,
32
+ description: "Wekan server URL",
33
+ env: "WEKAN_URL",
34
+ },
35
+ token: {
36
+ type: "string",
37
+ required: true,
38
+ description: "Wekan API token",
39
+ env: "WEKAN_TOKEN",
40
+ },
21
41
  });
22
42
  // ── Board ───────────────────────────────────────────
23
- rl.registerAction("board.create", { description: "Create a board", inputSchema: { title: { type: "string", required: true }, owner: { type: "string", required: true } },
24
- async execute(input, ctx) { return api(getConn(ctx), "POST", "boards", input); } });
25
- rl.registerAction("board.get", { description: "Get a board", inputSchema: { boardId: { type: "string", required: true } },
26
- async execute(input, ctx) { return api(getConn(ctx), "GET", `boards/${input.boardId}`); } });
27
- rl.registerAction("board.list", { description: "List boards for a user", inputSchema: { userId: { type: "string", required: true }, limit: { type: "number", required: false } },
43
+ rl.registerAction("board.create", {
44
+ description: "Create a board",
45
+ inputSchema: {
46
+ title: { type: "string", required: true },
47
+ owner: { type: "string", required: true },
48
+ },
49
+ async execute(input, ctx) {
50
+ return api(getConn(ctx), "POST", "boards", input);
51
+ },
52
+ });
53
+ rl.registerAction("board.get", {
54
+ description: "Get a board",
55
+ inputSchema: { boardId: { type: "string", required: true } },
56
+ async execute(input, ctx) {
57
+ return api(getConn(ctx), "GET", `boards/${input.boardId}`);
58
+ },
59
+ });
60
+ rl.registerAction("board.list", {
61
+ description: "List boards for a user",
62
+ inputSchema: {
63
+ userId: { type: "string", required: true },
64
+ limit: { type: "number", required: false },
65
+ },
28
66
  async execute(input, ctx) {
29
67
  const p = input;
30
68
  const data = (await api(getConn(ctx), "GET", `users/${p.userId}/boards`));
31
69
  return p.limit ? data.slice(0, p.limit) : data;
32
- } });
33
- rl.registerAction("board.delete", { description: "Delete a board", inputSchema: { boardId: { type: "string", required: true } },
34
- async execute(input, ctx) { return api(getConn(ctx), "DELETE", `boards/${input.boardId}`); } });
70
+ },
71
+ });
72
+ rl.registerAction("board.delete", {
73
+ description: "Delete a board",
74
+ inputSchema: { boardId: { type: "string", required: true } },
75
+ async execute(input, ctx) {
76
+ return api(getConn(ctx), "DELETE", `boards/${input.boardId}`);
77
+ },
78
+ });
35
79
  // ── List ────────────────────────────────────────────
36
- rl.registerAction("list.create", { description: "Create a list on a board", inputSchema: { boardId: { type: "string", required: true }, title: { type: "string", required: true } },
37
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "POST", `boards/${p.boardId}/lists`, { title: p.title }); } });
38
- rl.registerAction("list.get", { description: "Get a list", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true } },
39
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/lists/${p.listId}`); } });
40
- rl.registerAction("list.listAll", { description: "List all lists on a board", inputSchema: { boardId: { type: "string", required: true }, limit: { type: "number", required: false } },
80
+ rl.registerAction("list.create", {
81
+ description: "Create a list on a board",
82
+ inputSchema: {
83
+ boardId: { type: "string", required: true },
84
+ title: { type: "string", required: true },
85
+ },
86
+ async execute(input, ctx) {
87
+ const p = input;
88
+ return api(getConn(ctx), "POST", `boards/${p.boardId}/lists`, {
89
+ title: p.title,
90
+ });
91
+ },
92
+ });
93
+ rl.registerAction("list.get", {
94
+ description: "Get a list",
95
+ inputSchema: {
96
+ boardId: { type: "string", required: true },
97
+ listId: { type: "string", required: true },
98
+ },
99
+ async execute(input, ctx) {
100
+ const p = input;
101
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/lists/${p.listId}`);
102
+ },
103
+ });
104
+ rl.registerAction("list.listAll", {
105
+ description: "List all lists on a board",
106
+ inputSchema: {
107
+ boardId: { type: "string", required: true },
108
+ limit: { type: "number", required: false },
109
+ },
41
110
  async execute(input, ctx) {
42
111
  const p = input;
43
112
  const data = (await api(getConn(ctx), "GET", `boards/${p.boardId}/lists`));
44
113
  return p.limit ? data.slice(0, p.limit) : data;
45
- } });
46
- rl.registerAction("list.delete", { description: "Delete a list", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true } },
47
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "DELETE", `boards/${p.boardId}/lists/${p.listId}`); } });
114
+ },
115
+ });
116
+ rl.registerAction("list.delete", {
117
+ description: "Delete a list",
118
+ inputSchema: {
119
+ boardId: { type: "string", required: true },
120
+ listId: { type: "string", required: true },
121
+ },
122
+ async execute(input, ctx) {
123
+ const p = input;
124
+ return api(getConn(ctx), "DELETE", `boards/${p.boardId}/lists/${p.listId}`);
125
+ },
126
+ });
48
127
  // ── Card ────────────────────────────────────────────
49
- rl.registerAction("card.create", { description: "Create a card", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true }, title: { type: "string", required: true }, swimlaneId: { type: "string", required: true }, authorId: { type: "string", required: true }, description: { type: "string", required: false } },
128
+ rl.registerAction("card.create", {
129
+ description: "Create a card",
130
+ inputSchema: {
131
+ boardId: { type: "string", required: true },
132
+ listId: { type: "string", required: true },
133
+ title: { type: "string", required: true },
134
+ swimlaneId: { type: "string", required: true },
135
+ authorId: { type: "string", required: true },
136
+ description: { type: "string", required: false },
137
+ },
50
138
  async execute(input, ctx) {
51
139
  const { boardId, listId, ...body } = input;
52
140
  return api(getConn(ctx), "POST", `boards/${boardId}/lists/${listId}/cards`, body);
53
- } });
54
- rl.registerAction("card.get", { description: "Get a card", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true }, cardId: { type: "string", required: true } },
55
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/lists/${p.listId}/cards/${p.cardId}`); } });
56
- rl.registerAction("card.list", { description: "List cards in a list", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true }, limit: { type: "number", required: false } },
141
+ },
142
+ });
143
+ rl.registerAction("card.get", {
144
+ description: "Get a card",
145
+ inputSchema: {
146
+ boardId: { type: "string", required: true },
147
+ listId: { type: "string", required: true },
148
+ cardId: { type: "string", required: true },
149
+ },
150
+ async execute(input, ctx) {
151
+ const p = input;
152
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/lists/${p.listId}/cards/${p.cardId}`);
153
+ },
154
+ });
155
+ rl.registerAction("card.list", {
156
+ description: "List cards in a list",
157
+ inputSchema: {
158
+ boardId: { type: "string", required: true },
159
+ listId: { type: "string", required: true },
160
+ limit: { type: "number", required: false },
161
+ },
57
162
  async execute(input, ctx) {
58
163
  const p = input;
59
164
  const data = (await api(getConn(ctx), "GET", `boards/${p.boardId}/lists/${p.listId}/cards`));
60
165
  return p.limit ? data.slice(0, p.limit) : data;
61
- } });
62
- rl.registerAction("card.update", { description: "Update a card", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true }, cardId: { type: "string", required: true }, data: { type: "object", required: true } },
63
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "PUT", `boards/${p.boardId}/lists/${p.listId}/cards/${p.cardId}`, p.data); } });
64
- rl.registerAction("card.delete", { description: "Delete a card", inputSchema: { boardId: { type: "string", required: true }, listId: { type: "string", required: true }, cardId: { type: "string", required: true } },
65
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "DELETE", `boards/${p.boardId}/lists/${p.listId}/cards/${p.cardId}`); } });
166
+ },
167
+ });
168
+ rl.registerAction("card.update", {
169
+ description: "Update a card",
170
+ inputSchema: {
171
+ boardId: { type: "string", required: true },
172
+ listId: { type: "string", required: true },
173
+ cardId: { type: "string", required: true },
174
+ data: { type: "object", required: true },
175
+ },
176
+ async execute(input, ctx) {
177
+ const p = input;
178
+ return api(getConn(ctx), "PUT", `boards/${p.boardId}/lists/${p.listId}/cards/${p.cardId}`, p.data);
179
+ },
180
+ });
181
+ rl.registerAction("card.delete", {
182
+ description: "Delete a card",
183
+ inputSchema: {
184
+ boardId: { type: "string", required: true },
185
+ listId: { type: "string", required: true },
186
+ cardId: { type: "string", required: true },
187
+ },
188
+ async execute(input, ctx) {
189
+ const p = input;
190
+ return api(getConn(ctx), "DELETE", `boards/${p.boardId}/lists/${p.listId}/cards/${p.cardId}`);
191
+ },
192
+ });
66
193
  // ── Card Comment ────────────────────────────────────
67
- rl.registerAction("cardComment.create", { description: "Add a comment to a card", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, authorId: { type: "string", required: true }, comment: { type: "string", required: true } },
68
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "POST", `boards/${p.boardId}/cards/${p.cardId}/comments`, { authorId: p.authorId, comment: p.comment }); } });
69
- rl.registerAction("cardComment.get", { description: "Get a comment", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, commentId: { type: "string", required: true } },
70
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/comments/${p.commentId}`); } });
71
- rl.registerAction("cardComment.list", { description: "List comments on a card", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true } },
72
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/comments`); } });
73
- rl.registerAction("cardComment.delete", { description: "Delete a comment", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, commentId: { type: "string", required: true } },
74
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "DELETE", `boards/${p.boardId}/cards/${p.cardId}/comments/${p.commentId}`); } });
194
+ rl.registerAction("cardComment.create", {
195
+ description: "Add a comment to a card",
196
+ inputSchema: {
197
+ boardId: { type: "string", required: true },
198
+ cardId: { type: "string", required: true },
199
+ authorId: { type: "string", required: true },
200
+ comment: { type: "string", required: true },
201
+ },
202
+ async execute(input, ctx) {
203
+ const p = input;
204
+ return api(getConn(ctx), "POST", `boards/${p.boardId}/cards/${p.cardId}/comments`, { authorId: p.authorId, comment: p.comment });
205
+ },
206
+ });
207
+ rl.registerAction("cardComment.get", {
208
+ description: "Get a comment",
209
+ inputSchema: {
210
+ boardId: { type: "string", required: true },
211
+ cardId: { type: "string", required: true },
212
+ commentId: { type: "string", required: true },
213
+ },
214
+ async execute(input, ctx) {
215
+ const p = input;
216
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/comments/${p.commentId}`);
217
+ },
218
+ });
219
+ rl.registerAction("cardComment.list", {
220
+ description: "List comments on a card",
221
+ inputSchema: {
222
+ boardId: { type: "string", required: true },
223
+ cardId: { type: "string", required: true },
224
+ },
225
+ async execute(input, ctx) {
226
+ const p = input;
227
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/comments`);
228
+ },
229
+ });
230
+ rl.registerAction("cardComment.delete", {
231
+ description: "Delete a comment",
232
+ inputSchema: {
233
+ boardId: { type: "string", required: true },
234
+ cardId: { type: "string", required: true },
235
+ commentId: { type: "string", required: true },
236
+ },
237
+ async execute(input, ctx) {
238
+ const p = input;
239
+ return api(getConn(ctx), "DELETE", `boards/${p.boardId}/cards/${p.cardId}/comments/${p.commentId}`);
240
+ },
241
+ });
75
242
  // ── Checklist ───────────────────────────────────────
76
- rl.registerAction("checklist.create", { description: "Create a checklist on a card", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, title: { type: "string", required: true }, items: { type: "object", required: false, description: "Array of item titles" } },
77
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "POST", `boards/${p.boardId}/cards/${p.cardId}/checklists`, { title: p.title, items: p.items }); } });
78
- rl.registerAction("checklist.get", { description: "Get a checklist", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, checklistId: { type: "string", required: true } },
79
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}`); } });
80
- rl.registerAction("checklist.list", { description: "List checklists on a card", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true } },
81
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/checklists`); } });
82
- rl.registerAction("checklist.delete", { description: "Delete a checklist", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, checklistId: { type: "string", required: true } },
83
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "DELETE", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}`); } });
243
+ rl.registerAction("checklist.create", {
244
+ description: "Create a checklist on a card",
245
+ inputSchema: {
246
+ boardId: { type: "string", required: true },
247
+ cardId: { type: "string", required: true },
248
+ title: { type: "string", required: true },
249
+ items: {
250
+ type: "object",
251
+ required: false,
252
+ description: "Array of item titles",
253
+ },
254
+ },
255
+ async execute(input, ctx) {
256
+ const p = input;
257
+ return api(getConn(ctx), "POST", `boards/${p.boardId}/cards/${p.cardId}/checklists`, { title: p.title, items: p.items });
258
+ },
259
+ });
260
+ rl.registerAction("checklist.get", {
261
+ description: "Get a checklist",
262
+ inputSchema: {
263
+ boardId: { type: "string", required: true },
264
+ cardId: { type: "string", required: true },
265
+ checklistId: { type: "string", required: true },
266
+ },
267
+ async execute(input, ctx) {
268
+ const p = input;
269
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}`);
270
+ },
271
+ });
272
+ rl.registerAction("checklist.list", {
273
+ description: "List checklists on a card",
274
+ inputSchema: {
275
+ boardId: { type: "string", required: true },
276
+ cardId: { type: "string", required: true },
277
+ },
278
+ async execute(input, ctx) {
279
+ const p = input;
280
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/checklists`);
281
+ },
282
+ });
283
+ rl.registerAction("checklist.delete", {
284
+ description: "Delete a checklist",
285
+ inputSchema: {
286
+ boardId: { type: "string", required: true },
287
+ cardId: { type: "string", required: true },
288
+ checklistId: { type: "string", required: true },
289
+ },
290
+ async execute(input, ctx) {
291
+ const p = input;
292
+ return api(getConn(ctx), "DELETE", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}`);
293
+ },
294
+ });
84
295
  // ── Checklist Item ──────────────────────────────────
85
- rl.registerAction("checklistItem.get", { description: "Get a checklist item", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, checklistId: { type: "string", required: true }, itemId: { type: "string", required: true } },
86
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}/items/${p.itemId}`); } });
87
- rl.registerAction("checklistItem.update", { description: "Update a checklist item", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, checklistId: { type: "string", required: true }, itemId: { type: "string", required: true }, data: { type: "object", required: true } },
88
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "PUT", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}/items/${p.itemId}`, p.data); } });
89
- rl.registerAction("checklistItem.delete", { description: "Delete a checklist item", inputSchema: { boardId: { type: "string", required: true }, cardId: { type: "string", required: true }, checklistId: { type: "string", required: true }, itemId: { type: "string", required: true } },
90
- async execute(input, ctx) { const p = input; return api(getConn(ctx), "DELETE", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}/items/${p.itemId}`); } });
296
+ rl.registerAction("checklistItem.get", {
297
+ description: "Get a checklist item",
298
+ inputSchema: {
299
+ boardId: { type: "string", required: true },
300
+ cardId: { type: "string", required: true },
301
+ checklistId: { type: "string", required: true },
302
+ itemId: { type: "string", required: true },
303
+ },
304
+ async execute(input, ctx) {
305
+ const p = input;
306
+ return api(getConn(ctx), "GET", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}/items/${p.itemId}`);
307
+ },
308
+ });
309
+ rl.registerAction("checklistItem.update", {
310
+ description: "Update a checklist item",
311
+ inputSchema: {
312
+ boardId: { type: "string", required: true },
313
+ cardId: { type: "string", required: true },
314
+ checklistId: { type: "string", required: true },
315
+ itemId: { type: "string", required: true },
316
+ data: { type: "object", required: true },
317
+ },
318
+ async execute(input, ctx) {
319
+ const p = input;
320
+ return api(getConn(ctx), "PUT", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}/items/${p.itemId}`, p.data);
321
+ },
322
+ });
323
+ rl.registerAction("checklistItem.delete", {
324
+ description: "Delete a checklist item",
325
+ inputSchema: {
326
+ boardId: { type: "string", required: true },
327
+ cardId: { type: "string", required: true },
328
+ checklistId: { type: "string", required: true },
329
+ itemId: { type: "string", required: true },
330
+ },
331
+ async execute(input, ctx) {
332
+ const p = input;
333
+ return api(getConn(ctx), "DELETE", `boards/${p.boardId}/cards/${p.cardId}/checklists/${p.checklistId}/items/${p.itemId}`);
334
+ },
335
+ });
91
336
  }
@@ -1,6 +1,10 @@
1
1
  function getConn(ctx) {
2
2
  const c = ctx.connection.config;
3
- return { url: c.url.replace(/\/$/, ""), consumerKey: c.consumerKey, consumerSecret: c.consumerSecret };
3
+ return {
4
+ url: c.url.replace(/\/$/, ""),
5
+ consumerKey: c.consumerKey,
6
+ consumerSecret: c.consumerSecret,
7
+ };
4
8
  }
5
9
  async function apiRequest(conn, method, endpoint, body, qs) {
6
10
  const url = new URL(`${conn.url}/wp-json/wc/v3${endpoint}`);
@@ -12,7 +16,10 @@ async function apiRequest(conn, method, endpoint, body, qs) {
12
16
  }
13
17
  const init = {
14
18
  method,
15
- headers: { Authorization: `Basic ${btoa(`${conn.consumerKey}:${conn.consumerSecret}`)}`, "Content-Type": "application/json" },
19
+ headers: {
20
+ Authorization: `Basic ${btoa(`${conn.consumerKey}:${conn.consumerSecret}`)}`,
21
+ "Content-Type": "application/json",
22
+ },
16
23
  };
17
24
  if (body && Object.keys(body).length > 0)
18
25
  init.body = JSON.stringify(body);
@@ -25,16 +32,24 @@ function registerCrud(rl, resource, plural, conn, createSchema) {
25
32
  rl.registerAction(`${resource}.create`, {
26
33
  description: `Create a ${resource}`,
27
34
  inputSchema: createSchema,
28
- async execute(input, ctx) { return apiRequest(conn(ctx), "POST", `/${plural}`, input); },
35
+ async execute(input, ctx) {
36
+ return apiRequest(conn(ctx), "POST", `/${plural}`, input);
37
+ },
29
38
  });
30
39
  rl.registerAction(`${resource}.get`, {
31
40
  description: `Get a ${resource} by ID`,
32
41
  inputSchema: { id: { type: "string", required: true } },
33
- async execute(input, ctx) { return apiRequest(conn(ctx), "GET", `/${plural}/${input.id}`); },
42
+ async execute(input, ctx) {
43
+ return apiRequest(conn(ctx), "GET", `/${plural}/${input.id}`);
44
+ },
34
45
  });
35
46
  rl.registerAction(`${resource}.list`, {
36
47
  description: `List ${plural}`,
37
- inputSchema: { limit: { type: "number", required: false }, search: { type: "string", required: false }, status: { type: "string", required: false } },
48
+ inputSchema: {
49
+ limit: { type: "number", required: false },
50
+ search: { type: "string", required: false },
51
+ status: { type: "string", required: false },
52
+ },
38
53
  async execute(input, ctx) {
39
54
  const p = (input ?? {});
40
55
  const qs = {};
@@ -49,7 +64,10 @@ function registerCrud(rl, resource, plural, conn, createSchema) {
49
64
  });
50
65
  rl.registerAction(`${resource}.update`, {
51
66
  description: `Update a ${resource}`,
52
- inputSchema: { id: { type: "string", required: true }, data: { type: "object", required: true } },
67
+ inputSchema: {
68
+ id: { type: "string", required: true },
69
+ data: { type: "object", required: true },
70
+ },
53
71
  async execute(input, ctx) {
54
72
  const p = input;
55
73
  return apiRequest(conn(ctx), "PUT", `/${plural}/${p.id}`, p.data);
@@ -67,21 +85,48 @@ export default function woocommerce(rl) {
67
85
  rl.setName("woocommerce");
68
86
  rl.setVersion("0.1.0");
69
87
  rl.setConnectionSchema({
70
- url: { type: "string", required: true, description: "WooCommerce store URL", env: "WOOCOMMERCE_URL" },
71
- consumerKey: { type: "string", required: true, description: "WooCommerce consumer key", env: "WOOCOMMERCE_CONSUMER_KEY" },
72
- consumerSecret: { type: "string", required: true, description: "WooCommerce consumer secret", env: "WOOCOMMERCE_CONSUMER_SECRET" },
88
+ url: {
89
+ type: "string",
90
+ required: true,
91
+ description: "WooCommerce store URL",
92
+ env: "WOOCOMMERCE_URL",
93
+ },
94
+ consumerKey: {
95
+ type: "string",
96
+ required: true,
97
+ description: "WooCommerce consumer key",
98
+ env: "WOOCOMMERCE_CONSUMER_KEY",
99
+ },
100
+ consumerSecret: {
101
+ type: "string",
102
+ required: true,
103
+ description: "WooCommerce consumer secret",
104
+ env: "WOOCOMMERCE_CONSUMER_SECRET",
105
+ },
73
106
  });
74
107
  registerCrud(rl, "product", "products", getConn, {
75
108
  name: { type: "string", required: true },
76
- type: { type: "string", required: false, description: "simple, grouped, external, variable" },
109
+ type: {
110
+ type: "string",
111
+ required: false,
112
+ description: "simple, grouped, external, variable",
113
+ },
77
114
  regular_price: { type: "string", required: false },
78
115
  description: { type: "string", required: false },
79
116
  sku: { type: "string", required: false },
80
117
  });
81
118
  registerCrud(rl, "order", "orders", getConn, {
82
- status: { type: "string", required: false, description: "pending, processing, on-hold, completed, cancelled, refunded, failed" },
119
+ status: {
120
+ type: "string",
121
+ required: false,
122
+ description: "pending, processing, on-hold, completed, cancelled, refunded, failed",
123
+ },
83
124
  customer_id: { type: "number", required: false },
84
- line_items: { type: "object", required: false, description: "Array of { product_id, quantity }" },
125
+ line_items: {
126
+ type: "object",
127
+ required: false,
128
+ description: "Array of { product_id, quantity }",
129
+ },
85
130
  payment_method: { type: "string", required: false },
86
131
  });
87
132
  registerCrud(rl, "customer", "customers", getConn, {