@communecter/cocolight-api-client 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";exports.id=405,exports.ids=[405],exports.modules={405:(e,r,i)=>{i.d(r,{FileStorageStrategy:()=>c});var t=i(383),s=i(366),n=i(3),o=i(27);class c extends o.u3{constructor(e="tokens.json",r=n.join(s.homedir(),".config","cocolight")){super(),this.dir=r,this.filePath=n.join(r,e),this._ensureDirectoryExists()}_ensureDirectoryExists(){t.existsSync(this.dir)||t.mkdirSync(this.dir,{recursive:!0})}_readFile(){if(!t.existsSync(this.filePath))return{};try{return JSON.parse(t.readFileSync(this.filePath,"utf8"))}catch(e){return console.error("Error reading token file:",e),{}}}_writeFile(e){t.writeFileSync(this.filePath,JSON.stringify(e,null,2),"utf8")}getAccessToken(){return this._readFile().accessToken||null}setAccessToken(e){const r=this._readFile();r.accessToken=e,this._writeFile(r)}getRefreshToken(){return this._readFile().refreshToken||null}setRefreshToken(e){const r=this._readFile();r.refreshToken=e,this._writeFile(r)}clear(){this._writeFile({})}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";exports.id=931,exports.ids=[931],exports.modules={931:(e,s,t)=>{async function r(e){const{Readable:s}=await Promise.resolve().then(t.t.bind(t,272,19));return s.from(e)}async function o(){const{PassThrough:e}=await Promise.resolve().then(t.t.bind(t,272,19));return new e}t.d(s,{bufferToReadable:()=>r,createPassThrough:()=>o})}};
|