@subreader/netflix-msl
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -6,2 +6,3 @@ /// <reference types="node" /> | ||
export declare class MSLClientFilesystemStore implements IMSLClientStore { | ||
path: string; | ||
masterToken: MasterToken; | ||
@@ -11,3 +12,4 @@ userIDToken: UserIDToken; | ||
hmacKey: Buffer; | ||
constructor({ masterToken, userIDToken, hmacKey, encryptionKey, }?: { | ||
constructor({ path, masterToken, userIDToken, hmacKey, encryptionKey, }?: { | ||
path?: string; | ||
masterToken?: MasterToken; | ||
@@ -14,0 +16,0 @@ userIDToken?: UserIDToken; |
@@ -7,6 +7,8 @@ "use strict"; | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = __importDefault(require("path")); | ||
const MasterToken_1 = require("./MasterToken"); | ||
const UserIDToken_1 = require("./UserIDToken"); | ||
class MSLClientFilesystemStore { | ||
constructor({ masterToken, userIDToken, hmacKey, encryptionKey, } = {}) { | ||
constructor({ path = ".", masterToken, userIDToken, hmacKey, encryptionKey, } = {}) { | ||
this.path = path; | ||
if (masterToken) { | ||
@@ -30,3 +32,3 @@ this.setMasterToken(masterToken); | ||
return fs_1.default.promises | ||
.readFile("MasterToken") | ||
.readFile(path_1.default.join(this.path, "MasterToken")) | ||
.then(data => { | ||
@@ -43,3 +45,3 @@ const masterToken = MasterToken_1.MasterToken.decode(data.toString()); | ||
this.masterToken = masterToken; | ||
await fs_1.default.promises.writeFile("MasterToken", masterToken.encode()); | ||
await fs_1.default.promises.writeFile(path_1.default.join(this.path, "MasterToken"), masterToken.encode()); | ||
} | ||
@@ -51,3 +53,3 @@ async getHMACKey() { | ||
return fs_1.default.promises | ||
.readFile("HMACKey") | ||
.readFile(path_1.default.join(this.path, "HMACKey")) | ||
.then(hmacKey => { | ||
@@ -63,3 +65,3 @@ this.hmacKey = hmacKey; | ||
this.hmacKey = hmacKey; | ||
await fs_1.default.promises.writeFile("HMACKey", hmacKey); | ||
await fs_1.default.promises.writeFile(path_1.default.join(this.path, "HMACKey"), hmacKey); | ||
} | ||
@@ -71,3 +73,3 @@ async getEncryptionKey() { | ||
return fs_1.default.promises | ||
.readFile("EncryptionKey") | ||
.readFile(path_1.default.join(this.path, "EncryptionKey")) | ||
.then(encryptionKey => { | ||
@@ -83,3 +85,3 @@ this.encryptionKey = encryptionKey; | ||
this.encryptionKey = encryptionKey; | ||
await fs_1.default.promises.writeFile("EncryptionKey", encryptionKey); | ||
await fs_1.default.promises.writeFile(path_1.default.join(this.path, "EncryptionKey"), encryptionKey); | ||
} | ||
@@ -91,3 +93,3 @@ async getUserIDToken() { | ||
return fs_1.default.promises | ||
.readFile("UserIDToken") | ||
.readFile(path_1.default.join(this.path, "UserIDToken")) | ||
.then(data => { | ||
@@ -104,3 +106,3 @@ const userIDToken = UserIDToken_1.UserIDToken.decode(data.toString()); | ||
this.userIDToken = userIDToken; | ||
await fs_1.default.promises.writeFile("UserIDToken", userIDToken.encode()); | ||
await fs_1.default.promises.writeFile(path_1.default.join(this.path, "UserIDToken"), userIDToken.encode()); | ||
} | ||
@@ -107,0 +109,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "Netflix MSL Client", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "ISC", | ||
@@ -8,0 +8,0 @@ "main": "lib/MSLClient.js", |
Sorry, the diff of this file is not supported yet
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
90910
1505