mirror of https://github.com/actions/toolkit
Add missing function return types
parent
83baffc3f6
commit
2ee77e654f
|
@ -4,8 +4,8 @@ import * as config from './internal/config'
|
||||||
import * as utils from './internal/cacheUtils'
|
import * as utils from './internal/cacheUtils'
|
||||||
import * as cacheHttpClient from './internal/cacheHttpClient'
|
import * as cacheHttpClient from './internal/cacheHttpClient'
|
||||||
import * as cacheTwirpClient from './internal/shared/cacheTwirpClient'
|
import * as cacheTwirpClient from './internal/shared/cacheTwirpClient'
|
||||||
import { DownloadOptions, UploadOptions } from './options'
|
import {DownloadOptions, UploadOptions} from './options'
|
||||||
import { createTar, extractTar, listTar } from './internal/tar'
|
import {createTar, extractTar, listTar} from './internal/tar'
|
||||||
import {
|
import {
|
||||||
CreateCacheEntryRequest,
|
CreateCacheEntryRequest,
|
||||||
CreateCacheEntryResponse,
|
CreateCacheEntryResponse,
|
||||||
|
@ -14,9 +14,9 @@ import {
|
||||||
GetCacheEntryDownloadURLRequest,
|
GetCacheEntryDownloadURLRequest,
|
||||||
GetCacheEntryDownloadURLResponse
|
GetCacheEntryDownloadURLResponse
|
||||||
} from './generated/results/api/v1/cache'
|
} from './generated/results/api/v1/cache'
|
||||||
import { CacheFileSizeLimit } from './internal/constants'
|
import {CacheFileSizeLimit} from './internal/constants'
|
||||||
import { UploadCacheFile } from './internal/blob/upload-cache'
|
import {UploadCacheFile} from './internal/blob/upload-cache'
|
||||||
import { DownloadCacheFile } from './internal/blob/download-cache'
|
import {DownloadCacheFile} from './internal/blob/download-cache'
|
||||||
export class ValidationError extends Error {
|
export class ValidationError extends Error {
|
||||||
constructor(message: string) {
|
constructor(message: string) {
|
||||||
super(message)
|
super(message)
|
||||||
|
@ -121,7 +121,7 @@ async function restoreCachev1(
|
||||||
restoreKeys?: string[],
|
restoreKeys?: string[],
|
||||||
options?: DownloadOptions,
|
options?: DownloadOptions,
|
||||||
enableCrossOsArchive = false
|
enableCrossOsArchive = false
|
||||||
) {
|
): Promise<string | undefined> {
|
||||||
restoreKeys = restoreKeys || []
|
restoreKeys = restoreKeys || []
|
||||||
const keys = [primaryKey, ...restoreKeys]
|
const keys = [primaryKey, ...restoreKeys]
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ async function restoreCachev2(
|
||||||
restoreKeys?: string[],
|
restoreKeys?: string[],
|
||||||
options?: DownloadOptions,
|
options?: DownloadOptions,
|
||||||
enableCrossOsArchive = false
|
enableCrossOsArchive = false
|
||||||
) {
|
): Promise<string | undefined> {
|
||||||
restoreKeys = restoreKeys || []
|
restoreKeys = restoreKeys || []
|
||||||
const keys = [primaryKey, ...restoreKeys]
|
const keys = [primaryKey, ...restoreKeys]
|
||||||
|
|
||||||
|
@ -406,9 +406,9 @@ async function saveCachev1(
|
||||||
} else if (reserveCacheResponse?.statusCode === 400) {
|
} else if (reserveCacheResponse?.statusCode === 400) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
reserveCacheResponse?.error?.message ??
|
reserveCacheResponse?.error?.message ??
|
||||||
`Cache size of ~${Math.round(
|
`Cache size of ~${Math.round(
|
||||||
archiveFileSize / (1024 * 1024)
|
archiveFileSize / (1024 * 1024)
|
||||||
)} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
|
)} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
throw new ReserveCacheError(
|
throw new ReserveCacheError(
|
||||||
|
|
Loading…
Reference in New Issue