@pmate/cli 0.20.5 → 0.20.6

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 +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20424,14 +20424,15 @@ var ServiceRuntimeRunner = class {
20424
20424
  async fetchLogPage(namespace, appName, options) {
20425
20425
  const baseUrl = (process.env.INDEXER_BASE_URL || "https://indexer.pmate.chat").replace(/\/$/, "");
20426
20426
  const chainId = process.env.BLOCKCHAIN_CHAIN_ID || "pmate";
20427
- const action = options.history ? "list" : "search";
20427
+ const hasSearch = Boolean(options.search?.trim());
20428
+ const action = options.history || !hasSearch ? "list" : "search";
20428
20429
  const url = new URL(
20429
20430
  `/chains/${encodeURIComponent(chainId)}/namespaces/${encodeURIComponent(namespace)}/log/${encodeURIComponent(appName)}/${action}`,
20430
20431
  `${baseUrl}/`
20431
20432
  );
20432
20433
  url.searchParams.set("page_id", String(options.page));
20433
- if (options.search && !options.history) {
20434
- url.searchParams.set("keyword", options.search);
20434
+ if (hasSearch && !options.history) {
20435
+ url.searchParams.set("keyword", options.search.trim());
20435
20436
  }
20436
20437
  const response = await fetch(url.toString(), {
20437
20438
  method: "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.20.5",
3
+ "version": "0.20.6",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {