feat(ui): replace type-fest with utility-types

- The new package has more useful types
- Only used `JsonObject` from `type-fest`; added an implementation of that type
This commit is contained in:
psychedelicious
2024-02-22 17:19:08 +11:00
parent cc41e8912c
commit 0d9fbe5e04
7 changed files with 73 additions and 34 deletions

View File

@ -1,5 +1,5 @@
import type { JSONObject } from 'common/types';
import type { CoreMetadataInvocation, NonNullableGraph } from 'services/api/types';
import type { JsonObject } from 'type-fest';
import { METADATA } from './constants';
@ -30,7 +30,7 @@ export const addCoreMetadataNode = (
export const upsertMetadata = (
graph: NonNullableGraph,
metadata: Partial<CoreMetadataInvocation> | JsonObject
metadata: Partial<CoreMetadataInvocation> | JSONObject
): void => {
const metadataNode = graph.nodes[METADATA] as CoreMetadataInvocation | undefined;

View File

@ -1,3 +1,4 @@
import type { JSONObject } from 'common/types';
import { parseify } from 'common/util/serialize';
import type { InvocationTemplate } from 'features/nodes/types/invocation';
import type { WorkflowV3 } from 'features/nodes/types/workflow';
@ -5,14 +6,13 @@ import { isWorkflowInvocationNode } from 'features/nodes/types/workflow';
import { getNeedsUpdate } from 'features/nodes/util/node/nodeUpdate';
import { t } from 'i18next';
import { keyBy } from 'lodash-es';
import type { JsonObject } from 'type-fest';
import { parseAndMigrateWorkflow } from './migrations';
type WorkflowWarning = {
message: string;
issues?: string[];
data: JsonObject;
data: JSONObject;
};
type ValidateWorkflowResult = {