Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oracle/offline-persistence-toolkit

Package Overview
Dependencies
Maintainers
13
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oracle/offline-persistence-toolkit - npm Package Compare versions

Comparing version 1.2.7 to 1.2.8

dist/debug/offline-persistence-toolkit-arraystore-1.2.8.js

12

dist/debug/bundles-config.js

@@ -5,3 +5,3 @@ (function(){

{
'persist/offline-persistence-toolkit-core-1.2.7': [
'persist/offline-persistence-toolkit-core-1.2.8': [
'persist/persistenceUtils',

@@ -18,3 +18,3 @@ 'persist/impl/logger',

],
'persist/offline-persistence-toolkit-pouchdbstore-1.2.7': [
'persist/offline-persistence-toolkit-pouchdbstore-1.2.8': [
'persist/PersistenceStore',

@@ -27,3 +27,3 @@ 'persist/impl/storageUtils',

],
'persist/offline-persistence-toolkit-arraystore-1.2.7': [
'persist/offline-persistence-toolkit-arraystore-1.2.8': [
'persist/PersistenceStore',

@@ -36,3 +36,3 @@ 'persist/impl/storageUtils',

],
'persist/offline-persistence-toolkit-localstore-1.2.7': [
'persist/offline-persistence-toolkit-localstore-1.2.8': [
'persist/PersistenceStore',

@@ -45,3 +45,3 @@ 'persist/impl/storageUtils',

],
'persist/offline-persistence-toolkit-filesystemstore-1.2.7': [
'persist/offline-persistence-toolkit-filesystemstore-1.2.8': [
'persist/impl/storageUtils',

@@ -52,3 +52,3 @@ 'persist/impl/keyValuePersistenceStore',

],
'persist/offline-persistence-toolkit-responseproxy-1.2.7': [
'persist/offline-persistence-toolkit-responseproxy-1.2.8': [
'persist/fetchStrategies',

@@ -55,0 +55,0 @@ 'persist/cacheStrategies',

@@ -515,3 +515,3 @@ /**

var payloadType = persistenceUtils.derivePayloadType(self, response);
var payloadType = persistenceUtils._derivePayloadType(self, response);
if (payloadType === 'blob') {

@@ -518,0 +518,0 @@ logger.log('Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.blob()');

@@ -43,15 +43,3 @@ /**

/**
* Derive the payload body type based on content-type from response
* header and responseType from request.
* @method
* @name derivePayloadType
* @memberof persistenceUtils
* @static
* @param {XMLHttpRequest} xhr request object
* @param {Response} response Response object
* @return {string} Returns payload body type, possible values are:
* text, blob, arraybuffer, multipart
*/
function derivePayloadType(xhr, response) {
function _derivePayloadType(xhr, response) {
var contentType = response.headers.get('Content-Type');

@@ -63,5 +51,5 @@ var responseType = xhr.responseType;

return "blob";
} else if (contentType.indexOf('image/') !== -1 || responseType === 'arraybuffer') {
} else if (contentType && contentType.indexOf('image/') !== -1 || responseType === 'arraybuffer') {
return "arraybuffer";
} else if (contentType.indexOf('multipart/form-data') !== -1) {
} else if (contentType && contentType.indexOf('multipart/form-data') !== -1) {
return "multipart";

@@ -562,5 +550,5 @@ } else {

_cloneResponse: _cloneResponse,
derivePayloadType: derivePayloadType
_derivePayloadType: _derivePayloadType
};
});

@@ -1,1 +0,1 @@

!function(){requirejs.config({bundles:{"persist/offline-persistence-toolkit-core-1.2.7":["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.2.7":["persist/PersistenceStore","persist/impl/storageUtils","persist/pouchdb-browser-7.0.0","persist/impl/pouchDBPersistenceStore","persist/pouchDBPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-arraystore-1.2.7":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/arrayPersistenceStore","persist/arrayPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-localstore-1.2.7":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/localPersistenceStore","persist/localPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-filesystemstore-1.2.7":["persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/fileSystemPersistenceStore","persist/fileSystemPersistenceStoreFactory"],"persist/offline-persistence-toolkit-responseproxy-1.2.7":["persist/fetchStrategies","persist/cacheStrategies","persist/defaultResponseProxy","persist/simpleJsonShredding","persist/oracleRestJsonShredding","persist/simpleBinaryDataShredding","persist/queryHandlers"]}})}();
!function(){requirejs.config({bundles:{"persist/offline-persistence-toolkit-core-1.2.8":["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.2.8":["persist/PersistenceStore","persist/impl/storageUtils","persist/pouchdb-browser-7.0.0","persist/impl/pouchDBPersistenceStore","persist/pouchDBPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-arraystore-1.2.8":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/arrayPersistenceStore","persist/arrayPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-localstore-1.2.8":["persist/PersistenceStore","persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/localPersistenceStore","persist/localPersistenceStoreFactory","persist/persistenceStoreFactory"],"persist/offline-persistence-toolkit-filesystemstore-1.2.8":["persist/impl/storageUtils","persist/impl/keyValuePersistenceStore","persist/impl/fileSystemPersistenceStore","persist/fileSystemPersistenceStoreFactory"],"persist/offline-persistence-toolkit-responseproxy-1.2.8":["persist/fetchStrategies","persist/cacheStrategies","persist/defaultResponseProxy","persist/simpleJsonShredding","persist/oracleRestJsonShredding","persist/simpleBinaryDataShredding","persist/queryHandlers"]}})}();

@@ -1,1 +0,1 @@

define(["../persistenceUtils","./logger"],function(a,b){"use strict";function c(a){var b=this;Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_browserXMLHttpRequest",{value:a}),Object.defineProperty(this,"_method",{value:null,writable:!0}),Object.defineProperty(this,"onabort",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onerror",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onload",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadend",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadstart",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onprogress",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onreadystatechange",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"ontimeout",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"_password",{value:null,writable:!0}),Object.defineProperty(this,"_readyState",{value:0,writable:!0}),Object.defineProperty(this,"readyState",{enumerable:!0,get:function(){return b._readyState}}),Object.defineProperty(this,"_requestHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_response",{value:"",writable:!0}),Object.defineProperty(this,"response",{enumerable:!0,get:function(){return b._response}}),Object.defineProperty(this,"_responseHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_responseText",{value:"",writable:!0}),Object.defineProperty(this,"responseText",{enumerable:!0,get:function(){return b._responseText}}),Object.defineProperty(this,"responseType",{value:"",enumerable:!0,writable:!0}),Object.defineProperty(this,"_responseURL",{value:"",writable:!0}),Object.defineProperty(this,"responseURL",{enumerable:!0,get:function(){return b._responseURL}}),Object.defineProperty(this,"_responseXML",{value:null,writable:!0}),Object.defineProperty(this,"responseXML",{enumerable:!0,get:function(){return b._responseXML}}),Object.defineProperty(this,"_status",{value:0,writable:!0}),Object.defineProperty(this,"status",{enumerable:!0,get:function(){return b._status}}),Object.defineProperty(this,"_statusText",{value:"",writable:!0}),Object.defineProperty(this,"statusText",{enumerable:!0,get:function(){return b._statusText}}),Object.defineProperty(this,"timeout",{value:0,enumerable:!0}),Object.defineProperty(this,"upload",{value:null,enumerable:!0}),Object.defineProperty(this,"_url",{value:null,writable:!0}),Object.defineProperty(this,"_username",{value:null,writable:!0}),Object.defineProperty(this,"withCredentials",{value:!1,enumerable:!0,writable:!0})}function d(a,b){a._readyState=b,a.dispatchEvent(new k("readystatechange")),a._readyState==c.DONE&&(a.dispatchEvent(new k("load",!1,!1,a)),a.dispatchEvent(new k("loadend",!1,!1,a)))}function e(a){var b=a.toLowerCase();if(0===b.indexOf("http:")||0===b.indexOf("https:"))return!1;if(0===b.indexOf("file:")||0===b.indexOf("cdvfile:"))return!0;if(URL&&URL.prototype&&null!=(b=new URL(a,window.location.href).origin)&&"null"!=b&&b.length>0)return 0===b.toLowerCase().indexOf("file:");var c=document.createElement("a");return c.href=a,!(!(b=c.protocol)||0!==b.toLowerCase().indexOf("file:"))}function f(a){function b(b){c.append(b,a._requestHeaders[b])}var c=new Headers;return Object.keys(a._requestHeaders).forEach(b),c}function g(a,b){var c=f(a),d=a.withCredentials?"include":"same-origin",e={method:a._method,headers:c,mode:"cors",cache:"default",credentials:d};return"GET"!==a._method&&"HEAD"!==a._method&&"DELETE"!==a._method&&(e.body=b),e}function h(e,f,g){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Processing Response"),i(e,g.headers);var h=g.headers.get("Content-Type");e._status=g.status,e._statusText=g.statusText,e._responseURL=f.url;var j=a.derivePayloadType(e,g);if("blob"===j)b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.blob()"),g.blob().then(function(a){e._responseType="blob",e._response=a,d(e,c.DONE),"function"==typeof e.onload&&e.onload()},function(a){b.error(a)});else if("arraybuffer"===j)b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.arrayBuffer()"),g.arrayBuffer().then(function(a){e._responseType="arrayBuffer",e._response=a,d(e,c.DONE),"function"==typeof e.onload&&e.onload()},function(a){b.error("error reading response as arrayBuffer!")});else if("multipart"===j){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.formData()"),e._responseType="formData";var k=function(b){var f="";a.parseMultipartFormData(b,h).forEach(function(a){f+=a.data}),e._response=f,e._responseText=f,d(e,c.DONE),"function"==typeof e.onload&&e.onload()};if(g.formData)try{g.formData().then(function(a){var b,f,g="",h=a.values();do{f=h.next(),(b=f.value)&&(g+=b)}while(!f.done);e._response=g,e._responseText=g,d(e,c.DONE),"function"==typeof e.onload&&e.onload()})}catch(a){g.text().then(function(a){k(a)})}else g.text().then(function(a){k(a)})}else g.text().then(function(a){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.text()"),e._responseType="",e._response=a,e._responseText=a,d(e,c.DONE),"function"==typeof e.onload&&e.onload()},function(a){b.error(a)})}function i(a,b){if(a._responseHeaders={},b.entries){var e,f,g,h=b.entries();do{e=h.next(),e.value&&(f=e.value[0],g=e.value[1],a._forceMimeType&&"content-type"==f.toLowerCase()?a._responseHeaders[f]=a._forceMimeType:a._responseHeaders[f]=g)}while(!e.done)}else b.forEach&&b.forEach(function(b,c){a._forceMimeType&&"content-type"==c.toLowerCase()?a._responseHeaders[c]=a._forceMimeType:a._responseHeaders[c]=b});d(a,c.HEADERS_RECEIVED)}function j(a){if(a._readyState!==c.OPENED)throw new Error("INVALID_STATE_ERR")}function k(a,b,c,d){Object.defineProperty(this,"type",{value:a,enumerable:!0}),Object.defineProperty(this,"bubbles",{value:b,enumerable:!0}),Object.defineProperty(this,"cancelable",{value:c,enumerable:!0}),Object.defineProperty(this,"target",{value:d,enumerable:!0})}return Object.defineProperty(c,"UNSENT",{value:0,enumerable:!0}),Object.defineProperty(c,"OPENED",{value:1,enumerable:!0}),Object.defineProperty(c,"HEADERS_RECEIVED",{value:2,enumerable:!0}),Object.defineProperty(c,"LOADING",{value:3,enumerable:!0}),Object.defineProperty(c,"DONE",{value:4,enumerable:!0}),c.prototype.open=function(a,f,g,h,i){if(b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open() for method: "+a+", url: "+f),"boolean"==typeof g&&!g)throw new Error("InvalidAccessError: Failed to execute 'open' on 'XMLHttpRequest': Synchronous requests are disabled on the XHR Adapter");if(this._method=a,this._url=f,e(f)){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open called for a File url");var j=this;this._passthroughXHR=new j._browserXMLHttpRequest,this._passthroughXHR.onreadystatechange=function(){j._passthroughXHR.readyState==c.DONE&&(j._status=j._passthroughXHR.status,j._statusText=j._passthroughXHR.statusText,j._response=j._passthroughXHR.response,j._responseHeaders=j._passthroughXHR.responseHeaders,j._responseType=j._passthroughXHR.responseType,null!=j._responseType&&""!=j._responseType&&"text"!=j._responseType||(j._responseText=j._passthroughXHR.responseText),j._responseURL=j._passthroughXHR.responseURL,null!=j._responseType&&""!=j._responseType&&"document"!=j._responseType||(j._responseXML=j._passthroughXHR.responseXML)),d(j,j._passthroughXHR.readyState)},this._passthroughXHR.open(a,f,g,h,i)}else this._passthroughXHR=null;this._username=h,this._password=i,this._responseText=null,this._responseXML=null,this._requestHeaders={},d(this,c.OPENED)},c.prototype.setRequestHeader=function(a,c){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: setRequestHeader() with header: "+a+" ,value: "+c),j(this);var d=this._requestHeaders[a];this._requestHeaders[a]=d?d+=","+c:c},c.prototype.send=function(a){if(b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: send()"),this._passthroughXHR)null!=this.responseType&&(this._passthroughXHR.responseType=this.responseType),this._passthroughXHR.send(a);else{j(this),d(this,c.OPENED);var e=g(this,a),f=new Request(this._url,e),i=this;fetch(f).then(function(a){h(i,f,a)},function(a){b.error(a)}),this.dispatchEvent(new k("loadstart",!1,!1,this))}},c.prototype.abort=function(){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: abort() is not supported by the XHR Adapter")},c.prototype.getResponseHeader=function(a){if(b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getResponseHeader() for header: "+a),this._readyState<c.HEADERS_RECEIVED)return null;a=a.toLowerCase();for(var d in this._responseHeaders)if(d.toLowerCase()==a.toLowerCase())return this._responseHeaders[d];return null},c.prototype.getAllResponseHeaders=function(){function a(a){e+=a+": "+d._responseHeaders[a]+"\r\n"}b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getAllResponseHeaders()");var d=this;if(this._readyState<c.HEADERS_RECEIVED)return"";var e="";return this._responseHeaders&&Object.keys(this._responseHeaders).forEach(a),e},c.prototype.overrideMimeType=function(a){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: overrideMimeType() for mimeType: "+a),"string"==typeof a&&(this._forceMimeType=a.toLowerCase())},c.prototype.addEventListener=function(a,c){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: addEventListener() for event type: "+a),this._eventListeners[a]=this._eventListeners[a]||[],this._eventListeners[a].push(c)},c.prototype.removeEventListener=function(a,c){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: removeEventListener() for event type: "+a);var d,e=this._eventListeners[a]||[],f=e.length;for(d=0;d<f;d++)if(e[d]==c)return e.splice(d,1)},c.prototype.dispatchEvent=function(a){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: dispatchEvent() for event type: "+a.type);var c=this,d=a.type;switch((this._eventListeners[d]||[]).forEach(function(b){"function"==typeof b?b.call(c,a):b.handleEvent(a)}),d){case"abort":this.onabort&&this.onabort(a);break;case"error":this.onerror&&this.onerror(a);break;case"load":this.onload&&this.onload(a);break;case"loadend":this.onloadend&&this.onloadend(a);break;case"loadstart":this.onloadstart&&this.onloadstart(a);break;case"progress":this.onprogress&&this.onprogress(a);break;case"readystatechange":this.onreadystatechange&&this.onreadystatechange(a);break;case"timeout":this.ontimeout&&this.ontimeout(a)}return!!a.defaultPrevented},k.prototype.stopPropagation=function(){},k.prototype.preventDefault=function(){this.defaultPrevented=!0},c});
define(["../persistenceUtils","./logger"],function(a,b){"use strict";function c(a){var b=this;Object.defineProperty(this,"_eventListeners",{value:[],writable:!0}),Object.defineProperty(this,"_browserXMLHttpRequest",{value:a}),Object.defineProperty(this,"_method",{value:null,writable:!0}),Object.defineProperty(this,"onabort",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onerror",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onload",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadend",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onloadstart",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onprogress",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"onreadystatechange",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"ontimeout",{value:null,enumerable:!0,writable:!0}),Object.defineProperty(this,"_password",{value:null,writable:!0}),Object.defineProperty(this,"_readyState",{value:0,writable:!0}),Object.defineProperty(this,"readyState",{enumerable:!0,get:function(){return b._readyState}}),Object.defineProperty(this,"_requestHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_response",{value:"",writable:!0}),Object.defineProperty(this,"response",{enumerable:!0,get:function(){return b._response}}),Object.defineProperty(this,"_responseHeaders",{value:{},writable:!0}),Object.defineProperty(this,"_responseText",{value:"",writable:!0}),Object.defineProperty(this,"responseText",{enumerable:!0,get:function(){return b._responseText}}),Object.defineProperty(this,"responseType",{value:"",enumerable:!0,writable:!0}),Object.defineProperty(this,"_responseURL",{value:"",writable:!0}),Object.defineProperty(this,"responseURL",{enumerable:!0,get:function(){return b._responseURL}}),Object.defineProperty(this,"_responseXML",{value:null,writable:!0}),Object.defineProperty(this,"responseXML",{enumerable:!0,get:function(){return b._responseXML}}),Object.defineProperty(this,"_status",{value:0,writable:!0}),Object.defineProperty(this,"status",{enumerable:!0,get:function(){return b._status}}),Object.defineProperty(this,"_statusText",{value:"",writable:!0}),Object.defineProperty(this,"statusText",{enumerable:!0,get:function(){return b._statusText}}),Object.defineProperty(this,"timeout",{value:0,enumerable:!0}),Object.defineProperty(this,"upload",{value:null,enumerable:!0}),Object.defineProperty(this,"_url",{value:null,writable:!0}),Object.defineProperty(this,"_username",{value:null,writable:!0}),Object.defineProperty(this,"withCredentials",{value:!1,enumerable:!0,writable:!0})}function d(a,b){a._readyState=b,a.dispatchEvent(new k("readystatechange")),a._readyState==c.DONE&&(a.dispatchEvent(new k("load",!1,!1,a)),a.dispatchEvent(new k("loadend",!1,!1,a)))}function e(a){var b=a.toLowerCase();if(0===b.indexOf("http:")||0===b.indexOf("https:"))return!1;if(0===b.indexOf("file:")||0===b.indexOf("cdvfile:"))return!0;if(URL&&URL.prototype&&null!=(b=new URL(a,window.location.href).origin)&&"null"!=b&&b.length>0)return 0===b.toLowerCase().indexOf("file:");var c=document.createElement("a");return c.href=a,!(!(b=c.protocol)||0!==b.toLowerCase().indexOf("file:"))}function f(a){function b(b){c.append(b,a._requestHeaders[b])}var c=new Headers;return Object.keys(a._requestHeaders).forEach(b),c}function g(a,b){var c=f(a),d=a.withCredentials?"include":"same-origin",e={method:a._method,headers:c,mode:"cors",cache:"default",credentials:d};return"GET"!==a._method&&"HEAD"!==a._method&&"DELETE"!==a._method&&(e.body=b),e}function h(e,f,g){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Processing Response"),i(e,g.headers);var h=g.headers.get("Content-Type");e._status=g.status,e._statusText=g.statusText,e._responseURL=f.url;var j=a._derivePayloadType(e,g);if("blob"===j)b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.blob()"),g.blob().then(function(a){e._responseType="blob",e._response=a,d(e,c.DONE),"function"==typeof e.onload&&e.onload()},function(a){b.error(a)});else if("arraybuffer"===j)b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.arrayBuffer()"),g.arrayBuffer().then(function(a){e._responseType="arrayBuffer",e._response=a,d(e,c.DONE),"function"==typeof e.onload&&e.onload()},function(a){b.error("error reading response as arrayBuffer!")});else if("multipart"===j){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.formData()"),e._responseType="formData";var k=function(b){var f="";a.parseMultipartFormData(b,h).forEach(function(a){f+=a.data}),e._response=f,e._responseText=f,d(e,c.DONE),"function"==typeof e.onload&&e.onload()};if(g.formData)try{g.formData().then(function(a){var b,f,g="",h=a.values();do{f=h.next(),(b=f.value)&&(g+=b)}while(!f.done);e._response=g,e._responseText=g,d(e,c.DONE),"function"==typeof e.onload&&e.onload()})}catch(a){g.text().then(function(a){k(a)})}else g.text().then(function(a){k(a)})}else g.text().then(function(a){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: Calling response.text()"),e._responseType="",e._response=a,e._responseText=a,d(e,c.DONE),"function"==typeof e.onload&&e.onload()},function(a){b.error(a)})}function i(a,b){if(a._responseHeaders={},b.entries){var e,f,g,h=b.entries();do{e=h.next(),e.value&&(f=e.value[0],g=e.value[1],a._forceMimeType&&"content-type"==f.toLowerCase()?a._responseHeaders[f]=a._forceMimeType:a._responseHeaders[f]=g)}while(!e.done)}else b.forEach&&b.forEach(function(b,c){a._forceMimeType&&"content-type"==c.toLowerCase()?a._responseHeaders[c]=a._forceMimeType:a._responseHeaders[c]=b});d(a,c.HEADERS_RECEIVED)}function j(a){if(a._readyState!==c.OPENED)throw new Error("INVALID_STATE_ERR")}function k(a,b,c,d){Object.defineProperty(this,"type",{value:a,enumerable:!0}),Object.defineProperty(this,"bubbles",{value:b,enumerable:!0}),Object.defineProperty(this,"cancelable",{value:c,enumerable:!0}),Object.defineProperty(this,"target",{value:d,enumerable:!0})}return Object.defineProperty(c,"UNSENT",{value:0,enumerable:!0}),Object.defineProperty(c,"OPENED",{value:1,enumerable:!0}),Object.defineProperty(c,"HEADERS_RECEIVED",{value:2,enumerable:!0}),Object.defineProperty(c,"LOADING",{value:3,enumerable:!0}),Object.defineProperty(c,"DONE",{value:4,enumerable:!0}),c.prototype.open=function(a,f,g,h,i){if(b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open() for method: "+a+", url: "+f),"boolean"==typeof g&&!g)throw new Error("InvalidAccessError: Failed to execute 'open' on 'XMLHttpRequest': Synchronous requests are disabled on the XHR Adapter");if(this._method=a,this._url=f,e(f)){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: open called for a File url");var j=this;this._passthroughXHR=new j._browserXMLHttpRequest,this._passthroughXHR.onreadystatechange=function(){j._passthroughXHR.readyState==c.DONE&&(j._status=j._passthroughXHR.status,j._statusText=j._passthroughXHR.statusText,j._response=j._passthroughXHR.response,j._responseHeaders=j._passthroughXHR.responseHeaders,j._responseType=j._passthroughXHR.responseType,null!=j._responseType&&""!=j._responseType&&"text"!=j._responseType||(j._responseText=j._passthroughXHR.responseText),j._responseURL=j._passthroughXHR.responseURL,null!=j._responseType&&""!=j._responseType&&"document"!=j._responseType||(j._responseXML=j._passthroughXHR.responseXML)),d(j,j._passthroughXHR.readyState)},this._passthroughXHR.open(a,f,g,h,i)}else this._passthroughXHR=null;this._username=h,this._password=i,this._responseText=null,this._responseXML=null,this._requestHeaders={},d(this,c.OPENED)},c.prototype.setRequestHeader=function(a,c){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: setRequestHeader() with header: "+a+" ,value: "+c),j(this);var d=this._requestHeaders[a];this._requestHeaders[a]=d?d+=","+c:c},c.prototype.send=function(a){if(b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: send()"),this._passthroughXHR)null!=this.responseType&&(this._passthroughXHR.responseType=this.responseType),this._passthroughXHR.send(a);else{j(this),d(this,c.OPENED);var e=g(this,a),f=new Request(this._url,e),i=this;fetch(f).then(function(a){h(i,f,a)},function(a){b.error(a)}),this.dispatchEvent(new k("loadstart",!1,!1,this))}},c.prototype.abort=function(){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: abort() is not supported by the XHR Adapter")},c.prototype.getResponseHeader=function(a){if(b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getResponseHeader() for header: "+a),this._readyState<c.HEADERS_RECEIVED)return null;a=a.toLowerCase();for(var d in this._responseHeaders)if(d.toLowerCase()==a.toLowerCase())return this._responseHeaders[d];return null},c.prototype.getAllResponseHeaders=function(){function a(a){e+=a+": "+d._responseHeaders[a]+"\r\n"}b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: getAllResponseHeaders()");var d=this;if(this._readyState<c.HEADERS_RECEIVED)return"";var e="";return this._responseHeaders&&Object.keys(this._responseHeaders).forEach(a),e},c.prototype.overrideMimeType=function(a){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: overrideMimeType() for mimeType: "+a),"string"==typeof a&&(this._forceMimeType=a.toLowerCase())},c.prototype.addEventListener=function(a,c){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: addEventListener() for event type: "+a),this._eventListeners[a]=this._eventListeners[a]||[],this._eventListeners[a].push(c)},c.prototype.removeEventListener=function(a,c){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: removeEventListener() for event type: "+a);var d,e=this._eventListeners[a]||[],f=e.length;for(d=0;d<f;d++)if(e[d]==c)return e.splice(d,1)},c.prototype.dispatchEvent=function(a){b.log("Offline Persistence Toolkit PersistenceXMLHttpRequest: dispatchEvent() for event type: "+a.type);var c=this,d=a.type;switch((this._eventListeners[d]||[]).forEach(function(b){"function"==typeof b?b.call(c,a):b.handleEvent(a)}),d){case"abort":this.onabort&&this.onabort(a);break;case"error":this.onerror&&this.onerror(a);break;case"load":this.onload&&this.onload(a);break;case"loadend":this.onloadend&&this.onloadend(a);break;case"loadstart":this.onloadstart&&this.onloadstart(a);break;case"progress":this.onprogress&&this.onprogress(a);break;case"readystatechange":this.onreadystatechange&&this.onreadystatechange(a);break;case"timeout":this.ontimeout&&this.ontimeout(a)}return!!a.defaultPrevented},k.prototype.stopPropagation=function(){},k.prototype.preventDefault=function(){this.defaultPrevented=!0},c});

@@ -1,1 +0,1 @@

define(["./impl/logger"],function(a){"use strict";function b(a){return a.headers.has("x-oracle-jscpt-cache-expiration-date")}function c(a){return a.headers.has("x-oracle-jscpt-etag-generated")}function d(a,c){var d=c.headers.get("Content-Type"),f=a.responseType;return e(c.headers)?"text":b(c)||"blob"===f?"blob":-1!==d.indexOf("image/")||"arraybuffer"===f?"arraybuffer":-1!==d.indexOf("multipart/form-data")?"multipart":"text"}function e(a){var b=a.get("Content-Type");return!(!b||!b.match(/.*text\/.*/)&&!b.match(/.*application\/.*json.*/))}function f(a){var b=a.get("Content-Type");return b&&-1!==b.indexOf("multipart/")}function g(b,c){a.log("Offline Persistence Toolkit persistenceUtils: requestToJSON()"),c&&c._noClone||(b=b.clone());var d={};return h(b,d,["body","headers","signal"]),d.headers=j(b.headers),l(b,d)}function h(a,b,c){for(var d in a)"function"==typeof a[d]||i(d)||-1!==c.indexOf(d)||(b[d]=a[d])}function i(a){return 0===a.indexOf("_")}function j(a){var b={};if(a.entries){var c,d,e,f=a.entries();do{c=f.next(),c.value&&(d=c.value[0],e=c.value[1],b[d]=e)}while(!c.done)}else a.forEach&&a.forEach(function(a,c){b[c]=a});return k(b),b}function k(b){var c=b.date;c||(a.log("Offline Persistence Toolkit persistenceUtils: Setting HTTP date header since it's null or not exposed"),c=(new Date).toUTCString(),b.date=c)}function l(a,b){return b.body={},a instanceof Request&&f(a.headers)?m(a,b):a instanceof Request||e(a.headers)?a.text().then(function(a){return b.body.text=a,b}):a instanceof Request||"function"!=typeof a.arrayBuffer?Promise.reject(new Error({message:"payload body type is not supported"})):a.arrayBuffer().then(function(a){return a.byteLength>0&&(b.body.arrayBuffer=a),b})}function m(b,c){if(a.log("Offline Persistence Toolkit persistenceUtils: Copying multipart payload"),"function"==typeof b.formData)return b.formData().then(function(a){var b,d,e,f,g={},h=a.entries();do{b=h.next(),(d=b.value)&&(e=d[0],f=d[1],g[e]=f)}while(!b.done);return c.body.formData=g,c});var d=b.headers.get("Content-Type");return b.text().then(function(a){for(var b=v(a,d),e={},f=0;f<b.length;f++)e[b[f].headers.name]=b[f].data;return c.body.formData=e,c})}function n(b,c){a.log("Offline Persistence Toolkit persistenceUtils: responseToJSON()"),c&&c._noClone||(b=b.clone());var d={};return h(b,d,["body","headers"]),d.headers=j(b.headers),c&&c.excludeBody?Promise.resolve(d):l(b,d)}function o(b){a.log("Offline Persistence Toolkit persistenceUtils: requestFromJSON()");var c={};h(b,c,["headers","body","signal"]);var d=p(b,c);return c.headers=q(b,d),r(b,c)}function p(a,b){var c=!1,d=a.body;if(d.text&&d.text.length>0)b.body=d.text;else if(d.arrayBuffer)b.body=d.arrayBuffer;else if(d.formData){c=!0;var e=new FormData,f=d.formData;Object.keys(f).forEach(function(a){e.append(a,f[a])}),b.body=e}return c}function q(a,b){var c=new Headers;return Object.keys(a.headers).forEach(function(d){("content-type"!==d||!b&&"content-type"===d)&&c.append(d,a.headers[d])}),c}function r(a,b){return Promise.resolve(new Request(a.url,b))}function s(b){a.log("Offline Persistence Toolkit persistenceUtils: responseFromJSON()");var c={};return h(b,c,["headers","body"]),c.headers=q(b,!1),t(b,c)}function t(a,b){var c,d=a.body;return d&&d.text?c=new Response(d.text,b):d&&d.arrayBuffer?(b.responseType="blob",c=new Response(d.arrayBuffer,b)):d&&d.blob?(b.responseType="blob",c=new Response(d.blob,b)):c=new Response(null,b),Promise.resolve(c)}function u(b,c){return a.log("Offline Persistence Toolkit persistenceUtils: setResponsePayload()"),n(b).then(function(a){var b=a.body;return b.arrayBuffer=null,b.blob=null,b.text=null,c instanceof ArrayBuffer?b.arrayBuffer=c:c instanceof Blob?b.blob=c:b.text=JSON.stringify(c),s(a)})}function v(b,c){a.log("Offline Persistence Toolkit persistenceUtils: parseMultipartFormData()");var d=c.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!d)throw new Error("not a valid multipart form data value.");var e,f=function(a,b){var c=null;try{c=atob(a)}catch(a){return null}for(var d=new ArrayBuffer(c.length),e=new Uint8Array(d),f=0;f<c.length;f++)e[f]=c.charCodeAt(f);return new Blob([d],{type:b})},g=d[1]||d[2],h="string"==typeof b;if(h)e=b;else{var i=new Uint8Array(b);e=String.fromCharCode.apply(null,i)}for(var j=e.split(new RegExp(g)),k=[],l=1;l<j.length-1;l++){var m={},n=j[l],o=n.split("\r\n\r\n"),p=o[0],q=o[1],r=function(a){for(var b={},c={},d=a.split("\r\n"),e=0;e<d.length;e++){var f=d[e];if(0!==f.length){var g=f.split(";");if(1===g.length&&0===g[0].indexOf("Content-Type"))b.contentType=g[0].split(":")[1].trim();else for(var h=0;h<g.length;h++)if(-1!==g[h].indexOf("=")){var i=g[h].split("=");c[i[0].trim()]=i[1].substring(1,i[1].length-1)}}}return b.headers=c,b}(p);m.headers=r.headers,m.data=function(a,b){var c=a.split("\r\n");return b&&b.indexOf("image")>=0?f(c[0],b):c[0]}(q,r.contentType),k.push(m)}return k}function w(b){a.log("Offline Persistence Toolkit persistenceUtils: buildEndpointKey() for Request with url: "+b.url);var c={url:b.url,id:Math.random().toString(36).replace(/[^a-z]+/g,"")};return JSON.stringify(c)}function x(a){return g(a,{_noClone:!0}).then(function(a){return o(a).then(function(a){return a})})}function y(a,b){return b=b||{},n(a,{_noClone:!0}).then(function(a){return s(a).then(function(a){return null!=b.url&&b.url.length>0&&null==a.headers.get("x-oracle-jscpt-response-url")&&a.headers.set("x-oracle-jscpt-response-url",b.url),a})})}return{requestToJSON:g,requestFromJSON:o,responseToJSON:n,responseFromJSON:s,setResponsePayload:u,parseMultipartFormData:v,isCachedResponse:b,isGeneratedEtagResponse:c,_isTextPayload:e,buildEndpointKey:w,_cloneRequest:x,_cloneResponse:y,derivePayloadType:d}});
define(["./impl/logger"],function(a){"use strict";function b(a){return a.headers.has("x-oracle-jscpt-cache-expiration-date")}function c(a){return a.headers.has("x-oracle-jscpt-etag-generated")}function d(a,c){var d=c.headers.get("Content-Type"),f=a.responseType;return e(c.headers)?"text":b(c)||"blob"===f?"blob":d&&-1!==d.indexOf("image/")||"arraybuffer"===f?"arraybuffer":d&&-1!==d.indexOf("multipart/form-data")?"multipart":"text"}function e(a){var b=a.get("Content-Type");return!(!b||!b.match(/.*text\/.*/)&&!b.match(/.*application\/.*json.*/))}function f(a){var b=a.get("Content-Type");return b&&-1!==b.indexOf("multipart/")}function g(b,c){a.log("Offline Persistence Toolkit persistenceUtils: requestToJSON()"),c&&c._noClone||(b=b.clone());var d={};return h(b,d,["body","headers","signal"]),d.headers=j(b.headers),l(b,d)}function h(a,b,c){for(var d in a)"function"==typeof a[d]||i(d)||-1!==c.indexOf(d)||(b[d]=a[d])}function i(a){return 0===a.indexOf("_")}function j(a){var b={};if(a.entries){var c,d,e,f=a.entries();do{c=f.next(),c.value&&(d=c.value[0],e=c.value[1],b[d]=e)}while(!c.done)}else a.forEach&&a.forEach(function(a,c){b[c]=a});return k(b),b}function k(b){var c=b.date;c||(a.log("Offline Persistence Toolkit persistenceUtils: Setting HTTP date header since it's null or not exposed"),c=(new Date).toUTCString(),b.date=c)}function l(a,b){return b.body={},a instanceof Request&&f(a.headers)?m(a,b):a instanceof Request||e(a.headers)?a.text().then(function(a){return b.body.text=a,b}):a instanceof Request||"function"!=typeof a.arrayBuffer?Promise.reject(new Error({message:"payload body type is not supported"})):a.arrayBuffer().then(function(a){return a.byteLength>0&&(b.body.arrayBuffer=a),b})}function m(b,c){if(a.log("Offline Persistence Toolkit persistenceUtils: Copying multipart payload"),"function"==typeof b.formData)return b.formData().then(function(a){var b,d,e,f,g={},h=a.entries();do{b=h.next(),(d=b.value)&&(e=d[0],f=d[1],g[e]=f)}while(!b.done);return c.body.formData=g,c});var d=b.headers.get("Content-Type");return b.text().then(function(a){for(var b=v(a,d),e={},f=0;f<b.length;f++)e[b[f].headers.name]=b[f].data;return c.body.formData=e,c})}function n(b,c){a.log("Offline Persistence Toolkit persistenceUtils: responseToJSON()"),c&&c._noClone||(b=b.clone());var d={};return h(b,d,["body","headers"]),d.headers=j(b.headers),c&&c.excludeBody?Promise.resolve(d):l(b,d)}function o(b){a.log("Offline Persistence Toolkit persistenceUtils: requestFromJSON()");var c={};h(b,c,["headers","body","signal"]);var d=p(b,c);return c.headers=q(b,d),r(b,c)}function p(a,b){var c=!1,d=a.body;if(d.text&&d.text.length>0)b.body=d.text;else if(d.arrayBuffer)b.body=d.arrayBuffer;else if(d.formData){c=!0;var e=new FormData,f=d.formData;Object.keys(f).forEach(function(a){e.append(a,f[a])}),b.body=e}return c}function q(a,b){var c=new Headers;return Object.keys(a.headers).forEach(function(d){("content-type"!==d||!b&&"content-type"===d)&&c.append(d,a.headers[d])}),c}function r(a,b){return Promise.resolve(new Request(a.url,b))}function s(b){a.log("Offline Persistence Toolkit persistenceUtils: responseFromJSON()");var c={};return h(b,c,["headers","body"]),c.headers=q(b,!1),t(b,c)}function t(a,b){var c,d=a.body;return d&&d.text?c=new Response(d.text,b):d&&d.arrayBuffer?(b.responseType="blob",c=new Response(d.arrayBuffer,b)):d&&d.blob?(b.responseType="blob",c=new Response(d.blob,b)):c=new Response(null,b),Promise.resolve(c)}function u(b,c){return a.log("Offline Persistence Toolkit persistenceUtils: setResponsePayload()"),n(b).then(function(a){var b=a.body;return b.arrayBuffer=null,b.blob=null,b.text=null,c instanceof ArrayBuffer?b.arrayBuffer=c:c instanceof Blob?b.blob=c:b.text=JSON.stringify(c),s(a)})}function v(b,c){a.log("Offline Persistence Toolkit persistenceUtils: parseMultipartFormData()");var d=c.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!d)throw new Error("not a valid multipart form data value.");var e,f=function(a,b){var c=null;try{c=atob(a)}catch(a){return null}for(var d=new ArrayBuffer(c.length),e=new Uint8Array(d),f=0;f<c.length;f++)e[f]=c.charCodeAt(f);return new Blob([d],{type:b})},g=d[1]||d[2],h="string"==typeof b;if(h)e=b;else{var i=new Uint8Array(b);e=String.fromCharCode.apply(null,i)}for(var j=e.split(new RegExp(g)),k=[],l=1;l<j.length-1;l++){var m={},n=j[l],o=n.split("\r\n\r\n"),p=o[0],q=o[1],r=function(a){for(var b={},c={},d=a.split("\r\n"),e=0;e<d.length;e++){var f=d[e];if(0!==f.length){var g=f.split(";");if(1===g.length&&0===g[0].indexOf("Content-Type"))b.contentType=g[0].split(":")[1].trim();else for(var h=0;h<g.length;h++)if(-1!==g[h].indexOf("=")){var i=g[h].split("=");c[i[0].trim()]=i[1].substring(1,i[1].length-1)}}}return b.headers=c,b}(p);m.headers=r.headers,m.data=function(a,b){var c=a.split("\r\n");return b&&b.indexOf("image")>=0?f(c[0],b):c[0]}(q,r.contentType),k.push(m)}return k}function w(b){a.log("Offline Persistence Toolkit persistenceUtils: buildEndpointKey() for Request with url: "+b.url);var c={url:b.url,id:Math.random().toString(36).replace(/[^a-z]+/g,"")};return JSON.stringify(c)}function x(a){return g(a,{_noClone:!0}).then(function(a){return o(a).then(function(a){return a})})}function y(a,b){return b=b||{},n(a,{_noClone:!0}).then(function(a){return s(a).then(function(a){return null!=b.url&&b.url.length>0&&null==a.headers.get("x-oracle-jscpt-response-url")&&a.headers.set("x-oracle-jscpt-response-url",b.url),a})})}return{requestToJSON:g,requestFromJSON:o,responseToJSON:n,responseFromJSON:s,setResponsePayload:u,parseMultipartFormData:v,isCachedResponse:b,isGeneratedEtagResponse:c,_isTextPayload:e,buildEndpointKey:w,_cloneRequest:x,_cloneResponse:y,_derivePayloadType:d}});
{
"name": "@oracle/offline-persistence-toolkit",
"title": "Offline Persistence Toolkit",
"version": "1.2.7",
"version": "1.2.8",
"description": "Offline Persistence Toolkit by Oracle Corp.",

@@ -6,0 +6,0 @@ "author": "oraclejet",

@@ -1,2 +0,2 @@

# offline-persistence-toolkit 1.2.7 #
# offline-persistence-toolkit 1.2.8 #

@@ -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.2.7/min'
'persist' : 'js/libs/persist/v1.2.8/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.2.7/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.2.8/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.2.7/min'`.
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.2.8/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.2.7/min'
'persist' : 'js/libs/persist/v1.2.8/min'

@@ -99,0 +99,0 @@ // Other path mappings here

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc