@librechat/data-schemas 0.0.40 → 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.
Files changed (119) hide show
  1. package/dist/index.cjs +4810 -284
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.es.js +4783 -283
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/types/admin/capabilities.d.ts +71 -0
  6. package/dist/types/admin/index.d.ts +1 -0
  7. package/dist/types/app/index.d.ts +1 -0
  8. package/dist/types/app/resolution.d.ts +13 -0
  9. package/dist/types/config/tenantContext.d.ts +20 -0
  10. package/dist/types/index.d.ts +5 -1
  11. package/dist/types/methods/aclEntry.d.ts +10 -1
  12. package/dist/types/methods/action.d.ts +34 -0
  13. package/dist/types/methods/agent.d.ts +89 -0
  14. package/dist/types/methods/assistant.d.ts +39 -0
  15. package/dist/types/methods/banner.d.ts +31 -0
  16. package/dist/types/methods/categories.d.ts +34 -0
  17. package/dist/types/methods/config.d.ts +39 -0
  18. package/dist/types/methods/conversation.d.ts +82 -0
  19. package/dist/types/methods/conversationTag.d.ts +93 -0
  20. package/dist/types/methods/index.d.ts +35 -4
  21. package/dist/types/methods/memory.d.ts +1 -0
  22. package/dist/types/methods/message.d.ts +77 -0
  23. package/dist/types/methods/preset.d.ts +88 -0
  24. package/dist/types/methods/prompt.d.ts +410 -0
  25. package/dist/types/methods/role.d.ts +13 -1
  26. package/dist/types/methods/spendTokens.d.ts +63 -0
  27. package/dist/types/methods/systemGrant.d.ts +59 -0
  28. package/dist/types/methods/test-helpers.d.ts +18 -0
  29. package/dist/types/methods/toolCall.d.ts +82 -0
  30. package/dist/types/methods/transaction.d.ts +67 -13
  31. package/dist/types/methods/tx.d.ts +108 -0
  32. package/dist/types/methods/userGroup.d.ts +6 -0
  33. package/dist/types/migrations/index.d.ts +1 -0
  34. package/dist/types/migrations/tenantIndexes.d.ts +52 -0
  35. package/dist/types/models/accessRole.d.ts +0 -3
  36. package/dist/types/models/aclEntry.d.ts +0 -3
  37. package/dist/types/models/action.d.ts +0 -3
  38. package/dist/types/models/agent.d.ts +0 -3
  39. package/dist/types/models/agentCategory.d.ts +0 -3
  40. package/dist/types/models/assistant.d.ts +0 -3
  41. package/dist/types/models/balance.d.ts +0 -3
  42. package/dist/types/models/banner.d.ts +0 -3
  43. package/dist/types/models/{project.d.ts → config.d.ts} +1 -4
  44. package/dist/types/models/conversationTag.d.ts +0 -3
  45. package/dist/types/models/convo.d.ts +0 -3
  46. package/dist/types/models/file.d.ts +0 -3
  47. package/dist/types/models/group.d.ts +0 -3
  48. package/dist/types/models/index.d.ts +2 -1
  49. package/dist/types/models/key.d.ts +0 -3
  50. package/dist/types/models/mcpServer.d.ts +0 -3
  51. package/dist/types/models/message.d.ts +0 -3
  52. package/dist/types/models/pluginAuth.d.ts +0 -3
  53. package/dist/types/models/plugins/tenantIsolation.d.ts +38 -0
  54. package/dist/types/models/preset.d.ts +0 -3
  55. package/dist/types/models/prompt.d.ts +0 -3
  56. package/dist/types/models/promptGroup.d.ts +0 -3
  57. package/dist/types/models/role.d.ts +0 -3
  58. package/dist/types/models/session.d.ts +0 -3
  59. package/dist/types/models/sharedLink.d.ts +0 -3
  60. package/dist/types/models/systemGrant.d.ts +33 -0
  61. package/dist/types/models/token.d.ts +0 -3
  62. package/dist/types/models/toolCall.d.ts +0 -3
  63. package/dist/types/models/transaction.d.ts +0 -3
  64. package/dist/types/models/user.d.ts +0 -3
  65. package/dist/types/schema/agentApiKey.d.ts +1 -0
  66. package/dist/types/schema/banner.d.ts +1 -0
  67. package/dist/types/schema/categories.d.ts +1 -0
  68. package/dist/types/schema/{project.d.ts → config.d.ts} +9 -13
  69. package/dist/types/schema/conversationTag.d.ts +1 -0
  70. package/dist/types/schema/index.d.ts +2 -1
  71. package/dist/types/schema/key.d.ts +1 -0
  72. package/dist/types/schema/preset.d.ts +1 -0
  73. package/dist/types/schema/share.d.ts +1 -0
  74. package/dist/types/schema/systemGrant.d.ts +39 -0
  75. package/dist/types/schema/toolCall.d.ts +1 -0
  76. package/dist/types/schema/transaction.d.ts +1 -0
  77. package/dist/types/types/accessRole.d.ts +1 -0
  78. package/dist/types/types/aclEntry.d.ts +1 -0
  79. package/dist/types/types/action.d.ts +1 -0
  80. package/dist/types/types/admin.d.ts +98 -0
  81. package/dist/types/types/agent.d.ts +3 -5
  82. package/dist/types/types/agentApiKey.d.ts +1 -0
  83. package/dist/types/types/agentCategory.d.ts +1 -0
  84. package/dist/types/types/app.d.ts +3 -1
  85. package/dist/types/types/assistant.d.ts +1 -0
  86. package/dist/types/types/balance.d.ts +11 -0
  87. package/dist/types/types/banner.d.ts +1 -0
  88. package/dist/types/types/config.d.ts +58 -0
  89. package/dist/types/types/convo.d.ts +1 -0
  90. package/dist/types/types/file.d.ts +1 -0
  91. package/dist/types/types/group.d.ts +1 -0
  92. package/dist/types/types/index.d.ts +3 -0
  93. package/dist/types/types/mcp.d.ts +1 -0
  94. package/dist/types/types/memory.d.ts +1 -0
  95. package/dist/types/types/message.d.ts +7 -2
  96. package/dist/types/types/pluginAuth.d.ts +1 -0
  97. package/dist/types/types/prompts.d.ts +2 -1
  98. package/dist/types/types/role.d.ts +1 -0
  99. package/dist/types/types/session.d.ts +1 -0
  100. package/dist/types/types/systemGrant.d.ts +47 -0
  101. package/dist/types/types/token.d.ts +2 -0
  102. package/dist/types/types/user.d.ts +1 -0
  103. package/dist/types/utils/index.d.ts +3 -0
  104. package/dist/types/utils/principal.d.ts +34 -0
  105. package/dist/types/utils/retry.d.ts +41 -0
  106. package/dist/types/utils/string.d.ts +4 -0
  107. package/dist/types/utils/tempChatRetention.d.ts +25 -0
  108. package/package.json +1 -1
  109. package/dist/types/app/web.spec.d.ts +0 -1
  110. package/dist/types/methods/accessRole.spec.d.ts +0 -1
  111. package/dist/types/methods/aclEntry.spec.d.ts +0 -1
  112. package/dist/types/methods/file.spec.d.ts +0 -1
  113. package/dist/types/methods/mcpServer.spec.d.ts +0 -1
  114. package/dist/types/methods/token.spec.d.ts +0 -1
  115. package/dist/types/methods/user.methods.spec.d.ts +0 -1
  116. package/dist/types/methods/userGroup.methods.spec.d.ts +0 -1
  117. package/dist/types/methods/userGroup.roles.spec.d.ts +0 -1
  118. package/dist/types/methods/userGroup.spec.d.ts +0 -1
  119. package/dist/types/models/plugins/mongoMeili.spec.d.ts +0 -1
@@ -26,7 +26,7 @@
26
26
  /// <reference types="mongoose/types/inferrawdoctype" />
27
27
  import { DEFAULT_REFRESH_TOKEN_EXPIRY, type SessionMethods } from './session';
28
28
  import { type TokenMethods } from './token';
29
- import { type RoleMethods } from './role';
29
+ import { type RoleMethods, type RoleDeps } from './role';
30
30
  import { DEFAULT_SESSION_EXPIRY, type UserMethods } from './user';
31
31
  export { DEFAULT_REFRESH_TOKEN_EXPIRY, DEFAULT_SESSION_EXPIRY };
32
32
  import { type KeyMethods } from './key';
@@ -39,12 +39,43 @@ import { type PluginAuthMethods } from './pluginAuth';
39
39
  import { type AccessRoleMethods } from './accessRole';
40
40
  import { type UserGroupMethods } from './userGroup';
41
41
  import { type AclEntryMethods } from './aclEntry';
42
+ import { type SystemGrantMethods } from './systemGrant';
42
43
  import { type ShareMethods } from './share';
44
+ import { type ActionMethods } from './action';
45
+ import { type AssistantMethods } from './assistant';
46
+ import { type BannerMethods } from './banner';
47
+ import { type ToolCallMethods } from './toolCall';
48
+ import { type CategoriesMethods } from './categories';
49
+ import { type PresetMethods } from './preset';
50
+ import { type ConversationTagMethods } from './conversationTag';
51
+ import { type MessageMethods } from './message';
52
+ import { type ConversationMethods } from './conversation';
53
+ import { type TxMethods, tokenValues, cacheTokenValues, premiumTokenValues, defaultRate } from './tx';
43
54
  import { type TransactionMethods } from './transaction';
44
- export type AllMethods = UserMethods & SessionMethods & TokenMethods & RoleMethods & KeyMethods & FileMethods & MemoryMethods & AgentCategoryMethods & AgentApiKeyMethods & MCPServerMethods & UserGroupMethods & AclEntryMethods & ShareMethods & AccessRoleMethods & PluginAuthMethods & TransactionMethods;
55
+ import { type SpendTokensMethods } from './spendTokens';
56
+ import { type PromptMethods } from './prompt';
57
+ import { type AgentMethods } from './agent';
58
+ import { type ConfigMethods } from './config';
59
+ export { tokenValues, cacheTokenValues, premiumTokenValues, defaultRate };
60
+ export type AllMethods = UserMethods & SessionMethods & TokenMethods & RoleMethods & KeyMethods & FileMethods & MemoryMethods & AgentCategoryMethods & AgentApiKeyMethods & MCPServerMethods & UserGroupMethods & AclEntryMethods & SystemGrantMethods & ShareMethods & AccessRoleMethods & PluginAuthMethods & ActionMethods & AssistantMethods & BannerMethods & ToolCallMethods & CategoriesMethods & PresetMethods & ConversationTagMethods & MessageMethods & ConversationMethods & TxMethods & TransactionMethods & SpendTokensMethods & PromptMethods & AgentMethods & ConfigMethods;
61
+ /** Dependencies injected from the api layer into createMethods */
62
+ export interface CreateMethodsDeps {
63
+ /** Matches a model name to a canonical key. From @librechat/api. */
64
+ matchModelName?: (model: string, endpoint?: string) => string | undefined;
65
+ /** Finds the first key in values whose key is a substring of model. From @librechat/api. */
66
+ findMatchingPattern?: (model: string, values: Record<string, number | Record<string, number>>) => string | undefined;
67
+ /** Removes all ACL permissions for a resource. From PermissionService. */
68
+ removeAllPermissions?: (params: {
69
+ resourceType: string;
70
+ resourceId: unknown;
71
+ }) => Promise<void>;
72
+ /** Returns a cache store for the given key. From getLogStores. */
73
+ getCache?: RoleDeps['getCache'];
74
+ }
45
75
  /**
46
76
  * Creates all database methods for all collections
47
77
  * @param mongoose - Mongoose instance
78
+ * @param deps - Optional dependencies injected from the api layer
48
79
  */
49
- export declare function createMethods(mongoose: typeof import('mongoose')): AllMethods;
50
- export type { UserMethods, SessionMethods, TokenMethods, RoleMethods, KeyMethods, FileMethods, MemoryMethods, AgentCategoryMethods, AgentApiKeyMethods, MCPServerMethods, UserGroupMethods, AclEntryMethods, ShareMethods, AccessRoleMethods, PluginAuthMethods, TransactionMethods, };
80
+ export declare function createMethods(mongoose: typeof import('mongoose'), deps?: CreateMethodsDeps): AllMethods;
81
+ export type { UserMethods, SessionMethods, TokenMethods, RoleMethods, KeyMethods, FileMethods, MemoryMethods, AgentCategoryMethods, AgentApiKeyMethods, MCPServerMethods, UserGroupMethods, AclEntryMethods, SystemGrantMethods, ShareMethods, AccessRoleMethods, PluginAuthMethods, ActionMethods, AssistantMethods, BannerMethods, ToolCallMethods, CategoriesMethods, PresetMethods, ConversationTagMethods, MessageMethods, ConversationMethods, TxMethods, TransactionMethods, SpendTokensMethods, PromptMethods, AgentMethods, ConfigMethods, };
@@ -31,5 +31,6 @@ export declare function createMemoryMethods(mongoose: typeof import('mongoose'))
31
31
  deleteMemory: ({ userId, key }: t.DeleteMemoryParams) => Promise<t.MemoryResult>;
32
32
  getAllUserMemories: (userId: string | Types.ObjectId) => Promise<t.IMemoryEntryLean[]>;
33
33
  getFormattedMemories: ({ userId, }: t.GetFormattedMemoriesParams) => Promise<t.FormattedMemoriesResult>;
34
+ deleteAllUserMemories: (userId: string | Types.ObjectId) => Promise<number>;
34
35
  };
35
36
  export type MemoryMethods = ReturnType<typeof createMemoryMethods>;
@@ -0,0 +1,77 @@
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 { DeleteResult, FilterQuery } from 'mongoose';
27
+ import type { AppConfig, IMessage } from '~/types';
28
+ export interface MessageMethods {
29
+ saveMessage(ctx: {
30
+ userId: string;
31
+ isTemporary?: boolean;
32
+ interfaceConfig?: AppConfig['interfaceConfig'];
33
+ }, params: Partial<IMessage> & {
34
+ newMessageId?: string;
35
+ }, metadata?: {
36
+ context?: string;
37
+ }): Promise<IMessage | null | undefined>;
38
+ bulkSaveMessages(messages: Array<Partial<IMessage>>, overrideTimestamp?: boolean): Promise<unknown>;
39
+ recordMessage(params: {
40
+ user: string;
41
+ endpoint?: string;
42
+ messageId: string;
43
+ conversationId?: string;
44
+ parentMessageId?: string;
45
+ [key: string]: unknown;
46
+ }): Promise<IMessage | null>;
47
+ updateMessageText(userId: string, params: {
48
+ messageId: string;
49
+ text: string;
50
+ }): Promise<void>;
51
+ updateMessage(userId: string, message: Partial<IMessage> & {
52
+ newMessageId?: string;
53
+ }, metadata?: {
54
+ context?: string;
55
+ }): Promise<Partial<IMessage>>;
56
+ deleteMessagesSince(userId: string, params: {
57
+ messageId: string;
58
+ conversationId: string;
59
+ }): Promise<DeleteResult>;
60
+ getMessages(filter: FilterQuery<IMessage>, select?: string): Promise<IMessage[]>;
61
+ getMessage(params: {
62
+ user: string;
63
+ messageId: string;
64
+ }): Promise<IMessage | null>;
65
+ getMessagesByCursor(filter: FilterQuery<IMessage>, options?: {
66
+ sortField?: string;
67
+ sortOrder?: 1 | -1;
68
+ limit?: number;
69
+ cursor?: string | null;
70
+ }): Promise<{
71
+ messages: IMessage[];
72
+ nextCursor: string | null;
73
+ }>;
74
+ searchMessages(query: string, searchOptions: Partial<IMessage>, hydrate?: boolean): Promise<unknown>;
75
+ deleteMessages(filter: FilterQuery<IMessage>): Promise<DeleteResult>;
76
+ }
77
+ export declare function createMessageMethods(mongoose: typeof import('mongoose')): MessageMethods;
@@ -0,0 +1,88 @@
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
+ interface IPreset {
28
+ user?: string;
29
+ presetId?: string;
30
+ order?: number;
31
+ defaultPreset?: boolean;
32
+ tools?: (string | {
33
+ pluginKey?: string;
34
+ })[];
35
+ updatedAt?: Date;
36
+ [key: string]: unknown;
37
+ }
38
+ export declare function createPresetMethods(mongoose: typeof import('mongoose')): {
39
+ getPreset: (user: string, presetId: string) => Promise<(import("mongoose").FlattenMaps<{
40
+ [x: string]: unknown;
41
+ user?: string | undefined;
42
+ presetId?: string | undefined;
43
+ order?: number | undefined;
44
+ defaultPreset?: boolean | undefined;
45
+ tools?: (string | {
46
+ pluginKey?: string | undefined;
47
+ })[] | undefined;
48
+ updatedAt?: Date | undefined;
49
+ }> & {
50
+ _id: import("mongoose").Types.ObjectId;
51
+ } & {
52
+ __v: number;
53
+ }) | {
54
+ message: string;
55
+ } | null>;
56
+ getPresets: (user: string, filter?: Record<string, unknown>) => Promise<(import("mongoose").FlattenMaps<{
57
+ [x: string]: unknown;
58
+ user?: string | undefined;
59
+ presetId?: string | undefined;
60
+ order?: number | undefined;
61
+ defaultPreset?: boolean | undefined;
62
+ tools?: (string | {
63
+ pluginKey?: string | undefined;
64
+ })[] | undefined;
65
+ updatedAt?: Date | undefined;
66
+ }> & {
67
+ _id: import("mongoose").Types.ObjectId;
68
+ } & {
69
+ __v: number;
70
+ })[] | {
71
+ message: string;
72
+ }>;
73
+ savePreset: (user: string, { presetId, newPresetId, defaultPreset, ...preset }: {
74
+ [key: string]: unknown;
75
+ presetId?: string | undefined;
76
+ newPresetId?: string | undefined;
77
+ defaultPreset?: boolean | undefined;
78
+ }) => Promise<(import("mongoose").Document<unknown, {}, IPreset> & IPreset & {
79
+ _id: import("mongoose").Types.ObjectId;
80
+ } & {
81
+ __v: number;
82
+ }) | {
83
+ message: string;
84
+ }>;
85
+ deletePresets: (user: string, filter?: Record<string, unknown>) => Promise<import("mongodb").DeleteResult>;
86
+ };
87
+ export type PresetMethods = ReturnType<typeof createPresetMethods>;
88
+ export {};
@@ -0,0 +1,410 @@
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 { Model, Types } from 'mongoose';
27
+ import type { IPrompt, IPromptGroupDocument } from '~/types';
28
+ export interface PromptDeps {
29
+ /** Removes all ACL permissions for a resource. Injected from PermissionService. */
30
+ removeAllPermissions: (params: {
31
+ resourceType: string;
32
+ resourceId: unknown;
33
+ }) => Promise<void>;
34
+ /** Returns resource IDs solely owned by the given user. From createAclEntryMethods. */
35
+ getSoleOwnedResourceIds: (userObjectId: Types.ObjectId, resourceTypes: string | string[]) => Promise<Types.ObjectId[]>;
36
+ }
37
+ export declare function createPromptMethods(mongoose: typeof import('mongoose'), deps: PromptDeps): {
38
+ getPromptGroups: (filter: Record<string, unknown>) => Promise<{
39
+ promptGroups: Record<string, unknown>[];
40
+ pageNumber: string;
41
+ pageSize: string;
42
+ pages: string;
43
+ message?: undefined;
44
+ } | {
45
+ message: string;
46
+ promptGroups?: undefined;
47
+ pageNumber?: undefined;
48
+ pageSize?: undefined;
49
+ pages?: undefined;
50
+ }>;
51
+ deletePromptGroup: ({ _id }: {
52
+ _id: string;
53
+ }) => Promise<{
54
+ message: string;
55
+ }>;
56
+ getAllPromptGroups: (filter: Record<string, unknown>) => Promise<Record<string, unknown>[] | {
57
+ message: string;
58
+ }>;
59
+ getListPromptGroupsByAccess: ({ accessibleIds, otherParams, limit, after, }: {
60
+ accessibleIds?: Types.ObjectId[] | undefined;
61
+ otherParams?: Record<string, unknown> | undefined;
62
+ limit?: number | null | undefined;
63
+ after?: string | null | undefined;
64
+ }) => Promise<{
65
+ object: "list";
66
+ data: Record<string, unknown>[];
67
+ first_id: string | null;
68
+ last_id: string | null;
69
+ has_more: boolean;
70
+ after: string | null;
71
+ }>;
72
+ createPromptGroup: (saveData: {
73
+ prompt: Record<string, unknown>;
74
+ group: Record<string, unknown>;
75
+ author: string;
76
+ authorName: string;
77
+ }) => Promise<{
78
+ prompt: import("mongoose").FlattenMaps<IPrompt> & Required<{
79
+ _id: import("mongoose").FlattenMaps<unknown>;
80
+ }> & {
81
+ __v: number;
82
+ };
83
+ group: {
84
+ productionPrompt: {
85
+ prompt: string;
86
+ };
87
+ name: string;
88
+ numberOfGenerations: number;
89
+ oneliner: string;
90
+ category: string;
91
+ productionId: Types.ObjectId;
92
+ author: Types.ObjectId;
93
+ authorName: string;
94
+ command?: string | undefined;
95
+ createdAt?: Date | undefined;
96
+ updatedAt?: Date | undefined;
97
+ isPublic?: boolean | undefined;
98
+ tenantId?: string | undefined;
99
+ _id: import("mongoose").FlattenMaps<unknown>;
100
+ $assertPopulated: <Paths = {}>(path: string | string[], values?: Partial<Paths> | undefined) => Omit<IPromptGroupDocument, keyof Paths> & Paths;
101
+ $clearModifiedPaths: () => IPromptGroupDocument;
102
+ $clone: () => IPromptGroupDocument;
103
+ $createModifiedPathsSnapshot: () => import("mongoose").ModifiedPathsSnapshot;
104
+ $getAllSubdocs: () => import("mongoose").Document<unknown, any, any>[];
105
+ $ignore: (path: string) => void;
106
+ $isDefault: (path: string) => boolean;
107
+ $isDeleted: (val?: boolean | undefined) => boolean;
108
+ $getPopulatedDocs: () => import("mongoose").Document<unknown, any, any>[];
109
+ $inc: (path: string | string[], val?: number | undefined) => IPromptGroupDocument;
110
+ $isEmpty: (path: string) => boolean;
111
+ $isValid: (path: string) => boolean;
112
+ $locals: import("mongoose").FlattenMaps<Record<string, unknown>>;
113
+ $markValid: (path: string) => void;
114
+ $model: {
115
+ <ModelType = Model<unknown, {}, {}, {}, import("mongoose").Document<unknown, {}, unknown> & {
116
+ _id: Types.ObjectId;
117
+ } & {
118
+ __v: number;
119
+ }, any>>(name: string): ModelType;
120
+ <ModelType_1 = Model<any, {}, {}, {}, any, any>>(): ModelType_1;
121
+ };
122
+ $op: "save" | "validate" | "remove" | null;
123
+ $restoreModifiedPathsSnapshot: (snapshot: import("mongoose").ModifiedPathsSnapshot) => IPromptGroupDocument;
124
+ $session: (session?: import("mongodb").ClientSession | null | undefined) => import("mongodb").ClientSession | null;
125
+ $set: {
126
+ (path: string | Record<string, any>, val: any, type: any, options?: import("mongoose").DocumentSetOptions | undefined): IPromptGroupDocument;
127
+ (path: string | Record<string, any>, val: any, options?: import("mongoose").DocumentSetOptions | undefined): IPromptGroupDocument;
128
+ (value: string | Record<string, any>): IPromptGroupDocument;
129
+ };
130
+ $where: import("mongoose").FlattenMaps<Record<string, unknown>>;
131
+ baseModelName?: string | undefined;
132
+ collection: import("mongoose").Collection<import("bson").Document>;
133
+ db: import("mongoose").FlattenMaps<import("mongoose").Connection>;
134
+ deleteOne: (options?: import("mongoose").QueryOptions<unknown> | undefined) => any;
135
+ depopulate: <Paths_1 = {}>(path?: string | string[] | undefined) => import("mongoose").MergeType<IPromptGroupDocument, Paths_1>;
136
+ directModifiedPaths: () => string[];
137
+ equals: (doc: import("mongoose").Document<unknown, any, any>) => boolean;
138
+ errors?: import("mongoose").Error.ValidationError | undefined;
139
+ get: {
140
+ <T extends string | number | symbol>(path: T, type?: any, options?: any): any;
141
+ (path: string, type?: any, options?: any): any;
142
+ };
143
+ getChanges: () => import("mongoose").UpdateQuery<IPromptGroupDocument>;
144
+ id?: any;
145
+ increment: () => IPromptGroupDocument;
146
+ init: (obj: import("mongoose").AnyObject, opts?: import("mongoose").AnyObject | undefined) => IPromptGroupDocument;
147
+ invalidate: {
148
+ <T_1 extends string | number | symbol>(path: T_1, errorMsg: string | NativeError, value?: any, kind?: string | undefined): NativeError | null;
149
+ (path: string, errorMsg: string | NativeError, value?: any, kind?: string | undefined): NativeError | null;
150
+ };
151
+ isDirectModified: {
152
+ <T_2 extends string | number | symbol>(path: T_2 | T_2[]): boolean;
153
+ (path: string | string[]): boolean;
154
+ };
155
+ isDirectSelected: {
156
+ <T_3 extends string | number | symbol>(path: T_3): boolean;
157
+ (path: string): boolean;
158
+ };
159
+ isInit: {
160
+ <T_4 extends string | number | symbol>(path: T_4): boolean;
161
+ (path: string): boolean;
162
+ };
163
+ isModified: {
164
+ <T_5 extends string | number | symbol>(path?: T_5 | T_5[] | undefined, options?: {
165
+ ignoreAtomics?: boolean | undefined;
166
+ } | null | undefined): boolean;
167
+ (path?: string | string[] | undefined, options?: {
168
+ ignoreAtomics?: boolean | undefined;
169
+ } | null | undefined): boolean;
170
+ };
171
+ isNew: boolean;
172
+ isSelected: {
173
+ <T_6 extends string | number | symbol>(path: T_6): boolean;
174
+ (path: string): boolean;
175
+ };
176
+ markModified: {
177
+ <T_7 extends string | number | symbol>(path: T_7, scope?: any): void;
178
+ (path: string, scope?: any): void;
179
+ };
180
+ model: {
181
+ <ModelType_2 = Model<unknown, {}, {}, {}, import("mongoose").Document<unknown, {}, unknown> & {
182
+ _id: Types.ObjectId;
183
+ } & {
184
+ __v: number;
185
+ }, any>>(name: string): ModelType_2;
186
+ <ModelType_3 = Model<any, {}, {}, {}, any, any>>(): ModelType_3;
187
+ };
188
+ modifiedPaths: (options?: {
189
+ includeChildren?: boolean | undefined;
190
+ } | undefined) => string[];
191
+ overwrite: (obj: import("mongoose").AnyObject) => IPromptGroupDocument;
192
+ $parent: () => import("mongoose").Document<unknown, any, any> | undefined;
193
+ populate: {
194
+ <Paths_2 = {}>(path: string | import("mongoose").PopulateOptions | (string | import("mongoose").PopulateOptions)[]): Promise<import("mongoose").MergeType<IPromptGroupDocument, Paths_2>>;
195
+ <Paths_3 = {}>(path: string, select?: string | import("mongoose").AnyObject | undefined, model?: Model<any, {}, {}, {}, any, any> | undefined, match?: import("mongoose").AnyObject | undefined, options?: import("mongoose").PopulateOptions | undefined): Promise<import("mongoose").MergeType<IPromptGroupDocument, Paths_3>>;
196
+ };
197
+ populated: (path: string) => any;
198
+ replaceOne: (replacement?: import("mongoose").AnyObject | undefined, options?: import("mongoose").QueryOptions<unknown> | null | undefined) => import("mongoose").Query<any, IPromptGroupDocument, {}, unknown, "find", Record<string, never>>;
199
+ save: (options?: import("mongoose").SaveOptions | undefined) => Promise<IPromptGroupDocument>;
200
+ schema: import("mongoose").FlattenMaps<import("mongoose").Schema<any, Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
201
+ [x: string]: unknown;
202
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
203
+ [x: string]: unknown;
204
+ }>> & import("mongoose").FlatRecord<{
205
+ [x: string]: unknown;
206
+ }> & Required<{
207
+ _id: unknown;
208
+ }> & {
209
+ __v: number;
210
+ }>>;
211
+ set: {
212
+ <T_8 extends string | number | symbol>(path: T_8, val: any, type: any, options?: import("mongoose").DocumentSetOptions | undefined): IPromptGroupDocument;
213
+ (path: string | Record<string, any>, val: any, type: any, options?: import("mongoose").DocumentSetOptions | undefined): IPromptGroupDocument;
214
+ (path: string | Record<string, any>, val: any, options?: import("mongoose").DocumentSetOptions | undefined): IPromptGroupDocument;
215
+ (value: string | Record<string, any>): IPromptGroupDocument;
216
+ };
217
+ toJSON: {
218
+ (options?: (import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
219
+ _id: Types.ObjectId;
220
+ } & {
221
+ __v: number;
222
+ }> & {
223
+ flattenMaps?: true | undefined;
224
+ flattenObjectIds?: false | undefined;
225
+ }) | undefined): import("mongoose").FlattenMaps<any>;
226
+ (options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
227
+ _id: Types.ObjectId;
228
+ } & {
229
+ __v: number;
230
+ }> & {
231
+ flattenObjectIds: false;
232
+ }): import("mongoose").FlattenMaps<any>;
233
+ (options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
234
+ _id: Types.ObjectId;
235
+ } & {
236
+ __v: number;
237
+ }> & {
238
+ flattenObjectIds: true;
239
+ }): {
240
+ [x: string]: any;
241
+ };
242
+ (options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
243
+ _id: Types.ObjectId;
244
+ } & {
245
+ __v: number;
246
+ }> & {
247
+ flattenMaps: false;
248
+ }): any;
249
+ (options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
250
+ _id: Types.ObjectId;
251
+ } & {
252
+ __v: number;
253
+ }> & {
254
+ flattenMaps: false;
255
+ flattenObjectIds: true;
256
+ }): any;
257
+ <T_9 = any>(options?: (import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
258
+ _id: Types.ObjectId;
259
+ } & {
260
+ __v: number;
261
+ }> & {
262
+ flattenMaps?: true | undefined;
263
+ flattenObjectIds?: false | undefined;
264
+ }) | undefined): import("mongoose").FlattenMaps<T_9>;
265
+ <T_10 = any>(options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
266
+ _id: Types.ObjectId;
267
+ } & {
268
+ __v: number;
269
+ }> & {
270
+ flattenObjectIds: false;
271
+ }): import("mongoose").FlattenMaps<T_10>;
272
+ <T_11 = any>(options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
273
+ _id: Types.ObjectId;
274
+ } & {
275
+ __v: number;
276
+ }> & {
277
+ flattenObjectIds: true;
278
+ }): import("mongoose").ObjectIdToString<import("mongoose").FlattenMaps<T_11>>;
279
+ <T_12 = any>(options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
280
+ _id: Types.ObjectId;
281
+ } & {
282
+ __v: number;
283
+ }> & {
284
+ flattenMaps: false;
285
+ }): T_12;
286
+ <T_13 = any>(options: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
287
+ _id: Types.ObjectId;
288
+ } & {
289
+ __v: number;
290
+ }> & {
291
+ flattenMaps: false;
292
+ flattenObjectIds: true;
293
+ }): import("mongoose").ObjectIdToString<T_13>;
294
+ };
295
+ toObject: {
296
+ (options?: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
297
+ _id: Types.ObjectId;
298
+ } & {
299
+ __v: number;
300
+ }> | undefined): any;
301
+ <T_14>(options?: import("mongoose").ToObjectOptions<import("mongoose").Document<unknown, {}, unknown> & {
302
+ _id: Types.ObjectId;
303
+ } & {
304
+ __v: number;
305
+ }> | undefined): import("mongoose").Default__v<import("mongoose").Require_id<T_14>>;
306
+ };
307
+ unmarkModified: {
308
+ <T_15 extends string | number | symbol>(path: T_15): void;
309
+ (path: string): void;
310
+ };
311
+ updateOne: (update?: import("mongoose").UpdateWithAggregationPipeline | import("mongoose").UpdateQuery<IPromptGroupDocument> | undefined, options?: import("mongoose").QueryOptions<unknown> | null | undefined) => import("mongoose").Query<any, IPromptGroupDocument, {}, unknown, "find", Record<string, never>>;
312
+ validate: {
313
+ <T_16 extends string | number | symbol>(pathsToValidate?: T_16 | T_16[] | undefined, options?: import("mongoose").AnyObject | undefined): Promise<void>;
314
+ (pathsToValidate?: import("mongoose").PathsToValidate | undefined, options?: import("mongoose").AnyObject | undefined): Promise<void>;
315
+ (options: {
316
+ pathsToSkip?: import("mongoose").pathsToSkip | undefined;
317
+ }): Promise<void>;
318
+ };
319
+ validateSync: {
320
+ (options: {
321
+ [k: string]: any;
322
+ pathsToSkip?: import("mongoose").pathsToSkip | undefined;
323
+ }): import("mongoose").Error.ValidationError | null;
324
+ <T_17 extends string | number | symbol>(pathsToValidate?: T_17 | T_17[] | undefined, options?: import("mongoose").AnyObject | undefined): import("mongoose").Error.ValidationError | null;
325
+ (pathsToValidate?: import("mongoose").PathsToValidate | undefined, options?: import("mongoose").AnyObject | undefined): import("mongoose").Error.ValidationError | null;
326
+ };
327
+ __v: number;
328
+ };
329
+ }>;
330
+ savePrompt: (saveData: {
331
+ prompt: Record<string, unknown>;
332
+ author: string | Types.ObjectId;
333
+ }) => Promise<{
334
+ prompt: import("mongoose").Document<unknown, {}, IPrompt> & IPrompt & Required<{
335
+ _id: unknown;
336
+ }> & {
337
+ __v: number;
338
+ };
339
+ message?: undefined;
340
+ } | {
341
+ message: string;
342
+ prompt?: undefined;
343
+ }>;
344
+ getPrompts: (filter: Record<string, unknown>) => Promise<(import("mongoose").FlattenMaps<IPrompt> & Required<{
345
+ _id: import("mongoose").FlattenMaps<unknown>;
346
+ }> & {
347
+ __v: number;
348
+ })[] | {
349
+ message: string;
350
+ }>;
351
+ getPrompt: (filter: Record<string, unknown>) => Promise<(import("mongoose").FlattenMaps<IPrompt> & Required<{
352
+ _id: import("mongoose").FlattenMaps<unknown>;
353
+ }> & {
354
+ __v: number;
355
+ }) | {
356
+ message: string;
357
+ } | null>;
358
+ getRandomPromptGroups: (filter: {
359
+ skip: number | string;
360
+ limit: number | string;
361
+ }) => Promise<{
362
+ prompts: unknown[];
363
+ message?: undefined;
364
+ } | {
365
+ message: string;
366
+ prompts?: undefined;
367
+ }>;
368
+ getPromptGroupsWithPrompts: (filter: Record<string, unknown>) => Promise<(import("mongoose").FlattenMaps<IPromptGroupDocument> & Required<{
369
+ _id: import("mongoose").FlattenMaps<unknown>;
370
+ }> & {
371
+ __v: number;
372
+ }) | {
373
+ message: string;
374
+ } | null>;
375
+ getPromptGroup: (filter: Record<string, unknown>) => Promise<(import("mongoose").FlattenMaps<IPromptGroupDocument> & Required<{
376
+ _id: import("mongoose").FlattenMaps<unknown>;
377
+ }> & {
378
+ __v: number;
379
+ }) | {
380
+ message: string;
381
+ } | null>;
382
+ deletePrompt: ({ promptId, groupId, }: {
383
+ promptId: string | Types.ObjectId;
384
+ groupId: string | Types.ObjectId;
385
+ }) => Promise<{
386
+ prompt: string;
387
+ promptGroup: {
388
+ message: string;
389
+ id: string | Types.ObjectId;
390
+ };
391
+ } | {
392
+ prompt: string;
393
+ promptGroup?: undefined;
394
+ }>;
395
+ deleteUserPrompts: (userId: string) => Promise<void>;
396
+ updatePromptGroup: (filter: Record<string, unknown>, data: Record<string, unknown>) => Promise<(import("mongoose").Document<unknown, {}, IPromptGroupDocument> & IPromptGroupDocument & Required<{
397
+ _id: unknown;
398
+ }> & {
399
+ __v: number;
400
+ }) | {
401
+ message: string;
402
+ }>;
403
+ makePromptProduction: (promptId: string) => Promise<{
404
+ message: string;
405
+ }>;
406
+ updatePromptLabels: (_id: string, labels: unknown) => Promise<{
407
+ message: string;
408
+ }>;
409
+ };
410
+ export type PromptMethods = ReturnType<typeof createPromptMethods>;