neon 8.0.5 → 8.0.7
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/auth.js +1 -1
- package/dist/commands/config.js +90 -5
- package/package.json +2 -2
package/dist/commands/auth.js
CHANGED
|
@@ -132,7 +132,7 @@ const authFlow = async ({ configDir, oauthHost, clientId, apiHost, forceAuth, "f
|
|
|
132
132
|
}
|
|
133
133
|
log.info("Saved profile \"%s\" (%s)", profileName, at.storage === "keyring" ? KEYRING_CREDENTIALS : at.path);
|
|
134
134
|
}
|
|
135
|
-
log.info(
|
|
135
|
+
log.info(`Auth complete (profile ${profileName})`);
|
|
136
136
|
return tokenSet.access_token || "";
|
|
137
137
|
};
|
|
138
138
|
/**
|
package/dist/commands/config.js
CHANGED
|
@@ -559,11 +559,96 @@ const status = async (props) => {
|
|
|
559
559
|
process.stdout.write(`${JSON.stringify(configView, null, 2)}\n`);
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
562
|
+
if (props.output !== "table") {
|
|
563
|
+
writer(props).end({
|
|
564
|
+
project: live.project,
|
|
565
|
+
branch: live.branch,
|
|
566
|
+
config: configView
|
|
567
|
+
}, { fields: INSPECT_FIELDS });
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
writeStatusTables(props, live, configView);
|
|
571
|
+
};
|
|
572
|
+
const STATUS_FIELDS = [
|
|
573
|
+
"project",
|
|
574
|
+
"region",
|
|
575
|
+
"postgres_version",
|
|
576
|
+
"organization",
|
|
577
|
+
"branch",
|
|
578
|
+
"parent",
|
|
579
|
+
"default",
|
|
580
|
+
"protected",
|
|
581
|
+
"expires_at",
|
|
582
|
+
"auth",
|
|
583
|
+
"data_api",
|
|
584
|
+
"compute",
|
|
585
|
+
"scale_to_zero",
|
|
586
|
+
"ttl"
|
|
587
|
+
];
|
|
588
|
+
const formatComputeUnits = (settings) => {
|
|
589
|
+
const min = settings?.autoscalingLimitMinCu;
|
|
590
|
+
const max = settings?.autoscalingLimitMaxCu;
|
|
591
|
+
if (min === void 0 && max === void 0) return void 0;
|
|
592
|
+
if (min === void 0) return `max ${max} CU`;
|
|
593
|
+
if (max === void 0) return `min ${min} CU`;
|
|
594
|
+
return min === max ? `${min} CU` : `${min}-${max} CU`;
|
|
595
|
+
};
|
|
596
|
+
/** Human `status`: one summary block, then a table per reported resource kind. */
|
|
597
|
+
const writeStatusTables = (props, live, view) => {
|
|
598
|
+
const compute = view.branch?.postgres?.computeSettings;
|
|
599
|
+
const suspend = compute?.suspendTimeout;
|
|
600
|
+
const out = writer(props);
|
|
601
|
+
out.write({
|
|
602
|
+
project: `${live.project.name} (${live.project.id})`,
|
|
603
|
+
region: live.project.region,
|
|
604
|
+
postgres_version: live.project.pgVersion,
|
|
605
|
+
organization: live.project.orgId,
|
|
606
|
+
branch: `${live.branch.name} (${live.branch.id})`,
|
|
607
|
+
parent: live.branch.parent,
|
|
608
|
+
default: live.branch.isDefault ? "yes" : "no",
|
|
609
|
+
protected: live.branch.protected ? "yes" : "no",
|
|
610
|
+
expires_at: live.branch.expiresAt,
|
|
611
|
+
auth: view.auth ? "enabled" : void 0,
|
|
612
|
+
data_api: view.dataApi ? "enabled" : void 0,
|
|
613
|
+
compute: formatComputeUnits(compute),
|
|
614
|
+
scale_to_zero: suspend === void 0 ? void 0 : suspend === false ? "off" : String(suspend),
|
|
615
|
+
ttl: view.branch?.ttl
|
|
616
|
+
}, {
|
|
617
|
+
fields: STATUS_FIELDS,
|
|
618
|
+
humanTitle: "Status"
|
|
619
|
+
});
|
|
620
|
+
const functions = Object.entries(view.preview?.functions ?? {}).map(([slug, fn]) => ({
|
|
621
|
+
slug,
|
|
622
|
+
name: fn.name
|
|
623
|
+
}));
|
|
624
|
+
if (functions.length > 0) out.write(functions, {
|
|
625
|
+
fields: ["slug", "name"],
|
|
626
|
+
humanTitle: "Functions"
|
|
627
|
+
});
|
|
628
|
+
const buckets = Object.entries(view.preview?.buckets ?? {}).map(([name, bucket]) => ({
|
|
629
|
+
name,
|
|
630
|
+
access: bucket.access
|
|
631
|
+
}));
|
|
632
|
+
if (buckets.length > 0) out.write(buckets, {
|
|
633
|
+
fields: ["name", "access"],
|
|
634
|
+
humanTitle: "Buckets"
|
|
635
|
+
});
|
|
636
|
+
const credentials = (view.preview?.credentials ?? []).map((credential) => ({
|
|
637
|
+
id: credential.id,
|
|
638
|
+
name: credential.name,
|
|
639
|
+
scopes: credential.scopes.join(", "),
|
|
640
|
+
last_used_at: credential.lastUsedAt
|
|
641
|
+
}));
|
|
642
|
+
if (credentials.length > 0) out.write(credentials, {
|
|
643
|
+
fields: [
|
|
644
|
+
"id",
|
|
645
|
+
"name",
|
|
646
|
+
"scopes",
|
|
647
|
+
"last_used_at"
|
|
648
|
+
],
|
|
649
|
+
humanTitle: "Credentials"
|
|
650
|
+
});
|
|
651
|
+
out.end();
|
|
567
652
|
};
|
|
568
653
|
const planCmd = async (props) => {
|
|
569
654
|
const config = await loadConfig(props);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.7",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"yaml": "^2.9.0",
|
|
65
65
|
"yargs": "17.7.2",
|
|
66
66
|
"yoctocolors": "^2.1.2",
|
|
67
|
-
"@neon/config-runtime": "1.7.
|
|
67
|
+
"@neon/config-runtime": "1.7.4",
|
|
68
68
|
"@neon/sdk": "7.0.0",
|
|
69
69
|
"@neon/config": "1.8.3"
|
|
70
70
|
},
|