Saltar al contenido
Lumean

Descripciones en inglés

La interfaz de la sección está traducida a su idioma, pero las descripciones de operaciones, esquemas y errores solo existen en ruso y en inglés: aquí se muestra la versión en inglés.

private-chunks.preview.{userId}

The result of a background chunk-preview split calculation. Arrives for large texts submitted to POST /orders/chunks/preview.

Parámetros del canal

Complete sus valores: aparecen en el nombre del canal, en el código de abajo y en la consola. No se envían a ninguna parte ni terminan en la URL de la página.

is the numeric id of the key owner, returned by GET /user.

Nombre del canal al que suscribirse

private-chunks.preview.{userId}

El nombre todavía contiene marcadores entre llaves. Así no puede suscribirse: el servidor autoriza los canales por nombre exacto.

import Pusher from 'pusher-js';

const pusher = new Pusher('7c4dd881d8116ac76fe89aff71d8c2ff', {
  wsHost: 'ws.lumean.app',
  wsPort: 443, wssPort: 443,
  forceTLS: true,
  enabledTransports: ['ws', 'wss'],
  cluster: '',
  channelAuthorization: {
    endpoint: 'https://api.lumean.app/api/public/broadcasting/auth',
    headers: { 'X-API-KEY': 'YOUR_API_KEY' },
  },
});

const channel = pusher.subscribe('private-chunks.preview.{userId}');
channel.bind('ready', (data) => {
  console.log(data);
});

Ejemplo de payload

sin conexión

Canal: private-chunks.preview.{userId}

Es un evento de ejemplo; no hay conexión. Para suscribirse necesita su clave API.

requiere una clave con el permiso orders.read

.ready

{
  "status": "ready",
  "preview_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
  "summary": {
    "chunks_count": 342,
    "total_effective_length": 680000,
    "total_price_units": 680000,
    "pause_count": 12,
    "total_pause_seconds": 30,
    "caps_ok": true,
    "caps_exceeded": null,
    "paragraphs_count": null,
    "paragraphs": [
      {
        "paragraph_index": 0,
        "chunks_count": 3,
        "first_chunk_index": 0,
        "text_length": 2400,
        "effective_length": 2380,
        "price_units": 2380
      }
    ]
  },
  "page": {
    "current_page": 1,
    "per_page": 100,
    "total": 342,
    "has_more": true
  }
}

Eventos del canal: 1

Cada evento tiene su propia ancla, una tabla completa del payload con descripciones y enums, y una forma de ejemplo. Los nombres se muestran en notación de Laravel Echo, con el punto inicial.

.ready

Echo: .ready · pusher-js: ready

The async preview is ready — a limited notification: totals for the whole text (summary) and the first page's meta (page). The chunks themselves are not part of this event — fetch them separately via GET /orders/chunks/preview/{previewId}?page=1.

Campos del payload

statusobligatorio
Valoresready
string
Ejemplo ready
preview_idobligatorio

A content-based preview id (sha256 of text+template+mode). Use it for pagination (GET .../{previewId}) and repeat preflight lookups.

string
Ejemplo a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
summaryobligatorio

Totals for the whole text — not just the current page of chunks.

object
chunks_countopcional
integer
Ejemplo 342
total_effective_lengthopcional

Total billable length across all chunks, in characters (pauses are excluded).

integer
Ejemplo 680000
total_price_unitsopcional
integer
Ejemplo 680000
pause_countopcional
integer
Ejemplo 12
total_pause_secondsopcional
number
Ejemplo 30
caps_okopcional
boolean
Ejemplo true
caps_exceededopcional

null means the caps are fine. Otherwise kind is the exceeded cap, max the limit and actual the observed value (counts for count/chunks, seconds for single/total).

object | null
kindobligatorio
Valorescountsingletotalchunks
string
maxobligatorio
number
actualobligatorio
number
paragraphs_countopcional

Number of paragraphs, or null outside paragraph mode.

integer | null
paragraphsopcional

A per-paragraph aggregate. null means either "the preview is not paragraph-mode" or "there are more paragraphs than the broadcast payload cap" — in the second case paragraphs_count stays a number, and you fetch the full list via GET /orders/chunks/preview/{previewId}.

array<object> | null
paragraph_indexopcional
integer
Ejemplo 0
chunks_countopcional
integer
Ejemplo 3
first_chunk_indexopcional

The cross-text index of the paragraph's first chunk — use it to locate the paragraph within the paginated chunk list.

integer
Ejemplo 0
text_lengthopcional
integer
Ejemplo 2400
effective_lengthopcional
integer
Ejemplo 2380
price_unitsopcional
integer
Ejemplo 2380
pageobligatorio

Meta for the first page of chunks. Fetch the chunks themselves with a separate paginated GET request keyed by preview_id.

object
current_pageopcional
integer
Ejemplo 1
per_pageopcional
integer
Ejemplo 100
totalopcional

Total chunks in the split (across all pages).

integer
Ejemplo 342
has_moreopcional
boolean
Ejemplo true

Ejemplo de payload

{
  "status": "ready",
  "preview_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
  "summary": {
    "chunks_count": 342,
    "total_effective_length": 680000,
    "total_price_units": 680000,
    "pause_count": 12,
    "total_pause_seconds": 30,
    "caps_ok": true,
    "caps_exceeded": null,
    "paragraphs_count": null,
    "paragraphs": [
      {
        "paragraph_index": 0,
        "chunks_count": 3,
        "first_chunk_index": 0,
        "text_length": 2400,
        "effective_length": 2380,
        "price_units": 2380
      }
    ]
  },
  "page": {
    "current_page": 1,
    "per_page": 100,
    "total": 342,
    "has_more": true
  }
}

Ejemplo de la forma del evento. Los valores son ilustrativos.

Todos los canales y parámetros de conexión·POST /broadcasting/auth

Esta página para IA

Abrir .mdllm.md

versión de la API 1.0.0