@microsoft/mgt-element
Advanced tools
Comparing version 3.1.3-next.mgt-chat.4702515 to 3.1.3-next.mgt-chat.040beb6
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
import { IDBPObjectStore } from 'idb'; | ||
import { CacheItem, CacheSchema } from './CacheService'; | ||
@@ -57,3 +58,8 @@ /** | ||
queryDb(indexName: string, query: IDBKeyRange | IDBValidKey): Promise<T[]>; | ||
/** | ||
* Helper function to get a wrapping transaction for an action function | ||
* @param action a function that takes an object store uses it to make changes to the cache | ||
*/ | ||
transaction(action: (store: IDBPObjectStore<unknown, [string], string, 'readwrite'>) => Promise<void>): Promise<void>; | ||
} | ||
//# sourceMappingURL=CacheStore.d.ts.map |
@@ -169,3 +169,16 @@ /** | ||
} | ||
/** | ||
* Helper function to get a wrapping transaction for an action function | ||
* @param action a function that takes an object store uses it to make changes to the cache | ||
*/ | ||
transaction(action) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const db = yield this.getDb(); | ||
const tx = db.transaction(this.store, 'readwrite'); | ||
const store = tx.objectStore(this.store); | ||
yield action(store); | ||
yield tx.done; | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=CacheStore.js.map |
@@ -27,3 +27,2 @@ /** | ||
return (classOrDescriptor) => { | ||
// eslint-disable-next-line no-console | ||
error(`Tag name ${mgtTagName} is already defined using class ${mgtElement.name} version ${version(mgtElement)}\n`, `Currently registering class ${classOrDescriptor.name} with version ${version(classOrDescriptor)}\n`, 'Please use the disambiguation feature to define a unique tag name for this component see: https://github.com/microsoftgraph/microsoft-graph-toolkit/tree/main/packages/mgt-components#disambiguation'); | ||
@@ -30,0 +29,0 @@ return classOrDescriptor; |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export declare const PACKAGE_VERSION = "3.1.3-next.mgt-chat.4702515"; | ||
export declare const PACKAGE_VERSION = "3.1.3-next.mgt-chat.040beb6"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -9,3 +9,3 @@ /** | ||
// ANY CHANGES WILL BE LOST DURING BUILD | ||
export const PACKAGE_VERSION = '3.1.3-next.mgt-chat.4702515'; | ||
export const PACKAGE_VERSION = '3.1.3-next.mgt-chat.040beb6'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@microsoft/mgt-element", | ||
"version": "3.1.3-next.mgt-chat.4702515", | ||
"version": "3.1.3-next.mgt-chat.040beb6", | ||
"description": "Microsoft Graph Toolkit base classes", | ||
@@ -37,3 +37,3 @@ "homepage": "https://github.com/microsoftgraph/microsoft-graph-toolkit", | ||
"idb": "6.0.0", | ||
"lit": "^2.3.1" | ||
"lit": "^3.0.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "publishConfig": { |
@@ -8,3 +8,3 @@ /** | ||
import { openDB } from 'idb'; | ||
import { IDBPObjectStore, openDB } from 'idb'; | ||
import { Providers } from '../providers/Providers'; | ||
@@ -155,2 +155,14 @@ import { CacheItem, CacheSchema, Index, dbListKey } from './CacheService'; | ||
} | ||
/** | ||
* Helper function to get a wrapping transaction for an action function | ||
* @param action a function that takes an object store uses it to make changes to the cache | ||
*/ | ||
public async transaction(action: (store: IDBPObjectStore<unknown, [string], string, 'readwrite'>) => Promise<void>) { | ||
const db = await this.getDb(); | ||
const tx = db.transaction(this.store, 'readwrite'); | ||
const store = tx.objectStore(this.store); | ||
await action(store); | ||
await tx.done; | ||
} | ||
} |
@@ -29,3 +29,2 @@ /** | ||
return (classOrDescriptor: CustomElementConstructor) => { | ||
// eslint-disable-next-line no-console | ||
error( | ||
@@ -32,0 +31,0 @@ `Tag name ${mgtTagName} is already defined using class ${mgtElement.name} version ${version(mgtElement)}\n`, |
@@ -11,2 +11,2 @@ /** | ||
export const PACKAGE_VERSION = '3.1.3-next.mgt-chat.4702515'; | ||
export const PACKAGE_VERSION = '3.1.3-next.mgt-chat.040beb6'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
665673
10242
+ Added@lit/reactive-element@2.0.4(transitive)
+ Addedlit@3.2.1(transitive)
+ Addedlit-element@4.1.1(transitive)
+ Addedlit-html@3.2.1(transitive)
- Removed@lit/reactive-element@1.6.3(transitive)
- Removedlit@2.8.0(transitive)
- Removedlit-element@3.3.3(transitive)
- Removedlit-html@2.8.0(transitive)
Updatedlit@^3.0.0