skillhub 0.1.3 → 0.1.4
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 +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -111,7 +111,8 @@ async function searchSkills(query, options = {}) {
|
|
|
111
111
|
return JSON.parse(response.data);
|
|
112
112
|
}
|
|
113
113
|
async function getSkill(id) {
|
|
114
|
-
const
|
|
114
|
+
const encodedPath = id.split("/").map(encodeURIComponent).join("/");
|
|
115
|
+
const response = await httpsRequest(`${API_BASE_URL}/skills/${encodedPath}`);
|
|
115
116
|
if (response.statusCode === 404) {
|
|
116
117
|
return null;
|
|
117
118
|
}
|
|
@@ -122,7 +123,8 @@ async function getSkill(id) {
|
|
|
122
123
|
}
|
|
123
124
|
async function trackInstall(skillId, platform, method = "cli") {
|
|
124
125
|
try {
|
|
125
|
-
|
|
126
|
+
const encodedPath = skillId.split("/").map(encodeURIComponent).join("/");
|
|
127
|
+
await httpsRequest(`${API_BASE_URL}/skills/${encodedPath}/install`, {
|
|
126
128
|
method: "POST",
|
|
127
129
|
headers: { "Content-Type": "application/json" },
|
|
128
130
|
body: JSON.stringify({ platform, method })
|
|
@@ -357,7 +359,7 @@ async function search(query, options) {
|
|
|
357
359
|
const verified = skill.isVerified ? chalk2.green("\u2713") : " ";
|
|
358
360
|
const security = getSecurityBadge(skill.securityScore);
|
|
359
361
|
console.log(
|
|
360
|
-
`${verified} ${chalk2.cyan(skill.
|
|
362
|
+
`${verified} ${chalk2.cyan(skill.id.padEnd(40))} ${security} \u2B50 ${formatNumber(skill.githubStars).padStart(6)} \u2B07 ${formatNumber(skill.downloadCount).padStart(6)}`
|
|
361
363
|
);
|
|
362
364
|
console.log(
|
|
363
365
|
` ${chalk2.dim(skill.description.slice(0, 70))}${skill.description.length > 70 ? "..." : ""}`
|
package/package.json
CHANGED