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