From 82d603e09a5f72128e8c68df71833438f5fe83d2 Mon Sep 17 00:00:00 2001 From: Radu Gruia Date: Fri, 27 Sep 2024 11:50:21 +0100 Subject: [PATCH] chore: revert tool ids to action names for generated tools (#1616) --- tools/generator.go | 3 +-- tools/testdata/blog/tools.json | 26 ++++++++++++------------ tools/testdata/nested_inputs/tools.json | 6 +++--- tools/testdata/nested_outputs/tools.json | 6 +++--- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/tools/generator.go b/tools/generator.go index cd2917f66..e792f042d 100644 --- a/tools/generator.go +++ b/tools/generator.go @@ -7,7 +7,6 @@ import ( "sort" "strings" - "github.com/iancoleman/strcase" "github.com/teamkeel/keel/casing" "github.com/teamkeel/keel/proto" toolsproto "github.com/teamkeel/keel/tools/proto" @@ -83,7 +82,7 @@ func (g *Generator) scaffoldTools() { for _, action := range model.GetActions() { t := Tool{ Config: &toolsproto.ActionConfig{ - Id: strcase.ToKebab(action.GetName()), + Id: action.GetName(), ApiNames: g.Schema.FindApiNames(model.Name, action.Name), Name: casing.ToSentenceCase(action.Name), ActionName: action.GetName(), diff --git a/tools/testdata/blog/tools.json b/tools/testdata/blog/tools.json index 0984d510d..c5fe24e75 100644 --- a/tools/testdata/blog/tools.json +++ b/tools/testdata/blog/tools.json @@ -1,7 +1,7 @@ { "tools": [ { - "id": "create-from-image", + "id": "createFromImage", "name": "Create from image", "actionName": "createFromImage", "apiNames": ["Api"], @@ -22,7 +22,7 @@ "capabilities": {} }, { - "id": "create-post", + "id": "createPost", "name": "Create post", "actionName": "createPost", "apiNames": ["Api"], @@ -178,7 +178,7 @@ } }, { - "id": "delete-category", + "id": "deleteCategory", "name": "Delete category", "actionName": "deleteCategory", "apiNames": ["Api"], @@ -233,7 +233,7 @@ "capabilities": {} }, { - "id": "delete-post", + "id": "deletePost", "name": "Delete post", "actionName": "deletePost", "apiNames": ["Api"], @@ -343,7 +343,7 @@ "capabilities": {} }, { - "id": "get-category", + "id": "getCategory", "name": "Get category", "actionName": "getCategory", "apiNames": ["Api"], @@ -404,7 +404,7 @@ ] }, { - "id": "get-post", + "id": "getPost", "name": "Get post", "actionName": "getPost", "apiNames": ["Api"], @@ -534,7 +534,7 @@ "createEntryAction": { "toolId": "createPost" } }, { - "id": "list-categories", + "id": "listCategories", "name": "List categories", "actionName": "listCategories", "apiNames": ["Api"], @@ -680,7 +680,7 @@ } }, { - "id": "list-comments", + "id": "listComments", "name": "List comments", "actionName": "listComments", "apiNames": ["Api"], @@ -889,7 +889,7 @@ } }, { - "id": "list-posts", + "id": "listPosts", "name": "List posts", "actionName": "listPosts", "apiNames": ["Api"], @@ -1109,7 +1109,7 @@ "createEntryAction": { "toolId": "createPost" } }, { - "id": "list-posts-embeds", + "id": "listPostsEmbeds", "name": "List posts embeds", "actionName": "listPostsEmbeds", "apiNames": ["Api"], @@ -1494,7 +1494,7 @@ "createEntryAction": { "toolId": "createPost" } }, { - "id": "request-password-reset", + "id": "requestPasswordReset", "name": "Request password reset", "actionName": "requestPasswordReset", "apiNames": ["Api"], @@ -1522,7 +1522,7 @@ "capabilities": {} }, { - "id": "reset-password", + "id": "resetPassword", "name": "Reset password", "actionName": "resetPassword", "apiNames": ["Api"], @@ -1550,7 +1550,7 @@ "capabilities": {} }, { - "id": "update-post", + "id": "updatePost", "name": "Update post", "actionName": "updatePost", "apiNames": ["Api"], diff --git a/tools/testdata/nested_inputs/tools.json b/tools/testdata/nested_inputs/tools.json index fde148392..fc728bfd6 100644 --- a/tools/testdata/nested_inputs/tools.json +++ b/tools/testdata/nested_inputs/tools.json @@ -1,7 +1,7 @@ { "tools": [ { - "id": "create-invoice", + "id": "createInvoice", "name": "Create invoice", "actionName": "createInvoice", "apiNames": ["Api"], @@ -98,7 +98,7 @@ "capabilities": {} }, { - "id": "request-password-reset", + "id": "requestPasswordReset", "name": "Request password reset", "actionName": "requestPasswordReset", "apiNames": ["Api"], @@ -126,7 +126,7 @@ "capabilities": {} }, { - "id": "reset-password", + "id": "resetPassword", "name": "Reset password", "actionName": "resetPassword", "apiNames": ["Api"], diff --git a/tools/testdata/nested_outputs/tools.json b/tools/testdata/nested_outputs/tools.json index eb5f25f06..7e1af3718 100644 --- a/tools/testdata/nested_outputs/tools.json +++ b/tools/testdata/nested_outputs/tools.json @@ -1,7 +1,7 @@ { "tools": [ { - "id": "read-invoices", + "id": "readInvoices", "name": "Read invoices", "actionName": "readInvoices", "apiNames": ["Api"], @@ -93,7 +93,7 @@ "capabilities": {} }, { - "id": "request-password-reset", + "id": "requestPasswordReset", "name": "Request password reset", "actionName": "requestPasswordReset", "apiNames": ["Api"], @@ -121,7 +121,7 @@ "capabilities": {} }, { - "id": "reset-password", + "id": "resetPassword", "name": "Reset password", "actionName": "resetPassword", "apiNames": ["Api"],