@common_ch/common 1.0.280 → 1.0.282

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.
@@ -1,3 +1,4 @@
1
+ import { AiOptionNamesEnum } from "../../../enums/ai";
1
2
  import { ToolsChatgpt, TypePayEnum } from "../../../enums/plan";
2
3
  import { AiDoc } from "../../../models/app/ai";
3
4
  import { Subjects } from "../../subjects";
@@ -20,6 +21,7 @@ export interface PlanCreateEvent {
20
21
  tools: {
21
22
  chatgpt?: ToolsChatgpt[];
22
23
  };
24
+ models: AiOptionNamesEnum[];
23
25
  userOwn?: string;
24
26
  };
25
27
  }
@@ -1,3 +1,4 @@
1
+ import { AiOptionNamesEnum } from "../../../enums/ai";
1
2
  import { ToolsChatgpt, TypePayEnum } from "../../../enums/plan";
2
3
  import { AiDoc } from "../../../models/app/ai";
3
4
  import { Subjects } from "../../subjects";
@@ -20,6 +21,7 @@ export interface PlanUpdateEvent {
20
21
  tools: {
21
22
  chatgpt?: ToolsChatgpt[];
22
23
  };
24
+ models: AiOptionNamesEnum[];
23
25
  typePay: TypePayEnum;
24
26
  };
25
27
  }
@@ -1,8 +1,8 @@
1
1
  import mongoose from 'mongoose';
2
- import { AiOptionFieldEnum, AiOptionStatusEnum } from '../../enums/ai';
2
+ import { AiOptionFieldEnum, AiOptionNamesEnum, AiOptionStatusEnum } from '../../enums/ai';
3
3
  export interface AiOptionAttrs {
4
4
  _id: string;
5
- name: string;
5
+ name: AiOptionNamesEnum;
6
6
  image?: string;
7
7
  description?: string;
8
8
  defaultShow?: boolean;
@@ -17,7 +17,7 @@ interface AiOptionModel extends mongoose.Model<AiOptionDoc> {
17
17
  }
18
18
  export interface AiOptionDoc extends mongoose.Document {
19
19
  _id: string;
20
- name: string;
20
+ name: AiOptionNamesEnum;
21
21
  field: AiOptionFieldEnum;
22
22
  aiId: string;
23
23
  status: AiOptionStatusEnum;
@@ -10,6 +10,8 @@ const ai_1 = require("../../enums/ai");
10
10
  const aiOptionSchema = new mongoose_1.default.Schema({
11
11
  name: {
12
12
  type: String,
13
+ enum: ai_1.AiOptionNamesEnum,
14
+ unique: true,
13
15
  required: true,
14
16
  },
15
17
  image: {
@@ -2,6 +2,7 @@ import mongoose from 'mongoose';
2
2
  import { AiDoc } from './ai';
3
3
  import { PlanTypeEnum } from '../../events/types_/plan';
4
4
  import { PlanStatusEnum, ToolsChatgpt, TypePayEnum } from '../../enums/plan';
5
+ import { AiOptionNamesEnum } from '../../enums/ai';
5
6
  export interface PlanAttrs {
6
7
  _id?: string;
7
8
  price: string;
@@ -13,6 +14,7 @@ export interface PlanAttrs {
13
14
  tools: {
14
15
  chatgpt: ToolsChatgpt[];
15
16
  };
17
+ models: AiOptionNamesEnum[];
16
18
  description?: string;
17
19
  descriptionArray?: string[];
18
20
  status?: PlanStatusEnum;
@@ -35,6 +37,7 @@ export interface PlanDoc extends mongoose.Document {
35
37
  tools: {
36
38
  chatgpt: ToolsChatgpt[];
37
39
  };
40
+ models: AiOptionNamesEnum[];
38
41
  ais: string[] | AiDoc[];
39
42
  description?: string;
40
43
  descriptionArray?: string[];
@@ -8,6 +8,7 @@ const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const mongoose_update_if_current_1 = require("mongoose-update-if-current");
9
9
  const plan_1 = require("../../events/types_/plan");
10
10
  const plan_2 = require("../../enums/plan");
11
+ const ai_1 = require("../../enums/ai");
11
12
  const planSchema = new mongoose_1.default.Schema({
12
13
  price: {
13
14
  type: String,
@@ -30,6 +31,13 @@ const planSchema = new mongoose_1.default.Schema({
30
31
  },
31
32
  ],
32
33
  },
34
+ models: [
35
+ {
36
+ type: String,
37
+ enum: ai_1.AiOptionNamesEnum,
38
+ required: true,
39
+ }
40
+ ],
33
41
  limitUploadFiles: {
34
42
  type: Number,
35
43
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common_ch/common",
3
- "version": "1.0.280",
3
+ "version": "1.0.282",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [