@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.
- package/dist/aws/constants.d.ts +83 -0
- package/dist/aws/constants.d.ts.map +1 -0
- package/dist/aws/index.d.ts +6 -0
- package/dist/aws/index.d.ts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/storage/categories.d.ts +52 -0
- package/dist/storage/categories.d.ts.map +1 -0
- package/dist/storage/chunked-upload.d.ts +58 -0
- package/dist/storage/chunked-upload.d.ts.map +1 -0
- package/dist/storage/constants.d.ts +946 -0
- package/dist/storage/constants.d.ts.map +1 -0
- package/dist/storage/defaults.d.ts +180 -0
- package/dist/storage/defaults.d.ts.map +1 -0
- package/dist/storage/index.d.ts +14 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/mime-types.d.ts +33 -0
- package/dist/storage/mime-types.d.ts.map +1 -0
- package/dist/storage/validation.d.ts +29 -0
- package/dist/storage/validation.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/storage/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,cAAc,EACf,MAAM,cAAc,CAAC;AAatB;;GAEG;AACH,eAAO,MAAM,sBAAsB;IACjC;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAWH;;OAEG;;IASH;;OAEG;;IAWH;;OAEG;;IAGH;;OAEG;;CAgBK,CAAC;AAEX;;GA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-ready compliance and operational behavior.
|
|
6
|
+
*
|
|
7
|
+
* @module src/storage/defaults
|
|
8
|
+
*/
|
|
9
|
+
import type { StorageComplianceConfig, StorageRetentionPolicy, StoragePresetConfig, StorageVariantConfig } from '@plyaz/types';
|
|
10
|
+
import { FILE_CATEGORY, STORAGE_VARIANT_NAME } from '@plyaz/types';
|
|
11
|
+
/**
|
|
12
|
+
* Default retention policy - FINANCE/CRYPTO FOCUSED
|
|
13
|
+
*
|
|
14
|
+
* - 7 years retention (financial/tax compliance requirement)
|
|
15
|
+
* - Soft delete enabled with 60-day grace period
|
|
16
|
+
* - Not immutable by default (allows correction of errors)
|
|
17
|
+
* - Financial industry standard retention
|
|
18
|
+
*
|
|
19
|
+
* This policy is designed for crypto/blockchain platforms and provides:
|
|
20
|
+
* - IRS/SEC compliance (7-year retention)
|
|
21
|
+
* - Extended grace period for financial data recovery (60 days)
|
|
22
|
+
* - Audit trail for regulatory requirements
|
|
23
|
+
* - Transaction record preservation
|
|
24
|
+
*
|
|
25
|
+
* Suitable for: Crypto wallets, blockchain platforms, financial services
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_RETENTION_POLICY: StorageRetentionPolicy;
|
|
28
|
+
/**
|
|
29
|
+
* Default compliance configuration - CRYPTO/FINANCE PLATFORM
|
|
30
|
+
*
|
|
31
|
+
* Compliance is enabled by default with finance-focused defaults:
|
|
32
|
+
* - 7-year retention (IRS/SEC/FinCEN compliance)
|
|
33
|
+
* - Soft delete with 60-day grace period
|
|
34
|
+
* - Financial transaction audit trails
|
|
35
|
+
* - Not in strict mode (warnings instead of errors)
|
|
36
|
+
*
|
|
37
|
+
* Designed for crypto wallets, blockchain platforms, and financial services.
|
|
38
|
+
*
|
|
39
|
+
* Override this configuration for specific categories:
|
|
40
|
+
* - Transaction records: 7+ years retention, audit trail
|
|
41
|
+
* - Wallet backups: 7+ years retention, immutable
|
|
42
|
+
* - KYC/AML documents: 5-7 years retention per jurisdiction
|
|
43
|
+
* - Tax documents: 7+ years retention, immutable
|
|
44
|
+
* - Audit logs: 7+ years retention, immutable
|
|
45
|
+
* - Legal documents: 7+ years retention, immutable
|
|
46
|
+
* - Personal data: GDPR/CCPA-compliant deletion (user request)
|
|
47
|
+
*/
|
|
48
|
+
export declare const DEFAULT_COMPLIANCE_CONFIG: StorageComplianceConfig;
|
|
49
|
+
/**
|
|
50
|
+
* Preset retention policies for common use cases
|
|
51
|
+
*
|
|
52
|
+
* These can be used as templates or applied directly to file categories.
|
|
53
|
+
*/
|
|
54
|
+
export declare const PRESET_RETENTION_POLICIES: {
|
|
55
|
+
/**
|
|
56
|
+
* Legal document retention
|
|
57
|
+
* - 7 years retention (common legal requirement)
|
|
58
|
+
* - Immutable during retention period
|
|
59
|
+
* - Soft delete with grace period
|
|
60
|
+
* - Compliant with SOX, GDPR, and other frameworks
|
|
61
|
+
*/
|
|
62
|
+
LEGAL: StorageRetentionPolicy;
|
|
63
|
+
/**
|
|
64
|
+
* Financial document retention
|
|
65
|
+
* - 7 years retention (IRS, SEC requirements)
|
|
66
|
+
* - Immutable during retention period
|
|
67
|
+
* - Soft delete with extended grace period
|
|
68
|
+
*/
|
|
69
|
+
FINANCIAL: StorageRetentionPolicy;
|
|
70
|
+
/**
|
|
71
|
+
* Tax document retention
|
|
72
|
+
* - 7 years retention (IRS requirement)
|
|
73
|
+
* - Immutable during retention period
|
|
74
|
+
* - Soft delete enabled
|
|
75
|
+
*/
|
|
76
|
+
TAX: StorageRetentionPolicy;
|
|
77
|
+
/**
|
|
78
|
+
* Medical/health record retention
|
|
79
|
+
* - 10 years retention (HIPAA recommendation)
|
|
80
|
+
* - Immutable during retention period
|
|
81
|
+
* - Strict soft delete
|
|
82
|
+
*/
|
|
83
|
+
MEDICAL: StorageRetentionPolicy;
|
|
84
|
+
/**
|
|
85
|
+
* Audit log retention
|
|
86
|
+
* - 1 year retention (security best practice)
|
|
87
|
+
* - Immutable (cannot be modified or deleted)
|
|
88
|
+
* - No grace period (permanent)
|
|
89
|
+
*/
|
|
90
|
+
AUDIT: StorageRetentionPolicy;
|
|
91
|
+
/**
|
|
92
|
+
* Temporary file retention
|
|
93
|
+
* - No retention requirement
|
|
94
|
+
* - Can be deleted immediately
|
|
95
|
+
* - 7-day grace period for recovery
|
|
96
|
+
*/
|
|
97
|
+
TEMPORARY: StorageRetentionPolicy;
|
|
98
|
+
/**
|
|
99
|
+
* Personal data retention (GDPR/CCPA)
|
|
100
|
+
* - No mandatory retention
|
|
101
|
+
* - Can be deleted on user request
|
|
102
|
+
* - 30-day grace period for accidental deletion
|
|
103
|
+
*/
|
|
104
|
+
PERSONAL_DATA: StorageRetentionPolicy;
|
|
105
|
+
/**
|
|
106
|
+
* Crypto transaction records
|
|
107
|
+
* - 7 years retention (IRS/SEC/FinCEN requirement)
|
|
108
|
+
* - Immutable for audit trail integrity
|
|
109
|
+
* - Extended grace period for recovery
|
|
110
|
+
* - Blockchain transaction records, wallet operations, trades
|
|
111
|
+
*/
|
|
112
|
+
CRYPTO_TRANSACTION: StorageRetentionPolicy;
|
|
113
|
+
/**
|
|
114
|
+
* KYC/AML documents
|
|
115
|
+
* - 7 years retention (FinCEN/BSA requirement)
|
|
116
|
+
* - Immutable for regulatory audit
|
|
117
|
+
* - Extended grace period (90 days)
|
|
118
|
+
* - Identity verification, proof of address, source of funds
|
|
119
|
+
*/
|
|
120
|
+
KYC_AML: StorageRetentionPolicy;
|
|
121
|
+
/**
|
|
122
|
+
* Wallet backups & recovery seeds
|
|
123
|
+
* - 7 years retention (security best practice)
|
|
124
|
+
* - Immutable for security
|
|
125
|
+
* - Extended grace period (90 days)
|
|
126
|
+
* - Encrypted wallet backups, recovery phrases, private key backups
|
|
127
|
+
*/
|
|
128
|
+
WALLET_BACKUP: StorageRetentionPolicy;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Built-in Variant Presets
|
|
132
|
+
*
|
|
133
|
+
* Standard transformation presets optimized for common use cases.
|
|
134
|
+
* Each preset includes device-aware variants for optimal performance
|
|
135
|
+
* across mobile, tablet, desktop, and 4K displays.
|
|
136
|
+
*
|
|
137
|
+
* Available presets:
|
|
138
|
+
* - profile-picture: Square images for user profiles (1:1)
|
|
139
|
+
* - post-image: Feed/content images with flexible aspect ratios
|
|
140
|
+
* - hero-banner: Large banner images with 16:9 aspect ratio
|
|
141
|
+
* - video-streaming: Multi-resolution video transcoding
|
|
142
|
+
* - social-share: Optimized for social media platforms
|
|
143
|
+
* - product-image: E-commerce product photos
|
|
144
|
+
*/
|
|
145
|
+
export declare const BUILT_IN_PRESETS: StoragePresetConfig[];
|
|
146
|
+
/**
|
|
147
|
+
* Default Variants by File Category
|
|
148
|
+
*
|
|
149
|
+
* Automatic variant generation based on file category.
|
|
150
|
+
* When no preset is specified, these defaults are applied.
|
|
151
|
+
*
|
|
152
|
+
* Device-aware: Variants are automatically filtered based on target device
|
|
153
|
+
* to avoid generating unnecessary files and reduce storage costs.
|
|
154
|
+
*/
|
|
155
|
+
export declare const DEFAULT_VARIANTS_BY_CATEGORY: Partial<Record<FILE_CATEGORY, string[]>>;
|
|
156
|
+
/**
|
|
157
|
+
* Device-specific Variant Overrides
|
|
158
|
+
*
|
|
159
|
+
* These mappings override the category defaults when a specific device is targeted.
|
|
160
|
+
* Useful for mobile-first or desktop-first optimizations.
|
|
161
|
+
*/
|
|
162
|
+
export declare const DEVICE_SPECIFIC_VARIANT_OVERRIDES: Partial<Record<string, Partial<Record<FILE_CATEGORY, string[]>>>>;
|
|
163
|
+
/**
|
|
164
|
+
* Minimum Variant Requirements
|
|
165
|
+
*
|
|
166
|
+
* These categories must always generate at least these variants,
|
|
167
|
+
* regardless of device targeting, for fallback compatibility.
|
|
168
|
+
*/
|
|
169
|
+
export declare const MINIMUM_VARIANTS_BY_CATEGORY: Partial<Record<FILE_CATEGORY, string[]>>;
|
|
170
|
+
/**
|
|
171
|
+
* Standard Variant Definitions
|
|
172
|
+
*
|
|
173
|
+
* Maps variant names to their configuration.
|
|
174
|
+
* Used by PresetManager to resolve variant names like 'thumbnail', 'mobile', '720p'
|
|
175
|
+
* to actual variant configurations with dimensions, format, quality, etc.
|
|
176
|
+
*
|
|
177
|
+
* This is the source of truth for all standard variant names across the platform.
|
|
178
|
+
*/
|
|
179
|
+
export declare const STANDARD_VARIANT_DEFINITIONS: Record<STORAGE_VARIANT_NAME, Partial<StorageVariantConfig>>;
|
|
180
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/storage/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,aAAa,EACb,oBAAoB,EAErB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,wBAAwB,EAAE,sBAetC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,EAAE,uBAwDvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;IACpC;;;;;;OAMG;WAeE,sBAAsB;IAE3B;;;;;OAKG;eAeE,sBAAsB;IAE3B;;;;;OAKG;SAWE,sBAAsB;IAE3B;;;;;OAKG;aAWE,sBAAsB;IAE3B;;;;;OAKG;WASE,sBAAsB;IAE3B;;;;;OAKG;eASE,sBAAsB;IAE3B;;;;;OAKG;mBAWE,sBAAsB;IAE3B;;;;;;OAMG;wBAiBE,sBAAsB;IAE3B;;;;;;OAMG;aAkBE,sBAAsB;IAE3B;;;;;;OAMG;mBAcE,sBAAsB;CAC5B,CAAC;AAMF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,EAAE,mBAAmB,EA6YjD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAsCjF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,EAAE,OAAO,CACrD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAmDzD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAIjF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAC/C,oBAAoB,EACpB,OAAO,CAAC,oBAAoB,CAAC,CAiI9B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Configuration Module
|
|
3
|
+
*
|
|
4
|
+
* Exports all configuration constants and defaults for the storage system.
|
|
5
|
+
*
|
|
6
|
+
* @module src/storage
|
|
7
|
+
*/
|
|
8
|
+
export * from './constants';
|
|
9
|
+
export * from './defaults';
|
|
10
|
+
export * from './validation';
|
|
11
|
+
export * from './mime-types';
|
|
12
|
+
export * from './categories';
|
|
13
|
+
export * from './chunked-upload';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage MIME Type Mappings
|
|
3
|
+
*
|
|
4
|
+
* Centralized mapping between output formats, file extensions, and MIME types.
|
|
5
|
+
* Used for file generation, validation, and content-type handling.
|
|
6
|
+
*
|
|
7
|
+
* @module @plyaz/config/storage/mime-types
|
|
8
|
+
*/
|
|
9
|
+
import type { OUTPUT_FORMAT } from '@plyaz/types';
|
|
10
|
+
/**
|
|
11
|
+
* Map of output formats to file extensions
|
|
12
|
+
*/
|
|
13
|
+
export declare const STORAGE_OUTPUT_FORMAT_TO_EXTENSION: Record<OUTPUT_FORMAT, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Map of output formats to MIME types
|
|
16
|
+
*/
|
|
17
|
+
export declare const STORAGE_OUTPUT_FORMAT_TO_MIME_TYPE: Record<OUTPUT_FORMAT, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Get file extension for output format
|
|
20
|
+
*/
|
|
21
|
+
export declare function getStorageExtensionForFormat(format: OUTPUT_FORMAT): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get MIME type for output format
|
|
24
|
+
*/
|
|
25
|
+
export declare function getStorageMimeTypeForFormat(format: OUTPUT_FORMAT): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get both extension and MIME type for output format
|
|
28
|
+
*/
|
|
29
|
+
export declare function getStorageFormatInfo(format: OUTPUT_FORMAT): {
|
|
30
|
+
extension: string;
|
|
31
|
+
mimeType: string;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=mime-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mime-types.d.ts","sourceRoot":"","sources":["../../src/storage/mime-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAS5E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAS5E,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE1E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAEzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAKnG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage Validation Configuration
|
|
3
|
+
*
|
|
4
|
+
* Defines file size limits and MIME type restrictions per bucket purpose.
|
|
5
|
+
* Centralized configuration for storage validation across backend and frontend.
|
|
6
|
+
*
|
|
7
|
+
* @module @plyaz/config/storage/validation
|
|
8
|
+
*/
|
|
9
|
+
import type { StorageValidationConfig } from '@plyaz/types';
|
|
10
|
+
import { BUCKET_PURPOSE } from '@plyaz/types';
|
|
11
|
+
/**
|
|
12
|
+
* Default storage validation configuration
|
|
13
|
+
* Used when adapter config doesn't specify validation rules
|
|
14
|
+
*/
|
|
15
|
+
export declare const STORAGE_DEFAULT_VALIDATION_CONFIG: StorageValidationConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Get validation rules for a specific bucket purpose
|
|
18
|
+
* Falls back to default rules if purpose-specific rules not defined
|
|
19
|
+
*
|
|
20
|
+
* @param purpose - Bucket purpose
|
|
21
|
+
* @param config - Optional custom validation config (overrides defaults)
|
|
22
|
+
* @returns Validation rules for the purpose
|
|
23
|
+
*/
|
|
24
|
+
export declare function getStorageValidationRulesForPurpose(purpose: BUCKET_PURPOSE, config?: StorageValidationConfig): {
|
|
25
|
+
maxFileSize?: number;
|
|
26
|
+
allowedMimeTypes?: string[];
|
|
27
|
+
allowExecutables?: boolean;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/storage/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAgB9C;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,uBAoFtC,CAAC;AAEX;;;;;;;GAOG;AAEH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,cAAc,EACvB,MAAM,CAAC,EAAE,uBAAuB,GAC/B;IACD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAeA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"author": "Redeemer Pace",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Provides shared configs and constants for @playz ecosystem.",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"packageManager": "pnpm@10.11.0",
|
|
140
140
|
"dependencies": {
|
|
141
141
|
"@plyaz/devtools": "^1.9.4",
|
|
142
|
-
"@plyaz/types": "^1.
|
|
142
|
+
"@plyaz/types": "^1.16.0",
|
|
143
143
|
"globals": "^16.4.0",
|
|
144
144
|
"viem": "^2.31.7"
|
|
145
145
|
},
|