diff --git a/cli/cmd/encore/gen.go b/cli/cmd/encore/gen.go index 086eb7e987..733d934569 100644 --- a/cli/cmd/encore/gen.go +++ b/cli/cmd/encore/gen.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "os" + "strings" "time" "github.com/spf13/cobra" @@ -21,10 +22,15 @@ func init() { rootCmd.AddCommand(genCmd) var ( - output string - lang string - envName string - nextJsSupport bool + output string + lang string + envName string + preset string + + tsOptions = &daemonpb.GenClientRequest_TypeScriptOptions{ + Namespaces: true, + Swr: false, + } ) genClientCmd := &cobra.Command{ @@ -38,15 +44,29 @@ Use '--env=local' to generate it based on your local development version of the Supported language codes are: typescript: A TypeScript-client using the in-browser Fetch API go: A Go client using net/http" + +Support presets are: + nextjs: Generates a TypScript client for use within a Next.js application `, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { - if output == "" && lang == "" { - fatal("specify at least one of --output or --lang.") + if output == "" && lang == "" && preset == "" { + fatal("specify at least one of --output, --lang or --preset.") } appID := args[0] - if lang == "" { + if preset != "" { + switch strings.ToLower(preset) { + case "nextjs", "next.js": + lang = string(codegen.LangTypeScript) + tsOptions = &daemonpb.GenClientRequest_TypeScriptOptions{ + Namespaces: false, + Swr: true, + } + default: + fatal("unknown preset " + preset + "\n\nSupported presets are: nextjs") + } + } else if lang == "" { var ok bool l, ok := codegen.Detect(output) if !ok { @@ -62,19 +82,15 @@ Supported language codes are: lang = string(l) } - if nextJsSupport && lang != "typescript" { - fatal("--nextjs is only supported for typescript") - } - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() daemon := setupDaemon(ctx) resp, err := daemon.GenClient(ctx, &daemonpb.GenClientRequest{ - AppId: appID, - EnvName: envName, - Lang: lang, - NextJsSupport: nextJsSupport, + AppId: appID, + EnvName: envName, + Lang: lang, + Ts: tsOptions, }) if err != nil { fatal(err) @@ -106,6 +122,15 @@ Supported language codes are: genClientCmd.Flags().StringVarP(&envName, "env", "e", "", "The environment to fetch the API for (defaults to the primary environment)") _ = genClientCmd.RegisterFlagCompletionFunc("env", autoCompleteEnvSlug) - genClientCmd.Flags().BoolVar(&nextJsSupport, "nextjs", false, "Generates a TypeScript client which is compatible with a Next.js (disable Namespaces)") - _ = genClientCmd.RegisterFlagCompletionFunc("nextjs", autoCompleteFromStaticList("true", "false")) + genClientCmd.Flags().StringVarP(&preset, "preset", "p", "", "Configures the client generation based on a given preset") + _ = genClientCmd.RegisterFlagCompletionFunc( + "preset", + autoCompleteFromStaticList("nextjs\tConfigures the client generation for Next.js using TypeScript"), + ) + + genClientCmd.Flags().BoolVar(&tsOptions.Namespaces, "ts.namespaces", true, "Use namespaces in TypeScript to mirror Go packages") + _ = genClientCmd.RegisterFlagCompletionFunc("ts.namespaces", autoCompleteFromStaticList("true", "false")) + + genClientCmd.Flags().BoolVar(&tsOptions.Namespaces, "ts.swr", false, "Write SWR functions in the Typescript client") + _ = genClientCmd.RegisterFlagCompletionFunc("ts.swr", autoCompleteFromStaticList("true", "false")) } diff --git a/cli/daemon/daemon.go b/cli/daemon/daemon.go index c72a9f6d30..ae2c318bcd 100644 --- a/cli/daemon/daemon.go +++ b/cli/daemon/daemon.go @@ -103,7 +103,7 @@ func (s *Server) GenClient(ctx context.Context, params *daemonpb.GenClientReques } lang := codegen.Lang(params.Lang) - code, err := codegen.Client(lang, params.AppId, md, params.NextJsSupport) + code, err := codegen.Client(lang, params.AppId, md, params.Ts) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } diff --git a/cli/daemon/run/run_test.go b/cli/daemon/run/run_test.go index 09ab1c9d28..5f5ec15b34 100644 --- a/cli/daemon/run/run_test.go +++ b/cli/daemon/run/run_test.go @@ -108,7 +108,7 @@ func TestEndToEndWithApp(t *testing.T) { // Use golden to test that the generated clients are as expected for the echo test app for lang, path := range map[codegen.Lang]string{codegen.LangGo: "client/client.go", codegen.LangTypeScript: "client.ts"} { - client, err := codegen.Client(lang, "slug", build.Parse.Meta, false) + client, err := codegen.Client(lang, "slug", build.Parse.Meta, nil) if err != nil { fmt.Println(err.Error()) c.FailNow() diff --git a/cli/internal/codegen/client.go b/cli/internal/codegen/client.go index 5da4c8fee7..13b6aeeee4 100644 --- a/cli/internal/codegen/client.go +++ b/cli/internal/codegen/client.go @@ -9,6 +9,7 @@ import ( "runtime/debug" "strings" + daemonpb "encr.dev/proto/encore/daemon" meta "encr.dev/proto/encore/parser/meta/v1" ) @@ -44,7 +45,7 @@ func Detect(path string) (lang Lang, ok bool) { } // Client generates an API client based on the given app metadata. -func Client(lang Lang, appSlug string, md *meta.Data, nextJsSupport bool) (code []byte, err error) { +func Client(lang Lang, appSlug string, md *meta.Data, tsOptions *daemonpb.GenClientRequest_TypeScriptOptions) (code []byte, err error) { defer func() { if e := recover(); e != nil { err = fmt.Errorf("codegen.Client %s %s panicked: %v\n%s", lang, appSlug, e, debug.Stack()) @@ -54,7 +55,11 @@ func Client(lang Lang, appSlug string, md *meta.Data, nextJsSupport bool) (code var gen generator switch lang { case LangTypeScript: - gen = &typescript{generatorVersion: typescriptGenLatestVersion, noNamespaces: nextJsSupport, generateSWRHelpers: nextJsSupport} + if tsOptions == nil { + tsOptions = &daemonpb.GenClientRequest_TypeScriptOptions{Namespaces: true} + } + + gen = &typescript{generatorVersion: typescriptGenLatestVersion, noNamespaces: !tsOptions.Namespaces, generateSWRHelpers: tsOptions.Swr} case LangGo: gen = &golang{generatorVersion: goGenLatestVersion} default: diff --git a/cli/internal/codegen/client_test.go b/cli/internal/codegen/client_test.go index 336d890a5a..0e951b7d27 100644 --- a/cli/internal/codegen/client_test.go +++ b/cli/internal/codegen/client_test.go @@ -14,6 +14,7 @@ import ( "encr.dev/parser" "encr.dev/pkg/golden" + daemonpb "encr.dev/proto/encore/daemon" ) func TestMain(m *testing.M) { @@ -61,7 +62,7 @@ func TestClientCodeGeneration(t *testing.T) { c.Run(testName, func(c *qt.C) { c.Assert(ok, qt.IsTrue, qt.Commentf("Unable to detect language type for %s", file.Name())) - generatedClient, err := Client(language, "app", res.Meta, false) + generatedClient, err := Client(language, "app", res.Meta, &daemonpb.GenClientRequest_TypeScriptOptions{Namespaces: true, Swr: false}) c.Assert(err, qt.IsNil) golden.TestAgainst(c, file.Name(), string(generatedClient)) @@ -69,7 +70,7 @@ func TestClientCodeGeneration(t *testing.T) { if ok && language == LangTypeScript { c.Run(testName+"_nextjs_support", func(c *qt.C) { - generatedClient, err := Client(language, "app", res.Meta, true) + generatedClient, err := Client(language, "app", res.Meta, &daemonpb.GenClientRequest_TypeScriptOptions{Namespaces: false, Swr: true}) c.Assert(err, qt.IsNil) golden.TestAgainst(c, "nextjs_"+file.Name(), string(generatedClient)) diff --git a/proto/encore/daemon/daemon.pb.go b/proto/encore/daemon/daemon.pb.go index fc4930e3f6..f4d9ca0e51 100644 --- a/proto/encore/daemon/daemon.pb.go +++ b/proto/encore/daemon/daemon.pb.go @@ -953,11 +953,11 @@ type GenClientRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - EnvName string `protobuf:"bytes,2,opt,name=env_name,json=envName,proto3" json:"env_name,omitempty"` - Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"` - Filepath string `protobuf:"bytes,4,opt,name=filepath,proto3" json:"filepath,omitempty"` - NextJsSupport bool `protobuf:"varint,5,opt,name=next_js_support,json=nextJsSupport,proto3" json:"next_js_support,omitempty"` // True if the client is a TypeScript client being generated for NextJS + AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + EnvName string `protobuf:"bytes,2,opt,name=env_name,json=envName,proto3" json:"env_name,omitempty"` + Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"` + Filepath string `protobuf:"bytes,4,opt,name=filepath,proto3" json:"filepath,omitempty"` + Ts *GenClientRequest_TypeScriptOptions `protobuf:"bytes,5,opt,name=ts,proto3,oneof" json:"ts,omitempty"` } func (x *GenClientRequest) Reset() { @@ -1020,11 +1020,11 @@ func (x *GenClientRequest) GetFilepath() string { return "" } -func (x *GenClientRequest) GetNextJsSupport() bool { +func (x *GenClientRequest) GetTs() *GenClientRequest_TypeScriptOptions { if x != nil { - return x.NextJsSupport + return x.Ts } - return false + return nil } type GenClientResponse struct { @@ -1247,6 +1247,61 @@ func (x *VersionResponse) GetConfigHash() string { return "" } +type GenClientRequest_TypeScriptOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespaces bool `protobuf:"varint,1,opt,name=namespaces,proto3" json:"namespaces,omitempty"` // True if we should use namespaces for packages + Swr bool `protobuf:"varint,2,opt,name=swr,proto3" json:"swr,omitempty"` // True if we should generate SWR helper functions. +} + +func (x *GenClientRequest_TypeScriptOptions) Reset() { + *x = GenClientRequest_TypeScriptOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_encore_daemon_daemon_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenClientRequest_TypeScriptOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenClientRequest_TypeScriptOptions) ProtoMessage() {} + +func (x *GenClientRequest_TypeScriptOptions) ProtoReflect() protoreflect.Message { + mi := &file_encore_daemon_daemon_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenClientRequest_TypeScriptOptions.ProtoReflect.Descriptor instead. +func (*GenClientRequest_TypeScriptOptions) Descriptor() ([]byte, []int) { + return file_encore_daemon_daemon_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *GenClientRequest_TypeScriptOptions) GetNamespaces() bool { + if x != nil { + return x.Namespaces + } + return false +} + +func (x *GenClientRequest_TypeScriptOptions) GetSwr() bool { + if x != nil { + return x.Swr + } + return false +} + var File_encore_daemon_daemon_proto protoreflect.FileDescriptor var file_encore_daemon_daemon_proto_rawDesc = []byte{ @@ -1341,88 +1396,95 @@ var file_encore_daemon_daemon_proto_rawDesc = []byte{ 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x43, 0x6c, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x76, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x26, 0x0a, - 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6a, 0x73, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x4a, 0x73, 0x53, 0x75, - 0x70, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xb8, - 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x27, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x45, 0x56, 0x45, - 0x4c, 0x4f, 0x50, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x4f, - 0x44, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x22, 0x2d, 0x0a, 0x11, 0x53, 0x65, 0x74, - 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x4c, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x48, 0x61, 0x73, 0x68, 0x32, 0xe9, 0x05, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x12, 0x41, 0x0a, 0x03, 0x52, 0x75, 0x6e, 0x12, 0x19, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x65, - 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x45, 0x0a, 0x05, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, - 0x12, 0x47, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x65, 0x6e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x4e, 0x0a, 0x09, 0x44, 0x42, 0x43, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x42, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x42, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x07, 0x44, 0x42, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x42, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x07, 0x44, 0x42, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, - 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x44, 0x42, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, - 0x4e, 0x0a, 0x09, 0x47, 0x65, 0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x65, - 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6e, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, - 0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4e, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x65, - 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, - 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, - 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x41, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x1e, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x1e, 0x5a, 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x46, 0x0a, + 0x02, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x53, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x02, + 0x74, 0x73, 0x88, 0x01, 0x01, 0x1a, 0x45, 0x0a, 0x11, 0x54, 0x79, 0x70, 0x65, 0x53, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x77, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x73, 0x77, 0x72, 0x42, 0x05, 0x0a, 0x03, + 0x5f, 0x74, 0x73, 0x22, 0x27, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xb8, 0x01, 0x0a, + 0x10, 0x53, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x27, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x45, 0x56, 0x45, 0x4c, 0x4f, + 0x50, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x4f, 0x44, 0x55, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x22, 0x2d, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x4c, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x48, 0x61, 0x73, 0x68, 0x32, 0xe9, 0x05, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, + 0x41, 0x0a, 0x03, 0x52, 0x75, 0x6e, 0x12, 0x19, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x30, 0x01, 0x12, 0x43, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x65, 0x6e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x45, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x47, + 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x4e, 0x0a, 0x09, 0x44, 0x42, 0x43, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, + 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x42, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x42, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x07, 0x44, 0x42, 0x50, 0x72, 0x6f, + 0x78, 0x79, 0x12, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x44, 0x42, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x30, 0x01, 0x12, 0x49, 0x0a, 0x07, 0x44, 0x42, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x2e, + 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x42, + 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, + 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x4e, 0x0a, + 0x09, 0x47, 0x65, 0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x6e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, + 0x09, 0x53, 0x65, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x6e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, + 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x1e, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x1e, 0x5a, 0x1c, 0x65, 0x6e, 0x63, 0x72, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1438,59 +1500,61 @@ func file_encore_daemon_daemon_proto_rawDescGZIP() []byte { } var file_encore_daemon_daemon_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_encore_daemon_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_encore_daemon_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_encore_daemon_daemon_proto_goTypes = []interface{}{ - (SetSecretRequest_Type)(0), // 0: encore.daemon.SetSecretRequest.Type - (*CommandMessage)(nil), // 1: encore.daemon.CommandMessage - (*CommandOutput)(nil), // 2: encore.daemon.CommandOutput - (*CommandExit)(nil), // 3: encore.daemon.CommandExit - (*RunRequest)(nil), // 4: encore.daemon.RunRequest - (*TestRequest)(nil), // 5: encore.daemon.TestRequest - (*CheckRequest)(nil), // 6: encore.daemon.CheckRequest - (*ExportRequest)(nil), // 7: encore.daemon.ExportRequest - (*DockerExportParams)(nil), // 8: encore.daemon.DockerExportParams - (*ResetDBRequest)(nil), // 9: encore.daemon.ResetDBRequest - (*DBConnectRequest)(nil), // 10: encore.daemon.DBConnectRequest - (*DBConnectResponse)(nil), // 11: encore.daemon.DBConnectResponse - (*DBProxyRequest)(nil), // 12: encore.daemon.DBProxyRequest - (*DBResetRequest)(nil), // 13: encore.daemon.DBResetRequest - (*GenClientRequest)(nil), // 14: encore.daemon.GenClientRequest - (*GenClientResponse)(nil), // 15: encore.daemon.GenClientResponse - (*SetSecretRequest)(nil), // 16: encore.daemon.SetSecretRequest - (*SetSecretResponse)(nil), // 17: encore.daemon.SetSecretResponse - (*VersionResponse)(nil), // 18: encore.daemon.VersionResponse - (*emptypb.Empty)(nil), // 19: google.protobuf.Empty + (SetSecretRequest_Type)(0), // 0: encore.daemon.SetSecretRequest.Type + (*CommandMessage)(nil), // 1: encore.daemon.CommandMessage + (*CommandOutput)(nil), // 2: encore.daemon.CommandOutput + (*CommandExit)(nil), // 3: encore.daemon.CommandExit + (*RunRequest)(nil), // 4: encore.daemon.RunRequest + (*TestRequest)(nil), // 5: encore.daemon.TestRequest + (*CheckRequest)(nil), // 6: encore.daemon.CheckRequest + (*ExportRequest)(nil), // 7: encore.daemon.ExportRequest + (*DockerExportParams)(nil), // 8: encore.daemon.DockerExportParams + (*ResetDBRequest)(nil), // 9: encore.daemon.ResetDBRequest + (*DBConnectRequest)(nil), // 10: encore.daemon.DBConnectRequest + (*DBConnectResponse)(nil), // 11: encore.daemon.DBConnectResponse + (*DBProxyRequest)(nil), // 12: encore.daemon.DBProxyRequest + (*DBResetRequest)(nil), // 13: encore.daemon.DBResetRequest + (*GenClientRequest)(nil), // 14: encore.daemon.GenClientRequest + (*GenClientResponse)(nil), // 15: encore.daemon.GenClientResponse + (*SetSecretRequest)(nil), // 16: encore.daemon.SetSecretRequest + (*SetSecretResponse)(nil), // 17: encore.daemon.SetSecretResponse + (*VersionResponse)(nil), // 18: encore.daemon.VersionResponse + (*GenClientRequest_TypeScriptOptions)(nil), // 19: encore.daemon.GenClientRequest.TypeScriptOptions + (*emptypb.Empty)(nil), // 20: google.protobuf.Empty } var file_encore_daemon_daemon_proto_depIdxs = []int32{ 2, // 0: encore.daemon.CommandMessage.output:type_name -> encore.daemon.CommandOutput 3, // 1: encore.daemon.CommandMessage.exit:type_name -> encore.daemon.CommandExit 8, // 2: encore.daemon.ExportRequest.docker:type_name -> encore.daemon.DockerExportParams - 0, // 3: encore.daemon.SetSecretRequest.type:type_name -> encore.daemon.SetSecretRequest.Type - 4, // 4: encore.daemon.Daemon.Run:input_type -> encore.daemon.RunRequest - 5, // 5: encore.daemon.Daemon.Test:input_type -> encore.daemon.TestRequest - 6, // 6: encore.daemon.Daemon.Check:input_type -> encore.daemon.CheckRequest - 7, // 7: encore.daemon.Daemon.Export:input_type -> encore.daemon.ExportRequest - 10, // 8: encore.daemon.Daemon.DBConnect:input_type -> encore.daemon.DBConnectRequest - 12, // 9: encore.daemon.Daemon.DBProxy:input_type -> encore.daemon.DBProxyRequest - 13, // 10: encore.daemon.Daemon.DBReset:input_type -> encore.daemon.DBResetRequest - 14, // 11: encore.daemon.Daemon.GenClient:input_type -> encore.daemon.GenClientRequest - 16, // 12: encore.daemon.Daemon.SetSecret:input_type -> encore.daemon.SetSecretRequest - 19, // 13: encore.daemon.Daemon.Version:input_type -> google.protobuf.Empty - 1, // 14: encore.daemon.Daemon.Run:output_type -> encore.daemon.CommandMessage - 1, // 15: encore.daemon.Daemon.Test:output_type -> encore.daemon.CommandMessage - 1, // 16: encore.daemon.Daemon.Check:output_type -> encore.daemon.CommandMessage - 1, // 17: encore.daemon.Daemon.Export:output_type -> encore.daemon.CommandMessage - 11, // 18: encore.daemon.Daemon.DBConnect:output_type -> encore.daemon.DBConnectResponse - 1, // 19: encore.daemon.Daemon.DBProxy:output_type -> encore.daemon.CommandMessage - 1, // 20: encore.daemon.Daemon.DBReset:output_type -> encore.daemon.CommandMessage - 15, // 21: encore.daemon.Daemon.GenClient:output_type -> encore.daemon.GenClientResponse - 17, // 22: encore.daemon.Daemon.SetSecret:output_type -> encore.daemon.SetSecretResponse - 18, // 23: encore.daemon.Daemon.Version:output_type -> encore.daemon.VersionResponse - 14, // [14:24] is the sub-list for method output_type - 4, // [4:14] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 19, // 3: encore.daemon.GenClientRequest.ts:type_name -> encore.daemon.GenClientRequest.TypeScriptOptions + 0, // 4: encore.daemon.SetSecretRequest.type:type_name -> encore.daemon.SetSecretRequest.Type + 4, // 5: encore.daemon.Daemon.Run:input_type -> encore.daemon.RunRequest + 5, // 6: encore.daemon.Daemon.Test:input_type -> encore.daemon.TestRequest + 6, // 7: encore.daemon.Daemon.Check:input_type -> encore.daemon.CheckRequest + 7, // 8: encore.daemon.Daemon.Export:input_type -> encore.daemon.ExportRequest + 10, // 9: encore.daemon.Daemon.DBConnect:input_type -> encore.daemon.DBConnectRequest + 12, // 10: encore.daemon.Daemon.DBProxy:input_type -> encore.daemon.DBProxyRequest + 13, // 11: encore.daemon.Daemon.DBReset:input_type -> encore.daemon.DBResetRequest + 14, // 12: encore.daemon.Daemon.GenClient:input_type -> encore.daemon.GenClientRequest + 16, // 13: encore.daemon.Daemon.SetSecret:input_type -> encore.daemon.SetSecretRequest + 20, // 14: encore.daemon.Daemon.Version:input_type -> google.protobuf.Empty + 1, // 15: encore.daemon.Daemon.Run:output_type -> encore.daemon.CommandMessage + 1, // 16: encore.daemon.Daemon.Test:output_type -> encore.daemon.CommandMessage + 1, // 17: encore.daemon.Daemon.Check:output_type -> encore.daemon.CommandMessage + 1, // 18: encore.daemon.Daemon.Export:output_type -> encore.daemon.CommandMessage + 11, // 19: encore.daemon.Daemon.DBConnect:output_type -> encore.daemon.DBConnectResponse + 1, // 20: encore.daemon.Daemon.DBProxy:output_type -> encore.daemon.CommandMessage + 1, // 21: encore.daemon.Daemon.DBReset:output_type -> encore.daemon.CommandMessage + 15, // 22: encore.daemon.Daemon.GenClient:output_type -> encore.daemon.GenClientResponse + 17, // 23: encore.daemon.Daemon.SetSecret:output_type -> encore.daemon.SetSecretResponse + 18, // 24: encore.daemon.Daemon.Version:output_type -> encore.daemon.VersionResponse + 15, // [15:25] is the sub-list for method output_type + 5, // [5:15] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_encore_daemon_daemon_proto_init() } @@ -1715,6 +1779,18 @@ func file_encore_daemon_daemon_proto_init() { return nil } } + file_encore_daemon_daemon_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenClientRequest_TypeScriptOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_encore_daemon_daemon_proto_msgTypes[0].OneofWrappers = []interface{}{ (*CommandMessage_Output)(nil), @@ -1723,13 +1799,14 @@ func file_encore_daemon_daemon_proto_init() { file_encore_daemon_daemon_proto_msgTypes[6].OneofWrappers = []interface{}{ (*ExportRequest_Docker)(nil), } + file_encore_daemon_daemon_proto_msgTypes[13].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_encore_daemon_daemon_proto_rawDesc, NumEnums: 1, - NumMessages: 18, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/encore/daemon/daemon.proto b/proto/encore/daemon/daemon.proto index 97eedd18c5..dc77d73977 100644 --- a/proto/encore/daemon/daemon.proto +++ b/proto/encore/daemon/daemon.proto @@ -145,11 +145,16 @@ message DBResetRequest { } message GenClientRequest { - string app_id = 1; - string env_name = 2; - string lang = 3; - string filepath = 4; - bool next_js_support = 5; // True if the client is a TypeScript client being generated for NextJS + string app_id = 1; + string env_name = 2; + string lang = 3; + string filepath = 4; + optional TypeScriptOptions ts = 5; + + message TypeScriptOptions { + bool namespaces = 1; // True if we should use namespaces for packages + bool swr = 2; // True if we should generate SWR helper functions. + } } message GenClientResponse {