@super-protocol/sp-cli 0.0.9 → 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 (90) hide show
  1. package/README.md +191 -163
  2. package/dist/commands/account/base.d.ts +3 -4
  3. package/dist/commands/account/base.js +8 -6
  4. package/dist/commands/account/forget.js +3 -3
  5. package/dist/commands/account/get-sppi.js +7 -11
  6. package/dist/commands/account/info.d.ts +1 -13
  7. package/dist/commands/account/info.js +20 -40
  8. package/dist/commands/account/list.js +6 -6
  9. package/dist/commands/account/login.d.ts +6 -5
  10. package/dist/commands/account/login.js +96 -145
  11. package/dist/commands/account/switch.js +2 -2
  12. package/dist/commands/assets/base.d.ts +39 -0
  13. package/dist/commands/assets/base.js +217 -0
  14. package/dist/commands/assets/create.d.ts +41 -0
  15. package/dist/commands/assets/create.js +277 -0
  16. package/dist/commands/assets/delete.d.ts +14 -0
  17. package/dist/commands/assets/delete.js +69 -0
  18. package/dist/commands/assets/get.d.ts +14 -0
  19. package/dist/commands/assets/get.js +79 -0
  20. package/dist/commands/assets/list.d.ts +7 -0
  21. package/dist/commands/assets/list.js +33 -0
  22. package/dist/commands/assets/update.d.ts +44 -0
  23. package/dist/commands/assets/update.js +321 -0
  24. package/dist/commands/base.d.ts +1 -0
  25. package/dist/commands/base.js +5 -0
  26. package/dist/config/config.schema.d.ts +2 -11
  27. package/dist/config/config.schema.js +2 -7
  28. package/dist/constants.d.ts +3 -3
  29. package/dist/constants.js +3 -3
  30. package/dist/errors.d.ts +0 -2
  31. package/dist/errors.js +0 -2
  32. package/dist/hooks/prerun/auth.js +3 -8
  33. package/dist/interfaces/config-manager.interface.d.ts +3 -1
  34. package/dist/lib/container.d.ts +4 -12
  35. package/dist/lib/container.js +28 -113
  36. package/dist/lib/swarm-client/fetch-api.d.ts +7 -0
  37. package/dist/lib/swarm-client/fetch-api.js +41 -0
  38. package/dist/lib/swarm-client/fetch-timeout.client.d.ts +1 -0
  39. package/dist/lib/swarm-client/fetch-timeout.client.js +32 -0
  40. package/dist/lib/swarm-client/index.d.ts +6 -0
  41. package/dist/lib/swarm-client/index.js +31 -0
  42. package/dist/lib/swarm-client/middlewares/authorization.middleware.d.ts +2 -0
  43. package/dist/lib/swarm-client/middlewares/authorization.middleware.js +12 -0
  44. package/dist/lib/swarm-client/middlewares/index.d.ts +6 -0
  45. package/dist/lib/swarm-client/middlewares/index.js +5 -0
  46. package/dist/lib/swarm-client/middlewares/logger.middleware.d.ts +2 -0
  47. package/dist/lib/swarm-client/middlewares/logger.middleware.js +30 -0
  48. package/dist/lib/swarm-client/middlewares/request-id.middleware.d.ts +2 -0
  49. package/dist/lib/swarm-client/middlewares/request-id.middleware.js +13 -0
  50. package/dist/lib/swarm-client/types.d.ts +23 -0
  51. package/dist/lib/swarm-client/types.js +1 -0
  52. package/dist/managers/account-manager.d.ts +1 -0
  53. package/dist/managers/account-manager.js +13 -18
  54. package/dist/managers/config-file-manager.d.ts +22 -9
  55. package/dist/managers/config-file-manager.js +247 -122
  56. package/dist/managers/config-manager.d.ts +6 -6
  57. package/dist/managers/config-manager.js +8 -8
  58. package/dist/services/account.service.d.ts +42 -0
  59. package/dist/services/account.service.js +140 -0
  60. package/dist/services/asset.service.d.ts +35 -0
  61. package/dist/services/asset.service.js +120 -0
  62. package/dist/services/auth.service.d.ts +4 -6
  63. package/dist/services/auth.service.js +108 -118
  64. package/dist/utils/helper.js +2 -2
  65. package/oclif.manifest.json +462 -212
  66. package/package.json +7 -8
  67. package/dist/commands/files/download.d.ts +0 -15
  68. package/dist/commands/files/download.js +0 -63
  69. package/dist/commands/files/upload.d.ts +0 -18
  70. package/dist/commands/files/upload.js +0 -83
  71. package/dist/commands/storage/base.d.ts +0 -13
  72. package/dist/commands/storage/base.js +0 -125
  73. package/dist/commands/storage/create.d.ts +0 -11
  74. package/dist/commands/storage/create.js +0 -53
  75. package/dist/commands/storage/select.d.ts +0 -9
  76. package/dist/commands/storage/select.js +0 -38
  77. package/dist/commands/storage/show.d.ts +0 -17
  78. package/dist/commands/storage/show.js +0 -34
  79. package/dist/commands/storage/update.d.ts +0 -14
  80. package/dist/commands/storage/update.js +0 -204
  81. package/dist/commands/workflows/extend-lease.d.ts +0 -17
  82. package/dist/commands/workflows/extend-lease.js +0 -102
  83. package/dist/hooks/finally/shutdown-blockchain.d.ts +0 -3
  84. package/dist/hooks/finally/shutdown-blockchain.js +0 -8
  85. package/dist/middlewares/auth-middleware.d.ts +0 -9
  86. package/dist/middlewares/auth-middleware.js +0 -91
  87. package/dist/middlewares/cookies-middleware.d.ts +0 -8
  88. package/dist/middlewares/cookies-middleware.js +0 -80
  89. package/dist/services/storage.service.d.ts +0 -73
  90. 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.9 linux-x64 node-v22.22.0
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,20 +36,18 @@ 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
@@ -64,6 +62,8 @@ GLOBAL FLAGS
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.9/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.9/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.9/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,11 +141,11 @@ 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.9/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
@@ -158,6 +162,8 @@ GLOBAL FLAGS
158
162
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
159
163
 
160
164
  DESCRIPTION
165
+ Login and account creation for SuperProtocol
166
+
161
167
  Login to SuperProtocol (sign up or sign in).
162
168
 
163
169
  ALIASES
@@ -167,11 +173,11 @@ EXAMPLES
167
173
  $ sp account login
168
174
  ```
169
175
 
170
- _See code: [src/commands/account/login.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/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)_
171
177
 
172
178
  ## `sp account switch`
173
179
 
174
- Switch to a different account
180
+ Account management
175
181
 
176
182
  ```
177
183
  USAGE
@@ -185,283 +191,305 @@ GLOBAL FLAGS
185
191
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
186
192
 
187
193
  DESCRIPTION
194
+ Account management
195
+
188
196
  Switch to a different account
189
197
 
190
198
  EXAMPLES
191
199
  $ sp account switch
192
200
  ```
193
201
 
194
- _See code: [src/commands/account/switch.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/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)_
195
203
 
196
- ## `sp autocomplete [SHELL]`
204
+ ## `sp assets create`
197
205
 
198
- Display autocomplete installation instructions.
206
+ Asset management
199
207
 
200
208
  ```
201
209
  USAGE
202
- $ sp autocomplete [SHELL] [-r]
203
-
204
- ARGUMENTS
205
- [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>]
206
216
 
207
217
  FLAGS
208
- -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
209
246
 
210
- DESCRIPTION
211
- 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).
212
250
 
213
- EXAMPLES
214
- $ sp autocomplete
251
+ DESCRIPTION
252
+ Asset management
215
253
 
216
- $ sp autocomplete bash
254
+ Create a new asset.
217
255
 
218
- $ sp autocomplete zsh
256
+ EXAMPLES
257
+ $ sp assets create
219
258
 
220
- $ sp autocomplete powershell
259
+ $ sp assets create --fromFile ./asset.json
221
260
 
222
- $ 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
223
262
  ```
224
263
 
225
- _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)_
226
265
 
227
- ## `sp files download RESOURCEFILE LOCALDIRECTORY`
266
+ ## `sp assets delete`
228
267
 
229
- Download file or directory described in resource file
268
+ Asset management
230
269
 
231
270
  ```
232
271
  USAGE
233
- $ sp files download RESOURCEFILE LOCALDIRECTORY [--json] [--tty] [--maximum-concurrent <value>]
234
-
235
- ARGUMENTS
236
- RESOURCEFILE Path to a resource file
237
- LOCALDIRECTORY Path to save downloaded file
272
+ $ sp assets delete [--json] [--tty] [-f] [-i <value>] [-n <value>]
238
273
 
239
274
  FLAGS
240
- --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
241
278
 
242
279
  GLOBAL FLAGS
243
280
  --json Format output as json.
244
281
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
245
282
 
246
283
  DESCRIPTION
247
- Download file or directory described in resource file
284
+ Asset management
285
+
286
+ Delete an asset.
248
287
 
249
288
  EXAMPLES
250
- $ 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
251
292
  ```
252
293
 
253
- _See code: [src/commands/files/download.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/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)_
254
295
 
255
- ## `sp files upload PATH`
296
+ ## `sp assets get`
256
297
 
257
- Upload file or directory to remote storage
298
+ Asset management
258
299
 
259
300
  ```
260
301
  USAGE
261
- $ sp files upload PATH [--json] [--tty] [--filename <value>] [--maximum-concurrent <value>] [--metadata <value>]
262
- [--output <value>] [--skip-encryption] [--sync]
263
-
264
- ARGUMENTS
265
- PATH file or directory to upload
302
+ $ sp assets get [--json] [--tty] [-i <value>] [-n <value>]
266
303
 
267
304
  FLAGS
268
- --filename=<value> The name of the resulting file/directory in the storage
269
- --maximum-concurrent=<value> [default: 1] Maximum concurrent pieces to upload at once per transfer
270
- --metadata=<value> Path to a metadata file for adding fields to the resource file
271
- --output=<value> [default: resource.json] Path to save resource file that is used to access the uploaded
272
- file
273
- --skip-encryption Skip file encryption before upload
274
- --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
275
307
 
276
308
  GLOBAL FLAGS
277
309
  --json Format output as json.
278
310
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
279
311
 
280
312
  DESCRIPTION
281
- Upload file or directory to remote storage
313
+ Asset management
282
314
 
283
- EXAMPLES
284
- $ sp files upload ./file.txt
285
- ```
286
-
287
- _See code: [src/commands/files/upload.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/src/commands/files/upload.ts)_
288
-
289
- ## `sp help [COMMAND]`
290
-
291
- Display help for sp.
292
-
293
- ```
294
- USAGE
295
- $ sp help [COMMAND...] [-n]
296
-
297
- ARGUMENTS
298
- [COMMAND...] Command to show help for.
315
+ Get information about an asset.
299
316
 
300
- FLAGS
301
- -n, --nested-commands Include all nested commands in the output.
317
+ EXAMPLES
318
+ $ sp assets get --id 11111111-1111-1111-1111-111111111111
302
319
 
303
- DESCRIPTION
304
- Display help for sp.
320
+ $ sp assets get --name "dataset-v1"
305
321
  ```
306
322
 
307
- _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)_
308
324
 
309
- ## `sp login`
325
+ ## `sp assets list`
310
326
 
311
- Login to SuperProtocol (sign up or sign in).
327
+ Asset management
312
328
 
313
329
  ```
314
330
  USAGE
315
- $ sp login [--json] [--tty] [--name <value>] [--privateKey <value>] [--path <value>] [-y]
316
-
317
- FLAGS
318
- -y, --yes Skip questions (generate keys when needed).
319
- --name=<value> Account readable name
320
- --path=<value> Path to account(configuration) file to import
321
- --privateKey=<value> Account private key used for authentication
331
+ $ sp assets list [--json] [--tty]
322
332
 
323
333
  GLOBAL FLAGS
324
334
  --json Format output as json.
325
335
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
326
336
 
327
337
  DESCRIPTION
328
- Login to SuperProtocol (sign up or sign in).
338
+ Asset management
329
339
 
330
- ALIASES
331
- $ sp login
340
+ List assets for the current user.
332
341
 
333
342
  EXAMPLES
334
- $ sp login
343
+ $ sp assets list
335
344
  ```
336
345
 
337
- ## `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)_
338
347
 
339
- Create a new storage entry from file or interactive prompts.
348
+ ## `sp assets update`
349
+
350
+ Asset management
340
351
 
341
352
  ```
342
353
  USAGE
343
- $ 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>]
344
361
 
345
362
  FLAGS
346
- -f, --fromFile=<value> Path to a JSON file that contains AddStorageDto payload.
347
- --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
348
393
 
349
394
  GLOBAL FLAGS
350
395
  --json Format output as json.
351
396
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
352
397
 
353
398
  DESCRIPTION
354
- Create a new storage entry from file or interactive prompts.
399
+ Asset management
400
+
401
+ Update an existing asset.
355
402
 
356
403
  EXAMPLES
357
- $ sp storage create
404
+ $ sp assets update --id 11111111-1111-1111-1111-111111111111 --fromFile ./asset-update.json
358
405
 
359
- $ sp storage create --fromFile ./storage.json
406
+ $ sp assets update --name "dataset-v1"
360
407
 
361
- $ sp storage create --not-default
408
+ $ sp assets update --id 11111111-1111-1111-1111-111111111111 --newName "dataset-v2"
409
+
410
+ $ sp assets update --id 11111111-1111-1111-1111-111111111111 --sourceType s3 --s3Bucket b --s3Path p --s3AccessKey a --s3SecretKey s --s3Region us-east-1
362
411
  ```
363
412
 
364
- _See code: [src/commands/storage/create.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/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)_
365
414
 
366
- ## `sp storage select`
415
+ ## `sp autocomplete [SHELL]`
367
416
 
368
- Select a storage that will be used by subsequent commands.
417
+ Display autocomplete installation instructions.
369
418
 
370
419
  ```
371
420
  USAGE
372
- $ sp storage select [--json] [--tty]
421
+ $ sp autocomplete [SHELL] [-r]
373
422
 
374
- GLOBAL FLAGS
375
- --json Format output as json.
376
- --[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)
377
428
 
378
429
  DESCRIPTION
379
- Select a storage that will be used by subsequent commands.
430
+ Display autocomplete installation instructions.
380
431
 
381
432
  EXAMPLES
382
- $ sp storage select
383
- ```
384
-
385
- _See code: [src/commands/storage/select.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/src/commands/storage/select.ts)_
386
-
387
- ## `sp storage show`
388
-
389
- Show current selected storage
433
+ $ sp autocomplete
390
434
 
391
- ```
392
- USAGE
393
- $ sp storage show [--json] [--tty]
435
+ $ sp autocomplete bash
394
436
 
395
- GLOBAL FLAGS
396
- --json Format output as json.
397
- --[no-]tty Force or disable interactive mode (use --no-tty to disable).
437
+ $ sp autocomplete zsh
398
438
 
399
- DESCRIPTION
400
- Show current selected storage
439
+ $ sp autocomplete powershell
401
440
 
402
- EXAMPLES
403
- $ sp storage show
441
+ $ sp autocomplete --refresh-cache
404
442
  ```
405
443
 
406
- _See code: [src/commands/storage/show.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/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)_
407
445
 
408
- ## `sp storage update`
446
+ ## `sp help [COMMAND]`
409
447
 
410
- Update the configuration of an existing storage.
448
+ Display help for sp.
411
449
 
412
450
  ```
413
451
  USAGE
414
- $ sp storage update [--json] [--tty] [-f <value>] [-i <value>]
452
+ $ sp help [COMMAND...] [-n]
415
453
 
416
- FLAGS
417
- -f, --fromFile=<value> Path to a JSON file that contains UpdateStorageDto payload.
418
- -i, --id=<value> Storage ID to update
454
+ ARGUMENTS
455
+ [COMMAND...] Command to show help for.
419
456
 
420
- GLOBAL FLAGS
421
- --json Format output as json.
422
- --[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.
423
459
 
424
460
  DESCRIPTION
425
- Update the configuration of an existing storage.
426
-
427
- EXAMPLES
428
- $ sp storage update --id=2de3e3a4-0000-1111-2222-333344445555 --fromFile ./storage-update.json
429
-
430
- $ sp storage update --id=2de3e3a4-0000-1111-2222-333344445555
461
+ Display help for sp.
431
462
  ```
432
463
 
433
- _See code: [src/commands/storage/update.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/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)_
434
465
 
435
- ## `sp workflows extend-lease ORDERID`
466
+ ## `sp login`
436
467
 
437
- Replenish deposit for a workflow to extend its lease time
468
+ Login and account creation for SuperProtocol
438
469
 
439
470
  ```
440
471
  USAGE
441
- $ sp workflows extend-lease ORDERID [--json] [--tty] [--minutes <value>] [--sppi <value>] [-y]
442
-
443
- ARGUMENTS
444
- ORDERID Order ID
472
+ $ sp login [--json] [--tty] [--name <value>] [--privateKey <value>] [--path <value>] [-y]
445
473
 
446
474
  FLAGS
447
- -y, --yes Skip confirmation prompt
448
- --minutes=<value> Time to extend order in minutes (automatically calculates tokens)
449
- --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
450
479
 
451
480
  GLOBAL FLAGS
452
481
  --json Format output as json.
453
482
  --[no-]tty Force or disable interactive mode (use --no-tty to disable).
454
483
 
455
484
  DESCRIPTION
456
- Replenish deposit for a workflow to extend its lease time
485
+ Login and account creation for SuperProtocol
457
486
 
458
- EXAMPLES
459
- $ sp workflows extend-lease <orderId> --sppi 1.5
487
+ Login to SuperProtocol (sign up or sign in).
460
488
 
461
- $ sp workflows extend-lease <orderId> --minutes 120
489
+ ALIASES
490
+ $ sp login
462
491
 
463
- $ sp workflows extend-lease <orderId> --sppi 2 --yes
492
+ EXAMPLES
493
+ $ sp login
464
494
  ```
465
-
466
- _See code: [src/commands/workflows/extend-lease.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.9/src/commands/workflows/extend-lease.ts)_
467
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,16 +1,18 @@
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");
@@ -30,7 +30,7 @@ export default class AccountForget extends BaseAccountCommand {
30
30
  }
31
31
  async run() {
32
32
  const { force, name } = this.flags;
33
- const configs = this.configFileManager.getConfigsWithNames();
33
+ const configs = await this.configFileManager.getConfigsWithNames();
34
34
  if (configs.length === 0) {
35
35
  this.error('Not found any account', { exit: 1 });
36
36
  }
@@ -71,7 +71,7 @@ export default class AccountForget extends BaseAccountCommand {
71
71
  this.log(`Successfully forgot account: ${displayName}`);
72
72
  const newCurrent = this.configFileManager.getCurrentConfigFile();
73
73
  if (newCurrent) {
74
- const configsAfter = this.configFileManager.getConfigsWithNames();
74
+ const configsAfter = await this.configFileManager.getConfigsWithNames();
75
75
  const newCurrentConfig = configsAfter.find((c) => c.file === newCurrent);
76
76
  this.log(`Current account is now: ${newCurrentConfig?.name || newCurrent}`);
77
77
  }
@@ -87,7 +87,7 @@ export default class AccountForget extends BaseAccountCommand {
87
87
  }
88
88
  async updateNameFlagOptions() {
89
89
  const { configFileManager } = await AppContainer.container.initConfigFileManager().build();
90
- const configs = configFileManager.getConfigsWithNames();
90
+ const configs = await configFileManager.getConfigsWithNames();
91
91
  const options = configs.map((config) => config.name);
92
92
  this.constructor.flags.name = Flags.option({
93
93
  char: 'n',