@workbuddy/piece-workbuddy-edge 1.0.4 → 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 (168) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +83 -83
  3. package/src/index.js.map +1 -1
  4. package/src/index.ts +17 -17
  5. package/src/lib/actions/{crm->-companies.d.ts → crm-companies.d.ts} +1 -1
  6. package/src/lib/actions/crm-companies.d.ts.map +1 -0
  7. package/src/lib/actions/{crm->-companies.js → crm-companies.js} +1 -1
  8. package/src/lib/actions/{crm->-invites.js.map → crm-companies.js.map} +1 -1
  9. package/src/lib/actions/{crm->-contacts.d.ts → crm-contacts.d.ts} +1 -1
  10. package/src/lib/actions/crm-contacts.d.ts.map +1 -0
  11. package/src/lib/actions/{crm->-contacts.js → crm-contacts.js} +1 -1
  12. package/src/lib/actions/crm-contacts.js.map +1 -0
  13. package/src/lib/actions/{crm->-contractors.d.ts → crm-contractors.d.ts} +1 -1
  14. package/src/lib/actions/crm-contractors.d.ts.map +1 -0
  15. package/src/lib/actions/{crm->-contractors.js → crm-contractors.js} +1 -1
  16. package/src/lib/actions/{crm->-employees.js.map → crm-contractors.js.map} +1 -1
  17. package/src/lib/actions/{crm->-customers.d.ts → crm-customers.d.ts} +1 -1
  18. package/src/lib/actions/crm-customers.d.ts.map +1 -0
  19. package/src/lib/actions/{crm->-customers.js → crm-customers.js} +1 -1
  20. package/src/lib/actions/crm-customers.js.map +1 -0
  21. package/src/lib/actions/{crm->-employees.d.ts → crm-employees.d.ts} +1 -1
  22. package/src/lib/actions/crm-employees.d.ts.map +1 -0
  23. package/src/lib/actions/{crm->-employees.js → crm-employees.js} +1 -1
  24. package/src/lib/actions/crm-employees.js.map +1 -0
  25. package/src/lib/actions/{crm->-external-users.d.ts → crm-external-users.d.ts} +1 -1
  26. package/src/lib/actions/crm-external-users.d.ts.map +1 -0
  27. package/src/lib/actions/{crm->-external-users.js → crm-external-users.js} +1 -1
  28. package/src/lib/actions/crm-external-users.js.map +1 -0
  29. package/src/lib/actions/{crm->-invites.d.ts → crm-invites.d.ts} +1 -1
  30. package/src/lib/actions/crm-invites.d.ts.map +1 -0
  31. package/src/lib/actions/{crm->-invites.js → crm-invites.js} +1 -1
  32. package/src/lib/actions/crm-invites.js.map +1 -0
  33. package/src/lib/actions/{crm->-sites.d.ts → crm-sites.d.ts} +1 -1
  34. package/src/lib/actions/crm-sites.d.ts.map +1 -0
  35. package/src/lib/actions/{crm->-sites.js → crm-sites.js} +1 -1
  36. package/src/lib/actions/crm-sites.js.map +1 -0
  37. package/src/lib/actions/{crm->-suppliers.d.ts → crm-suppliers.d.ts} +1 -1
  38. package/src/lib/actions/crm-suppliers.d.ts.map +1 -0
  39. package/src/lib/actions/{crm->-suppliers.js → crm-suppliers.js} +1 -1
  40. package/src/lib/actions/crm-suppliers.js.map +1 -0
  41. package/src/lib/actions/index.d.ts +17 -17
  42. package/src/lib/actions/index.d.ts.map +1 -1
  43. package/src/lib/actions/index.js +17 -17
  44. package/src/lib/actions/index.js.map +1 -1
  45. package/src/lib/actions/index.ts +17 -17
  46. package/src/lib/actions/{jobs->-activities.d.ts → jobs-activities.d.ts} +1 -1
  47. package/src/lib/actions/jobs-activities.d.ts.map +1 -0
  48. package/src/lib/actions/{jobs->-activities.js → jobs-activities.js} +1 -1
  49. package/src/lib/actions/jobs-activities.js.map +1 -0
  50. package/src/lib/actions/{jobs->-contacts.d.ts → jobs-contacts.d.ts} +1 -1
  51. package/src/lib/actions/jobs-contacts.d.ts.map +1 -0
  52. package/src/lib/actions/{jobs->-contacts.js → jobs-contacts.js} +1 -1
  53. package/src/lib/actions/jobs-contacts.js.map +1 -0
  54. package/src/lib/actions/{jobs->-files.d.ts → jobs-files.d.ts} +1 -1
  55. package/src/lib/actions/jobs-files.d.ts.map +1 -0
  56. package/src/lib/actions/{jobs->-files.js → jobs-files.js} +1 -1
  57. package/src/lib/actions/jobs-files.js.map +1 -0
  58. package/src/lib/actions/{jobs->-tasks.d.ts → jobs-tasks.d.ts} +1 -1
  59. package/src/lib/actions/jobs-tasks.d.ts.map +1 -0
  60. package/src/lib/actions/{jobs->-tasks.js → jobs-tasks.js} +1 -1
  61. package/src/lib/actions/jobs-tasks.js.map +1 -0
  62. package/src/lib/actions/{stages->-activities.d.ts → stages-activities.d.ts} +1 -1
  63. package/src/lib/actions/stages-activities.d.ts.map +1 -0
  64. package/src/lib/actions/{stages->-activities.js → stages-activities.js} +1 -1
  65. package/src/lib/actions/{jobs->-activities.js.map → stages-activities.js.map} +1 -1
  66. package/src/lib/actions/{stages->-files.d.ts → stages-files.d.ts} +1 -1
  67. package/src/lib/actions/stages-files.d.ts.map +1 -0
  68. package/src/lib/actions/{stages->-files.js → stages-files.js} +1 -1
  69. package/src/lib/actions/stages-files.js.map +1 -0
  70. package/src/lib/actions/{stages->-resources.d.ts → stages-resources.d.ts} +1 -1
  71. package/src/lib/actions/stages-resources.d.ts.map +1 -0
  72. package/src/lib/actions/{stages->-resources.js → stages-resources.js} +1 -1
  73. package/src/lib/actions/stages-resources.js.map +1 -0
  74. package/src/lib/actions/{stages->-tasks.d.ts → stages-tasks.d.ts} +1 -1
  75. package/src/lib/actions/stages-tasks.d.ts.map +1 -0
  76. package/src/lib/actions/{stages->-tasks.js → stages-tasks.js} +1 -1
  77. package/src/lib/actions/stages-tasks.js.map +1 -0
  78. package/src/lib/auth.js +2 -2
  79. package/src/lib/auth.js.map +1 -1
  80. package/src/lib/auth.ts +2 -2
  81. package/src/lib/triggers/bill.d.ts +240 -48
  82. package/src/lib/triggers/bill.d.ts.map +1 -1
  83. package/src/lib/triggers/bill.js +288 -24
  84. package/src/lib/triggers/bill.js.map +1 -1
  85. package/src/lib/triggers/bill.ts +288 -24
  86. package/src/lib/triggers/invoice.d.ts +240 -48
  87. package/src/lib/triggers/invoice.d.ts.map +1 -1
  88. package/src/lib/triggers/invoice.js +288 -24
  89. package/src/lib/triggers/invoice.js.map +1 -1
  90. package/src/lib/triggers/invoice.ts +288 -24
  91. package/src/lib/triggers/job.d.ts +640 -128
  92. package/src/lib/triggers/job.d.ts.map +1 -1
  93. package/src/lib/triggers/job.js +768 -64
  94. package/src/lib/triggers/job.js.map +1 -1
  95. package/src/lib/triggers/job.ts +768 -64
  96. package/src/lib/triggers/lead.d.ts +400 -80
  97. package/src/lib/triggers/lead.d.ts.map +1 -1
  98. package/src/lib/triggers/lead.js +480 -40
  99. package/src/lib/triggers/lead.js.map +1 -1
  100. package/src/lib/triggers/lead.ts +480 -40
  101. package/src/lib/triggers/opportunity.d.ts +320 -64
  102. package/src/lib/triggers/opportunity.d.ts.map +1 -1
  103. package/src/lib/triggers/opportunity.js +384 -32
  104. package/src/lib/triggers/opportunity.js.map +1 -1
  105. package/src/lib/triggers/opportunity.ts +384 -32
  106. package/src/lib/triggers/quote.d.ts +240 -48
  107. package/src/lib/triggers/quote.d.ts.map +1 -1
  108. package/src/lib/triggers/quote.js +288 -24
  109. package/src/lib/triggers/quote.js.map +1 -1
  110. package/src/lib/triggers/quote.ts +288 -24
  111. package/src/lib/triggers/stage.d.ts +480 -96
  112. package/src/lib/triggers/stage.d.ts.map +1 -1
  113. package/src/lib/triggers/stage.js +576 -48
  114. package/src/lib/triggers/stage.js.map +1 -1
  115. package/src/lib/triggers/stage.ts +576 -48
  116. package/src/lib/triggers/task.d.ts +80 -16
  117. package/src/lib/triggers/task.d.ts.map +1 -1
  118. package/src/lib/triggers/task.js +96 -8
  119. package/src/lib/triggers/task.js.map +1 -1
  120. package/src/lib/triggers/task.ts +96 -8
  121. package/src/lib/actions/crm->-companies.d.ts.map +0 -1
  122. package/src/lib/actions/crm->-companies.js.map +0 -1
  123. package/src/lib/actions/crm->-contacts.d.ts.map +0 -1
  124. package/src/lib/actions/crm->-contacts.js.map +0 -1
  125. package/src/lib/actions/crm->-contractors.d.ts.map +0 -1
  126. package/src/lib/actions/crm->-contractors.js.map +0 -1
  127. package/src/lib/actions/crm->-customers.d.ts.map +0 -1
  128. package/src/lib/actions/crm->-customers.js.map +0 -1
  129. package/src/lib/actions/crm->-employees.d.ts.map +0 -1
  130. package/src/lib/actions/crm->-external-users.d.ts.map +0 -1
  131. package/src/lib/actions/crm->-external-users.js.map +0 -1
  132. package/src/lib/actions/crm->-invites.d.ts.map +0 -1
  133. package/src/lib/actions/crm->-sites.d.ts.map +0 -1
  134. package/src/lib/actions/crm->-sites.js.map +0 -1
  135. package/src/lib/actions/crm->-suppliers.d.ts.map +0 -1
  136. package/src/lib/actions/crm->-suppliers.js.map +0 -1
  137. package/src/lib/actions/jobs->-activities.d.ts.map +0 -1
  138. package/src/lib/actions/jobs->-contacts.d.ts.map +0 -1
  139. package/src/lib/actions/jobs->-contacts.js.map +0 -1
  140. package/src/lib/actions/jobs->-files.d.ts.map +0 -1
  141. package/src/lib/actions/jobs->-files.js.map +0 -1
  142. package/src/lib/actions/jobs->-tasks.d.ts.map +0 -1
  143. package/src/lib/actions/jobs->-tasks.js.map +0 -1
  144. package/src/lib/actions/stages->-activities.d.ts.map +0 -1
  145. package/src/lib/actions/stages->-activities.js.map +0 -1
  146. package/src/lib/actions/stages->-files.d.ts.map +0 -1
  147. package/src/lib/actions/stages->-files.js.map +0 -1
  148. package/src/lib/actions/stages->-resources.d.ts.map +0 -1
  149. package/src/lib/actions/stages->-resources.js.map +0 -1
  150. package/src/lib/actions/stages->-tasks.d.ts.map +0 -1
  151. package/src/lib/actions/stages->-tasks.js.map +0 -1
  152. /package/src/lib/actions/{crm->-companies.ts → crm-companies.ts} +0 -0
  153. /package/src/lib/actions/{crm->-contacts.ts → crm-contacts.ts} +0 -0
  154. /package/src/lib/actions/{crm->-contractors.ts → crm-contractors.ts} +0 -0
  155. /package/src/lib/actions/{crm->-customers.ts → crm-customers.ts} +0 -0
  156. /package/src/lib/actions/{crm->-employees.ts → crm-employees.ts} +0 -0
  157. /package/src/lib/actions/{crm->-external-users.ts → crm-external-users.ts} +0 -0
  158. /package/src/lib/actions/{crm->-invites.ts → crm-invites.ts} +0 -0
  159. /package/src/lib/actions/{crm->-sites.ts → crm-sites.ts} +0 -0
  160. /package/src/lib/actions/{crm->-suppliers.ts → crm-suppliers.ts} +0 -0
  161. /package/src/lib/actions/{jobs->-activities.ts → jobs-activities.ts} +0 -0
  162. /package/src/lib/actions/{jobs->-contacts.ts → jobs-contacts.ts} +0 -0
  163. /package/src/lib/actions/{jobs->-files.ts → jobs-files.ts} +0 -0
  164. /package/src/lib/actions/{jobs->-tasks.ts → jobs-tasks.ts} +0 -0
  165. /package/src/lib/actions/{stages->-activities.ts → stages-activities.ts} +0 -0
  166. /package/src/lib/actions/{stages->-files.ts → stages-files.ts} +0 -0
  167. /package/src/lib/actions/{stages->-resources.ts → stages-resources.ts} +0 -0
  168. /package/src/lib/actions/{stages->-tasks.ts → stages-tasks.ts} +0 -0
@@ -8,30 +8,140 @@ export const stage_created_trigger = createTrigger({
8
8
  displayName: 'Stage Created',
9
9
  description: 'Triggered when a new stage 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
- resource: Property.Array({
92
+ resource: Property.MultiSelectDropdown({
27
93
  displayName: 'Filter by Resource',
28
- description: 'Only trigger for specific resource IDs',
94
+ description: 'Only trigger for specific resource',
29
95
  required: false,
96
+ auth: workbuddyAuth,
97
+ refreshers: [],
98
+ options: async ({ auth }) => {
99
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
100
+ const token = await getAccessToken(authValue);
101
+ const baseUrl = authValue.props.baseUrl;
102
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
103
+ method: HttpMethod.GET,
104
+ url: `${baseUrl}/api/v2/public/employees`,
105
+ headers: {
106
+ Authorization: `Bearer ${token}`,
107
+ 'X-WorkBuddy-Version': '2026-01',
108
+ },
109
+ });
110
+ const items = response.body?.items || [];
111
+ return {
112
+ options: items.map((item) => ({
113
+ label: item.name,
114
+ value: item.id,
115
+ })),
116
+ };
117
+ },
30
118
  }),
31
- workCategory: Property.Array({
119
+ workCategory: Property.MultiSelectDropdown({
32
120
  displayName: 'Filter by Work Category',
33
- description: 'Only trigger for specific work category IDs',
121
+ description: 'Only trigger for specific work category',
34
122
  required: false,
123
+ auth: workbuddyAuth,
124
+ refreshers: [],
125
+ options: async ({ auth }) => {
126
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
127
+ const token = await getAccessToken(authValue);
128
+ const baseUrl = authValue.props.baseUrl;
129
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
130
+ method: HttpMethod.GET,
131
+ url: `${baseUrl}/api/v2/public/settings/work-types`,
132
+ headers: {
133
+ Authorization: `Bearer ${token}`,
134
+ 'X-WorkBuddy-Version': '2026-01',
135
+ },
136
+ });
137
+ const items = response.body?.items || [];
138
+ return {
139
+ options: items.map((item) => ({
140
+ label: item.name,
141
+ value: item.id,
142
+ })),
143
+ };
144
+ },
35
145
  }),
36
146
  stageStatus: Property.StaticMultiSelectDropdown({
37
147
  displayName: 'Filter by Status',
@@ -47,10 +157,32 @@ export const stage_created_trigger = createTrigger({
47
157
  ],
48
158
  },
49
159
  }),
50
- schedulingTag: Property.Array({
160
+ schedulingTag: Property.MultiSelectDropdown({
51
161
  displayName: 'Filter by Scheduling Tag',
52
- description: 'Only trigger for specific scheduling tag IDs',
162
+ description: 'Only trigger for specific scheduling tag',
53
163
  required: false,
164
+ auth: workbuddyAuth,
165
+ refreshers: [],
166
+ options: async ({ auth }) => {
167
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
168
+ const token = await getAccessToken(authValue);
169
+ const baseUrl = authValue.props.baseUrl;
170
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
171
+ method: HttpMethod.GET,
172
+ url: `${baseUrl}/api/v2/public/settings/tags?type=scheduling`,
173
+ headers: {
174
+ Authorization: `Bearer ${token}`,
175
+ 'X-WorkBuddy-Version': '2026-01',
176
+ },
177
+ });
178
+ const items = response.body?.items || [];
179
+ return {
180
+ options: items.map((item) => ({
181
+ label: item.name,
182
+ value: item.id,
183
+ })),
184
+ };
185
+ },
54
186
  }),
55
187
  },
56
188
  sampleData: {
@@ -181,30 +313,140 @@ export const stage_updated_trigger = createTrigger({
181
313
  displayName: 'Stage Updated',
182
314
  description: 'Triggered when a stage is updated',
183
315
  props: {
184
- customer: Property.Array({
316
+ customer: Property.MultiSelectDropdown({
185
317
  displayName: 'Filter by Customer',
186
- description: 'Only trigger for specific customer IDs',
318
+ description: 'Only trigger for specific customer',
187
319
  required: false,
320
+ auth: workbuddyAuth,
321
+ refreshers: [],
322
+ options: async ({ auth }) => {
323
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
324
+ const token = await getAccessToken(authValue);
325
+ const baseUrl = authValue.props.baseUrl;
326
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
327
+ method: HttpMethod.GET,
328
+ url: `${baseUrl}/api/v2/public/customers`,
329
+ headers: {
330
+ Authorization: `Bearer ${token}`,
331
+ 'X-WorkBuddy-Version': '2026-01',
332
+ },
333
+ });
334
+ const items = response.body?.items || [];
335
+ return {
336
+ options: items.map((item) => ({
337
+ label: item.name,
338
+ value: item.id,
339
+ })),
340
+ };
341
+ },
188
342
  }),
189
- billingCompany: Property.Array({
343
+ billingCompany: Property.MultiSelectDropdown({
190
344
  displayName: 'Filter by Billing Company',
191
- description: 'Only trigger for specific billing company IDs',
345
+ description: 'Only trigger for specific billing company',
192
346
  required: false,
347
+ auth: workbuddyAuth,
348
+ refreshers: [],
349
+ options: async ({ auth }) => {
350
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
351
+ const token = await getAccessToken(authValue);
352
+ const baseUrl = authValue.props.baseUrl;
353
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
354
+ method: HttpMethod.GET,
355
+ url: `${baseUrl}/api/v2/public/companies`,
356
+ headers: {
357
+ Authorization: `Bearer ${token}`,
358
+ 'X-WorkBuddy-Version': '2026-01',
359
+ },
360
+ });
361
+ const items = response.body?.items || [];
362
+ return {
363
+ options: items.map((item) => ({
364
+ label: item.name,
365
+ value: item.id,
366
+ })),
367
+ };
368
+ },
193
369
  }),
194
- tag: Property.Array({
370
+ tag: Property.MultiSelectDropdown({
195
371
  displayName: 'Filter by Tags',
196
- description: 'Only trigger for specific tags IDs',
372
+ description: 'Only trigger for specific tags',
197
373
  required: false,
374
+ auth: workbuddyAuth,
375
+ refreshers: [],
376
+ options: async ({ auth }) => {
377
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
378
+ const token = await getAccessToken(authValue);
379
+ const baseUrl = authValue.props.baseUrl;
380
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
381
+ method: HttpMethod.GET,
382
+ url: `${baseUrl}/api/v2/public/settings/tags`,
383
+ headers: {
384
+ Authorization: `Bearer ${token}`,
385
+ 'X-WorkBuddy-Version': '2026-01',
386
+ },
387
+ });
388
+ const items = response.body?.items || [];
389
+ return {
390
+ options: items.map((item) => ({
391
+ label: item.name,
392
+ value: item.id,
393
+ })),
394
+ };
395
+ },
198
396
  }),
199
- resource: Property.Array({
397
+ resource: Property.MultiSelectDropdown({
200
398
  displayName: 'Filter by Resource',
201
- description: 'Only trigger for specific resource IDs',
399
+ description: 'Only trigger for specific resource',
202
400
  required: false,
401
+ auth: workbuddyAuth,
402
+ refreshers: [],
403
+ options: async ({ auth }) => {
404
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
405
+ const token = await getAccessToken(authValue);
406
+ const baseUrl = authValue.props.baseUrl;
407
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
408
+ method: HttpMethod.GET,
409
+ url: `${baseUrl}/api/v2/public/employees`,
410
+ headers: {
411
+ Authorization: `Bearer ${token}`,
412
+ 'X-WorkBuddy-Version': '2026-01',
413
+ },
414
+ });
415
+ const items = response.body?.items || [];
416
+ return {
417
+ options: items.map((item) => ({
418
+ label: item.name,
419
+ value: item.id,
420
+ })),
421
+ };
422
+ },
203
423
  }),
204
- workCategory: Property.Array({
424
+ workCategory: Property.MultiSelectDropdown({
205
425
  displayName: 'Filter by Work Category',
206
- description: 'Only trigger for specific work category IDs',
426
+ description: 'Only trigger for specific work category',
207
427
  required: false,
428
+ auth: workbuddyAuth,
429
+ refreshers: [],
430
+ options: async ({ auth }) => {
431
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
432
+ const token = await getAccessToken(authValue);
433
+ const baseUrl = authValue.props.baseUrl;
434
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
435
+ method: HttpMethod.GET,
436
+ url: `${baseUrl}/api/v2/public/settings/work-types`,
437
+ headers: {
438
+ Authorization: `Bearer ${token}`,
439
+ 'X-WorkBuddy-Version': '2026-01',
440
+ },
441
+ });
442
+ const items = response.body?.items || [];
443
+ return {
444
+ options: items.map((item) => ({
445
+ label: item.name,
446
+ value: item.id,
447
+ })),
448
+ };
449
+ },
208
450
  }),
209
451
  stageStatus: Property.StaticMultiSelectDropdown({
210
452
  displayName: 'Filter by Status',
@@ -220,10 +462,32 @@ export const stage_updated_trigger = createTrigger({
220
462
  ],
221
463
  },
222
464
  }),
223
- schedulingTag: Property.Array({
465
+ schedulingTag: Property.MultiSelectDropdown({
224
466
  displayName: 'Filter by Scheduling Tag',
225
- description: 'Only trigger for specific scheduling tag IDs',
467
+ description: 'Only trigger for specific scheduling tag',
226
468
  required: false,
469
+ auth: workbuddyAuth,
470
+ refreshers: [],
471
+ options: async ({ auth }) => {
472
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
473
+ const token = await getAccessToken(authValue);
474
+ const baseUrl = authValue.props.baseUrl;
475
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
476
+ method: HttpMethod.GET,
477
+ url: `${baseUrl}/api/v2/public/settings/tags?type=scheduling`,
478
+ headers: {
479
+ Authorization: `Bearer ${token}`,
480
+ 'X-WorkBuddy-Version': '2026-01',
481
+ },
482
+ });
483
+ const items = response.body?.items || [];
484
+ return {
485
+ options: items.map((item) => ({
486
+ label: item.name,
487
+ value: item.id,
488
+ })),
489
+ };
490
+ },
227
491
  }),
228
492
  },
229
493
  sampleData: {
@@ -354,30 +618,140 @@ export const stage_status_changed_trigger = createTrigger({
354
618
  displayName: 'Stage Status Changed',
355
619
  description: 'Triggered when a stage status changes',
356
620
  props: {
357
- customer: Property.Array({
621
+ customer: Property.MultiSelectDropdown({
358
622
  displayName: 'Filter by Customer',
359
- description: 'Only trigger for specific customer IDs',
623
+ description: 'Only trigger for specific customer',
360
624
  required: false,
625
+ auth: workbuddyAuth,
626
+ refreshers: [],
627
+ options: async ({ auth }) => {
628
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
629
+ const token = await getAccessToken(authValue);
630
+ const baseUrl = authValue.props.baseUrl;
631
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
632
+ method: HttpMethod.GET,
633
+ url: `${baseUrl}/api/v2/public/customers`,
634
+ headers: {
635
+ Authorization: `Bearer ${token}`,
636
+ 'X-WorkBuddy-Version': '2026-01',
637
+ },
638
+ });
639
+ const items = response.body?.items || [];
640
+ return {
641
+ options: items.map((item) => ({
642
+ label: item.name,
643
+ value: item.id,
644
+ })),
645
+ };
646
+ },
361
647
  }),
362
- billingCompany: Property.Array({
648
+ billingCompany: Property.MultiSelectDropdown({
363
649
  displayName: 'Filter by Billing Company',
364
- description: 'Only trigger for specific billing company IDs',
650
+ description: 'Only trigger for specific billing company',
365
651
  required: false,
652
+ auth: workbuddyAuth,
653
+ refreshers: [],
654
+ options: async ({ auth }) => {
655
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
656
+ const token = await getAccessToken(authValue);
657
+ const baseUrl = authValue.props.baseUrl;
658
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
659
+ method: HttpMethod.GET,
660
+ url: `${baseUrl}/api/v2/public/companies`,
661
+ headers: {
662
+ Authorization: `Bearer ${token}`,
663
+ 'X-WorkBuddy-Version': '2026-01',
664
+ },
665
+ });
666
+ const items = response.body?.items || [];
667
+ return {
668
+ options: items.map((item) => ({
669
+ label: item.name,
670
+ value: item.id,
671
+ })),
672
+ };
673
+ },
366
674
  }),
367
- tag: Property.Array({
675
+ tag: Property.MultiSelectDropdown({
368
676
  displayName: 'Filter by Tags',
369
- description: 'Only trigger for specific tags IDs',
677
+ description: 'Only trigger for specific tags',
370
678
  required: false,
679
+ auth: workbuddyAuth,
680
+ refreshers: [],
681
+ options: async ({ auth }) => {
682
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
683
+ const token = await getAccessToken(authValue);
684
+ const baseUrl = authValue.props.baseUrl;
685
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
686
+ method: HttpMethod.GET,
687
+ url: `${baseUrl}/api/v2/public/settings/tags`,
688
+ headers: {
689
+ Authorization: `Bearer ${token}`,
690
+ 'X-WorkBuddy-Version': '2026-01',
691
+ },
692
+ });
693
+ const items = response.body?.items || [];
694
+ return {
695
+ options: items.map((item) => ({
696
+ label: item.name,
697
+ value: item.id,
698
+ })),
699
+ };
700
+ },
371
701
  }),
372
- resource: Property.Array({
702
+ resource: Property.MultiSelectDropdown({
373
703
  displayName: 'Filter by Resource',
374
- description: 'Only trigger for specific resource IDs',
704
+ description: 'Only trigger for specific resource',
375
705
  required: false,
706
+ auth: workbuddyAuth,
707
+ refreshers: [],
708
+ options: async ({ auth }) => {
709
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
710
+ const token = await getAccessToken(authValue);
711
+ const baseUrl = authValue.props.baseUrl;
712
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
713
+ method: HttpMethod.GET,
714
+ url: `${baseUrl}/api/v2/public/employees`,
715
+ headers: {
716
+ Authorization: `Bearer ${token}`,
717
+ 'X-WorkBuddy-Version': '2026-01',
718
+ },
719
+ });
720
+ const items = response.body?.items || [];
721
+ return {
722
+ options: items.map((item) => ({
723
+ label: item.name,
724
+ value: item.id,
725
+ })),
726
+ };
727
+ },
376
728
  }),
377
- workCategory: Property.Array({
729
+ workCategory: Property.MultiSelectDropdown({
378
730
  displayName: 'Filter by Work Category',
379
- description: 'Only trigger for specific work category IDs',
731
+ description: 'Only trigger for specific work category',
380
732
  required: false,
733
+ auth: workbuddyAuth,
734
+ refreshers: [],
735
+ options: async ({ auth }) => {
736
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
737
+ const token = await getAccessToken(authValue);
738
+ const baseUrl = authValue.props.baseUrl;
739
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
740
+ method: HttpMethod.GET,
741
+ url: `${baseUrl}/api/v2/public/settings/work-types`,
742
+ headers: {
743
+ Authorization: `Bearer ${token}`,
744
+ 'X-WorkBuddy-Version': '2026-01',
745
+ },
746
+ });
747
+ const items = response.body?.items || [];
748
+ return {
749
+ options: items.map((item) => ({
750
+ label: item.name,
751
+ value: item.id,
752
+ })),
753
+ };
754
+ },
381
755
  }),
382
756
  stageStatus: Property.StaticMultiSelectDropdown({
383
757
  displayName: 'Filter by Status',
@@ -393,10 +767,32 @@ export const stage_status_changed_trigger = createTrigger({
393
767
  ],
394
768
  },
395
769
  }),
396
- schedulingTag: Property.Array({
770
+ schedulingTag: Property.MultiSelectDropdown({
397
771
  displayName: 'Filter by Scheduling Tag',
398
- description: 'Only trigger for specific scheduling tag IDs',
772
+ description: 'Only trigger for specific scheduling tag',
399
773
  required: false,
774
+ auth: workbuddyAuth,
775
+ refreshers: [],
776
+ options: async ({ auth }) => {
777
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
778
+ const token = await getAccessToken(authValue);
779
+ const baseUrl = authValue.props.baseUrl;
780
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
781
+ method: HttpMethod.GET,
782
+ url: `${baseUrl}/api/v2/public/settings/tags?type=scheduling`,
783
+ headers: {
784
+ Authorization: `Bearer ${token}`,
785
+ 'X-WorkBuddy-Version': '2026-01',
786
+ },
787
+ });
788
+ const items = response.body?.items || [];
789
+ return {
790
+ options: items.map((item) => ({
791
+ label: item.name,
792
+ value: item.id,
793
+ })),
794
+ };
795
+ },
400
796
  }),
401
797
  },
402
798
  sampleData: {
@@ -527,30 +923,140 @@ export const stage_deleted_trigger = createTrigger({
527
923
  displayName: 'Stage Deleted',
528
924
  description: 'Triggered when a stage is deleted',
529
925
  props: {
530
- customer: Property.Array({
926
+ customer: Property.MultiSelectDropdown({
531
927
  displayName: 'Filter by Customer',
532
- description: 'Only trigger for specific customer IDs',
928
+ description: 'Only trigger for specific customer',
533
929
  required: false,
930
+ auth: workbuddyAuth,
931
+ refreshers: [],
932
+ options: async ({ auth }) => {
933
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
934
+ const token = await getAccessToken(authValue);
935
+ const baseUrl = authValue.props.baseUrl;
936
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
937
+ method: HttpMethod.GET,
938
+ url: `${baseUrl}/api/v2/public/customers`,
939
+ headers: {
940
+ Authorization: `Bearer ${token}`,
941
+ 'X-WorkBuddy-Version': '2026-01',
942
+ },
943
+ });
944
+ const items = response.body?.items || [];
945
+ return {
946
+ options: items.map((item) => ({
947
+ label: item.name,
948
+ value: item.id,
949
+ })),
950
+ };
951
+ },
534
952
  }),
535
- billingCompany: Property.Array({
953
+ billingCompany: Property.MultiSelectDropdown({
536
954
  displayName: 'Filter by Billing Company',
537
- description: 'Only trigger for specific billing company IDs',
955
+ description: 'Only trigger for specific billing company',
538
956
  required: false,
957
+ auth: workbuddyAuth,
958
+ refreshers: [],
959
+ options: async ({ auth }) => {
960
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
961
+ const token = await getAccessToken(authValue);
962
+ const baseUrl = authValue.props.baseUrl;
963
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
964
+ method: HttpMethod.GET,
965
+ url: `${baseUrl}/api/v2/public/companies`,
966
+ headers: {
967
+ Authorization: `Bearer ${token}`,
968
+ 'X-WorkBuddy-Version': '2026-01',
969
+ },
970
+ });
971
+ const items = response.body?.items || [];
972
+ return {
973
+ options: items.map((item) => ({
974
+ label: item.name,
975
+ value: item.id,
976
+ })),
977
+ };
978
+ },
539
979
  }),
540
- tag: Property.Array({
980
+ tag: Property.MultiSelectDropdown({
541
981
  displayName: 'Filter by Tags',
542
- description: 'Only trigger for specific tags IDs',
982
+ description: 'Only trigger for specific tags',
543
983
  required: false,
984
+ auth: workbuddyAuth,
985
+ refreshers: [],
986
+ options: async ({ auth }) => {
987
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
988
+ const token = await getAccessToken(authValue);
989
+ const baseUrl = authValue.props.baseUrl;
990
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
991
+ method: HttpMethod.GET,
992
+ url: `${baseUrl}/api/v2/public/settings/tags`,
993
+ headers: {
994
+ Authorization: `Bearer ${token}`,
995
+ 'X-WorkBuddy-Version': '2026-01',
996
+ },
997
+ });
998
+ const items = response.body?.items || [];
999
+ return {
1000
+ options: items.map((item) => ({
1001
+ label: item.name,
1002
+ value: item.id,
1003
+ })),
1004
+ };
1005
+ },
544
1006
  }),
545
- resource: Property.Array({
1007
+ resource: Property.MultiSelectDropdown({
546
1008
  displayName: 'Filter by Resource',
547
- description: 'Only trigger for specific resource IDs',
1009
+ description: 'Only trigger for specific resource',
548
1010
  required: false,
1011
+ auth: workbuddyAuth,
1012
+ refreshers: [],
1013
+ options: async ({ auth }) => {
1014
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
1015
+ const token = await getAccessToken(authValue);
1016
+ const baseUrl = authValue.props.baseUrl;
1017
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
1018
+ method: HttpMethod.GET,
1019
+ url: `${baseUrl}/api/v2/public/employees`,
1020
+ headers: {
1021
+ Authorization: `Bearer ${token}`,
1022
+ 'X-WorkBuddy-Version': '2026-01',
1023
+ },
1024
+ });
1025
+ const items = response.body?.items || [];
1026
+ return {
1027
+ options: items.map((item) => ({
1028
+ label: item.name,
1029
+ value: item.id,
1030
+ })),
1031
+ };
1032
+ },
549
1033
  }),
550
- workCategory: Property.Array({
1034
+ workCategory: Property.MultiSelectDropdown({
551
1035
  displayName: 'Filter by Work Category',
552
- description: 'Only trigger for specific work category IDs',
1036
+ description: 'Only trigger for specific work category',
553
1037
  required: false,
1038
+ auth: workbuddyAuth,
1039
+ refreshers: [],
1040
+ options: async ({ auth }) => {
1041
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
1042
+ const token = await getAccessToken(authValue);
1043
+ const baseUrl = authValue.props.baseUrl;
1044
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
1045
+ method: HttpMethod.GET,
1046
+ url: `${baseUrl}/api/v2/public/settings/work-types`,
1047
+ headers: {
1048
+ Authorization: `Bearer ${token}`,
1049
+ 'X-WorkBuddy-Version': '2026-01',
1050
+ },
1051
+ });
1052
+ const items = response.body?.items || [];
1053
+ return {
1054
+ options: items.map((item) => ({
1055
+ label: item.name,
1056
+ value: item.id,
1057
+ })),
1058
+ };
1059
+ },
554
1060
  }),
555
1061
  stageStatus: Property.StaticMultiSelectDropdown({
556
1062
  displayName: 'Filter by Status',
@@ -566,10 +1072,32 @@ export const stage_deleted_trigger = createTrigger({
566
1072
  ],
567
1073
  },
568
1074
  }),
569
- schedulingTag: Property.Array({
1075
+ schedulingTag: Property.MultiSelectDropdown({
570
1076
  displayName: 'Filter by Scheduling Tag',
571
- description: 'Only trigger for specific scheduling tag IDs',
1077
+ description: 'Only trigger for specific scheduling tag',
572
1078
  required: false,
1079
+ auth: workbuddyAuth,
1080
+ refreshers: [],
1081
+ options: async ({ auth }) => {
1082
+ const authValue = auth as unknown as { props: { baseUrl: string; clientId: string; clientSecret: string } };
1083
+ const token = await getAccessToken(authValue);
1084
+ const baseUrl = authValue.props.baseUrl;
1085
+ const response = await httpClient.sendRequest<{ items: Array<{ id: string; name: string }> }>({
1086
+ method: HttpMethod.GET,
1087
+ url: `${baseUrl}/api/v2/public/settings/tags?type=scheduling`,
1088
+ headers: {
1089
+ Authorization: `Bearer ${token}`,
1090
+ 'X-WorkBuddy-Version': '2026-01',
1091
+ },
1092
+ });
1093
+ const items = response.body?.items || [];
1094
+ return {
1095
+ options: items.map((item) => ({
1096
+ label: item.name,
1097
+ value: item.id,
1098
+ })),
1099
+ };
1100
+ },
573
1101
  }),
574
1102
  },
575
1103
  sampleData: {