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,437 @@
|
|
|
1
|
+
# SecurityRoles
|
|
2
|
+
(*securityRoles*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
Operations related to Security Roles
|
|
7
|
+
|
|
8
|
+
### Available Operations
|
|
9
|
+
|
|
10
|
+
* [listSecurityRoles](#listsecurityroles) - List all Security Roles
|
|
11
|
+
* [createSecurityRoles](#createsecurityroles) - Create a new Security Role
|
|
12
|
+
* [getSecurityRoles](#getsecurityroles) - Retrieve a Security Role
|
|
13
|
+
* [updateSecurityRoles](#updatesecurityroles) - Update a Security Role
|
|
14
|
+
* [deleteSecurityRoles](#deletesecurityroles) - Delete a Security Role
|
|
15
|
+
|
|
16
|
+
## listSecurityRoles
|
|
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.securityRoles.listSecurityRoles();
|
|
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 { securityRolesListSecurityRoles } from "servicem8/funcs/securityRolesListSecurityRoles.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 securityRolesListSecurityRoles(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.ListSecurityRolesResponse](../../models/operations/listsecurityrolesresponse.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
|
+
## createSecurityRoles
|
|
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.securityRoles.createSecurityRoles({
|
|
118
|
+
uuid: "123e4567-d954-4b9b-8be2-22b4d944127b",
|
|
119
|
+
name: "<value>",
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Handle the result
|
|
123
|
+
console.log(result);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
run();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Standalone function
|
|
130
|
+
|
|
131
|
+
The standalone function version of this method:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
135
|
+
import { securityRolesCreateSecurityRoles } from "servicem8/funcs/securityRolesCreateSecurityRoles.js";
|
|
136
|
+
|
|
137
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
138
|
+
// You can create one instance of it to use across an application.
|
|
139
|
+
const serviceM8 = new ServiceM8Core({
|
|
140
|
+
security: {
|
|
141
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
async function run() {
|
|
146
|
+
const res = await securityRolesCreateSecurityRoles(serviceM8, {
|
|
147
|
+
uuid: "123e4567-d954-4b9b-8be2-22b4d944127b",
|
|
148
|
+
name: "<value>",
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (!res.ok) {
|
|
152
|
+
throw res.error;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const { value: result } = res;
|
|
156
|
+
|
|
157
|
+
// Handle the result
|
|
158
|
+
console.log(result);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
run();
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Parameters
|
|
165
|
+
|
|
166
|
+
| Parameter | Type | Required | Description |
|
|
167
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
168
|
+
| `request` | [components.SecurityRoleInput](../../models/components/securityroleinput.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
169
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
170
|
+
| `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. |
|
|
171
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
172
|
+
|
|
173
|
+
### Response
|
|
174
|
+
|
|
175
|
+
**Promise\<[operations.CreateSecurityRolesResponse](../../models/operations/createsecurityrolesresponse.md)\>**
|
|
176
|
+
|
|
177
|
+
### Errors
|
|
178
|
+
|
|
179
|
+
| Error Type | Status Code | Content Type |
|
|
180
|
+
| ---------------- | ---------------- | ---------------- |
|
|
181
|
+
| errors.ErrorT | 400 | application/json |
|
|
182
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
183
|
+
|
|
184
|
+
## getSecurityRoles
|
|
185
|
+
|
|
186
|
+
Retrieve a Security Role
|
|
187
|
+
|
|
188
|
+
### Example Usage
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
import { ServiceM8 } from "servicem8";
|
|
192
|
+
|
|
193
|
+
const serviceM8 = new ServiceM8({
|
|
194
|
+
security: {
|
|
195
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
async function run() {
|
|
200
|
+
const result = await serviceM8.securityRoles.getSecurityRoles({
|
|
201
|
+
uuid: "2a2f5d93-2d30-4fff-b709-324e4e335f45",
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Handle the result
|
|
205
|
+
console.log(result);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
run();
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Standalone function
|
|
212
|
+
|
|
213
|
+
The standalone function version of this method:
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
217
|
+
import { securityRolesGetSecurityRoles } from "servicem8/funcs/securityRolesGetSecurityRoles.js";
|
|
218
|
+
|
|
219
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
220
|
+
// You can create one instance of it to use across an application.
|
|
221
|
+
const serviceM8 = new ServiceM8Core({
|
|
222
|
+
security: {
|
|
223
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
async function run() {
|
|
228
|
+
const res = await securityRolesGetSecurityRoles(serviceM8, {
|
|
229
|
+
uuid: "2a2f5d93-2d30-4fff-b709-324e4e335f45",
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
if (!res.ok) {
|
|
233
|
+
throw res.error;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const { value: result } = res;
|
|
237
|
+
|
|
238
|
+
// Handle the result
|
|
239
|
+
console.log(result);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
run();
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Parameters
|
|
246
|
+
|
|
247
|
+
| Parameter | Type | Required | Description |
|
|
248
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
249
|
+
| `request` | [operations.GetSecurityRolesRequest](../../models/operations/getsecurityrolesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
250
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
251
|
+
| `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. |
|
|
252
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
253
|
+
|
|
254
|
+
### Response
|
|
255
|
+
|
|
256
|
+
**Promise\<[operations.GetSecurityRolesResponse](../../models/operations/getsecurityrolesresponse.md)\>**
|
|
257
|
+
|
|
258
|
+
### Errors
|
|
259
|
+
|
|
260
|
+
| Error Type | Status Code | Content Type |
|
|
261
|
+
| ---------------- | ---------------- | ---------------- |
|
|
262
|
+
| errors.ErrorT | 400 | application/json |
|
|
263
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
264
|
+
|
|
265
|
+
## updateSecurityRoles
|
|
266
|
+
|
|
267
|
+
Update a Security Role
|
|
268
|
+
|
|
269
|
+
### Example Usage
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
import { ServiceM8 } from "servicem8";
|
|
273
|
+
|
|
274
|
+
const serviceM8 = new ServiceM8({
|
|
275
|
+
security: {
|
|
276
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
async function run() {
|
|
281
|
+
const result = await serviceM8.securityRoles.updateSecurityRoles({
|
|
282
|
+
uuid: "7f8646db-7cfb-450f-9a66-0807f786f55f",
|
|
283
|
+
securityRole: {
|
|
284
|
+
uuid: "123e4567-d954-4b9b-8be2-22b4d944127b",
|
|
285
|
+
name: "<value>",
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
// Handle the result
|
|
290
|
+
console.log(result);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
run();
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Standalone function
|
|
297
|
+
|
|
298
|
+
The standalone function version of this method:
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
302
|
+
import { securityRolesUpdateSecurityRoles } from "servicem8/funcs/securityRolesUpdateSecurityRoles.js";
|
|
303
|
+
|
|
304
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
305
|
+
// You can create one instance of it to use across an application.
|
|
306
|
+
const serviceM8 = new ServiceM8Core({
|
|
307
|
+
security: {
|
|
308
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
309
|
+
},
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
async function run() {
|
|
313
|
+
const res = await securityRolesUpdateSecurityRoles(serviceM8, {
|
|
314
|
+
uuid: "7f8646db-7cfb-450f-9a66-0807f786f55f",
|
|
315
|
+
securityRole: {
|
|
316
|
+
uuid: "123e4567-d954-4b9b-8be2-22b4d944127b",
|
|
317
|
+
name: "<value>",
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
if (!res.ok) {
|
|
322
|
+
throw res.error;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const { value: result } = res;
|
|
326
|
+
|
|
327
|
+
// Handle the result
|
|
328
|
+
console.log(result);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
run();
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Parameters
|
|
335
|
+
|
|
336
|
+
| Parameter | Type | Required | Description |
|
|
337
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
338
|
+
| `request` | [operations.UpdateSecurityRolesRequest](../../models/operations/updatesecurityrolesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
339
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
340
|
+
| `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. |
|
|
341
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
342
|
+
|
|
343
|
+
### Response
|
|
344
|
+
|
|
345
|
+
**Promise\<[operations.UpdateSecurityRolesResponse](../../models/operations/updatesecurityrolesresponse.md)\>**
|
|
346
|
+
|
|
347
|
+
### Errors
|
|
348
|
+
|
|
349
|
+
| Error Type | Status Code | Content Type |
|
|
350
|
+
| ---------------- | ---------------- | ---------------- |
|
|
351
|
+
| errors.ErrorT | 400 | application/json |
|
|
352
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
353
|
+
|
|
354
|
+
## deleteSecurityRoles
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
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.
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
### Example Usage
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
import { ServiceM8 } from "servicem8";
|
|
366
|
+
|
|
367
|
+
const serviceM8 = new ServiceM8({
|
|
368
|
+
security: {
|
|
369
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
370
|
+
},
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
async function run() {
|
|
374
|
+
const result = await serviceM8.securityRoles.deleteSecurityRoles({
|
|
375
|
+
uuid: "c93e08c8-ef3e-4c90-9316-a563244629ef",
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// Handle the result
|
|
379
|
+
console.log(result);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
run();
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Standalone function
|
|
386
|
+
|
|
387
|
+
The standalone function version of this method:
|
|
388
|
+
|
|
389
|
+
```typescript
|
|
390
|
+
import { ServiceM8Core } from "servicem8/core.js";
|
|
391
|
+
import { securityRolesDeleteSecurityRoles } from "servicem8/funcs/securityRolesDeleteSecurityRoles.js";
|
|
392
|
+
|
|
393
|
+
// Use `ServiceM8Core` for best tree-shaking performance.
|
|
394
|
+
// You can create one instance of it to use across an application.
|
|
395
|
+
const serviceM8 = new ServiceM8Core({
|
|
396
|
+
security: {
|
|
397
|
+
oauth2: process.env["SERVICEM8_OAUTH2"] ?? "",
|
|
398
|
+
},
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
async function run() {
|
|
402
|
+
const res = await securityRolesDeleteSecurityRoles(serviceM8, {
|
|
403
|
+
uuid: "c93e08c8-ef3e-4c90-9316-a563244629ef",
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
if (!res.ok) {
|
|
407
|
+
throw res.error;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const { value: result } = res;
|
|
411
|
+
|
|
412
|
+
// Handle the result
|
|
413
|
+
console.log(result);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
run();
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Parameters
|
|
420
|
+
|
|
421
|
+
| Parameter | Type | Required | Description |
|
|
422
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
423
|
+
| `request` | [operations.DeleteSecurityRolesRequest](../../models/operations/deletesecurityrolesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
424
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
425
|
+
| `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. |
|
|
426
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
427
|
+
|
|
428
|
+
### Response
|
|
429
|
+
|
|
430
|
+
**Promise\<[operations.DeleteSecurityRolesResponse](../../models/operations/deletesecurityrolesresponse.md)\>**
|
|
431
|
+
|
|
432
|
+
### Errors
|
|
433
|
+
|
|
434
|
+
| Error Type | Status Code | Content Type |
|
|
435
|
+
| ---------------- | ---------------- | ---------------- |
|
|
436
|
+
| errors.ErrorT | 400 | application/json |
|
|
437
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# ServiceM8 SDK
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
ServiceM8 API: Move your app forward with the ServiceM8 API
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Limits and Throttling
|
|
10
|
+
To ensure continuous quality of service, API usage can be subject to throttling. The throttle will be applied once an API consumer reaches a certain
|
|
11
|
+
threshold in terms of a maximum number of requests per minute. Most clients will never hit this threshold, but those that do, will get met by a
|
|
12
|
+
HTTP 429 Too Many Requests response code.
|
|
13
|
+
|
|
14
|
+
There is a limit of 180 requests per minute, if you reach this you will receive a HTTP 429 with a text body of "Number of allowed API requests per minute exceeded".
|
|
15
|
+
There is a limit of 20000 requests per day, if you reach this you will receive a HTTP 429 with a text body of "Number of allowed API requests per day exceeded".
|
|
16
|
+
|
|
17
|
+
We encourage all API developers to anticipate this error, and take appropriate measures like e.g. using a cached value from a previous call, or passing on a message to the end user that gets subjected to this behaviour (if any).
|
|
18
|
+
|
|
19
|
+
Limits are per Addon per account.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Available Operations
|