const { NotImplementedError } = require('./Errors') module.exports = class AbstractPersistor { /** * @param location * @param target * @param {string} source * @return {Promise} */ async sendFile(location, target, source) { throw new NotImplementedError('method not implemented in persistor', { method: 'sendFile', location, target, source, }) } /** * @param location * @param target * @param {NodeJS.ReadableStream} sourceStream * @param {Object} opts * @return {Promise} */ async sendStream(location, target, sourceStream, opts = {}) { throw new NotImplementedError('method not implemented in persistor', { method: 'sendStream', location, target, opts, }) } /** * @param location * @param name * @param {Object} [opts] * @param {Number} [opts.start] * @param {Number} [opts.end] * @return {Promise} */ async getObjectStream(location, name, opts = {}) { throw new NotImplementedError('method not implemented in persistor', { method: 'getObjectStream', location, name, opts, }) } /** * @param {string} location * @param {string} name * @return {Promise} */ async getRedirectUrl(location, name) { throw new NotImplementedError('method not implemented in persistor', { method: 'getRedirectUrl', location, name, }) } /** * @param {string} location * @param {string} name * @param {Object} opts * @return {Promise} */ async getObjectSize(location, name, opts) { throw new NotImplementedError('method not implemented in persistor', { method: 'getObjectSize', location, name, }) } /** * @param {string} location * @param {string} name * @param {Object} opts * @return {Promise} */ async getObjectMd5Hash(location, name, opts) { throw new NotImplementedError('method not implemented in persistor', { method: 'getObjectMd5Hash', location, name, }) } /** * @param {string} location * @param {string} fromName * @param {string} toName * @param {Object} opts * @return {Promise} */ async copyObject(location, fromName, toName, opts) { throw new NotImplementedError('method not implemented in persistor', { method: 'copyObject', location, fromName, toName, }) } /** * @param {string} location * @param {string} name * @return {Promise} */ async deleteObject(location, name) { throw new NotImplementedError('method not implemented in persistor', { method: 'deleteObject', location, name, }) } /** * @param {string} location * @param {string} name * @param {string} [continuationToken] * @return {Promise} */ async deleteDirectory(location, name, continuationToken) { throw new NotImplementedError('method not implemented in persistor', { method: 'deleteDirectory', location, name, }) } /** * @param {string} location * @param {string} name * @param {Object} opts * @return {Promise} */ async checkIfObjectExists(location, name, opts) { throw new NotImplementedError('method not implemented in persistor', { method: 'checkIfObjectExists', location, name, }) } /** * @param {string} location * @param {string} name * @param {string} [continuationToken] * @return {Promise} */ async directorySize(location, name, continuationToken) { throw new NotImplementedError('method not implemented in persistor', { method: 'directorySize', location, name, }) } }