hazo_files 1.4.2 → 1.4.4
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/README.md +103 -9
- package/dist/index.d.mts +288 -8
- package/dist/index.d.ts +288 -8
- package/dist/index.js +842 -16
- package/dist/index.mjs +835 -16
- package/dist/server/index.d.mts +298 -11
- package/dist/server/index.d.ts +298 -11
- package/dist/server/index.js +849 -19
- package/dist/server/index.mjs +842 -19
- package/package.json +5 -6
package/dist/index.d.ts
CHANGED
|
@@ -185,6 +185,8 @@ interface FileMetadataInput {
|
|
|
185
185
|
uploaded_by?: string;
|
|
186
186
|
/** Original filename at upload time (V2) */
|
|
187
187
|
original_filename?: string;
|
|
188
|
+
/** Content tag classifying the document type (V3) */
|
|
189
|
+
content_tag?: string;
|
|
188
190
|
}
|
|
189
191
|
/**
|
|
190
192
|
* Input for updating an existing metadata record
|
|
@@ -258,6 +260,23 @@ interface RemoveExtractionOptions {
|
|
|
258
260
|
/** Merge strategy to use when recalculating (default: 'shallow') */
|
|
259
261
|
mergeStrategy?: 'shallow' | 'deep';
|
|
260
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Configuration for LLM-based content tagging.
|
|
265
|
+
* When enabled, calls the LLM with a specific prompt and writes
|
|
266
|
+
* the extracted field value to the content_tag column.
|
|
267
|
+
*/
|
|
268
|
+
interface ContentTagConfig {
|
|
269
|
+
/** Whether to enable LLM-based content tagging */
|
|
270
|
+
content_tag_set_by_llm: boolean;
|
|
271
|
+
/** Prompt area for hazo_llm_api lookup */
|
|
272
|
+
content_tag_prompt_area: string;
|
|
273
|
+
/** Prompt key within the area */
|
|
274
|
+
content_tag_prompt_key: string;
|
|
275
|
+
/** Optional variables to substitute in the prompt template */
|
|
276
|
+
content_tag_prompt_variables?: Record<string, string>;
|
|
277
|
+
/** Field name to extract from the LLM response as the content tag */
|
|
278
|
+
content_tag_prompt_return_fieldname: string;
|
|
279
|
+
}
|
|
261
280
|
|
|
262
281
|
/**
|
|
263
282
|
* Naming convention types for hazo_files
|
|
@@ -412,6 +431,8 @@ interface FileMetadataRecordV2 extends FileMetadataRecord {
|
|
|
412
431
|
storage_verified_at?: string | null;
|
|
413
432
|
/** ISO timestamp when file was soft-deleted */
|
|
414
433
|
deleted_at?: string | null;
|
|
434
|
+
/** Content tag classifying the document type (V3) */
|
|
435
|
+
content_tag?: string | null;
|
|
415
436
|
}
|
|
416
437
|
/**
|
|
417
438
|
* Options for adding a reference to a file
|
|
@@ -493,7 +514,7 @@ interface UploadWithRefOptions {
|
|
|
493
514
|
* Core types for the hazo_files package
|
|
494
515
|
*/
|
|
495
516
|
/** Supported storage provider types */
|
|
496
|
-
type StorageProvider = 'local' | 'google_drive';
|
|
517
|
+
type StorageProvider = 'local' | 'google_drive' | 'dropbox';
|
|
497
518
|
/** File item representing a file in storage */
|
|
498
519
|
interface FileItem {
|
|
499
520
|
id: string;
|
|
@@ -521,11 +542,21 @@ interface FolderItem {
|
|
|
521
542
|
}
|
|
522
543
|
/** Union type for file system items */
|
|
523
544
|
type FileSystemItem = FileItem | FolderItem;
|
|
545
|
+
/** Dropbox specific configuration */
|
|
546
|
+
interface DropboxConfig {
|
|
547
|
+
clientId: string;
|
|
548
|
+
clientSecret: string;
|
|
549
|
+
redirectUri: string;
|
|
550
|
+
refreshToken?: string;
|
|
551
|
+
accessToken?: string;
|
|
552
|
+
rootPath?: string;
|
|
553
|
+
}
|
|
524
554
|
/** Configuration for the file manager */
|
|
525
555
|
interface HazoFilesConfig {
|
|
526
556
|
provider: StorageProvider;
|
|
527
557
|
local?: LocalStorageConfig;
|
|
528
558
|
google_drive?: GoogleDriveConfig;
|
|
559
|
+
dropbox?: DropboxConfig;
|
|
529
560
|
}
|
|
530
561
|
/** Local storage specific configuration */
|
|
531
562
|
interface LocalStorageConfig {
|
|
@@ -1004,7 +1035,7 @@ declare class FileMetadataService {
|
|
|
1004
1035
|
/**
|
|
1005
1036
|
* Update specific V2 fields on a record
|
|
1006
1037
|
*/
|
|
1007
|
-
updateFields(fileId: string, fields: Partial<Pick<FileMetadataRecordV2, 'scope_id' | 'uploaded_by' | 'original_filename' | 'storage_verified_at' | 'status'>>): Promise<boolean>;
|
|
1038
|
+
updateFields(fileId: string, fields: Partial<Pick<FileMetadataRecordV2, 'scope_id' | 'uploaded_by' | 'original_filename' | 'storage_verified_at' | 'status' | 'content_tag'>>): Promise<boolean>;
|
|
1008
1039
|
/**
|
|
1009
1040
|
* Find orphaned files (zero references)
|
|
1010
1041
|
*/
|
|
@@ -1408,6 +1439,13 @@ interface HazoLLMInstance {
|
|
|
1408
1439
|
* Factory function type for creating LLM instances
|
|
1409
1440
|
*/
|
|
1410
1441
|
type LLMFactory = (provider: LLMProvider, options?: Record<string, unknown>) => HazoLLMInstance | Promise<HazoLLMInstance>;
|
|
1442
|
+
/**
|
|
1443
|
+
* Extended LLM factory configuration with optional cache management
|
|
1444
|
+
*/
|
|
1445
|
+
interface LLMFactoryConfig {
|
|
1446
|
+
create: LLMFactory;
|
|
1447
|
+
invalidateCache?: (area?: string, key?: string) => void;
|
|
1448
|
+
}
|
|
1411
1449
|
/**
|
|
1412
1450
|
* LLM Extraction Service
|
|
1413
1451
|
*
|
|
@@ -1449,7 +1487,13 @@ type LLMFactory = (provider: LLMProvider, options?: Record<string, unknown>) =>
|
|
|
1449
1487
|
declare class LLMExtractionService {
|
|
1450
1488
|
private llmFactory;
|
|
1451
1489
|
private defaultProvider;
|
|
1452
|
-
|
|
1490
|
+
private cacheInvalidator?;
|
|
1491
|
+
constructor(factoryConfig: LLMFactoryConfig, defaultProvider?: LLMProvider);
|
|
1492
|
+
/**
|
|
1493
|
+
* Invalidate the LLM prompt cache
|
|
1494
|
+
* Passthrough to hazo_llm_api's invalidate_prompt_cache when configured
|
|
1495
|
+
*/
|
|
1496
|
+
invalidatePromptCache(area?: string, key?: string): void;
|
|
1453
1497
|
/**
|
|
1454
1498
|
* Extract data from a document
|
|
1455
1499
|
*
|
|
@@ -1481,10 +1525,10 @@ declare class LLMExtractionService {
|
|
|
1481
1525
|
/**
|
|
1482
1526
|
* Create an LLMExtractionService instance
|
|
1483
1527
|
*
|
|
1484
|
-
* @param
|
|
1528
|
+
* @param factoryConfig - LLM factory configuration with create function and optional cache invalidation
|
|
1485
1529
|
* @param defaultProvider - Default LLM provider (default: 'gemini')
|
|
1486
1530
|
*/
|
|
1487
|
-
declare function createLLMExtractionService(
|
|
1531
|
+
declare function createLLMExtractionService(factoryConfig: LLMFactoryConfig, defaultProvider?: LLMProvider): LLMExtractionService;
|
|
1488
1532
|
|
|
1489
1533
|
/**
|
|
1490
1534
|
* Upload + Extract Service
|
|
@@ -1532,6 +1576,11 @@ interface UploadExtractOptions extends TrackedUploadOptions {
|
|
|
1532
1576
|
* Whether to create the folder path if it doesn't exist
|
|
1533
1577
|
*/
|
|
1534
1578
|
createFolders?: boolean;
|
|
1579
|
+
/**
|
|
1580
|
+
* Content tag configuration for this upload.
|
|
1581
|
+
* Overrides the default config set on the service.
|
|
1582
|
+
*/
|
|
1583
|
+
contentTagConfig?: ContentTagConfig;
|
|
1535
1584
|
}
|
|
1536
1585
|
/**
|
|
1537
1586
|
* Result of upload with extraction
|
|
@@ -1551,6 +1600,8 @@ interface UploadExtractResult {
|
|
|
1551
1600
|
generatedFolderPath?: string;
|
|
1552
1601
|
/** Original file name before renaming */
|
|
1553
1602
|
originalFileName?: string;
|
|
1603
|
+
/** Content tag assigned by LLM (if content tagging was performed) */
|
|
1604
|
+
contentTag?: string;
|
|
1554
1605
|
}
|
|
1555
1606
|
/**
|
|
1556
1607
|
* Options for creating folders from naming convention
|
|
@@ -1608,7 +1659,8 @@ declare class UploadExtractService {
|
|
|
1608
1659
|
private fileManager;
|
|
1609
1660
|
private namingService?;
|
|
1610
1661
|
private extractionService?;
|
|
1611
|
-
|
|
1662
|
+
private defaultContentTagConfig?;
|
|
1663
|
+
constructor(fileManager: TrackedFileManager, namingService?: NamingConventionService, extractionService?: LLMExtractionService, defaultContentTagConfig?: ContentTagConfig);
|
|
1612
1664
|
/**
|
|
1613
1665
|
* Upload a file with optional extraction and naming convention
|
|
1614
1666
|
*/
|
|
@@ -1633,6 +1685,21 @@ declare class UploadExtractService {
|
|
|
1633
1685
|
fullPath?: string;
|
|
1634
1686
|
folderPath?: string;
|
|
1635
1687
|
}>;
|
|
1688
|
+
/**
|
|
1689
|
+
* Perform content tagging via LLM extraction.
|
|
1690
|
+
* Calls the LLM with the configured prompt, extracts the specified field,
|
|
1691
|
+
* and writes it to the content_tag column.
|
|
1692
|
+
*/
|
|
1693
|
+
private performContentTagging;
|
|
1694
|
+
/**
|
|
1695
|
+
* Manually tag a file's content via LLM.
|
|
1696
|
+
* Works with existing DB records, resolving the file path internally.
|
|
1697
|
+
*
|
|
1698
|
+
* @param fileId - Database record ID of the file
|
|
1699
|
+
* @param config - Content tag config (falls back to default if not provided)
|
|
1700
|
+
* @returns OperationResult with the tag value
|
|
1701
|
+
*/
|
|
1702
|
+
tagFileContent(fileId: string, config?: ContentTagConfig): Promise<OperationResult<string>>;
|
|
1636
1703
|
/**
|
|
1637
1704
|
* Get the file manager
|
|
1638
1705
|
*/
|
|
@@ -1649,7 +1716,7 @@ declare class UploadExtractService {
|
|
|
1649
1716
|
/**
|
|
1650
1717
|
* Create an UploadExtractService instance
|
|
1651
1718
|
*/
|
|
1652
|
-
declare function createUploadExtractService(fileManager: TrackedFileManager, namingService?: NamingConventionService, extractionService?: LLMExtractionService): UploadExtractService;
|
|
1719
|
+
declare function createUploadExtractService(fileManager: TrackedFileManager, namingService?: NamingConventionService, extractionService?: LLMExtractionService, defaultContentTagConfig?: ContentTagConfig): UploadExtractService;
|
|
1653
1720
|
|
|
1654
1721
|
/**
|
|
1655
1722
|
* Configuration loader for hazo_files
|
|
@@ -1743,6 +1810,8 @@ interface HazoFilesColumnDefinitions {
|
|
|
1743
1810
|
deleted_at: 'TEXT' | 'TIMESTAMP';
|
|
1744
1811
|
/** Original filename at upload time (V2) */
|
|
1745
1812
|
original_filename: 'TEXT';
|
|
1813
|
+
/** Content tag classifying the document type (V3) */
|
|
1814
|
+
content_tag: 'TEXT';
|
|
1746
1815
|
}
|
|
1747
1816
|
/**
|
|
1748
1817
|
* Schema definition for a specific database type
|
|
@@ -1925,6 +1994,46 @@ declare const HAZO_FILES_NAMING_TABLE_SCHEMA: HazoFilesNamingTableSchema;
|
|
|
1925
1994
|
* Get DDL for a custom naming table name
|
|
1926
1995
|
*/
|
|
1927
1996
|
declare function getNamingSchemaForTable(tableName: string, dbType: 'sqlite' | 'postgres'): DatabaseSchemaDefinition;
|
|
1997
|
+
/**
|
|
1998
|
+
* Migration schema for adding V3 content tagging column to existing tables.
|
|
1999
|
+
* Idempotent — safe to run multiple times.
|
|
2000
|
+
*
|
|
2001
|
+
* @example
|
|
2002
|
+
* ```typescript
|
|
2003
|
+
* import { HAZO_FILES_MIGRATION_V3 } from 'hazo_files';
|
|
2004
|
+
*
|
|
2005
|
+
* // SQLite
|
|
2006
|
+
* for (const stmt of HAZO_FILES_MIGRATION_V3.sqlite.alterStatements) {
|
|
2007
|
+
* try { await db.run(stmt); } catch { /* column already exists *\/ }
|
|
2008
|
+
* }
|
|
2009
|
+
* for (const idx of HAZO_FILES_MIGRATION_V3.sqlite.indexes) {
|
|
2010
|
+
* await db.run(idx);
|
|
2011
|
+
* }
|
|
2012
|
+
*
|
|
2013
|
+
* // PostgreSQL
|
|
2014
|
+
* for (const stmt of HAZO_FILES_MIGRATION_V3.postgres.alterStatements) {
|
|
2015
|
+
* await client.query(stmt);
|
|
2016
|
+
* }
|
|
2017
|
+
* for (const idx of HAZO_FILES_MIGRATION_V3.postgres.indexes) {
|
|
2018
|
+
* await client.query(idx);
|
|
2019
|
+
* }
|
|
2020
|
+
* ```
|
|
2021
|
+
*/
|
|
2022
|
+
interface HazoFilesMigrationV3 {
|
|
2023
|
+
/** Default table name */
|
|
2024
|
+
tableName: string;
|
|
2025
|
+
/** SQLite migration statements */
|
|
2026
|
+
sqlite: MigrationSchemaDefinition;
|
|
2027
|
+
/** PostgreSQL migration statements */
|
|
2028
|
+
postgres: MigrationSchemaDefinition;
|
|
2029
|
+
/** New column names added in V3 */
|
|
2030
|
+
newColumns: readonly string[];
|
|
2031
|
+
}
|
|
2032
|
+
declare const HAZO_FILES_MIGRATION_V3: HazoFilesMigrationV3;
|
|
2033
|
+
/**
|
|
2034
|
+
* Get V3 migration statements for a custom table name
|
|
2035
|
+
*/
|
|
2036
|
+
declare function getMigrationV3ForTable(tableName: string, dbType: 'sqlite' | 'postgres'): MigrationSchemaDefinition;
|
|
1928
2037
|
|
|
1929
2038
|
/**
|
|
1930
2039
|
* Migration: Add Reference Tracking (V2)
|
|
@@ -1967,6 +2076,33 @@ declare function migrateToV2(executor: MigrationExecutor, dbType: 'sqlite' | 'po
|
|
|
1967
2076
|
*/
|
|
1968
2077
|
declare function backfillV2Defaults(executor: MigrationExecutor, dbType: 'sqlite' | 'postgres', tableName?: string): Promise<void>;
|
|
1969
2078
|
|
|
2079
|
+
/**
|
|
2080
|
+
* Migration: Add Content Tag (V3)
|
|
2081
|
+
*
|
|
2082
|
+
* Adds content_tag column to an existing hazo_files table.
|
|
2083
|
+
* Idempotent — safe to run multiple times.
|
|
2084
|
+
*/
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* Run the V3 migration: add content_tag column and index.
|
|
2088
|
+
*
|
|
2089
|
+
* @param executor - Object with a `run(sql)` method
|
|
2090
|
+
* @param dbType - Database type ('sqlite' | 'postgres')
|
|
2091
|
+
* @param tableName - Custom table name (defaults to 'hazo_files')
|
|
2092
|
+
*
|
|
2093
|
+
* @example
|
|
2094
|
+
* ```typescript
|
|
2095
|
+
* import { migrateToV3 } from 'hazo_files';
|
|
2096
|
+
*
|
|
2097
|
+
* // SQLite with better-sqlite3
|
|
2098
|
+
* await migrateToV3({ run: (sql) => db.exec(sql) }, 'sqlite');
|
|
2099
|
+
*
|
|
2100
|
+
* // PostgreSQL with pg
|
|
2101
|
+
* await migrateToV3({ run: (sql) => client.query(sql) }, 'postgres');
|
|
2102
|
+
* ```
|
|
2103
|
+
*/
|
|
2104
|
+
declare function migrateToV3(executor: MigrationExecutor, dbType: 'sqlite' | 'postgres', tableName?: string): Promise<void>;
|
|
2105
|
+
|
|
1970
2106
|
/**
|
|
1971
2107
|
* Common utility functions
|
|
1972
2108
|
*/
|
|
@@ -2336,6 +2472,150 @@ declare class GoogleDriveModule extends BaseStorageModule {
|
|
|
2336
2472
|
*/
|
|
2337
2473
|
declare function createGoogleDriveModule(): GoogleDriveModule;
|
|
2338
2474
|
|
|
2475
|
+
/**
|
|
2476
|
+
* Dropbox OAuth Authentication Handler
|
|
2477
|
+
* Manages OAuth flow, token storage, and token refresh
|
|
2478
|
+
*/
|
|
2479
|
+
interface DropboxAuthConfig {
|
|
2480
|
+
clientId: string;
|
|
2481
|
+
clientSecret: string;
|
|
2482
|
+
redirectUri: string;
|
|
2483
|
+
}
|
|
2484
|
+
interface DropboxTokenData {
|
|
2485
|
+
accessToken: string;
|
|
2486
|
+
refreshToken: string;
|
|
2487
|
+
expiryDate?: number;
|
|
2488
|
+
}
|
|
2489
|
+
interface DropboxAuthCallbacks {
|
|
2490
|
+
onTokensUpdated?: (tokens: DropboxTokenData) => Promise<void>;
|
|
2491
|
+
getStoredTokens?: () => Promise<DropboxTokenData | null>;
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* Dropbox Authentication Manager
|
|
2495
|
+
*/
|
|
2496
|
+
declare class DropboxAuth {
|
|
2497
|
+
private config;
|
|
2498
|
+
private callbacks;
|
|
2499
|
+
private tokens;
|
|
2500
|
+
constructor(config: DropboxAuthConfig, callbacks?: DropboxAuthCallbacks);
|
|
2501
|
+
/**
|
|
2502
|
+
* Generate the authorization URL for OAuth consent
|
|
2503
|
+
*/
|
|
2504
|
+
getAuthUrl(state?: string): string;
|
|
2505
|
+
/**
|
|
2506
|
+
* Exchange authorization code for tokens
|
|
2507
|
+
*/
|
|
2508
|
+
exchangeCodeForTokens(code: string): Promise<DropboxTokenData>;
|
|
2509
|
+
/**
|
|
2510
|
+
* Set tokens directly (e.g., from stored tokens)
|
|
2511
|
+
*/
|
|
2512
|
+
setTokens(tokens: DropboxTokenData): Promise<void>;
|
|
2513
|
+
/**
|
|
2514
|
+
* Load tokens from storage using callback
|
|
2515
|
+
*/
|
|
2516
|
+
loadStoredTokens(): Promise<boolean>;
|
|
2517
|
+
/**
|
|
2518
|
+
* Check if authenticated
|
|
2519
|
+
*/
|
|
2520
|
+
isAuthenticated(): boolean;
|
|
2521
|
+
/**
|
|
2522
|
+
* Get current tokens
|
|
2523
|
+
*/
|
|
2524
|
+
getTokens(): DropboxTokenData | null;
|
|
2525
|
+
/**
|
|
2526
|
+
* Get current access token
|
|
2527
|
+
*/
|
|
2528
|
+
getAccessToken(): string | null;
|
|
2529
|
+
/**
|
|
2530
|
+
* Refresh the access token
|
|
2531
|
+
*/
|
|
2532
|
+
refreshAccessToken(): Promise<DropboxTokenData>;
|
|
2533
|
+
/**
|
|
2534
|
+
* Revoke access (disconnect)
|
|
2535
|
+
*/
|
|
2536
|
+
revokeAccess(): Promise<void>;
|
|
2537
|
+
/**
|
|
2538
|
+
* Check if token is expired or will expire soon
|
|
2539
|
+
*/
|
|
2540
|
+
isTokenExpired(bufferSeconds?: number): boolean;
|
|
2541
|
+
/**
|
|
2542
|
+
* Ensure valid access token (refresh if needed)
|
|
2543
|
+
*/
|
|
2544
|
+
ensureValidToken(): Promise<void>;
|
|
2545
|
+
}
|
|
2546
|
+
/**
|
|
2547
|
+
* Create a new DropboxAuth instance
|
|
2548
|
+
*/
|
|
2549
|
+
declare function createDropboxAuth(config: DropboxAuthConfig, callbacks?: DropboxAuthCallbacks): DropboxAuth;
|
|
2550
|
+
|
|
2551
|
+
/**
|
|
2552
|
+
* Dropbox Storage Module
|
|
2553
|
+
* Implements file operations using Dropbox API via the official SDK
|
|
2554
|
+
*/
|
|
2555
|
+
|
|
2556
|
+
declare class DropboxModule extends BaseStorageModule {
|
|
2557
|
+
readonly provider: StorageProvider;
|
|
2558
|
+
private auth;
|
|
2559
|
+
private dbx;
|
|
2560
|
+
private rootPath;
|
|
2561
|
+
private authCallbacks;
|
|
2562
|
+
/**
|
|
2563
|
+
* Set authentication callbacks for token persistence
|
|
2564
|
+
*/
|
|
2565
|
+
setAuthCallbacks(callbacks: DropboxAuthCallbacks): void;
|
|
2566
|
+
initialize(config: HazoFilesConfig): Promise<void>;
|
|
2567
|
+
/**
|
|
2568
|
+
* Create/recreate the Dropbox SDK client with the current access token
|
|
2569
|
+
*/
|
|
2570
|
+
private createDropboxClient;
|
|
2571
|
+
/**
|
|
2572
|
+
* Get the auth instance for OAuth flow
|
|
2573
|
+
*/
|
|
2574
|
+
getAuth(): DropboxAuth;
|
|
2575
|
+
/**
|
|
2576
|
+
* Check if user is authenticated
|
|
2577
|
+
*/
|
|
2578
|
+
isAuthenticated(): boolean;
|
|
2579
|
+
/**
|
|
2580
|
+
* Authenticate with provided tokens
|
|
2581
|
+
*/
|
|
2582
|
+
authenticate(tokens: DropboxTokenData): Promise<void>;
|
|
2583
|
+
/**
|
|
2584
|
+
* Ensure authenticated before operations
|
|
2585
|
+
*/
|
|
2586
|
+
private ensureAuthenticated;
|
|
2587
|
+
/**
|
|
2588
|
+
* Convert virtual path to Dropbox path
|
|
2589
|
+
* Virtual: /folder/file.txt -> Dropbox: /folder/file.txt (or /rootPath/folder/file.txt)
|
|
2590
|
+
* Dropbox root is empty string "", not "/"
|
|
2591
|
+
*/
|
|
2592
|
+
private toDropboxPath;
|
|
2593
|
+
/**
|
|
2594
|
+
* Convert Dropbox metadata to FileSystemItem
|
|
2595
|
+
*/
|
|
2596
|
+
private metadataToItem;
|
|
2597
|
+
/**
|
|
2598
|
+
* Convert a Dropbox path_display to virtual path
|
|
2599
|
+
*/
|
|
2600
|
+
private toVirtualPath;
|
|
2601
|
+
createDirectory(virtualPath: string): Promise<OperationResult<FolderItem>>;
|
|
2602
|
+
removeDirectory(virtualPath: string, recursive?: boolean): Promise<OperationResult>;
|
|
2603
|
+
uploadFile(source: string | Buffer | ReadableStream, remotePath: string, options?: UploadOptions): Promise<OperationResult<FileItem>>;
|
|
2604
|
+
downloadFile(remotePath: string, localPath?: string, options?: DownloadOptions): Promise<OperationResult<Buffer | string>>;
|
|
2605
|
+
moveItem(sourcePath: string, destinationPath: string, _options?: MoveOptions): Promise<OperationResult<FileSystemItem>>;
|
|
2606
|
+
deleteFile(virtualPath: string): Promise<OperationResult>;
|
|
2607
|
+
renameFile(virtualPath: string, newName: string, _options?: RenameOptions): Promise<OperationResult<FileItem>>;
|
|
2608
|
+
renameFolder(virtualPath: string, newName: string, _options?: RenameOptions): Promise<OperationResult<FolderItem>>;
|
|
2609
|
+
listDirectory(virtualPath: string, options?: ListOptions): Promise<OperationResult<FileSystemItem[]>>;
|
|
2610
|
+
getItem(virtualPath: string): Promise<OperationResult<FileSystemItem>>;
|
|
2611
|
+
exists(virtualPath: string): Promise<boolean>;
|
|
2612
|
+
getFolderTree(path?: string, depth?: number): Promise<OperationResult<TreeNode[]>>;
|
|
2613
|
+
}
|
|
2614
|
+
/**
|
|
2615
|
+
* Factory function to create a DropboxModule instance
|
|
2616
|
+
*/
|
|
2617
|
+
declare function createDropboxModule(): DropboxModule;
|
|
2618
|
+
|
|
2339
2619
|
/**
|
|
2340
2620
|
* Module Registry
|
|
2341
2621
|
* Central registry for all storage modules
|
|
@@ -2782,4 +3062,4 @@ declare function toV2Record(record: FileMetadataRecord): FileMetadataRecordV2;
|
|
|
2782
3062
|
*/
|
|
2783
3063
|
declare function buildFileWithStatus(record: FileMetadataRecord): FileWithStatus;
|
|
2784
3064
|
|
|
2785
|
-
export { ALL_SYSTEM_VARIABLES, type AddExtractionOptions, type AddRefOptions, type AuthCallbacks, AuthenticationError, type CleanupOrphanedOptions, ConfigurationError, type CreateFolderOptions, type CrudServiceLike, DEFAULT_DATE_FORMATS, type DatabaseSchemaDefinition, type DatabaseTrackingConfig, DirectoryExistsError, DirectoryNotEmptyError, DirectoryNotFoundError, type DownloadOptions, type ExtractionData, type ExtractionOptions, type ExtractionResult, type FileBrowserState, type FileDataStructure, FileExistsError, type FileInfo, type FileItem, FileManager, type FileManagerOptions, type FileMetadataInput, type FileMetadataRecord, type FileMetadataRecordV2, FileMetadataService, type FileMetadataServiceOptions, type FileMetadataUpdate, FileNotFoundError, type FileRef, type FileRefVisibility, type FileStatus, type FileSystemItem, FileTooLargeError, type FileWithStatus, type FindOrphanedOptions, type FolderItem, type GeneratedNameResult, type GoogleAuthConfig, GoogleDriveAuth, type GoogleDriveConfig, GoogleDriveModule, HAZO_FILES_DEFAULT_TABLE_NAME, HAZO_FILES_MIGRATION_V2, HAZO_FILES_NAMING_DEFAULT_TABLE_NAME, HAZO_FILES_NAMING_TABLE_SCHEMA, HAZO_FILES_TABLE_SCHEMA, type HazoFilesColumnDefinitions, type HazoFilesConfig, HazoFilesError, type HazoFilesMigrationV2, type HazoFilesNamingColumnDefinitions, type HazoFilesNamingTableSchema, type HazoFilesTableSchema, type HazoLLMInstance, InvalidExtensionError, InvalidPathError, LLMExtractionService, type LLMFactory, type LLMProvider, type ListNamingConventionsOptions, type ListOptions, type LocalStorageConfig, LocalStorageModule, type MetadataLogger, type MigrationExecutor, type MigrationSchemaDefinition, type MoveOptions, type NameGenerationOptions, type NamingConventionInput, type NamingConventionRecord, NamingConventionService, type NamingConventionServiceOptions, type NamingConventionType, type NamingConventionUpdate, type NamingRuleConfiguratorProps, type NamingRuleHistoryEntry, type NamingRuleSchema, type NamingVariable, OperationError, type OperationResult, type ParsedNamingConvention, type PatternSegment, PermissionDeniedError, type ProgressCallback, type RemoveExtractionOptions, type RemoveRefsCriteria, type RenameOptions, SYSTEM_COUNTER_VARIABLES, SYSTEM_DATE_VARIABLES, SYSTEM_FILE_VARIABLES, type StorageModule, type StorageProvider, type TokenData, TrackedFileManager, type TrackedFileManagerFullOptions, type TrackedFileManagerOptions, type TrackedUploadOptions, type TreeNode, type UploadExtractOptions, type UploadExtractResult, UploadExtractService, type UploadOptions, type UploadWithRefOptions, type UseNamingRuleActions, type UseNamingRuleReturn, type UseNamingRuleState, type VariableCategory, addExtractionToFileData, backfillV2Defaults, buildFileWithStatus, clearExtractions, clonePattern, computeFileHash, computeFileHashFromStream, computeFileHashSync, computeFileInfo, createAndInitializeModule, createEmptyFileDataStructure, createEmptyNamingRuleSchema, createFileItem, createFileManager, createFileMetadataService, createFileRef, createFolderItem, createGoogleDriveAuth, createGoogleDriveModule, createInitializedFileManager, createInitializedTrackedFileManager, createLLMExtractionService, createLiteralSegment, createLocalModule, createModule, createNamingConventionService, createTrackedFileManager, createUploadExtractService, createVariableSegment, deepMerge, errorResult, filterItems, formatBytes, formatCounter, formatDateToken, generateExtractionId, generateId, generatePreviewName, generateRefId, generateSampleConfig, generateSegmentId, getBaseName, getBreadcrumbs, getDirName, getExtension, getExtensionFromMime, getExtractionById, getExtractionCount, getExtractions, getFileCategory, getFileMetadataValues, getMergedData, getMigrationForTable, getMimeType, getNameWithoutExtension, getNamingSchemaForTable, getParentPath, getPathSegments, getRegisteredProviders, getRelativePath, getSchemaForTable, getSystemVariablePreviewValues, hasExtension, hasExtractionStructure, hasFileContentChanged, hashesEqual, hazo_files_generate_file_name, hazo_files_generate_folder_name, isAudio, isChildPath, isCounterVariable, isDateVariable, isDocument, isFile, isFileMetadataVariable, isFolder, isImage, isPreviewable, isProviderRegistered, isText, isVideo, joinPath, loadConfig, loadConfigAsync, migrateToV2, normalizePath, parseConfig, parseFileData, parseFileRefs, parsePatternString, patternToString, recalculateMergedData, registerModule, removeExtractionById, removeExtractionByIndex, removeRefFromArray, removeRefsByCriteriaFromArray, sanitizeFilename, saveConfig, sortItems, stringifyFileData, stringifyFileRefs, successResult, toV2Record, updateExtractionById, validateExtractionData, validateFileDataStructure, validateNamingRuleSchema, validatePath };
|
|
3065
|
+
export { ALL_SYSTEM_VARIABLES, type AddExtractionOptions, type AddRefOptions, type AuthCallbacks, AuthenticationError, type CleanupOrphanedOptions, ConfigurationError, type ContentTagConfig, type CreateFolderOptions, type CrudServiceLike, DEFAULT_DATE_FORMATS, type DatabaseSchemaDefinition, type DatabaseTrackingConfig, DirectoryExistsError, DirectoryNotEmptyError, DirectoryNotFoundError, type DownloadOptions, DropboxAuth, type DropboxAuthCallbacks, type DropboxAuthConfig, type DropboxConfig, DropboxModule, type DropboxTokenData, type ExtractionData, type ExtractionOptions, type ExtractionResult, type FileBrowserState, type FileDataStructure, FileExistsError, type FileInfo, type FileItem, FileManager, type FileManagerOptions, type FileMetadataInput, type FileMetadataRecord, type FileMetadataRecordV2, FileMetadataService, type FileMetadataServiceOptions, type FileMetadataUpdate, FileNotFoundError, type FileRef, type FileRefVisibility, type FileStatus, type FileSystemItem, FileTooLargeError, type FileWithStatus, type FindOrphanedOptions, type FolderItem, type GeneratedNameResult, type GoogleAuthConfig, GoogleDriveAuth, type GoogleDriveConfig, GoogleDriveModule, HAZO_FILES_DEFAULT_TABLE_NAME, HAZO_FILES_MIGRATION_V2, HAZO_FILES_MIGRATION_V3, HAZO_FILES_NAMING_DEFAULT_TABLE_NAME, HAZO_FILES_NAMING_TABLE_SCHEMA, HAZO_FILES_TABLE_SCHEMA, type HazoFilesColumnDefinitions, type HazoFilesConfig, HazoFilesError, type HazoFilesMigrationV2, type HazoFilesMigrationV3, type HazoFilesNamingColumnDefinitions, type HazoFilesNamingTableSchema, type HazoFilesTableSchema, type HazoLLMInstance, InvalidExtensionError, InvalidPathError, LLMExtractionService, type LLMFactory, type LLMFactoryConfig, type LLMProvider, type ListNamingConventionsOptions, type ListOptions, type LocalStorageConfig, LocalStorageModule, type MetadataLogger, type MigrationExecutor, type MigrationSchemaDefinition, type MoveOptions, type NameGenerationOptions, type NamingConventionInput, type NamingConventionRecord, NamingConventionService, type NamingConventionServiceOptions, type NamingConventionType, type NamingConventionUpdate, type NamingRuleConfiguratorProps, type NamingRuleHistoryEntry, type NamingRuleSchema, type NamingVariable, OperationError, type OperationResult, type ParsedNamingConvention, type PatternSegment, PermissionDeniedError, type ProgressCallback, type RemoveExtractionOptions, type RemoveRefsCriteria, type RenameOptions, SYSTEM_COUNTER_VARIABLES, SYSTEM_DATE_VARIABLES, SYSTEM_FILE_VARIABLES, type StorageModule, type StorageProvider, type TokenData, TrackedFileManager, type TrackedFileManagerFullOptions, type TrackedFileManagerOptions, type TrackedUploadOptions, type TreeNode, type UploadExtractOptions, type UploadExtractResult, UploadExtractService, type UploadOptions, type UploadWithRefOptions, type UseNamingRuleActions, type UseNamingRuleReturn, type UseNamingRuleState, type VariableCategory, addExtractionToFileData, backfillV2Defaults, buildFileWithStatus, clearExtractions, clonePattern, computeFileHash, computeFileHashFromStream, computeFileHashSync, computeFileInfo, createAndInitializeModule, createDropboxAuth, createDropboxModule, createEmptyFileDataStructure, createEmptyNamingRuleSchema, createFileItem, createFileManager, createFileMetadataService, createFileRef, createFolderItem, createGoogleDriveAuth, createGoogleDriveModule, createInitializedFileManager, createInitializedTrackedFileManager, createLLMExtractionService, createLiteralSegment, createLocalModule, createModule, createNamingConventionService, createTrackedFileManager, createUploadExtractService, createVariableSegment, deepMerge, errorResult, filterItems, formatBytes, formatCounter, formatDateToken, generateExtractionId, generateId, generatePreviewName, generateRefId, generateSampleConfig, generateSegmentId, getBaseName, getBreadcrumbs, getDirName, getExtension, getExtensionFromMime, getExtractionById, getExtractionCount, getExtractions, getFileCategory, getFileMetadataValues, getMergedData, getMigrationForTable, getMigrationV3ForTable, getMimeType, getNameWithoutExtension, getNamingSchemaForTable, getParentPath, getPathSegments, getRegisteredProviders, getRelativePath, getSchemaForTable, getSystemVariablePreviewValues, hasExtension, hasExtractionStructure, hasFileContentChanged, hashesEqual, hazo_files_generate_file_name, hazo_files_generate_folder_name, isAudio, isChildPath, isCounterVariable, isDateVariable, isDocument, isFile, isFileMetadataVariable, isFolder, isImage, isPreviewable, isProviderRegistered, isText, isVideo, joinPath, loadConfig, loadConfigAsync, migrateToV2, migrateToV3, normalizePath, parseConfig, parseFileData, parseFileRefs, parsePatternString, patternToString, recalculateMergedData, registerModule, removeExtractionById, removeExtractionByIndex, removeRefFromArray, removeRefsByCriteriaFromArray, sanitizeFilename, saveConfig, sortItems, stringifyFileData, stringifyFileRefs, successResult, toV2Record, updateExtractionById, validateExtractionData, validateFileDataStructure, validateNamingRuleSchema, validatePath };
|