cody-music
Advanced tools
Comparing version 2.10.6 to 2.10.7
@@ -321,3 +321,3 @@ "use strict"; | ||
async refreshSpotifyToken(optionalRefreshToken = "") { | ||
if (!musicStore.spotifyRefreshToken) { | ||
if (!musicStore.spotifyClientSecret || !musicStore.spotifyRefreshToken) { | ||
return { | ||
@@ -327,3 +327,3 @@ status: "failed", | ||
data: "", | ||
message: "Missing Spotify Credentials", | ||
message: "Missing Spotify token refresh information", | ||
}; | ||
@@ -392,3 +392,2 @@ } | ||
spotifyClient.defaults.headers.common["Authorization"] = `Bearer ${musicStore.spotifyAccessToken}`; | ||
// console.log(`PUT ${api} - ${moment().format()}`); | ||
return spotifyClient | ||
@@ -395,0 +394,0 @@ .put(api, payload) |
@@ -27,3 +27,3 @@ "use strict"; | ||
describe("refreshSpotifyAccessToken()", () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -30,0 +30,0 @@ before(function () { |
@@ -39,3 +39,3 @@ "use strict"; | ||
before(async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -42,0 +42,0 @@ CodyMusic.setCredentials({ |
@@ -36,3 +36,3 @@ "use strict"; | ||
before(async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -39,0 +39,0 @@ CodyMusic.setCredentials({ |
@@ -37,3 +37,3 @@ "use strict"; | ||
before(() => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -40,0 +40,0 @@ CodyMusic.setCredentials({ |
@@ -36,3 +36,3 @@ "use strict"; | ||
it("Validate getting expired access token response", async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -49,3 +49,3 @@ CodyMusic.setCredentials({ | ||
it("Validate getting non-expired token response", async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -52,0 +52,0 @@ CodyMusic.setCredentials({ |
@@ -358,3 +358,3 @@ import axios, { AxiosInstance } from "axios"; | ||
async refreshSpotifyToken(optionalRefreshToken: string = "") { | ||
if (!musicStore.spotifyRefreshToken) { | ||
if (!musicStore.spotifyClientSecret || !musicStore.spotifyRefreshToken) { | ||
return { | ||
@@ -364,3 +364,3 @@ status: "failed", | ||
data: "", | ||
message: "Missing Spotify Credentials", | ||
message: "Missing Spotify token refresh information", | ||
}; | ||
@@ -454,3 +454,2 @@ } | ||
// console.log(`PUT ${api} - ${moment().format()}`); | ||
return spotifyClient | ||
@@ -457,0 +456,0 @@ .put(api, payload) |
{ | ||
"name": "cody-music", | ||
"version": "2.10.6", | ||
"version": "2.10.7", | ||
"description": "mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control", | ||
@@ -49,4 +49,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"axios": "^0.26.0", | ||
"dotenv": "^16.0.0", | ||
"axios": "^0.27.2", | ||
"dotenv": "^16.0.1", | ||
"moment-timezone": "^0.5.34", | ||
@@ -53,0 +53,0 @@ "open": "^8.4.0" |
@@ -8,3 +8,3 @@ const expect = require("chai").expect; | ||
describe("refreshSpotifyAccessToken()", () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -11,0 +11,0 @@ |
@@ -23,3 +23,3 @@ const expect = require("chai").expect; | ||
before(async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -26,0 +26,0 @@ CodyMusic.setCredentials({ |
@@ -17,3 +17,3 @@ const expect = require("chai").expect; | ||
before(async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -20,0 +20,0 @@ CodyMusic.setCredentials({ |
@@ -20,3 +20,3 @@ const expect = require("chai").expect; | ||
before(() => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -23,0 +23,0 @@ CodyMusic.setCredentials({ |
@@ -17,3 +17,3 @@ const expect = require("chai").expect; | ||
it("Validate getting expired access token response", async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -31,3 +31,3 @@ CodyMusic.setCredentials({ | ||
it("Validate getting non-expired token response", async () => { | ||
let configFile = __dirname + "/../config.json"; | ||
let configFile = __dirname + "/../../config.json"; | ||
let data = testUtil.getJsonFromFile(configFile); | ||
@@ -34,0 +34,0 @@ CodyMusic.setCredentials({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
479517
11451
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.27.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
- Removedaxios@0.26.1(transitive)
Updatedaxios@^0.27.2
Updateddotenv@^16.0.1