remove file from input spec (#2782)

This commit is contained in:
Matt Hill
2024-11-11 12:17:44 -07:00
committed by GitHub
parent aab2b8fdbc
commit c088ab7a79
2 changed files with 41 additions and 43 deletions

View File

@@ -689,47 +689,47 @@ export class Value<Type, Store> {
}
}, spec.validator)
}
static file<Store>(a: {
name: string
description?: string | null
extensions: string[]
required: boolean
}) {
const buildValue = {
type: "file" as const,
description: null,
warning: null,
...a,
}
return new Value<FilePath, Store>(
() => ({
...buildValue,
}),
asRequiredParser(object({ filePath: string }), a),
)
}
static dynamicFile<Required extends boolean, Store>(
a: LazyBuild<
Store,
{
name: string
description?: string | null
warning?: string | null
extensions: string[]
required: Required
}
>,
) {
return new Value<string | null | undefined, Store>(
async (options) => ({
type: "file" as const,
description: null,
warning: null,
...(await a(options)),
}),
string.optional(),
)
}
// static file<Store>(a: {
// name: string
// description?: string | null
// extensions: string[]
// required: boolean
// }) {
// const buildValue = {
// type: "file" as const,
// description: null,
// warning: null,
// ...a,
// }
// return new Value<FilePath, Store>(
// () => ({
// ...buildValue,
// }),
// asRequiredParser(object({ filePath: string }), a),
// )
// }
// static dynamicFile<Required extends boolean, Store>(
// a: LazyBuild<
// Store,
// {
// name: string
// description?: string | null
// warning?: string | null
// extensions: string[]
// required: Required
// }
// >,
// ) {
// return new Value<string | null | undefined, Store>(
// async (options) => ({
// type: "file" as const,
// description: null,
// warning: null,
// ...(await a(options)),
// }),
// string.optional(),
// )
// }
static union<Required extends RequiredDefault<string>, Type, Store>(
a: {
name: string

View File

@@ -8,12 +8,10 @@ import {
ClearServiceInterfacesParams,
GetActionInputParams,
GetStatusParams,
GetStoreParams,
RequestActionParams,
RunActionParams,
SetDataVersionParams,
SetMainStatus,
SetStoreParams,
} from ".././osBindings"
import { CreateSubcontainerFsParams } from ".././osBindings"
import { DestroySubcontainerFsParams } from ".././osBindings"