UNPKG

@intuitionrobotics/bug-report

Version:
25 lines 1.04 kB
import { Module } from "@intuitionrobotics/ts-common"; import {} from "../../shared/api.js"; import { FirebaseModule, FirestoreCollection, StorageWrapper } from "@intuitionrobotics/firebase/backend"; export class AdminBRModule_Class extends Module { constructor() { super("AdminBRModule"); } // Resolved lazily on first use (was init()). _bugReport; _storage; get bugReport() { return this._bugReport ??= FirebaseModule.createAdminSession().getFirestore().getCollection('bug-report', ['_id']); } get storage() { return this._storage ??= FirebaseModule.createAdminSession().getStorage(); } getFilesFirebase = async () => this.bugReport.getAll(); downloadFiles = async (path) => { const bucket = await this.storage.getOrCreateBucket(this.config?.bucket); const file = await bucket.getFile(path.path); return file.getReadSecuredUrl(600000); }; } export const AdminBRModule = new AdminBRModule_Class(); //# sourceMappingURL=AdminBRModule.js.map