@happyvertical/files 0.74.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @happyvertical/files - Unified filesystem interface with provider pattern
3
+ *
4
+ * Provides a consistent API for file operations across storage backends.
5
+ * Each provider implements {@link FilesystemInterface}, allowing code to work
6
+ * with files regardless of the underlying storage system.
7
+ *
8
+ * Implemented providers:
9
+ * - **Local**: Node.js filesystem via `fs/promises`
10
+ * - **S3**: AWS S3 and S3-compatible services such as MinIO
11
+ * - **Google Drive**: Google Drive API v3 (OAuth2, service account, access token)
12
+ *
13
+ * Also exports rate-limited fetch utilities and legacy compatibility functions.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { getFilesystem } from '@happyvertical/files';
18
+ *
19
+ * const fs = await getFilesystem({ type: 'local', basePath: '/app/data' });
20
+ * await fs.write('config.json', JSON.stringify({ key: 'value' }));
21
+ * const content = await fs.read('config.json');
22
+ * ```
23
+ *
24
+ * @packageDocumentation
25
+ */
26
+ export type { FetchToFileOptions, WriteResponseToFileOptions, } from './fetch';
27
+ export { addRateLimit, fetchBuffer, fetchJSON, fetchText, fetchToFile, getRateLimit, writeResponseToFile, } from './fetch';
28
+ export * from './filesystem';
29
+ export { download, downloadFileWithCache, ensureDirectoryExists, getCached, getMimeType, isDirectory, isFile, listFiles, setCached, upload, } from './legacy';
30
+ export { LocalFilesystemProvider } from './node/local';
31
+ export { GoogleDriveProvider } from './providers/gdrive';
32
+ export { S3FilesystemProvider } from './providers/s3';
33
+ export { redactFilesystemConfig } from './redact';
34
+ export { getAvailableProviders, getFilesystem, getProviderInfo, initializeProviders, isProviderAvailable, registerProvider, } from './shared/factory';
35
+ export * from './shared/types';
36
+ import * as factory from './shared/factory';
37
+ /**
38
+ * Default export containing all factory functions
39
+ * @deprecated Use named imports instead for better tree-shaking
40
+ */
41
+ export default factory;
42
+ /** @internal */
43
+ export declare const PACKAGE_VERSION_INITIALIZED = true;
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,YAAY,EACV,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAEjB,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,WAAW,EACX,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,GACP,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAY/B,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C;;;GAGG;AACH,eAAe,OAAO,CAAC;AAEvB,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,OAAO,CAAC"}