itlab-internal-services 2.3.0 → 2.4.0

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 (69) hide show
  1. package/dist/{modules/services/services.module-utils.js → axios.js} +1 -1
  2. package/dist/exceptions/bad-body.exception.d.ts +8 -1
  3. package/dist/exceptions/bad-body.exception.js +26 -1
  4. package/dist/exceptions/duplicate.exception.d.ts +8 -1
  5. package/dist/exceptions/duplicate.exception.js +26 -1
  6. package/dist/exceptions/index.d.ts +7 -0
  7. package/dist/exceptions/not-found.exception.d.ts +8 -1
  8. package/dist/exceptions/not-found.exception.js +26 -1
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.js +2 -1
  11. package/dist/modules/account/account.module.d.ts +12 -0
  12. package/dist/modules/account/account.module.js +34 -0
  13. package/dist/modules/{services/account-service → account}/account.service.js +3 -3
  14. package/dist/modules/account/index.d.ts +2 -0
  15. package/dist/modules/account/index.js +7 -0
  16. package/dist/modules/authentication/authentication.module.d.ts +3 -12
  17. package/dist/modules/authentication/authentication.module.js +4 -6
  18. package/dist/modules/authentication/index.d.ts +1 -1
  19. package/dist/modules/comment/comment.controller.d.ts +24 -0
  20. package/dist/modules/comment/comment.controller.js +78 -0
  21. package/dist/modules/{services/comment-service/comment-service.definitions.d.ts → comment/comment.module-options.d.ts} +2 -0
  22. package/dist/modules/{services/comment-service/comment-service.definitions.js → comment/comment.module-options.js} +2 -0
  23. package/dist/modules/comment/comment.module.d.ts +19 -0
  24. package/dist/modules/comment/comment.module.js +57 -0
  25. package/dist/modules/comment/comment.service.d.ts +42 -0
  26. package/dist/modules/comment/comment.service.js +113 -0
  27. package/dist/modules/comment/index.d.ts +3 -0
  28. package/dist/modules/comment/index.js +12 -0
  29. package/dist/modules/content/content.module.d.ts +18 -0
  30. package/dist/modules/content/content.module.js +46 -0
  31. package/dist/modules/{services/content-service → content}/content.service.d.ts +5 -6
  32. package/dist/modules/{services/content-service → content}/content.service.js +21 -17
  33. package/dist/modules/content/index.d.ts +2 -0
  34. package/dist/modules/content/index.js +7 -0
  35. package/dist/modules/index.d.ts +5 -1
  36. package/dist/modules/index.js +5 -1
  37. package/dist/modules/like/like.module.d.ts +1 -1
  38. package/dist/modules/like/like.module.js +2 -2
  39. package/dist/modules/mail/index.d.ts +3 -0
  40. package/dist/modules/mail/index.js +10 -0
  41. package/dist/modules/mail/mail.module.d.ts +12 -0
  42. package/dist/modules/mail/mail.module.js +34 -0
  43. package/dist/modules/{services/mail-service → mail}/mail.service.d.ts +1 -1
  44. package/dist/modules/{services/mail-service → mail}/mail.service.js +3 -3
  45. package/dist/modules/search/index.d.ts +3 -0
  46. package/dist/modules/search/index.js +9 -0
  47. package/dist/modules/search/search.module.d.ts +18 -0
  48. package/dist/modules/search/search.module.js +46 -0
  49. package/dist/modules/{services/search-service → search}/search.service.d.ts +6 -7
  50. package/dist/modules/{services/search-service → search}/search.service.js +21 -17
  51. package/dist/schema.transformer.d.ts +2 -0
  52. package/dist/schema.transformer.js +10 -0
  53. package/dist/virtuals.factory.d.ts +57 -0
  54. package/dist/virtuals.factory.js +117 -0
  55. package/package.json +1 -1
  56. package/dist/modules/services/comment-service/comment.service.d.ts +0 -38
  57. package/dist/modules/services/comment-service/comment.service.js +0 -101
  58. package/dist/modules/services/index.d.ts +0 -9
  59. package/dist/modules/services/index.js +0 -40
  60. package/dist/modules/services/services.module.d.ts +0 -24
  61. package/dist/modules/services/services.module.js +0 -39
  62. package/dist/virtuals.d.ts +0 -51
  63. package/dist/virtuals.js +0 -121
  64. /package/dist/{modules/services/services.module-utils.d.ts → axios.d.ts} +0 -0
  65. /package/dist/modules/{services/account-service → account}/account.service.d.ts +0 -0
  66. /package/dist/modules/{services/mail-service/mail-service.definitions.d.ts → mail/mail.models.d.ts} +0 -0
  67. /package/dist/modules/{services/mail-service/mail-service.definitions.js → mail/mail.models.js} +0 -0
  68. /package/dist/modules/{services/search-service/search-service.definitions.d.ts → search/search.models.d.ts} +0 -0
  69. /package/dist/modules/{services/search-service/search-service.definitions.js → search/search.models.js} +0 -0
package/dist/virtuals.js DELETED
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerServiceRefVirtuals = exports.VirtualCommentsCount = exports.VirtualComments = exports.VirtualContent = exports.VirtualAccounts = exports.VirtualAccount = void 0;
4
- const pipes_1 = require("./pipes");
5
- /**
6
- * Creates a virtual account field on the schema, linking it to the 'accounts' collection.
7
- *
8
- * @param {Schema} schema - the schema to create the virtual field on
9
- * @param {string} name - the name of the virtual field
10
- * @param {string} localField - the local field to use for the virtual field
11
- * @return {void}
12
- */
13
- function VirtualAccount(schema, name, localField) {
14
- schema.virtual(name, {
15
- ref: 'accounts',
16
- foreignField: '_id',
17
- localField,
18
- justOne: true,
19
- });
20
- }
21
- exports.VirtualAccount = VirtualAccount;
22
- /**
23
- * Creates a virtual accounts field on the given schema, linking it to the 'accounts' collection.
24
- *
25
- * @param {Schema} schema - the schema to which the virtual field will be added
26
- * @param {string} name - the name of the virtual field
27
- * @param {string} localField - the local field to be used for the virtual linking
28
- * @return {void}
29
- */
30
- function VirtualAccounts(schema, name, localField) {
31
- schema.virtual(name, {
32
- ref: 'accounts',
33
- foreignField: '_id',
34
- localField,
35
- justOne: false,
36
- });
37
- }
38
- exports.VirtualAccounts = VirtualAccounts;
39
- /**
40
- * Creates a virtual content field in the schema, linking it to the 'content' collection.
41
- *
42
- * @param {Schema} schema - the schema to create the virtual field in
43
- * @param {Targets} target - the target for the virtual field
44
- * @return {void}
45
- */
46
- function VirtualContent(schema, target) {
47
- schema.virtual('content', {
48
- ref: 'content',
49
- foreignField: 'targetId',
50
- localField: '_id',
51
- match: { target },
52
- justOne: true,
53
- });
54
- }
55
- exports.VirtualContent = VirtualContent;
56
- /**
57
- * Creates virtual comments field in the schema, linking it to the 'comments' collection.
58
- *
59
- * @param {Schema} schema - the schema to create virtual comments for
60
- * @param {Targets} target - the target for which virtual comments are created
61
- * @return {void}
62
- */
63
- function VirtualComments(schema, target) {
64
- schema.virtual('comments', {
65
- ref: 'comments',
66
- foreignField: 'targetId',
67
- localField: '_id',
68
- match: { target, _replyTo: { $exists: false } },
69
- justOne: false,
70
- });
71
- }
72
- exports.VirtualComments = VirtualComments;
73
- /**
74
- * Creates a virtual commentsCount field in the schema to count the comments related to the specified target.
75
- *
76
- * @param {Schema} schema - the schema on which to create the virtual field
77
- * @param {Targets} target - the target for which the comments count is being calculated
78
- * @return {void}
79
- */
80
- function VirtualCommentsCount(schema, target) {
81
- schema.virtual('commentsCount', {
82
- ref: 'comments',
83
- foreignField: 'targetId',
84
- localField: '_id',
85
- match: { target },
86
- count: true,
87
- });
88
- }
89
- exports.VirtualCommentsCount = VirtualCommentsCount;
90
- /** The targets for which virtual fields are created */
91
- const targets = [
92
- pipes_1.Targets.BOOKS,
93
- pipes_1.Targets.DEMOHIVE,
94
- pipes_1.Targets.EVENTS,
95
- pipes_1.Targets.HACKSCHOOL_COURSE,
96
- pipes_1.Targets.HACKSCHOOL_DOCUMENTATION,
97
- pipes_1.Targets.HACKSCHOOL_THREAD,
98
- pipes_1.Targets.NEWSROOM,
99
- pipes_1.Targets.PODCASTS,
100
- pipes_1.Targets.TEAM_MEMBER,
101
- pipes_1.Targets.TECH_RADAR_BLIPS,
102
- pipes_1.Targets.TECH_RADAR_RADAR,
103
- ];
104
- /**
105
- * Registers virtual fields for service references in the given schema.
106
- *
107
- * @param {Schema} schema - the schema to register the virtual fields on
108
- * @return {void}
109
- */
110
- function registerServiceRefVirtuals(schema) {
111
- targets.forEach((target) => {
112
- schema.virtual('ref-' + target, {
113
- ref: target,
114
- foreignField: '_id',
115
- localField: 'targetId',
116
- match: { target },
117
- justOne: true,
118
- });
119
- });
120
- }
121
- exports.registerServiceRefVirtuals = registerServiceRefVirtuals;