pontus-x_cli 1.2.7 → 1.2.8

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/README.md CHANGED
@@ -22,7 +22,7 @@ $ npm install -g pontus-x_cli
22
22
  $ pontus-x_cli COMMAND
23
23
  running command...
24
24
  $ pontus-x_cli (--version)
25
- pontus-x_cli/1.2.7 linux-x64 node-v26.3.0
25
+ pontus-x_cli/1.2.8 linux-x64 node-v26.3.0
26
26
  $ pontus-x_cli --help [COMMAND]
27
27
  USAGE
28
28
  $ pontus-x_cli COMMAND
@@ -106,7 +106,7 @@ EXAMPLES
106
106
  $ pontus-x_cli access did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686
107
107
  ```
108
108
 
109
- _See code: [src/commands/access.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/access.ts)_
109
+ _See code: [src/commands/access.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/access.ts)_
110
110
 
111
111
  ## `pontus-x_cli autocomplete [SHELL]`
112
112
 
@@ -161,7 +161,7 @@ EXAMPLES
161
161
  $ pontus-x_cli change-price did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a 10
162
162
  ```
163
163
 
164
- _See code: [src/commands/change-price.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/change-price.ts)_
164
+ _See code: [src/commands/change-price.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/change-price.ts)_
165
165
 
166
166
  ## `pontus-x_cli check-participant-compliance`
167
167
 
@@ -182,7 +182,7 @@ EXAMPLES
182
182
  $ pontus-x_cli check-participant-compliance -p ./CEP.data.json --vp ./CEP.vp.json
183
183
  ```
184
184
 
185
- _See code: [src/commands/check-participant-compliance.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/check-participant-compliance.ts)_
185
+ _See code: [src/commands/check-participant-compliance.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/check-participant-compliance.ts)_
186
186
 
187
187
  ## `pontus-x_cli compute [ALGORITHM]`
188
188
 
@@ -213,7 +213,7 @@ EXAMPLES
213
213
  $ pontus-x_cli compute <algorithmDid> -t <tag1> -t <tag2> ...
214
214
  ```
215
215
 
216
- _See code: [src/commands/compute.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/compute.ts)_
216
+ _See code: [src/commands/compute.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/compute.ts)_
217
217
 
218
218
  ## `pontus-x_cli compute-results JOBID`
219
219
 
@@ -236,7 +236,7 @@ EXAMPLES
236
236
  $ pontus-x_cli compute-results 215bae450c8f40f59bfc5d1ccada3931 -p https://provider.agrospai.udl.cat
237
237
  ```
238
238
 
239
- _See code: [src/commands/compute-results.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/compute-results.ts)_
239
+ _See code: [src/commands/compute-results.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/compute-results.ts)_
240
240
 
241
241
  ## `pontus-x_cli compute-status JOBID`
242
242
 
@@ -259,7 +259,7 @@ EXAMPLES
259
259
  $ pontus-x_cli compute-status 215bae450c8f40f59bfc5d1ccada3931 -p https://provider.agrospai.udl.cat
260
260
  ```
261
261
 
262
- _See code: [src/commands/compute-status.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/compute-status.ts)_
262
+ _See code: [src/commands/compute-status.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/compute-status.ts)_
263
263
 
264
264
  ## `pontus-x_cli edit-additional-metadata DID METADATAFILE`
265
265
 
@@ -283,7 +283,7 @@ EXAMPLES
283
283
  $ pontus-x_cli edit-additional-metadata did:op:dcdb747f8feff3122c6d6c0f45a339a6e09415e721f98f61cc2c1d62ab35a21f ./metadata.json
284
284
  ```
285
285
 
286
- _See code: [src/commands/edit-additional-metadata.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/edit-additional-metadata.ts)_
286
+ _See code: [src/commands/edit-additional-metadata.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/edit-additional-metadata.ts)_
287
287
 
288
288
  ## `pontus-x_cli edit-algo DID IMAGE TAG CHECKSUM ENTRYPOINT`
289
289
 
@@ -310,7 +310,7 @@ EXAMPLES
310
310
  $ pontus-x_cli edit-algo did:op:dcdb747f8feff3122c6d6c0f45a339a6e09415e721f98f61cc2c1d62ab35a21f rogargon/pandas-profiling 4.16 sha256:81dca5439f07dff4d56097546a9fce7335be3de8e2622dc105c64e54376f86b5 "python /algorithm/src/main.py"
311
311
  ```
312
312
 
313
- _See code: [src/commands/edit-algo.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/edit-algo.ts)_
313
+ _See code: [src/commands/edit-algo.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/edit-algo.ts)_
314
314
 
315
315
  ## `pontus-x_cli edit-asset-allowed`
316
316
 
@@ -338,7 +338,7 @@ EXAMPLES
338
338
  $ pontus-x_cli edit-asset-allowed -u 0xAbc123... --public
339
339
  ```
340
340
 
341
- _See code: [src/commands/edit-asset-allowed.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/edit-asset-allowed.ts)_
341
+ _See code: [src/commands/edit-asset-allowed.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/edit-asset-allowed.ts)_
342
342
 
343
343
  ## `pontus-x_cli edit-asset-url DID URL`
344
344
 
@@ -362,7 +362,7 @@ EXAMPLES
362
362
  $ pontus-x_cli edit-asset-url did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686 https://raw.githubusercontent.com/plotly/datasets/refs/heads/master/titanic.csv
363
363
  ```
364
364
 
365
- _See code: [src/commands/edit-asset-url.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/edit-asset-url.ts)_
365
+ _See code: [src/commands/edit-asset-url.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/edit-asset-url.ts)_
366
366
 
367
367
  ## `pontus-x_cli edit-trusted-algos`
368
368
 
@@ -388,7 +388,7 @@ EXAMPLES
388
388
  $ pontus-x_cli edit-trusted-algos -d <datasetDid1> <datasetDid2> ... -a <algorithmDid1> <algorithmDid2> ...
389
389
  ```
390
390
 
391
- _See code: [src/commands/edit-trusted-algos.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/edit-trusted-algos.ts)_
391
+ _See code: [src/commands/edit-trusted-algos.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/edit-trusted-algos.ts)_
392
392
 
393
393
  ## `pontus-x_cli edit-trusted-publishers`
394
394
 
@@ -413,7 +413,7 @@ EXAMPLES
413
413
  $ pontus-x_cli edit-trusted-publishers -d <datasetDid1> <datasetDid2> ... -p <publisherDid1> <publisherDid2> ...
414
414
  ```
415
415
 
416
- _See code: [src/commands/edit-trusted-publishers.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/edit-trusted-publishers.ts)_
416
+ _See code: [src/commands/edit-trusted-publishers.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/edit-trusted-publishers.ts)_
417
417
 
418
418
  ## `pontus-x_cli export-private-key`
419
419
 
@@ -435,7 +435,7 @@ EXAMPLES
435
435
  $ pontus-x_cli export-private-key
436
436
  ```
437
437
 
438
- _See code: [src/commands/export-private-key.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/export-private-key.ts)_
438
+ _See code: [src/commands/export-private-key.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/export-private-key.ts)_
439
439
 
440
440
  ## `pontus-x_cli generate-asset-credentials DID`
441
441
 
@@ -461,7 +461,7 @@ EXAMPLES
461
461
  $ pontus-x_cli generate-asset-credentials -p ./CEP.data.json -d ./did.json -c certificate.key did:op:01f8bc1e797a854dc718bd7a802acb07c5fc39f706b03dd454bceb66be6828c6
462
462
  ```
463
463
 
464
- _See code: [src/commands/generate-asset-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/generate-asset-credentials.ts)_
464
+ _See code: [src/commands/generate-asset-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/generate-asset-credentials.ts)_
465
465
 
466
466
  ## `pontus-x_cli generate-did-web`
467
467
 
@@ -482,7 +482,7 @@ EXAMPLES
482
482
  $ pontus-x_cli generate-did-web -d <https://compliance.agrospai.udl.cat> -c certificate-chain.crt
483
483
  ```
484
484
 
485
- _See code: [src/commands/generate-did-web.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/generate-did-web.ts)_
485
+ _See code: [src/commands/generate-did-web.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/generate-did-web.ts)_
486
486
 
487
487
  ## `pontus-x_cli generate-manifest`
488
488
 
@@ -506,7 +506,7 @@ EXAMPLES
506
506
  $ pontus-x_cli generate-manifest --keys-dir ./keys --password-env KEY_PASSWORD --output manifest.yaml
507
507
  ```
508
508
 
509
- _See code: [src/commands/generate-manifest.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/generate-manifest.ts)_
509
+ _See code: [src/commands/generate-manifest.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/generate-manifest.ts)_
510
510
 
511
511
  ## `pontus-x_cli generate-participant-credentials`
512
512
 
@@ -529,7 +529,7 @@ EXAMPLES
529
529
  $ pontus-x_cli generate-participant-credentials -p ./CEP.data.json -d ./did.json -c certificate.key
530
530
  ```
531
531
 
532
- _See code: [src/commands/generate-participant-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/generate-participant-credentials.ts)_
532
+ _See code: [src/commands/generate-participant-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/generate-participant-credentials.ts)_
533
533
 
534
534
  ## `pontus-x_cli generate-private-keys`
535
535
 
@@ -555,7 +555,7 @@ EXAMPLES
555
555
  $ pontus-x_cli generate-private-keys --count 5 --output-dir ./keys
556
556
  ```
557
557
 
558
- _See code: [src/commands/generate-private-keys.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/generate-private-keys.ts)_
558
+ _See code: [src/commands/generate-private-keys.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/generate-private-keys.ts)_
559
559
 
560
560
  ## `pontus-x_cli get DID`
561
561
 
@@ -575,7 +575,7 @@ EXAMPLES
575
575
  $ pontus-x_cli get did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a
576
576
  ```
577
577
 
578
- _See code: [src/commands/get.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/get.ts)_
578
+ _See code: [src/commands/get.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/get.ts)_
579
579
 
580
580
  ## `pontus-x_cli help [COMMAND]`
581
581
 
@@ -618,7 +618,7 @@ EXAMPLES
618
618
  $ pontus-x_cli login d999baae98ac5246568fd726be8832c49626867d.json
619
619
  ```
620
620
 
621
- _See code: [src/commands/login.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/login.ts)_
621
+ _See code: [src/commands/login.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/login.ts)_
622
622
 
623
623
  ## `pontus-x_cli logout`
624
624
 
@@ -635,7 +635,7 @@ EXAMPLES
635
635
  $ pontus-x_cli logout
636
636
  ```
637
637
 
638
- _See code: [src/commands/logout.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/logout.ts)_
638
+ _See code: [src/commands/logout.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/logout.ts)_
639
639
 
640
640
  ## `pontus-x_cli publish PATH`
641
641
 
@@ -667,7 +667,7 @@ EXAMPLES
667
667
  $ pontus-x_cli publish samples/publish/algo/index.ts
668
668
  ```
669
669
 
670
- _See code: [src/commands/publish.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/publish.ts)_
670
+ _See code: [src/commands/publish.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/publish.ts)_
671
671
 
672
672
  ## `pontus-x_cli render [DID]`
673
673
 
@@ -684,7 +684,7 @@ FLAGS
684
684
  -t, --tags=<value>... Tags to filter datasets (they must have all the provided tags)
685
685
  ```
686
686
 
687
- _See code: [src/commands/render.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/render.ts)_
687
+ _See code: [src/commands/render.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/render.ts)_
688
688
 
689
689
  ## `pontus-x_cli revoke`
690
690
 
@@ -708,7 +708,7 @@ EXAMPLES
708
708
  $ pontus-x_cli revoke -d did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a did:op:abcee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7b
709
709
  ```
710
710
 
711
- _See code: [src/commands/revoke.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/revoke.ts)_
711
+ _See code: [src/commands/revoke.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/revoke.ts)_
712
712
 
713
713
  ## `pontus-x_cli self-description DID SDURL`
714
714
 
@@ -732,7 +732,7 @@ EXAMPLES
732
732
  $ pontus-x_cli self-description did:op:d22954f2cbf6a85c897ce605c275cc786e099592cc59e3b7dd66b93e784bed8c https://example.com/self-description.json
733
733
  ```
734
734
 
735
- _See code: [src/commands/self-description.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.7/src/commands/self-description.ts)_
735
+ _See code: [src/commands/self-description.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.8/src/commands/self-description.ts)_
736
736
  <!-- commandsstop -->
737
737
 
738
738
  # Useful information
@@ -1,5 +1,5 @@
1
- import type { ComputeJob } from '@oceanprotocol/lib';
2
- import { Command } from '@oclif/core';
1
+ import type { ComputeJob } from "@oceanprotocol/lib";
2
+ import { Command } from "@oclif/core";
3
3
  export default class Compute extends Command {
4
4
  static args: {
5
5
  algorithm: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
@@ -3,28 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_fs_1 = __importDefault(require("node:fs"));
7
+ const promises_1 = require("node:timers/promises");
8
+ const prompts_1 = require("@inquirer/prompts");
9
+ const core_1 = require("@oclif/core");
10
+ const chalk_1 = __importDefault(require("chalk"));
11
+ const readline_sync_1 = __importDefault(require("readline-sync"));
6
12
  const config_1 = require("../config");
7
13
  const aquarius_1 = require("../lib/aquarius");
8
14
  const asset_1 = require("../utils/asset");
9
15
  const connection_1 = require("../utils/connection");
10
16
  const login_1 = require("../utils/login");
11
- const prompts_1 = require("@inquirer/prompts");
12
- const core_1 = require("@oclif/core");
13
- const chalk_1 = __importDefault(require("chalk"));
14
- const fs_1 = __importDefault(require("fs"));
15
- const promises_1 = require("node:timers/promises");
16
- const readline_sync_1 = __importDefault(require("readline-sync"));
17
17
  class Compute extends core_1.Command {
18
18
  async run() {
19
19
  const { args, flags } = await this.parse(Compute);
20
20
  // Network selection
21
21
  const network = flags.network || (0, login_1.getEnvNetwork)() || (await (0, login_1.askForNetwork)());
22
22
  const chainId = config_1.NETWORK_CONFIGS[network].chainId;
23
- console.log(`${chalk_1.default.green('Using network:')} ${network}\n`);
23
+ console.log(`${chalk_1.default.green("Using network:")} ${network}\n`);
24
24
  var algoParams = {};
25
25
  if (flags.algoParams) {
26
26
  try {
27
- const jsonString = fs_1.default.readFileSync(flags.algoParams, 'utf-8');
27
+ const jsonString = node_fs_1.default.readFileSync(flags.algoParams, "utf-8");
28
28
  algoParams = JSON.parse(jsonString);
29
29
  }
30
30
  catch (err) {
@@ -32,34 +32,38 @@ class Compute extends core_1.Command {
32
32
  this.error(`Error reading file: ${message}`);
33
33
  }
34
34
  }
35
- this.log('Algorithm parameters:', flags.parameters, Object.keys(algoParams));
35
+ this.log("Algorithm parameters:", flags.parameters, Object.keys(algoParams));
36
36
  // Authentication selection
37
37
  const loginInfos = await (0, login_1.getLoginInfos)(flags.manifest);
38
38
  const inputLoginInfo = loginInfos.length === 1 ? loginInfos[0] : null;
39
39
  if (inputLoginInfo) {
40
- console.log(`${chalk_1.default.green('Using account:')} ${chalk_1.default.blue(inputLoginInfo.ownerAddress)} ${chalk_1.default.magenta(inputLoginInfo.ownerName)}\n`);
40
+ console.log(`${chalk_1.default.green("Using account:")} ${chalk_1.default.blue(inputLoginInfo.ownerAddress)} ${chalk_1.default.magenta(inputLoginInfo.ownerName)}\n`);
41
41
  }
42
42
  const loginInfo = inputLoginInfo !== null && inputLoginInfo !== void 0 ? inputLoginInfo : (await askForAccountSelection(loginInfos));
43
43
  // Algorithm selection
44
- const inputAlgorithm = args.algorithm ? await (0, aquarius_1.getAssetInfo)(args.algorithm) : null;
44
+ const inputAlgorithm = args.algorithm
45
+ ? await (0, aquarius_1.getAssetInfo)(args.algorithm)
46
+ : null;
45
47
  if (inputAlgorithm) {
46
48
  console.log(`Algorithm to run: ${chalk_1.default.blue(inputAlgorithm.name)} (${chalk_1.default.gray(inputAlgorithm.did)})\n`);
47
49
  }
48
50
  const algorithm = inputAlgorithm !== null && inputAlgorithm !== void 0 ? inputAlgorithm : (await askForAlgorithm(chainId));
49
51
  // Datasets selection
50
- const inputDatasets = flags.datasets ? await (0, aquarius_1.getAssetsFromDids)(flags.datasets) : null;
52
+ const inputDatasets = flags.datasets
53
+ ? await (0, aquarius_1.getAssetsFromDids)(flags.datasets)
54
+ : null;
51
55
  if (inputDatasets) {
52
- console.log('\nThe following assets will be used:');
56
+ console.log("\nThe following assets will be used:");
53
57
  for (const asset of inputDatasets) {
54
58
  const ownerName = await (0, aquarius_1.getOwnerName)(asset.owner);
55
- console.log(`${chalk_1.default.blue(asset.did)} | ${chalk_1.default.green(asset.created.split('T')[0])} | ${chalk_1.default.yellow(ownerName)} | ${chalk_1.default.magenta(asset.name)}`);
59
+ console.log(`${chalk_1.default.blue(asset.did)} | ${chalk_1.default.green(asset.created.split("T")[0])} | ${chalk_1.default.yellow(ownerName)} | ${chalk_1.default.magenta(asset.name)}`);
56
60
  }
57
61
  }
58
62
  const datasets = inputDatasets !== null && inputDatasets !== void 0 ? inputDatasets : (await askForDatasets(chainId));
59
63
  // Confirmation prompt
60
64
  if (!flags.yes &&
61
- !readline_sync_1.default.keyInYNStrict('\nDo you want to proceed with running the algorithm on the selected datasets?')) {
62
- console.log('Operation cancelled by the user.');
65
+ !readline_sync_1.default.keyInYNStrict("\nDo you want to proceed with running the algorithm on the selected datasets?")) {
66
+ console.log("Operation cancelled by the user.");
63
67
  return;
64
68
  }
65
69
  // Run compute
@@ -72,7 +76,9 @@ class Compute extends core_1.Command {
72
76
  const computeJob = await connection.nautilus.compute({
73
77
  algorithm: { did: algorithm.did, algocustomdata: algoParams },
74
78
  dataset: { did: datasets[0].did },
75
- additionalDatasets: datasets.filter((_, i) => i > 0).map(dataset => ({ did: dataset.did })),
79
+ additionalDatasets: datasets
80
+ .filter((_, i) => i > 0)
81
+ .map((dataset) => ({ did: dataset.did })),
76
82
  });
77
83
  const firstDatasetAsset = await connection.nautilus.getAquariusAsset(datasets[0].did);
78
84
  const provider = firstDatasetAsset.services[0].serviceEndpoint;
@@ -91,51 +97,51 @@ class Compute extends core_1.Command {
91
97
  }
92
98
  }
93
99
  Compute.args = {
94
- algorithm: core_1.Args.string({ description: 'Algorithm DID (did:op:...)' }),
100
+ algorithm: core_1.Args.string({ description: "Algorithm DID (did:op:...)" }),
95
101
  };
96
- Compute.description = 'Compute the algorithm on one or more datasets.';
102
+ Compute.description = "Compute the algorithm on one or more datasets.";
97
103
  Compute.examples = [
98
- '<%= config.bin %> <%= command.id %> <algorithmDid> -d <datasetDid1> <datasetDid2> ...',
99
- '<%= config.bin %> <%= command.id %> <algorithmDid> -t <tag1> -t <tag2> ...',
104
+ "<%= config.bin %> <%= command.id %> <algorithmDid> -d <datasetDid1> <datasetDid2> ...",
105
+ "<%= config.bin %> <%= command.id %> <algorithmDid> -t <tag1> -t <tag2> ...",
100
106
  ];
101
107
  Compute.flags = {
102
108
  datasets: core_1.Flags.string({
103
- char: 'd',
104
- description: 'Dataset DIDs (did:op:...)',
109
+ char: "d",
110
+ description: "Dataset DIDs (did:op:...)",
105
111
  multiple: true,
106
112
  }),
107
113
  yes: core_1.Flags.boolean({
108
- char: 'y',
114
+ char: "y",
109
115
  default: false,
110
- description: 'Automatic yes to prompts',
116
+ description: "Automatic yes to prompts",
111
117
  }),
112
118
  manifest: core_1.Flags.string({
113
- char: 'm',
114
- description: 'Path to manifest file with the accounts to use for authentication',
119
+ char: "m",
120
+ description: "Path to manifest file with the accounts to use for authentication",
115
121
  }),
116
122
  algoParams: core_1.Flags.string({
117
- char: 'a',
118
- description: 'Path to algorithm parameters file with the algorithm execution parameters',
123
+ char: "a",
124
+ description: "Path to algorithm parameters file with the algorithm execution parameters",
119
125
  }),
120
126
  network: core_1.Flags.string({
121
- char: 'n',
122
- description: 'Network to use (env: NETWORK)',
127
+ char: "n",
128
+ description: "Network to use (env: NETWORK)",
123
129
  options: Object.keys(config_1.NETWORK_CONFIGS),
124
130
  }),
125
131
  };
126
132
  exports.default = Compute;
127
133
  async function askForDatasets(chainId) {
128
- console.log('\nSelect the filters to find the datasets you want to use:');
134
+ console.log("\nSelect the filters to find the datasets you want to use:");
129
135
  return (0, asset_1.PromptForAssets)({
130
- assetTypes: ['dataset'],
131
- accessTypes: ['compute'],
136
+ assetTypes: ["dataset"],
137
+ accessTypes: ["compute"],
132
138
  chainIds: [chainId],
133
139
  });
134
140
  }
135
141
  async function askForAlgorithm(chainId) {
136
- console.log('\nSelect an algorithm to run:');
142
+ console.log("\nSelect an algorithm to run:");
137
143
  const answer = await (0, prompts_1.search)({
138
- message: 'Search for an algorithm by name:',
144
+ message: "Search for an algorithm by name:",
139
145
  pageSize: 10,
140
146
  source: async (input, { signal }) => {
141
147
  if (!input) {
@@ -145,8 +151,8 @@ async function askForAlgorithm(chainId) {
145
151
  if (signal.aborted)
146
152
  return [];
147
153
  const assets = await (0, aquarius_1.searchAssets)({
148
- assetTypes: ['algorithm'],
149
- accessTypes: ['compute'],
154
+ assetTypes: ["algorithm"],
155
+ accessTypes: ["compute"],
150
156
  chainIds: [chainId],
151
157
  searchText: input,
152
158
  signal,
@@ -166,8 +172,8 @@ async function askForAlgorithm(chainId) {
166
172
  }
167
173
  async function askForAccountSelection(loginInfos) {
168
174
  const answer = await (0, prompts_1.select)({
169
- message: 'Select the account to use:',
170
- choices: loginInfos.map(info => ({
175
+ message: "Select the account to use:",
176
+ choices: loginInfos.map((info) => ({
171
177
  name: `${info.ownerAddress} (${info.ownerName})`,
172
178
  value: info,
173
179
  })),
@@ -1 +1 @@
1
- {"version":3,"file":"compute.js","sourceRoot":"","sources":["../../src/commands/compute.ts"],"names":[],"mappings":";;;;;AAAA,qCAAwD;AACxD,6CAA4G;AAC5G,yCAA+C;AAC/C,mDAA+C;AAC/C,yCAA2F;AAC3F,+CAAkD;AAElD,sCAAkD;AAClD,kDAAyB;AACzB,4CAAmB;AACnB,mDAAiD;AACjD,kEAAwC;AAExC,MAAqB,OAAQ,SAAQ,cAAO;IAmC1C,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAEjD,oBAAoB;QACpB,MAAM,OAAO,GAAI,KAA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G;oBAClD,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,sBAAsB,CACnC,UAAuB;IAEvB,MAAM,MAAM,GAAG,MAAM,IAAA,gBAAM,EAAC;QAC1B,OAAO,EAAE,4BAA4B;QACrC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACjC,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,SAAS,GAAG;YAChD,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;KACJ,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Command } from '@oclif/core';
1
+ import { Command } from "@oclif/core";
2
2
  export default class EditAssetAllowed extends Command {
3
3
  static description: string;
4
4
  static examples: Command.Example[];
@@ -3,29 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const nautilus_1 = require("@deltadao/nautilus");
7
+ const core_1 = require("@oclif/core");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const readline_sync_1 = __importDefault(require("readline-sync"));
6
10
  const config_1 = require("../config");
7
11
  const aquarius_1 = require("../lib/aquarius");
8
12
  const asset_1 = require("../utils/asset");
9
13
  const connection_1 = require("../utils/connection");
10
14
  const login_1 = require("../utils/login");
11
- const nautilus_1 = require("@deltadao/nautilus");
12
- const core_1 = require("@oclif/core");
13
- const chalk_1 = __importDefault(require("chalk"));
14
- const readline_sync_1 = __importDefault(require("readline-sync"));
15
15
  class EditAssetAllowed extends core_1.Command {
16
16
  async run() {
17
17
  var _a, _b, _c;
18
18
  const { flags } = await this.parse(EditAssetAllowed);
19
19
  // Validation
20
20
  if (flags.public && ((_a = flags.users) === null || _a === void 0 ? void 0 : _a.length)) {
21
- this.error('You cannot specify user addresses and set the asset as public at the same time.');
21
+ this.error("You cannot specify user addresses and set the asset as public at the same time.");
22
22
  }
23
23
  if (!flags.public && !((_b = flags.users) === null || _b === void 0 ? void 0 : _b.length)) {
24
- this.error('You must either specify user addresses with -u or use --public to remove all restrictions.');
24
+ this.error("You must either specify user addresses with -u or use --public to remove all restrictions.");
25
25
  }
26
26
  // Network selection
27
27
  const network = flags.network || (0, login_1.getEnvNetwork)() || (await (0, login_1.askForNetwork)());
28
- console.log(`${chalk_1.default.green('Using network:')} ${network}\n`);
28
+ console.log(`${chalk_1.default.green("Using network:")} ${network}\n`);
29
29
  const chainId = config_1.NETWORK_CONFIGS[network].chainId;
30
30
  // Authentication selection
31
31
  const loginInfos = await (0, login_1.getLoginInfos)(flags.manifest);
@@ -34,28 +34,28 @@ class EditAssetAllowed extends core_1.Command {
34
34
  const assets = flags.datasets
35
35
  ? await (0, aquarius_1.getAssetsFromDids)(flags.datasets)
36
36
  : await askForAssets(loginInfos, chainId);
37
- console.log('\nThe following assets will be edited:');
37
+ console.log("\nThe following assets will be edited:");
38
38
  for (const asset of assets) {
39
39
  const ownerName = await (0, aquarius_1.getOwnerName)(asset.owner);
40
- console.log(`${chalk_1.default.blue(asset.did)} | ${chalk_1.default.green(asset.created.split('T')[0])} | ${chalk_1.default.yellow(ownerName)} | ${chalk_1.default.magenta(asset.name)}`);
40
+ console.log(`${chalk_1.default.blue(asset.did)} | ${chalk_1.default.green(asset.created.split("T")[0])} | ${chalk_1.default.yellow(ownerName)} | ${chalk_1.default.magenta(asset.name)}`);
41
41
  }
42
42
  // Summary of what will change
43
43
  if (flags.public) {
44
- console.log('\nAssets will be set as public (all address restrictions removed).');
44
+ console.log("\nAssets will be set as public (all address restrictions removed).");
45
45
  }
46
46
  else if ((_c = flags.users) === null || _c === void 0 ? void 0 : _c.length) {
47
- console.log('\nThe following addresses will be set as allowed users:');
47
+ console.log("\nThe following addresses will be set as allowed users:");
48
48
  for (const address of flags.users) {
49
49
  console.log(` ${chalk_1.default.cyan(address)}`);
50
50
  }
51
51
  }
52
52
  else {
53
- console.log('\nNo users specified — assets will be set to deny all (empty allow list).');
53
+ console.log("\nNo users specified — assets will be set to deny all (empty allow list).");
54
54
  }
55
55
  // Confirmation prompt
56
56
  if (!flags.yes &&
57
- !readline_sync_1.default.keyInYNStrict('\nDo you want to proceed with editing the allowed users for the selected assets?')) {
58
- console.log('Operation cancelled by the user.');
57
+ !readline_sync_1.default.keyInYNStrict("\nDo you want to proceed with editing the allowed users for the selected assets?")) {
58
+ console.log("Operation cancelled by the user.");
59
59
  return;
60
60
  }
61
61
  // Edit each asset
@@ -70,17 +70,21 @@ class EditAssetAllowed extends core_1.Command {
70
70
  const aquariusAsset = await connection.nautilus.getAquariusAsset(asset.did);
71
71
  const assetBuilder = new nautilus_1.AssetBuilder(aquariusAsset);
72
72
  if (flags.public) {
73
- ;
74
- [nautilus_1.CredentialListTypes.ALLOW, nautilus_1.CredentialListTypes.DENY].forEach(type => {
73
+ [nautilus_1.CredentialListTypes.ALLOW, nautilus_1.CredentialListTypes.DENY].forEach((type) => {
75
74
  var _a, _b, _c, _d;
76
75
  // Delete current allowed addresses
77
- const existing = (_d = (_c = (_b = (_a = aquariusAsset.credentials) === null || _a === void 0 ? void 0 : _a[type]) === null || _b === void 0 ? void 0 : _b.find((c) => c.type === 'address')) === null || _c === void 0 ? void 0 : _c.values) !== null && _d !== void 0 ? _d : [];
76
+ const existing = (_d = (_c = (_b = (_a = aquariusAsset.credentials) === null || _a === void 0 ? void 0 : _a[type]) === null || _b === void 0 ? void 0 : _b.find((c) => c.type === "address")) === null || _c === void 0 ? void 0 : _c.values) !== null && _d !== void 0 ? _d : [];
78
77
  assetBuilder.removeCredentialAddresses(type, existing);
79
78
  });
80
79
  }
81
80
  else {
82
- ;
83
- [nautilus_1.CredentialListTypes.ALLOW].forEach(type => { var _a; return assetBuilder.addCredentialAddresses(type, [asset.owner, ...((_a = flags.users) !== null && _a !== void 0 ? _a : [])]); });
81
+ [nautilus_1.CredentialListTypes.ALLOW].forEach((type) => {
82
+ var _a;
83
+ assetBuilder.addCredentialAddresses(type, [
84
+ asset.owner,
85
+ ...((_a = flags.users) !== null && _a !== void 0 ? _a : []),
86
+ ]);
87
+ });
84
88
  }
85
89
  const nautilusAsset = assetBuilder.build();
86
90
  const result = await connection.nautilus.edit(nautilusAsset);
@@ -92,49 +96,49 @@ class EditAssetAllowed extends core_1.Command {
92
96
  }
93
97
  }
94
98
  }
95
- EditAssetAllowed.description = 'Overwrite the list of allowed users for assets';
99
+ EditAssetAllowed.description = "Overwrite the list of allowed users for assets";
96
100
  EditAssetAllowed.examples = [
97
- '<%= config.bin %> <%= command.id %> -u 0xAbc123... 0xDef456... -d <assetDid1> <assetDid2>',
98
- '<%= config.bin %> <%= command.id %> -u 0xAbc123... --public',
101
+ "<%= config.bin %> <%= command.id %> -u 0xAbc123... 0xDef456... -d <assetDid1> <assetDid2>",
102
+ "<%= config.bin %> <%= command.id %> -u 0xAbc123... --public",
99
103
  ];
100
104
  EditAssetAllowed.flags = {
101
105
  users: core_1.Flags.string({
102
- char: 'u',
103
- description: 'Ethereum addresses of users to allow (0x...)',
106
+ char: "u",
107
+ description: "Ethereum addresses of users to allow (0x...)",
104
108
  multiple: true,
105
109
  required: false,
106
110
  }),
107
111
  datasets: core_1.Flags.string({
108
- char: 'd',
109
- description: 'Asset DIDs to edit (did:op:...)',
112
+ char: "d",
113
+ description: "Asset DIDs to edit (did:op:...)",
110
114
  multiple: true,
111
115
  }),
112
116
  yes: core_1.Flags.boolean({
113
- char: 'y',
114
- description: 'Skip confirmation prompt',
117
+ char: "y",
118
+ description: "Skip confirmation prompt",
115
119
  }),
116
120
  manifest: core_1.Flags.string({
117
- char: 'm',
118
- description: 'Path to manifest file with the accounts to use for authentication',
121
+ char: "m",
122
+ description: "Path to manifest file with the accounts to use for authentication",
119
123
  }),
120
124
  public: core_1.Flags.boolean({
121
- char: 'p',
122
- description: 'Make assets public (remove all address restrictions)',
125
+ char: "p",
126
+ description: "Make assets public (remove all address restrictions)",
123
127
  }),
124
128
  network: core_1.Flags.string({
125
- char: 'n',
126
- description: 'Network to use (env: NETWORK)',
129
+ char: "n",
130
+ description: "Network to use (env: NETWORK)",
127
131
  options: Object.keys(config_1.NETWORK_CONFIGS),
128
132
  }),
129
133
  };
130
134
  exports.default = EditAssetAllowed;
131
135
  async function askForAssets(loginInfos, chainId) {
132
- console.log('\nPlease select the filters to find the assets you want to edit:');
136
+ console.log("\nPlease select the filters to find the assets you want to edit:");
133
137
  return (0, asset_1.PromptForAssets)({
134
- assetTypes: ['dataset', 'algorithm'],
135
- accessTypes: ['access', 'compute'],
138
+ assetTypes: ["dataset", "algorithm"],
139
+ accessTypes: ["access", "compute"],
136
140
  chainIds: [chainId],
137
- ownerChoices: loginInfos.map(info => ({
141
+ ownerChoices: loginInfos.map((info) => ({
138
142
  name: info.ownerName,
139
143
  value: info.ownerAddress,
140
144
  })),