neon 3.2.2 → 3.3.0
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/README.md +70 -30
- package/dist/_chunks/{auth_selection-DGgq6ifc.js → auth_selection-CV_3n1du.js} +1 -1
- package/dist/_chunks/{cmd_pipeline-CUbBO9U_.js → cmd_pipeline-CEk93dGN.js} +8 -6
- package/dist/_chunks/credential_io-D2vw1UOw.js +409 -0
- package/dist/_chunks/{paths-DMq0Lt7a.js → paths-g3DRqJiD.js} +1 -1
- package/dist/_chunks/{profiles-Ir29rqns.js → profiles-CVXNvU2r.js} +106 -66
- package/dist/_chunks/{psql-DWH-kc69.js → psql-BNljLda2.js} +8 -7
- package/dist/_chunks/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-8H4AJuhK.js} +1 -0
- package/dist/analytics.js +19 -5
- package/dist/auth_context.js +25 -24
- package/dist/commands/api.js +1 -1
- package/dist/commands/api_keys.js +1 -1
- package/dist/commands/auth.js +121 -80
- package/dist/commands/bootstrap.js +2 -2
- package/dist/commands/branches.js +1 -1
- package/dist/commands/bucket.js +1 -1
- package/dist/commands/checkout.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/connection_string.js +1 -1
- package/dist/commands/data_api.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/diff.js +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/functions.js +1 -1
- package/dist/commands/init.js +2 -2
- package/dist/commands/inspect.js +1 -1
- package/dist/commands/ip_allow.js +1 -1
- package/dist/commands/link.js +1 -1
- package/dist/commands/logs.js +1 -1
- package/dist/commands/neon_auth.js +1 -1
- package/dist/commands/open.js +1 -1
- package/dist/commands/operations.js +1 -1
- package/dist/commands/orgs.js +1 -1
- package/dist/commands/profile.js +183 -202
- package/dist/commands/projects.js +1 -1
- package/dist/commands/psql.js +1 -1
- package/dist/commands/roles.js +1 -1
- package/dist/commands/schema_diff.js +15 -13
- package/dist/commands/set_context.js +1 -1
- package/dist/commands/snapshots.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/user.js +1 -1
- package/dist/commands/vpc_endpoints.js +1 -1
- package/dist/config.js +1 -1
- package/dist/credential_io.js +2 -0
- package/dist/index.js +27 -25
- package/dist/init/auth.js +14 -25
- package/dist/keyring.js +42 -0
- package/dist/psql/cli.js +1 -1
- package/dist/psql/command/cmd_connect.js +4 -3
- package/dist/psql/command/cmd_copy.js +65 -62
- package/dist/psql/command/cmd_io.js +1 -1
- package/dist/psql/command/cmd_pipeline.js +1 -1
- package/dist/psql/command/dispatch.js +1 -1
- package/dist/psql/core/common.js +1 -1
- package/dist/psql/core/mainloop.js +1 -1
- package/dist/psql/core/startup.js +1 -1
- package/dist/psql/index.js +1 -1
- package/dist/psql/io/psqlrc.js +13 -11
- package/dist/psql/print/aligned.js +9 -5
- package/dist/psql/wire/tls.js +11 -9
- package/dist/retire_credential.js +86 -0
- package/dist/utils/inspect_db.js +1 -1
- package/dist/utils/middlewares.js +1 -1
- package/package.json +5 -4
- package/dist/_chunks/credentials-MYdHdKah.js +0 -188
- package/dist/_chunks/secure_file-BucZj4yQ.js +0 -39
package/dist/commands/auth.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
2
|
-
import { d as
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { _ as upsertProfile, d as newProfileLocation, g as selectProfileName, h as resolveProfile, i as assertValidProfileName, l as locationForName, m as readProfiles, n as KEYRING_CREDENTIALS, p as profilesUsingPath, r as assertProfilesUsable, s as isKeyringPointer, t as DEFAULT_PROFILE, u as locationOf } from "../_chunks/profiles-CVXNvU2r.js";
|
|
3
|
+
import { a as OAUTH, i as API_KEY, l as interpretCredentials, s as credentialLabel, t as storeFor } from "../_chunks/credential_io-D2vw1UOw.js";
|
|
3
4
|
import { isCi } from "../env.js";
|
|
4
5
|
import { log } from "../log.js";
|
|
5
6
|
import { getApiClient } from "../api.js";
|
|
6
|
-
import {
|
|
7
|
-
import "../config.js";
|
|
7
|
+
import { o as isOwnedCredentialPath } from "../_chunks/paths-g3DRqJiD.js";
|
|
8
8
|
import { setAuthContext } from "../auth_context.js";
|
|
9
9
|
import { isConfigInit, isCurrentBranchProbe, isProfileCommand } from "../context.js";
|
|
10
10
|
import { extendTokenSet } from "../utils/auth.js";
|
|
11
11
|
import { auth, refreshToken } from "../auth.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { existsSync
|
|
12
|
+
import { i as selectCredential, n as displacedProfileWarning, t as credentialInputs } from "../_chunks/auth_selection-CV_3n1du.js";
|
|
13
|
+
import { readOutgoingCredential, retirePreviousCredential } from "../retire_credential.js";
|
|
14
|
+
import { existsSync } from "node:fs";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
16
|
//#region src/commands/auth.ts
|
|
17
17
|
var auth_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -19,63 +19,105 @@ var auth_exports = /* @__PURE__ */ __exportAll({
|
|
|
19
19
|
authFlow: () => authFlow,
|
|
20
20
|
builder: () => builder,
|
|
21
21
|
command: () => command,
|
|
22
|
-
credentialsPathForName: () => credentialsPathForName,
|
|
23
22
|
deleteCredentialsAt: () => deleteCredentialsAt,
|
|
24
23
|
describe: () => describe,
|
|
25
24
|
ensureAuth: () => ensureAuth,
|
|
26
25
|
handler: () => handler,
|
|
26
|
+
locationForAuth: () => locationForAuth,
|
|
27
27
|
usableCredential: () => usableCredential
|
|
28
28
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (name === "DEFAULT"
|
|
37
|
-
return
|
|
29
|
+
const locationForAuth = (configDir, name, keyring, options = {}) => {
|
|
30
|
+
const declared = readProfiles(configDir, log.warning)?.profiles[name];
|
|
31
|
+
const pointer = declared !== void 0 && isKeyringPointer(declared.credentials);
|
|
32
|
+
if (keyring === true || pointer) return {
|
|
33
|
+
profile: name,
|
|
34
|
+
storage: "keyring"
|
|
35
|
+
};
|
|
36
|
+
if (declared !== void 0 || name === "DEFAULT") return locationForName(configDir, name);
|
|
37
|
+
if (options.create === true) return newProfileLocation(configDir, name, "file");
|
|
38
|
+
return locationForName(configDir, name);
|
|
38
39
|
};
|
|
39
|
-
const credentialsPathFor = ({ configDir, profile }) => credentialsPathForName(configDir, selectProfileName(profile));
|
|
40
40
|
const command = "auth";
|
|
41
41
|
const aliases = ["login"];
|
|
42
42
|
const describe = "Authenticate";
|
|
43
|
-
const builder = (yargs) => yargs.option("context-file", { hidden: true })
|
|
43
|
+
const builder = (yargs) => yargs.option("context-file", { hidden: true }).option("keyring", {
|
|
44
|
+
describe: "Store the credential in the OS keyring. Per profile; later auth without the flag stays there. See `neon profile list`.",
|
|
45
|
+
type: "boolean"
|
|
46
|
+
});
|
|
44
47
|
const handler = async (args) => {
|
|
45
48
|
await authFlow(args);
|
|
46
49
|
};
|
|
47
|
-
const authFlow = async ({ configDir, oauthHost, clientId, apiHost, forceAuth, "force-auth": forceAuthKebab, allowUnsafeTls, profile }) => {
|
|
48
|
-
if (!(forceAuth ?? forceAuthKebab) && isCi()) throw new Error("Cannot run interactive auth in CI");
|
|
50
|
+
const authFlow = async ({ configDir, oauthHost, clientId, apiHost, forceAuth, "force-auth": forceAuthKebab, allowUnsafeTls, profile, keyring }) => {
|
|
49
51
|
const profileName = selectProfileName(profile);
|
|
50
52
|
const isNamed = profileName !== DEFAULT_PROFILE;
|
|
51
53
|
if (isNamed) assertValidProfileName(profileName);
|
|
52
54
|
assertProfilesUsable(configDir, profileName);
|
|
55
|
+
const at = locationForAuth(configDir, profileName, keyring, { create: true });
|
|
56
|
+
if (at.storage === "keyring") {
|
|
57
|
+
const declared = readProfiles(configDir)?.profiles[profileName];
|
|
58
|
+
storeFor(configDir).assertKeyringWritable(declared !== void 0 && isKeyringPointer(declared.credentials) ? profileName : void 0);
|
|
59
|
+
}
|
|
60
|
+
if (!(forceAuth ?? forceAuthKebab) && isCi()) throw new Error("Cannot run interactive auth in CI");
|
|
61
|
+
let previousFile;
|
|
62
|
+
let previousWasKeyring = false;
|
|
63
|
+
let previousOutgoing = null;
|
|
64
|
+
try {
|
|
65
|
+
const previous = resolveProfile(configDir, profileName);
|
|
66
|
+
previousWasKeyring = previous.storage === "keyring";
|
|
67
|
+
if (previous.storage === "file") previousFile = previous.credentialsPath;
|
|
68
|
+
previousOutgoing = readOutgoingCredential(configDir, locationOf(previous));
|
|
69
|
+
} catch {
|
|
70
|
+
previousFile = void 0;
|
|
71
|
+
}
|
|
53
72
|
const tokenSet = await auth({
|
|
54
73
|
oauthHost,
|
|
55
74
|
clientId,
|
|
56
75
|
allowUnsafeTls
|
|
57
76
|
});
|
|
58
|
-
const credentialsPath = isNamed && !readProfiles(configDir, log.warning)?.profiles[profileName] ? newProfileCredentialsPath(configDir, profileName) : credentialsPathFor({
|
|
59
|
-
configDir,
|
|
60
|
-
profile
|
|
61
|
-
});
|
|
62
77
|
let identity = {};
|
|
63
78
|
try {
|
|
64
|
-
identity = await preserveCredentials(
|
|
79
|
+
identity = await preserveCredentials(at, tokenSet, getApiClient({
|
|
65
80
|
apiKey: tokenSet.access_token || "",
|
|
66
81
|
apiHost
|
|
67
|
-
}));
|
|
68
|
-
} catch {
|
|
82
|
+
}), configDir);
|
|
83
|
+
} catch (err) {
|
|
69
84
|
log.error("Failed to save credentials");
|
|
70
|
-
|
|
85
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
71
86
|
}
|
|
72
|
-
if (isNamed) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
if (at.storage === "keyring" || isNamed) {
|
|
88
|
+
try {
|
|
89
|
+
upsertProfile(configDir, profileName, {
|
|
90
|
+
credentials: at.storage === "keyring" ? KEYRING_CREDENTIALS : at.path,
|
|
91
|
+
...identity.email ? { label: identity.email } : {},
|
|
92
|
+
...identity.id ? { userId: identity.id } : {}
|
|
93
|
+
});
|
|
94
|
+
} catch (err) {
|
|
95
|
+
if (at.storage === "keyring" && !previousWasKeyring) {
|
|
96
|
+
if (storeFor(configDir).delete(at, { required: false }) !== "cleared") log.warning("Could not confirm the new OS keyring item for profile \"%s\" was removed after a failed save.", profileName);
|
|
97
|
+
}
|
|
98
|
+
log.error("Failed to save credentials");
|
|
99
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
100
|
+
}
|
|
101
|
+
if (at.storage === "keyring") await retirePreviousCredential({
|
|
102
|
+
apiHost,
|
|
103
|
+
oauthHost,
|
|
104
|
+
clientId,
|
|
105
|
+
...allowUnsafeTls ? { allowUnsafeTls } : {}
|
|
106
|
+
}, profileName, previousOutgoing);
|
|
107
|
+
if (at.storage === "keyring" && previousFile !== void 0 && profilesUsingPath(configDir, previousFile, profileName).length === 0) {
|
|
108
|
+
if (isOwnedCredentialPath(configDir, previousFile)) try {
|
|
109
|
+
storeFor(configDir).delete({
|
|
110
|
+
profile: profileName,
|
|
111
|
+
storage: "file",
|
|
112
|
+
path: previousFile
|
|
113
|
+
});
|
|
114
|
+
log.info("Deleted %s", previousFile);
|
|
115
|
+
} catch {
|
|
116
|
+
log.warning("Saved the keyring item but could not delete %s", previousFile);
|
|
117
|
+
}
|
|
118
|
+
else if (existsSync(previousFile)) log.info("Left %s on disk — not created by neon", previousFile);
|
|
119
|
+
}
|
|
120
|
+
log.info("Saved profile \"%s\" (%s)", profileName, at.storage === "keyring" ? KEYRING_CREDENTIALS : at.path);
|
|
79
121
|
}
|
|
80
122
|
log.info("Auth complete");
|
|
81
123
|
return tokenSet.access_token || "";
|
|
@@ -85,22 +127,22 @@ const authFlow = async ({ configDir, oauthHost, clientId, apiHost, forceAuth, "f
|
|
|
85
127
|
* labelled with an email. The credentials file records only `user_id` — a UUID with no
|
|
86
128
|
* email — which is why identifying a stored profile offline is otherwise impossible.
|
|
87
129
|
*/
|
|
88
|
-
const preserveCredentials = async (
|
|
130
|
+
const preserveCredentials = async (at, credentials, apiClient, configDir) => {
|
|
89
131
|
const { data: { id, email } } = await apiClient.getCurrentUserInfo();
|
|
90
132
|
const stored = {
|
|
91
133
|
...credentials,
|
|
92
134
|
type: OAUTH,
|
|
93
135
|
...id !== void 0 ? { user_id: id } : {}
|
|
94
136
|
};
|
|
95
|
-
|
|
96
|
-
log.debug("Saved credentials to %s",
|
|
137
|
+
storeFor(configDir).write(at, stored);
|
|
138
|
+
log.debug("Saved credentials to %s", credentialLabel(at));
|
|
97
139
|
log.debug("Credentials MD5 hash: %s", md5hash(JSON.stringify(stored)));
|
|
98
140
|
return {
|
|
99
141
|
...id ? { id } : {},
|
|
100
142
|
...email ? { email } : {}
|
|
101
143
|
};
|
|
102
144
|
};
|
|
103
|
-
const handleExistingToken = async (tokenSet, props,
|
|
145
|
+
const handleExistingToken = async (tokenSet, props, at) => {
|
|
104
146
|
if (tokenSet.access_token && tokenSet.expires_at > Date.now()) {
|
|
105
147
|
log.debug("Using existing valid access_token");
|
|
106
148
|
const apiClient = getApiClient({
|
|
@@ -117,29 +159,29 @@ const handleExistingToken = async (tokenSet, props, credentialsPath) => {
|
|
|
117
159
|
log.debug("TokenSet is missing refresh_token, starting authentication");
|
|
118
160
|
return null;
|
|
119
161
|
}
|
|
162
|
+
let refreshedTokenSet;
|
|
120
163
|
try {
|
|
121
|
-
|
|
164
|
+
refreshedTokenSet = extendTokenSet(await refreshToken({
|
|
122
165
|
oauthHost: props.oauthHost,
|
|
123
166
|
clientId: props.clientId,
|
|
124
167
|
allowUnsafeTls: props.allowUnsafeTls
|
|
125
|
-
}, tokenSet);
|
|
126
|
-
const extendedTokenSet = extendTokenSet(refreshedTokenSet);
|
|
127
|
-
const apiKey = extendedTokenSet.access_token;
|
|
128
|
-
const apiClient = getApiClient({
|
|
129
|
-
apiKey,
|
|
130
|
-
apiHost: props.apiHost
|
|
131
|
-
});
|
|
132
|
-
await preserveCredentials(credentialsPath, extendedTokenSet, apiClient);
|
|
133
|
-
log.debug("Token refresh successful");
|
|
134
|
-
return {
|
|
135
|
-
apiKey,
|
|
136
|
-
apiClient
|
|
137
|
-
};
|
|
168
|
+
}, tokenSet));
|
|
138
169
|
} catch (err) {
|
|
139
170
|
const typedErr = err instanceof Error ? err : /* @__PURE__ */ new Error("Unknown error");
|
|
140
171
|
log.debug("Failed to refresh token: %s", typedErr.message);
|
|
141
172
|
throw new Error("AUTH_REFRESH_FAILED");
|
|
142
173
|
}
|
|
174
|
+
const apiKey = refreshedTokenSet.access_token;
|
|
175
|
+
const apiClient = getApiClient({
|
|
176
|
+
apiKey,
|
|
177
|
+
apiHost: props.apiHost
|
|
178
|
+
});
|
|
179
|
+
await preserveCredentials(at, refreshedTokenSet, apiClient, props.configDir);
|
|
180
|
+
log.debug("Token refresh successful");
|
|
181
|
+
return {
|
|
182
|
+
apiKey,
|
|
183
|
+
apiClient
|
|
184
|
+
};
|
|
143
185
|
};
|
|
144
186
|
/**
|
|
145
187
|
* The credential a stored file can authenticate with right now — its API key, or an OAuth
|
|
@@ -150,22 +192,21 @@ const handleExistingToken = async (tokenSet, props, credentialsPath) => {
|
|
|
150
192
|
* an interactive login would be authenticating something other than what the command is about.
|
|
151
193
|
*/
|
|
152
194
|
const usableCredential = async (props, at) => {
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const credential = interpretCredentials(stored, at);
|
|
195
|
+
const loaded = storeFor(props.configDir).read(at);
|
|
196
|
+
if (loaded === null) return null;
|
|
197
|
+
const credential = interpretCredentials(loaded.credentials, at, loaded.backend);
|
|
157
198
|
if (credential.kind === "api_key") return {
|
|
158
199
|
apiKey: credential.apiKey,
|
|
159
200
|
kind: API_KEY
|
|
160
201
|
};
|
|
161
202
|
try {
|
|
162
|
-
const result = await handleExistingToken(
|
|
203
|
+
const result = await handleExistingToken(loaded.credentials, props, at);
|
|
163
204
|
return result ? {
|
|
164
205
|
apiKey: result.apiKey,
|
|
165
206
|
kind: OAUTH
|
|
166
207
|
} : null;
|
|
167
208
|
} catch (err) {
|
|
168
|
-
log.debug("Could not use the stored OAuth session at %s: %s",
|
|
209
|
+
log.debug("Could not use the stored OAuth session at %s: %s", credentialLabel(at), err instanceof Error ? err.message : "unknown error");
|
|
169
210
|
return null;
|
|
170
211
|
}
|
|
171
212
|
};
|
|
@@ -205,15 +246,11 @@ const ensureAuth = async (props) => {
|
|
|
205
246
|
return;
|
|
206
247
|
}
|
|
207
248
|
props.apiKey = "";
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const stored = readCredentials(at);
|
|
214
|
-
if (stored !== null) {
|
|
215
|
-
log.debug("Trying to read credentials from %s", credentialsPath);
|
|
216
|
-
const credential = interpretCredentials(stored, at);
|
|
249
|
+
const at = locationForAuth(props.configDir, selection.profile);
|
|
250
|
+
const loaded = storeFor(props.configDir).read(at);
|
|
251
|
+
if (loaded !== null) {
|
|
252
|
+
log.debug("Trying to read credentials from %s", credentialLabel(at));
|
|
253
|
+
const credential = interpretCredentials(loaded.credentials, at, loaded.backend);
|
|
217
254
|
if (credential.kind === "api_key") {
|
|
218
255
|
log.debug("Using profile \"%s\"'s API key to authorize requests", selection.profile);
|
|
219
256
|
props.apiKey = credential.apiKey;
|
|
@@ -221,7 +258,8 @@ const ensureAuth = async (props) => {
|
|
|
221
258
|
source: "profile-api-key",
|
|
222
259
|
configDir: props.configDir,
|
|
223
260
|
profile: selection.profile,
|
|
224
|
-
|
|
261
|
+
storage: at.storage,
|
|
262
|
+
...at.storage === "file" ? { credentialsPath: at.path } : {}
|
|
225
263
|
});
|
|
226
264
|
props.apiClient = getApiClient({
|
|
227
265
|
apiKey: credential.apiKey,
|
|
@@ -230,7 +268,7 @@ const ensureAuth = async (props) => {
|
|
|
230
268
|
return;
|
|
231
269
|
}
|
|
232
270
|
try {
|
|
233
|
-
const result = await handleExistingToken(
|
|
271
|
+
const result = await handleExistingToken(loaded.credentials, props, at);
|
|
234
272
|
if (result) {
|
|
235
273
|
props.apiKey = result.apiKey;
|
|
236
274
|
props.apiClient = result.apiClient;
|
|
@@ -238,7 +276,8 @@ const ensureAuth = async (props) => {
|
|
|
238
276
|
source: "stored-credentials",
|
|
239
277
|
configDir: props.configDir,
|
|
240
278
|
profile: selection.profile,
|
|
241
|
-
|
|
279
|
+
storage: at.storage,
|
|
280
|
+
...at.storage === "file" ? { credentialsPath: at.path } : {}
|
|
242
281
|
});
|
|
243
282
|
return;
|
|
244
283
|
}
|
|
@@ -246,7 +285,7 @@ const ensureAuth = async (props) => {
|
|
|
246
285
|
if (!(err instanceof Error && err.message === "AUTH_REFRESH_FAILED")) throw err;
|
|
247
286
|
log.debug("Ensure auth failed, starting authentication", err);
|
|
248
287
|
}
|
|
249
|
-
} else log.debug("No usable credentials at %s, starting authentication",
|
|
288
|
+
} else log.debug("No usable credentials at %s, starting authentication", credentialLabel(at));
|
|
250
289
|
if (isLocalDev) {
|
|
251
290
|
log.debug("dev: no usable credentials; running without env injection");
|
|
252
291
|
return;
|
|
@@ -272,7 +311,8 @@ const ensureAuth = async (props) => {
|
|
|
272
311
|
source: "stored-credentials",
|
|
273
312
|
configDir: props.configDir,
|
|
274
313
|
profile: selection.profile,
|
|
275
|
-
|
|
314
|
+
storage: at.storage,
|
|
315
|
+
...at.storage === "file" ? { credentialsPath: at.path } : {}
|
|
276
316
|
});
|
|
277
317
|
};
|
|
278
318
|
/**
|
|
@@ -285,12 +325,13 @@ const ensureAuth = async (props) => {
|
|
|
285
325
|
* `--profile`-selected account deleted whatever `DEFAULT` pointed at — signing the user out
|
|
286
326
|
* of an account whose credentials the failed request had never touched.
|
|
287
327
|
*/
|
|
288
|
-
const deleteCredentialsAt = (
|
|
328
|
+
const deleteCredentialsAt = (at, configDir) => {
|
|
289
329
|
try {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
330
|
+
const store = storeFor(configDir);
|
|
331
|
+
const before = store.inspect(at);
|
|
332
|
+
store.delete(at);
|
|
333
|
+
if (before.credentials !== null || before.file === "ok") log.info("Deleted credentials from %s", credentialLabel(at));
|
|
334
|
+
else log.debug("No stored credential at %s", credentialLabel(at));
|
|
294
335
|
} catch (err) {
|
|
295
336
|
const typedErr = err instanceof Error ? err : /* @__PURE__ */ new Error("Unknown error");
|
|
296
337
|
log.error("Failed to delete credentials: %s", typedErr.message);
|
|
@@ -299,4 +340,4 @@ const deleteCredentialsAt = (credentialsPath) => {
|
|
|
299
340
|
};
|
|
300
341
|
const md5hash = (s) => createHash("md5").update(s).digest("hex");
|
|
301
342
|
//#endregion
|
|
302
|
-
export { aliases, authFlow, builder, command,
|
|
343
|
+
export { aliases, authFlow, builder, command, deleteCredentialsAt, describe, ensureAuth, handler, locationForAuth, auth_exports as t, usableCredential };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { isCi } from "../env.js";
|
|
3
3
|
import { log } from "../log.js";
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
|
5
|
-
import { t as credentialInputs } from "../_chunks/auth_selection-
|
|
5
|
+
import { t as credentialInputs } from "../_chunks/auth_selection-CV_3n1du.js";
|
|
6
6
|
import { BootstrapInputError, FALLBACK_TEMPLATES, ensureTargetUsable, fetchTemplates, findTemplate, scaffoldTemplate, templateIds } from "../init/bootstrap.js";
|
|
7
7
|
import { DO_NOT_SUBSTITUTE_HINT, formatInstallCommand, inferPackageManager, installArgs, installedPackageManagers, resolvePackageManager, runCommand } from "../utils/package_manager.js";
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { retryOnLock } from "../api.js";
|
|
4
4
|
import { contextBranch, readContextFile } from "../context.js";
|
package/dist/commands/bucket.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { isNeonApiError, retryOnLock } from "../api.js";
|
|
4
4
|
import { writer } from "../writer.js";
|
package/dist/commands/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { writer } from "../writer.js";
|
|
3
3
|
import { EndpointType } from "../utils/api_enums.js";
|
|
4
4
|
import { branchIdFromProps, fillSingleProject } from "../utils/enrichers.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { isNeonApiError, retryOnLock } from "../api.js";
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
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
4
|
import { branchIdFromProps, fillSingleProject } from "../utils/enrichers.js";
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { fillSingleProject } from "../utils/enrichers.js";
|
|
3
3
|
import { applyCmd, applyFlags, envFlag, envPullFlag } from "./config.js";
|
|
4
4
|
//#region src/commands/deploy.ts
|
package/dist/commands/dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { getCliName } from "../utils/cli_name.js";
|
|
4
4
|
import { readEnvFile, resolveEnvFilePath } from "../env_file.js";
|
package/dist/commands/diff.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { isNeonApiError } from "../api.js";
|
|
4
4
|
import { writer } from "../writer.js";
|
package/dist/commands/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { ensureGitignored } from "../context.js";
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { isNeonApiError, retryOnLock } from "../api.js";
|
|
4
4
|
import { getCliName } from "../utils/cli_name.js";
|
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { closeAnalytics, sendError } from "../analytics.js";
|
|
3
|
-
import { t as credentialInputs } from "../_chunks/auth_selection-
|
|
3
|
+
import { t as credentialInputs } from "../_chunks/auth_selection-CV_3n1du.js";
|
|
4
4
|
import { detectAgent } from "../init/detect_agent.js";
|
|
5
5
|
import { enrichResponse } from "../init/enrich_output.js";
|
|
6
6
|
import { interactiveInit } from "../init/interactive.js";
|
package/dist/commands/inspect.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { writer } from "../writer.js";
|
|
3
3
|
import { fillSingleProject } from "../utils/enrichers.js";
|
|
4
4
|
import { resolveConnectionUri, runInspectQuery } from "../utils/inspect_db.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { getCliName } from "../utils/cli_name.js";
|
|
4
4
|
import { writer } from "../writer.js";
|
package/dist/commands/link.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { isCi } from "../env.js";
|
|
3
3
|
import { log } from "../log.js";
|
|
4
4
|
import { isNeonApiError, messageFromBody } from "../api.js";
|
package/dist/commands/logs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { log } from "../log.js";
|
|
3
3
|
import { isNeonApiError } from "../api.js";
|
|
4
4
|
import { writer } from "../writer.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { codeFromBody, isNeonApiError, retryOnLock } from "../api.js";
|
|
3
3
|
import { writer } from "../writer.js";
|
|
4
4
|
import { NeonAuthEmailVerificationMethod, NeonAuthOauthProviderId, NeonAuthOauthProviderType, NeonAuthSupportedAuthProvider } from "../utils/api_enums.js";
|
package/dist/commands/open.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { writer } from "../writer.js";
|
|
3
3
|
import { fillSingleProject } from "../utils/enrichers.js";
|
|
4
4
|
//#region src/commands/operations.ts
|
package/dist/commands/orgs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "../_chunks/rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "../_chunks/rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { writer } from "../writer.js";
|
|
3
3
|
//#region src/commands/orgs.ts
|
|
4
4
|
var orgs_exports = /* @__PURE__ */ __exportAll({
|