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,448 @@
1
+ # AssetTypes
2
+ (*assetTypes*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Asset Types
7
+
8
+ ### Available Operations
9
+
10
+ * [listAssetTypes](#listassettypes) - List all Asset Types
11
+ * [createAssetTypes](#createassettypes) - Create a new Asset Type
12
+ * [getAssetTypes](#getassettypes) - Retrieve an Asset Type
13
+ * [updateAssetTypes](#updateassettypes) - Update an Asset Type
14
+ * [deleteAssetTypes](#deleteassettypes) - Delete an Asset Type
15
+
16
+ ## listAssetTypes
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_assets**.
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.assetTypes.listAssetTypes();
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 { assetTypesListAssetTypes } from "servicem8/funcs/assetTypesListAssetTypes.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 assetTypesListAssetTypes(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.ListAssetTypesResponse](../../models/operations/listassettypesresponse.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
+ ## createAssetTypes
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_assets**.
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.assetTypes.createAssetTypes({
128
+ uuid: "123e4567-6271-4eaa-9cd3-22b4d8f3e59b",
129
+ });
130
+
131
+ // Handle the result
132
+ console.log(result);
133
+ }
134
+
135
+ run();
136
+ ```
137
+
138
+ ### Standalone function
139
+
140
+ The standalone function version of this method:
141
+
142
+ ```typescript
143
+ import { ServiceM8Core } from "servicem8/core.js";
144
+ import { assetTypesCreateAssetTypes } from "servicem8/funcs/assetTypesCreateAssetTypes.js";
145
+
146
+ // Use `ServiceM8Core` for best tree-shaking performance.
147
+ // You can create one instance of it to use across an application.
148
+ const serviceM8 = new ServiceM8Core({
149
+ security: {
150
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
151
+ },
152
+ });
153
+
154
+ async function run() {
155
+ const res = await assetTypesCreateAssetTypes(serviceM8, {
156
+ uuid: "123e4567-6271-4eaa-9cd3-22b4d8f3e59b",
157
+ });
158
+
159
+ if (!res.ok) {
160
+ throw res.error;
161
+ }
162
+
163
+ const { value: result } = res;
164
+
165
+ // Handle the result
166
+ console.log(result);
167
+ }
168
+
169
+ run();
170
+ ```
171
+
172
+ ### Parameters
173
+
174
+ | Parameter | Type | Required | Description |
175
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
176
+ | `request` | [components.AssetTypeInput](../../models/components/assettypeinput.md) | :heavy_check_mark: | The request object to use for the request. |
177
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
178
+ | `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. |
179
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
180
+
181
+ ### Response
182
+
183
+ **Promise\<[operations.CreateAssetTypesResponse](../../models/operations/createassettypesresponse.md)\>**
184
+
185
+ ### Errors
186
+
187
+ | Error Type | Status Code | Content Type |
188
+ | ---------------- | ---------------- | ---------------- |
189
+ | errors.ErrorT | 400 | application/json |
190
+ | errors.APIError | 4XX, 5XX | \*/\* |
191
+
192
+ ## getAssetTypes
193
+
194
+
195
+
196
+ #### OAuth Scope
197
+ This endpoint requires the following OAuth scope **read_assets**.
198
+
199
+
200
+
201
+ ### Example Usage
202
+
203
+ ```typescript
204
+ import { ServiceM8 } from "servicem8";
205
+
206
+ const serviceM8 = new ServiceM8({
207
+ security: {
208
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
209
+ },
210
+ });
211
+
212
+ async function run() {
213
+ const result = await serviceM8.assetTypes.getAssetTypes({
214
+ uuid: "60d92c37-ec9f-444d-be47-2661b6ad833a",
215
+ });
216
+
217
+ // Handle the result
218
+ console.log(result);
219
+ }
220
+
221
+ run();
222
+ ```
223
+
224
+ ### Standalone function
225
+
226
+ The standalone function version of this method:
227
+
228
+ ```typescript
229
+ import { ServiceM8Core } from "servicem8/core.js";
230
+ import { assetTypesGetAssetTypes } from "servicem8/funcs/assetTypesGetAssetTypes.js";
231
+
232
+ // Use `ServiceM8Core` for best tree-shaking performance.
233
+ // You can create one instance of it to use across an application.
234
+ const serviceM8 = new ServiceM8Core({
235
+ security: {
236
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
237
+ },
238
+ });
239
+
240
+ async function run() {
241
+ const res = await assetTypesGetAssetTypes(serviceM8, {
242
+ uuid: "60d92c37-ec9f-444d-be47-2661b6ad833a",
243
+ });
244
+
245
+ if (!res.ok) {
246
+ throw res.error;
247
+ }
248
+
249
+ const { value: result } = res;
250
+
251
+ // Handle the result
252
+ console.log(result);
253
+ }
254
+
255
+ run();
256
+ ```
257
+
258
+ ### Parameters
259
+
260
+ | Parameter | Type | Required | Description |
261
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
262
+ | `request` | [operations.GetAssetTypesRequest](../../models/operations/getassettypesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
263
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
264
+ | `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. |
265
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
266
+
267
+ ### Response
268
+
269
+ **Promise\<[operations.GetAssetTypesResponse](../../models/operations/getassettypesresponse.md)\>**
270
+
271
+ ### Errors
272
+
273
+ | Error Type | Status Code | Content Type |
274
+ | ---------------- | ---------------- | ---------------- |
275
+ | errors.ErrorT | 400 | application/json |
276
+ | errors.APIError | 4XX, 5XX | \*/\* |
277
+
278
+ ## updateAssetTypes
279
+
280
+ Update an Asset Type
281
+
282
+ ### Example Usage
283
+
284
+ ```typescript
285
+ import { ServiceM8 } from "servicem8";
286
+
287
+ const serviceM8 = new ServiceM8({
288
+ security: {
289
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
290
+ },
291
+ });
292
+
293
+ async function run() {
294
+ const result = await serviceM8.assetTypes.updateAssetTypes({
295
+ uuid: "533258a6-a77b-40f0-81c1-0888e3215102",
296
+ assetType: {
297
+ uuid: "123e4567-6271-4eaa-9cd3-22b4d8f3e59b",
298
+ },
299
+ });
300
+
301
+ // Handle the result
302
+ console.log(result);
303
+ }
304
+
305
+ run();
306
+ ```
307
+
308
+ ### Standalone function
309
+
310
+ The standalone function version of this method:
311
+
312
+ ```typescript
313
+ import { ServiceM8Core } from "servicem8/core.js";
314
+ import { assetTypesUpdateAssetTypes } from "servicem8/funcs/assetTypesUpdateAssetTypes.js";
315
+
316
+ // Use `ServiceM8Core` for best tree-shaking performance.
317
+ // You can create one instance of it to use across an application.
318
+ const serviceM8 = new ServiceM8Core({
319
+ security: {
320
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
321
+ },
322
+ });
323
+
324
+ async function run() {
325
+ const res = await assetTypesUpdateAssetTypes(serviceM8, {
326
+ uuid: "533258a6-a77b-40f0-81c1-0888e3215102",
327
+ assetType: {
328
+ uuid: "123e4567-6271-4eaa-9cd3-22b4d8f3e59b",
329
+ },
330
+ });
331
+
332
+ if (!res.ok) {
333
+ throw res.error;
334
+ }
335
+
336
+ const { value: result } = res;
337
+
338
+ // Handle the result
339
+ console.log(result);
340
+ }
341
+
342
+ run();
343
+ ```
344
+
345
+ ### Parameters
346
+
347
+ | Parameter | Type | Required | Description |
348
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
349
+ | `request` | [operations.UpdateAssetTypesRequest](../../models/operations/updateassettypesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
350
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
351
+ | `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. |
352
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
353
+
354
+ ### Response
355
+
356
+ **Promise\<[operations.UpdateAssetTypesResponse](../../models/operations/updateassettypesresponse.md)\>**
357
+
358
+ ### Errors
359
+
360
+ | Error Type | Status Code | Content Type |
361
+ | ---------------- | ---------------- | ---------------- |
362
+ | errors.ErrorT | 400 | application/json |
363
+ | errors.APIError | 4XX, 5XX | \*/\* |
364
+
365
+ ## deleteAssetTypes
366
+
367
+
368
+
369
+ 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.
370
+
371
+
372
+
373
+ ### Example Usage
374
+
375
+ ```typescript
376
+ import { ServiceM8 } from "servicem8";
377
+
378
+ const serviceM8 = new ServiceM8({
379
+ security: {
380
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
381
+ },
382
+ });
383
+
384
+ async function run() {
385
+ const result = await serviceM8.assetTypes.deleteAssetTypes({
386
+ uuid: "ce66b3b1-ed5d-4c84-bc4a-d2042accb19f",
387
+ });
388
+
389
+ // Handle the result
390
+ console.log(result);
391
+ }
392
+
393
+ run();
394
+ ```
395
+
396
+ ### Standalone function
397
+
398
+ The standalone function version of this method:
399
+
400
+ ```typescript
401
+ import { ServiceM8Core } from "servicem8/core.js";
402
+ import { assetTypesDeleteAssetTypes } from "servicem8/funcs/assetTypesDeleteAssetTypes.js";
403
+
404
+ // Use `ServiceM8Core` for best tree-shaking performance.
405
+ // You can create one instance of it to use across an application.
406
+ const serviceM8 = new ServiceM8Core({
407
+ security: {
408
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
409
+ },
410
+ });
411
+
412
+ async function run() {
413
+ const res = await assetTypesDeleteAssetTypes(serviceM8, {
414
+ uuid: "ce66b3b1-ed5d-4c84-bc4a-d2042accb19f",
415
+ });
416
+
417
+ if (!res.ok) {
418
+ throw res.error;
419
+ }
420
+
421
+ const { value: result } = res;
422
+
423
+ // Handle the result
424
+ console.log(result);
425
+ }
426
+
427
+ run();
428
+ ```
429
+
430
+ ### Parameters
431
+
432
+ | Parameter | Type | Required | Description |
433
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
434
+ | `request` | [operations.DeleteAssetTypesRequest](../../models/operations/deleteassettypesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
435
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
436
+ | `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. |
437
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
438
+
439
+ ### Response
440
+
441
+ **Promise\<[operations.DeleteAssetTypesResponse](../../models/operations/deleteassettypesresponse.md)\>**
442
+
443
+ ### Errors
444
+
445
+ | Error Type | Status Code | Content Type |
446
+ | ---------------- | ---------------- | ---------------- |
447
+ | errors.ErrorT | 400 | application/json |
448
+ | errors.APIError | 4XX, 5XX | \*/\* |