pontus-x_cli 1.0.4 → 1.2.5
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 +144 -53
- package/bin/dev.js +5 -5
- package/bin/run.js +4 -5
- package/dist/commands/access.d.ts +1 -1
- package/dist/commands/access.js +3 -3
- package/dist/commands/access.js.map +1 -1
- package/dist/commands/change-price.d.ts +3 -3
- package/dist/commands/change-price.js +12 -11
- package/dist/commands/change-price.js.map +1 -1
- package/dist/commands/check-participant-compliance.d.ts +1 -1
- package/dist/commands/check-participant-compliance.js +13 -11
- package/dist/commands/check-participant-compliance.js.map +1 -1
- package/dist/commands/compute-results.d.ts +1 -1
- package/dist/commands/compute-results.js +7 -7
- package/dist/commands/compute-results.js.map +1 -1
- package/dist/commands/compute-status.d.ts +1 -1
- package/dist/commands/compute-status.js +7 -7
- package/dist/commands/compute-status.js.map +1 -1
- package/dist/commands/compute.d.ts +7 -5
- package/dist/commands/compute.js +136 -36
- package/dist/commands/compute.js.map +1 -1
- package/dist/commands/edit-additional-metadata.d.ts +3 -3
- package/dist/commands/edit-additional-metadata.js +18 -11
- package/dist/commands/edit-additional-metadata.js.map +1 -1
- package/dist/commands/edit-algo.d.ts +3 -3
- package/dist/commands/edit-algo.js +22 -13
- package/dist/commands/edit-algo.js.map +1 -1
- package/dist/commands/edit-asset-url.d.ts +3 -3
- package/dist/commands/edit-asset-url.js +12 -11
- package/dist/commands/edit-asset-url.js.map +1 -1
- package/dist/commands/edit-trusted-algos.d.ts +6 -5
- package/dist/commands/edit-trusted-algos.js +136 -21
- package/dist/commands/edit-trusted-algos.js.map +1 -1
- package/dist/commands/edit-trusted-publishers.d.ts +13 -0
- package/dist/commands/edit-trusted-publishers.js +132 -0
- package/dist/commands/edit-trusted-publishers.js.map +1 -0
- package/dist/commands/export-private-key.d.ts +2 -2
- package/dist/commands/export-private-key.js +27 -27
- package/dist/commands/export-private-key.js.map +1 -1
- package/dist/commands/generate-asset-credentials.d.ts +1 -1
- package/dist/commands/generate-asset-credentials.js +11 -11
- package/dist/commands/generate-asset-credentials.js.map +1 -1
- package/dist/commands/generate-did-web.d.ts +1 -1
- package/dist/commands/generate-did-web.js +11 -11
- package/dist/commands/generate-did-web.js.map +1 -1
- package/dist/commands/generate-participant-credentials.d.ts +1 -1
- package/dist/commands/generate-participant-credentials.js +10 -10
- package/dist/commands/generate-participant-credentials.js.map +1 -1
- package/dist/commands/get.d.ts +1 -1
- package/dist/commands/get.js +3 -3
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +16 -13
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts +1 -1
- package/dist/commands/logout.js +7 -7
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/publish.d.ts +5 -3
- package/dist/commands/publish.js +111 -43
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/render.d.ts +12 -0
- package/dist/commands/render.js +130 -0
- package/dist/commands/render.js.map +1 -0
- package/dist/commands/revoke.d.ts +7 -6
- package/dist/commands/revoke.js +92 -23
- package/dist/commands/revoke.js.map +1 -1
- package/dist/commands/self-description.d.ts +3 -3
- package/dist/commands/self-description.js +13 -8
- package/dist/commands/self-description.js.map +1 -1
- package/dist/config.d.ts +16 -18
- package/dist/config.js +63 -62
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/aquarius.d.ts +29 -0
- package/dist/lib/aquarius.js +212 -0
- package/dist/lib/aquarius.js.map +1 -0
- package/dist/lib/gaia-x_compliance/generate-credentials/index.js +26 -25
- package/dist/lib/gaia-x_compliance/generate-credentials/index.js.map +1 -1
- package/dist/lib/manifest.d.ts +5 -0
- package/dist/lib/manifest.js +33 -0
- package/dist/lib/manifest.js.map +1 -0
- package/dist/lib/spec.d.ts +12 -0
- package/dist/lib/spec.js +266 -0
- package/dist/lib/spec.js.map +1 -0
- package/dist/lib/wallet.d.ts +2 -0
- package/dist/lib/wallet.js +19 -0
- package/dist/lib/wallet.js.map +1 -0
- package/dist/lib/yaml.d.ts +2 -0
- package/dist/lib/yaml.js +53 -0
- package/dist/lib/yaml.js.map +1 -0
- package/dist/scripts/json-schema.d.ts +1 -0
- package/dist/scripts/json-schema.js +24 -0
- package/dist/scripts/json-schema.js.map +1 -0
- package/dist/types/manifest-schema.json +52 -0
- package/dist/types/manifest.d.ts +17 -0
- package/dist/types/manifest.js +14 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/schema.d.ts +1 -2
- package/dist/types/schema.js +3 -2
- package/dist/types/schema.js.map +1 -1
- package/dist/types/schema.json +24 -72
- package/dist/utils/account.d.ts +2 -0
- package/dist/utils/account.js +41 -0
- package/dist/utils/account.js.map +1 -0
- package/dist/utils/asset.d.ts +25 -0
- package/dist/utils/asset.js +108 -0
- package/dist/utils/asset.js.map +1 -0
- package/dist/utils/connection.d.ts +3 -3
- package/dist/utils/connection.js +2 -2
- package/dist/utils/connection.js.map +1 -1
- package/dist/utils/login.d.ts +14 -0
- package/dist/utils/login.js +99 -0
- package/dist/utils/login.js.map +1 -0
- package/oclif.manifest.json +250 -39
- package/package.json +22 -18
- package/dist/lib/publishFromFile.d.ts +0 -2
- package/dist/lib/publishFromFile.js +0 -143
- package/dist/lib/publishFromFile.js.map +0 -1
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.
|
|
25
|
+
pontus-x_cli/1.2.5 linux-x64 node-v25.6.1
|
|
26
26
|
$ pontus-x_cli --help [COMMAND]
|
|
27
27
|
USAGE
|
|
28
28
|
$ pontus-x_cli COMMAND
|
|
@@ -30,6 +30,33 @@ USAGE
|
|
|
30
30
|
```
|
|
31
31
|
<!-- usagestop -->
|
|
32
32
|
|
|
33
|
+
## Spec declarative format
|
|
34
|
+
|
|
35
|
+
Example:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
metadata:
|
|
39
|
+
type: algorithm
|
|
40
|
+
author: Universitat de Lleida (UdL)
|
|
41
|
+
name: Exploratory Data Analysis
|
|
42
|
+
description: description.md
|
|
43
|
+
...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Check [samples/publish](samples/publish) folder for more examples.
|
|
47
|
+
|
|
48
|
+
## Manifest declarative format
|
|
49
|
+
|
|
50
|
+
Example:
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
accounts:
|
|
54
|
+
- name: Universitat de Lleida (UdL)
|
|
55
|
+
address: '0xd999baae98ac5246568fd726be8832c49626867d'
|
|
56
|
+
privateKeyPath: keys/d999baae98ac5246568fd726be8832c49626867d.json
|
|
57
|
+
passwordEnvKey: UDL_KEY_PASSWORD
|
|
58
|
+
```
|
|
59
|
+
|
|
33
60
|
# Commands
|
|
34
61
|
|
|
35
62
|
<!-- commands -->
|
|
@@ -37,13 +64,14 @@ USAGE
|
|
|
37
64
|
* [`pontus-x_cli autocomplete [SHELL]`](#pontus-x_cli-autocomplete-shell)
|
|
38
65
|
* [`pontus-x_cli change-price DID NEWPRICE`](#pontus-x_cli-change-price-did-newprice)
|
|
39
66
|
* [`pontus-x_cli check-participant-compliance`](#pontus-x_cli-check-participant-compliance)
|
|
40
|
-
* [`pontus-x_cli compute
|
|
67
|
+
* [`pontus-x_cli compute [ALGORITHM]`](#pontus-x_cli-compute-algorithm)
|
|
41
68
|
* [`pontus-x_cli compute-results JOBID`](#pontus-x_cli-compute-results-jobid)
|
|
42
69
|
* [`pontus-x_cli compute-status JOBID`](#pontus-x_cli-compute-status-jobid)
|
|
43
70
|
* [`pontus-x_cli edit-additional-metadata DID METADATAFILE`](#pontus-x_cli-edit-additional-metadata-did-metadatafile)
|
|
44
71
|
* [`pontus-x_cli edit-algo DID IMAGE TAG CHECKSUM ENTRYPOINT`](#pontus-x_cli-edit-algo-did-image-tag-checksum-entrypoint)
|
|
45
72
|
* [`pontus-x_cli edit-asset-url DID URL`](#pontus-x_cli-edit-asset-url-did-url)
|
|
46
|
-
* [`pontus-x_cli edit-trusted-algos
|
|
73
|
+
* [`pontus-x_cli edit-trusted-algos`](#pontus-x_cli-edit-trusted-algos)
|
|
74
|
+
* [`pontus-x_cli edit-trusted-publishers`](#pontus-x_cli-edit-trusted-publishers)
|
|
47
75
|
* [`pontus-x_cli export-private-key`](#pontus-x_cli-export-private-key)
|
|
48
76
|
* [`pontus-x_cli generate-asset-credentials DID`](#pontus-x_cli-generate-asset-credentials-did)
|
|
49
77
|
* [`pontus-x_cli generate-did-web`](#pontus-x_cli-generate-did-web)
|
|
@@ -53,7 +81,8 @@ USAGE
|
|
|
53
81
|
* [`pontus-x_cli login KEYFILE`](#pontus-x_cli-login-keyfile)
|
|
54
82
|
* [`pontus-x_cli logout`](#pontus-x_cli-logout)
|
|
55
83
|
* [`pontus-x_cli publish PATH`](#pontus-x_cli-publish-path)
|
|
56
|
-
* [`pontus-x_cli
|
|
84
|
+
* [`pontus-x_cli render [DID]`](#pontus-x_cli-render-did)
|
|
85
|
+
* [`pontus-x_cli revoke`](#pontus-x_cli-revoke)
|
|
57
86
|
* [`pontus-x_cli self-description DID SDURL`](#pontus-x_cli-self-description-did-sdurl)
|
|
58
87
|
|
|
59
88
|
## `pontus-x_cli access DID`
|
|
@@ -74,7 +103,7 @@ EXAMPLES
|
|
|
74
103
|
$ pontus-x_cli access did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686
|
|
75
104
|
```
|
|
76
105
|
|
|
77
|
-
_See code: [src/commands/access.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
106
|
+
_See code: [src/commands/access.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/access.ts)_
|
|
78
107
|
|
|
79
108
|
## `pontus-x_cli autocomplete [SHELL]`
|
|
80
109
|
|
|
@@ -129,7 +158,7 @@ EXAMPLES
|
|
|
129
158
|
$ pontus-x_cli change-price did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a 10
|
|
130
159
|
```
|
|
131
160
|
|
|
132
|
-
_See code: [src/commands/change-price.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
161
|
+
_See code: [src/commands/change-price.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/change-price.ts)_
|
|
133
162
|
|
|
134
163
|
## `pontus-x_cli check-participant-compliance`
|
|
135
164
|
|
|
@@ -150,31 +179,36 @@ EXAMPLES
|
|
|
150
179
|
$ pontus-x_cli check-participant-compliance -p ./CEP.data.json --vp ./CEP.vp.json
|
|
151
180
|
```
|
|
152
181
|
|
|
153
|
-
_See code: [src/commands/check-participant-compliance.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
182
|
+
_See code: [src/commands/check-participant-compliance.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/check-participant-compliance.ts)_
|
|
154
183
|
|
|
155
|
-
## `pontus-x_cli compute
|
|
184
|
+
## `pontus-x_cli compute [ALGORITHM]`
|
|
156
185
|
|
|
157
186
|
Compute the algorithm on one or more datasets.
|
|
158
187
|
|
|
159
188
|
```
|
|
160
189
|
USAGE
|
|
161
|
-
$ pontus-x_cli compute
|
|
190
|
+
$ pontus-x_cli compute [ALGORITHM] [-d <value>...] [-y] [-m <value>] [-n PONTUSXDEV|PONTUSXTEST]
|
|
162
191
|
|
|
163
192
|
ARGUMENTS
|
|
164
|
-
|
|
193
|
+
[ALGORITHM] Algorithm DID (did:op:...)
|
|
165
194
|
|
|
166
195
|
FLAGS
|
|
167
|
-
-d, --datasets=<value>...
|
|
196
|
+
-d, --datasets=<value>... Dataset DIDs (did:op:...)
|
|
197
|
+
-m, --manifest=<value> Path to manifest file with the accounts to use for authentication
|
|
198
|
+
-n, --network=<option> Network to use (env: NETWORK)
|
|
199
|
+
<options: PONTUSXDEV|PONTUSXTEST>
|
|
168
200
|
-y, --yes Automatic yes to prompts
|
|
169
201
|
|
|
170
202
|
DESCRIPTION
|
|
171
203
|
Compute the algorithm on one or more datasets.
|
|
172
204
|
|
|
173
205
|
EXAMPLES
|
|
174
|
-
$ pontus-x_cli compute
|
|
206
|
+
$ pontus-x_cli compute <algorithmDid> -d <datasetDid1> <datasetDid2> ...
|
|
207
|
+
|
|
208
|
+
$ pontus-x_cli compute <algorithmDid> -t <tag1> -t <tag2> ...
|
|
175
209
|
```
|
|
176
210
|
|
|
177
|
-
_See code: [src/commands/compute.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
211
|
+
_See code: [src/commands/compute.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/compute.ts)_
|
|
178
212
|
|
|
179
213
|
## `pontus-x_cli compute-results JOBID`
|
|
180
214
|
|
|
@@ -197,7 +231,7 @@ EXAMPLES
|
|
|
197
231
|
$ pontus-x_cli compute-results 215bae450c8f40f59bfc5d1ccada3931 -p https://provider.agrospai.udl.cat
|
|
198
232
|
```
|
|
199
233
|
|
|
200
|
-
_See code: [src/commands/compute-results.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
234
|
+
_See code: [src/commands/compute-results.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/compute-results.ts)_
|
|
201
235
|
|
|
202
236
|
## `pontus-x_cli compute-status JOBID`
|
|
203
237
|
|
|
@@ -220,7 +254,7 @@ EXAMPLES
|
|
|
220
254
|
$ pontus-x_cli compute-status 215bae450c8f40f59bfc5d1ccada3931 -p https://provider.agrospai.udl.cat
|
|
221
255
|
```
|
|
222
256
|
|
|
223
|
-
_See code: [src/commands/compute-status.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
257
|
+
_See code: [src/commands/compute-status.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/compute-status.ts)_
|
|
224
258
|
|
|
225
259
|
## `pontus-x_cli edit-additional-metadata DID METADATAFILE`
|
|
226
260
|
|
|
@@ -244,7 +278,7 @@ EXAMPLES
|
|
|
244
278
|
$ pontus-x_cli edit-additional-metadata did:op:dcdb747f8feff3122c6d6c0f45a339a6e09415e721f98f61cc2c1d62ab35a21f ./metadata.json
|
|
245
279
|
```
|
|
246
280
|
|
|
247
|
-
_See code: [src/commands/edit-additional-metadata.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
281
|
+
_See code: [src/commands/edit-additional-metadata.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/edit-additional-metadata.ts)_
|
|
248
282
|
|
|
249
283
|
## `pontus-x_cli edit-algo DID IMAGE TAG CHECKSUM ENTRYPOINT`
|
|
250
284
|
|
|
@@ -271,7 +305,7 @@ EXAMPLES
|
|
|
271
305
|
$ pontus-x_cli edit-algo did:op:dcdb747f8feff3122c6d6c0f45a339a6e09415e721f98f61cc2c1d62ab35a21f rogargon/pandas-profiling 4.16 sha256:81dca5439f07dff4d56097546a9fce7335be3de8e2622dc105c64e54376f86b5 "python /algorithm/src/main.py"
|
|
272
306
|
```
|
|
273
307
|
|
|
274
|
-
_See code: [src/commands/edit-algo.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
308
|
+
_See code: [src/commands/edit-algo.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/edit-algo.ts)_
|
|
275
309
|
|
|
276
310
|
## `pontus-x_cli edit-asset-url DID URL`
|
|
277
311
|
|
|
@@ -295,31 +329,58 @@ EXAMPLES
|
|
|
295
329
|
$ pontus-x_cli edit-asset-url did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686 https://raw.githubusercontent.com/plotly/datasets/refs/heads/master/titanic.csv
|
|
296
330
|
```
|
|
297
331
|
|
|
298
|
-
_See code: [src/commands/edit-asset-url.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
332
|
+
_See code: [src/commands/edit-asset-url.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/edit-asset-url.ts)_
|
|
299
333
|
|
|
300
|
-
## `pontus-x_cli edit-trusted-algos
|
|
334
|
+
## `pontus-x_cli edit-trusted-algos`
|
|
301
335
|
|
|
302
|
-
Overwrite
|
|
336
|
+
Overwrite datasets trusted algorithms
|
|
303
337
|
|
|
304
338
|
```
|
|
305
339
|
USAGE
|
|
306
|
-
$ pontus-x_cli edit-trusted-algos
|
|
340
|
+
$ pontus-x_cli edit-trusted-algos [-d <value>...] [-a <value>...] [-y] [-m <value>] [-p] [-n PONTUSXDEV|PONTUSXTEST]
|
|
307
341
|
|
|
308
|
-
|
|
309
|
-
|
|
342
|
+
FLAGS
|
|
343
|
+
-a, --algorithms=<value>... Trusted algorithm DIDs (did:op:...)
|
|
344
|
+
-d, --datasets=<value>... Dataset DIDs (did:op:...)
|
|
345
|
+
-m, --manifest=<value> Path to manifest file with the accounts to use for authentication
|
|
346
|
+
-n, --network=<option> Network to use (env: NETWORK)
|
|
347
|
+
<options: PONTUSXDEV|PONTUSXTEST>
|
|
348
|
+
-p, --public Make dataset public (set all algorithms as trusted)
|
|
349
|
+
-y, --yes Skip confirmation prompt
|
|
350
|
+
|
|
351
|
+
DESCRIPTION
|
|
352
|
+
Overwrite datasets trusted algorithms
|
|
353
|
+
|
|
354
|
+
EXAMPLES
|
|
355
|
+
$ pontus-x_cli edit-trusted-algos -d <datasetDid1> <datasetDid2> ... -a <algorithmDid1> <algorithmDid2> ...
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
_See code: [src/commands/edit-trusted-algos.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/edit-trusted-algos.ts)_
|
|
359
|
+
|
|
360
|
+
## `pontus-x_cli edit-trusted-publishers`
|
|
361
|
+
|
|
362
|
+
Overwrite datasets trusted publishers
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
USAGE
|
|
366
|
+
$ pontus-x_cli edit-trusted-publishers [-d <value>...] [-p <value>...] [-y] [-m <value>] [-n PONTUSXDEV|PONTUSXTEST]
|
|
310
367
|
|
|
311
368
|
FLAGS
|
|
312
|
-
-
|
|
313
|
-
|
|
369
|
+
-d, --datasets=<value>... Dataset DIDs (did:op:...)
|
|
370
|
+
-m, --manifest=<value> Path to manifest file with the accounts to use for authentication
|
|
371
|
+
-n, --network=<option> Network to use (env: NETWORK)
|
|
372
|
+
<options: PONTUSXDEV|PONTUSXTEST>
|
|
373
|
+
-p, --publishers=<value>... Trusted publisher DIDs (did:op:...)
|
|
374
|
+
-y, --yes Skip confirmation prompt
|
|
314
375
|
|
|
315
376
|
DESCRIPTION
|
|
316
|
-
Overwrite
|
|
377
|
+
Overwrite datasets trusted publishers
|
|
317
378
|
|
|
318
379
|
EXAMPLES
|
|
319
|
-
$ pontus-x_cli edit-trusted-
|
|
380
|
+
$ pontus-x_cli edit-trusted-publishers -d <datasetDid1> <datasetDid2> ... -p <publisherDid1> <publisherDid2> ...
|
|
320
381
|
```
|
|
321
382
|
|
|
322
|
-
_See code: [src/commands/edit-trusted-
|
|
383
|
+
_See code: [src/commands/edit-trusted-publishers.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/edit-trusted-publishers.ts)_
|
|
323
384
|
|
|
324
385
|
## `pontus-x_cli export-private-key`
|
|
325
386
|
|
|
@@ -327,7 +388,7 @@ Export your private key as a JSON file, to use later with the login command or f
|
|
|
327
388
|
|
|
328
389
|
```
|
|
329
390
|
USAGE
|
|
330
|
-
$ pontus-x_cli export-private-key [-
|
|
391
|
+
$ pontus-x_cli export-private-key [-f <value>] [-p <value>] [-k <value>]
|
|
331
392
|
|
|
332
393
|
FLAGS
|
|
333
394
|
-f, --filepath=<value> File path to save the encrypted private key (default is <address>.json)
|
|
@@ -341,7 +402,7 @@ EXAMPLES
|
|
|
341
402
|
$ pontus-x_cli export-private-key
|
|
342
403
|
```
|
|
343
404
|
|
|
344
|
-
_See code: [src/commands/export-private-key.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
405
|
+
_See code: [src/commands/export-private-key.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/export-private-key.ts)_
|
|
345
406
|
|
|
346
407
|
## `pontus-x_cli generate-asset-credentials DID`
|
|
347
408
|
|
|
@@ -367,7 +428,7 @@ EXAMPLES
|
|
|
367
428
|
$ pontus-x_cli generate-asset-credentials -p ./CEP.data.json -d ./did.json -c certificate.key did:op:01f8bc1e797a854dc718bd7a802acb07c5fc39f706b03dd454bceb66be6828c6
|
|
368
429
|
```
|
|
369
430
|
|
|
370
|
-
_See code: [src/commands/generate-asset-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
431
|
+
_See code: [src/commands/generate-asset-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/generate-asset-credentials.ts)_
|
|
371
432
|
|
|
372
433
|
## `pontus-x_cli generate-did-web`
|
|
373
434
|
|
|
@@ -388,7 +449,7 @@ EXAMPLES
|
|
|
388
449
|
$ pontus-x_cli generate-did-web -d <https://compliance.agrospai.udl.cat> -c certificate-chain.crt
|
|
389
450
|
```
|
|
390
451
|
|
|
391
|
-
_See code: [src/commands/generate-did-web.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
452
|
+
_See code: [src/commands/generate-did-web.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/generate-did-web.ts)_
|
|
392
453
|
|
|
393
454
|
## `pontus-x_cli generate-participant-credentials`
|
|
394
455
|
|
|
@@ -411,7 +472,7 @@ EXAMPLES
|
|
|
411
472
|
$ pontus-x_cli generate-participant-credentials -p ./CEP.data.json -d ./did.json -c certificate.key
|
|
412
473
|
```
|
|
413
474
|
|
|
414
|
-
_See code: [src/commands/generate-participant-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
475
|
+
_See code: [src/commands/generate-participant-credentials.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/generate-participant-credentials.ts)_
|
|
415
476
|
|
|
416
477
|
## `pontus-x_cli get DID`
|
|
417
478
|
|
|
@@ -431,7 +492,7 @@ EXAMPLES
|
|
|
431
492
|
$ pontus-x_cli get did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a
|
|
432
493
|
```
|
|
433
494
|
|
|
434
|
-
_See code: [src/commands/get.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
495
|
+
_See code: [src/commands/get.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/get.ts)_
|
|
435
496
|
|
|
436
497
|
## `pontus-x_cli help [COMMAND]`
|
|
437
498
|
|
|
@@ -474,7 +535,7 @@ EXAMPLES
|
|
|
474
535
|
$ pontus-x_cli login d999baae98ac5246568fd726be8832c49626867d.json
|
|
475
536
|
```
|
|
476
537
|
|
|
477
|
-
_See code: [src/commands/login.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
538
|
+
_See code: [src/commands/login.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/login.ts)_
|
|
478
539
|
|
|
479
540
|
## `pontus-x_cli logout`
|
|
480
541
|
|
|
@@ -491,7 +552,7 @@ EXAMPLES
|
|
|
491
552
|
$ pontus-x_cli logout
|
|
492
553
|
```
|
|
493
554
|
|
|
494
|
-
_See code: [src/commands/logout.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
555
|
+
_See code: [src/commands/logout.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/logout.ts)_
|
|
495
556
|
|
|
496
557
|
## `pontus-x_cli publish PATH`
|
|
497
558
|
|
|
@@ -499,19 +560,23 @@ Publish the asset as instructed in the provided script folder.
|
|
|
499
560
|
|
|
500
561
|
```
|
|
501
562
|
USAGE
|
|
502
|
-
$ pontus-x_cli publish PATH -p <value> [
|
|
563
|
+
$ pontus-x_cli publish PATH [--dry-run] [-m <value>] [-p <value>] [-r]
|
|
503
564
|
|
|
504
565
|
ARGUMENTS
|
|
505
|
-
PATH Path to
|
|
566
|
+
PATH Path to find a JSON/YAML or TS file describing the asset to publish
|
|
506
567
|
|
|
507
568
|
FLAGS
|
|
508
|
-
-
|
|
569
|
+
-m, --manifest=<value> [default: ./manifest.yaml] Path to the manifest file
|
|
570
|
+
-p, --provider=<value> [default: https://provider.agrospai.udl.cat] The Provider URL
|
|
571
|
+
-r, --recursive Recursively publish assets in a directory (only for JSON/YAML files)
|
|
509
572
|
--dry-run Dry run the publishing process
|
|
510
573
|
|
|
511
574
|
DESCRIPTION
|
|
512
575
|
Publish the asset as instructed in the provided script folder.
|
|
513
576
|
|
|
514
577
|
EXAMPLES
|
|
578
|
+
$ pontus-x_cli publish samples/publish/algo/
|
|
579
|
+
|
|
515
580
|
$ pontus-x_cli publish samples/publish/algo/spec.json
|
|
516
581
|
|
|
517
582
|
$ pontus-x_cli publish samples/publish/algo/spec.yaml
|
|
@@ -519,30 +584,48 @@ EXAMPLES
|
|
|
519
584
|
$ pontus-x_cli publish samples/publish/algo/index.ts
|
|
520
585
|
```
|
|
521
586
|
|
|
522
|
-
_See code: [src/commands/publish.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
523
|
-
|
|
524
|
-
## `pontus-x_cli revoke DIDS`
|
|
587
|
+
_See code: [src/commands/publish.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/publish.ts)_
|
|
525
588
|
|
|
526
|
-
|
|
589
|
+
## `pontus-x_cli render [DID]`
|
|
527
590
|
|
|
528
591
|
```
|
|
529
592
|
USAGE
|
|
530
|
-
$ pontus-x_cli
|
|
593
|
+
$ pontus-x_cli render [DID] [-d <value>] [-t <value>...] [-a]
|
|
531
594
|
|
|
532
595
|
ARGUMENTS
|
|
533
|
-
|
|
596
|
+
[DID] Dataset DID
|
|
534
597
|
|
|
535
598
|
FLAGS
|
|
536
|
-
-
|
|
599
|
+
-a, --onlyAccess Only render datasets with an access service
|
|
600
|
+
-d, --dst=<value> [default: rendered] Destination folder to save the rendered specs
|
|
601
|
+
-t, --tags=<value>... Tags to filter datasets (they must have all the provided tags)
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
_See code: [src/commands/render.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/render.ts)_
|
|
605
|
+
|
|
606
|
+
## `pontus-x_cli revoke`
|
|
607
|
+
|
|
608
|
+
Publisher revocation of one or more owned DIDs
|
|
609
|
+
|
|
610
|
+
```
|
|
611
|
+
USAGE
|
|
612
|
+
$ pontus-x_cli revoke [-d <value>...] [-m <value>] [-p <value>...] [-r] [-y]
|
|
613
|
+
|
|
614
|
+
FLAGS
|
|
615
|
+
-d, --dids=<value>... DID to revoke
|
|
616
|
+
-m, --manifest=<value> [default: ./manifest.yaml] Path to the manifest file
|
|
617
|
+
-p, --paths=<value>... Path to find a JSON/YAML file describing the assets to revoke
|
|
618
|
+
-r, --recursive Recursively revoke assets in a directory (only for JSON/YAML files)
|
|
619
|
+
-y, --yes Skip confirmation prompt
|
|
537
620
|
|
|
538
621
|
DESCRIPTION
|
|
539
622
|
Publisher revocation of one or more owned DIDs
|
|
540
623
|
|
|
541
624
|
EXAMPLES
|
|
542
|
-
$ pontus-x_cli revoke did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a did:op:abcee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7b
|
|
625
|
+
$ pontus-x_cli revoke -d did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a did:op:abcee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7b
|
|
543
626
|
```
|
|
544
627
|
|
|
545
|
-
_See code: [src/commands/revoke.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
628
|
+
_See code: [src/commands/revoke.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/revoke.ts)_
|
|
546
629
|
|
|
547
630
|
## `pontus-x_cli self-description DID SDURL`
|
|
548
631
|
|
|
@@ -566,7 +649,7 @@ EXAMPLES
|
|
|
566
649
|
$ pontus-x_cli self-description did:op:d22954f2cbf6a85c897ce605c275cc786e099592cc59e3b7dd66b93e784bed8c https://example.com/self-description.json
|
|
567
650
|
```
|
|
568
651
|
|
|
569
|
-
_See code: [src/commands/self-description.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.
|
|
652
|
+
_See code: [src/commands/self-description.ts](https://github.com/AgrospAI/pontus-x_cli/blob/v1.2.5/src/commands/self-description.ts)_
|
|
570
653
|
<!-- commandsstop -->
|
|
571
654
|
|
|
572
655
|
# Useful information
|
|
@@ -615,6 +698,12 @@ npm run build
|
|
|
615
698
|
./bin/run.js COMMAND
|
|
616
699
|
```
|
|
617
700
|
|
|
701
|
+
## Build and run the CLI in one command
|
|
702
|
+
|
|
703
|
+
```bash
|
|
704
|
+
npm run dev -- COMMAND
|
|
705
|
+
```
|
|
706
|
+
|
|
618
707
|
### Global installation
|
|
619
708
|
|
|
620
709
|
```sh
|
|
@@ -656,18 +745,20 @@ test/
|
|
|
656
745
|
└── write/
|
|
657
746
|
```
|
|
658
747
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
748
|
+
- **auth**: commands related to authentication.
|
|
749
|
+
- **read**: commands that do not make modifications in the blockchain.
|
|
750
|
+
- **write**: commands that make modifications in the blockchain. All write commands are run sequentially to avoid conflicts.
|
|
662
751
|
|
|
663
752
|
### Initialization
|
|
664
753
|
|
|
665
|
-
Because the tests interact with the blockchain, we need to first deploy some assets manually and keep track of their DIDs
|
|
754
|
+
Because the tests interact with the blockchain, we need to first deploy some assets manually and keep track of their DIDs. To do that, you can run:
|
|
666
755
|
|
|
667
756
|
```sh
|
|
668
757
|
npm run test:init
|
|
669
758
|
```
|
|
670
759
|
|
|
760
|
+
There are some tests that need the `certificate.key` to be present in the `samples/data` folder. You can obtain it following the instructions in the [How to obtain the certificate key](#how-to-obtain-the-certificate-key) section.
|
|
761
|
+
|
|
671
762
|
### Clean up
|
|
672
763
|
|
|
673
764
|
Whenever you want to clean up the deployed assets in the blockchain, you can run:
|
package/bin/dev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ts-node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const oclif = await import(
|
|
6
|
-
await oclif.execute({ development: true, dir: __dirname })
|
|
7
|
-
})()
|
|
3
|
+
(async () => {
|
|
4
|
+
require("dotenv").config();
|
|
5
|
+
const oclif = await import("@oclif/core");
|
|
6
|
+
await oclif.execute({ development: true, dir: __dirname });
|
|
7
|
+
})();
|
package/bin/run.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// eslint-disable-next-line unicorn/prefer-top-level-await
|
|
4
3
|
(async () => {
|
|
5
|
-
require(
|
|
6
|
-
const oclif = await import(
|
|
7
|
-
await oclif.execute({ dir: __dirname })
|
|
8
|
-
})()
|
|
4
|
+
require("dotenv").config();
|
|
5
|
+
const oclif = await import("@oclif/core");
|
|
6
|
+
await oclif.execute({ dir: __dirname });
|
|
7
|
+
})();
|
package/dist/commands/access.js
CHANGED
|
@@ -13,11 +13,11 @@ class Access extends core_1.Command {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
Access.args = {
|
|
16
|
-
did: core_1.Args.string({ description:
|
|
16
|
+
did: core_1.Args.string({ description: "DID of the asset", required: true }),
|
|
17
17
|
};
|
|
18
|
-
Access.description =
|
|
18
|
+
Access.description = "Access an asset that can be downloaded given its DID";
|
|
19
19
|
Access.examples = [
|
|
20
|
-
|
|
20
|
+
"<%= config.bin %> <%= command.id %> did:op:af3e93c4f18903f91b108e7204b8a752e7605f4547ed507212bd6aca63af5686",
|
|
21
21
|
];
|
|
22
22
|
exports.default = Access;
|
|
23
23
|
//# sourceMappingURL=access.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../src/commands/access.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../src/commands/access.ts"],"names":[],"mappings":";;AAAA,sCAA4C;AAC5C,mDAAgD;AAEhD,MAAqB,MAAO,SAAQ,cAAO;IASzC,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;QACzD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAC;QAChD,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,GAAG,CAAC,iBAAiB,SAAS,IAAI,CAAC,CAAC;IAC3C,CAAC;;AAfM,WAAI,GAAG;IACZ,GAAG,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACtE,CAAC;AACK,kBAAW,GAAG,sDAAsD,CAAC;AACrE,eAAQ,GAAsB;IACnC,6GAA6G;CAC9G,CAAC;kBAPiB,MAAM"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
2
|
export default class ChangePrice extends Command {
|
|
3
3
|
static args: {
|
|
4
4
|
did: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
newPrice: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
6
|
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: Command.Example[];
|
|
7
9
|
static flags: {
|
|
8
10
|
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
};
|
|
10
|
-
static description: string;
|
|
11
|
-
static examples: Command.Example[];
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -12,8 +12,9 @@ class ChangePrice extends core_1.Command {
|
|
|
12
12
|
const { args, flags } = await this.parse(ChangePrice);
|
|
13
13
|
const { did, newPrice } = args;
|
|
14
14
|
const connection = await connection_1.Connection.connect();
|
|
15
|
-
const newPriceNumber = Number.parseFloat(newPrice.replace(
|
|
16
|
-
if (flags.yes ||
|
|
15
|
+
const newPriceNumber = Number.parseFloat(newPrice.replace(",", "."));
|
|
16
|
+
if (flags.yes ||
|
|
17
|
+
readline_sync_1.default.keyInYNStrict(`Set the price to ${newPriceNumber.toString()} for asset ${did}? `)) {
|
|
17
18
|
try {
|
|
18
19
|
const aquariusAsset = await connection.nautilus.getAquariusAsset(did);
|
|
19
20
|
const serviceId = (_b = (_a = aquariusAsset.services) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
@@ -27,23 +28,23 @@ class ChangePrice extends core_1.Command {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
ChangePrice.args = {
|
|
30
|
-
did: core_1.Args.string({ description:
|
|
31
|
+
did: core_1.Args.string({ description: "DID of the asset", required: true }),
|
|
31
32
|
newPrice: core_1.Args.string({
|
|
32
|
-
description:
|
|
33
|
+
description: "New price for the asset",
|
|
33
34
|
required: true,
|
|
34
35
|
}),
|
|
35
36
|
};
|
|
37
|
+
ChangePrice.description = "Change the price keeping the existing currency for an asset with the given DID";
|
|
38
|
+
ChangePrice.examples = [
|
|
39
|
+
"<%= config.bin %> <%= command.id %> did:op:ffeee8c8f19328985ef6743b08e61ef89d5141027fd47612e32e7900cacd2b7a 10",
|
|
40
|
+
];
|
|
36
41
|
ChangePrice.flags = {
|
|
37
42
|
yes: core_1.Flags.boolean({
|
|
38
|
-
char:
|
|
39
|
-
description: 'Automatic yes to prompts',
|
|
40
|
-
required: false,
|
|
43
|
+
char: "y",
|
|
41
44
|
default: false,
|
|
45
|
+
description: "Automatic yes to prompts",
|
|
46
|
+
required: false,
|
|
42
47
|
}),
|
|
43
48
|
};
|
|
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
49
|
exports.default = ChangePrice;
|
|
49
50
|
//# sourceMappingURL=change-price.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-price.js","sourceRoot":"","sources":["../../src/commands/change-price.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"change-price.js","sourceRoot":"","sources":["../../src/commands/change-price.ts"],"names":[],"mappings":";;;;;AAAA,sCAAmD;AACnD,kEAAyC;AACzC,mDAAgD;AAEhD,MAAqB,WAAY,SAAQ,cAAO;IAsB9C,KAAK,CAAC,GAAG;;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC/B,MAAM,UAAU,GAAG,MAAM,uBAAU,CAAC,OAAO,EAAE,CAAC;QAC9C,MAAM,cAAc,GAAW,MAAM,CAAC,UAAU,CAC9C,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAC3B,CAAC;QACF,IACE,KAAK,CAAC,GAAG;YACT,uBAAY,CAAC,aAAa,CACxB,oBAAoB,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CACnE,EACD,CAAC;YACD,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;gBACtE,MAAM,SAAS,GAAG,MAAA,MAAA,aAAa,CAAC,QAAQ,0CAAG,CAAC,CAAC,0CAAE,EAAE,CAAC;gBAClD,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,eAAe,CAClD,aAAa,EACb,SAAS,EACT,cAAc,CAAC,QAAQ,EAAE,CAC1B,CAAC;gBACF,IAAI,CAAC,GAAG,CACN,yCAAyC,UAAU,CAAC,aAAa,CAAC,WAAW,OAAO,EAAE,CAAC,eAAe,IAAI,CAC3G,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC;;AAjDM,gBAAI,GAAG;IACZ,GAAG,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrE,QAAQ,EAAE,WAAI,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,yBAAyB;QACtC,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;AACK,uBAAW,GAChB,gFAAgF,CAAC;AAC5E,oBAAQ,GAAsB;IACnC,gHAAgH;CACjH,CAAC;AACK,iBAAK,GAAG;IACb,GAAG,EAAE,YAAK,CAAC,OAAO,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,0BAA0B;QACvC,QAAQ,EAAE,KAAK;KAChB,CAAC;CACH,CAAC;kBApBiB,WAAW"}
|
|
@@ -3,24 +3,24 @@ 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 core_1 = require("@oclif/core");
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
6
|
const node_fs_1 = require("node:fs");
|
|
9
7
|
const node_path_1 = require("node:path");
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
|
+
const axios_1 = __importDefault(require("axios"));
|
|
10
10
|
class CheckParticipantCompliance extends core_1.Command {
|
|
11
11
|
async run() {
|
|
12
12
|
const { flags } = await this.parse(CheckParticipantCompliance);
|
|
13
|
-
const complianceService =
|
|
13
|
+
const complianceService = "https://compliance.lab.gaia-x.eu/v1/api/credential-offers";
|
|
14
14
|
const folder = (0, node_path_1.dirname)(flags.participant);
|
|
15
|
-
const participantData = JSON.parse((0, node_fs_1.readFileSync)(flags.participant,
|
|
16
|
-
const vp = JSON.parse((0, node_fs_1.readFileSync)(flags.vp,
|
|
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
17
|
await axios_1.default
|
|
18
18
|
.post(`${complianceService}?` +
|
|
19
19
|
`vcid=https://${participantData.issuer_domain}/.well-known/${participantData.participant_name}.compliance.json`, vp)
|
|
20
20
|
.then((response) => {
|
|
21
21
|
if (response.status === 201) {
|
|
22
22
|
const compliance = response.data;
|
|
23
|
-
(0, node_fs_1.writeFileSync)((0, node_path_1.resolve)(folder, participantData.participant_name
|
|
23
|
+
(0, node_fs_1.writeFileSync)((0, node_path_1.resolve)(folder, `${participantData.participant_name}.compliance.json`), JSON.stringify(compliance, null, 2), "utf8");
|
|
24
24
|
console.log(`Gaia-X Compliance verified for ${participantData.participant_legal_name} credentials ` +
|
|
25
25
|
`and stored in ${participantData.participant_name}.compliance.json`);
|
|
26
26
|
}
|
|
@@ -37,16 +37,18 @@ class CheckParticipantCompliance extends core_1.Command {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
CheckParticipantCompliance.description =
|
|
41
|
-
CheckParticipantCompliance.examples = [
|
|
40
|
+
CheckParticipantCompliance.description = "Use Gaia-X Compliance to check a participant Verifiable Presentation";
|
|
41
|
+
CheckParticipantCompliance.examples = [
|
|
42
|
+
"<%= config.bin %> <%= command.id %> -p ./CEP.data.json --vp ./CEP.vp.json",
|
|
43
|
+
];
|
|
42
44
|
CheckParticipantCompliance.flags = {
|
|
43
45
|
participant: core_1.Flags.string({
|
|
44
|
-
char:
|
|
45
|
-
description:
|
|
46
|
+
char: "p",
|
|
47
|
+
description: "Path to the JSON file including the required participant data",
|
|
46
48
|
required: true,
|
|
47
49
|
}),
|
|
48
50
|
vp: core_1.Flags.string({
|
|
49
|
-
description:
|
|
51
|
+
description: "Path to the participant Verifiable Presentation file",
|
|
50
52
|
required: true,
|
|
51
53
|
}),
|
|
52
54
|
};
|