Skip to content

Commit bdb20a6

Browse files
committed
Added explicit return types because TS was complaining…
1 parent bf2c5b2 commit bdb20a6

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

packages/cli-v3/src/apiClient.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export class CliApiClient {
418418
heartbeatRun: this.devHeartbeatRun.bind(this),
419419
startRunAttempt: this.devStartRunAttempt.bind(this),
420420
completeRunAttempt: this.devCompleteRunAttempt.bind(this),
421-
};
421+
} as const;
422422
}
423423

424424
get workers() {
@@ -481,7 +481,7 @@ export class CliApiClient {
481481
});
482482
}
483483

484-
private async devConfig() {
484+
private async devConfig(): Promise<ApiResult<DevConfigResponseBody>> {
485485
if (!this.accessToken) {
486486
throw new Error("devConfig: No access token");
487487
}
@@ -532,7 +532,9 @@ export class CliApiClient {
532532
});
533533
}
534534

535-
private async devDequeue(body: DevDequeueRequestBody) {
535+
private async devDequeue(
536+
body: DevDequeueRequestBody
537+
): Promise<ApiResult<DevDequeueResponseBody>> {
536538
if (!this.accessToken) {
537539
throw new Error("devConfig: No access token");
538540
}
@@ -547,7 +549,10 @@ export class CliApiClient {
547549
});
548550
}
549551

550-
private async devSendDebugLog(runId: string, body: WorkloadDebugLogRequestBody) {
552+
private async devSendDebugLog(
553+
runId: string,
554+
body: WorkloadDebugLogRequestBody
555+
): Promise<ApiResult<unknown>> {
551556
if (!this.accessToken) {
552557
throw new Error("devConfig: No access token");
553558
}
@@ -563,7 +568,9 @@ export class CliApiClient {
563568
});
564569
}
565570

566-
private async devGetRunExecutionData(runId: string) {
571+
private async devGetRunExecutionData(
572+
runId: string
573+
): Promise<ApiResult<WorkloadRunLatestSnapshotResponseBody>> {
567574
return wrapZodFetch(
568575
WorkloadRunLatestSnapshotResponseBody,
569576
`${this.apiURL}/engine/v1/dev/runs/${runId}/snapshots/latest`,
@@ -581,7 +588,7 @@ export class CliApiClient {
581588
runId: string,
582589
snapshotId: string,
583590
body: WorkloadHeartbeatRequestBody
584-
) {
591+
): Promise<ApiResult<WorkloadHeartbeatResponseBody>> {
585592
return wrapZodFetch(
586593
WorkloadHeartbeatResponseBody,
587594
`${this.apiURL}/engine/v1/dev/runs/${runId}/snapshots/${snapshotId}/heartbeat`,
@@ -597,7 +604,10 @@ export class CliApiClient {
597604
);
598605
}
599606

600-
private async devStartRunAttempt(runId: string, snapshotId: string) {
607+
private async devStartRunAttempt(
608+
runId: string,
609+
snapshotId: string
610+
): Promise<ApiResult<WorkloadRunAttemptStartResponseBody>> {
601611
return wrapZodFetch(
602612
WorkloadRunAttemptStartResponseBody,
603613
`${this.apiURL}/engine/v1/dev/runs/${runId}/snapshots/${snapshotId}/attempts/start`,
@@ -617,7 +627,7 @@ export class CliApiClient {
617627
runId: string,
618628
snapshotId: string,
619629
body: WorkloadRunAttemptCompleteRequestBody
620-
) {
630+
): Promise<ApiResult<WorkloadRunAttemptCompleteResponseBody>> {
621631
return wrapZodFetch(
622632
WorkloadRunAttemptCompleteResponseBody,
623633
`${this.apiURL}/engine/v1/dev/runs/${runId}/snapshots/${snapshotId}/attempts/complete`,

0 commit comments

Comments
 (0)