diff --git a/application/source/data/datasource/server/restapi.mjs b/application/source/data/datasource/server/restapi.mjs index 174a0b2ec0153d45da742fab97b9f4708a41efa4..534f5816c4d73214d28bf4349c7a48280c4a88f4 100644 --- a/application/source/data/datasource/server/restapi.mjs +++ b/application/source/data/datasource/server/restapi.mjs @@ -12,6 +12,16 @@ import { WriteError } from "./restapi/writeerror.mjs"; export { RestAPI }; + + +/** + * @type {symbol} + * @memberOf Monster + * @license AGPLv3 + * @since 3.12.0 + */ +const rawDataSymbol = Symbol.for("@schukai/monster/data/datasource/server/restapi/rawdata"); + /** * The RestAPI is a class that enables a REST API server. * @@ -182,6 +192,9 @@ function fetchData(init, key, callback) { try { obj = JSON.parse(body); + + response[rawDataSymbol] = obj; + } catch (e) { if (body.length > 100) { body = `${body.substring(0, 97)}...`; @@ -193,6 +206,7 @@ function fetchData(init, key, callback) { if (callback && isFunction(callback)) { callback(obj); } + return response; }); }