Commit 1dfdec6a authored by Vincent Bechu's avatar Vincent Bechu

Release Version 3.21.0

querystorage: add full text search
cryptostorage: fix confusing exemple
parent 3fec6581
...@@ -5716,7 +5716,7 @@ case 5: case 8: case 11: case 14: case 16: ...@@ -5716,7 +5716,7 @@ case 5: case 8: case 11: case 14: case 16:
this.$ = $$[$0]; this.$ = $$[$0];
break; break;
case 6: case 6:
this.$ = mkComplexQuery('OR', [$$[$0-1], $$[$0]]); this.$ = mkComplexQuery('AND', [$$[$0-1], $$[$0]]);
break; break;
case 7: case 7:
this.$ = mkComplexQuery('OR', [$$[$0-2], $$[$0]]); this.$ = mkComplexQuery('OR', [$$[$0-2], $$[$0]]);
...@@ -6985,7 +6985,8 @@ return new Parser; ...@@ -6985,7 +6985,8 @@ return new Parser;
matchMethod = null, matchMethod = null,
operator = this.operator, operator = this.operator,
value = null, value = null,
key = this.key; key = this.key,
k;
if (!(regexp_comparaison.test(operator))) { if (!(regexp_comparaison.test(operator))) {
// `operator` is not correct, we have to change it to "like" or "=" // `operator` is not correct, we have to change it to "like" or "="
...@@ -7004,6 +7005,22 @@ return new Parser; ...@@ -7004,6 +7005,22 @@ return new Parser;
key = this._key_schema.key_set[key]; key = this._key_schema.key_set[key];
} }
// match with all the fields if key is empty
if (key === '') {
matchMethod = this.like;
value = '%' + this.value + '%';
for (k in item) {
if (item.hasOwnProperty(k)) {
if (k !== '__id') {
if (matchMethod(item[k], value) === true) {
return true;
}
}
}
}
return false;
}
if (typeof key === 'object') { if (typeof key === 'object') {
checkKey(key); checkKey(key);
object_value = item[key.read_from]; object_value = item[key.read_from];
...@@ -13227,24 +13244,29 @@ return new Parser; ...@@ -13227,24 +13244,29 @@ return new Parser;
(function (jIO, RSVP, DOMException, Blob, crypto, Uint8Array, ArrayBuffer) { (function (jIO, RSVP, DOMException, Blob, crypto, Uint8Array, ArrayBuffer) {
"use strict"; "use strict";
/*
The cryptography system used by this storage is AES-GCM.
Here is an example of how to generate a key to the json format:
// you the cryptography system used by this storage is AES-GCM. return new RSVP.Queue()
// here is an example of how to generate a key to the json format. .push(function () {
return crypto.subtle.generateKey({name: "AES-GCM", length: 256},
// var key, true, ["encrypt", "decrypt"]);
// jsonKey; })
// crypto.subtle.generateKey({name: "AES-GCM",length: 256}, .push(function (key) {
// (true), ["encrypt", "decrypt"]) return crypto.subtle.exportKey("jwk", key);
// .then(function(res){key = res;}); })
// .push(function (json_key) {
// window.crypto.subtle.exportKey("jwk", key) var jio = jIO.createJIO({
// .then(function(res){jsonKey = val}) type: "crypt",
// key: json_key,
//var storage = jIO.createJIO({type: "crypt", key: jsonKey, sub_storage: {storage_definition}
// sub_storage: {...}}); });
});
// find more informations about this cryptography system on Find more informations about this cryptography system on
// https://github.com/diafygi/webcrypto-examples#aes-gcm https://github.com/diafygi/webcrypto-examples#aes-gcm
*/
/** /**
* The JIO Cryptography Storage extension * The JIO Cryptography Storage extension
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"name": "jio", "name": "jio",
"version": "v3.20.0", "version": "v3.21.0",
"license": "LGPLv3", "license": "LGPLv3",
"author": "Nexedi SA", "author": "Nexedi SA",
"contributors": [ "contributors": [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment