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.
- package/.devcontainer/README.md +30 -0
- package/bin/mcp-server.js +5 -5
- package/bin/mcp-server.js.map +4 -4
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/docs/sdks/allocationwindows/README.md +433 -0
- package/docs/sdks/assets/README.md +364 -0
- package/docs/sdks/assettypefields/README.md +456 -0
- package/docs/sdks/assettypes/README.md +448 -0
- package/docs/sdks/attachments/README.md +441 -0
- package/docs/sdks/badges/README.md +460 -0
- package/docs/sdks/bundles/README.md +437 -0
- package/docs/sdks/categories/README.md +462 -0
- package/docs/sdks/clients/README.md +466 -0
- package/docs/sdks/companycontacts/README.md +462 -0
- package/docs/sdks/emailtemplates/README.md +437 -0
- package/docs/sdks/feedback/README.md +437 -0
- package/docs/sdks/formfields/README.md +437 -0
- package/docs/sdks/formresponses/README.md +461 -0
- package/docs/sdks/forms/README.md +437 -0
- package/docs/sdks/jobactivities/README.md +490 -0
- package/docs/sdks/joballocations/README.md +492 -0
- package/docs/sdks/jobchecklists/README.md +477 -0
- package/docs/sdks/jobcontacts/README.md +462 -0
- package/docs/sdks/jobmaterialbundles/README.md +441 -0
- package/docs/sdks/jobmaterials/README.md +478 -0
- package/docs/sdks/jobpayments/README.md +445 -0
- package/docs/sdks/jobqueues/README.md +458 -0
- package/docs/sdks/jobs/README.md +546 -0
- package/docs/sdks/knowledgearticles/README.md +452 -0
- package/docs/sdks/locations/README.md +462 -0
- package/docs/sdks/materials/README.md +466 -0
- package/docs/sdks/notes/README.md +445 -0
- package/docs/sdks/securityroles/README.md +437 -0
- package/docs/sdks/servicem8/README.md +22 -0
- package/docs/sdks/smstemplates/README.md +437 -0
- package/docs/sdks/staffmembers/README.md +494 -0
- package/docs/sdks/staffmessages/README.md +457 -0
- package/docs/sdks/tasks/README.md +490 -0
- package/docs/sdks/taxrates/README.md +437 -0
- package/docs/sdks/vendors/README.md +278 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/api_fixed.json +0 -14096
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
# JobActivities
|
|
2
|
+
(*jobActivities*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
Operations related to Job Activities
|
|
7
|
+
|
|
8
|
+
### Available Operations
|
|
9
|
+
|
|
10
|
+
* [listJobActivities](#listjobactivities) - List all Job Activities
|
|
11
|
+
* [createJobActivities](#createjobactivities) - Create a new Job Activity
|
|
12
|
+
* [getJobActivities](#getjobactivities) - Retrieve a Job Activity
|
|
13
|
+
* [updateJobActivities](#updatejobactivities) - Update a Job Activity
|
|
14
|
+
* [deleteJobActivities](#deletejobactivities) - Delete a Job Activity
|
|
15
|
+
|
|
16
|
+
## listJobActivities
|
|
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_schedule**.
|
|
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.jobActivities.listJobActivities();
|
|
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 { jobActivitiesListJobActivities } from "servicem8/funcs/jobActivitiesListJobActivities.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 jobActivitiesListJobActivities(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.ListJobActivitiesResponse](../../models/operations/listjobactivitiesresponse.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
|
+
## createJobActivities
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
#### OAuth Scope
|
|
106
|
+
This endpoint requires the following OAuth scope **manage_schedule**.
|
|
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.jobActivities.createJobActivities({
|
|
128
|
+
uuid: "123e4567-1b48-457f-af8c-22b4d03b6b2b",
|
|
129
|
+
jobUuid: "123e4567-a197-4fde-9d28-22b4d6697a9b",
|
|
130
|
+
staffUuid: "123e4567-18e2-47d1-bab5-22b4d5480d6b",
|
|
131
|
+
startDate: "YYYY-MM-DD HH:MM:SS",
|
|
132
|
+
endDate: "YYYY-MM-DD HH:MM:SS",
|
|
133
|
+
hasBeenOpenedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
134
|
+
allocatedByStaffUuid: "123e4567-65b0-480f-9dde-22b4d7935d9b",
|
|
135
|
+
allocatedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
136
|
+
materialUuid: "123e4567-4d7f-44f4-b6bf-22b4de8f9fcb",
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// Handle the result
|
|
140
|
+
console.log(result);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
run();
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Standalone function
|
|
147
|
+
|
|
148
|
+
The standalone function version of this method:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
152
|
+
import { jobActivitiesCreateJobActivities } from "servicem8/funcs/jobActivitiesCreateJobActivities.js";
|
|
153
|
+
|
|
154
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
155
|
+
// You can create one instance of it to use across an application.
|
|
156
|
+
const serviceM8 = new ServiceM8Core({
|
|
157
|
+
security: {
|
|
158
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
async function run() {
|
|
163
|
+
const res = await jobActivitiesCreateJobActivities(serviceM8, {
|
|
164
|
+
uuid: "123e4567-1b48-457f-af8c-22b4d03b6b2b",
|
|
165
|
+
jobUuid: "123e4567-a197-4fde-9d28-22b4d6697a9b",
|
|
166
|
+
staffUuid: "123e4567-18e2-47d1-bab5-22b4d5480d6b",
|
|
167
|
+
startDate: "YYYY-MM-DD HH:MM:SS",
|
|
168
|
+
endDate: "YYYY-MM-DD HH:MM:SS",
|
|
169
|
+
hasBeenOpenedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
170
|
+
allocatedByStaffUuid: "123e4567-65b0-480f-9dde-22b4d7935d9b",
|
|
171
|
+
allocatedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
172
|
+
materialUuid: "123e4567-4d7f-44f4-b6bf-22b4de8f9fcb",
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (!res.ok) {
|
|
176
|
+
throw res.error;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const { value: result } = res;
|
|
180
|
+
|
|
181
|
+
// Handle the result
|
|
182
|
+
console.log(result);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
run();
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Parameters
|
|
189
|
+
|
|
190
|
+
| Parameter | Type | Required | Description |
|
|
191
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
192
|
+
| `request` | [components.JobActivityInput](../../models/components/jobactivityinput.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
193
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
194
|
+
| `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. |
|
|
195
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
196
|
+
|
|
197
|
+
### Response
|
|
198
|
+
|
|
199
|
+
**Promise\<[operations.CreateJobActivitiesResponse](../../models/operations/createjobactivitiesresponse.md)\>**
|
|
200
|
+
|
|
201
|
+
### Errors
|
|
202
|
+
|
|
203
|
+
| Error Type | Status Code | Content Type |
|
|
204
|
+
| ---------------- | ---------------- | ---------------- |
|
|
205
|
+
| errors.ErrorT | 400 | application/json |
|
|
206
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
207
|
+
|
|
208
|
+
## getJobActivities
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
#### OAuth Scope
|
|
213
|
+
This endpoint requires the following OAuth scope **read_schedule**.
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
### Example Usage
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { ServiceM8 } from "servicem8";
|
|
221
|
+
|
|
222
|
+
const serviceM8 = new ServiceM8({
|
|
223
|
+
security: {
|
|
224
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
async function run() {
|
|
229
|
+
const result = await serviceM8.jobActivities.getJobActivities({
|
|
230
|
+
uuid: "f32731bb-bb87-4332-b835-cec6ca6ebe5c",
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Handle the result
|
|
234
|
+
console.log(result);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
run();
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Standalone function
|
|
241
|
+
|
|
242
|
+
The standalone function version of this method:
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
246
|
+
import { jobActivitiesGetJobActivities } from "servicem8/funcs/jobActivitiesGetJobActivities.js";
|
|
247
|
+
|
|
248
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
249
|
+
// You can create one instance of it to use across an application.
|
|
250
|
+
const serviceM8 = new ServiceM8Core({
|
|
251
|
+
security: {
|
|
252
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
async function run() {
|
|
257
|
+
const res = await jobActivitiesGetJobActivities(serviceM8, {
|
|
258
|
+
uuid: "f32731bb-bb87-4332-b835-cec6ca6ebe5c",
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
if (!res.ok) {
|
|
262
|
+
throw res.error;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const { value: result } = res;
|
|
266
|
+
|
|
267
|
+
// Handle the result
|
|
268
|
+
console.log(result);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
run();
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Parameters
|
|
275
|
+
|
|
276
|
+
| Parameter | Type | Required | Description |
|
|
277
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
278
|
+
| `request` | [operations.GetJobActivitiesRequest](../../models/operations/getjobactivitiesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
279
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
280
|
+
| `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. |
|
|
281
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
282
|
+
|
|
283
|
+
### Response
|
|
284
|
+
|
|
285
|
+
**Promise\<[operations.GetJobActivitiesResponse](../../models/operations/getjobactivitiesresponse.md)\>**
|
|
286
|
+
|
|
287
|
+
### Errors
|
|
288
|
+
|
|
289
|
+
| Error Type | Status Code | Content Type |
|
|
290
|
+
| ---------------- | ---------------- | ---------------- |
|
|
291
|
+
| errors.ErrorT | 400 | application/json |
|
|
292
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
293
|
+
|
|
294
|
+
## updateJobActivities
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
#### OAuth Scope
|
|
299
|
+
This endpoint requires the following OAuth scope **manage_schedule**.
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
### Example Usage
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
import { ServiceM8 } from "servicem8";
|
|
307
|
+
|
|
308
|
+
const serviceM8 = new ServiceM8({
|
|
309
|
+
security: {
|
|
310
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
async function run() {
|
|
315
|
+
const result = await serviceM8.jobActivities.updateJobActivities({
|
|
316
|
+
uuid: "baff6543-b6e3-49f1-98fc-1f6ac89c2a41",
|
|
317
|
+
jobActivity: {
|
|
318
|
+
uuid: "123e4567-1b48-457f-af8c-22b4d03b6b2b",
|
|
319
|
+
jobUuid: "123e4567-a197-4fde-9d28-22b4d6697a9b",
|
|
320
|
+
staffUuid: "123e4567-18e2-47d1-bab5-22b4d5480d6b",
|
|
321
|
+
startDate: "YYYY-MM-DD HH:MM:SS",
|
|
322
|
+
endDate: "YYYY-MM-DD HH:MM:SS",
|
|
323
|
+
hasBeenOpenedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
324
|
+
allocatedByStaffUuid: "123e4567-65b0-480f-9dde-22b4d7935d9b",
|
|
325
|
+
allocatedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
326
|
+
materialUuid: "123e4567-4d7f-44f4-b6bf-22b4de8f9fcb",
|
|
327
|
+
},
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
// Handle the result
|
|
331
|
+
console.log(result);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
run();
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Standalone function
|
|
338
|
+
|
|
339
|
+
The standalone function version of this method:
|
|
340
|
+
|
|
341
|
+
```typescript
|
|
342
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
343
|
+
import { jobActivitiesUpdateJobActivities } from "servicem8/funcs/jobActivitiesUpdateJobActivities.js";
|
|
344
|
+
|
|
345
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
346
|
+
// You can create one instance of it to use across an application.
|
|
347
|
+
const serviceM8 = new ServiceM8Core({
|
|
348
|
+
security: {
|
|
349
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
async function run() {
|
|
354
|
+
const res = await jobActivitiesUpdateJobActivities(serviceM8, {
|
|
355
|
+
uuid: "baff6543-b6e3-49f1-98fc-1f6ac89c2a41",
|
|
356
|
+
jobActivity: {
|
|
357
|
+
uuid: "123e4567-1b48-457f-af8c-22b4d03b6b2b",
|
|
358
|
+
jobUuid: "123e4567-a197-4fde-9d28-22b4d6697a9b",
|
|
359
|
+
staffUuid: "123e4567-18e2-47d1-bab5-22b4d5480d6b",
|
|
360
|
+
startDate: "YYYY-MM-DD HH:MM:SS",
|
|
361
|
+
endDate: "YYYY-MM-DD HH:MM:SS",
|
|
362
|
+
hasBeenOpenedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
363
|
+
allocatedByStaffUuid: "123e4567-65b0-480f-9dde-22b4d7935d9b",
|
|
364
|
+
allocatedTimestamp: "YYYY-MM-DD HH:MM:SS",
|
|
365
|
+
materialUuid: "123e4567-4d7f-44f4-b6bf-22b4de8f9fcb",
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
if (!res.ok) {
|
|
370
|
+
throw res.error;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
const { value: result } = res;
|
|
374
|
+
|
|
375
|
+
// Handle the result
|
|
376
|
+
console.log(result);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
run();
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Parameters
|
|
383
|
+
|
|
384
|
+
| Parameter | Type | Required | Description |
|
|
385
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
386
|
+
| `request` | [operations.UpdateJobActivitiesRequest](../../models/operations/updatejobactivitiesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
387
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
388
|
+
| `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. |
|
|
389
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
390
|
+
|
|
391
|
+
### Response
|
|
392
|
+
|
|
393
|
+
**Promise\<[operations.UpdateJobActivitiesResponse](../../models/operations/updatejobactivitiesresponse.md)\>**
|
|
394
|
+
|
|
395
|
+
### Errors
|
|
396
|
+
|
|
397
|
+
| Error Type | Status Code | Content Type |
|
|
398
|
+
| ---------------- | ---------------- | ---------------- |
|
|
399
|
+
| errors.ErrorT | 400 | application/json |
|
|
400
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
401
|
+
|
|
402
|
+
## deleteJobActivities
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
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.
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
#### OAuth Scope
|
|
411
|
+
This endpoint requires the following OAuth scope **manage_schedule**.
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
### Example Usage
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
import { ServiceM8 } from "servicem8";
|
|
419
|
+
|
|
420
|
+
const serviceM8 = new ServiceM8({
|
|
421
|
+
security: {
|
|
422
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
423
|
+
},
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
async function run() {
|
|
427
|
+
const result = await serviceM8.jobActivities.deleteJobActivities({
|
|
428
|
+
uuid: "09f10d68-7762-4ec3-9513-2a1fb89ff1b5",
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// Handle the result
|
|
432
|
+
console.log(result);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
run();
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Standalone function
|
|
439
|
+
|
|
440
|
+
The standalone function version of this method:
|
|
441
|
+
|
|
442
|
+
```typescript
|
|
443
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
444
|
+
import { jobActivitiesDeleteJobActivities } from "servicem8/funcs/jobActivitiesDeleteJobActivities.js";
|
|
445
|
+
|
|
446
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
447
|
+
// You can create one instance of it to use across an application.
|
|
448
|
+
const serviceM8 = new ServiceM8Core({
|
|
449
|
+
security: {
|
|
450
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
451
|
+
},
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
async function run() {
|
|
455
|
+
const res = await jobActivitiesDeleteJobActivities(serviceM8, {
|
|
456
|
+
uuid: "09f10d68-7762-4ec3-9513-2a1fb89ff1b5",
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
if (!res.ok) {
|
|
460
|
+
throw res.error;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const { value: result } = res;
|
|
464
|
+
|
|
465
|
+
// Handle the result
|
|
466
|
+
console.log(result);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
run();
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Parameters
|
|
473
|
+
|
|
474
|
+
| Parameter | Type | Required | Description |
|
|
475
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
476
|
+
| `request` | [operations.DeleteJobActivitiesRequest](../../models/operations/deletejobactivitiesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
477
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
478
|
+
| `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. |
|
|
479
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
480
|
+
|
|
481
|
+
### Response
|
|
482
|
+
|
|
483
|
+
**Promise\<[operations.DeleteJobActivitiesResponse](../../models/operations/deletejobactivitiesresponse.md)\>**
|
|
484
|
+
|
|
485
|
+
### Errors
|
|
486
|
+
|
|
487
|
+
| Error Type | Status Code | Content Type |
|
|
488
|
+
| ---------------- | ---------------- | ---------------- |
|
|
489
|
+
| errors.ErrorT | 400 | application/json |
|
|
490
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|