@super-protocol/sp-cli 0.0.2-alpha.1 → 0.0.2-beta.2
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 +144 -49
- package/dist/commands/account/info.d.ts +21 -0
- package/dist/commands/account/info.js +43 -0
- package/dist/commands/auth/login.d.ts +1 -10
- package/dist/commands/auth/login.js +23 -75
- package/dist/commands/base.d.ts +2 -4
- package/dist/commands/base.js +8 -10
- package/dist/commands/config/add.js +9 -5
- package/dist/commands/config/base.d.ts +4 -3
- package/dist/commands/config/base.js +12 -14
- package/dist/commands/config/create.js +4 -4
- package/dist/commands/config/list.js +2 -2
- package/dist/commands/config/use.js +5 -3
- package/dist/commands/storage/base.d.ts +8 -0
- package/dist/commands/storage/base.js +12 -0
- package/dist/commands/storage/create.d.ts +15 -0
- package/dist/commands/storage/create.js +169 -0
- package/dist/commands/storage/select.d.ts +9 -0
- package/dist/commands/storage/select.js +46 -0
- package/dist/commands/storage/update.d.ts +16 -0
- package/dist/commands/storage/update.js +244 -0
- package/dist/config/config.schema.d.ts +1 -0
- package/dist/config/config.schema.js +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +2 -0
- package/dist/lib/container.d.ts +6 -7
- package/dist/lib/container.js +26 -26
- package/dist/managers/account-manager.js +12 -2
- package/dist/managers/config-file-manager.d.ts +1 -1
- package/dist/managers/config-file-manager.js +12 -7
- package/dist/middlewares/auth-middleware.js +5 -1
- package/dist/services/auth.service.d.ts +24 -0
- package/dist/services/auth.service.js +93 -0
- package/dist/services/storage.service.d.ts +47 -0
- package/dist/services/storage.service.js +179 -0
- package/oclif.manifest.json +217 -137
- package/package.json +9 -3
|
@@ -48,7 +48,6 @@ export default class ConfigAdd extends BaseConfigCommand {
|
|
|
48
48
|
if (!existsSync(testPath)) {
|
|
49
49
|
return 'File does not exist';
|
|
50
50
|
}
|
|
51
|
-
return true;
|
|
52
51
|
},
|
|
53
52
|
});
|
|
54
53
|
}
|
|
@@ -66,15 +65,20 @@ export default class ConfigAdd extends BaseConfigCommand {
|
|
|
66
65
|
this.log(`Successfully imported configuration: ${displayName}`);
|
|
67
66
|
this.log(`Configuration file: ${importedFileName}`);
|
|
68
67
|
const shouldSwitch = this.flags.yes || await this.selectPrompt({
|
|
69
|
-
choices: [
|
|
70
|
-
{ name: 'Yes', value: true },
|
|
71
|
-
{ name: 'No', value: false },
|
|
72
|
-
],
|
|
73
68
|
message: 'Switch to this configuration now?',
|
|
69
|
+
options: [
|
|
70
|
+
{ label: 'Yes', value: true },
|
|
71
|
+
{ label: 'No', value: false },
|
|
72
|
+
],
|
|
74
73
|
});
|
|
75
74
|
if (shouldSwitch) {
|
|
76
75
|
await this.configFileManager.setCurrentConfig(importedFileName);
|
|
77
76
|
this.log(`Switched to configuration: ${displayName}`);
|
|
77
|
+
await this.container
|
|
78
|
+
.initConfigFileManager(true)
|
|
79
|
+
.initConfigManager(true)
|
|
80
|
+
.initAccountManager(true)
|
|
81
|
+
.build();
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
catch (error) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { Command } from '@oclif/core';
|
|
2
|
-
import {
|
|
2
|
+
import { select, text } from '@clack/prompts';
|
|
3
3
|
import type { ConfigFileManager } from '../../managers/config-file-manager.js';
|
|
4
4
|
import { BaseCommand } from '../base.js';
|
|
5
|
-
type
|
|
5
|
+
type TextOptions = Parameters<typeof text>[0];
|
|
6
6
|
type SelectOptions<T> = Parameters<typeof select<T>>[0];
|
|
7
7
|
export declare abstract class BaseConfigCommand<T extends typeof Command> extends BaseCommand<T> {
|
|
8
|
+
static baseFlags: {};
|
|
8
9
|
protected configFileManager: ConfigFileManager;
|
|
9
10
|
protected displayCurrentConfig(): void;
|
|
10
11
|
init(): Promise<void>;
|
|
11
|
-
protected inputPrompt(options:
|
|
12
|
+
protected inputPrompt(options: TextOptions): Promise<string>;
|
|
12
13
|
protected selectPrompt<Value>(options: SelectOptions<Value>): Promise<Value>;
|
|
13
14
|
}
|
|
14
15
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { select, text } from '@clack/prompts';
|
|
2
|
+
import { PROVIDER_URL } from '../../constants.js';
|
|
2
3
|
import { BaseCommand } from '../base.js';
|
|
3
4
|
export class BaseConfigCommand extends BaseCommand {
|
|
5
|
+
static baseFlags = {};
|
|
4
6
|
configFileManager;
|
|
5
7
|
displayCurrentConfig() {
|
|
6
8
|
const current = this.configFileManager.getCurrentConfigFile();
|
|
@@ -20,25 +22,19 @@ export class BaseConfigCommand extends BaseCommand {
|
|
|
20
22
|
this.log(` Provider URL: ${configData.providerUrl}`);
|
|
21
23
|
}
|
|
22
24
|
else {
|
|
23
|
-
this.log(
|
|
25
|
+
this.log(` Provider URL: ${PROVIDER_URL} (using default)`);
|
|
24
26
|
}
|
|
25
27
|
if (configData.auth?.accessKey) {
|
|
26
|
-
this.log(' Authorization:
|
|
28
|
+
this.log(' Authorization: [OK] Configured');
|
|
27
29
|
}
|
|
28
30
|
else {
|
|
29
|
-
this.log(' Authorization:
|
|
31
|
+
this.log(' Authorization: [--] Not configured');
|
|
30
32
|
}
|
|
31
33
|
if (configData.account?.address) {
|
|
32
|
-
this.log(` Account:
|
|
34
|
+
this.log(` Account: [OK] ${configData.account.address}`);
|
|
33
35
|
}
|
|
34
36
|
else {
|
|
35
|
-
this.log(' Account:
|
|
36
|
-
}
|
|
37
|
-
if (configData.cookies) {
|
|
38
|
-
this.log(' Cookies: ✓ Stored');
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.log(' Cookies: ✗ None');
|
|
37
|
+
this.log(' Account: [--] Not configured');
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
}
|
|
@@ -54,9 +50,11 @@ export class BaseConfigCommand extends BaseCommand {
|
|
|
54
50
|
this.configFileManager = this.container.configFileManager;
|
|
55
51
|
}
|
|
56
52
|
async inputPrompt(options) {
|
|
57
|
-
|
|
53
|
+
const result = await text(options);
|
|
54
|
+
return this.ensurePromptValue(result);
|
|
58
55
|
}
|
|
59
56
|
async selectPrompt(options) {
|
|
60
|
-
|
|
57
|
+
const result = await select(options);
|
|
58
|
+
return this.ensurePromptValue(result);
|
|
61
59
|
}
|
|
62
60
|
}
|
|
@@ -33,11 +33,11 @@ export default class ConfigCreate extends BaseConfigCommand {
|
|
|
33
33
|
this.log(`Provider URL: ${url}`);
|
|
34
34
|
}
|
|
35
35
|
const shouldSwitch = yes || await this.selectPrompt({
|
|
36
|
-
choices: [
|
|
37
|
-
{ name: 'Yes', value: true },
|
|
38
|
-
{ name: 'No', value: false },
|
|
39
|
-
],
|
|
40
36
|
message: 'Switch to this configuration now?',
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'Yes', value: true },
|
|
39
|
+
{ label: 'No', value: false },
|
|
40
|
+
],
|
|
41
41
|
});
|
|
42
42
|
if (shouldSwitch) {
|
|
43
43
|
await this.configFileManager.setCurrentConfig(fileName);
|
|
@@ -23,10 +23,10 @@ export default class ConfigList extends BaseConfigCommand {
|
|
|
23
23
|
parts.push(`URL: ${configData.providerUrl}`);
|
|
24
24
|
}
|
|
25
25
|
if (configData.auth) {
|
|
26
|
-
parts.push('Auth:
|
|
26
|
+
parts.push('Auth: [OK]');
|
|
27
27
|
}
|
|
28
28
|
if (configData.account) {
|
|
29
|
-
parts.push(
|
|
29
|
+
parts.push(`Account: [OK] ${configData.account.address} `);
|
|
30
30
|
}
|
|
31
31
|
if (parts.length > 0) {
|
|
32
32
|
statusInfo = ` | ${parts.join(', ')}`;
|
|
@@ -6,17 +6,19 @@ export default class ConfigUse extends BaseConfigCommand {
|
|
|
6
6
|
];
|
|
7
7
|
async run() {
|
|
8
8
|
const configs = this.configFileManager.getConfigsWithNames();
|
|
9
|
+
const currentConfig = this.configFileManager.getCurrentConfigFile();
|
|
9
10
|
if (configs.length === 0) {
|
|
10
11
|
this.log('No configurations found');
|
|
11
12
|
this.log('Create a new configuration with: sp config create --name "Config Name"');
|
|
12
13
|
return;
|
|
13
14
|
}
|
|
14
15
|
const selected = await this.selectPrompt({
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
initialValue: currentConfig,
|
|
17
|
+
message: 'Select a configuration:',
|
|
18
|
+
options: configs.map(config => ({
|
|
19
|
+
label: config.name ?? config.file,
|
|
17
20
|
value: config.file,
|
|
18
21
|
})),
|
|
19
|
-
message: 'Select a configuration:',
|
|
20
22
|
});
|
|
21
23
|
await this.configFileManager.setCurrentConfig(selected);
|
|
22
24
|
const selectedConfig = configs.find(c => c.file === selected);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../commands/base.js';
|
|
3
|
+
import { StorageService } from '../../services/storage.service.js';
|
|
4
|
+
export declare abstract class BaseStorageCommand<T extends typeof Command> extends BaseCommand<T> {
|
|
5
|
+
protected currentDir: string;
|
|
6
|
+
protected storageService: StorageService;
|
|
7
|
+
init(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../commands/base.js';
|
|
2
|
+
import { StorageService } from '../../services/storage.service.js';
|
|
3
|
+
export class BaseStorageCommand extends BaseCommand {
|
|
4
|
+
currentDir = process.cwd();
|
|
5
|
+
storageService;
|
|
6
|
+
async init() {
|
|
7
|
+
await super.init();
|
|
8
|
+
await this.container.initConfigManager().initProviderClient().build();
|
|
9
|
+
const { providerClient } = this.container;
|
|
10
|
+
this.storageService = new StorageService(providerClient, this.logger);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseStorageCommand } from './base.js';
|
|
2
|
+
export default class StorageCreate extends BaseStorageCommand<typeof StorageCreate> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
fromFile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
notDefault: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
private loadStorageFromFile;
|
|
11
|
+
private promptS3Credentials;
|
|
12
|
+
private promptStoragePayload;
|
|
13
|
+
private promptStorJCredentials;
|
|
14
|
+
private validateStoragePayload;
|
|
15
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { password, select, text } from '@clack/prompts';
|
|
2
|
+
import { Flags } from '@oclif/core';
|
|
3
|
+
import { StorageType } from '@super-protocol/provider-client';
|
|
4
|
+
import fs from 'node:fs/promises';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { BaseStorageCommand } from './base.js';
|
|
7
|
+
export default class StorageCreate extends BaseStorageCommand {
|
|
8
|
+
static description = 'Create a new storage entry from file or interactive prompts.';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> storage create',
|
|
11
|
+
'<%= config.bin %> storage create --fromFile ./storage.json',
|
|
12
|
+
'<%= config.bin %> storage create --not-default',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
fromFile: Flags.string({
|
|
16
|
+
aliases: ['fromFile'],
|
|
17
|
+
char: 'f',
|
|
18
|
+
description: 'Path to a JSON file that contains AddStorageDto payload.',
|
|
19
|
+
}),
|
|
20
|
+
notDefault: Flags.boolean({
|
|
21
|
+
description: 'Skip setting the created storage as default.',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(StorageCreate);
|
|
26
|
+
const payload = flags.fromFile
|
|
27
|
+
? await this.loadStorageFromFile(flags.fromFile)
|
|
28
|
+
: await this.promptStoragePayload();
|
|
29
|
+
try {
|
|
30
|
+
const storage = await this.storageService.createStorage(payload);
|
|
31
|
+
this.log(`Storage created: ${storage.id}`);
|
|
32
|
+
if (!flags.notDefault) {
|
|
33
|
+
await this.storageService.saveStorage(storage.id);
|
|
34
|
+
this.log('Storage set as default');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
this.error(error instanceof Error ? error.message : String(error));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async loadStorageFromFile(filePath) {
|
|
42
|
+
const absolutePath = path.isAbsolute(filePath)
|
|
43
|
+
? filePath
|
|
44
|
+
: path.join(this.currentDir, filePath);
|
|
45
|
+
try {
|
|
46
|
+
const fileContent = await fs.readFile(absolutePath, 'utf8');
|
|
47
|
+
const parsed = JSON.parse(fileContent);
|
|
48
|
+
this.validateStoragePayload(parsed);
|
|
49
|
+
return parsed;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
this.error(`Failed to load storage definition: ${error instanceof Error ? error.message : String(error)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async promptS3Credentials() {
|
|
56
|
+
const region = this.ensurePromptValue(await text({
|
|
57
|
+
message: 'AWS region',
|
|
58
|
+
validate(value) {
|
|
59
|
+
return value ? undefined : 'Region is required';
|
|
60
|
+
},
|
|
61
|
+
})).trim();
|
|
62
|
+
const readAccessKeyId = this.ensurePromptValue(await text({
|
|
63
|
+
message: 'Read access key ID',
|
|
64
|
+
validate(value) {
|
|
65
|
+
return value ? undefined : 'Read access key ID is required';
|
|
66
|
+
},
|
|
67
|
+
})).trim();
|
|
68
|
+
const readSecretAccessKey = this.ensurePromptValue(await password({
|
|
69
|
+
message: 'Read secret access key',
|
|
70
|
+
validate(value) {
|
|
71
|
+
return value ? undefined : 'Read secret access key is required';
|
|
72
|
+
},
|
|
73
|
+
})).trim();
|
|
74
|
+
const writeAccessKeyId = this.ensurePromptValue(await text({
|
|
75
|
+
message: 'Write access key ID',
|
|
76
|
+
validate(value) {
|
|
77
|
+
return value ? undefined : 'Write access key ID is required';
|
|
78
|
+
},
|
|
79
|
+
})).trim();
|
|
80
|
+
const writeSecretAccessKey = this.ensurePromptValue(await password({
|
|
81
|
+
message: 'Write secret access key',
|
|
82
|
+
validate(value) {
|
|
83
|
+
return value ? undefined : 'Write secret access key is required';
|
|
84
|
+
},
|
|
85
|
+
})).trim();
|
|
86
|
+
return {
|
|
87
|
+
readAccessKeyId,
|
|
88
|
+
readSecretAccessKey,
|
|
89
|
+
region,
|
|
90
|
+
writeAccessKeyId,
|
|
91
|
+
writeSecretAccessKey,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async promptStoragePayload() {
|
|
95
|
+
const storageType = this.ensurePromptValue(await select({
|
|
96
|
+
message: 'Select storage type',
|
|
97
|
+
options: [
|
|
98
|
+
{ label: 'Amazon S3', value: StorageType.S3 },
|
|
99
|
+
{ label: 'StorJ', value: StorageType.StorJ },
|
|
100
|
+
],
|
|
101
|
+
}));
|
|
102
|
+
const bucket = this.ensurePromptValue(await text({
|
|
103
|
+
message: 'Bucket name',
|
|
104
|
+
validate(value) {
|
|
105
|
+
return value ? undefined : 'Bucket is required';
|
|
106
|
+
},
|
|
107
|
+
})).trim();
|
|
108
|
+
const prefix = this.ensurePromptValue(await text({
|
|
109
|
+
defaultValue: '/',
|
|
110
|
+
message: 'Prefix',
|
|
111
|
+
validate(value) {
|
|
112
|
+
return value ? undefined : 'Prefix is required';
|
|
113
|
+
},
|
|
114
|
+
})).trim();
|
|
115
|
+
const storage = {
|
|
116
|
+
bucket,
|
|
117
|
+
prefix,
|
|
118
|
+
storageType,
|
|
119
|
+
};
|
|
120
|
+
if (storageType === StorageType.S3) {
|
|
121
|
+
storage.s3Credentials = await this.promptS3Credentials();
|
|
122
|
+
}
|
|
123
|
+
if (storageType === StorageType.StorJ) {
|
|
124
|
+
storage.storjCredentials = await this.promptStorJCredentials();
|
|
125
|
+
}
|
|
126
|
+
return storage;
|
|
127
|
+
}
|
|
128
|
+
async promptStorJCredentials() {
|
|
129
|
+
const readAccessToken = this.ensurePromptValue(await password({
|
|
130
|
+
message: 'Read access token',
|
|
131
|
+
validate(value) {
|
|
132
|
+
return value ? undefined : 'Read access token is required';
|
|
133
|
+
},
|
|
134
|
+
})).trim();
|
|
135
|
+
const writeAccessToken = this.ensurePromptValue(await password({
|
|
136
|
+
message: 'Write access token',
|
|
137
|
+
validate(value) {
|
|
138
|
+
return value ? undefined : 'Write access token is required';
|
|
139
|
+
},
|
|
140
|
+
})).trim();
|
|
141
|
+
return {
|
|
142
|
+
readAccessToken,
|
|
143
|
+
writeAccessToken,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
validateStoragePayload(payload) {
|
|
147
|
+
if (!payload || typeof payload !== 'object') {
|
|
148
|
+
this.error('Storage definition must be an object');
|
|
149
|
+
}
|
|
150
|
+
if (!payload.bucket) {
|
|
151
|
+
this.error('Storage definition missing "bucket"');
|
|
152
|
+
}
|
|
153
|
+
if (!payload.prefix) {
|
|
154
|
+
this.error('Storage definition missing "prefix"');
|
|
155
|
+
}
|
|
156
|
+
if (!payload.storageType) {
|
|
157
|
+
this.error('Storage definition missing "storageType"');
|
|
158
|
+
}
|
|
159
|
+
if (!Object.values(StorageType).includes(payload.storageType)) {
|
|
160
|
+
this.error(`Unsupported storage type: ${payload.storageType}`);
|
|
161
|
+
}
|
|
162
|
+
if (payload.storageType === StorageType.S3 && !payload.s3Credentials) {
|
|
163
|
+
this.error('S3 storage requires "s3Credentials"');
|
|
164
|
+
}
|
|
165
|
+
if (payload.storageType === StorageType.StorJ && !payload.storjCredentials) {
|
|
166
|
+
this.error('StorJ storage requires "storjCredentials"');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseStorageCommand } from './base.js';
|
|
2
|
+
export default class StorageSelect extends BaseStorageCommand<typeof StorageSelect> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { select } from '@clack/prompts';
|
|
2
|
+
import { Flags } from '@oclif/core';
|
|
3
|
+
import { StoragesEmptyError } from '../../services/storage.service.js';
|
|
4
|
+
import { BaseStorageCommand } from './base.js';
|
|
5
|
+
export default class StorageSelect extends BaseStorageCommand {
|
|
6
|
+
static description = 'Select a storage that will be used by subsequent commands.';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> storage select',
|
|
9
|
+
'<%= config.bin %> storage select --id=2de3e3a4-0000-1111-2222-333344445555',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
id: Flags.string({
|
|
13
|
+
char: 'i',
|
|
14
|
+
description: 'Storage ID to select',
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { flags } = await this.parse(StorageSelect);
|
|
19
|
+
try {
|
|
20
|
+
let storageId = flags.id;
|
|
21
|
+
if (!storageId) {
|
|
22
|
+
const storages = await this.storageService.requestStorages();
|
|
23
|
+
storageId = this.ensurePromptValue(await select({
|
|
24
|
+
message: 'Select storage',
|
|
25
|
+
options: storages.map(storage => ({
|
|
26
|
+
label: `${storage.id} (${storage.storageType}) ${storage.bucket}/${storage.prefix} `,
|
|
27
|
+
value: storage.id,
|
|
28
|
+
})),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
if (!storageId) {
|
|
32
|
+
this.error('Storage ID is required');
|
|
33
|
+
}
|
|
34
|
+
await this.storageService.saveStorage(storageId);
|
|
35
|
+
this.log(`Selected storage: ${storageId}`);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error instanceof StoragesEmptyError) {
|
|
39
|
+
this.error('No storages available. Run "sp storage create" first.');
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.error(error instanceof Error ? error.message : String(error));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseStorageCommand } from './base.js';
|
|
2
|
+
export default class StorageUpdate extends BaseStorageCommand<typeof StorageUpdate> {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
fromFile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
private ensureNonEmptyString;
|
|
11
|
+
private ensureUpdatePayload;
|
|
12
|
+
private loadStorageFromFile;
|
|
13
|
+
private promptS3Credentials;
|
|
14
|
+
private promptStorageUpdate;
|
|
15
|
+
private promptStorJCredentials;
|
|
16
|
+
}
|