peakurl 1.0.1 → 1.0.3
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/bin/peakurl.js +14 -9
- package/man/peakurl.1 +1 -1
- package/package.json +5 -5
package/bin/peakurl.js
CHANGED
|
@@ -37,7 +37,9 @@ function ensureCliError(error) {
|
|
|
37
37
|
var CONFIG_FILENAME = "config.json";
|
|
38
38
|
var STATE_FILENAME = "state.json";
|
|
39
39
|
function getConfigPath() {
|
|
40
|
-
|
|
40
|
+
const paths = envPaths("peakurl", { suffix: "" });
|
|
41
|
+
const directory = process.platform === "darwin" ? paths.data : paths.config;
|
|
42
|
+
return join(directory, CONFIG_FILENAME);
|
|
41
43
|
}
|
|
42
44
|
function getStatePath() {
|
|
43
45
|
return join(envPaths("peakurl", { suffix: "" }).config, STATE_FILENAME);
|
|
@@ -1798,14 +1800,17 @@ function userLabel(user) {
|
|
|
1798
1800
|
function userValue(user) {
|
|
1799
1801
|
return text4(user.username) || text4(user.email) || String(user.id ?? "");
|
|
1800
1802
|
}
|
|
1801
|
-
function userTable(user) {
|
|
1803
|
+
function userTable(user, apiBaseUrl) {
|
|
1802
1804
|
const rows2 = [
|
|
1803
|
-
["
|
|
1804
|
-
["Username", text4(user.username)],
|
|
1805
|
-
["Email", text4(user.email)],
|
|
1805
|
+
["ID", user.id === void 0 ? void 0 : String(user.id)],
|
|
1806
1806
|
["Role", text4(user.role)],
|
|
1807
|
-
["
|
|
1807
|
+
["Username", text4(user.username)],
|
|
1808
|
+
["Name", userLabel(user)],
|
|
1809
|
+
["Email", text4(user.email)]
|
|
1808
1810
|
].filter((entry) => Boolean(entry[1]));
|
|
1811
|
+
if (apiBaseUrl) {
|
|
1812
|
+
rows2.push(["API URL", apiBaseUrl]);
|
|
1813
|
+
}
|
|
1809
1814
|
if (rows2.length === 0) {
|
|
1810
1815
|
return "No user fields returned.";
|
|
1811
1816
|
}
|
|
@@ -2350,7 +2355,7 @@ async function login(options) {
|
|
|
2350
2355
|
successLine(`Saved credentials for ${credentials.apiBaseUrl}.`)
|
|
2351
2356
|
);
|
|
2352
2357
|
writeStdout(`Authenticated as ${userLabel(response.data)}`);
|
|
2353
|
-
writeStdout(userTable(response.data));
|
|
2358
|
+
writeStdout(userTable(response.data, credentials.apiBaseUrl));
|
|
2354
2359
|
}
|
|
2355
2360
|
|
|
2356
2361
|
// src/commands/logout.ts
|
|
@@ -2542,7 +2547,7 @@ async function whoami(options) {
|
|
|
2542
2547
|
return;
|
|
2543
2548
|
}
|
|
2544
2549
|
writeStdout(successLine(response.message));
|
|
2545
|
-
writeStdout(userTable(response.data));
|
|
2550
|
+
writeStdout(userTable(response.data, config.apiBaseUrl));
|
|
2546
2551
|
}
|
|
2547
2552
|
|
|
2548
2553
|
// src/index.ts
|
|
@@ -2590,7 +2595,7 @@ function getRetryCommandName(argv) {
|
|
|
2590
2595
|
async function main() {
|
|
2591
2596
|
const program = new Command();
|
|
2592
2597
|
const version = await getCliVersion();
|
|
2593
|
-
program.name("peakurl").description("Manage your PeakURL site from the terminal.").helpOption("-h, --help", "Show help").helpCommand("help [command]", "Show help for a command").version(version, "-
|
|
2598
|
+
program.name("peakurl").description("Manage your PeakURL site from the terminal.").helpOption("-h, --help", "Show help").helpCommand("help [command]", "Show help for a command").version(version, "-v, --version", "Show CLI version").showHelpAfterError().showSuggestionAfterError().addHelpText(
|
|
2594
2599
|
"after",
|
|
2595
2600
|
`
|
|
2596
2601
|
Get Started:
|
package/man/peakurl.1
CHANGED
|
@@ -305,7 +305,7 @@ This is primarily useful for testing.
|
|
|
305
305
|
.Sh FILES
|
|
306
306
|
.Bl -tag -width "Windows"
|
|
307
307
|
.It macOS
|
|
308
|
-
.Pa ~/Library/
|
|
308
|
+
.Pa ~/Library/Application Support/peakurl/config.json
|
|
309
309
|
.It Linux and other Unix systems
|
|
310
310
|
.Pa ~/.config/peakurl/config.json
|
|
311
311
|
.It Windows
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peakurl",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Official CLI for creating, listing, and managing PeakURL short links from the terminal",
|
|
5
5
|
"homepage": "https://peakurl.org",
|
|
6
6
|
"bugs": {
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"env-paths": "^4.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"prettier": "^3.
|
|
54
|
+
"@types/node": "^26.1.2",
|
|
55
|
+
"prettier": "^3.9.6",
|
|
56
56
|
"tsup": "^8.5.1",
|
|
57
|
-
"tsx": "^4.
|
|
58
|
-
"typescript": "^
|
|
57
|
+
"tsx": "^4.23.4",
|
|
58
|
+
"typescript": "^7.0.2"
|
|
59
59
|
},
|
|
60
60
|
"license": "MIT"
|
|
61
61
|
}
|