@naylence/runtime 0.3.5-test.7 → 0.3.5-test.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.
@@ -3333,6 +3333,7 @@ const ENV_VAR_STORAGE_DB_DIRECTORY = 'FAME_STORAGE_DB_DIRECTORY';
3333
3333
  const ENV_VAR_STORAGE_MASTER_KEY = 'FAME_STORAGE_MASTER_KEY';
3334
3334
  const ENV_VAR_STORAGE_ENCRYPTED = 'FAME_STORAGE_ENCRYPTED';
3335
3335
  const PROFILE_NAME_MEMORY = 'memory';
3336
+ const PROFILE_NAME_INDEXEDDB = 'indexeddb';
3336
3337
  const PROFILE_NAME_SQLITE = 'sqlite';
3337
3338
  const PROFILE_NAME_ENCRYPTED_SQLITE = 'encrypted-sqlite';
3338
3339
  const storageProfileSchema = zod.z
@@ -3341,12 +3342,15 @@ const storageProfileSchema = zod.z
3341
3342
  profile: zod.z
3342
3343
  .string()
3343
3344
  .optional()
3344
- .describe('Storage profile name (memory | sqlite | encrypted-sqlite)'),
3345
+ .describe('Storage profile name (memory | indexeddb | sqlite | encrypted-sqlite)'),
3345
3346
  })
3346
3347
  .passthrough();
3347
3348
  const MEMORY_PROFILE_CONFIG = {
3348
3349
  type: 'InMemoryStorageProvider',
3349
3350
  };
3351
+ const INDEXEDDB_PROFILE_CONFIG = {
3352
+ type: 'IndexedDBStorageProvider',
3353
+ };
3350
3354
  const SQLITE_PROFILE_CONFIG = {
3351
3355
  type: 'SQLiteStorageProvider',
3352
3356
  dbDirectory: factory.Expressions.env(ENV_VAR_STORAGE_DB_DIRECTORY, './data/sqlite'),
@@ -3361,11 +3365,21 @@ const ENCRYPTED_SQLITE_PROFILE_CONFIG = {
3361
3365
  masterKey: factory.Expressions.env(ENV_VAR_STORAGE_MASTER_KEY),
3362
3366
  isCached: true,
3363
3367
  };
3364
- const PROFILE_MAP$1 = {
3368
+ // Base profile map with browser-safe options
3369
+ const BASE_PROFILE_MAP = {
3365
3370
  [PROFILE_NAME_MEMORY]: MEMORY_PROFILE_CONFIG,
3366
- [PROFILE_NAME_SQLITE]: SQLITE_PROFILE_CONFIG,
3367
- [PROFILE_NAME_ENCRYPTED_SQLITE]: ENCRYPTED_SQLITE_PROFILE_CONFIG,
3371
+ [PROFILE_NAME_INDEXEDDB]: INDEXEDDB_PROFILE_CONFIG,
3368
3372
  };
3373
+ // Extended profile map - can be augmented by Node.js environment
3374
+ const PROFILE_MAP$1 = {
3375
+ ...BASE_PROFILE_MAP,
3376
+ };
3377
+ // Register SQLite profiles if we're in Node.js environment
3378
+ // This check allows the code to work in both browser and Node.js
3379
+ if (typeof process !== 'undefined' && process.versions?.node) {
3380
+ PROFILE_MAP$1[PROFILE_NAME_SQLITE] = SQLITE_PROFILE_CONFIG;
3381
+ PROFILE_MAP$1[PROFILE_NAME_ENCRYPTED_SQLITE] = ENCRYPTED_SQLITE_PROFILE_CONFIG;
3382
+ }
3369
3383
  class StorageProfileFactory extends StorageProviderFactory {
3370
3384
  constructor() {
3371
3385
  super(...arguments);