@talqing/sdk 0.4.5 → 0.6.0
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 +15 -12
- package/dist/cjs/gen/index.d.ts +1 -1
- package/dist/cjs/gen/index.d.ts.map +1 -1
- package/dist/cjs/gen/sdk.gen.d.ts +334 -44
- package/dist/cjs/gen/sdk.gen.d.ts.map +1 -1
- package/dist/cjs/gen/sdk.gen.js +719 -68
- package/dist/cjs/gen/sdk.gen.js.map +1 -1
- package/dist/cjs/gen/types.gen.d.ts +5009 -2767
- package/dist/cjs/gen/types.gen.d.ts.map +1 -1
- package/dist/esm/gen/index.d.ts +1 -1
- package/dist/esm/gen/index.d.ts.map +1 -1
- package/dist/esm/gen/sdk.gen.d.ts +334 -44
- package/dist/esm/gen/sdk.gen.d.ts.map +1 -1
- package/dist/esm/gen/sdk.gen.js +708 -66
- package/dist/esm/gen/sdk.gen.js.map +1 -1
- package/dist/esm/gen/types.gen.d.ts +5009 -2767
- package/dist/esm/gen/types.gen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/gen/index.ts +1 -1
- package/src/gen/sdk.gen.ts +842 -78
- package/src/gen/types.gen.ts +5254 -2847
package/dist/cjs/gen/sdk.gen.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.TalqingApi = exports.Webhooks = void 0;
|
|
4
|
+
exports.Runs = exports.Telephony = exports.Providers = exports.PhoneNumbers = exports.Accounts = exports.Streams = exports.Secrets = exports.Schemas = exports.Functions = exports.Observability = exports.Knowledge2 = exports.Pages = exports.Nodes = exports.Integrations = exports.Triggers = exports.McpTools = exports.Email = exports.Senders = exports.Batches2 = exports.Sends = exports.Recipients2 = exports.Copilot = exports.Tools = exports.Tasks = exports.Knowledge = exports.Agents2 = exports.Conversations = exports.Sessions = exports.Items2 = exports.Chats = exports.Tokens = exports.Messages = exports.Items = exports.Analysis2 = exports.Catalog = exports.Voices = exports.Elevenlabs = exports.Models = exports.Avatars = exports.Calls = exports.ScreenRecording = exports.Recording = exports.Batches = exports.Recipients = exports.Analysis = exports.ProviderKeys = exports.Billing = exports.Credits = exports.Agents = exports.Versions = void 0;
|
|
5
|
+
exports.TalqingApi = exports.Whatsapp = exports.TwilioSenders = exports.Templates = exports.Batches3 = exports.Recipients3 = exports.Webhooks = exports.Tools2 = exports.Versions3 = exports.Tasks2 = exports.Versions2 = void 0;
|
|
6
6
|
const client_gen_js_1 = require("./client.gen.js");
|
|
7
7
|
const index_js_1 = require("./client/index.js");
|
|
8
8
|
class HeyApiClient {
|
|
@@ -134,7 +134,7 @@ class Agents extends HeyApiClient {
|
|
|
134
134
|
/**
|
|
135
135
|
* Delete Agent
|
|
136
136
|
*
|
|
137
|
-
* Delete an agent and its
|
|
137
|
+
* Delete an agent and its versions permanently; 409 while anything still points at it.
|
|
138
138
|
*/
|
|
139
139
|
delete(parameters, options) {
|
|
140
140
|
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }] }]);
|
|
@@ -594,7 +594,9 @@ class Batches extends HeyApiClient {
|
|
|
594
594
|
*
|
|
595
595
|
* Two things you would otherwise learn from an invoice:
|
|
596
596
|
*
|
|
597
|
-
* - **
|
|
597
|
+
* - **Voicemail is answered and billed** unless the agent has
|
|
598
|
+
* `voicemail_detection` on; then it hangs up (optionally after a message),
|
|
599
|
+
* and the recipient is retried like a missed call.
|
|
598
600
|
* - **Calls run your agent's current published version.** Republishing changes
|
|
599
601
|
* every call placed after that moment.
|
|
600
602
|
*/
|
|
@@ -617,6 +619,27 @@ class Batches extends HeyApiClient {
|
|
|
617
619
|
}
|
|
618
620
|
});
|
|
619
621
|
}
|
|
622
|
+
/**
|
|
623
|
+
* Delete Call Batch
|
|
624
|
+
*
|
|
625
|
+
* Delete a finished batch and its recipient list for good. Its calls stay.
|
|
626
|
+
*
|
|
627
|
+
* Refused while it is live or a call of it is still in progress; cancel it first.
|
|
628
|
+
*/
|
|
629
|
+
delete(parameters, options) {
|
|
630
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
631
|
+
return (options?.client ?? this.client).delete({
|
|
632
|
+
responseStyle: 'data',
|
|
633
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
634
|
+
in: 'cookie',
|
|
635
|
+
name: 'talqing_session',
|
|
636
|
+
type: 'apiKey'
|
|
637
|
+
}],
|
|
638
|
+
url: '/v1/calls/batches/{batch_id}',
|
|
639
|
+
...options,
|
|
640
|
+
...params
|
|
641
|
+
});
|
|
642
|
+
}
|
|
620
643
|
/**
|
|
621
644
|
* Get Call Batch
|
|
622
645
|
*
|
|
@@ -672,7 +695,7 @@ class Batches extends HeyApiClient {
|
|
|
672
695
|
/**
|
|
673
696
|
* Cancel Call Batch
|
|
674
697
|
*
|
|
675
|
-
* Stop a batch for good. There is no undo
|
|
698
|
+
* Stop a batch for good. There is no undo.
|
|
676
699
|
*
|
|
677
700
|
* Everyone not yet called immediately reads as `canceled`. Calls already
|
|
678
701
|
* ringing or in progress are **not** dropped — they run to their natural end,
|
|
@@ -1289,21 +1312,92 @@ class Catalog extends HeyApiClient {
|
|
|
1289
1312
|
}
|
|
1290
1313
|
}
|
|
1291
1314
|
exports.Catalog = Catalog;
|
|
1292
|
-
class
|
|
1315
|
+
class Analysis2 extends HeyApiClient {
|
|
1316
|
+
/**
|
|
1317
|
+
* Rerun Chat Analysis
|
|
1318
|
+
*
|
|
1319
|
+
* Analyse an ended chat again with its agent's saved definition.
|
|
1320
|
+
*
|
|
1321
|
+
* A real model call: the workspace is charged and the chat re-priced.
|
|
1322
|
+
*/
|
|
1323
|
+
rerun(parameters, options) {
|
|
1324
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }] }]);
|
|
1325
|
+
return (options?.client ?? this.client).post({
|
|
1326
|
+
responseStyle: 'data',
|
|
1327
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1328
|
+
in: 'cookie',
|
|
1329
|
+
name: 'talqing_session',
|
|
1330
|
+
type: 'apiKey'
|
|
1331
|
+
}],
|
|
1332
|
+
url: '/v1/chats/{chat_id}/analysis',
|
|
1333
|
+
...options,
|
|
1334
|
+
...params
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* Preview Chat Analysis
|
|
1339
|
+
*
|
|
1340
|
+
* Try an analysis definition against an ended chat. Nothing is saved; costs one model call.
|
|
1341
|
+
*/
|
|
1342
|
+
preview(parameters, options) {
|
|
1343
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }, { key: 'previewAnalysisRequest', map: 'body' }] }]);
|
|
1344
|
+
return (options?.client ?? this.client).post({
|
|
1345
|
+
responseStyle: 'data',
|
|
1346
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1347
|
+
in: 'cookie',
|
|
1348
|
+
name: 'talqing_session',
|
|
1349
|
+
type: 'apiKey'
|
|
1350
|
+
}],
|
|
1351
|
+
url: '/v1/chats/{chat_id}/analysis/preview',
|
|
1352
|
+
...options,
|
|
1353
|
+
...params,
|
|
1354
|
+
headers: {
|
|
1355
|
+
'Content-Type': 'application/json',
|
|
1356
|
+
...options?.headers,
|
|
1357
|
+
...params.headers
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
exports.Analysis2 = Analysis2;
|
|
1363
|
+
class Items extends HeyApiClient {
|
|
1293
1364
|
/**
|
|
1294
|
-
*
|
|
1365
|
+
* List Chat Items
|
|
1295
1366
|
*
|
|
1296
|
-
*
|
|
1367
|
+
* The messages, tool calls and handoffs of one chat.
|
|
1368
|
+
*/
|
|
1369
|
+
list(parameters, options) {
|
|
1370
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
1371
|
+
{ in: 'path', key: 'chat_id' },
|
|
1372
|
+
{ in: 'query', key: 'limit' },
|
|
1373
|
+
{ in: 'query', key: 'offset' },
|
|
1374
|
+
{ in: 'query', key: 'order' }
|
|
1375
|
+
] }]);
|
|
1376
|
+
return (options?.client ?? this.client).get({
|
|
1377
|
+
responseStyle: 'data',
|
|
1378
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1379
|
+
in: 'cookie',
|
|
1380
|
+
name: 'talqing_session',
|
|
1381
|
+
type: 'apiKey'
|
|
1382
|
+
}],
|
|
1383
|
+
url: '/v1/chats/{chat_id}/items',
|
|
1384
|
+
...options,
|
|
1385
|
+
...params
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
exports.Items = Items;
|
|
1390
|
+
class Messages extends HeyApiClient {
|
|
1391
|
+
/**
|
|
1392
|
+
* Create Chat Message
|
|
1297
1393
|
*
|
|
1298
|
-
*
|
|
1299
|
-
* same thread. `client_message_id` is a UUID you generate; re-sending with the
|
|
1300
|
-
* same one is ignored rather than duplicated.
|
|
1394
|
+
* Send a message and get the agent's reply back on this request.
|
|
1301
1395
|
*
|
|
1302
|
-
*
|
|
1303
|
-
*
|
|
1396
|
+
* A newer message supersedes one still being answered: the older request
|
|
1397
|
+
* returns `status: canceled` with `superseded_by_item_id`.
|
|
1304
1398
|
*/
|
|
1305
1399
|
create(parameters, options) {
|
|
1306
|
-
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: '
|
|
1400
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }, { key: 'chatMessageRequest', map: 'body' }] }]);
|
|
1307
1401
|
return (options?.client ?? this.client).post({
|
|
1308
1402
|
responseStyle: 'data',
|
|
1309
1403
|
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
@@ -1311,7 +1405,7 @@ class Messages extends HeyApiClient {
|
|
|
1311
1405
|
name: 'talqing_session',
|
|
1312
1406
|
type: 'apiKey'
|
|
1313
1407
|
}],
|
|
1314
|
-
url: '/v1/
|
|
1408
|
+
url: '/v1/chats/{chat_id}/messages',
|
|
1315
1409
|
...options,
|
|
1316
1410
|
...params,
|
|
1317
1411
|
headers: {
|
|
@@ -1323,7 +1417,172 @@ class Messages extends HeyApiClient {
|
|
|
1323
1417
|
}
|
|
1324
1418
|
}
|
|
1325
1419
|
exports.Messages = Messages;
|
|
1326
|
-
class
|
|
1420
|
+
class Tokens extends HeyApiClient {
|
|
1421
|
+
/**
|
|
1422
|
+
* Create Chat Token
|
|
1423
|
+
*
|
|
1424
|
+
* Mint a one-hour browser token for this chat. Mint another to refresh.
|
|
1425
|
+
*/
|
|
1426
|
+
create(parameters, options) {
|
|
1427
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }] }]);
|
|
1428
|
+
return (options?.client ?? this.client).post({
|
|
1429
|
+
responseStyle: 'data',
|
|
1430
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1431
|
+
in: 'cookie',
|
|
1432
|
+
name: 'talqing_session',
|
|
1433
|
+
type: 'apiKey'
|
|
1434
|
+
}],
|
|
1435
|
+
url: '/v1/chats/{chat_id}/token',
|
|
1436
|
+
...options,
|
|
1437
|
+
...params
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
exports.Tokens = Tokens;
|
|
1442
|
+
class Chats extends HeyApiClient {
|
|
1443
|
+
/**
|
|
1444
|
+
* List Chats
|
|
1445
|
+
*
|
|
1446
|
+
* List chats, newest first.
|
|
1447
|
+
*/
|
|
1448
|
+
list(parameters, options) {
|
|
1449
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
1450
|
+
{ in: 'query', key: 'limit' },
|
|
1451
|
+
{ in: 'query', key: 'offset' },
|
|
1452
|
+
{ in: 'query', key: 'agent_id' },
|
|
1453
|
+
{ in: 'query', key: 'contact_key' },
|
|
1454
|
+
{ in: 'query', key: 'status' }
|
|
1455
|
+
] }]);
|
|
1456
|
+
return (options?.client ?? this.client).get({
|
|
1457
|
+
responseStyle: 'data',
|
|
1458
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1459
|
+
in: 'cookie',
|
|
1460
|
+
name: 'talqing_session',
|
|
1461
|
+
type: 'apiKey'
|
|
1462
|
+
}],
|
|
1463
|
+
url: '/v1/chats',
|
|
1464
|
+
...options,
|
|
1465
|
+
...params
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Create Chat
|
|
1470
|
+
*
|
|
1471
|
+
* Start a chat with a text agent. Send it messages with `create_chat_message`.
|
|
1472
|
+
*
|
|
1473
|
+
* It stays open until the agent's `end_call` tool or `end_chat` ends it. Starting
|
|
1474
|
+
* one ends the contact's open chat with the same agent.
|
|
1475
|
+
*/
|
|
1476
|
+
create(parameters, options) {
|
|
1477
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createChatRequest', map: 'body' }] }]);
|
|
1478
|
+
return (options?.client ?? this.client).post({
|
|
1479
|
+
responseStyle: 'data',
|
|
1480
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1481
|
+
in: 'cookie',
|
|
1482
|
+
name: 'talqing_session',
|
|
1483
|
+
type: 'apiKey'
|
|
1484
|
+
}],
|
|
1485
|
+
url: '/v1/chats',
|
|
1486
|
+
...options,
|
|
1487
|
+
...params,
|
|
1488
|
+
headers: {
|
|
1489
|
+
'Content-Type': 'application/json',
|
|
1490
|
+
...options?.headers,
|
|
1491
|
+
...params.headers
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* Delete Chat
|
|
1497
|
+
*
|
|
1498
|
+
* Erase an ended chat's content; the chat and its cost stay. Cannot be undone.
|
|
1499
|
+
*/
|
|
1500
|
+
delete(parameters, options) {
|
|
1501
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }] }]);
|
|
1502
|
+
return (options?.client ?? this.client).delete({
|
|
1503
|
+
responseStyle: 'data',
|
|
1504
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1505
|
+
in: 'cookie',
|
|
1506
|
+
name: 'talqing_session',
|
|
1507
|
+
type: 'apiKey'
|
|
1508
|
+
}],
|
|
1509
|
+
url: '/v1/chats/{chat_id}',
|
|
1510
|
+
...options,
|
|
1511
|
+
...params
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* Get Chat
|
|
1516
|
+
*
|
|
1517
|
+
* Read one chat: its status, cost so far and, once ended, its analysis.
|
|
1518
|
+
*/
|
|
1519
|
+
get(parameters, options) {
|
|
1520
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }] }]);
|
|
1521
|
+
return (options?.client ?? this.client).get({
|
|
1522
|
+
responseStyle: 'data',
|
|
1523
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1524
|
+
in: 'cookie',
|
|
1525
|
+
name: 'talqing_session',
|
|
1526
|
+
type: 'apiKey'
|
|
1527
|
+
}],
|
|
1528
|
+
url: '/v1/chats/{chat_id}',
|
|
1529
|
+
...options,
|
|
1530
|
+
...params
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Get Chat Detail
|
|
1535
|
+
*
|
|
1536
|
+
* One chat with its health snapshot, cost lines, vars and event trace.
|
|
1537
|
+
*/
|
|
1538
|
+
detail(parameters, options) {
|
|
1539
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }] }]);
|
|
1540
|
+
return (options?.client ?? this.client).get({
|
|
1541
|
+
responseStyle: 'data',
|
|
1542
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1543
|
+
in: 'cookie',
|
|
1544
|
+
name: 'talqing_session',
|
|
1545
|
+
type: 'apiKey'
|
|
1546
|
+
}],
|
|
1547
|
+
url: '/v1/chats/{chat_id}/detail',
|
|
1548
|
+
...options,
|
|
1549
|
+
...params
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* End Chat
|
|
1554
|
+
*
|
|
1555
|
+
* End a chat. Its analysis and `session.completed` webhook follow.
|
|
1556
|
+
*/
|
|
1557
|
+
end(parameters, options) {
|
|
1558
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'chat_id' }] }]);
|
|
1559
|
+
return (options?.client ?? this.client).post({
|
|
1560
|
+
responseStyle: 'data',
|
|
1561
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1562
|
+
in: 'cookie',
|
|
1563
|
+
name: 'talqing_session',
|
|
1564
|
+
type: 'apiKey'
|
|
1565
|
+
}],
|
|
1566
|
+
url: '/v1/chats/{chat_id}/end',
|
|
1567
|
+
...options,
|
|
1568
|
+
...params
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
get analysis() {
|
|
1572
|
+
return this._analysis ?? (this._analysis = new Analysis2({ client: this.client }));
|
|
1573
|
+
}
|
|
1574
|
+
get items() {
|
|
1575
|
+
return this._items ?? (this._items = new Items({ client: this.client }));
|
|
1576
|
+
}
|
|
1577
|
+
get messages() {
|
|
1578
|
+
return this._messages ?? (this._messages = new Messages({ client: this.client }));
|
|
1579
|
+
}
|
|
1580
|
+
get tokens() {
|
|
1581
|
+
return this._tokens ?? (this._tokens = new Tokens({ client: this.client }));
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
exports.Chats = Chats;
|
|
1585
|
+
class Items2 extends HeyApiClient {
|
|
1327
1586
|
/**
|
|
1328
1587
|
* List Conversation Items
|
|
1329
1588
|
*
|
|
@@ -1354,17 +1613,16 @@ class Items extends HeyApiClient {
|
|
|
1354
1613
|
});
|
|
1355
1614
|
}
|
|
1356
1615
|
}
|
|
1357
|
-
exports.
|
|
1616
|
+
exports.Items2 = Items2;
|
|
1358
1617
|
class Sessions extends HeyApiClient {
|
|
1359
1618
|
/**
|
|
1360
1619
|
* List Conversation Sessions
|
|
1361
1620
|
*
|
|
1362
1621
|
* The agent sessions behind a conversation, newest first.
|
|
1363
1622
|
*
|
|
1364
|
-
* A thread can be handled many times — each phone call
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1367
|
-
* the matching `session_id` for `get_call`.
|
|
1623
|
+
* A thread can be handled many times — each phone call and each chat is one
|
|
1624
|
+
* session, recording which agent version ran, how it finished and what its
|
|
1625
|
+
* analysis concluded. A session's id is its `get_call` or `get_chat` id.
|
|
1368
1626
|
*/
|
|
1369
1627
|
list(parameters, options) {
|
|
1370
1628
|
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
@@ -1392,8 +1650,8 @@ class Conversations extends HeyApiClient {
|
|
|
1392
1650
|
*
|
|
1393
1651
|
* List conversations across every channel, most recently active first.
|
|
1394
1652
|
*
|
|
1395
|
-
* One conversation is one
|
|
1396
|
-
*
|
|
1653
|
+
* One conversation is one thread — a web chat, a Telegram thread, or a single
|
|
1654
|
+
* phone call — with `surface` saying which. Several of them
|
|
1397
1655
|
* can belong to the same person: pass `contact_key` to list only theirs.
|
|
1398
1656
|
*/
|
|
1399
1657
|
list(parameters, options) {
|
|
@@ -1401,7 +1659,8 @@ class Conversations extends HeyApiClient {
|
|
|
1401
1659
|
{ in: 'query', key: 'limit' },
|
|
1402
1660
|
{ in: 'query', key: 'offset' },
|
|
1403
1661
|
{ in: 'query', key: 'agent_id' },
|
|
1404
|
-
{ in: 'query', key: 'contact_key' }
|
|
1662
|
+
{ in: 'query', key: 'contact_key' },
|
|
1663
|
+
{ in: 'query', key: 'status' }
|
|
1405
1664
|
] }]);
|
|
1406
1665
|
return (options?.client ?? this.client).get({
|
|
1407
1666
|
responseStyle: 'data',
|
|
@@ -1415,38 +1674,6 @@ class Conversations extends HeyApiClient {
|
|
|
1415
1674
|
...params
|
|
1416
1675
|
});
|
|
1417
1676
|
}
|
|
1418
|
-
/**
|
|
1419
|
-
* Create Text Conversation
|
|
1420
|
-
*
|
|
1421
|
-
* Open a text conversation with a published text agent.
|
|
1422
|
-
*
|
|
1423
|
-
* `contact_key` is your own stable id for the person you are talking to —
|
|
1424
|
-
* unique in the workspace, and how you reach them again. `userdata` seeds what
|
|
1425
|
-
* the agent knows about them, readable as `{{userdata.field}}` from the
|
|
1426
|
-
* agent's tools.
|
|
1427
|
-
*
|
|
1428
|
-
* Creating the conversation does not send anything; call `create_text_message`
|
|
1429
|
-
* to say something.
|
|
1430
|
-
*/
|
|
1431
|
-
create(parameters, options) {
|
|
1432
|
-
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createTextConversationRequest', map: 'body' }] }]);
|
|
1433
|
-
return (options?.client ?? this.client).post({
|
|
1434
|
-
responseStyle: 'data',
|
|
1435
|
-
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1436
|
-
in: 'cookie',
|
|
1437
|
-
name: 'talqing_session',
|
|
1438
|
-
type: 'apiKey'
|
|
1439
|
-
}],
|
|
1440
|
-
url: '/v1/conversations',
|
|
1441
|
-
...options,
|
|
1442
|
-
...params,
|
|
1443
|
-
headers: {
|
|
1444
|
-
'Content-Type': 'application/json',
|
|
1445
|
-
...options?.headers,
|
|
1446
|
-
...params.headers
|
|
1447
|
-
}
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
1677
|
/**
|
|
1451
1678
|
* Get Conversation
|
|
1452
1679
|
*
|
|
@@ -1552,11 +1779,31 @@ class Conversations extends HeyApiClient {
|
|
|
1552
1779
|
...params
|
|
1553
1780
|
});
|
|
1554
1781
|
}
|
|
1555
|
-
|
|
1556
|
-
|
|
1782
|
+
/**
|
|
1783
|
+
* List Conversation Trace
|
|
1784
|
+
*
|
|
1785
|
+
* What the platform did during this conversation's sessions, oldest first.
|
|
1786
|
+
*/
|
|
1787
|
+
trace(parameters, options) {
|
|
1788
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
1789
|
+
{ in: 'path', key: 'conversation_id' },
|
|
1790
|
+
{ in: 'query', key: 'after' },
|
|
1791
|
+
{ in: 'query', key: 'before' }
|
|
1792
|
+
] }]);
|
|
1793
|
+
return (options?.client ?? this.client).get({
|
|
1794
|
+
responseStyle: 'data',
|
|
1795
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
1796
|
+
in: 'cookie',
|
|
1797
|
+
name: 'talqing_session',
|
|
1798
|
+
type: 'apiKey'
|
|
1799
|
+
}],
|
|
1800
|
+
url: '/v1/conversations/{conversation_id}/trace',
|
|
1801
|
+
...options,
|
|
1802
|
+
...params
|
|
1803
|
+
});
|
|
1557
1804
|
}
|
|
1558
1805
|
get items() {
|
|
1559
|
-
return this._items ?? (this._items = new
|
|
1806
|
+
return this._items ?? (this._items = new Items2({ client: this.client }));
|
|
1560
1807
|
}
|
|
1561
1808
|
get sessions() {
|
|
1562
1809
|
return this._sessions ?? (this._sessions = new Sessions({ client: this.client }));
|
|
@@ -2188,14 +2435,35 @@ class Batches2 extends HeyApiClient {
|
|
|
2188
2435
|
});
|
|
2189
2436
|
}
|
|
2190
2437
|
/**
|
|
2191
|
-
*
|
|
2438
|
+
* Delete Email Batch
|
|
2192
2439
|
*
|
|
2193
|
-
*
|
|
2440
|
+
* Delete a batch, its rows and its sends for good. **The record of what was sent goes too.**
|
|
2194
2441
|
*
|
|
2195
|
-
*
|
|
2196
|
-
* rows, and `sent_today` how much of `send_daily_cap` is left today.
|
|
2442
|
+
* Refused while it is still drafting or a send has not finished; cancel those first.
|
|
2197
2443
|
*/
|
|
2198
|
-
|
|
2444
|
+
delete(parameters, options) {
|
|
2445
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
2446
|
+
return (options?.client ?? this.client).delete({
|
|
2447
|
+
responseStyle: 'data',
|
|
2448
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
2449
|
+
in: 'cookie',
|
|
2450
|
+
name: 'talqing_session',
|
|
2451
|
+
type: 'apiKey'
|
|
2452
|
+
}],
|
|
2453
|
+
url: '/v1/email/batches/{batch_id}',
|
|
2454
|
+
...options,
|
|
2455
|
+
...params
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* Get Email Batch
|
|
2460
|
+
*
|
|
2461
|
+
* One batch: its policy, its per-status counts and what drafting has cost.
|
|
2462
|
+
*
|
|
2463
|
+
* `drafted_versions` says which published version of the task wrote how many
|
|
2464
|
+
* rows, and `sent_today` how much of `send_daily_cap` is left today.
|
|
2465
|
+
*/
|
|
2466
|
+
get(parameters, options) {
|
|
2199
2467
|
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
2200
2468
|
return (options?.client ?? this.client).get({
|
|
2201
2469
|
responseStyle: 'data',
|
|
@@ -2243,8 +2511,7 @@ class Batches2 extends HeyApiClient {
|
|
|
2243
2511
|
/**
|
|
2244
2512
|
* Cancel Email Batch
|
|
2245
2513
|
*
|
|
2246
|
-
* Stop drafting for good.
|
|
2247
|
-
* record of what was sent to whom.
|
|
2514
|
+
* Stop drafting for good.
|
|
2248
2515
|
*
|
|
2249
2516
|
* Rows already drafted are **not** touched and neither is any send: cancelling
|
|
2250
2517
|
* stops drafting, and drafts already produced are still worth reviewing and
|
|
@@ -3120,8 +3387,8 @@ class Secrets extends HeyApiClient {
|
|
|
3120
3387
|
/**
|
|
3121
3388
|
* Delete Secret
|
|
3122
3389
|
*
|
|
3123
|
-
* Delete a secret permanently.
|
|
3124
|
-
*
|
|
3390
|
+
* Delete a secret permanently. Refused with 409 while a tool, integration or
|
|
3391
|
+
* carrier account references it. Organization admins only.
|
|
3125
3392
|
*/
|
|
3126
3393
|
delete(parameters, options) {
|
|
3127
3394
|
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'secret_id' }] }]);
|
|
@@ -4414,6 +4681,384 @@ class Webhooks extends HeyApiClient {
|
|
|
4414
4681
|
}
|
|
4415
4682
|
}
|
|
4416
4683
|
exports.Webhooks = Webhooks;
|
|
4684
|
+
class Recipients3 extends HeyApiClient {
|
|
4685
|
+
/**
|
|
4686
|
+
* List Whatsapp Batch Recipients
|
|
4687
|
+
*
|
|
4688
|
+
* A batch's rows in upload order, each with its rendered message.
|
|
4689
|
+
*
|
|
4690
|
+
* `status` may repeat; a row matching any of them is returned.
|
|
4691
|
+
*/
|
|
4692
|
+
list(parameters, options) {
|
|
4693
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
4694
|
+
{ in: 'path', key: 'batch_id' },
|
|
4695
|
+
{ in: 'query', key: 'limit' },
|
|
4696
|
+
{ in: 'query', key: 'offset' },
|
|
4697
|
+
{ in: 'query', key: 'status' }
|
|
4698
|
+
] }]);
|
|
4699
|
+
return (options?.client ?? this.client).get({
|
|
4700
|
+
responseStyle: 'data',
|
|
4701
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4702
|
+
in: 'cookie',
|
|
4703
|
+
name: 'talqing_session',
|
|
4704
|
+
type: 'apiKey'
|
|
4705
|
+
}],
|
|
4706
|
+
url: '/v1/whatsapp/batches/{batch_id}/recipients',
|
|
4707
|
+
...options,
|
|
4708
|
+
...params
|
|
4709
|
+
});
|
|
4710
|
+
}
|
|
4711
|
+
/**
|
|
4712
|
+
* Restore Whatsapp Batch Recipients
|
|
4713
|
+
*
|
|
4714
|
+
* Put rows a person skipped back. A row skipped for its cells returns when they are fixed.
|
|
4715
|
+
*/
|
|
4716
|
+
restore(parameters, options) {
|
|
4717
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
|
|
4718
|
+
return (options?.client ?? this.client).post({
|
|
4719
|
+
responseStyle: 'data',
|
|
4720
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4721
|
+
in: 'cookie',
|
|
4722
|
+
name: 'talqing_session',
|
|
4723
|
+
type: 'apiKey'
|
|
4724
|
+
}],
|
|
4725
|
+
url: '/v1/whatsapp/batches/{batch_id}/recipients/restore',
|
|
4726
|
+
...options,
|
|
4727
|
+
...params,
|
|
4728
|
+
headers: {
|
|
4729
|
+
'Content-Type': 'application/json',
|
|
4730
|
+
...options?.headers,
|
|
4731
|
+
...params.headers
|
|
4732
|
+
}
|
|
4733
|
+
});
|
|
4734
|
+
}
|
|
4735
|
+
/**
|
|
4736
|
+
* Skip Whatsapp Batch Recipients
|
|
4737
|
+
*
|
|
4738
|
+
* Take ready rows out of the send. Reversible with restore.
|
|
4739
|
+
*/
|
|
4740
|
+
skip(parameters, options) {
|
|
4741
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
|
|
4742
|
+
return (options?.client ?? this.client).post({
|
|
4743
|
+
responseStyle: 'data',
|
|
4744
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4745
|
+
in: 'cookie',
|
|
4746
|
+
name: 'talqing_session',
|
|
4747
|
+
type: 'apiKey'
|
|
4748
|
+
}],
|
|
4749
|
+
url: '/v1/whatsapp/batches/{batch_id}/recipients/skip',
|
|
4750
|
+
...options,
|
|
4751
|
+
...params,
|
|
4752
|
+
headers: {
|
|
4753
|
+
'Content-Type': 'application/json',
|
|
4754
|
+
...options?.headers,
|
|
4755
|
+
...params.headers
|
|
4756
|
+
}
|
|
4757
|
+
});
|
|
4758
|
+
}
|
|
4759
|
+
/**
|
|
4760
|
+
* Patch Whatsapp Batch Recipient
|
|
4761
|
+
*
|
|
4762
|
+
* Edit cells on a row not yet sent, its phone included. An empty value clears the edit.
|
|
4763
|
+
*/
|
|
4764
|
+
update(parameters, options) {
|
|
4765
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
4766
|
+
{ in: 'path', key: 'batch_id' },
|
|
4767
|
+
{ in: 'path', key: 'recipient_id' },
|
|
4768
|
+
{ key: 'patchWhatsAppRecipientRequest', map: 'body' }
|
|
4769
|
+
] }]);
|
|
4770
|
+
return (options?.client ?? this.client).patch({
|
|
4771
|
+
responseStyle: 'data',
|
|
4772
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4773
|
+
in: 'cookie',
|
|
4774
|
+
name: 'talqing_session',
|
|
4775
|
+
type: 'apiKey'
|
|
4776
|
+
}],
|
|
4777
|
+
url: '/v1/whatsapp/batches/{batch_id}/recipients/{recipient_id}',
|
|
4778
|
+
...options,
|
|
4779
|
+
...params,
|
|
4780
|
+
headers: {
|
|
4781
|
+
'Content-Type': 'application/json',
|
|
4782
|
+
...options?.headers,
|
|
4783
|
+
...params.headers
|
|
4784
|
+
}
|
|
4785
|
+
});
|
|
4786
|
+
}
|
|
4787
|
+
}
|
|
4788
|
+
exports.Recipients3 = Recipients3;
|
|
4789
|
+
class Batches3 extends HeyApiClient {
|
|
4790
|
+
/**
|
|
4791
|
+
* List Whatsapp Batches
|
|
4792
|
+
*
|
|
4793
|
+
* List WhatsApp batches, newest first.
|
|
4794
|
+
*/
|
|
4795
|
+
list(parameters, options) {
|
|
4796
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
|
|
4797
|
+
{ in: 'query', key: 'limit' },
|
|
4798
|
+
{ in: 'query', key: 'offset' },
|
|
4799
|
+
{ in: 'query', key: 'status' }
|
|
4800
|
+
] }]);
|
|
4801
|
+
return (options?.client ?? this.client).get({
|
|
4802
|
+
responseStyle: 'data',
|
|
4803
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4804
|
+
in: 'cookie',
|
|
4805
|
+
name: 'talqing_session',
|
|
4806
|
+
type: 'apiKey'
|
|
4807
|
+
}],
|
|
4808
|
+
url: '/v1/whatsapp/batches',
|
|
4809
|
+
...options,
|
|
4810
|
+
...params
|
|
4811
|
+
});
|
|
4812
|
+
}
|
|
4813
|
+
/**
|
|
4814
|
+
* Create Whatsapp Batch
|
|
4815
|
+
*
|
|
4816
|
+
* Create a WhatsApp batch: one approved template, sent once per CSV row. Sends nothing yet.
|
|
4817
|
+
*
|
|
4818
|
+
* Only message people who opted in to hear from you on WhatsApp. A row with an
|
|
4819
|
+
* invalid or repeated phone, or a blank or line-broken mapped cell, is kept and
|
|
4820
|
+
* skipped with the reason. Replies go to the sender's assigned agent, which
|
|
4821
|
+
* sees the row's cells as `{{userdata.<column>}}`.
|
|
4822
|
+
*/
|
|
4823
|
+
create(parameters, options) {
|
|
4824
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createWhatsAppBatchRequest', map: 'body' }] }]);
|
|
4825
|
+
return (options?.client ?? this.client).post({
|
|
4826
|
+
responseStyle: 'data',
|
|
4827
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4828
|
+
in: 'cookie',
|
|
4829
|
+
name: 'talqing_session',
|
|
4830
|
+
type: 'apiKey'
|
|
4831
|
+
}],
|
|
4832
|
+
url: '/v1/whatsapp/batches',
|
|
4833
|
+
...options,
|
|
4834
|
+
...params,
|
|
4835
|
+
headers: {
|
|
4836
|
+
'Content-Type': 'application/json',
|
|
4837
|
+
...options?.headers,
|
|
4838
|
+
...params.headers
|
|
4839
|
+
}
|
|
4840
|
+
});
|
|
4841
|
+
}
|
|
4842
|
+
/**
|
|
4843
|
+
* Delete Whatsapp Batch
|
|
4844
|
+
*
|
|
4845
|
+
* Delete a batch and its rows for good. A live batch must be canceled first.
|
|
4846
|
+
*
|
|
4847
|
+
* The conversations it started stay; its delivery and reply counts do not.
|
|
4848
|
+
*/
|
|
4849
|
+
delete(parameters, options) {
|
|
4850
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
4851
|
+
return (options?.client ?? this.client).delete({
|
|
4852
|
+
responseStyle: 'data',
|
|
4853
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4854
|
+
in: 'cookie',
|
|
4855
|
+
name: 'talqing_session',
|
|
4856
|
+
type: 'apiKey'
|
|
4857
|
+
}],
|
|
4858
|
+
url: '/v1/whatsapp/batches/{batch_id}',
|
|
4859
|
+
...options,
|
|
4860
|
+
...params
|
|
4861
|
+
});
|
|
4862
|
+
}
|
|
4863
|
+
/**
|
|
4864
|
+
* Get Whatsapp Batch
|
|
4865
|
+
*
|
|
4866
|
+
* One batch: its template, schedule and per-status counts, `replied` included.
|
|
4867
|
+
*/
|
|
4868
|
+
get(parameters, options) {
|
|
4869
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
4870
|
+
return (options?.client ?? this.client).get({
|
|
4871
|
+
responseStyle: 'data',
|
|
4872
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4873
|
+
in: 'cookie',
|
|
4874
|
+
name: 'talqing_session',
|
|
4875
|
+
type: 'apiKey'
|
|
4876
|
+
}],
|
|
4877
|
+
url: '/v1/whatsapp/batches/{batch_id}',
|
|
4878
|
+
...options,
|
|
4879
|
+
...params
|
|
4880
|
+
});
|
|
4881
|
+
}
|
|
4882
|
+
/**
|
|
4883
|
+
* Patch Whatsapp Batch
|
|
4884
|
+
*
|
|
4885
|
+
* Edit a batch. Pacing and the window reach a live send within minutes.
|
|
4886
|
+
*
|
|
4887
|
+
* `variable_map` changes only before sending, `start_at` only before it begins;
|
|
4888
|
+
* a finished batch takes `name` alone.
|
|
4889
|
+
*/
|
|
4890
|
+
update(parameters, options) {
|
|
4891
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'patchWhatsAppBatchRequest', map: 'body' }] }]);
|
|
4892
|
+
return (options?.client ?? this.client).patch({
|
|
4893
|
+
responseStyle: 'data',
|
|
4894
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4895
|
+
in: 'cookie',
|
|
4896
|
+
name: 'talqing_session',
|
|
4897
|
+
type: 'apiKey'
|
|
4898
|
+
}],
|
|
4899
|
+
url: '/v1/whatsapp/batches/{batch_id}',
|
|
4900
|
+
...options,
|
|
4901
|
+
...params,
|
|
4902
|
+
headers: {
|
|
4903
|
+
'Content-Type': 'application/json',
|
|
4904
|
+
...options?.headers,
|
|
4905
|
+
...params.headers
|
|
4906
|
+
}
|
|
4907
|
+
});
|
|
4908
|
+
}
|
|
4909
|
+
/**
|
|
4910
|
+
* Cancel Whatsapp Batch
|
|
4911
|
+
*
|
|
4912
|
+
* Stop for good. Messages already sent stay sent, and replies are still answered.
|
|
4913
|
+
*/
|
|
4914
|
+
cancel(parameters, options) {
|
|
4915
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
4916
|
+
return (options?.client ?? this.client).post({
|
|
4917
|
+
responseStyle: 'data',
|
|
4918
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4919
|
+
in: 'cookie',
|
|
4920
|
+
name: 'talqing_session',
|
|
4921
|
+
type: 'apiKey'
|
|
4922
|
+
}],
|
|
4923
|
+
url: '/v1/whatsapp/batches/{batch_id}/cancel',
|
|
4924
|
+
...options,
|
|
4925
|
+
...params
|
|
4926
|
+
});
|
|
4927
|
+
}
|
|
4928
|
+
/**
|
|
4929
|
+
* Pause Whatsapp Batch
|
|
4930
|
+
*
|
|
4931
|
+
* Stop sending before the next message. Nothing is lost.
|
|
4932
|
+
*/
|
|
4933
|
+
pause(parameters, options) {
|
|
4934
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
4935
|
+
return (options?.client ?? this.client).post({
|
|
4936
|
+
responseStyle: 'data',
|
|
4937
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4938
|
+
in: 'cookie',
|
|
4939
|
+
name: 'talqing_session',
|
|
4940
|
+
type: 'apiKey'
|
|
4941
|
+
}],
|
|
4942
|
+
url: '/v1/whatsapp/batches/{batch_id}/pause',
|
|
4943
|
+
...options,
|
|
4944
|
+
...params
|
|
4945
|
+
});
|
|
4946
|
+
}
|
|
4947
|
+
/**
|
|
4948
|
+
* Resume Whatsapp Batch
|
|
4949
|
+
*
|
|
4950
|
+
* Carry on sending from where the batch stopped.
|
|
4951
|
+
*/
|
|
4952
|
+
resume(parameters, options) {
|
|
4953
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
|
|
4954
|
+
return (options?.client ?? this.client).post({
|
|
4955
|
+
responseStyle: 'data',
|
|
4956
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4957
|
+
in: 'cookie',
|
|
4958
|
+
name: 'talqing_session',
|
|
4959
|
+
type: 'apiKey'
|
|
4960
|
+
}],
|
|
4961
|
+
url: '/v1/whatsapp/batches/{batch_id}/resume',
|
|
4962
|
+
...options,
|
|
4963
|
+
...params
|
|
4964
|
+
});
|
|
4965
|
+
}
|
|
4966
|
+
/**
|
|
4967
|
+
* Send Whatsapp Batch
|
|
4968
|
+
*
|
|
4969
|
+
* Send every ready row. **This messages real people and cannot be undone.**
|
|
4970
|
+
*
|
|
4971
|
+
* `start_at` schedules it, `window` holds it to business hours, and
|
|
4972
|
+
* `send_daily_cap` (default 250, Meta's lowest tier) and `send_gap_seconds`
|
|
4973
|
+
* pace it.
|
|
4974
|
+
*/
|
|
4975
|
+
send(parameters, options) {
|
|
4976
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'sendWhatsAppBatchRequest', map: 'body' }] }]);
|
|
4977
|
+
return (options?.client ?? this.client).post({
|
|
4978
|
+
responseStyle: 'data',
|
|
4979
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
4980
|
+
in: 'cookie',
|
|
4981
|
+
name: 'talqing_session',
|
|
4982
|
+
type: 'apiKey'
|
|
4983
|
+
}],
|
|
4984
|
+
url: '/v1/whatsapp/batches/{batch_id}/send',
|
|
4985
|
+
...options,
|
|
4986
|
+
...params,
|
|
4987
|
+
headers: {
|
|
4988
|
+
'Content-Type': 'application/json',
|
|
4989
|
+
...options?.headers,
|
|
4990
|
+
...params.headers
|
|
4991
|
+
}
|
|
4992
|
+
});
|
|
4993
|
+
}
|
|
4994
|
+
get recipients() {
|
|
4995
|
+
return this._recipients ?? (this._recipients = new Recipients3({ client: this.client }));
|
|
4996
|
+
}
|
|
4997
|
+
}
|
|
4998
|
+
exports.Batches3 = Batches3;
|
|
4999
|
+
class Templates extends HeyApiClient {
|
|
5000
|
+
/**
|
|
5001
|
+
* List Whatsapp Templates
|
|
5002
|
+
*
|
|
5003
|
+
* List a WhatsApp sender's approved templates, read live from its BSP.
|
|
5004
|
+
*
|
|
5005
|
+
* One with `unsupported_reason` set cannot be sent from a batch.
|
|
5006
|
+
*/
|
|
5007
|
+
list(parameters, options) {
|
|
5008
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'integration_id' }] }]);
|
|
5009
|
+
return (options?.client ?? this.client).get({
|
|
5010
|
+
responseStyle: 'data',
|
|
5011
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
5012
|
+
in: 'cookie',
|
|
5013
|
+
name: 'talqing_session',
|
|
5014
|
+
type: 'apiKey'
|
|
5015
|
+
}],
|
|
5016
|
+
url: '/v1/whatsapp/templates',
|
|
5017
|
+
...options,
|
|
5018
|
+
...params
|
|
5019
|
+
});
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
5022
|
+
exports.Templates = Templates;
|
|
5023
|
+
class TwilioSenders extends HeyApiClient {
|
|
5024
|
+
/**
|
|
5025
|
+
* List Twilio Whatsapp Senders
|
|
5026
|
+
*
|
|
5027
|
+
* List the WhatsApp senders on a Twilio account, before connecting one. Stores nothing.
|
|
5028
|
+
*/
|
|
5029
|
+
list(parameters, options) {
|
|
5030
|
+
const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'twilioSendersRequest', map: 'body' }] }]);
|
|
5031
|
+
return (options?.client ?? this.client).post({
|
|
5032
|
+
responseStyle: 'data',
|
|
5033
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
5034
|
+
in: 'cookie',
|
|
5035
|
+
name: 'talqing_session',
|
|
5036
|
+
type: 'apiKey'
|
|
5037
|
+
}],
|
|
5038
|
+
url: '/v1/whatsapp/twilio-senders',
|
|
5039
|
+
...options,
|
|
5040
|
+
...params,
|
|
5041
|
+
headers: {
|
|
5042
|
+
'Content-Type': 'application/json',
|
|
5043
|
+
...options?.headers,
|
|
5044
|
+
...params.headers
|
|
5045
|
+
}
|
|
5046
|
+
});
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
exports.TwilioSenders = TwilioSenders;
|
|
5050
|
+
class Whatsapp extends HeyApiClient {
|
|
5051
|
+
get batches() {
|
|
5052
|
+
return this._batches ?? (this._batches = new Batches3({ client: this.client }));
|
|
5053
|
+
}
|
|
5054
|
+
get templates() {
|
|
5055
|
+
return this._templates ?? (this._templates = new Templates({ client: this.client }));
|
|
5056
|
+
}
|
|
5057
|
+
get twilioSenders() {
|
|
5058
|
+
return this._twilioSenders ?? (this._twilioSenders = new TwilioSenders({ client: this.client }));
|
|
5059
|
+
}
|
|
5060
|
+
}
|
|
5061
|
+
exports.Whatsapp = Whatsapp;
|
|
4417
5062
|
class TalqingApi extends HeyApiClient {
|
|
4418
5063
|
constructor(args) {
|
|
4419
5064
|
super(args);
|
|
@@ -4451,6 +5096,9 @@ class TalqingApi extends HeyApiClient {
|
|
|
4451
5096
|
get catalog() {
|
|
4452
5097
|
return this._catalog ?? (this._catalog = new Catalog({ client: this.client }));
|
|
4453
5098
|
}
|
|
5099
|
+
get chats() {
|
|
5100
|
+
return this._chats ?? (this._chats = new Chats({ client: this.client }));
|
|
5101
|
+
}
|
|
4454
5102
|
get conversations() {
|
|
4455
5103
|
return this._conversations ?? (this._conversations = new Conversations({ client: this.client }));
|
|
4456
5104
|
}
|
|
@@ -4487,6 +5135,9 @@ class TalqingApi extends HeyApiClient {
|
|
|
4487
5135
|
get webhooks() {
|
|
4488
5136
|
return this._webhooks ?? (this._webhooks = new Webhooks({ client: this.client }));
|
|
4489
5137
|
}
|
|
5138
|
+
get whatsapp() {
|
|
5139
|
+
return this._whatsapp ?? (this._whatsapp = new Whatsapp({ client: this.client }));
|
|
5140
|
+
}
|
|
4490
5141
|
}
|
|
4491
5142
|
exports.TalqingApi = TalqingApi;
|
|
4492
5143
|
TalqingApi.__registry = new HeyApiRegistry();
|