@ipcom/asterisk-ari 0.0.19 → 0.0.21
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/cjs/index.cjs +204 -49
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/esm/index.js +203 -49
- package/dist/esm/index.js.map +2 -2
- package/dist/types/ari-client/ariClient.d.ts +172 -33
- package/dist/types/ari-client/ariClient.d.ts.map +1 -1
- package/dist/types/ari-client/interfaces/applications.types.d.ts +3 -4
- package/dist/types/ari-client/interfaces/applications.types.d.ts.map +1 -1
- package/dist/types/ari-client/interfaces/events.types.d.ts +58 -0
- package/dist/types/ari-client/interfaces/events.types.d.ts.map +1 -0
- package/dist/types/ari-client/interfaces/index.d.ts +1 -0
- package/dist/types/ari-client/interfaces/index.d.ts.map +1 -1
- package/dist/types/ari-client/resources/applications.d.ts +12 -7
- package/dist/types/ari-client/resources/applications.d.ts.map +1 -1
- package/dist/types/ari-client/websocketClient.d.ts +4 -1
- package/dist/types/ari-client/websocketClient.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import type { Application, ApplicationDetails } from "./interfaces/applications.
|
|
|
2
2
|
import type { AsteriskInfo, Logging, Module, Variable } from "./interfaces/asterisk.types";
|
|
3
3
|
import type { Channel, ChannelPlayback, ChannelVar, ExternalMediaOptions, OriginateRequest, PlaybackOptions, RTPStats, RecordingOptions, SnoopOptions } from "./interfaces/channels.types";
|
|
4
4
|
import type { Endpoint, EndpointDetails } from "./interfaces/endpoints.types.js";
|
|
5
|
+
import type { WebSocketEvent, WebSocketEventType } from "./interfaces/events.types";
|
|
5
6
|
import type { Playback as APIPlayback, PlaybackControlRequest } from "./interfaces/playbacks.types";
|
|
6
7
|
import type { AriClientConfig } from "./interfaces/requests.js";
|
|
7
8
|
import type { Sound, SoundListRequest } from "./interfaces/sounds.types";
|
|
@@ -29,7 +30,7 @@ export declare class AriClient {
|
|
|
29
30
|
* @param app - The application name to connect to.
|
|
30
31
|
* @returns {Promise<void>} Resolves when the WebSocket connects successfully.
|
|
31
32
|
*/
|
|
32
|
-
connectWebSocket(app: string): Promise<void>;
|
|
33
|
+
connectWebSocket(app: string, subscribedEvents?: WebSocketEventType[]): Promise<void>;
|
|
33
34
|
/**
|
|
34
35
|
* Ensures the ARI application is registered.
|
|
35
36
|
*
|
|
@@ -44,12 +45,16 @@ export declare class AriClient {
|
|
|
44
45
|
*/
|
|
45
46
|
isWebSocketConnected(): boolean;
|
|
46
47
|
/**
|
|
47
|
-
* Registers a callback for
|
|
48
|
+
* Registers a callback function for WebSocket events.
|
|
49
|
+
* This method allows you to listen for and respond to WebSocket messages
|
|
50
|
+
* and process specific event types.
|
|
48
51
|
*
|
|
49
|
-
* @param
|
|
50
|
-
*
|
|
52
|
+
* @param callback - The callback function to execute when a WebSocket message is received.
|
|
53
|
+
* The function will receive the parsed event data as its parameter.
|
|
54
|
+
* @throws {Error} Throws an error if the WebSocket is not connected when trying to register the event.
|
|
55
|
+
* @returns {void}
|
|
51
56
|
*/
|
|
52
|
-
onWebSocketEvent(
|
|
57
|
+
onWebSocketEvent(callback: (data: WebSocketEvent) => void): void;
|
|
53
58
|
/**
|
|
54
59
|
* Closes the WebSocket connection.
|
|
55
60
|
*/
|
|
@@ -140,7 +145,14 @@ export declare class AriClient {
|
|
|
140
145
|
*/
|
|
141
146
|
snoopChannelWithId(channelId: string, snoopId: string, options: SnoopOptions): Promise<Channel>;
|
|
142
147
|
/**
|
|
143
|
-
*
|
|
148
|
+
* Initiates a dial operation on a previously created channel.
|
|
149
|
+
* This function attempts to connect the specified channel to its configured destination.
|
|
150
|
+
*
|
|
151
|
+
* @param channelId - The unique identifier of the channel to dial.
|
|
152
|
+
* @param caller - Optional. The caller ID to use for the outgoing call. If not provided, the default caller ID for the channel will be used.
|
|
153
|
+
* @param timeout - Optional. The maximum time in seconds to wait for the dial operation to complete. If not specified, the system's default timeout will be used.
|
|
154
|
+
* @returns A Promise that resolves when the dial operation has been initiated successfully. Note that this does not guarantee that the call was answered, only that dialing has begun.
|
|
155
|
+
* @throws Will throw an error if the dial operation fails, e.g., if the channel doesn't exist or is in an invalid state.
|
|
144
156
|
*/
|
|
145
157
|
dialChannel(channelId: string, caller?: string, timeout?: number): Promise<void>;
|
|
146
158
|
/**
|
|
@@ -164,11 +176,34 @@ export declare class AriClient {
|
|
|
164
176
|
*/
|
|
165
177
|
ringChannel(channelId: string): Promise<void>;
|
|
166
178
|
/**
|
|
167
|
-
* Stops ringing indication on a channel.
|
|
179
|
+
* Stops the ringing indication on a specified channel in the Asterisk system.
|
|
180
|
+
*
|
|
181
|
+
* This function sends a request to the Asterisk server to cease the ringing
|
|
182
|
+
* indication on a particular channel. This is typically used when you want to
|
|
183
|
+
* stop the ringing sound on a channel without answering or hanging up the call.
|
|
184
|
+
*
|
|
185
|
+
* @param channelId - The unique identifier of the channel on which to stop the ringing.
|
|
186
|
+
* This should be a string that uniquely identifies the channel in the Asterisk system.
|
|
187
|
+
*
|
|
188
|
+
* @returns A Promise that resolves when the ringing has been successfully stopped on the specified channel.
|
|
189
|
+
* The promise resolves to void, indicating no specific return value.
|
|
190
|
+
* If an error occurs during the operation, the promise will be rejected with an error object.
|
|
168
191
|
*/
|
|
169
192
|
stopRingChannel(channelId: string): Promise<void>;
|
|
170
193
|
/**
|
|
171
|
-
* Sends DTMF to a channel.
|
|
194
|
+
* Sends DTMF (Dual-Tone Multi-Frequency) tones to a specified channel.
|
|
195
|
+
*
|
|
196
|
+
* This function allows sending DTMF tones to a channel, which can be used for various purposes
|
|
197
|
+
* such as interacting with IVR systems or sending signals during a call.
|
|
198
|
+
*
|
|
199
|
+
* @param channelId - The unique identifier of the channel to send DTMF tones to.
|
|
200
|
+
* @param dtmf - A string representing the DTMF tones to send (e.g., "123#").
|
|
201
|
+
* @param options - Optional parameters to control the timing of DTMF tones.
|
|
202
|
+
* @param options.before - The time (in milliseconds) to wait before sending DTMF.
|
|
203
|
+
* @param options.between - The time (in milliseconds) to wait between each DTMF tone.
|
|
204
|
+
* @param options.duration - The duration (in milliseconds) of each DTMF tone.
|
|
205
|
+
* @param options.after - The time (in milliseconds) to wait after sending all DTMF tones.
|
|
206
|
+
* @returns A Promise that resolves when the DTMF tones have been successfully sent.
|
|
172
207
|
*/
|
|
173
208
|
sendDTMF(channelId: string, dtmf: string, options?: {
|
|
174
209
|
before?: number;
|
|
@@ -177,26 +212,96 @@ export declare class AriClient {
|
|
|
177
212
|
after?: number;
|
|
178
213
|
}): Promise<void>;
|
|
179
214
|
/**
|
|
180
|
-
* Mutes a channel.
|
|
215
|
+
* Mutes a channel in the Asterisk system.
|
|
216
|
+
*
|
|
217
|
+
* This function initiates a mute operation on the specified channel, preventing
|
|
218
|
+
* audio transmission in the specified direction(s).
|
|
219
|
+
*
|
|
220
|
+
* @param channelId - The unique identifier of the channel to be muted.
|
|
221
|
+
* This should be a string that uniquely identifies the channel in the Asterisk system.
|
|
222
|
+
* @param direction - The direction of audio to mute. Can be one of:
|
|
223
|
+
* - "both": Mute both incoming and outgoing audio (default)
|
|
224
|
+
* - "in": Mute only incoming audio
|
|
225
|
+
* - "out": Mute only outgoing audio
|
|
226
|
+
*
|
|
227
|
+
* @returns A Promise that resolves when the mute operation has been successfully completed.
|
|
228
|
+
* The promise resolves to void, indicating no specific return value.
|
|
229
|
+
* If an error occurs during the operation, the promise will be rejected with an error object.
|
|
181
230
|
*/
|
|
182
231
|
muteChannel(channelId: string, direction?: "both" | "in" | "out"): Promise<void>;
|
|
183
232
|
/**
|
|
184
|
-
* Unmutes a channel.
|
|
233
|
+
* Unmutes a channel in the Asterisk system.
|
|
234
|
+
*
|
|
235
|
+
* This function removes the mute status from a specified channel, allowing audio
|
|
236
|
+
* transmission to resume in the specified direction(s).
|
|
237
|
+
*
|
|
238
|
+
* @param channelId - The unique identifier of the channel to be unmuted.
|
|
239
|
+
* This should be a string that uniquely identifies the channel in the Asterisk system.
|
|
240
|
+
* @param direction - The direction of audio to unmute. Can be one of:
|
|
241
|
+
* - "both": Unmute both incoming and outgoing audio (default)
|
|
242
|
+
* - "in": Unmute only incoming audio
|
|
243
|
+
* - "out": Unmute only outgoing audio
|
|
244
|
+
*
|
|
245
|
+
* @returns A Promise that resolves when the unmute operation has been successfully completed.
|
|
246
|
+
* The promise resolves to void, indicating no specific return value.
|
|
247
|
+
* If an error occurs during the operation, the promise will be rejected with an error object.
|
|
185
248
|
*/
|
|
186
249
|
unmuteChannel(channelId: string, direction?: "both" | "in" | "out"): Promise<void>;
|
|
187
250
|
/**
|
|
188
|
-
* Puts a channel on hold.
|
|
251
|
+
* Puts a specified channel on hold.
|
|
252
|
+
*
|
|
253
|
+
* This function initiates a hold operation on the specified channel in the Asterisk system.
|
|
254
|
+
* When a channel is put on hold, typically the audio is muted or replaced with hold music,
|
|
255
|
+
* depending on the system configuration.
|
|
256
|
+
*
|
|
257
|
+
* @param channelId - The unique identifier of the channel to be put on hold.
|
|
258
|
+
* This should be a string that uniquely identifies the channel in the Asterisk system.
|
|
259
|
+
*
|
|
260
|
+
* @returns A Promise that resolves when the hold operation has been successfully initiated.
|
|
261
|
+
* The promise resolves to void, indicating no specific return value.
|
|
262
|
+
* If an error occurs during the operation, the promise will be rejected with an error object.
|
|
189
263
|
*/
|
|
190
264
|
holdChannel(channelId: string): Promise<void>;
|
|
191
265
|
/**
|
|
192
|
-
* Removes a channel from hold.
|
|
266
|
+
* Removes a specified channel from hold.
|
|
267
|
+
*
|
|
268
|
+
* This function initiates an unhold operation on the specified channel in the Asterisk system.
|
|
269
|
+
* When a channel is taken off hold, it typically resumes normal audio transmission,
|
|
270
|
+
* allowing the parties to continue their conversation.
|
|
271
|
+
*
|
|
272
|
+
* @param channelId - The unique identifier of the channel to be taken off hold.
|
|
273
|
+
* This should be a string that uniquely identifies the channel in the Asterisk system.
|
|
274
|
+
*
|
|
275
|
+
* @returns A Promise that resolves when the unhold operation has been successfully initiated.
|
|
276
|
+
* The promise resolves to void, indicating no specific return value.
|
|
277
|
+
* If an error occurs during the operation, the promise will be rejected with an error object.
|
|
193
278
|
*/
|
|
194
279
|
unholdChannel(channelId: string): Promise<void>;
|
|
195
280
|
/**
|
|
196
|
-
* Creates a new channel using the provided originate request data.
|
|
281
|
+
* Creates a new channel in the Asterisk system using the provided originate request data.
|
|
282
|
+
* This function initiates a new communication channel based on the specified parameters.
|
|
197
283
|
*
|
|
198
|
-
* @param data -
|
|
199
|
-
*
|
|
284
|
+
* @param data - An object containing the originate request data for channel creation.
|
|
285
|
+
* This includes details such as the endpoint to call, the context to use,
|
|
286
|
+
* and any variables to set on the new channel.
|
|
287
|
+
* @param data.endpoint - The endpoint to call (e.g., "SIP/1234").
|
|
288
|
+
* @param data.extension - The extension to dial after the channel is created.
|
|
289
|
+
* @param data.context - The dialplan context to use for the new channel.
|
|
290
|
+
* @param data.priority - The priority to start at in the dialplan.
|
|
291
|
+
* @param data.app - The application to execute on the channel (alternative to extension/context/priority).
|
|
292
|
+
* @param data.appArgs - The arguments to pass to the application, if 'app' is specified.
|
|
293
|
+
* @param data.callerId - The caller ID to set on the new channel.
|
|
294
|
+
* @param data.timeout - The timeout (in seconds) to wait for the channel to be answered.
|
|
295
|
+
* @param data.variables - An object containing key-value pairs of channel variables to set.
|
|
296
|
+
* @param data.channelId - An optional ID to assign to the new channel.
|
|
297
|
+
* @param data.otherChannelId - The ID of another channel to bridge with after creation.
|
|
298
|
+
*
|
|
299
|
+
* @returns A Promise that resolves to the created Channel object.
|
|
300
|
+
* The Channel object contains details about the newly created channel,
|
|
301
|
+
* such as its unique identifier, state, and other relevant information.
|
|
302
|
+
*
|
|
303
|
+
* @throws Will throw an error if the channel creation fails for any reason,
|
|
304
|
+
* such as invalid parameters or system issues.
|
|
200
305
|
*/
|
|
201
306
|
createChannel(data: OriginateRequest): Promise<Channel>;
|
|
202
307
|
/**
|
|
@@ -272,63 +377,97 @@ export declare class AriClient {
|
|
|
272
377
|
*/
|
|
273
378
|
getPlaybackDetails(playbackId: string): Promise<APIPlayback>;
|
|
274
379
|
/**
|
|
275
|
-
* Controls a specific playback.
|
|
380
|
+
* Controls a specific playback in the Asterisk server.
|
|
276
381
|
*
|
|
277
|
-
* @param playbackId - The unique identifier of the playback.
|
|
278
|
-
* @param controlRequest -
|
|
279
|
-
* @returns
|
|
382
|
+
* @param playbackId - The unique identifier of the playback to control.
|
|
383
|
+
* @param controlRequest - An object containing the control operation details.
|
|
384
|
+
* @returns A Promise that resolves when the control operation is successfully executed.
|
|
280
385
|
*/
|
|
281
386
|
controlPlayback(playbackId: string, controlRequest: PlaybackControlRequest): Promise<void>;
|
|
282
387
|
/**
|
|
283
|
-
* Stops a specific playback.
|
|
388
|
+
* Stops a specific playback in the Asterisk server.
|
|
284
389
|
*
|
|
285
|
-
* @param playbackId - The unique identifier of the playback.
|
|
286
|
-
* @returns
|
|
390
|
+
* @param playbackId - The unique identifier of the playback to stop.
|
|
391
|
+
* @returns A Promise that resolves when the playback is successfully stopped.
|
|
287
392
|
*/
|
|
288
393
|
stopPlayback(playbackId: string): Promise<void>;
|
|
289
394
|
/**
|
|
290
|
-
*
|
|
395
|
+
* Retrieves a list of all available sounds in the Asterisk server.
|
|
291
396
|
*
|
|
292
397
|
* @param params - Optional parameters to filter the list of sounds.
|
|
293
|
-
* @returns
|
|
398
|
+
* @returns A Promise that resolves to an array of Sound objects representing the available sounds.
|
|
294
399
|
*/
|
|
295
400
|
listSounds(params?: SoundListRequest): Promise<Sound[]>;
|
|
296
401
|
/**
|
|
297
|
-
* Retrieves
|
|
402
|
+
* Retrieves detailed information about a specific sound in the Asterisk server.
|
|
298
403
|
*
|
|
299
|
-
* @param soundId - The unique identifier of the sound.
|
|
300
|
-
* @returns
|
|
404
|
+
* @param soundId - The unique identifier of the sound to retrieve details for.
|
|
405
|
+
* @returns A Promise that resolves to a Sound object containing the details of the specified sound.
|
|
301
406
|
*/
|
|
302
407
|
getSoundDetails(soundId: string): Promise<Sound>;
|
|
303
408
|
/**
|
|
304
|
-
* Retrieves information about the Asterisk server.
|
|
409
|
+
* Retrieves general information about the Asterisk server.
|
|
410
|
+
*
|
|
411
|
+
* @returns A Promise that resolves to an AsteriskInfo object containing server information.
|
|
305
412
|
*/
|
|
306
413
|
getAsteriskInfo(): Promise<AsteriskInfo>;
|
|
307
414
|
/**
|
|
308
|
-
*
|
|
415
|
+
* Retrieves a list of all loaded modules in the Asterisk server.
|
|
416
|
+
*
|
|
417
|
+
* @returns A Promise that resolves to an array of Module objects representing the loaded modules.
|
|
309
418
|
*/
|
|
310
419
|
listModules(): Promise<Module[]>;
|
|
311
420
|
/**
|
|
312
|
-
* Manages a specific module in the Asterisk server.
|
|
421
|
+
* Manages a specific module in the Asterisk server by loading, unloading, or reloading it.
|
|
422
|
+
*
|
|
423
|
+
* @param moduleName - The name of the module to manage.
|
|
424
|
+
* @param action - The action to perform on the module: "load", "unload", or "reload".
|
|
425
|
+
* @returns A Promise that resolves when the module management action is completed successfully.
|
|
313
426
|
*/
|
|
314
427
|
manageModule(moduleName: string, action: "load" | "unload" | "reload"): Promise<void>;
|
|
315
428
|
/**
|
|
316
|
-
* Retrieves all configured logging channels.
|
|
429
|
+
* Retrieves a list of all configured logging channels in the Asterisk server.
|
|
430
|
+
*
|
|
431
|
+
* @returns A Promise that resolves to an array of Logging objects representing the configured logging channels.
|
|
317
432
|
*/
|
|
318
433
|
listLoggingChannels(): Promise<Logging[]>;
|
|
319
434
|
/**
|
|
320
435
|
* Adds or removes a log channel in the Asterisk server.
|
|
436
|
+
*
|
|
437
|
+
* @param logChannelName - The name of the log channel to manage.
|
|
438
|
+
* @param action - The action to perform: "add" to create a new log channel or "remove" to delete an existing one.
|
|
439
|
+
* @param configuration - Optional configuration object for adding a log channel. Ignored when removing a channel.
|
|
440
|
+
* @param configuration.type - The type of the log channel.
|
|
441
|
+
* @param configuration.configuration - Additional configuration details for the log channel.
|
|
442
|
+
* @returns A Promise that resolves when the log channel management action is completed successfully.
|
|
321
443
|
*/
|
|
322
444
|
manageLogChannel(logChannelName: string, action: "add" | "remove", configuration?: {
|
|
323
445
|
type?: string;
|
|
324
446
|
configuration?: string;
|
|
325
447
|
}): Promise<void>;
|
|
326
448
|
/**
|
|
327
|
-
* Retrieves the value of a global variable.
|
|
449
|
+
* Retrieves the value of a global variable from the Asterisk server.
|
|
450
|
+
*
|
|
451
|
+
* @param variableName - The name of the global variable to retrieve.
|
|
452
|
+
* @returns A Promise that resolves to a Variable object containing the name and value of the global variable.
|
|
328
453
|
*/
|
|
329
454
|
getGlobalVariable(variableName: string): Promise<Variable>;
|
|
330
455
|
/**
|
|
331
|
-
* Sets a global variable.
|
|
456
|
+
* Sets a global variable in the Asterisk server.
|
|
457
|
+
*
|
|
458
|
+
* This function allows you to set or update the value of a global variable
|
|
459
|
+
* in the Asterisk server. Global variables are accessible throughout the
|
|
460
|
+
* entire Asterisk system and can be used for various purposes such as
|
|
461
|
+
* configuration settings or sharing data between different parts of the system.
|
|
462
|
+
*
|
|
463
|
+
* @param variableName - The name of the global variable to set or update.
|
|
464
|
+
* This should be a string identifying the variable uniquely.
|
|
465
|
+
* @param value - The value to assign to the global variable. This can be any
|
|
466
|
+
* string value, including empty strings.
|
|
467
|
+
* @returns A Promise that resolves when the global variable has been successfully
|
|
468
|
+
* set. The promise resolves to void, indicating no specific return value.
|
|
469
|
+
* If an error occurs during the operation, the promise will be rejected
|
|
470
|
+
* with an error object.
|
|
332
471
|
*/
|
|
333
472
|
setGlobalVariable(variableName: string, value: string): Promise<void>;
|
|
334
473
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ariClient.d.ts","sourceRoot":"","sources":["../../../src/ari-client/ariClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,6BAA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;;;OAKG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIhE;;;;;;;;;;;;;;;;OAgBG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5E"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import type { WebSocketEvent } from "./events.types";
|
|
1
2
|
export interface Application {
|
|
2
3
|
name: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
}
|
|
5
|
-
export interface ApplicationDetails {
|
|
6
|
-
|
|
7
|
-
description?: string;
|
|
8
|
-
subscribedEvents?: string[];
|
|
6
|
+
export interface ApplicationDetails extends Application {
|
|
7
|
+
subscribedEvents?: WebSocketEvent["type"][];
|
|
9
8
|
}
|
|
10
9
|
//# sourceMappingURL=applications.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.types.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/interfaces/applications.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"applications.types.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/interfaces/applications.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,gBAAgB,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;CAC7C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Channel } from "./channels.types";
|
|
2
|
+
export type WebSocketEventType = "DeviceStateChanged" | "PlaybackStarted" | "PlaybackContinuing" | "PlaybackFinished" | "RecordingStarted" | "RecordingFinished" | "RecordingFailed" | "ApplicationMoveFailed" | "ApplicationReplaced" | "BridgeCreated" | "BridgeDestroyed" | "BridgeMerged" | "BridgeBlindTransfer" | "BridgeAttendedTransfer" | "BridgeVideoSourceChanged" | "ChannelCreated" | "ChannelDestroyed" | "ChannelEnteredBridge" | "ChannelLeftBridge" | "ChannelStateChange" | "ChannelDtmfReceived" | "ChannelDialplan" | "ChannelCallerId" | "ChannelUserevent" | "ChannelHangupRequest" | "ChannelVarset" | "ChannelTalkingStarted" | "ChannelTalkingFinished" | "ChannelHold" | "ChannelUnhold" | "ContactStatusChange" | "EndpointStateChange" | "Dial" | "StasisEnd" | "StasisStart" | "TextMessageReceived" | "ChannelConnectedLine" | "PeerStatusChange";
|
|
3
|
+
export type WebSocketEvent = {
|
|
4
|
+
type: "ChannelVarset";
|
|
5
|
+
variable: string;
|
|
6
|
+
value: string;
|
|
7
|
+
channel?: Channel;
|
|
8
|
+
} | {
|
|
9
|
+
type: "StasisStart";
|
|
10
|
+
args: string[];
|
|
11
|
+
channel: Channel;
|
|
12
|
+
replace_channel?: Channel;
|
|
13
|
+
} | {
|
|
14
|
+
type: "PlaybackStarted";
|
|
15
|
+
playbackId: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: "PlaybackFinished";
|
|
18
|
+
playbackId: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: "BridgeCreated";
|
|
21
|
+
bridgeId: string;
|
|
22
|
+
bridgeType: string;
|
|
23
|
+
channels: Channel[];
|
|
24
|
+
} | {
|
|
25
|
+
type: "BridgeDestroyed";
|
|
26
|
+
bridgeId: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: "ChannelCreated";
|
|
29
|
+
channel: Channel;
|
|
30
|
+
} | {
|
|
31
|
+
type: "ChannelDestroyed";
|
|
32
|
+
channel: Channel;
|
|
33
|
+
} | {
|
|
34
|
+
type: "ApplicationMoveFailed";
|
|
35
|
+
application: string;
|
|
36
|
+
channel: Channel;
|
|
37
|
+
} | {
|
|
38
|
+
type: "RecordingStarted";
|
|
39
|
+
recordingId: string;
|
|
40
|
+
name: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: "RecordingFinished";
|
|
43
|
+
recordingId: string;
|
|
44
|
+
name: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: "RecordingFailed";
|
|
47
|
+
recordingId: string;
|
|
48
|
+
name: string;
|
|
49
|
+
reason: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "DeviceStateChanged";
|
|
52
|
+
device: string;
|
|
53
|
+
state: string;
|
|
54
|
+
} | {
|
|
55
|
+
type: string;
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=events.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/interfaces/events.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAC1B,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,uBAAuB,GACvB,qBAAqB,GACrB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,qBAAqB,GACrB,wBAAwB,GACxB,0BAA0B,GAC1B,gBAAgB,GAChB,kBAAkB,GAClB,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,GACrB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,GACtB,eAAe,GACf,uBAAuB,GACvB,wBAAwB,GACxB,aAAa,GACb,eAAe,GACf,qBAAqB,GACrB,qBAAqB,GACrB,MAAM,GACN,WAAW,GACX,aAAa,GACb,qBAAqB,GACrB,sBAAsB,GACtB,kBAAkB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MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC"}
|
|
@@ -5,4 +5,5 @@ export type { Playback } from "./playbacks.types.js";
|
|
|
5
5
|
export type { Application } from "./applications.types.js";
|
|
6
6
|
export type { Sound } from "./sounds.types.js";
|
|
7
7
|
export type { AsteriskInfo, Module, Logging, Variable } from "./asterisk.types";
|
|
8
|
+
export type { WebSocketEvent, WebSocketEventType } from "./events.types.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAChF,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
import type { BaseClient } from "../baseClient.js";
|
|
2
2
|
import type { Application, ApplicationDetails } from "../interfaces/applications.types.js";
|
|
3
|
+
export interface ApplicationMessage {
|
|
4
|
+
event: string;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
}
|
|
3
7
|
export declare class Applications {
|
|
4
8
|
private client;
|
|
5
9
|
constructor(client: BaseClient);
|
|
6
10
|
/**
|
|
7
11
|
* Lists all applications.
|
|
8
12
|
*
|
|
9
|
-
* @returns A promise that resolves to an array of Application objects
|
|
13
|
+
* @returns A promise that resolves to an array of Application objects.
|
|
10
14
|
* @throws {Error} If the API response is not an array.
|
|
11
15
|
*/
|
|
12
16
|
list(): Promise<Application[]>;
|
|
13
17
|
/**
|
|
14
18
|
* Retrieves details of a specific application.
|
|
15
19
|
*
|
|
16
|
-
* @param appName - The
|
|
17
|
-
* @returns A promise that resolves to an ApplicationDetails object
|
|
20
|
+
* @param appName - The name of the application to retrieve details for.
|
|
21
|
+
* @returns A promise that resolves to an ApplicationDetails object.
|
|
22
|
+
* @throws {Error} If there's an error fetching the application details.
|
|
18
23
|
*/
|
|
19
24
|
getDetails(appName: string): Promise<ApplicationDetails>;
|
|
20
25
|
/**
|
|
21
26
|
* Sends a message to a specific application.
|
|
22
27
|
*
|
|
23
|
-
* @param appName - The
|
|
24
|
-
* @param body - The message
|
|
25
|
-
* @returns A promise that resolves when the message is sent
|
|
28
|
+
* @param appName - The name of the application to send the message to.
|
|
29
|
+
* @param body - The message to be sent, containing an event and optional data.
|
|
30
|
+
* @returns A promise that resolves when the message is successfully sent.
|
|
26
31
|
*/
|
|
27
|
-
sendMessage(appName: string, body:
|
|
32
|
+
sendMessage(appName: string, body: ApplicationMessage): Promise<void>;
|
|
28
33
|
}
|
|
29
34
|
//# sourceMappingURL=applications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/resources/applications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,qCAAqC,CAAC;AAE7C,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAUpC
|
|
1
|
+
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/resources/applications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAUpC;;;;;;OAMG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAW9D;;;;;;OAMG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WebSocketEvent } from "./interfaces/events.types";
|
|
1
2
|
export declare class WebSocketClient {
|
|
2
3
|
private url;
|
|
3
4
|
private ws;
|
|
@@ -7,7 +8,9 @@ export declare class WebSocketClient {
|
|
|
7
8
|
connect(): Promise<void>;
|
|
8
9
|
reconnect(): Promise<void>;
|
|
9
10
|
isConnected(): boolean;
|
|
10
|
-
on(event:
|
|
11
|
+
on<T extends WebSocketEvent["type"]>(event: "message" | "open" | "error" | "close", callback: (data: Extract<WebSocketEvent, {
|
|
12
|
+
type: T;
|
|
13
|
+
}>) => void): void;
|
|
11
14
|
send(data: any): void;
|
|
12
15
|
close(): void;
|
|
13
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocketClient.d.ts","sourceRoot":"","sources":["../../../src/ari-client/websocketClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"websocketClient.d.ts","sourceRoot":"","sources":["../../../src/ari-client/websocketClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,qBAAa,eAAe;IAKd,OAAO,CAAC,GAAG;IAJvB,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAS;gBAEX,GAAG,EAAE,MAAM;IAEzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAyBxB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAehC,WAAW,IAAI,OAAO;IAItB,EAAE,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,EACjC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,EAC7C,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,KAAK,IAAI,GAC7D,IAAI;IAwBP,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAYrB,KAAK,IAAI,IAAI;CAOd"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { Endpoints } from "./ari-client/resources/endpoints.js";
|
|
|
4
4
|
export { Applications } from "./ari-client/resources/applications.js";
|
|
5
5
|
export { Sounds } from "./ari-client/resources/sounds.js";
|
|
6
6
|
export { Playbacks } from "./ari-client/resources/playbacks.js";
|
|
7
|
-
export
|
|
7
|
+
export { Asterisk } from "./ari-client/resources/asterisk.js";
|
|
8
|
+
export type { AriClientConfig, Channel, Endpoint, Playback, Application, Sound, AsteriskInfo, Module, Logging, Variable, WebSocketEvent, WebSocketEventType, } from "./ari-client/interfaces/index.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAG9D,YAAY,EACV,eAAe,EACf,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,KAAK,EACL,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,GACnB,MAAM,kCAAkC,CAAC"}
|