From ae54610a86dc0f07c4beb025f31e1db2aab1715d Mon Sep 17 00:00:00 2001 From: "Robert St. John" Date: Sat, 30 Nov 2024 23:24:33 -0700 Subject: [PATCH] refactor(service): users/auth: role database type changes --- service/src/models/role.d.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/service/src/models/role.d.ts b/service/src/models/role.d.ts index f6784fa6a..b5f6a4bf7 100644 --- a/service/src/models/role.d.ts +++ b/service/src/models/role.d.ts @@ -1,20 +1,22 @@ - +import mongoose from 'mongoose' import { AnyPermission } from '../entities/authorization/entities.permissions' type Callback = (err: any, result?: R) => any export declare interface RoleDocument { - id: string + _id: mongoose.Types.ObjectId name: string description?: string permissions: AnyPermission[] } +export type RoleModelInstance = mongoose.HydratedDocument + export declare type RoleJson = Omit -export declare function getRoleById(id: string, callback: Callback): void -export declare function getRole(name: string, callback: Callback): void -export declare function getRoles(callback: Callback): void -export declare function createRole(role: RoleDocument, callback: Callback): void -export declare function updateRole(id: string, update: Partial, callback: Callback): void -export declare function deleteRole(role: RoleDocument, callback: Callback): void +export declare function getRoleById(id: string, callback: Callback): void +export declare function getRole(name: string, callback: Callback): void +export declare function getRoles(callback: Callback): void +export declare function createRole(role: Omit, callback: Callback): void +export declare function updateRole(id: string, update: Partial, callback: Callback): void +export declare function deleteRole(role: RoleModelInstance, callback: Callback): void