Skip to content

Commit

Permalink
remove file from input spec (#2782)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattDHill authored Nov 11, 2024
1 parent aab2b8f commit c088ab7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 43 deletions.
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

0 comments on commit c088ab7

Please sign in to comment.