maybethisone 0.2.0 → 0.2.1
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/index.js +14 -5
- package/dist/mcp.js +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,11 +8,19 @@ import Table from "cli-table3";
|
|
|
8
8
|
// src/checkers/github.ts
|
|
9
9
|
async function checkGitHubOrg(name) {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const [orgResponse, userResponse] = await Promise.all([
|
|
12
|
+
fetch(`https://github.com/orgs/${name}`, {
|
|
13
|
+
method: "HEAD",
|
|
14
|
+
redirect: "manual"
|
|
15
|
+
}),
|
|
16
|
+
fetch(`https://github.com/${name}`, {
|
|
17
|
+
method: "HEAD",
|
|
18
|
+
redirect: "manual"
|
|
19
|
+
})
|
|
20
|
+
]);
|
|
21
|
+
const orgExists = orgResponse.status !== 404;
|
|
22
|
+
const userExists = userResponse.status !== 404;
|
|
23
|
+
return { available: !orgExists && !userExists };
|
|
16
24
|
} catch (error) {
|
|
17
25
|
return { available: null, error: error.message };
|
|
18
26
|
}
|
|
@@ -293,6 +301,7 @@ async function main() {
|
|
|
293
301
|
}
|
|
294
302
|
}
|
|
295
303
|
await closeBrowser2();
|
|
304
|
+
process.exit(0);
|
|
296
305
|
}
|
|
297
306
|
main().catch(async (err) => {
|
|
298
307
|
console.error(err);
|
package/dist/mcp.js
CHANGED
|
@@ -8,11 +8,19 @@ import { z } from "zod";
|
|
|
8
8
|
// src/checkers/github.ts
|
|
9
9
|
async function checkGitHubOrg(name) {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const [orgResponse, userResponse] = await Promise.all([
|
|
12
|
+
fetch(`https://github.com/orgs/${name}`, {
|
|
13
|
+
method: "HEAD",
|
|
14
|
+
redirect: "manual"
|
|
15
|
+
}),
|
|
16
|
+
fetch(`https://github.com/${name}`, {
|
|
17
|
+
method: "HEAD",
|
|
18
|
+
redirect: "manual"
|
|
19
|
+
})
|
|
20
|
+
]);
|
|
21
|
+
const orgExists = orgResponse.status !== 404;
|
|
22
|
+
const userExists = userResponse.status !== 404;
|
|
23
|
+
return { available: !orgExists && !userExists };
|
|
16
24
|
} catch (error) {
|
|
17
25
|
return { available: null, error: error.message };
|
|
18
26
|
}
|