servicem8 0.3.3 → 0.3.7

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,441 @@
1
+ # Attachments
2
+ (*attachments*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Attachments
7
+
8
+ ### Available Operations
9
+
10
+ * [listAttachments](#listattachments) - List all Attachments
11
+ * [createAttachments](#createattachments) - Create a new Attachment
12
+ * [getAttachments](#getattachments) - Retrieve an Attachment
13
+ * [updateAttachments](#updateattachments) - Update an Attachment
14
+ * [deleteAttachments](#deleteattachments) - Delete an Attachment
15
+
16
+ ## listAttachments
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
+ ### Example Usage
25
+
26
+ ```typescript
27
+ import { ServiceM8 } from "servicem8";
28
+
29
+ const serviceM8 = new ServiceM8({
30
+ security: {
31
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
32
+ },
33
+ });
34
+
35
+ async function run() {
36
+ const result = await serviceM8.attachments.listAttachments();
37
+
38
+ // Handle the result
39
+ console.log(result);
40
+ }
41
+
42
+ run();
43
+ ```
44
+
45
+ ### Standalone function
46
+
47
+ The standalone function version of this method:
48
+
49
+ ```typescript
50
+ import { ServiceM8Core } from "servicem8/core.js";
51
+ import { attachmentsListAttachments } from "servicem8/funcs/attachmentsListAttachments.js";
52
+
53
+ // Use `ServiceM8Core` for best tree-shaking performance.
54
+ // You can create one instance of it to use across an application.
55
+ const serviceM8 = new ServiceM8Core({
56
+ security: {
57
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
58
+ },
59
+ });
60
+
61
+ async function run() {
62
+ const res = await attachmentsListAttachments(serviceM8);
63
+
64
+ if (!res.ok) {
65
+ throw res.error;
66
+ }
67
+
68
+ const { value: result } = res;
69
+
70
+ // Handle the result
71
+ console.log(result);
72
+ }
73
+
74
+ run();
75
+ ```
76
+
77
+ ### Parameters
78
+
79
+ | Parameter | Type | Required | Description |
80
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
81
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
82
+ | `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. |
83
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
84
+
85
+ ### Response
86
+
87
+ **Promise\<[operations.ListAttachmentsResponse](../../models/operations/listattachmentsresponse.md)\>**
88
+
89
+ ### Errors
90
+
91
+ | Error Type | Status Code | Content Type |
92
+ | ---------------- | ---------------- | ---------------- |
93
+ | errors.ErrorT | 400 | application/json |
94
+ | errors.APIError | 4XX, 5XX | \*/\* |
95
+
96
+ ## createAttachments
97
+
98
+
99
+
100
+ #### Record UUID
101
+ 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.
102
+
103
+
104
+
105
+ ### Example Usage
106
+
107
+ ```typescript
108
+ import { ServiceM8 } from "servicem8";
109
+
110
+ const serviceM8 = new ServiceM8({
111
+ security: {
112
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
113
+ },
114
+ });
115
+
116
+ async function run() {
117
+ const result = await serviceM8.attachments.createAttachments({
118
+ uuid: "123e4567-07bc-4698-b15d-22b4d5d1156b",
119
+ relatedObjectUuid: "123e4567-aa29-4c42-ae6f-22b4d6e7453b",
120
+ createdByStaffUuid: "123e4567-6df3-4a46-b4ff-22b4d04b5acb",
121
+ });
122
+
123
+ // Handle the result
124
+ console.log(result);
125
+ }
126
+
127
+ run();
128
+ ```
129
+
130
+ ### Standalone function
131
+
132
+ The standalone function version of this method:
133
+
134
+ ```typescript
135
+ import { ServiceM8Core } from "servicem8/core.js";
136
+ import { attachmentsCreateAttachments } from "servicem8/funcs/attachmentsCreateAttachments.js";
137
+
138
+ // Use `ServiceM8Core` for best tree-shaking performance.
139
+ // You can create one instance of it to use across an application.
140
+ const serviceM8 = new ServiceM8Core({
141
+ security: {
142
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
143
+ },
144
+ });
145
+
146
+ async function run() {
147
+ const res = await attachmentsCreateAttachments(serviceM8, {
148
+ uuid: "123e4567-07bc-4698-b15d-22b4d5d1156b",
149
+ relatedObjectUuid: "123e4567-aa29-4c42-ae6f-22b4d6e7453b",
150
+ createdByStaffUuid: "123e4567-6df3-4a46-b4ff-22b4d04b5acb",
151
+ });
152
+
153
+ if (!res.ok) {
154
+ throw res.error;
155
+ }
156
+
157
+ const { value: result } = res;
158
+
159
+ // Handle the result
160
+ console.log(result);
161
+ }
162
+
163
+ run();
164
+ ```
165
+
166
+ ### Parameters
167
+
168
+ | Parameter | Type | Required | Description |
169
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
170
+ | `request` | [components.AttachmentInput](../../models/components/attachmentinput.md) | :heavy_check_mark: | The request object to use for the request. |
171
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
172
+ | `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. |
173
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
174
+
175
+ ### Response
176
+
177
+ **Promise\<[operations.CreateAttachmentsResponse](../../models/operations/createattachmentsresponse.md)\>**
178
+
179
+ ### Errors
180
+
181
+ | Error Type | Status Code | Content Type |
182
+ | ---------------- | ---------------- | ---------------- |
183
+ | errors.ErrorT | 400 | application/json |
184
+ | errors.APIError | 4XX, 5XX | \*/\* |
185
+
186
+ ## getAttachments
187
+
188
+ Retrieve an Attachment
189
+
190
+ ### Example Usage
191
+
192
+ ```typescript
193
+ import { ServiceM8 } from "servicem8";
194
+
195
+ const serviceM8 = new ServiceM8({
196
+ security: {
197
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
198
+ },
199
+ });
200
+
201
+ async function run() {
202
+ const result = await serviceM8.attachments.getAttachments({
203
+ uuid: "a2f84c5a-7c7b-498c-98b8-8833efa107b6",
204
+ });
205
+
206
+ // Handle the result
207
+ console.log(result);
208
+ }
209
+
210
+ run();
211
+ ```
212
+
213
+ ### Standalone function
214
+
215
+ The standalone function version of this method:
216
+
217
+ ```typescript
218
+ import { ServiceM8Core } from "servicem8/core.js";
219
+ import { attachmentsGetAttachments } from "servicem8/funcs/attachmentsGetAttachments.js";
220
+
221
+ // Use `ServiceM8Core` for best tree-shaking performance.
222
+ // You can create one instance of it to use across an application.
223
+ const serviceM8 = new ServiceM8Core({
224
+ security: {
225
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
226
+ },
227
+ });
228
+
229
+ async function run() {
230
+ const res = await attachmentsGetAttachments(serviceM8, {
231
+ uuid: "a2f84c5a-7c7b-498c-98b8-8833efa107b6",
232
+ });
233
+
234
+ if (!res.ok) {
235
+ throw res.error;
236
+ }
237
+
238
+ const { value: result } = res;
239
+
240
+ // Handle the result
241
+ console.log(result);
242
+ }
243
+
244
+ run();
245
+ ```
246
+
247
+ ### Parameters
248
+
249
+ | Parameter | Type | Required | Description |
250
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
251
+ | `request` | [operations.GetAttachmentsRequest](../../models/operations/getattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
252
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
253
+ | `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. |
254
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
255
+
256
+ ### Response
257
+
258
+ **Promise\<[operations.GetAttachmentsResponse](../../models/operations/getattachmentsresponse.md)\>**
259
+
260
+ ### Errors
261
+
262
+ | Error Type | Status Code | Content Type |
263
+ | ---------------- | ---------------- | ---------------- |
264
+ | errors.ErrorT | 400 | application/json |
265
+ | errors.APIError | 4XX, 5XX | \*/\* |
266
+
267
+ ## updateAttachments
268
+
269
+ Update an Attachment
270
+
271
+ ### Example Usage
272
+
273
+ ```typescript
274
+ import { ServiceM8 } from "servicem8";
275
+
276
+ const serviceM8 = new ServiceM8({
277
+ security: {
278
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
279
+ },
280
+ });
281
+
282
+ async function run() {
283
+ const result = await serviceM8.attachments.updateAttachments({
284
+ uuid: "e28258ad-72e5-4d18-9280-984c43db4570",
285
+ attachment: {
286
+ uuid: "123e4567-07bc-4698-b15d-22b4d5d1156b",
287
+ relatedObjectUuid: "123e4567-aa29-4c42-ae6f-22b4d6e7453b",
288
+ createdByStaffUuid: "123e4567-6df3-4a46-b4ff-22b4d04b5acb",
289
+ },
290
+ });
291
+
292
+ // Handle the result
293
+ console.log(result);
294
+ }
295
+
296
+ run();
297
+ ```
298
+
299
+ ### Standalone function
300
+
301
+ The standalone function version of this method:
302
+
303
+ ```typescript
304
+ import { ServiceM8Core } from "servicem8/core.js";
305
+ import { attachmentsUpdateAttachments } from "servicem8/funcs/attachmentsUpdateAttachments.js";
306
+
307
+ // Use `ServiceM8Core` for best tree-shaking performance.
308
+ // You can create one instance of it to use across an application.
309
+ const serviceM8 = new ServiceM8Core({
310
+ security: {
311
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
312
+ },
313
+ });
314
+
315
+ async function run() {
316
+ const res = await attachmentsUpdateAttachments(serviceM8, {
317
+ uuid: "e28258ad-72e5-4d18-9280-984c43db4570",
318
+ attachment: {
319
+ uuid: "123e4567-07bc-4698-b15d-22b4d5d1156b",
320
+ relatedObjectUuid: "123e4567-aa29-4c42-ae6f-22b4d6e7453b",
321
+ createdByStaffUuid: "123e4567-6df3-4a46-b4ff-22b4d04b5acb",
322
+ },
323
+ });
324
+
325
+ if (!res.ok) {
326
+ throw res.error;
327
+ }
328
+
329
+ const { value: result } = res;
330
+
331
+ // Handle the result
332
+ console.log(result);
333
+ }
334
+
335
+ run();
336
+ ```
337
+
338
+ ### Parameters
339
+
340
+ | Parameter | Type | Required | Description |
341
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
342
+ | `request` | [operations.UpdateAttachmentsRequest](../../models/operations/updateattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
343
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
344
+ | `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. |
345
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
346
+
347
+ ### Response
348
+
349
+ **Promise\<[operations.UpdateAttachmentsResponse](../../models/operations/updateattachmentsresponse.md)\>**
350
+
351
+ ### Errors
352
+
353
+ | Error Type | Status Code | Content Type |
354
+ | ---------------- | ---------------- | ---------------- |
355
+ | errors.ErrorT | 400 | application/json |
356
+ | errors.APIError | 4XX, 5XX | \*/\* |
357
+
358
+ ## deleteAttachments
359
+
360
+
361
+
362
+ 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.
363
+
364
+
365
+
366
+ ### Example Usage
367
+
368
+ ```typescript
369
+ import { ServiceM8 } from "servicem8";
370
+
371
+ const serviceM8 = new ServiceM8({
372
+ security: {
373
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
374
+ },
375
+ });
376
+
377
+ async function run() {
378
+ const result = await serviceM8.attachments.deleteAttachments({
379
+ uuid: "39745876-b698-4202-be4c-9f2bf94c8294",
380
+ });
381
+
382
+ // Handle the result
383
+ console.log(result);
384
+ }
385
+
386
+ run();
387
+ ```
388
+
389
+ ### Standalone function
390
+
391
+ The standalone function version of this method:
392
+
393
+ ```typescript
394
+ import { ServiceM8Core } from "servicem8/core.js";
395
+ import { attachmentsDeleteAttachments } from "servicem8/funcs/attachmentsDeleteAttachments.js";
396
+
397
+ // Use `ServiceM8Core` for best tree-shaking performance.
398
+ // You can create one instance of it to use across an application.
399
+ const serviceM8 = new ServiceM8Core({
400
+ security: {
401
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
402
+ },
403
+ });
404
+
405
+ async function run() {
406
+ const res = await attachmentsDeleteAttachments(serviceM8, {
407
+ uuid: "39745876-b698-4202-be4c-9f2bf94c8294",
408
+ });
409
+
410
+ if (!res.ok) {
411
+ throw res.error;
412
+ }
413
+
414
+ const { value: result } = res;
415
+
416
+ // Handle the result
417
+ console.log(result);
418
+ }
419
+
420
+ run();
421
+ ```
422
+
423
+ ### Parameters
424
+
425
+ | Parameter | Type | Required | Description |
426
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
427
+ | `request` | [operations.DeleteAttachmentsRequest](../../models/operations/deleteattachmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
428
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
429
+ | `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. |
430
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
431
+
432
+ ### Response
433
+
434
+ **Promise\<[operations.DeleteAttachmentsResponse](../../models/operations/deleteattachmentsresponse.md)\>**
435
+
436
+ ### Errors
437
+
438
+ | Error Type | Status Code | Content Type |
439
+ | ---------------- | ---------------- | ---------------- |
440
+ | errors.ErrorT | 400 | application/json |
441
+ | errors.APIError | 4XX, 5XX | \*/\* |