diff --git a/apps/dashboard/package.json b/apps/dashboard/package.json index 9a1df21c65..2f0cc572f1 100644 --- a/apps/dashboard/package.json +++ b/apps/dashboard/package.json @@ -12,6 +12,8 @@ }, "dependencies": { "@ant-design/plots": "^1.2.5", + "@connectrpc/connect": "^2.1.0", + "@connectrpc/connect-web": "^2.1.0", "@hookform/resolvers": "^3.4.2", "@planetscale/database": "^1.16.0", "@radix-ui/react-accordion": "^1.2.0", @@ -55,6 +57,7 @@ "@unkey/icons": "workspace:^", "@unkey/id": "workspace:^", "@unkey/keys": "workspace:^", + "@unkey/proto": "workspace:^", "@unkey/ratelimit": "^2.1.3", "@unkey/rbac": "workspace:^", "@unkey/resend": "workspace:^", diff --git a/go/buf.gen.yaml b/go/buf.gen.yaml index ce9c08c23e..8f64013b78 100644 --- a/go/buf.gen.yaml +++ b/go/buf.gen.yaml @@ -6,3 +6,9 @@ plugins: - remote: buf.build/connectrpc/go:v1.18.1 out: gen/proto opt: paths=source_relative + - remote: buf.build/bufbuild/es:v1.10.0 + out: ../internal/proto/generated + opt: target=ts + - remote: buf.build/connectrpc/es:v1.6.1 + out: ../internal/proto/generated + opt: target=ts diff --git a/internal/proto/generated/proto/ctrl/v1/acme_connect.ts b/internal/proto/generated/proto/ctrl/v1/acme_connect.ts new file mode 100644 index 0000000000..b6420e7204 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/acme_connect.ts @@ -0,0 +1,28 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/ctrl/v1/acme.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + HandleCertificateVerificationRequest, + HandleCertificateVerificationResponse, +} from "./acme_pb.js"; + +/** + * @generated from service ctrl.v1.AcmeService + */ +export const AcmeService = { + typeName: "ctrl.v1.AcmeService", + methods: { + /** + * @generated from rpc ctrl.v1.AcmeService.HandleCertificateVerification + */ + handleCertificateVerification: { + name: "HandleCertificateVerification", + I: HandleCertificateVerificationRequest, + O: HandleCertificateVerificationResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/ctrl/v1/acme_pb.ts b/internal/proto/generated/proto/ctrl/v1/acme_pb.ts new file mode 100644 index 0000000000..00307cbfc0 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/acme_pb.ts @@ -0,0 +1,130 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/ctrl/v1/acme.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message ctrl.v1.HandleCertificateVerificationRequest + */ +export class HandleCertificateVerificationRequest extends Message { + /** + * @generated from field: string domain = 1; + */ + domain = ""; + + /** + * @generated from field: string token = 2; + */ + token = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.HandleCertificateVerificationRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): HandleCertificateVerificationRequest { + return new HandleCertificateVerificationRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): HandleCertificateVerificationRequest { + return new HandleCertificateVerificationRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): HandleCertificateVerificationRequest { + return new HandleCertificateVerificationRequest().fromJsonString(jsonString, options); + } + + static equals( + a: + | HandleCertificateVerificationRequest + | PlainMessage + | undefined, + b: + | HandleCertificateVerificationRequest + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(HandleCertificateVerificationRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.HandleCertificateVerificationResponse + */ +export class HandleCertificateVerificationResponse extends Message { + /** + * @generated from field: string token = 1; + */ + token = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.HandleCertificateVerificationResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): HandleCertificateVerificationResponse { + return new HandleCertificateVerificationResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): HandleCertificateVerificationResponse { + return new HandleCertificateVerificationResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): HandleCertificateVerificationResponse { + return new HandleCertificateVerificationResponse().fromJsonString(jsonString, options); + } + + static equals( + a: + | HandleCertificateVerificationResponse + | PlainMessage + | undefined, + b: + | HandleCertificateVerificationResponse + | PlainMessage + | undefined, + ): boolean { + return proto3.util.equals(HandleCertificateVerificationResponse, a, b); + } +} diff --git a/internal/proto/generated/proto/ctrl/v1/build_connect.ts b/internal/proto/generated/proto/ctrl/v1/build_connect.ts new file mode 100644 index 0000000000..4c4e78b63f --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/build_connect.ts @@ -0,0 +1,43 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/ctrl/v1/build.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + CreateBuildRequest, + CreateBuildResponse, + GetBuildRequest, + GetBuildResponse, +} from "./build_pb.js"; + +/** + * @generated from service ctrl.v1.BuildService + */ +export const BuildService = { + typeName: "ctrl.v1.BuildService", + methods: { + /** + * Create a new build + * + * @generated from rpc ctrl.v1.BuildService.CreateBuild + */ + createBuild: { + name: "CreateBuild", + I: CreateBuildRequest, + O: CreateBuildResponse, + kind: MethodKind.Unary, + }, + /** + * Get build details + * + * @generated from rpc ctrl.v1.BuildService.GetBuild + */ + getBuild: { + name: "GetBuild", + I: GetBuildRequest, + O: GetBuildResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/ctrl/v1/build_pb.ts b/internal/proto/generated/proto/ctrl/v1/build_pb.ts new file mode 100644 index 0000000000..f330e891d1 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/build_pb.ts @@ -0,0 +1,354 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/ctrl/v1/build.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, Timestamp, proto3 } from "@bufbuild/protobuf"; + +/** + * Build status enum + * + * @generated from enum ctrl.v1.BuildStatus + */ +export enum BuildStatus { + /** + * @generated from enum value: BUILD_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: BUILD_STATUS_PENDING = 1; + */ + PENDING = 1, + + /** + * @generated from enum value: BUILD_STATUS_RUNNING = 2; + */ + RUNNING = 2, + + /** + * @generated from enum value: BUILD_STATUS_SUCCEEDED = 3; + */ + SUCCEEDED = 3, + + /** + * @generated from enum value: BUILD_STATUS_FAILED = 4; + */ + FAILED = 4, + + /** + * @generated from enum value: BUILD_STATUS_CANCELLED = 5; + */ + CANCELLED = 5, +} +// Retrieve enum metadata with: proto3.getEnumType(BuildStatus) +proto3.util.setEnumType(BuildStatus, "ctrl.v1.BuildStatus", [ + { no: 0, name: "BUILD_STATUS_UNSPECIFIED" }, + { no: 1, name: "BUILD_STATUS_PENDING" }, + { no: 2, name: "BUILD_STATUS_RUNNING" }, + { no: 3, name: "BUILD_STATUS_SUCCEEDED" }, + { no: 4, name: "BUILD_STATUS_FAILED" }, + { no: 5, name: "BUILD_STATUS_CANCELLED" }, +]); + +/** + * @generated from message ctrl.v1.CreateBuildRequest + */ +export class CreateBuildRequest extends Message { + /** + * @generated from field: string workspace_id = 1; + */ + workspaceId = ""; + + /** + * @generated from field: string project_id = 2; + */ + projectId = ""; + + /** + * @generated from field: string version_id = 3; + */ + versionId = ""; + + /** + * @generated from field: string docker_image = 4; + */ + dockerImage = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.CreateBuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "project_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "docker_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBuildRequest { + return new CreateBuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBuildRequest { + return new CreateBuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateBuildRequest { + return new CreateBuildRequest().fromJsonString(jsonString, options); + } + + static equals( + a: CreateBuildRequest | PlainMessage | undefined, + b: CreateBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateBuildRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.CreateBuildResponse + */ +export class CreateBuildResponse extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.CreateBuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBuildResponse { + return new CreateBuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBuildResponse { + return new CreateBuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateBuildResponse { + return new CreateBuildResponse().fromJsonString(jsonString, options); + } + + static equals( + a: CreateBuildResponse | PlainMessage | undefined, + b: CreateBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateBuildResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetBuildRequest + */ +export class GetBuildRequest extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetBuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetBuildRequest { + return new GetBuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetBuildRequest { + return new GetBuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetBuildRequest { + return new GetBuildRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetBuildRequest | PlainMessage | undefined, + b: GetBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetBuildRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetBuildResponse + */ +export class GetBuildResponse extends Message { + /** + * @generated from field: ctrl.v1.Build build = 1; + */ + build?: Build; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetBuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build", kind: "message", T: Build }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetBuildResponse { + return new GetBuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetBuildResponse { + return new GetBuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetBuildResponse { + return new GetBuildResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetBuildResponse | PlainMessage | undefined, + b: GetBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetBuildResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.Build + */ +export class Build extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string workspace_id = 2; + */ + workspaceId = ""; + + /** + * @generated from field: string project_id = 3; + */ + projectId = ""; + + /** + * @generated from field: string version_id = 4; + */ + versionId = ""; + + /** + * Build details + * + * @generated from field: ctrl.v1.BuildStatus status = 5; + */ + status = BuildStatus.UNSPECIFIED; + + /** + * For failed builds + * + * @generated from field: string error_message = 6; + */ + errorMessage = ""; + + /** + * Timestamps + * + * @generated from field: google.protobuf.Timestamp created_at = 7; + */ + createdAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp started_at = 8; + */ + startedAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp completed_at = 9; + */ + completedAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp updated_at = 10; + */ + updatedAt?: Timestamp; + + /** + * Build metadata + * + * Output rootfs image + * + * @generated from field: string rootfs_image_id = 11; + */ + rootfsImageId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.Build"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "project_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "status", kind: "enum", T: proto3.getEnumType(BuildStatus) }, + { no: 6, name: "error_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "created_at", kind: "message", T: Timestamp }, + { no: 8, name: "started_at", kind: "message", T: Timestamp }, + { no: 9, name: "completed_at", kind: "message", T: Timestamp }, + { no: 10, name: "updated_at", kind: "message", T: Timestamp }, + { no: 11, name: "rootfs_image_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Build { + return new Build().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Build { + return new Build().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Build { + return new Build().fromJsonString(jsonString, options); + } + + static equals( + a: Build | PlainMessage | undefined, + b: Build | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Build, a, b); + } +} diff --git a/internal/proto/generated/proto/ctrl/v1/deployment_connect.ts b/internal/proto/generated/proto/ctrl/v1/deployment_connect.ts new file mode 100644 index 0000000000..ba500f294f --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/deployment_connect.ts @@ -0,0 +1,43 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/ctrl/v1/deployment.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + CreateDeploymentRequest, + CreateDeploymentResponse, + GetDeploymentRequest, + GetDeploymentResponse, +} from "./deployment_pb.js"; + +/** + * @generated from service ctrl.v1.DeploymentService + */ +export const DeploymentService = { + typeName: "ctrl.v1.DeploymentService", + methods: { + /** + * Create a new deployment + * + * @generated from rpc ctrl.v1.DeploymentService.CreateDeployment + */ + createDeployment: { + name: "CreateDeployment", + I: CreateDeploymentRequest, + O: CreateDeploymentResponse, + kind: MethodKind.Unary, + }, + /** + * Get deployment details + * + * @generated from rpc ctrl.v1.DeploymentService.GetDeployment + */ + getDeployment: { + name: "GetDeployment", + I: GetDeploymentRequest, + O: GetDeploymentResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/ctrl/v1/deployment_pb.ts b/internal/proto/generated/proto/ctrl/v1/deployment_pb.ts new file mode 100644 index 0000000000..ba3b35854c --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/deployment_pb.ts @@ -0,0 +1,763 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/ctrl/v1/deployment.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * Deployment status enum + * + * @generated from enum ctrl.v1.DeploymentStatus + */ +export enum DeploymentStatus { + /** + * @generated from enum value: DEPLOYMENT_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: DEPLOYMENT_STATUS_PENDING = 1; + */ + PENDING = 1, + + /** + * @generated from enum value: DEPLOYMENT_STATUS_BUILDING = 2; + */ + BUILDING = 2, + + /** + * @generated from enum value: DEPLOYMENT_STATUS_DEPLOYING = 3; + */ + DEPLOYING = 3, + + /** + * @generated from enum value: DEPLOYMENT_STATUS_NETWORK = 4; + */ + NETWORK = 4, + + /** + * @generated from enum value: DEPLOYMENT_STATUS_READY = 5; + */ + READY = 5, + + /** + * @generated from enum value: DEPLOYMENT_STATUS_FAILED = 6; + */ + FAILED = 6, +} +// Retrieve enum metadata with: proto3.getEnumType(DeploymentStatus) +proto3.util.setEnumType(DeploymentStatus, "ctrl.v1.DeploymentStatus", [ + { no: 0, name: "DEPLOYMENT_STATUS_UNSPECIFIED" }, + { no: 1, name: "DEPLOYMENT_STATUS_PENDING" }, + { no: 2, name: "DEPLOYMENT_STATUS_BUILDING" }, + { no: 3, name: "DEPLOYMENT_STATUS_DEPLOYING" }, + { no: 4, name: "DEPLOYMENT_STATUS_NETWORK" }, + { no: 5, name: "DEPLOYMENT_STATUS_READY" }, + { no: 6, name: "DEPLOYMENT_STATUS_FAILED" }, +]); + +/** + * Source type for deployment creation + * + * @generated from enum ctrl.v1.SourceType + */ +export enum SourceType { + /** + * @generated from enum value: SOURCE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: SOURCE_TYPE_GIT = 1; + */ + GIT = 1, + + /** + * @generated from enum value: SOURCE_TYPE_CLI_UPLOAD = 2; + */ + CLI_UPLOAD = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SourceType) +proto3.util.setEnumType(SourceType, "ctrl.v1.SourceType", [ + { no: 0, name: "SOURCE_TYPE_UNSPECIFIED" }, + { no: 1, name: "SOURCE_TYPE_GIT" }, + { no: 2, name: "SOURCE_TYPE_CLI_UPLOAD" }, +]); + +/** + * @generated from message ctrl.v1.CreateDeploymentRequest + */ +export class CreateDeploymentRequest extends Message { + /** + * @generated from field: string workspace_id = 1; + */ + workspaceId = ""; + + /** + * @generated from field: string project_id = 2; + */ + projectId = ""; + + /** + * @generated from field: string branch = 3; + */ + branch = ""; + + /** + * Source information + * + * @generated from field: ctrl.v1.SourceType source_type = 4; + */ + sourceType = SourceType.UNSPECIFIED; + + /** + * For git sources + * + * @generated from field: string git_commit_sha = 5; + */ + gitCommitSha = ""; + + /** + * Optional environment override (defaults based on branch) + * + * @generated from field: string environment_id = 7; + */ + environmentId = ""; + + /** + * Docker image support + * + * e.g. "ghcr.io/user/app:sha256..." + * + * @generated from field: string docker_image_tag = 8; + */ + dockerImageTag = ""; + + /** + * Gateway hostname for routing + * + * @generated from field: string hostname = 9; + */ + hostname = ""; + + /** + * Keyspace ID for authentication + * + * @generated from field: string keyspace_id = 10; + */ + keyspaceId = ""; + + /** + * Extended git information + * + * @generated from field: string git_commit_message = 6; + */ + gitCommitMessage = ""; + + /** + * @generated from field: string git_commit_author_name = 11; + */ + gitCommitAuthorName = ""; + + /** + * TODO: Add GitHub API integration to lookup username/avatar from email + * + * @generated from field: string git_commit_author_username = 12; + */ + gitCommitAuthorUsername = ""; + + /** + * @generated from field: string git_commit_author_avatar_url = 13; + */ + gitCommitAuthorAvatarUrl = ""; + + /** + * Unix epoch milliseconds + * + * @generated from field: int64 git_commit_timestamp = 14; + */ + gitCommitTimestamp = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.CreateDeploymentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "project_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "branch", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "source_type", kind: "enum", T: proto3.getEnumType(SourceType) }, + { no: 5, name: "git_commit_sha", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "environment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "docker_image_tag", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 9, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 10, name: "keyspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "git_commit_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "git_commit_author_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 12, name: "git_commit_author_username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 13, name: "git_commit_author_avatar_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 14, name: "git_commit_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): CreateDeploymentRequest { + return new CreateDeploymentRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): CreateDeploymentRequest { + return new CreateDeploymentRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateDeploymentRequest { + return new CreateDeploymentRequest().fromJsonString(jsonString, options); + } + + static equals( + a: CreateDeploymentRequest | PlainMessage | undefined, + b: CreateDeploymentRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateDeploymentRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.CreateDeploymentResponse + */ +export class CreateDeploymentResponse extends Message { + /** + * @generated from field: string deployment_id = 1; + */ + deploymentId = ""; + + /** + * Will be PENDING or BUILDING + * + * @generated from field: ctrl.v1.DeploymentStatus status = 2; + */ + status = DeploymentStatus.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.CreateDeploymentResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "deployment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(DeploymentStatus) }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): CreateDeploymentResponse { + return new CreateDeploymentResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): CreateDeploymentResponse { + return new CreateDeploymentResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateDeploymentResponse { + return new CreateDeploymentResponse().fromJsonString(jsonString, options); + } + + static equals( + a: CreateDeploymentResponse | PlainMessage | undefined, + b: CreateDeploymentResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateDeploymentResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetDeploymentRequest + */ +export class GetDeploymentRequest extends Message { + /** + * @generated from field: string deployment_id = 1; + */ + deploymentId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetDeploymentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "deployment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDeploymentRequest { + return new GetDeploymentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDeploymentRequest { + return new GetDeploymentRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetDeploymentRequest { + return new GetDeploymentRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetDeploymentRequest | PlainMessage | undefined, + b: GetDeploymentRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetDeploymentRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetDeploymentResponse + */ +export class GetDeploymentResponse extends Message { + /** + * @generated from field: ctrl.v1.Deployment deployment = 1; + */ + deployment?: Deployment; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetDeploymentResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "deployment", kind: "message", T: Deployment }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetDeploymentResponse { + return new GetDeploymentResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDeploymentResponse { + return new GetDeploymentResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetDeploymentResponse { + return new GetDeploymentResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetDeploymentResponse | PlainMessage | undefined, + b: GetDeploymentResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetDeploymentResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.Deployment + */ +export class Deployment extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string workspace_id = 2; + */ + workspaceId = ""; + + /** + * @generated from field: string project_id = 3; + */ + projectId = ""; + + /** + * @generated from field: string environment_id = 4; + */ + environmentId = ""; + + /** + * Source information + * + * @generated from field: string git_commit_sha = 5; + */ + gitCommitSha = ""; + + /** + * @generated from field: string git_branch = 6; + */ + gitBranch = ""; + + /** + * Status and lifecycle + * + * @generated from field: ctrl.v1.DeploymentStatus status = 7; + */ + status = DeploymentStatus.UNSPECIFIED; + + /** + * For failed deployments + * + * @generated from field: string error_message = 8; + */ + errorMessage = ""; + + /** + * Configuration snapshot (resolved at creation time) + * + * @generated from field: map environment_variables = 9; + */ + environmentVariables: { [key: string]: string } = {}; + + /** + * Topology configuration + * + * @generated from field: ctrl.v1.Topology topology = 10; + */ + topology?: Topology; + + /** + * Timestamps + * + * @generated from field: int64 created_at = 11; + */ + createdAt = protoInt64.zero; + + /** + * @generated from field: int64 updated_at = 12; + */ + updatedAt = protoInt64.zero; + + /** + * Associated hostnames for this deployment + * + * @generated from field: repeated string hostnames = 13; + */ + hostnames: string[] = []; + + /** + * Build information + * + * @generated from field: string rootfs_image_id = 14; + */ + rootfsImageId = ""; + + /** + * @generated from field: string build_id = 15; + */ + buildId = ""; + + /** + * Deployment steps + * + * @generated from field: repeated ctrl.v1.DeploymentStep steps = 16; + */ + steps: DeploymentStep[] = []; + + /** + * Extended git information + * + * @generated from field: string git_commit_message = 17; + */ + gitCommitMessage = ""; + + /** + * @generated from field: string git_commit_author_name = 18; + */ + gitCommitAuthorName = ""; + + /** + * Removed: email is PII and not stored + * + * @generated from field: string git_commit_author_username = 20; + */ + gitCommitAuthorUsername = ""; + + /** + * @generated from field: string git_commit_author_avatar_url = 21; + */ + gitCommitAuthorAvatarUrl = ""; + + /** + * Unix epoch milliseconds + * + * @generated from field: int64 git_commit_timestamp = 22; + */ + gitCommitTimestamp = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.Deployment"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "project_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "environment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "git_commit_sha", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "git_branch", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "status", kind: "enum", T: proto3.getEnumType(DeploymentStatus) }, + { no: 8, name: "error_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 9, + name: "environment_variables", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 10, name: "topology", kind: "message", T: Topology }, + { no: 11, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 12, name: "updated_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 13, name: "hostnames", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 14, name: "rootfs_image_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 15, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 16, name: "steps", kind: "message", T: DeploymentStep, repeated: true }, + { no: 17, name: "git_commit_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 18, name: "git_commit_author_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 20, name: "git_commit_author_username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 21, name: "git_commit_author_avatar_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 22, name: "git_commit_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Deployment { + return new Deployment().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Deployment { + return new Deployment().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Deployment { + return new Deployment().fromJsonString(jsonString, options); + } + + static equals( + a: Deployment | PlainMessage | undefined, + b: Deployment | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Deployment, a, b); + } +} + +/** + * @generated from message ctrl.v1.DeploymentStep + */ +export class DeploymentStep extends Message { + /** + * @generated from field: string status = 1; + */ + status = ""; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + /** + * @generated from field: string error_message = 3; + */ + errorMessage = ""; + + /** + * @generated from field: int64 created_at = 4; + */ + createdAt = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.DeploymentStep"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "error_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeploymentStep { + return new DeploymentStep().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeploymentStep { + return new DeploymentStep().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeploymentStep { + return new DeploymentStep().fromJsonString(jsonString, options); + } + + static equals( + a: DeploymentStep | PlainMessage | undefined, + b: DeploymentStep | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeploymentStep, a, b); + } +} + +/** + * @generated from message ctrl.v1.Topology + */ +export class Topology extends Message { + /** + * @generated from field: int32 cpu_millicores = 1; + */ + cpuMillicores = 0; + + /** + * @generated from field: int32 memory_mb = 2; + */ + memoryMb = 0; + + /** + * Regional configuration + * + * @generated from field: repeated ctrl.v1.RegionalConfig regions = 3; + */ + regions: RegionalConfig[] = []; + + /** + * Runtime settings + * + * 0 means no timeout + * + * @generated from field: int32 idle_timeout_seconds = 4; + */ + idleTimeoutSeconds = 0; + + /** + * @generated from field: string health_check_path = 5; + */ + healthCheckPath = ""; + + /** + * @generated from field: int32 port = 6; + */ + port = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.Topology"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "cpu_millicores", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "memory_mb", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "regions", kind: "message", T: RegionalConfig, repeated: true }, + { no: 4, name: "idle_timeout_seconds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 5, name: "health_check_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Topology { + return new Topology().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Topology { + return new Topology().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Topology { + return new Topology().fromJsonString(jsonString, options); + } + + static equals( + a: Topology | PlainMessage | undefined, + b: Topology | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Topology, a, b); + } +} + +/** + * @generated from message ctrl.v1.RegionalConfig + */ +export class RegionalConfig extends Message { + /** + * @generated from field: string region = 1; + */ + region = ""; + + /** + * @generated from field: int32 min_instances = 2; + */ + minInstances = 0; + + /** + * @generated from field: int32 max_instances = 3; + */ + maxInstances = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.RegionalConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "region", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "min_instances", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "max_instances", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegionalConfig { + return new RegionalConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegionalConfig { + return new RegionalConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegionalConfig { + return new RegionalConfig().fromJsonString(jsonString, options); + } + + static equals( + a: RegionalConfig | PlainMessage | undefined, + b: RegionalConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RegionalConfig, a, b); + } +} diff --git a/internal/proto/generated/proto/ctrl/v1/openapi_connect.ts b/internal/proto/generated/proto/ctrl/v1/openapi_connect.ts new file mode 100644 index 0000000000..0e42c5e0c8 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/openapi_connect.ts @@ -0,0 +1,25 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/ctrl/v1/openapi.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { GetOpenApiDiffRequest, GetOpenApiDiffResponse } from "./openapi_pb.js"; + +/** + * @generated from service ctrl.v1.OpenApiService + */ +export const OpenApiService = { + typeName: "ctrl.v1.OpenApiService", + methods: { + /** + * @generated from rpc ctrl.v1.OpenApiService.GetOpenApiDiff + */ + getOpenApiDiff: { + name: "GetOpenApiDiff", + I: GetOpenApiDiffRequest, + O: GetOpenApiDiffResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/ctrl/v1/openapi_pb.ts b/internal/proto/generated/proto/ctrl/v1/openapi_pb.ts new file mode 100644 index 0000000000..9ec69ba66f --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/openapi_pb.ts @@ -0,0 +1,347 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/ctrl/v1/openapi.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message ctrl.v1.GetOpenApiDiffRequest + */ +export class GetOpenApiDiffRequest extends Message { + /** + * @generated from field: string old_version_id = 1; + */ + oldVersionId = ""; + + /** + * @generated from field: string new_version_id = 2; + */ + newVersionId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetOpenApiDiffRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "old_version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "new_version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetOpenApiDiffRequest { + return new GetOpenApiDiffRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetOpenApiDiffRequest { + return new GetOpenApiDiffRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetOpenApiDiffRequest { + return new GetOpenApiDiffRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetOpenApiDiffRequest | PlainMessage | undefined, + b: GetOpenApiDiffRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetOpenApiDiffRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.ChangelogEntry + */ +export class ChangelogEntry extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string text = 2; + */ + text = ""; + + /** + * @generated from field: int32 level = 3; + */ + level = 0; + + /** + * @generated from field: string operation = 4; + */ + operation = ""; + + /** + * @generated from field: optional string operation_id = 5; + */ + operationId?: string; + + /** + * @generated from field: string path = 6; + */ + path = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.ChangelogEntry"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "level", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "operation", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "operation_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + { no: 6, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangelogEntry { + return new ChangelogEntry().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangelogEntry { + return new ChangelogEntry().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangelogEntry { + return new ChangelogEntry().fromJsonString(jsonString, options); + } + + static equals( + a: ChangelogEntry | PlainMessage | undefined, + b: ChangelogEntry | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ChangelogEntry, a, b); + } +} + +/** + * @generated from message ctrl.v1.DiffSummary + */ +export class DiffSummary extends Message { + /** + * @generated from field: bool diff = 1; + */ + diff = false; + + /** + * @generated from field: ctrl.v1.DiffDetails details = 2; + */ + details?: DiffDetails; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.DiffSummary"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "diff", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "details", kind: "message", T: DiffDetails }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiffSummary { + return new DiffSummary().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiffSummary { + return new DiffSummary().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiffSummary { + return new DiffSummary().fromJsonString(jsonString, options); + } + + static equals( + a: DiffSummary | PlainMessage | undefined, + b: DiffSummary | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DiffSummary, a, b); + } +} + +/** + * @generated from message ctrl.v1.DiffDetails + */ +export class DiffDetails extends Message { + /** + * @generated from field: ctrl.v1.DiffCounts endpoints = 1; + */ + endpoints?: DiffCounts; + + /** + * @generated from field: ctrl.v1.DiffCounts paths = 2; + */ + paths?: DiffCounts; + + /** + * @generated from field: ctrl.v1.DiffCounts schemas = 3; + */ + schemas?: DiffCounts; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.DiffDetails"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "endpoints", kind: "message", T: DiffCounts }, + { no: 2, name: "paths", kind: "message", T: DiffCounts }, + { no: 3, name: "schemas", kind: "message", T: DiffCounts }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiffDetails { + return new DiffDetails().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiffDetails { + return new DiffDetails().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiffDetails { + return new DiffDetails().fromJsonString(jsonString, options); + } + + static equals( + a: DiffDetails | PlainMessage | undefined, + b: DiffDetails | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DiffDetails, a, b); + } +} + +/** + * @generated from message ctrl.v1.DiffCounts + */ +export class DiffCounts extends Message { + /** + * @generated from field: int32 added = 1; + */ + added = 0; + + /** + * @generated from field: int32 deleted = 2; + */ + deleted = 0; + + /** + * @generated from field: int32 modified = 3; + */ + modified = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.DiffCounts"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "added", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "deleted", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "modified", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DiffCounts { + return new DiffCounts().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DiffCounts { + return new DiffCounts().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DiffCounts { + return new DiffCounts().fromJsonString(jsonString, options); + } + + static equals( + a: DiffCounts | PlainMessage | undefined, + b: DiffCounts | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DiffCounts, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetOpenApiDiffResponse + */ +export class GetOpenApiDiffResponse extends Message { + /** + * @generated from field: ctrl.v1.DiffSummary summary = 1; + */ + summary?: DiffSummary; + + /** + * @generated from field: bool has_breaking_changes = 2; + */ + hasBreakingChanges = false; + + /** + * @generated from field: repeated ctrl.v1.ChangelogEntry changes = 3; + */ + changes: ChangelogEntry[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetOpenApiDiffResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "summary", kind: "message", T: DiffSummary }, + { no: 2, name: "has_breaking_changes", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "changes", kind: "message", T: ChangelogEntry, repeated: true }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetOpenApiDiffResponse { + return new GetOpenApiDiffResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetOpenApiDiffResponse { + return new GetOpenApiDiffResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetOpenApiDiffResponse { + return new GetOpenApiDiffResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetOpenApiDiffResponse | PlainMessage | undefined, + b: GetOpenApiDiffResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetOpenApiDiffResponse, a, b); + } +} diff --git a/internal/proto/generated/proto/ctrl/v1/routing_connect.ts b/internal/proto/generated/proto/ctrl/v1/routing_connect.ts new file mode 100644 index 0000000000..796a08e432 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/routing_connect.ts @@ -0,0 +1,69 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/ctrl/v1/routing.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + GetRouteRequest, + GetRouteResponse, + ListRoutesRequest, + ListRoutesResponse, + RollbackRequest, + RollbackResponse, + SetRouteRequest, + SetRouteResponse, +} from "./routing_pb.js"; + +/** + * @generated from service ctrl.v1.RoutingService + */ +export const RoutingService = { + typeName: "ctrl.v1.RoutingService", + methods: { + /** + * Update routing for a hostname + * + * @generated from rpc ctrl.v1.RoutingService.SetRoute + */ + setRoute: { + name: "SetRoute", + I: SetRouteRequest, + O: SetRouteResponse, + kind: MethodKind.Unary, + }, + /** + * Get current routing for a hostname + * + * @generated from rpc ctrl.v1.RoutingService.GetRoute + */ + getRoute: { + name: "GetRoute", + I: GetRouteRequest, + O: GetRouteResponse, + kind: MethodKind.Unary, + }, + /** + * List all routes for a workspace/project + * + * @generated from rpc ctrl.v1.RoutingService.ListRoutes + */ + listRoutes: { + name: "ListRoutes", + I: ListRoutesRequest, + O: ListRoutesResponse, + kind: MethodKind.Unary, + }, + /** + * Convenience method for rollback (just calls SetRoute internally) + * + * @generated from rpc ctrl.v1.RoutingService.Rollback + */ + rollback: { + name: "Rollback", + I: RollbackRequest, + O: RollbackResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/ctrl/v1/routing_pb.ts b/internal/proto/generated/proto/ctrl/v1/routing_pb.ts new file mode 100644 index 0000000000..4e2aeeaaf4 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/routing_pb.ts @@ -0,0 +1,537 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/ctrl/v1/routing.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, Timestamp, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message ctrl.v1.SetRouteRequest + */ +export class SetRouteRequest extends Message { + /** + * @generated from field: string hostname = 1; + */ + hostname = ""; + + /** + * @generated from field: string version_id = 2; + */ + versionId = ""; + + /** + * Optional: for blue-green deployments + * + * 0-100, defaults to 100 for full cutover + * + * @generated from field: int32 weight = 3; + */ + weight = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.SetRouteRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "weight", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetRouteRequest { + return new SetRouteRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetRouteRequest { + return new SetRouteRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetRouteRequest { + return new SetRouteRequest().fromJsonString(jsonString, options); + } + + static equals( + a: SetRouteRequest | PlainMessage | undefined, + b: SetRouteRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SetRouteRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.SetRouteResponse + */ +export class SetRouteResponse extends Message { + /** + * What was previously active + * + * @generated from field: string previous_version_id = 1; + */ + previousVersionId = ""; + + /** + * @generated from field: google.protobuf.Timestamp effective_at = 2; + */ + effectiveAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.SetRouteResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "previous_version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "effective_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetRouteResponse { + return new SetRouteResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetRouteResponse { + return new SetRouteResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetRouteResponse { + return new SetRouteResponse().fromJsonString(jsonString, options); + } + + static equals( + a: SetRouteResponse | PlainMessage | undefined, + b: SetRouteResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SetRouteResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetRouteRequest + */ +export class GetRouteRequest extends Message { + /** + * @generated from field: string hostname = 1; + */ + hostname = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetRouteRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetRouteRequest { + return new GetRouteRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetRouteRequest { + return new GetRouteRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetRouteRequest { + return new GetRouteRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetRouteRequest | PlainMessage | undefined, + b: GetRouteRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetRouteRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.GetRouteResponse + */ +export class GetRouteResponse extends Message { + /** + * @generated from field: ctrl.v1.Route route = 1; + */ + route?: Route; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.GetRouteResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "route", kind: "message", T: Route }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetRouteResponse { + return new GetRouteResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetRouteResponse { + return new GetRouteResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetRouteResponse { + return new GetRouteResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetRouteResponse | PlainMessage | undefined, + b: GetRouteResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetRouteResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.ListRoutesRequest + */ +export class ListRoutesRequest extends Message { + /** + * @generated from field: string workspace_id = 1; + */ + workspaceId = ""; + + /** + * @generated from field: string project_id = 2; + */ + projectId = ""; + + /** + * Optional filters + * + * @generated from field: string environment_id = 3; + */ + environmentId = ""; + + /** + * Include preview/branch routes + * + * @generated from field: bool include_preview = 4; + */ + includePreview = false; + + /** + * Pagination + * + * @generated from field: int32 page_size = 10; + */ + pageSize = 0; + + /** + * @generated from field: string page_token = 11; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.ListRoutesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "project_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "environment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "include_preview", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 11, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListRoutesRequest { + return new ListRoutesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListRoutesRequest { + return new ListRoutesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListRoutesRequest { + return new ListRoutesRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ListRoutesRequest | PlainMessage | undefined, + b: ListRoutesRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListRoutesRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.ListRoutesResponse + */ +export class ListRoutesResponse extends Message { + /** + * @generated from field: repeated ctrl.v1.Route routes = 1; + */ + routes: Route[] = []; + + /** + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.ListRoutesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "routes", kind: "message", T: Route, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListRoutesResponse { + return new ListRoutesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListRoutesResponse { + return new ListRoutesResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ListRoutesResponse { + return new ListRoutesResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ListRoutesResponse | PlainMessage | undefined, + b: ListRoutesResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListRoutesResponse, a, b); + } +} + +/** + * @generated from message ctrl.v1.Route + */ +export class Route extends Message { + /** + * @generated from field: string hostname = 1; + */ + hostname = ""; + + /** + * @generated from field: string version_id = 2; + */ + versionId = ""; + + /** + * @generated from field: string workspace_id = 3; + */ + workspaceId = ""; + + /** + * @generated from field: string project_id = 4; + */ + projectId = ""; + + /** + * @generated from field: string environment_id = 5; + */ + environmentId = ""; + + /** + * Traffic configuration + * + * For blue-green deployments + * + * @generated from field: int32 weight = 6; + */ + weight = 0; + + /** + * Metadata + * + * @generated from field: bool is_custom_domain = 7; + */ + isCustomDomain = false; + + /** + * @generated from field: bool is_enabled = 8; + */ + isEnabled = false; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 9; + */ + createdAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp updated_at = 10; + */ + updatedAt?: Timestamp; + + /** + * TLS info + * + * @generated from field: bool has_certificate = 11; + */ + hasCertificate = false; + + /** + * @generated from field: google.protobuf.Timestamp certificate_expires_at = 12; + */ + certificateExpiresAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.Route"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "project_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "environment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "weight", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 7, name: "is_custom_domain", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 8, name: "is_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 9, name: "created_at", kind: "message", T: Timestamp }, + { no: 10, name: "updated_at", kind: "message", T: Timestamp }, + { no: 11, name: "has_certificate", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 12, name: "certificate_expires_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Route { + return new Route().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Route { + return new Route().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Route { + return new Route().fromJsonString(jsonString, options); + } + + static equals( + a: Route | PlainMessage | undefined, + b: Route | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Route, a, b); + } +} + +/** + * Convenience messages for common operations + * + * @generated from message ctrl.v1.RollbackRequest + */ +export class RollbackRequest extends Message { + /** + * @generated from field: string hostname = 1; + */ + hostname = ""; + + /** + * @generated from field: string target_version_id = 2; + */ + targetVersionId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.RollbackRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "target_version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RollbackRequest { + return new RollbackRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RollbackRequest { + return new RollbackRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RollbackRequest { + return new RollbackRequest().fromJsonString(jsonString, options); + } + + static equals( + a: RollbackRequest | PlainMessage | undefined, + b: RollbackRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RollbackRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.RollbackResponse + */ +export class RollbackResponse extends Message { + /** + * @generated from field: string previous_version_id = 1; + */ + previousVersionId = ""; + + /** + * @generated from field: string new_version_id = 2; + */ + newVersionId = ""; + + /** + * @generated from field: google.protobuf.Timestamp effective_at = 3; + */ + effectiveAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.RollbackResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "previous_version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "new_version_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "effective_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RollbackResponse { + return new RollbackResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RollbackResponse { + return new RollbackResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RollbackResponse { + return new RollbackResponse().fromJsonString(jsonString, options); + } + + static equals( + a: RollbackResponse | PlainMessage | undefined, + b: RollbackResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RollbackResponse, a, b); + } +} diff --git a/internal/proto/generated/proto/ctrl/v1/service_connect.ts b/internal/proto/generated/proto/ctrl/v1/service_connect.ts new file mode 100644 index 0000000000..e11ff88f03 --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/service_connect.ts @@ -0,0 +1,25 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/ctrl/v1/service.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { LivenessRequest, LivenessResponse } from "./service_pb.js"; + +/** + * @generated from service ctrl.v1.CtrlService + */ +export const CtrlService = { + typeName: "ctrl.v1.CtrlService", + methods: { + /** + * @generated from rpc ctrl.v1.CtrlService.Liveness + */ + liveness: { + name: "Liveness", + I: LivenessRequest, + O: LivenessResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/ctrl/v1/service_pb.ts b/internal/proto/generated/proto/ctrl/v1/service_pb.ts new file mode 100644 index 0000000000..81de93014f --- /dev/null +++ b/internal/proto/generated/proto/ctrl/v1/service_pb.ts @@ -0,0 +1,99 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/ctrl/v1/service.proto (package ctrl.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message ctrl.v1.LivenessRequest + */ +export class LivenessRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.LivenessRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => []); + + static fromBinary(bytes: Uint8Array, options?: Partial): LivenessRequest { + return new LivenessRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LivenessRequest { + return new LivenessRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LivenessRequest { + return new LivenessRequest().fromJsonString(jsonString, options); + } + + static equals( + a: LivenessRequest | PlainMessage | undefined, + b: LivenessRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(LivenessRequest, a, b); + } +} + +/** + * @generated from message ctrl.v1.LivenessResponse + */ +export class LivenessResponse extends Message { + /** + * @generated from field: string status = 1; + */ + status = ""; + + /** + * @generated from field: string version = 2; + */ + version = ""; + + /** + * @generated from field: string instance_id = 3; + */ + instanceId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "ctrl.v1.LivenessResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "instance_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LivenessResponse { + return new LivenessResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LivenessResponse { + return new LivenessResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LivenessResponse { + return new LivenessResponse().fromJsonString(jsonString, options); + } + + static equals( + a: LivenessResponse | PlainMessage | undefined, + b: LivenessResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(LivenessResponse, a, b); + } +} diff --git a/internal/proto/generated/proto/deploy/assetmanagerd/v1/asset_connect.ts b/internal/proto/generated/proto/deploy/assetmanagerd/v1/asset_connect.ts new file mode 100644 index 0000000000..b34aa4f8f6 --- /dev/null +++ b/internal/proto/generated/proto/deploy/assetmanagerd/v1/asset_connect.ts @@ -0,0 +1,151 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/deploy/assetmanagerd/v1/asset.proto (package deploy.assetmanagerd.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + AcquireAssetRequest, + AcquireAssetResponse, + DeleteAssetRequest, + DeleteAssetResponse, + GarbageCollectRequest, + GarbageCollectResponse, + GetAssetRequest, + GetAssetResponse, + ListAssetsRequest, + ListAssetsResponse, + PrepareAssetsRequest, + PrepareAssetsResponse, + QueryAssetsRequest, + QueryAssetsResponse, + RegisterAssetRequest, + RegisterAssetResponse, + ReleaseAssetRequest, + ReleaseAssetResponse, + UploadAssetRequest, + UploadAssetResponse, +} from "./asset_pb.js"; + +/** + * AssetManagerService manages VM assets (kernels, rootfs images) across the + * infrastructure + * + * @generated from service deploy.assetmanagerd.v1.AssetManagerService + */ +export const AssetManagerService = { + typeName: "deploy.assetmanagerd.v1.AssetManagerService", + methods: { + /** + * Upload and register an asset in one operation + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.UploadAsset + */ + uploadAsset: { + name: "UploadAsset", + I: UploadAssetRequest, + O: UploadAssetResponse, + kind: MethodKind.ClientStreaming, + }, + /** + * Register a new asset (called by builderd after creating images) + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.RegisterAsset + */ + registerAsset: { + name: "RegisterAsset", + I: RegisterAssetRequest, + O: RegisterAssetResponse, + kind: MethodKind.Unary, + }, + /** + * Get asset location and metadata + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.GetAsset + */ + getAsset: { + name: "GetAsset", + I: GetAssetRequest, + O: GetAssetResponse, + kind: MethodKind.Unary, + }, + /** + * List available assets with filtering + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.ListAssets + */ + listAssets: { + name: "ListAssets", + I: ListAssetsRequest, + O: ListAssetsResponse, + kind: MethodKind.Unary, + }, + /** + * Mark asset as in-use (reference counting for GC) + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.AcquireAsset + */ + acquireAsset: { + name: "AcquireAsset", + I: AcquireAssetRequest, + O: AcquireAssetResponse, + kind: MethodKind.Unary, + }, + /** + * Release asset reference (decrements ref count) + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.ReleaseAsset + */ + releaseAsset: { + name: "ReleaseAsset", + I: ReleaseAssetRequest, + O: ReleaseAssetResponse, + kind: MethodKind.Unary, + }, + /** + * Delete an asset (only if ref count is 0) + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.DeleteAsset + */ + deleteAsset: { + name: "DeleteAsset", + I: DeleteAssetRequest, + O: DeleteAssetResponse, + kind: MethodKind.Unary, + }, + /** + * Trigger garbage collection of unused assets + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.GarbageCollect + */ + garbageCollect: { + name: "GarbageCollect", + I: GarbageCollectRequest, + O: GarbageCollectResponse, + kind: MethodKind.Unary, + }, + /** + * Pre-stage assets for a specific host/jailer + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.PrepareAssets + */ + prepareAssets: { + name: "PrepareAssets", + I: PrepareAssetsRequest, + O: PrepareAssetsResponse, + kind: MethodKind.Unary, + }, + /** + * Query assets with automatic build triggering if not found + * This is the enhanced version of ListAssets that supports automatic asset creation + * + * @generated from rpc deploy.assetmanagerd.v1.AssetManagerService.QueryAssets + */ + queryAssets: { + name: "QueryAssets", + I: QueryAssetsRequest, + O: QueryAssetsResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/deploy/assetmanagerd/v1/asset_pb.ts b/internal/proto/generated/proto/deploy/assetmanagerd/v1/asset_pb.ts new file mode 100644 index 0000000000..7c976c979d --- /dev/null +++ b/internal/proto/generated/proto/deploy/assetmanagerd/v1/asset_pb.ts @@ -0,0 +1,1690 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/deploy/assetmanagerd/v1/asset.proto (package deploy.assetmanagerd.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * @generated from enum deploy.assetmanagerd.v1.AssetType + */ +export enum AssetType { + /** + * @generated from enum value: ASSET_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: ASSET_TYPE_KERNEL = 1; + */ + KERNEL = 1, + + /** + * @generated from enum value: ASSET_TYPE_ROOTFS = 2; + */ + ROOTFS = 2, + + /** + * @generated from enum value: ASSET_TYPE_INITRD = 3; + */ + INITRD = 3, + + /** + * @generated from enum value: ASSET_TYPE_DISK_IMAGE = 4; + */ + DISK_IMAGE = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(AssetType) +proto3.util.setEnumType(AssetType, "deploy.assetmanagerd.v1.AssetType", [ + { no: 0, name: "ASSET_TYPE_UNSPECIFIED" }, + { no: 1, name: "ASSET_TYPE_KERNEL" }, + { no: 2, name: "ASSET_TYPE_ROOTFS" }, + { no: 3, name: "ASSET_TYPE_INITRD" }, + { no: 4, name: "ASSET_TYPE_DISK_IMAGE" }, +]); + +/** + * @generated from enum deploy.assetmanagerd.v1.AssetStatus + */ +export enum AssetStatus { + /** + * @generated from enum value: ASSET_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: ASSET_STATUS_UPLOADING = 1; + */ + UPLOADING = 1, + + /** + * @generated from enum value: ASSET_STATUS_AVAILABLE = 2; + */ + AVAILABLE = 2, + + /** + * @generated from enum value: ASSET_STATUS_DELETING = 3; + */ + DELETING = 3, + + /** + * @generated from enum value: ASSET_STATUS_ERROR = 4; + */ + ERROR = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(AssetStatus) +proto3.util.setEnumType(AssetStatus, "deploy.assetmanagerd.v1.AssetStatus", [ + { no: 0, name: "ASSET_STATUS_UNSPECIFIED" }, + { no: 1, name: "ASSET_STATUS_UPLOADING" }, + { no: 2, name: "ASSET_STATUS_AVAILABLE" }, + { no: 3, name: "ASSET_STATUS_DELETING" }, + { no: 4, name: "ASSET_STATUS_ERROR" }, +]); + +/** + * @generated from enum deploy.assetmanagerd.v1.StorageBackend + */ +export enum StorageBackend { + /** + * @generated from enum value: STORAGE_BACKEND_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: STORAGE_BACKEND_LOCAL = 1; + */ + LOCAL = 1, + + /** + * @generated from enum value: STORAGE_BACKEND_S3 = 2; + */ + S3 = 2, + + /** + * @generated from enum value: STORAGE_BACKEND_HTTP = 3; + */ + HTTP = 3, + + /** + * @generated from enum value: STORAGE_BACKEND_NFS = 4; + */ + NFS = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(StorageBackend) +proto3.util.setEnumType(StorageBackend, "deploy.assetmanagerd.v1.StorageBackend", [ + { no: 0, name: "STORAGE_BACKEND_UNSPECIFIED" }, + { no: 1, name: "STORAGE_BACKEND_LOCAL" }, + { no: 2, name: "STORAGE_BACKEND_S3" }, + { no: 3, name: "STORAGE_BACKEND_HTTP" }, + { no: 4, name: "STORAGE_BACKEND_NFS" }, +]); + +/** + * @generated from message deploy.assetmanagerd.v1.Asset + */ +export class Asset extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string name = 2; + */ + name = ""; + + /** + * @generated from field: deploy.assetmanagerd.v1.AssetType type = 3; + */ + type = AssetType.UNSPECIFIED; + + /** + * @generated from field: deploy.assetmanagerd.v1.AssetStatus status = 4; + */ + status = AssetStatus.UNSPECIFIED; + + /** + * Storage information + * + * @generated from field: deploy.assetmanagerd.v1.StorageBackend backend = 5; + */ + backend = StorageBackend.UNSPECIFIED; + + /** + * Path or URL depending on backend + * + * @generated from field: string location = 6; + */ + location = ""; + + /** + * @generated from field: int64 size_bytes = 7; + */ + sizeBytes = protoInt64.zero; + + /** + * SHA256 + * + * @generated from field: string checksum = 8; + */ + checksum = ""; + + /** + * Metadata + * + * @generated from field: map labels = 9; + */ + labels: { [key: string]: string } = {}; + + /** + * e.g., "builderd", "manual" + * + * @generated from field: string created_by = 10; + */ + createdBy = ""; + + /** + * Unix timestamp + * + * @generated from field: int64 created_at = 11; + */ + createdAt = protoInt64.zero; + + /** + * @generated from field: int64 last_accessed_at = 12; + */ + lastAccessedAt = protoInt64.zero; + + /** + * Reference counting for GC + * + * @generated from field: int32 reference_count = 13; + */ + referenceCount = 0; + + /** + * Build information (if created by builderd) + * + * @generated from field: string build_id = 14; + */ + buildId = ""; + + /** + * @generated from field: string source_image = 15; + */ + sourceImage = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.Asset"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "type", kind: "enum", T: proto3.getEnumType(AssetType) }, + { no: 4, name: "status", kind: "enum", T: proto3.getEnumType(AssetStatus) }, + { no: 5, name: "backend", kind: "enum", T: proto3.getEnumType(StorageBackend) }, + { no: 6, name: "location", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 8, name: "checksum", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 9, + name: "labels", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 10, name: "created_by", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 12, name: "last_accessed_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 13, name: "reference_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 14, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 15, name: "source_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Asset { + return new Asset().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Asset { + return new Asset().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Asset { + return new Asset().fromJsonString(jsonString, options); + } + + static equals( + a: Asset | PlainMessage | undefined, + b: Asset | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Asset, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.UploadAssetRequest + */ +export class UploadAssetRequest extends Message { + /** + * @generated from oneof deploy.assetmanagerd.v1.UploadAssetRequest.data + */ + data: + | { + /** + * @generated from field: deploy.assetmanagerd.v1.UploadAssetMetadata metadata = 1; + */ + value: UploadAssetMetadata; + case: "metadata"; + } + | { + /** + * @generated from field: bytes chunk = 2; + */ + value: Uint8Array; + case: "chunk"; + } + | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.UploadAssetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "metadata", kind: "message", T: UploadAssetMetadata, oneof: "data" }, + { no: 2, name: "chunk", kind: "scalar", T: 12 /* ScalarType.BYTES */, oneof: "data" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UploadAssetRequest { + return new UploadAssetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UploadAssetRequest { + return new UploadAssetRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): UploadAssetRequest { + return new UploadAssetRequest().fromJsonString(jsonString, options); + } + + static equals( + a: UploadAssetRequest | PlainMessage | undefined, + b: UploadAssetRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(UploadAssetRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.UploadAssetMetadata + */ +export class UploadAssetMetadata extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + /** + * @generated from field: deploy.assetmanagerd.v1.AssetType type = 2; + */ + type = AssetType.UNSPECIFIED; + + /** + * @generated from field: int64 size_bytes = 3; + */ + sizeBytes = protoInt64.zero; + + /** + * @generated from field: map labels = 4; + */ + labels: { [key: string]: string } = {}; + + /** + * @generated from field: string created_by = 5; + */ + createdBy = ""; + + /** + * @generated from field: string build_id = 6; + */ + buildId = ""; + + /** + * @generated from field: string source_image = 7; + */ + sourceImage = ""; + + /** + * Optional: specific asset ID to use + * + * @generated from field: string id = 8; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.UploadAssetMetadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AssetType) }, + { no: 3, name: "size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { + no: 4, + name: "labels", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 5, name: "created_by", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "source_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UploadAssetMetadata { + return new UploadAssetMetadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UploadAssetMetadata { + return new UploadAssetMetadata().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): UploadAssetMetadata { + return new UploadAssetMetadata().fromJsonString(jsonString, options); + } + + static equals( + a: UploadAssetMetadata | PlainMessage | undefined, + b: UploadAssetMetadata | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(UploadAssetMetadata, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.UploadAssetResponse + */ +export class UploadAssetResponse extends Message { + /** + * @generated from field: deploy.assetmanagerd.v1.Asset asset = 1; + */ + asset?: Asset; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.UploadAssetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset", kind: "message", T: Asset }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UploadAssetResponse { + return new UploadAssetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UploadAssetResponse { + return new UploadAssetResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): UploadAssetResponse { + return new UploadAssetResponse().fromJsonString(jsonString, options); + } + + static equals( + a: UploadAssetResponse | PlainMessage | undefined, + b: UploadAssetResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(UploadAssetResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.RegisterAssetRequest + */ +export class RegisterAssetRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + /** + * @generated from field: deploy.assetmanagerd.v1.AssetType type = 2; + */ + type = AssetType.UNSPECIFIED; + + /** + * @generated from field: deploy.assetmanagerd.v1.StorageBackend backend = 3; + */ + backend = StorageBackend.UNSPECIFIED; + + /** + * @generated from field: string location = 4; + */ + location = ""; + + /** + * @generated from field: int64 size_bytes = 5; + */ + sizeBytes = protoInt64.zero; + + /** + * @generated from field: string checksum = 6; + */ + checksum = ""; + + /** + * @generated from field: map labels = 7; + */ + labels: { [key: string]: string } = {}; + + /** + * @generated from field: string created_by = 8; + */ + createdBy = ""; + + /** + * Optional build information + * + * @generated from field: string build_id = 9; + */ + buildId = ""; + + /** + * @generated from field: string source_image = 10; + */ + sourceImage = ""; + + /** + * Optional: specific asset ID to use (if not provided, one will be generated) + * + * @generated from field: string id = 11; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.RegisterAssetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "type", kind: "enum", T: proto3.getEnumType(AssetType) }, + { no: 3, name: "backend", kind: "enum", T: proto3.getEnumType(StorageBackend) }, + { no: 4, name: "location", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "checksum", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 7, + name: "labels", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 8, name: "created_by", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 9, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 10, name: "source_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterAssetRequest { + return new RegisterAssetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterAssetRequest { + return new RegisterAssetRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): RegisterAssetRequest { + return new RegisterAssetRequest().fromJsonString(jsonString, options); + } + + static equals( + a: RegisterAssetRequest | PlainMessage | undefined, + b: RegisterAssetRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RegisterAssetRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.RegisterAssetResponse + */ +export class RegisterAssetResponse extends Message { + /** + * @generated from field: deploy.assetmanagerd.v1.Asset asset = 1; + */ + asset?: Asset; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.RegisterAssetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset", kind: "message", T: Asset }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): RegisterAssetResponse { + return new RegisterAssetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterAssetResponse { + return new RegisterAssetResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): RegisterAssetResponse { + return new RegisterAssetResponse().fromJsonString(jsonString, options); + } + + static equals( + a: RegisterAssetResponse | PlainMessage | undefined, + b: RegisterAssetResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RegisterAssetResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.GetAssetRequest + */ +export class GetAssetRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * If true, ensures asset is available locally (downloads if needed) + * + * @generated from field: bool ensure_local = 2; + */ + ensureLocal = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.GetAssetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "ensure_local", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAssetRequest { + return new GetAssetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAssetRequest { + return new GetAssetRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAssetRequest { + return new GetAssetRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetAssetRequest | PlainMessage | undefined, + b: GetAssetRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetAssetRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.GetAssetResponse + */ +export class GetAssetResponse extends Message { + /** + * @generated from field: deploy.assetmanagerd.v1.Asset asset = 1; + */ + asset?: Asset; + + /** + * Local path if ensure_local was true + * + * @generated from field: string local_path = 2; + */ + localPath = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.GetAssetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset", kind: "message", T: Asset }, + { no: 2, name: "local_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAssetResponse { + return new GetAssetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAssetResponse { + return new GetAssetResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAssetResponse { + return new GetAssetResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetAssetResponse | PlainMessage | undefined, + b: GetAssetResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetAssetResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.ListAssetsRequest + */ +export class ListAssetsRequest extends Message { + /** + * Filter by type + * + * @generated from field: deploy.assetmanagerd.v1.AssetType type = 1; + */ + type = AssetType.UNSPECIFIED; + + /** + * Filter by status + * + * @generated from field: deploy.assetmanagerd.v1.AssetStatus status = 2; + */ + status = AssetStatus.UNSPECIFIED; + + /** + * Filter by labels (all must match) + * + * @generated from field: map label_selector = 3; + */ + labelSelector: { [key: string]: string } = {}; + + /** + * Pagination + * + * @generated from field: int32 page_size = 4; + */ + pageSize = 0; + + /** + * @generated from field: string page_token = 5; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.ListAssetsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AssetType) }, + { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(AssetStatus) }, + { + no: 3, + name: "label_selector", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 4, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 5, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAssetsRequest { + return new ListAssetsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAssetsRequest { + return new ListAssetsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListAssetsRequest { + return new ListAssetsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ListAssetsRequest | PlainMessage | undefined, + b: ListAssetsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListAssetsRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.ListAssetsResponse + */ +export class ListAssetsResponse extends Message { + /** + * @generated from field: repeated deploy.assetmanagerd.v1.Asset assets = 1; + */ + assets: Asset[] = []; + + /** + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.ListAssetsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "assets", kind: "message", T: Asset, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListAssetsResponse { + return new ListAssetsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListAssetsResponse { + return new ListAssetsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ListAssetsResponse { + return new ListAssetsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ListAssetsResponse | PlainMessage | undefined, + b: ListAssetsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListAssetsResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.AcquireAssetRequest + */ +export class AcquireAssetRequest extends Message { + /** + * @generated from field: string asset_id = 1; + */ + assetId = ""; + + /** + * e.g., "vm-123" + * + * @generated from field: string acquired_by = 2; + */ + acquiredBy = ""; + + /** + * Optional auto-release after TTL + * + * @generated from field: int64 ttl_seconds = 3; + */ + ttlSeconds = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.AcquireAssetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "acquired_by", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "ttl_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AcquireAssetRequest { + return new AcquireAssetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AcquireAssetRequest { + return new AcquireAssetRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): AcquireAssetRequest { + return new AcquireAssetRequest().fromJsonString(jsonString, options); + } + + static equals( + a: AcquireAssetRequest | PlainMessage | undefined, + b: AcquireAssetRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(AcquireAssetRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.AcquireAssetResponse + */ +export class AcquireAssetResponse extends Message { + /** + * @generated from field: deploy.assetmanagerd.v1.Asset asset = 1; + */ + asset?: Asset; + + /** + * Use this for release + * + * @generated from field: string lease_id = 2; + */ + leaseId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.AcquireAssetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset", kind: "message", T: Asset }, + { no: 2, name: "lease_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AcquireAssetResponse { + return new AcquireAssetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AcquireAssetResponse { + return new AcquireAssetResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): AcquireAssetResponse { + return new AcquireAssetResponse().fromJsonString(jsonString, options); + } + + static equals( + a: AcquireAssetResponse | PlainMessage | undefined, + b: AcquireAssetResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(AcquireAssetResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.ReleaseAssetRequest + */ +export class ReleaseAssetRequest extends Message { + /** + * @generated from field: string lease_id = 1; + */ + leaseId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.ReleaseAssetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "lease_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReleaseAssetRequest { + return new ReleaseAssetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReleaseAssetRequest { + return new ReleaseAssetRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ReleaseAssetRequest { + return new ReleaseAssetRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ReleaseAssetRequest | PlainMessage | undefined, + b: ReleaseAssetRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ReleaseAssetRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.ReleaseAssetResponse + */ +export class ReleaseAssetResponse extends Message { + /** + * @generated from field: deploy.assetmanagerd.v1.Asset asset = 1; + */ + asset?: Asset; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.ReleaseAssetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset", kind: "message", T: Asset }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReleaseAssetResponse { + return new ReleaseAssetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReleaseAssetResponse { + return new ReleaseAssetResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ReleaseAssetResponse { + return new ReleaseAssetResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ReleaseAssetResponse | PlainMessage | undefined, + b: ReleaseAssetResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ReleaseAssetResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.DeleteAssetRequest + */ +export class DeleteAssetRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Delete even if ref count > 0 + * + * @generated from field: bool force = 2; + */ + force = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.DeleteAssetRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAssetRequest { + return new DeleteAssetRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAssetRequest { + return new DeleteAssetRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): DeleteAssetRequest { + return new DeleteAssetRequest().fromJsonString(jsonString, options); + } + + static equals( + a: DeleteAssetRequest | PlainMessage | undefined, + b: DeleteAssetRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeleteAssetRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.DeleteAssetResponse + */ +export class DeleteAssetResponse extends Message { + /** + * @generated from field: bool deleted = 1; + */ + deleted = false; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.DeleteAssetResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "deleted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAssetResponse { + return new DeleteAssetResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAssetResponse { + return new DeleteAssetResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): DeleteAssetResponse { + return new DeleteAssetResponse().fromJsonString(jsonString, options); + } + + static equals( + a: DeleteAssetResponse | PlainMessage | undefined, + b: DeleteAssetResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeleteAssetResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.GarbageCollectRequest + */ +export class GarbageCollectRequest extends Message { + /** + * Delete assets not accessed in this many seconds + * + * @generated from field: int64 max_age_seconds = 1; + */ + maxAgeSeconds = protoInt64.zero; + + /** + * Delete assets with 0 references + * + * @generated from field: bool delete_unreferenced = 2; + */ + deleteUnreferenced = false; + + /** + * Dry run - just return what would be deleted + * + * @generated from field: bool dry_run = 3; + */ + dryRun = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.GarbageCollectRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "max_age_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "delete_unreferenced", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "dry_run", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GarbageCollectRequest { + return new GarbageCollectRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GarbageCollectRequest { + return new GarbageCollectRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GarbageCollectRequest { + return new GarbageCollectRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GarbageCollectRequest | PlainMessage | undefined, + b: GarbageCollectRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GarbageCollectRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.GarbageCollectResponse + */ +export class GarbageCollectResponse extends Message { + /** + * @generated from field: repeated deploy.assetmanagerd.v1.Asset deleted_assets = 1; + */ + deletedAssets: Asset[] = []; + + /** + * @generated from field: int64 bytes_freed = 2; + */ + bytesFreed = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.GarbageCollectResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "deleted_assets", kind: "message", T: Asset, repeated: true }, + { no: 2, name: "bytes_freed", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GarbageCollectResponse { + return new GarbageCollectResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GarbageCollectResponse { + return new GarbageCollectResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GarbageCollectResponse { + return new GarbageCollectResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GarbageCollectResponse | PlainMessage | undefined, + b: GarbageCollectResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GarbageCollectResponse, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.PrepareAssetsRequest + */ +export class PrepareAssetsRequest extends Message { + /** + * @generated from field: repeated string asset_ids = 1; + */ + assetIds: string[] = []; + + /** + * e.g., jailer chroot path + * + * @generated from field: string target_path = 2; + */ + targetPath = ""; + + /** + * e.g., "vm-123" + * + * @generated from field: string prepared_for = 3; + */ + preparedFor = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.PrepareAssetsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "asset_ids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "target_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "prepared_for", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PrepareAssetsRequest { + return new PrepareAssetsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PrepareAssetsRequest { + return new PrepareAssetsRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): PrepareAssetsRequest { + return new PrepareAssetsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: PrepareAssetsRequest | PlainMessage | undefined, + b: PrepareAssetsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PrepareAssetsRequest, a, b); + } +} + +/** + * @generated from message deploy.assetmanagerd.v1.PrepareAssetsResponse + */ +export class PrepareAssetsResponse extends Message { + /** + * asset_id -> local path + * + * @generated from field: map asset_paths = 1; + */ + assetPaths: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.PrepareAssetsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: "asset_paths", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): PrepareAssetsResponse { + return new PrepareAssetsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PrepareAssetsResponse { + return new PrepareAssetsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): PrepareAssetsResponse { + return new PrepareAssetsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: PrepareAssetsResponse | PlainMessage | undefined, + b: PrepareAssetsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PrepareAssetsResponse, a, b); + } +} + +/** + * QueryAssetsRequest is similar to ListAssetsRequest but with build options + * + * @generated from message deploy.assetmanagerd.v1.QueryAssetsRequest + */ +export class QueryAssetsRequest extends Message { + /** + * Filter by type + * + * @generated from field: deploy.assetmanagerd.v1.AssetType type = 1; + */ + type = AssetType.UNSPECIFIED; + + /** + * Filter by status + * + * @generated from field: deploy.assetmanagerd.v1.AssetStatus status = 2; + */ + status = AssetStatus.UNSPECIFIED; + + /** + * Filter by labels (all must match) + * + * @generated from field: map label_selector = 3; + */ + labelSelector: { [key: string]: string } = {}; + + /** + * Pagination + * + * @generated from field: int32 page_size = 4; + */ + pageSize = 0; + + /** + * @generated from field: string page_token = 5; + */ + pageToken = ""; + + /** + * Build options - if asset not found and these are set, trigger build + * + * @generated from field: deploy.assetmanagerd.v1.BuildOptions build_options = 6; + */ + buildOptions?: BuildOptions; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.QueryAssetsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(AssetType) }, + { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(AssetStatus) }, + { + no: 3, + name: "label_selector", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 4, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 5, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "build_options", kind: "message", T: BuildOptions }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAssetsRequest { + return new QueryAssetsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAssetsRequest { + return new QueryAssetsRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): QueryAssetsRequest { + return new QueryAssetsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: QueryAssetsRequest | PlainMessage | undefined, + b: QueryAssetsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(QueryAssetsRequest, a, b); + } +} + +/** + * BuildOptions controls automatic asset creation + * + * @generated from message deploy.assetmanagerd.v1.BuildOptions + */ +export class BuildOptions extends Message { + /** + * Enable automatic building if assets don't exist + * + * @generated from field: bool enable_auto_build = 1; + */ + enableAutoBuild = false; + + /** + * Wait for build completion before returning + * + * @generated from field: bool wait_for_completion = 2; + */ + waitForCompletion = false; + + /** + * Timeout for build operation (seconds) + * + * @generated from field: int32 build_timeout_seconds = 3; + */ + buildTimeoutSeconds = 0; + + /** + * Additional labels to add to the built asset + * + * @generated from field: map build_labels = 4; + */ + buildLabels: { [key: string]: string } = {}; + + /** + * Tenant context for build authorization + * + * @generated from field: string tenant_id = 5; + */ + tenantId = ""; + + /** + * Suggested asset ID to use when registering the built asset + * This allows the caller to know the asset ID before it's built + * + * @generated from field: string suggested_asset_id = 6; + */ + suggestedAssetId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.BuildOptions"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "enable_auto_build", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "wait_for_completion", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "build_timeout_seconds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { + no: 4, + name: "build_labels", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 5, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "suggested_asset_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildOptions { + return new BuildOptions().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildOptions { + return new BuildOptions().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildOptions { + return new BuildOptions().fromJsonString(jsonString, options); + } + + static equals( + a: BuildOptions | PlainMessage | undefined, + b: BuildOptions | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildOptions, a, b); + } +} + +/** + * QueryAssetsResponse includes build information if builds were triggered + * + * @generated from message deploy.assetmanagerd.v1.QueryAssetsResponse + */ +export class QueryAssetsResponse extends Message { + /** + * @generated from field: repeated deploy.assetmanagerd.v1.Asset assets = 1; + */ + assets: Asset[] = []; + + /** + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + /** + * Information about any builds that were triggered + * + * @generated from field: repeated deploy.assetmanagerd.v1.BuildInfo triggered_builds = 3; + */ + triggeredBuilds: BuildInfo[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.QueryAssetsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "assets", kind: "message", T: Asset, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "triggered_builds", kind: "message", T: BuildInfo, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAssetsResponse { + return new QueryAssetsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAssetsResponse { + return new QueryAssetsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): QueryAssetsResponse { + return new QueryAssetsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: QueryAssetsResponse | PlainMessage | undefined, + b: QueryAssetsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(QueryAssetsResponse, a, b); + } +} + +/** + * BuildInfo provides information about triggered builds + * + * @generated from message deploy.assetmanagerd.v1.BuildInfo + */ +export class BuildInfo extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * @generated from field: string docker_image = 2; + */ + dockerImage = ""; + + /** + * "pending", "building", "completed", "failed" + * + * @generated from field: string status = 3; + */ + status = ""; + + /** + * @generated from field: string error_message = 4; + */ + errorMessage = ""; + + /** + * Asset ID if build completed and asset was registered + * + * @generated from field: string asset_id = 5; + */ + assetId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.assetmanagerd.v1.BuildInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "docker_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "error_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "asset_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildInfo { + return new BuildInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildInfo { + return new BuildInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildInfo { + return new BuildInfo().fromJsonString(jsonString, options); + } + + static equals( + a: BuildInfo | PlainMessage | undefined, + b: BuildInfo | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildInfo, a, b); + } +} diff --git a/internal/proto/generated/proto/deploy/billaged/v1/billing_connect.ts b/internal/proto/generated/proto/deploy/billaged/v1/billing_connect.ts new file mode 100644 index 0000000000..4359e113b9 --- /dev/null +++ b/internal/proto/generated/proto/deploy/billaged/v1/billing_connect.ts @@ -0,0 +1,72 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/deploy/billaged/v1/billing.proto (package deploy.billaged.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + NotifyPossibleGapRequest, + NotifyPossibleGapResponse, + NotifyVmStartedRequest, + NotifyVmStartedResponse, + NotifyVmStoppedRequest, + NotifyVmStoppedResponse, + SendHeartbeatRequest, + SendHeartbeatResponse, + SendMetricsBatchRequest, + SendMetricsBatchResponse, +} from "./billing_pb.js"; + +/** + * @generated from service deploy.billaged.v1.BillingService + */ +export const BillingService = { + typeName: "deploy.billaged.v1.BillingService", + methods: { + /** + * @generated from rpc deploy.billaged.v1.BillingService.SendMetricsBatch + */ + sendMetricsBatch: { + name: "SendMetricsBatch", + I: SendMetricsBatchRequest, + O: SendMetricsBatchResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc deploy.billaged.v1.BillingService.SendHeartbeat + */ + sendHeartbeat: { + name: "SendHeartbeat", + I: SendHeartbeatRequest, + O: SendHeartbeatResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc deploy.billaged.v1.BillingService.NotifyVmStarted + */ + notifyVmStarted: { + name: "NotifyVmStarted", + I: NotifyVmStartedRequest, + O: NotifyVmStartedResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc deploy.billaged.v1.BillingService.NotifyVmStopped + */ + notifyVmStopped: { + name: "NotifyVmStopped", + I: NotifyVmStoppedRequest, + O: NotifyVmStoppedResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc deploy.billaged.v1.BillingService.NotifyPossibleGap + */ + notifyPossibleGap: { + name: "NotifyPossibleGap", + I: NotifyPossibleGapRequest, + O: NotifyPossibleGapResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/deploy/billaged/v1/billing_pb.ts b/internal/proto/generated/proto/deploy/billaged/v1/billing_pb.ts new file mode 100644 index 0000000000..d57e7c43f0 --- /dev/null +++ b/internal/proto/generated/proto/deploy/billaged/v1/billing_pb.ts @@ -0,0 +1,625 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/deploy/billaged/v1/billing.proto (package deploy.billaged.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, Timestamp, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * @generated from message deploy.billaged.v1.VMMetrics + */ +export class VMMetrics extends Message { + /** + * @generated from field: google.protobuf.Timestamp timestamp = 1; + */ + timestamp?: Timestamp; + + /** + * @generated from field: int64 cpu_time_nanos = 2; + */ + cpuTimeNanos = protoInt64.zero; + + /** + * @generated from field: int64 memory_usage_bytes = 3; + */ + memoryUsageBytes = protoInt64.zero; + + /** + * @generated from field: int64 disk_read_bytes = 4; + */ + diskReadBytes = protoInt64.zero; + + /** + * @generated from field: int64 disk_write_bytes = 5; + */ + diskWriteBytes = protoInt64.zero; + + /** + * @generated from field: int64 network_rx_bytes = 6; + */ + networkRxBytes = protoInt64.zero; + + /** + * @generated from field: int64 network_tx_bytes = 7; + */ + networkTxBytes = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.VMMetrics"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "timestamp", kind: "message", T: Timestamp }, + { no: 2, name: "cpu_time_nanos", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "memory_usage_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "disk_read_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "disk_write_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "network_rx_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 7, name: "network_tx_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VMMetrics { + return new VMMetrics().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VMMetrics { + return new VMMetrics().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VMMetrics { + return new VMMetrics().fromJsonString(jsonString, options); + } + + static equals( + a: VMMetrics | PlainMessage | undefined, + b: VMMetrics | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(VMMetrics, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.SendMetricsBatchRequest + */ +export class SendMetricsBatchRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * @generated from field: string customer_id = 2; + */ + customerId = ""; + + /** + * @generated from field: repeated deploy.billaged.v1.VMMetrics metrics = 3; + */ + metrics: VMMetrics[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.SendMetricsBatchRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "customer_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "metrics", kind: "message", T: VMMetrics, repeated: true }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): SendMetricsBatchRequest { + return new SendMetricsBatchRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): SendMetricsBatchRequest { + return new SendMetricsBatchRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): SendMetricsBatchRequest { + return new SendMetricsBatchRequest().fromJsonString(jsonString, options); + } + + static equals( + a: SendMetricsBatchRequest | PlainMessage | undefined, + b: SendMetricsBatchRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SendMetricsBatchRequest, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.SendMetricsBatchResponse + */ +export class SendMetricsBatchResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.SendMetricsBatchResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): SendMetricsBatchResponse { + return new SendMetricsBatchResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): SendMetricsBatchResponse { + return new SendMetricsBatchResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): SendMetricsBatchResponse { + return new SendMetricsBatchResponse().fromJsonString(jsonString, options); + } + + static equals( + a: SendMetricsBatchResponse | PlainMessage | undefined, + b: SendMetricsBatchResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SendMetricsBatchResponse, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.SendHeartbeatRequest + */ +export class SendHeartbeatRequest extends Message { + /** + * @generated from field: string instance_id = 1; + */ + instanceId = ""; + + /** + * @generated from field: repeated string active_vms = 2; + */ + activeVms: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.SendHeartbeatRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "instance_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "active_vms", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SendHeartbeatRequest { + return new SendHeartbeatRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendHeartbeatRequest { + return new SendHeartbeatRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): SendHeartbeatRequest { + return new SendHeartbeatRequest().fromJsonString(jsonString, options); + } + + static equals( + a: SendHeartbeatRequest | PlainMessage | undefined, + b: SendHeartbeatRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SendHeartbeatRequest, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.SendHeartbeatResponse + */ +export class SendHeartbeatResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.SendHeartbeatResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): SendHeartbeatResponse { + return new SendHeartbeatResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendHeartbeatResponse { + return new SendHeartbeatResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): SendHeartbeatResponse { + return new SendHeartbeatResponse().fromJsonString(jsonString, options); + } + + static equals( + a: SendHeartbeatResponse | PlainMessage | undefined, + b: SendHeartbeatResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SendHeartbeatResponse, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.NotifyVmStartedRequest + */ +export class NotifyVmStartedRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * @generated from field: string customer_id = 2; + */ + customerId = ""; + + /** + * @generated from field: int64 start_time = 3; + */ + startTime = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.NotifyVmStartedRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "customer_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "start_time", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): NotifyVmStartedRequest { + return new NotifyVmStartedRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): NotifyVmStartedRequest { + return new NotifyVmStartedRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): NotifyVmStartedRequest { + return new NotifyVmStartedRequest().fromJsonString(jsonString, options); + } + + static equals( + a: NotifyVmStartedRequest | PlainMessage | undefined, + b: NotifyVmStartedRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NotifyVmStartedRequest, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.NotifyVmStartedResponse + */ +export class NotifyVmStartedResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.NotifyVmStartedResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): NotifyVmStartedResponse { + return new NotifyVmStartedResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): NotifyVmStartedResponse { + return new NotifyVmStartedResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): NotifyVmStartedResponse { + return new NotifyVmStartedResponse().fromJsonString(jsonString, options); + } + + static equals( + a: NotifyVmStartedResponse | PlainMessage | undefined, + b: NotifyVmStartedResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NotifyVmStartedResponse, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.NotifyVmStoppedRequest + */ +export class NotifyVmStoppedRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * @generated from field: int64 stop_time = 2; + */ + stopTime = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.NotifyVmStoppedRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "stop_time", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): NotifyVmStoppedRequest { + return new NotifyVmStoppedRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): NotifyVmStoppedRequest { + return new NotifyVmStoppedRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): NotifyVmStoppedRequest { + return new NotifyVmStoppedRequest().fromJsonString(jsonString, options); + } + + static equals( + a: NotifyVmStoppedRequest | PlainMessage | undefined, + b: NotifyVmStoppedRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NotifyVmStoppedRequest, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.NotifyVmStoppedResponse + */ +export class NotifyVmStoppedResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.NotifyVmStoppedResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): NotifyVmStoppedResponse { + return new NotifyVmStoppedResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): NotifyVmStoppedResponse { + return new NotifyVmStoppedResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): NotifyVmStoppedResponse { + return new NotifyVmStoppedResponse().fromJsonString(jsonString, options); + } + + static equals( + a: NotifyVmStoppedResponse | PlainMessage | undefined, + b: NotifyVmStoppedResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NotifyVmStoppedResponse, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.NotifyPossibleGapRequest + */ +export class NotifyPossibleGapRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * @generated from field: int64 last_sent = 2; + */ + lastSent = protoInt64.zero; + + /** + * @generated from field: int64 resume_time = 3; + */ + resumeTime = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.NotifyPossibleGapRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "last_sent", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "resume_time", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): NotifyPossibleGapRequest { + return new NotifyPossibleGapRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): NotifyPossibleGapRequest { + return new NotifyPossibleGapRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): NotifyPossibleGapRequest { + return new NotifyPossibleGapRequest().fromJsonString(jsonString, options); + } + + static equals( + a: NotifyPossibleGapRequest | PlainMessage | undefined, + b: NotifyPossibleGapRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NotifyPossibleGapRequest, a, b); + } +} + +/** + * @generated from message deploy.billaged.v1.NotifyPossibleGapResponse + */ +export class NotifyPossibleGapResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.billaged.v1.NotifyPossibleGapResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): NotifyPossibleGapResponse { + return new NotifyPossibleGapResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): NotifyPossibleGapResponse { + return new NotifyPossibleGapResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): NotifyPossibleGapResponse { + return new NotifyPossibleGapResponse().fromJsonString(jsonString, options); + } + + static equals( + a: NotifyPossibleGapResponse | PlainMessage | undefined, + b: NotifyPossibleGapResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NotifyPossibleGapResponse, a, b); + } +} diff --git a/internal/proto/generated/proto/deploy/builderd/v1/builder_connect.ts b/internal/proto/generated/proto/deploy/builderd/v1/builder_connect.ts new file mode 100644 index 0000000000..b0a17ad032 --- /dev/null +++ b/internal/proto/generated/proto/deploy/builderd/v1/builder_connect.ts @@ -0,0 +1,123 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/deploy/builderd/v1/builder.proto (package deploy.builderd.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + CancelBuildRequest, + CancelBuildResponse, + CreateBuildRequest, + CreateBuildResponse, + DeleteBuildRequest, + DeleteBuildResponse, + GetBuildRequest, + GetBuildResponse, + GetBuildStatsRequest, + GetBuildStatsResponse, + GetTenantQuotasRequest, + GetTenantQuotasResponse, + ListBuildsRequest, + ListBuildsResponse, + StreamBuildLogsRequest, + StreamBuildLogsResponse, +} from "./builder_pb.js"; + +/** + * BuilderService provides multi-tenant build execution for various source types + * + * @generated from service deploy.builderd.v1.BuilderService + */ +export const BuilderService = { + typeName: "deploy.builderd.v1.BuilderService", + methods: { + /** + * Create a new build job + * + * @generated from rpc deploy.builderd.v1.BuilderService.CreateBuild + */ + createBuild: { + name: "CreateBuild", + I: CreateBuildRequest, + O: CreateBuildResponse, + kind: MethodKind.Unary, + }, + /** + * Get build status and progress + * + * @generated from rpc deploy.builderd.v1.BuilderService.GetBuild + */ + getBuild: { + name: "GetBuild", + I: GetBuildRequest, + O: GetBuildResponse, + kind: MethodKind.Unary, + }, + /** + * List builds with filtering (tenant-scoped) + * + * @generated from rpc deploy.builderd.v1.BuilderService.ListBuilds + */ + listBuilds: { + name: "ListBuilds", + I: ListBuildsRequest, + O: ListBuildsResponse, + kind: MethodKind.Unary, + }, + /** + * Cancel a running build + * + * @generated from rpc deploy.builderd.v1.BuilderService.CancelBuild + */ + cancelBuild: { + name: "CancelBuild", + I: CancelBuildRequest, + O: CancelBuildResponse, + kind: MethodKind.Unary, + }, + /** + * Delete a build and its artifacts + * + * @generated from rpc deploy.builderd.v1.BuilderService.DeleteBuild + */ + deleteBuild: { + name: "DeleteBuild", + I: DeleteBuildRequest, + O: DeleteBuildResponse, + kind: MethodKind.Unary, + }, + /** + * Stream build logs in real-time + * + * @generated from rpc deploy.builderd.v1.BuilderService.StreamBuildLogs + */ + streamBuildLogs: { + name: "StreamBuildLogs", + I: StreamBuildLogsRequest, + O: StreamBuildLogsResponse, + kind: MethodKind.ServerStreaming, + }, + /** + * Get tenant quotas and usage + * + * @generated from rpc deploy.builderd.v1.BuilderService.GetTenantQuotas + */ + getTenantQuotas: { + name: "GetTenantQuotas", + I: GetTenantQuotasRequest, + O: GetTenantQuotasResponse, + kind: MethodKind.Unary, + }, + /** + * Get build statistics + * + * @generated from rpc deploy.builderd.v1.BuilderService.GetBuildStats + */ + getBuildStats: { + name: "GetBuildStats", + I: GetBuildStatsRequest, + O: GetBuildStatsResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/deploy/builderd/v1/builder_pb.ts b/internal/proto/generated/proto/deploy/builderd/v1/builder_pb.ts new file mode 100644 index 0000000000..a749911c94 --- /dev/null +++ b/internal/proto/generated/proto/deploy/builderd/v1/builder_pb.ts @@ -0,0 +1,3192 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/deploy/builderd/v1/builder.proto (package deploy.builderd.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, Timestamp, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * Build job lifecycle states + * + * @generated from enum deploy.builderd.v1.BuildState + */ +export enum BuildState { + /** + * @generated from enum value: BUILD_STATE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Job queued + * + * @generated from enum value: BUILD_STATE_PENDING = 1; + */ + PENDING = 1, + + /** + * Pulling Docker image or source + * + * @generated from enum value: BUILD_STATE_PULLING = 2; + */ + PULLING = 2, + + /** + * Extracting/preparing source + * + * @generated from enum value: BUILD_STATE_EXTRACTING = 3; + */ + EXTRACTING = 3, + + /** + * Building rootfs + * + * @generated from enum value: BUILD_STATE_BUILDING = 4; + */ + BUILDING = 4, + + /** + * Applying optimizations + * + * @generated from enum value: BUILD_STATE_OPTIMIZING = 5; + */ + OPTIMIZING = 5, + + /** + * Build successful + * + * @generated from enum value: BUILD_STATE_COMPLETED = 6; + */ + COMPLETED = 6, + + /** + * Build failed + * + * @generated from enum value: BUILD_STATE_FAILED = 7; + */ + FAILED = 7, + + /** + * Build cancelled + * + * @generated from enum value: BUILD_STATE_CANCELLED = 8; + */ + CANCELLED = 8, + + /** + * Cleaning up resources + * + * @generated from enum value: BUILD_STATE_CLEANING = 9; + */ + CLEANING = 9, +} +// Retrieve enum metadata with: proto3.getEnumType(BuildState) +proto3.util.setEnumType(BuildState, "deploy.builderd.v1.BuildState", [ + { no: 0, name: "BUILD_STATE_UNSPECIFIED" }, + { no: 1, name: "BUILD_STATE_PENDING" }, + { no: 2, name: "BUILD_STATE_PULLING" }, + { no: 3, name: "BUILD_STATE_EXTRACTING" }, + { no: 4, name: "BUILD_STATE_BUILDING" }, + { no: 5, name: "BUILD_STATE_OPTIMIZING" }, + { no: 6, name: "BUILD_STATE_COMPLETED" }, + { no: 7, name: "BUILD_STATE_FAILED" }, + { no: 8, name: "BUILD_STATE_CANCELLED" }, + { no: 9, name: "BUILD_STATE_CLEANING" }, +]); + +/** + * Tenant service tiers + * + * @generated from enum deploy.builderd.v1.TenantTier + */ +export enum TenantTier { + /** + * @generated from enum value: TENANT_TIER_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Limited resources + * + * @generated from enum value: TENANT_TIER_FREE = 1; + */ + FREE = 1, + + /** + * Standard resources + * + * @generated from enum value: TENANT_TIER_PRO = 2; + */ + PRO = 2, + + /** + * Higher limits + isolation + * + * @generated from enum value: TENANT_TIER_ENTERPRISE = 3; + */ + ENTERPRISE = 3, + + /** + * Dedicated infrastructure + * + * @generated from enum value: TENANT_TIER_DEDICATED = 4; + */ + DEDICATED = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(TenantTier) +proto3.util.setEnumType(TenantTier, "deploy.builderd.v1.TenantTier", [ + { no: 0, name: "TENANT_TIER_UNSPECIFIED" }, + { no: 1, name: "TENANT_TIER_FREE" }, + { no: 2, name: "TENANT_TIER_PRO" }, + { no: 3, name: "TENANT_TIER_ENTERPRISE" }, + { no: 4, name: "TENANT_TIER_DEDICATED" }, +]); + +/** + * Init process strategies for microVMs + * + * @generated from enum deploy.builderd.v1.InitStrategy + */ +export enum InitStrategy { + /** + * @generated from enum value: INIT_STRATEGY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Use tini as init (recommended) + * + * @generated from enum value: INIT_STRATEGY_TINI = 1; + */ + TINI = 1, + + /** + * Direct exec (risky) + * + * @generated from enum value: INIT_STRATEGY_DIRECT = 2; + */ + DIRECT = 2, + + /** + * Custom init script + * + * @generated from enum value: INIT_STRATEGY_CUSTOM = 3; + */ + CUSTOM = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(InitStrategy) +proto3.util.setEnumType(InitStrategy, "deploy.builderd.v1.InitStrategy", [ + { no: 0, name: "INIT_STRATEGY_UNSPECIFIED" }, + { no: 1, name: "INIT_STRATEGY_TINI" }, + { no: 2, name: "INIT_STRATEGY_DIRECT" }, + { no: 3, name: "INIT_STRATEGY_CUSTOM" }, +]); + +/** + * Multi-tenant context + * + * @generated from message deploy.builderd.v1.TenantContext + */ +export class TenantContext extends Message { + /** + * Primary tenant identifier + * + * @generated from field: string tenant_id = 1; + */ + tenantId = ""; + + /** + * Customer within tenant (for billing) + * + * @generated from field: string customer_id = 2; + */ + customerId = ""; + + /** + * Organization (for enterprise) + * + * @generated from field: string organization_id = 3; + */ + organizationId = ""; + + /** + * Service tier + * + * @generated from field: deploy.builderd.v1.TenantTier tier = 4; + */ + tier = TenantTier.UNSPECIFIED; + + /** + * Build permissions + * + * @generated from field: repeated string permissions = 5; + */ + permissions: string[] = []; + + /** + * Tenant metadata + * + * @generated from field: map metadata = 6; + */ + metadata: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.TenantContext"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "customer_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "tier", kind: "enum", T: proto3.getEnumType(TenantTier) }, + { no: 5, name: "permissions", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { + no: 6, + name: "metadata", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TenantContext { + return new TenantContext().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TenantContext { + return new TenantContext().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TenantContext { + return new TenantContext().fromJsonString(jsonString, options); + } + + static equals( + a: TenantContext | PlainMessage | undefined, + b: TenantContext | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(TenantContext, a, b); + } +} + +/** + * Build source types - extensible for future build types + * + * @generated from message deploy.builderd.v1.BuildSource + */ +export class BuildSource extends Message { + /** + * @generated from oneof deploy.builderd.v1.BuildSource.source_type + */ + sourceType: + | { + /** + * @generated from field: deploy.builderd.v1.DockerImageSource docker_image = 1; + */ + value: DockerImageSource; + case: "dockerImage"; + } + | { + /** + * @generated from field: deploy.builderd.v1.GitRepositorySource git_repository = 2; + */ + value: GitRepositorySource; + case: "gitRepository"; + } + | { + /** + * Future: nix_flake = 4, buildpack = 5, etc. + * + * @generated from field: deploy.builderd.v1.ArchiveSource archive = 3; + */ + value: ArchiveSource; + case: "archive"; + } + | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildSource"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "docker_image", kind: "message", T: DockerImageSource, oneof: "source_type" }, + { + no: 2, + name: "git_repository", + kind: "message", + T: GitRepositorySource, + oneof: "source_type", + }, + { no: 3, name: "archive", kind: "message", T: ArchiveSource, oneof: "source_type" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildSource { + return new BuildSource().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildSource { + return new BuildSource().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildSource { + return new BuildSource().fromJsonString(jsonString, options); + } + + static equals( + a: BuildSource | PlainMessage | undefined, + b: BuildSource | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildSource, a, b); + } +} + +/** + * Docker image extraction (first implementation) + * + * @generated from message deploy.builderd.v1.DockerImageSource + */ +export class DockerImageSource extends Message { + /** + * "ghcr.io/unkeyed/unkey:f4cfee5" + * + * @generated from field: string image_uri = 1; + */ + imageUri = ""; + + /** + * Registry authentication + * + * @generated from field: deploy.builderd.v1.DockerAuth auth = 2; + */ + auth?: DockerAuth; + + /** + * Additional tags to consider + * + * @generated from field: repeated string pull_tags = 3; + */ + pullTags: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.DockerImageSource"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "image_uri", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "auth", kind: "message", T: DockerAuth }, + { no: 3, name: "pull_tags", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DockerImageSource { + return new DockerImageSource().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DockerImageSource { + return new DockerImageSource().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DockerImageSource { + return new DockerImageSource().fromJsonString(jsonString, options); + } + + static equals( + a: DockerImageSource | PlainMessage | undefined, + b: DockerImageSource | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DockerImageSource, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.DockerAuth + */ +export class DockerAuth extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string password = 2; + */ + password = ""; + + /** + * @generated from field: string token = 3; + */ + token = ""; + + /** + * @generated from field: string registry = 4; + */ + registry = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.DockerAuth"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "registry", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DockerAuth { + return new DockerAuth().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DockerAuth { + return new DockerAuth().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DockerAuth { + return new DockerAuth().fromJsonString(jsonString, options); + } + + static equals( + a: DockerAuth | PlainMessage | undefined, + b: DockerAuth | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DockerAuth, a, b); + } +} + +/** + * Git repository builds (future) + * + * @generated from message deploy.builderd.v1.GitRepositorySource + */ +export class GitRepositorySource extends Message { + /** + * "https://github.com/unkeyed/unkey" + * + * @generated from field: string repository_url = 1; + */ + repositoryUrl = ""; + + /** + * branch/tag/commit + * + * @generated from field: string ref = 2; + */ + ref = ""; + + /** + * subdirectory if needed + * + * @generated from field: string build_context = 3; + */ + buildContext = ""; + + /** + * @generated from field: deploy.builderd.v1.GitAuth auth = 4; + */ + auth?: GitAuth; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GitRepositorySource"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "repository_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "ref", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "build_context", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "auth", kind: "message", T: GitAuth }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GitRepositorySource { + return new GitRepositorySource().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GitRepositorySource { + return new GitRepositorySource().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GitRepositorySource { + return new GitRepositorySource().fromJsonString(jsonString, options); + } + + static equals( + a: GitRepositorySource | PlainMessage | undefined, + b: GitRepositorySource | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GitRepositorySource, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GitAuth + */ +export class GitAuth extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string password = 2; + */ + password = ""; + + /** + * @generated from field: string ssh_key = 3; + */ + sshKey = ""; + + /** + * @generated from field: string token = 4; + */ + token = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GitAuth"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "ssh_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GitAuth { + return new GitAuth().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GitAuth { + return new GitAuth().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GitAuth { + return new GitAuth().fromJsonString(jsonString, options); + } + + static equals( + a: GitAuth | PlainMessage | undefined, + b: GitAuth | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GitAuth, a, b); + } +} + +/** + * Archive builds (future) + * + * @generated from message deploy.builderd.v1.ArchiveSource + */ +export class ArchiveSource extends Message { + /** + * URL to tar.gz, zip, etc. + * + * @generated from field: string archive_url = 1; + */ + archiveUrl = ""; + + /** + * "tar.gz", "zip" + * + * @generated from field: string archive_type = 2; + */ + archiveType = ""; + + /** + * subdirectory in archive + * + * @generated from field: string build_context = 3; + */ + buildContext = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.ArchiveSource"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "archive_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "archive_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "build_context", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ArchiveSource { + return new ArchiveSource().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ArchiveSource { + return new ArchiveSource().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ArchiveSource { + return new ArchiveSource().fromJsonString(jsonString, options); + } + + static equals( + a: ArchiveSource | PlainMessage | undefined, + b: ArchiveSource | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ArchiveSource, a, b); + } +} + +/** + * Build target types - extensible + * + * @generated from message deploy.builderd.v1.BuildTarget + */ +export class BuildTarget extends Message { + /** + * @generated from oneof deploy.builderd.v1.BuildTarget.target_type + */ + targetType: + | { + /** + * @generated from field: deploy.builderd.v1.MicroVMRootfs microvm_rootfs = 1; + */ + value: MicroVMRootfs; + case: "microvmRootfs"; + } + | { + /** + * Future: wasm_module = 3, lambda_layer = 4, etc. + * + * @generated from field: deploy.builderd.v1.ContainerImage container_image = 2; + */ + value: ContainerImage; + case: "containerImage"; + } + | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildTarget"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "microvm_rootfs", kind: "message", T: MicroVMRootfs, oneof: "target_type" }, + { no: 2, name: "container_image", kind: "message", T: ContainerImage, oneof: "target_type" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildTarget { + return new BuildTarget().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildTarget { + return new BuildTarget().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildTarget { + return new BuildTarget().fromJsonString(jsonString, options); + } + + static equals( + a: BuildTarget | PlainMessage | undefined, + b: BuildTarget | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildTarget, a, b); + } +} + +/** + * MicroVM rootfs (our focus) + * + * @generated from message deploy.builderd.v1.MicroVMRootfs + */ +export class MicroVMRootfs extends Message { + /** + * @generated from field: deploy.builderd.v1.InitStrategy init_strategy = 1; + */ + initStrategy = InitStrategy.UNSPECIFIED; + + /** + * @generated from field: deploy.builderd.v1.RuntimeConfig runtime_config = 2; + */ + runtimeConfig?: RuntimeConfig; + + /** + * @generated from field: deploy.builderd.v1.OptimizationSettings optimization = 3; + */ + optimization?: OptimizationSettings; + + /** + * @generated from field: repeated string preserve_paths = 4; + */ + preservePaths: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.MicroVMRootfs"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "init_strategy", kind: "enum", T: proto3.getEnumType(InitStrategy) }, + { no: 2, name: "runtime_config", kind: "message", T: RuntimeConfig }, + { no: 3, name: "optimization", kind: "message", T: OptimizationSettings }, + { no: 4, name: "preserve_paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MicroVMRootfs { + return new MicroVMRootfs().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MicroVMRootfs { + return new MicroVMRootfs().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MicroVMRootfs { + return new MicroVMRootfs().fromJsonString(jsonString, options); + } + + static equals( + a: MicroVMRootfs | PlainMessage | undefined, + b: MicroVMRootfs | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(MicroVMRootfs, a, b); + } +} + +/** + * Container image (future) + * + * @generated from message deploy.builderd.v1.ContainerImage + */ +export class ContainerImage extends Message { + /** + * @generated from field: string base_image = 1; + */ + baseImage = ""; + + /** + * @generated from field: repeated string layers = 2; + */ + layers: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.ContainerImage"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "base_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "layers", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ContainerImage { + return new ContainerImage().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ContainerImage { + return new ContainerImage().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ContainerImage { + return new ContainerImage().fromJsonString(jsonString, options); + } + + static equals( + a: ContainerImage | PlainMessage | undefined, + b: ContainerImage | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ContainerImage, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.RuntimeConfig + */ +export class RuntimeConfig extends Message { + /** + * Override CMD + * + * @generated from field: repeated string command = 1; + */ + command: string[] = []; + + /** + * Override ENTRYPOINT + * + * @generated from field: repeated string entrypoint = 2; + */ + entrypoint: string[] = []; + + /** + * Override WORKDIR + * + * @generated from field: string working_dir = 3; + */ + workingDir = ""; + + /** + * Environment variables + * + * @generated from field: map environment = 4; + */ + environment: { [key: string]: string } = {}; + + /** + * Ports to expose + * + * @generated from field: repeated string exposed_ports = 5; + */ + exposedPorts: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.RuntimeConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "command", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 2, name: "entrypoint", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 3, name: "working_dir", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: "environment", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 5, name: "exposed_ports", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RuntimeConfig { + return new RuntimeConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RuntimeConfig { + return new RuntimeConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RuntimeConfig { + return new RuntimeConfig().fromJsonString(jsonString, options); + } + + static equals( + a: RuntimeConfig | PlainMessage | undefined, + b: RuntimeConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RuntimeConfig, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.OptimizationSettings + */ +export class OptimizationSettings extends Message { + /** + * Strip debug info + * + * @generated from field: bool strip_debug_symbols = 1; + */ + stripDebugSymbols = false; + + /** + * Compress with UPX + * + * @generated from field: bool compress_binaries = 2; + */ + compressBinaries = false; + + /** + * Remove documentation + * + * @generated from field: bool remove_docs = 3; + */ + removeDocs = false; + + /** + * Remove package caches + * + * @generated from field: bool remove_cache = 4; + */ + removeCache = false; + + /** + * Paths to always keep + * + * @generated from field: repeated string preserve_paths = 5; + */ + preservePaths: string[] = []; + + /** + * Files to exclude + * + * @generated from field: repeated string exclude_patterns = 6; + */ + excludePatterns: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.OptimizationSettings"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "strip_debug_symbols", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "compress_binaries", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "remove_docs", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "remove_cache", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "preserve_paths", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { + no: 6, + name: "exclude_patterns", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): OptimizationSettings { + return new OptimizationSettings().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): OptimizationSettings { + return new OptimizationSettings().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): OptimizationSettings { + return new OptimizationSettings().fromJsonString(jsonString, options); + } + + static equals( + a: OptimizationSettings | PlainMessage | undefined, + b: OptimizationSettings | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(OptimizationSettings, a, b); + } +} + +/** + * Build strategies - how to build from source to target + * + * @generated from message deploy.builderd.v1.BuildStrategy + */ +export class BuildStrategy extends Message { + /** + * @generated from oneof deploy.builderd.v1.BuildStrategy.strategy_type + */ + strategyType: + | { + /** + * @generated from field: deploy.builderd.v1.DockerExtractStrategy docker_extract = 1; + */ + value: DockerExtractStrategy; + case: "dockerExtract"; + } + | { + /** + * @generated from field: deploy.builderd.v1.GoApiStrategy go_api = 2; + */ + value: GoApiStrategy; + case: "goApi"; + } + | { + /** + * @generated from field: deploy.builderd.v1.SinatraStrategy sinatra = 3; + */ + value: SinatraStrategy; + case: "sinatra"; + } + | { + /** + * Future: python_wsgi = 5, rust_binary = 6, etc. + * + * @generated from field: deploy.builderd.v1.NodejsStrategy nodejs = 4; + */ + value: NodejsStrategy; + case: "nodejs"; + } + | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildStrategy"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { + no: 1, + name: "docker_extract", + kind: "message", + T: DockerExtractStrategy, + oneof: "strategy_type", + }, + { no: 2, name: "go_api", kind: "message", T: GoApiStrategy, oneof: "strategy_type" }, + { no: 3, name: "sinatra", kind: "message", T: SinatraStrategy, oneof: "strategy_type" }, + { no: 4, name: "nodejs", kind: "message", T: NodejsStrategy, oneof: "strategy_type" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildStrategy { + return new BuildStrategy().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildStrategy { + return new BuildStrategy().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildStrategy { + return new BuildStrategy().fromJsonString(jsonString, options); + } + + static equals( + a: BuildStrategy | PlainMessage | undefined, + b: BuildStrategy | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildStrategy, a, b); + } +} + +/** + * Docker extraction strategy (first implementation) + * + * @generated from message deploy.builderd.v1.DockerExtractStrategy + */ +export class DockerExtractStrategy extends Message { + /** + * Keep layer structure + * + * @generated from field: bool preserve_layers = 1; + */ + preserveLayers = false; + + /** + * Merge all layers + * + * @generated from field: bool flatten_filesystem = 2; + */ + flattenFilesystem = false; + + /** + * Files to exclude + * + * @generated from field: repeated string exclude_patterns = 3; + */ + excludePatterns: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.DockerExtractStrategy"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "preserve_layers", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "flatten_filesystem", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { + no: 3, + name: "exclude_patterns", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): DockerExtractStrategy { + return new DockerExtractStrategy().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DockerExtractStrategy { + return new DockerExtractStrategy().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): DockerExtractStrategy { + return new DockerExtractStrategy().fromJsonString(jsonString, options); + } + + static equals( + a: DockerExtractStrategy | PlainMessage | undefined, + b: DockerExtractStrategy | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DockerExtractStrategy, a, b); + } +} + +/** + * Go API strategy (future) + * + * @generated from message deploy.builderd.v1.GoApiStrategy + */ +export class GoApiStrategy extends Message { + /** + * "1.21", "latest" + * + * @generated from field: string go_version = 1; + */ + goVersion = ""; + + /** + * "-ldflags", "-tags" + * + * @generated from field: repeated string build_flags = 2; + */ + buildFlags: string[] = []; + + /** + * "./cmd/api" + * + * @generated from field: string main_package = 3; + */ + mainPackage = ""; + + /** + * @generated from field: bool enable_cgo = 4; + */ + enableCgo = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GoApiStrategy"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "go_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "build_flags", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 3, name: "main_package", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "enable_cgo", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GoApiStrategy { + return new GoApiStrategy().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GoApiStrategy { + return new GoApiStrategy().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GoApiStrategy { + return new GoApiStrategy().fromJsonString(jsonString, options); + } + + static equals( + a: GoApiStrategy | PlainMessage | undefined, + b: GoApiStrategy | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GoApiStrategy, a, b); + } +} + +/** + * Sinatra strategy (future) + * + * @generated from message deploy.builderd.v1.SinatraStrategy + */ +export class SinatraStrategy extends Message { + /** + * "3.2", "latest" + * + * @generated from field: string ruby_version = 1; + */ + rubyVersion = ""; + + /** + * "Gemfile" + * + * @generated from field: string gemfile_path = 2; + */ + gemfilePath = ""; + + /** + * "puma", "unicorn" + * + * @generated from field: string rack_server = 3; + */ + rackServer = ""; + + /** + * Server-specific config + * + * @generated from field: map rack_config = 4; + */ + rackConfig: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.SinatraStrategy"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "ruby_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "gemfile_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "rack_server", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: "rack_config", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SinatraStrategy { + return new SinatraStrategy().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SinatraStrategy { + return new SinatraStrategy().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SinatraStrategy { + return new SinatraStrategy().fromJsonString(jsonString, options); + } + + static equals( + a: SinatraStrategy | PlainMessage | undefined, + b: SinatraStrategy | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(SinatraStrategy, a, b); + } +} + +/** + * Node.js strategy (future) + * + * @generated from message deploy.builderd.v1.NodejsStrategy + */ +export class NodejsStrategy extends Message { + /** + * "18", "20", "latest" + * + * @generated from field: string node_version = 1; + */ + nodeVersion = ""; + + /** + * "npm", "yarn", "pnpm" + * + * @generated from field: string package_manager = 2; + */ + packageManager = ""; + + /** + * "start", "server" + * + * @generated from field: string start_script = 3; + */ + startScript = ""; + + /** + * NODE_ENV=production + * + * @generated from field: bool enable_production = 4; + */ + enableProduction = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.NodejsStrategy"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "node_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "package_manager", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "start_script", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "enable_production", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): NodejsStrategy { + return new NodejsStrategy().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): NodejsStrategy { + return new NodejsStrategy().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): NodejsStrategy { + return new NodejsStrategy().fromJsonString(jsonString, options); + } + + static equals( + a: NodejsStrategy | PlainMessage | undefined, + b: NodejsStrategy | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NodejsStrategy, a, b); + } +} + +/** + * Tenant-aware resource limits + * + * @generated from message deploy.builderd.v1.TenantResourceLimits + */ +export class TenantResourceLimits extends Message { + /** + * Per-build limits + * + * @generated from field: int64 max_memory_bytes = 1; + */ + maxMemoryBytes = protoInt64.zero; + + /** + * @generated from field: int32 max_cpu_cores = 2; + */ + maxCpuCores = 0; + + /** + * @generated from field: int64 max_disk_bytes = 3; + */ + maxDiskBytes = protoInt64.zero; + + /** + * @generated from field: int32 timeout_seconds = 4; + */ + timeoutSeconds = 0; + + /** + * Tenant-wide quotas + * + * Concurrent builds per tenant + * + * @generated from field: int32 max_concurrent_builds = 5; + */ + maxConcurrentBuilds = 0; + + /** + * Daily build quota + * + * @generated from field: int32 max_daily_builds = 6; + */ + maxDailyBuilds = 0; + + /** + * Total storage quota + * + * @generated from field: int64 max_storage_bytes = 7; + */ + maxStorageBytes = protoInt64.zero; + + /** + * Max time per build + * + * @generated from field: int32 max_build_time_minutes = 8; + */ + maxBuildTimeMinutes = 0; + + /** + * Network restrictions + * + * Docker registries + * + * @generated from field: repeated string allowed_registries = 9; + */ + allowedRegistries: string[] = []; + + /** + * Git hosts + * + * @generated from field: repeated string allowed_git_hosts = 10; + */ + allowedGitHosts: string[] = []; + + /** + * External network access + * + * @generated from field: bool allow_external_network = 11; + */ + allowExternalNetwork = false; + + /** + * Security restrictions + * + * Privileged containers + * + * @generated from field: bool allow_privileged_builds = 12; + */ + allowPrivilegedBuilds = false; + + /** + * Forbidden commands + * + * @generated from field: repeated string blocked_commands = 13; + */ + blockedCommands: string[] = []; + + /** + * Isolation level (0-3) + * + * @generated from field: int32 sandbox_level = 14; + */ + sandboxLevel = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.TenantResourceLimits"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "max_memory_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "max_cpu_cores", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "max_disk_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "timeout_seconds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 5, name: "max_concurrent_builds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 6, name: "max_daily_builds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 7, name: "max_storage_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 8, name: "max_build_time_minutes", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { + no: 9, + name: "allowed_registries", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + { + no: 10, + name: "allowed_git_hosts", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + { no: 11, name: "allow_external_network", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 12, name: "allow_privileged_builds", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { + no: 13, + name: "blocked_commands", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + { no: 14, name: "sandbox_level", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TenantResourceLimits { + return new TenantResourceLimits().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TenantResourceLimits { + return new TenantResourceLimits().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): TenantResourceLimits { + return new TenantResourceLimits().fromJsonString(jsonString, options); + } + + static equals( + a: TenantResourceLimits | PlainMessage | undefined, + b: TenantResourceLimits | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(TenantResourceLimits, a, b); + } +} + +/** + * Main build configuration + * + * @generated from message deploy.builderd.v1.BuildConfig + */ +export class BuildConfig extends Message { + /** + * Tenant identification + * + * @generated from field: deploy.builderd.v1.TenantContext tenant = 1; + */ + tenant?: TenantContext; + + /** + * What we're building from + * + * @generated from field: deploy.builderd.v1.BuildSource source = 2; + */ + source?: BuildSource; + + /** + * What we're building to + * + * @generated from field: deploy.builderd.v1.BuildTarget target = 3; + */ + target?: BuildTarget; + + /** + * How to build it + * + * @generated from field: deploy.builderd.v1.BuildStrategy strategy = 4; + */ + strategy?: BuildStrategy; + + /** + * Build constraints (tenant-aware) + * + * @generated from field: deploy.builderd.v1.TenantResourceLimits limits = 5; + */ + limits?: TenantResourceLimits; + + /** + * Build metadata + * + * Human-readable name + * + * @generated from field: string build_name = 6; + */ + buildName = ""; + + /** + * Custom labels + * + * @generated from field: map labels = 7; + */ + labels: { [key: string]: string } = {}; + + /** + * Suggested asset ID to use when registering the built artifact + * This allows the caller to pre-generate the asset ID + * + * @generated from field: string suggested_asset_id = 8; + */ + suggestedAssetId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tenant", kind: "message", T: TenantContext }, + { no: 2, name: "source", kind: "message", T: BuildSource }, + { no: 3, name: "target", kind: "message", T: BuildTarget }, + { no: 4, name: "strategy", kind: "message", T: BuildStrategy }, + { no: 5, name: "limits", kind: "message", T: TenantResourceLimits }, + { no: 6, name: "build_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 7, + name: "labels", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 8, name: "suggested_asset_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildConfig { + return new BuildConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildConfig { + return new BuildConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildConfig { + return new BuildConfig().fromJsonString(jsonString, options); + } + + static equals( + a: BuildConfig | PlainMessage | undefined, + b: BuildConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildConfig, a, b); + } +} + +/** + * Build isolation metadata + * + * @generated from message deploy.builderd.v1.BuildIsolation + */ +export class BuildIsolation extends Message { + /** + * Unique sandbox identifier + * + * @generated from field: string sandbox_id = 1; + */ + sandboxId = ""; + + /** + * Network isolation + * + * @generated from field: string network_namespace = 2; + */ + networkNamespace = ""; + + /** + * Filesystem isolation + * + * @generated from field: string filesystem_namespace = 3; + */ + filesystemNamespace = ""; + + /** + * SELinux/AppArmor contexts + * + * @generated from field: repeated string security_contexts = 4; + */ + securityContexts: string[] = []; + + /** + * Resource cgroup + * + * @generated from field: string cgroup_path = 5; + */ + cgroupPath = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildIsolation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sandbox_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "network_namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "filesystem_namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: "security_contexts", + kind: "scalar", + T: 9 /* ScalarType.STRING */, + repeated: true, + }, + { no: 5, name: "cgroup_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildIsolation { + return new BuildIsolation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildIsolation { + return new BuildIsolation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildIsolation { + return new BuildIsolation().fromJsonString(jsonString, options); + } + + static equals( + a: BuildIsolation | PlainMessage | undefined, + b: BuildIsolation | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildIsolation, a, b); + } +} + +/** + * Image metadata extracted from Docker images + * + * @generated from message deploy.builderd.v1.ImageMetadata + */ +export class ImageMetadata extends Message { + /** + * Original Docker image + * + * @generated from field: string original_image = 1; + */ + originalImage = ""; + + /** + * Docker image SHA256 + * + * @generated from field: string image_digest = 2; + */ + imageDigest = ""; + + /** + * Layer digests + * + * @generated from field: repeated string layers = 3; + */ + layers: string[] = []; + + /** + * Docker labels + * + * @generated from field: map labels = 4; + */ + labels: { [key: string]: string } = {}; + + /** + * Original CMD + * + * @generated from field: repeated string command = 5; + */ + command: string[] = []; + + /** + * Original ENTRYPOINT + * + * @generated from field: repeated string entrypoint = 6; + */ + entrypoint: string[] = []; + + /** + * WORKDIR + * + * @generated from field: string working_dir = 7; + */ + workingDir = ""; + + /** + * Environment variables + * + * @generated from field: map env = 8; + */ + env: { [key: string]: string } = {}; + + /** + * EXPOSE ports + * + * @generated from field: repeated string exposed_ports = 9; + */ + exposedPorts: string[] = []; + + /** + * USER directive + * + * @generated from field: string user = 10; + */ + user = ""; + + /** + * VOLUME directives + * + * @generated from field: repeated string volumes = 11; + */ + volumes: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.ImageMetadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "original_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "image_digest", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "layers", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { + no: 4, + name: "labels", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 5, name: "command", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 6, name: "entrypoint", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 7, name: "working_dir", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 8, + name: "env", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 9, name: "exposed_ports", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 10, name: "user", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "volumes", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ImageMetadata { + return new ImageMetadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ImageMetadata { + return new ImageMetadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ImageMetadata { + return new ImageMetadata().fromJsonString(jsonString, options); + } + + static equals( + a: ImageMetadata | PlainMessage | undefined, + b: ImageMetadata | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ImageMetadata, a, b); + } +} + +/** + * Build performance metrics + * + * @generated from message deploy.builderd.v1.BuildMetrics + */ +export class BuildMetrics extends Message { + /** + * Time to pull image/source + * + * @generated from field: int64 pull_duration_ms = 1; + */ + pullDurationMs = protoInt64.zero; + + /** + * Time to extract layers + * + * @generated from field: int64 extract_duration_ms = 2; + */ + extractDurationMs = protoInt64.zero; + + /** + * Time to build rootfs + * + * @generated from field: int64 build_duration_ms = 3; + */ + buildDurationMs = protoInt64.zero; + + /** + * Time for optimizations + * + * @generated from field: int64 optimize_duration_ms = 4; + */ + optimizeDurationMs = protoInt64.zero; + + /** + * Total build time + * + * @generated from field: int64 total_duration_ms = 5; + */ + totalDurationMs = protoInt64.zero; + + /** + * Original image/source size + * + * @generated from field: int64 original_size_bytes = 6; + */ + originalSizeBytes = protoInt64.zero; + + /** + * Final rootfs size + * + * @generated from field: int64 rootfs_size_bytes = 7; + */ + rootfsSizeBytes = protoInt64.zero; + + /** + * Size reduction percentage + * + * @generated from field: int64 compression_ratio = 8; + */ + compressionRatio = protoInt64.zero; + + /** + * Peak memory usage + * + * @generated from field: int64 memory_peak_bytes = 9; + */ + memoryPeakBytes = protoInt64.zero; + + /** + * Temporary disk usage + * + * @generated from field: int64 disk_usage_bytes = 10; + */ + diskUsageBytes = protoInt64.zero; + + /** + * CPU cores utilized + * + * @generated from field: int32 cpu_cores_used = 11; + */ + cpuCoresUsed = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildMetrics"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pull_duration_ms", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "extract_duration_ms", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "build_duration_ms", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "optimize_duration_ms", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "total_duration_ms", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "original_size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 7, name: "rootfs_size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 8, name: "compression_ratio", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 9, name: "memory_peak_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 10, name: "disk_usage_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 11, name: "cpu_cores_used", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildMetrics { + return new BuildMetrics().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildMetrics { + return new BuildMetrics().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildMetrics { + return new BuildMetrics().fromJsonString(jsonString, options); + } + + static equals( + a: BuildMetrics | PlainMessage | undefined, + b: BuildMetrics | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildMetrics, a, b); + } +} + +/** + * Complete build job information + * + * @generated from message deploy.builderd.v1.BuildJob + */ +export class BuildJob extends Message { + /** + * Unique build identifier + * + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * Build configuration + * + * @generated from field: deploy.builderd.v1.BuildConfig config = 2; + */ + config?: BuildConfig; + + /** + * Current build state + * + * @generated from field: deploy.builderd.v1.BuildState state = 3; + */ + state = BuildState.UNSPECIFIED; + + /** + * Timestamps + * + * @generated from field: google.protobuf.Timestamp created_at = 4; + */ + createdAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp started_at = 5; + */ + startedAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp completed_at = 6; + */ + completedAt?: Timestamp; + + /** + * Results + * + * Path to built rootfs + * + * @generated from field: string rootfs_path = 7; + */ + rootfsPath = ""; + + /** + * Size of rootfs + * + * @generated from field: int64 rootfs_size_bytes = 8; + */ + rootfsSizeBytes = protoInt64.zero; + + /** + * SHA256 of rootfs + * + * @generated from field: string rootfs_checksum = 9; + */ + rootfsChecksum = ""; + + /** + * Build metadata + * + * @generated from field: deploy.builderd.v1.ImageMetadata image_metadata = 10; + */ + imageMetadata?: ImageMetadata; + + /** + * @generated from field: deploy.builderd.v1.BuildMetrics metrics = 11; + */ + metrics?: BuildMetrics; + + /** + * @generated from field: deploy.builderd.v1.BuildIsolation isolation = 12; + */ + isolation?: BuildIsolation; + + /** + * Error information + * + * @generated from field: string error_message = 13; + */ + errorMessage = ""; + + /** + * @generated from field: repeated string build_logs = 14; + */ + buildLogs: string[] = []; + + /** + * Progress information + * + * 0-100 + * + * @generated from field: int32 progress_percent = 15; + */ + progressPercent = 0; + + /** + * Current build step + * + * @generated from field: string current_step = 16; + */ + currentStep = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.BuildJob"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "config", kind: "message", T: BuildConfig }, + { no: 3, name: "state", kind: "enum", T: proto3.getEnumType(BuildState) }, + { no: 4, name: "created_at", kind: "message", T: Timestamp }, + { no: 5, name: "started_at", kind: "message", T: Timestamp }, + { no: 6, name: "completed_at", kind: "message", T: Timestamp }, + { no: 7, name: "rootfs_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "rootfs_size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 9, name: "rootfs_checksum", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 10, name: "image_metadata", kind: "message", T: ImageMetadata }, + { no: 11, name: "metrics", kind: "message", T: BuildMetrics }, + { no: 12, name: "isolation", kind: "message", T: BuildIsolation }, + { no: 13, name: "error_message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 14, name: "build_logs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 15, name: "progress_percent", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 16, name: "current_step", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BuildJob { + return new BuildJob().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BuildJob { + return new BuildJob().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BuildJob { + return new BuildJob().fromJsonString(jsonString, options); + } + + static equals( + a: BuildJob | PlainMessage | undefined, + b: BuildJob | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BuildJob, a, b); + } +} + +/** + * Build log entry for streaming + * + * @generated from message deploy.builderd.v1.StreamBuildLogsResponse + */ +export class StreamBuildLogsResponse extends Message { + /** + * @generated from field: google.protobuf.Timestamp timestamp = 1; + */ + timestamp?: Timestamp; + + /** + * "info", "warn", "error", "debug" + * + * @generated from field: string level = 2; + */ + level = ""; + + /** + * @generated from field: string message = 3; + */ + message = ""; + + /** + * "puller", "extractor", "builder" + * + * @generated from field: string component = 4; + */ + component = ""; + + /** + * @generated from field: map metadata = 5; + */ + metadata: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.StreamBuildLogsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "timestamp", kind: "message", T: Timestamp }, + { no: 2, name: "level", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "component", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 5, + name: "metadata", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): StreamBuildLogsResponse { + return new StreamBuildLogsResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): StreamBuildLogsResponse { + return new StreamBuildLogsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): StreamBuildLogsResponse { + return new StreamBuildLogsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: StreamBuildLogsResponse | PlainMessage | undefined, + b: StreamBuildLogsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(StreamBuildLogsResponse, a, b); + } +} + +/** + * Tenant usage statistics + * + * @generated from message deploy.builderd.v1.TenantUsageStats + */ +export class TenantUsageStats extends Message { + /** + * @generated from field: int32 active_builds = 1; + */ + activeBuilds = 0; + + /** + * @generated from field: int32 daily_builds_used = 2; + */ + dailyBuildsUsed = 0; + + /** + * @generated from field: int64 storage_bytes_used = 3; + */ + storageBytesUsed = protoInt64.zero; + + /** + * @generated from field: int64 compute_minutes_used = 4; + */ + computeMinutesUsed = protoInt64.zero; + + /** + * @generated from field: int32 builds_queued = 5; + */ + buildsQueued = 0; + + /** + * @generated from field: int32 builds_completed_today = 6; + */ + buildsCompletedToday = 0; + + /** + * @generated from field: int32 builds_failed_today = 7; + */ + buildsFailedToday = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.TenantUsageStats"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "active_builds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "daily_builds_used", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "storage_bytes_used", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "compute_minutes_used", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "builds_queued", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 6, name: "builds_completed_today", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 7, name: "builds_failed_today", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TenantUsageStats { + return new TenantUsageStats().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TenantUsageStats { + return new TenantUsageStats().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TenantUsageStats { + return new TenantUsageStats().fromJsonString(jsonString, options); + } + + static equals( + a: TenantUsageStats | PlainMessage | undefined, + b: TenantUsageStats | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(TenantUsageStats, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.QuotaViolation + */ +export class QuotaViolation extends Message { + /** + * "concurrent_builds", "daily_builds", etc. + * + * @generated from field: string quota_type = 1; + */ + quotaType = ""; + + /** + * @generated from field: int64 current_value = 2; + */ + currentValue = protoInt64.zero; + + /** + * @generated from field: int64 limit_value = 3; + */ + limitValue = protoInt64.zero; + + /** + * @generated from field: string message = 4; + */ + message = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.QuotaViolation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "quota_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "current_value", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "limit_value", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): QuotaViolation { + return new QuotaViolation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): QuotaViolation { + return new QuotaViolation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): QuotaViolation { + return new QuotaViolation().fromJsonString(jsonString, options); + } + + static equals( + a: QuotaViolation | PlainMessage | undefined, + b: QuotaViolation | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(QuotaViolation, a, b); + } +} + +/** + * Request/Response messages + * + * @generated from message deploy.builderd.v1.CreateBuildRequest + */ +export class CreateBuildRequest extends Message { + /** + * @generated from field: deploy.builderd.v1.BuildConfig config = 1; + */ + config?: BuildConfig; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.CreateBuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "config", kind: "message", T: BuildConfig }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBuildRequest { + return new CreateBuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBuildRequest { + return new CreateBuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateBuildRequest { + return new CreateBuildRequest().fromJsonString(jsonString, options); + } + + static equals( + a: CreateBuildRequest | PlainMessage | undefined, + b: CreateBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateBuildRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.CreateBuildResponse + */ +export class CreateBuildResponse extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * @generated from field: deploy.builderd.v1.BuildState state = 2; + */ + state = BuildState.UNSPECIFIED; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 3; + */ + createdAt?: Timestamp; + + /** + * Path to the generated rootfs for VM creation + * + * @generated from field: string rootfs_path = 4; + */ + rootfsPath = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.CreateBuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(BuildState) }, + { no: 3, name: "created_at", kind: "message", T: Timestamp }, + { no: 4, name: "rootfs_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBuildResponse { + return new CreateBuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBuildResponse { + return new CreateBuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateBuildResponse { + return new CreateBuildResponse().fromJsonString(jsonString, options); + } + + static equals( + a: CreateBuildResponse | PlainMessage | undefined, + b: CreateBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateBuildResponse, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GetBuildRequest + */ +export class GetBuildRequest extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * For authorization + * + * @generated from field: string tenant_id = 2; + */ + tenantId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GetBuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetBuildRequest { + return new GetBuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetBuildRequest { + return new GetBuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetBuildRequest { + return new GetBuildRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetBuildRequest | PlainMessage | undefined, + b: GetBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetBuildRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GetBuildResponse + */ +export class GetBuildResponse extends Message { + /** + * @generated from field: deploy.builderd.v1.BuildJob build = 1; + */ + build?: BuildJob; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GetBuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build", kind: "message", T: BuildJob }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetBuildResponse { + return new GetBuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetBuildResponse { + return new GetBuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetBuildResponse { + return new GetBuildResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetBuildResponse | PlainMessage | undefined, + b: GetBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetBuildResponse, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.ListBuildsRequest + */ +export class ListBuildsRequest extends Message { + /** + * Required for filtering + * + * @generated from field: string tenant_id = 1; + */ + tenantId = ""; + + /** + * @generated from field: repeated deploy.builderd.v1.BuildState state_filter = 2; + */ + stateFilter: BuildState[] = []; + + /** + * @generated from field: int32 page_size = 3; + */ + pageSize = 0; + + /** + * @generated from field: string page_token = 4; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.ListBuildsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 2, + name: "state_filter", + kind: "enum", + T: proto3.getEnumType(BuildState), + repeated: true, + }, + { no: 3, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListBuildsRequest { + return new ListBuildsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListBuildsRequest { + return new ListBuildsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListBuildsRequest { + return new ListBuildsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ListBuildsRequest | PlainMessage | undefined, + b: ListBuildsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListBuildsRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.ListBuildsResponse + */ +export class ListBuildsResponse extends Message { + /** + * @generated from field: repeated deploy.builderd.v1.BuildJob builds = 1; + */ + builds: BuildJob[] = []; + + /** + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + /** + * @generated from field: int32 total_count = 3; + */ + totalCount = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.ListBuildsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "builds", kind: "message", T: BuildJob, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "total_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListBuildsResponse { + return new ListBuildsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListBuildsResponse { + return new ListBuildsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ListBuildsResponse { + return new ListBuildsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ListBuildsResponse | PlainMessage | undefined, + b: ListBuildsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListBuildsResponse, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.CancelBuildRequest + */ +export class CancelBuildRequest extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * For authorization + * + * @generated from field: string tenant_id = 2; + */ + tenantId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.CancelBuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CancelBuildRequest { + return new CancelBuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CancelBuildRequest { + return new CancelBuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CancelBuildRequest { + return new CancelBuildRequest().fromJsonString(jsonString, options); + } + + static equals( + a: CancelBuildRequest | PlainMessage | undefined, + b: CancelBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CancelBuildRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.CancelBuildResponse + */ +export class CancelBuildResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: deploy.builderd.v1.BuildState state = 2; + */ + state = BuildState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.CancelBuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(BuildState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CancelBuildResponse { + return new CancelBuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CancelBuildResponse { + return new CancelBuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CancelBuildResponse { + return new CancelBuildResponse().fromJsonString(jsonString, options); + } + + static equals( + a: CancelBuildResponse | PlainMessage | undefined, + b: CancelBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CancelBuildResponse, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.DeleteBuildRequest + */ +export class DeleteBuildRequest extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * For authorization + * + * @generated from field: string tenant_id = 2; + */ + tenantId = ""; + + /** + * Delete even if running + * + * @generated from field: bool force = 3; + */ + force = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.DeleteBuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteBuildRequest { + return new DeleteBuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteBuildRequest { + return new DeleteBuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): DeleteBuildRequest { + return new DeleteBuildRequest().fromJsonString(jsonString, options); + } + + static equals( + a: DeleteBuildRequest | PlainMessage | undefined, + b: DeleteBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeleteBuildRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.DeleteBuildResponse + */ +export class DeleteBuildResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.DeleteBuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteBuildResponse { + return new DeleteBuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteBuildResponse { + return new DeleteBuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): DeleteBuildResponse { + return new DeleteBuildResponse().fromJsonString(jsonString, options); + } + + static equals( + a: DeleteBuildResponse | PlainMessage | undefined, + b: DeleteBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeleteBuildResponse, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.StreamBuildLogsRequest + */ +export class StreamBuildLogsRequest extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = ""; + + /** + * For authorization + * + * @generated from field: string tenant_id = 2; + */ + tenantId = ""; + + /** + * Continue streaming new logs + * + * @generated from field: bool follow = 3; + */ + follow = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.StreamBuildLogsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "build_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "follow", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): StreamBuildLogsRequest { + return new StreamBuildLogsRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): StreamBuildLogsRequest { + return new StreamBuildLogsRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): StreamBuildLogsRequest { + return new StreamBuildLogsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: StreamBuildLogsRequest | PlainMessage | undefined, + b: StreamBuildLogsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(StreamBuildLogsRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GetTenantQuotasRequest + */ +export class GetTenantQuotasRequest extends Message { + /** + * @generated from field: string tenant_id = 1; + */ + tenantId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GetTenantQuotasRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetTenantQuotasRequest { + return new GetTenantQuotasRequest().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetTenantQuotasRequest { + return new GetTenantQuotasRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetTenantQuotasRequest { + return new GetTenantQuotasRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetTenantQuotasRequest | PlainMessage | undefined, + b: GetTenantQuotasRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetTenantQuotasRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GetTenantQuotasResponse + */ +export class GetTenantQuotasResponse extends Message { + /** + * @generated from field: deploy.builderd.v1.TenantResourceLimits current_limits = 1; + */ + currentLimits?: TenantResourceLimits; + + /** + * @generated from field: deploy.builderd.v1.TenantUsageStats current_usage = 2; + */ + currentUsage?: TenantUsageStats; + + /** + * @generated from field: repeated deploy.builderd.v1.QuotaViolation violations = 3; + */ + violations: QuotaViolation[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GetTenantQuotasResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "current_limits", kind: "message", T: TenantResourceLimits }, + { no: 2, name: "current_usage", kind: "message", T: TenantUsageStats }, + { no: 3, name: "violations", kind: "message", T: QuotaViolation, repeated: true }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetTenantQuotasResponse { + return new GetTenantQuotasResponse().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): GetTenantQuotasResponse { + return new GetTenantQuotasResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetTenantQuotasResponse { + return new GetTenantQuotasResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetTenantQuotasResponse | PlainMessage | undefined, + b: GetTenantQuotasResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetTenantQuotasResponse, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GetBuildStatsRequest + */ +export class GetBuildStatsRequest extends Message { + /** + * @generated from field: string tenant_id = 1; + */ + tenantId = ""; + + /** + * @generated from field: google.protobuf.Timestamp start_time = 2; + */ + startTime?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp end_time = 3; + */ + endTime?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GetBuildStatsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "tenant_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "start_time", kind: "message", T: Timestamp }, + { no: 3, name: "end_time", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetBuildStatsRequest { + return new GetBuildStatsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetBuildStatsRequest { + return new GetBuildStatsRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetBuildStatsRequest { + return new GetBuildStatsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetBuildStatsRequest | PlainMessage | undefined, + b: GetBuildStatsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetBuildStatsRequest, a, b); + } +} + +/** + * @generated from message deploy.builderd.v1.GetBuildStatsResponse + */ +export class GetBuildStatsResponse extends Message { + /** + * @generated from field: int32 total_builds = 1; + */ + totalBuilds = 0; + + /** + * @generated from field: int32 successful_builds = 2; + */ + successfulBuilds = 0; + + /** + * @generated from field: int32 failed_builds = 3; + */ + failedBuilds = 0; + + /** + * @generated from field: int64 avg_build_time_ms = 4; + */ + avgBuildTimeMs = protoInt64.zero; + + /** + * @generated from field: int64 total_storage_bytes = 5; + */ + totalStorageBytes = protoInt64.zero; + + /** + * @generated from field: int64 total_compute_minutes = 6; + */ + totalComputeMinutes = protoInt64.zero; + + /** + * @generated from field: repeated deploy.builderd.v1.BuildJob recent_builds = 7; + */ + recentBuilds: BuildJob[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "deploy.builderd.v1.GetBuildStatsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "total_builds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "successful_builds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "failed_builds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "avg_build_time_ms", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "total_storage_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "total_compute_minutes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 7, name: "recent_builds", kind: "message", T: BuildJob, repeated: true }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): GetBuildStatsResponse { + return new GetBuildStatsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetBuildStatsResponse { + return new GetBuildStatsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): GetBuildStatsResponse { + return new GetBuildStatsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetBuildStatsResponse | PlainMessage | undefined, + b: GetBuildStatsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetBuildStatsResponse, a, b); + } +} diff --git a/internal/proto/generated/proto/metal/vmprovisioner/v1/vmprovisioner_connect.ts b/internal/proto/generated/proto/metal/vmprovisioner/v1/vmprovisioner_connect.ts new file mode 100644 index 0000000000..1c53385ebe --- /dev/null +++ b/internal/proto/generated/proto/metal/vmprovisioner/v1/vmprovisioner_connect.ts @@ -0,0 +1,136 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/metal/vmprovisioner/v1/vmprovisioner.proto (package metal.vmprovisioner.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + BootVmRequest, + BootVmResponse, + CreateVmRequest, + CreateVmResponse, + DeleteVmRequest, + DeleteVmResponse, + GetVmInfoRequest, + GetVmInfoResponse, + ListVmsRequest, + ListVmsResponse, + PauseVmRequest, + PauseVmResponse, + RebootVmRequest, + RebootVmResponse, + ResumeVmRequest, + ResumeVmResponse, + ShutdownVmRequest, + ShutdownVmResponse, +} from "./vmprovisioner_pb.js"; + +/** + * VmService provides unified VM management across different hypervisor backends + * + * @generated from service metal.vmprovisioner.v1.VmService + */ +export const VmService = { + typeName: "metal.vmprovisioner.v1.VmService", + methods: { + /** + * CreateVm creates a new virtual machine instance + * + * @generated from rpc metal.vmprovisioner.v1.VmService.CreateVm + */ + createVm: { + name: "CreateVm", + I: CreateVmRequest, + O: CreateVmResponse, + kind: MethodKind.Unary, + }, + /** + * DeleteVm removes a virtual machine instance + * + * @generated from rpc metal.vmprovisioner.v1.VmService.DeleteVm + */ + deleteVm: { + name: "DeleteVm", + I: DeleteVmRequest, + O: DeleteVmResponse, + kind: MethodKind.Unary, + }, + /** + * BootVm starts a created virtual machine + * + * @generated from rpc metal.vmprovisioner.v1.VmService.BootVm + */ + bootVm: { + name: "BootVm", + I: BootVmRequest, + O: BootVmResponse, + kind: MethodKind.Unary, + }, + /** + * ShutdownVm gracefully stops a running virtual machine + * + * @generated from rpc metal.vmprovisioner.v1.VmService.ShutdownVm + */ + shutdownVm: { + name: "ShutdownVm", + I: ShutdownVmRequest, + O: ShutdownVmResponse, + kind: MethodKind.Unary, + }, + /** + * PauseVm pauses a running virtual machine + * + * @generated from rpc metal.vmprovisioner.v1.VmService.PauseVm + */ + pauseVm: { + name: "PauseVm", + I: PauseVmRequest, + O: PauseVmResponse, + kind: MethodKind.Unary, + }, + /** + * ResumeVm resumes a paused virtual machine + * + * @generated from rpc metal.vmprovisioner.v1.VmService.ResumeVm + */ + resumeVm: { + name: "ResumeVm", + I: ResumeVmRequest, + O: ResumeVmResponse, + kind: MethodKind.Unary, + }, + /** + * RebootVm restarts a running virtual machine + * + * @generated from rpc metal.vmprovisioner.v1.VmService.RebootVm + */ + rebootVm: { + name: "RebootVm", + I: RebootVmRequest, + O: RebootVmResponse, + kind: MethodKind.Unary, + }, + /** + * GetVmInfo retrieves virtual machine status and configuration + * + * @generated from rpc metal.vmprovisioner.v1.VmService.GetVmInfo + */ + getVmInfo: { + name: "GetVmInfo", + I: GetVmInfoRequest, + O: GetVmInfoResponse, + kind: MethodKind.Unary, + }, + /** + * ListVms lists all virtual machines managed by this service + * + * @generated from rpc metal.vmprovisioner.v1.VmService.ListVms + */ + listVms: { + name: "ListVms", + I: ListVmsRequest, + O: ListVmsResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/metal/vmprovisioner/v1/vmprovisioner_pb.ts b/internal/proto/generated/proto/metal/vmprovisioner/v1/vmprovisioner_pb.ts new file mode 100644 index 0000000000..4d54d5e274 --- /dev/null +++ b/internal/proto/generated/proto/metal/vmprovisioner/v1/vmprovisioner_pb.ts @@ -0,0 +1,2273 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/metal/vmprovisioner/v1/vmprovisioner.proto (package metal.vmprovisioner.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * VM lifecycle states + * + * @generated from enum metal.vmprovisioner.v1.VmState + */ +export enum VmState { + /** + * @generated from enum value: VM_STATE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: VM_STATE_CREATED = 1; + */ + CREATED = 1, + + /** + * @generated from enum value: VM_STATE_RUNNING = 2; + */ + RUNNING = 2, + + /** + * @generated from enum value: VM_STATE_PAUSED = 3; + */ + PAUSED = 3, + + /** + * @generated from enum value: VM_STATE_SHUTDOWN = 4; + */ + SHUTDOWN = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(VmState) +proto3.util.setEnumType(VmState, "metal.vmprovisioner.v1.VmState", [ + { no: 0, name: "VM_STATE_UNSPECIFIED" }, + { no: 1, name: "VM_STATE_CREATED" }, + { no: 2, name: "VM_STATE_RUNNING" }, + { no: 3, name: "VM_STATE_PAUSED" }, + { no: 4, name: "VM_STATE_SHUTDOWN" }, +]); + +/** + * Network mode for the interface + * + * @generated from enum metal.vmprovisioner.v1.NetworkMode + */ +export enum NetworkMode { + /** + * @generated from enum value: NETWORK_MODE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Both IPv4 and IPv6 + * + * @generated from enum value: NETWORK_MODE_DUAL_STACK = 1; + */ + DUAL_STACK = 1, + + /** + * IPv4 only + * + * @generated from enum value: NETWORK_MODE_IPV4_ONLY = 2; + */ + IPV4_ONLY = 2, + + /** + * IPv6 only + * + * @generated from enum value: NETWORK_MODE_IPV6_ONLY = 3; + */ + IPV6_ONLY = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(NetworkMode) +proto3.util.setEnumType(NetworkMode, "metal.vmprovisioner.v1.NetworkMode", [ + { no: 0, name: "NETWORK_MODE_UNSPECIFIED" }, + { no: 1, name: "NETWORK_MODE_DUAL_STACK" }, + { no: 2, name: "NETWORK_MODE_IPV4_ONLY" }, + { no: 3, name: "NETWORK_MODE_IPV6_ONLY" }, +]); + +/** + * Unified VM configuration that works across different hypervisors + * + * @generated from message metal.vmprovisioner.v1.VmConfig + */ +export class VmConfig extends Message { + /** + * CPU configuration + * + * @generated from field: metal.vmprovisioner.v1.CpuConfig cpu = 1; + */ + cpu?: CpuConfig; + + /** + * Memory configuration + * + * @generated from field: metal.vmprovisioner.v1.MemoryConfig memory = 2; + */ + memory?: MemoryConfig; + + /** + * Boot configuration + * + * @generated from field: metal.vmprovisioner.v1.BootConfig boot = 3; + */ + boot?: BootConfig; + + /** + * Storage devices + * + * @generated from field: repeated metal.vmprovisioner.v1.StorageDevice storage = 4; + */ + storage: StorageDevice[] = []; + + /** + * Network interfaces + * + * @generated from field: repeated metal.vmprovisioner.v1.NetworkInterface network = 5; + */ + network: NetworkInterface[] = []; + + /** + * Console configuration + * + * @generated from field: metal.vmprovisioner.v1.ConsoleConfig console = 6; + */ + console?: ConsoleConfig; + + /** + * Metadata and labels + * + * @generated from field: map metadata = 7; + */ + metadata: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.VmConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "cpu", kind: "message", T: CpuConfig }, + { no: 2, name: "memory", kind: "message", T: MemoryConfig }, + { no: 3, name: "boot", kind: "message", T: BootConfig }, + { no: 4, name: "storage", kind: "message", T: StorageDevice, repeated: true }, + { no: 5, name: "network", kind: "message", T: NetworkInterface, repeated: true }, + { no: 6, name: "console", kind: "message", T: ConsoleConfig }, + { + no: 7, + name: "metadata", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VmConfig { + return new VmConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VmConfig { + return new VmConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VmConfig { + return new VmConfig().fromJsonString(jsonString, options); + } + + static equals( + a: VmConfig | PlainMessage | undefined, + b: VmConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(VmConfig, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.CpuConfig + */ +export class CpuConfig extends Message { + /** + * Number of virtual CPUs to allocate at boot + * + * @generated from field: int32 vcpu_count = 1; + */ + vcpuCount = 0; + + /** + * Maximum number of virtual CPUs (for hotplug) + * + * @generated from field: int32 max_vcpu_count = 2; + */ + maxVcpuCount = 0; + + /** + * CPU topology (optional) + * + * @generated from field: metal.vmprovisioner.v1.CpuTopology topology = 3; + */ + topology?: CpuTopology; + + /** + * CPU features and model (backend-specific) + * + * @generated from field: map features = 4; + */ + features: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.CpuConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vcpu_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "max_vcpu_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "topology", kind: "message", T: CpuTopology }, + { + no: 4, + name: "features", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CpuConfig { + return new CpuConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CpuConfig { + return new CpuConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CpuConfig { + return new CpuConfig().fromJsonString(jsonString, options); + } + + static equals( + a: CpuConfig | PlainMessage | undefined, + b: CpuConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CpuConfig, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.CpuTopology + */ +export class CpuTopology extends Message { + /** + * @generated from field: int32 sockets = 1; + */ + sockets = 0; + + /** + * @generated from field: int32 cores_per_socket = 2; + */ + coresPerSocket = 0; + + /** + * @generated from field: int32 threads_per_core = 3; + */ + threadsPerCore = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.CpuTopology"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "sockets", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "cores_per_socket", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "threads_per_core", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CpuTopology { + return new CpuTopology().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CpuTopology { + return new CpuTopology().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CpuTopology { + return new CpuTopology().fromJsonString(jsonString, options); + } + + static equals( + a: CpuTopology | PlainMessage | undefined, + b: CpuTopology | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CpuTopology, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.MemoryConfig + */ +export class MemoryConfig extends Message { + /** + * Memory size in bytes + * + * @generated from field: int64 size_bytes = 1; + */ + sizeBytes = protoInt64.zero; + + /** + * Whether memory hotplug is enabled + * + * @generated from field: bool hotplug_enabled = 2; + */ + hotplugEnabled = false; + + /** + * Maximum memory size for hotplug (bytes) + * + * @generated from field: int64 max_size_bytes = 3; + */ + maxSizeBytes = protoInt64.zero; + + /** + * Memory backing options (hugepages, etc.) + * + * @generated from field: map backing = 4; + */ + backing: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.MemoryConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "hotplug_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "max_size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { + no: 4, + name: "backing", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): MemoryConfig { + return new MemoryConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): MemoryConfig { + return new MemoryConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): MemoryConfig { + return new MemoryConfig().fromJsonString(jsonString, options); + } + + static equals( + a: MemoryConfig | PlainMessage | undefined, + b: MemoryConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(MemoryConfig, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.BootConfig + */ +export class BootConfig extends Message { + /** + * Path to kernel image + * + * @generated from field: string kernel_path = 1; + */ + kernelPath = ""; + + /** + * Path to initial ramdisk (optional) + * + * @generated from field: string initrd_path = 2; + */ + initrdPath = ""; + + /** + * Kernel command line arguments + * + * @generated from field: string kernel_args = 3; + */ + kernelArgs = ""; + + /** + * Boot order and options + * + * @generated from field: map boot_options = 4; + */ + bootOptions: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.BootConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "kernel_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "initrd_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "kernel_args", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 4, + name: "boot_options", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BootConfig { + return new BootConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BootConfig { + return new BootConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BootConfig { + return new BootConfig().fromJsonString(jsonString, options); + } + + static equals( + a: BootConfig | PlainMessage | undefined, + b: BootConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BootConfig, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.StorageDevice + */ +export class StorageDevice extends Message { + /** + * Unique identifier for this storage device + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Path to the backing file or block device + * + * @generated from field: string path = 2; + */ + path = ""; + + /** + * Whether this device is read-only + * + * @generated from field: bool read_only = 3; + */ + readOnly = false; + + /** + * Whether this is the root/boot device + * + * @generated from field: bool is_root_device = 4; + */ + isRootDevice = false; + + /** + * Storage interface type (virtio-blk, nvme, etc.) + * + * @generated from field: string interface_type = 5; + */ + interfaceType = ""; + + /** + * Additional storage options + * + * @generated from field: map options = 6; + */ + options: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.StorageDevice"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "read_only", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "is_root_device", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "interface_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 6, + name: "options", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StorageDevice { + return new StorageDevice().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StorageDevice { + return new StorageDevice().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StorageDevice { + return new StorageDevice().fromJsonString(jsonString, options); + } + + static equals( + a: StorageDevice | PlainMessage | undefined, + b: StorageDevice | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(StorageDevice, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.NetworkInterface + */ +export class NetworkInterface extends Message { + /** + * Unique identifier for this network interface + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * MAC address (optional, will be generated if not provided) + * + * @generated from field: string mac_address = 2; + */ + macAddress = ""; + + /** + * Host-side TAP device name + * + * @generated from field: string tap_device = 3; + */ + tapDevice = ""; + + /** + * Network interface type (virtio-net, e1000, etc.) + * + * @generated from field: string interface_type = 4; + */ + interfaceType = ""; + + /** + * Additional network options + * + * @generated from field: map options = 5; + */ + options: { [key: string]: string } = {}; + + /** + * IPv4 configuration (optional) + * + * @generated from field: metal.vmprovisioner.v1.IPv4Config ipv4_config = 6; + */ + ipv4Config?: IPv4Config; + + /** + * IPv6 configuration (optional) + * + * @generated from field: metal.vmprovisioner.v1.IPv6Config ipv6_config = 7; + */ + ipv6Config?: IPv6Config; + + /** + * Network mode + * + * @generated from field: metal.vmprovisioner.v1.NetworkMode mode = 8; + */ + mode = NetworkMode.UNSPECIFIED; + + /** + * Rate limiting + * + * Receive rate limit + * + * @generated from field: metal.vmprovisioner.v1.RateLimit rx_rate_limit = 10; + */ + rxRateLimit?: RateLimit; + + /** + * Transmit rate limit + * + * @generated from field: metal.vmprovisioner.v1.RateLimit tx_rate_limit = 11; + */ + txRateLimit?: RateLimit; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.NetworkInterface"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "mac_address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "tap_device", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "interface_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { + no: 5, + name: "options", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 6, name: "ipv4_config", kind: "message", T: IPv4Config }, + { no: 7, name: "ipv6_config", kind: "message", T: IPv6Config }, + { no: 8, name: "mode", kind: "enum", T: proto3.getEnumType(NetworkMode) }, + { no: 10, name: "rx_rate_limit", kind: "message", T: RateLimit }, + { no: 11, name: "tx_rate_limit", kind: "message", T: RateLimit }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): NetworkInterface { + return new NetworkInterface().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): NetworkInterface { + return new NetworkInterface().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): NetworkInterface { + return new NetworkInterface().fromJsonString(jsonString, options); + } + + static equals( + a: NetworkInterface | PlainMessage | undefined, + b: NetworkInterface | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NetworkInterface, a, b); + } +} + +/** + * IPv4 network configuration + * + * @generated from message metal.vmprovisioner.v1.IPv4Config + */ +export class IPv4Config extends Message { + /** + * IPv4 address (e.g., "10.100.1.2") + * + * @generated from field: string address = 1; + */ + address = ""; + + /** + * Network mask (e.g., "255.255.255.0") + * + * @generated from field: string netmask = 2; + */ + netmask = ""; + + /** + * Default gateway + * + * @generated from field: string gateway = 3; + */ + gateway = ""; + + /** + * DNS servers + * + * @generated from field: repeated string dns_servers = 4; + */ + dnsServers: string[] = []; + + /** + * Use DHCP instead of static config + * + * @generated from field: bool dhcp = 5; + */ + dhcp = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.IPv4Config"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "netmask", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "gateway", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "dns_servers", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 5, name: "dhcp", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IPv4Config { + return new IPv4Config().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IPv4Config { + return new IPv4Config().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IPv4Config { + return new IPv4Config().fromJsonString(jsonString, options); + } + + static equals( + a: IPv4Config | PlainMessage | undefined, + b: IPv4Config | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(IPv4Config, a, b); + } +} + +/** + * IPv6 network configuration + * + * @generated from message metal.vmprovisioner.v1.IPv6Config + */ +export class IPv6Config extends Message { + /** + * IPv6 address (e.g., "fd00::1:2") + * + * @generated from field: string address = 1; + */ + address = ""; + + /** + * Prefix length (e.g., 64) + * + * @generated from field: int32 prefix_length = 2; + */ + prefixLength = 0; + + /** + * Default gateway + * + * @generated from field: string gateway = 3; + */ + gateway = ""; + + /** + * DNS servers (IPv6 addresses) + * + * @generated from field: repeated string dns_servers = 4; + */ + dnsServers: string[] = []; + + /** + * Use SLAAC (Stateless Address Autoconfiguration) + * + * @generated from field: bool slaac = 5; + */ + slaac = false; + + /** + * Enable privacy extensions + * + * @generated from field: bool privacy_extensions = 6; + */ + privacyExtensions = false; + + /** + * Link-local address (auto-generated if empty) + * + * @generated from field: string link_local = 7; + */ + linkLocal = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.IPv6Config"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "prefix_length", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "gateway", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "dns_servers", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 5, name: "slaac", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "privacy_extensions", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 7, name: "link_local", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): IPv6Config { + return new IPv6Config().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): IPv6Config { + return new IPv6Config().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): IPv6Config { + return new IPv6Config().fromJsonString(jsonString, options); + } + + static equals( + a: IPv6Config | PlainMessage | undefined, + b: IPv6Config | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(IPv6Config, a, b); + } +} + +/** + * Rate limiting configuration + * + * @generated from message metal.vmprovisioner.v1.RateLimit + */ +export class RateLimit extends Message { + /** + * Bandwidth in bytes/second + * + * @generated from field: int64 bandwidth = 1; + */ + bandwidth = protoInt64.zero; + + /** + * Token bucket refill time in milliseconds + * + * @generated from field: int64 refill_time = 2; + */ + refillTime = protoInt64.zero; + + /** + * Burst size in bytes + * + * @generated from field: int64 burst = 3; + */ + burst = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.RateLimit"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "bandwidth", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "refill_time", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "burst", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RateLimit { + return new RateLimit().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RateLimit { + return new RateLimit().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RateLimit { + return new RateLimit().fromJsonString(jsonString, options); + } + + static equals( + a: RateLimit | PlainMessage | undefined, + b: RateLimit | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RateLimit, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ConsoleConfig + */ +export class ConsoleConfig extends Message { + /** + * Whether console is enabled + * + * @generated from field: bool enabled = 1; + */ + enabled = false; + + /** + * Console output destination (file path, pty, etc.) + * + * @generated from field: string output = 2; + */ + output = ""; + + /** + * Console input source (optional) + * + * @generated from field: string input = 3; + */ + input = ""; + + /** + * Console type (serial, virtio-console, etc.) + * + * @generated from field: string console_type = 4; + */ + consoleType = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ConsoleConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "output", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "input", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "console_type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ConsoleConfig { + return new ConsoleConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ConsoleConfig { + return new ConsoleConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ConsoleConfig { + return new ConsoleConfig().fromJsonString(jsonString, options); + } + + static equals( + a: ConsoleConfig | PlainMessage | undefined, + b: ConsoleConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ConsoleConfig, a, b); + } +} + +/** + * Request/Response messages + * + * @generated from message metal.vmprovisioner.v1.CreateVmRequest + */ +export class CreateVmRequest extends Message { + /** + * Unique identifier for the VM (optional, will be generated if not provided) + * + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * VM configuration + * + * @generated from field: metal.vmprovisioner.v1.VmConfig config = 2; + */ + config?: VmConfig; + + /** + * Customer identifier for billing and isolation + * + * @generated from field: string customer_id = 3; + */ + customerId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.CreateVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "config", kind: "message", T: VmConfig }, + { no: 3, name: "customer_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateVmRequest { + return new CreateVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateVmRequest { + return new CreateVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateVmRequest { + return new CreateVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: CreateVmRequest | PlainMessage | undefined, + b: CreateVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.CreateVmResponse + */ +export class CreateVmResponse extends Message { + /** + * Assigned VM identifier + * + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * Current VM state after creation + * + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.CreateVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateVmResponse { + return new CreateVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateVmResponse { + return new CreateVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateVmResponse { + return new CreateVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: CreateVmResponse | PlainMessage | undefined, + b: CreateVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.DeleteVmRequest + */ +export class DeleteVmRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * Whether to force deletion even if VM is running + * + * @generated from field: bool force = 2; + */ + force = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.DeleteVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteVmRequest { + return new DeleteVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteVmRequest { + return new DeleteVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteVmRequest { + return new DeleteVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: DeleteVmRequest | PlainMessage | undefined, + b: DeleteVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeleteVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.DeleteVmResponse + */ +export class DeleteVmResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.DeleteVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteVmResponse { + return new DeleteVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteVmResponse { + return new DeleteVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteVmResponse { + return new DeleteVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: DeleteVmResponse | PlainMessage | undefined, + b: DeleteVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DeleteVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.BootVmRequest + */ +export class BootVmRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.BootVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BootVmRequest { + return new BootVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BootVmRequest { + return new BootVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BootVmRequest { + return new BootVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: BootVmRequest | PlainMessage | undefined, + b: BootVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BootVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.BootVmResponse + */ +export class BootVmResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.BootVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BootVmResponse { + return new BootVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BootVmResponse { + return new BootVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BootVmResponse { + return new BootVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: BootVmResponse | PlainMessage | undefined, + b: BootVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(BootVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ShutdownVmRequest + */ +export class ShutdownVmRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * Whether to force shutdown (vs graceful) + * + * @generated from field: bool force = 2; + */ + force = false; + + /** + * Timeout for graceful shutdown (seconds) + * + * @generated from field: int32 timeout_seconds = 3; + */ + timeoutSeconds = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ShutdownVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "timeout_seconds", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ShutdownVmRequest { + return new ShutdownVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ShutdownVmRequest { + return new ShutdownVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ShutdownVmRequest { + return new ShutdownVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ShutdownVmRequest | PlainMessage | undefined, + b: ShutdownVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ShutdownVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ShutdownVmResponse + */ +export class ShutdownVmResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ShutdownVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ShutdownVmResponse { + return new ShutdownVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ShutdownVmResponse { + return new ShutdownVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ShutdownVmResponse { + return new ShutdownVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ShutdownVmResponse | PlainMessage | undefined, + b: ShutdownVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ShutdownVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.PauseVmRequest + */ +export class PauseVmRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.PauseVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PauseVmRequest { + return new PauseVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PauseVmRequest { + return new PauseVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PauseVmRequest { + return new PauseVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: PauseVmRequest | PlainMessage | undefined, + b: PauseVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PauseVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.PauseVmResponse + */ +export class PauseVmResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.PauseVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PauseVmResponse { + return new PauseVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PauseVmResponse { + return new PauseVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PauseVmResponse { + return new PauseVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: PauseVmResponse | PlainMessage | undefined, + b: PauseVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PauseVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ResumeVmRequest + */ +export class ResumeVmRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ResumeVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResumeVmRequest { + return new ResumeVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResumeVmRequest { + return new ResumeVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResumeVmRequest { + return new ResumeVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ResumeVmRequest | PlainMessage | undefined, + b: ResumeVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ResumeVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ResumeVmResponse + */ +export class ResumeVmResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ResumeVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResumeVmResponse { + return new ResumeVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResumeVmResponse { + return new ResumeVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResumeVmResponse { + return new ResumeVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ResumeVmResponse | PlainMessage | undefined, + b: ResumeVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ResumeVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.RebootVmRequest + */ +export class RebootVmRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * Whether to force reboot (vs graceful) + * + * @generated from field: bool force = 2; + */ + force = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.RebootVmRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RebootVmRequest { + return new RebootVmRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RebootVmRequest { + return new RebootVmRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RebootVmRequest { + return new RebootVmRequest().fromJsonString(jsonString, options); + } + + static equals( + a: RebootVmRequest | PlainMessage | undefined, + b: RebootVmRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RebootVmRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.RebootVmResponse + */ +export class RebootVmResponse extends Message { + /** + * @generated from field: bool success = 1; + */ + success = false; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.RebootVmResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "success", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RebootVmResponse { + return new RebootVmResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RebootVmResponse { + return new RebootVmResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RebootVmResponse { + return new RebootVmResponse().fromJsonString(jsonString, options); + } + + static equals( + a: RebootVmResponse | PlainMessage | undefined, + b: RebootVmResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(RebootVmResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.GetVmInfoRequest + */ +export class GetVmInfoRequest extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.GetVmInfoRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetVmInfoRequest { + return new GetVmInfoRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetVmInfoRequest { + return new GetVmInfoRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetVmInfoRequest { + return new GetVmInfoRequest().fromJsonString(jsonString, options); + } + + static equals( + a: GetVmInfoRequest | PlainMessage | undefined, + b: GetVmInfoRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetVmInfoRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.GetVmInfoResponse + */ +export class GetVmInfoResponse extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * @generated from field: metal.vmprovisioner.v1.VmConfig config = 2; + */ + config?: VmConfig; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 3; + */ + state = VmState.UNSPECIFIED; + + /** + * @generated from field: metal.vmprovisioner.v1.VmMetrics metrics = 4; + */ + metrics?: VmMetrics; + + /** + * Backend-specific information + * + * @generated from field: map backend_info = 5; + */ + backendInfo: { [key: string]: string } = {}; + + /** + * Network information if available + * + * @generated from field: metal.vmprovisioner.v1.VmNetworkInfo network_info = 6; + */ + networkInfo?: VmNetworkInfo; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.GetVmInfoResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "config", kind: "message", T: VmConfig }, + { no: 3, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + { no: 4, name: "metrics", kind: "message", T: VmMetrics }, + { + no: 5, + name: "backend_info", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 6, name: "network_info", kind: "message", T: VmNetworkInfo }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetVmInfoResponse { + return new GetVmInfoResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetVmInfoResponse { + return new GetVmInfoResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetVmInfoResponse { + return new GetVmInfoResponse().fromJsonString(jsonString, options); + } + + static equals( + a: GetVmInfoResponse | PlainMessage | undefined, + b: GetVmInfoResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GetVmInfoResponse, a, b); + } +} + +/** + * Port mapping for VM network forwarding + * + * @generated from message metal.vmprovisioner.v1.PortMapping + */ +export class PortMapping extends Message { + /** + * Port inside the VM + * + * @generated from field: int32 container_port = 1; + */ + containerPort = 0; + + /** + * Port on the host system + * + * @generated from field: int32 host_port = 2; + */ + hostPort = 0; + + /** + * Protocol (tcp, udp) + * + * @generated from field: string protocol = 3; + */ + protocol = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.PortMapping"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "container_port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "host_port", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PortMapping { + return new PortMapping().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PortMapping { + return new PortMapping().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PortMapping { + return new PortMapping().fromJsonString(jsonString, options); + } + + static equals( + a: PortMapping | PlainMessage | undefined, + b: PortMapping | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(PortMapping, a, b); + } +} + +/** + * Network information for a VM + * + * @generated from message metal.vmprovisioner.v1.VmNetworkInfo + */ +export class VmNetworkInfo extends Message { + /** + * @generated from field: string ip_address = 1; + */ + ipAddress = ""; + + /** + * @generated from field: string mac_address = 2; + */ + macAddress = ""; + + /** + * @generated from field: string tap_device = 3; + */ + tapDevice = ""; + + /** + * @generated from field: string network_namespace = 4; + */ + networkNamespace = ""; + + /** + * @generated from field: string gateway = 5; + */ + gateway = ""; + + /** + * @generated from field: repeated string dns_servers = 6; + */ + dnsServers: string[] = []; + + /** + * Port forwards from host to VM + * + * @generated from field: repeated metal.vmprovisioner.v1.PortMapping port_mappings = 7; + */ + portMappings: PortMapping[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.VmNetworkInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "ip_address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "mac_address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "tap_device", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "network_namespace", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "gateway", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "dns_servers", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 7, name: "port_mappings", kind: "message", T: PortMapping, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VmNetworkInfo { + return new VmNetworkInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VmNetworkInfo { + return new VmNetworkInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VmNetworkInfo { + return new VmNetworkInfo().fromJsonString(jsonString, options); + } + + static equals( + a: VmNetworkInfo | PlainMessage | undefined, + b: VmNetworkInfo | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(VmNetworkInfo, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.VmMetrics + */ +export class VmMetrics extends Message { + /** + * CPU usage percentage (0-100) + * + * @generated from field: double cpu_usage_percent = 1; + */ + cpuUsagePercent = 0; + + /** + * Memory usage in bytes + * + * @generated from field: int64 memory_usage_bytes = 2; + */ + memoryUsageBytes = protoInt64.zero; + + /** + * Network I/O statistics + * + * @generated from field: metal.vmprovisioner.v1.NetworkStats network_stats = 3; + */ + networkStats?: NetworkStats; + + /** + * Storage I/O statistics + * + * @generated from field: metal.vmprovisioner.v1.StorageStats storage_stats = 4; + */ + storageStats?: StorageStats; + + /** + * VM uptime in seconds + * + * @generated from field: int64 uptime_seconds = 5; + */ + uptimeSeconds = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.VmMetrics"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "cpu_usage_percent", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 2, name: "memory_usage_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "network_stats", kind: "message", T: NetworkStats }, + { no: 4, name: "storage_stats", kind: "message", T: StorageStats }, + { no: 5, name: "uptime_seconds", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VmMetrics { + return new VmMetrics().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VmMetrics { + return new VmMetrics().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VmMetrics { + return new VmMetrics().fromJsonString(jsonString, options); + } + + static equals( + a: VmMetrics | PlainMessage | undefined, + b: VmMetrics | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(VmMetrics, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.NetworkStats + */ +export class NetworkStats extends Message { + /** + * @generated from field: int64 bytes_received = 1; + */ + bytesReceived = protoInt64.zero; + + /** + * @generated from field: int64 bytes_transmitted = 2; + */ + bytesTransmitted = protoInt64.zero; + + /** + * @generated from field: int64 packets_received = 3; + */ + packetsReceived = protoInt64.zero; + + /** + * @generated from field: int64 packets_transmitted = 4; + */ + packetsTransmitted = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.NetworkStats"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "bytes_received", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "bytes_transmitted", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "packets_received", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "packets_transmitted", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): NetworkStats { + return new NetworkStats().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): NetworkStats { + return new NetworkStats().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): NetworkStats { + return new NetworkStats().fromJsonString(jsonString, options); + } + + static equals( + a: NetworkStats | PlainMessage | undefined, + b: NetworkStats | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(NetworkStats, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.StorageStats + */ +export class StorageStats extends Message { + /** + * @generated from field: int64 bytes_read = 1; + */ + bytesRead = protoInt64.zero; + + /** + * @generated from field: int64 bytes_written = 2; + */ + bytesWritten = protoInt64.zero; + + /** + * @generated from field: int64 read_operations = 3; + */ + readOperations = protoInt64.zero; + + /** + * @generated from field: int64 write_operations = 4; + */ + writeOperations = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.StorageStats"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "bytes_read", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "bytes_written", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "read_operations", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "write_operations", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StorageStats { + return new StorageStats().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StorageStats { + return new StorageStats().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StorageStats { + return new StorageStats().fromJsonString(jsonString, options); + } + + static equals( + a: StorageStats | PlainMessage | undefined, + b: StorageStats | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(StorageStats, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ListVmsRequest + */ +export class ListVmsRequest extends Message { + /** + * Optional filter by state + * + * @generated from field: repeated metal.vmprovisioner.v1.VmState state_filter = 1; + */ + stateFilter: VmState[] = []; + + /** + * Pagination + * + * @generated from field: int32 page_size = 2; + */ + pageSize = 0; + + /** + * @generated from field: string page_token = 3; + */ + pageToken = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ListVmsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "state_filter", kind: "enum", T: proto3.getEnumType(VmState), repeated: true }, + { no: 2, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListVmsRequest { + return new ListVmsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListVmsRequest { + return new ListVmsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListVmsRequest { + return new ListVmsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ListVmsRequest | PlainMessage | undefined, + b: ListVmsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListVmsRequest, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.ListVmsResponse + */ +export class ListVmsResponse extends Message { + /** + * @generated from field: repeated metal.vmprovisioner.v1.VmInfo vms = 1; + */ + vms: VmInfo[] = []; + + /** + * @generated from field: string next_page_token = 2; + */ + nextPageToken = ""; + + /** + * @generated from field: int32 total_count = 3; + */ + totalCount = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.ListVmsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vms", kind: "message", T: VmInfo, repeated: true }, + { no: 2, name: "next_page_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "total_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListVmsResponse { + return new ListVmsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListVmsResponse { + return new ListVmsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListVmsResponse { + return new ListVmsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ListVmsResponse | PlainMessage | undefined, + b: ListVmsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ListVmsResponse, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.VmInfo + */ +export class VmInfo extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * @generated from field: metal.vmprovisioner.v1.VmState state = 2; + */ + state = VmState.UNSPECIFIED; + + /** + * Basic config info (subset of full config) + * + * @generated from field: int32 vcpu_count = 3; + */ + vcpuCount = 0; + + /** + * @generated from field: int64 memory_size_bytes = 4; + */ + memorySizeBytes = protoInt64.zero; + + /** + * Creation and modification timestamps + * + * @generated from field: int64 created_timestamp = 5; + */ + createdTimestamp = protoInt64.zero; + + /** + * @generated from field: int64 modified_timestamp = 6; + */ + modifiedTimestamp = protoInt64.zero; + + /** + * Metadata + * + * @generated from field: map metadata = 7; + */ + metadata: { [key: string]: string } = {}; + + /** + * Customer identifier + * + * @generated from field: string customer_id = 8; + */ + customerId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.VmInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "state", kind: "enum", T: proto3.getEnumType(VmState) }, + { no: 3, name: "vcpu_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "memory_size_bytes", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "created_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "modified_timestamp", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { + no: 7, + name: "metadata", + kind: "map", + K: 9 /* ScalarType.STRING */, + V: { kind: "scalar", T: 9 /* ScalarType.STRING */ }, + }, + { no: 8, name: "customer_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VmInfo { + return new VmInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VmInfo { + return new VmInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VmInfo { + return new VmInfo().fromJsonString(jsonString, options); + } + + static equals( + a: VmInfo | PlainMessage | undefined, + b: VmInfo | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(VmInfo, a, b); + } +} diff --git a/internal/proto/generated/proto/metal/vmprovisioner/v1/wip_pb.ts b/internal/proto/generated/proto/metal/vmprovisioner/v1/wip_pb.ts new file mode 100644 index 0000000000..d8ffac5da3 --- /dev/null +++ b/internal/proto/generated/proto/metal/vmprovisioner/v1/wip_pb.ts @@ -0,0 +1,174 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/metal/vmprovisioner/v1/wip.proto (package metal.vmprovisioner.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * @generated from enum metal.vmprovisioner.v1.NetworkSize + */ +export enum NetworkSize { + /** + * These are made up + * + * @generated from enum value: NETWORK_SIZE_SMALL = 0; + */ + SMALL = 0, + + /** + * @generated from enum value: NETWORK_SIZE_MEDIUM = 1; + */ + MEDIUM = 1, + + /** + * @generated from enum value: NETWORK_SIZE_LARGE = 2; + */ + LARGE = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(NetworkSize) +proto3.util.setEnumType(NetworkSize, "metal.vmprovisioner.v1.NetworkSize", [ + { no: 0, name: "NETWORK_SIZE_SMALL" }, + { no: 1, name: "NETWORK_SIZE_MEDIUM" }, + { no: 2, name: "NETWORK_SIZE_LARGE" }, +]); + +/** + * from our call, ian + * lmk what you think, it's not hooked up yet and we can change it as you wish. + * + * @generated from message metal.vmprovisioner.v1.CreateVmRequestV2 + */ +export class CreateVmRequestV2 extends Message { + /** + * @generated from field: string vm_id = 1; + */ + vmId = ""; + + /** + * I know you want this elsewhere but I really don't understand what you want me to do. + * cause just defining it as `message DeploymentId string` doesn't make anything better. + * please send help + * + * @generated from field: string deployment_id = 2; + */ + deploymentId = ""; + + /** + * 1024 = 1 vcpu + * + * millicores, e.g., 1024 = 1 vCPU + * + * @generated from field: uint32 cpu_millicores = 3; + */ + cpuMillicores = 0; + + /** + * bytes + * + * @generated from field: uint64 memory_bytes = 4; + */ + memoryBytes = protoInt64.zero; + + /** + * full image ref: registry/repo:tag or digest + * + * @generated from field: string docker_image = 5; + */ + dockerImage = ""; + + /** + * default: NETWORK_SIZE_UNSPECIFIED + * + * @generated from field: metal.vmprovisioner.v1.NetworkSize network_size = 6; + */ + networkSize = NetworkSize.SMALL; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.CreateVmRequestV2"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vm_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "deployment_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "cpu_millicores", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "memory_bytes", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + { no: 5, name: "docker_image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "network_size", kind: "enum", T: proto3.getEnumType(NetworkSize) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateVmRequestV2 { + return new CreateVmRequestV2().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateVmRequestV2 { + return new CreateVmRequestV2().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateVmRequestV2 { + return new CreateVmRequestV2().fromJsonString(jsonString, options); + } + + static equals( + a: CreateVmRequestV2 | PlainMessage | undefined, + b: CreateVmRequestV2 | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateVmRequestV2, a, b); + } +} + +/** + * @generated from message metal.vmprovisioner.v1.CreateVmRespomseV2 + */ +export class CreateVmRespomseV2 extends Message { + /** + * metalhost_ip:port + * + * @generated from field: string address = 1; + */ + address = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "metal.vmprovisioner.v1.CreateVmRespomseV2"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "address", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateVmRespomseV2 { + return new CreateVmRespomseV2().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateVmRespomseV2 { + return new CreateVmRespomseV2().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): CreateVmRespomseV2 { + return new CreateVmRespomseV2().fromJsonString(jsonString, options); + } + + static equals( + a: CreateVmRespomseV2 | PlainMessage | undefined, + b: CreateVmRespomseV2 | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateVmRespomseV2, a, b); + } +} diff --git a/internal/proto/generated/proto/partition/v1/gateway_pb.ts b/internal/proto/generated/proto/partition/v1/gateway_pb.ts new file mode 100644 index 0000000000..2efeb2b6ad --- /dev/null +++ b/internal/proto/generated/proto/partition/v1/gateway_pb.ts @@ -0,0 +1,301 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/partition/v1/gateway.proto (package partition.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * GatewayConfig contains all configuration needed for a hostname + * including deployment metadata and middleware configurations + * + * @generated from message partition.v1.GatewayConfig + */ +export class GatewayConfig extends Message { + /** + * @generated from field: partition.v1.Project project = 1; + */ + project?: Project; + + /** + * Deployment information + * + * @generated from field: partition.v1.Deployment deployment = 2; + */ + deployment?: Deployment; + + /** + * @generated from field: repeated partition.v1.VM vms = 3; + */ + vms: VM[] = []; + + /** + * Middleware configurations + * + * @generated from field: optional partition.v1.AuthConfig auth_config = 4; + */ + authConfig?: AuthConfig; + + /** + * @generated from field: optional partition.v1.ValidationConfig validation_config = 5; + */ + validationConfig?: ValidationConfig; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "partition.v1.GatewayConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project", kind: "message", T: Project }, + { no: 2, name: "deployment", kind: "message", T: Deployment }, + { no: 3, name: "vms", kind: "message", T: VM, repeated: true }, + { no: 4, name: "auth_config", kind: "message", T: AuthConfig, opt: true }, + { no: 5, name: "validation_config", kind: "message", T: ValidationConfig, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GatewayConfig { + return new GatewayConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GatewayConfig { + return new GatewayConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GatewayConfig { + return new GatewayConfig().fromJsonString(jsonString, options); + } + + static equals( + a: GatewayConfig | PlainMessage | undefined, + b: GatewayConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(GatewayConfig, a, b); + } +} + +/** + * @generated from message partition.v1.Deployment + */ +export class Deployment extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: bool is_enabled = 2; + */ + isEnabled = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "partition.v1.Deployment"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "is_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Deployment { + return new Deployment().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Deployment { + return new Deployment().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Deployment { + return new Deployment().fromJsonString(jsonString, options); + } + + static equals( + a: Deployment | PlainMessage | undefined, + b: Deployment | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Deployment, a, b); + } +} + +/** + * @generated from message partition.v1.Project + */ +export class Project extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: bool is_enabled = 2; + */ + isEnabled = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "partition.v1.Project"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "is_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Project { + return new Project().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Project { + return new Project().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Project { + return new Project().fromJsonString(jsonString, options); + } + + static equals( + a: Project | PlainMessage | undefined, + b: Project | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Project, a, b); + } +} + +/** + * @generated from message partition.v1.VM + */ +export class VM extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "partition.v1.VM"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VM { + return new VM().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VM { + return new VM().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VM { + return new VM().fromJsonString(jsonString, options); + } + + static equals( + a: VM | PlainMessage | undefined, + b: VM | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(VM, a, b); + } +} + +/** + * Authentication middleware configuration + * + * @generated from message partition.v1.AuthConfig + */ +export class AuthConfig extends Message { + /** + * @generated from field: string key_auth_id = 1; + */ + keyAuthId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "partition.v1.AuthConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_auth_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AuthConfig { + return new AuthConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AuthConfig { + return new AuthConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AuthConfig { + return new AuthConfig().fromJsonString(jsonString, options); + } + + static equals( + a: AuthConfig | PlainMessage | undefined, + b: AuthConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(AuthConfig, a, b); + } +} + +/** + * Request validation middleware configuration + * + * @generated from message partition.v1.ValidationConfig + */ +export class ValidationConfig extends Message { + /** + * @generated from field: string openapi_spec = 1; + */ + openapiSpec = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "partition.v1.ValidationConfig"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "openapi_spec", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ValidationConfig { + return new ValidationConfig().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ValidationConfig { + return new ValidationConfig().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ValidationConfig { + return new ValidationConfig().fromJsonString(jsonString, options); + } + + static equals( + a: ValidationConfig | PlainMessage | undefined, + b: ValidationConfig | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ValidationConfig, a, b); + } +} diff --git a/internal/proto/generated/proto/vault/v1/object_pb.ts b/internal/proto/generated/proto/vault/v1/object_pb.ts new file mode 100644 index 0000000000..eb353f25be --- /dev/null +++ b/internal/proto/generated/proto/vault/v1/object_pb.ts @@ -0,0 +1,270 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/vault/v1/object.proto (package vault.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; + +/** + * @generated from enum vault.v1.Algorithm + */ +export enum Algorithm { + /** + * @generated from enum value: AES_256_GCM = 0; + */ + AES_256_GCM = 0, +} +// Retrieve enum metadata with: proto3.getEnumType(Algorithm) +proto3.util.setEnumType(Algorithm, "vault.v1.Algorithm", [{ no: 0, name: "AES_256_GCM" }]); + +/** + * @generated from message vault.v1.DataEncryptionKey + */ +export class DataEncryptionKey extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Linux milliseconds since epoch + * + * @generated from field: int64 created_at = 2; + */ + createdAt = protoInt64.zero; + + /** + * @generated from field: bytes key = 3; + */ + key = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.DataEncryptionKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DataEncryptionKey { + return new DataEncryptionKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DataEncryptionKey { + return new DataEncryptionKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DataEncryptionKey { + return new DataEncryptionKey().fromJsonString(jsonString, options); + } + + static equals( + a: DataEncryptionKey | PlainMessage | undefined, + b: DataEncryptionKey | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DataEncryptionKey, a, b); + } +} + +/** + * This is stored in the database in whatever format the database uses + * + * @generated from message vault.v1.EncryptedDataEncryptionKey + */ +export class EncryptedDataEncryptionKey extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * Linux milliseconds since epoch + * + * @generated from field: int64 created_at = 2; + */ + createdAt = protoInt64.zero; + + /** + * @generated from field: vault.v1.Encrypted encrypted = 3; + */ + encrypted?: Encrypted; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.EncryptedDataEncryptionKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "encrypted", kind: "message", T: Encrypted }, + ]); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): EncryptedDataEncryptionKey { + return new EncryptedDataEncryptionKey().fromBinary(bytes, options); + } + + static fromJson( + jsonValue: JsonValue, + options?: Partial, + ): EncryptedDataEncryptionKey { + return new EncryptedDataEncryptionKey().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): EncryptedDataEncryptionKey { + return new EncryptedDataEncryptionKey().fromJsonString(jsonString, options); + } + + static equals( + a: EncryptedDataEncryptionKey | PlainMessage | undefined, + b: EncryptedDataEncryptionKey | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(EncryptedDataEncryptionKey, a, b); + } +} + +/** + * KeyEncryptionKey is a key used to encrypt data encryption keys + * + * @generated from message vault.v1.KeyEncryptionKey + */ +export class KeyEncryptionKey extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: int64 created_at = 2; + */ + createdAt = protoInt64.zero; + + /** + * @generated from field: bytes key = 3; + */ + key = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.KeyEncryptionKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "created_at", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "key", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): KeyEncryptionKey { + return new KeyEncryptionKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): KeyEncryptionKey { + return new KeyEncryptionKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): KeyEncryptionKey { + return new KeyEncryptionKey().fromJsonString(jsonString, options); + } + + static equals( + a: KeyEncryptionKey | PlainMessage | undefined, + b: KeyEncryptionKey | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(KeyEncryptionKey, a, b); + } +} + +/** + * Encrypted contains the output of the encryption and all of the metadata required to decrypt it + * + * @generated from message vault.v1.Encrypted + */ +export class Encrypted extends Message { + /** + * @generated from field: vault.v1.Algorithm algorithm = 1; + */ + algorithm = Algorithm.AES_256_GCM; + + /** + * @generated from field: bytes nonce = 2; + */ + nonce = new Uint8Array(0); + + /** + * @generated from field: bytes ciphertext = 3; + */ + ciphertext = new Uint8Array(0); + + /** + * key id of the key that encrypted this data + * + * @generated from field: string encryption_key_id = 4; + */ + encryptionKeyId = ""; + + /** + * time of encryption + * we can use this later to figure out if a piece of data should be re-encrypted + * + * @generated from field: int64 time = 5; + */ + time = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.Encrypted"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "algorithm", kind: "enum", T: proto3.getEnumType(Algorithm) }, + { no: 2, name: "nonce", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: "ciphertext", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 4, name: "encryption_key_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "time", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Encrypted { + return new Encrypted().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Encrypted { + return new Encrypted().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Encrypted { + return new Encrypted().fromJsonString(jsonString, options); + } + + static equals( + a: Encrypted | PlainMessage | undefined, + b: Encrypted | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(Encrypted, a, b); + } +} diff --git a/internal/proto/generated/proto/vault/v1/service_connect.ts b/internal/proto/generated/proto/vault/v1/service_connect.ts new file mode 100644 index 0000000000..1ed0182f24 --- /dev/null +++ b/internal/proto/generated/proto/vault/v1/service_connect.ts @@ -0,0 +1,96 @@ +// @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts" +// @generated from file proto/vault/v1/service.proto (package vault.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { MethodKind } from "@bufbuild/protobuf"; +import { + CreateDEKRequest, + CreateDEKResponse, + DecryptRequest, + DecryptResponse, + EncryptBulkRequest, + EncryptBulkResponse, + EncryptRequest, + EncryptResponse, + LivenessRequest, + LivenessResponse, + ReEncryptDEKsRequest, + ReEncryptDEKsResponse, + ReEncryptRequest, + ReEncryptResponse, +} from "./service_pb.js"; + +/** + * @generated from service vault.v1.VaultService + */ +export const VaultService = { + typeName: "vault.v1.VaultService", + methods: { + /** + * @generated from rpc vault.v1.VaultService.Liveness + */ + liveness: { + name: "Liveness", + I: LivenessRequest, + O: LivenessResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc vault.v1.VaultService.CreateDEK + */ + createDEK: { + name: "CreateDEK", + I: CreateDEKRequest, + O: CreateDEKResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc vault.v1.VaultService.Encrypt + */ + encrypt: { + name: "Encrypt", + I: EncryptRequest, + O: EncryptResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc vault.v1.VaultService.EncryptBulk + */ + encryptBulk: { + name: "EncryptBulk", + I: EncryptBulkRequest, + O: EncryptBulkResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc vault.v1.VaultService.Decrypt + */ + decrypt: { + name: "Decrypt", + I: DecryptRequest, + O: DecryptResponse, + kind: MethodKind.Unary, + }, + /** + * ReEncrypt rec + * + * @generated from rpc vault.v1.VaultService.ReEncrypt + */ + reEncrypt: { + name: "ReEncrypt", + I: ReEncryptRequest, + O: ReEncryptResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc vault.v1.VaultService.ReEncryptDEKs + */ + reEncryptDEKs: { + name: "ReEncryptDEKs", + I: ReEncryptDEKsRequest, + O: ReEncryptDEKsResponse, + kind: MethodKind.Unary, + }, + }, +} as const; diff --git a/internal/proto/generated/proto/vault/v1/service_pb.ts b/internal/proto/generated/proto/vault/v1/service_pb.ts new file mode 100644 index 0000000000..511d471f07 --- /dev/null +++ b/internal/proto/generated/proto/vault/v1/service_pb.ts @@ -0,0 +1,612 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file proto/vault/v1/service.proto (package vault.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message vault.v1.LivenessRequest + */ +export class LivenessRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.LivenessRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => []); + + static fromBinary(bytes: Uint8Array, options?: Partial): LivenessRequest { + return new LivenessRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LivenessRequest { + return new LivenessRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LivenessRequest { + return new LivenessRequest().fromJsonString(jsonString, options); + } + + static equals( + a: LivenessRequest | PlainMessage | undefined, + b: LivenessRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(LivenessRequest, a, b); + } +} + +/** + * @generated from message vault.v1.LivenessResponse + */ +export class LivenessResponse extends Message { + /** + * @generated from field: string status = 1; + */ + status = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.LivenessResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "status", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LivenessResponse { + return new LivenessResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LivenessResponse { + return new LivenessResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LivenessResponse { + return new LivenessResponse().fromJsonString(jsonString, options); + } + + static equals( + a: LivenessResponse | PlainMessage | undefined, + b: LivenessResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(LivenessResponse, a, b); + } +} + +/** + * @generated from message vault.v1.EncryptRequest + */ +export class EncryptRequest extends Message { + /** + * @generated from field: string keyring = 1; + */ + keyring = ""; + + /** + * @generated from field: string data = 2; + */ + data = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.EncryptRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "keyring", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EncryptRequest { + return new EncryptRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EncryptRequest { + return new EncryptRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EncryptRequest { + return new EncryptRequest().fromJsonString(jsonString, options); + } + + static equals( + a: EncryptRequest | PlainMessage | undefined, + b: EncryptRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(EncryptRequest, a, b); + } +} + +/** + * @generated from message vault.v1.EncryptResponse + */ +export class EncryptResponse extends Message { + /** + * @generated from field: string encrypted = 1; + */ + encrypted = ""; + + /** + * @generated from field: string key_id = 2; + */ + keyId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.EncryptResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "encrypted", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EncryptResponse { + return new EncryptResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EncryptResponse { + return new EncryptResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EncryptResponse { + return new EncryptResponse().fromJsonString(jsonString, options); + } + + static equals( + a: EncryptResponse | PlainMessage | undefined, + b: EncryptResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(EncryptResponse, a, b); + } +} + +/** + * @generated from message vault.v1.EncryptBulkRequest + */ +export class EncryptBulkRequest extends Message { + /** + * @generated from field: string keyring = 1; + */ + keyring = ""; + + /** + * @generated from field: repeated string data = 2; + */ + data: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.EncryptBulkRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "keyring", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "data", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EncryptBulkRequest { + return new EncryptBulkRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EncryptBulkRequest { + return new EncryptBulkRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): EncryptBulkRequest { + return new EncryptBulkRequest().fromJsonString(jsonString, options); + } + + static equals( + a: EncryptBulkRequest | PlainMessage | undefined, + b: EncryptBulkRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(EncryptBulkRequest, a, b); + } +} + +/** + * @generated from message vault.v1.EncryptBulkResponse + */ +export class EncryptBulkResponse extends Message { + /** + * @generated from field: repeated vault.v1.EncryptResponse encrypted = 1; + */ + encrypted: EncryptResponse[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.EncryptBulkResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "encrypted", kind: "message", T: EncryptResponse, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EncryptBulkResponse { + return new EncryptBulkResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EncryptBulkResponse { + return new EncryptBulkResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): EncryptBulkResponse { + return new EncryptBulkResponse().fromJsonString(jsonString, options); + } + + static equals( + a: EncryptBulkResponse | PlainMessage | undefined, + b: EncryptBulkResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(EncryptBulkResponse, a, b); + } +} + +/** + * @generated from message vault.v1.DecryptRequest + */ +export class DecryptRequest extends Message { + /** + * @generated from field: string keyring = 1; + */ + keyring = ""; + + /** + * @generated from field: string encrypted = 2; + */ + encrypted = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.DecryptRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "keyring", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "encrypted", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DecryptRequest { + return new DecryptRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DecryptRequest { + return new DecryptRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DecryptRequest { + return new DecryptRequest().fromJsonString(jsonString, options); + } + + static equals( + a: DecryptRequest | PlainMessage | undefined, + b: DecryptRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DecryptRequest, a, b); + } +} + +/** + * @generated from message vault.v1.DecryptResponse + */ +export class DecryptResponse extends Message { + /** + * @generated from field: string plaintext = 1; + */ + plaintext = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.DecryptResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "plaintext", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DecryptResponse { + return new DecryptResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DecryptResponse { + return new DecryptResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DecryptResponse { + return new DecryptResponse().fromJsonString(jsonString, options); + } + + static equals( + a: DecryptResponse | PlainMessage | undefined, + b: DecryptResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(DecryptResponse, a, b); + } +} + +/** + * @generated from message vault.v1.CreateDEKRequest + */ +export class CreateDEKRequest extends Message { + /** + * @generated from field: string keyring = 1; + */ + keyring = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.CreateDEKRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "keyring", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateDEKRequest { + return new CreateDEKRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateDEKRequest { + return new CreateDEKRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateDEKRequest { + return new CreateDEKRequest().fromJsonString(jsonString, options); + } + + static equals( + a: CreateDEKRequest | PlainMessage | undefined, + b: CreateDEKRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateDEKRequest, a, b); + } +} + +/** + * @generated from message vault.v1.CreateDEKResponse + */ +export class CreateDEKResponse extends Message { + /** + * @generated from field: string key_id = 1; + */ + keyId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.CreateDEKResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateDEKResponse { + return new CreateDEKResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateDEKResponse { + return new CreateDEKResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateDEKResponse { + return new CreateDEKResponse().fromJsonString(jsonString, options); + } + + static equals( + a: CreateDEKResponse | PlainMessage | undefined, + b: CreateDEKResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(CreateDEKResponse, a, b); + } +} + +/** + * @generated from message vault.v1.ReEncryptRequest + */ +export class ReEncryptRequest extends Message { + /** + * @generated from field: string keyring = 1; + */ + keyring = ""; + + /** + * @generated from field: string encrypted = 2; + */ + encrypted = ""; + + /** + * Specify the key_id to use for re-encryption. If not provided, the latest will be used + * + * @generated from field: optional string key_id = 3; + */ + keyId?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.ReEncryptRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "keyring", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "encrypted", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "key_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReEncryptRequest { + return new ReEncryptRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReEncryptRequest { + return new ReEncryptRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ReEncryptRequest { + return new ReEncryptRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ReEncryptRequest | PlainMessage | undefined, + b: ReEncryptRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ReEncryptRequest, a, b); + } +} + +/** + * @generated from message vault.v1.ReEncryptResponse + */ +export class ReEncryptResponse extends Message { + /** + * @generated from field: string encrypted = 1; + */ + encrypted = ""; + + /** + * @generated from field: string key_id = 2; + */ + keyId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.ReEncryptResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "encrypted", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReEncryptResponse { + return new ReEncryptResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReEncryptResponse { + return new ReEncryptResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ReEncryptResponse { + return new ReEncryptResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ReEncryptResponse | PlainMessage | undefined, + b: ReEncryptResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ReEncryptResponse, a, b); + } +} + +/** + * @generated from message vault.v1.ReEncryptDEKsRequest + */ +export class ReEncryptDEKsRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.ReEncryptDEKsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => []); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReEncryptDEKsRequest { + return new ReEncryptDEKsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReEncryptDEKsRequest { + return new ReEncryptDEKsRequest().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ReEncryptDEKsRequest { + return new ReEncryptDEKsRequest().fromJsonString(jsonString, options); + } + + static equals( + a: ReEncryptDEKsRequest | PlainMessage | undefined, + b: ReEncryptDEKsRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ReEncryptDEKsRequest, a, b); + } +} + +/** + * @generated from message vault.v1.ReEncryptDEKsResponse + */ +export class ReEncryptDEKsResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "vault.v1.ReEncryptDEKsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => []); + + static fromBinary( + bytes: Uint8Array, + options?: Partial, + ): ReEncryptDEKsResponse { + return new ReEncryptDEKsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReEncryptDEKsResponse { + return new ReEncryptDEKsResponse().fromJson(jsonValue, options); + } + + static fromJsonString( + jsonString: string, + options?: Partial, + ): ReEncryptDEKsResponse { + return new ReEncryptDEKsResponse().fromJsonString(jsonString, options); + } + + static equals( + a: ReEncryptDEKsResponse | PlainMessage | undefined, + b: ReEncryptDEKsResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ReEncryptDEKsResponse, a, b); + } +} diff --git a/internal/proto/package.json b/internal/proto/package.json new file mode 100644 index 0000000000..5bf13a2ed3 --- /dev/null +++ b/internal/proto/package.json @@ -0,0 +1,22 @@ +{ + "name": "@unkey/proto", + "version": "0.0.1", + "private": true, + "type": "module", + "main": "src/index.ts", + "types": "src/index.ts", + "scripts": { + "clean": "rm -rf dist generated" + }, + "devDependencies": { + "@bufbuild/buf": "^1.47.2", + "@bufbuild/protobuf": "^1.10.0", + "@connectrpc/protoc-gen-connect-es": "^1.6.1", + "@bufbuild/protoc-gen-es": "^1.10.0", + "typescript": "^5.7.3" + }, + "dependencies": { + "@bufbuild/protobuf": "^1.10.0", + "@connectrpc/connect": "^1.6.1" + } +} diff --git a/internal/proto/src/index.ts b/internal/proto/src/index.ts new file mode 100644 index 0000000000..f49df943e5 --- /dev/null +++ b/internal/proto/src/index.ts @@ -0,0 +1,3 @@ +// Re-export ctrl service types and services +export * from "../generated/proto/ctrl/v1/deployment_pb"; +export * from "../generated/proto/ctrl/v1/deployment_connect"; diff --git a/internal/proto/tsconfig.json b/internal/proto/tsconfig.json new file mode 100644 index 0000000000..1a611ba603 --- /dev/null +++ b/internal/proto/tsconfig.json @@ -0,0 +1,9 @@ +{ + "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 984c5dc33a..07394b5cbf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,6 +142,12 @@ importers: '@ant-design/plots': specifier: ^1.2.5 version: 1.2.5(react-dom@18.3.1)(react@18.3.1) + '@connectrpc/connect': + specifier: ^2.1.0 + version: 2.1.0(@bufbuild/protobuf@2.8.0) + '@connectrpc/connect-web': + specifier: ^2.1.0 + version: 2.1.0(@bufbuild/protobuf@2.8.0)(@connectrpc/connect@2.1.0) '@hookform/resolvers': specifier: ^3.4.2 version: 3.4.2(react-hook-form@7.51.3) @@ -271,6 +277,9 @@ importers: '@unkey/keys': specifier: workspace:^ version: link:../../internal/keys + '@unkey/proto': + specifier: workspace:^ + version: link:../../internal/proto '@unkey/ratelimit': specifier: ^2.1.3 version: 2.1.3 @@ -833,6 +842,28 @@ importers: specifier: ^5.5.3 version: 5.7.3 + internal/proto: + dependencies: + '@bufbuild/protobuf': + specifier: ^1.10.0 + version: 1.10.0 + '@connectrpc/connect': + specifier: ^1.6.1 + version: 1.6.1(@bufbuild/protobuf@1.10.0) + devDependencies: + '@bufbuild/buf': + specifier: ^1.47.2 + version: 1.47.2 + '@bufbuild/protoc-gen-es': + specifier: ^1.10.0 + version: 1.10.0(@bufbuild/protobuf@1.10.0) + '@connectrpc/protoc-gen-connect-es': + specifier: ^1.6.1 + version: 1.6.1(@bufbuild/protoc-gen-es@1.10.0)(@connectrpc/connect@1.6.1) + typescript: + specifier: ^5.7.3 + version: 5.7.3 + internal/resend: dependencies: '@react-email/body': @@ -1713,6 +1744,131 @@ packages: dev: true optional: true + /@bufbuild/buf-darwin-arm64@1.47.2: + resolution: {integrity: sha512-74WerFn06y+azgVfsnzhfbI5wla/OLPDnIvaNJBWHaqya/3bfascJkDylW2GVNHmwG1K/cscpmcc/RJPaO7ntQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf-darwin-x64@1.47.2: + resolution: {integrity: sha512-adAiOacOQe8Ym/YXPCEiq9mrPeKRmDtF2TgqPWTcDy6mF7TqR7hMJINkEEuMd1EeACmXnzMOnXlm9ICtvdYgPg==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf-linux-aarch64@1.47.2: + resolution: {integrity: sha512-52vY+Owffr5diw2PyfQJqH+Fld6zW6NhNZak4zojvc2MjZKubWM0TfNyM9jXz2YrwyB+cyxkabE60nBI80m37w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf-linux-armv7@1.47.2: + resolution: {integrity: sha512-g9KtpObDeHZ/VG/0b5ZCieOao7L/WYZ0fPqFSs4N07D3APgEDhJG6vLyUcDgJMDgyLcgkNjNz0+XdYQb/tXyQw==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf-linux-x64@1.47.2: + resolution: {integrity: sha512-MODCK2BzD1Mgoyr+5Sp8xA8qMNdytj8hYheyhA5NnCGTkQf8sfqAjpBSAAmKk6Zar8HOlVXML6tzE/ioDFFGwQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf-win32-arm64@1.47.2: + resolution: {integrity: sha512-563YKYWJl3LrCY3G3+zuhb8HwOs6DzWslwGPFkKV2hwHyWyvd1DR1JjiLvw9zX64IKNctQ0HempSqc3kcboaqQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf-win32-x64@1.47.2: + resolution: {integrity: sha512-Sqcdv7La2xBDh3bTdEYb2f4UTMMqCcYe/D0RELhvQ5wDn6I35V3/2YT1OF5fRuf0BZLCo0OdO37S9L47uHSz2g==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@bufbuild/buf@1.47.2: + resolution: {integrity: sha512-glY5kCAoO4+a7HvDb+BLOdoHSdCk4mdXdkp53H8JFz7maOnkxCiHHXgRX+taFyEu25N8ybn7NjZFrZSdRwq2sA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@bufbuild/buf-darwin-arm64': 1.47.2 + '@bufbuild/buf-darwin-x64': 1.47.2 + '@bufbuild/buf-linux-aarch64': 1.47.2 + '@bufbuild/buf-linux-armv7': 1.47.2 + '@bufbuild/buf-linux-x64': 1.47.2 + '@bufbuild/buf-win32-arm64': 1.47.2 + '@bufbuild/buf-win32-x64': 1.47.2 + dev: true + + /@bufbuild/protobuf@1.10.0: + resolution: {integrity: sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==} + + /@bufbuild/protobuf@1.10.1: + resolution: {integrity: sha512-wJ8ReQbHxsAfXhrf9ixl0aYbZorRuOWpBNzm8pL8ftmSxQx/wnJD5Eg861NwJU/czy2VXFIebCeZnZrI9rktIQ==} + dev: true + + /@bufbuild/protobuf@2.8.0: + resolution: {integrity: sha512-r1/0w5C9dkbcdjyxY8ZHsC5AOWg4Pnzhm2zu7LO4UHSounp2tMm6Y+oioV9zlGbLveE7YaWRDUk48WLxRDgoqg==} + dev: false + + /@bufbuild/protoc-gen-es@1.10.0(@bufbuild/protobuf@1.10.0): + resolution: {integrity: sha512-zBYBsVT/ul4uZb6F+kD7/k4sWNHVVbEPfJwKi0FDr+9VJo8MKIofI6pkr5ksBLr4fi/74r+e/75Xi/0clL5dXg==} + engines: {node: '>=14'} + hasBin: true + peerDependencies: + '@bufbuild/protobuf': 1.10.0 + peerDependenciesMeta: + '@bufbuild/protobuf': + optional: true + dependencies: + '@bufbuild/protobuf': 1.10.0 + '@bufbuild/protoplugin': 1.10.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@bufbuild/protoplugin@1.10.0: + resolution: {integrity: sha512-u6NE4vL0lw1+EK4/PiE/SQB7fKO4LRJNTEScIXVOi2x88K/c8WKc/k0KyEaA0asVBMpwekJQZGnRyj04ZtN5Gg==} + dependencies: + '@bufbuild/protobuf': 1.10.0 + '@typescript/vfs': 1.6.1(typescript@4.5.2) + typescript: 4.5.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@bufbuild/protoplugin@1.10.1: + resolution: {integrity: sha512-LaSbfwabAFIvbVnbn8jWwElRoffCIxhVraO8arliVwWupWezHLXgqPHEYLXZY/SsAR+/YsFBQJa8tAGtNPJyaQ==} + dependencies: + '@bufbuild/protobuf': 1.10.1 + '@typescript/vfs': 1.6.1(typescript@4.5.2) + typescript: 4.5.2 + transitivePeerDependencies: + - supports-color + dev: true + /@changesets/apply-release-plan@7.0.12: resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} dependencies: @@ -2130,6 +2286,52 @@ packages: dev: true optional: true + /@connectrpc/connect-web@2.1.0(@bufbuild/protobuf@2.8.0)(@connectrpc/connect@2.1.0): + resolution: {integrity: sha512-4IBFeMeXS1RVtmmFE/MwH+vWq/5vDRKys70va+DAaWDh83Rdy0iUQOJbITUDzvonlY5as3vwfs5yy9Yp2miHSw==} + peerDependencies: + '@bufbuild/protobuf': ^2.7.0 + '@connectrpc/connect': 2.1.0 + dependencies: + '@bufbuild/protobuf': 2.8.0 + '@connectrpc/connect': 2.1.0(@bufbuild/protobuf@2.8.0) + dev: false + + /@connectrpc/connect@1.6.1(@bufbuild/protobuf@1.10.0): + resolution: {integrity: sha512-KchMDNtU4CDTdkyf0qG7ugJ6qHTOR/aI7XebYn3OTCNagaDYWiZUVKgRgwH79yeMkpNgvEUaXSK7wKjaBK9b/Q==} + peerDependencies: + '@bufbuild/protobuf': ^1.10.0 + dependencies: + '@bufbuild/protobuf': 1.10.0 + + /@connectrpc/connect@2.1.0(@bufbuild/protobuf@2.8.0): + resolution: {integrity: sha512-xhiwnYlJNHzmFsRw+iSPIwXR/xweTvTw8x5HiwWp10sbVtd4OpOXbRgE7V58xs1EC17fzusF1f5uOAy24OkBuA==} + peerDependencies: + '@bufbuild/protobuf': ^2.7.0 + dependencies: + '@bufbuild/protobuf': 2.8.0 + dev: false + + /@connectrpc/protoc-gen-connect-es@1.6.1(@bufbuild/protoc-gen-es@1.10.0)(@connectrpc/connect@1.6.1): + resolution: {integrity: sha512-0fHcaADd+GKM0I/koIQpmKg7b+QL18bXlggTUYEAlMFzsd4zN/ApG3235hdUcRyhrAOAItTXxh8ZAV/nNd43Gg==} + engines: {node: '>=16.0.0'} + hasBin: true + peerDependencies: + '@bufbuild/protoc-gen-es': ^1.10.0 + '@connectrpc/connect': 1.6.1 + peerDependenciesMeta: + '@bufbuild/protoc-gen-es': + optional: true + '@connectrpc/connect': + optional: true + dependencies: + '@bufbuild/protobuf': 1.10.0 + '@bufbuild/protoc-gen-es': 1.10.0(@bufbuild/protobuf@1.10.0) + '@bufbuild/protoplugin': 1.10.1 + '@connectrpc/connect': 1.6.1(@bufbuild/protobuf@1.10.0) + transitivePeerDependencies: + - supports-color + dev: true + /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -10716,6 +10918,17 @@ packages: eslint-visitor-keys: 4.2.1 dev: true + /@typescript/vfs@1.6.1(typescript@4.5.2): + resolution: {integrity: sha512-JwoxboBh7Oz1v38tPbkrZ62ZXNHAk9bJ7c9x0eI5zBfBnBYGhURdbnh7Z4smN/MV48Y5OCcZb58n972UtbazsA==} + peerDependencies: + typescript: '*' + dependencies: + debug: 4.4.1(supports-color@8.1.1) + typescript: 4.5.2 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript/vfs@1.6.1(typescript@5.7.3): resolution: {integrity: sha512-JwoxboBh7Oz1v38tPbkrZ62ZXNHAk9bJ7c9x0eI5zBfBnBYGhURdbnh7Z4smN/MV48Y5OCcZb58n972UtbazsA==} peerDependencies: @@ -22077,6 +22290,12 @@ packages: resolution: {integrity: sha512-dFSOFBKV6uwaloBCCUhxlD3Pr/P1a/tJdcmPrTXCHlEFD3faj0mztjcGn6VBAhQ0/Bdy8K3VWrrqwbt/ffsYsg==} dev: false + /typescript@4.5.2: + resolution: {integrity: sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'}