@fabraix/nyx 0.1.0 → 0.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/api/client.js +1 -1
- package/dist/api/client.js.map +1 -1
- package/dist/api/types.d.ts +7 -9
- package/dist/commands/login.js +47 -44
- package/dist/commands/login.js.map +1 -1
- package/dist/config/schema.d.ts +16 -16
- package/package.json +1 -1
package/dist/api/client.js
CHANGED
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAE/C,MAAM,UAAU,UAAU;IACxB,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,YAAY,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAc,EACd,IAAY,EACZ,IAAc;IAEd,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE;QACtC,MAAM,EAAE,kBAAkB;QAC1B,IAAI;KACL,CAAC,CAAC;IACH,OAAO,GAAG,CAAC,IAAI,EAAgB,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,IAAY,EACZ,MAAc;IAEd,OAAO,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED,KAAK,UAAU,OAAO,CACpB,MAAc,EACd,IAAY,EACZ,IAAwC;IAExC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,QAAQ,CAChB,sDAAsD,EACtD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AAG,CAAC,MAAM,KAAK,MAAM,EAAE,EAC5D,KAAK,EACL,GAAG,CAAC,MAAM,CACX,CAAC;AACJ,CAAC"}
|
package/dist/api/types.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
balance_usd: number;
|
|
9
|
-
};
|
|
1
|
+
export interface TokenValidationResponse {
|
|
2
|
+
userId: string;
|
|
3
|
+
email: string;
|
|
4
|
+
username: string;
|
|
5
|
+
beta: string;
|
|
6
|
+
skillCreated: boolean;
|
|
7
|
+
token: string;
|
|
10
8
|
}
|
|
11
9
|
export interface ProtocolEndpoint {
|
|
12
10
|
method: string;
|
package/dist/commands/login.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createServer } from "node:http";
|
|
2
2
|
import open from "open";
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
import { saveCredentials } from "../config/auth.js";
|
|
5
|
-
import {
|
|
4
|
+
import { getToken, saveCredentials } from "../config/auth.js";
|
|
5
|
+
import { getBaseUrl } from "../api/client.js";
|
|
6
6
|
import { NyxError, handleError } from "../utils/errors.js";
|
|
7
7
|
export function registerLogin(program) {
|
|
8
8
|
program
|
|
@@ -24,82 +24,85 @@ export function registerLogin(program) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
async function checkAuth() {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
console.log(` Plan: ${resp.account.plan}`);
|
|
31
|
-
console.log(` Balance: $${resp.account.balance_usd.toFixed(2)}\n`);
|
|
32
|
-
}
|
|
33
|
-
async function interactiveLogin() {
|
|
34
|
-
const { port, codePromise, server } = startCallbackServer();
|
|
35
|
-
const loginUrl = `https://app.fabraix.com/auth/cli?port=${port}`;
|
|
36
|
-
console.log(chalk.dim(`\n Opening browser to: ${loginUrl}`));
|
|
37
|
-
console.log(chalk.dim(" Waiting for authentication...\n"));
|
|
38
|
-
await open(loginUrl);
|
|
39
|
-
let code;
|
|
40
|
-
try {
|
|
41
|
-
code = await codePromise;
|
|
42
|
-
}
|
|
43
|
-
finally {
|
|
44
|
-
server.close();
|
|
27
|
+
const token = getToken();
|
|
28
|
+
if (!token) {
|
|
29
|
+
throw new NyxError("Not authenticated. Run `nyx login` or set NYX_TOKEN.", "auth");
|
|
45
30
|
}
|
|
46
31
|
const baseUrl = getBaseUrl();
|
|
47
32
|
let res;
|
|
48
33
|
try {
|
|
49
|
-
res = await fetch(`${baseUrl}/v1/
|
|
50
|
-
method: "
|
|
51
|
-
headers: { "
|
|
52
|
-
body: JSON.stringify({ code }),
|
|
34
|
+
res = await fetch(`${baseUrl}/v1/verify/token-validation`, {
|
|
35
|
+
method: "GET",
|
|
36
|
+
headers: { "X-Verification-Token": token },
|
|
53
37
|
});
|
|
54
38
|
}
|
|
55
39
|
catch {
|
|
56
40
|
throw new NyxError(`Network error: could not reach ${baseUrl}. Check your internet connection.`, "network");
|
|
57
41
|
}
|
|
58
42
|
if (!res.ok) {
|
|
59
|
-
throw new NyxError("
|
|
43
|
+
throw new NyxError("Authentication failed. Your token may have expired. Run `nyx login`.", "auth");
|
|
60
44
|
}
|
|
61
45
|
const data = (await res.json());
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
console.log(chalk.green("\n Authenticated"));
|
|
47
|
+
console.log(` Email: ${data.email}`);
|
|
48
|
+
console.log(` User: ${data.username}\n`);
|
|
49
|
+
}
|
|
50
|
+
async function interactiveLogin() {
|
|
51
|
+
const { port, tokenPromise, server } = startCallbackServer();
|
|
52
|
+
const loginUrl = `https://app.fabraix.com/auth/cli?port=${port}`;
|
|
53
|
+
console.log(chalk.dim(`\n Opening browser to: ${loginUrl}`));
|
|
54
|
+
console.log(chalk.dim(" Waiting for authentication...\n"));
|
|
55
|
+
await open(loginUrl);
|
|
56
|
+
let token;
|
|
57
|
+
let email;
|
|
58
|
+
try {
|
|
59
|
+
const result = await tokenPromise;
|
|
60
|
+
token = result.token;
|
|
61
|
+
email = result.email;
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
server.close();
|
|
64
65
|
}
|
|
65
66
|
saveCredentials({
|
|
66
|
-
token
|
|
67
|
-
email
|
|
68
|
-
expires_at: data.expires_at,
|
|
67
|
+
token,
|
|
68
|
+
email,
|
|
69
69
|
});
|
|
70
70
|
console.log(chalk.green(" Logged in successfully!"));
|
|
71
|
-
|
|
71
|
+
if (email) {
|
|
72
|
+
console.log(` Email: ${email}\n`);
|
|
73
|
+
}
|
|
72
74
|
}
|
|
73
75
|
function startCallbackServer() {
|
|
74
|
-
let
|
|
75
|
-
let
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
let resolveToken;
|
|
77
|
+
let rejectToken;
|
|
78
|
+
const tokenPromise = new Promise((resolve, reject) => {
|
|
79
|
+
resolveToken = resolve;
|
|
80
|
+
rejectToken = reject;
|
|
79
81
|
});
|
|
80
82
|
const server = createServer((req, res) => {
|
|
81
83
|
const url = new URL(req.url, `http://localhost`);
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
+
const token = url.searchParams.get("token");
|
|
85
|
+
const email = url.searchParams.get("email") ?? undefined;
|
|
86
|
+
if (token) {
|
|
84
87
|
res.writeHead(200, { "Content-Type": "text/html" });
|
|
85
88
|
res.end("<html><body><h2>Authenticated! You can close this tab.</h2></body></html>");
|
|
86
|
-
|
|
89
|
+
resolveToken({ token, email });
|
|
87
90
|
}
|
|
88
91
|
else {
|
|
89
92
|
res.writeHead(400, { "Content-Type": "text/plain" });
|
|
90
|
-
res.end("Missing
|
|
93
|
+
res.end("Missing token parameter");
|
|
91
94
|
}
|
|
92
95
|
});
|
|
93
96
|
server.on("error", (err) => {
|
|
94
|
-
|
|
97
|
+
rejectToken(new NyxError(`Failed to start login server: ${err.message}`, "network"));
|
|
95
98
|
});
|
|
96
99
|
server.listen(0);
|
|
97
100
|
const port = server.address().port;
|
|
98
101
|
const timeout = setTimeout(() => {
|
|
99
|
-
|
|
102
|
+
rejectToken(new NyxError("Login timed out. Please try again.", "auth"));
|
|
100
103
|
server.close();
|
|
101
104
|
}, 120_000);
|
|
102
|
-
|
|
103
|
-
return { port,
|
|
105
|
+
tokenPromise.finally(() => clearTimeout(timeout));
|
|
106
|
+
return { port, tokenPromise, server };
|
|
104
107
|
}
|
|
105
108
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,SAAS,EAAE,+BAA+B,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,IAAI,CAAC;YACH,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM,SAAS,EAAE,CAAC;YACpB,CA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schema.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ export declare const configSchema: z.ZodObject<{
|
|
|
10
10
|
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
11
|
response: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
method: "
|
|
13
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
14
14
|
path: string;
|
|
15
15
|
body?: Record<string, unknown> | undefined;
|
|
16
16
|
response?: Record<string, string> | undefined;
|
|
17
17
|
}, {
|
|
18
|
-
method: "
|
|
18
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
19
19
|
path: string;
|
|
20
20
|
body?: Record<string, unknown> | undefined;
|
|
21
21
|
response?: Record<string, string> | undefined;
|
|
@@ -26,38 +26,38 @@ export declare const configSchema: z.ZodObject<{
|
|
|
26
26
|
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
27
27
|
response: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
method: "
|
|
29
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
30
30
|
path: string;
|
|
31
31
|
body?: Record<string, unknown> | undefined;
|
|
32
32
|
response?: Record<string, string> | undefined;
|
|
33
33
|
}, {
|
|
34
|
-
method: "
|
|
34
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
35
35
|
path: string;
|
|
36
36
|
body?: Record<string, unknown> | undefined;
|
|
37
37
|
response?: Record<string, string> | undefined;
|
|
38
38
|
}>;
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
40
|
create_session: {
|
|
41
|
-
method: "
|
|
41
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
42
42
|
path: string;
|
|
43
43
|
body?: Record<string, unknown> | undefined;
|
|
44
44
|
response?: Record<string, string> | undefined;
|
|
45
45
|
};
|
|
46
46
|
send_message: {
|
|
47
|
-
method: "
|
|
47
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
48
48
|
path: string;
|
|
49
49
|
body?: Record<string, unknown> | undefined;
|
|
50
50
|
response?: Record<string, string> | undefined;
|
|
51
51
|
};
|
|
52
52
|
}, {
|
|
53
53
|
create_session: {
|
|
54
|
-
method: "
|
|
54
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
55
55
|
path: string;
|
|
56
56
|
body?: Record<string, unknown> | undefined;
|
|
57
57
|
response?: Record<string, string> | undefined;
|
|
58
58
|
};
|
|
59
59
|
send_message: {
|
|
60
|
-
method: "
|
|
60
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
61
61
|
path: string;
|
|
62
62
|
body?: Record<string, unknown> | undefined;
|
|
63
63
|
response?: Record<string, string> | undefined;
|
|
@@ -67,13 +67,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
67
67
|
base_url: string;
|
|
68
68
|
protocol: {
|
|
69
69
|
create_session: {
|
|
70
|
-
method: "
|
|
70
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
71
71
|
path: string;
|
|
72
72
|
body?: Record<string, unknown> | undefined;
|
|
73
73
|
response?: Record<string, string> | undefined;
|
|
74
74
|
};
|
|
75
75
|
send_message: {
|
|
76
|
-
method: "
|
|
76
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
77
77
|
path: string;
|
|
78
78
|
body?: Record<string, unknown> | undefined;
|
|
79
79
|
response?: Record<string, string> | undefined;
|
|
@@ -83,13 +83,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
83
83
|
base_url: string;
|
|
84
84
|
protocol: {
|
|
85
85
|
create_session: {
|
|
86
|
-
method: "
|
|
86
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
87
87
|
path: string;
|
|
88
88
|
body?: Record<string, unknown> | undefined;
|
|
89
89
|
response?: Record<string, string> | undefined;
|
|
90
90
|
};
|
|
91
91
|
send_message: {
|
|
92
|
-
method: "
|
|
92
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
93
93
|
path: string;
|
|
94
94
|
body?: Record<string, unknown> | undefined;
|
|
95
95
|
response?: Record<string, string> | undefined;
|
|
@@ -106,13 +106,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
106
106
|
base_url: string;
|
|
107
107
|
protocol: {
|
|
108
108
|
create_session: {
|
|
109
|
-
method: "
|
|
109
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
110
110
|
path: string;
|
|
111
111
|
body?: Record<string, unknown> | undefined;
|
|
112
112
|
response?: Record<string, string> | undefined;
|
|
113
113
|
};
|
|
114
114
|
send_message: {
|
|
115
|
-
method: "
|
|
115
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
116
116
|
path: string;
|
|
117
117
|
body?: Record<string, unknown> | undefined;
|
|
118
118
|
response?: Record<string, string> | undefined;
|
|
@@ -129,13 +129,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
129
129
|
base_url: string;
|
|
130
130
|
protocol: {
|
|
131
131
|
create_session: {
|
|
132
|
-
method: "
|
|
132
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
133
133
|
path: string;
|
|
134
134
|
body?: Record<string, unknown> | undefined;
|
|
135
135
|
response?: Record<string, string> | undefined;
|
|
136
136
|
};
|
|
137
137
|
send_message: {
|
|
138
|
-
method: "
|
|
138
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
139
139
|
path: string;
|
|
140
140
|
body?: Record<string, unknown> | undefined;
|
|
141
141
|
response?: Record<string, string> | undefined;
|