gemcap-be-common 1.5.103 → 1.5.105

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.
@@ -29,12 +29,12 @@
29
29
  /// <reference types="mongoose/types/inferschematype" />
30
30
  import mongoose from 'mongoose';
31
31
  import { TTaskStatus } from '../interfaces/task.interface';
32
- export interface IAiAnalysisJob {
32
+ export interface IAIJob {
33
33
  taskId: string;
34
34
  userId: string;
35
35
  status: TTaskStatus;
36
- inputFileIds: string[];
37
- anthropicInputFileIds: string[];
36
+ inputFileIds?: string[];
37
+ anthropicInputFileIds?: string[];
38
38
  anthropicOutputFileIds?: string[];
39
39
  resultFiles?: Array<{
40
40
  fileId: string;
@@ -44,28 +44,28 @@ export interface IAiAnalysisJob {
44
44
  size?: number;
45
45
  }>;
46
46
  userPrompt?: string;
47
- provider: string;
48
- model: string;
49
- skillId: string;
47
+ provider?: string;
48
+ model?: string;
49
+ skillId?: string;
50
50
  responseText?: string;
51
51
  rawResponse?: unknown;
52
52
  errorMessage?: string;
53
53
  startedAt?: Date;
54
54
  completedAt?: Date;
55
55
  }
56
- export type TAiAnalysisJobDoc = mongoose.HydratedDocument<IAiAnalysisJob>;
57
- export interface IAiAnalysisJobLean extends IAiAnalysisJob {
56
+ export type TAIJobDoc = mongoose.HydratedDocument<IAIJob>;
57
+ export interface IAIJobLean extends IAIJob {
58
58
  _id: mongoose.Types.ObjectId;
59
59
  createdAt: Date;
60
60
  updatedAt: Date;
61
61
  }
62
- export interface IAiAnalysisJobPlain extends IAiAnalysisJob {
62
+ export interface IAIJobPlain extends IAIJob {
63
63
  _id: string;
64
64
  createdAt: Date;
65
65
  updatedAt: Date;
66
66
  }
67
- export type TAiAnalysisJobModel = mongoose.Model<IAiAnalysisJob>;
68
- export declare const AiAnalysisJobSchema: mongoose.Schema<IAiAnalysisJob, TAiAnalysisJobModel, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IAiAnalysisJob, mongoose.Document<unknown, {}, mongoose.FlatRecord<IAiAnalysisJob>> & mongoose.FlatRecord<IAiAnalysisJob> & {
67
+ export type TAIJobModel = mongoose.Model<IAIJob>;
68
+ export declare const AIJobSchema: mongoose.Schema<IAIJob, TAIJobModel, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, IAIJob, mongoose.Document<unknown, {}, mongoose.FlatRecord<IAIJob>> & mongoose.FlatRecord<IAIJob> & {
69
69
  _id: mongoose.Types.ObjectId;
70
70
  }>;
71
- export declare const AiAnalysisJob: TAiAnalysisJobModel;
71
+ export declare const AIJob: TAIJobModel;
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AiAnalysisJob = exports.AiAnalysisJobSchema = void 0;
6
+ exports.AIJob = exports.AIJobSchema = void 0;
7
7
  const mongoose_1 = __importDefault(require("mongoose"));
8
8
  const _models_1 = require("./_models");
9
- exports.AiAnalysisJobSchema = new mongoose_1.default.Schema({
9
+ exports.AIJobSchema = new mongoose_1.default.Schema({
10
10
  taskId: {
11
11
  type: String,
12
12
  required: true,
@@ -21,15 +21,12 @@ exports.AiAnalysisJobSchema = new mongoose_1.default.Schema({
21
21
  },
22
22
  inputFileIds: [{
23
23
  type: String,
24
- required: true,
25
24
  }],
26
25
  anthropicInputFileIds: [{
27
26
  type: String,
28
- required: true,
29
27
  }],
30
28
  anthropicOutputFileIds: [{
31
29
  type: String,
32
- required: false,
33
30
  }],
34
31
  resultFiles: [{
35
32
  fileId: {
@@ -55,43 +52,34 @@ exports.AiAnalysisJobSchema = new mongoose_1.default.Schema({
55
52
  }],
56
53
  userPrompt: {
57
54
  type: String,
58
- required: false,
59
55
  },
60
56
  provider: {
61
57
  type: String,
62
- required: true,
63
58
  },
64
59
  model: {
65
60
  type: String,
66
- required: true,
67
61
  },
68
62
  skillId: {
69
63
  type: String,
70
- required: true,
71
64
  },
72
65
  responseText: {
73
66
  type: String,
74
- required: false,
75
67
  },
76
68
  rawResponse: {
77
69
  type: mongoose_1.default.Schema.Types.Mixed,
78
- required: false,
79
70
  },
80
71
  errorMessage: {
81
72
  type: String,
82
- required: true,
83
73
  },
84
74
  startedAt: {
85
75
  type: Date,
86
- required: true,
87
76
  },
88
77
  completedAt: {
89
78
  type: Date,
90
- required: true,
91
79
  },
92
80
  }, {
93
81
  timestamps: { createdAt: true, updatedAt: true },
94
82
  versionKey: false,
95
83
  });
96
- exports.AiAnalysisJobSchema.index({ taskId: 1, userId: 1, status: 1 }, { unique: true });
97
- exports.AiAnalysisJob = mongoose_1.default.model(_models_1.MODEL_NAMES.AIJobs, exports.AiAnalysisJobSchema);
84
+ exports.AIJobSchema.index({ taskId: 1, userId: 1, status: 1 }, { unique: true });
85
+ exports.AIJob = mongoose_1.default.model(_models_1.MODEL_NAMES.AIJobs, exports.AIJobSchema);
@@ -3,14 +3,14 @@ import mongoose from 'mongoose';
3
3
  import { MODEL_NAMES } from './_models';
4
4
  import { TTaskStatus } from '../interfaces/task.interface';
5
5
 
6
- export interface IAiAnalysisJob {
6
+ export interface IAIJob {
7
7
  taskId: string;
8
8
  userId: string;
9
9
 
10
10
  status: TTaskStatus;
11
11
 
12
- inputFileIds: string[];
13
- anthropicInputFileIds: string[];
12
+ inputFileIds?: string[];
13
+ anthropicInputFileIds?: string[];
14
14
 
15
15
  anthropicOutputFileIds?: string[];
16
16
 
@@ -23,9 +23,9 @@ export interface IAiAnalysisJob {
23
23
  }>;
24
24
 
25
25
  userPrompt?: string;
26
- provider: string,
27
- model: string;
28
- skillId: string;
26
+ provider?: string,
27
+ model?: string;
28
+ skillId?: string;
29
29
 
30
30
  responseText?: string;
31
31
  rawResponse?: unknown;
@@ -36,23 +36,23 @@ export interface IAiAnalysisJob {
36
36
  completedAt?: Date;
37
37
  }
38
38
 
39
- export type TAiAnalysisJobDoc = mongoose.HydratedDocument<IAiAnalysisJob>;
39
+ export type TAIJobDoc = mongoose.HydratedDocument<IAIJob>;
40
40
 
41
- export interface IAiAnalysisJobLean extends IAiAnalysisJob {
41
+ export interface IAIJobLean extends IAIJob {
42
42
  _id: mongoose.Types.ObjectId;
43
43
  createdAt: Date;
44
44
  updatedAt: Date;
45
45
  }
46
46
 
47
- export interface IAiAnalysisJobPlain extends IAiAnalysisJob {
47
+ export interface IAIJobPlain extends IAIJob {
48
48
  _id: string;
49
49
  createdAt: Date;
50
50
  updatedAt: Date;
51
51
  }
52
52
 
53
- export type TAiAnalysisJobModel = mongoose.Model<IAiAnalysisJob>;
53
+ export type TAIJobModel = mongoose.Model<IAIJob>;
54
54
 
55
- export const AiAnalysisJobSchema = new mongoose.Schema<IAiAnalysisJob, TAiAnalysisJobModel>(
55
+ export const AIJobSchema = new mongoose.Schema<IAIJob, TAIJobModel>(
56
56
  {
57
57
  taskId: {
58
58
  type: String,
@@ -68,15 +68,12 @@ export const AiAnalysisJobSchema = new mongoose.Schema<IAiAnalysisJob, TAiAnalys
68
68
  },
69
69
  inputFileIds: [{
70
70
  type: String,
71
- required: true,
72
71
  }],
73
72
  anthropicInputFileIds: [{
74
73
  type: String,
75
- required: true,
76
74
  }],
77
75
  anthropicOutputFileIds: [{
78
76
  type: String,
79
- required: false,
80
77
  }],
81
78
 
82
79
  resultFiles: [{
@@ -104,39 +101,30 @@ export const AiAnalysisJobSchema = new mongoose.Schema<IAiAnalysisJob, TAiAnalys
104
101
 
105
102
  userPrompt: {
106
103
  type: String,
107
- required: false,
108
104
  },
109
105
  provider: {
110
106
  type: String,
111
- required: true,
112
107
  },
113
108
  model: {
114
109
  type: String,
115
- required: true,
116
110
  },
117
111
  skillId: {
118
112
  type: String,
119
- required: true,
120
113
  },
121
114
  responseText: {
122
115
  type: String,
123
- required: false,
124
116
  },
125
117
  rawResponse: {
126
118
  type: mongoose.Schema.Types.Mixed,
127
- required: false,
128
119
  },
129
120
  errorMessage: {
130
121
  type: String,
131
- required: true,
132
122
  },
133
123
  startedAt: {
134
124
  type: Date,
135
- required: true,
136
125
  },
137
126
  completedAt: {
138
127
  type: Date,
139
- required: true,
140
128
  },
141
129
  },
142
130
  {
@@ -145,9 +133,9 @@ export const AiAnalysisJobSchema = new mongoose.Schema<IAiAnalysisJob, TAiAnalys
145
133
  },
146
134
  );
147
135
 
148
- AiAnalysisJobSchema.index(
136
+ AIJobSchema.index(
149
137
  { taskId: 1, userId: 1, status: 1 },
150
138
  { unique: true },
151
139
  );
152
140
 
153
- export const AiAnalysisJob = mongoose.model<IAiAnalysisJob, TAiAnalysisJobModel>(MODEL_NAMES.AIJobs, AiAnalysisJobSchema);
141
+ export const AIJob = mongoose.model<IAIJob, TAIJobModel>(MODEL_NAMES.AIJobs, AIJobSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.103",
3
+ "version": "1.5.105",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {