chore(deps): bump all (#294)

This commit is contained in:
Julian Tölle 2023-09-16 13:02:19 +02:00 committed by GitHub
parent 1979d924c9
commit 38cf2ff549
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 4681 additions and 3804 deletions

View file

@ -6,14 +6,14 @@ import {
import { HttpService } from "@nestjs/axios";
import { Injectable, Logger } from "@nestjs/common";
import { Counter, Histogram } from "@opentelemetry/api-metrics";
import type { AxiosRequestConfig } from "axios";
import type { InternalAxiosRequestConfig } from "axios";
import { MetricService } from "nestjs-otel";
import { UrlValueParserService } from "../../../open-telemetry/url-value-parser.service";
const SPOTIFY_API_METRICS_CONFIG_KEY = Symbol("kSpotifyApiMetricsInterceptor");
// Merging our custom properties with the base config
interface SpotifyApiMetricsConfig extends AxiosRequestConfig {
interface SpotifyApiMetricsConfig extends InternalAxiosRequestConfig {
[SPOTIFY_API_METRICS_CONFIG_KEY]: {
startTime: number;
};
@ -28,13 +28,13 @@ export class MetricsInterceptor extends AxiosInterceptor<SpotifyApiMetricsConfig
constructor(
httpService: HttpService,
metricService: MetricService,
private readonly urlValueParserService: UrlValueParserService
private readonly urlValueParserService: UrlValueParserService,
) {
super(httpService);
this.responseCounter = metricService.getCounter(
"listory_spotify_api_http_response",
{ description: "Total number of HTTP responses from Spotify API" }
{ description: "Total number of HTTP responses from Spotify API" },
);
this.requestHistogram = metricService.getHistogram(
@ -43,7 +43,7 @@ export class MetricsInterceptor extends AxiosInterceptor<SpotifyApiMetricsConfig
description:
"HTTP latency value recorder in seconds for requests made to Spotify API",
unit: "seconds",
}
},
);
}
@ -71,7 +71,7 @@ export class MetricsInterceptor extends AxiosInterceptor<SpotifyApiMetricsConfig
status: response.status.toString(),
path: this.urlValueParserService.replacePathValues(
response.config.url,
"<id>"
"<id>",
),
};

View file

@ -25,8 +25,8 @@ export class SpotifyApiService {
{
headers: { Authorization: `Bearer ${accessToken}` },
params: parameters,
}
)
},
),
);
return history.data.items;
@ -34,12 +34,12 @@ export class SpotifyApiService {
async getArtist(
accessToken: string,
spotifyID: string
spotifyID: string,
): Promise<ArtistObject> {
const artist = await firstValueFrom(
this.httpService.get<ArtistObject>(`v1/artists/${spotifyID}`, {
headers: { Authorization: `Bearer ${accessToken}` },
})
}),
);
return artist.data;
@ -47,7 +47,7 @@ export class SpotifyApiService {
async getArtists(
accessToken: string,
spotifyIDs: string[]
spotifyIDs: string[],
): Promise<ArtistObject[]> {
const artist = await firstValueFrom(
this.httpService.get<{ artists: ArtistObject[] }>(`v1/artists`, {
@ -55,7 +55,7 @@ export class SpotifyApiService {
params: {
ids: spotifyIDs.join(","),
},
})
}),
);
return artist.data.artists;
@ -65,14 +65,14 @@ export class SpotifyApiService {
const album = await firstValueFrom(
this.httpService.get<AlbumObject>(`v1/albums/${spotifyID}`, {
headers: { Authorization: `Bearer ${accessToken}` },
})
}),
);
return album.data;
}
async getAlbums(
accessToken: string,
spotifyIDs: string[]
spotifyIDs: string[],
): Promise<AlbumObject[]> {
const album = await firstValueFrom(
this.httpService.get<{ albums: AlbumObject[] }>(`v1/albums`, {
@ -80,7 +80,7 @@ export class SpotifyApiService {
params: {
ids: spotifyIDs.join(","),
},
})
}),
);
return album.data.albums;
}
@ -89,7 +89,7 @@ export class SpotifyApiService {
const track = await firstValueFrom(
this.httpService.get<TrackObject>(`v1/tracks/${spotifyID}`, {
headers: { Authorization: `Bearer ${accessToken}` },
})
}),
);
return track.data;
@ -97,7 +97,7 @@ export class SpotifyApiService {
async getTracks(
accessToken: string,
spotifyIDs: string[]
spotifyIDs: string[],
): Promise<TrackObject[]> {
const track = await firstValueFrom(
this.httpService.get<{ tracks: TrackObject[] }>(`v1/tracks`, {
@ -105,7 +105,7 @@ export class SpotifyApiService {
params: {
ids: spotifyIDs.join(","),
},
})
}),
);
return track.data.tracks;