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