feat: add place gate population scripts, map style assets, automated cron sync tasks, and expand dashboard and landing applications
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Controller, Get, Post, Query, UseGuards, Res } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||
import { ApiTags, ApiOperation, ApiExcludeEndpoint } from '@nestjs/swagger';
|
||||
import type { Response } from 'express';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
@@ -28,6 +28,7 @@ export class MapsController {
|
||||
return this.fuelPricingService.updateMonthlyPrices();
|
||||
}
|
||||
|
||||
@ApiExcludeEndpoint()
|
||||
@Post('sync-routes')
|
||||
@ApiOperation({ summary: 'Request GraphHopper routing sync 🔄' })
|
||||
async syncRoutes() {
|
||||
@@ -124,6 +125,23 @@ export class MapsController {
|
||||
});
|
||||
}
|
||||
|
||||
// Sanitize internal / external provider URLs to protect internal infrastructure
|
||||
if (styleObj.glyphs && (styleObj.glyphs.includes('protomaps.com') || styleObj.glyphs.includes('cdn.'))) {
|
||||
styleObj.glyphs = 'https://map-saas.intaleqapp.com/fonts/{fontstack}/{range}.pbf';
|
||||
}
|
||||
if (styleObj.sprite && styleObj.sprite.includes('demotiles.maplibre.org')) {
|
||||
styleObj.sprite = 'https://map-saas.intaleqapp.com/sprites/osm-bright';
|
||||
}
|
||||
// Sanitize sources to Siro branded endpoints
|
||||
if (styleObj.sources) {
|
||||
Object.keys(styleObj.sources).forEach(sourceKey => {
|
||||
const s = styleObj.sources[sourceKey];
|
||||
if (s && s.url && (s.url.includes('protomaps.com') || s.url.includes('demotiles'))) {
|
||||
s.url = 'https://map-saas.intaleqapp.com/tiles/v1.json';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.send(styleObj);
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Controller, Get, Post, Patch, Delete, Body, Param, Query, UseGuards, HttpException, HttpStatus, Logger } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiQuery, ApiParam } from '@nestjs/swagger';
|
||||
import { ApiTags, ApiOperation, ApiQuery, ApiParam, ApiExcludeController } from '@nestjs/swagger';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository, DataSource } from 'typeorm';
|
||||
import { CandidateRoad } from './candidate-road.entity';
|
||||
@@ -7,6 +7,7 @@ import { RoadSegmentStat } from './road-stat.entity';
|
||||
import { ApiKeyGuard } from '../common/guards/api-key.guard';
|
||||
import { RedisService } from '../common/redis.service';
|
||||
|
||||
@ApiExcludeController()
|
||||
@ApiTags('map-refinement-roads')
|
||||
@Controller('map-refinement/roads')
|
||||
@UseGuards(ApiKeyGuard)
|
||||
|
||||
Reference in New Issue
Block a user