@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
|
@@ -8,6 +8,11 @@ export const PublicCrmSupplierController_list = createAction({
|
|
|
8
8
|
displayName: 'List suppliers',
|
|
9
9
|
description: '',
|
|
10
10
|
props: {
|
|
11
|
+
search: Property.ShortText({
|
|
12
|
+
displayName: 'Search',
|
|
13
|
+
description: 'Search by name, phone, email or legal name',
|
|
14
|
+
required: false,
|
|
15
|
+
}),
|
|
11
16
|
cursor: Property.ShortText({
|
|
12
17
|
displayName: 'Cursor',
|
|
13
18
|
description: '',
|
|
@@ -26,6 +31,12 @@ export const PublicCrmSupplierController_list = createAction({
|
|
|
26
31
|
const url = `${baseUrl}/suppliers`;
|
|
27
32
|
|
|
28
33
|
const queryParams = new URLSearchParams();
|
|
34
|
+
if (
|
|
35
|
+
context.propsValue.search !== undefined &&
|
|
36
|
+
context.propsValue.search !== null &&
|
|
37
|
+
context.propsValue.search !== ''
|
|
38
|
+
)
|
|
39
|
+
queryParams.append('search', String(context.propsValue.search));
|
|
29
40
|
if (
|
|
30
41
|
context.propsValue.cursor !== undefined &&
|
|
31
42
|
context.propsValue.cursor !== null &&
|
|
@@ -51,6 +62,110 @@ export const PublicCrmSupplierController_list = createAction({
|
|
|
51
62
|
},
|
|
52
63
|
});
|
|
53
64
|
|
|
65
|
+
export const PublicCrmSupplierController_create = createAction({
|
|
66
|
+
name: 'PublicCrmSupplierController_create',
|
|
67
|
+
auth: workbuddyAuth,
|
|
68
|
+
displayName: 'Create supplier',
|
|
69
|
+
description: '',
|
|
70
|
+
props: {
|
|
71
|
+
name: Property.ShortText({
|
|
72
|
+
displayName: 'Name',
|
|
73
|
+
description: 'Display name',
|
|
74
|
+
required: true,
|
|
75
|
+
}),
|
|
76
|
+
address: Property.Json({
|
|
77
|
+
displayName: 'Address',
|
|
78
|
+
description: '',
|
|
79
|
+
required: true,
|
|
80
|
+
}),
|
|
81
|
+
contact: Property.Json({
|
|
82
|
+
displayName: 'Contact',
|
|
83
|
+
description: 'Inline contact object — alternative to contactId',
|
|
84
|
+
required: true,
|
|
85
|
+
}),
|
|
86
|
+
legalName: Property.ShortText({
|
|
87
|
+
displayName: 'Legal Name',
|
|
88
|
+
description: '',
|
|
89
|
+
required: false,
|
|
90
|
+
}),
|
|
91
|
+
phone: Property.ShortText({
|
|
92
|
+
displayName: 'Phone',
|
|
93
|
+
description: 'Phone number',
|
|
94
|
+
required: false,
|
|
95
|
+
}),
|
|
96
|
+
email: Property.ShortText({
|
|
97
|
+
displayName: 'Email',
|
|
98
|
+
description: 'Email address',
|
|
99
|
+
required: false,
|
|
100
|
+
}),
|
|
101
|
+
website: Property.ShortText({
|
|
102
|
+
displayName: 'Website',
|
|
103
|
+
description: '',
|
|
104
|
+
required: false,
|
|
105
|
+
}),
|
|
106
|
+
integrationId: Property.ShortText({
|
|
107
|
+
displayName: 'Integration Id',
|
|
108
|
+
description: 'integration ID',
|
|
109
|
+
required: false,
|
|
110
|
+
}),
|
|
111
|
+
notes: Property.LongText({
|
|
112
|
+
displayName: 'Notes',
|
|
113
|
+
description: 'Additional notes or comments',
|
|
114
|
+
required: false,
|
|
115
|
+
}),
|
|
116
|
+
customFields: Property.Json({
|
|
117
|
+
displayName: 'Custom Fields',
|
|
118
|
+
description: 'Custom fields as key-value pairs — validated against tenant field definitions',
|
|
119
|
+
required: false,
|
|
120
|
+
}),
|
|
121
|
+
socialNetwork: Property.Json({
|
|
122
|
+
displayName: 'Social Network',
|
|
123
|
+
description: '',
|
|
124
|
+
required: false,
|
|
125
|
+
}),
|
|
126
|
+
taxId: Property.ShortText({
|
|
127
|
+
displayName: 'Tax Id',
|
|
128
|
+
description: 'tax ID',
|
|
129
|
+
required: false,
|
|
130
|
+
}),
|
|
131
|
+
},
|
|
132
|
+
async run(context) {
|
|
133
|
+
const token = await getAccessToken(context.auth);
|
|
134
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
135
|
+
|
|
136
|
+
const url = `${baseUrl}/api/v2/public/suppliers`;
|
|
137
|
+
|
|
138
|
+
const rawBody: Record<string, unknown> = {
|
|
139
|
+
name: context.propsValue.name,
|
|
140
|
+
legalName: context.propsValue.legalName,
|
|
141
|
+
phone: context.propsValue.phone,
|
|
142
|
+
email: context.propsValue.email,
|
|
143
|
+
website: context.propsValue.website,
|
|
144
|
+
integrationId: context.propsValue.integrationId,
|
|
145
|
+
address: context.propsValue.address,
|
|
146
|
+
contact: context.propsValue.contact,
|
|
147
|
+
notes: context.propsValue.notes,
|
|
148
|
+
customFields: context.propsValue.customFields,
|
|
149
|
+
socialNetwork: context.propsValue.socialNetwork,
|
|
150
|
+
taxId: context.propsValue.taxId,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const body = rawBody;
|
|
154
|
+
const response = await httpClient.sendRequest({
|
|
155
|
+
method: HttpMethod.POST,
|
|
156
|
+
url: `${baseUrl}/api/v2/public/suppliers`,
|
|
157
|
+
headers: {
|
|
158
|
+
Authorization: `Bearer ${token}`,
|
|
159
|
+
'Content-Type': 'application/json',
|
|
160
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
161
|
+
},
|
|
162
|
+
body: body,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
return response.body;
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
|
|
54
169
|
export const PublicCrmSupplierController_getById = createAction({
|
|
55
170
|
name: 'PublicCrmSupplierController_getById',
|
|
56
171
|
auth: workbuddyAuth,
|
|
@@ -59,7 +174,7 @@ export const PublicCrmSupplierController_getById = createAction({
|
|
|
59
174
|
props: {
|
|
60
175
|
id: Property.ShortText({
|
|
61
176
|
displayName: 'Id',
|
|
62
|
-
description: 'Supplier ID',
|
|
177
|
+
description: 'Supplier ID or integration ID',
|
|
63
178
|
required: true,
|
|
64
179
|
}),
|
|
65
180
|
},
|
|
@@ -82,3 +197,263 @@ export const PublicCrmSupplierController_getById = createAction({
|
|
|
82
197
|
return response.body;
|
|
83
198
|
},
|
|
84
199
|
});
|
|
200
|
+
|
|
201
|
+
export const PublicCrmSupplierController_update = createAction({
|
|
202
|
+
name: 'PublicCrmSupplierController_update',
|
|
203
|
+
auth: workbuddyAuth,
|
|
204
|
+
displayName: 'Update supplier',
|
|
205
|
+
description: '',
|
|
206
|
+
props: {
|
|
207
|
+
id: Property.ShortText({
|
|
208
|
+
displayName: 'Id',
|
|
209
|
+
description: 'Supplier ID or integration ID',
|
|
210
|
+
required: true,
|
|
211
|
+
}),
|
|
212
|
+
name: Property.ShortText({
|
|
213
|
+
displayName: 'Name',
|
|
214
|
+
description: 'Display name',
|
|
215
|
+
required: false,
|
|
216
|
+
}),
|
|
217
|
+
legalName: Property.ShortText({
|
|
218
|
+
displayName: 'Legal Name',
|
|
219
|
+
description: '',
|
|
220
|
+
required: false,
|
|
221
|
+
}),
|
|
222
|
+
phone: Property.ShortText({
|
|
223
|
+
displayName: 'Phone',
|
|
224
|
+
description: 'Phone number',
|
|
225
|
+
required: false,
|
|
226
|
+
}),
|
|
227
|
+
email: Property.ShortText({
|
|
228
|
+
displayName: 'Email',
|
|
229
|
+
description: 'Email address',
|
|
230
|
+
required: false,
|
|
231
|
+
}),
|
|
232
|
+
website: Property.ShortText({
|
|
233
|
+
displayName: 'Website',
|
|
234
|
+
description: '',
|
|
235
|
+
required: false,
|
|
236
|
+
}),
|
|
237
|
+
integrationId: Property.ShortText({
|
|
238
|
+
displayName: 'Integration Id',
|
|
239
|
+
description: 'integration ID',
|
|
240
|
+
required: false,
|
|
241
|
+
}),
|
|
242
|
+
address: Property.Json({
|
|
243
|
+
displayName: 'Address',
|
|
244
|
+
description: '',
|
|
245
|
+
required: false,
|
|
246
|
+
}),
|
|
247
|
+
primarySite: Property.Json({
|
|
248
|
+
displayName: 'Primary Site',
|
|
249
|
+
description: '',
|
|
250
|
+
required: false,
|
|
251
|
+
}),
|
|
252
|
+
owner: Property.Json({
|
|
253
|
+
displayName: 'Owner',
|
|
254
|
+
description: '',
|
|
255
|
+
required: false,
|
|
256
|
+
}),
|
|
257
|
+
labels: Property.Json({
|
|
258
|
+
displayName: 'Labels',
|
|
259
|
+
description: '',
|
|
260
|
+
required: false,
|
|
261
|
+
defaultValue: [],
|
|
262
|
+
}),
|
|
263
|
+
notes: Property.LongText({
|
|
264
|
+
displayName: 'Notes',
|
|
265
|
+
description: 'Additional notes or comments',
|
|
266
|
+
required: false,
|
|
267
|
+
}),
|
|
268
|
+
customFields: Property.Json({
|
|
269
|
+
displayName: 'Custom Fields',
|
|
270
|
+
description: 'Custom fields as key-value pairs — validated against tenant field definitions',
|
|
271
|
+
required: false,
|
|
272
|
+
}),
|
|
273
|
+
socialNetwork: Property.Json({
|
|
274
|
+
displayName: 'Social Network',
|
|
275
|
+
description: '',
|
|
276
|
+
required: false,
|
|
277
|
+
}),
|
|
278
|
+
zones: Property.Json({
|
|
279
|
+
displayName: 'Zones',
|
|
280
|
+
description: '',
|
|
281
|
+
required: false,
|
|
282
|
+
defaultValue: [],
|
|
283
|
+
}),
|
|
284
|
+
workCategories: Property.Json({
|
|
285
|
+
displayName: 'Work Categories',
|
|
286
|
+
description: '',
|
|
287
|
+
required: false,
|
|
288
|
+
defaultValue: [],
|
|
289
|
+
}),
|
|
290
|
+
taxId: Property.ShortText({
|
|
291
|
+
displayName: 'Tax Id',
|
|
292
|
+
description: 'tax ID',
|
|
293
|
+
required: false,
|
|
294
|
+
}),
|
|
295
|
+
accounting: Property.Json({
|
|
296
|
+
displayName: 'Accounting',
|
|
297
|
+
description: '',
|
|
298
|
+
required: false,
|
|
299
|
+
}),
|
|
300
|
+
financeTags: Property.Json({
|
|
301
|
+
displayName: 'Finance Tags',
|
|
302
|
+
description: '',
|
|
303
|
+
required: false,
|
|
304
|
+
defaultValue: [],
|
|
305
|
+
}),
|
|
306
|
+
invoices: Property.Json({
|
|
307
|
+
displayName: 'Invoices',
|
|
308
|
+
description: '',
|
|
309
|
+
required: false,
|
|
310
|
+
}),
|
|
311
|
+
billTo: Property.Json({
|
|
312
|
+
displayName: 'Bill To',
|
|
313
|
+
description: '',
|
|
314
|
+
required: false,
|
|
315
|
+
}),
|
|
316
|
+
credit: Property.Json({
|
|
317
|
+
displayName: 'Credit',
|
|
318
|
+
description: '',
|
|
319
|
+
required: false,
|
|
320
|
+
}),
|
|
321
|
+
billTheme: Property.Json({
|
|
322
|
+
displayName: 'Bill Theme',
|
|
323
|
+
description: '',
|
|
324
|
+
required: false,
|
|
325
|
+
}),
|
|
326
|
+
},
|
|
327
|
+
async run(context) {
|
|
328
|
+
const token = await getAccessToken(context.auth);
|
|
329
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
330
|
+
|
|
331
|
+
const url = `${baseUrl}/api/v2/public/suppliers/${context.propsValue.id}`;
|
|
332
|
+
|
|
333
|
+
// Build body with only defined values (for partial updates)
|
|
334
|
+
const rawBody: Record<string, unknown> = {
|
|
335
|
+
name: context.propsValue.name,
|
|
336
|
+
legalName: context.propsValue.legalName,
|
|
337
|
+
phone: context.propsValue.phone,
|
|
338
|
+
email: context.propsValue.email,
|
|
339
|
+
website: context.propsValue.website,
|
|
340
|
+
integrationId: context.propsValue.integrationId,
|
|
341
|
+
address: context.propsValue.address,
|
|
342
|
+
primarySite: context.propsValue.primarySite,
|
|
343
|
+
owner: context.propsValue.owner,
|
|
344
|
+
labels: context.propsValue.labels,
|
|
345
|
+
notes: context.propsValue.notes,
|
|
346
|
+
customFields: context.propsValue.customFields,
|
|
347
|
+
socialNetwork: context.propsValue.socialNetwork,
|
|
348
|
+
zones: context.propsValue.zones,
|
|
349
|
+
workCategories: context.propsValue.workCategories,
|
|
350
|
+
taxId: context.propsValue.taxId,
|
|
351
|
+
accounting: context.propsValue.accounting,
|
|
352
|
+
financeTags: context.propsValue.financeTags,
|
|
353
|
+
invoices: context.propsValue.invoices,
|
|
354
|
+
billTo: context.propsValue.billTo,
|
|
355
|
+
credit: context.propsValue.credit,
|
|
356
|
+
billTheme: context.propsValue.billTheme,
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
const body = Object.fromEntries(
|
|
360
|
+
Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== '')
|
|
361
|
+
);
|
|
362
|
+
const response = await httpClient.sendRequest({
|
|
363
|
+
method: HttpMethod.PATCH,
|
|
364
|
+
url: `${baseUrl}/api/v2/public/suppliers/${context.propsValue.id}`,
|
|
365
|
+
headers: {
|
|
366
|
+
Authorization: `Bearer ${token}`,
|
|
367
|
+
'Content-Type': 'application/json',
|
|
368
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
369
|
+
},
|
|
370
|
+
body: body,
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
return response.body;
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
export const PublicCrmSupplierController_delete = createAction({
|
|
378
|
+
name: 'PublicCrmSupplierController_delete',
|
|
379
|
+
auth: workbuddyAuth,
|
|
380
|
+
displayName: 'Delete supplier',
|
|
381
|
+
description: '',
|
|
382
|
+
props: {
|
|
383
|
+
id: Property.ShortText({
|
|
384
|
+
displayName: 'Id',
|
|
385
|
+
description: 'Supplier ID or integration ID',
|
|
386
|
+
required: true,
|
|
387
|
+
}),
|
|
388
|
+
},
|
|
389
|
+
async run(context) {
|
|
390
|
+
const token = await getAccessToken(context.auth);
|
|
391
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
392
|
+
|
|
393
|
+
const url = `${baseUrl}/api/v2/public/suppliers/${context.propsValue.id}`;
|
|
394
|
+
|
|
395
|
+
const response = await httpClient.sendRequest({
|
|
396
|
+
method: HttpMethod.DELETE,
|
|
397
|
+
url: `${baseUrl}/api/v2/public/suppliers/${context.propsValue.id}`,
|
|
398
|
+
headers: {
|
|
399
|
+
Authorization: `Bearer ${token}`,
|
|
400
|
+
'Content-Type': 'application/json',
|
|
401
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
return response.body;
|
|
406
|
+
},
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
export const PublicCrmSupplierController_updateStatus = createAction({
|
|
410
|
+
name: 'PublicCrmSupplierController_updateStatus',
|
|
411
|
+
auth: workbuddyAuth,
|
|
412
|
+
displayName: 'Update supplier status',
|
|
413
|
+
description: '',
|
|
414
|
+
props: {
|
|
415
|
+
id: Property.ShortText({
|
|
416
|
+
displayName: 'Id',
|
|
417
|
+
description: 'Supplier ID or integration ID',
|
|
418
|
+
required: true,
|
|
419
|
+
}),
|
|
420
|
+
statusId: Property.ShortText({
|
|
421
|
+
displayName: 'Status Id',
|
|
422
|
+
description: 'status ID',
|
|
423
|
+
required: true,
|
|
424
|
+
}),
|
|
425
|
+
note: Property.ShortText({
|
|
426
|
+
displayName: 'Note',
|
|
427
|
+
description: '',
|
|
428
|
+
required: false,
|
|
429
|
+
}),
|
|
430
|
+
},
|
|
431
|
+
async run(context) {
|
|
432
|
+
const token = await getAccessToken(context.auth);
|
|
433
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
434
|
+
|
|
435
|
+
const url = `${baseUrl}/api/v2/public/suppliers/${context.propsValue.id}/status`;
|
|
436
|
+
|
|
437
|
+
// Build body with only defined values (for partial updates)
|
|
438
|
+
const rawBody: Record<string, unknown> = {
|
|
439
|
+
statusId: context.propsValue.statusId,
|
|
440
|
+
note: context.propsValue.note,
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
const body = Object.fromEntries(
|
|
444
|
+
Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== '')
|
|
445
|
+
);
|
|
446
|
+
const response = await httpClient.sendRequest({
|
|
447
|
+
method: HttpMethod.PATCH,
|
|
448
|
+
url: `${baseUrl}/api/v2/public/suppliers/${context.propsValue.id}/status`,
|
|
449
|
+
headers: {
|
|
450
|
+
Authorization: `Bearer ${token}`,
|
|
451
|
+
'Content-Type': 'application/json',
|
|
452
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
453
|
+
},
|
|
454
|
+
body: body,
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
return response.body;
|
|
458
|
+
},
|
|
459
|
+
});
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export * from './jobs';
|
|
2
|
+
export * from './items';
|
|
3
|
+
export * from './pending-items';
|
|
4
|
+
export * from './stages-pending-items';
|
|
2
5
|
export * from './stages';
|
|
3
6
|
export * from './stages-resources';
|
|
4
|
-
export * from './settings';
|
|
7
|
+
export * from './settings-reference-data';
|
|
8
|
+
export * from './settings-templates';
|
|
9
|
+
export * from './settings-items';
|
|
10
|
+
export * from './settings-custom-fields';
|
|
5
11
|
export * from './attachments';
|
|
6
12
|
export * from './jobs-activities';
|
|
7
13
|
export * from './stages-activities';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
package/src/lib/actions/index.js
CHANGED
|
@@ -15,9 +15,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./jobs"), exports);
|
|
18
|
+
__exportStar(require("./items"), exports);
|
|
19
|
+
__exportStar(require("./pending-items"), exports);
|
|
20
|
+
__exportStar(require("./stages-pending-items"), exports);
|
|
18
21
|
__exportStar(require("./stages"), exports);
|
|
19
22
|
__exportStar(require("./stages-resources"), exports);
|
|
20
|
-
__exportStar(require("./settings"), exports);
|
|
23
|
+
__exportStar(require("./settings-reference-data"), exports);
|
|
24
|
+
__exportStar(require("./settings-templates"), exports);
|
|
25
|
+
__exportStar(require("./settings-items"), exports);
|
|
26
|
+
__exportStar(require("./settings-custom-fields"), exports);
|
|
21
27
|
__exportStar(require("./attachments"), exports);
|
|
22
28
|
__exportStar(require("./jobs-activities"), exports);
|
|
23
29
|
__exportStar(require("./stages-activities"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,kDAAgC;AAChC,yDAAuC;AACvC,2CAAyB;AACzB,qDAAmC;AACnC,4DAA0C;AAC1C,uDAAqC;AACrC,mDAAiC;AACjC,2DAAyC;AACzC,gDAA8B;AAC9B,oDAAkC;AAClC,sDAAoC;AACpC,+CAA6B;AAC7B,iDAA+B;AAC/B,+CAA6B;AAC7B,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,kDAAgC;AAChC,kDAAgC;AAChC,uDAAqC;AACrC,iDAA+B;AAC/B,gDAA8B;AAC9B,8CAA4B;AAC5B,gDAA8B;AAC9B,gDAA8B;AAC9B,2CAAyB;AACzB,0CAAwB;AACxB,wCAAsB"}
|
package/src/lib/actions/index.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export * from './jobs';
|
|
2
|
+
export * from './items';
|
|
3
|
+
export * from './pending-items';
|
|
4
|
+
export * from './stages-pending-items';
|
|
2
5
|
export * from './stages';
|
|
3
6
|
export * from './stages-resources';
|
|
4
|
-
export * from './settings';
|
|
7
|
+
export * from './settings-reference-data';
|
|
8
|
+
export * from './settings-templates';
|
|
9
|
+
export * from './settings-items';
|
|
10
|
+
export * from './settings-custom-fields';
|
|
5
11
|
export * from './attachments';
|
|
6
12
|
export * from './jobs-activities';
|
|
7
13
|
export * from './stages-activities';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PublicApiJobLineItemController_list: 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
|
+
integrationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["items.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mCAAmC;;;;;;EAwC9C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicApiJobLineItemController_list = 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.PublicApiJobLineItemController_list = (0, pieces_framework_1.createAction)({
|
|
8
|
+
name: 'PublicApiJobLineItemController_list',
|
|
9
|
+
auth: auth_1.workbuddyAuth,
|
|
10
|
+
displayName: 'Find job line items',
|
|
11
|
+
description: 'Find a job line item by external integration ID.',
|
|
12
|
+
props: {
|
|
13
|
+
integrationId: pieces_framework_1.Property.ShortText({
|
|
14
|
+
displayName: 'Integration Id',
|
|
15
|
+
description: 'External integration ID for the line item',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
async run(context) {
|
|
20
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
21
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
22
|
+
const url = `${baseUrl}/items`;
|
|
23
|
+
const queryParams = new URLSearchParams();
|
|
24
|
+
if (context.propsValue.integrationId !== undefined &&
|
|
25
|
+
context.propsValue.integrationId !== null &&
|
|
26
|
+
context.propsValue.integrationId !== '')
|
|
27
|
+
queryParams.append('integrationId', String(context.propsValue.integrationId));
|
|
28
|
+
const queryString = queryParams.toString();
|
|
29
|
+
const urlWithQuery = queryString ? `${url}?${queryString}` : url;
|
|
30
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
31
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
32
|
+
url: urlWithQuery,
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: `Bearer ${token}`,
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
return response.body;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.js","sourceRoot":"","sources":["items.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAwD;AAE3C,QAAA,mCAAmC,GAAG,IAAA,+BAAY,EAAC;IAC9D,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE,oBAAa;IACnB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,kDAAkD;IAC/D,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;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,QAAQ,CAAC;QAE/B,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAC1C,IACE,OAAO,CAAC,UAAU,CAAC,aAAa,KAAK,SAAS;YAC9C,OAAO,CAAC,UAAU,CAAC,aAAa,KAAK,IAAI;YACzC,OAAO,CAAC,UAAU,CAAC,aAAa,KAAK,EAAE;YAEvC,WAAW,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;QAChF,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QAEjE,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,YAAY;YACjB,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,45 @@
|
|
|
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 PublicApiJobLineItemController_list = createAction({
|
|
6
|
+
name: 'PublicApiJobLineItemController_list',
|
|
7
|
+
auth: workbuddyAuth,
|
|
8
|
+
displayName: 'Find job line items',
|
|
9
|
+
description: 'Find a job line item by external integration ID.',
|
|
10
|
+
props: {
|
|
11
|
+
integrationId: Property.ShortText({
|
|
12
|
+
displayName: 'Integration Id',
|
|
13
|
+
description: 'External integration ID for the line item',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
},
|
|
17
|
+
async run(context) {
|
|
18
|
+
const token = await getAccessToken(context.auth);
|
|
19
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
20
|
+
|
|
21
|
+
const url = `${baseUrl}/items`;
|
|
22
|
+
|
|
23
|
+
const queryParams = new URLSearchParams();
|
|
24
|
+
if (
|
|
25
|
+
context.propsValue.integrationId !== undefined &&
|
|
26
|
+
context.propsValue.integrationId !== null &&
|
|
27
|
+
context.propsValue.integrationId !== ''
|
|
28
|
+
)
|
|
29
|
+
queryParams.append('integrationId', String(context.propsValue.integrationId));
|
|
30
|
+
const queryString = queryParams.toString();
|
|
31
|
+
const urlWithQuery = queryString ? `${url}?${queryString}` : url;
|
|
32
|
+
|
|
33
|
+
const response = await httpClient.sendRequest({
|
|
34
|
+
method: HttpMethod.GET,
|
|
35
|
+
url: urlWithQuery,
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${token}`,
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return response.body;
|
|
44
|
+
},
|
|
45
|
+
});
|
|
@@ -28,6 +28,7 @@ export declare const PublicJobActivitiesController_createNote: import("@activepi
|
|
|
28
28
|
}>, {
|
|
29
29
|
jobId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
30
30
|
body: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
31
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
31
32
|
labelIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
32
33
|
attachmentIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
33
34
|
sharing: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
@@ -56,7 +57,7 @@ export declare const PublicJobActivitiesController_createSms: import("@activepie
|
|
|
56
57
|
jobId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
57
58
|
templateId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
58
59
|
body: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
59
|
-
to: import("@activepieces/pieces-framework").
|
|
60
|
+
to: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
60
61
|
labelIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
61
62
|
sharing: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
62
63
|
}>;
|
|
@@ -67,9 +68,9 @@ export declare const PublicJobActivitiesController_createPhone: import("@activep
|
|
|
67
68
|
}>, {
|
|
68
69
|
jobId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
69
70
|
direction: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
71
|
+
callDate: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
70
72
|
outcome: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
71
73
|
duration: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
72
|
-
callDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
73
74
|
body: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
74
75
|
labelIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
75
76
|
sharing: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
@@ -91,7 +92,7 @@ export declare const PublicJobActivitiesController_createThread: import("@active
|
|
|
91
92
|
}>, {
|
|
92
93
|
jobId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
93
94
|
body: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
94
|
-
|
|
95
|
+
threadType: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
95
96
|
sharing: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
96
97
|
}>;
|
|
97
98
|
//# sourceMappingURL=jobs-activities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs-activities.d.ts","sourceRoot":"","sources":["jobs-activities.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kCAAkC;;;;;;EA8B7C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;EAmChD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;EAmC/C,CAAC;AAEH,eAAO,MAAM,wCAAwC
|
|
1
|
+
{"version":3,"file":"jobs-activities.d.ts","sourceRoot":"","sources":["jobs-activities.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kCAAkC;;;;;;EA8B7C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;EAmChD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;EAmC/C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;EAiEnD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;EAyFpD,CAAC;AAEH,eAAO,MAAM,uCAAuC;;;;;;;;;;;EAkElD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;EA8FpD,CAAC;AAEH,eAAO,MAAM,+CAA+C;;;;;;;;;EAqD1D,CAAC;AAEH,eAAO,MAAM,0CAA0C;;;;;;;;;EAqDrD,CAAC"}
|