@@ -14,6 +14,7 @@ import { RunnerGroup } from '../models/entities/RunnerGroup';
 | 
			
		||||
import { RunnerOrganization } from '../models/entities/RunnerOrganization';
 | 
			
		||||
import { ResponseSelfServiceOrganisation } from '../models/responses/ResponseSelfServiceOrganisation';
 | 
			
		||||
import { ResponseSelfServiceRunner } from '../models/responses/ResponseSelfServiceRunner';
 | 
			
		||||
import { ResponseSelfServiceScan } from '../models/responses/ResponseSelfServiceScan';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@JsonController()
 | 
			
		||||
@@ -38,6 +39,20 @@ export class RunnerSelfServiceController {
 | 
			
		||||
		return (new ResponseSelfServiceRunner(await this.getRunner(token)));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Get('/runners/me/:jwt/scans')
 | 
			
		||||
	@ResponseSchema(ResponseSelfServiceScan, { isArray: true })
 | 
			
		||||
	@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
 | 
			
		||||
	@OnUndefined(RunnerNotFoundError)
 | 
			
		||||
	@OpenAPI({ description: 'Lists all your (runner) scans. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please contact support.' })
 | 
			
		||||
	async getScans(@Param('jwt') token: string) {
 | 
			
		||||
		const scans = (await this.getRunner(token)).scans;
 | 
			
		||||
		let responseScans = new Array<ResponseSelfServiceScan>()
 | 
			
		||||
		for (let scan of scans) {
 | 
			
		||||
			responseScans.push(new ResponseSelfServiceScan(scan));
 | 
			
		||||
		}
 | 
			
		||||
		return responseScans;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Post('/runners/register')
 | 
			
		||||
	@ResponseSchema(ResponseSelfServiceRunner)
 | 
			
		||||
	@ResponseSchema(RunnerEmailNeededError, { statusCode: 406 })
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user