Icu 8190 ember data recording asciicast (#124)

* feat: 🎸 Add asciicast getter and adapter

✅ Closes: ICU-8190
This commit is contained in:
Zhihe Li authored and GitHub committed 2023-03-16 15:25:16 -04:00
1 parent d08ce29e5a
commit 39d43daf7a
1 file changed
+11 -3
+11 -3
View File
@@ -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' },
});
}
}