Skip to content

Commit

Permalink
refactor: Update import paths, function syntax, and type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
durandom committed Nov 7, 2024
1 parent e78e75d commit b9db877
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/scripts/fetchSession.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PaddockService } from '../services/PaddockService';
import { PaddockService } from '../services/PaddockService.js';

async function main() {
const main = async () => {
try {
const paddockService = new PaddockService('http://telemetry.b4mad.racing:30050/graphql');
const sessionDataArray = await paddockService.getSessionData('1730913437');
Expand All @@ -15,6 +15,6 @@ async function main() {
console.error('Error fetching sessions:', error);
process.exit(1);
}
}
};

main();
6 changes: 3 additions & 3 deletions src/scripts/fetchSessions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PaddockService } from '../services/PaddockService';
import { PaddockService } from '../services/PaddockService.js';

async function main() {
const main = async () => {
try {
const paddockService = new PaddockService('http://telemetry.b4mad.racing:30050/graphql');
const sessions = await paddockService.getSessions(undefined, 10);
Expand All @@ -23,6 +23,6 @@ async function main() {
console.error('Error fetching sessions:', error);
process.exit(1);
}
}
};

main();
9 changes: 7 additions & 2 deletions src/services/PaddockService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class PaddockService {
return data.allTelemetrySessions.nodes;
}

async getLandmarks(id: string): Promise<TrackLandmarks> {
async getLandmarks(id: number): Promise<TrackLandmarks> {
const { data } = await this.executeQuery(gql`
query GetLandmarks($id: BigInt!) {
allTelemetryLandmarks(
Expand Down Expand Up @@ -126,25 +126,30 @@ export class PaddockService {
time
valid
telemetryTrackByTrackId {
id
name
}
}
}
telemetryCarByCarId {
id
name
}
telemetryDriverByDriverId {
id
name
}
telemetryGameByGameId {
id
name
}
telemetrySessiontypeBySessionTypeId {
id
type
}
telemetryTrackByTrackId {
name
id
name
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,28 @@ export interface PaddockLap {
}

export interface PaddockCar {
id: number;
name: string;
}

export interface PaddockDriver {
id: number;
name: string;
}

export interface PaddockGame {
id: number;
name: string;
}

export interface PaddockSessionType {
id: number;
type: string;
}

export interface PaddockTrack {
id: number;
name: string;
id: string;
}

export interface PaddockSession {
Expand Down

0 comments on commit b9db877

Please sign in to comment.