@plyaz/types 1.15.20 → 1.16.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.
- package/dist/api/aws/index.d.ts +5 -0
- package/dist/api/aws/signature.d.ts +42 -0
- package/dist/api/endpoints/cdn/endpoints.d.ts +57 -0
- package/dist/api/endpoints/cdn/index.d.ts +6 -0
- package/dist/api/endpoints/cdn/types.d.ts +151 -0
- package/dist/api/endpoints/index.d.ts +2 -0
- package/dist/api/endpoints/types.d.ts +3 -1
- package/dist/api/endpoints/virustotal/endpoints.d.ts +37 -0
- package/dist/api/endpoints/virustotal/index.d.ts +6 -0
- package/dist/api/endpoints/virustotal/types.d.ts +202 -0
- package/dist/api/index.cjs +1317 -1
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +1317 -1
- package/dist/api/index.js.map +1 -1
- package/dist/core/idempotency.d.ts +48 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/errors/codes.d.ts +296 -0
- package/dist/errors/enums.d.ts +10 -0
- package/dist/errors/index.cjs +1482 -1
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1482 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/validation.d.ts +71 -0
- package/dist/index.cjs +2268 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +2227 -133
- package/dist/index.js.map +1 -1
- package/dist/logger/enums.d.ts +10 -0
- package/dist/notifications/types.d.ts +1 -2
- package/dist/storage/compliance.d.ts +247 -0
- package/dist/storage/enums.d.ts +527 -0
- package/dist/storage/event-handler-mapping.d.ts +69 -0
- package/dist/storage/index.d.ts +13 -0
- package/dist/storage/interfaces.d.ts +2242 -0
- package/dist/storage/plugins.d.ts +996 -0
- package/dist/storage/schemas.d.ts +224 -0
- package/dist/storage/webhooks.d.ts +340 -0
- package/package.json +6 -1
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Package Enums
|
|
3
|
+
* @module @plyaz/types/storage
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* File categories for organizing uploaded files
|
|
7
|
+
*/
|
|
8
|
+
export declare enum FILE_CATEGORY {
|
|
9
|
+
ProfileImage = "profile_image",
|
|
10
|
+
ProfileBanner = "profile_banner",
|
|
11
|
+
ProfileData = "profile_data",
|
|
12
|
+
IdDocument = "id_document",
|
|
13
|
+
PostImage = "post_image",
|
|
14
|
+
PostVideo = "post_video",
|
|
15
|
+
PostAudio = "post_audio",
|
|
16
|
+
PostDocument = "post_document",
|
|
17
|
+
PostArchive = "post_archive",
|
|
18
|
+
GalleryImage = "gallery_image",
|
|
19
|
+
GalleryVideo = "gallery_video",
|
|
20
|
+
HighlightVideo = "highlight_video",
|
|
21
|
+
TrainingVideo = "training_video",
|
|
22
|
+
ProductImage = "product_image",
|
|
23
|
+
ProductVideo = "product_video",
|
|
24
|
+
MerchandiseImage = "merchandise_image",
|
|
25
|
+
DOCUMENT = "document",
|
|
26
|
+
ContractDocument = "contract_document",
|
|
27
|
+
InvoiceDocument = "invoice_document",
|
|
28
|
+
ReceiptDocument = "receipt_document",
|
|
29
|
+
TaxDocument = "tax_document",
|
|
30
|
+
LegalDocument = "legal_document",
|
|
31
|
+
FinancialDocument = "financial_document",
|
|
32
|
+
NftImage = "nft_image",
|
|
33
|
+
NftMetadata = "nft_metadata",
|
|
34
|
+
BrandLogo = "brand_logo",
|
|
35
|
+
BrandAsset = "brand_asset",
|
|
36
|
+
MarketingAsset = "marketing_asset",
|
|
37
|
+
AVATAR = "avatar",
|
|
38
|
+
ATTACHMENT = "attachment",
|
|
39
|
+
TempFile = "temp_file",
|
|
40
|
+
OTHER = "other"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Entity types that can own files
|
|
44
|
+
*/
|
|
45
|
+
export declare enum ENTITY_TYPE {
|
|
46
|
+
USER = "user",
|
|
47
|
+
FAN = "fan",
|
|
48
|
+
ATHLETE = "athlete",
|
|
49
|
+
CLUB = "club",
|
|
50
|
+
BRAND = "brand",
|
|
51
|
+
ORGANIZATION = "organization",
|
|
52
|
+
EVENT = "event",
|
|
53
|
+
POST = "post",
|
|
54
|
+
PRODUCT = "product",
|
|
55
|
+
NFT = "nft",
|
|
56
|
+
SYSTEM = "system"
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Storage adapter types
|
|
60
|
+
*/
|
|
61
|
+
export declare enum STORAGE_ADAPTER_TYPE {
|
|
62
|
+
CloudflareR2 = "cloudflare_r2",
|
|
63
|
+
SupabaseStorage = "supabase_storage",
|
|
64
|
+
CUSTOM = "custom",
|
|
65
|
+
MOCK = "mock"
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* File access levels
|
|
69
|
+
*/
|
|
70
|
+
export declare enum FILE_ACCESS_LEVEL {
|
|
71
|
+
PUBLIC = "public",
|
|
72
|
+
PRIVATE = "private",
|
|
73
|
+
SHARED = "shared",
|
|
74
|
+
RESTRICTED = "restricted"
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Upload status
|
|
78
|
+
*/
|
|
79
|
+
export declare enum UPLOAD_STATUS {
|
|
80
|
+
PENDING = "pending",
|
|
81
|
+
UPLOADING = "uploading",
|
|
82
|
+
PROCESSING = "processing",
|
|
83
|
+
COMPLETED = "completed",
|
|
84
|
+
FAILED = "failed",
|
|
85
|
+
CANCELLED = "cancelled"
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Storage event types
|
|
89
|
+
*/
|
|
90
|
+
export declare enum STORAGE_EVENT_TYPE {
|
|
91
|
+
FileUploaded = "file_uploaded",
|
|
92
|
+
FileUploadFailed = "file_upload_failed",
|
|
93
|
+
UploadProgress = "upload_progress",
|
|
94
|
+
UploadAborted = "upload_aborted",
|
|
95
|
+
FileDeleted = "file_deleted",
|
|
96
|
+
FileDeleteFailed = "file_delete_failed",
|
|
97
|
+
FileAccessed = "file_accessed",
|
|
98
|
+
SignedUrlGenerated = "signed_url_generated",
|
|
99
|
+
MetadataExtracted = "metadata_extracted",
|
|
100
|
+
MediaProcessingStarted = "media_processing_started",
|
|
101
|
+
MediaProcessingCompleted = "media_processing_completed",
|
|
102
|
+
MediaProcessingFailed = "media_processing_failed",
|
|
103
|
+
TranscodeComplete = "transcode_complete",
|
|
104
|
+
TranscodeFailed = "transcode_failed",
|
|
105
|
+
TranscodeProgress = "transcode_progress",
|
|
106
|
+
ThumbnailGenerated = "thumbnail_generated",
|
|
107
|
+
ImageOptimized = "image_optimized",
|
|
108
|
+
VirusDetected = "virus_detected",
|
|
109
|
+
VirusScanCompleted = "virus_scan_completed",
|
|
110
|
+
AdapterHealthCheck = "adapter_health_check",
|
|
111
|
+
AdapterFailed = "adapter_failed",
|
|
112
|
+
RetentionPolicyApplied = "retention_policy_applied",
|
|
113
|
+
RetentionEnforced = "retention_enforced",
|
|
114
|
+
FileMarkedForDeletion = "file_marked_for_deletion",
|
|
115
|
+
ImmutabilityEnforced = "immutability_enforced",
|
|
116
|
+
SoftDeleteProcessed = "soft_delete_processed",
|
|
117
|
+
FileRestored = "file_restored",
|
|
118
|
+
FileArchived = "file_archived",
|
|
119
|
+
RetentionExpired = "retention_expired",
|
|
120
|
+
JurisdictionConflictResolved = "jurisdiction_conflict_resolved",
|
|
121
|
+
FileGenerated = "file_generated",
|
|
122
|
+
FileGenerationFailed = "file_generation_failed",
|
|
123
|
+
FileUpdated = "file_updated",
|
|
124
|
+
FileUpdateFailed = "file_update_failed",
|
|
125
|
+
FileReplaced = "file_replaced",
|
|
126
|
+
FileReplaceFailed = "file_replace_failed",
|
|
127
|
+
FileMoved = "file_moved",
|
|
128
|
+
FileMoveFailed = "file_move_failed",
|
|
129
|
+
FileCopied = "file_copied",
|
|
130
|
+
FileCopyFailed = "file_copy_failed",
|
|
131
|
+
AuditLogCreated = "audit_log_created",
|
|
132
|
+
QueueStarted = "storage.queue.started",
|
|
133
|
+
QueueStopped = "storage.queue.stopped",
|
|
134
|
+
OperationProcessing = "storage.operation.processing",
|
|
135
|
+
OperationCompleted = "storage.operation.completed",
|
|
136
|
+
OperationRetry = "storage.operation.retry",
|
|
137
|
+
OperationFailed = "storage.operation.failed",
|
|
138
|
+
StorageError = "storage_error",
|
|
139
|
+
CdnInvalidated = "cdn_invalidated",
|
|
140
|
+
CdnInvalidationFailed = "cdn_invalidation_failed",
|
|
141
|
+
IntegrityCheckFailed = "integrity_check_failed",
|
|
142
|
+
CorruptionDetected = "corruption_detected",
|
|
143
|
+
QuotaWarning = "quota_warning",
|
|
144
|
+
QuotaExceeded = "quota_exceeded",
|
|
145
|
+
WebhookReceived = "webhook_received",
|
|
146
|
+
WebhookProcessed = "webhook_processed",
|
|
147
|
+
WebhookFailed = "webhook_failed",
|
|
148
|
+
WebhookRetryExhausted = "webhook_retry_exhausted"
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Retry strategies for adapter operations
|
|
152
|
+
*/
|
|
153
|
+
export declare enum RETRY_STRATEGY {
|
|
154
|
+
ExponentialBackoff = "exponential_backoff",
|
|
155
|
+
LinearBackoff = "linear_backoff",
|
|
156
|
+
FixedDelay = "fixed_delay",
|
|
157
|
+
NoRetry = "no_retry"
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Path generation strategies
|
|
161
|
+
*/
|
|
162
|
+
export declare enum PATH_GENERATION_STRATEGY {
|
|
163
|
+
HashBased = "hash_based",
|
|
164
|
+
EntityBased = "entity_based",
|
|
165
|
+
DateBased = "date_based",
|
|
166
|
+
CategoryBased = "category_based",
|
|
167
|
+
FLAT = "flat"
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* File validation error types
|
|
171
|
+
*/
|
|
172
|
+
export declare enum FILE_VALIDATION_ERROR {
|
|
173
|
+
InvalidMimeType = "invalid_mime_type",
|
|
174
|
+
FileTooLarge = "file_too_large",
|
|
175
|
+
FileTooSmall = "file_too_small",
|
|
176
|
+
InvalidExtension = "invalid_extension",
|
|
177
|
+
InvalidFilename = "invalid_filename",
|
|
178
|
+
ExecutableDetected = "executable_detected",
|
|
179
|
+
VirusDetected = "virus_detected"
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Template output formats
|
|
183
|
+
*/
|
|
184
|
+
export declare enum TEMPLATE_OUTPUT_FORMAT {
|
|
185
|
+
PDF = "pdf",
|
|
186
|
+
HTML = "html",
|
|
187
|
+
MARKDOWN = "markdown"
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Document types for compliance storage (R2)
|
|
191
|
+
* Financial and legal documents requiring strict compliance
|
|
192
|
+
*/
|
|
193
|
+
export declare enum DOCUMENT_TYPE {
|
|
194
|
+
INVOICE = "invoice",
|
|
195
|
+
RECEIPT = "receipt",
|
|
196
|
+
TAX = "tax",
|
|
197
|
+
COMPLIANCE = "compliance",
|
|
198
|
+
CERTIFICATE = "certificate",
|
|
199
|
+
CONTRACT = "contract",
|
|
200
|
+
REPORT = "report"
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Media entity types (for Supabase media storage)
|
|
204
|
+
*/
|
|
205
|
+
export declare enum MEDIA_ENTITY {
|
|
206
|
+
TEAM = "team",
|
|
207
|
+
CLUB = "club",
|
|
208
|
+
ATHLETE = "athlete",
|
|
209
|
+
MATCH = "match",
|
|
210
|
+
LEAGUE = "league",
|
|
211
|
+
POST = "post",
|
|
212
|
+
CAMPAIGN = "campaign",
|
|
213
|
+
PRODUCT = "product",
|
|
214
|
+
BRAND = "brand",
|
|
215
|
+
USER = "user"
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Storage visibility levels
|
|
219
|
+
*/
|
|
220
|
+
export declare enum STORAGE_VISIBILITY {
|
|
221
|
+
PUBLIC = "public",
|
|
222
|
+
PRIVATE = "private"
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Environment types for bucket naming
|
|
226
|
+
*/
|
|
227
|
+
export declare enum STORAGE_ENVIRONMENT {
|
|
228
|
+
PRODUCTION = "prod",
|
|
229
|
+
STAGING = "stg",
|
|
230
|
+
DEVELOPMENT = "dev"
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Business model types for organizational separation
|
|
234
|
+
*/
|
|
235
|
+
export declare enum BUSINESS_MODEL {
|
|
236
|
+
B2B = "b2b",
|
|
237
|
+
B2C = "b2c",
|
|
238
|
+
B2B2C = "b2b2c",
|
|
239
|
+
INTERNAL = "internal"
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Organization tier for dedicated resources
|
|
243
|
+
*/
|
|
244
|
+
export declare enum ORGANIZATION_TIER {
|
|
245
|
+
ENTERPRISE = "enterprise",
|
|
246
|
+
PROFESSIONAL = "professional",
|
|
247
|
+
STANDARD = "standard",
|
|
248
|
+
STARTER = "starter"
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Storage bucket purpose (provider-agnostic)
|
|
252
|
+
* Describes what the bucket is used for, not how it's named
|
|
253
|
+
*/
|
|
254
|
+
export declare enum BUCKET_PURPOSE {
|
|
255
|
+
/** Financial/legal compliance documents */
|
|
256
|
+
COMPLIANCE = "compliance",
|
|
257
|
+
/** Image files (photos, graphics) */
|
|
258
|
+
MediaImages = "media-images",
|
|
259
|
+
/** Video files */
|
|
260
|
+
MediaVideos = "media-videos",
|
|
261
|
+
/** Static assets (CSS, JS, fonts) */
|
|
262
|
+
MediaStatic = "media-static",
|
|
263
|
+
/** User uploads (attachments, documents) */
|
|
264
|
+
UserUploads = "user-uploads",
|
|
265
|
+
/** Temporary files (processing, staging) */
|
|
266
|
+
TEMPORARY = "temporary",
|
|
267
|
+
/** Archived/cold storage */
|
|
268
|
+
ARCHIVES = "archives",
|
|
269
|
+
/** Backups */
|
|
270
|
+
BACKUPS = "backups"
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Path generation strategy type
|
|
274
|
+
*/
|
|
275
|
+
export declare enum PATH_STRATEGY {
|
|
276
|
+
/** Financial/legal compliance documents */
|
|
277
|
+
COMPLIANCE = "compliance",
|
|
278
|
+
/** Media files (images/videos) */
|
|
279
|
+
MEDIA = "media",
|
|
280
|
+
/** General files */
|
|
281
|
+
GENERAL = "general"
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Media variant types
|
|
285
|
+
*/
|
|
286
|
+
export declare enum MEDIA_VARIANT_TYPE {
|
|
287
|
+
THUMBNAIL = "thumbnail",
|
|
288
|
+
SMALL = "small",
|
|
289
|
+
MEDIUM = "medium",
|
|
290
|
+
LARGE = "large",
|
|
291
|
+
MOBILE = "mobile",
|
|
292
|
+
TABLET = "tablet",
|
|
293
|
+
DESKTOP = "desktop",
|
|
294
|
+
HD = "hd",
|
|
295
|
+
FourK = "4k",
|
|
296
|
+
Video360p = "360p",
|
|
297
|
+
Video480p = "480p",
|
|
298
|
+
Video720p = "720p",
|
|
299
|
+
Video1080p = "1080p"
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Storage queue priority levels
|
|
303
|
+
*/
|
|
304
|
+
export declare enum STORAGE_QUEUE_PRIORITY {
|
|
305
|
+
HIGH = "high",
|
|
306
|
+
NORMAL = "normal",
|
|
307
|
+
LOW = "low"
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Device types for device-aware variant optimization
|
|
311
|
+
* Used to select optimal variants based on target device
|
|
312
|
+
*/
|
|
313
|
+
export declare enum STORAGE_DEVICE_TYPE {
|
|
314
|
+
/** Mobile phones (320px - 480px) */
|
|
315
|
+
MOBILE = "mobile",
|
|
316
|
+
/** Tablets (768px - 1024px) */
|
|
317
|
+
TABLET = "tablet",
|
|
318
|
+
/** Desktop/laptop screens (1280px - 1920px) */
|
|
319
|
+
DESKTOP = "desktop",
|
|
320
|
+
/** 4K/Retina displays (2560px+) */
|
|
321
|
+
FourK = "4k",
|
|
322
|
+
/** Smart TVs and large displays (3840px+) */
|
|
323
|
+
TV = "tv",
|
|
324
|
+
/** Watch/wearable devices (small screens) */
|
|
325
|
+
WATCH = "watch",
|
|
326
|
+
/** Auto-detect best variant (default) */
|
|
327
|
+
AUTO = "auto"
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Standard variant names for images and videos
|
|
331
|
+
* Used to identify specific size/quality variants
|
|
332
|
+
*/
|
|
333
|
+
export declare enum STORAGE_VARIANT_NAME {
|
|
334
|
+
THUMBNAIL = "thumbnail",
|
|
335
|
+
SMALL = "small",
|
|
336
|
+
MEDIUM = "medium",
|
|
337
|
+
LARGE = "large",
|
|
338
|
+
XLARGE = "xlarge",
|
|
339
|
+
MOBILE = "mobile",
|
|
340
|
+
TABLET = "tablet",
|
|
341
|
+
DESKTOP = "desktop",
|
|
342
|
+
HD = "hd",
|
|
343
|
+
FourK = "4k",
|
|
344
|
+
RETINA = "retina",
|
|
345
|
+
Video360p = "360p",
|
|
346
|
+
Video480p = "480p",
|
|
347
|
+
Video720p = "720p",
|
|
348
|
+
Video1080p = "1080p",
|
|
349
|
+
Video4k = "4k-video"
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Adapter health status
|
|
353
|
+
*/
|
|
354
|
+
export declare enum ADAPTER_HEALTH_STATUS {
|
|
355
|
+
HEALTHY = "healthy",
|
|
356
|
+
DEGRADED = "degraded",
|
|
357
|
+
UNHEALTHY = "unhealthy",
|
|
358
|
+
UNKNOWN = "unknown"
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Renderer type (document/template rendering engines)
|
|
362
|
+
*/
|
|
363
|
+
export declare enum STORAGE_RENDERER_TYPE {
|
|
364
|
+
PUPPETEER = "puppeteer",// Headless Chrome (HTML → PDF/PNG)
|
|
365
|
+
PLAYWRIGHT = "playwright",// Headless browser (HTML → PDF/PNG)
|
|
366
|
+
PDFKIT = "pdfkit",// Lightweight PDF generation
|
|
367
|
+
JSPDF = "jspdf",// Client-side PDF generation
|
|
368
|
+
WKHTMLTOPDF = "wkhtmltopdf",// Standalone binary (HTML → PDF)
|
|
369
|
+
EXCELJS = "exceljs",// Excel generation
|
|
370
|
+
DOCXTEMPLATER = "docxtemplater"
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Output format for rendered documents
|
|
374
|
+
*/
|
|
375
|
+
export declare enum OUTPUT_FORMAT {
|
|
376
|
+
PDF = "pdf",
|
|
377
|
+
HTML = "html",
|
|
378
|
+
PNG = "png",
|
|
379
|
+
JPEG = "jpeg",
|
|
380
|
+
EXCEL = "excel",// .xlsx
|
|
381
|
+
WORD = "word",// .docx
|
|
382
|
+
CSV = "csv",
|
|
383
|
+
JSON = "json"
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Compliance jurisdictions
|
|
387
|
+
*
|
|
388
|
+
* Standardized jurisdiction codes for compliance enforcement
|
|
389
|
+
*/
|
|
390
|
+
export declare enum STORAGE_JURISDICTION {
|
|
391
|
+
GLOBAL = "GLOBAL",
|
|
392
|
+
US = "US",
|
|
393
|
+
UsCa = "US-CA",// California (CCPA)
|
|
394
|
+
UsNy = "US-NY",// New York (NYDFS)
|
|
395
|
+
UsTx = "US-TX",// Texas
|
|
396
|
+
UsFl = "US-FL",// Florida
|
|
397
|
+
UsIl = "US-IL",// Illinois
|
|
398
|
+
EU = "EU",
|
|
399
|
+
EuDe = "EU-DE",// Germany
|
|
400
|
+
EuFr = "EU-FR",// France
|
|
401
|
+
EuGb = "EU-GB",// United Kingdom (post-Brexit)
|
|
402
|
+
EuIt = "EU-IT",// Italy
|
|
403
|
+
EuEs = "EU-ES",// Spain
|
|
404
|
+
EuNl = "EU-NL",// Netherlands
|
|
405
|
+
EuCh = "EU-CH",// Switzerland
|
|
406
|
+
JP = "JP",// Japan
|
|
407
|
+
SG = "SG",// Singapore
|
|
408
|
+
HK = "HK",// Hong Kong
|
|
409
|
+
AU = "AU",// Australia
|
|
410
|
+
NZ = "NZ",// New Zealand
|
|
411
|
+
KR = "KR",// South Korea
|
|
412
|
+
CN = "CN",// China
|
|
413
|
+
AE = "AE",// UAE
|
|
414
|
+
SA = "SA",// Saudi Arabia
|
|
415
|
+
IL = "IL",// Israel
|
|
416
|
+
ZA = "ZA",// South Africa
|
|
417
|
+
CA = "CA",// Canada
|
|
418
|
+
BR = "BR",// Brazil
|
|
419
|
+
MX = "MX",// Mexico
|
|
420
|
+
AR = "AR"
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Regulatory frameworks for compliance
|
|
424
|
+
*
|
|
425
|
+
* Standardized framework codes to prevent arbitrary strings
|
|
426
|
+
*/
|
|
427
|
+
export declare enum STORAGE_REGULATORY_FRAMEWORK {
|
|
428
|
+
IRS = "IRS",// Internal Revenue Service
|
|
429
|
+
SEC = "SEC",// Securities and Exchange Commission
|
|
430
|
+
FINRA = "FINRA",// Financial Industry Regulatory Authority
|
|
431
|
+
SOX = "SOX",// Sarbanes-Oxley Act
|
|
432
|
+
GLBA = "GLBA",// Gramm-Leach-Bliley Act
|
|
433
|
+
FCRA = "FCRA",// Fair Credit Reporting Act
|
|
434
|
+
FINCEN = "FinCEN",// Financial Crimes Enforcement Network
|
|
435
|
+
BSA = "BSA",// Bank Secrecy Act
|
|
436
|
+
AML = "AML",// Anti-Money Laundering
|
|
437
|
+
OFAC = "OFAC",// Office of Foreign Assets Control
|
|
438
|
+
NYDFS = "NYDFS",// NY Department of Financial Services
|
|
439
|
+
CCPA = "CCPA",// California Consumer Privacy Act
|
|
440
|
+
CPRA = "CPRA",// California Privacy Rights Act
|
|
441
|
+
GDPR = "GDPR",// General Data Protection Regulation
|
|
442
|
+
MICA = "MiCA",// Markets in Crypto-Assets Regulation
|
|
443
|
+
AMLD5 = "5AMLD",// 5th Anti-Money Laundering Directive
|
|
444
|
+
AMLD6 = "6AMLD",// 6th Anti-Money Laundering Directive
|
|
445
|
+
PSD2 = "PSD2",// Payment Services Directive 2
|
|
446
|
+
EMIR = "EMIR",// European Market Infrastructure Regulation
|
|
447
|
+
FATF = "FATF",// Financial Action Task Force
|
|
448
|
+
BaselIii = "Basel III",// Basel III banking regulations
|
|
449
|
+
ISO27001 = "ISO27001",// Information security management
|
|
450
|
+
SOC2 = "SOC2",// Service Organization Control 2
|
|
451
|
+
HIPAA = "HIPAA",// Health Insurance Portability and Accountability Act
|
|
452
|
+
HITECH = "HITECH",// Health Information Technology for Economic and Clinical Health
|
|
453
|
+
PciDss = "PCI DSS",// Payment Card Industry Data Security Standard
|
|
454
|
+
FERPA = "FERPA",// Family Educational Rights and Privacy Act
|
|
455
|
+
COPPA = "COPPA",// Children's Online Privacy Protection Act
|
|
456
|
+
InternalSecurity = "Internal Security Policy",
|
|
457
|
+
IndustryBestPractices = "Industry Best Practices"
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Storage plugin types
|
|
461
|
+
*/
|
|
462
|
+
export declare enum STORAGE_PLUGIN_TYPE {
|
|
463
|
+
VALIDATION = "validation",// File validation (size, type, content)
|
|
464
|
+
SECURITY = "security",// Virus scanning, malware detection
|
|
465
|
+
METADATA = "metadata",// Metadata extraction (dimensions, duration)
|
|
466
|
+
CDN = "cdn",// CDN invalidation, cache management
|
|
467
|
+
PROCESSING = "processing",// Media processing, transcoding
|
|
468
|
+
MONITORING = "monitoring",// Access tracking, performance monitoring
|
|
469
|
+
COMPLIANCE = "compliance",// Compliance checks, retention policies
|
|
470
|
+
AUDIT = "audit",// Audit logging, compliance tracking
|
|
471
|
+
CUSTOM = "custom"
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Storage Webhook Types
|
|
475
|
+
*
|
|
476
|
+
* Webhook system for handling external callbacks from:
|
|
477
|
+
* - Cloud storage providers (R2, Supabase)
|
|
478
|
+
* - Media processing services (AWS MediaConvert, Cloudinary)
|
|
479
|
+
* - CDN providers (Cloudflare, CloudFront, Fastly)
|
|
480
|
+
*
|
|
481
|
+
* @module @plyaz/types/storage/webhooks
|
|
482
|
+
*
|
|
483
|
+
* Note: Validation schema implementation (Zod) is abstracted away.
|
|
484
|
+
* Consumers don't need to know about or install Zod.
|
|
485
|
+
*/
|
|
486
|
+
/**
|
|
487
|
+
* Webhook event types for storage operations
|
|
488
|
+
*/
|
|
489
|
+
export declare enum STORAGE_WEBHOOK_EVENT_TYPE {
|
|
490
|
+
ObjectCreated = "object.created",
|
|
491
|
+
ObjectUpdated = "object.updated",
|
|
492
|
+
ObjectDeleted = "object.deleted",
|
|
493
|
+
ObjectRestored = "object.restored",
|
|
494
|
+
ObjectArchived = "object.archived",
|
|
495
|
+
TranscodeComplete = "transcode.complete",
|
|
496
|
+
TranscodeFailed = "transcode.failed",
|
|
497
|
+
TranscodeProgress = "transcode.progress",
|
|
498
|
+
ThumbnailComplete = "thumbnail.complete",
|
|
499
|
+
ImageOptimizationComplete = "image.optimization.complete",
|
|
500
|
+
CdnInvalidationComplete = "cdn.invalidation.complete",
|
|
501
|
+
CdnInvalidationFailed = "cdn.invalidation.failed",
|
|
502
|
+
ChecksumMismatch = "checksum.mismatch",
|
|
503
|
+
ObjectCorrupted = "object.corrupted",
|
|
504
|
+
QuotaWarning = "quota.warning",
|
|
505
|
+
QuotaExceeded = "quota.exceeded"
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Storage operations
|
|
509
|
+
*/
|
|
510
|
+
export declare enum STORAGE_OPERATION {
|
|
511
|
+
UPLOAD = "upload",
|
|
512
|
+
DELETE = "delete",
|
|
513
|
+
UPDATE = "update",
|
|
514
|
+
RESTORE = "restore",
|
|
515
|
+
ARCHIVE = "archive"
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Signature verification methods for storage webhooks
|
|
519
|
+
*/
|
|
520
|
+
export declare enum STORAGE_SIGNATURE_METHOD {
|
|
521
|
+
HmacSha256 = "hmac-sha256",
|
|
522
|
+
HmacSha512 = "hmac-sha512",
|
|
523
|
+
HmacSha1 = "hmac-sha1",
|
|
524
|
+
AwsSignatureV4 = "aws-signature-v4",
|
|
525
|
+
JWT = "jwt",
|
|
526
|
+
Custom = "custom"
|
|
527
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Handler Mapping
|
|
3
|
+
*
|
|
4
|
+
* Centralized mapping between camelCase handler names (StorageEventHandlers)
|
|
5
|
+
* and enum-based event types (STORAGE_EVENT_TYPE).
|
|
6
|
+
*
|
|
7
|
+
* This mapping is used by:
|
|
8
|
+
* - StorageService to register handlers
|
|
9
|
+
* - Documentation generation
|
|
10
|
+
* - Type utilities
|
|
11
|
+
* - Testing utilities
|
|
12
|
+
*
|
|
13
|
+
* @module @plyaz/types/storage
|
|
14
|
+
*/
|
|
15
|
+
import type { StorageEventHandlers } from './interfaces';
|
|
16
|
+
import type { STORAGE_WEBHOOK_EVENT_TYPE } from './enums';
|
|
17
|
+
import { STORAGE_EVENT_TYPE } from './enums';
|
|
18
|
+
/**
|
|
19
|
+
* Mapping from camelCase handler method names to StorageEventType enum values
|
|
20
|
+
*
|
|
21
|
+
* This is the single source of truth for the handler name <-> event type relationship.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import { STORAGE_EVENT_HANDLER_MAPPING } from '@plyaz/types';
|
|
26
|
+
*
|
|
27
|
+
* // Get event type from handler name
|
|
28
|
+
* const eventType = STORAGE_EVENT_HANDLER_MAPPING.onFileUploaded;
|
|
29
|
+
* // Returns: STORAGE_EVENT_TYPE.FileUploaded
|
|
30
|
+
*
|
|
31
|
+
* // Register handler
|
|
32
|
+
* if (handlers.onFileUploaded) {
|
|
33
|
+
* eventManager.on(STORAGE_EVENT_HANDLER_MAPPING.onFileUploaded, handlers.onFileUploaded);
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const STORAGE_EVENT_HANDLER_MAPPING: Record<keyof StorageEventHandlers, STORAGE_EVENT_TYPE>;
|
|
38
|
+
/**
|
|
39
|
+
* Webhook event type to internal storage event mapping
|
|
40
|
+
*
|
|
41
|
+
* Maps external webhook event types to internal StorageEventType enums
|
|
42
|
+
* Used by WebhookManager to emit the correct storage events
|
|
43
|
+
*/
|
|
44
|
+
export declare const WEBHOOK_EVENT_TYPE_MAPPING: Record<(typeof STORAGE_WEBHOOK_EVENT_TYPE)[keyof typeof STORAGE_WEBHOOK_EVENT_TYPE], STORAGE_EVENT_TYPE>;
|
|
45
|
+
/**
|
|
46
|
+
* Reverse mapping from StorageEventType enum values to camelCase handler names
|
|
47
|
+
*
|
|
48
|
+
* Useful for generating handler names from event types, documentation, etc.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { STORAGE_EVENT_TYPE_TO_HANDLER_NAME } from '@plyaz/types';
|
|
53
|
+
*
|
|
54
|
+
* // Get handler name from event type
|
|
55
|
+
* const handlerName = STORAGE_EVENT_TYPE_TO_HANDLER_NAME[STORAGE_EVENT_TYPE.FileUploaded];
|
|
56
|
+
* // Returns: 'onFileUploaded'
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const STORAGE_EVENT_TYPE_TO_HANDLER_NAME: Record<STORAGE_EVENT_TYPE, keyof StorageEventHandlers>;
|
|
60
|
+
/**
|
|
61
|
+
* Type-safe helper to get all handler names
|
|
62
|
+
*/
|
|
63
|
+
export type StorageEventHandlerName = keyof StorageEventHandlers;
|
|
64
|
+
export type StorageWebhookEventHandlerName = (typeof STORAGE_WEBHOOK_EVENT_TYPE)[keyof typeof STORAGE_WEBHOOK_EVENT_TYPE];
|
|
65
|
+
/**
|
|
66
|
+
* Type-safe helper to get all event types that have handlers
|
|
67
|
+
*/
|
|
68
|
+
export type MappedStorageEventType = (typeof STORAGE_EVENT_HANDLER_MAPPING)[StorageEventHandlerName];
|
|
69
|
+
export type MappedStorageWebhookEventType = (typeof WEBHOOK_EVENT_TYPE_MAPPING)[StorageWebhookEventHandlerName];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Package Types
|
|
3
|
+
* @module @plyaz/types/storage
|
|
4
|
+
*/
|
|
5
|
+
export { ADAPTER_HEALTH_STATUS, ENTITY_TYPE, FILE_ACCESS_LEVEL, FILE_CATEGORY, FILE_VALIDATION_ERROR, MEDIA_VARIANT_TYPE, OUTPUT_FORMAT, PATH_GENERATION_STRATEGY, STORAGE_RENDERER_TYPE, RETRY_STRATEGY, STORAGE_ADAPTER_TYPE, STORAGE_EVENT_TYPE, STORAGE_QUEUE_PRIORITY, TEMPLATE_OUTPUT_FORMAT, DOCUMENT_TYPE, MEDIA_ENTITY, STORAGE_VISIBILITY, STORAGE_ENVIRONMENT, BUSINESS_MODEL, ORGANIZATION_TIER, BUCKET_PURPOSE, PATH_STRATEGY, UPLOAD_STATUS, STORAGE_JURISDICTION, STORAGE_REGULATORY_FRAMEWORK, STORAGE_PLUGIN_TYPE, STORAGE_WEBHOOK_EVENT_TYPE, STORAGE_OPERATION, STORAGE_SIGNATURE_METHOD, STORAGE_DEVICE_TYPE, STORAGE_VARIANT_NAME, } from './enums';
|
|
6
|
+
export type { AdapterHealthCheck, BaseStorageAdapterConfig, BucketConfiguration, BucketRouterConfig, CompliancePathOptions, CloudflareR2Config, CorsConfig, CustomAdapterConfig, DeleteParams, DownloadParams, DownloadResult, FileDeleteResult, FileMetadata, FileValidationResult, GeneralPathOptions, MediaPathOptions, MediaProcessingOptions, MockAdapterConfig, PathGenerationConfig, PDFRenderOptions, PresignedUrlOptions, PresignedUrlResult, StorageExcelRenderOptions, StorageWordRenderOptions, StorageFileOperationType, StorageQueueProcessFunction, StorageQueuedOperation, QueueItem, StorageQueueStatistics, RetentionPolicy, RoutingCondition, RoutingDecision, RoutingRule, ShareLinkConfig, StorageApiClientConfig, StorageCategory, StorageComplianceRule, StorageEventPayload, StorageEventHandlers, StorageLayoutConfig, StorageRenderOptions, StorageRendererAdapterConfig, StorageRendererHealthCheck, StorageRenderResult, StorageResult, StorageQueueConfig, StorageRetryConfig, StorageServiceConfig, StorageTemplateCacheEntry, StorageTemplateEngineConfig, StorageTemplateFrontmatter, StorageTemplateRenderResult, StorageTranslationService, SupabaseStorageConfig, TemplateConfig, TemplateService, UploadParams, UploadProgressEvent, UploadResult, ValidationRule, MultipartUploadPart, BucketDeletionResult, BucketPurposeValidationRules, StorageValidationConfig, StorageAdapterRegistryConfig, StorageEventManagerConfig, StorageQueueProcessorConfig, StorageComplianceManagerConfig, StorageRendererRegistryConfig, StorageLayoutEngineConfig, StorageAppliedLayout, StorageTranslationServiceConfig, FileSystemTemplateServiceConfig, StorageDocxTemplaterRendererConfig, StorageWordDocumentData, StoragePlaywrightRendererConfig, StoragePDFKitRendererConfig, StoragePDFKitDocumentData, StorageExcelJSRendererConfig, StorageExcelData, StoragePuppeteerRendererConfig, StorageMediaProcessingWebhookConfig, StorageRetryOptions, StorageHashPathOptions, StorageEntityPathOptions, StorageDatePathOptions, StorageCategoryPathOptions, StorageFlatPathOptions, StorageTemplateVariables, StorageSignedUrlOptions, StorageVerificationResult, StorageEventCallback, StoragePathHashAlgorithm, StorageHashAlgorithm, StorageSignedUrlPermission, StorageAdapterCapability, StorageVariantConfig, StoragePresetConfig, StorageResolvedVariant, StoragePresetManagerConfig, StorageResolveVariantsOptions, StorageBucketDeletionResult, StorageChunkExtractionResult, StorageChunkUploadPartResult, } from './interfaces';
|
|
7
|
+
export { STORAGE_EVENT_HANDLER_MAPPING, STORAGE_EVENT_TYPE_TO_HANDLER_NAME, } from './event-handler-mapping';
|
|
8
|
+
export type { StorageEventHandlerName, MappedStorageEventType } from './event-handler-mapping';
|
|
9
|
+
export type { StorageRetentionPolicyType, StorageRetentionStrategy, StorageImmutabilityStrategy, StorageDeletionReason, StorageRetentionPolicy, StorageComplianceConfig, StorageComplianceCheckResult, StorageDeleteComplianceOptions, StorageBulkDeleteResult, StorageComplianceEventMetadata, StorageSoftDeleteMetadata, } from './compliance';
|
|
10
|
+
export type { StoragePlugin, StoragePluginConfig, PluginStorageAdapterInterface, StoragePluginContext, StoragePluginFile, StoragePluginUploadResult, StoragePluginDeleteResult, StoragePluginAccessEvent, StoragePluginHealth, StoragePluginExecutionResult, BeforeUploadResult, BeforeDeleteResult, VirusScanResult, VirusThreat, VirusScanProviderConfig, VirusScanProvider, VirusScanPluginConfig, VirusTotalProviderConfig, ClamAVProviderConfig, ImageVariant, WatermarkConfig, SharpImagePluginConfig, VideoResolution, ThumbnailConfig, HLSConfig, FFmpegVideoPluginConfig, ExtractedMetadata, MetadataExtractionPluginConfig, CDNProviderType, BaseCDNProviderConfig, CloudflareCDNConfig, CloudFrontCDNConfig, FastlyCDNConfig, CDNProviderConfig, CDNInvalidationPluginConfig, CDNInvalidationResult, } from './plugins';
|
|
11
|
+
export type { StorageWebhookPayload, ProcessedStorageWebhookEvent, StorageWebhookVerificationResult, StorageWebhookProcessingResult, StorageBaseWebhookAdapterConfig, StorageWebhookSecurityConfig, StorageWebhookAdapter, StorageWebhookManagerConfig, StorageWebhookMiddleware, StorageWebhookRetryConfig, StorageIdempotencyRecord, StorageExternalIdempotencyStore, CloudflareR2WebhookConfig, SupabaseStorageWebhookConfig, } from './webhooks';
|
|
12
|
+
export { STORAGE_PROCESSING_STATUS, StorageProcessingOutputSchema, StorageMediaProcessingPayloadSchema, R2EventRecordSchema, R2WebhookPayloadSchema, SupabaseStorageObjectSchema, SupabaseWebhookPayloadSchema, } from './schemas';
|
|
13
|
+
export type { StorageProcessingOutput, StorageMediaProcessingPayload, R2WebhookPayload, R2EventRecord, SupabaseWebhookPayload, SupabaseStorageObject, } from './schemas';
|