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,437 @@
1
+ # Forms
2
+ (*forms*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Forms
7
+
8
+ ### Available Operations
9
+
10
+ * [listForms](#listforms) - List all Forms
11
+ * [createForms](#createforms) - Create a new Form
12
+ * [getForms](#getforms) - Retrieve a Form
13
+ * [updateForms](#updateforms) - Update a Form
14
+ * [deleteForms](#deleteforms) - Delete a Form
15
+
16
+ ## listForms
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.forms.listForms();
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 { formsListForms } from "servicem8/funcs/formsListForms.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 formsListForms(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.ListFormsResponse](../../models/operations/listformsresponse.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
+ ## createForms
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.forms.createForms({
118
+ uuid: "123e4567-5db4-40f4-a301-22b4dd7f402b",
119
+ documentTemplateUuid: "123e4567-d467-40de-924d-22b4da1881bb",
120
+ });
121
+
122
+ // Handle the result
123
+ console.log(result);
124
+ }
125
+
126
+ run();
127
+ ```
128
+
129
+ ### Standalone function
130
+
131
+ The standalone function version of this method:
132
+
133
+ ```typescript
134
+ import { ServiceM8Core } from "servicem8/core.js";
135
+ import { formsCreateForms } from "servicem8/funcs/formsCreateForms.js";
136
+
137
+ // Use `ServiceM8Core` for best tree-shaking performance.
138
+ // You can create one instance of it to use across an application.
139
+ const serviceM8 = new ServiceM8Core({
140
+ security: {
141
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
142
+ },
143
+ });
144
+
145
+ async function run() {
146
+ const res = await formsCreateForms(serviceM8, {
147
+ uuid: "123e4567-5db4-40f4-a301-22b4dd7f402b",
148
+ documentTemplateUuid: "123e4567-d467-40de-924d-22b4da1881bb",
149
+ });
150
+
151
+ if (!res.ok) {
152
+ throw res.error;
153
+ }
154
+
155
+ const { value: result } = res;
156
+
157
+ // Handle the result
158
+ console.log(result);
159
+ }
160
+
161
+ run();
162
+ ```
163
+
164
+ ### Parameters
165
+
166
+ | Parameter | Type | Required | Description |
167
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
168
+ | `request` | [components.FormInput](../../models/components/forminput.md) | :heavy_check_mark: | The request object to use for the request. |
169
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
170
+ | `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. |
171
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
172
+
173
+ ### Response
174
+
175
+ **Promise\<[operations.CreateFormsResponse](../../models/operations/createformsresponse.md)\>**
176
+
177
+ ### Errors
178
+
179
+ | Error Type | Status Code | Content Type |
180
+ | ---------------- | ---------------- | ---------------- |
181
+ | errors.ErrorT | 400 | application/json |
182
+ | errors.APIError | 4XX, 5XX | \*/\* |
183
+
184
+ ## getForms
185
+
186
+ Retrieve a Form
187
+
188
+ ### Example Usage
189
+
190
+ ```typescript
191
+ import { ServiceM8 } from "servicem8";
192
+
193
+ const serviceM8 = new ServiceM8({
194
+ security: {
195
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
196
+ },
197
+ });
198
+
199
+ async function run() {
200
+ const result = await serviceM8.forms.getForms({
201
+ uuid: "56e285a2-c6af-4c67-87b1-6ba5832617e0",
202
+ });
203
+
204
+ // Handle the result
205
+ console.log(result);
206
+ }
207
+
208
+ run();
209
+ ```
210
+
211
+ ### Standalone function
212
+
213
+ The standalone function version of this method:
214
+
215
+ ```typescript
216
+ import { ServiceM8Core } from "servicem8/core.js";
217
+ import { formsGetForms } from "servicem8/funcs/formsGetForms.js";
218
+
219
+ // Use `ServiceM8Core` for best tree-shaking performance.
220
+ // You can create one instance of it to use across an application.
221
+ const serviceM8 = new ServiceM8Core({
222
+ security: {
223
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
224
+ },
225
+ });
226
+
227
+ async function run() {
228
+ const res = await formsGetForms(serviceM8, {
229
+ uuid: "56e285a2-c6af-4c67-87b1-6ba5832617e0",
230
+ });
231
+
232
+ if (!res.ok) {
233
+ throw res.error;
234
+ }
235
+
236
+ const { value: result } = res;
237
+
238
+ // Handle the result
239
+ console.log(result);
240
+ }
241
+
242
+ run();
243
+ ```
244
+
245
+ ### Parameters
246
+
247
+ | Parameter | Type | Required | Description |
248
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
249
+ | `request` | [operations.GetFormsRequest](../../models/operations/getformsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
250
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
251
+ | `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. |
252
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
253
+
254
+ ### Response
255
+
256
+ **Promise\<[operations.GetFormsResponse](../../models/operations/getformsresponse.md)\>**
257
+
258
+ ### Errors
259
+
260
+ | Error Type | Status Code | Content Type |
261
+ | ---------------- | ---------------- | ---------------- |
262
+ | errors.ErrorT | 400 | application/json |
263
+ | errors.APIError | 4XX, 5XX | \*/\* |
264
+
265
+ ## updateForms
266
+
267
+ Update a Form
268
+
269
+ ### Example Usage
270
+
271
+ ```typescript
272
+ import { ServiceM8 } from "servicem8";
273
+
274
+ const serviceM8 = new ServiceM8({
275
+ security: {
276
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
277
+ },
278
+ });
279
+
280
+ async function run() {
281
+ const result = await serviceM8.forms.updateForms({
282
+ uuid: "bb397553-eb0b-4e65-89e5-bfd6db4fee68",
283
+ form: {
284
+ uuid: "123e4567-5db4-40f4-a301-22b4dd7f402b",
285
+ documentTemplateUuid: "123e4567-d467-40de-924d-22b4da1881bb",
286
+ },
287
+ });
288
+
289
+ // Handle the result
290
+ console.log(result);
291
+ }
292
+
293
+ run();
294
+ ```
295
+
296
+ ### Standalone function
297
+
298
+ The standalone function version of this method:
299
+
300
+ ```typescript
301
+ import { ServiceM8Core } from "servicem8/core.js";
302
+ import { formsUpdateForms } from "servicem8/funcs/formsUpdateForms.js";
303
+
304
+ // Use `ServiceM8Core` for best tree-shaking performance.
305
+ // You can create one instance of it to use across an application.
306
+ const serviceM8 = new ServiceM8Core({
307
+ security: {
308
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
309
+ },
310
+ });
311
+
312
+ async function run() {
313
+ const res = await formsUpdateForms(serviceM8, {
314
+ uuid: "bb397553-eb0b-4e65-89e5-bfd6db4fee68",
315
+ form: {
316
+ uuid: "123e4567-5db4-40f4-a301-22b4dd7f402b",
317
+ documentTemplateUuid: "123e4567-d467-40de-924d-22b4da1881bb",
318
+ },
319
+ });
320
+
321
+ if (!res.ok) {
322
+ throw res.error;
323
+ }
324
+
325
+ const { value: result } = res;
326
+
327
+ // Handle the result
328
+ console.log(result);
329
+ }
330
+
331
+ run();
332
+ ```
333
+
334
+ ### Parameters
335
+
336
+ | Parameter | Type | Required | Description |
337
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
338
+ | `request` | [operations.UpdateFormsRequest](../../models/operations/updateformsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
339
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
340
+ | `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. |
341
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
342
+
343
+ ### Response
344
+
345
+ **Promise\<[operations.UpdateFormsResponse](../../models/operations/updateformsresponse.md)\>**
346
+
347
+ ### Errors
348
+
349
+ | Error Type | Status Code | Content Type |
350
+ | ---------------- | ---------------- | ---------------- |
351
+ | errors.ErrorT | 400 | application/json |
352
+ | errors.APIError | 4XX, 5XX | \*/\* |
353
+
354
+ ## deleteForms
355
+
356
+
357
+
358
+ 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.
359
+
360
+
361
+
362
+ ### Example Usage
363
+
364
+ ```typescript
365
+ import { ServiceM8 } from "servicem8";
366
+
367
+ const serviceM8 = new ServiceM8({
368
+ security: {
369
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
370
+ },
371
+ });
372
+
373
+ async function run() {
374
+ const result = await serviceM8.forms.deleteForms({
375
+ uuid: "eae94b1e-10d9-4270-bca0-cbe1c887f39a",
376
+ });
377
+
378
+ // Handle the result
379
+ console.log(result);
380
+ }
381
+
382
+ run();
383
+ ```
384
+
385
+ ### Standalone function
386
+
387
+ The standalone function version of this method:
388
+
389
+ ```typescript
390
+ import { ServiceM8Core } from "servicem8/core.js";
391
+ import { formsDeleteForms } from "servicem8/funcs/formsDeleteForms.js";
392
+
393
+ // Use `ServiceM8Core` for best tree-shaking performance.
394
+ // You can create one instance of it to use across an application.
395
+ const serviceM8 = new ServiceM8Core({
396
+ security: {
397
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
398
+ },
399
+ });
400
+
401
+ async function run() {
402
+ const res = await formsDeleteForms(serviceM8, {
403
+ uuid: "eae94b1e-10d9-4270-bca0-cbe1c887f39a",
404
+ });
405
+
406
+ if (!res.ok) {
407
+ throw res.error;
408
+ }
409
+
410
+ const { value: result } = res;
411
+
412
+ // Handle the result
413
+ console.log(result);
414
+ }
415
+
416
+ run();
417
+ ```
418
+
419
+ ### Parameters
420
+
421
+ | Parameter | Type | Required | Description |
422
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
423
+ | `request` | [operations.DeleteFormsRequest](../../models/operations/deleteformsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
424
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
425
+ | `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. |
426
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
427
+
428
+ ### Response
429
+
430
+ **Promise\<[operations.DeleteFormsResponse](../../models/operations/deleteformsresponse.md)\>**
431
+
432
+ ### Errors
433
+
434
+ | Error Type | Status Code | Content Type |
435
+ | ---------------- | ---------------- | ---------------- |
436
+ | errors.ErrorT | 400 | application/json |
437
+ | errors.APIError | 4XX, 5XX | \*/\* |