mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-03 00:58:50 +01:00
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* feat: Enhance shared link functionality with target message support * refactor: Remove comment on compound index in share schema * chore: Reorganize imports in ShareButton component for clarity * refactor: Integrate Recoil for latest message tracking in ShareButton component --------- Co-authored-by: Danny Avila <danny@librechat.ai>
49 lines
985 B
TypeScript
49 lines
985 B
TypeScript
import mongoose, { Schema, Document, Types } from 'mongoose';
|
|
|
|
export interface ISharedLink extends Document {
|
|
conversationId: string;
|
|
title?: string;
|
|
user?: string;
|
|
messages?: Types.ObjectId[];
|
|
shareId?: string;
|
|
targetMessageId?: string;
|
|
isPublic: boolean;
|
|
createdAt?: Date;
|
|
updatedAt?: Date;
|
|
}
|
|
|
|
const shareSchema: Schema<ISharedLink> = new Schema(
|
|
{
|
|
conversationId: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
title: {
|
|
type: String,
|
|
index: true,
|
|
},
|
|
user: {
|
|
type: String,
|
|
index: true,
|
|
},
|
|
messages: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Message' }],
|
|
shareId: {
|
|
type: String,
|
|
index: true,
|
|
},
|
|
targetMessageId: {
|
|
type: String,
|
|
required: false,
|
|
index: true,
|
|
},
|
|
isPublic: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
},
|
|
{ timestamps: true },
|
|
);
|
|
|
|
shareSchema.index({ conversationId: 1, user: 1, targetMessageId: 1 });
|
|
|
|
export default shareSchema;
|