@common_ch/common 1.0.310 → 1.0.311

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.
@@ -20,7 +20,6 @@ export type Attachment = {
20
20
  name: string;
21
21
  };
22
22
  export type Messages = {
23
- ai: string | AiAttrs | AiDoc;
24
23
  aiOption: string | AiOptionAttrs | AiOptionDoc;
25
24
  role: 'user' | 'assistant' | 'system';
26
25
  runId?: string;
@@ -143,10 +143,6 @@ const messageSchema = new mongoose_1.default.Schema({
143
143
  },
144
144
  messages: [
145
145
  {
146
- ai: {
147
- type: mongoose_1.default.Schema.Types.ObjectId,
148
- ref: 'Ai',
149
- },
150
146
  aiOption: {
151
147
  type: mongoose_1.default.Schema.Types.ObjectId,
152
148
  ref: 'AiOption',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common_ch/common",
3
- "version": "1.0.310",
3
+ "version": "1.0.311",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [
@@ -1,36 +0,0 @@
1
- import mongoose from 'mongoose';
2
- import { MessageTypeSupportChatEnum, SupportChatStatusEnum } from '../../enums/supportChat';
3
- export interface SupportChatAttrs {
4
- userId: string;
5
- messages: {
6
- message: string;
7
- typeMessage: MessageTypeSupportChatEnum;
8
- file?: string;
9
- adminName?: string;
10
- adminFamily?: string;
11
- createdAt: string;
12
- }[];
13
- status?: SupportChatStatusEnum;
14
- createdAt?: string;
15
- updatedAt?: string;
16
- }
17
- interface SupportChatModel extends mongoose.Model<SupportChatDoc> {
18
- build(attrs: SupportChatAttrs): SupportChatDoc;
19
- }
20
- export interface SupportChatDoc extends mongoose.Document {
21
- _id: string;
22
- userId: string;
23
- messages: {
24
- message: string;
25
- typeMessage: MessageTypeSupportChatEnum;
26
- file?: string;
27
- adminName?: string;
28
- adminFamily?: string;
29
- createdAt: string;
30
- }[];
31
- status?: SupportChatStatusEnum;
32
- createdAt?: string;
33
- updatedAt?: string;
34
- }
35
- declare const SupportChat: SupportChatModel;
36
- export { SupportChat };
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SupportChat = void 0;
7
- const mongoose_1 = __importDefault(require("mongoose"));
8
- const mongoose_update_if_current_1 = require("mongoose-update-if-current");
9
- const supportChat_1 = require("../../enums/supportChat");
10
- const supportChatSchema = new mongoose_1.default.Schema({
11
- userId: {
12
- type: mongoose_1.default.Schema.Types.ObjectId,
13
- ref: 'User',
14
- required: true,
15
- },
16
- messages: [{
17
- file: {
18
- type: String,
19
- required: false,
20
- },
21
- message: {
22
- type: String,
23
- required: true,
24
- },
25
- adminName: {
26
- type: String,
27
- required: false,
28
- },
29
- adminFamily: {
30
- type: String,
31
- required: false,
32
- },
33
- typeMessage: {
34
- type: String,
35
- required: true,
36
- default: supportChat_1.MessageTypeSupportChatEnum.user
37
- },
38
- createdAt: {
39
- type: mongoose_1.default.Schema.Types.Date,
40
- }
41
- }],
42
- status: {
43
- type: String,
44
- enum: supportChat_1.SupportChatStatusEnum,
45
- default: supportChat_1.SupportChatStatusEnum.start,
46
- },
47
- createdAt: {
48
- type: mongoose_1.default.Schema.Types.Date,
49
- },
50
- updatedAt: {
51
- type: mongoose_1.default.Schema.Types.Date,
52
- },
53
- }, {
54
- timestamps: true,
55
- });
56
- supportChatSchema.set('versionKey', 'version');
57
- supportChatSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
58
- supportChatSchema.index({ 'userId': 1 });
59
- supportChatSchema.statics.build = (attrs) => {
60
- return new SupportChat(attrs);
61
- };
62
- const SupportChat = mongoose_1.default.model('SupportChat', supportChatSchema);
63
- exports.SupportChat = SupportChat;