@librechat/data-schemas 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/resolution.cjs +4 -0
- package/dist/app/resolution.cjs.map +1 -1
- package/dist/app/resolution.es.js +4 -0
- package/dist/app/resolution.es.js.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +1 -0
- package/dist/index.es.js.map +1 -1
- package/dist/methods/index.cjs +1 -0
- package/dist/methods/index.cjs.map +1 -1
- package/dist/methods/index.es.js +1 -0
- package/dist/methods/index.es.js.map +1 -1
- package/dist/methods/role.cjs +165 -9
- package/dist/methods/role.cjs.map +1 -1
- package/dist/methods/role.es.js +166 -11
- package/dist/methods/role.es.js.map +1 -1
- package/dist/methods/systemGrant.cjs +11 -0
- package/dist/methods/systemGrant.cjs.map +1 -1
- package/dist/methods/systemGrant.es.js +11 -0
- package/dist/methods/systemGrant.es.js.map +1 -1
- package/dist/methods/user.cjs +10 -0
- package/dist/methods/user.cjs.map +1 -1
- package/dist/methods/user.es.js +10 -0
- package/dist/methods/user.es.js.map +1 -1
- package/dist/methods/userGroup.cjs +83 -9
- package/dist/methods/userGroup.cjs.map +1 -1
- package/dist/methods/userGroup.es.js +83 -9
- package/dist/methods/userGroup.es.js.map +1 -1
- package/dist/schema/role.cjs +1 -0
- package/dist/schema/role.cjs.map +1 -1
- package/dist/schema/role.es.js +1 -0
- package/dist/schema/role.es.js.map +1 -1
- package/dist/schema/user.cjs +1 -0
- package/dist/schema/user.cjs.map +1 -1
- package/dist/schema/user.es.js +1 -0
- package/dist/schema/user.es.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/methods/index.d.ts +3 -2
- package/dist/types/methods/role.d.ts +19 -6
- package/dist/types/methods/systemGrant.d.ts +1 -0
- package/dist/types/methods/user.d.ts +1 -0
- package/dist/types/methods/userGroup.d.ts +14 -2
- package/dist/types/types/admin.d.ts +1 -1
- package/dist/types/types/role.d.ts +3 -0
- package/package.json +1 -1
|
@@ -29,8 +29,8 @@ import type { TPrincipalSearchResult } from 'librechat-data-provider';
|
|
|
29
29
|
import type { ClientSession } from 'mongoose';
|
|
30
30
|
import type { IGroup, IUser } from '~/types';
|
|
31
31
|
export declare function createUserGroupMethods(mongoose: typeof import('mongoose')): {
|
|
32
|
-
findGroupById: (groupId: string | Types.ObjectId, projection?: Record<string,
|
|
33
|
-
findGroupByExternalId: (idOnTheSource: string, source?: 'entra' | 'local', projection?: Record<string,
|
|
32
|
+
findGroupById: (groupId: string | Types.ObjectId, projection?: Record<string, 0 | 1>, session?: ClientSession) => Promise<IGroup | null>;
|
|
33
|
+
findGroupByExternalId: (idOnTheSource: string, source?: 'entra' | 'local', projection?: Record<string, 0 | 1>, session?: ClientSession) => Promise<IGroup | null>;
|
|
34
34
|
findGroupsByNamePattern: (namePattern: string, source?: 'entra' | 'local' | null, limit?: number, session?: ClientSession) => Promise<IGroup[]>;
|
|
35
35
|
findGroupsByMemberId: (userId: string | Types.ObjectId, session?: ClientSession) => Promise<IGroup[]>;
|
|
36
36
|
createGroup: (groupData: Partial<IGroup>, session?: ClientSession) => Promise<IGroup>;
|
|
@@ -75,5 +75,17 @@ export declare function createUserGroupMethods(mongoose: typeof import('mongoose
|
|
|
75
75
|
name?: string | undefined;
|
|
76
76
|
email?: string | undefined;
|
|
77
77
|
}>(results: T[]) => T[];
|
|
78
|
+
listGroups: (filter?: {
|
|
79
|
+
source?: 'local' | 'entra';
|
|
80
|
+
search?: string;
|
|
81
|
+
limit?: number;
|
|
82
|
+
offset?: number;
|
|
83
|
+
}, session?: ClientSession) => Promise<IGroup[]>;
|
|
84
|
+
countGroups: (filter?: {
|
|
85
|
+
source?: 'local' | 'entra';
|
|
86
|
+
search?: string;
|
|
87
|
+
}, session?: ClientSession) => Promise<number>;
|
|
88
|
+
deleteGroup: (groupId: string | Types.ObjectId, session?: ClientSession) => Promise<IGroup | null>;
|
|
89
|
+
removeMemberById: (groupId: string | Types.ObjectId, memberId: string, session?: ClientSession) => Promise<IGroup | null>;
|
|
78
90
|
};
|
|
79
91
|
export type UserGroupMethods = ReturnType<typeof createUserGroupMethods>;
|
|
@@ -28,6 +28,7 @@ import type { Document } from 'mongoose';
|
|
|
28
28
|
import { CursorPaginationParams } from '~/common';
|
|
29
29
|
export interface IRole extends Document {
|
|
30
30
|
name: string;
|
|
31
|
+
description?: string;
|
|
31
32
|
permissions: {};
|
|
32
33
|
tenantId?: string;
|
|
33
34
|
}
|
|
@@ -35,10 +36,12 @@ export type RolePermissions = IRole['permissions'];
|
|
|
35
36
|
export type RolePermissionsInput = DeepPartial<RolePermissions>;
|
|
36
37
|
export interface CreateRoleRequest {
|
|
37
38
|
name: string;
|
|
39
|
+
description?: string;
|
|
38
40
|
permissions: RolePermissionsInput;
|
|
39
41
|
}
|
|
40
42
|
export interface UpdateRoleRequest {
|
|
41
43
|
name?: string;
|
|
44
|
+
description?: string;
|
|
42
45
|
permissions?: RolePermissionsInput;
|
|
43
46
|
}
|
|
44
47
|
export interface RoleFilterOptions extends CursorPaginationParams {
|