@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.
- package/README.md +191 -163
- package/dist/commands/account/base.d.ts +3 -4
- package/dist/commands/account/base.js +8 -6
- package/dist/commands/account/forget.js +3 -3
- package/dist/commands/account/get-sppi.js +7 -11
- package/dist/commands/account/info.d.ts +1 -13
- package/dist/commands/account/info.js +20 -40
- package/dist/commands/account/list.js +6 -6
- package/dist/commands/account/login.d.ts +6 -5
- package/dist/commands/account/login.js +96 -145
- package/dist/commands/account/switch.js +2 -2
- package/dist/commands/assets/base.d.ts +39 -0
- package/dist/commands/assets/base.js +217 -0
- package/dist/commands/assets/create.d.ts +41 -0
- package/dist/commands/assets/create.js +277 -0
- package/dist/commands/assets/delete.d.ts +14 -0
- package/dist/commands/assets/delete.js +69 -0
- package/dist/commands/assets/get.d.ts +14 -0
- package/dist/commands/assets/get.js +79 -0
- package/dist/commands/assets/list.d.ts +7 -0
- package/dist/commands/assets/list.js +33 -0
- package/dist/commands/assets/update.d.ts +44 -0
- package/dist/commands/assets/update.js +321 -0
- package/dist/commands/base.d.ts +1 -0
- package/dist/commands/base.js +5 -0
- package/dist/config/config.schema.d.ts +2 -11
- package/dist/config/config.schema.js +2 -7
- package/dist/constants.d.ts +3 -3
- package/dist/constants.js +3 -3
- package/dist/errors.d.ts +0 -2
- package/dist/errors.js +0 -2
- package/dist/hooks/prerun/auth.js +3 -8
- package/dist/interfaces/config-manager.interface.d.ts +3 -1
- package/dist/lib/container.d.ts +4 -12
- package/dist/lib/container.js +28 -113
- package/dist/lib/swarm-client/fetch-api.d.ts +7 -0
- package/dist/lib/swarm-client/fetch-api.js +41 -0
- package/dist/lib/swarm-client/fetch-timeout.client.d.ts +1 -0
- package/dist/lib/swarm-client/fetch-timeout.client.js +32 -0
- package/dist/lib/swarm-client/index.d.ts +6 -0
- package/dist/lib/swarm-client/index.js +31 -0
- package/dist/lib/swarm-client/middlewares/authorization.middleware.d.ts +2 -0
- package/dist/lib/swarm-client/middlewares/authorization.middleware.js +12 -0
- package/dist/lib/swarm-client/middlewares/index.d.ts +6 -0
- package/dist/lib/swarm-client/middlewares/index.js +5 -0
- package/dist/lib/swarm-client/middlewares/logger.middleware.d.ts +2 -0
- package/dist/lib/swarm-client/middlewares/logger.middleware.js +30 -0
- package/dist/lib/swarm-client/middlewares/request-id.middleware.d.ts +2 -0
- package/dist/lib/swarm-client/middlewares/request-id.middleware.js +13 -0
- package/dist/lib/swarm-client/types.d.ts +23 -0
- package/dist/lib/swarm-client/types.js +1 -0
- package/dist/managers/account-manager.d.ts +1 -0
- package/dist/managers/account-manager.js +13 -18
- package/dist/managers/config-file-manager.d.ts +22 -9
- package/dist/managers/config-file-manager.js +247 -122
- package/dist/managers/config-manager.d.ts +6 -6
- package/dist/managers/config-manager.js +8 -8
- package/dist/services/account.service.d.ts +42 -0
- package/dist/services/account.service.js +140 -0
- package/dist/services/asset.service.d.ts +35 -0
- package/dist/services/asset.service.js +120 -0
- package/dist/services/auth.service.d.ts +4 -6
- package/dist/services/auth.service.js +108 -118
- package/dist/utils/helper.js +2 -2
- package/oclif.manifest.json +462 -212
- package/package.json +7 -8
- package/dist/commands/files/download.d.ts +0 -15
- package/dist/commands/files/download.js +0 -63
- package/dist/commands/files/upload.d.ts +0 -18
- package/dist/commands/files/upload.js +0 -83
- package/dist/commands/storage/base.d.ts +0 -13
- package/dist/commands/storage/base.js +0 -125
- package/dist/commands/storage/create.d.ts +0 -11
- package/dist/commands/storage/create.js +0 -53
- package/dist/commands/storage/select.d.ts +0 -9
- package/dist/commands/storage/select.js +0 -38
- package/dist/commands/storage/show.d.ts +0 -17
- package/dist/commands/storage/show.js +0 -34
- package/dist/commands/storage/update.d.ts +0 -14
- package/dist/commands/storage/update.js +0 -204
- package/dist/commands/workflows/extend-lease.d.ts +0 -17
- package/dist/commands/workflows/extend-lease.js +0 -102
- package/dist/hooks/finally/shutdown-blockchain.d.ts +0 -3
- package/dist/hooks/finally/shutdown-blockchain.js +0 -8
- package/dist/middlewares/auth-middleware.d.ts +0 -9
- package/dist/middlewares/auth-middleware.js +0 -91
- package/dist/middlewares/cookies-middleware.d.ts +0 -8
- package/dist/middlewares/cookies-middleware.js +0 -80
- package/dist/services/storage.service.d.ts +0 -73
- 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.
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
|
204
|
+
## `sp assets create`
|
|
197
205
|
|
|
198
|
-
|
|
206
|
+
Asset management
|
|
199
207
|
|
|
200
208
|
```
|
|
201
209
|
USAGE
|
|
202
|
-
$ sp
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
211
|
-
|
|
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
|
-
|
|
214
|
-
|
|
251
|
+
DESCRIPTION
|
|
252
|
+
Asset management
|
|
215
253
|
|
|
216
|
-
|
|
254
|
+
Create a new asset.
|
|
217
255
|
|
|
218
|
-
|
|
256
|
+
EXAMPLES
|
|
257
|
+
$ sp assets create
|
|
219
258
|
|
|
220
|
-
$ sp
|
|
259
|
+
$ sp assets create --fromFile ./asset.json
|
|
221
260
|
|
|
222
|
-
$ sp
|
|
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: [
|
|
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
|
|
266
|
+
## `sp assets delete`
|
|
228
267
|
|
|
229
|
-
|
|
268
|
+
Asset management
|
|
230
269
|
|
|
231
270
|
```
|
|
232
271
|
USAGE
|
|
233
|
-
$ sp
|
|
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
|
-
|
|
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
|
-
|
|
284
|
+
Asset management
|
|
285
|
+
|
|
286
|
+
Delete an asset.
|
|
248
287
|
|
|
249
288
|
EXAMPLES
|
|
250
|
-
$ sp
|
|
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/
|
|
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
|
|
296
|
+
## `sp assets get`
|
|
256
297
|
|
|
257
|
-
|
|
298
|
+
Asset management
|
|
258
299
|
|
|
259
300
|
```
|
|
260
301
|
USAGE
|
|
261
|
-
$ sp
|
|
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
|
-
--
|
|
269
|
-
--
|
|
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
|
-
|
|
313
|
+
Asset management
|
|
282
314
|
|
|
283
|
-
|
|
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
|
-
|
|
301
|
-
|
|
317
|
+
EXAMPLES
|
|
318
|
+
$ sp assets get --id 11111111-1111-1111-1111-111111111111
|
|
302
319
|
|
|
303
|
-
|
|
304
|
-
Display help for sp.
|
|
320
|
+
$ sp assets get --name "dataset-v1"
|
|
305
321
|
```
|
|
306
322
|
|
|
307
|
-
_See code: [
|
|
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
|
|
325
|
+
## `sp assets list`
|
|
310
326
|
|
|
311
|
-
|
|
327
|
+
Asset management
|
|
312
328
|
|
|
313
329
|
```
|
|
314
330
|
USAGE
|
|
315
|
-
$ sp
|
|
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
|
-
|
|
338
|
+
Asset management
|
|
329
339
|
|
|
330
|
-
|
|
331
|
-
$ sp login
|
|
340
|
+
List assets for the current user.
|
|
332
341
|
|
|
333
342
|
EXAMPLES
|
|
334
|
-
$ sp
|
|
343
|
+
$ sp assets list
|
|
335
344
|
```
|
|
336
345
|
|
|
337
|
-
|
|
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
|
-
|
|
348
|
+
## `sp assets update`
|
|
349
|
+
|
|
350
|
+
Asset management
|
|
340
351
|
|
|
341
352
|
```
|
|
342
353
|
USAGE
|
|
343
|
-
$ sp
|
|
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>
|
|
347
|
-
|
|
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
|
-
|
|
399
|
+
Asset management
|
|
400
|
+
|
|
401
|
+
Update an existing asset.
|
|
355
402
|
|
|
356
403
|
EXAMPLES
|
|
357
|
-
$ sp
|
|
404
|
+
$ sp assets update --id 11111111-1111-1111-1111-111111111111 --fromFile ./asset-update.json
|
|
358
405
|
|
|
359
|
-
$ sp
|
|
406
|
+
$ sp assets update --name "dataset-v1"
|
|
360
407
|
|
|
361
|
-
$ sp
|
|
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/
|
|
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
|
|
415
|
+
## `sp autocomplete [SHELL]`
|
|
367
416
|
|
|
368
|
-
|
|
417
|
+
Display autocomplete installation instructions.
|
|
369
418
|
|
|
370
419
|
```
|
|
371
420
|
USAGE
|
|
372
|
-
$ sp
|
|
421
|
+
$ sp autocomplete [SHELL] [-r]
|
|
373
422
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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
|
-
|
|
430
|
+
Display autocomplete installation instructions.
|
|
380
431
|
|
|
381
432
|
EXAMPLES
|
|
382
|
-
$ sp
|
|
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
|
-
|
|
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
|
-
|
|
400
|
-
Show current selected storage
|
|
439
|
+
$ sp autocomplete powershell
|
|
401
440
|
|
|
402
|
-
|
|
403
|
-
$ sp storage show
|
|
441
|
+
$ sp autocomplete --refresh-cache
|
|
404
442
|
```
|
|
405
443
|
|
|
406
|
-
_See code: [
|
|
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
|
|
446
|
+
## `sp help [COMMAND]`
|
|
409
447
|
|
|
410
|
-
|
|
448
|
+
Display help for sp.
|
|
411
449
|
|
|
412
450
|
```
|
|
413
451
|
USAGE
|
|
414
|
-
$ sp
|
|
452
|
+
$ sp help [COMMAND...] [-n]
|
|
415
453
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
-i, --id=<value> Storage ID to update
|
|
454
|
+
ARGUMENTS
|
|
455
|
+
[COMMAND...] Command to show help for.
|
|
419
456
|
|
|
420
|
-
|
|
421
|
-
--
|
|
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
|
-
|
|
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: [
|
|
464
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
|
|
434
465
|
|
|
435
|
-
## `sp
|
|
466
|
+
## `sp login`
|
|
436
467
|
|
|
437
|
-
|
|
468
|
+
Login and account creation for SuperProtocol
|
|
438
469
|
|
|
439
470
|
```
|
|
440
471
|
USAGE
|
|
441
|
-
$ sp
|
|
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
|
|
448
|
-
--
|
|
449
|
-
--
|
|
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
|
-
|
|
485
|
+
Login and account creation for SuperProtocol
|
|
457
486
|
|
|
458
|
-
|
|
459
|
-
$ sp workflows extend-lease <orderId> --sppi 1.5
|
|
487
|
+
Login to SuperProtocol (sign up or sign in).
|
|
460
488
|
|
|
461
|
-
|
|
489
|
+
ALIASES
|
|
490
|
+
$ sp login
|
|
462
491
|
|
|
463
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
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 (
|
|
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',
|