@varity-labs/types 2.0.0-alpha.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/LICENSE +31 -0
- package/README.md +328 -0
- package/dist/api.d.ts +219 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +6 -0
- package/dist/auth.d.ts +457 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +222 -0
- package/dist/common.d.ts +130 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +47 -0
- package/dist/gcs-compatible.d.ts +500 -0
- package/dist/gcs-compatible.d.ts.map +1 -0
- package/dist/gcs-compatible.js +51 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/migration.d.ts +532 -0
- package/dist/migration.d.ts.map +1 -0
- package/dist/migration.js +90 -0
- package/dist/s3-compatible.d.ts +473 -0
- package/dist/s3-compatible.d.ts.map +1 -0
- package/dist/s3-compatible.js +63 -0
- package/dist/storage.d.ts +600 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +75 -0
- package/dist/thirdweb.d.ts +1182 -0
- package/dist/thirdweb.d.ts.map +1 -0
- package/dist/thirdweb.js +91 -0
- package/package.json +43 -0
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity Storage Types - Core Storage Infrastructure
|
|
3
|
+
*
|
|
4
|
+
* This module defines the complete type system for Varity's multi-backend storage architecture,
|
|
5
|
+
* supporting Filecoin/IPFS, S3-compatible, GCS-compatible, and multi-tier storage strategies.
|
|
6
|
+
*
|
|
7
|
+
* Part of Varity's 3-layer encrypted storage architecture:
|
|
8
|
+
* - Layer 1: Varity Internal (company docs, internal knowledge)
|
|
9
|
+
* - Layer 2: Industry RAG (shared industry knowledge)
|
|
10
|
+
* - Layer 3: Customer Data (private business data)
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Storage layer for Varity's 3-layer architecture
|
|
14
|
+
*/
|
|
15
|
+
export declare enum StorageLayer {
|
|
16
|
+
/** Varity company documents and internal knowledge */
|
|
17
|
+
VARITY_INTERNAL = "varity-internal",
|
|
18
|
+
/** Industry-specific RAG knowledge (shared across customers) */
|
|
19
|
+
INDUSTRY_RAG = "industry-rag",
|
|
20
|
+
/** Customer-specific private data */
|
|
21
|
+
CUSTOMER_DATA = "customer-data"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Storage backend types supported by Varity
|
|
25
|
+
*/
|
|
26
|
+
export declare enum StorageBackend {
|
|
27
|
+
/** Filecoin/IPFS via Pinata API (current default) */
|
|
28
|
+
FILECOIN_IPFS = "filecoin-ipfs",
|
|
29
|
+
/** Celestia Data Availability Layer */
|
|
30
|
+
CELESTIA = "celestia",
|
|
31
|
+
/** S3-compatible storage (MinIO, AWS S3, etc.) */
|
|
32
|
+
S3_COMPATIBLE = "s3-compatible",
|
|
33
|
+
/** Google Cloud Storage compatible */
|
|
34
|
+
GCS_COMPATIBLE = "gcs-compatible",
|
|
35
|
+
/** Multi-tier storage with automatic tiering */
|
|
36
|
+
MULTI_TIER = "multi-tier"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Storage tier for multi-tier architecture
|
|
40
|
+
* Balances access speed vs cost optimization
|
|
41
|
+
*/
|
|
42
|
+
export declare enum StorageTier {
|
|
43
|
+
/** Fast access, higher cost (IPFS pinned, in-memory cache) */
|
|
44
|
+
HOT = "hot",
|
|
45
|
+
/** Moderate access, moderate cost (standard storage) */
|
|
46
|
+
WARM = "warm",
|
|
47
|
+
/** Infrequent access, lower cost (archive storage) */
|
|
48
|
+
COLD = "cold",
|
|
49
|
+
/** Long-term archive, lowest cost (deep archive) */
|
|
50
|
+
GLACIER = "glacier"
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Base storage adapter interface - ALL storage backends must implement this
|
|
54
|
+
*
|
|
55
|
+
* This interface ensures consistent behavior across all storage backends,
|
|
56
|
+
* whether Filecoin, S3, GCS, or multi-tier strategies.
|
|
57
|
+
*/
|
|
58
|
+
export interface IStorageAdapter {
|
|
59
|
+
/**
|
|
60
|
+
* Upload data to storage
|
|
61
|
+
* @param data - Data to upload (Buffer, string, Blob, or any binary data)
|
|
62
|
+
* @param options - Upload configuration options
|
|
63
|
+
* @returns Storage result with identifier and metadata
|
|
64
|
+
*/
|
|
65
|
+
upload(data: any, options: UploadOptions): Promise<StorageResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Download data from storage
|
|
68
|
+
* @param identifier - Storage identifier (CID, S3 key, etc.)
|
|
69
|
+
* @returns Downloaded data (Buffer, Blob, or binary data)
|
|
70
|
+
*/
|
|
71
|
+
download(identifier: string): Promise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* Delete data from storage
|
|
74
|
+
* @param identifier - Storage identifier to delete
|
|
75
|
+
*/
|
|
76
|
+
delete(identifier: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* List stored objects matching criteria
|
|
79
|
+
* @param options - List filtering and pagination options
|
|
80
|
+
* @returns Array of storage items
|
|
81
|
+
*/
|
|
82
|
+
list(options?: ListOptions): Promise<StorageItem[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Check if object exists in storage
|
|
85
|
+
* @param identifier - Storage identifier to check
|
|
86
|
+
* @returns True if exists, false otherwise
|
|
87
|
+
*/
|
|
88
|
+
exists(identifier: string): Promise<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Get object metadata without downloading content
|
|
91
|
+
* @param identifier - Storage identifier
|
|
92
|
+
* @returns Object metadata
|
|
93
|
+
*/
|
|
94
|
+
getMetadata(identifier: string): Promise<StorageMetadata>;
|
|
95
|
+
/**
|
|
96
|
+
* Get the storage backend type
|
|
97
|
+
*/
|
|
98
|
+
getBackendType(): StorageBackend;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Upload options for storage operations
|
|
102
|
+
*/
|
|
103
|
+
export interface UploadOptions {
|
|
104
|
+
/** Storage layer (Varity Internal, Industry RAG, Customer Data) */
|
|
105
|
+
layer: StorageLayer;
|
|
106
|
+
/** Storage tier (hot, warm, cold, glacier) */
|
|
107
|
+
tier?: StorageTier;
|
|
108
|
+
/** Custom metadata to attach to object */
|
|
109
|
+
metadata?: Record<string, any>;
|
|
110
|
+
/** Pin to IPFS (for Filecoin backend) */
|
|
111
|
+
pin?: boolean;
|
|
112
|
+
/** Enable Lit Protocol encryption */
|
|
113
|
+
encrypt?: boolean;
|
|
114
|
+
/** Storage namespace (layer-specific prefix) */
|
|
115
|
+
namespace?: string;
|
|
116
|
+
/** Content type (MIME type) */
|
|
117
|
+
contentType?: string;
|
|
118
|
+
/** Cache control header */
|
|
119
|
+
cacheControl?: string;
|
|
120
|
+
/** ACL/permissions (backend-specific) */
|
|
121
|
+
acl?: string;
|
|
122
|
+
/** Tags for organization */
|
|
123
|
+
tags?: Record<string, string>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Storage result returned after upload operation
|
|
127
|
+
*/
|
|
128
|
+
export interface StorageResult {
|
|
129
|
+
/** Primary identifier (CID for Filecoin, key for S3, etc.) */
|
|
130
|
+
identifier: string;
|
|
131
|
+
/** Gateway URL for accessing the content */
|
|
132
|
+
gatewayUrl: string;
|
|
133
|
+
/** Size in bytes */
|
|
134
|
+
size: number;
|
|
135
|
+
/** Content hash (SHA256 or backend-specific) */
|
|
136
|
+
hash: string;
|
|
137
|
+
/** Upload timestamp (Unix milliseconds) */
|
|
138
|
+
timestamp: number;
|
|
139
|
+
/** Storage backend used */
|
|
140
|
+
backend: StorageBackend;
|
|
141
|
+
/** Storage tier assigned */
|
|
142
|
+
tier?: StorageTier;
|
|
143
|
+
/** Storage layer used */
|
|
144
|
+
layer?: StorageLayer;
|
|
145
|
+
/** Encryption metadata (if encrypted) */
|
|
146
|
+
encryptionMetadata?: {
|
|
147
|
+
encrypted: boolean;
|
|
148
|
+
walletAddress?: string;
|
|
149
|
+
layer: StorageLayer;
|
|
150
|
+
algorithm?: string;
|
|
151
|
+
};
|
|
152
|
+
/** Additional backend-specific metadata */
|
|
153
|
+
backendMetadata?: Record<string, any>;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Storage item returned from list operations
|
|
157
|
+
*/
|
|
158
|
+
export interface StorageItem {
|
|
159
|
+
/** Storage identifier */
|
|
160
|
+
identifier: string;
|
|
161
|
+
/** Object key/name */
|
|
162
|
+
key: string;
|
|
163
|
+
/** Size in bytes */
|
|
164
|
+
size: number;
|
|
165
|
+
/** Last modified timestamp */
|
|
166
|
+
lastModified: Date;
|
|
167
|
+
/** ETag (if supported by backend) */
|
|
168
|
+
etag?: string;
|
|
169
|
+
/** Custom metadata */
|
|
170
|
+
metadata?: Record<string, any>;
|
|
171
|
+
/** Storage tier */
|
|
172
|
+
tier?: StorageTier;
|
|
173
|
+
/** Storage class (backend-specific) */
|
|
174
|
+
storageClass?: string;
|
|
175
|
+
/** Whether object is encrypted */
|
|
176
|
+
encrypted?: boolean;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* List options for querying storage
|
|
180
|
+
*/
|
|
181
|
+
export interface ListOptions {
|
|
182
|
+
/** Prefix filter (e.g., 'varity-internal/', 'customer-123/') */
|
|
183
|
+
prefix?: string;
|
|
184
|
+
/** Delimiter for hierarchical listing */
|
|
185
|
+
delimiter?: string;
|
|
186
|
+
/** Maximum number of results to return */
|
|
187
|
+
maxResults?: number;
|
|
188
|
+
/** Continuation token for pagination */
|
|
189
|
+
continuationToken?: string;
|
|
190
|
+
/** Filter by storage tier */
|
|
191
|
+
tier?: StorageTier;
|
|
192
|
+
/** Start after this key (for pagination) */
|
|
193
|
+
startAfter?: string;
|
|
194
|
+
/** Include metadata in results */
|
|
195
|
+
includeMetadata?: boolean;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Storage metadata for objects
|
|
199
|
+
*/
|
|
200
|
+
export interface StorageMetadata {
|
|
201
|
+
/** Storage identifier */
|
|
202
|
+
identifier: string;
|
|
203
|
+
/** Size in bytes */
|
|
204
|
+
size: number;
|
|
205
|
+
/** Content type */
|
|
206
|
+
contentType?: string;
|
|
207
|
+
/** Last modified timestamp */
|
|
208
|
+
lastModified: Date;
|
|
209
|
+
/** ETag */
|
|
210
|
+
etag?: string;
|
|
211
|
+
/** Custom metadata */
|
|
212
|
+
customMetadata?: Record<string, any>;
|
|
213
|
+
/** Storage tier */
|
|
214
|
+
tier?: StorageTier;
|
|
215
|
+
/** Storage layer */
|
|
216
|
+
layer?: StorageLayer;
|
|
217
|
+
/** Access statistics */
|
|
218
|
+
accessCount?: number;
|
|
219
|
+
/** Last accessed timestamp */
|
|
220
|
+
lastAccessed?: Date;
|
|
221
|
+
/** Whether object is encrypted */
|
|
222
|
+
encrypted?: boolean;
|
|
223
|
+
/** Cache control settings */
|
|
224
|
+
cacheControl?: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Multi-tier storage configuration
|
|
228
|
+
* Enables automatic cost optimization through intelligent tiering
|
|
229
|
+
*/
|
|
230
|
+
export interface MultiTierStorageConfig {
|
|
231
|
+
/** Hot tier configuration (fast access) */
|
|
232
|
+
hotTier: TierConfig;
|
|
233
|
+
/** Warm tier configuration (moderate access) */
|
|
234
|
+
warmTier?: TierConfig;
|
|
235
|
+
/** Cold tier configuration (infrequent access) */
|
|
236
|
+
coldTier: TierConfig;
|
|
237
|
+
/** Auto-tiering configuration */
|
|
238
|
+
autoTiering: AutoTieringConfig;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Configuration for a specific storage tier
|
|
242
|
+
*/
|
|
243
|
+
export interface TierConfig {
|
|
244
|
+
/** Storage backend to use */
|
|
245
|
+
backend: StorageBackend;
|
|
246
|
+
/** Replication factor */
|
|
247
|
+
replication: number;
|
|
248
|
+
/** Cost per GB per month (USD) */
|
|
249
|
+
costPerGB: number;
|
|
250
|
+
/** Expected access latency in milliseconds */
|
|
251
|
+
accessLatency: number;
|
|
252
|
+
/** Minimum object size for this tier */
|
|
253
|
+
minObjectSize?: number;
|
|
254
|
+
/** Maximum object size for this tier */
|
|
255
|
+
maxObjectSize?: number;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Auto-tiering configuration
|
|
259
|
+
*/
|
|
260
|
+
export interface AutoTieringConfig {
|
|
261
|
+
/** Enable automatic tiering */
|
|
262
|
+
enabled: boolean;
|
|
263
|
+
/** Tiering policy to use */
|
|
264
|
+
policy: TieringPolicy;
|
|
265
|
+
/** Check interval in hours */
|
|
266
|
+
checkInterval: number;
|
|
267
|
+
/** Tiering rules */
|
|
268
|
+
rules?: TieringRule[];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Tiering policies
|
|
272
|
+
*/
|
|
273
|
+
export declare enum TieringPolicy {
|
|
274
|
+
/** Based on object age */
|
|
275
|
+
TIME_BASED = "time-based",
|
|
276
|
+
/** Based on access frequency */
|
|
277
|
+
ACCESS_BASED = "access-based",
|
|
278
|
+
/** Based on object size */
|
|
279
|
+
SIZE_BASED = "size-based",
|
|
280
|
+
/** Cost optimization strategy */
|
|
281
|
+
COST_OPTIMIZED = "cost-optimized",
|
|
282
|
+
/** Custom policy */
|
|
283
|
+
CUSTOM = "custom"
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Tiering rule for automatic tier transitions
|
|
287
|
+
*/
|
|
288
|
+
export interface TieringRule {
|
|
289
|
+
/** Rule name */
|
|
290
|
+
name: string;
|
|
291
|
+
/** Rule description */
|
|
292
|
+
description?: string;
|
|
293
|
+
/** Condition to trigger tiering */
|
|
294
|
+
condition: TieringCondition;
|
|
295
|
+
/** Action to take when condition is met */
|
|
296
|
+
action: TieringAction;
|
|
297
|
+
/** Rule priority (higher = evaluated first) */
|
|
298
|
+
priority?: number;
|
|
299
|
+
/** Whether rule is enabled */
|
|
300
|
+
enabled?: boolean;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Condition for tiering rule
|
|
304
|
+
*/
|
|
305
|
+
export interface TieringCondition {
|
|
306
|
+
/** Condition type */
|
|
307
|
+
type: 'age' | 'access_count' | 'size' | 'cost' | 'last_accessed';
|
|
308
|
+
/** Comparison operator */
|
|
309
|
+
operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte' | 'ne';
|
|
310
|
+
/** Comparison value */
|
|
311
|
+
value: number;
|
|
312
|
+
/** Unit for the value */
|
|
313
|
+
unit?: 'days' | 'mb' | 'gb' | 'usd' | 'accesses';
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Action to take when tiering condition is met
|
|
317
|
+
*/
|
|
318
|
+
export interface TieringAction {
|
|
319
|
+
/** Target tier to move object to */
|
|
320
|
+
moveTo: StorageTier;
|
|
321
|
+
/** Send notification */
|
|
322
|
+
notify?: boolean;
|
|
323
|
+
/** Notification recipients */
|
|
324
|
+
notifyTo?: string[];
|
|
325
|
+
/** Delete object instead of moving */
|
|
326
|
+
delete?: boolean;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Access pattern analytics for cost optimization
|
|
330
|
+
*/
|
|
331
|
+
export interface AccessPattern {
|
|
332
|
+
/** Object identifier */
|
|
333
|
+
identifier: string;
|
|
334
|
+
/** Total access count */
|
|
335
|
+
accessCount: number;
|
|
336
|
+
/** Last accessed timestamp */
|
|
337
|
+
lastAccessed: Date;
|
|
338
|
+
/** Average interval between accesses (days) */
|
|
339
|
+
averageAccessInterval: number;
|
|
340
|
+
/** Total bandwidth consumed (bytes) */
|
|
341
|
+
totalBandwidth: number;
|
|
342
|
+
/** Current storage tier */
|
|
343
|
+
currentTier: StorageTier;
|
|
344
|
+
/** Recommended tier based on access pattern */
|
|
345
|
+
recommendedTier: StorageTier;
|
|
346
|
+
/** Estimated monthly cost savings if moved to recommended tier */
|
|
347
|
+
costSavingsEstimate: number;
|
|
348
|
+
/** Confidence score for recommendation (0-1) */
|
|
349
|
+
recommendationConfidence: number;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Storage usage statistics
|
|
353
|
+
*/
|
|
354
|
+
export interface StorageStats {
|
|
355
|
+
/** Total objects stored */
|
|
356
|
+
totalObjects: number;
|
|
357
|
+
/** Total size in bytes */
|
|
358
|
+
totalSize: number;
|
|
359
|
+
/** Breakdown by tier */
|
|
360
|
+
byTier: Record<StorageTier, TierStats>;
|
|
361
|
+
/** Breakdown by layer */
|
|
362
|
+
byLayer: Record<StorageLayer, LayerStats>;
|
|
363
|
+
/** Total monthly cost estimate */
|
|
364
|
+
monthlyCostEstimate: number;
|
|
365
|
+
/** Last updated timestamp */
|
|
366
|
+
lastUpdated: Date;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Statistics for a specific tier
|
|
370
|
+
*/
|
|
371
|
+
export interface TierStats {
|
|
372
|
+
/** Number of objects */
|
|
373
|
+
objectCount: number;
|
|
374
|
+
/** Total size in bytes */
|
|
375
|
+
totalSize: number;
|
|
376
|
+
/** Monthly cost */
|
|
377
|
+
monthlyCost: number;
|
|
378
|
+
/** Average object size */
|
|
379
|
+
avgObjectSize: number;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Statistics for a specific layer
|
|
383
|
+
*/
|
|
384
|
+
export interface LayerStats {
|
|
385
|
+
/** Number of objects */
|
|
386
|
+
objectCount: number;
|
|
387
|
+
/** Total size in bytes */
|
|
388
|
+
totalSize: number;
|
|
389
|
+
/** Percentage of total storage */
|
|
390
|
+
percentage: number;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Storage operation result with metrics
|
|
394
|
+
*/
|
|
395
|
+
export interface StorageOperationResult {
|
|
396
|
+
/** Whether operation succeeded */
|
|
397
|
+
success: boolean;
|
|
398
|
+
/** Operation type */
|
|
399
|
+
operation: 'upload' | 'download' | 'delete' | 'list';
|
|
400
|
+
/** Duration in milliseconds */
|
|
401
|
+
durationMs: number;
|
|
402
|
+
/** Bytes transferred */
|
|
403
|
+
bytesTransferred: number;
|
|
404
|
+
/** Error message (if failed) */
|
|
405
|
+
error?: string;
|
|
406
|
+
/** Additional details */
|
|
407
|
+
details?: Record<string, any>;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Encryption options for storage operations
|
|
411
|
+
*/
|
|
412
|
+
export interface EncryptionOptions {
|
|
413
|
+
/** Enable encryption */
|
|
414
|
+
enabled: boolean;
|
|
415
|
+
/** Encryption algorithm */
|
|
416
|
+
algorithm?: 'aes-256-gcm' | 'aes-256-cbc';
|
|
417
|
+
/** Key derivation function */
|
|
418
|
+
keyDerivation?: 'pbkdf2' | 'scrypt';
|
|
419
|
+
/** Use Lit Protocol for access control */
|
|
420
|
+
litProtocol?: boolean;
|
|
421
|
+
/** Custom encryption key (base64) */
|
|
422
|
+
customKey?: string;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Encryption metadata stored with encrypted objects
|
|
426
|
+
*/
|
|
427
|
+
export interface EncryptionMetadata {
|
|
428
|
+
/** Whether object is encrypted */
|
|
429
|
+
encrypted: boolean;
|
|
430
|
+
/** Encryption algorithm used */
|
|
431
|
+
algorithm: string;
|
|
432
|
+
/** Wallet address used for encryption */
|
|
433
|
+
walletAddress: string;
|
|
434
|
+
/** Storage layer */
|
|
435
|
+
layer: StorageLayer;
|
|
436
|
+
/** Lit Protocol enabled */
|
|
437
|
+
litProtocolEnabled: boolean;
|
|
438
|
+
/** Key identifier (for Lit Protocol or KMS) */
|
|
439
|
+
keyId?: string;
|
|
440
|
+
/** Initialization vector (for some algorithms) */
|
|
441
|
+
iv?: string;
|
|
442
|
+
/** Authentication tag (for GCM mode) */
|
|
443
|
+
authTag?: string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Comprehensive storage metrics and analytics
|
|
447
|
+
*/
|
|
448
|
+
export interface StorageMetrics {
|
|
449
|
+
/** Total storage size (bytes) */
|
|
450
|
+
totalSize: number;
|
|
451
|
+
/** Total object count */
|
|
452
|
+
objectCount: number;
|
|
453
|
+
/** Metrics by storage layer */
|
|
454
|
+
byLayer: Record<StorageLayer, LayerMetrics>;
|
|
455
|
+
/** Metrics by storage tier */
|
|
456
|
+
byTier: Record<StorageTier, TierMetrics>;
|
|
457
|
+
/** Metrics by backend */
|
|
458
|
+
byBackend: Record<StorageBackend, BackendMetrics>;
|
|
459
|
+
/** Cost breakdown */
|
|
460
|
+
costs: StorageCosts;
|
|
461
|
+
/** Last updated timestamp */
|
|
462
|
+
lastUpdated: Date;
|
|
463
|
+
/** Bandwidth usage (bytes) */
|
|
464
|
+
bandwidthUsage?: BandwidthMetrics;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Metrics for a specific storage layer
|
|
468
|
+
*/
|
|
469
|
+
export interface LayerMetrics {
|
|
470
|
+
/** Number of objects */
|
|
471
|
+
objectCount: number;
|
|
472
|
+
/** Total size (bytes) */
|
|
473
|
+
totalSize: number;
|
|
474
|
+
/** Last updated timestamp */
|
|
475
|
+
lastUpdated: Date;
|
|
476
|
+
/** Encrypted object count */
|
|
477
|
+
encryptedObjects?: number;
|
|
478
|
+
/** Average object size */
|
|
479
|
+
avgObjectSize?: number;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Metrics for a specific storage tier
|
|
483
|
+
*/
|
|
484
|
+
export interface TierMetrics {
|
|
485
|
+
/** Number of objects */
|
|
486
|
+
objectCount: number;
|
|
487
|
+
/** Total size (bytes) */
|
|
488
|
+
totalSize: number;
|
|
489
|
+
/** Average access time (milliseconds) */
|
|
490
|
+
averageAccessTime: number;
|
|
491
|
+
/** Cost per GB per month */
|
|
492
|
+
costPerGB: number;
|
|
493
|
+
/** Monthly cost estimate */
|
|
494
|
+
monthlyCost: number;
|
|
495
|
+
/** Average object size */
|
|
496
|
+
avgObjectSize: number;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Metrics for a specific storage backend
|
|
500
|
+
*/
|
|
501
|
+
export interface BackendMetrics {
|
|
502
|
+
/** Number of objects */
|
|
503
|
+
objectCount: number;
|
|
504
|
+
/** Total size (bytes) */
|
|
505
|
+
totalSize: number;
|
|
506
|
+
/** Backend availability (percentage 0-100) */
|
|
507
|
+
availability: number;
|
|
508
|
+
/** Latency metrics */
|
|
509
|
+
latency: LatencyMetrics;
|
|
510
|
+
/** Request count */
|
|
511
|
+
requestCount?: number;
|
|
512
|
+
/** Error count */
|
|
513
|
+
errorCount?: number;
|
|
514
|
+
/** Last health check */
|
|
515
|
+
lastHealthCheck?: Date;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Latency metrics for a backend
|
|
519
|
+
*/
|
|
520
|
+
export interface LatencyMetrics {
|
|
521
|
+
/** 50th percentile latency (ms) */
|
|
522
|
+
p50: number;
|
|
523
|
+
/** 95th percentile latency (ms) */
|
|
524
|
+
p95: number;
|
|
525
|
+
/** 99th percentile latency (ms) */
|
|
526
|
+
p99: number;
|
|
527
|
+
/** Average latency (ms) */
|
|
528
|
+
avg: number;
|
|
529
|
+
/** Minimum latency (ms) */
|
|
530
|
+
min?: number;
|
|
531
|
+
/** Maximum latency (ms) */
|
|
532
|
+
max?: number;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Storage cost breakdown
|
|
536
|
+
*/
|
|
537
|
+
export interface StorageCosts {
|
|
538
|
+
/** Total monthly cost (USD) */
|
|
539
|
+
monthlyTotal: number;
|
|
540
|
+
/** Cost breakdown by category */
|
|
541
|
+
breakdown: {
|
|
542
|
+
/** Storage costs */
|
|
543
|
+
storage: number;
|
|
544
|
+
/** Bandwidth/egress costs */
|
|
545
|
+
bandwidth: number;
|
|
546
|
+
/** API operation costs */
|
|
547
|
+
operations: number;
|
|
548
|
+
/** Replication costs */
|
|
549
|
+
replication?: number;
|
|
550
|
+
};
|
|
551
|
+
/** Comparison to AWS S3 */
|
|
552
|
+
comparisonToAWS: CostComparison;
|
|
553
|
+
/** Comparison to Google Cloud Storage */
|
|
554
|
+
comparisonToGCP: CostComparison;
|
|
555
|
+
/** Monthly savings amount */
|
|
556
|
+
monthlySavings: number;
|
|
557
|
+
/** Savings percentage */
|
|
558
|
+
savingsPercent: number;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Cost comparison between platforms
|
|
562
|
+
*/
|
|
563
|
+
export interface CostComparison {
|
|
564
|
+
/** Source platform monthly cost */
|
|
565
|
+
sourceMonthlyCost: number;
|
|
566
|
+
/** Target platform monthly cost */
|
|
567
|
+
targetMonthlyCost: number;
|
|
568
|
+
/** Savings amount */
|
|
569
|
+
savingsAmount: number;
|
|
570
|
+
/** Savings percentage */
|
|
571
|
+
savingsPercent: number;
|
|
572
|
+
/** Storage cost breakdown */
|
|
573
|
+
storageCost: number;
|
|
574
|
+
/** Bandwidth cost breakdown */
|
|
575
|
+
bandwidthCost: number;
|
|
576
|
+
/** Operations cost breakdown */
|
|
577
|
+
operationsCost: number;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Bandwidth usage metrics
|
|
581
|
+
*/
|
|
582
|
+
export interface BandwidthMetrics {
|
|
583
|
+
/** Total upload bytes */
|
|
584
|
+
uploadBytes: number;
|
|
585
|
+
/** Total download bytes */
|
|
586
|
+
downloadBytes: number;
|
|
587
|
+
/** Upload requests count */
|
|
588
|
+
uploadRequests: number;
|
|
589
|
+
/** Download requests count */
|
|
590
|
+
downloadRequests: number;
|
|
591
|
+
/** Period start */
|
|
592
|
+
periodStart: Date;
|
|
593
|
+
/** Period end */
|
|
594
|
+
periodEnd: Date;
|
|
595
|
+
/** Average upload speed (bytes/sec) */
|
|
596
|
+
avgUploadSpeed?: number;
|
|
597
|
+
/** Average download speed (bytes/sec) */
|
|
598
|
+
avgDownloadSpeed?: number;
|
|
599
|
+
}
|
|
600
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAA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,EAAE,MAAM,CAAA;IAErB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAA;IAEnB,2BAA2B;IAC3B,aAAa,EAAE,MAAM,CAAA;IAErB,4BAA4B;IAC5B,cAAc,EAAE,MAAM,CAAA;IAEtB,8BAA8B;IAC9B,gBAAgB,EAAE,MAAM,CAAA;IAExB,mBAAmB;IACnB,WAAW,EAAE,IAAI,CAAA;IAEjB,iBAAiB;IACjB,SAAS,EAAE,IAAI,CAAA;IAEf,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B"}
|
package/dist/storage.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity Storage Types - Core Storage Infrastructure
|
|
3
|
+
*
|
|
4
|
+
* This module defines the complete type system for Varity's multi-backend storage architecture,
|
|
5
|
+
* supporting Filecoin/IPFS, S3-compatible, GCS-compatible, and multi-tier storage strategies.
|
|
6
|
+
*
|
|
7
|
+
* Part of Varity's 3-layer encrypted storage architecture:
|
|
8
|
+
* - Layer 1: Varity Internal (company docs, internal knowledge)
|
|
9
|
+
* - Layer 2: Industry RAG (shared industry knowledge)
|
|
10
|
+
* - Layer 3: Customer Data (private business data)
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Storage layer for Varity's 3-layer architecture
|
|
14
|
+
*/
|
|
15
|
+
export var StorageLayer;
|
|
16
|
+
(function (StorageLayer) {
|
|
17
|
+
/** Varity company documents and internal knowledge */
|
|
18
|
+
StorageLayer["VARITY_INTERNAL"] = "varity-internal";
|
|
19
|
+
/** Industry-specific RAG knowledge (shared across customers) */
|
|
20
|
+
StorageLayer["INDUSTRY_RAG"] = "industry-rag";
|
|
21
|
+
/** Customer-specific private data */
|
|
22
|
+
StorageLayer["CUSTOMER_DATA"] = "customer-data";
|
|
23
|
+
})(StorageLayer || (StorageLayer = {}));
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Storage Backend Types
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Storage backend types supported by Varity
|
|
29
|
+
*/
|
|
30
|
+
export var StorageBackend;
|
|
31
|
+
(function (StorageBackend) {
|
|
32
|
+
/** Filecoin/IPFS via Pinata API (current default) */
|
|
33
|
+
StorageBackend["FILECOIN_IPFS"] = "filecoin-ipfs";
|
|
34
|
+
/** Celestia Data Availability Layer */
|
|
35
|
+
StorageBackend["CELESTIA"] = "celestia";
|
|
36
|
+
/** S3-compatible storage (MinIO, AWS S3, etc.) */
|
|
37
|
+
StorageBackend["S3_COMPATIBLE"] = "s3-compatible";
|
|
38
|
+
/** Google Cloud Storage compatible */
|
|
39
|
+
StorageBackend["GCS_COMPATIBLE"] = "gcs-compatible";
|
|
40
|
+
/** Multi-tier storage with automatic tiering */
|
|
41
|
+
StorageBackend["MULTI_TIER"] = "multi-tier";
|
|
42
|
+
})(StorageBackend || (StorageBackend = {}));
|
|
43
|
+
/**
|
|
44
|
+
* Storage tier for multi-tier architecture
|
|
45
|
+
* Balances access speed vs cost optimization
|
|
46
|
+
*/
|
|
47
|
+
export var StorageTier;
|
|
48
|
+
(function (StorageTier) {
|
|
49
|
+
/** Fast access, higher cost (IPFS pinned, in-memory cache) */
|
|
50
|
+
StorageTier["HOT"] = "hot";
|
|
51
|
+
/** Moderate access, moderate cost (standard storage) */
|
|
52
|
+
StorageTier["WARM"] = "warm";
|
|
53
|
+
/** Infrequent access, lower cost (archive storage) */
|
|
54
|
+
StorageTier["COLD"] = "cold";
|
|
55
|
+
/** Long-term archive, lowest cost (deep archive) */
|
|
56
|
+
StorageTier["GLACIER"] = "glacier";
|
|
57
|
+
})(StorageTier || (StorageTier = {}));
|
|
58
|
+
/**
|
|
59
|
+
* Tiering policies
|
|
60
|
+
*/
|
|
61
|
+
export var TieringPolicy;
|
|
62
|
+
(function (TieringPolicy) {
|
|
63
|
+
/** Based on object age */
|
|
64
|
+
TieringPolicy["TIME_BASED"] = "time-based";
|
|
65
|
+
/** Based on access frequency */
|
|
66
|
+
TieringPolicy["ACCESS_BASED"] = "access-based";
|
|
67
|
+
/** Based on object size */
|
|
68
|
+
TieringPolicy["SIZE_BASED"] = "size-based";
|
|
69
|
+
/** Cost optimization strategy */
|
|
70
|
+
TieringPolicy["COST_OPTIMIZED"] = "cost-optimized";
|
|
71
|
+
/** Custom policy */
|
|
72
|
+
TieringPolicy["CUSTOM"] = "custom";
|
|
73
|
+
})(TieringPolicy || (TieringPolicy = {}));
|
|
74
|
+
// NOTE: Types are declared above and exported via interface/enum declarations
|
|
75
|
+
// No need for duplicate export statements at the end
|