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,466 @@
1
+ # Clients
2
+ (*clients*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Clients
7
+
8
+ ### Available Operations
9
+
10
+ * [listClients](#listclients) - List all Clients
11
+ * [createClients](#createclients) - Create a new Client
12
+ * [getClients](#getclients) - Retrieve a Client
13
+ * [updateClients](#updateclients) - Update a Client
14
+ * [deleteClients](#deleteclients) - Delete a Client
15
+
16
+ ## listClients
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_customers**.
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.clients.listClients();
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 { clientsListClients } from "servicem8/funcs/clientsListClients.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 clientsListClients(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.ListClientsResponse](../../models/operations/listclientsresponse.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
+ ## createClients
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_customers**.
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.clients.createClients({
128
+ uuid: "123e4567-7bbb-4453-af74-22b4d21656ab",
129
+ name: "<value>",
130
+ taxRateUuid: "123e4567-f0d3-4396-a609-22b4d94f07fb",
131
+ });
132
+
133
+ // Handle the result
134
+ console.log(result);
135
+ }
136
+
137
+ run();
138
+ ```
139
+
140
+ ### Standalone function
141
+
142
+ The standalone function version of this method:
143
+
144
+ ```typescript
145
+ import { ServiceM8Core } from "servicem8/core.js";
146
+ import { clientsCreateClients } from "servicem8/funcs/clientsCreateClients.js";
147
+
148
+ // Use `ServiceM8Core` for best tree-shaking performance.
149
+ // You can create one instance of it to use across an application.
150
+ const serviceM8 = new ServiceM8Core({
151
+ security: {
152
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
153
+ },
154
+ });
155
+
156
+ async function run() {
157
+ const res = await clientsCreateClients(serviceM8, {
158
+ uuid: "123e4567-7bbb-4453-af74-22b4d21656ab",
159
+ name: "<value>",
160
+ taxRateUuid: "123e4567-f0d3-4396-a609-22b4d94f07fb",
161
+ });
162
+
163
+ if (!res.ok) {
164
+ throw res.error;
165
+ }
166
+
167
+ const { value: result } = res;
168
+
169
+ // Handle the result
170
+ console.log(result);
171
+ }
172
+
173
+ run();
174
+ ```
175
+
176
+ ### Parameters
177
+
178
+ | Parameter | Type | Required | Description |
179
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
180
+ | `request` | [components.CompanyInput](../../models/components/companyinput.md) | :heavy_check_mark: | The request object to use for the request. |
181
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
182
+ | `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. |
183
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
184
+
185
+ ### Response
186
+
187
+ **Promise\<[operations.CreateClientsResponse](../../models/operations/createclientsresponse.md)\>**
188
+
189
+ ### Errors
190
+
191
+ | Error Type | Status Code | Content Type |
192
+ | ---------------- | ---------------- | ---------------- |
193
+ | errors.ErrorT | 400 | application/json |
194
+ | errors.APIError | 4XX, 5XX | \*/\* |
195
+
196
+ ## getClients
197
+
198
+
199
+
200
+ #### OAuth Scope
201
+ This endpoint requires the following OAuth scope **read_customers**.
202
+
203
+
204
+
205
+ ### Example Usage
206
+
207
+ ```typescript
208
+ import { ServiceM8 } from "servicem8";
209
+
210
+ const serviceM8 = new ServiceM8({
211
+ security: {
212
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
213
+ },
214
+ });
215
+
216
+ async function run() {
217
+ const result = await serviceM8.clients.getClients({
218
+ uuid: "9c1a0df8-3b93-4256-a5b9-153f2476dca2",
219
+ });
220
+
221
+ // Handle the result
222
+ console.log(result);
223
+ }
224
+
225
+ run();
226
+ ```
227
+
228
+ ### Standalone function
229
+
230
+ The standalone function version of this method:
231
+
232
+ ```typescript
233
+ import { ServiceM8Core } from "servicem8/core.js";
234
+ import { clientsGetClients } from "servicem8/funcs/clientsGetClients.js";
235
+
236
+ // Use `ServiceM8Core` for best tree-shaking performance.
237
+ // You can create one instance of it to use across an application.
238
+ const serviceM8 = new ServiceM8Core({
239
+ security: {
240
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
241
+ },
242
+ });
243
+
244
+ async function run() {
245
+ const res = await clientsGetClients(serviceM8, {
246
+ uuid: "9c1a0df8-3b93-4256-a5b9-153f2476dca2",
247
+ });
248
+
249
+ if (!res.ok) {
250
+ throw res.error;
251
+ }
252
+
253
+ const { value: result } = res;
254
+
255
+ // Handle the result
256
+ console.log(result);
257
+ }
258
+
259
+ run();
260
+ ```
261
+
262
+ ### Parameters
263
+
264
+ | Parameter | Type | Required | Description |
265
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
266
+ | `request` | [operations.GetClientsRequest](../../models/operations/getclientsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
267
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
268
+ | `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. |
269
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
270
+
271
+ ### Response
272
+
273
+ **Promise\<[operations.GetClientsResponse](../../models/operations/getclientsresponse.md)\>**
274
+
275
+ ### Errors
276
+
277
+ | Error Type | Status Code | Content Type |
278
+ | ---------------- | ---------------- | ---------------- |
279
+ | errors.ErrorT | 400 | application/json |
280
+ | errors.APIError | 4XX, 5XX | \*/\* |
281
+
282
+ ## updateClients
283
+
284
+
285
+
286
+ #### OAuth Scope
287
+ This endpoint requires the following OAuth scope **manage_customers**.
288
+
289
+
290
+
291
+ ### Example Usage
292
+
293
+ ```typescript
294
+ import { ServiceM8 } from "servicem8";
295
+
296
+ const serviceM8 = new ServiceM8({
297
+ security: {
298
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
299
+ },
300
+ });
301
+
302
+ async function run() {
303
+ const result = await serviceM8.clients.updateClients({
304
+ uuid: "f11a55dd-2ac9-459f-be84-6c4d35c68836",
305
+ company: {
306
+ uuid: "123e4567-7bbb-4453-af74-22b4d21656ab",
307
+ name: "<value>",
308
+ taxRateUuid: "123e4567-f0d3-4396-a609-22b4d94f07fb",
309
+ },
310
+ });
311
+
312
+ // Handle the result
313
+ console.log(result);
314
+ }
315
+
316
+ run();
317
+ ```
318
+
319
+ ### Standalone function
320
+
321
+ The standalone function version of this method:
322
+
323
+ ```typescript
324
+ import { ServiceM8Core } from "servicem8/core.js";
325
+ import { clientsUpdateClients } from "servicem8/funcs/clientsUpdateClients.js";
326
+
327
+ // Use `ServiceM8Core` for best tree-shaking performance.
328
+ // You can create one instance of it to use across an application.
329
+ const serviceM8 = new ServiceM8Core({
330
+ security: {
331
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
332
+ },
333
+ });
334
+
335
+ async function run() {
336
+ const res = await clientsUpdateClients(serviceM8, {
337
+ uuid: "f11a55dd-2ac9-459f-be84-6c4d35c68836",
338
+ company: {
339
+ uuid: "123e4567-7bbb-4453-af74-22b4d21656ab",
340
+ name: "<value>",
341
+ taxRateUuid: "123e4567-f0d3-4396-a609-22b4d94f07fb",
342
+ },
343
+ });
344
+
345
+ if (!res.ok) {
346
+ throw res.error;
347
+ }
348
+
349
+ const { value: result } = res;
350
+
351
+ // Handle the result
352
+ console.log(result);
353
+ }
354
+
355
+ run();
356
+ ```
357
+
358
+ ### Parameters
359
+
360
+ | Parameter | Type | Required | Description |
361
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
362
+ | `request` | [operations.UpdateClientsRequest](../../models/operations/updateclientsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
363
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
364
+ | `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. |
365
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
366
+
367
+ ### Response
368
+
369
+ **Promise\<[operations.UpdateClientsResponse](../../models/operations/updateclientsresponse.md)\>**
370
+
371
+ ### Errors
372
+
373
+ | Error Type | Status Code | Content Type |
374
+ | ---------------- | ---------------- | ---------------- |
375
+ | errors.ErrorT | 400 | application/json |
376
+ | errors.APIError | 4XX, 5XX | \*/\* |
377
+
378
+ ## deleteClients
379
+
380
+
381
+
382
+ 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.
383
+
384
+
385
+
386
+ #### OAuth Scope
387
+ This endpoint requires the following OAuth scope **manage_customers**.
388
+
389
+
390
+
391
+ ### Example Usage
392
+
393
+ ```typescript
394
+ import { ServiceM8 } from "servicem8";
395
+
396
+ const serviceM8 = new ServiceM8({
397
+ security: {
398
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
399
+ },
400
+ });
401
+
402
+ async function run() {
403
+ const result = await serviceM8.clients.deleteClients({
404
+ uuid: "a3243f68-15f9-42b3-85b8-657620337aea",
405
+ });
406
+
407
+ // Handle the result
408
+ console.log(result);
409
+ }
410
+
411
+ run();
412
+ ```
413
+
414
+ ### Standalone function
415
+
416
+ The standalone function version of this method:
417
+
418
+ ```typescript
419
+ import { ServiceM8Core } from "servicem8/core.js";
420
+ import { clientsDeleteClients } from "servicem8/funcs/clientsDeleteClients.js";
421
+
422
+ // Use `ServiceM8Core` for best tree-shaking performance.
423
+ // You can create one instance of it to use across an application.
424
+ const serviceM8 = new ServiceM8Core({
425
+ security: {
426
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
427
+ },
428
+ });
429
+
430
+ async function run() {
431
+ const res = await clientsDeleteClients(serviceM8, {
432
+ uuid: "a3243f68-15f9-42b3-85b8-657620337aea",
433
+ });
434
+
435
+ if (!res.ok) {
436
+ throw res.error;
437
+ }
438
+
439
+ const { value: result } = res;
440
+
441
+ // Handle the result
442
+ console.log(result);
443
+ }
444
+
445
+ run();
446
+ ```
447
+
448
+ ### Parameters
449
+
450
+ | Parameter | Type | Required | Description |
451
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
452
+ | `request` | [operations.DeleteClientsRequest](../../models/operations/deleteclientsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
453
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
454
+ | `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. |
455
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
456
+
457
+ ### Response
458
+
459
+ **Promise\<[operations.DeleteClientsResponse](../../models/operations/deleteclientsresponse.md)\>**
460
+
461
+ ### Errors
462
+
463
+ | Error Type | Status Code | Content Type |
464
+ | ---------------- | ---------------- | ---------------- |
465
+ | errors.ErrorT | 400 | application/json |
466
+ | errors.APIError | 4XX, 5XX | \*/\* |