@prestyj/core 5.1.0 → 5.1.1
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.
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1744,6 +1744,17 @@ var AuthStorage = class {
|
|
|
1744
1744
|
async ensureLoaded() {
|
|
1745
1745
|
if (!this.loaded) await this.load();
|
|
1746
1746
|
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Force a re-read from disk, discarding the in-memory cache. Needed when
|
|
1749
|
+
* another process mutates the auth file out-of-band — e.g. the desktop app
|
|
1750
|
+
* writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
|
|
1751
|
+
* this instance, so a long-lived daemon's cache would otherwise stay stale and
|
|
1752
|
+
* never see a newly added provider key.
|
|
1753
|
+
*/
|
|
1754
|
+
async reload() {
|
|
1755
|
+
this.loaded = false;
|
|
1756
|
+
await this.load();
|
|
1757
|
+
}
|
|
1747
1758
|
async getCredentials(provider) {
|
|
1748
1759
|
await this.ensureLoaded();
|
|
1749
1760
|
return this.data[provider];
|