pontus-x_cli 1.2.8 → 2.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.
- package/README.md +131 -43
- package/dist/commands/access.js +19 -2
- package/dist/commands/access.js.map +1 -1
- package/dist/commands/change-currency.d.ts +13 -0
- package/dist/commands/change-currency.js +70 -0
- package/dist/commands/change-currency.js.map +1 -0
- package/dist/commands/change-price.js +7 -5
- package/dist/commands/change-price.js.map +1 -1
- package/dist/commands/compute-results.d.ts +1 -1
- package/dist/commands/compute-results.js +5 -6
- package/dist/commands/compute-results.js.map +1 -1
- package/dist/commands/compute-status.d.ts +1 -1
- package/dist/commands/compute-status.js +12 -8
- package/dist/commands/compute-status.js.map +1 -1
- package/dist/commands/compute.d.ts +2 -2
- package/dist/commands/compute.js +27 -15
- package/dist/commands/compute.js.map +1 -1
- package/dist/commands/edit-additional-metadata.d.ts +1 -1
- package/dist/commands/edit-additional-metadata.js +16 -11
- package/dist/commands/edit-additional-metadata.js.map +1 -1
- package/dist/commands/edit-algo.js +12 -4
- package/dist/commands/edit-algo.js.map +1 -1
- package/dist/commands/edit-asset-allowed.js +32 -6
- package/dist/commands/edit-asset-allowed.js.map +1 -1
- package/dist/commands/edit-asset-url.js +12 -5
- package/dist/commands/edit-asset-url.js.map +1 -1
- package/dist/commands/edit-compute-network.d.ts +14 -0
- package/dist/commands/edit-compute-network.js +78 -0
- package/dist/commands/edit-compute-network.js.map +1 -0
- package/dist/commands/edit-keywords.d.ts +13 -0
- package/dist/commands/edit-keywords.js +57 -0
- package/dist/commands/edit-keywords.js.map +1 -0
- package/dist/commands/edit-trusted-algos.js +18 -11
- package/dist/commands/edit-trusted-algos.js.map +1 -1
- package/dist/commands/edit-trusted-publishers.js +12 -5
- package/dist/commands/edit-trusted-publishers.js.map +1 -1
- package/dist/commands/generate-asset-credentials.js +1 -1
- package/dist/commands/generate-asset-credentials.js.map +1 -1
- package/dist/commands/get.js +2 -2
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/publish.d.ts +2 -1
- package/dist/commands/publish.js +55 -7
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/render.js +46 -27
- package/dist/commands/render.js.map +1 -1
- package/dist/commands/revoke.js +11 -5
- package/dist/commands/revoke.js.map +1 -1
- package/dist/commands/self-description.js +8 -3
- package/dist/commands/self-description.js.map +1 -1
- package/dist/config.d.ts +16 -13
- package/dist/config.js +27 -1
- package/dist/config.js.map +1 -1
- package/dist/lib/aquarius.js +70 -5
- package/dist/lib/aquarius.js.map +1 -1
- package/dist/lib/gaia-x_compliance/generate-credentials/index.js +35 -20
- package/dist/lib/gaia-x_compliance/generate-credentials/index.js.map +1 -1
- package/dist/lib/spec.js +36 -5
- package/dist/lib/spec.js.map +1 -1
- package/dist/scripts/patch-nautilus.cjs +15 -0
- package/dist/scripts/patch-nautilus.cjs.map +1 -0
- package/dist/scripts/patch-nautilus.d.cts +1 -0
- package/dist/types/schema.json +337 -48
- package/dist/utils/connection.d.ts +2 -1
- package/dist/utils/connection.js +84 -4
- package/dist/utils/connection.js.map +1 -1
- package/oclif.manifest.json +169 -15
- package/package.json +6 -6
package/dist/types/schema.json
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
"$ref": "#/definitions/PublishConfig",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"definitions": {
|
|
5
|
+
"ArweaveFileObject": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"encryptMethod": {
|
|
9
|
+
"$ref": "#/definitions/EncryptMethod"
|
|
10
|
+
},
|
|
11
|
+
"encryptedBy": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"transactionId": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"type": {
|
|
18
|
+
"anyOf": [
|
|
19
|
+
{
|
|
20
|
+
"$ref": "#/definitions/FileObjectType"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": ["transactionId", "type"],
|
|
29
|
+
"type": "object"
|
|
30
|
+
},
|
|
31
|
+
"EncryptMethod": {
|
|
32
|
+
"enum": ["AES", "ECIES"],
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
5
35
|
"ExtendedConsumerParameter": {
|
|
6
36
|
"additionalProperties": false,
|
|
7
37
|
"properties": {
|
|
@@ -41,15 +71,95 @@
|
|
|
41
71
|
],
|
|
42
72
|
"type": "object"
|
|
43
73
|
},
|
|
74
|
+
"FileObjectType": {
|
|
75
|
+
"enum": ["url", "ipfs", "arweave", "s3", "ftp"],
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
44
78
|
"FileTypes": {
|
|
45
|
-
"
|
|
79
|
+
"description": "Storage backends ocean-node can read.\n\nTwo v1 types are gone because ocean-node no longer implements them: `graphql` and `smartcontract`. Three are new: `s3`, `ftp` and the node's own persistent storage.",
|
|
80
|
+
"enum": ["url", "ipfs", "arweave", "s3", "ftp", "nodePersistentStorage"],
|
|
46
81
|
"type": "string"
|
|
47
82
|
},
|
|
83
|
+
"FtpFileObject": {
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"properties": {
|
|
86
|
+
"encryptMethod": {
|
|
87
|
+
"$ref": "#/definitions/EncryptMethod"
|
|
88
|
+
},
|
|
89
|
+
"encryptedBy": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"type": {
|
|
93
|
+
"anyOf": [
|
|
94
|
+
{
|
|
95
|
+
"$ref": "#/definitions/FileObjectType"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"url": {
|
|
103
|
+
"description": "Full FTP or FTPS URL: ftp://[user:password@]host[:port]/path or ftps://...",
|
|
104
|
+
"type": "string"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"required": ["type", "url"],
|
|
108
|
+
"type": "object"
|
|
109
|
+
},
|
|
110
|
+
"HeadersObject": {
|
|
111
|
+
"additionalProperties": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"type": "object"
|
|
115
|
+
},
|
|
116
|
+
"IpfsFileObject": {
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"properties": {
|
|
119
|
+
"encryptMethod": {
|
|
120
|
+
"$ref": "#/definitions/EncryptMethod"
|
|
121
|
+
},
|
|
122
|
+
"encryptedBy": {
|
|
123
|
+
"type": "string"
|
|
124
|
+
},
|
|
125
|
+
"hash": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"type": {
|
|
129
|
+
"anyOf": [
|
|
130
|
+
{
|
|
131
|
+
"$ref": "#/definitions/FileObjectType"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"type": "string"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"required": ["hash", "type"],
|
|
140
|
+
"type": "object"
|
|
141
|
+
},
|
|
142
|
+
"LanguageValueObject": {
|
|
143
|
+
"additionalProperties": false,
|
|
144
|
+
"properties": {
|
|
145
|
+
"@direction": {
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
"@language": {
|
|
149
|
+
"type": "string"
|
|
150
|
+
},
|
|
151
|
+
"@value": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"required": ["@value", "@language", "@direction"],
|
|
156
|
+
"type": "object"
|
|
157
|
+
},
|
|
48
158
|
"MetadataConfig": {
|
|
49
159
|
"additionalProperties": false,
|
|
50
160
|
"properties": {
|
|
51
161
|
"additionalInformation": {
|
|
52
|
-
"
|
|
162
|
+
"type": "object"
|
|
53
163
|
},
|
|
54
164
|
"algorithm": {
|
|
55
165
|
"additionalProperties": false,
|
|
@@ -64,7 +174,6 @@
|
|
|
64
174
|
"additionalProperties": false,
|
|
65
175
|
"properties": {
|
|
66
176
|
"checksum": {
|
|
67
|
-
"description": "Checksum of the Docker image.",
|
|
68
177
|
"type": "string"
|
|
69
178
|
},
|
|
70
179
|
"consumerParameters": {
|
|
@@ -74,15 +183,12 @@
|
|
|
74
183
|
"type": "array"
|
|
75
184
|
},
|
|
76
185
|
"entrypoint": {
|
|
77
|
-
"description": "The command to execute, or script to run inside the Docker image.",
|
|
78
186
|
"type": "string"
|
|
79
187
|
},
|
|
80
188
|
"image": {
|
|
81
|
-
"description": "Name of the Docker image.",
|
|
82
189
|
"type": "string"
|
|
83
190
|
},
|
|
84
191
|
"tag": {
|
|
85
|
-
"description": "Tag of the Docker image.",
|
|
86
192
|
"type": "string"
|
|
87
193
|
}
|
|
88
194
|
},
|
|
@@ -90,59 +196,62 @@
|
|
|
90
196
|
"type": "object"
|
|
91
197
|
},
|
|
92
198
|
"language": {
|
|
93
|
-
"description": "Programming language used to implement the software.",
|
|
94
|
-
"type": "string"
|
|
95
|
-
},
|
|
96
|
-
"rawcode": {
|
|
97
|
-
"description": "Rawcode",
|
|
98
199
|
"type": "string"
|
|
99
200
|
},
|
|
100
201
|
"version": {
|
|
101
|
-
"description": "Version of the software preferably in SemVer notation.",
|
|
102
202
|
"type": "string"
|
|
103
203
|
}
|
|
104
204
|
},
|
|
105
205
|
"required": ["container"],
|
|
106
206
|
"type": "object"
|
|
107
207
|
},
|
|
208
|
+
"attachments": {
|
|
209
|
+
"items": {
|
|
210
|
+
"$ref": "#/definitions/RemoteObject"
|
|
211
|
+
},
|
|
212
|
+
"type": "array"
|
|
213
|
+
},
|
|
108
214
|
"author": {
|
|
109
215
|
"type": "string"
|
|
110
216
|
},
|
|
111
217
|
"categories": {
|
|
112
|
-
"description": "Array of categories associated to the asset. Note: recommended to use tags instead of this.",
|
|
113
218
|
"items": {
|
|
114
219
|
"type": "string"
|
|
115
220
|
},
|
|
116
221
|
"type": "array"
|
|
117
222
|
},
|
|
118
|
-
"contentLanguage": {
|
|
119
|
-
"description": "The language of the content. Use one of the language codes from the IETF BCP 47 standard",
|
|
120
|
-
"type": "string"
|
|
121
|
-
},
|
|
122
223
|
"copyrightHolder": {
|
|
123
|
-
"description": "The party holding the legal copyright. Empty by default.",
|
|
124
224
|
"type": "string"
|
|
125
225
|
},
|
|
126
226
|
"description": {
|
|
127
|
-
"description": "Details of what the resource is.",
|
|
128
227
|
"type": "string"
|
|
129
228
|
},
|
|
130
229
|
"did": {
|
|
131
230
|
"type": "string"
|
|
132
231
|
},
|
|
232
|
+
"displayTitle": {
|
|
233
|
+
"$ref": "#/definitions/LanguageValueObject"
|
|
234
|
+
},
|
|
133
235
|
"license": {
|
|
134
|
-
"description": "Short name referencing the license of the asset. If it’s not specified, the following value will be added: “No License Specified”.",
|
|
135
236
|
"type": "string"
|
|
136
237
|
},
|
|
137
238
|
"links": {
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
239
|
+
"anyOf": [
|
|
240
|
+
{
|
|
241
|
+
"items": {
|
|
242
|
+
"type": "string"
|
|
243
|
+
},
|
|
244
|
+
"type": "array"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"additionalProperties": {
|
|
248
|
+
"type": "string"
|
|
249
|
+
},
|
|
250
|
+
"type": "object"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
143
253
|
},
|
|
144
254
|
"name": {
|
|
145
|
-
"description": "Descriptive name or title of the asset.",
|
|
146
255
|
"type": "string"
|
|
147
256
|
},
|
|
148
257
|
"network": {
|
|
@@ -151,20 +260,20 @@
|
|
|
151
260
|
"owner": {
|
|
152
261
|
"type": "string"
|
|
153
262
|
},
|
|
263
|
+
"providedBy": {
|
|
264
|
+
"type": "string"
|
|
265
|
+
},
|
|
154
266
|
"tags": {
|
|
155
|
-
"description": "Array of keywords or tags used to describe this content. Empty by default.",
|
|
156
267
|
"items": {
|
|
157
268
|
"type": "string"
|
|
158
269
|
},
|
|
159
270
|
"type": "array"
|
|
160
271
|
},
|
|
161
272
|
"type": {
|
|
162
|
-
"description": "Asset type. Includes \"dataset\" (e.g. csv file), \"algorithm\" (e.g. Python script). Each type needs a different subset of metadata attributes.",
|
|
163
|
-
"enum": ["dataset", "algorithm"],
|
|
164
273
|
"type": "string"
|
|
165
274
|
}
|
|
166
275
|
},
|
|
167
|
-
"required": ["description", "
|
|
276
|
+
"required": ["description", "name", "type"],
|
|
168
277
|
"type": "object"
|
|
169
278
|
},
|
|
170
279
|
"NftCreateDataWithoutOwner": {
|
|
@@ -208,6 +317,29 @@
|
|
|
208
317
|
"required": ["key", "value"],
|
|
209
318
|
"type": "object"
|
|
210
319
|
},
|
|
320
|
+
"PersistentStorageObject": {
|
|
321
|
+
"additionalProperties": false,
|
|
322
|
+
"properties": {
|
|
323
|
+
"bucketId": {
|
|
324
|
+
"type": "string"
|
|
325
|
+
},
|
|
326
|
+
"encryptMethod": {
|
|
327
|
+
"$ref": "#/definitions/EncryptMethod"
|
|
328
|
+
},
|
|
329
|
+
"encryptedBy": {
|
|
330
|
+
"type": "string"
|
|
331
|
+
},
|
|
332
|
+
"fileName": {
|
|
333
|
+
"type": "string"
|
|
334
|
+
},
|
|
335
|
+
"type": {
|
|
336
|
+
"const": "nodePersistentStorage",
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"required": ["bucketId", "fileName", "type"],
|
|
341
|
+
"type": "object"
|
|
342
|
+
},
|
|
211
343
|
"PublishConfig": {
|
|
212
344
|
"additionalProperties": false,
|
|
213
345
|
"properties": {
|
|
@@ -265,7 +397,14 @@
|
|
|
265
397
|
},
|
|
266
398
|
"files": {
|
|
267
399
|
"items": {
|
|
268
|
-
"
|
|
400
|
+
"anyOf": [
|
|
401
|
+
{
|
|
402
|
+
"$ref": "#/definitions/ServiceFileType%3CFileTypes%3E"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"$ref": "#/definitions/UrlFileObject"
|
|
406
|
+
}
|
|
407
|
+
]
|
|
269
408
|
},
|
|
270
409
|
"type": "array"
|
|
271
410
|
},
|
|
@@ -327,8 +466,155 @@
|
|
|
327
466
|
"required": ["metadata", "nftData", "service"],
|
|
328
467
|
"type": "object"
|
|
329
468
|
},
|
|
330
|
-
"
|
|
331
|
-
"
|
|
469
|
+
"RemoteObject": {
|
|
470
|
+
"additionalProperties": false,
|
|
471
|
+
"properties": {
|
|
472
|
+
"additionalInformation": {
|
|
473
|
+
"additionalProperties": {
|
|
474
|
+
"type": ["string", "number", "boolean"]
|
|
475
|
+
},
|
|
476
|
+
"type": "object"
|
|
477
|
+
},
|
|
478
|
+
"description": {
|
|
479
|
+
"$ref": "#/definitions/LanguageValueObject"
|
|
480
|
+
},
|
|
481
|
+
"displayName": {
|
|
482
|
+
"$ref": "#/definitions/LanguageValueObject"
|
|
483
|
+
},
|
|
484
|
+
"fileType": {
|
|
485
|
+
"type": "string"
|
|
486
|
+
},
|
|
487
|
+
"mirrors": {
|
|
488
|
+
"items": {
|
|
489
|
+
"$ref": "#/definitions/RemoteSource"
|
|
490
|
+
},
|
|
491
|
+
"type": "array"
|
|
492
|
+
},
|
|
493
|
+
"name": {
|
|
494
|
+
"type": "string"
|
|
495
|
+
},
|
|
496
|
+
"sha256": {
|
|
497
|
+
"type": "string"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
"required": ["name", "fileType", "sha256", "mirrors"],
|
|
501
|
+
"type": "object"
|
|
502
|
+
},
|
|
503
|
+
"RemoteSource": {
|
|
504
|
+
"additionalProperties": false,
|
|
505
|
+
"properties": {
|
|
506
|
+
"headers": {
|
|
507
|
+
"anyOf": [
|
|
508
|
+
{
|
|
509
|
+
"type": "string"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"additionalProperties": {
|
|
513
|
+
"type": ["string", "number", "boolean"]
|
|
514
|
+
},
|
|
515
|
+
"type": "object"
|
|
516
|
+
}
|
|
517
|
+
]
|
|
518
|
+
},
|
|
519
|
+
"ipfsCid": {
|
|
520
|
+
"type": "string"
|
|
521
|
+
},
|
|
522
|
+
"method": {
|
|
523
|
+
"type": "string"
|
|
524
|
+
},
|
|
525
|
+
"type": {
|
|
526
|
+
"type": "string"
|
|
527
|
+
},
|
|
528
|
+
"url": {
|
|
529
|
+
"type": "string"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"required": ["type"],
|
|
533
|
+
"type": "object"
|
|
534
|
+
},
|
|
535
|
+
"S3FileObject": {
|
|
536
|
+
"additionalProperties": false,
|
|
537
|
+
"properties": {
|
|
538
|
+
"encryptMethod": {
|
|
539
|
+
"$ref": "#/definitions/EncryptMethod"
|
|
540
|
+
},
|
|
541
|
+
"encryptedBy": {
|
|
542
|
+
"type": "string"
|
|
543
|
+
},
|
|
544
|
+
"s3Access": {
|
|
545
|
+
"$ref": "#/definitions/S3Object"
|
|
546
|
+
},
|
|
547
|
+
"type": {
|
|
548
|
+
"anyOf": [
|
|
549
|
+
{
|
|
550
|
+
"$ref": "#/definitions/FileObjectType"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"type": "string"
|
|
554
|
+
}
|
|
555
|
+
]
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
"required": ["s3Access", "type"],
|
|
559
|
+
"type": "object"
|
|
560
|
+
},
|
|
561
|
+
"S3Object": {
|
|
562
|
+
"additionalProperties": false,
|
|
563
|
+
"properties": {
|
|
564
|
+
"accessKeyId": {
|
|
565
|
+
"type": "string"
|
|
566
|
+
},
|
|
567
|
+
"bucket": {
|
|
568
|
+
"type": "string"
|
|
569
|
+
},
|
|
570
|
+
"endpoint": {
|
|
571
|
+
"type": "string"
|
|
572
|
+
},
|
|
573
|
+
"forcePathStyle": {
|
|
574
|
+
"description": "If true, use path-style addressing (e.g. endpoint/bucket/key). Required for some S3-compatible services (e.g. MinIO). Default false (virtual-host style, e.g. bucket.endpoint/key).",
|
|
575
|
+
"type": "boolean"
|
|
576
|
+
},
|
|
577
|
+
"objectKey": {
|
|
578
|
+
"type": "string"
|
|
579
|
+
},
|
|
580
|
+
"region": {
|
|
581
|
+
"type": "string"
|
|
582
|
+
},
|
|
583
|
+
"secretAccessKey": {
|
|
584
|
+
"type": "string"
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
"required": [
|
|
588
|
+
"endpoint",
|
|
589
|
+
"objectKey",
|
|
590
|
+
"bucket",
|
|
591
|
+
"accessKeyId",
|
|
592
|
+
"secretAccessKey"
|
|
593
|
+
],
|
|
594
|
+
"type": "object"
|
|
595
|
+
},
|
|
596
|
+
"ServiceFileType<FileTypes>": {
|
|
597
|
+
"anyOf": [
|
|
598
|
+
{
|
|
599
|
+
"$ref": "#/definitions/IpfsFileObject"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"$ref": "#/definitions/ArweaveFileObject"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"$ref": "#/definitions/S3FileObject"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"$ref": "#/definitions/FtpFileObject"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"$ref": "#/definitions/PersistentStorageObject"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"$ref": "#/definitions/UrlFileObject"
|
|
615
|
+
}
|
|
616
|
+
],
|
|
617
|
+
"description": "Maps a `FileTypes` member onto the ocean.js storage object it needs."
|
|
332
618
|
},
|
|
333
619
|
"ServiceTypes": {
|
|
334
620
|
"enum": ["access", "compute"],
|
|
@@ -336,6 +622,7 @@
|
|
|
336
622
|
},
|
|
337
623
|
"TrustedAlgorithmAsset": {
|
|
338
624
|
"additionalProperties": false,
|
|
625
|
+
"description": "An algorithm to trust, by DID and (now that v5 requires it) by service.\n\nDDO v5's `PublisherTrustedAlgorithms` carries a required `serviceId`, so nautilus finally resolves one entry per (did, serviceId) pair instead of assuming `services[0]`.",
|
|
339
626
|
"properties": {
|
|
340
627
|
"did": {
|
|
341
628
|
"type": "string"
|
|
@@ -350,34 +637,36 @@
|
|
|
350
637
|
"required": ["did"],
|
|
351
638
|
"type": "object"
|
|
352
639
|
},
|
|
353
|
-
"
|
|
640
|
+
"UrlFileObject": {
|
|
354
641
|
"additionalProperties": false,
|
|
355
642
|
"properties": {
|
|
356
|
-
"
|
|
357
|
-
"
|
|
358
|
-
"type": "string"
|
|
359
|
-
},
|
|
360
|
-
"description": "Headers key value pairs associated with the asset GET request",
|
|
361
|
-
"type": "object"
|
|
643
|
+
"encryptMethod": {
|
|
644
|
+
"$ref": "#/definitions/EncryptMethod"
|
|
362
645
|
},
|
|
363
|
-
"
|
|
364
|
-
"
|
|
365
|
-
|
|
646
|
+
"encryptedBy": {
|
|
647
|
+
"type": "string"
|
|
648
|
+
},
|
|
649
|
+
"headers": {
|
|
650
|
+
"$ref": "#/definitions/HeadersObject"
|
|
366
651
|
},
|
|
367
652
|
"method": {
|
|
368
|
-
"description": "HTTP method used",
|
|
369
653
|
"type": "string"
|
|
370
654
|
},
|
|
371
655
|
"type": {
|
|
372
|
-
"
|
|
373
|
-
|
|
656
|
+
"anyOf": [
|
|
657
|
+
{
|
|
658
|
+
"$ref": "#/definitions/FileObjectType"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"type": "string"
|
|
662
|
+
}
|
|
663
|
+
]
|
|
374
664
|
},
|
|
375
665
|
"url": {
|
|
376
|
-
"description": "File URL.",
|
|
377
666
|
"type": "string"
|
|
378
667
|
}
|
|
379
668
|
},
|
|
380
|
-
"required": ["
|
|
669
|
+
"required": ["method", "type", "url"],
|
|
381
670
|
"type": "object"
|
|
382
671
|
}
|
|
383
672
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nautilus } from "@deltadao/nautilus";
|
|
1
|
+
import { Nautilus, type RemoteStore } from "@deltadao/nautilus";
|
|
2
2
|
import { Wallet } from "ethers";
|
|
3
3
|
import { type FixedRatePricingConfigGenerator, type NetworkConfig } from "../config";
|
|
4
4
|
export declare class Connection {
|
|
@@ -8,6 +8,7 @@ export declare class Connection {
|
|
|
8
8
|
pricingConfig: {
|
|
9
9
|
[p: string]: FixedRatePricingConfigGenerator;
|
|
10
10
|
};
|
|
11
|
+
remoteStore?: RemoteStore | undefined;
|
|
11
12
|
private constructor();
|
|
12
13
|
static connect(envOverrides?: Record<string, string>): Promise<Connection>;
|
|
13
14
|
}
|
package/dist/utils/connection.js
CHANGED
|
@@ -4,12 +4,43 @@ exports.Connection = void 0;
|
|
|
4
4
|
const nautilus_1 = require("@deltadao/nautilus");
|
|
5
5
|
const ethers_1 = require("ethers");
|
|
6
6
|
const config_1 = require("../config");
|
|
7
|
+
// Backward compatibility: ethers v6 renamed `transactionHash` to `hash` on TransactionReceipt.
|
|
8
|
+
// Provide a getter on both CommonJS and ESM TransactionReceipt so legacy scripts accessing `receipt.transactionHash` continue to work.
|
|
9
|
+
if (!("transactionHash" in ethers_1.TransactionReceipt.prototype)) {
|
|
10
|
+
Object.defineProperty(ethers_1.TransactionReceipt.prototype, "transactionHash", {
|
|
11
|
+
get() {
|
|
12
|
+
return this.hash;
|
|
13
|
+
},
|
|
14
|
+
configurable: true,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function createRemoteStore(env) {
|
|
18
|
+
if (env.PINATA_JWT) {
|
|
19
|
+
return new nautilus_1.IpfsRemoteStore({
|
|
20
|
+
uploadUrl: env.PINATA_UPLOAD_URL ||
|
|
21
|
+
"https://api.pinata.cloud/pinning/pinFileToIPFS",
|
|
22
|
+
headers: { Authorization: `Bearer ${env.PINATA_JWT}` },
|
|
23
|
+
probe: "upload",
|
|
24
|
+
gatewayUrl: env.PINATA_GATEWAY_URL || "https://gateway.pinata.cloud",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (env.IPFS_UPLOAD_URL) {
|
|
28
|
+
return new nautilus_1.IpfsRemoteStore({
|
|
29
|
+
uploadUrl: env.IPFS_UPLOAD_URL,
|
|
30
|
+
probe: "upload",
|
|
31
|
+
gatewayUrl: env.IPFS_GATEWAY_URL,
|
|
32
|
+
allowInsecureTransport: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
7
37
|
class Connection {
|
|
8
|
-
constructor(wallet, nautilus, networkConfig, pricingConfig) {
|
|
38
|
+
constructor(wallet, nautilus, networkConfig, pricingConfig, remoteStore) {
|
|
9
39
|
this.wallet = wallet;
|
|
10
40
|
this.nautilus = nautilus;
|
|
11
41
|
this.networkConfig = networkConfig;
|
|
12
42
|
this.pricingConfig = pricingConfig;
|
|
43
|
+
this.remoteStore = remoteStore;
|
|
13
44
|
}
|
|
14
45
|
static async connect(envOverrides) {
|
|
15
46
|
const env = Object.assign(Object.assign({}, process.env), envOverrides);
|
|
@@ -27,11 +58,60 @@ class Connection {
|
|
|
27
58
|
throw new Error(`Login to retrieve your private key using "pontusx-cli login keyFile.json"` +
|
|
28
59
|
` and do not forget to logout when finished.`);
|
|
29
60
|
}
|
|
30
|
-
const provider = new ethers_1.
|
|
61
|
+
const provider = new ethers_1.JsonRpcProvider(networkConfig.nodeUri);
|
|
31
62
|
const wallet = new ethers_1.Wallet(env.PRIVATE_KEY, provider);
|
|
32
|
-
const
|
|
63
|
+
const oceanNodeUri = env.OCEAN_NODE_URI ||
|
|
64
|
+
networkConfig.oceanNodeUri ||
|
|
65
|
+
config_1.DEFAULT_OCEAN_NODE_URI;
|
|
66
|
+
const remoteStore = createRemoteStore(env);
|
|
67
|
+
const nautilus = await nautilus_1.Nautilus.create(wallet, {
|
|
68
|
+
config: Object.assign(Object.assign({}, networkConfig), { oceanNodeUri, nodeUri: networkConfig.nodeUri }),
|
|
69
|
+
remoteStore,
|
|
70
|
+
});
|
|
71
|
+
const patchReceipt = (receipt) => {
|
|
72
|
+
if (receipt && !receipt.transactionHash && receipt.hash) {
|
|
73
|
+
try {
|
|
74
|
+
receipt.transactionHash = receipt.hash;
|
|
75
|
+
}
|
|
76
|
+
catch (_a) {
|
|
77
|
+
// ignore
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return receipt;
|
|
81
|
+
};
|
|
82
|
+
const patchResponse = (response) => {
|
|
83
|
+
if (response === null || response === void 0 ? void 0 : response.setMetadataTxReceipt) {
|
|
84
|
+
patchReceipt(response.setMetadataTxReceipt);
|
|
85
|
+
}
|
|
86
|
+
return response;
|
|
87
|
+
};
|
|
88
|
+
const originalPublish = nautilus.publish.bind(nautilus);
|
|
89
|
+
nautilus.publish = (async (asset, options) => {
|
|
90
|
+
const res = await originalPublish(asset, options);
|
|
91
|
+
return patchResponse(res);
|
|
92
|
+
});
|
|
93
|
+
const originalCompletePublish = nautilus.completePublish.bind(nautilus);
|
|
94
|
+
nautilus.completePublish = (async (nftAddress, asset, options) => {
|
|
95
|
+
const res = await originalCompletePublish(nftAddress, asset, options);
|
|
96
|
+
return patchResponse(res);
|
|
97
|
+
});
|
|
98
|
+
const originalEdit = nautilus.edit.bind(nautilus);
|
|
99
|
+
nautilus.edit = (async (asset, options) => {
|
|
100
|
+
const res = await originalEdit(asset, options);
|
|
101
|
+
return patchResponse(res);
|
|
102
|
+
});
|
|
103
|
+
const originalSetLifecycle = nautilus.setAssetLifecycleState.bind(nautilus);
|
|
104
|
+
nautilus.setAssetLifecycleState = (async (asset, state) => {
|
|
105
|
+
const tx = await originalSetLifecycle(asset, state);
|
|
106
|
+
return patchReceipt(tx);
|
|
107
|
+
});
|
|
108
|
+
const originalSetPrice = nautilus.setServicePrice.bind(nautilus);
|
|
109
|
+
nautilus.setServicePrice = (async (asset, serviceId, price) => {
|
|
110
|
+
const tx = await originalSetPrice(asset, serviceId, price);
|
|
111
|
+
return patchReceipt(tx);
|
|
112
|
+
});
|
|
33
113
|
console.log(`Connected as ${wallet.address}`);
|
|
34
|
-
return new Connection(wallet, nautilus, networkConfig, pricingConfig);
|
|
114
|
+
return new Connection(wallet, nautilus, networkConfig, pricingConfig, remoteStore);
|
|
35
115
|
}
|
|
36
116
|
}
|
|
37
117
|
exports.Connection = Connection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/utils/connection.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/utils/connection.ts"],"names":[],"mappings":";;;AAAA,iDAI4B;AAC5B,mCAAqE;AAErE,sCAOmB;AAEnB,+FAA+F;AAC/F,uIAAuI;AACvI,IAAI,CAAC,CAAC,iBAAiB,IAAI,2BAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;IACzD,MAAM,CAAC,cAAc,CAAC,2BAAkB,CAAC,SAAS,EAAE,iBAAiB,EAAE;QACrE,GAAG;YACD,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,CAAC;QACD,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CACxB,GAAuC;IAEvC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;QACnB,OAAO,IAAI,0BAAe,CAAC;YACzB,SAAS,EACP,GAAG,CAAC,iBAAiB;gBACrB,gDAAgD;YAClD,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,GAAG,CAAC,UAAU,EAAE,EAAE;YACtD,KAAK,EAAE,QAAQ;YACf,UAAU,EAAE,GAAG,CAAC,kBAAkB,IAAI,8BAA8B;SACrE,CAAC,CAAC;IACL,CAAC;IAED,IAAI,GAAG,CAAC,eAAe,EAAE,CAAC;QACxB,OAAO,IAAI,0BAAe,CAAC;YACzB,SAAS,EAAE,GAAG,CAAC,eAAe;YAC9B,KAAK,EAAE,QAAQ;YACf,UAAU,EAAE,GAAG,CAAC,gBAAgB;YAChC,sBAAsB,EAAE,IAAI;SAC7B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAa,UAAU;IACrB,YACS,M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