@somewhere-tech/cli 0.33.6 → 0.33.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/postgres.js +479 -0
- package/dist/commands/postgres.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import { ApiClient, CliApiError } from '../lib/client.js';
|
|
4
|
+
import { getToken } from '../lib/config.js';
|
|
5
|
+
import { resolveProjectRef } from '../lib/platform-command.js';
|
|
6
|
+
import { dim, error, info, printJson, printJsonError, success, teal, warn } from '../lib/output.js';
|
|
7
|
+
/**
|
|
8
|
+
* `somewhere postgres` — bind the developer's OWN Neon database to a project.
|
|
9
|
+
*
|
|
10
|
+
* Pass-through, not managed: the developer owns the Neon account and pays Neon
|
|
11
|
+
* directly. The platform stores the credentials and exposes the attached
|
|
12
|
+
* database to deployed functions as `sw.postgres`, which IS the official
|
|
13
|
+
* `@neondatabase/serverless` driver callable — this CLI never describes it as
|
|
14
|
+
* anything else and never adds a query surface of its own.
|
|
15
|
+
*
|
|
16
|
+
* Field names mirror `worker/src/routes/postgres.ts` exactly
|
|
17
|
+
* (`provider_project_id`, `branch_id`, `database`, `role`, `requires_redeploy`,
|
|
18
|
+
* `note`). The CLI publishes no aliases of its own: an alias here is a second
|
|
19
|
+
* name for the same thing that drifts the first time the route changes.
|
|
20
|
+
*
|
|
21
|
+
* Two rules shape every command below:
|
|
22
|
+
*
|
|
23
|
+
* 1. The Neon management key can delete the developer's databases. It is read
|
|
24
|
+
* from the environment, from stdin, or from a hidden prompt — never from
|
|
25
|
+
* argv, where it would be visible in the process table and in shell
|
|
26
|
+
* history. It is sent once and never written to the CLI config.
|
|
27
|
+
* 2. Nothing that could carry a connection string or a key is printed. Human
|
|
28
|
+
* output reads an explicit allowlist of fields; the route already redacts
|
|
29
|
+
* the host and never returns either credential.
|
|
30
|
+
*
|
|
31
|
+
* Connection is by API key. There is no browser account-connect flow to offer
|
|
32
|
+
* because Neon restricts OAuth to registered commercial partners — a design
|
|
33
|
+
* constraint worth recording here, and not worth spending a customer's help
|
|
34
|
+
* text on.
|
|
35
|
+
*/
|
|
36
|
+
/** The env var `connect` reads the Neon management key from, mirroring
|
|
37
|
+
* SOMEWHERE_TOKEN for `somewhere auth set`. */
|
|
38
|
+
const NEON_KEY_ENV = 'SOMEWHERE_NEON_API_KEY';
|
|
39
|
+
const NEON_KEY_DOCS = 'https://neon.com/docs/manage/api-keys';
|
|
40
|
+
const KEY_SOURCE_HELP = `The Neon API key is read from ${NEON_KEY_ENV}, from stdin, or from a hidden prompt — ` +
|
|
41
|
+
'never from an argument, where it would be visible in the process table. ' +
|
|
42
|
+
'It is stored encrypted by the platform and never saved in your CLI config.';
|
|
43
|
+
/** Fallback for a route that reports `requires_redeploy` without a `note`.
|
|
44
|
+
* When the route sends its own note, that text wins — one sentence, written
|
|
45
|
+
* once, server-side, so the CLI cannot drift from it. */
|
|
46
|
+
const REDEPLOY_NOTICE = 'Takes effect on the next deploy. Releases already deployed keep the connection details they were built with.';
|
|
47
|
+
/**
|
|
48
|
+
* Reconciliation, not retry.
|
|
49
|
+
*
|
|
50
|
+
* Neon's POST /projects takes no idempotency key and does not enforce name
|
|
51
|
+
* uniqueness, so a second attempt spends the developer's money again and
|
|
52
|
+
* leaves an orphan project behind. This is the guidance for both ways an
|
|
53
|
+
* outcome can be unknown: the route answering POSTGRES_CREATE_UNCERTAIN, and
|
|
54
|
+
* no HTTP answer arriving at all.
|
|
55
|
+
*/
|
|
56
|
+
const CREATE_RECONCILE_GUIDANCE = [
|
|
57
|
+
'Do NOT run create again — Neon does not de-duplicate project creation, so a second attempt can bill you twice and leave a database you never asked for.',
|
|
58
|
+
'Run `somewhere postgres status` to see what the platform recorded.',
|
|
59
|
+
'Check your Neon account for a project matching this request; if one exists, bind it with `somewhere postgres attach <neon-project-id>`.',
|
|
60
|
+
];
|
|
61
|
+
const CREATE_UNCERTAIN = 'POSTGRES_CREATE_UNCERTAIN';
|
|
62
|
+
function str(value) {
|
|
63
|
+
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
64
|
+
}
|
|
65
|
+
/** Read the Neon management key without it ever passing through argv. */
|
|
66
|
+
async function readNeonApiKey() {
|
|
67
|
+
const fromEnv = process.env[NEON_KEY_ENV]?.trim();
|
|
68
|
+
if (fromEnv)
|
|
69
|
+
return fromEnv;
|
|
70
|
+
if (!process.stdin.isTTY) {
|
|
71
|
+
// fd 0 directly: the same one-shot read `somewhere auth set` uses for a token.
|
|
72
|
+
return readFileSync(0, 'utf8').trim();
|
|
73
|
+
}
|
|
74
|
+
const response = await prompts({
|
|
75
|
+
type: 'password',
|
|
76
|
+
name: 'key',
|
|
77
|
+
message: 'Neon API key',
|
|
78
|
+
});
|
|
79
|
+
return typeof response.key === 'string' ? response.key.trim() : '';
|
|
80
|
+
}
|
|
81
|
+
/** A padded `label value` line, matching the alignment `auth status` uses. */
|
|
82
|
+
function field(label, value) {
|
|
83
|
+
info(`${label.padEnd(14)}${value}`);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Say what happens next, in the route's own words when it supplies them.
|
|
87
|
+
*
|
|
88
|
+
* `note` is the single sentence the routes share for "existing releases keep
|
|
89
|
+
* what they were built with". Printing it rather than a local paraphrase is
|
|
90
|
+
* what keeps the CLI from making a revocation claim the platform does not.
|
|
91
|
+
*/
|
|
92
|
+
function printNote(result) {
|
|
93
|
+
// The shared note is about what the NEXT deploy picks up. `disconnect` sends
|
|
94
|
+
// it unconditionally but reports requires_redeploy:false when it detached
|
|
95
|
+
// nothing — clearing a stuck create changes no release, so printing "takes
|
|
96
|
+
// effect on the next deploy" there would describe work that does not exist.
|
|
97
|
+
if (result.requires_redeploy === false)
|
|
98
|
+
return;
|
|
99
|
+
const note = str(result.note);
|
|
100
|
+
if (note) {
|
|
101
|
+
warn(note);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (result.requires_redeploy === true)
|
|
105
|
+
warn(REDEPLOY_NOTICE);
|
|
106
|
+
}
|
|
107
|
+
function reportError(err, json) {
|
|
108
|
+
if (err instanceof CliApiError) {
|
|
109
|
+
const uncertain = err.code === CREATE_UNCERTAIN;
|
|
110
|
+
if (json) {
|
|
111
|
+
printJsonError(err.code, err.message, {
|
|
112
|
+
...(err.hint ? { hint: err.hint } : {}),
|
|
113
|
+
// An agent reading --json must see "do not retry" without parsing prose.
|
|
114
|
+
...(uncertain ? { outcome: 'unknown', guidance: CREATE_RECONCILE_GUIDANCE } : {}),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
error(`${err.code}: ${err.message}`);
|
|
119
|
+
if (err.hint)
|
|
120
|
+
info(dim(err.hint));
|
|
121
|
+
if (uncertain)
|
|
122
|
+
for (const line of CREATE_RECONCILE_GUIDANCE)
|
|
123
|
+
info(dim(line));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
128
|
+
if (json)
|
|
129
|
+
printJsonError('CLI_ERROR', message);
|
|
130
|
+
else
|
|
131
|
+
error(message);
|
|
132
|
+
}
|
|
133
|
+
process.exitCode = 1;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The first sentence of a transport failure — what happened, without the advice.
|
|
137
|
+
*
|
|
138
|
+
* The client's NETWORK_ERROR/TIMEOUT/SERVER_SLOW messages all open by naming
|
|
139
|
+
* the endpoint and the cause and then close by telling the caller to retry.
|
|
140
|
+
* That tail is correct for a read and wrong for provisioning, so the create
|
|
141
|
+
* path keeps the diagnosis and drops the advice rather than printing both and
|
|
142
|
+
* contradicting itself.
|
|
143
|
+
*/
|
|
144
|
+
function transportDetail(message) {
|
|
145
|
+
return /^(.*?\.)\s/.exec(message)?.[1] ?? message;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* A create whose failure does not prove the database was not created.
|
|
149
|
+
*
|
|
150
|
+
* Two shapes qualify, and neither is a definite "no":
|
|
151
|
+
*
|
|
152
|
+
* - `statusCode === 0` — the client's marker for "no response received": a
|
|
153
|
+
* timeout, a dropped connection. The request may have reached Neon and
|
|
154
|
+
* provisioned a database nobody can see yet.
|
|
155
|
+
* - Any 5xx. A gateway can answer 500/502/503/504 for a POST the origin
|
|
156
|
+
* already committed, so the failure is the *answer* going missing, not the
|
|
157
|
+
* work. That covers the platform's own POSTGRES_PROVIDER_ERROR too: the
|
|
158
|
+
* provider having errored is not evidence it created nothing.
|
|
159
|
+
*
|
|
160
|
+
* The error's own code is kept rather than relabelled as the route's
|
|
161
|
+
* POSTGRES_CREATE_UNCERTAIN — that is the route's verdict to give, and in
|
|
162
|
+
* these cases the route either never answered or answered something else.
|
|
163
|
+
* What the CLI adds is the outcome being unknown and guidance that
|
|
164
|
+
* reconciles rather than retries. It never claims a database WAS created.
|
|
165
|
+
*
|
|
166
|
+
* 4xx answers are left definite: validation, auth, owner-role and refusals are
|
|
167
|
+
* the server saying it did not act, and calling them uncertain would send
|
|
168
|
+
* someone hunting through their Neon account for nothing.
|
|
169
|
+
*/
|
|
170
|
+
function isAmbiguousCreateOutcome(err) {
|
|
171
|
+
return err.statusCode === 0 || err.statusCode >= 500;
|
|
172
|
+
}
|
|
173
|
+
function reportAmbiguousCreateOutcome(err, json) {
|
|
174
|
+
// A client-synthesized transport message closes with retry advice that is
|
|
175
|
+
// wrong here, so only its first sentence survives. A 5xx message came from
|
|
176
|
+
// the platform, is already specific about what failed, and is kept whole.
|
|
177
|
+
const detail = err.statusCode === 0 ? transportDetail(err.message) : err.message;
|
|
178
|
+
const message = 'The create request did not return a usable result, so a Neon database may or may not have been created. ' +
|
|
179
|
+
`The outcome is unknown, not failed. (${detail})`;
|
|
180
|
+
if (json) {
|
|
181
|
+
printJsonError(err.code, message, { outcome: 'unknown', guidance: CREATE_RECONCILE_GUIDANCE });
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
error(`${err.code}: ${message}`);
|
|
185
|
+
for (const line of CREATE_RECONCILE_GUIDANCE)
|
|
186
|
+
info(dim(line));
|
|
187
|
+
}
|
|
188
|
+
process.exitCode = 1;
|
|
189
|
+
}
|
|
190
|
+
/** Confirm an action that has a cost or a consequence, the way `git disconnect` does. */
|
|
191
|
+
async function confirm(message, skip, flagHint) {
|
|
192
|
+
if (skip)
|
|
193
|
+
return true;
|
|
194
|
+
if (!process.stdin.isTTY)
|
|
195
|
+
throw new Error(flagHint);
|
|
196
|
+
const answer = await prompts({ type: 'confirm', name: 'ok', message, initial: false });
|
|
197
|
+
return answer.ok === true;
|
|
198
|
+
}
|
|
199
|
+
export function registerPostgres(program) {
|
|
200
|
+
const postgres = program
|
|
201
|
+
.command('postgres')
|
|
202
|
+
.description('Attach your own Neon Postgres database to a project (sw.postgres)')
|
|
203
|
+
.addHelpText('after', '\nYou own the Neon account and pay Neon directly. Somewhere passes the connection through:\n' +
|
|
204
|
+
'in a deployed function, sw.postgres is the official @neondatabase/serverless driver callable,\n' +
|
|
205
|
+
"with the driver's own behavior and errors.\n" +
|
|
206
|
+
`\nConnect using a Neon API key: ${NEON_KEY_DOCS}\n` +
|
|
207
|
+
'\nExamples:\n' +
|
|
208
|
+
' printf %s "$NEON_API_KEY" | somewhere postgres connect --project my-app\n' +
|
|
209
|
+
' somewhere postgres attach <neon-project-id> --project my-app\n' +
|
|
210
|
+
' somewhere postgres status --project my-app\n');
|
|
211
|
+
postgres
|
|
212
|
+
.command('connect')
|
|
213
|
+
.description('Store your Neon API key for a project (the key is never passed as an argument)')
|
|
214
|
+
.option('-p, --project <id-or-slug>', 'Project ID or slug; defaults to the linked project')
|
|
215
|
+
.option('--neon-project <id>', 'Verify the key against this Neon project instead of the whole account — required for a project-scoped key')
|
|
216
|
+
.option('--json', 'Print the complete response as JSON')
|
|
217
|
+
.allowExcessArguments(false)
|
|
218
|
+
.addHelpText('after', `\n${KEY_SOURCE_HELP}\n` +
|
|
219
|
+
`\nCreate a Neon API key: ${NEON_KEY_DOCS}\n` +
|
|
220
|
+
'\nThe key is checked against the work it will do. An account-scoped key is verified by\n' +
|
|
221
|
+
'listing your Neon projects; a project-scoped key cannot list them, so pass --neon-project\n' +
|
|
222
|
+
'<id> and it is verified by reading that project instead.\n')
|
|
223
|
+
.showHelpAfterError('Do not pass the Neon API key as an argument — it is visible in the process table. ' +
|
|
224
|
+
`Use \`printf %s "$NEON_API_KEY" | somewhere postgres connect\` or set ${NEON_KEY_ENV}.`)
|
|
225
|
+
.action(async (opts) => {
|
|
226
|
+
try {
|
|
227
|
+
const projectId = resolveProjectRef(opts.project);
|
|
228
|
+
const apiKey = await readNeonApiKey();
|
|
229
|
+
if (!apiKey)
|
|
230
|
+
throw new Error(`No Neon API key supplied. ${KEY_SOURCE_HELP}`);
|
|
231
|
+
const client = new ApiClient(getToken());
|
|
232
|
+
const result = await client.call('POST', '/postgres/connect', {
|
|
233
|
+
project_id: projectId,
|
|
234
|
+
api_key: apiKey,
|
|
235
|
+
...(opts.neonProject === undefined ? {} : { provider_project_id: opts.neonProject }),
|
|
236
|
+
});
|
|
237
|
+
if (opts.json) {
|
|
238
|
+
printJson(result);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
success(`Neon account connected to ${teal(projectId)}.`);
|
|
242
|
+
info(dim('The key is stored encrypted by the platform. It is not saved in your CLI config.'));
|
|
243
|
+
printNote(result);
|
|
244
|
+
info(dim('Next: `somewhere postgres attach <neon-project-id>` for a database you already have, ' +
|
|
245
|
+
'or `somewhere postgres create` to make one in your Neon account.'));
|
|
246
|
+
}
|
|
247
|
+
catch (err) {
|
|
248
|
+
reportError(err, opts.json);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
postgres
|
|
252
|
+
.command('attach <neon-project-id>')
|
|
253
|
+
.description('Bind an existing Neon project to this project (never creates one)')
|
|
254
|
+
.option('-p, --project <id-or-slug>', 'Project ID or slug; defaults to the linked project')
|
|
255
|
+
.option('--database <name>', 'Database to connect to; required when the branch has more than one')
|
|
256
|
+
.option('--role <name>', 'Neon role to connect as; required when the branch has more than one')
|
|
257
|
+
.option('--branch <id>', 'Neon branch ID; defaults to the branch Neon marks default')
|
|
258
|
+
.option('--no-pooled', "Connect directly instead of through Neon's connection pooler")
|
|
259
|
+
.option('--json', 'Print the complete response as JSON')
|
|
260
|
+
.addHelpText('after', '\nBranch, database and role are chosen explicitly. When Neon offers several and you named\n' +
|
|
261
|
+
'none, the platform refuses and lists them rather than binding whichever sorted first.\n' +
|
|
262
|
+
'Attaching never resets a role password, because that would break anything else using it.\n' +
|
|
263
|
+
'\nConnections go through Neon\'s pooler by default. Pass --no-pooled for a direct connection\n' +
|
|
264
|
+
'when you need session-level features the pooler does not carry.\n')
|
|
265
|
+
.action(async (neonProjectId, opts) => {
|
|
266
|
+
try {
|
|
267
|
+
const projectId = resolveProjectRef(opts.project);
|
|
268
|
+
const client = new ApiClient(getToken());
|
|
269
|
+
const result = await client.call('POST', '/postgres/attach', {
|
|
270
|
+
project_id: projectId,
|
|
271
|
+
provider_project_id: neonProjectId,
|
|
272
|
+
...(opts.database === undefined ? {} : { database: opts.database }),
|
|
273
|
+
...(opts.role === undefined ? {} : { role: opts.role }),
|
|
274
|
+
...(opts.branch === undefined ? {} : { branch_id: opts.branch }),
|
|
275
|
+
// Commander defaults a --no-x flag to true, so only an explicit
|
|
276
|
+
// --no-pooled is sent; the platform owns the pooled default.
|
|
277
|
+
...(opts.pooled === false ? { pooled: false } : {}),
|
|
278
|
+
});
|
|
279
|
+
if (opts.json) {
|
|
280
|
+
printJson(result);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
success(`Attached Neon project ${teal(str(result.provider_project_id) ?? neonProjectId)} to ${projectId}.`);
|
|
284
|
+
const database = str(result.database);
|
|
285
|
+
if (database)
|
|
286
|
+
field('Database:', database);
|
|
287
|
+
const role = str(result.role);
|
|
288
|
+
if (role)
|
|
289
|
+
field('Role:', role);
|
|
290
|
+
const branchId = str(result.branch_id);
|
|
291
|
+
if (branchId)
|
|
292
|
+
field('Branch:', branchId);
|
|
293
|
+
const host = str(result.host);
|
|
294
|
+
if (host)
|
|
295
|
+
field('Host:', host);
|
|
296
|
+
printNote(result);
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
// A failed attach stops here. It never becomes a create: creating a
|
|
300
|
+
// database the developer did not ask for spends their money.
|
|
301
|
+
reportError(err, opts.json);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
postgres
|
|
305
|
+
.command('create')
|
|
306
|
+
.description('Create a new Neon project in YOUR Neon account and attach it (billed by Neon to you)')
|
|
307
|
+
.option('-p, --project <id-or-slug>', 'Project ID or slug; defaults to the linked project')
|
|
308
|
+
.option('--name <name>', 'Name for the new Neon project')
|
|
309
|
+
.option('--region <region>', 'Neon region, e.g. aws-us-east-2')
|
|
310
|
+
.option('-y, --yes', 'Create without confirming')
|
|
311
|
+
.option('--json', 'Print the complete response as JSON')
|
|
312
|
+
.addHelpText('after', '\nThis creates a real database in your own Neon account and Neon bills you for it.\n' +
|
|
313
|
+
'Creation is never automatic: a failed `attach` does not fall back to this command.\n' +
|
|
314
|
+
'If the outcome is reported as unknown, do NOT run it again — Neon does not de-duplicate\n' +
|
|
315
|
+
'project creation. Run `somewhere postgres status` and check your Neon account instead.\n')
|
|
316
|
+
.action(async (opts) => {
|
|
317
|
+
try {
|
|
318
|
+
const projectId = resolveProjectRef(opts.project);
|
|
319
|
+
const ok = await confirm('Create a new Neon project in your Neon account? Neon bills you for it.', opts.yes, 'Pass --yes to create a Neon project in a non-interactive shell. Neon bills you for it.');
|
|
320
|
+
if (!ok) {
|
|
321
|
+
if (!opts.json)
|
|
322
|
+
warn('Aborted — nothing was created.');
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const client = new ApiClient(getToken());
|
|
326
|
+
const result = await client.call('POST', '/postgres/create', {
|
|
327
|
+
project_id: projectId,
|
|
328
|
+
...(opts.name === undefined ? {} : { name: opts.name }),
|
|
329
|
+
...(opts.region === undefined ? {} : { region: opts.region }),
|
|
330
|
+
});
|
|
331
|
+
if (opts.json) {
|
|
332
|
+
printJson(result);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
success(`Created Neon project ${teal(str(result.provider_project_id) ?? '(id not reported)')} in your Neon account.`);
|
|
336
|
+
const region = str(result.region);
|
|
337
|
+
if (region)
|
|
338
|
+
field('Region:', region);
|
|
339
|
+
const host = str(result.host);
|
|
340
|
+
if (host)
|
|
341
|
+
field('Host:', host);
|
|
342
|
+
info(dim('This database belongs to your Neon account and Neon bills you for it.'));
|
|
343
|
+
printNote(result);
|
|
344
|
+
}
|
|
345
|
+
catch (err) {
|
|
346
|
+
// Never retried. A lost response or a 5xx is reported as an unknown
|
|
347
|
+
// outcome rather than as the generic "safe to try again" failure.
|
|
348
|
+
if (err instanceof CliApiError && isAmbiguousCreateOutcome(err)) {
|
|
349
|
+
reportAmbiguousCreateOutcome(err, opts.json);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
reportError(err, opts.json);
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
postgres
|
|
356
|
+
.command('status')
|
|
357
|
+
.description('Show the Postgres attachment for a project (never prints a key or a connection string)')
|
|
358
|
+
.option('-p, --project <id-or-slug>', 'Project ID or slug; defaults to the linked project')
|
|
359
|
+
.option('--json', 'Print the complete response as JSON')
|
|
360
|
+
.action(async (opts) => {
|
|
361
|
+
try {
|
|
362
|
+
const projectId = resolveProjectRef(opts.project);
|
|
363
|
+
const client = new ApiClient(getToken());
|
|
364
|
+
const result = await client.call('GET', '/postgres/status', undefined, {
|
|
365
|
+
project_id: projectId,
|
|
366
|
+
});
|
|
367
|
+
if (opts.json) {
|
|
368
|
+
printJson(result);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
const connected = result.connected === true;
|
|
372
|
+
const attached = result.attached === true;
|
|
373
|
+
field('Project:', projectId);
|
|
374
|
+
field('Connected:', connected ? 'yes' : `no${dim(' (no Neon API key stored)')}`);
|
|
375
|
+
field('Attached:', attached ? 'yes' : 'no');
|
|
376
|
+
for (const [label, value] of [
|
|
377
|
+
['Provider:', result.provider],
|
|
378
|
+
['Neon project:', result.provider_project_id],
|
|
379
|
+
['Branch:', result.branch_id],
|
|
380
|
+
['Database:', result.database],
|
|
381
|
+
['Role:', result.role],
|
|
382
|
+
['Host:', result.host],
|
|
383
|
+
['State:', result.status],
|
|
384
|
+
['Auth:', result.auth_kind],
|
|
385
|
+
['Last error:', result.last_error],
|
|
386
|
+
['Attached at:', result.attached_at],
|
|
387
|
+
['Updated:', result.updated_at],
|
|
388
|
+
]) {
|
|
389
|
+
const text = str(value);
|
|
390
|
+
if (text)
|
|
391
|
+
field(label, text);
|
|
392
|
+
}
|
|
393
|
+
if (!connected) {
|
|
394
|
+
info(dim(`Run \`somewhere postgres connect\` to store your Neon API key: ${NEON_KEY_DOCS}`));
|
|
395
|
+
}
|
|
396
|
+
else if (!attached) {
|
|
397
|
+
info(dim('Run `somewhere postgres attach <neon-project-id>` or `somewhere postgres create`.'));
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
catch (err) {
|
|
401
|
+
reportError(err, opts.json);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
postgres
|
|
405
|
+
.command('disconnect')
|
|
406
|
+
.description("Remove Somewhere's Postgres attachment (your Neon database is NOT deleted)")
|
|
407
|
+
.option('-p, --project <id-or-slug>', 'Project ID or slug; defaults to the linked project')
|
|
408
|
+
.option('--forget-key', 'Also delete the stored Neon API key, not just the attachment')
|
|
409
|
+
.option('-y, --yes', 'Disconnect without confirming')
|
|
410
|
+
.option('--json', 'Print the complete response as JSON')
|
|
411
|
+
.addHelpText('after', '\nThis removes the attachment on our side. It never calls Neon\'s delete: your database,\n' +
|
|
412
|
+
'its data and its Neon billing continue.\n' +
|
|
413
|
+
'It is also not an immediate cut-off — a release that is already deployed keeps the\n' +
|
|
414
|
+
'connection details it was built with. Rotate the credential in Neon to cut those off.\n' +
|
|
415
|
+
'\nThe stored Neon API key is kept by default, so you can attach again without supplying it.\n' +
|
|
416
|
+
'Pass --forget-key to delete it too; a later attach then needs `somewhere postgres connect` first.\n' +
|
|
417
|
+
'\nDisconnecting also clears a create that never resolved. If that create had already reached\n' +
|
|
418
|
+
'your provider, the id of the database it left behind is printed once here — after this the\n' +
|
|
419
|
+
'platform no longer stores it, and that database keeps billing until you attach or delete it.\n')
|
|
420
|
+
.action(async (opts) => {
|
|
421
|
+
try {
|
|
422
|
+
const projectId = resolveProjectRef(opts.project);
|
|
423
|
+
const ok = await confirm(opts.forgetKey
|
|
424
|
+
? 'Remove the Postgres attachment and delete the stored Neon API key? Your Neon database is not deleted.'
|
|
425
|
+
: 'Remove the Postgres attachment? Your Neon database is not deleted.', opts.yes, 'Pass --yes to disconnect in a non-interactive shell.');
|
|
426
|
+
if (!ok) {
|
|
427
|
+
if (!opts.json)
|
|
428
|
+
warn('Aborted — the attachment is unchanged.');
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const client = new ApiClient(getToken());
|
|
432
|
+
const result = await client.call('POST', '/postgres/disconnect', {
|
|
433
|
+
project_id: projectId,
|
|
434
|
+
...(opts.forgetKey ? { forget_key: true } : {}),
|
|
435
|
+
});
|
|
436
|
+
if (opts.json) {
|
|
437
|
+
printJson(result);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
// Detaching a live database and clearing a create that never resolved
|
|
441
|
+
// are different events, and the route now distinguishes them. Saying
|
|
442
|
+
// "attachment removed" for a project that had nothing attached would
|
|
443
|
+
// describe a detach that did not happen.
|
|
444
|
+
const detached = result.detached === true;
|
|
445
|
+
const clearedPendingCreate = result.cleared_pending_create === true;
|
|
446
|
+
if (detached) {
|
|
447
|
+
success(`Postgres attachment removed for ${teal(projectId)}.`);
|
|
448
|
+
info('Your Neon database was NOT deleted — it and its Neon billing continue.');
|
|
449
|
+
}
|
|
450
|
+
else if (clearedPendingCreate) {
|
|
451
|
+
success(`Cleared an unresolved create for ${teal(projectId)}. No attached database was removed.`);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
success(`Postgres record cleared for ${teal(projectId)}. Nothing was attached.`);
|
|
455
|
+
}
|
|
456
|
+
if (result.key_removed === true)
|
|
457
|
+
info('The stored Neon API key was deleted too.');
|
|
458
|
+
else
|
|
459
|
+
info(dim('The stored Neon API key was kept — pass --forget-key to delete it as well.'));
|
|
460
|
+
// After this the platform no longer stores the id, so this is the last
|
|
461
|
+
// time anything can tell the developer what to reconcile. Printed in
|
|
462
|
+
// normal output, not behind --json: a database they are paying for
|
|
463
|
+
// must not disappear from view because they ran the human command.
|
|
464
|
+
const unresolvedId = str(result.unresolved_provider_project_id);
|
|
465
|
+
if (unresolvedId)
|
|
466
|
+
field('Unresolved:', unresolvedId);
|
|
467
|
+
const unresolvedNote = str(result.unresolved_note);
|
|
468
|
+
if (unresolvedNote)
|
|
469
|
+
warn(unresolvedNote);
|
|
470
|
+
// The route's own sentence about already-deployed releases; never a
|
|
471
|
+
// local paraphrase that could harden into a revocation claim.
|
|
472
|
+
printNote(result);
|
|
473
|
+
}
|
|
474
|
+
catch (err) {
|
|
475
|
+
reportError(err, opts.json);
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=postgres.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../src/commands/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,QAAQ,E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I,CAAC,SAAS,CAAC,qCAAqC,CAAC,CAAC;YACpG,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;YACnF,CAAC;YACD,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI;gBAAE,IAAI,CAAC,0CAA0C,CAAC,CAAC;;gBAC7E,IAAI,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC,CAAC;YAC7F,uEAAuE;YACvE,qEAAqE;YACrE,mEAAmE;YACnE,mEAAmE;YACnE,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC;YAChE,IAAI,YAAY;gBAAE,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;YACrD,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YACnD,IAAI,cAAc;gBAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YACzC,oEAAoE;YACpE,8DAA8D;YAC9D,SAAS,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { registerTypecheck } from './commands/typecheck.js';
|
|
|
12
12
|
import { registerPromote } from './commands/promote.js';
|
|
13
13
|
import { registerRollback } from './commands/rollback.js';
|
|
14
14
|
import { registerDb } from './commands/db.js';
|
|
15
|
+
import { registerPostgres } from './commands/postgres.js';
|
|
15
16
|
import { registerDocs } from './commands/docs.js';
|
|
16
17
|
import { registerAdvisor } from './commands/advisor.js';
|
|
17
18
|
import { registerCatalog } from './commands/catalog.js';
|
|
@@ -72,6 +73,7 @@ registerTypecheck(program);
|
|
|
72
73
|
registerPromote(program);
|
|
73
74
|
registerRollback(program);
|
|
74
75
|
registerDb(program);
|
|
76
|
+
registerPostgres(program);
|
|
75
77
|
registerDocs(program);
|
|
76
78
|
registerAdvisor(program);
|
|
77
79
|
registerCatalog(program);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,W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CAAC"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@somewhere-tech/cli",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@somewhere-tech/cli",
|
|
9
|
-
"version": "0.33.
|
|
9
|
+
"version": "0.33.7",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@modelcontextprotocol/sdk",
|
|
12
12
|
"chokidar",
|