From 1157b5fe6f876a3a383639cee0c13a79103bd05e Mon Sep 17 00:00:00 2001 From: Ruben Talstra Date: Sat, 8 Mar 2025 21:05:24 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=9F=20feat:=20Add=20LICENSE=20file=20a?= =?UTF-8?q?nd=20update=20package=20version=20to=200.0.2=20with=20MIT=20lic?= =?UTF-8?q?ense?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 2 +- packages/data-schemas/LICENSE | 21 ++++++ packages/data-schemas/README.md | 114 +++++++++++++++++++++++++++++ packages/data-schemas/package.json | 4 +- packages/data-schemas/src/index.ts | 1 - 5 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 packages/data-schemas/LICENSE create mode 100644 packages/data-schemas/README.md diff --git a/package-lock.json b/package-lock.json index 8d2ea4b98da..e9d9c1ef16f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41151,7 +41151,7 @@ }, "packages/data-schemas": { "name": "@librechat/data-schemas", - "version": "0.0.1", + "version": "0.0.2", "license": "ISC", "dependencies": { "mongoose": "^8.9.5" diff --git a/packages/data-schemas/LICENSE b/packages/data-schemas/LICENSE new file mode 100644 index 00000000000..535850a920a --- /dev/null +++ b/packages/data-schemas/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 LibreChat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/data-schemas/README.md b/packages/data-schemas/README.md new file mode 100644 index 00000000000..f9362e8238f --- /dev/null +++ b/packages/data-schemas/README.md @@ -0,0 +1,114 @@ +# `@librechat/data-schemas` + +Mongoose schemas and models for LibreChat. This package provides a comprehensive collection of Mongoose schemas used across the LibreChat project, enabling robust data modeling and validation for various entities such as actions, agents, messages, users, and more. + + +## Features + +- **Modular Schemas:** Includes schemas for actions, agents, assistants, balance, banners, categories, conversation tags, conversations, files, keys, messages, plugin authentication, presets, projects, prompts, prompt groups, roles, sessions, shared links, tokens, tool calls, transactions, and users. +- **TypeScript Support:** Provides TypeScript definitions for type-safe development. +- **Ready for Mongoose Integration:** Easily integrate with Mongoose to create models and interact with your MongoDB database. +- **Flexible & Extensible:** Designed to support the evolving needs of LibreChat while being adaptable to other projects. + + +## Installation + +Install the package via npm or yarn: + +```bash +npm install @librechat/data-schemas +``` + +Or with yarn: + +```bash +yarn add @librechat/data-schemas +``` + + +## Usage + +After installation, you can import and use the schemas in your project. For example, to create a Mongoose model for a user: + +```js +import mongoose from 'mongoose'; +import { userSchema } from '@librechat/data-schemas'; + +const UserModel = mongoose.model('User', userSchema); + +// Now you can use UserModel to create, read, update, and delete user documents. +``` + +You can also import other schemas as needed: + +```js +import { actionSchema, agentSchema, messageSchema } from '@librechat/data-schemas'; +``` + +Each schema is designed to integrate seamlessly with Mongoose and provides indexes, timestamps, and validations tailored for LibreChat’s use cases. + + +## Development + +This package uses Rollup and TypeScript for building and bundling. + +### Available Scripts + +- **Build:** + Cleans the `dist` directory and builds the package. + ```bash + npm run build + ``` + +- **Build Watch:** + Rebuilds automatically on file changes. + ```bash + npm run build:watch + ``` + +- **Test:** + Runs tests with coverage in watch mode. + ```bash + npm run test + ``` + +- **Test (CI):** + Runs tests with coverage for CI environments. + ```bash + npm run test:ci + ``` + +- **Verify:** + Runs tests in CI mode to verify code integrity. + ```bash + npm run verify + ``` + +- **Clean:** + Removes the `dist` directory. + ```bash + npm run clean + ``` + +For those using Bun, equivalent scripts are available: +- **Bun Clean:** `bun run b:clean` +- **Bun Build:** `bun run b:build` + + +## Repository & Issues + +The source code is maintained on GitHub. +- **Repository:** [LibreChat Repository](https://github.com/danny-avila/LibreChat.git) +- **Issues & Bug Reports:** [LibreChat Issues](https://github.com/danny-avila/LibreChat/issues) + + +## License + +This project is licensed under the [MIT License](LICENSE). + + +## Contributing + +Contributions to improve and expand the data schemas are welcome. If you have suggestions, improvements, or bug fixes, please open an issue or submit a pull request on the [GitHub repository](https://github.com/danny-avila/LibreChat/issues). + +For more detailed documentation on each schema and model, please refer to the source code or visit the [LibreChat website](https://librechat.ai). diff --git a/packages/data-schemas/package.json b/packages/data-schemas/package.json index 2a165716770..82f398e31b2 100644 --- a/packages/data-schemas/package.json +++ b/packages/data-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@librechat/data-schemas", - "version": "0.0.1", + "version": "0.0.2", "type": "module", "description": "Mongoose schemas and models for LibreChat", "main": "dist/index.cjs", @@ -28,7 +28,7 @@ "url": "git+https://github.com/danny-avila/LibreChat.git" }, "author": "", - "license": "ISC", + "license": "MIT", "bugs": { "url": "https://github.com/danny-avila/LibreChat/issues" }, diff --git a/packages/data-schemas/src/index.ts b/packages/data-schemas/src/index.ts index 33fa916f326..2374afcac95 100644 --- a/packages/data-schemas/src/index.ts +++ b/packages/data-schemas/src/index.ts @@ -1,4 +1,3 @@ -// index.ts import actionSchema from './schema/action'; import agentSchema from './schema/agent'; import assistantSchema from './schema/assistant';