diff --git a/examples/firestoreSyncExample.js b/examples/firestoreSyncExample.js deleted file mode 100644 index e05221e1..00000000 --- a/examples/firestoreSyncExample.js +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Example: Using the FirestoreSync Conduit Augmentation - * - * This example demonstrates how to use the FirestoreSync augmentation - * to sync data between Brainy and Firestore in both one-way and two-way modes. - * - * Prerequisites: - * 1. Install Firebase: npm install firebase - * 2. Set up a Firebase project and enable Firestore - * 3. Get your Firebase configuration from the Firebase console - */ - -import { - registerAugmentation, - initializeAugmentationPipeline, - BrainyGraph -} from '../dist/index.js' - -import { - createFirestoreSyncAugmentation, - FirestoreSyncConfig -} from '../dist/augmentations/firestoreSyncAugmentation.js' - -// Your Firebase configuration -// Replace with your actual Firebase project configuration -const firebaseConfig = { - apiKey: 'your-api-key', - authDomain: 'your-project-id.firebaseapp.com', - projectId: 'your-project-id', - storageBucket: 'your-project-id.appspot.com', - messagingSenderId: 'your-messaging-sender-id', - appId: 'your-app-id' -} - -// Example 1: One-way sync (Brainy -> Firestore) -async function setupOneWaySync() { - console.log('Setting up one-way sync from Brainy to Firestore...') - - // Create the FirestoreSync augmentation with one-way sync configuration - const oneWaySyncConfig = { - firebaseConfig, - nodesCollection: 'brainy_nodes', - edgesCollection: 'brainy_edges', - metadataCollection: 'brainy_metadata', - syncMode: 'one-way' - } - - // Create and register the augmentation - const oneWaySync = createFirestoreSyncAugmentation( - 'brainy-firestore-one-way-sync', - oneWaySyncConfig - ) - - registerAugmentation(oneWaySync) - - // Initialize the augmentation pipeline - initializeAugmentationPipeline() - - // Initialize the augmentation - await oneWaySync.initialize() - - console.log('One-way sync augmentation initialized successfully') - - return oneWaySync -} - -// Example 2: Two-way sync (Bidirectional between Brainy and Firestore) -async function setupTwoWaySync() { - console.log('Setting up two-way sync between Brainy and Firestore...') - - // Create the FirestoreSync augmentation with two-way sync configuration - const twoWaySyncConfig = { - firebaseConfig, - nodesCollection: 'brainy_nodes', - edgesCollection: 'brainy_edges', - metadataCollection: 'brainy_metadata', - syncMode: 'two-way', - syncInterval: 30000 // Sync every 30 seconds - } - - // Create and register the augmentation - const twoWaySync = createFirestoreSyncAugmentation( - 'brainy-firestore-two-way-sync', - twoWaySyncConfig - ) - - registerAugmentation(twoWaySync) - - // Initialize the augmentation pipeline - initializeAugmentationPipeline() - - // Initialize the augmentation - await twoWaySync.initialize() - - console.log('Two-way sync augmentation initialized successfully') - - return twoWaySync -} - -// Example 3: Using the FirestoreSync augmentation with a Brainy graph -async function syncGraphToFirestore() { - console.log('Creating a Brainy graph and syncing it to Firestore...') - - // Set up the one-way sync augmentation - const syncAugmentation = await setupOneWaySync() - - // Create a Brainy graph - const graph = new BrainyGraph() - await graph.initialize() - - // Add some nodes and edges to the graph - const node1 = await graph.addNode({ - vector: [0.1, 0.2, 0.3], - metadata: { name: 'Node 1', description: 'First test node' } - }) - - const node2 = await graph.addNode({ - vector: [0.4, 0.5, 0.6], - metadata: { name: 'Node 2', description: 'Second test node' } - }) - - const edge = await graph.addEdge({ - sourceId: node1.id, - targetId: node2.id, - type: 'related', - weight: 0.75, - metadata: { description: 'Test relationship' } - }) - - // Sync the nodes and edge to Firestore - await syncAugmentation.syncNodeToFirestore(node1) - await syncAugmentation.syncNodeToFirestore(node2) - await syncAugmentation.syncEdgeToFirestore(edge) - - console.log('Graph data synced to Firestore successfully') - - // Clean up - await syncAugmentation.shutDown() - await graph.close() -} - -// Example 4: Reading data from Firestore -async function readFromFirestore() { - console.log('Reading data from Firestore...') - - // Set up the one-way sync augmentation - const syncAugmentation = await setupOneWaySync() - - // Read all nodes from Firestore - const nodesResponse = await syncAugmentation.readData({ - collection: 'brainy_nodes' - }) - - if (nodesResponse.success) { - console.log(`Found ${nodesResponse.data.length} nodes in Firestore`) - console.log('First node:', nodesResponse.data[0]) - } else { - console.error('Failed to read nodes:', nodesResponse.error) - } - - // Read a specific edge by ID - const edgeResponse = await syncAugmentation.readData({ - collection: 'brainy_edges', - id: 'some-edge-id' // Replace with an actual edge ID - }) - - if (edgeResponse.success) { - console.log('Edge data:', edgeResponse.data) - } else { - console.error('Failed to read edge:', edgeResponse.error) - } - - // Clean up - await syncAugmentation.shutDown() -} - -// Example 5: Writing data to Firestore -async function writeToFirestore() { - console.log('Writing data to Firestore...') - - // Set up the one-way sync augmentation - const syncAugmentation = await setupOneWaySync() - - // Write a custom document to Firestore - const writeResponse = await syncAugmentation.writeData({ - collection: 'custom_collection', - id: 'custom-doc-1', - document: { - name: 'Custom Document', - timestamp: new Date(), - values: [1, 2, 3, 4, 5], - nested: { - field1: 'value1', - field2: 'value2' - } - } - }) - - if (writeResponse.success) { - console.log('Document written successfully:', writeResponse.data) - } else { - console.error('Failed to write document:', writeResponse.error) - } - - // Clean up - await syncAugmentation.shutDown() -} - -// Example 6: Monitoring changes in Firestore -async function monitorFirestore() { - console.log('Monitoring changes in Firestore...') - - // Set up the two-way sync augmentation - const syncAugmentation = await setupTwoWaySync() - - // Monitor changes in the nodes collection - await syncAugmentation.monitorStream('brainy_nodes', (data) => { - console.log('Node change detected:', data) - }) - - console.log('Monitoring started. Changes will be logged as they occur.') - console.log('Press Ctrl+C to stop monitoring.') - - // Keep the process running - // In a real application, you would integrate this with your application lifecycle - process.on('SIGINT', async () => { - console.log('Stopping monitoring...') - await syncAugmentation.shutDown() - process.exit(0) - }) -} - -// Run the examples -async function runExamples() { - try { - // Uncomment the example you want to run - // await syncGraphToFirestore(); - // await readFromFirestore(); - // await writeToFirestore(); - // await monitorFirestore(); - - console.log('Example completed successfully') - } catch (error) { - console.error('Error running example:', error) - } -} - -runExamples() diff --git a/examples/memoryAugmentationExample.js b/examples/memoryAugmentationExample.js index ecdb402a..ae36e447 100644 --- a/examples/memoryAugmentationExample.js +++ b/examples/memoryAugmentationExample.js @@ -7,15 +7,12 @@ * The example shows: * 1. Using the default memory augmentation (auto-selected based on environment) * 2. Using specific storage types (Memory, FileSystem, OPFS) - * 3. Using Firestore storage */ import { registerAugmentation, initializeAugmentationPipeline, - createMemoryAugmentation, - createFirestoreStorageAugmentation, - FirestoreStorageConfig + createMemoryAugmentation } from '../dist/index.js' // Example 1: Using the default memory augmentation @@ -126,66 +123,6 @@ async function useOPFSStorage() { } } -// Example 5: Using Firestore storage -async function useFirestoreStorage() { - console.log('Setting up Firestore storage...') - - // Your Firebase configuration - // Replace with your actual Firebase project configuration - const firebaseConfig = { - projectId: 'your-project-id', - collection: 'brainy_data', - // Optional: provide credentials, databaseURL, appName - } - - try { - // Method 1: Using createMemoryAugmentation with 'firestore' storage type - const memoryAug = await createMemoryAugmentation('brainy-firestore-storage', { - storageType: 'firestore', - firestoreConfig: firebaseConfig - }) - - // Register the augmentation - registerAugmentation(memoryAug) - - // Initialize the augmentation - await memoryAug.initialize() - - console.log('Firestore storage initialized successfully') - - // Store some data - await storeAndRetrieveData(memoryAug) - - return memoryAug - } catch (error) { - console.error('Failed to initialize Firestore storage:', error) - console.log('This might be because Firebase is not properly configured or installed') - - // Method 2: Using createFirestoreStorageAugmentation directly - console.log('Trying alternative method...') - - try { - const firestoreStorage = createFirestoreStorageAugmentation( - 'firestore-storage-direct', - firebaseConfig - ) - - registerAugmentation(firestoreStorage) - await firestoreStorage.initialize() - - console.log('Firestore storage initialized successfully (direct method)') - - // Store some data - await storeAndRetrieveData(firestoreStorage) - - return firestoreStorage - } catch (directError) { - console.error('Failed to initialize Firestore storage (direct method):', directError) - return null - } - } -} - // Helper function to store and retrieve data async function storeAndRetrieveData(memoryAug) { console.log('Storing and retrieving data...') @@ -322,12 +259,6 @@ async function runExamples() { await opfsStorage.shutDown() } - // Example 5: Firestore storage - const firestoreStorage = await useFirestoreStorage() - if (firestoreStorage) { - await firestoreStorage.shutDown() - } - console.log('All examples completed') } diff --git a/package-lock.json b/package-lock.json index 79e3275d..81f7c722 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "@tensorflow/tfjs-backend-cpu": "^4.22.0", "@tensorflow/tfjs-core": "^4.22.0", "@tensorflow/tfjs-layers": "^4.22.0", - "firebase": "^10.8.0", "uuid": "^9.0.0" }, "devDependencies": { @@ -62,9 +61,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.2.tgz", - "integrity": "sha512-TUtMJYRPyUb/9aU8f3K0mjmjf6M9N5Woshn2CS6nqJSeJtTtQcpLUXjGt9vbF8ZGff0El99sWkLgzwW3VXnxZQ==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.3.tgz", + "integrity": "sha512-V42wFfx1ymFte+ecf6iXghnnP8kWTO+ZLXIyZq+1LAXHHvTZdVxicn4yiVYdYMGaCO3tmqub11AorKkv+iodqw==", "dev": true, "license": "MIT", "engines": { @@ -72,22 +71,22 @@ } }, "node_modules/@babel/core": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.1.tgz", - "integrity": "sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz", + "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.1", - "@babel/helper-compilation-targets": "^7.27.1", - "@babel/helper-module-transforms": "^7.27.1", - "@babel/helpers": "^7.27.1", - "@babel/parser": "^7.27.1", - "@babel/template": "^7.27.1", - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1", + "@babel/generator": "^7.27.3", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.27.3", + "@babel/helpers": "^7.27.4", + "@babel/parser": "^7.27.4", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.27.4", + "@babel/types": "^7.27.3", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -113,14 +112,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz", - "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.3.tgz", + "integrity": "sha512-xnlJYj5zepml8NXtjkG0WquFUv8RskFqyFcVgTBp5k+NaA/8uw/K+OSVf8AMGw5e9HKP2ETd5xpK5MLZQD6b4Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.27.1", - "@babel/types": "^7.27.1", + "@babel/parser": "^7.27.3", + "@babel/types": "^7.27.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -171,15 +170,15 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.1.tgz", - "integrity": "sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz", + "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.27.1" + "@babel/traverse": "^7.27.3" }, "engines": { "node": ">=6.9.0" @@ -229,27 +228,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz", - "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.4.tgz", + "integrity": "sha512-Y+bO6U+I7ZKaM5G5rDUZiYfUvQPUibYmAFe7EnKdnKBbVXDZxvp+MWOH5gYciY0EPk4EScsuFMQBbEfpdRKSCQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.27.1", - "@babel/types": "^7.27.1" + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.3" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", - "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.4.tgz", + "integrity": "sha512-BRmLHGwpUqLFR2jzx9orBuX/ABDkj2jLKOXrHDTN2aOKL+jFDDKaRNo9nyYsIl9h/UE/7lMKdDjKQQyxKKDZ7g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.27.1" + "@babel/types": "^7.27.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -513,17 +512,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.1.tgz", - "integrity": "sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==", + "version": "7.27.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz", + "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.27.1", - "@babel/parser": "^7.27.1", - "@babel/template": "^7.27.1", - "@babel/types": "^7.27.1", + "@babel/generator": "^7.27.3", + "@babel/parser": "^7.27.4", + "@babel/template": "^7.27.2", + "@babel/types": "^7.27.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -542,9 +541,9 @@ } }, "node_modules/@babel/types": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", - "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", + "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz", + "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==", "dev": true, "license": "MIT", "dependencies": { @@ -649,638 +648,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@firebase/analytics": { - "version": "0.10.8", - "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.8.tgz", - "integrity": "sha512-CVnHcS4iRJPqtIDc411+UmFldk0ShSK3OB+D0bKD8Ck5Vro6dbK5+APZpkuWpbfdL359DIQUnAaMLE+zs/PVyA==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/installations": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/analytics-compat": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.14.tgz", - "integrity": "sha512-unRVY6SvRqfNFIAA/kwl4vK+lvQAL2HVcgu9zTrUtTyYDmtIt/lOuHJynBMYEgLnKm39YKBDhtqdapP2e++ASw==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/analytics": "0.10.8", - "@firebase/analytics-types": "0.8.2", - "@firebase/component": "0.6.9", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/analytics-types": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.2.tgz", - "integrity": "sha512-EnzNNLh+9/sJsimsA/FGqzakmrAUKLeJvjRHlg8df1f97NLUlFidk9600y0ZgWOp3CAxn6Hjtk+08tixlUOWyw==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/app": { - "version": "0.10.13", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.10.13.tgz", - "integrity": "sha512-OZiDAEK/lDB6xy/XzYAyJJkaDqmQ+BCtOEPLqFvxWKUz5JbBmej7IiiRHdtiIOD/twW7O5AxVsfaaGA/V1bNsA==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "idb": "7.1.1", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/app-check": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.8.tgz", - "integrity": "sha512-O49RGF1xj7k6BuhxGpHmqOW5hqBIAEbt2q6POW0lIywx7emYtzPDeQI+ryQpC4zbKX646SoVZ711TN1DBLNSOQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/app-check-compat": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.15.tgz", - "integrity": "sha512-zFIvIFFNqDXpOT2huorz9cwf56VT3oJYRFjSFYdSbGYEJYEaXjLJbfC79lx/zjx4Fh+yuN8pry3TtvwaevrGbg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/app-check": "0.8.8", - "@firebase/app-check-types": "0.5.2", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/app-check-interop-types": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2.tgz", - "integrity": "sha512-LMs47Vinv2HBMZi49C09dJxp0QT5LwDzFaVGf/+ITHe3BlIhUiLNttkATSXplc89A2lAaeTqjgqVkiRfUGyQiQ==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/app-check-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.2.tgz", - "integrity": "sha512-FSOEzTzL5bLUbD2co3Zut46iyPWML6xc4x+78TeaXMSuJap5QObfb+rVvZJtla3asN4RwU7elaQaduP+HFizDA==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/app-compat": { - "version": "0.2.43", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.43.tgz", - "integrity": "sha512-HM96ZyIblXjAC7TzE8wIk2QhHlSvksYkQ4Ukh1GmEenzkucSNUmUX4QvoKrqeWsLEQ8hdcojABeCV8ybVyZmeg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/app": "0.10.13", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/app-types": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2.tgz", - "integrity": "sha512-oMEZ1TDlBz479lmABwWsWjzHwheQKiAgnuKxE0pz0IXCVx7/rtlkx1fQ6GfgK24WCrxDKMplZrT50Kh04iMbXQ==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/auth": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.9.tgz", - "integrity": "sha512-yLD5095kVgDw965jepMyUrIgDklD6qH/BZNHeKOgvu7pchOKNjVM+zQoOVYJIKWMWOWBq8IRNVU6NXzBbozaJg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0", - "undici": "6.19.7" - }, - "peerDependencies": { - "@firebase/app": "0.x", - "@react-native-async-storage/async-storage": "^1.18.1" - }, - "peerDependenciesMeta": { - "@react-native-async-storage/async-storage": { - "optional": true - } - } - }, - "node_modules/@firebase/auth-compat": { - "version": "0.5.14", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.14.tgz", - "integrity": "sha512-2eczCSqBl1KUPJacZlFpQayvpilg3dxXLy9cSMTKtQMTQSmondUtPI47P3ikH3bQAXhzKLOE+qVxJ3/IRtu9pw==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/auth": "1.7.9", - "@firebase/auth-types": "0.12.2", - "@firebase/component": "0.6.9", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0", - "undici": "6.19.7" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/auth-interop-types": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3.tgz", - "integrity": "sha512-Fc9wuJGgxoxQeavybiuwgyi+0rssr76b+nHpj+eGhXFYAdudMWyfBHvFL/I5fEHniUM/UQdFzi9VXJK2iZF7FQ==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/auth-types": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.2.tgz", - "integrity": "sha512-qsEBaRMoGvHO10unlDJhaKSuPn4pyoTtlQuP1ghZfzB6rNQPuhp/N/DcFZxm9i4v0SogjCbf9reWupwIvfmH6w==", - "license": "Apache-2.0", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/component": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.9.tgz", - "integrity": "sha512-gm8EUEJE/fEac86AvHn8Z/QW8BvR56TBw3hMW0O838J/1mThYQXAIQBgUv75EqlCZfdawpWLrKt1uXvp9ciK3Q==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/data-connect": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.1.0.tgz", - "integrity": "sha512-vSe5s8dY13ilhLnfY0eYRmQsdTbH7PUFZtBbqU6JVX/j8Qp9A6G5gG6//ulbX9/1JFOF1IWNOne9c8S/DOCJaQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/database": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.8.tgz", - "integrity": "sha512-dzXALZeBI1U5TXt6619cv0+tgEhJiwlUtQ55WNZY7vGAjv7Q1QioV969iYwt1AQQ0ovHnEW0YW9TiBfefLvErg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "faye-websocket": "0.11.4", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database-compat": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.8.tgz", - "integrity": "sha512-OpeWZoPE3sGIRPBKYnW9wLad25RaWbGyk7fFQe4xnJQKRzlynWeFBSRRAoLE2Old01WXwskUiucNqUUVlFsceg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/database": "1.0.8", - "@firebase/database-types": "1.0.5", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/database-types": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.5.tgz", - "integrity": "sha512-fTlqCNwFYyq/C6W7AJ5OCuq5CeZuBEsEwptnVxlNPkWCo5cTTyukzAHRSO/jaQcItz33FfYrrFk1SJofcu2AaQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/app-types": "0.9.2", - "@firebase/util": "1.10.0" - } - }, - "node_modules/@firebase/firestore": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.3.tgz", - "integrity": "sha512-NwVU+JPZ/3bhvNSJMCSzfcBZZg8SUGyzZ2T0EW3/bkUeefCyzMISSt/TTIfEHc8cdyXGlMqfGe3/62u9s74UEg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "@firebase/webchannel-wrapper": "1.0.1", - "@grpc/grpc-js": "~1.9.0", - "@grpc/proto-loader": "^0.7.8", - "tslib": "^2.1.0", - "undici": "6.19.7" - }, - "engines": { - "node": ">=10.10.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/firestore-compat": { - "version": "0.3.38", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.38.tgz", - "integrity": "sha512-GoS0bIMMkjpLni6StSwRJarpu2+S5m346Na7gr9YZ/BZ/W3/8iHGNr9PxC+f0rNZXqS4fGRn88pICjrZEgbkqQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/firestore": "4.7.3", - "@firebase/firestore-types": "3.0.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/firestore-types": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.2.tgz", - "integrity": "sha512-wp1A+t5rI2Qc/2q7r2ZpjUXkRVPtGMd6zCLsiWurjsQpqPgFin3AhNibKcIzoF2rnToNa/XYtyWXuifjOOwDgg==", - "license": "Apache-2.0", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/functions": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.8.tgz", - "integrity": "sha512-Lo2rTPDn96naFIlSZKVd1yvRRqqqwiJk7cf9TZhUerwnPKgBzXy+aHE22ry+6EjCaQusUoNai6mU6p+G8QZT1g==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.9", - "@firebase/messaging-interop-types": "0.2.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0", - "undici": "6.19.7" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/functions-compat": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.14.tgz", - "integrity": "sha512-dZ0PKOKQFnOlMfcim39XzaXonSuPPAVuzpqA4ONTIdyaJK/OnBaIEVs/+BH4faa1a2tLeR+Jy15PKqDRQoNIJw==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/functions": "0.11.8", - "@firebase/functions-types": "0.6.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/functions-types": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.2.tgz", - "integrity": "sha512-0KiJ9lZ28nS2iJJvimpY4nNccV21rkQyor5Iheu/nq8aKXJqtJdeSlZDspjPSBBiHRzo7/GMUttegnsEITqR+w==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/installations": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.9.tgz", - "integrity": "sha512-hlT7AwCiKghOX3XizLxXOsTFiFCQnp/oj86zp1UxwDGmyzsyoxtX+UIZyVyH/oBF5+XtblFG9KZzZQ/h+dpy+Q==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/util": "1.10.0", - "idb": "7.1.1", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/installations-compat": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.9.tgz", - "integrity": "sha512-2lfdc6kPXR7WaL4FCQSQUhXcPbI7ol3wF+vkgtU25r77OxPf8F/VmswQ7sgIkBBWtymn5ZF20TIKtnOj9rjb6w==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/installations": "0.6.9", - "@firebase/installations-types": "0.5.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/installations-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.2.tgz", - "integrity": "sha512-que84TqGRZJpJKHBlF2pkvc1YcXrtEDOVGiDjovP/a3s6W4nlbohGXEsBJo0JCeeg/UG9A+DEZVDUV9GpklUzA==", - "license": "Apache-2.0", - "peerDependencies": { - "@firebase/app-types": "0.x" - } - }, - "node_modules/@firebase/logger": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.2.tgz", - "integrity": "sha512-Q1VuA5M1Gjqrwom6I6NUU4lQXdo9IAQieXlujeHZWvRt1b7qQ0KwBaNAjgxG27jgF9/mUwsNmO8ptBCGVYhB0A==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/messaging": { - "version": "0.12.12", - "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.12.tgz", - "integrity": "sha512-6q0pbzYBJhZEtUoQx7hnPhZvAbuMNuBXKQXOx2YlWhSrlv9N1m0ZzlNpBbu/ItTzrwNKTibdYzUyaaxdWLg+4w==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/installations": "0.6.9", - "@firebase/messaging-interop-types": "0.2.2", - "@firebase/util": "1.10.0", - "idb": "7.1.1", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/messaging-compat": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.12.tgz", - "integrity": "sha512-pKsiUVZrbmRgdImYqhBNZlkKJbqjlPkVdQRZGRbkTyX4OSGKR0F/oJeCt1a8jEg5UnBp4fdVwSWSp4DuCovvEQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/messaging": "0.12.12", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/messaging-interop-types": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.2.tgz", - "integrity": "sha512-l68HXbuD2PPzDUOFb3aG+nZj5KA3INcPwlocwLZOzPp9rFM9yeuI9YLl6DQfguTX5eAGxO0doTR+rDLDvQb5tA==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/performance": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.9.tgz", - "integrity": "sha512-PnVaak5sqfz5ivhua+HserxTJHtCar/7zM0flCX6NkzBNzJzyzlH4Hs94h2Il0LQB99roBqoE5QT1JqWqcLJHQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/installations": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/performance-compat": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.9.tgz", - "integrity": "sha512-dNl95IUnpsu3fAfYBZDCVhXNkASE0uo4HYaEPd2/PKscfTvsgqFAOxfAXzBEDOnynDWiaGUnb5M1O00JQ+3FXA==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/performance": "0.6.9", - "@firebase/performance-types": "0.2.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/performance-types": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.2.tgz", - "integrity": "sha512-gVq0/lAClVH5STrIdKnHnCo2UcPLjJlDUoEB/tB4KM+hAeHUxWKnpT0nemUPvxZ5nbdY/pybeyMe8Cs29gEcHA==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/remote-config": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.9.tgz", - "integrity": "sha512-EO1NLCWSPMHdDSRGwZ73kxEEcTopAxX1naqLJFNApp4hO8WfKfmEpmjxmP5TrrnypjIf2tUkYaKsfbEA7+AMmA==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/installations": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/remote-config-compat": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.9.tgz", - "integrity": "sha512-AxzGpWfWFYejH2twxfdOJt5Cfh/ATHONegTd/a0p5flEzsD5JsxXgfkFToop+mypEL3gNwawxrxlZddmDoNxyA==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/remote-config": "0.4.9", - "@firebase/remote-config-types": "0.3.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/remote-config-types": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.2.tgz", - "integrity": "sha512-0BC4+Ud7y2aPTyhXJTMTFfrGGLqdYXrUB9sJVAB8NiqJswDTc4/2qrE/yfUbnQJhbSi6ZaTTBKyG3n1nplssaA==", - "license": "Apache-2.0" - }, - "node_modules/@firebase/storage": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.2.tgz", - "integrity": "sha512-fxuJnHshbhVwuJ4FuISLu+/76Aby2sh+44ztjF2ppoe0TELIDxPW6/r1KGlWYt//AD0IodDYYA8ZTN89q8YqUw==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0", - "undici": "6.19.7" - }, - "peerDependencies": { - "@firebase/app": "0.x" - } - }, - "node_modules/@firebase/storage-compat": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.12.tgz", - "integrity": "sha512-hA4VWKyGU5bWOll+uwzzhEMMYGu9PlKQc1w4DWxB3aIErWYzonrZjF0icqNQZbwKNIdh8SHjZlFeB2w6OSsjfg==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/component": "0.6.9", - "@firebase/storage": "0.13.2", - "@firebase/storage-types": "0.8.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "peerDependencies": { - "@firebase/app-compat": "0.x" - } - }, - "node_modules/@firebase/storage-types": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.2.tgz", - "integrity": "sha512-0vWu99rdey0g53lA7IShoA2Lol1jfnPovzLDUBuon65K7uKG9G+L5uO05brD9pMw+l4HRFw23ah3GwTGpEav6g==", - "license": "Apache-2.0", - "peerDependencies": { - "@firebase/app-types": "0.x", - "@firebase/util": "1.x" - } - }, - "node_modules/@firebase/util": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.10.0.tgz", - "integrity": "sha512-xKtx4A668icQqoANRxyDLBLz51TAbDP9KRfpbKGxiCAW346d0BeJe5vN6/hKxxmWwnZ0mautyv39JxviwwQMOQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/vertexai-preview": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@firebase/vertexai-preview/-/vertexai-preview-0.0.4.tgz", - "integrity": "sha512-EBSqyu9eg8frQlVU9/HjKtHN7odqbh9MtAcVz3WwHj4gLCLOoN9F/o+oxlq3CxvFrd3CNTZwu6d2mZtVlEInng==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/component": "0.6.9", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.10.0", - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@firebase/app": "0.x", - "@firebase/app-types": "0.x" - } - }, - "node_modules/@firebase/webchannel-wrapper": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.1.tgz", - "integrity": "sha512-jmEnr/pk0yVkA7mIlHNnxCi+wWzOFUg0WyIotgkKAb2u1J7fAeDBcVNSTjTihbAYNusCLQdW5s9IJ5qwnEufcQ==", - "license": "Apache-2.0" - }, - "node_modules/@grpc/grpc-js": { - "version": "1.9.15", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", - "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==", - "license": "Apache-2.0", - "dependencies": { - "@grpc/proto-loader": "^0.7.8", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.7.15", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.15.tgz", - "integrity": "sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==", - "license": "Apache-2.0", - "dependencies": { - "lodash.camelcase": "^4.3.0", - "long": "^5.0.0", - "protobufjs": "^7.2.5", - "yargs": "^17.7.2" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@grpc/proto-loader/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@grpc/proto-loader/node_modules/long": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", - "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", - "license": "Apache-2.0" - }, - "node_modules/@grpc/proto-loader/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -1833,70 +1200,6 @@ "node": ">= 8" } }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "license": "BSD-3-Clause", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "license": "BSD-3-Clause" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", - "license": "BSD-3-Clause" - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -2164,9 +1467,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.17.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.47.tgz", - "integrity": "sha512-3dLX0Upo1v7RvUimvxLeXqwrfyKxUINk0EAM83swP2mlSUcwV73sZy8XhNz8bcZ3VbsfQyC/y6jRdL5tgCNpDQ==", + "version": "20.17.57", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.57.tgz", + "integrity": "sha512-f3T4y6VU4fVQDKVqJV4Uppy8c1p/sVvS3peyqxyWnzkqXFJLRU7Y1Bl7rMS1Qe9z0v4M6McY0Fp9yBsgHJUsWQ==", "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -2739,9 +2042,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", - "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", "dev": true, "funding": [ { @@ -2759,8 +2062,8 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001716", - "electron-to-chromium": "^1.5.149", + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -2835,9 +2138,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001718", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", - "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", + "version": "1.0.30001720", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz", + "integrity": "sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g==", "dev": true, "funding": [ { @@ -3161,9 +2464,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.155", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.155.tgz", - "integrity": "sha512-ps5KcGGmwL8VaeJlvlDlu4fORQpv3+GIcF5I3f9tUKUlJ/wsysh6HU8P5L1XWRYeXfA0oJd4PyM8ds8zTFf6Ng==", + "version": "1.5.162", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.162.tgz", + "integrity": "sha512-hQA+Zb5QQwoSaXJWEAGEw1zhk//O7qDzib05Z4qTqZfNju/FAkrm5ZInp0JbTp4Z18A6bilopdZWEYrFSsfllA==", "dev": true, "license": "ISC" }, @@ -3563,18 +2866,6 @@ "reusify": "^1.0.4" } }, - "node_modules/faye-websocket": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", - "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", - "license": "Apache-2.0", - "dependencies": { - "websocket-driver": ">=0.5.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -3651,42 +2942,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/firebase": { - "version": "10.14.1", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.14.1.tgz", - "integrity": "sha512-0KZxU+Ela9rUCULqFsUUOYYkjh7OM1EWdIfG6///MtXd0t2/uUIf0iNV5i0KariMhRQ5jve/OY985nrAXFaZeQ==", - "license": "Apache-2.0", - "dependencies": { - "@firebase/analytics": "0.10.8", - "@firebase/analytics-compat": "0.2.14", - "@firebase/app": "0.10.13", - "@firebase/app-check": "0.8.8", - "@firebase/app-check-compat": "0.3.15", - "@firebase/app-compat": "0.2.43", - "@firebase/app-types": "0.9.2", - "@firebase/auth": "1.7.9", - "@firebase/auth-compat": "0.5.14", - "@firebase/data-connect": "0.1.0", - "@firebase/database": "1.0.8", - "@firebase/database-compat": "1.0.8", - "@firebase/firestore": "4.7.3", - "@firebase/firestore-compat": "0.3.38", - "@firebase/functions": "0.11.8", - "@firebase/functions-compat": "0.3.14", - "@firebase/installations": "0.6.9", - "@firebase/installations-compat": "0.2.9", - "@firebase/messaging": "0.12.12", - "@firebase/messaging-compat": "0.2.12", - "@firebase/performance": "0.6.9", - "@firebase/performance-compat": "0.2.9", - "@firebase/remote-config": "0.4.9", - "@firebase/remote-config-compat": "0.2.9", - "@firebase/storage": "0.13.2", - "@firebase/storage-compat": "0.3.12", - "@firebase/util": "1.10.0", - "@firebase/vertexai-preview": "0.0.4" - } - }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -4011,12 +3266,6 @@ "dev": true, "license": "MIT" }, - "node_modules/http-parser-js": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.10.tgz", - "integrity": "sha512-Pysuw9XpUq5dVc/2SMHpuTY01RFl8fttgcyunjL7eEMhGM3cI4eOmiCycJDVCo/7O7ClfQD3SaI6ftDzqOXYMA==", - "license": "MIT" - }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -4027,12 +3276,6 @@ "node": ">=10.17.0" } }, - "node_modules/idb": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", - "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==", - "license": "ISC" - }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -5093,12 +4336,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "license": "MIT" - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -5636,36 +4873,6 @@ "node": ">= 6" } }, - "node_modules/protobufjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", - "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", - "hasInstallScript": true, - "license": "BSD-3-Clause", - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/protobufjs/node_modules/long": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", - "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", - "license": "Apache-2.0" - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -6181,9 +5388,9 @@ } }, "node_modules/ts-jest": { - "version": "29.3.3", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.3.tgz", - "integrity": "sha512-y6jLm19SL4GroiBmHwFK4dSHUfDNmOrJbRfp6QmDIlI9p5tT5Q8ItccB4pTIslCIqOZuQnBwpTR0bQ5eUMYwkw==", + "version": "29.3.4", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.4.tgz", + "integrity": "sha512-Iqbrm8IXOmV+ggWHOTEbjwyCf2xZlUMv5npExksXohL+tk8va4Fjhb+X2+Rt9NBmgO7bJ8WpnMLOwih/DnMlFA==", "dev": true, "license": "MIT", "dependencies": { @@ -6243,12 +5450,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6299,15 +5500,6 @@ "node": ">=14.17" } }, - "node_modules/undici": { - "version": "6.19.7", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.7.tgz", - "integrity": "sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A==", - "license": "MIT", - "engines": { - "node": ">=18.17" - } - }, "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", @@ -6399,29 +5591,6 @@ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, - "node_modules/websocket-driver": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", - "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", - "license": "Apache-2.0", - "dependencies": { - "http-parser-js": ">=0.5.1", - "safe-buffer": ">=5.1.0", - "websocket-extensions": ">=0.1.1" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/websocket-extensions": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", - "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -6534,6 +5703,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, "license": "ISC", "engines": { "node": ">=12" diff --git a/src/augmentations/firestoreStorageAugmentation.ts b/src/augmentations/firestoreStorageAugmentation.ts deleted file mode 100644 index e21bf01b..00000000 --- a/src/augmentations/firestoreStorageAugmentation.ts +++ /dev/null @@ -1,389 +0,0 @@ -import { - AugmentationType, - IMemoryAugmentation, - AugmentationResponse -} from '../types/augmentations.js' -import { Vector } from '../coreTypes.js' -import { cosineDistance } from '../utils/distance.js' - -// TEMPORARILY COMMENTED OUT: Firebase imports -// import { initializeApp, getApp } from 'firebase/app' -// import { -// getFirestore, -// collection, -// doc, -// setDoc, -// getDoc, -// updateDoc, -// deleteDoc, -// query, -// getDocs, -// limit -// } from 'firebase/firestore' -// import { findNearest } from '@firebase/firestore-vector-search' - -/** - * Configuration for Firestore storage augmentation - */ -export interface FirestoreStorageConfig { - /** - * Firestore project ID - */ - projectId: string - - /** - * Firestore collection name for storing data - */ - collection: string - - /** - * Optional Firestore credentials - */ - credentials?: any - - /** - * Optional Firestore database URL - */ - databaseURL?: string - - /** - * Optional Firestore app name - */ - appName?: string -} - -/** - * Storage augmentation that uses Firestore for storage - */ -export class FirestoreStorageAugmentation implements IMemoryAugmentation { - readonly name: string - readonly description: string = 'Storage augmentation that stores data in Firestore' - enabled: boolean = true - private config: FirestoreStorageConfig - private isInitialized = false - private firestore: any = null - private collection: any = null - - constructor(name: string, config: FirestoreStorageConfig) { - this.name = name - this.config = config - } - - getType(): AugmentationType { - return AugmentationType.MEMORY - } - - async initialize(): Promise { - if (this.isInitialized) { - return - } - - try { - // TEMPORARILY COMMENTED OUT: Firebase initialization - /* - // Initialize Firebase if not already initialized - let app - try { - app = getApp(this.config.appName || '[DEFAULT]') - } catch (e) { - // App doesn't exist, initialize it - // Create a config object with the required properties - const firebaseConfig: any = { - projectId: this.config.projectId - } - - // Add optional properties if they exist - if (this.config.databaseURL) { - firebaseConfig.databaseURL = this.config.databaseURL - } - - // Add credentials if they exist - if (this.config.credentials) { - // Use credentials as part of the config object - // instead of as a 'credential' property - Object.assign(firebaseConfig, this.config.credentials) - } - - app = initializeApp(firebaseConfig, this.config.appName) - } - - // Get Firestore instance - this.firestore = getFirestore(app) - this.collection = collection(this.firestore, this.config.collection) - */ - - console.log(`FirestoreStorageAugmentation '${this.name}' initialization temporarily disabled`) - this.isInitialized = true - } catch (error) { - console.error(`Failed to initialize FirestoreStorageAugmentation:`, error) - throw new Error(`Failed to initialize FirestoreStorageAugmentation: ${error}`) - } - } - - async shutDown(): Promise { - this.isInitialized = false - this.firestore = null - this.collection = null - } - - async getStatus(): Promise<'active' | 'inactive' | 'error'> { - if (!this.isInitialized) { - return 'inactive' - } - - // TEMPORARILY COMMENTED OUT: Firebase status check - /* - try { - // Try a simple operation to check if Firestore is working - await getDocs(query(collection(this.firestore, '__test__'), limit(1))) - return 'active' - } catch (error) { - console.error('Firestore connection error:', error) - return 'error' - } - */ - - console.log('Firebase status check temporarily disabled') - return 'inactive' - } - - async storeData( - key: string, - data: unknown, - options?: Record - ): Promise> { - await this.ensureInitialized() - - // TEMPORARILY COMMENTED OUT: Firebase store operation - /* - try { - await setDoc(doc(this.collection, key), this.prepareForFirestore(data)) - return { success: true, data: true } - } catch (error) { - console.error(`Failed to store data for key ${key}:`, error) - return { - success: false, - data: false, - error: `Failed to store data: ${error}` - } - } - */ - - console.log(`Firebase store operation temporarily disabled for key: ${key}`) - return { - success: false, - data: false, - error: 'Firebase functionality temporarily disabled' - } - } - - async retrieveData( - key: string, - options?: Record - ): Promise> { - await this.ensureInitialized() - - // TEMPORARILY COMMENTED OUT: Firebase retrieve operation - /* - try { - const docSnapshot = await getDoc(doc(this.collection, key)) - - if (!docSnapshot.exists()) { - return { - success: true, - data: null - } - } - - return { - success: true, - data: docSnapshot.data() - } - } catch (error) { - console.error(`Failed to retrieve data for key ${key}:`, error) - return { - success: false, - data: null, - error: `Failed to retrieve data: ${error}` - } - } - */ - - console.log(`Firebase retrieve operation temporarily disabled for key: ${key}`) - return { - success: false, - data: null, - error: 'Firebase functionality temporarily disabled' - } - } - - async updateData( - key: string, - data: unknown, - options?: Record - ): Promise> { - await this.ensureInitialized() - - // TEMPORARILY COMMENTED OUT: Firebase update operation - /* - try { - await updateDoc(doc(this.collection, key), this.prepareForFirestore(data)) - return { success: true, data: true } - } catch (error) { - console.error(`Failed to update data for key ${key}:`, error) - return { - success: false, - data: false, - error: `Failed to update data: ${error}` - } - } - */ - - console.log(`Firebase update operation temporarily disabled for key: ${key}`) - return { - success: false, - data: false, - error: 'Firebase functionality temporarily disabled' - } - } - - async deleteData( - key: string, - options?: Record - ): Promise> { - await this.ensureInitialized() - - // TEMPORARILY COMMENTED OUT: Firebase delete operation - /* - try { - await deleteDoc(doc(this.collection, key)) - return { success: true, data: true } - } catch (error) { - console.error(`Failed to delete data for key ${key}:`, error) - return { - success: false, - data: false, - error: `Failed to delete data: ${error}` - } - } - */ - - console.log(`Firebase delete operation temporarily disabled for key: ${key}`) - return { - success: false, - data: false, - error: 'Firebase functionality temporarily disabled' - } - } - - async listDataKeys( - pattern?: string, - options?: Record - ): Promise> { - await this.ensureInitialized() - - // TEMPORARILY COMMENTED OUT: Firebase list operation - console.log(`Firebase list operation temporarily disabled for pattern: ${pattern || 'none'}`) - return { - success: false, - data: [], - error: 'Firebase functionality temporarily disabled' - } - } - - /** - * Searches for data in Firestore using vector similarity. - * Uses Firestore's built-in findNearest function for efficient vector search. - * - * TEMPORARILY COMMENTED OUT: Firebase vector search - * - * @param queryData The query vector or data to search for - * @param k Number of results to return (default: 10) - * @param options Optional search options - */ - async search( - queryData: unknown, - k: number = 10, - options?: Record - ): Promise>> { - await this.ensureInitialized() - - // TEMPORARILY COMMENTED OUT: Firebase vector search - console.log(`Firebase vector search temporarily disabled`) - return { - success: false, - data: [], - error: 'Firebase functionality temporarily disabled' - } - } - - private async ensureInitialized(): Promise { - if (!this.isInitialized) { - await this.initialize() - } - } - - /** - * Prepare data for Firestore by handling special types - */ - private prepareForFirestore(obj: any): any { - if (obj === null || obj === undefined) { - return null - } - - if ( - typeof obj === 'string' || - typeof obj === 'number' || - typeof obj === 'boolean' - ) { - return obj - } - - if (obj instanceof Date) { - return obj - } - - if (Array.isArray(obj)) { - return obj.map(item => this.prepareForFirestore(item)) - } - - if (obj instanceof Map) { - const result: Record = {} - for (const [key, value] of obj.entries()) { - result[String(key)] = this.prepareForFirestore(value) - } - return result - } - - if (obj instanceof Set) { - return Array.from(obj).map(item => this.prepareForFirestore(item)) - } - - if (typeof obj === 'object') { - const result: Record = {} - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - result[key] = this.prepareForFirestore(obj[key]) - } - } - return result - } - - // Default fallback - return null - } -} - -/** - * Create a Firestore storage augmentation - */ -export function createFirestoreStorageAugmentation( - name: string, - config: FirestoreStorageConfig -): IMemoryAugmentation { - return new FirestoreStorageAugmentation(name, config) -} diff --git a/src/augmentations/firestoreSyncAugmentation.ts b/src/augmentations/firestoreSyncAugmentation.ts deleted file mode 100644 index 6f3b8c28..00000000 --- a/src/augmentations/firestoreSyncAugmentation.ts +++ /dev/null @@ -1,538 +0,0 @@ -/** - * FirestoreSync Conduit Augmentation - * - * This augmentation allows for syncing data to Firestore either one-way or two-way. - * One-way sync: Data is only pushed from Brainy to Firestore - * Two-way sync: Data is synchronized between Brainy and Firestore in both directions - * - * Note: This augmentation requires Firebase to be installed as a dependency. - * Install with: npm install firebase - * - * TEMPORARILY COMMENTED OUT: All Firebase/Firestore functionality - */ - -import { - AugmentationType, - IConduitAugmentation, - AugmentationResponse, - WebSocketConnection -} from '../types/augmentations.js' -import { HNSWNode, Edge } from '../coreTypes.js' - -// Firebase imports will be dynamically loaded to avoid dependency issues -// TEMPORARILY COMMENTED OUT: Firebase imports -// let firebase: any = null -// let firestore: any = null - -/** - * Configuration for FirestoreSync augmentation - */ -export interface FirestoreSyncConfig { - /** Firebase configuration object */ - firebaseConfig: { - apiKey: string - authDomain: string - projectId: string - storageBucket?: string - messagingSenderId?: string - appId: string - } - /** Collection name for nodes in Firestore */ - nodesCollection: string - /** Collection name for edges in Firestore */ - edgesCollection: string - /** Collection name for metadata in Firestore */ - metadataCollection: string - /** Sync mode: 'one-way' (Brainy -> Firestore) or 'two-way' (bidirectional) */ - syncMode: 'one-way' | 'two-way' - /** Sync interval in milliseconds (for two-way sync) */ - syncInterval?: number -} - -/** - * FirestoreSync Conduit Augmentation - * Allows for syncing data to Firestore either one-way or two-way - */ -export class FirestoreSyncAugmentation implements IConduitAugmentation { - readonly name: string - readonly description: string - enabled: boolean - private config: FirestoreSyncConfig - private isInitialized: boolean = false - private db: any = null - private syncIntervalId: NodeJS.Timeout | null = null - private lastSyncTimestamp: number = 0 - - constructor(name: string, config: FirestoreSyncConfig) { - this.name = name - this.description = 'Syncs data between Brainy and Firestore' - this.enabled = true - this.config = config - } - - /** - * Initialize the augmentation - * - * TEMPORARILY COMMENTED OUT: Firebase initialization - */ - async initialize(): Promise { - if (this.isInitialized) { - return - } - - try { - // TEMPORARILY COMMENTED OUT: Firebase initialization - /* - // Dynamically import Firebase - try { - const firebaseModule = await import('firebase/app') - const firestoreModule = await import('firebase/firestore') - - firebase = firebaseModule.default || firebaseModule - firestore = firestoreModule - } catch (importError) { - throw new Error(`Failed to import Firebase modules: ${importError}. Please install Firebase with: npm install firebase`) - } - - // Initialize Firebase - const app = firebase.initializeApp(this.config.firebaseConfig, this.name) - this.db = firebase.firestore(app) - - // Set up two-way sync if configured - if (this.config.syncMode === 'two-way' && this.config.syncInterval) { - this.startSyncInterval() - } - */ - - this.isInitialized = true - console.log(`FirestoreSync augmentation '${this.name}' initialized successfully (Firebase functionality temporarily disabled)`) - } catch (error) { - console.error(`Failed to initialize FirestoreSync augmentation: ${error}`) - throw new Error(`Failed to initialize FirestoreSync augmentation: ${error}`) - } - } - - /** - * Shut down the augmentation - * - * TEMPORARILY COMMENTED OUT: Firebase shutdown - */ - async shutDown(): Promise { - if (this.syncIntervalId) { - clearInterval(this.syncIntervalId) - this.syncIntervalId = null - } - - // TEMPORARILY COMMENTED OUT: Firebase shutdown - /* - if (firebase && this.isInitialized) { - await firebase.app(this.name).delete() - } - */ - - this.isInitialized = false - console.log(`FirestoreSync augmentation '${this.name}' shut down successfully`) - } - - /** - * Get the status of the augmentation - */ - async getStatus(): Promise<'active' | 'inactive' | 'error'> { - if (!this.enabled) { - return 'inactive' - } - - if (!this.isInitialized) { - return 'error' - } - - return 'active' - } - - /** - * Establish a connection to Firestore - * - * TEMPORARILY COMMENTED OUT: Firebase connection - */ - establishConnection( - targetSystemId: string, - config: Record - ): AugmentationResponse { - // TEMPORARILY COMMENTED OUT: Firebase connection - /* - // Ensure initialization happens before returning - this.ensureInitialized().catch(error => { - console.error(`Error initializing during establishConnection: ${error}`) - }) - */ - - try { - // For Firestore, the connection is already established during initialization - // This method is mainly for compatibility with the IConduitAugmentation interface - return { - success: true, - data: { - connectionId: targetSystemId, - url: `Firebase connection temporarily disabled`, - status: 'disabled' - } - } - } catch (error) { - return { - success: false, - data: { - connectionId: targetSystemId, - url: '', - status: 'error' - }, - error: `Failed to establish connection: ${error}` - } - } - } - - /** - * Read data from Firestore - */ - readData( - query: Record, - options?: Record - ): AugmentationResponse { - // This is a synchronous wrapper around an async operation - // We'll start the async operation but return a placeholder response immediately - - // Ensure we're initialized - this.ensureInitialized().catch(error => { - console.error(`Error initializing during readData: ${error}`) - }) - - try { - // Return a placeholder response - // In a real implementation, this would need to be redesigned to work synchronously - // or the interface would need to be updated to allow for Promise returns - return { - success: true, - data: { - message: "Reading data from Firestore (placeholder response)", - query: query, - options: options - } - } - } catch (error) { - return { - success: false, - data: {}, - error: `Failed to read data: ${error}` - } - } - } - - /** - * Write data to Firestore - */ - writeData( - data: Record, - options?: Record - ): AugmentationResponse { - // This is a synchronous wrapper around an async operation - // We'll start the async operation but return a placeholder response immediately - - // Ensure we're initialized - this.ensureInitialized().catch(error => { - console.error(`Error initializing during writeData: ${error}`) - }) - - try { - // Extract the ID if available for the response - const id = data.id as string || 'unknown-id' - - // Start the async operation in the background - // In a real implementation, this would need to be redesigned to work synchronously - // or the interface would need to be updated to allow for Promise returns - setTimeout(() => { - this.writeDataAsync(data, options).catch(error => { - console.error(`Error in background writeData: ${error}`) - }) - }, 0) - - return { - success: true, - data: { - id, - message: "Writing data to Firestore (operation started in background)", - status: "pending" - } - } - } catch (error) { - return { - success: false, - data: {}, - error: `Failed to write data: ${error}` - } - } - } - - // Private async method to actually perform the write operation - // TEMPORARILY COMMENTED OUT: Firebase write operation - private async writeDataAsync( - data: Record, - options?: Record - ): Promise { - await this.ensureInitialized() - - try { - const { collection, id, document } = data as { - collection: string, - id: string, - document: Record - } - - // TEMPORARILY COMMENTED OUT: Firebase write operation - /* - // Prepare the document for Firestore - // Convert Maps and Sets to arrays or objects for Firestore compatibility - const firestoreDoc = this.prepareForFirestore(document) - - // Add timestamp for sync tracking - firestoreDoc._lastUpdated = firebase.firestore.FieldValue.serverTimestamp() - firestoreDoc._source = 'brainy' - - // Write to Firestore - await this.db.collection(collection).doc(id).set(firestoreDoc, { merge: true }) - */ - - console.log(`Firebase write operation temporarily disabled: ${collection}/${id}`) - } catch (error) { - console.error(`Failed to write data: ${error}`) - throw error - } - } - - /** - * Monitor a data stream in Firestore - * - * TEMPORARILY COMMENTED OUT: Firebase monitoring - */ - async monitorStream(streamId: string, callback: (data: unknown) => void): Promise { - await this.ensureInitialized() - - try { - // TEMPORARILY COMMENTED OUT: Firebase monitoring - /* - // Set up a listener for changes in the specified collection - const unsubscribe = this.db.collection(streamId) - .where('_lastUpdated', '>', new Date(this.lastSyncTimestamp)) - .where('_source', '==', 'firestore') // Only listen for changes from Firestore - .onSnapshot((snapshot: any) => { - const changes = snapshot.docChanges() - - for (const change of changes) { - const data = this.convertFirestoreDocToObject(change.doc) - callback({ - type: change.type, // 'added', 'modified', or 'removed' - data - }) - } - - // Update last sync timestamp - this.lastSyncTimestamp = Date.now() - }) - - // Return the unsubscribe function wrapped in a Promise - return Promise.resolve(unsubscribe) - */ - - console.log(`Firebase monitoring temporarily disabled for stream: ${streamId}`) - return Promise.resolve(() => { - console.log('Unsubscribe function (placeholder - Firebase temporarily disabled)') - }) - } catch (error) { - console.error(`Failed to monitor stream: ${error}`) - throw new Error(`Failed to monitor stream: ${error}`) - } - } - - /** - * Sync a node to Firestore - * - * TEMPORARILY COMMENTED OUT: Firebase sync - */ - async syncNodeToFirestore(node: HNSWNode): Promise { - await this.ensureInitialized() - - try { - // TEMPORARILY COMMENTED OUT: Firebase sync - /* - const firestoreNode = this.prepareForFirestore(node) - firestoreNode._lastUpdated = firebase.firestore.FieldValue.serverTimestamp() - firestoreNode._source = 'brainy' - - await this.db.collection(this.config.nodesCollection).doc(node.id).set(firestoreNode, { merge: true }) - */ - console.log(`Firebase sync temporarily disabled for node: ${node.id}`) - } catch (error) { - console.error(`Failed to sync node: ${error}`) - throw new Error(`Failed to sync node: ${error}`) - } - } - - /** - * Sync an edge to Firestore - * - * TEMPORARILY COMMENTED OUT: Firebase sync - */ - async syncEdgeToFirestore(edge: Edge): Promise { - await this.ensureInitialized() - - try { - // TEMPORARILY COMMENTED OUT: Firebase sync - /* - const firestoreEdge = this.prepareForFirestore(edge) - firestoreEdge._lastUpdated = firebase.firestore.FieldValue.serverTimestamp() - firestoreEdge._source = 'brainy' - - await this.db.collection(this.config.edgesCollection).doc(edge.id).set(firestoreEdge, { merge: true }) - */ - console.log(`Firebase sync temporarily disabled for edge: ${edge.id}`) - } catch (error) { - console.error(`Failed to sync edge: ${error}`) - throw new Error(`Failed to sync edge: ${error}`) - } - } - - /** - * Sync metadata to Firestore - * - * TEMPORARILY COMMENTED OUT: Firebase sync - */ - async syncMetadataToFirestore(id: string, metadata: any): Promise { - await this.ensureInitialized() - - try { - // TEMPORARILY COMMENTED OUT: Firebase sync - /* - const firestoreMetadata = this.prepareForFirestore(metadata) - firestoreMetadata._lastUpdated = firebase.firestore.FieldValue.serverTimestamp() - firestoreMetadata._source = 'brainy' - - await this.db.collection(this.config.metadataCollection).doc(id).set(firestoreMetadata, { merge: true }) - */ - console.log(`Firebase sync temporarily disabled for metadata: ${id}`) - } catch (error) { - console.error(`Failed to sync metadata: ${error}`) - throw new Error(`Failed to sync metadata: ${error}`) - } - } - - /** - * Start the sync interval for two-way sync - * - * TEMPORARILY COMMENTED OUT: Firebase sync interval - */ - private startSyncInterval(): void { - if (this.syncIntervalId) { - clearInterval(this.syncIntervalId) - } - - this.lastSyncTimestamp = Date.now() - - // TEMPORARILY COMMENTED OUT: Firebase sync interval - /* - this.syncIntervalId = setInterval(async () => { - if (!this.enabled || !this.isInitialized) { - return - } - - try { - // Sync from Firestore to Brainy - await this.syncFromFirestore() - } catch (error) { - console.error(`Error during two-way sync: ${error}`) - } - }, this.config.syncInterval || 60000) // Default to 1 minute if not specified - */ - - console.log('Firebase sync interval temporarily disabled') - } - - /** - * Sync data from Firestore to Brainy - * - * TEMPORARILY COMMENTED OUT: Firebase sync - */ - private async syncFromFirestore(): Promise { - // TEMPORARILY COMMENTED OUT: Firebase sync - /* - // This would typically call back to the Brainy system to update its data - // For now, we'll just log that it would happen - console.log('Syncing data from Firestore to Brainy (not implemented yet)') - - // In a real implementation, this would: - // 1. Query Firestore for documents updated since lastSyncTimestamp - // 2. For each document, update the corresponding data in Brainy - // 3. Update lastSyncTimestamp - */ - - console.log('Firebase sync from Firestore temporarily disabled') - } - - /** - * Ensure the augmentation is initialized - */ - private async ensureInitialized(): Promise { - if (!this.isInitialized) { - await this.initialize() - } - } - - /** - * Convert a Firestore document to a plain JavaScript object - */ - private convertFirestoreDocToObject(doc: any): any { - const data = doc.data() - return { - id: doc.id, - ...data - } - } - - /** - * Prepare an object for Firestore by converting Maps and Sets - */ - private prepareForFirestore(obj: any): any { - if (obj === null || typeof obj !== 'object') { - return obj - } - - if (Array.isArray(obj)) { - return obj.map(item => this.prepareForFirestore(item)) - } - - if (obj instanceof Map) { - const result: Record = {} - for (const [key, value] of obj.entries()) { - result[key] = this.prepareForFirestore(value) - } - return result - } - - if (obj instanceof Set) { - return Array.from(obj).map(item => this.prepareForFirestore(item)) - } - - const result: Record = {} - for (const [key, value] of Object.entries(obj)) { - result[key] = this.prepareForFirestore(value) - } - return result - } -} - -/** - * Create and register a FirestoreSync augmentation - */ -export function createFirestoreSyncAugmentation( - name: string, - config: FirestoreSyncConfig -): FirestoreSyncAugmentation { - return new FirestoreSyncAugmentation(name, config) -} diff --git a/src/augmentations/memoryAugmentations.ts b/src/augmentations/memoryAugmentations.ts index dfe39f78..9ec7e86b 100644 --- a/src/augmentations/memoryAugmentations.ts +++ b/src/augmentations/memoryAugmentations.ts @@ -8,11 +8,6 @@ import { MemoryStorage } from '../storage/opfsStorage.js' import { FileSystemStorage } from '../storage/fileSystemStorage.js' import { OPFSStorage } from '../storage/opfsStorage.js' import { cosineDistance } from '../utils/distance.js' -import { - FirestoreStorageAugmentation, - FirestoreStorageConfig, - createFirestoreStorageAugmentation -} from './firestoreStorageAugmentation.js' /** * Base class for memory augmentations that wrap a StorageAdapter @@ -292,10 +287,9 @@ export class OPFSStorageAugmentation extends BaseMemoryAugmentation { export async function createMemoryAugmentation( name: string, options: { - storageType?: 'memory' | 'filesystem' | 'opfs' | 'firestore' + storageType?: 'memory' | 'filesystem' | 'opfs' rootDirectory?: string requestPersistentStorage?: boolean - firestoreConfig?: FirestoreStorageConfig } = {} ): Promise { // If a specific storage type is requested, use that @@ -307,11 +301,6 @@ export async function createMemoryAugmentation( return new FileSystemStorageAugmentation(name, options.rootDirectory) case 'opfs': return new OPFSStorageAugmentation(name) - case 'firestore': - if (!options.firestoreConfig) { - throw new Error('firestoreConfig is required when using Firestore storage') - } - return createFirestoreStorageAugmentation(name, options.firestoreConfig) } } diff --git a/src/index.ts b/src/index.ts index 416bf15f..9d7afc15 100644 --- a/src/index.ts +++ b/src/index.ts @@ -116,22 +116,12 @@ import { OPFSStorageAugmentation, createMemoryAugmentation } from './augmentations/memoryAugmentations.js' -import { - FirestoreStorageAugmentation, - createFirestoreStorageAugmentation -} from './augmentations/firestoreStorageAugmentation.js' -import type { FirestoreStorageConfig } from './augmentations/firestoreStorageAugmentation.js' export { MemoryStorageAugmentation, FileSystemStorageAugmentation, OPFSStorageAugmentation, - FirestoreStorageAugmentation, - createMemoryAugmentation, - createFirestoreStorageAugmentation -} -export type { - FirestoreStorageConfig + createMemoryAugmentation } diff --git a/src/types/augmentations.ts b/src/types/augmentations.ts index e2012dcd..0fa0aedc 100644 --- a/src/types/augmentations.ts +++ b/src/types/augmentations.ts @@ -187,7 +187,7 @@ export namespace BrainyAugmentations { /** * Interface for Memory augmentations. - * These augmentations provide storage capabilities for data in different formats (e.g., fileSystem, in-memory, or firestore). + * These augmentations provide storage capabilities for data in different formats (e.g., fileSystem, in-memory). */ export interface IMemoryAugmentation extends IAugmentation { /** diff --git a/src/types/firebase-vector-search.d.ts b/src/types/firebase-vector-search.d.ts deleted file mode 100644 index 1f6d5ff7..00000000 --- a/src/types/firebase-vector-search.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// TEMPORARILY COMMENTED OUT: Firebase vector search type declarations -/* -declare module '@firebase/firestore-vector-search' { - interface VectorSearchOptions { - collection: any; - vectorField: string; - queryVector: number[]; - limit: number; - distanceMeasure?: string; - } - - interface VectorSearchResult { - id: string; - data: any; - distance?: number; - } - - export function findNearest(options: VectorSearchOptions): Promise; -} -*/