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,478 @@
1
+ # JobMaterials
2
+ (*jobMaterials*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Job Materials
7
+
8
+ ### Available Operations
9
+
10
+ * [listJobMaterials](#listjobmaterials) - List all Job Materials
11
+ * [createJobMaterials](#createjobmaterials) - Create a new Job Material
12
+ * [getJobMaterials](#getjobmaterials) - Retrieve a Job Material
13
+ * [updateJobMaterials](#updatejobmaterials) - Update a Job Material
14
+ * [deleteJobMaterials](#deletejobmaterials) - Delete a Job Material
15
+
16
+ ## listJobMaterials
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_job_materials**.
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.jobMaterials.listJobMaterials();
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 { jobMaterialsListJobMaterials } from "servicem8/funcs/jobMaterialsListJobMaterials.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 jobMaterialsListJobMaterials(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.ListJobMaterialsResponse](../../models/operations/listjobmaterialsresponse.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
+ ## createJobMaterials
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_job_materials**.
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.jobMaterials.createJobMaterials({
128
+ uuid: "123e4567-334d-4865-92d3-22b4ddcfc3db",
129
+ jobUuid: "123e4567-951d-4781-a157-22b4dcc3c8db",
130
+ materialUuid: "123e4567-35d4-4ddd-9169-22b4dce512ab",
131
+ quantity: "<value>",
132
+ taxRateUuid: "123e4567-1dd4-42c2-ad1c-22b4d3f47b6b",
133
+ jobMaterialBundleUuid: "123e4567-402b-4069-b7c3-22b4d307a2eb",
134
+ });
135
+
136
+ // Handle the result
137
+ console.log(result);
138
+ }
139
+
140
+ run();
141
+ ```
142
+
143
+ ### Standalone function
144
+
145
+ The standalone function version of this method:
146
+
147
+ ```typescript
148
+ import { ServiceM8Core } from "servicem8/core.js";
149
+ import { jobMaterialsCreateJobMaterials } from "servicem8/funcs/jobMaterialsCreateJobMaterials.js";
150
+
151
+ // Use `ServiceM8Core` for best tree-shaking performance.
152
+ // You can create one instance of it to use across an application.
153
+ const serviceM8 = new ServiceM8Core({
154
+ security: {
155
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
156
+ },
157
+ });
158
+
159
+ async function run() {
160
+ const res = await jobMaterialsCreateJobMaterials(serviceM8, {
161
+ uuid: "123e4567-334d-4865-92d3-22b4ddcfc3db",
162
+ jobUuid: "123e4567-951d-4781-a157-22b4dcc3c8db",
163
+ materialUuid: "123e4567-35d4-4ddd-9169-22b4dce512ab",
164
+ quantity: "<value>",
165
+ taxRateUuid: "123e4567-1dd4-42c2-ad1c-22b4d3f47b6b",
166
+ jobMaterialBundleUuid: "123e4567-402b-4069-b7c3-22b4d307a2eb",
167
+ });
168
+
169
+ if (!res.ok) {
170
+ throw res.error;
171
+ }
172
+
173
+ const { value: result } = res;
174
+
175
+ // Handle the result
176
+ console.log(result);
177
+ }
178
+
179
+ run();
180
+ ```
181
+
182
+ ### Parameters
183
+
184
+ | Parameter | Type | Required | Description |
185
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
186
+ | `request` | [components.JobMaterialInput](../../models/components/jobmaterialinput.md) | :heavy_check_mark: | The request object to use for the request. |
187
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
188
+ | `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. |
189
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
190
+
191
+ ### Response
192
+
193
+ **Promise\<[operations.CreateJobMaterialsResponse](../../models/operations/createjobmaterialsresponse.md)\>**
194
+
195
+ ### Errors
196
+
197
+ | Error Type | Status Code | Content Type |
198
+ | ---------------- | ---------------- | ---------------- |
199
+ | errors.ErrorT | 400 | application/json |
200
+ | errors.APIError | 4XX, 5XX | \*/\* |
201
+
202
+ ## getJobMaterials
203
+
204
+
205
+
206
+ #### OAuth Scope
207
+ This endpoint requires the following OAuth scope **read_job_materials**.
208
+
209
+
210
+
211
+ ### Example Usage
212
+
213
+ ```typescript
214
+ import { ServiceM8 } from "servicem8";
215
+
216
+ const serviceM8 = new ServiceM8({
217
+ security: {
218
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
219
+ },
220
+ });
221
+
222
+ async function run() {
223
+ const result = await serviceM8.jobMaterials.getJobMaterials({
224
+ uuid: "d79254ce-b994-4a50-8a99-5f1146cac7ca",
225
+ });
226
+
227
+ // Handle the result
228
+ console.log(result);
229
+ }
230
+
231
+ run();
232
+ ```
233
+
234
+ ### Standalone function
235
+
236
+ The standalone function version of this method:
237
+
238
+ ```typescript
239
+ import { ServiceM8Core } from "servicem8/core.js";
240
+ import { jobMaterialsGetJobMaterials } from "servicem8/funcs/jobMaterialsGetJobMaterials.js";
241
+
242
+ // Use `ServiceM8Core` for best tree-shaking performance.
243
+ // You can create one instance of it to use across an application.
244
+ const serviceM8 = new ServiceM8Core({
245
+ security: {
246
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
247
+ },
248
+ });
249
+
250
+ async function run() {
251
+ const res = await jobMaterialsGetJobMaterials(serviceM8, {
252
+ uuid: "d79254ce-b994-4a50-8a99-5f1146cac7ca",
253
+ });
254
+
255
+ if (!res.ok) {
256
+ throw res.error;
257
+ }
258
+
259
+ const { value: result } = res;
260
+
261
+ // Handle the result
262
+ console.log(result);
263
+ }
264
+
265
+ run();
266
+ ```
267
+
268
+ ### Parameters
269
+
270
+ | Parameter | Type | Required | Description |
271
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
272
+ | `request` | [operations.GetJobMaterialsRequest](../../models/operations/getjobmaterialsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
273
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
274
+ | `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. |
275
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
276
+
277
+ ### Response
278
+
279
+ **Promise\<[operations.GetJobMaterialsResponse](../../models/operations/getjobmaterialsresponse.md)\>**
280
+
281
+ ### Errors
282
+
283
+ | Error Type | Status Code | Content Type |
284
+ | ---------------- | ---------------- | ---------------- |
285
+ | errors.ErrorT | 400 | application/json |
286
+ | errors.APIError | 4XX, 5XX | \*/\* |
287
+
288
+ ## updateJobMaterials
289
+
290
+
291
+
292
+ #### OAuth Scope
293
+ This endpoint requires the following OAuth scope **manage_job_materials**.
294
+
295
+
296
+
297
+ ### Example Usage
298
+
299
+ ```typescript
300
+ import { ServiceM8 } from "servicem8";
301
+
302
+ const serviceM8 = new ServiceM8({
303
+ security: {
304
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
305
+ },
306
+ });
307
+
308
+ async function run() {
309
+ const result = await serviceM8.jobMaterials.updateJobMaterials({
310
+ uuid: "e5cec741-7f2b-410a-bf65-aff4658f1c92",
311
+ jobMaterial: {
312
+ uuid: "123e4567-334d-4865-92d3-22b4ddcfc3db",
313
+ jobUuid: "123e4567-951d-4781-a157-22b4dcc3c8db",
314
+ materialUuid: "123e4567-35d4-4ddd-9169-22b4dce512ab",
315
+ quantity: "<value>",
316
+ taxRateUuid: "123e4567-1dd4-42c2-ad1c-22b4d3f47b6b",
317
+ jobMaterialBundleUuid: "123e4567-402b-4069-b7c3-22b4d307a2eb",
318
+ },
319
+ });
320
+
321
+ // Handle the result
322
+ console.log(result);
323
+ }
324
+
325
+ run();
326
+ ```
327
+
328
+ ### Standalone function
329
+
330
+ The standalone function version of this method:
331
+
332
+ ```typescript
333
+ import { ServiceM8Core } from "servicem8/core.js";
334
+ import { jobMaterialsUpdateJobMaterials } from "servicem8/funcs/jobMaterialsUpdateJobMaterials.js";
335
+
336
+ // Use `ServiceM8Core` for best tree-shaking performance.
337
+ // You can create one instance of it to use across an application.
338
+ const serviceM8 = new ServiceM8Core({
339
+ security: {
340
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
341
+ },
342
+ });
343
+
344
+ async function run() {
345
+ const res = await jobMaterialsUpdateJobMaterials(serviceM8, {
346
+ uuid: "e5cec741-7f2b-410a-bf65-aff4658f1c92",
347
+ jobMaterial: {
348
+ uuid: "123e4567-334d-4865-92d3-22b4ddcfc3db",
349
+ jobUuid: "123e4567-951d-4781-a157-22b4dcc3c8db",
350
+ materialUuid: "123e4567-35d4-4ddd-9169-22b4dce512ab",
351
+ quantity: "<value>",
352
+ taxRateUuid: "123e4567-1dd4-42c2-ad1c-22b4d3f47b6b",
353
+ jobMaterialBundleUuid: "123e4567-402b-4069-b7c3-22b4d307a2eb",
354
+ },
355
+ });
356
+
357
+ if (!res.ok) {
358
+ throw res.error;
359
+ }
360
+
361
+ const { value: result } = res;
362
+
363
+ // Handle the result
364
+ console.log(result);
365
+ }
366
+
367
+ run();
368
+ ```
369
+
370
+ ### Parameters
371
+
372
+ | Parameter | Type | Required | Description |
373
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
374
+ | `request` | [operations.UpdateJobMaterialsRequest](../../models/operations/updatejobmaterialsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
375
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
376
+ | `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. |
377
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
378
+
379
+ ### Response
380
+
381
+ **Promise\<[operations.UpdateJobMaterialsResponse](../../models/operations/updatejobmaterialsresponse.md)\>**
382
+
383
+ ### Errors
384
+
385
+ | Error Type | Status Code | Content Type |
386
+ | ---------------- | ---------------- | ---------------- |
387
+ | errors.ErrorT | 400 | application/json |
388
+ | errors.APIError | 4XX, 5XX | \*/\* |
389
+
390
+ ## deleteJobMaterials
391
+
392
+
393
+
394
+ 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.
395
+
396
+
397
+
398
+ #### OAuth Scope
399
+ This endpoint requires the following OAuth scope **manage_job_materials**.
400
+
401
+
402
+
403
+ ### Example Usage
404
+
405
+ ```typescript
406
+ import { ServiceM8 } from "servicem8";
407
+
408
+ const serviceM8 = new ServiceM8({
409
+ security: {
410
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
411
+ },
412
+ });
413
+
414
+ async function run() {
415
+ const result = await serviceM8.jobMaterials.deleteJobMaterials({
416
+ uuid: "4e8876ca-968b-495e-9f73-d41227fa2e1a",
417
+ });
418
+
419
+ // Handle the result
420
+ console.log(result);
421
+ }
422
+
423
+ run();
424
+ ```
425
+
426
+ ### Standalone function
427
+
428
+ The standalone function version of this method:
429
+
430
+ ```typescript
431
+ import { ServiceM8Core } from "servicem8/core.js";
432
+ import { jobMaterialsDeleteJobMaterials } from "servicem8/funcs/jobMaterialsDeleteJobMaterials.js";
433
+
434
+ // Use `ServiceM8Core` for best tree-shaking performance.
435
+ // You can create one instance of it to use across an application.
436
+ const serviceM8 = new ServiceM8Core({
437
+ security: {
438
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
439
+ },
440
+ });
441
+
442
+ async function run() {
443
+ const res = await jobMaterialsDeleteJobMaterials(serviceM8, {
444
+ uuid: "4e8876ca-968b-495e-9f73-d41227fa2e1a",
445
+ });
446
+
447
+ if (!res.ok) {
448
+ throw res.error;
449
+ }
450
+
451
+ const { value: result } = res;
452
+
453
+ // Handle the result
454
+ console.log(result);
455
+ }
456
+
457
+ run();
458
+ ```
459
+
460
+ ### Parameters
461
+
462
+ | Parameter | Type | Required | Description |
463
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
464
+ | `request` | [operations.DeleteJobMaterialsRequest](../../models/operations/deletejobmaterialsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
465
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
466
+ | `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. |
467
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
468
+
469
+ ### Response
470
+
471
+ **Promise\<[operations.DeleteJobMaterialsResponse](../../models/operations/deletejobmaterialsresponse.md)\>**
472
+
473
+ ### Errors
474
+
475
+ | Error Type | Status Code | Content Type |
476
+ | ---------------- | ---------------- | ---------------- |
477
+ | errors.ErrorT | 400 | application/json |
478
+ | errors.APIError | 4XX, 5XX | \*/\* |