**What** One problem with local development can be the dependencies management. To mitigate that, transform checks from an instance of to value check as well as harmonize utils function to be part of the class as a static method instead of separate utilities. By using this approach we are not dependent of the origin of the class and therefore it should ease the user experience. **NOTE** As a next step to discuss, we should probably move the interfaces from the interfaces/medusa package to the utils package. Then we can deprecate the interfaces package and remove it at a later time
29 lines
553 B
JavaScript
29 lines
553 B
JavaScript
import BaseService from "./base-service"
|
|
|
|
/**
|
|
* Interface for file connectors
|
|
* @interface
|
|
* @deprecated use AbstractFileService from @medusajs/medusa instead
|
|
*/
|
|
class BaseFileService extends BaseService {
|
|
static _isFileService = true
|
|
|
|
static isFileService(obj) {
|
|
return obj?.constructor?._isFileService
|
|
}
|
|
|
|
constructor() {
|
|
super()
|
|
}
|
|
|
|
upload() {
|
|
throw Error("upload must be overridden by the child class")
|
|
}
|
|
|
|
delete() {
|
|
throw Error("delete must be overridden by the child class")
|
|
}
|
|
}
|
|
|
|
export default BaseFileService
|