@actionway/cli 0.17.1 → 0.18.0
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/README.md +5 -1
- package/dist/index.js +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,9 @@ actionway CLI 的本地端壳(迁移文档 `docs/DL_TO_ACTIONWAY_CLI_MIGRATION
|
|
|
12
12
|
- 高频 typed command 继续提供参数与文件 UX,但投影到同一个 Tool Call;
|
|
13
13
|
- `account usage / wallet / transactions` 只读 Actionway Business 数据;
|
|
14
14
|
- 本壳另有 `init` / `update` / `login` / `logout` / `whoami`,cli-core
|
|
15
|
-
|
|
15
|
+
继续提供 wait/poll 与已冻结的共享 typed commands。
|
|
16
|
+
|
|
17
|
+
- **账户响应无本地换算**:`account` 响应同时保留精确整数 micros 与可直接展示的 USD 十进制字符串;钱包包含快照更新时间,交易包含状态、说明、完成时间和 signed balance delta。Usage/Transactions 支持 ISO 时间窗口、领域筛选和 opaque cursor,返回的 summary 覆盖完整筛选集合而非当前页。CLI 不自行换算资金,也不改变服务端返回的字段语义。
|
|
16
18
|
- **计费零逻辑**:报价、扣费、错误面裁剪全在 gateway;本壳只透传。旧
|
|
17
19
|
stock download 直连 CDN、Gateway 无法观察结局,因此在阶段二的
|
|
18
20
|
command-level 计费编排完成前明确 fail-closed,不把迁移缺口当免费能力。
|
|
@@ -39,6 +41,8 @@ pnpm cli update --check # 查新版(24h 缓存)
|
|
|
39
41
|
pnpm cli -- tools search "generate a product image"
|
|
40
42
|
pnpm cli -- tools inspect media.image.generate
|
|
41
43
|
pnpm cli -- account usage
|
|
44
|
+
pnpm cli -- account usage --from 2026-08-01 --to 2026-09-01 --service generate-image
|
|
45
|
+
pnpm cli -- account transactions --from 2026-08-01 --kind top_up
|
|
42
46
|
pnpm cli -- generate-video --print-schema
|
|
43
47
|
```
|
|
44
48
|
|
package/dist/index.js
CHANGED
|
@@ -12876,6 +12876,23 @@ function failAccount(error) {
|
|
|
12876
12876
|
}
|
|
12877
12877
|
fail({ code: "E_BACKEND", message: error instanceof Error ? error.message : String(error) });
|
|
12878
12878
|
}
|
|
12879
|
+
function accountEndpoint(path, options) {
|
|
12880
|
+
const parameters = new URLSearchParams();
|
|
12881
|
+
for (const [name, value] of [
|
|
12882
|
+
["limit", options.limit],
|
|
12883
|
+
["cursor", options.cursor],
|
|
12884
|
+
["from", options.from],
|
|
12885
|
+
["to", options.to],
|
|
12886
|
+
["status", options.status],
|
|
12887
|
+
["service_id", options.service],
|
|
12888
|
+
["pricing_kind", options.pricingKind],
|
|
12889
|
+
["kind", options.kind]
|
|
12890
|
+
]) {
|
|
12891
|
+
if (value !== void 0) parameters.set(name, value);
|
|
12892
|
+
}
|
|
12893
|
+
const query = parameters.toString();
|
|
12894
|
+
return `v1/account/${path}${query ? `?${query}` : ""}`;
|
|
12895
|
+
}
|
|
12879
12896
|
async function read(endpoint, getTransport3) {
|
|
12880
12897
|
try {
|
|
12881
12898
|
ok(await getTransport3().getBusiness(endpoint, { retries: 1 }));
|
|
@@ -12885,9 +12902,9 @@ async function read(endpoint, getTransport3) {
|
|
|
12885
12902
|
}
|
|
12886
12903
|
function registerAccountCommands(program2, getTransport3) {
|
|
12887
12904
|
const account = program2.command("account").description("Read your Actionway USD wallet, service usage, and wallet transactions.");
|
|
12888
|
-
account.command("usage").description("
|
|
12905
|
+
account.command("usage").description("Query held, charged, released, and free capability calls.").option("--limit <count>", "Maximum records in this page (1-100).").option("--cursor <cursor>", "Opaque nextCursor returned by the previous page.").option("--from <date>", "Inclusive ISO date or timestamp (UTC for date-only values).").option("--to <date>", "Exclusive ISO date or timestamp (UTC for date-only values).").option("--status <status>", "held, settled, or expired.").option("--service <service-id>", "Exact public serviceId.").option("--pricing-kind <kind>", "priced or free.").action((options) => read(accountEndpoint("usage", options), getTransport3));
|
|
12889
12906
|
account.command("wallet").description("Show the current available and held Actionway USD wallet balance.").action(() => read("v1/account/wallet", getTransport3));
|
|
12890
|
-
account.command("transactions").description("
|
|
12907
|
+
account.command("transactions").description("Query wallet top-ups, charges, promotions, refunds, and other fund movements.").option("--limit <count>", "Maximum records in this page (1-50).").option("--cursor <cursor>", "Opaque nextCursor returned by the previous page.").option("--from <date>", "Inclusive ISO date or timestamp (UTC for date-only values).").option("--to <date>", "Exclusive ISO date or timestamp (UTC for date-only values).").option("--status <status>", "pending, succeeded, or failed.").option("--kind <kind>", "top_up, charge, refund, dispute, or promotion kind.").action((options) => read(accountEndpoint("transactions", options), getTransport3));
|
|
12891
12908
|
}
|
|
12892
12909
|
|
|
12893
12910
|
// src/lib/install-session.ts
|
package/package.json
CHANGED