osai-agent 4.2.25 → 4.2.26
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/package.json +1 -1
- package/src/commands/admin.js +9 -4
package/package.json
CHANGED
package/src/commands/admin.js
CHANGED
|
@@ -82,12 +82,17 @@ export const enableUser = async ({ server, email }) => {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
export const generateProKeys = async ({ server, count, type }) => {
|
|
85
|
-
const spinner = ora('Generating Pro keys...').start();
|
|
85
|
+
const spinner = ora({ text: 'Generating Pro keys...', spinner: 'bouncingBar' }).start();
|
|
86
|
+
let done = false;
|
|
87
|
+
const coldStartWarn = setTimeout(() => {
|
|
88
|
+
if (!done) spinner.text = 'Server is waking up (HF Spaces cold start), please wait...';
|
|
89
|
+
}, 15000);
|
|
86
90
|
const data = await adminFetch(server, '/generate', 'POST', { type, count }, '/pro');
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
done = true;
|
|
92
|
+
clearTimeout(coldStartWarn);
|
|
93
|
+
spinner.succeed(`${data.count} Pro keys generated (${data.type}, ${data.duration_days} days)`);
|
|
89
94
|
for (const key of data.keys) {
|
|
90
|
-
console.log(`
|
|
95
|
+
console.log(` ${chalk.hex('#ff9e64')(key)}`);
|
|
91
96
|
}
|
|
92
97
|
console.log();
|
|
93
98
|
};
|