@super-protocol/sp-cli 0.0.6 → 0.0.8
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 +116 -234
- package/dist/commands/account/base.d.ts +19 -0
- package/dist/commands/account/base.js +42 -0
- package/dist/commands/account/forget.d.ts +14 -0
- package/dist/commands/account/forget.js +49 -0
- package/dist/commands/account/get-sppi.d.ts +2 -2
- package/dist/commands/account/get-sppi.js +8 -13
- package/dist/commands/account/info.d.ts +5 -2
- package/dist/commands/account/info.js +53 -3
- package/dist/commands/account/list.d.ts +9 -0
- package/dist/commands/{config → account}/list.js +16 -9
- package/dist/commands/account/login.d.ts +35 -0
- package/dist/commands/account/login.js +249 -0
- package/dist/commands/account/switch.d.ts +12 -0
- package/dist/commands/account/switch.js +40 -0
- package/dist/commands/base.d.ts +4 -3
- package/dist/commands/base.js +99 -13
- package/dist/commands/files/download.js +13 -5
- package/dist/commands/files/upload.js +11 -7
- package/dist/commands/storage/base.d.ts +2 -2
- package/dist/commands/storage/base.js +11 -11
- package/dist/commands/storage/create.js +1 -1
- package/dist/commands/storage/select.js +6 -8
- package/dist/commands/storage/show.js +2 -4
- package/dist/commands/storage/update.js +39 -22
- package/dist/commands/workflows/extend-lease.d.ts +1 -1
- package/dist/commands/workflows/extend-lease.js +21 -13
- package/dist/config/config-file.schema.d.ts +1 -2
- package/dist/config/config-file.schema.js +0 -1
- package/dist/config/config.schema.d.ts +1 -1
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +2 -0
- package/dist/hooks/finally/shutdown-blockchain.d.ts +1 -1
- package/dist/hooks/finally/shutdown-blockchain.js +1 -1
- package/dist/hooks/finally/unlock-config.d.ts +3 -0
- package/dist/hooks/finally/unlock-config.js +5 -0
- package/dist/hooks/init/init-container.d.ts +1 -1
- package/dist/hooks/init/init-container.js +2 -3
- package/dist/hooks/init/lock-config.d.ts +3 -0
- package/dist/hooks/init/lock-config.js +19 -0
- package/dist/hooks/prerun/auth.d.ts +3 -0
- package/dist/hooks/prerun/auth.js +70 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/account-manager.interface.d.ts +1 -1
- package/dist/interfaces/config-manager.interface.d.ts +2 -2
- package/dist/lib/cli-instance-lock.d.ts +2 -0
- package/dist/lib/cli-instance-lock.js +37 -0
- package/dist/lib/container.d.ts +6 -4
- package/dist/lib/container.js +108 -38
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +4 -1
- package/dist/managers/account-manager.d.ts +7 -8
- package/dist/managers/account-manager.js +20 -45
- package/dist/managers/config-file-manager.d.ts +6 -7
- package/dist/managers/config-file-manager.js +35 -32
- package/dist/managers/config-manager.d.ts +5 -5
- package/dist/managers/config-manager.js +5 -2
- package/dist/middlewares/auth-middleware.d.ts +1 -1
- package/dist/services/auth.service.d.ts +10 -15
- package/dist/services/auth.service.js +71 -5
- package/dist/services/storage.service.d.ts +3 -3
- package/dist/services/storage.service.js +46 -19
- package/dist/utils/helper.d.ts +1 -0
- package/dist/utils/helper.js +15 -1
- package/dist/utils/prompt-flags.d.ts +20 -0
- package/dist/utils/prompt-flags.js +121 -0
- package/dist/utils/prompt.service.d.ts +16 -0
- package/dist/utils/prompt.service.js +75 -0
- package/dist/utils/tty.d.ts +1 -0
- package/dist/utils/tty.js +3 -0
- package/oclif.manifest.json +206 -242
- package/package.json +17 -24
- package/dist/commands/auth/login.d.ts +0 -12
- package/dist/commands/auth/login.js +0 -50
- package/dist/commands/auth/me.d.ts +0 -5
- package/dist/commands/auth/me.js +0 -16
- package/dist/commands/config/add.d.ts +0 -13
- package/dist/commands/config/add.js +0 -73
- package/dist/commands/config/base.d.ts +0 -16
- package/dist/commands/config/base.js +0 -78
- package/dist/commands/config/create.d.ts +0 -11
- package/dist/commands/config/create.js +0 -41
- package/dist/commands/config/delete.d.ts +0 -10
- package/dist/commands/config/delete.js +0 -25
- package/dist/commands/config/index.d.ts +0 -6
- package/dist/commands/config/index.js +0 -22
- package/dist/commands/config/list.d.ts +0 -6
- package/dist/commands/config/show.d.ts +0 -6
- package/dist/commands/config/show.js +0 -10
- package/dist/commands/config/use.d.ts +0 -6
- package/dist/commands/config/use.js +0 -27
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.8 linux-x64 node-v22.21.1
|
|
25
25
|
$ sp --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ sp COMMAND
|
|
@@ -30,18 +30,13 @@ USAGE
|
|
|
30
30
|
<!-- usagestop -->
|
|
31
31
|
# Commands
|
|
32
32
|
<!-- commands -->
|
|
33
|
+
* [`sp account forget`](#sp-account-forget)
|
|
33
34
|
* [`sp account get-sppi`](#sp-account-get-sppi)
|
|
34
35
|
* [`sp account info`](#sp-account-info)
|
|
35
|
-
* [`sp
|
|
36
|
-
* [`sp
|
|
36
|
+
* [`sp account list`](#sp-account-list)
|
|
37
|
+
* [`sp account login`](#sp-account-login)
|
|
38
|
+
* [`sp account switch`](#sp-account-switch)
|
|
37
39
|
* [`sp autocomplete [SHELL]`](#sp-autocomplete-shell)
|
|
38
|
-
* [`sp config`](#sp-config)
|
|
39
|
-
* [`sp config add [FILE]`](#sp-config-add-file)
|
|
40
|
-
* [`sp config create`](#sp-config-create)
|
|
41
|
-
* [`sp config delete`](#sp-config-delete)
|
|
42
|
-
* [`sp config list`](#sp-config-list)
|
|
43
|
-
* [`sp config show`](#sp-config-show)
|
|
44
|
-
* [`sp config use`](#sp-config-use)
|
|
45
40
|
* [`sp files download RESOURCEFILE LOCALDIRECTORY`](#sp-files-download-resourcefile-localdirectory)
|
|
46
41
|
* [`sp files upload PATH`](#sp-files-upload-path)
|
|
47
42
|
* [`sp help [COMMAND]`](#sp-help-command)
|
|
@@ -52,296 +47,178 @@ USAGE
|
|
|
52
47
|
* [`sp storage update`](#sp-storage-update)
|
|
53
48
|
* [`sp workflows extend-lease ORDERID`](#sp-workflows-extend-lease-orderid)
|
|
54
49
|
|
|
55
|
-
## `sp account
|
|
50
|
+
## `sp account forget`
|
|
56
51
|
|
|
57
|
-
|
|
52
|
+
Purge all account details
|
|
58
53
|
|
|
59
54
|
```
|
|
60
55
|
USAGE
|
|
61
|
-
$ sp account
|
|
56
|
+
$ sp account forget -n <value> [--json] [--tty] [-f]
|
|
62
57
|
|
|
63
|
-
|
|
64
|
-
--
|
|
65
|
-
--
|
|
66
|
-
|
|
67
|
-
DESCRIPTION
|
|
68
|
-
Get SPPI (Super Protocol incentive tokens)
|
|
69
|
-
|
|
70
|
-
EXAMPLES
|
|
71
|
-
$ sp account get-sppi
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
_See code: [src/commands/account/get-sppi.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.6/src/commands/account/get-sppi.ts)_
|
|
75
|
-
|
|
76
|
-
## `sp account info`
|
|
77
|
-
|
|
78
|
-
Information about current authorized user
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
USAGE
|
|
82
|
-
$ sp account info [--json] [--config <value>]
|
|
83
|
-
|
|
84
|
-
GLOBAL FLAGS
|
|
85
|
-
--config=<value> Specify config file.
|
|
86
|
-
--json Format output as json.
|
|
87
|
-
|
|
88
|
-
DESCRIPTION
|
|
89
|
-
Information about current authorized user
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
_See code: [src/commands/account/info.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.6/src/commands/account/info.ts)_
|
|
93
|
-
|
|
94
|
-
## `sp auth login`
|
|
95
|
-
|
|
96
|
-
Login to SuperProtocol (sign up or sign in).
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
USAGE
|
|
100
|
-
$ sp auth login [--json] [--config <value>]
|
|
101
|
-
|
|
102
|
-
GLOBAL FLAGS
|
|
103
|
-
--config=<value> Specify config file.
|
|
104
|
-
--json Format output as json.
|
|
105
|
-
|
|
106
|
-
DESCRIPTION
|
|
107
|
-
Login to SuperProtocol (sign up or sign in).
|
|
108
|
-
|
|
109
|
-
ALIASES
|
|
110
|
-
$ sp login
|
|
111
|
-
|
|
112
|
-
EXAMPLES
|
|
113
|
-
$ sp auth login
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
_See code: [src/commands/auth/login.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.6/src/commands/auth/login.ts)_
|
|
117
|
-
|
|
118
|
-
## `sp auth me`
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
USAGE
|
|
122
|
-
$ sp auth me [--json] [--config <value>]
|
|
58
|
+
FLAGS
|
|
59
|
+
-f, --force Force deletion without confirmation
|
|
60
|
+
-n, --name=<value> (required) Configuration name to delete
|
|
123
61
|
|
|
124
62
|
GLOBAL FLAGS
|
|
125
|
-
--
|
|
126
|
-
--
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
_See code: [src/commands/auth/me.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.6/src/commands/auth/me.ts)_
|
|
130
|
-
|
|
131
|
-
## `sp autocomplete [SHELL]`
|
|
132
|
-
|
|
133
|
-
Display autocomplete installation instructions.
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
USAGE
|
|
137
|
-
$ sp autocomplete [SHELL] [-r]
|
|
138
|
-
|
|
139
|
-
ARGUMENTS
|
|
140
|
-
[SHELL] (zsh|bash|powershell) Shell type
|
|
141
|
-
|
|
142
|
-
FLAGS
|
|
143
|
-
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
63
|
+
--json Format output as json.
|
|
64
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
144
65
|
|
|
145
66
|
DESCRIPTION
|
|
146
|
-
|
|
67
|
+
Purge all account details
|
|
147
68
|
|
|
148
69
|
EXAMPLES
|
|
149
|
-
$ sp
|
|
70
|
+
$ sp account forget
|
|
150
71
|
|
|
151
|
-
$ sp
|
|
152
|
-
|
|
153
|
-
$ sp autocomplete zsh
|
|
72
|
+
$ sp account forget --name "My Account"
|
|
154
73
|
|
|
155
|
-
$ sp
|
|
156
|
-
|
|
157
|
-
$ sp autocomplete --refresh-cache
|
|
74
|
+
$ sp account forget --name "My Account" --force
|
|
158
75
|
```
|
|
159
76
|
|
|
160
|
-
_See code: [
|
|
77
|
+
_See code: [src/commands/account/forget.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/forget.ts)_
|
|
161
78
|
|
|
162
|
-
## `sp
|
|
79
|
+
## `sp account get-sppi`
|
|
163
80
|
|
|
164
|
-
|
|
81
|
+
Get SPPI (Super Protocol incentive tokens)
|
|
165
82
|
|
|
166
83
|
```
|
|
167
84
|
USAGE
|
|
168
|
-
$ sp
|
|
85
|
+
$ sp account get-sppi [--json] [--tty]
|
|
169
86
|
|
|
170
87
|
GLOBAL FLAGS
|
|
171
|
-
--json
|
|
88
|
+
--json Format output as json.
|
|
89
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
172
90
|
|
|
173
91
|
DESCRIPTION
|
|
174
|
-
|
|
92
|
+
Get SPPI (Super Protocol incentive tokens)
|
|
175
93
|
|
|
176
94
|
EXAMPLES
|
|
177
|
-
$ sp
|
|
178
|
-
|
|
179
|
-
$ sp config list - List all configurations
|
|
180
|
-
|
|
181
|
-
$ sp config use - Switch to a configuration
|
|
182
|
-
|
|
183
|
-
$ sp config create --name "My Config" - Create new configuration
|
|
184
|
-
|
|
185
|
-
$ sp config add ./config.json - Import configuration from file
|
|
186
|
-
|
|
187
|
-
$ sp config delete - Delete a configuration
|
|
95
|
+
$ sp account get-sppi
|
|
188
96
|
```
|
|
189
97
|
|
|
190
|
-
_See code: [src/commands/
|
|
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)_
|
|
191
99
|
|
|
192
|
-
## `sp
|
|
100
|
+
## `sp account info`
|
|
193
101
|
|
|
194
|
-
|
|
102
|
+
Information about current authorized user
|
|
195
103
|
|
|
196
104
|
```
|
|
197
105
|
USAGE
|
|
198
|
-
$ sp
|
|
199
|
-
|
|
200
|
-
ARGUMENTS
|
|
201
|
-
[FILE] Configuration file path to import
|
|
106
|
+
$ sp account info [--json] [--tty] [--detail]
|
|
202
107
|
|
|
203
108
|
FLAGS
|
|
204
|
-
|
|
205
|
-
-y, --yes Automatically switch to imported configuration
|
|
109
|
+
--detail Detailed information about Account
|
|
206
110
|
|
|
207
111
|
GLOBAL FLAGS
|
|
208
|
-
--json
|
|
112
|
+
--json Format output as json.
|
|
113
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
209
114
|
|
|
210
115
|
DESCRIPTION
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
EXAMPLES
|
|
214
|
-
$ sp config add ./my-config.json
|
|
215
|
-
|
|
216
|
-
$ sp config add ./my-config.json --name "Imported"
|
|
217
|
-
|
|
218
|
-
Configuration files must follow this schema:
|
|
219
|
-
{
|
|
220
|
-
"providerUrl": "https://api.dp.superprotocol.com",
|
|
221
|
-
"name": "Some name",
|
|
222
|
-
"account": {
|
|
223
|
-
"address": "0x111222333444555....",
|
|
224
|
-
"privateKey": "0x000011122233344555..."
|
|
225
|
-
}
|
|
226
|
-
}
|
|
116
|
+
Information about current authorized user
|
|
227
117
|
```
|
|
228
118
|
|
|
229
|
-
_See code: [src/commands/
|
|
119
|
+
_See code: [src/commands/account/info.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/info.ts)_
|
|
230
120
|
|
|
231
|
-
## `sp
|
|
121
|
+
## `sp account list`
|
|
232
122
|
|
|
233
|
-
|
|
123
|
+
List all Accounts
|
|
234
124
|
|
|
235
125
|
```
|
|
236
126
|
USAGE
|
|
237
|
-
$ sp
|
|
238
|
-
|
|
239
|
-
FLAGS
|
|
240
|
-
-n, --name=<value> (required) Configuration name
|
|
241
|
-
-u, --url=<value> Provider base URL
|
|
242
|
-
-y, --yes Switch to new config
|
|
127
|
+
$ sp account list [--json] [--tty]
|
|
243
128
|
|
|
244
129
|
GLOBAL FLAGS
|
|
245
|
-
--json
|
|
130
|
+
--json Format output as json.
|
|
131
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
246
132
|
|
|
247
133
|
DESCRIPTION
|
|
248
|
-
|
|
134
|
+
List all Accounts
|
|
249
135
|
|
|
250
136
|
EXAMPLES
|
|
251
|
-
$ sp
|
|
252
|
-
|
|
253
|
-
$ sp config create --name "Production" --url "https://api.dp.superprotocol.com"
|
|
137
|
+
$ sp account list
|
|
254
138
|
```
|
|
255
139
|
|
|
256
|
-
_See code: [src/commands/
|
|
140
|
+
_See code: [src/commands/account/list.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/list.ts)_
|
|
257
141
|
|
|
258
|
-
## `sp
|
|
142
|
+
## `sp account login`
|
|
259
143
|
|
|
260
|
-
|
|
144
|
+
Login to SuperProtocol (sign up or sign in).
|
|
261
145
|
|
|
262
146
|
```
|
|
263
147
|
USAGE
|
|
264
|
-
$ sp
|
|
148
|
+
$ sp account login [--json] [--tty] [--name <value>] [--privateKey <value>] [-y]
|
|
265
149
|
|
|
266
150
|
FLAGS
|
|
267
|
-
-
|
|
268
|
-
|
|
151
|
+
-y, --yes Skip questions (generate keys when needed).
|
|
152
|
+
--name=<value> Account readable name
|
|
153
|
+
--privateKey=<value> Account private key used for authentication
|
|
269
154
|
|
|
270
155
|
GLOBAL FLAGS
|
|
271
|
-
--json
|
|
156
|
+
--json Format output as json.
|
|
157
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
272
158
|
|
|
273
159
|
DESCRIPTION
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
EXAMPLES
|
|
277
|
-
$ sp config delete
|
|
160
|
+
Login to SuperProtocol (sign up or sign in).
|
|
278
161
|
|
|
279
|
-
|
|
162
|
+
ALIASES
|
|
163
|
+
$ sp login
|
|
280
164
|
|
|
281
|
-
|
|
165
|
+
EXAMPLES
|
|
166
|
+
$ sp account login
|
|
282
167
|
```
|
|
283
168
|
|
|
284
|
-
_See code: [src/commands/
|
|
169
|
+
_See code: [src/commands/account/login.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/login.ts)_
|
|
285
170
|
|
|
286
|
-
## `sp
|
|
171
|
+
## `sp account switch`
|
|
287
172
|
|
|
288
|
-
|
|
173
|
+
Switch to a different account
|
|
289
174
|
|
|
290
175
|
```
|
|
291
176
|
USAGE
|
|
292
|
-
$ sp
|
|
177
|
+
$ sp account switch [--json] [--tty]
|
|
293
178
|
|
|
294
179
|
GLOBAL FLAGS
|
|
295
|
-
--json
|
|
180
|
+
--json Format output as json.
|
|
181
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
296
182
|
|
|
297
183
|
DESCRIPTION
|
|
298
|
-
|
|
184
|
+
Switch to a different account
|
|
299
185
|
|
|
300
186
|
EXAMPLES
|
|
301
|
-
$ sp
|
|
187
|
+
$ sp account switch
|
|
302
188
|
```
|
|
303
189
|
|
|
304
|
-
_See code: [src/commands/
|
|
190
|
+
_See code: [src/commands/account/switch.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/account/switch.ts)_
|
|
305
191
|
|
|
306
|
-
## `sp
|
|
192
|
+
## `sp autocomplete [SHELL]`
|
|
307
193
|
|
|
308
|
-
|
|
194
|
+
Display autocomplete installation instructions.
|
|
309
195
|
|
|
310
196
|
```
|
|
311
197
|
USAGE
|
|
312
|
-
$ sp
|
|
198
|
+
$ sp autocomplete [SHELL] [-r]
|
|
313
199
|
|
|
314
|
-
|
|
315
|
-
|
|
200
|
+
ARGUMENTS
|
|
201
|
+
[SHELL] (zsh|bash|powershell) Shell type
|
|
202
|
+
|
|
203
|
+
FLAGS
|
|
204
|
+
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
316
205
|
|
|
317
206
|
DESCRIPTION
|
|
318
|
-
|
|
207
|
+
Display autocomplete installation instructions.
|
|
319
208
|
|
|
320
209
|
EXAMPLES
|
|
321
|
-
$ sp
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
_See code: [src/commands/config/show.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.6/src/commands/config/show.ts)_
|
|
325
|
-
|
|
326
|
-
## `sp config use`
|
|
327
|
-
|
|
328
|
-
Switch to a different configuration file
|
|
210
|
+
$ sp autocomplete
|
|
329
211
|
|
|
330
|
-
|
|
331
|
-
USAGE
|
|
332
|
-
$ sp config use [--json]
|
|
212
|
+
$ sp autocomplete bash
|
|
333
213
|
|
|
334
|
-
|
|
335
|
-
--json Format output as json.
|
|
214
|
+
$ sp autocomplete zsh
|
|
336
215
|
|
|
337
|
-
|
|
338
|
-
Switch to a different configuration file
|
|
216
|
+
$ sp autocomplete powershell
|
|
339
217
|
|
|
340
|
-
|
|
341
|
-
$ sp config use
|
|
218
|
+
$ sp autocomplete --refresh-cache
|
|
342
219
|
```
|
|
343
220
|
|
|
344
|
-
_See code: [
|
|
221
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.39/src/commands/autocomplete/index.ts)_
|
|
345
222
|
|
|
346
223
|
## `sp files download RESOURCEFILE LOCALDIRECTORY`
|
|
347
224
|
|
|
@@ -349,7 +226,7 @@ Download file or directory described in resource file
|
|
|
349
226
|
|
|
350
227
|
```
|
|
351
228
|
USAGE
|
|
352
|
-
$ sp files download RESOURCEFILE LOCALDIRECTORY [--json] [--
|
|
229
|
+
$ sp files download RESOURCEFILE LOCALDIRECTORY [--json] [--tty] [--maximum-concurrent <value>]
|
|
353
230
|
|
|
354
231
|
ARGUMENTS
|
|
355
232
|
RESOURCEFILE Path to a resource file
|
|
@@ -359,8 +236,8 @@ FLAGS
|
|
|
359
236
|
--maximum-concurrent=<value> [default: 1] Maximum concurrent pieces to download at once per transfer
|
|
360
237
|
|
|
361
238
|
GLOBAL FLAGS
|
|
362
|
-
--
|
|
363
|
-
--
|
|
239
|
+
--json Format output as json.
|
|
240
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
364
241
|
|
|
365
242
|
DESCRIPTION
|
|
366
243
|
Download file or directory described in resource file
|
|
@@ -369,7 +246,7 @@ EXAMPLES
|
|
|
369
246
|
$ sp files download ./resource.json ./pathToDownload
|
|
370
247
|
```
|
|
371
248
|
|
|
372
|
-
_See code: [src/commands/files/download.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
249
|
+
_See code: [src/commands/files/download.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/files/download.ts)_
|
|
373
250
|
|
|
374
251
|
## `sp files upload PATH`
|
|
375
252
|
|
|
@@ -377,8 +254,8 @@ Upload file or directory to remote storage
|
|
|
377
254
|
|
|
378
255
|
```
|
|
379
256
|
USAGE
|
|
380
|
-
$ sp files upload PATH [--json] [--
|
|
381
|
-
[--
|
|
257
|
+
$ sp files upload PATH [--json] [--tty] [--filename <value>] [--maximum-concurrent <value>] [--metadata <value>]
|
|
258
|
+
[--output <value>] [--skip-encryption] [--sync]
|
|
382
259
|
|
|
383
260
|
ARGUMENTS
|
|
384
261
|
PATH file or directory to upload
|
|
@@ -393,8 +270,8 @@ FLAGS
|
|
|
393
270
|
--sync Sync mode: delete files in target that don't exist in source
|
|
394
271
|
|
|
395
272
|
GLOBAL FLAGS
|
|
396
|
-
--
|
|
397
|
-
--
|
|
273
|
+
--json Format output as json.
|
|
274
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
398
275
|
|
|
399
276
|
DESCRIPTION
|
|
400
277
|
Upload file or directory to remote storage
|
|
@@ -403,7 +280,7 @@ EXAMPLES
|
|
|
403
280
|
$ sp files upload ./file.txt
|
|
404
281
|
```
|
|
405
282
|
|
|
406
|
-
_See code: [src/commands/files/upload.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
283
|
+
_See code: [src/commands/files/upload.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/files/upload.ts)_
|
|
407
284
|
|
|
408
285
|
## `sp help [COMMAND]`
|
|
409
286
|
|
|
@@ -431,11 +308,16 @@ Login to SuperProtocol (sign up or sign in).
|
|
|
431
308
|
|
|
432
309
|
```
|
|
433
310
|
USAGE
|
|
434
|
-
$ sp login [--json] [--
|
|
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
|
|
435
317
|
|
|
436
318
|
GLOBAL FLAGS
|
|
437
|
-
--
|
|
438
|
-
--
|
|
319
|
+
--json Format output as json.
|
|
320
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
439
321
|
|
|
440
322
|
DESCRIPTION
|
|
441
323
|
Login to SuperProtocol (sign up or sign in).
|
|
@@ -453,15 +335,15 @@ Create a new storage entry from file or interactive prompts.
|
|
|
453
335
|
|
|
454
336
|
```
|
|
455
337
|
USAGE
|
|
456
|
-
$ sp storage create [--json] [--
|
|
338
|
+
$ sp storage create [--json] [--tty] [-f <value>] [--notDefault]
|
|
457
339
|
|
|
458
340
|
FLAGS
|
|
459
341
|
-f, --fromFile=<value> Path to a JSON file that contains AddStorageDto payload.
|
|
460
342
|
--notDefault Skip setting the created storage as default.
|
|
461
343
|
|
|
462
344
|
GLOBAL FLAGS
|
|
463
|
-
--
|
|
464
|
-
--
|
|
345
|
+
--json Format output as json.
|
|
346
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
465
347
|
|
|
466
348
|
DESCRIPTION
|
|
467
349
|
Create a new storage entry from file or interactive prompts.
|
|
@@ -474,7 +356,7 @@ EXAMPLES
|
|
|
474
356
|
$ sp storage create --not-default
|
|
475
357
|
```
|
|
476
358
|
|
|
477
|
-
_See code: [src/commands/storage/create.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
359
|
+
_See code: [src/commands/storage/create.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/create.ts)_
|
|
478
360
|
|
|
479
361
|
## `sp storage select`
|
|
480
362
|
|
|
@@ -482,11 +364,11 @@ Select a storage that will be used by subsequent commands.
|
|
|
482
364
|
|
|
483
365
|
```
|
|
484
366
|
USAGE
|
|
485
|
-
$ sp storage select [--json] [--
|
|
367
|
+
$ sp storage select [--json] [--tty]
|
|
486
368
|
|
|
487
369
|
GLOBAL FLAGS
|
|
488
|
-
--
|
|
489
|
-
--
|
|
370
|
+
--json Format output as json.
|
|
371
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
490
372
|
|
|
491
373
|
DESCRIPTION
|
|
492
374
|
Select a storage that will be used by subsequent commands.
|
|
@@ -495,7 +377,7 @@ EXAMPLES
|
|
|
495
377
|
$ sp storage select
|
|
496
378
|
```
|
|
497
379
|
|
|
498
|
-
_See code: [src/commands/storage/select.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
380
|
+
_See code: [src/commands/storage/select.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/select.ts)_
|
|
499
381
|
|
|
500
382
|
## `sp storage show`
|
|
501
383
|
|
|
@@ -503,11 +385,11 @@ Show current selected storage
|
|
|
503
385
|
|
|
504
386
|
```
|
|
505
387
|
USAGE
|
|
506
|
-
$ sp storage show [--json] [--
|
|
388
|
+
$ sp storage show [--json] [--tty]
|
|
507
389
|
|
|
508
390
|
GLOBAL FLAGS
|
|
509
|
-
--
|
|
510
|
-
--
|
|
391
|
+
--json Format output as json.
|
|
392
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
511
393
|
|
|
512
394
|
DESCRIPTION
|
|
513
395
|
Show current selected storage
|
|
@@ -516,7 +398,7 @@ EXAMPLES
|
|
|
516
398
|
$ sp storage show
|
|
517
399
|
```
|
|
518
400
|
|
|
519
|
-
_See code: [src/commands/storage/show.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
401
|
+
_See code: [src/commands/storage/show.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/show.ts)_
|
|
520
402
|
|
|
521
403
|
## `sp storage update`
|
|
522
404
|
|
|
@@ -524,15 +406,15 @@ Update the configuration of an existing storage.
|
|
|
524
406
|
|
|
525
407
|
```
|
|
526
408
|
USAGE
|
|
527
|
-
$ sp storage update [--json] [--
|
|
409
|
+
$ sp storage update [--json] [--tty] [-f <value>] [-i <value>]
|
|
528
410
|
|
|
529
411
|
FLAGS
|
|
530
412
|
-f, --fromFile=<value> Path to a JSON file that contains UpdateStorageDto payload.
|
|
531
413
|
-i, --id=<value> Storage ID to update
|
|
532
414
|
|
|
533
415
|
GLOBAL FLAGS
|
|
534
|
-
--
|
|
535
|
-
--
|
|
416
|
+
--json Format output as json.
|
|
417
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
536
418
|
|
|
537
419
|
DESCRIPTION
|
|
538
420
|
Update the configuration of an existing storage.
|
|
@@ -543,7 +425,7 @@ EXAMPLES
|
|
|
543
425
|
$ sp storage update --id=2de3e3a4-0000-1111-2222-333344445555
|
|
544
426
|
```
|
|
545
427
|
|
|
546
|
-
_See code: [src/commands/storage/update.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
428
|
+
_See code: [src/commands/storage/update.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.8/src/commands/storage/update.ts)_
|
|
547
429
|
|
|
548
430
|
## `sp workflows extend-lease ORDERID`
|
|
549
431
|
|
|
@@ -551,7 +433,7 @@ Replenish deposit for a workflow to extend its lease time
|
|
|
551
433
|
|
|
552
434
|
```
|
|
553
435
|
USAGE
|
|
554
|
-
$ sp workflows extend-lease ORDERID [--json] [--
|
|
436
|
+
$ sp workflows extend-lease ORDERID [--json] [--tty] [--minutes <value>] [--sppi <value>] [-y]
|
|
555
437
|
|
|
556
438
|
ARGUMENTS
|
|
557
439
|
ORDERID Order ID
|
|
@@ -562,8 +444,8 @@ FLAGS
|
|
|
562
444
|
--sppi=<value> SPPI token amount to add to the order
|
|
563
445
|
|
|
564
446
|
GLOBAL FLAGS
|
|
565
|
-
--
|
|
566
|
-
--
|
|
447
|
+
--json Format output as json.
|
|
448
|
+
--[no-]tty Force or disable interactive mode (use --no-tty to disable).
|
|
567
449
|
|
|
568
450
|
DESCRIPTION
|
|
569
451
|
Replenish deposit for a workflow to extend its lease time
|
|
@@ -576,5 +458,5 @@ EXAMPLES
|
|
|
576
458
|
$ sp workflows extend-lease <orderId> --sppi 2 --yes
|
|
577
459
|
```
|
|
578
460
|
|
|
579
|
-
_See code: [src/commands/workflows/extend-lease.ts](https://github.com/Super-Protocol/sp-cli/blob/v0.0.
|
|
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)_
|
|
580
462
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Command } from '@oclif/core';
|
|
2
|
+
import type { AccountManager } from '../../managers/index.js';
|
|
3
|
+
import { type SelectOptions } from '../../utils/prompt.service.js';
|
|
4
|
+
import { BaseCommand } from '../base.js';
|
|
5
|
+
type ProviderInitOptions = {
|
|
6
|
+
assumeYes?: boolean;
|
|
7
|
+
enableAuth?: boolean;
|
|
8
|
+
enableCookies?: boolean;
|
|
9
|
+
rebuild?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare abstract class BaseAccountCommand<T extends typeof Command> extends BaseCommand<T> {
|
|
12
|
+
protected initAccountContext(providerOptions?: ProviderInitOptions): Promise<void>;
|
|
13
|
+
interactWithUser(accountManager: AccountManager): Promise<{
|
|
14
|
+
address: string;
|
|
15
|
+
privateKey: string;
|
|
16
|
+
}>;
|
|
17
|
+
protected selectPrompt<Value>(options: SelectOptions<Value>): Promise<Value>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { promptService } from '../../utils/prompt.service.js';
|
|
2
|
+
import { BaseCommand } from '../base.js';
|
|
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();
|
|
7
|
+
if (!(await accountManager.hasAccount())) {
|
|
8
|
+
await (providerOptions.assumeYes
|
|
9
|
+
? accountManager.create()
|
|
10
|
+
: this.interactWithUser(accountManager));
|
|
11
|
+
}
|
|
12
|
+
const { assumeYes: _assumeYes, rebuild: _rebuild, ...initOptions } = providerOptions;
|
|
13
|
+
await this.container.initProviderClient({ ...initOptions, rebuild }).build();
|
|
14
|
+
}
|
|
15
|
+
async interactWithUser(accountManager) {
|
|
16
|
+
this.warn("Account doesn't exist in current configuration");
|
|
17
|
+
const ask = await promptService.confirm({
|
|
18
|
+
message: 'Do you want to create a new account?',
|
|
19
|
+
});
|
|
20
|
+
if (ask) {
|
|
21
|
+
const account = await accountManager.create();
|
|
22
|
+
this.log('Generated new keyPair for new account.');
|
|
23
|
+
return account;
|
|
24
|
+
}
|
|
25
|
+
const privateKeyInput = await promptService.password({
|
|
26
|
+
message: 'Please input your privateKey for using in account',
|
|
27
|
+
});
|
|
28
|
+
const privateKey = privateKeyInput.trim();
|
|
29
|
+
try {
|
|
30
|
+
const account = await accountManager.createFromKey(privateKey);
|
|
31
|
+
this.log('Your privateKey will be used in config. Keypair created');
|
|
32
|
+
return account;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.debug(error);
|
|
36
|
+
this.error('Invalid private key format. Please try again.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async selectPrompt(options) {
|
|
40
|
+
return promptService.select(options);
|
|
41
|
+
}
|
|
42
|
+
}
|