You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/data/configDump/configDump.ts

28 lines
1.1 KiB
TypeScript

import { GroupPubkeyType } from 'libsession_util_nodejs';
import { AsyncObjectWrapper, ConfigDumpDataNode, ConfigDumpRow } from '../../types/sqlSharedTypes';
// eslint-disable-next-line import/no-unresolved, import/extensions
import { ConfigWrapperObjectTypesMeta } from '../../webworker/workers/browser/libsession_worker_functions';
import { channels } from '../channels';
import { cleanData } from '../dataUtils';
export const ConfigDumpData: AsyncObjectWrapper<ConfigDumpDataNode> = {
getByVariantAndPubkey: (variant: ConfigWrapperObjectTypesMeta, pubkey: string) => {
return channels.getByVariantAndPubkey(variant, pubkey);
},
saveConfigDump: (dump: ConfigDumpRow) => {
return channels.saveConfigDump(cleanData(dump));
},
getAllDumpsWithData: () => {
return channels.getAllDumpsWithData();
},
getAllDumpsWithoutData: () => {
return channels.getAllDumpsWithoutData();
},
getAllDumpsWithoutDataFor: (pk: string) => {
return channels.getAllDumpsWithoutDataFor(pk);
},
deleteDumpFor: (pk: GroupPubkeyType) => {
return channels.deleteDumpFor(pk);
},
};