vibekit-auth 1.0.0 → 1.0.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.js +6 -18
- package/package.json +1 -1
- package/src/index.ts +7 -19
package/dist/index.js
CHANGED
|
@@ -59,19 +59,19 @@ async function main() {
|
|
|
59
59
|
}
|
|
60
60
|
console.log();
|
|
61
61
|
// Step 2: Get Telegram ID
|
|
62
|
+
console.log(chalk_1.default.gray(' To find your Telegram ID, message @userinfobot on Telegram'));
|
|
63
|
+
console.log();
|
|
62
64
|
const response = await (0, prompts_1.default)([
|
|
63
65
|
{
|
|
64
66
|
type: 'text',
|
|
65
67
|
name: 'telegramId',
|
|
66
|
-
message: 'Enter your Telegram ID
|
|
67
|
-
hint: 'You can find your ID by messaging @userinfobot on Telegram',
|
|
68
|
+
message: 'Enter your numeric Telegram ID:',
|
|
68
69
|
validate: (value) => {
|
|
69
70
|
if (!value.trim()) {
|
|
70
71
|
return 'Telegram ID is required';
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return 'Enter a valid Telegram ID (number) or username (@username)';
|
|
73
|
+
if (isNaN(Number(value.trim()))) {
|
|
74
|
+
return 'Please enter your numeric ID (e.g., 123456789), not username';
|
|
75
75
|
}
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
@@ -81,19 +81,7 @@ async function main() {
|
|
|
81
81
|
console.log(chalk_1.default.yellow('\n Cancelled.'));
|
|
82
82
|
process.exit(0);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
// If they entered a username, we need to resolve it
|
|
86
|
-
// For now, require numeric ID
|
|
87
|
-
if (telegramId.startsWith('@') || isNaN(Number(telegramId))) {
|
|
88
|
-
console.log();
|
|
89
|
-
console.log(chalk_1.default.yellow(' Please enter your numeric Telegram ID, not username.'));
|
|
90
|
-
console.log(chalk_1.default.gray(' To find your ID:'));
|
|
91
|
-
console.log(chalk_1.default.gray(' 1. Open Telegram'));
|
|
92
|
-
console.log(chalk_1.default.gray(' 2. Message @userinfobot'));
|
|
93
|
-
console.log(chalk_1.default.gray(' 3. It will reply with your numeric ID'));
|
|
94
|
-
console.log();
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|
|
84
|
+
const telegramId = response.telegramId.trim();
|
|
97
85
|
const numericTelegramId = parseInt(telegramId, 10);
|
|
98
86
|
// Step 3: Upload to server
|
|
99
87
|
console.log();
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -67,19 +67,20 @@ async function main() {
|
|
|
67
67
|
console.log();
|
|
68
68
|
|
|
69
69
|
// Step 2: Get Telegram ID
|
|
70
|
+
console.log(chalk.gray(' To find your Telegram ID, message @userinfobot on Telegram'));
|
|
71
|
+
console.log();
|
|
72
|
+
|
|
70
73
|
const response = await prompts([
|
|
71
74
|
{
|
|
72
75
|
type: 'text',
|
|
73
76
|
name: 'telegramId',
|
|
74
|
-
message: 'Enter your Telegram ID
|
|
75
|
-
hint: 'You can find your ID by messaging @userinfobot on Telegram',
|
|
77
|
+
message: 'Enter your numeric Telegram ID:',
|
|
76
78
|
validate: (value: string) => {
|
|
77
79
|
if (!value.trim()) {
|
|
78
80
|
return 'Telegram ID is required';
|
|
79
81
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return 'Enter a valid Telegram ID (number) or username (@username)';
|
|
82
|
+
if (isNaN(Number(value.trim()))) {
|
|
83
|
+
return 'Please enter your numeric ID (e.g., 123456789), not username';
|
|
83
84
|
}
|
|
84
85
|
return true;
|
|
85
86
|
}
|
|
@@ -91,20 +92,7 @@ async function main() {
|
|
|
91
92
|
process.exit(0);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// If they entered a username, we need to resolve it
|
|
97
|
-
// For now, require numeric ID
|
|
98
|
-
if (telegramId.startsWith('@') || isNaN(Number(telegramId))) {
|
|
99
|
-
console.log();
|
|
100
|
-
console.log(chalk.yellow(' Please enter your numeric Telegram ID, not username.'));
|
|
101
|
-
console.log(chalk.gray(' To find your ID:'));
|
|
102
|
-
console.log(chalk.gray(' 1. Open Telegram'));
|
|
103
|
-
console.log(chalk.gray(' 2. Message @userinfobot'));
|
|
104
|
-
console.log(chalk.gray(' 3. It will reply with your numeric ID'));
|
|
105
|
-
console.log();
|
|
106
|
-
process.exit(1);
|
|
107
|
-
}
|
|
95
|
+
const telegramId = response.telegramId.trim();
|
|
108
96
|
|
|
109
97
|
const numericTelegramId = parseInt(telegramId, 10);
|
|
110
98
|
|