@unstoppabledomains/ud-cli 0.1.19 → 0.1.21

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.
@@ -0,0 +1,15 @@
1
+ interface SignupResponse {
2
+ signup_session_token: string;
3
+ expires_in: number;
4
+ }
5
+ interface SignupVerifyResponse {
6
+ access_token: string;
7
+ token_type: string;
8
+ expires_in: number;
9
+ refresh_token: string;
10
+ scope: string;
11
+ }
12
+ export declare function startSignup(email: string, password: string): Promise<SignupResponse>;
13
+ export declare function verifySignup(sessionToken: string, verificationCode: string): Promise<SignupVerifyResponse>;
14
+ export {};
15
+ //# sourceMappingURL=signup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signup.d.ts","sourceRoot":"","sources":["../../src/lib/signup.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,oBAAoB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAOD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,cAAc,CAAC,CAoBzB;AAED,wBAAsB,YAAY,CAChC,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAuB/B"}
@@ -0,0 +1,47 @@
1
+ import { apiBaseUrl } from './config.js';
2
+ export async function startSignup(email, password) {
3
+ const url = `${apiBaseUrl()}/api/oauth/signup`;
4
+ const res = await fetch(url, {
5
+ method: 'POST',
6
+ headers: { 'Content-Type': 'application/json' },
7
+ body: JSON.stringify({ email, password }),
8
+ });
9
+ if (!res.ok) {
10
+ const text = await res.text();
11
+ try {
12
+ const body = JSON.parse(text);
13
+ throw new Error(body.error_description ?? 'Signup failed');
14
+ }
15
+ catch (err) {
16
+ if (err instanceof SyntaxError)
17
+ throw new Error('Signup failed');
18
+ throw err;
19
+ }
20
+ }
21
+ return (await res.json());
22
+ }
23
+ export async function verifySignup(sessionToken, verificationCode) {
24
+ const url = `${apiBaseUrl()}/api/oauth/signup/verify`;
25
+ const res = await fetch(url, {
26
+ method: 'POST',
27
+ headers: { 'Content-Type': 'application/json' },
28
+ body: JSON.stringify({
29
+ signup_session_token: sessionToken,
30
+ verification_code: verificationCode,
31
+ }),
32
+ });
33
+ if (!res.ok) {
34
+ const text = await res.text();
35
+ try {
36
+ const body = JSON.parse(text);
37
+ throw new Error(body.error_description ?? 'Verification failed');
38
+ }
39
+ catch (err) {
40
+ if (err instanceof SyntaxError)
41
+ throw new Error('Verification failed');
42
+ throw err;
43
+ }
44
+ }
45
+ return (await res.json());
46
+ }
47
+ //# sourceMappingURL=signup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signup.js","sourceRoot":"","sources":["../../src/lib/signup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAoBzC,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAa,EACb,QAAgB;IAEhB,MAAM,GAAG,GAAG,GAAG,UAAU,EAAE,mBAAmB,CAAC;IAC/C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KAC1C,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,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I,EAAE,CAAyB,CAAC;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unstoppabledomains/ud-cli",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Unstoppable Domains CLI — Search, register, and manage your domains from the command line.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,11 +9,21 @@ allowed-tools: Bash(ud:*)
9
9
  ## Prerequisites
10
10
 
11
11
  ```bash
12
- ud auth login # OAuth (opens browser)
12
+ ud auth signup # Create account (no browser needed — recommended for agents)
13
+ ud auth login # OAuth sign-in (opens browser)
13
14
  ud auth login -k <key> # API key (ud_mcp_ + 64 hex chars)
14
15
  ud auth status # Check current auth
15
16
  ```
16
17
 
18
+ ### Account Creation (headless)
19
+
20
+ `ud auth signup` creates an account interactively:
21
+ 1. Prompts for email and password (min 8 chars, uppercase, lowercase, number, special character)
22
+ 2. Sends a 6-character verification code to the email
23
+ 3. Prompts for the code, then signs you in automatically
24
+
25
+ This is the fastest path to onboard — no browser or dashboard needed.
26
+
17
27
  ## Global Options
18
28
 
19
29
  ```