@myapihq/cli 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -25
- package/package.json +1 -1
- package/src/index.ts +4 -27
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-indexes.js — do not edit manually
|
|
3
3
|
import { parseArgs } from './utils.js';
|
|
4
|
-
import { error, info
|
|
5
|
-
import { loadConfig, saveConfig } from './config.js';
|
|
4
|
+
import { error, info } from './output.js';
|
|
6
5
|
import { MyApiError } from '@myapihq/sdk';
|
|
7
6
|
import updateNotifier from 'update-notifier';
|
|
8
|
-
import omelette from 'omelette';
|
|
9
7
|
import * as fs from 'fs';
|
|
10
8
|
const pkgPath = new URL('../package.json', import.meta.url);
|
|
11
9
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
@@ -22,24 +20,10 @@ import * as urlCmd from './commands/url.js';
|
|
|
22
20
|
import * as webhookCmd from './commands/webhook.js';
|
|
23
21
|
import * as workflowCmd from './commands/workflow.js';
|
|
24
22
|
async function main() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
reply(['keys', 'billing', 'org', 'setup', 'config', 'domain', 'funnel', 'image', 'storage', 'url', 'webhook', 'workflow', 'autocomplete']);
|
|
28
|
-
});
|
|
29
|
-
completion.init();
|
|
30
|
-
const config = loadConfig();
|
|
31
|
-
if (config && !config.autocomplete_setup) {
|
|
32
|
-
try {
|
|
33
|
-
completion.setupShellInitFile();
|
|
34
|
-
config.autocomplete_setup = true;
|
|
35
|
-
saveConfig(config);
|
|
36
|
-
info('✨ Autocomplete has been auto-configured! Restart your terminal (or run: source ~/.bashrc) to use it.');
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
// Ignore if we can't write to shell profiles
|
|
40
|
-
}
|
|
23
|
+
try {
|
|
24
|
+
updateNotifier({ pkg }).notify();
|
|
41
25
|
}
|
|
42
|
-
|
|
26
|
+
catch (e) { }
|
|
43
27
|
const { args, flags } = parseArgs(process.argv.slice(2));
|
|
44
28
|
if (args.length === 0) {
|
|
45
29
|
printHelp();
|
|
@@ -48,10 +32,6 @@ async function main() {
|
|
|
48
32
|
const [command, subcommand, ...restArgs] = args;
|
|
49
33
|
try {
|
|
50
34
|
switch (command) {
|
|
51
|
-
case 'autocomplete':
|
|
52
|
-
completion.setupShellInitFile();
|
|
53
|
-
success('Autocomplete successfully configured! Please restart your terminal or run: source ~/.bashrc (or ~/.zshrc)');
|
|
54
|
-
break;
|
|
55
35
|
case 'setup':
|
|
56
36
|
if (flags.help) {
|
|
57
37
|
info('Usage: myapi setup\n\nSetup CLI credentials and view integration instructions');
|
|
@@ -152,7 +132,6 @@ function printHelp() {
|
|
|
152
132
|
Usage: myapi <command> [subcommand] [args]
|
|
153
133
|
|
|
154
134
|
Commands:
|
|
155
|
-
autocomplete Autocomplete setup for bash/zsh
|
|
156
135
|
keys Manage API keys
|
|
157
136
|
billing Check balance and manage billing
|
|
158
137
|
org Manage organizations
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-indexes.js — do not edit manually
|
|
3
3
|
import { parseArgs } from './utils.js';
|
|
4
4
|
import { error, info, success } from './output.js';
|
|
5
|
-
import { loadConfig
|
|
5
|
+
import { loadConfig } from './config.js';
|
|
6
6
|
import { MyApiError } from '@myapihq/sdk';
|
|
7
7
|
import updateNotifier from 'update-notifier';
|
|
8
|
-
import omelette from 'omelette';
|
|
9
8
|
import * as fs from 'fs';
|
|
10
|
-
import * as path from 'path';
|
|
11
9
|
|
|
12
10
|
const pkgPath = new URL('../package.json', import.meta.url);
|
|
13
11
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
@@ -25,35 +23,15 @@ import * as webhookCmd from './commands/webhook.js';
|
|
|
25
23
|
import * as workflowCmd from './commands/workflow.js';
|
|
26
24
|
|
|
27
25
|
async function main() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
completion.init();
|
|
33
|
-
|
|
34
|
-
const config = loadConfig();
|
|
35
|
-
if (config && !config.autocomplete_setup) {
|
|
36
|
-
try {
|
|
37
|
-
completion.setupShellInitFile();
|
|
38
|
-
config.autocomplete_setup = true;
|
|
39
|
-
saveConfig(config);
|
|
40
|
-
info('✨ Autocomplete has been auto-configured! Restart your terminal (or run: source ~/.bashrc) to use it.');
|
|
41
|
-
} catch (e) {
|
|
42
|
-
// Ignore if we can't write to shell profiles
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
updateNotifier({ pkg }).notify();
|
|
26
|
+
try {
|
|
27
|
+
updateNotifier({ pkg }).notify();
|
|
28
|
+
} catch(e) {}
|
|
47
29
|
|
|
48
30
|
const { args, flags } = parseArgs(process.argv.slice(2));
|
|
49
31
|
if (args.length === 0) { printHelp(); process.exit(0); }
|
|
50
32
|
const [command, subcommand, ...restArgs] = args;
|
|
51
33
|
try {
|
|
52
34
|
switch (command) {
|
|
53
|
-
case 'autocomplete':
|
|
54
|
-
completion.setupShellInitFile();
|
|
55
|
-
success('Autocomplete successfully configured! Please restart your terminal or run: source ~/.bashrc (or ~/.zshrc)');
|
|
56
|
-
break;
|
|
57
35
|
case 'setup':
|
|
58
36
|
if (flags.help) {
|
|
59
37
|
info('Usage: myapi setup\n\nSetup CLI credentials and view integration instructions');
|
|
@@ -137,7 +115,6 @@ function printHelp() {
|
|
|
137
115
|
Usage: myapi <command> [subcommand] [args]
|
|
138
116
|
|
|
139
117
|
Commands:
|
|
140
|
-
autocomplete Autocomplete setup for bash/zsh
|
|
141
118
|
keys Manage API keys
|
|
142
119
|
billing Check balance and manage billing
|
|
143
120
|
org Manage organizations
|