servicem8 0.3.3 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.devcontainer/README.md +30 -0
  2. package/bin/mcp-server.js +5 -5
  3. package/bin/mcp-server.js.map +4 -4
  4. package/dist/commonjs/lib/config.d.ts +2 -2
  5. package/dist/commonjs/lib/config.js +2 -2
  6. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  7. package/dist/commonjs/mcp-server/server.js +1 -1
  8. package/dist/esm/lib/config.d.ts +2 -2
  9. package/dist/esm/lib/config.js +2 -2
  10. package/dist/esm/mcp-server/mcp-server.js +1 -1
  11. package/dist/esm/mcp-server/server.js +1 -1
  12. package/docs/sdks/allocationwindows/README.md +433 -0
  13. package/docs/sdks/assets/README.md +364 -0
  14. package/docs/sdks/assettypefields/README.md +456 -0
  15. package/docs/sdks/assettypes/README.md +448 -0
  16. package/docs/sdks/attachments/README.md +441 -0
  17. package/docs/sdks/badges/README.md +460 -0
  18. package/docs/sdks/bundles/README.md +437 -0
  19. package/docs/sdks/categories/README.md +462 -0
  20. package/docs/sdks/clients/README.md +466 -0
  21. package/docs/sdks/companycontacts/README.md +462 -0
  22. package/docs/sdks/emailtemplates/README.md +437 -0
  23. package/docs/sdks/feedback/README.md +437 -0
  24. package/docs/sdks/formfields/README.md +437 -0
  25. package/docs/sdks/formresponses/README.md +461 -0
  26. package/docs/sdks/forms/README.md +437 -0
  27. package/docs/sdks/jobactivities/README.md +490 -0
  28. package/docs/sdks/joballocations/README.md +492 -0
  29. package/docs/sdks/jobchecklists/README.md +477 -0
  30. package/docs/sdks/jobcontacts/README.md +462 -0
  31. package/docs/sdks/jobmaterialbundles/README.md +441 -0
  32. package/docs/sdks/jobmaterials/README.md +478 -0
  33. package/docs/sdks/jobpayments/README.md +445 -0
  34. package/docs/sdks/jobqueues/README.md +458 -0
  35. package/docs/sdks/jobs/README.md +546 -0
  36. package/docs/sdks/knowledgearticles/README.md +452 -0
  37. package/docs/sdks/locations/README.md +462 -0
  38. package/docs/sdks/materials/README.md +466 -0
  39. package/docs/sdks/notes/README.md +445 -0
  40. package/docs/sdks/securityroles/README.md +437 -0
  41. package/docs/sdks/servicem8/README.md +22 -0
  42. package/docs/sdks/smstemplates/README.md +437 -0
  43. package/docs/sdks/staffmembers/README.md +494 -0
  44. package/docs/sdks/staffmessages/README.md +457 -0
  45. package/docs/sdks/tasks/README.md +490 -0
  46. package/docs/sdks/taxrates/README.md +437 -0
  47. package/docs/sdks/vendors/README.md +278 -0
  48. package/jsr.json +1 -1
  49. package/package.json +1 -1
  50. package/src/lib/config.ts +2 -2
  51. package/src/mcp-server/mcp-server.ts +1 -1
  52. package/src/mcp-server/server.ts +1 -1
  53. package/api_fixed.json +0 -14096
@@ -0,0 +1,546 @@
1
+ # Jobs
2
+ (*jobs*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Jobs
7
+
8
+ ### Available Operations
9
+
10
+ * [listJobs](#listjobs) - List all Jobs
11
+ * [createJobs](#createjobs) - Create a new Job
12
+ * [getJobs](#getjobs) - Retrieve a Job
13
+ * [updateJobs](#updatejobs) - Update a Job
14
+ * [deleteJobs](#deletejobs) - Delete a Job
15
+
16
+ ## listJobs
17
+
18
+
19
+
20
+ #### Filtering
21
+ This endpoint supports result filtering. For more information on how to filter this request, [go here](/docs/filtering).
22
+
23
+
24
+ #### OAuth Scope
25
+ This endpoint requires the following OAuth scope **read_jobs**.
26
+
27
+
28
+
29
+ ### Example Usage
30
+
31
+ ```typescript
32
+ import { ServiceM8 } from "servicem8";
33
+
34
+ const serviceM8 = new ServiceM8({
35
+ security: {
36
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
37
+ },
38
+ });
39
+
40
+ async function run() {
41
+ const result = await serviceM8.jobs.listJobs();
42
+
43
+ // Handle the result
44
+ console.log(result);
45
+ }
46
+
47
+ run();
48
+ ```
49
+
50
+ ### Standalone function
51
+
52
+ The standalone function version of this method:
53
+
54
+ ```typescript
55
+ import { ServiceM8Core } from "servicem8/core.js";
56
+ import { jobsListJobs } from "servicem8/funcs/jobsListJobs.js";
57
+
58
+ // Use `ServiceM8Core` for best tree-shaking performance.
59
+ // You can create one instance of it to use across an application.
60
+ const serviceM8 = new ServiceM8Core({
61
+ security: {
62
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
63
+ },
64
+ });
65
+
66
+ async function run() {
67
+ const res = await jobsListJobs(serviceM8);
68
+
69
+ if (!res.ok) {
70
+ throw res.error;
71
+ }
72
+
73
+ const { value: result } = res;
74
+
75
+ // Handle the result
76
+ console.log(result);
77
+ }
78
+
79
+ run();
80
+ ```
81
+
82
+ ### Parameters
83
+
84
+ | Parameter | Type | Required | Description |
85
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
86
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
87
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
88
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
89
+
90
+ ### Response
91
+
92
+ **Promise\<[operations.ListJobsResponse](../../models/operations/listjobsresponse.md)\>**
93
+
94
+ ### Errors
95
+
96
+ | Error Type | Status Code | Content Type |
97
+ | ---------------- | ---------------- | ---------------- |
98
+ | errors.ErrorT | 400 | application/json |
99
+ | errors.APIError | 4XX, 5XX | \*/\* |
100
+
101
+ ## createJobs
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **create_jobs**.
107
+
108
+
109
+
110
+ #### Record UUID
111
+ UUID is optional for record creation. If no UUID is supplied, a UUID will be automatically generated for the new record and returned in the response header as x-record-uuid.
112
+
113
+
114
+
115
+ ### Example Usage
116
+
117
+ ```typescript
118
+ import { ServiceM8 } from "servicem8";
119
+
120
+ const serviceM8 = new ServiceM8({
121
+ security: {
122
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
123
+ },
124
+ });
125
+
126
+ async function run() {
127
+ const result = await serviceM8.jobs.createJobs({
128
+ uuid: "123e4567-9443-40f8-a097-22b4d1d047fb",
129
+ createdByStaffUuid: "123e4567-a308-44ce-a0e1-22b4d0829b3b",
130
+ date: "YYYY-MM-DD",
131
+ companyUuid: "123e4567-db1c-45f1-b8d3-22b4d70ec70b",
132
+ status: "<value>",
133
+ paymentDate: "YYYY-MM-DD HH:MM:SS",
134
+ paymentActionedByUuid: "123e4567-79d7-4031-8216-22b4d90caa2b",
135
+ categoryUuid: "123e4567-1e98-4f7e-b691-22b4d501e20b",
136
+ invoiceSentStamp: "YYYY-MM-DD HH:MM:SS",
137
+ readyToInvoiceStamp: "YYYY-MM-DD HH:MM:SS",
138
+ paymentProcessedStamp: "YYYY-MM-DD HH:MM:SS",
139
+ queueUuid: "123e4567-4eca-4c40-ae6d-22b4d3576c7b",
140
+ queueExpiryDate: "YYYY-MM-DD HH:MM:SS",
141
+ queueAssignedStaffUuid: "123e4567-b6b5-4aee-9f2e-22b4d13f676b",
142
+ paymentReceivedStamp: "YYYY-MM-DD HH:MM:SS",
143
+ quoteDate: "YYYY-MM-DD HH:MM:SS",
144
+ quoteSentStamp: "YYYY-MM-DD HH:MM:SS",
145
+ workOrderDate: "YYYY-MM-DD HH:MM:SS",
146
+ completionDate: "YYYY-MM-DD HH:MM:SS",
147
+ completionActionedByUuid: "123e4567-ced8-4c56-90ff-22b4deca2cdb",
148
+ unsuccessfulDate: "YYYY-MM-DD HH:MM:SS",
149
+ jobIsScheduledUntilStamp: "YYYY-MM-DD HH:MM:SS",
150
+ activeNetworkRequestUuid: "123e4567-bf1f-4806-b2ac-22b4d33ee99b",
151
+ });
152
+
153
+ // Handle the result
154
+ console.log(result);
155
+ }
156
+
157
+ run();
158
+ ```
159
+
160
+ ### Standalone function
161
+
162
+ The standalone function version of this method:
163
+
164
+ ```typescript
165
+ import { ServiceM8Core } from "servicem8/core.js";
166
+ import { jobsCreateJobs } from "servicem8/funcs/jobsCreateJobs.js";
167
+
168
+ // Use `ServiceM8Core` for best tree-shaking performance.
169
+ // You can create one instance of it to use across an application.
170
+ const serviceM8 = new ServiceM8Core({
171
+ security: {
172
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
173
+ },
174
+ });
175
+
176
+ async function run() {
177
+ const res = await jobsCreateJobs(serviceM8, {
178
+ uuid: "123e4567-9443-40f8-a097-22b4d1d047fb",
179
+ createdByStaffUuid: "123e4567-a308-44ce-a0e1-22b4d0829b3b",
180
+ date: "YYYY-MM-DD",
181
+ companyUuid: "123e4567-db1c-45f1-b8d3-22b4d70ec70b",
182
+ status: "<value>",
183
+ paymentDate: "YYYY-MM-DD HH:MM:SS",
184
+ paymentActionedByUuid: "123e4567-79d7-4031-8216-22b4d90caa2b",
185
+ categoryUuid: "123e4567-1e98-4f7e-b691-22b4d501e20b",
186
+ invoiceSentStamp: "YYYY-MM-DD HH:MM:SS",
187
+ readyToInvoiceStamp: "YYYY-MM-DD HH:MM:SS",
188
+ paymentProcessedStamp: "YYYY-MM-DD HH:MM:SS",
189
+ queueUuid: "123e4567-4eca-4c40-ae6d-22b4d3576c7b",
190
+ queueExpiryDate: "YYYY-MM-DD HH:MM:SS",
191
+ queueAssignedStaffUuid: "123e4567-b6b5-4aee-9f2e-22b4d13f676b",
192
+ paymentReceivedStamp: "YYYY-MM-DD HH:MM:SS",
193
+ quoteDate: "YYYY-MM-DD HH:MM:SS",
194
+ quoteSentStamp: "YYYY-MM-DD HH:MM:SS",
195
+ workOrderDate: "YYYY-MM-DD HH:MM:SS",
196
+ completionDate: "YYYY-MM-DD HH:MM:SS",
197
+ completionActionedByUuid: "123e4567-ced8-4c56-90ff-22b4deca2cdb",
198
+ unsuccessfulDate: "YYYY-MM-DD HH:MM:SS",
199
+ jobIsScheduledUntilStamp: "YYYY-MM-DD HH:MM:SS",
200
+ activeNetworkRequestUuid: "123e4567-bf1f-4806-b2ac-22b4d33ee99b",
201
+ });
202
+
203
+ if (!res.ok) {
204
+ throw res.error;
205
+ }
206
+
207
+ const { value: result } = res;
208
+
209
+ // Handle the result
210
+ console.log(result);
211
+ }
212
+
213
+ run();
214
+ ```
215
+
216
+ ### Parameters
217
+
218
+ | Parameter | Type | Required | Description |
219
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
220
+ | `request` | [components.JobInput](../../models/components/jobinput.md) | :heavy_check_mark: | The request object to use for the request. |
221
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
222
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
223
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
224
+
225
+ ### Response
226
+
227
+ **Promise\<[operations.CreateJobsResponse](../../models/operations/createjobsresponse.md)\>**
228
+
229
+ ### Errors
230
+
231
+ | Error Type | Status Code | Content Type |
232
+ | ---------------- | ---------------- | ---------------- |
233
+ | errors.ErrorT | 400 | application/json |
234
+ | errors.APIError | 4XX, 5XX | \*/\* |
235
+
236
+ ## getJobs
237
+
238
+
239
+
240
+ #### OAuth Scope
241
+ This endpoint requires the following OAuth scope **read_jobs**.
242
+
243
+
244
+
245
+ ### Example Usage
246
+
247
+ ```typescript
248
+ import { ServiceM8 } from "servicem8";
249
+
250
+ const serviceM8 = new ServiceM8({
251
+ security: {
252
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
253
+ },
254
+ });
255
+
256
+ async function run() {
257
+ const result = await serviceM8.jobs.getJobs({
258
+ uuid: "e03231ef-9c59-48f0-8dc1-2a1c0a2ec3b8",
259
+ });
260
+
261
+ // Handle the result
262
+ console.log(result);
263
+ }
264
+
265
+ run();
266
+ ```
267
+
268
+ ### Standalone function
269
+
270
+ The standalone function version of this method:
271
+
272
+ ```typescript
273
+ import { ServiceM8Core } from "servicem8/core.js";
274
+ import { jobsGetJobs } from "servicem8/funcs/jobsGetJobs.js";
275
+
276
+ // Use `ServiceM8Core` for best tree-shaking performance.
277
+ // You can create one instance of it to use across an application.
278
+ const serviceM8 = new ServiceM8Core({
279
+ security: {
280
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
281
+ },
282
+ });
283
+
284
+ async function run() {
285
+ const res = await jobsGetJobs(serviceM8, {
286
+ uuid: "e03231ef-9c59-48f0-8dc1-2a1c0a2ec3b8",
287
+ });
288
+
289
+ if (!res.ok) {
290
+ throw res.error;
291
+ }
292
+
293
+ const { value: result } = res;
294
+
295
+ // Handle the result
296
+ console.log(result);
297
+ }
298
+
299
+ run();
300
+ ```
301
+
302
+ ### Parameters
303
+
304
+ | Parameter | Type | Required | Description |
305
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
306
+ | `request` | [operations.GetJobsRequest](../../models/operations/getjobsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
307
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
308
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
309
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
310
+
311
+ ### Response
312
+
313
+ **Promise\<[operations.GetJobsResponse](../../models/operations/getjobsresponse.md)\>**
314
+
315
+ ### Errors
316
+
317
+ | Error Type | Status Code | Content Type |
318
+ | ---------------- | ---------------- | ---------------- |
319
+ | errors.ErrorT | 400 | application/json |
320
+ | errors.APIError | 4XX, 5XX | \*/\* |
321
+
322
+ ## updateJobs
323
+
324
+
325
+
326
+ #### OAuth Scope
327
+ This endpoint requires the following OAuth scope **manage_jobs**.
328
+
329
+
330
+
331
+ ### Example Usage
332
+
333
+ ```typescript
334
+ import { ServiceM8 } from "servicem8";
335
+
336
+ const serviceM8 = new ServiceM8({
337
+ security: {
338
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
339
+ },
340
+ });
341
+
342
+ async function run() {
343
+ const result = await serviceM8.jobs.updateJobs({
344
+ uuid: "4f33e04f-a386-479f-8e76-bf95913d83ac",
345
+ job: {
346
+ uuid: "123e4567-9443-40f8-a097-22b4d1d047fb",
347
+ createdByStaffUuid: "123e4567-a308-44ce-a0e1-22b4d0829b3b",
348
+ date: "YYYY-MM-DD",
349
+ companyUuid: "123e4567-db1c-45f1-b8d3-22b4d70ec70b",
350
+ status: "<value>",
351
+ paymentDate: "YYYY-MM-DD HH:MM:SS",
352
+ paymentActionedByUuid: "123e4567-79d7-4031-8216-22b4d90caa2b",
353
+ categoryUuid: "123e4567-1e98-4f7e-b691-22b4d501e20b",
354
+ invoiceSentStamp: "YYYY-MM-DD HH:MM:SS",
355
+ readyToInvoiceStamp: "YYYY-MM-DD HH:MM:SS",
356
+ paymentProcessedStamp: "YYYY-MM-DD HH:MM:SS",
357
+ queueUuid: "123e4567-4eca-4c40-ae6d-22b4d3576c7b",
358
+ queueExpiryDate: "YYYY-MM-DD HH:MM:SS",
359
+ queueAssignedStaffUuid: "123e4567-b6b5-4aee-9f2e-22b4d13f676b",
360
+ paymentReceivedStamp: "YYYY-MM-DD HH:MM:SS",
361
+ quoteDate: "YYYY-MM-DD HH:MM:SS",
362
+ quoteSentStamp: "YYYY-MM-DD HH:MM:SS",
363
+ workOrderDate: "YYYY-MM-DD HH:MM:SS",
364
+ completionDate: "YYYY-MM-DD HH:MM:SS",
365
+ completionActionedByUuid: "123e4567-ced8-4c56-90ff-22b4deca2cdb",
366
+ unsuccessfulDate: "YYYY-MM-DD HH:MM:SS",
367
+ jobIsScheduledUntilStamp: "YYYY-MM-DD HH:MM:SS",
368
+ activeNetworkRequestUuid: "123e4567-bf1f-4806-b2ac-22b4d33ee99b",
369
+ },
370
+ });
371
+
372
+ // Handle the result
373
+ console.log(result);
374
+ }
375
+
376
+ run();
377
+ ```
378
+
379
+ ### Standalone function
380
+
381
+ The standalone function version of this method:
382
+
383
+ ```typescript
384
+ import { ServiceM8Core } from "servicem8/core.js";
385
+ import { jobsUpdateJobs } from "servicem8/funcs/jobsUpdateJobs.js";
386
+
387
+ // Use `ServiceM8Core` for best tree-shaking performance.
388
+ // You can create one instance of it to use across an application.
389
+ const serviceM8 = new ServiceM8Core({
390
+ security: {
391
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
392
+ },
393
+ });
394
+
395
+ async function run() {
396
+ const res = await jobsUpdateJobs(serviceM8, {
397
+ uuid: "4f33e04f-a386-479f-8e76-bf95913d83ac",
398
+ job: {
399
+ uuid: "123e4567-9443-40f8-a097-22b4d1d047fb",
400
+ createdByStaffUuid: "123e4567-a308-44ce-a0e1-22b4d0829b3b",
401
+ date: "YYYY-MM-DD",
402
+ companyUuid: "123e4567-db1c-45f1-b8d3-22b4d70ec70b",
403
+ status: "<value>",
404
+ paymentDate: "YYYY-MM-DD HH:MM:SS",
405
+ paymentActionedByUuid: "123e4567-79d7-4031-8216-22b4d90caa2b",
406
+ categoryUuid: "123e4567-1e98-4f7e-b691-22b4d501e20b",
407
+ invoiceSentStamp: "YYYY-MM-DD HH:MM:SS",
408
+ readyToInvoiceStamp: "YYYY-MM-DD HH:MM:SS",
409
+ paymentProcessedStamp: "YYYY-MM-DD HH:MM:SS",
410
+ queueUuid: "123e4567-4eca-4c40-ae6d-22b4d3576c7b",
411
+ queueExpiryDate: "YYYY-MM-DD HH:MM:SS",
412
+ queueAssignedStaffUuid: "123e4567-b6b5-4aee-9f2e-22b4d13f676b",
413
+ paymentReceivedStamp: "YYYY-MM-DD HH:MM:SS",
414
+ quoteDate: "YYYY-MM-DD HH:MM:SS",
415
+ quoteSentStamp: "YYYY-MM-DD HH:MM:SS",
416
+ workOrderDate: "YYYY-MM-DD HH:MM:SS",
417
+ completionDate: "YYYY-MM-DD HH:MM:SS",
418
+ completionActionedByUuid: "123e4567-ced8-4c56-90ff-22b4deca2cdb",
419
+ unsuccessfulDate: "YYYY-MM-DD HH:MM:SS",
420
+ jobIsScheduledUntilStamp: "YYYY-MM-DD HH:MM:SS",
421
+ activeNetworkRequestUuid: "123e4567-bf1f-4806-b2ac-22b4d33ee99b",
422
+ },
423
+ });
424
+
425
+ if (!res.ok) {
426
+ throw res.error;
427
+ }
428
+
429
+ const { value: result } = res;
430
+
431
+ // Handle the result
432
+ console.log(result);
433
+ }
434
+
435
+ run();
436
+ ```
437
+
438
+ ### Parameters
439
+
440
+ | Parameter | Type | Required | Description |
441
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
442
+ | `request` | [operations.UpdateJobsRequest](../../models/operations/updatejobsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
443
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
444
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
445
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
446
+
447
+ ### Response
448
+
449
+ **Promise\<[operations.UpdateJobsResponse](../../models/operations/updatejobsresponse.md)\>**
450
+
451
+ ### Errors
452
+
453
+ | Error Type | Status Code | Content Type |
454
+ | ---------------- | ---------------- | ---------------- |
455
+ | errors.ErrorT | 400 | application/json |
456
+ | errors.APIError | 4XX, 5XX | \*/\* |
457
+
458
+ ## deleteJobs
459
+
460
+
461
+
462
+ In ServiceM8, records are never deleted, but are archived. Archived records will remain accessible via the API as (active = 0), however will no longer be visible in UI. Archived records can be restored to active by setting the record active field to 1.
463
+
464
+
465
+
466
+ #### OAuth Scope
467
+ This endpoint requires the following OAuth scope **manage_jobs**.
468
+
469
+
470
+
471
+ ### Example Usage
472
+
473
+ ```typescript
474
+ import { ServiceM8 } from "servicem8";
475
+
476
+ const serviceM8 = new ServiceM8({
477
+ security: {
478
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
479
+ },
480
+ });
481
+
482
+ async function run() {
483
+ const result = await serviceM8.jobs.deleteJobs({
484
+ uuid: "485f3e02-d99b-43c9-9f25-d27243291361",
485
+ });
486
+
487
+ // Handle the result
488
+ console.log(result);
489
+ }
490
+
491
+ run();
492
+ ```
493
+
494
+ ### Standalone function
495
+
496
+ The standalone function version of this method:
497
+
498
+ ```typescript
499
+ import { ServiceM8Core } from "servicem8/core.js";
500
+ import { jobsDeleteJobs } from "servicem8/funcs/jobsDeleteJobs.js";
501
+
502
+ // Use `ServiceM8Core` for best tree-shaking performance.
503
+ // You can create one instance of it to use across an application.
504
+ const serviceM8 = new ServiceM8Core({
505
+ security: {
506
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
507
+ },
508
+ });
509
+
510
+ async function run() {
511
+ const res = await jobsDeleteJobs(serviceM8, {
512
+ uuid: "485f3e02-d99b-43c9-9f25-d27243291361",
513
+ });
514
+
515
+ if (!res.ok) {
516
+ throw res.error;
517
+ }
518
+
519
+ const { value: result } = res;
520
+
521
+ // Handle the result
522
+ console.log(result);
523
+ }
524
+
525
+ run();
526
+ ```
527
+
528
+ ### Parameters
529
+
530
+ | Parameter | Type | Required | Description |
531
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
532
+ | `request` | [operations.DeleteJobsRequest](../../models/operations/deletejobsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
533
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
534
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
535
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
536
+
537
+ ### Response
538
+
539
+ **Promise\<[operations.DeleteJobsResponse](../../models/operations/deletejobsresponse.md)\>**
540
+
541
+ ### Errors
542
+
543
+ | Error Type | Status Code | Content Type |
544
+ | ---------------- | ---------------- | ---------------- |
545
+ | errors.ErrorT | 400 | application/json |
546
+ | errors.APIError | 4XX, 5XX | \*/\* |