@super-protocol/sp-cli 0.0.8 → 0.0.10-beta

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 (95) hide show
  1. package/README.md +200 -167
  2. package/dist/commands/account/base.d.ts +3 -4
  3. package/dist/commands/account/base.js +12 -9
  4. package/dist/commands/account/forget.d.ts +1 -1
  5. package/dist/commands/account/forget.js +66 -17
  6. package/dist/commands/account/get-sppi.js +7 -11
  7. package/dist/commands/account/info.d.ts +1 -13
  8. package/dist/commands/account/info.js +25 -45
  9. package/dist/commands/account/list.js +6 -6
  10. package/dist/commands/account/login.d.ts +10 -3
  11. package/dist/commands/account/login.js +143 -87
  12. package/dist/commands/account/switch.d.ts +3 -0
  13. package/dist/commands/account/switch.js +31 -11
  14. package/dist/commands/assets/base.d.ts +39 -0
  15. package/dist/commands/assets/base.js +217 -0
  16. package/dist/commands/assets/create.d.ts +41 -0
  17. package/dist/commands/assets/create.js +277 -0
  18. package/dist/commands/assets/delete.d.ts +14 -0
  19. package/dist/commands/assets/delete.js +69 -0
  20. package/dist/commands/assets/get.d.ts +14 -0
  21. package/dist/commands/assets/get.js +79 -0
  22. package/dist/commands/assets/list.d.ts +7 -0
  23. package/dist/commands/assets/list.js +33 -0
  24. package/dist/commands/assets/update.d.ts +44 -0
  25. package/dist/commands/assets/update.js +321 -0
  26. package/dist/commands/base.d.ts +1 -0
  27. package/dist/commands/base.js +6 -0
  28. package/dist/config/config.schema.d.ts +2 -11
  29. package/dist/config/config.schema.js +2 -7
  30. package/dist/constants.d.ts +3 -3
  31. package/dist/constants.js +3 -3
  32. package/dist/errors.d.ts +0 -2
  33. package/dist/errors.js +0 -2
  34. package/dist/hooks/prerun/auth.js +5 -9
  35. package/dist/interfaces/config-manager.interface.d.ts +3 -1
  36. package/dist/lib/container.d.ts +4 -12
  37. package/dist/lib/container.js +28 -113
  38. package/dist/lib/swarm-client/fetch-api.d.ts +7 -0
  39. package/dist/lib/swarm-client/fetch-api.js +41 -0
  40. package/dist/lib/swarm-client/fetch-timeout.client.d.ts +1 -0
  41. package/dist/lib/swarm-client/fetch-timeout.client.js +32 -0
  42. package/dist/lib/swarm-client/index.d.ts +6 -0
  43. package/dist/lib/swarm-client/index.js +31 -0
  44. package/dist/lib/swarm-client/middlewares/authorization.middleware.d.ts +2 -0
  45. package/dist/lib/swarm-client/middlewares/authorization.middleware.js +12 -0
  46. package/dist/lib/swarm-client/middlewares/index.d.ts +6 -0
  47. package/dist/lib/swarm-client/middlewares/index.js +5 -0
  48. package/dist/lib/swarm-client/middlewares/logger.middleware.d.ts +2 -0
  49. package/dist/lib/swarm-client/middlewares/logger.middleware.js +30 -0
  50. package/dist/lib/swarm-client/middlewares/request-id.middleware.d.ts +2 -0
  51. package/dist/lib/swarm-client/middlewares/request-id.middleware.js +13 -0
  52. package/dist/lib/swarm-client/types.d.ts +23 -0
  53. package/dist/lib/swarm-client/types.js +1 -0
  54. package/dist/managers/account-manager.d.ts +1 -0
  55. package/dist/managers/account-manager.js +13 -18
  56. package/dist/managers/config-file-manager.d.ts +24 -17
  57. package/dist/managers/config-file-manager.js +285 -161
  58. package/dist/managers/config-manager.d.ts +6 -6
  59. package/dist/managers/config-manager.js +8 -8
  60. package/dist/services/account.service.d.ts +42 -0
  61. package/dist/services/account.service.js +140 -0
  62. package/dist/services/asset.service.d.ts +35 -0
  63. package/dist/services/asset.service.js +120 -0
  64. package/dist/services/auth.service.d.ts +4 -6
  65. package/dist/services/auth.service.js +108 -118
  66. package/dist/utils/helper.js +2 -2
  67. package/dist/utils/progress.js +1 -0
  68. package/dist/utils/prompt.service.d.ts +8 -1
  69. package/dist/utils/prompt.service.js +33 -1
  70. package/oclif.manifest.json +479 -215
  71. package/package.json +7 -8
  72. package/dist/commands/files/download.d.ts +0 -15
  73. package/dist/commands/files/download.js +0 -63
  74. package/dist/commands/files/upload.d.ts +0 -18
  75. package/dist/commands/files/upload.js +0 -83
  76. package/dist/commands/storage/base.d.ts +0 -13
  77. package/dist/commands/storage/base.js +0 -125
  78. package/dist/commands/storage/create.d.ts +0 -11
  79. package/dist/commands/storage/create.js +0 -53
  80. package/dist/commands/storage/select.d.ts +0 -9
  81. package/dist/commands/storage/select.js +0 -38
  82. package/dist/commands/storage/show.d.ts +0 -17
  83. package/dist/commands/storage/show.js +0 -34
  84. package/dist/commands/storage/update.d.ts +0 -14
  85. package/dist/commands/storage/update.js +0 -204
  86. package/dist/commands/workflows/extend-lease.d.ts +0 -17
  87. package/dist/commands/workflows/extend-lease.js +0 -102
  88. package/dist/hooks/finally/shutdown-blockchain.d.ts +0 -3
  89. package/dist/hooks/finally/shutdown-blockchain.js +0 -8
  90. package/dist/middlewares/auth-middleware.d.ts +0 -9
  91. package/dist/middlewares/auth-middleware.js +0 -91
  92. package/dist/middlewares/cookies-middleware.d.ts +0 -8
  93. package/dist/middlewares/cookies-middleware.js +0 -80
  94. package/dist/services/storage.service.d.ts +0 -73
  95. package/dist/services/storage.service.js +0 -378
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @super-protocol/sp-cli
21
21
  $ sp COMMAND
22
22
  running command...
23
23
  $ sp (--version)
24
- @super-protocol/sp-cli/0.0.8 linux-x64 node-v22.21.1
24
+ @super-protocol/sp-cli/0.0.10-beta linux-x64 node-v22.22.0
25
25
  $ sp --help [COMMAND]
26
26
  USAGE
27
27
  $ sp COMMAND
@@ -36,34 +36,34 @@ USAGE
36
36
  * [`sp account list`](#sp-account-list)
37
37
  * [`sp account login`](#sp-account-login)
38
38
  * [`sp account switch`](#sp-account-switch)
39
+ * [`sp assets create`](#sp-assets-create)
40
+ * [`sp assets delete`](#sp-assets-delete)
41
+ * [`sp assets get`](#sp-assets-get)
42
+ * [`sp assets list`](#sp-assets-list)
43
+ * [`sp assets update`](#sp-assets-update)
39
44
  * [`sp autocomplete [SHELL]`](#sp-autocomplete-shell)
40
- * [`sp files download RESOURCEFILE LOCALDIRECTORY`](#sp-files-download-resourcefile-localdirectory)
41
- * [`sp files upload PATH`](#sp-files-upload-path)
42
45
  * [`sp help [COMMAND]`](#sp-help-command)
43
46
  * [`sp login`](#sp-login)
44
- * [`sp storage create`](#sp-storage-create)
45
- * [`sp storage select`](#sp-storage-select)
46
- * [`sp storage show`](#sp-storage-show)
47
- * [`sp storage update`](#sp-storage-update)
48
- * [`sp workflows extend-lease ORDERID`](#sp-workflows-extend-lease-orderid)
49
47
 
50
48
  ## `sp account forget`
51
49
 
52
- Purge all account details
50
+ Account management
53
51
 
54
52
  ```
55
53
  USAGE
56
- $ sp account forget -n <value> [--json] [--tty] [-f]
54
+ $ sp account forget [--json] [--tty] [-f] [-n <value>]
57
55
 
58
56
  FLAGS
59
- -f, --force Force deletion without confirmation
60
- -n, --name=<value> (required) Configuration name to delete
57
+ -f, --force Force forget without confirmation
58
+ -n, --name=<value> Account name to forget
61
59
 
62
60
  GLOBAL FLAGS
63
61
  --json Format output as json.
64
62
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
65
63
 
66
64
  DESCRIPTION
65
+ Account management
66
+
67
67
  Purge all account details
68
68
 
69
69
  EXAMPLES
@@ -74,11 +74,11 @@ EXAMPLES
74
74
  $ sp account forget --name "My Account" --force
75
75
  ```
76
76
 
77
- _See code: [src/commands/account/forget.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/forget.ts)_
77
+ _See code: [src/commands/account/forget.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/account/forget.ts)_
78
78
 
79
79
  ## `sp account get-sppi`
80
80
 
81
- Get SPPI (Super Protocol incentive tokens)
81
+ Account management
82
82
 
83
83
  ```
84
84
  USAGE
@@ -89,17 +89,19 @@ GLOBAL FLAGS
89
89
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
90
90
 
91
91
  DESCRIPTION
92
+ Account management
93
+
92
94
  Get SPPI (Super Protocol incentive tokens)
93
95
 
94
96
  EXAMPLES
95
97
  $ sp account get-sppi
96
98
  ```
97
99
 
98
- _See code: [src/commands/account/get-sppi.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/get-sppi.ts)_
100
+ _See code: [src/commands/account/get-sppi.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/account/get-sppi.ts)_
99
101
 
100
102
  ## `sp account info`
101
103
 
102
- Information about current authorized user
104
+ Account management
103
105
 
104
106
  ```
105
107
  USAGE
@@ -113,10 +115,12 @@ GLOBAL FLAGS
113
115
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
114
116
 
115
117
  DESCRIPTION
118
+ Account management
119
+
116
120
  Information about current authorized user
117
121
  ```
118
122
 
119
- _See code: [src/commands/account/info.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/info.ts)_
123
+ _See code: [src/commands/account/info.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/account/info.ts)_
120
124
 
121
125
  ## `sp account list`
122
126
 
@@ -137,19 +141,20 @@ EXAMPLES
137
141
  $ sp account list
138
142
  ```
139
143
 
140
- _See code: [src/commands/account/list.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/list.ts)_
144
+ _See code: [src/commands/account/list.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/account/list.ts)_
141
145
 
142
146
  ## `sp account login`
143
147
 
144
- Login to SuperProtocol (sign up or sign in).
148
+ Login and account creation for SuperProtocol
145
149
 
146
150
  ```
147
151
  USAGE
148
- $ sp account login [--json] [--tty] [--name <value>] [--privateKey <value>] [-y]
152
+ $ sp account login [--json] [--tty] [--name <value>] [--privateKey <value>] [--path <value>] [-y]
149
153
 
150
154
  FLAGS
151
155
  -y, --yes Skip questions (generate keys when needed).
152
156
  --name=<value> Account readable name
157
+ --path=<value> Path to account(configuration) file to import
153
158
  --privateKey=<value> Account private key used for authentication
154
159
 
155
160
  GLOBAL FLAGS
@@ -157,6 +162,8 @@ GLOBAL FLAGS
157
162
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
158
163
 
159
164
  DESCRIPTION
165
+ Login and account creation for SuperProtocol
166
+
160
167
  Login to SuperProtocol (sign up or sign in).
161
168
 
162
169
  ALIASES
@@ -166,297 +173,323 @@ EXAMPLES
166
173
  $ sp account login
167
174
  ```
168
175
 
169
- _See code: [src/commands/account/login.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/login.ts)_
176
+ _See code: [src/commands/account/login.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/account/login.ts)_
170
177
 
171
178
  ## `sp account switch`
172
179
 
173
- Switch to a different account
180
+ Account management
174
181
 
175
182
  ```
176
183
  USAGE
177
- $ sp account switch [--json] [--tty]
184
+ $ sp account switch [--json] [--tty] [-n <value>]
185
+
186
+ FLAGS
187
+ -n, --name=<value> Account name to switch
178
188
 
179
189
  GLOBAL FLAGS
180
190
  --json Format output as json.
181
191
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
182
192
 
183
193
  DESCRIPTION
194
+ Account management
195
+
184
196
  Switch to a different account
185
197
 
186
198
  EXAMPLES
187
199
  $ sp account switch
188
200
  ```
189
201
 
190
- _See code: [src/commands/account/switch.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/switch.ts)_
202
+ _See code: [src/commands/account/switch.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/account/switch.ts)_
191
203
 
192
- ## `sp autocomplete [SHELL]`
204
+ ## `sp assets create`
193
205
 
194
- Display autocomplete installation instructions.
206
+ Asset management
195
207
 
196
208
  ```
197
209
  USAGE
198
- $ sp autocomplete [SHELL] [-r]
199
-
200
- ARGUMENTS
201
- [SHELL] (zsh|bash|powershell) Shell type
210
+ $ sp assets create [--json] [--tty] [-f <value>] [-n <value>] [-t data|image|output] [-s
211
+ storj|s3|dockerhub|github|google-docs] [--tag <value>] [--hash <value>] [--size <value>] [--storjBucket <value>]
212
+ [--storjPath <value>] [--storjToken <value>] [--s3Bucket <value>] [--s3Path <value>] [--s3AccessKey <value>]
213
+ [--s3SecretKey <value>] [--s3Region <value>] [--s3Endpoint <value>] [--dockerImage <value>] [--dockerRegistry
214
+ <value>] [--dockerUsername <value>] [--dockerPassword <value>] [--githubRepo <value>] [--githubToken <value>]
215
+ [--githubBranch <value>] [--gdocsDocumentId <value>] [--gdocsApiKey <value>] [--gdocsServiceAccountJson <value>]
202
216
 
203
217
  FLAGS
204
- -r, --refresh-cache Refresh cache (ignores displaying instructions)
218
+ -f, --fromFile=<value> Path to a JSON file that contains asset definition.
219
+ -n, --name=<value> Asset name
220
+ -s, --sourceType=<option> Source type
221
+ <options: storj|s3|dockerhub|github|google-docs>
222
+ -t, --type=<option> Asset type
223
+ <options: data|image|output>
224
+ --dockerImage=<value> Docker image
225
+ --dockerPassword=<value> Docker password
226
+ --dockerRegistry=<value> Docker registry
227
+ --dockerUsername=<value> Docker username
228
+ --gdocsApiKey=<value> Google Docs API key
229
+ --gdocsDocumentId=<value> Google Docs document ID
230
+ --gdocsServiceAccountJson=<value> Google Docs service account JSON
231
+ --githubBranch=<value> GitHub branch
232
+ --githubRepo=<value> GitHub repo (org/repo)
233
+ --githubToken=<value> GitHub token
234
+ --hash=<value> Asset hash
235
+ --s3AccessKey=<value> S3 access key
236
+ --s3Bucket=<value> S3 bucket
237
+ --s3Endpoint=<value> S3 endpoint
238
+ --s3Path=<value> S3 path
239
+ --s3Region=<value> S3 region
240
+ --s3SecretKey=<value> S3 secret key
241
+ --size=<value> Asset size in bytes
242
+ --storjBucket=<value> Storj bucket
243
+ --storjPath=<value> Storj path
244
+ --storjToken=<value> Storj access token
245
+ --tag=<value> Asset tag
205
246
 
206
- DESCRIPTION
207
- Display autocomplete installation instructions.
247
+ GLOBAL FLAGS
248
+ --json Format output as json.
249
+ --[no-]tty Force or disable interactive mode (use --no-tty to disable).
208
250
 
209
- EXAMPLES
210
- $ sp autocomplete
251
+ DESCRIPTION
252
+ Asset management
211
253
 
212
- $ sp autocomplete bash
254
+ Create a new asset.
213
255
 
214
- $ sp autocomplete zsh
256
+ EXAMPLES
257
+ $ sp assets create
215
258
 
216
- $ sp autocomplete powershell
259
+ $ sp assets create --fromFile ./asset.json
217
260
 
218
- $ sp autocomplete --refresh-cache
261
+ $ sp assets create --name "dataset-v1" --type data --sourceType s3 --s3Bucket b --s3Path p --s3AccessKey a --s3SecretKey s --s3Region us-east-1
219
262
  ```
220
263
 
221
- _See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.39/src/commands/autocomplete/index.ts)_
264
+ _See code: [src/commands/assets/create.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/assets/create.ts)_
222
265
 
223
- ## `sp files download RESOURCEFILE LOCALDIRECTORY`
266
+ ## `sp assets delete`
224
267
 
225
- Download file or directory described in resource file
268
+ Asset management
226
269
 
227
270
  ```
228
271
  USAGE
229
- $ sp files download RESOURCEFILE LOCALDIRECTORY [--json] [--tty] [--maximum-concurrent <value>]
230
-
231
- ARGUMENTS
232
- RESOURCEFILE Path to a resource file
233
- LOCALDIRECTORY Path to save downloaded file
272
+ $ sp assets delete [--json] [--tty] [-f] [-i <value>] [-n <value>]
234
273
 
235
274
  FLAGS
236
- --maximum-concurrent=<value> [default: 1] Maximum concurrent pieces to download at once per transfer
275
+ -f, --force Delete without confirmation
276
+ -i, --id=<value> Asset ID to delete
277
+ -n, --name=<value> Asset name to delete
237
278
 
238
279
  GLOBAL FLAGS
239
280
  --json Format output as json.
240
281
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
241
282
 
242
283
  DESCRIPTION
243
- Download file or directory described in resource file
284
+ Asset management
285
+
286
+ Delete an asset.
244
287
 
245
288
  EXAMPLES
246
- $ sp files download ./resource.json ./pathToDownload
289
+ $ sp assets delete --id 11111111-1111-1111-1111-111111111111
290
+
291
+ $ sp assets delete --name "dataset-v1" --force
247
292
  ```
248
293
 
249
- _See code: [src/commands/files/download.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/files/download.ts)_
294
+ _See code: [src/commands/assets/delete.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/assets/delete.ts)_
250
295
 
251
- ## `sp files upload PATH`
296
+ ## `sp assets get`
252
297
 
253
- Upload file or directory to remote storage
298
+ Asset management
254
299
 
255
300
  ```
256
301
  USAGE
257
- $ sp files upload PATH [--json] [--tty] [--filename <value>] [--maximum-concurrent <value>] [--metadata <value>]
258
- [--output <value>] [--skip-encryption] [--sync]
259
-
260
- ARGUMENTS
261
- PATH file or directory to upload
302
+ $ sp assets get [--json] [--tty] [-i <value>] [-n <value>]
262
303
 
263
304
  FLAGS
264
- --filename=<value> The name of the resulting file/directory in the storage
265
- --maximum-concurrent=<value> [default: 1] Maximum concurrent pieces to upload at once per transfer
266
- --metadata=<value> Path to a metadata file for adding fields to the resource file
267
- --output=<value> [default: resource.json] Path to save resource file that is used to access the uploaded
268
- file
269
- --skip-encryption Skip file encryption before upload
270
- --sync Sync mode: delete files in target that don't exist in source
305
+ -i, --id=<value> Asset ID to fetch
306
+ -n, --name=<value> Asset name to fetch
271
307
 
272
308
  GLOBAL FLAGS
273
309
  --json Format output as json.
274
310
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
275
311
 
276
312
  DESCRIPTION
277
- Upload file or directory to remote storage
278
-
279
- EXAMPLES
280
- $ sp files upload ./file.txt
281
- ```
282
-
283
- _See code: [src/commands/files/upload.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/files/upload.ts)_
284
-
285
- ## `sp help [COMMAND]`
313
+ Asset management
286
314
 
287
- Display help for sp.
288
-
289
- ```
290
- USAGE
291
- $ sp help [COMMAND...] [-n]
292
-
293
- ARGUMENTS
294
- [COMMAND...] Command to show help for.
315
+ Get information about an asset.
295
316
 
296
- FLAGS
297
- -n, --nested-commands Include all nested commands in the output.
317
+ EXAMPLES
318
+ $ sp assets get --id 11111111-1111-1111-1111-111111111111
298
319
 
299
- DESCRIPTION
300
- Display help for sp.
320
+ $ sp assets get --name "dataset-v1"
301
321
  ```
302
322
 
303
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
323
+ _See code: [src/commands/assets/get.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/assets/get.ts)_
304
324
 
305
- ## `sp login`
325
+ ## `sp assets list`
306
326
 
307
- Login to SuperProtocol (sign up or sign in).
327
+ Asset management
308
328
 
309
329
  ```
310
330
  USAGE
311
- $ sp login [--json] [--tty] [--name <value>] [--privateKey <value>] [-y]
312
-
313
- FLAGS
314
- -y, --yes Skip questions (generate keys when needed).
315
- --name=<value> Account readable name
316
- --privateKey=<value> Account private key used for authentication
331
+ $ sp assets list [--json] [--tty]
317
332
 
318
333
  GLOBAL FLAGS
319
334
  --json Format output as json.
320
335
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
321
336
 
322
337
  DESCRIPTION
323
- Login to SuperProtocol (sign up or sign in).
338
+ Asset management
324
339
 
325
- ALIASES
326
- $ sp login
340
+ List assets for the current user.
327
341
 
328
342
  EXAMPLES
329
- $ sp login
343
+ $ sp assets list
330
344
  ```
331
345
 
332
- ## `sp storage create`
346
+ _See code: [src/commands/assets/list.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/assets/list.ts)_
347
+
348
+ ## `sp assets update`
333
349
 
334
- Create a new storage entry from file or interactive prompts.
350
+ Asset management
335
351
 
336
352
  ```
337
353
  USAGE
338
- $ sp storage create [--json] [--tty] [-f <value>] [--notDefault]
354
+ $ sp assets update [--json] [--tty] [-f <value>] [-i <value>] [-n <value>] [--newName <value>] [-t
355
+ data|image|output] [-s storj|s3|dockerhub|github|google-docs] [--tag <value>] [--hash <value>] [--size <value>]
356
+ [--storjBucket <value>] [--storjPath <value>] [--storjToken <value>] [--s3Bucket <value>] [--s3Path <value>]
357
+ [--s3AccessKey <value>] [--s3SecretKey <value>] [--s3Region <value>] [--s3Endpoint <value>] [--dockerImage <value>]
358
+ [--dockerRegistry <value>] [--dockerUsername <value>] [--dockerPassword <value>] [--githubRepo <value>]
359
+ [--githubToken <value>] [--githubBranch <value>] [--gdocsDocumentId <value>] [--gdocsApiKey <value>]
360
+ [--gdocsServiceAccountJson <value>]
339
361
 
340
362
  FLAGS
341
- -f, --fromFile=<value> Path to a JSON file that contains AddStorageDto payload.
342
- --notDefault Skip setting the created storage as default.
363
+ -f, --fromFile=<value> Path to a JSON file that contains asset update definition.
364
+ -i, --id=<value> Asset ID to update
365
+ -n, --name=<value> Asset name to update
366
+ -s, --sourceType=<option> New source type
367
+ <options: storj|s3|dockerhub|github|google-docs>
368
+ -t, --type=<option> New asset type
369
+ <options: data|image|output>
370
+ --dockerImage=<value> Docker image
371
+ --dockerPassword=<value> Docker password
372
+ --dockerRegistry=<value> Docker registry
373
+ --dockerUsername=<value> Docker username
374
+ --gdocsApiKey=<value> Google Docs API key
375
+ --gdocsDocumentId=<value> Google Docs document ID
376
+ --gdocsServiceAccountJson=<value> Google Docs service account JSON
377
+ --githubBranch=<value> GitHub branch
378
+ --githubRepo=<value> GitHub repo (org/repo)
379
+ --githubToken=<value> GitHub token
380
+ --hash=<value> New asset hash
381
+ --newName=<value> New asset name
382
+ --s3AccessKey=<value> S3 access key
383
+ --s3Bucket=<value> S3 bucket
384
+ --s3Endpoint=<value> S3 endpoint
385
+ --s3Path=<value> S3 path
386
+ --s3Region=<value> S3 region
387
+ --s3SecretKey=<value> S3 secret key
388
+ --size=<value> New asset size in bytes
389
+ --storjBucket=<value> Storj bucket
390
+ --storjPath=<value> Storj path
391
+ --storjToken=<value> Storj access token
392
+ --tag=<value> New asset tag
343
393
 
344
394
  GLOBAL FLAGS
345
395
  --json Format output as json.
346
396
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
347
397
 
348
398
  DESCRIPTION
349
- Create a new storage entry from file or interactive prompts.
399
+ Asset management
400
+
401
+ Update an existing asset.
350
402
 
351
403
  EXAMPLES
352
- $ sp storage create
404
+ $ sp assets update --id 11111111-1111-1111-1111-111111111111 --fromFile ./asset-update.json
405
+
406
+ $ sp assets update --name "dataset-v1"
353
407
 
354
- $ sp storage create --fromFile ./storage.json
408
+ $ sp assets update --id 11111111-1111-1111-1111-111111111111 --newName "dataset-v2"
355
409
 
356
- $ sp storage create --not-default
410
+ $ sp assets update --id 11111111-1111-1111-1111-111111111111 --sourceType s3 --s3Bucket b --s3Path p --s3AccessKey a --s3SecretKey s --s3Region us-east-1
357
411
  ```
358
412
 
359
- _See code: [src/commands/storage/create.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/create.ts)_
413
+ _See code: [src/commands/assets/update.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.10-beta/src/commands/assets/update.ts)_
360
414
 
361
- ## `sp storage select`
415
+ ## `sp autocomplete [SHELL]`
362
416
 
363
- Select a storage that will be used by subsequent commands.
417
+ Display autocomplete installation instructions.
364
418
 
365
419
  ```
366
420
  USAGE
367
- $ sp storage select [--json] [--tty]
421
+ $ sp autocomplete [SHELL] [-r]
368
422
 
369
- GLOBAL FLAGS
370
- --json Format output as json.
371
- --[no-]tty Force or disable interactive mode (use --no-tty to disable).
423
+ ARGUMENTS
424
+ [SHELL] (zsh|bash|powershell) Shell type
425
+
426
+ FLAGS
427
+ -r, --refresh-cache Refresh cache (ignores displaying instructions)
372
428
 
373
429
  DESCRIPTION
374
- Select a storage that will be used by subsequent commands.
430
+ Display autocomplete installation instructions.
375
431
 
376
432
  EXAMPLES
377
- $ sp storage select
378
- ```
379
-
380
- _See code: [src/commands/storage/select.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/select.ts)_
381
-
382
- ## `sp storage show`
383
-
384
- Show current selected storage
433
+ $ sp autocomplete
385
434
 
386
- ```
387
- USAGE
388
- $ sp storage show [--json] [--tty]
435
+ $ sp autocomplete bash
389
436
 
390
- GLOBAL FLAGS
391
- --json Format output as json.
392
- --[no-]tty Force or disable interactive mode (use --no-tty to disable).
437
+ $ sp autocomplete zsh
393
438
 
394
- DESCRIPTION
395
- Show current selected storage
439
+ $ sp autocomplete powershell
396
440
 
397
- EXAMPLES
398
- $ sp storage show
441
+ $ sp autocomplete --refresh-cache
399
442
  ```
400
443
 
401
- _See code: [src/commands/storage/show.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/show.ts)_
444
+ _See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.39/src/commands/autocomplete/index.ts)_
402
445
 
403
- ## `sp storage update`
446
+ ## `sp help [COMMAND]`
404
447
 
405
- Update the configuration of an existing storage.
448
+ Display help for sp.
406
449
 
407
450
  ```
408
451
  USAGE
409
- $ sp storage update [--json] [--tty] [-f <value>] [-i <value>]
452
+ $ sp help [COMMAND...] [-n]
410
453
 
411
- FLAGS
412
- -f, --fromFile=<value> Path to a JSON file that contains UpdateStorageDto payload.
413
- -i, --id=<value> Storage ID to update
454
+ ARGUMENTS
455
+ [COMMAND...] Command to show help for.
414
456
 
415
- GLOBAL FLAGS
416
- --json Format output as json.
417
- --[no-]tty Force or disable interactive mode (use --no-tty to disable).
457
+ FLAGS
458
+ -n, --nested-commands Include all nested commands in the output.
418
459
 
419
460
  DESCRIPTION
420
- Update the configuration of an existing storage.
421
-
422
- EXAMPLES
423
- $ sp storage update --id=2de3e3a4-0000-1111-2222-333344445555 --fromFile ./storage-update.json
424
-
425
- $ sp storage update --id=2de3e3a4-0000-1111-2222-333344445555
461
+ Display help for sp.
426
462
  ```
427
463
 
428
- _See code: [src/commands/storage/update.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/update.ts)_
464
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
429
465
 
430
- ## `sp workflows extend-lease ORDERID`
466
+ ## `sp login`
431
467
 
432
- Replenish deposit for a workflow to extend its lease time
468
+ Login and account creation for SuperProtocol
433
469
 
434
470
  ```
435
471
  USAGE
436
- $ sp workflows extend-lease ORDERID [--json] [--tty] [--minutes <value>] [--sppi <value>] [-y]
437
-
438
- ARGUMENTS
439
- ORDERID Order ID
472
+ $ sp login [--json] [--tty] [--name <value>] [--privateKey <value>] [--path <value>] [-y]
440
473
 
441
474
  FLAGS
442
- -y, --yes Skip confirmation prompt
443
- --minutes=<value> Time to extend order in minutes (automatically calculates tokens)
444
- --sppi=<value> SPPI token amount to add to the order
475
+ -y, --yes Skip questions (generate keys when needed).
476
+ --name=<value> Account readable name
477
+ --path=<value> Path to account(configuration) file to import
478
+ --privateKey=<value> Account private key used for authentication
445
479
 
446
480
  GLOBAL FLAGS
447
481
  --json Format output as json.
448
482
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
449
483
 
450
484
  DESCRIPTION
451
- Replenish deposit for a workflow to extend its lease time
485
+ Login and account creation for SuperProtocol
452
486
 
453
- EXAMPLES
454
- $ sp workflows extend-lease <orderId> --sppi 1.5
487
+ Login to SuperProtocol (sign up or sign in).
455
488
 
456
- $ sp workflows extend-lease <orderId> --minutes 120
489
+ ALIASES
490
+ $ sp login
457
491
 
458
- $ sp workflows extend-lease <orderId> --sppi 2 --yes
492
+ EXAMPLES
493
+ $ sp login
459
494
  ```
460
-
461
- _See code: [src/commands/workflows/extend-lease.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/workflows/extend-lease.ts)_
462
495
  <!-- commandsstop -->
@@ -2,14 +2,13 @@ import type { Command } from '@oclif/core';
2
2
  import type { AccountManager } from '../../managers/index.js';
3
3
  import { type SelectOptions } from '../../utils/prompt.service.js';
4
4
  import { BaseCommand } from '../base.js';
5
- type ProviderInitOptions = {
5
+ type AccountInitOptions = {
6
6
  assumeYes?: boolean;
7
- enableAuth?: boolean;
8
- enableCookies?: boolean;
9
7
  rebuild?: boolean;
10
8
  };
11
9
  export declare abstract class BaseAccountCommand<T extends typeof Command> extends BaseCommand<T> {
12
- protected initAccountContext(providerOptions?: ProviderInitOptions): Promise<void>;
10
+ static summary: string;
11
+ protected initAccountContext(accountOptions?: AccountInitOptions): Promise<void>;
13
12
  interactWithUser(accountManager: AccountManager): Promise<{
14
13
  address: string;
15
14
  privateKey: string;
@@ -1,29 +1,32 @@
1
1
  import { promptService } from '../../utils/prompt.service.js';
2
2
  import { BaseCommand } from '../base.js';
3
3
  export class BaseAccountCommand extends BaseCommand {
4
- async initAccountContext(providerOptions = {}) {
5
- const rebuild = Boolean(providerOptions.rebuild);
6
- const { accountManager } = await this.container.initAccountManager(rebuild).build();
4
+ static summary = 'Account management';
5
+ async initAccountContext(accountOptions = {}) {
6
+ const rebuild = Boolean(accountOptions.rebuild);
7
+ const { accountManager } = await this.container
8
+ .initConfigFileManager(rebuild)
9
+ .initAccountManager(rebuild)
10
+ .build();
7
11
  if (!(await accountManager.hasAccount())) {
8
- await (providerOptions.assumeYes
12
+ await (accountOptions.assumeYes
9
13
  ? accountManager.create()
10
14
  : this.interactWithUser(accountManager));
11
15
  }
12
- const { assumeYes: _assumeYes, rebuild: _rebuild, ...initOptions } = providerOptions;
13
- await this.container.initProviderClient({ ...initOptions, rebuild }).build();
14
16
  }
15
17
  async interactWithUser(accountManager) {
16
18
  this.warn("Account doesn't exist in current configuration");
17
19
  const ask = await promptService.confirm({
18
- message: 'Do you want to create a new account?',
20
+ message: 'Do you already have an account?',
19
21
  });
20
- if (ask) {
22
+ if (!ask) {
21
23
  const account = await accountManager.create();
22
24
  this.log('Generated new keyPair for new account.');
23
25
  return account;
24
26
  }
25
27
  const privateKeyInput = await promptService.password({
26
- message: 'Please input your privateKey for using in account',
28
+ message: 'Please input your privateKey',
29
+ validate: (value) => value?.trim(),
27
30
  });
28
31
  const privateKey = privateKeyInput.trim();
29
32
  try {