Skip to content

Commit b053ae6

Browse files
committed
chore: reformat
1 parent 26cec8c commit b053ae6

File tree

9 files changed

+37
-47
lines changed

9 files changed

+37
-47
lines changed

Diff for: .eslintrc.cjs

-12
This file was deleted.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"lint-staged": "^15.2.10",
4242
"prettier": "^3.3.3",
4343
"rimraf": "^5.0.10",
44-
"typescript": "~5.1.6",
44+
"typescript": "~5.5.4",
4545
"typescript-eslint": "^8.4.0"
4646
},
4747
"packageManager": "[email protected]"

Diff for: src/api/auth.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function GenerateAuthorizeUrl(
66
clientId: string,
77
redirectUri: string,
88
scopes: string[],
9-
state: string | undefined
9+
state: string | undefined,
1010
): URL {
1111
const url = new URL(SpotifyAuthUrl + '/authorize')
1212
url.searchParams.append('client_id', clientId)
@@ -33,7 +33,7 @@ export interface RefreshAccessTokenResponse {
3333
export async function refreshAccessToken(
3434
clientId: string,
3535
clientSecret: string,
36-
refreshToken: string
36+
refreshToken: string,
3737
): Promise<Response<RefreshAccessTokenResponse>> {
3838
const authToken = Buffer.from(`${clientId}:${clientSecret}`).toString('base64')
3939
return doRequest<RefreshAccessTokenResponse>(
@@ -51,7 +51,7 @@ export async function refreshAccessToken(
5151
grant_type: 'refresh_token',
5252
refresh_token: refreshToken,
5353
},
54-
})
54+
}),
5555
)
5656
}
5757
export interface AuthorizationCodeGrantResponse {
@@ -65,7 +65,7 @@ export async function authorizationCodeGrant(
6565
clientId: string,
6666
clientSecret: string,
6767
redirectURI: string,
68-
authCode: string
68+
authCode: string,
6969
): Promise<Response<AuthorizationCodeGrantResponse>> {
7070
const authToken = Buffer.from(`${clientId}:${clientSecret}`).toString('base64')
7171
return doRequest<AuthorizationCodeGrantResponse>(
@@ -86,6 +86,6 @@ export async function authorizationCodeGrant(
8686
client_id: clientId,
8787
client_secret: clientSecret,
8888
},
89-
})
89+
}),
9090
)
9191
}

Diff for: src/api/device.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Response, doGetRequest, RequestOptionsBase, doPutRequest, QueryParameters, DeviceOptions } from './util.js'
22

33
export async function getMyDevices(
4-
reqOptions: RequestOptionsBase
4+
reqOptions: RequestOptionsBase,
55
): Promise<Response<SpotifyApi.UserDevicesResponse | undefined>> {
66
return doGetRequest(reqOptions, '/v1/me/player/devices')
77
}
88

99
export async function setVolume(
1010
reqOptions: RequestOptionsBase,
1111
volumePercent: number,
12-
options?: DeviceOptions
12+
options?: DeviceOptions,
1313
): Promise<Response<void>> {
1414
const params: QueryParameters = {
1515
volume_percent: volumePercent,

Diff for: src/api/playback.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from './util.js'
1111

1212
export async function getMyCurrentPlaybackState(
13-
reqOptions: RequestOptionsBase
13+
reqOptions: RequestOptionsBase,
1414
): Promise<Response<SpotifyApi.CurrentPlaybackResponse | undefined>> {
1515
return doGetRequest(reqOptions, '/v1/me/player')
1616
}
@@ -35,7 +35,7 @@ export interface TransferPlaybackOptions {
3535
export async function transferMyPlayback(
3636
reqOptions: RequestOptionsBase,
3737
deviceIds: ReadonlyArray<string>,
38-
options?: TransferPlaybackOptions
38+
options?: TransferPlaybackOptions,
3939
): Promise<Response<void>> {
4040
const body: BodyParameters = {
4141
...options,
@@ -77,7 +77,7 @@ export async function play(reqOptions: RequestOptionsBase, options?: PlayOptions
7777
export async function setRepeat(
7878
reqOptions: RequestOptionsBase,
7979
state: 'off' | 'track' | 'context',
80-
options?: DeviceOptions
80+
options?: DeviceOptions,
8181
): Promise<Response<void>> {
8282
const params: QueryParameters = {
8383
state,
@@ -90,7 +90,7 @@ export async function setRepeat(
9090
export async function setShuffle(
9191
reqOptions: RequestOptionsBase,
9292
state: boolean,
93-
options?: DeviceOptions
93+
options?: DeviceOptions,
9494
): Promise<Response<void>> {
9595
const params: QueryParameters = {
9696
state,
@@ -103,7 +103,7 @@ export async function setShuffle(
103103
export async function seek(
104104
reqOptions: RequestOptionsBase,
105105
positionMs: number,
106-
options?: DeviceOptions
106+
options?: DeviceOptions,
107107
): Promise<Response<void>> {
108108
const params: QueryParameters = {
109109
position_ms: positionMs,

Diff for: src/api/util.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function doGetRequest<T>(reqOptions: RequestOptionsBase, pathname:
1717
request: DefaultTimeout,
1818
},
1919
hooks: {},
20-
})
20+
}),
2121
)
2222
}
2323

@@ -28,7 +28,7 @@ export async function doPutRequest<T>(
2828
reqOptions: RequestOptionsBase,
2929
pathname: string,
3030
queryParams: QueryParameters,
31-
body: BodyParameters
31+
body: BodyParameters,
3232
): Promise<Response<T>> {
3333
return doRequest<T>(
3434
got.put<T>(SpotifyBaseUrl + pathname, {
@@ -43,14 +43,14 @@ export async function doPutRequest<T>(
4343
hooks: {},
4444
searchParams: queryParams,
4545
json: body,
46-
})
46+
}),
4747
)
4848
}
4949

5050
export async function doPostRequest<T>(
5151
reqOptions: RequestOptionsBase,
5252
pathname: string,
53-
queryParams: QueryParameters
53+
queryParams: QueryParameters,
5454
): Promise<Response<T>> {
5555
return doRequest<T>(
5656
got.post<T>(SpotifyBaseUrl + pathname, {
@@ -64,7 +64,7 @@ export async function doPostRequest<T>(
6464
},
6565
hooks: {},
6666
searchParams: queryParams,
67-
})
67+
}),
6868
)
6969
}
7070

@@ -80,12 +80,14 @@ export async function doRequest<T>(req: CancelableRequest<Response<T>>): Promise
8080
}
8181
} catch (e: unknown) {
8282
if (e instanceof HTTPError) {
83+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
8384
return Promise.reject({
8485
headers: e.response.headers,
8586
statusCode: e.response.statusCode,
8687
error: e,
8788
})
8889
} else {
90+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
8991
return Promise.reject({
9092
headers: {},
9193
statusCode: 500,

Diff for: src/helpers.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function ChangeVolume(
2020
deviceId: string,
2121
absolute: boolean,
2222
volumeOrDelta: number,
23-
attempt = 0
23+
attempt = 0,
2424
): Promise<void> {
2525
const reqOptions = instance.getRequestOptionsBase()
2626
if (!reqOptions) return
@@ -106,7 +106,7 @@ export async function ChangePlayState(
106106
instance: SpotifyInstanceBase,
107107
deviceId: string,
108108
action: 'play' | 'pause' | 'toggle',
109-
attempt = 0
109+
attempt = 0,
110110
): Promise<void> {
111111
const reqOptions = instance.getRequestOptionsBase()
112112
if (!reqOptions) return
@@ -133,7 +133,7 @@ export async function ChangeRepeatState(
133133
instance: SpotifyInstanceBase,
134134
deviceId: string,
135135
target: 'off' | 'track' | 'context',
136-
attempt = 0
136+
attempt = 0,
137137
): Promise<void> {
138138
const reqOptions = instance.getRequestOptionsBase()
139139
if (!reqOptions) return
@@ -158,7 +158,7 @@ export async function ChangeShuffleState(
158158
instance: SpotifyInstanceBase,
159159
deviceId: string,
160160
target: boolean | 'toggle',
161-
attempt = 0
161+
attempt = 0,
162162
): Promise<void> {
163163
const reqOptions = instance.getRequestOptionsBase()
164164
if (!reqOptions) return
@@ -185,7 +185,7 @@ export async function SeekPosition(
185185
instance: SpotifyInstanceBase,
186186
deviceId: string,
187187
positionMs: number,
188-
attempt = 0
188+
attempt = 0,
189189
): Promise<void> {
190190
const reqOptions = instance.getRequestOptionsBase()
191191
if (!reqOptions) return
@@ -207,7 +207,7 @@ export async function PlaySpecificList(
207207
deviceId: string,
208208
context_uri: string,
209209
behavior: 'return' | 'resume' | 'force',
210-
attempt = 0
210+
attempt = 0,
211211
): Promise<void> {
212212
const reqOptions = instance.getRequestOptionsBase()
213213
if (!reqOptions) return
@@ -244,7 +244,7 @@ export async function PlaySpecificTracks(
244244
deviceId: string,
245245
uris: string[],
246246
positionMs: number,
247-
attempt = 0
247+
attempt = 0,
248248
): Promise<void> {
249249
const reqOptions = instance.getRequestOptionsBase()
250250
if (!reqOptions) return

Diff for: src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class SpotifyInstance extends InstanceBase<DeviceConfig> implements SpotifyInsta
184184
this.config.clientId,
185185
this.config.redirectUri,
186186
AUTH_SCOPES,
187-
''
187+
'',
188188
).toString()
189189
this.saveConfig(this.config)
190190

Diff for: yarn.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -2968,7 +2968,7 @@ __metadata:
29682968
prettier: "npm:^3.3.3"
29692969
rimraf: "npm:^5.0.10"
29702970
type-fest: "npm:^4.26.1"
2971-
typescript: "npm:~5.1.6"
2971+
typescript: "npm:~5.5.4"
29722972
typescript-eslint: "npm:^8.4.0"
29732973
languageName: unknown
29742974
linkType: soft
@@ -3215,23 +3215,23 @@ __metadata:
32153215
languageName: node
32163216
linkType: hard
32173217

3218-
"typescript@npm:~5.1.6":
3219-
version: 5.1.6
3220-
resolution: "typescript@npm:5.1.6"
3218+
"typescript@npm:~5.5.4":
3219+
version: 5.5.4
3220+
resolution: "typescript@npm:5.5.4"
32213221
bin:
32223222
tsc: bin/tsc
32233223
tsserver: bin/tsserver
3224-
checksum: 10c0/45ac28e2df8365fd28dac42f5d62edfe69a7203d5ec646732cadc04065331f34f9078f81f150fde42ed9754eed6fa3b06a8f3523c40b821e557b727f1992e025
3224+
checksum: 10c0/422be60f89e661eab29ac488c974b6cc0a660fb2228003b297c3d10c32c90f3bcffc1009b43876a082515a3c376b1eefcce823d6e78982e6878408b9a923199c
32253225
languageName: node
32263226
linkType: hard
32273227

3228-
"typescript@patch:typescript@npm%3A~5.1.6#optional!builtin<compat/typescript>":
3229-
version: 5.1.6
3230-
resolution: "typescript@patch:typescript@npm%3A5.1.6#optional!builtin<compat/typescript>::version=5.1.6&hash=5da071"
3228+
"typescript@patch:typescript@npm%3A~5.5.4#optional!builtin<compat/typescript>":
3229+
version: 5.5.4
3230+
resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=379a07"
32313231
bin:
32323232
tsc: bin/tsc
32333233
tsserver: bin/tsserver
3234-
checksum: 10c0/c2bded58ab897a8341fdbb0c1d92ea2362f498cfffebdc8a529d03e15ea2454142dfbf122dabbd9a5cb79b7123790d27def16e11844887d20636226773ed329a
3234+
checksum: 10c0/73409d7b9196a5a1217b3aaad929bf76294d3ce7d6e9766dd880ece296ee91cf7d7db6b16c6c6c630ee5096eccde726c0ef17c7dfa52b01a243e57ae1f09ef07
32353235
languageName: node
32363236
linkType: hard
32373237

0 commit comments

Comments
 (0)