UNPKG

@brontosaurus/db

Version:
83 lines (82 loc) 9.58 kB
import { Basics } from "@brontosaurus/definition"; import { ObjectID } from "bson"; import { IAccount } from "../interface/account"; import { IAccountModel } from "../model/account"; export declare const createOnLimboUnsavedAccount: (username: string, password: string, namespace: ObjectID, displayName?: string | undefined, email?: string | undefined, phone?: string | undefined, organization?: ObjectID | undefined, groups?: ObjectID[], infos?: Record<string, Basics>, beacons?: Record<string, Basics>, tags?: ObjectID[]) => IAccountModel; export declare const createUnsavedAccount: (username: string, password: string, namespace: ObjectID, displayName?: string | undefined, email?: string | undefined, phone?: string | undefined, organization?: ObjectID | undefined, groups?: ObjectID[], infos?: Record<string, Basics>, beacons?: Record<string, Basics>, tags?: ObjectID[]) => IAccountModel; export declare const getAccountsByOrganization: (organization: string | ObjectID) => Promise<IAccountModel[]>; export declare const getAccountsByOrganizationAndPage: (organization: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByOrganizationLean: (organization: string | ObjectID) => Promise<IAccount[]>; export declare const getAccountsByOrganizationAndPageLean: (organization: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByOrganizationPages: (organization: ObjectID | string, limit: number) => Promise<number>; export declare const getAccountsByGroup: (group: string | ObjectID) => Promise<IAccountModel[]>; export declare const getAccountsByGroupAndPage: (group: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByGroupLean: (group: string | ObjectID) => Promise<IAccount[]>; export declare const getAccountsByGroupAndPageLean: (group: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByGroupPages: (group: ObjectID | string, limit: number) => Promise<number>; export declare const getAccountsByTag: (tag: string | ObjectID) => Promise<IAccountModel[]>; export declare const getAccountsByTagAndPage: (tag: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByTagLean: (tag: string | ObjectID) => Promise<IAccount[]>; export declare const getAccountsByTagAndPageLean: (tag: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByTagPages: (tag: ObjectID | string, limit: number) => Promise<number>; export declare const getAccountsByNamespace: (namespace: string | ObjectID) => Promise<IAccountModel[]>; export declare const getAccountsByNamespaceAndPage: (namespace: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByNamespaceLean: (namespace: string | ObjectID) => Promise<IAccount[]>; export declare const getAccountsByNamespaceAndPageLean: (namespace: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByNamespacePages: (namespace: ObjectID | string, limit: number) => Promise<number>; export declare const getAccountsByDecorator: (decorator: string | ObjectID) => Promise<IAccountModel[]>; export declare const getAccountsByDecoratorAndPage: (decorator: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByDecoratorLean: (decorator: string | ObjectID) => Promise<IAccount[]>; export declare const getAccountsByDecoratorAndPageLean: (decorator: string | ObjectID, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByDecoratorPages: (decorator: ObjectID | string, limit: number) => Promise<number>; export declare const getActiveAccountsByGroups: (groups: Array<string | ObjectID>) => Promise<IAccountModel[]>; export declare const getActiveAccountsByGroupsLean: (groups: Array<string | ObjectID>) => Promise<IAccount[]>; export declare const getAccountsByGroups: (groups: Array<string | ObjectID>) => Promise<IAccountModel[]>; export declare const getAccountsByGroupsLean: (groups: Array<string | ObjectID>) => Promise<IAccount[]>; export declare const getAccountByUsernameAndNamespace: (username: string, namespace: ObjectID) => Promise<IAccountModel | null>; export declare const getAccountByUsernameAndNamespaceLean: (username: string, namespace: ObjectID) => Promise<IAccount | null>; export declare const getActiveAccountByUsernameAndNamespace: (username: string, namespace: ObjectID) => Promise<IAccountModel | null>; export declare const getActiveAccountByUsernameAndNamespaceLean: (username: string, namespace: ObjectID) => Promise<IAccount | null>; export declare const getAllAccounts: () => Promise<IAccountModel[]>; export declare const getAllAccountsLean: () => Promise<IAccount[]>; export declare const getAccountById: (id: ObjectID | string) => Promise<IAccountModel | null>; export declare const getAccountByIdLean: (id: ObjectID | string) => Promise<IAccount | null>; export declare const getTotalAccountPages: (limit: number) => Promise<number>; export declare const getSelectedActiveAccountPages: (limit: number, keyword?: string | undefined) => Promise<number>; export declare const getSelectedAccountPages: (limit: number, keyword?: string | undefined) => Promise<number>; export declare const getTotalActiveAccountPages: (limit: number) => Promise<number>; export declare const getActiveAccountsByTags: (tags: Array<string | ObjectID>) => Promise<IAccountModel[]>; export declare const getActiveAccountsByTagsLean: (tags: Array<string | ObjectID>) => Promise<IAccount[]>; export declare const getAccountsByTags: (tags: Array<string | ObjectID>) => Promise<IAccountModel[]>; export declare const getAccountsByTagsLean: (tags: Array<string | ObjectID>) => Promise<IAccount[]>; export declare const getActiveAccountPagesByKeyword: (limit: number, keyword: string) => Promise<number>; export declare const getAccountPagesByKeyword: (limit: number, keyword: string) => Promise<number>; export declare const getStandaloneAcitveAccountPagesByKeyword: (limit: number, keyword: string) => Promise<number>; export declare const getStandaloneActiveAccountsByPage: (keyword: string, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getStandaloneActiveAccountsByPageLean: (keyword: string, limit: number, page: number) => Promise<IAccount[]>; export declare const getSelectedActiveAccountsByPage: (limit: number, page: number, keyword?: string | undefined) => Promise<IAccountModel[]>; export declare const getSelectedActiveAccountsByPageLean: (limit: number, page: number, keyword?: string | undefined) => Promise<IAccount[]>; export declare const getSelectedAccountsByPage: (limit: number, page: number, keyword?: string | undefined) => Promise<IAccountModel[]>; export declare const getSelectedAccountsByPageLean: (limit: number, page: number, keyword?: string | undefined) => Promise<IAccount[]>; export declare const getActiveAccountsByPage: (keyword: string, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getActiveAccountsByPageLean: (keyword: string, limit: number, page: number) => Promise<IAccount[]>; export declare const getAccountsByPage: (keyword: string, limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAccountsByPageLean: (keyword: string, limit: number, page: number) => Promise<IAccount[]>; export declare const getAllActiveAccountsByPage: (limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAllActiveAccountsByPageLean: (limit: number, page: number) => Promise<IAccount[]>; export declare const getAllAccountsByPage: (limit: number, page: number) => Promise<IAccountModel[]>; export declare const getAllAccountsByPageLean: (limit: number, page: number) => Promise<IAccount[]>; export declare const isAccountDuplicatedByUsernameAndNamespace: (username: string, namespace: ObjectID) => Promise<boolean>; export declare const resetAccountPassword: (username: string, namespace: ObjectID, newPassword: string) => Promise<IAccountModel | null>; export declare const getAccountCountByOrganization: (organizationId: ObjectID) => Promise<number>; export declare const getActiveAccountByGroupAndOrganization: (group: ObjectID, organization: ObjectID) => Promise<IAccountModel[]>; export declare const getActiveAccountByGroupAndOrganizationLean: (group: ObjectID, organization: ObjectID) => Promise<IAccount[]>; export declare const getActiveAccountCountByGroup: (group: ObjectID) => Promise<number>; export declare const getActiveAccountsByGroup: (group: ObjectID) => Promise<IAccountModel[]>; export declare const getActiveAccountsByGroupLean: (group: ObjectID) => Promise<IAccount[]>; export declare const getAccountsByQuery: (query: Record<string, any>) => Promise<IAccountModel[]>; export declare const getAccountsByQueryLean: (query: Record<string, any>) => Promise<IAccount[]>; export declare const getAccountsByUsernames: (usernames: string[]) => Promise<IAccountModel[]>; export declare const getAccountsByUsernamesLean: (usernames: string[]) => Promise<IAccount[]>; export declare const getAccountsByIds: (ids: string[] | ObjectID[]) => Promise<IAccountModel[]>; export declare const getAccountsByIdsLean: (ids: string[] | ObjectID[]) => Promise<IAccount[]>;