diff --git a/application/source/data/datasource/restapi.mjs b/application/source/data/datasource/restapi.mjs index 4df020ce2058835a5c2ecd8b7d1be3823b80626d..1afa3a0f0fb24a90ba949ed59d371d14db8ba63f 100644 --- a/application/source/data/datasource/restapi.mjs +++ b/application/source/data/datasource/restapi.mjs @@ -88,6 +88,10 @@ class RestAPI extends Datasource { transformer: undefined, callbacks: [] }, + sheathing: { + object: undefined, + path: undefined, + }, report: { path: undefined } @@ -149,6 +153,11 @@ class RestAPI extends Datasource { let transformation = self.getOption('read.mapping.transformer'); if (transformation !== undefined) { const pipe = new Pipe(transformation); + + for (const callback of self.getOption('read.mapping.callbacks')) { + pipe.setCallback(callback.constructor.name, callback); + } + obj = pipe.run(obj); } @@ -177,6 +186,11 @@ class RestAPI extends Datasource { let transformation = self.getOption('write.mapping.transformer'); if (transformation !== undefined) { const pipe = new Pipe(transformation); + + for (const callback of self.getOption('write.mapping.callbacks')) { + pipe.setCallback(callback.constructor.name, callback); + } + obj = pipe.run(obj); }