gemcap-be-common 1.5.102 → 1.5.103
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.
- package/models/AiAnalysisJob.model.d.ts +71 -0
- package/models/AiAnalysisJob.model.js +97 -0
- package/models/AiAnalysisJob.model.ts +153 -0
- package/models/_index.d.ts +3 -3
- package/models/_models.d.ts +1 -0
- package/models/_models.js +1 -0
- package/models/_models.ts +1 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/types" />
|
|
2
|
+
/// <reference types="mongoose/types/models" />
|
|
3
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
4
|
+
/// <reference types="mongoose/types/utility" />
|
|
5
|
+
/// <reference types="mongoose/types/document" />
|
|
6
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
7
|
+
/// <reference types="mongoose/types/callback" />
|
|
8
|
+
/// <reference types="mongoose/types/collection" />
|
|
9
|
+
/// <reference types="mongoose/types/connection" />
|
|
10
|
+
/// <reference types="mongoose/types/cursor" />
|
|
11
|
+
/// <reference types="mongoose/types/document" />
|
|
12
|
+
/// <reference types="mongoose/types/error" />
|
|
13
|
+
/// <reference types="mongoose/types/expressions" />
|
|
14
|
+
/// <reference types="mongoose/types/helpers" />
|
|
15
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
16
|
+
/// <reference types="mongoose/types/indexes" />
|
|
17
|
+
/// <reference types="mongoose/types/models" />
|
|
18
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
19
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
20
|
+
/// <reference types="mongoose/types/populate" />
|
|
21
|
+
/// <reference types="mongoose/types/query" />
|
|
22
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
23
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
24
|
+
/// <reference types="mongoose/types/session" />
|
|
25
|
+
/// <reference types="mongoose/types/types" />
|
|
26
|
+
/// <reference types="mongoose/types/utility" />
|
|
27
|
+
/// <reference types="mongoose/types/validation" />
|
|
28
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
29
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
30
|
+
import mongoose from 'mongoose';
|
|
31
|
+
import { TTaskStatus } from '../interfaces/task.interface';
|
|
32
|
+
export interface IAiAnalysisJob {
|
|
33
|
+
taskId: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
status: TTaskStatus;
|
|
36
|
+
inputFileIds: string[];
|
|
37
|
+
anthropicInputFileIds: string[];
|
|
38
|
+
anthropicOutputFileIds?: string[];
|
|
39
|
+
resultFiles?: Array<{
|
|
40
|
+
fileId: string;
|
|
41
|
+
anthropicFileId: string;
|
|
42
|
+
filename: string;
|
|
43
|
+
mimeType?: string;
|
|
44
|
+
size?: number;
|
|
45
|
+
}>;
|
|
46
|
+
userPrompt?: string;
|
|
47
|
+
provider: string;
|
|
48
|
+
model: string;
|
|
49
|
+
skillId: string;
|
|
50
|
+
responseText?: string;
|
|
51
|
+
rawResponse?: unknown;
|
|
52
|
+
errorMessage?: string;
|
|
53
|
+
startedAt?: Date;
|
|
54
|
+
completedAt?: Date;
|
|
55
|
+
}
|
|
56
|
+
export type TAiAnalysisJobDoc = mongoose.HydratedDocument<IAiAnalysisJob>;
|
|
57
|
+
export interface IAiAnalysisJobLean extends IAiAnalysisJob {
|
|
58
|
+
_id: mongoose.Types.ObjectId;
|
|
59
|
+
createdAt: Date;
|
|
60
|
+
updatedAt: Date;
|
|
61
|
+
}
|
|
62
|
+
export interface IAiAnalysisJobPlain extends IAiAnalysisJob {
|
|
63
|
+
_id: string;
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
updatedAt: Date;
|
|
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> & {
|
|
69
|
+
_id: mongoose.Types.ObjectId;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const AiAnalysisJob: TAiAnalysisJobModel;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AiAnalysisJob = exports.AiAnalysisJobSchema = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const _models_1 = require("./_models");
|
|
9
|
+
exports.AiAnalysisJobSchema = new mongoose_1.default.Schema({
|
|
10
|
+
taskId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
userId: {
|
|
15
|
+
type: 'String',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
status: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
inputFileIds: [{
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
}],
|
|
26
|
+
anthropicInputFileIds: [{
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
}],
|
|
30
|
+
anthropicOutputFileIds: [{
|
|
31
|
+
type: String,
|
|
32
|
+
required: false,
|
|
33
|
+
}],
|
|
34
|
+
resultFiles: [{
|
|
35
|
+
fileId: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
anthropicFileId: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
filename: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
mimeType: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
type: Number,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
}],
|
|
56
|
+
userPrompt: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
60
|
+
provider: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
model: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
68
|
+
skillId: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
responseText: {
|
|
73
|
+
type: String,
|
|
74
|
+
required: false,
|
|
75
|
+
},
|
|
76
|
+
rawResponse: {
|
|
77
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
78
|
+
required: false,
|
|
79
|
+
},
|
|
80
|
+
errorMessage: {
|
|
81
|
+
type: String,
|
|
82
|
+
required: true,
|
|
83
|
+
},
|
|
84
|
+
startedAt: {
|
|
85
|
+
type: Date,
|
|
86
|
+
required: true,
|
|
87
|
+
},
|
|
88
|
+
completedAt: {
|
|
89
|
+
type: Date,
|
|
90
|
+
required: true,
|
|
91
|
+
},
|
|
92
|
+
}, {
|
|
93
|
+
timestamps: { createdAt: true, updatedAt: true },
|
|
94
|
+
versionKey: false,
|
|
95
|
+
});
|
|
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);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
import { MODEL_NAMES } from './_models';
|
|
4
|
+
import { TTaskStatus } from '../interfaces/task.interface';
|
|
5
|
+
|
|
6
|
+
export interface IAiAnalysisJob {
|
|
7
|
+
taskId: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
|
|
10
|
+
status: TTaskStatus;
|
|
11
|
+
|
|
12
|
+
inputFileIds: string[];
|
|
13
|
+
anthropicInputFileIds: string[];
|
|
14
|
+
|
|
15
|
+
anthropicOutputFileIds?: string[];
|
|
16
|
+
|
|
17
|
+
resultFiles?: Array<{
|
|
18
|
+
fileId: string;
|
|
19
|
+
anthropicFileId: string;
|
|
20
|
+
filename: string;
|
|
21
|
+
mimeType?: string;
|
|
22
|
+
size?: number;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
userPrompt?: string;
|
|
26
|
+
provider: string,
|
|
27
|
+
model: string;
|
|
28
|
+
skillId: string;
|
|
29
|
+
|
|
30
|
+
responseText?: string;
|
|
31
|
+
rawResponse?: unknown;
|
|
32
|
+
|
|
33
|
+
errorMessage?: string;
|
|
34
|
+
|
|
35
|
+
startedAt?: Date;
|
|
36
|
+
completedAt?: Date;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type TAiAnalysisJobDoc = mongoose.HydratedDocument<IAiAnalysisJob>;
|
|
40
|
+
|
|
41
|
+
export interface IAiAnalysisJobLean extends IAiAnalysisJob {
|
|
42
|
+
_id: mongoose.Types.ObjectId;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface IAiAnalysisJobPlain extends IAiAnalysisJob {
|
|
48
|
+
_id: string;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
updatedAt: Date;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type TAiAnalysisJobModel = mongoose.Model<IAiAnalysisJob>;
|
|
54
|
+
|
|
55
|
+
export const AiAnalysisJobSchema = new mongoose.Schema<IAiAnalysisJob, TAiAnalysisJobModel>(
|
|
56
|
+
{
|
|
57
|
+
taskId: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
userId: {
|
|
62
|
+
type: 'String',
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
status: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
inputFileIds: [{
|
|
70
|
+
type: String,
|
|
71
|
+
required: true,
|
|
72
|
+
}],
|
|
73
|
+
anthropicInputFileIds: [{
|
|
74
|
+
type: String,
|
|
75
|
+
required: true,
|
|
76
|
+
}],
|
|
77
|
+
anthropicOutputFileIds: [{
|
|
78
|
+
type: String,
|
|
79
|
+
required: false,
|
|
80
|
+
}],
|
|
81
|
+
|
|
82
|
+
resultFiles: [{
|
|
83
|
+
fileId: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
87
|
+
anthropicFileId: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: true,
|
|
90
|
+
},
|
|
91
|
+
filename: {
|
|
92
|
+
type: String,
|
|
93
|
+
required: true,
|
|
94
|
+
},
|
|
95
|
+
mimeType: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
size: {
|
|
100
|
+
type: Number,
|
|
101
|
+
required: true,
|
|
102
|
+
},
|
|
103
|
+
}],
|
|
104
|
+
|
|
105
|
+
userPrompt: {
|
|
106
|
+
type: String,
|
|
107
|
+
required: false,
|
|
108
|
+
},
|
|
109
|
+
provider: {
|
|
110
|
+
type: String,
|
|
111
|
+
required: true,
|
|
112
|
+
},
|
|
113
|
+
model: {
|
|
114
|
+
type: String,
|
|
115
|
+
required: true,
|
|
116
|
+
},
|
|
117
|
+
skillId: {
|
|
118
|
+
type: String,
|
|
119
|
+
required: true,
|
|
120
|
+
},
|
|
121
|
+
responseText: {
|
|
122
|
+
type: String,
|
|
123
|
+
required: false,
|
|
124
|
+
},
|
|
125
|
+
rawResponse: {
|
|
126
|
+
type: mongoose.Schema.Types.Mixed,
|
|
127
|
+
required: false,
|
|
128
|
+
},
|
|
129
|
+
errorMessage: {
|
|
130
|
+
type: String,
|
|
131
|
+
required: true,
|
|
132
|
+
},
|
|
133
|
+
startedAt: {
|
|
134
|
+
type: Date,
|
|
135
|
+
required: true,
|
|
136
|
+
},
|
|
137
|
+
completedAt: {
|
|
138
|
+
type: Date,
|
|
139
|
+
required: true,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
timestamps: { createdAt: true, updatedAt: true },
|
|
144
|
+
versionKey: false,
|
|
145
|
+
},
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
AiAnalysisJobSchema.index(
|
|
149
|
+
{ taskId: 1, userId: 1, status: 1 },
|
|
150
|
+
{ unique: true },
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
export const AiAnalysisJob = mongoose.model<IAiAnalysisJob, TAiAnalysisJobModel>(MODEL_NAMES.AIJobs, AiAnalysisJobSchema);
|
package/models/_index.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ export declare const allSchemas: {
|
|
|
35
35
|
createdAt: NativeDate;
|
|
36
36
|
updatedAt: NativeDate;
|
|
37
37
|
} & {
|
|
38
|
-
order: number;
|
|
39
38
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
39
|
+
order: number;
|
|
40
40
|
apDate: Date;
|
|
41
41
|
amount: number;
|
|
42
42
|
__v?: number;
|
|
@@ -49,8 +49,8 @@ export declare const allSchemas: {
|
|
|
49
49
|
createdAt: NativeDate;
|
|
50
50
|
updatedAt: NativeDate;
|
|
51
51
|
} & {
|
|
52
|
-
order: number;
|
|
53
52
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
53
|
+
order: number;
|
|
54
54
|
apDate: Date;
|
|
55
55
|
amount: number;
|
|
56
56
|
__v?: number;
|
|
@@ -63,8 +63,8 @@ export declare const allSchemas: {
|
|
|
63
63
|
createdAt: NativeDate;
|
|
64
64
|
updatedAt: NativeDate;
|
|
65
65
|
} & {
|
|
66
|
-
order: number;
|
|
67
66
|
bbcSheetId: import("mongoose").Types.ObjectId;
|
|
67
|
+
order: number;
|
|
68
68
|
apDate: Date;
|
|
69
69
|
amount: number;
|
|
70
70
|
__v?: number;
|
package/models/_models.d.ts
CHANGED
package/models/_models.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MODEL_NAMES = void 0;
|
|
4
4
|
exports.MODEL_NAMES = {
|
|
5
5
|
accountPayableItem: 'AccountPayableItem',
|
|
6
|
+
AIJobs: 'ai_jobs',
|
|
6
7
|
allocatedBankTransactions: 'allocated_bank_transactions',
|
|
7
8
|
allocatedData: 'allocated_data',
|
|
8
9
|
ARAvailabilities: 'availabilities',
|
package/models/_models.ts
CHANGED