Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove file from input spec #2782

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions sdk/base/lib/actions/input/builder/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions sdk/base/lib/test/startosTypeValidation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import {
ClearServiceInterfacesParams,
GetActionInputParams,
GetStatusParams,
GetStoreParams,
RequestActionParams,
RunActionParams,
SetDataVersionParams,
SetMainStatus,
SetStoreParams,
} from ".././osBindings"
import { CreateSubcontainerFsParams } from ".././osBindings"
import { DestroySubcontainerFsParams } from ".././osBindings"
Expand Down
Loading