@frogbotai/piece-trello 0.29.0 → 0.30.0
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/actions.js +102 -48
- package/dist/actions.js.map +1 -1
- package/dist/client.js +31 -26
- package/dist/client.js.map +1 -1
- package/dist/config.js +13 -3
- package/dist/config.js.map +1 -1
- package/dist/define.js +1 -0
- package/dist/define.js.map +1 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +11 -10
- package/dist/files.js.map +1 -1
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/options.js +17 -15
- package/dist/options.js.map +1 -1
- package/dist/schemas.js +7 -10
- package/dist/schemas.js.map +1 -1
- package/dist/triggers.js +47 -41
- package/dist/triggers.js.map +1 -1
- package/package.json +4 -4
package/dist/actions.js
CHANGED
|
@@ -3,37 +3,64 @@ import { defineAction } from './define.js';
|
|
|
3
3
|
import { loadAttachment } from './files.js';
|
|
4
4
|
import { boardOptions, labelOptions, listOptions } from './options.js';
|
|
5
5
|
import { attachmentOutput, cardOutput, emptyOutput } from './schemas.js';
|
|
6
|
-
const cardIdInput = z.object({
|
|
6
|
+
const cardIdInput = z.object({
|
|
7
|
+
cardId: z.string().min(1).meta({
|
|
8
|
+
label: 'Card ID'
|
|
9
|
+
})
|
|
10
|
+
});
|
|
7
11
|
const attachmentIdInput = cardIdInput.extend({
|
|
8
|
-
attachmentId: z.string().min(1).meta({
|
|
12
|
+
attachmentId: z.string().min(1).meta({
|
|
13
|
+
label: 'Attachment ID'
|
|
14
|
+
})
|
|
9
15
|
});
|
|
10
16
|
export const createCard = defineAction({
|
|
11
17
|
slug: 'createCard',
|
|
12
18
|
description: 'Create a Trello card.',
|
|
13
19
|
input: z.object({
|
|
14
|
-
boardId: z.string().min(1).meta({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
boardId: z.string().min(1).meta({
|
|
21
|
+
label: 'Board'
|
|
22
|
+
}),
|
|
23
|
+
listId: z.string().min(1).meta({
|
|
24
|
+
label: 'List'
|
|
25
|
+
}),
|
|
26
|
+
name: z.string().min(1).meta({
|
|
27
|
+
label: 'Task name'
|
|
28
|
+
}),
|
|
29
|
+
description: z.string().optional().meta({
|
|
30
|
+
label: 'Task description'
|
|
31
|
+
}),
|
|
32
|
+
position: z.enum([
|
|
33
|
+
'top',
|
|
34
|
+
'bottom'
|
|
35
|
+
]).optional(),
|
|
36
|
+
labelIds: z.array(z.string()).optional().meta({
|
|
37
|
+
label: 'Labels'
|
|
38
|
+
})
|
|
20
39
|
}),
|
|
21
40
|
output: cardOutput,
|
|
22
41
|
idempotent: false,
|
|
23
|
-
options: {
|
|
24
|
-
|
|
42
|
+
options: {
|
|
43
|
+
boardId: boardOptions,
|
|
44
|
+
listId: listOptions,
|
|
45
|
+
labelIds: labelOptions
|
|
46
|
+
},
|
|
47
|
+
async run ({ client, input }) {
|
|
25
48
|
return client.request('cards', {
|
|
26
49
|
method: 'POST',
|
|
27
|
-
headers: {
|
|
50
|
+
headers: {
|
|
51
|
+
'Content-Type': 'application/json'
|
|
52
|
+
},
|
|
28
53
|
body: JSON.stringify({
|
|
29
54
|
name: input.name,
|
|
30
55
|
desc: input.description,
|
|
31
56
|
pos: input.position,
|
|
32
|
-
idLabels: input.labelIds
|
|
57
|
+
idLabels: input.labelIds
|
|
33
58
|
}),
|
|
34
|
-
query: {
|
|
59
|
+
query: {
|
|
60
|
+
idList: input.listId
|
|
61
|
+
}
|
|
35
62
|
});
|
|
36
|
-
}
|
|
63
|
+
}
|
|
37
64
|
});
|
|
38
65
|
export const getCard = defineAction({
|
|
39
66
|
slug: 'getCard',
|
|
@@ -41,9 +68,9 @@ export const getCard = defineAction({
|
|
|
41
68
|
input: cardIdInput,
|
|
42
69
|
output: cardOutput,
|
|
43
70
|
idempotent: true,
|
|
44
|
-
async run({ client, input }) {
|
|
71
|
+
async run ({ client, input }) {
|
|
45
72
|
return client.getCard(input.cardId);
|
|
46
|
-
}
|
|
73
|
+
}
|
|
47
74
|
});
|
|
48
75
|
export const updateCard = defineAction({
|
|
49
76
|
slug: 'updateCard',
|
|
@@ -54,18 +81,27 @@ export const updateCard = defineAction({
|
|
|
54
81
|
listId: z.string().optional(),
|
|
55
82
|
name: z.string().optional(),
|
|
56
83
|
description: z.string().optional(),
|
|
57
|
-
position: z.enum([
|
|
84
|
+
position: z.enum([
|
|
85
|
+
'top',
|
|
86
|
+
'bottom'
|
|
87
|
+
]).optional(),
|
|
58
88
|
labelIds: z.array(z.string()).optional(),
|
|
59
89
|
archived: z.boolean().optional(),
|
|
60
|
-
due: z.string().datetime().optional()
|
|
90
|
+
due: z.string().datetime().optional()
|
|
61
91
|
}),
|
|
62
92
|
output: cardOutput,
|
|
63
93
|
idempotent: true,
|
|
64
|
-
options: {
|
|
65
|
-
|
|
94
|
+
options: {
|
|
95
|
+
boardId: boardOptions,
|
|
96
|
+
listId: listOptions,
|
|
97
|
+
labelIds: labelOptions
|
|
98
|
+
},
|
|
99
|
+
async run ({ client, input }) {
|
|
66
100
|
return client.request(`cards/${input.cardId}`, {
|
|
67
101
|
method: 'PUT',
|
|
68
|
-
headers: {
|
|
102
|
+
headers: {
|
|
103
|
+
'Content-Type': 'application/json'
|
|
104
|
+
},
|
|
69
105
|
body: JSON.stringify({
|
|
70
106
|
name: input.name,
|
|
71
107
|
desc: input.description,
|
|
@@ -73,10 +109,10 @@ export const updateCard = defineAction({
|
|
|
73
109
|
pos: input.position,
|
|
74
110
|
idLabels: input.labelIds,
|
|
75
111
|
closed: input.archived,
|
|
76
|
-
due: input.due
|
|
77
|
-
})
|
|
112
|
+
due: input.due
|
|
113
|
+
})
|
|
78
114
|
});
|
|
79
|
-
}
|
|
115
|
+
}
|
|
80
116
|
});
|
|
81
117
|
export const deleteCard = defineAction({
|
|
82
118
|
slug: 'deleteCard',
|
|
@@ -84,9 +120,11 @@ export const deleteCard = defineAction({
|
|
|
84
120
|
input: cardIdInput,
|
|
85
121
|
output: emptyOutput,
|
|
86
122
|
idempotent: false,
|
|
87
|
-
async run({ client, input }) {
|
|
88
|
-
return client.request(`cards/${input.cardId}`, {
|
|
89
|
-
|
|
123
|
+
async run ({ client, input }) {
|
|
124
|
+
return client.request(`cards/${input.cardId}`, {
|
|
125
|
+
method: 'DELETE'
|
|
126
|
+
});
|
|
127
|
+
}
|
|
90
128
|
});
|
|
91
129
|
export const listCardAttachments = defineAction({
|
|
92
130
|
slug: 'listCardAttachments',
|
|
@@ -94,25 +132,28 @@ export const listCardAttachments = defineAction({
|
|
|
94
132
|
input: cardIdInput,
|
|
95
133
|
output: z.array(attachmentOutput),
|
|
96
134
|
idempotent: true,
|
|
97
|
-
async run({ client, input }) {
|
|
135
|
+
async run ({ client, input }) {
|
|
98
136
|
return client.request(`cards/${input.cardId}/attachments`);
|
|
99
|
-
}
|
|
137
|
+
}
|
|
100
138
|
});
|
|
101
139
|
export const addCardAttachment = defineAction({
|
|
102
140
|
slug: 'addCardAttachment',
|
|
103
141
|
description: 'Upload an attachment to a Trello card.',
|
|
104
142
|
input: cardIdInput.extend({
|
|
105
143
|
attachment: z.object({
|
|
106
|
-
fileId: z.union([
|
|
107
|
-
|
|
144
|
+
fileId: z.union([
|
|
145
|
+
z.string(),
|
|
146
|
+
z.number()
|
|
147
|
+
]),
|
|
148
|
+
name: z.string().optional()
|
|
108
149
|
}),
|
|
109
150
|
name: z.string().optional(),
|
|
110
151
|
mimeType: z.string().optional(),
|
|
111
|
-
setCover: z.boolean().optional()
|
|
152
|
+
setCover: z.boolean().optional()
|
|
112
153
|
}),
|
|
113
154
|
output: attachmentOutput,
|
|
114
155
|
idempotent: false,
|
|
115
|
-
async run({ client, input, req }) {
|
|
156
|
+
async run ({ client, input, req }) {
|
|
116
157
|
const attachment = await loadAttachment(req, input.attachment);
|
|
117
158
|
const form = new FormData();
|
|
118
159
|
form.append('file', attachment.data, attachment.name);
|
|
@@ -122,10 +163,10 @@ export const addCardAttachment = defineAction({
|
|
|
122
163
|
query: {
|
|
123
164
|
mimeType: input.mimeType ?? attachment.type,
|
|
124
165
|
name: input.name,
|
|
125
|
-
setCover: input.setCover
|
|
126
|
-
}
|
|
166
|
+
setCover: input.setCover
|
|
167
|
+
}
|
|
127
168
|
});
|
|
128
|
-
}
|
|
169
|
+
}
|
|
129
170
|
});
|
|
130
171
|
export const getCardAttachment = defineAction({
|
|
131
172
|
slug: 'getCardAttachment',
|
|
@@ -133,9 +174,9 @@ export const getCardAttachment = defineAction({
|
|
|
133
174
|
input: attachmentIdInput,
|
|
134
175
|
output: attachmentOutput,
|
|
135
176
|
idempotent: true,
|
|
136
|
-
async run({ client, input }) {
|
|
177
|
+
async run ({ client, input }) {
|
|
137
178
|
return client.request(`cards/${input.cardId}/attachments/${input.attachmentId}`);
|
|
138
|
-
}
|
|
179
|
+
}
|
|
139
180
|
});
|
|
140
181
|
export const deleteCardAttachment = defineAction({
|
|
141
182
|
slug: 'deleteCardAttachment',
|
|
@@ -143,18 +184,28 @@ export const deleteCardAttachment = defineAction({
|
|
|
143
184
|
input: attachmentIdInput,
|
|
144
185
|
output: emptyOutput,
|
|
145
186
|
idempotent: false,
|
|
146
|
-
async run({ client, input }) {
|
|
187
|
+
async run ({ client, input }) {
|
|
147
188
|
return client.request(`cards/${input.cardId}/attachments/${input.attachmentId}`, {
|
|
148
|
-
method: 'DELETE'
|
|
189
|
+
method: 'DELETE'
|
|
149
190
|
});
|
|
150
|
-
}
|
|
191
|
+
}
|
|
151
192
|
});
|
|
152
193
|
const customInput = z.object({
|
|
153
|
-
method: z.enum([
|
|
194
|
+
method: z.enum([
|
|
195
|
+
'GET',
|
|
196
|
+
'POST',
|
|
197
|
+
'PUT',
|
|
198
|
+
'PATCH',
|
|
199
|
+
'DELETE'
|
|
200
|
+
]),
|
|
154
201
|
path: z.string().startsWith('/'),
|
|
155
202
|
headers: z.record(z.string(), z.string()).optional(),
|
|
156
|
-
query: z.record(z.string(), z.union([
|
|
157
|
-
|
|
203
|
+
query: z.record(z.string(), z.union([
|
|
204
|
+
z.string(),
|
|
205
|
+
z.number(),
|
|
206
|
+
z.boolean()
|
|
207
|
+
])).optional(),
|
|
208
|
+
body: z.json().optional()
|
|
158
209
|
});
|
|
159
210
|
export const customApiCall = defineAction({
|
|
160
211
|
slug: 'customApiCall',
|
|
@@ -162,16 +213,19 @@ export const customApiCall = defineAction({
|
|
|
162
213
|
input: customInput,
|
|
163
214
|
output: z.json(),
|
|
164
215
|
idempotent: false,
|
|
165
|
-
async run({ client, input }) {
|
|
216
|
+
async run ({ client, input }) {
|
|
166
217
|
return client.request(input.path, {
|
|
167
218
|
method: input.method,
|
|
168
219
|
headers: {
|
|
169
220
|
...input.headers,
|
|
170
|
-
...
|
|
221
|
+
...input.body === undefined ? {} : {
|
|
222
|
+
'Content-Type': 'application/json'
|
|
223
|
+
}
|
|
171
224
|
},
|
|
172
225
|
body: input.body === undefined ? undefined : JSON.stringify(input.body),
|
|
173
|
-
query: input.query
|
|
226
|
+
query: input.query
|
|
174
227
|
});
|
|
175
|
-
}
|
|
228
|
+
}
|
|
176
229
|
});
|
|
230
|
+
|
|
177
231
|
//# sourceMappingURL=actions.js.map
|
package/dist/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/actions.ts"],"names":["z","defineAction","loadAttachment","boardOptions","labelOptions","listOptions","attachmentOutput","cardOutput","emptyOutput","cardIdInput","object","cardId","string","min","meta","label","attachmentIdInput","extend","attachmentId","createCard","slug","description","input","boardId","listId","name","optional","position","enum","labelIds","array","output","idempotent","options","run","client","request","method","headers","body","JSON","stringify","desc","pos","idLabels","query","idList","getCard","updateCard","archived","boolean","due","datetime","closed","deleteCard","listCardAttachments","addCardAttachment","attachment","fileId","union","number","mimeType","setCover","req","form","FormData","append","data","type","getCardAttachment","deleteCardAttachment","customInput","path","startsWith","record","json","customApiCall","undefined"],"mappings":"AAAA,SAASA,CAAC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EAAE,EAAE;YAC/EmB,QAAQ;QACV;IACF;AACF,GAAG;AAEH,MAAMkC,cAAcvE,EAAEU,MAAM,CAAC;IAC3B2B,QAAQrC,EAAE4B,IAAI,CAAC;QAAC;QAAO;QAAQ;QAAO;QAAS;KAAS;IACxD4C,MAAMxE,EAAEY,MAAM,GAAG6D,UAAU,CAAC;IAC5BnC,SAAStC,EAAE0E,MAAM,CAAC1E,EAAEY,MAAM,IAAIZ,EAAEY,MAAM,IAAIc,QAAQ;IAClDmB,OAAO7C,EAAE0E,MAAM,CAAC1E,EAAEY,MAAM,IAAIZ,EAAE2D,KAAK,CAAC;QAAC3D,EAAEY,MAAM;QAAIZ,EAAE4D,MAAM;QAAI5D,EAAEkD,OAAO;KAAG,GAAGxB,QAAQ;IACpFa,MAAMvC,EAAE2E,IAAI,GAAGjD,QAAQ;AACzB;AAEA,OAAO,MAAMkD,gBAAgB3E,aAAa;IACxCmB,MAAM;IACNC,aAAa;IACbC,OAAOiD;IACPxC,QAAQ/B,EAAE2E,IAAI;IACd3C,YAAY;IACZ,MAAME,KAAI,EAAEC,MAAM,EAAEb,KAAK,EAAE;QACzB,OAAOa,OAAOC,OAAO,CAACd,MAAMkD,IAAI,EAAE;YAChCnC,QAAQf,MAAMe,MAAM;YACpBC,SAAS;gBACP,GAAGhB,MAAMgB,OAAO;gBAChB,GAAIhB,MAAMiB,IAAI,KAAKsC,YAAY,CAAC,IAAI;oBAAE,gBAAgB;gBAAmB,CAAC;YAC5E;YACAtC,MAAMjB,MAAMiB,IAAI,KAAKsC,YAAYA,YAAYrC,KAAKC,SAAS,CAACnB,MAAMiB,IAAI;YACtEM,OAAOvB,MAAMuB,KAAK;QACpB;IACF;AACF,GAAG","file":"actions.js"}
|
package/dist/client.js
CHANGED
|
@@ -6,50 +6,55 @@ export function createTrelloClient({ auth }) {
|
|
|
6
6
|
const url = new URL(`https://api.trello.com/1/${path.replace(/^\//, '')}`);
|
|
7
7
|
url.searchParams.set('key', credential.username);
|
|
8
8
|
url.searchParams.set('token', credential.password);
|
|
9
|
-
Object.entries(init.query ?? {}).forEach(([key, value])
|
|
10
|
-
if (value !== undefined)
|
|
11
|
-
url.searchParams.set(key, String(value));
|
|
9
|
+
Object.entries(init.query ?? {}).forEach(([key, value])=>{
|
|
10
|
+
if (value !== undefined) url.searchParams.set(key, String(value));
|
|
12
11
|
});
|
|
13
12
|
const response = await fetch(url, init);
|
|
14
13
|
const text = await response.text();
|
|
15
14
|
if (!response.ok) {
|
|
16
15
|
throw new Error(`Trello request failed (${response.status}): ${text || response.statusText}`);
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return text ? JSON.parse(text) : {};
|
|
19
18
|
}
|
|
20
19
|
return {
|
|
21
20
|
request,
|
|
22
|
-
verifyWebhook(body, signature, webhookUrl) {
|
|
23
|
-
if (!signature || !/^[A-Za-z\d+/]{27}=$/.test(signature))
|
|
24
|
-
|
|
25
|
-
const expected = createHmac('sha1', credential.applicationSecret)
|
|
26
|
-
.update(body)
|
|
27
|
-
.update(webhookUrl)
|
|
28
|
-
.digest();
|
|
21
|
+
verifyWebhook (body, signature, webhookUrl) {
|
|
22
|
+
if (!signature || !/^[A-Za-z\d+/]{27}=$/.test(signature)) return false;
|
|
23
|
+
const expected = createHmac('sha1', credential.applicationSecret).update(body).update(webhookUrl).digest();
|
|
29
24
|
const actual = Buffer.from(signature, 'base64');
|
|
30
25
|
return actual.length === expected.length && timingSafeEqual(actual, expected);
|
|
31
26
|
},
|
|
32
|
-
async listAll(path) {
|
|
27
|
+
async listAll (path) {
|
|
33
28
|
const items = [];
|
|
34
29
|
let before;
|
|
35
|
-
while
|
|
36
|
-
const page = await request(path, {
|
|
30
|
+
while(true){
|
|
31
|
+
const page = await request(path, {
|
|
32
|
+
query: {
|
|
33
|
+
limit: 1000,
|
|
34
|
+
before
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
37
|
items.push(...page);
|
|
38
|
-
if (page.length < 1000)
|
|
39
|
-
return items;
|
|
38
|
+
if (page.length < 1000) return items;
|
|
40
39
|
before = page.at(-1)?.id;
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
|
-
getCard: (cardId)
|
|
44
|
-
listBoards: ()
|
|
45
|
-
listLists: (boardId)
|
|
46
|
-
listLabels: (boardId)
|
|
47
|
-
listWebhooks: ()
|
|
48
|
-
createWebhook: (idModel, callbackURL)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
getCard: (cardId)=>request(`cards/${cardId}`),
|
|
43
|
+
listBoards: ()=>request('members/me/boards'),
|
|
44
|
+
listLists: (boardId)=>request(`boards/${boardId}/lists`),
|
|
45
|
+
listLabels: (boardId)=>request(`boards/${boardId}/labels`),
|
|
46
|
+
listWebhooks: ()=>request(`tokens/${credential.password}/webhooks`),
|
|
47
|
+
createWebhook: (idModel, callbackURL)=>request('webhooks', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
query: {
|
|
50
|
+
callbackURL,
|
|
51
|
+
idModel
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
deleteWebhook: (id)=>request(`webhooks/${id}`, {
|
|
55
|
+
method: 'DELETE'
|
|
56
|
+
})
|
|
53
57
|
};
|
|
54
58
|
}
|
|
59
|
+
|
|
55
60
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"names":["createHmac","timingSafeEqual","trelloAuth","createTrelloClient","auth","credential","parse","request","path","init","url","URL","replace","searchParams","set","username","password","Object","entries","query","forEach","key","value","undefined","String","response","fetch","text","ok","Error","status","statusText","JSON","verifyWebhook","body","signature","webhookUrl","test","expected","applicationSecret","update","digest","actual","Buffer","from","length","listAll","items","before","page","limit","push","at","id","getCard","cardId","listBoards","listLists","boardId","listLabels","listWebhooks","createWebhook","idModel","callbackURL","method","deleteWebhook"],"mappings":"AAAA,SAASA,UAAU,EAAE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tE;QACA,MAAMQ,SAAkCtC,IAAY;YAClD,MAAMuC,QAAa,EAAE;YACrB,IAAIC;YAEJ,MAAO,KAAM;gBACX,MAAMC,OAAO,MAAM1C,QAAaC,MAAM;oBAAEW,OAAO;wBAAE+B,OAAO;wBAAMF;oBAAO;gBAAE;gBAEvED,MAAMI,IAAI,IAAIF;gBAEd,IAAIA,KAAKJ,MAAM,GAAG,MAAM,OAAOE;gBAE/BC,SAASC,KAAKG,EAAE,CAAC,CAAC,IAAIC;YACxB;QACF;QACAC,SAAS,CAA8BC,SAAmBhD,QAAW,CAAC,MAAM,EAAEgD,QAAQ;QACtFC,YAAY,IAAMjD,QAA6C;QAC/DkD,WAAW,CAACC,UACVnD,QAA6C,CAAC,OAAO,EAAEmD,QAAQ,MAAM,CAAC;QACxEC,YAAY,CAACD,UACXnD,QAA4D,CAAC,OAAO,EAAEmD,QAAQ,OAAO,CAAC;QACxFE,cAAc,IAAMrD,QAAyB,CAAC,OAAO,EAAEF,WAAWW,QAAQ,CAAC,SAAS,CAAC;QACrF6C,eAAe,CAACC,SAAiBC,cAC/BxD,QAAuB,YAAY;gBACjCyD,QAAQ;gBACR7C,OAAO;oBAAE4C;oBAAaD;gBAAQ;YAChC;QACFG,eAAe,CAACZ,KAAe9C,QAAQ,CAAC,SAAS,EAAE8C,IAAI,EAAE;gBAAEW,QAAQ;YAAS;IAC9E;AACF","file":"client.js"}
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const trelloAuth = z.object({
|
|
3
|
-
username: z.string().min(1).meta({
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
username: z.string().min(1).meta({
|
|
4
|
+
label: 'API key',
|
|
5
|
+
secret: true
|
|
6
|
+
}),
|
|
7
|
+
password: z.string().min(1).meta({
|
|
8
|
+
label: 'Token',
|
|
9
|
+
secret: true
|
|
10
|
+
}),
|
|
11
|
+
applicationSecret: z.string().min(1).meta({
|
|
12
|
+
label: 'Application secret',
|
|
13
|
+
secret: true
|
|
14
|
+
})
|
|
6
15
|
});
|
|
16
|
+
|
|
7
17
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":["z","trelloAuth","object","username","string","min","meta","label","secret","password","applicationSecret"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,OAAO,MAAMC,aAAaD,EAAEE,MAAM,CAAC;IACjCC,UAAUH,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAAWC,QAAQ;IAAK;IAClEC,UAAUT,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAASC,QAAQ;IAAK;IAChEE,mBAAmBV,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,IAAI,CAAC;QAAEC,OAAO;QAAsBC,QAAQ;IAAK;AACxF,GAAG","file":"config.js"}
|
package/dist/define.js
CHANGED
package/dist/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/define.ts"],"names":["createPieceHelpers","defineAction","definePollingTrigger","defineWebhookTrigger"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,OAAO,MAAM,EAAEC,YAAY,EAAEC,oBAAoB,EAAEC,oBAAoB,EAAE,GACvEH,qBAA6B","file":"define.js"}
|
package/dist/files.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,wBAAsB,cAAc,CAClC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;;;;GA0DlD"}
|
package/dist/files.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import { filesCollectionSlug } from 'frogbot/pieces';
|
|
1
2
|
export async function loadAttachment(req, value) {
|
|
2
|
-
const collection = req
|
|
3
|
-
if (!collection) {
|
|
4
|
-
throw new Error('[frogbot] Trello attachments require the files collection to be configured.');
|
|
5
|
-
}
|
|
3
|
+
const collection = filesCollectionSlug(req, 'Trello');
|
|
6
4
|
const doc = await req.frogbot.findByID({
|
|
7
5
|
collection,
|
|
8
6
|
id: value.fileId,
|
|
9
7
|
depth: 0,
|
|
10
8
|
req,
|
|
11
|
-
overrideAccess: false
|
|
9
|
+
overrideAccess: false
|
|
12
10
|
});
|
|
13
11
|
const fileUrl = doc.url;
|
|
14
12
|
if (typeof fileUrl !== 'string') {
|
|
@@ -25,15 +23,17 @@ export async function loadAttachment(req, value) {
|
|
|
25
23
|
if (url.origin !== base.origin) {
|
|
26
24
|
throw new Error(`[frogbot] File '${value.fileId}' has an invalid URL.`);
|
|
27
25
|
}
|
|
28
|
-
for (const name of [
|
|
26
|
+
for (const name of [
|
|
27
|
+
'authorization',
|
|
28
|
+
'cookie'
|
|
29
|
+
]){
|
|
29
30
|
const header = req.headers.get(name);
|
|
30
|
-
if (header)
|
|
31
|
-
headers.set(name, header);
|
|
31
|
+
if (header) headers.set(name, header);
|
|
32
32
|
}
|
|
33
33
|
const response = await fetch(url, {
|
|
34
34
|
headers,
|
|
35
35
|
redirect: 'error',
|
|
36
|
-
signal: req.signal ?? undefined
|
|
36
|
+
signal: req.signal ?? undefined
|
|
37
37
|
});
|
|
38
38
|
if (!response.ok) {
|
|
39
39
|
throw new Error(`[frogbot] File '${value.fileId}' is unavailable (${response.status}).`);
|
|
@@ -44,7 +44,8 @@ export async function loadAttachment(req, value) {
|
|
|
44
44
|
return {
|
|
45
45
|
name: value.name ?? filename ?? name ?? 'attachment',
|
|
46
46
|
type: mimeType ?? 'application/octet-stream',
|
|
47
|
-
data: await response.blob()
|
|
47
|
+
data: await response.blob()
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
+
|
|
50
51
|
//# sourceMappingURL=files.js.map
|
package/dist/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/files.ts"],"names":["filesCollectionSlug","loadAttachment","req","value","collection","doc","frogbot","findByID","id","fileId","depth","overrideAccess","fileUrl","url","Error","config","_internal","payloadConfig","baseUrl","serverURL","URL","base","headers","Headers","origin","name","header","get","set","response","fetch","redirect","signal","undefined","ok","status","filename","mimeType","type","data","blob"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,iBAAiB;AAErD,OAAO,eAAeC,eACpBC,GAAmB,EACnBC,KAAiD;IAEjD,MAAMC,aAAaJ,oBAAoBE,KAAK;IAE5C,MAAMG,MAAM,MAAMH,IAAII,OAAO,CAACC,QAAQ,CAAC;QACrCH;QACAI,IAAIL,MAAMM,MAAM;QAChBC,OAAO;QACPR;QACAS,gBAAgB;IAClB;IAEA,MAAMC,UAAUP,IAAIQ,GAAG;IAEvB,IAAI,OAAOD,YAAY,UAAU;QAC/B,MAAM,IAAIE,MAAM,CAAC,gBAAgB,EAAEX,MAAMM,MAAM,CAAC,iBAAiB,CAAC;IACpE;IAEA,MAAMM,SAAS,MAAMb,IAAII,OAAO,CAACS,MAAM,CAACC,SAAS,CAACC,aAAa;IAC/D,MAAMC,UAAUH,OAAOI,SAAS,IAAIjB,IAAIW,GAAG;IAE3C,IAAI,OAAOK,YAAY,UAAU;QAC/B,MAAM,IAAIJ,MAAM,CAAC,gBAAgB,EAAEX,MAAMM,MAAM,CAAC,iBAAiB,CAAC;IACpE;IAEA,MAAMI,MAAM,IAAIO,IAAIR,SAASM;IAC7B,MAAMG,OAAO,IAAID,IAAIF;IACrB,MAAMI,UAAU,IAAIC;IAEpB,IAAIV,IAAIW,MAAM,KAAKH,KAAKG,MAAM,EAAE;QAC9B,MAAM,IAAIV,MAAM,CAAC,gBAAgB,EAAEX,MAAMM,MAAM,CAAC,qBAAqB,CAAC;IACxE;IAEA,KAAK,MAAMgB,QAAQ;QAAC;QAAiB;KAAS,CAAE;QAC9C,MAAMC,SAASxB,IAAIoB,OAAO,CAACK,GAAG,CAACF;QAE/B,IAAIC,QAAQJ,QAAQM,GAAG,CAACH,MAAMC;IAChC;IAEA,MAAMG,WAAW,MAAMC,MAAMjB,KAAK;QAChCS;QACAS,UAAU;QACVC,QAAQ9B,IAAI8B,MAAM,IAAIC;IACxB;IAEA,IAAI,CAACJ,SAASK,EAAE,EAAE;QAChB,MAAM,IAAIpB,MAAM,CAAC,gBAAgB,EAAEX,MAAMM,MAAM,CAAC,kBAAkB,EAAEoB,SAASM,MAAM,CAAC,EAAE,CAAC;IACzF;IAEA,MAAMC,WAAW,OAAO/B,IAAI+B,QAAQ,KAAK,WAAW/B,IAAI+B,QAAQ,GAAGH;IACnE,MAAMR,OAAO,OAAOpB,IAAIoB,IAAI,KAAK,WAAWpB,IAAIoB,IAAI,GAAGQ;IACvD,MAAMI,WAAW,OAAOhC,IAAIgC,QAAQ,KAAK,WAAWhC,IAAIgC,QAAQ,GAAGJ;IAEnE,OAAO;QACLR,MAAMtB,MAAMsB,IAAI,IAAIW,YAAYX,QAAQ;QACxCa,MAAMD,YAAY;QAClBE,MAAM,MAAMV,SAASW,IAAI;IAC3B;AACF","file":"files.js"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { definePiece } from 'frogbot/pieces';
|
|
2
|
-
import { addCardAttachment, createCard, customApiCall, deleteCard, deleteCardAttachment, getCard, getCardAttachment, listCardAttachments, updateCard
|
|
2
|
+
import { addCardAttachment, createCard, customApiCall, deleteCard, deleteCardAttachment, getCard, getCardAttachment, listCardAttachments, updateCard } from './actions.js';
|
|
3
3
|
import { createTrelloClient } from './client.js';
|
|
4
4
|
import { trelloAuth } from './config.js';
|
|
5
5
|
import { cardCreated, cardDeadline, cardMovedToList } from './triggers.js';
|
|
@@ -12,26 +12,32 @@ export const trelloActions = [
|
|
|
12
12
|
'addCardAttachment',
|
|
13
13
|
'getCardAttachment',
|
|
14
14
|
'deleteCardAttachment',
|
|
15
|
-
'customApiCall'
|
|
15
|
+
'customApiCall'
|
|
16
|
+
];
|
|
17
|
+
export const trelloTriggers = [
|
|
18
|
+
'cardCreated',
|
|
19
|
+
'cardMovedToList',
|
|
20
|
+
'cardDeadline'
|
|
16
21
|
];
|
|
17
|
-
export const trelloTriggers = ['cardCreated', 'cardMovedToList', 'cardDeadline'];
|
|
18
22
|
export const trelloScopes = [];
|
|
19
23
|
export const createTrello = definePiece({
|
|
20
24
|
slug: 'trello',
|
|
21
25
|
label: 'Trello',
|
|
22
26
|
admin: {
|
|
23
27
|
description: 'Manage Trello cards, attachments, and card events',
|
|
24
|
-
group: 'Productivity'
|
|
28
|
+
group: 'Productivity'
|
|
25
29
|
},
|
|
26
30
|
auth: trelloAuth,
|
|
27
31
|
client: createTrelloClient,
|
|
28
32
|
webhook: {
|
|
29
|
-
async verify() {
|
|
33
|
+
async verify () {
|
|
30
34
|
return true;
|
|
31
35
|
},
|
|
32
|
-
async handshake({ req }) {
|
|
33
|
-
return req.method === 'HEAD' ? new Response(null, {
|
|
34
|
-
|
|
36
|
+
async handshake ({ req }) {
|
|
37
|
+
return req.method === 'HEAD' ? new Response(null, {
|
|
38
|
+
status: 200
|
|
39
|
+
}) : null;
|
|
40
|
+
}
|
|
35
41
|
},
|
|
36
42
|
actions: [
|
|
37
43
|
createCard,
|
|
@@ -42,8 +48,13 @@ export const createTrello = definePiece({
|
|
|
42
48
|
addCardAttachment,
|
|
43
49
|
getCardAttachment,
|
|
44
50
|
deleteCardAttachment,
|
|
45
|
-
customApiCall
|
|
51
|
+
customApiCall
|
|
46
52
|
],
|
|
47
|
-
triggers: [
|
|
53
|
+
triggers: [
|
|
54
|
+
cardCreated,
|
|
55
|
+
cardMovedToList,
|
|
56
|
+
cardDeadline
|
|
57
|
+
]
|
|
48
58
|
});
|
|
59
|
+
|
|
49
60
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["definePiece","addCardAttachment","createCard","customApiCall","deleteCard","deleteCardAttachment","getCard","getCardAttachment","listCardAttachments","updateCard","createTrelloClient","trelloAuth","cardCreated","cardDeadline","cardMovedToList","trelloActions","trelloTriggers","trelloScopes","createTrello","slug","label","admin","description","group","auth","client","webhook","verify","handshake","req","method","Response","status","actions","triggers"],"mappings":"AAAA,SAASA,WAAW,QAAQ,iBAAiB;AAE7C,SACEC,iBAAiB,EACjBC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,oBAAoB,EACpBC,OAAO,EACPC,iBAAiB,EACjBC,mBAAmB,EACnBC,UAAU,QACL,eAAe;AACtB,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,WAAW,EAAEC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAE3E,OAAO,MAAMC,gBAAgB;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AACX,OAAO,MAAMC,iBAAiB;IAAC;IAAe;IAAmB;CAAe,CAAU;AAC1F,OAAO,MAAMC,eAAe,EAAE,CAAU;AAExC,OAAO,MAAMC,eAAelB,YAAY;IACtCmB,MAAM;IACNC,OAAO;IACPC,OAAO;QACLC,aAAa;QACbC,OAAO;IACT;IACAC,MAAMb;IACNc,QAAQf;IACRgB,SAAS;QACP,MAAMC;YACJ,OAAO;QACT;QACA,MAAMC,WAAU,EAAEC,GAAG,EAAE;YACrB,OAAOA,IAAIC,MAAM,KAAK,SAAS,IAAIC,SAAS,MAAM;gBAAEC,QAAQ;YAAI,KAAK;QACvE;IACF;IACAC,SAAS;QACP/B;QACAI;QACAG;QACAL;QACAI;QACAP;QACAM;QACAF;QACAF;KACD;IACD+B,UAAU;QAACtB;QAAaE;QAAiBD;KAAa;AACxD,GAAG","file":"index.js"}
|
package/dist/options.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
export async function boardOptions({ client }) {
|
|
2
|
-
return (await client.listBoards()).map(({ id, name })
|
|
2
|
+
return (await client.listBoards()).map(({ id, name })=>({
|
|
3
|
+
label: name,
|
|
4
|
+
value: id
|
|
5
|
+
}));
|
|
3
6
|
}
|
|
4
|
-
export async function listOptions({ client, input
|
|
5
|
-
if (!input.boardId)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}));
|
|
7
|
+
export async function listOptions({ client, input }) {
|
|
8
|
+
if (!input.boardId) return [];
|
|
9
|
+
return (await client.listLists(input.boardId)).map(({ id, name })=>({
|
|
10
|
+
label: name,
|
|
11
|
+
value: id
|
|
12
|
+
}));
|
|
11
13
|
}
|
|
12
|
-
export async function labelOptions({ client, input
|
|
13
|
-
if (!input.boardId)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}));
|
|
14
|
+
export async function labelOptions({ client, input }) {
|
|
15
|
+
if (!input.boardId) return [];
|
|
16
|
+
return (await client.listLabels(input.boardId)).map(({ color, id, name })=>({
|
|
17
|
+
label: name || color,
|
|
18
|
+
value: id
|
|
19
|
+
}));
|
|
19
20
|
}
|
|
21
|
+
|
|
20
22
|
//# sourceMappingURL=options.js.map
|
package/dist/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/options.ts"],"names":["boardOptions","client","listBoards","map","id","name","label","value","listOptions","input","boardId","listLists","labelOptions","listLabels","color"],"mappings":"AAIA,OAAO,eAAeA,aAAa,EAAEC,MAAM,EAAsB;IAC/D,OAAO,AAAC,CAAA,MAAMA,OAAOC,UAAU,EAAC,EAAGC,GAAG,CAAC,CAAC,EAAEC,EAAE,EAAEC,IAAI,EAAE,GAAM,CAAA;YAAEC,OAAOD;YAAME,OAAOH;QAAG,CAAA;AACrF;AAEA,OAAO,eAAeI,YAAY,EAChCP,MAAM,EACNQ,KAAK,EAIN;IACC,IAAI,CAACA,MAAMC,OAAO,EAAE,OAAO,EAAE;IAE7B,OAAO,AAAC,CAAA,MAAMT,OAAOU,SAAS,CAACF,MAAMC,OAAO,CAAA,EAAGP,GAAG,CAAC,CAAC,EAAEC,EAAE,EAAEC,IAAI,EAAE,GAAM,CAAA;YACpEC,OAAOD;YACPE,OAAOH;QACT,CAAA;AACF;AAEA,OAAO,eAAeQ,aAAa,EACjCX,MAAM,EACNQ,KAAK,EAIN;IACC,IAAI,CAACA,MAAMC,OAAO,EAAE,OAAO,EAAE;IAE7B,OAAO,AAAC,CAAA,MAAMT,OAAOY,UAAU,CAACJ,MAAMC,OAAO,CAAA,EAAGP,GAAG,CAAC,CAAC,EAAEW,KAAK,EAAEV,EAAE,EAAEC,IAAI,EAAE,GAAM,CAAA;YAC5EC,OAAOD,QAAQS;YACfP,OAAOH;QACT,CAAA;AACF","file":"options.js"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const cardOutput = z
|
|
3
|
-
.object({
|
|
2
|
+
export const cardOutput = z.object({
|
|
4
3
|
id: z.string(),
|
|
5
4
|
name: z.string(),
|
|
6
5
|
desc: z.string().optional(),
|
|
@@ -9,16 +8,14 @@ export const cardOutput = z
|
|
|
9
8
|
due: z.string().nullable().optional(),
|
|
10
9
|
dueComplete: z.boolean().optional(),
|
|
11
10
|
dateLastActivity: z.string().optional(),
|
|
12
|
-
url: z.string().optional()
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
export const attachmentOutput = z
|
|
16
|
-
.object({
|
|
11
|
+
url: z.string().optional()
|
|
12
|
+
}).passthrough();
|
|
13
|
+
export const attachmentOutput = z.object({
|
|
17
14
|
id: z.string(),
|
|
18
15
|
name: z.string(),
|
|
19
16
|
url: z.string(),
|
|
20
|
-
mimeType: z.string().optional()
|
|
21
|
-
})
|
|
22
|
-
.passthrough();
|
|
17
|
+
mimeType: z.string().optional()
|
|
18
|
+
}).passthrough();
|
|
23
19
|
export const emptyOutput = z.object({}).passthrough();
|
|
20
|
+
|
|
24
21
|
//# sourceMappingURL=schemas.js.map
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/schemas.ts"],"names":["z","cardOutput","object","id","string","name","desc","optional","idBoard","idList","due","nullable","dueComplete","boolean","dateLastActivity","url","passthrough","attachmentOutput","mimeType","emptyOutput"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAM;AAExB,OAAO,MAAMC,aAAaD,EACvBE,MAAM,CAAC;IACNC,IAAIH,EAAEI,MAAM;IACZC,MAAML,EAAEI,MAAM;IACdE,MAAMN,EAAEI,MAAM,GAAGG,QAAQ;IACzBC,SAASR,EAAEI,MAAM,GAAGG,QAAQ;IAC5BE,QAAQT,EAAEI,MAAM,GAAGG,QAAQ;IAC3BG,KAAKV,EAAEI,MAAM,GAAGO,QAAQ,GAAGJ,QAAQ;IACnCK,aAAaZ,EAAEa,OAAO,GAAGN,QAAQ;IACjCO,kBAAkBd,EAAEI,MAAM,GAAGG,QAAQ;IACrCQ,KAAKf,EAAEI,MAAM,GAAGG,QAAQ;AAC1B,GACCS,WAAW,GAAG;AAEjB,OAAO,MAAMC,mBAAmBjB,EAC7BE,MAAM,CAAC;IACNC,IAAIH,EAAEI,MAAM;IACZC,MAAML,EAAEI,MAAM;IACdW,KAAKf,EAAEI,MAAM;IACbc,UAAUlB,EAAEI,MAAM,GAAGG,QAAQ;AAC/B,GACCS,WAAW,GAAG;AAEjB,OAAO,MAAMG,cAAcnB,EAAEE,MAAM,CAAC,CAAC,GAAGc,WAAW,GAAG","file":"schemas.js"}
|
package/dist/triggers.js
CHANGED
|
@@ -2,26 +2,28 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { definePollingTrigger, defineWebhookTrigger } from './define.js';
|
|
4
4
|
import { cardOutput } from './schemas.js';
|
|
5
|
-
function webhookTrigger({ slug, description, input, model, matches
|
|
5
|
+
function webhookTrigger({ slug, description, input, model, matches }) {
|
|
6
6
|
return defineWebhookTrigger({
|
|
7
7
|
slug,
|
|
8
8
|
description,
|
|
9
9
|
type: 'webhook',
|
|
10
10
|
input,
|
|
11
11
|
output: cardOutput,
|
|
12
|
-
async onEnable({ client, input, webhookUrl }) {
|
|
12
|
+
async onEnable ({ client, input, webhookUrl }) {
|
|
13
13
|
const idModel = model(input);
|
|
14
|
-
const existing = (await client.listWebhooks()).find((webhook)
|
|
15
|
-
const webhook = existing ??
|
|
16
|
-
return {
|
|
14
|
+
const existing = (await client.listWebhooks()).find((webhook)=>webhook.idModel === idModel && webhook.callbackURL === webhookUrl);
|
|
15
|
+
const webhook = existing ?? await client.createWebhook(idModel, webhookUrl);
|
|
16
|
+
return {
|
|
17
|
+
webhookId: webhook.id,
|
|
18
|
+
webhookUrl,
|
|
19
|
+
owned: !existing
|
|
20
|
+
};
|
|
17
21
|
},
|
|
18
|
-
async onDisable({ client, state }) {
|
|
19
|
-
if (state.owned)
|
|
20
|
-
await client.deleteWebhook(state.webhookId);
|
|
22
|
+
async onDisable ({ client, state }) {
|
|
23
|
+
if (state.owned) await client.deleteWebhook(state.webhookId);
|
|
21
24
|
},
|
|
22
|
-
async run({ client, input, req, state }) {
|
|
23
|
-
if (!req.arrayBuffer)
|
|
24
|
-
throw new Error('Trello webhook raw body is unavailable.');
|
|
25
|
+
async run ({ client, input, req, state }) {
|
|
26
|
+
if (!req.arrayBuffer) throw new Error('Trello webhook raw body is unavailable.');
|
|
25
27
|
const body = Buffer.from(await req.arrayBuffer());
|
|
26
28
|
const signature = req.headers.get('x-trello-webhook');
|
|
27
29
|
if (!client.verifyWebhook(body, signature, state.webhookUrl)) {
|
|
@@ -29,58 +31,58 @@ function webhookTrigger({ slug, description, input, model, matches, }) {
|
|
|
29
31
|
}
|
|
30
32
|
const delivery = req.data;
|
|
31
33
|
const cardId = matches(delivery, input);
|
|
32
|
-
if (!cardId)
|
|
33
|
-
return [];
|
|
34
|
+
if (!cardId) return [];
|
|
34
35
|
const card = cardOutput.parse(await client.getCard(cardId));
|
|
35
36
|
return [
|
|
36
37
|
{
|
|
37
38
|
dedupeKey: createHash('sha256').update(JSON.stringify(delivery)).digest('hex'),
|
|
38
|
-
data: card
|
|
39
|
-
}
|
|
39
|
+
data: card
|
|
40
|
+
}
|
|
40
41
|
];
|
|
41
|
-
}
|
|
42
|
+
}
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
const boardListInput = z.object({
|
|
45
46
|
boardId: z.string().min(1),
|
|
46
|
-
listId: z.string().optional()
|
|
47
|
+
listId: z.string().optional()
|
|
47
48
|
});
|
|
48
49
|
export const cardCreated = webhookTrigger({
|
|
49
50
|
slug: 'cardCreated',
|
|
50
51
|
description: 'Emit a card created on a board or optional list.',
|
|
51
52
|
input: boardListInput,
|
|
52
|
-
model: (input)
|
|
53
|
-
matches(delivery, input) {
|
|
53
|
+
model: (input)=>String(input.listId ?? input.boardId),
|
|
54
|
+
matches (delivery, input) {
|
|
54
55
|
const display = delivery.action?.display;
|
|
55
|
-
if (display?.translationKey !== 'action_create_card')
|
|
56
|
-
|
|
57
|
-
if (input.listId && display.entities?.list?.id !== input.listId)
|
|
58
|
-
return undefined;
|
|
56
|
+
if (display?.translationKey !== 'action_create_card') return undefined;
|
|
57
|
+
if (input.listId && display.entities?.list?.id !== input.listId) return undefined;
|
|
59
58
|
return display.entities?.card?.id;
|
|
60
|
-
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const movedInput = z.object({
|
|
62
|
+
boardId: z.string().min(1),
|
|
63
|
+
listId: z.string().min(1)
|
|
61
64
|
});
|
|
62
|
-
const movedInput = z.object({ boardId: z.string().min(1), listId: z.string().min(1) });
|
|
63
65
|
export const cardMovedToList = webhookTrigger({
|
|
64
66
|
slug: 'cardMovedToList',
|
|
65
67
|
description: 'Emit a card moved into a selected list.',
|
|
66
68
|
input: movedInput,
|
|
67
|
-
model: (input)
|
|
68
|
-
matches(delivery, input) {
|
|
69
|
+
model: (input)=>String(input.listId),
|
|
70
|
+
matches (delivery, input) {
|
|
69
71
|
const display = delivery.action?.display;
|
|
70
|
-
if (display?.translationKey !== 'action_move_card_from_list_to_list')
|
|
71
|
-
|
|
72
|
-
if (display.entities?.
|
|
73
|
-
return undefined;
|
|
74
|
-
if (display.entities?.listBefore?.id === input.listId)
|
|
75
|
-
return undefined;
|
|
72
|
+
if (display?.translationKey !== 'action_move_card_from_list_to_list') return undefined;
|
|
73
|
+
if (display.entities?.listAfter?.id !== input.listId) return undefined;
|
|
74
|
+
if (display.entities?.listBefore?.id === input.listId) return undefined;
|
|
76
75
|
return display.entities?.card?.id;
|
|
77
|
-
}
|
|
76
|
+
}
|
|
78
77
|
});
|
|
79
78
|
const deadlineInput = z.object({
|
|
80
79
|
boardId: z.string().min(1),
|
|
81
80
|
listId: z.string().optional(),
|
|
82
|
-
timeUnit: z.enum([
|
|
83
|
-
|
|
81
|
+
timeUnit: z.enum([
|
|
82
|
+
'minutes',
|
|
83
|
+
'hours'
|
|
84
|
+
]).default('hours'),
|
|
85
|
+
timeBeforeDue: z.number().min(0).default(24)
|
|
84
86
|
});
|
|
85
87
|
export const cardDeadline = definePollingTrigger({
|
|
86
88
|
slug: 'cardDeadline',
|
|
@@ -89,18 +91,22 @@ export const cardDeadline = definePollingTrigger({
|
|
|
89
91
|
schedule: '*/5 * * * *',
|
|
90
92
|
input: deadlineInput,
|
|
91
93
|
output: cardOutput,
|
|
92
|
-
async run({ client, input, cursor }) {
|
|
94
|
+
async run ({ client, input, cursor }) {
|
|
93
95
|
const since = typeof cursor === 'number' ? cursor : 0;
|
|
94
96
|
const path = input.listId ? `lists/${input.listId}/cards` : `boards/${input.boardId}/cards`;
|
|
95
97
|
const cards = await client.listAll(path);
|
|
96
98
|
const now = Date.now();
|
|
97
99
|
const range = input.timeBeforeDue * (input.timeUnit === 'minutes' ? 60_000 : 3_600_000);
|
|
98
|
-
const events = cards.filter((card)
|
|
100
|
+
const events = cards.filter((card)=>{
|
|
99
101
|
const due = card.due ? Date.parse(card.due) : Number.NaN;
|
|
100
102
|
return !card.dueComplete && due > now && due < now + range && due > since;
|
|
101
103
|
});
|
|
102
|
-
const latest = events.reduce((value, card)
|
|
103
|
-
return {
|
|
104
|
-
|
|
104
|
+
const latest = events.reduce((value, card)=>Math.max(value, Date.parse(card.due)), since);
|
|
105
|
+
return {
|
|
106
|
+
events,
|
|
107
|
+
cursor: latest
|
|
108
|
+
};
|
|
109
|
+
}
|
|
105
110
|
});
|
|
111
|
+
|
|
106
112
|
//# sourceMappingURL=triggers.js.map
|
package/dist/triggers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/triggers.ts"],"names":["createHash","z","definePollingTrigger","defineWebhookTrigger","cardOutput","webhookTrigger","slug","description","input","model","matches","type","output","onEnable","client","webhookUrl","idModel","existing","listWebhooks","find","webhook","callbackURL","createWebhook","webhookId","id","owned","onDisable","state","deleteWebhook","run","req","arrayBuffer","Error","body","Buffer","from","signature","headers","get","verifyWebhook","delivery","data","cardId","card","parse","getCard","dedupeKey","update","JSON","stringify","digest","boardListInput","object","boardId","string","min","listId","optional","cardCreated","String","display","action","translationKey","undefined","entities","list","movedInput","cardMovedToList","listAfter","listBefore","deadlineInput","timeUnit","enum","default","timeBeforeDue","number","cardDeadline","schedule","cursor","since","path","cards","listAll","now","Date","range","events","filter","due","Number","NaN","dueComplete","latest","reduce","value","Math","max"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,CAAC,QAAQ,MAAM;AAExB,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,cAAc;AACzE,SAASC,UAAU,QAAQ,eAAe;AAW1C,SAASC,eAAuE,EAC9EC,IAAI,EACJC,WAAW,EACXC,KAAK,EACLC,KAAK,EACLC,OAAO,EAOR;IACC,OAAOP,qBAAqB;QAC1BG;QACAC;QACAI,MAAM;QACNH;QACAI,QAAQR;QACR,MAAMS,UAAS,EAAEC,MAAM,EAAEN,KAAK,EAAEO,UAAU,EAAE;YAC1C,MAAMC,UAAUP,MAAMD;YACtB,MAAMS,WAAW,AAAC,CAAA,MAAMH,OAAOI,YAAY,EAAC,EAAGC,IAAI,CACjD,CAACC,UAAYA,QAAQJ,OAAO,KAAKA,WAAWI,QAAQC,WAAW,KAAKN;YAEtE,MAAMK,UAAUH,YAAa,MAAMH,OAAOQ,aAAa,CAACN,SAASD;YAEjE,OAAO;gBAAEQ,WAAWH,QAAQI,EAAE;gBAAET;gBAAYU,OAAO,CAACR;YAAS;QAC/D;QACA,MAAMS,WAAU,EAAEZ,MAAM,EAAEa,KAAK,EAAE;YAC/B,IAAIA,MAAMF,KAAK,EAAE,MAAMX,OAAOc,aAAa,CAACD,MAAMJ,SAAS;QAC7D;QACA,MAAMM,KAAI,EAAEf,MAAM,EAAEN,KAAK,EAAEsB,GAAG,EAAEH,KAAK,EAAE;YACrC,IAAI,CAACG,IAAIC,WAAW,EAAE,MAAM,IAAIC,MAAM;YAEtC,MAAMC,OAAOC,OAAOC,IAAI,CAAC,MAAML,IAAIC,WAAW;YAC9C,MAAMK,YAAYN,IAAIO,OAAO,CAACC,GAAG,CAAC;YAElC,IAAI,CAACxB,OAAOyB,aAAa,CAACN,MAAMG,WAAWT,MAAMZ,UAAU,GAAG;gBAC5D,MAAM,IAAIiB,MAAM;YAClB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AK6C,GAAG,GAAGJ,KAAKxC,KAAK,CAACD,KAAK6C,GAAG,IAAIC,OAAOC,GAAG;YAExD,OAAO,CAAC/C,KAAKgD,WAAW,IAAIH,MAAML,OAAOK,MAAML,MAAME,SAASG,MAAMT;QACtE;QACA,MAAMa,SAASN,OAAOO,MAAM,CAAC,CAACC,OAAOnD,OAASoD,KAAKC,GAAG,CAACF,OAAOV,KAAKxC,KAAK,CAACD,KAAK6C,GAAG,IAAKT;QAEtF,OAAO;YAAEO;YAAQR,QAAQc;QAAO;IAClC;AACF,GAAG","file":"triggers.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-trello",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Trello tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"zod": "^4.3.6"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"frogbot": "0.
|
|
25
|
+
"frogbot": "0.30.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "5.6.2",
|
|
29
|
-
"frogbot": "0.
|
|
29
|
+
"frogbot": "0.30.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "
|
|
35
|
+
"build": "node ../../../scripts/build-package.mjs",
|
|
36
36
|
"clean": "rm -rf dist",
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
}
|