@common_ch/common 1.0.333 → 1.0.337

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.
Files changed (85) hide show
  1. package/build/events/app/feedback/feedback-create-event.d.ts +3 -2
  2. package/build/events/app/message/message-summary-messageId-event.d.ts +2 -1
  3. package/build/events/app/message/message-summary-new-chat-event.d.ts +2 -1
  4. package/build/events/app/message/use-message-by-user-event.d.ts +3 -2
  5. package/build/events/app/rate/rate-created-event.d.ts +4 -3
  6. package/build/events/app/ticket/ticket-created-event.d.ts +3 -2
  7. package/build/events/app/ticket/ticket-done-by-user.d.ts +2 -1
  8. package/build/events/app/ticket/ticket-response-by-user.d.ts +2 -1
  9. package/build/events/app/transaction/create-transaction.d.ts +4 -3
  10. package/build/events/app/transaction/transaction-successful.d.ts +3 -2
  11. package/build/events/app/user/user-update-all-version-event.d.ts +3 -2
  12. package/build/events/app/user/user-update-wallet-event.d.ts +2 -1
  13. package/build/events/auth/admin/admin-created-event.d.ts +2 -1
  14. package/build/events/auth/user/log-user-login-event.d.ts +3 -2
  15. package/build/events/auth/user/user-created-event.d.ts +2 -1
  16. package/build/events/auth/user/user-update-in-auth.d.ts +2 -1
  17. package/build/events/auth/user/user-updated-password-event.d.ts +2 -1
  18. package/build/events/portal/admin/admin-change-status-event.d.ts +2 -1
  19. package/build/events/portal/admin/admin-updated-event.d.ts +2 -1
  20. package/build/events/portal/admin/admin-updated-password-event.d.ts +2 -1
  21. package/build/events/portal/ai/ai-changeStatus-event.d.ts +2 -1
  22. package/build/events/portal/ai/ai-created-event.d.ts +2 -1
  23. package/build/events/portal/ai/ai-set-default-show-event.d.ts +2 -1
  24. package/build/events/portal/ai/ai-unset-defaultShow-event.d.ts +2 -1
  25. package/build/events/portal/ai/ai-update-event.d.ts +2 -1
  26. package/build/events/portal/ai-option/ai-option-changeStatus-event.d.ts +2 -1
  27. package/build/events/portal/ai-option/ai-option-created-event.d.ts +3 -2
  28. package/build/events/portal/ai-option/ai-option-set-default-show-event.d.ts +2 -1
  29. package/build/events/portal/ai-option/ai-option-unset-defaultShow-event.d.ts +2 -1
  30. package/build/events/portal/ai-option/ai-option-updated-event.d.ts +3 -2
  31. package/build/events/portal/blog/blog-change-status-event.d.ts +2 -1
  32. package/build/events/portal/blog/blog-create-event.d.ts +2 -1
  33. package/build/events/portal/blog/blog-update-event.d.ts +2 -1
  34. package/build/events/portal/blog-category/blog-category-change-status-event.d.ts +2 -1
  35. package/build/events/portal/blog-category/blog-category-create-event.d.ts +2 -1
  36. package/build/events/portal/blog-category/blog-category-update-event.d.ts +2 -1
  37. package/build/events/portal/discount/discount-change-code-event.d.ts +2 -1
  38. package/build/events/portal/discount/discount-change-status-event.d.ts +2 -1
  39. package/build/events/portal/discount/discount-create-event.d.ts +2 -1
  40. package/build/events/portal/discount/discount-update-event.d.ts +4 -3
  41. package/build/events/portal/org/org-change-status-event.d.ts +2 -1
  42. package/build/events/portal/org/org-created-event.d.ts +2 -1
  43. package/build/events/portal/org/org-updated-event.d.ts +2 -1
  44. package/build/events/portal/plan/plan-change-status-event.d.ts +2 -1
  45. package/build/events/portal/plan/plan-create-event.d.ts +3 -2
  46. package/build/events/portal/plan/plan-update-event.d.ts +2 -1
  47. package/build/events/portal/plan/set-plan-by-user-in-portal.d.ts +3 -2
  48. package/build/events/portal/plan-org/plan-org-change-status-event.d.ts +3 -2
  49. package/build/events/portal/plan-org/plan-org-create-event.d.ts +3 -2
  50. package/build/events/portal/plan-org/plan-org-update-event.d.ts +3 -2
  51. package/build/events/portal/prompt/prompt-create-event.d.ts +4 -3
  52. package/build/events/portal/prompt/prompt-update-event.d.ts +4 -3
  53. package/build/events/portal/ticket/ticket-answered-event.d.ts +2 -1
  54. package/build/events/portal/transaction/increaseOrDecreaseBalance-event.d.ts +3 -2
  55. package/build/events/portal/user/setPlanForUserEvent.d.ts +3 -2
  56. package/build/events/portal/user/user-change-limit-event.d.ts +2 -1
  57. package/build/events/portal/user/user-change-status-event.d.ts +2 -1
  58. package/build/events/portal/user/user-update-version-event.d.ts +2 -1
  59. package/build/events/portal/user/user-updated-event.d.ts +2 -1
  60. package/build/events/portal/user/user-updated-password-event.d.ts +2 -1
  61. package/build/events/portal/user/user-updated-wallet-event.d.ts +2 -1
  62. package/build/middlewares/current-admin-org.d.ts +2 -1
  63. package/build/middlewares/current-admin.d.ts +2 -1
  64. package/build/middlewares/current-user.d.ts +2 -1
  65. package/build/models/app/ai-option.d.ts +5 -5
  66. package/build/models/app/ai.d.ts +4 -4
  67. package/build/models/app/archiveMessage.d.ts +6 -6
  68. package/build/models/app/blog-category.d.ts +3 -3
  69. package/build/models/app/blog.d.ts +5 -5
  70. package/build/models/app/defaults-user.d.ts +9 -9
  71. package/build/models/app/discount.d.ts +7 -7
  72. package/build/models/app/feedback.d.ts +6 -6
  73. package/build/models/app/fileReferenceGemini.d.ts +4 -4
  74. package/build/models/app/image.d.ts +6 -6
  75. package/build/models/app/message.d.ts +8 -8
  76. package/build/models/app/messageShared.d.ts +7 -7
  77. package/build/models/app/plan.d.ts +3 -3
  78. package/build/models/app/prompt.d.ts +5 -5
  79. package/build/models/app/rate.d.ts +6 -6
  80. package/build/models/app/ticket.d.ts +6 -6
  81. package/build/models/app/transaction.d.ts +7 -7
  82. package/build/models/app/usage.d.ts +6 -6
  83. package/build/models/app/user.d.ts +4 -4
  84. package/build/models/app/voice.d.ts +8 -8
  85. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  import { PlanOrgStatusEnum } from "../../types_/plan";
3
4
  export interface PlanOrgChangeStatusEvent {
4
5
  subject: Subjects.PlanOrgChangeStatus;
5
6
  data: {
6
- id: string;
7
+ id: Types.ObjectId;
7
8
  status: PlanOrgStatusEnum;
8
- orgId?: string;
9
+ orgId?: Types.ObjectId;
9
10
  version: number;
10
11
  };
11
12
  }
@@ -1,3 +1,4 @@
1
+ import { Types } from "mongoose";
1
2
  import { TypePayEnum } from "../../../enums/plan";
2
3
  import { AiDoc } from "../../../models/app/ai";
3
4
  import { Subjects } from "../../subjects";
@@ -5,14 +6,14 @@ import { PlanOrgTypeEnum } from "../../types_/plan";
5
6
  export interface PlanOrgCreateEvent {
6
7
  subject: Subjects.PlanOrgCreated;
7
8
  data: {
8
- id: string;
9
+ id: Types.ObjectId;
9
10
  name: string;
10
11
  price: string;
11
12
  limitOfRequest: number;
12
13
  description: string;
13
14
  limitUploadFiles: number;
14
15
  ais: AiDoc[];
15
- orgId?: string;
16
+ orgId?: Types.ObjectId;
16
17
  deleteFile: boolean;
17
18
  type: PlanOrgTypeEnum;
18
19
  numberOfUsers: number;
@@ -1,3 +1,4 @@
1
+ import { Types } from "mongoose";
1
2
  import { TypePayEnum } from "../../../enums/plan";
2
3
  import { AiDoc } from "../../../models/app/ai";
3
4
  import { Subjects } from "../../subjects";
@@ -5,7 +6,7 @@ import { PlanOrgTypeEnum } from "../../types_/plan";
5
6
  export interface PlanOrgUpdateEvent {
6
7
  subject: Subjects.PlanOrgUpdated;
7
8
  data: {
8
- id: string;
9
+ id: Types.ObjectId;
9
10
  version: number;
10
11
  name: string;
11
12
  price: string;
@@ -13,7 +14,7 @@ export interface PlanOrgUpdateEvent {
13
14
  description: string;
14
15
  limitUploadFiles: number;
15
16
  ais: AiDoc[];
16
- orgId?: string;
17
+ orgId?: Types.ObjectId;
17
18
  type: PlanOrgTypeEnum;
18
19
  deleteFile: boolean;
19
20
  numberOfUsers: number;
@@ -1,11 +1,12 @@
1
+ import { Types } from "mongoose";
1
2
  import { PromptTypeEnum } from "../../../enums/prompt";
2
3
  import { Subjects } from "../../subjects";
3
4
  export interface PromptCreatedEvent {
4
5
  subject: Subjects.PromptCreated;
5
6
  data: {
6
- id: string;
7
- userId?: string;
8
- aiId?: string;
7
+ id: Types.ObjectId;
8
+ userId?: Types.ObjectId;
9
+ aiId?: Types.ObjectId;
9
10
  promptType: PromptTypeEnum;
10
11
  prompt: string;
11
12
  description?: string;
@@ -1,11 +1,12 @@
1
+ import { Types } from "mongoose";
1
2
  import { PromptTypeEnum } from "../../../enums/prompt";
2
3
  import { Subjects } from "../../subjects";
3
4
  export interface PromptUpdateEvent {
4
5
  subject: Subjects.PromptUpdated;
5
6
  data: {
6
- id: string;
7
- userId?: string;
8
- aiId?: string;
7
+ id: Types.ObjectId;
8
+ userId?: Types.ObjectId;
9
+ aiId?: Types.ObjectId;
9
10
  promptType: PromptTypeEnum;
10
11
  prompt: string;
11
12
  description?: string;
@@ -1,9 +1,10 @@
1
+ import { Types } from "mongoose";
1
2
  import { MessageTypeTicketEnum, TicketStatusEnum } from "../../../enums/ticket";
2
3
  import { Subjects } from "../../subjects";
3
4
  export interface TicketAnsweredEvent {
4
5
  subject: Subjects.TicketAnswered;
5
6
  data: {
6
- id: string;
7
+ id: Types.ObjectId;
7
8
  version: number;
8
9
  messages: {
9
10
  message: string;
@@ -1,12 +1,13 @@
1
+ import { Types } from "mongoose";
1
2
  import { TransactionStatusEnum } from "../../../enums/transaction";
2
3
  import { Subjects } from "../../subjects";
3
4
  export interface IncreaseOrDecreaseBalanceEvent {
4
5
  subject: Subjects.IncreaseOrDecreaseBalanceTransaction;
5
6
  data: {
6
- id: string;
7
+ id: Types.ObjectId;
7
8
  authority: string;
8
9
  description: string;
9
- userId: string;
10
+ userId: Types.ObjectId;
10
11
  status: TransactionStatusEnum;
11
12
  amount: number;
12
13
  };
@@ -1,9 +1,10 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  export interface SetPlanForUserEvent {
3
4
  subject: Subjects.SetPlanForUserInPortal;
4
5
  data: {
5
- userId: string;
6
- planId: string;
6
+ userId: Types.ObjectId;
7
+ planId: Types.ObjectId;
7
8
  amountApiExistPlan: number;
8
9
  amountUploadExistPlan: number;
9
10
  exTimePlan: string;
@@ -1,8 +1,9 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  export interface UserChangeLimitEvent {
3
4
  subject: Subjects.UserChangeLimit;
4
5
  data: {
5
- id: string;
6
+ id: Types.ObjectId;
6
7
  versionLimit: number;
7
8
  limit: boolean;
8
9
  limitNumberOfUsers: number;
@@ -1,9 +1,10 @@
1
+ import { Types } from "mongoose";
1
2
  import { UserStatusEnum } from "../../../enums/user";
2
3
  import { Subjects } from "../../subjects";
3
4
  export interface UserChangedStatusInPortalEvent {
4
5
  subject: Subjects.UserChangedStatusInPortal;
5
6
  data: {
6
- id: string;
7
+ id: Types.ObjectId;
7
8
  status: UserStatusEnum;
8
9
  version: number;
9
10
  };
@@ -1,8 +1,9 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  export interface UserUpdateVersionRequestEvent {
3
4
  subject: Subjects.UserUpdateVersionRequest;
4
5
  data: {
5
- userId: string;
6
+ userId: Types.ObjectId;
6
7
  versionUser: number;
7
8
  };
8
9
  }
@@ -1,8 +1,9 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  export interface UserUpdatedInPortalEvent {
3
4
  subject: Subjects.UserUpdatedInPortal;
4
5
  data: {
5
- id: string;
6
+ id: Types.ObjectId;
6
7
  version: number;
7
8
  name: string;
8
9
  family: string;
@@ -1,8 +1,9 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  export interface UserUpdatedPasswordInPortalEvent {
3
4
  subject: Subjects.UserUpdatedPasswordInPortal;
4
5
  data: {
5
- id: string;
6
+ id: Types.ObjectId;
6
7
  version: number;
7
8
  password: string;
8
9
  };
@@ -1,8 +1,9 @@
1
+ import { Types } from "mongoose";
1
2
  import { Subjects } from "../../subjects";
2
3
  export interface UserUpdatedWalletInPortalEvent {
3
4
  subject: Subjects.UserUpdatedWalletInPortal;
4
5
  data: {
5
- id: string;
6
+ id: Types.ObjectId;
6
7
  version: number;
7
8
  newAmount: string;
8
9
  };
@@ -1,6 +1,7 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
+ import { Types } from 'mongoose';
2
3
  interface AdminOrgPayload {
3
- _id: string;
4
+ _id: Types.ObjectId;
4
5
  email: string;
5
6
  username: string;
6
7
  mobile: string;
@@ -1,6 +1,7 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
+ import { Types } from 'mongoose';
2
3
  interface UserPayload {
3
- _id: string;
4
+ _id: Types.ObjectId;
4
5
  email: string;
5
6
  username: string;
6
7
  mobile: string;
@@ -1,6 +1,7 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
+ import { Types } from 'mongoose';
2
3
  interface UserPayload {
3
- _id: string;
4
+ _id: Types.ObjectId;
4
5
  email: string;
5
6
  username: string;
6
7
  mobile: string;
@@ -1,14 +1,14 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { AiOptionFieldEnum, AiOptionNamesEnum, AiOptionStatusEnum } from '../../enums/ai';
3
3
  export interface AiOptionAttrs {
4
- _id: string;
4
+ _id: Types.ObjectId;
5
5
  name: AiOptionNamesEnum;
6
6
  image?: string;
7
7
  description?: string;
8
8
  defaultShow?: boolean;
9
9
  status?: AiOptionStatusEnum;
10
10
  field: AiOptionFieldEnum;
11
- aiId: string;
11
+ aiId: Types.ObjectId;
12
12
  inputPrice: number;
13
13
  outputPrice: number;
14
14
  cachePrice: number;
@@ -19,10 +19,10 @@ interface AiOptionModel extends mongoose.Model<AiOptionDoc> {
19
19
  build(attrs: AiOptionAttrs): AiOptionDoc;
20
20
  }
21
21
  export interface AiOptionDoc extends mongoose.Document {
22
- _id: string;
22
+ _id: Types.ObjectId;
23
23
  name: AiOptionNamesEnum;
24
24
  field: AiOptionFieldEnum;
25
- aiId: string;
25
+ aiId: Types.ObjectId;
26
26
  status: AiOptionStatusEnum;
27
27
  version: number;
28
28
  image?: string;
@@ -1,7 +1,7 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { AiStatusEnum } from '../../events/types_/ai';
3
3
  export interface AiAttrs {
4
- _id: string;
4
+ _id: Types.ObjectId;
5
5
  name: string;
6
6
  status?: AiStatusEnum;
7
7
  defaultShow?: boolean;
@@ -12,7 +12,7 @@ export interface AiAttrs {
12
12
  updatedAt?: number;
13
13
  }
14
14
  export interface AiDoc extends mongoose.Document {
15
- _id: string;
15
+ _id: Types.ObjectId;
16
16
  name: string;
17
17
  status: AiStatusEnum;
18
18
  version: number;
@@ -26,7 +26,7 @@ export interface AiDoc extends mongoose.Document {
26
26
  interface AiModel extends mongoose.Model<AiDoc> {
27
27
  build(attrs: AiAttrs): AiDoc;
28
28
  findByEvent(event: {
29
- id: string;
29
+ id: Types.ObjectId;
30
30
  version: number;
31
31
  }): Promise<AiDoc | null>;
32
32
  }
@@ -1,7 +1,7 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  export interface ArchiveMessageAttrs {
3
- userId: string;
4
- messageId: string;
3
+ userId: Types.ObjectId;
4
+ messageId: Types.ObjectId;
5
5
  createdAt?: string;
6
6
  updatedAt?: string;
7
7
  }
@@ -9,9 +9,9 @@ interface ArchiveMessageModel extends mongoose.Model<ArchiveMessageDoc> {
9
9
  build(attrs: ArchiveMessageAttrs): ArchiveMessageDoc;
10
10
  }
11
11
  interface ArchiveMessageDoc extends mongoose.Document {
12
- _id: string;
13
- userId: string;
14
- messageId: string;
12
+ _id: Types.ObjectId;
13
+ userId: Types.ObjectId;
14
+ messageId: Types.ObjectId;
15
15
  createdAt?: string;
16
16
  updatedAt?: string;
17
17
  }
@@ -1,7 +1,7 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { BlogCategoryStatusEnum } from '../../enums/category';
3
3
  export interface BlogCategoryAttrs {
4
- _id: string;
4
+ _id: Types.ObjectId;
5
5
  title: string;
6
6
  description?: string;
7
7
  status?: BlogCategoryStatusEnum;
@@ -13,7 +13,7 @@ interface BlogCategoryModel extends mongoose.Model<BlogCategoryDoc> {
13
13
  build(attrs: BlogCategoryAttrs): BlogCategoryDoc;
14
14
  }
15
15
  export interface BlogCategoryDoc extends mongoose.Document {
16
- _id: string;
16
+ _id: Types.ObjectId;
17
17
  title: string;
18
18
  description?: string;
19
19
  status: BlogCategoryStatusEnum;
@@ -1,13 +1,13 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { BlogStatusEnum } from '../../enums/blog';
3
3
  export interface BlogAttrs {
4
- _id: string;
4
+ _id: Types.ObjectId;
5
5
  title: string;
6
6
  publishDate?: number;
7
7
  shortDescription: string;
8
8
  description: string;
9
9
  status: BlogStatusEnum;
10
- categoryId: string;
10
+ categoryId: Types.ObjectId;
11
11
  mainPic: string;
12
12
  alt: string;
13
13
  anotherPics?: string[];
@@ -18,14 +18,14 @@ interface BlogModel extends mongoose.Model<BlogDoc> {
18
18
  build(attrs: BlogAttrs): BlogDoc;
19
19
  }
20
20
  export interface BlogDoc extends mongoose.Document {
21
- _id: string;
21
+ _id: Types.ObjectId;
22
22
  version: number;
23
23
  title: string;
24
24
  publishDate?: number;
25
25
  shortDescription: string;
26
26
  description: string;
27
27
  status: BlogStatusEnum;
28
- categoryId: string;
28
+ categoryId: Types.ObjectId;
29
29
  mainPic: string;
30
30
  alt: string;
31
31
  anotherPics?: string[];
@@ -1,16 +1,16 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  export interface DefaultsUserAttrs {
3
- userId: string;
4
- aiOptionId: string;
5
- aiId: string;
3
+ userId: Types.ObjectId;
4
+ aiOptionId: Types.ObjectId;
5
+ aiId: Types.ObjectId;
6
6
  createdAt?: number;
7
7
  updatedAt?: number;
8
8
  }
9
9
  export interface DefaultsUserDoc extends mongoose.Document {
10
- _id: string;
11
- userId: string;
12
- aiOptionId: string;
13
- aiId: string;
10
+ _id: Types.ObjectId;
11
+ userId: Types.ObjectId;
12
+ aiOptionId: Types.ObjectId;
13
+ aiId: Types.ObjectId;
14
14
  version: number;
15
15
  createdAt?: number;
16
16
  updatedAt?: number;
@@ -18,7 +18,7 @@ export interface DefaultsUserDoc extends mongoose.Document {
18
18
  interface DefaultsUserModel extends mongoose.Model<DefaultsUserDoc> {
19
19
  build(attrs: DefaultsUserAttrs): DefaultsUserDoc;
20
20
  findByEvent(event: {
21
- id: string;
21
+ id: Types.ObjectId;
22
22
  version: number;
23
23
  }): Promise<DefaultsUserDoc | null>;
24
24
  }
@@ -1,18 +1,18 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { UserDoc } from './user';
3
3
  import { PlanDoc } from './plan';
4
4
  import { DiscountStatusEnum, DiscountType } from '../../enums/discount';
5
5
  export interface DiscountAttrs {
6
- _id: string;
6
+ _id: Types.ObjectId;
7
7
  title: string;
8
8
  type: DiscountType;
9
9
  amount: string;
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;
@@ -21,15 +21,15 @@ interface DiscountModel extends mongoose.Model<DiscountDoc> {
21
21
  build(attrs: DiscountAttrs): DiscountDoc;
22
22
  }
23
23
  export interface DiscountDoc extends mongoose.Document {
24
- _id: string;
24
+ _id: Types.ObjectId;
25
25
  title: string;
26
26
  type: DiscountType;
27
27
  amount: string;
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;
@@ -1,8 +1,8 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { FeedbackTypeEnum } from '../../events/app/feedback/feedback-create-event';
3
3
  export interface FeedbackAttrs {
4
- userId: string;
5
- aiId?: string;
4
+ userId: Types.ObjectId;
5
+ aiId?: Types.ObjectId;
6
6
  comment?: string;
7
7
  type: FeedbackTypeEnum;
8
8
  createdAt?: number;
@@ -12,9 +12,9 @@ interface FeedbackModel extends mongoose.Model<FeedbackDoc> {
12
12
  build(attrs: FeedbackAttrs): FeedbackDoc;
13
13
  }
14
14
  export interface FeedbackDoc extends mongoose.Document {
15
- _id: string;
16
- userId: string;
17
- aiId?: string;
15
+ _id: Types.ObjectId;
16
+ userId: Types.ObjectId;
17
+ aiId?: Types.ObjectId;
18
18
  comment?: string;
19
19
  rating?: number;
20
20
  type: FeedbackTypeEnum;
@@ -1,6 +1,6 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  export interface FileReferenceGeminiAttrs {
3
- geminiId: string;
3
+ geminiId: Types.ObjectId;
4
4
  fileUri: string;
5
5
  mimeType: string;
6
6
  displayName: string;
@@ -11,8 +11,8 @@ interface FileReferenceGeminiModel extends mongoose.Model<FileReferenceGeminiDoc
11
11
  build(attrs: FileReferenceGeminiAttrs): FileReferenceGeminiDoc;
12
12
  }
13
13
  export interface FileReferenceGeminiDoc extends mongoose.Document {
14
- _id: string;
15
- geminiId: string;
14
+ _id: Types.ObjectId;
15
+ geminiId: Types.ObjectId;
16
16
  fileUri: string;
17
17
  mimeType: string;
18
18
  displayName: string;
@@ -1,17 +1,17 @@
1
- import mongoose from 'mongoose';
1
+ 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;
9
9
  createdAt: string;
10
10
  };
11
11
  export interface ImageAttrs {
12
- userId: string;
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;
@@ -22,8 +22,8 @@ interface ImageModel extends mongoose.Model<ImageDoc> {
22
22
  build(attrs: ImageAttrs): ImageDoc;
23
23
  }
24
24
  export interface ImageDoc extends mongoose.Document {
25
- _id: string;
26
- userId: string;
25
+ _id: Types.ObjectId;
26
+ userId: Types.ObjectId;
27
27
  imageName: string;
28
28
  planId?: string;
29
29
  images: Images[];
@@ -1,11 +1,11 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { AiAttrs, AiDoc } from './ai';
3
3
  import { ContentGemini } from '../../enums/message';
4
4
  import { AiOptionAttrs, AiOptionDoc } from './ai-option';
5
5
  import { FileReferenceGeminiDoc } from './fileReferenceGemini';
6
6
  export type Content = {
7
7
  type: 'input_image';
8
- file_id: string;
8
+ file_id: Types.ObjectId;
9
9
  detail: 'auto';
10
10
  } | {
11
11
  type: 'input_text';
@@ -31,7 +31,7 @@ export type Messages = {
31
31
  createdAt: string;
32
32
  };
33
33
  export interface MessageAttrs {
34
- userId: string;
34
+ userId: Types.ObjectId;
35
35
  ai: string | AiAttrs | AiDoc;
36
36
  messageName: string;
37
37
  planId?: string;
@@ -57,11 +57,11 @@ interface MessageModel extends mongoose.Model<MessageDoc> {
57
57
  build(attrs: MessageAttrs): MessageDoc;
58
58
  }
59
59
  export interface MessageDoc extends mongoose.Document {
60
- _id: string;
61
- userId: string;
62
- ai: string | AiAttrs | AiDoc;
60
+ _id: Types.ObjectId;
61
+ userId: Types.ObjectId;
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?: {
@@ -99,7 +99,7 @@ export declare const ContentSchema: mongoose.Schema<any, mongoose.Model<any, any
99
99
  file_id?: string | null | undefined;
100
100
  detail?: "auto" | null | undefined;
101
101
  }> & {
102
- _id: mongoose.Types.ObjectId;
102
+ _id: Types.ObjectId;
103
103
  } & {
104
104
  __v: number;
105
105
  }>;
@@ -1,11 +1,11 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } from 'mongoose';
2
2
  import { AiAttrs, AiDoc } from './ai';
3
3
  import { ContentGemini } from '../../enums/message';
4
4
  import { Messages } from './message';
5
5
  import { FileReferenceGeminiDoc } from './fileReferenceGemini';
6
6
  export interface SharedMessageAttrs {
7
- messageId: string;
8
- userId: string;
7
+ messageId: Types.ObjectId;
8
+ userId: Types.ObjectId;
9
9
  shareMessageCode: string;
10
10
  messageName: string;
11
11
  chatGptFiles?: {
@@ -24,10 +24,10 @@ interface SharedMessageModel extends mongoose.Model<SharedMessageDoc> {
24
24
  build(attrs: SharedMessageAttrs): SharedMessageDoc;
25
25
  }
26
26
  export interface SharedMessageDoc extends mongoose.Document {
27
- _id: string;
28
- messageId: string;
27
+ _id: Types.ObjectId;
28
+ messageId: Types.ObjectId;
29
29
  shareMessageCode: string;
30
- userId: string;
30
+ userId: Types.ObjectId;
31
31
  messageName: string;
32
32
  threadChatgptId?: string;
33
33
  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;
@@ -1,10 +1,10 @@
1
- import mongoose from 'mongoose';
1
+ import mongoose, { Types } 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
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;
@@ -30,7 +30,7 @@ interface PlanModel extends mongoose.Model<PlanDoc> {
30
30
  build(attrs: PlanAttrs): PlanDoc;
31
31
  }
32
32
  export interface PlanDoc extends mongoose.Document {
33
- _id: string;
33
+ _id: Types.ObjectId;
34
34
  price: string;
35
35
  name: string;
36
36
  points: number;