@onivoro/app-server-bucketvore 24.31.1
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/assets/.gitkeep +1 -0
- package/main.js +2852 -0
- package/package.json +50 -0
- package/src/index.d.ts +7 -0
- package/src/index.js +23 -0
package/main.js
ADDED
|
@@ -0,0 +1,2852 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/******/ (() => { // webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ var __webpack_modules__ = ([
|
|
5
|
+
/* 0 */,
|
|
6
|
+
/* 1 */
|
|
7
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11
|
+
exports.bootstrap = bootstrap;
|
|
12
|
+
const core_1 = __webpack_require__(2);
|
|
13
|
+
const app_server_bucketvore_module_1 = __webpack_require__(3);
|
|
14
|
+
const app_server_bucketvore_config_class_1 = __webpack_require__(42);
|
|
15
|
+
async function bootstrap() {
|
|
16
|
+
const app = await core_1.NestFactory.create(app_server_bucketvore_module_1.AppServerBucketvoreModule, { logger: console });
|
|
17
|
+
const port = Number(new app_server_bucketvore_config_class_1.AppServerBucketvoreConfig().HTTP_PORT);
|
|
18
|
+
await app.listen(port);
|
|
19
|
+
console.log(`BucketVore available at: http://localhost:${port}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/***/ }),
|
|
24
|
+
/* 2 */
|
|
25
|
+
/***/ ((module) => {
|
|
26
|
+
|
|
27
|
+
module.exports = require("@nestjs/core");
|
|
28
|
+
|
|
29
|
+
/***/ }),
|
|
30
|
+
/* 3 */
|
|
31
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35
|
+
exports.AppServerBucketvoreModule = void 0;
|
|
36
|
+
const tslib_1 = __webpack_require__(4);
|
|
37
|
+
const common_1 = __webpack_require__(5);
|
|
38
|
+
const app_controller_1 = __webpack_require__(6);
|
|
39
|
+
const buckets_controller_1 = __webpack_require__(44);
|
|
40
|
+
const files_controller_1 = __webpack_require__(51);
|
|
41
|
+
const upload_controller_1 = __webpack_require__(52);
|
|
42
|
+
const app_server_bucketvore_config_class_1 = __webpack_require__(42);
|
|
43
|
+
const client_s3_1 = __webpack_require__(46);
|
|
44
|
+
const credential_providers_1 = __webpack_require__(48);
|
|
45
|
+
const s3_service_1 = __webpack_require__(45);
|
|
46
|
+
const html_generator_service_1 = __webpack_require__(49);
|
|
47
|
+
const file_preview_service_1 = __webpack_require__(50);
|
|
48
|
+
const bucketvoreConfig = new app_server_bucketvore_config_class_1.AppServerBucketvoreConfig();
|
|
49
|
+
let AppServerBucketvoreModule = class AppServerBucketvoreModule {
|
|
50
|
+
};
|
|
51
|
+
exports.AppServerBucketvoreModule = AppServerBucketvoreModule;
|
|
52
|
+
exports.AppServerBucketvoreModule = AppServerBucketvoreModule = tslib_1.__decorate([
|
|
53
|
+
(0, common_1.Module)({
|
|
54
|
+
imports: [],
|
|
55
|
+
controllers: [
|
|
56
|
+
app_controller_1.AppController,
|
|
57
|
+
buckets_controller_1.BucketsController,
|
|
58
|
+
files_controller_1.FilesController,
|
|
59
|
+
upload_controller_1.UploadController,
|
|
60
|
+
],
|
|
61
|
+
providers: [
|
|
62
|
+
s3_service_1.S3Service,
|
|
63
|
+
html_generator_service_1.HtmlGeneratorService,
|
|
64
|
+
file_preview_service_1.FilePreviewService,
|
|
65
|
+
{ provide: app_server_bucketvore_config_class_1.AppServerBucketvoreConfig, useValue: bucketvoreConfig },
|
|
66
|
+
{
|
|
67
|
+
provide: client_s3_1.S3Client,
|
|
68
|
+
useFactory: () => {
|
|
69
|
+
const clientConfig = {
|
|
70
|
+
region: 'us-east-1', // Default region for initial client (bucket regions are auto-detected)
|
|
71
|
+
};
|
|
72
|
+
if (bucketvoreConfig.AWS_PROFILE) {
|
|
73
|
+
clientConfig.credentials = (0, credential_providers_1.fromIni)({ profile: bucketvoreConfig.AWS_PROFILE });
|
|
74
|
+
}
|
|
75
|
+
return new client_s3_1.S3Client(clientConfig);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
], AppServerBucketvoreModule);
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/***/ }),
|
|
84
|
+
/* 4 */
|
|
85
|
+
/***/ ((module) => {
|
|
86
|
+
|
|
87
|
+
module.exports = require("tslib");
|
|
88
|
+
|
|
89
|
+
/***/ }),
|
|
90
|
+
/* 5 */
|
|
91
|
+
/***/ ((module) => {
|
|
92
|
+
|
|
93
|
+
module.exports = require("@nestjs/common");
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
/* 6 */
|
|
97
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
var _a;
|
|
101
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102
|
+
exports.AppController = void 0;
|
|
103
|
+
const tslib_1 = __webpack_require__(4);
|
|
104
|
+
const common_1 = __webpack_require__(5);
|
|
105
|
+
const server_html_1 = __webpack_require__(7);
|
|
106
|
+
const app_server_bucketvore_config_class_1 = __webpack_require__(42);
|
|
107
|
+
const design_system_1 = __webpack_require__(43);
|
|
108
|
+
let AppController = class AppController {
|
|
109
|
+
constructor(config) {
|
|
110
|
+
this.config = config;
|
|
111
|
+
}
|
|
112
|
+
get() {
|
|
113
|
+
return (0, server_html_1.$html)({
|
|
114
|
+
lang: 'en',
|
|
115
|
+
children: [
|
|
116
|
+
(0, server_html_1.$head)({
|
|
117
|
+
children: [
|
|
118
|
+
(0, server_html_1.$meta)({ charset: 'UTF-8' }),
|
|
119
|
+
(0, server_html_1.$meta)({ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }),
|
|
120
|
+
(0, server_html_1.$title)({ textContent: 'BucketVore - S3 File Explorer' }),
|
|
121
|
+
(0, server_html_1.$script)({ src: 'https://unpkg.com/alpinejs@3.13.5/dist/cdn.min.js', defer: true }),
|
|
122
|
+
(0, server_html_1.$style)({ textContent: design_system_1.DESIGN_SYSTEM_STYLES })
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
(0, server_html_1.$body)({
|
|
126
|
+
'x-data': 's3Explorer()',
|
|
127
|
+
'x-init': 'init()',
|
|
128
|
+
children: [
|
|
129
|
+
// Header
|
|
130
|
+
(0, server_html_1.$header)({
|
|
131
|
+
children: [
|
|
132
|
+
(0, server_html_1.$div)({
|
|
133
|
+
className: 'header-left',
|
|
134
|
+
children: [
|
|
135
|
+
(0, server_html_1.$div)({
|
|
136
|
+
className: 'header-info',
|
|
137
|
+
children: [
|
|
138
|
+
(0, server_html_1.$h1)({ textContent: '🪣 BucketVore' }),
|
|
139
|
+
(0, server_html_1.$p)({
|
|
140
|
+
'x-show': 'selectedBucket',
|
|
141
|
+
'x-text': 'selectedBucket',
|
|
142
|
+
textContent: 'Select a bucket'
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
}),
|
|
148
|
+
(0, server_html_1.$div)({
|
|
149
|
+
className: 'header-actions',
|
|
150
|
+
'x-show': 'selectedBucket',
|
|
151
|
+
children: [
|
|
152
|
+
(0, server_html_1.$button)({
|
|
153
|
+
className: 'btn',
|
|
154
|
+
'@click': 'showUpload = true',
|
|
155
|
+
textContent: '⬆️ Upload'
|
|
156
|
+
}),
|
|
157
|
+
(0, server_html_1.$button)({
|
|
158
|
+
className: 'btn secondary',
|
|
159
|
+
'@click': 'refresh()',
|
|
160
|
+
textContent: '🔄 Refresh'
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
}),
|
|
166
|
+
(0, server_html_1.$div)({
|
|
167
|
+
className: 'container',
|
|
168
|
+
children: [
|
|
169
|
+
// Sidebar - Bucket List
|
|
170
|
+
(0, server_html_1.$aside)({
|
|
171
|
+
children: [
|
|
172
|
+
(0, server_html_1.$div)({
|
|
173
|
+
className: 'sidebar-header',
|
|
174
|
+
children: [
|
|
175
|
+
(0, server_html_1.$h1)({ textContent: '📋 Buckets', style: { fontSize: 'var(--size-sm)', marginBottom: 'var(--space-3)' } }),
|
|
176
|
+
(0, server_html_1.$input)({
|
|
177
|
+
type: 'text',
|
|
178
|
+
placeholder: 'Filter buckets...',
|
|
179
|
+
'x-model': 'bucketFilter',
|
|
180
|
+
'@input': 'filterBuckets()',
|
|
181
|
+
className: 'filter-input',
|
|
182
|
+
style: { width: '100%', padding: 'var(--space-2)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--color-border)', backgroundColor: 'var(--color-bg-tertiary)', color: 'var(--color-text-primary)', fontSize: 'var(--size-sm)' }
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
}),
|
|
186
|
+
(0, server_html_1.$div)({
|
|
187
|
+
className: 'bucket-list',
|
|
188
|
+
'x-html': 'filteredBucketsHtml'
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
}),
|
|
192
|
+
// Main Content - File Explorer
|
|
193
|
+
(0, server_html_1.$main)({
|
|
194
|
+
children: [
|
|
195
|
+
// Toolbar with breadcrumbs
|
|
196
|
+
(0, server_html_1.$div)({
|
|
197
|
+
className: 'toolbar',
|
|
198
|
+
'x-show': 'selectedBucket',
|
|
199
|
+
children: [
|
|
200
|
+
(0, server_html_1.$div)({
|
|
201
|
+
style: { flex: '1', display: 'flex', flexDirection: 'column', gap: 'var(--space-2)' },
|
|
202
|
+
children: [
|
|
203
|
+
(0, server_html_1.$div)({
|
|
204
|
+
'x-html': 'breadcrumbsHtml'
|
|
205
|
+
}),
|
|
206
|
+
(0, server_html_1.$input)({
|
|
207
|
+
type: 'text',
|
|
208
|
+
placeholder: 'Filter files and folders...',
|
|
209
|
+
'x-model': 'fileFilter',
|
|
210
|
+
'@input': 'filterFiles()',
|
|
211
|
+
className: 'filter-input',
|
|
212
|
+
style: { width: '100%', maxWidth: '400px', padding: 'var(--space-2)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--color-border)', backgroundColor: 'var(--color-bg-tertiary)', color: 'var(--color-text-primary)', fontSize: 'var(--size-sm)' }
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
}),
|
|
216
|
+
(0, server_html_1.$div)({
|
|
217
|
+
className: 'toolbar-actions',
|
|
218
|
+
children: [
|
|
219
|
+
(0, server_html_1.$button)({
|
|
220
|
+
className: 'btn-icon',
|
|
221
|
+
'@click': 'viewMode = viewMode === "list" ? "grid" : "list"',
|
|
222
|
+
'x-text': 'viewMode === "list" ? "⊞" : "☰"',
|
|
223
|
+
title: 'Toggle view'
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
})
|
|
227
|
+
]
|
|
228
|
+
}),
|
|
229
|
+
// File Explorer
|
|
230
|
+
(0, server_html_1.$div)({
|
|
231
|
+
className: 'file-explorer',
|
|
232
|
+
children: [
|
|
233
|
+
(0, server_html_1.$div)({
|
|
234
|
+
className: 'file-list',
|
|
235
|
+
'x-html': 'filteredFilesHtml'
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
}),
|
|
243
|
+
// Upload Modal
|
|
244
|
+
(0, server_html_1.$div)({
|
|
245
|
+
className: 'modal-overlay',
|
|
246
|
+
'x-show': 'showUpload',
|
|
247
|
+
'@click.self': 'showUpload = false',
|
|
248
|
+
style: { display: 'none' },
|
|
249
|
+
children: [
|
|
250
|
+
(0, server_html_1.$div)({
|
|
251
|
+
className: 'modal',
|
|
252
|
+
style: { width: '500px' },
|
|
253
|
+
children: [
|
|
254
|
+
(0, server_html_1.$div)({
|
|
255
|
+
className: 'preview-header',
|
|
256
|
+
children: [
|
|
257
|
+
(0, server_html_1.$h1)({ textContent: 'Upload Files', style: { fontSize: 'var(--size-lg)', margin: 0 } }),
|
|
258
|
+
(0, server_html_1.$button)({
|
|
259
|
+
className: 'btn-close',
|
|
260
|
+
'@click': 'showUpload = false',
|
|
261
|
+
textContent: '✕'
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
(0, server_html_1.$div)({
|
|
266
|
+
className: 'preview-content',
|
|
267
|
+
children: [
|
|
268
|
+
(0, server_html_1.$div)({
|
|
269
|
+
className: 'upload-zone',
|
|
270
|
+
'@click': '$refs.fileInput.click()',
|
|
271
|
+
'@drop.prevent': 'handleDrop($event)',
|
|
272
|
+
'@dragover.prevent': '$el.classList.add("drag-over")',
|
|
273
|
+
'@dragleave.prevent': '$el.classList.remove("drag-over")',
|
|
274
|
+
children: [
|
|
275
|
+
(0, server_html_1.$div)({ className: 'upload-zone-icon', textContent: '📁' }),
|
|
276
|
+
(0, server_html_1.$p)({ textContent: 'Click to select files or drag and drop' }),
|
|
277
|
+
(0, server_html_1.$input)({
|
|
278
|
+
type: 'file',
|
|
279
|
+
multiple: true,
|
|
280
|
+
'x-ref': 'fileInput',
|
|
281
|
+
'@change': 'handleFileSelect($event)'
|
|
282
|
+
})
|
|
283
|
+
]
|
|
284
|
+
}),
|
|
285
|
+
(0, server_html_1.$div)({
|
|
286
|
+
'x-show': 'uploadProgress.length > 0',
|
|
287
|
+
style: { marginTop: 'var(--space-4)' },
|
|
288
|
+
children: [
|
|
289
|
+
(0, server_html_1.$h1)({ textContent: 'Uploading...', style: { fontSize: 'var(--size-sm)', marginBottom: 'var(--space-2)' } }),
|
|
290
|
+
(0, server_html_1.$div)({
|
|
291
|
+
'x-html': 'uploadProgressHtml'
|
|
292
|
+
})
|
|
293
|
+
]
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
})
|
|
297
|
+
]
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
}),
|
|
301
|
+
// Preview Modal
|
|
302
|
+
(0, server_html_1.$div)({
|
|
303
|
+
className: 'modal-overlay',
|
|
304
|
+
'x-show': 'showPreview',
|
|
305
|
+
'@click.self': 'closePreview()',
|
|
306
|
+
style: { display: 'none' },
|
|
307
|
+
children: [
|
|
308
|
+
(0, server_html_1.$div)({
|
|
309
|
+
className: 'modal',
|
|
310
|
+
style: { maxWidth: '95vw', maxHeight: '95vh', width: '95vw' },
|
|
311
|
+
'x-html': 'previewHtml'
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
}),
|
|
315
|
+
(0, server_html_1.$script)({
|
|
316
|
+
textContent: `
|
|
317
|
+
function s3Explorer() {
|
|
318
|
+
return {
|
|
319
|
+
selectedBucket: '',
|
|
320
|
+
currentPrefix: '',
|
|
321
|
+
viewMode: 'list',
|
|
322
|
+
showUpload: false,
|
|
323
|
+
showPreview: false,
|
|
324
|
+
uploadProgress: [],
|
|
325
|
+
|
|
326
|
+
bucketFilter: '',
|
|
327
|
+
fileFilter: '',
|
|
328
|
+
allBuckets: [],
|
|
329
|
+
allFilesData: { filesHtml: '', breadcrumbsHtml: '' },
|
|
330
|
+
|
|
331
|
+
bucketsHtml: '<div class="loading"><div class="spinner"></div><p>Loading buckets...</p></div>',
|
|
332
|
+
breadcrumbsHtml: '',
|
|
333
|
+
filesHtml: '<div class="empty-state"><div class="empty-state-icon">🪣</div><p>Select a bucket to browse files</p></div>',
|
|
334
|
+
previewHtml: '',
|
|
335
|
+
|
|
336
|
+
get filteredBucketsHtml() {
|
|
337
|
+
if (!this.bucketFilter.trim()) {
|
|
338
|
+
return this.bucketsHtml;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const filter = this.bucketFilter.toLowerCase();
|
|
342
|
+
const parser = new DOMParser();
|
|
343
|
+
const doc = parser.parseFromString(this.bucketsHtml, 'text/html');
|
|
344
|
+
const bucketItems = doc.querySelectorAll('.bucket-item');
|
|
345
|
+
|
|
346
|
+
let filtered = '';
|
|
347
|
+
bucketItems.forEach(item => {
|
|
348
|
+
const bucketName = item.querySelector('.bucket-name')?.textContent?.toLowerCase() || '';
|
|
349
|
+
if (bucketName.includes(filter)) {
|
|
350
|
+
filtered += item.outerHTML;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
if (!filtered) {
|
|
355
|
+
return '<div class="empty-state"><div class="empty-state-icon">🔍</div><p>No buckets match your filter</p></div>';
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return filtered;
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
get filteredFilesHtml() {
|
|
362
|
+
if (!this.fileFilter.trim()) {
|
|
363
|
+
return this.filesHtml;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const filter = this.fileFilter.toLowerCase();
|
|
367
|
+
const parser = new DOMParser();
|
|
368
|
+
const doc = parser.parseFromString(this.filesHtml, 'text/html');
|
|
369
|
+
const fileItems = doc.querySelectorAll('.file-item');
|
|
370
|
+
|
|
371
|
+
let filtered = '';
|
|
372
|
+
fileItems.forEach(item => {
|
|
373
|
+
const fileName = item.querySelector('.file-name')?.textContent?.toLowerCase() || '';
|
|
374
|
+
if (fileName.includes(filter)) {
|
|
375
|
+
filtered += item.outerHTML;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
if (!filtered) {
|
|
380
|
+
return '<div class="empty-state"><div class="empty-state-icon">🔍</div><p>No files match your filter</p></div>';
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return filtered;
|
|
384
|
+
},
|
|
385
|
+
|
|
386
|
+
get uploadProgressHtml() {
|
|
387
|
+
return this.uploadProgress.map(f =>
|
|
388
|
+
\`<div style="margin-bottom: var(--space-2)">
|
|
389
|
+
<div style="display: flex; justify-content: space-between; font-size: var(--size-sm); margin-bottom: var(--space-1)">
|
|
390
|
+
<span>\${f.name}</span>
|
|
391
|
+
<span>\${f.status}</span>
|
|
392
|
+
</div>
|
|
393
|
+
</div>\`
|
|
394
|
+
).join('');
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
async init() {
|
|
398
|
+
await this.loadBuckets();
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
async loadBuckets() {
|
|
402
|
+
try {
|
|
403
|
+
const response = await fetch('/api/buckets');
|
|
404
|
+
this.bucketsHtml = await response.text();
|
|
405
|
+
} catch (error) {
|
|
406
|
+
this.bucketsHtml = '<div class="error"><div class="error-icon">⚠️</div><p>Error loading buckets</p></div>';
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
async selectBucket(bucket) {
|
|
411
|
+
this.selectedBucket = bucket;
|
|
412
|
+
this.currentPrefix = '';
|
|
413
|
+
await this.loadFiles();
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
async loadFiles() {
|
|
417
|
+
try {
|
|
418
|
+
this.filesHtml = '<div class="loading"><div class="spinner"></div><p>Loading files...</p></div>';
|
|
419
|
+
this.fileFilter = ''; // Reset filter when navigating
|
|
420
|
+
const url = \`/api/files?bucket=\${this.selectedBucket}&prefix=\${encodeURIComponent(this.currentPrefix)}\`;
|
|
421
|
+
const response = await fetch(url);
|
|
422
|
+
|
|
423
|
+
const data = await response.json();
|
|
424
|
+
this.filesHtml = data.filesHtml;
|
|
425
|
+
this.breadcrumbsHtml = data.breadcrumbsHtml;
|
|
426
|
+
} catch (error) {
|
|
427
|
+
this.filesHtml = '<div class="error"><div class="error-icon">⚠️</div><p>Error loading files</p></div>';
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
async navigateToFolder(prefix) {
|
|
432
|
+
this.currentPrefix = prefix;
|
|
433
|
+
await this.loadFiles();
|
|
434
|
+
},
|
|
435
|
+
|
|
436
|
+
async previewFile(key) {
|
|
437
|
+
try {
|
|
438
|
+
this.showPreview = true;
|
|
439
|
+
this.previewHtml = '<div class="loading"><div class="spinner"></div><p>Loading preview...</p></div>';
|
|
440
|
+
|
|
441
|
+
const response = await fetch(\`/api/files/preview?bucket=\${this.selectedBucket}&key=\${encodeURIComponent(key)}\`);
|
|
442
|
+
this.previewHtml = await response.text();
|
|
443
|
+
} catch (error) {
|
|
444
|
+
this.previewHtml = '<div class="error"><div class="error-icon">⚠️</div><p>Error loading preview</p></div>';
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
|
|
448
|
+
closePreview() {
|
|
449
|
+
this.showPreview = false;
|
|
450
|
+
this.previewHtml = '';
|
|
451
|
+
},
|
|
452
|
+
|
|
453
|
+
async downloadFile(key) {
|
|
454
|
+
try {
|
|
455
|
+
const response = await fetch(\`/api/files/download?bucket=\${this.selectedBucket}&key=\${encodeURIComponent(key)}\`);
|
|
456
|
+
const data = await response.json();
|
|
457
|
+
window.open(data.url, '_blank');
|
|
458
|
+
} catch (error) {
|
|
459
|
+
alert('Error generating download link');
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
|
|
463
|
+
async deleteFile(key) {
|
|
464
|
+
if (!confirm(\`Delete \${key}?\`)) return;
|
|
465
|
+
|
|
466
|
+
try {
|
|
467
|
+
await fetch(\`/api/files/delete\`, {
|
|
468
|
+
method: 'POST',
|
|
469
|
+
headers: { 'Content-Type': 'application/json' },
|
|
470
|
+
body: JSON.stringify({ bucket: this.selectedBucket, key })
|
|
471
|
+
});
|
|
472
|
+
await this.loadFiles();
|
|
473
|
+
} catch (error) {
|
|
474
|
+
alert('Error deleting file');
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
async deleteFolder(prefix) {
|
|
479
|
+
if (!confirm(\`Delete folder \${prefix} and all its contents?\`)) return;
|
|
480
|
+
|
|
481
|
+
try {
|
|
482
|
+
await fetch(\`/api/files/delete-folder\`, {
|
|
483
|
+
method: 'POST',
|
|
484
|
+
headers: { 'Content-Type': 'application/json' },
|
|
485
|
+
body: JSON.stringify({ bucket: this.selectedBucket, prefix })
|
|
486
|
+
});
|
|
487
|
+
await this.loadFiles();
|
|
488
|
+
} catch (error) {
|
|
489
|
+
alert('Error deleting folder');
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
|
|
493
|
+
handleFileSelect(event) {
|
|
494
|
+
const files = Array.from(event.target.files);
|
|
495
|
+
this.uploadFiles(files);
|
|
496
|
+
},
|
|
497
|
+
|
|
498
|
+
handleDrop(event) {
|
|
499
|
+
event.target.classList.remove('drag-over');
|
|
500
|
+
const files = Array.from(event.dataTransfer.files);
|
|
501
|
+
this.uploadFiles(files);
|
|
502
|
+
},
|
|
503
|
+
|
|
504
|
+
async uploadFiles(files) {
|
|
505
|
+
this.uploadProgress = files.map(f => ({ name: f.name, status: 'Uploading...' }));
|
|
506
|
+
|
|
507
|
+
for (let i = 0; i < files.length; i++) {
|
|
508
|
+
const file = files[i];
|
|
509
|
+
const formData = new FormData();
|
|
510
|
+
formData.append('file', file);
|
|
511
|
+
formData.append('bucket', this.selectedBucket);
|
|
512
|
+
formData.append('prefix', this.currentPrefix);
|
|
513
|
+
|
|
514
|
+
try {
|
|
515
|
+
await fetch('/api/upload', {
|
|
516
|
+
method: 'POST',
|
|
517
|
+
body: formData
|
|
518
|
+
});
|
|
519
|
+
this.uploadProgress[i].status = '✓ Complete';
|
|
520
|
+
} catch (error) {
|
|
521
|
+
this.uploadProgress[i].status = '✗ Failed';
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
setTimeout(async () => {
|
|
526
|
+
this.uploadProgress = [];
|
|
527
|
+
this.showUpload = false;
|
|
528
|
+
await this.loadFiles();
|
|
529
|
+
}, 2000);
|
|
530
|
+
},
|
|
531
|
+
|
|
532
|
+
async refresh() {
|
|
533
|
+
await this.loadFiles();
|
|
534
|
+
},
|
|
535
|
+
|
|
536
|
+
filterBuckets() {
|
|
537
|
+
// Reactive computed property handles this automatically
|
|
538
|
+
},
|
|
539
|
+
|
|
540
|
+
filterFiles() {
|
|
541
|
+
// Reactive computed property handles this automatically
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
`
|
|
546
|
+
})
|
|
547
|
+
]
|
|
548
|
+
})
|
|
549
|
+
]
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
exports.AppController = AppController;
|
|
554
|
+
tslib_1.__decorate([
|
|
555
|
+
(0, common_1.Get)(),
|
|
556
|
+
tslib_1.__metadata("design:type", Function),
|
|
557
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
558
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
559
|
+
], AppController.prototype, "get", null);
|
|
560
|
+
exports.AppController = AppController = tslib_1.__decorate([
|
|
561
|
+
(0, common_1.Controller)(),
|
|
562
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof app_server_bucketvore_config_class_1.AppServerBucketvoreConfig !== "undefined" && app_server_bucketvore_config_class_1.AppServerBucketvoreConfig) === "function" ? _a : Object])
|
|
563
|
+
], AppController);
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
/***/ }),
|
|
567
|
+
/* 7 */
|
|
568
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
572
|
+
const tslib_1 = __webpack_require__(4);
|
|
573
|
+
tslib_1.__exportStar(__webpack_require__(8), exports);
|
|
574
|
+
tslib_1.__exportStar(__webpack_require__(9), exports);
|
|
575
|
+
tslib_1.__exportStar(__webpack_require__(10), exports);
|
|
576
|
+
tslib_1.__exportStar(__webpack_require__(16), exports);
|
|
577
|
+
tslib_1.__exportStar(__webpack_require__(21), exports);
|
|
578
|
+
tslib_1.__exportStar(__webpack_require__(12), exports);
|
|
579
|
+
tslib_1.__exportStar(__webpack_require__(13), exports);
|
|
580
|
+
tslib_1.__exportStar(__webpack_require__(11), exports);
|
|
581
|
+
tslib_1.__exportStar(__webpack_require__(18), exports);
|
|
582
|
+
tslib_1.__exportStar(__webpack_require__(17), exports);
|
|
583
|
+
tslib_1.__exportStar(__webpack_require__(14), exports);
|
|
584
|
+
tslib_1.__exportStar(__webpack_require__(15), exports);
|
|
585
|
+
tslib_1.__exportStar(__webpack_require__(19), exports);
|
|
586
|
+
tslib_1.__exportStar(__webpack_require__(20), exports);
|
|
587
|
+
tslib_1.__exportStar(__webpack_require__(22), exports);
|
|
588
|
+
tslib_1.__exportStar(__webpack_require__(23), exports);
|
|
589
|
+
tslib_1.__exportStar(__webpack_require__(25), exports);
|
|
590
|
+
tslib_1.__exportStar(__webpack_require__(26), exports);
|
|
591
|
+
tslib_1.__exportStar(__webpack_require__(27), exports);
|
|
592
|
+
tslib_1.__exportStar(__webpack_require__(28), exports);
|
|
593
|
+
tslib_1.__exportStar(__webpack_require__(29), exports);
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
/***/ }),
|
|
597
|
+
/* 8 */
|
|
598
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
602
|
+
exports.a = a;
|
|
603
|
+
function a(text, href, cssClass) {
|
|
604
|
+
const classExp = cssClass ? `class="${cssClass}"` : '';
|
|
605
|
+
return `<a target="_blank" href="${href}" ${classExp}>${text}</a>`;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
/***/ }),
|
|
610
|
+
/* 9 */
|
|
611
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
/***/ }),
|
|
618
|
+
/* 10 */
|
|
619
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
623
|
+
exports.html = html;
|
|
624
|
+
const tags_1 = __webpack_require__(11);
|
|
625
|
+
function html(title, subtitle, markup, logoUrl) {
|
|
626
|
+
return (0, tags_1._htm)([
|
|
627
|
+
(0, tags_1._head)([
|
|
628
|
+
(0, tags_1._style)([
|
|
629
|
+
'body {',
|
|
630
|
+
'padding: 64px;',
|
|
631
|
+
`font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";`,
|
|
632
|
+
`font-size: 1rem;`,
|
|
633
|
+
`-webkit-font-smoothing: antialiased;`,
|
|
634
|
+
`-moz-osx-font-smoothing: grayscale;`,
|
|
635
|
+
'color: rgb(34, 30, 31);',
|
|
636
|
+
'}',
|
|
637
|
+
'h1, h2, h3, h4, pre { color: rgb(34, 30, 31) !important; }',
|
|
638
|
+
'td, th { text-align: left; padding: 8px;}',
|
|
639
|
+
'table { border-collapse: collapse; width: 100%;}',
|
|
640
|
+
'tbody { border-width: 1px; border-style: solid; border-left-style: none; border-right-style: none; }',
|
|
641
|
+
'.focal, a { padding: 12px 24px; font-weight: bold; display: block; text-align: center; border-radius: 4px; }',
|
|
642
|
+
'.mw-880 { max-width: 880px !important; margin: auto; }',
|
|
643
|
+
'.mw-440 { max-width: 440px !important; margin: auto; }',
|
|
644
|
+
'pre { padding: 12px 24px; font-weight: bold; display: block; text-align: center; border-radius: 4px; border: solid 1px; }',
|
|
645
|
+
'a { max-width: 240px; }',
|
|
646
|
+
'.bg-gray { background-color: #efefef; }',
|
|
647
|
+
'.drop-shadow, .button { filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.3)); }',
|
|
648
|
+
'.button { text-decoration: none; margin: 32px 0; background-color: rgb(205, 62, 71); color: white !important; }',
|
|
649
|
+
]),
|
|
650
|
+
]),
|
|
651
|
+
(0, tags_1._body)([
|
|
652
|
+
(0, tags_1._header)([
|
|
653
|
+
logoUrl
|
|
654
|
+
? `<img height="64" width="auto" src="${logoUrl}" />`
|
|
655
|
+
: undefined,
|
|
656
|
+
(0, tags_1._h1)([title]),
|
|
657
|
+
(0, tags_1._h2)([subtitle]),
|
|
658
|
+
].filter(Boolean)),
|
|
659
|
+
(0, tags_1._main)(markup),
|
|
660
|
+
]),
|
|
661
|
+
]);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
/***/ }),
|
|
666
|
+
/* 11 */
|
|
667
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
671
|
+
exports._style = exports._tr = exports._thead = exports._th = exports._td = exports._tbody = exports._tab = exports._pre = exports._p = exports._main = exports._img = exports._htm = exports._header = exports._head = exports._h6 = exports._h5 = exports._h4 = exports._h3 = exports._h2 = exports._h1 = exports._div = exports._body = void 0;
|
|
672
|
+
const self_closing_tag_function_1 = __webpack_require__(12);
|
|
673
|
+
const tag_function_1 = __webpack_require__(13);
|
|
674
|
+
exports._body = tag_function_1.tag.bind(null, 'body');
|
|
675
|
+
exports._div = tag_function_1.tag.bind(null, 'div');
|
|
676
|
+
exports._h1 = tag_function_1.tag.bind(null, 'h1');
|
|
677
|
+
exports._h2 = tag_function_1.tag.bind(null, 'h2');
|
|
678
|
+
exports._h3 = tag_function_1.tag.bind(null, 'h3');
|
|
679
|
+
exports._h4 = tag_function_1.tag.bind(null, 'h4');
|
|
680
|
+
exports._h5 = tag_function_1.tag.bind(null, 'h5');
|
|
681
|
+
exports._h6 = tag_function_1.tag.bind(null, 'h6');
|
|
682
|
+
exports._head = tag_function_1.tag.bind(null, 'head');
|
|
683
|
+
exports._header = tag_function_1.tag.bind(null, 'header');
|
|
684
|
+
exports._htm = tag_function_1.tag.bind(null, 'html');
|
|
685
|
+
exports._img = self_closing_tag_function_1.selfClosingTag.bind(null, 'img');
|
|
686
|
+
exports._main = tag_function_1.tag.bind(null, 'main');
|
|
687
|
+
exports._p = tag_function_1.tag.bind(null, 'p');
|
|
688
|
+
exports._pre = tag_function_1.tag.bind(null, 'pre');
|
|
689
|
+
exports._tab = tag_function_1.tag.bind(null, 'table');
|
|
690
|
+
exports._tbody = tag_function_1.tag.bind(null, 'tbody');
|
|
691
|
+
exports._td = tag_function_1.tag.bind(null, 'td');
|
|
692
|
+
exports._th = tag_function_1.tag.bind(null, 'th');
|
|
693
|
+
exports._thead = tag_function_1.tag.bind(null, 'thead');
|
|
694
|
+
exports._tr = tag_function_1.tag.bind(null, 'tr');
|
|
695
|
+
exports._style = tag_function_1.tag.bind(null, 'style');
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
/***/ }),
|
|
699
|
+
/* 12 */
|
|
700
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
704
|
+
exports.selfClosingTag = selfClosingTag;
|
|
705
|
+
const tag_function_1 = __webpack_require__(13);
|
|
706
|
+
function selfClosingTag(tag, cssClass, attributes, styles) {
|
|
707
|
+
return (0, tag_function_1.tag)(tag, [], cssClass, attributes, styles).replace(`></${tag}>`, '/>');
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
/***/ }),
|
|
712
|
+
/* 13 */
|
|
713
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
717
|
+
exports.tag = tag;
|
|
718
|
+
const format_attributes_function_1 = __webpack_require__(14);
|
|
719
|
+
const inline_style_function_1 = __webpack_require__(15);
|
|
720
|
+
function tag(tag, content, cssClass, attributes, styles) {
|
|
721
|
+
const classExp = cssClass ? ` class="${cssClass}"` : '';
|
|
722
|
+
const attributesExp = attributes ? ` ${(0, format_attributes_function_1.formatAttributes)(attributes)}` : '';
|
|
723
|
+
const styleExp = styles ? ` ${(0, inline_style_function_1.inlineStyle)(styles)}` : '';
|
|
724
|
+
return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
/***/ }),
|
|
729
|
+
/* 14 */
|
|
730
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
734
|
+
exports.formatAttributes = formatAttributes;
|
|
735
|
+
function formatAttributes(attributes) {
|
|
736
|
+
if (!attributes) {
|
|
737
|
+
return '';
|
|
738
|
+
}
|
|
739
|
+
return Object.entries(attributes)
|
|
740
|
+
.map(([k, v]) => `${k}="${v}"`)
|
|
741
|
+
.join(' ');
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
/***/ }),
|
|
746
|
+
/* 15 */
|
|
747
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
751
|
+
exports.inlineStyle = inlineStyle;
|
|
752
|
+
function inlineStyle(styles) {
|
|
753
|
+
const rules = Object.entries(styles)
|
|
754
|
+
.filter(([, v]) => (v != null) && (v != undefined))
|
|
755
|
+
.map(([k, v]) => {
|
|
756
|
+
// convert camelCase property names to kebab-case
|
|
757
|
+
const prop = k.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
758
|
+
return `${prop}: ${v};`;
|
|
759
|
+
})
|
|
760
|
+
.join(' ');
|
|
761
|
+
return `style="${rules}"`;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
/***/ }),
|
|
766
|
+
/* 16 */
|
|
767
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
771
|
+
exports.loginButton = loginButton;
|
|
772
|
+
const elements_1 = __webpack_require__(17);
|
|
773
|
+
const button_styles_constant_1 = __webpack_require__(20);
|
|
774
|
+
function loginButton(text, href, extraStyles) {
|
|
775
|
+
return (0, elements_1.anchor)([text], {
|
|
776
|
+
href,
|
|
777
|
+
style: {
|
|
778
|
+
...button_styles_constant_1.buttonStyles,
|
|
779
|
+
...(extraStyles || {})
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
/***/ }),
|
|
786
|
+
/* 17 */
|
|
787
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
791
|
+
exports.style = exports.tr = exports.thead = exports.th = exports.td = exports.tbody = exports.tab = exports.pre = exports.p = exports.main = exports.img = exports.htm = exports.header = exports.head = exports.h6 = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.div = exports.button = exports.body = exports.anchor = void 0;
|
|
792
|
+
const element_function_1 = __webpack_require__(18);
|
|
793
|
+
const self_closing_element_function_1 = __webpack_require__(19);
|
|
794
|
+
const button_styles_constant_1 = __webpack_require__(20);
|
|
795
|
+
const anchor = (content, attributes) => (0, element_function_1.element)('a', content, { ...attributes, style: { ...button_styles_constant_1.buttonStyles, ...attributes?.style } });
|
|
796
|
+
exports.anchor = anchor;
|
|
797
|
+
exports.body = element_function_1.element.bind(null, 'body');
|
|
798
|
+
const button = (content, attributes) => (0, element_function_1.element)('button', content, { ...attributes, style: { ...button_styles_constant_1.buttonStyles, ...attributes?.style } });
|
|
799
|
+
exports.button = button;
|
|
800
|
+
exports.div = element_function_1.element.bind(null, 'div');
|
|
801
|
+
exports.h1 = element_function_1.element.bind(null, 'h1');
|
|
802
|
+
exports.h2 = element_function_1.element.bind(null, 'h2');
|
|
803
|
+
exports.h3 = element_function_1.element.bind(null, 'h3');
|
|
804
|
+
exports.h4 = element_function_1.element.bind(null, 'h4');
|
|
805
|
+
exports.h5 = element_function_1.element.bind(null, 'h5');
|
|
806
|
+
exports.h6 = element_function_1.element.bind(null, 'h6');
|
|
807
|
+
exports.head = element_function_1.element.bind(null, 'head');
|
|
808
|
+
exports.header = element_function_1.element.bind(null, 'header');
|
|
809
|
+
exports.htm = element_function_1.element.bind(null, 'html');
|
|
810
|
+
exports.img = self_closing_element_function_1.selfClosingElement.bind(null, 'img');
|
|
811
|
+
exports.main = element_function_1.element.bind(null, 'main');
|
|
812
|
+
exports.p = element_function_1.element.bind(null, 'p');
|
|
813
|
+
exports.pre = element_function_1.element.bind(null, 'pre');
|
|
814
|
+
exports.tab = element_function_1.element.bind(null, 'table');
|
|
815
|
+
exports.tbody = element_function_1.element.bind(null, 'tbody');
|
|
816
|
+
exports.td = element_function_1.element.bind(null, 'td');
|
|
817
|
+
exports.th = element_function_1.element.bind(null, 'th');
|
|
818
|
+
exports.thead = element_function_1.element.bind(null, 'thead');
|
|
819
|
+
exports.tr = element_function_1.element.bind(null, 'tr');
|
|
820
|
+
// todo: make this take a Record<string, Record<string, string>> instead of the terrible raw string formatting used now
|
|
821
|
+
// todo: apply kebab-casing to camelCased keys so that consumers can write { fontWeight: 600 } instead of {'font-weight': 600 } (do this for all style properties of primitives' attributes)
|
|
822
|
+
exports.style = element_function_1.element.bind(null, 'style');
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
/***/ }),
|
|
826
|
+
/* 18 */
|
|
827
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
831
|
+
exports.element = element;
|
|
832
|
+
const format_attributes_function_1 = __webpack_require__(14);
|
|
833
|
+
const inline_style_function_1 = __webpack_require__(15);
|
|
834
|
+
function element(tag, content, attributes) {
|
|
835
|
+
const { cssClass = '', style = undefined, ...attrs } = attributes || {};
|
|
836
|
+
const classExp = cssClass ? ` class="${cssClass}"` : '';
|
|
837
|
+
const attributesExp = attrs ? ` ${(0, format_attributes_function_1.formatAttributes)(attrs)}` : '';
|
|
838
|
+
const styleExp = style ? ` ${(0, inline_style_function_1.inlineStyle)(style)}` : '';
|
|
839
|
+
return `<${tag}${classExp}${attributesExp}${styleExp}>${content.join?.('')}</${tag}>`;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
/***/ }),
|
|
844
|
+
/* 19 */
|
|
845
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
849
|
+
exports.selfClosingElement = selfClosingElement;
|
|
850
|
+
const element_function_1 = __webpack_require__(18);
|
|
851
|
+
function selfClosingElement(tag, attributes) {
|
|
852
|
+
return (0, element_function_1.element)(tag, [], attributes).replace(`></${tag}>`, '/>');
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
/***/ }),
|
|
857
|
+
/* 20 */
|
|
858
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
862
|
+
exports.buttonStyles = void 0;
|
|
863
|
+
exports.buttonStyles = {
|
|
864
|
+
padding: '1rem 1.5rem',
|
|
865
|
+
border: 'solid 1px',
|
|
866
|
+
'border-radius': '4px',
|
|
867
|
+
display: 'inline-block',
|
|
868
|
+
'font-weight': '600',
|
|
869
|
+
'text-align': 'center',
|
|
870
|
+
'text-decoration': 'none',
|
|
871
|
+
'box-sizing': 'border-box',
|
|
872
|
+
color: 'inherit'
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
/***/ }),
|
|
877
|
+
/* 21 */
|
|
878
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
/***/ }),
|
|
885
|
+
/* 22 */
|
|
886
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
890
|
+
exports.fontStyles = void 0;
|
|
891
|
+
exports.fontStyles = {
|
|
892
|
+
'font-family': `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important`,
|
|
893
|
+
'font-size': `1rem;`,
|
|
894
|
+
'-webkit-font-smoothing': `antialiased`,
|
|
895
|
+
'-moz-osx-font-smoothing': `grayscale`,
|
|
896
|
+
color: 'rgba(0, 0, 0, 0.5) !important',
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
/***/ }),
|
|
901
|
+
/* 23 */
|
|
902
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
906
|
+
exports.CSSProperties = void 0;
|
|
907
|
+
const css_properties_type_1 = __webpack_require__(24);
|
|
908
|
+
Object.defineProperty(exports, "CSSProperties", ({ enumerable: true, get: function () { return css_properties_type_1.CSSProperties; } }));
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
/***/ }),
|
|
912
|
+
/* 24 */
|
|
913
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
/***/ }),
|
|
920
|
+
/* 25 */
|
|
921
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
/***/ }),
|
|
928
|
+
/* 26 */
|
|
929
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
/***/ }),
|
|
936
|
+
/* 27 */
|
|
937
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
941
|
+
exports.emailBody = emailBody;
|
|
942
|
+
const elements_1 = __webpack_require__(17);
|
|
943
|
+
const font_styles_constant_1 = __webpack_require__(22);
|
|
944
|
+
function emailBody(title, subtitle, markup, logoUrl, extraStyles = {}) {
|
|
945
|
+
return (0, elements_1.div)([
|
|
946
|
+
(0, elements_1.div)([
|
|
947
|
+
(0, elements_1.div)([
|
|
948
|
+
logoUrl
|
|
949
|
+
? `<img height="64" width="auto" src="${logoUrl}" />`
|
|
950
|
+
: undefined,
|
|
951
|
+
title ? (0, elements_1.h1)([title]) : undefined,
|
|
952
|
+
subtitle ? (0, elements_1.h2)([subtitle]) : undefined,
|
|
953
|
+
].filter(Boolean)),
|
|
954
|
+
(0, elements_1.div)(markup),
|
|
955
|
+
], {
|
|
956
|
+
style: {
|
|
957
|
+
...font_styles_constant_1.fontStyles,
|
|
958
|
+
...(extraStyles || {})
|
|
959
|
+
}
|
|
960
|
+
}),
|
|
961
|
+
]);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
/***/ }),
|
|
966
|
+
/* 28 */
|
|
967
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
971
|
+
exports.table = table;
|
|
972
|
+
const elements_1 = __webpack_require__(17);
|
|
973
|
+
const padding = '0.5rem';
|
|
974
|
+
const color = 'inherit';
|
|
975
|
+
function table(columns, rows) {
|
|
976
|
+
return (0, elements_1.tab)([
|
|
977
|
+
(0, elements_1.thead)([(0, elements_1.tr)(columns.map((c) => (0, elements_1.th)([c], { style: { 'text-align': 'left', padding, color } })), { style: { 'border-bottom-color': color, 'border-bottom-style': 'solid', 'border-top-style': 'none', 'border-left-style': 'none', 'border-right-style': 'none' } })]),
|
|
978
|
+
(0, elements_1.tbody)(rows.map((row, i) => (0, elements_1.tr)(row.map((cell) => (0, elements_1.td)([cell], { style: { padding, color } })), { style: { 'background-color': i % 2 ? '' : 'rgba(0, 0, 0, 0.2)', padding, color } }))),
|
|
979
|
+
], { style: { 'border-collapse': 'collapse', width: '100%', color } });
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
/***/ }),
|
|
984
|
+
/* 29 */
|
|
985
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
989
|
+
exports.$footer = exports.$figure = exports.$figcaption = exports.$fieldset = exports.$embed = exports.$em = exports.$dt = exports.$dl = exports.$div = exports.$dialog = exports.$dfn = exports.$details = exports.$del = exports.$dd = exports.$datalist = exports.$data = exports.$colgroup = exports.$col = exports.$code = exports.$cite = exports.$caption = exports.$canvas = exports.$button = exports.$br = exports.$body = exports.$blockquote = exports.$bdo = exports.$bdi = exports.$base = exports.$b = exports.$audio = exports.$aside = exports.$article = exports.$area = exports.$address = exports.$abbr = exports.$a = exports.styled = exports.styleOnPointerEnter = exports.styleOnFocus = exports.styleOn = exports.setElementStyles = exports.setElementStyle = exports.setAttrs = exports.extractStyle = exports.asElementFactory = exports.asId = exports.styleManager = exports.TElementProps = exports.CSSProperties = void 0;
|
|
990
|
+
exports.$slot = exports.$select = exports.$section = exports.$script = exports.$samp = exports.$s = exports.$ruby = exports.$rt = exports.$rp = exports.$q = exports.$progress = exports.$pre = exports.$picture = exports.$p = exports.$output = exports.$option = exports.$optgroup = exports.$ol = exports.$object = exports.$noscript = exports.$nav = exports.$meter = exports.$meta = exports.$menu = exports.$math = exports.$mark = exports.$map = exports.$main = exports.$link = exports.$li = exports.$legend = exports.$label = exports.$kbd = exports.$ins = exports.$input = exports.$img = exports.$iframe = exports.$i = exports.$html = exports.$hr = exports.$hgroup = exports.$header = exports.$head = exports.$h6 = exports.$h5 = exports.$h4 = exports.$h3 = exports.$h2 = exports.$h1 = exports.$form = void 0;
|
|
991
|
+
exports.$wbr = exports.$video = exports.$var = exports.$ul = exports.$u = exports.$track = exports.$tr = exports.$title = exports.$time = exports.$thead = exports.$th = exports.$tfoot = exports.$textarea = exports.$template = exports.$td = exports.$tbody = exports.$table = exports.$sup = exports.$summary = exports.$sub = exports.$style = exports.$strong = exports.$span = exports.$source = exports.$small = void 0;
|
|
992
|
+
const element_function_1 = __webpack_require__(18);
|
|
993
|
+
const self_closing_element_function_1 = __webpack_require__(19);
|
|
994
|
+
const css_properties_type_1 = __webpack_require__(24);
|
|
995
|
+
Object.defineProperty(exports, "CSSProperties", ({ enumerable: true, get: function () { return css_properties_type_1.CSSProperties; } }));
|
|
996
|
+
const element_props_type_1 = __webpack_require__(30);
|
|
997
|
+
Object.defineProperty(exports, "TElementProps", ({ enumerable: true, get: function () { return element_props_type_1.TElementProps; } }));
|
|
998
|
+
const style_manager_constant_1 = __webpack_require__(31);
|
|
999
|
+
Object.defineProperty(exports, "styleManager", ({ enumerable: true, get: function () { return style_manager_constant_1.styleManager; } }));
|
|
1000
|
+
const as_id_function_1 = __webpack_require__(32);
|
|
1001
|
+
Object.defineProperty(exports, "asId", ({ enumerable: true, get: function () { return as_id_function_1.asId; } }));
|
|
1002
|
+
const as_element_factory_function_1 = __webpack_require__(33);
|
|
1003
|
+
Object.defineProperty(exports, "asElementFactory", ({ enumerable: true, get: function () { return as_element_factory_function_1.asElementFactory; } }));
|
|
1004
|
+
const extract_style_function_1 = __webpack_require__(34);
|
|
1005
|
+
Object.defineProperty(exports, "extractStyle", ({ enumerable: true, get: function () { return extract_style_function_1.extractStyle; } }));
|
|
1006
|
+
const set_element_attributes_function_1 = __webpack_require__(35);
|
|
1007
|
+
Object.defineProperty(exports, "setAttrs", ({ enumerable: true, get: function () { return set_element_attributes_function_1.setAttrs; } }));
|
|
1008
|
+
const set_element_style_function_1 = __webpack_require__(36);
|
|
1009
|
+
Object.defineProperty(exports, "setElementStyle", ({ enumerable: true, get: function () { return set_element_style_function_1.setElementStyle; } }));
|
|
1010
|
+
const set_element_styles_function_1 = __webpack_require__(37);
|
|
1011
|
+
Object.defineProperty(exports, "setElementStyles", ({ enumerable: true, get: function () { return set_element_styles_function_1.setElementStyles; } }));
|
|
1012
|
+
const style_on_function_1 = __webpack_require__(38);
|
|
1013
|
+
Object.defineProperty(exports, "styleOn", ({ enumerable: true, get: function () { return style_on_function_1.styleOn; } }));
|
|
1014
|
+
const style_on_focus_function_1 = __webpack_require__(39);
|
|
1015
|
+
Object.defineProperty(exports, "styleOnFocus", ({ enumerable: true, get: function () { return style_on_focus_function_1.styleOnFocus; } }));
|
|
1016
|
+
const style_on_pointer_enter_function_1 = __webpack_require__(40);
|
|
1017
|
+
Object.defineProperty(exports, "styleOnPointerEnter", ({ enumerable: true, get: function () { return style_on_pointer_enter_function_1.styleOnPointerEnter; } }));
|
|
1018
|
+
const styled_function_1 = __webpack_require__(41);
|
|
1019
|
+
Object.defineProperty(exports, "styled", ({ enumerable: true, get: function () { return styled_function_1.styled; } }));
|
|
1020
|
+
// Element factories
|
|
1021
|
+
exports.$a = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'a'));
|
|
1022
|
+
exports.$abbr = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'abbr'));
|
|
1023
|
+
exports.$address = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'address'));
|
|
1024
|
+
exports.$area = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('area', attrs));
|
|
1025
|
+
exports.$article = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'article'));
|
|
1026
|
+
exports.$aside = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'aside'));
|
|
1027
|
+
exports.$audio = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'audio'));
|
|
1028
|
+
exports.$b = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'b'));
|
|
1029
|
+
exports.$base = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('base', attrs));
|
|
1030
|
+
exports.$bdi = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'bdi'));
|
|
1031
|
+
exports.$bdo = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'bdo'));
|
|
1032
|
+
exports.$blockquote = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'blockquote'));
|
|
1033
|
+
exports.$body = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'body'));
|
|
1034
|
+
exports.$br = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('br', attrs));
|
|
1035
|
+
exports.$button = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'button'));
|
|
1036
|
+
exports.$canvas = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'canvas'));
|
|
1037
|
+
exports.$caption = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'caption'));
|
|
1038
|
+
exports.$cite = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'cite'));
|
|
1039
|
+
exports.$code = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'code'));
|
|
1040
|
+
exports.$col = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('col', attrs));
|
|
1041
|
+
exports.$colgroup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'colgroup'));
|
|
1042
|
+
exports.$data = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'data'));
|
|
1043
|
+
exports.$datalist = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'datalist'));
|
|
1044
|
+
exports.$dd = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dd'));
|
|
1045
|
+
exports.$del = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'del'));
|
|
1046
|
+
exports.$details = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'details'));
|
|
1047
|
+
exports.$dfn = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dfn'));
|
|
1048
|
+
exports.$dialog = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dialog'));
|
|
1049
|
+
exports.$div = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'div'));
|
|
1050
|
+
exports.$dl = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dl'));
|
|
1051
|
+
exports.$dt = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'dt'));
|
|
1052
|
+
exports.$em = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'em'));
|
|
1053
|
+
exports.$embed = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('embed', attrs));
|
|
1054
|
+
exports.$fieldset = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'fieldset'));
|
|
1055
|
+
exports.$figcaption = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'figcaption'));
|
|
1056
|
+
exports.$figure = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'figure'));
|
|
1057
|
+
exports.$footer = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'footer'));
|
|
1058
|
+
exports.$form = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'form'));
|
|
1059
|
+
exports.$h1 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h1'));
|
|
1060
|
+
exports.$h2 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h2'));
|
|
1061
|
+
exports.$h3 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h3'));
|
|
1062
|
+
exports.$h4 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h4'));
|
|
1063
|
+
exports.$h5 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h5'));
|
|
1064
|
+
exports.$h6 = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'h6'));
|
|
1065
|
+
exports.$head = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'head'));
|
|
1066
|
+
exports.$header = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'header'));
|
|
1067
|
+
exports.$hgroup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'hgroup'));
|
|
1068
|
+
exports.$hr = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('hr', attrs));
|
|
1069
|
+
exports.$html = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'html'));
|
|
1070
|
+
exports.$i = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'i'));
|
|
1071
|
+
exports.$iframe = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'iframe'));
|
|
1072
|
+
exports.$img = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('img', attrs));
|
|
1073
|
+
exports.$input = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('input', attrs));
|
|
1074
|
+
exports.$ins = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ins'));
|
|
1075
|
+
exports.$kbd = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'kbd'));
|
|
1076
|
+
exports.$label = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'label'));
|
|
1077
|
+
exports.$legend = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'legend'));
|
|
1078
|
+
exports.$li = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'li'));
|
|
1079
|
+
exports.$link = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('link', attrs));
|
|
1080
|
+
exports.$main = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'main'));
|
|
1081
|
+
exports.$map = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'map'));
|
|
1082
|
+
exports.$mark = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'mark'));
|
|
1083
|
+
exports.$math = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'math'));
|
|
1084
|
+
exports.$menu = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'menu'));
|
|
1085
|
+
exports.$meta = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('meta', attrs));
|
|
1086
|
+
exports.$meter = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'meter'));
|
|
1087
|
+
exports.$nav = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'nav'));
|
|
1088
|
+
exports.$noscript = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'noscript'));
|
|
1089
|
+
exports.$object = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'object'));
|
|
1090
|
+
exports.$ol = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ol'));
|
|
1091
|
+
exports.$optgroup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'optgroup'));
|
|
1092
|
+
exports.$option = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'option'));
|
|
1093
|
+
exports.$output = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'output'));
|
|
1094
|
+
exports.$p = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'p'));
|
|
1095
|
+
exports.$picture = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'picture'));
|
|
1096
|
+
exports.$pre = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'pre'));
|
|
1097
|
+
exports.$progress = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'progress'));
|
|
1098
|
+
exports.$q = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'q'));
|
|
1099
|
+
exports.$rp = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'rp'));
|
|
1100
|
+
exports.$rt = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'rt'));
|
|
1101
|
+
exports.$ruby = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ruby'));
|
|
1102
|
+
exports.$s = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 's'));
|
|
1103
|
+
exports.$samp = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'samp'));
|
|
1104
|
+
exports.$script = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'script'));
|
|
1105
|
+
exports.$section = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'section'));
|
|
1106
|
+
exports.$select = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'select'));
|
|
1107
|
+
exports.$slot = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'slot'));
|
|
1108
|
+
exports.$small = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'small'));
|
|
1109
|
+
exports.$source = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('source', attrs));
|
|
1110
|
+
exports.$span = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'span'));
|
|
1111
|
+
exports.$strong = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'strong'));
|
|
1112
|
+
exports.$style = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'style'));
|
|
1113
|
+
exports.$sub = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'sub'));
|
|
1114
|
+
exports.$summary = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'summary'));
|
|
1115
|
+
exports.$sup = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'sup'));
|
|
1116
|
+
exports.$table = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'table'));
|
|
1117
|
+
exports.$tbody = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'tbody'));
|
|
1118
|
+
exports.$td = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'td'));
|
|
1119
|
+
exports.$template = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'template'));
|
|
1120
|
+
exports.$textarea = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'textarea'));
|
|
1121
|
+
exports.$tfoot = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'tfoot'));
|
|
1122
|
+
exports.$th = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'th'));
|
|
1123
|
+
exports.$thead = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'thead'));
|
|
1124
|
+
exports.$time = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'time'));
|
|
1125
|
+
exports.$title = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'title'));
|
|
1126
|
+
exports.$tr = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'tr'));
|
|
1127
|
+
exports.$track = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('track', attrs));
|
|
1128
|
+
exports.$u = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'u'));
|
|
1129
|
+
exports.$ul = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'ul'));
|
|
1130
|
+
exports.$var = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'var'));
|
|
1131
|
+
exports.$video = (0, as_element_factory_function_1.asElementFactory)(element_function_1.element.bind(null, 'video'));
|
|
1132
|
+
exports.$wbr = (0, as_element_factory_function_1.asElementFactory)((_, attrs) => (0, self_closing_element_function_1.selfClosingElement)('wbr', attrs));
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
/***/ }),
|
|
1136
|
+
/* 30 */
|
|
1137
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
/***/ }),
|
|
1144
|
+
/* 31 */
|
|
1145
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1149
|
+
exports.styleManager = exports.StyleManager = void 0;
|
|
1150
|
+
class StyleManager {
|
|
1151
|
+
static applyStyle(css) {
|
|
1152
|
+
if (!css)
|
|
1153
|
+
return null;
|
|
1154
|
+
const normalized = css.replace(/\s+/g, ' ').trim();
|
|
1155
|
+
if (StyleManager.styleCache.has(normalized)) {
|
|
1156
|
+
return StyleManager.styleCache.get(normalized);
|
|
1157
|
+
}
|
|
1158
|
+
const className = 'sc-' +
|
|
1159
|
+
Buffer.from(normalized).toString('base64').slice(0, 8).replace(/[^a-zA-Z0-9]/g, '') +
|
|
1160
|
+
'-' +
|
|
1161
|
+
Math.random().toString(36).slice(2, 6);
|
|
1162
|
+
StyleManager.styleCache.set(normalized, className);
|
|
1163
|
+
StyleManager.styles.push(`.${className} { ${normalized} }`);
|
|
1164
|
+
return className;
|
|
1165
|
+
}
|
|
1166
|
+
static getStyles() {
|
|
1167
|
+
return StyleManager.styles.join('\n');
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
exports.StyleManager = StyleManager;
|
|
1171
|
+
StyleManager.styleCache = new Map();
|
|
1172
|
+
StyleManager.styles = [];
|
|
1173
|
+
exports.styleManager = StyleManager;
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
/***/ }),
|
|
1177
|
+
/* 32 */
|
|
1178
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1182
|
+
exports.asId = asId;
|
|
1183
|
+
let idCounter = 0;
|
|
1184
|
+
function asId(prefix = 'id') {
|
|
1185
|
+
idCounter += 1;
|
|
1186
|
+
return `${prefix}_${idCounter}`;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
/***/ }),
|
|
1191
|
+
/* 33 */
|
|
1192
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1196
|
+
exports.asElementFactory = asElementFactory;
|
|
1197
|
+
function asElementFactory(renderer) {
|
|
1198
|
+
return (props = {}) => {
|
|
1199
|
+
const { style, className, children, textContent, innerHTML, $$, ...attrs } = props;
|
|
1200
|
+
const attributes = {
|
|
1201
|
+
cssClass: className,
|
|
1202
|
+
style,
|
|
1203
|
+
...attrs,
|
|
1204
|
+
};
|
|
1205
|
+
let content = [];
|
|
1206
|
+
if (children && children.length)
|
|
1207
|
+
content = children;
|
|
1208
|
+
if ($$ && $$.length)
|
|
1209
|
+
content = $$;
|
|
1210
|
+
if (textContent != null)
|
|
1211
|
+
content = [textContent];
|
|
1212
|
+
if (innerHTML != null)
|
|
1213
|
+
content = [innerHTML];
|
|
1214
|
+
return renderer(content, attributes);
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
/***/ }),
|
|
1220
|
+
/* 34 */
|
|
1221
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1225
|
+
exports.extractStyle = extractStyle;
|
|
1226
|
+
function extractStyle(element, style) {
|
|
1227
|
+
return undefined;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
/***/ }),
|
|
1232
|
+
/* 35 */
|
|
1233
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1237
|
+
exports.setAttrs = setAttrs;
|
|
1238
|
+
function setAttrs(target, attrs) {
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
/***/ }),
|
|
1243
|
+
/* 36 */
|
|
1244
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1248
|
+
exports.setElementStyle = setElementStyle;
|
|
1249
|
+
function setElementStyle(target, key, value) {
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
/***/ }),
|
|
1254
|
+
/* 37 */
|
|
1255
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1259
|
+
exports.setElementStyles = setElementStyles;
|
|
1260
|
+
function setElementStyles(target, styles) {
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
/***/ }),
|
|
1265
|
+
/* 38 */
|
|
1266
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1270
|
+
exports.styleOn = styleOn;
|
|
1271
|
+
function styleOn(element, event, style, elementToStyle, onlyIf) {
|
|
1272
|
+
// no-op
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
/***/ }),
|
|
1277
|
+
/* 39 */
|
|
1278
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1282
|
+
exports.styleOnFocus = styleOnFocus;
|
|
1283
|
+
const style_on_function_1 = __webpack_require__(38);
|
|
1284
|
+
function styleOnFocus(element, style, elementToStyle, onlyIf) {
|
|
1285
|
+
(0, style_on_function_1.styleOn)(element, 'focus', style, elementToStyle, onlyIf);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
/***/ }),
|
|
1290
|
+
/* 40 */
|
|
1291
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1295
|
+
exports.styleOnPointerEnter = styleOnPointerEnter;
|
|
1296
|
+
const style_on_function_1 = __webpack_require__(38);
|
|
1297
|
+
function styleOnPointerEnter(element, style, elementToStyle, onlyIf) {
|
|
1298
|
+
(0, style_on_function_1.styleOn)(element, 'mouseenter', style, elementToStyle, onlyIf);
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
/***/ }),
|
|
1303
|
+
/* 41 */
|
|
1304
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1308
|
+
exports.styled = styled;
|
|
1309
|
+
const style_manager_constant_1 = __webpack_require__(31);
|
|
1310
|
+
function styled(creator) {
|
|
1311
|
+
return (css, ...values) => (props = {}) => {
|
|
1312
|
+
const raw = css.reduce((acc, part, i) => acc + part + (values[i] || ''), '').trim();
|
|
1313
|
+
const className = style_manager_constant_1.styleManager.applyStyle(raw) || '';
|
|
1314
|
+
const propsWithClass = {
|
|
1315
|
+
...props,
|
|
1316
|
+
className: [className, props.className].filter(Boolean).join(' '),
|
|
1317
|
+
};
|
|
1318
|
+
return creator(propsWithClass);
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
/***/ }),
|
|
1324
|
+
/* 42 */
|
|
1325
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1329
|
+
exports.AppServerBucketvoreConfig = void 0;
|
|
1330
|
+
class AppServerBucketvoreConfig {
|
|
1331
|
+
constructor() {
|
|
1332
|
+
this.AWS_PROFILE = process.env['AWS_PROFILE'] || 'default';
|
|
1333
|
+
this.HTTP_PORT = process.env['HTTP_PORT'] || '3007';
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
exports.AppServerBucketvoreConfig = AppServerBucketvoreConfig;
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
/***/ }),
|
|
1340
|
+
/* 43 */
|
|
1341
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Design System for BucketVore UI
|
|
1346
|
+
* Modern dark theme file explorer
|
|
1347
|
+
*/
|
|
1348
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1349
|
+
exports.DESIGN_SYSTEM_STYLES = void 0;
|
|
1350
|
+
exports.DESIGN_SYSTEM_STYLES = `
|
|
1351
|
+
/* ====================================================================
|
|
1352
|
+
Design System Variables
|
|
1353
|
+
==================================================================== */
|
|
1354
|
+
|
|
1355
|
+
:root {
|
|
1356
|
+
/* Colors - Dark Theme */
|
|
1357
|
+
--color-bg-primary: #1a1a1a;
|
|
1358
|
+
--color-bg-secondary: #242424;
|
|
1359
|
+
--color-bg-tertiary: #2d2d2d;
|
|
1360
|
+
--color-border: #3a3a3a;
|
|
1361
|
+
--color-border-light: #4a4a4a;
|
|
1362
|
+
--color-text-primary: #e8e8e8;
|
|
1363
|
+
--color-text-secondary: #a0a0a0;
|
|
1364
|
+
--color-text-tertiary: #707070;
|
|
1365
|
+
|
|
1366
|
+
/* Accents */
|
|
1367
|
+
--color-accent-primary: #0ea5e9;
|
|
1368
|
+
--color-accent-secondary: #8b5cf6;
|
|
1369
|
+
--color-accent-tertiary: #06b6d4;
|
|
1370
|
+
|
|
1371
|
+
/* Status Colors */
|
|
1372
|
+
--color-status-success: #10b981;
|
|
1373
|
+
--color-status-warning: #f59e0b;
|
|
1374
|
+
--color-status-error: #ef4444;
|
|
1375
|
+
--color-status-info: #06b6d4;
|
|
1376
|
+
|
|
1377
|
+
/* Typography */
|
|
1378
|
+
--font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
1379
|
+
--font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
1380
|
+
--weight-normal: 400;
|
|
1381
|
+
--weight-medium: 500;
|
|
1382
|
+
--weight-semibold: 600;
|
|
1383
|
+
--weight-bold: 700;
|
|
1384
|
+
|
|
1385
|
+
/* Font Sizes */
|
|
1386
|
+
--size-xs: 0.75rem;
|
|
1387
|
+
--size-sm: 0.875rem;
|
|
1388
|
+
--size-base: 1rem;
|
|
1389
|
+
--size-lg: 1.125rem;
|
|
1390
|
+
--size-xl: 1.25rem;
|
|
1391
|
+
--size-2xl: 1.5rem;
|
|
1392
|
+
|
|
1393
|
+
/* Spacing */
|
|
1394
|
+
--space-1: 0.25rem;
|
|
1395
|
+
--space-2: 0.5rem;
|
|
1396
|
+
--space-3: 0.75rem;
|
|
1397
|
+
--space-4: 1rem;
|
|
1398
|
+
--space-6: 1.5rem;
|
|
1399
|
+
--space-8: 2rem;
|
|
1400
|
+
|
|
1401
|
+
/* Border Radius */
|
|
1402
|
+
--radius-sm: 4px;
|
|
1403
|
+
--radius-md: 8px;
|
|
1404
|
+
--radius-lg: 12px;
|
|
1405
|
+
|
|
1406
|
+
/* Transitions */
|
|
1407
|
+
--transition-fast: all 150ms ease-out;
|
|
1408
|
+
--transition-base: all 300ms ease-out;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
/* ====================================================================
|
|
1412
|
+
Global Reset & Base Styles
|
|
1413
|
+
==================================================================== */
|
|
1414
|
+
|
|
1415
|
+
* {
|
|
1416
|
+
margin: 0;
|
|
1417
|
+
padding: 0;
|
|
1418
|
+
box-sizing: border-box;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
html, body {
|
|
1422
|
+
height: 100%;
|
|
1423
|
+
overflow: hidden;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
body {
|
|
1427
|
+
font-family: var(--font-primary);
|
|
1428
|
+
background-color: var(--color-bg-primary);
|
|
1429
|
+
color: var(--color-text-primary);
|
|
1430
|
+
font-size: var(--size-base);
|
|
1431
|
+
font-weight: var(--weight-normal);
|
|
1432
|
+
line-height: 1.5;
|
|
1433
|
+
display: flex;
|
|
1434
|
+
flex-direction: column;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/* ====================================================================
|
|
1438
|
+
Layout
|
|
1439
|
+
==================================================================== */
|
|
1440
|
+
|
|
1441
|
+
header {
|
|
1442
|
+
display: flex;
|
|
1443
|
+
align-items: center;
|
|
1444
|
+
justify-content: space-between;
|
|
1445
|
+
height: 64px;
|
|
1446
|
+
padding: 0 var(--space-8);
|
|
1447
|
+
background-color: var(--color-bg-secondary);
|
|
1448
|
+
border-bottom: 1px solid var(--color-border);
|
|
1449
|
+
flex-shrink: 0;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.header-left {
|
|
1453
|
+
display: flex;
|
|
1454
|
+
align-items: center;
|
|
1455
|
+
gap: var(--space-4);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
.header-info h1 {
|
|
1459
|
+
font-size: var(--size-xl);
|
|
1460
|
+
font-weight: var(--weight-semibold);
|
|
1461
|
+
color: var(--color-text-primary);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
.header-info p {
|
|
1465
|
+
font-size: var(--size-sm);
|
|
1466
|
+
color: var(--color-text-secondary);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
.header-actions {
|
|
1470
|
+
display: flex;
|
|
1471
|
+
gap: var(--space-3);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.container {
|
|
1475
|
+
flex: 1;
|
|
1476
|
+
display: flex;
|
|
1477
|
+
overflow: hidden;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
aside {
|
|
1481
|
+
width: 280px;
|
|
1482
|
+
background-color: var(--color-bg-secondary);
|
|
1483
|
+
border-right: 1px solid var(--color-border);
|
|
1484
|
+
display: flex;
|
|
1485
|
+
flex-direction: column;
|
|
1486
|
+
flex-shrink: 0;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
.sidebar-header {
|
|
1490
|
+
padding: var(--space-4);
|
|
1491
|
+
border-bottom: 1px solid var(--color-border);
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
.sidebar-header h2 {
|
|
1495
|
+
font-size: var(--size-sm);
|
|
1496
|
+
font-weight: var(--weight-semibold);
|
|
1497
|
+
text-transform: uppercase;
|
|
1498
|
+
letter-spacing: 0.5px;
|
|
1499
|
+
color: var(--color-text-secondary);
|
|
1500
|
+
margin-bottom: var(--space-3);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
.bucket-list {
|
|
1504
|
+
flex: 1;
|
|
1505
|
+
overflow-y: auto;
|
|
1506
|
+
padding: var(--space-2);
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
.bucket-item {
|
|
1510
|
+
display: flex;
|
|
1511
|
+
align-items: center;
|
|
1512
|
+
gap: var(--space-3);
|
|
1513
|
+
padding: var(--space-3);
|
|
1514
|
+
cursor: pointer;
|
|
1515
|
+
border-radius: var(--radius-md);
|
|
1516
|
+
transition: var(--transition-fast);
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
.bucket-item:hover {
|
|
1520
|
+
background-color: var(--color-bg-tertiary);
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
.bucket-item.active {
|
|
1524
|
+
background-color: var(--color-bg-tertiary);
|
|
1525
|
+
color: var(--color-accent-primary);
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
.bucket-icon {
|
|
1529
|
+
font-size: var(--size-xl);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.bucket-info {
|
|
1533
|
+
flex: 1;
|
|
1534
|
+
min-width: 0;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.bucket-name {
|
|
1538
|
+
font-weight: var(--weight-medium);
|
|
1539
|
+
white-space: nowrap;
|
|
1540
|
+
overflow: hidden;
|
|
1541
|
+
text-overflow: ellipsis;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
.bucket-date {
|
|
1545
|
+
font-size: var(--size-xs);
|
|
1546
|
+
color: var(--color-text-secondary);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
main {
|
|
1550
|
+
flex: 1;
|
|
1551
|
+
display: flex;
|
|
1552
|
+
flex-direction: column;
|
|
1553
|
+
overflow: hidden;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
.toolbar {
|
|
1557
|
+
display: flex;
|
|
1558
|
+
align-items: center;
|
|
1559
|
+
justify-content: space-between;
|
|
1560
|
+
padding: var(--space-4) var(--space-6);
|
|
1561
|
+
background-color: var(--color-bg-secondary);
|
|
1562
|
+
border-bottom: 1px solid var(--color-border);
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.breadcrumbs {
|
|
1566
|
+
display: flex;
|
|
1567
|
+
align-items: center;
|
|
1568
|
+
gap: var(--space-2);
|
|
1569
|
+
flex: 1;
|
|
1570
|
+
min-width: 0;
|
|
1571
|
+
overflow-x: auto;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
.breadcrumb-item {
|
|
1575
|
+
background: none;
|
|
1576
|
+
border: none;
|
|
1577
|
+
color: var(--color-text-secondary);
|
|
1578
|
+
font-size: var(--size-sm);
|
|
1579
|
+
cursor: pointer;
|
|
1580
|
+
padding: var(--space-1) var(--space-2);
|
|
1581
|
+
border-radius: var(--radius-sm);
|
|
1582
|
+
transition: var(--transition-fast);
|
|
1583
|
+
white-space: nowrap;
|
|
1584
|
+
font-family: var(--font-primary);
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
.breadcrumb-item:hover {
|
|
1588
|
+
background-color: var(--color-bg-tertiary);
|
|
1589
|
+
color: var(--color-text-primary);
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
.breadcrumb-separator {
|
|
1593
|
+
color: var(--color-text-tertiary);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
.toolbar-actions {
|
|
1597
|
+
display: flex;
|
|
1598
|
+
gap: var(--space-2);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.file-explorer {
|
|
1602
|
+
flex: 1;
|
|
1603
|
+
overflow-y: auto;
|
|
1604
|
+
padding: var(--space-4);
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
.file-list {
|
|
1608
|
+
display: flex;
|
|
1609
|
+
flex-direction: column;
|
|
1610
|
+
gap: var(--space-1);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
.file-item {
|
|
1614
|
+
display: flex;
|
|
1615
|
+
align-items: center;
|
|
1616
|
+
gap: var(--space-3);
|
|
1617
|
+
padding: var(--space-3) var(--space-4);
|
|
1618
|
+
background-color: var(--color-bg-secondary);
|
|
1619
|
+
border: 1px solid var(--color-border);
|
|
1620
|
+
border-radius: var(--radius-md);
|
|
1621
|
+
transition: var(--transition-fast);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
.file-item:hover {
|
|
1625
|
+
background-color: var(--color-bg-tertiary);
|
|
1626
|
+
border-color: var(--color-border-light);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
.file-item.folder {
|
|
1630
|
+
font-weight: var(--weight-medium);
|
|
1631
|
+
cursor: pointer;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.file-icon {
|
|
1635
|
+
font-size: var(--size-xl);
|
|
1636
|
+
flex-shrink: 0;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
.file-info {
|
|
1640
|
+
flex: 1;
|
|
1641
|
+
min-width: 0;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.file-name {
|
|
1645
|
+
font-size: var(--size-sm);
|
|
1646
|
+
white-space: nowrap;
|
|
1647
|
+
overflow: hidden;
|
|
1648
|
+
text-overflow: ellipsis;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
.file-meta {
|
|
1652
|
+
font-size: var(--size-xs);
|
|
1653
|
+
color: var(--color-text-secondary);
|
|
1654
|
+
margin-top: var(--space-1);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
.file-actions {
|
|
1658
|
+
display: flex;
|
|
1659
|
+
gap: var(--space-2);
|
|
1660
|
+
opacity: 0;
|
|
1661
|
+
transition: var(--transition-fast);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
.file-item:hover .file-actions {
|
|
1665
|
+
opacity: 1;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
/* ====================================================================
|
|
1669
|
+
Buttons
|
|
1670
|
+
==================================================================== */
|
|
1671
|
+
|
|
1672
|
+
.btn {
|
|
1673
|
+
display: inline-flex;
|
|
1674
|
+
align-items: center;
|
|
1675
|
+
justify-content: center;
|
|
1676
|
+
gap: var(--space-2);
|
|
1677
|
+
padding: var(--space-2) var(--space-4);
|
|
1678
|
+
background-color: var(--color-accent-primary);
|
|
1679
|
+
color: #ffffff;
|
|
1680
|
+
border: none;
|
|
1681
|
+
border-radius: var(--radius-sm);
|
|
1682
|
+
font-size: var(--size-sm);
|
|
1683
|
+
font-weight: var(--weight-medium);
|
|
1684
|
+
cursor: pointer;
|
|
1685
|
+
transition: var(--transition-fast);
|
|
1686
|
+
font-family: var(--font-primary);
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.btn:hover:not(:disabled) {
|
|
1690
|
+
background-color: #0d9ecf;
|
|
1691
|
+
transform: scale(1.02);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.btn:active:not(:disabled) {
|
|
1695
|
+
transform: scale(0.98);
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
.btn:disabled {
|
|
1699
|
+
opacity: 0.5;
|
|
1700
|
+
cursor: not-allowed;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
.btn.secondary {
|
|
1704
|
+
background-color: var(--color-bg-tertiary);
|
|
1705
|
+
border: 1px solid var(--color-border);
|
|
1706
|
+
color: var(--color-text-primary);
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
.btn.secondary:hover:not(:disabled) {
|
|
1710
|
+
background-color: var(--color-border);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
.btn-icon {
|
|
1714
|
+
background: none;
|
|
1715
|
+
border: none;
|
|
1716
|
+
color: var(--color-text-secondary);
|
|
1717
|
+
font-size: var(--size-lg);
|
|
1718
|
+
cursor: pointer;
|
|
1719
|
+
padding: var(--space-1);
|
|
1720
|
+
border-radius: var(--radius-sm);
|
|
1721
|
+
transition: var(--transition-fast);
|
|
1722
|
+
display: flex;
|
|
1723
|
+
align-items: center;
|
|
1724
|
+
justify-content: center;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
.btn-icon:hover {
|
|
1728
|
+
background-color: var(--color-bg-tertiary);
|
|
1729
|
+
color: var(--color-text-primary);
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
.btn-close {
|
|
1733
|
+
background: none;
|
|
1734
|
+
border: none;
|
|
1735
|
+
color: var(--color-text-secondary);
|
|
1736
|
+
font-size: var(--size-xl);
|
|
1737
|
+
cursor: pointer;
|
|
1738
|
+
padding: var(--space-2);
|
|
1739
|
+
line-height: 1;
|
|
1740
|
+
transition: var(--transition-fast);
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
.btn-close:hover {
|
|
1744
|
+
color: var(--color-text-primary);
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
/* ====================================================================
|
|
1748
|
+
Modal & Preview
|
|
1749
|
+
==================================================================== */
|
|
1750
|
+
|
|
1751
|
+
.modal-overlay {
|
|
1752
|
+
position: fixed;
|
|
1753
|
+
top: 0;
|
|
1754
|
+
left: 0;
|
|
1755
|
+
right: 0;
|
|
1756
|
+
bottom: 0;
|
|
1757
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
1758
|
+
display: flex;
|
|
1759
|
+
align-items: center;
|
|
1760
|
+
justify-content: center;
|
|
1761
|
+
z-index: 1000;
|
|
1762
|
+
padding: var(--space-8);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
.modal {
|
|
1766
|
+
background-color: var(--color-bg-secondary);
|
|
1767
|
+
border: 1px solid var(--color-border);
|
|
1768
|
+
border-radius: var(--radius-lg);
|
|
1769
|
+
max-width: 90vw;
|
|
1770
|
+
max-height: 90vh;
|
|
1771
|
+
display: flex;
|
|
1772
|
+
flex-direction: column;
|
|
1773
|
+
overflow: hidden;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
.file-preview {
|
|
1777
|
+
display: flex;
|
|
1778
|
+
flex-direction: column;
|
|
1779
|
+
width: 100%;
|
|
1780
|
+
height: 100%;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
.preview-header {
|
|
1784
|
+
display: flex;
|
|
1785
|
+
align-items: center;
|
|
1786
|
+
justify-content: space-between;
|
|
1787
|
+
padding: var(--space-4) var(--space-6);
|
|
1788
|
+
border-bottom: 1px solid var(--color-border);
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
.preview-header h3 {
|
|
1792
|
+
font-size: var(--size-lg);
|
|
1793
|
+
font-weight: var(--weight-semibold);
|
|
1794
|
+
margin: 0;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
.preview-meta {
|
|
1798
|
+
padding: var(--space-3) var(--space-6);
|
|
1799
|
+
background-color: var(--color-bg-tertiary);
|
|
1800
|
+
font-size: var(--size-xs);
|
|
1801
|
+
color: var(--color-text-secondary);
|
|
1802
|
+
border-bottom: 1px solid var(--color-border);
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
.preview-content {
|
|
1806
|
+
flex: 1;
|
|
1807
|
+
overflow: auto;
|
|
1808
|
+
padding: var(--space-6);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
.preview-image-container,
|
|
1812
|
+
.preview-video-container,
|
|
1813
|
+
.preview-audio-container,
|
|
1814
|
+
.preview-pdf-container {
|
|
1815
|
+
display: flex;
|
|
1816
|
+
align-items: center;
|
|
1817
|
+
justify-content: center;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
.preview-text-container pre {
|
|
1821
|
+
background-color: var(--color-bg-tertiary);
|
|
1822
|
+
border: 1px solid var(--color-border);
|
|
1823
|
+
border-radius: var(--radius-md);
|
|
1824
|
+
padding: var(--space-4);
|
|
1825
|
+
overflow: auto;
|
|
1826
|
+
font-family: var(--font-mono);
|
|
1827
|
+
font-size: var(--size-sm);
|
|
1828
|
+
line-height: 1.6;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
.preview-unavailable {
|
|
1832
|
+
display: flex;
|
|
1833
|
+
flex-direction: column;
|
|
1834
|
+
align-items: center;
|
|
1835
|
+
justify-content: center;
|
|
1836
|
+
gap: var(--space-4);
|
|
1837
|
+
padding: var(--space-8);
|
|
1838
|
+
text-align: center;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
.preview-actions {
|
|
1842
|
+
display: flex;
|
|
1843
|
+
gap: var(--space-3);
|
|
1844
|
+
padding: var(--space-4) var(--space-6);
|
|
1845
|
+
border-top: 1px solid var(--color-border);
|
|
1846
|
+
background-color: var(--color-bg-secondary);
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
/* ====================================================================
|
|
1850
|
+
Upload Zone
|
|
1851
|
+
==================================================================== */
|
|
1852
|
+
|
|
1853
|
+
.upload-zone {
|
|
1854
|
+
border: 2px dashed var(--color-border);
|
|
1855
|
+
border-radius: var(--radius-lg);
|
|
1856
|
+
padding: var(--space-8);
|
|
1857
|
+
text-align: center;
|
|
1858
|
+
transition: var(--transition-fast);
|
|
1859
|
+
cursor: pointer;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
.upload-zone:hover,
|
|
1863
|
+
.upload-zone.drag-over {
|
|
1864
|
+
border-color: var(--color-accent-primary);
|
|
1865
|
+
background-color: var(--color-bg-tertiary);
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
.upload-zone-icon {
|
|
1869
|
+
font-size: 3rem;
|
|
1870
|
+
margin-bottom: var(--space-4);
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
.upload-zone input[type="file"] {
|
|
1874
|
+
display: none;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
/* ====================================================================
|
|
1878
|
+
States
|
|
1879
|
+
==================================================================== */
|
|
1880
|
+
|
|
1881
|
+
.loading {
|
|
1882
|
+
display: flex;
|
|
1883
|
+
flex-direction: column;
|
|
1884
|
+
align-items: center;
|
|
1885
|
+
justify-content: center;
|
|
1886
|
+
gap: var(--space-4);
|
|
1887
|
+
padding: var(--space-8);
|
|
1888
|
+
color: var(--color-text-secondary);
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
.spinner {
|
|
1892
|
+
width: 40px;
|
|
1893
|
+
height: 40px;
|
|
1894
|
+
border: 3px solid var(--color-border);
|
|
1895
|
+
border-top-color: var(--color-accent-primary);
|
|
1896
|
+
border-radius: 50%;
|
|
1897
|
+
animation: spin 1s linear infinite;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
@keyframes spin {
|
|
1901
|
+
to { transform: rotate(360deg); }
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
.empty-state {
|
|
1905
|
+
display: flex;
|
|
1906
|
+
flex-direction: column;
|
|
1907
|
+
align-items: center;
|
|
1908
|
+
justify-content: center;
|
|
1909
|
+
gap: var(--space-4);
|
|
1910
|
+
padding: var(--space-8);
|
|
1911
|
+
color: var(--color-text-secondary);
|
|
1912
|
+
text-align: center;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
.empty-state-icon {
|
|
1916
|
+
font-size: 4rem;
|
|
1917
|
+
opacity: 0.5;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
.error {
|
|
1921
|
+
display: flex;
|
|
1922
|
+
align-items: center;
|
|
1923
|
+
gap: var(--space-3);
|
|
1924
|
+
padding: var(--space-4);
|
|
1925
|
+
background-color: rgba(239, 68, 68, 0.1);
|
|
1926
|
+
border: 1px solid var(--color-status-error);
|
|
1927
|
+
border-radius: var(--radius-md);
|
|
1928
|
+
color: var(--color-status-error);
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
.error-icon {
|
|
1932
|
+
font-size: var(--size-xl);
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
/* ====================================================================
|
|
1936
|
+
Scrollbars
|
|
1937
|
+
==================================================================== */
|
|
1938
|
+
|
|
1939
|
+
::-webkit-scrollbar {
|
|
1940
|
+
width: 12px;
|
|
1941
|
+
height: 12px;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
::-webkit-scrollbar-track {
|
|
1945
|
+
background-color: var(--color-bg-primary);
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
::-webkit-scrollbar-thumb {
|
|
1949
|
+
background-color: var(--color-border);
|
|
1950
|
+
border-radius: var(--radius-sm);
|
|
1951
|
+
border: 2px solid var(--color-bg-primary);
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
::-webkit-scrollbar-thumb:hover {
|
|
1955
|
+
background-color: var(--color-border-light);
|
|
1956
|
+
}
|
|
1957
|
+
`;
|
|
1958
|
+
|
|
1959
|
+
|
|
1960
|
+
/***/ }),
|
|
1961
|
+
/* 44 */
|
|
1962
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
var _a, _b;
|
|
1966
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1967
|
+
exports.BucketsController = void 0;
|
|
1968
|
+
const tslib_1 = __webpack_require__(4);
|
|
1969
|
+
const common_1 = __webpack_require__(5);
|
|
1970
|
+
const s3_service_1 = __webpack_require__(45);
|
|
1971
|
+
const html_generator_service_1 = __webpack_require__(49);
|
|
1972
|
+
let BucketsController = class BucketsController {
|
|
1973
|
+
constructor(s3Service, htmlGenerator) {
|
|
1974
|
+
this.s3Service = s3Service;
|
|
1975
|
+
this.htmlGenerator = htmlGenerator;
|
|
1976
|
+
}
|
|
1977
|
+
async get() {
|
|
1978
|
+
try {
|
|
1979
|
+
const buckets = await this.s3Service.listBuckets();
|
|
1980
|
+
return this.htmlGenerator.generateBucketsListHtml(buckets);
|
|
1981
|
+
}
|
|
1982
|
+
catch (error) {
|
|
1983
|
+
console.error('Error listing buckets:', error);
|
|
1984
|
+
return this.htmlGenerator.generateErrorHtml('Failed to load buckets');
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
exports.BucketsController = BucketsController;
|
|
1989
|
+
tslib_1.__decorate([
|
|
1990
|
+
(0, common_1.Get)(),
|
|
1991
|
+
tslib_1.__metadata("design:type", Function),
|
|
1992
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
1993
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1994
|
+
], BucketsController.prototype, "get", null);
|
|
1995
|
+
exports.BucketsController = BucketsController = tslib_1.__decorate([
|
|
1996
|
+
(0, common_1.Controller)('api/buckets'),
|
|
1997
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object, typeof (_b = typeof html_generator_service_1.HtmlGeneratorService !== "undefined" && html_generator_service_1.HtmlGeneratorService) === "function" ? _b : Object])
|
|
1998
|
+
], BucketsController);
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
/***/ }),
|
|
2002
|
+
/* 45 */
|
|
2003
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
var _a, _b;
|
|
2007
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2008
|
+
exports.S3Service = void 0;
|
|
2009
|
+
const tslib_1 = __webpack_require__(4);
|
|
2010
|
+
const common_1 = __webpack_require__(5);
|
|
2011
|
+
const client_s3_1 = __webpack_require__(46);
|
|
2012
|
+
const s3_request_presigner_1 = __webpack_require__(47);
|
|
2013
|
+
const app_server_bucketvore_config_class_1 = __webpack_require__(42);
|
|
2014
|
+
const credential_providers_1 = __webpack_require__(48);
|
|
2015
|
+
let S3Service = class S3Service {
|
|
2016
|
+
constructor(s3Client, config) {
|
|
2017
|
+
this.s3Client = s3Client;
|
|
2018
|
+
this.config = config;
|
|
2019
|
+
this.bucketRegionCache = new Map();
|
|
2020
|
+
this.regionalClients = new Map();
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* Get or create an S3 client for a specific region
|
|
2024
|
+
*/
|
|
2025
|
+
async getClientForBucket(bucket) {
|
|
2026
|
+
// Try to get cached region
|
|
2027
|
+
let region = this.bucketRegionCache.get(bucket);
|
|
2028
|
+
if (!region) {
|
|
2029
|
+
// Fetch bucket region
|
|
2030
|
+
try {
|
|
2031
|
+
const command = new client_s3_1.GetBucketLocationCommand({ Bucket: bucket });
|
|
2032
|
+
const response = await this.s3Client.send(command);
|
|
2033
|
+
// LocationConstraint is null for us-east-1
|
|
2034
|
+
region = response.LocationConstraint || 'us-east-1';
|
|
2035
|
+
this.bucketRegionCache.set(bucket, region);
|
|
2036
|
+
}
|
|
2037
|
+
catch (error) {
|
|
2038
|
+
console.warn(`Could not get region for bucket ${bucket}, using us-east-1 as fallback`, error);
|
|
2039
|
+
region = 'us-east-1';
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
// Return existing client if we have one for this region
|
|
2043
|
+
if (this.regionalClients.has(region)) {
|
|
2044
|
+
return this.regionalClients.get(region);
|
|
2045
|
+
}
|
|
2046
|
+
// Create new regional client
|
|
2047
|
+
const clientConfig = {
|
|
2048
|
+
region,
|
|
2049
|
+
};
|
|
2050
|
+
if (this.config.AWS_PROFILE) {
|
|
2051
|
+
clientConfig.credentials = (0, credential_providers_1.fromIni)({ profile: this.config.AWS_PROFILE });
|
|
2052
|
+
}
|
|
2053
|
+
const regionalClient = new client_s3_1.S3Client(clientConfig);
|
|
2054
|
+
this.regionalClients.set(region, regionalClient);
|
|
2055
|
+
return regionalClient;
|
|
2056
|
+
}
|
|
2057
|
+
async listBuckets() {
|
|
2058
|
+
const command = new client_s3_1.ListBucketsCommand({});
|
|
2059
|
+
const response = await this.s3Client.send(command);
|
|
2060
|
+
return (response.Buckets || []).map(bucket => ({
|
|
2061
|
+
name: bucket.Name,
|
|
2062
|
+
creationDate: bucket.CreationDate
|
|
2063
|
+
}));
|
|
2064
|
+
}
|
|
2065
|
+
async listObjects(bucket, prefix) {
|
|
2066
|
+
const client = await this.getClientForBucket(bucket);
|
|
2067
|
+
const command = new client_s3_1.ListObjectsV2Command({
|
|
2068
|
+
Bucket: bucket,
|
|
2069
|
+
Prefix: prefix || '',
|
|
2070
|
+
Delimiter: '/'
|
|
2071
|
+
});
|
|
2072
|
+
const response = await client.send(command);
|
|
2073
|
+
const objects = (response.Contents || [])
|
|
2074
|
+
.filter(obj => obj.Key !== prefix) // Filter out the folder itself
|
|
2075
|
+
.map(obj => ({
|
|
2076
|
+
...obj,
|
|
2077
|
+
Key: obj.Key,
|
|
2078
|
+
isFolder: false
|
|
2079
|
+
}));
|
|
2080
|
+
const commonPrefixes = (response.CommonPrefixes || [])
|
|
2081
|
+
.map(cp => cp.Prefix)
|
|
2082
|
+
.filter(p => p !== prefix);
|
|
2083
|
+
return { objects, commonPrefixes };
|
|
2084
|
+
}
|
|
2085
|
+
async getObject(bucket, key) {
|
|
2086
|
+
const client = await this.getClientForBucket(bucket);
|
|
2087
|
+
const command = new client_s3_1.GetObjectCommand({
|
|
2088
|
+
Bucket: bucket,
|
|
2089
|
+
Key: key
|
|
2090
|
+
});
|
|
2091
|
+
const response = await client.send(command);
|
|
2092
|
+
const body = await response.Body?.transformToByteArray();
|
|
2093
|
+
return {
|
|
2094
|
+
body,
|
|
2095
|
+
contentType: response.ContentType,
|
|
2096
|
+
contentLength: response.ContentLength
|
|
2097
|
+
};
|
|
2098
|
+
}
|
|
2099
|
+
async getObjectMetadata(bucket, key) {
|
|
2100
|
+
const client = await this.getClientForBucket(bucket);
|
|
2101
|
+
const command = new client_s3_1.HeadObjectCommand({
|
|
2102
|
+
Bucket: bucket,
|
|
2103
|
+
Key: key
|
|
2104
|
+
});
|
|
2105
|
+
return await client.send(command);
|
|
2106
|
+
}
|
|
2107
|
+
async getPresignedDownloadUrl(bucket, key, expiresIn = 3600) {
|
|
2108
|
+
const client = await this.getClientForBucket(bucket);
|
|
2109
|
+
const command = new client_s3_1.GetObjectCommand({
|
|
2110
|
+
Bucket: bucket,
|
|
2111
|
+
Key: key,
|
|
2112
|
+
ResponseContentDisposition: `attachment; filename="${key.split('/').pop()}"`
|
|
2113
|
+
});
|
|
2114
|
+
return await (0, s3_request_presigner_1.getSignedUrl)(client, command, { expiresIn });
|
|
2115
|
+
}
|
|
2116
|
+
async getPresignedViewUrl(bucket, key, expiresIn = 3600) {
|
|
2117
|
+
const client = await this.getClientForBucket(bucket);
|
|
2118
|
+
const command = new client_s3_1.GetObjectCommand({
|
|
2119
|
+
Bucket: bucket,
|
|
2120
|
+
Key: key,
|
|
2121
|
+
ResponseContentDisposition: 'inline'
|
|
2122
|
+
});
|
|
2123
|
+
return await (0, s3_request_presigner_1.getSignedUrl)(client, command, { expiresIn });
|
|
2124
|
+
}
|
|
2125
|
+
async uploadObject(bucket, key, body, contentType) {
|
|
2126
|
+
const client = await this.getClientForBucket(bucket);
|
|
2127
|
+
const command = new client_s3_1.PutObjectCommand({
|
|
2128
|
+
Bucket: bucket,
|
|
2129
|
+
Key: key,
|
|
2130
|
+
Body: body,
|
|
2131
|
+
ContentType: contentType
|
|
2132
|
+
});
|
|
2133
|
+
await client.send(command);
|
|
2134
|
+
}
|
|
2135
|
+
async deleteObject(bucket, key) {
|
|
2136
|
+
const client = await this.getClientForBucket(bucket);
|
|
2137
|
+
const command = new client_s3_1.DeleteObjectCommand({
|
|
2138
|
+
Bucket: bucket,
|
|
2139
|
+
Key: key
|
|
2140
|
+
});
|
|
2141
|
+
await client.send(command);
|
|
2142
|
+
}
|
|
2143
|
+
async deleteObjects(bucket, keys) {
|
|
2144
|
+
if (keys.length === 0)
|
|
2145
|
+
return;
|
|
2146
|
+
const client = await this.getClientForBucket(bucket);
|
|
2147
|
+
const command = new client_s3_1.DeleteObjectsCommand({
|
|
2148
|
+
Bucket: bucket,
|
|
2149
|
+
Delete: {
|
|
2150
|
+
Objects: keys.map(key => ({ Key: key }))
|
|
2151
|
+
}
|
|
2152
|
+
});
|
|
2153
|
+
await client.send(command);
|
|
2154
|
+
}
|
|
2155
|
+
async deleteFolder(bucket, prefix) {
|
|
2156
|
+
const { objects } = await this.listObjects(bucket, prefix);
|
|
2157
|
+
const keys = objects.map(obj => obj.Key);
|
|
2158
|
+
if (keys.length > 0) {
|
|
2159
|
+
await this.deleteObjects(bucket, keys);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
formatFileSize(bytes) {
|
|
2163
|
+
if (!bytes)
|
|
2164
|
+
return '0 B';
|
|
2165
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
2166
|
+
let size = bytes;
|
|
2167
|
+
let unitIndex = 0;
|
|
2168
|
+
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
2169
|
+
size /= 1024;
|
|
2170
|
+
unitIndex++;
|
|
2171
|
+
}
|
|
2172
|
+
return `${size.toFixed(2)} ${units[unitIndex]}`;
|
|
2173
|
+
}
|
|
2174
|
+
getFileExtension(key) {
|
|
2175
|
+
const parts = key.split('.');
|
|
2176
|
+
return parts.length > 1 ? parts[parts.length - 1].toLowerCase() : '';
|
|
2177
|
+
}
|
|
2178
|
+
getFileName(key) {
|
|
2179
|
+
return key.split('/').pop() || key;
|
|
2180
|
+
}
|
|
2181
|
+
getFolderName(prefix) {
|
|
2182
|
+
const parts = prefix.replace(/\/$/, '').split('/');
|
|
2183
|
+
return parts[parts.length - 1] || prefix;
|
|
2184
|
+
}
|
|
2185
|
+
};
|
|
2186
|
+
exports.S3Service = S3Service;
|
|
2187
|
+
exports.S3Service = S3Service = tslib_1.__decorate([
|
|
2188
|
+
(0, common_1.Injectable)(),
|
|
2189
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof client_s3_1.S3Client !== "undefined" && client_s3_1.S3Client) === "function" ? _a : Object, typeof (_b = typeof app_server_bucketvore_config_class_1.AppServerBucketvoreConfig !== "undefined" && app_server_bucketvore_config_class_1.AppServerBucketvoreConfig) === "function" ? _b : Object])
|
|
2190
|
+
], S3Service);
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
/***/ }),
|
|
2194
|
+
/* 46 */
|
|
2195
|
+
/***/ ((module) => {
|
|
2196
|
+
|
|
2197
|
+
module.exports = require("@aws-sdk/client-s3");
|
|
2198
|
+
|
|
2199
|
+
/***/ }),
|
|
2200
|
+
/* 47 */
|
|
2201
|
+
/***/ ((module) => {
|
|
2202
|
+
|
|
2203
|
+
module.exports = require("@aws-sdk/s3-request-presigner");
|
|
2204
|
+
|
|
2205
|
+
/***/ }),
|
|
2206
|
+
/* 48 */
|
|
2207
|
+
/***/ ((module) => {
|
|
2208
|
+
|
|
2209
|
+
module.exports = require("@aws-sdk/credential-providers");
|
|
2210
|
+
|
|
2211
|
+
/***/ }),
|
|
2212
|
+
/* 49 */
|
|
2213
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
var _a;
|
|
2217
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2218
|
+
exports.HtmlGeneratorService = void 0;
|
|
2219
|
+
const tslib_1 = __webpack_require__(4);
|
|
2220
|
+
const common_1 = __webpack_require__(5);
|
|
2221
|
+
const server_html_1 = __webpack_require__(7);
|
|
2222
|
+
const file_preview_service_1 = __webpack_require__(50);
|
|
2223
|
+
let HtmlGeneratorService = class HtmlGeneratorService {
|
|
2224
|
+
constructor(filePreviewService) {
|
|
2225
|
+
this.filePreviewService = filePreviewService;
|
|
2226
|
+
}
|
|
2227
|
+
generateBucketsListHtml(buckets) {
|
|
2228
|
+
if (!buckets || buckets.length === 0) {
|
|
2229
|
+
return (0, server_html_1.$div)({
|
|
2230
|
+
className: 'empty-state',
|
|
2231
|
+
children: [
|
|
2232
|
+
(0, server_html_1.$div)({ className: 'empty-state-icon', textContent: '🪣' }),
|
|
2233
|
+
(0, server_html_1.$p)({ textContent: 'No buckets found' })
|
|
2234
|
+
]
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
const bucketElements = buckets.map(bucket => (0, server_html_1.$div)({
|
|
2238
|
+
className: 'bucket-item',
|
|
2239
|
+
'@click': `selectBucket('${bucket.name}')`,
|
|
2240
|
+
children: [
|
|
2241
|
+
(0, server_html_1.$div)({ className: 'bucket-icon', textContent: '🪣' }),
|
|
2242
|
+
(0, server_html_1.$div)({
|
|
2243
|
+
className: 'bucket-info',
|
|
2244
|
+
children: [
|
|
2245
|
+
(0, server_html_1.$div)({ className: 'bucket-name', textContent: bucket.name }),
|
|
2246
|
+
bucket.creationDate ? (0, server_html_1.$div)({
|
|
2247
|
+
className: 'bucket-date',
|
|
2248
|
+
textContent: new Date(bucket.creationDate).toLocaleDateString()
|
|
2249
|
+
}) : ''
|
|
2250
|
+
].filter(Boolean)
|
|
2251
|
+
})
|
|
2252
|
+
]
|
|
2253
|
+
}));
|
|
2254
|
+
return bucketElements.join('');
|
|
2255
|
+
}
|
|
2256
|
+
generateBreadcrumbs(prefix, bucket) {
|
|
2257
|
+
const parts = prefix ? prefix.split('/').filter(Boolean) : [];
|
|
2258
|
+
const breadcrumbs = [
|
|
2259
|
+
(0, server_html_1.$button)({
|
|
2260
|
+
className: 'breadcrumb-item',
|
|
2261
|
+
'@click': "navigateToFolder('')",
|
|
2262
|
+
textContent: '🪣 ' + bucket
|
|
2263
|
+
})
|
|
2264
|
+
];
|
|
2265
|
+
let currentPath = '';
|
|
2266
|
+
parts.forEach((part, index) => {
|
|
2267
|
+
currentPath += part + '/';
|
|
2268
|
+
breadcrumbs.push((0, server_html_1.$span)({ className: 'breadcrumb-separator', textContent: '/' }));
|
|
2269
|
+
breadcrumbs.push((0, server_html_1.$button)({
|
|
2270
|
+
className: 'breadcrumb-item',
|
|
2271
|
+
'@click': `navigateToFolder('${currentPath}')`,
|
|
2272
|
+
textContent: part
|
|
2273
|
+
}));
|
|
2274
|
+
});
|
|
2275
|
+
return (0, server_html_1.$div)({
|
|
2276
|
+
className: 'breadcrumbs',
|
|
2277
|
+
children: breadcrumbs
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
generateFileListHtml(objects, folders, s3Service, currentPrefix = '') {
|
|
2281
|
+
if (folders.length === 0 && objects.length === 0) {
|
|
2282
|
+
return (0, server_html_1.$div)({
|
|
2283
|
+
className: 'empty-state',
|
|
2284
|
+
children: [
|
|
2285
|
+
(0, server_html_1.$div)({ className: 'empty-state-icon', textContent: '📂' }),
|
|
2286
|
+
(0, server_html_1.$p)({ textContent: 'This folder is empty' })
|
|
2287
|
+
]
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
const folderElements = folders.map(folderPrefix => {
|
|
2291
|
+
const folderName = s3Service.getFolderName(folderPrefix);
|
|
2292
|
+
return (0, server_html_1.$div)({
|
|
2293
|
+
className: 'file-item folder',
|
|
2294
|
+
'@click': `navigateToFolder('${folderPrefix}')`,
|
|
2295
|
+
children: [
|
|
2296
|
+
(0, server_html_1.$div)({ className: 'file-icon', textContent: '📁' }),
|
|
2297
|
+
(0, server_html_1.$div)({
|
|
2298
|
+
className: 'file-info',
|
|
2299
|
+
children: [
|
|
2300
|
+
(0, server_html_1.$div)({ className: 'file-name', textContent: folderName }),
|
|
2301
|
+
(0, server_html_1.$div)({ className: 'file-meta', textContent: 'Folder' })
|
|
2302
|
+
]
|
|
2303
|
+
}),
|
|
2304
|
+
(0, server_html_1.$div)({
|
|
2305
|
+
className: 'file-actions',
|
|
2306
|
+
children: [
|
|
2307
|
+
(0, server_html_1.$button)({
|
|
2308
|
+
className: 'btn-icon',
|
|
2309
|
+
'@click.stop': `deleteFolder('${folderPrefix}')`,
|
|
2310
|
+
title: 'Delete folder',
|
|
2311
|
+
textContent: '🗑️'
|
|
2312
|
+
})
|
|
2313
|
+
]
|
|
2314
|
+
})
|
|
2315
|
+
]
|
|
2316
|
+
});
|
|
2317
|
+
});
|
|
2318
|
+
const fileElements = objects.map(obj => {
|
|
2319
|
+
const fileName = s3Service.getFileName(obj.Key);
|
|
2320
|
+
const extension = s3Service.getFileExtension(obj.Key);
|
|
2321
|
+
const icon = this.filePreviewService.getFileIcon(extension);
|
|
2322
|
+
const canPreview = this.filePreviewService.canPreview(extension);
|
|
2323
|
+
return (0, server_html_1.$div)({
|
|
2324
|
+
className: 'file-item',
|
|
2325
|
+
'@click': canPreview ? `previewFile('${obj.Key}')` : '',
|
|
2326
|
+
style: { cursor: canPreview ? 'pointer' : 'default' },
|
|
2327
|
+
children: [
|
|
2328
|
+
(0, server_html_1.$div)({ className: 'file-icon', textContent: icon }),
|
|
2329
|
+
(0, server_html_1.$div)({
|
|
2330
|
+
className: 'file-info',
|
|
2331
|
+
children: [
|
|
2332
|
+
(0, server_html_1.$div)({ className: 'file-name', textContent: fileName }),
|
|
2333
|
+
(0, server_html_1.$div)({
|
|
2334
|
+
className: 'file-meta',
|
|
2335
|
+
textContent: `${s3Service.formatFileSize(obj.Size)} · ${obj.LastModified ? new Date(obj.LastModified).toLocaleString() : ''}`
|
|
2336
|
+
})
|
|
2337
|
+
]
|
|
2338
|
+
}),
|
|
2339
|
+
(0, server_html_1.$div)({
|
|
2340
|
+
className: 'file-actions',
|
|
2341
|
+
children: [
|
|
2342
|
+
canPreview ? (0, server_html_1.$button)({
|
|
2343
|
+
className: 'btn-icon',
|
|
2344
|
+
'@click.stop': `previewFile('${obj.Key}')`,
|
|
2345
|
+
title: 'Preview',
|
|
2346
|
+
textContent: '👁️'
|
|
2347
|
+
}) : '',
|
|
2348
|
+
(0, server_html_1.$button)({
|
|
2349
|
+
className: 'btn-icon',
|
|
2350
|
+
'@click.stop': `downloadFile('${obj.Key}')`,
|
|
2351
|
+
title: 'Download',
|
|
2352
|
+
textContent: '⬇️'
|
|
2353
|
+
}),
|
|
2354
|
+
(0, server_html_1.$button)({
|
|
2355
|
+
className: 'btn-icon',
|
|
2356
|
+
'@click.stop': `deleteFile('${obj.Key}')`,
|
|
2357
|
+
title: 'Delete',
|
|
2358
|
+
textContent: '🗑️'
|
|
2359
|
+
})
|
|
2360
|
+
].filter(Boolean)
|
|
2361
|
+
})
|
|
2362
|
+
]
|
|
2363
|
+
});
|
|
2364
|
+
});
|
|
2365
|
+
return [...folderElements, ...fileElements].join('');
|
|
2366
|
+
}
|
|
2367
|
+
generateFilePreviewHtml(key, previewType, content, metadata, s3Service, presignedUrl) {
|
|
2368
|
+
const fileName = s3Service.getFileName(key);
|
|
2369
|
+
const extension = s3Service.getFileExtension(key);
|
|
2370
|
+
let previewContent = '';
|
|
2371
|
+
switch (previewType) {
|
|
2372
|
+
case 'image':
|
|
2373
|
+
previewContent = (0, server_html_1.$div)({
|
|
2374
|
+
className: 'preview-image-container',
|
|
2375
|
+
children: [
|
|
2376
|
+
(0, server_html_1.$img)({
|
|
2377
|
+
src: presignedUrl,
|
|
2378
|
+
alt: fileName,
|
|
2379
|
+
style: { maxWidth: '100%', maxHeight: '70vh', objectFit: 'contain' }
|
|
2380
|
+
})
|
|
2381
|
+
]
|
|
2382
|
+
});
|
|
2383
|
+
break;
|
|
2384
|
+
case 'text':
|
|
2385
|
+
const textContent = content.toString('utf-8');
|
|
2386
|
+
const formatted = extension === 'json' ? this.filePreviewService.formatJson(textContent) : textContent;
|
|
2387
|
+
previewContent = (0, server_html_1.$div)({
|
|
2388
|
+
className: 'preview-text-container',
|
|
2389
|
+
children: [
|
|
2390
|
+
(0, server_html_1.$pre)({
|
|
2391
|
+
children: [
|
|
2392
|
+
(0, server_html_1.$code)({
|
|
2393
|
+
textContent: formatted.substring(0, 50000) // Limit to 50KB for display
|
|
2394
|
+
})
|
|
2395
|
+
]
|
|
2396
|
+
})
|
|
2397
|
+
]
|
|
2398
|
+
});
|
|
2399
|
+
break;
|
|
2400
|
+
case 'video':
|
|
2401
|
+
previewContent = (0, server_html_1.$div)({
|
|
2402
|
+
className: 'preview-video-container',
|
|
2403
|
+
children: [
|
|
2404
|
+
(0, server_html_1.$video)({
|
|
2405
|
+
src: presignedUrl,
|
|
2406
|
+
controls: true,
|
|
2407
|
+
style: { maxWidth: '100%', maxHeight: '70vh' }
|
|
2408
|
+
})
|
|
2409
|
+
]
|
|
2410
|
+
});
|
|
2411
|
+
break;
|
|
2412
|
+
case 'audio':
|
|
2413
|
+
previewContent = (0, server_html_1.$div)({
|
|
2414
|
+
className: 'preview-audio-container',
|
|
2415
|
+
children: [
|
|
2416
|
+
(0, server_html_1.$audio)({
|
|
2417
|
+
src: presignedUrl,
|
|
2418
|
+
controls: true,
|
|
2419
|
+
style: { width: '100%' }
|
|
2420
|
+
})
|
|
2421
|
+
]
|
|
2422
|
+
});
|
|
2423
|
+
break;
|
|
2424
|
+
case 'pdf':
|
|
2425
|
+
previewContent = (0, server_html_1.$div)({
|
|
2426
|
+
className: 'preview-pdf-container',
|
|
2427
|
+
children: [
|
|
2428
|
+
(0, server_html_1.$iframe)({
|
|
2429
|
+
src: presignedUrl,
|
|
2430
|
+
style: { width: '100%', height: '85vh', border: 'none' }
|
|
2431
|
+
})
|
|
2432
|
+
]
|
|
2433
|
+
});
|
|
2434
|
+
break;
|
|
2435
|
+
default:
|
|
2436
|
+
previewContent = (0, server_html_1.$div)({
|
|
2437
|
+
className: 'preview-unavailable',
|
|
2438
|
+
children: [
|
|
2439
|
+
(0, server_html_1.$p)({ textContent: 'Preview not available for this file type' }),
|
|
2440
|
+
(0, server_html_1.$button)({
|
|
2441
|
+
className: 'btn',
|
|
2442
|
+
'@click': `downloadFile('${key}')`,
|
|
2443
|
+
textContent: '⬇️ Download File'
|
|
2444
|
+
})
|
|
2445
|
+
]
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
return (0, server_html_1.$div)({
|
|
2449
|
+
className: 'file-preview',
|
|
2450
|
+
children: [
|
|
2451
|
+
(0, server_html_1.$div)({
|
|
2452
|
+
className: 'preview-header',
|
|
2453
|
+
children: [
|
|
2454
|
+
(0, server_html_1.$h3)({ textContent: fileName }),
|
|
2455
|
+
(0, server_html_1.$button)({
|
|
2456
|
+
className: 'btn-close',
|
|
2457
|
+
'@click': 'closePreview()',
|
|
2458
|
+
textContent: '✕'
|
|
2459
|
+
})
|
|
2460
|
+
]
|
|
2461
|
+
}),
|
|
2462
|
+
(0, server_html_1.$div)({
|
|
2463
|
+
className: 'preview-meta',
|
|
2464
|
+
children: [
|
|
2465
|
+
(0, server_html_1.$span)({ textContent: `Size: ${s3Service.formatFileSize(metadata.ContentLength)}` }),
|
|
2466
|
+
(0, server_html_1.$span)({ textContent: ` · Type: ${metadata.ContentType || 'unknown'}` }),
|
|
2467
|
+
metadata.LastModified ? (0, server_html_1.$span)({ textContent: ` · Modified: ${new Date(metadata.LastModified).toLocaleString()}` }) : ''
|
|
2468
|
+
].filter(Boolean)
|
|
2469
|
+
}),
|
|
2470
|
+
(0, server_html_1.$div)({
|
|
2471
|
+
className: 'preview-content',
|
|
2472
|
+
children: [previewContent]
|
|
2473
|
+
}),
|
|
2474
|
+
(0, server_html_1.$div)({
|
|
2475
|
+
className: 'preview-actions',
|
|
2476
|
+
children: [
|
|
2477
|
+
(0, server_html_1.$button)({
|
|
2478
|
+
className: 'btn',
|
|
2479
|
+
'@click': `downloadFile('${key}')`,
|
|
2480
|
+
textContent: '⬇️ Download'
|
|
2481
|
+
}),
|
|
2482
|
+
(0, server_html_1.$button)({
|
|
2483
|
+
className: 'btn secondary',
|
|
2484
|
+
'@click': 'closePreview()',
|
|
2485
|
+
textContent: 'Close'
|
|
2486
|
+
})
|
|
2487
|
+
]
|
|
2488
|
+
})
|
|
2489
|
+
]
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
generateErrorHtml(message) {
|
|
2493
|
+
return (0, server_html_1.$div)({
|
|
2494
|
+
className: 'error',
|
|
2495
|
+
children: [
|
|
2496
|
+
(0, server_html_1.$div)({ className: 'error-icon', textContent: '⚠️' }),
|
|
2497
|
+
(0, server_html_1.$p)({ textContent: message })
|
|
2498
|
+
]
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2501
|
+
generateLoadingHtml(message = 'Loading...') {
|
|
2502
|
+
return (0, server_html_1.$div)({
|
|
2503
|
+
className: 'loading',
|
|
2504
|
+
children: [
|
|
2505
|
+
(0, server_html_1.$div)({ className: 'spinner' }),
|
|
2506
|
+
(0, server_html_1.$p)({ textContent: message })
|
|
2507
|
+
]
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
exports.HtmlGeneratorService = HtmlGeneratorService;
|
|
2512
|
+
exports.HtmlGeneratorService = HtmlGeneratorService = tslib_1.__decorate([
|
|
2513
|
+
(0, common_1.Injectable)(),
|
|
2514
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof file_preview_service_1.FilePreviewService !== "undefined" && file_preview_service_1.FilePreviewService) === "function" ? _a : Object])
|
|
2515
|
+
], HtmlGeneratorService);
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
/***/ }),
|
|
2519
|
+
/* 50 */
|
|
2520
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2524
|
+
exports.FilePreviewService = void 0;
|
|
2525
|
+
const tslib_1 = __webpack_require__(4);
|
|
2526
|
+
const common_1 = __webpack_require__(5);
|
|
2527
|
+
let FilePreviewService = class FilePreviewService {
|
|
2528
|
+
constructor() {
|
|
2529
|
+
this.imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'];
|
|
2530
|
+
this.textExtensions = ['txt', 'md', 'json', 'xml', 'csv', 'log', 'yaml', 'yml', 'ts', 'js', 'jsx', 'tsx', 'html', 'css', 'scss', 'py', 'java', 'c', 'cpp', 'h', 'go', 'rs', 'sh', 'bash'];
|
|
2531
|
+
this.videoExtensions = ['mp4', 'webm', 'ogg', 'mov'];
|
|
2532
|
+
this.audioExtensions = ['mp3', 'wav', 'ogg', 'flac'];
|
|
2533
|
+
this.pdfExtensions = ['pdf'];
|
|
2534
|
+
}
|
|
2535
|
+
canPreview(extension) {
|
|
2536
|
+
const ext = extension.toLowerCase();
|
|
2537
|
+
return this.imageExtensions.includes(ext) ||
|
|
2538
|
+
this.textExtensions.includes(ext) ||
|
|
2539
|
+
this.videoExtensions.includes(ext) ||
|
|
2540
|
+
this.audioExtensions.includes(ext) ||
|
|
2541
|
+
this.pdfExtensions.includes(ext);
|
|
2542
|
+
}
|
|
2543
|
+
isImage(extension) {
|
|
2544
|
+
return this.imageExtensions.includes(extension.toLowerCase());
|
|
2545
|
+
}
|
|
2546
|
+
isText(extension) {
|
|
2547
|
+
return this.textExtensions.includes(extension.toLowerCase());
|
|
2548
|
+
}
|
|
2549
|
+
isVideo(extension) {
|
|
2550
|
+
return this.videoExtensions.includes(extension.toLowerCase());
|
|
2551
|
+
}
|
|
2552
|
+
isAudio(extension) {
|
|
2553
|
+
return this.audioExtensions.includes(extension.toLowerCase());
|
|
2554
|
+
}
|
|
2555
|
+
isPdf(extension) {
|
|
2556
|
+
return this.pdfExtensions.includes(extension.toLowerCase());
|
|
2557
|
+
}
|
|
2558
|
+
getPreviewType(extension) {
|
|
2559
|
+
const ext = extension.toLowerCase();
|
|
2560
|
+
if (this.isImage(ext))
|
|
2561
|
+
return 'image';
|
|
2562
|
+
if (this.isText(ext))
|
|
2563
|
+
return 'text';
|
|
2564
|
+
if (this.isVideo(ext))
|
|
2565
|
+
return 'video';
|
|
2566
|
+
if (this.isAudio(ext))
|
|
2567
|
+
return 'audio';
|
|
2568
|
+
if (this.isPdf(ext))
|
|
2569
|
+
return 'pdf';
|
|
2570
|
+
return 'none';
|
|
2571
|
+
}
|
|
2572
|
+
getFileIcon(extension) {
|
|
2573
|
+
const ext = extension.toLowerCase();
|
|
2574
|
+
if (this.isImage(ext))
|
|
2575
|
+
return '🖼️';
|
|
2576
|
+
if (this.isText(ext))
|
|
2577
|
+
return '📄';
|
|
2578
|
+
if (this.isVideo(ext))
|
|
2579
|
+
return '🎥';
|
|
2580
|
+
if (this.isAudio(ext))
|
|
2581
|
+
return '🎵';
|
|
2582
|
+
if (this.isPdf(ext))
|
|
2583
|
+
return '📕';
|
|
2584
|
+
if (['zip', 'tar', 'gz', 'rar', '7z'].includes(ext))
|
|
2585
|
+
return '📦';
|
|
2586
|
+
if (['doc', 'docx'].includes(ext))
|
|
2587
|
+
return '📝';
|
|
2588
|
+
if (['xls', 'xlsx'].includes(ext))
|
|
2589
|
+
return '📊';
|
|
2590
|
+
if (['ppt', 'pptx'].includes(ext))
|
|
2591
|
+
return '📽️';
|
|
2592
|
+
return '📎';
|
|
2593
|
+
}
|
|
2594
|
+
async generateTextPreview(content, maxLength = 10000) {
|
|
2595
|
+
const decoder = new TextDecoder('utf-8');
|
|
2596
|
+
const text = decoder.decode(content);
|
|
2597
|
+
if (text.length <= maxLength) {
|
|
2598
|
+
return text;
|
|
2599
|
+
}
|
|
2600
|
+
return text.substring(0, maxLength) + '\n\n... (truncated)';
|
|
2601
|
+
}
|
|
2602
|
+
formatJson(content) {
|
|
2603
|
+
try {
|
|
2604
|
+
const parsed = JSON.parse(content);
|
|
2605
|
+
return JSON.stringify(parsed, null, 2);
|
|
2606
|
+
}
|
|
2607
|
+
catch {
|
|
2608
|
+
return content;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
};
|
|
2612
|
+
exports.FilePreviewService = FilePreviewService;
|
|
2613
|
+
exports.FilePreviewService = FilePreviewService = tslib_1.__decorate([
|
|
2614
|
+
(0, common_1.Injectable)()
|
|
2615
|
+
], FilePreviewService);
|
|
2616
|
+
|
|
2617
|
+
|
|
2618
|
+
/***/ }),
|
|
2619
|
+
/* 51 */
|
|
2620
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2621
|
+
|
|
2622
|
+
|
|
2623
|
+
var _a, _b, _c;
|
|
2624
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2625
|
+
exports.FilesController = void 0;
|
|
2626
|
+
const tslib_1 = __webpack_require__(4);
|
|
2627
|
+
const common_1 = __webpack_require__(5);
|
|
2628
|
+
const s3_service_1 = __webpack_require__(45);
|
|
2629
|
+
const html_generator_service_1 = __webpack_require__(49);
|
|
2630
|
+
const file_preview_service_1 = __webpack_require__(50);
|
|
2631
|
+
let FilesController = class FilesController {
|
|
2632
|
+
constructor(s3Service, htmlGenerator, filePreviewService) {
|
|
2633
|
+
this.s3Service = s3Service;
|
|
2634
|
+
this.htmlGenerator = htmlGenerator;
|
|
2635
|
+
this.filePreviewService = filePreviewService;
|
|
2636
|
+
}
|
|
2637
|
+
async listFiles(bucket, prefix) {
|
|
2638
|
+
try {
|
|
2639
|
+
const { objects, commonPrefixes } = await this.s3Service.listObjects(bucket, prefix);
|
|
2640
|
+
const filesHtml = this.htmlGenerator.generateFileListHtml(objects, commonPrefixes, this.s3Service, prefix);
|
|
2641
|
+
const breadcrumbsHtml = this.htmlGenerator.generateBreadcrumbs(prefix || '', bucket);
|
|
2642
|
+
return {
|
|
2643
|
+
filesHtml,
|
|
2644
|
+
breadcrumbsHtml,
|
|
2645
|
+
objects: objects.length,
|
|
2646
|
+
folders: commonPrefixes.length
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
catch (error) {
|
|
2650
|
+
console.error('Error listing files:', error);
|
|
2651
|
+
return {
|
|
2652
|
+
filesHtml: this.htmlGenerator.generateErrorHtml('Failed to load files'),
|
|
2653
|
+
breadcrumbsHtml: '',
|
|
2654
|
+
objects: 0,
|
|
2655
|
+
folders: 0
|
|
2656
|
+
};
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
async previewFile(bucket, key) {
|
|
2660
|
+
try {
|
|
2661
|
+
const extension = this.s3Service.getFileExtension(key);
|
|
2662
|
+
const previewType = this.filePreviewService.getPreviewType(extension);
|
|
2663
|
+
const metadata = await this.s3Service.getObjectMetadata(bucket, key);
|
|
2664
|
+
let content = null;
|
|
2665
|
+
let presignedUrl;
|
|
2666
|
+
if (previewType === 'text') {
|
|
2667
|
+
const { body } = await this.s3Service.getObject(bucket, key);
|
|
2668
|
+
content = Buffer.from(body);
|
|
2669
|
+
}
|
|
2670
|
+
else if (previewType !== 'none') {
|
|
2671
|
+
presignedUrl = await this.s3Service.getPresignedViewUrl(bucket, key);
|
|
2672
|
+
}
|
|
2673
|
+
return this.htmlGenerator.generateFilePreviewHtml(key, previewType, content, metadata, this.s3Service, presignedUrl);
|
|
2674
|
+
}
|
|
2675
|
+
catch (error) {
|
|
2676
|
+
console.error('Error previewing file:', error);
|
|
2677
|
+
return this.htmlGenerator.generateErrorHtml('Failed to load preview');
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
async downloadFile(bucket, key) {
|
|
2681
|
+
try {
|
|
2682
|
+
const url = await this.s3Service.getPresignedDownloadUrl(bucket, key);
|
|
2683
|
+
return { url };
|
|
2684
|
+
}
|
|
2685
|
+
catch (error) {
|
|
2686
|
+
console.error('Error generating download URL:', error);
|
|
2687
|
+
throw error;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
async deleteFile(body) {
|
|
2691
|
+
try {
|
|
2692
|
+
await this.s3Service.deleteObject(body.bucket, body.key);
|
|
2693
|
+
return { success: true };
|
|
2694
|
+
}
|
|
2695
|
+
catch (error) {
|
|
2696
|
+
console.error('Error deleting file:', error);
|
|
2697
|
+
throw error;
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
async deleteFolder(body) {
|
|
2701
|
+
try {
|
|
2702
|
+
await this.s3Service.deleteFolder(body.bucket, body.prefix);
|
|
2703
|
+
return { success: true };
|
|
2704
|
+
}
|
|
2705
|
+
catch (error) {
|
|
2706
|
+
console.error('Error deleting folder:', error);
|
|
2707
|
+
throw error;
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
exports.FilesController = FilesController;
|
|
2712
|
+
tslib_1.__decorate([
|
|
2713
|
+
(0, common_1.Get)(),
|
|
2714
|
+
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
2715
|
+
tslib_1.__param(1, (0, common_1.Query)('prefix')),
|
|
2716
|
+
tslib_1.__metadata("design:type", Function),
|
|
2717
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
2718
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
2719
|
+
], FilesController.prototype, "listFiles", null);
|
|
2720
|
+
tslib_1.__decorate([
|
|
2721
|
+
(0, common_1.Get)('preview'),
|
|
2722
|
+
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
2723
|
+
tslib_1.__param(1, (0, common_1.Query)('key')),
|
|
2724
|
+
tslib_1.__metadata("design:type", Function),
|
|
2725
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
2726
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
2727
|
+
], FilesController.prototype, "previewFile", null);
|
|
2728
|
+
tslib_1.__decorate([
|
|
2729
|
+
(0, common_1.Get)('download'),
|
|
2730
|
+
tslib_1.__param(0, (0, common_1.Query)('bucket')),
|
|
2731
|
+
tslib_1.__param(1, (0, common_1.Query)('key')),
|
|
2732
|
+
tslib_1.__metadata("design:type", Function),
|
|
2733
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
2734
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
2735
|
+
], FilesController.prototype, "downloadFile", null);
|
|
2736
|
+
tslib_1.__decorate([
|
|
2737
|
+
(0, common_1.Post)('delete'),
|
|
2738
|
+
tslib_1.__param(0, (0, common_1.Body)()),
|
|
2739
|
+
tslib_1.__metadata("design:type", Function),
|
|
2740
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
2741
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
2742
|
+
], FilesController.prototype, "deleteFile", null);
|
|
2743
|
+
tslib_1.__decorate([
|
|
2744
|
+
(0, common_1.Post)('delete-folder'),
|
|
2745
|
+
tslib_1.__param(0, (0, common_1.Body)()),
|
|
2746
|
+
tslib_1.__metadata("design:type", Function),
|
|
2747
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
2748
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
2749
|
+
], FilesController.prototype, "deleteFolder", null);
|
|
2750
|
+
exports.FilesController = FilesController = tslib_1.__decorate([
|
|
2751
|
+
(0, common_1.Controller)('api/files'),
|
|
2752
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object, typeof (_b = typeof html_generator_service_1.HtmlGeneratorService !== "undefined" && html_generator_service_1.HtmlGeneratorService) === "function" ? _b : Object, typeof (_c = typeof file_preview_service_1.FilePreviewService !== "undefined" && file_preview_service_1.FilePreviewService) === "function" ? _c : Object])
|
|
2753
|
+
], FilesController);
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
/***/ }),
|
|
2757
|
+
/* 52 */
|
|
2758
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
var _a;
|
|
2762
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2763
|
+
exports.UploadController = void 0;
|
|
2764
|
+
const tslib_1 = __webpack_require__(4);
|
|
2765
|
+
const common_1 = __webpack_require__(5);
|
|
2766
|
+
const platform_express_1 = __webpack_require__(53);
|
|
2767
|
+
const s3_service_1 = __webpack_require__(45);
|
|
2768
|
+
let UploadController = class UploadController {
|
|
2769
|
+
constructor(s3Service) {
|
|
2770
|
+
this.s3Service = s3Service;
|
|
2771
|
+
}
|
|
2772
|
+
async uploadFile(file, bucket, prefix) {
|
|
2773
|
+
try {
|
|
2774
|
+
const key = prefix ? `${prefix}${file.originalname}` : file.originalname;
|
|
2775
|
+
await this.s3Service.uploadObject(bucket, key, file.buffer, file.mimetype);
|
|
2776
|
+
return {
|
|
2777
|
+
success: true,
|
|
2778
|
+
key,
|
|
2779
|
+
size: file.size
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
catch (error) {
|
|
2783
|
+
console.error('Error uploading file:', error);
|
|
2784
|
+
throw error;
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
};
|
|
2788
|
+
exports.UploadController = UploadController;
|
|
2789
|
+
tslib_1.__decorate([
|
|
2790
|
+
(0, common_1.Post)(),
|
|
2791
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
2792
|
+
tslib_1.__param(0, (0, common_1.UploadedFile)()),
|
|
2793
|
+
tslib_1.__param(1, (0, common_1.Body)('bucket')),
|
|
2794
|
+
tslib_1.__param(2, (0, common_1.Body)('prefix')),
|
|
2795
|
+
tslib_1.__metadata("design:type", Function),
|
|
2796
|
+
tslib_1.__metadata("design:paramtypes", [Object, String, String]),
|
|
2797
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
2798
|
+
], UploadController.prototype, "uploadFile", null);
|
|
2799
|
+
exports.UploadController = UploadController = tslib_1.__decorate([
|
|
2800
|
+
(0, common_1.Controller)('api/upload'),
|
|
2801
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof s3_service_1.S3Service !== "undefined" && s3_service_1.S3Service) === "function" ? _a : Object])
|
|
2802
|
+
], UploadController);
|
|
2803
|
+
|
|
2804
|
+
|
|
2805
|
+
/***/ }),
|
|
2806
|
+
/* 53 */
|
|
2807
|
+
/***/ ((module) => {
|
|
2808
|
+
|
|
2809
|
+
module.exports = require("@nestjs/platform-express");
|
|
2810
|
+
|
|
2811
|
+
/***/ })
|
|
2812
|
+
/******/ ]);
|
|
2813
|
+
/************************************************************************/
|
|
2814
|
+
/******/ // The module cache
|
|
2815
|
+
/******/ var __webpack_module_cache__ = {};
|
|
2816
|
+
/******/
|
|
2817
|
+
/******/ // The require function
|
|
2818
|
+
/******/ function __webpack_require__(moduleId) {
|
|
2819
|
+
/******/ // Check if module is in cache
|
|
2820
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
2821
|
+
/******/ if (cachedModule !== undefined) {
|
|
2822
|
+
/******/ return cachedModule.exports;
|
|
2823
|
+
/******/ }
|
|
2824
|
+
/******/ // Create a new module (and put it into the cache)
|
|
2825
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
2826
|
+
/******/ // no module.id needed
|
|
2827
|
+
/******/ // no module.loaded needed
|
|
2828
|
+
/******/ exports: {}
|
|
2829
|
+
/******/ };
|
|
2830
|
+
/******/
|
|
2831
|
+
/******/ // Execute the module function
|
|
2832
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
2833
|
+
/******/
|
|
2834
|
+
/******/ // Return the exports of the module
|
|
2835
|
+
/******/ return module.exports;
|
|
2836
|
+
/******/ }
|
|
2837
|
+
/******/
|
|
2838
|
+
/************************************************************************/
|
|
2839
|
+
var __webpack_exports__ = {};
|
|
2840
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
2841
|
+
(() => {
|
|
2842
|
+
var exports = __webpack_exports__;
|
|
2843
|
+
//#!/usr/bin/env node
|
|
2844
|
+
|
|
2845
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2846
|
+
const index_1 = __webpack_require__(1);
|
|
2847
|
+
(0, index_1.bootstrap)();
|
|
2848
|
+
|
|
2849
|
+
})();
|
|
2850
|
+
|
|
2851
|
+
/******/ })()
|
|
2852
|
+
;
|