@librechat/data-schemas 0.0.39 → 0.0.42
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/index.cjs +4810 -284
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +4783 -283
- package/dist/index.es.js.map +1 -1
- package/dist/types/admin/capabilities.d.ts +71 -0
- package/dist/types/admin/index.d.ts +1 -0
- package/dist/types/app/index.d.ts +1 -0
- package/dist/types/app/resolution.d.ts +13 -0
- package/dist/types/config/tenantContext.d.ts +20 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/methods/aclEntry.d.ts +10 -1
- package/dist/types/methods/action.d.ts +34 -0
- package/dist/types/methods/agent.d.ts +89 -0
- package/dist/types/methods/assistant.d.ts +39 -0
- package/dist/types/methods/banner.d.ts +31 -0
- package/dist/types/methods/categories.d.ts +34 -0
- package/dist/types/methods/config.d.ts +39 -0
- package/dist/types/methods/conversation.d.ts +82 -0
- package/dist/types/methods/conversationTag.d.ts +93 -0
- package/dist/types/methods/index.d.ts +35 -4
- package/dist/types/methods/memory.d.ts +1 -0
- package/dist/types/methods/message.d.ts +77 -0
- package/dist/types/methods/preset.d.ts +88 -0
- package/dist/types/methods/prompt.d.ts +410 -0
- package/dist/types/methods/role.d.ts +13 -1
- package/dist/types/methods/spendTokens.d.ts +63 -0
- package/dist/types/methods/systemGrant.d.ts +59 -0
- package/dist/types/methods/test-helpers.d.ts +18 -0
- package/dist/types/methods/toolCall.d.ts +82 -0
- package/dist/types/methods/transaction.d.ts +67 -13
- package/dist/types/methods/tx.d.ts +108 -0
- package/dist/types/methods/userGroup.d.ts +6 -0
- package/dist/types/migrations/index.d.ts +1 -0
- package/dist/types/migrations/tenantIndexes.d.ts +52 -0
- package/dist/types/models/accessRole.d.ts +0 -3
- package/dist/types/models/aclEntry.d.ts +0 -3
- package/dist/types/models/action.d.ts +0 -3
- package/dist/types/models/agent.d.ts +0 -3
- package/dist/types/models/agentCategory.d.ts +0 -3
- package/dist/types/models/assistant.d.ts +0 -3
- package/dist/types/models/balance.d.ts +0 -3
- package/dist/types/models/banner.d.ts +0 -3
- package/dist/types/models/{project.d.ts → config.d.ts} +1 -4
- package/dist/types/models/conversationTag.d.ts +0 -3
- package/dist/types/models/convo.d.ts +0 -3
- package/dist/types/models/file.d.ts +0 -3
- package/dist/types/models/group.d.ts +0 -3
- package/dist/types/models/index.d.ts +2 -1
- package/dist/types/models/key.d.ts +0 -3
- package/dist/types/models/mcpServer.d.ts +0 -3
- package/dist/types/models/message.d.ts +0 -3
- package/dist/types/models/pluginAuth.d.ts +0 -3
- package/dist/types/models/plugins/tenantIsolation.d.ts +38 -0
- package/dist/types/models/preset.d.ts +0 -3
- package/dist/types/models/prompt.d.ts +0 -3
- package/dist/types/models/promptGroup.d.ts +0 -3
- package/dist/types/models/role.d.ts +0 -3
- package/dist/types/models/session.d.ts +0 -3
- package/dist/types/models/sharedLink.d.ts +0 -3
- package/dist/types/models/systemGrant.d.ts +33 -0
- package/dist/types/models/token.d.ts +0 -3
- package/dist/types/models/toolCall.d.ts +0 -3
- package/dist/types/models/transaction.d.ts +0 -3
- package/dist/types/models/user.d.ts +0 -3
- package/dist/types/schema/agentApiKey.d.ts +1 -0
- package/dist/types/schema/banner.d.ts +1 -0
- package/dist/types/schema/categories.d.ts +1 -0
- package/dist/types/schema/{project.d.ts → config.d.ts} +9 -13
- package/dist/types/schema/conversationTag.d.ts +1 -0
- package/dist/types/schema/index.d.ts +2 -1
- package/dist/types/schema/key.d.ts +1 -0
- package/dist/types/schema/preset.d.ts +1 -0
- package/dist/types/schema/share.d.ts +1 -0
- package/dist/types/schema/systemGrant.d.ts +39 -0
- package/dist/types/schema/toolCall.d.ts +1 -0
- package/dist/types/schema/transaction.d.ts +1 -0
- package/dist/types/types/accessRole.d.ts +1 -0
- package/dist/types/types/aclEntry.d.ts +1 -0
- package/dist/types/types/action.d.ts +1 -0
- package/dist/types/types/admin.d.ts +98 -0
- package/dist/types/types/agent.d.ts +3 -5
- package/dist/types/types/agentApiKey.d.ts +1 -0
- package/dist/types/types/agentCategory.d.ts +1 -0
- package/dist/types/types/app.d.ts +3 -1
- package/dist/types/types/assistant.d.ts +1 -0
- package/dist/types/types/balance.d.ts +11 -0
- package/dist/types/types/banner.d.ts +1 -0
- package/dist/types/types/config.d.ts +58 -0
- package/dist/types/types/convo.d.ts +1 -0
- package/dist/types/types/file.d.ts +1 -0
- package/dist/types/types/group.d.ts +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/mcp.d.ts +1 -0
- package/dist/types/types/memory.d.ts +1 -0
- package/dist/types/types/message.d.ts +7 -2
- package/dist/types/types/pluginAuth.d.ts +1 -0
- package/dist/types/types/prompts.d.ts +2 -1
- package/dist/types/types/role.d.ts +1 -0
- package/dist/types/types/session.d.ts +1 -0
- package/dist/types/types/systemGrant.d.ts +47 -0
- package/dist/types/types/token.d.ts +2 -0
- package/dist/types/types/user.d.ts +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/principal.d.ts +34 -0
- package/dist/types/utils/retry.d.ts +41 -0
- package/dist/types/utils/string.d.ts +4 -0
- package/dist/types/utils/tempChatRetention.d.ts +25 -0
- package/package.json +1 -1
- package/dist/types/app/web.spec.d.ts +0 -1
- package/dist/types/methods/accessRole.spec.d.ts +0 -1
- package/dist/types/methods/aclEntry.spec.d.ts +0 -1
- package/dist/types/methods/file.spec.d.ts +0 -1
- package/dist/types/methods/mcpServer.spec.d.ts +0 -1
- package/dist/types/methods/token.spec.d.ts +0 -1
- package/dist/types/methods/user.methods.spec.d.ts +0 -1
- package/dist/types/methods/userGroup.methods.spec.d.ts +0 -1
- package/dist/types/methods/userGroup.roles.spec.d.ts +0 -1
- package/dist/types/methods/userGroup.spec.d.ts +0 -1
- package/dist/types/models/plugins/mongoMeili.spec.d.ts +0 -1
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Group model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createGroupModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -43,7 +43,6 @@ export declare function createModels(mongoose: typeof import('mongoose')): {
|
|
|
43
43
|
Assistant: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
44
44
|
File: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
45
45
|
Banner: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
46
|
-
Project: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
47
46
|
Key: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
48
47
|
PluginAuth: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
49
48
|
Transaction: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -56,5 +55,7 @@ export declare function createModels(mongoose: typeof import('mongoose')): {
|
|
|
56
55
|
MemoryEntry: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
57
56
|
AccessRole: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
58
57
|
AclEntry: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
58
|
+
SystemGrant: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
59
59
|
Group: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
60
|
+
Config: import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
60
61
|
};
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Key model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createKeyModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the MCPServer model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createMCPServerModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Message model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createMessageModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the PluginAuth model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createPluginAuthModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
+
import type { Schema } from 'mongoose';
|
|
27
|
+
/** Resets the cached strict-mode flag. Exposed for test teardown only. */
|
|
28
|
+
export declare function _resetStrictCache(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Mongoose schema plugin that enforces tenant-level data isolation.
|
|
31
|
+
*
|
|
32
|
+
* - `tenantId` present in async context -> injected into every query filter.
|
|
33
|
+
* - `tenantId` is `SYSTEM_TENANT_ID` -> skips injection (explicit cross-tenant op).
|
|
34
|
+
* - `tenantId` absent + `TENANT_ISOLATION_STRICT=true` -> throws (fail-closed).
|
|
35
|
+
* - `tenantId` absent + strict mode off -> passes through (transitional/pre-tenancy).
|
|
36
|
+
* - Update and replace operations that modify `tenantId` are blocked unless running as system.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyTenantIsolation(schema: Schema): void;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Preset model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createPresetModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Prompt model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createPromptModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the PromptGroup model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createPromptGroupModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Role model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createRoleModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Session model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createSessionModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the SharedLink model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createSharedLinkModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
+
/**
|
|
28
|
+
* SystemGrant is a cross-tenant control plane — its query logic in systemGrant methods
|
|
29
|
+
* explicitly handles tenantId conditions (platform-level vs tenant-scoped grants).
|
|
30
|
+
* Do NOT apply tenant isolation plugin here; it would inject a hard tenantId equality
|
|
31
|
+
* filter that conflicts with the $and/$or logic in hasCapabilityForPrincipals.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createSystemGrantModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Token model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createTokenModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the ToolCall model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createToolCallModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the Transaction model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createTransactionModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -24,7 +24,4 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
/**
|
|
28
|
-
* Creates or returns the User model using the provided mongoose instance and schema
|
|
29
|
-
*/
|
|
30
27
|
export declare function createUserModel(mongoose: typeof import('mongoose')): import("mongoose").Model<any, {}, {}, {}, any, any>;
|
|
@@ -32,6 +32,7 @@ export interface IBanner extends Document {
|
|
|
32
32
|
type: 'banner' | 'popup';
|
|
33
33
|
isPublic: boolean;
|
|
34
34
|
persistable: boolean;
|
|
35
|
+
tenantId?: string;
|
|
35
36
|
}
|
|
36
37
|
declare const bannerSchema: Schema<IBanner, import("mongoose").Model<IBanner, any, any, any, Document<unknown, any, IBanner> & IBanner & Required<{
|
|
37
38
|
_id: unknown;
|
|
@@ -27,6 +27,7 @@ import { Schema, Document } from 'mongoose';
|
|
|
27
27
|
export interface ICategory extends Document {
|
|
28
28
|
label: string;
|
|
29
29
|
value: string;
|
|
30
|
+
tenantId?: string;
|
|
30
31
|
}
|
|
31
32
|
declare const categoriesSchema: Schema<ICategory, import("mongoose").Model<ICategory, any, any, any, Document<unknown, any, ICategory> & ICategory & Required<{
|
|
32
33
|
_id: unknown;
|
|
@@ -23,21 +23,17 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
-
import { Schema
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
updatedAt?: Date;
|
|
33
|
-
}
|
|
34
|
-
declare const projectSchema: Schema<IMongoProject, import("mongoose").Model<IMongoProject, any, any, any, Document<unknown, any, IMongoProject> & IMongoProject & Required<{
|
|
35
|
-
_id: unknown;
|
|
26
|
+
import { Schema } from 'mongoose';
|
|
27
|
+
import type { IConfig } from '~/types';
|
|
28
|
+
declare const configSchema: Schema<IConfig, import("mongoose").Model<IConfig, any, any, any, import("mongoose").Document<unknown, any, IConfig> & import("~/types").Config & import("mongoose").Document<unknown, any, any> & {
|
|
29
|
+
_id: import("mongoose").Types.ObjectId;
|
|
30
|
+
} & Required<{
|
|
31
|
+
_id: import("mongoose").Types.ObjectId;
|
|
36
32
|
}> & {
|
|
37
33
|
__v: number;
|
|
38
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions,
|
|
39
|
-
_id:
|
|
34
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IConfig, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<IConfig>> & import("mongoose").FlatRecord<IConfig> & Required<{
|
|
35
|
+
_id: import("mongoose").Types.ObjectId;
|
|
40
36
|
}> & {
|
|
41
37
|
__v: number;
|
|
42
38
|
}>;
|
|
43
|
-
export default
|
|
39
|
+
export default configSchema;
|
|
@@ -30,6 +30,7 @@ export interface IConversationTag extends Document {
|
|
|
30
30
|
description?: string;
|
|
31
31
|
count?: number;
|
|
32
32
|
position?: number;
|
|
33
|
+
tenantId?: string;
|
|
33
34
|
}
|
|
34
35
|
declare const conversationTag: Schema<IConversationTag, import("mongoose").Model<IConversationTag, any, any, any, Document<unknown, any, IConversationTag> & IConversationTag & Required<{
|
|
35
36
|
_id: unknown;
|
|
@@ -13,7 +13,6 @@ export { default as keySchema } from './key';
|
|
|
13
13
|
export { default as messageSchema } from './message';
|
|
14
14
|
export { default as pluginAuthSchema } from './pluginAuth';
|
|
15
15
|
export { default as presetSchema } from './preset';
|
|
16
|
-
export { default as projectSchema } from './project';
|
|
17
16
|
export { default as promptSchema } from './prompt';
|
|
18
17
|
export { default as promptGroupSchema } from './promptGroup';
|
|
19
18
|
export { default as roleSchema } from './role';
|
|
@@ -25,3 +24,5 @@ export { default as transactionSchema } from './transaction';
|
|
|
25
24
|
export { default as userSchema } from './user';
|
|
26
25
|
export { default as memorySchema } from './memory';
|
|
27
26
|
export { default as groupSchema } from './group';
|
|
27
|
+
export { default as systemGrantSchema } from './systemGrant';
|
|
28
|
+
export { default as configSchema } from './config';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
|
+
import { Schema } from 'mongoose';
|
|
27
|
+
import type { ISystemGrant } from '~/types';
|
|
28
|
+
declare const systemGrantSchema: Schema<ISystemGrant, import("mongoose").Model<ISystemGrant, any, any, any, import("mongoose").Document<unknown, any, ISystemGrant> & import("~/types").SystemGrant & import("mongoose").Document<unknown, any, any> & {
|
|
29
|
+
_id: import("mongoose").Types.ObjectId;
|
|
30
|
+
} & Required<{
|
|
31
|
+
_id: import("mongoose").Types.ObjectId;
|
|
32
|
+
}> & {
|
|
33
|
+
__v: number;
|
|
34
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ISystemGrant, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ISystemGrant>> & import("mongoose").FlatRecord<ISystemGrant> & Required<{
|
|
35
|
+
_id: import("mongoose").Types.ObjectId;
|
|
36
|
+
}> & {
|
|
37
|
+
__v: number;
|
|
38
|
+
}>;
|
|
39
|
+
export default systemGrantSchema;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { PrincipalType, PrincipalModel, TCustomConfig, z, configSchema } from 'librechat-data-provider';
|
|
2
|
+
/** Base capabilities defined in the SystemCapabilities object. */
|
|
3
|
+
export type BaseSystemCapability = 'access:admin' | 'read:users' | 'manage:users' | 'read:groups' | 'manage:groups' | 'read:roles' | 'manage:roles' | 'read:configs' | 'manage:configs' | 'assign:configs' | 'read:usage' | 'read:agents' | 'manage:agents' | 'manage:mcpservers' | 'read:prompts' | 'manage:prompts' | 'read:assistants' | 'manage:assistants';
|
|
4
|
+
/** Principal types that can receive config overrides. */
|
|
5
|
+
export type ConfigAssignTarget = 'user' | 'group' | 'role';
|
|
6
|
+
/** Top-level keys of the configSchema from librechat.yaml. */
|
|
7
|
+
export type ConfigSection = keyof z.infer<typeof configSchema>;
|
|
8
|
+
/** Section-level config capabilities derived from configSchema keys. */
|
|
9
|
+
type ConfigSectionCapability = `manage:configs:${ConfigSection}` | `read:configs:${ConfigSection}`;
|
|
10
|
+
/** Principal-scoped config assignment capabilities. */
|
|
11
|
+
type ConfigAssignCapability = `assign:configs:${ConfigAssignTarget}`;
|
|
12
|
+
/**
|
|
13
|
+
* Union of all valid capability strings:
|
|
14
|
+
* - Base capabilities from SystemCapabilities
|
|
15
|
+
* - Section-level config capabilities (manage:configs:<section>, read:configs:<section>)
|
|
16
|
+
* - Config assignment capabilities (assign:configs:<user|group|role>)
|
|
17
|
+
*/
|
|
18
|
+
export type SystemCapability = BaseSystemCapability | ConfigSectionCapability | ConfigAssignCapability;
|
|
19
|
+
/** UI grouping of capabilities for the admin panel's capability editor. */
|
|
20
|
+
export type CapabilityCategory = {
|
|
21
|
+
key: string;
|
|
22
|
+
labelKey: string;
|
|
23
|
+
capabilities: BaseSystemCapability[];
|
|
24
|
+
};
|
|
25
|
+
/** Config document as returned by the admin API (no Mongoose internals). */
|
|
26
|
+
export type AdminConfig = {
|
|
27
|
+
_id: string;
|
|
28
|
+
principalType: PrincipalType;
|
|
29
|
+
principalId: string;
|
|
30
|
+
principalModel: PrincipalModel;
|
|
31
|
+
priority: number;
|
|
32
|
+
overrides: Partial<TCustomConfig>;
|
|
33
|
+
isActive: boolean;
|
|
34
|
+
configVersion: number;
|
|
35
|
+
tenantId?: string;
|
|
36
|
+
createdAt?: string;
|
|
37
|
+
updatedAt?: string;
|
|
38
|
+
};
|
|
39
|
+
export type AdminConfigListResponse = {
|
|
40
|
+
configs: AdminConfig[];
|
|
41
|
+
};
|
|
42
|
+
export type AdminConfigResponse = {
|
|
43
|
+
config: AdminConfig;
|
|
44
|
+
};
|
|
45
|
+
export type AdminConfigDeleteResponse = {
|
|
46
|
+
success: boolean;
|
|
47
|
+
};
|
|
48
|
+
/** Audit action types for grant changes. */
|
|
49
|
+
export type AuditAction = 'grant_assigned' | 'grant_removed';
|
|
50
|
+
/** SystemGrant document as returned by the admin API. */
|
|
51
|
+
export type AdminSystemGrant = {
|
|
52
|
+
id: string;
|
|
53
|
+
principalType: PrincipalType;
|
|
54
|
+
principalId: string;
|
|
55
|
+
capability: string;
|
|
56
|
+
grantedBy?: string;
|
|
57
|
+
grantedAt: string;
|
|
58
|
+
expiresAt?: string;
|
|
59
|
+
};
|
|
60
|
+
/** Audit log entry for grant changes as returned by the admin API. */
|
|
61
|
+
export type AdminAuditLogEntry = {
|
|
62
|
+
id: string;
|
|
63
|
+
action: AuditAction;
|
|
64
|
+
actorId: string;
|
|
65
|
+
actorName: string;
|
|
66
|
+
targetPrincipalType: PrincipalType;
|
|
67
|
+
targetPrincipalId: string;
|
|
68
|
+
targetName: string;
|
|
69
|
+
capability: string;
|
|
70
|
+
timestamp: string;
|
|
71
|
+
};
|
|
72
|
+
/** Group as returned by the admin API. */
|
|
73
|
+
export type AdminGroup = {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
description: string;
|
|
77
|
+
memberCount: number;
|
|
78
|
+
topMembers: {
|
|
79
|
+
name: string;
|
|
80
|
+
}[];
|
|
81
|
+
isActive: boolean;
|
|
82
|
+
};
|
|
83
|
+
/** Member entry as returned by the admin API for group/role membership lists. */
|
|
84
|
+
export type AdminMember = {
|
|
85
|
+
userId: string;
|
|
86
|
+
name: string;
|
|
87
|
+
email: string;
|
|
88
|
+
avatarUrl?: string;
|
|
89
|
+
joinedAt: string;
|
|
90
|
+
};
|
|
91
|
+
/** Minimal user info returned by user search endpoints. */
|
|
92
|
+
export type AdminUserSearchResult = {
|
|
93
|
+
userId: string;
|
|
94
|
+
name: string;
|
|
95
|
+
email: string;
|
|
96
|
+
avatarUrl?: string;
|
|
97
|
+
};
|
|
98
|
+
export {};
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { Document, Types } from 'mongoose';
|
|
27
|
-
import type { GraphEdge, AgentToolOptions } from 'librechat-data-provider';
|
|
27
|
+
import type { GraphEdge, AgentToolOptions, AgentToolResources } from 'librechat-data-provider';
|
|
28
28
|
export interface ISupportContact {
|
|
29
29
|
name?: string;
|
|
30
30
|
email?: string;
|
|
@@ -54,11 +54,8 @@ export interface IAgent extends Omit<Document, 'model'> {
|
|
|
54
54
|
/** @deprecated Use edges instead */
|
|
55
55
|
agent_ids?: string[];
|
|
56
56
|
edges?: GraphEdge[];
|
|
57
|
-
/** @deprecated Use ACL permissions instead */
|
|
58
|
-
isCollaborative?: boolean;
|
|
59
57
|
conversation_starters?: string[];
|
|
60
|
-
tool_resources?:
|
|
61
|
-
projectIds?: Types.ObjectId[];
|
|
58
|
+
tool_resources?: AgentToolResources;
|
|
62
59
|
versions?: Omit<IAgent, 'versions'>[];
|
|
63
60
|
category: string;
|
|
64
61
|
support_contact?: ISupportContact;
|
|
@@ -67,4 +64,5 @@ export interface IAgent extends Omit<Document, 'model'> {
|
|
|
67
64
|
mcpServerNames?: string[];
|
|
68
65
|
/** Per-tool configuration (defer_loading, allowed_callers) */
|
|
69
66
|
tool_options?: AgentToolOptions;
|
|
67
|
+
tenantId?: string;
|
|
70
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TEndpoint, FileSources, TFileConfig, TAzureConfig, TCustomConfig, TMemoryConfig, TVertexAIConfig, TAssistantEndpoint, TAnthropicEndpoint } from 'librechat-data-provider';
|
|
1
|
+
import type { TEndpoint, FileSources, TFileConfig, TAzureConfig, TCustomConfig, TMemoryConfig, TVertexAIConfig, TAssistantEndpoint, TAnthropicEndpoint, SummarizationConfig } from 'librechat-data-provider';
|
|
2
2
|
export type JsonSchemaType = {
|
|
3
3
|
type: 'string' | 'number' | 'integer' | 'float' | 'boolean' | 'array' | 'object';
|
|
4
4
|
enum?: string[];
|
|
@@ -39,6 +39,8 @@ export interface AppConfig {
|
|
|
39
39
|
};
|
|
40
40
|
/** Memory configuration */
|
|
41
41
|
memory?: TMemoryConfig;
|
|
42
|
+
/** Summarization configuration */
|
|
43
|
+
summarization?: SummarizationConfig;
|
|
42
44
|
/** Web search configuration */
|
|
43
45
|
webSearch?: TCustomConfig['webSearch'];
|
|
44
46
|
/** File storage strategy ('local', 's3', 'firebase', 'azure_blob') */
|
|
@@ -32,4 +32,15 @@ export interface IBalance extends Document {
|
|
|
32
32
|
refillIntervalUnit: 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months';
|
|
33
33
|
lastRefill: Date;
|
|
34
34
|
refillAmount: number;
|
|
35
|
+
tenantId?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Plain data fields for creating or updating a balance record (no Mongoose Document methods) */
|
|
38
|
+
export interface IBalanceUpdate {
|
|
39
|
+
user?: string;
|
|
40
|
+
tokenCredits?: number;
|
|
41
|
+
autoRefillEnabled?: boolean;
|
|
42
|
+
refillIntervalValue?: number;
|
|
43
|
+
refillIntervalUnit?: string;
|
|
44
|
+
refillAmount?: number;
|
|
45
|
+
lastRefill?: Date;
|
|
35
46
|
}
|