@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.
- package/README.md +200 -167
- package/dist/commands/account/base.d.ts +3 -4
- package/dist/commands/account/base.js +12 -9
- package/dist/commands/account/forget.d.ts +1 -1
- package/dist/commands/account/forget.js +66 -17
- package/dist/commands/account/get-sppi.js +7 -11
- package/dist/commands/account/info.d.ts +1 -13
- package/dist/commands/account/info.js +25 -45
- package/dist/commands/account/list.js +6 -6
- package/dist/commands/account/login.d.ts +10 -3
- package/dist/commands/account/login.js +143 -87
- package/dist/commands/account/switch.d.ts +3 -0
- package/dist/commands/account/switch.js +31 -11
- 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 +6 -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 +5 -9
- 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 +24 -17
- package/dist/managers/config-file-manager.js +285 -161
- 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/dist/utils/progress.js +1 -0
- package/dist/utils/prompt.service.d.ts +8 -1
- package/dist/utils/prompt.service.js +33 -1
- package/oclif.manifest.json +479 -215
- 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,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
|
-
|
|
50
|
+
Account management
|
|
53
51
|
|
|
54
52
|
```
|
|
55
53
|
USAGE
|
|
56
|
-
$ sp account forget
|
|
54
|
+
$ sp account forget [--json] [--tty] [-f] [-n <value>]
|
|
57
55
|
|
|
58
56
|
FLAGS
|
|
59
|
-
-f, --force Force
|
|
60
|
-
-n, --name=<value>
|
|
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.
|
|
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,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.
|
|
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
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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
|
|
204
|
+
## `sp assets create`
|
|
193
205
|
|
|
194
|
-
|
|
206
|
+
Asset management
|
|
195
207
|
|
|
196
208
|
```
|
|
197
209
|
USAGE
|
|
198
|
-
$ sp
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
207
|
-
|
|
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
|
-
|
|
210
|
-
|
|
251
|
+
DESCRIPTION
|
|
252
|
+
Asset management
|
|
211
253
|
|
|
212
|
-
|
|
254
|
+
Create a new asset.
|
|
213
255
|
|
|
214
|
-
|
|
256
|
+
EXAMPLES
|
|
257
|
+
$ sp assets create
|
|
215
258
|
|
|
216
|
-
$ sp
|
|
259
|
+
$ sp assets create --fromFile ./asset.json
|
|
217
260
|
|
|
218
|
-
$ sp
|
|
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: [
|
|
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
|
|
266
|
+
## `sp assets delete`
|
|
224
267
|
|
|
225
|
-
|
|
268
|
+
Asset management
|
|
226
269
|
|
|
227
270
|
```
|
|
228
271
|
USAGE
|
|
229
|
-
$ sp
|
|
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
|
-
|
|
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
|
-
|
|
284
|
+
Asset management
|
|
285
|
+
|
|
286
|
+
Delete an asset.
|
|
244
287
|
|
|
245
288
|
EXAMPLES
|
|
246
|
-
$ sp
|
|
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/
|
|
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
|
|
296
|
+
## `sp assets get`
|
|
252
297
|
|
|
253
|
-
|
|
298
|
+
Asset management
|
|
254
299
|
|
|
255
300
|
```
|
|
256
301
|
USAGE
|
|
257
|
-
$ sp
|
|
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
|
-
--
|
|
265
|
-
--
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
297
|
-
|
|
317
|
+
EXAMPLES
|
|
318
|
+
$ sp assets get --id 11111111-1111-1111-1111-111111111111
|
|
298
319
|
|
|
299
|
-
|
|
300
|
-
Display help for sp.
|
|
320
|
+
$ sp assets get --name "dataset-v1"
|
|
301
321
|
```
|
|
302
322
|
|
|
303
|
-
_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)_
|
|
304
324
|
|
|
305
|
-
## `sp
|
|
325
|
+
## `sp assets list`
|
|
306
326
|
|
|
307
|
-
|
|
327
|
+
Asset management
|
|
308
328
|
|
|
309
329
|
```
|
|
310
330
|
USAGE
|
|
311
|
-
$ sp
|
|
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
|
-
|
|
338
|
+
Asset management
|
|
324
339
|
|
|
325
|
-
|
|
326
|
-
$ sp login
|
|
340
|
+
List assets for the current user.
|
|
327
341
|
|
|
328
342
|
EXAMPLES
|
|
329
|
-
$ sp
|
|
343
|
+
$ sp assets list
|
|
330
344
|
```
|
|
331
345
|
|
|
332
|
-
|
|
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
|
-
|
|
350
|
+
Asset management
|
|
335
351
|
|
|
336
352
|
```
|
|
337
353
|
USAGE
|
|
338
|
-
$ 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>]
|
|
339
361
|
|
|
340
362
|
FLAGS
|
|
341
|
-
-f, --fromFile=<value>
|
|
342
|
-
|
|
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
|
-
|
|
399
|
+
Asset management
|
|
400
|
+
|
|
401
|
+
Update an existing asset.
|
|
350
402
|
|
|
351
403
|
EXAMPLES
|
|
352
|
-
$ sp
|
|
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
|
|
408
|
+
$ sp assets update --id 11111111-1111-1111-1111-111111111111 --newName "dataset-v2"
|
|
355
409
|
|
|
356
|
-
$ sp
|
|
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/
|
|
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
|
|
415
|
+
## `sp autocomplete [SHELL]`
|
|
362
416
|
|
|
363
|
-
|
|
417
|
+
Display autocomplete installation instructions.
|
|
364
418
|
|
|
365
419
|
```
|
|
366
420
|
USAGE
|
|
367
|
-
$ sp
|
|
421
|
+
$ sp autocomplete [SHELL] [-r]
|
|
368
422
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
-
|
|
430
|
+
Display autocomplete installation instructions.
|
|
375
431
|
|
|
376
432
|
EXAMPLES
|
|
377
|
-
$ sp
|
|
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
|
-
|
|
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
|
-
|
|
395
|
-
Show current selected storage
|
|
439
|
+
$ sp autocomplete powershell
|
|
396
440
|
|
|
397
|
-
|
|
398
|
-
$ sp storage show
|
|
441
|
+
$ sp autocomplete --refresh-cache
|
|
399
442
|
```
|
|
400
443
|
|
|
401
|
-
_See code: [
|
|
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
|
|
446
|
+
## `sp help [COMMAND]`
|
|
404
447
|
|
|
405
|
-
|
|
448
|
+
Display help for sp.
|
|
406
449
|
|
|
407
450
|
```
|
|
408
451
|
USAGE
|
|
409
|
-
$ sp
|
|
452
|
+
$ sp help [COMMAND...] [-n]
|
|
410
453
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
-i, --id=<value> Storage ID to update
|
|
454
|
+
ARGUMENTS
|
|
455
|
+
[COMMAND...] Command to show help for.
|
|
414
456
|
|
|
415
|
-
|
|
416
|
-
--
|
|
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
|
-
|
|
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: [
|
|
464
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
|
|
429
465
|
|
|
430
|
-
## `sp
|
|
466
|
+
## `sp login`
|
|
431
467
|
|
|
432
|
-
|
|
468
|
+
Login and account creation for SuperProtocol
|
|
433
469
|
|
|
434
470
|
```
|
|
435
471
|
USAGE
|
|
436
|
-
$ sp
|
|
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
|
|
443
|
-
--
|
|
444
|
-
--
|
|
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
|
-
|
|
485
|
+
Login and account creation for SuperProtocol
|
|
452
486
|
|
|
453
|
-
|
|
454
|
-
$ sp workflows extend-lease <orderId> --sppi 1.5
|
|
487
|
+
Login to SuperProtocol (sign up or sign in).
|
|
455
488
|
|
|
456
|
-
|
|
489
|
+
ALIASES
|
|
490
|
+
$ sp login
|
|
457
491
|
|
|
458
|
-
|
|
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
|
|
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,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
|
-
|
|
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");
|
|
17
19
|
const ask = await promptService.confirm({
|
|
18
|
-
message: 'Do you
|
|
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
|
|
28
|
+
message: 'Please input your privateKey',
|
|
29
|
+
validate: (value) => value?.trim(),
|
|
27
30
|
});
|
|
28
31
|
const privateKey = privateKeyInput.trim();
|
|
29
32
|
try {
|