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
|
+
# EmailTemplates
|
|
2
|
+
(*emailTemplates*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
Operations related to Email Templates
|
|
7
|
+
|
|
8
|
+
### Available Operations
|
|
9
|
+
|
|
10
|
+
* [listEmailTemplates](#listemailtemplates) - List all Email Templates
|
|
11
|
+
* [createEmailTemplates](#createemailtemplates) - Create a new Email Template
|
|
12
|
+
* [getEmailTemplates](#getemailtemplates) - Retrieve an Email Template
|
|
13
|
+
* [updateEmailTemplates](#updateemailtemplates) - Update an Email Template
|
|
14
|
+
* [deleteEmailTemplates](#deleteemailtemplates) - Delete an Email Template
|
|
15
|
+
|
|
16
|
+
## listEmailTemplates
|
|
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.emailTemplates.listEmailTemplates();
|
|
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 { emailTemplatesListEmailTemplates } from "servicem8/funcs/emailTemplatesListEmailTemplates.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 emailTemplatesListEmailTemplates(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.ListEmailTemplatesResponse](../../models/operations/listemailtemplatesresponse.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
|
+
## createEmailTemplates
|
|
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.emailTemplates.createEmailTemplates({
|
|
118
|
+
uuid: "123e4567-f545-4db1-a5e8-22b4d7622d0b",
|
|
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 { emailTemplatesCreateEmailTemplates } from "servicem8/funcs/emailTemplatesCreateEmailTemplates.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 emailTemplatesCreateEmailTemplates(serviceM8, {
|
|
147
|
+
uuid: "123e4567-f545-4db1-a5e8-22b4d7622d0b",
|
|
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.EmailTemplateInput](../../models/components/emailtemplateinput.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.CreateEmailTemplatesResponse](../../models/operations/createemailtemplatesresponse.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
|
+
## getEmailTemplates
|
|
185
|
+
|
|
186
|
+
Retrieve an Email Template
|
|
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.emailTemplates.getEmailTemplates({
|
|
201
|
+
uuid: "01e49d7f-64e2-4e6f-b41a-39acd826f9d1",
|
|
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 { emailTemplatesGetEmailTemplates } from "servicem8/funcs/emailTemplatesGetEmailTemplates.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 emailTemplatesGetEmailTemplates(serviceM8, {
|
|
229
|
+
uuid: "01e49d7f-64e2-4e6f-b41a-39acd826f9d1",
|
|
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.GetEmailTemplatesRequest](../../models/operations/getemailtemplatesrequest.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.GetEmailTemplatesResponse](../../models/operations/getemailtemplatesresponse.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
|
+
## updateEmailTemplates
|
|
266
|
+
|
|
267
|
+
Update an Email Template
|
|
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.emailTemplates.updateEmailTemplates({
|
|
282
|
+
uuid: "fa27ec4a-b284-4c08-a042-7fd0d943ed6e",
|
|
283
|
+
emailTemplate: {
|
|
284
|
+
uuid: "123e4567-f545-4db1-a5e8-22b4d7622d0b",
|
|
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 { emailTemplatesUpdateEmailTemplates } from "servicem8/funcs/emailTemplatesUpdateEmailTemplates.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 emailTemplatesUpdateEmailTemplates(serviceM8, {
|
|
314
|
+
uuid: "fa27ec4a-b284-4c08-a042-7fd0d943ed6e",
|
|
315
|
+
emailTemplate: {
|
|
316
|
+
uuid: "123e4567-f545-4db1-a5e8-22b4d7622d0b",
|
|
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.UpdateEmailTemplatesRequest](../../models/operations/updateemailtemplatesrequest.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.UpdateEmailTemplatesResponse](../../models/operations/updateemailtemplatesresponse.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
|
+
## deleteEmailTemplates
|
|
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.emailTemplates.deleteEmailTemplates({
|
|
375
|
+
uuid: "dfea2db9-0def-4920-9904-a2b188367027",
|
|
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 { emailTemplatesDeleteEmailTemplates } from "servicem8/funcs/emailTemplatesDeleteEmailTemplates.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 emailTemplatesDeleteEmailTemplates(serviceM8, {
|
|
403
|
+
uuid: "dfea2db9-0def-4920-9904-a2b188367027",
|
|
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.DeleteEmailTemplatesRequest](../../models/operations/deleteemailtemplatesrequest.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.DeleteEmailTemplatesResponse](../../models/operations/deleteemailtemplatesresponse.md)\>**
|
|
431
|
+
|
|
432
|
+
### Errors
|
|
433
|
+
|
|
434
|
+
| Error Type | Status Code | Content Type |
|
|
435
|
+
| ---------------- | ---------------- | ---------------- |
|
|
436
|
+
| errors.ErrorT | 400 | application/json |
|
|
437
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|