buritifs 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +209 -0
- package/dist/chunk-QOM3Q3WE.js +803 -0
- package/dist/chunk-QOM3Q3WE.js.map +1 -0
- package/dist/index.cjs +831 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +303 -0
- package/dist/index.d.ts +303 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +943 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +34 -0
- package/dist/react/index.d.ts +34 -0
- package/dist/react/index.js +120 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/Explorer/file.ts","../src/core/Explorer/folder.ts","../src/core/utils.ts","../src/core/storage/idb-setup.ts","../src/core/storage/opfs-storage.ts","../src/core/storage/idb-nodes.ts","../src/core/storage/idb-query.ts","../src/core/storage/idb-refactor.ts","../src/core/storage/storage-init.ts","../src/core/Explorer/ExplorerMain.ts"],"sourcesContent":["\n\n\nimport type { ReturnedErrorOrSucessExplorerType, ReturnedExplorerFileType, ReturnedExplorerInfoType, ReturnedExplorerReadType } from \"../types/general\";\nimport type ExplorerTree from \"./ExplorerMain\";\n\nexport default class ExplorerFile {\n private base:string;\n private storage:ExplorerTree;\n\n readonly ok:true = true;\n readonly error:null = null;\n readonly type: 'file' = 'file';\n\n get path(): string { return this.base; }\n\n constructor(base:string, storage:ExplorerTree){\n this.base = base;\n this.storage = storage;\n }\n\n // ─── Info ─────────────────────────────────────────────────\n\n async info():Promise<ReturnedExplorerInfoType>{\n return await this.storage.info({path: this.base});\n }\n\n // ─── Refactor ─────────────────────────────────────────────\n\n async rename({name}:{name:string}):Promise<ReturnedErrorOrSucessExplorerType>{\n const result = await this.storage.rename({path: this.base, name});\n if (!result.ok) return result;\n const parentPath = this.base.substring(0, this.base.lastIndexOf('/')) || '/';\n this.base = `${parentPath === '/' ? '' : parentPath}/${name}`;\n return {ok:true, error:null};\n }\n\n async copy({to, priority}:{to:string, priority?:'source'|'destination'}):Promise<ReturnedExplorerFileType>{\n const result = await this.storage.copy({fromPath: this.base, toPath: to, merge:false, priority});\n if (!result.ok) return result;\n return await this.storage.source({path: to}) as ReturnedExplorerFileType;\n }\n\n async move({to, force}:{to:string, force?:boolean}):Promise<ReturnedErrorOrSucessExplorerType>{\n const result = await this.storage.move({fromPath: this.base, toPath: to, force});\n if (!result.ok) return result;\n const newInstance = await this.storage.source({path: to});\n if (newInstance instanceof ExplorerFile) this.base = newInstance.base;\n return {ok:true, error:null};\n }\n\n async delete():Promise<ReturnedErrorOrSucessExplorerType>{\n return await this.storage.delete({path: this.base});\n }\n\n async exists():Promise<boolean>{\n return await this.storage.exists({path: this.base});\n }\n\n async write({content}:{content: ArrayBuffer | string | object}):Promise<ReturnedErrorOrSucessExplorerType>{\n return await this.storage.write({path: this.base, content});\n }\n\n async read():Promise<ReturnedExplorerReadType>{\n return await this.storage.read({path: this.base});\n }\n\n}\n\n","\n\nimport type { ListItem, ReturnedErrorOrSucessExplorerType, ReturnedExplorerFileType, ReturnedExplorerFolderType, ReturnedExplorerInfoType, ReturnedExplorerListType, ReturnedExplorerSizeType } from \"../types/general\";\nimport type ExplorerTree from \"./ExplorerMain\";\n\nexport default class ExplorerFolder {\n\n private base:string;\n private storage:ExplorerTree;\n\n readonly ok: true = true;\n readonly error: null = null;\n readonly type: 'folder' = 'folder';\n\n get path(): string { return this.base === '/' ? '/' : this.base.slice(0, -1); }\n get tree(): ExplorerTree { return this.storage; }\n\n constructor(base:string, storage:ExplorerTree){\n this.base = base == '/' ? base : (base.endsWith('/') ? base : `${base}/`);\n this.storage = storage;\n }\n\n // ─── Info ─────────────────────────────────────────────────\n\n async info():Promise<ReturnedExplorerInfoType>{\n return await this.storage.info({path: this.path});\n }\n\n // ─── Get ──────────────────────────────────────────────────\n\n async get({name}:{name:string}):Promise<ReturnedExplorerFileType | ReturnedExplorerFolderType>{\n const path = `${this.base}${name}`;\n return await this.storage.source({path});\n }\n\n // ─── New ──────────────────────────────────────────────────\n\n async newFolder({name}:{name:string}):Promise<ReturnedExplorerFolderType>{\n const path = `${this.base}${name}`;\n return await this.storage.newFolder({path});\n }\n\n async newFile({name}:{name:string}):Promise<ReturnedExplorerFileType>{\n const path = `${this.base}${name}`;\n return await this.storage.newFile({path});\n }\n\n // ─── Refactor ─────────────────────────────────────────────\n\n async rename({name}:{name:string}):Promise<ReturnedErrorOrSucessExplorerType>{\n const path = this.base === '/' ? '/' : this.base.slice(0, -1);\n const result = await this.storage.rename({path, name});\n if (!result.ok) return result;\n const parentPath = path.substring(0, path.lastIndexOf('/')) || '/';\n this.base = `${parentPath === '/' ? '' : parentPath}/${name}/`;\n return {ok:true, error:null};\n }\n\n async copy({to, merge, priority}:{to:string, merge?:boolean, priority?:'source'|'destination'}):Promise<ReturnedExplorerFolderType>{\n const result = await this.storage.copy({fromPath: this.base, toPath: to, merge, priority});\n if (!result.ok) return result;\n return await this.storage.source({path: to}) as ReturnedExplorerFolderType;\n }\n\n async move({to, force}:{to:string, force?:boolean}):Promise<ReturnedErrorOrSucessExplorerType>{\n const result = await this.storage.move({fromPath: this.base, toPath: to, force});\n if (!result.ok) return result;\n const newInstance = await this.storage.source({path: to});\n if (newInstance instanceof ExplorerFolder) this.base = newInstance.base;\n return {ok:true, error:null};\n }\n\n async delete():Promise<ReturnedErrorOrSucessExplorerType>{\n return await this.storage.delete({path: this.base});\n }\n\n async list({recursive, limit, page, filter}:{recursive?:boolean, limit?:number, page?:number, filter?:(item:ListItem)=>boolean}={}):Promise<ReturnedExplorerListType>{\n return await this.storage.list({path: this.path, recursive, limit, page, filter});\n }\n\n async exists():Promise<boolean>{\n return await this.storage.exists({path: this.path});\n }\n\n async size({recursive, filter}:{recursive?:boolean, filter?:(item:ListItem)=>boolean}={}):Promise<ReturnedExplorerSizeType>{\n return await this.storage.size({path: this.path, recursive, filter});\n }\n\n}\n\n","\n\nexport function validatePath(oldPath: string):{newPath:string, error:string|null} {\n // Sanitize\n let path = oldPath;\n if (!path.startsWith(\"/\")) path = `/${path}`;\n if (path.endsWith(\"/\") && path !== '/') path = path.slice(0, -1);\n // Validate\n if (path.trim() === \"\") return { newPath: oldPath, error: 'Path cannot be empty' };\n if (path.includes(\"//\")) return { newPath: oldPath, error: 'Path cannot contain \"//\"' };\n if (path.endsWith(\"/\") && path !== \"/\") return { newPath: oldPath, error: 'Path cannot end with \"/\"' };\n if (path.includes(' ')) return { newPath: oldPath, error: 'Path cannot contain spaces' };\n return { newPath: path, error: null };\n}\n\n\n/*\nexport async function runAction<S extends object, E extends object>(\n props: { action: () => Promise<S | void>; free?: () => E | void }\n): Promise<S & { ok: true; error: null } | E & { ok: false; error: string }> {\n try {\n const responseSucess = (await props.action()) ?? {} as S;\n return { ...responseSucess, ok: true, error: null } as S & { ok: true; error: null };\n } catch (e) {\n const responseError = (props.free?.() ?? {}) as E;\n return { ...responseError, ok: false, error: e instanceof Error ? e.message : String(e) } as E & { ok: false; error: string };\n }\n}\n*/\n\n\n\n\n\n\n\n\n","\n\nimport type { PropsClassMainType, TableBuritiTypeBD } from \"../types/general\";\nimport { validatePath } from \"../utils\";\n\nexport default class IDBSetup {\n\n private static registry = new Map<string, IDBDatabase>();\n\n protected db: IDBDatabase | null = null;\n private dbName: string;\n private static readonly DB_VERSION: number = 1;\n\n constructor({name}:PropsClassMainType){\n this.dbName = name;\n }\n\n // ─── Helpers ───────────────────────────────────────────────\n\n protected request<T>(mode: IDBTransactionMode, fn: (store: IDBObjectStore) => IDBRequest<T>): Promise<T> {\n return new Promise((resolve, reject) => {\n const transaction = this.db!.transaction(\"nodes\", mode);\n const store = transaction.objectStore(\"nodes\");\n const req = fn(store);\n req.onsuccess = () => resolve(req.result);\n req.onerror = (e) => reject((e.target as IDBRequest).error);\n });\n }\n\n protected transact(mode: IDBTransactionMode, fn: (store: IDBObjectStore) => void): Promise<void> {\n return new Promise((resolve, reject) => {\n const transaction = this.db!.transaction(\"nodes\", mode);\n const store = transaction.objectStore(\"nodes\");\n fn(store);\n transaction.oncomplete = () => resolve();\n transaction.onerror = (e) => reject((e.target as IDBTransaction).error);\n });\n }\n\n protected async pathTrated(path:string):Promise<{path:string, parent:string|null, name:string, table:TableBuritiTypeBD|null}>{\n if(path === '/'){\n return {\n path,\n parent:null,\n name:path,\n table:await this.request<TableBuritiTypeBD|null>('readonly', store => store.get(path))\n }\n };\n\n\n const {newPath, error} = validatePath(path);\n if(error) throw new Error(error);\n\n const pathParts = newPath.split('/');\n const parent = pathParts.length === 2 ? '/' : pathParts.slice(0, -1).join('/');\n\n const parentNode = await this.request<TableBuritiTypeBD|null>('readonly', store => store.get(parent));\n if(!parentNode) throw new Error(`Parent path \"${parent}\" does not exist`);\n if(parentNode.type !== 'folder') throw new Error(`Parent path \"${parent}\" is not a folder`);\n\n const existingNode = await this.request<TableBuritiTypeBD|null>('readonly', store => store.get(newPath));\n\n return {path:newPath, parent, name:pathParts.pop() as string, table:existingNode};\n }\n\n protected async withWAL(\n data: TableBuritiTypeBD,\n action: () => Promise<void>\n ): Promise<void> {\n await this.transact(\"readwrite\", store => store.put({ ...data, status: 'pending' }));\n await action();\n await this.transact(\"readwrite\", store => store.put({ ...data, status: 'ready' }));\n }\n\n // ─── init ──────────────────────────────────────────────────\n\n protected openDB(): Promise<void> {\n\n // Se já existe uma conexão aberta para esse banco, reutiliza\n const existing = IDBSetup.registry.get(this.dbName);\n if (existing) {\n this.db = existing;\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, IDBSetup.DB_VERSION);\n\n request.onsuccess = (event) => {\n this.db = (event.target as IDBOpenDBRequest).result;\n IDBSetup.registry.set(this.dbName, this.db);\n resolve();\n };\n\n request.onerror = (event) => {\n reject((event.target as IDBOpenDBRequest).error);\n };\n\n request.onblocked = () => {\n reject(new Error('IndexedDB blocked: close other tabs that are using the database.'));\n };\n\n request.onupgradeneeded = (event) => {\n const db = (event.target as IDBOpenDBRequest).result;\n\n if (event.oldVersion < 1){\n const store = db.createObjectStore(\"nodes\", { keyPath: \"path\" });\n store.createIndex(\"type\", \"type\");\n store.createIndex(\"parent\", \"parent\");\n store.createIndex(\"contentId\", \"contentId\", { unique:true });\n store.createIndex(\"status\", \"status\");\n }\n\n //if (event.oldVersion < 2){}\n //if (event.oldVersion < 3){}\n };\n });\n }\n\n static close({name}:{name: string}): void {\n const db = IDBSetup.registry.get(name);\n if (db) {\n db.close();\n IDBSetup.registry.delete(name);\n }\n }\n}\n\n","import { PropsClassMainType } from \"../types/general\";\nimport IDBSetup from \"./idb-setup\";\n\n\nexport default class OPFSStorage extends IDBSetup {\n protected root!: FileSystemDirectoryHandle;\n\n constructor(props: PropsClassMainType) {\n super(props);\n }\n\n protected async openStorage(){\n this.root = await navigator.storage.getDirectory();\n if (!this.root) throw new Error(\"Mensagem de erro\");\n }\n\n protected async writeStorage(id: string, content: ArrayBuffer | string | object): Promise<void> {\n const fileHandle = await this.root.getFileHandle(id, { create: true });\n const writable = await fileHandle.createWritable();\n const data = typeof content === \"object\" && !(content instanceof ArrayBuffer)\n ? JSON.stringify(content)\n : content;\n await writable.write(data);\n await writable.close();\n }\n\n protected async readStorage(id: string): Promise<ArrayBuffer> {\n const fileHandle = await this.root.getFileHandle(id);\n const file = await fileHandle.getFile();\n return await file.arrayBuffer();\n }\n\n protected async readTextStorage(id: string): Promise<string> {\n const fileHandle = await this.root.getFileHandle(id);\n const file = await fileHandle.getFile();\n return await file.text();\n }\n\n protected async deleteStorage(id: string): Promise<void> {\n await this.root.removeEntry(id);\n }\n\n protected async existsStorage(id: string): Promise<boolean> {\n try {\n await this.root.getFileHandle(id);\n return true;\n } catch {\n return false;\n }\n }\n}\n","\n\nimport type { PropsClassAddNoteBD, PropsClassMainType, TableBuritiTypeBD } from \"../types/general\";\nimport OPFSStorage from \"./opfs-storage\";\n\nexport default class IDBNodes extends OPFSStorage {\n\n constructor(props: PropsClassMainType) {\n super(props);\n }\n\n protected async getSource(props: { path: string }): Promise<TableBuritiTypeBD> {\n const propsTrated = await this.pathTrated(props.path);\n if (!propsTrated.table) throw new Error(`Path ${props.path} does not exist`);\n return propsTrated.table;\n }\n\n protected async addNode({ path, type }: PropsClassAddNoteBD): Promise<void> {\n\n if (type !== 'file' && type !== 'folder') throw new Error(\"Type must be 'file' or 'folder'\");\n if (path == '/') throw new Error(\"Should not create the root folder.\");\n\n const propsTrated = await this.pathTrated(path);\n if (propsTrated.path === '/') throw new Error(\"Cannot add root node\");\n if (propsTrated.table && propsTrated.table.type !== type) throw new Error(`Path \"${path}\" already exists as a \"${propsTrated.table.type}\"`);\n\n const now = Date.now();\n\n const contentId = type === 'file'\n ? String(crypto.getRandomValues(new Uint32Array(1))[0])\n : undefined;\n\n const node = {\n path: propsTrated.path,\n parent: propsTrated.parent,\n type,\n createdAt: propsTrated.table?.createdAt ?? now,\n updatedAt: now,\n ...(contentId ? { contentId } : {})\n } as TableBuritiTypeBD;\n\n await this.withWAL(node, async () => {\n if (type === 'file') await this.writeStorage(contentId!, \"\");\n });\n }\n\n protected async removeNode({ path }: { path: string }): Promise<void> {\n if (path === '/') throw new Error('Cannot remove root node.');\n const node = await this.getSource({ path });\n\n if (node.type === 'file') {\n await this.transact(\"readwrite\", store => store.delete(node.path));\n await this.deleteStorage(node.contentId).catch(() => {});\n return;\n }\n\n if (node.type === 'folder') {\n // Busca todos os arquivos filhos para deletar do OPFS\n const range = IDBKeyRange.bound(node.path + '/', node.path + '/' + '\\uffff');\n const children = await this.request<TableBuritiTypeBD[]>('readonly', store => store.getAll(range));\n\n await this.transact(\"readwrite\", store => {\n store.delete(range);\n store.delete(node.path);\n });\n\n for (const child of children) {\n if (child.type === 'file') {\n await this.deleteStorage(child.contentId).catch(() => {});\n }\n }\n return;\n }\n\n throw new Error(`Unknown node type \"${(node as TableBuritiTypeBD).type}\" at path \"${path}\".`);\n }\n}\n","\nimport type { ListItem, PropsClassMainType, TableBuritiTypeBD } from \"../types/general\";\nimport IDBNodes from \"./idb-nodes\";\n\nexport default class IDBQuery extends IDBNodes {\n\n constructor(props: PropsClassMainType) {\n super(props);\n }\n\n protected async existsNode({ path }: { path: string }): Promise<boolean> {\n const norm = await this.pathTrated(path);\n return !!norm.table;\n }\n\n protected async sizeNode({\n pathRef,\n recursive = false,\n filter,\n }: {\n pathRef: string;\n recursive?: boolean;\n filter?: (item: ListItem) => boolean;\n }): Promise<number> {\n\n const norm = await this.pathTrated(pathRef);\n if (!norm.table) throw new Error(`Path \"${pathRef}\" does not exist`);\n if (norm.table.type !== 'folder') throw new Error(`Path \"${pathRef}\" is not a folder`);\n\n const recursiveRange = norm.path === '/'\n ? IDBKeyRange.lowerBound('/', true)\n : IDBKeyRange.bound(norm.path + '/', norm.path + '/' + '\\uffff');\n\n let count:number = 0;\n await this.transact('readonly', store => {\n const req = recursive\n ? store.openCursor(recursiveRange)\n : store.index('parent').openCursor(IDBKeyRange.only(norm.path));\n\n req.onsuccess = (e) => {\n const cursor = (e.target as IDBRequest<IDBCursorWithValue | null>).result;\n if (!cursor) return;\n const node = cursor.value as TableBuritiTypeBD;\n if (node.status !== 'pending') {\n const item: ListItem = { path: node.path, type: node.type, createdAt: node.createdAt, updatedAt: node.updatedAt };\n if (!filter || filter(item)) count++;\n }\n cursor.continue();\n };\n });\n\n return count;\n }\n\n protected async listNodes({\n pathRef,\n recursive = false,\n limit = -1,\n page = 0,\n filter,\n }: {\n pathRef: string;\n recursive?: boolean;\n limit?: number;\n page?: number;\n filter?: (item: ListItem) => boolean;\n }): Promise<ListItem[]> {\n\n const norm = await this.pathTrated(pathRef);\n if (!norm.table) throw new Error(`Path \"${pathRef}\" does not exist`);\n if (norm.table.type !== 'folder') throw new Error(`Path \"${pathRef}\" is not a folder`);\n\n const recursiveRange = norm.path === '/'\n ? IDBKeyRange.lowerBound('/', true)\n : IDBKeyRange.bound(norm.path + '/', norm.path + '/' + '\\uffff');\n\n const results: ListItem[] = [];\n let toSkip = limit === -1 ? 0 : page * limit;\n let count = 0;\n\n await this.transact('readonly', (store => {\n const req: IDBRequest<IDBCursorWithValue | null> = recursive\n ? store.openCursor(recursiveRange)\n : store.index('parent').openCursor(IDBKeyRange.only(norm.path));\n\n req.onsuccess = (e) => {\n const cursor = (e.target as IDBRequest<IDBCursorWithValue | null>).result;\n if (!cursor) return;\n\n const node = cursor.value as TableBuritiTypeBD;\n\n if (node.status === 'pending') {\n cursor.continue();\n return;\n }\n\n const item: ListItem = {\n path: node.path,\n type: node.type,\n createdAt: node.createdAt,\n updatedAt: node.updatedAt,\n };\n\n if (filter && !filter(item)) { cursor.continue(); return; }\n if (toSkip > 0) { toSkip--; cursor.continue(); return; }\n if (limit !== -1 && count >= limit) return;\n\n results.push(item);\n count++;\n cursor.continue();\n }\n }));\n\n return results;\n }\n}\n","\nimport type { PropsClassMainType, TableBuritiTypeBD } from \"../types/general\";\nimport IDBQuery from \"./idb-query\";\n\nexport default class IDBRefactor extends IDBQuery {\n\n constructor(props: PropsClassMainType) {\n super(props);\n }\n\n protected async copyNode({\n fromPath,\n toPath,\n merge = false,\n priority = 'source',\n }: {\n fromPath: string;\n toPath: string;\n merge?: boolean;\n priority?: 'source' | 'destination';\n }): Promise<void> {\n\n if (fromPath === '/' || toPath === '/') throw new Error('Cannot copy root node.');\n if (fromPath === toPath) throw new Error('Cannot copy a node to itself.');\n\n const fromEntity = await this.getSource({ path: fromPath });\n const toEntityProps = await this.pathTrated(toPath);\n const now = Date.now();\n\n const remap = (oldPath: string) => toEntityProps.path + oldPath.slice(fromEntity.path.length);\n const remapParent = (oldParent: string | null): string | null =>\n oldParent === null\n ? null\n : oldParent === fromEntity.path\n ? toEntityProps.path\n : remap(oldParent);\n\n // ─── File ─────────────────────────────────────────────────\n if (fromEntity.type === 'file') {\n if (priority === 'destination' && !!toEntityProps.table) return;\n\n const newContentId = String(crypto.getRandomValues(new Uint32Array(1))[0]);\n const content = await this.readStorage(fromEntity.contentId);\n await this.writeStorage(newContentId, content);\n\n await this.transact('readwrite', store => {\n if (toEntityProps.table) store.delete(toEntityProps.path);\n store.put({\n path: toEntityProps.path,\n parent: toEntityProps.parent,\n type: 'file',\n contentId: newContentId,\n createdAt: fromEntity.createdAt,\n updatedAt: now,\n status: 'ready',\n } as TableBuritiTypeBD);\n });\n\n // Cleanup OPFS do arquivo substituído (referência já removida do IDB)\n if (toEntityProps.table?.type === 'file') {\n await this.deleteStorage(toEntityProps.table.contentId).catch(() => {});\n }\n return;\n }\n\n // ─── Folder ───────────────────────────────────────────────\n if (fromEntity.type === 'folder') {\n const destExists = !!toEntityProps.table;\n const destIsFile = toEntityProps.table?.type === 'file';\n\n if (priority === 'destination' && !merge && destExists) return;\n if (priority === 'destination' && destIsFile) return;\n\n const skipExisting = merge && priority === 'destination';\n const shouldReplaceDest = destExists && (!merge || destIsFile);\n\n // Coleta filhos da fonte\n const sourceRange = IDBKeyRange.bound(fromEntity.path + '/', fromEntity.path + '/' + '\\uffff');\n const sourceChildren = await this.request<TableBuritiTypeBD[]>('readonly', store => store.getAll(sourceRange));\n\n // Coleta nós do destino que serão removidos (para cleanup do OPFS depois)\n let destNodesToClean: TableBuritiTypeBD[] = [];\n if (shouldReplaceDest) {\n if (destIsFile && toEntityProps.table) {\n destNodesToClean = [toEntityProps.table];\n } else {\n const destRange = IDBKeyRange.bound(toEntityProps.path + '/', toEntityProps.path + '/' + '\\uffff');\n destNodesToClean = await this.request<TableBuritiTypeBD[]>('readonly', store => store.getAll(destRange));\n }\n }\n\n // Monta listas do que será criado\n type FolderToCreate = { path: string; parent: string | null; createdAt: number };\n type FileToCopy = { fromContentId: string; newContentId: string; newPath: string; newParent: string | null; createdAt: number };\n\n const foldersToCreate: FolderToCreate[] = [\n { path: toEntityProps.path, parent: toEntityProps.parent, createdAt: toEntityProps.table?.createdAt ?? now }\n ];\n const filesToCopy: FileToCopy[] = [];\n\n for (const node of sourceChildren) {\n if (node.status === 'pending') continue;\n const newPath = remap(node.path);\n const newParent = remapParent(node.parent);\n\n if (node.type === 'folder') {\n if (skipExisting && await this.existsNode({ path: newPath })) continue;\n foldersToCreate.push({ path: newPath, parent: newParent, createdAt: node.createdAt });\n } else if (node.type === 'file') {\n if (skipExisting && await this.existsNode({ path: newPath })) continue;\n filesToCopy.push({\n fromContentId: node.contentId,\n newContentId: String(crypto.getRandomValues(new Uint32Array(1))[0]),\n newPath,\n newParent,\n createdAt: node.createdAt,\n });\n }\n }\n\n // Passo 1: escreve novos arquivos no OPFS (IDB intocado)\n for (const file of filesToCopy) {\n const content = await this.readStorage(file.fromContentId);\n await this.writeStorage(file.newContentId, content);\n }\n\n // Passo 2: transact único para todas as mudanças no IDB\n await this.transact('readwrite', store => {\n if (shouldReplaceDest) {\n store.delete(toEntityProps.path);\n if (!destIsFile) {\n const destRange = IDBKeyRange.bound(toEntityProps.path + '/', toEntityProps.path + '/' + '\\uffff');\n store.delete(destRange as unknown as IDBValidKey);\n }\n }\n\n for (const folder of foldersToCreate) {\n store.put({ path: folder.path, parent: folder.parent, type: 'folder', createdAt: folder.createdAt, updatedAt: now, status: 'ready' } as TableBuritiTypeBD);\n }\n\n for (const file of filesToCopy) {\n store.put({ path: file.newPath, parent: file.newParent, type: 'file', contentId: file.newContentId, createdAt: file.createdAt, updatedAt: now, status: 'ready' } as TableBuritiTypeBD);\n }\n });\n\n // Passo 3: cleanup OPFS antigo (referências já removidas do IDB)\n for (const node of destNodesToClean) {\n if (node.type === 'file') {\n await this.deleteStorage(node.contentId).catch(() => {});\n }\n }\n }\n }\n\n protected async moveNode({\n fromPath,\n toPath,\n force = false,\n }: {\n fromPath: string;\n toPath: string;\n force?: boolean;\n }): Promise<void> {\n if (fromPath === '/' || toPath === '/') throw new Error('Cannot move root node.');\n const fromNorm = await this.pathTrated(fromPath);\n const toNorm = await this.pathTrated(toPath);\n if (fromNorm.path === toNorm.path) throw new Error('Cannot move a node to itself.');\n if (toNorm.path.startsWith(fromNorm.path + '/')) throw new Error('Cannot move a folder into one of its own descendants.');\n\n const fromEntity = await this.getSource({ path: fromPath });\n const destExists = !!toNorm.table;\n\n if (destExists) {\n if (!force) throw new Error(`Destination \"${toNorm.path}\" already exists.`);\n await this.removeNode({ path: toNorm.path });\n }\n\n const now = Date.now();\n const remap = (oldPath: string) => toNorm.path + oldPath.slice(fromNorm.path.length);\n const remapParent = (oldParent: string | null): string | null =>\n oldParent === null\n ? null\n : oldParent === fromNorm.path\n ? toNorm.path\n : remap(oldParent);\n\n if (fromEntity.type === 'file') {\n await this.transact('readwrite', store => {\n store.delete(fromNorm.path);\n store.put({ ...fromEntity, path: toNorm.path, parent: toNorm.parent, updatedAt: now });\n });\n return;\n }\n\n if (fromEntity.type === 'folder') {\n const range = IDBKeyRange.bound(fromNorm.path + '/', fromNorm.path + '/' + '\\uffff');\n const children = await this.request<TableBuritiTypeBD[]>('readonly', store => store.getAll(range));\n\n await this.transact('readwrite', store => {\n store.delete(fromNorm.path);\n store.put({ ...fromEntity, path: toNorm.path, parent: toNorm.parent, updatedAt: now });\n\n for (const node of children) {\n if (node.status === 'pending') continue;\n const newPath = remap(node.path);\n const newParent = remapParent(node.parent);\n store.delete(node.path);\n store.put({ ...node, path: newPath, parent: newParent, updatedAt: now });\n }\n });\n }\n }\n}\n","\nimport type { PropsClassMainType, TableBuritiTypeBD } from \"../types/general\";\nimport IDBRefactor from \"./idb-refactor\";\n\nexport default class StorageInit extends IDBRefactor {\n\n constructor(props: PropsClassMainType) {\n super(props);\n }\n\n protected async initExplorerData(): Promise<void> {\n await this.openDB();\n await this.openStorage();\n await this.recover();\n }\n\n private async recover(): Promise<void> {\n await this.recoverPending();\n await this.recoverOrphans();\n await this.recoverBroken();\n }\n\n private async recoverPending(): Promise<void> {\n const pending = await this.request<TableBuritiTypeBD[]>(\n 'readonly',\n store => store.index('status').getAll('pending')\n );\n\n for (const node of pending) {\n await this.removeNode({path:node.path});\n if (node.type === 'file') {\n await this.deleteStorage(node.contentId).catch(() => {});\n }\n }\n }\n\n private async recoverOrphans(): Promise<void> {\n if (!(Symbol.asyncIterator in this.root)) return;\n\n for await (const [name, handle] of this.root as unknown as AsyncIterable<[string, FileSystemHandle]>) {\n if (handle.kind !== 'file') continue;\n const linked = await this.request<TableBuritiTypeBD | null>(\n 'readonly',\n store => store.index('contentId').get(name)\n );\n if (!linked) {\n await this.deleteStorage(name).catch(() => {});\n }\n }\n }\n\n private async recoverBroken(): Promise<void> {\n const files = await this.request<TableBuritiTypeBD[]>(\n 'readonly',\n store => store.index('type').getAll('file')\n );\n\n for (const node of files) {\n if (node.type !== 'file') continue;\n const exists = await this.existsStorage(node.contentId);\n if (!exists) {\n await this.removeNode({ path: node.path }).catch(() => {});\n }\n }\n }\n}\n","\n\nimport StorageInit from \"../storage/storage-init\";\nimport type { ListItem, PropsClassMainType, ReturnedErrorExplorerType, ReturnedErrorOrSucessExplorerType, ReturnedExplorerFileType, ReturnedExplorerFolderType, ReturnedExplorerInfoType, ReturnedExplorerListType, ReturnedExplorerReadType, ReturnedExplorerSizeType, TableBuritiTypeBD } from \"../types/general\";\nimport ExplorerFile from \"./file\";\nimport ExplorerFolder from \"./folder\";\n\n\nexport default class ExplorerTree extends StorageInit {\n\n private listeners: Map<string, Set<() => void>> = new Map();\n\n private constructor(props:PropsClassMainType){\n super(props);\n }\n\n subscribe(path: string, fn: () => void): () => void {\n if (!this.listeners.has(path)) this.listeners.set(path, new Set());\n this.listeners.get(path)!.add(fn);\n return () => this.listeners.get(path)?.delete(fn);\n }\n\n private parentOf(path: string): string {\n const idx = path.lastIndexOf('/');\n if (idx <= 0) return '/';\n return path.slice(0, idx);\n }\n\n private notify(path: string): void {\n let current: string | null = path;\n while (current !== null) {\n this.listeners.get(current)?.forEach(fn => fn());\n if (current === '/') break;\n current = this.parentOf(current);\n }\n }\n\n static async create(props:PropsClassMainType):Promise<ExplorerTree | ReturnedErrorExplorerType>{\n const instance = new ExplorerTree(props);\n try {\n await instance.initExplorerData();\n const now = Date.now();\n const existing = await instance.request<{ createdAt: number } | null>('readonly', store => store.get('/'));\n const objectPathRootInitialize:TableBuritiTypeBD = {\n path:'/',\n type:'folder',\n parent:null,\n createdAt: existing?.createdAt ?? now,\n updatedAt: now,\n status: \"ready\"\n }\n await instance.transact(\"readwrite\", (store) => store.put(objectPathRootInitialize));\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n return instance;\n }\n\n // ─── Get ──────────────────────────────────────────────────\n\n async source({path}:{path:string}):Promise<ReturnedExplorerFileType | ReturnedExplorerFolderType>{\n try {\n const table = await this.getSource({path});\n if(table.type === 'folder') return new ExplorerFolder(table.path, this);\n if(table.type === 'file') return new ExplorerFile(table.path, this);\n return {ok:false, error:`Internal error: entity at \"${path}\" has no valid type`};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n // ─── Info ─────────────────────────────────────────────────\n\n async info({path}:{path:string}):Promise<ReturnedExplorerInfoType>{\n try {\n const table = await this.getSource({path});\n return {ok:true, error:null, path:table.path, createdAt:table.createdAt, updatedAt:table.updatedAt};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async type({path}:{path:string}):Promise<string|null>{\n try {\n const entity = await this.getSource({path});\n return entity.path === '/' ? 'folder' : entity.type;\n } catch (e) {\n return null;\n }\n }\n\n // ─── New ──────────────────────────────────────────────────\n \n async newFolder({path}:{path:string}):Promise<ReturnedExplorerFolderType>{\n try {\n await this.addNode({path, type:'folder'});\n this.notify(this.parentOf(path));\n return new ExplorerFolder(path, this);\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async newFile({path}:{path:string}):Promise<ReturnedExplorerFileType>{\n try {\n await this.addNode({path, type:'file'});\n this.notify(this.parentOf(path));\n return new ExplorerFile(path, this);\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n // ─── Refactor ─────────────────────────────────────────────\n \n async delete({path}:{path:string}):Promise<ReturnedErrorOrSucessExplorerType>{\n try {\n const parent = this.parentOf(path);\n await this.removeNode({path});\n this.notify(parent);\n return {ok:true, error:null};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async copy({fromPath, toPath, merge, priority}:{fromPath:string, toPath:string, merge?:boolean, priority?:'source'|'destination'}):Promise<ReturnedErrorOrSucessExplorerType>{\n try {\n await this.copyNode({fromPath, toPath, merge, priority});\n this.notify(this.parentOf(toPath));\n return {ok:true, error:null};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async move({fromPath, toPath, force}:{fromPath:string, toPath:string, force?:boolean}):Promise<ReturnedErrorOrSucessExplorerType>{\n try {\n await this.moveNode({fromPath, toPath, force});\n this.notify(this.parentOf(fromPath));\n this.notify(this.parentOf(toPath));\n return {ok:true, error:null};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async rename({path, name}:{path:string, name:string}):Promise<ReturnedErrorOrSucessExplorerType>{\n try {\n const normalized = await this.pathTrated(path);\n const parent = normalized.parent ?? '/';\n const toPath = `${parent === '/' ? '' : parent}/${name}`;\n await this.moveNode({fromPath: normalized.path, toPath});\n this.notify(parent);\n return {ok:true, error:null};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async list({path, recursive, limit, page, filter}:{path:string, recursive?:boolean, limit?:number, page?:number, filter?:(item:ListItem)=>boolean}):Promise<ReturnedExplorerListType>{\n try {\n const items = await this.listNodes({pathRef: path, recursive, limit, page, filter});\n return {ok:true, error:null, items};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async exists({path}:{path:string}):Promise<boolean>{\n try {\n return await this.existsNode({path});\n } catch {\n return false;\n }\n }\n\n async size({path, recursive, filter}:{path:string, recursive?:boolean, filter?:(item:ListItem)=>boolean}):Promise<ReturnedExplorerSizeType>{\n try {\n const size = await this.sizeNode({pathRef: path, recursive, filter});\n return {ok:true, error:null, size};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async write({path, content}:{path:string, content: ArrayBuffer | string | object}):Promise<ReturnedErrorOrSucessExplorerType>{\n try {\n const tableByDB = await this.getSource({path});\n if (tableByDB.type === 'folder') return {ok: false, error: `Path \"${path}\" is a folder`};\n await this.writeStorage(tableByDB.contentId, content);\n await this.transact('readwrite', store => store.put({...tableByDB, updatedAt: Date.now()}));\n this.notify(path);\n return {ok:true, error:null};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n async read({path}:{path:string}):Promise<ReturnedExplorerReadType>{\n try {\n const tableByDB = await this.getSource({path});\n if (tableByDB.type === 'folder') return {ok:false, error:`Path \"${path}\" is a folder`};\n const content = await this.readStorage(tableByDB.contentId);\n const text = new TextDecoder().decode(content);\n return {ok:true, error:null, content, text};\n } catch (e) {\n return {ok:false, error:e instanceof Error ? e.message : String(e)};\n }\n }\n\n // zip. Talvez futuramente.\n // Sync Github. Talvez futuramente.\n}\n\n\n\n"],"mappings":";AAMA,IAAqB,eAArB,MAAqB,cAAa;AAAA,EAUhC,YAAY,MAAa,SAAqB;AAN9C,SAAS,KAAU;AACnB,SAAS,QAAa;AACtB,SAAS,OAAe;AAKtB,SAAK,OAAO;AACZ,SAAK,UAAU;AAAA,EACjB;AAAA,EALA,IAAI,OAAe;AAAE,WAAO,KAAK;AAAA,EAAM;AAAA;AAAA,EASvC,MAAM,OAAwC;AAC5C,WAAO,MAAM,KAAK,QAAQ,KAAK,EAAC,MAAM,KAAK,KAAI,CAAC;AAAA,EAClD;AAAA;AAAA,EAIA,MAAM,OAAO,EAAC,KAAI,GAA2D;AAC3E,UAAM,SAAS,MAAM,KAAK,QAAQ,OAAO,EAAC,MAAM,KAAK,MAAM,KAAI,CAAC;AAChE,QAAI,CAAC,OAAO,GAAI,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