@workbuddy/piece-workbuddy-edge 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +24 -0
- package/src/index.d.ts +8 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +199 -0
- package/src/index.js.map +1 -0
- package/src/index.ts +354 -0
- package/src/lib/actions/attachments.d.ts +17 -0
- package/src/lib/actions/attachments.d.ts.map +1 -0
- package/src/lib/actions/attachments.js +79 -0
- package/src/lib/actions/attachments.js.map +1 -0
- package/src/lib/actions/attachments.ts +85 -0
- package/src/lib/actions/crm->-companies.d.ts +16 -0
- package/src/lib/actions/crm->-companies.d.ts.map +1 -0
- package/src/lib/actions/crm->-companies.js +77 -0
- package/src/lib/actions/crm->-companies.js.map +1 -0
- package/src/lib/actions/crm->-companies.ts +84 -0
- package/src/lib/actions/crm->-contacts.d.ts +16 -0
- package/src/lib/actions/crm->-contacts.d.ts.map +1 -0
- package/src/lib/actions/crm->-contacts.js +77 -0
- package/src/lib/actions/crm->-contacts.js.map +1 -0
- package/src/lib/actions/crm->-contacts.ts +84 -0
- package/src/lib/actions/crm->-contractors.d.ts +16 -0
- package/src/lib/actions/crm->-contractors.d.ts.map +1 -0
- package/src/lib/actions/crm->-contractors.js +77 -0
- package/src/lib/actions/crm->-contractors.js.map +1 -0
- package/src/lib/actions/crm->-contractors.ts +84 -0
- package/src/lib/actions/crm->-customers.d.ts +35 -0
- package/src/lib/actions/crm->-customers.d.ts.map +1 -0
- package/src/lib/actions/crm->-customers.js +180 -0
- package/src/lib/actions/crm->-customers.js.map +1 -0
- package/src/lib/actions/crm->-customers.ts +203 -0
- package/src/lib/actions/crm->-employees.d.ts +16 -0
- package/src/lib/actions/crm->-employees.d.ts.map +1 -0
- package/src/lib/actions/crm->-employees.js +77 -0
- package/src/lib/actions/crm->-employees.js.map +1 -0
- package/src/lib/actions/crm->-employees.ts +84 -0
- package/src/lib/actions/crm->-external-users.d.ts +16 -0
- package/src/lib/actions/crm->-external-users.d.ts.map +1 -0
- package/src/lib/actions/crm->-external-users.js +77 -0
- package/src/lib/actions/crm->-external-users.js.map +1 -0
- package/src/lib/actions/crm->-external-users.ts +84 -0
- package/src/lib/actions/crm->-invites.d.ts +16 -0
- package/src/lib/actions/crm->-invites.d.ts.map +1 -0
- package/src/lib/actions/crm->-invites.js +77 -0
- package/src/lib/actions/crm->-invites.js.map +1 -0
- package/src/lib/actions/crm->-invites.ts +84 -0
- package/src/lib/actions/crm->-sites.d.ts +17 -0
- package/src/lib/actions/crm->-sites.d.ts.map +1 -0
- package/src/lib/actions/crm->-sites.js +86 -0
- package/src/lib/actions/crm->-sites.js.map +1 -0
- package/src/lib/actions/crm->-sites.ts +95 -0
- package/src/lib/actions/crm->-suppliers.d.ts +16 -0
- package/src/lib/actions/crm->-suppliers.d.ts.map +1 -0
- package/src/lib/actions/crm->-suppliers.js +77 -0
- package/src/lib/actions/crm->-suppliers.js.map +1 -0
- package/src/lib/actions/crm->-suppliers.ts +84 -0
- package/src/lib/actions/data-export.d.ts +11 -0
- package/src/lib/actions/data-export.d.ts.map +1 -0
- package/src/lib/actions/data-export.js +78 -0
- package/src/lib/actions/data-export.js.map +1 -0
- package/src/lib/actions/data-export.ts +82 -0
- package/src/lib/actions/index.d.ts +25 -0
- package/src/lib/actions/index.d.ts.map +1 -0
- package/src/lib/actions/index.js +41 -0
- package/src/lib/actions/index.js.map +1 -0
- package/src/lib/actions/index.ts +24 -0
- package/src/lib/actions/jobs->-activities.d.ts +87 -0
- package/src/lib/actions/jobs->-activities.d.ts.map +1 -0
- package/src/lib/actions/jobs->-activities.js +445 -0
- package/src/lib/actions/jobs->-activities.js.map +1 -0
- package/src/lib/actions/jobs->-activities.ts +473 -0
- package/src/lib/actions/jobs->-contacts.d.ts +31 -0
- package/src/lib/actions/jobs->-contacts.d.ts.map +1 -0
- package/src/lib/actions/jobs->-contacts.js +129 -0
- package/src/lib/actions/jobs->-contacts.js.map +1 -0
- package/src/lib/actions/jobs->-contacts.ts +141 -0
- package/src/lib/actions/jobs->-files.d.ts +31 -0
- package/src/lib/actions/jobs->-files.d.ts.map +1 -0
- package/src/lib/actions/jobs->-files.js +129 -0
- package/src/lib/actions/jobs->-files.js.map +1 -0
- package/src/lib/actions/jobs->-files.ts +141 -0
- package/src/lib/actions/jobs->-tasks.d.ts +75 -0
- package/src/lib/actions/jobs->-tasks.d.ts.map +1 -0
- package/src/lib/actions/jobs->-tasks.js +395 -0
- package/src/lib/actions/jobs->-tasks.js.map +1 -0
- package/src/lib/actions/jobs->-tasks.ts +417 -0
- package/src/lib/actions/jobs.d.ts +148 -0
- package/src/lib/actions/jobs.d.ts.map +1 -0
- package/src/lib/actions/jobs.js +800 -0
- package/src/lib/actions/jobs.js.map +1 -0
- package/src/lib/actions/jobs.ts +846 -0
- package/src/lib/actions/mcp-context.d.ts +16 -0
- package/src/lib/actions/mcp-context.d.ts.map +1 -0
- package/src/lib/actions/mcp-context.js +82 -0
- package/src/lib/actions/mcp-context.js.map +1 -0
- package/src/lib/actions/mcp-context.ts +86 -0
- package/src/lib/actions/mcp.d.ts +21 -0
- package/src/lib/actions/mcp.d.ts.map +1 -0
- package/src/lib/actions/mcp.js +104 -0
- package/src/lib/actions/mcp.js.map +1 -0
- package/src/lib/actions/mcp.ts +112 -0
- package/src/lib/actions/settings.d.ts +57 -0
- package/src/lib/actions/settings.d.ts.map +1 -0
- package/src/lib/actions/settings.js +257 -0
- package/src/lib/actions/settings.js.map +1 -0
- package/src/lib/actions/settings.ts +301 -0
- package/src/lib/actions/stages->-activities.d.ts +87 -0
- package/src/lib/actions/stages->-activities.d.ts.map +1 -0
- package/src/lib/actions/stages->-activities.js +445 -0
- package/src/lib/actions/stages->-activities.js.map +1 -0
- package/src/lib/actions/stages->-activities.ts +473 -0
- package/src/lib/actions/stages->-files.d.ts +31 -0
- package/src/lib/actions/stages->-files.d.ts.map +1 -0
- package/src/lib/actions/stages->-files.js +129 -0
- package/src/lib/actions/stages->-files.js.map +1 -0
- package/src/lib/actions/stages->-files.ts +141 -0
- package/src/lib/actions/stages->-resources.d.ts +58 -0
- package/src/lib/actions/stages->-resources.d.ts.map +1 -0
- package/src/lib/actions/stages->-resources.js +279 -0
- package/src/lib/actions/stages->-resources.js.map +1 -0
- package/src/lib/actions/stages->-resources.ts +302 -0
- package/src/lib/actions/stages->-tasks.d.ts +77 -0
- package/src/lib/actions/stages->-tasks.d.ts.map +1 -0
- package/src/lib/actions/stages->-tasks.js +405 -0
- package/src/lib/actions/stages->-tasks.js.map +1 -0
- package/src/lib/actions/stages->-tasks.ts +427 -0
- package/src/lib/actions/stages.d.ts +85 -0
- package/src/lib/actions/stages.d.ts.map +1 -0
- package/src/lib/actions/stages.js +417 -0
- package/src/lib/actions/stages.js.map +1 -0
- package/src/lib/actions/stages.ts +452 -0
- package/src/lib/actions/webhooks-v2.d.ts +72 -0
- package/src/lib/actions/webhooks-v2.d.ts.map +1 -0
- package/src/lib/actions/webhooks-v2.js +297 -0
- package/src/lib/actions/webhooks-v2.js.map +1 -0
- package/src/lib/actions/webhooks-v2.ts +337 -0
- package/src/lib/actions/webhooks.d.ts +48 -0
- package/src/lib/actions/webhooks.d.ts.map +1 -0
- package/src/lib/actions/webhooks.js +292 -0
- package/src/lib/actions/webhooks.js.map +1 -0
- package/src/lib/actions/webhooks.ts +318 -0
- package/src/lib/auth.d.ts +18 -0
- package/src/lib/auth.d.ts.map +1 -0
- package/src/lib/auth.js +77 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/auth.ts +84 -0
- package/src/lib/common/index.d.ts +11 -0
- package/src/lib/common/index.d.ts.map +1 -0
- package/src/lib/common/index.js +8 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/common/index.ts +12 -0
- package/src/lib/triggers/activity.d.ts +77 -0
- package/src/lib/triggers/activity.d.ts.map +1 -0
- package/src/lib/triggers/activity.js +241 -0
- package/src/lib/triggers/activity.js.map +1 -0
- package/src/lib/triggers/activity.ts +261 -0
- package/src/lib/triggers/allocation.d.ts +53 -0
- package/src/lib/triggers/allocation.d.ts.map +1 -0
- package/src/lib/triggers/allocation.js +181 -0
- package/src/lib/triggers/allocation.js.map +1 -0
- package/src/lib/triggers/allocation.ts +198 -0
- package/src/lib/triggers/bill.d.ts +102 -0
- package/src/lib/triggers/bill.d.ts.map +1 -0
- package/src/lib/triggers/bill.js +327 -0
- package/src/lib/triggers/bill.js.map +1 -0
- package/src/lib/triggers/bill.ts +355 -0
- package/src/lib/triggers/form.d.ts +19 -0
- package/src/lib/triggers/form.d.ts.map +1 -0
- package/src/lib/triggers/form.js +65 -0
- package/src/lib/triggers/form.js.map +1 -0
- package/src/lib/triggers/form.ts +68 -0
- package/src/lib/triggers/index.d.ts +10 -0
- package/src/lib/triggers/index.d.ts.map +1 -0
- package/src/lib/triggers/index.js +26 -0
- package/src/lib/triggers/index.js.map +1 -0
- package/src/lib/triggers/index.ts +9 -0
- package/src/lib/triggers/invoice.d.ts +102 -0
- package/src/lib/triggers/invoice.d.ts.map +1 -0
- package/src/lib/triggers/invoice.js +327 -0
- package/src/lib/triggers/invoice.js.map +1 -0
- package/src/lib/triggers/invoice.ts +355 -0
- package/src/lib/triggers/item.d.ts +53 -0
- package/src/lib/triggers/item.d.ts.map +1 -0
- package/src/lib/triggers/item.js +181 -0
- package/src/lib/triggers/item.js.map +1 -0
- package/src/lib/triggers/item.ts +198 -0
- package/src/lib/triggers/job.d.ts +102 -0
- package/src/lib/triggers/job.d.ts.map +1 -0
- package/src/lib/triggers/job.js +419 -0
- package/src/lib/triggers/job.js.map +1 -0
- package/src/lib/triggers/job.ts +447 -0
- package/src/lib/triggers/lead.d.ts +102 -0
- package/src/lib/triggers/lead.d.ts.map +1 -0
- package/src/lib/triggers/lead.js +319 -0
- package/src/lib/triggers/lead.js.map +1 -0
- package/src/lib/triggers/lead.ts +347 -0
- package/src/lib/triggers/opportunity.d.ts +102 -0
- package/src/lib/triggers/opportunity.d.ts.map +1 -0
- package/src/lib/triggers/opportunity.js +319 -0
- package/src/lib/triggers/opportunity.js.map +1 -0
- package/src/lib/triggers/opportunity.ts +347 -0
- package/src/lib/triggers/quote.d.ts +102 -0
- package/src/lib/triggers/quote.d.ts.map +1 -0
- package/src/lib/triggers/quote.js +327 -0
- package/src/lib/triggers/quote.js.map +1 -0
- package/src/lib/triggers/quote.ts +355 -0
- package/src/lib/triggers/site.d.ts +19 -0
- package/src/lib/triggers/site.d.ts.map +1 -0
- package/src/lib/triggers/site.js +65 -0
- package/src/lib/triggers/site.js.map +1 -0
- package/src/lib/triggers/site.ts +68 -0
- package/src/lib/triggers/stage.d.ts +102 -0
- package/src/lib/triggers/stage.d.ts.map +1 -0
- package/src/lib/triggers/stage.js +487 -0
- package/src/lib/triggers/stage.js.map +1 -0
- package/src/lib/triggers/stage.ts +515 -0
- package/src/lib/triggers/task.d.ts +102 -0
- package/src/lib/triggers/task.d.ts.map +1 -0
- package/src/lib/triggers/task.js +323 -0
- package/src/lib/triggers/task.js.map +1 -0
- package/src/lib/triggers/task.ts +351 -0
- package/src/lib/workbuddy.svg +5 -0
|
@@ -0,0 +1,452 @@
|
|
|
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 PublicJobStageController_create = createAction({
|
|
6
|
+
name: 'PublicJobStageController_create',
|
|
7
|
+
auth: workbuddyAuth,
|
|
8
|
+
displayName: 'Create a new stage',
|
|
9
|
+
description: 'Create a new stage (work order) within a job. Stages represent discrete phases of work.',
|
|
10
|
+
props: {
|
|
11
|
+
jobId: Property.ShortText({
|
|
12
|
+
displayName: 'Job Id',
|
|
13
|
+
description: '',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
name: Property.ShortText({
|
|
17
|
+
displayName: 'Name',
|
|
18
|
+
description: '',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
workCategoryId: Property.ShortText({
|
|
22
|
+
displayName: 'Work Category Id',
|
|
23
|
+
description: '',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
sequence: Property.Number({
|
|
27
|
+
displayName: 'Sequence',
|
|
28
|
+
description: '',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
startDate: Property.ShortText({
|
|
32
|
+
displayName: 'Start Date',
|
|
33
|
+
description: '',
|
|
34
|
+
required: false,
|
|
35
|
+
}),
|
|
36
|
+
dueDate: Property.ShortText({
|
|
37
|
+
displayName: 'Due Date',
|
|
38
|
+
description: '',
|
|
39
|
+
required: false,
|
|
40
|
+
}),
|
|
41
|
+
notes: Property.LongText({
|
|
42
|
+
displayName: 'Notes',
|
|
43
|
+
description: '',
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
customFields: Property.Json({
|
|
47
|
+
displayName: 'Custom Fields',
|
|
48
|
+
description: '',
|
|
49
|
+
required: false,
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
async run(context) {
|
|
53
|
+
const token = await getAccessToken(context.auth);
|
|
54
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
55
|
+
|
|
56
|
+
const url = `${baseUrl}/api/v2/public/stages`;
|
|
57
|
+
|
|
58
|
+
const body = {
|
|
59
|
+
jobId: context.propsValue.jobId,
|
|
60
|
+
name: context.propsValue.name,
|
|
61
|
+
workCategoryId: context.propsValue.workCategoryId,
|
|
62
|
+
sequence: context.propsValue.sequence,
|
|
63
|
+
startDate: context.propsValue.startDate,
|
|
64
|
+
dueDate: context.propsValue.dueDate,
|
|
65
|
+
notes: context.propsValue.notes,
|
|
66
|
+
customFields: context.propsValue.customFields,
|
|
67
|
+
};
|
|
68
|
+
const response = await httpClient.sendRequest({
|
|
69
|
+
method: HttpMethod.POST,
|
|
70
|
+
url: `${baseUrl}/api/v2/public/stages`,
|
|
71
|
+
headers: {
|
|
72
|
+
Authorization: `Bearer ${token}`,
|
|
73
|
+
'Content-Type': 'application/json',
|
|
74
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
75
|
+
},
|
|
76
|
+
body: body,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return response.body;
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const PublicJobStageController_update = createAction({
|
|
84
|
+
name: 'PublicJobStageController_update',
|
|
85
|
+
auth: workbuddyAuth,
|
|
86
|
+
displayName: 'Update a stage',
|
|
87
|
+
description: 'Partially update a stage. Only provided fields will be modified.',
|
|
88
|
+
props: {
|
|
89
|
+
id: Property.ShortText({
|
|
90
|
+
displayName: 'Id',
|
|
91
|
+
description: 'Stage ID',
|
|
92
|
+
required: true,
|
|
93
|
+
}),
|
|
94
|
+
name: Property.ShortText({
|
|
95
|
+
displayName: 'Name',
|
|
96
|
+
description: '',
|
|
97
|
+
required: false,
|
|
98
|
+
}),
|
|
99
|
+
workCategoryId: Property.ShortText({
|
|
100
|
+
displayName: 'Work Category Id',
|
|
101
|
+
description: '',
|
|
102
|
+
required: false,
|
|
103
|
+
}),
|
|
104
|
+
startDate: Property.ShortText({
|
|
105
|
+
displayName: 'Start Date',
|
|
106
|
+
description: '',
|
|
107
|
+
required: false,
|
|
108
|
+
}),
|
|
109
|
+
dueDate: Property.ShortText({
|
|
110
|
+
displayName: 'Due Date',
|
|
111
|
+
description: '',
|
|
112
|
+
required: false,
|
|
113
|
+
}),
|
|
114
|
+
notes: Property.LongText({
|
|
115
|
+
displayName: 'Notes',
|
|
116
|
+
description: '',
|
|
117
|
+
required: false,
|
|
118
|
+
}),
|
|
119
|
+
tags: Property.Json({
|
|
120
|
+
displayName: 'Tags',
|
|
121
|
+
description: '',
|
|
122
|
+
required: false,
|
|
123
|
+
}),
|
|
124
|
+
schedulingTags: Property.Json({
|
|
125
|
+
displayName: 'Scheduling Tags',
|
|
126
|
+
description: '',
|
|
127
|
+
required: false,
|
|
128
|
+
}),
|
|
129
|
+
customFields: Property.Json({
|
|
130
|
+
displayName: 'Custom Fields',
|
|
131
|
+
description: '',
|
|
132
|
+
required: false,
|
|
133
|
+
}),
|
|
134
|
+
},
|
|
135
|
+
async run(context) {
|
|
136
|
+
const token = await getAccessToken(context.auth);
|
|
137
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
138
|
+
|
|
139
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}`;
|
|
140
|
+
|
|
141
|
+
// Build body with only defined values (for partial updates)
|
|
142
|
+
const rawBody: Record<string, unknown> = {
|
|
143
|
+
name: context.propsValue.name,
|
|
144
|
+
workCategoryId: context.propsValue.workCategoryId,
|
|
145
|
+
startDate: context.propsValue.startDate,
|
|
146
|
+
dueDate: context.propsValue.dueDate,
|
|
147
|
+
notes: context.propsValue.notes,
|
|
148
|
+
tags: context.propsValue.tags,
|
|
149
|
+
schedulingTags: context.propsValue.schedulingTags,
|
|
150
|
+
customFields: context.propsValue.customFields,
|
|
151
|
+
};
|
|
152
|
+
const body = Object.fromEntries(
|
|
153
|
+
Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== '')
|
|
154
|
+
);
|
|
155
|
+
const response = await httpClient.sendRequest({
|
|
156
|
+
method: HttpMethod.PATCH,
|
|
157
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}`,
|
|
158
|
+
headers: {
|
|
159
|
+
Authorization: `Bearer ${token}`,
|
|
160
|
+
'Content-Type': 'application/json',
|
|
161
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
162
|
+
},
|
|
163
|
+
body: body,
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
return response.body;
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export const PublicJobStageController_delete = createAction({
|
|
171
|
+
name: 'PublicJobStageController_delete',
|
|
172
|
+
auth: workbuddyAuth,
|
|
173
|
+
displayName: 'Delete a stage',
|
|
174
|
+
description: 'Permanently delete a stage and all associated items/resources. This action cannot be undone.',
|
|
175
|
+
props: {
|
|
176
|
+
id: Property.ShortText({
|
|
177
|
+
displayName: 'Id',
|
|
178
|
+
description: 'Stage ID',
|
|
179
|
+
required: true,
|
|
180
|
+
}),
|
|
181
|
+
},
|
|
182
|
+
async run(context) {
|
|
183
|
+
const token = await getAccessToken(context.auth);
|
|
184
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
185
|
+
|
|
186
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}`;
|
|
187
|
+
|
|
188
|
+
const response = await httpClient.sendRequest({
|
|
189
|
+
method: HttpMethod.DELETE,
|
|
190
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}`,
|
|
191
|
+
headers: {
|
|
192
|
+
Authorization: `Bearer ${token}`,
|
|
193
|
+
'Content-Type': 'application/json',
|
|
194
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return response.body;
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
export const PublicJobStageController_dispatch = createAction({
|
|
203
|
+
name: 'PublicJobStageController_dispatch',
|
|
204
|
+
auth: workbuddyAuth,
|
|
205
|
+
displayName: 'Dispatch a stage',
|
|
206
|
+
description: 'Change stage status to dispatched, making it ready for field work.',
|
|
207
|
+
props: {
|
|
208
|
+
id: Property.ShortText({
|
|
209
|
+
displayName: 'Id',
|
|
210
|
+
description: 'Stage ID',
|
|
211
|
+
required: true,
|
|
212
|
+
}),
|
|
213
|
+
},
|
|
214
|
+
async run(context) {
|
|
215
|
+
const token = await getAccessToken(context.auth);
|
|
216
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
217
|
+
|
|
218
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/dispatch`;
|
|
219
|
+
|
|
220
|
+
const response = await httpClient.sendRequest({
|
|
221
|
+
method: HttpMethod.POST,
|
|
222
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/dispatch`,
|
|
223
|
+
headers: {
|
|
224
|
+
Authorization: `Bearer ${token}`,
|
|
225
|
+
'Content-Type': 'application/json',
|
|
226
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return response.body;
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
export const PublicJobStageController_complete = createAction({
|
|
235
|
+
name: 'PublicJobStageController_complete',
|
|
236
|
+
auth: workbuddyAuth,
|
|
237
|
+
displayName: 'Complete a stage',
|
|
238
|
+
description: 'Mark a stage as completed. Field work is done but stage may still need finalisation/billing.',
|
|
239
|
+
props: {
|
|
240
|
+
id: Property.ShortText({
|
|
241
|
+
displayName: 'Id',
|
|
242
|
+
description: 'Stage ID',
|
|
243
|
+
required: true,
|
|
244
|
+
}),
|
|
245
|
+
completedDate: Property.DateTime({
|
|
246
|
+
displayName: 'Completed Date',
|
|
247
|
+
description: '',
|
|
248
|
+
required: false,
|
|
249
|
+
}),
|
|
250
|
+
notes: Property.LongText({
|
|
251
|
+
displayName: 'Notes',
|
|
252
|
+
description: '',
|
|
253
|
+
required: false,
|
|
254
|
+
}),
|
|
255
|
+
},
|
|
256
|
+
async run(context) {
|
|
257
|
+
const token = await getAccessToken(context.auth);
|
|
258
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
259
|
+
|
|
260
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/complete`;
|
|
261
|
+
|
|
262
|
+
const body = {
|
|
263
|
+
completedDate: context.propsValue.completedDate,
|
|
264
|
+
notes: context.propsValue.notes,
|
|
265
|
+
};
|
|
266
|
+
const response = await httpClient.sendRequest({
|
|
267
|
+
method: HttpMethod.POST,
|
|
268
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/complete`,
|
|
269
|
+
headers: {
|
|
270
|
+
Authorization: `Bearer ${token}`,
|
|
271
|
+
'Content-Type': 'application/json',
|
|
272
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
273
|
+
},
|
|
274
|
+
body: body,
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
return response.body;
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
export const PublicJobStageController_finalise = createAction({
|
|
282
|
+
name: 'PublicJobStageController_finalise',
|
|
283
|
+
auth: workbuddyAuth,
|
|
284
|
+
displayName: 'Finalise a stage',
|
|
285
|
+
description: 'Finalise a completed stage. This typically indicates billing/invoicing is complete.',
|
|
286
|
+
props: {
|
|
287
|
+
id: Property.ShortText({
|
|
288
|
+
displayName: 'Id',
|
|
289
|
+
description: 'Stage ID',
|
|
290
|
+
required: true,
|
|
291
|
+
}),
|
|
292
|
+
finalisedDate: Property.DateTime({
|
|
293
|
+
displayName: 'Finalised Date',
|
|
294
|
+
description: '',
|
|
295
|
+
required: false,
|
|
296
|
+
}),
|
|
297
|
+
},
|
|
298
|
+
async run(context) {
|
|
299
|
+
const token = await getAccessToken(context.auth);
|
|
300
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
301
|
+
|
|
302
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/finalise`;
|
|
303
|
+
|
|
304
|
+
const body = {
|
|
305
|
+
finalisedDate: context.propsValue.finalisedDate,
|
|
306
|
+
};
|
|
307
|
+
const response = await httpClient.sendRequest({
|
|
308
|
+
method: HttpMethod.POST,
|
|
309
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/finalise`,
|
|
310
|
+
headers: {
|
|
311
|
+
Authorization: `Bearer ${token}`,
|
|
312
|
+
'Content-Type': 'application/json',
|
|
313
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
314
|
+
},
|
|
315
|
+
body: body,
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
return response.body;
|
|
319
|
+
},
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
export const PublicJobStageController_cancel = createAction({
|
|
323
|
+
name: 'PublicJobStageController_cancel',
|
|
324
|
+
auth: workbuddyAuth,
|
|
325
|
+
displayName: 'Cancel a stage',
|
|
326
|
+
description: 'Cancel a stage. Provide a reason/note for the cancellation.',
|
|
327
|
+
props: {
|
|
328
|
+
id: Property.ShortText({
|
|
329
|
+
displayName: 'Id',
|
|
330
|
+
description: 'Stage ID',
|
|
331
|
+
required: true,
|
|
332
|
+
}),
|
|
333
|
+
note: Property.ShortText({
|
|
334
|
+
displayName: 'Note',
|
|
335
|
+
description: '',
|
|
336
|
+
required: true,
|
|
337
|
+
}),
|
|
338
|
+
},
|
|
339
|
+
async run(context) {
|
|
340
|
+
const token = await getAccessToken(context.auth);
|
|
341
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
342
|
+
|
|
343
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/cancel`;
|
|
344
|
+
|
|
345
|
+
const body = {
|
|
346
|
+
note: context.propsValue.note,
|
|
347
|
+
};
|
|
348
|
+
const response = await httpClient.sendRequest({
|
|
349
|
+
method: HttpMethod.POST,
|
|
350
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/cancel`,
|
|
351
|
+
headers: {
|
|
352
|
+
Authorization: `Bearer ${token}`,
|
|
353
|
+
'Content-Type': 'application/json',
|
|
354
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
355
|
+
},
|
|
356
|
+
body: body,
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
return response.body;
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
export const PublicJobStageController_reverse = createAction({
|
|
364
|
+
name: 'PublicJobStageController_reverse',
|
|
365
|
+
auth: workbuddyAuth,
|
|
366
|
+
displayName: 'Reverse stage status',
|
|
367
|
+
description:
|
|
368
|
+
'Reverse (reopen) a stage to a previous status. This is an admin action that bypasses normal transition rules and clears fields appropriate to the target status.',
|
|
369
|
+
props: {
|
|
370
|
+
id: Property.ShortText({
|
|
371
|
+
displayName: 'Id',
|
|
372
|
+
description: 'Stage ID',
|
|
373
|
+
required: true,
|
|
374
|
+
}),
|
|
375
|
+
targetStatus: Property.StaticDropdown({
|
|
376
|
+
displayName: 'Target Status',
|
|
377
|
+
description: '',
|
|
378
|
+
required: true,
|
|
379
|
+
options: {
|
|
380
|
+
options: [
|
|
381
|
+
{ label: 'new', value: 'new' },
|
|
382
|
+
{ label: 'assigned', value: 'assigned' },
|
|
383
|
+
{ label: 'dispatched', value: 'dispatched' },
|
|
384
|
+
{ label: 'in_progress', value: 'in_progress' },
|
|
385
|
+
{ label: 'on_hold', value: 'on_hold' },
|
|
386
|
+
{ label: 'completed', value: 'completed' },
|
|
387
|
+
{ label: 'finalised', value: 'finalised' },
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
}),
|
|
391
|
+
note: Property.ShortText({
|
|
392
|
+
displayName: 'Note',
|
|
393
|
+
description: '',
|
|
394
|
+
required: false,
|
|
395
|
+
}),
|
|
396
|
+
},
|
|
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/stages/${context.propsValue.id}/reverse`;
|
|
402
|
+
|
|
403
|
+
const body = {
|
|
404
|
+
targetStatus: context.propsValue.targetStatus,
|
|
405
|
+
note: context.propsValue.note,
|
|
406
|
+
};
|
|
407
|
+
const response = await httpClient.sendRequest({
|
|
408
|
+
method: HttpMethod.POST,
|
|
409
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/reverse`,
|
|
410
|
+
headers: {
|
|
411
|
+
Authorization: `Bearer ${token}`,
|
|
412
|
+
'Content-Type': 'application/json',
|
|
413
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
414
|
+
},
|
|
415
|
+
body: body,
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
return response.body;
|
|
419
|
+
},
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
export const PublicJobStageController_reissue = createAction({
|
|
423
|
+
name: 'PublicJobStageController_reissue',
|
|
424
|
+
auth: workbuddyAuth,
|
|
425
|
+
displayName: 'Reissue dispatch notifications',
|
|
426
|
+
description: 'Resend dispatch notifications to all resources and contractor assigned to this stage.',
|
|
427
|
+
props: {
|
|
428
|
+
id: Property.ShortText({
|
|
429
|
+
displayName: 'Id',
|
|
430
|
+
description: 'Stage ID',
|
|
431
|
+
required: true,
|
|
432
|
+
}),
|
|
433
|
+
},
|
|
434
|
+
async run(context) {
|
|
435
|
+
const token = await getAccessToken(context.auth);
|
|
436
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
437
|
+
|
|
438
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/reissue`;
|
|
439
|
+
|
|
440
|
+
const response = await httpClient.sendRequest({
|
|
441
|
+
method: HttpMethod.POST,
|
|
442
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/reissue`,
|
|
443
|
+
headers: {
|
|
444
|
+
Authorization: `Bearer ${token}`,
|
|
445
|
+
'Content-Type': 'application/json',
|
|
446
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
447
|
+
},
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
return response.body;
|
|
451
|
+
},
|
|
452
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const PublicApiWebhookV2Controller_listEntities: 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
|
+
export declare const PublicApiWebhookV2Controller_listEntityEvents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
+
}>, {
|
|
11
|
+
entity: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const PublicApiWebhookV2Controller_listEntityFilters: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
14
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
16
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
17
|
+
}>, {
|
|
18
|
+
entity: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const PublicApiWebhookV2Controller_list: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
21
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
23
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
24
|
+
}>, {}>;
|
|
25
|
+
export declare const PublicApiWebhookV2Controller_create: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
26
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
27
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
28
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
29
|
+
}>, {}>;
|
|
30
|
+
export declare const PublicApiWebhookV2Controller_get: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
31
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
32
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
33
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
34
|
+
}>, {
|
|
35
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const PublicApiWebhookV2Controller_update: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
38
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
39
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
40
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
41
|
+
}>, {
|
|
42
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const PublicApiWebhookV2Controller_delete: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
45
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
46
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
47
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
48
|
+
}>, {
|
|
49
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const PublicApiWebhookV2Controller_regenerateSecret: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
52
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
53
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
54
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
55
|
+
}>, {
|
|
56
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const PublicApiWebhookV2Controller_test: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
59
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
60
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
61
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
62
|
+
}>, {
|
|
63
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
64
|
+
}>;
|
|
65
|
+
export declare const PublicApiWebhookV2Controller_listDeliveries: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
66
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
67
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
68
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
69
|
+
}>, {
|
|
70
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
71
|
+
}>;
|
|
72
|
+
//# sourceMappingURL=webhooks-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks-v2.d.ts","sourceRoot":"","sources":["webhooks-v2.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yCAAyC;;;;OAwBpD,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;EA8BxD,CAAC;AAEH,eAAO,MAAM,8CAA8C;;;;;;EA8BzD,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;OAwB5C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;OAwB9C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;EA8B3C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;EA8B9C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;EA8B9C,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;EA8BxD,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;EA8B5C,CAAC;AAEH,eAAO,MAAM,2CAA2C;;;;;;EA8BtD,CAAC"}
|