mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
chore: update the name of metadata
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Config, ExtractConfigType } from "../config/builder/config"
|
||||
import { ActionMetaData, ActionResult, Effects, ExportedAction } from "../types"
|
||||
import { ActionMetadata, ActionResult, Effects, ExportedAction } from "../types"
|
||||
import { createUtils } from "../util"
|
||||
import { Utils, utils } from "../util/utils"
|
||||
|
||||
@@ -13,7 +13,7 @@ export class CreatedAction<
|
||||
Type extends Record<string, any> = ExtractConfigType<ConfigType>,
|
||||
> {
|
||||
private constructor(
|
||||
public readonly myMetaData: Omit<ActionMetaData, "input">,
|
||||
public readonly myMetaData: Omit<ActionMetadata, "input">,
|
||||
readonly fn: (options: {
|
||||
effects: Effects
|
||||
utils: Utils<Store, Vault>
|
||||
@@ -32,7 +32,7 @@ export class CreatedAction<
|
||||
| Config<any, never, never>,
|
||||
Type extends Record<string, any> = ExtractConfigType<ConfigType>,
|
||||
>(
|
||||
metaData: Omit<ActionMetaData, "input"> & {
|
||||
metaData: Omit<ActionMetadata, "input"> & {
|
||||
input: Config<Type, Store, Vault> | Config<Type, never, never>
|
||||
},
|
||||
fn: (options: {
|
||||
@@ -65,10 +65,10 @@ export class CreatedAction<
|
||||
})
|
||||
}
|
||||
|
||||
async actionMetaData(options: {
|
||||
async ActionMetadata(options: {
|
||||
effects: Effects
|
||||
utils: Utils<Store, Vault>
|
||||
}): Promise<ActionMetaData> {
|
||||
}): Promise<ActionMetadata> {
|
||||
return {
|
||||
...this.myMetaData,
|
||||
input: await this.input.build(options),
|
||||
|
||||
@@ -17,14 +17,14 @@ export function setupActions<Store, Vault>(
|
||||
get actions() {
|
||||
return myActions()
|
||||
},
|
||||
async actionsMetaData({ effects }: { effects: Effects }) {
|
||||
async actionsMetadata({ effects }: { effects: Effects }) {
|
||||
const utils = createUtils<Store, Vault>(effects)
|
||||
return Promise.all(
|
||||
createdActions.map((x) => x.actionMetaData({ effects, utils })),
|
||||
createdActions.map((x) => x.ActionMetadata({ effects, utils })),
|
||||
)
|
||||
},
|
||||
} satisfies {
|
||||
actions: ExpectedExports.actions
|
||||
actionsMetaData: ExpectedExports.actionsMetaData
|
||||
actionsMetadata: ExpectedExports.actionsMetadata
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user