@sourceloop/ctrl-plane-tenant-management-service
Version:
Tenant Management microservice for SaaS control plane
52 lines • 2.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TenantMgmtConfigTenantController = void 0;
const tslib_1 = require("tslib");
const repository_1 = require("@loopback/repository");
const rest_1 = require("@loopback/rest");
const models_1 = require("../models");
const repositories_1 = require("../repositories");
const loopback4_authentication_1 = require("loopback4-authentication");
const loopback4_authorization_1 = require("loopback4-authorization");
const permissions_1 = require("../permissions");
const core_1 = require("@sourceloop/core");
const basePath = '/tenant-configs/{id}/tenant';
let TenantMgmtConfigTenantController = class TenantMgmtConfigTenantController {
constructor(tenantConfigRepository) {
this.tenantConfigRepository = tenantConfigRepository;
}
async getTenant(id) {
return this.tenantConfigRepository.tenant(id);
}
};
exports.TenantMgmtConfigTenantController = TenantMgmtConfigTenantController;
tslib_1.__decorate([
(0, loopback4_authorization_1.authorize)({
permissions: [permissions_1.PermissionKey.ViewTenantConfig],
}),
(0, loopback4_authentication_1.authenticate)("bearer" /* STRATEGY.BEARER */, {
passReqToCallback: true,
}),
(0, rest_1.get)(`${basePath}`, {
security: core_1.OPERATION_SECURITY_SPEC,
responses: {
[200 /* STATUS_CODE.OK */]: {
description: 'Tenant belonging to TenantConfig',
content: {
'application/json': {
schema: (0, rest_1.getModelSchemaRef)(models_1.Tenant),
},
},
},
},
}),
tslib_1.__param(0, rest_1.param.path.string('id')),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", [Object]),
tslib_1.__metadata("design:returntype", Promise)
], TenantMgmtConfigTenantController.prototype, "getTenant", null);
exports.TenantMgmtConfigTenantController = TenantMgmtConfigTenantController = tslib_1.__decorate([
tslib_1.__param(0, (0, repository_1.repository)(repositories_1.TenantMgmtConfigRepository)),
tslib_1.__metadata("design:paramtypes", [repositories_1.TenantMgmtConfigRepository])
], TenantMgmtConfigTenantController);
//# sourceMappingURL=tenant-mgmt-config-tenant.controller.js.map