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,462 @@
1
+ # Locations
2
+ (*locations*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Locations
7
+
8
+ ### Available Operations
9
+
10
+ * [listLocations](#listlocations) - List all Locations
11
+ * [createLocations](#createlocations) - Create a new Location
12
+ * [getLocations](#getlocations) - Retrieve a Location
13
+ * [updateLocations](#updatelocations) - Update a Location
14
+ * [deleteLocations](#deletelocations) - Delete a Location
15
+
16
+ ## listLocations
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_locations**.
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.locations.listLocations();
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 { locationsListLocations } from "servicem8/funcs/locationsListLocations.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 locationsListLocations(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.ListLocationsResponse](../../models/operations/listlocationsresponse.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
+ ## createLocations
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_locations**.
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.locations.createLocations({
128
+ uuid: "123e4567-05e7-48cd-a7e5-22b4d5838b3b",
129
+ name: "<value>",
130
+ });
131
+
132
+ // Handle the result
133
+ console.log(result);
134
+ }
135
+
136
+ run();
137
+ ```
138
+
139
+ ### Standalone function
140
+
141
+ The standalone function version of this method:
142
+
143
+ ```typescript
144
+ import { ServiceM8Core } from "servicem8/core.js";
145
+ import { locationsCreateLocations } from "servicem8/funcs/locationsCreateLocations.js";
146
+
147
+ // Use `ServiceM8Core` for best tree-shaking performance.
148
+ // You can create one instance of it to use across an application.
149
+ const serviceM8 = new ServiceM8Core({
150
+ security: {
151
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
152
+ },
153
+ });
154
+
155
+ async function run() {
156
+ const res = await locationsCreateLocations(serviceM8, {
157
+ uuid: "123e4567-05e7-48cd-a7e5-22b4d5838b3b",
158
+ name: "<value>",
159
+ });
160
+
161
+ if (!res.ok) {
162
+ throw res.error;
163
+ }
164
+
165
+ const { value: result } = res;
166
+
167
+ // Handle the result
168
+ console.log(result);
169
+ }
170
+
171
+ run();
172
+ ```
173
+
174
+ ### Parameters
175
+
176
+ | Parameter | Type | Required | Description |
177
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
178
+ | `request` | [components.LocationInput](../../models/components/locationinput.md) | :heavy_check_mark: | The request object to use for the request. |
179
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
180
+ | `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. |
181
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
182
+
183
+ ### Response
184
+
185
+ **Promise\<[operations.CreateLocationsResponse](../../models/operations/createlocationsresponse.md)\>**
186
+
187
+ ### Errors
188
+
189
+ | Error Type | Status Code | Content Type |
190
+ | ---------------- | ---------------- | ---------------- |
191
+ | errors.ErrorT | 400 | application/json |
192
+ | errors.APIError | 4XX, 5XX | \*/\* |
193
+
194
+ ## getLocations
195
+
196
+
197
+
198
+ #### OAuth Scope
199
+ This endpoint requires the following OAuth scope **read_locations**.
200
+
201
+
202
+
203
+ ### Example Usage
204
+
205
+ ```typescript
206
+ import { ServiceM8 } from "servicem8";
207
+
208
+ const serviceM8 = new ServiceM8({
209
+ security: {
210
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
211
+ },
212
+ });
213
+
214
+ async function run() {
215
+ const result = await serviceM8.locations.getLocations({
216
+ uuid: "7e65687e-03d3-48f0-b0b2-e5b1b278767a",
217
+ });
218
+
219
+ // Handle the result
220
+ console.log(result);
221
+ }
222
+
223
+ run();
224
+ ```
225
+
226
+ ### Standalone function
227
+
228
+ The standalone function version of this method:
229
+
230
+ ```typescript
231
+ import { ServiceM8Core } from "servicem8/core.js";
232
+ import { locationsGetLocations } from "servicem8/funcs/locationsGetLocations.js";
233
+
234
+ // Use `ServiceM8Core` for best tree-shaking performance.
235
+ // You can create one instance of it to use across an application.
236
+ const serviceM8 = new ServiceM8Core({
237
+ security: {
238
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
239
+ },
240
+ });
241
+
242
+ async function run() {
243
+ const res = await locationsGetLocations(serviceM8, {
244
+ uuid: "7e65687e-03d3-48f0-b0b2-e5b1b278767a",
245
+ });
246
+
247
+ if (!res.ok) {
248
+ throw res.error;
249
+ }
250
+
251
+ const { value: result } = res;
252
+
253
+ // Handle the result
254
+ console.log(result);
255
+ }
256
+
257
+ run();
258
+ ```
259
+
260
+ ### Parameters
261
+
262
+ | Parameter | Type | Required | Description |
263
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
264
+ | `request` | [operations.GetLocationsRequest](../../models/operations/getlocationsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
265
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
266
+ | `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. |
267
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
268
+
269
+ ### Response
270
+
271
+ **Promise\<[operations.GetLocationsResponse](../../models/operations/getlocationsresponse.md)\>**
272
+
273
+ ### Errors
274
+
275
+ | Error Type | Status Code | Content Type |
276
+ | ---------------- | ---------------- | ---------------- |
277
+ | errors.ErrorT | 400 | application/json |
278
+ | errors.APIError | 4XX, 5XX | \*/\* |
279
+
280
+ ## updateLocations
281
+
282
+
283
+
284
+ #### OAuth Scope
285
+ This endpoint requires the following OAuth scope **manage_locations**.
286
+
287
+
288
+
289
+ ### Example Usage
290
+
291
+ ```typescript
292
+ import { ServiceM8 } from "servicem8";
293
+
294
+ const serviceM8 = new ServiceM8({
295
+ security: {
296
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
297
+ },
298
+ });
299
+
300
+ async function run() {
301
+ const result = await serviceM8.locations.updateLocations({
302
+ uuid: "f05b34ba-ce1d-4329-a6e7-836cc33d661d",
303
+ location: {
304
+ uuid: "123e4567-05e7-48cd-a7e5-22b4d5838b3b",
305
+ name: "<value>",
306
+ },
307
+ });
308
+
309
+ // Handle the result
310
+ console.log(result);
311
+ }
312
+
313
+ run();
314
+ ```
315
+
316
+ ### Standalone function
317
+
318
+ The standalone function version of this method:
319
+
320
+ ```typescript
321
+ import { ServiceM8Core } from "servicem8/core.js";
322
+ import { locationsUpdateLocations } from "servicem8/funcs/locationsUpdateLocations.js";
323
+
324
+ // Use `ServiceM8Core` for best tree-shaking performance.
325
+ // You can create one instance of it to use across an application.
326
+ const serviceM8 = new ServiceM8Core({
327
+ security: {
328
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
329
+ },
330
+ });
331
+
332
+ async function run() {
333
+ const res = await locationsUpdateLocations(serviceM8, {
334
+ uuid: "f05b34ba-ce1d-4329-a6e7-836cc33d661d",
335
+ location: {
336
+ uuid: "123e4567-05e7-48cd-a7e5-22b4d5838b3b",
337
+ name: "<value>",
338
+ },
339
+ });
340
+
341
+ if (!res.ok) {
342
+ throw res.error;
343
+ }
344
+
345
+ const { value: result } = res;
346
+
347
+ // Handle the result
348
+ console.log(result);
349
+ }
350
+
351
+ run();
352
+ ```
353
+
354
+ ### Parameters
355
+
356
+ | Parameter | Type | Required | Description |
357
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
358
+ | `request` | [operations.UpdateLocationsRequest](../../models/operations/updatelocationsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
359
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
360
+ | `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. |
361
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
362
+
363
+ ### Response
364
+
365
+ **Promise\<[operations.UpdateLocationsResponse](../../models/operations/updatelocationsresponse.md)\>**
366
+
367
+ ### Errors
368
+
369
+ | Error Type | Status Code | Content Type |
370
+ | ---------------- | ---------------- | ---------------- |
371
+ | errors.ErrorT | 400 | application/json |
372
+ | errors.APIError | 4XX, 5XX | \*/\* |
373
+
374
+ ## deleteLocations
375
+
376
+
377
+
378
+ 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.
379
+
380
+
381
+
382
+ #### OAuth Scope
383
+ This endpoint requires the following OAuth scope **manage_locations**.
384
+
385
+
386
+
387
+ ### Example Usage
388
+
389
+ ```typescript
390
+ import { ServiceM8 } from "servicem8";
391
+
392
+ const serviceM8 = new ServiceM8({
393
+ security: {
394
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
395
+ },
396
+ });
397
+
398
+ async function run() {
399
+ const result = await serviceM8.locations.deleteLocations({
400
+ uuid: "937c6a5c-952a-4249-930e-2950d7cc01d7",
401
+ });
402
+
403
+ // Handle the result
404
+ console.log(result);
405
+ }
406
+
407
+ run();
408
+ ```
409
+
410
+ ### Standalone function
411
+
412
+ The standalone function version of this method:
413
+
414
+ ```typescript
415
+ import { ServiceM8Core } from "servicem8/core.js";
416
+ import { locationsDeleteLocations } from "servicem8/funcs/locationsDeleteLocations.js";
417
+
418
+ // Use `ServiceM8Core` for best tree-shaking performance.
419
+ // You can create one instance of it to use across an application.
420
+ const serviceM8 = new ServiceM8Core({
421
+ security: {
422
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
423
+ },
424
+ });
425
+
426
+ async function run() {
427
+ const res = await locationsDeleteLocations(serviceM8, {
428
+ uuid: "937c6a5c-952a-4249-930e-2950d7cc01d7",
429
+ });
430
+
431
+ if (!res.ok) {
432
+ throw res.error;
433
+ }
434
+
435
+ const { value: result } = res;
436
+
437
+ // Handle the result
438
+ console.log(result);
439
+ }
440
+
441
+ run();
442
+ ```
443
+
444
+ ### Parameters
445
+
446
+ | Parameter | Type | Required | Description |
447
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
448
+ | `request` | [operations.DeleteLocationsRequest](../../models/operations/deletelocationsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
449
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
450
+ | `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. |
451
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
452
+
453
+ ### Response
454
+
455
+ **Promise\<[operations.DeleteLocationsResponse](../../models/operations/deletelocationsresponse.md)\>**
456
+
457
+ ### Errors
458
+
459
+ | Error Type | Status Code | Content Type |
460
+ | ---------------- | ---------------- | ---------------- |
461
+ | errors.ErrorT | 400 | application/json |
462
+ | errors.APIError | 4XX, 5XX | \*/\* |