@ipcom/asterisk-ari 0.0.18 → 0.0.20
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 +313 -49
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/esm/index.js +313 -49
- package/dist/esm/index.js.map +4 -4
- package/dist/types/ari-client/ariClient.d.ts +202 -29
- 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/asterisk.types.d.ts +39 -0
- package/dist/types/ari-client/interfaces/asterisk.types.d.ts.map +1 -0
- 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/resources/asterisk.d.ts +37 -0
- package/dist/types/ari-client/resources/asterisk.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 +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Application, ApplicationDetails } from "./interfaces/applications.types";
|
|
2
|
+
import type { AsteriskInfo, Logging, Module, Variable } from "./interfaces/asterisk.types";
|
|
2
3
|
import type { Channel, ChannelPlayback, ChannelVar, ExternalMediaOptions, OriginateRequest, PlaybackOptions, RTPStats, RecordingOptions, SnoopOptions } from "./interfaces/channels.types";
|
|
3
4
|
import type { Endpoint, EndpointDetails } from "./interfaces/endpoints.types.js";
|
|
5
|
+
import type { WebSocketEvent, WebSocketEventType } from "./interfaces/events.types";
|
|
4
6
|
import type { Playback as APIPlayback, PlaybackControlRequest } from "./interfaces/playbacks.types";
|
|
5
7
|
import type { AriClientConfig } from "./interfaces/requests.js";
|
|
6
8
|
import type { Sound, SoundListRequest } from "./interfaces/sounds.types";
|
|
7
9
|
import { Applications } from "./resources/applications.js";
|
|
10
|
+
import { Asterisk } from "./resources/asterisk";
|
|
8
11
|
import { Channels } from "./resources/channels.js";
|
|
9
12
|
import { Endpoints } from "./resources/endpoints";
|
|
10
13
|
import { Playbacks } from "./resources/playbacks";
|
|
@@ -19,6 +22,7 @@ export declare class AriClient {
|
|
|
19
22
|
applications: Applications;
|
|
20
23
|
playbacks: Playbacks;
|
|
21
24
|
sounds: Sounds;
|
|
25
|
+
asterisk: Asterisk;
|
|
22
26
|
constructor(config: AriClientConfig);
|
|
23
27
|
/**
|
|
24
28
|
* Connects to the ARI WebSocket for a specific application.
|
|
@@ -26,7 +30,7 @@ export declare class AriClient {
|
|
|
26
30
|
* @param app - The application name to connect to.
|
|
27
31
|
* @returns {Promise<void>} Resolves when the WebSocket connects successfully.
|
|
28
32
|
*/
|
|
29
|
-
connectWebSocket(app: string): Promise<void>;
|
|
33
|
+
connectWebSocket(app: string, subscribedEvents?: WebSocketEventType[]): Promise<void>;
|
|
30
34
|
/**
|
|
31
35
|
* Ensures the ARI application is registered.
|
|
32
36
|
*
|
|
@@ -41,12 +45,16 @@ export declare class AriClient {
|
|
|
41
45
|
*/
|
|
42
46
|
isWebSocketConnected(): boolean;
|
|
43
47
|
/**
|
|
44
|
-
* 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.
|
|
45
51
|
*
|
|
46
|
-
* @param
|
|
47
|
-
*
|
|
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}
|
|
48
56
|
*/
|
|
49
|
-
onWebSocketEvent(
|
|
57
|
+
onWebSocketEvent(callback: (data: WebSocketEvent) => void): void;
|
|
50
58
|
/**
|
|
51
59
|
* Closes the WebSocket connection.
|
|
52
60
|
*/
|
|
@@ -137,7 +145,14 @@ export declare class AriClient {
|
|
|
137
145
|
*/
|
|
138
146
|
snoopChannelWithId(channelId: string, snoopId: string, options: SnoopOptions): Promise<Channel>;
|
|
139
147
|
/**
|
|
140
|
-
*
|
|
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.
|
|
141
156
|
*/
|
|
142
157
|
dialChannel(channelId: string, caller?: string, timeout?: number): Promise<void>;
|
|
143
158
|
/**
|
|
@@ -161,11 +176,34 @@ export declare class AriClient {
|
|
|
161
176
|
*/
|
|
162
177
|
ringChannel(channelId: string): Promise<void>;
|
|
163
178
|
/**
|
|
164
|
-
* 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.
|
|
165
191
|
*/
|
|
166
192
|
stopRingChannel(channelId: string): Promise<void>;
|
|
167
193
|
/**
|
|
168
|
-
* 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.
|
|
169
207
|
*/
|
|
170
208
|
sendDTMF(channelId: string, dtmf: string, options?: {
|
|
171
209
|
before?: number;
|
|
@@ -174,27 +212,97 @@ export declare class AriClient {
|
|
|
174
212
|
after?: number;
|
|
175
213
|
}): Promise<void>;
|
|
176
214
|
/**
|
|
177
|
-
* 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.
|
|
178
230
|
*/
|
|
179
231
|
muteChannel(channelId: string, direction?: "both" | "in" | "out"): Promise<void>;
|
|
180
232
|
/**
|
|
181
|
-
* 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.
|
|
182
248
|
*/
|
|
183
249
|
unmuteChannel(channelId: string, direction?: "both" | "in" | "out"): Promise<void>;
|
|
184
250
|
/**
|
|
185
|
-
* 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.
|
|
186
263
|
*/
|
|
187
264
|
holdChannel(channelId: string): Promise<void>;
|
|
188
265
|
/**
|
|
189
|
-
* 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.
|
|
190
278
|
*/
|
|
191
279
|
unholdChannel(channelId: string): Promise<void>;
|
|
192
280
|
/**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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.
|
|
283
|
+
*
|
|
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.
|
|
305
|
+
*/
|
|
198
306
|
createChannel(data: OriginateRequest): Promise<Channel>;
|
|
199
307
|
/**
|
|
200
308
|
* Hangs up a specific channel.
|
|
@@ -269,33 +377,98 @@ export declare class AriClient {
|
|
|
269
377
|
*/
|
|
270
378
|
getPlaybackDetails(playbackId: string): Promise<APIPlayback>;
|
|
271
379
|
/**
|
|
272
|
-
* Controls a specific playback.
|
|
380
|
+
* Controls a specific playback in the Asterisk server.
|
|
273
381
|
*
|
|
274
|
-
* @param playbackId - The unique identifier of the playback.
|
|
275
|
-
* @param controlRequest -
|
|
276
|
-
* @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.
|
|
277
385
|
*/
|
|
278
386
|
controlPlayback(playbackId: string, controlRequest: PlaybackControlRequest): Promise<void>;
|
|
279
387
|
/**
|
|
280
|
-
* Stops a specific playback.
|
|
388
|
+
* Stops a specific playback in the Asterisk server.
|
|
281
389
|
*
|
|
282
|
-
* @param playbackId - The unique identifier of the playback.
|
|
283
|
-
* @returns
|
|
390
|
+
* @param playbackId - The unique identifier of the playback to stop.
|
|
391
|
+
* @returns A Promise that resolves when the playback is successfully stopped.
|
|
284
392
|
*/
|
|
285
393
|
stopPlayback(playbackId: string): Promise<void>;
|
|
286
394
|
/**
|
|
287
|
-
*
|
|
395
|
+
* Retrieves a list of all available sounds in the Asterisk server.
|
|
288
396
|
*
|
|
289
397
|
* @param params - Optional parameters to filter the list of sounds.
|
|
290
|
-
* @returns
|
|
398
|
+
* @returns A Promise that resolves to an array of Sound objects representing the available sounds.
|
|
291
399
|
*/
|
|
292
400
|
listSounds(params?: SoundListRequest): Promise<Sound[]>;
|
|
293
401
|
/**
|
|
294
|
-
* Retrieves
|
|
402
|
+
* Retrieves detailed information about a specific sound in the Asterisk server.
|
|
295
403
|
*
|
|
296
|
-
* @param soundId - The unique identifier of the sound.
|
|
297
|
-
* @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.
|
|
298
406
|
*/
|
|
299
407
|
getSoundDetails(soundId: string): Promise<Sound>;
|
|
408
|
+
/**
|
|
409
|
+
* Retrieves general information about the Asterisk server.
|
|
410
|
+
*
|
|
411
|
+
* @returns A Promise that resolves to an AsteriskInfo object containing server information.
|
|
412
|
+
*/
|
|
413
|
+
getAsteriskInfo(): Promise<AsteriskInfo>;
|
|
414
|
+
/**
|
|
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.
|
|
418
|
+
*/
|
|
419
|
+
listModules(): Promise<Module[]>;
|
|
420
|
+
/**
|
|
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.
|
|
426
|
+
*/
|
|
427
|
+
manageModule(moduleName: string, action: "load" | "unload" | "reload"): Promise<void>;
|
|
428
|
+
/**
|
|
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.
|
|
432
|
+
*/
|
|
433
|
+
listLoggingChannels(): Promise<Logging[]>;
|
|
434
|
+
/**
|
|
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.
|
|
443
|
+
*/
|
|
444
|
+
manageLogChannel(logChannelName: string, action: "add" | "remove", configuration?: {
|
|
445
|
+
type?: string;
|
|
446
|
+
configuration?: string;
|
|
447
|
+
}): Promise<void>;
|
|
448
|
+
/**
|
|
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.
|
|
453
|
+
*/
|
|
454
|
+
getGlobalVariable(variableName: string): Promise<Variable>;
|
|
455
|
+
/**
|
|
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.
|
|
471
|
+
*/
|
|
472
|
+
setGlobalVariable(variableName: string, value: string): Promise<void>;
|
|
300
473
|
}
|
|
301
474
|
//# sourceMappingURL=ariClient.d.ts.map
|
|
@@ -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,OAAO,EACP,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,QAAQ,IAAI,WAAW,EACvB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,qBAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"ariClient.d.ts","sourceRoot":"","sources":["../../../src/ari-client/ariClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EACn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M,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,39 @@
|
|
|
1
|
+
export interface AsteriskInfo {
|
|
2
|
+
build: {
|
|
3
|
+
os: string;
|
|
4
|
+
kernel: string;
|
|
5
|
+
machine: string;
|
|
6
|
+
options: string[];
|
|
7
|
+
modules: string[];
|
|
8
|
+
};
|
|
9
|
+
system: {
|
|
10
|
+
entity_id: string;
|
|
11
|
+
version: string;
|
|
12
|
+
uptime: {
|
|
13
|
+
startup_time: string;
|
|
14
|
+
last_reload_time: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
config: {
|
|
18
|
+
name: string;
|
|
19
|
+
default_language: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface Module {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
support_level: string;
|
|
26
|
+
use_count: number;
|
|
27
|
+
status: string;
|
|
28
|
+
}
|
|
29
|
+
export interface Logging {
|
|
30
|
+
channel: string;
|
|
31
|
+
type: string;
|
|
32
|
+
configuration: string;
|
|
33
|
+
status: string;
|
|
34
|
+
}
|
|
35
|
+
export interface Variable {
|
|
36
|
+
name: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=asterisk.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asterisk.types.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/interfaces/asterisk.types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE;YACN,YAAY,EAAE,MAAM,CAAC;YACrB,gBAAgB,EAAE,MAAM,CAAC;SAC1B,CAAC;KACH,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAGD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -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,k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IACvB,OAAO,EAAE,OAAO,CAAC;CAClB,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB,GACD;IACE,IAAI,EAAE,uBAAuB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,mBAAmB,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,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"}
|
|
@@ -4,4 +4,5 @@ export type { Endpoint } from "./endpoints.types.js";
|
|
|
4
4
|
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
|
+
export type { AsteriskInfo, Module, Logging, Variable } from "./asterisk.types";
|
|
7
8
|
//# 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"}
|
|
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,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 +1,38 @@
|
|
|
1
|
+
import type { BaseClient } from "../baseClient.js";
|
|
2
|
+
import type { AsteriskInfo, Logging, Module, Variable } from "../interfaces/asterisk.types.js";
|
|
3
|
+
export declare class Asterisk {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: BaseClient);
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves information about the Asterisk server.
|
|
8
|
+
*/
|
|
9
|
+
getInfo(): Promise<AsteriskInfo>;
|
|
10
|
+
/**
|
|
11
|
+
* Lists all loaded modules in the Asterisk server.
|
|
12
|
+
*/
|
|
13
|
+
listModules(): Promise<Module[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Manages a specific module in the Asterisk server.
|
|
16
|
+
*/
|
|
17
|
+
manageModule(moduleName: string, action: "load" | "unload" | "reload"): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves all configured logging channels.
|
|
20
|
+
*/
|
|
21
|
+
listLoggingChannels(): Promise<Logging[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Adds or removes a log channel in the Asterisk server.
|
|
24
|
+
*/
|
|
25
|
+
manageLogChannel(logChannelName: string, action: "add" | "remove", configuration?: {
|
|
26
|
+
type?: string;
|
|
27
|
+
configuration?: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the value of a global variable.
|
|
31
|
+
*/
|
|
32
|
+
getGlobalVariable(variableName: string): Promise<Variable>;
|
|
33
|
+
/**
|
|
34
|
+
* Sets a global variable.
|
|
35
|
+
*/
|
|
36
|
+
setGlobalVariable(variableName: string, value: string): Promise<void>;
|
|
37
|
+
}
|
|
1
38
|
//# sourceMappingURL=asterisk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asterisk.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/resources/asterisk.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"asterisk.d.ts","sourceRoot":"","sources":["../../../../src/ari-client/resources/asterisk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,iCAAiC,CAAC;AAUzC,qBAAa,QAAQ;IACP,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC;IAItC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAItC;;OAEG;IACG,YAAY,CAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GACnC,OAAO,CAAC,IAAI,CAAC;IAMhB;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAI/C;;OAEG;IACG,gBAAgB,CACpB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,KAAK,GAAG,QAAQ,EACxB,aAAa,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACxD,OAAO,CAAC,IAAI,CAAC;IAOhB;;OAEG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMhE;;OAEG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAK5E"}
|
|
@@ -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,5 @@ 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 type { AriClientConfig, Channel, Endpoint, Playback, Application, Sound, } from "./ari-client/interfaces/index.js";
|
|
7
|
+
export type { AriClientConfig, Channel, Endpoint, Playback, Application, Sound, AsteriskInfo, Module, Logging, Variable, } from "./ari-client/interfaces/index.js";
|
|
8
8
|
//# 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;AAGhE,YAAY,EACV,eAAe,EACf,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,KAAK,
|
|
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;AAGhE,YAAY,EACV,eAAe,EACf,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,KAAK,EACL,YAAY,EACZ,MAAM,EACN,OAAO,EACP,QAAQ,GACT,MAAM,kCAAkC,CAAC"}
|