neon 7.0.7 → 7.0.8

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.
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
2
2
  import { retryOnLock } from "../api.js";
3
3
  import { writer } from "../writer.js";
4
- import { branchIdFromProps, fillSingleProject } from "../utils/enrichers.js";
4
+ import { fillSingleProject, resolveBranchFromProps } from "../utils/enrichers.js";
5
5
  //#region src/commands/databases.ts
6
6
  var databases_exports = /* @__PURE__ */ __exportAll({
7
7
  DATABASE_FIELDS: () => DATABASE_FIELDS,
@@ -46,12 +46,17 @@ const handler = (args) => {
46
46
  return args;
47
47
  };
48
48
  const list = async (props) => {
49
- const branchId = await branchIdFromProps(props);
49
+ const { branchId, branch } = await resolveBranchFromProps(props);
50
50
  const { data } = await props.apiClient.listProjectBranchDatabases(props.projectId, branchId);
51
- writer(props).end(data.databases, { fields: DATABASE_FIELDS });
51
+ const branchLabel = branch?.name ?? branchId;
52
+ writer(props).end(data.databases, {
53
+ fields: DATABASE_FIELDS,
54
+ humanTitle: `Databases on ${branchLabel}`,
55
+ emptyMessage: `No databases on ${branchLabel}.`
56
+ });
52
57
  };
53
58
  const create = async (props) => {
54
- const branchId = await branchIdFromProps(props);
59
+ const { branchId, branch } = await resolveBranchFromProps(props);
55
60
  const owner = props.ownerName ?? await props.apiClient.listProjectBranchRoles(props.projectId, branchId).then(({ data }) => {
56
61
  if (data.roles.length === 0) throw new Error(`No roles found in branch ${branchId}`);
57
62
  if (data.roles.length > 1) throw new Error(`More than one role found in branch ${branchId}. Please specify the owner name. Roles: ${data.roles.map((r) => r.name).join(", ")}`);
@@ -62,12 +67,18 @@ const create = async (props) => {
62
67
  name: props.name,
63
68
  owner_name: owner
64
69
  } }));
65
- writer(props).end(data.database, { fields: DATABASE_FIELDS });
70
+ writer(props).end(data.database, {
71
+ fields: DATABASE_FIELDS,
72
+ humanTitle: `Database created on ${branch?.name ?? branchId}`
73
+ });
66
74
  };
67
75
  const deleteDb = async (props) => {
68
- const branchId = await branchIdFromProps(props);
76
+ const { branchId, branch } = await resolveBranchFromProps(props);
69
77
  const { data } = await retryOnLock(() => props.apiClient.deleteProjectBranchDatabase(props.projectId, branchId, props.database));
70
- if (data) writer(props).end(data.database, { fields: DATABASE_FIELDS });
78
+ if (data) writer(props).end(data.database, {
79
+ fields: DATABASE_FIELDS,
80
+ humanTitle: `Database deleted from ${branch?.name ?? branchId}`
81
+ });
71
82
  };
72
83
  //#endregion
73
84
  export { DATABASE_FIELDS, aliases, builder, command, create, deleteDb, describe, handler, list, databases_exports as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "7.0.7",
3
+ "version": "7.0.8",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -99,10 +99,10 @@
99
99
  "tsx": "4.22.3",
100
100
  "typescript": "^5.9.0",
101
101
  "vitest": "^3.0.9",
102
- "@neon-internals/cli-core": "0.0.0",
103
102
  "@neon-internals/env-core": "0.0.26",
104
103
  "@neon/e2e-harness": "0.0.0",
105
- "@neon/functions": "0.11.0"
104
+ "@neon/functions": "0.11.0",
105
+ "@neon-internals/cli-core": "0.0.0"
106
106
  },
107
107
  "publishConfig": {
108
108
  "access": "public",