UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

34 lines (33 loc) 1.22 kB
import type { Connection, FilterQuery } from 'mongoose'; import * as factory from '../factory'; import { IDocType } from './mongoose/schemas/role'; type IRole = IDocType; type IKeyOfProjection = keyof IDocType; /** * IAMロールリポジトリ */ export declare class RoleRepo { private readonly roleModel; constructor(connection: Connection); static CREATE_MONGO_CONDITIONS(params: factory.role.organizationRole.ISearchConditions): FilterQuery<IDocType>[]; projectFields(params: factory.role.organizationRole.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IRole[]>; aggregatePermissions(params: { roleName: { $in: string[]; }; }): Promise<{ _id: string; }[]>; addPermissionIfNotExists(params: { roleName: { $eq: factory.role.organizationRole.RoleName; }; permission: string; }): Promise<(import("mongoose").FlattenMaps<IDocType> & { _id: import("mongoose").Types.ObjectId; }) | null>; addMember(params: Pick<IRole, 'member' | 'memberOf' | 'roleName'>): Promise<(import("mongoose").FlattenMaps<IDocType> & { _id: import("mongoose").Types.ObjectId; }) | null>; } export {};