@workbuddy/piece-workbuddy-edge 1.0.5 → 1.0.6

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