@ipcom/asterisk-ari 0.0.160 → 0.0.162
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 +139 -1
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/esm/index.js +139 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/types/ari-client/ariClient.d.ts +14 -12
- package/dist/types/ari-client/ariClient.d.ts.map +1 -1
- package/dist/types/ari-client/baseClient.d.ts +1 -1
- package/dist/types/ari-client/interfaces/applications.types.d.ts +2 -2
- package/dist/types/ari-client/interfaces/bridges.types.d.ts +5 -5
- package/dist/types/ari-client/interfaces/channels.types.d.ts +4 -4
- package/dist/types/ari-client/interfaces/events.types.d.ts +51 -42
- package/dist/types/ari-client/interfaces/events.types.d.ts.map +1 -1
- package/dist/types/ari-client/interfaces/index.d.ts +10 -9
- package/dist/types/ari-client/interfaces/index.d.ts.map +1 -1
- package/dist/types/ari-client/interfaces/playbacks.types.d.ts +2 -2
- package/dist/types/ari-client/interfaces/recordings.types.d.ts +50 -0
- package/dist/types/ari-client/interfaces/recordings.types.d.ts.map +1 -0
- package/dist/types/ari-client/interfaces/websocket.types.d.ts +2 -2
- package/dist/types/ari-client/resources/applications.d.ts +2 -2
- package/dist/types/ari-client/resources/asterisk.d.ts +4 -4
- package/dist/types/ari-client/resources/baseResource.d.ts +1 -1
- package/dist/types/ari-client/resources/baseResource.d.ts.map +1 -1
- package/dist/types/ari-client/resources/bridges.d.ts +6 -6
- package/dist/types/ari-client/resources/channels.d.ts +11 -11
- package/dist/types/ari-client/resources/channels.d.ts.map +1 -1
- package/dist/types/ari-client/resources/endpoints.d.ts +2 -2
- package/dist/types/ari-client/resources/playbacks.d.ts +8 -8
- package/dist/types/ari-client/resources/playbacks.d.ts.map +1 -1
- package/dist/types/ari-client/resources/recordings.d.ts +77 -0
- package/dist/types/ari-client/resources/recordings.d.ts.map +1 -1
- package/dist/types/ari-client/resources/sounds.d.ts +2 -2
- package/dist/types/ari-client/utils.d.ts +1 -1
- package/dist/types/ari-client/websocketClient.d.ts +4 -4
- package/dist/types/index.d.ts +17 -17
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +19 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -1855,6 +1855,7 @@ var ChannelInstance = class {
|
|
|
1855
1855
|
listeners.forEach((listener) => {
|
|
1856
1856
|
this.eventEmitter.off(
|
|
1857
1857
|
event,
|
|
1858
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
1858
1859
|
listener
|
|
1859
1860
|
);
|
|
1860
1861
|
});
|
|
@@ -1919,7 +1920,10 @@ var ChannelInstance = class {
|
|
|
1919
1920
|
});
|
|
1920
1921
|
} catch (error) {
|
|
1921
1922
|
const message = getErrorMessage2(error);
|
|
1922
|
-
console.error(
|
|
1923
|
+
console.error(
|
|
1924
|
+
`Error continuing dialplan for channel ${this.id}:`,
|
|
1925
|
+
message
|
|
1926
|
+
);
|
|
1923
1927
|
throw new Error(`Failed to continue dialplan: ${message}`);
|
|
1924
1928
|
}
|
|
1925
1929
|
}
|
|
@@ -3690,6 +3694,137 @@ var WebSocketClient = class extends import_events4.EventEmitter {
|
|
|
3690
3694
|
}
|
|
3691
3695
|
};
|
|
3692
3696
|
|
|
3697
|
+
// src/ari-client/resources/recordings.ts
|
|
3698
|
+
var Recordings = class {
|
|
3699
|
+
constructor(baseClient) {
|
|
3700
|
+
this.baseClient = baseClient;
|
|
3701
|
+
}
|
|
3702
|
+
/**
|
|
3703
|
+
* List recordings that are complete.
|
|
3704
|
+
* @returns Promise<StoredRecording[]>
|
|
3705
|
+
*/
|
|
3706
|
+
async listStored() {
|
|
3707
|
+
return this.baseClient.get("/recordings/stored");
|
|
3708
|
+
}
|
|
3709
|
+
/**
|
|
3710
|
+
* Get a stored recording's details.
|
|
3711
|
+
* @param params - The parameters for getting a stored recording
|
|
3712
|
+
* @returns Promise<StoredRecording>
|
|
3713
|
+
*/
|
|
3714
|
+
async getStored(params) {
|
|
3715
|
+
return this.baseClient.get(
|
|
3716
|
+
`/recordings/stored/${params.recordingName}`
|
|
3717
|
+
);
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* Delete a stored recording.
|
|
3721
|
+
* @param params - The parameters for deleting a stored recording
|
|
3722
|
+
* @returns Promise<void>
|
|
3723
|
+
*/
|
|
3724
|
+
async deleteStored(params) {
|
|
3725
|
+
return this.baseClient.delete(
|
|
3726
|
+
`/recordings/stored/${params.recordingName}`
|
|
3727
|
+
);
|
|
3728
|
+
}
|
|
3729
|
+
/**
|
|
3730
|
+
* Get the file associated with the stored recording.
|
|
3731
|
+
* @param params - The parameters for getting a stored recording file
|
|
3732
|
+
* @returns Promise<ArrayBuffer>
|
|
3733
|
+
*/
|
|
3734
|
+
async getStoredFile(params) {
|
|
3735
|
+
return this.baseClient.get(
|
|
3736
|
+
`/recordings/stored/${params.recordingName}/file`,
|
|
3737
|
+
{ responseType: "arraybuffer" }
|
|
3738
|
+
);
|
|
3739
|
+
}
|
|
3740
|
+
/**
|
|
3741
|
+
* Copy a stored recording.
|
|
3742
|
+
* @param params - The parameters for copying a stored recording
|
|
3743
|
+
* @returns Promise<StoredRecording>
|
|
3744
|
+
*/
|
|
3745
|
+
async copyStored(params) {
|
|
3746
|
+
return this.baseClient.post(
|
|
3747
|
+
`/recordings/stored/${params.recordingName}/copy`,
|
|
3748
|
+
void 0,
|
|
3749
|
+
{
|
|
3750
|
+
params: {
|
|
3751
|
+
destinationRecordingName: params.destinationRecordingName
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
);
|
|
3755
|
+
}
|
|
3756
|
+
/**
|
|
3757
|
+
* List live recordings.
|
|
3758
|
+
* @param params - The parameters for getting a live recording
|
|
3759
|
+
* @returns Promise<LiveRecording>
|
|
3760
|
+
*/
|
|
3761
|
+
async getLive(params) {
|
|
3762
|
+
return this.baseClient.get(
|
|
3763
|
+
`/recordings/live/${params.recordingName}`
|
|
3764
|
+
);
|
|
3765
|
+
}
|
|
3766
|
+
/**
|
|
3767
|
+
* Stop a live recording and discard it.
|
|
3768
|
+
* @param params - The parameters for canceling a recording
|
|
3769
|
+
* @returns Promise<void>
|
|
3770
|
+
*/
|
|
3771
|
+
async cancel(params) {
|
|
3772
|
+
return this.baseClient.delete(
|
|
3773
|
+
`/recordings/live/${params.recordingName}`
|
|
3774
|
+
);
|
|
3775
|
+
}
|
|
3776
|
+
/**
|
|
3777
|
+
* Stop a live recording and store it.
|
|
3778
|
+
* @param params - The parameters for stopping a recording
|
|
3779
|
+
* @returns Promise<void>
|
|
3780
|
+
*/
|
|
3781
|
+
async stop(params) {
|
|
3782
|
+
return this.baseClient.post(
|
|
3783
|
+
`/recordings/live/${params.recordingName}/stop`
|
|
3784
|
+
);
|
|
3785
|
+
}
|
|
3786
|
+
/**
|
|
3787
|
+
* Pause a live recording.
|
|
3788
|
+
* @param params - The parameters for pausing a recording
|
|
3789
|
+
* @returns Promise<void>
|
|
3790
|
+
*/
|
|
3791
|
+
async pause(params) {
|
|
3792
|
+
return this.baseClient.post(
|
|
3793
|
+
`/recordings/live/${params.recordingName}/pause`
|
|
3794
|
+
);
|
|
3795
|
+
}
|
|
3796
|
+
/**
|
|
3797
|
+
* Unpause a live recording.
|
|
3798
|
+
* @param params - The parameters for unpausing a recording
|
|
3799
|
+
* @returns Promise<void>
|
|
3800
|
+
*/
|
|
3801
|
+
async unpause(params) {
|
|
3802
|
+
return this.baseClient.delete(
|
|
3803
|
+
`/recordings/live/${params.recordingName}/pause`
|
|
3804
|
+
);
|
|
3805
|
+
}
|
|
3806
|
+
/**
|
|
3807
|
+
* Mute a live recording.
|
|
3808
|
+
* @param params - The parameters for muting a recording
|
|
3809
|
+
* @returns Promise<void>
|
|
3810
|
+
*/
|
|
3811
|
+
async mute(params) {
|
|
3812
|
+
return this.baseClient.post(
|
|
3813
|
+
`/recordings/live/${params.recordingName}/mute`
|
|
3814
|
+
);
|
|
3815
|
+
}
|
|
3816
|
+
/**
|
|
3817
|
+
* Unmute a live recording.
|
|
3818
|
+
* @param params - The parameters for unmuting a recording
|
|
3819
|
+
* @returns Promise<void>
|
|
3820
|
+
*/
|
|
3821
|
+
async unmute(params) {
|
|
3822
|
+
return this.baseClient.delete(
|
|
3823
|
+
`/recordings/live/${params.recordingName}/mute`
|
|
3824
|
+
);
|
|
3825
|
+
}
|
|
3826
|
+
};
|
|
3827
|
+
|
|
3693
3828
|
// src/ari-client/ariClient.ts
|
|
3694
3829
|
var AriClient = class {
|
|
3695
3830
|
/**
|
|
@@ -3714,6 +3849,7 @@ var AriClient = class {
|
|
|
3714
3849
|
this.applications = new Applications(this.baseClient);
|
|
3715
3850
|
this.sounds = new Sounds(this.baseClient);
|
|
3716
3851
|
this.asterisk = new Asterisk(this.baseClient);
|
|
3852
|
+
this.recordings = new Recordings(this.baseClient);
|
|
3717
3853
|
console.log(`ARI Client initialized with base URL: ${baseUrl}`);
|
|
3718
3854
|
}
|
|
3719
3855
|
baseClient;
|
|
@@ -3726,6 +3862,7 @@ var AriClient = class {
|
|
|
3726
3862
|
sounds;
|
|
3727
3863
|
asterisk;
|
|
3728
3864
|
bridges;
|
|
3865
|
+
recordings;
|
|
3729
3866
|
async cleanup() {
|
|
3730
3867
|
try {
|
|
3731
3868
|
console.log("Starting ARI Client cleanup...");
|
|
@@ -3837,6 +3974,7 @@ var AriClient = class {
|
|
|
3837
3974
|
this.applications = null;
|
|
3838
3975
|
this.sounds = null;
|
|
3839
3976
|
this.asterisk = null;
|
|
3977
|
+
this.recordings = null;
|
|
3840
3978
|
console.log("ARI Client destroyed successfully");
|
|
3841
3979
|
} catch (error) {
|
|
3842
3980
|
console.error("Error destroying ARI Client:", error);
|