@sendly/node 3.18.0 → 3.18.2
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 +114 -1
- package/dist/index.d.mts +479 -1
- package/dist/index.d.ts +479 -1
- package/dist/index.js +495 -1
- package/dist/index.mjs +495 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -420,7 +420,7 @@ await sendly.messages.send({
|
|
|
420
420
|
import { CREDITS_PER_SMS, SUPPORTED_COUNTRIES } from '@sendly/node';
|
|
421
421
|
|
|
422
422
|
// Credits per SMS by tier
|
|
423
|
-
console.log(CREDITS_PER_SMS.domestic); //
|
|
423
|
+
console.log(CREDITS_PER_SMS.domestic); // 2 (US/Canada)
|
|
424
424
|
console.log(CREDITS_PER_SMS.tier1); // 8 (UK, Poland, India, etc.)
|
|
425
425
|
console.log(CREDITS_PER_SMS.tier2); // 12 (France, Japan, Australia, etc.)
|
|
426
426
|
console.log(CREDITS_PER_SMS.tier3); // 16 (Germany, Italy, Mexico, etc.)
|
|
@@ -605,6 +605,119 @@ Get an API key by ID.
|
|
|
605
605
|
|
|
606
606
|
Get usage statistics for an API key.
|
|
607
607
|
|
|
608
|
+
## Enterprise
|
|
609
|
+
|
|
610
|
+
The Enterprise API lets you programmatically manage workspaces, verification, credits, and API keys for multi-tenant platforms. Requires an enterprise master key (`sk_live_v1_master_*`).
|
|
611
|
+
|
|
612
|
+
### Quick Provision
|
|
613
|
+
|
|
614
|
+
Create a fully configured workspace in a single call:
|
|
615
|
+
|
|
616
|
+
```typescript
|
|
617
|
+
const client = new Sendly('sk_live_v1_master_YOUR_KEY');
|
|
618
|
+
|
|
619
|
+
// Inherit verification from an existing workspace (fastest)
|
|
620
|
+
const result = await client.enterprise.provision({
|
|
621
|
+
name: 'Acme Insurance - Austin',
|
|
622
|
+
sourceWorkspaceId: 'ws_verified',
|
|
623
|
+
creditAmount: 5000,
|
|
624
|
+
creditSourceWorkspaceId: 'ws_pool',
|
|
625
|
+
keyName: 'Production',
|
|
626
|
+
keyType: 'live',
|
|
627
|
+
generateOptInPage: true
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
console.log(result.workspace.id);
|
|
631
|
+
console.log(result.apiKey?.rawKey); // shown once
|
|
632
|
+
console.log(result.optInPage?.url); // hosted opt-in page
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
Three provisioning modes:
|
|
636
|
+
|
|
637
|
+
| Mode | Params | Description |
|
|
638
|
+
|------|--------|-------------|
|
|
639
|
+
| **Inherit** | `sourceWorkspaceId` | Shares toll-free number from verified workspace |
|
|
640
|
+
| **Inherit + New Number** | `sourceWorkspaceId` + `inheritWithNewNumber: true` | Copies business info, purchases new number |
|
|
641
|
+
| **Fresh** | `verification: { ... }` | Full business details, new number + carrier approval |
|
|
642
|
+
|
|
643
|
+
### Workspace Management
|
|
644
|
+
|
|
645
|
+
```typescript
|
|
646
|
+
// Create
|
|
647
|
+
const ws = await client.enterprise.workspaces.create({ name: 'Acme Insurance' });
|
|
648
|
+
|
|
649
|
+
// List
|
|
650
|
+
const { workspaces } = await client.enterprise.workspaces.list();
|
|
651
|
+
|
|
652
|
+
// Get details
|
|
653
|
+
const detail = await client.enterprise.workspaces.get('ws_xxx');
|
|
654
|
+
|
|
655
|
+
// Delete
|
|
656
|
+
await client.enterprise.workspaces.delete('ws_xxx');
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
### Verification
|
|
660
|
+
|
|
661
|
+
```typescript
|
|
662
|
+
// Submit full verification
|
|
663
|
+
await client.enterprise.workspaces.submitVerification('ws_xxx', {
|
|
664
|
+
businessName: 'Acme Insurance LLC',
|
|
665
|
+
businessType: 'llc',
|
|
666
|
+
ein: '12-3456789',
|
|
667
|
+
address: '100 Main St',
|
|
668
|
+
city: 'Austin',
|
|
669
|
+
state: 'TX',
|
|
670
|
+
zip: '78701',
|
|
671
|
+
useCase: 'Policy renewal reminders',
|
|
672
|
+
sampleMessages: ['Your policy renews on 3/15.']
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
// Inherit from verified workspace
|
|
676
|
+
await client.enterprise.workspaces.inheritVerification('ws_new', {
|
|
677
|
+
sourceWorkspaceId: 'ws_verified'
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// Inherit with new number
|
|
681
|
+
await client.enterprise.workspaces.inheritVerification('ws_new', {
|
|
682
|
+
sourceWorkspaceId: 'ws_verified',
|
|
683
|
+
purchaseNewNumber: true
|
|
684
|
+
});
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### Credits & API Keys
|
|
688
|
+
|
|
689
|
+
```typescript
|
|
690
|
+
// Transfer credits
|
|
691
|
+
await client.enterprise.workspaces.transferCredits('ws_dest', {
|
|
692
|
+
sourceWorkspaceId: 'ws_source',
|
|
693
|
+
amount: 5000
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
// Create workspace API key
|
|
697
|
+
const key = await client.enterprise.workspaces.createKey('ws_xxx', {
|
|
698
|
+
name: 'Production',
|
|
699
|
+
type: 'live'
|
|
700
|
+
});
|
|
701
|
+
console.log(key.rawKey); // shown once
|
|
702
|
+
|
|
703
|
+
// Revoke a key
|
|
704
|
+
await client.enterprise.workspaces.revokeKey('ws_xxx', 'key_abc');
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
### Webhooks & Analytics
|
|
708
|
+
|
|
709
|
+
```typescript
|
|
710
|
+
// Set enterprise webhook
|
|
711
|
+
await client.enterprise.webhooks.set({ url: 'https://yourapp.com/webhooks' });
|
|
712
|
+
|
|
713
|
+
// Analytics
|
|
714
|
+
const overview = await client.enterprise.analytics.overview();
|
|
715
|
+
const messages = await client.enterprise.analytics.messages({ period: '30d' });
|
|
716
|
+
const delivery = await client.enterprise.analytics.delivery();
|
|
717
|
+
```
|
|
718
|
+
|
|
719
|
+
Full enterprise docs: [sendly.live/docs/enterprise](https://sendly.live/docs/enterprise)
|
|
720
|
+
|
|
608
721
|
## Support
|
|
609
722
|
|
|
610
723
|
- 📚 [Documentation](https://sendly.live/docs)
|
package/dist/index.d.mts
CHANGED
|
@@ -1504,6 +1504,366 @@ interface ImportContactsResponse {
|
|
|
1504
1504
|
errors: ImportContactsError[];
|
|
1505
1505
|
totalErrors: number;
|
|
1506
1506
|
}
|
|
1507
|
+
interface EnterpriseAccount {
|
|
1508
|
+
id: string;
|
|
1509
|
+
maxWorkspaces: number;
|
|
1510
|
+
workspaceCount: number;
|
|
1511
|
+
workspaces: EnterpriseWorkspaceSummary[];
|
|
1512
|
+
metadata: Record<string, unknown>;
|
|
1513
|
+
}
|
|
1514
|
+
interface EnterpriseWorkspaceSummary {
|
|
1515
|
+
id: string;
|
|
1516
|
+
name: string;
|
|
1517
|
+
slug: string;
|
|
1518
|
+
verificationStatus: string | null;
|
|
1519
|
+
verificationType: string | null;
|
|
1520
|
+
tollFreeNumber: string | null;
|
|
1521
|
+
creditBalance: number;
|
|
1522
|
+
}
|
|
1523
|
+
interface EnterpriseWorkspace {
|
|
1524
|
+
id: string;
|
|
1525
|
+
name: string;
|
|
1526
|
+
slug: string;
|
|
1527
|
+
verificationStatus: string | null;
|
|
1528
|
+
verificationType: string | null;
|
|
1529
|
+
tollFreeNumber: string | null;
|
|
1530
|
+
creditBalance: number;
|
|
1531
|
+
keyCount: number;
|
|
1532
|
+
messages30d: number;
|
|
1533
|
+
delivered30d: number;
|
|
1534
|
+
failed30d: number;
|
|
1535
|
+
createdAt: string;
|
|
1536
|
+
}
|
|
1537
|
+
interface EnterpriseWorkspaceDetail {
|
|
1538
|
+
id: string;
|
|
1539
|
+
name: string;
|
|
1540
|
+
slug: string;
|
|
1541
|
+
verificationStatus: string | null;
|
|
1542
|
+
tollFreeNumber: string | null;
|
|
1543
|
+
businessName: string | null;
|
|
1544
|
+
creditBalance: number;
|
|
1545
|
+
keys: Array<{
|
|
1546
|
+
id: string;
|
|
1547
|
+
name: string;
|
|
1548
|
+
keyPrefix: string;
|
|
1549
|
+
createdAt: string;
|
|
1550
|
+
lastUsedAt: string | null;
|
|
1551
|
+
}>;
|
|
1552
|
+
messages30d: number;
|
|
1553
|
+
delivered30d: number;
|
|
1554
|
+
failed30d: number;
|
|
1555
|
+
deliveryRate: number;
|
|
1556
|
+
}
|
|
1557
|
+
interface CreateWorkspaceOptions {
|
|
1558
|
+
name: string;
|
|
1559
|
+
description?: string;
|
|
1560
|
+
}
|
|
1561
|
+
interface ProvisionWorkspaceOptions {
|
|
1562
|
+
name: string;
|
|
1563
|
+
sourceWorkspaceId?: string;
|
|
1564
|
+
inheritWithNewNumber?: boolean;
|
|
1565
|
+
verification?: {
|
|
1566
|
+
businessName: string;
|
|
1567
|
+
website: string;
|
|
1568
|
+
address: {
|
|
1569
|
+
street: string;
|
|
1570
|
+
city: string;
|
|
1571
|
+
state: string;
|
|
1572
|
+
zip: string;
|
|
1573
|
+
country?: string;
|
|
1574
|
+
};
|
|
1575
|
+
contact: {
|
|
1576
|
+
firstName: string;
|
|
1577
|
+
lastName: string;
|
|
1578
|
+
email: string;
|
|
1579
|
+
phone: string;
|
|
1580
|
+
};
|
|
1581
|
+
brn?: string;
|
|
1582
|
+
brnType?: string;
|
|
1583
|
+
brnCountry?: string;
|
|
1584
|
+
useCase: string;
|
|
1585
|
+
useCaseSummary: string;
|
|
1586
|
+
sampleMessages: string;
|
|
1587
|
+
optInWorkflow: string;
|
|
1588
|
+
optInImageUrls?: string;
|
|
1589
|
+
monthlyVolume?: string;
|
|
1590
|
+
};
|
|
1591
|
+
creditAmount?: number;
|
|
1592
|
+
creditSourceWorkspaceId?: string;
|
|
1593
|
+
keyName?: string;
|
|
1594
|
+
keyType?: "test" | "live";
|
|
1595
|
+
webhookUrl?: string;
|
|
1596
|
+
generateOptInPage?: boolean;
|
|
1597
|
+
}
|
|
1598
|
+
interface ProvisionWorkspaceResult {
|
|
1599
|
+
workspace: {
|
|
1600
|
+
id: string;
|
|
1601
|
+
name: string;
|
|
1602
|
+
slug: string;
|
|
1603
|
+
};
|
|
1604
|
+
verification?: {
|
|
1605
|
+
id: string;
|
|
1606
|
+
status: string;
|
|
1607
|
+
type: string;
|
|
1608
|
+
tollFreeNumber: string | null;
|
|
1609
|
+
inherited?: boolean;
|
|
1610
|
+
newNumber?: boolean;
|
|
1611
|
+
};
|
|
1612
|
+
credits?: {
|
|
1613
|
+
balance: number;
|
|
1614
|
+
transferred?: number;
|
|
1615
|
+
};
|
|
1616
|
+
apiKey?: {
|
|
1617
|
+
id: string;
|
|
1618
|
+
name: string;
|
|
1619
|
+
prefix: string;
|
|
1620
|
+
key?: string;
|
|
1621
|
+
};
|
|
1622
|
+
optInPage?: {
|
|
1623
|
+
url: string;
|
|
1624
|
+
slug: string;
|
|
1625
|
+
pageId: string;
|
|
1626
|
+
};
|
|
1627
|
+
legalPages?: {
|
|
1628
|
+
privacyUrl?: string;
|
|
1629
|
+
termsUrl?: string;
|
|
1630
|
+
};
|
|
1631
|
+
webhook?: {
|
|
1632
|
+
id: string;
|
|
1633
|
+
url: string;
|
|
1634
|
+
};
|
|
1635
|
+
apiBaseUrl?: string;
|
|
1636
|
+
dashboardUrl?: string;
|
|
1637
|
+
}
|
|
1638
|
+
interface TransferCreditsOptions {
|
|
1639
|
+
sourceWorkspaceId: string;
|
|
1640
|
+
amount: number;
|
|
1641
|
+
}
|
|
1642
|
+
interface TransferCreditsResult {
|
|
1643
|
+
success: boolean;
|
|
1644
|
+
sourceBalance: number;
|
|
1645
|
+
targetBalance: number;
|
|
1646
|
+
}
|
|
1647
|
+
interface CreateKeyOptions {
|
|
1648
|
+
name?: string;
|
|
1649
|
+
type?: "live" | "test";
|
|
1650
|
+
}
|
|
1651
|
+
interface CreatedApiKey {
|
|
1652
|
+
id: string;
|
|
1653
|
+
name: string;
|
|
1654
|
+
key: string;
|
|
1655
|
+
keyPrefix: string;
|
|
1656
|
+
createdAt: string;
|
|
1657
|
+
}
|
|
1658
|
+
interface WorkspaceCredits {
|
|
1659
|
+
balance: number;
|
|
1660
|
+
lifetimeCredits: number;
|
|
1661
|
+
}
|
|
1662
|
+
interface EnterpriseWebhook {
|
|
1663
|
+
url: string;
|
|
1664
|
+
}
|
|
1665
|
+
interface EnterpriseWebhookTestResult {
|
|
1666
|
+
success: boolean;
|
|
1667
|
+
statusCode?: number;
|
|
1668
|
+
statusText?: string;
|
|
1669
|
+
error?: string;
|
|
1670
|
+
}
|
|
1671
|
+
interface AnalyticsOverview {
|
|
1672
|
+
totalMessages: number;
|
|
1673
|
+
deliveredMessages: number;
|
|
1674
|
+
failedMessages: number;
|
|
1675
|
+
deliveryRate: number;
|
|
1676
|
+
totalCreditsUsed: number;
|
|
1677
|
+
activeWorkspaces: number;
|
|
1678
|
+
}
|
|
1679
|
+
interface MessageAnalyticsDataPoint {
|
|
1680
|
+
date: string;
|
|
1681
|
+
sent: number;
|
|
1682
|
+
delivered: number;
|
|
1683
|
+
failed: number;
|
|
1684
|
+
}
|
|
1685
|
+
interface MessageAnalytics {
|
|
1686
|
+
period: string;
|
|
1687
|
+
data: MessageAnalyticsDataPoint[];
|
|
1688
|
+
}
|
|
1689
|
+
interface DeliveryAnalyticsItem {
|
|
1690
|
+
workspaceId: string;
|
|
1691
|
+
name: string;
|
|
1692
|
+
sent: number;
|
|
1693
|
+
delivered: number;
|
|
1694
|
+
failed: number;
|
|
1695
|
+
rate: number;
|
|
1696
|
+
}
|
|
1697
|
+
interface CreditAnalyticsDataPoint {
|
|
1698
|
+
date: string;
|
|
1699
|
+
used: number;
|
|
1700
|
+
transferred: number;
|
|
1701
|
+
purchased: number;
|
|
1702
|
+
}
|
|
1703
|
+
interface CreditAnalytics {
|
|
1704
|
+
period: string;
|
|
1705
|
+
data: CreditAnalyticsDataPoint[];
|
|
1706
|
+
}
|
|
1707
|
+
type AnalyticsPeriod = "7d" | "30d" | "90d";
|
|
1708
|
+
interface OptInPage {
|
|
1709
|
+
id: string;
|
|
1710
|
+
slug: string;
|
|
1711
|
+
url: string;
|
|
1712
|
+
businessName: string;
|
|
1713
|
+
useCase: string | null;
|
|
1714
|
+
isActive: boolean;
|
|
1715
|
+
viewCount: number;
|
|
1716
|
+
logoUrl: string | null;
|
|
1717
|
+
headerColor: string | null;
|
|
1718
|
+
buttonColor: string | null;
|
|
1719
|
+
customHeadline: string | null;
|
|
1720
|
+
createdAt: string;
|
|
1721
|
+
}
|
|
1722
|
+
interface CreateOptInPageOptions {
|
|
1723
|
+
businessName: string;
|
|
1724
|
+
useCase?: string;
|
|
1725
|
+
useCaseSummary?: string;
|
|
1726
|
+
sampleMessages?: string;
|
|
1727
|
+
}
|
|
1728
|
+
interface CreateOptInPageResult {
|
|
1729
|
+
id: string;
|
|
1730
|
+
slug: string;
|
|
1731
|
+
url: string;
|
|
1732
|
+
businessName: string;
|
|
1733
|
+
}
|
|
1734
|
+
interface UpdateOptInPageOptions {
|
|
1735
|
+
logoUrl?: string;
|
|
1736
|
+
headerColor?: string;
|
|
1737
|
+
buttonColor?: string;
|
|
1738
|
+
customHeadline?: string;
|
|
1739
|
+
customBenefits?: string[];
|
|
1740
|
+
}
|
|
1741
|
+
interface WorkspaceWebhook {
|
|
1742
|
+
id: string;
|
|
1743
|
+
url: string;
|
|
1744
|
+
events: string[];
|
|
1745
|
+
isActive: boolean;
|
|
1746
|
+
createdAt: string;
|
|
1747
|
+
}
|
|
1748
|
+
interface SetWorkspaceWebhookOptions {
|
|
1749
|
+
url: string;
|
|
1750
|
+
events?: string[];
|
|
1751
|
+
description?: string;
|
|
1752
|
+
}
|
|
1753
|
+
interface SetWorkspaceWebhookResult {
|
|
1754
|
+
id: string;
|
|
1755
|
+
url: string;
|
|
1756
|
+
events: string[];
|
|
1757
|
+
secret?: string;
|
|
1758
|
+
created?: boolean;
|
|
1759
|
+
updated?: boolean;
|
|
1760
|
+
}
|
|
1761
|
+
interface SuspendWorkspaceOptions {
|
|
1762
|
+
reason?: string;
|
|
1763
|
+
}
|
|
1764
|
+
interface SuspendWorkspaceResult {
|
|
1765
|
+
id: string;
|
|
1766
|
+
status: string;
|
|
1767
|
+
suspendedAt: string;
|
|
1768
|
+
}
|
|
1769
|
+
interface ResumeWorkspaceResult {
|
|
1770
|
+
id: string;
|
|
1771
|
+
status: string;
|
|
1772
|
+
}
|
|
1773
|
+
interface AutoTopUpSettings {
|
|
1774
|
+
enabled: boolean;
|
|
1775
|
+
threshold: number;
|
|
1776
|
+
amount: number;
|
|
1777
|
+
sourceWorkspaceId: string | null;
|
|
1778
|
+
}
|
|
1779
|
+
interface UpdateAutoTopUpOptions {
|
|
1780
|
+
enabled: boolean;
|
|
1781
|
+
threshold: number;
|
|
1782
|
+
amount: number;
|
|
1783
|
+
sourceWorkspaceId?: string | null;
|
|
1784
|
+
}
|
|
1785
|
+
interface BillingBreakdownOptions {
|
|
1786
|
+
period?: AnalyticsPeriod;
|
|
1787
|
+
page?: number;
|
|
1788
|
+
limit?: number;
|
|
1789
|
+
}
|
|
1790
|
+
interface WorkspaceBillingItem {
|
|
1791
|
+
id: string;
|
|
1792
|
+
name: string;
|
|
1793
|
+
creditsUsed: number;
|
|
1794
|
+
creditsPurchased: number;
|
|
1795
|
+
creditsTransferredIn: number;
|
|
1796
|
+
creditsTransferredOut: number;
|
|
1797
|
+
messagesSent: number;
|
|
1798
|
+
messagesDelivered: number;
|
|
1799
|
+
workspaceFee: number;
|
|
1800
|
+
allocatedPlatformFee: number;
|
|
1801
|
+
totalCost: number;
|
|
1802
|
+
}
|
|
1803
|
+
interface BillingBreakdown {
|
|
1804
|
+
period: string;
|
|
1805
|
+
summary: {
|
|
1806
|
+
platformFee: number;
|
|
1807
|
+
totalWorkspaceFees: number;
|
|
1808
|
+
totalCreditsUsed: number;
|
|
1809
|
+
totalCost: number;
|
|
1810
|
+
};
|
|
1811
|
+
workspaces: WorkspaceBillingItem[];
|
|
1812
|
+
}
|
|
1813
|
+
interface BulkProvisionWorkspace {
|
|
1814
|
+
name: string;
|
|
1815
|
+
sourceWorkspaceId?: string;
|
|
1816
|
+
creditAmount?: number;
|
|
1817
|
+
creditSourceWorkspaceId?: string;
|
|
1818
|
+
}
|
|
1819
|
+
interface BulkProvisionResultItem {
|
|
1820
|
+
name: string;
|
|
1821
|
+
status: "success" | "partial" | "failed";
|
|
1822
|
+
workspaceId?: string;
|
|
1823
|
+
slug?: string;
|
|
1824
|
+
warning?: string;
|
|
1825
|
+
error?: string;
|
|
1826
|
+
}
|
|
1827
|
+
interface BulkProvisionResult {
|
|
1828
|
+
results: BulkProvisionResultItem[];
|
|
1829
|
+
summary: {
|
|
1830
|
+
total: number;
|
|
1831
|
+
succeeded: number;
|
|
1832
|
+
failed: number;
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
interface DnsRecord {
|
|
1836
|
+
type: string;
|
|
1837
|
+
name: string;
|
|
1838
|
+
value: string;
|
|
1839
|
+
}
|
|
1840
|
+
interface SetCustomDomainResult {
|
|
1841
|
+
domain: string;
|
|
1842
|
+
verified: boolean;
|
|
1843
|
+
dnsInstructions: {
|
|
1844
|
+
cname: DnsRecord;
|
|
1845
|
+
txt: DnsRecord;
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
interface SendInvitationOptions {
|
|
1849
|
+
email: string;
|
|
1850
|
+
role: "admin" | "member" | "viewer";
|
|
1851
|
+
}
|
|
1852
|
+
interface Invitation {
|
|
1853
|
+
id: string;
|
|
1854
|
+
email: string;
|
|
1855
|
+
role: string;
|
|
1856
|
+
status: string;
|
|
1857
|
+
expiresAt: string;
|
|
1858
|
+
}
|
|
1859
|
+
interface QuotaSettings {
|
|
1860
|
+
monthlyMessageQuota: number | null;
|
|
1861
|
+
messagesThisMonth: number;
|
|
1862
|
+
quotaResetAt: string | null;
|
|
1863
|
+
}
|
|
1864
|
+
interface UpdateQuotaOptions {
|
|
1865
|
+
monthlyMessageQuota: number | null;
|
|
1866
|
+
}
|
|
1507
1867
|
|
|
1508
1868
|
/**
|
|
1509
1869
|
* HTTP Client Utility
|
|
@@ -3050,6 +3410,108 @@ declare class MediaResource {
|
|
|
3050
3410
|
upload(file: Buffer | NodeJS.ReadableStream, options?: MediaUploadOptions): Promise<MediaFile>;
|
|
3051
3411
|
}
|
|
3052
3412
|
|
|
3413
|
+
declare class WorkspacesSubResource {
|
|
3414
|
+
private readonly http;
|
|
3415
|
+
constructor(http: HttpClient);
|
|
3416
|
+
create(options: CreateWorkspaceOptions): Promise<EnterpriseWorkspace>;
|
|
3417
|
+
list(): Promise<{
|
|
3418
|
+
workspaces: EnterpriseWorkspace[];
|
|
3419
|
+
maxWorkspaces: number;
|
|
3420
|
+
workspacesUsed: number;
|
|
3421
|
+
}>;
|
|
3422
|
+
get(workspaceId: string): Promise<EnterpriseWorkspaceDetail>;
|
|
3423
|
+
delete(workspaceId: string): Promise<void>;
|
|
3424
|
+
submitVerification(workspaceId: string, data: {
|
|
3425
|
+
businessName: string;
|
|
3426
|
+
businessType: string;
|
|
3427
|
+
ein: string;
|
|
3428
|
+
address: string;
|
|
3429
|
+
city: string;
|
|
3430
|
+
state: string;
|
|
3431
|
+
zip: string;
|
|
3432
|
+
useCase: string;
|
|
3433
|
+
sampleMessages: string[];
|
|
3434
|
+
monthlyVolume?: number;
|
|
3435
|
+
}): Promise<unknown>;
|
|
3436
|
+
inheritVerification(workspaceId: string, options: {
|
|
3437
|
+
sourceWorkspaceId: string;
|
|
3438
|
+
}): Promise<unknown>;
|
|
3439
|
+
getVerification(workspaceId: string): Promise<unknown>;
|
|
3440
|
+
transferCredits(workspaceId: string, options: TransferCreditsOptions): Promise<TransferCreditsResult>;
|
|
3441
|
+
getCredits(workspaceId: string): Promise<WorkspaceCredits>;
|
|
3442
|
+
createKey(workspaceId: string, options?: CreateKeyOptions): Promise<CreatedApiKey>;
|
|
3443
|
+
listKeys(workspaceId: string): Promise<Array<{
|
|
3444
|
+
id: string;
|
|
3445
|
+
name: string;
|
|
3446
|
+
keyPrefix: string;
|
|
3447
|
+
createdAt: string;
|
|
3448
|
+
lastUsedAt: string | null;
|
|
3449
|
+
}>>;
|
|
3450
|
+
revokeKey(workspaceId: string, keyId: string): Promise<void>;
|
|
3451
|
+
listOptInPages(workspaceId: string): Promise<OptInPage[]>;
|
|
3452
|
+
createOptInPage(workspaceId: string, options: CreateOptInPageOptions): Promise<CreateOptInPageResult>;
|
|
3453
|
+
updateOptInPage(workspaceId: string, pageId: string, options: UpdateOptInPageOptions): Promise<OptInPage>;
|
|
3454
|
+
deleteOptInPage(workspaceId: string, pageId: string): Promise<void>;
|
|
3455
|
+
setWebhook(workspaceId: string, options: SetWorkspaceWebhookOptions): Promise<SetWorkspaceWebhookResult>;
|
|
3456
|
+
listWebhooks(workspaceId: string): Promise<WorkspaceWebhook[]>;
|
|
3457
|
+
deleteWebhooks(workspaceId: string, webhookId?: string): Promise<void>;
|
|
3458
|
+
testWebhook(workspaceId: string): Promise<EnterpriseWebhookTestResult>;
|
|
3459
|
+
suspend(workspaceId: string, options?: SuspendWorkspaceOptions): Promise<SuspendWorkspaceResult>;
|
|
3460
|
+
resume(workspaceId: string): Promise<ResumeWorkspaceResult>;
|
|
3461
|
+
provisionBulk(workspaces: BulkProvisionWorkspace[]): Promise<BulkProvisionResult>;
|
|
3462
|
+
setCustomDomain(workspaceId: string, pageId: string, domain: string): Promise<SetCustomDomainResult>;
|
|
3463
|
+
sendInvitation(workspaceId: string, options: SendInvitationOptions): Promise<Invitation>;
|
|
3464
|
+
listInvitations(workspaceId: string): Promise<Invitation[]>;
|
|
3465
|
+
cancelInvitation(workspaceId: string, inviteId: string): Promise<void>;
|
|
3466
|
+
getQuota(workspaceId: string): Promise<QuotaSettings>;
|
|
3467
|
+
setQuota(workspaceId: string, options: UpdateQuotaOptions): Promise<QuotaSettings>;
|
|
3468
|
+
}
|
|
3469
|
+
declare class WebhooksSubResource {
|
|
3470
|
+
private readonly http;
|
|
3471
|
+
constructor(http: HttpClient);
|
|
3472
|
+
set(options: {
|
|
3473
|
+
url: string;
|
|
3474
|
+
}): Promise<EnterpriseWebhook>;
|
|
3475
|
+
get(): Promise<EnterpriseWebhook>;
|
|
3476
|
+
delete(): Promise<void>;
|
|
3477
|
+
test(): Promise<EnterpriseWebhookTestResult>;
|
|
3478
|
+
}
|
|
3479
|
+
declare class AnalyticsSubResource {
|
|
3480
|
+
private readonly http;
|
|
3481
|
+
constructor(http: HttpClient);
|
|
3482
|
+
overview(): Promise<AnalyticsOverview>;
|
|
3483
|
+
messages(options?: {
|
|
3484
|
+
period?: AnalyticsPeriod;
|
|
3485
|
+
workspaceId?: string;
|
|
3486
|
+
}): Promise<MessageAnalytics>;
|
|
3487
|
+
delivery(): Promise<DeliveryAnalyticsItem[]>;
|
|
3488
|
+
credits(options?: {
|
|
3489
|
+
period?: AnalyticsPeriod;
|
|
3490
|
+
}): Promise<CreditAnalytics>;
|
|
3491
|
+
}
|
|
3492
|
+
declare class SettingsSubResource {
|
|
3493
|
+
private readonly http;
|
|
3494
|
+
constructor(http: HttpClient);
|
|
3495
|
+
getAutoTopUp(): Promise<AutoTopUpSettings>;
|
|
3496
|
+
updateAutoTopUp(options: UpdateAutoTopUpOptions): Promise<AutoTopUpSettings>;
|
|
3497
|
+
}
|
|
3498
|
+
declare class BillingSubResource {
|
|
3499
|
+
private readonly http;
|
|
3500
|
+
constructor(http: HttpClient);
|
|
3501
|
+
getBreakdown(options?: BillingBreakdownOptions): Promise<BillingBreakdown>;
|
|
3502
|
+
}
|
|
3503
|
+
declare class EnterpriseResource {
|
|
3504
|
+
private readonly http;
|
|
3505
|
+
readonly workspaces: WorkspacesSubResource;
|
|
3506
|
+
readonly webhooks: WebhooksSubResource;
|
|
3507
|
+
readonly analytics: AnalyticsSubResource;
|
|
3508
|
+
readonly settings: SettingsSubResource;
|
|
3509
|
+
readonly billing: BillingSubResource;
|
|
3510
|
+
constructor(http: HttpClient);
|
|
3511
|
+
getAccount(): Promise<EnterpriseAccount>;
|
|
3512
|
+
provision(options: ProvisionWorkspaceOptions): Promise<ProvisionWorkspaceResult>;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3053
3515
|
/**
|
|
3054
3516
|
* Sendly Client
|
|
3055
3517
|
* @packageDocumentation
|
|
@@ -3240,6 +3702,22 @@ declare class Sendly {
|
|
|
3240
3702
|
* ```
|
|
3241
3703
|
*/
|
|
3242
3704
|
readonly media: MediaResource;
|
|
3705
|
+
/**
|
|
3706
|
+
* Enterprise API resource - Multi-workspace management
|
|
3707
|
+
*
|
|
3708
|
+
* @example
|
|
3709
|
+
* ```typescript
|
|
3710
|
+
* // Get enterprise account
|
|
3711
|
+
* const account = await sendly.enterprise.getAccount();
|
|
3712
|
+
*
|
|
3713
|
+
* // Create a workspace
|
|
3714
|
+
* const workspace = await sendly.enterprise.workspaces.create({ name: 'New Workspace' });
|
|
3715
|
+
*
|
|
3716
|
+
* // Get analytics
|
|
3717
|
+
* const overview = await sendly.enterprise.analytics.overview();
|
|
3718
|
+
* ```
|
|
3719
|
+
*/
|
|
3720
|
+
readonly enterprise: EnterpriseResource;
|
|
3243
3721
|
private readonly http;
|
|
3244
3722
|
private readonly config;
|
|
3245
3723
|
/**
|
|
@@ -3690,4 +4168,4 @@ declare class Webhooks {
|
|
|
3690
4168
|
*/
|
|
3691
4169
|
type WebhookMessageData = WebhookMessageObject;
|
|
3692
4170
|
|
|
3693
|
-
export { ALL_SUPPORTED_COUNTRIES, type Account, type ApiErrorResponse, type ApiKey, AuthenticationError, type BatchListResponse, type BatchMessageItem, type BatchMessageRequest, type BatchMessageResponse, type BatchMessageResult, type BatchStatus, CREDITS_PER_SMS, type Campaign, type CampaignListResponse, type CampaignPreview, type CampaignStatus, type CancelledMessageResponse, type CheckVerificationRequest, type CheckVerificationResponse, type CircuitState, type Contact, type ContactList, type ContactListResponse, type ContactListsResponse, type CreateCampaignRequest, type CreateContactListRequest, type CreateContactRequest, type CreateTemplateRequest, type CreateVerifySessionRequest, type CreateWebhookOptions, type CreditTransaction, type Credits, type DeliveryStatus, type ImportContactItem, type ImportContactsError, type ImportContactsRequest, type ImportContactsResponse, InsufficientCreditsError, type ListBatchesOptions, type ListCampaignsOptions, type ListContactsOptions, type ListMessagesOptions, type ListScheduledMessagesOptions, type ListVerificationsOptions, type MediaFile, type MediaUploadOptions, type Message, type MessageListResponse, type MessageStatus, type MessageType, NetworkError, NotFoundError, type PricingTier, RateLimitError, type RateLimitInfo, SANDBOX_TEST_NUMBERS, SUPPORTED_COUNTRIES, type ScheduleCampaignRequest, type ScheduleMessageRequest, type ScheduledMessage, type ScheduledMessageListResponse, type ScheduledMessageStatus, type SendMessageRequest, type SendVerificationRequest, type SendVerificationResponse, type SenderType, Sendly, type SendlyConfig, SendlyError, type SendlyErrorCode, type Template, type TemplateListResponse, type TemplatePreview, type TemplateStatus, type TemplateVariable, TimeoutError, type UpdateCampaignRequest, type UpdateContactListRequest, type UpdateContactRequest, type UpdateTemplateRequest, type UpdateWebhookOptions, type ValidateSessionTokenRequest, type ValidateSessionTokenResponse, ValidationError, type Verification, type VerificationDeliveryStatus, type VerificationListResponse, type VerificationStatus, type VerifySession, type VerifySessionStatus, type Webhook, type WebhookCreatedResponse, type WebhookDelivery, type WebhookEvent, type WebhookEventType, type WebhookMessageData, type WebhookMessageStatus, type WebhookSecretRotation, WebhookSignatureError, type WebhookTestResult, Webhooks, calculateSegments, Sendly as default, generateWebhookSignature, getCountryFromPhone, isCountrySupported, parseWebhookEvent, validateMessageText, validatePhoneNumber, validateSenderId, verifyWebhookSignature };
|
|
4171
|
+
export { ALL_SUPPORTED_COUNTRIES, type Account, type AnalyticsOverview, type AnalyticsPeriod, type ApiErrorResponse, type ApiKey, AuthenticationError, type AutoTopUpSettings, type BatchListResponse, type BatchMessageItem, type BatchMessageRequest, type BatchMessageResponse, type BatchMessageResult, type BatchStatus, type BillingBreakdown, type BillingBreakdownOptions, type BulkProvisionResult, type BulkProvisionResultItem, type BulkProvisionWorkspace, CREDITS_PER_SMS, type Campaign, type CampaignListResponse, type CampaignPreview, type CampaignStatus, type CancelledMessageResponse, type CheckVerificationRequest, type CheckVerificationResponse, type CircuitState, type Contact, type ContactList, type ContactListResponse, type ContactListsResponse, type CreateCampaignRequest, type CreateContactListRequest, type CreateContactRequest, type CreateKeyOptions, type CreateOptInPageOptions, type CreateOptInPageResult, type CreateTemplateRequest, type CreateVerifySessionRequest, type CreateWebhookOptions, type CreateWorkspaceOptions, type CreatedApiKey, type CreditAnalytics, type CreditAnalyticsDataPoint, type CreditTransaction, type Credits, type DeliveryAnalyticsItem, type DeliveryStatus, type DnsRecord, type EnterpriseAccount, type EnterpriseWebhook, type EnterpriseWebhookTestResult, type EnterpriseWorkspace, type EnterpriseWorkspaceDetail, type EnterpriseWorkspaceSummary, type ImportContactItem, type ImportContactsError, type ImportContactsRequest, type ImportContactsResponse, InsufficientCreditsError, type Invitation, type ListBatchesOptions, type ListCampaignsOptions, type ListContactsOptions, type ListMessagesOptions, type ListScheduledMessagesOptions, type ListVerificationsOptions, type MediaFile, type MediaUploadOptions, type Message, type MessageAnalytics, type MessageAnalyticsDataPoint, type MessageListResponse, type MessageStatus, type MessageType, NetworkError, NotFoundError, type OptInPage, type PricingTier, type ProvisionWorkspaceOptions, type ProvisionWorkspaceResult, type QuotaSettings, RateLimitError, type RateLimitInfo, type ResumeWorkspaceResult, SANDBOX_TEST_NUMBERS, SUPPORTED_COUNTRIES, type ScheduleCampaignRequest, type ScheduleMessageRequest, type ScheduledMessage, type ScheduledMessageListResponse, type ScheduledMessageStatus, type SendInvitationOptions, type SendMessageRequest, type SendVerificationRequest, type SendVerificationResponse, type SenderType, Sendly, type SendlyConfig, SendlyError, type SendlyErrorCode, type SetCustomDomainResult, type SetWorkspaceWebhookOptions, type SetWorkspaceWebhookResult, type SuspendWorkspaceOptions, type SuspendWorkspaceResult, type Template, type TemplateListResponse, type TemplatePreview, type TemplateStatus, type TemplateVariable, TimeoutError, type TransferCreditsOptions, type TransferCreditsResult, type UpdateAutoTopUpOptions, type UpdateCampaignRequest, type UpdateContactListRequest, type UpdateContactRequest, type UpdateOptInPageOptions, type UpdateQuotaOptions, type UpdateTemplateRequest, type UpdateWebhookOptions, type ValidateSessionTokenRequest, type ValidateSessionTokenResponse, ValidationError, type Verification, type VerificationDeliveryStatus, type VerificationListResponse, type VerificationStatus, type VerifySession, type VerifySessionStatus, type Webhook, type WebhookCreatedResponse, type WebhookDelivery, type WebhookEvent, type WebhookEventType, type WebhookMessageData, type WebhookMessageStatus, type WebhookSecretRotation, WebhookSignatureError, type WebhookTestResult, Webhooks, type WorkspaceBillingItem, type WorkspaceCredits, type WorkspaceWebhook, calculateSegments, Sendly as default, generateWebhookSignature, getCountryFromPhone, isCountrySupported, parseWebhookEvent, validateMessageText, validatePhoneNumber, validateSenderId, verifyWebhookSignature };
|