mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
sdk hotfix
This commit is contained in:
@@ -422,6 +422,9 @@ impl ImageSource {
|
||||
// docker buildx build ${path} -o type=image,name=start9/${id}
|
||||
let tag = format!("start9/{id}/{image_id}:{}", new_guid());
|
||||
let mut command = Command::new(CONTAINER_TOOL);
|
||||
if CONTAINER_TOOL == "docker" {
|
||||
command.arg("buildx");
|
||||
}
|
||||
command
|
||||
.arg("build")
|
||||
.arg(workdir)
|
||||
@@ -553,6 +556,7 @@ impl ImageSource {
|
||||
Command::new(CONTAINER_TOOL)
|
||||
.arg("create")
|
||||
.arg(&docker_platform)
|
||||
.arg("--entrypoint=/bin/sh")
|
||||
.arg(&tag)
|
||||
.invoke(ErrorKind::Docker)
|
||||
.await?,
|
||||
|
||||
@@ -13,7 +13,7 @@ export type Run<
|
||||
| InputSpec<Record<string, never>, never>,
|
||||
> = (options: {
|
||||
effects: T.Effects
|
||||
input: ExtractInputSpecType<A> & Record<string, any>
|
||||
input: ExtractInputSpecType<A>
|
||||
}) => Promise<(T.ActionResult & { version: "1" }) | null | void | undefined>
|
||||
export type GetInput<
|
||||
A extends
|
||||
@@ -22,12 +22,7 @@ export type GetInput<
|
||||
| InputSpec<Record<string, any>, never>,
|
||||
> = (options: {
|
||||
effects: T.Effects
|
||||
}) => Promise<
|
||||
| null
|
||||
| void
|
||||
| undefined
|
||||
| (ExtractPartialInputSpecType<A> & Record<string, any>)
|
||||
>
|
||||
}) => Promise<null | void | undefined | ExtractPartialInputSpecType<A>>
|
||||
|
||||
export type MaybeFn<T> = T | ((options: { effects: T.Effects }) => Promise<T>)
|
||||
function callMaybeFn<T>(
|
||||
@@ -63,8 +58,8 @@ export class Action<
|
||||
readonly id: Id,
|
||||
private readonly metadataFn: MaybeFn<T.ActionMetadata>,
|
||||
private readonly inputSpec: InputSpecType,
|
||||
private readonly getInputFn: GetInput<ExtractInputSpecType<InputSpecType>>,
|
||||
private readonly runFn: Run<ExtractInputSpecType<InputSpecType>>,
|
||||
private readonly getInputFn: GetInput<InputSpecType>,
|
||||
private readonly runFn: Run<InputSpecType>,
|
||||
) {}
|
||||
static withInput<
|
||||
Id extends T.ActionId,
|
||||
@@ -77,8 +72,8 @@ export class Action<
|
||||
id: Id,
|
||||
metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>,
|
||||
inputSpec: InputSpecType,
|
||||
getInput: GetInput<ExtractInputSpecType<InputSpecType>>,
|
||||
run: Run<ExtractInputSpecType<InputSpecType>>,
|
||||
getInput: GetInput<InputSpecType>,
|
||||
run: Run<InputSpecType>,
|
||||
): Action<Id, Store, InputSpecType> {
|
||||
return new Action(
|
||||
id,
|
||||
|
||||
@@ -301,14 +301,12 @@ export class StartSdk<Manifest extends T.SDKManifest, Store> {
|
||||
| Record<string, any>
|
||||
| InputSpec<any, any>
|
||||
| InputSpec<any, never>,
|
||||
Type extends
|
||||
ExtractInputSpecType<InputSpecType> = ExtractInputSpecType<InputSpecType>,
|
||||
>(
|
||||
id: Id,
|
||||
metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>,
|
||||
inputSpec: InputSpecType,
|
||||
getInput: GetInput<Type>,
|
||||
run: Run<Type>,
|
||||
getInput: GetInput<InputSpecType>,
|
||||
run: Run<InputSpecType>,
|
||||
) => Action.withInput(id, metadata, inputSpec, getInput, run),
|
||||
/**
|
||||
* @description Use this function to create an action that does not accept form input
|
||||
|
||||
4
sdk/package/package-lock.json
generated
4
sdk/package/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@start9labs/start-sdk",
|
||||
"version": "0.3.6-beta.5",
|
||||
"version": "0.3.6-beta.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@start9labs/start-sdk",
|
||||
"version": "0.3.6-beta.5",
|
||||
"version": "0.3.6-beta.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@iarna/toml": "^2.2.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@start9labs/start-sdk",
|
||||
"version": "0.3.6-beta.5",
|
||||
"version": "0.3.6-beta.6",
|
||||
"description": "Software development kit to facilitate packaging services for StartOS",
|
||||
"main": "./package/lib/index.js",
|
||||
"types": "./package/lib/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user