@indexnetwork/cli 0.8.0 → 0.8.1

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 +10 -4
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -265,7 +265,10 @@ class ApiClient {
265
265
  async listNetworks() {
266
266
  const res = await this.get("/api/indexes");
267
267
  const body = await res.json();
268
- return body.indexes;
268
+ return body.indexes.map((n) => ({
269
+ ...n,
270
+ joinPolicy: n.joinPolicy ?? n.permissions?.joinPolicy
271
+ }));
269
272
  }
270
273
  async createNetwork(title, prompt) {
271
274
  const res = await this.post("/api/indexes", {
@@ -278,7 +281,8 @@ class ApiClient {
278
281
  async getNetwork(id) {
279
282
  const res = await this.get(`/api/indexes/${id}`);
280
283
  const body = await res.json();
281
- return body.index;
284
+ const n = body.index;
285
+ return { ...n, joinPolicy: n.joinPolicy ?? n.permissions?.joinPolicy };
282
286
  }
283
287
  async getNetworkMembers(id) {
284
288
  const res = await this.get(`/api/indexes/${id}/members`);
@@ -1034,10 +1038,12 @@ function opportunityTable(opportunities) {
1034
1038
  `);
1035
1039
  for (const opp of opportunities) {
1036
1040
  const shortId = opp.id.slice(0, 8);
1037
- const name = (opp.counterpartName ?? "Unknown").slice(0, nameW);
1041
+ const fallbackName = opp.actors?.[1]?.name ?? opp.actors?.find((a) => a.name)?.name;
1042
+ const name = (opp.counterpartName ?? fallbackName ?? "Unknown").slice(0, nameW);
1038
1043
  const category = (opp.interpretation?.category ?? "-").slice(0, catW);
1039
1044
  const st = opp.status.slice(0, statusW);
1040
- const conf = opp.interpretation?.confidence != null ? `${opp.interpretation.confidence}%` : "-";
1045
+ const rawConf = opp.interpretation?.confidence;
1046
+ const conf = rawConf != null ? `${Math.round(rawConf <= 1 ? rawConf * 100 : rawConf)}%` : "-";
1041
1047
  const date = opp.createdAt ? new Date(opp.createdAt).toLocaleDateString("en-US", {
1042
1048
  year: "numeric",
1043
1049
  month: "short",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Command-line interface for Index Network",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,10 +20,10 @@
20
20
  "publish:all": "bun scripts/publish.ts"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@indexnetwork/cli-linux-x64": "0.8.0",
24
- "@indexnetwork/cli-linux-arm64": "0.8.0",
25
- "@indexnetwork/cli-darwin-x64": "0.8.0",
26
- "@indexnetwork/cli-darwin-arm64": "0.8.0"
23
+ "@indexnetwork/cli-linux-x64": "0.8.1",
24
+ "@indexnetwork/cli-linux-arm64": "0.8.1",
25
+ "@indexnetwork/cli-darwin-x64": "0.8.1",
26
+ "@indexnetwork/cli-darwin-arm64": "0.8.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/bun": "latest"