itlab-internal-services 2.15.5 → 2.15.6
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/classes/document-merger.class.js +27 -37
- package/dist/classes/document-updater.class.js +2 -2
- package/dist/factories/virtuals.factory.js +2 -2
- package/dist/functions/create-duplicate-checker.function.js +3 -12
- package/dist/functions/create-internal-axios-client.function.d.ts +0 -1
- package/dist/functions/create-schema-transformer.function.js +1 -1
- package/dist/models/thumbnail/thumbnail.model.js +1 -0
- package/dist/modules/cache/cache.service.js +50 -71
- package/dist/modules/comment/comment.controller.js +3 -13
- package/dist/modules/comment/comment.module.js +5 -1
- package/dist/modules/comment/comment.service.js +30 -40
- package/dist/modules/content/content.module.js +4 -1
- package/dist/modules/content/content.property.js +1 -0
- package/dist/modules/content/content.service.js +56 -68
- package/dist/modules/database/database.liveness-controller.js +19 -30
- package/dist/modules/database/database.module.js +4 -12
- package/dist/modules/database/lock-service/lock.service.js +22 -35
- package/dist/modules/database/model-service/dbs/hub-account.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-account.db.js +1 -1
- package/dist/modules/database/model-service/dbs/hub-books.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-comments.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-content.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-demo-hive.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-events.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-hackschool.db.d.ts +6 -6
- package/dist/modules/database/model-service/dbs/hub-newsroom.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-podcasts.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-team.db.d.ts +2 -2
- package/dist/modules/database/model-service/dbs/hub-tech-radar.db.d.ts +4 -4
- package/dist/modules/database/model-service/model.service.d.ts +392 -224
- package/dist/modules/database/model-service/model.service.js +4 -17
- package/dist/modules/fetch/fetch.module.js +4 -1
- package/dist/modules/fetch/fetch.service.js +56 -94
- package/dist/modules/like/like.controller.js +7 -21
- package/dist/modules/like/like.module.js +5 -1
- package/dist/modules/like/like.service.js +13 -28
- package/dist/modules/mail/mail.module.js +4 -1
- package/dist/modules/mail/mail.service.js +1 -0
- package/dist/modules/notification/notification.module.js +4 -1
- package/dist/modules/pass/pass.module.js +4 -1
- package/dist/modules/pass/pass.service.js +39 -61
- package/dist/modules/search/search.module.js +4 -1
- package/dist/modules/search/search.service.js +11 -22
- package/dist/transform/boolean.transform.js +3 -2
- package/dist/transform/image-url.transform.js +1 -1
- package/dist/transform/number.transform.js +2 -1
- package/dist/transform/string-array.transform.js +1 -1
- package/dist/transform/string.transform.js +1 -1
- package/dist/transform/timestamp.transform.js +2 -1
- package/package.json +53 -22
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
var ContentService_1;
|
|
24
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
16
|
exports.ContentService = void 0;
|
|
@@ -64,20 +55,19 @@ let ContentService = ContentService_1 = class ContentService {
|
|
|
64
55
|
* @param {LabContent} content - Content object to validate
|
|
65
56
|
* @returns {Promise<void>} Resolves if valid, rejects with HTTP error otherwise
|
|
66
57
|
*/
|
|
67
|
-
validateContent(content) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
58
|
+
async validateContent(content) {
|
|
59
|
+
var _a, _b, _c;
|
|
60
|
+
this.logger.log('Validating content');
|
|
61
|
+
try {
|
|
62
|
+
await this.axiosInstance.post(`verify`, { content });
|
|
63
|
+
this.logger.log('Content validation successful');
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
const axiosError = error;
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
68
|
+
this.logger.error(`Content validation failed: ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
69
|
+
throw new common_1.HttpException((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data, ((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.status) || 500);
|
|
70
|
+
}
|
|
81
71
|
}
|
|
82
72
|
/**
|
|
83
73
|
* Submits new content for a specific resource.
|
|
@@ -86,20 +76,19 @@ let ContentService = ContentService_1 = class ContentService {
|
|
|
86
76
|
* @param {LabContent} content - Content to be persisted
|
|
87
77
|
* @returns {Promise<void>}
|
|
88
78
|
*/
|
|
89
|
-
submitContent(resourceId, content) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
79
|
+
async submitContent(resourceId, content) {
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
this.logger.log(`Submitting content for ${this.resource} (${resourceId})`);
|
|
82
|
+
try {
|
|
83
|
+
await this.axiosInstance.post(`${this.resource}/${resourceId}`, { content });
|
|
84
|
+
this.logger.log(`Content successfully submitted for ${this.resource} (${resourceId})`);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
const axiosError = error;
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
89
|
+
this.logger.error(`Content submission failed for ${this.resource} (${resourceId}): ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
90
|
+
throw new common_1.HttpException((_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.data, ((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.status) || 500);
|
|
91
|
+
}
|
|
103
92
|
}
|
|
104
93
|
/**
|
|
105
94
|
* Removes content associated with the given resource.
|
|
@@ -107,19 +96,18 @@ let ContentService = ContentService_1 = class ContentService {
|
|
|
107
96
|
* @param {string} resourceId - Unique identifier of the resource
|
|
108
97
|
* @returns {Promise<void>}
|
|
109
98
|
*/
|
|
110
|
-
removeContent(resourceId) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
99
|
+
async removeContent(resourceId) {
|
|
100
|
+
var _a;
|
|
101
|
+
this.logger.log(`Removing content for ${this.resource} (${resourceId})`);
|
|
102
|
+
try {
|
|
103
|
+
await this.axiosInstance.delete(`${this.resource}/${resourceId}`);
|
|
104
|
+
this.logger.log(`Content removed successfully for ${this.resource} (${resourceId})`);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const axiosError = error;
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
109
|
+
this.logger.error(`Content removal failed for ${this.resource} (${resourceId}): ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
110
|
+
}
|
|
123
111
|
}
|
|
124
112
|
/**
|
|
125
113
|
* Retrieves content in the specified format from the backend service.
|
|
@@ -128,24 +116,24 @@ let ContentService = ContentService_1 = class ContentService {
|
|
|
128
116
|
* @param {'json'|'text'|'html'|'populated'} type - Format in which to retrieve content
|
|
129
117
|
* @returns {Promise<LabContent | string | LabContentPopulated>} - The retrieved content
|
|
130
118
|
*/
|
|
131
|
-
getContent(resourceId, type) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
}
|
|
119
|
+
async getContent(resourceId, type) {
|
|
120
|
+
var _a;
|
|
121
|
+
this.logger.log(`Fetching ${type} content for ${this.resource} (${resourceId})`);
|
|
122
|
+
try {
|
|
123
|
+
const response = await this.axiosInstance.get(`${this.resource}/${resourceId}/${type}`);
|
|
124
|
+
this.logger.log(`Successfully retrieved ${type} content for ${this.resource} (${resourceId})`);
|
|
125
|
+
return response.data;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const axiosError = error;
|
|
129
|
+
this.logger.error(
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
131
|
+
`Failed to fetch ${type} content for ${this.resource} (${resourceId}): ${(_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.data}`);
|
|
132
|
+
// Return sensible default based on content type
|
|
133
|
+
if (type === 'text')
|
|
134
|
+
return '';
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
149
137
|
}
|
|
150
138
|
};
|
|
151
139
|
exports.ContentService = ContentService;
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
15
|
exports.DatabaseLivenessProbeController = void 0;
|
|
25
16
|
const common_1 = require("@nestjs/common");
|
|
@@ -50,29 +41,27 @@ let DatabaseLivenessProbeController = class DatabaseLivenessProbeController {
|
|
|
50
41
|
* @param res {Response} - Express response object used to return HTTP status
|
|
51
42
|
* @returns {Promise<void>} - Sends status response directly via Express
|
|
52
43
|
*/
|
|
53
|
-
getLivenessStatus(response) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
async getLivenessStatus(response) {
|
|
45
|
+
// Confirm the Mongoose connection exists and is in a connected state (readyState = 1)
|
|
46
|
+
if (!this.connection || this.connection.readyState !== mongoose_2.ConnectionStates.connected) {
|
|
47
|
+
response.status(500).send('MongoDB connection is not established');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
// Ping the MongoDB admin interface to verify responsiveness
|
|
52
|
+
const pingResult = await this.connection.db.admin().ping();
|
|
53
|
+
// Validate ping response; an 'ok' value of 1 indicates success
|
|
54
|
+
if ((pingResult === null || pingResult === void 0 ? void 0 : pingResult.ok) === 1) {
|
|
55
|
+
response.status(200).send({ ok: 1, db: 1 });
|
|
58
56
|
return;
|
|
59
57
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
// If ping did not return success, raise an error indicating DB connectivity issues
|
|
69
|
-
response.status(500).send('Failed to receive pong from MongoDB');
|
|
70
|
-
}
|
|
71
|
-
catch (_a) {
|
|
72
|
-
// General catch-all for any unexpected errors during the ping process
|
|
73
|
-
response.status(500).send('Error occurred while pinging MongoDB');
|
|
74
|
-
}
|
|
75
|
-
});
|
|
58
|
+
// If ping did not return success, raise an error indicating DB connectivity issues
|
|
59
|
+
response.status(500).send('Failed to receive pong from MongoDB');
|
|
60
|
+
}
|
|
61
|
+
catch (_a) {
|
|
62
|
+
// General catch-all for any unexpected errors during the ping process
|
|
63
|
+
response.status(500).send('Error occurred while pinging MongoDB');
|
|
64
|
+
}
|
|
76
65
|
}
|
|
77
66
|
};
|
|
78
67
|
exports.DatabaseLivenessProbeController = DatabaseLivenessProbeController;
|
|
@@ -5,15 +5,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
10
|
};
|
|
@@ -75,10 +66,11 @@ let DatabaseModule = DatabaseModule_1 = class DatabaseModule {
|
|
|
75
66
|
imports: [
|
|
76
67
|
mongoose_1.MongooseModule.forRootAsync({
|
|
77
68
|
inject: asyncOptions.inject,
|
|
78
|
-
useFactory: (...args) =>
|
|
79
|
-
|
|
69
|
+
useFactory: async (...args) => {
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
71
|
+
const resolvedOptions = await asyncOptions.useFactory(...args);
|
|
80
72
|
return this.buildMongooseOptions(resolvedOptions);
|
|
81
|
-
}
|
|
73
|
+
},
|
|
82
74
|
}),
|
|
83
75
|
],
|
|
84
76
|
};
|
|
@@ -11,15 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
var LockService_1;
|
|
24
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
16
|
exports.LockService = void 0;
|
|
@@ -48,15 +39,14 @@ let LockService = LockService_1 = class LockService {
|
|
|
48
39
|
this.logger = new common_1.Logger(LockService_1.name);
|
|
49
40
|
this.serviceId = (0, crypto_1.randomUUID)(); // Unique identifier for this service instance
|
|
50
41
|
this.lockDuration = 300000; // Duration for which a lock is held (5 minutes)
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
51
43
|
this.lockModel = this.databaseConnection.model(lock_schema_1.LockDefinition.name, lock_schema_1.LockDefinition.schema);
|
|
52
44
|
}
|
|
53
45
|
/**
|
|
54
46
|
* Ensures the lock model indexes and schema are initialized after module setup.
|
|
55
47
|
*/
|
|
56
|
-
onModuleInit() {
|
|
57
|
-
|
|
58
|
-
yield this.lockModel.init();
|
|
59
|
-
});
|
|
48
|
+
async onModuleInit() {
|
|
49
|
+
await this.lockModel.init();
|
|
60
50
|
}
|
|
61
51
|
/**
|
|
62
52
|
* Attempts to acquire a distributed lock for the given key.
|
|
@@ -74,25 +64,24 @@ let LockService = LockService_1 = class LockService {
|
|
|
74
64
|
* @param lockKey Unique identifier for the resource to lock.
|
|
75
65
|
* @returns True if the lock was acquired successfully; false otherwise.
|
|
76
66
|
*/
|
|
77
|
-
acquireLock(lockKey) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.logger.log(`Lock for key "${lockKey}" is currently held by another service.`);
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
this.logger.log(`Lock for key "${lockKey}" acquired; expires at ${expiresAt.toISOString()}`);
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
this.logger.log(`Failed to acquire lock (${lockKey}): Another service has already locked this item`);
|
|
67
|
+
async acquireLock(lockKey) {
|
|
68
|
+
const now = new Date();
|
|
69
|
+
const expiresAt = new Date(now.getTime() + this.lockDuration);
|
|
70
|
+
this.logger.log(`Attempting to acquire lock for key "${lockKey}"`);
|
|
71
|
+
try {
|
|
72
|
+
const lock = await this.lockModel.findOneAndUpdate({ lockKey, serviceId: { $exists: false }, expiresAt: { $lt: now } }, { $set: { lockKey, serviceId: this.serviceId, expiresAt } }, { upsert: true, new: true });
|
|
73
|
+
if (lock.serviceId !== this.serviceId) {
|
|
74
|
+
this.logger.log(`Lock for key "${lockKey}" is currently held by another service.`);
|
|
93
75
|
return false;
|
|
94
76
|
}
|
|
95
|
-
|
|
77
|
+
this.logger.log(`Lock for key "${lockKey}" acquired; expires at ${expiresAt.toISOString()}`);
|
|
78
|
+
return true;
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
this.logger.log(`Failed to acquire lock (${lockKey}): Another service has already locked this item`);
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
96
85
|
}
|
|
97
86
|
/**
|
|
98
87
|
* Releases the lock for the specified key, but only if currently owned by this service instance.
|
|
@@ -101,11 +90,9 @@ let LockService = LockService_1 = class LockService {
|
|
|
101
90
|
*
|
|
102
91
|
* @param lockKey Unique identifier for the lock to release.
|
|
103
92
|
*/
|
|
104
|
-
releaseLock(lockKey) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
yield this.lockModel.deleteOne({ lockKey, serviceId: this.serviceId });
|
|
108
|
-
});
|
|
93
|
+
async releaseLock(lockKey) {
|
|
94
|
+
this.logger.log(`Releasing lock for key "${lockKey}" if owned by this service.`);
|
|
95
|
+
await this.lockModel.deleteOne({ lockKey, serviceId: this.serviceId });
|
|
109
96
|
}
|
|
110
97
|
};
|
|
111
98
|
exports.LockService = LockService;
|
|
@@ -14,11 +14,11 @@ export declare const AccountDB: {
|
|
|
14
14
|
name: string;
|
|
15
15
|
account: {
|
|
16
16
|
model: typeof AccountModel;
|
|
17
|
-
schema: import("mongoose").Schema<AccountModel, import("mongoose").Model<AccountModel, any, any, any, Document<unknown, any, AccountModel, any> & AccountModel & Required<{
|
|
17
|
+
schema: import("mongoose").Schema<AccountModel, import("mongoose").Model<AccountModel, any, any, any, Document<unknown, any, AccountModel, any, {}> & AccountModel & Required<{
|
|
18
18
|
_id: unknown;
|
|
19
19
|
}> & {
|
|
20
20
|
__v: number;
|
|
21
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AccountModel, Document<unknown, {}, import("mongoose").FlatRecord<AccountModel>, {}
|
|
21
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AccountModel, Document<unknown, {}, import("mongoose").FlatRecord<AccountModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<AccountModel> & Required<{
|
|
22
22
|
_id: unknown;
|
|
23
23
|
}> & {
|
|
24
24
|
__v: number;
|
|
@@ -17,7 +17,7 @@ const transform = (0, functions_1.createSchemaTransformer)((doc) => {
|
|
|
17
17
|
const { _id, email, username, avatar } = doc;
|
|
18
18
|
const account = { id: _id.toString(), email: email, username: username };
|
|
19
19
|
if (avatar)
|
|
20
|
-
account.avatar = `https://file.svi-itlab.com/avatar/${_id}.webp`;
|
|
20
|
+
account.avatar = `https://file.svi-itlab.com/avatar/${_id.toString()}.webp`;
|
|
21
21
|
return account;
|
|
22
22
|
});
|
|
23
23
|
let AccountModel = class AccountModel extends mongoose_2.Document {
|
|
@@ -9,11 +9,11 @@ export declare const BooksDB: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
book: {
|
|
11
11
|
model: typeof BookModel;
|
|
12
|
-
schema: import("mongoose").Schema<BookModel, import("mongoose").Model<BookModel, any, any, any, Document<unknown, any, BookModel, any> & BookModel & Required<{
|
|
12
|
+
schema: import("mongoose").Schema<BookModel, import("mongoose").Model<BookModel, any, any, any, Document<unknown, any, BookModel, any, {}> & BookModel & Required<{
|
|
13
13
|
_id: unknown;
|
|
14
14
|
}> & {
|
|
15
15
|
__v: number;
|
|
16
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BookModel, Document<unknown, {}, import("mongoose").FlatRecord<BookModel>, {}
|
|
16
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BookModel, Document<unknown, {}, import("mongoose").FlatRecord<BookModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<BookModel> & Required<{
|
|
17
17
|
_id: unknown;
|
|
18
18
|
}> & {
|
|
19
19
|
__v: number;
|
|
@@ -15,11 +15,11 @@ export declare const CommentsDB: {
|
|
|
15
15
|
name: string;
|
|
16
16
|
comment: {
|
|
17
17
|
model: typeof CommentModel;
|
|
18
|
-
schema: import("mongoose").Schema<CommentModel, import("mongoose").Model<CommentModel, any, any, any, Document<unknown, any, CommentModel, any> & CommentModel & Required<{
|
|
18
|
+
schema: import("mongoose").Schema<CommentModel, import("mongoose").Model<CommentModel, any, any, any, Document<unknown, any, CommentModel, any, {}> & CommentModel & Required<{
|
|
19
19
|
_id: unknown;
|
|
20
20
|
}> & {
|
|
21
21
|
__v: number;
|
|
22
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentModel, Document<unknown, {}, import("mongoose").FlatRecord<CommentModel>, {}
|
|
22
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CommentModel, Document<unknown, {}, import("mongoose").FlatRecord<CommentModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CommentModel> & Required<{
|
|
23
23
|
_id: unknown;
|
|
24
24
|
}> & {
|
|
25
25
|
__v: number;
|
|
@@ -10,11 +10,11 @@ export declare const ContentDB: {
|
|
|
10
10
|
name: string;
|
|
11
11
|
content: {
|
|
12
12
|
model: typeof ContentModel;
|
|
13
|
-
schema: import("mongoose").Schema<ContentModel, import("mongoose").Model<ContentModel, any, any, any, Document<unknown, any, ContentModel, any> & ContentModel & Required<{
|
|
13
|
+
schema: import("mongoose").Schema<ContentModel, import("mongoose").Model<ContentModel, any, any, any, Document<unknown, any, ContentModel, any, {}> & ContentModel & Required<{
|
|
14
14
|
_id: unknown;
|
|
15
15
|
}> & {
|
|
16
16
|
__v: number;
|
|
17
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ContentModel, Document<unknown, {}, import("mongoose").FlatRecord<ContentModel>, {}
|
|
17
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ContentModel, Document<unknown, {}, import("mongoose").FlatRecord<ContentModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ContentModel> & Required<{
|
|
18
18
|
_id: unknown;
|
|
19
19
|
}> & {
|
|
20
20
|
__v: number;
|
|
@@ -9,11 +9,11 @@ export declare const DemoHiveDB: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
demo: {
|
|
11
11
|
model: typeof DemoModel;
|
|
12
|
-
schema: import("mongoose").Schema<DemoModel, import("mongoose").Model<DemoModel, any, any, any, Document<unknown, any, DemoModel, any> & DemoModel & Required<{
|
|
12
|
+
schema: import("mongoose").Schema<DemoModel, import("mongoose").Model<DemoModel, any, any, any, Document<unknown, any, DemoModel, any, {}> & DemoModel & Required<{
|
|
13
13
|
_id: unknown;
|
|
14
14
|
}> & {
|
|
15
15
|
__v: number;
|
|
16
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DemoModel, Document<unknown, {}, import("mongoose").FlatRecord<DemoModel>, {}
|
|
16
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DemoModel, Document<unknown, {}, import("mongoose").FlatRecord<DemoModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<DemoModel> & Required<{
|
|
17
17
|
_id: unknown;
|
|
18
18
|
}> & {
|
|
19
19
|
__v: number;
|
|
@@ -10,11 +10,11 @@ export declare const EventsDB: {
|
|
|
10
10
|
name: string;
|
|
11
11
|
event: {
|
|
12
12
|
model: typeof EventModel;
|
|
13
|
-
schema: import("mongoose").Schema<EventModel, import("mongoose").Model<EventModel, any, any, any, Document<unknown, any, EventModel, any> & EventModel & Required<{
|
|
13
|
+
schema: import("mongoose").Schema<EventModel, import("mongoose").Model<EventModel, any, any, any, Document<unknown, any, EventModel, any, {}> & EventModel & Required<{
|
|
14
14
|
_id: unknown;
|
|
15
15
|
}> & {
|
|
16
16
|
__v: number;
|
|
17
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventModel, Document<unknown, {}, import("mongoose").FlatRecord<EventModel>, {}
|
|
17
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventModel, Document<unknown, {}, import("mongoose").FlatRecord<EventModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EventModel> & Required<{
|
|
18
18
|
_id: unknown;
|
|
19
19
|
}> & {
|
|
20
20
|
__v: number;
|
|
@@ -22,11 +22,11 @@ export declare const HackschoolDB: {
|
|
|
22
22
|
name: string;
|
|
23
23
|
course: {
|
|
24
24
|
model: typeof CourseModel;
|
|
25
|
-
schema: import("mongoose").Schema<CourseModel, import("mongoose").Model<CourseModel, any, any, any, Document<unknown, any, CourseModel, any> & CourseModel & Required<{
|
|
25
|
+
schema: import("mongoose").Schema<CourseModel, import("mongoose").Model<CourseModel, any, any, any, Document<unknown, any, CourseModel, any, {}> & CourseModel & Required<{
|
|
26
26
|
_id: unknown;
|
|
27
27
|
}> & {
|
|
28
28
|
__v: number;
|
|
29
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CourseModel, Document<unknown, {}, import("mongoose").FlatRecord<CourseModel>, {}
|
|
29
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CourseModel, Document<unknown, {}, import("mongoose").FlatRecord<CourseModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CourseModel> & Required<{
|
|
30
30
|
_id: unknown;
|
|
31
31
|
}> & {
|
|
32
32
|
__v: number;
|
|
@@ -34,11 +34,11 @@ export declare const HackschoolDB: {
|
|
|
34
34
|
};
|
|
35
35
|
doc: {
|
|
36
36
|
model: typeof DocModel;
|
|
37
|
-
schema: import("mongoose").Schema<DocModel, import("mongoose").Model<DocModel, any, any, any, Document<unknown, any, DocModel, any> & DocModel & Required<{
|
|
37
|
+
schema: import("mongoose").Schema<DocModel, import("mongoose").Model<DocModel, any, any, any, Document<unknown, any, DocModel, any, {}> & DocModel & Required<{
|
|
38
38
|
_id: unknown;
|
|
39
39
|
}> & {
|
|
40
40
|
__v: number;
|
|
41
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DocModel, Document<unknown, {}, import("mongoose").FlatRecord<DocModel>, {}
|
|
41
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DocModel, Document<unknown, {}, import("mongoose").FlatRecord<DocModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<DocModel> & Required<{
|
|
42
42
|
_id: unknown;
|
|
43
43
|
}> & {
|
|
44
44
|
__v: number;
|
|
@@ -46,11 +46,11 @@ export declare const HackschoolDB: {
|
|
|
46
46
|
};
|
|
47
47
|
thread: {
|
|
48
48
|
model: typeof ThreadModel;
|
|
49
|
-
schema: import("mongoose").Schema<ThreadModel, import("mongoose").Model<ThreadModel, any, any, any, Document<unknown, any, ThreadModel, any> & ThreadModel & Required<{
|
|
49
|
+
schema: import("mongoose").Schema<ThreadModel, import("mongoose").Model<ThreadModel, any, any, any, Document<unknown, any, ThreadModel, any, {}> & ThreadModel & Required<{
|
|
50
50
|
_id: unknown;
|
|
51
51
|
}> & {
|
|
52
52
|
__v: number;
|
|
53
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ThreadModel, Document<unknown, {}, import("mongoose").FlatRecord<ThreadModel>, {}
|
|
53
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ThreadModel, Document<unknown, {}, import("mongoose").FlatRecord<ThreadModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ThreadModel> & Required<{
|
|
54
54
|
_id: unknown;
|
|
55
55
|
}> & {
|
|
56
56
|
__v: number;
|
|
@@ -11,11 +11,11 @@ export declare const NewsroomDB: {
|
|
|
11
11
|
name: string;
|
|
12
12
|
news: {
|
|
13
13
|
model: typeof NewsModel;
|
|
14
|
-
schema: import("mongoose").Schema<NewsModel, import("mongoose").Model<NewsModel, any, any, any, Document<unknown, any, NewsModel, any> & NewsModel & Required<{
|
|
14
|
+
schema: import("mongoose").Schema<NewsModel, import("mongoose").Model<NewsModel, any, any, any, Document<unknown, any, NewsModel, any, {}> & NewsModel & Required<{
|
|
15
15
|
_id: unknown;
|
|
16
16
|
}> & {
|
|
17
17
|
__v: number;
|
|
18
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, NewsModel, Document<unknown, {}, import("mongoose").FlatRecord<NewsModel>, {}
|
|
18
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, NewsModel, Document<unknown, {}, import("mongoose").FlatRecord<NewsModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<NewsModel> & Required<{
|
|
19
19
|
_id: unknown;
|
|
20
20
|
}> & {
|
|
21
21
|
__v: number;
|
|
@@ -9,11 +9,11 @@ export declare const PodcastsDB: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
podcast: {
|
|
11
11
|
model: typeof PodcastModel;
|
|
12
|
-
schema: import("mongoose").Schema<PodcastModel, import("mongoose").Model<PodcastModel, any, any, any, Document<unknown, any, PodcastModel, any> & PodcastModel & Required<{
|
|
12
|
+
schema: import("mongoose").Schema<PodcastModel, import("mongoose").Model<PodcastModel, any, any, any, Document<unknown, any, PodcastModel, any, {}> & PodcastModel & Required<{
|
|
13
13
|
_id: unknown;
|
|
14
14
|
}> & {
|
|
15
15
|
__v: number;
|
|
16
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, PodcastModel, Document<unknown, {}, import("mongoose").FlatRecord<PodcastModel>, {}
|
|
16
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, PodcastModel, Document<unknown, {}, import("mongoose").FlatRecord<PodcastModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<PodcastModel> & Required<{
|
|
17
17
|
_id: unknown;
|
|
18
18
|
}> & {
|
|
19
19
|
__v: number;
|
|
@@ -8,11 +8,11 @@ export declare const TeamDB: {
|
|
|
8
8
|
name: string;
|
|
9
9
|
member: {
|
|
10
10
|
model: typeof MemberModel;
|
|
11
|
-
schema: import("mongoose").Schema<MemberModel, import("mongoose").Model<MemberModel, any, any, any, Document<unknown, any, MemberModel, any> & MemberModel & Required<{
|
|
11
|
+
schema: import("mongoose").Schema<MemberModel, import("mongoose").Model<MemberModel, any, any, any, Document<unknown, any, MemberModel, any, {}> & MemberModel & Required<{
|
|
12
12
|
_id: unknown;
|
|
13
13
|
}> & {
|
|
14
14
|
__v: number;
|
|
15
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, MemberModel, Document<unknown, {}, import("mongoose").FlatRecord<MemberModel>, {}
|
|
15
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, MemberModel, Document<unknown, {}, import("mongoose").FlatRecord<MemberModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<MemberModel> & Required<{
|
|
16
16
|
_id: unknown;
|
|
17
17
|
}> & {
|
|
18
18
|
__v: number;
|
|
@@ -16,11 +16,11 @@ export declare const TechRadarDB: {
|
|
|
16
16
|
name: string;
|
|
17
17
|
blip: {
|
|
18
18
|
model: typeof BlipModel;
|
|
19
|
-
schema: import("mongoose").Schema<BlipModel, import("mongoose").Model<BlipModel, any, any, any, Document<unknown, any, BlipModel, any> & BlipModel & Required<{
|
|
19
|
+
schema: import("mongoose").Schema<BlipModel, import("mongoose").Model<BlipModel, any, any, any, Document<unknown, any, BlipModel, any, {}> & BlipModel & Required<{
|
|
20
20
|
_id: unknown;
|
|
21
21
|
}> & {
|
|
22
22
|
__v: number;
|
|
23
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BlipModel, Document<unknown, {}, import("mongoose").FlatRecord<BlipModel>, {}
|
|
23
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BlipModel, Document<unknown, {}, import("mongoose").FlatRecord<BlipModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<BlipModel> & Required<{
|
|
24
24
|
_id: unknown;
|
|
25
25
|
}> & {
|
|
26
26
|
__v: number;
|
|
@@ -28,11 +28,11 @@ export declare const TechRadarDB: {
|
|
|
28
28
|
};
|
|
29
29
|
edition: {
|
|
30
30
|
model: typeof EditionModel;
|
|
31
|
-
schema: import("mongoose").Schema<EditionModel, import("mongoose").Model<EditionModel, any, any, any, Document<unknown, any, EditionModel, any> & EditionModel & Required<{
|
|
31
|
+
schema: import("mongoose").Schema<EditionModel, import("mongoose").Model<EditionModel, any, any, any, Document<unknown, any, EditionModel, any, {}> & EditionModel & Required<{
|
|
32
32
|
_id: unknown;
|
|
33
33
|
}> & {
|
|
34
34
|
__v: number;
|
|
35
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EditionModel, Document<unknown, {}, import("mongoose").FlatRecord<EditionModel>, {}
|
|
35
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EditionModel, Document<unknown, {}, import("mongoose").FlatRecord<EditionModel>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EditionModel> & Required<{
|
|
36
36
|
_id: unknown;
|
|
37
37
|
}> & {
|
|
38
38
|
__v: number;
|