diff --git a/dist/module-debug/db/interface.js b/dist/module-debug/db/interface.js new file mode 100644 index 0000000..486d2bd --- /dev/null +++ b/dist/module-debug/db/interface.js @@ -0,0 +1,47 @@ +/** + * @interface + */ +export default function StorageInterface() {} + +// Mandatory Initializer +// ------------------------------ + +// assign store to an index +StorageInterface.prototype.mount = async function () {}; +// open connection +StorageInterface.prototype.open = async function () {}; +// close connection +StorageInterface.prototype.close = function () {}; +// drop the database (drop tables) +StorageInterface.prototype.destroy = async function () {}; + +// Mandatory Query Tasks +// ------------------------------ + +// transfer all changes of an index to the database +StorageInterface.prototype.commit = async function () {}; +// get results of a term "key" with optional context "ctx" +StorageInterface.prototype.get = async function () {}; +// get documents stored in index (enrich result) +StorageInterface.prototype.enrich = async function () {}; +// check if id exists on a specific index +StorageInterface.prototype.has = async function () {}; +// delete one id or multiple ids on a specific index +StorageInterface.prototype.remove = async function () {}; +// clear all data (truncate) +StorageInterface.prototype.clear = async function () {}; + +// Optional Methods +// ------------------------------ + +/** + * Perform the query intersection on database side + * @type {Function|null} + */ +StorageInterface.prototype.search = async function () {}; + +/** + * Give some information about the storage + * @type {Function|null} + */ +StorageInterface.prototype.info = async function () {}; \ No newline at end of file diff --git a/dist/module-min/db/interface.js b/dist/module-min/db/interface.js new file mode 100644 index 0000000..0d3fbd2 --- /dev/null +++ b/dist/module-min/db/interface.js @@ -0,0 +1 @@ +export default function StorageInterface(){}StorageInterface.prototype.mount=async function(){},StorageInterface.prototype.open=async function(){},StorageInterface.prototype.close=function(){},StorageInterface.prototype.destroy=async function(){},StorageInterface.prototype.commit=async function(){},StorageInterface.prototype.get=async function(){},StorageInterface.prototype.enrich=async function(){},StorageInterface.prototype.has=async function(){},StorageInterface.prototype.remove=async function(){},StorageInterface.prototype.clear=async function(){},StorageInterface.prototype.search=async function(){},StorageInterface.prototype.info=async function(){}; \ No newline at end of file diff --git a/dist/module/db/interface.js b/dist/module/db/interface.js new file mode 100644 index 0000000..486d2bd --- /dev/null +++ b/dist/module/db/interface.js @@ -0,0 +1,47 @@ +/** + * @interface + */ +export default function StorageInterface() {} + +// Mandatory Initializer +// ------------------------------ + +// assign store to an index +StorageInterface.prototype.mount = async function () {}; +// open connection +StorageInterface.prototype.open = async function () {}; +// close connection +StorageInterface.prototype.close = function () {}; +// drop the database (drop tables) +StorageInterface.prototype.destroy = async function () {}; + +// Mandatory Query Tasks +// ------------------------------ + +// transfer all changes of an index to the database +StorageInterface.prototype.commit = async function () {}; +// get results of a term "key" with optional context "ctx" +StorageInterface.prototype.get = async function () {}; +// get documents stored in index (enrich result) +StorageInterface.prototype.enrich = async function () {}; +// check if id exists on a specific index +StorageInterface.prototype.has = async function () {}; +// delete one id or multiple ids on a specific index +StorageInterface.prototype.remove = async function () {}; +// clear all data (truncate) +StorageInterface.prototype.clear = async function () {}; + +// Optional Methods +// ------------------------------ + +/** + * Perform the query intersection on database side + * @type {Function|null} + */ +StorageInterface.prototype.search = async function () {}; + +/** + * Give some information about the storage + * @type {Function|null} + */ +StorageInterface.prototype.info = async function () {}; \ No newline at end of file diff --git a/task/babel.js b/task/babel.js index f8b2df4..85cc128 100644 --- a/task/babel.js +++ b/task/babel.js @@ -50,6 +50,7 @@ fs.existsSync("dist") || fs.mkdirSync("dist"); }); }); + fs.copyFileSync("src/db/interface.js", "tmp/db/interface.js"); fs.copyFileSync("task/babel." + (debug ? "debug": (minify ? "min" : "bundle")) + ".json", "tmp/.babelrc"); fs.rmSync("dist/module" + (debug ? "-debug" : (minify ? "-min" : "")), { recursive: true }); fs.mkdirSync("dist/module" + (debug ? "-debug" : (minify ? "-min" : "")));