Skip to content

Commit 62b4f4f

Browse files
Updated to v1.2.2 and fixed bugs in pouchDB store
1 parent d32724c commit 62b4f4f

12 files changed

+97
-71
lines changed

Gruntfile.js

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ module.exports = function (grunt) {
8282
{
8383
name: 'persist/defaultResponseProxy',
8484
include: ['persist/simpleJsonShredding', 'persist/oracleRestJsonShredding', 'persist/simpleBinaryDataShredding', 'persist/queryHandlers'],
85-
excludeShallow: ['persist/persistenceUtils',
86-
'persist/impl/logger',
87-
'persist/impl/PersistenceXMLHttpRequest',
85+
excludeShallow: ['persist/persistenceUtils',
86+
'persist/impl/logger',
87+
'persist/impl/PersistenceXMLHttpRequest',
8888
'persist/persistenceStoreManager',
8989
'persist/impl/defaultCacheHandler',
9090
'persist/impl/PersistenceSyncManager',
@@ -129,9 +129,9 @@ module.exports = function (grunt) {
129129
{
130130
name: 'persist/defaultResponseProxy',
131131
include: ['persist/simpleJsonShredding', 'persist/oracleRestJsonShredding', 'persist/simpleBinaryDataShredding', 'persist/queryHandlers'],
132-
excludeShallow: ['persist/persistenceUtils',
133-
'persist/impl/logger',
134-
'persist/impl/PersistenceXMLHttpRequest',
132+
excludeShallow: ['persist/persistenceUtils',
133+
'persist/impl/logger',
134+
'persist/impl/PersistenceXMLHttpRequest',
135135
'persist/persistenceStoreManager',
136136
'persist/impl/defaultCacheHandler',
137137
'persist/impl/PersistenceSyncManager',
@@ -150,51 +150,55 @@ module.exports = function (grunt) {
150150
main: {
151151
files: [
152152
{
153-
src: '<%= paths.dist_bundles %>/persist/persistenceManager.js',
153+
src: '<%= paths.dist_bundles %>/persist/persistenceManager.js',
154154
dest: '<%= paths.dist_bundles %>/persist/offline-persistence-toolkit-core-<%= pkg.version %>.js'
155155
},
156156
{
157-
src: '<%= paths.dist_bundles %>/persist/arrayPersistenceStoreFactory.js',
157+
src: '<%= paths.dist_bundles %>/persist/arrayPersistenceStoreFactory.js',
158158
dest: '<%= paths.dist_bundles %>/persist/offline-persistence-toolkit-arraystore-<%= pkg.version %>.js'
159159
},
160160
{
161-
src: '<%= paths.dist_bundles %>/persist/localPersistenceStoreFactory.js',
161+
src: '<%= paths.dist_bundles %>/persist/localPersistenceStoreFactory.js',
162162
dest: '<%= paths.dist_bundles %>/persist/offline-persistence-toolkit-localstore-<%= pkg.version %>.js'
163163
},
164164
{
165-
src: '<%= paths.dist_bundles %>/persist/pouchDBPersistenceStoreFactory.js',
165+
src: '<%= paths.dist_bundles %>/persist/pouchDBPersistenceStoreFactory.js',
166166
dest: '<%= paths.dist_bundles %>/persist/offline-persistence-toolkit-pouchdbstore-<%= pkg.version %>.js'
167167
},
168168
{
169-
src: '<%= paths.dist_bundles %>/persist/fileSystemPersistenceStoreFactory.js',
169+
src: '<%= paths.dist_bundles %>/persist/fileSystemPersistenceStoreFactory.js',
170170
dest: '<%= paths.dist_bundles %>/persist/offline-persistence-toolkit-filesystemstore-<%= pkg.version %>.js'
171171
},
172172
{
173-
src: '<%= paths.dist_bundles %>/persist/defaultResponseProxy.js',
173+
src: '<%= paths.dist_bundles %>/persist/defaultResponseProxy.js',
174174
dest: '<%= paths.dist_bundles %>/persist/offline-persistence-toolkit-responseproxy-<%= pkg.version %>.js'
175175
},
176176
{
177-
src: '<%= paths.dist_bundles_debug %>/persist/persistenceManager.js',
177+
src: '<%= paths.dist_bundles_debug %>/persist/persistenceManager.js',
178178
dest: '<%= paths.dist_bundles_debug %>/persist/offline-persistence-toolkit-core-<%= pkg.version %>.js'
179179
},
180180
{
181-
src: '<%= paths.dist_bundles_debug %>/persist/localPersistenceStoreFactory.js',
181+
src: '<%= paths.dist_bundles_debug %>/persist/arrayPersistenceStoreFactory.js',
182+
dest: '<%= paths.dist_bundles_debug %>/persist/offline-persistence-toolkit-arraystore-<%= pkg.version %>.js'
183+
},
184+
{
185+
src: '<%= paths.dist_bundles_debug %>/persist/localPersistenceStoreFactory.js',
182186
dest: '<%= paths.dist_bundles_debug %>/persist/offline-persistence-toolkit-localstore-<%= pkg.version %>.js'
183187
},
184188
{
185-
src: '<%= paths.dist_bundles_debug %>/persist/pouchDBPersistenceStoreFactory.js',
189+
src: '<%= paths.dist_bundles_debug %>/persist/pouchDBPersistenceStoreFactory.js',
186190
dest: '<%= paths.dist_bundles_debug %>/persist/offline-persistence-toolkit-pouchdbstore-<%= pkg.version %>.js'
187191
},
188192
{
189-
src: '<%= paths.dist_bundles_debug %>/persist/fileSystemPersistenceStoreFactory.js',
193+
src: '<%= paths.dist_bundles_debug %>/persist/fileSystemPersistenceStoreFactory.js',
190194
dest: '<%= paths.dist_bundles_debug %>/persist/offline-persistence-toolkit-filesystemstore-<%= pkg.version %>.js'
191195
},
192196
{
193-
src: '<%= paths.dist_bundles_debug %>/persist/defaultResponseProxy.js',
197+
src: '<%= paths.dist_bundles_debug %>/persist/defaultResponseProxy.js',
194198
dest: '<%= paths.dist_bundles_debug %>/persist/offline-persistence-toolkit-responseproxy-<%= pkg.version %>.js'
195199
},
196200
{
197-
src: 'coverage/dist/debug/require-config-coverage.js',
201+
src: 'coverage/dist/debug/require-config-coverage.js',
198202
dest: 'coverage/dist/debug/bundles-config.js'
199203
}
200204
]

JSDOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.2.1 #
1+
# offline-persistence-toolkit 1.2.2 #
22

33
## Introduction ##
44

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.2.1 #
1+
# offline-persistence-toolkit 1.2.2 #
22

33
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.
44

@@ -58,16 +58,16 @@ If your app uses [RequireJS](http://www.requirejs.org/ "RequireJS"), update the
5858
```javascript
5959
requirejs.config({
6060
paths: {
61-
'persist' : 'js/libs/persist/v1.2.1/min'
61+
'persist' : 'js/libs/persist/v1.2.2/min'
6262

6363
// Other path mappings here
6464
}
6565
```
66-
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.2.1/min'` entry to the list of paths.
66+
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.2.2/min'` entry to the list of paths.
6767
6868
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.
6969
70-
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.2.1/min'`.
70+
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.2.2/min'`.
7171
7272
Versions of the toolkit are also available on CDN under the latest JET release. e.g.
7373
@@ -91,7 +91,7 @@ And again, if you are using RequireJS, you will need to map paths for these pack
9191
paths: {
9292
'pouchdb': 'js/libs/pouchdb-6.3.4',
9393
'pouchfind': 'js/libs/pouchdb.find',
94-
'persist' : 'js/libs/persist/v1.2.1/min'
94+
'persist' : 'js/libs/persist/v1.2.2/min'
9595

9696
// Other path mappings here
9797
}

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.2.1 #
1+
# offline-persistence-toolkit 1.2.2 #
22

33
# Introduction #
44

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h3> </h3>
4343

4444

4545
<section>
46-
<article><h1>offline-persistence-toolkit 1.2.1</h1><h2>Introduction</h2><p>This document provides a reference to the offline-persistence-toolkit's JavaScript API. Links to JSDoc for each class can be found to the right.</p>
46+
<article><h1>offline-persistence-toolkit 1.2.2</h1><h2>Introduction</h2><p>This document provides a reference to the offline-persistence-toolkit's JavaScript API. Links to JSDoc for each class can be found to the right.</p>
4747
<p>The toolkit's <a href="https://github.com/oracle/offline-persistence-toolkit/" title="README">README</a> file provides an overview of the toolkit’s capabilities. Having read that document, you can find more information about how to implement a range of common and advanced use cases with the toolkit in the
4848
<a href="https://github.com/oracle/offline-persistence-toolkit/blob/master/USAGE.md" title="Usage guide">Usage guide</a>.</p>
4949
<h2>License</h2><p>Copyright (c) 2017 Oracle and/or its affiliates The Universal Permissive License (UPL), Version 1.0.</p></article>

docs/persistenceUtils.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Parameters:</h5>
238238

239239
<dt class="tag-source">Source:</dt>
240240
<dd class="tag-source"><ul class="dummy"><li>
241-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line463">line 463</a>
241+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line465">line 465</a>
242242
</li></ul></dd>
243243

244244

@@ -732,7 +732,7 @@ <h5>Parameters:</h5>
732732

733733
<dt class="tag-source">Source:</dt>
734734
<dd class="tag-source"><ul class="dummy"><li>
735-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line362">line 362</a>
735+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line364">line 364</a>
736736
</li></ul></dd>
737737

738738

@@ -889,7 +889,7 @@ <h5>Parameters:</h5>
889889

890890
<dt class="tag-source">Source:</dt>
891891
<dd class="tag-source"><ul class="dummy"><li>
892-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line236">line 236</a>
892+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line238">line 238</a>
893893
</li></ul></dd>
894894

895895

@@ -1046,7 +1046,7 @@ <h5>Parameters:</h5>
10461046

10471047
<dt class="tag-source">Source:</dt>
10481048
<dd class="tag-source"><ul class="dummy"><li>
1049-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line63">line 63</a>
1049+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line65">line 65</a>
10501050
</li></ul></dd>
10511051

10521052

@@ -1203,7 +1203,7 @@ <h5>Parameters:</h5>
12031203

12041204
<dt class="tag-source">Source:</dt>
12051205
<dd class="tag-source"><ul class="dummy"><li>
1206-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line293">line 293</a>
1206+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line295">line 295</a>
12071207
</li></ul></dd>
12081208

12091209

@@ -1403,7 +1403,7 @@ <h5>Parameters:</h5>
14031403

14041404
<dt class="tag-source">Source:</dt>
14051405
<dd class="tag-source"><ul class="dummy"><li>
1406-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line207">line 207</a>
1406+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line209">line 209</a>
14071407
</li></ul></dd>
14081408

14091409

@@ -1583,7 +1583,7 @@ <h5>Parameters:</h5>
15831583

15841584
<dt class="tag-source">Source:</dt>
15851585
<dd class="tag-source"><ul class="dummy"><li>
1586-
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line331">line 331</a>
1586+
<a href="persistenceUtils.js.html">persistenceUtils.js</a>, <a href="persistenceUtils.js.html#line333">line 333</a>
15871587
</li></ul></dd>
15881588

15891589

docs/persistenceUtils.js.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ <h1 class="page-title">Source: persistenceUtils.js</h1>
7272

7373
var contentType = headers.get('Content-Type');
7474

75+
// the response is considered text type when contentType value is of
76+
// pattern text/ or application/*json .
7577
if (contentType &amp;&amp;
76-
(contentType.indexOf('text/') !== -1 ||
77-
contentType.indexOf('application/json') !== -1)) {
78+
(contentType.match(/.*text\/.*/) ||
79+
contentType.match(/.*application\/.*json.*/))) {
7880
return true;
7981
}
8082
return false;
@@ -294,7 +296,7 @@ <h1 class="page-title">Source: persistenceUtils.js</h1>
294296
var formData = new FormData();
295297
var formPairs = body.formData;
296298
Object.keys(formPairs).forEach(function (pairkey) {
297-
formData.append(pairkey, formPairs[pairkey]);
299+
formData.append(pairkey, formPairs[pairkey]); // @XSSFalsePositive
298300
});
299301
targetObj.body = formData;
300302
}
@@ -307,7 +309,7 @@ <h1 class="page-title">Source: persistenceUtils.js</h1>
307309
Object.keys(data.headers).forEach(function (key) {
308310
if (key !== 'content-type' ||
309311
(!skipContentType &amp;&amp; key === 'content-type')) {
310-
headers.append(key, data.headers[key]);
312+
headers.append(key, data.headers[key]); // @XSSFalsePositive
311313
}
312314
});
313315

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@oracle/offline-persistence-toolkit",
33
"title": "Offline Persistence Toolkit",
4-
"version": "1.2.1",
4+
"version": "1.2.2",
55
"description": "Offline Persistence Toolkit by Oracle Corp.",
66
"author": "oraclejet",
77
"license": "UPL-1.0",

src/impl/PersistenceXMLHttpRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ define(['../persistenceUtils', './logger'], function (persistenceUtils, logger)
477477
function _getRequestHeaders(self) {
478478
var requestHeaders = new Headers();
479479
function appendRequestHeader(requestHeader) {
480-
requestHeaders.append(requestHeader, self._requestHeaders[requestHeader]);
480+
requestHeaders.append(requestHeader, self._requestHeaders[requestHeader]); // @XSSFalsePositive
481481
}
482482
Object.keys(self._requestHeaders).forEach(appendRequestHeader);
483483

src/impl/fetch.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@
105105

106106
if (headers instanceof Headers) {
107107
headers.forEach(function(value, name) {
108-
this.append(name, value)
108+
this.append(name, value) // @XSSFalsePositive
109109
}, this)
110110
} else if (Array.isArray(headers)) {
111111
headers.forEach(function(header) {
112-
this.append(header[0], header[1])
112+
this.append(header[0], header[1]) // @XSSFalsePositive
113113
}, this)
114114
} else if (headers) {
115115
Object.getOwnPropertyNames(headers).forEach(function(name) {
116-
this.append(name, headers[name])
116+
this.append(name, headers[name]) // @XSSFalsePositive
117117
}, this)
118118
}
119119
}
@@ -377,7 +377,7 @@
377377
var split = bytes.split('=')
378378
var name = split.shift().replace(/\+/g, ' ')
379379
var value = split.join('=').replace(/\+/g, ' ')
380-
form.append(decodeURIComponent(name), decodeURIComponent(value))
380+
form.append(decodeURIComponent(name), decodeURIComponent(value)) // @XSSFalsePositive
381381
}
382382
})
383383
return form
@@ -393,7 +393,7 @@
393393
var key = parts.shift().trim()
394394
if (key) {
395395
var value = parts.join(':').trim()
396-
headers.append(key, value)
396+
headers.append(key, value) // @XSSFalsePositive
397397
}
398398
})
399399
return headers

0 commit comments

Comments
 (0)