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,364 @@
1
+ # Assets
2
+ (*assets*)
3
+
4
+ ## Overview
5
+
6
+ Operations related to Assets
7
+
8
+ ### Available Operations
9
+
10
+ * [listAssets](#listassets) - List all Assets
11
+ * [getAssets](#getassets) - Retrieve an Asset
12
+ * [updateAssets](#updateassets) - Update an Asset
13
+ * [deleteAssets](#deleteassets) - Delete an Asset
14
+
15
+ ## listAssets
16
+
17
+
18
+
19
+ #### Filtering
20
+ This endpoint supports result filtering. For more information on how to filter this request, [go here](/docs/filtering).
21
+
22
+
23
+ #### OAuth Scope
24
+ This endpoint requires the following OAuth scope **read_assets**.
25
+
26
+
27
+
28
+ ### Example Usage
29
+
30
+ ```typescript
31
+ import { ServiceM8 } from "servicem8";
32
+
33
+ const serviceM8 = new ServiceM8({
34
+ security: {
35
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
36
+ },
37
+ });
38
+
39
+ async function run() {
40
+ const result = await serviceM8.assets.listAssets();
41
+
42
+ // Handle the result
43
+ console.log(result);
44
+ }
45
+
46
+ run();
47
+ ```
48
+
49
+ ### Standalone function
50
+
51
+ The standalone function version of this method:
52
+
53
+ ```typescript
54
+ import { ServiceM8Core } from "servicem8/core.js";
55
+ import { assetsListAssets } from "servicem8/funcs/assetsListAssets.js";
56
+
57
+ // Use `ServiceM8Core` for best tree-shaking performance.
58
+ // You can create one instance of it to use across an application.
59
+ const serviceM8 = new ServiceM8Core({
60
+ security: {
61
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
62
+ },
63
+ });
64
+
65
+ async function run() {
66
+ const res = await assetsListAssets(serviceM8);
67
+
68
+ if (!res.ok) {
69
+ throw res.error;
70
+ }
71
+
72
+ const { value: result } = res;
73
+
74
+ // Handle the result
75
+ console.log(result);
76
+ }
77
+
78
+ run();
79
+ ```
80
+
81
+ ### Parameters
82
+
83
+ | Parameter | Type | Required | Description |
84
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
85
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
86
+ | `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. |
87
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
88
+
89
+ ### Response
90
+
91
+ **Promise\<[operations.ListAssetsResponse](../../models/operations/listassetsresponse.md)\>**
92
+
93
+ ### Errors
94
+
95
+ | Error Type | Status Code | Content Type |
96
+ | ---------------- | ---------------- | ---------------- |
97
+ | errors.ErrorT | 400 | application/json |
98
+ | errors.APIError | 4XX, 5XX | \*/\* |
99
+
100
+ ## getAssets
101
+
102
+
103
+
104
+ #### OAuth Scope
105
+ This endpoint requires the following OAuth scope **read_assets**.
106
+
107
+
108
+
109
+ ### Example Usage
110
+
111
+ ```typescript
112
+ import { ServiceM8 } from "servicem8";
113
+
114
+ const serviceM8 = new ServiceM8({
115
+ security: {
116
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
117
+ },
118
+ });
119
+
120
+ async function run() {
121
+ const result = await serviceM8.assets.getAssets({
122
+ uuid: "8eb1fa27-739c-4946-b465-dfd310714838",
123
+ });
124
+
125
+ // Handle the result
126
+ console.log(result);
127
+ }
128
+
129
+ run();
130
+ ```
131
+
132
+ ### Standalone function
133
+
134
+ The standalone function version of this method:
135
+
136
+ ```typescript
137
+ import { ServiceM8Core } from "servicem8/core.js";
138
+ import { assetsGetAssets } from "servicem8/funcs/assetsGetAssets.js";
139
+
140
+ // Use `ServiceM8Core` for best tree-shaking performance.
141
+ // You can create one instance of it to use across an application.
142
+ const serviceM8 = new ServiceM8Core({
143
+ security: {
144
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
145
+ },
146
+ });
147
+
148
+ async function run() {
149
+ const res = await assetsGetAssets(serviceM8, {
150
+ uuid: "8eb1fa27-739c-4946-b465-dfd310714838",
151
+ });
152
+
153
+ if (!res.ok) {
154
+ throw res.error;
155
+ }
156
+
157
+ const { value: result } = res;
158
+
159
+ // Handle the result
160
+ console.log(result);
161
+ }
162
+
163
+ run();
164
+ ```
165
+
166
+ ### Parameters
167
+
168
+ | Parameter | Type | Required | Description |
169
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
170
+ | `request` | [operations.GetAssetsRequest](../../models/operations/getassetsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
171
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
172
+ | `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. |
173
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
174
+
175
+ ### Response
176
+
177
+ **Promise\<[operations.GetAssetsResponse](../../models/operations/getassetsresponse.md)\>**
178
+
179
+ ### Errors
180
+
181
+ | Error Type | Status Code | Content Type |
182
+ | ---------------- | ---------------- | ---------------- |
183
+ | errors.ErrorT | 400 | application/json |
184
+ | errors.APIError | 4XX, 5XX | \*/\* |
185
+
186
+ ## updateAssets
187
+
188
+ Update an Asset
189
+
190
+ ### Example Usage
191
+
192
+ ```typescript
193
+ import { ServiceM8 } from "servicem8";
194
+
195
+ const serviceM8 = new ServiceM8({
196
+ security: {
197
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
198
+ },
199
+ });
200
+
201
+ async function run() {
202
+ const result = await serviceM8.assets.updateAssets({
203
+ uuid: "6722d620-da15-4c25-9986-572ac1041593",
204
+ asset: {
205
+ uuid: "123e4567-ae39-46c1-9052-22b4d002e90b",
206
+ companyUuid: "123e4567-7127-4d5d-968a-22b4d53438eb",
207
+ assetTypeUuid: "123e4567-41f4-4c6c-934a-22b4d5af612b",
208
+ name: "<value>",
209
+ geoTimestamp: "YYYY-MM-DD HH:MM:SS",
210
+ },
211
+ });
212
+
213
+ // Handle the result
214
+ console.log(result);
215
+ }
216
+
217
+ run();
218
+ ```
219
+
220
+ ### Standalone function
221
+
222
+ The standalone function version of this method:
223
+
224
+ ```typescript
225
+ import { ServiceM8Core } from "servicem8/core.js";
226
+ import { assetsUpdateAssets } from "servicem8/funcs/assetsUpdateAssets.js";
227
+
228
+ // Use `ServiceM8Core` for best tree-shaking performance.
229
+ // You can create one instance of it to use across an application.
230
+ const serviceM8 = new ServiceM8Core({
231
+ security: {
232
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
233
+ },
234
+ });
235
+
236
+ async function run() {
237
+ const res = await assetsUpdateAssets(serviceM8, {
238
+ uuid: "6722d620-da15-4c25-9986-572ac1041593",
239
+ asset: {
240
+ uuid: "123e4567-ae39-46c1-9052-22b4d002e90b",
241
+ companyUuid: "123e4567-7127-4d5d-968a-22b4d53438eb",
242
+ assetTypeUuid: "123e4567-41f4-4c6c-934a-22b4d5af612b",
243
+ name: "<value>",
244
+ geoTimestamp: "YYYY-MM-DD HH:MM:SS",
245
+ },
246
+ });
247
+
248
+ if (!res.ok) {
249
+ throw res.error;
250
+ }
251
+
252
+ const { value: result } = res;
253
+
254
+ // Handle the result
255
+ console.log(result);
256
+ }
257
+
258
+ run();
259
+ ```
260
+
261
+ ### Parameters
262
+
263
+ | Parameter | Type | Required | Description |
264
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
265
+ | `request` | [operations.UpdateAssetsRequest](../../models/operations/updateassetsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
266
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
267
+ | `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. |
268
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
269
+
270
+ ### Response
271
+
272
+ **Promise\<[operations.UpdateAssetsResponse](../../models/operations/updateassetsresponse.md)\>**
273
+
274
+ ### Errors
275
+
276
+ | Error Type | Status Code | Content Type |
277
+ | ---------------- | ---------------- | ---------------- |
278
+ | errors.ErrorT | 400 | application/json |
279
+ | errors.APIError | 4XX, 5XX | \*/\* |
280
+
281
+ ## deleteAssets
282
+
283
+
284
+
285
+ 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.
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.assets.deleteAssets({
302
+ uuid: "08c79778-2e1b-42dd-a9de-5ce4bf6cd898",
303
+ });
304
+
305
+ // Handle the result
306
+ console.log(result);
307
+ }
308
+
309
+ run();
310
+ ```
311
+
312
+ ### Standalone function
313
+
314
+ The standalone function version of this method:
315
+
316
+ ```typescript
317
+ import { ServiceM8Core } from "servicem8/core.js";
318
+ import { assetsDeleteAssets } from "servicem8/funcs/assetsDeleteAssets.js";
319
+
320
+ // Use `ServiceM8Core` for best tree-shaking performance.
321
+ // You can create one instance of it to use across an application.
322
+ const serviceM8 = new ServiceM8Core({
323
+ security: {
324
+ oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
325
+ },
326
+ });
327
+
328
+ async function run() {
329
+ const res = await assetsDeleteAssets(serviceM8, {
330
+ uuid: "08c79778-2e1b-42dd-a9de-5ce4bf6cd898",
331
+ });
332
+
333
+ if (!res.ok) {
334
+ throw res.error;
335
+ }
336
+
337
+ const { value: result } = res;
338
+
339
+ // Handle the result
340
+ console.log(result);
341
+ }
342
+
343
+ run();
344
+ ```
345
+
346
+ ### Parameters
347
+
348
+ | Parameter | Type | Required | Description |
349
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
350
+ | `request` | [operations.DeleteAssetsRequest](../../models/operations/deleteassetsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
351
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
352
+ | `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. |
353
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
354
+
355
+ ### Response
356
+
357
+ **Promise\<[operations.DeleteAssetsResponse](../../models/operations/deleteassetsresponse.md)\>**
358
+
359
+ ### Errors
360
+
361
+ | Error Type | Status Code | Content Type |
362
+ | ---------------- | ---------------- | ---------------- |
363
+ | errors.ErrorT | 400 | application/json |
364
+ | errors.APIError | 4XX, 5XX | \*/\* |