@wave-av/sdk 2.0.4 → 2.0.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/audience.d.ts +105 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/billing-types.d.ts +39 -0
- package/dist/billing-types.d.ts.map +1 -0
- package/dist/billing-types.js +18 -0
- package/dist/billing-types.mjs +0 -0
- package/dist/billing.d.ts +69 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +139 -0
- package/dist/billing.mjs +9 -0
- package/dist/camera-control.d.ts +55 -0
- package/dist/camera-control.d.ts.map +1 -0
- package/dist/captions-types.d.ts +119 -0
- package/dist/captions-types.d.ts.map +1 -0
- package/dist/captions.d.ts +218 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/chapters-types.d.ts +87 -0
- package/dist/chapters-types.d.ts.map +1 -0
- package/dist/chapters.d.ts +207 -0
- package/dist/chapters.d.ts.map +1 -0
- package/dist/chunk-I3V47I4W.mjs +114 -0
- package/dist/client-types.d.ts +59 -0
- package/dist/client-types.d.ts.map +1 -0
- package/dist/client.d.ts +120 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clips-types.d.ts +31 -0
- package/dist/clips-types.d.ts.map +1 -0
- package/dist/clips.d.ts +230 -0
- package/dist/clips.d.ts.map +1 -0
- package/dist/cloud-switcher.d.ts +66 -0
- package/dist/cloud-switcher.d.ts.map +1 -0
- package/dist/collab-types.d.ts +205 -0
- package/dist/collab-types.d.ts.map +1 -0
- package/dist/collab.d.ts +227 -0
- package/dist/collab.d.ts.map +1 -0
- package/dist/connect.d.ts +89 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/creator.d.ts +110 -0
- package/dist/creator.d.ts.map +1 -0
- package/dist/desktop.d.ts +96 -0
- package/dist/desktop.d.ts.map +1 -0
- package/dist/distribution.d.ts +93 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/drm.d.ts +88 -0
- package/dist/drm.d.ts.map +1 -0
- package/dist/edge.d.ts +113 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/editor-types.d.ts +237 -0
- package/dist/editor-types.d.ts.map +1 -0
- package/dist/editor.d.ts +207 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/fleet.d.ts +208 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/ghost.d.ts +214 -0
- package/dist/ghost.d.ts.map +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.mjs +49 -43
- package/dist/marketplace.d.ts +91 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/mesh.d.ts +238 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/notifications.d.ts +83 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/phone-types.d.ts +111 -0
- package/dist/phone-types.d.ts.map +1 -0
- package/dist/phone.d.ts +235 -0
- package/dist/phone.d.ts.map +1 -0
- package/dist/pipeline-types.d.ts +188 -0
- package/dist/pipeline-types.d.ts.map +1 -0
- package/dist/pipeline.d.ts +224 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/podcast.d.ts +114 -0
- package/dist/podcast.d.ts.map +1 -0
- package/dist/prism.d.ts +133 -0
- package/dist/prism.d.ts.map +1 -0
- package/dist/prompter.d.ts +185 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/pulse.d.ts +157 -0
- package/dist/pulse.d.ts.map +1 -0
- package/dist/qr.d.ts +83 -0
- package/dist/qr.d.ts.map +1 -0
- package/dist/replay.d.ts +53 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/scene-types.d.ts +191 -0
- package/dist/scene-types.d.ts.map +1 -0
- package/dist/scene.d.ts +214 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/search-types.d.ts +211 -0
- package/dist/search-types.d.ts.map +1 -0
- package/dist/search.d.ts +251 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/sentiment-types.d.ts +108 -0
- package/dist/sentiment-types.d.ts.map +1 -0
- package/dist/sentiment.d.ts +247 -0
- package/dist/sentiment.d.ts.map +1 -0
- package/dist/signage.d.ts +102 -0
- package/dist/signage.d.ts.map +1 -0
- package/dist/slides.d.ts +69 -0
- package/dist/slides.d.ts.map +1 -0
- package/dist/studio-ai-types.d.ts +199 -0
- package/dist/studio-ai-types.d.ts.map +1 -0
- package/dist/studio-ai.d.ts +219 -0
- package/dist/studio-ai.d.ts.map +1 -0
- package/dist/studio-types.d.ts +268 -0
- package/dist/studio-types.d.ts.map +1 -0
- package/dist/studio.d.ts +235 -0
- package/dist/studio.d.ts.map +1 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/transcribe-types.d.ts +154 -0
- package/dist/transcribe-types.d.ts.map +1 -0
- package/dist/transcribe.d.ts +219 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/usb.d.ts +65 -0
- package/dist/usb.d.ts.map +1 -0
- package/dist/vault.d.ts +122 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/voice-types.d.ts +107 -0
- package/dist/voice-types.d.ts.map +1 -0
- package/dist/voice.d.ts +178 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/zoom.d.ts +92 -0
- package/dist/zoom.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/mesh.d.ts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Mesh API
|
|
3
|
+
*
|
|
4
|
+
* Multi-region infrastructure failover. Manage regions, peers, failover
|
|
5
|
+
* policies, and replication across your global streaming infrastructure.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
8
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
9
|
+
*/
|
|
10
|
+
import type { WaveClient, PaginationParams, PaginatedResponse, Timestamps } from "./client";
|
|
11
|
+
/**
|
|
12
|
+
* Region operational status
|
|
13
|
+
*/
|
|
14
|
+
export type RegionStatus = "active" | "standby" | "draining" | "offline";
|
|
15
|
+
/**
|
|
16
|
+
* Failover strategy
|
|
17
|
+
*/
|
|
18
|
+
export type FailoverStrategy = "automatic" | "manual" | "weighted";
|
|
19
|
+
/**
|
|
20
|
+
* Mesh region
|
|
21
|
+
*/
|
|
22
|
+
export interface MeshRegion extends Timestamps {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
provider: "aws" | "gcp" | "cloudflare" | "custom";
|
|
26
|
+
location: string;
|
|
27
|
+
status: RegionStatus;
|
|
28
|
+
latency_ms: number;
|
|
29
|
+
capacity_percent: number;
|
|
30
|
+
stream_count: number;
|
|
31
|
+
viewer_count: number;
|
|
32
|
+
is_primary: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Mesh peer connection between regions
|
|
36
|
+
*/
|
|
37
|
+
export interface MeshPeer {
|
|
38
|
+
id: string;
|
|
39
|
+
region_id: string;
|
|
40
|
+
endpoint: string;
|
|
41
|
+
status: "connected" | "disconnected" | "syncing";
|
|
42
|
+
last_sync_at: string;
|
|
43
|
+
replication_lag_ms: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Failover policy
|
|
47
|
+
*/
|
|
48
|
+
export interface FailoverPolicy extends Timestamps {
|
|
49
|
+
id: string;
|
|
50
|
+
organization_id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
strategy: FailoverStrategy;
|
|
53
|
+
primary_region: string;
|
|
54
|
+
fallback_regions: string[];
|
|
55
|
+
health_check_interval_ms: number;
|
|
56
|
+
failover_threshold: number;
|
|
57
|
+
auto_failback: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Failover event record
|
|
61
|
+
*/
|
|
62
|
+
export interface FailoverEvent {
|
|
63
|
+
id: string;
|
|
64
|
+
policy_id: string;
|
|
65
|
+
type: "failover" | "failback" | "manual_switch";
|
|
66
|
+
from_region: string;
|
|
67
|
+
to_region: string;
|
|
68
|
+
reason: string;
|
|
69
|
+
duration_ms: number;
|
|
70
|
+
timestamp: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Replication status between two regions
|
|
74
|
+
*/
|
|
75
|
+
export interface ReplicationStatus {
|
|
76
|
+
source_region: string;
|
|
77
|
+
target_region: string;
|
|
78
|
+
status: "synced" | "lagging" | "stale";
|
|
79
|
+
lag_ms: number;
|
|
80
|
+
last_sync_at: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Full mesh topology snapshot
|
|
84
|
+
*/
|
|
85
|
+
export interface MeshTopology {
|
|
86
|
+
regions: MeshRegion[];
|
|
87
|
+
peers: MeshPeer[];
|
|
88
|
+
policies: FailoverPolicy[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create a failover policy
|
|
92
|
+
*/
|
|
93
|
+
export interface CreatePolicyRequest {
|
|
94
|
+
name: string;
|
|
95
|
+
strategy: FailoverStrategy;
|
|
96
|
+
primary_region: string;
|
|
97
|
+
fallback_regions: string[];
|
|
98
|
+
health_check_interval_ms?: number;
|
|
99
|
+
failover_threshold?: number;
|
|
100
|
+
auto_failback?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* List regions filters
|
|
104
|
+
*/
|
|
105
|
+
export interface ListRegionsParams extends PaginationParams {
|
|
106
|
+
status?: RegionStatus;
|
|
107
|
+
provider?: "aws" | "gcp" | "cloudflare" | "custom";
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Mesh API client
|
|
111
|
+
*
|
|
112
|
+
* All operations require appropriate permissions. Authorization is enforced
|
|
113
|
+
* server-side - the API returns 403 if the authenticated user lacks access.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* import { WaveClient } from '@wave/sdk';
|
|
118
|
+
* import { MeshAPI } from '@wave/sdk/mesh';
|
|
119
|
+
*
|
|
120
|
+
* const client = new WaveClient({ apiKey: 'your-api-key' });
|
|
121
|
+
* const mesh = new MeshAPI(client);
|
|
122
|
+
*
|
|
123
|
+
* // Get the full mesh topology
|
|
124
|
+
* const topology = await mesh.getTopology();
|
|
125
|
+
* console.log('Regions:', topology.regions.length);
|
|
126
|
+
*
|
|
127
|
+
* // Create a failover policy
|
|
128
|
+
* const policy = await mesh.createPolicy({
|
|
129
|
+
* name: 'US West Failover',
|
|
130
|
+
* strategy: 'automatic',
|
|
131
|
+
* primary_region: 'us-west-2',
|
|
132
|
+
* fallback_regions: ['us-east-1', 'eu-west-1'],
|
|
133
|
+
* failover_threshold: 3,
|
|
134
|
+
* auto_failback: true,
|
|
135
|
+
* });
|
|
136
|
+
*
|
|
137
|
+
* // Trigger manual failover
|
|
138
|
+
* await mesh.triggerFailover(policy.id, 'us-east-1');
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare class MeshAPI {
|
|
142
|
+
private readonly client;
|
|
143
|
+
private readonly basePath;
|
|
144
|
+
constructor(client: WaveClient);
|
|
145
|
+
/**
|
|
146
|
+
* List mesh regions with optional filters
|
|
147
|
+
*
|
|
148
|
+
* Requires: mesh:read permission
|
|
149
|
+
*/
|
|
150
|
+
listRegions(params?: ListRegionsParams): Promise<PaginatedResponse<MeshRegion>>;
|
|
151
|
+
/**
|
|
152
|
+
* Get a region by ID
|
|
153
|
+
*
|
|
154
|
+
* Requires: mesh:read permission
|
|
155
|
+
*/
|
|
156
|
+
getRegion(regionId: string): Promise<MeshRegion>;
|
|
157
|
+
/**
|
|
158
|
+
* Get health details for a region
|
|
159
|
+
*
|
|
160
|
+
* Requires: mesh:read permission
|
|
161
|
+
*/
|
|
162
|
+
getRegionHealth(regionId: string): Promise<{
|
|
163
|
+
status: RegionStatus;
|
|
164
|
+
latency_ms: number;
|
|
165
|
+
details: Record<string, unknown>;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* List mesh peers, optionally filtered by region
|
|
169
|
+
*
|
|
170
|
+
* Requires: mesh:read permission
|
|
171
|
+
*/
|
|
172
|
+
listPeers(regionId?: string): Promise<MeshPeer[]>;
|
|
173
|
+
/**
|
|
174
|
+
* Add a peer to a region
|
|
175
|
+
*
|
|
176
|
+
* Requires: mesh:create permission
|
|
177
|
+
*/
|
|
178
|
+
addPeer(regionId: string, endpoint: string): Promise<MeshPeer>;
|
|
179
|
+
/**
|
|
180
|
+
* Remove a peer
|
|
181
|
+
*
|
|
182
|
+
* Requires: mesh:remove permission (server-side RBAC enforced)
|
|
183
|
+
*/
|
|
184
|
+
removePeer(peerId: string): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Create a failover policy
|
|
187
|
+
*
|
|
188
|
+
* Requires: mesh:create permission
|
|
189
|
+
*/
|
|
190
|
+
createPolicy(request: CreatePolicyRequest): Promise<FailoverPolicy>;
|
|
191
|
+
/**
|
|
192
|
+
* Update a failover policy
|
|
193
|
+
*
|
|
194
|
+
* Requires: mesh:update permission
|
|
195
|
+
*/
|
|
196
|
+
updatePolicy(policyId: string, updates: Partial<CreatePolicyRequest>): Promise<FailoverPolicy>;
|
|
197
|
+
/**
|
|
198
|
+
* Remove a failover policy
|
|
199
|
+
*
|
|
200
|
+
* Requires: mesh:remove permission (server-side RBAC enforced)
|
|
201
|
+
*/
|
|
202
|
+
removePolicy(policyId: string): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* List failover policies
|
|
205
|
+
*
|
|
206
|
+
* Requires: mesh:read permission
|
|
207
|
+
*/
|
|
208
|
+
listPolicies(params?: PaginationParams): Promise<PaginatedResponse<FailoverPolicy>>;
|
|
209
|
+
/**
|
|
210
|
+
* Trigger a manual failover to a target region
|
|
211
|
+
*
|
|
212
|
+
* Requires: mesh:failover permission
|
|
213
|
+
*/
|
|
214
|
+
triggerFailover(policyId: string, targetRegion: string): Promise<FailoverEvent>;
|
|
215
|
+
/**
|
|
216
|
+
* Get failover event history for a policy
|
|
217
|
+
*
|
|
218
|
+
* Requires: mesh:read permission
|
|
219
|
+
*/
|
|
220
|
+
getFailoverHistory(policyId: string, params?: PaginationParams): Promise<PaginatedResponse<FailoverEvent>>;
|
|
221
|
+
/**
|
|
222
|
+
* Get replication status between regions
|
|
223
|
+
*
|
|
224
|
+
* Requires: mesh:read permission
|
|
225
|
+
*/
|
|
226
|
+
getReplicationStatus(sourceRegion?: string, targetRegion?: string): Promise<ReplicationStatus[]>;
|
|
227
|
+
/**
|
|
228
|
+
* Get the full mesh topology (regions, peers, and policies)
|
|
229
|
+
*
|
|
230
|
+
* Requires: mesh:read permission
|
|
231
|
+
*/
|
|
232
|
+
getTopology(): Promise<MeshTopology>;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Create a Mesh API instance
|
|
236
|
+
*/
|
|
237
|
+
export declare function createMeshAPI(client: WaveClient): MeshAPI;
|
|
238
|
+
//# sourceMappingURL=mesh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../src/mesh.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAM5F;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,GAAG,KAAK,GAAG,YAAY,GAAG,QAAQ,CAAC;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,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Notifications API
|
|
3
|
+
*
|
|
4
|
+
* User notification preferences, delivery channels, and notification management.
|
|
5
|
+
*/
|
|
6
|
+
import type { WaveClient, PaginationParams, PaginatedResponse, Timestamps } from "./client";
|
|
7
|
+
export type NotificationChannel = "in_app" | "email" | "push" | "sms" | "slack" | "webhook";
|
|
8
|
+
export type NotificationStatus = "unread" | "read" | "archived";
|
|
9
|
+
export type NotificationPriority = "low" | "normal" | "high" | "urgent";
|
|
10
|
+
export interface Notification extends Timestamps {
|
|
11
|
+
id: string;
|
|
12
|
+
user_id: string;
|
|
13
|
+
type: string;
|
|
14
|
+
title: string;
|
|
15
|
+
body: string;
|
|
16
|
+
status: NotificationStatus;
|
|
17
|
+
priority: NotificationPriority;
|
|
18
|
+
channel: NotificationChannel;
|
|
19
|
+
action_url?: string;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
read_at?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface NotificationPreferences {
|
|
24
|
+
user_id: string;
|
|
25
|
+
channels: Record<NotificationChannel, boolean>;
|
|
26
|
+
categories: Record<string, {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
channels: NotificationChannel[];
|
|
29
|
+
}>;
|
|
30
|
+
quiet_hours?: {
|
|
31
|
+
start: string;
|
|
32
|
+
end: string;
|
|
33
|
+
timezone: string;
|
|
34
|
+
};
|
|
35
|
+
digest_frequency?: "realtime" | "hourly" | "daily" | "weekly";
|
|
36
|
+
}
|
|
37
|
+
export interface ListNotificationsParams extends PaginationParams {
|
|
38
|
+
status?: NotificationStatus;
|
|
39
|
+
type?: string;
|
|
40
|
+
priority?: NotificationPriority;
|
|
41
|
+
channel?: NotificationChannel;
|
|
42
|
+
since?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* User notification management: preferences, channels, read state, and delivery.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const notifications = await wave.notifications.list({ status: 'unread' });
|
|
50
|
+
* await wave.notifications.markAsRead(notifications.data[0].id);
|
|
51
|
+
* await wave.notifications.markAllRead();
|
|
52
|
+
* const prefs = await wave.notifications.getPreferences();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare class NotificationsAPI {
|
|
56
|
+
private readonly client;
|
|
57
|
+
private readonly basePath;
|
|
58
|
+
constructor(client: WaveClient);
|
|
59
|
+
/** List notifications with optional filters. */
|
|
60
|
+
list(params?: ListNotificationsParams): Promise<PaginatedResponse<Notification>>;
|
|
61
|
+
/** Get a single notification by ID. */
|
|
62
|
+
get(notificationId: string): Promise<Notification>;
|
|
63
|
+
/** Mark a notification as read. */
|
|
64
|
+
markAsRead(notificationId: string): Promise<Notification>;
|
|
65
|
+
/** Mark all notifications as read. */
|
|
66
|
+
markAllRead(): Promise<{
|
|
67
|
+
updated: number;
|
|
68
|
+
}>;
|
|
69
|
+
/** Archive a notification. */
|
|
70
|
+
archive(notificationId: string): Promise<Notification>;
|
|
71
|
+
/** Delete a notification. */
|
|
72
|
+
remove(notificationId: string): Promise<void>;
|
|
73
|
+
/** Get unread count. */
|
|
74
|
+
getUnreadCount(): Promise<{
|
|
75
|
+
count: number;
|
|
76
|
+
}>;
|
|
77
|
+
/** Get notification preferences. */
|
|
78
|
+
getPreferences(): Promise<NotificationPreferences>;
|
|
79
|
+
/** Update notification preferences. */
|
|
80
|
+
updatePreferences(preferences: Partial<NotificationPreferences>): Promise<NotificationPreferences>;
|
|
81
|
+
}
|
|
82
|
+
export declare function createNotificationsAPI(client: WaveClient): NotificationsAPI;
|
|
83
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAM5F,MAAM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ringing' | 'in_progress' | 'completed' | 'failed' | 'busy' | 'no_answer' | 'canceled';
|
|
2
|
+
export type CallDirection = 'inbound' | 'outbound';
|
|
3
|
+
export type PhoneNumberType = 'local' | 'toll_free' | 'mobile' | 'voip';
|
|
4
|
+
export interface PhoneNumberCapabilities {
|
|
5
|
+
voice: boolean;
|
|
6
|
+
sms: boolean;
|
|
7
|
+
mms: boolean;
|
|
8
|
+
fax: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface PhoneNumber extends Timestamps {
|
|
11
|
+
id: string;
|
|
12
|
+
organization_id: string;
|
|
13
|
+
number: string;
|
|
14
|
+
formatted_number: string;
|
|
15
|
+
country_code: string;
|
|
16
|
+
type: PhoneNumberType;
|
|
17
|
+
capabilities: PhoneNumberCapabilities;
|
|
18
|
+
friendly_name?: string;
|
|
19
|
+
status: 'active' | 'inactive' | 'pending';
|
|
20
|
+
monthly_cost: number;
|
|
21
|
+
metadata?: Metadata;
|
|
22
|
+
}
|
|
23
|
+
export interface Call extends Timestamps {
|
|
24
|
+
id: string;
|
|
25
|
+
organization_id: string;
|
|
26
|
+
from_number: string;
|
|
27
|
+
to_number: string;
|
|
28
|
+
direction: CallDirection;
|
|
29
|
+
status: CallStatus;
|
|
30
|
+
duration?: number;
|
|
31
|
+
start_time?: string;
|
|
32
|
+
end_time?: string;
|
|
33
|
+
recording_url?: string;
|
|
34
|
+
transcription_id?: string;
|
|
35
|
+
cost?: number;
|
|
36
|
+
metadata?: Metadata;
|
|
37
|
+
}
|
|
38
|
+
export interface MakeCallRequest {
|
|
39
|
+
/** Phone number to call from (must be owned) */
|
|
40
|
+
from: string;
|
|
41
|
+
/** Phone number to call */
|
|
42
|
+
to: string;
|
|
43
|
+
/** URL for call status webhooks */
|
|
44
|
+
status_callback_url?: string;
|
|
45
|
+
/** URL for call instructions (TwiML or similar) */
|
|
46
|
+
url?: string;
|
|
47
|
+
/** Timeout in seconds before no-answer */
|
|
48
|
+
timeout?: number;
|
|
49
|
+
/** Record the call */
|
|
50
|
+
record?: boolean;
|
|
51
|
+
/** Enable transcription */
|
|
52
|
+
transcribe?: boolean;
|
|
53
|
+
/** Custom data to include with call events */
|
|
54
|
+
metadata?: Metadata;
|
|
55
|
+
}
|
|
56
|
+
export interface UpdateCallRequest {
|
|
57
|
+
/** URL for new call instructions */
|
|
58
|
+
url?: string;
|
|
59
|
+
/** End the call */
|
|
60
|
+
status?: 'completed' | 'canceled';
|
|
61
|
+
/** Mute/unmute the call */
|
|
62
|
+
muted?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface Conference extends Timestamps {
|
|
65
|
+
id: string;
|
|
66
|
+
organization_id: string;
|
|
67
|
+
friendly_name: string;
|
|
68
|
+
status: 'init' | 'in_progress' | 'completed';
|
|
69
|
+
region?: string;
|
|
70
|
+
participants: ConferenceParticipant[];
|
|
71
|
+
max_participants?: number;
|
|
72
|
+
recording_enabled: boolean;
|
|
73
|
+
recording_url?: string;
|
|
74
|
+
metadata?: Metadata;
|
|
75
|
+
}
|
|
76
|
+
export interface ConferenceParticipant {
|
|
77
|
+
call_id: string;
|
|
78
|
+
phone_number: string;
|
|
79
|
+
status: 'connecting' | 'connected' | 'disconnected';
|
|
80
|
+
muted: boolean;
|
|
81
|
+
hold: boolean;
|
|
82
|
+
start_time?: string;
|
|
83
|
+
duration?: number;
|
|
84
|
+
}
|
|
85
|
+
export interface SearchNumbersRequest {
|
|
86
|
+
country_code: string;
|
|
87
|
+
type?: PhoneNumberType;
|
|
88
|
+
area_code?: string;
|
|
89
|
+
contains?: string;
|
|
90
|
+
capabilities?: Partial<PhoneNumberCapabilities>;
|
|
91
|
+
limit?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface AvailablePhoneNumber {
|
|
94
|
+
number: string;
|
|
95
|
+
formatted_number: string;
|
|
96
|
+
country_code: string;
|
|
97
|
+
type: PhoneNumberType;
|
|
98
|
+
capabilities: PhoneNumberCapabilities;
|
|
99
|
+
region?: string;
|
|
100
|
+
city?: string;
|
|
101
|
+
monthly_cost: number;
|
|
102
|
+
}
|
|
103
|
+
export interface ListCallsParams extends PaginationParams {
|
|
104
|
+
status?: CallStatus;
|
|
105
|
+
direction?: CallDirection;
|
|
106
|
+
from_number?: string;
|
|
107
|
+
to_number?: string;
|
|
108
|
+
start_after?: string;
|
|
109
|
+
start_before?: string;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=phone-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-types.d.ts","sourceRoot":"","sources":["../src/phone-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,SAAS,GACT,aAAa,GACb,WAAW,GACX,QAAQ,GACR,MAAM,GACN,WAAW,GACX,UAAU,CAAC;AACf,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AACxE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CACd;AACD,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,eAAe,CAAC;IACtB,YAAY,EAAE,uBAAuB,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AACD,MAAM,WAAW,IAAK,SAAQ,UAAU;IACtC,EAAE,EAAE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AAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/phone.d.ts
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Phone API
|
|
3
|
+
*
|
|
4
|
+
* Voice calling and telephony integration capabilities.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
7
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
8
|
+
*/
|
|
9
|
+
import type { WaveClient, PaginationParams, PaginatedResponse, Metadata } from './client';
|
|
10
|
+
import type { PhoneNumberType, PhoneNumber, Call, MakeCallRequest, UpdateCallRequest, Conference, ConferenceParticipant, SearchNumbersRequest, AvailablePhoneNumber, ListCallsParams } from './phone-types';
|
|
11
|
+
/**
|
|
12
|
+
* Call status
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Call direction
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Phone number type
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Phone number capabilities
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Phone number
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Call record
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Make call request
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Call update request
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Conference room
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Conference participant
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Search available numbers request
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Available phone number
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* List calls params
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* Phone API client
|
|
52
|
+
*/
|
|
53
|
+
export declare class PhoneAPI {
|
|
54
|
+
private readonly client;
|
|
55
|
+
private readonly basePath;
|
|
56
|
+
constructor(client: WaveClient);
|
|
57
|
+
/**
|
|
58
|
+
* List owned phone numbers
|
|
59
|
+
*
|
|
60
|
+
* Requires: phone:read permission
|
|
61
|
+
*/
|
|
62
|
+
listNumbers(params?: PaginationParams & {
|
|
63
|
+
status?: 'active' | 'inactive';
|
|
64
|
+
type?: PhoneNumberType;
|
|
65
|
+
}): Promise<PaginatedResponse<PhoneNumber>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a phone number by ID
|
|
68
|
+
*
|
|
69
|
+
* Requires: phone:read permission
|
|
70
|
+
*/
|
|
71
|
+
getNumber(numberId: string): Promise<PhoneNumber>;
|
|
72
|
+
/**
|
|
73
|
+
* Search for available phone numbers to purchase
|
|
74
|
+
*
|
|
75
|
+
* Requires: phone:read permission
|
|
76
|
+
*/
|
|
77
|
+
searchAvailableNumbers(request: SearchNumbersRequest): Promise<AvailablePhoneNumber[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Purchase a phone number
|
|
80
|
+
*
|
|
81
|
+
* Requires: phone:purchase permission
|
|
82
|
+
*/
|
|
83
|
+
purchaseNumber(number: string, options?: {
|
|
84
|
+
friendly_name?: string;
|
|
85
|
+
metadata?: Metadata;
|
|
86
|
+
}): Promise<PhoneNumber>;
|
|
87
|
+
/**
|
|
88
|
+
* Update a phone number
|
|
89
|
+
*
|
|
90
|
+
* Requires: phone:update permission
|
|
91
|
+
*/
|
|
92
|
+
updateNumber(numberId: string, updates: {
|
|
93
|
+
friendly_name?: string;
|
|
94
|
+
metadata?: Metadata;
|
|
95
|
+
}): Promise<PhoneNumber>;
|
|
96
|
+
/**
|
|
97
|
+
* Release a phone number
|
|
98
|
+
*
|
|
99
|
+
* Requires: phone:release permission (server-side RBAC enforced)
|
|
100
|
+
*/
|
|
101
|
+
releaseNumber(numberId: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Make an outbound call
|
|
104
|
+
*
|
|
105
|
+
* Requires: phone:call permission
|
|
106
|
+
*/
|
|
107
|
+
makeCall(request: MakeCallRequest): Promise<Call>;
|
|
108
|
+
/**
|
|
109
|
+
* Get a call by ID
|
|
110
|
+
*
|
|
111
|
+
* Requires: phone:read permission
|
|
112
|
+
*/
|
|
113
|
+
getCall(callId: string): Promise<Call>;
|
|
114
|
+
/**
|
|
115
|
+
* List calls
|
|
116
|
+
*
|
|
117
|
+
* Requires: phone:read permission
|
|
118
|
+
*/
|
|
119
|
+
listCalls(params?: ListCallsParams): Promise<PaginatedResponse<Call>>;
|
|
120
|
+
/**
|
|
121
|
+
* Update an active call
|
|
122
|
+
*
|
|
123
|
+
* Requires: phone:call permission
|
|
124
|
+
*/
|
|
125
|
+
updateCall(callId: string, updates: UpdateCallRequest): Promise<Call>;
|
|
126
|
+
/**
|
|
127
|
+
* End an active call
|
|
128
|
+
*
|
|
129
|
+
* Requires: phone:call permission
|
|
130
|
+
*/
|
|
131
|
+
endCall(callId: string): Promise<Call>;
|
|
132
|
+
/**
|
|
133
|
+
* Get call recording
|
|
134
|
+
*
|
|
135
|
+
* Requires: phone:read permission
|
|
136
|
+
*/
|
|
137
|
+
getRecording(callId: string): Promise<{
|
|
138
|
+
url: string;
|
|
139
|
+
duration: number;
|
|
140
|
+
file_size: number;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Wait for call to end
|
|
144
|
+
*/
|
|
145
|
+
waitForCallEnd(callId: string, options?: {
|
|
146
|
+
pollInterval?: number;
|
|
147
|
+
timeout?: number;
|
|
148
|
+
onUpdate?: (call: Call) => void;
|
|
149
|
+
}): Promise<Call>;
|
|
150
|
+
/**
|
|
151
|
+
* Create a conference room
|
|
152
|
+
*
|
|
153
|
+
* Requires: phone:conference permission
|
|
154
|
+
*/
|
|
155
|
+
createConference(options: {
|
|
156
|
+
friendly_name: string;
|
|
157
|
+
max_participants?: number;
|
|
158
|
+
recording_enabled?: boolean;
|
|
159
|
+
region?: string;
|
|
160
|
+
metadata?: Metadata;
|
|
161
|
+
}): Promise<Conference>;
|
|
162
|
+
/**
|
|
163
|
+
* Get a conference by ID
|
|
164
|
+
*
|
|
165
|
+
* Requires: phone:read permission
|
|
166
|
+
*/
|
|
167
|
+
getConference(conferenceId: string): Promise<Conference>;
|
|
168
|
+
/**
|
|
169
|
+
* List conferences
|
|
170
|
+
*
|
|
171
|
+
* Requires: phone:read permission
|
|
172
|
+
*/
|
|
173
|
+
listConferences(params?: PaginationParams & {
|
|
174
|
+
status?: 'init' | 'in_progress' | 'completed';
|
|
175
|
+
}): Promise<PaginatedResponse<Conference>>;
|
|
176
|
+
/**
|
|
177
|
+
* Add a participant to a conference
|
|
178
|
+
*
|
|
179
|
+
* Requires: phone:conference permission
|
|
180
|
+
*/
|
|
181
|
+
addConferenceParticipant(conferenceId: string, options: {
|
|
182
|
+
from: string;
|
|
183
|
+
to: string;
|
|
184
|
+
muted?: boolean;
|
|
185
|
+
}): Promise<ConferenceParticipant>;
|
|
186
|
+
/**
|
|
187
|
+
* Update a conference participant
|
|
188
|
+
*
|
|
189
|
+
* Requires: phone:conference permission
|
|
190
|
+
*/
|
|
191
|
+
updateConferenceParticipant(conferenceId: string, callId: string, updates: {
|
|
192
|
+
muted?: boolean;
|
|
193
|
+
hold?: boolean;
|
|
194
|
+
}): Promise<ConferenceParticipant>;
|
|
195
|
+
/**
|
|
196
|
+
* Remove a participant from a conference
|
|
197
|
+
*
|
|
198
|
+
* Requires: phone:conference permission (server-side RBAC enforced)
|
|
199
|
+
*/
|
|
200
|
+
removeConferenceParticipant(conferenceId: string, callId: string): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* End a conference
|
|
203
|
+
*
|
|
204
|
+
* Requires: phone:conference permission
|
|
205
|
+
*/
|
|
206
|
+
endConference(conferenceId: string): Promise<Conference>;
|
|
207
|
+
/**
|
|
208
|
+
* Validate a phone number
|
|
209
|
+
*
|
|
210
|
+
* Requires: phone:read permission
|
|
211
|
+
*/
|
|
212
|
+
validateNumber(number: string): Promise<{
|
|
213
|
+
valid: boolean;
|
|
214
|
+
formatted_number?: string;
|
|
215
|
+
country_code?: string;
|
|
216
|
+
type?: PhoneNumberType;
|
|
217
|
+
carrier?: string;
|
|
218
|
+
}>;
|
|
219
|
+
/**
|
|
220
|
+
* Get supported countries
|
|
221
|
+
*
|
|
222
|
+
* Requires: phone:read permission
|
|
223
|
+
*/
|
|
224
|
+
getSupportedCountries(): Promise<Array<{
|
|
225
|
+
code: string;
|
|
226
|
+
name: string;
|
|
227
|
+
calling_code: string;
|
|
228
|
+
supported_types: PhoneNumberType[];
|
|
229
|
+
}>>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Create a Phone API instance
|
|
233
|
+
*/
|
|
234
|
+
export declare function createPhoneAPI(client: WaveClient): PhoneAPI;
|
|
235
|
+
//# sourceMappingURL=phone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../src/phone.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EAEjB,QAAQ,EACT,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAA6B,eAAe,EAA2B,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhQ;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAIH;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,O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