diff --git a/application/source/data/datasource.mjs b/application/source/data/datasource.mjs index 655e191c30360a54df0410f16c1f47af56f2215e..3c8f43b0aad74cc044f1e9b7524861eaab99c703 100644 --- a/application/source/data/datasource.mjs +++ b/application/source/data/datasource.mjs @@ -17,6 +17,18 @@ import {Pathfinder} from "./pathfinder.mjs"; export {Datasource} + +/** + * This callback can be passed to a datasource and is used to adapt data structures. + * + * @callback Monster.Data.Datasource~exampleCallback + * @param {*} value Value + * @param {string} key Key + * @memberOf Monster.Data + * @see Monster.Data.Datasource + */ + + /** * @private * @type {symbol} diff --git a/application/source/data/datasource/restapi.mjs b/application/source/data/datasource/restapi.mjs index b806548580c951565e0ce3629c4c82dbe9331e1b..4df020ce2058835a5c2ecd8b7d1be3823b80626d 100644 --- a/application/source/data/datasource/restapi.mjs +++ b/application/source/data/datasource/restapi.mjs @@ -22,7 +22,7 @@ export {RestAPI} * @since 1.22.0 * @copyright schukai GmbH * @memberOf Monster.Data.Datasource - * @summary The LocalStorage class encapsulates the access to data objects. + * @summary The RestAPI is a class that binds a REST API server. */ class RestAPI extends Datasource { @@ -30,7 +30,6 @@ class RestAPI extends Datasource { * * @param {Object} [readDefinition] An options object containing any custom settings that you want to apply to the read request. * @param {Object} [writeDefinition] An options object containing any custom settings that you want to apply to the write request. - * @throws {TypeError} value is not a string */ constructor(readDefinition, writeDefinition) { super(); @@ -54,17 +53,21 @@ class RestAPI extends Datasource { } /** - * @property {string} url=undefined Defines the resource that you wish to fetch. * @property {Object} write={} Options * @property {Object} write.init={} An options object containing any custom settings that you want to apply to the request. The parameters are identical to those of the {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request|Request constructor} * @property {string} write.init.method=POST + * @property {Object} write.init.headers Object containing any custom headers that you want to apply to the request. * @property {string} write.acceptedStatus=[200,201] * @property {string} write.url URL * @property {Object} write.mapping the mapping is applied before writing. * @property {String} write.mapping.transformer Transformer to select the appropriate entries + * @property {Monster.Data.Datasource~exampleCallback[]} write.mapping.callback with the help of the callback, the structures can be adjusted before writing. * @property {Object} write.report * @property {String} write.report.path Path to validations - * @property {Monster.Data.Datasource~exampleCallback[]} write.mapping.callback with the help of the callback, the structures can be adjusted before writing. + * @property {Object} write.sheathing + * @property {Object} write.sheathing.object Object to be wrapped + * @property {string} write.sheathing.path Path to the data + * @property {Object} read={} Options * @property {Object} read.init={} An options object containing any custom settings that you want to apply to the request. The parameters are identical to those of the {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request|Request constructor} * @property {string} read.init.method=GET * @property {string} read.acceptedStatus=[200] @@ -234,12 +237,3 @@ class RestAPI extends Datasource { } -/** - * This callback can be passed to a datasource and is used to adapt data structures. - * - * @callback Monster.Data.Datasource~exampleCallback - * @param {*} value Value - * @param {string} key Key - * @memberOf Monster.Data - * @see Monster.Data.Datasource - */ diff --git a/application/source/types/queue.mjs b/application/source/types/queue.mjs index c5e841caaf741c1d601f4a42c4724c3d5fc3c972..c6e691923e018e58f3ad584ff83233dd2801a965 100644 --- a/application/source/types/queue.mjs +++ b/application/source/types/queue.mjs @@ -7,11 +7,18 @@ import {Base} from './base.mjs'; import {instanceSymbol} from '../constants.mjs'; + export {Queue} /** - * You can create the instance via the monster namespace `new Monster.Types.Queue()`. - * + * A queue is a list of items that are processed one after another (first in, first out). + * + * With a queue you can add items to the end of the list `Queue.add()` and remove items from the beginning of the list `Queue.pop()`. + * + * With `Queue.peek()` you can get the first item without removing it from the list. + * + * You can create the instance via `new Queue()`. + * * @externalExample ../../example/types/queue.mjs * @license AGPLv3 * @since 1.4.0 diff --git a/development/test/web/test.html b/development/test/web/test.html index 1ab4753c683e726567ee92c1c44db68d51e71423..73a5ded6e795a7f1cbe67714391c880fd38adbea 100644 --- a/development/test/web/test.html +++ b/development/test/web/test.html @@ -14,8 +14,8 @@ </head> <body> <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;"> - <h1 style='margin-bottom: 0.1em;'>Monster 2.2.1</h1> - <div id="lastupdate" style='font-size:0.7em'>last update Mi 4. Jan 15:51:44 CET 2023</div> + <h1 style='margin-bottom: 0.1em;'>Monster 3.0.0</h1> + <div id="lastupdate" style='font-size:0.7em'>last update Fr 6. Jan 12:54:47 CET 2023</div> </div> <div id="mocks"></div> <div id="mocha"></div> diff --git a/development/test/web/tests.js b/development/test/web/tests.js index b7fc0d797e5b81b301f0178833c13f1f265a5c28..524e6c337276b28046be5d4bbdddde2b70f291d3 100644 --- a/development/test/web/tests.js +++ b/development/test/web/tests.js @@ -16416,7 +16416,7 @@ ${key.data.toString("base64")} if (monsterVersion instanceof Version) { return monsterVersion; } - monsterVersion = new Version("2.2.1"); + monsterVersion = new Version("3.0.0"); return monsterVersion; } @@ -16424,7 +16424,7 @@ ${key.data.toString("base64")} describe("Monster", function() { describe(".getMonsterVersion()", function() { let monsterVersion2; - monsterVersion2 = new Version("2.2.1"); + monsterVersion2 = new Version("3.0.0"); let m = getMonsterVersion(); it("should " + monsterVersion2 + " is " + m, function() { expect(m.compareTo(monsterVersion2)).is.equal(0); @@ -26633,6 +26633,22 @@ ${key.data.toString("base64")} * @memberOf Monster.I18n * @see {@link https://datatracker.ietf.org/doc/html/rfc3066} */ +/** + * A queue is a list of items that are processed one after another (first in, first out). + * + * With a queue you can add items to the end of the list `Queue.add()` and remove items from the beginning of the list `Queue.pop()`. + * + * With `Queue.peek()` you can get the first item without removing it from the list. + * + * You can create the instance via `new Queue()`. + * + * @externalExample ../../example/types/queue.mjs + * @license AGPLv3 + * @since 1.4.0 + * @copyright schukai GmbH + * @memberOf Monster.Types + * @summary A Queue (Fifo) + */ /** * Adds a class attribute to an element. * @@ -27474,6 +27490,16 @@ ${key.data.toString("base64")} * @memberOf Monster.DOM * @summary A Resource class */ +/** + * The RestAPI is a class that enables a REST API server. + * + * @externalExample ../../../example/data/storage/restapi.mjs + * @license AGPLv3 + * @since 3.1.0 + * @copyright schukai GmbH + * @memberOf Monster.Data.Datasource + * @summary The LocalStorage class encapsulates the access to data objects. + */ /** * The RestAPI is a class that enables a REST API server. * @@ -27482,7 +27508,7 @@ ${key.data.toString("base64")} * @since 1.22.0 * @copyright schukai GmbH * @memberOf Monster.Data.Datasource - * @summary The LocalStorage class encapsulates the access to data objects. + * @summary The RestAPI is a class that binds a REST API server. */ /** * The SessionStorage class provides a data source that uses the SessionStorage API on the client. @@ -28861,16 +28887,6 @@ ${key.data.toString("base64")} * @memberOf Monster.Types * @summary An iterator to run recursively through a tree of nodes */ -/** - * You can create the instance via the monster namespace `new Monster.Types.Queue()`. - * - * @externalExample ../../example/types/queue.mjs - * @license AGPLv3 - * @since 1.4.0 - * @copyright schukai GmbH - * @memberOf Monster.Types - * @summary A Queue (Fifo) - */ /** * this function uses crypt and returns a random number. *