my-typescript-library-rahul52us 1.1.8 → 1.2.1

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 (60) hide show
  1. package/dist/repository/filesystem.repository.js +2 -2
  2. package/dist/repository/filesystem.repository.js.map +1 -1
  3. package/dist/repository/schemas/WorkflowSettingsScheme.js +1 -1
  4. package/dist/repository/schemas/WorkflowSettingsScheme.js.map +1 -1
  5. package/dist/repository/schemas/accountdetails.schema.js +1 -1
  6. package/dist/repository/schemas/accountdetails.schema.js.map +1 -1
  7. package/dist/repository/schemas/extracted.schema.js +1 -1
  8. package/dist/repository/schemas/extracted.schema.js.map +1 -1
  9. package/dist/repository/schemas/form.schema.js +1 -1
  10. package/dist/repository/schemas/form.schema.js.map +1 -1
  11. package/dist/repository/schemas/notifications.schema.js +1 -1
  12. package/dist/repository/schemas/notifications.schema.js.map +1 -1
  13. package/dist/repository/schemas/organisation.schema.js +1 -1
  14. package/dist/repository/schemas/organisation.schema.js.map +1 -1
  15. package/dist/repository/schemas/profile.schema.js +1 -1
  16. package/dist/repository/schemas/profile.schema.js.map +1 -1
  17. package/dist/repository/schemas/role.schema.js +1 -1
  18. package/dist/repository/schemas/role.schema.js.map +1 -1
  19. package/dist/repository/schemas/tokens.schema.js +17 -6
  20. package/dist/repository/schemas/tokens.schema.js.map +1 -1
  21. package/dist/repository/schemas/userrole.schema.js +1 -1
  22. package/dist/repository/schemas/userrole.schema.js.map +1 -1
  23. package/dist/server.js +1 -3
  24. package/dist/server.js.map +1 -1
  25. package/dist/setupModal.js +28 -38
  26. package/dist/setupModal.js.map +1 -1
  27. package/dist/types/repository/organisation.repository.d.ts +1 -6
  28. package/dist/types/repository/profile.repository.d.ts +1 -5
  29. package/dist/types/repository/role.repository.d.ts +2 -7
  30. package/dist/types/repository/schemas/WorkflowSettingsScheme.d.ts +1 -1
  31. package/dist/types/repository/schemas/accountdetails.schema.d.ts +2 -19
  32. package/dist/types/repository/schemas/extracted.schema.d.ts +1 -1
  33. package/dist/types/repository/schemas/form.schema.d.ts +1 -1
  34. package/dist/types/repository/schemas/notifications.schema.d.ts +1 -1
  35. package/dist/types/repository/schemas/organisation.schema.d.ts +1 -1
  36. package/dist/types/repository/schemas/profile.schema.d.ts +1 -1
  37. package/dist/types/repository/schemas/role.schema.d.ts +1 -1
  38. package/dist/types/repository/schemas/tokens.schema.d.ts +2 -8
  39. package/dist/types/repository/schemas/userrole.schema.d.ts +1 -1
  40. package/dist/types/repository/userrole.repository.d.ts +1 -6
  41. package/dist/types/server.d.ts +0 -1
  42. package/dist/types/services/organisation/organisation.service.d.ts +1 -32
  43. package/dist/types/services/roles/role.services.d.ts +1 -32
  44. package/dist/types/services/userroles/userrole.service.d.ts +1 -6
  45. package/dist/types/setupModal.d.ts +2 -14
  46. package/package.json +1 -1
  47. package/src/repository/filesystem.repository.ts +2 -2
  48. package/src/repository/schemas/WorkflowSettingsScheme.ts +2 -1
  49. package/src/repository/schemas/accountdetails.schema.ts +1 -1
  50. package/src/repository/schemas/extracted.schema.ts +2 -1
  51. package/src/repository/schemas/form.schema.ts +2 -1
  52. package/src/repository/schemas/notifications.schema.ts +1 -4
  53. package/src/repository/schemas/organisation.schema.ts +2 -1
  54. package/src/repository/schemas/profile.schema.ts +2 -1
  55. package/src/repository/schemas/role.schema.ts +2 -1
  56. package/src/repository/schemas/tokens.schema.ts +34 -19
  57. package/src/repository/schemas/userrole.schema.ts +2 -1
  58. package/src/server.ts +0 -1
  59. package/src/setupModal.ts +30 -38
  60. package/types/server.d.ts +1 -1
@@ -35,7 +35,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.getFileData = exports.getFile = exports.uploadFile = void 0;
36
36
  const mongoose_1 = __importStar(require("mongoose"));
37
37
  const stream_1 = require("stream");
38
- const setupModal_1 = require("~/setupModal");
38
+ const setupModal_1 = require("../setupModal");
39
39
  const { GridFSBucket } = mongoose_1.mongo;
40
40
  function uploadFile(file, name, type) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
@@ -54,7 +54,7 @@ function uploadFile(file, name, type) {
54
54
  readableStream.pipe(uploadStream);
55
55
  uploadStream.on("finish", () => {
56
56
  const fileId = uploadStream.id;
57
- (0, setupModal_1.getFileSystemModal)()
57
+ (0, setupModal_1.getFileSystemModel)()
58
58
  .create({
59
59
  fileId: fileId,
60
60
  })
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.repository.js","sourceRoot":"","sources":["../../src/repository/filesystem.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuD;AACvD,mCAAkC;AAClC,6CAAkD;AAElD,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAK,CAAC;AAE/B,SAAsB,UAAU,CAAC,IAAY,EAAE,IAAY,EAAE,IAAY;;QACvE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI;gBACA,MAAM,UAAU,GAAG,kBAAQ,CAAC,UAAU,CAAC;gBACvC,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAE/C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;gBACjD,MAAM,cAAc,GAAG,IAAI,iBAAQ,EAAE,CAAC;gBACtC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC5B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAE1B,MAAM,YAAY,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;oBAC/C,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;iBAClC,CAAC,CAAC;gBAEH,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAEl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
  });
30
- exports.default = mongoose_1.default.model('settings', workFlowSettingsSchema);
30
+ exports.default = mongoose_1.default.models.settings || mongoose_1.default.model('settings', workFlowSettingsSchema);
31
31
  //# sourceMappingURL=WorkflowSettingsScheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowSettingsScheme.js","sourceRoot":"","sources":["../../../src/repository/schemas/WorkflowSettingsScheme.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAE/B,MAAM,sBAAsB,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAG;QACH,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,UAAU;KACnB;IACD,OAAO,EAAG;QACN,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,cAAc;KACvB;IACD,KAAK,EAAG;QACJ,IAAI,EAAG,MAAM;KAChB;IACD,IAAI,EAAG;QACH,IAAI,EAAG,MAAM;KAChB;IACD,MAAM,EAAG;QACL,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;KACrC;IACD,UAAU,EAAG;QACT,IAAI,EAAG,IAAI;QACX,OAAO,EAAG,IAAI,IAAI,EAAE;KACvB;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAAC,UAAU,EAAC,sBAAsB,CAAC,CAAA"}
1
+ {"version":3,"file":"WorkflowSettingsScheme.js","sourceRoot":"","sources":["../../../src/repository/schemas/WorkflowSettingsScheme.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAE/B,MAAM,sBAAsB,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAG;QACH,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,UAAU;KACnB;IACD,OAAO,EAAG;QACN,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,cAAc;KACvB;IACD,KAAK,EAAG;QACJ,IAAI,EAAG,MAAM;KAChB;IACD,IAAI,EAAG;QACH,IAAI,EAAG,MAAM;KAChB;IACD,MAAM,EAAG;QACL,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;KACrC;IACD,UAAU,EAAG;QACT,IAAI,EAAG,IAAI;QACX,OAAO,EAAG,IAAI,IAAI,EAAE;KACvB;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,MAAM,CAAC,QAAQ,IAAI,kBAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC"}
@@ -60,5 +60,5 @@ const AccountDetailsSchema = new mongoose_1.default.Schema({
60
60
  trim: true,
61
61
  },
62
62
  });
63
- exports.default = mongoose_1.default.model('AccountDetails', AccountDetailsSchema);
63
+ exports.default = mongoose_1.default.models.AccountDetails || mongoose_1.default.model('AccountDetails', AccountDetailsSchema);
64
64
  //# sourceMappingURL=accountdetails.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accountdetails.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/accountdetails.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsD;AAoBtD,MAAM,oBAAoB,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,YAAY,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,UAAU,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAEH,kBAAe,kBAAQ,CAAC,KAAK,CAAiB,gBAAgB,EAAE,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"accountdetails.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/accountdetails.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsD;AAoBtD,MAAM,oBAAoB,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,YAAY,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;IACD,UAAU,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAEH,kBAAe,kBAAQ,CAAC,MAAM,CAAC,cAAc,IAAI,kBAAQ,CAAC,KAAK,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC"}
@@ -45,5 +45,5 @@ const extractedSchema = new mongoose_1.Schema({
45
45
  required: true
46
46
  }
47
47
  });
48
- exports.default = mongoose_1.default.model("extracted", extractedSchema);
48
+ exports.default = mongoose_1.default.models.extracted || mongoose_1.default.model('extracted', extractedSchema);
49
49
  //# sourceMappingURL=extracted.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extracted.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/extracted.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4D;AAU5D,MAAM,eAAe,GAAG,IAAI,iBAAM,CAAC;IAC/B,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;QAC7B,GAAG,EAAE,UAAU;KAClB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACjB;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAAa,WAAW,EAAE,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"extracted.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/extracted.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4D;AAU5D,MAAM,eAAe,GAAG,IAAI,iBAAM,CAAC;IAC/B,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;KACb;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;QAC7B,GAAG,EAAE,UAAU;KAClB;IACD,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACjB;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,MAAM,CAAC,SAAS,IAAI,kBAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC"}
@@ -34,5 +34,5 @@ const formSchema = new mongoose_1.default.Schema({
34
34
  type: Date
35
35
  },
36
36
  });
37
- exports.default = mongoose_1.default.model('Form', formSchema);
37
+ exports.default = mongoose_1.default.models.Form || mongoose_1.default.model('Form', formSchema);
38
38
  //# sourceMappingURL=form.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/form.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAE/B,MAAM,UAAU,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACnC,IAAI,EAAG;QACH,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,UAAU;KACnB;IACD,OAAO,EAAG;QACN,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,cAAc;KACvB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,OAAO,EAAE,UAAU;KACtB;IACD,QAAQ,EAAG;QACP,IAAI,EAAG,MAAM;KAChB;IACD,MAAM,EAAG;QACL,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;KACrC;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAG;QACT,IAAI,EAAG,IAAI;KACd;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAAC,MAAM,EAAC,UAAU,CAAC,CAAA"}
1
+ {"version":3,"file":"form.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/form.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAE/B,MAAM,UAAU,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACnC,IAAI,EAAG;QACH,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,UAAU;KACnB;IACD,OAAO,EAAG;QACN,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACrC,GAAG,EAAG,cAAc;KACvB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,OAAO,EAAE,UAAU;KACtB;IACD,QAAQ,EAAG;QACP,IAAI,EAAG,MAAM;KAChB;IACD,MAAM,EAAG;QACL,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;KACrC;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAG;QACT,IAAI,EAAG,IAAI;KACd;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,kBAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC"}
@@ -39,5 +39,5 @@ const NotificationsSchema = new mongoose_1.default.Schema({
39
39
  type: Date,
40
40
  },
41
41
  }, { timestamps: true });
42
- exports.default = mongoose_1.default.model("notification", NotificationsSchema);
42
+ exports.default = mongoose_1.default.models.notification || mongoose_1.default.model('notification', NotificationsSchema);
43
43
  //# sourceMappingURL=notifications.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/notifications.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsD;AAatD,MAAM,mBAAmB,GAAW,IAAI,kBAAQ,CAAC,MAAM,CACrD;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,OAAO,EAAE,UAAU;KACpB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;QAC7B,GAAG,EAAE,SAAS;KACf;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;KACd;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;QAC7B,GAAG,EAAE,SAAS;KACf;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;YAC7B,GAAG,EAAE,SAAS;SACf;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;KACd;IACD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;KACX;CACF,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,CACrB,CAAC;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAC3B,cAAc,EACd,mBAAmB,CACpB,CAAC"}
1
+ {"version":3,"file":"notifications.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/notifications.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsD;AAatD,MAAM,mBAAmB,GAAW,IAAI,kBAAQ,CAAC,MAAM,CACrD;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,OAAO,EAAE,UAAU;KACpB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;QAC7B,GAAG,EAAE,SAAS;KACf;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;KACd;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;QAC7B,GAAG,EAAE,SAAS;KACf;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,kBAAQ,CAAC,KAAK,CAAC,QAAQ;YAC7B,GAAG,EAAE,SAAS;SACf;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;KACd;IACD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;KACX;CACF,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,CACrB,CAAC;AAEF,kBAAe,kBAAQ,CAAC,MAAM,CAAC,YAAY,IAAI,kBAAQ,CAAC,KAAK,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC"}
@@ -146,5 +146,5 @@ const OrganisationSchema = new mongoose_1.Schema({
146
146
  },
147
147
  });
148
148
  // Export the mongoose model with the generic typing
149
- exports.default = mongoose_1.default.model("Organisation", OrganisationSchema);
149
+ exports.default = mongoose_1.default.models.Organisation || mongoose_1.default.model('Organisation', OrganisationSchema);
150
150
  //# sourceMappingURL=organisation.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"organisation.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/organisation.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4C;AAsD5C,iCAAiC;AACjC,MAAM,kBAAkB,GAAW,IAAI,iBAAM,CAAC;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC;QACpC,MAAM,EAAE,KAAK;KACd;IACD,WAAW,EAAE;QACX,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;iBACb;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;iBACb;gBACD,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;yBACb;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,MAAM;yBACb;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,m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AAC,QAAQ;QACpC,GAAG,EAAE,cAAc;KACpB;CACF,CAAC,CAAC;AAEH,oDAAoD;AACpD,kBAAe,kBAAQ,CAAC,KAAK,CAAgB,cAAc,EAAE,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"organisation.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/organisation.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4C;AAsD5C,iCAAiC;AACjC,MAAM,kBAAkB,GAAW,IAAI,iBAAM,CAAC;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC;QACpC,MAAM,EAAE,KAAK;KACd;IACD,WAAW,EAAE;QACX,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;iBACb;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;iBACb;gBACD,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;yBACb;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,MAAM;yBACb;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC;KACtC;IACD,GAAG,EAAE;QACH,IAAI,EAAE,MAAM;KACb;IACD,cAAc,EAAE;QACd;YACE,YAAY,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACf;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,cAAc;KACxB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;KACb;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;SACb;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;SACb;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM;KACb;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE;YACJ;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;QACD,KAAK,EAAE;YACL;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;QACD,GAAG,EAAE;YACH;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;QACD,eAAe,EAAE;YACf;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,GAAG,EAAE,cAAc;KACpB;CACF,CAAC,CAAC;AAEH,oDAAoD;AACpD,kBAAe,kBAAQ,CAAC,MAAM,CAAC,YAAY,IAAI,kBAAQ,CAAC,KAAK,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC"}
@@ -49,5 +49,5 @@ const profileSchema = new mongoose_1.default.Schema({
49
49
  type: String,
50
50
  }
51
51
  });
52
- exports.default = mongoose_1.default.model('Profile', profileSchema);
52
+ exports.default = mongoose_1.default.models.Profile || mongoose_1.default.model('Profile', profileSchema);
53
53
  //# sourceMappingURL=profile.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/profile.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4D;AAiB3D,CAAC;AAEF,MAAM,aAAa,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;KACf;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;KACf;IACD,YAAY,EAAE;QACV,IAAI,EAAE,MAAM;KACf;IACD,aAAa,EAAE;QACX,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAAU,SAAS,EAAE,aAAa,CAAC,CAAA"}
1
+ {"version":3,"file":"profile.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/profile.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4D;AAiB3D,CAAC;AAEF,MAAM,aAAa,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;KACf;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;KACf;IACD,YAAY,EAAE;QACV,IAAI,EAAE,MAAM;KACf;IACD,aAAa,EAAE;QACX,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;CACJ,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,MAAM,CAAC,OAAO,IAAI,kBAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC"}
@@ -35,5 +35,5 @@ const RoleSchema = new mongoose_1.default.Schema({
35
35
  type: Date,
36
36
  }
37
37
  });
38
- exports.default = mongoose_1.default.model('Role', RoleSchema);
38
+ exports.default = mongoose_1.default.models.Role || mongoose_1.default.model('Role', RoleSchema);
39
39
  //# sourceMappingURL=role.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"role.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/role.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsD;AAYtD,MAAM,UAAU,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,IAAI,EAA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ACtB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,GAAG,EAAE,MAAM;KACd;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAEH,kBAAe,kBAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,kBAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC"}
@@ -24,19 +24,30 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  const mongoose_1 = __importStar(require("mongoose"));
27
- ;
28
27
  const TokensSchema = new mongoose_1.default.Schema({
29
28
  userId: {
30
29
  type: mongoose_1.Schema.Types.ObjectId,
31
- required: true
30
+ required: true,
32
31
  },
33
32
  type: {
34
- type: String
33
+ type: String,
34
+ required: true,
35
35
  },
36
36
  created_at: {
37
37
  type: Date,
38
- default: Date.now
39
- }
38
+ default: Date.now,
39
+ },
40
40
  });
41
- exports.default = mongoose_1.default.model('Token', TokensSchema);
41
+ // Safe way to dynamically fetch or initialize the model
42
+ let TokenModel = null;
43
+ console.log(mongoose_1.default.models);
44
+ if (mongoose_1.default.models.Token) {
45
+ console.log("Token model already exists.");
46
+ TokenModel = mongoose_1.default.models.Token;
47
+ }
48
+ else {
49
+ console.log("Creating Token model fallback.");
50
+ TokenModel = mongoose_1.default.model('Token', TokensSchema);
51
+ }
52
+ exports.default = TokenModel;
42
53
  //# sourceMappingURL=tokens.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/tokens.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDA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O,EAAE,YAAY,CAAC,CAAC;CAC9D;AAED,kBAAe,UAAU,CAAC"}
@@ -78,5 +78,5 @@ const UserRoleSchema = new mongoose_1.default.Schema({
78
78
  type: Date,
79
79
  }
80
80
  });
81
- exports.default = mongoose_1.default.model('UserRole', UserRoleSchema);
81
+ exports.default = mongoose_1.default.models.UserRole || mongoose_1.default.model('UserRole', UserRoleSchema);
82
82
  //# sourceMappingURL=userrole.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"userrole.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/userrole.schema.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;;;AAEzD,gDAAgD;AAChD,oBAAoB;AACpB,mBAAmB;AACnB,6BAA6B;AAC7B,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,IAAI;AAEJ,uDAAuD;AACvD,cAAc;AACd,wBAAwB;AACxB,sBAAsB;AACtB,2BAA2B;AAC3B,sDAAsD;AACtD,SAAS;AACT,cAAc;AACd,wBAAwB;AACxB,sBAAsB;AACtB,uDAAuD;AACvD,SAAS;AACT,qBAAqB;AACrB,0BAA0B;AAC1B,+DAA+D;AAC/D,SAAS;AACT,iBAAiB;AACjB,gDAAgD;AAChD,qDAAqD;AACrD,+BAA+B;AAC/B,SAAS;AACT,mBAAmB;AACnB,sBAAsB;AACtB,SAAS;AACT,mBAAmB;AACnB,sBAAsB;AACtB,6BAA6B;AAC7B,SAAS;AACT,mBAAmB;AACnB,sBAAsB;AACtB,QAAQ;AACR,MAAM;AAEN,wEAAwE;AACxE,wDAAsD;AAatD,MAAM,cAAc,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC;KAC7C;IACD,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,IAAI,EAAE,gCAAgC,CAAC;KACrD;IACD,OAAO,EAAE;QACL,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC;QACzC,GAAG,EAAE,cAAc;KACtB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,GAAG,EAAE,UAAU;KAClB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAEH,kBAAe,kBAAQ,CAAC,KAAK,CAAY,UAAU,EAAE,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"userrole.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/userrole.schema.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;;;AAEzD,gDAAgD;AAChD,oBAAoB;AACpB,mBAAmB;AACnB,6BAA6B;AAC7B,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,IAAI;AAEJ,uDAAuD;AACvD,cAAc;AACd,wBAAwB;AACxB,sBAAsB;AACtB,2BAA2B;AAC3B,sDAAsD;AACtD,SAAS;AACT,cAAc;AACd,wBAAwB;AACxB,sBAAsB;AACtB,uDAAuD;AACvD,SAAS;AACT,qBAAqB;AACrB,0BAA0B;AAC1B,+DAA+D;AAC/D,SAAS;AACT,iBAAiB;AACjB,gDAAgD;AAChD,qDAAqD;AACrD,+BAA+B;AAC/B,SAAS;AACT,mBAAmB;AACnB,sBAAsB;AACtB,SAAS;AACT,mBAAmB;AACnB,sBAAsB;AACtB,6BAA6B;AAC7B,SAAS;AACT,mBAAmB;AACnB,sBAAsB;AACtB,QAAQ;AACR,MAAM;AAEN,wEAAwE;AACxE,wDAAsD;AAatD,MAAM,cAAc,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC;KAC7C;IACD,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,IAAI,EAAE,gCAAgC,CAAC;KACrD;IACD,OAAO,EAAE;QACL,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC;QACzC,GAAG,EAAE,cAAc;KACtB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,GAAG,EAAE,UAAU;KAClB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAEH,kBAAe,kBAAQ,CAAC,MAAM,CAAC,QAAQ,IAAI,kBAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC"}
package/dist/server.js CHANGED
@@ -3,7 +3,7 @@ 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.logConnectionDetails = exports.setupLibrary = exports.Form = exports.WorkFlow = exports.Document = exports.UserRole = exports.Notifications = exports.Profile = exports.FileUpload = exports.Logs = exports.Role = exports.User = exports.Auth = exports.routes = exports.createPendingApproval = void 0;
6
+ exports.setupLibrary = exports.Form = exports.WorkFlow = exports.Document = exports.UserRole = exports.Notifications = exports.Profile = exports.FileUpload = exports.Logs = exports.Role = exports.User = exports.Auth = exports.routes = exports.createPendingApproval = void 0;
7
7
  var document_services_1 = require("./services/document/document.services");
8
8
  Object.defineProperty(exports, "createPendingApproval", { enumerable: true, get: function () { return document_services_1.createPendingApprovalFunction; } });
9
9
  var routes_1 = require("./routes");
@@ -34,7 +34,5 @@ var form_route_1 = require("./routes/form.route");
34
34
  Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return __importDefault(form_route_1).default; } });
35
35
  var setupModal_1 = require("./setupModal");
36
36
  Object.defineProperty(exports, "setupLibrary", { enumerable: true, get: function () { return setupModal_1.setupLibrary; } });
37
- var setupModal_2 = require("./setupModal");
38
- Object.defineProperty(exports, "logConnectionDetails", { enumerable: true, get: function () { return setupModal_2.logConnectionDetails; } });
39
37
  console.log("liberay are imported");
40
38
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;AAAA,2EAA+G;AAAtG,0HAAA,6BAA6B,OAAyB;AAC/D,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,gDAAqD;AAA5C,kHAAA,OAAO,OAAQ;AACxB,8DAAkE;AAAzD,+HAAA,OAAO,OAAc;AAC9B,wDAA4D;AAAnD,yHAAA,OAAO,OAAW;AAC3B,gEAAgE;AAChE,oEAAwE;AAA/D,qIAAA,OAAO,OAAiB;AACjC,6EAA6E;AAC7E,0DAA8D;AAArD,2HAAA,OAAO,OAAY;AAC5B,0DAA8D;AAArD,2HAAA,OAAO,OAAY;AAC5B,0DAA8D;AAArD,2HAAA,OAAO,OAAY;AAC5B,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,2CAAyD;AAAjD,0GAAA,YAAY,OAAgB;AACpC,2CAAyE;AAAjE,kHAAA,oBAAoB,OAAwB;AACpD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;AAAA,2EAA+G;AAAtG,0HAAA,6BAA6B,OAAyB;AAC/D,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,gDAAqD;AAA5C,kHAAA,OAAO,OAAQ;AACxB,8DAAkE;AAAzD,+HAAA,OAAO,OAAc;AAC9B,wDAA4D;AAAnD,yHAAA,OAAO,OAAW;AAC3B,gEAAgE;AAChE,oEAAwE;AAA/D,qIAAA,OAAO,OAAiB;AACjC,6EAA6E;AAC7E,0DAA8D;AAArD,2HAAA,OAAO,OAAY;AAC5B,0DAA8D;AAArD,2HAAA,OAAO,OAAY;AAC5B,0DAA8D;AAArD,2HAAA,OAAO,OAAY;AAC5B,kDAAsD;AAA7C,mHAAA,OAAO,OAAQ;AACxB,2CAAyD;AAAjD,0GAAA,YAAY,OAAgB;AACpC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA"}
@@ -3,28 +3,30 @@ 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.logConnectionDetails = exports.getWorkflowModel = exports.getFileSystemModal = exports.getDocumentModel = exports.setupLibrary = void 0;
6
+ exports.getFileSystemModel = exports.getWorkflowModel = exports.getDocumentModel = exports.setupLibrary = void 0;
7
7
  // library/mongooseSetup.ts
8
8
  const mongoose_1 = __importDefault(require("mongoose"));
9
9
  const document_schema_1 = require("./repository/schemas/document.schema");
10
10
  const workflow_schema_1 = require("./repository/schemas/workflow.schema");
11
11
  const fileSystem_schema_1 = require("./repository/schemas/fileSystem.schema");
12
- let modelsInitialized = false;
13
- // Private references to models
14
- let DocumentModel = null;
15
- let WorkflowModel = null;
16
- let FileSystemModal = null;
17
12
  /**
18
13
  * Utility to ensure initialization has occurred
19
14
  */
20
- const checkInitialization = () => {
21
- if (!modelsInitialized) {
22
- throw new Error("Library models are not initialized. Call `setupLibrary()` before using library features.");
23
- }
15
+ let modelsInitialized = false;
16
+ /**
17
+ * Dynamically create or get existing Mongoose models
18
+ */
19
+ const getOrCreateModel = (modelName, schema) => {
20
+ return mongoose_1.default.models[modelName] || mongoose_1.default.model(modelName, schema);
24
21
  };
25
22
  /**
26
- * Set up the library models dynamically.
27
- * This will only initialize models once per connection.
23
+ * Library models
24
+ */
25
+ let DocumentModel;
26
+ let WorkflowModel;
27
+ let FileSystemModel;
28
+ /**
29
+ * Safely initialize models dynamically
28
30
  */
29
31
  const setupLibrary = (connection) => {
30
32
  if (modelsInitialized) {
@@ -32,47 +34,35 @@ const setupLibrary = (connection) => {
32
34
  return;
33
35
  }
34
36
  console.log("Initializing library models with provided connection...");
35
- DocumentModel = connection.model("Document", document_schema_1.DocumentSchema);
36
- WorkflowModel = connection.model("Workflow", workflow_schema_1.workFlowSchema);
37
- FileSystemModal = connection.model('FileSystem', fileSystem_schema_1.fileSystemSchema);
37
+ // Dynamically resolve models and store them
38
+ DocumentModel = getOrCreateModel("Document", document_schema_1.DocumentSchema);
39
+ WorkflowModel = getOrCreateModel("Workflow", workflow_schema_1.workFlowSchema);
40
+ FileSystemModel = getOrCreateModel("FileSystem", fileSystem_schema_1.fileSystemSchema);
38
41
  modelsInitialized = true;
39
42
  console.log("Library models initialized.");
40
43
  };
41
44
  exports.setupLibrary = setupLibrary;
42
45
  /**
43
- * Getter for the Document model
46
+ * Getter for models with initialization check
44
47
  */
48
+ const checkInitialization = () => {
49
+ if (!modelsInitialized) {
50
+ throw new Error("Library models are not initialized. Call `setupLibrary()` before using library features.");
51
+ }
52
+ };
45
53
  const getDocumentModel = () => {
46
54
  checkInitialization();
47
55
  return DocumentModel;
48
56
  };
49
57
  exports.getDocumentModel = getDocumentModel;
50
- const getFileSystemModal = () => {
51
- checkInitialization();
52
- return FileSystemModal;
53
- };
54
- exports.getFileSystemModal = getFileSystemModal;
55
- /**
56
- * Getter for the Workflow model
57
- */
58
58
  const getWorkflowModel = () => {
59
59
  checkInitialization();
60
60
  return WorkflowModel;
61
61
  };
62
62
  exports.getWorkflowModel = getWorkflowModel;
63
- /**
64
- * Log connection details for debugging purposes.
65
- */
66
- const logConnectionDetails = () => {
67
- if (mongoose_1.default.connection) {
68
- console.log("MongoDB Ready State:", mongoose_1.default.connection.readyState);
69
- console.log("MongoDB Host:", mongoose_1.default.connection.host);
70
- console.log("MongoDB Database Name:", mongoose_1.default.connection.name);
71
- }
72
- else {
73
- console.log("No mongoose connection established.");
74
- }
63
+ const getFileSystemModel = () => {
64
+ checkInitialization();
65
+ return FileSystemModel;
75
66
  };
76
- exports.logConnectionDetails = logConnectionDetails;
77
- exports.default = exports.setupLibrary;
67
+ exports.getFileSystemModel = getFileSystemModel;
78
68
  //# sourceMappingURL=setupModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setupModal.js","sourceRoot":"","sources":["../src/setupModal.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA2B;AAC3B,wDAAgC;AAChC,0EAAsE;AACtE,0EAAsE;AACtE,8EAAuE;AAEvE,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B,+BAA+B;AAC/B,IAAI,aAAa,GAA+B,IAAI,CAAC;AACrD,IAAI,aAAa,GAA+B,IAAI,CAAC;AACrD,IAAI,eAAe,GAA+B,IAAI,CAAA;AAEtD;;GAEG;AACH,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,IAAI,CAAC,iBAAiB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E,oCAAgB,CAAC,CAAC;IAEnE,iBAAiB,GAAG,IAAI,CAAC;IAEzB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAC7C,CAAC,CAAC;AAhBW,QAAA,YAAY,gBAgBvB;AAEF;;GAEG;AACH,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC;KAC7G;AACH,CAAC,CAAC;AAEK,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,mBAAmB,EAAE,CAAC;IACtB,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B;AAEK,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,mBAAmB,EAAE,CAAC;IACtB,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B;AAEK,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,mBAAmB,EAAE,CAAC;IACtB,OAAO,eAAe,CAAC;AACzB,CAAC,CAAC;AAHW,QAAA,kBAAkB,sBAG7B"}
@@ -1,4 +1,3 @@
1
- import mongoose from 'mongoose';
2
1
  type address = {
3
2
  shipping: any;
4
3
  billing: any;
@@ -50,11 +49,7 @@ export declare function findOrgById(orgId: string): Promise<{
50
49
  license: string;
51
50
  } | null>;
52
51
  export declare function updateorganisation(id: string, data: Partial<OrgProfile>): Promise<any>;
53
- export declare function findOrgDetails(id: string): Promise<mongoose.Document<unknown, {}, import("./schemas/organisation.schema").IOrganisation> & import("./schemas/organisation.schema").IOrganisation & Required<{
54
- _id: unknown;
55
- }> & {
56
- __v: number;
57
- }>;
52
+ export declare function findOrgDetails(id: string): Promise<any>;
58
53
  export declare function getOrgDetails(searchValue: string, company: string, userId: string, sort: string | null, skip: string | null, limit: string | null): Promise<any>;
59
54
  export declare function getCompliancesDetails(searchValue: string, company: string, userId: string, sort: string | null, skip: string | null, limit: string | null): Promise<any[] | Error>;
60
55
  export {};
@@ -44,9 +44,5 @@ export type accountDetailsData = {
44
44
  };
45
45
  export declare function createProfile(accountDetailsData: profile): Promise<any>;
46
46
  export declare function updateProfile(id: string, data: accountDetailsData): Promise<Error | import("mongoose").UpdateWriteOpResult>;
47
- export declare function getProfile(id: string): Promise<Error | (import("mongoose").Document<unknown, {}, profile> & profile & Required<{
48
- _id: unknown;
49
- }> & {
50
- __v: number;
51
- })>;
47
+ export declare function getProfile(id: string): Promise<any>;
52
48
  export declare function getAllProfile(searchValue: string): Promise<any>;
@@ -1,13 +1,8 @@
1
1
  import { IRole } from './schemas/role.schema';
2
- import mongoose from 'mongoose';
3
2
  export { IRole };
4
- export declare function createRolePermission(data: IRole): Promise<unknown>;
3
+ export declare function createRolePermission(data: IRole): Promise<any>;
5
4
  export declare function updateRolePermission(id: string, data: Partial<IRole>): Promise<any>;
6
- export declare function getRole(id: string): Promise<Error | (mongoose.Document<unknown, {}, IRole> & IRole & Required<{
7
- _id: unknown;
8
- }> & {
9
- __v: number;
10
- })>;
5
+ export declare function getRole(id: string): Promise<any>;
11
6
  export declare function deleteRolePermission(id: string): Promise<any>;
12
7
  export declare function getRolePermission(id: string): Promise<any>;
13
8
  export declare function getAllRolePermissions(searchValue: string, company: string, sort: string | null, skip: string | null, limit: string | null): Promise<IRole[]>;
@@ -1,3 +1,3 @@
1
1
  import mongoose from 'mongoose';
2
- declare const _default: mongoose.PassportLocalModel<any>;
2
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
3
3
  export default _default;
@@ -1,20 +1,3 @@
1
- import mongoose, { Document } from "mongoose";
2
- interface AccountDetails extends Document {
3
- _id: mongoose.Types.ObjectId;
4
- name?: string;
5
- address?: string;
6
- createdAt?: string;
7
- updatedAt?: string;
8
- deletedAt?: string;
9
- city?: string;
10
- pincode?: string;
11
- state?: string;
12
- country?: string;
13
- gstin?: string;
14
- openingbalance?: string;
15
- billedamount?: string;
16
- amountreceived?: string;
17
- balancedue?: string;
18
- }
19
- declare const _default: mongoose.PassportLocalModel<AccountDetails>;
1
+ import mongoose from "mongoose";
2
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
20
3
  export default _default;
@@ -6,5 +6,5 @@ export interface IExtracted extends Document {
6
6
  fileId?: string;
7
7
  data: object;
8
8
  }
9
- declare const _default: mongoose.PassportLocalModel<IExtracted>;
9
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
10
10
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import mongoose from 'mongoose';
2
- declare const _default: mongoose.PassportLocalModel<any>;
2
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
3
3
  export default _default;
@@ -9,5 +9,5 @@ export interface INotifications extends Document {
9
9
  notificationType: string;
10
10
  deletedAt?: any;
11
11
  }
12
- declare const _default: mongoose.PassportLocalModel<INotifications>;
12
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
13
13
  export default _default;
@@ -46,5 +46,5 @@ export interface IOrganisation extends Document {
46
46
  customerOrg?: string;
47
47
  deposits?: object;
48
48
  }
49
- declare const _default: mongoose.PassportLocalModel<IOrganisation>;
49
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
50
50
  export default _default;
@@ -15,5 +15,5 @@ export interface profile extends Document {
15
15
  shippingAddressCountry: string;
16
16
  shippingAddressPinCode: string;
17
17
  }
18
- declare const _default: mongoose.PassportLocalModel<profile>;
18
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
19
19
  export default _default;
@@ -8,5 +8,5 @@ export interface IRole extends Document {
8
8
  deletedAt?: Date;
9
9
  template?: string;
10
10
  }
11
- declare const _default: mongoose.PassportLocalModel<IRole>;
11
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
12
12
  export default _default;
@@ -1,8 +1,2 @@
1
- import mongoose, { Schema, Document } from "mongoose";
2
- interface ISession extends Document {
3
- userId: Schema.Types.ObjectId;
4
- type: string;
5
- created_at: Date;
6
- }
7
- declare const _default: mongoose.PassportLocalModel<ISession>;
8
- export default _default;
1
+ declare let TokenModel: any;
2
+ export default TokenModel;
@@ -9,5 +9,5 @@ export interface IUserRole extends Document {
9
9
  deletedAt?: Date;
10
10
  template?: string;
11
11
  }
12
- declare const _default: mongoose.PassportLocalModel<IUserRole>;
12
+ declare const _default: mongoose.Model<any, {}, {}, {}, any, any>;
13
13
  export default _default;
@@ -1,13 +1,8 @@
1
1
  import { IUserRole } from './schemas/userrole.schema';
2
- import mongoose from 'mongoose';
3
2
  export { IUserRole };
4
3
  export declare function createRolePermission(data: IUserRole): Promise<any>;
5
4
  export declare function updateRolePermission(id: string, data: Partial<IUserRole>): Promise<any>;
6
- export declare function getRole(id: string): Promise<Error | (mongoose.Document<unknown, {}, IUserRole> & IUserRole & Required<{
7
- _id: unknown;
8
- }> & {
9
- __v: number;
10
- })>;
5
+ export declare function getRole(id: string): Promise<any>;
11
6
  export declare function deleteRolePermission(id: string): Promise<any>;
12
7
  export declare function getRolePermission(id: string): Promise<any>;
13
8
  export declare function getAllRolePermissions(searchValue: string, company: string, sort: string | null, skip: string | null, limit: string | null): Promise<IUserRole[]>;
@@ -12,4 +12,3 @@ export { default as Document } from './routes/document.route';
12
12
  export { default as WorkFlow } from './routes/workflow.route';
13
13
  export { default as Form } from './routes/form.route';
14
14
  export { setupLibrary as setupLibrary } from './setupModal';
15
- export { logConnectionDetails as logConnectionDetails } from './setupModal';
@@ -1,30 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose" />
25
- /// <reference types="passport-local-mongoose" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import { Request, Response } from 'express';
29
2
  interface UserRequest extends Request {
30
3
  user?: {
@@ -34,11 +7,7 @@ interface UserRequest extends Request {
34
7
  }
35
8
  export declare function createOrganizationService(req: any, res: Response): Promise<any>;
36
9
  export declare function getOrgDetailsService(req: UserRequest, res: Response): Promise<Response<any, Record<string, any>>>;
37
- export declare function findOrgDetailsService(req: UserRequest, res: Response): Promise<(import("mongoose").Document<unknown, {}, import("../../repository/schemas/organisation.schema").IOrganisation> & import("../../repository/schemas/organisation.schema").IOrganisation & Required<{
38
- _id: unknown;
39
- }> & {
40
- __v: number;
41
- }) | Response<any, Record<string, any>>>;
10
+ export declare function findOrgDetailsService(req: UserRequest, res: Response): Promise<any>;
42
11
  export declare function updateOrganisationHandler(req: UserRequest, res: Response): Promise<Response>;
43
12
  export declare function getOrganisationService(req: UserRequest, res: Response): Promise<Response<any, Record<string, any>>>;
44
13
  export declare function getComplainceCountService(req: UserRequest, res: Response): Promise<Response<any, Record<string, any>>>;
@@ -1,30 +1,3 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose" />
25
- /// <reference types="passport-local-mongoose" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import { Request, Response } from 'express';
29
2
  interface UserRequest extends Request {
30
3
  user?: {
@@ -34,11 +7,7 @@ interface UserRequest extends Request {
34
7
  export declare function createRoleService(req: UserRequest, res: Response): Promise<Response<any, Record<string, any>>>;
35
8
  export declare function getRoleById(Id: string): Promise<{
36
9
  success: boolean;
37
- data: Error | (import("mongoose").Document<unknown, {}, import("../../repository/role.repository").IRole> & import("../../repository/role.repository").IRole & Required<{
38
- _id: unknown;
39
- }> & {
40
- __v: number;
41
- });
10
+ data: any;
42
11
  error?: undefined;
43
12
  } | {
44
13
  success: boolean;
@@ -1,5 +1,4 @@
1
1
  import { Request, Response } from 'express';
2
- import mongoose from 'mongoose';
3
2
  interface UserRequest extends Request {
4
3
  user?: {
5
4
  company?: string;
@@ -8,11 +7,7 @@ interface UserRequest extends Request {
8
7
  export declare function createUserRoleService(req: UserRequest, res: Response): Promise<Response<any, Record<string, any>>>;
9
8
  export declare function getRoleById(Id: string): Promise<{
10
9
  success: boolean;
11
- data: Error | (mongoose.Document<unknown, {}, import("../../repository/userrole.repository").IUserRole> & import("../../repository/userrole.repository").IUserRole & Required<{
12
- _id: unknown;
13
- }> & {
14
- __v: number;
15
- });
10
+ data: any;
16
11
  error?: undefined;
17
12
  } | {
18
13
  success: boolean;
@@ -1,20 +1,8 @@
1
1
  import mongoose from "mongoose";
2
2
  /**
3
- * Set up the library models dynamically.
4
- * This will only initialize models once per connection.
3
+ * Safely initialize models dynamically
5
4
  */
6
5
  export declare const setupLibrary: (connection: typeof mongoose) => void;
7
- /**
8
- * Getter for the Document model
9
- */
10
6
  export declare const getDocumentModel: () => mongoose.Model<any, {}, {}, {}, any, any>;
11
- export declare const getFileSystemModal: () => mongoose.Model<any, {}, {}, {}, any, any>;
12
- /**
13
- * Getter for the Workflow model
14
- */
15
7
  export declare const getWorkflowModel: () => mongoose.Model<any, {}, {}, {}, any, any>;
16
- /**
17
- * Log connection details for debugging purposes.
18
- */
19
- export declare const logConnectionDetails: () => void;
20
- export default setupLibrary;
8
+ export declare const getFileSystemModel: () => mongoose.Model<any, {}, {}, {}, any, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-typescript-library-rahul52us",
3
- "version": "1.1.8",
3
+ "version": "1.2.1",
4
4
  "description": "A reusable TypeScript utility library.",
5
5
  "main": "dist/server.js",
6
6
  "types": "dist/types/server.d.ts",
@@ -1,6 +1,6 @@
1
1
  import mongoose, { connection, mongo } from "mongoose";
2
2
  import { Readable } from "stream";
3
- import { getFileSystemModal } from "~/setupModal";
3
+ import { getFileSystemModel } from "../setupModal";
4
4
 
5
5
  const { GridFSBucket } = mongo;
6
6
 
@@ -24,7 +24,7 @@ export async function uploadFile(file: string, name: string, type: string) {
24
24
 
25
25
  uploadStream.on("finish", () => {
26
26
  const fileId = uploadStream.id;
27
- getFileSystemModal()
27
+ getFileSystemModel()
28
28
  .create({
29
29
  fileId: fileId,
30
30
  })
@@ -24,4 +24,5 @@ const workFlowSettingsSchema = new mongoose.Schema({
24
24
  }
25
25
  })
26
26
 
27
- export default mongoose.model('settings',workFlowSettingsSchema)
27
+ export default mongoose.models.settings || mongoose.model('settings', workFlowSettingsSchema);
28
+
@@ -75,4 +75,4 @@ const AccountDetailsSchema: Schema = new mongoose.Schema({
75
75
  },
76
76
  });
77
77
 
78
- export default mongoose.model<AccountDetails>('AccountDetails', AccountDetailsSchema);
78
+ export default mongoose.models.AccountDetails || mongoose.model('AccountDetails', AccountDetailsSchema);
@@ -30,4 +30,5 @@ const extractedSchema = new Schema({
30
30
  }
31
31
  })
32
32
 
33
- export default mongoose.model<IExtracted>("extracted", extractedSchema);
33
+ export default mongoose.models.extracted || mongoose.model('extracted', extractedSchema);
34
+
@@ -31,4 +31,5 @@ const formSchema = new mongoose.Schema({
31
31
  },
32
32
  })
33
33
 
34
- export default mongoose.model('Form',formSchema)
34
+ export default mongoose.models.Form || mongoose.model('Form', formSchema);
35
+
@@ -50,7 +50,4 @@ const NotificationsSchema: Schema = new mongoose.Schema(
50
50
  { timestamps: true }
51
51
  );
52
52
 
53
- export default mongoose.model<INotifications>(
54
- "notification",
55
- NotificationsSchema
56
- );
53
+ export default mongoose.models.notification || mongoose.model('notification', NotificationsSchema);
@@ -175,4 +175,5 @@ const OrganisationSchema: Schema = new Schema({
175
175
  });
176
176
 
177
177
  // Export the mongoose model with the generic typing
178
- export default mongoose.model<IOrganisation>("Organisation", OrganisationSchema);
178
+ export default mongoose.models.Organisation || mongoose.model('Organisation', OrganisationSchema);
179
+
@@ -62,4 +62,5 @@ const profileSchema: Schema = new mongoose.Schema({
62
62
  }
63
63
  })
64
64
 
65
- export default mongoose.model<profile>('Profile', profileSchema)
65
+ export default mongoose.models.Profile || mongoose.model('Profile', profileSchema);
66
+
@@ -42,4 +42,5 @@ const RoleSchema: Schema = new mongoose.Schema({
42
42
  }
43
43
  });
44
44
 
45
- export default mongoose.model<IRole>('Role', RoleSchema);
45
+ export default mongoose.models.Role || mongoose.model('Role', RoleSchema);
46
+
@@ -1,24 +1,39 @@
1
1
  import mongoose, { Schema, Document } from "mongoose";
2
2
 
3
3
  interface ISession extends Document {
4
- userId: Schema.Types.ObjectId;
5
- type: string;
6
- created_at: Date;
7
- };
4
+ userId: Schema.Types.ObjectId;
5
+ type: string;
6
+ created_at: Date;
7
+ }
8
8
 
9
9
  const TokensSchema: Schema = new mongoose.Schema({
10
- userId: {
11
- type: Schema.Types.ObjectId,
12
- required: true
13
- },
14
- type: {
15
- type: String
16
- },
17
- created_at:{
18
- type: Date,
19
- default: Date.now
20
- }
21
-
22
- })
23
-
24
- export default mongoose.model<ISession>('Token', TokensSchema)
10
+ userId: {
11
+ type: Schema.Types.ObjectId,
12
+ required: true,
13
+ },
14
+ type: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ created_at: {
19
+ type: Date,
20
+ default: Date.now,
21
+ },
22
+ });
23
+
24
+ // Safe way to dynamically fetch or initialize the model
25
+ let TokenModel : any = null;
26
+
27
+ console.log(mongoose.models)
28
+
29
+ if (mongoose.models.Token) {
30
+ console.log("Token model already exists.");
31
+ TokenModel = mongoose.models.Token;
32
+ } else {
33
+ console.log("Creating Token model fallback.");
34
+ TokenModel = mongoose.model<ISession>('Token', TokensSchema);
35
+ }
36
+
37
+ export default TokenModel;
38
+
39
+
@@ -89,4 +89,5 @@ const UserRoleSchema: Schema = new mongoose.Schema({
89
89
  }
90
90
  });
91
91
 
92
- export default mongoose.model<IUserRole>('UserRole', UserRoleSchema);
92
+ export default mongoose.models.UserRole || mongoose.model('UserRole', UserRoleSchema);
93
+
package/src/server.ts CHANGED
@@ -14,5 +14,4 @@ export { default as Document } from './routes/document.route';
14
14
  export { default as WorkFlow } from './routes/workflow.route';
15
15
  export { default as Form } from './routes/form.route';
16
16
  export {setupLibrary as setupLibrary} from './setupModal'
17
- export {logConnectionDetails as logConnectionDetails} from './setupModal'
18
17
  console.log("liberay are imported")
package/src/setupModal.ts CHANGED
@@ -2,27 +2,29 @@
2
2
  import mongoose from "mongoose";
3
3
  import { DocumentSchema } from "./repository/schemas/document.schema";
4
4
  import { workFlowSchema } from "./repository/schemas/workflow.schema";
5
- import {fileSystemSchema} from './repository/schemas/fileSystem.schema'
5
+ import { fileSystemSchema } from './repository/schemas/fileSystem.schema';
6
6
 
7
+ /**
8
+ * Utility to ensure initialization has occurred
9
+ */
7
10
  let modelsInitialized = false;
8
11
 
9
- // Private references to models
10
- let DocumentModel: mongoose.Model<any> | null = null;
11
- let WorkflowModel: mongoose.Model<any> | null = null;
12
- let FileSystemModal: mongoose.Model<any> | null = null
13
-
14
12
  /**
15
- * Utility to ensure initialization has occurred
13
+ * Dynamically create or get existing Mongoose models
16
14
  */
17
- const checkInitialization = () => {
18
- if (!modelsInitialized) {
19
- throw new Error("Library models are not initialized. Call `setupLibrary()` before using library features.");
20
- }
15
+ const getOrCreateModel = (modelName: string, schema: mongoose.Schema) => {
16
+ return mongoose.models[modelName] || mongoose.model(modelName, schema);
21
17
  };
22
18
 
23
19
  /**
24
- * Set up the library models dynamically.
25
- * This will only initialize models once per connection.
20
+ * Library models
21
+ */
22
+ let DocumentModel: mongoose.Model<any>;
23
+ let WorkflowModel: mongoose.Model<any>;
24
+ let FileSystemModel: mongoose.Model<any>;
25
+
26
+ /**
27
+ * Safely initialize models dynamically
26
28
  */
27
29
  export const setupLibrary = (connection: typeof mongoose) => {
28
30
  if (modelsInitialized) {
@@ -32,46 +34,36 @@ export const setupLibrary = (connection: typeof mongoose) => {
32
34
 
33
35
  console.log("Initializing library models with provided connection...");
34
36
 
35
- DocumentModel = connection.model("Document", DocumentSchema);
36
- WorkflowModel = connection.model("Workflow", workFlowSchema);
37
- FileSystemModal = connection.model('FileSystem',fileSystemSchema)
37
+ // Dynamically resolve models and store them
38
+ DocumentModel = getOrCreateModel("Document", DocumentSchema);
39
+ WorkflowModel = getOrCreateModel("Workflow", workFlowSchema);
40
+ FileSystemModel = getOrCreateModel("FileSystem", fileSystemSchema);
41
+
38
42
  modelsInitialized = true;
39
43
 
40
44
  console.log("Library models initialized.");
41
45
  };
42
46
 
43
47
  /**
44
- * Getter for the Document model
48
+ * Getter for models with initialization check
45
49
  */
46
- export const getDocumentModel = () => {
47
- checkInitialization();
48
- return DocumentModel;
50
+ const checkInitialization = () => {
51
+ if (!modelsInitialized) {
52
+ throw new Error("Library models are not initialized. Call `setupLibrary()` before using library features.");
53
+ }
49
54
  };
50
55
 
51
- export const getFileSystemModal = () => {
56
+ export const getDocumentModel = () => {
52
57
  checkInitialization();
53
- return FileSystemModal;
58
+ return DocumentModel;
54
59
  };
55
60
 
56
- /**
57
- * Getter for the Workflow model
58
- */
59
61
  export const getWorkflowModel = () => {
60
62
  checkInitialization();
61
63
  return WorkflowModel;
62
64
  };
63
65
 
64
- /**
65
- * Log connection details for debugging purposes.
66
- */
67
- export const logConnectionDetails = () => {
68
- if (mongoose.connection) {
69
- console.log("MongoDB Ready State:", mongoose.connection.readyState);
70
- console.log("MongoDB Host:", mongoose.connection.host);
71
- console.log("MongoDB Database Name:", mongoose.connection.name);
72
- } else {
73
- console.log("No mongoose connection established.");
74
- }
66
+ export const getFileSystemModel = () => {
67
+ checkInitialization();
68
+ return FileSystemModel;
75
69
  };
76
-
77
- export default setupLibrary;
package/types/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // types/index.d.ts
2
2
  declare module 'my-typescript-library-rahul52us' {
3
- export function setupMongoose(): void
3
+ export function setupLibrary(): void
4
4
  export function logConnectionDetails() : void;
5
5
  export function createPendingApproval(): any;
6
6