Skip to content

Commit abdefea

Browse files
2282 - added json file tools
1 parent 620357f commit abdefea

File tree

4 files changed

+607
-6
lines changed

4 files changed

+607
-6
lines changed

server/libs/modules/components/json-file/src/main/java/com/bytechef/component/json/file/JsonFileComponentHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.bytechef.component.json.file;
1818

1919
import static com.bytechef.component.definition.ComponentDsl.component;
20+
import static com.bytechef.component.definition.ComponentDsl.tool;
2021

2122
import com.bytechef.component.ComponentHandler;
2223
import com.bytechef.component.definition.ComponentCategory;
@@ -38,7 +39,10 @@ public class JsonFileComponentHandler implements ComponentHandler {
3839
.categories(ComponentCategory.HELPERS)
3940
.actions(
4041
JsonFileReadAction.ACTION_DEFINITION,
41-
JsonFileWriteAction.ACTION_DEFINITION);
42+
JsonFileWriteAction.ACTION_DEFINITION)
43+
.clusterElements(
44+
tool(JsonFileReadAction.ACTION_DEFINITION),
45+
tool(JsonFileWriteAction.ACTION_DEFINITION));
4246

4347
@Override
4448
public ComponentDefinition getDefinition() {

server/libs/modules/components/json-file/src/main/java/com/bytechef/component/json/file/action/JsonFileReadAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import static com.bytechef.component.json.file.constant.JsonFileConstants.PAGE_SIZE;
3030
import static com.bytechef.component.json.file.constant.JsonFileConstants.PATH;
3131

32-
import com.bytechef.component.definition.ActionContext;
3332
import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;
33+
import com.bytechef.component.definition.Context;
3434
import com.bytechef.component.definition.FileEntry;
3535
import com.bytechef.component.definition.Parameters;
3636
import com.bytechef.component.json.file.constant.FileType;
@@ -97,7 +97,7 @@ protected static FileType getFileType(Parameters inputParameters) {
9797

9898
@SuppressWarnings("unchecked")
9999
protected static Object perform(
100-
Parameters inputParameters, Parameters connectionParameters, ActionContext context) throws IOException {
100+
Parameters inputParameters, Parameters connectionParameters, Context context) throws IOException {
101101

102102
FileType fileType = getFileType(inputParameters);
103103
FileEntry fileEntry = inputParameters.getRequiredFileEntry(FILE_ENTRY);

server/libs/modules/components/json-file/src/main/java/com/bytechef/component/json/file/action/JsonFileWriteAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import static com.bytechef.component.json.file.constant.JsonFileConstants.SOURCE;
2929
import static com.bytechef.component.json.file.constant.JsonFileConstants.TYPE;
3030

31-
import com.bytechef.component.definition.ActionContext;
3231
import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;
32+
import com.bytechef.component.definition.Context;
3333
import com.bytechef.component.definition.FileEntry;
3434
import com.bytechef.component.definition.Parameters;
3535
import com.bytechef.component.json.file.constant.FileType;
@@ -98,7 +98,7 @@ private static String getDefaultFileName(FileType fileType, String defaultFilena
9898

9999
@SuppressWarnings("unchecked")
100100
protected static FileEntry perform(
101-
Parameters inputParameters, Parameters connectionParameters, ActionContext context) throws IOException {
101+
Parameters inputParameters, Parameters connectionParameters, Context context) throws IOException {
102102

103103
FileType fileType = JsonFileReadAction.getFileType(inputParameters);
104104
Object source = inputParameters.getRequired(SOURCE);

0 commit comments

Comments
 (0)