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,460 @@
1
+ # Badges
2
+ (*badges*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Badges
7
+
8
+ ### Available Operations
9
+
10
+ * [listBadges](#listbadges) - List all Badges
11
+ * [createBadges](#createbadges) - Create a new Badge
12
+ * [getBadges](#getbadges) - Retrieve a Badge
13
+ * [updateBadges](#updatebadges) - Update a Badge
14
+ * [deleteBadges](#deletebadges) - Delete a Badge
15
+
16
+ ## listBadges
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 **manage_badges**.
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.badges.listBadges();
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 { badgesListBadges } from "servicem8/funcs/badgesListBadges.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 badgesListBadges(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.ListBadgesResponse](../../models/operations/listbadgesresponse.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
+ ## createBadges
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_badges**.
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.badges.createBadges({
128
+ uuid: "123e4567-5d12-4ad5-822e-22b4de257e8b",
129
+ name: "<value>",
130
+ regardingFormUuid: "123e4567-7b64-417a-8f17-22b4d3eeb90b",
131
+ regardingAssetTypeUuid: "123e4567-75ec-4555-8285-22b4d0f6c5bb",
132
+ });
133
+
134
+ // Handle the result
135
+ console.log(result);
136
+ }
137
+
138
+ run();
139
+ ```
140
+
141
+ ### Standalone function
142
+
143
+ The standalone function version of this method:
144
+
145
+ ```typescript
146
+ import { ServiceM8Core } from "servicem8/core.js";
147
+ import { badgesCreateBadges } from "servicem8/funcs/badgesCreateBadges.js";
148
+
149
+ // Use `ServiceM8Core` for best tree-shaking performance.
150
+ // You can create one instance of it to use across an application.
151
+ const serviceM8 = new ServiceM8Core({
152
+ security: {
153
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
154
+ },
155
+ });
156
+
157
+ async function run() {
158
+ const res = await badgesCreateBadges(serviceM8, {
159
+ uuid: "123e4567-5d12-4ad5-822e-22b4de257e8b",
160
+ name: "<value>",
161
+ regardingFormUuid: "123e4567-7b64-417a-8f17-22b4d3eeb90b",
162
+ regardingAssetTypeUuid: "123e4567-75ec-4555-8285-22b4d0f6c5bb",
163
+ });
164
+
165
+ if (!res.ok) {
166
+ throw res.error;
167
+ }
168
+
169
+ const { value: result } = res;
170
+
171
+ // Handle the result
172
+ console.log(result);
173
+ }
174
+
175
+ run();
176
+ ```
177
+
178
+ ### Parameters
179
+
180
+ | Parameter | Type | Required | Description |
181
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
182
+ | `request` | [components.BadgeInput](../../models/components/badgeinput.md) | :heavy_check_mark: | The request object to use for the request. |
183
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
184
+ | `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. |
185
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
186
+
187
+ ### Response
188
+
189
+ **Promise\<[operations.CreateBadgesResponse](../../models/operations/createbadgesresponse.md)\>**
190
+
191
+ ### Errors
192
+
193
+ | Error Type | Status Code | Content Type |
194
+ | ---------------- | ---------------- | ---------------- |
195
+ | errors.ErrorT | 400 | application/json |
196
+ | errors.APIError | 4XX, 5XX | \*/\* |
197
+
198
+ ## getBadges
199
+
200
+
201
+
202
+ #### OAuth Scope
203
+ This endpoint requires the following OAuth scope **manage_badges**.
204
+
205
+
206
+
207
+ ### Example Usage
208
+
209
+ ```typescript
210
+ import { ServiceM8 } from "servicem8";
211
+
212
+ const serviceM8 = new ServiceM8({
213
+ security: {
214
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
215
+ },
216
+ });
217
+
218
+ async function run() {
219
+ const result = await serviceM8.badges.getBadges({
220
+ uuid: "c714ee05-601d-45d9-8e91-f4918cce018c",
221
+ });
222
+
223
+ // Handle the result
224
+ console.log(result);
225
+ }
226
+
227
+ run();
228
+ ```
229
+
230
+ ### Standalone function
231
+
232
+ The standalone function version of this method:
233
+
234
+ ```typescript
235
+ import { ServiceM8Core } from "servicem8/core.js";
236
+ import { badgesGetBadges } from "servicem8/funcs/badgesGetBadges.js";
237
+
238
+ // Use `ServiceM8Core` for best tree-shaking performance.
239
+ // You can create one instance of it to use across an application.
240
+ const serviceM8 = new ServiceM8Core({
241
+ security: {
242
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
243
+ },
244
+ });
245
+
246
+ async function run() {
247
+ const res = await badgesGetBadges(serviceM8, {
248
+ uuid: "c714ee05-601d-45d9-8e91-f4918cce018c",
249
+ });
250
+
251
+ if (!res.ok) {
252
+ throw res.error;
253
+ }
254
+
255
+ const { value: result } = res;
256
+
257
+ // Handle the result
258
+ console.log(result);
259
+ }
260
+
261
+ run();
262
+ ```
263
+
264
+ ### Parameters
265
+
266
+ | Parameter | Type | Required | Description |
267
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
268
+ | `request` | [operations.GetBadgesRequest](../../models/operations/getbadgesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
269
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
270
+ | `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. |
271
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
272
+
273
+ ### Response
274
+
275
+ **Promise\<[operations.GetBadgesResponse](../../models/operations/getbadgesresponse.md)\>**
276
+
277
+ ### Errors
278
+
279
+ | Error Type | Status Code | Content Type |
280
+ | ---------------- | ---------------- | ---------------- |
281
+ | errors.ErrorT | 400 | application/json |
282
+ | errors.APIError | 4XX, 5XX | \*/\* |
283
+
284
+ ## updateBadges
285
+
286
+ Update a Badge
287
+
288
+ ### Example Usage
289
+
290
+ ```typescript
291
+ import { ServiceM8 } from "servicem8";
292
+
293
+ const serviceM8 = new ServiceM8({
294
+ security: {
295
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
296
+ },
297
+ });
298
+
299
+ async function run() {
300
+ const result = await serviceM8.badges.updateBadges({
301
+ uuid: "baaf4b5b-290b-4da2-91a9-cd052d299937",
302
+ badge: {
303
+ uuid: "123e4567-5d12-4ad5-822e-22b4de257e8b",
304
+ name: "<value>",
305
+ regardingFormUuid: "123e4567-7b64-417a-8f17-22b4d3eeb90b",
306
+ regardingAssetTypeUuid: "123e4567-75ec-4555-8285-22b4d0f6c5bb",
307
+ },
308
+ });
309
+
310
+ // Handle the result
311
+ console.log(result);
312
+ }
313
+
314
+ run();
315
+ ```
316
+
317
+ ### Standalone function
318
+
319
+ The standalone function version of this method:
320
+
321
+ ```typescript
322
+ import { ServiceM8Core } from "servicem8/core.js";
323
+ import { badgesUpdateBadges } from "servicem8/funcs/badgesUpdateBadges.js";
324
+
325
+ // Use `ServiceM8Core` for best tree-shaking performance.
326
+ // You can create one instance of it to use across an application.
327
+ const serviceM8 = new ServiceM8Core({
328
+ security: {
329
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
330
+ },
331
+ });
332
+
333
+ async function run() {
334
+ const res = await badgesUpdateBadges(serviceM8, {
335
+ uuid: "baaf4b5b-290b-4da2-91a9-cd052d299937",
336
+ badge: {
337
+ uuid: "123e4567-5d12-4ad5-822e-22b4de257e8b",
338
+ name: "<value>",
339
+ regardingFormUuid: "123e4567-7b64-417a-8f17-22b4d3eeb90b",
340
+ regardingAssetTypeUuid: "123e4567-75ec-4555-8285-22b4d0f6c5bb",
341
+ },
342
+ });
343
+
344
+ if (!res.ok) {
345
+ throw res.error;
346
+ }
347
+
348
+ const { value: result } = res;
349
+
350
+ // Handle the result
351
+ console.log(result);
352
+ }
353
+
354
+ run();
355
+ ```
356
+
357
+ ### Parameters
358
+
359
+ | Parameter | Type | Required | Description |
360
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
361
+ | `request` | [operations.UpdateBadgesRequest](../../models/operations/updatebadgesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
362
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
363
+ | `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. |
364
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
365
+
366
+ ### Response
367
+
368
+ **Promise\<[operations.UpdateBadgesResponse](../../models/operations/updatebadgesresponse.md)\>**
369
+
370
+ ### Errors
371
+
372
+ | Error Type | Status Code | Content Type |
373
+ | ---------------- | ---------------- | ---------------- |
374
+ | errors.ErrorT | 400 | application/json |
375
+ | errors.APIError | 4XX, 5XX | \*/\* |
376
+
377
+ ## deleteBadges
378
+
379
+
380
+
381
+ 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.
382
+
383
+
384
+
385
+ ### Example Usage
386
+
387
+ ```typescript
388
+ import { ServiceM8 } from "servicem8";
389
+
390
+ const serviceM8 = new ServiceM8({
391
+ security: {
392
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
393
+ },
394
+ });
395
+
396
+ async function run() {
397
+ const result = await serviceM8.badges.deleteBadges({
398
+ uuid: "2b2625d6-0f11-4829-b4cc-986b89602c82",
399
+ });
400
+
401
+ // Handle the result
402
+ console.log(result);
403
+ }
404
+
405
+ run();
406
+ ```
407
+
408
+ ### Standalone function
409
+
410
+ The standalone function version of this method:
411
+
412
+ ```typescript
413
+ import { ServiceM8Core } from "servicem8/core.js";
414
+ import { badgesDeleteBadges } from "servicem8/funcs/badgesDeleteBadges.js";
415
+
416
+ // Use `ServiceM8Core` for best tree-shaking performance.
417
+ // You can create one instance of it to use across an application.
418
+ const serviceM8 = new ServiceM8Core({
419
+ security: {
420
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
421
+ },
422
+ });
423
+
424
+ async function run() {
425
+ const res = await badgesDeleteBadges(serviceM8, {
426
+ uuid: "2b2625d6-0f11-4829-b4cc-986b89602c82",
427
+ });
428
+
429
+ if (!res.ok) {
430
+ throw res.error;
431
+ }
432
+
433
+ const { value: result } = res;
434
+
435
+ // Handle the result
436
+ console.log(result);
437
+ }
438
+
439
+ run();
440
+ ```
441
+
442
+ ### Parameters
443
+
444
+ | Parameter | Type | Required | Description |
445
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
446
+ | `request` | [operations.DeleteBadgesRequest](../../models/operations/deletebadgesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
447
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
448
+ | `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. |
449
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
450
+
451
+ ### Response
452
+
453
+ **Promise\<[operations.DeleteBadgesResponse](../../models/operations/deletebadgesresponse.md)\>**
454
+
455
+ ### Errors
456
+
457
+ | Error Type | Status Code | Content Type |
458
+ | ---------------- | ---------------- | ---------------- |
459
+ | errors.ErrorT | 400 | application/json |
460
+ | errors.APIError | 4XX, 5XX | \*/\* |