@myapihq/cli 1.0.13 → 1.0.15
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/commands/config.d.ts +4 -0
- package/dist/commands/config.js +51 -0
- package/dist/commands/domain.d.ts +7 -7
- package/dist/commands/domain.js +38 -31
- package/dist/commands/email.js +23 -22
- package/dist/commands/funnel.d.ts +7 -0
- package/dist/commands/funnel.js +120 -8
- package/dist/commands/keys.js +5 -1
- package/dist/commands/org.js +4 -4
- package/dist/config.d.ts +2 -0
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/commands/config.ts +46 -0
- package/src/commands/domain.ts +33 -26
- package/src/commands/email.ts +20 -19
- package/src/commands/funnel.ts +99 -8
- package/src/commands/keys.ts +7 -2
- package/src/commands/org.ts +4 -4
- package/src/config.ts +2 -0
- package/src/index.ts +5 -5
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function setOrg(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
2
|
+
export declare function setDomain(domain: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
3
|
+
export declare function view(flags: Record<string, string | boolean>): Promise<void>;
|
|
4
|
+
export declare function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>): Promise<void>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setOrg = setOrg;
|
|
4
|
+
exports.setDomain = setDomain;
|
|
5
|
+
exports.view = view;
|
|
6
|
+
exports.run = run;
|
|
7
|
+
const config_js_1 = require("../config.js");
|
|
8
|
+
const output_js_1 = require("../output.js");
|
|
9
|
+
async function setOrg(id, flags) {
|
|
10
|
+
if (!id || flags.help) {
|
|
11
|
+
(0, output_js_1.info)("Usage: myapi config set-org <id>\n\nSets a default organization ID for subsequent commands.");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const config = (0, config_js_1.requireConfig)();
|
|
15
|
+
config.default_org = id;
|
|
16
|
+
(0, config_js_1.saveConfig)(config);
|
|
17
|
+
(0, output_js_1.success)(`Default organization set to: ${id}`);
|
|
18
|
+
}
|
|
19
|
+
async function setDomain(domain, flags) {
|
|
20
|
+
if (!domain || flags.help) {
|
|
21
|
+
(0, output_js_1.info)("Usage: myapi config set-domain <domain>\n\nSets a default domain for subsequent commands.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const config = (0, config_js_1.requireConfig)();
|
|
25
|
+
config.default_domain = domain;
|
|
26
|
+
(0, config_js_1.saveConfig)(config);
|
|
27
|
+
(0, output_js_1.success)(`Default domain set to: ${domain}`);
|
|
28
|
+
}
|
|
29
|
+
async function view(flags) {
|
|
30
|
+
if (flags.help) {
|
|
31
|
+
(0, output_js_1.info)("Usage: myapi config view\n\nViews current config settings.");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const config = (0, config_js_1.requireConfig)();
|
|
35
|
+
(0, output_js_1.info)(`Default Org: ${config.default_org || 'Not set'}`);
|
|
36
|
+
(0, output_js_1.info)(`Default Domain: ${config.default_domain || 'Not set'}`);
|
|
37
|
+
}
|
|
38
|
+
async function run(subcommand, args, flags) {
|
|
39
|
+
if (!subcommand || (flags.help && !subcommand)) {
|
|
40
|
+
(0, output_js_1.info)('Usage: myapi config <subcommand>\n\nSubcommands:\n view View current config\n set-org Set default organization\n set-domain Set default domain');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (subcommand === 'view')
|
|
44
|
+
await view(flags);
|
|
45
|
+
else if (subcommand === 'set-org')
|
|
46
|
+
await setOrg(args[0], flags);
|
|
47
|
+
else if (subcommand === 'set-domain')
|
|
48
|
+
await setDomain(args[0], flags);
|
|
49
|
+
else
|
|
50
|
+
(0, output_js_1.error)(`Unknown subcommand: ${subcommand}. Run "myapi config --help" for a list of valid subcommands.`);
|
|
51
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare function check(
|
|
2
|
-
export declare function register(
|
|
3
|
-
export declare function importDomain(
|
|
1
|
+
export declare function check(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
2
|
+
export declare function register(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
3
|
+
export declare function importDomain(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
4
4
|
export declare function list(flags: Record<string, string | boolean>): Promise<void>;
|
|
5
|
-
export declare function assign(
|
|
6
|
-
export declare function unassign(
|
|
7
|
-
export declare function settings(
|
|
8
|
-
export declare function updateSettings(
|
|
5
|
+
export declare function assign(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
6
|
+
export declare function unassign(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
7
|
+
export declare function settings(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
8
|
+
export declare function updateSettings(domainArg: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
9
9
|
export declare function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>): Promise<void>;
|
package/dist/commands/domain.js
CHANGED
|
@@ -12,11 +12,12 @@ exports.run = run;
|
|
|
12
12
|
const sdk_1 = require("@myapihq/sdk");
|
|
13
13
|
const config_js_1 = require("../config.js");
|
|
14
14
|
const output_js_1 = require("../output.js");
|
|
15
|
-
async function check(
|
|
16
|
-
const orgId = flags.org;
|
|
17
|
-
if (!orgId || !domain)
|
|
18
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain check <domain> --org <id>");
|
|
15
|
+
async function check(domainArg, flags) {
|
|
19
16
|
const config = (0, config_js_1.requireConfig)();
|
|
17
|
+
const orgId = flags.org || config.default_org;
|
|
18
|
+
const domain = domainArg || config.default_domain;
|
|
19
|
+
if (!orgId || !domain)
|
|
20
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain check <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
20
21
|
const res = await sdk_1.domain.checkDomain(config.api_key, orgId, domain);
|
|
21
22
|
if (res.available) {
|
|
22
23
|
(0, output_js_1.info)(`${domain} — Available ✓ Price: $${(res.price_cents / 100).toFixed(2)}/yr`);
|
|
@@ -25,23 +26,25 @@ async function check(domain, flags) {
|
|
|
25
26
|
(0, output_js_1.info)(`Not available ✗`);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
async function register(
|
|
29
|
-
const
|
|
29
|
+
async function register(domainArg, flags) {
|
|
30
|
+
const config = (0, config_js_1.requireConfig)();
|
|
31
|
+
const orgId = flags.org || config.default_org;
|
|
32
|
+
const domain = domainArg || config.default_domain;
|
|
30
33
|
if (!orgId || !domain)
|
|
31
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain register <domain> --org <id> [--years <num>]");
|
|
34
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain register <domain> --org <id> [--years <num>]\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
32
35
|
const years = parseInt(flags.years) || 1;
|
|
33
|
-
const config = (0, config_js_1.requireConfig)();
|
|
34
36
|
const res = await sdk_1.domain.registerDomain(config.api_key, orgId, domain, years);
|
|
35
37
|
(0, output_js_1.success)(`Registered ${domain}!\n${JSON.stringify(res, null, 2)}`);
|
|
36
38
|
}
|
|
37
|
-
async function importDomain(
|
|
38
|
-
const
|
|
39
|
+
async function importDomain(domainArg, flags) {
|
|
40
|
+
const config = (0, config_js_1.requireConfig)();
|
|
41
|
+
const orgId = flags.org || config.default_org;
|
|
42
|
+
const domain = domainArg || config.default_domain;
|
|
39
43
|
if (!orgId || !domain)
|
|
40
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>");
|
|
44
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
41
45
|
if (!flags['namecheap-user'] || !flags['namecheap-key']) {
|
|
42
46
|
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>");
|
|
43
47
|
}
|
|
44
|
-
const config = (0, config_js_1.requireConfig)();
|
|
45
48
|
await sdk_1.domain.importDomain(config.api_key, orgId, {
|
|
46
49
|
domain,
|
|
47
50
|
namecheap_api_user: flags['namecheap-user'],
|
|
@@ -50,44 +53,48 @@ async function importDomain(domain, flags) {
|
|
|
50
53
|
(0, output_js_1.success)(`Imported ${domain}`);
|
|
51
54
|
}
|
|
52
55
|
async function list(flags) {
|
|
53
|
-
const orgId = flags.org;
|
|
54
|
-
if (!orgId)
|
|
55
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain list --org <id> [--filter=all|unassigned|org]");
|
|
56
56
|
const config = (0, config_js_1.requireConfig)();
|
|
57
|
+
const orgId = flags.org || config.default_org;
|
|
58
|
+
if (!orgId)
|
|
59
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain list --org <id> [--filter=all|unassigned|org]\n(Or set a default org via: myapi config set-org <id>)");
|
|
57
60
|
const filter = flags.filter;
|
|
58
61
|
const domains = await sdk_1.domain.listDomains(config.api_key, orgId, filter);
|
|
59
62
|
(0, output_js_1.printTable)(domains);
|
|
60
63
|
}
|
|
61
|
-
async function assign(
|
|
62
|
-
const
|
|
64
|
+
async function assign(domainArg, flags) {
|
|
65
|
+
const config = (0, config_js_1.requireConfig)();
|
|
66
|
+
const orgId = flags.org || config.default_org;
|
|
67
|
+
const domain = domainArg || config.default_domain;
|
|
63
68
|
const targetOrgId = flags.target;
|
|
64
69
|
if (!orgId || !domain || !targetOrgId)
|
|
65
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id> --target <target_org_id>");
|
|
66
|
-
const config = (0, config_js_1.requireConfig)();
|
|
70
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id> --target <target_org_id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
67
71
|
const res = await sdk_1.domain.assignDomain(config.api_key, orgId, domain, targetOrgId);
|
|
68
72
|
(0, output_js_1.success)(`Assigned ${domain} to org ${targetOrgId}`);
|
|
69
73
|
}
|
|
70
|
-
async function unassign(
|
|
71
|
-
const orgId = flags.org;
|
|
72
|
-
if (!orgId || !domain)
|
|
73
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain unassign <domain> --org <id>");
|
|
74
|
+
async function unassign(domainArg, flags) {
|
|
74
75
|
const config = (0, config_js_1.requireConfig)();
|
|
76
|
+
const orgId = flags.org || config.default_org;
|
|
77
|
+
const domain = domainArg || config.default_domain;
|
|
78
|
+
if (!orgId || !domain)
|
|
79
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain unassign <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
75
80
|
const res = await sdk_1.domain.unassignDomain(config.api_key, orgId, domain);
|
|
76
81
|
(0, output_js_1.success)(`Unassigned ${domain} from org ${orgId}`);
|
|
77
82
|
}
|
|
78
|
-
async function settings(
|
|
79
|
-
const orgId = flags.org;
|
|
80
|
-
if (!orgId || !domain)
|
|
81
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain settings <domain> --org <id>");
|
|
83
|
+
async function settings(domainArg, flags) {
|
|
82
84
|
const config = (0, config_js_1.requireConfig)();
|
|
85
|
+
const orgId = flags.org || config.default_org;
|
|
86
|
+
const domain = domainArg || config.default_domain;
|
|
87
|
+
if (!orgId || !domain)
|
|
88
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain settings <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
83
89
|
const res = await sdk_1.domain.getDomainSettings(config.api_key, orgId, domain);
|
|
84
90
|
(0, output_js_1.printJson)(res);
|
|
85
91
|
}
|
|
86
|
-
async function updateSettings(
|
|
87
|
-
const orgId = flags.org;
|
|
88
|
-
if (!orgId || !domain)
|
|
89
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain update-settings <domain> --org <id> [--security=...] [--browser-check=...] [--purge-cache]");
|
|
92
|
+
async function updateSettings(domainArg, flags) {
|
|
90
93
|
const config = (0, config_js_1.requireConfig)();
|
|
94
|
+
const orgId = flags.org || config.default_org;
|
|
95
|
+
const domain = domainArg || config.default_domain;
|
|
96
|
+
if (!orgId || !domain)
|
|
97
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi domain update-settings <domain> --org <id> [--security=...] [--browser-check=...] [--purge-cache]\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
91
98
|
const payload = {};
|
|
92
99
|
if (flags.security)
|
|
93
100
|
payload.security_level = flags.security;
|
package/dist/commands/email.js
CHANGED
|
@@ -14,28 +14,29 @@ const config_js_1 = require("../config.js");
|
|
|
14
14
|
const output_js_1 = require("../output.js");
|
|
15
15
|
const utils_js_1 = require("../utils.js");
|
|
16
16
|
async function createMailbox(flags) {
|
|
17
|
-
const orgId = flags.org;
|
|
18
|
-
if (!orgId || !flags.domain || !flags.username) {
|
|
19
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email create-mailbox --org <id> --domain <domain> --username <user>");
|
|
20
|
-
}
|
|
21
17
|
const config = (0, config_js_1.requireConfig)();
|
|
22
|
-
const
|
|
18
|
+
const orgId = flags.org || config.default_org;
|
|
19
|
+
const domain = flags.domain || config.default_domain;
|
|
20
|
+
if (!orgId || !domain || !flags.username) {
|
|
21
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email create-mailbox --org <id> --domain <domain> --username <user>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
22
|
+
}
|
|
23
|
+
const address = await sdk_1.email.createMailbox(config.api_key, orgId, domain, flags.username);
|
|
23
24
|
(0, output_js_1.success)(`Mailbox created: ${address.address}`);
|
|
24
25
|
}
|
|
25
26
|
async function listMailboxes(flags) {
|
|
26
|
-
const orgId = flags.org;
|
|
27
|
-
if (!orgId)
|
|
28
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email list-mailboxes --org <id>");
|
|
29
27
|
const config = (0, config_js_1.requireConfig)();
|
|
28
|
+
const orgId = flags.org || config.default_org;
|
|
29
|
+
if (!orgId)
|
|
30
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email list-mailboxes --org <id>\n(Or set a default org via: myapi config set-org <id>)");
|
|
30
31
|
const mailboxes = await sdk_1.email.listMailboxes(config.api_key, orgId);
|
|
31
32
|
(0, output_js_1.printTable)(mailboxes);
|
|
32
33
|
}
|
|
33
34
|
async function send(flags) {
|
|
34
|
-
const
|
|
35
|
+
const config = (0, config_js_1.requireConfig)();
|
|
36
|
+
const orgId = flags.org || config.default_org;
|
|
35
37
|
if (!orgId || !flags.from || !flags.to || !flags.subject || !flags.body) {
|
|
36
38
|
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email send --org <id> --from <email> --to <email> --subject <str> --body <str>");
|
|
37
39
|
}
|
|
38
|
-
const config = (0, config_js_1.requireConfig)();
|
|
39
40
|
const res = await sdk_1.email.sendEmail(config.api_key, orgId, {
|
|
40
41
|
from: flags.from,
|
|
41
42
|
to: [flags.to],
|
|
@@ -45,27 +46,27 @@ async function send(flags) {
|
|
|
45
46
|
(0, output_js_1.success)(`Email sent! Message ID: ${res.message_id}`);
|
|
46
47
|
}
|
|
47
48
|
async function inbox(address, flags) {
|
|
48
|
-
const
|
|
49
|
+
const config = (0, config_js_1.requireConfig)();
|
|
50
|
+
const orgId = flags.org || config.default_org;
|
|
49
51
|
if (!orgId || !address)
|
|
50
52
|
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email inbox <address> --org <id>");
|
|
51
|
-
const config = (0, config_js_1.requireConfig)();
|
|
52
53
|
const messages = await sdk_1.email.getInbox(config.api_key, orgId, address);
|
|
53
54
|
(0, output_js_1.printTable)(messages);
|
|
54
55
|
}
|
|
55
56
|
async function listTemplates(flags) {
|
|
56
|
-
const orgId = flags.org;
|
|
57
|
-
if (!orgId)
|
|
58
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email list-templates --org <id>");
|
|
59
57
|
const config = (0, config_js_1.requireConfig)();
|
|
58
|
+
const orgId = flags.org || config.default_org;
|
|
59
|
+
if (!orgId)
|
|
60
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email list-templates --org <id>\n(Or set a default org via: myapi config set-org <id>)");
|
|
60
61
|
const templates = await sdk_1.email.listTemplates(config.api_key, orgId);
|
|
61
62
|
(0, output_js_1.printTable)(templates);
|
|
62
63
|
}
|
|
63
64
|
async function generateTemplate(flags) {
|
|
64
|
-
const
|
|
65
|
+
const config = (0, config_js_1.requireConfig)();
|
|
66
|
+
const orgId = flags.org || config.default_org;
|
|
65
67
|
if (!orgId || !flags.prompt || !flags.name) {
|
|
66
68
|
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email generate-template --org <id> --prompt <str> --name <str>");
|
|
67
69
|
}
|
|
68
|
-
const config = (0, config_js_1.requireConfig)();
|
|
69
70
|
const job = await sdk_1.email.generateTemplate(config.api_key, orgId, {
|
|
70
71
|
prompt: flags.prompt,
|
|
71
72
|
name: flags.name
|
|
@@ -93,18 +94,18 @@ async function generateTemplate(flags) {
|
|
|
93
94
|
(0, output_js_1.error)("Template generation timed out");
|
|
94
95
|
}
|
|
95
96
|
async function listCampaigns(flags) {
|
|
96
|
-
const orgId = flags.org;
|
|
97
|
-
if (!orgId)
|
|
98
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email list-campaigns --org <id>");
|
|
99
97
|
const config = (0, config_js_1.requireConfig)();
|
|
98
|
+
const orgId = flags.org || config.default_org;
|
|
99
|
+
if (!orgId)
|
|
100
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email list-campaigns --org <id>\n(Or set a default org via: myapi config set-org <id>)");
|
|
100
101
|
const campaigns = await sdk_1.email.listCampaigns(config.api_key, orgId);
|
|
101
102
|
(0, output_js_1.printTable)(campaigns);
|
|
102
103
|
}
|
|
103
104
|
async function campaignStats(id, flags) {
|
|
104
|
-
const
|
|
105
|
+
const config = (0, config_js_1.requireConfig)();
|
|
106
|
+
const orgId = flags.org || config.default_org;
|
|
105
107
|
if (!orgId || !id)
|
|
106
108
|
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi email campaign-stats <id> --org <id>");
|
|
107
|
-
const config = (0, config_js_1.requireConfig)();
|
|
108
109
|
const stats = await sdk_1.email.getCampaignStats(config.api_key, orgId, id);
|
|
109
110
|
(0, output_js_1.printJson)(stats);
|
|
110
111
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export declare function list(flags: Record<string, string | boolean>): Promise<void>;
|
|
2
2
|
export declare function create(flags: Record<string, string | boolean>): Promise<void>;
|
|
3
|
+
export declare function get(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
4
|
+
export declare function del(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
5
|
+
export declare function preview(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
6
|
+
export declare function publish(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
7
|
+
export declare function status(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
3
8
|
export declare function push(id: string, slug: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
9
|
+
export declare function verify(id: string, flags: Record<string, string | boolean>): Promise<void>;
|
|
10
|
+
export declare function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>): Promise<void>;
|
package/dist/commands/funnel.js
CHANGED
|
@@ -2,27 +2,81 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.list = list;
|
|
4
4
|
exports.create = create;
|
|
5
|
+
exports.get = get;
|
|
6
|
+
exports.del = del;
|
|
7
|
+
exports.preview = preview;
|
|
8
|
+
exports.publish = publish;
|
|
9
|
+
exports.status = status;
|
|
5
10
|
exports.push = push;
|
|
11
|
+
exports.verify = verify;
|
|
12
|
+
exports.run = run;
|
|
6
13
|
const sdk_1 = require("@myapihq/sdk");
|
|
7
14
|
const config_js_1 = require("../config.js");
|
|
8
15
|
const output_js_1 = require("../output.js");
|
|
9
16
|
async function list(flags) {
|
|
10
17
|
const config = (0, config_js_1.requireConfig)();
|
|
11
|
-
const
|
|
18
|
+
const orgId = flags.org || config.default_org;
|
|
19
|
+
if (!orgId)
|
|
20
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel list --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
21
|
+
const funnels = await sdk_1.funnel.listFunnels(config.api_key, orgId);
|
|
12
22
|
(0, output_js_1.printTable)(funnels);
|
|
13
23
|
}
|
|
14
24
|
async function create(flags) {
|
|
15
|
-
if (!flags['org-id'] || !flags.domain) {
|
|
16
|
-
(0, output_js_1.error)("Missing --org-id or --domain flags");
|
|
17
|
-
}
|
|
18
25
|
const config = (0, config_js_1.requireConfig)();
|
|
19
|
-
const
|
|
26
|
+
const orgId = flags.org || config.default_org;
|
|
27
|
+
const domain = flags.domain || config.default_domain;
|
|
28
|
+
if (!orgId || !domain) {
|
|
29
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel create --org <id> --domain <domain>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
30
|
+
}
|
|
31
|
+
const funnel = await sdk_1.funnel.createFunnel(config.api_key, orgId, domain);
|
|
20
32
|
(0, output_js_1.success)(`Funnel created! ID: ${funnel.id}`);
|
|
21
33
|
}
|
|
34
|
+
async function get(id, flags) {
|
|
35
|
+
const config = (0, config_js_1.requireConfig)();
|
|
36
|
+
const orgId = flags.org || config.default_org;
|
|
37
|
+
if (!orgId || !id)
|
|
38
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel get <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
39
|
+
const funnel = await sdk_1.funnel.getFunnel(config.api_key, orgId, id);
|
|
40
|
+
(0, output_js_1.printJson)(funnel);
|
|
41
|
+
}
|
|
42
|
+
async function del(id, flags) {
|
|
43
|
+
const config = (0, config_js_1.requireConfig)();
|
|
44
|
+
const orgId = flags.org || config.default_org;
|
|
45
|
+
if (!orgId || !id)
|
|
46
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel delete <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
47
|
+
await sdk_1.funnel.deleteFunnel(config.api_key, orgId, id);
|
|
48
|
+
(0, output_js_1.success)(`Funnel ${id} deleted`);
|
|
49
|
+
}
|
|
50
|
+
async function preview(id, flags) {
|
|
51
|
+
const config = (0, config_js_1.requireConfig)();
|
|
52
|
+
const orgId = flags.org || config.default_org;
|
|
53
|
+
if (!orgId || !id)
|
|
54
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel preview <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
55
|
+
const p = await sdk_1.funnel.previewFunnel(config.api_key, orgId, id);
|
|
56
|
+
(0, output_js_1.success)(`Preview deployed: ${p.preview_url}`);
|
|
57
|
+
}
|
|
58
|
+
async function publish(id, flags) {
|
|
59
|
+
const config = (0, config_js_1.requireConfig)();
|
|
60
|
+
const orgId = flags.org || config.default_org;
|
|
61
|
+
if (!orgId || !id)
|
|
62
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel publish <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
63
|
+
const p = await sdk_1.funnel.publishFunnel(config.api_key, orgId, id);
|
|
64
|
+
(0, output_js_1.success)(`Publish job started. Status: ${p.status}`);
|
|
65
|
+
}
|
|
66
|
+
async function status(id, flags) {
|
|
67
|
+
const config = (0, config_js_1.requireConfig)();
|
|
68
|
+
const orgId = flags.org || config.default_org;
|
|
69
|
+
if (!orgId || !id)
|
|
70
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel status <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
71
|
+
const s = await sdk_1.funnel.getPublishStatus(config.api_key, orgId, id);
|
|
72
|
+
(0, output_js_1.info)(`Publish Status: ${s.status}`);
|
|
73
|
+
}
|
|
22
74
|
async function push(id, slug, flags) {
|
|
23
|
-
if (!id || !slug)
|
|
24
|
-
(0, output_js_1.error)("Missing id or slug");
|
|
25
75
|
const config = (0, config_js_1.requireConfig)();
|
|
76
|
+
const orgId = flags.org || config.default_org;
|
|
77
|
+
if (!orgId || !id || !slug) {
|
|
78
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel push <funnel_id> <slug> --org <id> < index.html\n(Or set defaults via: myapi config set-org <id>)");
|
|
79
|
+
}
|
|
26
80
|
const html = await new Promise((resolve, reject) => {
|
|
27
81
|
let data = '';
|
|
28
82
|
process.stdin.setEncoding('utf-8');
|
|
@@ -32,6 +86,64 @@ async function push(id, slug, flags) {
|
|
|
32
86
|
});
|
|
33
87
|
if (!html)
|
|
34
88
|
(0, output_js_1.error)("No HTML provided via stdin");
|
|
35
|
-
await sdk_1.funnel.pushPage(config.api_key, id, slug, html);
|
|
89
|
+
await sdk_1.funnel.pushPage(config.api_key, orgId, id, slug, html);
|
|
36
90
|
(0, output_js_1.success)(`Pushed page to ${slug}`);
|
|
37
91
|
}
|
|
92
|
+
async function verify(id, flags) {
|
|
93
|
+
const config = (0, config_js_1.requireConfig)();
|
|
94
|
+
const orgId = flags.org || config.default_org;
|
|
95
|
+
if (!orgId || !id)
|
|
96
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi funnel verify <id> --org <id> [--slug <slug>]\n(Or set defaults via: myapi config set-org <id>)");
|
|
97
|
+
const opts = {};
|
|
98
|
+
if (flags.slug)
|
|
99
|
+
opts.slug = flags.slug;
|
|
100
|
+
const v = await sdk_1.funnel.verifyFunnel(config.api_key, orgId, id, opts);
|
|
101
|
+
(0, output_js_1.printJson)(v);
|
|
102
|
+
}
|
|
103
|
+
async function run(subcommand, args, flags) {
|
|
104
|
+
if (!subcommand || (flags.help && !subcommand)) {
|
|
105
|
+
(0, output_js_1.info)('Usage: myapi funnel <subcommand>\n\nSubcommands:\n list List funnels\n create Create a funnel\n get Get funnel details\n delete Delete a funnel\n preview Deploy to a preview domain\n publish Deploy to production domain\n status Check publish status\n push Push a raw HTML page to a slug\n verify Verify links and webhooks\n\nNote: All funnel commands require the --org <id> flag.');
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (flags.help) {
|
|
109
|
+
if (subcommand === 'list')
|
|
110
|
+
(0, output_js_1.info)('Usage: myapi funnel list --org <id>');
|
|
111
|
+
else if (subcommand === 'create')
|
|
112
|
+
(0, output_js_1.info)('Usage: myapi funnel create --org <id> --domain <domain>');
|
|
113
|
+
else if (subcommand === 'get')
|
|
114
|
+
(0, output_js_1.info)('Usage: myapi funnel get <id> --org <id>');
|
|
115
|
+
else if (subcommand === 'delete')
|
|
116
|
+
(0, output_js_1.info)('Usage: myapi funnel delete <id> --org <id>');
|
|
117
|
+
else if (subcommand === 'preview')
|
|
118
|
+
(0, output_js_1.info)('Usage: myapi funnel preview <id> --org <id>');
|
|
119
|
+
else if (subcommand === 'publish')
|
|
120
|
+
(0, output_js_1.info)('Usage: myapi funnel publish <id> --org <id>');
|
|
121
|
+
else if (subcommand === 'status')
|
|
122
|
+
(0, output_js_1.info)('Usage: myapi funnel status <id> --org <id>');
|
|
123
|
+
else if (subcommand === 'push')
|
|
124
|
+
(0, output_js_1.info)('Usage: myapi funnel push <funnel_id> <slug> --org <id> < index.html\n\nPushes HTML content from stdin to the specified funnel.');
|
|
125
|
+
else if (subcommand === 'verify')
|
|
126
|
+
(0, output_js_1.info)('Usage: myapi funnel verify <id> --org <id> [--slug <slug>]\n\nVerifies syntax and structure before publishing.');
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (subcommand === 'list')
|
|
130
|
+
await list(flags);
|
|
131
|
+
else if (subcommand === 'create')
|
|
132
|
+
await create(flags);
|
|
133
|
+
else if (subcommand === 'get')
|
|
134
|
+
await get(args[0], flags);
|
|
135
|
+
else if (subcommand === 'delete')
|
|
136
|
+
await del(args[0], flags);
|
|
137
|
+
else if (subcommand === 'preview')
|
|
138
|
+
await preview(args[0], flags);
|
|
139
|
+
else if (subcommand === 'publish')
|
|
140
|
+
await publish(args[0], flags);
|
|
141
|
+
else if (subcommand === 'status')
|
|
142
|
+
await status(args[0], flags);
|
|
143
|
+
else if (subcommand === 'push')
|
|
144
|
+
await push(args[0], args[1], flags);
|
|
145
|
+
else if (subcommand === 'verify')
|
|
146
|
+
await verify(args[0], flags);
|
|
147
|
+
else
|
|
148
|
+
(0, output_js_1.error)(`Unknown subcommand: ${subcommand}. Run "myapi funnel --help" for a list of valid subcommands.`);
|
|
149
|
+
}
|
package/dist/commands/keys.js
CHANGED
|
@@ -58,11 +58,15 @@ async function createNew(flags) {
|
|
|
58
58
|
}
|
|
59
59
|
async function list(flags) {
|
|
60
60
|
if (flags.help) {
|
|
61
|
-
(0, output_js_1.info)('Usage: myapi keys list\n\nLists all API keys associated with your account.');
|
|
61
|
+
(0, output_js_1.info)('Usage: myapi keys list [--json]\n\nLists all API keys associated with your account.');
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
const config = (0, config_js_1.requireConfig)();
|
|
65
65
|
const keysList = await sdk_1.hq.listApiKeys(config.api_key);
|
|
66
|
+
if (flags.json) {
|
|
67
|
+
(0, output_js_1.printJson)(keysList);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
66
70
|
const formattedKeys = keysList.map(k => {
|
|
67
71
|
// Format creation date
|
|
68
72
|
const createdDate = new Date(k.created_at);
|
package/dist/commands/org.js
CHANGED
|
@@ -71,13 +71,13 @@ async function importOrg(args, flags) {
|
|
|
71
71
|
(0, output_js_1.info)('Usage: myapi org import <domain> --org <id>\n\nAutomatically extracts brand info from an existing website and updates the organization.\n\nNote: You must create a placeholder organization first using `myapi org create` to get an org_id.');
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
const
|
|
74
|
+
const config = (0, config_js_1.requireConfig)();
|
|
75
|
+
const domain = args[0] || config.default_domain;
|
|
76
|
+
const orgId = flags.org || config.default_org;
|
|
76
77
|
if (!domain || !orgId) {
|
|
77
|
-
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi org import <domain> --org <id>");
|
|
78
|
+
(0, output_js_1.error)("Missing required arguments.\nUsage: myapi org import <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
|
-
const config = (0, config_js_1.requireConfig)();
|
|
81
81
|
const result = await sdk_1.hq.importOrg(config.api_key, orgId, domain);
|
|
82
82
|
const importId = result.job_id;
|
|
83
83
|
process.stdout.write("Importing ");
|
package/dist/config.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -42,8 +42,8 @@ const keysCmd = __importStar(require("./commands/keys.js"));
|
|
|
42
42
|
const billingCmd = __importStar(require("./commands/billing.js"));
|
|
43
43
|
const orgCmd = __importStar(require("./commands/org.js"));
|
|
44
44
|
const setupCmd = __importStar(require("./commands/setup.js"));
|
|
45
|
+
const configCmd = __importStar(require("./commands/config.js"));
|
|
45
46
|
const domainCmd = __importStar(require("./commands/domain.js"));
|
|
46
|
-
const emailCmd = __importStar(require("./commands/email.js"));
|
|
47
47
|
async function main() {
|
|
48
48
|
const { args, flags } = (0, utils_js_1.parseArgs)(process.argv.slice(2));
|
|
49
49
|
if (args.length === 0) {
|
|
@@ -108,12 +108,12 @@ async function main() {
|
|
|
108
108
|
else
|
|
109
109
|
printHelp();
|
|
110
110
|
break;
|
|
111
|
+
case 'config':
|
|
112
|
+
await configCmd.run(subcommand, restArgs, flags);
|
|
113
|
+
break;
|
|
111
114
|
case 'domain':
|
|
112
115
|
await domainCmd.run(subcommand, restArgs, flags);
|
|
113
116
|
break;
|
|
114
|
-
case 'email':
|
|
115
|
-
await emailCmd.run(subcommand, restArgs, flags);
|
|
116
|
-
break;
|
|
117
117
|
default:
|
|
118
118
|
printHelp();
|
|
119
119
|
process.exit(0);
|
|
@@ -139,8 +139,8 @@ Commands:
|
|
|
139
139
|
billing Check balance and manage billing
|
|
140
140
|
org Manage organizations
|
|
141
141
|
setup Setup CLI credentials and view integration instructions
|
|
142
|
+
config Manage CLI defaults like org_id and domain
|
|
142
143
|
domain Manage domain configurations
|
|
143
|
-
email Send emails and manage templates
|
|
144
144
|
|
|
145
145
|
Run "myapi <command> --help" for subcommand help.`);
|
|
146
146
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { requireConfig, saveConfig } from '../config.js';
|
|
2
|
+
import { success, error, info } from '../output.js';
|
|
3
|
+
|
|
4
|
+
export async function setOrg(id: string, flags: Record<string, string | boolean>) {
|
|
5
|
+
if (!id || flags.help) {
|
|
6
|
+
info("Usage: myapi config set-org <id>\n\nSets a default organization ID for subsequent commands.");
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const config = requireConfig();
|
|
10
|
+
config.default_org = id;
|
|
11
|
+
saveConfig(config);
|
|
12
|
+
success(`Default organization set to: ${id}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function setDomain(domain: string, flags: Record<string, string | boolean>) {
|
|
16
|
+
if (!domain || flags.help) {
|
|
17
|
+
info("Usage: myapi config set-domain <domain>\n\nSets a default domain for subsequent commands.");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const config = requireConfig();
|
|
21
|
+
config.default_domain = domain;
|
|
22
|
+
saveConfig(config);
|
|
23
|
+
success(`Default domain set to: ${domain}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function view(flags: Record<string, string | boolean>) {
|
|
27
|
+
if (flags.help) {
|
|
28
|
+
info("Usage: myapi config view\n\nViews current config settings.");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const config = requireConfig();
|
|
32
|
+
info(`Default Org: ${config.default_org || 'Not set'}`);
|
|
33
|
+
info(`Default Domain: ${config.default_domain || 'Not set'}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>) {
|
|
37
|
+
if (!subcommand || (flags.help && !subcommand)) {
|
|
38
|
+
info('Usage: myapi config <subcommand>\n\nSubcommands:\n view View current config\n set-org Set default organization\n set-domain Set default domain');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (subcommand === 'view') await view(flags);
|
|
43
|
+
else if (subcommand === 'set-org') await setOrg(args[0], flags);
|
|
44
|
+
else if (subcommand === 'set-domain') await setDomain(args[0], flags);
|
|
45
|
+
else error(`Unknown subcommand: ${subcommand}. Run "myapi config --help" for a list of valid subcommands.`);
|
|
46
|
+
}
|
package/src/commands/domain.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { domain as sdkDomain } from '@myapihq/sdk';
|
|
|
2
2
|
import { requireConfig } from '../config.js';
|
|
3
3
|
import { success, error, info, printTable, printJson } from '../output.js';
|
|
4
4
|
|
|
5
|
-
export async function check(
|
|
6
|
-
const orgId = flags.org as string;
|
|
7
|
-
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain check <domain> --org <id>");
|
|
5
|
+
export async function check(domainArg: string, flags: Record<string, string | boolean>) {
|
|
8
6
|
const config = requireConfig();
|
|
7
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
8
|
+
const domain = domainArg || (config.default_domain as string);
|
|
9
|
+
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain check <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
9
10
|
const res = await sdkDomain.checkDomain(config.api_key, orgId, domain);
|
|
10
11
|
if (res.available) {
|
|
11
12
|
info(`${domain} — Available ✓ Price: $${(res.price_cents / 100).toFixed(2)}/yr`);
|
|
@@ -14,22 +15,24 @@ export async function check(domain: string, flags: Record<string, string | boole
|
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export async function register(
|
|
18
|
-
const orgId = flags.org as string;
|
|
19
|
-
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain register <domain> --org <id> [--years <num>]");
|
|
20
|
-
const years = parseInt(flags.years as string) || 1;
|
|
18
|
+
export async function register(domainArg: string, flags: Record<string, string | boolean>) {
|
|
21
19
|
const config = requireConfig();
|
|
20
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
21
|
+
const domain = domainArg || (config.default_domain as string);
|
|
22
|
+
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain register <domain> --org <id> [--years <num>]\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
23
|
+
const years = parseInt(flags.years as string) || 1;
|
|
22
24
|
const res = await sdkDomain.registerDomain(config.api_key, orgId, domain, years);
|
|
23
25
|
success(`Registered ${domain}!\n${JSON.stringify(res, null, 2)}`);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
export async function importDomain(
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
export async function importDomain(domainArg: string, flags: Record<string, string | boolean>) {
|
|
29
|
+
const config = requireConfig();
|
|
30
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
31
|
+
const domain = domainArg || (config.default_domain as string);
|
|
32
|
+
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
29
33
|
if (!flags['namecheap-user'] || !flags['namecheap-key']) {
|
|
30
34
|
error("Missing required arguments.\nUsage: myapi domain import <domain> --org <id> --namecheap-user <user> --namecheap-key <key>");
|
|
31
35
|
}
|
|
32
|
-
const config = requireConfig();
|
|
33
36
|
await sdkDomain.importDomain(config.api_key, orgId, {
|
|
34
37
|
domain,
|
|
35
38
|
namecheap_api_user: flags['namecheap-user'] as string,
|
|
@@ -39,43 +42,47 @@ export async function importDomain(domain: string, flags: Record<string, string
|
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
export async function list(flags: Record<string, string | boolean>) {
|
|
42
|
-
const orgId = flags.org as string;
|
|
43
|
-
if (!orgId) error("Missing required arguments.\nUsage: myapi domain list --org <id> [--filter=all|unassigned|org]");
|
|
44
45
|
const config = requireConfig();
|
|
46
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
47
|
+
if (!orgId) error("Missing required arguments.\nUsage: myapi domain list --org <id> [--filter=all|unassigned|org]\n(Or set a default org via: myapi config set-org <id>)");
|
|
45
48
|
const filter = flags.filter as 'all' | 'unassigned' | 'org' | undefined;
|
|
46
49
|
const domains = await sdkDomain.listDomains(config.api_key, orgId, filter);
|
|
47
50
|
printTable(domains as unknown as Record<string, unknown>[]);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
export async function assign(
|
|
51
|
-
const orgId = flags.org as string;
|
|
52
|
-
const targetOrgId = flags.target as string;
|
|
53
|
-
if (!orgId || !domain || !targetOrgId) error("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id> --target <target_org_id>");
|
|
53
|
+
export async function assign(domainArg: string, flags: Record<string, string | boolean>) {
|
|
54
54
|
const config = requireConfig();
|
|
55
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
56
|
+
const domain = domainArg || (config.default_domain as string);
|
|
57
|
+
const targetOrgId = flags.target as string;
|
|
58
|
+
if (!orgId || !domain || !targetOrgId) error("Missing required arguments.\nUsage: myapi domain assign <domain> --org <id> --target <target_org_id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
55
59
|
const res = await sdkDomain.assignDomain(config.api_key, orgId, domain, targetOrgId);
|
|
56
60
|
success(`Assigned ${domain} to org ${targetOrgId}`);
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
export async function unassign(
|
|
60
|
-
const orgId = flags.org as string;
|
|
61
|
-
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain unassign <domain> --org <id>");
|
|
63
|
+
export async function unassign(domainArg: string, flags: Record<string, string | boolean>) {
|
|
62
64
|
const config = requireConfig();
|
|
65
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
66
|
+
const domain = domainArg || (config.default_domain as string);
|
|
67
|
+
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain unassign <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
63
68
|
const res = await sdkDomain.unassignDomain(config.api_key, orgId, domain);
|
|
64
69
|
success(`Unassigned ${domain} from org ${orgId}`);
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
export async function settings(
|
|
68
|
-
const orgId = flags.org as string;
|
|
69
|
-
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain settings <domain> --org <id>");
|
|
72
|
+
export async function settings(domainArg: string, flags: Record<string, string | boolean>) {
|
|
70
73
|
const config = requireConfig();
|
|
74
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
75
|
+
const domain = domainArg || (config.default_domain as string);
|
|
76
|
+
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain settings <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
71
77
|
const res = await sdkDomain.getDomainSettings(config.api_key, orgId, domain);
|
|
72
78
|
printJson(res);
|
|
73
79
|
}
|
|
74
80
|
|
|
75
|
-
export async function updateSettings(
|
|
76
|
-
const orgId = flags.org as string;
|
|
77
|
-
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain update-settings <domain> --org <id> [--security=...] [--browser-check=...] [--purge-cache]");
|
|
81
|
+
export async function updateSettings(domainArg: string, flags: Record<string, string | boolean>) {
|
|
78
82
|
const config = requireConfig();
|
|
83
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
84
|
+
const domain = domainArg || (config.default_domain as string);
|
|
85
|
+
if (!orgId || !domain) error("Missing required arguments.\nUsage: myapi domain update-settings <domain> --org <id> [--security=...] [--browser-check=...] [--purge-cache]\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
79
86
|
const payload: any = {};
|
|
80
87
|
if (flags.security) payload.security_level = flags.security as string;
|
|
81
88
|
if (flags['browser-check']) payload.browser_check = flags['browser-check'] as string;
|
package/src/commands/email.ts
CHANGED
|
@@ -4,29 +4,30 @@ import { success, error, printTable, printJson, info } from '../output.js';
|
|
|
4
4
|
import { sleep } from '../utils.js';
|
|
5
5
|
|
|
6
6
|
export async function createMailbox(flags: Record<string, string | boolean>) {
|
|
7
|
-
const orgId = flags.org as string;
|
|
8
|
-
if (!orgId || !flags.domain || !flags.username) {
|
|
9
|
-
error("Missing required arguments.\nUsage: myapi email create-mailbox --org <id> --domain <domain> --username <user>");
|
|
10
|
-
}
|
|
11
7
|
const config = requireConfig();
|
|
12
|
-
const
|
|
8
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
9
|
+
const domain = (flags.domain as string) || config.default_domain;
|
|
10
|
+
if (!orgId || !domain || !flags.username) {
|
|
11
|
+
error("Missing required arguments.\nUsage: myapi email create-mailbox --org <id> --domain <domain> --username <user>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
12
|
+
}
|
|
13
|
+
const address = await sdkEmail.createMailbox(config.api_key, orgId, domain, flags.username as string);
|
|
13
14
|
success(`Mailbox created: ${address.address}`);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export async function listMailboxes(flags: Record<string, string | boolean>) {
|
|
17
|
-
const orgId = flags.org as string;
|
|
18
|
-
if (!orgId) error("Missing required arguments.\nUsage: myapi email list-mailboxes --org <id>");
|
|
19
18
|
const config = requireConfig();
|
|
19
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
20
|
+
if (!orgId) error("Missing required arguments.\nUsage: myapi email list-mailboxes --org <id>\n(Or set a default org via: myapi config set-org <id>)");
|
|
20
21
|
const mailboxes = await sdkEmail.listMailboxes(config.api_key, orgId);
|
|
21
22
|
printTable(mailboxes as unknown as Record<string, unknown>[]);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export async function send(flags: Record<string, string | boolean>) {
|
|
25
|
-
const
|
|
26
|
+
const config = requireConfig();
|
|
27
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
26
28
|
if (!orgId || !flags.from || !flags.to || !flags.subject || !flags.body) {
|
|
27
29
|
error("Missing required arguments.\nUsage: myapi email send --org <id> --from <email> --to <email> --subject <str> --body <str>");
|
|
28
30
|
}
|
|
29
|
-
const config = requireConfig();
|
|
30
31
|
const res = await sdkEmail.sendEmail(config.api_key, orgId, {
|
|
31
32
|
from: flags.from as string,
|
|
32
33
|
to: [flags.to as string],
|
|
@@ -37,27 +38,27 @@ export async function send(flags: Record<string, string | boolean>) {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export async function inbox(address: string, flags: Record<string, string | boolean>) {
|
|
40
|
-
const orgId = flags.org as string;
|
|
41
|
-
if (!orgId || !address) error("Missing required arguments.\nUsage: myapi email inbox <address> --org <id>");
|
|
42
41
|
const config = requireConfig();
|
|
42
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
43
|
+
if (!orgId || !address) error("Missing required arguments.\nUsage: myapi email inbox <address> --org <id>");
|
|
43
44
|
const messages = await sdkEmail.getInbox(config.api_key, orgId, address);
|
|
44
45
|
printTable(messages as unknown as Record<string, unknown>[]);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export async function listTemplates(flags: Record<string, string | boolean>) {
|
|
48
|
-
const orgId = flags.org as string;
|
|
49
|
-
if (!orgId) error("Missing required arguments.\nUsage: myapi email list-templates --org <id>");
|
|
50
49
|
const config = requireConfig();
|
|
50
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
51
|
+
if (!orgId) error("Missing required arguments.\nUsage: myapi email list-templates --org <id>\n(Or set a default org via: myapi config set-org <id>)");
|
|
51
52
|
const templates = await sdkEmail.listTemplates(config.api_key, orgId);
|
|
52
53
|
printTable(templates as unknown as Record<string, unknown>[]);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
export async function generateTemplate(flags: Record<string, string | boolean>) {
|
|
56
|
-
const
|
|
57
|
+
const config = requireConfig();
|
|
58
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
57
59
|
if (!orgId || !flags.prompt || !flags.name) {
|
|
58
60
|
error("Missing required arguments.\nUsage: myapi email generate-template --org <id> --prompt <str> --name <str>");
|
|
59
61
|
}
|
|
60
|
-
const config = requireConfig();
|
|
61
62
|
|
|
62
63
|
const job = await sdkEmail.generateTemplate(config.api_key, orgId, {
|
|
63
64
|
prompt: flags.prompt as string,
|
|
@@ -89,17 +90,17 @@ export async function generateTemplate(flags: Record<string, string | boolean>)
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
export async function listCampaigns(flags: Record<string, string | boolean>) {
|
|
92
|
-
const orgId = flags.org as string;
|
|
93
|
-
if (!orgId) error("Missing required arguments.\nUsage: myapi email list-campaigns --org <id>");
|
|
94
93
|
const config = requireConfig();
|
|
94
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
95
|
+
if (!orgId) error("Missing required arguments.\nUsage: myapi email list-campaigns --org <id>\n(Or set a default org via: myapi config set-org <id>)");
|
|
95
96
|
const campaigns = await sdkEmail.listCampaigns(config.api_key, orgId);
|
|
96
97
|
printTable(campaigns as unknown as Record<string, unknown>[]);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
export async function campaignStats(id: string, flags: Record<string, string | boolean>) {
|
|
100
|
-
const orgId = flags.org as string;
|
|
101
|
-
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi email campaign-stats <id> --org <id>");
|
|
102
101
|
const config = requireConfig();
|
|
102
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
103
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi email campaign-stats <id> --org <id>");
|
|
103
104
|
const stats = await sdkEmail.getCampaignStats(config.api_key, orgId, id);
|
|
104
105
|
printJson(stats);
|
|
105
106
|
}
|
package/src/commands/funnel.ts
CHANGED
|
@@ -1,26 +1,76 @@
|
|
|
1
1
|
import { funnel as sdkFunnel } from '@myapihq/sdk';
|
|
2
2
|
import { requireConfig } from '../config.js';
|
|
3
|
-
import { success, error, printTable } from '../output.js';
|
|
3
|
+
import { success, error, printTable, info, printJson } from '../output.js';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
|
|
6
6
|
export async function list(flags: Record<string, string | boolean>) {
|
|
7
7
|
const config = requireConfig();
|
|
8
|
-
const
|
|
8
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
9
|
+
if (!orgId) error("Missing required arguments.\nUsage: myapi funnel list --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
10
|
+
const funnels = await sdkFunnel.listFunnels(config.api_key, orgId);
|
|
9
11
|
printTable(funnels as unknown as Record<string, unknown>[]);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export async function create(flags: Record<string, string | boolean>) {
|
|
13
|
-
if (!flags['org-id'] || !flags.domain) {
|
|
14
|
-
error("Missing --org-id or --domain flags");
|
|
15
|
-
}
|
|
16
15
|
const config = requireConfig();
|
|
17
|
-
const
|
|
16
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
17
|
+
const domain = (flags.domain as string) || config.default_domain;
|
|
18
|
+
|
|
19
|
+
if (!orgId || !domain) {
|
|
20
|
+
error("Missing required arguments.\nUsage: myapi funnel create --org <id> --domain <domain>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const funnel = await sdkFunnel.createFunnel(config.api_key, orgId, domain);
|
|
18
24
|
success(`Funnel created! ID: ${funnel.id}`);
|
|
19
25
|
}
|
|
20
26
|
|
|
27
|
+
export async function get(id: string, flags: Record<string, string | boolean>) {
|
|
28
|
+
const config = requireConfig();
|
|
29
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
30
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi funnel get <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
31
|
+
const funnel = await sdkFunnel.getFunnel(config.api_key, orgId, id);
|
|
32
|
+
printJson(funnel);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function del(id: string, flags: Record<string, string | boolean>) {
|
|
36
|
+
const config = requireConfig();
|
|
37
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
38
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi funnel delete <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
39
|
+
await sdkFunnel.deleteFunnel(config.api_key, orgId, id);
|
|
40
|
+
success(`Funnel ${id} deleted`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function preview(id: string, flags: Record<string, string | boolean>) {
|
|
44
|
+
const config = requireConfig();
|
|
45
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
46
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi funnel preview <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
47
|
+
const p = await sdkFunnel.previewFunnel(config.api_key, orgId, id);
|
|
48
|
+
success(`Preview deployed: ${p.preview_url}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export async function publish(id: string, flags: Record<string, string | boolean>) {
|
|
52
|
+
const config = requireConfig();
|
|
53
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
54
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi funnel publish <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
55
|
+
const p = await sdkFunnel.publishFunnel(config.api_key, orgId, id);
|
|
56
|
+
success(`Publish job started. Status: ${p.status}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function status(id: string, flags: Record<string, string | boolean>) {
|
|
60
|
+
const config = requireConfig();
|
|
61
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
62
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi funnel status <id> --org <id>\n(Or set defaults via: myapi config set-org <id>)");
|
|
63
|
+
const s = await sdkFunnel.getPublishStatus(config.api_key, orgId, id);
|
|
64
|
+
info(`Publish Status: ${s.status}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
21
67
|
export async function push(id: string, slug: string, flags: Record<string, string | boolean>) {
|
|
22
|
-
if (!id || !slug) error("Missing id or slug");
|
|
23
68
|
const config = requireConfig();
|
|
69
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
70
|
+
|
|
71
|
+
if (!orgId || !id || !slug) {
|
|
72
|
+
error("Missing required arguments.\nUsage: myapi funnel push <funnel_id> <slug> --org <id> < index.html\n(Or set defaults via: myapi config set-org <id>)");
|
|
73
|
+
}
|
|
24
74
|
|
|
25
75
|
const html = await new Promise<string>((resolve, reject) => {
|
|
26
76
|
let data = '';
|
|
@@ -32,6 +82,47 @@ export async function push(id: string, slug: string, flags: Record<string, strin
|
|
|
32
82
|
|
|
33
83
|
if (!html) error("No HTML provided via stdin");
|
|
34
84
|
|
|
35
|
-
await sdkFunnel.pushPage(config.api_key, id, slug, html);
|
|
85
|
+
await sdkFunnel.pushPage(config.api_key, orgId, id, slug, html);
|
|
36
86
|
success(`Pushed page to ${slug}`);
|
|
37
87
|
}
|
|
88
|
+
|
|
89
|
+
export async function verify(id: string, flags: Record<string, string | boolean>) {
|
|
90
|
+
const config = requireConfig();
|
|
91
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
92
|
+
if (!orgId || !id) error("Missing required arguments.\nUsage: myapi funnel verify <id> --org <id> [--slug <slug>]\n(Or set defaults via: myapi config set-org <id>)");
|
|
93
|
+
const opts: any = {};
|
|
94
|
+
if (flags.slug) opts.slug = flags.slug as string;
|
|
95
|
+
const v = await sdkFunnel.verifyFunnel(config.api_key, orgId, id, opts);
|
|
96
|
+
printJson(v);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export async function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>) {
|
|
100
|
+
if (!subcommand || (flags.help && !subcommand)) {
|
|
101
|
+
info('Usage: myapi funnel <subcommand>\n\nSubcommands:\n list List funnels\n create Create a funnel\n get Get funnel details\n delete Delete a funnel\n preview Deploy to a preview domain\n publish Deploy to production domain\n status Check publish status\n push Push a raw HTML page to a slug\n verify Verify links and webhooks\n\nNote: All funnel commands require the --org <id> flag.');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (flags.help) {
|
|
106
|
+
if (subcommand === 'list') info('Usage: myapi funnel list --org <id>');
|
|
107
|
+
else if (subcommand === 'create') info('Usage: myapi funnel create --org <id> --domain <domain>');
|
|
108
|
+
else if (subcommand === 'get') info('Usage: myapi funnel get <id> --org <id>');
|
|
109
|
+
else if (subcommand === 'delete') info('Usage: myapi funnel delete <id> --org <id>');
|
|
110
|
+
else if (subcommand === 'preview') info('Usage: myapi funnel preview <id> --org <id>');
|
|
111
|
+
else if (subcommand === 'publish') info('Usage: myapi funnel publish <id> --org <id>');
|
|
112
|
+
else if (subcommand === 'status') info('Usage: myapi funnel status <id> --org <id>');
|
|
113
|
+
else if (subcommand === 'push') info('Usage: myapi funnel push <funnel_id> <slug> --org <id> < index.html\n\nPushes HTML content from stdin to the specified funnel.');
|
|
114
|
+
else if (subcommand === 'verify') info('Usage: myapi funnel verify <id> --org <id> [--slug <slug>]\n\nVerifies syntax and structure before publishing.');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (subcommand === 'list') await list(flags);
|
|
119
|
+
else if (subcommand === 'create') await create(flags);
|
|
120
|
+
else if (subcommand === 'get') await get(args[0], flags);
|
|
121
|
+
else if (subcommand === 'delete') await del(args[0], flags);
|
|
122
|
+
else if (subcommand === 'preview') await preview(args[0], flags);
|
|
123
|
+
else if (subcommand === 'publish') await publish(args[0], flags);
|
|
124
|
+
else if (subcommand === 'status') await status(args[0], flags);
|
|
125
|
+
else if (subcommand === 'push') await push(args[0], args[1], flags);
|
|
126
|
+
else if (subcommand === 'verify') await verify(args[0], flags);
|
|
127
|
+
else error(`Unknown subcommand: ${subcommand}. Run "myapi funnel --help" for a list of valid subcommands.`);
|
|
128
|
+
}
|
package/src/commands/keys.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hq } from '@myapihq/sdk';
|
|
2
2
|
import { requireConfig } from '../config.js';
|
|
3
|
-
import { success, error, printTable, info } from '../output.js';
|
|
3
|
+
import { success, error, printTable, info, printJson } from '../output.js';
|
|
4
4
|
import * as readline from 'readline';
|
|
5
5
|
|
|
6
6
|
export async function createNew(flags: Record<string, string | boolean>) {
|
|
@@ -24,12 +24,17 @@ export async function createNew(flags: Record<string, string | boolean>) {
|
|
|
24
24
|
|
|
25
25
|
export async function list(flags: Record<string, string | boolean>) {
|
|
26
26
|
if (flags.help) {
|
|
27
|
-
info('Usage: myapi keys list\n\nLists all API keys associated with your account.');
|
|
27
|
+
info('Usage: myapi keys list [--json]\n\nLists all API keys associated with your account.');
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const config = requireConfig();
|
|
31
31
|
const keysList = await hq.listApiKeys(config.api_key);
|
|
32
32
|
|
|
33
|
+
if (flags.json) {
|
|
34
|
+
printJson(keysList);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
const formattedKeys = keysList.map(k => {
|
|
34
39
|
// Format creation date
|
|
35
40
|
const createdDate = new Date(k.created_at);
|
package/src/commands/org.ts
CHANGED
|
@@ -66,14 +66,14 @@ export async function importOrg(args: string[], flags: Record<string, string | b
|
|
|
66
66
|
info('Usage: myapi org import <domain> --org <id>\n\nAutomatically extracts brand info from an existing website and updates the organization.\n\nNote: You must create a placeholder organization first using `myapi org create` to get an org_id.');
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
70
|
-
const
|
|
69
|
+
const config = requireConfig();
|
|
70
|
+
const domain = args[0] || (config.default_domain as string);
|
|
71
|
+
const orgId = (flags.org as string) || config.default_org;
|
|
71
72
|
|
|
72
73
|
if (!domain || !orgId) {
|
|
73
|
-
error("Missing required arguments.\nUsage: myapi org import <domain> --org <id>");
|
|
74
|
+
error("Missing required arguments.\nUsage: myapi org import <domain> --org <id>\n(Or set defaults via: myapi config set-org <id> / set-domain <domain>)");
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
const config = requireConfig();
|
|
77
77
|
|
|
78
78
|
const result = await hq.importOrg(config.api_key, orgId, domain);
|
|
79
79
|
const importId = result.job_id;
|
package/src/config.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,8 +7,8 @@ import * as keysCmd from './commands/keys.js';
|
|
|
7
7
|
import * as billingCmd from './commands/billing.js';
|
|
8
8
|
import * as orgCmd from './commands/org.js';
|
|
9
9
|
import * as setupCmd from './commands/setup.js';
|
|
10
|
+
import * as configCmd from './commands/config.js';
|
|
10
11
|
import * as domainCmd from './commands/domain.js';
|
|
11
|
-
import * as emailCmd from './commands/email.js';
|
|
12
12
|
|
|
13
13
|
async function main() {
|
|
14
14
|
const { args, flags } = parseArgs(process.argv.slice(2));
|
|
@@ -56,12 +56,12 @@ async function main() {
|
|
|
56
56
|
else if (subcommand === 'setup') await billingCmd.setup(flags);
|
|
57
57
|
else printHelp();
|
|
58
58
|
break;
|
|
59
|
+
case 'config':
|
|
60
|
+
await configCmd.run(subcommand, restArgs, flags);
|
|
61
|
+
break;
|
|
59
62
|
case 'domain':
|
|
60
63
|
await domainCmd.run(subcommand, restArgs, flags);
|
|
61
64
|
break;
|
|
62
|
-
case 'email':
|
|
63
|
-
await emailCmd.run(subcommand, restArgs, flags);
|
|
64
|
-
break;
|
|
65
65
|
default:
|
|
66
66
|
printHelp();
|
|
67
67
|
process.exit(0);
|
|
@@ -85,8 +85,8 @@ Commands:
|
|
|
85
85
|
billing Check balance and manage billing
|
|
86
86
|
org Manage organizations
|
|
87
87
|
setup Setup CLI credentials and view integration instructions
|
|
88
|
+
config Manage CLI defaults like org_id and domain
|
|
88
89
|
domain Manage domain configurations
|
|
89
|
-
email Send emails and manage templates
|
|
90
90
|
|
|
91
91
|
Run "myapi <command> --help" for subcommand help.`);
|
|
92
92
|
}
|