2026-04-14-8 auth and commercial
This commit is contained in:
+12
-14
@@ -13,10 +13,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TelemetryController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const telemetry_service_1 = require("./telemetry.service");
|
||||
const telemetry_analyzer_service_1 = require("./telemetry-analyzer.service");
|
||||
const api_key_guard_1 = require("../common/guards/api-key.guard");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
let TelemetryController = class TelemetryController {
|
||||
telemetryService;
|
||||
analyzerService;
|
||||
@@ -39,20 +40,15 @@ let TelemetryController = class TelemetryController {
|
||||
roadDiscovery: discoveryResults,
|
||||
};
|
||||
}
|
||||
async processIntelligence(hours) {
|
||||
const syncResults = await this.analyzerService.syncExternalData();
|
||||
const roadResults = await this.analyzerService.analyzeRoadSpeeds(hours || 24);
|
||||
const discoveryResults = await this.analyzerService.discoverNewRoads(hours || 168);
|
||||
const summary = await this.analyzerService.getAnalysisSummary();
|
||||
async processIntelligence(hours, days) {
|
||||
const parsedDays = days ? parseInt(days, 10) : 1;
|
||||
const parsedHours = hours ? parseInt(hours, 10) : (parsedDays * 24);
|
||||
this.analyzerService.runDeepIntelligence(parsedHours);
|
||||
return {
|
||||
success: true,
|
||||
message: `Intelligence sync and analysis started for the last ${parsedDays} days. You will receive a summary on Telegram once complete! 🚀`,
|
||||
timestamp: new Date(),
|
||||
sync: syncResults,
|
||||
analysis: {
|
||||
roads: roadResults,
|
||||
discovery: discoveryResults,
|
||||
},
|
||||
currentStatus: summary,
|
||||
window: { days: parsedDays, hours: parsedHours },
|
||||
};
|
||||
}
|
||||
async getSummary() {
|
||||
@@ -90,8 +86,9 @@ __decorate([
|
||||
(0, common_1.Post)('process-intelligence'),
|
||||
(0, swagger_1.ApiOperation)({ summary: 'Automated One-Click Sync & Analyze 🚀' }),
|
||||
__param(0, (0, common_1.Query)('hours')),
|
||||
__param(1, (0, common_1.Query)('days')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Number]),
|
||||
__metadata("design:paramtypes", [String, String]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], TelemetryController.prototype, "processIntelligence", null);
|
||||
__decorate([
|
||||
@@ -114,6 +111,7 @@ __decorate([
|
||||
exports.TelemetryController = TelemetryController = __decorate([
|
||||
(0, swagger_1.ApiTags)('telemetry'),
|
||||
(0, common_1.Controller)('telemetry'),
|
||||
(0, common_1.UseGuards)(api_key_guard_1.ApiKeyGuard),
|
||||
__metadata("design:paramtypes", [telemetry_service_1.TelemetryService,
|
||||
telemetry_analyzer_service_1.TelemetryAnalyzerService])
|
||||
], TelemetryController);
|
||||
|
||||
Reference in New Issue
Block a user