Compare commits

..

No commits in common. "77019896e58af3b98f5ad7109c306784aa7197d8" and "d78dc14a2b91ee3503269cbbeef0c2c54584fa32" have entirely different histories.

3 changed files with 120 additions and 319 deletions

View File

@ -78,6 +78,8 @@ function getMultipleObjects(db, storeName, keys) {
// ============================================ // ============================================
async function scanMissingData(processesToScan) { async function scanMissingData(processesToScan) {
console.log("[Service Worker] 🚀 Scanning with DIRECT DB ACCESS...");
let db; let db;
try { try {
db = await openDB(); db = await openDB();
@ -101,6 +103,7 @@ async function scanMissingData(processesToScan) {
if (!process || !process.states) continue; if (!process || !process.states) continue;
const firstState = process.states[0]; const firstState = process.states[0];
// Sécurisation : on vérifie que firstState existe
if (!firstState) continue; if (!firstState) continue;
const processId = firstState.commited_in; const processId = firstState.commited_in;
@ -109,6 +112,7 @@ async function scanMissingData(processesToScan) {
if (state.state_id === EMPTY32BYTES) continue; if (state.state_id === EMPTY32BYTES) continue;
for (const [field, hash] of Object.entries(state.pcd_commitment)) { for (const [field, hash] of Object.entries(state.pcd_commitment)) {
// On ignore les données publiques ou les rôles
if ( if (
(state.public_data && state.public_data[field] !== undefined) || (state.public_data && state.public_data[field] !== undefined) ||
field === "roles" field === "roles"
@ -140,6 +144,7 @@ async function scanMissingData(processesToScan) {
}); });
} }
} else { } else {
// Si on a trouvé la donnée, on est sûr de ne pas avoir besoin de la télécharger
if (toDownload.has(hash)) { if (toDownload.has(hash)) {
toDownload.delete(hash); toDownload.delete(hash);
} }
@ -149,17 +154,13 @@ async function scanMissingData(processesToScan) {
} }
} }
// On ferme la connexion BDD // On ferme la connexion BDD pour libérer les ressources
db.close(); db.close();
// ✅ LOG PERTINENT UNIQUEMENT : On n'affiche que si on a trouvé quelque chose console.log("[Service Worker] Scan complete:", {
if (toDownload.size > 0 || diffsToCreate.length > 0) { toDownload: toDownload.size,
console.log("[Service Worker] 🔄 Scan found items:", { diffsToCreate: diffsToCreate.length,
toDownload: toDownload.size, });
diffsToCreate: diffsToCreate.length,
});
}
return { return {
toDownload: Array.from(toDownload), toDownload: Array.from(toDownload),
diffsToCreate: diffsToCreate, diffsToCreate: diffsToCreate,

View File

@ -143,6 +143,7 @@ export class Database {
} }
navigator.serviceWorker.addEventListener("message", async (event) => { navigator.serviceWorker.addEventListener("message", async (event) => {
// ✅ SIMPLIFICATION : Plus besoin de gérer les "DB_REQUEST"
await this.handleServiceWorkerMessage(event.data); await this.handleServiceWorkerMessage(event.data);
}); });
@ -206,6 +207,8 @@ export class Database {
// SERVICE WORKER MESSAGE HANDLERS // SERVICE WORKER MESSAGE HANDLERS
// ============================================ // ============================================
// ✅ NETTOYAGE : handleDatabaseRequest() a été supprimé
private async handleServiceWorkerMessage(message: any) { private async handleServiceWorkerMessage(message: any) {
switch (message.type) { switch (message.type) {
case "TO_DOWNLOAD": case "TO_DOWNLOAD":

View File

@ -1,19 +1,9 @@
import * as Comlink from "comlink"; import * as Comlink from 'comlink';
import { import { ApiReturn, Device, Member, MerkleProofResult, Process, ProcessState, SecretsStore, UserDiff } from '../../pkg/sdk_client';
ApiReturn, import { BackUp } from '../types/index';
Device, import { APP_CONFIG } from '../config/constants';
Member, import { NetworkService } from './core/network.service';
MerkleProofResult, import type { CoreBackend } from '../workers/core.worker';
Process,
ProcessState,
SecretsStore,
UserDiff,
} from "../../pkg/sdk_client";
import { BackUp } from "../types/index";
import { APP_CONFIG } from "../config/constants";
import { NetworkService } from "./core/network.service";
import type { CoreBackend } from "../workers/core.worker";
import Database from "./database.service";
export default class Services { export default class Services {
private static instance: Services; private static instance: Services;
@ -31,8 +21,8 @@ export default class Services {
// Initialisation du Core Worker // Initialisation du Core Worker
this.workerInstance = new Worker( this.workerInstance = new Worker(
new URL("../workers/core.worker.ts", import.meta.url), new URL('../workers/core.worker.ts', import.meta.url),
{ type: "module" } { type: 'module' }
); );
this.coreWorker = Comlink.wrap<CoreBackend>(this.workerInstance); this.coreWorker = Comlink.wrap<CoreBackend>(this.workerInstance);
} }
@ -51,26 +41,23 @@ export default class Services {
} }
public async init(): Promise<void> { public async init(): Promise<void> {
console.log("[Services] 🚀 Démarrage Proxy..."); console.log('[Services] 🚀 Démarrage Proxy...');
// 1. Initialiser le Core Worker // 1. Initialiser le Core Worker
await this.coreWorker.init(); await this.coreWorker.init();
// 2. Initialiser la Database ici (Main Thread) pour lancer le SW
await Database.getInstance(); // 2. Configurer les Callbacks (Le worker pilote le main thread pour le réseau)
// 3. Configurer les Callbacks (Le worker pilote le main thread pour le réseau)
await this.coreWorker.setCallbacks( await this.coreWorker.setCallbacks(
Comlink.proxy(this.handleWorkerNotification.bind(this)), // notifier Comlink.proxy(this.handleWorkerNotification.bind(this)), // notifier
Comlink.proxy(this.handleWorkerNetworkSend.bind(this)), // networkSender Comlink.proxy(this.handleWorkerNetworkSend.bind(this)), // networkSender
Comlink.proxy(this.handleWorkerRelayUpdate.bind(this)), // relayUpdater Comlink.proxy(this.handleWorkerRelayUpdate.bind(this)), // relayUpdater
Comlink.proxy(this.handleWorkerRelayRequest.bind(this)) // relayGetter Comlink.proxy(this.handleWorkerRelayRequest.bind(this)) // relayGetter
); );
// 3. Initialiser le Réseau (Network Worker via Proxy) // 3. Initialiser le Réseau (Network Worker via Proxy)
await this.networkService.initRelays(); await this.networkService.initRelays();
console.log( console.log('[Services] ✅ Proxy connecté au CoreWorker et NetworkService.');
"[Services] ✅ Proxy connecté au CoreWorker et NetworkService."
);
} }
// ========================================== // ==========================================
@ -98,345 +85,155 @@ export default class Services {
// ========================================== // ==========================================
public async dispatchToWorker(flag: string, content: string, url: string) { public async dispatchToWorker(flag: string, content: string, url: string) {
switch (flag) { switch (flag) {
case "Handshake": case 'Handshake': await this.coreWorker.handleHandshakeMsg(url, content); break;
await this.coreWorker.handleHandshakeMsg(url, content); case 'NewTx': await this.coreWorker.parseNewTx(content); break;
break; case 'Cipher': await this.coreWorker.parseCipher(content); break;
case "NewTx": case 'Commit': await this.coreWorker.handleCommitError(content); break;
await this.coreWorker.parseNewTx(content);
break;
case "Cipher":
await this.coreWorker.parseCipher(content);
break;
case "Commit":
await this.coreWorker.handleCommitError(content);
break;
} }
} }
// ========================================== // ==========================================
// PROXY - PROPERTIES PUBLIC // PROXY - PROPERTIES PUBLIC
// ========================================== // ==========================================
public async getDevice1() { public async getDevice1() { return await this.coreWorker.getDevice1(); }
return await this.coreWorker.getDevice1(); public async getDevice2Ready() { return await this.coreWorker.getDevice2Ready(); }
}
public async getDevice2Ready() {
return await this.coreWorker.getDevice2Ready();
}
// NOTE: getSdkClient renvoie null car l'objet WASM n'est pas transférable hors du worker. // NOTE: getSdkClient renvoie null car l'objet WASM n'est pas transférable hors du worker.
// Toute la logique utilisant le client doit être dans le worker. // Toute la logique utilisant le client doit être dans le worker.
public get sdkClient() { public get sdkClient() { return null; }
return null;
}
public async setProcessId(id: string | null) { public async setProcessId(id: string | null) { return await this.coreWorker.setProcessId(id); }
return await this.coreWorker.setProcessId(id); public async setStateId(id: string | null) { return await this.coreWorker.setStateId(id); }
} public async getProcessId() { return await this.coreWorker.getProcessId(); }
public async setStateId(id: string | null) { public async getStateId() { return await this.coreWorker.getStateId(); }
return await this.coreWorker.setStateId(id); public async resetState() { return await this.coreWorker.resetState(); }
}
public async getProcessId() {
return await this.coreWorker.getProcessId();
}
public async getStateId() {
return await this.coreWorker.getStateId();
}
public async resetState() {
return await this.coreWorker.resetState();
}
// ========================================== // ==========================================
// PROXY - NETWORK PROXY // PROXY - NETWORK PROXY
// ========================================== // ==========================================
public async connectAllRelays() { public async connectAllRelays() { await this.networkService.connectAllRelays(); }
await this.networkService.connectAllRelays(); public async addWebsocketConnection(url: string) { await this.networkService.addWebsocketConnection(url); }
} public getAllRelays() { return this.networkService.getAllRelays(); }
public async addWebsocketConnection(url: string) { public updateRelay(url: string, sp: string) { this.networkService.updateRelay(url, sp); }
await this.networkService.addWebsocketConnection(url); public getSpAddress(url: string) { return this.networkService.getAllRelays()[url]; }
}
public getAllRelays() {
return this.networkService.getAllRelays();
}
public updateRelay(url: string, sp: string) {
this.networkService.updateRelay(url, sp);
}
public getSpAddress(url: string) {
return this.networkService.getAllRelays()[url];
}
// Délégation directe au NetworkService // Délégation directe au NetworkService
public printAllRelays() { public printAllRelays() {
// Si NetworkService ne l'expose pas directement dans sa version proxy, on l'ajoute ou on log ici // Si NetworkService ne l'expose pas directement dans sa version proxy, on l'ajoute ou on log ici
console.log("Relays:", this.networkService.getAllRelays()); console.log('Relays:', this.networkService.getAllRelays());
} }
// ========================================== // ==========================================
// PROXY - WALLET // PROXY - WALLET
// ========================================== // ==========================================
public async isPaired() { public async isPaired() { return await this.coreWorker.isPaired(); }
return await this.coreWorker.isPaired(); public async getAmount() { return await this.coreWorker.getAmount(); }
} public async getDeviceAddress() { return await this.coreWorker.getDeviceAddress(); }
public async getAmount() { public async dumpDeviceFromMemory() { return await this.coreWorker.dumpDeviceFromMemory(); }
return await this.coreWorker.getAmount(); public async dumpNeuteredDevice() { return await this.coreWorker.dumpNeuteredDevice(); }
} public async getPairingProcessId() { return await this.coreWorker.getPairingProcessId(); }
public async getDeviceAddress() { public async getDeviceFromDatabase() { return await this.coreWorker.getDeviceFromDatabase(); }
return await this.coreWorker.getDeviceAddress(); public async restoreDevice(d: Device) { await this.coreWorker.restoreDevice(d); }
} public async pairDevice(pid: string, list: string[]) { await this.coreWorker.pairDevice(pid, list); }
public async dumpDeviceFromMemory() { public async unpairDevice() { await this.coreWorker.unpairDevice(); }
return await this.coreWorker.dumpDeviceFromMemory(); public async saveDeviceInDatabase(d: Device) { await this.coreWorker.saveDeviceInDatabase(d); }
} public async createNewDevice() { return await this.coreWorker.createNewDevice(); }
public async dumpNeuteredDevice() { public async dumpWallet() { return await this.coreWorker.dumpWallet(); }
return await this.coreWorker.dumpNeuteredDevice(); public async getMemberFromDevice() { return await this.coreWorker.getMemberFromDevice(); }
}
public async getPairingProcessId() {
return await this.coreWorker.getPairingProcessId();
}
public async getDeviceFromDatabase() {
return await this.coreWorker.getDeviceFromDatabase();
}
public async restoreDevice(d: Device) {
await this.coreWorker.restoreDevice(d);
}
public async pairDevice(pid: string, list: string[]) {
await this.coreWorker.pairDevice(pid, list);
}
public async unpairDevice() {
await this.coreWorker.unpairDevice();
}
public async saveDeviceInDatabase(d: Device) {
await this.coreWorker.saveDeviceInDatabase(d);
}
public async createNewDevice() {
return await this.coreWorker.createNewDevice();
}
public async dumpWallet() {
return await this.coreWorker.dumpWallet();
}
public async getMemberFromDevice() {
return await this.coreWorker.getMemberFromDevice();
}
// ========================================== // ==========================================
// PROXY - PROCESS // PROXY - PROCESS
// ========================================== // ==========================================
public async getProcess(id: string) { public async getProcess(id: string) { return await this.coreWorker.getProcess(id); }
return await this.coreWorker.getProcess(id); public async getProcesses() { return await this.coreWorker.getProcesses(); }
} public async restoreProcessesFromDB() { await this.coreWorker.restoreProcessesFromDB(); }
public async getProcesses() { public async getLastCommitedState(p: Process) { return await this.coreWorker.getLastCommitedState(p); }
return await this.coreWorker.getProcesses(); public async getUncommitedStates(p: Process) { return await this.coreWorker.getUncommitedStates(p); }
} public async getStateFromId(p: Process, id: string) { return await this.coreWorker.getStateFromId(p, id); }
public async restoreProcessesFromDB() { public async getRoles(p: Process) { return await this.coreWorker.getRoles(p); }
await this.coreWorker.restoreProcessesFromDB(); public async getLastCommitedStateIndex(p: Process) { return await this.coreWorker.getLastCommitedStateIndex(p); }
} public async batchSaveProcessesToDb(p: Record<string, Process>) { return await this.coreWorker.batchSaveProcessesToDb(p); }
public async getLastCommitedState(p: Process) {
return await this.coreWorker.getLastCommitedState(p);
}
public async getUncommitedStates(p: Process) {
return await this.coreWorker.getUncommitedStates(p);
}
public async getStateFromId(p: Process, id: string) {
return await this.coreWorker.getStateFromId(p, id);
}
public async getRoles(p: Process) {
return await this.coreWorker.getRoles(p);
}
public async getLastCommitedStateIndex(p: Process) {
return await this.coreWorker.getLastCommitedStateIndex(p);
}
public async batchSaveProcessesToDb(p: Record<string, Process>) {
return await this.coreWorker.batchSaveProcessesToDb(p);
}
// ========================================== // ==========================================
// PROXY - CRYPTO // PROXY - CRYPTO
// ========================================== // ==========================================
public async decodeValue(val: number[]) { public async decodeValue(val: number[]) { return await this.coreWorker.decodeValue(val); }
return await this.coreWorker.decodeValue(val); public async hexToBlob(hex: string) { return await this.coreWorker.hexToBlob(hex); }
} public async hexToUInt8Array(hex: string) { return await this.coreWorker.hexToUInt8Array(hex); }
public async hexToBlob(hex: string) { public async blobToHex(blob: Blob) { return await this.coreWorker.blobToHex(blob); }
return await this.coreWorker.hexToBlob(hex); public async getHashForFile(c: string, l: string, f: any) { return await this.coreWorker.getHashForFile(c, l, f); }
} public async getMerkleProofForFile(s: ProcessState, a: string) { return await this.coreWorker.getMerkleProofForFile(s, a); }
public async hexToUInt8Array(hex: string) { public async validateMerkleProof(p: MerkleProofResult, h: string) { return await this.coreWorker.validateMerkleProof(p, h); }
return await this.coreWorker.hexToUInt8Array(hex);
}
public async blobToHex(blob: Blob) {
return await this.coreWorker.blobToHex(blob);
}
public async getHashForFile(c: string, l: string, f: any) {
return await this.coreWorker.getHashForFile(c, l, f);
}
public async getMerkleProofForFile(s: ProcessState, a: string) {
return await this.coreWorker.getMerkleProofForFile(s, a);
}
public async validateMerkleProof(p: MerkleProofResult, h: string) {
return await this.coreWorker.validateMerkleProof(p, h);
}
// ========================================== // ==========================================
// PROXY - MEMBERS // PROXY - MEMBERS
// ========================================== // ==========================================
public async getAllMembers() { public async getAllMembers() { return await this.coreWorker.getAllMembers(); }
return await this.coreWorker.getAllMembers(); public async getAllMembersSorted() { return await this.coreWorker.getAllMembersSorted(); }
} public async ensureMembersAvailable() { await this.coreWorker.ensureMembersAvailable(); }
public async getAllMembersSorted() { public async getAddressesForMemberId(memberId: string) { return await this.coreWorker.getAddressesForMemberId(memberId); }
return await this.coreWorker.getAllMembersSorted(); public async compareMembers(mA: string[], mB: string[]) { return await this.coreWorker.compareMembers(mA, mB); }
}
public async ensureMembersAvailable() {
await this.coreWorker.ensureMembersAvailable();
}
public async getAddressesForMemberId(memberId: string) {
return await this.coreWorker.getAddressesForMemberId(memberId);
}
public async compareMembers(mA: string[], mB: string[]) {
return await this.coreWorker.compareMembers(mA, mB);
}
// ========================================== // ==========================================
// PROXY - UTILS // PROXY - UTILS
// ========================================== // ==========================================
public async createFaucetMessage() { public async createFaucetMessage() { return await this.coreWorker.createFaucetMessage(); }
return await this.coreWorker.createFaucetMessage(); public async isChildRole(parent: any, child: any) { return await this.coreWorker.isChildRole(parent, child); }
}
public async isChildRole(parent: any, child: any) {
return await this.coreWorker.isChildRole(parent, child);
}
// ========================================== // ==========================================
// PROXY - LOGIQUE METIER & API // PROXY - LOGIQUE METIER & API
// ========================================== // ==========================================
public async getMyProcesses() { public async getMyProcesses() { return await this.coreWorker.getMyProcesses(); }
return await this.coreWorker.getMyProcesses(); public async ensureConnections(p: Process, sId?: string) { await this.coreWorker.ensureConnections(p, sId || null); }
} public async connectAddresses(addr: string[]) { return await this.coreWorker.connectAddresses(addr); }
public async ensureConnections(p: Process, sId?: string) {
await this.coreWorker.ensureConnections(p, sId || null);
}
public async connectAddresses(addr: string[]) {
return await this.coreWorker.connectAddresses(addr);
}
public async createPairingProcess(name: string, pairWith: string[]) { public async createPairingProcess(name: string, pairWith: string[]) { return await this.coreWorker.createPairingProcess(name, pairWith); }
return await this.coreWorker.createPairingProcess(name, pairWith); public async createProcess(priv: any, pub: any, roles: any) { return await this.coreWorker.createProcess(priv, pub, roles); }
} public async updateProcess(pid: string, newData: any, priv: string[], roles: any) { return await this.coreWorker.updateProcess(pid, newData, priv, roles); }
public async createProcess(priv: any, pub: any, roles: any) {
return await this.coreWorker.createProcess(priv, pub, roles);
}
public async updateProcess(
pid: string,
newData: any,
priv: string[],
roles: any
) {
return await this.coreWorker.updateProcess(pid, newData, priv, roles);
}
public async createPrdUpdate(pid: string, sid: string) { public async createPrdUpdate(pid: string, sid: string) { return await this.coreWorker.createPrdUpdate(pid, sid); }
return await this.coreWorker.createPrdUpdate(pid, sid); public async createPrdResponse(pid: string, sid: string) { return await this.coreWorker.createPrdResponse(pid, sid); }
} public async approveChange(pid: string, sid: string) { return await this.coreWorker.approveChange(pid, sid); }
public async createPrdResponse(pid: string, sid: string) { public async rejectChange(pid: string, sid: string) { return await this.coreWorker.rejectChange(pid, sid); }
return await this.coreWorker.createPrdResponse(pid, sid); public async requestDataFromPeers(pid: string, sids: string[], roles: any) { await this.coreWorker.requestDataFromPeers(pid, sids, roles); }
}
public async approveChange(pid: string, sid: string) {
return await this.coreWorker.approveChange(pid, sid);
}
public async rejectChange(pid: string, sid: string) {
return await this.coreWorker.rejectChange(pid, sid);
}
public async requestDataFromPeers(pid: string, sids: string[], roles: any) {
await this.coreWorker.requestDataFromPeers(pid, sids, roles);
}
public async resetDevice() { public async resetDevice() { await this.coreWorker.resetDevice(); }
await this.coreWorker.resetDevice(); public async handleApiReturn(res: ApiReturn) { await this.coreWorker.handleApiReturn(res); }
} public async saveDiffsToDb(diffs: UserDiff[]) { await this.coreWorker.saveDiffsToDb(diffs); }
public async handleApiReturn(res: ApiReturn) { public async handleCommitError(res: string) { await this.coreWorker.handleCommitError(res); }
await this.coreWorker.handleApiReturn(res);
}
public async saveDiffsToDb(diffs: UserDiff[]) {
await this.coreWorker.saveDiffsToDb(diffs);
}
public async handleCommitError(res: string) {
await this.coreWorker.handleCommitError(res);
}
public async rolesContainsUs(roles: any) { public async rolesContainsUs(roles: any) { return await this.coreWorker.rolesContainsUs(roles); }
return await this.coreWorker.rolesContainsUs(roles); public async getSecretForAddress(addr: string) { return await this.coreWorker.getSecretForAddress(addr); }
} public async getAllDiffs() { return await this.coreWorker.getAllDiffs(); }
public async getSecretForAddress(addr: string) { public async getDiffByValue(val: string) { return await this.coreWorker.getDiffByValue(val); }
return await this.coreWorker.getSecretForAddress(addr); public async getAllSecrets() { return await this.coreWorker.getAllSecrets(); }
}
public async getAllDiffs() {
return await this.coreWorker.getAllDiffs();
}
public async getDiffByValue(val: string) {
return await this.coreWorker.getDiffByValue(val);
}
public async getAllSecrets() {
return await this.coreWorker.getAllSecrets();
}
// ========================================== // ==========================================
// PROXY - STORAGE & DB // PROXY - STORAGE & DB
// ========================================== // ==========================================
public async saveBlobToDb(h: string, d: Blob) { public async saveBlobToDb(h: string, d: Blob) { await this.coreWorker.saveBlobToDb(h, d); }
await this.coreWorker.saveBlobToDb(h, d); public async getBlobFromDb(h: string) { return await this.coreWorker.getBlobFromDb(h); }
} public async fetchValueFromStorage(h: string) { return await this.coreWorker.fetchValueFromStorage(h); }
public async getBlobFromDb(h: string) { public async saveDataToStorage(s: string[], h: string, d: Blob, ttl: number | null) { return await this.coreWorker.saveDataToStorage(s, h, d, ttl); }
return await this.coreWorker.getBlobFromDb(h);
}
public async fetchValueFromStorage(h: string) {
return await this.coreWorker.fetchValueFromStorage(h);
}
public async saveDataToStorage(
s: string[],
h: string,
d: Blob,
ttl: number | null
) {
return await this.coreWorker.saveDataToStorage(s, h, d, ttl);
}
// ========================================== // ==========================================
// PROXY - HELPERS UI & DATA // PROXY - HELPERS UI & DATA
// ========================================== // ==========================================
public async getProcessName(p: Process) { public async getProcessName(p: Process) { return await this.coreWorker.getProcessName(p); }
return await this.coreWorker.getProcessName(p); public async getPublicData(p: Process) { return await this.coreWorker.getPublicData(p); }
} public async getNotifications() { return await this.coreWorker.getNotifications(); }
public async getPublicData(p: Process) { public async setNotifications(n: any[]) { await this.coreWorker.setNotifications(n); }
return await this.coreWorker.getPublicData(p);
}
public async getNotifications() {
return await this.coreWorker.getNotifications();
}
public async setNotifications(n: any[]) {
await this.coreWorker.setNotifications(n);
}
public async parseCipher(msg: string) { public async parseCipher(msg: string) { await this.coreWorker.parseCipher(msg); }
await this.coreWorker.parseCipher(msg); public async parseNewTx(msg: string) { await this.coreWorker.parseNewTx(msg); }
} public async updateMemberPublicName(pid: string, name: string) { return await this.coreWorker.updateMemberPublicName(pid, name); }
public async parseNewTx(msg: string) {
await this.coreWorker.parseNewTx(msg);
}
public async updateMemberPublicName(pid: string, name: string) {
return await this.coreWorker.updateMemberPublicName(pid, name);
}
// ========================================== // ==========================================
// PROXY - BACKUP & DECRYPT // PROXY - BACKUP & DECRYPT
// ========================================== // ==========================================
public async importJSON(b: BackUp) { public async importJSON(b: BackUp) { await this.coreWorker.importJSON(b); }
await this.coreWorker.importJSON(b); public async restoreSecretsFromBackUp(s: SecretsStore) { await this.coreWorker.restoreSecretsFromBackUp(s); }
} public async restoreSecretsFromDB() { await this.coreWorker.restoreSecretsFromDB(); }
public async restoreSecretsFromBackUp(s: SecretsStore) { public async createBackUp() { return await this.coreWorker.createBackUp(); }
await this.coreWorker.restoreSecretsFromBackUp(s);
}
public async restoreSecretsFromDB() {
await this.coreWorker.restoreSecretsFromDB();
}
public async createBackUp() {
return await this.coreWorker.createBackUp();
}
public async decryptAttribute(pid: string, s: ProcessState, attr: string) { public async decryptAttribute(pid: string, s: ProcessState, attr: string) { return await this.coreWorker.decryptAttribute(pid, s, attr); }
return await this.coreWorker.decryptAttribute(pid, s, attr); }
}
}