cloud-ide-model-schema 1.1.26 → 1.1.27

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.
@@ -1,4 +1,5 @@
1
+ import * as mongoose from 'mongoose';
1
2
  import 'dotenv/config';
2
3
  declare function connectDB(): Promise<void>;
3
- declare const customUUID: () => string;
4
+ declare const customUUID: () => mongoose.Types.ObjectId;
4
5
  export { connectDB, customUUID };
@@ -66,5 +66,5 @@ function connectDB() {
66
66
  });
67
67
  }
68
68
  // Event listner for success and error // pending
69
- var customUUID = function () { return "".concat(process.env.UUID_PREFIX, "-").concat((0, cloud_ide_lms_model_1.generateRandomAlphanumericString)(21)); };
69
+ var customUUID = function () { return new mongoose.Types.ObjectId("".concat(process.env.UUID_PREFIX).concat((0, cloud_ide_lms_model_1.generateRandomAlphanumericString)(21))); };
70
70
  exports.customUUID = customUUID;
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CCoreSylog = void 0;
4
4
  var mongoose_1 = require("mongoose");
5
+ var database_1 = require("../../config/database");
5
6
  /* SCHEMA START */
6
7
  var core_system_logs = new mongoose_1.Schema({
7
8
  _id: {
8
9
  type: mongoose_1.default.Schema.Types.ObjectId,
9
- default: function () { return new mongoose_1.default.Types.ObjectId(); } // default ObjectId, can be replaced with a custom UUID generator
10
+ default: function () { return (0, database_1.customUUID)(); } // default ObjectId, can be replaced with a custom UUID generator
10
11
  },
11
12
  sylog_id_user: {
12
13
  type: mongoose_1.default.Schema.Types.ObjectId,
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript": "^5.8.3"
10
10
  },
11
11
  "name": "cloud-ide-model-schema",
12
- "version": "1.1.26",
12
+ "version": "1.1.27",
13
13
  "description": "Pachage for schema management of Cloud IDEsys LMS",
14
14
  "main": "lib/index.js",
15
15
  "types": "lib/index.d.ts",