@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.d.cts CHANGED
@@ -98,6 +98,14 @@ declare class AuthStorage {
98
98
  isStaticApiKey(provider: string): Promise<boolean>;
99
99
  load(): Promise<void>;
100
100
  private ensureLoaded;
101
+ /**
102
+ * Force a re-read from disk, discarding the in-memory cache. Needed when
103
+ * another process mutates the auth file out-of-band — e.g. the desktop app
104
+ * writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
105
+ * this instance, so a long-lived daemon's cache would otherwise stay stale and
106
+ * never see a newly added provider key.
107
+ */
108
+ reload(): Promise<void>;
101
109
  getCredentials(provider: string): Promise<OAuthCredentials | undefined>;
102
110
  setCredentials(provider: string, creds: OAuthCredentials): Promise<void>;
103
111
  clearCredentials(provider: string): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -98,6 +98,14 @@ declare class AuthStorage {
98
98
  isStaticApiKey(provider: string): Promise<boolean>;
99
99
  load(): Promise<void>;
100
100
  private ensureLoaded;
101
+ /**
102
+ * Force a re-read from disk, discarding the in-memory cache. Needed when
103
+ * another process mutates the auth file out-of-band — e.g. the desktop app
104
+ * writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
105
+ * this instance, so a long-lived daemon's cache would otherwise stay stale and
106
+ * never see a newly added provider key.
107
+ */
108
+ reload(): Promise<void>;
101
109
  getCredentials(provider: string): Promise<OAuthCredentials | undefined>;
102
110
  setCredentials(provider: string, creds: OAuthCredentials): Promise<void>;
103
111
  clearCredentials(provider: string): Promise<void>;
package/dist/index.js CHANGED
@@ -1267,6 +1267,17 @@ var AuthStorage = class {
1267
1267
  async ensureLoaded() {
1268
1268
  if (!this.loaded) await this.load();
1269
1269
  }
1270
+ /**
1271
+ * Force a re-read from disk, discarding the in-memory cache. Needed when
1272
+ * another process mutates the auth file out-of-band — e.g. the desktop app
1273
+ * writes API keys natively (Rust → ~/.ezcoder/auth.json) without going through
1274
+ * this instance, so a long-lived daemon's cache would otherwise stay stale and
1275
+ * never see a newly added provider key.
1276
+ */
1277
+ async reload() {
1278
+ this.loaded = false;
1279
+ await this.load();
1280
+ }
1270
1281
  async getCredentials(provider) {
1271
1282
  await this.ensureLoaded();
1272
1283
  return this.data[provider];