@getlatedev/node 0.2.5 → 0.2.6

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/dist/index.js CHANGED
@@ -1400,6 +1400,240 @@ var releaseWhatsAppPhoneNumber = (options) => {
1400
1400
  url: "/v1/whatsapp/phone-numbers/{phoneNumberId}"
1401
1401
  });
1402
1402
  };
1403
+ var listContacts = (options) => {
1404
+ return (options?.client ?? client).get({
1405
+ ...options,
1406
+ url: "/v1/contacts"
1407
+ });
1408
+ };
1409
+ var createContact = (options) => {
1410
+ return (options?.client ?? client).post({
1411
+ ...options,
1412
+ url: "/v1/contacts"
1413
+ });
1414
+ };
1415
+ var getContact = (options) => {
1416
+ return (options?.client ?? client).get({
1417
+ ...options,
1418
+ url: "/v1/contacts/{contactId}"
1419
+ });
1420
+ };
1421
+ var updateContact = (options) => {
1422
+ return (options?.client ?? client).patch({
1423
+ ...options,
1424
+ url: "/v1/contacts/{contactId}"
1425
+ });
1426
+ };
1427
+ var deleteContact = (options) => {
1428
+ return (options?.client ?? client).delete({
1429
+ ...options,
1430
+ url: "/v1/contacts/{contactId}"
1431
+ });
1432
+ };
1433
+ var getContactChannels = (options) => {
1434
+ return (options?.client ?? client).get({
1435
+ ...options,
1436
+ url: "/v1/contacts/{contactId}/channels"
1437
+ });
1438
+ };
1439
+ var bulkCreateContacts = (options) => {
1440
+ return (options?.client ?? client).post({
1441
+ ...options,
1442
+ url: "/v1/contacts/bulk"
1443
+ });
1444
+ };
1445
+ var setContactFieldValue = (options) => {
1446
+ return (options?.client ?? client).put({
1447
+ ...options,
1448
+ url: "/v1/contacts/{contactId}/fields/{slug}"
1449
+ });
1450
+ };
1451
+ var clearContactFieldValue = (options) => {
1452
+ return (options?.client ?? client).delete({
1453
+ ...options,
1454
+ url: "/v1/contacts/{contactId}/fields/{slug}"
1455
+ });
1456
+ };
1457
+ var listCustomFields = (options) => {
1458
+ return (options?.client ?? client).get({
1459
+ ...options,
1460
+ url: "/v1/custom-fields"
1461
+ });
1462
+ };
1463
+ var createCustomField = (options) => {
1464
+ return (options?.client ?? client).post({
1465
+ ...options,
1466
+ url: "/v1/custom-fields"
1467
+ });
1468
+ };
1469
+ var updateCustomField = (options) => {
1470
+ return (options?.client ?? client).patch({
1471
+ ...options,
1472
+ url: "/v1/custom-fields/{fieldId}"
1473
+ });
1474
+ };
1475
+ var deleteCustomField = (options) => {
1476
+ return (options?.client ?? client).delete({
1477
+ ...options,
1478
+ url: "/v1/custom-fields/{fieldId}"
1479
+ });
1480
+ };
1481
+ var listBroadcasts = (options) => {
1482
+ return (options?.client ?? client).get({
1483
+ ...options,
1484
+ url: "/v1/broadcasts"
1485
+ });
1486
+ };
1487
+ var createBroadcast = (options) => {
1488
+ return (options?.client ?? client).post({
1489
+ ...options,
1490
+ url: "/v1/broadcasts"
1491
+ });
1492
+ };
1493
+ var getBroadcast = (options) => {
1494
+ return (options?.client ?? client).get({
1495
+ ...options,
1496
+ url: "/v1/broadcasts/{broadcastId}"
1497
+ });
1498
+ };
1499
+ var updateBroadcast = (options) => {
1500
+ return (options?.client ?? client).patch({
1501
+ ...options,
1502
+ url: "/v1/broadcasts/{broadcastId}"
1503
+ });
1504
+ };
1505
+ var deleteBroadcast = (options) => {
1506
+ return (options?.client ?? client).delete({
1507
+ ...options,
1508
+ url: "/v1/broadcasts/{broadcastId}"
1509
+ });
1510
+ };
1511
+ var sendBroadcast = (options) => {
1512
+ return (options?.client ?? client).post({
1513
+ ...options,
1514
+ url: "/v1/broadcasts/{broadcastId}/send"
1515
+ });
1516
+ };
1517
+ var scheduleBroadcast = (options) => {
1518
+ return (options?.client ?? client).post({
1519
+ ...options,
1520
+ url: "/v1/broadcasts/{broadcastId}/schedule"
1521
+ });
1522
+ };
1523
+ var cancelBroadcast = (options) => {
1524
+ return (options?.client ?? client).post({
1525
+ ...options,
1526
+ url: "/v1/broadcasts/{broadcastId}/cancel"
1527
+ });
1528
+ };
1529
+ var listBroadcastRecipients = (options) => {
1530
+ return (options?.client ?? client).get({
1531
+ ...options,
1532
+ url: "/v1/broadcasts/{broadcastId}/recipients"
1533
+ });
1534
+ };
1535
+ var addBroadcastRecipients = (options) => {
1536
+ return (options?.client ?? client).post({
1537
+ ...options,
1538
+ url: "/v1/broadcasts/{broadcastId}/recipients"
1539
+ });
1540
+ };
1541
+ var listSequences = (options) => {
1542
+ return (options?.client ?? client).get({
1543
+ ...options,
1544
+ url: "/v1/sequences"
1545
+ });
1546
+ };
1547
+ var createSequence = (options) => {
1548
+ return (options?.client ?? client).post({
1549
+ ...options,
1550
+ url: "/v1/sequences"
1551
+ });
1552
+ };
1553
+ var getSequence = (options) => {
1554
+ return (options?.client ?? client).get({
1555
+ ...options,
1556
+ url: "/v1/sequences/{sequenceId}"
1557
+ });
1558
+ };
1559
+ var updateSequence = (options) => {
1560
+ return (options?.client ?? client).patch({
1561
+ ...options,
1562
+ url: "/v1/sequences/{sequenceId}"
1563
+ });
1564
+ };
1565
+ var deleteSequence = (options) => {
1566
+ return (options?.client ?? client).delete({
1567
+ ...options,
1568
+ url: "/v1/sequences/{sequenceId}"
1569
+ });
1570
+ };
1571
+ var activateSequence = (options) => {
1572
+ return (options?.client ?? client).post({
1573
+ ...options,
1574
+ url: "/v1/sequences/{sequenceId}/activate"
1575
+ });
1576
+ };
1577
+ var pauseSequence = (options) => {
1578
+ return (options?.client ?? client).post({
1579
+ ...options,
1580
+ url: "/v1/sequences/{sequenceId}/pause"
1581
+ });
1582
+ };
1583
+ var enrollContacts = (options) => {
1584
+ return (options?.client ?? client).post({
1585
+ ...options,
1586
+ url: "/v1/sequences/{sequenceId}/enroll"
1587
+ });
1588
+ };
1589
+ var unenrollContact = (options) => {
1590
+ return (options?.client ?? client).delete({
1591
+ ...options,
1592
+ url: "/v1/sequences/{sequenceId}/enroll/{contactId}"
1593
+ });
1594
+ };
1595
+ var listSequenceEnrollments = (options) => {
1596
+ return (options?.client ?? client).get({
1597
+ ...options,
1598
+ url: "/v1/sequences/{sequenceId}/enrollments"
1599
+ });
1600
+ };
1601
+ var listCommentAutomations = (options) => {
1602
+ return (options?.client ?? client).get({
1603
+ ...options,
1604
+ url: "/v1/comment-automations"
1605
+ });
1606
+ };
1607
+ var createCommentAutomation = (options) => {
1608
+ return (options?.client ?? client).post({
1609
+ ...options,
1610
+ url: "/v1/comment-automations"
1611
+ });
1612
+ };
1613
+ var getCommentAutomation = (options) => {
1614
+ return (options?.client ?? client).get({
1615
+ ...options,
1616
+ url: "/v1/comment-automations/{automationId}"
1617
+ });
1618
+ };
1619
+ var updateCommentAutomation = (options) => {
1620
+ return (options?.client ?? client).patch({
1621
+ ...options,
1622
+ url: "/v1/comment-automations/{automationId}"
1623
+ });
1624
+ };
1625
+ var deleteCommentAutomation = (options) => {
1626
+ return (options?.client ?? client).delete({
1627
+ ...options,
1628
+ url: "/v1/comment-automations/{automationId}"
1629
+ });
1630
+ };
1631
+ var listCommentAutomationLogs = (options) => {
1632
+ return (options?.client ?? client).get({
1633
+ ...options,
1634
+ url: "/v1/comment-automations/{automationId}/logs"
1635
+ });
1636
+ };
1403
1637
 
1404
1638
  // src/errors.ts
1405
1639
  var ZernioApiError = class _ZernioApiError extends Error {
@@ -1848,6 +2082,70 @@ var Zernio = class {
1848
2082
  getWhatsAppPhoneNumber,
1849
2083
  releaseWhatsAppPhoneNumber
1850
2084
  };
2085
+ /**
2086
+ * contacts API
2087
+ */
2088
+ this.contacts = {
2089
+ listContacts,
2090
+ createContact,
2091
+ getContact,
2092
+ updateContact,
2093
+ deleteContact,
2094
+ getContactChannels,
2095
+ bulkCreateContacts
2096
+ };
2097
+ /**
2098
+ * customfields API
2099
+ */
2100
+ this.customfields = {
2101
+ setContactFieldValue,
2102
+ clearContactFieldValue,
2103
+ listCustomFields,
2104
+ createCustomField,
2105
+ updateCustomField,
2106
+ deleteCustomField
2107
+ };
2108
+ /**
2109
+ * broadcasts API
2110
+ */
2111
+ this.broadcasts = {
2112
+ listBroadcasts,
2113
+ createBroadcast,
2114
+ getBroadcast,
2115
+ updateBroadcast,
2116
+ deleteBroadcast,
2117
+ sendBroadcast,
2118
+ scheduleBroadcast,
2119
+ cancelBroadcast,
2120
+ listBroadcastRecipients,
2121
+ addBroadcastRecipients
2122
+ };
2123
+ /**
2124
+ * sequences API
2125
+ */
2126
+ this.sequences = {
2127
+ listSequences,
2128
+ createSequence,
2129
+ getSequence,
2130
+ updateSequence,
2131
+ deleteSequence,
2132
+ activateSequence,
2133
+ pauseSequence,
2134
+ enrollContacts,
2135
+ unenrollContact,
2136
+ listSequenceEnrollments
2137
+ };
2138
+ /**
2139
+ * commentautomations API
2140
+ */
2141
+ this.commentautomations = {
2142
+ listCommentAutomations,
2143
+ createCommentAutomation,
2144
+ getCommentAutomation,
2145
+ updateCommentAutomation,
2146
+ deleteCommentAutomation,
2147
+ listCommentAutomationLogs
2148
+ };
1851
2149
  const apiKey = options.apiKey ?? process.env["ZERNIO_API_KEY"] ?? process.env["LATE_API_KEY"];
1852
2150
  if (!apiKey) {
1853
2151
  throw new ZernioApiError(
package/dist/index.mjs CHANGED
@@ -1369,6 +1369,240 @@ var releaseWhatsAppPhoneNumber = (options) => {
1369
1369
  url: "/v1/whatsapp/phone-numbers/{phoneNumberId}"
1370
1370
  });
1371
1371
  };
1372
+ var listContacts = (options) => {
1373
+ return (options?.client ?? client).get({
1374
+ ...options,
1375
+ url: "/v1/contacts"
1376
+ });
1377
+ };
1378
+ var createContact = (options) => {
1379
+ return (options?.client ?? client).post({
1380
+ ...options,
1381
+ url: "/v1/contacts"
1382
+ });
1383
+ };
1384
+ var getContact = (options) => {
1385
+ return (options?.client ?? client).get({
1386
+ ...options,
1387
+ url: "/v1/contacts/{contactId}"
1388
+ });
1389
+ };
1390
+ var updateContact = (options) => {
1391
+ return (options?.client ?? client).patch({
1392
+ ...options,
1393
+ url: "/v1/contacts/{contactId}"
1394
+ });
1395
+ };
1396
+ var deleteContact = (options) => {
1397
+ return (options?.client ?? client).delete({
1398
+ ...options,
1399
+ url: "/v1/contacts/{contactId}"
1400
+ });
1401
+ };
1402
+ var getContactChannels = (options) => {
1403
+ return (options?.client ?? client).get({
1404
+ ...options,
1405
+ url: "/v1/contacts/{contactId}/channels"
1406
+ });
1407
+ };
1408
+ var bulkCreateContacts = (options) => {
1409
+ return (options?.client ?? client).post({
1410
+ ...options,
1411
+ url: "/v1/contacts/bulk"
1412
+ });
1413
+ };
1414
+ var setContactFieldValue = (options) => {
1415
+ return (options?.client ?? client).put({
1416
+ ...options,
1417
+ url: "/v1/contacts/{contactId}/fields/{slug}"
1418
+ });
1419
+ };
1420
+ var clearContactFieldValue = (options) => {
1421
+ return (options?.client ?? client).delete({
1422
+ ...options,
1423
+ url: "/v1/contacts/{contactId}/fields/{slug}"
1424
+ });
1425
+ };
1426
+ var listCustomFields = (options) => {
1427
+ return (options?.client ?? client).get({
1428
+ ...options,
1429
+ url: "/v1/custom-fields"
1430
+ });
1431
+ };
1432
+ var createCustomField = (options) => {
1433
+ return (options?.client ?? client).post({
1434
+ ...options,
1435
+ url: "/v1/custom-fields"
1436
+ });
1437
+ };
1438
+ var updateCustomField = (options) => {
1439
+ return (options?.client ?? client).patch({
1440
+ ...options,
1441
+ url: "/v1/custom-fields/{fieldId}"
1442
+ });
1443
+ };
1444
+ var deleteCustomField = (options) => {
1445
+ return (options?.client ?? client).delete({
1446
+ ...options,
1447
+ url: "/v1/custom-fields/{fieldId}"
1448
+ });
1449
+ };
1450
+ var listBroadcasts = (options) => {
1451
+ return (options?.client ?? client).get({
1452
+ ...options,
1453
+ url: "/v1/broadcasts"
1454
+ });
1455
+ };
1456
+ var createBroadcast = (options) => {
1457
+ return (options?.client ?? client).post({
1458
+ ...options,
1459
+ url: "/v1/broadcasts"
1460
+ });
1461
+ };
1462
+ var getBroadcast = (options) => {
1463
+ return (options?.client ?? client).get({
1464
+ ...options,
1465
+ url: "/v1/broadcasts/{broadcastId}"
1466
+ });
1467
+ };
1468
+ var updateBroadcast = (options) => {
1469
+ return (options?.client ?? client).patch({
1470
+ ...options,
1471
+ url: "/v1/broadcasts/{broadcastId}"
1472
+ });
1473
+ };
1474
+ var deleteBroadcast = (options) => {
1475
+ return (options?.client ?? client).delete({
1476
+ ...options,
1477
+ url: "/v1/broadcasts/{broadcastId}"
1478
+ });
1479
+ };
1480
+ var sendBroadcast = (options) => {
1481
+ return (options?.client ?? client).post({
1482
+ ...options,
1483
+ url: "/v1/broadcasts/{broadcastId}/send"
1484
+ });
1485
+ };
1486
+ var scheduleBroadcast = (options) => {
1487
+ return (options?.client ?? client).post({
1488
+ ...options,
1489
+ url: "/v1/broadcasts/{broadcastId}/schedule"
1490
+ });
1491
+ };
1492
+ var cancelBroadcast = (options) => {
1493
+ return (options?.client ?? client).post({
1494
+ ...options,
1495
+ url: "/v1/broadcasts/{broadcastId}/cancel"
1496
+ });
1497
+ };
1498
+ var listBroadcastRecipients = (options) => {
1499
+ return (options?.client ?? client).get({
1500
+ ...options,
1501
+ url: "/v1/broadcasts/{broadcastId}/recipients"
1502
+ });
1503
+ };
1504
+ var addBroadcastRecipients = (options) => {
1505
+ return (options?.client ?? client).post({
1506
+ ...options,
1507
+ url: "/v1/broadcasts/{broadcastId}/recipients"
1508
+ });
1509
+ };
1510
+ var listSequences = (options) => {
1511
+ return (options?.client ?? client).get({
1512
+ ...options,
1513
+ url: "/v1/sequences"
1514
+ });
1515
+ };
1516
+ var createSequence = (options) => {
1517
+ return (options?.client ?? client).post({
1518
+ ...options,
1519
+ url: "/v1/sequences"
1520
+ });
1521
+ };
1522
+ var getSequence = (options) => {
1523
+ return (options?.client ?? client).get({
1524
+ ...options,
1525
+ url: "/v1/sequences/{sequenceId}"
1526
+ });
1527
+ };
1528
+ var updateSequence = (options) => {
1529
+ return (options?.client ?? client).patch({
1530
+ ...options,
1531
+ url: "/v1/sequences/{sequenceId}"
1532
+ });
1533
+ };
1534
+ var deleteSequence = (options) => {
1535
+ return (options?.client ?? client).delete({
1536
+ ...options,
1537
+ url: "/v1/sequences/{sequenceId}"
1538
+ });
1539
+ };
1540
+ var activateSequence = (options) => {
1541
+ return (options?.client ?? client).post({
1542
+ ...options,
1543
+ url: "/v1/sequences/{sequenceId}/activate"
1544
+ });
1545
+ };
1546
+ var pauseSequence = (options) => {
1547
+ return (options?.client ?? client).post({
1548
+ ...options,
1549
+ url: "/v1/sequences/{sequenceId}/pause"
1550
+ });
1551
+ };
1552
+ var enrollContacts = (options) => {
1553
+ return (options?.client ?? client).post({
1554
+ ...options,
1555
+ url: "/v1/sequences/{sequenceId}/enroll"
1556
+ });
1557
+ };
1558
+ var unenrollContact = (options) => {
1559
+ return (options?.client ?? client).delete({
1560
+ ...options,
1561
+ url: "/v1/sequences/{sequenceId}/enroll/{contactId}"
1562
+ });
1563
+ };
1564
+ var listSequenceEnrollments = (options) => {
1565
+ return (options?.client ?? client).get({
1566
+ ...options,
1567
+ url: "/v1/sequences/{sequenceId}/enrollments"
1568
+ });
1569
+ };
1570
+ var listCommentAutomations = (options) => {
1571
+ return (options?.client ?? client).get({
1572
+ ...options,
1573
+ url: "/v1/comment-automations"
1574
+ });
1575
+ };
1576
+ var createCommentAutomation = (options) => {
1577
+ return (options?.client ?? client).post({
1578
+ ...options,
1579
+ url: "/v1/comment-automations"
1580
+ });
1581
+ };
1582
+ var getCommentAutomation = (options) => {
1583
+ return (options?.client ?? client).get({
1584
+ ...options,
1585
+ url: "/v1/comment-automations/{automationId}"
1586
+ });
1587
+ };
1588
+ var updateCommentAutomation = (options) => {
1589
+ return (options?.client ?? client).patch({
1590
+ ...options,
1591
+ url: "/v1/comment-automations/{automationId}"
1592
+ });
1593
+ };
1594
+ var deleteCommentAutomation = (options) => {
1595
+ return (options?.client ?? client).delete({
1596
+ ...options,
1597
+ url: "/v1/comment-automations/{automationId}"
1598
+ });
1599
+ };
1600
+ var listCommentAutomationLogs = (options) => {
1601
+ return (options?.client ?? client).get({
1602
+ ...options,
1603
+ url: "/v1/comment-automations/{automationId}/logs"
1604
+ });
1605
+ };
1372
1606
 
1373
1607
  // src/errors.ts
1374
1608
  var ZernioApiError = class _ZernioApiError extends Error {
@@ -1817,6 +2051,70 @@ var Zernio = class {
1817
2051
  getWhatsAppPhoneNumber,
1818
2052
  releaseWhatsAppPhoneNumber
1819
2053
  };
2054
+ /**
2055
+ * contacts API
2056
+ */
2057
+ this.contacts = {
2058
+ listContacts,
2059
+ createContact,
2060
+ getContact,
2061
+ updateContact,
2062
+ deleteContact,
2063
+ getContactChannels,
2064
+ bulkCreateContacts
2065
+ };
2066
+ /**
2067
+ * customfields API
2068
+ */
2069
+ this.customfields = {
2070
+ setContactFieldValue,
2071
+ clearContactFieldValue,
2072
+ listCustomFields,
2073
+ createCustomField,
2074
+ updateCustomField,
2075
+ deleteCustomField
2076
+ };
2077
+ /**
2078
+ * broadcasts API
2079
+ */
2080
+ this.broadcasts = {
2081
+ listBroadcasts,
2082
+ createBroadcast,
2083
+ getBroadcast,
2084
+ updateBroadcast,
2085
+ deleteBroadcast,
2086
+ sendBroadcast,
2087
+ scheduleBroadcast,
2088
+ cancelBroadcast,
2089
+ listBroadcastRecipients,
2090
+ addBroadcastRecipients
2091
+ };
2092
+ /**
2093
+ * sequences API
2094
+ */
2095
+ this.sequences = {
2096
+ listSequences,
2097
+ createSequence,
2098
+ getSequence,
2099
+ updateSequence,
2100
+ deleteSequence,
2101
+ activateSequence,
2102
+ pauseSequence,
2103
+ enrollContacts,
2104
+ unenrollContact,
2105
+ listSequenceEnrollments
2106
+ };
2107
+ /**
2108
+ * commentautomations API
2109
+ */
2110
+ this.commentautomations = {
2111
+ listCommentAutomations,
2112
+ createCommentAutomation,
2113
+ getCommentAutomation,
2114
+ updateCommentAutomation,
2115
+ deleteCommentAutomation,
2116
+ listCommentAutomationLogs
2117
+ };
1820
2118
  const apiKey = options.apiKey ?? process.env["ZERNIO_API_KEY"] ?? process.env["LATE_API_KEY"];
1821
2119
  if (!apiKey) {
1822
2120
  throw new ZernioApiError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlatedev/node",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",