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,452 @@
1
+ # KnowledgeArticles
2
+ (*knowledgeArticles*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Knowledge Articles
7
+
8
+ ### Available Operations
9
+
10
+ * [listKnowledgeArticles](#listknowledgearticles) - List all Knowledge Articles
11
+ * [createKnowledgeArticles](#createknowledgearticles) - Create a new Knowledge Article
12
+ * [getKnowledgeArticles](#getknowledgearticles) - Retrieve a Knowledge Article
13
+ * [updateKnowledgeArticles](#updateknowledgearticles) - Update a Knowledge Article
14
+ * [deleteKnowledgeArticles](#deleteknowledgearticles) - Delete a Knowledge Article
15
+
16
+ ## listKnowledgeArticles
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_knowledge**.
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.knowledgeArticles.listKnowledgeArticles();
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 { knowledgeArticlesListKnowledgeArticles } from "servicem8/funcs/knowledgeArticlesListKnowledgeArticles.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 knowledgeArticlesListKnowledgeArticles(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.ListKnowledgeArticlesResponse](../../models/operations/listknowledgearticlesresponse.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
+ ## createKnowledgeArticles
102
+
103
+
104
+
105
+ #### OAuth Scope
106
+ This endpoint requires the following OAuth scope **manage_knowledge**.
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.knowledgeArticles.createKnowledgeArticles({
128
+ uuid: "123e4567-c20a-4706-a59e-22b4da87904b",
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 { knowledgeArticlesCreateKnowledgeArticles } from "servicem8/funcs/knowledgeArticlesCreateKnowledgeArticles.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 knowledgeArticlesCreateKnowledgeArticles(serviceM8, {
157
+ uuid: "123e4567-c20a-4706-a59e-22b4da87904b",
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.KnowledgeArticleInput](../../models/components/knowledgearticleinput.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.CreateKnowledgeArticlesResponse](../../models/operations/createknowledgearticlesresponse.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
+ ## getKnowledgeArticles
195
+
196
+
197
+
198
+ #### OAuth Scope
199
+ This endpoint requires the following OAuth scope **read_knowledge**.
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.knowledgeArticles.getKnowledgeArticles({
216
+ uuid: "2c7d225f-8f77-49cd-9760-85e9336ff06c",
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 { knowledgeArticlesGetKnowledgeArticles } from "servicem8/funcs/knowledgeArticlesGetKnowledgeArticles.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 knowledgeArticlesGetKnowledgeArticles(serviceM8, {
244
+ uuid: "2c7d225f-8f77-49cd-9760-85e9336ff06c",
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.GetKnowledgeArticlesRequest](../../models/operations/getknowledgearticlesrequest.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.GetKnowledgeArticlesResponse](../../models/operations/getknowledgearticlesresponse.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
+ ## updateKnowledgeArticles
281
+
282
+ Update a Knowledge Article
283
+
284
+ ### Example Usage
285
+
286
+ ```typescript
287
+ import { ServiceM8 } from "servicem8";
288
+
289
+ const serviceM8 = new ServiceM8({
290
+ security: {
291
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
292
+ },
293
+ });
294
+
295
+ async function run() {
296
+ const result = await serviceM8.knowledgeArticles.updateKnowledgeArticles({
297
+ uuid: "2600c9c1-cf7f-44a6-9750-8ff52ba6b536",
298
+ knowledgeArticle: {
299
+ uuid: "123e4567-c20a-4706-a59e-22b4da87904b",
300
+ name: "<value>",
301
+ },
302
+ });
303
+
304
+ // Handle the result
305
+ console.log(result);
306
+ }
307
+
308
+ run();
309
+ ```
310
+
311
+ ### Standalone function
312
+
313
+ The standalone function version of this method:
314
+
315
+ ```typescript
316
+ import { ServiceM8Core } from "servicem8/core.js";
317
+ import { knowledgeArticlesUpdateKnowledgeArticles } from "servicem8/funcs/knowledgeArticlesUpdateKnowledgeArticles.js";
318
+
319
+ // Use `ServiceM8Core` for best tree-shaking performance.
320
+ // You can create one instance of it to use across an application.
321
+ const serviceM8 = new ServiceM8Core({
322
+ security: {
323
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
324
+ },
325
+ });
326
+
327
+ async function run() {
328
+ const res = await knowledgeArticlesUpdateKnowledgeArticles(serviceM8, {
329
+ uuid: "2600c9c1-cf7f-44a6-9750-8ff52ba6b536",
330
+ knowledgeArticle: {
331
+ uuid: "123e4567-c20a-4706-a59e-22b4da87904b",
332
+ name: "<value>",
333
+ },
334
+ });
335
+
336
+ if (!res.ok) {
337
+ throw res.error;
338
+ }
339
+
340
+ const { value: result } = res;
341
+
342
+ // Handle the result
343
+ console.log(result);
344
+ }
345
+
346
+ run();
347
+ ```
348
+
349
+ ### Parameters
350
+
351
+ | Parameter | Type | Required | Description |
352
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
353
+ | `request` | [operations.UpdateKnowledgeArticlesRequest](../../models/operations/updateknowledgearticlesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
354
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
355
+ | `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. |
356
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
357
+
358
+ ### Response
359
+
360
+ **Promise\<[operations.UpdateKnowledgeArticlesResponse](../../models/operations/updateknowledgearticlesresponse.md)\>**
361
+
362
+ ### Errors
363
+
364
+ | Error Type | Status Code | Content Type |
365
+ | ---------------- | ---------------- | ---------------- |
366
+ | errors.ErrorT | 400 | application/json |
367
+ | errors.APIError | 4XX, 5XX | \*/\* |
368
+
369
+ ## deleteKnowledgeArticles
370
+
371
+
372
+
373
+ 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.
374
+
375
+
376
+
377
+ ### Example Usage
378
+
379
+ ```typescript
380
+ import { ServiceM8 } from "servicem8";
381
+
382
+ const serviceM8 = new ServiceM8({
383
+ security: {
384
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
385
+ },
386
+ });
387
+
388
+ async function run() {
389
+ const result = await serviceM8.knowledgeArticles.deleteKnowledgeArticles({
390
+ uuid: "cc3da51c-4af1-4c84-9300-0d5b2ceb2ed1",
391
+ });
392
+
393
+ // Handle the result
394
+ console.log(result);
395
+ }
396
+
397
+ run();
398
+ ```
399
+
400
+ ### Standalone function
401
+
402
+ The standalone function version of this method:
403
+
404
+ ```typescript
405
+ import { ServiceM8Core } from "servicem8/core.js";
406
+ import { knowledgeArticlesDeleteKnowledgeArticles } from "servicem8/funcs/knowledgeArticlesDeleteKnowledgeArticles.js";
407
+
408
+ // Use `ServiceM8Core` for best tree-shaking performance.
409
+ // You can create one instance of it to use across an application.
410
+ const serviceM8 = new ServiceM8Core({
411
+ security: {
412
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
413
+ },
414
+ });
415
+
416
+ async function run() {
417
+ const res = await knowledgeArticlesDeleteKnowledgeArticles(serviceM8, {
418
+ uuid: "cc3da51c-4af1-4c84-9300-0d5b2ceb2ed1",
419
+ });
420
+
421
+ if (!res.ok) {
422
+ throw res.error;
423
+ }
424
+
425
+ const { value: result } = res;
426
+
427
+ // Handle the result
428
+ console.log(result);
429
+ }
430
+
431
+ run();
432
+ ```
433
+
434
+ ### Parameters
435
+
436
+ | Parameter | Type | Required | Description |
437
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
438
+ | `request` | [operations.DeleteKnowledgeArticlesRequest](../../models/operations/deleteknowledgearticlesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
439
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
440
+ | `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. |
441
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
442
+
443
+ ### Response
444
+
445
+ **Promise\<[operations.DeleteKnowledgeArticlesResponse](../../models/operations/deleteknowledgearticlesresponse.md)\>**
446
+
447
+ ### Errors
448
+
449
+ | Error Type | Status Code | Content Type |
450
+ | ---------------- | ---------------- | ---------------- |
451
+ | errors.ErrorT | 400 | application/json |
452
+ | errors.APIError | 4XX, 5XX | \*/\* |