@qodalis/cli-server-plugin-aws 0.0.0-stage → 1.0.0-beta.13
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/LICENSE +21 -0
- package/README.md +155 -2
- package/dist/aws-command-processor.d.ts +19 -0
- package/dist/aws-command-processor.d.ts.map +1 -0
- package/dist/aws-command-processor.js +265 -0
- package/dist/aws-command-processor.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/processors/cloudwatch-processor.d.ts +12 -0
- package/dist/processors/cloudwatch-processor.d.ts.map +1 -0
- package/dist/processors/cloudwatch-processor.js +168 -0
- package/dist/processors/cloudwatch-processor.js.map +1 -0
- package/dist/processors/dynamodb-processor.d.ts +12 -0
- package/dist/processors/dynamodb-processor.d.ts.map +1 -0
- package/dist/processors/dynamodb-processor.js +201 -0
- package/dist/processors/dynamodb-processor.js.map +1 -0
- package/dist/processors/ec2-processor.d.ts +12 -0
- package/dist/processors/ec2-processor.d.ts.map +1 -0
- package/dist/processors/ec2-processor.js +305 -0
- package/dist/processors/ec2-processor.js.map +1 -0
- package/dist/processors/ecs-processor.d.ts +12 -0
- package/dist/processors/ecs-processor.d.ts.map +1 -0
- package/dist/processors/ecs-processor.js +169 -0
- package/dist/processors/ecs-processor.js.map +1 -0
- package/dist/processors/iam-processor.d.ts +12 -0
- package/dist/processors/iam-processor.d.ts.map +1 -0
- package/dist/processors/iam-processor.js +151 -0
- package/dist/processors/iam-processor.js.map +1 -0
- package/dist/processors/lambda-processor.d.ts +12 -0
- package/dist/processors/lambda-processor.d.ts.map +1 -0
- package/dist/processors/lambda-processor.js +187 -0
- package/dist/processors/lambda-processor.js.map +1 -0
- package/dist/processors/s3-processor.d.ts +27 -0
- package/dist/processors/s3-processor.d.ts.map +1 -0
- package/dist/processors/s3-processor.js +345 -0
- package/dist/processors/s3-processor.js.map +1 -0
- package/dist/processors/sns-processor.d.ts +12 -0
- package/dist/processors/sns-processor.d.ts.map +1 -0
- package/dist/processors/sns-processor.js +157 -0
- package/dist/processors/sns-processor.js.map +1 -0
- package/dist/processors/sqs-processor.d.ts +12 -0
- package/dist/processors/sqs-processor.d.ts.map +1 -0
- package/dist/processors/sqs-processor.js +191 -0
- package/dist/processors/sqs-processor.js.map +1 -0
- package/dist/services/aws-config-service.d.ts +50 -0
- package/dist/services/aws-config-service.d.ts.map +1 -0
- package/dist/services/aws-config-service.js +61 -0
- package/dist/services/aws-config-service.js.map +1 -0
- package/dist/services/aws-credential-manager.d.ts +29 -0
- package/dist/services/aws-credential-manager.d.ts.map +1 -0
- package/dist/services/aws-credential-manager.js +50 -0
- package/dist/services/aws-credential-manager.js.map +1 -0
- package/dist/utils/output-helpers.d.ts +68 -0
- package/dist/utils/output-helpers.d.ts.map +1 -0
- package/dist/utils/output-helpers.js +107 -0
- package/dist/utils/output-helpers.js.map +1 -0
- package/dist/utils/pagination.d.ts +9 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +21 -0
- package/dist/utils/pagination.js.map +1 -0
- package/package.json +51 -5
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AwsS3Processor = void 0;
|
|
4
|
+
exports.parseS3Uri = parseS3Uri;
|
|
5
|
+
exports.formatBytes = formatBytes;
|
|
6
|
+
const cli_server_abstractions_1 = require("@qodalis/cli-server-abstractions");
|
|
7
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
8
|
+
const s3_request_presigner_1 = require("@aws-sdk/s3-request-presigner");
|
|
9
|
+
const output_helpers_1 = require("../utils/output-helpers");
|
|
10
|
+
const pagination_1 = require("../utils/pagination");
|
|
11
|
+
/**
|
|
12
|
+
* Parses an S3 URI (s3://bucket/key) into its bucket and key components.
|
|
13
|
+
* @param uri - The S3 URI to parse.
|
|
14
|
+
* @returns An object with `bucket` and `key` properties, or `null` if the URI is invalid.
|
|
15
|
+
*/
|
|
16
|
+
function parseS3Uri(uri) {
|
|
17
|
+
const match = uri.match(/^s3:\/\/([^/]+)\/?(.*)$/);
|
|
18
|
+
if (!match)
|
|
19
|
+
return null;
|
|
20
|
+
return { bucket: match[1], key: match[2] };
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Formats a byte count into a human-readable string (e.g., '1.5 MB').
|
|
24
|
+
* @param bytes - The number of bytes.
|
|
25
|
+
* @returns A formatted string with the appropriate unit.
|
|
26
|
+
*/
|
|
27
|
+
function formatBytes(bytes) {
|
|
28
|
+
if (bytes === 0)
|
|
29
|
+
return '0 B';
|
|
30
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
31
|
+
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
32
|
+
return `${(bytes / Math.pow(1024, i)).toFixed(1)} ${units[i]}`;
|
|
33
|
+
}
|
|
34
|
+
/** Sub-processor that lists S3 buckets or objects within a bucket. */
|
|
35
|
+
class S3LsProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
36
|
+
credentialManager;
|
|
37
|
+
command = 'ls';
|
|
38
|
+
description = 'List S3 buckets or objects in a bucket';
|
|
39
|
+
valueRequired = false;
|
|
40
|
+
acceptsValue = true;
|
|
41
|
+
parameters = [
|
|
42
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
43
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('output', 'Output format (table|json|text)', false, 'string', ['-o'], 'table'),
|
|
44
|
+
];
|
|
45
|
+
constructor(credentialManager) {
|
|
46
|
+
super();
|
|
47
|
+
this.credentialManager = credentialManager;
|
|
48
|
+
}
|
|
49
|
+
/** @inheritdoc */
|
|
50
|
+
async handleAsync() {
|
|
51
|
+
return '';
|
|
52
|
+
}
|
|
53
|
+
/** @inheritdoc */
|
|
54
|
+
async handleStructuredAsync(command) {
|
|
55
|
+
const client = this.credentialManager.getClient(client_s3_1.S3Client, {
|
|
56
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
57
|
+
});
|
|
58
|
+
const value = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
59
|
+
if (!value) {
|
|
60
|
+
try {
|
|
61
|
+
const response = await client.send(new client_s3_1.ListBucketsCommand({}));
|
|
62
|
+
const buckets = response.Buckets ?? [];
|
|
63
|
+
if (buckets.length === 0) {
|
|
64
|
+
return (0, output_helpers_1.buildResponse)([{ type: 'text', value: 'No buckets found.', style: 'warning' }]);
|
|
65
|
+
}
|
|
66
|
+
const items = buckets.map((b) => {
|
|
67
|
+
const date = b.CreationDate ? b.CreationDate.toISOString().slice(0, 10) : '(unknown)';
|
|
68
|
+
return `${date} ${b.Name}`;
|
|
69
|
+
});
|
|
70
|
+
const defaultOutput = (0, output_helpers_1.formatAsList)(items);
|
|
71
|
+
return (0, output_helpers_1.buildResponse)([(0, output_helpers_1.applyOutputFormat)(command, defaultOutput, buckets)]);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to list buckets: ${err.message ?? err}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const parsed = parseS3Uri(value);
|
|
78
|
+
if (!parsed) {
|
|
79
|
+
return (0, output_helpers_1.buildErrorResponse)(`Invalid S3 URI: "${value}". Expected format: s3://bucket[/prefix]`);
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const paginator = (0, client_s3_1.paginateListObjectsV2)({ client }, { Bucket: parsed.bucket, Prefix: parsed.key || undefined });
|
|
83
|
+
const objects = await (0, pagination_1.paginateAll)(paginator, (page) => page.Contents ?? []);
|
|
84
|
+
if (objects.length === 0) {
|
|
85
|
+
return (0, output_helpers_1.buildResponse)([{ type: 'text', value: `No objects found in s3://${parsed.bucket}/${parsed.key || ''}`, style: 'warning' }]);
|
|
86
|
+
}
|
|
87
|
+
const rows = objects.map((obj) => {
|
|
88
|
+
const date = obj.LastModified ? obj.LastModified.toISOString().slice(0, 19).replace('T', ' ') : '(unknown)';
|
|
89
|
+
const size = obj.Size !== undefined ? formatBytes(obj.Size) : '0 B';
|
|
90
|
+
return [date, size, obj.Key ?? ''];
|
|
91
|
+
});
|
|
92
|
+
const tableOutput = (0, output_helpers_1.formatAsTable)(['Last Modified', 'Size', 'Key'], rows);
|
|
93
|
+
return (0, output_helpers_1.buildResponse)([(0, output_helpers_1.applyOutputFormat)(command, tableOutput, objects)]);
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to list objects: ${err.message ?? err}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** Sub-processor that copies objects between S3 locations (S3-to-S3 only). */
|
|
101
|
+
class S3CpProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
102
|
+
credentialManager;
|
|
103
|
+
command = 'cp';
|
|
104
|
+
description = 'Copy objects between S3 locations (S3-to-S3 only)';
|
|
105
|
+
valueRequired = true;
|
|
106
|
+
parameters = [
|
|
107
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('dest', 'Destination S3 URI (s3://bucket/key)', true, 'string', ['-d']),
|
|
108
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
109
|
+
];
|
|
110
|
+
constructor(credentialManager) {
|
|
111
|
+
super();
|
|
112
|
+
this.credentialManager = credentialManager;
|
|
113
|
+
}
|
|
114
|
+
/** @inheritdoc */
|
|
115
|
+
async handleAsync() {
|
|
116
|
+
return '';
|
|
117
|
+
}
|
|
118
|
+
/** @inheritdoc */
|
|
119
|
+
async handleStructuredAsync(command) {
|
|
120
|
+
const source = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
121
|
+
const dest = command.args?.dest;
|
|
122
|
+
if (!source) {
|
|
123
|
+
return (0, output_helpers_1.buildErrorResponse)('Source S3 URI is required. Usage: s3 cp <s3://bucket/key> --dest <s3://bucket/key>');
|
|
124
|
+
}
|
|
125
|
+
if (!dest) {
|
|
126
|
+
return (0, output_helpers_1.buildErrorResponse)('Destination is required. Use --dest <s3://bucket/key>.');
|
|
127
|
+
}
|
|
128
|
+
const srcParsed = parseS3Uri(source);
|
|
129
|
+
if (!srcParsed || !srcParsed.key) {
|
|
130
|
+
return (0, output_helpers_1.buildErrorResponse)(`Invalid source S3 URI: "${source}". Expected format: s3://bucket/key`);
|
|
131
|
+
}
|
|
132
|
+
const dstParsed = parseS3Uri(dest);
|
|
133
|
+
if (!dstParsed || !dstParsed.key) {
|
|
134
|
+
return (0, output_helpers_1.buildErrorResponse)(`Invalid destination S3 URI: "${dest}". Expected format: s3://bucket/key`);
|
|
135
|
+
}
|
|
136
|
+
const client = this.credentialManager.getClient(client_s3_1.S3Client, {
|
|
137
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
138
|
+
});
|
|
139
|
+
try {
|
|
140
|
+
await client.send(new client_s3_1.CopyObjectCommand({
|
|
141
|
+
Bucket: dstParsed.bucket,
|
|
142
|
+
Key: dstParsed.key,
|
|
143
|
+
CopySource: `${srcParsed.bucket}/${srcParsed.key}`,
|
|
144
|
+
}));
|
|
145
|
+
return (0, output_helpers_1.buildSuccessResponse)(`Copied ${source} to ${dest}`);
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to copy object: ${err.message ?? err}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** Sub-processor that deletes an S3 object, with optional dry-run support. */
|
|
153
|
+
class S3RmProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
154
|
+
credentialManager;
|
|
155
|
+
command = 'rm';
|
|
156
|
+
description = 'Delete an S3 object';
|
|
157
|
+
valueRequired = true;
|
|
158
|
+
parameters = [
|
|
159
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('dry-run', 'Preview without deleting', false, 'boolean'),
|
|
160
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
161
|
+
];
|
|
162
|
+
constructor(credentialManager) {
|
|
163
|
+
super();
|
|
164
|
+
this.credentialManager = credentialManager;
|
|
165
|
+
}
|
|
166
|
+
/** @inheritdoc */
|
|
167
|
+
async handleAsync() {
|
|
168
|
+
return '';
|
|
169
|
+
}
|
|
170
|
+
/** @inheritdoc */
|
|
171
|
+
async handleStructuredAsync(command) {
|
|
172
|
+
const value = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
173
|
+
if (!value) {
|
|
174
|
+
return (0, output_helpers_1.buildErrorResponse)('S3 URI is required. Usage: s3 rm <s3://bucket/key>');
|
|
175
|
+
}
|
|
176
|
+
const parsed = parseS3Uri(value);
|
|
177
|
+
if (!parsed || !parsed.key) {
|
|
178
|
+
return (0, output_helpers_1.buildErrorResponse)(`Invalid S3 URI: "${value}". Expected format: s3://bucket/key`);
|
|
179
|
+
}
|
|
180
|
+
if ((0, output_helpers_1.isDryRun)(command)) {
|
|
181
|
+
return (0, output_helpers_1.buildResponse)([
|
|
182
|
+
{ type: 'text', value: `[DRY RUN] Would delete ${value}`, style: 'warning' },
|
|
183
|
+
]);
|
|
184
|
+
}
|
|
185
|
+
const client = this.credentialManager.getClient(client_s3_1.S3Client, {
|
|
186
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
187
|
+
});
|
|
188
|
+
try {
|
|
189
|
+
await client.send(new client_s3_1.DeleteObjectCommand({
|
|
190
|
+
Bucket: parsed.bucket,
|
|
191
|
+
Key: parsed.key,
|
|
192
|
+
}));
|
|
193
|
+
return (0, output_helpers_1.buildSuccessResponse)(`Deleted ${value}`);
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to delete object: ${err.message ?? err}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/** Sub-processor that creates a new S3 bucket. */
|
|
201
|
+
class S3MbProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
202
|
+
credentialManager;
|
|
203
|
+
command = 'mb';
|
|
204
|
+
description = 'Create an S3 bucket';
|
|
205
|
+
valueRequired = true;
|
|
206
|
+
parameters = [
|
|
207
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
208
|
+
];
|
|
209
|
+
constructor(credentialManager) {
|
|
210
|
+
super();
|
|
211
|
+
this.credentialManager = credentialManager;
|
|
212
|
+
}
|
|
213
|
+
/** @inheritdoc */
|
|
214
|
+
async handleAsync() {
|
|
215
|
+
return '';
|
|
216
|
+
}
|
|
217
|
+
/** @inheritdoc */
|
|
218
|
+
async handleStructuredAsync(command) {
|
|
219
|
+
const bucketName = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
220
|
+
if (!bucketName) {
|
|
221
|
+
return (0, output_helpers_1.buildErrorResponse)('Bucket name is required. Usage: s3 mb <bucket-name>');
|
|
222
|
+
}
|
|
223
|
+
const client = this.credentialManager.getClient(client_s3_1.S3Client, {
|
|
224
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
225
|
+
});
|
|
226
|
+
try {
|
|
227
|
+
await client.send(new client_s3_1.CreateBucketCommand({ Bucket: bucketName }));
|
|
228
|
+
return (0, output_helpers_1.buildSuccessResponse)(`Bucket "${bucketName}" created successfully.`);
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to create bucket: ${err.message ?? err}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/** Sub-processor that deletes an S3 bucket, with optional dry-run support. */
|
|
236
|
+
class S3RbProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
237
|
+
credentialManager;
|
|
238
|
+
command = 'rb';
|
|
239
|
+
description = 'Delete an S3 bucket';
|
|
240
|
+
valueRequired = true;
|
|
241
|
+
parameters = [
|
|
242
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('dry-run', 'Preview without deleting', false, 'boolean'),
|
|
243
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
244
|
+
];
|
|
245
|
+
constructor(credentialManager) {
|
|
246
|
+
super();
|
|
247
|
+
this.credentialManager = credentialManager;
|
|
248
|
+
}
|
|
249
|
+
/** @inheritdoc */
|
|
250
|
+
async handleAsync() {
|
|
251
|
+
return '';
|
|
252
|
+
}
|
|
253
|
+
/** @inheritdoc */
|
|
254
|
+
async handleStructuredAsync(command) {
|
|
255
|
+
const bucketName = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
256
|
+
if (!bucketName) {
|
|
257
|
+
return (0, output_helpers_1.buildErrorResponse)('Bucket name is required. Usage: s3 rb <bucket-name>');
|
|
258
|
+
}
|
|
259
|
+
if ((0, output_helpers_1.isDryRun)(command)) {
|
|
260
|
+
return (0, output_helpers_1.buildResponse)([
|
|
261
|
+
{ type: 'text', value: `[DRY RUN] Would delete bucket "${bucketName}"`, style: 'warning' },
|
|
262
|
+
]);
|
|
263
|
+
}
|
|
264
|
+
const client = this.credentialManager.getClient(client_s3_1.S3Client, {
|
|
265
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
266
|
+
});
|
|
267
|
+
try {
|
|
268
|
+
await client.send(new client_s3_1.DeleteBucketCommand({ Bucket: bucketName }));
|
|
269
|
+
return (0, output_helpers_1.buildSuccessResponse)(`Bucket "${bucketName}" deleted successfully.`);
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to delete bucket: ${err.message ?? err}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/** Sub-processor that generates a pre-signed URL for an S3 object. */
|
|
277
|
+
class S3PresignProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
278
|
+
credentialManager;
|
|
279
|
+
command = 'presign';
|
|
280
|
+
description = 'Generate a pre-signed URL for an S3 object';
|
|
281
|
+
valueRequired = true;
|
|
282
|
+
parameters = [
|
|
283
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('expires', 'URL expiration in seconds (default: 3600)', false, 'number', ['-e'], '3600'),
|
|
284
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
285
|
+
];
|
|
286
|
+
constructor(credentialManager) {
|
|
287
|
+
super();
|
|
288
|
+
this.credentialManager = credentialManager;
|
|
289
|
+
}
|
|
290
|
+
/** @inheritdoc */
|
|
291
|
+
async handleAsync() {
|
|
292
|
+
return '';
|
|
293
|
+
}
|
|
294
|
+
/** @inheritdoc */
|
|
295
|
+
async handleStructuredAsync(command) {
|
|
296
|
+
const value = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
297
|
+
if (!value) {
|
|
298
|
+
return (0, output_helpers_1.buildErrorResponse)('S3 URI is required. Usage: s3 presign <s3://bucket/key>');
|
|
299
|
+
}
|
|
300
|
+
const parsed = parseS3Uri(value);
|
|
301
|
+
if (!parsed || !parsed.key) {
|
|
302
|
+
return (0, output_helpers_1.buildErrorResponse)(`Invalid S3 URI: "${value}". Expected format: s3://bucket/key`);
|
|
303
|
+
}
|
|
304
|
+
const expiresIn = command.args?.expires ? Number(command.args.expires) : 3600;
|
|
305
|
+
if (isNaN(expiresIn) || expiresIn <= 0) {
|
|
306
|
+
return (0, output_helpers_1.buildErrorResponse)('--expires must be a positive number of seconds.');
|
|
307
|
+
}
|
|
308
|
+
const client = this.credentialManager.getClient(client_s3_1.S3Client, {
|
|
309
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
310
|
+
});
|
|
311
|
+
try {
|
|
312
|
+
const url = await (0, s3_request_presigner_1.getSignedUrl)(client, new client_s3_1.GetObjectCommand({ Bucket: parsed.bucket, Key: parsed.key }), { expiresIn });
|
|
313
|
+
return (0, output_helpers_1.buildResponse)([
|
|
314
|
+
{ type: 'text', value: url },
|
|
315
|
+
{ type: 'text', value: `Expires in ${expiresIn} seconds.`, style: 'info' },
|
|
316
|
+
]);
|
|
317
|
+
}
|
|
318
|
+
catch (err) {
|
|
319
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to generate pre-signed URL: ${err.message ?? err}`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/** Parent processor for S3 sub-commands (ls, cp, rm, mb, rb, presign). */
|
|
324
|
+
class AwsS3Processor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
325
|
+
command = 's3';
|
|
326
|
+
description = 'Amazon S3 operations — list, copy, remove objects and buckets';
|
|
327
|
+
processors;
|
|
328
|
+
constructor(credentialManager) {
|
|
329
|
+
super();
|
|
330
|
+
this.processors = [
|
|
331
|
+
new S3LsProcessor(credentialManager),
|
|
332
|
+
new S3CpProcessor(credentialManager),
|
|
333
|
+
new S3RmProcessor(credentialManager),
|
|
334
|
+
new S3MbProcessor(credentialManager),
|
|
335
|
+
new S3RbProcessor(credentialManager),
|
|
336
|
+
new S3PresignProcessor(credentialManager),
|
|
337
|
+
];
|
|
338
|
+
}
|
|
339
|
+
/** @inheritdoc */
|
|
340
|
+
async handleAsync() {
|
|
341
|
+
return '';
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
exports.AwsS3Processor = AwsS3Processor;
|
|
345
|
+
//# sourceMappingURL=s3-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-processor.js","sourceRoot":"","sources":["../../src/processors/s3-processor.ts"],"names":[],"mappings":";;;AAoCA,gCAIC;AAOD,kCAKC;AApDD,8EAO0C;AAC1C,kDAS4B;AAC5B,wEAA6D;AAE7D,4DAQiC;AACjC,oDAAkD;AAElD;;;;GAIG;AACH,SAAgB,UAAU,C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C;YACpC,IAAI,kBAAkB,CAAC,iBAAiB,CAAC;SAC5C,CAAC;IACN,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,WAAW;QACb,OAAO,EAAE,CAAC;IACd,CAAC;CACJ;AArBD,wCAqBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CliCommandProcessor, ICliCommandProcessor } from '@qodalis/cli-server-abstractions';
|
|
2
|
+
import { AwsCredentialManager } from '../services/aws-credential-manager';
|
|
3
|
+
/** Parent processor for SNS sub-commands (topics, publish, subscriptions). */
|
|
4
|
+
export declare class AwsSnsProcessor extends CliCommandProcessor {
|
|
5
|
+
command: string;
|
|
6
|
+
description: string;
|
|
7
|
+
processors: ICliCommandProcessor[];
|
|
8
|
+
constructor(credentialManager: AwsCredentialManager);
|
|
9
|
+
/** @inheritdoc */
|
|
10
|
+
handleAsync(): Promise<string>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=sns-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sns-processor.d.ts","sourceRoot":"","sources":["../../src/processors/sns-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EAInB,oBAAoB,EAEvB,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAgK1E,8EAA8E;AAC9E,qBAAa,eAAgB,SAAQ,mBAAmB;IACpD,OAAO,SAAS;IAChB,WAAW,SAAyD;IACpE,UAAU,EAAE,oBAAoB,EAAE,CAAC;gBAEvB,iBAAiB,EAAE,oBAAoB;IASnD,kBAAkB;IACZ,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;CAGvC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AwsSnsProcessor = void 0;
|
|
4
|
+
const cli_server_abstractions_1 = require("@qodalis/cli-server-abstractions");
|
|
5
|
+
const client_sns_1 = require("@aws-sdk/client-sns");
|
|
6
|
+
const output_helpers_1 = require("../utils/output-helpers");
|
|
7
|
+
/** Sub-processor that lists SNS topics. */
|
|
8
|
+
class SnsTopicsProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
9
|
+
credentialManager;
|
|
10
|
+
command = 'topics';
|
|
11
|
+
description = 'List SNS topics';
|
|
12
|
+
parameters = [
|
|
13
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
14
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('output', 'Output format (table|json|text)', false, 'string', ['-o'], 'table'),
|
|
15
|
+
];
|
|
16
|
+
constructor(credentialManager) {
|
|
17
|
+
super();
|
|
18
|
+
this.credentialManager = credentialManager;
|
|
19
|
+
}
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
async handleAsync() {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
/** @inheritdoc */
|
|
25
|
+
async handleStructuredAsync(command) {
|
|
26
|
+
const client = this.credentialManager.getClient(client_sns_1.SNSClient, {
|
|
27
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
28
|
+
});
|
|
29
|
+
try {
|
|
30
|
+
const response = await client.send(new client_sns_1.ListTopicsCommand({}));
|
|
31
|
+
const topics = response.Topics ?? [];
|
|
32
|
+
if (topics.length === 0) {
|
|
33
|
+
return (0, output_helpers_1.buildResponse)([{ type: 'text', value: 'No SNS topics found.', style: 'warning' }]);
|
|
34
|
+
}
|
|
35
|
+
const arns = topics.map((t) => t.TopicArn ?? '(unknown)');
|
|
36
|
+
const listOutput = (0, output_helpers_1.formatAsList)(arns);
|
|
37
|
+
return (0, output_helpers_1.buildResponse)([(0, output_helpers_1.applyOutputFormat)(command, listOutput, topics)]);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to list SNS topics: ${err.message ?? err}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Sub-processor that publishes a message to an SNS topic. */
|
|
45
|
+
class SnsPublishProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
46
|
+
credentialManager;
|
|
47
|
+
command = 'publish';
|
|
48
|
+
description = 'Publish a message to an SNS topic';
|
|
49
|
+
valueRequired = true;
|
|
50
|
+
parameters = [
|
|
51
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('message', 'Message to publish', true, 'string', ['-m']),
|
|
52
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
53
|
+
];
|
|
54
|
+
constructor(credentialManager) {
|
|
55
|
+
super();
|
|
56
|
+
this.credentialManager = credentialManager;
|
|
57
|
+
}
|
|
58
|
+
/** @inheritdoc */
|
|
59
|
+
async handleAsync() {
|
|
60
|
+
return '';
|
|
61
|
+
}
|
|
62
|
+
/** @inheritdoc */
|
|
63
|
+
async handleStructuredAsync(command) {
|
|
64
|
+
const topicArn = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
65
|
+
if (!topicArn) {
|
|
66
|
+
return (0, output_helpers_1.buildErrorResponse)('Topic ARN is required. Usage: sns publish <topic-arn> --message <message>');
|
|
67
|
+
}
|
|
68
|
+
const message = command.args?.message;
|
|
69
|
+
if (!message) {
|
|
70
|
+
return (0, output_helpers_1.buildErrorResponse)('--message is required. Usage: sns publish <topic-arn> --message <message>');
|
|
71
|
+
}
|
|
72
|
+
const client = this.credentialManager.getClient(client_sns_1.SNSClient, {
|
|
73
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
74
|
+
});
|
|
75
|
+
try {
|
|
76
|
+
const response = await client.send(new client_sns_1.PublishCommand({
|
|
77
|
+
TopicArn: topicArn,
|
|
78
|
+
Message: message,
|
|
79
|
+
}));
|
|
80
|
+
return (0, output_helpers_1.buildSuccessResponse)(`Message published successfully. MessageId: ${response.MessageId ?? '(unknown)'}`);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to publish message: ${err.message ?? err}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Sub-processor that lists SNS subscriptions, optionally filtered by topic ARN. */
|
|
88
|
+
class SnsSubscriptionsProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
89
|
+
credentialManager;
|
|
90
|
+
command = 'subscriptions';
|
|
91
|
+
acceptsValue = true;
|
|
92
|
+
description = 'List SNS subscriptions (optionally filtered by topic ARN)';
|
|
93
|
+
parameters = [
|
|
94
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('region', 'AWS region override', false, 'string', ['-r']),
|
|
95
|
+
new cli_server_abstractions_1.CliCommandParameterDescriptor('output', 'Output format (table|json|text)', false, 'string', ['-o'], 'table'),
|
|
96
|
+
];
|
|
97
|
+
constructor(credentialManager) {
|
|
98
|
+
super();
|
|
99
|
+
this.credentialManager = credentialManager;
|
|
100
|
+
}
|
|
101
|
+
/** @inheritdoc */
|
|
102
|
+
async handleAsync() {
|
|
103
|
+
return '';
|
|
104
|
+
}
|
|
105
|
+
/** @inheritdoc */
|
|
106
|
+
async handleStructuredAsync(command) {
|
|
107
|
+
const topicArn = (0, cli_server_abstractions_1.getPositionalText)(command);
|
|
108
|
+
const client = this.credentialManager.getClient(client_sns_1.SNSClient, {
|
|
109
|
+
region: command.args?.region ? String(command.args.region) : undefined,
|
|
110
|
+
});
|
|
111
|
+
try {
|
|
112
|
+
let subscriptions;
|
|
113
|
+
if (topicArn) {
|
|
114
|
+
const response = await client.send(new client_sns_1.ListSubscriptionsByTopicCommand({ TopicArn: topicArn }));
|
|
115
|
+
subscriptions = response.Subscriptions ?? [];
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const response = await client.send(new client_sns_1.ListSubscriptionsCommand({}));
|
|
119
|
+
subscriptions = response.Subscriptions ?? [];
|
|
120
|
+
}
|
|
121
|
+
if (subscriptions.length === 0) {
|
|
122
|
+
return (0, output_helpers_1.buildResponse)([{ type: 'text', value: 'No SNS subscriptions found.', style: 'warning' }]);
|
|
123
|
+
}
|
|
124
|
+
const rows = subscriptions.map((sub) => [
|
|
125
|
+
sub.SubscriptionArn ?? '(unknown)',
|
|
126
|
+
sub.Protocol ?? '(unknown)',
|
|
127
|
+
sub.Endpoint ?? '(unknown)',
|
|
128
|
+
sub.TopicArn ?? '(unknown)',
|
|
129
|
+
]);
|
|
130
|
+
const tableOutput = (0, output_helpers_1.formatAsTable)(['SubscriptionArn', 'Protocol', 'Endpoint', 'TopicArn'], rows);
|
|
131
|
+
return (0, output_helpers_1.buildResponse)([(0, output_helpers_1.applyOutputFormat)(command, tableOutput, subscriptions)]);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
return (0, output_helpers_1.buildErrorResponse)(`Failed to list SNS subscriptions: ${err.message ?? err}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Parent processor for SNS sub-commands (topics, publish, subscriptions). */
|
|
139
|
+
class AwsSnsProcessor extends cli_server_abstractions_1.CliCommandProcessor {
|
|
140
|
+
command = 'sns';
|
|
141
|
+
description = 'AWS SNS operations — topics, publish, subscriptions';
|
|
142
|
+
processors;
|
|
143
|
+
constructor(credentialManager) {
|
|
144
|
+
super();
|
|
145
|
+
this.processors = [
|
|
146
|
+
new SnsTopicsProcessor(credentialManager),
|
|
147
|
+
new SnsPublishProcessor(credentialManager),
|
|
148
|
+
new SnsSubscriptionsProcessor(credentialManager),
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
/** @inheritdoc */
|
|
152
|
+
async handleAsync() {
|
|
153
|
+
return '';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.AwsSnsProcessor = AwsSnsProcessor;
|
|
157
|
+
//# sourceMappingURL=sns-processor.js.map
|
|
@@ -0,0 +1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2
|
+
import { AwsCredentialManager } from '../services/aws-credential-manager';
|
|
3
|
+
/** Parent processor for SQS sub-commands (list, send, receive, purge). */
|
|
4
|
+
export declare class AwsSqsProcessor extends CliCommandProcessor {
|
|
5
|
+
command: string;
|
|
6
|
+
description: string;
|
|
7
|
+
processors: ICliCommandProcessor[];
|
|
8
|
+
constructor(credentialManager: AwsCredentialManager);
|
|
9
|
+
/** @inheritdoc */
|
|
10
|
+
handleAsync(): Promise<string>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=sqs-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqs-processor.d.ts","sourceRoot":"","sources":["../../src/processors/sqs-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EAInB,oBAAoB,EAEvB,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAuM1E,0EAA0E;AAC1E,qBAAa,eAAgB,SAAQ,mBAAmB;IACpD,OAAO,SAAS;IAChB,WAAW,SAAqD;IAChE,UAAU,EAAE,oBAAoB,EAAE,CAAC;gBAEvB,iBAAiB,EAAE,oBAAoB;IAUnD,kBAAkB;IACZ,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;CAGvC"}
|