Prometheus Entity Management API
    Preparing search index...
    interface LiveLayer {
        append(type: string, id: string, field: string, chunk: string): void;
        commit(
            type: string,
            id: string,
            options?: { fields?: readonly string[] },
        ): void;
        commitAll(): void;
        discard(type: string, id: string, fields?: readonly string[]): void;
        get(
            type: string,
            id: string,
        ): Readonly<Record<string, unknown>> | undefined;
        read<T = Record<string, unknown>>(type: string, id: string): T | null;
        set(type: string, id: string, values: Record<string, unknown>): void;
        subscribe(type: string, id: string, listener: () => void): () => void;
    }
    Index
    • Append a chunk to a string field. Starts from the current live value, else the durable value when it is a string, else the empty string.

      Parameters

      • type: string
      • id: string
      • field: string
      • chunk: string

      Returns void

    • Write the entity's live fields (or only fields) to the graph in one write and clear them.

      Parameters

      • type: string
      • id: string
      • Optionaloptions: { fields?: readonly string[] }

      Returns void

    • Commit every entity's live fields in one graph publication.

      Returns void

    • Drop live fields (all, or only fields) without touching the graph.

      Parameters

      • type: string
      • id: string
      • Optionalfields: readonly string[]

      Returns void

    • The live fields of one entity, or undefined when none are held.

      Parameters

      • type: string
      • id: string

      Returns Readonly<Record<string, unknown>> | undefined

    • Durable entity (canonical + patches) overlaid with live fields; null when neither exists.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • type: string
      • id: string

      Returns T | null

    • Merge ephemeral field values for one entity.

      Parameters

      • type: string
      • id: string
      • values: Record<string, unknown>

      Returns void

    • Listen to live writes and durable graph changes for one entity. Returns an unsubscribe function.

      Parameters

      • type: string
      • id: string
      • listener: () => void

      Returns () => void