@common_ch/common 1.0.318 → 1.0.320

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.
@@ -2,6 +2,13 @@ import mongoose from 'mongoose';
2
2
  import { UserDoc } from './user';
3
3
  import { PromptTypeEnum } from '../../enums/prompt';
4
4
  import { AiDoc } from './ai';
5
+ interface PersonalityPrompt {
6
+ prompt: string;
7
+ personalityId: string;
8
+ name: string;
9
+ job: string;
10
+ others: string;
11
+ }
5
12
  export interface PromptAttrs {
6
13
  _id?: string;
7
14
  prompt: string;
@@ -9,6 +16,7 @@ export interface PromptAttrs {
9
16
  promptType: PromptTypeEnum;
10
17
  personalityName?: string;
11
18
  aiId?: string | AiDoc;
19
+ personalityPrompt?: PersonalityPrompt;
12
20
  description?: string;
13
21
  version?: number;
14
22
  createdAt?: string;
@@ -23,6 +31,7 @@ export interface PromptDoc extends mongoose.Document {
23
31
  userId?: string | UserDoc;
24
32
  personalityName?: string;
25
33
  promptType: PromptTypeEnum;
34
+ personalityPrompt?: PersonalityPrompt;
26
35
  aiId?: string | AiDoc;
27
36
  description?: string;
28
37
  version?: number;
@@ -7,6 +7,29 @@ exports.Prompt = void 0;
7
7
  const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const mongoose_update_if_current_1 = require("mongoose-update-if-current");
9
9
  const prompt_1 = require("../../enums/prompt");
10
+ const PersonalityPromptSchema = new mongoose_1.default.Schema({
11
+ personalityId: {
12
+ type: mongoose_1.default.Schema.Types.ObjectId,
13
+ ref: 'Prompt',
14
+ required: false,
15
+ },
16
+ prompt: {
17
+ type: String,
18
+ required: false,
19
+ },
20
+ name: {
21
+ type: String,
22
+ required: false,
23
+ },
24
+ job: {
25
+ type: String,
26
+ required: false,
27
+ },
28
+ others: {
29
+ type: String,
30
+ required: false,
31
+ }
32
+ }, { _id: false });
10
33
  const promptSchema = new mongoose_1.default.Schema({
11
34
  prompt: {
12
35
  type: String,
@@ -20,6 +43,10 @@ const promptSchema = new mongoose_1.default.Schema({
20
43
  type: String,
21
44
  required: false,
22
45
  },
46
+ personalityPrompt: {
47
+ type: PersonalityPromptSchema,
48
+ required: false,
49
+ },
23
50
  promptType: {
24
51
  type: String,
25
52
  enum: prompt_1.PromptTypeEnum,
@@ -22,6 +22,7 @@ export interface UserAttrs {
22
22
  password?: string;
23
23
  family?: string;
24
24
  updatedPortal?: boolean;
25
+ personalPrompt?: boolean;
25
26
  createdAt?: number;
26
27
  updatedAt?: number;
27
28
  }
@@ -51,6 +52,7 @@ export interface UserDoc extends mongoose.Document {
51
52
  family?: string;
52
53
  apiUsed?: number;
53
54
  updatedPortal?: boolean;
55
+ personalPrompt?: boolean;
54
56
  createdAt?: number;
55
57
  updatedAt?: number;
56
58
  updateWalletBalance(amount: number): Promise<{
@@ -105,6 +105,11 @@ const userSchema = new mongoose_1.default.Schema({
105
105
  required: true,
106
106
  default: 0
107
107
  },
108
+ personalPrompt: {
109
+ type: Boolean,
110
+ required: false,
111
+ default: false,
112
+ },
108
113
  status: {
109
114
  type: String,
110
115
  enum: user_1.UserStatusEnum,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common_ch/common",
3
- "version": "1.0.318",
3
+ "version": "1.0.320",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [