import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { NavigateToEntityPayload } from '../../_contract-src/action-payloads/navigate-to-entity/navigate-to-entity-payload'; import { postToHost } from './post-to-host'; /** * Navigates the Struct PIM host to the editor for a given entity. * The host resolves the URL from `entityType` + `entityId` — extensions * do not need to know the host's route structure. * * Supported entity types: `Product`, `Variant`, `VariantGroup`, `Category`, * `Asset`, `GlobalList`, `GlobalListValue`. * * @example * ```ts * struct.actions.navigateToEntity({ * entityType: 'Product', * entityId: '7d3f...e91', * }); * ``` */ export function navigateToEntity(params: NavigateToEntityPayload) { postToHost({ actionType: ActionType.NavigateToEntity, payload: params }); }