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
|
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "1.0.0";
|
|
34
|
-
readonly sdkVersion: "0.3.
|
|
34
|
+
readonly sdkVersion: "0.3.8";
|
|
35
35
|
readonly genVersion: "2.593.4";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.3.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.3.8 2.593.4 1.0.0 servicem8";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -28,8 +28,8 @@ function serverURLFromOptions(options) {
|
|
|
28
28
|
exports.SDK_METADATA = {
|
|
29
29
|
language: "typescript",
|
|
30
30
|
openapiDocVersion: "1.0.0",
|
|
31
|
-
sdkVersion: "0.3.
|
|
31
|
+
sdkVersion: "0.3.8",
|
|
32
32
|
genVersion: "2.593.4",
|
|
33
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
33
|
+
userAgent: "speakeasy-sdk/typescript 0.3.8 2.593.4 1.0.0 servicem8",
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=config.js.map
|
|
@@ -22,7 +22,7 @@ const routes = (0, core_1.buildRouteMap)({
|
|
|
22
22
|
exports.app = (0, core_1.buildApplication)(routes, {
|
|
23
23
|
name: "mcp",
|
|
24
24
|
versionInfo: {
|
|
25
|
-
currentVersion: "0.3.
|
|
25
|
+
currentVersion: "0.3.8",
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
(0, core_1.run)(exports.app, node_process_1.default.argv.slice(2), (0, cli_js_1.buildContext)(node_process_1.default));
|
|
@@ -184,7 +184,7 @@ const vendorsUpdateVendors_js_1 = require("./tools/vendorsUpdateVendors.js");
|
|
|
184
184
|
function createMCPServer(deps) {
|
|
185
185
|
const server = new mcp_js_1.McpServer({
|
|
186
186
|
name: "ServiceM8",
|
|
187
|
-
version: "0.3.
|
|
187
|
+
version: "0.3.8",
|
|
188
188
|
});
|
|
189
189
|
const client = new core_js_1.ServiceM8Core({
|
|
190
190
|
security: deps.security,
|
package/dist/esm/lib/config.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "1.0.0";
|
|
34
|
-
readonly sdkVersion: "0.3.
|
|
34
|
+
readonly sdkVersion: "0.3.8";
|
|
35
35
|
readonly genVersion: "2.593.4";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.3.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.3.8 2.593.4 1.0.0 servicem8";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/esm/lib/config.js
CHANGED
|
@@ -24,8 +24,8 @@ export function serverURLFromOptions(options) {
|
|
|
24
24
|
export const SDK_METADATA = {
|
|
25
25
|
language: "typescript",
|
|
26
26
|
openapiDocVersion: "1.0.0",
|
|
27
|
-
sdkVersion: "0.3.
|
|
27
|
+
sdkVersion: "0.3.8",
|
|
28
28
|
genVersion: "2.593.4",
|
|
29
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
29
|
+
userAgent: "speakeasy-sdk/typescript 0.3.8 2.593.4 1.0.0 servicem8",
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=config.js.map
|
|
@@ -181,7 +181,7 @@ import { tool$vendorsUpdateVendors } from "./tools/vendorsUpdateVendors.js";
|
|
|
181
181
|
export function createMCPServer(deps) {
|
|
182
182
|
const server = new McpServer({
|
|
183
183
|
name: "ServiceM8",
|
|
184
|
-
version: "0.3.
|
|
184
|
+
version: "0.3.8",
|
|
185
185
|
});
|
|
186
186
|
const client = new ServiceM8Core({
|
|
187
187
|
security: deps.security,
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
# AllocationWindows
|
|
2
|
+
(*allocationWindows*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
Operations related to Allocation Windows
|
|
7
|
+
|
|
8
|
+
### Available Operations
|
|
9
|
+
|
|
10
|
+
* [listAllocationWindows](#listallocationwindows) - List all Allocation Windows
|
|
11
|
+
* [createAllocationWindows](#createallocationwindows) - Create a new Allocation Window
|
|
12
|
+
* [getAllocationWindows](#getallocationwindows) - Retrieve an Allocation Window
|
|
13
|
+
* [updateAllocationWindows](#updateallocationwindows) - Update an Allocation Window
|
|
14
|
+
* [deleteAllocationWindows](#deleteallocationwindows) - Delete an Allocation Window
|
|
15
|
+
|
|
16
|
+
## listAllocationWindows
|
|
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
|
+
### Example Usage
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { ServiceM8 } from "servicem8";
|
|
28
|
+
|
|
29
|
+
const serviceM8 = new ServiceM8({
|
|
30
|
+
security: {
|
|
31
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
async function run() {
|
|
36
|
+
const result = await serviceM8.allocationWindows.listAllocationWindows();
|
|
37
|
+
|
|
38
|
+
// Handle the result
|
|
39
|
+
console.log(result);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
run();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Standalone function
|
|
46
|
+
|
|
47
|
+
The standalone function version of this method:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
51
|
+
import { allocationWindowsListAllocationWindows } from "servicem8/funcs/allocationWindowsListAllocationWindows.js";
|
|
52
|
+
|
|
53
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
54
|
+
// You can create one instance of it to use across an application.
|
|
55
|
+
const serviceM8 = new ServiceM8Core({
|
|
56
|
+
security: {
|
|
57
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
async function run() {
|
|
62
|
+
const res = await allocationWindowsListAllocationWindows(serviceM8);
|
|
63
|
+
|
|
64
|
+
if (!res.ok) {
|
|
65
|
+
throw res.error;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const { value: result } = res;
|
|
69
|
+
|
|
70
|
+
// Handle the result
|
|
71
|
+
console.log(result);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
run();
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Parameters
|
|
78
|
+
|
|
79
|
+
| Parameter | Type | Required | Description |
|
|
80
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
81
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
82
|
+
| `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. |
|
|
83
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
84
|
+
|
|
85
|
+
### Response
|
|
86
|
+
|
|
87
|
+
**Promise\<[operations.ListAllocationWindowsResponse](../../models/operations/listallocationwindowsresponse.md)\>**
|
|
88
|
+
|
|
89
|
+
### Errors
|
|
90
|
+
|
|
91
|
+
| Error Type | Status Code | Content Type |
|
|
92
|
+
| ---------------- | ---------------- | ---------------- |
|
|
93
|
+
| errors.ErrorT | 400 | application/json |
|
|
94
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
95
|
+
|
|
96
|
+
## createAllocationWindows
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
#### Record UUID
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Example Usage
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { ServiceM8 } from "servicem8";
|
|
109
|
+
|
|
110
|
+
const serviceM8 = new ServiceM8({
|
|
111
|
+
security: {
|
|
112
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
async function run() {
|
|
117
|
+
const result = await serviceM8.allocationWindows.createAllocationWindows({
|
|
118
|
+
uuid: "123e4567-9668-4a12-bc72-22b4d86a47db",
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// Handle the result
|
|
122
|
+
console.log(result);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
run();
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Standalone function
|
|
129
|
+
|
|
130
|
+
The standalone function version of this method:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
134
|
+
import { allocationWindowsCreateAllocationWindows } from "servicem8/funcs/allocationWindowsCreateAllocationWindows.js";
|
|
135
|
+
|
|
136
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
137
|
+
// You can create one instance of it to use across an application.
|
|
138
|
+
const serviceM8 = new ServiceM8Core({
|
|
139
|
+
security: {
|
|
140
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
async function run() {
|
|
145
|
+
const res = await allocationWindowsCreateAllocationWindows(serviceM8, {
|
|
146
|
+
uuid: "123e4567-9668-4a12-bc72-22b4d86a47db",
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
if (!res.ok) {
|
|
150
|
+
throw res.error;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const { value: result } = res;
|
|
154
|
+
|
|
155
|
+
// Handle the result
|
|
156
|
+
console.log(result);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
run();
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Parameters
|
|
163
|
+
|
|
164
|
+
| Parameter | Type | Required | Description |
|
|
165
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
166
|
+
| `request` | [components.AllocationWindowInput](../../models/components/allocationwindowinput.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
167
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
168
|
+
| `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. |
|
|
169
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
170
|
+
|
|
171
|
+
### Response
|
|
172
|
+
|
|
173
|
+
**Promise\<[operations.CreateAllocationWindowsResponse](../../models/operations/createallocationwindowsresponse.md)\>**
|
|
174
|
+
|
|
175
|
+
### Errors
|
|
176
|
+
|
|
177
|
+
| Error Type | Status Code | Content Type |
|
|
178
|
+
| ---------------- | ---------------- | ---------------- |
|
|
179
|
+
| errors.ErrorT | 400 | application/json |
|
|
180
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
181
|
+
|
|
182
|
+
## getAllocationWindows
|
|
183
|
+
|
|
184
|
+
Retrieve an Allocation Window
|
|
185
|
+
|
|
186
|
+
### Example Usage
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { ServiceM8 } from "servicem8";
|
|
190
|
+
|
|
191
|
+
const serviceM8 = new ServiceM8({
|
|
192
|
+
security: {
|
|
193
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
async function run() {
|
|
198
|
+
const result = await serviceM8.allocationWindows.getAllocationWindows({
|
|
199
|
+
uuid: "4b696862-c2d8-4bfe-936b-d6716d1d97a4",
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Handle the result
|
|
203
|
+
console.log(result);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
run();
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Standalone function
|
|
210
|
+
|
|
211
|
+
The standalone function version of this method:
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
215
|
+
import { allocationWindowsGetAllocationWindows } from "servicem8/funcs/allocationWindowsGetAllocationWindows.js";
|
|
216
|
+
|
|
217
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
218
|
+
// You can create one instance of it to use across an application.
|
|
219
|
+
const serviceM8 = new ServiceM8Core({
|
|
220
|
+
security: {
|
|
221
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
async function run() {
|
|
226
|
+
const res = await allocationWindowsGetAllocationWindows(serviceM8, {
|
|
227
|
+
uuid: "4b696862-c2d8-4bfe-936b-d6716d1d97a4",
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
if (!res.ok) {
|
|
231
|
+
throw res.error;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const { value: result } = res;
|
|
235
|
+
|
|
236
|
+
// Handle the result
|
|
237
|
+
console.log(result);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
run();
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Parameters
|
|
244
|
+
|
|
245
|
+
| Parameter | Type | Required | Description |
|
|
246
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
247
|
+
| `request` | [operations.GetAllocationWindowsRequest](../../models/operations/getallocationwindowsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
248
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
249
|
+
| `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. |
|
|
250
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
251
|
+
|
|
252
|
+
### Response
|
|
253
|
+
|
|
254
|
+
**Promise\<[operations.GetAllocationWindowsResponse](../../models/operations/getallocationwindowsresponse.md)\>**
|
|
255
|
+
|
|
256
|
+
### Errors
|
|
257
|
+
|
|
258
|
+
| Error Type | Status Code | Content Type |
|
|
259
|
+
| ---------------- | ---------------- | ---------------- |
|
|
260
|
+
| errors.ErrorT | 400 | application/json |
|
|
261
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
262
|
+
|
|
263
|
+
## updateAllocationWindows
|
|
264
|
+
|
|
265
|
+
Update an Allocation Window
|
|
266
|
+
|
|
267
|
+
### Example Usage
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
import { ServiceM8 } from "servicem8";
|
|
271
|
+
|
|
272
|
+
const serviceM8 = new ServiceM8({
|
|
273
|
+
security: {
|
|
274
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
async function run() {
|
|
279
|
+
const result = await serviceM8.allocationWindows.updateAllocationWindows({
|
|
280
|
+
uuid: "c0cdf698-ce1e-4a18-8dc8-7753e239240e",
|
|
281
|
+
allocationWindow: {
|
|
282
|
+
uuid: "123e4567-9668-4a12-bc72-22b4d86a47db",
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// Handle the result
|
|
287
|
+
console.log(result);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
run();
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Standalone function
|
|
294
|
+
|
|
295
|
+
The standalone function version of this method:
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
299
|
+
import { allocationWindowsUpdateAllocationWindows } from "servicem8/funcs/allocationWindowsUpdateAllocationWindows.js";
|
|
300
|
+
|
|
301
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
302
|
+
// You can create one instance of it to use across an application.
|
|
303
|
+
const serviceM8 = new ServiceM8Core({
|
|
304
|
+
security: {
|
|
305
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
async function run() {
|
|
310
|
+
const res = await allocationWindowsUpdateAllocationWindows(serviceM8, {
|
|
311
|
+
uuid: "c0cdf698-ce1e-4a18-8dc8-7753e239240e",
|
|
312
|
+
allocationWindow: {
|
|
313
|
+
uuid: "123e4567-9668-4a12-bc72-22b4d86a47db",
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
if (!res.ok) {
|
|
318
|
+
throw res.error;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const { value: result } = res;
|
|
322
|
+
|
|
323
|
+
// Handle the result
|
|
324
|
+
console.log(result);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
run();
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Parameters
|
|
331
|
+
|
|
332
|
+
| Parameter | Type | Required | Description |
|
|
333
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
334
|
+
| `request` | [operations.UpdateAllocationWindowsRequest](../../models/operations/updateallocationwindowsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
335
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
336
|
+
| `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. |
|
|
337
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
338
|
+
|
|
339
|
+
### Response
|
|
340
|
+
|
|
341
|
+
**Promise\<[operations.UpdateAllocationWindowsResponse](../../models/operations/updateallocationwindowsresponse.md)\>**
|
|
342
|
+
|
|
343
|
+
### Errors
|
|
344
|
+
|
|
345
|
+
| Error Type | Status Code | Content Type |
|
|
346
|
+
| ---------------- | ---------------- | ---------------- |
|
|
347
|
+
| errors.ErrorT | 400 | application/json |
|
|
348
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
349
|
+
|
|
350
|
+
## deleteAllocationWindows
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
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.
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
### Example Usage
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
import { ServiceM8 } from "servicem8";
|
|
362
|
+
|
|
363
|
+
const serviceM8 = new ServiceM8({
|
|
364
|
+
security: {
|
|
365
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
async function run() {
|
|
370
|
+
const result = await serviceM8.allocationWindows.deleteAllocationWindows({
|
|
371
|
+
uuid: "e4f73706-6c1c-46f5-b319-113193db25ca",
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// Handle the result
|
|
375
|
+
console.log(result);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
run();
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Standalone function
|
|
382
|
+
|
|
383
|
+
The standalone function version of this method:
|
|
384
|
+
|
|
385
|
+
```typescript
|
|
386
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
387
|
+
import { allocationWindowsDeleteAllocationWindows } from "servicem8/funcs/allocationWindowsDeleteAllocationWindows.js";
|
|
388
|
+
|
|
389
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
390
|
+
// You can create one instance of it to use across an application.
|
|
391
|
+
const serviceM8 = new ServiceM8Core({
|
|
392
|
+
security: {
|
|
393
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
394
|
+
},
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
async function run() {
|
|
398
|
+
const res = await allocationWindowsDeleteAllocationWindows(serviceM8, {
|
|
399
|
+
uuid: "e4f73706-6c1c-46f5-b319-113193db25ca",
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
if (!res.ok) {
|
|
403
|
+
throw res.error;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const { value: result } = res;
|
|
407
|
+
|
|
408
|
+
// Handle the result
|
|
409
|
+
console.log(result);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
run();
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Parameters
|
|
416
|
+
|
|
417
|
+
| Parameter | Type | Required | Description |
|
|
418
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
419
|
+
| `request` | [operations.DeleteAllocationWindowsRequest](../../models/operations/deleteallocationwindowsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
420
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
421
|
+
| `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. |
|
|
422
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
423
|
+
|
|
424
|
+
### Response
|
|
425
|
+
|
|
426
|
+
**Promise\<[operations.DeleteAllocationWindowsResponse](../../models/operations/deleteallocationwindowsresponse.md)\>**
|
|
427
|
+
|
|
428
|
+
### Errors
|
|
429
|
+
|
|
430
|
+
| Error Type | Status Code | Content Type |
|
|
431
|
+
| ---------------- | ---------------- | ---------------- |
|
|
432
|
+
| errors.ErrorT | 400 | application/json |
|
|
433
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|