@qzhuli/qzhuli-cli 0.5.2 → 0.5.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/cmd.js +9 -7
  2. package/package.json +1 -1
package/dist/cmd.js CHANGED
@@ -12716,8 +12716,7 @@ async function searchByName(factory, name) {
12716
12716
  };
12717
12717
  }
12718
12718
  const conversations3 = listResult.data ?? [];
12719
- const matchedIds = conversations3.filter((c) => c.name?.includes(name)).map((c) => c.id);
12720
- if (matchedIds.length === 0) {
12719
+ if (conversations3.length === 0) {
12721
12720
  return {
12722
12721
  status: "success",
12723
12722
  code: "NOT_FOUND" /* NOT_FOUND */,
@@ -12726,10 +12725,13 @@ async function searchByName(factory, name) {
12726
12725
  };
12727
12726
  }
12728
12727
  const profileResults = await Promise.all(
12729
- matchedIds.map((convId) => factory.repos.conversation.getProfile(convId))
12728
+ conversations3.map((c) => factory.repos.conversation.getProfile(c.id))
12730
12729
  );
12731
- const profiles = profileResults.filter((r) => r.ok).map((r) => r.data);
12732
- if (profiles.length === 0) {
12730
+ const matchedProfiles = profileResults.filter((r) => r.ok).map((r) => r.data).filter((p) => {
12731
+ const convName = p.conversation.name ?? "";
12732
+ return convName.includes(name);
12733
+ });
12734
+ if (matchedProfiles.length === 0) {
12733
12735
  return {
12734
12736
  status: "success",
12735
12737
  code: "NOT_FOUND" /* NOT_FOUND */,
@@ -12737,7 +12739,7 @@ async function searchByName(factory, name) {
12737
12739
  data: null
12738
12740
  };
12739
12741
  }
12740
- const items = profiles.map(profileToItem);
12742
+ const items = matchedProfiles.map(profileToItem);
12741
12743
  const groupedByUid = /* @__PURE__ */ new Map();
12742
12744
  for (const item of items) {
12743
12745
  const primaryUser = item.users[0];
@@ -15107,7 +15109,7 @@ async function main() {
15107
15109
  ${t("cli.banner")}` : t("cli.banner");
15108
15110
  program.addHelpText("beforeAll", `${banner}
15109
15111
  `);
15110
- program.name("qz").version(`v${"0.5.2"}`, "-v, --version", t("options.version")).helpOption("-h, --help", t("options.help")).option("-q, --jq <expr>", t("options.jq")).option("--dry-run", t("options.dryRun"));
15112
+ program.name("qz").version(`v${"0.5.3"}`, "-v, --version", t("options.version")).helpOption("-h, --help", t("options.help")).option("-q, --jq <expr>", t("options.jq")).option("--dry-run", t("options.dryRun"));
15111
15113
  program.usage("<command> [subcommand] [options]");
15112
15114
  program.hook("preAction", () => {
15113
15115
  const opts = program.opts();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzhuli/qzhuli-cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "CLI tool for Q助理 (QZhuli)",
5
5
  "main": "dist/cmd.js",
6
6
  "bin": {