itlab-internal-services 2.0.2 → 2.1.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.
- package/dist/env.d.ts +5 -0
- package/dist/env.js +8 -0
- package/dist/guards/index.d.ts +0 -2
- package/dist/guards/index.js +0 -2
- package/dist/guards/perms.guard.js +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +1 -4
- package/dist/modules/authentication/authentication.module.d.ts +7 -0
- package/dist/modules/authentication/authentication.module.js +26 -0
- package/dist/modules/authentication/index.d.ts +3 -0
- package/dist/{services → modules/authentication}/index.js +5 -8
- package/dist/modules/authentication/internal/index.d.ts +3 -0
- package/dist/modules/authentication/internal/index.js +19 -0
- package/dist/modules/authentication/internal/internal.constants.d.ts +5 -0
- package/dist/modules/authentication/internal/internal.constants.js +8 -0
- package/dist/modules/authentication/internal/internal.decorators.d.ts +1 -0
- package/dist/modules/authentication/internal/internal.decorators.js +9 -0
- package/dist/modules/authentication/internal/internal.guard.d.ts +4 -0
- package/dist/modules/authentication/internal/internal.guard.js +18 -0
- package/dist/modules/authentication/internal/internal.strategy.d.ts +10 -0
- package/dist/modules/authentication/internal/internal.strategy.js +36 -0
- package/dist/modules/authentication/jwt/index.d.ts +3 -0
- package/dist/modules/authentication/jwt/index.js +19 -0
- package/dist/modules/authentication/jwt/jwt.constants.d.ts +8 -0
- package/dist/modules/authentication/jwt/jwt.constants.js +10 -0
- package/dist/modules/authentication/jwt/jwt.decorators.d.ts +5 -0
- package/dist/modules/authentication/jwt/jwt.decorators.js +21 -0
- package/dist/modules/authentication/jwt/jwt.guard.d.ts +9 -0
- package/dist/modules/authentication/jwt/jwt.guard.js +37 -0
- package/dist/modules/authentication/jwt/jwt.strategy.d.ts +9 -0
- package/dist/modules/authentication/jwt/jwt.strategy.js +35 -0
- package/dist/modules/database/database.module-options.d.ts +4 -0
- package/dist/modules/database/database.module.d.ts +6 -0
- package/dist/modules/database/database.module.js +69 -0
- package/dist/modules/database/index.d.ts +5 -0
- package/dist/modules/database/index.js +11 -0
- package/dist/{services → modules/database/model-service}/model.service.d.ts +25 -25
- package/dist/{services → modules/database/model-service}/model.service.js +11 -11
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-account.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-books.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-comments.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-content.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-demo-hive.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-events.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-hackschool.schemas.d.ts +3 -3
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-newsroom.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-podcasts.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-team.schemas.d.ts +1 -1
- package/dist/{model-schemas → modules/database/model-service/schemas}/hub-tech-radar.schemas.d.ts +2 -2
- package/dist/{services → modules/database/populate-service}/populate.service.d.ts +1 -1
- package/dist/{services → modules/database/populate-service}/populate.service.js +2 -2
- package/dist/{services → modules/database/service-mapper-service}/service-mapper.service.d.ts +1 -1
- package/dist/{services → modules/database/service-mapper-service}/service-mapper.service.js +1 -1
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +19 -0
- package/dist/{services → modules/services/account-service}/account.service.d.ts +3 -3
- package/dist/{services → modules/services/account-service}/account.service.js +10 -16
- package/dist/modules/services/comment-service/comment-service.definitions.d.ts +5 -0
- package/dist/modules/services/comment-service/comment-service.definitions.js +28 -0
- package/dist/{services → modules/services/comment-service}/comment.service.d.ts +6 -10
- package/dist/{services → modules/services/comment-service}/comment.service.js +15 -36
- package/dist/{services → modules/services/content-service}/content.service.d.ts +5 -5
- package/dist/{services → modules/services/content-service}/content.service.js +14 -19
- package/dist/modules/services/index.d.ts +9 -0
- package/dist/modules/services/index.js +22 -0
- package/dist/modules/services/mail-service/mail-service.definitions.d.ts +13 -0
- package/dist/modules/services/mail-service/mail-service.definitions.js +55 -0
- package/dist/modules/services/mail-service/mail.service.d.ts +11 -0
- package/dist/{services → modules/services/mail-service}/mail.service.js +19 -30
- package/dist/modules/services/search-service/search-service.definitions.d.ts +6 -0
- package/dist/modules/services/search-service/search-service.definitions.js +32 -0
- package/dist/modules/services/search-service/search.service.d.ts +11 -0
- package/dist/modules/services/search-service/search.service.js +46 -0
- package/dist/modules/services/services.module-utils.d.ts +7 -0
- package/dist/modules/services/services.module-utils.js +15 -0
- package/dist/modules/services/services.module.d.ts +7 -0
- package/dist/modules/services/services.module.js +30 -0
- package/dist/swagger.config.js +2 -2
- package/package.json +3 -3
- package/dist/guards/internal.guard.d.ts +0 -15
- package/dist/guards/internal.guard.js +0 -49
- package/dist/guards/jwt.guard.d.ts +0 -25
- package/dist/guards/jwt.guard.js +0 -74
- package/dist/itlab.interfaces.d.ts +0 -4
- package/dist/itlab.module-definition.d.ts +0 -4
- package/dist/itlab.module-definition.js +0 -10
- package/dist/itlab.module.d.ts +0 -3
- package/dist/itlab.module.js +0 -32
- package/dist/mongo.factory.d.ts +0 -6
- package/dist/mongo.factory.js +0 -34
- package/dist/services/index.d.ts +0 -8
- package/dist/services/mail.service.d.ts +0 -23
- package/dist/services/search.service.d.ts +0 -16
- package/dist/services/search.service.js +0 -71
- /package/dist/{itlab.interfaces.js → modules/database/database.module-options.js} +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-account.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-books.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-comments.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-content.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-demo-hive.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-events.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-hackschool.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-newsroom.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-podcasts.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-team.schemas.js +0 -0
- /package/dist/{model-schemas → modules/database/model-service/schemas}/hub-tech-radar.schemas.js +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ITLAB_MODULE_OPTIONS_TOKEN = exports.ITLabModuleConfig = void 0;
|
|
5
|
-
const common_1 = require("@nestjs/common");
|
|
6
|
-
_a = new common_1.ConfigurableModuleBuilder()
|
|
7
|
-
.setFactoryMethodName('createITLabOptions')
|
|
8
|
-
.setClassMethodName('forRoot')
|
|
9
|
-
.setExtras({ isGlobal: true }, (defintion, extras) => (Object.assign(Object.assign({}, defintion), { global: extras.isGlobal })))
|
|
10
|
-
.build(), exports.ITLabModuleConfig = _a.ConfigurableModuleClass, exports.ITLAB_MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
|
package/dist/itlab.module.d.ts
DELETED
package/dist/itlab.module.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ITLabModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const guards_1 = require("./guards");
|
|
12
|
-
const itlab_module_definition_1 = require("./itlab.module-definition");
|
|
13
|
-
const services_1 = require("./services");
|
|
14
|
-
const services = [
|
|
15
|
-
services_1.CommentService,
|
|
16
|
-
services_1.ContentService,
|
|
17
|
-
services_1.SearchService,
|
|
18
|
-
services_1.MailService,
|
|
19
|
-
services_1.AccountService,
|
|
20
|
-
services_1.ModelService,
|
|
21
|
-
services_1.PopulateService,
|
|
22
|
-
services_1.ServiceMapperService,
|
|
23
|
-
];
|
|
24
|
-
let ITLabModule = class ITLabModule extends itlab_module_definition_1.ITLabModuleConfig {
|
|
25
|
-
};
|
|
26
|
-
ITLabModule = __decorate([
|
|
27
|
-
(0, common_1.Module)({
|
|
28
|
-
providers: [...services, guards_1.JwtStrategy, guards_1.InternalStrategy],
|
|
29
|
-
exports: services,
|
|
30
|
-
})
|
|
31
|
-
], ITLabModule);
|
|
32
|
-
exports.ITLabModule = ITLabModule;
|
package/dist/mongo.factory.d.ts
DELETED
package/dist/mongo.factory.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useMongoFactory = void 0;
|
|
7
|
-
const config_1 = require("@nestjs/config");
|
|
8
|
-
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
|
-
const path_1 = require("path");
|
|
10
|
-
function useMongoFactory(options) {
|
|
11
|
-
return {
|
|
12
|
-
inject: [config_1.ConfigService],
|
|
13
|
-
useFactory: (configService) => {
|
|
14
|
-
mongoose_1.default.set('strictQuery', true);
|
|
15
|
-
const uri = configService.get('MONGO_SRV');
|
|
16
|
-
const username = configService.get('MONGO_USERNAME');
|
|
17
|
-
const password = configService.get('MONGO_PASSWORD');
|
|
18
|
-
return {
|
|
19
|
-
uri: `mongodb+srv://${uri}`,
|
|
20
|
-
auth: { username, password },
|
|
21
|
-
appName: options.appName,
|
|
22
|
-
dbName: options.dbName,
|
|
23
|
-
authMechanism: 'SCRAM-SHA-256',
|
|
24
|
-
authSource: 'admin',
|
|
25
|
-
replicaSet: 'organisation-hub-mongodb',
|
|
26
|
-
serverSelectionTimeoutMS: 2000,
|
|
27
|
-
tls: true,
|
|
28
|
-
tlsCAFile: (0, path_1.join)(process.cwd(), 'certificates', 'mongo-ca.crt'),
|
|
29
|
-
tlsCertificateKeyFile: (0, path_1.join)(process.cwd(), 'certificates', 'mongo-certificate-key.pem'),
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
exports.useMongoFactory = useMongoFactory;
|
package/dist/services/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './account.service';
|
|
2
|
-
export * from './comment.service';
|
|
3
|
-
export * from './content.service';
|
|
4
|
-
export * from './mail.service';
|
|
5
|
-
export * from './model.service';
|
|
6
|
-
export * from './populate.service';
|
|
7
|
-
export * from './search.service';
|
|
8
|
-
export * from './service-mapper.service';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ITLabModuleOptions } from '../itlab.interfaces';
|
|
2
|
-
export declare class SendWeeklyDagoBERTSummaryDto {
|
|
3
|
-
timespan: string;
|
|
4
|
-
total: string;
|
|
5
|
-
anomalies: string;
|
|
6
|
-
downtimes: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class SendDagoBERTDowntimeDto {
|
|
9
|
-
app: string;
|
|
10
|
-
namespace: string;
|
|
11
|
-
duration: string;
|
|
12
|
-
start: string;
|
|
13
|
-
end: string;
|
|
14
|
-
}
|
|
15
|
-
export declare class MailService {
|
|
16
|
-
private readonly options;
|
|
17
|
-
constructor(options: ITLabModuleOptions);
|
|
18
|
-
private axios;
|
|
19
|
-
private logger;
|
|
20
|
-
sendToken(token: string, address: string): void;
|
|
21
|
-
sendWeeklyDagoBERTSummary(dto: SendWeeklyDagoBERTSummaryDto, address: string): void;
|
|
22
|
-
sendDagoBERTDowntime(dto: SendDagoBERTDowntimeDto, address: string): void;
|
|
23
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ITLabModuleOptions } from '../itlab.interfaces';
|
|
2
|
-
import { Targets } from '../pipes/target.pipe';
|
|
3
|
-
export declare class SearchableDocument {
|
|
4
|
-
label: string;
|
|
5
|
-
url: string;
|
|
6
|
-
timestamp: number;
|
|
7
|
-
data: object;
|
|
8
|
-
}
|
|
9
|
-
export declare class SearchService {
|
|
10
|
-
private readonly options;
|
|
11
|
-
constructor(options: ITLabModuleOptions);
|
|
12
|
-
private axios;
|
|
13
|
-
private logger;
|
|
14
|
-
index(targetId: string, document: SearchableDocument, target: Targets): void;
|
|
15
|
-
remove(targetId: string, target: Targets): void;
|
|
16
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.SearchService = exports.SearchableDocument = void 0;
|
|
19
|
-
const common_1 = require("@nestjs/common");
|
|
20
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
21
|
-
const axios_1 = __importDefault(require("axios"));
|
|
22
|
-
const guards_1 = require("../guards");
|
|
23
|
-
const itlab_module_definition_1 = require("../itlab.module-definition");
|
|
24
|
-
class SearchableDocument {
|
|
25
|
-
}
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, swagger_1.ApiProperty)({ description: 'Anzeigename des Ergebnisses' }),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], SearchableDocument.prototype, "label", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, swagger_1.ApiProperty)({ description: 'Link zum Ergebnis' }),
|
|
32
|
-
__metadata("design:type", String)
|
|
33
|
-
], SearchableDocument.prototype, "url", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, swagger_1.ApiProperty)({ description: 'Ab wann wird das Ergebnis in der Suche angezeigt' }),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], SearchableDocument.prototype, "timestamp", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, swagger_1.ApiProperty)({ description: 'Zu speichernde Informationen' }),
|
|
40
|
-
__metadata("design:type", Object)
|
|
41
|
-
], SearchableDocument.prototype, "data", void 0);
|
|
42
|
-
exports.SearchableDocument = SearchableDocument;
|
|
43
|
-
let SearchService = class SearchService {
|
|
44
|
-
constructor(options) {
|
|
45
|
-
this.options = options;
|
|
46
|
-
this.axios = axios_1.default.create({
|
|
47
|
-
baseURL: 'https://services.svi-itlab.com/search/internal/',
|
|
48
|
-
headers: { [guards_1.INTERNAL_HEADER_KEY]: this.options.token },
|
|
49
|
-
});
|
|
50
|
-
this.logger = new common_1.Logger(SearchService.name);
|
|
51
|
-
}
|
|
52
|
-
index(targetId, document, target) {
|
|
53
|
-
this.logger.log(`Indexing ${target} (${targetId})`);
|
|
54
|
-
this.axios
|
|
55
|
-
.post(`${target}/${targetId}`, document)
|
|
56
|
-
.then(() => this.logger.log(`Sucessfully indexed ${target} (${targetId})`))
|
|
57
|
-
.catch(({ response }) => this.logger.error(`Couldn't index ${target} (${targetId})`, response.data));
|
|
58
|
-
}
|
|
59
|
-
remove(targetId, target) {
|
|
60
|
-
this.logger.log(`Removing ${target} (${targetId})`);
|
|
61
|
-
this.axios
|
|
62
|
-
.delete(`${target}/${targetId}`)
|
|
63
|
-
.then(() => this.logger.log(`Sucessfully removed ${target} (${targetId})`))
|
|
64
|
-
.catch(({ response }) => this.logger.error(`Couldn't remove ${target} (${targetId})`, response.data));
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
SearchService = __decorate([
|
|
68
|
-
__param(0, (0, common_1.Inject)(itlab_module_definition_1.ITLAB_MODULE_OPTIONS_TOKEN)),
|
|
69
|
-
__metadata("design:paramtypes", [Object])
|
|
70
|
-
], SearchService);
|
|
71
|
-
exports.SearchService = SearchService;
|
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-account.schemas.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-comments.schemas.js
RENAMED
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-content.schemas.js
RENAMED
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-demo-hive.schemas.js
RENAMED
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-events.schemas.js
RENAMED
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-hackschool.schemas.js
RENAMED
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-newsroom.schemas.js
RENAMED
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-podcasts.schemas.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/{model-schemas → modules/database/model-service/schemas}/hub-tech-radar.schemas.js
RENAMED
|
File without changes
|