nworks-plus 1.4.3 → 1.4.5
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.ja.md +1 -2
- package/README.ko.md +1 -2
- package/README.md +1 -2
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/nworks-plus)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/nworks-plus)
|
|
6
|
-
[](https://glama.ai/mcp/servers/yjcho9317/nworks)
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
yjcho9317 氏の [nworks](https://github.com/yjcho9317/nworks) のフォークです。オリジナルは [awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers) に掲載されています。
|
|
9
8
|
|
|
10
9
|
[🇺🇸 English](README.md) | [🇰🇷 한국어](README.ko.md) | 🇯🇵 日本語
|
|
11
10
|
|
package/README.ko.md
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/nworks-plus)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/nworks-plus)
|
|
6
|
-
[](https://glama.ai/mcp/servers/yjcho9317/nworks)
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
yjcho9317님의 [nworks](https://github.com/yjcho9317/nworks)를 포크한 프로젝트입니다. 원본은 [awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers)에 등재되어 있습니다.
|
|
9
8
|
|
|
10
9
|
[🇺🇸 English](README.md) | 🇰🇷 한국어 | [🇯🇵 日本語](README.ja.md)
|
|
11
10
|
|
package/README.md
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/nworks-plus)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://www.npmjs.com/package/nworks-plus)
|
|
6
|
-
[](https://glama.ai/mcp/servers/yjcho9317/nworks)
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
A fork of [nworks](https://github.com/yjcho9317/nworks) by yjcho9317, which is featured in [awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers).
|
|
9
8
|
|
|
10
9
|
🇺🇸 English | [🇰🇷 한국어](README.ko.md) | [🇯🇵 日本語](README.ja.md)
|
|
11
10
|
|
package/dist/index.js
CHANGED
|
@@ -733,17 +733,24 @@ var logoutCommand = new Command2("logout").description("Remove stored credential
|
|
|
733
733
|
|
|
734
734
|
// src/commands/whoami.ts
|
|
735
735
|
import { Command as Command3 } from "commander";
|
|
736
|
+
function describeToken(token) {
|
|
737
|
+
const expiresAt = token?.expiresAt;
|
|
738
|
+
if (typeof expiresAt !== "number" || isNaN(expiresAt) || expiresAt <= 0) {
|
|
739
|
+
return { valid: false, expiresAt: "(no token)" };
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
valid: expiresAt > Date.now() / 1e3,
|
|
743
|
+
expiresAt: new Date(expiresAt * 1e3).toISOString()
|
|
744
|
+
};
|
|
745
|
+
}
|
|
736
746
|
var whoamiCommand = new Command3("whoami").description("Show current authentication status").option("--profile <name>", "Profile name", "default").option("--json", "JSON output").action(async (opts) => {
|
|
737
747
|
try {
|
|
738
748
|
const profile = opts.profile;
|
|
739
749
|
const creds = await loadCredentials(profile);
|
|
740
750
|
const token = await loadToken(profile);
|
|
741
|
-
const
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
if (typeof expiresAt === "number" && !isNaN(expiresAt) && expiresAt > 0) {
|
|
745
|
-
tokenExpiresAt = new Date(expiresAt * 1e3).toISOString();
|
|
746
|
-
}
|
|
751
|
+
const userToken = await loadUserToken(profile);
|
|
752
|
+
const service = describeToken(token);
|
|
753
|
+
const user = describeToken(userToken);
|
|
747
754
|
output(
|
|
748
755
|
{
|
|
749
756
|
profile,
|
|
@@ -751,8 +758,11 @@ var whoamiCommand = new Command3("whoami").description("Show current authenticat
|
|
|
751
758
|
clientId: creds.clientId,
|
|
752
759
|
botId: creds.botId ?? "(not set)",
|
|
753
760
|
domainId: creds.domainId ?? "(not set)",
|
|
754
|
-
tokenValid:
|
|
755
|
-
tokenExpiresAt
|
|
761
|
+
tokenValid: service.valid,
|
|
762
|
+
tokenExpiresAt: service.expiresAt,
|
|
763
|
+
userOAuthValid: user.valid,
|
|
764
|
+
userOAuthExpiresAt: user.expiresAt,
|
|
765
|
+
userOAuthScope: userToken?.scope ?? "(not set)"
|
|
756
766
|
},
|
|
757
767
|
opts
|
|
758
768
|
);
|