Icu 8190 ember data recording asciicast (#124)
* feat: 🎸 Add asciicast getter and adapter ✅ Closes: ICU-8190
This commit is contained in:
1 parent
d08ce29e5a
commit
39d43daf7a
1 file changed
+11
-3
@@ -28,17 +28,25 @@ export default class SessionRecordingModel extends GeneratedSessionRecordingMode
|
||||
return !TYPES_SESSION_RECORDING.includes(this.type);
|
||||
}
|
||||
|
||||
getAsciiCast({ connectionId, channelId, mimeType }) {
|
||||
/**
|
||||
* Download the recording for either session, connection, or channels.
|
||||
* id can be the session ID, session recording ID, connection recording ID,
|
||||
* or the channel recording ID.
|
||||
* @param {string} id
|
||||
* @param {string} mimeType
|
||||
* @returns {Promise}
|
||||
*/
|
||||
getAsciiCast(id) {
|
||||
const adapter = this.store.adapterFor('application');
|
||||
const options = { adapterOptions: { method: 'download' } };
|
||||
const url = adapter.buildURL(
|
||||
'session-recording',
|
||||
this.id,
|
||||
id,
|
||||
options,
|
||||
'findRecord'
|
||||
);
|
||||
return adapter.ajax(url, 'GET', {
|
||||
data: { connectionId, channelId, mimeType },
|
||||
data: { mimeType: 'application/x-asciicast' },
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user