From e7dfd8215eeaf1d9d3111f9a45669ac89c57f908 Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Wed, 23 Oct 2024 18:20:20 +0100 Subject: [PATCH] Regenerate client from API definition --- src/gen/depot/core/v1/build_connect.ts | 69 ++++ src/gen/depot/core/v1/build_pb.ts | 474 +++++++++++++++++++++++++ src/gen/depot/core/v1/project_pb.ts | 16 + src/index.ts | 2 + 4 files changed, 561 insertions(+) create mode 100644 src/gen/depot/core/v1/build_connect.ts create mode 100644 src/gen/depot/core/v1/build_pb.ts diff --git a/src/gen/depot/core/v1/build_connect.ts b/src/gen/depot/core/v1/build_connect.ts new file mode 100644 index 0000000..eab6b78 --- /dev/null +++ b/src/gen/depot/core/v1/build_connect.ts @@ -0,0 +1,69 @@ +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts" +// @generated from file depot/core/v1/build.proto (package depot.core.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import {MethodKind} from '@bufbuild/protobuf' +import { + GetBuildRequest, + GetBuildResponse, + ListBuildsRequest, + ListBuildsResponse, + ShareBuildRequest, + ShareBuildResponse, + StopSharingBuildRequest, + StopSharingBuildResponse, +} from './build_pb.js' + +/** + * @generated from service depot.core.v1.BuildService + */ +export const BuildService = { + typeName: 'depot.core.v1.BuildService', + methods: { + /** + * Share a URL to a build with users outside of your organization + * + * @generated from rpc depot.core.v1.BuildService.ShareBuild + */ + shareBuild: { + name: 'ShareBuild', + I: ShareBuildRequest, + O: ShareBuildResponse, + kind: MethodKind.Unary, + }, + /** + * Stop sharing a build + * + * @generated from rpc depot.core.v1.BuildService.StopSharingBuild + */ + stopSharingBuild: { + name: 'StopSharingBuild', + I: StopSharingBuildRequest, + O: StopSharingBuildResponse, + kind: MethodKind.Unary, + }, + /** + * List the builds in your organization + * + * @generated from rpc depot.core.v1.BuildService.ListBuilds + */ + listBuilds: { + name: 'ListBuilds', + I: ListBuildsRequest, + O: ListBuildsResponse, + kind: MethodKind.Unary, + }, + /** + * Get the build metadata of a build + * + * @generated from rpc depot.core.v1.BuildService.GetBuild + */ + getBuild: { + name: 'GetBuild', + I: GetBuildRequest, + O: GetBuildResponse, + kind: MethodKind.Unary, + }, + }, +} as const diff --git a/src/gen/depot/core/v1/build_pb.ts b/src/gen/depot/core/v1/build_pb.ts new file mode 100644 index 0000000..5b43567 --- /dev/null +++ b/src/gen/depot/core/v1/build_pb.ts @@ -0,0 +1,474 @@ +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts" +// @generated from file depot/core/v1/build.proto (package depot.core.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { + BinaryReadOptions, + FieldList, + JsonReadOptions, + JsonValue, + PartialMessage, + PlainMessage, +} from '@bufbuild/protobuf' +import {Message, proto3, Timestamp} from '@bufbuild/protobuf' + +/** + * @generated from message depot.core.v1.ShareBuildRequest + */ +export class ShareBuildRequest 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 = 'depot.core.v1.ShareBuildRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + {no: 1, name: 'build_id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, + ]) + + static fromBinary(bytes: Uint8Array, options?: Partial): ShareBuildRequest { + return new ShareBuildRequest().fromBinary(bytes, options) + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ShareBuildRequest { + return new ShareBuildRequest().fromJson(jsonValue, options) + } + + static fromJsonString(jsonString: string, options?: Partial): ShareBuildRequest { + return new ShareBuildRequest().fromJsonString(jsonString, options) + } + + static equals( + a: ShareBuildRequest | PlainMessage | undefined, + b: ShareBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ShareBuildRequest, a, b) + } +} + +/** + * @generated from message depot.core.v1.ShareBuildResponse + */ +export class ShareBuildResponse extends Message { + /** + * @generated from field: string share_url = 1; + */ + shareUrl = '' + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'depot.core.v1.ShareBuildResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + {no: 1, name: 'share_url', kind: 'scalar', T: 9 /* ScalarType.STRING */}, + ]) + + static fromBinary(bytes: Uint8Array, options?: Partial): ShareBuildResponse { + return new ShareBuildResponse().fromBinary(bytes, options) + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ShareBuildResponse { + return new ShareBuildResponse().fromJson(jsonValue, options) + } + + static fromJsonString(jsonString: string, options?: Partial): ShareBuildResponse { + return new ShareBuildResponse().fromJsonString(jsonString, options) + } + + static equals( + a: ShareBuildResponse | PlainMessage | undefined, + b: ShareBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(ShareBuildResponse, a, b) + } +} + +/** + * @generated from message depot.core.v1.StopSharingBuildRequest + */ +export class StopSharingBuildRequest 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 = 'depot.core.v1.StopSharingBuildRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + {no: 1, name: 'build_id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, + ]) + + static fromBinary(bytes: Uint8Array, options?: Partial): StopSharingBuildRequest { + return new StopSharingBuildRequest().fromBinary(bytes, options) + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StopSharingBuildRequest { + return new StopSharingBuildRequest().fromJson(jsonValue, options) + } + + static fromJsonString(jsonString: string, options?: Partial): StopSharingBuildRequest { + return new StopSharingBuildRequest().fromJsonString(jsonString, options) + } + + static equals( + a: StopSharingBuildRequest | PlainMessage | undefined, + b: StopSharingBuildRequest | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(StopSharingBuildRequest, a, b) + } +} + +/** + * @generated from message depot.core.v1.StopSharingBuildResponse + */ +export class StopSharingBuildResponse extends Message { + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'depot.core.v1.StopSharingBuildResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => []) + + static fromBinary(bytes: Uint8Array, options?: Partial): StopSharingBuildResponse { + return new StopSharingBuildResponse().fromBinary(bytes, options) + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StopSharingBuildResponse { + return new StopSharingBuildResponse().fromJson(jsonValue, options) + } + + static fromJsonString(jsonString: string, options?: Partial): StopSharingBuildResponse { + return new StopSharingBuildResponse().fromJsonString(jsonString, options) + } + + static equals( + a: StopSharingBuildResponse | PlainMessage | undefined, + b: StopSharingBuildResponse | PlainMessage | undefined, + ): boolean { + return proto3.util.equals(StopSharingBuildResponse, a, b) + } +} + +/** + * @generated from message depot.core.v1.ListBuildsRequest + */ +export class ListBuildsRequest extends Message { + /** + * @generated from field: string project_id = 1; + */ + projectId = '' + + /** + * @generated from field: optional int32 page_size = 2; + */ + pageSize?: number + + /** + * @generated from field: optional string page_token = 3; + */ + pageToken?: string + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'depot.core.v1.ListBuildsRequest' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + {no: 1, name: 'project_id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, + {no: 2, name: 'page_size', kind: 'scalar', T: 5 /* ScalarType.INT32 */, opt: true}, + {no: 3, name: 'page_token', kind: 'scalar', T: 9 /* ScalarType.STRING */, opt: true}, + ]) + + 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 depot.core.v1.ListBuildsResponse + */ +export class ListBuildsResponse extends Message { + /** + * @generated from field: repeated depot.core.v1.Build builds = 1; + */ + builds: Build[] = [] + + /** + * @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 = 'depot.core.v1.ListBuildsResponse' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + {no: 1, name: 'builds', kind: 'message', T: Build, repeated: true}, + {no: 2, name: 'next_page_token', kind: 'scalar', T: 9 /* ScalarType.STRING */}, + ]) + + 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 depot.core.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 = 'depot.core.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 depot.core.v1.GetBuildResponse + */ +export class GetBuildResponse extends Message { + /** + * @generated from field: depot.core.v1.Build build = 1; + */ + build?: Build + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'depot.core.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 depot.core.v1.Build + */ +export class Build extends Message { + /** + * @generated from field: string build_id = 1; + */ + buildId = '' + + /** + * @generated from field: depot.core.v1.Build.Status status = 2; + */ + status = Build_Status.UNSPECIFIED + + /** + * @generated from field: google.protobuf.Timestamp created_at = 3; + */ + createdAt?: Timestamp + + /** + * @generated from field: optional google.protobuf.Timestamp started_at = 4; + */ + startedAt?: Timestamp + + /** + * @generated from field: optional google.protobuf.Timestamp finished_at = 5; + */ + finishedAt?: Timestamp + + /** + * @generated from field: optional int32 build_duration_seconds = 6; + */ + buildDurationSeconds?: number + + /** + * @generated from field: optional int32 saved_duration_seconds = 7; + */ + savedDurationSeconds?: number + + /** + * @generated from field: optional int32 cached_steps = 8; + */ + cachedSteps?: number + + /** + * @generated from field: optional int32 total_steps = 9; + */ + totalSteps?: number + + constructor(data?: PartialMessage) { + super() + proto3.util.initPartial(data, this) + } + + static readonly runtime: typeof proto3 = proto3 + static readonly typeName = 'depot.core.v1.Build' + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + {no: 1, name: 'build_id', kind: 'scalar', T: 9 /* ScalarType.STRING */}, + {no: 2, name: 'status', kind: 'enum', T: proto3.getEnumType(Build_Status)}, + {no: 3, name: 'created_at', kind: 'message', T: Timestamp}, + {no: 4, name: 'started_at', kind: 'message', T: Timestamp, opt: true}, + {no: 5, name: 'finished_at', kind: 'message', T: Timestamp, opt: true}, + {no: 6, name: 'build_duration_seconds', kind: 'scalar', T: 5 /* ScalarType.INT32 */, opt: true}, + {no: 7, name: 'saved_duration_seconds', kind: 'scalar', T: 5 /* ScalarType.INT32 */, opt: true}, + {no: 8, name: 'cached_steps', kind: 'scalar', T: 5 /* ScalarType.INT32 */, opt: true}, + {no: 9, name: 'total_steps', kind: 'scalar', T: 5 /* ScalarType.INT32 */, opt: true}, + ]) + + 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) + } +} + +/** + * @generated from enum depot.core.v1.Build.Status + */ +export enum Build_Status { + /** + * @generated from enum value: STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: STATUS_RUNNING = 1; + */ + RUNNING = 1, + + /** + * @generated from enum value: STATUS_FAILED = 2; + */ + FAILED = 2, + + /** + * @generated from enum value: STATUS_SUCCESS = 3; + */ + SUCCESS = 3, + + /** + * @generated from enum value: STATUS_ERROR = 4; + */ + ERROR = 4, + + /** + * @generated from enum value: STATUS_CANCELED = 5; + */ + CANCELED = 5, +} +// Retrieve enum metadata with: proto3.getEnumType(Build_Status) +proto3.util.setEnumType(Build_Status, 'depot.core.v1.Build.Status', [ + {no: 0, name: 'STATUS_UNSPECIFIED'}, + {no: 1, name: 'STATUS_RUNNING'}, + {no: 2, name: 'STATUS_FAILED'}, + {no: 3, name: 'STATUS_SUCCESS'}, + {no: 4, name: 'STATUS_ERROR'}, + {no: 5, name: 'STATUS_CANCELED'}, +]) diff --git a/src/gen/depot/core/v1/project_pb.ts b/src/gen/depot/core/v1/project_pb.ts index 9ad54cf..ecbccd8 100644 --- a/src/gen/depot/core/v1/project_pb.ts +++ b/src/gen/depot/core/v1/project_pb.ts @@ -39,12 +39,28 @@ export enum Hardware { * @generated from enum value: HARDWARE_4X4 = 2; */ HARDWARE_4X4 = 2, + + /** + * 8 CPU and 8GB of memory. + * + * @generated from enum value: HARDWARE_8X8 = 3; + */ + HARDWARE_8X8 = 3, + + /** + * 8 CPU and 16GB of memory. + * + * @generated from enum value: HARDWARE_8X16 = 4; + */ + HARDWARE_8X16 = 4, } // Retrieve enum metadata with: proto3.getEnumType(Hardware) proto3.util.setEnumType(Hardware, 'depot.core.v1.Hardware', [ {no: 0, name: 'HARDWARE_UNSPECIFIED'}, {no: 1, name: 'HARDWARE_16X32'}, {no: 2, name: 'HARDWARE_4X4'}, + {no: 3, name: 'HARDWARE_8X8'}, + {no: 4, name: 'HARDWARE_8X16'}, ]) /** diff --git a/src/index.ts b/src/index.ts index af1d8a8..2d3c6c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import {createPromiseClient} from '@connectrpc/connect' import {createConnectTransport} from '@connectrpc/connect-node' import * as buildV1Build from './gen/depot/build/v1/build_connect' import * as buildkitV1BuildKit from './gen/depot/buildkit/v1/buildkit_connect' +import * as coreV1Build from './gen/depot/core/v1/build_connect' import * as coreV1Project from './gen/depot/core/v1/project_connect' const transport = createConnectTransport({ @@ -22,6 +23,7 @@ export const depot = { }, core: { v1: { + BuildService: createPromiseClient(coreV1Build.BuildService, transport), ProjectService: createPromiseClient(coreV1Project.ProjectService, transport), }, },