Commit 0b4c0676 authored by Aurel's avatar Aurel

remove aurelstorage (useless) & commit dist

parent 9260a30f
......@@ -203,7 +203,6 @@ module.exports = function (grunt) {
'src/jio.storage/cryptstorage.js',
'src/jio.storage/websqlstorage.js',
'src/jio.storage/mappingstorage.js',
'src/jio.storage/aurelstorage.js'
],
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js'
// dest: 'jio.js'
......
......@@ -13535,6 +13535,12 @@ return new Parser;
if (storage._no_sub_query_id) {
throw new jIO.util.jIOError('no sub query id active', 404);
}
if (value === undefined) {
throw new jIO.util.jIOError(
'can not find document with ' + key + ' : undefined',
404
);
}
query = new SimpleQuery({
key: key,
value: value,
......@@ -13555,13 +13561,13 @@ return new Parser;
"limit": storage._query.limit
})
.push(function (data) {
if (data.data.rows.length === 0) {
if (data.data.total_rows === 0) {
throw new jIO.util.jIOError(
"Can not find id",
"Can not find document with (" + key + ", " + value + ")",
404
);
}
if (data.data.rows.length > 1) {
if (data.data.total_rows > 1) {
throw new TypeError("id must be unique field: " + key
+ ", result:" + data.data.rows.toString());
}
......@@ -13588,9 +13594,6 @@ return new Parser;
doc.hasOwnProperty(storage._property_for_sub_id)) {
return doc[storage._property_for_sub_id];
}
if (doc.hasOwnProperty(args)) {
return doc[args];
}
}
return getSubIdEqualSubProperty(storage, id, storage._map_id[1]);
},
......@@ -13867,7 +13870,7 @@ return new Parser;
if (this._property_for_sub_id && id !== undefined) {
return this._sub_storage.put(id, sub_doc);
}
if (!this._id_mapped || doc[this._id_mapped] !== undefined) {
if (this._id_mapped && doc[this._id_mapped] !== undefined) {
return getSubStorageId(storage, id, doc)
.push(function (sub_id) {
return storage._sub_storage.put(sub_id, sub_doc);
......@@ -14115,58 +14118,4 @@ return new Parser;
};
jIO.addStorage('mapping', MappingStorage);
}(jIO, RSVP, UriTemplate, SimpleQuery, ComplexQuery, QueryFactory, Query));;/*jslint nomen: true*/
(function (jIO) {
"use strict";
/**
* The jIO AurelStorage extension
*
* @class AurelStorage
* @constructor
*/
function AurelStorage(spec) {
this._sub_storage = jIO.createJIO(spec.sub_storage);
this._index = spec.index;
}
AurelStorage.prototype.get = function () {
return this._sub_storage.get.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.allAttachments = function () {
return this._sub_storage.allAttachments.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.post = function (param) {
var id = param[this._index];
return this.put(id, param);
};
AurelStorage.prototype.put = function () {
return this._sub_storage.put.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.remove = function () {
return this._sub_storage.remove.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.getAttachment = function () {
return this._sub_storage.getAttachment.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.putAttachment = function () {
return this._sub_storage.putAttachment.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.removeAttachment = function () {
return this._sub_storage.removeAttachment.apply(this._sub_storage,
arguments);
};
AurelStorage.prototype.repair = function () {
return this._sub_storage.repair.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.hasCapacity = function (name) {
return this._sub_storage.hasCapacity(name);
};
AurelStorage.prototype.buildQuery = function () {
return this._sub_storage.buildQuery.apply(this._sub_storage,
arguments);
};
jIO.addStorage('aurel', AurelStorage);
}(jIO));
}(jIO, RSVP, UriTemplate, SimpleQuery, ComplexQuery, QueryFactory, Query));
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13535,6 +13535,12 @@ return new Parser;
if (storage._no_sub_query_id) {
throw new jIO.util.jIOError('no sub query id active', 404);
}
if (value === undefined) {
throw new jIO.util.jIOError(
'can not find document with ' + key + ' : undefined',
404
);
}
query = new SimpleQuery({
key: key,
value: value,
......@@ -13555,13 +13561,13 @@ return new Parser;
"limit": storage._query.limit
})
.push(function (data) {
if (data.data.rows.length === 0) {
if (data.data.total_rows === 0) {
throw new jIO.util.jIOError(
"Can not find id",
"Can not find document with (" + key + ", " + value + ")",
404
);
}
if (data.data.rows.length > 1) {
if (data.data.total_rows > 1) {
throw new TypeError("id must be unique field: " + key
+ ", result:" + data.data.rows.toString());
}
......@@ -13588,9 +13594,6 @@ return new Parser;
doc.hasOwnProperty(storage._property_for_sub_id)) {
return doc[storage._property_for_sub_id];
}
if (doc.hasOwnProperty(args)) {
return doc[args];
}
}
return getSubIdEqualSubProperty(storage, id, storage._map_id[1]);
},
......@@ -13867,7 +13870,7 @@ return new Parser;
if (this._property_for_sub_id && id !== undefined) {
return this._sub_storage.put(id, sub_doc);
}
if (!this._id_mapped || doc[this._id_mapped] !== undefined) {
if (this._id_mapped && doc[this._id_mapped] !== undefined) {
return getSubStorageId(storage, id, doc)
.push(function (sub_id) {
return storage._sub_storage.put(sub_id, sub_doc);
......@@ -14115,58 +14118,4 @@ return new Parser;
};
jIO.addStorage('mapping', MappingStorage);
}(jIO, RSVP, UriTemplate, SimpleQuery, ComplexQuery, QueryFactory, Query));;/*jslint nomen: true*/
(function (jIO) {
"use strict";
/**
* The jIO AurelStorage extension
*
* @class AurelStorage
* @constructor
*/
function AurelStorage(spec) {
this._sub_storage = jIO.createJIO(spec.sub_storage);
this._index = spec.index;
}
AurelStorage.prototype.get = function () {
return this._sub_storage.get.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.allAttachments = function () {
return this._sub_storage.allAttachments.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.post = function (param) {
var id = param[this._index];
return this.put(id, param);
};
AurelStorage.prototype.put = function () {
return this._sub_storage.put.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.remove = function () {
return this._sub_storage.remove.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.getAttachment = function () {
return this._sub_storage.getAttachment.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.putAttachment = function () {
return this._sub_storage.putAttachment.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.removeAttachment = function () {
return this._sub_storage.removeAttachment.apply(this._sub_storage,
arguments);
};
AurelStorage.prototype.repair = function () {
return this._sub_storage.repair.apply(this._sub_storage, arguments);
};
AurelStorage.prototype.hasCapacity = function (name) {
return this._sub_storage.hasCapacity(name);
};
AurelStorage.prototype.buildQuery = function () {
return this._sub_storage.buildQuery.apply(this._sub_storage,
arguments);
};
jIO.addStorage('aurel', AurelStorage);
}(jIO));
}(jIO, RSVP, UriTemplate, SimpleQuery, ComplexQuery, QueryFactory, Query));
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5097,6 +5097,12 @@ return new Parser;
if (storage._no_sub_query_id) {
throw new jIO.util.jIOError('no sub query id active', 404);
}
if (value === undefined) {
throw new jIO.util.jIOError(
'can not find document with ' + key + ' : undefined',
404
);
}
query = new SimpleQuery({
key: key,
value: value,
......@@ -5117,13 +5123,13 @@ return new Parser;
"limit": storage._query.limit
})
.push(function (data) {
if (data.data.rows.length === 0) {
if (data.data.total_rows === 0) {
throw new jIO.util.jIOError(
"Can not find id",
"Can not find document with (" + key + ", " + value + ")",
404
);
}
if (data.data.rows.length > 1) {
if (data.data.total_rows > 1) {
throw new TypeError("id must be unique field: " + key
+ ", result:" + data.data.rows.toString());
}
......@@ -5150,9 +5156,6 @@ return new Parser;
doc.hasOwnProperty(storage._property_for_sub_id)) {
return doc[storage._property_for_sub_id];
}
if (doc.hasOwnProperty(args)) {
return doc[args];
}
}
return getSubIdEqualSubProperty(storage, id, storage._map_id[1]);
},
......@@ -5429,7 +5432,7 @@ return new Parser;
if (this._property_for_sub_id && id !== undefined) {
return this._sub_storage.put(id, sub_doc);
}
if (!this._id_mapped || doc[this._id_mapped] !== undefined) {
if (this._id_mapped && doc[this._id_mapped] !== undefined) {
return getSubStorageId(storage, id, doc)
.push(function (sub_id) {
return storage._sub_storage.put(sub_id, sub_doc);
......
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