ben-ai-models-registry 1.0.26 → 1.0.28

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/index.js CHANGED
@@ -1,22 +1,24 @@
1
1
  // index.js
2
- const JobStatus = require('./models/JobStatus');
3
- const Run = require('./models/Run');
4
- const Files = require('./models/Files');
5
- const Dataset = require('./models/Dataset');
6
- const Program = require('./models/Program');
7
- const QA = require('./models/QA');
8
- const ChatMessages = require('./models/ChatMessages');
9
- const LanguageObject = require('./models/LanguageObject')
10
- const User = require('./models/User')
2
+ const JobStatus = require("./models/JobStatus");
3
+ const Run = require("./models/Run");
4
+ const Files = require("./models/Files");
5
+ const Dataset = require("./models/Dataset");
6
+ const Program = require("./models/Program");
7
+ const QA = require("./models/QA");
8
+ const ChatMessages = require("./models/ChatMessages");
9
+ const LanguageObject = require("./models/LanguageObject");
10
+ const User = require("./models/User");
11
+ const AdminLog = require("./models/AdminLog");
11
12
 
12
13
  module.exports = {
13
- JobStatus,
14
- Run,
15
- Files,
16
- Dataset,
17
- Program,
18
- QA,
19
- ChatMessages,
20
- LanguageObject,
21
- User
14
+ JobStatus,
15
+ Run,
16
+ Files,
17
+ Dataset,
18
+ Program,
19
+ QA,
20
+ ChatMessages,
21
+ LanguageObject,
22
+ User,
23
+ AdminLog,
22
24
  };
@@ -0,0 +1,19 @@
1
+ const mongoose = require("mongoose");
2
+ const { Schema } = mongoose;
3
+
4
+ const AdminLogSchema = new Schema({
5
+ actionType: { type: String, required: true },
6
+ actor: {
7
+ userId: {
8
+ type: mongoose.Schema.Types.ObjectId,
9
+ ref: "User",
10
+ required: true,
11
+ },
12
+ role: { type: String, required: true },
13
+ },
14
+ timestamp: { type: Date, default: Date.now },
15
+ context: { type: Schema.Types.Mixed, default: {} },
16
+ });
17
+
18
+ module.exports =
19
+ mongoose.models.AdminLog || mongoose.model("AdminLog", AdminLogSchema);
package/models/Run.js CHANGED
@@ -38,6 +38,10 @@ const AnswerSchema = new Schema(
38
38
  url: { type: String },
39
39
  },
40
40
  ],
41
+ context: {
42
+ type: [Schema.Types.Mixed], // Allows any data type in the array
43
+ default: [],
44
+ },
41
45
  assistantModel: {
42
46
  type: String,
43
47
  enum: Object.values(AssistantModel),
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
- "name": "ben-ai-models-registry",
3
- "version": "1.0.26",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC",
12
- "dependencies": {
13
- "mongoose": "^8.4.4"
14
- }
2
+ "name": "ben-ai-models-registry",
3
+ "version": "1.0.28",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "mongoose": "^8.4.4"
14
+ }
15
15
  }