Rename scriptApi to qqqScriptUtils, putting that into context;

This commit is contained in:
2023-05-04 15:38:49 -05:00
parent 0ce989b75c
commit 8d55ee2706
4 changed files with 12 additions and 4 deletions

View File

@ -142,6 +142,7 @@ public class ExecuteCodeAction
executeCodeInput.setCodeReference(new QCodeReference().withInlineCode(scriptRevision.getContents()).withCodeType(QCodeType.JAVA_SCRIPT)); // todo - code type as attribute of script!!
ExecuteCodeAction.addApiUtilityToContext(context, scriptRevision);
context.put("qqq", new QqqScriptUtils());
ExecuteCodeAction.setExecutionLoggerInExecuteCodeInput(input, scriptRevision, executeCodeInput);
return (executeCodeInput);

View File

@ -49,11 +49,15 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
** etc, plus object constructors).
**
** Before scripts knew about the API, this class made sense and was used.
** But, now that scripts do know about the API, it feels like this class could
** But, when scripts gained knowledge of the API, then it felt like this class could
** be deleted... but, what about, a QQQ deployment without the API module...
** In that case, we might still want this class... think about it.
**
** And/Or - it turns out - sometimes using QQQ directly is "better" (?) than using
** an api - so - this object may be available for other use cases (e.g., getting
** a record's backendDetails (e.g., for full json from a source backend api)).
*******************************************************************************/
public class ScriptApi implements Serializable
public class QqqScriptUtils implements Serializable
{
/*******************************************************************************

View File

@ -81,6 +81,9 @@ public interface TestScriptActionInterface
*******************************************************************************/
default void execute(TestScriptInput input, TestScriptOutput output) throws QException
{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// todo - could this be merged with the various other script runners, to use ExecuteCodeAction.setupExecuteCodeInput?? //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ExecuteCodeInput executeCodeInput = new ExecuteCodeInput();
executeCodeInput.setContext(new HashMap<>());