@oracle/offline-persistence-toolkit
Advanced tools
Comparing version 1.4.9 to 1.5.1
@@ -5,3 +5,3 @@ (function(){ | ||
{ | ||
'persist/offline-persistence-toolkit-core-1.4.9': [ | ||
'persist/offline-persistence-toolkit-core-1.5.1': [ | ||
'persist/persistenceUtils', | ||
@@ -18,3 +18,3 @@ 'persist/impl/logger', | ||
], | ||
'persist/offline-persistence-toolkit-pouchdbstore-1.4.9': [ | ||
'persist/offline-persistence-toolkit-pouchdbstore-1.5.1': [ | ||
'persist/PersistenceStore', | ||
@@ -28,3 +28,3 @@ 'persist/impl/storageUtils', | ||
], | ||
'persist/offline-persistence-toolkit-arraystore-1.4.9': [ | ||
'persist/offline-persistence-toolkit-arraystore-1.5.1': [ | ||
'persist/PersistenceStore', | ||
@@ -37,3 +37,3 @@ 'persist/impl/storageUtils', | ||
], | ||
'persist/offline-persistence-toolkit-localstore-1.4.9': [ | ||
'persist/offline-persistence-toolkit-localstore-1.5.1': [ | ||
'persist/PersistenceStore', | ||
@@ -46,3 +46,3 @@ 'persist/impl/storageUtils', | ||
], | ||
'persist/offline-persistence-toolkit-filesystemstore-1.4.9': [ | ||
'persist/offline-persistence-toolkit-filesystemstore-1.5.1': [ | ||
'persist/impl/storageUtils', | ||
@@ -53,3 +53,3 @@ 'persist/impl/keyValuePersistenceStore', | ||
], | ||
'persist/offline-persistence-toolkit-responseproxy-1.4.9': [ | ||
'persist/offline-persistence-toolkit-responseproxy-1.5.1': [ | ||
'persist/fetchStrategies', | ||
@@ -56,0 +56,0 @@ 'persist/cacheStrategies', |
@@ -39,2 +39,7 @@ /** | ||
this._storeName = storeName; | ||
// the names of all the shredded stores associated | ||
// with this cache. We need them when clear() is | ||
// called since we need to clear all the shredded | ||
// stores as well. | ||
this._shreddedNamesStoreName = this._storeName + '_OPT_INT_SHRED_STORE_NAMES_'; | ||
this._store = null; | ||
@@ -45,11 +50,2 @@ | ||
this._createStorePromise; | ||
// the names of all the shredded stores associated | ||
// with this cache. We need them when clear() is | ||
// called since we need to clear all the shredded | ||
// stores as well. | ||
Object.defineProperty(this, '_STORE_NAMES_', { | ||
value: '_OPT_INT_SHRED_STORE_NAMES_', | ||
writable: false | ||
}); | ||
} | ||
@@ -317,2 +313,25 @@ | ||
/** | ||
* Return the persistent store. | ||
* @returns {Object} The persistent store. | ||
*/ | ||
OfflineCache.prototype._getShreddedNamesStore = function () { | ||
var self = this; | ||
if (self._shreddedNamesStore) { | ||
return Promise.resolve(self._shreddedNamesStore); | ||
} | ||
if (self._createShreddedNamesStorePromise) { | ||
return self._createShreddedNamesStorePromise; | ||
} else { | ||
self._createShreddedNamesStorePromise = persistenceStoreManager.openStore(self._shreddedNamesStoreName, { | ||
index: ["metadata.baseUrl", "metadata.url", "metadata.created"], | ||
skipMetadata: true | ||
}).then(function (store) { | ||
self._shreddedNamesStore = store; | ||
return self._shreddedNamesStore; | ||
}); | ||
return self._createShreddedNamesStorePromise; | ||
} | ||
} | ||
/** | ||
@@ -499,5 +518,2 @@ * Perform vary header check and return the first match among all the | ||
} | ||
self._updateShreddedStoreNames(shreddedPayload.map(function(entry) { | ||
return entry.name; | ||
})); | ||
var storePromises = []; | ||
@@ -509,3 +525,8 @@ requestResponsePair.value.responseData.bodyAbstract = _buildBodyAbstract(shreddedPayload); | ||
storePromises.push(cacheHandler.cacheShreddedData(shreddedPayload)); | ||
return Promise.all(storePromises); | ||
return self._updateShreddedStoreNames(shreddedPayload.map(function(entry) { | ||
return entry.name; | ||
})).then(function() { | ||
return Promise.all(storePromises); | ||
}); | ||
}); | ||
@@ -523,37 +544,29 @@ } | ||
OfflineCache.prototype._updateShreddedStoreNames = function (storeNames) { | ||
if (!storeNames) { | ||
localStorage.setItem(this._STORE_NAMES_, ""); | ||
return; | ||
} | ||
var storeageData = localStorage.getItem(this._STORE_NAMES_); | ||
if (!storeageData) { | ||
storeageData = JSON.stringify(storeNames); | ||
} else { | ||
var existingStoreNames; | ||
try { | ||
existingStoreNames = JSON.parse(storeageData); | ||
} catch(exc) { | ||
existingStoreNames = []; | ||
return this._getShreddedNamesStore().then(function(store) { | ||
if (!storeNames) { | ||
return store.delete(); | ||
} else { | ||
return store.keys().then(function(keys) { | ||
var keysToAdd = []; | ||
storeNames.forEach(function(storeName) { | ||
if (keys.indexOf(storeName) < 0) { | ||
keysToAdd.push(storeName); | ||
} | ||
}); | ||
if (keysToAdd.length > 0) { | ||
var rowsToAdd = []; | ||
keysToAdd.forEach(function(key) { | ||
rowsToAdd.push({key: key, metadata: {}, value: {}}); | ||
}); | ||
return store.upsertAll(rowsToAdd); | ||
} | ||
}); | ||
} | ||
storeNames.forEach(function (storeName) { | ||
if (existingStoreNames.indexOf(storeName) < 0) { | ||
existingStoreNames.push(storeName); | ||
} | ||
}); | ||
storeageData = JSON.stringify(existingStoreNames); | ||
} | ||
localStorage.setItem(this._STORE_NAMES_, storeageData); | ||
}); | ||
}; | ||
OfflineCache.prototype._getShreddedStoreNames = function () { | ||
var storeNames = []; | ||
var storeageData = localStorage.getItem(this._STORE_NAMES_); | ||
if (storeageData) { | ||
try { | ||
storeNames = JSON.parse(storeageData); | ||
} catch (exc) { | ||
logger.log("error getting shredded store names from localStorage"); | ||
} | ||
} | ||
return storeNames; | ||
return this._getShreddedNamesStore().then(function(store) { | ||
return store.keys(); | ||
}); | ||
}; | ||
@@ -805,12 +818,14 @@ | ||
deletePromiseArray.push(cacheStore.delete()); | ||
var storeNames = self._getShreddedStoreNames(); | ||
storeNames.forEach(function(storeName) { | ||
deletePromiseArray.push(persistenceStoreManager.deleteStore(storeName)); | ||
return; | ||
return self._getShreddedStoreNames().then(function(storeNames) { | ||
storeNames.forEach(function(storeName) { | ||
deletePromiseArray.push(persistenceStoreManager.deleteStore(storeName)); | ||
return; | ||
}); | ||
return Promise.all(deletePromiseArray).then(function(results) { | ||
return self._updateShreddedStoreNames(null); | ||
}).then(function() { | ||
self._cacheKeys = []; | ||
return true; | ||
}); | ||
}); | ||
return Promise.all(deletePromiseArray).then(function(results) { | ||
self._updateShreddedStoreNames(null); | ||
self._cacheKeys = []; | ||
return true; | ||
}); | ||
}).catch(function(error) { | ||
@@ -817,0 +832,0 @@ logger.log("Offline Persistence Toolkit OfflineCache: clear() error"); |
@@ -411,3 +411,5 @@ /** | ||
// Don't do it for Service Workers | ||
if (_isSafari()) { | ||
if (_isSafari() && | ||
!persistenceManager._browserRequestConstructor && | ||
!persistenceManager._persistenceRequestConstructor) { | ||
logger.log("Offline Persistence Toolkit PersistenceManager: Replacing Safari Browser APIs"); | ||
@@ -425,3 +427,4 @@ // using self to refer to both the "window" and the "self" context | ||
self['Request'] = persistenceManager._persistenceRequestConstructor; | ||
if (!_isBrowserContext()) { | ||
if (!_isBrowserContext() && | ||
!persistenceManager._browserFetchFunc) { | ||
// replace serviceWorker's fetch with this wrapper to unwrap safari request in sw | ||
@@ -428,0 +431,0 @@ Object.defineProperty(persistenceManager, '_browserFetchFunc', { |
@@ -332,5 +332,5 @@ /** | ||
case 'LIKE': | ||
rhsOp = rhsOp.replace('%', '.+'); | ||
rhsOp = rhsOp.replace(/%/g, '.*'); | ||
returnExp[lhsOp] = { | ||
$regex: rhsOp | ||
$regex: RegExp(rhsOp,'i') | ||
}; | ||
@@ -337,0 +337,0 @@ break; |
@@ -1,1 +0,1 @@ | ||
!function(){requirejs.config({bundles:{"persist/offline-persistence-toolkit-core-1.4.9":["persist/persistenceUtils","persist/impl/logger","persist/impl/PersistenceXMLHttpRequest","persist/persistenceStoreManager","persist/impl/defaultCacheHandler","persist/impl/PersistenceSyncManager","persist/impl/OfflineCache","persist/impl/offlineCacheManager","persist/impl/fetch","persist/persistenceManager"],"persist/offline-persistence-toolkit-pouchdbstore-1.4.9":["persist/PersistenceStore","persist/impl/storageUtils","persist/pouchdb-browser-7.0.0","persist/impl/pouchDBPersistenceStore","persist/pouchDBPersistenceStoreFactory","persist/configurablePouchDBStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-arraystore-1.4.9":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/arrayPersistenceStore","persist/arrayPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-localstore-1.4.9":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/localPersistenceStore","persist/localPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-filesystemstore-1.4.9":["persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/fileSystemPersistenceStore","persist/fileSystemPersistenceStoreFactory"],"persist/offline-persistence-toolkit-responseproxy-1.4.9":["persist/fetchStrategies","persist/cacheStrategies","persist/defaultResponseProxy","persist/simpleJsonShredding","persist/oracleRestJsonShredding","persist/simpleBinaryDataShredding","persist/queryHandlers"]}})}(); | ||
!function(){requirejs.config({bundles:{"persist/offline-persistence-toolkit-core-1.5.1":["persist/persistenceUtils","persist/impl/logger","persist/impl/PersistenceXMLHttpRequest","persist/persistenceStoreManager","persist/impl/defaultCacheHandler","persist/impl/PersistenceSyncManager","persist/impl/OfflineCache","persist/impl/offlineCacheManager","persist/impl/fetch","persist/persistenceManager"],"persist/offline-persistence-toolkit-pouchdbstore-1.5.1":["persist/PersistenceStore","persist/impl/storageUtils","persist/pouchdb-browser-7.0.0","persist/impl/pouchDBPersistenceStore","persist/pouchDBPersistenceStoreFactory","persist/configurablePouchDBStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-arraystore-1.5.1":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/arrayPersistenceStore","persist/arrayPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-localstore-1.5.1":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/localPersistenceStore","persist/localPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-filesystemstore-1.5.1":["persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/fileSystemPersistenceStore","persist/fileSystemPersistenceStoreFactory"],"persist/offline-persistence-toolkit-responseproxy-1.5.1":["persist/fetchStrategies","persist/cacheStrategies","persist/defaultResponseProxy","persist/simpleJsonShredding","persist/oracleRestJsonShredding","persist/simpleBinaryDataShredding","persist/queryHandlers"]}})}(); |
@@ -1,1 +0,1 @@ | ||
define(["./defaultCacheHandler","../persistenceStoreManager","../persistenceUtils","./logger"],function(a,b,c,d){"use strict";function e(a,b){if(!a)throw TypeError("A name must be provided to create an OfflineCache!");if(!b)throw TypeError("A persistence store must be provided to create an OfflineCache!");this._name=a,this._storeName=b,this._store=null,this._cacheKeys=[],this._createStorePromise,Object.defineProperty(this,"_STORE_NAMES_",{value:"_OPT_INT_SHRED_STORE_NAMES_",writable:!1})}function f(a,b,c){if(c&&c.length)for(var d=0;d<c.length;d++){var e=c[d];if(i(a,b,e.value))return e}return null}function g(a,b,c){var d=[];if(c&&c.length){d=c.filter(h(a,b,"value")).map(function(a){return a.value.responseData})}return d}function h(a,b,c){return function(d){var e;return e=c?d[c]:d,i(a,b,e)}}function i(a,b,c){if(a)return!0;if(!c||!b)return!1;var e=c.requestData.headers,f=c.responseData.headers,g=b.headers,h=f.vary;if(d.log("Offline Persistence Toolkit OfflineCache: Processing HTTP Vary header"),!h)return!0;if("*"===h.trim())return!1;for(var i=h.split(","),j=0;j<i.length;j++){var k=i[j].toLowerCase();k=k.trim();var l=g.get(k),m=e[k];if(d.log("Offline Persistence Toolkit OfflineCache: HTTP Vary header name: "+k),d.log("Offline Persistence Toolkit OfflineCache: Request HTTP Vary header value: "+l),d.log("Offline Persistence Toolkit OfflineCache: Cached HTTP Vary header value: "+m),!(!m&&!l||m&&l&&m===l))return!1}return!0}function j(b,c,e){if(c){d.log("Offline Persistence Toolkit OfflineCache: Converting cached entry to Response object");var f=!1;e&&e.ignoreBody&&(f=!0);var g=c.bodyAbstract;return a.constructResponse(c).then(function(c){if(null!=b.url&&b.url.length>0&&null==c.headers.get("x-oracle-jscpt-response-url")&&c.headers.set("x-oracle-jscpt-response-url",b.url),!f&&g){var e;try{e=JSON.parse(g)}catch(a){d.error("error parsing json "+g)}return a.fillResponseBodyWithShreddedData(b,e,c)}return c})}return Promise.resolve()}function k(a,b,c){if(b&&b.length){var d=b.map(function(b){return j(a,b,c)});return Promise.all(d)}return Promise.resolve()}function l(a){var b=a.map(function(a){return{name:a.name,keys:a.keys?a.keys.reduce(function(a,b){return b?a.push(b):d.warn("should not have undefined key in the shredded data"),a},[]):a.keys,resourceType:a.resourceType}});return JSON.stringify(b)}function m(b,c,d){if(c){var e=a.constructSearchCriteria(c,d);e.fields=["key","value"];var f=d&&d.ignoreVary;return b.find(e).then(function(a){if(a&&a.length){return a.filter(h(f,c,"value")).map(function(a){return a.key})}return[]})}return b.keys()}return e.prototype.getName=function(){return this._name},e.prototype.add=function(a){d.log("Offline Persistence Toolkit OfflineCache: add()");var b=this;return fetch(a).then(function(c){return b.put(a,c)})},e.prototype.addAll=function(a){d.log("Offline Persistence Toolkit OfflineCache: addAll()");var b=a.map(this.add,this);return Promise.all(b)},e.prototype.match=function(a,b){return d.log("Offline Persistence Toolkit OfflineCache: match() for Request with url: "+a.url),this._getCacheEntries(a,b).then(function(c){var d=b&&b.ignoreVary,e=f(d,a,c);if(e)return j(a,e.value.responseData,b)}).catch(function(b){d.log("error finding match for request with url: "+a.url)})},e.prototype._getCacheEntries=function(b,c){var d=this;return this._getStore().then(function(e){var f=a.getMatchedCacheKeys(b,c,d._cacheKeys);if(f&&f.length){var g=f.map(function(a){return e.findByKey(a).then(function(b){return{key:a,value:b}})});return Promise.all(g)}var h=a.constructSearchCriteria(b,c);return h.fields=["key","value"],e.find(h)})},e.prototype._matchByKey=function(a,b,c){return this._getStore().then(function(a){return a.findByKey(b)}).then(function(b){return b?j(a,b.responseData,c):void 0})},e.prototype._internalMatch=function(b,c){var e=this;return e._getStore().then(function(d){var f=a.getMatchedCacheKeys(b,c,e._cacheKeys);if(f&&f.length){var g=f.map(function(a){return d.findByKey(a)});return Promise.all(g).then(function(a){return a.map(function(a,b){return{key:f[b],value:a}})})}var h=a.constructSearchCriteria(b,c);return h.fields=["key","value"],d.find(h)}).then(function(a){if(a){var e=c&&c.ignoreVary,g=f(e,b,a);if(g){var h={key:g.key},i=g.value.responseData.bodyAbstract;if(i)try{var j=JSON.parse(i);j?1===j.length&&"single"===j[0].resourceType?h.resourceType="single":h.resourceType="collection":h.resourceType="unknown"}catch(a){return void d.log("internal error: invalid body abstract")}else h.resourceType="unknown";return h}}}).catch(function(a){d.log("error finding match internal")})},e.prototype.matchAll=function(a,b){return d.log("Offline Persistence Toolkit OfflineCache: matchAll() for Request with url: "+a.url),this._getCacheEntries(a,b).then(function(c){var d=b&&b.ignoreVary,e=g(d,a,c);return k(a,e,b)}).catch(function(b){d.log("error finding all matches for request with url: "+a.url)})},e.prototype._getStore=function(){var a=this;if(a._store)return Promise.resolve(a._store);if(a._createStorePromise)return a._createStorePromise;var c;return a._createStorePromise=b.openStore(a._storeName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then(function(a){return c=a,a.keys()}).then(function(b){return a._cacheKeys=b,a._store=c,a._store}),a._createStorePromise},e.prototype.put=function(b,c){d.log("Offline Persistence Toolkit OfflineCache: put() for Request with url: "+b.url);var e,f=this;return f._getStore().then(function(){return a.constructRequestResponseCacheData(b,c)}).then(function(d){var g=f._store;return e=d.key,a.hasShredder(b)?a.shredResponse(b,c).then(function(b){if(!b)return void(e=null);f._updateShreddedStoreNames(b.map(function(a){return a.name}));var c=[];return d.value.responseData.bodyAbstract=l(b),c.push(g.upsert(d.key,d.metadata,d.value)),c.push(a.cacheShreddedData(b)),Promise.all(c)}):g.upsert(d.key,d.metadata,d.value)}).then(function(){e&&f._cacheKeys.indexOf(e)<0&&f._cacheKeys.push(e)}).catch(function(a){d.error("error in cache.put() for Request with url: "+b.url)})},e.prototype._updateShreddedStoreNames=function(a){if(!a)return void localStorage.setItem(this._STORE_NAMES_,"");var b=localStorage.getItem(this._STORE_NAMES_);if(b){var c;try{c=JSON.parse(b)}catch(a){c=[]}a.forEach(function(a){c.indexOf(a)<0&&c.push(a)}),b=JSON.stringify(c)}else b=JSON.stringify(a);localStorage.setItem(this._STORE_NAMES_,b)},e.prototype._getShreddedStoreNames=function(){var a=[],b=localStorage.getItem(this._STORE_NAMES_);if(b)try{a=JSON.parse(b)}catch(a){d.log("error getting shredded store names from localStorage")}return a},e.prototype.delete=function(b,c){if(!b)return d.warn("Offline Persistence Toolkit OfflineCache: delete() request is a required parameter. To clear the cache, please call clear()"),Promise.resolve(!1);d.log("Offline Persistence Toolkit OfflineCache: delete() for Request with url: "+b.url);var e=this;return e._getStore().then(function(f){if(a.hasShredder(b)){var g=a.constructSearchCriteria(b,c);g.fields=["key","value"];var i=c&&c.ignoreVary;return f.find(g).then(function(c){if(c&&c.length){var g=c.filter(h(i,b,"value")),j=[];return g.forEach(function(b){j.push(f.removeByKey(b.key));var c=e._cacheKeys.indexOf(b.key);c>=0&&e._cacheKeys.splice(c,1),b.value.responseData.bodyAbstract&&b.value.responseData.bodyAbstract.length&&j.push(a.deleteShreddedData(JSON.parse(b.value.responseData.bodyAbstract)))}),Promise.all(j).then(function(){return d.log("Offline Persistence Toolkit OfflineCache: all matching entries are deleted from both the cache store and the shredded store."),!0})}return!1})}return m(f,b,c).then(function(a){if(a&&a.length){var b=a.map(function(a){var b=e._cacheKeys.indexOf(a);return b>=0&&e._cacheKeys.splice(b,1),f.removeByKey(a)});return Promise.all(b)}return[]}).then(function(a){return!(!a||!a.length)})}).catch(function(a){return d.log("Offline Persistence Toolkit OfflineCache: error occurred delete() for Request with url: "+b.url),!1})},e.prototype.keys=function(a,b){a?d.log("Offline Persistence Toolkit OfflineCache: keys() for Request with url: "+a.url):d.log("Offline Persistence Toolkit OfflineCache: keys()");var e=this;return e._getStore().then(function(){return m(e._store,a,b)}).then(function(a){var b=[];return a.forEach(function(a){b.push(e._store.findByKey(a).then(function(a){return c.requestFromJSON(a.requestData)}))}),Promise.all(b)}).catch(function(b){return d.log("Offline Persistence Toolkit OfflineCache: keys() error for Request with url: "+a.url),[]})},e.prototype.hasMatch=function(a,b){return d.log("Offline Persistence Toolkit OfflineCache: hasMatch() for Request with url: "+a.url),this._getCacheEntries(a,b).then(function(c){return null!==f(b&&b.ignoreVary,a,c)})},e.prototype.clear=function(){d.log("Offline Persistence Toolkit OfflineCache: clear()");var a=this;return a._getStore().then(function(c){var d=[];return d.push(c.delete()),a._getShreddedStoreNames().forEach(function(a){d.push(b.deleteStore(a))}),Promise.all(d).then(function(b){return a._updateShreddedStoreNames(null),a._cacheKeys=[],!0})}).catch(function(a){d.log("Offline Persistence Toolkit OfflineCache: clear() error")})},e}); | ||
define(["./defaultCacheHandler","../persistenceStoreManager","../persistenceUtils","./logger"],function(a,b,c,d){"use strict";function e(a,b){if(!a)throw TypeError("A name must be provided to create an OfflineCache!");if(!b)throw TypeError("A persistence store must be provided to create an OfflineCache!");this._name=a,this._storeName=b,this._shreddedNamesStoreName=this._storeName+"_OPT_INT_SHRED_STORE_NAMES_",this._store=null,this._cacheKeys=[],this._createStorePromise}function f(a,b,c){if(c&&c.length)for(var d=0;d<c.length;d++){var e=c[d];if(i(a,b,e.value))return e}return null}function g(a,b,c){var d=[];if(c&&c.length){d=c.filter(h(a,b,"value")).map(function(a){return a.value.responseData})}return d}function h(a,b,c){return function(d){var e;return e=c?d[c]:d,i(a,b,e)}}function i(a,b,c){if(a)return!0;if(!c||!b)return!1;var e=c.requestData.headers,f=c.responseData.headers,g=b.headers,h=f.vary;if(d.log("Offline Persistence Toolkit OfflineCache: Processing HTTP Vary header"),!h)return!0;if("*"===h.trim())return!1;for(var i=h.split(","),j=0;j<i.length;j++){var k=i[j].toLowerCase();k=k.trim();var l=g.get(k),m=e[k];if(d.log("Offline Persistence Toolkit OfflineCache: HTTP Vary header name: "+k),d.log("Offline Persistence Toolkit OfflineCache: Request HTTP Vary header value: "+l),d.log("Offline Persistence Toolkit OfflineCache: Cached HTTP Vary header value: "+m),!(!m&&!l||m&&l&&m===l))return!1}return!0}function j(b,c,e){if(c){d.log("Offline Persistence Toolkit OfflineCache: Converting cached entry to Response object");var f=!1;e&&e.ignoreBody&&(f=!0);var g=c.bodyAbstract;return a.constructResponse(c).then(function(c){if(null!=b.url&&b.url.length>0&&null==c.headers.get("x-oracle-jscpt-response-url")&&c.headers.set("x-oracle-jscpt-response-url",b.url),!f&&g){var e;try{e=JSON.parse(g)}catch(a){d.error("error parsing json "+g)}return a.fillResponseBodyWithShreddedData(b,e,c)}return c})}return Promise.resolve()}function k(a,b,c){if(b&&b.length){var d=b.map(function(b){return j(a,b,c)});return Promise.all(d)}return Promise.resolve()}function l(a){var b=a.map(function(a){return{name:a.name,keys:a.keys?a.keys.reduce(function(a,b){return b?a.push(b):d.warn("should not have undefined key in the shredded data"),a},[]):a.keys,resourceType:a.resourceType}});return JSON.stringify(b)}function m(b,c,d){if(c){var e=a.constructSearchCriteria(c,d);e.fields=["key","value"];var f=d&&d.ignoreVary;return b.find(e).then(function(a){if(a&&a.length){return a.filter(h(f,c,"value")).map(function(a){return a.key})}return[]})}return b.keys()}return e.prototype.getName=function(){return this._name},e.prototype.add=function(a){d.log("Offline Persistence Toolkit OfflineCache: add()");var b=this;return fetch(a).then(function(c){return b.put(a,c)})},e.prototype.addAll=function(a){d.log("Offline Persistence Toolkit OfflineCache: addAll()");var b=a.map(this.add,this);return Promise.all(b)},e.prototype.match=function(a,b){return d.log("Offline Persistence Toolkit OfflineCache: match() for Request with url: "+a.url),this._getCacheEntries(a,b).then(function(c){var d=b&&b.ignoreVary,e=f(d,a,c);if(e)return j(a,e.value.responseData,b)}).catch(function(b){d.log("error finding match for request with url: "+a.url)})},e.prototype._getCacheEntries=function(b,c){var d=this;return this._getStore().then(function(e){var f=a.getMatchedCacheKeys(b,c,d._cacheKeys);if(f&&f.length){var g=f.map(function(a){return e.findByKey(a).then(function(b){return{key:a,value:b}})});return Promise.all(g)}var h=a.constructSearchCriteria(b,c);return h.fields=["key","value"],e.find(h)})},e.prototype._matchByKey=function(a,b,c){return this._getStore().then(function(a){return a.findByKey(b)}).then(function(b){return b?j(a,b.responseData,c):void 0})},e.prototype._internalMatch=function(b,c){var e=this;return e._getStore().then(function(d){var f=a.getMatchedCacheKeys(b,c,e._cacheKeys);if(f&&f.length){var g=f.map(function(a){return d.findByKey(a)});return Promise.all(g).then(function(a){return a.map(function(a,b){return{key:f[b],value:a}})})}var h=a.constructSearchCriteria(b,c);return h.fields=["key","value"],d.find(h)}).then(function(a){if(a){var e=c&&c.ignoreVary,g=f(e,b,a);if(g){var h={key:g.key},i=g.value.responseData.bodyAbstract;if(i)try{var j=JSON.parse(i);j?1===j.length&&"single"===j[0].resourceType?h.resourceType="single":h.resourceType="collection":h.resourceType="unknown"}catch(a){return void d.log("internal error: invalid body abstract")}else h.resourceType="unknown";return h}}}).catch(function(a){d.log("error finding match internal")})},e.prototype.matchAll=function(a,b){return d.log("Offline Persistence Toolkit OfflineCache: matchAll() for Request with url: "+a.url),this._getCacheEntries(a,b).then(function(c){var d=b&&b.ignoreVary,e=g(d,a,c);return k(a,e,b)}).catch(function(b){d.log("error finding all matches for request with url: "+a.url)})},e.prototype._getStore=function(){var a=this;if(a._store)return Promise.resolve(a._store);if(a._createStorePromise)return a._createStorePromise;var c;return a._createStorePromise=b.openStore(a._storeName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then(function(a){return c=a,a.keys()}).then(function(b){return a._cacheKeys=b,a._store=c,a._store}),a._createStorePromise},e.prototype._getShreddedNamesStore=function(){var a=this;return a._shreddedNamesStore?Promise.resolve(a._shreddedNamesStore):a._createShreddedNamesStorePromise?a._createShreddedNamesStorePromise:(a._createShreddedNamesStorePromise=b.openStore(a._shreddedNamesStoreName,{index:["metadata.baseUrl","metadata.url","metadata.created"],skipMetadata:!0}).then(function(b){return a._shreddedNamesStore=b,a._shreddedNamesStore}),a._createShreddedNamesStorePromise)},e.prototype.put=function(b,c){d.log("Offline Persistence Toolkit OfflineCache: put() for Request with url: "+b.url);var e,f=this;return f._getStore().then(function(){return a.constructRequestResponseCacheData(b,c)}).then(function(d){var g=f._store;return e=d.key,a.hasShredder(b)?a.shredResponse(b,c).then(function(b){if(!b)return void(e=null);var c=[];return d.value.responseData.bodyAbstract=l(b),c.push(g.upsert(d.key,d.metadata,d.value)),c.push(a.cacheShreddedData(b)),f._updateShreddedStoreNames(b.map(function(a){return a.name})).then(function(){return Promise.all(c)})}):g.upsert(d.key,d.metadata,d.value)}).then(function(){e&&f._cacheKeys.indexOf(e)<0&&f._cacheKeys.push(e)}).catch(function(a){d.error("error in cache.put() for Request with url: "+b.url)})},e.prototype._updateShreddedStoreNames=function(a){return this._getShreddedNamesStore().then(function(b){return a?b.keys().then(function(c){var d=[];if(a.forEach(function(a){c.indexOf(a)<0&&d.push(a)}),d.length>0){var e=[];return d.forEach(function(a){e.push({key:a,metadata:{},value:{}})}),b.upsertAll(e)}}):b.delete()})},e.prototype._getShreddedStoreNames=function(){return this._getShreddedNamesStore().then(function(a){return a.keys()})},e.prototype.delete=function(b,c){if(!b)return d.warn("Offline Persistence Toolkit OfflineCache: delete() request is a required parameter. To clear the cache, please call clear()"),Promise.resolve(!1);d.log("Offline Persistence Toolkit OfflineCache: delete() for Request with url: "+b.url);var e=this;return e._getStore().then(function(f){if(a.hasShredder(b)){var g=a.constructSearchCriteria(b,c);g.fields=["key","value"];var i=c&&c.ignoreVary;return f.find(g).then(function(c){if(c&&c.length){var g=c.filter(h(i,b,"value")),j=[];return g.forEach(function(b){j.push(f.removeByKey(b.key));var c=e._cacheKeys.indexOf(b.key);c>=0&&e._cacheKeys.splice(c,1),b.value.responseData.bodyAbstract&&b.value.responseData.bodyAbstract.length&&j.push(a.deleteShreddedData(JSON.parse(b.value.responseData.bodyAbstract)))}),Promise.all(j).then(function(){return d.log("Offline Persistence Toolkit OfflineCache: all matching entries are deleted from both the cache store and the shredded store."),!0})}return!1})}return m(f,b,c).then(function(a){if(a&&a.length){var b=a.map(function(a){var b=e._cacheKeys.indexOf(a);return b>=0&&e._cacheKeys.splice(b,1),f.removeByKey(a)});return Promise.all(b)}return[]}).then(function(a){return!(!a||!a.length)})}).catch(function(a){return d.log("Offline Persistence Toolkit OfflineCache: error occurred delete() for Request with url: "+b.url),!1})},e.prototype.keys=function(a,b){a?d.log("Offline Persistence Toolkit OfflineCache: keys() for Request with url: "+a.url):d.log("Offline Persistence Toolkit OfflineCache: keys()");var e=this;return e._getStore().then(function(){return m(e._store,a,b)}).then(function(a){var b=[];return a.forEach(function(a){b.push(e._store.findByKey(a).then(function(a){return c.requestFromJSON(a.requestData)}))}),Promise.all(b)}).catch(function(b){return d.log("Offline Persistence Toolkit OfflineCache: keys() error for Request with url: "+a.url),[]})},e.prototype.hasMatch=function(a,b){return d.log("Offline Persistence Toolkit OfflineCache: hasMatch() for Request with url: "+a.url),this._getCacheEntries(a,b).then(function(c){return null!==f(b&&b.ignoreVary,a,c)})},e.prototype.clear=function(){d.log("Offline Persistence Toolkit OfflineCache: clear()");var a=this;return a._getStore().then(function(c){var d=[];return d.push(c.delete()),a._getShreddedStoreNames().then(function(c){return c.forEach(function(a){d.push(b.deleteStore(a))}),Promise.all(d).then(function(b){return a._updateShreddedStoreNames(null)}).then(function(){return a._cacheKeys=[],!0})})}).catch(function(a){d.log("Offline Persistence Toolkit OfflineCache: clear() error")})},e}); |
@@ -1,1 +0,1 @@ | ||
define(["./impl/PersistenceXMLHttpRequest","./impl/PersistenceSyncManager","./impl/offlineCacheManager","./impl/logger","./impl/fetch"],function(a,b,c,d){"use strict";function e(){Object.defineProperty(this,"_registrations",{value:[],writable:!0}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_forceOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_isOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_cache",{value:null,writable:!0}),Object.defineProperty(this,"_persistenceSyncManager",{value:new b(this.isOnline.bind(this),this.browserFetch.bind(this),this.getCache.bind(this))})}function f(a){var b=a;g()&&!b._addedBrowserEventListeners&&(d.log("Offline Persistence Toolkit PersistenceManager: Adding browser event listeners"),window.addEventListener("offline",function(a){b._isOffline=!0},!1),window.addEventListener("online",function(a){b._isOffline=!1},!1),b._addedBrowserEventListeners=!0)}function g(){return"undefined"!=typeof window&&null!=window}function h(a,b,c){var e,f,g,h,i=null,j=a._registrations,k=null!=j?j.length:0;for(e=0;e<k;e++)if(g=j[e],null!=c.request.url.match(g.scope)){for(h=g._eventListeners.length,f=0;f<h;f++)if(g._eventListeners[f].type==b)if("fetch"==b)null===i&&c._setPromiseCallbacks instanceof Function&&(i=new Promise(function(a,b){c._setPromiseCallbacks(a,b)})),d.log("Offline Persistence Toolkit PersistenceManager: Calling fetch event listener"),g._eventListeners[f].listener(c);else if(d.log("Offline Persistence Toolkit PersistenceManager: Calling event listener"),!1===g._eventListeners[f].listener(c))return!1;if(null!=i)return i}return!0}function i(a){a._cache=c.open("systemCache")}function j(b){p()&&(d.log("Offline Persistence Toolkit PersistenceManager: Replacing Safari Browser APIs"),Object.defineProperty(b,"_browserRequestConstructor",{value:self.Request,writable:!1}),Object.defineProperty(b,"_persistenceRequestConstructor",{value:n(b),writable:!1}),self.Request=b._persistenceRequestConstructor,g()||(Object.defineProperty(b,"_browserFetchFunc",{value:self.fetch,writable:!1}),self.fetch=o(b))),!g()||b._browserFetchFunc||b._browserXMLHttpRequest||(d.log("Offline Persistence Toolkit PersistenceManager: Replacing browser APIs"),Object.defineProperty(b,"_browserFetchFunc",{value:window.fetch,writable:!1}),Object.defineProperty(b,"_browserXMLHttpRequest",{value:window.XMLHttpRequest,writable:!1}),window.fetch=m(b),window.XMLHttpRequest=function(){return null!=b._browserFetchRequest?new b._browserXMLHttpRequest:new a(b._browserXMLHttpRequest)})}function k(a,b){var c=a,d=c._registrations.indexOf(b);return d>-1&&(c._registrations.splice(d,1),!0)}function l(a,b){Object.defineProperty(this,"scope",{value:a,enumerable:!0}),Object.defineProperty(this,"_persistenceManager",{value:b}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0})}function m(a){function b(a){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:a,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return b.prototype.respondWith=function(a){var b=this;if(a instanceof Promise)a.then(function(a){b._resolveCallback(a)},function(a){b._rejectCallback(a)});else if("function"==typeof a){var c=a();b._resolveCallback(c)}},b.prototype._setPromiseCallbacks=function(a,b){this._resolveCallback=a,this._rejectCallback=b},function(c,d){var e;return e=Request.prototype.isPrototypeOf(c)&&!d?c:new Request(c,d),a.getRegistration(e.url).then(function(c){if(null!=c){var d=new b(e),f=h(a,"fetch",d);if(null!=f&&f instanceof Promise)return f}return a.browserFetch(e)})}}function n(a){function b(c,e){var f=this,g=c,h=e;if(d.log("Offline Persistence Toolkit persistenceRequest: Create New Request"),c._input){d.log("Offline Persistence Toolkit persistenceRequest: Input is a PersistenceRequest"),g=c._input,h=Object.assign({},c._init);for(var i in e)e.hasOwnProperty(i)&&(h[i]=e[i]);if(c.headers&&h&&h.body&&h.body instanceof FormData)if(h.headers){var j=c.headers.get("Content-Type");h.headers.set("Content-Type",j)}else h.headers=c.headers}this._browserRequest=new a._browserRequestConstructor(g,h),this._input=g,this._init=h;var k;for(k in this._browserRequest)"body"!=k&&"function"==typeof this._browserRequest[k]||function(a){var b=Object.getOwnPropertyDescriptor(f._browserRequest,a);b&&(b.writable||b.set)?Object.defineProperty(f,a,{get:function(){return f._browserRequest[a]},set:function(b){f._browserRequest[a]=b},enumerable:!0}):Object.defineProperty(f,a,{get:function(){return f._browserRequest[a]},enumerable:!0})}(k);var l=this.headers.get("Content-Type");null!=l&&l.indexOf("boundary=")>-1&&l.indexOf("form-data")>-1&&(l=l.split("boundary="),this._boundary="--"+l[l.length-1]),this.arrayBuffer=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called arrayBuffer()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?s(a._init.body,a._boundary).then(function(a){return q(a)}):a._browserRequest.arrayBuffer()}catch(a){return Promise.reject(a)}},this.blob=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called blob()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?s(a._init.body,a._boundary).then(function(b){return new Blob([b],{type:a.headers.get("Content-Type")})}):a._browserRequest.blob()}catch(a){return Promise.reject(a)}},this.formData=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called formData()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?Promise.resolve(a._init.body):a._browserRequest.formData()}catch(a){return Promise.reject(a)}},this.json=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called json()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?Promise.reject(new SyntaxError("Unexpected number in JSON at position 1")):a._browserRequest.json()}catch(a){return Promise.reject(a)}},this.text=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called text()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?s(a._init.body,a._boundary):a._browserRequest.text()}catch(a){return Promise.reject(a)}},this.clone=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called clone()");var a=this;a.headers&&a._init&&a._init.body&&a._init.body instanceof FormData&&(a._init.headers=a.headers);var c=new b(a._input,a._init);return c._browserRequest=a._browserRequest.clone(),c},this.toString=function(){return d.log("Offline Persistence Toolkit persistenceRequest:requestToString()"),this._input.url?this._input.url:this._input}}return b}function o(a){function b(a){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:a,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return b.prototype.respondWith=function(a){var b=this;if(a instanceof Promise)a.then(function(a){b._resolveCallback(a)},function(a){b._rejectCallback(a)});else if("function"==typeof a){var c=a();b._resolveCallback(c)}},b.prototype._setPromiseCallbacks=function(a,b){this._resolveCallback=a,this._rejectCallback=b},function(b,c){var e;return e=Request.prototype.isPrototypeOf(b)&&!c?b:new Request(b,c),d.log("Offline Persistence Toolkit serviceWorkerFetch:"+e.url),e._browserRequest&&(e=e._browserRequest),new Promise(function(b,c){a._browserFetchFunc.call(self,e).then(function(a){b(a)},function(a){c(a)})})}}function p(){var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=/\((iPad|iPhone)/i.test(navigator.userAgent);return a||b}function q(a){return(new TextEncoder).encode(a).buffer}function r(a,b,c){return new Promise(function(d,e){var f;switch(a.constructor.name){case"File":var g=new FileReader;g.onload=function(e){f='\r\nContent-Disposition: form-data; name="'+b.toString()+'"; filename="'+a.name+'"\r\nContent-Type: '+a.type+"\r\n\r\n"+e.target.result+"\r\n"+c,d(f)},g.onerror=function(){g.abort(),e(new DOMException("Problem parsing input file."))},g.readAsText(a);break;case"String":f='\r\nContent-Disposition: form-data; name="'+b+'"\r\n\r\n'+a+"\r\n"+c,d(f);break;default:f='\r\nContent-Disposition: form-data; name="'+b.toString()+'"\r\n\r\n'+a.toString()+"\r\n"+c,d(f)}})}function s(a,b){return new Promise(function(c,d){var e=[],f=b;a.forEach(function(a,c){e.push(r(a,c,b))}),Promise.all(e).then(function(a){a.forEach(function(a){f+=a}),f+="--",c(f)}).catch(function(a){d(a)})})}return e.prototype.init=function(){return d.log("Offline Persistence Toolkit PersistenceManager: Initilizing"),j(this),f(this),i(this),Promise.resolve()},e.prototype.forceOffline=function(a){d.log("Offline Persistence Toolkit PersistenceManager: forceOffline is called with value: "+a),this._forceOffline=a},e.prototype.getCache=function(){return this._cache},e.prototype.isOnline=function(){var a=navigator.onLine;return navigator.network&&navigator.network.connection&&navigator.network.connection.type==Connection.NONE&&(a=!1,d.log("Offline Persistence Toolkit PersistenceManager: Cordova network info plugin is returning online value: "+a)),a&&!this._isOffline&&!this._forceOffline},e.prototype.register=function(a){a=a||{};var b=new l(a.scope,this);return this._registrations.push(b),Promise.resolve(b)},e.prototype.getRegistration=function(a){var b,c,d=this._registrations.length;for(b=0;b<d;b++)if(c=this._registrations[b],a.match(c.scope))return Promise.resolve(c);return Promise.resolve()},e.prototype.getRegistrations=function(){return Promise.resolve(this._registrations.slice())},e.prototype.getSyncManager=function(){return this._persistenceSyncManager},e.prototype.browserFetch=function(a){var b=this;d.log("Offline Persistence Toolkit PersistenceManager: browserFetch() for Request with url: "+a.url);var c=a;return g()?(Object.defineProperty(this,"_browserFetchRequest",{value:a,writable:!0}),new Promise(function(e,f){d.log("Offline Persistence Toolkit PersistenceManager: Calling browser fetch function for Request with url: "+a.url),a._browserRequest&&(c=a._browserRequest),b._browserFetchFunc.call(window,c).then(function(a){e(a)},function(a){f(a)}),b._browserFetchRequest=null})):(a._browserRequest&&(c=a._browserRequest),fetch(c))},l.prototype.addEventListener=function(a,b){this._eventListeners.push({type:a.toLowerCase(),listener:b})},l.prototype.unregister=function(){return Promise.resolve(k(this._persistenceManager,this))},new e}); | ||
define(["./impl/PersistenceXMLHttpRequest","./impl/PersistenceSyncManager","./impl/offlineCacheManager","./impl/logger","./impl/fetch"],function(a,b,c,d){"use strict";function e(){Object.defineProperty(this,"_registrations",{value:[],writable:!0}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_forceOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_isOffline",{value:!1,writable:!0}),Object.defineProperty(this,"_cache",{value:null,writable:!0}),Object.defineProperty(this,"_persistenceSyncManager",{value:new b(this.isOnline.bind(this),this.browserFetch.bind(this),this.getCache.bind(this))})}function f(a){var b=a;g()&&!b._addedBrowserEventListeners&&(d.log("Offline Persistence Toolkit PersistenceManager: Adding browser event listeners"),window.addEventListener("offline",function(a){b._isOffline=!0},!1),window.addEventListener("online",function(a){b._isOffline=!1},!1),b._addedBrowserEventListeners=!0)}function g(){return"undefined"!=typeof window&&null!=window}function h(a,b,c){var e,f,g,h,i=null,j=a._registrations,k=null!=j?j.length:0;for(e=0;e<k;e++)if(g=j[e],null!=c.request.url.match(g.scope)){for(h=g._eventListeners.length,f=0;f<h;f++)if(g._eventListeners[f].type==b)if("fetch"==b)null===i&&c._setPromiseCallbacks instanceof Function&&(i=new Promise(function(a,b){c._setPromiseCallbacks(a,b)})),d.log("Offline Persistence Toolkit PersistenceManager: Calling fetch event listener"),g._eventListeners[f].listener(c);else if(d.log("Offline Persistence Toolkit PersistenceManager: Calling event listener"),!1===g._eventListeners[f].listener(c))return!1;if(null!=i)return i}return!0}function i(a){a._cache=c.open("systemCache")}function j(b){!p()||b._browserRequestConstructor||b._persistenceRequestConstructor||(d.log("Offline Persistence Toolkit PersistenceManager: Replacing Safari Browser APIs"),Object.defineProperty(b,"_browserRequestConstructor",{value:self.Request,writable:!1}),Object.defineProperty(b,"_persistenceRequestConstructor",{value:n(b),writable:!1}),self.Request=b._persistenceRequestConstructor,g()||b._browserFetchFunc||(Object.defineProperty(b,"_browserFetchFunc",{value:self.fetch,writable:!1}),self.fetch=o(b))),!g()||b._browserFetchFunc||b._browserXMLHttpRequest||(d.log("Offline Persistence Toolkit PersistenceManager: Replacing browser APIs"),Object.defineProperty(b,"_browserFetchFunc",{value:window.fetch,writable:!1}),Object.defineProperty(b,"_browserXMLHttpRequest",{value:window.XMLHttpRequest,writable:!1}),window.fetch=m(b),window.XMLHttpRequest=function(){return null!=b._browserFetchRequest?new b._browserXMLHttpRequest:new a(b._browserXMLHttpRequest)})}function k(a,b){var c=a,d=c._registrations.indexOf(b);return d>-1&&(c._registrations.splice(d,1),!0)}function l(a,b){Object.defineProperty(this,"scope",{value:a,enumerable:!0}),Object.defineProperty(this,"_persistenceManager",{value:b}),Object.defineProperty(this,"_eventListeners",{value:[],writable:!0})}function m(a){function b(a){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:a,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return b.prototype.respondWith=function(a){var b=this;if(a instanceof Promise)a.then(function(a){b._resolveCallback(a)},function(a){b._rejectCallback(a)});else if("function"==typeof a){var c=a();b._resolveCallback(c)}},b.prototype._setPromiseCallbacks=function(a,b){this._resolveCallback=a,this._rejectCallback=b},function(c,d){var e;return e=Request.prototype.isPrototypeOf(c)&&!d?c:new Request(c,d),a.getRegistration(e.url).then(function(c){if(null!=c){var d=new b(e),f=h(a,"fetch",d);if(null!=f&&f instanceof Promise)return f}return a.browserFetch(e)})}}function n(a){function b(c,e){var f=this,g=c,h=e;if(d.log("Offline Persistence Toolkit persistenceRequest: Create New Request"),c._input){d.log("Offline Persistence Toolkit persistenceRequest: Input is a PersistenceRequest"),g=c._input,h=Object.assign({},c._init);for(var i in e)e.hasOwnProperty(i)&&(h[i]=e[i]);if(c.headers&&h&&h.body&&h.body instanceof FormData)if(h.headers){var j=c.headers.get("Content-Type");h.headers.set("Content-Type",j)}else h.headers=c.headers}this._browserRequest=new a._browserRequestConstructor(g,h),this._input=g,this._init=h;var k;for(k in this._browserRequest)"body"!=k&&"function"==typeof this._browserRequest[k]||function(a){var b=Object.getOwnPropertyDescriptor(f._browserRequest,a);b&&(b.writable||b.set)?Object.defineProperty(f,a,{get:function(){return f._browserRequest[a]},set:function(b){f._browserRequest[a]=b},enumerable:!0}):Object.defineProperty(f,a,{get:function(){return f._browserRequest[a]},enumerable:!0})}(k);var l=this.headers.get("Content-Type");null!=l&&l.indexOf("boundary=")>-1&&l.indexOf("form-data")>-1&&(l=l.split("boundary="),this._boundary="--"+l[l.length-1]),this.arrayBuffer=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called arrayBuffer()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?s(a._init.body,a._boundary).then(function(a){return q(a)}):a._browserRequest.arrayBuffer()}catch(a){return Promise.reject(a)}},this.blob=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called blob()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?s(a._init.body,a._boundary).then(function(b){return new Blob([b],{type:a.headers.get("Content-Type")})}):a._browserRequest.blob()}catch(a){return Promise.reject(a)}},this.formData=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called formData()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?Promise.resolve(a._init.body):a._browserRequest.formData()}catch(a){return Promise.reject(a)}},this.json=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called json()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?Promise.reject(new SyntaxError("Unexpected number in JSON at position 1")):a._browserRequest.json()}catch(a){return Promise.reject(a)}},this.text=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called text()");var a=this;try{return a._init&&a._init.body&&a._init.body instanceof FormData?s(a._init.body,a._boundary):a._browserRequest.text()}catch(a){return Promise.reject(a)}},this.clone=function(){d.log("Offline Persistence Toolkit persistenceRequest: Called clone()");var a=this;a.headers&&a._init&&a._init.body&&a._init.body instanceof FormData&&(a._init.headers=a.headers);var c=new b(a._input,a._init);return c._browserRequest=a._browserRequest.clone(),c},this.toString=function(){return d.log("Offline Persistence Toolkit persistenceRequest:requestToString()"),this._input.url?this._input.url:this._input}}return b}function o(a){function b(a){Object.defineProperty(this,"isReload",{value:!1,enumerable:!0}),Object.defineProperty(this,"clientId",{value:null,enumerable:!0}),Object.defineProperty(this,"client",{value:null,enumerable:!0}),Object.defineProperty(this,"request",{value:a,enumerable:!0}),Object.defineProperty(this,"_resolveCallback",{value:null,writable:!0}),Object.defineProperty(this,"_rejectCallback",{value:null,writable:!0})}return b.prototype.respondWith=function(a){var b=this;if(a instanceof Promise)a.then(function(a){b._resolveCallback(a)},function(a){b._rejectCallback(a)});else if("function"==typeof a){var c=a();b._resolveCallback(c)}},b.prototype._setPromiseCallbacks=function(a,b){this._resolveCallback=a,this._rejectCallback=b},function(b,c){var e;return e=Request.prototype.isPrototypeOf(b)&&!c?b:new Request(b,c),d.log("Offline Persistence Toolkit serviceWorkerFetch:"+e.url),e._browserRequest&&(e=e._browserRequest),new Promise(function(b,c){a._browserFetchFunc.call(self,e).then(function(a){b(a)},function(a){c(a)})})}}function p(){var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=/\((iPad|iPhone)/i.test(navigator.userAgent);return a||b}function q(a){return(new TextEncoder).encode(a).buffer}function r(a,b,c){return new Promise(function(d,e){var f;switch(a.constructor.name){case"File":var g=new FileReader;g.onload=function(e){f='\r\nContent-Disposition: form-data; name="'+b.toString()+'"; filename="'+a.name+'"\r\nContent-Type: '+a.type+"\r\n\r\n"+e.target.result+"\r\n"+c,d(f)},g.onerror=function(){g.abort(),e(new DOMException("Problem parsing input file."))},g.readAsText(a);break;case"String":f='\r\nContent-Disposition: form-data; name="'+b+'"\r\n\r\n'+a+"\r\n"+c,d(f);break;default:f='\r\nContent-Disposition: form-data; name="'+b.toString()+'"\r\n\r\n'+a.toString()+"\r\n"+c,d(f)}})}function s(a,b){return new Promise(function(c,d){var e=[],f=b;a.forEach(function(a,c){e.push(r(a,c,b))}),Promise.all(e).then(function(a){a.forEach(function(a){f+=a}),f+="--",c(f)}).catch(function(a){d(a)})})}return e.prototype.init=function(){return d.log("Offline Persistence Toolkit PersistenceManager: Initilizing"),j(this),f(this),i(this),Promise.resolve()},e.prototype.forceOffline=function(a){d.log("Offline Persistence Toolkit PersistenceManager: forceOffline is called with value: "+a),this._forceOffline=a},e.prototype.getCache=function(){return this._cache},e.prototype.isOnline=function(){var a=navigator.onLine;return navigator.network&&navigator.network.connection&&navigator.network.connection.type==Connection.NONE&&(a=!1,d.log("Offline Persistence Toolkit PersistenceManager: Cordova network info plugin is returning online value: "+a)),a&&!this._isOffline&&!this._forceOffline},e.prototype.register=function(a){a=a||{};var b=new l(a.scope,this);return this._registrations.push(b),Promise.resolve(b)},e.prototype.getRegistration=function(a){var b,c,d=this._registrations.length;for(b=0;b<d;b++)if(c=this._registrations[b],a.match(c.scope))return Promise.resolve(c);return Promise.resolve()},e.prototype.getRegistrations=function(){return Promise.resolve(this._registrations.slice())},e.prototype.getSyncManager=function(){return this._persistenceSyncManager},e.prototype.browserFetch=function(a){var b=this;d.log("Offline Persistence Toolkit PersistenceManager: browserFetch() for Request with url: "+a.url);var c=a;return g()?(Object.defineProperty(this,"_browserFetchRequest",{value:a,writable:!0}),new Promise(function(e,f){d.log("Offline Persistence Toolkit PersistenceManager: Calling browser fetch function for Request with url: "+a.url),a._browserRequest&&(c=a._browserRequest),b._browserFetchFunc.call(window,c).then(function(a){e(a)},function(a){f(a)}),b._browserFetchRequest=null})):(a._browserRequest&&(c=a._browserRequest),fetch(c))},l.prototype.addEventListener=function(a,b){this._eventListeners.push({type:a.toLowerCase(),listener:b})},l.prototype.unregister=function(){return Promise.resolve(k(this._persistenceManager,this))},new e}); |
@@ -1,1 +0,1 @@ | ||
define(["./persistenceManager","./persistenceStoreManager","./persistenceUtils","./impl/logger","./impl/sql-where-parser.min"],function(a,b,c,d,e){"use strict";function f(a,b,e){return b=b||function(a){return h(a)},function(f,h){if("GET"==f.method||"HEAD"==f.method){d.log("Offline Persistence Toolkit queryHandlers: OracleRestQueryHandler processing request");var i,j,l=f.url.split("?"),m={};j="undefined"==typeof URLSearchParams?k(l[1]):new URLSearchParams(l[1]).entries();var n,o,p,q,r;do{n=j.next(),null!=n.value&&(o=n.value[0],p=n.value[1],"q"==o?i=p:"limit"==o?q=p:"offset"==o&&(r=p))}while(!n.done);var s,t,m=c._mapFindQuery(b(i),e);if(null!=h.jsonProcessor&&(s=h.jsonProcessor.shredder,t=h.jsonProcessor.unshredder),null!=s&&null!=t)return g(f,a,m,s,t,r,q).then(function(a){if(a){return a.clone().text().then(function(b){if(null!=b&&b.length>0)try{var d=JSON.parse(b);return d.links?a:(d.links=[{rel:"self",href:f.url}],c.setResponsePayload(a,d).then(function(a){return a}))}catch(a){}})}})}return Promise.resolve()}}function g(e,f,g,h,i,j,k){return a.getCache()._internalMatch(e,{ignoreSearch:!0,ignoreBody:!0}).then(function(h){if(h)return"unknown"===h.resourceType?null:"single"===h.resourceType?a.getCache()._matchByKey(e,h.key):b.openStore(f).then(function(a){return a.find(g)}).then(function(b){var g=!1,l=b.length;j&&j>0&&(b=j<l?b.slice(j):[]),k&&k>0&&b.length>0&&k<b.length&&(g=!0,b=b.slice(0,k));var m={name:f,data:b,resourceType:"collection"};return a.getCache()._matchByKey(e,h.key,{ignoreBody:!0}).then(function(a){return i([m],a).then(function(b){return b.clone().text().then(function(e){if(!(null!=e&&e.length>0))return b;try{var f=JSON.parse(e);return null!=f.items?(k&&(f.limit=parseInt(k,10)),j&&(f.offset=parseInt(j,10)),f.hasMore=g,f.totalResults=l,c.setResponsePayload(a,f)):b}catch(a){d.log("JSON parse error on payload: "+e)}})})})});var l=m(e);return l?b.openStore(f).then(function(a){return a.findByKey(l)}).then(function(b){if(b){var d=n(e);return d?c.requestToJSON(e).then(function(e){return e.url=d,c.requestFromJSON(e).then(function(c){return a.getCache().match(c,{ignoreSearch:!0,ignoreBody:!0}).then(function(a){if(a){return i([{name:f,data:[b],resourceType:"single"}],a)}})})}):void 0}}):void 0})}function h(a){var b={};if(a){var c=e.defaultConfig;c.operators[5]["<>"]=2,c.tokenizer.shouldTokenize.push("<>");var d,f=new e(c),g=a.split(";"),h={},i=[],j={};for(d=0;d<g.length;d++)j=f.parse(g[d],function(a,b){"AND"!=(a=a.toUpperCase())&&"OR"!=a&&","!=a&&(b[0]="value."+b[0]);var c=b[0],d=b[1],e={};switch(a){case">":e[c]={$gt:d};break;case"<":e[c]={$lt:d};break;case">=":e[c]={$gte:d};break;case"<=":e[c]={$lte:d};break;case"=":e[c]={$eq:d};break;case"!=":e[c]={$ne:d};break;case"AND":e={$and:b};break;case"OR":e={$or:b};break;case"LIKE":d=d.replace("%",".+"),e[c]={$regex:d};break;case"BETWEEN":var f=[];f[0]={},f[1]={},f[0][c]={$gte:b[1]},f[1][c]={$lte:b[2]},e={$and:f};break;case"<>":e[c]={$ne:d};break;case"IS":if(null===d){var g=[];g[0]={},g[1]={},g[0][c]={$eq:null},g[1][c]={$eq:void 0},e={$or:g}}break;case"IN":e[c]={$in:[].concat(d)};break;case",":return[d].concat(c)}return e}),i.push(j);i.length>1?h.$and=i:1==i.length&&(h=i[0]),Object.keys(h).length>0&&(b.selector=h)}return b}function i(a,b,e){return function(f,h){if("GET"==f.method||"HEAD"==f.method){d.log("Offline Persistence Toolkit queryHandlers: SimpleQueryHandler processing request");var i,k,l=f.url.split("?"),m=c._mapFindQuery(j(l,b),e);if(null!=h.jsonProcessor&&(i=h.jsonProcessor.shredder,k=h.jsonProcessor.unshredder),null!=i&&null!=k)return g(f,a,m,i,k)}return Promise.resolve()}}function j(a,b){var c={};if(a&&a.length>1){var d,e={};d="undefined"==typeof URLSearchParams?k(a[1]):new URLSearchParams(a[1]).entries();var f,g,h;do{f=d.next(),null!=f.value&&(g=f.value[0],h=f.value[1],b&&-1!=b.indexOf(g)||(e["value."+g]=h))}while(!f.done);Object.keys(e).length>0&&(c.selector=e)}return c}function k(a){var b=[];if(null!=a){"?"===a.charAt(0)&&(a=a.slice(1)),a=a||"";var c,d,e,f=a.split("&");b=f.map(function(a){return e=a.indexOf("="),e>-1?(c=a.slice(0,e),d=a.slice(e+1),d=l(d)):(c=a,d=""),c=l(c),[c,d]})}return{next:function(){var a=b.shift();return{done:void 0===a,value:a}}}}function l(a){return decodeURIComponent(a.replace(/\+/g," "))}function m(a){var b=a.url.split("/");return b.length>1?b[b.length-1].split("?")[0]:null}function n(a){var b=a.url.split("/");return b.length>1?(b.pop(),b.join("/")):null}return{getSimpleQueryHandler:i,getOracleRestQueryHandler:f}}); | ||
define(["./persistenceManager","./persistenceStoreManager","./persistenceUtils","./impl/logger","./impl/sql-where-parser.min"],function(a,b,c,d,e){"use strict";function f(a,b,e){return b=b||function(a){return h(a)},function(f,h){if("GET"==f.method||"HEAD"==f.method){d.log("Offline Persistence Toolkit queryHandlers: OracleRestQueryHandler processing request");var i,j,l=f.url.split("?"),m={};j="undefined"==typeof URLSearchParams?k(l[1]):new URLSearchParams(l[1]).entries();var n,o,p,q,r;do{n=j.next(),null!=n.value&&(o=n.value[0],p=n.value[1],"q"==o?i=p:"limit"==o?q=p:"offset"==o&&(r=p))}while(!n.done);var s,t,m=c._mapFindQuery(b(i),e);if(null!=h.jsonProcessor&&(s=h.jsonProcessor.shredder,t=h.jsonProcessor.unshredder),null!=s&&null!=t)return g(f,a,m,s,t,r,q).then(function(a){if(a){return a.clone().text().then(function(b){if(null!=b&&b.length>0)try{var d=JSON.parse(b);return d.links?a:(d.links=[{rel:"self",href:f.url}],c.setResponsePayload(a,d).then(function(a){return a}))}catch(a){}})}})}return Promise.resolve()}}function g(e,f,g,h,i,j,k){return a.getCache()._internalMatch(e,{ignoreSearch:!0,ignoreBody:!0}).then(function(h){if(h)return"unknown"===h.resourceType?null:"single"===h.resourceType?a.getCache()._matchByKey(e,h.key):b.openStore(f).then(function(a){return a.find(g)}).then(function(b){var g=!1,l=b.length;j&&j>0&&(b=j<l?b.slice(j):[]),k&&k>0&&b.length>0&&k<b.length&&(g=!0,b=b.slice(0,k));var m={name:f,data:b,resourceType:"collection"};return a.getCache()._matchByKey(e,h.key,{ignoreBody:!0}).then(function(a){return i([m],a).then(function(b){return b.clone().text().then(function(e){if(!(null!=e&&e.length>0))return b;try{var f=JSON.parse(e);return null!=f.items?(k&&(f.limit=parseInt(k,10)),j&&(f.offset=parseInt(j,10)),f.hasMore=g,f.totalResults=l,c.setResponsePayload(a,f)):b}catch(a){d.log("JSON parse error on payload: "+e)}})})})});var l=m(e);return l?b.openStore(f).then(function(a){return a.findByKey(l)}).then(function(b){if(b){var d=n(e);return d?c.requestToJSON(e).then(function(e){return e.url=d,c.requestFromJSON(e).then(function(c){return a.getCache().match(c,{ignoreSearch:!0,ignoreBody:!0}).then(function(a){if(a){return i([{name:f,data:[b],resourceType:"single"}],a)}})})}):void 0}}):void 0})}function h(a){var b={};if(a){var c=e.defaultConfig;c.operators[5]["<>"]=2,c.tokenizer.shouldTokenize.push("<>");var d,f=new e(c),g=a.split(";"),h={},i=[],j={};for(d=0;d<g.length;d++)j=f.parse(g[d],function(a,b){"AND"!=(a=a.toUpperCase())&&"OR"!=a&&","!=a&&(b[0]="value."+b[0]);var c=b[0],d=b[1],e={};switch(a){case">":e[c]={$gt:d};break;case"<":e[c]={$lt:d};break;case">=":e[c]={$gte:d};break;case"<=":e[c]={$lte:d};break;case"=":e[c]={$eq:d};break;case"!=":e[c]={$ne:d};break;case"AND":e={$and:b};break;case"OR":e={$or:b};break;case"LIKE":d=d.replace(/%/g,".*"),e[c]={$regex:RegExp(d,"i")};break;case"BETWEEN":var f=[];f[0]={},f[1]={},f[0][c]={$gte:b[1]},f[1][c]={$lte:b[2]},e={$and:f};break;case"<>":e[c]={$ne:d};break;case"IS":if(null===d){var g=[];g[0]={},g[1]={},g[0][c]={$eq:null},g[1][c]={$eq:void 0},e={$or:g}}break;case"IN":e[c]={$in:[].concat(d)};break;case",":return[d].concat(c)}return e}),i.push(j);i.length>1?h.$and=i:1==i.length&&(h=i[0]),Object.keys(h).length>0&&(b.selector=h)}return b}function i(a,b,e){return function(f,h){if("GET"==f.method||"HEAD"==f.method){d.log("Offline Persistence Toolkit queryHandlers: SimpleQueryHandler processing request");var i,k,l=f.url.split("?"),m=c._mapFindQuery(j(l,b),e);if(null!=h.jsonProcessor&&(i=h.jsonProcessor.shredder,k=h.jsonProcessor.unshredder),null!=i&&null!=k)return g(f,a,m,i,k)}return Promise.resolve()}}function j(a,b){var c={};if(a&&a.length>1){var d,e={};d="undefined"==typeof URLSearchParams?k(a[1]):new URLSearchParams(a[1]).entries();var f,g,h;do{f=d.next(),null!=f.value&&(g=f.value[0],h=f.value[1],b&&-1!=b.indexOf(g)||(e["value."+g]=h))}while(!f.done);Object.keys(e).length>0&&(c.selector=e)}return c}function k(a){var b=[];if(null!=a){"?"===a.charAt(0)&&(a=a.slice(1)),a=a||"";var c,d,e,f=a.split("&");b=f.map(function(a){return e=a.indexOf("="),e>-1?(c=a.slice(0,e),d=a.slice(e+1),d=l(d)):(c=a,d=""),c=l(c),[c,d]})}return{next:function(){var a=b.shift();return{done:void 0===a,value:a}}}}function l(a){return decodeURIComponent(a.replace(/\+/g," "))}function m(a){var b=a.url.split("/");return b.length>1?b[b.length-1].split("?")[0]:null}function n(a){var b=a.url.split("/");return b.length>1?(b.pop(),b.join("/")):null}return{getSimpleQueryHandler:i,getOracleRestQueryHandler:f}}); |
{ | ||
"name": "@oracle/offline-persistence-toolkit", | ||
"title": "Offline Persistence Toolkit", | ||
"version": "1.4.9", | ||
"version": "1.5.1", | ||
"description": "Offline Persistence Toolkit by Oracle Corp.", | ||
@@ -6,0 +6,0 @@ "author": "oraclejet", |
@@ -1,2 +0,2 @@ | ||
# offline-persistence-toolkit 1.4.9 # | ||
# offline-persistence-toolkit 1.5.1 # | ||
@@ -61,3 +61,3 @@ offline-persistence-toolkit is a client-side JavaScript library that provides caching and offline support at the HTTP request layer. This support is transparent to the user and is done through the Fetch API and an XHR adapter. HTTP requests made while the client device is offline are captured for replay when connection to the server is restored. Additional capabilities include a persistent storage layer, synchronization manager, binary data support and various configuration APIs for customizing the default behavior. This framework can be used in both ServiceWorker and non-ServiceWorker contexts within web and hybrid mobile apps. | ||
paths: { | ||
'persist' : 'js/libs/persist/v1.4.9/min' | ||
'persist' : 'js/libs/persist/v1.5.1/min' | ||
@@ -67,7 +67,7 @@ // Other path mappings here | ||
``` | ||
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.4.9/min'` entry to the list of paths. | ||
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.5.1/min'` entry to the list of paths. | ||
You can choose the name of the paths prefix. That is, you can use a different value to the ‘persist’ value shown in the examples. | ||
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.4.9/min'`. | ||
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.5.1/min'`. | ||
@@ -96,3 +96,3 @@ Versions of the toolkit are also available on CDN under the latest JET release. e.g. | ||
'pouchfind': 'js/libs/pouchdb.find', | ||
'persist' : 'js/libs/persist/v1.4.9/min' | ||
'persist' : 'js/libs/persist/v1.5.1/min' | ||
@@ -99,0 +99,0 @@ // Other path mappings here |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
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
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
4725504
86020