@heybox/hb-sdk API Reference - v0.9.5
    正在准备搜索索引...

    接口 WorkspaceCardControllerContext

    interface WorkspaceCardControllerContext {
        environment: { locale: string; platform: "windows" | "macos" };
        game: { appId: string };
        images?: {
            load(
                input: { fallbackAssetId: string; url: string },
            ): Promise<{ imageRef: string }>;
        };
        network?: {
            request: (
                input: {
                    body?: WorkspaceCardJson;
                    method: "GET" | "POST";
                    url: string;
                },
            ) => Promise<{ body: WorkspaceCardJson; status: number }>;
        };
        operationId: string;
        storage?: {
            getStorage(
                input: { key: string },
            ): Promise<{ data: WorkspaceCardJson | undefined }>;
            setStorage(input: { data: WorkspaceCardJson; key: string }): Promise<void>;
        };
        trigger: {
            executionId: string;
            reason: | "invoke"
            | "generation"
            | "retry"
            | "cold"
            | "periodic"
            | "request"
            | "recovery";
        };
    }
    索引

    属性

    environment: { locale: string; platform: "windows" | "macos" }
    game: { appId: string }
    images?: {
        load(
            input: { fallbackAssetId: string; url: string },
        ): Promise<{ imageRef: string }>;
    }
    network?: {
        request: (
            input: {
                body?: WorkspaceCardJson;
                method: "GET" | "POST";
                url: string;
            },
        ) => Promise<{ body: WorkspaceCardJson; status: number }>;
    }
    operationId: string

    Extension 生成的执行身份;action handler 可将其提交为业务幂等键。

    storage?: {
        getStorage(
            input: { key: string },
        ): Promise<{ data: WorkspaceCardJson | undefined }>;
        setStorage(input: { data: WorkspaceCardJson; key: string }): Promise<void>;
    }

    设备共享存储;不能保存账号资料、凭据或账号派生内容。完成的写入不随 State 失败回滚。

    trigger: {
        executionId: string;
        reason:
            | "invoke"
            | "generation"
            | "retry"
            | "cold"
            | "periodic"
            | "request"
            | "recovery";
    }