c456-cli 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +13 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command as Command7 } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "c456-cli",
9
- version: "0.1.1",
9
+ version: "0.1.3",
10
10
  description: "C456 CLI - \u5185\u5BB9\u5F55\u5165\u4E0E\u6574\u7406\u5DE5\u5177",
11
11
  type: "module",
12
12
  bin: {
@@ -411,17 +411,23 @@ var intake_default = intake;
411
411
  // src/commands/fetch.js
412
412
  import { Command as Command2 } from "commander";
413
413
  var fetchProfile = new Command2().name("fetch").description("\u8D44\u6599\u6293\u53D6 - \u4ECE URL \u81EA\u52A8\u89E3\u6790\u5E73\u53F0\u8D44\u6599");
414
- fetchProfile.command("profile").description("\u6293\u53D6\u6307\u5B9A URL \u7684\u8D44\u6599\u6BB5\u6570\u636E").requiredOption("-u, --url <url>", "\u76EE\u6807 URL").option("-p, --profile-id <type>", "\u8D44\u6599\u7C7B\u578B\uFF1Alink_product/package_registry/github_origin/social_account").action(async (opts, cmd) => {
414
+ fetchProfile.command("profile").description("\u6293\u53D6\u6307\u5B9A URL \u7684\u8D44\u6599\u6BB5\u6570\u636E").requiredOption("-u, --url <url>", "\u76EE\u6807 URL").requiredOption(
415
+ "-p, --profile-id <type>",
416
+ [
417
+ "\u8D44\u6599\u7C7B\u578B\uFF08\u5FC5\u586B\uFF09\uFF1A",
418
+ "- link_product\uFF1A\u666E\u901A\u4EA7\u54C1/\u5B98\u7F51\u94FE\u63A5\uFF08\u89E3\u6790\u540D\u79F0\u3001\u56FE\u6807\u3001\u7B80\u4ECB\u7B49\uFF09",
419
+ "- package_registry\uFF1A\u8F6F\u4EF6\u5305\u5730\u5740\uFF08npm/RubyGems \u7B49\uFF09",
420
+ "- github_origin\uFF1A\u5F00\u6E90\u4ED3\u5E93\u5730\u5740\uFF08GitHub/GitLab/Gitee\uFF09",
421
+ "- social_account\uFF1A\u793E\u4EA4\u8D26\u53F7\u4E3B\u9875/\u9891\u9053\uFF08YouTube/\u6296\u97F3/\u5C0F\u7EA2\u4E66\u7B49\uFF09"
422
+ ].join("\n")
423
+ ).action(async (opts, cmd) => {
415
424
  const { apiKey, client } = resolveApi(cmd);
416
425
  if (!apiKey) {
417
426
  console.error("\u9519\u8BEF\uFF1A\u672A\u914D\u7F6E API Key");
418
427
  process.exit(1);
419
428
  }
420
429
  try {
421
- const body = { url: opts.url };
422
- if (opts.profileId) {
423
- body.profile_id = opts.profileId;
424
- }
430
+ const body = { url: opts.url, profile_id: opts.profileId };
425
431
  const result = await client.post("/fetches", body);
426
432
  const { data, suggested_title } = result.data;
427
433
  console.log("\u2705 \u8D44\u6599\u6293\u53D6\u6210\u529F");
@@ -435,7 +441,7 @@ fetchProfile.command("profile").description("\u6293\u53D6\u6307\u5B9A URL \u7684
435
441
  process.exit(1);
436
442
  }
437
443
  });
438
- fetchProfile.command("detect").description("\u81EA\u52A8\u68C0\u6D4B URL \u7C7B\u578B\u5E76\u6293\u53D6\u8D44\u6599\u5E76\u521B\u5EFA tool \u6536\u5F55").requiredOption("-u, --url <url>", "\u76EE\u6807 URL").action(async (opts, cmd) => {
444
+ fetchProfile.command("detect").description("\u521B\u5EFA tool \u6536\u5F55\u5E76\u5C1D\u8BD5\u81EA\u52A8\u89E3\u6790\u8D44\u6599\uFF08\u4E0D\u662F profile_id \u81EA\u52A8\u63A8\u65AD\uFF1B\u793E\u4EA4\u8D26\u53F7\u8BF7\u7528 fetch profile -p social_account\uFF09").requiredOption("-u, --url <url>", "\u76EE\u6807 URL").action(async (opts, cmd) => {
439
445
  const { apiKey, client } = resolveApi(cmd);
440
446
  if (!apiKey) {
441
447
  console.error("\u9519\u8BEF\uFF1A\u672A\u914D\u7F6E API Key");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c456-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "C456 CLI - 内容录入与整理工具",
5
5
  "type": "module",
6
6
  "bin": {