@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/esm/index.js
CHANGED
|
@@ -1834,6 +1834,7 @@ var ChannelInstance = class {
|
|
|
1834
1834
|
listeners.forEach((listener) => {
|
|
1835
1835
|
this.eventEmitter.off(
|
|
1836
1836
|
event,
|
|
1837
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
1837
1838
|
listener
|
|
1838
1839
|
);
|
|
1839
1840
|
});
|
|
@@ -1898,7 +1899,10 @@ var ChannelInstance = class {
|
|
|
1898
1899
|
});
|
|
1899
1900
|
} catch (error) {
|
|
1900
1901
|
const message = getErrorMessage2(error);
|
|
1901
|
-
console.error(
|
|
1902
|
+
console.error(
|
|
1903
|
+
`Error continuing dialplan for channel ${this.id}:`,
|
|
1904
|
+
message
|
|
1905
|
+
);
|
|
1902
1906
|
throw new Error(`Failed to continue dialplan: ${message}`);
|
|
1903
1907
|
}
|
|
1904
1908
|
}
|
|
@@ -3669,6 +3673,137 @@ var WebSocketClient = class extends EventEmitter4 {
|
|
|
3669
3673
|
}
|
|
3670
3674
|
};
|
|
3671
3675
|
|
|
3676
|
+
// src/ari-client/resources/recordings.ts
|
|
3677
|
+
var Recordings = class {
|
|
3678
|
+
constructor(baseClient) {
|
|
3679
|
+
this.baseClient = baseClient;
|
|
3680
|
+
}
|
|
3681
|
+
/**
|
|
3682
|
+
* List recordings that are complete.
|
|
3683
|
+
* @returns Promise<StoredRecording[]>
|
|
3684
|
+
*/
|
|
3685
|
+
async listStored() {
|
|
3686
|
+
return this.baseClient.get("/recordings/stored");
|
|
3687
|
+
}
|
|
3688
|
+
/**
|
|
3689
|
+
* Get a stored recording's details.
|
|
3690
|
+
* @param params - The parameters for getting a stored recording
|
|
3691
|
+
* @returns Promise<StoredRecording>
|
|
3692
|
+
*/
|
|
3693
|
+
async getStored(params) {
|
|
3694
|
+
return this.baseClient.get(
|
|
3695
|
+
`/recordings/stored/${params.recordingName}`
|
|
3696
|
+
);
|
|
3697
|
+
}
|
|
3698
|
+
/**
|
|
3699
|
+
* Delete a stored recording.
|
|
3700
|
+
* @param params - The parameters for deleting a stored recording
|
|
3701
|
+
* @returns Promise<void>
|
|
3702
|
+
*/
|
|
3703
|
+
async deleteStored(params) {
|
|
3704
|
+
return this.baseClient.delete(
|
|
3705
|
+
`/recordings/stored/${params.recordingName}`
|
|
3706
|
+
);
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* Get the file associated with the stored recording.
|
|
3710
|
+
* @param params - The parameters for getting a stored recording file
|
|
3711
|
+
* @returns Promise<ArrayBuffer>
|
|
3712
|
+
*/
|
|
3713
|
+
async getStoredFile(params) {
|
|
3714
|
+
return this.baseClient.get(
|
|
3715
|
+
`/recordings/stored/${params.recordingName}/file`,
|
|
3716
|
+
{ responseType: "arraybuffer" }
|
|
3717
|
+
);
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* Copy a stored recording.
|
|
3721
|
+
* @param params - The parameters for copying a stored recording
|
|
3722
|
+
* @returns Promise<StoredRecording>
|
|
3723
|
+
*/
|
|
3724
|
+
async copyStored(params) {
|
|
3725
|
+
return this.baseClient.post(
|
|
3726
|
+
`/recordings/stored/${params.recordingName}/copy`,
|
|
3727
|
+
void 0,
|
|
3728
|
+
{
|
|
3729
|
+
params: {
|
|
3730
|
+
destinationRecordingName: params.destinationRecordingName
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
);
|
|
3734
|
+
}
|
|
3735
|
+
/**
|
|
3736
|
+
* List live recordings.
|
|
3737
|
+
* @param params - The parameters for getting a live recording
|
|
3738
|
+
* @returns Promise<LiveRecording>
|
|
3739
|
+
*/
|
|
3740
|
+
async getLive(params) {
|
|
3741
|
+
return this.baseClient.get(
|
|
3742
|
+
`/recordings/live/${params.recordingName}`
|
|
3743
|
+
);
|
|
3744
|
+
}
|
|
3745
|
+
/**
|
|
3746
|
+
* Stop a live recording and discard it.
|
|
3747
|
+
* @param params - The parameters for canceling a recording
|
|
3748
|
+
* @returns Promise<void>
|
|
3749
|
+
*/
|
|
3750
|
+
async cancel(params) {
|
|
3751
|
+
return this.baseClient.delete(
|
|
3752
|
+
`/recordings/live/${params.recordingName}`
|
|
3753
|
+
);
|
|
3754
|
+
}
|
|
3755
|
+
/**
|
|
3756
|
+
* Stop a live recording and store it.
|
|
3757
|
+
* @param params - The parameters for stopping a recording
|
|
3758
|
+
* @returns Promise<void>
|
|
3759
|
+
*/
|
|
3760
|
+
async stop(params) {
|
|
3761
|
+
return this.baseClient.post(
|
|
3762
|
+
`/recordings/live/${params.recordingName}/stop`
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Pause a live recording.
|
|
3767
|
+
* @param params - The parameters for pausing a recording
|
|
3768
|
+
* @returns Promise<void>
|
|
3769
|
+
*/
|
|
3770
|
+
async pause(params) {
|
|
3771
|
+
return this.baseClient.post(
|
|
3772
|
+
`/recordings/live/${params.recordingName}/pause`
|
|
3773
|
+
);
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* Unpause a live recording.
|
|
3777
|
+
* @param params - The parameters for unpausing a recording
|
|
3778
|
+
* @returns Promise<void>
|
|
3779
|
+
*/
|
|
3780
|
+
async unpause(params) {
|
|
3781
|
+
return this.baseClient.delete(
|
|
3782
|
+
`/recordings/live/${params.recordingName}/pause`
|
|
3783
|
+
);
|
|
3784
|
+
}
|
|
3785
|
+
/**
|
|
3786
|
+
* Mute a live recording.
|
|
3787
|
+
* @param params - The parameters for muting a recording
|
|
3788
|
+
* @returns Promise<void>
|
|
3789
|
+
*/
|
|
3790
|
+
async mute(params) {
|
|
3791
|
+
return this.baseClient.post(
|
|
3792
|
+
`/recordings/live/${params.recordingName}/mute`
|
|
3793
|
+
);
|
|
3794
|
+
}
|
|
3795
|
+
/**
|
|
3796
|
+
* Unmute a live recording.
|
|
3797
|
+
* @param params - The parameters for unmuting a recording
|
|
3798
|
+
* @returns Promise<void>
|
|
3799
|
+
*/
|
|
3800
|
+
async unmute(params) {
|
|
3801
|
+
return this.baseClient.delete(
|
|
3802
|
+
`/recordings/live/${params.recordingName}/mute`
|
|
3803
|
+
);
|
|
3804
|
+
}
|
|
3805
|
+
};
|
|
3806
|
+
|
|
3672
3807
|
// src/ari-client/ariClient.ts
|
|
3673
3808
|
var AriClient = class {
|
|
3674
3809
|
/**
|
|
@@ -3693,6 +3828,7 @@ var AriClient = class {
|
|
|
3693
3828
|
this.applications = new Applications(this.baseClient);
|
|
3694
3829
|
this.sounds = new Sounds(this.baseClient);
|
|
3695
3830
|
this.asterisk = new Asterisk(this.baseClient);
|
|
3831
|
+
this.recordings = new Recordings(this.baseClient);
|
|
3696
3832
|
console.log(`ARI Client initialized with base URL: ${baseUrl}`);
|
|
3697
3833
|
}
|
|
3698
3834
|
baseClient;
|
|
@@ -3705,6 +3841,7 @@ var AriClient = class {
|
|
|
3705
3841
|
sounds;
|
|
3706
3842
|
asterisk;
|
|
3707
3843
|
bridges;
|
|
3844
|
+
recordings;
|
|
3708
3845
|
async cleanup() {
|
|
3709
3846
|
try {
|
|
3710
3847
|
console.log("Starting ARI Client cleanup...");
|
|
@@ -3816,6 +3953,7 @@ var AriClient = class {
|
|
|
3816
3953
|
this.applications = null;
|
|
3817
3954
|
this.sounds = null;
|
|
3818
3955
|
this.asterisk = null;
|
|
3956
|
+
this.recordings = null;
|
|
3819
3957
|
console.log("ARI Client destroyed successfully");
|
|
3820
3958
|
} catch (error) {
|
|
3821
3959
|
console.error("Error destroying ARI Client:", error);
|