asma-helpers 0.7.2 → 0.7.3
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.
- package/lib/helpers/clearCacheData.d.ts +9 -0
- package/lib/helpers/clearCacheData.d.ts.map +1 -1
- package/lib/helpers/clearCacheData.js +8 -0
- package/lib/helpers/clearCacheData.js.map +1 -1
- package/lib/helpers/initASMAAppVitals.d.ts +1 -1
- package/lib/helpers/initASMAAppVitals.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/helpers/InitializeIDBListenersOnMstSnapshots.ts +1 -0
- package/src/helpers/clearCacheData.ts +14 -0
- package/src/helpers/initASMAAppVitals.ts +4 -4
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
__ASMA_clearCacheDataCalled__: boolean;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @imortant When using in micro-apps combination shell/child make sure this app is called only once and only in shell app! otherwise it will have unexpected behaviour with no errors or warnings
|
|
9
|
+
*/
|
|
1
10
|
export declare const clearCacheData: (CACHE_VERSION: string) => Promise<void>;
|
|
2
11
|
//# sourceMappingURL=clearCacheData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearCacheData.d.ts","sourceRoot":"","sources":["../../src/helpers/clearCacheData.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,kBAAyB,MAAM,
|
|
1
|
+
{"version":3,"file":"clearCacheData.d.ts","sourceRoot":"","sources":["../../src/helpers/clearCacheData.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,6BAA6B,EAAE,OAAO,CAAA;KACzC;CACJ;AACD;;;GAGG;AACH,eAAO,MAAM,cAAc,kBAAyB,MAAM,kBAgBzD,CAAA"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @imortant When using in micro-apps combination shell/child make sure this app is called only once and only in shell app! otherwise it will have unexpected behaviour with no errors or warnings
|
|
4
|
+
*/
|
|
1
5
|
export const clearCacheData = async (CACHE_VERSION) => {
|
|
6
|
+
if (window.__ASMA_clearCacheDataCalled__) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
window.__ASMA_clearCacheDataCalled__ = true;
|
|
2
10
|
const version = localStorage.getItem('version');
|
|
3
11
|
if ((!version || version !== CACHE_VERSION) && indexedDB && typeof indexedDB['databases'] === 'function') {
|
|
4
12
|
const IndexedDBS = await indexedDB.databases();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearCacheData.js","sourceRoot":"","sources":["../../src/helpers/clearCacheData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clearCacheData.js","sourceRoot":"","sources":["../../src/helpers/clearCacheData.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,aAAqB,EAAE,EAAE;IAC1D,IAAI,MAAM,CAAC,6BAA6B,EAAE;QACtC,OAAM;KACT;IACD,MAAM,CAAC,6BAA6B,GAAG,IAAI,CAAA;IAE3C,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/C,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,aAAa,CAAC,IAAI,SAAS,IAAI,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,UAAU,EAAE;QACtG,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE,CAAA;QAE9C,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAC7B,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC9D,CAAC,CAAC,CAAA;QAEF,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;KACjD;AACL,CAAC,CAAA"}
|
|
@@ -6,7 +6,7 @@ export declare function initASMAAppVitals({ authenticated, is_child_app, subdoma
|
|
|
6
6
|
/**
|
|
7
7
|
* //TODO invesigate how to internalyze this variable
|
|
8
8
|
* use this method from asma-qiankun-react-loader
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
10
|
setLoadMicroApp(dev_mode: boolean): Promise<void>;
|
|
11
11
|
is_child_app?: boolean;
|
|
12
12
|
mst_stores_to_persisit: Object[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initASMAAppVitals.d.ts","sourceRoot":"","sources":["../../src/helpers/initASMAAppVitals.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,EACpC,aAAa,EACb,YAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,eAAe,GAClB,EAAE;IACC;;;
|
|
1
|
+
{"version":3,"file":"initASMAAppVitals.d.ts","sourceRoot":"","sources":["../../src/helpers/initASMAAppVitals.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,EACpC,aAAa,EACb,YAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,eAAe,GAClB,EAAE;IACC;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sBAAsB,EAAE,MAAM,EAAE,CAAA;IAChC;;;OAGG;IACH,aAAa,EAAE,MAAM,OAAO,CAAA;IAC5B,eAAe,EAAE;QACb;;;WAGG;QACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;QAChC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;QACnD;;WAEG;QACH,KAAK,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE,CAAA;QACnD;;WAEG;QACH,OAAO,EAAE,WAAW,GAAG,YAAY,GAAG,eAAe,CAAA;KACxD,CAAA;CACJ,2CA6BA"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
__ASMA_clearCacheDataCalled__: boolean
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @imortant When using in micro-apps combination shell/child make sure this app is called only once and only in shell app! otherwise it will have unexpected behaviour with no errors or warnings
|
|
9
|
+
*/
|
|
1
10
|
export const clearCacheData = async (CACHE_VERSION: string) => {
|
|
11
|
+
if (window.__ASMA_clearCacheDataCalled__) {
|
|
12
|
+
return
|
|
13
|
+
}
|
|
14
|
+
window.__ASMA_clearCacheDataCalled__ = true
|
|
15
|
+
|
|
2
16
|
const version = localStorage.getItem('version')
|
|
3
17
|
if ((!version || version !== CACHE_VERSION) && indexedDB && typeof indexedDB['databases'] === 'function') {
|
|
4
18
|
const IndexedDBS = await indexedDB.databases()
|
|
@@ -18,10 +18,10 @@ export async function initASMAAppVitals({
|
|
|
18
18
|
/**
|
|
19
19
|
* //TODO invesigate how to internalyze this variable
|
|
20
20
|
* use this method from asma-qiankun-react-loader
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
*/
|
|
22
|
+
setLoadMicroApp(dev_mode: boolean): Promise<void>
|
|
23
|
+
is_child_app?: boolean
|
|
24
|
+
mst_stores_to_persisit: Object[]
|
|
25
25
|
/**
|
|
26
26
|
* //TODO invesigate how to internalyze this variable
|
|
27
27
|
* add qiankunWindow.__POWERED_BY_QIANKUN__ there where qiankunWindow is awailable
|