@workbuddy/piece-workbuddy-edge 1.0.32 → 1.0.34
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/index.d.ts.map +1 -1
- package/src/index.js +76 -14
- package/src/index.js.map +1 -1
- package/src/index.ts +139 -10
- package/src/lib/actions/crm-companies.d.ts +1 -0
- package/src/lib/actions/crm-companies.d.ts.map +1 -1
- package/src/lib/actions/crm-companies.js +9 -0
- package/src/lib/actions/crm-companies.js.map +1 -1
- package/src/lib/actions/crm-companies.ts +11 -0
- package/src/lib/actions/crm-contacts.d.ts +25 -0
- package/src/lib/actions/crm-contacts.d.ts.map +1 -1
- package/src/lib/actions/crm-contacts.js +135 -3
- package/src/lib/actions/crm-contacts.js.map +1 -1
- package/src/lib/actions/crm-contacts.ts +149 -2
- package/src/lib/actions/crm-contractors.d.ts +110 -0
- package/src/lib/actions/crm-contractors.d.ts.map +1 -1
- package/src/lib/actions/crm-contractors.js +585 -2
- package/src/lib/actions/crm-contractors.js.map +1 -1
- package/src/lib/actions/crm-contractors.ts +631 -1
- package/src/lib/actions/crm-customers.d.ts +94 -0
- package/src/lib/actions/crm-customers.d.ts.map +1 -1
- package/src/lib/actions/crm-customers.js +504 -3
- package/src/lib/actions/crm-customers.js.map +1 -1
- package/src/lib/actions/crm-customers.ts +545 -2
- package/src/lib/actions/crm-external-users.js +1 -1
- package/src/lib/actions/crm-external-users.js.map +1 -1
- package/src/lib/actions/crm-external-users.ts +1 -1
- package/src/lib/actions/crm-invites.d.ts +1 -0
- package/src/lib/actions/crm-invites.d.ts.map +1 -1
- package/src/lib/actions/crm-invites.js +9 -0
- package/src/lib/actions/crm-invites.js.map +1 -1
- package/src/lib/actions/crm-invites.ts +11 -0
- package/src/lib/actions/crm-sites.d.ts +10 -0
- package/src/lib/actions/crm-sites.d.ts.map +1 -1
- package/src/lib/actions/crm-sites.js +59 -3
- package/src/lib/actions/crm-sites.js.map +1 -1
- package/src/lib/actions/crm-sites.ts +70 -2
- package/src/lib/actions/crm-suppliers.d.ts +64 -0
- package/src/lib/actions/crm-suppliers.d.ts.map +1 -1
- package/src/lib/actions/crm-suppliers.js +352 -2
- package/src/lib/actions/crm-suppliers.js.map +1 -1
- package/src/lib/actions/crm-suppliers.ts +376 -1
- package/src/lib/actions/index.d.ts +7 -1
- package/src/lib/actions/index.d.ts.map +1 -1
- package/src/lib/actions/index.js +7 -1
- package/src/lib/actions/index.js.map +1 -1
- package/src/lib/actions/index.ts +7 -1
- package/src/lib/actions/items.d.ts +8 -0
- package/src/lib/actions/items.d.ts.map +1 -0
- package/src/lib/actions/items.js +42 -0
- package/src/lib/actions/items.js.map +1 -0
- package/src/lib/actions/items.ts +45 -0
- package/src/lib/actions/jobs-activities.d.ts +4 -3
- package/src/lib/actions/jobs-activities.d.ts.map +1 -1
- package/src/lib/actions/jobs-activities.js +19 -12
- package/src/lib/actions/jobs-activities.js.map +1 -1
- package/src/lib/actions/jobs-activities.ts +19 -12
- package/src/lib/actions/jobs-tasks.d.ts +0 -2
- package/src/lib/actions/jobs-tasks.d.ts.map +1 -1
- package/src/lib/actions/jobs-tasks.js +0 -12
- package/src/lib/actions/jobs-tasks.js.map +1 -1
- package/src/lib/actions/jobs-tasks.ts +0 -12
- package/src/lib/actions/jobs.d.ts +87 -1
- package/src/lib/actions/jobs.d.ts.map +1 -1
- package/src/lib/actions/jobs.js +495 -7
- package/src/lib/actions/jobs.js.map +1 -1
- package/src/lib/actions/jobs.ts +523 -6
- package/src/lib/actions/mcp.d.ts +3 -3
- package/src/lib/actions/mcp.d.ts.map +1 -1
- package/src/lib/actions/mcp.js +9 -9
- package/src/lib/actions/mcp.js.map +1 -1
- package/src/lib/actions/mcp.ts +8 -8
- package/src/lib/actions/pending-items.d.ts +8 -0
- package/src/lib/actions/pending-items.d.ts.map +1 -0
- package/src/lib/actions/pending-items.js +42 -0
- package/src/lib/actions/pending-items.js.map +1 -0
- package/src/lib/actions/pending-items.ts +45 -0
- package/src/lib/actions/settings-custom-fields.d.ts +21 -0
- package/src/lib/actions/settings-custom-fields.d.ts.map +1 -0
- package/src/lib/actions/settings-custom-fields.js +95 -0
- package/src/lib/actions/settings-custom-fields.js.map +1 -0
- package/src/lib/actions/settings-custom-fields.ts +107 -0
- package/src/lib/actions/settings-items.d.ts +136 -0
- package/src/lib/actions/settings-items.d.ts.map +1 -0
- package/src/lib/actions/settings-items.js +772 -0
- package/src/lib/actions/settings-items.js.map +1 -0
- package/src/lib/actions/settings-items.ts +818 -0
- package/src/lib/actions/{settings.d.ts → settings-reference-data.d.ts} +33 -10
- package/src/lib/actions/settings-reference-data.d.ts.map +1 -0
- package/src/lib/actions/settings-reference-data.js +423 -0
- package/src/lib/actions/settings-reference-data.js.map +1 -0
- package/src/lib/actions/settings-reference-data.ts +496 -0
- package/src/lib/actions/settings-templates.d.ts +15 -0
- package/src/lib/actions/settings-templates.d.ts.map +1 -0
- package/src/lib/actions/settings-templates.js +75 -0
- package/src/lib/actions/settings-templates.js.map +1 -0
- package/src/lib/actions/settings-templates.ts +79 -0
- package/src/lib/actions/stages-activities.d.ts +4 -3
- package/src/lib/actions/stages-activities.d.ts.map +1 -1
- package/src/lib/actions/stages-activities.js +19 -12
- package/src/lib/actions/stages-activities.js.map +1 -1
- package/src/lib/actions/stages-activities.ts +19 -12
- package/src/lib/actions/stages-pending-items.d.ts +75 -0
- package/src/lib/actions/stages-pending-items.d.ts.map +1 -0
- package/src/lib/actions/stages-pending-items.js +370 -0
- package/src/lib/actions/stages-pending-items.js.map +1 -0
- package/src/lib/actions/stages-pending-items.ts +404 -0
- package/src/lib/actions/stages-resources.d.ts.map +1 -1
- package/src/lib/actions/stages-resources.js +5 -8
- package/src/lib/actions/stages-resources.js.map +1 -1
- package/src/lib/actions/stages-resources.ts +8 -8
- package/src/lib/actions/stages-tasks.d.ts +0 -2
- package/src/lib/actions/stages-tasks.d.ts.map +1 -1
- package/src/lib/actions/stages-tasks.js +0 -12
- package/src/lib/actions/stages-tasks.js.map +1 -1
- package/src/lib/actions/stages-tasks.ts +0 -12
- package/src/lib/actions/stages.d.ts +20 -3
- package/src/lib/actions/stages.d.ts.map +1 -1
- package/src/lib/actions/stages.js +103 -21
- package/src/lib/actions/stages.js.map +1 -1
- package/src/lib/actions/stages.ts +116 -20
- package/src/lib/actions/webhooks-v2.js +11 -11
- package/src/lib/actions/webhooks-v2.js.map +1 -1
- package/src/lib/actions/webhooks-v2.ts +11 -11
- package/src/lib/actions/settings.d.ts.map +0 -1
- package/src/lib/actions/settings.js +0 -257
- package/src/lib/actions/settings.js.map +0 -1
- package/src/lib/actions/settings.ts +0 -301
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import { createAction, Property } from '@activepieces/pieces-framework';
|
|
2
|
+
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
|
3
|
+
import { workbuddyAuth, getAccessToken } from '../auth';
|
|
4
|
+
|
|
5
|
+
export const PublicApiEntityStatusController_list = createAction({
|
|
6
|
+
name: 'PublicApiEntityStatusController_list',
|
|
7
|
+
auth: workbuddyAuth,
|
|
8
|
+
displayName: 'List entity statuses',
|
|
9
|
+
description:
|
|
10
|
+
'Retrieve all active statuses for a given entity type. Supported entities: customer, contractor, supplier, contact, external-user, pending-item',
|
|
11
|
+
props: {
|
|
12
|
+
entity: Property.StaticDropdown({
|
|
13
|
+
displayName: 'Entity',
|
|
14
|
+
description: 'Entity type (customer, contractor, supplier, contact, external-user, pending-item)',
|
|
15
|
+
required: true,
|
|
16
|
+
options: {
|
|
17
|
+
options: [
|
|
18
|
+
{ label: 'customer', value: 'customer' },
|
|
19
|
+
{ label: 'contractor', value: 'contractor' },
|
|
20
|
+
{ label: 'supplier', value: 'supplier' },
|
|
21
|
+
{ label: 'contact', value: 'contact' },
|
|
22
|
+
{ label: 'external-user', value: 'external-user' },
|
|
23
|
+
{ label: 'pending-item', value: 'pending-item' },
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
async run(context) {
|
|
29
|
+
const token = await getAccessToken(context.auth);
|
|
30
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
31
|
+
|
|
32
|
+
const url = `${baseUrl}/api/v2/public/settings/entity-statuses/${context.propsValue.entity}`;
|
|
33
|
+
|
|
34
|
+
const response = await httpClient.sendRequest({
|
|
35
|
+
method: HttpMethod.GET,
|
|
36
|
+
url: `${baseUrl}/api/v2/public/settings/entity-statuses/${context.propsValue.entity}`,
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: `Bearer ${token}`,
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
return response.body;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const PublicApiJobStatusController_list = createAction({
|
|
49
|
+
name: 'PublicApiJobStatusController_list',
|
|
50
|
+
auth: workbuddyAuth,
|
|
51
|
+
displayName: 'List job statuses',
|
|
52
|
+
description:
|
|
53
|
+
'Retrieve all possible job statuses. These are system-defined status values that represent the aggregated state of a job based on its stages.',
|
|
54
|
+
props: {},
|
|
55
|
+
async run(context) {
|
|
56
|
+
const token = await getAccessToken(context.auth);
|
|
57
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
58
|
+
|
|
59
|
+
const url = `${baseUrl}/api/v2/public/settings/job-statuses`;
|
|
60
|
+
|
|
61
|
+
const response = await httpClient.sendRequest({
|
|
62
|
+
method: HttpMethod.GET,
|
|
63
|
+
url: `${baseUrl}/api/v2/public/settings/job-statuses`,
|
|
64
|
+
headers: {
|
|
65
|
+
Authorization: `Bearer ${token}`,
|
|
66
|
+
'Content-Type': 'application/json',
|
|
67
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return response.body;
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const PublicApiJobTypeController_list = createAction({
|
|
76
|
+
name: 'PublicApiJobTypeController_list',
|
|
77
|
+
auth: workbuddyAuth,
|
|
78
|
+
displayName: 'List job types',
|
|
79
|
+
description:
|
|
80
|
+
'Retrieve all active job types configured for the tenant. Job types categorize jobs by the type of work being performed (e.g., Maintenance, Installation, Repair).',
|
|
81
|
+
props: {},
|
|
82
|
+
async run(context) {
|
|
83
|
+
const token = await getAccessToken(context.auth);
|
|
84
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
85
|
+
|
|
86
|
+
const url = `${baseUrl}/api/v2/public/settings/job-types`;
|
|
87
|
+
|
|
88
|
+
const response = await httpClient.sendRequest({
|
|
89
|
+
method: HttpMethod.GET,
|
|
90
|
+
url: `${baseUrl}/api/v2/public/settings/job-types`,
|
|
91
|
+
headers: {
|
|
92
|
+
Authorization: `Bearer ${token}`,
|
|
93
|
+
'Content-Type': 'application/json',
|
|
94
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return response.body;
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export const PublicApiJobTemplateController_list = createAction({
|
|
103
|
+
name: 'PublicApiJobTemplateController_list',
|
|
104
|
+
auth: workbuddyAuth,
|
|
105
|
+
displayName: 'List job templates',
|
|
106
|
+
description:
|
|
107
|
+
'Retrieve all active, public job templates configured for the tenant. Use the returned id as the templateId for POST /jobs/template/:templateId.',
|
|
108
|
+
props: {},
|
|
109
|
+
async run(context) {
|
|
110
|
+
const token = await getAccessToken(context.auth);
|
|
111
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
112
|
+
|
|
113
|
+
const url = `${baseUrl}/api/v2/public/settings/job-templates`;
|
|
114
|
+
|
|
115
|
+
const response = await httpClient.sendRequest({
|
|
116
|
+
method: HttpMethod.GET,
|
|
117
|
+
url: `${baseUrl}/api/v2/public/settings/job-templates`,
|
|
118
|
+
headers: {
|
|
119
|
+
Authorization: `Bearer ${token}`,
|
|
120
|
+
'Content-Type': 'application/json',
|
|
121
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
return response.body;
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export const PublicApiPriorityController_list = createAction({
|
|
130
|
+
name: 'PublicApiPriorityController_list',
|
|
131
|
+
auth: workbuddyAuth,
|
|
132
|
+
displayName: 'List priorities',
|
|
133
|
+
description:
|
|
134
|
+
'Retrieve all active priority levels configured for the tenant. Priorities indicate the urgency of jobs (e.g., Critical, High, Medium, Low).',
|
|
135
|
+
props: {},
|
|
136
|
+
async run(context) {
|
|
137
|
+
const token = await getAccessToken(context.auth);
|
|
138
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
139
|
+
|
|
140
|
+
const url = `${baseUrl}/api/v2/public/settings/priorities`;
|
|
141
|
+
|
|
142
|
+
const response = await httpClient.sendRequest({
|
|
143
|
+
method: HttpMethod.GET,
|
|
144
|
+
url: `${baseUrl}/api/v2/public/settings/priorities`,
|
|
145
|
+
headers: {
|
|
146
|
+
Authorization: `Bearer ${token}`,
|
|
147
|
+
'Content-Type': 'application/json',
|
|
148
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
return response.body;
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export const PublicApiPriceBookController_list = createAction({
|
|
157
|
+
name: 'PublicApiPriceBookController_list',
|
|
158
|
+
auth: workbuddyAuth,
|
|
159
|
+
displayName: 'List pricebooks',
|
|
160
|
+
description:
|
|
161
|
+
'Discover tenant pricebooks for a category (customer / contractor / supplier). Use category=customer&status=current&assignableOnly=true for job-create candidates. Optional accountId scopes to a CRM account (includeGlobal defaults true). Each item includes company (owning company) and optional account — both match Settings UI fields.',
|
|
162
|
+
props: {
|
|
163
|
+
category: Property.StaticDropdown({
|
|
164
|
+
displayName: 'Category',
|
|
165
|
+
description: '',
|
|
166
|
+
required: true,
|
|
167
|
+
options: {
|
|
168
|
+
options: [
|
|
169
|
+
{ label: 'customer', value: 'customer' },
|
|
170
|
+
{ label: 'contractor', value: 'contractor' },
|
|
171
|
+
{ label: 'supplier', value: 'supplier' },
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
limit: Property.Number({
|
|
176
|
+
displayName: 'Limit',
|
|
177
|
+
description: '',
|
|
178
|
+
required: false,
|
|
179
|
+
}),
|
|
180
|
+
assignableOnly: Property.Checkbox({
|
|
181
|
+
displayName: 'Assignable Only',
|
|
182
|
+
description: '',
|
|
183
|
+
required: false,
|
|
184
|
+
}),
|
|
185
|
+
mode: Property.StaticDropdown({
|
|
186
|
+
displayName: 'Mode',
|
|
187
|
+
description: '',
|
|
188
|
+
required: false,
|
|
189
|
+
options: {
|
|
190
|
+
options: [
|
|
191
|
+
{ label: 'static', value: 'static' },
|
|
192
|
+
{ label: 'dynamic', value: 'dynamic' },
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
}),
|
|
196
|
+
search: Property.ShortText({
|
|
197
|
+
displayName: 'Search',
|
|
198
|
+
description: 'Name contains or exact id',
|
|
199
|
+
required: false,
|
|
200
|
+
}),
|
|
201
|
+
includeGlobal: Property.Checkbox({
|
|
202
|
+
displayName: 'Include Global',
|
|
203
|
+
description: '',
|
|
204
|
+
required: false,
|
|
205
|
+
}),
|
|
206
|
+
accountId: Property.ShortText({
|
|
207
|
+
displayName: 'Account Id',
|
|
208
|
+
description: 'account ID',
|
|
209
|
+
required: false,
|
|
210
|
+
}),
|
|
211
|
+
status: Property.StaticDropdown({
|
|
212
|
+
displayName: 'Status',
|
|
213
|
+
description: '',
|
|
214
|
+
required: false,
|
|
215
|
+
options: {
|
|
216
|
+
options: [
|
|
217
|
+
{ label: 'current', value: 'current' },
|
|
218
|
+
{ label: 'expired', value: 'expired' },
|
|
219
|
+
{ label: 'future', value: 'future' },
|
|
220
|
+
{ label: 'all', value: 'all' },
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
},
|
|
225
|
+
async run(context) {
|
|
226
|
+
const token = await getAccessToken(context.auth);
|
|
227
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
228
|
+
|
|
229
|
+
const url = `${baseUrl}/settings/pricebooks`;
|
|
230
|
+
|
|
231
|
+
const queryParams = new URLSearchParams();
|
|
232
|
+
if (context.propsValue.limit !== undefined && context.propsValue.limit !== null)
|
|
233
|
+
queryParams.append('limit', String(context.propsValue.limit));
|
|
234
|
+
if (context.propsValue.assignableOnly !== undefined && context.propsValue.assignableOnly !== null)
|
|
235
|
+
queryParams.append('assignableOnly', String(context.propsValue.assignableOnly));
|
|
236
|
+
if (context.propsValue.mode !== undefined && context.propsValue.mode !== null && context.propsValue.mode !== '')
|
|
237
|
+
queryParams.append('mode', String(context.propsValue.mode));
|
|
238
|
+
if (
|
|
239
|
+
context.propsValue.search !== undefined &&
|
|
240
|
+
context.propsValue.search !== null &&
|
|
241
|
+
context.propsValue.search !== ''
|
|
242
|
+
)
|
|
243
|
+
queryParams.append('search', String(context.propsValue.search));
|
|
244
|
+
if (context.propsValue.includeGlobal !== undefined && context.propsValue.includeGlobal !== null)
|
|
245
|
+
queryParams.append('includeGlobal', String(context.propsValue.includeGlobal));
|
|
246
|
+
if (
|
|
247
|
+
context.propsValue.accountId !== undefined &&
|
|
248
|
+
context.propsValue.accountId !== null &&
|
|
249
|
+
context.propsValue.accountId !== ''
|
|
250
|
+
)
|
|
251
|
+
queryParams.append('accountId', String(context.propsValue.accountId));
|
|
252
|
+
if (
|
|
253
|
+
context.propsValue.status !== undefined &&
|
|
254
|
+
context.propsValue.status !== null &&
|
|
255
|
+
context.propsValue.status !== ''
|
|
256
|
+
)
|
|
257
|
+
queryParams.append('status', String(context.propsValue.status));
|
|
258
|
+
if (
|
|
259
|
+
context.propsValue.category !== undefined &&
|
|
260
|
+
context.propsValue.category !== null &&
|
|
261
|
+
context.propsValue.category !== ''
|
|
262
|
+
)
|
|
263
|
+
queryParams.append('category', String(context.propsValue.category));
|
|
264
|
+
const queryString = queryParams.toString();
|
|
265
|
+
const urlWithQuery = queryString ? `${url}?${queryString}` : url;
|
|
266
|
+
|
|
267
|
+
const response = await httpClient.sendRequest({
|
|
268
|
+
method: HttpMethod.GET,
|
|
269
|
+
url: urlWithQuery,
|
|
270
|
+
headers: {
|
|
271
|
+
Authorization: `Bearer ${token}`,
|
|
272
|
+
'Content-Type': 'application/json',
|
|
273
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
return response.body;
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
export const PublicApiPriceBookController_getByIdOrName = createAction({
|
|
282
|
+
name: 'PublicApiPriceBookController_getByIdOrName',
|
|
283
|
+
auth: workbuddyAuth,
|
|
284
|
+
displayName: 'Get pricebook',
|
|
285
|
+
description:
|
|
286
|
+
'Retrieve a pricebook by id (preferred) or exact name (case-insensitive). Pass category when the name may exist in more than one category. Response includes company (owning company) and optional account, matching Settings UI.',
|
|
287
|
+
props: {
|
|
288
|
+
idOrName: Property.ShortText({
|
|
289
|
+
displayName: 'Id Or Name',
|
|
290
|
+
description: 'Pricebook id or exact name',
|
|
291
|
+
required: true,
|
|
292
|
+
}),
|
|
293
|
+
category: Property.StaticDropdown({
|
|
294
|
+
displayName: 'Category',
|
|
295
|
+
description: '',
|
|
296
|
+
required: false,
|
|
297
|
+
options: {
|
|
298
|
+
options: [
|
|
299
|
+
{ label: 'customer', value: 'customer' },
|
|
300
|
+
{ label: 'contractor', value: 'contractor' },
|
|
301
|
+
{ label: 'supplier', value: 'supplier' },
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
}),
|
|
305
|
+
},
|
|
306
|
+
async run(context) {
|
|
307
|
+
const token = await getAccessToken(context.auth);
|
|
308
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
309
|
+
|
|
310
|
+
const url = `${baseUrl}/settings/pricebooks/{idOrName}`;
|
|
311
|
+
|
|
312
|
+
const queryParams = new URLSearchParams();
|
|
313
|
+
if (
|
|
314
|
+
context.propsValue.category !== undefined &&
|
|
315
|
+
context.propsValue.category !== null &&
|
|
316
|
+
context.propsValue.category !== ''
|
|
317
|
+
)
|
|
318
|
+
queryParams.append('category', String(context.propsValue.category));
|
|
319
|
+
const queryString = queryParams.toString();
|
|
320
|
+
const urlWithQuery = queryString ? `${url}?${queryString}` : url;
|
|
321
|
+
|
|
322
|
+
const response = await httpClient.sendRequest({
|
|
323
|
+
method: HttpMethod.GET,
|
|
324
|
+
url: urlWithQuery,
|
|
325
|
+
headers: {
|
|
326
|
+
Authorization: `Bearer ${token}`,
|
|
327
|
+
'Content-Type': 'application/json',
|
|
328
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
329
|
+
},
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
return response.body;
|
|
333
|
+
},
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
export const PublicApiStageStatusController_list = createAction({
|
|
337
|
+
name: 'PublicApiStageStatusController_list',
|
|
338
|
+
auth: workbuddyAuth,
|
|
339
|
+
displayName: 'List stage statuses',
|
|
340
|
+
description:
|
|
341
|
+
'Retrieve all stage statuses configured for the tenant (Settings > Stage Status).\nEach item is a workflow state a stage (work order) can use (e.g. New, Dispatched, En Route, On Site, Completed, Finalised).\n\nResponse fields include:\n- identity: id, name, systemName, systemStatus, sortOrder\n- description (nullable)\n- activityOptions: shareWithCustomer, shareWithField (always present; unset = false)\n- displayOptions: showInContractorPortal, showInFieldApp (always present)\n\nDisplay Options rules (match Settings UI):\n- Only systemStatus On Hold or In Progress support display options; other systemStatus values return both flags as false\n- showInFieldApp is not configurable for In Progress and is always false\n- When supported and not configured, visibility defaults to true (Settings UI default)\n\nRequires scope: settings:read',
|
|
342
|
+
props: {},
|
|
343
|
+
async run(context) {
|
|
344
|
+
const token = await getAccessToken(context.auth);
|
|
345
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
346
|
+
|
|
347
|
+
const url = `${baseUrl}/api/v2/public/settings/stage-statuses`;
|
|
348
|
+
|
|
349
|
+
const response = await httpClient.sendRequest({
|
|
350
|
+
method: HttpMethod.GET,
|
|
351
|
+
url: `${baseUrl}/api/v2/public/settings/stage-statuses`,
|
|
352
|
+
headers: {
|
|
353
|
+
Authorization: `Bearer ${token}`,
|
|
354
|
+
'Content-Type': 'application/json',
|
|
355
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
return response.body;
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
export const PublicApiTagController_list = createAction({
|
|
364
|
+
name: 'PublicApiTagController_list',
|
|
365
|
+
auth: workbuddyAuth,
|
|
366
|
+
displayName: 'List tags',
|
|
367
|
+
description:
|
|
368
|
+
'Retrieve all active tags (labels) configured. Use the optional `type` query parameter to filter by label type. Defaults to `job` if not specified. Supported types: job, scheduling, quote, customer, user, overheads, form, finance, system, work-order-system, account, contact, zone, work-categories, lead-source, lead, opportunity, opportunity-lost, project, project-type, payment-type, file, asset, item-location, task, phase, site, service-type, subscriptions, agreement, work, integration-types, flag-category.',
|
|
369
|
+
props: {},
|
|
370
|
+
async run(context) {
|
|
371
|
+
const token = await getAccessToken(context.auth);
|
|
372
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
373
|
+
|
|
374
|
+
const url = `${baseUrl}/api/v2/public/settings/tags`;
|
|
375
|
+
|
|
376
|
+
const response = await httpClient.sendRequest({
|
|
377
|
+
method: HttpMethod.GET,
|
|
378
|
+
url: `${baseUrl}/api/v2/public/settings/tags`,
|
|
379
|
+
headers: {
|
|
380
|
+
Authorization: `Bearer ${token}`,
|
|
381
|
+
'Content-Type': 'application/json',
|
|
382
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
return response.body;
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
export const PublicApiZoneController_list = createAction({
|
|
391
|
+
name: 'PublicApiZoneController_list',
|
|
392
|
+
auth: workbuddyAuth,
|
|
393
|
+
displayName: 'List zones',
|
|
394
|
+
description:
|
|
395
|
+
'Retrieve all active zones configured for the tenant. Zones represent geographic regions used for job assignment, routing, and resource allocation.',
|
|
396
|
+
props: {},
|
|
397
|
+
async run(context) {
|
|
398
|
+
const token = await getAccessToken(context.auth);
|
|
399
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
400
|
+
|
|
401
|
+
const url = `${baseUrl}/api/v2/public/settings/zones`;
|
|
402
|
+
|
|
403
|
+
const response = await httpClient.sendRequest({
|
|
404
|
+
method: HttpMethod.GET,
|
|
405
|
+
url: `${baseUrl}/api/v2/public/settings/zones`,
|
|
406
|
+
headers: {
|
|
407
|
+
Authorization: `Bearer ${token}`,
|
|
408
|
+
'Content-Type': 'application/json',
|
|
409
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
return response.body;
|
|
414
|
+
},
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
export const PublicApiWorkTypeController_list = createAction({
|
|
418
|
+
name: 'PublicApiWorkTypeController_list',
|
|
419
|
+
auth: workbuddyAuth,
|
|
420
|
+
displayName: 'List work types',
|
|
421
|
+
description:
|
|
422
|
+
'Retrieve all active work types configured for the tenant (e.g., Labour, Travel, Administration) for time tracking and billing purposes.',
|
|
423
|
+
props: {},
|
|
424
|
+
async run(context) {
|
|
425
|
+
const token = await getAccessToken(context.auth);
|
|
426
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
427
|
+
|
|
428
|
+
const url = `${baseUrl}/api/v2/public/settings/work-types`;
|
|
429
|
+
|
|
430
|
+
const response = await httpClient.sendRequest({
|
|
431
|
+
method: HttpMethod.GET,
|
|
432
|
+
url: `${baseUrl}/api/v2/public/settings/work-types`,
|
|
433
|
+
headers: {
|
|
434
|
+
Authorization: `Bearer ${token}`,
|
|
435
|
+
'Content-Type': 'application/json',
|
|
436
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
return response.body;
|
|
441
|
+
},
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
export const PublicApiPortalRoleController_listClientPortal = createAction({
|
|
445
|
+
name: 'PublicApiPortalRoleController_listClientPortal',
|
|
446
|
+
auth: workbuddyAuth,
|
|
447
|
+
displayName: 'List client portal roles',
|
|
448
|
+
description:
|
|
449
|
+
'Roles assignable to customer login contacts (UserType.Client). Includes custom client roles; includes built-in system client roles only when Enable System Security Roles is on for the tenant. Use item.id as roleId when login is true on contact create/invite.',
|
|
450
|
+
props: {},
|
|
451
|
+
async run(context) {
|
|
452
|
+
const token = await getAccessToken(context.auth);
|
|
453
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
454
|
+
|
|
455
|
+
const url = `${baseUrl}/api/v2/public/settings/roles/client-portal`;
|
|
456
|
+
|
|
457
|
+
const response = await httpClient.sendRequest({
|
|
458
|
+
method: HttpMethod.GET,
|
|
459
|
+
url: `${baseUrl}/api/v2/public/settings/roles/client-portal`,
|
|
460
|
+
headers: {
|
|
461
|
+
Authorization: `Bearer ${token}`,
|
|
462
|
+
'Content-Type': 'application/json',
|
|
463
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
464
|
+
},
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
return response.body;
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
export const PublicApiPortalRoleController_listContractorPortal = createAction({
|
|
472
|
+
name: 'PublicApiPortalRoleController_listContractorPortal',
|
|
473
|
+
auth: workbuddyAuth,
|
|
474
|
+
displayName: 'List contractor portal roles',
|
|
475
|
+
description:
|
|
476
|
+
'Roles assignable to contractor login contacts (UserType.Subcontractor). Includes custom contractor roles; includes built-in system contractor roles only when Enable System Security Roles is on for the tenant. Use item.id as roleId when login is true on contact create/invite.',
|
|
477
|
+
props: {},
|
|
478
|
+
async run(context) {
|
|
479
|
+
const token = await getAccessToken(context.auth);
|
|
480
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
481
|
+
|
|
482
|
+
const url = `${baseUrl}/api/v2/public/settings/roles/contractor-portal`;
|
|
483
|
+
|
|
484
|
+
const response = await httpClient.sendRequest({
|
|
485
|
+
method: HttpMethod.GET,
|
|
486
|
+
url: `${baseUrl}/api/v2/public/settings/roles/contractor-portal`,
|
|
487
|
+
headers: {
|
|
488
|
+
Authorization: `Bearer ${token}`,
|
|
489
|
+
'Content-Type': 'application/json',
|
|
490
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
491
|
+
},
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
return response.body;
|
|
495
|
+
},
|
|
496
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const PublicApiTemplateController_listEmailTemplates: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {
|
|
6
|
+
entity: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const PublicApiTemplateController_listSmsTemplates: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>, {
|
|
13
|
+
entity: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=settings-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-templates.d.ts","sourceRoot":"","sources":["settings-templates.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,8CAA8C;;;;;;EAoCzD,CAAC;AAEH,eAAO,MAAM,4CAA4C;;;;;;EAoCvD,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicApiTemplateController_listSmsTemplates = exports.PublicApiTemplateController_listEmailTemplates = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
|
+
exports.PublicApiTemplateController_listEmailTemplates = (0, pieces_framework_1.createAction)({
|
|
8
|
+
name: 'PublicApiTemplateController_listEmailTemplates',
|
|
9
|
+
auth: auth_1.workbuddyAuth,
|
|
10
|
+
displayName: 'List email templates for entity type',
|
|
11
|
+
description: 'Retrieve all active email templates for the specified entity type (job or stage).',
|
|
12
|
+
props: {
|
|
13
|
+
entity: pieces_framework_1.Property.StaticDropdown({
|
|
14
|
+
displayName: 'Entity',
|
|
15
|
+
description: 'Entity type',
|
|
16
|
+
required: true,
|
|
17
|
+
options: {
|
|
18
|
+
options: [
|
|
19
|
+
{ label: 'job', value: 'job' },
|
|
20
|
+
{ label: 'stage', value: 'stage' },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
async run(context) {
|
|
26
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
27
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
28
|
+
const url = `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/email`;
|
|
29
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
30
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
31
|
+
url: `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/email`,
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: `Bearer ${token}`,
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return response.body;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
exports.PublicApiTemplateController_listSmsTemplates = (0, pieces_framework_1.createAction)({
|
|
42
|
+
name: 'PublicApiTemplateController_listSmsTemplates',
|
|
43
|
+
auth: auth_1.workbuddyAuth,
|
|
44
|
+
displayName: 'List SMS templates for entity type',
|
|
45
|
+
description: 'Retrieve all active SMS templates for the specified entity type (job or stage).',
|
|
46
|
+
props: {
|
|
47
|
+
entity: pieces_framework_1.Property.StaticDropdown({
|
|
48
|
+
displayName: 'Entity',
|
|
49
|
+
description: 'Entity type',
|
|
50
|
+
required: true,
|
|
51
|
+
options: {
|
|
52
|
+
options: [
|
|
53
|
+
{ label: 'job', value: 'job' },
|
|
54
|
+
{ label: 'stage', value: 'stage' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
async run(context) {
|
|
60
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
61
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
62
|
+
const url = `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/sms`;
|
|
63
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
64
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
65
|
+
url: `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/sms`,
|
|
66
|
+
headers: {
|
|
67
|
+
Authorization: `Bearer ${token}`,
|
|
68
|
+
'Content-Type': 'application/json',
|
|
69
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
return response.body;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=settings-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-templates.js","sourceRoot":"","sources":["settings-templates.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAwD;AAE3C,QAAA,8CAA8C,GAAG,IAAA,+BAAY,EAAC;IACzE,IAAI,EAAE,gDAAgD;IACtD,IAAI,EAAE,oBAAa;IACnB,WAAW,EAAE,sCAAsC;IACnD,WAAW,EAAE,mFAAmF;IAChG,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;iBACnC;aACF;SACF,CAAC;KACH;IACD,KAAK,CAAC,GAAG,CAAC,OAAO;QACf,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAE3C,MAAM,GAAG,GAAG,GAAG,OAAO,qCAAqC,OAAO,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC;QAE7F,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,OAAO,qCAAqC,OAAO,CAAC,UAAU,CAAC,MAAM,QAAQ;YACrF,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;gBAClC,qBAAqB,EAAE,SAAS;aACjC;SACF,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,4CAA4C,GAAG,IAAA,+BAAY,EAAC;IACvE,IAAI,EAAE,8CAA8C;IACpD,IAAI,EAAE,oBAAa;IACnB,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE,iFAAiF;IAC9F,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;iBACnC;aACF;SACF,CAAC;KACH;IACD,KAAK,CAAC,GAAG,CAAC,OAAO;QACf,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;QAE3C,MAAM,GAAG,GAAG,GAAG,OAAO,qCAAqC,OAAO,CAAC,UAAU,CAAC,MAAM,MAAM,CAAC;QAE3F,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,OAAO,qCAAqC,OAAO,CAAC,UAAU,CAAC,MAAM,MAAM;YACnF,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;gBAClC,qBAAqB,EAAE,SAAS;aACjC;SACF,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createAction, Property } from '@activepieces/pieces-framework';
|
|
2
|
+
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
|
3
|
+
import { workbuddyAuth, getAccessToken } from '../auth';
|
|
4
|
+
|
|
5
|
+
export const PublicApiTemplateController_listEmailTemplates = createAction({
|
|
6
|
+
name: 'PublicApiTemplateController_listEmailTemplates',
|
|
7
|
+
auth: workbuddyAuth,
|
|
8
|
+
displayName: 'List email templates for entity type',
|
|
9
|
+
description: 'Retrieve all active email templates for the specified entity type (job or stage).',
|
|
10
|
+
props: {
|
|
11
|
+
entity: Property.StaticDropdown({
|
|
12
|
+
displayName: 'Entity',
|
|
13
|
+
description: 'Entity type',
|
|
14
|
+
required: true,
|
|
15
|
+
options: {
|
|
16
|
+
options: [
|
|
17
|
+
{ label: 'job', value: 'job' },
|
|
18
|
+
{ label: 'stage', value: 'stage' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
async run(context) {
|
|
24
|
+
const token = await getAccessToken(context.auth);
|
|
25
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
26
|
+
|
|
27
|
+
const url = `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/email`;
|
|
28
|
+
|
|
29
|
+
const response = await httpClient.sendRequest({
|
|
30
|
+
method: HttpMethod.GET,
|
|
31
|
+
url: `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/email`,
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: `Bearer ${token}`,
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return response.body;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const PublicApiTemplateController_listSmsTemplates = createAction({
|
|
44
|
+
name: 'PublicApiTemplateController_listSmsTemplates',
|
|
45
|
+
auth: workbuddyAuth,
|
|
46
|
+
displayName: 'List SMS templates for entity type',
|
|
47
|
+
description: 'Retrieve all active SMS templates for the specified entity type (job or stage).',
|
|
48
|
+
props: {
|
|
49
|
+
entity: Property.StaticDropdown({
|
|
50
|
+
displayName: 'Entity',
|
|
51
|
+
description: 'Entity type',
|
|
52
|
+
required: true,
|
|
53
|
+
options: {
|
|
54
|
+
options: [
|
|
55
|
+
{ label: 'job', value: 'job' },
|
|
56
|
+
{ label: 'stage', value: 'stage' },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
async run(context) {
|
|
62
|
+
const token = await getAccessToken(context.auth);
|
|
63
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
64
|
+
|
|
65
|
+
const url = `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/sms`;
|
|
66
|
+
|
|
67
|
+
const response = await httpClient.sendRequest({
|
|
68
|
+
method: HttpMethod.GET,
|
|
69
|
+
url: `${baseUrl}/api/v2/public/settings/templates/${context.propsValue.entity}/sms`,
|
|
70
|
+
headers: {
|
|
71
|
+
Authorization: `Bearer ${token}`,
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
return response.body;
|
|
78
|
+
},
|
|
79
|
+
});
|