@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.
Files changed (45) hide show
  1. package/dist/app/resolution.cjs +4 -0
  2. package/dist/app/resolution.cjs.map +1 -1
  3. package/dist/app/resolution.es.js +4 -0
  4. package/dist/app/resolution.es.js.map +1 -1
  5. package/dist/index.cjs +4 -2
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.es.js +1 -0
  8. package/dist/index.es.js.map +1 -1
  9. package/dist/methods/index.cjs +1 -0
  10. package/dist/methods/index.cjs.map +1 -1
  11. package/dist/methods/index.es.js +1 -0
  12. package/dist/methods/index.es.js.map +1 -1
  13. package/dist/methods/role.cjs +165 -9
  14. package/dist/methods/role.cjs.map +1 -1
  15. package/dist/methods/role.es.js +166 -11
  16. package/dist/methods/role.es.js.map +1 -1
  17. package/dist/methods/systemGrant.cjs +11 -0
  18. package/dist/methods/systemGrant.cjs.map +1 -1
  19. package/dist/methods/systemGrant.es.js +11 -0
  20. package/dist/methods/systemGrant.es.js.map +1 -1
  21. package/dist/methods/user.cjs +10 -0
  22. package/dist/methods/user.cjs.map +1 -1
  23. package/dist/methods/user.es.js +10 -0
  24. package/dist/methods/user.es.js.map +1 -1
  25. package/dist/methods/userGroup.cjs +83 -9
  26. package/dist/methods/userGroup.cjs.map +1 -1
  27. package/dist/methods/userGroup.es.js +83 -9
  28. package/dist/methods/userGroup.es.js.map +1 -1
  29. package/dist/schema/role.cjs +1 -0
  30. package/dist/schema/role.cjs.map +1 -1
  31. package/dist/schema/role.es.js +1 -0
  32. package/dist/schema/role.es.js.map +1 -1
  33. package/dist/schema/user.cjs +1 -0
  34. package/dist/schema/user.cjs.map +1 -1
  35. package/dist/schema/user.es.js +1 -0
  36. package/dist/schema/user.es.js.map +1 -1
  37. package/dist/types/index.d.ts +1 -1
  38. package/dist/types/methods/index.d.ts +3 -2
  39. package/dist/types/methods/role.d.ts +19 -6
  40. package/dist/types/methods/systemGrant.d.ts +1 -0
  41. package/dist/types/methods/user.d.ts +1 -0
  42. package/dist/types/methods/userGroup.d.ts +14 -2
  43. package/dist/types/types/admin.d.ts +1 -1
  44. package/dist/types/types/role.d.ts +3 -0
  45. 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, unknown>, session?: ClientSession) => Promise<IGroup | null>;
33
- findGroupByExternalId: (idOnTheSource: string, source?: 'entra' | 'local', projection?: Record<string, unknown>, session?: ClientSession) => Promise<IGroup | null>;
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>;
@@ -87,7 +87,7 @@ export type AdminMember = {
87
87
  name: string;
88
88
  email: string;
89
89
  avatarUrl?: string;
90
- joinedAt: string;
90
+ joinedAt?: string;
91
91
  };
92
92
  /** Minimal user info returned by user search endpoints. */
93
93
  export type AdminUserSearchResult = {
@@ -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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@librechat/data-schemas",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "Mongoose schemas and models for LibreChat",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",