@workbuddy/piece-workbuddy-vnext 1.0.83 → 1.0.85
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 +12 -0
- package/src/index.js.map +1 -1
- package/src/index.ts +26 -1
- package/src/lib/actions/crm-contacts.d.ts.map +1 -1
- package/src/lib/actions/crm-contacts.js +1 -1
- package/src/lib/actions/crm-contacts.js.map +1 -1
- package/src/lib/actions/crm-contacts.ts +2 -1
- 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-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/index.d.ts +2 -0
- package/src/lib/actions/index.d.ts.map +1 -1
- package/src/lib/actions/index.js +2 -0
- package/src/lib/actions/index.js.map +1 -1
- package/src/lib/actions/index.ts +2 -0
- package/src/lib/actions/jobs.d.ts.map +1 -1
- package/src/lib/actions/jobs.js +0 -3
- package/src/lib/actions/jobs.js.map +1 -1
- package/src/lib/actions/jobs.ts +0 -3
- 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-reference-data.d.ts.map +1 -1
- package/src/lib/actions/settings-reference-data.js +6 -5
- package/src/lib/actions/settings-reference-data.js.map +1 -1
- package/src/lib/actions/settings-reference-data.ts +6 -5
- 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 +4 -4
- package/src/lib/actions/stages-resources.js.map +1 -1
- package/src/lib/actions/stages-resources.ts +7 -4
- package/src/lib/actions/stages.d.ts +10 -0
- package/src/lib/actions/stages.d.ts.map +1 -1
- package/src/lib/actions/stages.js +52 -2
- package/src/lib/actions/stages.js.map +1 -1
- package/src/lib/actions/stages.ts +58 -1
|
@@ -0,0 +1,404 @@
|
|
|
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 PublicJobStagePendingItemController_list = createAction({
|
|
6
|
+
name: 'PublicJobStagePendingItemController_list',
|
|
7
|
+
auth: workbuddyAuth,
|
|
8
|
+
displayName: 'List stage pending items',
|
|
9
|
+
description: 'List items awaiting approval for a stage.',
|
|
10
|
+
props: {
|
|
11
|
+
id: Property.ShortText({
|
|
12
|
+
displayName: 'Id',
|
|
13
|
+
description: 'Job ID',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
stageId: Property.ShortText({
|
|
17
|
+
displayName: 'Stage Id',
|
|
18
|
+
description: 'Stage ID',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
cursor: Property.ShortText({
|
|
22
|
+
displayName: 'Cursor',
|
|
23
|
+
description: 'Pending item ID after which to continue',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
limit: Property.Number({
|
|
27
|
+
displayName: 'Limit',
|
|
28
|
+
description: 'Maximum results (1-200)',
|
|
29
|
+
required: false,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
async run(context) {
|
|
33
|
+
const token = await getAccessToken(context.auth);
|
|
34
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
35
|
+
|
|
36
|
+
const url = `${baseUrl}/jobs/{id}/stages/{stageId}/pending-items`;
|
|
37
|
+
|
|
38
|
+
const queryParams = new URLSearchParams();
|
|
39
|
+
if (
|
|
40
|
+
context.propsValue.cursor !== undefined &&
|
|
41
|
+
context.propsValue.cursor !== null &&
|
|
42
|
+
context.propsValue.cursor !== ''
|
|
43
|
+
)
|
|
44
|
+
queryParams.append('cursor', String(context.propsValue.cursor));
|
|
45
|
+
if (context.propsValue.limit !== undefined && context.propsValue.limit !== null)
|
|
46
|
+
queryParams.append('limit', String(context.propsValue.limit));
|
|
47
|
+
const queryString = queryParams.toString();
|
|
48
|
+
const urlWithQuery = queryString ? `${url}?${queryString}` : url;
|
|
49
|
+
|
|
50
|
+
const response = await httpClient.sendRequest({
|
|
51
|
+
method: HttpMethod.GET,
|
|
52
|
+
url: urlWithQuery,
|
|
53
|
+
headers: {
|
|
54
|
+
Authorization: `Bearer ${token}`,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return response.body;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const PublicJobStagePendingItemController_create = createAction({
|
|
65
|
+
name: 'PublicJobStagePendingItemController_create',
|
|
66
|
+
auth: workbuddyAuth,
|
|
67
|
+
displayName: 'Create stage pending items',
|
|
68
|
+
description: 'Create one or more items awaiting approval.',
|
|
69
|
+
props: {
|
|
70
|
+
id: Property.ShortText({
|
|
71
|
+
displayName: 'Id',
|
|
72
|
+
description: 'Job ID',
|
|
73
|
+
required: true,
|
|
74
|
+
}),
|
|
75
|
+
stageId: Property.ShortText({
|
|
76
|
+
displayName: 'Stage Id',
|
|
77
|
+
description: 'Stage ID',
|
|
78
|
+
required: true,
|
|
79
|
+
}),
|
|
80
|
+
items: Property.Json({
|
|
81
|
+
displayName: 'Items',
|
|
82
|
+
description: '',
|
|
83
|
+
required: true,
|
|
84
|
+
defaultValue: [],
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
async run(context) {
|
|
88
|
+
const token = await getAccessToken(context.auth);
|
|
89
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
90
|
+
|
|
91
|
+
const url = `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items`;
|
|
92
|
+
|
|
93
|
+
const rawBody: Record<string, unknown> = {
|
|
94
|
+
items: context.propsValue.items,
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const body = rawBody;
|
|
98
|
+
const response = await httpClient.sendRequest({
|
|
99
|
+
method: HttpMethod.POST,
|
|
100
|
+
url: `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items`,
|
|
101
|
+
headers: {
|
|
102
|
+
Authorization: `Bearer ${token}`,
|
|
103
|
+
'Content-Type': 'application/json',
|
|
104
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
105
|
+
},
|
|
106
|
+
body: body,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return response.body;
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
export const PublicJobStagePendingItemController_get = createAction({
|
|
114
|
+
name: 'PublicJobStagePendingItemController_get',
|
|
115
|
+
auth: workbuddyAuth,
|
|
116
|
+
displayName: 'Get stage pending item',
|
|
117
|
+
description: 'Get a specific pending item within a stage.',
|
|
118
|
+
props: {
|
|
119
|
+
id: Property.ShortText({
|
|
120
|
+
displayName: 'Id',
|
|
121
|
+
description: 'Job ID',
|
|
122
|
+
required: true,
|
|
123
|
+
}),
|
|
124
|
+
stageId: Property.ShortText({
|
|
125
|
+
displayName: 'Stage Id',
|
|
126
|
+
description: 'Stage ID',
|
|
127
|
+
required: true,
|
|
128
|
+
}),
|
|
129
|
+
itemId: Property.ShortText({
|
|
130
|
+
displayName: 'Item Id',
|
|
131
|
+
description: 'Pending item ID',
|
|
132
|
+
required: true,
|
|
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/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}`;
|
|
140
|
+
|
|
141
|
+
const response = await httpClient.sendRequest({
|
|
142
|
+
method: HttpMethod.GET,
|
|
143
|
+
url: `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}`,
|
|
144
|
+
headers: {
|
|
145
|
+
Authorization: `Bearer ${token}`,
|
|
146
|
+
'Content-Type': 'application/json',
|
|
147
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return response.body;
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
export const PublicJobStagePendingItemController_update = createAction({
|
|
156
|
+
name: 'PublicJobStagePendingItemController_update',
|
|
157
|
+
auth: workbuddyAuth,
|
|
158
|
+
displayName: 'Update stage pending item',
|
|
159
|
+
description: 'Update general pending-item fields. Use the status route for itemStatus.',
|
|
160
|
+
props: {
|
|
161
|
+
id: Property.ShortText({
|
|
162
|
+
displayName: 'Id',
|
|
163
|
+
description: 'Job ID',
|
|
164
|
+
required: true,
|
|
165
|
+
}),
|
|
166
|
+
stageId: Property.ShortText({
|
|
167
|
+
displayName: 'Stage Id',
|
|
168
|
+
description: 'Stage ID',
|
|
169
|
+
required: true,
|
|
170
|
+
}),
|
|
171
|
+
itemId: Property.ShortText({
|
|
172
|
+
displayName: 'Item Id',
|
|
173
|
+
description: 'Pending item ID',
|
|
174
|
+
required: true,
|
|
175
|
+
}),
|
|
176
|
+
updatedAt: Property.DateTime({
|
|
177
|
+
displayName: 'Updated At',
|
|
178
|
+
description: 'For optimistic concurrency — update fails if entity was modified after this timestamp',
|
|
179
|
+
required: false,
|
|
180
|
+
}),
|
|
181
|
+
quantity: Property.Number({
|
|
182
|
+
displayName: 'Quantity',
|
|
183
|
+
description: '',
|
|
184
|
+
required: false,
|
|
185
|
+
}),
|
|
186
|
+
unit: Property.ShortText({
|
|
187
|
+
displayName: 'Unit',
|
|
188
|
+
description: '',
|
|
189
|
+
required: false,
|
|
190
|
+
}),
|
|
191
|
+
location: Property.ShortText({
|
|
192
|
+
displayName: 'Location',
|
|
193
|
+
description: '',
|
|
194
|
+
required: false,
|
|
195
|
+
}),
|
|
196
|
+
note: Property.ShortText({
|
|
197
|
+
displayName: 'Note',
|
|
198
|
+
description: '',
|
|
199
|
+
required: false,
|
|
200
|
+
}),
|
|
201
|
+
buyPrice: Property.Number({
|
|
202
|
+
displayName: 'Buy Price',
|
|
203
|
+
description: '',
|
|
204
|
+
required: false,
|
|
205
|
+
}),
|
|
206
|
+
sellPrice: Property.Number({
|
|
207
|
+
displayName: 'Sell Price',
|
|
208
|
+
description: '',
|
|
209
|
+
required: false,
|
|
210
|
+
}),
|
|
211
|
+
invoicingStatus: Property.StaticDropdown({
|
|
212
|
+
displayName: 'Invoicing Status',
|
|
213
|
+
description: '',
|
|
214
|
+
required: false,
|
|
215
|
+
options: {
|
|
216
|
+
options: [
|
|
217
|
+
{ label: 'Billable', value: 'Billable' },
|
|
218
|
+
{ label: 'No Charge', value: 'No Charge' },
|
|
219
|
+
{ label: 'Not Billable', value: 'Not Billable' },
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
}),
|
|
223
|
+
suppliedBySubcontractor: Property.Checkbox({
|
|
224
|
+
displayName: 'Supplied By Subcontractor',
|
|
225
|
+
description: '',
|
|
226
|
+
required: false,
|
|
227
|
+
}),
|
|
228
|
+
},
|
|
229
|
+
async run(context) {
|
|
230
|
+
const token = await getAccessToken(context.auth);
|
|
231
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
232
|
+
|
|
233
|
+
const url = `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}`;
|
|
234
|
+
|
|
235
|
+
// Build body with only defined values (for partial updates)
|
|
236
|
+
const rawBody: Record<string, unknown> = {
|
|
237
|
+
updatedAt: context.propsValue.updatedAt,
|
|
238
|
+
quantity: context.propsValue.quantity,
|
|
239
|
+
unit: context.propsValue.unit,
|
|
240
|
+
location: context.propsValue.location,
|
|
241
|
+
note: context.propsValue.note,
|
|
242
|
+
buyPrice: context.propsValue.buyPrice,
|
|
243
|
+
sellPrice: context.propsValue.sellPrice,
|
|
244
|
+
invoicingStatus: context.propsValue.invoicingStatus,
|
|
245
|
+
suppliedBySubcontractor: context.propsValue.suppliedBySubcontractor,
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const body = Object.fromEntries(
|
|
249
|
+
Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== '')
|
|
250
|
+
);
|
|
251
|
+
const response = await httpClient.sendRequest({
|
|
252
|
+
method: HttpMethod.PATCH,
|
|
253
|
+
url: `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}`,
|
|
254
|
+
headers: {
|
|
255
|
+
Authorization: `Bearer ${token}`,
|
|
256
|
+
'Content-Type': 'application/json',
|
|
257
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
258
|
+
},
|
|
259
|
+
body: body,
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
return response.body;
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export const PublicJobStagePendingItemController_delete = createAction({
|
|
267
|
+
name: 'PublicJobStagePendingItemController_delete',
|
|
268
|
+
auth: workbuddyAuth,
|
|
269
|
+
displayName: 'Delete stage pending item',
|
|
270
|
+
description: 'Delete or decline a pending item according to tenant deletion settings.',
|
|
271
|
+
props: {
|
|
272
|
+
id: Property.ShortText({
|
|
273
|
+
displayName: 'Id',
|
|
274
|
+
description: 'Job ID',
|
|
275
|
+
required: true,
|
|
276
|
+
}),
|
|
277
|
+
stageId: Property.ShortText({
|
|
278
|
+
displayName: 'Stage Id',
|
|
279
|
+
description: 'Stage ID',
|
|
280
|
+
required: true,
|
|
281
|
+
}),
|
|
282
|
+
itemId: Property.ShortText({
|
|
283
|
+
displayName: 'Item Id',
|
|
284
|
+
description: 'Pending item ID',
|
|
285
|
+
required: true,
|
|
286
|
+
}),
|
|
287
|
+
},
|
|
288
|
+
async run(context) {
|
|
289
|
+
const token = await getAccessToken(context.auth);
|
|
290
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
291
|
+
|
|
292
|
+
const url = `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}`;
|
|
293
|
+
|
|
294
|
+
const response = await httpClient.sendRequest({
|
|
295
|
+
method: HttpMethod.DELETE,
|
|
296
|
+
url: `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}`,
|
|
297
|
+
headers: {
|
|
298
|
+
Authorization: `Bearer ${token}`,
|
|
299
|
+
'Content-Type': 'application/json',
|
|
300
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
return response.body;
|
|
305
|
+
},
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
export const PublicJobStagePendingItemController_updateStatus = createAction({
|
|
309
|
+
name: 'PublicJobStagePendingItemController_updateStatus',
|
|
310
|
+
auth: workbuddyAuth,
|
|
311
|
+
displayName: 'Update pending-item status',
|
|
312
|
+
description: 'Set the dedicated pending-item status. No general item fields are accepted.',
|
|
313
|
+
props: {
|
|
314
|
+
id: Property.ShortText({
|
|
315
|
+
displayName: 'Id',
|
|
316
|
+
description: 'Job ID',
|
|
317
|
+
required: true,
|
|
318
|
+
}),
|
|
319
|
+
stageId: Property.ShortText({
|
|
320
|
+
displayName: 'Stage Id',
|
|
321
|
+
description: 'Stage ID',
|
|
322
|
+
required: true,
|
|
323
|
+
}),
|
|
324
|
+
itemId: Property.ShortText({
|
|
325
|
+
displayName: 'Item Id',
|
|
326
|
+
description: 'Pending item ID',
|
|
327
|
+
required: true,
|
|
328
|
+
}),
|
|
329
|
+
itemStatusId: Property.ShortText({
|
|
330
|
+
displayName: 'Item Status Id',
|
|
331
|
+
description: 'item status ID',
|
|
332
|
+
required: true,
|
|
333
|
+
}),
|
|
334
|
+
},
|
|
335
|
+
async run(context) {
|
|
336
|
+
const token = await getAccessToken(context.auth);
|
|
337
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
338
|
+
|
|
339
|
+
const url = `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}/status`;
|
|
340
|
+
|
|
341
|
+
// Build body with only defined values (for partial updates)
|
|
342
|
+
const rawBody: Record<string, unknown> = {
|
|
343
|
+
itemStatusId: context.propsValue.itemStatusId,
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
const body = Object.fromEntries(
|
|
347
|
+
Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== '')
|
|
348
|
+
);
|
|
349
|
+
const response = await httpClient.sendRequest({
|
|
350
|
+
method: HttpMethod.PATCH,
|
|
351
|
+
url: `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}/status`,
|
|
352
|
+
headers: {
|
|
353
|
+
Authorization: `Bearer ${token}`,
|
|
354
|
+
'Content-Type': 'application/json',
|
|
355
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
356
|
+
},
|
|
357
|
+
body: body,
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
return response.body;
|
|
361
|
+
},
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
export const PublicJobStagePendingItemController_approve = createAction({
|
|
365
|
+
name: 'PublicJobStagePendingItemController_approve',
|
|
366
|
+
auth: workbuddyAuth,
|
|
367
|
+
displayName: 'Approve stage pending item',
|
|
368
|
+
description: 'Approve a pending item and promote it to a standard stage item.',
|
|
369
|
+
props: {
|
|
370
|
+
id: Property.ShortText({
|
|
371
|
+
displayName: 'Id',
|
|
372
|
+
description: 'Job ID',
|
|
373
|
+
required: true,
|
|
374
|
+
}),
|
|
375
|
+
stageId: Property.ShortText({
|
|
376
|
+
displayName: 'Stage Id',
|
|
377
|
+
description: 'Stage ID',
|
|
378
|
+
required: true,
|
|
379
|
+
}),
|
|
380
|
+
itemId: Property.ShortText({
|
|
381
|
+
displayName: 'Item Id',
|
|
382
|
+
description: 'Pending item ID',
|
|
383
|
+
required: true,
|
|
384
|
+
}),
|
|
385
|
+
},
|
|
386
|
+
async run(context) {
|
|
387
|
+
const token = await getAccessToken(context.auth);
|
|
388
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
389
|
+
|
|
390
|
+
const url = `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}/approve`;
|
|
391
|
+
|
|
392
|
+
const response = await httpClient.sendRequest({
|
|
393
|
+
method: HttpMethod.POST,
|
|
394
|
+
url: `${baseUrl}/api/v2/public/jobs/${context.propsValue.id}/stages/${context.propsValue.stageId}/pending-items/${context.propsValue.itemId}/approve`,
|
|
395
|
+
headers: {
|
|
396
|
+
Authorization: `Bearer ${token}`,
|
|
397
|
+
'Content-Type': 'application/json',
|
|
398
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
return response.body;
|
|
403
|
+
},
|
|
404
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stages-resources.d.ts","sourceRoot":"","sources":["stages-resources.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qCAAqC;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"stages-resources.d.ts","sourceRoot":"","sources":["stages-resources.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qCAAqC;;;;;;;;;EA0DhD,CAAC;AAEH,eAAO,MAAM,uCAAuC;;;;;;;;EAgDlD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;EAyC/C,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;EAwCpD,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;EAwCnD,CAAC;AAEH,eAAO,MAAM,6CAA6C;;;;;;;;;;EAgExD,CAAC"}
|
|
@@ -8,7 +8,7 @@ exports.PublicJobStageResourceController_list = (0, pieces_framework_1.createAct
|
|
|
8
8
|
name: 'PublicJobStageResourceController_list',
|
|
9
9
|
auth: auth_1.workbuddyAuth,
|
|
10
10
|
displayName: 'List stage resources',
|
|
11
|
-
description: '
|
|
11
|
+
description: 'List people assigned to the stage via this API: employees (resource rows) and the stage contractor when set. Contractors assigned with POST .../resources appear here with isContractor=true (same shape as the assign response) (WBS-10448). Login contacts auto-created for contractor dispatch are excluded.',
|
|
12
12
|
props: {
|
|
13
13
|
jobId: pieces_framework_1.Property.ShortText({
|
|
14
14
|
displayName: 'Job Id',
|
|
@@ -60,7 +60,7 @@ exports.PublicJobStageResourceController_assign = (0, pieces_framework_1.createA
|
|
|
60
60
|
name: 'PublicJobStageResourceController_assign',
|
|
61
61
|
auth: auth_1.workbuddyAuth,
|
|
62
62
|
displayName: 'Assign resource to stage',
|
|
63
|
-
description: 'Assign
|
|
63
|
+
description: 'Assign an Employee or Subcontractor by contactId. Employee → resource row. Subcontractor → stage contractor (isContractor=true). Both appear on GET list (WBS-10448). contactId is a person Contact id (use /employees for staff), not a CRM Contact from /contacts (WBS-10445 / WBS-10442).',
|
|
64
64
|
props: {
|
|
65
65
|
jobId: pieces_framework_1.Property.ShortText({
|
|
66
66
|
displayName: 'Job Id',
|
|
@@ -104,7 +104,7 @@ exports.PublicJobStageResourceController_get = (0, pieces_framework_1.createActi
|
|
|
104
104
|
name: 'PublicJobStageResourceController_get',
|
|
105
105
|
auth: auth_1.workbuddyAuth,
|
|
106
106
|
displayName: 'Get stage resource',
|
|
107
|
-
description: 'Get
|
|
107
|
+
description: 'Get one assignment by id. Employee rows use the resource/contact id; the stage contractor uses the contractor contact id (same id as POST assign when isContractor=true) (WBS-10448).',
|
|
108
108
|
props: {
|
|
109
109
|
jobId: pieces_framework_1.Property.ShortText({
|
|
110
110
|
displayName: 'Job Id',
|
|
@@ -118,7 +118,7 @@ exports.PublicJobStageResourceController_get = (0, pieces_framework_1.createActi
|
|
|
118
118
|
}),
|
|
119
119
|
resourceId: pieces_framework_1.Property.ShortText({
|
|
120
120
|
displayName: 'Resource Id',
|
|
121
|
-
description: 'Resource ID',
|
|
121
|
+
description: 'Resource or contractor contact ID',
|
|
122
122
|
required: true,
|
|
123
123
|
}),
|
|
124
124
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stages-resources.js","sourceRoot":"","sources":["stages-resources.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAwD;AAE3C,QAAA,qCAAqC,GAAG,IAAA,+BAAY,EAAC;IAChE,IAAI,EAAE,uCAAuC;IAC7C,IAAI,EAAE,oBAAa;IACnB,WAAW,EAAE,sBAAsB;IACnC,WAAW,
|
|
1
|
+
{"version":3,"file":"stages-resources.js","sourceRoot":"","sources":["stages-resources.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAwD;AAE3C,QAAA,qCAAqC,GAAG,IAAA,+BAAY,EAAC;IAChE,IAAI,EAAE,uCAAuC;IAC7C,IAAI,EAAE,oBAAa;IACnB,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,iTAAiT;IACnT,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,QAAQ;Y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AAO;YACnC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;YACjC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;SACtC,CAAC;QAEF,MAAM,IAAI,GAAG,OAAO,CAAC;QACrB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,GAAG,OAAO,uBAAuB,OAAO,CAAC,UAAU,CAAC,KAAK,WAAW,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,OAAO,CAAC,UAAU,CAAC,UAAU,SAAS;YACvJ,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;gBAClC,qBAAqB,EAAE,SAAS;aACjC;YACD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -6,7 +6,8 @@ export const PublicJobStageResourceController_list = createAction({
|
|
|
6
6
|
name: 'PublicJobStageResourceController_list',
|
|
7
7
|
auth: workbuddyAuth,
|
|
8
8
|
displayName: 'List stage resources',
|
|
9
|
-
description:
|
|
9
|
+
description:
|
|
10
|
+
'List people assigned to the stage via this API: employees (resource rows) and the stage contractor when set. Contractors assigned with POST .../resources appear here with isContractor=true (same shape as the assign response) (WBS-10448). Login contacts auto-created for contractor dispatch are excluded.',
|
|
10
11
|
props: {
|
|
11
12
|
jobId: Property.ShortText({
|
|
12
13
|
displayName: 'Job Id',
|
|
@@ -65,7 +66,8 @@ export const PublicJobStageResourceController_assign = createAction({
|
|
|
65
66
|
name: 'PublicJobStageResourceController_assign',
|
|
66
67
|
auth: workbuddyAuth,
|
|
67
68
|
displayName: 'Assign resource to stage',
|
|
68
|
-
description:
|
|
69
|
+
description:
|
|
70
|
+
'Assign an Employee or Subcontractor by contactId. Employee → resource row. Subcontractor → stage contractor (isContractor=true). Both appear on GET list (WBS-10448). contactId is a person Contact id (use /employees for staff), not a CRM Contact from /contacts (WBS-10445 / WBS-10442).',
|
|
69
71
|
props: {
|
|
70
72
|
jobId: Property.ShortText({
|
|
71
73
|
displayName: 'Job Id',
|
|
@@ -114,7 +116,8 @@ export const PublicJobStageResourceController_get = createAction({
|
|
|
114
116
|
name: 'PublicJobStageResourceController_get',
|
|
115
117
|
auth: workbuddyAuth,
|
|
116
118
|
displayName: 'Get stage resource',
|
|
117
|
-
description:
|
|
119
|
+
description:
|
|
120
|
+
'Get one assignment by id. Employee rows use the resource/contact id; the stage contractor uses the contractor contact id (same id as POST assign when isContractor=true) (WBS-10448).',
|
|
118
121
|
props: {
|
|
119
122
|
jobId: Property.ShortText({
|
|
120
123
|
displayName: 'Job Id',
|
|
@@ -128,7 +131,7 @@ export const PublicJobStageResourceController_get = createAction({
|
|
|
128
131
|
}),
|
|
129
132
|
resourceId: Property.ShortText({
|
|
130
133
|
displayName: 'Resource Id',
|
|
131
|
-
description: 'Resource ID',
|
|
134
|
+
description: 'Resource or contractor contact ID',
|
|
132
135
|
required: true,
|
|
133
136
|
}),
|
|
134
137
|
},
|
|
@@ -48,9 +48,19 @@ export declare const PublicJobStageController_complete: import("@activepieces/pi
|
|
|
48
48
|
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
49
49
|
}>, {
|
|
50
50
|
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
51
|
+
statusId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
51
52
|
completedDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
52
53
|
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
53
54
|
}>;
|
|
55
|
+
export declare const PublicJobStageController_inProgress: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
56
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
57
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
58
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
59
|
+
}>, {
|
|
60
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
61
|
+
statusId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
62
|
+
note: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
63
|
+
}>;
|
|
54
64
|
export declare const PublicJobStageController_finalise: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
55
65
|
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
56
66
|
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["stages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,+BAA+B;;;;;;;;;;;EAkE1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;EAkI1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;EA+B1C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;EA8B5C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;
|
|
1
|
+
{"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["stages.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,+BAA+B;;;;;;;;;;;EAkE1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;EAkI1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;EA+B1C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;EA8B5C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;EAsD5C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;EAgD9C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;EA+C5C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;EAyC1C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;EAgD1C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;EA2D3C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;EA8B3C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PublicJobStageController_reissue = exports.PublicJobStageController_reverse = exports.PublicJobStageController_onHold = exports.PublicJobStageController_cancel = exports.PublicJobStageController_finalise = exports.PublicJobStageController_complete = exports.PublicJobStageController_dispatch = exports.PublicJobStageController_delete = exports.PublicJobStageController_update = exports.PublicJobStageController_create = void 0;
|
|
3
|
+
exports.PublicJobStageController_reissue = exports.PublicJobStageController_reverse = exports.PublicJobStageController_onHold = exports.PublicJobStageController_cancel = exports.PublicJobStageController_finalise = exports.PublicJobStageController_inProgress = exports.PublicJobStageController_complete = exports.PublicJobStageController_dispatch = exports.PublicJobStageController_delete = exports.PublicJobStageController_update = exports.PublicJobStageController_create = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const auth_1 = require("../auth");
|
|
@@ -247,13 +247,18 @@ exports.PublicJobStageController_complete = (0, pieces_framework_1.createAction)
|
|
|
247
247
|
name: 'PublicJobStageController_complete',
|
|
248
248
|
auth: auth_1.workbuddyAuth,
|
|
249
249
|
displayName: 'Complete a stage',
|
|
250
|
-
description: 'Mark a stage as completed. Field work is done but stage may still need finalisation/billing.',
|
|
250
|
+
description: 'Mark a stage as completed. Field work is done but stage may still need finalisation/billing. Optional statusId selects a tenant Completed status from GET /settings/stage-statuses (systemStatus Completed); omit to use the system Completed status (MAI-2101).',
|
|
251
251
|
props: {
|
|
252
252
|
id: pieces_framework_1.Property.ShortText({
|
|
253
253
|
displayName: 'Id',
|
|
254
254
|
description: 'Stage ID',
|
|
255
255
|
required: true,
|
|
256
256
|
}),
|
|
257
|
+
statusId: pieces_framework_1.Property.ShortText({
|
|
258
|
+
displayName: 'Status Id',
|
|
259
|
+
description: 'status ID',
|
|
260
|
+
required: false,
|
|
261
|
+
}),
|
|
257
262
|
completedDate: pieces_framework_1.Property.DateTime({
|
|
258
263
|
displayName: 'Completed Date',
|
|
259
264
|
description: 'Completion date (ISO 8601 datetime)',
|
|
@@ -270,6 +275,7 @@ exports.PublicJobStageController_complete = (0, pieces_framework_1.createAction)
|
|
|
270
275
|
const baseUrl = context.auth.props.baseUrl;
|
|
271
276
|
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/complete`;
|
|
272
277
|
const rawBody = {
|
|
278
|
+
statusId: context.propsValue.statusId,
|
|
273
279
|
completedDate: context.propsValue.completedDate,
|
|
274
280
|
notes: context.propsValue.notes,
|
|
275
281
|
};
|
|
@@ -287,6 +293,50 @@ exports.PublicJobStageController_complete = (0, pieces_framework_1.createAction)
|
|
|
287
293
|
return response.body;
|
|
288
294
|
},
|
|
289
295
|
});
|
|
296
|
+
exports.PublicJobStageController_inProgress = (0, pieces_framework_1.createAction)({
|
|
297
|
+
name: 'PublicJobStageController_inProgress',
|
|
298
|
+
auth: auth_1.workbuddyAuth,
|
|
299
|
+
displayName: 'Mark a stage in progress',
|
|
300
|
+
description: 'Set the stage to an In Progress status. Pass statusId from GET /settings/stage-statuses with systemStatus In Progress (multiple peer statuses may share that systemStatus) (MAI-2101).',
|
|
301
|
+
props: {
|
|
302
|
+
id: pieces_framework_1.Property.ShortText({
|
|
303
|
+
displayName: 'Id',
|
|
304
|
+
description: 'Stage ID',
|
|
305
|
+
required: true,
|
|
306
|
+
}),
|
|
307
|
+
statusId: pieces_framework_1.Property.ShortText({
|
|
308
|
+
displayName: 'Status Id',
|
|
309
|
+
description: 'status ID',
|
|
310
|
+
required: true,
|
|
311
|
+
}),
|
|
312
|
+
note: pieces_framework_1.Property.ShortText({
|
|
313
|
+
displayName: 'Note',
|
|
314
|
+
description: '',
|
|
315
|
+
required: false,
|
|
316
|
+
}),
|
|
317
|
+
},
|
|
318
|
+
async run(context) {
|
|
319
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
320
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
321
|
+
const url = `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/in-progress`;
|
|
322
|
+
const rawBody = {
|
|
323
|
+
statusId: context.propsValue.statusId,
|
|
324
|
+
note: context.propsValue.note,
|
|
325
|
+
};
|
|
326
|
+
const body = rawBody;
|
|
327
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
328
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
329
|
+
url: `${baseUrl}/api/v2/public/stages/${context.propsValue.id}/in-progress`,
|
|
330
|
+
headers: {
|
|
331
|
+
Authorization: `Bearer ${token}`,
|
|
332
|
+
'Content-Type': 'application/json',
|
|
333
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
334
|
+
},
|
|
335
|
+
body: body,
|
|
336
|
+
});
|
|
337
|
+
return response.body;
|
|
338
|
+
},
|
|
339
|
+
});
|
|
290
340
|
exports.PublicJobStageController_finalise = (0, pieces_framework_1.createAction)({
|
|
291
341
|
name: 'PublicJobStageController_finalise',
|
|
292
342
|
auth: auth_1.workbuddyAuth,
|