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,490 @@
1
+ # Tasks
2
+ (*tasks*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Tasks
7
+
8
+ ### Available Operations
9
+
10
+ * [listTasks](#listtasks) - List all Tasks
11
+ * [createTasks](#createtasks) - Create a new Task
12
+ * [getTasks](#gettasks) - Retrieve a Task
13
+ * [updateTasks](#updatetasks) - Update a Task
14
+ * [deleteTasks](#deletetasks) - Delete a Task
15
+
16
+ ## listTasks
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_tasks**.
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.tasks.listTasks();
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 { tasksListTasks } from "servicem8/funcs/tasksListTasks.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 tasksListTasks(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.ListTasksResponse](../../models/operations/listtasksresponse.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
+ ## createTasks
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_tasks**.
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.tasks.createTasks({
128
+ uuid: "123e4567-a72d-4a44-883e-22b4dc3e260b",
129
+ dueDate: "YYYY-MM-DD",
130
+ name: "<value>",
131
+ relatedObjectUuid: "123e4567-ea7a-418d-8bc7-22b4d6f88e8b",
132
+ completedTimestamp: "YYYY-MM-DD HH:MM:SS",
133
+ completedByStaffUuid: "123e4567-1596-433b-8657-22b4d1913aab",
134
+ assignedToStaffUuid: "123e4567-299b-4b50-b21f-22b4d1057ebb",
135
+ createdByStaffUuid: "123e4567-dd10-49af-ba90-22b4d80f729b",
136
+ createDate: "YYYY-MM-DD HH:MM:SS",
137
+ });
138
+
139
+ // Handle the result
140
+ console.log(result);
141
+ }
142
+
143
+ run();
144
+ ```
145
+
146
+ ### Standalone function
147
+
148
+ The standalone function version of this method:
149
+
150
+ ```typescript
151
+ import { ServiceM8Core } from "servicem8/core.js";
152
+ import { tasksCreateTasks } from "servicem8/funcs/tasksCreateTasks.js";
153
+
154
+ // Use `ServiceM8Core` for best tree-shaking performance.
155
+ // You can create one instance of it to use across an application.
156
+ const serviceM8 = new ServiceM8Core({
157
+ security: {
158
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
159
+ },
160
+ });
161
+
162
+ async function run() {
163
+ const res = await tasksCreateTasks(serviceM8, {
164
+ uuid: "123e4567-a72d-4a44-883e-22b4dc3e260b",
165
+ dueDate: "YYYY-MM-DD",
166
+ name: "<value>",
167
+ relatedObjectUuid: "123e4567-ea7a-418d-8bc7-22b4d6f88e8b",
168
+ completedTimestamp: "YYYY-MM-DD HH:MM:SS",
169
+ completedByStaffUuid: "123e4567-1596-433b-8657-22b4d1913aab",
170
+ assignedToStaffUuid: "123e4567-299b-4b50-b21f-22b4d1057ebb",
171
+ createdByStaffUuid: "123e4567-dd10-49af-ba90-22b4d80f729b",
172
+ createDate: "YYYY-MM-DD HH:MM:SS",
173
+ });
174
+
175
+ if (!res.ok) {
176
+ throw res.error;
177
+ }
178
+
179
+ const { value: result } = res;
180
+
181
+ // Handle the result
182
+ console.log(result);
183
+ }
184
+
185
+ run();
186
+ ```
187
+
188
+ ### Parameters
189
+
190
+ | Parameter | Type | Required | Description |
191
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
192
+ | `request` | [components.TaskInput](../../models/components/taskinput.md) | :heavy_check_mark: | The request object to use for the request. |
193
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
194
+ | `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. |
195
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
196
+
197
+ ### Response
198
+
199
+ **Promise\<[operations.CreateTasksResponse](../../models/operations/createtasksresponse.md)\>**
200
+
201
+ ### Errors
202
+
203
+ | Error Type | Status Code | Content Type |
204
+ | ---------------- | ---------------- | ---------------- |
205
+ | errors.ErrorT | 400 | application/json |
206
+ | errors.APIError | 4XX, 5XX | \*/\* |
207
+
208
+ ## getTasks
209
+
210
+
211
+
212
+ #### OAuth Scope
213
+ This endpoint requires the following OAuth scope **read_tasks**.
214
+
215
+
216
+
217
+ ### Example Usage
218
+
219
+ ```typescript
220
+ import { ServiceM8 } from "servicem8";
221
+
222
+ const serviceM8 = new ServiceM8({
223
+ security: {
224
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
225
+ },
226
+ });
227
+
228
+ async function run() {
229
+ const result = await serviceM8.tasks.getTasks({
230
+ uuid: "89513748-b917-4807-944b-430445ee8621",
231
+ });
232
+
233
+ // Handle the result
234
+ console.log(result);
235
+ }
236
+
237
+ run();
238
+ ```
239
+
240
+ ### Standalone function
241
+
242
+ The standalone function version of this method:
243
+
244
+ ```typescript
245
+ import { ServiceM8Core } from "servicem8/core.js";
246
+ import { tasksGetTasks } from "servicem8/funcs/tasksGetTasks.js";
247
+
248
+ // Use `ServiceM8Core` for best tree-shaking performance.
249
+ // You can create one instance of it to use across an application.
250
+ const serviceM8 = new ServiceM8Core({
251
+ security: {
252
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
253
+ },
254
+ });
255
+
256
+ async function run() {
257
+ const res = await tasksGetTasks(serviceM8, {
258
+ uuid: "89513748-b917-4807-944b-430445ee8621",
259
+ });
260
+
261
+ if (!res.ok) {
262
+ throw res.error;
263
+ }
264
+
265
+ const { value: result } = res;
266
+
267
+ // Handle the result
268
+ console.log(result);
269
+ }
270
+
271
+ run();
272
+ ```
273
+
274
+ ### Parameters
275
+
276
+ | Parameter | Type | Required | Description |
277
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
278
+ | `request` | [operations.GetTasksRequest](../../models/operations/gettasksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
279
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
280
+ | `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. |
281
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
282
+
283
+ ### Response
284
+
285
+ **Promise\<[operations.GetTasksResponse](../../models/operations/gettasksresponse.md)\>**
286
+
287
+ ### Errors
288
+
289
+ | Error Type | Status Code | Content Type |
290
+ | ---------------- | ---------------- | ---------------- |
291
+ | errors.ErrorT | 400 | application/json |
292
+ | errors.APIError | 4XX, 5XX | \*/\* |
293
+
294
+ ## updateTasks
295
+
296
+
297
+
298
+ #### OAuth Scope
299
+ This endpoint requires the following OAuth scope **manage_tasks**.
300
+
301
+
302
+
303
+ ### Example Usage
304
+
305
+ ```typescript
306
+ import { ServiceM8 } from "servicem8";
307
+
308
+ const serviceM8 = new ServiceM8({
309
+ security: {
310
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
311
+ },
312
+ });
313
+
314
+ async function run() {
315
+ const result = await serviceM8.tasks.updateTasks({
316
+ uuid: "63b2819d-65b6-4785-8dec-6cc2953e2c97",
317
+ task: {
318
+ uuid: "123e4567-a72d-4a44-883e-22b4dc3e260b",
319
+ dueDate: "YYYY-MM-DD",
320
+ name: "<value>",
321
+ relatedObjectUuid: "123e4567-ea7a-418d-8bc7-22b4d6f88e8b",
322
+ completedTimestamp: "YYYY-MM-DD HH:MM:SS",
323
+ completedByStaffUuid: "123e4567-1596-433b-8657-22b4d1913aab",
324
+ assignedToStaffUuid: "123e4567-299b-4b50-b21f-22b4d1057ebb",
325
+ createdByStaffUuid: "123e4567-dd10-49af-ba90-22b4d80f729b",
326
+ createDate: "YYYY-MM-DD HH:MM:SS",
327
+ },
328
+ });
329
+
330
+ // Handle the result
331
+ console.log(result);
332
+ }
333
+
334
+ run();
335
+ ```
336
+
337
+ ### Standalone function
338
+
339
+ The standalone function version of this method:
340
+
341
+ ```typescript
342
+ import { ServiceM8Core } from "servicem8/core.js";
343
+ import { tasksUpdateTasks } from "servicem8/funcs/tasksUpdateTasks.js";
344
+
345
+ // Use `ServiceM8Core` for best tree-shaking performance.
346
+ // You can create one instance of it to use across an application.
347
+ const serviceM8 = new ServiceM8Core({
348
+ security: {
349
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
350
+ },
351
+ });
352
+
353
+ async function run() {
354
+ const res = await tasksUpdateTasks(serviceM8, {
355
+ uuid: "63b2819d-65b6-4785-8dec-6cc2953e2c97",
356
+ task: {
357
+ uuid: "123e4567-a72d-4a44-883e-22b4dc3e260b",
358
+ dueDate: "YYYY-MM-DD",
359
+ name: "<value>",
360
+ relatedObjectUuid: "123e4567-ea7a-418d-8bc7-22b4d6f88e8b",
361
+ completedTimestamp: "YYYY-MM-DD HH:MM:SS",
362
+ completedByStaffUuid: "123e4567-1596-433b-8657-22b4d1913aab",
363
+ assignedToStaffUuid: "123e4567-299b-4b50-b21f-22b4d1057ebb",
364
+ createdByStaffUuid: "123e4567-dd10-49af-ba90-22b4d80f729b",
365
+ createDate: "YYYY-MM-DD HH:MM:SS",
366
+ },
367
+ });
368
+
369
+ if (!res.ok) {
370
+ throw res.error;
371
+ }
372
+
373
+ const { value: result } = res;
374
+
375
+ // Handle the result
376
+ console.log(result);
377
+ }
378
+
379
+ run();
380
+ ```
381
+
382
+ ### Parameters
383
+
384
+ | Parameter | Type | Required | Description |
385
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
386
+ | `request` | [operations.UpdateTasksRequest](../../models/operations/updatetasksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
387
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
388
+ | `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. |
389
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
390
+
391
+ ### Response
392
+
393
+ **Promise\<[operations.UpdateTasksResponse](../../models/operations/updatetasksresponse.md)\>**
394
+
395
+ ### Errors
396
+
397
+ | Error Type | Status Code | Content Type |
398
+ | ---------------- | ---------------- | ---------------- |
399
+ | errors.ErrorT | 400 | application/json |
400
+ | errors.APIError | 4XX, 5XX | \*/\* |
401
+
402
+ ## deleteTasks
403
+
404
+
405
+
406
+ 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.
407
+
408
+
409
+
410
+ #### OAuth Scope
411
+ This endpoint requires the following OAuth scope **manage_tasks**.
412
+
413
+
414
+
415
+ ### Example Usage
416
+
417
+ ```typescript
418
+ import { ServiceM8 } from "servicem8";
419
+
420
+ const serviceM8 = new ServiceM8({
421
+ security: {
422
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
423
+ },
424
+ });
425
+
426
+ async function run() {
427
+ const result = await serviceM8.tasks.deleteTasks({
428
+ uuid: "b2f94108-940f-438b-b838-58e70df1ddb2",
429
+ });
430
+
431
+ // Handle the result
432
+ console.log(result);
433
+ }
434
+
435
+ run();
436
+ ```
437
+
438
+ ### Standalone function
439
+
440
+ The standalone function version of this method:
441
+
442
+ ```typescript
443
+ import { ServiceM8Core } from "servicem8/core.js";
444
+ import { tasksDeleteTasks } from "servicem8/funcs/tasksDeleteTasks.js";
445
+
446
+ // Use `ServiceM8Core` for best tree-shaking performance.
447
+ // You can create one instance of it to use across an application.
448
+ const serviceM8 = new ServiceM8Core({
449
+ security: {
450
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
451
+ },
452
+ });
453
+
454
+ async function run() {
455
+ const res = await tasksDeleteTasks(serviceM8, {
456
+ uuid: "b2f94108-940f-438b-b838-58e70df1ddb2",
457
+ });
458
+
459
+ if (!res.ok) {
460
+ throw res.error;
461
+ }
462
+
463
+ const { value: result } = res;
464
+
465
+ // Handle the result
466
+ console.log(result);
467
+ }
468
+
469
+ run();
470
+ ```
471
+
472
+ ### Parameters
473
+
474
+ | Parameter | Type | Required | Description |
475
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
476
+ | `request` | [operations.DeleteTasksRequest](../../models/operations/deletetasksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
477
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
478
+ | `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. |
479
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
480
+
481
+ ### Response
482
+
483
+ **Promise\<[operations.DeleteTasksResponse](../../models/operations/deletetasksresponse.md)\>**
484
+
485
+ ### Errors
486
+
487
+ | Error Type | Status Code | Content Type |
488
+ | ---------------- | ---------------- | ---------------- |
489
+ | errors.ErrorT | 400 | application/json |
490
+ | errors.APIError | 4XX, 5XX | \*/\* |