Make workflow metadata available in expresions and

node-functions
This commit is contained in:
Jan Oberhauser
2020-02-15 17:07:01 -08:00
parent b1719f1bcc
commit 70286b469e
13 changed files with 148 additions and 25 deletions

View File

@@ -240,6 +240,35 @@ export class WorkflowDataProxy {
/**
* Returns a proxt to query data from the workflow
*
* @private
* @returns
* @memberof WorkflowDataProxy
*/
private workflowGetter() {
const allowedValues = [
'active',
'id',
'name',
];
const that = this;
return new Proxy({}, {
get(target, name, receiver) {
if (!allowedValues.includes(name.toString())) {
throw new Error(`The key "${name.toString()}" is not supported!`);
}
// @ts-ignore
return that.workflow[name.toString()];
}
});
}
/**
* Returns a proxy to query data of all nodes
*