@manturhub/cli 0.10.0 → 0.10.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/bin/cli.js +15 -1
- package/lib/api.js +1 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -336,6 +336,20 @@ async function main() {
|
|
|
336
336
|
console.error(error.message);
|
|
337
337
|
process.exit(1);
|
|
338
338
|
}
|
|
339
|
+
if (operator.billing_mode === "internal_free") {
|
|
340
|
+
const free = {
|
|
341
|
+
operator_id: operator.id,
|
|
342
|
+
billing_mode: "internal_free",
|
|
343
|
+
estimated_dumplings: 0,
|
|
344
|
+
formula: "内部管理员只读查询,不扣馒头",
|
|
345
|
+
};
|
|
346
|
+
console.log(
|
|
347
|
+
args.includes("--json")
|
|
348
|
+
? JSON.stringify(free, null, 2)
|
|
349
|
+
: `${operator.name}: 内部管理员只读查询,不扣馒头`
|
|
350
|
+
);
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
339
353
|
const r = await apiFetch(`/api/v1/operators/${encodeURIComponent(operator.id)}/quote`, { auth: "optional" });
|
|
340
354
|
if (!r.ok) {
|
|
341
355
|
console.error(`查询价格失败(HTTP ${r.status}): ${JSON.stringify(r.json)}`);
|
|
@@ -420,7 +434,7 @@ async function main() {
|
|
|
420
434
|
process.exit(1);
|
|
421
435
|
}
|
|
422
436
|
let quoteId = getFlag("confirm");
|
|
423
|
-
if (!quoteId) {
|
|
437
|
+
if (!quoteId && operator.billing_mode !== "internal_free") {
|
|
424
438
|
const quote = await apiFetch(`/api/v1/operators/${encodeURIComponent(operatorId)}/quote`, {
|
|
425
439
|
method: "POST",
|
|
426
440
|
body,
|
package/lib/api.js
CHANGED