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.
- package/dist/plugins/actionNetwork/src/index.js +118 -25
- package/dist/plugins/activeCampaign/src/index.js +184 -38
- package/dist/plugins/adalo/src/index.js +40 -8
- package/dist/plugins/affinity/src/index.js +100 -20
- package/dist/plugins/agileCrm/src/index.js +115 -27
- package/dist/plugins/airtable/src/index.js +94 -19
- package/dist/plugins/airtop/src/index.js +266 -62
- package/dist/plugins/apiTemplateIo/src/index.js +25 -5
- package/dist/plugins/asana/src/index.js +195 -41
- package/dist/plugins/autopilot/src/index.js +39 -8
- package/dist/plugins/bambooHr/src/index.js +109 -22
- package/dist/plugins/bannerbear/src/index.js +36 -8
- package/dist/plugins/baserow/src/index.js +35 -7
- package/dist/plugins/beeminder/src/index.js +198 -40
- package/dist/plugins/bitly/src/index.js +46 -10
- package/dist/plugins/bitwarden/src/index.js +167 -36
- package/dist/plugins/box/src/index.js +172 -37
- package/dist/plugins/brandfetch/src/index.js +5 -1
- package/dist/plugins/brevo/src/index.js +136 -29
- package/dist/plugins/bubble/src/index.js +76 -17
- package/dist/plugins/chargebee/src/index.js +35 -7
- package/dist/plugins/circleci/src/index.js +50 -10
- package/dist/plugins/ciscoWebex/src/index.js +131 -27
- package/dist/plugins/clearbit/src/index.js +76 -17
- package/dist/plugins/clickup/src/index.js +500 -107
- package/dist/plugins/clockify/src/index.js +229 -47
- package/dist/plugins/cloudflare/src/index.js +28 -6
- package/dist/plugins/cockpit/src/index.js +54 -12
- package/dist/plugins/coda/src/index.js +81 -19
- package/dist/plugins/coingecko/src/index.js +157 -33
- package/dist/plugins/contentful/src/index.js +85 -17
- package/dist/plugins/convertkit/src/index.js +74 -18
- package/dist/plugins/copper/src/index.js +59 -11
- package/dist/plugins/cortex/src/index.js +55 -13
- package/dist/plugins/currents/src/index.js +310 -71
- package/dist/plugins/customerIo/src/index.js +112 -23
- package/dist/plugins/databricks/src/index.js +549 -115
- package/dist/plugins/deepl/src/index.js +26 -6
- package/dist/plugins/demio/src/index.js +56 -11
- package/dist/plugins/dhl/src/index.js +16 -3
- package/dist/plugins/discord/src/index.js +141 -31
- package/dist/plugins/discourse/src/index.js +136 -31
- package/dist/plugins/disqus/src/index.js +96 -20
- package/dist/plugins/docker/src/index.js +20 -4
- package/dist/plugins/drift/src/index.js +19 -5
- package/dist/plugins/dropbox/src/index.js +139 -30
- package/dist/plugins/dropcontact/src/index.js +21 -4
- package/dist/plugins/egoi/src/index.js +61 -15
- package/dist/plugins/elasticsearch/src/index.js +59 -13
- package/dist/plugins/emelia/src/index.js +95 -19
- package/dist/plugins/erpnext/src/index.js +74 -15
- package/dist/plugins/facebookGraph/src/index.js +52 -11
- package/dist/plugins/freshdesk/src/index.js +220 -48
- package/dist/plugins/freshservice/src/index.js +39 -9
- package/dist/plugins/freshworksCrm/src/index.js +58 -12
- package/dist/plugins/getresponse/src/index.js +87 -18
- package/dist/plugins/ghost/src/index.js +114 -26
- package/dist/plugins/github/src/index.js +483 -109
- package/dist/plugins/gitlab/src/index.js +193 -45
- package/dist/plugins/gong/src/index.js +68 -14
- package/dist/plugins/gotify/src/index.js +43 -9
- package/dist/plugins/gotowebinar/src/index.js +233 -47
- package/dist/plugins/grafana/src/index.js +92 -21
- package/dist/plugins/graphql/src/index.js +38 -8
- package/dist/plugins/grist/src/index.js +52 -10
- package/dist/plugins/hackernews/src/index.js +32 -6
- package/dist/plugins/halopsa/src/index.js +131 -26
- package/dist/plugins/harvest/src/index.js +182 -42
- package/dist/plugins/helpscout/src/index.js +153 -31
- package/dist/plugins/highlevel/src/index.js +291 -58
- package/dist/plugins/homeAssistant/src/index.js +124 -26
- package/dist/plugins/hubspot/src/index.js +163 -29
- package/dist/plugins/humanticAi/src/index.js +54 -5
- package/dist/plugins/hunter/src/index.js +21 -4
- package/dist/plugins/intercom/src/index.js +95 -20
- package/dist/plugins/iterable/src/index.js +96 -20
- package/dist/plugins/jenkins/src/index.js +75 -17
- package/dist/plugins/jira/src/index.js +193 -43
- package/dist/plugins/keap/src/index.js +222 -56
- package/dist/plugins/kobotoolbox/src/index.js +113 -25
- package/dist/plugins/lemlist/src/index.js +79 -18
- package/dist/plugins/linear/src/index.js +86 -19
- package/dist/plugins/lingvanex/src/index.js +38 -8
- package/dist/plugins/linkedin/src/index.js +37 -8
- package/dist/plugins/lonescale/src/index.js +41 -9
- package/dist/plugins/magento/src/index.js +98 -27
- package/dist/plugins/mailcheck/src/index.js +11 -2
- package/dist/plugins/mailchimp/src/index.js +193 -42
- package/dist/plugins/mailerlite/src/index.js +61 -12
- package/dist/plugins/mailgun/src/index.js +39 -7
- package/dist/plugins/mailjet/src/index.js +141 -30
- package/dist/plugins/mandrill/src/index.js +67 -14
- package/dist/plugins/marketstack/src/index.js +56 -10
- package/dist/plugins/matrix/src/index.js +97 -20
- package/dist/plugins/mattermost/src/index.js +124 -26
- package/dist/plugins/mautic/src/index.js +129 -26
- package/dist/plugins/medium/src/index.js +64 -13
- package/dist/plugins/messagebird/src/index.js +80 -15
- package/dist/plugins/metabase/src/index.js +57 -12
- package/dist/plugins/misp/src/index.js +135 -33
- package/dist/plugins/mocean/src/index.js +33 -7
- package/dist/plugins/monday/src/index.js +97 -23
- package/dist/plugins/monicaCrm/src/index.js +112 -23
- package/dist/plugins/msg91/src/index.js +11 -2
- package/dist/plugins/nasa/src/index.js +108 -21
- package/dist/plugins/netlify/src/index.js +28 -6
- package/dist/plugins/netscalerAdc/src/index.js +144 -29
- package/dist/plugins/nextcloud/src/index.js +103 -20
- package/dist/plugins/nocodb/src/index.js +57 -11
- package/dist/plugins/notion/src/index.js +148 -37
- package/dist/plugins/npm/src/index.js +59 -12
- package/dist/plugins/odoo/src/index.js +102 -20
- package/dist/plugins/okta/src/index.js +50 -10
- package/dist/plugins/oneSimpleApi/src/index.js +84 -17
- package/dist/plugins/onfleet/src/index.js +139 -32
- package/dist/plugins/openThesaurus/src/index.js +46 -9
- package/dist/plugins/openweathermap/src/index.js +31 -6
- package/dist/plugins/oura/src/index.js +36 -7
- package/dist/plugins/paddle/src/index.js +80 -17
- package/dist/plugins/pagerduty/src/index.js +53 -12
- package/dist/plugins/paypal/src/index.js +51 -11
- package/dist/plugins/peekalink/src/index.js +12 -3
- package/dist/plugins/phantombuster/src/index.js +39 -8
- package/dist/plugins/philipsHue/src/index.js +64 -13
- package/dist/plugins/pipedrive/src/index.js +167 -45
- package/dist/plugins/plivo/src/index.js +43 -8
- package/dist/plugins/postbin/src/index.js +9 -2
- package/dist/plugins/posthog/src/index.js +50 -13
- package/dist/plugins/profitwell/src/index.js +24 -5
- package/dist/plugins/pushbullet/src/index.js +45 -9
- package/dist/plugins/pushcut/src/index.js +31 -6
- package/dist/plugins/pushover/src/index.js +51 -10
- package/dist/plugins/quickbase/src/index.js +66 -13
- package/dist/plugins/quickbooks/src/index.js +86 -19
- package/dist/plugins/quickchart/src/index.js +35 -7
- package/dist/plugins/raindrop/src/index.js +54 -13
- package/dist/plugins/reddit/src/index.js +73 -18
- package/dist/plugins/rocketchat/src/index.js +47 -9
- package/dist/plugins/rundeck/src/index.js +26 -5
- package/dist/plugins/salesforce/src/index.js +161 -31
- package/dist/plugins/salesmate/src/index.js +75 -16
- package/dist/plugins/securityScorecard/src/index.js +73 -15
- package/dist/plugins/segment/src/index.js +21 -4
- package/dist/plugins/sendgrid/src/index.js +102 -24
- package/dist/plugins/sendy/src/index.js +54 -11
- package/dist/plugins/sentry/src/index.js +174 -34
- package/dist/plugins/servicenow/src/index.js +120 -27
- package/dist/plugins/shopify/src/index.js +53 -12
- package/dist/plugins/signl4/src/index.js +16 -3
- package/dist/plugins/slack/src/index.js +407 -105
- package/dist/plugins/sms77/src/index.js +26 -5
- package/dist/plugins/splunk/src/index.js +186 -45
- package/dist/plugins/spotify/src/index.js +265 -66
- package/dist/plugins/stackby/src/index.js +18 -6
- package/dist/plugins/storyblok/src/index.js +57 -11
- package/dist/plugins/strapi/src/index.js +63 -12
- package/dist/plugins/strava/src/index.js +58 -13
- package/dist/plugins/stripe/src/index.js +143 -30
- package/dist/plugins/supabase/src/index.js +49 -10
- package/dist/plugins/syncromsp/src/index.js +245 -67
- package/dist/plugins/tapfiliate/src/index.js +57 -14
- package/dist/plugins/telegram/src/index.js +202 -39
- package/dist/plugins/thehive/src/index.js +271 -66
- package/dist/plugins/thehiveProject/src/index.js +457 -89
- package/dist/plugins/todoist/src/index.js +326 -77
- package/dist/plugins/travisci/src/index.js +35 -8
- package/dist/plugins/trello/src/index.js +204 -46
- package/dist/plugins/twake/src/index.js +10 -2
- package/dist/plugins/twilio/src/index.js +56 -11
- package/dist/plugins/twist/src/index.js +241 -48
- package/dist/plugins/twitter/src/index.js +128 -30
- package/dist/plugins/unleashedSoftware/src/index.js +30 -6
- package/dist/plugins/uplead/src/index.js +9 -2
- package/dist/plugins/uproc/src/index.js +31 -6
- package/dist/plugins/uptimerobot/src/index.js +119 -25
- package/dist/plugins/urlscanio/src/index.js +25 -6
- package/dist/plugins/vero/src/index.js +68 -13
- package/dist/plugins/vonage/src/index.js +32 -6
- package/dist/plugins/wekan/src/index.js +297 -52
- package/dist/plugins/woocommerce/src/index.js +57 -12
- package/dist/plugins/wordpress/src/index.js +94 -18
- package/dist/plugins/xero/src/index.js +79 -13
- package/dist/plugins/yourls/src/index.js +33 -6
- package/dist/plugins/zammad/src/index.js +139 -36
- package/dist/plugins/zendesk/src/index.js +201 -48
- package/dist/plugins/zoho/src/index.js +88 -21
- package/dist/plugins/zoom/src/index.js +41 -7
- package/dist/plugins/zulip/src/index.js +101 -20
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const BASE = "https://api.trello.com/1";
|
|
2
2
|
function getConn(ctx) {
|
|
3
|
-
return {
|
|
3
|
+
return {
|
|
4
|
+
apiKey: ctx.connection.config.apiKey,
|
|
5
|
+
token: ctx.connection.config.token,
|
|
6
|
+
};
|
|
4
7
|
}
|
|
5
8
|
async function apiRequest(conn, method, endpoint, body, qs) {
|
|
6
9
|
const url = new URL(`${BASE}/${endpoint}`);
|
|
@@ -12,7 +15,10 @@ async function apiRequest(conn, method, endpoint, body, qs) {
|
|
|
12
15
|
url.searchParams.set(k, String(v));
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
|
-
const init = {
|
|
18
|
+
const init = {
|
|
19
|
+
method,
|
|
20
|
+
headers: { "Content-Type": "application/json" },
|
|
21
|
+
};
|
|
16
22
|
if (body && Object.keys(body).length > 0 && method !== "GET")
|
|
17
23
|
init.body = JSON.stringify(body);
|
|
18
24
|
const res = await fetch(url.toString(), init);
|
|
@@ -25,26 +31,49 @@ export default function trello(rl) {
|
|
|
25
31
|
rl.setName("trello");
|
|
26
32
|
rl.setVersion("0.1.0");
|
|
27
33
|
rl.setConnectionSchema({
|
|
28
|
-
apiKey: {
|
|
29
|
-
|
|
34
|
+
apiKey: {
|
|
35
|
+
type: "string",
|
|
36
|
+
required: true,
|
|
37
|
+
description: "Trello API key",
|
|
38
|
+
env: "TRELLO_API_KEY",
|
|
39
|
+
},
|
|
40
|
+
token: {
|
|
41
|
+
type: "string",
|
|
42
|
+
required: true,
|
|
43
|
+
description: "Trello API token",
|
|
44
|
+
env: "TRELLO_TOKEN",
|
|
45
|
+
},
|
|
30
46
|
});
|
|
31
47
|
// ── Board ───────────────────────────────────────────
|
|
32
48
|
rl.registerAction("board.create", {
|
|
33
49
|
description: "Create a board",
|
|
34
|
-
inputSchema: {
|
|
50
|
+
inputSchema: {
|
|
51
|
+
name: { type: "string", required: true },
|
|
52
|
+
description: { type: "string", required: false },
|
|
53
|
+
},
|
|
35
54
|
async execute(input, ctx) {
|
|
36
55
|
const p = input;
|
|
37
|
-
return apiRequest(getConn(ctx), "POST", "boards", {
|
|
56
|
+
return apiRequest(getConn(ctx), "POST", "boards", {
|
|
57
|
+
name: p.name,
|
|
58
|
+
desc: p.description,
|
|
59
|
+
});
|
|
38
60
|
},
|
|
39
61
|
});
|
|
40
62
|
rl.registerAction("board.get", {
|
|
41
63
|
description: "Get a board by ID",
|
|
42
64
|
inputSchema: { id: { type: "string", required: true } },
|
|
43
|
-
async execute(input, ctx) {
|
|
65
|
+
async execute(input, ctx) {
|
|
66
|
+
return apiRequest(getConn(ctx), "GET", `boards/${input.id}`);
|
|
67
|
+
},
|
|
44
68
|
});
|
|
45
69
|
rl.registerAction("board.update", {
|
|
46
70
|
description: "Update a board",
|
|
47
|
-
inputSchema: {
|
|
71
|
+
inputSchema: {
|
|
72
|
+
id: { type: "string", required: true },
|
|
73
|
+
name: { type: "string", required: false },
|
|
74
|
+
description: { type: "string", required: false },
|
|
75
|
+
closed: { type: "boolean", required: false },
|
|
76
|
+
},
|
|
48
77
|
async execute(input, ctx) {
|
|
49
78
|
const { id, ...fields } = input;
|
|
50
79
|
const qs = {};
|
|
@@ -60,12 +89,17 @@ export default function trello(rl) {
|
|
|
60
89
|
rl.registerAction("board.delete", {
|
|
61
90
|
description: "Delete a board",
|
|
62
91
|
inputSchema: { id: { type: "string", required: true } },
|
|
63
|
-
async execute(input, ctx) {
|
|
92
|
+
async execute(input, ctx) {
|
|
93
|
+
return apiRequest(getConn(ctx), "DELETE", `boards/${input.id}`);
|
|
94
|
+
},
|
|
64
95
|
});
|
|
65
96
|
// ── Board Member ────────────────────────────────────
|
|
66
97
|
rl.registerAction("boardMember.list", {
|
|
67
98
|
description: "List members of a board",
|
|
68
|
-
inputSchema: {
|
|
99
|
+
inputSchema: {
|
|
100
|
+
boardId: { type: "string", required: true },
|
|
101
|
+
limit: { type: "number", required: false },
|
|
102
|
+
},
|
|
69
103
|
async execute(input, ctx) {
|
|
70
104
|
const p = (input ?? {});
|
|
71
105
|
const data = (await apiRequest(getConn(ctx), "GET", `boards/${p.boardId}/members`));
|
|
@@ -74,7 +108,15 @@ export default function trello(rl) {
|
|
|
74
108
|
});
|
|
75
109
|
rl.registerAction("boardMember.add", {
|
|
76
110
|
description: "Add a member to a board",
|
|
77
|
-
inputSchema: {
|
|
111
|
+
inputSchema: {
|
|
112
|
+
boardId: { type: "string", required: true },
|
|
113
|
+
memberId: { type: "string", required: true },
|
|
114
|
+
type: {
|
|
115
|
+
type: "string",
|
|
116
|
+
required: true,
|
|
117
|
+
description: "admin, normal, or observer",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
78
120
|
async execute(input, ctx) {
|
|
79
121
|
const p = input;
|
|
80
122
|
return apiRequest(getConn(ctx), "PUT", `boards/${p.boardId}/members/${p.memberId}`, undefined, { type: p.type });
|
|
@@ -82,7 +124,10 @@ export default function trello(rl) {
|
|
|
82
124
|
});
|
|
83
125
|
rl.registerAction("boardMember.remove", {
|
|
84
126
|
description: "Remove a member from a board",
|
|
85
|
-
inputSchema: {
|
|
127
|
+
inputSchema: {
|
|
128
|
+
boardId: { type: "string", required: true },
|
|
129
|
+
memberId: { type: "string", required: true },
|
|
130
|
+
},
|
|
86
131
|
async execute(input, ctx) {
|
|
87
132
|
const p = input;
|
|
88
133
|
return apiRequest(getConn(ctx), "DELETE", `boards/${p.boardId}/members/${p.memberId}`);
|
|
@@ -91,7 +136,12 @@ export default function trello(rl) {
|
|
|
91
136
|
// ── Card ────────────────────────────────────────────
|
|
92
137
|
rl.registerAction("card.create", {
|
|
93
138
|
description: "Create a card",
|
|
94
|
-
inputSchema: {
|
|
139
|
+
inputSchema: {
|
|
140
|
+
listId: { type: "string", required: true },
|
|
141
|
+
name: { type: "string", required: true },
|
|
142
|
+
description: { type: "string", required: false },
|
|
143
|
+
due: { type: "string", required: false },
|
|
144
|
+
},
|
|
95
145
|
async execute(input, ctx) {
|
|
96
146
|
const p = input;
|
|
97
147
|
const body = { idList: p.listId, name: p.name };
|
|
@@ -105,11 +155,20 @@ export default function trello(rl) {
|
|
|
105
155
|
rl.registerAction("card.get", {
|
|
106
156
|
description: "Get a card by ID",
|
|
107
157
|
inputSchema: { id: { type: "string", required: true } },
|
|
108
|
-
async execute(input, ctx) {
|
|
158
|
+
async execute(input, ctx) {
|
|
159
|
+
return apiRequest(getConn(ctx), "GET", `cards/${input.id}`);
|
|
160
|
+
},
|
|
109
161
|
});
|
|
110
162
|
rl.registerAction("card.update", {
|
|
111
163
|
description: "Update a card",
|
|
112
|
-
inputSchema: {
|
|
164
|
+
inputSchema: {
|
|
165
|
+
id: { type: "string", required: true },
|
|
166
|
+
name: { type: "string", required: false },
|
|
167
|
+
description: { type: "string", required: false },
|
|
168
|
+
closed: { type: "boolean", required: false },
|
|
169
|
+
idList: { type: "string", required: false },
|
|
170
|
+
due: { type: "string", required: false },
|
|
171
|
+
},
|
|
113
172
|
async execute(input, ctx) {
|
|
114
173
|
const { id, ...fields } = input;
|
|
115
174
|
const qs = {};
|
|
@@ -129,12 +188,17 @@ export default function trello(rl) {
|
|
|
129
188
|
rl.registerAction("card.delete", {
|
|
130
189
|
description: "Delete a card",
|
|
131
190
|
inputSchema: { id: { type: "string", required: true } },
|
|
132
|
-
async execute(input, ctx) {
|
|
191
|
+
async execute(input, ctx) {
|
|
192
|
+
return apiRequest(getConn(ctx), "DELETE", `cards/${input.id}`);
|
|
193
|
+
},
|
|
133
194
|
});
|
|
134
195
|
// ── Card Comment ────────────────────────────────────
|
|
135
196
|
rl.registerAction("cardComment.create", {
|
|
136
197
|
description: "Add a comment to a card",
|
|
137
|
-
inputSchema: {
|
|
198
|
+
inputSchema: {
|
|
199
|
+
cardId: { type: "string", required: true },
|
|
200
|
+
text: { type: "string", required: true },
|
|
201
|
+
},
|
|
138
202
|
async execute(input, ctx) {
|
|
139
203
|
const p = input;
|
|
140
204
|
return apiRequest(getConn(ctx), "POST", `cards/${p.cardId}/actions/comments`, { text: p.text });
|
|
@@ -142,7 +206,11 @@ export default function trello(rl) {
|
|
|
142
206
|
});
|
|
143
207
|
rl.registerAction("cardComment.update", {
|
|
144
208
|
description: "Update a comment on a card",
|
|
145
|
-
inputSchema: {
|
|
209
|
+
inputSchema: {
|
|
210
|
+
cardId: { type: "string", required: true },
|
|
211
|
+
commentId: { type: "string", required: true },
|
|
212
|
+
text: { type: "string", required: true },
|
|
213
|
+
},
|
|
146
214
|
async execute(input, ctx) {
|
|
147
215
|
const p = input;
|
|
148
216
|
return apiRequest(getConn(ctx), "PUT", `cards/${p.cardId}/actions/${p.commentId}/comments`, undefined, { text: p.text });
|
|
@@ -150,7 +218,10 @@ export default function trello(rl) {
|
|
|
150
218
|
});
|
|
151
219
|
rl.registerAction("cardComment.delete", {
|
|
152
220
|
description: "Delete a comment from a card",
|
|
153
|
-
inputSchema: {
|
|
221
|
+
inputSchema: {
|
|
222
|
+
cardId: { type: "string", required: true },
|
|
223
|
+
commentId: { type: "string", required: true },
|
|
224
|
+
},
|
|
154
225
|
async execute(input, ctx) {
|
|
155
226
|
const p = input;
|
|
156
227
|
return apiRequest(getConn(ctx), "DELETE", `cards/${p.cardId}/actions/${p.commentId}/comments`);
|
|
@@ -159,20 +230,31 @@ export default function trello(rl) {
|
|
|
159
230
|
// ── List ────────────────────────────────────────────
|
|
160
231
|
rl.registerAction("list.create", {
|
|
161
232
|
description: "Create a list on a board",
|
|
162
|
-
inputSchema: {
|
|
233
|
+
inputSchema: {
|
|
234
|
+
boardId: { type: "string", required: true },
|
|
235
|
+
name: { type: "string", required: true },
|
|
236
|
+
},
|
|
163
237
|
async execute(input, ctx) {
|
|
164
238
|
const p = input;
|
|
165
|
-
return apiRequest(getConn(ctx), "POST", "lists", {
|
|
239
|
+
return apiRequest(getConn(ctx), "POST", "lists", {
|
|
240
|
+
idBoard: p.boardId,
|
|
241
|
+
name: p.name,
|
|
242
|
+
});
|
|
166
243
|
},
|
|
167
244
|
});
|
|
168
245
|
rl.registerAction("list.get", {
|
|
169
246
|
description: "Get a list by ID",
|
|
170
247
|
inputSchema: { id: { type: "string", required: true } },
|
|
171
|
-
async execute(input, ctx) {
|
|
248
|
+
async execute(input, ctx) {
|
|
249
|
+
return apiRequest(getConn(ctx), "GET", `lists/${input.id}`);
|
|
250
|
+
},
|
|
172
251
|
});
|
|
173
252
|
rl.registerAction("list.listAll", {
|
|
174
253
|
description: "List all lists on a board",
|
|
175
|
-
inputSchema: {
|
|
254
|
+
inputSchema: {
|
|
255
|
+
boardId: { type: "string", required: true },
|
|
256
|
+
limit: { type: "number", required: false },
|
|
257
|
+
},
|
|
176
258
|
async execute(input, ctx) {
|
|
177
259
|
const p = (input ?? {});
|
|
178
260
|
const data = (await apiRequest(getConn(ctx), "GET", `boards/${p.boardId}/lists`));
|
|
@@ -181,7 +263,10 @@ export default function trello(rl) {
|
|
|
181
263
|
});
|
|
182
264
|
rl.registerAction("list.getCards", {
|
|
183
265
|
description: "Get cards in a list",
|
|
184
|
-
inputSchema: {
|
|
266
|
+
inputSchema: {
|
|
267
|
+
listId: { type: "string", required: true },
|
|
268
|
+
limit: { type: "number", required: false },
|
|
269
|
+
},
|
|
185
270
|
async execute(input, ctx) {
|
|
186
271
|
const p = (input ?? {});
|
|
187
272
|
const data = (await apiRequest(getConn(ctx), "GET", `lists/${p.listId}/cards`));
|
|
@@ -190,7 +275,11 @@ export default function trello(rl) {
|
|
|
190
275
|
});
|
|
191
276
|
rl.registerAction("list.update", {
|
|
192
277
|
description: "Update a list",
|
|
193
|
-
inputSchema: {
|
|
278
|
+
inputSchema: {
|
|
279
|
+
id: { type: "string", required: true },
|
|
280
|
+
name: { type: "string", required: false },
|
|
281
|
+
closed: { type: "boolean", required: false },
|
|
282
|
+
},
|
|
194
283
|
async execute(input, ctx) {
|
|
195
284
|
const { id, ...fields } = input;
|
|
196
285
|
const qs = {};
|
|
@@ -204,7 +293,11 @@ export default function trello(rl) {
|
|
|
204
293
|
// ── Attachment ──────────────────────────────────────
|
|
205
294
|
rl.registerAction("attachment.create", {
|
|
206
295
|
description: "Add a URL attachment to a card",
|
|
207
|
-
inputSchema: {
|
|
296
|
+
inputSchema: {
|
|
297
|
+
cardId: { type: "string", required: true },
|
|
298
|
+
url: { type: "string", required: true },
|
|
299
|
+
name: { type: "string", required: false },
|
|
300
|
+
},
|
|
208
301
|
async execute(input, ctx) {
|
|
209
302
|
const p = input;
|
|
210
303
|
const body = { url: p.url };
|
|
@@ -215,7 +308,10 @@ export default function trello(rl) {
|
|
|
215
308
|
});
|
|
216
309
|
rl.registerAction("attachment.get", {
|
|
217
310
|
description: "Get an attachment",
|
|
218
|
-
inputSchema: {
|
|
311
|
+
inputSchema: {
|
|
312
|
+
cardId: { type: "string", required: true },
|
|
313
|
+
id: { type: "string", required: true },
|
|
314
|
+
},
|
|
219
315
|
async execute(input, ctx) {
|
|
220
316
|
const p = input;
|
|
221
317
|
return apiRequest(getConn(ctx), "GET", `cards/${p.cardId}/attachments/${p.id}`);
|
|
@@ -224,11 +320,16 @@ export default function trello(rl) {
|
|
|
224
320
|
rl.registerAction("attachment.list", {
|
|
225
321
|
description: "List attachments on a card",
|
|
226
322
|
inputSchema: { cardId: { type: "string", required: true } },
|
|
227
|
-
async execute(input, ctx) {
|
|
323
|
+
async execute(input, ctx) {
|
|
324
|
+
return apiRequest(getConn(ctx), "GET", `cards/${input.cardId}/attachments`);
|
|
325
|
+
},
|
|
228
326
|
});
|
|
229
327
|
rl.registerAction("attachment.delete", {
|
|
230
328
|
description: "Delete an attachment from a card",
|
|
231
|
-
inputSchema: {
|
|
329
|
+
inputSchema: {
|
|
330
|
+
cardId: { type: "string", required: true },
|
|
331
|
+
id: { type: "string", required: true },
|
|
332
|
+
},
|
|
232
333
|
async execute(input, ctx) {
|
|
233
334
|
const p = input;
|
|
234
335
|
return apiRequest(getConn(ctx), "DELETE", `cards/${p.cardId}/attachments/${p.id}`);
|
|
@@ -237,25 +338,37 @@ export default function trello(rl) {
|
|
|
237
338
|
// ── Checklist ───────────────────────────────────────
|
|
238
339
|
rl.registerAction("checklist.create", {
|
|
239
340
|
description: "Create a checklist on a card",
|
|
240
|
-
inputSchema: {
|
|
341
|
+
inputSchema: {
|
|
342
|
+
cardId: { type: "string", required: true },
|
|
343
|
+
name: { type: "string", required: true },
|
|
344
|
+
},
|
|
241
345
|
async execute(input, ctx) {
|
|
242
346
|
const p = input;
|
|
243
|
-
return apiRequest(getConn(ctx), "POST", `cards/${p.cardId}/checklists`, {
|
|
347
|
+
return apiRequest(getConn(ctx), "POST", `cards/${p.cardId}/checklists`, {
|
|
348
|
+
name: p.name,
|
|
349
|
+
});
|
|
244
350
|
},
|
|
245
351
|
});
|
|
246
352
|
rl.registerAction("checklist.get", {
|
|
247
353
|
description: "Get a checklist by ID",
|
|
248
354
|
inputSchema: { id: { type: "string", required: true } },
|
|
249
|
-
async execute(input, ctx) {
|
|
355
|
+
async execute(input, ctx) {
|
|
356
|
+
return apiRequest(getConn(ctx), "GET", `checklists/${input.id}`);
|
|
357
|
+
},
|
|
250
358
|
});
|
|
251
359
|
rl.registerAction("checklist.list", {
|
|
252
360
|
description: "List checklists on a card",
|
|
253
361
|
inputSchema: { cardId: { type: "string", required: true } },
|
|
254
|
-
async execute(input, ctx) {
|
|
362
|
+
async execute(input, ctx) {
|
|
363
|
+
return apiRequest(getConn(ctx), "GET", `cards/${input.cardId}/checklists`);
|
|
364
|
+
},
|
|
255
365
|
});
|
|
256
366
|
rl.registerAction("checklist.delete", {
|
|
257
367
|
description: "Delete a checklist from a card",
|
|
258
|
-
inputSchema: {
|
|
368
|
+
inputSchema: {
|
|
369
|
+
cardId: { type: "string", required: true },
|
|
370
|
+
id: { type: "string", required: true },
|
|
371
|
+
},
|
|
259
372
|
async execute(input, ctx) {
|
|
260
373
|
const p = input;
|
|
261
374
|
return apiRequest(getConn(ctx), "DELETE", `cards/${p.cardId}/checklists/${p.id}`);
|
|
@@ -263,7 +376,10 @@ export default function trello(rl) {
|
|
|
263
376
|
});
|
|
264
377
|
rl.registerAction("checklist.createItem", {
|
|
265
378
|
description: "Create a check item in a checklist",
|
|
266
|
-
inputSchema: {
|
|
379
|
+
inputSchema: {
|
|
380
|
+
checklistId: { type: "string", required: true },
|
|
381
|
+
name: { type: "string", required: true },
|
|
382
|
+
},
|
|
267
383
|
async execute(input, ctx) {
|
|
268
384
|
const p = input;
|
|
269
385
|
return apiRequest(getConn(ctx), "POST", `checklists/${p.checklistId}/checkItems`, { name: p.name });
|
|
@@ -271,7 +387,16 @@ export default function trello(rl) {
|
|
|
271
387
|
});
|
|
272
388
|
rl.registerAction("checklist.updateItem", {
|
|
273
389
|
description: "Update a check item on a card",
|
|
274
|
-
inputSchema: {
|
|
390
|
+
inputSchema: {
|
|
391
|
+
cardId: { type: "string", required: true },
|
|
392
|
+
checkItemId: { type: "string", required: true },
|
|
393
|
+
state: {
|
|
394
|
+
type: "string",
|
|
395
|
+
required: false,
|
|
396
|
+
description: "complete or incomplete",
|
|
397
|
+
},
|
|
398
|
+
name: { type: "string", required: false },
|
|
399
|
+
},
|
|
275
400
|
async execute(input, ctx) {
|
|
276
401
|
const p = input;
|
|
277
402
|
const qs = {};
|
|
@@ -284,7 +409,10 @@ export default function trello(rl) {
|
|
|
284
409
|
});
|
|
285
410
|
rl.registerAction("checklist.deleteItem", {
|
|
286
411
|
description: "Delete a check item from a card",
|
|
287
|
-
inputSchema: {
|
|
412
|
+
inputSchema: {
|
|
413
|
+
cardId: { type: "string", required: true },
|
|
414
|
+
checkItemId: { type: "string", required: true },
|
|
415
|
+
},
|
|
288
416
|
async execute(input, ctx) {
|
|
289
417
|
const p = input;
|
|
290
418
|
return apiRequest(getConn(ctx), "DELETE", `cards/${p.cardId}/checkItem/${p.checkItemId}`);
|
|
@@ -293,25 +421,45 @@ export default function trello(rl) {
|
|
|
293
421
|
// ── Label ───────────────────────────────────────────
|
|
294
422
|
rl.registerAction("label.create", {
|
|
295
423
|
description: "Create a label on a board",
|
|
296
|
-
inputSchema: {
|
|
424
|
+
inputSchema: {
|
|
425
|
+
boardId: { type: "string", required: true },
|
|
426
|
+
name: { type: "string", required: true },
|
|
427
|
+
color: {
|
|
428
|
+
type: "string",
|
|
429
|
+
required: true,
|
|
430
|
+
description: "green, yellow, orange, red, purple, blue, sky, lime, pink, black, null",
|
|
431
|
+
},
|
|
432
|
+
},
|
|
297
433
|
async execute(input, ctx) {
|
|
298
434
|
const p = input;
|
|
299
|
-
return apiRequest(getConn(ctx), "POST", "labels", {
|
|
435
|
+
return apiRequest(getConn(ctx), "POST", "labels", {
|
|
436
|
+
idBoard: p.boardId,
|
|
437
|
+
name: p.name,
|
|
438
|
+
color: p.color,
|
|
439
|
+
});
|
|
300
440
|
},
|
|
301
441
|
});
|
|
302
442
|
rl.registerAction("label.get", {
|
|
303
443
|
description: "Get a label by ID",
|
|
304
444
|
inputSchema: { id: { type: "string", required: true } },
|
|
305
|
-
async execute(input, ctx) {
|
|
445
|
+
async execute(input, ctx) {
|
|
446
|
+
return apiRequest(getConn(ctx), "GET", `labels/${input.id}`);
|
|
447
|
+
},
|
|
306
448
|
});
|
|
307
449
|
rl.registerAction("label.list", {
|
|
308
450
|
description: "List labels on a board",
|
|
309
451
|
inputSchema: { boardId: { type: "string", required: true } },
|
|
310
|
-
async execute(input, ctx) {
|
|
452
|
+
async execute(input, ctx) {
|
|
453
|
+
return apiRequest(getConn(ctx), "GET", `board/${input.boardId}/labels`);
|
|
454
|
+
},
|
|
311
455
|
});
|
|
312
456
|
rl.registerAction("label.update", {
|
|
313
457
|
description: "Update a label",
|
|
314
|
-
inputSchema: {
|
|
458
|
+
inputSchema: {
|
|
459
|
+
id: { type: "string", required: true },
|
|
460
|
+
name: { type: "string", required: false },
|
|
461
|
+
color: { type: "string", required: false },
|
|
462
|
+
},
|
|
315
463
|
async execute(input, ctx) {
|
|
316
464
|
const { id, ...fields } = input;
|
|
317
465
|
return apiRequest(getConn(ctx), "PUT", `labels/${id}`, undefined, fields);
|
|
@@ -320,19 +468,29 @@ export default function trello(rl) {
|
|
|
320
468
|
rl.registerAction("label.delete", {
|
|
321
469
|
description: "Delete a label",
|
|
322
470
|
inputSchema: { id: { type: "string", required: true } },
|
|
323
|
-
async execute(input, ctx) {
|
|
471
|
+
async execute(input, ctx) {
|
|
472
|
+
return apiRequest(getConn(ctx), "DELETE", `labels/${input.id}`);
|
|
473
|
+
},
|
|
324
474
|
});
|
|
325
475
|
rl.registerAction("label.addToCard", {
|
|
326
476
|
description: "Add a label to a card",
|
|
327
|
-
inputSchema: {
|
|
477
|
+
inputSchema: {
|
|
478
|
+
cardId: { type: "string", required: true },
|
|
479
|
+
labelId: { type: "string", required: true },
|
|
480
|
+
},
|
|
328
481
|
async execute(input, ctx) {
|
|
329
482
|
const p = input;
|
|
330
|
-
return apiRequest(getConn(ctx), "POST", `cards/${p.cardId}/idLabels`, {
|
|
483
|
+
return apiRequest(getConn(ctx), "POST", `cards/${p.cardId}/idLabels`, {
|
|
484
|
+
value: p.labelId,
|
|
485
|
+
});
|
|
331
486
|
},
|
|
332
487
|
});
|
|
333
488
|
rl.registerAction("label.removeFromCard", {
|
|
334
489
|
description: "Remove a label from a card",
|
|
335
|
-
inputSchema: {
|
|
490
|
+
inputSchema: {
|
|
491
|
+
cardId: { type: "string", required: true },
|
|
492
|
+
labelId: { type: "string", required: true },
|
|
493
|
+
},
|
|
336
494
|
async execute(input, ctx) {
|
|
337
495
|
const p = input;
|
|
338
496
|
return apiRequest(getConn(ctx), "DELETE", `cards/${p.cardId}/idLabels/${p.labelId}`);
|
|
@@ -2,7 +2,12 @@ export default function twake(rl) {
|
|
|
2
2
|
rl.setName("twake");
|
|
3
3
|
rl.setVersion("0.1.0");
|
|
4
4
|
rl.setConnectionSchema({
|
|
5
|
-
apiKey: {
|
|
5
|
+
apiKey: {
|
|
6
|
+
type: "string",
|
|
7
|
+
required: true,
|
|
8
|
+
description: "Twake workspace API key",
|
|
9
|
+
env: "TWAKE_API_KEY",
|
|
10
|
+
},
|
|
6
11
|
});
|
|
7
12
|
rl.registerAction("message.send", {
|
|
8
13
|
description: "Send a message to a Twake channel",
|
|
@@ -28,7 +33,10 @@ export default function twake(rl) {
|
|
|
28
33
|
};
|
|
29
34
|
const res = await fetch("https://plugins.twake.app/plugins/runline/actions/message/save", {
|
|
30
35
|
method: "POST",
|
|
31
|
-
headers: {
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${ctx.connection.config.apiKey}`,
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
},
|
|
32
40
|
body: JSON.stringify(body),
|
|
33
41
|
});
|
|
34
42
|
if (!res.ok)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
function getConn(ctx) {
|
|
2
2
|
const c = ctx.connection.config;
|
|
3
|
-
return {
|
|
3
|
+
return {
|
|
4
|
+
accountSid: c.accountSid,
|
|
5
|
+
authToken: c.authToken,
|
|
6
|
+
};
|
|
4
7
|
}
|
|
5
8
|
async function apiRequest(conn, method, endpoint, body) {
|
|
6
9
|
const url = `https://api.twilio.com/2010-04-01/Accounts/${conn.accountSid}${endpoint}`;
|
|
@@ -22,22 +25,50 @@ async function apiRequest(conn, method, endpoint, body) {
|
|
|
22
25
|
return res.json();
|
|
23
26
|
}
|
|
24
27
|
function escapeXml(str) {
|
|
25
|
-
return str.replace(/[<>&"']/g, (ch) => ({
|
|
28
|
+
return str.replace(/[<>&"']/g, (ch) => ({
|
|
29
|
+
"<": "<",
|
|
30
|
+
">": ">",
|
|
31
|
+
"&": "&",
|
|
32
|
+
'"': """,
|
|
33
|
+
"'": "'",
|
|
34
|
+
})[ch] || ch);
|
|
26
35
|
}
|
|
27
36
|
export default function twilio(rl) {
|
|
28
37
|
rl.setName("twilio");
|
|
29
38
|
rl.setVersion("0.1.0");
|
|
30
39
|
rl.setConnectionSchema({
|
|
31
|
-
accountSid: {
|
|
32
|
-
|
|
40
|
+
accountSid: {
|
|
41
|
+
type: "string",
|
|
42
|
+
required: true,
|
|
43
|
+
description: "Twilio Account SID",
|
|
44
|
+
env: "TWILIO_ACCOUNT_SID",
|
|
45
|
+
},
|
|
46
|
+
authToken: {
|
|
47
|
+
type: "string",
|
|
48
|
+
required: true,
|
|
49
|
+
description: "Twilio Auth Token",
|
|
50
|
+
env: "TWILIO_AUTH_TOKEN",
|
|
51
|
+
},
|
|
33
52
|
});
|
|
34
53
|
rl.registerAction("sms.send", {
|
|
35
54
|
description: "Send an SMS, MMS, or WhatsApp message",
|
|
36
55
|
inputSchema: {
|
|
37
|
-
from: {
|
|
38
|
-
|
|
56
|
+
from: {
|
|
57
|
+
type: "string",
|
|
58
|
+
required: true,
|
|
59
|
+
description: "Sender phone number",
|
|
60
|
+
},
|
|
61
|
+
to: {
|
|
62
|
+
type: "string",
|
|
63
|
+
required: true,
|
|
64
|
+
description: "Recipient phone number",
|
|
65
|
+
},
|
|
39
66
|
body: { type: "string", required: true, description: "Message text" },
|
|
40
|
-
whatsapp: {
|
|
67
|
+
whatsapp: {
|
|
68
|
+
type: "boolean",
|
|
69
|
+
required: false,
|
|
70
|
+
description: "Send via WhatsApp",
|
|
71
|
+
},
|
|
41
72
|
statusCallback: { type: "string", required: false },
|
|
42
73
|
},
|
|
43
74
|
async execute(input, ctx) {
|
|
@@ -49,7 +80,10 @@ export default function twilio(rl) {
|
|
|
49
80
|
to = `whatsapp:${to}`;
|
|
50
81
|
}
|
|
51
82
|
return apiRequest(getConn(ctx), "POST", "/Messages.json", {
|
|
52
|
-
From: from,
|
|
83
|
+
From: from,
|
|
84
|
+
To: to,
|
|
85
|
+
Body: p.body,
|
|
86
|
+
StatusCallback: p.statusCallback,
|
|
53
87
|
});
|
|
54
88
|
},
|
|
55
89
|
});
|
|
@@ -58,8 +92,16 @@ export default function twilio(rl) {
|
|
|
58
92
|
inputSchema: {
|
|
59
93
|
from: { type: "string", required: true },
|
|
60
94
|
to: { type: "string", required: true },
|
|
61
|
-
message: {
|
|
62
|
-
|
|
95
|
+
message: {
|
|
96
|
+
type: "string",
|
|
97
|
+
required: true,
|
|
98
|
+
description: "Text to speak or TwiML",
|
|
99
|
+
},
|
|
100
|
+
twiml: {
|
|
101
|
+
type: "boolean",
|
|
102
|
+
required: false,
|
|
103
|
+
description: "If true, message is treated as raw TwiML",
|
|
104
|
+
},
|
|
63
105
|
statusCallback: { type: "string", required: false },
|
|
64
106
|
},
|
|
65
107
|
async execute(input, ctx) {
|
|
@@ -68,7 +110,10 @@ export default function twilio(rl) {
|
|
|
68
110
|
? p.message
|
|
69
111
|
: `<Response><Say>${escapeXml(p.message)}</Say></Response>`;
|
|
70
112
|
return apiRequest(getConn(ctx), "POST", "/Calls.json", {
|
|
71
|
-
From: p.from,
|
|
113
|
+
From: p.from,
|
|
114
|
+
To: p.to,
|
|
115
|
+
Twiml: twiml,
|
|
116
|
+
StatusCallback: p.statusCallback,
|
|
72
117
|
});
|
|
73
118
|
},
|
|
74
119
|
});
|