@tarout/cli 0.7.0 → 0.7.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/index.js +27 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import { Command } from "commander";
|
|
|
61
61
|
// package.json
|
|
62
62
|
var package_default = {
|
|
63
63
|
name: "@tarout/cli",
|
|
64
|
-
version: "0.7.
|
|
64
|
+
version: "0.7.1",
|
|
65
65
|
description: "Tarout CLI \u2014 the Saudi cloud platform for coding agents",
|
|
66
66
|
type: "module",
|
|
67
67
|
bin: {
|
|
@@ -7286,9 +7286,30 @@ async function createAppFromCurrentDirectory(client, profile, options = {}) {
|
|
|
7286
7286
|
sourceType: application.sourceType
|
|
7287
7287
|
};
|
|
7288
7288
|
}
|
|
7289
|
+
async function isOrgPaidSafely(client) {
|
|
7290
|
+
try {
|
|
7291
|
+
const opts = await client.application.getCreateOptions.query();
|
|
7292
|
+
return opts?.isPaid === true;
|
|
7293
|
+
} catch {
|
|
7294
|
+
return false;
|
|
7295
|
+
}
|
|
7296
|
+
}
|
|
7289
7297
|
async function resolveAppPlanForCreate(client, options) {
|
|
7290
7298
|
const explicitPlan = normalizeAppPlan(options.plan);
|
|
7291
|
-
if (explicitPlan) return explicitPlan;
|
|
7299
|
+
if (explicitPlan && explicitPlan !== "FREE") return explicitPlan;
|
|
7300
|
+
if (explicitPlan === "FREE") {
|
|
7301
|
+
if (await isOrgPaidSafely(client)) {
|
|
7302
|
+
if (!isJsonMode()) {
|
|
7303
|
+
log(
|
|
7304
|
+
colors.dim(
|
|
7305
|
+
"Your org is on a paid plan \u2014 free apps aren't available, so this app will use your paid tier."
|
|
7306
|
+
)
|
|
7307
|
+
);
|
|
7308
|
+
}
|
|
7309
|
+
return void 0;
|
|
7310
|
+
}
|
|
7311
|
+
return "FREE";
|
|
7312
|
+
}
|
|
7292
7313
|
if (isJsonMode() || shouldSkipConfirmation()) return void 0;
|
|
7293
7314
|
let createOptions;
|
|
7294
7315
|
try {
|
|
@@ -19244,7 +19265,10 @@ function registerUpCommand(program2) {
|
|
|
19244
19265
|
).option(
|
|
19245
19266
|
"--api-url <url>",
|
|
19246
19267
|
"Custom API URL (defaults to saved profile or https://tarout.sa)"
|
|
19247
|
-
).option("--token <token>", "API token for this run").option("--name <name>", "Application name (defaults to directory name)").option(
|
|
19268
|
+
).option("--token <token>", "API token for this run").option("--name <name>", "Application name (defaults to directory name)").option(
|
|
19269
|
+
"--plan <plan>",
|
|
19270
|
+
"App hosting plan: free, shared, or dedicated (defaults to your org's tier)"
|
|
19271
|
+
).option("--source <source>", "Source: upload (default) or github", "upload").option(
|
|
19248
19272
|
"--app <ref>",
|
|
19249
19273
|
"Deploy to an existing app by id or name (skips create-or-pick prompt; 'auto' picks the lone match)"
|
|
19250
19274
|
).option(
|