@persistmemory/cli 0.2.1 → 0.2.2
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/bin.js +15 -3
- package/dist/bin.js.map +2 -2
- package/dist/index.js +15 -3
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1525,7 +1525,7 @@ function shortDate(iso) {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
|
|
1527
1527
|
// src/help.ts
|
|
1528
|
-
var VERSION = true ? "0.2.
|
|
1528
|
+
var VERSION = true ? "0.2.2" : versionFromManifest();
|
|
1529
1529
|
var PACKAGE = "@persistmemory/cli";
|
|
1530
1530
|
var HELP = `
|
|
1531
1531
|
pm \u2014 PersistMemory from your terminal
|
|
@@ -1744,7 +1744,17 @@ async function startLoopback(options = {}) {
|
|
|
1744
1744
|
// This page is one-use and holds a result; nothing should keep it.
|
|
1745
1745
|
"cache-control": "no-store",
|
|
1746
1746
|
// It never loads anything, so it is not allowed to.
|
|
1747
|
-
"content-security-policy": "default-src 'none'; style-src 'unsafe-inline'"
|
|
1747
|
+
"content-security-policy": "default-src 'none'; style-src 'unsafe-inline'",
|
|
1748
|
+
/*
|
|
1749
|
+
Not kept alive, because a kept socket keeps the PROCESS alive.
|
|
1750
|
+
|
|
1751
|
+
`server.close()` stops new connections and leaves established ones
|
|
1752
|
+
open, and a browser holds this one open by default — so `pm auth login`
|
|
1753
|
+
printed "Signed in" and then sat there until somebody pressed Ctrl+C.
|
|
1754
|
+
The page is the last thing this server ever serves; there is nothing to
|
|
1755
|
+
reuse the connection for.
|
|
1756
|
+
*/
|
|
1757
|
+
connection: "close"
|
|
1748
1758
|
});
|
|
1749
1759
|
response.end(donePage(callback));
|
|
1750
1760
|
resolveCallback?.(callback);
|
|
@@ -1776,7 +1786,9 @@ async function startLoopback(options = {}) {
|
|
|
1776
1786
|
},
|
|
1777
1787
|
close() {
|
|
1778
1788
|
clearTimeout(timer);
|
|
1789
|
+
server.closeAllConnections?.();
|
|
1779
1790
|
server.close();
|
|
1791
|
+
server.unref();
|
|
1780
1792
|
}
|
|
1781
1793
|
};
|
|
1782
1794
|
}
|
|
@@ -2062,7 +2074,7 @@ async function clientFor(resolved, deps) {
|
|
|
2062
2074
|
});
|
|
2063
2075
|
}
|
|
2064
2076
|
async function currentCredential(resolved, deps) {
|
|
2065
|
-
const credential = resolved.credential;
|
|
2077
|
+
const credential = resolved.fromEnvironment ? resolved.credential : readCredentials(deps.paths)[resolved.profile] ?? resolved.credential;
|
|
2066
2078
|
if (!credential) throw new NotSignedIn();
|
|
2067
2079
|
if (!isExpired(credential, deps.now?.() ?? Date.now())) return credential;
|
|
2068
2080
|
if (!credential.refreshToken || !resolved.clientId) {
|