@plyaz/config 1.7.21 → 1.8.0

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.
@@ -0,0 +1,946 @@
1
+ /**
2
+ * Storage Configuration Constants
3
+ *
4
+ * Default configuration values for the storage system.
5
+ * These can be overridden at runtime through configuration objects.
6
+ *
7
+ * @module src/storage/constants
8
+ */
9
+ import { ADAPTER_HEALTH_STATUS, FILE_ACCESS_LEVEL, PATH_GENERATION_STRATEGY, STORAGE_QUEUE_PRIORITY, RETRY_STRATEGY } from '@plyaz/types';
10
+ /**
11
+ * File Validation Configuration
12
+ */
13
+ export declare const FILE_VALIDATION_CONFIG: {
14
+ /**
15
+ * Default maximum file size (bytes)
16
+ * 100MB - reasonable default for most applications
17
+ */
18
+ readonly DEFAULT_MAX_FILE_SIZE: number;
19
+ /**
20
+ * Default minimum file size (bytes)
21
+ * 1 byte - allow any non-empty file
22
+ */
23
+ readonly DEFAULT_MIN_FILE_SIZE: 1;
24
+ /**
25
+ * Maximum file size for images (bytes)
26
+ * 25MB - covers high-resolution images
27
+ */
28
+ readonly IMAGE_MAX_SIZE: number;
29
+ /**
30
+ * Maximum file size for videos (bytes)
31
+ * 500MB - allows reasonable quality videos
32
+ */
33
+ readonly VIDEO_MAX_SIZE: number;
34
+ /**
35
+ * Maximum file size for documents (bytes)
36
+ * 50MB - covers most document types including PDFs
37
+ */
38
+ readonly DOCUMENT_MAX_SIZE: number;
39
+ /**
40
+ * Maximum file size for audio (bytes)
41
+ * 100MB - allows high-quality audio files
42
+ */
43
+ readonly AUDIO_MAX_SIZE: number;
44
+ /**
45
+ * Maximum file size for archives (bytes)
46
+ * 1GB - allows compressed collections
47
+ */
48
+ readonly ARCHIVE_MAX_SIZE: number;
49
+ /**
50
+ * Default allowed MIME types for images
51
+ */
52
+ readonly DEFAULT_ALLOWED_IMAGE_TYPES: readonly ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp", "image/avif", "image/svg+xml"];
53
+ /**
54
+ * Default allowed MIME types for videos
55
+ */
56
+ readonly DEFAULT_ALLOWED_VIDEO_TYPES: readonly ["video/mp4", "video/mpeg", "video/quicktime", "video/x-msvideo", "video/webm"];
57
+ /**
58
+ * Default allowed MIME types for documents
59
+ */
60
+ readonly DEFAULT_ALLOWED_DOCUMENT_TYPES: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "text/plain", "text/csv"];
61
+ /**
62
+ * Default allowed MIME types for audio
63
+ */
64
+ readonly DEFAULT_ALLOWED_AUDIO_TYPES: readonly ["audio/mpeg", "audio/mp3", "audio/wav", "audio/ogg", "audio/webm"];
65
+ /**
66
+ * Blocked executable extensions
67
+ */
68
+ readonly BLOCKED_EXECUTABLE_EXTENSIONS: readonly [".exe", ".bat", ".cmd", ".com", ".sh", ".bash", ".ps1", ".app", ".deb", ".rpm", ".dmg", ".pkg", ".msi"];
69
+ };
70
+ /**
71
+ * Storage Retry Configuration
72
+ */
73
+ export declare const STORAGE_RETRY_CONFIG: {
74
+ /**
75
+ * Default retry strategy
76
+ */
77
+ readonly DEFAULT_STRATEGY: RETRY_STRATEGY.ExponentialBackoff;
78
+ /**
79
+ * Default maximum number of retry attempts
80
+ */
81
+ readonly DEFAULT_MAX_ATTEMPTS: 3;
82
+ /**
83
+ * Default initial delay between retries (milliseconds)
84
+ */
85
+ readonly DEFAULT_INITIAL_DELAY_MS: 1000;
86
+ /**
87
+ * Maximum delay between retries (milliseconds)
88
+ */
89
+ readonly MAX_DELAY_MS: 30000;
90
+ /**
91
+ * Backoff multiplier for exponential backoff
92
+ */
93
+ readonly BACKOFF_MULTIPLIER: 2;
94
+ };
95
+ /**
96
+ * Path Generation Configuration
97
+ */
98
+ export declare const PATH_GENERATION_CONFIG: {
99
+ /**
100
+ * Default path generation strategy
101
+ */
102
+ readonly DEFAULT_STRATEGY: PATH_GENERATION_STRATEGY.HashBased;
103
+ /**
104
+ * Whether to include hash in path by default
105
+ */
106
+ readonly DEFAULT_INCLUDE_HASH: true;
107
+ /**
108
+ * Whether to include timestamp in path by default
109
+ */
110
+ readonly DEFAULT_INCLUDE_TIMESTAMP: false;
111
+ /**
112
+ * Default path template for entity-based strategy
113
+ * Supports: {entityType}, {entityId}, {category}, {filename}, {hash}, {timestamp}
114
+ */
115
+ readonly DEFAULT_ENTITY_TEMPLATE: "{entityType}/{entityId}/{category}/{filename}";
116
+ /**
117
+ * Default path template for date-based strategy
118
+ */
119
+ readonly DEFAULT_DATE_TEMPLATE: "{year}/{month}/{day}/{filename}";
120
+ /**
121
+ * Default path template for category-based strategy
122
+ */
123
+ readonly DEFAULT_CATEGORY_TEMPLATE: "{category}/{filename}";
124
+ };
125
+ /**
126
+ * Storage Queue Configuration
127
+ */
128
+ export declare const STORAGE_QUEUE_CONFIG: {
129
+ /**
130
+ * Default maximum queue size
131
+ */
132
+ readonly DEFAULT_MAX_SIZE: 10000;
133
+ /**
134
+ * Default number of concurrent workers
135
+ */
136
+ readonly DEFAULT_CONCURRENCY: 5;
137
+ /**
138
+ * Default queue priority
139
+ */
140
+ readonly DEFAULT_PRIORITY: STORAGE_QUEUE_PRIORITY.NORMAL;
141
+ /**
142
+ * Default maximum retries for queue items
143
+ */
144
+ readonly DEFAULT_MAX_RETRIES: 3;
145
+ /**
146
+ * Default retry delay for failed queue items (milliseconds)
147
+ */
148
+ readonly DEFAULT_RETRY_DELAY_MS: 5000;
149
+ };
150
+ /**
151
+ * Adapter Configuration
152
+ */
153
+ export declare const ADAPTER_CONFIG: {
154
+ /**
155
+ * Default adapter priority
156
+ */
157
+ readonly DEFAULT_PRIORITY: 1;
158
+ /**
159
+ * Default health check interval (milliseconds)
160
+ */
161
+ readonly DEFAULT_HEALTH_CHECK_INTERVAL_MS: 30000;
162
+ /**
163
+ * Default health check timeout (milliseconds)
164
+ */
165
+ readonly DEFAULT_HEALTH_CHECK_TIMEOUT_MS: 5000;
166
+ /**
167
+ * Default healthy status
168
+ */
169
+ readonly DEFAULT_HEALTH_STATUS: ADAPTER_HEALTH_STATUS.UNKNOWN;
170
+ /**
171
+ * Maximum acceptable health check response time (milliseconds)
172
+ */
173
+ readonly MAX_ACCEPTABLE_RESPONSE_TIME_MS: 2000;
174
+ };
175
+ /**
176
+ * Upload Configuration
177
+ */
178
+ export declare const UPLOAD_CONFIG: {
179
+ /**
180
+ * Default maximum concurrent uploads
181
+ */
182
+ readonly DEFAULT_MAX_CONCURRENT: 3;
183
+ /**
184
+ * Default upload timeout (milliseconds)
185
+ * 5 minutes for large files
186
+ */
187
+ readonly DEFAULT_TIMEOUT_MS: 300000;
188
+ /**
189
+ * Default chunk size for chunked uploads (bytes)
190
+ * 5MB per chunk
191
+ */
192
+ readonly DEFAULT_CHUNK_SIZE: number;
193
+ /**
194
+ * Minimum file size to trigger chunked upload (bytes)
195
+ * 50MB - files larger than this use chunked upload
196
+ */
197
+ readonly CHUNKED_UPLOAD_THRESHOLD: number;
198
+ /**
199
+ * Maximum number of upload retries
200
+ */
201
+ readonly MAX_UPLOAD_RETRIES: 3;
202
+ /**
203
+ * Whether to extract metadata by default
204
+ */
205
+ readonly DEFAULT_EXTRACT_METADATA: true;
206
+ /**
207
+ * Whether to scan for viruses by default
208
+ */
209
+ readonly DEFAULT_VIRUS_SCAN: false;
210
+ /**
211
+ * Default file access level
212
+ */
213
+ readonly DEFAULT_ACCESS_LEVEL: FILE_ACCESS_LEVEL.PRIVATE;
214
+ };
215
+ /**
216
+ * Download Configuration
217
+ */
218
+ export declare const DOWNLOAD_CONFIG: {
219
+ /**
220
+ * Default download timeout (milliseconds)
221
+ */
222
+ readonly DEFAULT_TIMEOUT_MS: 120000;
223
+ /**
224
+ * Default signed URL expiry (seconds)
225
+ * 1 hour
226
+ */
227
+ readonly DEFAULT_SIGNED_URL_EXPIRY_SECONDS: 3600;
228
+ /**
229
+ * Maximum signed URL expiry (seconds)
230
+ * 7 days
231
+ */
232
+ readonly MAX_SIGNED_URL_EXPIRY_SECONDS: 604800;
233
+ /**
234
+ * Minimum signed URL expiry (seconds)
235
+ * 5 minutes
236
+ */
237
+ readonly MIN_SIGNED_URL_EXPIRY_SECONDS: 300;
238
+ };
239
+ /**
240
+ * Media Processing Configuration
241
+ */
242
+ export declare const MEDIA_PROCESSING_CONFIG: {
243
+ /**
244
+ * Default image quality (1-100)
245
+ */
246
+ readonly DEFAULT_IMAGE_QUALITY: 85;
247
+ /**
248
+ * Default thumbnail width (pixels)
249
+ */
250
+ readonly DEFAULT_THUMBNAIL_WIDTH: 200;
251
+ /**
252
+ * Default thumbnail height (pixels)
253
+ */
254
+ readonly DEFAULT_THUMBNAIL_HEIGHT: 200;
255
+ /**
256
+ * Default image format for conversion
257
+ */
258
+ readonly DEFAULT_IMAGE_FORMAT: "jpeg";
259
+ /**
260
+ * Maximum processing timeout (milliseconds)
261
+ * 10 minutes for complex media processing
262
+ */
263
+ readonly MAX_PROCESSING_TIMEOUT_MS: 600000;
264
+ /**
265
+ * Maximum image dimensions (pixels)
266
+ */
267
+ readonly MAX_IMAGE_DIMENSIONS: 10000;
268
+ /**
269
+ * Whether to generate thumbnails by default
270
+ */
271
+ readonly DEFAULT_GENERATE_THUMBNAIL: true;
272
+ };
273
+ /**
274
+ * Virus Scan Configuration
275
+ */
276
+ export declare const VIRUS_SCAN_CONFIG: {
277
+ /**
278
+ * Maximum file size to scan (bytes)
279
+ * 100MB - VirusTotal free tier limit
280
+ */
281
+ readonly MAX_SCAN_SIZE: number;
282
+ /**
283
+ * Whether to fail upload on virus detection
284
+ */
285
+ readonly FAIL_ON_DETECTION: true;
286
+ /**
287
+ * Scan timeout (milliseconds)
288
+ */
289
+ readonly SCAN_TIMEOUT_MS: 60000;
290
+ };
291
+ /**
292
+ * Compliance Configuration
293
+ */
294
+ export declare const COMPLIANCE_CONFIG: {
295
+ /**
296
+ * Default retention period (days)
297
+ */
298
+ readonly DEFAULT_RETENTION_DAYS: 365;
299
+ /**
300
+ * Whether files are immutable by default
301
+ */
302
+ readonly DEFAULT_IMMUTABLE: false;
303
+ /**
304
+ * Whether to auto-delete after retention expires
305
+ */
306
+ readonly DEFAULT_AUTO_DELETE: false;
307
+ /**
308
+ * Retention check interval (milliseconds)
309
+ * Check daily
310
+ */
311
+ readonly RETENTION_CHECK_INTERVAL_MS: 86400000;
312
+ };
313
+ /**
314
+ * Storage Template & PDF Configuration
315
+ */
316
+ export declare const STORAGE_TEMPLATE_CONFIG: {
317
+ /**
318
+ * Default PDF format
319
+ */
320
+ readonly DEFAULT_PDF_FORMAT: "A4";
321
+ /**
322
+ * Default PDF orientation
323
+ */
324
+ readonly DEFAULT_PDF_ORIENTATION: "portrait";
325
+ /**
326
+ * Default PDF margin
327
+ */
328
+ readonly DEFAULT_PDF_MARGIN: {
329
+ readonly top: "20mm";
330
+ readonly right: "15mm";
331
+ readonly bottom: "20mm";
332
+ readonly left: "15mm";
333
+ };
334
+ /**
335
+ * Whether to print background by default
336
+ */
337
+ readonly DEFAULT_PRINT_BACKGROUND: true;
338
+ /**
339
+ * PDF generation timeout (milliseconds)
340
+ */
341
+ readonly PDF_GENERATION_TIMEOUT_MS: 60000;
342
+ /**
343
+ * Maximum template size (bytes)
344
+ */
345
+ readonly MAX_TEMPLATE_SIZE: 1048576;
346
+ };
347
+ /**
348
+ * Share Link Configuration
349
+ */
350
+ export declare const SHARE_LINK_CONFIG: {
351
+ /**
352
+ * Default share link expiry (seconds)
353
+ * 7 days
354
+ */
355
+ readonly DEFAULT_EXPIRY_SECONDS: 604800;
356
+ /**
357
+ * Maximum share link expiry (seconds)
358
+ * 30 days
359
+ */
360
+ readonly MAX_EXPIRY_SECONDS: 2592000;
361
+ /**
362
+ * Default maximum downloads per share link
363
+ */
364
+ readonly DEFAULT_MAX_DOWNLOADS: 100;
365
+ /**
366
+ * Whether to require password by default
367
+ */
368
+ readonly DEFAULT_REQUIRE_PASSWORD: false;
369
+ };
370
+ /**
371
+ * TTL Configuration
372
+ */
373
+ export declare const TTL_CONFIG: {
374
+ /**
375
+ * Default TTL for temporary files (seconds)
376
+ * 24 hours
377
+ */
378
+ readonly DEFAULT_TTL_SECONDS: 86400;
379
+ /**
380
+ * TTL cleanup interval (milliseconds)
381
+ * Check every hour
382
+ */
383
+ readonly CLEANUP_INTERVAL_MS: 3600000;
384
+ /**
385
+ * Grace period before actual deletion (milliseconds)
386
+ * 1 hour buffer
387
+ */
388
+ readonly DELETION_GRACE_PERIOD_MS: 3600000;
389
+ };
390
+ /**
391
+ * CORS Configuration
392
+ */
393
+ export declare const CORS_CONFIG: {
394
+ /**
395
+ * Default allowed origins
396
+ */
397
+ readonly DEFAULT_ALLOWED_ORIGINS: readonly ["*"];
398
+ /**
399
+ * Default allowed methods
400
+ */
401
+ readonly DEFAULT_ALLOWED_METHODS: readonly ["GET", "POST", "PUT", "DELETE", "HEAD"];
402
+ /**
403
+ * Default allowed headers
404
+ */
405
+ readonly DEFAULT_ALLOWED_HEADERS: readonly ["Content-Type", "Authorization", "X-Requested-With", "X-Upload-Content-Type", "X-Upload-Content-Length"];
406
+ /**
407
+ * Default exposed headers
408
+ */
409
+ readonly DEFAULT_EXPOSED_HEADERS: readonly ["ETag", "Content-Length", "Content-Type", "Last-Modified"];
410
+ /**
411
+ * Default max age (seconds)
412
+ */
413
+ readonly DEFAULT_MAX_AGE_SECONDS: 3600;
414
+ /**
415
+ * Whether to allow credentials by default
416
+ */
417
+ readonly DEFAULT_ALLOW_CREDENTIALS: false;
418
+ };
419
+ /**
420
+ * Audit Log Configuration
421
+ */
422
+ export declare const AUDIT_CONFIG: {
423
+ /**
424
+ * Whether to log uploads by default
425
+ */
426
+ readonly DEFAULT_LOG_UPLOADS: true;
427
+ /**
428
+ * Whether to log downloads by default
429
+ */
430
+ readonly DEFAULT_LOG_DOWNLOADS: true;
431
+ /**
432
+ * Whether to log deletes by default
433
+ */
434
+ readonly DEFAULT_LOG_DELETES: true;
435
+ /**
436
+ * Audit log retention period (days)
437
+ */
438
+ readonly LOG_RETENTION_DAYS: 365;
439
+ /**
440
+ * Maximum audit log size per file (bytes)
441
+ */
442
+ readonly MAX_LOG_SIZE: number;
443
+ };
444
+ /**
445
+ * CDN Invalidation Configuration
446
+ */
447
+ export declare const CDN_CONFIG: {
448
+ /**
449
+ * Default invalidation timeout (milliseconds)
450
+ */
451
+ readonly DEFAULT_INVALIDATION_TIMEOUT_MS: 30000;
452
+ /**
453
+ * Maximum batch size for invalidation
454
+ */
455
+ readonly MAX_INVALIDATION_BATCH_SIZE: 100;
456
+ /**
457
+ * Invalidation retry attempts
458
+ */
459
+ readonly INVALIDATION_MAX_RETRIES: 3;
460
+ };
461
+ /**
462
+ * Monitoring Configuration
463
+ */
464
+ export declare const MONITORING_CONFIG: {
465
+ /**
466
+ * Metrics collection interval (milliseconds)
467
+ */
468
+ readonly METRICS_INTERVAL_MS: 60000;
469
+ /**
470
+ * Whether to track upload progress by default
471
+ */
472
+ readonly DEFAULT_TRACK_PROGRESS: true;
473
+ /**
474
+ * Progress update interval (milliseconds)
475
+ */
476
+ readonly PROGRESS_UPDATE_INTERVAL_MS: 500;
477
+ };
478
+ /**
479
+ * Cloudflare R2 Configuration
480
+ */
481
+ export declare const CLOUDFLARE_R2_CONFIG: {
482
+ /**
483
+ * Default region
484
+ */
485
+ readonly DEFAULT_REGION: "auto";
486
+ /**
487
+ * Default endpoint format
488
+ */
489
+ readonly DEFAULT_ENDPOINT_FORMAT: "https://{accountId}.r2.cloudflarestorage.com";
490
+ };
491
+ /**
492
+ * Supabase Storage Configuration
493
+ */
494
+ export declare const SUPABASE_STORAGE_CONFIG: {
495
+ /**
496
+ * Default bucket name
497
+ */
498
+ readonly DEFAULT_BUCKET: "uploads";
499
+ /**
500
+ * Upload upsert by default
501
+ */
502
+ readonly DEFAULT_UPSERT: false;
503
+ };
504
+ /**
505
+ * Export all configuration as a single object for convenience
506
+ */
507
+ export declare const STORAGE_PACKAGE_CONFIG: {
508
+ readonly FILE_VALIDATION: {
509
+ /**
510
+ * Default maximum file size (bytes)
511
+ * 100MB - reasonable default for most applications
512
+ */
513
+ readonly DEFAULT_MAX_FILE_SIZE: number;
514
+ /**
515
+ * Default minimum file size (bytes)
516
+ * 1 byte - allow any non-empty file
517
+ */
518
+ readonly DEFAULT_MIN_FILE_SIZE: 1;
519
+ /**
520
+ * Maximum file size for images (bytes)
521
+ * 25MB - covers high-resolution images
522
+ */
523
+ readonly IMAGE_MAX_SIZE: number;
524
+ /**
525
+ * Maximum file size for videos (bytes)
526
+ * 500MB - allows reasonable quality videos
527
+ */
528
+ readonly VIDEO_MAX_SIZE: number;
529
+ /**
530
+ * Maximum file size for documents (bytes)
531
+ * 50MB - covers most document types including PDFs
532
+ */
533
+ readonly DOCUMENT_MAX_SIZE: number;
534
+ /**
535
+ * Maximum file size for audio (bytes)
536
+ * 100MB - allows high-quality audio files
537
+ */
538
+ readonly AUDIO_MAX_SIZE: number;
539
+ /**
540
+ * Maximum file size for archives (bytes)
541
+ * 1GB - allows compressed collections
542
+ */
543
+ readonly ARCHIVE_MAX_SIZE: number;
544
+ /**
545
+ * Default allowed MIME types for images
546
+ */
547
+ readonly DEFAULT_ALLOWED_IMAGE_TYPES: readonly ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp", "image/avif", "image/svg+xml"];
548
+ /**
549
+ * Default allowed MIME types for videos
550
+ */
551
+ readonly DEFAULT_ALLOWED_VIDEO_TYPES: readonly ["video/mp4", "video/mpeg", "video/quicktime", "video/x-msvideo", "video/webm"];
552
+ /**
553
+ * Default allowed MIME types for documents
554
+ */
555
+ readonly DEFAULT_ALLOWED_DOCUMENT_TYPES: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "text/plain", "text/csv"];
556
+ /**
557
+ * Default allowed MIME types for audio
558
+ */
559
+ readonly DEFAULT_ALLOWED_AUDIO_TYPES: readonly ["audio/mpeg", "audio/mp3", "audio/wav", "audio/ogg", "audio/webm"];
560
+ /**
561
+ * Blocked executable extensions
562
+ */
563
+ readonly BLOCKED_EXECUTABLE_EXTENSIONS: readonly [".exe", ".bat", ".cmd", ".com", ".sh", ".bash", ".ps1", ".app", ".deb", ".rpm", ".dmg", ".pkg", ".msi"];
564
+ };
565
+ readonly RETRY: {
566
+ /**
567
+ * Default retry strategy
568
+ */
569
+ readonly DEFAULT_STRATEGY: RETRY_STRATEGY.ExponentialBackoff;
570
+ /**
571
+ * Default maximum number of retry attempts
572
+ */
573
+ readonly DEFAULT_MAX_ATTEMPTS: 3;
574
+ /**
575
+ * Default initial delay between retries (milliseconds)
576
+ */
577
+ readonly DEFAULT_INITIAL_DELAY_MS: 1000;
578
+ /**
579
+ * Maximum delay between retries (milliseconds)
580
+ */
581
+ readonly MAX_DELAY_MS: 30000;
582
+ /**
583
+ * Backoff multiplier for exponential backoff
584
+ */
585
+ readonly BACKOFF_MULTIPLIER: 2;
586
+ };
587
+ readonly PATH_GENERATION: {
588
+ /**
589
+ * Default path generation strategy
590
+ */
591
+ readonly DEFAULT_STRATEGY: PATH_GENERATION_STRATEGY.HashBased;
592
+ /**
593
+ * Whether to include hash in path by default
594
+ */
595
+ readonly DEFAULT_INCLUDE_HASH: true;
596
+ /**
597
+ * Whether to include timestamp in path by default
598
+ */
599
+ readonly DEFAULT_INCLUDE_TIMESTAMP: false;
600
+ /**
601
+ * Default path template for entity-based strategy
602
+ * Supports: {entityType}, {entityId}, {category}, {filename}, {hash}, {timestamp}
603
+ */
604
+ readonly DEFAULT_ENTITY_TEMPLATE: "{entityType}/{entityId}/{category}/{filename}";
605
+ /**
606
+ * Default path template for date-based strategy
607
+ */
608
+ readonly DEFAULT_DATE_TEMPLATE: "{year}/{month}/{day}/{filename}";
609
+ /**
610
+ * Default path template for category-based strategy
611
+ */
612
+ readonly DEFAULT_CATEGORY_TEMPLATE: "{category}/{filename}";
613
+ };
614
+ readonly QUEUE: {
615
+ /**
616
+ * Default maximum queue size
617
+ */
618
+ readonly DEFAULT_MAX_SIZE: 10000;
619
+ /**
620
+ * Default number of concurrent workers
621
+ */
622
+ readonly DEFAULT_CONCURRENCY: 5;
623
+ /**
624
+ * Default queue priority
625
+ */
626
+ readonly DEFAULT_PRIORITY: STORAGE_QUEUE_PRIORITY.NORMAL;
627
+ /**
628
+ * Default maximum retries for queue items
629
+ */
630
+ readonly DEFAULT_MAX_RETRIES: 3;
631
+ /**
632
+ * Default retry delay for failed queue items (milliseconds)
633
+ */
634
+ readonly DEFAULT_RETRY_DELAY_MS: 5000;
635
+ };
636
+ readonly ADAPTER: {
637
+ /**
638
+ * Default adapter priority
639
+ */
640
+ readonly DEFAULT_PRIORITY: 1;
641
+ /**
642
+ * Default health check interval (milliseconds)
643
+ */
644
+ readonly DEFAULT_HEALTH_CHECK_INTERVAL_MS: 30000;
645
+ /**
646
+ * Default health check timeout (milliseconds)
647
+ */
648
+ readonly DEFAULT_HEALTH_CHECK_TIMEOUT_MS: 5000;
649
+ /**
650
+ * Default healthy status
651
+ */
652
+ readonly DEFAULT_HEALTH_STATUS: ADAPTER_HEALTH_STATUS.UNKNOWN;
653
+ /**
654
+ * Maximum acceptable health check response time (milliseconds)
655
+ */
656
+ readonly MAX_ACCEPTABLE_RESPONSE_TIME_MS: 2000;
657
+ };
658
+ readonly UPLOAD: {
659
+ /**
660
+ * Default maximum concurrent uploads
661
+ */
662
+ readonly DEFAULT_MAX_CONCURRENT: 3;
663
+ /**
664
+ * Default upload timeout (milliseconds)
665
+ * 5 minutes for large files
666
+ */
667
+ readonly DEFAULT_TIMEOUT_MS: 300000;
668
+ /**
669
+ * Default chunk size for chunked uploads (bytes)
670
+ * 5MB per chunk
671
+ */
672
+ readonly DEFAULT_CHUNK_SIZE: number;
673
+ /**
674
+ * Minimum file size to trigger chunked upload (bytes)
675
+ * 50MB - files larger than this use chunked upload
676
+ */
677
+ readonly CHUNKED_UPLOAD_THRESHOLD: number;
678
+ /**
679
+ * Maximum number of upload retries
680
+ */
681
+ readonly MAX_UPLOAD_RETRIES: 3;
682
+ /**
683
+ * Whether to extract metadata by default
684
+ */
685
+ readonly DEFAULT_EXTRACT_METADATA: true;
686
+ /**
687
+ * Whether to scan for viruses by default
688
+ */
689
+ readonly DEFAULT_VIRUS_SCAN: false;
690
+ /**
691
+ * Default file access level
692
+ */
693
+ readonly DEFAULT_ACCESS_LEVEL: FILE_ACCESS_LEVEL.PRIVATE;
694
+ };
695
+ readonly DOWNLOAD: {
696
+ /**
697
+ * Default download timeout (milliseconds)
698
+ */
699
+ readonly DEFAULT_TIMEOUT_MS: 120000;
700
+ /**
701
+ * Default signed URL expiry (seconds)
702
+ * 1 hour
703
+ */
704
+ readonly DEFAULT_SIGNED_URL_EXPIRY_SECONDS: 3600;
705
+ /**
706
+ * Maximum signed URL expiry (seconds)
707
+ * 7 days
708
+ */
709
+ readonly MAX_SIGNED_URL_EXPIRY_SECONDS: 604800;
710
+ /**
711
+ * Minimum signed URL expiry (seconds)
712
+ * 5 minutes
713
+ */
714
+ readonly MIN_SIGNED_URL_EXPIRY_SECONDS: 300;
715
+ };
716
+ readonly MEDIA_PROCESSING: {
717
+ /**
718
+ * Default image quality (1-100)
719
+ */
720
+ readonly DEFAULT_IMAGE_QUALITY: 85;
721
+ /**
722
+ * Default thumbnail width (pixels)
723
+ */
724
+ readonly DEFAULT_THUMBNAIL_WIDTH: 200;
725
+ /**
726
+ * Default thumbnail height (pixels)
727
+ */
728
+ readonly DEFAULT_THUMBNAIL_HEIGHT: 200;
729
+ /**
730
+ * Default image format for conversion
731
+ */
732
+ readonly DEFAULT_IMAGE_FORMAT: "jpeg";
733
+ /**
734
+ * Maximum processing timeout (milliseconds)
735
+ * 10 minutes for complex media processing
736
+ */
737
+ readonly MAX_PROCESSING_TIMEOUT_MS: 600000;
738
+ /**
739
+ * Maximum image dimensions (pixels)
740
+ */
741
+ readonly MAX_IMAGE_DIMENSIONS: 10000;
742
+ /**
743
+ * Whether to generate thumbnails by default
744
+ */
745
+ readonly DEFAULT_GENERATE_THUMBNAIL: true;
746
+ };
747
+ readonly VIRUS_SCAN: {
748
+ /**
749
+ * Maximum file size to scan (bytes)
750
+ * 100MB - VirusTotal free tier limit
751
+ */
752
+ readonly MAX_SCAN_SIZE: number;
753
+ /**
754
+ * Whether to fail upload on virus detection
755
+ */
756
+ readonly FAIL_ON_DETECTION: true;
757
+ /**
758
+ * Scan timeout (milliseconds)
759
+ */
760
+ readonly SCAN_TIMEOUT_MS: 60000;
761
+ };
762
+ readonly COMPLIANCE: {
763
+ /**
764
+ * Default retention period (days)
765
+ */
766
+ readonly DEFAULT_RETENTION_DAYS: 365;
767
+ /**
768
+ * Whether files are immutable by default
769
+ */
770
+ readonly DEFAULT_IMMUTABLE: false;
771
+ /**
772
+ * Whether to auto-delete after retention expires
773
+ */
774
+ readonly DEFAULT_AUTO_DELETE: false;
775
+ /**
776
+ * Retention check interval (milliseconds)
777
+ * Check daily
778
+ */
779
+ readonly RETENTION_CHECK_INTERVAL_MS: 86400000;
780
+ };
781
+ readonly TEMPLATE: {
782
+ /**
783
+ * Default PDF format
784
+ */
785
+ readonly DEFAULT_PDF_FORMAT: "A4";
786
+ /**
787
+ * Default PDF orientation
788
+ */
789
+ readonly DEFAULT_PDF_ORIENTATION: "portrait";
790
+ /**
791
+ * Default PDF margin
792
+ */
793
+ readonly DEFAULT_PDF_MARGIN: {
794
+ readonly top: "20mm";
795
+ readonly right: "15mm";
796
+ readonly bottom: "20mm";
797
+ readonly left: "15mm";
798
+ };
799
+ /**
800
+ * Whether to print background by default
801
+ */
802
+ readonly DEFAULT_PRINT_BACKGROUND: true;
803
+ /**
804
+ * PDF generation timeout (milliseconds)
805
+ */
806
+ readonly PDF_GENERATION_TIMEOUT_MS: 60000;
807
+ /**
808
+ * Maximum template size (bytes)
809
+ */
810
+ readonly MAX_TEMPLATE_SIZE: 1048576;
811
+ };
812
+ readonly SHARE_LINK: {
813
+ /**
814
+ * Default share link expiry (seconds)
815
+ * 7 days
816
+ */
817
+ readonly DEFAULT_EXPIRY_SECONDS: 604800;
818
+ /**
819
+ * Maximum share link expiry (seconds)
820
+ * 30 days
821
+ */
822
+ readonly MAX_EXPIRY_SECONDS: 2592000;
823
+ /**
824
+ * Default maximum downloads per share link
825
+ */
826
+ readonly DEFAULT_MAX_DOWNLOADS: 100;
827
+ /**
828
+ * Whether to require password by default
829
+ */
830
+ readonly DEFAULT_REQUIRE_PASSWORD: false;
831
+ };
832
+ readonly TTL: {
833
+ /**
834
+ * Default TTL for temporary files (seconds)
835
+ * 24 hours
836
+ */
837
+ readonly DEFAULT_TTL_SECONDS: 86400;
838
+ /**
839
+ * TTL cleanup interval (milliseconds)
840
+ * Check every hour
841
+ */
842
+ readonly CLEANUP_INTERVAL_MS: 3600000;
843
+ /**
844
+ * Grace period before actual deletion (milliseconds)
845
+ * 1 hour buffer
846
+ */
847
+ readonly DELETION_GRACE_PERIOD_MS: 3600000;
848
+ };
849
+ readonly CORS: {
850
+ /**
851
+ * Default allowed origins
852
+ */
853
+ readonly DEFAULT_ALLOWED_ORIGINS: readonly ["*"];
854
+ /**
855
+ * Default allowed methods
856
+ */
857
+ readonly DEFAULT_ALLOWED_METHODS: readonly ["GET", "POST", "PUT", "DELETE", "HEAD"];
858
+ /**
859
+ * Default allowed headers
860
+ */
861
+ readonly DEFAULT_ALLOWED_HEADERS: readonly ["Content-Type", "Authorization", "X-Requested-With", "X-Upload-Content-Type", "X-Upload-Content-Length"];
862
+ /**
863
+ * Default exposed headers
864
+ */
865
+ readonly DEFAULT_EXPOSED_HEADERS: readonly ["ETag", "Content-Length", "Content-Type", "Last-Modified"];
866
+ /**
867
+ * Default max age (seconds)
868
+ */
869
+ readonly DEFAULT_MAX_AGE_SECONDS: 3600;
870
+ /**
871
+ * Whether to allow credentials by default
872
+ */
873
+ readonly DEFAULT_ALLOW_CREDENTIALS: false;
874
+ };
875
+ readonly AUDIT: {
876
+ /**
877
+ * Whether to log uploads by default
878
+ */
879
+ readonly DEFAULT_LOG_UPLOADS: true;
880
+ /**
881
+ * Whether to log downloads by default
882
+ */
883
+ readonly DEFAULT_LOG_DOWNLOADS: true;
884
+ /**
885
+ * Whether to log deletes by default
886
+ */
887
+ readonly DEFAULT_LOG_DELETES: true;
888
+ /**
889
+ * Audit log retention period (days)
890
+ */
891
+ readonly LOG_RETENTION_DAYS: 365;
892
+ /**
893
+ * Maximum audit log size per file (bytes)
894
+ */
895
+ readonly MAX_LOG_SIZE: number;
896
+ };
897
+ readonly CDN: {
898
+ /**
899
+ * Default invalidation timeout (milliseconds)
900
+ */
901
+ readonly DEFAULT_INVALIDATION_TIMEOUT_MS: 30000;
902
+ /**
903
+ * Maximum batch size for invalidation
904
+ */
905
+ readonly MAX_INVALIDATION_BATCH_SIZE: 100;
906
+ /**
907
+ * Invalidation retry attempts
908
+ */
909
+ readonly INVALIDATION_MAX_RETRIES: 3;
910
+ };
911
+ readonly MONITORING: {
912
+ /**
913
+ * Metrics collection interval (milliseconds)
914
+ */
915
+ readonly METRICS_INTERVAL_MS: 60000;
916
+ /**
917
+ * Whether to track upload progress by default
918
+ */
919
+ readonly DEFAULT_TRACK_PROGRESS: true;
920
+ /**
921
+ * Progress update interval (milliseconds)
922
+ */
923
+ readonly PROGRESS_UPDATE_INTERVAL_MS: 500;
924
+ };
925
+ readonly CLOUDFLARE_R2: {
926
+ /**
927
+ * Default region
928
+ */
929
+ readonly DEFAULT_REGION: "auto";
930
+ /**
931
+ * Default endpoint format
932
+ */
933
+ readonly DEFAULT_ENDPOINT_FORMAT: "https://{accountId}.r2.cloudflarestorage.com";
934
+ };
935
+ readonly SUPABASE_STORAGE: {
936
+ /**
937
+ * Default bucket name
938
+ */
939
+ readonly DEFAULT_BUCKET: "uploads";
940
+ /**
941
+ * Upload upsert by default
942
+ */
943
+ readonly DEFAULT_UPSERT: false;
944
+ };
945
+ };
946
+ //# sourceMappingURL=constants.d.ts.map