ngx-indexed-db 20.0.1 → 21.0.0

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.
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, isDevMode, Inject, Injectable, assertInInjectionContext, inject, PLATFORM_ID, makeEnvironmentProviders, NgModule } from '@angular/core';
2
+ import { InjectionToken, isDevMode, Inject, Injectable, assertInInjectionContext, inject, PLATFORM_ID, DOCUMENT, makeEnvironmentProviders, NgModule } from '@angular/core';
3
3
  import { __decorate } from 'tslib';
4
4
  import { Observable, from, combineLatest } from 'rxjs';
5
5
  import { finalize, take } from 'rxjs/operators';
6
- import { isPlatformBrowser, DOCUMENT } from '@angular/common';
6
+ import { isPlatformBrowser } from '@angular/common';
7
7
 
8
8
  var DBMode;
9
9
  (function (DBMode) {
@@ -309,9 +309,7 @@ class NgxIndexedDBService {
309
309
  const key = value.key;
310
310
  delete value.key;
311
311
  const hasKey = Boolean(key);
312
- const request = hasKey
313
- ? objectStore.add(value, key)
314
- : objectStore.add(value);
312
+ const request = hasKey ? objectStore.add(value, key) : objectStore.add(value);
315
313
  request.onsuccess = (evt) => {
316
314
  const result = evt.target.result;
317
315
  resolve1(result);
@@ -569,12 +567,12 @@ class NgxIndexedDBService {
569
567
  });
570
568
  }
571
569
  /**
572
- * Delete all items by an index.
573
- * @param storeName The name of the store to query
574
- * @param indexName The index name to filter
575
- * @param query The key or key range criteria to apply
576
- * @param direction A string telling the cursor which direction to travel.
577
- */
570
+ * Delete all items by an index.
571
+ * @param storeName The name of the store to query
572
+ * @param indexName The index name to filter
573
+ * @param query The key or key range criteria to apply
574
+ * @param direction A string telling the cursor which direction to travel.
575
+ */
578
576
  deleteAllByIndex(storeName, indexName, query, direction) {
579
577
  return new Observable((obs) => {
580
578
  openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)
@@ -840,8 +838,8 @@ class NgxIndexedDBService {
840
838
  .catch((reason) => obs.error(reason));
841
839
  });
842
840
  }
843
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBService, deps: [{ token: CONFIG_TOKEN }, { token: INDEXED_DB }], target: i0.ɵɵFactoryTarget.Injectable }); }
844
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBService }); }
841
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBService, deps: [{ token: CONFIG_TOKEN }, { token: INDEXED_DB }], target: i0.ɵɵFactoryTarget.Injectable }); }
842
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBService }); }
845
843
  }
846
844
  __decorate([
847
845
  CloseDbConnection()
@@ -912,7 +910,7 @@ __decorate([
912
910
  __decorate([
913
911
  CloseDbConnection()
914
912
  ], NgxIndexedDBService.prototype, "getAllObjectStoreNames", null);
915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBService, decorators: [{
913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBService, decorators: [{
916
914
  type: Injectable
917
915
  }], ctorParameters: () => [{ type: undefined, decorators: [{
918
916
  type: Inject,
@@ -992,11 +990,11 @@ class NgxIndexedDBModule {
992
990
  providers: [..._provideIndexedDb(...dbConfigs)],
993
991
  };
994
992
  }
995
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
996
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBModule }); }
997
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBModule }); }
993
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
994
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBModule }); }
995
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBModule }); }
998
996
  }
999
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: NgxIndexedDBModule, decorators: [{
997
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: NgxIndexedDBModule, decorators: [{
1000
998
  type: NgModule
1001
999
  }] });
1002
1000
 
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-indexed-db.mjs","sources":["../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.meta.ts","../../../projects/ngx-indexed-db/src/utils/index.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts","../../../projects/ngx-indexed-db/src/lib/decorators.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts","../../../projects/ngx-indexed-db/src/ssr/server-indexed-db.ts","../../../projects/ngx-indexed-db/src/ssr/index.ts","../../../projects/ngx-indexed-db/src/lib/provide-indexed-db.ts","../../../projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts","../../../projects/ngx-indexed-db/src/ngx-indexed-db.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface DBConfig {\n name: string;\n version?: number;\n objectStoresMeta: ObjectStoreMeta[];\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void };\n isDefault?: boolean;\n}\n\nexport interface ObjectStoreMeta {\n store: string;\n storeConfig: { keyPath: string | string[]; autoIncrement: boolean; [key: string]: any };\n storeSchema: ObjectStoreSchema[];\n}\n\nexport interface ObjectStoreSchema {\n name: string;\n keypath: string | string[];\n options: { unique: boolean; [key: string]: any };\n}\n\nexport interface IndexDetails {\n indexName: string;\n order: string;\n}\n\nexport interface RequestEvent<T> extends Event {\n target: RequestEventTarget<T>;\n}\n\nexport interface RequestEventTarget<T> extends EventTarget {\n result: T | T[];\n}\n\nexport enum DBMode {\n readonly = 'readonly',\n readwrite = 'readwrite',\n}\n\nexport type WithID = { id: number };\n\nexport type IndexKey<P extends IDBValidKey, K extends IDBValidKey> = {\n readonly primaryKey: P;\n readonly key: K;\n};\n\ntype Modify<T, R> = Omit<T, keyof R> & R;\n\nexport type NgxIDBCursor<P extends IDBValidKey, K extends IDBValidKey, V = any> = Modify<\n IDBCursor,\n { key: K; primaryKey: P; update(value: V): IDBRequest<IDBValidKey> }\n>;\n\nexport type NgxIDBCursorWithValue<\n V = any,\n P extends IDBValidKey = IDBValidKey,\n K extends IDBValidKey = IDBValidKey\n> = NgxIDBCursor<P, K, V> & { value: V };\n\nexport const CONFIG_TOKEN = new InjectionToken<Record<string, DBConfig>>(null);\nexport const INDEXED_DB = new InjectionToken<IDBFactory>('Indexed DB');\n/**\n * Token used to inject the indexed db implementation on the server\n */\nexport const SERVER_INDEXED_DB = new InjectionToken<IDBFactory>('Server Indexed DB');\n","export interface Options {\n storeName: string;\n dbMode: IDBTransactionMode;\n error: (e: Event) => any;\n complete?: (e: Event) => any;\n abort?: any;\n}\n\nexport function validateStoreName(db: IDBDatabase, storeName: string): boolean {\n return db.objectStoreNames.contains(storeName);\n}\n\nexport function validateBeforeTransaction(db: IDBDatabase, storeName: string, reject: (message: string) => void): void {\n if (!db) {\n reject('You need to use the openDatabase function to create a database before you query it!');\n return; // Stop further execution\n }\n if (!validateStoreName(db, storeName)) {\n reject(`objectStore does not exists: ${storeName}`);\n }\n}\n\nexport function createTransaction(db: IDBDatabase, options: Options): IDBTransaction {\n const trans: IDBTransaction = db.transaction(options.storeName, options.dbMode);\n trans.onerror = options.error;\n trans.onabort = options.abort;\n return trans;\n}\n\nexport function optionsGenerator(\n type: any,\n storeName: any,\n reject: (reason?: any) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resolve?: (e: any) => void\n): Options {\n return {\n storeName,\n dbMode: type,\n error: (e: Event) => {\n reject(e);\n },\n abort: (e: Event) => {\n reject(e);\n },\n };\n}\n","import { ObjectStoreMeta } from './ngx-indexed-db.meta';\nimport { Observable } from 'rxjs';\n\nexport const openedDatabases: IDBDatabase[] = [];\n\nexport function openDatabase(\n indexedDB: IDBFactory,\n dbName: string,\n version?: number,\n upgradeCallback?: (a: Event, b: IDBDatabase) => void\n): Promise<IDBDatabase> {\n return new Promise<IDBDatabase>((resolve, reject) => {\n if (!indexedDB) {\n reject('IndexedDB not available');\n }\n const request = indexedDB.open(dbName, version);\n let db: IDBDatabase;\n request.onsuccess = () => {\n db = request.result;\n openedDatabases.push(db);\n resolve(db);\n };\n request.onerror = () => {\n reject(`IndexedDB error: ${request.error}`);\n };\n if (typeof upgradeCallback === 'function') {\n request.onupgradeneeded = (event: Event) => {\n upgradeCallback(event, db);\n };\n }\n });\n}\n\nexport async function CreateObjectStore(\n indexedDB: IDBFactory,\n dbName: string,\n version: number,\n storeSchemas: ObjectStoreMeta[],\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n if (!indexedDB) {\n return;\n }\n const request: IDBOpenDBRequest = indexedDB.open(dbName, version);\n request.onupgradeneeded = async (event: IDBVersionChangeEvent) => {\n const database: IDBDatabase = (event.target as any).result;\n\n const storeCreationPromises = storeSchemas.map(async (storeSchema) => {\n if (!database.objectStoreNames.contains(storeSchema.store)) {\n const objectStore = database.createObjectStore(storeSchema.store, storeSchema.storeConfig);\n for (const schema of storeSchema.storeSchema) {\n objectStore.createIndex(schema.name, schema.keypath, schema.options);\n }\n }\n });\n\n await Promise.all(storeCreationPromises);\n\n const storeMigrations = migrationFactory && migrationFactory();\n if (storeMigrations) {\n const migrationKeys = Object.keys(storeMigrations)\n .map((k) => parseInt(k, 10))\n .filter((v) => v > event.oldVersion)\n .sort((a, b) => a - b);\n\n for (const v of migrationKeys) {\n storeMigrations[v](database, request.transaction);\n }\n }\n\n database.close();\n resolve();\n };\n\n request.onsuccess = (e: any) => {\n e.target.result.close();\n resolve();\n };\n\n request.onerror = (error: Event) => {\n reject(error);\n };\n });\n}\n\nexport function DeleteObjectStore(dbName: string, version: number, storeName: string): Observable<void> {\n if (!dbName || !version || !storeName) {\n throw Error('Params: \"dbName\", \"version\", \"storeName\" are mandatory.');\n }\n\n return new Observable((obs) => {\n try {\n const newVersion = version + 1;\n const request: IDBOpenDBRequest = indexedDB.open(dbName, newVersion);\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\n const database: IDBDatabase = (event.target as any).result;\n\n database.deleteObjectStore(storeName);\n database.close();\n console.log('onupgradeneeded');\n obs.next();\n obs.complete();\n };\n\n request.onerror = (e) => obs.error(e);\n } catch (error) {\n obs.error(error);\n }\n });\n}\n\nexport function closeDatabase(db: IDBDatabase): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n if (!db) {\n reject(new Error('No database to close'));\n return;\n }\n\n try {\n db.close();\n resolve();\n } catch (error) {\n reject(`Error closing database: ${error}`);\n }\n });\n}\n","import {Observable} from 'rxjs';\nimport {finalize} from 'rxjs/operators';\nimport {closeDatabase, openedDatabases} from './ngx-indexed-db';\n\nexport function CloseDbConnection(): MethodDecorator {\n return function (_target: object, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n const originalMethod = descriptor.value;\n descriptor.value = function (...args: unknown[]) {\n const result = originalMethod.apply(this, args);\n\n if (result instanceof Observable) {\n return result.pipe(\n finalize(async () => {\n const promises = openedDatabases.map(async (db: IDBDatabase) => {\n await closeDatabase(db);\n });\n await Promise.all(promises);\n openedDatabases.length = 0;\n }));\n }\n return result;\n };\n return descriptor;\n };\n}\n","import { Inject, Injectable, isDevMode } from '@angular/core';\nimport { Observable, combineLatest, from } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { createTransaction, optionsGenerator, validateBeforeTransaction } from '../utils';\nimport { CloseDbConnection } from './decorators';\nimport { CreateObjectStore, DeleteObjectStore, openDatabase } from './ngx-indexed-db';\nimport {\n CONFIG_TOKEN,\n DBConfig,\n DBMode,\n INDEXED_DB,\n IndexKey,\n NgxIDBCursor,\n NgxIDBCursorWithValue,\n ObjectStoreMeta,\n RequestEvent,\n WithID,\n} from './ngx-indexed-db.meta';\n\n@Injectable()\nexport class NgxIndexedDBService {\n private defaultDatabaseName?: string = null;\n private selectedDb: string;\n\n constructor(\n @Inject(CONFIG_TOKEN) private dbConfigs: Record<string, DBConfig>,\n @Inject(INDEXED_DB) private indexedDB: IDBFactory\n ) {\n Object.values(this.dbConfigs).forEach((dbConfig, _, ref) => this.instanciateConfig(dbConfig, ref.length === 1));\n }\n\n private async instanciateConfig(dbConfig: DBConfig, isOnlyConfig: boolean): Promise<void> {\n if (!dbConfig.name) {\n throw new Error('NgxIndexedDB: Please, provide the dbName in the configuration');\n }\n // if (!dbConfig.version) {\n // throw new Error('NgxIndexedDB: Please, provide the db version in the configuration');\n // }\n if ((dbConfig.isDefault ?? false) && this.defaultDatabaseName) {\n // A default DB is already configured, throw an error\n throw new Error('NgxIndexedDB: Only one database can be set as default');\n }\n if (((dbConfig.isDefault ?? false) && !this.defaultDatabaseName) || isOnlyConfig) {\n this.defaultDatabaseName = dbConfig.name;\n this.selectedDb = dbConfig.name;\n }\n\n await CreateObjectStore(\n this.indexedDB,\n dbConfig.name,\n dbConfig.version,\n dbConfig.objectStoresMeta,\n dbConfig.migrationFactory\n );\n\n openDatabase(this.indexedDB, dbConfig.name).then((db) => {\n if (db.version !== dbConfig.version) {\n if (isDevMode()) {\n console.warn(`\n Your DB Config doesn't match the most recent version of the DB with name ${dbConfig.name}, please update it\n DB current version: ${db.version};\n Your configuration: ${dbConfig.version};\n `);\n console.warn(`Using latest version ${db.version}`);\n }\n this.dbConfigs[dbConfig.name].version = db.version;\n }\n\n db.close();\n });\n }\n\n private get dbConfig(): DBConfig {\n return this.dbConfigs[this.selectedDb];\n }\n\n /**\n * The function return the current version of database\n *\n * @Return the current version of database as number\n */\n @CloseDbConnection()\n getDatabaseVersion(): Observable<number | string> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n obs.next(db.version);\n obs.complete();\n })\n .catch((err) => obs.error(`error during get version of database => ${err} `));\n });\n }\n\n /**\n * Selects a database for the current context.\n * @param {string} [databaseName=undefined] Database name to select.\n */\n public selectDb(databaseName?: string): void {\n databaseName = databaseName ?? this.defaultDatabaseName;\n if (!databaseName) {\n // Name is still null, it means that there is no default database set\n // and the database name was not specified while calling a method\n throw new Error(`No database name specified and no default database set.`);\n }\n if (!Object.keys(this.dbConfigs).includes(databaseName)) {\n throw new Error(`NgxIndexedDB: Database ${databaseName} is not initialized.`);\n }\n\n this.selectedDb = databaseName;\n }\n\n /**\n * Allows to create a new object store ad-hoc\n * @param storeName The name of the store to be created\n * @param migrationFactory The migration factory if exists\n */\n async createObjectStore(\n storeSchema: ObjectStoreMeta,\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n ): Promise<void> {\n const storeSchemas: ObjectStoreMeta[] = [storeSchema];\n await CreateObjectStore(\n this.indexedDB,\n this.dbConfig.name,\n ++this.dbConfig.version,\n storeSchemas,\n migrationFactory\n );\n }\n\n /**\n * Create dynamic store if not already without incrementing version\n * For Dynamic store\n * @param storeName The name of the store to create\n */\n async createDynamicObjectStore(\n storeSchema: ObjectStoreMeta,\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n ): Promise<void> {\n const storeSchemas: ObjectStoreMeta[] = [storeSchema];\n await CreateObjectStore(\n this.indexedDB,\n this.dbConfig.name,\n this.dbConfig.version,\n storeSchemas,\n migrationFactory\n );\n }\n\n\n /**\n * Adds new entry in the store and returns its key\n * @param storeName The name of the store to add the item\n * @param value The entry to be added\n * @param key The optional key for the entry\n */\n @CloseDbConnection()\n add<T>(storeName: string, value: T, key?: any): Observable<T & WithID> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n const hasKey = Boolean(key);\n const request: IDBRequest<IDBValidKey> = hasKey ? objectStore.add(value, key) : objectStore.add(value);\n\n request.onsuccess = async (evt: Event) => {\n const result: any = (evt.target as IDBOpenDBRequest).result;\n const getRequest: IDBRequest = objectStore.get(result) as IDBRequest<T>;\n getRequest.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T & WithID>).result);\n obs.complete();\n };\n\n getRequest.onerror = (event: Event) => {\n obs.error(event);\n };\n };\n\n request.onerror = (event: Event) => {\n obs.error(event);\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Adds new entries in the store and returns its key\n * @param storeName The name of the store to add the item\n * @param values The entries to be added containing optional key attribute\n */\n @CloseDbConnection()\n bulkAdd<T>(storeName: string, values: Array<T & { key?: any }>): Observable<number[]> {\n const promises = new Promise<number[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, resolve, reject));\n const objectStore = transaction.objectStore(storeName);\n\n const results = values.map((value) => {\n return new Promise<number>((resolve1) => {\n const key = value.key;\n delete value.key;\n\n const hasKey = Boolean(key);\n const request: IDBRequest<IDBValidKey> = hasKey\n ? objectStore.add(value, key)\n : objectStore.add(value);\n\n request.onsuccess = (evt: Event) => {\n const result = (evt.target as IDBOpenDBRequest).result;\n resolve1((result as unknown) as number);\n };\n });\n });\n\n resolve(Promise.all(results));\n })\n .catch((reason) => reject(reason));\n });\n\n return from(promises);\n }\n\n /**\n * Delete entries in the store and returns current entries in the store\n * @param storeName The name of the store to add the item\n * @param keys The keys to be deleted\n */\n @CloseDbConnection()\n bulkDelete(storeName: string, keys: IDBValidKey[]): Observable<number[]> {\n const promises = keys.map((key) => {\n return new Promise<number>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n objectStore.delete(key);\n\n transaction.oncomplete = () => {\n this.getAll(storeName)\n .pipe(take(1))\n .subscribe((newValues) => {\n resolve(newValues as any);\n });\n };\n })\n .catch((reason) => reject(reason));\n });\n });\n return from(Promise.all(promises));\n }\n\n /**\n * Returns entry by key.\n * @param storeName The name of the store to query\n * @param key The entry key\n */\n @CloseDbConnection()\n getByKey<T>(storeName: string, key: IDBValidKey): Observable<T> {\n return new Observable<T>((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.get(key) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T>).result);\n obs.complete();\n };\n request.onerror = (event: Event) => {\n obs.error(event);\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Retrieve multiple entries in the store\n * @param storeName The name of the store to retrieve the items\n * @param keys The ids entries to be retrieve\n */\n @CloseDbConnection()\n bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): Observable<T[]> {\n const observables = keys.map((key) => this.getByKey<T>(storeName, key));\n\n return new Observable((obs) => {\n combineLatest(observables).subscribe((values) => {\n obs.next(values);\n obs.complete();\n });\n });\n }\n\n /**\n * Returns entry by id.\n * @param storeName The name of the store to query\n * @param id The entry id\n */\n @CloseDbConnection()\n getByID<T>(storeName: string, id: string | number): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error, obs.next));\n const objectStore = transaction.objectStore(storeName);\n const request: IDBRequest = objectStore.get(id) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T>).result);\n obs.complete();\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Returns entry by index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param key The entry key.\n */\n @CloseDbConnection()\n getByIndex<T>(storeName: string, indexName: string, key: IDBValidKey): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.get(key) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T>).result);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Return all elements from one store\n * @param storeName The name of the store to select the items\n */\n @CloseDbConnection()\n getAll<T>(storeName: string): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error, obs.next));\n const objectStore = transaction.objectStore(storeName);\n\n const request: IDBRequest = objectStore.getAll();\n\n request.onerror = (evt: Event) => {\n obs.error(evt);\n };\n\n request.onsuccess = ({ target: { result: ResultAll } }: RequestEvent<T>) => {\n obs.next(ResultAll as T[]);\n obs.complete();\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Adds or updates a record in store with the given value and key. Return all items present in the store\n * @param storeName The name of the store to update\n * @param value The new value for the entry\n */\n @CloseDbConnection()\n update<T>(storeName: string, value: T): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n\n const request: IDBRequest<IDBValidKey> = objectStore.put(value);\n\n request.onsuccess = async (evt: Event) => {\n const result: any = (evt.target as IDBOpenDBRequest).result;\n\n const getRequest: IDBRequest = objectStore.get(result) as IDBRequest<T>;\n getRequest.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T & WithID>).result);\n obs.complete();\n };\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Adds or updates a record in store with the given value and key. Return all items present in the store\n * @param storeName The name of the store to update\n * @param items The values to update in the DB\n *\n * @Return The return value is an Observable with the primary key of the object that was last in given array\n *\n * @error If the call to bulkPut fails the transaction will be aborted and previously inserted entities will be deleted\n */\n @CloseDbConnection()\n public bulkPut<T>(storeName: string, items: T[]): Observable<IDBValidKey> {\n let transaction: IDBTransaction;\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n\n items.forEach((item, index: number) => {\n const request = objectStore.put(item);\n\n if (index === items.length - 1) {\n request.onsuccess = (evt: Event) => {\n transaction.commit();\n obs.next((evt.target as IDBRequest<IDBValidKey>).result);\n obs.complete();\n };\n }\n\n request.onerror = (evt: Event) => {\n transaction.abort();\n obs.error(evt);\n };\n });\n })\n .catch((reason) => {\n transaction?.abort();\n obs.error(reason);\n });\n });\n }\n\n /**\n * Returns all items from the store after delete.\n * @param storeName The name of the store to have the entry deleted\n * @param query The key or key range criteria to apply\n */\n @CloseDbConnection()\n delete<T>(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n objectStore.delete(query);\n\n transaction.onerror = (e) => obs.error(e);\n transaction.oncomplete = () => {\n this.getAll<T>(storeName)\n .pipe(take(1))\n .subscribe({\n next: (newValues) => {\n obs.next(newValues);\n },\n error: (e) => obs.error(e), \n complete: () => obs.complete(),\n });\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns after a successful delete.\n * @param storeName The name of the store to have the entry deleted\n * @param query The key or key range criteria to apply\n */\n @CloseDbConnection()\n deleteByKey(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n objectStore.delete(query);\n\n transaction.onerror = (e) => obs.error(e);\n transaction.oncomplete = () => {\n obs.next();\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Delete all items by an index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param query The key or key range criteria to apply\n * @param direction A string telling the cursor which direction to travel.\n */\n @CloseDbConnection()\n deleteAllByIndex<T>(\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection\n ): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(query, direction);\n \n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<T>>).result;\n if (cursor) {\n cursor.delete();\n cursor.continue();\n } else {\n obs.next();\n obs.complete();\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Clear the data in the objectStore.\n * @param storeName The name of the store to have the entries deleted\n */\n @CloseDbConnection()\n clear(storeName: string): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n objectStore.clear();\n\n transaction.onerror = (e) => obs.error(e);\n transaction.oncomplete = () => {\n obs.next();\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Delete database.\n */\n @CloseDbConnection()\n deleteDatabase(): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then(async (db) => {\n db.close();\n const deleteDBRequest = this.indexedDB.deleteDatabase(this.dbConfig.name);\n deleteDBRequest.onsuccess = () => {\n obs.next();\n obs.complete();\n };\n deleteDBRequest.onerror = (error) => obs.error(error);\n deleteDBRequest.onblocked = () => {\n console.warn(\n 'Delete blocked: Ensure all tabs, instances, or connections are closed. Database name:',\n this.dbConfig.name\n );\n obs.error(new Error(\"Unable to delete database because it's blocked\"));\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Returns the open cursor\n * If no matching data are present, the observable is completed immediately.\n * @param options The options to open the cursor\n * @param options.storeName The name of the store to have the entries deleted\n * @param options.query The key or key range criteria to apply\n * @param options.direction A string telling the cursor which direction to travel\n * @param options.mode The transaction mode.\n */\n @CloseDbConnection()\n openCursor<V = any, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(\n options: {\n storeName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection,\n mode: DBMode\n } \n ): Observable<NgxIDBCursorWithValue<V, P, K>> {\n const { storeName, query, direction, mode = DBMode.readonly } = options;\n\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(mode, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.openCursor(query, direction);\n\n transaction.oncomplete = () => obs.complete();\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event: Event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<V, P, K>>).result;\n if (cursor) {\n obs.next(cursor);\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Open a cursor by index filter\n * If no matching data are present, the observable is completed immediately.\n * @param options The options to open the cursor\n * @param options.storeName The name of the store to query\n * @param options.indexName The index name to filter\n * @param options.query The key or key range criteria to apply\n * @param options.direction A string telling the cursor which direction to travel\n * @param options.mode The transaction mode.\n */\n @CloseDbConnection()\n openCursorByIndex<V, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(\n options: {\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection,\n mode?: DBMode\n }\n ): Observable<NgxIDBCursorWithValue<V, P, K>> {\n const { storeName, indexName, query, direction, mode = DBMode.readonly } = options;\n\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(mode, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(query, direction);\n\n transaction.oncomplete = () => obs.complete();\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event: Event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<V, P, K>>).result;\n if (cursor) {\n obs.next(cursor);\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns all items by an index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param query The key or key range criteria to apply\n * @param direction A string telling the cursor which direction to travel.\n */\n @CloseDbConnection()\n getAllByIndex<T>(\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection\n ): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(query, direction);\n\n const data: T[] = [];\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<T>>).result;\n if (cursor) {\n data.push(cursor.value);\n cursor.continue();\n } else {\n obs.next(data);\n obs.complete();\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns all primary keys by an index.\n * @param storeName The name of the store to query\n * @param query The key or key range criteria to apply\n * @param direction A string telling the cursor which direction to travel.\n */\n @CloseDbConnection()\n getAllKeysByIndex<P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection\n ): Observable<IndexKey<P, K>[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n\n const data: IndexKey<P, K>[] = [];\n const request = index.openKeyCursor(query, direction);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursor<P, K>>).result;\n if (cursor) {\n const { primaryKey, key } = cursor;\n data.push({\n primaryKey,\n key,\n });\n cursor.continue();\n } else {\n obs.next(data);\n obs.complete();\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns the number of rows in a store.\n * @param storeName The name of the store to query\n * @param query The key or key range criteria to apply.\n */\n @CloseDbConnection()\n count(storeName: string, query?: IDBValidKey | IDBKeyRange): Observable<number> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.count(query);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (e) => {\n obs.next((e.target as IDBRequest<number>).result);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns the number of records within a key range.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param query The key or key range criteria to apply.\n */\n @CloseDbConnection()\n countByIndex(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange): Observable<number> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request: IDBRequest = index.count(query);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (e) => {\n obs.next((e.target as IDBRequest<number>).result);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Delete the store by name.\n * @param storeName The name of the store to query\n */\n deleteObjectStore(storeName: string): Observable<void> {\n return DeleteObjectStore(this.dbConfig.name, ++this.dbConfig.version, storeName);\n }\n\n /**\n * Get all object store names.\n */\n @CloseDbConnection()\n getAllObjectStoreNames(): Observable<string[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n obs.next(Array.from(db.objectStoreNames));\n obs.complete();\n })\n .catch((reason) => obs.error(reason));\n });\n }\n}\n","/**\n *\n * A class that implements the IDBFactory interface, but only for the server.\n * All methods return a mocked value.\n *\n */\nexport class ServerIndexedDB implements IDBFactory {\n cmp(): number {\n return 0;\n }\n databases(): Promise<IDBDatabaseInfo[]> {\n return Promise.resolve([]);\n }\n\n deleteDatabase(): IDBOpenDBRequest {\n return {\n onupgradeneeded: null,\n onblocked: null,\n onerror: null,\n onsuccess: null,\n error: null,\n } as IDBOpenDBRequest;\n }\n\n open(): IDBOpenDBRequest {\n return {\n onupgradeneeded: null,\n onblocked: null,\n onerror: null,\n onsuccess: null,\n error: null,\n } as IDBOpenDBRequest;\n }\n}\n","import { assertInInjectionContext, inject, PLATFORM_ID } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { SERVER_INDEXED_DB } from '../lib/ngx-indexed-db.meta';\nimport { ServerIndexedDB } from './server-indexed-db';\n\n/**\n * Factory function for creating an instance of IDBFactory.\n *\n * It determines the platform using the {@link PLATFORM_ID} to decide whether to use the\n * browser's IndexedDB or a server-side implementation.\n *\n * @returns {IDBFactory} IDBFactory.\n */\nexport function indexedDbFactory(): IDBFactory {\n assertInInjectionContext(indexedDbFactory);\n const platformId = inject(PLATFORM_ID);\n const serverIndexedDB = inject(SERVER_INDEXED_DB, { optional: true }) ?? new ServerIndexedDB();\n return isPlatformBrowser(platformId) ? inject(DOCUMENT).defaultView.indexedDB : serverIndexedDB;\n}\n","import { makeEnvironmentProviders, Provider } from '@angular/core';\nimport { DBConfig, CONFIG_TOKEN, INDEXED_DB } from './ngx-indexed-db.meta';\nimport { NgxIndexedDBService } from './ngx-indexed-db.service';\nimport { indexedDbFactory } from '../ssr';\n\nexport const provideIndexedDb = (...dbConfigs: DBConfig[]) => {\n return makeEnvironmentProviders([..._provideIndexedDb(...dbConfigs)]);\n};\n\nexport const _provideIndexedDb = (...dbConfigs: DBConfig[]): Provider[] => {\n const configs = dbConfigs.reduce<Record<string, DBConfig>>((acc, curr) => {\n acc[curr.name] = curr;\n return acc;\n }, {});\n return [\n NgxIndexedDBService,\n { provide: CONFIG_TOKEN, useValue: configs },\n { provide: INDEXED_DB, useFactory: indexedDbFactory },\n ];\n};\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { DBConfig } from './ngx-indexed-db.meta';\nimport { _provideIndexedDb } from './provide-indexed-db';\n\n@NgModule()\nexport class NgxIndexedDBModule {\n static forRoot(...dbConfigs: DBConfig[]): ModuleWithProviders<NgxIndexedDBModule> {\n return {\n ngModule: NgxIndexedDBModule,\n providers: [..._provideIndexedDb(...dbConfigs)],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;IAmCY;AAAZ,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,MAAA,CAAA,W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ACrC,OAAO;AACL,YAAA,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE,CAAC,GAAG,iBAAiB,CAAC,GAAG,SAAS,CAAC,CAAC;SAChD;;8GALQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAlB,kBAAkB,EAAA,CAAA,CAAA;+GAAlB,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B;;;ACJD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-indexed-db.mjs","sources":["../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.meta.ts","../../../projects/ngx-indexed-db/src/utils/index.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts","../../../projects/ngx-indexed-db/src/lib/decorators.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts","../../../projects/ngx-indexed-db/src/ssr/server-indexed-db.ts","../../../projects/ngx-indexed-db/src/ssr/index.ts","../../../projects/ngx-indexed-db/src/lib/provide-indexed-db.ts","../../../projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts","../../../projects/ngx-indexed-db/src/ngx-indexed-db.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface DBConfig {\n name: string;\n version?: number;\n objectStoresMeta: ObjectStoreMeta[];\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void };\n isDefault?: boolean;\n}\n\nexport interface ObjectStoreMeta {\n store: string;\n storeConfig: { keyPath: string | string[]; autoIncrement: boolean; [key: string]: any };\n storeSchema: ObjectStoreSchema[];\n}\n\nexport interface ObjectStoreSchema {\n name: string;\n keypath: string | string[];\n options: { unique: boolean; [key: string]: any };\n}\n\nexport interface IndexDetails {\n indexName: string;\n order: string;\n}\n\nexport interface RequestEvent<T> extends Event {\n target: RequestEventTarget<T>;\n}\n\nexport interface RequestEventTarget<T> extends EventTarget {\n result: T | T[];\n}\n\nexport enum DBMode {\n readonly = 'readonly',\n readwrite = 'readwrite',\n}\n\nexport type WithID = { id: number };\n\nexport type IndexKey<P extends IDBValidKey, K extends IDBValidKey> = {\n readonly primaryKey: P;\n readonly key: K;\n};\n\ntype Modify<T, R> = Omit<T, keyof R> & R;\n\nexport type NgxIDBCursor<P extends IDBValidKey, K extends IDBValidKey, V = any> = Modify<\n IDBCursor,\n { key: K; primaryKey: P; update(value: V): IDBRequest<IDBValidKey> }\n>;\n\nexport type NgxIDBCursorWithValue<\n V = any,\n P extends IDBValidKey = IDBValidKey,\n K extends IDBValidKey = IDBValidKey\n> = NgxIDBCursor<P, K, V> & { value: V };\n\nexport const CONFIG_TOKEN = new InjectionToken<Record<string, DBConfig>>(null);\nexport const INDEXED_DB = new InjectionToken<IDBFactory>('Indexed DB');\n/**\n * Token used to inject the indexed db implementation on the server\n */\nexport const SERVER_INDEXED_DB = new InjectionToken<IDBFactory>('Server Indexed DB');\n","export interface Options {\n storeName: string;\n dbMode: IDBTransactionMode;\n error: (e: Event) => any;\n complete?: (e: Event) => any;\n abort?: any;\n}\n\nexport function validateStoreName(db: IDBDatabase, storeName: string): boolean {\n return db.objectStoreNames.contains(storeName);\n}\n\nexport function validateBeforeTransaction(db: IDBDatabase, storeName: string, reject: (message: string) => void): void {\n if (!db) {\n reject('You need to use the openDatabase function to create a database before you query it!');\n return; // Stop further execution\n }\n if (!validateStoreName(db, storeName)) {\n reject(`objectStore does not exists: ${storeName}`);\n }\n}\n\nexport function createTransaction(db: IDBDatabase, options: Options): IDBTransaction {\n const trans: IDBTransaction = db.transaction(options.storeName, options.dbMode);\n trans.onerror = options.error;\n trans.onabort = options.abort;\n return trans;\n}\n\nexport function optionsGenerator(\n type: any,\n storeName: any,\n reject: (reason?: any) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resolve?: (e: any) => void\n): Options {\n return {\n storeName,\n dbMode: type,\n error: (e: Event) => {\n reject(e);\n },\n abort: (e: Event) => {\n reject(e);\n },\n };\n}\n","import { ObjectStoreMeta } from './ngx-indexed-db.meta';\nimport { Observable } from 'rxjs';\n\nexport const openedDatabases: IDBDatabase[] = [];\n\nexport function openDatabase(\n indexedDB: IDBFactory,\n dbName: string,\n version?: number,\n upgradeCallback?: (a: Event, b: IDBDatabase) => void\n): Promise<IDBDatabase> {\n return new Promise<IDBDatabase>((resolve, reject) => {\n if (!indexedDB) {\n reject('IndexedDB not available');\n }\n const request = indexedDB.open(dbName, version);\n let db: IDBDatabase;\n request.onsuccess = () => {\n db = request.result;\n openedDatabases.push(db);\n resolve(db);\n };\n request.onerror = () => {\n reject(`IndexedDB error: ${request.error}`);\n };\n if (typeof upgradeCallback === 'function') {\n request.onupgradeneeded = (event: Event) => {\n upgradeCallback(event, db);\n };\n }\n });\n}\n\nexport async function CreateObjectStore(\n indexedDB: IDBFactory,\n dbName: string,\n version: number,\n storeSchemas: ObjectStoreMeta[],\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n if (!indexedDB) {\n return;\n }\n const request: IDBOpenDBRequest = indexedDB.open(dbName, version);\n request.onupgradeneeded = async (event: IDBVersionChangeEvent) => {\n const database: IDBDatabase = (event.target as any).result;\n\n const storeCreationPromises = storeSchemas.map(async (storeSchema) => {\n if (!database.objectStoreNames.contains(storeSchema.store)) {\n const objectStore = database.createObjectStore(storeSchema.store, storeSchema.storeConfig);\n for (const schema of storeSchema.storeSchema) {\n objectStore.createIndex(schema.name, schema.keypath, schema.options);\n }\n }\n });\n\n await Promise.all(storeCreationPromises);\n\n const storeMigrations = migrationFactory && migrationFactory();\n if (storeMigrations) {\n const migrationKeys = Object.keys(storeMigrations)\n .map((k) => parseInt(k, 10))\n .filter((v) => v > event.oldVersion)\n .sort((a, b) => a - b);\n\n for (const v of migrationKeys) {\n storeMigrations[v](database, request.transaction);\n }\n }\n\n database.close();\n resolve();\n };\n\n request.onsuccess = (e: any) => {\n e.target.result.close();\n resolve();\n };\n\n request.onerror = (error: Event) => {\n reject(error);\n };\n });\n}\n\nexport function DeleteObjectStore(dbName: string, version: number, storeName: string): Observable<void> {\n if (!dbName || !version || !storeName) {\n throw Error('Params: \"dbName\", \"version\", \"storeName\" are mandatory.');\n }\n\n return new Observable((obs) => {\n try {\n const newVersion = version + 1;\n const request: IDBOpenDBRequest = indexedDB.open(dbName, newVersion);\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\n const database: IDBDatabase = (event.target as any).result;\n\n database.deleteObjectStore(storeName);\n database.close();\n console.log('onupgradeneeded');\n obs.next();\n obs.complete();\n };\n\n request.onerror = (e) => obs.error(e);\n } catch (error) {\n obs.error(error);\n }\n });\n}\n\nexport function closeDatabase(db: IDBDatabase): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n if (!db) {\n reject(new Error('No database to close'));\n return;\n }\n\n try {\n db.close();\n resolve();\n } catch (error) {\n reject(`Error closing database: ${error}`);\n }\n });\n}\n","import { Observable } from 'rxjs';\nimport { finalize } from 'rxjs/operators';\nimport { closeDatabase, openedDatabases } from './ngx-indexed-db';\n\nexport function CloseDbConnection(): MethodDecorator {\n return function (_target: object, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n const originalMethod = descriptor.value;\n descriptor.value = function (...args: unknown[]) {\n const result = originalMethod.apply(this, args);\n\n if (result instanceof Observable) {\n return result.pipe(\n finalize(async () => {\n const promises = openedDatabases.map(async (db: IDBDatabase) => {\n await closeDatabase(db);\n });\n await Promise.all(promises);\n openedDatabases.length = 0;\n })\n );\n }\n return result;\n };\n return descriptor;\n };\n}\n","import { Inject, Injectable, isDevMode } from '@angular/core';\nimport { Observable, combineLatest, from } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { createTransaction, optionsGenerator, validateBeforeTransaction } from '../utils';\nimport { CloseDbConnection } from './decorators';\nimport { CreateObjectStore, DeleteObjectStore, openDatabase } from './ngx-indexed-db';\nimport {\n CONFIG_TOKEN,\n DBConfig,\n DBMode,\n INDEXED_DB,\n IndexKey,\n NgxIDBCursor,\n NgxIDBCursorWithValue,\n ObjectStoreMeta,\n RequestEvent,\n WithID,\n} from './ngx-indexed-db.meta';\n\n@Injectable()\nexport class NgxIndexedDBService {\n private defaultDatabaseName?: string = null;\n private selectedDb: string;\n\n constructor(\n @Inject(CONFIG_TOKEN) private dbConfigs: Record<string, DBConfig>,\n @Inject(INDEXED_DB) private indexedDB: IDBFactory\n ) {\n Object.values(this.dbConfigs).forEach((dbConfig, _, ref) => this.instanciateConfig(dbConfig, ref.length === 1));\n }\n\n private async instanciateConfig(dbConfig: DBConfig, isOnlyConfig: boolean): Promise<void> {\n if (!dbConfig.name) {\n throw new Error('NgxIndexedDB: Please, provide the dbName in the configuration');\n }\n // if (!dbConfig.version) {\n // throw new Error('NgxIndexedDB: Please, provide the db version in the configuration');\n // }\n if ((dbConfig.isDefault ?? false) && this.defaultDatabaseName) {\n // A default DB is already configured, throw an error\n throw new Error('NgxIndexedDB: Only one database can be set as default');\n }\n if (((dbConfig.isDefault ?? false) && !this.defaultDatabaseName) || isOnlyConfig) {\n this.defaultDatabaseName = dbConfig.name;\n this.selectedDb = dbConfig.name;\n }\n\n await CreateObjectStore(\n this.indexedDB,\n dbConfig.name,\n dbConfig.version,\n dbConfig.objectStoresMeta,\n dbConfig.migrationFactory\n );\n\n openDatabase(this.indexedDB, dbConfig.name).then((db) => {\n if (db.version !== dbConfig.version) {\n if (isDevMode()) {\n console.warn(`\n Your DB Config doesn't match the most recent version of the DB with name ${dbConfig.name}, please update it\n DB current version: ${db.version};\n Your configuration: ${dbConfig.version};\n `);\n console.warn(`Using latest version ${db.version}`);\n }\n this.dbConfigs[dbConfig.name].version = db.version;\n }\n\n db.close();\n });\n }\n\n private get dbConfig(): DBConfig {\n return this.dbConfigs[this.selectedDb];\n }\n\n /**\n * The function return the current version of database\n *\n * @Return the current version of database as number\n */\n @CloseDbConnection()\n getDatabaseVersion(): Observable<number | string> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n obs.next(db.version);\n obs.complete();\n })\n .catch((err) => obs.error(`error during get version of database => ${err} `));\n });\n }\n\n /**\n * Selects a database for the current context.\n * @param {string} [databaseName=undefined] Database name to select.\n */\n public selectDb(databaseName?: string): void {\n databaseName = databaseName ?? this.defaultDatabaseName;\n if (!databaseName) {\n // Name is still null, it means that there is no default database set\n // and the database name was not specified while calling a method\n throw new Error(`No database name specified and no default database set.`);\n }\n if (!Object.keys(this.dbConfigs).includes(databaseName)) {\n throw new Error(`NgxIndexedDB: Database ${databaseName} is not initialized.`);\n }\n\n this.selectedDb = databaseName;\n }\n\n /**\n * Allows to create a new object store ad-hoc\n * @param storeName The name of the store to be created\n * @param migrationFactory The migration factory if exists\n */\n async createObjectStore(\n storeSchema: ObjectStoreMeta,\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n ): Promise<void> {\n const storeSchemas: ObjectStoreMeta[] = [storeSchema];\n await CreateObjectStore(\n this.indexedDB,\n this.dbConfig.name,\n ++this.dbConfig.version,\n storeSchemas,\n migrationFactory\n );\n }\n\n /**\n * Create dynamic store if not already without incrementing version\n * For Dynamic store\n * @param storeName The name of the store to create\n */\n async createDynamicObjectStore(\n storeSchema: ObjectStoreMeta,\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n ): Promise<void> {\n const storeSchemas: ObjectStoreMeta[] = [storeSchema];\n await CreateObjectStore(this.indexedDB, this.dbConfig.name, this.dbConfig.version, storeSchemas, migrationFactory);\n }\n\n /**\n * Adds new entry in the store and returns its key\n * @param storeName The name of the store to add the item\n * @param value The entry to be added\n * @param key The optional key for the entry\n */\n @CloseDbConnection()\n add<T>(storeName: string, value: T, key?: any): Observable<T & WithID> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n const hasKey = Boolean(key);\n const request: IDBRequest<IDBValidKey> = hasKey ? objectStore.add(value, key) : objectStore.add(value);\n\n request.onsuccess = async (evt: Event) => {\n const result: any = (evt.target as IDBOpenDBRequest).result;\n const getRequest: IDBRequest = objectStore.get(result) as IDBRequest<T>;\n getRequest.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T & WithID>).result);\n obs.complete();\n };\n\n getRequest.onerror = (event: Event) => {\n obs.error(event);\n };\n };\n\n request.onerror = (event: Event) => {\n obs.error(event);\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Adds new entries in the store and returns its key\n * @param storeName The name of the store to add the item\n * @param values The entries to be added containing optional key attribute\n */\n @CloseDbConnection()\n bulkAdd<T>(storeName: string, values: Array<T & { key?: any }>): Observable<number[]> {\n const promises = new Promise<number[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, resolve, reject));\n const objectStore = transaction.objectStore(storeName);\n\n const results = values.map((value) => {\n return new Promise<number>((resolve1) => {\n const key = value.key;\n delete value.key;\n\n const hasKey = Boolean(key);\n const request: IDBRequest<IDBValidKey> = hasKey ? objectStore.add(value, key) : objectStore.add(value);\n\n request.onsuccess = (evt: Event) => {\n const result = (evt.target as IDBOpenDBRequest).result;\n resolve1((result as unknown) as number);\n };\n });\n });\n\n resolve(Promise.all(results));\n })\n .catch((reason) => reject(reason));\n });\n\n return from(promises);\n }\n\n /**\n * Delete entries in the store and returns current entries in the store\n * @param storeName The name of the store to add the item\n * @param keys The keys to be deleted\n */\n @CloseDbConnection()\n bulkDelete(storeName: string, keys: IDBValidKey[]): Observable<number[]> {\n const promises = keys.map((key) => {\n return new Promise<number>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n objectStore.delete(key);\n\n transaction.oncomplete = () => {\n this.getAll(storeName)\n .pipe(take(1))\n .subscribe((newValues) => {\n resolve(newValues as any);\n });\n };\n })\n .catch((reason) => reject(reason));\n });\n });\n return from(Promise.all(promises));\n }\n\n /**\n * Returns entry by key.\n * @param storeName The name of the store to query\n * @param key The entry key\n */\n @CloseDbConnection()\n getByKey<T>(storeName: string, key: IDBValidKey): Observable<T> {\n return new Observable<T>((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.get(key) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T>).result);\n obs.complete();\n };\n request.onerror = (event: Event) => {\n obs.error(event);\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Retrieve multiple entries in the store\n * @param storeName The name of the store to retrieve the items\n * @param keys The ids entries to be retrieve\n */\n @CloseDbConnection()\n bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): Observable<T[]> {\n const observables = keys.map((key) => this.getByKey<T>(storeName, key));\n\n return new Observable((obs) => {\n combineLatest(observables).subscribe((values) => {\n obs.next(values);\n obs.complete();\n });\n });\n }\n\n /**\n * Returns entry by id.\n * @param storeName The name of the store to query\n * @param id The entry id\n */\n @CloseDbConnection()\n getByID<T>(storeName: string, id: string | number): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error, obs.next));\n const objectStore = transaction.objectStore(storeName);\n const request: IDBRequest = objectStore.get(id) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T>).result);\n obs.complete();\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Returns entry by index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param key The entry key.\n */\n @CloseDbConnection()\n getByIndex<T>(storeName: string, indexName: string, key: IDBValidKey): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.get(key) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T>).result);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Return all elements from one store\n * @param storeName The name of the store to select the items\n */\n @CloseDbConnection()\n getAll<T>(storeName: string): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error, obs.next));\n const objectStore = transaction.objectStore(storeName);\n\n const request: IDBRequest = objectStore.getAll();\n\n request.onerror = (evt: Event) => {\n obs.error(evt);\n };\n\n request.onsuccess = ({ target: { result: ResultAll } }: RequestEvent<T>) => {\n obs.next(ResultAll as T[]);\n obs.complete();\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Adds or updates a record in store with the given value and key. Return all items present in the store\n * @param storeName The name of the store to update\n * @param value The new value for the entry\n */\n @CloseDbConnection()\n update<T>(storeName: string, value: T): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n\n const request: IDBRequest<IDBValidKey> = objectStore.put(value);\n\n request.onsuccess = async (evt: Event) => {\n const result: any = (evt.target as IDBOpenDBRequest).result;\n\n const getRequest: IDBRequest = objectStore.get(result) as IDBRequest<T>;\n getRequest.onsuccess = (event: Event) => {\n obs.next((event.target as IDBRequest<T & WithID>).result);\n obs.complete();\n };\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Adds or updates a record in store with the given value and key. Return all items present in the store\n * @param storeName The name of the store to update\n * @param items The values to update in the DB\n *\n * @Return The return value is an Observable with the primary key of the object that was last in given array\n *\n * @error If the call to bulkPut fails the transaction will be aborted and previously inserted entities will be deleted\n */\n @CloseDbConnection()\n public bulkPut<T>(storeName: string, items: T[]): Observable<IDBValidKey> {\n let transaction: IDBTransaction;\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n\n items.forEach((item, index: number) => {\n const request = objectStore.put(item);\n\n if (index === items.length - 1) {\n request.onsuccess = (evt: Event) => {\n transaction.commit();\n obs.next((evt.target as IDBRequest<IDBValidKey>).result);\n obs.complete();\n };\n }\n\n request.onerror = (evt: Event) => {\n transaction.abort();\n obs.error(evt);\n };\n });\n })\n .catch((reason) => {\n transaction?.abort();\n obs.error(reason);\n });\n });\n }\n\n /**\n * Returns all items from the store after delete.\n * @param storeName The name of the store to have the entry deleted\n * @param query The key or key range criteria to apply\n */\n @CloseDbConnection()\n delete<T>(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n objectStore.delete(query);\n\n transaction.onerror = (e) => obs.error(e);\n transaction.oncomplete = () => {\n this.getAll<T>(storeName)\n .pipe(take(1))\n .subscribe({\n next: (newValues) => {\n obs.next(newValues);\n },\n error: (e) => obs.error(e),\n complete: () => obs.complete(),\n });\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns after a successful delete.\n * @param storeName The name of the store to have the entry deleted\n * @param query The key or key range criteria to apply\n */\n @CloseDbConnection()\n deleteByKey(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n objectStore.delete(query);\n\n transaction.onerror = (e) => obs.error(e);\n transaction.oncomplete = () => {\n obs.next();\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Delete all items by an index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param query The key or key range criteria to apply\n * @param direction A string telling the cursor which direction to travel.\n */\n @CloseDbConnection()\n deleteAllByIndex<T>(\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection\n ): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(query, direction);\n\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<T>>).result;\n if (cursor) {\n cursor.delete();\n cursor.continue();\n } else {\n obs.next();\n obs.complete();\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Clear the data in the objectStore.\n * @param storeName The name of the store to have the entries deleted\n */\n @CloseDbConnection()\n clear(storeName: string): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(\n db,\n optionsGenerator(DBMode.readwrite, storeName, (e) => obs.error(e))\n );\n const objectStore = transaction.objectStore(storeName);\n objectStore.clear();\n\n transaction.onerror = (e) => obs.error(e);\n transaction.oncomplete = () => {\n obs.next();\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Delete database.\n */\n @CloseDbConnection()\n deleteDatabase(): Observable<void> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then(async (db) => {\n db.close();\n const deleteDBRequest = this.indexedDB.deleteDatabase(this.dbConfig.name);\n deleteDBRequest.onsuccess = () => {\n obs.next();\n obs.complete();\n };\n deleteDBRequest.onerror = (error) => obs.error(error);\n deleteDBRequest.onblocked = () => {\n console.warn(\n 'Delete blocked: Ensure all tabs, instances, or connections are closed. Database name:',\n this.dbConfig.name\n );\n obs.error(new Error(\"Unable to delete database because it's blocked\"));\n };\n })\n .catch((error) => obs.error(error));\n });\n }\n\n /**\n * Returns the open cursor\n * If no matching data are present, the observable is completed immediately.\n * @param options The options to open the cursor\n * @param options.storeName The name of the store to have the entries deleted\n * @param options.query The key or key range criteria to apply\n * @param options.direction A string telling the cursor which direction to travel\n * @param options.mode The transaction mode.\n */\n @CloseDbConnection()\n openCursor<V = any, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(options: {\n storeName: string;\n query?: IDBValidKey | IDBKeyRange | null;\n direction?: IDBCursorDirection;\n mode: DBMode;\n }): Observable<NgxIDBCursorWithValue<V, P, K>> {\n const { storeName, query, direction, mode = DBMode.readonly } = options;\n\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(mode, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.openCursor(query, direction);\n\n transaction.oncomplete = () => obs.complete();\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event: Event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<V, P, K>>).result;\n if (cursor) {\n obs.next(cursor);\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Open a cursor by index filter\n * If no matching data are present, the observable is completed immediately.\n * @param options The options to open the cursor\n * @param options.storeName The name of the store to query\n * @param options.indexName The index name to filter\n * @param options.query The key or key range criteria to apply\n * @param options.direction A string telling the cursor which direction to travel\n * @param options.mode The transaction mode.\n */\n @CloseDbConnection()\n openCursorByIndex<V, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(options: {\n storeName: string;\n indexName: string;\n query?: IDBValidKey | IDBKeyRange | null;\n direction?: IDBCursorDirection;\n mode?: DBMode;\n }): Observable<NgxIDBCursorWithValue<V, P, K>> {\n const { storeName, indexName, query, direction, mode = DBMode.readonly } = options;\n\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(mode, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(query, direction);\n\n transaction.oncomplete = () => obs.complete();\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event: Event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<V, P, K>>).result;\n if (cursor) {\n obs.next(cursor);\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns all items by an index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param query The key or key range criteria to apply\n * @param direction A string telling the cursor which direction to travel.\n */\n @CloseDbConnection()\n getAllByIndex<T>(\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection\n ): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(query, direction);\n\n const data: T[] = [];\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursorWithValue<T>>).result;\n if (cursor) {\n data.push(cursor.value);\n cursor.continue();\n } else {\n obs.next(data);\n obs.complete();\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns all primary keys by an index.\n * @param storeName The name of the store to query\n * @param query The key or key range criteria to apply\n * @param direction A string telling the cursor which direction to travel.\n */\n @CloseDbConnection()\n getAllKeysByIndex<P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(\n storeName: string,\n indexName: string,\n query?: IDBValidKey | IDBKeyRange | null,\n direction?: IDBCursorDirection\n ): Observable<IndexKey<P, K>[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n\n const data: IndexKey<P, K>[] = [];\n const request = index.openKeyCursor(query, direction);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (event) => {\n const cursor = (event.target as IDBRequest<NgxIDBCursor<P, K>>).result;\n if (cursor) {\n const { primaryKey, key } = cursor;\n data.push({\n primaryKey,\n key,\n });\n cursor.continue();\n } else {\n obs.next(data);\n obs.complete();\n }\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns the number of rows in a store.\n * @param storeName The name of the store to query\n * @param query The key or key range criteria to apply.\n */\n @CloseDbConnection()\n count(storeName: string, query?: IDBValidKey | IDBKeyRange): Observable<number> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.count(query);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (e) => {\n obs.next((e.target as IDBRequest<number>).result);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns the number of records within a key range.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param query The key or key range criteria to apply.\n */\n @CloseDbConnection()\n countByIndex(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange): Observable<number> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (e) => obs.error(e));\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request: IDBRequest = index.count(query);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (e) => {\n obs.next((e.target as IDBRequest<number>).result);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Delete the store by name.\n * @param storeName The name of the store to query\n */\n deleteObjectStore(storeName: string): Observable<void> {\n return DeleteObjectStore(this.dbConfig.name, ++this.dbConfig.version, storeName);\n }\n\n /**\n * Get all object store names.\n */\n @CloseDbConnection()\n getAllObjectStoreNames(): Observable<string[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n obs.next(Array.from(db.objectStoreNames));\n obs.complete();\n })\n .catch((reason) => obs.error(reason));\n });\n }\n}\n","/**\n *\n * A class that implements the IDBFactory interface, but only for the server.\n * All methods return a mocked value.\n *\n */\nexport class ServerIndexedDB implements IDBFactory {\n cmp(): number {\n return 0;\n }\n databases(): Promise<IDBDatabaseInfo[]> {\n return Promise.resolve([]);\n }\n\n deleteDatabase(): IDBOpenDBRequest {\n return {\n onupgradeneeded: null,\n onblocked: null,\n onerror: null,\n onsuccess: null,\n error: null,\n } as IDBOpenDBRequest;\n }\n\n open(): IDBOpenDBRequest {\n return {\n onupgradeneeded: null,\n onblocked: null,\n onerror: null,\n onsuccess: null,\n error: null,\n } as IDBOpenDBRequest;\n }\n}\n","import { assertInInjectionContext, inject, PLATFORM_ID, DOCUMENT } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { SERVER_INDEXED_DB } from '../lib/ngx-indexed-db.meta';\nimport { ServerIndexedDB } from './server-indexed-db';\n\n/**\n * Factory function for creating an instance of IDBFactory.\n *\n * It determines the platform using the {@link PLATFORM_ID} to decide whether to use the\n * browser's IndexedDB or a server-side implementation.\n *\n * @returns {IDBFactory} IDBFactory.\n */\nexport function indexedDbFactory(): IDBFactory {\n assertInInjectionContext(indexedDbFactory);\n const platformId = inject(PLATFORM_ID);\n const serverIndexedDB = inject(SERVER_INDEXED_DB, { optional: true }) ?? new ServerIndexedDB();\n return isPlatformBrowser(platformId) ? inject(DOCUMENT).defaultView.indexedDB : serverIndexedDB;\n}\n","import { makeEnvironmentProviders, Provider } from '@angular/core';\nimport { DBConfig, CONFIG_TOKEN, INDEXED_DB } from './ngx-indexed-db.meta';\nimport { NgxIndexedDBService } from './ngx-indexed-db.service';\nimport { indexedDbFactory } from '../ssr';\n\nexport const provideIndexedDb = (...dbConfigs: DBConfig[]) => {\n return makeEnvironmentProviders([..._provideIndexedDb(...dbConfigs)]);\n};\n\nexport const _provideIndexedDb = (...dbConfigs: DBConfig[]): Provider[] => {\n const configs = dbConfigs.reduce<Record<string, DBConfig>>((acc, curr) => {\n acc[curr.name] = curr;\n return acc;\n }, {});\n return [\n NgxIndexedDBService,\n { provide: CONFIG_TOKEN, useValue: configs },\n { provide: INDEXED_DB, useFactory: indexedDbFactory },\n ];\n};\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { DBConfig } from './ngx-indexed-db.meta';\nimport { _provideIndexedDb } from './provide-indexed-db';\n\n@NgModule()\nexport class NgxIndexedDBModule {\n static forRoot(...dbConfigs: DBConfig[]): ModuleWithProviders<NgxIndexedDBModule> {\n return {\n ngModule: NgxIndexedDBModule,\n providers: [..._provideIndexedDb(...dbConfigs)],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;IAmCY;AAAZ,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,MAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACzB,CAAC,EAHW,MAAM,KAAN,MAAM,GAGjB,EAAA,CAAA,CAAA;MAsBY,YAAY,GAAG,IAAI,cAAc,CAA2B,IAAI;MAChE,UAAU,GAAG,IAAI,cAAc,CAAa,YAAY;AACrE;;AAEG;MACU,iBAAiB,GAAG,IAAI,cAAc,CAAa,mBAAmB;;ACzDnE,SAAA,iBAAiB,CAAC,EAAe,EAAE,SAAiB,EAAA;IAClE,OAAO,EAAE,CAAC,g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FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B;;;ACJD;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,282 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, ModuleWithProviders } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+
5
+ interface DBConfig {
6
+ name: string;
7
+ version?: number;
8
+ objectStoresMeta: ObjectStoreMeta[];
9
+ migrationFactory?: () => {
10
+ [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
11
+ };
12
+ isDefault?: boolean;
13
+ }
14
+ interface ObjectStoreMeta {
15
+ store: string;
16
+ storeConfig: {
17
+ keyPath: string | string[];
18
+ autoIncrement: boolean;
19
+ [key: string]: any;
20
+ };
21
+ storeSchema: ObjectStoreSchema[];
22
+ }
23
+ interface ObjectStoreSchema {
24
+ name: string;
25
+ keypath: string | string[];
26
+ options: {
27
+ unique: boolean;
28
+ [key: string]: any;
29
+ };
30
+ }
31
+ interface IndexDetails {
32
+ indexName: string;
33
+ order: string;
34
+ }
35
+ interface RequestEvent<T> extends Event {
36
+ target: RequestEventTarget<T>;
37
+ }
38
+ interface RequestEventTarget<T> extends EventTarget {
39
+ result: T | T[];
40
+ }
41
+ declare enum DBMode {
42
+ readonly = "readonly",
43
+ readwrite = "readwrite"
44
+ }
45
+ type WithID = {
46
+ id: number;
47
+ };
48
+ type IndexKey<P extends IDBValidKey, K extends IDBValidKey> = {
49
+ readonly primaryKey: P;
50
+ readonly key: K;
51
+ };
52
+ type Modify<T, R> = Omit<T, keyof R> & R;
53
+ type NgxIDBCursor<P extends IDBValidKey, K extends IDBValidKey, V = any> = Modify<IDBCursor, {
54
+ key: K;
55
+ primaryKey: P;
56
+ update(value: V): IDBRequest<IDBValidKey>;
57
+ }>;
58
+ type NgxIDBCursorWithValue<V = any, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey> = NgxIDBCursor<P, K, V> & {
59
+ value: V;
60
+ };
61
+ declare const CONFIG_TOKEN: InjectionToken<Record<string, DBConfig>>;
62
+ declare const INDEXED_DB: InjectionToken<IDBFactory>;
1
63
  /**
2
- * Generated bundle index. Do not edit.
64
+ * Token used to inject the indexed db implementation on the server
3
65
  */
4
- /// <amd-module name="ngx-indexed-db" />
5
- export * from './public-api';
66
+ declare const SERVER_INDEXED_DB: InjectionToken<IDBFactory>;
67
+
68
+ declare class NgxIndexedDBModule {
69
+ static forRoot(...dbConfigs: DBConfig[]): ModuleWithProviders<NgxIndexedDBModule>;
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxIndexedDBModule, never>;
71
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxIndexedDBModule, never, never, never>;
72
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxIndexedDBModule>;
73
+ }
74
+
75
+ declare class NgxIndexedDBService {
76
+ private dbConfigs;
77
+ private indexedDB;
78
+ private defaultDatabaseName?;
79
+ private selectedDb;
80
+ constructor(dbConfigs: Record<string, DBConfig>, indexedDB: IDBFactory);
81
+ private instanciateConfig;
82
+ private get dbConfig();
83
+ /**
84
+ * The function return the current version of database
85
+ *
86
+ * @Return the current version of database as number
87
+ */
88
+ getDatabaseVersion(): Observable<number | string>;
89
+ /**
90
+ * Selects a database for the current context.
91
+ * @param {string} [databaseName=undefined] Database name to select.
92
+ */
93
+ selectDb(databaseName?: string): void;
94
+ /**
95
+ * Allows to create a new object store ad-hoc
96
+ * @param storeName The name of the store to be created
97
+ * @param migrationFactory The migration factory if exists
98
+ */
99
+ createObjectStore(storeSchema: ObjectStoreMeta, migrationFactory?: () => {
100
+ [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
101
+ }): Promise<void>;
102
+ /**
103
+ * Create dynamic store if not already without incrementing version
104
+ * For Dynamic store
105
+ * @param storeName The name of the store to create
106
+ */
107
+ createDynamicObjectStore(storeSchema: ObjectStoreMeta, migrationFactory?: () => {
108
+ [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
109
+ }): Promise<void>;
110
+ /**
111
+ * Adds new entry in the store and returns its key
112
+ * @param storeName The name of the store to add the item
113
+ * @param value The entry to be added
114
+ * @param key The optional key for the entry
115
+ */
116
+ add<T>(storeName: string, value: T, key?: any): Observable<T & WithID>;
117
+ /**
118
+ * Adds new entries in the store and returns its key
119
+ * @param storeName The name of the store to add the item
120
+ * @param values The entries to be added containing optional key attribute
121
+ */
122
+ bulkAdd<T>(storeName: string, values: Array<T & {
123
+ key?: any;
124
+ }>): Observable<number[]>;
125
+ /**
126
+ * Delete entries in the store and returns current entries in the store
127
+ * @param storeName The name of the store to add the item
128
+ * @param keys The keys to be deleted
129
+ */
130
+ bulkDelete(storeName: string, keys: IDBValidKey[]): Observable<number[]>;
131
+ /**
132
+ * Returns entry by key.
133
+ * @param storeName The name of the store to query
134
+ * @param key The entry key
135
+ */
136
+ getByKey<T>(storeName: string, key: IDBValidKey): Observable<T>;
137
+ /**
138
+ * Retrieve multiple entries in the store
139
+ * @param storeName The name of the store to retrieve the items
140
+ * @param keys The ids entries to be retrieve
141
+ */
142
+ bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): Observable<T[]>;
143
+ /**
144
+ * Returns entry by id.
145
+ * @param storeName The name of the store to query
146
+ * @param id The entry id
147
+ */
148
+ getByID<T>(storeName: string, id: string | number): Observable<T>;
149
+ /**
150
+ * Returns entry by index.
151
+ * @param storeName The name of the store to query
152
+ * @param indexName The index name to filter
153
+ * @param key The entry key.
154
+ */
155
+ getByIndex<T>(storeName: string, indexName: string, key: IDBValidKey): Observable<T>;
156
+ /**
157
+ * Return all elements from one store
158
+ * @param storeName The name of the store to select the items
159
+ */
160
+ getAll<T>(storeName: string): Observable<T[]>;
161
+ /**
162
+ * Adds or updates a record in store with the given value and key. Return all items present in the store
163
+ * @param storeName The name of the store to update
164
+ * @param value The new value for the entry
165
+ */
166
+ update<T>(storeName: string, value: T): Observable<T>;
167
+ /**
168
+ * Adds or updates a record in store with the given value and key. Return all items present in the store
169
+ * @param storeName The name of the store to update
170
+ * @param items The values to update in the DB
171
+ *
172
+ * @Return The return value is an Observable with the primary key of the object that was last in given array
173
+ *
174
+ * @error If the call to bulkPut fails the transaction will be aborted and previously inserted entities will be deleted
175
+ */
176
+ bulkPut<T>(storeName: string, items: T[]): Observable<IDBValidKey>;
177
+ /**
178
+ * Returns all items from the store after delete.
179
+ * @param storeName The name of the store to have the entry deleted
180
+ * @param query The key or key range criteria to apply
181
+ */
182
+ delete<T>(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<T[]>;
183
+ /**
184
+ * Returns after a successful delete.
185
+ * @param storeName The name of the store to have the entry deleted
186
+ * @param query The key or key range criteria to apply
187
+ */
188
+ deleteByKey(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<void>;
189
+ /**
190
+ * Delete all items by an index.
191
+ * @param storeName The name of the store to query
192
+ * @param indexName The index name to filter
193
+ * @param query The key or key range criteria to apply
194
+ * @param direction A string telling the cursor which direction to travel.
195
+ */
196
+ deleteAllByIndex<T>(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): Observable<void>;
197
+ /**
198
+ * Clear the data in the objectStore.
199
+ * @param storeName The name of the store to have the entries deleted
200
+ */
201
+ clear(storeName: string): Observable<void>;
202
+ /**
203
+ * Delete database.
204
+ */
205
+ deleteDatabase(): Observable<void>;
206
+ /**
207
+ * Returns the open cursor
208
+ * If no matching data are present, the observable is completed immediately.
209
+ * @param options The options to open the cursor
210
+ * @param options.storeName The name of the store to have the entries deleted
211
+ * @param options.query The key or key range criteria to apply
212
+ * @param options.direction A string telling the cursor which direction to travel
213
+ * @param options.mode The transaction mode.
214
+ */
215
+ openCursor<V = any, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(options: {
216
+ storeName: string;
217
+ query?: IDBValidKey | IDBKeyRange | null;
218
+ direction?: IDBCursorDirection;
219
+ mode: DBMode;
220
+ }): Observable<NgxIDBCursorWithValue<V, P, K>>;
221
+ /**
222
+ * Open a cursor by index filter
223
+ * If no matching data are present, the observable is completed immediately.
224
+ * @param options The options to open the cursor
225
+ * @param options.storeName The name of the store to query
226
+ * @param options.indexName The index name to filter
227
+ * @param options.query The key or key range criteria to apply
228
+ * @param options.direction A string telling the cursor which direction to travel
229
+ * @param options.mode The transaction mode.
230
+ */
231
+ openCursorByIndex<V, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(options: {
232
+ storeName: string;
233
+ indexName: string;
234
+ query?: IDBValidKey | IDBKeyRange | null;
235
+ direction?: IDBCursorDirection;
236
+ mode?: DBMode;
237
+ }): Observable<NgxIDBCursorWithValue<V, P, K>>;
238
+ /**
239
+ * Returns all items by an index.
240
+ * @param storeName The name of the store to query
241
+ * @param indexName The index name to filter
242
+ * @param query The key or key range criteria to apply
243
+ * @param direction A string telling the cursor which direction to travel.
244
+ */
245
+ getAllByIndex<T>(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): Observable<T[]>;
246
+ /**
247
+ * Returns all primary keys by an index.
248
+ * @param storeName The name of the store to query
249
+ * @param query The key or key range criteria to apply
250
+ * @param direction A string telling the cursor which direction to travel.
251
+ */
252
+ getAllKeysByIndex<P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): Observable<IndexKey<P, K>[]>;
253
+ /**
254
+ * Returns the number of rows in a store.
255
+ * @param storeName The name of the store to query
256
+ * @param query The key or key range criteria to apply.
257
+ */
258
+ count(storeName: string, query?: IDBValidKey | IDBKeyRange): Observable<number>;
259
+ /**
260
+ * Returns the number of records within a key range.
261
+ * @param storeName The name of the store to query
262
+ * @param indexName The index name to filter
263
+ * @param query The key or key range criteria to apply.
264
+ */
265
+ countByIndex(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange): Observable<number>;
266
+ /**
267
+ * Delete the store by name.
268
+ * @param storeName The name of the store to query
269
+ */
270
+ deleteObjectStore(storeName: string): Observable<void>;
271
+ /**
272
+ * Get all object store names.
273
+ */
274
+ getAllObjectStoreNames(): Observable<string[]>;
275
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxIndexedDBService, never>;
276
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxIndexedDBService>;
277
+ }
278
+
279
+ declare const provideIndexedDb: (...dbConfigs: DBConfig[]) => i0.EnvironmentProviders;
280
+
281
+ export { CONFIG_TOKEN, DBMode, INDEXED_DB, NgxIndexedDBModule, NgxIndexedDBService, SERVER_INDEXED_DB, provideIndexedDb };
282
+ export type { DBConfig, IndexDetails, IndexKey, NgxIDBCursor, NgxIDBCursorWithValue, ObjectStoreMeta, ObjectStoreSchema, RequestEvent, RequestEventTarget, WithID };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-indexed-db",
3
3
  "author": "Charles Assunção",
4
4
  "description": "Angular wrapper to IndexedDB database.",
5
- "version": "20.0.1",
5
+ "version": "21.0.0",
6
6
  "license": "ISC",
7
7
  "private": false,
8
8
  "keywords": [
@@ -21,8 +21,8 @@
21
21
  "url": "https://github.com/assuncaocharles/ngx-indexed-db"
22
22
  },
23
23
  "peerDependencies": {
24
- "@angular/common": ">=10.0.6 < 20.0.0",
25
- "@angular/core": ">=10.0.6 < 20.0.0"
24
+ "@angular/common": ">=10.0.6 < 21.0.0",
25
+ "@angular/core": ">=10.0.6 < 21.0.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "tslib": "^2.0.0"
@@ -1 +0,0 @@
1
- export declare function CloseDbConnection(): MethodDecorator;
@@ -1,9 +0,0 @@
1
- import { ObjectStoreMeta } from './ngx-indexed-db.meta';
2
- import { Observable } from 'rxjs';
3
- export declare const openedDatabases: IDBDatabase[];
4
- export declare function openDatabase(indexedDB: IDBFactory, dbName: string, version?: number, upgradeCallback?: (a: Event, b: IDBDatabase) => void): Promise<IDBDatabase>;
5
- export declare function CreateObjectStore(indexedDB: IDBFactory, dbName: string, version: number, storeSchemas: ObjectStoreMeta[], migrationFactory?: () => {
6
- [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
7
- }): Promise<void>;
8
- export declare function DeleteObjectStore(dbName: string, version: number, storeName: string): Observable<void>;
9
- export declare function closeDatabase(db: IDBDatabase): Promise<void>;
@@ -1,64 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export interface DBConfig {
3
- name: string;
4
- version?: number;
5
- objectStoresMeta: ObjectStoreMeta[];
6
- migrationFactory?: () => {
7
- [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
8
- };
9
- isDefault?: boolean;
10
- }
11
- export interface ObjectStoreMeta {
12
- store: string;
13
- storeConfig: {
14
- keyPath: string | string[];
15
- autoIncrement: boolean;
16
- [key: string]: any;
17
- };
18
- storeSchema: ObjectStoreSchema[];
19
- }
20
- export interface ObjectStoreSchema {
21
- name: string;
22
- keypath: string | string[];
23
- options: {
24
- unique: boolean;
25
- [key: string]: any;
26
- };
27
- }
28
- export interface IndexDetails {
29
- indexName: string;
30
- order: string;
31
- }
32
- export interface RequestEvent<T> extends Event {
33
- target: RequestEventTarget<T>;
34
- }
35
- export interface RequestEventTarget<T> extends EventTarget {
36
- result: T | T[];
37
- }
38
- export declare enum DBMode {
39
- readonly = "readonly",
40
- readwrite = "readwrite"
41
- }
42
- export type WithID = {
43
- id: number;
44
- };
45
- export type IndexKey<P extends IDBValidKey, K extends IDBValidKey> = {
46
- readonly primaryKey: P;
47
- readonly key: K;
48
- };
49
- type Modify<T, R> = Omit<T, keyof R> & R;
50
- export type NgxIDBCursor<P extends IDBValidKey, K extends IDBValidKey, V = any> = Modify<IDBCursor, {
51
- key: K;
52
- primaryKey: P;
53
- update(value: V): IDBRequest<IDBValidKey>;
54
- }>;
55
- export type NgxIDBCursorWithValue<V = any, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey> = NgxIDBCursor<P, K, V> & {
56
- value: V;
57
- };
58
- export declare const CONFIG_TOKEN: InjectionToken<Record<string, DBConfig>>;
59
- export declare const INDEXED_DB: InjectionToken<IDBFactory>;
60
- /**
61
- * Token used to inject the indexed db implementation on the server
62
- */
63
- export declare const SERVER_INDEXED_DB: InjectionToken<IDBFactory>;
64
- export {};
@@ -1,206 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { DBConfig, DBMode, IndexKey, NgxIDBCursorWithValue, ObjectStoreMeta, WithID } from './ngx-indexed-db.meta';
3
- import * as i0 from "@angular/core";
4
- export declare class NgxIndexedDBService {
5
- private dbConfigs;
6
- private indexedDB;
7
- private defaultDatabaseName?;
8
- private selectedDb;
9
- constructor(dbConfigs: Record<string, DBConfig>, indexedDB: IDBFactory);
10
- private instanciateConfig;
11
- private get dbConfig();
12
- /**
13
- * The function return the current version of database
14
- *
15
- * @Return the current version of database as number
16
- */
17
- getDatabaseVersion(): Observable<number | string>;
18
- /**
19
- * Selects a database for the current context.
20
- * @param {string} [databaseName=undefined] Database name to select.
21
- */
22
- selectDb(databaseName?: string): void;
23
- /**
24
- * Allows to create a new object store ad-hoc
25
- * @param storeName The name of the store to be created
26
- * @param migrationFactory The migration factory if exists
27
- */
28
- createObjectStore(storeSchema: ObjectStoreMeta, migrationFactory?: () => {
29
- [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
30
- }): Promise<void>;
31
- /**
32
- * Create dynamic store if not already without incrementing version
33
- * For Dynamic store
34
- * @param storeName The name of the store to create
35
- */
36
- createDynamicObjectStore(storeSchema: ObjectStoreMeta, migrationFactory?: () => {
37
- [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
38
- }): Promise<void>;
39
- /**
40
- * Adds new entry in the store and returns its key
41
- * @param storeName The name of the store to add the item
42
- * @param value The entry to be added
43
- * @param key The optional key for the entry
44
- */
45
- add<T>(storeName: string, value: T, key?: any): Observable<T & WithID>;
46
- /**
47
- * Adds new entries in the store and returns its key
48
- * @param storeName The name of the store to add the item
49
- * @param values The entries to be added containing optional key attribute
50
- */
51
- bulkAdd<T>(storeName: string, values: Array<T & {
52
- key?: any;
53
- }>): Observable<number[]>;
54
- /**
55
- * Delete entries in the store and returns current entries in the store
56
- * @param storeName The name of the store to add the item
57
- * @param keys The keys to be deleted
58
- */
59
- bulkDelete(storeName: string, keys: IDBValidKey[]): Observable<number[]>;
60
- /**
61
- * Returns entry by key.
62
- * @param storeName The name of the store to query
63
- * @param key The entry key
64
- */
65
- getByKey<T>(storeName: string, key: IDBValidKey): Observable<T>;
66
- /**
67
- * Retrieve multiple entries in the store
68
- * @param storeName The name of the store to retrieve the items
69
- * @param keys The ids entries to be retrieve
70
- */
71
- bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): Observable<T[]>;
72
- /**
73
- * Returns entry by id.
74
- * @param storeName The name of the store to query
75
- * @param id The entry id
76
- */
77
- getByID<T>(storeName: string, id: string | number): Observable<T>;
78
- /**
79
- * Returns entry by index.
80
- * @param storeName The name of the store to query
81
- * @param indexName The index name to filter
82
- * @param key The entry key.
83
- */
84
- getByIndex<T>(storeName: string, indexName: string, key: IDBValidKey): Observable<T>;
85
- /**
86
- * Return all elements from one store
87
- * @param storeName The name of the store to select the items
88
- */
89
- getAll<T>(storeName: string): Observable<T[]>;
90
- /**
91
- * Adds or updates a record in store with the given value and key. Return all items present in the store
92
- * @param storeName The name of the store to update
93
- * @param value The new value for the entry
94
- */
95
- update<T>(storeName: string, value: T): Observable<T>;
96
- /**
97
- * Adds or updates a record in store with the given value and key. Return all items present in the store
98
- * @param storeName The name of the store to update
99
- * @param items The values to update in the DB
100
- *
101
- * @Return The return value is an Observable with the primary key of the object that was last in given array
102
- *
103
- * @error If the call to bulkPut fails the transaction will be aborted and previously inserted entities will be deleted
104
- */
105
- bulkPut<T>(storeName: string, items: T[]): Observable<IDBValidKey>;
106
- /**
107
- * Returns all items from the store after delete.
108
- * @param storeName The name of the store to have the entry deleted
109
- * @param query The key or key range criteria to apply
110
- */
111
- delete<T>(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<T[]>;
112
- /**
113
- * Returns after a successful delete.
114
- * @param storeName The name of the store to have the entry deleted
115
- * @param query The key or key range criteria to apply
116
- */
117
- deleteByKey(storeName: string, query: IDBValidKey | IDBKeyRange): Observable<void>;
118
- /**
119
- * Delete all items by an index.
120
- * @param storeName The name of the store to query
121
- * @param indexName The index name to filter
122
- * @param query The key or key range criteria to apply
123
- * @param direction A string telling the cursor which direction to travel.
124
- */
125
- deleteAllByIndex<T>(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): Observable<void>;
126
- /**
127
- * Clear the data in the objectStore.
128
- * @param storeName The name of the store to have the entries deleted
129
- */
130
- clear(storeName: string): Observable<void>;
131
- /**
132
- * Delete database.
133
- */
134
- deleteDatabase(): Observable<void>;
135
- /**
136
- * Returns the open cursor
137
- * If no matching data are present, the observable is completed immediately.
138
- * @param options The options to open the cursor
139
- * @param options.storeName The name of the store to have the entries deleted
140
- * @param options.query The key or key range criteria to apply
141
- * @param options.direction A string telling the cursor which direction to travel
142
- * @param options.mode The transaction mode.
143
- */
144
- openCursor<V = any, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(options: {
145
- storeName: string;
146
- query?: IDBValidKey | IDBKeyRange | null;
147
- direction?: IDBCursorDirection;
148
- mode: DBMode;
149
- }): Observable<NgxIDBCursorWithValue<V, P, K>>;
150
- /**
151
- * Open a cursor by index filter
152
- * If no matching data are present, the observable is completed immediately.
153
- * @param options The options to open the cursor
154
- * @param options.storeName The name of the store to query
155
- * @param options.indexName The index name to filter
156
- * @param options.query The key or key range criteria to apply
157
- * @param options.direction A string telling the cursor which direction to travel
158
- * @param options.mode The transaction mode.
159
- */
160
- openCursorByIndex<V, P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(options: {
161
- storeName: string;
162
- indexName: string;
163
- query?: IDBValidKey | IDBKeyRange | null;
164
- direction?: IDBCursorDirection;
165
- mode?: DBMode;
166
- }): Observable<NgxIDBCursorWithValue<V, P, K>>;
167
- /**
168
- * Returns all items by an index.
169
- * @param storeName The name of the store to query
170
- * @param indexName The index name to filter
171
- * @param query The key or key range criteria to apply
172
- * @param direction A string telling the cursor which direction to travel.
173
- */
174
- getAllByIndex<T>(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): Observable<T[]>;
175
- /**
176
- * Returns all primary keys by an index.
177
- * @param storeName The name of the store to query
178
- * @param query The key or key range criteria to apply
179
- * @param direction A string telling the cursor which direction to travel.
180
- */
181
- getAllKeysByIndex<P extends IDBValidKey = IDBValidKey, K extends IDBValidKey = IDBValidKey>(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): Observable<IndexKey<P, K>[]>;
182
- /**
183
- * Returns the number of rows in a store.
184
- * @param storeName The name of the store to query
185
- * @param query The key or key range criteria to apply.
186
- */
187
- count(storeName: string, query?: IDBValidKey | IDBKeyRange): Observable<number>;
188
- /**
189
- * Returns the number of records within a key range.
190
- * @param storeName The name of the store to query
191
- * @param indexName The index name to filter
192
- * @param query The key or key range criteria to apply.
193
- */
194
- countByIndex(storeName: string, indexName: string, query?: IDBValidKey | IDBKeyRange): Observable<number>;
195
- /**
196
- * Delete the store by name.
197
- * @param storeName The name of the store to query
198
- */
199
- deleteObjectStore(storeName: string): Observable<void>;
200
- /**
201
- * Get all object store names.
202
- */
203
- getAllObjectStoreNames(): Observable<string[]>;
204
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxIndexedDBService, never>;
205
- static ɵprov: i0.ɵɵInjectableDeclaration<NgxIndexedDBService>;
206
- }
@@ -1,9 +0,0 @@
1
- import { ModuleWithProviders } from '@angular/core';
2
- import { DBConfig } from './ngx-indexed-db.meta';
3
- import * as i0 from "@angular/core";
4
- export declare class NgxIndexedDBModule {
5
- static forRoot(...dbConfigs: DBConfig[]): ModuleWithProviders<NgxIndexedDBModule>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxIndexedDBModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxIndexedDBModule, never, never, never>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxIndexedDBModule>;
9
- }
@@ -1,4 +0,0 @@
1
- import { Provider } from '@angular/core';
2
- import { DBConfig } from './ngx-indexed-db.meta';
3
- export declare const provideIndexedDb: (...dbConfigs: DBConfig[]) => import("@angular/core").EnvironmentProviders;
4
- export declare const _provideIndexedDb: (...dbConfigs: DBConfig[]) => Provider[];
package/public-api.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './lib/ngxindexeddb.module';
2
- export * from './lib/ngx-indexed-db.service';
3
- export * from './lib/ngx-indexed-db.meta';
4
- export { provideIndexedDb } from './lib/provide-indexed-db';
package/ssr/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Factory function for creating an instance of IDBFactory.
3
- *
4
- * It determines the platform using the {@link PLATFORM_ID} to decide whether to use the
5
- * browser's IndexedDB or a server-side implementation.
6
- *
7
- * @returns {IDBFactory} IDBFactory.
8
- */
9
- export declare function indexedDbFactory(): IDBFactory;
@@ -1,12 +0,0 @@
1
- /**
2
- *
3
- * A class that implements the IDBFactory interface, but only for the server.
4
- * All methods return a mocked value.
5
- *
6
- */
7
- export declare class ServerIndexedDB implements IDBFactory {
8
- cmp(): number;
9
- databases(): Promise<IDBDatabaseInfo[]>;
10
- deleteDatabase(): IDBOpenDBRequest;
11
- open(): IDBOpenDBRequest;
12
- }
package/utils/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export interface Options {
2
- storeName: string;
3
- dbMode: IDBTransactionMode;
4
- error: (e: Event) => any;
5
- complete?: (e: Event) => any;
6
- abort?: any;
7
- }
8
- export declare function validateStoreName(db: IDBDatabase, storeName: string): boolean;
9
- export declare function validateBeforeTransaction(db: IDBDatabase, storeName: string, reject: (message: string) => void): void;
10
- export declare function createTransaction(db: IDBDatabase, options: Options): IDBTransaction;
11
- export declare function optionsGenerator(type: any, storeName: any, reject: (reason?: any) => void, resolve?: (e: any) => void): Options;