@workbuddy/piece-workbuddy-edge 1.0.5 → 1.0.7
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/package.json +1 -1
- package/src/lib/auth.js +2 -2
- package/src/lib/auth.js.map +1 -1
- package/src/lib/auth.ts +2 -2
- package/src/lib/triggers/bill.d.ts +240 -48
- package/src/lib/triggers/bill.d.ts.map +1 -1
- package/src/lib/triggers/bill.js +288 -24
- package/src/lib/triggers/bill.js.map +1 -1
- package/src/lib/triggers/bill.ts +288 -24
- package/src/lib/triggers/invoice.d.ts +240 -48
- package/src/lib/triggers/invoice.d.ts.map +1 -1
- package/src/lib/triggers/invoice.js +288 -24
- package/src/lib/triggers/invoice.js.map +1 -1
- package/src/lib/triggers/invoice.ts +288 -24
- package/src/lib/triggers/job.d.ts +640 -128
- package/src/lib/triggers/job.d.ts.map +1 -1
- package/src/lib/triggers/job.js +768 -64
- package/src/lib/triggers/job.js.map +1 -1
- package/src/lib/triggers/job.ts +768 -64
- package/src/lib/triggers/lead.d.ts +400 -80
- package/src/lib/triggers/lead.d.ts.map +1 -1
- package/src/lib/triggers/lead.js +480 -40
- package/src/lib/triggers/lead.js.map +1 -1
- package/src/lib/triggers/lead.ts +480 -40
- package/src/lib/triggers/opportunity.d.ts +320 -64
- package/src/lib/triggers/opportunity.d.ts.map +1 -1
- package/src/lib/triggers/opportunity.js +384 -32
- package/src/lib/triggers/opportunity.js.map +1 -1
- package/src/lib/triggers/opportunity.ts +384 -32
- package/src/lib/triggers/quote.d.ts +240 -48
- package/src/lib/triggers/quote.d.ts.map +1 -1
- package/src/lib/triggers/quote.js +288 -24
- package/src/lib/triggers/quote.js.map +1 -1
- package/src/lib/triggers/quote.ts +288 -24
- package/src/lib/triggers/stage.d.ts +480 -96
- package/src/lib/triggers/stage.d.ts.map +1 -1
- package/src/lib/triggers/stage.js +576 -48
- package/src/lib/triggers/stage.js.map +1 -1
- package/src/lib/triggers/stage.ts +576 -48
- package/src/lib/triggers/task.d.ts +80 -16
- package/src/lib/triggers/task.d.ts.map +1 -1
- package/src/lib/triggers/task.js +96 -8
- package/src/lib/triggers/task.js.map +1 -1
- package/src/lib/triggers/task.ts +96 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lead.d.ts","sourceRoot":"","sources":["lead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,gCAAgC,CAAC;AAI1F,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"lead.d.ts","sourceRoot":"","sources":["lead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,gCAAgC,CAAC;AAI1F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqO/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqO/B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqOtC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqO/B,CAAC"}
|
package/src/lib/triggers/lead.js
CHANGED
|
@@ -10,20 +10,86 @@ exports.lead_created_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
10
10
|
displayName: 'Lead Created',
|
|
11
11
|
description: 'Triggered when a new lead is created',
|
|
12
12
|
props: {
|
|
13
|
-
customer: pieces_framework_1.Property.
|
|
13
|
+
customer: pieces_framework_1.Property.MultiSelectDropdown({
|
|
14
14
|
displayName: 'Filter by Customer',
|
|
15
|
-
description: 'Only trigger for specific customer
|
|
15
|
+
description: 'Only trigger for specific customer',
|
|
16
16
|
required: false,
|
|
17
|
+
auth: auth_1.workbuddyAuth,
|
|
18
|
+
refreshers: [],
|
|
19
|
+
options: async ({ auth }) => {
|
|
20
|
+
const authValue = auth;
|
|
21
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
22
|
+
const baseUrl = authValue.props.baseUrl;
|
|
23
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
24
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
25
|
+
url: `${baseUrl}/api/v2/public/customers`,
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: `Bearer ${token}`,
|
|
28
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const items = response.body?.items || [];
|
|
32
|
+
return {
|
|
33
|
+
options: items.map((item) => ({
|
|
34
|
+
label: item.name,
|
|
35
|
+
value: item.id,
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
17
39
|
}),
|
|
18
|
-
billingCompany: pieces_framework_1.Property.
|
|
40
|
+
billingCompany: pieces_framework_1.Property.MultiSelectDropdown({
|
|
19
41
|
displayName: 'Filter by Billing Company',
|
|
20
|
-
description: 'Only trigger for specific billing company
|
|
42
|
+
description: 'Only trigger for specific billing company',
|
|
21
43
|
required: false,
|
|
44
|
+
auth: auth_1.workbuddyAuth,
|
|
45
|
+
refreshers: [],
|
|
46
|
+
options: async ({ auth }) => {
|
|
47
|
+
const authValue = auth;
|
|
48
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
49
|
+
const baseUrl = authValue.props.baseUrl;
|
|
50
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
51
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
52
|
+
url: `${baseUrl}/api/v2/public/companies`,
|
|
53
|
+
headers: {
|
|
54
|
+
Authorization: `Bearer ${token}`,
|
|
55
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const items = response.body?.items || [];
|
|
59
|
+
return {
|
|
60
|
+
options: items.map((item) => ({
|
|
61
|
+
label: item.name,
|
|
62
|
+
value: item.id,
|
|
63
|
+
})),
|
|
64
|
+
};
|
|
65
|
+
},
|
|
22
66
|
}),
|
|
23
|
-
tag: pieces_framework_1.Property.
|
|
67
|
+
tag: pieces_framework_1.Property.MultiSelectDropdown({
|
|
24
68
|
displayName: 'Filter by Tags',
|
|
25
|
-
description: 'Only trigger for specific tags
|
|
69
|
+
description: 'Only trigger for specific tags',
|
|
26
70
|
required: false,
|
|
71
|
+
auth: auth_1.workbuddyAuth,
|
|
72
|
+
refreshers: [],
|
|
73
|
+
options: async ({ auth }) => {
|
|
74
|
+
const authValue = auth;
|
|
75
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
76
|
+
const baseUrl = authValue.props.baseUrl;
|
|
77
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
78
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
79
|
+
url: `${baseUrl}/api/v2/public/settings/tags`,
|
|
80
|
+
headers: {
|
|
81
|
+
Authorization: `Bearer ${token}`,
|
|
82
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
const items = response.body?.items || [];
|
|
86
|
+
return {
|
|
87
|
+
options: items.map((item) => ({
|
|
88
|
+
label: item.name,
|
|
89
|
+
value: item.id,
|
|
90
|
+
})),
|
|
91
|
+
};
|
|
92
|
+
},
|
|
27
93
|
}),
|
|
28
94
|
leadStage: pieces_framework_1.Property.Array({
|
|
29
95
|
displayName: 'Filter by Stage',
|
|
@@ -35,15 +101,59 @@ exports.lead_created_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
35
101
|
description: 'Only trigger for specific source IDs',
|
|
36
102
|
required: false,
|
|
37
103
|
}),
|
|
38
|
-
owner: pieces_framework_1.Property.
|
|
104
|
+
owner: pieces_framework_1.Property.MultiSelectDropdown({
|
|
39
105
|
displayName: 'Filter by Owner',
|
|
40
|
-
description: 'Only trigger for specific owner
|
|
106
|
+
description: 'Only trigger for specific owner',
|
|
41
107
|
required: false,
|
|
108
|
+
auth: auth_1.workbuddyAuth,
|
|
109
|
+
refreshers: [],
|
|
110
|
+
options: async ({ auth }) => {
|
|
111
|
+
const authValue = auth;
|
|
112
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
113
|
+
const baseUrl = authValue.props.baseUrl;
|
|
114
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
115
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
116
|
+
url: `${baseUrl}/api/v2/public/employees`,
|
|
117
|
+
headers: {
|
|
118
|
+
Authorization: `Bearer ${token}`,
|
|
119
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
const items = response.body?.items || [];
|
|
123
|
+
return {
|
|
124
|
+
options: items.map((item) => ({
|
|
125
|
+
label: item.name,
|
|
126
|
+
value: item.id,
|
|
127
|
+
})),
|
|
128
|
+
};
|
|
129
|
+
},
|
|
42
130
|
}),
|
|
43
|
-
type: pieces_framework_1.Property.
|
|
131
|
+
type: pieces_framework_1.Property.MultiSelectDropdown({
|
|
44
132
|
displayName: 'Filter by Job Type',
|
|
45
|
-
description: 'Only trigger for specific job type
|
|
133
|
+
description: 'Only trigger for specific job type',
|
|
46
134
|
required: false,
|
|
135
|
+
auth: auth_1.workbuddyAuth,
|
|
136
|
+
refreshers: [],
|
|
137
|
+
options: async ({ auth }) => {
|
|
138
|
+
const authValue = auth;
|
|
139
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
140
|
+
const baseUrl = authValue.props.baseUrl;
|
|
141
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
142
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
143
|
+
url: `${baseUrl}/api/v2/public/settings/job-types`,
|
|
144
|
+
headers: {
|
|
145
|
+
Authorization: `Bearer ${token}`,
|
|
146
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
const items = response.body?.items || [];
|
|
150
|
+
return {
|
|
151
|
+
options: items.map((item) => ({
|
|
152
|
+
label: item.name,
|
|
153
|
+
value: item.id,
|
|
154
|
+
})),
|
|
155
|
+
};
|
|
156
|
+
},
|
|
47
157
|
}),
|
|
48
158
|
},
|
|
49
159
|
sampleData: {
|
|
@@ -131,20 +241,86 @@ exports.lead_updated_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
131
241
|
displayName: 'Lead Updated',
|
|
132
242
|
description: 'Triggered when a lead is updated',
|
|
133
243
|
props: {
|
|
134
|
-
customer: pieces_framework_1.Property.
|
|
244
|
+
customer: pieces_framework_1.Property.MultiSelectDropdown({
|
|
135
245
|
displayName: 'Filter by Customer',
|
|
136
|
-
description: 'Only trigger for specific customer
|
|
246
|
+
description: 'Only trigger for specific customer',
|
|
137
247
|
required: false,
|
|
248
|
+
auth: auth_1.workbuddyAuth,
|
|
249
|
+
refreshers: [],
|
|
250
|
+
options: async ({ auth }) => {
|
|
251
|
+
const authValue = auth;
|
|
252
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
253
|
+
const baseUrl = authValue.props.baseUrl;
|
|
254
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
255
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
256
|
+
url: `${baseUrl}/api/v2/public/customers`,
|
|
257
|
+
headers: {
|
|
258
|
+
Authorization: `Bearer ${token}`,
|
|
259
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
const items = response.body?.items || [];
|
|
263
|
+
return {
|
|
264
|
+
options: items.map((item) => ({
|
|
265
|
+
label: item.name,
|
|
266
|
+
value: item.id,
|
|
267
|
+
})),
|
|
268
|
+
};
|
|
269
|
+
},
|
|
138
270
|
}),
|
|
139
|
-
billingCompany: pieces_framework_1.Property.
|
|
271
|
+
billingCompany: pieces_framework_1.Property.MultiSelectDropdown({
|
|
140
272
|
displayName: 'Filter by Billing Company',
|
|
141
|
-
description: 'Only trigger for specific billing company
|
|
273
|
+
description: 'Only trigger for specific billing company',
|
|
142
274
|
required: false,
|
|
275
|
+
auth: auth_1.workbuddyAuth,
|
|
276
|
+
refreshers: [],
|
|
277
|
+
options: async ({ auth }) => {
|
|
278
|
+
const authValue = auth;
|
|
279
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
280
|
+
const baseUrl = authValue.props.baseUrl;
|
|
281
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
282
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
283
|
+
url: `${baseUrl}/api/v2/public/companies`,
|
|
284
|
+
headers: {
|
|
285
|
+
Authorization: `Bearer ${token}`,
|
|
286
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
const items = response.body?.items || [];
|
|
290
|
+
return {
|
|
291
|
+
options: items.map((item) => ({
|
|
292
|
+
label: item.name,
|
|
293
|
+
value: item.id,
|
|
294
|
+
})),
|
|
295
|
+
};
|
|
296
|
+
},
|
|
143
297
|
}),
|
|
144
|
-
tag: pieces_framework_1.Property.
|
|
298
|
+
tag: pieces_framework_1.Property.MultiSelectDropdown({
|
|
145
299
|
displayName: 'Filter by Tags',
|
|
146
|
-
description: 'Only trigger for specific tags
|
|
300
|
+
description: 'Only trigger for specific tags',
|
|
147
301
|
required: false,
|
|
302
|
+
auth: auth_1.workbuddyAuth,
|
|
303
|
+
refreshers: [],
|
|
304
|
+
options: async ({ auth }) => {
|
|
305
|
+
const authValue = auth;
|
|
306
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
307
|
+
const baseUrl = authValue.props.baseUrl;
|
|
308
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
309
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
310
|
+
url: `${baseUrl}/api/v2/public/settings/tags`,
|
|
311
|
+
headers: {
|
|
312
|
+
Authorization: `Bearer ${token}`,
|
|
313
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
const items = response.body?.items || [];
|
|
317
|
+
return {
|
|
318
|
+
options: items.map((item) => ({
|
|
319
|
+
label: item.name,
|
|
320
|
+
value: item.id,
|
|
321
|
+
})),
|
|
322
|
+
};
|
|
323
|
+
},
|
|
148
324
|
}),
|
|
149
325
|
leadStage: pieces_framework_1.Property.Array({
|
|
150
326
|
displayName: 'Filter by Stage',
|
|
@@ -156,15 +332,59 @@ exports.lead_updated_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
156
332
|
description: 'Only trigger for specific source IDs',
|
|
157
333
|
required: false,
|
|
158
334
|
}),
|
|
159
|
-
owner: pieces_framework_1.Property.
|
|
335
|
+
owner: pieces_framework_1.Property.MultiSelectDropdown({
|
|
160
336
|
displayName: 'Filter by Owner',
|
|
161
|
-
description: 'Only trigger for specific owner
|
|
337
|
+
description: 'Only trigger for specific owner',
|
|
162
338
|
required: false,
|
|
339
|
+
auth: auth_1.workbuddyAuth,
|
|
340
|
+
refreshers: [],
|
|
341
|
+
options: async ({ auth }) => {
|
|
342
|
+
const authValue = auth;
|
|
343
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
344
|
+
const baseUrl = authValue.props.baseUrl;
|
|
345
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
346
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
347
|
+
url: `${baseUrl}/api/v2/public/employees`,
|
|
348
|
+
headers: {
|
|
349
|
+
Authorization: `Bearer ${token}`,
|
|
350
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
351
|
+
},
|
|
352
|
+
});
|
|
353
|
+
const items = response.body?.items || [];
|
|
354
|
+
return {
|
|
355
|
+
options: items.map((item) => ({
|
|
356
|
+
label: item.name,
|
|
357
|
+
value: item.id,
|
|
358
|
+
})),
|
|
359
|
+
};
|
|
360
|
+
},
|
|
163
361
|
}),
|
|
164
|
-
type: pieces_framework_1.Property.
|
|
362
|
+
type: pieces_framework_1.Property.MultiSelectDropdown({
|
|
165
363
|
displayName: 'Filter by Job Type',
|
|
166
|
-
description: 'Only trigger for specific job type
|
|
364
|
+
description: 'Only trigger for specific job type',
|
|
167
365
|
required: false,
|
|
366
|
+
auth: auth_1.workbuddyAuth,
|
|
367
|
+
refreshers: [],
|
|
368
|
+
options: async ({ auth }) => {
|
|
369
|
+
const authValue = auth;
|
|
370
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
371
|
+
const baseUrl = authValue.props.baseUrl;
|
|
372
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
373
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
374
|
+
url: `${baseUrl}/api/v2/public/settings/job-types`,
|
|
375
|
+
headers: {
|
|
376
|
+
Authorization: `Bearer ${token}`,
|
|
377
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
const items = response.body?.items || [];
|
|
381
|
+
return {
|
|
382
|
+
options: items.map((item) => ({
|
|
383
|
+
label: item.name,
|
|
384
|
+
value: item.id,
|
|
385
|
+
})),
|
|
386
|
+
};
|
|
387
|
+
},
|
|
168
388
|
}),
|
|
169
389
|
},
|
|
170
390
|
sampleData: {
|
|
@@ -252,20 +472,86 @@ exports.lead_status_changed_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
252
472
|
displayName: 'Lead Status Changed',
|
|
253
473
|
description: 'Triggered when a lead status changes',
|
|
254
474
|
props: {
|
|
255
|
-
customer: pieces_framework_1.Property.
|
|
475
|
+
customer: pieces_framework_1.Property.MultiSelectDropdown({
|
|
256
476
|
displayName: 'Filter by Customer',
|
|
257
|
-
description: 'Only trigger for specific customer
|
|
477
|
+
description: 'Only trigger for specific customer',
|
|
258
478
|
required: false,
|
|
479
|
+
auth: auth_1.workbuddyAuth,
|
|
480
|
+
refreshers: [],
|
|
481
|
+
options: async ({ auth }) => {
|
|
482
|
+
const authValue = auth;
|
|
483
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
484
|
+
const baseUrl = authValue.props.baseUrl;
|
|
485
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
486
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
487
|
+
url: `${baseUrl}/api/v2/public/customers`,
|
|
488
|
+
headers: {
|
|
489
|
+
Authorization: `Bearer ${token}`,
|
|
490
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
491
|
+
},
|
|
492
|
+
});
|
|
493
|
+
const items = response.body?.items || [];
|
|
494
|
+
return {
|
|
495
|
+
options: items.map((item) => ({
|
|
496
|
+
label: item.name,
|
|
497
|
+
value: item.id,
|
|
498
|
+
})),
|
|
499
|
+
};
|
|
500
|
+
},
|
|
259
501
|
}),
|
|
260
|
-
billingCompany: pieces_framework_1.Property.
|
|
502
|
+
billingCompany: pieces_framework_1.Property.MultiSelectDropdown({
|
|
261
503
|
displayName: 'Filter by Billing Company',
|
|
262
|
-
description: 'Only trigger for specific billing company
|
|
504
|
+
description: 'Only trigger for specific billing company',
|
|
263
505
|
required: false,
|
|
506
|
+
auth: auth_1.workbuddyAuth,
|
|
507
|
+
refreshers: [],
|
|
508
|
+
options: async ({ auth }) => {
|
|
509
|
+
const authValue = auth;
|
|
510
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
511
|
+
const baseUrl = authValue.props.baseUrl;
|
|
512
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
513
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
514
|
+
url: `${baseUrl}/api/v2/public/companies`,
|
|
515
|
+
headers: {
|
|
516
|
+
Authorization: `Bearer ${token}`,
|
|
517
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
518
|
+
},
|
|
519
|
+
});
|
|
520
|
+
const items = response.body?.items || [];
|
|
521
|
+
return {
|
|
522
|
+
options: items.map((item) => ({
|
|
523
|
+
label: item.name,
|
|
524
|
+
value: item.id,
|
|
525
|
+
})),
|
|
526
|
+
};
|
|
527
|
+
},
|
|
264
528
|
}),
|
|
265
|
-
tag: pieces_framework_1.Property.
|
|
529
|
+
tag: pieces_framework_1.Property.MultiSelectDropdown({
|
|
266
530
|
displayName: 'Filter by Tags',
|
|
267
|
-
description: 'Only trigger for specific tags
|
|
531
|
+
description: 'Only trigger for specific tags',
|
|
268
532
|
required: false,
|
|
533
|
+
auth: auth_1.workbuddyAuth,
|
|
534
|
+
refreshers: [],
|
|
535
|
+
options: async ({ auth }) => {
|
|
536
|
+
const authValue = auth;
|
|
537
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
538
|
+
const baseUrl = authValue.props.baseUrl;
|
|
539
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
540
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
541
|
+
url: `${baseUrl}/api/v2/public/settings/tags`,
|
|
542
|
+
headers: {
|
|
543
|
+
Authorization: `Bearer ${token}`,
|
|
544
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
545
|
+
},
|
|
546
|
+
});
|
|
547
|
+
const items = response.body?.items || [];
|
|
548
|
+
return {
|
|
549
|
+
options: items.map((item) => ({
|
|
550
|
+
label: item.name,
|
|
551
|
+
value: item.id,
|
|
552
|
+
})),
|
|
553
|
+
};
|
|
554
|
+
},
|
|
269
555
|
}),
|
|
270
556
|
leadStage: pieces_framework_1.Property.Array({
|
|
271
557
|
displayName: 'Filter by Stage',
|
|
@@ -277,15 +563,59 @@ exports.lead_status_changed_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
277
563
|
description: 'Only trigger for specific source IDs',
|
|
278
564
|
required: false,
|
|
279
565
|
}),
|
|
280
|
-
owner: pieces_framework_1.Property.
|
|
566
|
+
owner: pieces_framework_1.Property.MultiSelectDropdown({
|
|
281
567
|
displayName: 'Filter by Owner',
|
|
282
|
-
description: 'Only trigger for specific owner
|
|
568
|
+
description: 'Only trigger for specific owner',
|
|
283
569
|
required: false,
|
|
570
|
+
auth: auth_1.workbuddyAuth,
|
|
571
|
+
refreshers: [],
|
|
572
|
+
options: async ({ auth }) => {
|
|
573
|
+
const authValue = auth;
|
|
574
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
575
|
+
const baseUrl = authValue.props.baseUrl;
|
|
576
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
577
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
578
|
+
url: `${baseUrl}/api/v2/public/employees`,
|
|
579
|
+
headers: {
|
|
580
|
+
Authorization: `Bearer ${token}`,
|
|
581
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
582
|
+
},
|
|
583
|
+
});
|
|
584
|
+
const items = response.body?.items || [];
|
|
585
|
+
return {
|
|
586
|
+
options: items.map((item) => ({
|
|
587
|
+
label: item.name,
|
|
588
|
+
value: item.id,
|
|
589
|
+
})),
|
|
590
|
+
};
|
|
591
|
+
},
|
|
284
592
|
}),
|
|
285
|
-
type: pieces_framework_1.Property.
|
|
593
|
+
type: pieces_framework_1.Property.MultiSelectDropdown({
|
|
286
594
|
displayName: 'Filter by Job Type',
|
|
287
|
-
description: 'Only trigger for specific job type
|
|
595
|
+
description: 'Only trigger for specific job type',
|
|
288
596
|
required: false,
|
|
597
|
+
auth: auth_1.workbuddyAuth,
|
|
598
|
+
refreshers: [],
|
|
599
|
+
options: async ({ auth }) => {
|
|
600
|
+
const authValue = auth;
|
|
601
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
602
|
+
const baseUrl = authValue.props.baseUrl;
|
|
603
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
604
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
605
|
+
url: `${baseUrl}/api/v2/public/settings/job-types`,
|
|
606
|
+
headers: {
|
|
607
|
+
Authorization: `Bearer ${token}`,
|
|
608
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
609
|
+
},
|
|
610
|
+
});
|
|
611
|
+
const items = response.body?.items || [];
|
|
612
|
+
return {
|
|
613
|
+
options: items.map((item) => ({
|
|
614
|
+
label: item.name,
|
|
615
|
+
value: item.id,
|
|
616
|
+
})),
|
|
617
|
+
};
|
|
618
|
+
},
|
|
289
619
|
}),
|
|
290
620
|
},
|
|
291
621
|
sampleData: {
|
|
@@ -373,20 +703,86 @@ exports.lead_deleted_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
373
703
|
displayName: 'Lead Deleted',
|
|
374
704
|
description: 'Triggered when a lead is deleted',
|
|
375
705
|
props: {
|
|
376
|
-
customer: pieces_framework_1.Property.
|
|
706
|
+
customer: pieces_framework_1.Property.MultiSelectDropdown({
|
|
377
707
|
displayName: 'Filter by Customer',
|
|
378
|
-
description: 'Only trigger for specific customer
|
|
708
|
+
description: 'Only trigger for specific customer',
|
|
379
709
|
required: false,
|
|
710
|
+
auth: auth_1.workbuddyAuth,
|
|
711
|
+
refreshers: [],
|
|
712
|
+
options: async ({ auth }) => {
|
|
713
|
+
const authValue = auth;
|
|
714
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
715
|
+
const baseUrl = authValue.props.baseUrl;
|
|
716
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
717
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
718
|
+
url: `${baseUrl}/api/v2/public/customers`,
|
|
719
|
+
headers: {
|
|
720
|
+
Authorization: `Bearer ${token}`,
|
|
721
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
722
|
+
},
|
|
723
|
+
});
|
|
724
|
+
const items = response.body?.items || [];
|
|
725
|
+
return {
|
|
726
|
+
options: items.map((item) => ({
|
|
727
|
+
label: item.name,
|
|
728
|
+
value: item.id,
|
|
729
|
+
})),
|
|
730
|
+
};
|
|
731
|
+
},
|
|
380
732
|
}),
|
|
381
|
-
billingCompany: pieces_framework_1.Property.
|
|
733
|
+
billingCompany: pieces_framework_1.Property.MultiSelectDropdown({
|
|
382
734
|
displayName: 'Filter by Billing Company',
|
|
383
|
-
description: 'Only trigger for specific billing company
|
|
735
|
+
description: 'Only trigger for specific billing company',
|
|
384
736
|
required: false,
|
|
737
|
+
auth: auth_1.workbuddyAuth,
|
|
738
|
+
refreshers: [],
|
|
739
|
+
options: async ({ auth }) => {
|
|
740
|
+
const authValue = auth;
|
|
741
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
742
|
+
const baseUrl = authValue.props.baseUrl;
|
|
743
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
744
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
745
|
+
url: `${baseUrl}/api/v2/public/companies`,
|
|
746
|
+
headers: {
|
|
747
|
+
Authorization: `Bearer ${token}`,
|
|
748
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
const items = response.body?.items || [];
|
|
752
|
+
return {
|
|
753
|
+
options: items.map((item) => ({
|
|
754
|
+
label: item.name,
|
|
755
|
+
value: item.id,
|
|
756
|
+
})),
|
|
757
|
+
};
|
|
758
|
+
},
|
|
385
759
|
}),
|
|
386
|
-
tag: pieces_framework_1.Property.
|
|
760
|
+
tag: pieces_framework_1.Property.MultiSelectDropdown({
|
|
387
761
|
displayName: 'Filter by Tags',
|
|
388
|
-
description: 'Only trigger for specific tags
|
|
762
|
+
description: 'Only trigger for specific tags',
|
|
389
763
|
required: false,
|
|
764
|
+
auth: auth_1.workbuddyAuth,
|
|
765
|
+
refreshers: [],
|
|
766
|
+
options: async ({ auth }) => {
|
|
767
|
+
const authValue = auth;
|
|
768
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
769
|
+
const baseUrl = authValue.props.baseUrl;
|
|
770
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
771
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
772
|
+
url: `${baseUrl}/api/v2/public/settings/tags`,
|
|
773
|
+
headers: {
|
|
774
|
+
Authorization: `Bearer ${token}`,
|
|
775
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
776
|
+
},
|
|
777
|
+
});
|
|
778
|
+
const items = response.body?.items || [];
|
|
779
|
+
return {
|
|
780
|
+
options: items.map((item) => ({
|
|
781
|
+
label: item.name,
|
|
782
|
+
value: item.id,
|
|
783
|
+
})),
|
|
784
|
+
};
|
|
785
|
+
},
|
|
390
786
|
}),
|
|
391
787
|
leadStage: pieces_framework_1.Property.Array({
|
|
392
788
|
displayName: 'Filter by Stage',
|
|
@@ -398,15 +794,59 @@ exports.lead_deleted_trigger = (0, pieces_framework_1.createTrigger)({
|
|
|
398
794
|
description: 'Only trigger for specific source IDs',
|
|
399
795
|
required: false,
|
|
400
796
|
}),
|
|
401
|
-
owner: pieces_framework_1.Property.
|
|
797
|
+
owner: pieces_framework_1.Property.MultiSelectDropdown({
|
|
402
798
|
displayName: 'Filter by Owner',
|
|
403
|
-
description: 'Only trigger for specific owner
|
|
799
|
+
description: 'Only trigger for specific owner',
|
|
404
800
|
required: false,
|
|
801
|
+
auth: auth_1.workbuddyAuth,
|
|
802
|
+
refreshers: [],
|
|
803
|
+
options: async ({ auth }) => {
|
|
804
|
+
const authValue = auth;
|
|
805
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
806
|
+
const baseUrl = authValue.props.baseUrl;
|
|
807
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
808
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
809
|
+
url: `${baseUrl}/api/v2/public/employees`,
|
|
810
|
+
headers: {
|
|
811
|
+
Authorization: `Bearer ${token}`,
|
|
812
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
813
|
+
},
|
|
814
|
+
});
|
|
815
|
+
const items = response.body?.items || [];
|
|
816
|
+
return {
|
|
817
|
+
options: items.map((item) => ({
|
|
818
|
+
label: item.name,
|
|
819
|
+
value: item.id,
|
|
820
|
+
})),
|
|
821
|
+
};
|
|
822
|
+
},
|
|
405
823
|
}),
|
|
406
|
-
type: pieces_framework_1.Property.
|
|
824
|
+
type: pieces_framework_1.Property.MultiSelectDropdown({
|
|
407
825
|
displayName: 'Filter by Job Type',
|
|
408
|
-
description: 'Only trigger for specific job type
|
|
826
|
+
description: 'Only trigger for specific job type',
|
|
409
827
|
required: false,
|
|
828
|
+
auth: auth_1.workbuddyAuth,
|
|
829
|
+
refreshers: [],
|
|
830
|
+
options: async ({ auth }) => {
|
|
831
|
+
const authValue = auth;
|
|
832
|
+
const token = await (0, auth_1.getAccessToken)(authValue);
|
|
833
|
+
const baseUrl = authValue.props.baseUrl;
|
|
834
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
835
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
836
|
+
url: `${baseUrl}/api/v2/public/settings/job-types`,
|
|
837
|
+
headers: {
|
|
838
|
+
Authorization: `Bearer ${token}`,
|
|
839
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
840
|
+
},
|
|
841
|
+
});
|
|
842
|
+
const items = response.body?.items || [];
|
|
843
|
+
return {
|
|
844
|
+
options: items.map((item) => ({
|
|
845
|
+
label: item.name,
|
|
846
|
+
value: item.id,
|
|
847
|
+
})),
|
|
848
|
+
};
|
|
849
|
+
},
|
|
410
850
|
}),
|
|
411
851
|
},
|
|
412
852
|
sampleData: {
|