@common_ch/common 1.0.336 → 1.0.338

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.
@@ -8,7 +8,7 @@ export interface BlogCreatedEvent {
8
8
  title: string;
9
9
  shortDescription: string;
10
10
  description: string;
11
- categoryId: string;
11
+ categoryId: Types.ObjectId;
12
12
  mainPic: string;
13
13
  alt: string;
14
14
  anotherPics?: string[];
@@ -10,9 +10,9 @@ export interface DiscountAttrs {
10
10
  code: string;
11
11
  startDate: Date;
12
12
  endDate: Date;
13
- users: string[] | UserDoc[];
13
+ users: Types.ObjectId[] | UserDoc[];
14
14
  version: number;
15
- plan?: PlanDoc | string;
15
+ plan?: PlanDoc | Types.ObjectId;
16
16
  status?: DiscountStatusEnum;
17
17
  createdAt?: string;
18
18
  updatedAt?: string;
@@ -28,8 +28,8 @@ export interface DiscountDoc extends mongoose.Document {
28
28
  startDate: Date;
29
29
  endDate: Date;
30
30
  code: string;
31
- users: UserDoc[] | string[];
32
- plan?: PlanDoc | string;
31
+ users: UserDoc[] | Types.ObjectId[];
32
+ plan?: PlanDoc | Types.ObjectId;
33
33
  status: DiscountStatusEnum;
34
34
  version: number;
35
35
  createdAt?: string;
@@ -2,7 +2,7 @@ import mongoose, { Types } from 'mongoose';
2
2
  import { FeedbackTypeEnum } from '../../events/app/feedback/feedback-create-event';
3
3
  export interface FeedbackAttrs {
4
4
  userId: Types.ObjectId;
5
- aiId?: string;
5
+ aiId?: Types.ObjectId;
6
6
  comment?: string;
7
7
  type: FeedbackTypeEnum;
8
8
  createdAt?: number;
@@ -14,7 +14,7 @@ interface FeedbackModel extends mongoose.Model<FeedbackDoc> {
14
14
  export interface FeedbackDoc extends mongoose.Document {
15
15
  _id: Types.ObjectId;
16
16
  userId: Types.ObjectId;
17
- aiId?: string;
17
+ aiId?: Types.ObjectId;
18
18
  comment?: string;
19
19
  rating?: number;
20
20
  type: FeedbackTypeEnum;
@@ -2,7 +2,7 @@ import mongoose, { Types } from 'mongoose';
2
2
  import { AiAttrs } from './ai';
3
3
  import { ImageRoleEnum } from '../../enums/image';
4
4
  export type Images = {
5
- ai: string | AiAttrs;
5
+ ai: Types.ObjectId | AiAttrs;
6
6
  role: ImageRoleEnum;
7
7
  content: string;
8
8
  deleted?: boolean;
@@ -11,7 +11,7 @@ export type Images = {
11
11
  export interface ImageAttrs {
12
12
  userId: Types.ObjectId;
13
13
  imageName: string;
14
- planId?: string;
14
+ planId?: Types.ObjectId;
15
15
  images: Images[];
16
16
  chatGptTokenNumber?: number;
17
17
  geminiTokenNumber?: number;
@@ -59,9 +59,9 @@ interface MessageModel extends mongoose.Model<MessageDoc> {
59
59
  export interface MessageDoc extends mongoose.Document {
60
60
  _id: Types.ObjectId;
61
61
  userId: Types.ObjectId;
62
- ai: string | AiAttrs | AiDoc;
62
+ ai: Types.ObjectId | AiAttrs | AiDoc;
63
63
  messageName: string;
64
- planId?: string;
64
+ planId?: Types.ObjectId;
65
65
  threadChatgptId?: string;
66
66
  chatGptTokenNumber?: number;
67
67
  chatGptFiles?: {
@@ -35,7 +35,7 @@ export interface SharedMessageDoc extends mongoose.Document {
35
35
  fileIds?: string[];
36
36
  };
37
37
  messages: Messages[];
38
- ai: string | AiAttrs | AiDoc;
38
+ ai: Types.ObjectId | AiAttrs | AiDoc;
39
39
  messagesGemini: ContentGemini[];
40
40
  fileRefs: mongoose.Types.ObjectId[] | FileReferenceGeminiDoc[];
41
41
  version: number;
@@ -4,7 +4,7 @@ import { PlanTypeEnum } from '../../events/types_/plan';
4
4
  import { PlanStatusEnum, ToolsChatgpt, TypePayEnum } from '../../enums/plan';
5
5
  import { AiOptionNamesEnum } from '../../enums/ai';
6
6
  export interface PlanAttrs {
7
- _id?: string;
7
+ _id?: Types.ObjectId;
8
8
  price: string;
9
9
  name: string;
10
10
  points: number;
@@ -10,12 +10,12 @@ interface PersonalityPrompt {
10
10
  others?: string;
11
11
  }
12
12
  export interface PromptAttrs {
13
- _id?: string;
13
+ _id?: Types.ObjectId;
14
14
  prompt: string;
15
- userId?: string | UserDoc;
15
+ userId?: Types.ObjectId | UserDoc;
16
16
  promptType: PromptTypeEnum;
17
17
  personalityName?: string;
18
- aiId?: string | AiDoc;
18
+ aiId?: Types.ObjectId | AiDoc;
19
19
  personalityPrompt?: PersonalityPrompt;
20
20
  description?: string;
21
21
  version?: number;
@@ -12,7 +12,7 @@ export interface TicketAttrs {
12
12
  createdAt: string;
13
13
  }[];
14
14
  type: TicketTypeEnum;
15
- adminId?: string;
15
+ adminId?: Types.ObjectId;
16
16
  status?: TicketStatusEnum;
17
17
  createdAt?: string;
18
18
  updatedAt?: string;
@@ -33,7 +33,7 @@ export interface TicketDoc extends mongoose.Document {
33
33
  createdAt: string;
34
34
  }[];
35
35
  type: TicketTypeEnum;
36
- adminId?: string;
36
+ adminId?: Types.ObjectId;
37
37
  status?: TicketStatusEnum;
38
38
  version: number;
39
39
  createdAt?: string;
@@ -1,10 +1,10 @@
1
1
  import mongoose, { Types } from 'mongoose';
2
2
  import { TransactionStatusEnum } from '../../enums/transaction';
3
3
  export interface TransactionAttrs {
4
- _id?: string;
4
+ _id?: Types.ObjectId;
5
5
  description: string;
6
6
  userId: Types.ObjectId;
7
- planId?: string;
7
+ planId?: Types.ObjectId;
8
8
  amount: number;
9
9
  transaction_data?: object;
10
10
  payment_data?: object;
@@ -19,7 +19,7 @@ export interface TransactionDoc extends mongoose.Document {
19
19
  _id: Types.ObjectId;
20
20
  description: string;
21
21
  userId: Types.ObjectId;
22
- planId?: string;
22
+ planId?: Types.ObjectId;
23
23
  amount: number;
24
24
  transaction_data?: object;
25
25
  authority?: string;
@@ -13,7 +13,7 @@ export interface UsageAiAttrs {
13
13
  requestType: RequestType;
14
14
  mimeTypeFile?: string;
15
15
  filePath?: string;
16
- ai?: string;
16
+ ai?: Types.ObjectId;
17
17
  modelAi?: string;
18
18
  promptTokens?: number;
19
19
  completionTokens?: number;
@@ -33,7 +33,7 @@ export interface UsageAiDoc extends mongoose.Document {
33
33
  userId: Types.ObjectId;
34
34
  mimeTypeFile?: string;
35
35
  filePath?: string;
36
- ai?: string;
36
+ ai?: Types.ObjectId;
37
37
  requestType: RequestType;
38
38
  modelAi?: string;
39
39
  promptTokens?: number;
@@ -4,7 +4,7 @@ import { UserStatusEnum } from '../../enums/user';
4
4
  export interface UserAttrs {
5
5
  _id: Types.ObjectId;
6
6
  walletBalance?: mongoose.Types.Decimal128;
7
- planId?: string;
7
+ planId?: Types.ObjectId;
8
8
  planName?: string;
9
9
  startTimePlan?: string;
10
10
  exTimePlan?: string;
@@ -4,9 +4,9 @@ import { SpeechTypeEnum } from '../../enums/voice';
4
4
  export interface SpeechAttrs {
5
5
  userId: Types.ObjectId;
6
6
  speechName: string;
7
- planId?: string;
7
+ planId?: Types.ObjectId;
8
8
  speech: {
9
- ai: string | AiAttrs;
9
+ ai: Types.ObjectId | AiAttrs;
10
10
  type: SpeechTypeEnum;
11
11
  file: string;
12
12
  content: string;
@@ -25,9 +25,9 @@ interface SpeechDoc extends mongoose.Document {
25
25
  _id: Types.ObjectId;
26
26
  userId: Types.ObjectId;
27
27
  speechName: string;
28
- planId?: string;
28
+ planId?: Types.ObjectId;
29
29
  speech: {
30
- ai: string | AiDoc;
30
+ ai: Types.ObjectId | AiDoc;
31
31
  type: SpeechTypeEnum;
32
32
  file: string;
33
33
  content: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common_ch/common",
3
- "version": "1.0.336",
3
+ "version": "1.0.338",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [