Files
Daniel Salazar 99d96edd9c feat: s3 fs in oss (#2761)
* feat: s3 fs in oss

* feat: new endpoints in OSS

* fix: name of fs extension

* perf: signed uploads

* fix: await socket events to align fs events

* fix: default bucket names

* fix: backend tests

* fix: deps

* fix: order
2026-04-02 11:20:59 -07:00

32 lines
757 B
JavaScript

import { TeePromise } from 'teepromise';
export default class BaseOperation {
static STATUS_PENDING = {};
static STATUS_RUNNING = {};
static STATUS_DONE = {};
/** @type {PromiseLike<void> & { resolve: () => void }} */
#donePromise;
constructor () {
this.status_ = this.constructor.STATUS_PENDING;
this.#donePromise = new TeePromise();
}
get status () {
return this.status_;
}
set status (status) {
this.status_ = status;
if ( status === this.constructor.STATUS_DONE ) {
this.#donePromise.resolve();
}
}
async awaitDone () {
await this.#donePromise;
}
async onComplete (fn) {
await this.#donePromise;
fn();
}
}