when-does-my-quota-refresh 1.0.1 → 1.2.0
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/accounts-FH6AKZT7.js +27 -0
- package/dist/{auth-K5ETZYGY.js → auth-GX4ZIG5O.js} +2 -2
- package/dist/auth-GX4ZIG5O.js.map +1 -0
- package/dist/chunk-H7BEO7IF.js +2 -0
- package/dist/chunk-H7BEO7IF.js.map +1 -0
- package/dist/{chunk-24ILGZJ2.js → chunk-VLP22VAR.js} +263 -175
- package/dist/chunk-VLP22VAR.js.map +1 -0
- package/dist/cli/index.js +219 -29
- package/dist/cli/index.js.map +1 -1
- package/dist/sdk/index.d.ts +16 -5
- package/dist/sdk/index.js +409 -182
- package/dist/sdk/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-24ILGZJ2.js.map +0 -1
- /package/dist/{auth-K5ETZYGY.js.map → accounts-FH6AKZT7.js.map} +0 -0
package/dist/sdk/index.d.ts
CHANGED
|
@@ -56,13 +56,19 @@ interface DataSourceAdapter {
|
|
|
56
56
|
isAvailable(): Promise<boolean>;
|
|
57
57
|
fetchQuota(): Promise<QuotaSnapshot>;
|
|
58
58
|
}
|
|
59
|
+
interface PluginContext {
|
|
60
|
+
/** Emit a desktop notification */
|
|
61
|
+
notify(title: string, message: string): void;
|
|
62
|
+
/** Log a message */
|
|
63
|
+
log(message: string): void;
|
|
64
|
+
}
|
|
59
65
|
interface Plugin {
|
|
60
66
|
name: string;
|
|
61
67
|
version: string;
|
|
62
|
-
onQuotaUpdate?: (snapshot: QuotaSnapshot) => Promise<void>;
|
|
63
|
-
onQuotaLow?: (group: string, bucket: string, remaining: number) => Promise<void>;
|
|
64
|
-
onReset?: (group: string, nextReset: Date) => Promise<void>;
|
|
65
|
-
onInit?: () => Promise<void>;
|
|
68
|
+
onQuotaUpdate?: (snapshot: QuotaSnapshot, ctx: PluginContext) => Promise<void>;
|
|
69
|
+
onQuotaLow?: (group: string, bucket: string, remaining: number, ctx: PluginContext) => Promise<void>;
|
|
70
|
+
onReset?: (group: string, nextReset: Date, ctx: PluginContext) => Promise<void>;
|
|
71
|
+
onInit?: (ctx: PluginContext) => Promise<void>;
|
|
66
72
|
onDestroy?: () => Promise<void>;
|
|
67
73
|
}
|
|
68
74
|
interface UsageRecord {
|
|
@@ -79,8 +85,12 @@ interface AppConfig {
|
|
|
79
85
|
refreshIntervalMs: number;
|
|
80
86
|
wakeupModels: string[];
|
|
81
87
|
wakeupAccounts: string[];
|
|
88
|
+
wakeupMode: 'smart' | 'interval' | 'daily';
|
|
89
|
+
wakeupIntervalHours: number;
|
|
90
|
+
wakeupDailyTimes: string;
|
|
82
91
|
notifications: boolean;
|
|
83
92
|
plugins: string[];
|
|
93
|
+
webhookUrl?: string;
|
|
84
94
|
daemon: {
|
|
85
95
|
pollIntervalMs: number;
|
|
86
96
|
enabled: boolean;
|
|
@@ -181,6 +191,7 @@ declare function closeStore(): void;
|
|
|
181
191
|
declare class QuotaClient {
|
|
182
192
|
private registry;
|
|
183
193
|
private cache;
|
|
194
|
+
private plugins;
|
|
184
195
|
private verbose;
|
|
185
196
|
constructor(options?: ClientOptions);
|
|
186
197
|
/**
|
|
@@ -347,4 +358,4 @@ declare class QuotaFetchError extends Error {
|
|
|
347
358
|
*/
|
|
348
359
|
declare function createClient(options?: ClientOptions): QuotaClient;
|
|
349
360
|
|
|
350
|
-
export { type AccountInfo, AuthError, type ClientOptions, type DataSource, type ModelQuotaInfo, type Plugin, type PromptCreditsInfo, type QuotaBucket, QuotaCache, QuotaClient, QuotaFetchError, type QuotaGroup, type QuotaSnapshot, SourceRegistry, SourceUnavailableError, type UsageRecord, cleanupHistory, closeStore, createClient, getAccountTokens, getActiveAccountTokens, getConfigDirPath, getDailySummary, getDataDirPath, getHistory, getLatestSnapshot, listAccounts, loadConfig, loginAccount, removeAccount, saveConfig, setActiveAccount, storeSnapshot };
|
|
361
|
+
export { type AccountInfo, AuthError, type ClientOptions, type DataSource, type ModelQuotaInfo, type Plugin, type PluginContext, type PromptCreditsInfo, type QuotaBucket, QuotaCache, QuotaClient, QuotaFetchError, type QuotaGroup, type QuotaSnapshot, SourceRegistry, SourceUnavailableError, type UsageRecord, cleanupHistory, closeStore, createClient, getAccountTokens, getActiveAccountTokens, getConfigDirPath, getDailySummary, getDataDirPath, getHistory, getLatestSnapshot, listAccounts, loadConfig, loginAccount, removeAccount, saveConfig, setActiveAccount, storeSnapshot };
|