Function: createEntityLabel()

createEntityLabel(args: { entity: LixEntityCanonical | LixEntity; label: { id: string; }; lix: Pick<Lix, "db">; }): Promise<void>

Creates a mapping between an entity and a label.

This function allows any entity in the system to be labeled, enabling universal labeling across all entity types.

Examples

// Label a bundle entity
await createEntityLabel({
  lix,
  entity: {
    entity_id: "bundle123",
    schema_key: "inlang_bundle",
    file_id: "messages.json"
  },
  label: { id: "needs-translation-label-id" }
});
// Label a change set
await createEntityLabel({
  lix,
  entity: {
    entity_id: "cs123",
    schema_key: "lix_change_set",
    file_id: "lix"
  },
  label: { id: "reviewed-label-id" }
});

Parameters

ParameterType
args{ entity: LixEntityCanonical | LixEntity; label: { id: string; }; lix: Pick<Lix, "db">; }
args.entityLixEntityCanonical | LixEntity
args.label{ id: string; }
args.label.idstring
args.lixPick<Lix, "db">

Returns

Promise<void>