pontus-x_cli 0.0.7 → 1.0.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 (105) hide show
  1. package/README.md +559 -157
  2. package/bin/dev.js +7 -0
  3. package/bin/run.js +8 -0
  4. package/dist/commands/access.d.ts +9 -0
  5. package/dist/commands/access.js +23 -0
  6. package/dist/commands/access.js.map +1 -0
  7. package/dist/commands/change-price.d.ts +13 -0
  8. package/dist/commands/change-price.js +49 -0
  9. package/dist/commands/change-price.js.map +1 -0
  10. package/dist/commands/check-participant-compliance.d.ts +10 -0
  11. package/dist/commands/check-participant-compliance.js +54 -0
  12. package/dist/commands/check-participant-compliance.js.map +1 -0
  13. package/dist/commands/compute-results.d.ts +12 -0
  14. package/dist/commands/compute-results.js +40 -0
  15. package/dist/commands/compute-results.js.map +1 -0
  16. package/dist/commands/compute-status.d.ts +12 -0
  17. package/dist/commands/compute-status.js +40 -0
  18. package/dist/commands/compute-status.js.map +1 -0
  19. package/dist/commands/compute.d.ts +14 -0
  20. package/dist/commands/compute.js +66 -0
  21. package/dist/commands/compute.js.map +1 -0
  22. package/dist/commands/edit-algo.d.ts +16 -0
  23. package/dist/commands/edit-algo.js +51 -0
  24. package/dist/commands/edit-algo.js.map +1 -0
  25. package/dist/commands/edit-asset-url.d.ts +13 -0
  26. package/dist/commands/edit-asset-url.js +55 -0
  27. package/dist/commands/edit-asset-url.js.map +1 -0
  28. package/dist/commands/edit-trusted-algos.d.ts +13 -0
  29. package/dist/commands/edit-trusted-algos.js +54 -0
  30. package/dist/commands/edit-trusted-algos.js.map +1 -0
  31. package/dist/commands/export-private-key.d.ts +11 -0
  32. package/dist/commands/export-private-key.js +67 -0
  33. package/dist/commands/export-private-key.js.map +1 -0
  34. package/dist/commands/generate-asset-credentials.d.ts +15 -0
  35. package/dist/commands/generate-asset-credentials.js +59 -0
  36. package/dist/commands/generate-asset-credentials.js.map +1 -0
  37. package/dist/commands/generate-did-web.d.ts +10 -0
  38. package/dist/commands/generate-did-web.js +39 -0
  39. package/dist/commands/generate-did-web.js.map +1 -0
  40. package/dist/commands/generate-participant-credentials.d.ts +12 -0
  41. package/dist/commands/generate-participant-credentials.js +51 -0
  42. package/dist/commands/generate-participant-credentials.js.map +1 -0
  43. package/dist/commands/get.d.ts +9 -0
  44. package/dist/commands/get.js +23 -0
  45. package/dist/commands/get.js.map +1 -0
  46. package/dist/commands/login.d.ts +14 -0
  47. package/dist/commands/login.js +51 -0
  48. package/dist/commands/login.js.map +1 -0
  49. package/dist/commands/logout.d.ts +6 -0
  50. package/dist/commands/logout.js +24 -0
  51. package/dist/commands/logout.js.map +1 -0
  52. package/dist/commands/publish.d.ts +15 -0
  53. package/dist/commands/publish.js +107 -0
  54. package/dist/commands/publish.js.map +1 -0
  55. package/dist/commands/revoke.d.ts +12 -0
  56. package/dist/commands/revoke.js +50 -0
  57. package/dist/commands/revoke.js.map +1 -0
  58. package/dist/commands/self-description.d.ts +13 -0
  59. package/dist/commands/self-description.js +53 -0
  60. package/dist/commands/self-description.js.map +1 -0
  61. package/dist/config.d.ts +48 -0
  62. package/dist/config.js +106 -117
  63. package/dist/config.js.map +1 -1
  64. package/dist/index.d.ts +2 -0
  65. package/dist/index.js +3 -444
  66. package/dist/index.js.map +1 -1
  67. package/dist/lib/gaia-x_compliance/generate-credentials/index.d.ts +1 -0
  68. package/dist/{gaia-x_compliance → lib/gaia-x_compliance}/generate-credentials/index.js +55 -105
  69. package/dist/lib/gaia-x_compliance/generate-credentials/index.js.map +1 -0
  70. package/dist/{gaia-x_compliance → lib/gaia-x_compliance}/generate-credentials/templates/participant.hbs +5 -1
  71. package/dist/lib/publishFromFile.d.ts +2 -0
  72. package/dist/lib/publishFromFile.js +143 -0
  73. package/dist/lib/publishFromFile.js.map +1 -0
  74. package/dist/types/schema.d.ts +2 -0
  75. package/dist/types/schema.js +8 -0
  76. package/dist/types/schema.js.map +1 -0
  77. package/dist/types/schema.json +474 -0
  78. package/dist/utils/connection.d.ts +13 -0
  79. package/dist/utils/connection.js +11 -19
  80. package/dist/utils/connection.js.map +1 -1
  81. package/oclif.manifest.json +830 -0
  82. package/package.json +72 -40
  83. package/dist/aquarius-query/index.js +0 -30
  84. package/dist/aquarius-query/index.js.map +0 -1
  85. package/dist/export-key-as-json/index.js +0 -27
  86. package/dist/export-key-as-json/index.js.map +0 -1
  87. package/dist/gaia-x_compliance/generate-credentials/index.js.map +0 -1
  88. package/dist/gaia-x_compliance/generate-did-web/index.js +0 -14
  89. package/dist/gaia-x_compliance/generate-did-web/index.js.map +0 -1
  90. package/dist/publish/samples/algo/index.js +0 -62
  91. package/dist/publish/samples/algo/index.js.map +0 -1
  92. package/dist/publish/samples/basic-predictor/index.js +0 -83
  93. package/dist/publish/samples/basic-predictor/index.js.map +0 -1
  94. package/dist/publish/samples/data/index.js +0 -55
  95. package/dist/publish/samples/data/index.js.map +0 -1
  96. package/dist/utils/index.js +0 -20
  97. package/dist/utils/index.js.map +0 -1
  98. package/dist/utils/package-version.js +0 -22
  99. package/dist/utils/package-version.js.map +0 -1
  100. package/dist/utils/publish-script-runner.js +0 -60
  101. package/dist/utils/publish-script-runner.js.map +0 -1
  102. /package/dist/{gaia-x_compliance → lib/gaia-x_compliance}/generate-credentials/templates/dataset.hbs +0 -0
  103. /package/dist/{gaia-x_compliance → lib/gaia-x_compliance}/generate-credentials/templates/lrn-request.hbs +0 -0
  104. /package/dist/{gaia-x_compliance → lib/gaia-x_compliance}/generate-credentials/templates/service.hbs +0 -0
  105. /package/dist/{gaia-x_compliance → lib/gaia-x_compliance}/generate-credentials/templates/tandc.hbs +0 -0
package/bin/dev.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ts-node
2
+
3
+ // eslint-disable-next-line unicorn/prefer-top-level-await
4
+ ; (async () => {
5
+ const oclif = await import('@oclif/core')
6
+ await oclif.execute({ development: true, dir: __dirname })
7
+ })()
package/bin/run.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ // eslint-disable-next-line unicorn/prefer-top-level-await
4
+ (async () => {
5
+ require('dotenv').config()
6
+ const oclif = await import('@oclif/core')
7
+ await oclif.execute({ dir: __dirname })
8
+ })()
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Access extends Command {
3
+ static args: {
4
+ did: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: Command.Example[];
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const connection_1 = require("../utils/connection");
5
+ class Access extends core_1.Command {
6
+ async run() {
7
+ const { args } = await this.parse(Access);
8
+ const { did } = args;
9
+ this.log(`Getting access to downloadable asset: ${did}`);
10
+ const { nautilus } = await connection_1.Connection.connect();
11
+ const accessUrl = await nautilus.access({ assetDid: did });
12
+ this.log(`Download URL: ${accessUrl}\n`);
13
+ }
14
+ }
15
+ Access.args = {
16
+ did: core_1.Args.string({ description: 'DID of the asset', required: true }),
17
+ };
18
+ Access.description = 'Access an asset that can be downloaded given its DID';
19
+ Access.examples = [
20
+ '<%= config.bin %> <%= command.id %> did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686',
21
+ ];
22
+ exports.default = Access;
23
+ //# sourceMappingURL=access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.js","sourceRoot":"","sources":["../../src/commands/access.ts"],"names":[],"mappings":";;AAAA,sCAAyC;AAEzC,oDAA8C;AAE9C,MAAqB,MAAO,SAAQ,cAAO;IASzC,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACvC,MAAM,EAAC,GAAG,EAAC,GAAG,IAAI,CAAA;QAClB,IAAI,CAAC,GAAG,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAA;QACxD,MAAM,EAAC,QAAQ,EAAC,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAA;QAC7C,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAC,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAA;QACxD,IAAI,CAAC,GAAG,CAAC,iBAAiB,SAAS,IAAI,CAAC,CAAA;IAC1C,CAAC;;AAfM,WAAI,GAAG;IACZ,GAAG,EAAE,WAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;CACpE,CAAA;AACM,kBAAW,GAAG,sDAAsD,CAAA;AACpE,eAAQ,GAAsB;IACnC,6GAA6G;CAC9G,CAAA;kBAPkB,MAAM"}
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ChangePrice extends Command {
3
+ static args: {
4
+ did: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ newPrice: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ static description: string;
11
+ static examples: Command.Example[];
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const readline_sync_1 = __importDefault(require("readline-sync"));
8
+ const connection_1 = require("../utils/connection");
9
+ class ChangePrice extends core_1.Command {
10
+ async run() {
11
+ var _a, _b;
12
+ const { args, flags } = await this.parse(ChangePrice);
13
+ const { did, newPrice } = args;
14
+ const connection = await connection_1.Connection.connect();
15
+ const newPriceNumber = Number.parseFloat(newPrice.replace(',', '.'));
16
+ if (flags.yes || readline_sync_1.default.keyInYNStrict(`Set the price to ${newPriceNumber.toString()} for asset ${did}? `)) {
17
+ try {
18
+ const aquariusAsset = await connection.nautilus.getAquariusAsset(did);
19
+ const serviceId = (_b = (_a = aquariusAsset.services) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
20
+ const tx = await connection.nautilus.setServicePrice(aquariusAsset, serviceId, newPriceNumber.toString());
21
+ this.log(`Price updated for asset, transaction: ${connection.networkConfig.explorerUri}/tx/${tx.transactionHash}\n`);
22
+ }
23
+ catch (error) {
24
+ this.error(`Error changing the price: ${error}`);
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ChangePrice.args = {
30
+ did: core_1.Args.string({ description: 'DID of the asset', required: true }),
31
+ newPrice: core_1.Args.string({
32
+ description: 'New price for the asset',
33
+ required: true,
34
+ }),
35
+ };
36
+ ChangePrice.flags = {
37
+ yes: core_1.Flags.boolean({
38
+ char: 'y',
39
+ description: 'Automatic yes to prompts',
40
+ required: false,
41
+ default: false,
42
+ }),
43
+ };
44
+ ChangePrice.description = 'Change the price keeping the existing currency for an asset with the given DID';
45
+ ChangePrice.examples = [
46
+ '<%= config.bin %> <%= command.id %> did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a 10',
47
+ ];
48
+ exports.default = ChangePrice;
49
+ //# sourceMappingURL=change-price.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-price.js","sourceRoot":"","sources":["../../src/commands/change-price.ts"],"names":[],"mappings":";;;;;AAAA,sCAAgD;AAChD,kEAAwC;AAExC,oDAA8C;AAE9C,MAAqB,WAAY,SAAQ,cAAO;IAqB9C,KAAK,CAAC,GAAG;;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACnD,MAAM,EAAC,GAAG,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAA;QAC5B,MAAM,UA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,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAA;AACM,uBAAW,GAAG,gFAAgF,CAAA;AAC9F,oBAAQ,GAAsB;IACnC,gHAAgH;CACjH,CAAA;kBAnBkB,WAAW"}
@@ -0,0 +1,10 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class CheckParticipantCompliance extends Command {
3
+ static description: string;
4
+ static examples: Command.Example[];
5
+ static flags: {
6
+ participant: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ vp: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const node_fs_1 = require("node:fs");
9
+ const node_path_1 = require("node:path");
10
+ class CheckParticipantCompliance extends core_1.Command {
11
+ async run() {
12
+ const { flags } = await this.parse(CheckParticipantCompliance);
13
+ const complianceService = 'https://compliance.lab.gaia-x.eu/v1/api/credential-offers';
14
+ const folder = (0, node_path_1.dirname)(flags.participant);
15
+ const participantData = JSON.parse((0, node_fs_1.readFileSync)(flags.participant, 'utf8'));
16
+ const vp = JSON.parse((0, node_fs_1.readFileSync)(flags.vp, 'utf8'));
17
+ await axios_1.default
18
+ .post(`${complianceService}?` +
19
+ `vcid=https://${participantData.issuer_domain}/.well-known/${participantData.participant_name}.compliance.json`, vp)
20
+ .then((response) => {
21
+ if (response.status === 201) {
22
+ const compliance = response.data;
23
+ (0, node_fs_1.writeFileSync)((0, node_path_1.resolve)(folder, participantData.participant_name + '.compliance.json'), JSON.stringify(compliance, null, 2), 'utf8');
24
+ console.log(`Gaia-X Compliance verified for ${participantData.participant_legal_name} credentials ` +
25
+ `and stored in ${participantData.participant_name}.compliance.json`);
26
+ }
27
+ else {
28
+ console.error(`Error generating Compliance for ${participantData.participant_legal_name}`);
29
+ console.error(response === null || response === void 0 ? void 0 : response.data);
30
+ }
31
+ })
32
+ .catch((error) => {
33
+ var _a;
34
+ console.error(`Error generating Compliance for ${participantData.participant_legal_name}`);
35
+ console.error((_a = error.response) === null || _a === void 0 ? void 0 : _a.data);
36
+ throw error;
37
+ });
38
+ }
39
+ }
40
+ CheckParticipantCompliance.description = 'Use Gaia-X Compliance to check a participant Verifiable Presentation';
41
+ CheckParticipantCompliance.examples = ['<%= config.bin %> <%= command.id %> -p ./CEP.data.json --vp ./CEP.vp.json'];
42
+ CheckParticipantCompliance.flags = {
43
+ participant: core_1.Flags.string({
44
+ char: 'p',
45
+ description: 'Path to the JSON file including the required participant data',
46
+ required: true,
47
+ }),
48
+ vp: core_1.Flags.string({
49
+ description: 'Path to the participant Verifiable Presentation file',
50
+ required: true,
51
+ }),
52
+ };
53
+ exports.default = CheckParticipantCompliance;
54
+ //# sourceMappingURL=check-participant-compliance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-participant-compliance.js","sourceRoot":"","sources":["../../src/commands/check-participant-compliance.ts"],"names":[],"mappings":";;;;;AAAA,sCAA0C;AAC1C,kDAAuC;AACvC,qCAAmD;AACnD,yCAA0C;AAE1C,MAAqB,0BAA2B,SAAQ,cAAO;IAe7D,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC5D,MAAM,iBAAiB,GAAG,2DAA2D,CAAA;QACrF,MAAM,MAAM,GAAG,IAAA,mBAAO,EAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACzC,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,C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sE,CAAA;AACpF,mCAAQ,GAAsB,CAAC,2EAA2E,CAAC,CAAA;AAC3G,gCAAK,GAAG;IACb,WAAW,EAAE,YAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,+DAA+D;QAC5E,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,sDAAsD;QACnE,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAA;kBAbkB,0BAA0B"}
@@ -0,0 +1,12 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ComputeResults extends Command {
3
+ static args: {
4
+ jobId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: Command.Example[];
8
+ static flags: {
9
+ provider: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const connection_1 = require("../utils/connection");
5
+ class ComputeResults extends core_1.Command {
6
+ async run() {
7
+ const { args, flags } = await this.parse(ComputeResults);
8
+ const connection = await connection_1.Connection.connect();
9
+ try {
10
+ const computeResultUrl = await connection.nautilus.getComputeResult({
11
+ jobId: args.jobId,
12
+ providerUri: flags.provider,
13
+ });
14
+ if (computeResultUrl)
15
+ this.log(`Compute results available from: ${computeResultUrl}\n`);
16
+ else
17
+ this.log('No results available yet\n');
18
+ }
19
+ catch (error) {
20
+ this.error(`Error starting compute: ${error}`);
21
+ }
22
+ }
23
+ }
24
+ ComputeResults.args = {
25
+ jobId: core_1.Args.string({ description: 'Compute job ID', required: true }),
26
+ };
27
+ ComputeResults.description = 'Get the compute job results.';
28
+ ComputeResults.examples = [
29
+ '<%= config.bin %> <%= command.id %> 215bae450c8f40f59bfc5d1ccada3931 -p https://provider.agrospai.udl.cat',
30
+ ];
31
+ ComputeResults.flags = {
32
+ provider: core_1.Flags.string({
33
+ char: 'p',
34
+ description: 'The Provider URL',
35
+ required: true,
36
+ default: 'https://provider.agrospai.udl.cat',
37
+ }),
38
+ };
39
+ exports.default = ComputeResults;
40
+ //# sourceMappingURL=compute-results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-results.js","sourceRoot":"","sources":["../../src/commands/compute-results.ts"],"names":[],"mappings":";;AAAA,sCAAgD;AAEhD,oDAA8C;AAE9C,MAAqB,cAAe,SAAQ,cAAO;IAiBjD,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACtD,MAAM,UAAU,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAA;QAC7C,IAAI,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAClE,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,KAAK,CAAC,QAAQ;aAC5B,CAAC,CAAA;YACF,IAAI,gBAAgB;gBAAE,IAAI,CAAC,GAAG,CAAC,mCAAmC,gBAAgB,IAAI,CAAC,CAAA;;gBAClF,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;;AA7BM,mBAAI,GAAG;IACZ,KAAK,EAAE,WAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;CACpE,CAAA;AACM,0BAAW,GAAG,8BAA8B,CAAA;AAC5C,uBAAQ,GAAsB;IACnC,2GAA2G;CAC5G,CAAA;AACM,oBAAK,GAAG;IACb,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,kBAAkB;QAC/B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,mCAAmC;KAC7C,CAAC;CACH,CAAA;kBAfkB,cAAc"}
@@ -0,0 +1,12 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class ComputeStatus extends Command {
3
+ static args: {
4
+ jobId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: Command.Example[];
8
+ static flags: {
9
+ provider: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const connection_1 = require("../utils/connection");
5
+ class ComputeStatus extends core_1.Command {
6
+ async run() {
7
+ const { args, flags } = await this.parse(ComputeStatus);
8
+ const connection = await connection_1.Connection.connect();
9
+ try {
10
+ const computeJobStatus = await connection.nautilus.getComputeStatus({
11
+ jobId: args.jobId,
12
+ providerUri: flags.provider,
13
+ });
14
+ this.log(`Compute status: ${computeJobStatus.statusText}\n`);
15
+ if (computeJobStatus.statusText === 'Job finished') {
16
+ this.log(`Get results using command:\n ${this.config.bin} ${this.id} ${args.jobId} -p ${flags.provider}\n`);
17
+ }
18
+ }
19
+ catch (error) {
20
+ this.error(`Error starting compute: ${error}`);
21
+ }
22
+ }
23
+ }
24
+ ComputeStatus.args = {
25
+ jobId: core_1.Args.string({ description: 'Compute job ID', required: true }),
26
+ };
27
+ ComputeStatus.description = 'Check compute job status.';
28
+ ComputeStatus.examples = [
29
+ '<%= config.bin %> <%= command.id %> 215bae450c8f40f59bfc5d1ccada3931 -p https://provider.agrospai.udl.cat',
30
+ ];
31
+ ComputeStatus.flags = {
32
+ provider: core_1.Flags.string({
33
+ char: 'p',
34
+ description: 'The Provider URL',
35
+ required: true,
36
+ default: 'https://provider.agrospai.udl.cat',
37
+ }),
38
+ };
39
+ exports.default = ComputeStatus;
40
+ //# sourceMappingURL=compute-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute-status.js","sourceRoot":"","sources":["../../src/commands/compute-status.ts"],"names":[],"mappings":";;AAAA,sCAAgD;AAEhD,oDAA8C;AAE9C,MAAqB,aAAc,SAAQ,cAAO;IAiBhD,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACrD,MAAM,UAAU,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAA;QAC7C,IAAI,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAClE,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,WAAW,EAAE,KAAK,CAAC,QAAQ;aAC5B,CAAC,CAAA;YACF,IAAI,CAAC,GAAG,CAAC,mBAAmB,gBAAgB,CAAC,UAAU,IAAI,CAAC,CAAA;YAC5D,IAAI,gBAAgB,CAAC,UAAU,KAAK,cAAc,EAAE,CAAC;gBACnD,IAAI,CAAC,GAAG,CAAC,gCAAgC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,OAAO,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAA;YAC7G,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;;AA/BM,kBAAI,GAAG;IACZ,KAAK,EAAE,WAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;CACpE,CAAA;AACM,yBAAW,GAAG,2BAA2B,CAAA;AACzC,sBAAQ,GAAsB;IACnC,2GAA2G;CAC5G,CAAA;AACM,mBAAK,GAAG;IACb,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,kBAAkB;QAC/B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,mCAAmC;KAC7C,CAAC;CACH,CAAA;kBAfkB,aAAa"}
@@ -0,0 +1,14 @@
1
+ import { Command } from '@oclif/core';
2
+ import { ComputeJob } from '@oceanprotocol/lib';
3
+ export default class Compute extends Command {
4
+ static args: {
5
+ algo: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: Command.Example[];
9
+ static flags: {
10
+ datasets: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<ComputeJob | ComputeJob[] | void>;
14
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const readline_sync_1 = __importDefault(require("readline-sync"));
8
+ const connection_1 = require("../utils/connection");
9
+ class Compute extends core_1.Command {
10
+ async run() {
11
+ const { args, flags } = await this.parse(Compute);
12
+ const { algo } = args;
13
+ const { datasets } = flags;
14
+ const connection = await connection_1.Connection.connect();
15
+ if (flags.yes || readline_sync_1.default.keyInYNStrict(`Computing algorithm ${algo} on datasets [${datasets.join(', ')}]? `)) {
16
+ try {
17
+ const firstDatasetAsset = await connection.nautilus.getAquariusAsset(datasets[0]);
18
+ const provider = firstDatasetAsset.services[0].serviceEndpoint;
19
+ const dataset = {
20
+ did: datasets[0],
21
+ };
22
+ const algorithm = { did: algo };
23
+ const additionalDatasets = datasets.filter((_, i) => i > 0).map((dataset) => ({ did: dataset }));
24
+ const computeJob = await connection.nautilus.compute({
25
+ additionalDatasets,
26
+ algorithm,
27
+ dataset,
28
+ });
29
+ if (Array.isArray(computeJob)) {
30
+ for (const job of computeJob)
31
+ this.log(`Compute started, check status using command:\n pontus-x_cli compute-status ${job.jobId} -p ${provider}\n`);
32
+ }
33
+ else {
34
+ this.log(`Compute started, check status using command:\n pontus-x_cli compute-status ${computeJob.jobId} -p ${provider}\n`);
35
+ }
36
+ return computeJob;
37
+ }
38
+ catch (error) {
39
+ this.error(`Error starting compute: ${error}`);
40
+ }
41
+ }
42
+ }
43
+ }
44
+ Compute.args = {
45
+ algo: core_1.Args.string({ description: 'Algorithm DID', required: true }),
46
+ };
47
+ Compute.description = 'Compute the algorithm on one or more datasets.';
48
+ Compute.examples = [
49
+ '<%= config.bin %> <%= command.id %> did:op:34e2ff9baf030318b13ff3940ab0885bb11fee49a8597123392983f5a0db8a35 -d did:op:d8a36ff74d36e54ce245d27689330fc39debb2fdfeac09d4a08b24b68cf5053d',
50
+ ];
51
+ Compute.flags = {
52
+ datasets: core_1.Flags.string({
53
+ char: 'd',
54
+ description: 'Dataset DIDs',
55
+ multiple: true,
56
+ required: true,
57
+ }),
58
+ yes: core_1.Flags.boolean({
59
+ char: 'y',
60
+ description: 'Automatic yes to prompts',
61
+ required: false,
62
+ default: false,
63
+ }),
64
+ };
65
+ exports.default = Compute;
66
+ //# sourceMappingURL=compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compute.js","sourceRoot":"","sources":["../../src/commands/compute.ts"],"names":[],"mappings":";;;;;AAAA,sCAAgD;AAChD,kEAAwC;AAExC,oDAA8C;AAG9C,MAAqB,OAAQ,SAAQ,cAAO;IAuB1C,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CA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AAC;qBAAM,CAAC;oBACN,IAAI,CAAC,GAAG,CACN,8EAA8E,UAAU,CAAC,KAAK,OAAO,QAAQ,IAAI,CAClH,CAAA;gBACH,CAAC;gBACD,OAAO,UAAU,CAAA;YACnB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAA;YAChD,CAAC;QACH,CAAC;IACH,CAAC;;AAzDM,YAAI,GAAG;IACZ,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;CAClE,CAAA;AACM,mBAAW,GAAG,gDAAgD,CAAA;AAC9D,gBAAQ,GAAsB;IACnC,wLAAwL;CACzL,CAAA;AACM,aAAK,GAAG;IACb,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,cAAc;QAC3B,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,GAAG,EAAE,YAAK,CAAC,OAAO,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,0BAA0B;QACvC,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAA;kBArBkB,OAAO"}
@@ -0,0 +1,16 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class EditAlgo extends Command {
3
+ static args: {
4
+ did: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ image: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ tag: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ checksum: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ entrypoint: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
9
+ };
10
+ static flags: {
11
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ static description: string;
14
+ static examples: Command.Example[];
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const nautilus_1 = require("@deltadao/nautilus");
7
+ const core_1 = require("@oclif/core");
8
+ const readline_sync_1 = __importDefault(require("readline-sync"));
9
+ const connection_1 = require("../utils/connection");
10
+ class EditAlgo extends core_1.Command {
11
+ async run() {
12
+ const { args, flags } = await this.parse(EditAlgo);
13
+ const { checksum, did, image, tag, entrypoint } = args;
14
+ const connection = await connection_1.Connection.connect();
15
+ if (flags.yes ||
16
+ readline_sync_1.default.keyInYNStrict(`Change the container metadata for asset ${did}` +
17
+ `to entrypoint "${entrypoint}" for ${image}:${tag} and image checksum ${checksum}? `)) {
18
+ try {
19
+ const aquariusAsset = await connection.nautilus.getAquariusAsset(did);
20
+ const assetBuilder = new nautilus_1.AssetBuilder(aquariusAsset);
21
+ const asset = assetBuilder
22
+ .setAlgorithm(Object.assign(Object.assign({}, aquariusAsset.metadata.algorithm), { container: Object.assign(Object.assign({}, aquariusAsset.metadata.algorithm.container), { checksum,
23
+ image,
24
+ tag,
25
+ entrypoint }) }))
26
+ .build();
27
+ const result = await connection.nautilus.edit(asset);
28
+ this.log(`Container metadata updated for the algorithm, transaction: ${connection.networkConfig.explorerUri}/tx/${result.setMetadataTxReceipt.transactionHash}\n`);
29
+ }
30
+ catch (error) {
31
+ this.error(`Error editing container metadata: ${error}`);
32
+ }
33
+ }
34
+ }
35
+ }
36
+ EditAlgo.args = {
37
+ did: core_1.Args.string({ description: 'Algorithm DID', required: true }),
38
+ image: core_1.Args.string({ description: 'Container image', required: true }),
39
+ tag: core_1.Args.string({ description: 'Container tag', required: true }),
40
+ checksum: core_1.Args.string({ description: 'Image checksum', required: true }),
41
+ entrypoint: core_1.Args.string({ description: 'Algorithm entrypoint', required: true }),
42
+ };
43
+ EditAlgo.flags = {
44
+ yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompt', required: false, default: false }),
45
+ };
46
+ EditAlgo.description = 'Change the container metadata for a given algorithm DID';
47
+ EditAlgo.examples = [
48
+ '<%= config.bin %> <%= command.id %> did:op:dcdb747f8feff3122c6d6c0f45a339a6e09415e721f98f61cc2c1d62ab35a21f rogargon/pandas-profiling 4.16 sha256:81dca5439f07dff4d56097546a9fce7335be3de8e2622dc105c64e54376f86b5 "python /algorithm/src/main.py"',
49
+ ];
50
+ exports.default = EditAlgo;
51
+ //# sourceMappingURL=edit-algo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-algo.js","sourceRoot":"","sources":["../../src/commands/edit-algo.ts"],"names":[],"mappings":";;;;;AAAA,iDAA+C;AAC/C,sCAAgD;AAChD,kEAAwC;AAExC,oDAA8C;AAE9C,MAAqB,QAAS,SAAQ,cAAO;IAgB3C,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QAChD,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAC,GAAG,IAAI,CAAA;QACpD,MAAM,UAAU,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAA;QAC7C,IACE,KAAK,CAAC,GAAG;YACT,uBAAY,CAAC,aAAa,CACxB,2CAA2C,GAAG,EAAE;gBAC9C,kBAAkB,UAAU,SAAS,KAAK,IAAI,GAAG,uBAAuB,QAAQ,IAAI,CACvF,EACD,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;gBACrE,MAAM,YAAY,GAAG,IAAI,uBAAY,CAAC,aAAa,CAAC,CAAA;gBACpD,M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0B,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;CAC1G,CAAA;AACM,oBAAW,GAAG,yDAAyD,CAAA;AACvE,iBAAQ,GAAsB;IACnC,oPAAoP;CACrP,CAAA;kBAdkB,QAAQ"}
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class EditAssetUrl extends Command {
3
+ static args: {
4
+ did: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ url: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ static description: string;
11
+ static examples: Command.Example[];
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const nautilus_1 = require("@deltadao/nautilus");
7
+ const core_1 = require("@oclif/core");
8
+ const readline_sync_1 = __importDefault(require("readline-sync"));
9
+ const connection_1 = require("../utils/connection");
10
+ class EditAssetUrl extends core_1.Command {
11
+ async run() {
12
+ const { args, flags } = await this.parse(EditAssetUrl);
13
+ const { did, url } = args;
14
+ const connection = await connection_1.Connection.connect();
15
+ if (flags.yes || readline_sync_1.default.keyInYNStrict(`Changing the URL for ${did} to ${url}? `)) {
16
+ try {
17
+ const aquariusAsset = await connection.nautilus.getAquariusAsset(did);
18
+ const assetBuilder = new nautilus_1.AssetBuilder(aquariusAsset);
19
+ const serviceBuilder = new nautilus_1.ServiceBuilder({
20
+ aquariusAsset,
21
+ serviceId: aquariusAsset.services[0].id,
22
+ });
23
+ serviceBuilder.addFile({ method: 'GET', type: 'url', url });
24
+ const service = serviceBuilder.build();
25
+ const asset = assetBuilder.addService(service).build();
26
+ const result = await connection.nautilus.edit(asset);
27
+ this.log(`Changed asset URL, transaction: ${connection.networkConfig.explorerUri}/tx/${result.setMetadataTxReceipt.transactionHash}\n`);
28
+ }
29
+ catch (error) {
30
+ this.error(`Error changing dataset URL: ${error}`);
31
+ }
32
+ }
33
+ }
34
+ }
35
+ EditAssetUrl.args = {
36
+ did: core_1.Args.string({ description: 'DID of the asset', required: true }),
37
+ url: core_1.Args.string({
38
+ description: 'New URL for the asset',
39
+ required: true,
40
+ }),
41
+ };
42
+ EditAssetUrl.flags = {
43
+ yes: core_1.Flags.boolean({
44
+ char: 'y',
45
+ description: 'Automatic yes to prompts',
46
+ required: false,
47
+ default: false,
48
+ }),
49
+ };
50
+ EditAssetUrl.description = 'Change the URL of an asset DID';
51
+ EditAssetUrl.examples = [
52
+ '<%= config.bin %> <%= command.id %> did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686 https://raw.githubusercontent.com/plotly/datasets/refs/heads/master/titanic.csv',
53
+ ];
54
+ exports.default = EditAssetUrl;
55
+ //# sourceMappingURL=edit-asset-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-asset-url.js","sourceRoot":"","sources":["../../src/commands/edit-asset-url.ts"],"names":[],"mappings":";;;;;AAAA,iDAA+D;AAC/D,sCAAgD;AAChD,kEAAwC;AAExC,oDAA8C;AAE9C,MAAqB,YAAa,SAAQ,cAAO;IAqB/C,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QACpD,MAAM,EAAC,GAAG,EAAE,GAAG,EAAC,GAAG,IAAI,CAAA;QACvB,MAAM,UAAU,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAA;QAC7C,IAAI,KAAK,CAAC,GAAG,IAAI,uBAAY,CAAC,aAAa,CAAC,wBAAwB,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;YACvF,IAAI,CAAC;gBACH,MAAM,aA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vC,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAA;AACM,wBAAW,GAAG,gCAAgC,CAAA;AAC9C,qBAAQ,GAAsB;IACnC,6LAA6L;CAC9L,CAAA;kBAnBkB,YAAY"}
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class EditTrustedAlgos extends Command {
3
+ static args: {
4
+ did: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: Command.Example[];
8
+ static flags: {
9
+ algos: import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const nautilus_1 = require("@deltadao/nautilus");
7
+ const core_1 = require("@oclif/core");
8
+ const readline_sync_1 = __importDefault(require("readline-sync"));
9
+ const connection_1 = require("../utils/connection");
10
+ class EditTrustedAlgos extends core_1.Command {
11
+ async run() {
12
+ const { args, flags } = await this.parse(EditTrustedAlgos);
13
+ const { did } = args;
14
+ const { algos } = flags;
15
+ const connection = await connection_1.Connection.connect();
16
+ if (flags.yes ||
17
+ readline_sync_1.default.keyInYNStrict(`Changing the trusted algorithms for ${did} to [${algos.join(', ')}]? `)) {
18
+ try {
19
+ const aquariusAsset = await connection.nautilus.getAquariusAsset(did);
20
+ const assetBuilder = new nautilus_1.AssetBuilder(aquariusAsset);
21
+ const serviceBuilder = new nautilus_1.ServiceBuilder({
22
+ aquariusAsset,
23
+ serviceId: aquariusAsset.services[0].id,
24
+ });
25
+ serviceBuilder.setAllAlgorithmsUntrusted(); // Remove existing trusted algorithms
26
+ serviceBuilder.addTrustedAlgorithms(algos.map((algo) => ({ did: algo })));
27
+ const service = serviceBuilder.build();
28
+ const asset = assetBuilder.addService(service).build();
29
+ const result = await connection.nautilus.edit(asset);
30
+ this.log(`Edited the trusted algorithms, transaction: ${connection.networkConfig.explorerUri}/tx/${result.setMetadataTxReceipt.transactionHash}\n`);
31
+ }
32
+ catch (error) {
33
+ this.error(`Error editing the trusted algorithms: ${error}`);
34
+ }
35
+ }
36
+ }
37
+ }
38
+ EditTrustedAlgos.args = {
39
+ did: core_1.Args.string({ description: 'DID of the asset', required: true }),
40
+ };
41
+ EditTrustedAlgos.description = 'Overwrite the trusted algorithms for a data asset to the provided algorithm DIDs';
42
+ EditTrustedAlgos.examples = [
43
+ '<%= config.bin %> <%= command.id %> did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a --algos did:op:8f9994d01975cadd0196a2f7f811ed850e5d02a7223e7c5a31faaebe7371c81a did:op:0b970c95211cb8ef4574383386376646081bb7eb949b2a75e1e2171ea25949a7',
44
+ ];
45
+ EditTrustedAlgos.flags = {
46
+ algos: core_1.Flags.string({
47
+ description: 'Algorithm DIDs',
48
+ multiple: true,
49
+ required: true,
50
+ }),
51
+ yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompt', default: false }),
52
+ };
53
+ exports.default = EditTrustedAlgos;
54
+ //# sourceMappingURL=edit-trusted-algos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-trusted-algos.js","sourceRoot":"","sources":["../../src/commands/edit-trusted-algos.ts"],"names":[],"mappings":";;;;;AAAA,iDAA+D;AAC/D,sCAAgD;AAChD,kEAAwC;AAExC,oDAA8C;AAE9C,MAAqB,gBAAiB,SAAQ,cAAO;IAiBnD,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;QACxD,MAAM,EAAC,GAAG,EAAC,GAAG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