@myapihq/cli 1.0.58 → 1.0.59

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.
@@ -139,7 +139,7 @@ export async function whoami(flags = {}) {
139
139
  info(`Org: ${config.default_org ?? '(none)'}`);
140
140
  info(`Funnel: ${config.default_funnel ?? '(none)'}`);
141
141
  info(`Type: ${config.is_anonymous ? 'anonymous' : 'registered'}`);
142
- info(`Balance: ${balance ? `${balance.balance_display} | Credits: ${balance.credits_display}` : '(unavailable)'}`);
142
+ info(`Balance: ${balance ? `${balance.balance_display} | Credits: ${balance.credits_display} (not usable for domains)` : '(unavailable)'}`);
143
143
  }
144
144
  // myapi auth switch [index] — switch between saved accounts.
145
145
  export async function switchCmd(flags = {}, indexArg) {
@@ -21,7 +21,7 @@ export async function balance(flags) {
21
21
  const pm = result.has_payment_method ? 'yes' : 'no';
22
22
  const accountType = config.is_anonymous ? 'anonymous' : `registered (${config.email ?? ''})`;
23
23
  info(`Account: ${accountType}`);
24
- info(`Balance: ${result.balance_display} | Credits: ${result.credits_display} | Payment method: ${pm}`);
24
+ info(`Balance: ${result.balance_display} | Credits: ${result.credits_display} (not usable for domains) | Payment method: ${pm}`);
25
25
  }
26
26
  export async function history(flags) {
27
27
  if (flags.help) {
@@ -48,7 +48,7 @@ export async function history(flags) {
48
48
  }
49
49
  export async function topup(amountStr, flags) {
50
50
  if (flags.help) {
51
- info('Usage: myapi billing topup <amount>\n\nAmount is in whole dollars (e.g. "10" charges $10).\nUse --yes to skip confirmation.\nExample: myapi billing topup 10\n\nFlags:\n --yes Skip confirmation prompt');
51
+ info('Usage: myapi billing topup <amount>\n\nAmount is in whole dollars (e.g. "10" charges $10).\nConfirmation is required for amounts of $50 or more. Use --yes to skip it.\nExample: myapi billing topup 10\n\nFlags:\n --yes Skip confirmation prompt for large amounts');
52
52
  return;
53
53
  }
54
54
  const amount = Math.round(parseFloat(amountStr));
@@ -30,7 +30,8 @@ export async function register(domainArg, flags) {
30
30
  error("Missing required arguments.\nUsage: myapi domain register <domain> --org <id> [--years <num>]\n(Set defaults: myapi auth config set-org <id> / myapi auth config set-domain <domain>)");
31
31
  const years = parseInt(flags.years) || 1;
32
32
  const res = await sdkDomain.registerDomain(config.api_key, orgId, domain, years);
33
- success(`Registered ${domain}!\n${JSON.stringify(res, null, 2)}`);
33
+ success(`Registered ${domain}!`);
34
+ info(`Next: assign it to your org so your funnel goes live:\n myapi domain assign ${domain} --org ${orgId}`);
34
35
  }
35
36
  export async function importDomain(domainArg, flags) {
36
37
  const config = requireConfig();
@@ -63,11 +64,10 @@ export async function assign(domainArg, flags) {
63
64
  const config = requireConfig();
64
65
  const orgId = flags.org || config.default_org;
65
66
  const domain = domainArg || config.default_domain;
66
- const targetOrgId = flags.target;
67
- if (!orgId || !domain || !targetOrgId)
68
- error("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id> --target <target_org_id>\n(Set defaults: myapi auth config set-org <id> / myapi auth config set-domain <domain>)");
69
- await sdkDomain.assignDomain(config.api_key, orgId, domain, targetOrgId);
70
- success(`Assigned ${domain} to org ${targetOrgId}`);
67
+ if (!orgId || !domain)
68
+ error("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id>\n(Set defaults: myapi auth config set-org <id> / myapi auth config set-domain <domain>)");
69
+ await sdkDomain.assignDomain(config.api_key, orgId, domain);
70
+ success(`Assigned ${domain} to org ${orgId}`);
71
71
  }
72
72
  export async function unassign(domainArg, flags) {
73
73
  const config = requireConfig();
@@ -121,7 +121,7 @@ export async function updateSettings(domainArg, flags) {
121
121
  }
122
122
  export async function run(subcommand, args, flags) {
123
123
  if (!subcommand || (flags.help && !subcommand)) {
124
- info('Usage: myapi domain <subcommand>\n\nSubcommands:\n list List domains\n check Check domain availability\n register Register a domain\n import Import an existing domain\n assign Assign domain to org\n unassign Unassign domain from its current org\n status Get domain status\n settings Get domain settings\n update-settings Update domain settings\n\nTip: Set defaults with "myapi auth config set-org <id>" to skip --org on every command.');
124
+ info('Usage: myapi domain <subcommand>\n\nSubcommands:\n list List domains\n check Check domain availability\n register Register a domain\n import Import an existing domain\n assign Assign domain to an org\n unassign Unassign domain from its current org\n status Get domain status\n settings Get domain settings\n update-settings Update domain settings\n\nTip: Set defaults with "myapi auth config set-org <id>" to skip --org on every command.');
125
125
  return;
126
126
  }
127
127
  if (flags.help) {
@@ -134,7 +134,7 @@ export async function run(subcommand, args, flags) {
134
134
  else if (subcommand === 'import')
135
135
  info('Usage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>\n\nImports an existing domain from Namecheap.');
136
136
  else if (subcommand === 'assign')
137
- info('Usage: myapi domain assign <domain> --org <id> --target <target_org_id>\n\nAssigns a domain to a different organization.');
137
+ info('Usage: myapi domain assign <domain> --org <id>\n\nAssigns a domain to the specified organization.');
138
138
  else if (subcommand === 'unassign')
139
139
  info('Usage: myapi domain unassign <domain> --org <id>\n\nUnassigns a domain from its current organization.');
140
140
  else if (subcommand === 'status')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myapihq/cli",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "MyAPI command-line interface",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -146,7 +146,7 @@ export async function whoami(flags: Record<string, string | boolean> = {}) {
146
146
  info(`Org: ${config!.default_org ?? '(none)'}`);
147
147
  info(`Funnel: ${config!.default_funnel ?? '(none)'}`);
148
148
  info(`Type: ${config!.is_anonymous ? 'anonymous' : 'registered'}`);
149
- info(`Balance: ${balance ? `${balance.balance_display} | Credits: ${balance.credits_display}` : '(unavailable)'}`);
149
+ info(`Balance: ${balance ? `${balance.balance_display} | Credits: ${balance.credits_display} (not usable for domains)` : '(unavailable)'}`);
150
150
  }
151
151
 
152
152
  // myapi auth switch [index] — switch between saved accounts.
@@ -24,7 +24,7 @@ export async function balance(flags: Record<string, string | boolean>) {
24
24
  const pm = result.has_payment_method ? 'yes' : 'no';
25
25
  const accountType = config.is_anonymous ? 'anonymous' : `registered (${config.email ?? ''})`;
26
26
  info(`Account: ${accountType}`);
27
- info(`Balance: ${result.balance_display} | Credits: ${result.credits_display} | Payment method: ${pm}`);
27
+ info(`Balance: ${result.balance_display} | Credits: ${result.credits_display} (not usable for domains) | Payment method: ${pm}`);
28
28
  }
29
29
 
30
30
  export async function history(flags: Record<string, string | boolean>) {
@@ -57,7 +57,7 @@ export async function history(flags: Record<string, string | boolean>) {
57
57
 
58
58
  export async function topup(amountStr: string, flags: Record<string, string | boolean>) {
59
59
  if (flags.help) {
60
- info('Usage: myapi billing topup <amount>\n\nAmount is in whole dollars (e.g. "10" charges $10).\nUse --yes to skip confirmation.\nExample: myapi billing topup 10\n\nFlags:\n --yes Skip confirmation prompt');
60
+ info('Usage: myapi billing topup <amount>\n\nAmount is in whole dollars (e.g. "10" charges $10).\nConfirmation is required for amounts of $50 or more. Use --yes to skip it.\nExample: myapi billing topup 10\n\nFlags:\n --yes Skip confirmation prompt for large amounts');
61
61
  return;
62
62
  }
63
63
  const amount = Math.round(parseFloat(amountStr));
@@ -29,7 +29,8 @@ export async function register(domainArg: string, flags: Record<string, string |
29
29
  if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain register <domain> --org <id> [--years <num>]\n(Set defaults: myapi auth config set-org <id> / myapi auth config set-domain <domain>)");
30
30
  const years = parseInt(flags.years as string) || 1;
31
31
  const res = await sdkDomain.registerDomain(config.api_key, orgId, domain, years);
32
- success(`Registered ${domain}!\n${JSON.stringify(res, null, 2)}`);
32
+ success(`Registered ${domain}!`);
33
+ info(`Next: assign it to your org so your funnel goes live:\n myapi domain assign ${domain} --org ${orgId}`);
33
34
  }
34
35
 
35
36
  export async function importDomain(domainArg: string, flags: Record<string, string | boolean>) {
@@ -58,10 +59,9 @@ export async function assign(domainArg: string, flags: Record<string, string | b
58
59
  const config = requireConfig();
59
60
  const orgId = (flags.org as string) || config.default_org;
60
61
  const domain = domainArg || (config.default_domain as string);
61
- const targetOrgId = flags.target as string;
62
- if (!orgId || !domain || !targetOrgId) error("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id> --target <target_org_id>\n(Set defaults: myapi auth config set-org <id> / myapi auth config set-domain <domain>)");
63
- await sdkDomain.assignDomain(config.api_key, orgId, domain, targetOrgId);
64
- success(`Assigned ${domain} to org ${targetOrgId}`);
62
+ if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id>\n(Set defaults: myapi auth config set-org <id> / myapi auth config set-domain <domain>)");
63
+ await sdkDomain.assignDomain(config.api_key, orgId, domain);
64
+ success(`Assigned ${domain} to org ${orgId}`);
65
65
  }
66
66
 
67
67
  export async function unassign(domainArg: string, flags: Record<string, string | boolean>) {
@@ -113,7 +113,7 @@ export async function updateSettings(domainArg: string, flags: Record<string, st
113
113
 
114
114
  export async function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>) {
115
115
  if (!subcommand || (flags.help && !subcommand)) {
116
- info('Usage: myapi domain <subcommand>\n\nSubcommands:\n list List domains\n check Check domain availability\n register Register a domain\n import Import an existing domain\n assign Assign domain to org\n unassign Unassign domain from its current org\n status Get domain status\n settings Get domain settings\n update-settings Update domain settings\n\nTip: Set defaults with "myapi auth config set-org <id>" to skip --org on every command.');
116
+ info('Usage: myapi domain <subcommand>\n\nSubcommands:\n list List domains\n check Check domain availability\n register Register a domain\n import Import an existing domain\n assign Assign domain to an org\n unassign Unassign domain from its current org\n status Get domain status\n settings Get domain settings\n update-settings Update domain settings\n\nTip: Set defaults with "myapi auth config set-org <id>" to skip --org on every command.');
117
117
  return;
118
118
  }
119
119
 
@@ -122,7 +122,7 @@ export async function run(subcommand: string | undefined, args: string[], flags:
122
122
  else if (subcommand === 'check') info('Usage: myapi domain check <domain> --org <id> [--json]\n\nChecks if a domain name is available for registration.\n\nFlags:\n --json Output raw JSON');
123
123
  else if (subcommand === 'register') info('Usage: myapi domain register <domain> --org <id> [--years <num>]\n\nRegisters a new domain name.');
124
124
  else if (subcommand === 'import') info('Usage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>\n\nImports an existing domain from Namecheap.');
125
- else if (subcommand === 'assign') info('Usage: myapi domain assign <domain> --org <id> --target <target_org_id>\n\nAssigns a domain to a different organization.');
125
+ else if (subcommand === 'assign') info('Usage: myapi domain assign <domain> --org <id>\n\nAssigns a domain to the specified organization.');
126
126
  else if (subcommand === 'unassign') info('Usage: myapi domain unassign <domain> --org <id>\n\nUnassigns a domain from its current organization.');
127
127
  else if (subcommand === 'status') info('Usage: myapi domain status <domain> --org <id> [--json]\n\nGets the registration status of a domain.\n\nFlags:\n --json Output raw JSON');
128
128
  else if (subcommand === 'settings') info('Usage: myapi domain settings <domain> --org <id>\n\nGets the DNS settings and configuration for a domain.');