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
|
+
# FormFields
|
|
2
|
+
(*formFields*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
Operations related to Form Fields
|
|
7
|
+
|
|
8
|
+
### Available Operations
|
|
9
|
+
|
|
10
|
+
* [listFormFields](#listformfields) - List all Form Fields
|
|
11
|
+
* [createFormFields](#createformfields) - Create a new Form Field
|
|
12
|
+
* [getFormFields](#getformfields) - Retrieve a Form Field
|
|
13
|
+
* [updateFormFields](#updateformfields) - Update a Form Field
|
|
14
|
+
* [deleteFormFields](#deleteformfields) - Delete a Form Field
|
|
15
|
+
|
|
16
|
+
## listFormFields
|
|
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.formFields.listFormFields();
|
|
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 { formFieldsListFormFields } from "servicem8/funcs/formFieldsListFormFields.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 formFieldsListFormFields(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.ListFormFieldsResponse](../../models/operations/listformfieldsresponse.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
|
+
## createFormFields
|
|
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.formFields.createFormFields({
|
|
118
|
+
uuid: "123e4567-4523-42ac-8cda-22b4d2c367eb",
|
|
119
|
+
formUuid: "123e4567-e70d-45d9-b32f-22b4db7cb5ab",
|
|
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 { formFieldsCreateFormFields } from "servicem8/funcs/formFieldsCreateFormFields.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 formFieldsCreateFormFields(serviceM8, {
|
|
147
|
+
uuid: "123e4567-4523-42ac-8cda-22b4d2c367eb",
|
|
148
|
+
formUuid: "123e4567-e70d-45d9-b32f-22b4db7cb5ab",
|
|
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.FormFieldInput](../../models/components/formfieldinput.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.CreateFormFieldsResponse](../../models/operations/createformfieldsresponse.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
|
+
## getFormFields
|
|
185
|
+
|
|
186
|
+
Retrieve a Form Field
|
|
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.formFields.getFormFields({
|
|
201
|
+
uuid: "45a3c3af-9f5d-46a2-b258-7ba29e2086c3",
|
|
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 { formFieldsGetFormFields } from "servicem8/funcs/formFieldsGetFormFields.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 formFieldsGetFormFields(serviceM8, {
|
|
229
|
+
uuid: "45a3c3af-9f5d-46a2-b258-7ba29e2086c3",
|
|
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.GetFormFieldsRequest](../../models/operations/getformfieldsrequest.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.GetFormFieldsResponse](../../models/operations/getformfieldsresponse.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
|
+
## updateFormFields
|
|
266
|
+
|
|
267
|
+
Update a Form Field
|
|
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.formFields.updateFormFields({
|
|
282
|
+
uuid: "16f818d5-0155-43f2-8227-7d5e671996c5",
|
|
283
|
+
formField: {
|
|
284
|
+
uuid: "123e4567-4523-42ac-8cda-22b4d2c367eb",
|
|
285
|
+
formUuid: "123e4567-e70d-45d9-b32f-22b4db7cb5ab",
|
|
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 { formFieldsUpdateFormFields } from "servicem8/funcs/formFieldsUpdateFormFields.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 formFieldsUpdateFormFields(serviceM8, {
|
|
314
|
+
uuid: "16f818d5-0155-43f2-8227-7d5e671996c5",
|
|
315
|
+
formField: {
|
|
316
|
+
uuid: "123e4567-4523-42ac-8cda-22b4d2c367eb",
|
|
317
|
+
formUuid: "123e4567-e70d-45d9-b32f-22b4db7cb5ab",
|
|
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.UpdateFormFieldsRequest](../../models/operations/updateformfieldsrequest.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.UpdateFormFieldsResponse](../../models/operations/updateformfieldsresponse.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
|
+
## deleteFormFields
|
|
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.formFields.deleteFormFields({
|
|
375
|
+
uuid: "4f152d41-bb83-4ea7-8e94-f5eb7756ae7a",
|
|
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 { formFieldsDeleteFormFields } from "servicem8/funcs/formFieldsDeleteFormFields.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 formFieldsDeleteFormFields(serviceM8, {
|
|
403
|
+
uuid: "4f152d41-bb83-4ea7-8e94-f5eb7756ae7a",
|
|
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.DeleteFormFieldsRequest](../../models/operations/deleteformfieldsrequest.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.DeleteFormFieldsResponse](../../models/operations/deleteformfieldsresponse.md)\>**
|
|
431
|
+
|
|
432
|
+
### Errors
|
|
433
|
+
|
|
434
|
+
| Error Type | Status Code | Content Type |
|
|
435
|
+
| ---------------- | ---------------- | ---------------- |
|
|
436
|
+
| errors.ErrorT | 400 | application/json |
|
|
437
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|