@cantemizyurek/skillz 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.cjs +31 -0
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -11248,6 +11248,7 @@ var skillNameSchema = external_exports.string().min(1).max(64).regex(
|
|
|
11248
11248
|
SKILL_NAME_REGEX,
|
|
11249
11249
|
"Skill name must be lowercase alphanumeric with internal dashes"
|
|
11250
11250
|
);
|
|
11251
|
+
var namespaceSchema = usernameSchema;
|
|
11251
11252
|
var namespaceNameSchema = external_exports.string().regex(
|
|
11252
11253
|
/^[a-z0-9](?:[a-z0-9-]{1,30}[a-z0-9])?\/[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/,
|
|
11253
11254
|
"Expected namespace/name"
|
|
@@ -11318,6 +11319,16 @@ var RegistryClient = class {
|
|
|
11318
11319
|
method: "GET"
|
|
11319
11320
|
});
|
|
11320
11321
|
}
|
|
11322
|
+
async list(namespace) {
|
|
11323
|
+
const params = new URLSearchParams();
|
|
11324
|
+
params.set("sort", "downloads");
|
|
11325
|
+
if (namespace) {
|
|
11326
|
+
params.set("namespace", namespace);
|
|
11327
|
+
}
|
|
11328
|
+
return this.request(`/skills?${params.toString()}`, {
|
|
11329
|
+
method: "GET"
|
|
11330
|
+
});
|
|
11331
|
+
}
|
|
11321
11332
|
async skillInfo(namespace, name) {
|
|
11322
11333
|
return this.request(`/skills/${namespace}/${name}`, {
|
|
11323
11334
|
method: "GET"
|
|
@@ -11749,6 +11760,26 @@ program.command("whoami").description("Show current authenticated user").action(
|
|
|
11749
11760
|
const me = await client.whoami();
|
|
11750
11761
|
console.log(`${me.user.username} (${me.user.role})`);
|
|
11751
11762
|
});
|
|
11763
|
+
program.command("list").description("List skills by download count (descending)").argument("[namespace]", "optional namespace").action(async (namespaceInput, _options, command) => {
|
|
11764
|
+
const { client } = await makeClient(command, true);
|
|
11765
|
+
const namespace = namespaceInput ? namespaceSchema.parse(namespaceInput) : void 0;
|
|
11766
|
+
const result = await client.list(namespace);
|
|
11767
|
+
if (result.skills.length === 0) {
|
|
11768
|
+
if (namespace) {
|
|
11769
|
+
console.log(`No skills found for namespace ${namespace}.`);
|
|
11770
|
+
} else {
|
|
11771
|
+
console.log("No skills found.");
|
|
11772
|
+
}
|
|
11773
|
+
return;
|
|
11774
|
+
}
|
|
11775
|
+
for (const skill of result.skills) {
|
|
11776
|
+
const latest = skill.latestVersion ?? "none";
|
|
11777
|
+
console.log(
|
|
11778
|
+
`${skill.namespace}/${skill.name} downloads=${skill.downloadCount} latest=${latest}`
|
|
11779
|
+
);
|
|
11780
|
+
console.log(` ${skill.description}`);
|
|
11781
|
+
}
|
|
11782
|
+
});
|
|
11752
11783
|
program.command("search").description("Search skills").argument("<query>", "search query").action(async (query, _options, command) => {
|
|
11753
11784
|
const { client } = await makeClient(command, true);
|
|
11754
11785
|
const result = await client.search(query);
|