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.
- package/dist/{modules/services/services.module-utils.js → axios.js} +1 -1
- package/dist/exceptions/bad-body.exception.d.ts +8 -1
- package/dist/exceptions/bad-body.exception.js +26 -1
- package/dist/exceptions/duplicate.exception.d.ts +8 -1
- package/dist/exceptions/duplicate.exception.js +26 -1
- package/dist/exceptions/index.d.ts +7 -0
- package/dist/exceptions/not-found.exception.d.ts +8 -1
- package/dist/exceptions/not-found.exception.js +26 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/modules/account/account.module.d.ts +12 -0
- package/dist/modules/account/account.module.js +34 -0
- package/dist/modules/{services/account-service → account}/account.service.js +3 -3
- package/dist/modules/account/index.d.ts +2 -0
- package/dist/modules/account/index.js +7 -0
- package/dist/modules/authentication/authentication.module.d.ts +3 -12
- package/dist/modules/authentication/authentication.module.js +4 -6
- package/dist/modules/authentication/index.d.ts +1 -1
- package/dist/modules/comment/comment.controller.d.ts +24 -0
- package/dist/modules/comment/comment.controller.js +78 -0
- package/dist/modules/{services/comment-service/comment-service.definitions.d.ts → comment/comment.module-options.d.ts} +2 -0
- package/dist/modules/{services/comment-service/comment-service.definitions.js → comment/comment.module-options.js} +2 -0
- package/dist/modules/comment/comment.module.d.ts +19 -0
- package/dist/modules/comment/comment.module.js +57 -0
- package/dist/modules/comment/comment.service.d.ts +42 -0
- package/dist/modules/comment/comment.service.js +113 -0
- package/dist/modules/comment/index.d.ts +3 -0
- package/dist/modules/comment/index.js +12 -0
- package/dist/modules/content/content.module.d.ts +18 -0
- package/dist/modules/content/content.module.js +46 -0
- package/dist/modules/{services/content-service → content}/content.service.d.ts +5 -6
- package/dist/modules/{services/content-service → content}/content.service.js +21 -17
- package/dist/modules/content/index.d.ts +2 -0
- package/dist/modules/content/index.js +7 -0
- package/dist/modules/index.d.ts +5 -1
- package/dist/modules/index.js +5 -1
- package/dist/modules/like/like.module.d.ts +1 -1
- package/dist/modules/like/like.module.js +2 -2
- package/dist/modules/mail/index.d.ts +3 -0
- package/dist/modules/mail/index.js +10 -0
- package/dist/modules/mail/mail.module.d.ts +12 -0
- package/dist/modules/mail/mail.module.js +34 -0
- package/dist/modules/{services/mail-service → mail}/mail.service.d.ts +1 -1
- package/dist/modules/{services/mail-service → mail}/mail.service.js +3 -3
- package/dist/modules/search/index.d.ts +3 -0
- package/dist/modules/search/index.js +9 -0
- package/dist/modules/search/search.module.d.ts +18 -0
- package/dist/modules/search/search.module.js +46 -0
- package/dist/modules/{services/search-service → search}/search.service.d.ts +6 -7
- package/dist/modules/{services/search-service → search}/search.service.js +21 -17
- package/dist/schema.transformer.d.ts +2 -0
- package/dist/schema.transformer.js +10 -0
- package/dist/virtuals.factory.d.ts +57 -0
- package/dist/virtuals.factory.js +117 -0
- package/package.json +1 -1
- package/dist/modules/services/comment-service/comment.service.d.ts +0 -38
- package/dist/modules/services/comment-service/comment.service.js +0 -101
- package/dist/modules/services/index.d.ts +0 -9
- package/dist/modules/services/index.js +0 -40
- package/dist/modules/services/services.module.d.ts +0 -24
- package/dist/modules/services/services.module.js +0 -39
- package/dist/virtuals.d.ts +0 -51
- package/dist/virtuals.js +0 -121
- /package/dist/{modules/services/services.module-utils.d.ts → axios.d.ts} +0 -0
- /package/dist/modules/{services/account-service → account}/account.service.d.ts +0 -0
- /package/dist/modules/{services/mail-service/mail-service.definitions.d.ts → mail/mail.models.d.ts} +0 -0
- /package/dist/modules/{services/mail-service/mail-service.definitions.js → mail/mail.models.js} +0 -0
- /package/dist/modules/{services/search-service/search-service.definitions.d.ts → search/search.models.d.ts} +0 -0
- /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;
|
|
File without changes
|
|
File without changes
|
/package/dist/modules/{services/mail-service/mail-service.definitions.d.ts → mail/mail.models.d.ts}
RENAMED
|
File without changes
|
/package/dist/modules/{services/mail-service/mail-service.definitions.js → mail/mail.models.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|