@myapihq/cli 2.3.1 → 2.4.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/commands/account.d.ts +1 -1
- package/dist/commands/account.js +1 -0
- package/dist/commands/authproduct.js +7 -3
- package/dist/commands/billing.js +7 -2
- package/dist/commands/container.js +4 -3
- package/dist/commands/database.js +4 -3
- package/dist/commands/domain.js +39 -14
- package/dist/commands/email/message.js +6 -3
- package/dist/commands/email/template.js +3 -3
- package/dist/commands/fn.js +4 -3
- package/dist/commands/funnel.js +33 -13
- package/dist/commands/git.js +108 -35
- package/dist/commands/image.js +7 -4
- package/dist/commands/keys-validation.test.js +5 -0
- package/dist/commands/keys.js +6 -2
- package/dist/commands/llm.js +14 -10
- package/dist/commands/login-validation.test.d.ts +1 -0
- package/dist/commands/login-validation.test.js +65 -0
- package/dist/commands/login.d.ts +20 -0
- package/dist/commands/login.js +478 -0
- package/dist/commands/org.d.ts +1 -1
- package/dist/commands/org.js +24 -7
- package/dist/commands/queue.js +4 -3
- package/dist/commands/setup.js +8 -3
- package/dist/commands/storage.js +1 -1
- package/dist/commands/workflow.js +5 -4
- package/dist/completion.js +3 -3
- package/dist/config.js +3 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +62 -0
- package/dist/errors.test.d.ts +1 -0
- package/dist/errors.test.js +28 -0
- package/dist/exposes.test.js +1 -0
- package/dist/flags.js +5 -3
- package/dist/flags.test.js +1 -1
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.js +22 -0
- package/dist/index.js +10 -51
- package/dist/skills/my-api-hq/SKILL.md +2 -2
- package/dist/skills/my-domain-api/SKILL.md +5 -5
- package/dist/skills/my-email-verify-api/SKILL.md +6 -4
- package/dist/skills/my-funnel-api/SKILL.md +5 -4
- package/dist/skills/my-git-api/SKILL.md +14 -7
- package/dist/skills/my-image-api/SKILL.md +1 -1
- package/dist/skills/my-storage-api/SKILL.md +5 -5
- package/dist/skills/my-webhook-api/SKILL.md +1 -1
- package/dist/skills/my-workflow-api/SKILL.md +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +13 -1
- package/package.json +3 -2
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withFundsRetry } from '@myapihq/sdk';
|
|
2
|
+
import { spinnerFrame, spinnerWrite, clearLine, error, banner } from './output.js';
|
|
2
3
|
export function sleep(ms) {
|
|
3
4
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
4
5
|
}
|
|
6
|
+
// Wrap a billable SDK call: when the wallet is empty but an auto-recharge is
|
|
7
|
+
// already in flight (the 402 split), wait the server-hinted interval and
|
|
8
|
+
// retry instead of failing — so an unattended agent isn't killed by a refill
|
|
9
|
+
// that's seconds away. Every other 402 state (capped / no_pm / failed /
|
|
10
|
+
// disabled, spend-cap) still fails fast into the tailored guidance in
|
|
11
|
+
// index.ts. Progress goes to stderr so --json stdout stays clean.
|
|
12
|
+
export function retryFunds(call) {
|
|
13
|
+
return withFundsRetry(call, {
|
|
14
|
+
onRetry: (attempt, waitSec) => banner(`› Wallet empty — auto-recharge in flight; waiting ${waitSec}s and retrying (attempt ${attempt}/3)…`),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
5
17
|
/**
|
|
6
18
|
* Formats an ISO/Go timestamp string to "YYYY-MM-DD HH:mm" (UTC).
|
|
7
19
|
* Strips Go's " +0000 UTC" suffix before parsing.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myapihq/cli",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "MyAPI command-line interface",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"test:all": "npm run build && MYAPI_RUN_RESET=1 vitest run src test/smoke test/scripts test/online",
|
|
25
25
|
"check-coverage": "npm run build && node scripts/check-coverage.js",
|
|
26
26
|
"check-coverage:live": "npm run build && node scripts/check-coverage.js --live",
|
|
27
|
+
"typecheck:tests": "tsc -p tsconfig.tests.json",
|
|
27
28
|
"update-schema": "node scripts/update-schema.js",
|
|
28
29
|
"lint:changelog": "node ../../scripts/lint-changelog.js",
|
|
29
30
|
"lint:help-order": "node scripts/lint-help-order.js",
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"lint:skills:strict": "node scripts/copy-skills.js && node scripts/lint-skills.js --strict"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@myapihq/sdk": "^2.
|
|
35
|
+
"@myapihq/sdk": "^2.4.1"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@types/node": "^25.6.0",
|