@voltade/envoy-sdk 1.2.16 → 1.3.1
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/README.md +536 -64
- package/dist/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -1
- package/dist/client.js.map +1 -1
- package/dist/resources/contacts/index.d.ts +105 -0
- package/dist/resources/contacts/index.d.ts.map +1 -0
- package/dist/resources/contacts/index.js +135 -0
- package/dist/resources/contacts/index.js.map +1 -0
- package/dist/resources/contacts/types.d.ts +176 -0
- package/dist/resources/contacts/types.d.ts.map +1 -0
- package/dist/resources/contacts/types.js +68 -0
- package/dist/resources/contacts/types.js.map +1 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -0
- package/dist/resources/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,39 +11,34 @@ npm install @voltade/envoy-sdk
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { EnvoyClient } from
|
|
14
|
+
import { EnvoyClient } from "@voltade/envoy-sdk";
|
|
15
15
|
|
|
16
|
-
// Initialize the client
|
|
17
16
|
const client = new EnvoyClient({
|
|
18
|
-
apiKey:
|
|
19
|
-
accountId:
|
|
20
|
-
baseUrl:
|
|
17
|
+
apiKey: "your-api-key",
|
|
18
|
+
accountId: "your-account-id",
|
|
19
|
+
baseUrl: "https://envoy-crm.voltade.com", // optional
|
|
21
20
|
});
|
|
22
21
|
|
|
23
|
-
//
|
|
22
|
+
// Send a message
|
|
24
23
|
const message = await client.conversations.createMessage(123, {
|
|
25
|
-
content:
|
|
26
|
-
message_type:
|
|
27
|
-
private: false
|
|
24
|
+
content: "Hello, how can I help you?",
|
|
25
|
+
message_type: "outgoing",
|
|
26
|
+
private: false,
|
|
28
27
|
});
|
|
29
28
|
|
|
30
|
-
// Escalate
|
|
29
|
+
// Escalate to human
|
|
31
30
|
const result = await client.conversations.escalateToHuman(123);
|
|
32
|
-
console.log(`Escalated: ${result.success}`);
|
|
33
31
|
```
|
|
34
32
|
|
|
35
33
|
## Features
|
|
36
34
|
|
|
37
35
|
- **Type-safe**: Full TypeScript support with comprehensive type definitions
|
|
38
|
-
- **Resource-based**: Organized API methods by resource (conversations,
|
|
36
|
+
- **Resource-based**: Organized API methods by resource (conversations, contacts, companies, etc.)
|
|
39
37
|
- **Error handling**: Structured error types for different API failures
|
|
40
|
-
- **
|
|
41
|
-
|
|
42
|
-
## API Reference
|
|
38
|
+
- **Zod schemas**: Runtime validation with exported schemas
|
|
39
|
+
- **Webhook support**: Parse and validate incoming webhook events
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
#### Configuration
|
|
41
|
+
## Configuration
|
|
47
42
|
|
|
48
43
|
```typescript
|
|
49
44
|
const client = new EnvoyClient({
|
|
@@ -54,24 +49,56 @@ const client = new EnvoyClient({
|
|
|
54
49
|
});
|
|
55
50
|
```
|
|
56
51
|
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## API Reference
|
|
55
|
+
|
|
57
56
|
### Conversations
|
|
58
57
|
|
|
59
|
-
####
|
|
58
|
+
#### `createMessage(conversationId, params)`
|
|
59
|
+
|
|
60
|
+
Create and send a message to a conversation. Supports text messages, WhatsApp templates, and file attachments.
|
|
60
61
|
|
|
61
62
|
```typescript
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
// Simple text message
|
|
64
|
+
const message = await client.conversations.createMessage(123, {
|
|
65
|
+
content: "Hello, how can I help you?",
|
|
66
|
+
message_type: "outgoing",
|
|
65
67
|
private: false,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// WhatsApp template message
|
|
71
|
+
const templateMessage = await client.conversations.createMessage(123, {
|
|
72
|
+
content: "Template message",
|
|
73
|
+
template_params: {
|
|
74
|
+
name: "order_confirmation",
|
|
75
|
+
category: "MARKETING",
|
|
76
|
+
language: "en",
|
|
77
|
+
processed_params: {
|
|
78
|
+
body: { "1": "121212" },
|
|
79
|
+
header: {
|
|
80
|
+
media_url: "https://example.com/image.jpg",
|
|
81
|
+
media_type: "image",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Message with file attachments
|
|
88
|
+
const file = new File([blob], "document.pdf", { type: "application/pdf" });
|
|
89
|
+
const messageWithAttachment = await client.conversations.createMessage(123, {
|
|
90
|
+
content: "Here is your document",
|
|
91
|
+
message_type: "outgoing",
|
|
92
|
+
file_attachments: [file],
|
|
68
93
|
});
|
|
69
94
|
```
|
|
70
95
|
|
|
71
|
-
####
|
|
96
|
+
#### `escalateToHuman(conversationId)`
|
|
97
|
+
|
|
98
|
+
Escalate a conversation to a human agent.
|
|
72
99
|
|
|
73
100
|
```typescript
|
|
74
|
-
const result = await client.conversations.escalateToHuman(
|
|
101
|
+
const result = await client.conversations.escalateToHuman(123);
|
|
75
102
|
|
|
76
103
|
if (result.success) {
|
|
77
104
|
console.log(`Escalated to ${result.escalation_type}`);
|
|
@@ -81,6 +108,336 @@ if (result.success) {
|
|
|
81
108
|
}
|
|
82
109
|
```
|
|
83
110
|
|
|
111
|
+
#### `get(conversationId)`
|
|
112
|
+
|
|
113
|
+
Get a conversation by ID.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
const conversation = await client.conversations.get(123);
|
|
117
|
+
console.log(conversation.status); // 'open' | 'resolved' | 'pending' | 'snoozed'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### `getMessages(conversationId)`
|
|
121
|
+
|
|
122
|
+
Get all messages for a conversation.
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
const response = await client.conversations.getMessages(123);
|
|
126
|
+
console.log(response.payload); // Array of messages
|
|
127
|
+
console.log(response.meta); // Metadata including labels, assignee
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### Contacts
|
|
133
|
+
|
|
134
|
+
#### `create(params)`
|
|
135
|
+
|
|
136
|
+
Create a new contact.
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const contact = await client.contacts.create({
|
|
140
|
+
inbox_id: 1,
|
|
141
|
+
name: "John Doe",
|
|
142
|
+
email: "john@example.com",
|
|
143
|
+
phone_number: "+1234567890",
|
|
144
|
+
custom_attributes: { plan: "enterprise" },
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### `update(contactId, params)`
|
|
149
|
+
|
|
150
|
+
Update an existing contact.
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
const contact = await client.contacts.update(123, {
|
|
154
|
+
name: "Jane Doe",
|
|
155
|
+
email: "jane@example.com",
|
|
156
|
+
custom_attributes: { plan: "pro" },
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### `get(contactId)`
|
|
161
|
+
|
|
162
|
+
Get a contact by ID.
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
const contact = await client.contacts.get(123);
|
|
166
|
+
console.log(contact.name, contact.email);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### `delete(contactId)`
|
|
170
|
+
|
|
171
|
+
Delete a contact.
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
await client.contacts.delete(123);
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### `list(params?)`
|
|
178
|
+
|
|
179
|
+
List all contacts with pagination.
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
const response = await client.contacts.list({ page: 1 });
|
|
183
|
+
console.log(response.payload); // Array of contacts
|
|
184
|
+
console.log(response.meta); // Pagination metadata
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### `search(params)`
|
|
188
|
+
|
|
189
|
+
Search contacts by name, identifier, email, or phone number.
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
const response = await client.contacts.search({
|
|
193
|
+
q: "john@example.com",
|
|
194
|
+
page: 1,
|
|
195
|
+
});
|
|
196
|
+
console.log(response.payload);
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### Companies
|
|
202
|
+
|
|
203
|
+
#### `list(params?)`
|
|
204
|
+
|
|
205
|
+
List all companies with pagination.
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
const companies = await client.companies.list();
|
|
209
|
+
|
|
210
|
+
// With pagination
|
|
211
|
+
const companies = await client.companies.list({ page: 2, per_page: 50 });
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### `create(params)`
|
|
215
|
+
|
|
216
|
+
Create a new company.
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
const company = await client.companies.create({
|
|
220
|
+
name: "Acme Corp",
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### `get(companyId)`
|
|
225
|
+
|
|
226
|
+
Get a company by ID.
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
const company = await client.companies.get(456);
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### `update(companyId, params)`
|
|
233
|
+
|
|
234
|
+
Update an existing company.
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
const company = await client.companies.update(456, {
|
|
238
|
+
name: "Acme Corp Updated",
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### `search(query, params?)`
|
|
243
|
+
|
|
244
|
+
Search companies by name.
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
const response = await client.companies.search("Acme");
|
|
248
|
+
|
|
249
|
+
// With pagination
|
|
250
|
+
const response = await client.companies.search("Acme", {
|
|
251
|
+
page: 2,
|
|
252
|
+
per_page: 50,
|
|
253
|
+
});
|
|
254
|
+
console.log(response.payload); // Array of matching companies
|
|
255
|
+
console.log(response.meta); // { count, current_page }
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### `delete(companyId)`
|
|
259
|
+
|
|
260
|
+
Delete a company.
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
await client.companies.delete(456);
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### Company Members
|
|
269
|
+
|
|
270
|
+
Manage contacts within a company via `client.companies.members`.
|
|
271
|
+
|
|
272
|
+
#### `list(companyId)`
|
|
273
|
+
|
|
274
|
+
List all members (contacts) of a company.
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
const members = await client.companies.members.list(456);
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### `add(companyId, params)`
|
|
281
|
+
|
|
282
|
+
Add contacts to a company.
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
const members = await client.companies.members.add(456, {
|
|
286
|
+
contact_ids: [101, 102, 103],
|
|
287
|
+
});
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### `remove(companyId, params)`
|
|
291
|
+
|
|
292
|
+
Remove contacts from a company.
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
await client.companies.members.remove(456, {
|
|
296
|
+
contact_ids: [101, 102],
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
### Inboxes
|
|
303
|
+
|
|
304
|
+
#### `searchPortals(inboxId, params)`
|
|
305
|
+
|
|
306
|
+
Search the knowledge base portals for articles.
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
const articles = await client.inboxes.searchPortals(1, {
|
|
310
|
+
queries: ["shipping", "policy"],
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
articles.forEach((article) => {
|
|
314
|
+
console.log(article.title, article.content);
|
|
315
|
+
});
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
#### `uploadWhatsappMedia(inboxId, params)`
|
|
319
|
+
|
|
320
|
+
Upload media file for WhatsApp messages.
|
|
321
|
+
|
|
322
|
+
```typescript
|
|
323
|
+
// Upload an image
|
|
324
|
+
const file = new File([imageBlob], "photo.jpg", { type: "image/jpeg" });
|
|
325
|
+
const result = await client.inboxes.uploadWhatsappMedia(123, {
|
|
326
|
+
file: file,
|
|
327
|
+
type: "image/jpeg",
|
|
328
|
+
filename: "photo.jpg",
|
|
329
|
+
for_template: false,
|
|
330
|
+
});
|
|
331
|
+
console.log("Media ID:", result.media_id);
|
|
332
|
+
|
|
333
|
+
// Upload a document for template
|
|
334
|
+
const docFile = new File([pdfBlob], "invoice.pdf", { type: "application/pdf" });
|
|
335
|
+
const docResult = await client.inboxes.uploadWhatsappMedia(123, {
|
|
336
|
+
file: docFile,
|
|
337
|
+
type: "application/pdf",
|
|
338
|
+
filename: "invoice.pdf",
|
|
339
|
+
for_template: true,
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### Orders
|
|
346
|
+
|
|
347
|
+
#### `list(params?)`
|
|
348
|
+
|
|
349
|
+
List all orders with pagination and filtering.
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
// List with default pagination
|
|
353
|
+
const response = await client.orders.list();
|
|
354
|
+
console.log(response.data); // Array of orders
|
|
355
|
+
console.log(response.meta); // Pagination metadata
|
|
356
|
+
|
|
357
|
+
// With date filtering
|
|
358
|
+
const response = await client.orders.list({
|
|
359
|
+
page: 1,
|
|
360
|
+
per_page: 50,
|
|
361
|
+
since: "2024-01-01",
|
|
362
|
+
until: "2024-12-31",
|
|
363
|
+
sort: "-created_at",
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// With advanced filtering
|
|
367
|
+
const response = await client.orders.list({
|
|
368
|
+
payload: [{ field: "financial_status", operator: "eq", value: "paid" }],
|
|
369
|
+
});
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
#### `upsert(params)`
|
|
373
|
+
|
|
374
|
+
Create or update an order based on `source` and `source_id`. If an order with the same source and source_id exists, it will be updated.
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
const result = await client.orders.upsert({
|
|
378
|
+
name: "ORD-12345",
|
|
379
|
+
company_id: 101,
|
|
380
|
+
total_amount: 150,
|
|
381
|
+
currency_code: "USD",
|
|
382
|
+
financial_status: "paid",
|
|
383
|
+
fulfillment_status: "fulfilled",
|
|
384
|
+
source: "shopify",
|
|
385
|
+
source_id: "789456123",
|
|
386
|
+
order_url: "https://mystore.myshopify.com/admin/orders/789456123",
|
|
387
|
+
notes: "Customer requested gift wrapping",
|
|
388
|
+
metadata: {
|
|
389
|
+
line_items: [
|
|
390
|
+
{
|
|
391
|
+
part_number: "SKU-001",
|
|
392
|
+
quantity: 2,
|
|
393
|
+
description: "Widget",
|
|
394
|
+
line_total: 75,
|
|
395
|
+
},
|
|
396
|
+
],
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
console.log(result.payload); // The created/updated order
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
### Webhooks
|
|
405
|
+
|
|
406
|
+
Parse and validate incoming webhook events using the `webhookEvent` utility.
|
|
407
|
+
|
|
408
|
+
```typescript
|
|
409
|
+
import { webhookEvent } from "@voltade/envoy-sdk";
|
|
410
|
+
|
|
411
|
+
// In your webhook handler
|
|
412
|
+
app.post("/webhook", (req, res) => {
|
|
413
|
+
// Throws ZodError if invalid
|
|
414
|
+
const event = webhookEvent.parse(req.body);
|
|
415
|
+
|
|
416
|
+
if (event.event === "message_created") {
|
|
417
|
+
console.log("New message:", event.content);
|
|
418
|
+
console.log("Conversation:", event.conversation.id);
|
|
419
|
+
console.log("Sender:", event.sender.name);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
res.sendStatus(200);
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// Or use safeParse for graceful handling
|
|
426
|
+
const event = webhookEvent.safeParse(req.body);
|
|
427
|
+
if (event) {
|
|
428
|
+
// Handle valid event
|
|
429
|
+
} else {
|
|
430
|
+
// Invalid payload
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**Supported webhook events:**
|
|
435
|
+
|
|
436
|
+
- `message_created` - New message in a conversation
|
|
437
|
+
- `message_updated` - Message was updated
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
84
441
|
## Error Handling
|
|
85
442
|
|
|
86
443
|
The SDK provides structured error types:
|
|
@@ -93,85 +450,200 @@ import {
|
|
|
93
450
|
NotFoundError,
|
|
94
451
|
RateLimitError,
|
|
95
452
|
ServerError,
|
|
96
|
-
NetworkError
|
|
97
|
-
|
|
453
|
+
NetworkError,
|
|
454
|
+
ValidationError,
|
|
455
|
+
} from "@voltade/envoy-sdk";
|
|
98
456
|
|
|
99
457
|
try {
|
|
100
|
-
await client.conversations.createMessage(123, { content:
|
|
458
|
+
await client.conversations.createMessage(123, { content: "Hello" });
|
|
101
459
|
} catch (error) {
|
|
102
460
|
if (error instanceof AuthenticationError) {
|
|
103
|
-
console.error(
|
|
461
|
+
console.error("Invalid API key");
|
|
104
462
|
} else if (error instanceof NotFoundError) {
|
|
105
|
-
console.error(
|
|
463
|
+
console.error("Conversation not found");
|
|
106
464
|
} else if (error instanceof RateLimitError) {
|
|
107
|
-
console.error(
|
|
465
|
+
console.error("Rate limit exceeded, retry after:", error.retryAfter);
|
|
466
|
+
} else if (error instanceof BadRequestError) {
|
|
467
|
+
console.error("Bad request:", error.response);
|
|
468
|
+
} else if (error instanceof ValidationError) {
|
|
469
|
+
console.error("Validation failed:", error.errors);
|
|
470
|
+
} else if (error instanceof ServerError) {
|
|
471
|
+
console.error("Server error:", error.statusCode);
|
|
472
|
+
} else if (error instanceof NetworkError) {
|
|
473
|
+
console.error("Network error:", error.originalError);
|
|
108
474
|
}
|
|
109
475
|
}
|
|
110
476
|
```
|
|
111
477
|
|
|
478
|
+
---
|
|
479
|
+
|
|
112
480
|
## Types
|
|
113
481
|
|
|
114
|
-
All TypeScript types are exported
|
|
482
|
+
All TypeScript types are exported:
|
|
115
483
|
|
|
116
484
|
```typescript
|
|
117
485
|
import type {
|
|
486
|
+
// Conversations
|
|
118
487
|
Message,
|
|
119
488
|
Conversation,
|
|
489
|
+
ConversationStatus,
|
|
120
490
|
CreateMessageParams,
|
|
121
491
|
EscalationResponse,
|
|
492
|
+
EscalationType,
|
|
122
493
|
MessageType,
|
|
123
494
|
ContentType,
|
|
124
|
-
|
|
125
|
-
|
|
495
|
+
MessagesResponse,
|
|
496
|
+
MessagesResponseMeta,
|
|
497
|
+
TemplateParams,
|
|
498
|
+
Agent,
|
|
499
|
+
Assignee,
|
|
500
|
+
Team,
|
|
501
|
+
Priority,
|
|
502
|
+
Contact,
|
|
503
|
+
ContactInbox,
|
|
504
|
+
ConversationMeta,
|
|
505
|
+
|
|
506
|
+
// Contacts
|
|
507
|
+
ContactCreateParams,
|
|
508
|
+
ContactUpdateParams,
|
|
509
|
+
ListContactsParams,
|
|
510
|
+
ListContactsResponse,
|
|
511
|
+
SearchContactsParams,
|
|
512
|
+
|
|
513
|
+
// Companies
|
|
514
|
+
Company,
|
|
515
|
+
CreateCompanyParams,
|
|
516
|
+
CreateCompanyResponse,
|
|
517
|
+
GetCompanyResponse,
|
|
518
|
+
ListCompaniesParams,
|
|
519
|
+
ListCompaniesResponse,
|
|
520
|
+
UpdateCompanyParams,
|
|
521
|
+
UpdateCompanyResponse,
|
|
522
|
+
SearchCompaniesResponse,
|
|
523
|
+
|
|
524
|
+
// Company Members
|
|
525
|
+
AddCompanyMembersParams,
|
|
526
|
+
AddCompanyMembersResponse,
|
|
527
|
+
ListCompanyMembersResponse,
|
|
528
|
+
RemoveCompanyMembersParams,
|
|
529
|
+
|
|
530
|
+
// Inboxes
|
|
531
|
+
Article,
|
|
532
|
+
SearchParams,
|
|
533
|
+
SearchResponse,
|
|
534
|
+
UploadWhatsappMediaParams,
|
|
535
|
+
UploadWhatsappMediaResponse,
|
|
536
|
+
|
|
537
|
+
// Orders
|
|
538
|
+
Order,
|
|
539
|
+
OrdersMeta,
|
|
540
|
+
ListOrdersParams,
|
|
541
|
+
ListOrdersResponse,
|
|
542
|
+
UpsertOrderParams,
|
|
543
|
+
UpsertOrderRequest,
|
|
544
|
+
UpsertOrderResponse,
|
|
545
|
+
UpsertOrderResponsePayload,
|
|
546
|
+
|
|
547
|
+
// Webhooks
|
|
548
|
+
WebhookEvent,
|
|
549
|
+
MessageCreatedEvent,
|
|
550
|
+
MessageUpdatedEvent,
|
|
551
|
+
WebhookConversation,
|
|
552
|
+
WebhookMessage,
|
|
553
|
+
WebhookSender,
|
|
554
|
+
|
|
555
|
+
// Client
|
|
556
|
+
EnvoyClientConfig,
|
|
557
|
+
} from "@voltade/envoy-sdk";
|
|
126
558
|
```
|
|
127
559
|
|
|
560
|
+
---
|
|
561
|
+
|
|
128
562
|
## Zod Schemas
|
|
129
563
|
|
|
130
564
|
The SDK exposes Zod schemas for runtime validation. All types are derived from these schemas using `z.infer`:
|
|
131
565
|
|
|
132
566
|
```typescript
|
|
133
567
|
import {
|
|
568
|
+
// Conversations
|
|
134
569
|
MessageSchema,
|
|
570
|
+
ConversationSchema,
|
|
571
|
+
ConversationStatusSchema,
|
|
135
572
|
CreateMessageParamsSchema,
|
|
136
573
|
EscalationResponseSchema,
|
|
137
|
-
|
|
138
|
-
|
|
574
|
+
EscalationTypeSchema,
|
|
575
|
+
MessageTypeSchema,
|
|
576
|
+
ContentTypeSchema,
|
|
577
|
+
MessagesResponseSchema,
|
|
578
|
+
MessagesResponseMetaSchema,
|
|
579
|
+
TemplateParamsSchema,
|
|
580
|
+
AgentSchema,
|
|
581
|
+
AssigneeSchema,
|
|
582
|
+
TeamSchema,
|
|
583
|
+
PrioritySchema,
|
|
584
|
+
ContactSchema,
|
|
585
|
+
ContactInboxSchema,
|
|
586
|
+
ConversationMetaSchema,
|
|
587
|
+
|
|
588
|
+
// Contacts
|
|
589
|
+
ContactCreateParamsSchema,
|
|
590
|
+
ContactUpdateParamsSchema,
|
|
591
|
+
ListContactsParamsSchema,
|
|
592
|
+
ListContactsResponseSchema,
|
|
593
|
+
SearchContactsParamsSchema,
|
|
594
|
+
|
|
595
|
+
// Companies
|
|
596
|
+
CompanySchema,
|
|
597
|
+
CreateCompanyParamsSchema,
|
|
598
|
+
CreateCompanyResponseSchema,
|
|
599
|
+
GetCompanyResponseSchema,
|
|
600
|
+
ListCompaniesParamsSchema,
|
|
601
|
+
ListCompaniesResponseSchema,
|
|
602
|
+
UpdateCompanyParamsSchema,
|
|
603
|
+
UpdateCompanyResponseSchema,
|
|
604
|
+
SearchCompaniesResponseSchema,
|
|
605
|
+
|
|
606
|
+
// Company Members
|
|
607
|
+
AddCompanyMembersParamsSchema,
|
|
608
|
+
AddCompanyMembersResponseSchema,
|
|
609
|
+
ListCompanyMembersResponseSchema,
|
|
610
|
+
RemoveCompanyMembersParamsSchema,
|
|
611
|
+
|
|
612
|
+
// Inboxes
|
|
613
|
+
ArticleSchema,
|
|
614
|
+
SearchParamsSchema,
|
|
615
|
+
SearchResponseSchema,
|
|
616
|
+
UploadWhatsappMediaParamsSchema,
|
|
617
|
+
UploadWhatsappMediaResponseSchema,
|
|
618
|
+
|
|
619
|
+
// Orders
|
|
620
|
+
OrderSchema,
|
|
621
|
+
OrdersMetaSchema,
|
|
622
|
+
ListOrdersParamsSchema,
|
|
623
|
+
ListOrdersResponseSchema,
|
|
624
|
+
UpsertOrderParamsSchema,
|
|
625
|
+
UpsertOrderRequestSchema,
|
|
626
|
+
UpsertOrderResponseSchema,
|
|
627
|
+
UpsertOrderResponsePayloadSchema,
|
|
628
|
+
|
|
629
|
+
// Webhooks
|
|
630
|
+
WebhookEventSchema,
|
|
631
|
+
MessageCreatedEventSchema,
|
|
632
|
+
MessageUpdatedEventSchema,
|
|
633
|
+
WebhookConversationSchema,
|
|
634
|
+
WebhookMessageSchema,
|
|
635
|
+
WebhookSenderSchema,
|
|
636
|
+
} from "@voltade/envoy-sdk";
|
|
139
637
|
|
|
140
638
|
// Validate data at runtime
|
|
141
|
-
const messageData = {
|
|
142
|
-
id: 123,
|
|
143
|
-
content: 'Hello',
|
|
144
|
-
message_type: 'outgoing',
|
|
145
|
-
// ... other fields
|
|
146
|
-
};
|
|
147
|
-
|
|
148
639
|
const validatedMessage = MessageSchema.parse(messageData);
|
|
149
640
|
|
|
150
641
|
// Validate user input
|
|
151
|
-
const userInput = {
|
|
152
|
-
content: 'Hello, world!',
|
|
153
|
-
message_type: 'outgoing',
|
|
154
|
-
private: false
|
|
155
|
-
};
|
|
156
|
-
|
|
157
642
|
const validatedParams = CreateMessageParamsSchema.parse(userInput);
|
|
158
643
|
await client.conversations.createMessage(123, validatedParams);
|
|
159
644
|
```
|
|
160
645
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
All schemas are exported from the SDK:
|
|
164
|
-
- `MessageTypeSchema`
|
|
165
|
-
- `ContentTypeSchema`
|
|
166
|
-
- `CreateMessageParamsSchema`
|
|
167
|
-
- `MessageSchema`
|
|
168
|
-
- `EscalationTypeSchema`
|
|
169
|
-
- `PrioritySchema`
|
|
170
|
-
- `TeamSchema`
|
|
171
|
-
- `AgentSchema`
|
|
172
|
-
- `EscalationResponseSchema`
|
|
173
|
-
- `ConversationStatusSchema`
|
|
174
|
-
- `ConversationSchema`
|
|
646
|
+
---
|
|
175
647
|
|
|
176
648
|
## Development
|
|
177
649
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "./http-client.js";
|
|
2
|
-
import { Companies, Conversations, Inboxes, Orders } from "./resources/index.js";
|
|
2
|
+
import { Companies, Contacts, Conversations, Inboxes, Orders } from "./resources/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Configuration options for EnvoyClient
|
|
5
5
|
*/
|
|
@@ -43,6 +43,10 @@ export declare class EnvoyClient {
|
|
|
43
43
|
* Companies resource for managing companies
|
|
44
44
|
*/
|
|
45
45
|
readonly companies: Companies;
|
|
46
|
+
/**
|
|
47
|
+
* Contacts resource for managing contacts
|
|
48
|
+
*/
|
|
49
|
+
readonly contacts: Contacts;
|
|
46
50
|
/**
|
|
47
51
|
* Conversations resource for managing conversations and messages
|
|
48
52
|
*/
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,SAAS,EACT,aAAa,EACb,OAAO,EACP,MAAM,EACP,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;OAEG;IACH,SAAgB,SAAS,EAAE,SAAS,CAAC;IAErC;;OAEG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC;IAE7C;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC;;OAEG;IACH,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,OAAO,EACP,MAAM,EACP,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;OAEG;IACH,SAAgB,SAAS,EAAE,SAAS,CAAC;IAErC;;OAEG;IACH,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IAEnC;;OAEG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC;IAE7C;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC;;OAEG;IACH,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,iBAAiB;IAerC;;;OAGG;IACH,aAAa,IAAI,UAAU;CAG5B"}
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "./http-client.js";
|
|
2
|
-
import { Companies, Conversations, Inboxes, Orders, } from "./resources/index.js";
|
|
2
|
+
import { Companies, Contacts, Conversations, Inboxes, Orders, } from "./resources/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Envoy API Client
|
|
5
5
|
* A comprehensive SDK for interacting with the Envoy API
|
|
@@ -36,6 +36,7 @@ export class EnvoyClient {
|
|
|
36
36
|
this.httpClient = new HttpClient(httpConfig);
|
|
37
37
|
// Initialize resources
|
|
38
38
|
this.companies = new Companies(this.httpClient);
|
|
39
|
+
this.contacts = new Contacts(this.httpClient);
|
|
39
40
|
this.conversations = new Conversations(this.httpClient);
|
|
40
41
|
this.inboxes = new Inboxes(this.httpClient);
|
|
41
42
|
this.orders = new Orders(this.httpClient);
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,SAAS,EACT,aAAa,EACb,OAAO,EACP,MAAM,GACP,MAAM,sBAAsB,CAAC;AAY9B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,OAAO,EACP,MAAM,GACP,MAAM,sBAAsB,CAAC;AAY9B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,WAAW;IA4BtB,YAAY,MAAyB;QACnC,MAAM,UAAU,GAAqB;YACnC,GAAG,MAAM;SACV,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;QAE7C,uBAAuB;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contacts resource module
|
|
3
|
+
* Provides functionality for managing contacts in Envoy
|
|
4
|
+
*/
|
|
5
|
+
import type { HttpClient } from "../../http-client.js";
|
|
6
|
+
import type { Contact } from "../conversations/types.js";
|
|
7
|
+
import type { ContactCreateParams, ContactUpdateParams, ListContactsParams, ListContactsResponse, SearchContactsParams } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Base resource class that all resource classes extend from
|
|
10
|
+
*/
|
|
11
|
+
declare abstract class BaseResource {
|
|
12
|
+
protected readonly client: HttpClient;
|
|
13
|
+
constructor(client: HttpClient);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Contacts resource class for managing contact-related operations
|
|
17
|
+
*/
|
|
18
|
+
export declare class Contacts extends BaseResource {
|
|
19
|
+
/**
|
|
20
|
+
* Create a new contact
|
|
21
|
+
* @param params - Contact creation parameters (inbox_id is required)
|
|
22
|
+
* @returns The created contact
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const contact = await client.contacts.create({
|
|
27
|
+
* inbox_id: 1,
|
|
28
|
+
* name: 'John Doe',
|
|
29
|
+
* email: 'john@example.com',
|
|
30
|
+
* phone_number: '+1234567890',
|
|
31
|
+
* custom_attributes: { plan: 'enterprise' }
|
|
32
|
+
* });
|
|
33
|
+
* console.log(contact.id);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
create(params: ContactCreateParams): Promise<Contact>;
|
|
37
|
+
/**
|
|
38
|
+
* Update an existing contact
|
|
39
|
+
* @param contactId - ID of the contact to update
|
|
40
|
+
* @param params - Contact update parameters
|
|
41
|
+
* @returns The updated contact
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const contact = await client.contacts.update(123, {
|
|
46
|
+
* name: 'Jane Doe',
|
|
47
|
+
* email: 'jane@example.com',
|
|
48
|
+
* custom_attributes: { plan: 'pro' }
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
update(contactId: number, params: ContactUpdateParams): Promise<Contact>;
|
|
53
|
+
/**
|
|
54
|
+
* Get a contact by ID
|
|
55
|
+
* @param contactId - ID of the contact
|
|
56
|
+
* @returns The contact details
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const contact = await client.contacts.get(123);
|
|
61
|
+
* console.log(contact.name, contact.email);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
get(contactId: number): Promise<Contact>;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a contact
|
|
67
|
+
* @param contactId - ID of the contact to delete
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* await client.contacts.delete(123);
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
delete(contactId: number): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* List all contacts with pagination
|
|
77
|
+
* @param params - Query parameters for pagination and sorting
|
|
78
|
+
* @returns Paginated list of contacts
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const response = await client.contacts.list({ page: 1 });
|
|
83
|
+
* console.log(response.payload); // Array of contacts
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
list(params?: ListContactsParams): Promise<ListContactsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Search contacts by name, identifier, email, or phone number
|
|
89
|
+
* @param params - Search query and pagination parameters
|
|
90
|
+
* @returns Matching contacts
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* const response = await client.contacts.search({
|
|
95
|
+
* q: 'john@example.com',
|
|
96
|
+
* page: 1
|
|
97
|
+
* });
|
|
98
|
+
* console.log(response.payload);
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
search(params: SearchContactsParams): Promise<ListContactsResponse>;
|
|
102
|
+
}
|
|
103
|
+
export type { ContactCreateParams, ContactUpdateParams, ListContactsParams, ListContactsResponse, SearchContactsParams, } from "./types.js";
|
|
104
|
+
export { ContactCreateParamsSchema, ContactUpdateParamsSchema, ListContactsParamsSchema, ListContactsResponseSchema, SearchContactsParamsSchema, } from "./types.js";
|
|
105
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../resources/contacts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,uBAAe,YAAY;IACb,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;CAClD;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,YAAY;IACxC;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3D;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,OAAO,CAAC;IAInB;;;;;;;;;;OAUG;IACG,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C;;;;;;;;OAQG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;;;;;;;OAUG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAetE;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAgB1E;AAGD,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contacts resource module
|
|
3
|
+
* Provides functionality for managing contacts in Envoy
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Base resource class that all resource classes extend from
|
|
7
|
+
*/
|
|
8
|
+
class BaseResource {
|
|
9
|
+
constructor(client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Contacts resource class for managing contact-related operations
|
|
15
|
+
*/
|
|
16
|
+
export class Contacts extends BaseResource {
|
|
17
|
+
/**
|
|
18
|
+
* Create a new contact
|
|
19
|
+
* @param params - Contact creation parameters (inbox_id is required)
|
|
20
|
+
* @returns The created contact
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const contact = await client.contacts.create({
|
|
25
|
+
* inbox_id: 1,
|
|
26
|
+
* name: 'John Doe',
|
|
27
|
+
* email: 'john@example.com',
|
|
28
|
+
* phone_number: '+1234567890',
|
|
29
|
+
* custom_attributes: { plan: 'enterprise' }
|
|
30
|
+
* });
|
|
31
|
+
* console.log(contact.id);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
async create(params) {
|
|
35
|
+
return await this.client.post("/contacts", params);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update an existing contact
|
|
39
|
+
* @param contactId - ID of the contact to update
|
|
40
|
+
* @param params - Contact update parameters
|
|
41
|
+
* @returns The updated contact
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const contact = await client.contacts.update(123, {
|
|
46
|
+
* name: 'Jane Doe',
|
|
47
|
+
* email: 'jane@example.com',
|
|
48
|
+
* custom_attributes: { plan: 'pro' }
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
async update(contactId, params) {
|
|
53
|
+
return await this.client.put(`/contacts/${contactId}`, params);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get a contact by ID
|
|
57
|
+
* @param contactId - ID of the contact
|
|
58
|
+
* @returns The contact details
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const contact = await client.contacts.get(123);
|
|
63
|
+
* console.log(contact.name, contact.email);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
async get(contactId) {
|
|
67
|
+
return await this.client.get(`/contacts/${contactId}`);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Delete a contact
|
|
71
|
+
* @param contactId - ID of the contact to delete
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* await client.contacts.delete(123);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
async delete(contactId) {
|
|
79
|
+
await this.client.delete(`/contacts/${contactId}`);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* List all contacts with pagination
|
|
83
|
+
* @param params - Query parameters for pagination and sorting
|
|
84
|
+
* @returns Paginated list of contacts
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const response = await client.contacts.list({ page: 1 });
|
|
89
|
+
* console.log(response.payload); // Array of contacts
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
async list(params) {
|
|
93
|
+
const queryParams = {};
|
|
94
|
+
if (params?.page !== undefined) {
|
|
95
|
+
queryParams.page = params.page;
|
|
96
|
+
}
|
|
97
|
+
if (params?.sort) {
|
|
98
|
+
queryParams.sort = params.sort;
|
|
99
|
+
}
|
|
100
|
+
return await this.client.get("/contacts", {
|
|
101
|
+
params: queryParams,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Search contacts by name, identifier, email, or phone number
|
|
106
|
+
* @param params - Search query and pagination parameters
|
|
107
|
+
* @returns Matching contacts
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const response = await client.contacts.search({
|
|
112
|
+
* q: 'john@example.com',
|
|
113
|
+
* page: 1
|
|
114
|
+
* });
|
|
115
|
+
* console.log(response.payload);
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
async search(params) {
|
|
119
|
+
const queryParams = {
|
|
120
|
+
q: params.q,
|
|
121
|
+
};
|
|
122
|
+
if (params.page !== undefined) {
|
|
123
|
+
queryParams.page = params.page;
|
|
124
|
+
}
|
|
125
|
+
if (params.sort) {
|
|
126
|
+
queryParams.sort = params.sort;
|
|
127
|
+
}
|
|
128
|
+
return await this.client.get("/contacts/search", {
|
|
129
|
+
params: queryParams,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Re-export Zod schemas
|
|
134
|
+
export { ContactCreateParamsSchema, ContactUpdateParamsSchema, ListContactsParamsSchema, ListContactsResponseSchema, SearchContactsParamsSchema, } from "./types.js";
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../resources/contacts/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;GAEG;AACH,MAAe,YAAY;IACzB,YAA+B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,YAAY;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,MAA2B;QAE3B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,aAAa,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,GAAG,CAAC,SAAiB;QACzB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,aAAa,SAAS,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,SAAS,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,CAAC,MAA2B;QACpC,MAAM,WAAW,GAAoC,EAAE,CAAC;QAExD,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjC,CAAC;QACD,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;YACjB,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjC,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAuB,WAAW,EAAE;YAC9D,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CAAC,MAA4B;QACvC,MAAM,WAAW,GAAoC;YACnD,CAAC,EAAE,MAAM,CAAC,CAAC;SACZ,CAAC;QAEF,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjC,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjC,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAuB,kBAAkB,EAAE;YACrE,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;CACF;AAWD,wBAAwB;AACxB,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ContactSchema, ContactInboxSchema, type Contact, type ContactInbox } from "../conversations/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Zod Schemas for Contacts
|
|
5
|
+
*/
|
|
6
|
+
export declare const ContactCreateParamsSchema: z.ZodObject<{
|
|
7
|
+
inbox_id: z.ZodNumber;
|
|
8
|
+
name: z.ZodOptional<z.ZodString>;
|
|
9
|
+
email: z.ZodOptional<z.ZodString>;
|
|
10
|
+
phone_number: z.ZodOptional<z.ZodString>;
|
|
11
|
+
avatar_url: z.ZodOptional<z.ZodString>;
|
|
12
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
13
|
+
custom_attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
inbox_id: number;
|
|
16
|
+
name?: string | undefined;
|
|
17
|
+
email?: string | undefined;
|
|
18
|
+
avatar_url?: string | undefined;
|
|
19
|
+
phone_number?: string | undefined;
|
|
20
|
+
identifier?: string | undefined;
|
|
21
|
+
custom_attributes?: Record<string, unknown> | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
inbox_id: number;
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
email?: string | undefined;
|
|
26
|
+
avatar_url?: string | undefined;
|
|
27
|
+
phone_number?: string | undefined;
|
|
28
|
+
identifier?: string | undefined;
|
|
29
|
+
custom_attributes?: Record<string, unknown> | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const ContactUpdateParamsSchema: z.ZodObject<{
|
|
32
|
+
name: z.ZodOptional<z.ZodString>;
|
|
33
|
+
email: z.ZodOptional<z.ZodString>;
|
|
34
|
+
phone_number: z.ZodOptional<z.ZodString>;
|
|
35
|
+
avatar_url: z.ZodOptional<z.ZodString>;
|
|
36
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
37
|
+
custom_attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
email?: string | undefined;
|
|
41
|
+
avatar_url?: string | undefined;
|
|
42
|
+
phone_number?: string | undefined;
|
|
43
|
+
identifier?: string | undefined;
|
|
44
|
+
custom_attributes?: Record<string, unknown> | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
email?: string | undefined;
|
|
48
|
+
avatar_url?: string | undefined;
|
|
49
|
+
phone_number?: string | undefined;
|
|
50
|
+
identifier?: string | undefined;
|
|
51
|
+
custom_attributes?: Record<string, unknown> | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const ListContactsParamsSchema: z.ZodObject<{
|
|
54
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
55
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
page: number;
|
|
58
|
+
sort?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
sort?: string | undefined;
|
|
61
|
+
page?: number | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const ListContactsResponseSchema: z.ZodObject<{
|
|
64
|
+
payload: z.ZodArray<z.ZodObject<{
|
|
65
|
+
id: z.ZodNumber;
|
|
66
|
+
name: z.ZodNullable<z.ZodString>;
|
|
67
|
+
email: z.ZodNullable<z.ZodString>;
|
|
68
|
+
phone_number: z.ZodNullable<z.ZodString>;
|
|
69
|
+
thumbnail: z.ZodString;
|
|
70
|
+
identifier: z.ZodNullable<z.ZodString>;
|
|
71
|
+
additional_attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
72
|
+
custom_attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
73
|
+
blocked: z.ZodBoolean;
|
|
74
|
+
customer_stage: z.ZodString;
|
|
75
|
+
customer_stage_explanation: z.ZodNullable<z.ZodString>;
|
|
76
|
+
type: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
name: string | null;
|
|
79
|
+
id: number;
|
|
80
|
+
email: string | null;
|
|
81
|
+
thumbnail: string;
|
|
82
|
+
phone_number: string | null;
|
|
83
|
+
identifier: string | null;
|
|
84
|
+
additional_attributes: Record<string, unknown>;
|
|
85
|
+
custom_attributes: Record<string, unknown>;
|
|
86
|
+
blocked: boolean;
|
|
87
|
+
customer_stage: string;
|
|
88
|
+
customer_stage_explanation: string | null;
|
|
89
|
+
type?: string | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
name: string | null;
|
|
92
|
+
id: number;
|
|
93
|
+
email: string | null;
|
|
94
|
+
thumbnail: string;
|
|
95
|
+
phone_number: string | null;
|
|
96
|
+
identifier: string | null;
|
|
97
|
+
additional_attributes: Record<string, unknown>;
|
|
98
|
+
custom_attributes: Record<string, unknown>;
|
|
99
|
+
blocked: boolean;
|
|
100
|
+
customer_stage: string;
|
|
101
|
+
customer_stage_explanation: string | null;
|
|
102
|
+
type?: string | undefined;
|
|
103
|
+
}>, "many">;
|
|
104
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
current_page: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
count?: number | undefined;
|
|
109
|
+
current_page?: number | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
count?: number | undefined;
|
|
112
|
+
current_page?: number | undefined;
|
|
113
|
+
}>>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
payload: {
|
|
116
|
+
name: string | null;
|
|
117
|
+
id: number;
|
|
118
|
+
email: string | null;
|
|
119
|
+
thumbnail: string;
|
|
120
|
+
phone_number: string | null;
|
|
121
|
+
identifier: string | null;
|
|
122
|
+
additional_attributes: Record<string, unknown>;
|
|
123
|
+
custom_attributes: Record<string, unknown>;
|
|
124
|
+
blocked: boolean;
|
|
125
|
+
customer_stage: string;
|
|
126
|
+
customer_stage_explanation: string | null;
|
|
127
|
+
type?: string | undefined;
|
|
128
|
+
}[];
|
|
129
|
+
meta?: {
|
|
130
|
+
count?: number | undefined;
|
|
131
|
+
current_page?: number | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
payload: {
|
|
135
|
+
name: string | null;
|
|
136
|
+
id: number;
|
|
137
|
+
email: string | null;
|
|
138
|
+
thumbnail: string;
|
|
139
|
+
phone_number: string | null;
|
|
140
|
+
identifier: string | null;
|
|
141
|
+
additional_attributes: Record<string, unknown>;
|
|
142
|
+
custom_attributes: Record<string, unknown>;
|
|
143
|
+
blocked: boolean;
|
|
144
|
+
customer_stage: string;
|
|
145
|
+
customer_stage_explanation: string | null;
|
|
146
|
+
type?: string | undefined;
|
|
147
|
+
}[];
|
|
148
|
+
meta?: {
|
|
149
|
+
count?: number | undefined;
|
|
150
|
+
current_page?: number | undefined;
|
|
151
|
+
} | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
export declare const SearchContactsParamsSchema: z.ZodObject<{
|
|
154
|
+
q: z.ZodString;
|
|
155
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
156
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
page: number;
|
|
159
|
+
q: string;
|
|
160
|
+
sort?: string | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
q: string;
|
|
163
|
+
sort?: string | undefined;
|
|
164
|
+
page?: number | undefined;
|
|
165
|
+
}>;
|
|
166
|
+
/**
|
|
167
|
+
* TypeScript Types (inferred from Zod schemas)
|
|
168
|
+
*/
|
|
169
|
+
export type ContactCreateParams = z.infer<typeof ContactCreateParamsSchema>;
|
|
170
|
+
export type ContactUpdateParams = z.infer<typeof ContactUpdateParamsSchema>;
|
|
171
|
+
export type ListContactsParams = z.infer<typeof ListContactsParamsSchema>;
|
|
172
|
+
export type ListContactsResponse = z.infer<typeof ListContactsResponseSchema>;
|
|
173
|
+
export type SearchContactsParams = z.infer<typeof SearchContactsParamsSchema>;
|
|
174
|
+
export { ContactSchema, ContactInboxSchema };
|
|
175
|
+
export type { Contact, ContactInbox };
|
|
176
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../resources/contacts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,KAAK,OAAO,EACZ,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;EAkBpC,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;EAiBpC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AAEH;;GAEG;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAG9E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAC7C,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ContactSchema, ContactInboxSchema, } from "../conversations/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Zod Schemas for Contacts
|
|
5
|
+
*/
|
|
6
|
+
// Contact create parameters schema
|
|
7
|
+
export const ContactCreateParamsSchema = z.object({
|
|
8
|
+
inbox_id: z.number().describe("ID of the inbox"),
|
|
9
|
+
name: z.string().optional().describe("Name of the contact"),
|
|
10
|
+
email: z.string().email().optional().describe("Email of the contact"),
|
|
11
|
+
phone_number: z.string().optional().describe("Phone number of the contact"),
|
|
12
|
+
avatar_url: z
|
|
13
|
+
.string()
|
|
14
|
+
.url()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("URL to a jpeg, png file for the contact avatar"),
|
|
17
|
+
identifier: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("A unique identifier for the contact in external system"),
|
|
21
|
+
custom_attributes: z
|
|
22
|
+
.record(z.unknown())
|
|
23
|
+
.optional()
|
|
24
|
+
.describe("Custom attributes for the contact"),
|
|
25
|
+
});
|
|
26
|
+
// Contact update parameters schema
|
|
27
|
+
export const ContactUpdateParamsSchema = z.object({
|
|
28
|
+
name: z.string().optional().describe("Name of the contact"),
|
|
29
|
+
email: z.string().email().optional().describe("Email of the contact"),
|
|
30
|
+
phone_number: z.string().optional().describe("Phone number of the contact"),
|
|
31
|
+
avatar_url: z
|
|
32
|
+
.string()
|
|
33
|
+
.url()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("URL to a jpeg, png file for the contact avatar"),
|
|
36
|
+
identifier: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("A unique identifier for the contact in external system"),
|
|
40
|
+
custom_attributes: z
|
|
41
|
+
.record(z.unknown())
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Custom attributes for the contact"),
|
|
44
|
+
});
|
|
45
|
+
// List contacts parameters schema
|
|
46
|
+
export const ListContactsParamsSchema = z.object({
|
|
47
|
+
page: z.number().int().positive().optional().default(1),
|
|
48
|
+
sort: z.string().optional().describe("Sort order for contacts"),
|
|
49
|
+
});
|
|
50
|
+
// List contacts response schema
|
|
51
|
+
export const ListContactsResponseSchema = z.object({
|
|
52
|
+
payload: z.array(ContactSchema),
|
|
53
|
+
meta: z
|
|
54
|
+
.object({
|
|
55
|
+
count: z.number().optional(),
|
|
56
|
+
current_page: z.number().optional(),
|
|
57
|
+
})
|
|
58
|
+
.optional(),
|
|
59
|
+
});
|
|
60
|
+
// Search contacts parameters schema
|
|
61
|
+
export const SearchContactsParamsSchema = z.object({
|
|
62
|
+
q: z.string().describe("Search query (name, identifier, email, or phone)"),
|
|
63
|
+
page: z.number().int().positive().optional().default(1),
|
|
64
|
+
sort: z.string().optional().describe("Sort order for contacts"),
|
|
65
|
+
});
|
|
66
|
+
// Re-export from conversations for convenience
|
|
67
|
+
export { ContactSchema, ContactInboxSchema };
|
|
68
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../resources/contacts/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/dist/resources/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../resources/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED