import { ObjectId } from "./datastructures/bson.cjs"; import { AuthorizationStruct, GroupStruct, ProfileStruct } from "./datastructures/types"; import { TimeSpecifier } from './genTimestamps'; import { Service } from "../../services/Service"; import { User } from '../../services/router/Router'; export declare const toObjectId: (str: any) => any; export declare const getStringId: (mongoid: string | ObjectId) => any; type CollectionsType = { [x: string]: CollectionType; }; type CollectionType = any | { instance?: any; reference: { [key: string]: any; }; }; export declare class StructBackend extends Service { name: string; debug: boolean; db: any; users: { [key: string]: User; }; collections: CollectionsType; mode: 'local' | 'mongo' | string; useAuths: boolean; useAccessTokens: boolean; useRefreshTokens: boolean; accessTokens: Map; refreshTokens: Map; constructor(options?: any, dboptions?: { users?: { [key: string]: User; }; mode?: 'local' | 'mongo' | string; db?: any; collections?: CollectionsType; useAuths?: boolean; debug?: boolean; useAccessTokens?: boolean; useRefreshTokens?: boolean; }); initDB: (dboptions: any) => void; query: (requestingUserId: string, collection?: any, queryObj?: any, findOne?: boolean, skip?: number, token?: string) => Promise; getUser: (requestingUserId: string, lookupId: string, basicInfo?: boolean, token?: string) => Promise; setUser: (requestingUserId: string, struct: Partial, token: string) => Promise; getUsersByIds: (requestingUserId: string, userIds: string[], basicInfo?: boolean) => Promise; getUsersByRole: (requestingUserId: string, role: string) => Promise; deleteUser: (requestingUserId: string, userId: string, deleteData?: boolean, token?: string) => Promise; setData: (requestingUserId: string, structs: any[], notify?: boolean, token?: string) => Promise; getData: (requestingUserId: string, collection?: string, ownerId?: string, dict?: any, limit?: number, skip?: number, token?: string) => Promise; getDataByIds: (requestingUserId: string, structIds: string[], ownerId?: string, collection?: string, token?: string) => Promise; getAllData: (requestingUserId: string, ownerId: string, excludedCollections?: string[], timeRange?: [number | TimeSpecifier, number | TimeSpecifier], token?: string) => Promise; deleteData: (requestingUserId: string, structIds: string[], token?: string) => Promise; getUserGroups: (requestingUserId: string, userId?: string, groupId?: string) => Promise; deleteGroup: (requestingUserId: string, groupId: string, token?: string) => Promise; getAuthorizations: (requestingUserId: string, ownerId?: string, authId?: string, token?: string) => Promise; deleteAuthorization: (requestingUserId: string, authId: string, token?: string) => Promise; getToken: (user: Partial) => string; notificationStruct: (parentStruct?: any) => { structType: string; timestamp: number; _id: string; note: string; alert: boolean; ownerId: string; parentUserId: string; parent: { structType: any; _id: any; }; }; checkToNotify: (user: Partial, structs?: any[], mode?: string) => Promise; queryMongo: (user: Partial, collection: string, queryObj?: any, findOne?: boolean, skip?: number, token?: string) => Promise; setMongoData: (user: Partial, structs?: any[], notify?: boolean, token?: string) => Promise; setMongoUser: (user: Partial, struct: Partial, token?: string) => Promise; setGroup: (user: Partial, struct: any, mode?: string, token?: string) => Promise; getMongoUser: (user: Partial, info?: string, requireAuth?: boolean, basicInfo?: boolean, token?: string) => Promise<{} | { user: ProfileStruct; authorizations: AuthorizationStruct[]; groups: GroupStruct[] | { user: ProfileStruct; }; }>; queryUsers: (user: Partial, info?: string, limit?: number, skip?: number, requireAuth?: boolean, token?: string) => Promise<{} | { user: ProfileStruct; authorizations: AuthorizationStruct[]; groups: GroupStruct[] | { user: ProfileStruct; }; }>; getMongoUsersByIds: (user: Partial, userIds?: any[], basicInfo?: boolean) => Promise; getMongoUsersByRole: (user: Partial, role: string) => Promise; getMongoDataByIds: (user: Partial, structIds: string[], ownerId: string | undefined, collection: string | undefined, token?: string) => Promise; getMongoData: (user: Partial, collection: string | undefined, ownerId: string | undefined, dict?: any | undefined, limit?: number, skip?: number, token?: string) => Promise; getAllUserMongoData: (user: Partial, ownerId: any, excluded?: any[], timeRange?: [number | TimeSpecifier, number | TimeSpecifier], token?: string) => Promise; getMongoDataByRefs: (user: Partial, structRefs?: any[], token?: string) => Promise; getMongoAuthorizations: (user: Partial, ownerId?: any, authId?: string, token?: string) => Promise; getMongoGroups: (user: Partial, userId?: any, groupId?: string) => Promise; deleteMongoData: (user: Partial, structRefs?: any[], token?: string) => Promise; deleteMongoUser: (user: Partial, userId: any, deleteData?: boolean, token?: string) => Promise; deleteMongoGroup: (user: Partial, groupId: any, token?: string) => Promise; deleteMongoAuthorization: (user: Partial, authId: any, token?: string) => Promise; setAuthorization: (user: Partial, authStruct: any, token?: string) => Promise; checkAuthorization: (user: string | Partial | { _id: string; }, struct: any, request?: string, token?: string) => Promise; wipeDB: () => Promise; overwriteLocalData: (structs: any) => void; setLocalData: (structs: any) => void; getLocalData: (collection: any, query?: any) => any; deleteLocalData: (struct: any) => boolean; } export {};