ngx-indexed-db 9.1.2 → 9.4.2

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 +1 @@
1
- {"version":3,"file":"ngx-indexed-db.js","sources":["../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts","../../../projects/ngx-indexed-db/src/utils/index.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.meta.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts","../../../projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts","../../../projects/ngx-indexed-db/src/ngx-indexed-db.ts"],"sourcesContent":["import { ObjectStoreMeta, ObjectStoreSchema } from './ngx-indexed-db.meta';\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 = (event: Event) => {\n db = request.result;\n resolve(db);\n };\n request.onerror = (event: Event) => {\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 function CreateObjectStore(\n indexedDB: IDBFactory,\n dbName: string,\n version: number,\n storeSchemas: ObjectStoreMeta[],\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n): void {\n if (!indexedDB) {\n return;\n }\n const request: IDBOpenDBRequest = indexedDB.open(dbName, version);\n\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\n const database: IDBDatabase = (event.target as any).result;\n\n storeSchemas.forEach((storeSchema: ObjectStoreMeta) => {\n if (!database.objectStoreNames.contains(storeSchema.store)) {\n const objectStore = database.createObjectStore(storeSchema.store, storeSchema.storeConfig);\n storeSchema.storeSchema.forEach((schema: ObjectStoreSchema) => {\n objectStore.createIndex(schema.name, schema.keypath, schema.options);\n });\n }\n });\n\n const storeMigrations = migrationFactory && migrationFactory();\n if (storeMigrations) {\n Object.keys(storeMigrations)\n .map((k) => parseInt(k, 10))\n .filter((v) => v > event.oldVersion)\n .sort((a, b) => a - b)\n .forEach((v) => {\n storeMigrations[v](database, request.transaction);\n });\n }\n\n database.close();\n };\n\n request.onsuccess = (e: any) => {\n e.target.result.close();\n };\n}\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 }\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.oncomplete = options.complete;\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 resolve: (e: any) => void\n): Options {\n return {\n storeName,\n dbMode: type,\n error: (e: Event) => {\n reject(e);\n },\n complete: (e: Event) => {\n resolve(e);\n },\n abort: (e: Event) => {\n reject(e);\n },\n };\n}\n","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}\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 Key = string | number | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey | IDBKeyRange;\n\nexport const CONFIG_TOKEN = new InjectionToken<DBConfig>(null);\n","import { Injectable, Inject, PLATFORM_ID } from '@angular/core';\nimport { openDatabase, CreateObjectStore } from './ngx-indexed-db';\nimport { createTransaction, optionsGenerator, validateBeforeTransaction } from '../utils';\nimport { CONFIG_TOKEN, DBConfig, Key, RequestEvent, ObjectStoreMeta, DBMode } from './ngx-indexed-db.meta';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Observable, from, Subject } from 'rxjs';\nimport { take } from 'rxjs/operators';\n\n@Injectable()\nexport class NgxIndexedDBService {\n private readonly isBrowser: boolean;\n private indexedDB: IDBFactory;\n\n constructor(@Inject(CONFIG_TOKEN) private dbConfig: DBConfig, @Inject(PLATFORM_ID) private platformId: any) {\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 this.isBrowser = isPlatformBrowser(this.platformId);\n if (this.isBrowser) {\n this.indexedDB =\n window.indexedDB ||\n (window as any).mozIndexedDB ||\n (window as any).webkitIndexedDB ||\n (window as any).msIndexedDB;\n\n 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 (process.env.NODE_ENV !== 'production') {\n console.warn(`\n Your DB Config doesn't match the most recent version of the DB with name ${this.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.dbConfig.version = db.version;\n }\n });\n }\n }\n\n /**\n * Allows to crate 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 createObjectStore(\n storeSchema: ObjectStoreMeta,\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n ): void {\n const storeSchemas: ObjectStoreMeta[] = [storeSchema];\n 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 add<T>(storeName: string, value: T, key?: any): Observable<number> {\n return from(\n 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 const request: IDBRequest<IDBValidKey> = Boolean(key)\n ? objectStore.add(value, key)\n : objectStore.add(value);\n\n request.onsuccess = (evt: Event) => {\n const result = (evt.target as IDBOpenDBRequest).result;\n resolve((result as unknown) as number);\n };\n })\n .catch((reason) => reject(reason));\n })\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 bulkAdd<T>(storeName: string, values: T & { key?: any }[]): Observable<number[]> {\n const promises = values.map((value) => {\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\n const key = value.key;\n delete value.key;\n\n const request: IDBRequest<IDBValidKey> = Boolean(key)\n ? objectStore.add(value, key)\n : objectStore.add(value);\n\n request.onsuccess = (evt: Event) => {\n const result = (evt.target as IDBOpenDBRequest).result;\n resolve((result as unknown) as number);\n };\n })\n .catch((reason) => reject(reason));\n });\n });\n return from(Promise.resolve(Promise.all(promises)));\n }\n\n /**\n * Adds new entry in the store and returns the item that was added\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 addItem<T>(storeName: string, value: T, key?: any): Observable<T> {\n return from(\n new Promise<T>((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 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 const itemKey = hasKey ? key : ((result as unknown) as number);\n this.getByKey(storeName, itemKey).subscribe((newValue) => {\n resolve(newValue as T);\n });\n };\n })\n .catch((reason) => reject(reason));\n })\n );\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 getByKey<T>(storeName: string, key: IDBValidKey): Observable<T> {\n return from(\n new Promise<T>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const request = objectStore.get(key) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n resolve((event.target as IDBRequest<T>).result);\n };\n request.onerror = (event: Event) => {\n reject(event);\n };\n })\n .catch((reason) => reject(reason));\n })\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 bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): Observable<T[]> {\n const promises = keys.map((key) => this.getByKey<T>(storeName, key).toPromise());\n return from(Promise.resolve(Promise.all(promises)));\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 getByID<T>(storeName: string, id: string | number): Observable<T> {\n return from(\n new Promise<T>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const request: IDBRequest = objectStore.get(id) as IDBRequest<T>;\n request.onsuccess = (event: Event) => {\n resolve((event.target as IDBRequest<T>).result);\n };\n })\n .catch((reason) => reject(reason));\n })\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 getByIndex<T>(storeName: string, indexName: string, key: IDBValidKey): Observable<T> {\n return from(\n new Promise<T>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\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 resolve((event.target as IDBRequest<T>).result);\n };\n })\n .catch((reason) => reject(reason));\n })\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 getAll<T>(storeName: string): Observable<T[]> {\n return from(\n new Promise<T[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n\n const request: IDBRequest = objectStore.getAll();\n\n request.onerror = (evt: Event) => {\n reject(evt);\n };\n\n request.onsuccess = ({ target: { result: ResultAll } }: RequestEvent<T>) => {\n resolve(ResultAll as T[]);\n };\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Returns all items from the store after update.\n * @param storeName The name of the store to update\n * @param value The new value for the entry\n * @param key The key of the entry to update if exists\n */\n update<T>(storeName: string, value: T, key?: any): Observable<T[]> {\n return from(\n new Promise<T[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n\n transaction.oncomplete = () => {\n this.getAll(storeName)\n .pipe(take(1))\n .subscribe((newValues) => {\n resolve(newValues as T[]);\n });\n };\n\n key ? objectStore.put(value, key) : objectStore.put(value);\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Returns the item you updated from the store after the update.\n * @param storeName The name of the store to update\n * @param value The new value for the entry\n * @param key The key of the entry to update\n */\n updateByKey<T>(storeName: string, value: T, key: IDBValidKey): Observable<T> {\n return from(\n new Promise<T>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n\n transaction.oncomplete = () => {\n this.getByKey(storeName, key).subscribe((newValue) => {\n resolve(newValue as T);\n });\n };\n\n objectStore.put(value, key);\n })\n .catch((reason) => reject(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 key The key of the entry to be deleted\n */\n delete<T>(storeName: string, key: Key): Observable<T[]> {\n return from(\n new Promise<T[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\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 T[]);\n });\n };\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Returns true from the store after a successful delete.\n * @param storeName The name of the store to have the entry deleted\n * @param key The key of the entry to be deleted\n */\n deleteByKey(storeName: string, key: Key): Observable<boolean> {\n return from(\n new Promise<boolean>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n\n transaction.oncomplete = () => {\n resolve(true);\n };\n\n objectStore.delete(key);\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Returns true if successfully delete all entries from the store.\n * @param storeName The name of the store to have the entries deleted\n */\n clear(storeName: string): Observable<boolean> {\n return from(\n new Promise<boolean>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n objectStore.clear();\n transaction.oncomplete = () => {\n resolve(true);\n };\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Returns true if successfully delete the DB.\n */\n deleteDatabase(): Observable<boolean> {\n return from(\n new Promise<boolean>(async (resolve, reject) => {\n try {\n const db = await openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version);\n await db.close();\n const deleteDBRequest = this.indexedDB.deleteDatabase(this.dbConfig.name);\n deleteDBRequest.onsuccess = () => {\n resolve(true);\n };\n deleteDBRequest.onerror = reject;\n deleteDBRequest.onblocked = () => {\n throw new Error(`Unable to delete database because it's blocked`);\n };\n } catch (evt) {\n reject(evt);\n }\n })\n );\n }\n\n /**\n * Returns the open cursor event\n * @param storeName The name of the store to have the entries deleted\n * @param keyRange The key range which the cursor should be open on\n */\n openCursor(storeName: string, keyRange?: IDBKeyRange): Observable<Event> {\n return from(\n new Promise<Event>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const request = keyRange === undefined ? objectStore.openCursor() : objectStore.openCursor(keyRange);\n\n request.onsuccess = (event: Event) => {\n resolve(event);\n };\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Open a cursor by index filter.\n * @param storeName The name of the store to query.\n * @param indexName The index name to filter.\n * @param keyRange The range value and criteria to apply on the index.\n */\n openCursorByIndex(\n storeName: string,\n indexName: string,\n keyRange: IDBKeyRange,\n mode: DBMode = DBMode.readonly\n ): Observable<Event> {\n const obs = new Subject<Event>();\n\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (reason) => {\n obs.error(reason);\n });\n const transaction = createTransaction(\n db,\n optionsGenerator(\n mode,\n storeName,\n (reason) => {\n obs.error(reason);\n },\n () => {\n obs.next();\n }\n )\n );\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(keyRange);\n\n request.onsuccess = (event: Event) => {\n obs.next(event);\n };\n })\n .catch((reason) => obs.error(reason));\n\n return obs;\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 keyRange The range value and criteria to apply on the index.\n */\n getAllByIndex<T>(storeName: string, indexName: string, keyRange: IDBKeyRange): Observable<T[]> {\n const data: T[] = [];\n return from(\n new Promise<T[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(keyRange);\n request.onsuccess = (event) => {\n const cursor: IDBCursorWithValue = (event.target as IDBRequest<IDBCursorWithValue>).result;\n if (cursor) {\n data.push(cursor.value);\n cursor.continue();\n } else {\n resolve(data);\n }\n };\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n\n /**\n * Returns all primary keys by an index.\n * @param storeName The name of the store to query\n * @param indexName The index name to filter\n * @param keyRange The range value and criteria to apply on the index.\n */\n getAllKeysByIndex(\n storeName: string,\n indexName: string,\n keyRange: IDBKeyRange\n ): Observable<{ primaryKey: any; key: any }[]> {\n const data: { primaryKey: any; key: any }[] = [];\n return from(\n new Promise<{ primaryKey: any; key: any }[]>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openKeyCursor(keyRange);\n request.onsuccess = (event) => {\n const cursor: IDBCursor = (event.target as IDBRequest<IDBCursor>).result;\n if (cursor) {\n data.push({ primaryKey: cursor.primaryKey, key: cursor.key });\n cursor.continue();\n } else {\n resolve(data);\n }\n };\n })\n .catch((reason) => reject(reason));\n })\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 keyRange The range value and criteria to apply.\n */\n count(storeName: string, keyRange?: IDBValidKey | IDBKeyRange): Observable<number> {\n return from(\n new Promise<number>((resolve, reject) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, reject);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, reject, resolve));\n const objectStore = transaction.objectStore(storeName);\n const request: IDBRequest = objectStore.count(keyRange);\n request.onerror = (e) => reject(e);\n request.onsuccess = (e) => resolve(((e.target as IDBOpenDBRequest).result as unknown) as number);\n })\n .catch((reason) => reject(reason));\n })\n );\n }\n}\n","import { NgModule, ModuleWithProviders, InjectionToken } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NgxIndexedDBService } from './ngx-indexed-db.service';\nimport { DBConfig, CONFIG_TOKEN } from './ngx-indexed-db.meta';\n\n@NgModule({\n declarations: [],\n imports: [CommonModule]\n})\nexport class NgxIndexedDBModule {\n static forRoot(dbConfig: DBConfig): ModuleWithProviders<NgxIndexedDBModule> {\n return {\n ngModule: NgxIndexedDBModule,\n providers: [NgxIndexedDBService, { provide: CONFIG_TOKEN, useValue: dbConfig }]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;SAEgB,YAAY,CAC1B,SAAqB,EACrB,MAAc,EACd,OAAgB,EAChB,eAAoD;IAEpD,OAAO,IAAI,OAAO,CAAc,CAAC,OAAO,EAAE,MAAM;QAC9C,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,CAAC,yBAAyB,CAAC,CAAC;SACnC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,EAAe,CAAC;QACpB,OAAO,CAAC,SAAS,GAAG,CAAC,KAAY;YAC/B,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;YACpB,OAAO,CAAC,EAAE,CAAC,CAAC;SACb,CAAC;QACF,OAAO,CAAC,OAAO,GAAG,CAAC,KAAY;YAC7B,MAAM,CAAC,oBAAoB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;SAC7C,CAAC;QACF,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;YACzC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AAC,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;gBACzG,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACvD,MAAM,OAAO,GAAe,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACxD,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;gBACnC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,OAAO,CAAG,CAAC,CAAC,MAA2B,CAAC,MAA4B,CAAC,CAAC;aAClG,CAAC;iBACD,KAAK,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;SACtC,CAAC,CACH,CAAC;KACH;;;YAzjBF,UAAU;;;4CAKI,MAAM,SAAC,YAAY;4CAA+B,MAAM,SAAC,WAAW;;;MCJtE,kBAAkB;IAC7B,OAAO,OAAO,CAAC,QAAkB;QAC/B,OAAO;YACL,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;SAChF,CAAC;KACH;;;YAVF,QAAQ,SAAC;gBACR,YAAY,EAAE,EAAE;gBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;aACxB;;;ACRD;;;;;;"}
1
+ {"version":3,"file":"ngx-indexed-db.js","sources":["../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.ts","../../../projects/ngx-indexed-db/src/utils/index.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.meta.ts","../../../projects/ngx-indexed-db/src/lib/ngx-indexed-db.service.ts","../../../projects/ngx-indexed-db/src/lib/ngxindexeddb.module.ts","../../../projects/ngx-indexed-db/src/ngx-indexed-db.ts"],"sourcesContent":["import { ObjectStoreMeta, ObjectStoreSchema } from './ngx-indexed-db.meta';\nimport { Observable, Subscriber } from 'rxjs';\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 = (event: Event) => {\n db = request.result;\n resolve(db);\n };\n request.onerror = (event: Event) => {\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 function CreateObjectStore(\n indexedDB: IDBFactory,\n dbName: string,\n version: number,\n storeSchemas: ObjectStoreMeta[],\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n): void {\n if (!indexedDB) {\n return;\n }\n const request: IDBOpenDBRequest = indexedDB.open(dbName, version);\n\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\n const database: IDBDatabase = (event.target as any).result;\n\n storeSchemas.forEach((storeSchema: ObjectStoreMeta) => {\n if (!database.objectStoreNames.contains(storeSchema.store)) {\n const objectStore = database.createObjectStore(storeSchema.store, storeSchema.storeConfig);\n storeSchema.storeSchema.forEach((schema: ObjectStoreSchema) => {\n objectStore.createIndex(schema.name, schema.keypath, schema.options);\n });\n }\n });\n\n const storeMigrations = migrationFactory && migrationFactory();\n if (storeMigrations) {\n Object.keys(storeMigrations)\n .map((k) => parseInt(k, 10))\n .filter((v) => v > event.oldVersion)\n .sort((a, b) => a - b)\n .forEach((v) => {\n storeMigrations[v](database, request.transaction);\n });\n }\n\n database.close();\n };\n\n request.onsuccess = (e: any) => {\n e.target.result.close();\n };\n}\n\nexport function DeleteObjectStore(dbName: string, version: number, storeName: string): Observable<boolean> {\n if (!dbName || !version || !storeName) {\n throw Error('Params: \"dbName\", \"version\", \"storeName\" are mandatory.');\n }\n\n return new Observable<boolean>((obs: Subscriber<boolean>) => {\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(true);\n obs.complete();\n };\n\n request.onerror = (e) => obs.error(e);\n } catch (error) {\n obs.error(error);\n }\n });\n\n\n}\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 }\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 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 { 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}\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 Key = string | number | Date | ArrayBufferView | ArrayBuffer | IDBValidKey | IDBKeyRange;\n\nexport const CONFIG_TOKEN = new InjectionToken<DBConfig>(null);\n","import { Injectable, Inject, PLATFORM_ID } from '@angular/core';\nimport { openDatabase, CreateObjectStore, DeleteObjectStore } from './ngx-indexed-db';\nimport { createTransaction, optionsGenerator, validateBeforeTransaction } from '../utils';\nimport { CONFIG_TOKEN, DBConfig, Key, RequestEvent, ObjectStoreMeta, DBMode } from './ngx-indexed-db.meta';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Observable, Subject, forkJoin, combineLatest, from } from 'rxjs';\nimport { take } from 'rxjs/operators';\n\n@Injectable()\nexport class NgxIndexedDBService {\n private readonly isBrowser: boolean;\n private indexedDB: IDBFactory;\n\n constructor(@Inject(CONFIG_TOKEN) private dbConfig: DBConfig, @Inject(PLATFORM_ID) private platformId: any) {\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 this.isBrowser = isPlatformBrowser(this.platformId);\n if (this.isBrowser) {\n this.indexedDB =\n window.indexedDB ||\n (window as any).mozIndexedDB ||\n (window as any).webkitIndexedDB ||\n (window as any).msIndexedDB;\n\n 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 (process.env.NODE_ENV !== 'production') {\n console.warn(`\n Your DB Config doesn't match the most recent version of the DB with name ${this.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.dbConfig.version = db.version;\n }\n });\n }\n }\n\n /**\n * Allows to crate 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 createObjectStore(\n storeSchema: ObjectStoreMeta,\n migrationFactory?: () => { [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void }\n ): void {\n const storeSchemas: ObjectStoreMeta[] = [storeSchema];\n 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 add<T>(storeName: string, value: T, key?: any): Observable<T> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db: IDBDatabase) => {\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request: IDBRequest<IDBValidKey> = Boolean(key) ? 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>).result);\n obs.complete();\n };\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 bulkAdd<T>(storeName: string, values: 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, reject1) => {\n const key = value.key;\n delete value.key;\n\n const request: IDBRequest<IDBValidKey> = Boolean(key)\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 bulkDelete(storeName: string, keys: Key[]): 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 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 bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): any {\n const observables = keys.map((key) => this.getByKey(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 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, obs.error);\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 };\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 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, obs.error);\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 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, obs.error);\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 * Returns all items from the store after update.\n * @param storeName The name of the store to update\n * @param value The new value for the entry\n * @param key The key of the entry to update if exists\n */\n update<T>(storeName: string, value: T, key?: any): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n\n transaction.oncomplete = () => {\n this.getAll(storeName)\n .pipe(take(1))\n .subscribe((newValues) => {\n obs.next(newValues as T[]);\n obs.complete();\n });\n };\n\n key ? objectStore.put(value, key) : objectStore.put(value);\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns the item you updated from the store after the update.\n * @param storeName The name of the store to update\n * @param value The new value for the entry\n * @param key The key of the entry to update\n */\n updateByKey<T>(storeName: string, value: T, key: IDBValidKey): Observable<T> {\n return new Observable<T>((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n\n transaction.oncomplete = () => {\n this.getByKey(storeName, key)\n .pipe(take(1))\n .subscribe((newValue) => {\n obs.next(newValue as T);\n obs.complete();\n });\n };\n\n objectStore.put(value, key);\n })\n .catch((reason) => obs.error(reason));\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 key The key of the entry to be deleted\n */\n delete<T>(storeName: string, key: Key): Observable<T[]> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\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 obs.next(newValues as T[]);\n obs.complete();\n });\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns true from the store after a successful delete.\n * @param storeName The name of the store to have the entry deleted\n * @param key The key of the entry to be deleted\n */\n deleteByKey(storeName: string, key: Key): Observable<boolean> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n\n transaction.oncomplete = () => {\n obs.next(true);\n obs.complete();\n };\n\n objectStore.delete(key);\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns true if successfully delete all entries from the store.\n * @param storeName The name of the store to have the entries deleted\n */\n clear(storeName: string): Observable<boolean> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readwrite, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n objectStore.clear();\n transaction.oncomplete = () => {\n obs.next(true);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Returns true if successfully delete the DB.\n */\n deleteDatabase(): Observable<boolean> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then(async (db) => {\n await db.close();\n const deleteDBRequest = this.indexedDB.deleteDatabase(this.dbConfig.name);\n deleteDBRequest.onsuccess = () => {\n obs.next(true);\n obs.complete();\n };\n deleteDBRequest.onerror = (error) => obs.error(error);\n deleteDBRequest.onblocked = () => {\n throw 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 event\n * @param storeName The name of the store to have the entries deleted\n * @param keyRange The key range which the cursor should be open on\n */\n openCursor(storeName: string, keyRange?: IDBKeyRange): Observable<Event> {\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request = keyRange === undefined ? objectStore.openCursor() : objectStore.openCursor(keyRange);\n\n request.onsuccess = (event: Event) => {\n obs.next(event);\n obs.complete();\n };\n })\n .catch((reason) => obs.error(reason));\n });\n }\n\n /**\n * Open a cursor by index filter.\n * @param storeName The name of the store to query.\n * @param indexName The index name to filter.\n * @param keyRange The range value and criteria to apply on the index.\n */\n openCursorByIndex(\n storeName: string,\n indexName: string,\n keyRange: IDBKeyRange,\n mode: DBMode = DBMode.readonly\n ): Observable<Event> {\n const obs = new Subject<Event>();\n\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, (reason) => {\n obs.error(reason);\n });\n const transaction = createTransaction(\n db,\n optionsGenerator(\n mode,\n storeName,\n (reason) => {\n obs.error(reason);\n },\n () => {\n obs.next();\n }\n )\n );\n const objectStore = transaction.objectStore(storeName);\n const index = objectStore.index(indexName);\n const request = index.openCursor(keyRange);\n\n request.onsuccess = (event: Event) => {\n obs.next(event);\n };\n })\n .catch((reason) => obs.error(reason));\n\n return obs;\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 keyRange The range value and criteria to apply on the index.\n */\n getAllByIndex<T>(storeName: string, indexName: string, keyRange: IDBKeyRange): Observable<T[]> {\n const data: T[] = [];\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\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(keyRange);\n request.onsuccess = (event) => {\n const cursor: IDBCursorWithValue = (event.target as IDBRequest<IDBCursorWithValue>).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 indexName The index name to filter\n * @param keyRange The range value and criteria to apply on the index.\n */\n getAllKeysByIndex(\n storeName: string,\n indexName: string,\n keyRange: IDBKeyRange\n ): Observable<{ primaryKey: any; key: any }[]> {\n const data: { primaryKey: any; key: any }[] = [];\n return new Observable((obs) => {\n openDatabase(this.indexedDB, this.dbConfig.name, this.dbConfig.version)\n .then((db) => {\n validateBeforeTransaction(db, storeName, obs.error);\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.openKeyCursor(keyRange);\n request.onsuccess = (event) => {\n const cursor: IDBCursor = (event.target as IDBRequest<IDBCursor>).result;\n if (cursor) {\n data.push({ primaryKey: cursor.primaryKey, key: cursor.key });\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 keyRange The range value and criteria to apply.\n */\n count(storeName: string, keyRange?: 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, obs.error);\n const transaction = createTransaction(db, optionsGenerator(DBMode.readonly, storeName, obs.error));\n const objectStore = transaction.objectStore(storeName);\n const request: IDBRequest = objectStore.count(keyRange);\n request.onerror = (e) => obs.error(e);\n request.onsuccess = (e) => {\n obs.next(((e.target as IDBOpenDBRequest).result as unknown) as number);\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<boolean> {\n return DeleteObjectStore(this.dbConfig.name, ++this.dbConfig.version, storeName);\n }\n}\n","import { NgModule, ModuleWithProviders, InjectionToken } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NgxIndexedDBService } from './ngx-indexed-db.service';\nimport { DBConfig, CONFIG_TOKEN } from './ngx-indexed-db.meta';\n\n@NgModule({\n declarations: [],\n imports: [CommonModule]\n})\nexport class NgxIndexedDBModule {\n static forRoot(dbConfig: DBConfig): ModuleWithProviders<NgxIndexedDBModule> {\n return {\n ngModule: NgxIndexedDBModule,\n providers: [NgxIndexedDBService, { provide: CONFIG_TOKEN, useValue: dbConfig }]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;SAGgB,YAAY,CAC1B,SAAqB,EACrB,MAAc,EACd,OAAgB,EAChB,eAAoD;IAEpD,OAAO,IAAI,OAAO,CAAc,CAAC,OAAO,EAAE,MAAM;QAC9C,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,CAAC,yBAAyB,CAAC,CAAC;SACnC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,EAAe,CAAC;QACpB,OAAO,CAAC,SAAS,GAAG,CAAC,KAAY;YAC/B,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;YACpB,OAAO,CAAC,EAAE,CAAC,CAAC;SACb,CAAC;QACF,OAAO,CAAC,OAAO,GAAG,CAAC,KAAY;YAC7B,MAAM,CAAC,oBAAoB,OAAO,CAAC,KAAK,EAAE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O,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;KACpF;;;YA/jBF,UAAU;;;4CAKI,MAAM,SAAC,YAAY;4CAA+B,MAAM,SAAC,WAAW;;;MCJtE,kBAAkB;IAC7B,OAAO,OAAO,CAAC,QAAkB;QAC/B,OAAO;YACL,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;SAChF,CAAC;KACH;;;YAVF,QAAQ,SAAC;gBACR,YAAY,EAAE,EAAE;gBAChB,OAAO,EAAE,CAAC,YAAY,CAAC;aACxB;;;ACRD;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  import { ObjectStoreMeta } from './ngx-indexed-db.meta';
2
+ import { Observable } from 'rxjs';
2
3
  export declare function openDatabase(indexedDB: IDBFactory, dbName: string, version?: number, upgradeCallback?: (a: Event, b: IDBDatabase) => void): Promise<IDBDatabase>;
3
4
  export declare function CreateObjectStore(indexedDB: IDBFactory, dbName: string, version: number, storeSchemas: ObjectStoreMeta[], migrationFactory?: () => {
4
5
  [key: number]: (db: IDBDatabase, transaction: IDBTransaction) => void;
5
6
  }): void;
7
+ export declare function DeleteObjectStore(dbName: string, version: number, storeName: string): Observable<boolean>;
@@ -38,5 +38,5 @@ export declare enum DBMode {
38
38
  readonly = "readonly",
39
39
  readwrite = "readwrite"
40
40
  }
41
- export declare type Key = string | number | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey | IDBKeyRange;
41
+ export declare type Key = string | number | Date | ArrayBufferView | ArrayBuffer | IDBValidKey | IDBKeyRange;
42
42
  export declare const CONFIG_TOKEN: InjectionToken<DBConfig>;
@@ -20,7 +20,7 @@ export declare class NgxIndexedDBService {
20
20
  * @param value The entry to be added
21
21
  * @param key The optional key for the entry
22
22
  */
23
- add<T>(storeName: string, value: T, key?: any): Observable<number>;
23
+ add<T>(storeName: string, value: T, key?: any): Observable<T>;
24
24
  /**
25
25
  * Adds new entries in the store and returns its key
26
26
  * @param storeName The name of the store to add the item
@@ -30,12 +30,11 @@ export declare class NgxIndexedDBService {
30
30
  key?: any;
31
31
  }[]): Observable<number[]>;
32
32
  /**
33
- * Adds new entry in the store and returns the item that was added
33
+ * Delete entries in the store and returns current entries in the store
34
34
  * @param storeName The name of the store to add the item
35
- * @param value The entry to be added
36
- * @param key The optional key for the entry
35
+ * @param keys The keys to be deleted
37
36
  */
38
- addItem<T>(storeName: string, value: T, key?: any): Observable<T>;
37
+ bulkDelete(storeName: string, keys: Key[]): Observable<number[]>;
39
38
  /**
40
39
  * Returns entry by key.
41
40
  * @param storeName The name of the store to query
@@ -47,7 +46,7 @@ export declare class NgxIndexedDBService {
47
46
  * @param storeName The name of the store to retrieve the items
48
47
  * @param keys The ids entries to be retrieve
49
48
  */
50
- bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): Observable<T[]>;
49
+ bulkGet<T>(storeName: string, keys: Array<IDBValidKey>): any;
51
50
  /**
52
51
  * Returns entry by id.
53
52
  * @param storeName The name of the store to query
@@ -137,4 +136,9 @@ export declare class NgxIndexedDBService {
137
136
  * @param keyRange The range value and criteria to apply.
138
137
  */
139
138
  count(storeName: string, keyRange?: IDBValidKey | IDBKeyRange): Observable<number>;
139
+ /**
140
+ * Delete the store by name.
141
+ * @param storeName The name of the store to query
142
+ */
143
+ deleteObjectStore(storeName: string): Observable<boolean>;
140
144
  }
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"NgxIndexedDBModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"declarations":[],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":12}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["dbConfig"],"value":{"ngModule":{"__symbolic":"reference","name":"NgxIndexedDBModule"},"providers":[{"__symbolic":"reference","name":"NgxIndexedDBService"},{"provide":{"__symbolic":"reference","name":"CONFIG_TOKEN"},"useValue":{"__symbolic":"reference","name":"dbConfig"}}]}}}},"NgxIndexedDBService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":13,"character":15},"arguments":[{"__symbolic":"reference","name":"CONFIG_TOKEN"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":13,"character":65},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":13,"character":72}]}]],"parameters":[{"__symbolic":"reference","name":"DBConfig"},{"__symbolic":"reference","name":"any"}]}],"createObjectStore":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"bulkAdd":[{"__symbolic":"method"}],"addItem":[{"__symbolic":"method"}],"getByKey":[{"__symbolic":"method"}],"bulkGet":[{"__symbolic":"method"}],"getByID":[{"__symbolic":"method"}],"getByIndex":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"updateByKey":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"deleteByKey":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"deleteDatabase":[{"__symbolic":"method"}],"openCursor":[{"__symbolic":"method"}],"openCursorByIndex":[{"__symbolic":"method"}],"getAllByIndex":[{"__symbolic":"method"}],"getAllKeysByIndex":[{"__symbolic":"method"}],"count":[{"__symbolic":"method"}]}},"DBConfig":{"__symbolic":"interface"},"ObjectStoreMeta":{"__symbolic":"interface"},"ObjectStoreSchema":{"__symbolic":"interface"},"IndexDetails":{"__symbolic":"interface"},"RequestEvent":{"__symbolic":"interface"},"RequestEventTarget":{"__symbolic":"interface"},"DBMode":{"readonly":"readonly","readwrite":"readwrite"},"Key":{"__symbolic":"interface"},"CONFIG_TOKEN":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":41,"character":32},"arguments":[null]}},"origins":{"NgxIndexedDBModule":"./lib/ngxindexeddb.module","NgxIndexedDBService":"./lib/ngx-indexed-db.service","DBConfig":"./lib/ngx-indexed-db.meta","ObjectStoreMeta":"./lib/ngx-indexed-db.meta","ObjectStoreSchema":"./lib/ngx-indexed-db.meta","IndexDetails":"./lib/ngx-indexed-db.meta","RequestEvent":"./lib/ngx-indexed-db.meta","RequestEventTarget":"./lib/ngx-indexed-db.meta","DBMode":"./lib/ngx-indexed-db.meta","Key":"./lib/ngx-indexed-db.meta","CONFIG_TOKEN":"./lib/ngx-indexed-db.meta"},"importAs":"ngx-indexed-db"}
1
+ {"__symbolic":"module","version":4,"metadata":{"NgxIndexedDBModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"declarations":[],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":12}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["dbConfig"],"value":{"ngModule":{"__symbolic":"reference","name":"NgxIndexedDBModule"},"providers":[{"__symbolic":"reference","name":"NgxIndexedDBService"},{"provide":{"__symbolic":"reference","name":"CONFIG_TOKEN"},"useValue":{"__symbolic":"reference","name":"dbConfig"}}]}}}},"NgxIndexedDBService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":13,"character":15},"arguments":[{"__symbolic":"reference","name":"CONFIG_TOKEN"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":13,"character":65},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":13,"character":72}]}]],"parameters":[{"__symbolic":"reference","name":"DBConfig"},{"__symbolic":"reference","name":"any"}]}],"createObjectStore":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"bulkAdd":[{"__symbolic":"method"}],"bulkDelete":[{"__symbolic":"method"}],"getByKey":[{"__symbolic":"method"}],"bulkGet":[{"__symbolic":"method"}],"getByID":[{"__symbolic":"method"}],"getByIndex":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"updateByKey":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"deleteByKey":[{"__symbolic":"method"}],"clear":[{"__symbolic":"method"}],"deleteDatabase":[{"__symbolic":"method"}],"openCursor":[{"__symbolic":"method"}],"openCursorByIndex":[{"__symbolic":"method"}],"getAllByIndex":[{"__symbolic":"method"}],"getAllKeysByIndex":[{"__symbolic":"method"}],"count":[{"__symbolic":"method"}],"deleteObjectStore":[{"__symbolic":"method"}]}},"DBConfig":{"__symbolic":"interface"},"ObjectStoreMeta":{"__symbolic":"interface"},"ObjectStoreSchema":{"__symbolic":"interface"},"IndexDetails":{"__symbolic":"interface"},"RequestEvent":{"__symbolic":"interface"},"RequestEventTarget":{"__symbolic":"interface"},"DBMode":{"readonly":"readonly","readwrite":"readwrite"},"Key":{"__symbolic":"interface"},"CONFIG_TOKEN":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":41,"character":32},"arguments":[null]}},"origins":{"NgxIndexedDBModule":"./lib/ngxindexeddb.module","NgxIndexedDBService":"./lib/ngx-indexed-db.service","DBConfig":"./lib/ngx-indexed-db.meta","ObjectStoreMeta":"./lib/ngx-indexed-db.meta","ObjectStoreSchema":"./lib/ngx-indexed-db.meta","IndexDetails":"./lib/ngx-indexed-db.meta","RequestEvent":"./lib/ngx-indexed-db.meta","RequestEventTarget":"./lib/ngx-indexed-db.meta","DBMode":"./lib/ngx-indexed-db.meta","Key":"./lib/ngx-indexed-db.meta","CONFIG_TOKEN":"./lib/ngx-indexed-db.meta"},"importAs":"ngx-indexed-db"}
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": "9.1.2",
5
+ "version": "9.4.2",
6
6
  "license": "ISC",
7
7
  "private": false,
8
8
  "keywords": [
package/utils/index.d.ts CHANGED
@@ -2,10 +2,10 @@ export interface Options {
2
2
  storeName: string;
3
3
  dbMode: IDBTransactionMode;
4
4
  error: (e: Event) => any;
5
- complete: (e: Event) => any;
5
+ complete?: (e: Event) => any;
6
6
  abort?: any;
7
7
  }
8
8
  export declare function validateStoreName(db: IDBDatabase, storeName: string): boolean;
9
9
  export declare function validateBeforeTransaction(db: IDBDatabase, storeName: string, reject: (message: string) => void): void;
10
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;
11
+ export declare function optionsGenerator(type: any, storeName: any, reject: (reason?: any) => void, resolve?: (e: any) => void): Options;