fix: add schema for custom nodes i18n and simplify storeUserData type

- Add zCustomNodesI18n schema and CustomNodesI18n type to apiSchema.ts
- Update getCustomNodesI18n to use new CustomNodesI18n type
- Simplify storeUserData data parameter from BodyInit | Record<string, unknown> | null to unknown
This commit is contained in:
Johnpaul Chiwetelu
2026-01-17 22:34:57 +01:00
parent ed1dd91c06
commit 7712ada495
2 changed files with 6 additions and 2 deletions

View File

@@ -13,6 +13,9 @@ export type PromptId = z.infer<typeof zPromptId>
export const resultItemType = z.enum(['input', 'output', 'temp'])
export type ResultItemType = z.infer<typeof resultItemType>
const zCustomNodesI18n = z.record(z.string(), z.unknown())
export type CustomNodesI18n = z.infer<typeof zCustomNodesI18n>
const zResultItem = z.object({
filename: z.string().optional(),
subfolder: z.string().optional(),

View File

@@ -22,6 +22,7 @@ import type {
} from '@/platform/workflow/validation/schemas/workflowSchema'
import type {
AssetDownloadWsMessage,
CustomNodesI18n,
EmbeddingsResponse,
ExecutedWsMessage,
ExecutingWsMessage,
@@ -1074,7 +1075,7 @@ export class ComfyApi extends EventTarget {
*/
async storeUserData(
file: string,
data: BodyInit | Record<string, unknown> | null,
data: unknown,
options: RequestInit & {
overwrite?: boolean
stringify?: boolean
@@ -1251,7 +1252,7 @@ export class ComfyApi extends EventTarget {
*
* @returns The custom nodes i18n data
*/
async getCustomNodesI18n(): Promise<Record<string, unknown>> {
async getCustomNodesI18n(): Promise<CustomNodesI18n> {
return (await axios.get(this.apiURL('/i18n'))).data
}