diff --git a/apps/dashboard/Dockerfile b/apps/dashboard/Dockerfile index 209de3ec59..46a42832ce 100644 --- a/apps/dashboard/Dockerfile +++ b/apps/dashboard/Dockerfile @@ -26,7 +26,6 @@ COPY ./internal/hash/package.json ./internal/hash/package.json COPY ./internal/icons/package.json ./internal/icons/package.json COPY ./internal/id/package.json ./internal/id/package.json COPY ./internal/keys/package.json ./internal/keys/package.json -COPY ./internal/proto/package.json ./internal/proto/package.json COPY ./internal/resend/package.json ./internal/resend/package.json COPY ./internal/schema/package.json ./internal/schema/package.json COPY ./internal/tsconfig/package.json ./internal/tsconfig/package.json diff --git a/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/details/project-details-expandables/sections/open-api-diff.tsx b/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/details/project-details-expandables/sections/open-api-diff.tsx index 43e01f070f..00bb20de55 100644 --- a/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/details/project-details-expandables/sections/open-api-diff.tsx +++ b/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/details/project-details-expandables/sections/open-api-diff.tsx @@ -1,9 +1,9 @@ "use client"; +import type { GetOpenApiDiffResponse } from "@/gen/proto/ctrl/v1/openapi_pb"; import { shortenId } from "@/lib/shorten-id"; import { trpc } from "@/lib/trpc/client"; import { useLiveQuery } from "@tanstack/react-db"; import { ArrowRight } from "@unkey/icons"; -import type { GetOpenApiDiffResponse } from "@unkey/proto"; import Link from "next/link"; import { useParams } from "next/navigation"; import { useProject } from "../../../layout-provider"; diff --git a/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/openapi-diff/components/client.tsx b/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/openapi-diff/components/client.tsx index 25552b50e5..82a7a6e563 100644 --- a/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/openapi-diff/components/client.tsx +++ b/apps/dashboard/app/(app)/[workspaceSlug]/projects/[projectId]/openapi-diff/components/client.tsx @@ -1,4 +1,5 @@ "use client"; +import type { ChangelogEntry } from "@/gen/proto/ctrl/v1/openapi_pb"; import { ChevronDown, CircleInfo, @@ -7,7 +8,6 @@ import { InputSearch, TriangleWarning, } from "@unkey/icons"; -import type { ChangelogEntry } from "@unkey/proto"; import { Badge, Button, diff --git a/internal/proto/generated/cache/v1/invalidation_pb.ts b/apps/dashboard/gen/proto/cache/v1/invalidation_pb.ts similarity index 73% rename from internal/proto/generated/cache/v1/invalidation_pb.ts rename to apps/dashboard/gen/proto/cache/v1/invalidation_pb.ts index ea7f19c7e3..90f1a77f60 100644 --- a/internal/proto/generated/cache/v1/invalidation_pb.ts +++ b/apps/dashboard/gen/proto/cache/v1/invalidation_pb.ts @@ -2,15 +2,18 @@ // @generated from file cache/v1/invalidation.proto (package cache.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file cache/v1/invalidation.proto. */ -export const file_cache_v1_invalidation: GenFile = /*@__PURE__*/ - fileDesc("ChtjYWNoZS92MS9pbnZhbGlkYXRpb24ucHJvdG8SCGNhY2hlLnYxImsKFkNhY2hlSW52YWxpZGF0aW9uRXZlbnQSEgoKY2FjaGVfbmFtZRgBIAEoCRIRCgljYWNoZV9rZXkYAiABKAkSEQoJdGltZXN0YW1wGAMgASgDEhcKD3NvdXJjZV9pbnN0YW5jZRgEIAEoCUKaAQoMY29tLmNhY2hlLnYxQhFJbnZhbGlkYXRpb25Qcm90b1ABWjZnaXRodWIuY29tL3Vua2V5ZWQvdW5rZXkvZ28vZ2VuL3Byb3RvL2NhY2hlL3YxO2NhY2hldjGiAgNDWFiqAghDYWNoZS5WMcoCCENhY2hlXFYx4gIUQ2FjaGVcVjFcR1BCTWV0YWRhdGHqAglDYWNoZTo6VjFiBnByb3RvMw"); +export const file_cache_v1_invalidation: GenFile = + /*@__PURE__*/ + fileDesc( + "ChtjYWNoZS92MS9pbnZhbGlkYXRpb24ucHJvdG8SCGNhY2hlLnYxImsKFkNhY2hlSW52YWxpZGF0aW9uRXZlbnQSEgoKY2FjaGVfbmFtZRgBIAEoCRIRCgljYWNoZV9rZXkYAiABKAkSEQoJdGltZXN0YW1wGAMgASgDEhcKD3NvdXJjZV9pbnN0YW5jZRgEIAEoCUKaAQoMY29tLmNhY2hlLnYxQhFJbnZhbGlkYXRpb25Qcm90b1ABWjZnaXRodWIuY29tL3Vua2V5ZWQvdW5rZXkvZ28vZ2VuL3Byb3RvL2NhY2hlL3YxO2NhY2hldjGiAgNDWFiqAghDYWNoZS5WMcoCCENhY2hlXFYx4gIUQ2FjaGVcVjFcR1BCTWV0YWRhdGHqAglDYWNoZTo6VjFiBnByb3RvMw", + ); /** * CacheInvalidationEvent represents a cache invalidation event @@ -51,6 +54,6 @@ export type CacheInvalidationEvent = Message<"cache.v1.CacheInvalidationEvent"> * Describes the message cache.v1.CacheInvalidationEvent. * Use `create(CacheInvalidationEventSchema)` to create a new message. */ -export const CacheInvalidationEventSchema: GenMessage = /*@__PURE__*/ +export const CacheInvalidationEventSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_cache_v1_invalidation, 0); - diff --git a/internal/proto/generated/ctrl/v1/acme_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/acme_pb.ts similarity index 70% rename from internal/proto/generated/ctrl/v1/acme_pb.ts rename to apps/dashboard/gen/proto/ctrl/v1/acme_pb.ts index aa8284a482..75c479df26 100644 --- a/internal/proto/generated/ctrl/v1/acme_pb.ts +++ b/apps/dashboard/gen/proto/ctrl/v1/acme_pb.ts @@ -2,16 +2,20 @@ // @generated from file ctrl/v1/acme.proto (package ctrl.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file ctrl/v1/acme.proto. */ -export const file_ctrl_v1_acme: GenFile = /*@__PURE__*/ - fileDesc("ChJjdHJsL3YxL2FjbWUucHJvdG8SB2N0cmwudjEiOQoYVmVyaWZ5Q2VydGlmaWNhdGVSZXF1ZXN0Eg4KBmRvbWFpbhgBIAEoCRINCgV0b2tlbhgCIAEoCSIyChlWZXJpZnlDZXJ0aWZpY2F0ZVJlc3BvbnNlEhUKDWF1dGhvcml6YXRpb24YASABKAkyawoLQWNtZVNlcnZpY2USXAoRVmVyaWZ5Q2VydGlmaWNhdGUSIS5jdHJsLnYxLlZlcmlmeUNlcnRpZmljYXRlUmVxdWVzdBoiLmN0cmwudjEuVmVyaWZ5Q2VydGlmaWNhdGVSZXNwb25zZSIAQosBCgtjb20uY3RybC52MUIJQWNtZVByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", [file_google_protobuf_timestamp]); +export const file_ctrl_v1_acme: GenFile = + /*@__PURE__*/ + fileDesc( + "ChJjdHJsL3YxL2FjbWUucHJvdG8SB2N0cmwudjEiOQoYVmVyaWZ5Q2VydGlmaWNhdGVSZXF1ZXN0Eg4KBmRvbWFpbhgBIAEoCRINCgV0b2tlbhgCIAEoCSIyChlWZXJpZnlDZXJ0aWZpY2F0ZVJlc3BvbnNlEhUKDWF1dGhvcml6YXRpb24YASABKAkyawoLQWNtZVNlcnZpY2USXAoRVmVyaWZ5Q2VydGlmaWNhdGUSIS5jdHJsLnYxLlZlcmlmeUNlcnRpZmljYXRlUmVxdWVzdBoiLmN0cmwudjEuVmVyaWZ5Q2VydGlmaWNhdGVSZXNwb25zZSIAQosBCgtjb20uY3RybC52MUIJQWNtZVByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", + [file_google_protobuf_timestamp], + ); /** * @generated from message ctrl.v1.VerifyCertificateRequest @@ -32,7 +36,8 @@ export type VerifyCertificateRequest = Message<"ctrl.v1.VerifyCertificateRequest * Describes the message ctrl.v1.VerifyCertificateRequest. * Use `create(VerifyCertificateRequestSchema)` to create a new message. */ -export const VerifyCertificateRequestSchema: GenMessage = /*@__PURE__*/ +export const VerifyCertificateRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_acme, 0); /** @@ -49,7 +54,8 @@ export type VerifyCertificateResponse = Message<"ctrl.v1.VerifyCertificateRespon * Describes the message ctrl.v1.VerifyCertificateResponse. * Use `create(VerifyCertificateResponseSchema)` to create a new message. */ -export const VerifyCertificateResponseSchema: GenMessage = /*@__PURE__*/ +export const VerifyCertificateResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_acme, 1); /** @@ -63,7 +69,5 @@ export const AcmeService: GenService<{ methodKind: "unary"; input: typeof VerifyCertificateRequestSchema; output: typeof VerifyCertificateResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_ctrl_v1_acme, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_acme, 0); diff --git a/internal/proto/generated/ctrl/v1/build_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/build_pb.ts similarity index 75% rename from internal/proto/generated/ctrl/v1/build_pb.ts rename to apps/dashboard/gen/proto/ctrl/v1/build_pb.ts index 76596d3641..80a4508d28 100644 --- a/internal/proto/generated/ctrl/v1/build_pb.ts +++ b/apps/dashboard/gen/proto/ctrl/v1/build_pb.ts @@ -2,15 +2,18 @@ // @generated from file ctrl/v1/build.proto (package ctrl.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file ctrl/v1/build.proto. */ -export const file_ctrl_v1_build: GenFile = /*@__PURE__*/ - fileDesc("ChNjdHJsL3YxL2J1aWxkLnByb3RvEgdjdHJsLnYxIqkBChJDcmVhdGVCdWlsZFJlcXVlc3QSGgoSYnVpbGRfY29udGV4dF9wYXRoGAEgASgJEhwKD2RvY2tlcmZpbGVfcGF0aBgCIAEoCUgAiAEBEhgKEHVua2V5X3Byb2plY3RfaWQYAyABKAkSFQoNZGVwbG95bWVudF9pZBgEIAEoCRIUCgx3b3Jrc3BhY2VfaWQYBSABKAlCEgoQX2RvY2tlcmZpbGVfcGF0aCJVChNDcmVhdGVCdWlsZFJlc3BvbnNlEhIKCmltYWdlX25hbWUYASABKAkSEAoIYnVpbGRfaWQYAiABKAkSGAoQZGVwb3RfcHJvamVjdF9pZBgDIAEoCSI0ChhHZW5lcmF0ZVVwbG9hZFVSTFJlcXVlc3QSGAoQdW5rZXlfcHJvamVjdF9pZBgBIAEoCSJfChlHZW5lcmF0ZVVwbG9hZFVSTFJlc3BvbnNlEhIKCnVwbG9hZF91cmwYASABKAkSGgoSYnVpbGRfY29udGV4dF9wYXRoGAIgASgJEhIKCmV4cGlyZXNfaW4YAyABKAMyuAEKDEJ1aWxkU2VydmljZRJKCgtDcmVhdGVCdWlsZBIbLmN0cmwudjEuQ3JlYXRlQnVpbGRSZXF1ZXN0GhwuY3RybC52MS5DcmVhdGVCdWlsZFJlc3BvbnNlIgASXAoRR2VuZXJhdGVVcGxvYWRVUkwSIS5jdHJsLnYxLkdlbmVyYXRlVXBsb2FkVVJMUmVxdWVzdBoiLmN0cmwudjEuR2VuZXJhdGVVcGx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cmwudjEuR2VuZXJhdGVVcGxvYWRVUkxSZXNwb25zZSIAQowBCgtjb20uY3RybC52MUIKQnVpbGRQcm90b1ABWjRnaXRodWIuY29tL3Vua2V5ZWQvdW5rZXkvZ28vZ2VuL3Byb3RvL2N0cmwvdjE7Y3RybHYxogIDQ1hYqgIHQ3RybC5WMcoCB0N0cmxcVjHiAhNDdHJsXFYxXEdQQk1ldGFkYXRh6gIIQ3RybDo6VjFiBnByb3RvMw", + ); /** * @generated from message ctrl.v1.CreateBuildRequest @@ -52,7 +55,8 @@ export type CreateBuildRequest = Message<"ctrl.v1.CreateBuildRequest"> & { * Describes the message ctrl.v1.CreateBuildRequest. * Use `create(CreateBuildRequestSchema)` to create a new message. */ -export const CreateBuildRequestSchema: GenMessage = /*@__PURE__*/ +export const CreateBuildRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_build, 0); /** @@ -85,7 +89,8 @@ export type CreateBuildResponse = Message<"ctrl.v1.CreateBuildResponse"> & { * Describes the message ctrl.v1.CreateBuildResponse. * Use `create(CreateBuildResponseSchema)` to create a new message. */ -export const CreateBuildResponseSchema: GenMessage = /*@__PURE__*/ +export const CreateBuildResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_build, 1); /** @@ -104,7 +109,8 @@ export type GenerateUploadURLRequest = Message<"ctrl.v1.GenerateUploadURLRequest * Describes the message ctrl.v1.GenerateUploadURLRequest. * Use `create(GenerateUploadURLRequestSchema)` to create a new message. */ -export const GenerateUploadURLRequestSchema: GenMessage = /*@__PURE__*/ +export const GenerateUploadURLRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_build, 2); /** @@ -137,7 +143,8 @@ export type GenerateUploadURLResponse = Message<"ctrl.v1.GenerateUploadURLRespon * Describes the message ctrl.v1.GenerateUploadURLResponse. * Use `create(GenerateUploadURLResponseSchema)` to create a new message. */ -export const GenerateUploadURLResponseSchema: GenMessage = /*@__PURE__*/ +export const GenerateUploadURLResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_build, 3); /** @@ -151,7 +158,7 @@ export const BuildService: GenService<{ methodKind: "unary"; input: typeof CreateBuildRequestSchema; output: typeof CreateBuildResponseSchema; - }, + }; /** * @generated from rpc ctrl.v1.BuildService.GenerateUploadURL */ @@ -159,7 +166,5 @@ export const BuildService: GenService<{ methodKind: "unary"; input: typeof GenerateUploadURLRequestSchema; output: typeof GenerateUploadURLResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_ctrl_v1_build, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_build, 0); diff --git a/internal/proto/generated/ctrl/v1/deployment_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/deployment_pb.ts similarity index 72% rename from internal/proto/generated/ctrl/v1/deployment_pb.ts rename to apps/dashboard/gen/proto/ctrl/v1/deployment_pb.ts index 0b0c05f477..2034cf6927 100644 --- a/internal/proto/generated/ctrl/v1/deployment_pb.ts +++ b/apps/dashboard/gen/proto/ctrl/v1/deployment_pb.ts @@ -2,15 +2,18 @@ // @generated from file ctrl/v1/deployment.proto (package ctrl.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file ctrl/v1/deployment.proto. */ -export const file_ctrl_v1_deployment: GenFile = /*@__PURE__*/ - fileDesc("ChhjdHJsL3YxL2RlcGxveW1lbnQucHJvdG8SB2N0cmwudjEimQIKF0NyZWF0ZURlcGxveW1lbnRSZXF1ZXN0EhIKCnByb2plY3RfaWQYAiABKAkSDgoGYnJhbmNoGAMgASgJEhgKEGVudmlyb25tZW50X3NsdWcYBCABKAkSLgoNYnVpbGRfY29udGV4dBgFIAEoCzIVLmN0cmwudjEuQnVpbGRDb250Z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QQ3JlYXRlRGVwbG95bWVudBIgLmN0cmwudjEuQ3JlYXRlRGVwbG95bWVudFJlcXVlc3QaIS5jdHJsLnYxLkNyZWF0ZURlcGxveW1lbnRSZXNwb25zZSIAElAKDUdldERlcGxveW1lbnQSHS5jdHJsLnYxLkdldERlcGxveW1lbnRSZXF1ZXN0Gh4uY3RybC52MS5HZXREZXBsb3ltZW50UmVzcG9uc2UiABJBCghSb2xsYmFjaxIYLmN0cmwudjEuUm9sbGJhY2tSZXF1ZXN0GhkuY3RybC52MS5Sb2xsYmFja1Jlc3BvbnNlIgASPgoHUHJvbW90ZRIXLmN0cmwudjEuUHJvbW90ZVJlcXVlc3QaGC5jdHJsLnYxLlByb21vdGVSZXNwb25zZSIAQpEBCgtjb20uY3RybC52MUIPRGVwbG95bWVudFByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", + ); /** * @generated from message ctrl.v1.CreateDeploymentRequest @@ -36,21 +39,24 @@ export type CreateDeploymentRequest = Message<"ctrl.v1.CreateDeploymentRequest"> * * @generated from oneof ctrl.v1.CreateDeploymentRequest.source */ - source: { - /** - * @generated from field: ctrl.v1.BuildContext build_context = 5; - */ - value: BuildContext; - case: "buildContext"; - } | { - /** - * Prebuilt image reference - * - * @generated from field: string docker_image = 6; - */ - value: string; - case: "dockerImage"; - } | { case: undefined; value?: undefined }; + source: + | { + /** + * @generated from field: ctrl.v1.BuildContext build_context = 5; + */ + value: BuildContext; + case: "buildContext"; + } + | { + /** + * Prebuilt image reference + * + * @generated from field: string docker_image = 6; + */ + value: string; + case: "dockerImage"; + } + | { case: undefined; value?: undefined }; /** * Git information @@ -71,7 +77,8 @@ export type CreateDeploymentRequest = Message<"ctrl.v1.CreateDeploymentRequest"> * Describes the message ctrl.v1.CreateDeploymentRequest. * Use `create(CreateDeploymentRequestSchema)` to create a new message. */ -export const CreateDeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const CreateDeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 0); /** @@ -97,7 +104,8 @@ export type BuildContext = Message<"ctrl.v1.BuildContext"> & { * Describes the message ctrl.v1.BuildContext. * Use `create(BuildContextSchema)` to create a new message. */ -export const BuildContextSchema: GenMessage = /*@__PURE__*/ +export const BuildContextSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 1); /** @@ -136,7 +144,8 @@ export type GitCommitInfo = Message<"ctrl.v1.GitCommitInfo"> & { * Describes the message ctrl.v1.GitCommitInfo. * Use `create(GitCommitInfoSchema)` to create a new message. */ -export const GitCommitInfoSchema: GenMessage = /*@__PURE__*/ +export const GitCommitInfoSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 2); /** @@ -160,7 +169,8 @@ export type CreateDeploymentResponse = Message<"ctrl.v1.CreateDeploymentResponse * Describes the message ctrl.v1.CreateDeploymentResponse. * Use `create(CreateDeploymentResponseSchema)` to create a new message. */ -export const CreateDeploymentResponseSchema: GenMessage = /*@__PURE__*/ +export const CreateDeploymentResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 3); /** @@ -177,7 +187,8 @@ export type GetDeploymentRequest = Message<"ctrl.v1.GetDeploymentRequest"> & { * Describes the message ctrl.v1.GetDeploymentRequest. * Use `create(GetDeploymentRequestSchema)` to create a new message. */ -export const GetDeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const GetDeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 4); /** @@ -194,7 +205,8 @@ export type GetDeploymentResponse = Message<"ctrl.v1.GetDeploymentResponse"> & { * Describes the message ctrl.v1.GetDeploymentResponse. * Use `create(GetDeploymentResponseSchema)` to create a new message. */ -export const GetDeploymentResponseSchema: GenMessage = /*@__PURE__*/ +export const GetDeploymentResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 5); /** @@ -330,7 +342,8 @@ export type Deployment = Message<"ctrl.v1.Deployment"> & { * Describes the message ctrl.v1.Deployment. * Use `create(DeploymentSchema)` to create a new message. */ -export const DeploymentSchema: GenMessage = /*@__PURE__*/ +export const DeploymentSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 6); /** @@ -362,7 +375,8 @@ export type DeploymentStep = Message<"ctrl.v1.DeploymentStep"> & { * Describes the message ctrl.v1.DeploymentStep. * Use `create(DeploymentStepSchema)` to create a new message. */ -export const DeploymentStepSchema: GenMessage = /*@__PURE__*/ +export const DeploymentStepSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 7); /** @@ -410,7 +424,8 @@ export type Topology = Message<"ctrl.v1.Topology"> & { * Describes the message ctrl.v1.Topology. * Use `create(TopologySchema)` to create a new message. */ -export const TopologySchema: GenMessage = /*@__PURE__*/ +export const TopologySchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 8); /** @@ -437,7 +452,8 @@ export type RegionalConfig = Message<"ctrl.v1.RegionalConfig"> & { * Describes the message ctrl.v1.RegionalConfig. * Use `create(RegionalConfigSchema)` to create a new message. */ -export const RegionalConfigSchema: GenMessage = /*@__PURE__*/ +export const RegionalConfigSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 9); /** @@ -459,20 +475,21 @@ export type RollbackRequest = Message<"ctrl.v1.RollbackRequest"> & { * Describes the message ctrl.v1.RollbackRequest. * Use `create(RollbackRequestSchema)` to create a new message. */ -export const RollbackRequestSchema: GenMessage = /*@__PURE__*/ +export const RollbackRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 10); /** * @generated from message ctrl.v1.RollbackResponse */ -export type RollbackResponse = Message<"ctrl.v1.RollbackResponse"> & { -}; +export type RollbackResponse = Message<"ctrl.v1.RollbackResponse"> & {}; /** * Describes the message ctrl.v1.RollbackResponse. * Use `create(RollbackResponseSchema)` to create a new message. */ -export const RollbackResponseSchema: GenMessage = /*@__PURE__*/ +export const RollbackResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 11); /** @@ -489,20 +506,21 @@ export type PromoteRequest = Message<"ctrl.v1.PromoteRequest"> & { * Describes the message ctrl.v1.PromoteRequest. * Use `create(PromoteRequestSchema)` to create a new message. */ -export const PromoteRequestSchema: GenMessage = /*@__PURE__*/ +export const PromoteRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 12); /** * @generated from message ctrl.v1.PromoteResponse */ -export type PromoteResponse = Message<"ctrl.v1.PromoteResponse"> & { -}; +export type PromoteResponse = Message<"ctrl.v1.PromoteResponse"> & {}; /** * Describes the message ctrl.v1.PromoteResponse. * Use `create(PromoteResponseSchema)` to create a new message. */ -export const PromoteResponseSchema: GenMessage = /*@__PURE__*/ +export const PromoteResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_deployment, 13); /** @@ -550,7 +568,8 @@ export enum DeploymentStatus { /** * Describes the enum ctrl.v1.DeploymentStatus. */ -export const DeploymentStatusSchema: GenEnum = /*@__PURE__*/ +export const DeploymentStatusSchema: GenEnum = + /*@__PURE__*/ enumDesc(file_ctrl_v1_deployment, 0); /** @@ -578,7 +597,8 @@ export enum SourceType { /** * Describes the enum ctrl.v1.SourceType. */ -export const SourceTypeSchema: GenEnum = /*@__PURE__*/ +export const SourceTypeSchema: GenEnum = + /*@__PURE__*/ enumDesc(file_ctrl_v1_deployment, 1); /** @@ -594,7 +614,7 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof CreateDeploymentRequestSchema; output: typeof CreateDeploymentResponseSchema; - }, + }; /** * Get deployment details * @@ -604,7 +624,7 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof GetDeploymentRequestSchema; output: typeof GetDeploymentResponseSchema; - }, + }; /** * Reassign the sticky domains of the projects live deployment to the target deployment * @@ -614,7 +634,7 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof RollbackRequestSchema; output: typeof RollbackResponseSchema; - }, + }; /** * Promote the deployment to the live environment * @@ -624,7 +644,5 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof PromoteRequestSchema; output: typeof PromoteResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_ctrl_v1_deployment, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_deployment, 0); diff --git a/apps/dashboard/gen/proto/ctrl/v1/environment_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/environment_pb.ts new file mode 100644 index 0000000000..563e2a6641 --- /dev/null +++ b/apps/dashboard/gen/proto/ctrl/v1/environment_pb.ts @@ -0,0 +1,113 @@ +// @generated by protoc-gen-es v2.8.0 with parameter "target=ts" +// @generated from file ctrl/v1/environment.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ + +import type { Message } from "@bufbuild/protobuf"; +import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; + +/** + * Describes the file ctrl/v1/environment.proto. + */ +export const file_ctrl_v1_environment: GenFile = + /*@__PURE__*/ + fileDesc( + "ChljdHJsL3YxL2Vudmlyb25tZW50LnByb3RvEgdjdHJsLnYxInkKGENyZWF0ZUVudmlyb25tZW50UmVxdWVzdBISCgpwcm9qZWN0X2lkGAEgASgJEgwKBHNsdWcYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSJgoEdHlwZRgEIAEoDjIYLmN0cmwudjEuRW52aXJvbm1lbnRUeXBlIicKGUNyZWF0ZUVudmlyb25tZW50UmVzcG9uc2USCgoCaWQYASABKAkqlAEKD0Vudmlyb25tZW50VHlwZRIgChxFTlZJUk9OTUVOVF9UWVBFX1VOU1BFQ0lGSUVEEAASIAocRU5WSVJPTk1FTlRfVFlQRV9ERVZFTE9QTUVOVBABEhwKGEVOVklST05NRU5UX1RZUEVfUFJFVklFVxACEh8KG0VOVklST05NRU5UX1RZUEVfUFJPRFVDVElPThADMnIKEkVudmlyb25tZW50U2VydmljZRJcChFDcmVhdGVFbnZpcm9ubWVudBIhLmN0cmwudjEuQ3JlYXRlRW52aXJvbm1lbnRSZXF1ZXN0GiIuY3RybC52MS5DcmVhdGVFbnZpcm9ubWVudFJlc3BvbnNlIgBCkgEKC2NvbS5jdHJsLnYxQhBFbnZpcm9ubWVudFByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", + ); + +/** + * @generated from message ctrl.v1.CreateEnvironmentRequest + */ +export type CreateEnvironmentRequest = Message<"ctrl.v1.CreateEnvironmentRequest"> & { + /** + * @generated from field: string project_id = 1; + */ + projectId: string; + + /** + * @generated from field: string slug = 2; + */ + slug: string; + + /** + * @generated from field: string description = 3; + */ + description: string; + + /** + * @generated from field: ctrl.v1.EnvironmentType type = 4; + */ + type: EnvironmentType; +}; + +/** + * Describes the message ctrl.v1.CreateEnvironmentRequest. + * Use `create(CreateEnvironmentRequestSchema)` to create a new message. + */ +export const CreateEnvironmentRequestSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_ctrl_v1_environment, 0); + +/** + * @generated from message ctrl.v1.CreateEnvironmentResponse + */ +export type CreateEnvironmentResponse = Message<"ctrl.v1.CreateEnvironmentResponse"> & { + /** + * @generated from field: string id = 1; + */ + id: string; +}; + +/** + * Describes the message ctrl.v1.CreateEnvironmentResponse. + * Use `create(CreateEnvironmentResponseSchema)` to create a new message. + */ +export const CreateEnvironmentResponseSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_ctrl_v1_environment, 1); + +/** + * @generated from enum ctrl.v1.EnvironmentType + */ +export enum EnvironmentType { + /** + * @generated from enum value: ENVIRONMENT_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: ENVIRONMENT_TYPE_DEVELOPMENT = 1; + */ + DEVELOPMENT = 1, + + /** + * @generated from enum value: ENVIRONMENT_TYPE_PREVIEW = 2; + */ + PREVIEW = 2, + + /** + * @generated from enum value: ENVIRONMENT_TYPE_PRODUCTION = 3; + */ + PRODUCTION = 3, +} + +/** + * Describes the enum ctrl.v1.EnvironmentType. + */ +export const EnvironmentTypeSchema: GenEnum = + /*@__PURE__*/ + enumDesc(file_ctrl_v1_environment, 0); + +/** + * @generated from service ctrl.v1.EnvironmentService + */ +export const EnvironmentService: GenService<{ + /** + * @generated from rpc ctrl.v1.EnvironmentService.CreateEnvironment + */ + createEnvironment: { + methodKind: "unary"; + input: typeof CreateEnvironmentRequestSchema; + output: typeof CreateEnvironmentResponseSchema; + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_environment, 0); diff --git a/internal/proto/generated/ctrl/v1/openapi_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/openapi_pb.ts similarity index 71% rename from internal/proto/generated/ctrl/v1/openapi_pb.ts rename to apps/dashboard/gen/proto/ctrl/v1/openapi_pb.ts index a83bad8042..2a83231830 100644 --- a/internal/proto/generated/ctrl/v1/openapi_pb.ts +++ b/apps/dashboard/gen/proto/ctrl/v1/openapi_pb.ts @@ -2,15 +2,18 @@ // @generated from file ctrl/v1/openapi.proto (package ctrl.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file ctrl/v1/openapi.proto. */ -export const file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QoOT3BlbkFwaVNlcnZpY2USUwoOR2V0T3BlbkFwaURpZmYSHi5jdHJsLnYxLkdldE9wZW5BcGlEaWZmUmVxdWVzdBofLmN0cmwudjEuR2V0T3BlbkFwaURpZmZSZXNwb25zZSIAQo4BCgtjb20uY3RybC52MUIMT3BlbmFwaVByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", + ); /** * @generated from message ctrl.v1.GetOpenApiDiffRequest @@ -31,7 +34,8 @@ export type GetOpenApiDiffRequest = Message<"ctrl.v1.GetOpenApiDiffRequest"> & { * Describes the message ctrl.v1.GetOpenApiDiffRequest. * Use `create(GetOpenApiDiffRequestSchema)` to create a new message. */ -export const GetOpenApiDiffRequestSchema: GenMessage = /*@__PURE__*/ +export const GetOpenApiDiffRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_openapi, 0); /** @@ -73,7 +77,8 @@ export type ChangelogEntry = Message<"ctrl.v1.ChangelogEntry"> & { * Describes the message ctrl.v1.ChangelogEntry. * Use `create(ChangelogEntrySchema)` to create a new message. */ -export const ChangelogEntrySchema: GenMessage = /*@__PURE__*/ +export const ChangelogEntrySchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_openapi, 1); /** @@ -95,7 +100,8 @@ export type DiffSummary = Message<"ctrl.v1.DiffSummary"> & { * Describes the message ctrl.v1.DiffSummary. * Use `create(DiffSummarySchema)` to create a new message. */ -export const DiffSummarySchema: GenMessage = /*@__PURE__*/ +export const DiffSummarySchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_openapi, 2); /** @@ -122,7 +128,8 @@ export type DiffDetails = Message<"ctrl.v1.DiffDetails"> & { * Describes the message ctrl.v1.DiffDetails. * Use `create(DiffDetailsSchema)` to create a new message. */ -export const DiffDetailsSchema: GenMessage = /*@__PURE__*/ +export const DiffDetailsSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_openapi, 3); /** @@ -149,7 +156,8 @@ export type DiffCounts = Message<"ctrl.v1.DiffCounts"> & { * Describes the message ctrl.v1.DiffCounts. * Use `create(DiffCountsSchema)` to create a new message. */ -export const DiffCountsSchema: GenMessage = /*@__PURE__*/ +export const DiffCountsSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_openapi, 4); /** @@ -176,7 +184,8 @@ export type GetOpenApiDiffResponse = Message<"ctrl.v1.GetOpenApiDiffResponse"> & * Describes the message ctrl.v1.GetOpenApiDiffResponse. * Use `create(GetOpenApiDiffResponseSchema)` to create a new message. */ -export const GetOpenApiDiffResponseSchema: GenMessage = /*@__PURE__*/ +export const GetOpenApiDiffResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_openapi, 5); /** @@ -190,7 +199,5 @@ export const OpenApiService: GenService<{ methodKind: "unary"; input: typeof GetOpenApiDiffRequestSchema; output: typeof GetOpenApiDiffResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_ctrl_v1_openapi, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_openapi, 0); diff --git a/apps/dashboard/gen/proto/ctrl/v1/project_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/project_pb.ts new file mode 100644 index 0000000000..47b868be0b --- /dev/null +++ b/apps/dashboard/gen/proto/ctrl/v1/project_pb.ts @@ -0,0 +1,81 @@ +// @generated by protoc-gen-es v2.8.0 with parameter "target=ts" +// @generated from file ctrl/v1/project.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ + +import type { Message } from "@bufbuild/protobuf"; +import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; +import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; + +/** + * Describes the file ctrl/v1/project.proto. + */ +export const file_ctrl_v1_project: GenFile = + /*@__PURE__*/ + fileDesc( + "ChVjdHJsL3YxL3Byb2plY3QucHJvdG8SB2N0cmwudjEiYAoUQ3JlYXRlUHJvamVjdFJlcXVlc3QSFAoMd29ya3NwYWNlX2lkGAEgASgJEgwKBG5hbWUYAiABKAkSDAoEc2x1ZxgDIAEoCRIWCg5naXRfcmVwb3NpdG9yeRgEIAEoCSIjChVDcmVhdGVQcm9qZWN0UmVzcG9uc2USCgoCaWQYASABKAkyYgoOUHJvamVjdFNlcnZpY2USUAoNQ3JlYXRlUHJvamVjdBIdLmN0cmwudjEuQ3JlYXRlUHJvamVjdFJlcXVlc3QaHi5jdHJsLnYxLkNyZWF0ZVByb2plY3RSZXNwb25zZSIAQo4BCgtjb20uY3RybC52MUIMUHJvamVjdFByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", + ); + +/** + * @generated from message ctrl.v1.CreateProjectRequest + */ +export type CreateProjectRequest = Message<"ctrl.v1.CreateProjectRequest"> & { + /** + * @generated from field: string workspace_id = 1; + */ + workspaceId: string; + + /** + * @generated from field: string name = 2; + */ + name: string; + + /** + * @generated from field: string slug = 3; + */ + slug: string; + + /** + * @generated from field: string git_repository = 4; + */ + gitRepository: string; +}; + +/** + * Describes the message ctrl.v1.CreateProjectRequest. + * Use `create(CreateProjectRequestSchema)` to create a new message. + */ +export const CreateProjectRequestSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_ctrl_v1_project, 0); + +/** + * @generated from message ctrl.v1.CreateProjectResponse + */ +export type CreateProjectResponse = Message<"ctrl.v1.CreateProjectResponse"> & { + /** + * @generated from field: string id = 1; + */ + id: string; +}; + +/** + * Describes the message ctrl.v1.CreateProjectResponse. + * Use `create(CreateProjectResponseSchema)` to create a new message. + */ +export const CreateProjectResponseSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_ctrl_v1_project, 1); + +/** + * @generated from service ctrl.v1.ProjectService + */ +export const ProjectService: GenService<{ + /** + * @generated from rpc ctrl.v1.ProjectService.CreateProject + */ + createProject: { + methodKind: "unary"; + input: typeof CreateProjectRequestSchema; + output: typeof CreateProjectResponseSchema; + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_project, 0); diff --git a/internal/proto/generated/ctrl/v1/service_pb.ts b/apps/dashboard/gen/proto/ctrl/v1/service_pb.ts similarity index 71% rename from internal/proto/generated/ctrl/v1/service_pb.ts rename to apps/dashboard/gen/proto/ctrl/v1/service_pb.ts index bb90f20d71..dc1c3038c4 100644 --- a/internal/proto/generated/ctrl/v1/service_pb.ts +++ b/apps/dashboard/gen/proto/ctrl/v1/service_pb.ts @@ -2,27 +2,30 @@ // @generated from file ctrl/v1/service.proto (package ctrl.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file ctrl/v1/service.proto. */ -export const file_ctrl_v1_service: GenFile = /*@__PURE__*/ - fileDesc("ChVjdHJsL3YxL3NlcnZpY2UucHJvdG8SB2N0cmwudjEiEQoPTGl2ZW5lc3NSZXF1ZXN0IkgKEExpdmVuZXNzUmVzcG9uc2USDgoGc3RhdHVzGAEgASgJEg8KB3ZlcnNpb24YAiABKAkSEwoLaW5zdGFuY2VfaWQYAyABKAkyUAoLQ3RybFNlcnZpY2USQQoITGl2ZW5lc3MSGC5jdHJsLnYxLkxpdmVuZXNzUmVxdWVzdBoZLmN0cmwudjEuTGl2ZW5lc3NSZXNwb25zZSIAQo4BCgtjb20uY3RybC52MUIMU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z"); +export const file_ctrl_v1_service: GenFile = + /*@__PURE__*/ + fileDesc( + "ChVjdHJsL3YxL3NlcnZpY2UucHJvdG8SB2N0cmwudjEiEQoPTGl2ZW5lc3NSZXF1ZXN0IkgKEExpdmVuZXNzUmVzcG9uc2USDgoGc3RhdHVzGAEgASgJEg8KB3ZlcnNpb24YAiABKAkSEwoLaW5zdGFuY2VfaWQYAyABKAkyUAoLQ3RybFNlcnZpY2USQQoITGl2ZW5lc3MSGC5jdHJsLnYxLkxpdmVuZXNzUmVxdWVzdBoZLmN0cmwudjEuTGl2ZW5lc3NSZXNwb25zZSIAQo4BCgtjb20uY3RybC52MUIMU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vdW5rZXllZC91bmtleS9nby9nZW4vcHJvdG8vY3RybC92MTtjdHJsdjGiAgNDWFiqAgdDdHJsLlYxygIHQ3RybFxWMeICE0N0cmxcVjFcR1BCTWV0YWRhdGHqAghDdHJsOjpWMWIGcHJvdG8z", + ); /** * @generated from message ctrl.v1.LivenessRequest */ -export type LivenessRequest = Message<"ctrl.v1.LivenessRequest"> & { -}; +export type LivenessRequest = Message<"ctrl.v1.LivenessRequest"> & {}; /** * Describes the message ctrl.v1.LivenessRequest. * Use `create(LivenessRequestSchema)` to create a new message. */ -export const LivenessRequestSchema: GenMessage = /*@__PURE__*/ +export const LivenessRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_service, 0); /** @@ -49,7 +52,8 @@ export type LivenessResponse = Message<"ctrl.v1.LivenessResponse"> & { * Describes the message ctrl.v1.LivenessResponse. * Use `create(LivenessResponseSchema)` to create a new message. */ -export const LivenessResponseSchema: GenMessage = /*@__PURE__*/ +export const LivenessResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_ctrl_v1_service, 1); /** @@ -63,7 +67,5 @@ export const CtrlService: GenService<{ methodKind: "unary"; input: typeof LivenessRequestSchema; output: typeof LivenessResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_ctrl_v1_service, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_ctrl_v1_service, 0); diff --git a/internal/proto/generated/krane/v1/deployment_pb.ts b/apps/dashboard/gen/proto/krane/v1/deployment_pb.ts similarity index 76% rename from internal/proto/generated/krane/v1/deployment_pb.ts rename to apps/dashboard/gen/proto/krane/v1/deployment_pb.ts index 576bb40a60..752e9fc70b 100644 --- a/internal/proto/generated/krane/v1/deployment_pb.ts +++ b/apps/dashboard/gen/proto/krane/v1/deployment_pb.ts @@ -2,15 +2,18 @@ // @generated from file krane/v1/deployment.proto (package krane.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file krane/v1/deployment.proto. */ -export const file_krane_v1_deployment: GenFile = /*@__PURE__*/ - fileDesc("ChlrcmFuZS92MS9kZXBsb3ltZW50LnByb3RvEghrcmFuZS52MSKPAQoRRGVwbG95bWVudFJlcXVlc3QSEQoJbmFtZXNwYWNlGAEgASgJEhUKDWRlcGxveW1lbnRfaWQYAiABKAkSDQoFaW1hZ2UYAyABKAkSEAoIcmVwbGljYXMYBCABKA0SFgoOY3B1X21pbGxpY29yZXMYBSABKA0SFwoPbWVtb3J5X3NpemVfbWliGAYgASgEIkoKF0NyZWF0ZURlcGxveW1lbnRSZXF1ZXN0Ei8KCmRlcGxveW1lbnQYASABKAsyGy5rcmFuZS52MS5EZXBsb3ltZW50UmVxdWVzdCJGChhDcmVhdGVEZXBsb3ltZW50UmVzcG9uc2USKgoGc3RhdHVz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RhdGHqAglLcmFuZTo6VjFiBnByb3RvMw", + ); /** * @generated from message krane.v1.DeploymentRequest @@ -51,7 +54,8 @@ export type DeploymentRequest = Message<"krane.v1.DeploymentRequest"> & { * Describes the message krane.v1.DeploymentRequest. * Use `create(DeploymentRequestSchema)` to create a new message. */ -export const DeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const DeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 0); /** @@ -68,7 +72,8 @@ export type CreateDeploymentRequest = Message<"krane.v1.CreateDeploymentRequest" * Describes the message krane.v1.CreateDeploymentRequest. * Use `create(CreateDeploymentRequestSchema)` to create a new message. */ -export const CreateDeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const CreateDeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 1); /** @@ -85,7 +90,8 @@ export type CreateDeploymentResponse = Message<"krane.v1.CreateDeploymentRespons * Describes the message krane.v1.CreateDeploymentResponse. * Use `create(CreateDeploymentResponseSchema)` to create a new message. */ -export const CreateDeploymentResponseSchema: GenMessage = /*@__PURE__*/ +export const CreateDeploymentResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 2); /** @@ -102,7 +108,8 @@ export type UpdateDeploymentRequest = Message<"krane.v1.UpdateDeploymentRequest" * Describes the message krane.v1.UpdateDeploymentRequest. * Use `create(UpdateDeploymentRequestSchema)` to create a new message. */ -export const UpdateDeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const UpdateDeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 3); /** @@ -119,7 +126,8 @@ export type UpdateDeploymentResponse = Message<"krane.v1.UpdateDeploymentRespons * Describes the message krane.v1.UpdateDeploymentResponse. * Use `create(UpdateDeploymentResponseSchema)` to create a new message. */ -export const UpdateDeploymentResponseSchema: GenMessage = /*@__PURE__*/ +export const UpdateDeploymentResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 4); /** @@ -141,20 +149,21 @@ export type DeleteDeploymentRequest = Message<"krane.v1.DeleteDeploymentRequest" * Describes the message krane.v1.DeleteDeploymentRequest. * Use `create(DeleteDeploymentRequestSchema)` to create a new message. */ -export const DeleteDeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const DeleteDeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 5); /** * @generated from message krane.v1.DeleteDeploymentResponse */ -export type DeleteDeploymentResponse = Message<"krane.v1.DeleteDeploymentResponse"> & { -}; +export type DeleteDeploymentResponse = Message<"krane.v1.DeleteDeploymentResponse"> & {}; /** * Describes the message krane.v1.DeleteDeploymentResponse. * Use `create(DeleteDeploymentResponseSchema)` to create a new message. */ -export const DeleteDeploymentResponseSchema: GenMessage = /*@__PURE__*/ +export const DeleteDeploymentResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 6); /** @@ -176,7 +185,8 @@ export type GetDeploymentRequest = Message<"krane.v1.GetDeploymentRequest"> & { * Describes the message krane.v1.GetDeploymentRequest. * Use `create(GetDeploymentRequestSchema)` to create a new message. */ -export const GetDeploymentRequestSchema: GenMessage = /*@__PURE__*/ +export const GetDeploymentRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 7); /** @@ -193,7 +203,8 @@ export type GetDeploymentResponse = Message<"krane.v1.GetDeploymentResponse"> & * Describes the message krane.v1.GetDeploymentResponse. * Use `create(GetDeploymentResponseSchema)` to create a new message. */ -export const GetDeploymentResponseSchema: GenMessage = /*@__PURE__*/ +export const GetDeploymentResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 8); /** @@ -220,7 +231,8 @@ export type Instance = Message<"krane.v1.Instance"> & { * Describes the message krane.v1.Instance. * Use `create(InstanceSchema)` to create a new message. */ -export const InstanceSchema: GenMessage = /*@__PURE__*/ +export const InstanceSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_deployment, 9); /** @@ -257,7 +269,8 @@ export enum DeploymentStatus { /** * Describes the enum krane.v1.DeploymentStatus. */ -export const DeploymentStatusSchema: GenEnum = /*@__PURE__*/ +export const DeploymentStatusSchema: GenEnum = + /*@__PURE__*/ enumDesc(file_krane_v1_deployment, 0); /** @@ -273,7 +286,7 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof CreateDeploymentRequestSchema; output: typeof CreateDeploymentResponseSchema; - }, + }; /** * GetDeployment * @@ -283,7 +296,7 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof GetDeploymentRequestSchema; output: typeof GetDeploymentResponseSchema; - }, + }; /** * DeleteDeployment * @@ -293,7 +306,5 @@ export const DeploymentService: GenService<{ methodKind: "unary"; input: typeof DeleteDeploymentRequestSchema; output: typeof DeleteDeploymentResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_krane_v1_deployment, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_krane_v1_deployment, 0); diff --git a/internal/proto/generated/krane/v1/gateway_pb.ts b/apps/dashboard/gen/proto/krane/v1/gateway_pb.ts similarity index 76% rename from internal/proto/generated/krane/v1/gateway_pb.ts rename to apps/dashboard/gen/proto/krane/v1/gateway_pb.ts index 78350344a4..ed675d8066 100644 --- a/internal/proto/generated/krane/v1/gateway_pb.ts +++ b/apps/dashboard/gen/proto/krane/v1/gateway_pb.ts @@ -2,15 +2,18 @@ // @generated from file krane/v1/gateway.proto (package krane.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file krane/v1/gateway.proto. */ -export const file_krane_v1_gateway: GenFile = /*@__PURE__*/ - fileDesc("ChZrcmFuZS92MS9nYXRld2F5LnByb3RvE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xLkRlbGV0ZUdhdGV3YXlSZXF1ZXN0Gh8ua3JhbmUudjEuRGVsZXRlR2F0ZXdheVJlc3BvbnNlQpUBCgxjb20ua3JhbmUudjFCDEdhdGV3YXlQcm90b1ABWjZnaXRodWIuY29tL3Vua2V5ZWQvdW5rZXkvZ28vZ2VuL3Byb3RvL2tyYW5lL3YxO2tyYW5ldjGiAgNLWFiqAghLcmFuZS5WMcoCCEtyYW5lXFYx4gIUS3JhbmVcVjFcR1BCTWV0YWRhdGHqAglLcmFuZTo6VjFiBnByb3RvMw", + ); /** * @generated from message krane.v1.GatewayRequest @@ -56,7 +59,8 @@ export type GatewayRequest = Message<"krane.v1.GatewayRequest"> & { * Describes the message krane.v1.GatewayRequest. * Use `create(GatewayRequestSchema)` to create a new message. */ -export const GatewayRequestSchema: GenMessage = /*@__PURE__*/ +export const GatewayRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 0); /** @@ -73,7 +77,8 @@ export type CreateGatewayRequest = Message<"krane.v1.CreateGatewayRequest"> & { * Describes the message krane.v1.CreateGatewayRequest. * Use `create(CreateGatewayRequestSchema)` to create a new message. */ -export const CreateGatewayRequestSchema: GenMessage = /*@__PURE__*/ +export const CreateGatewayRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 1); /** @@ -90,7 +95,8 @@ export type CreateGatewayResponse = Message<"krane.v1.CreateGatewayResponse"> & * Describes the message krane.v1.CreateGatewayResponse. * Use `create(CreateGatewayResponseSchema)` to create a new message. */ -export const CreateGatewayResponseSchema: GenMessage = /*@__PURE__*/ +export const CreateGatewayResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 2); /** @@ -107,7 +113,8 @@ export type UpdateGatewayRequest = Message<"krane.v1.UpdateGatewayRequest"> & { * Describes the message krane.v1.UpdateGatewayRequest. * Use `create(UpdateGatewayRequestSchema)` to create a new message. */ -export const UpdateGatewayRequestSchema: GenMessage = /*@__PURE__*/ +export const UpdateGatewayRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 3); /** @@ -124,7 +131,8 @@ export type UpdateGatewayResponse = Message<"krane.v1.UpdateGatewayResponse"> & * Describes the message krane.v1.UpdateGatewayResponse. * Use `create(UpdateGatewayResponseSchema)` to create a new message. */ -export const UpdateGatewayResponseSchema: GenMessage = /*@__PURE__*/ +export const UpdateGatewayResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 4); /** @@ -146,20 +154,21 @@ export type DeleteGatewayRequest = Message<"krane.v1.DeleteGatewayRequest"> & { * Describes the message krane.v1.DeleteGatewayRequest. * Use `create(DeleteGatewayRequestSchema)` to create a new message. */ -export const DeleteGatewayRequestSchema: GenMessage = /*@__PURE__*/ +export const DeleteGatewayRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 5); /** * @generated from message krane.v1.DeleteGatewayResponse */ -export type DeleteGatewayResponse = Message<"krane.v1.DeleteGatewayResponse"> & { -}; +export type DeleteGatewayResponse = Message<"krane.v1.DeleteGatewayResponse"> & {}; /** * Describes the message krane.v1.DeleteGatewayResponse. * Use `create(DeleteGatewayResponseSchema)` to create a new message. */ -export const DeleteGatewayResponseSchema: GenMessage = /*@__PURE__*/ +export const DeleteGatewayResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 6); /** @@ -181,7 +190,8 @@ export type GetGatewayRequest = Message<"krane.v1.GetGatewayRequest"> & { * Describes the message krane.v1.GetGatewayRequest. * Use `create(GetGatewayRequestSchema)` to create a new message. */ -export const GetGatewayRequestSchema: GenMessage = /*@__PURE__*/ +export const GetGatewayRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 7); /** @@ -203,7 +213,8 @@ export type GetGatewayResponse = Message<"krane.v1.GetGatewayResponse"> & { * Describes the message krane.v1.GetGatewayResponse. * Use `create(GetGatewayResponseSchema)` to create a new message. */ -export const GetGatewayResponseSchema: GenMessage = /*@__PURE__*/ +export const GetGatewayResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 8); /** @@ -225,7 +236,8 @@ export type GatewayInstance = Message<"krane.v1.GatewayInstance"> & { * Describes the message krane.v1.GatewayInstance. * Use `create(GatewayInstanceSchema)` to create a new message. */ -export const GatewayInstanceSchema: GenMessage = /*@__PURE__*/ +export const GatewayInstanceSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_krane_v1_gateway, 9); /** @@ -262,7 +274,8 @@ export enum GatewayStatus { /** * Describes the enum krane.v1.GatewayStatus. */ -export const GatewayStatusSchema: GenEnum = /*@__PURE__*/ +export const GatewayStatusSchema: GenEnum = + /*@__PURE__*/ enumDesc(file_krane_v1_gateway, 0); /** @@ -278,7 +291,7 @@ export const GatewayService: GenService<{ methodKind: "unary"; input: typeof CreateGatewayRequestSchema; output: typeof CreateGatewayResponseSchema; - }, + }; /** * GetGateway * @@ -288,7 +301,7 @@ export const GatewayService: GenService<{ methodKind: "unary"; input: typeof GetGatewayRequestSchema; output: typeof GetGatewayResponseSchema; - }, + }; /** * DeleteGateway * @@ -298,7 +311,5 @@ export const GatewayService: GenService<{ methodKind: "unary"; input: typeof DeleteGatewayRequestSchema; output: typeof DeleteGatewayResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_krane_v1_gateway, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_krane_v1_gateway, 0); diff --git a/internal/proto/generated/vault/v1/object_pb.ts b/apps/dashboard/gen/proto/vault/v1/object_pb.ts similarity index 78% rename from internal/proto/generated/vault/v1/object_pb.ts rename to apps/dashboard/gen/proto/vault/v1/object_pb.ts index 4f9cf36bc0..93ba57ae33 100644 --- a/internal/proto/generated/vault/v1/object_pb.ts +++ b/apps/dashboard/gen/proto/vault/v1/object_pb.ts @@ -2,15 +2,18 @@ // @generated from file vault/v1/object.proto (package vault.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file vault/v1/object.proto. */ -export const file_vault_v1_object: GenFile = /*@__PURE__*/ - fileDesc("ChV2YXVsdC92MS9vYmplY3QucHJvdG8SCHZhdWx0LnYxIkAKEURhdGFFbmNyeXB0aW9uS2V5EgoKAmlkGAEgASgJEhIKCmNyZWF0ZWRfYXQYAiABKAMSCwoDa2V5GAMgASgMImQKGkVuY3J5cHRlZERhdGFFbmNyeXB0aW9uS2V5EgoKAmlkGAEgASgJEhIKCmNyZWF0ZWRfYXQYAiABKAMSJgoJZW5jcnlwdGVkGAMgASgLMhMudmF1bHQudjEuRW5jcnlwdGVkIj8KEEtleUVuY3J5cHRpb25LZXkSCgoCaWQYASABKAkSEgoKY3JlYXRlZF9hdBgCIAEoAxILCgNrZXkYAyABKAwifwoJRW5jcnlwdGVkEiYKCWFsZ29yaXRobRgBIAEoDjITLnZhdWx0LnYxLkFsZ29yaXRobRINCgVub25jZRgCIAEoDBISCgpjaXBoZXJ0ZXh0GAMgASgMEhkKEWVuY3J5cHRpb25fa2V5X2lkGAQgASgJEgwKBHRpbWUYBSABKAMqHAoJQWxnb3JpdGhtEg8KC0FFU18yNTZfR0NNEABClAEKDGNvbS52YXVsdC52MUILT2JqZWN0UHJvdG9QAVo2Z2l0aHViLmNvbS91bmtleWVkL3Vua2V5L2dvL2dlbi9wcm90by92YXVsdC92MTt2YXVsdHYxogIDVlhYqgIIVmF1bHQuVjHKAghWYXVsdFxWMeICFFZhdWx0XFYxXEdQQk1ldGFkYXRh6gIJVmF1bHQ6OlYxYgZwcm90bzM"); +export const file_vault_v1_object: GenFile = + /*@__PURE__*/ + fileDesc( + "ChV2YXVsdC92MS9vYmplY3QucHJvdG8SCHZhdWx0LnYxIkAKEURhdGFFbmNyeXB0aW9uS2V5EgoKAmlkGAEgASgJEhIKCmNyZWF0ZWRfYXQYAiABKAMSCwoDa2V5GAMgASgMImQKGkVuY3J5cHRlZERhdGFFbmNyeXB0aW9uS2V5EgoKAmlkGAEgASgJEhIKCmNyZWF0ZWRfYXQYAiABKAMSJgoJZW5jcnlwdGVkGAMgASgLMhMudmF1bHQudjEuRW5jcnlwdGVkIj8KEEtleUVuY3J5cHRpb25LZXkSCgoCaWQYASABKAkSEgoKY3JlYXRlZF9hdBgCIAEoAxILCgNrZXkYAyABKAwifwoJRW5jcnlwdGVkEiYKCWFsZ29yaXRobRgBIAEoDjITLnZhdWx0LnYxLkFsZ29yaXRobRINCgVub25jZRgCIAEoDBISCgpjaXBoZXJ0ZXh0GAMgASgMEhkKEWVuY3J5cHRpb25fa2V5X2lkGAQgASgJEgwKBHRpbWUYBSABKAMqHAoJQWxnb3JpdGhtEg8KC0FFU18yNTZfR0NNEABClAEKDGNvbS52YXVsdC52MUILT2JqZWN0UHJvdG9QAVo2Z2l0aHViLmNvbS91bmtleWVkL3Vua2V5L2dvL2dlbi9wcm90by92YXVsdC92MTt2YXVsdHYxogIDVlhYqgIIVmF1bHQuVjHKAghWYXVsdFxWMeICFFZhdWx0XFYxXEdQQk1ldGFkYXRh6gIJVmF1bHQ6OlYxYgZwcm90bzM", + ); /** * @generated from message vault.v1.DataEncryptionKey @@ -38,7 +41,8 @@ export type DataEncryptionKey = Message<"vault.v1.DataEncryptionKey"> & { * Describes the message vault.v1.DataEncryptionKey. * Use `create(DataEncryptionKeySchema)` to create a new message. */ -export const DataEncryptionKeySchema: GenMessage = /*@__PURE__*/ +export const DataEncryptionKeySchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_object, 0); /** @@ -69,7 +73,8 @@ export type EncryptedDataEncryptionKey = Message<"vault.v1.EncryptedDataEncrypti * Describes the message vault.v1.EncryptedDataEncryptionKey. * Use `create(EncryptedDataEncryptionKeySchema)` to create a new message. */ -export const EncryptedDataEncryptionKeySchema: GenMessage = /*@__PURE__*/ +export const EncryptedDataEncryptionKeySchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_object, 1); /** @@ -98,7 +103,8 @@ export type KeyEncryptionKey = Message<"vault.v1.KeyEncryptionKey"> & { * Describes the message vault.v1.KeyEncryptionKey. * Use `create(KeyEncryptionKeySchema)` to create a new message. */ -export const KeyEncryptionKeySchema: GenMessage = /*@__PURE__*/ +export const KeyEncryptionKeySchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_object, 2); /** @@ -142,7 +148,8 @@ export type Encrypted = Message<"vault.v1.Encrypted"> & { * Describes the message vault.v1.Encrypted. * Use `create(EncryptedSchema)` to create a new message. */ -export const EncryptedSchema: GenMessage = /*@__PURE__*/ +export const EncryptedSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_object, 3); /** @@ -158,6 +165,4 @@ export enum Algorithm { /** * Describes the enum vault.v1.Algorithm. */ -export const AlgorithmSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_vault_v1_object, 0); - +export const AlgorithmSchema: GenEnum = /*@__PURE__*/ enumDesc(file_vault_v1_object, 0); diff --git a/internal/proto/generated/vault/v1/service_pb.ts b/apps/dashboard/gen/proto/vault/v1/service_pb.ts similarity index 77% rename from internal/proto/generated/vault/v1/service_pb.ts rename to apps/dashboard/gen/proto/vault/v1/service_pb.ts index f04bf7277a..ad2e772cfe 100644 --- a/internal/proto/generated/vault/v1/service_pb.ts +++ b/apps/dashboard/gen/proto/vault/v1/service_pb.ts @@ -2,27 +2,30 @@ // @generated from file vault/v1/service.proto (package vault.v1, syntax proto3) /* eslint-disable */ +import type { Message } from "@bufbuild/protobuf"; import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import type { Message } from "@bufbuild/protobuf"; /** * Describes the file vault/v1/service.proto. */ -export const file_vault_v1_service: GenFile = /*@__PURE__*/ - fileDesc("ChZ2YXVsdC92MS9zZXJ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dWx0LnYxLkRlY3J5cHRSZXNwb25zZSIAEkYKCVJlRW5jcnlwdBIaLnZhdWx0LnYxLlJlRW5jcnlwdFJlcXVlc3QaGy52YXVsdC52MS5SZUVuY3J5cHRSZXNwb25zZSIAElIKDVJlRW5jcnlwdERFS3MSHi52YXVsdC52MS5SZUVuY3J5cHRERUtzUmVxdWVzdBofLnZhdWx0LnYxLlJlRW5jcnlwdERFS3NSZXNwb25zZSIAQpUBCgxjb20udmF1bHQudjFCDFNlcnZpY2VQcm90b1ABWjZnaXRodWIuY29tL3Vua2V5ZWQvdW5rZXkvZ28vZ2VuL3Byb3RvL3ZhdWx0L3YxO3ZhdWx0djGiAgNWWFiqAghWYXVsdC5WMcoCCFZhdWx0XFYx4gIUVmF1bHRcVjFcR1BCTWV0YWRhdGHqAglWYXVsdDo6VjFiBnByb3RvMw", + ); /** * @generated from message vault.v1.LivenessRequest */ -export type LivenessRequest = Message<"vault.v1.LivenessRequest"> & { -}; +export type LivenessRequest = Message<"vault.v1.LivenessRequest"> & {}; /** * Describes the message vault.v1.LivenessRequest. * Use `create(LivenessRequestSchema)` to create a new message. */ -export const LivenessRequestSchema: GenMessage = /*@__PURE__*/ +export const LivenessRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 0); /** @@ -39,7 +42,8 @@ export type LivenessResponse = Message<"vault.v1.LivenessResponse"> & { * Describes the message vault.v1.LivenessResponse. * Use `create(LivenessResponseSchema)` to create a new message. */ -export const LivenessResponseSchema: GenMessage = /*@__PURE__*/ +export const LivenessResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 1); /** @@ -61,7 +65,8 @@ export type EncryptRequest = Message<"vault.v1.EncryptRequest"> & { * Describes the message vault.v1.EncryptRequest. * Use `create(EncryptRequestSchema)` to create a new message. */ -export const EncryptRequestSchema: GenMessage = /*@__PURE__*/ +export const EncryptRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 2); /** @@ -83,7 +88,8 @@ export type EncryptResponse = Message<"vault.v1.EncryptResponse"> & { * Describes the message vault.v1.EncryptResponse. * Use `create(EncryptResponseSchema)` to create a new message. */ -export const EncryptResponseSchema: GenMessage = /*@__PURE__*/ +export const EncryptResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 3); /** @@ -105,7 +111,8 @@ export type EncryptBulkRequest = Message<"vault.v1.EncryptBulkRequest"> & { * Describes the message vault.v1.EncryptBulkRequest. * Use `create(EncryptBulkRequestSchema)` to create a new message. */ -export const EncryptBulkRequestSchema: GenMessage = /*@__PURE__*/ +export const EncryptBulkRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 4); /** @@ -122,7 +129,8 @@ export type EncryptBulkResponse = Message<"vault.v1.EncryptBulkResponse"> & { * Describes the message vault.v1.EncryptBulkResponse. * Use `create(EncryptBulkResponseSchema)` to create a new message. */ -export const EncryptBulkResponseSchema: GenMessage = /*@__PURE__*/ +export const EncryptBulkResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 5); /** @@ -144,7 +152,8 @@ export type DecryptRequest = Message<"vault.v1.DecryptRequest"> & { * Describes the message vault.v1.DecryptRequest. * Use `create(DecryptRequestSchema)` to create a new message. */ -export const DecryptRequestSchema: GenMessage = /*@__PURE__*/ +export const DecryptRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 6); /** @@ -161,7 +170,8 @@ export type DecryptResponse = Message<"vault.v1.DecryptResponse"> & { * Describes the message vault.v1.DecryptResponse. * Use `create(DecryptResponseSchema)` to create a new message. */ -export const DecryptResponseSchema: GenMessage = /*@__PURE__*/ +export const DecryptResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 7); /** @@ -178,7 +188,8 @@ export type CreateDEKRequest = Message<"vault.v1.CreateDEKRequest"> & { * Describes the message vault.v1.CreateDEKRequest. * Use `create(CreateDEKRequestSchema)` to create a new message. */ -export const CreateDEKRequestSchema: GenMessage = /*@__PURE__*/ +export const CreateDEKRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 8); /** @@ -195,7 +206,8 @@ export type CreateDEKResponse = Message<"vault.v1.CreateDEKResponse"> & { * Describes the message vault.v1.CreateDEKResponse. * Use `create(CreateDEKResponseSchema)` to create a new message. */ -export const CreateDEKResponseSchema: GenMessage = /*@__PURE__*/ +export const CreateDEKResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 9); /** @@ -224,7 +236,8 @@ export type ReEncryptRequest = Message<"vault.v1.ReEncryptRequest"> & { * Describes the message vault.v1.ReEncryptRequest. * Use `create(ReEncryptRequestSchema)` to create a new message. */ -export const ReEncryptRequestSchema: GenMessage = /*@__PURE__*/ +export const ReEncryptRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 10); /** @@ -246,33 +259,34 @@ export type ReEncryptResponse = Message<"vault.v1.ReEncryptResponse"> & { * Describes the message vault.v1.ReEncryptResponse. * Use `create(ReEncryptResponseSchema)` to create a new message. */ -export const ReEncryptResponseSchema: GenMessage = /*@__PURE__*/ +export const ReEncryptResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 11); /** * @generated from message vault.v1.ReEncryptDEKsRequest */ -export type ReEncryptDEKsRequest = Message<"vault.v1.ReEncryptDEKsRequest"> & { -}; +export type ReEncryptDEKsRequest = Message<"vault.v1.ReEncryptDEKsRequest"> & {}; /** * Describes the message vault.v1.ReEncryptDEKsRequest. * Use `create(ReEncryptDEKsRequestSchema)` to create a new message. */ -export const ReEncryptDEKsRequestSchema: GenMessage = /*@__PURE__*/ +export const ReEncryptDEKsRequestSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 12); /** * @generated from message vault.v1.ReEncryptDEKsResponse */ -export type ReEncryptDEKsResponse = Message<"vault.v1.ReEncryptDEKsResponse"> & { -}; +export type ReEncryptDEKsResponse = Message<"vault.v1.ReEncryptDEKsResponse"> & {}; /** * Describes the message vault.v1.ReEncryptDEKsResponse. * Use `create(ReEncryptDEKsResponseSchema)` to create a new message. */ -export const ReEncryptDEKsResponseSchema: GenMessage = /*@__PURE__*/ +export const ReEncryptDEKsResponseSchema: GenMessage = + /*@__PURE__*/ messageDesc(file_vault_v1_service, 13); /** @@ -286,7 +300,7 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof LivenessRequestSchema; output: typeof LivenessResponseSchema; - }, + }; /** * @generated from rpc vault.v1.VaultService.CreateDEK */ @@ -294,7 +308,7 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof CreateDEKRequestSchema; output: typeof CreateDEKResponseSchema; - }, + }; /** * @generated from rpc vault.v1.VaultService.Encrypt */ @@ -302,7 +316,7 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof EncryptRequestSchema; output: typeof EncryptResponseSchema; - }, + }; /** * @generated from rpc vault.v1.VaultService.EncryptBulk */ @@ -310,7 +324,7 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof EncryptBulkRequestSchema; output: typeof EncryptBulkResponseSchema; - }, + }; /** * @generated from rpc vault.v1.VaultService.Decrypt */ @@ -318,7 +332,7 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof DecryptRequestSchema; output: typeof DecryptResponseSchema; - }, + }; /** * ReEncrypt rec * @@ -328,7 +342,7 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof ReEncryptRequestSchema; output: typeof ReEncryptResponseSchema; - }, + }; /** * @generated from rpc vault.v1.VaultService.ReEncryptDEKs */ @@ -336,7 +350,5 @@ export const VaultService: GenService<{ methodKind: "unary"; input: typeof ReEncryptDEKsRequestSchema; output: typeof ReEncryptDEKsResponseSchema; - }, -}> = /*@__PURE__*/ - serviceDesc(file_vault_v1_service, 0); - + }; +}> = /*@__PURE__*/ serviceDesc(file_vault_v1_service, 0); diff --git a/apps/dashboard/lib/trpc/routers/deploy/deployment/getOpenApiDiff.ts b/apps/dashboard/lib/trpc/routers/deploy/deployment/getOpenApiDiff.ts index 0f96423e64..4204cf4032 100644 --- a/apps/dashboard/lib/trpc/routers/deploy/deployment/getOpenApiDiff.ts +++ b/apps/dashboard/lib/trpc/routers/deploy/deployment/getOpenApiDiff.ts @@ -1,10 +1,10 @@ +import { OpenApiService } from "@/gen/proto/ctrl/v1/openapi_pb"; import { db } from "@/lib/db"; import { env } from "@/lib/env"; import { requireUser, requireWorkspace, t } from "@/lib/trpc/trpc"; import { createClient } from "@connectrpc/connect"; import { createConnectTransport } from "@connectrpc/connect-web"; import { TRPCError } from "@trpc/server"; -import { type GetOpenApiDiffResponse, OpenApiService } from "@unkey/proto"; import { z } from "zod"; export const getOpenApiDiff = t.procedure @@ -67,9 +67,9 @@ export const getOpenApiDiff = t.procedure }); return { - hasBreakingChanges: (resp as GetOpenApiDiffResponse).hasBreakingChanges, - summary: (resp as GetOpenApiDiffResponse).summary, - changes: (resp as GetOpenApiDiffResponse).changes, + hasBreakingChanges: resp.hasBreakingChanges, + summary: resp.summary, + changes: resp.changes, }; } catch (error) { console.error("Failed to get OpenAPI diff:", error); diff --git a/apps/dashboard/lib/trpc/routers/deploy/deployment/promote.ts b/apps/dashboard/lib/trpc/routers/deploy/deployment/promote.ts index e9aff65b51..c86f8aadfc 100644 --- a/apps/dashboard/lib/trpc/routers/deploy/deployment/promote.ts +++ b/apps/dashboard/lib/trpc/routers/deploy/deployment/promote.ts @@ -3,7 +3,7 @@ import { createClient } from "@connectrpc/connect"; import { createConnectTransport } from "@connectrpc/connect-web"; // Import service definition that you want to connect to. -import { DeploymentService } from "@unkey/proto"; +import { DeploymentService } from "@/gen/proto/ctrl/v1/deployment_pb"; import { db } from "@/lib/db"; import { env } from "@/lib/env"; diff --git a/apps/dashboard/lib/trpc/routers/deploy/deployment/rollback.ts b/apps/dashboard/lib/trpc/routers/deploy/deployment/rollback.ts index 71b5c5903e..d72828dc2e 100644 --- a/apps/dashboard/lib/trpc/routers/deploy/deployment/rollback.ts +++ b/apps/dashboard/lib/trpc/routers/deploy/deployment/rollback.ts @@ -3,7 +3,7 @@ import { createClient } from "@connectrpc/connect"; import { createConnectTransport } from "@connectrpc/connect-web"; // Import service definition that you want to connect to. -import { DeploymentService } from "@unkey/proto"; +import { DeploymentService } from "@/gen/proto/ctrl/v1/deployment_pb"; import { db } from "@/lib/db"; import { env } from "@/lib/env"; diff --git a/apps/dashboard/lib/trpc/routers/deploy/project/create.ts b/apps/dashboard/lib/trpc/routers/deploy/project/create.ts index b3cdc52781..28e7248d8a 100644 --- a/apps/dashboard/lib/trpc/routers/deploy/project/create.ts +++ b/apps/dashboard/lib/trpc/routers/deploy/project/create.ts @@ -1,9 +1,11 @@ -import { insertAuditLogs } from "@/lib/audit"; +import { ProjectService } from "@/gen/proto/ctrl/v1/project_pb"; import { createProjectRequestSchema } from "@/lib/collections/deploy/projects"; -import { db, schema } from "@/lib/db"; +import { db } from "@/lib/db"; +import { env } from "@/lib/env"; import { ratelimit, requireUser, requireWorkspace, t, withRatelimit } from "@/lib/trpc/trpc"; +import { createClient } from "@connectrpc/connect"; +import { createConnectTransport } from "@connectrpc/connect-web"; import { TRPCError } from "@trpc/server"; -import { newId } from "@unkey/id"; export const createProject = t.procedure .use(requireUser) @@ -14,6 +16,28 @@ export const createProject = t.procedure const userId = ctx.user.id; const workspaceId = ctx.workspace.id; + const { CTRL_URL, CTRL_API_KEY } = env(); + if (!CTRL_URL || !CTRL_API_KEY) { + throw new TRPCError({ + code: "PRECONDITION_FAILED", + message: "ctrl service is not configured", + }); + } + // Here we make the client itself, combining the service + // definition with the transport. + const ctrl = createClient( + ProjectService, + createConnectTransport({ + baseUrl: CTRL_URL, + interceptors: [ + (next) => (req) => { + req.header.set("Authorization", `Bearer ${CTRL_API_KEY}`); + return next(req); + }, + ], + }), + ); + try { const workspace = await db.query.workspaces.findFirst({ where: (table, { eq, isNull, and }) => @@ -60,99 +84,15 @@ export const createProject = t.procedure }); } - const projectId = newId("project"); - const now = Date.now(); - - try { - await db.transaction(async (tx) => { - await tx.insert(schema.projects).values({ - id: projectId, - workspaceId, - name: input.name, - slug: input.slug, - liveDeploymentId: null, - gitRepositoryUrl: input.gitRepositoryUrl || null, - defaultBranch: "main", - deleteProtection: false, - createdAt: now, - updatedAt: now, - }); - - await insertAuditLogs(tx, { - workspaceId, - actor: { - type: "user", - id: userId, - }, - event: "project.create", - description: `Created project "${input.name}" with slug "${input.slug}"`, - resources: [ - { - type: "project", - id: projectId, - name: input.name, - }, - ], - context: { - location: ctx.audit.location, - userAgent: ctx.audit.userAgent, - }, - }); - - for (const slug of ["production", "preview"]) { - const environmentId = newId("environment"); - await tx.insert(schema.environments).values({ - id: environmentId, - workspaceId, - projectId, - createdAt: now, - updatedAt: now, - slug, - gatewayConfig: "", - }); - - await insertAuditLogs(tx, { - workspaceId, - actor: { - type: "user", - id: userId, - }, - event: "environment.create", - description: `Created environment "${slug}" for project "${input.name}"`, - resources: [ - { - type: "environment", - id: environmentId, - name: slug, - }, - ], - context: { - location: ctx.audit.location, - userAgent: ctx.audit.userAgent, - }, - }); - } - }); - } catch (txErr) { - console.error({ - message: "Transaction failed during project creation", - userId, - workspaceId, - projectId, - projectSlug: input.slug, - error: txErr instanceof Error ? txErr.message : String(txErr), - stack: txErr instanceof Error ? txErr.stack : undefined, - }); - - throw txErr; // Re-throw to be caught by outer catch - } - - return { - id: projectId, + const project = await ctrl.createProject({ + workspaceId: ctx.workspace.id, name: input.name, slug: input.slug, - gitRepositoryUrl: input.gitRepositoryUrl, - createdAt: now, + gitRepository: input.gitRepositoryUrl ?? "", + }); + + return { + id: project.id, }; } catch (err) { if (err instanceof TRPCError) { diff --git a/apps/dashboard/package.json b/apps/dashboard/package.json index b33eec5ede..e00602c38a 100644 --- a/apps/dashboard/package.json +++ b/apps/dashboard/package.json @@ -12,9 +12,11 @@ }, "dependencies": { "@ant-design/plots": "1.2.5", + "@bufbuild/protobuf": "2.8.0", "@connectrpc/connect": "2.1.0", "@connectrpc/connect-web": "2.1.0", "@hookform/resolvers": "3.4.2", + "@marsidev/react-turnstile": "1.0.2", "@planetscale/database": "1.16.0", "@radix-ui/react-accordion": "1.2.0", "@radix-ui/react-alert-dialog": "1.1.4", @@ -100,8 +102,7 @@ "typescript": "5.7.3", "usehooks-ts": "3.1.0", "vaul": "0.9.0", - "zod": "3.23.5", - "@marsidev/react-turnstile": "1.0.2" + "zod": "3.23.5" }, "devDependencies": { "@tailwindcss/aspect-ratio": "0.4.2", diff --git a/deployment/05-seed-chronark.sql b/deployment/05-seed-chronark.sql index 664a6c3146..05fec37164 100644 --- a/deployment/05-seed-chronark.sql +++ b/deployment/05-seed-chronark.sql @@ -5,6 +5,8 @@ + + -- Insert test workspace INSERT INTO workspaces ( id, @@ -23,32 +25,3 @@ INSERT INTO workspaces ( '{"deployments":true}', '{}' ) ON DUPLICATE KEY UPDATE created_at_m = UNIX_TIMESTAMP() * 1000; - --- Insert project -INSERT INTO projects ( - id, - workspace_id, - name, - slug, - created_at -) VALUES ( - 'proj_chronark', - 'ws_chronark', - 'API', - 'api', - UNIX_TIMESTAMP() * 1000 -) ON DUPLICATE KEY UPDATE created_at = UNIX_TIMESTAMP() * 1000; - -INSERT INTO environments ( - id, - workspace_id, - project_id, - slug, - created_at -) VALUES ( - 'env_chronark', - 'ws_chronark', - 'proj_chronark', - 'production', - UNIX_TIMESTAMP() * 1000 -) ON DUPLICATE KEY UPDATE created_at = UNIX_TIMESTAMP() * 1000; diff --git a/deployment/Dockerfile.mysql b/deployment/Dockerfile.mysql index 869512852b..44e6debd4e 100644 --- a/deployment/Dockerfile.mysql +++ b/deployment/Dockerfile.mysql @@ -8,4 +8,4 @@ COPY go/pkg/db/schema.sql /docker-entrypoint-initdb.d/01-main-schema.sql # Copy seed data for local development COPY deployment/04-seed-workspace.sql /docker-entrypoint-initdb.d/04-seed-workspace.sql -# COPY deployment/05-seed-chronark.sql /docker-entrypoint-initdb.d/05-seed-chronark.sql +COPY deployment/05-seed-chronark.sql /docker-entrypoint-initdb.d/05-seed-chronark.sql diff --git a/go/apps/ctrl/run.go b/go/apps/ctrl/run.go index 82552c1bea..7e0cdaf563 100644 --- a/go/apps/ctrl/run.go +++ b/go/apps/ctrl/run.go @@ -19,8 +19,10 @@ import ( "github.com/unkeyed/unkey/go/apps/ctrl/services/ctrl" "github.com/unkeyed/unkey/go/apps/ctrl/services/deployment" "github.com/unkeyed/unkey/go/apps/ctrl/services/openapi" + "github.com/unkeyed/unkey/go/apps/ctrl/services/project" "github.com/unkeyed/unkey/go/apps/ctrl/workflows/certificate" "github.com/unkeyed/unkey/go/apps/ctrl/workflows/deploy" + projectWorkflow "github.com/unkeyed/unkey/go/apps/ctrl/workflows/project" "github.com/unkeyed/unkey/go/apps/ctrl/workflows/routing" deployTLS "github.com/unkeyed/unkey/go/deploy/pkg/tls" "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1/ctrlv1connect" @@ -150,7 +152,18 @@ func Run(ctx context.Context, cfg Config) error { httpClient.Timeout = 30 * time.Second - kraneClient := kranev1connect.NewDeploymentServiceClient( + kraneDeploymentClient := kranev1connect.NewDeploymentServiceClient( + httpClient, + cfg.KraneAddress, + connect.WithInterceptors(connect.UnaryInterceptorFunc(func(next connect.UnaryFunc) connect.UnaryFunc { + return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { + req.Header().Set("Authorization", "Bearer dev_user_ctrl") + return next(ctx, req) + } + })), + ) + + kraneGatewayClient := kranev1connect.NewGatewayServiceClient( httpClient, cfg.KraneAddress, connect.WithInterceptors(connect.UnaryInterceptorFunc(func(next connect.UnaryFunc) connect.UnaryFunc { @@ -221,7 +234,7 @@ func Run(ctx context.Context, cfg Config) error { restateSrv.Bind(hydrav1.NewDeploymentServiceServer(deploy.New(deploy.Config{ Logger: logger, DB: database, - Krane: kraneClient, + Krane: kraneDeploymentClient, BuildClient: buildService, DefaultDomain: cfg.DefaultDomain, }))) @@ -237,6 +250,11 @@ func Run(ctx context.Context, cfg Config) error { DB: database, Vault: vaultSvc, }))) + restateSrv.Bind(hydrav1.NewProjectServiceServer(projectWorkflow.New(projectWorkflow.Config{ + Logger: logger, + DB: database, + Krane: kraneGatewayClient, + }))) go func() { addr := fmt.Sprintf(":%d", cfg.Restate.HttpPort) @@ -320,6 +338,11 @@ func Run(ctx context.Context, cfg Config) error { BuildService: buildService, Logger: logger, }), connectOptions...)) + mux.Handle(ctrlv1connect.NewProjectServiceHandler(project.New(project.Config{ + Database: database, + Restate: restateClient, + Logger: logger, + }), connectOptions...)) mux.Handle(ctrlv1connect.NewOpenApiServiceHandler(openapi.New(database, logger), connectOptions...)) mux.Handle(ctrlv1connect.NewAcmeServiceHandler(acme.New(acme.Config{ DB: database, diff --git a/go/apps/ctrl/services/project/create_project.go b/go/apps/ctrl/services/project/create_project.go new file mode 100644 index 0000000000..5ff5cabd2e --- /dev/null +++ b/go/apps/ctrl/services/project/create_project.go @@ -0,0 +1,31 @@ +package project + +import ( + "context" + + "connectrpc.com/connect" + ctrlv1 "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1" + hydrav1 "github.com/unkeyed/unkey/go/gen/proto/hydra/v1" +) + +func (s *Service) CreateProject( + ctx context.Context, + req *connect.Request[ctrlv1.CreateProjectRequest], +) (*connect.Response[ctrlv1.CreateProjectResponse], error) { + + res, err := hydrav1.NewProjectServiceIngressClient(s.restate, req.Msg.GetWorkspaceId()). + CreateProject().Request(ctx, &hydrav1.CreateProjectRequest{ + WorkspaceId: req.Msg.GetWorkspaceId(), + Name: req.Msg.GetName(), + Slug: req.Msg.GetSlug(), + GitRepository: req.Msg.GetGitRepository(), + }) + + if err != nil { + return nil, connect.NewError(connect.CodeInternal, err) + } + + return connect.NewResponse(&ctrlv1.CreateProjectResponse{ + Id: res.ProjectId, + }), nil +} diff --git a/go/apps/ctrl/services/project/service.go b/go/apps/ctrl/services/project/service.go new file mode 100644 index 0000000000..0623b50842 --- /dev/null +++ b/go/apps/ctrl/services/project/service.go @@ -0,0 +1,30 @@ +package project + +import ( + restateingress "github.com/restatedev/sdk-go/ingress" + "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1/ctrlv1connect" + "github.com/unkeyed/unkey/go/pkg/db" + "github.com/unkeyed/unkey/go/pkg/otel/logging" +) + +type Service struct { + ctrlv1connect.UnimplementedProjectServiceHandler + db db.Database + restate *restateingress.Client + logger logging.Logger +} + +type Config struct { + Database db.Database + Restate *restateingress.Client + Logger logging.Logger +} + +func New(cfg Config) *Service { + return &Service{ + UnimplementedProjectServiceHandler: ctrlv1connect.UnimplementedProjectServiceHandler{}, + db: cfg.Database, + restate: cfg.Restate, + logger: cfg.Logger, + } +} diff --git a/go/apps/ctrl/workflows/project/create.go b/go/apps/ctrl/workflows/project/create.go new file mode 100644 index 0000000000..e24234bd6b --- /dev/null +++ b/go/apps/ctrl/workflows/project/create.go @@ -0,0 +1,135 @@ +package project + +import ( + "database/sql" + "errors" + "time" + + "connectrpc.com/connect" + restate "github.com/restatedev/sdk-go" + hydrav1 "github.com/unkeyed/unkey/go/gen/proto/hydra/v1" + kranev1 "github.com/unkeyed/unkey/go/gen/proto/krane/v1" + "github.com/unkeyed/unkey/go/pkg/assert" + "github.com/unkeyed/unkey/go/pkg/db" + "github.com/unkeyed/unkey/go/pkg/uid" +) + +func (s *Service) CreateProject(ctx restate.ObjectContext, req *hydrav1.CreateProjectRequest) (*hydrav1.CreateProjectResponse, error) { + + if err := assert.All( + assert.NotEmpty(req.WorkspaceId), + assert.NotEmpty(req.Name), + assert.NotEmpty(req.Slug), + ); err != nil { + return nil, restate.TerminalError(err) + } + + workspace, err := restate.Run(ctx, func(runCtx restate.RunContext) (db.Workspace, error) { + found, err := db.Query.FindWorkspaceByID(ctx, s.db.RW(), req.WorkspaceId) + if err != nil { + if db.IsNotFound(err) { + return db.Workspace{}, restate.TerminalError(errors.New("workspace not found")) + } + return db.Workspace{}, err + } + return found, nil + }, restate.WithName("find workspace")) + + if err != nil { + return nil, err + } + + projectID, err := restate.Run(ctx, func(runCtx restate.RunContext) (string, error) { + return uid.New(uid.ProjectPrefix), nil + }, restate.WithName("generate project ID")) + if err != nil { + return nil, err + } + + _, err = restate.Run(ctx, func(runCtx restate.RunContext) (restate.Void, error) { + return restate.Void{}, db.Query.InsertProject(runCtx, s.db.RW(), db.InsertProjectParams{ + ID: projectID, + WorkspaceID: workspace.ID, + Name: req.Name, + Slug: req.Slug, + GitRepositoryUrl: sql.NullString{Valid: req.GitRepository != "", String: req.GitRepository}, + DefaultBranch: sql.NullString{Valid: true, String: "main"}, + + CreatedAt: time.Now().UnixMilli(), + UpdatedAt: sql.NullInt64{Valid: false, Int64: 0}, + }) + }, restate.WithName("insert project")) + + if err != nil { + return nil, err + } + + environments := []struct { + Slug string + Description string + }{ + {Slug: "development", Description: "Development environment"}, + {Slug: "production", Description: "Production environment"}, + } + + for _, env := range environments { + environmentID, err := restate.Run(ctx, func(runCtx restate.RunContext) (string, error) { + return uid.New(uid.EnvironmentPrefix), nil + }, restate.WithName("create environment id")) + + if err != nil { + return nil, err + } + + _, err = restate.Run(ctx, func(runCtx restate.RunContext) (restate.Void, error) { + return restate.Void{}, db.Query.InsertEnvironment(runCtx, s.db.RW(), db.InsertEnvironmentParams{ + ID: environmentID, + WorkspaceID: workspace.ID, + ProjectID: projectID, + Slug: env.Slug, + Description: env.Description, + CreatedAt: time.Now().UnixMilli(), + UpdatedAt: sql.NullInt64{Valid: false, Int64: 0}, + }) + }, restate.WithName("insert environment")) + + if err != nil { + return nil, err + } + gatewayID, err := restate.Run(ctx, func(runCtx restate.RunContext) (string, error) { + return uid.New(uid.GatewayPrefix), nil + }) + if err != nil { + return nil, err + } + + replicas := uint32(1) + if env.Slug == "production" { + replicas = uint32(3) + } + + _, err = restate.Run(ctx, func(runCtx restate.RunContext) (restate.Void, error) { + _, err := s.krane.CreateGateway(runCtx, connect.NewRequest(&kranev1.CreateGatewayRequest{ + Gateway: &kranev1.GatewayRequest{ + Namespace: workspace.ID, + WorkspaceId: workspace.ID, + GatewayId: gatewayID, + Image: "nginx:latest", // TODO + Replicas: replicas, + CpuMillicores: uint32(128), + MemorySizeMib: uint64(256), + }, + })) + return restate.Void{}, err + }, restate.WithName("provision gateway")) + + if err != nil { + return nil, err + } + + } + + return &hydrav1.CreateProjectResponse{ + ProjectId: projectID, + }, nil +} diff --git a/go/apps/ctrl/workflows/project/service.go b/go/apps/ctrl/workflows/project/service.go new file mode 100644 index 0000000000..fc12409c45 --- /dev/null +++ b/go/apps/ctrl/workflows/project/service.go @@ -0,0 +1,38 @@ +package project + +import ( + hydrav1 "github.com/unkeyed/unkey/go/gen/proto/hydra/v1" + "github.com/unkeyed/unkey/go/gen/proto/krane/v1/kranev1connect" + "github.com/unkeyed/unkey/go/pkg/db" + "github.com/unkeyed/unkey/go/pkg/otel/logging" +) + +type Service struct { + hydrav1.UnimplementedProjectServiceServer + db db.Database + logger logging.Logger + krane kranev1connect.GatewayServiceClient +} + +var _ hydrav1.ProjectServiceServer = (*Service)(nil) + +// Config holds the configuration for creating a project service. +type Config struct { + // Logger for structured logging. + Logger logging.Logger + + // DB is the main database connection for domain data. + DB db.Database + + Krane kranev1connect.GatewayServiceClient +} + +// New creates a new project service instance. +func New(cfg Config) *Service { + return &Service{ + UnimplementedProjectServiceServer: hydrav1.UnimplementedProjectServiceServer{}, + db: cfg.DB, + logger: cfg.Logger, + krane: cfg.Krane, + } +} diff --git a/go/apps/krane/backend/kubernetes/gateway_get.go b/go/apps/krane/backend/kubernetes/gateway_get.go index 8122a89db5..456770bed6 100644 --- a/go/apps/krane/backend/kubernetes/gateway_get.go +++ b/go/apps/krane/backend/kubernetes/gateway_get.go @@ -41,13 +41,13 @@ func (k *k8s) GetGateway(ctx context.Context, req *connect.Request[kranev1.GetGa return nil, connect.NewError(connect.CodeInternal, fmt.Errorf("failed to get deployment: %w", err)) } - // Check if this deployment is managed by Krane + // Check if this gateway is managed by Krane managedBy, exists := deployment.Labels["unkey.managed.by"] if !exists || managedBy != "krane" { return nil, connect.NewError(connect.CodeNotFound, fmt.Errorf("deployment not found: %s", k8sgatewayID)) } - // Determine deployment status + // Determine gateway status var status kranev1.GatewayStatus if deployment.Status.AvailableReplicas == deployment.Status.Replicas { status = kranev1.GatewayStatus_GATEWAY_STATUS_RUNNING diff --git a/go/apps/krane/run.go b/go/apps/krane/run.go index 826a0d6327..3d115734c5 100644 --- a/go/apps/krane/run.go +++ b/go/apps/krane/run.go @@ -66,7 +66,7 @@ func Run(ctx context.Context, cfg Config) error { // Create the connect handler mux := http.NewServeMux() - var svc kranev1connect.DeploymentServiceHandler + var svc Svc switch cfg.Backend { case Kubernetes: { @@ -98,6 +98,7 @@ func Run(ctx context.Context, cfg Config) error { // Create the service handlers with interceptors mux.Handle(kranev1connect.NewDeploymentServiceHandler(svc)) + mux.Handle(kranev1connect.NewGatewayServiceHandler(svc)) // Configure server addr := fmt.Sprintf(":%d", cfg.HttpPort) @@ -152,3 +153,8 @@ func Run(ctx context.Context, cfg Config) error { logger.Info("krane server shut down successfully") return nil } + +type Svc interface { + kranev1connect.DeploymentServiceHandler + kranev1connect.GatewayServiceHandler +} diff --git a/go/buf.gen.connect.yaml b/go/buf.gen.connect.yaml index 873286f1ac..b62f8d7171 100644 --- a/go/buf.gen.connect.yaml +++ b/go/buf.gen.connect.yaml @@ -9,6 +9,6 @@ plugins: out: gen/proto opt: paths=source_relative - remote: buf.build/bufbuild/es:v2.8.0 - out: ../internal/proto/generated + out: ../apps/dashboard/gen/proto opt: target=ts include_imports: true diff --git a/go/gen/proto/ctrl/v1/ctrlv1connect/environment.connect.go b/go/gen/proto/ctrl/v1/ctrlv1connect/environment.connect.go new file mode 100644 index 0000000000..e6109b9b88 --- /dev/null +++ b/go/gen/proto/ctrl/v1/ctrlv1connect/environment.connect.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: ctrl/v1/environment.proto + +package ctrlv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // EnvironmentServiceName is the fully-qualified name of the EnvironmentService service. + EnvironmentServiceName = "ctrl.v1.EnvironmentService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // EnvironmentServiceCreateEnvironmentProcedure is the fully-qualified name of the + // EnvironmentService's CreateEnvironment RPC. + EnvironmentServiceCreateEnvironmentProcedure = "/ctrl.v1.EnvironmentService/CreateEnvironment" +) + +// EnvironmentServiceClient is a client for the ctrl.v1.EnvironmentService service. +type EnvironmentServiceClient interface { + CreateEnvironment(context.Context, *connect.Request[v1.CreateEnvironmentRequest]) (*connect.Response[v1.CreateEnvironmentResponse], error) +} + +// NewEnvironmentServiceClient constructs a client for the ctrl.v1.EnvironmentService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewEnvironmentServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) EnvironmentServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + environmentServiceMethods := v1.File_ctrl_v1_environment_proto.Services().ByName("EnvironmentService").Methods() + return &environmentServiceClient{ + createEnvironment: connect.NewClient[v1.CreateEnvironmentRequest, v1.CreateEnvironmentResponse]( + httpClient, + baseURL+EnvironmentServiceCreateEnvironmentProcedure, + connect.WithSchema(environmentServiceMethods.ByName("CreateEnvironment")), + connect.WithClientOptions(opts...), + ), + } +} + +// environmentServiceClient implements EnvironmentServiceClient. +type environmentServiceClient struct { + createEnvironment *connect.Client[v1.CreateEnvironmentRequest, v1.CreateEnvironmentResponse] +} + +// CreateEnvironment calls ctrl.v1.EnvironmentService.CreateEnvironment. +func (c *environmentServiceClient) CreateEnvironment(ctx context.Context, req *connect.Request[v1.CreateEnvironmentRequest]) (*connect.Response[v1.CreateEnvironmentResponse], error) { + return c.createEnvironment.CallUnary(ctx, req) +} + +// EnvironmentServiceHandler is an implementation of the ctrl.v1.EnvironmentService service. +type EnvironmentServiceHandler interface { + CreateEnvironment(context.Context, *connect.Request[v1.CreateEnvironmentRequest]) (*connect.Response[v1.CreateEnvironmentResponse], error) +} + +// NewEnvironmentServiceHandler builds an HTTP handler from the service implementation. It returns +// the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewEnvironmentServiceHandler(svc EnvironmentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + environmentServiceMethods := v1.File_ctrl_v1_environment_proto.Services().ByName("EnvironmentService").Methods() + environmentServiceCreateEnvironmentHandler := connect.NewUnaryHandler( + EnvironmentServiceCreateEnvironmentProcedure, + svc.CreateEnvironment, + connect.WithSchema(environmentServiceMethods.ByName("CreateEnvironment")), + connect.WithHandlerOptions(opts...), + ) + return "/ctrl.v1.EnvironmentService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case EnvironmentServiceCreateEnvironmentProcedure: + environmentServiceCreateEnvironmentHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedEnvironmentServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedEnvironmentServiceHandler struct{} + +func (UnimplementedEnvironmentServiceHandler) CreateEnvironment(context.Context, *connect.Request[v1.CreateEnvironmentRequest]) (*connect.Response[v1.CreateEnvironmentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ctrl.v1.EnvironmentService.CreateEnvironment is not implemented")) +} diff --git a/go/gen/proto/ctrl/v1/ctrlv1connect/project.connect.go b/go/gen/proto/ctrl/v1/ctrlv1connect/project.connect.go new file mode 100644 index 0000000000..7b3b07612b --- /dev/null +++ b/go/gen/proto/ctrl/v1/ctrlv1connect/project.connect.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: ctrl/v1/project.proto + +package ctrlv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // ProjectServiceName is the fully-qualified name of the ProjectService service. + ProjectServiceName = "ctrl.v1.ProjectService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // ProjectServiceCreateProjectProcedure is the fully-qualified name of the ProjectService's + // CreateProject RPC. + ProjectServiceCreateProjectProcedure = "/ctrl.v1.ProjectService/CreateProject" +) + +// ProjectServiceClient is a client for the ctrl.v1.ProjectService service. +type ProjectServiceClient interface { + CreateProject(context.Context, *connect.Request[v1.CreateProjectRequest]) (*connect.Response[v1.CreateProjectResponse], error) +} + +// NewProjectServiceClient constructs a client for the ctrl.v1.ProjectService service. By default, +// it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and +// sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() +// or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewProjectServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ProjectServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + projectServiceMethods := v1.File_ctrl_v1_project_proto.Services().ByName("ProjectService").Methods() + return &projectServiceClient{ + createProject: connect.NewClient[v1.CreateProjectRequest, v1.CreateProjectResponse]( + httpClient, + baseURL+ProjectServiceCreateProjectProcedure, + connect.WithSchema(projectServiceMethods.ByName("CreateProject")), + connect.WithClientOptions(opts...), + ), + } +} + +// projectServiceClient implements ProjectServiceClient. +type projectServiceClient struct { + createProject *connect.Client[v1.CreateProjectRequest, v1.CreateProjectResponse] +} + +// CreateProject calls ctrl.v1.ProjectService.CreateProject. +func (c *projectServiceClient) CreateProject(ctx context.Context, req *connect.Request[v1.CreateProjectRequest]) (*connect.Response[v1.CreateProjectResponse], error) { + return c.createProject.CallUnary(ctx, req) +} + +// ProjectServiceHandler is an implementation of the ctrl.v1.ProjectService service. +type ProjectServiceHandler interface { + CreateProject(context.Context, *connect.Request[v1.CreateProjectRequest]) (*connect.Response[v1.CreateProjectResponse], error) +} + +// NewProjectServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewProjectServiceHandler(svc ProjectServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + projectServiceMethods := v1.File_ctrl_v1_project_proto.Services().ByName("ProjectService").Methods() + projectServiceCreateProjectHandler := connect.NewUnaryHandler( + ProjectServiceCreateProjectProcedure, + svc.CreateProject, + connect.WithSchema(projectServiceMethods.ByName("CreateProject")), + connect.WithHandlerOptions(opts...), + ) + return "/ctrl.v1.ProjectService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ProjectServiceCreateProjectProcedure: + projectServiceCreateProjectHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedProjectServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedProjectServiceHandler struct{} + +func (UnimplementedProjectServiceHandler) CreateProject(context.Context, *connect.Request[v1.CreateProjectRequest]) (*connect.Response[v1.CreateProjectResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ctrl.v1.ProjectService.CreateProject is not implemented")) +} diff --git a/go/gen/proto/ctrl/v1/environment.pb.go b/go/gen/proto/ctrl/v1/environment.pb.go new file mode 100644 index 0000000000..22a6ab7d15 --- /dev/null +++ b/go/gen/proto/ctrl/v1/environment.pb.go @@ -0,0 +1,263 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.8 +// protoc (unknown) +// source: ctrl/v1/environment.proto + +package ctrlv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EnvironmentType int32 + +const ( + EnvironmentType_ENVIRONMENT_TYPE_UNSPECIFIED EnvironmentType = 0 + EnvironmentType_ENVIRONMENT_TYPE_DEVELOPMENT EnvironmentType = 1 + EnvironmentType_ENVIRONMENT_TYPE_PREVIEW EnvironmentType = 2 + EnvironmentType_ENVIRONMENT_TYPE_PRODUCTION EnvironmentType = 3 +) + +// Enum value maps for EnvironmentType. +var ( + EnvironmentType_name = map[int32]string{ + 0: "ENVIRONMENT_TYPE_UNSPECIFIED", + 1: "ENVIRONMENT_TYPE_DEVELOPMENT", + 2: "ENVIRONMENT_TYPE_PREVIEW", + 3: "ENVIRONMENT_TYPE_PRODUCTION", + } + EnvironmentType_value = map[string]int32{ + "ENVIRONMENT_TYPE_UNSPECIFIED": 0, + "ENVIRONMENT_TYPE_DEVELOPMENT": 1, + "ENVIRONMENT_TYPE_PREVIEW": 2, + "ENVIRONMENT_TYPE_PRODUCTION": 3, + } +) + +func (x EnvironmentType) Enum() *EnvironmentType { + p := new(EnvironmentType) + *p = x + return p +} + +func (x EnvironmentType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EnvironmentType) Descriptor() protoreflect.EnumDescriptor { + return file_ctrl_v1_environment_proto_enumTypes[0].Descriptor() +} + +func (EnvironmentType) Type() protoreflect.EnumType { + return &file_ctrl_v1_environment_proto_enumTypes[0] +} + +func (x EnvironmentType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EnvironmentType.Descriptor instead. +func (EnvironmentType) EnumDescriptor() ([]byte, []int) { + return file_ctrl_v1_environment_proto_rawDescGZIP(), []int{0} +} + +type CreateEnvironmentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Slug string `protobuf:"bytes,2,opt,name=slug,proto3" json:"slug,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Type EnvironmentType `protobuf:"varint,4,opt,name=type,proto3,enum=ctrl.v1.EnvironmentType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateEnvironmentRequest) Reset() { + *x = CreateEnvironmentRequest{} + mi := &file_ctrl_v1_environment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEnvironmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEnvironmentRequest) ProtoMessage() {} + +func (x *CreateEnvironmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_ctrl_v1_environment_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEnvironmentRequest.ProtoReflect.Descriptor instead. +func (*CreateEnvironmentRequest) Descriptor() ([]byte, []int) { + return file_ctrl_v1_environment_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateEnvironmentRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *CreateEnvironmentRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *CreateEnvironmentRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateEnvironmentRequest) GetType() EnvironmentType { + if x != nil { + return x.Type + } + return EnvironmentType_ENVIRONMENT_TYPE_UNSPECIFIED +} + +type CreateEnvironmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateEnvironmentResponse) Reset() { + *x = CreateEnvironmentResponse{} + mi := &file_ctrl_v1_environment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEnvironmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEnvironmentResponse) ProtoMessage() {} + +func (x *CreateEnvironmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_ctrl_v1_environment_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEnvironmentResponse.ProtoReflect.Descriptor instead. +func (*CreateEnvironmentResponse) Descriptor() ([]byte, []int) { + return file_ctrl_v1_environment_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateEnvironmentResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_ctrl_v1_environment_proto protoreflect.FileDescriptor + +const file_ctrl_v1_environment_proto_rawDesc = "" + + "\n" + + "\x19ctrl/v1/environment.proto\x12\actrl.v1\"\x9d\x01\n" + + "\x18CreateEnvironmentRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\x12\x12\n" + + "\x04slug\x18\x02 \x01(\tR\x04slug\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12,\n" + + "\x04type\x18\x04 \x01(\x0e2\x18.ctrl.v1.EnvironmentTypeR\x04type\"+\n" + + "\x19CreateEnvironmentResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id*\x94\x01\n" + + "\x0fEnvironmentType\x12 \n" + + "\x1cENVIRONMENT_TYPE_UNSPECIFIED\x10\x00\x12 \n" + + "\x1cENVIRONMENT_TYPE_DEVELOPMENT\x10\x01\x12\x1c\n" + + "\x18ENVIRONMENT_TYPE_PREVIEW\x10\x02\x12\x1f\n" + + "\x1bENVIRONMENT_TYPE_PRODUCTION\x10\x032r\n" + + "\x12EnvironmentService\x12\\\n" + + "\x11CreateEnvironment\x12!.ctrl.v1.CreateEnvironmentRequest\x1a\".ctrl.v1.CreateEnvironmentResponse\"\x00B\x92\x01\n" + + "\vcom.ctrl.v1B\x10EnvironmentProtoP\x01Z4github.com/unkeyed/unkey/go/gen/proto/ctrl/v1;ctrlv1\xa2\x02\x03CXX\xaa\x02\aCtrl.V1\xca\x02\aCtrl\\V1\xe2\x02\x13Ctrl\\V1\\GPBMetadata\xea\x02\bCtrl::V1b\x06proto3" + +var ( + file_ctrl_v1_environment_proto_rawDescOnce sync.Once + file_ctrl_v1_environment_proto_rawDescData []byte +) + +func file_ctrl_v1_environment_proto_rawDescGZIP() []byte { + file_ctrl_v1_environment_proto_rawDescOnce.Do(func() { + file_ctrl_v1_environment_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ctrl_v1_environment_proto_rawDesc), len(file_ctrl_v1_environment_proto_rawDesc))) + }) + return file_ctrl_v1_environment_proto_rawDescData +} + +var file_ctrl_v1_environment_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ctrl_v1_environment_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_ctrl_v1_environment_proto_goTypes = []any{ + (EnvironmentType)(0), // 0: ctrl.v1.EnvironmentType + (*CreateEnvironmentRequest)(nil), // 1: ctrl.v1.CreateEnvironmentRequest + (*CreateEnvironmentResponse)(nil), // 2: ctrl.v1.CreateEnvironmentResponse +} +var file_ctrl_v1_environment_proto_depIdxs = []int32{ + 0, // 0: ctrl.v1.CreateEnvironmentRequest.type:type_name -> ctrl.v1.EnvironmentType + 1, // 1: ctrl.v1.EnvironmentService.CreateEnvironment:input_type -> ctrl.v1.CreateEnvironmentRequest + 2, // 2: ctrl.v1.EnvironmentService.CreateEnvironment:output_type -> ctrl.v1.CreateEnvironmentResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_ctrl_v1_environment_proto_init() } +func file_ctrl_v1_environment_proto_init() { + if File_ctrl_v1_environment_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_ctrl_v1_environment_proto_rawDesc), len(file_ctrl_v1_environment_proto_rawDesc)), + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ctrl_v1_environment_proto_goTypes, + DependencyIndexes: file_ctrl_v1_environment_proto_depIdxs, + EnumInfos: file_ctrl_v1_environment_proto_enumTypes, + MessageInfos: file_ctrl_v1_environment_proto_msgTypes, + }.Build() + File_ctrl_v1_environment_proto = out.File + file_ctrl_v1_environment_proto_goTypes = nil + file_ctrl_v1_environment_proto_depIdxs = nil +} diff --git a/go/gen/proto/ctrl/v1/project.pb.go b/go/gen/proto/ctrl/v1/project.pb.go new file mode 100644 index 0000000000..05f39852d3 --- /dev/null +++ b/go/gen/proto/ctrl/v1/project.pb.go @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.8 +// protoc (unknown) +// source: ctrl/v1/project.proto + +package ctrlv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateProjectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Slug string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"` + GitRepository string `protobuf:"bytes,4,opt,name=git_repository,json=gitRepository,proto3" json:"git_repository,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateProjectRequest) Reset() { + *x = CreateProjectRequest{} + mi := &file_ctrl_v1_project_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProjectRequest) ProtoMessage() {} + +func (x *CreateProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_ctrl_v1_project_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateProjectRequest.ProtoReflect.Descriptor instead. +func (*CreateProjectRequest) Descriptor() ([]byte, []int) { + return file_ctrl_v1_project_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateProjectRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *CreateProjectRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateProjectRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *CreateProjectRequest) GetGitRepository() string { + if x != nil { + return x.GitRepository + } + return "" +} + +type CreateProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateProjectResponse) Reset() { + *x = CreateProjectResponse{} + mi := &file_ctrl_v1_project_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProjectResponse) ProtoMessage() {} + +func (x *CreateProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_ctrl_v1_project_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateProjectResponse.ProtoReflect.Descriptor instead. +func (*CreateProjectResponse) Descriptor() ([]byte, []int) { + return file_ctrl_v1_project_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateProjectResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +var File_ctrl_v1_project_proto protoreflect.FileDescriptor + +const file_ctrl_v1_project_proto_rawDesc = "" + + "\n" + + "\x15ctrl/v1/project.proto\x12\actrl.v1\"\x88\x01\n" + + "\x14CreateProjectRequest\x12!\n" + + "\fworkspace_id\x18\x01 \x01(\tR\vworkspaceId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04slug\x18\x03 \x01(\tR\x04slug\x12%\n" + + "\x0egit_repository\x18\x04 \x01(\tR\rgitRepository\"'\n" + + "\x15CreateProjectResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id2b\n" + + "\x0eProjectService\x12P\n" + + "\rCreateProject\x12\x1d.ctrl.v1.CreateProjectRequest\x1a\x1e.ctrl.v1.CreateProjectResponse\"\x00B\x8e\x01\n" + + "\vcom.ctrl.v1B\fProjectProtoP\x01Z4github.com/unkeyed/unkey/go/gen/proto/ctrl/v1;ctrlv1\xa2\x02\x03CXX\xaa\x02\aCtrl.V1\xca\x02\aCtrl\\V1\xe2\x02\x13Ctrl\\V1\\GPBMetadata\xea\x02\bCtrl::V1b\x06proto3" + +var ( + file_ctrl_v1_project_proto_rawDescOnce sync.Once + file_ctrl_v1_project_proto_rawDescData []byte +) + +func file_ctrl_v1_project_proto_rawDescGZIP() []byte { + file_ctrl_v1_project_proto_rawDescOnce.Do(func() { + file_ctrl_v1_project_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ctrl_v1_project_proto_rawDesc), len(file_ctrl_v1_project_proto_rawDesc))) + }) + return file_ctrl_v1_project_proto_rawDescData +} + +var file_ctrl_v1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_ctrl_v1_project_proto_goTypes = []any{ + (*CreateProjectRequest)(nil), // 0: ctrl.v1.CreateProjectRequest + (*CreateProjectResponse)(nil), // 1: ctrl.v1.CreateProjectResponse +} +var file_ctrl_v1_project_proto_depIdxs = []int32{ + 0, // 0: ctrl.v1.ProjectService.CreateProject:input_type -> ctrl.v1.CreateProjectRequest + 1, // 1: ctrl.v1.ProjectService.CreateProject:output_type -> ctrl.v1.CreateProjectResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ctrl_v1_project_proto_init() } +func file_ctrl_v1_project_proto_init() { + if File_ctrl_v1_project_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_ctrl_v1_project_proto_rawDesc), len(file_ctrl_v1_project_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ctrl_v1_project_proto_goTypes, + DependencyIndexes: file_ctrl_v1_project_proto_depIdxs, + MessageInfos: file_ctrl_v1_project_proto_msgTypes, + }.Build() + File_ctrl_v1_project_proto = out.File + file_ctrl_v1_project_proto_goTypes = nil + file_ctrl_v1_project_proto_depIdxs = nil +} diff --git a/go/gen/proto/hydra/v1/environment.pb.go b/go/gen/proto/hydra/v1/environment.pb.go new file mode 100644 index 0000000000..613ab9a98f --- /dev/null +++ b/go/gen/proto/hydra/v1/environment.pb.go @@ -0,0 +1,268 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.8 +// protoc (unknown) +// source: hydra/v1/environment.proto + +package hydrav1 + +import ( + _ "github.com/restatedev/sdk-go/generated/dev/restate/sdk" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateEnvironmentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + EnvironmentId string `protobuf:"bytes,2,opt,name=environment_id,json=environmentId,proto3" json:"environment_id,omitempty"` + Gateway *CreateEnvironmentRequest_Gateway `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateEnvironmentRequest) Reset() { + *x = CreateEnvironmentRequest{} + mi := &file_hydra_v1_environment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEnvironmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEnvironmentRequest) ProtoMessage() {} + +func (x *CreateEnvironmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_hydra_v1_environment_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEnvironmentRequest.ProtoReflect.Descriptor instead. +func (*CreateEnvironmentRequest) Descriptor() ([]byte, []int) { + return file_hydra_v1_environment_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateEnvironmentRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *CreateEnvironmentRequest) GetEnvironmentId() string { + if x != nil { + return x.EnvironmentId + } + return "" +} + +func (x *CreateEnvironmentRequest) GetGateway() *CreateEnvironmentRequest_Gateway { + if x != nil { + return x.Gateway + } + return nil +} + +type CreateEnvironmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateEnvironmentResponse) Reset() { + *x = CreateEnvironmentResponse{} + mi := &file_hydra_v1_environment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEnvironmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEnvironmentResponse) ProtoMessage() {} + +func (x *CreateEnvironmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_hydra_v1_environment_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEnvironmentResponse.ProtoReflect.Descriptor instead. +func (*CreateEnvironmentResponse) Descriptor() ([]byte, []int) { + return file_hydra_v1_environment_proto_rawDescGZIP(), []int{1} +} + +type CreateEnvironmentRequest_Gateway struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + Replicas uint32 `protobuf:"varint,3,opt,name=replicas,proto3" json:"replicas,omitempty"` + CpuMillicores uint32 `protobuf:"varint,4,opt,name=cpu_millicores,json=cpuMillicores,proto3" json:"cpu_millicores,omitempty"` + MemorySizeMib uint64 `protobuf:"varint,5,opt,name=memory_size_mib,json=memorySizeMib,proto3" json:"memory_size_mib,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateEnvironmentRequest_Gateway) Reset() { + *x = CreateEnvironmentRequest_Gateway{} + mi := &file_hydra_v1_environment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEnvironmentRequest_Gateway) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEnvironmentRequest_Gateway) ProtoMessage() {} + +func (x *CreateEnvironmentRequest_Gateway) ProtoReflect() protoreflect.Message { + mi := &file_hydra_v1_environment_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEnvironmentRequest_Gateway.ProtoReflect.Descriptor instead. +func (*CreateEnvironmentRequest_Gateway) Descriptor() ([]byte, []int) { + return file_hydra_v1_environment_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *CreateEnvironmentRequest_Gateway) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *CreateEnvironmentRequest_Gateway) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *CreateEnvironmentRequest_Gateway) GetReplicas() uint32 { + if x != nil { + return x.Replicas + } + return 0 +} + +func (x *CreateEnvironmentRequest_Gateway) GetCpuMillicores() uint32 { + if x != nil { + return x.CpuMillicores + } + return 0 +} + +func (x *CreateEnvironmentRequest_Gateway) GetMemorySizeMib() uint64 { + if x != nil { + return x.MemorySizeMib + } + return 0 +} + +var File_hydra_v1_environment_proto protoreflect.FileDescriptor + +const file_hydra_v1_environment_proto_rawDesc = "" + + "\n" + + "\x1ahydra/v1/environment.proto\x12\bhydra.v1\x1a\x18dev/restate/sdk/go.proto\"\xc7\x02\n" + + "\x18CreateEnvironmentRequest\x12!\n" + + "\fworkspace_id\x18\x01 \x01(\tR\vworkspaceId\x12%\n" + + "\x0eenvironment_id\x18\x02 \x01(\tR\renvironmentId\x12D\n" + + "\agateway\x18\x03 \x01(\v2*.hydra.v1.CreateEnvironmentRequest.GatewayR\agateway\x1a\x9a\x01\n" + + "\aGateway\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + + "\x05image\x18\x02 \x01(\tR\x05image\x12\x1a\n" + + "\breplicas\x18\x03 \x01(\rR\breplicas\x12%\n" + + "\x0ecpu_millicores\x18\x04 \x01(\rR\rcpuMillicores\x12&\n" + + "\x0fmemory_size_mib\x18\x05 \x01(\x04R\rmemorySizeMib\"\x1b\n" + + "\x19CreateEnvironmentResponse2z\n" + + "\x12EnvironmentService\x12^\n" + + "\x11CreateEnvironment\x12\".hydra.v1.CreateEnvironmentRequest\x1a#.hydra.v1.CreateEnvironmentResponse\"\x00\x1a\x04\x98\x80\x01\x01B\x99\x01\n" + + "\fcom.hydra.v1B\x10EnvironmentProtoP\x01Z6github.com/unkeyed/unkey/go/gen/proto/hydra/v1;hydrav1\xa2\x02\x03HXX\xaa\x02\bHydra.V1\xca\x02\bHydra\\V1\xe2\x02\x14Hydra\\V1\\GPBMetadata\xea\x02\tHydra::V1b\x06proto3" + +var ( + file_hydra_v1_environment_proto_rawDescOnce sync.Once + file_hydra_v1_environment_proto_rawDescData []byte +) + +func file_hydra_v1_environment_proto_rawDescGZIP() []byte { + file_hydra_v1_environment_proto_rawDescOnce.Do(func() { + file_hydra_v1_environment_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_hydra_v1_environment_proto_rawDesc), len(file_hydra_v1_environment_proto_rawDesc))) + }) + return file_hydra_v1_environment_proto_rawDescData +} + +var file_hydra_v1_environment_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_hydra_v1_environment_proto_goTypes = []any{ + (*CreateEnvironmentRequest)(nil), // 0: hydra.v1.CreateEnvironmentRequest + (*CreateEnvironmentResponse)(nil), // 1: hydra.v1.CreateEnvironmentResponse + (*CreateEnvironmentRequest_Gateway)(nil), // 2: hydra.v1.CreateEnvironmentRequest.Gateway +} +var file_hydra_v1_environment_proto_depIdxs = []int32{ + 2, // 0: hydra.v1.CreateEnvironmentRequest.gateway:type_name -> hydra.v1.CreateEnvironmentRequest.Gateway + 0, // 1: hydra.v1.EnvironmentService.CreateEnvironment:input_type -> hydra.v1.CreateEnvironmentRequest + 1, // 2: hydra.v1.EnvironmentService.CreateEnvironment:output_type -> hydra.v1.CreateEnvironmentResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_hydra_v1_environment_proto_init() } +func file_hydra_v1_environment_proto_init() { + if File_hydra_v1_environment_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_hydra_v1_environment_proto_rawDesc), len(file_hydra_v1_environment_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_hydra_v1_environment_proto_goTypes, + DependencyIndexes: file_hydra_v1_environment_proto_depIdxs, + MessageInfos: file_hydra_v1_environment_proto_msgTypes, + }.Build() + File_hydra_v1_environment_proto = out.File + file_hydra_v1_environment_proto_goTypes = nil + file_hydra_v1_environment_proto_depIdxs = nil +} diff --git a/go/gen/proto/hydra/v1/environment_restate.pb.go b/go/gen/proto/hydra/v1/environment_restate.pb.go new file mode 100644 index 0000000000..70777167a0 --- /dev/null +++ b/go/gen/proto/hydra/v1/environment_restate.pb.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-go-restate. DO NOT EDIT. +// versions: +// - protoc-gen-go-restate v0.1 +// - protoc (unknown) +// source: hydra/v1/environment.proto + +package hydrav1 + +import ( + fmt "fmt" + sdk_go "github.com/restatedev/sdk-go" + encoding "github.com/restatedev/sdk-go/encoding" + ingress "github.com/restatedev/sdk-go/ingress" +) + +// EnvironmentServiceClient is the client API for hydra.v1.EnvironmentService service. +type EnvironmentServiceClient interface { + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + CreateEnvironment(opts ...sdk_go.ClientOption) sdk_go.Client[*CreateEnvironmentRequest, *CreateEnvironmentResponse] +} + +type environmentServiceClient struct { + ctx sdk_go.Context + key string + options []sdk_go.ClientOption +} + +func NewEnvironmentServiceClient(ctx sdk_go.Context, key string, opts ...sdk_go.ClientOption) EnvironmentServiceClient { + cOpts := append([]sdk_go.ClientOption{sdk_go.WithProtoJSON}, opts...) + return &environmentServiceClient{ + ctx, + key, + cOpts, + } +} +func (c *environmentServiceClient) CreateEnvironment(opts ...sdk_go.ClientOption) sdk_go.Client[*CreateEnvironmentRequest, *CreateEnvironmentResponse] { + cOpts := c.options + if len(opts) > 0 { + cOpts = append(append([]sdk_go.ClientOption{}, cOpts...), opts...) + } + return sdk_go.WithRequestType[*CreateEnvironmentRequest](sdk_go.Object[*CreateEnvironmentResponse](c.ctx, "hydra.v1.EnvironmentService", c.key, "CreateEnvironment", cOpts...)) +} + +// EnvironmentServiceIngressClient is the ingress client API for hydra.v1.EnvironmentService service. +// +// This client is used to call the service from outside of a Restate context. +type EnvironmentServiceIngressClient interface { + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + CreateEnvironment() ingress.Requester[*CreateEnvironmentRequest, *CreateEnvironmentResponse] +} + +type environmentServiceIngressClient struct { + client *ingress.Client + serviceName string + key string +} + +func NewEnvironmentServiceIngressClient(client *ingress.Client, key string) EnvironmentServiceIngressClient { + return &environmentServiceIngressClient{ + client, + "hydra.v1.EnvironmentService", + key, + } +} + +func (c *environmentServiceIngressClient) CreateEnvironment() ingress.Requester[*CreateEnvironmentRequest, *CreateEnvironmentResponse] { + codec := encoding.ProtoJSONCodec + return ingress.NewRequester[*CreateEnvironmentRequest, *CreateEnvironmentResponse](c.client, c.serviceName, "CreateEnvironment", &c.key, &codec) +} + +// EnvironmentServiceServer is the server API for hydra.v1.EnvironmentService service. +// All implementations should embed UnimplementedEnvironmentServiceServer +// for forward compatibility. +type EnvironmentServiceServer interface { + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + CreateEnvironment(ctx sdk_go.ObjectContext, req *CreateEnvironmentRequest) (*CreateEnvironmentResponse, error) +} + +// UnimplementedEnvironmentServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedEnvironmentServiceServer struct{} + +func (UnimplementedEnvironmentServiceServer) CreateEnvironment(ctx sdk_go.ObjectContext, req *CreateEnvironmentRequest) (*CreateEnvironmentResponse, error) { + return nil, sdk_go.TerminalError(fmt.Errorf("method CreateEnvironment not implemented"), 501) +} +func (UnimplementedEnvironmentServiceServer) testEmbeddedByValue() {} + +// UnsafeEnvironmentServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EnvironmentServiceServer will +// result in compilation errors. +type UnsafeEnvironmentServiceServer interface { + mustEmbedUnimplementedEnvironmentServiceServer() +} + +func NewEnvironmentServiceServer(srv EnvironmentServiceServer, opts ...sdk_go.ServiceDefinitionOption) sdk_go.ServiceDefinition { + // If the following call panics, it indicates UnimplementedEnvironmentServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + sOpts := append([]sdk_go.ServiceDefinitionOption{sdk_go.WithProtoJSON}, opts...) + router := sdk_go.NewObject("hydra.v1.EnvironmentService", sOpts...) + router = router.Handler("CreateEnvironment", sdk_go.NewObjectHandler(srv.CreateEnvironment)) + return router +} diff --git a/go/gen/proto/hydra/v1/project.pb.go b/go/gen/proto/hydra/v1/project.pb.go new file mode 100644 index 0000000000..7c0dc46e78 --- /dev/null +++ b/go/gen/proto/hydra/v1/project.pb.go @@ -0,0 +1,203 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.8 +// protoc (unknown) +// source: hydra/v1/project.proto + +package hydrav1 + +import ( + _ "github.com/restatedev/sdk-go/generated/dev/restate/sdk" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateProjectRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Slug string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"` + GitRepository string `protobuf:"bytes,4,opt,name=git_repository,json=gitRepository,proto3" json:"git_repository,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateProjectRequest) Reset() { + *x = CreateProjectRequest{} + mi := &file_hydra_v1_project_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProjectRequest) ProtoMessage() {} + +func (x *CreateProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_hydra_v1_project_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateProjectRequest.ProtoReflect.Descriptor instead. +func (*CreateProjectRequest) Descriptor() ([]byte, []int) { + return file_hydra_v1_project_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateProjectRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *CreateProjectRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateProjectRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *CreateProjectRequest) GetGitRepository() string { + if x != nil { + return x.GitRepository + } + return "" +} + +type CreateProjectResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateProjectResponse) Reset() { + *x = CreateProjectResponse{} + mi := &file_hydra_v1_project_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateProjectResponse) ProtoMessage() {} + +func (x *CreateProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_hydra_v1_project_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateProjectResponse.ProtoReflect.Descriptor instead. +func (*CreateProjectResponse) Descriptor() ([]byte, []int) { + return file_hydra_v1_project_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateProjectResponse) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +var File_hydra_v1_project_proto protoreflect.FileDescriptor + +const file_hydra_v1_project_proto_rawDesc = "" + + "\n" + + "\x16hydra/v1/project.proto\x12\bhydra.v1\x1a\x18dev/restate/sdk/go.proto\"\x88\x01\n" + + "\x14CreateProjectRequest\x12!\n" + + "\fworkspace_id\x18\x01 \x01(\tR\vworkspaceId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04slug\x18\x03 \x01(\tR\x04slug\x12%\n" + + "\x0egit_repository\x18\x04 \x01(\tR\rgitRepository\"6\n" + + "\x15CreateProjectResponse\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId2j\n" + + "\x0eProjectService\x12R\n" + + "\rCreateProject\x12\x1e.hydra.v1.CreateProjectRequest\x1a\x1f.hydra.v1.CreateProjectResponse\"\x00\x1a\x04\x98\x80\x01\x01B\x95\x01\n" + + "\fcom.hydra.v1B\fProjectProtoP\x01Z6github.com/unkeyed/unkey/go/gen/proto/hydra/v1;hydrav1\xa2\x02\x03HXX\xaa\x02\bHydra.V1\xca\x02\bHydra\\V1\xe2\x02\x14Hydra\\V1\\GPBMetadata\xea\x02\tHydra::V1b\x06proto3" + +var ( + file_hydra_v1_project_proto_rawDescOnce sync.Once + file_hydra_v1_project_proto_rawDescData []byte +) + +func file_hydra_v1_project_proto_rawDescGZIP() []byte { + file_hydra_v1_project_proto_rawDescOnce.Do(func() { + file_hydra_v1_project_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_hydra_v1_project_proto_rawDesc), len(file_hydra_v1_project_proto_rawDesc))) + }) + return file_hydra_v1_project_proto_rawDescData +} + +var file_hydra_v1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_hydra_v1_project_proto_goTypes = []any{ + (*CreateProjectRequest)(nil), // 0: hydra.v1.CreateProjectRequest + (*CreateProjectResponse)(nil), // 1: hydra.v1.CreateProjectResponse +} +var file_hydra_v1_project_proto_depIdxs = []int32{ + 0, // 0: hydra.v1.ProjectService.CreateProject:input_type -> hydra.v1.CreateProjectRequest + 1, // 1: hydra.v1.ProjectService.CreateProject:output_type -> hydra.v1.CreateProjectResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_hydra_v1_project_proto_init() } +func file_hydra_v1_project_proto_init() { + if File_hydra_v1_project_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_hydra_v1_project_proto_rawDesc), len(file_hydra_v1_project_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_hydra_v1_project_proto_goTypes, + DependencyIndexes: file_hydra_v1_project_proto_depIdxs, + MessageInfos: file_hydra_v1_project_proto_msgTypes, + }.Build() + File_hydra_v1_project_proto = out.File + file_hydra_v1_project_proto_goTypes = nil + file_hydra_v1_project_proto_depIdxs = nil +} diff --git a/go/gen/proto/hydra/v1/project_restate.pb.go b/go/gen/proto/hydra/v1/project_restate.pb.go new file mode 100644 index 0000000000..1d8f6a05d9 --- /dev/null +++ b/go/gen/proto/hydra/v1/project_restate.pb.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-go-restate. DO NOT EDIT. +// versions: +// - protoc-gen-go-restate v0.1 +// - protoc (unknown) +// source: hydra/v1/project.proto + +package hydrav1 + +import ( + fmt "fmt" + sdk_go "github.com/restatedev/sdk-go" + encoding "github.com/restatedev/sdk-go/encoding" + ingress "github.com/restatedev/sdk-go/ingress" +) + +// ProjectServiceClient is the client API for hydra.v1.ProjectService service. +type ProjectServiceClient interface { + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + CreateProject(opts ...sdk_go.ClientOption) sdk_go.Client[*CreateProjectRequest, *CreateProjectResponse] +} + +type projectServiceClient struct { + ctx sdk_go.Context + key string + options []sdk_go.ClientOption +} + +func NewProjectServiceClient(ctx sdk_go.Context, key string, opts ...sdk_go.ClientOption) ProjectServiceClient { + cOpts := append([]sdk_go.ClientOption{sdk_go.WithProtoJSON}, opts...) + return &projectServiceClient{ + ctx, + key, + cOpts, + } +} +func (c *projectServiceClient) CreateProject(opts ...sdk_go.ClientOption) sdk_go.Client[*CreateProjectRequest, *CreateProjectResponse] { + cOpts := c.options + if len(opts) > 0 { + cOpts = append(append([]sdk_go.ClientOption{}, cOpts...), opts...) + } + return sdk_go.WithRequestType[*CreateProjectRequest](sdk_go.Object[*CreateProjectResponse](c.ctx, "hydra.v1.ProjectService", c.key, "CreateProject", cOpts...)) +} + +// ProjectServiceIngressClient is the ingress client API for hydra.v1.ProjectService service. +// +// This client is used to call the service from outside of a Restate context. +type ProjectServiceIngressClient interface { + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + CreateProject() ingress.Requester[*CreateProjectRequest, *CreateProjectResponse] +} + +type projectServiceIngressClient struct { + client *ingress.Client + serviceName string + key string +} + +func NewProjectServiceIngressClient(client *ingress.Client, key string) ProjectServiceIngressClient { + return &projectServiceIngressClient{ + client, + "hydra.v1.ProjectService", + key, + } +} + +func (c *projectServiceIngressClient) CreateProject() ingress.Requester[*CreateProjectRequest, *CreateProjectResponse] { + codec := encoding.ProtoJSONCodec + return ingress.NewRequester[*CreateProjectRequest, *CreateProjectResponse](c.client, c.serviceName, "CreateProject", &c.key, &codec) +} + +// ProjectServiceServer is the server API for hydra.v1.ProjectService service. +// All implementations should embed UnimplementedProjectServiceServer +// for forward compatibility. +type ProjectServiceServer interface { + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + CreateProject(ctx sdk_go.ObjectContext, req *CreateProjectRequest) (*CreateProjectResponse, error) +} + +// UnimplementedProjectServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedProjectServiceServer struct{} + +func (UnimplementedProjectServiceServer) CreateProject(ctx sdk_go.ObjectContext, req *CreateProjectRequest) (*CreateProjectResponse, error) { + return nil, sdk_go.TerminalError(fmt.Errorf("method CreateProject not implemented"), 501) +} +func (UnimplementedProjectServiceServer) testEmbeddedByValue() {} + +// UnsafeProjectServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ProjectServiceServer will +// result in compilation errors. +type UnsafeProjectServiceServer interface { + mustEmbedUnimplementedProjectServiceServer() +} + +func NewProjectServiceServer(srv ProjectServiceServer, opts ...sdk_go.ServiceDefinitionOption) sdk_go.ServiceDefinition { + // If the following call panics, it indicates UnimplementedProjectServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + sOpts := append([]sdk_go.ServiceDefinitionOption{sdk_go.WithProtoJSON}, opts...) + router := sdk_go.NewObject("hydra.v1.ProjectService", sOpts...) + router = router.Handler("CreateProject", sdk_go.NewObjectHandler(srv.CreateProject)) + return router +} diff --git a/go/pkg/db/bulk_environment_insert.sql_generated.go b/go/pkg/db/bulk_environment_insert.sql_generated.go new file mode 100644 index 0000000000..bf683304d8 --- /dev/null +++ b/go/pkg/db/bulk_environment_insert.sql_generated.go @@ -0,0 +1,44 @@ +// Code generated by sqlc bulk insert plugin. DO NOT EDIT. + +package db + +import ( + "context" + "fmt" + "strings" +) + +// bulkInsertEnvironment is the base query for bulk insert +const bulkInsertEnvironment = `INSERT INTO environments ( id, workspace_id, project_id, slug, description, created_at, updated_at ) VALUES %s` + +// InsertEnvironments performs bulk insert in a single query +func (q *BulkQueries) InsertEnvironments(ctx context.Context, db DBTX, args []InsertEnvironmentParams) error { + + if len(args) == 0 { + return nil + } + + // Build the bulk insert query + valueClauses := make([]string, len(args)) + for i := range args { + valueClauses[i] = "( ?, ?, ?, ?, ?, ?, ? )" + } + + bulkQuery := fmt.Sprintf(bulkInsertEnvironment, strings.Join(valueClauses, ", ")) + + // Collect all arguments + var allArgs []any + for _, arg := range args { + allArgs = append(allArgs, arg.ID) + allArgs = append(allArgs, arg.WorkspaceID) + allArgs = append(allArgs, arg.ProjectID) + allArgs = append(allArgs, arg.Slug) + allArgs = append(allArgs, arg.Description) + allArgs = append(allArgs, arg.CreatedAt) + allArgs = append(allArgs, arg.UpdatedAt) + } + + // Execute the bulk insert + _, err := db.ExecContext(ctx, bulkQuery, allArgs...) + return err +} diff --git a/go/pkg/db/environment_find_by_id.sql_generated.go b/go/pkg/db/environment_find_by_id.sql_generated.go index 7f16aa6d61..33ba184728 100644 --- a/go/pkg/db/environment_find_by_id.sql_generated.go +++ b/go/pkg/db/environment_find_by_id.sql_generated.go @@ -7,7 +7,6 @@ package db import ( "context" - "database/sql" ) const findEnvironmentById = `-- name: FindEnvironmentById :one @@ -17,11 +16,11 @@ WHERE id = ? ` type FindEnvironmentByIdRow struct { - ID string `db:"id"` - WorkspaceID string `db:"workspace_id"` - ProjectID string `db:"project_id"` - Slug string `db:"slug"` - Description sql.NullString `db:"description"` + ID string `db:"id"` + WorkspaceID string `db:"workspace_id"` + ProjectID string `db:"project_id"` + Slug string `db:"slug"` + Description string `db:"description"` } // FindEnvironmentById diff --git a/go/pkg/db/environment_find_by_project_id_and_slug.sql_generated.go b/go/pkg/db/environment_find_by_project_id_and_slug.sql_generated.go index fdd3a719dd..337f5791e1 100644 --- a/go/pkg/db/environment_find_by_project_id_and_slug.sql_generated.go +++ b/go/pkg/db/environment_find_by_project_id_and_slug.sql_generated.go @@ -7,7 +7,6 @@ package db import ( "context" - "database/sql" ) const findEnvironmentByProjectIdAndSlug = `-- name: FindEnvironmentByProjectIdAndSlug :one @@ -25,11 +24,11 @@ type FindEnvironmentByProjectIdAndSlugParams struct { } type FindEnvironmentByProjectIdAndSlugRow struct { - ID string `db:"id"` - WorkspaceID string `db:"workspace_id"` - ProjectID string `db:"project_id"` - Slug string `db:"slug"` - Description sql.NullString `db:"description"` + ID string `db:"id"` + WorkspaceID string `db:"workspace_id"` + ProjectID string `db:"project_id"` + Slug string `db:"slug"` + Description string `db:"description"` } // FindEnvironmentByProjectIdAndSlug diff --git a/go/pkg/db/environment_insert.sql_generated.go b/go/pkg/db/environment_insert.sql_generated.go new file mode 100644 index 0000000000..924e3f8fe0 --- /dev/null +++ b/go/pkg/db/environment_insert.sql_generated.go @@ -0,0 +1,61 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.29.0 +// source: environment_insert.sql + +package db + +import ( + "context" + "database/sql" +) + +const insertEnvironment = `-- name: InsertEnvironment :exec +INSERT INTO environments ( + id, + workspace_id, + project_id, + slug, + description, + created_at, + updated_at +) VALUES ( + ?, ?, ?, ?, ?, ?, ? +) +` + +type InsertEnvironmentParams struct { + ID string `db:"id"` + WorkspaceID string `db:"workspace_id"` + ProjectID string `db:"project_id"` + Slug string `db:"slug"` + Description string `db:"description"` + CreatedAt int64 `db:"created_at"` + UpdatedAt sql.NullInt64 `db:"updated_at"` +} + +// InsertEnvironment +// +// INSERT INTO environments ( +// id, +// workspace_id, +// project_id, +// slug, +// description, +// created_at, +// updated_at +// ) VALUES ( +// ?, ?, ?, ?, ?, ?, ? +// ) +func (q *Queries) InsertEnvironment(ctx context.Context, db DBTX, arg InsertEnvironmentParams) error { + _, err := db.ExecContext(ctx, insertEnvironment, + arg.ID, + arg.WorkspaceID, + arg.ProjectID, + arg.Slug, + arg.Description, + arg.CreatedAt, + arg.UpdatedAt, + ) + return err +} diff --git a/go/pkg/db/models_generated.go b/go/pkg/db/models_generated.go index 0ba490e56c..35381cc47c 100644 --- a/go/pkg/db/models_generated.go +++ b/go/pkg/db/models_generated.go @@ -770,15 +770,15 @@ type EncryptedKey struct { } type Environment struct { - ID string `db:"id"` - WorkspaceID string `db:"workspace_id"` - ProjectID string `db:"project_id"` - Slug string `db:"slug"` - Description sql.NullString `db:"description"` - GatewayConfig []byte `db:"gateway_config"` - DeleteProtection sql.NullBool `db:"delete_protection"` - CreatedAt int64 `db:"created_at"` - UpdatedAt sql.NullInt64 `db:"updated_at"` + ID string `db:"id"` + WorkspaceID string `db:"workspace_id"` + ProjectID string `db:"project_id"` + Slug string `db:"slug"` + Description string `db:"description"` + GatewayConfig []byte `db:"gateway_config"` + DeleteProtection sql.NullBool `db:"delete_protection"` + CreatedAt int64 `db:"created_at"` + UpdatedAt sql.NullInt64 `db:"updated_at"` } type Gateway struct { diff --git a/go/pkg/db/querier_bulk_generated.go b/go/pkg/db/querier_bulk_generated.go index 2b158a9595..3383c61f9a 100644 --- a/go/pkg/db/querier_bulk_generated.go +++ b/go/pkg/db/querier_bulk_generated.go @@ -15,6 +15,7 @@ type BulkQuerier interface { InsertClickhouseWorkspaceSettingses(ctx context.Context, db DBTX, args []InsertClickhouseWorkspaceSettingsParams) error InsertDeployments(ctx context.Context, db DBTX, args []InsertDeploymentParams) error InsertDeploymentSteps(ctx context.Context, db DBTX, args []InsertDeploymentStepParams) error + InsertEnvironments(ctx context.Context, db DBTX, args []InsertEnvironmentParams) error UpsertEnvironment(ctx context.Context, db DBTX, args []UpsertEnvironmentParams) error InsertGateways(ctx context.Context, db DBTX, args []InsertGatewayParams) error InsertIdentities(ctx context.Context, db DBTX, args []InsertIdentityParams) error diff --git a/go/pkg/db/querier_generated.go b/go/pkg/db/querier_generated.go index 4a99948c6d..83176d1b73 100644 --- a/go/pkg/db/querier_generated.go +++ b/go/pkg/db/querier_generated.go @@ -1144,6 +1144,20 @@ type Querier interface { // message = VALUES(message), // created_at = VALUES(created_at) InsertDeploymentStep(ctx context.Context, db DBTX, arg InsertDeploymentStepParams) error + //InsertEnvironment + // + // INSERT INTO environments ( + // id, + // workspace_id, + // project_id, + // slug, + // description, + // created_at, + // updated_at + // ) VALUES ( + // ?, ?, ?, ?, ?, ?, ? + // ) + InsertEnvironment(ctx context.Context, db DBTX, arg InsertEnvironmentParams) error //InsertGateway // // INSERT INTO gateways ( diff --git a/go/pkg/db/queries/environment_insert.sql b/go/pkg/db/queries/environment_insert.sql new file mode 100644 index 0000000000..564a15ccdb --- /dev/null +++ b/go/pkg/db/queries/environment_insert.sql @@ -0,0 +1,12 @@ +-- name: InsertEnvironment :exec +INSERT INTO environments ( + id, + workspace_id, + project_id, + slug, + description, + created_at, + updated_at +) VALUES ( + ?, ?, ?, ?, ?, ?, ? +); \ No newline at end of file diff --git a/go/pkg/db/schema.sql b/go/pkg/db/schema.sql index be0e139390..4f4ed80110 100644 --- a/go/pkg/db/schema.sql +++ b/go/pkg/db/schema.sql @@ -307,7 +307,7 @@ CREATE TABLE `environments` ( `workspace_id` varchar(256) NOT NULL, `project_id` varchar(256) NOT NULL, `slug` varchar(256) NOT NULL, - `description` varchar(255), + `description` varchar(255) NOT NULL DEFAULT '', `gateway_config` longblob NOT NULL, `delete_protection` boolean DEFAULT false, `created_at` bigint NOT NULL, diff --git a/go/proto/ctrl/v1/environment.proto b/go/proto/ctrl/v1/environment.proto new file mode 100644 index 0000000000..f0b80c18fe --- /dev/null +++ b/go/proto/ctrl/v1/environment.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package ctrl.v1; + +option go_package = "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1;ctrlv1"; + +service EnvironmentService { + + rpc CreateEnvironment(CreateEnvironmentRequest) returns (CreateEnvironmentResponse) {} + + +} + +enum EnvironmentType { + ENVIRONMENT_TYPE_UNSPECIFIED = 0; + ENVIRONMENT_TYPE_DEVELOPMENT = 1; + ENVIRONMENT_TYPE_PREVIEW = 2; + ENVIRONMENT_TYPE_PRODUCTION = 3; +} + +message CreateEnvironmentRequest { + string project_id = 1; + string slug = 2; + string description = 3; + EnvironmentType type = 4; + +} + +message CreateEnvironmentResponse { + string id = 1; +} diff --git a/go/proto/ctrl/v1/project.proto b/go/proto/ctrl/v1/project.proto new file mode 100644 index 0000000000..8b145acf0e --- /dev/null +++ b/go/proto/ctrl/v1/project.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package ctrl.v1; + +option go_package = "github.com/unkeyed/unkey/go/gen/proto/ctrl/v1;ctrlv1"; + +service ProjectService { + + rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse) {} + + +} + + +message CreateProjectRequest { + string workspace_id =1; + string name = 2; + string slug = 3; + string git_repository = 4; + +} + +message CreateProjectResponse { + string id = 1; +} diff --git a/go/proto/hydra/v1/environment.proto b/go/proto/hydra/v1/environment.proto new file mode 100644 index 0000000000..ed10e6f3f0 --- /dev/null +++ b/go/proto/hydra/v1/environment.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package hydra.v1; + +import "dev/restate/sdk/go.proto"; + +option go_package = "github.com/unkeyed/unkey/go/gen/proto/hydra/v1;hydrav1"; + +service EnvironmentService { + option (dev.restate.sdk.go.service_type) = VIRTUAL_OBJECT; + + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + rpc CreateEnvironment(CreateEnvironmentRequest) returns (CreateEnvironmentResponse) {} + +} + + +message CreateEnvironmentRequest { + string workspace_id = 1; + string environment_id = 2; + message Gateway { + string id = 1; + + string image = 2; + + uint32 replicas = 3; + uint32 cpu_millicores = 4; + uint64 memory_size_mib = 5; + + } + Gateway gateway = 3; + +} + +message CreateEnvironmentResponse { +} diff --git a/go/proto/hydra/v1/project.proto b/go/proto/hydra/v1/project.proto new file mode 100644 index 0000000000..bb4657420b --- /dev/null +++ b/go/proto/hydra/v1/project.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package hydra.v1; + +import "dev/restate/sdk/go.proto"; + +option go_package = "github.com/unkeyed/unkey/go/gen/proto/hydra/v1;hydrav1"; + +service ProjectService { + option (dev.restate.sdk.go.service_type) = VIRTUAL_OBJECT; + + // AssignIngressRoutes creates or reassigns ingress routes to a deployment + rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse) {} + +} + + +message CreateProjectRequest { + string workspace_id = 1; +string name = 2; + string slug= 3; + string git_repository = 4; + + +} + +message CreateProjectResponse { + string project_id = 1; +} diff --git a/go/proto/krane/v1/gateway.proto b/go/proto/krane/v1/gateway.proto index c0d5a3c1a0..71381d789f 100644 --- a/go/proto/krane/v1/gateway.proto +++ b/go/proto/krane/v1/gateway.proto @@ -69,5 +69,4 @@ enum GatewayStatus { message GatewayInstance { string id = 1; GatewayStatus status = 2; - } diff --git a/internal/db/src/schema/environments.ts b/internal/db/src/schema/environments.ts index 07c48f50c0..a7dfc78c58 100644 --- a/internal/db/src/schema/environments.ts +++ b/internal/db/src/schema/environments.ts @@ -15,7 +15,7 @@ export const environments = mysqlTable( projectId: varchar("project_id", { length: 256 }).notNull(), slug: varchar("slug", { length: 256 }).notNull(), // URL-safe identifier within workspace - description: varchar("description", { length: 255 }), + description: varchar("description", { length: 255 }).notNull().default(""), gatewayConfig: longblob("gateway_config").notNull(), diff --git a/internal/proto/src/index.ts b/internal/proto/src/index.ts deleted file mode 100644 index 66c897cf21..0000000000 --- a/internal/proto/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Re-export ctrl service types and services -export * from "../generated/ctrl/v1/deployment_pb"; -export * from "../generated/ctrl/v1/openapi_pb"; -//export * from "../generated/ctrl/v1/deployment_connect"; diff --git a/internal/proto/tsconfig.json b/internal/proto/tsconfig.json deleted file mode 100644 index 1a611ba603..0000000000 --- a/internal/proto/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../tsconfig/base.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "." - }, - "include": ["src/**/*", "generated/**/*"], - "exclude": ["dist", "node_modules"] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 710880a48d..77bd66f478 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,6 +142,9 @@ importers: '@ant-design/plots': specifier: 1.2.5 version: 1.2.5(react-dom@18.2.0)(react@18.2.0) + '@bufbuild/protobuf': + specifier: 2.8.0 + version: 2.8.0 '@connectrpc/connect': specifier: 2.1.0 version: 2.1.0(@bufbuild/protobuf@2.8.0)