planvortex 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -368,15 +368,15 @@ if you would rather branch on `error.family`.
368
368
 
369
369
  | Codes | What went wrong | Class |
370
370
  | -------------------- | ------------------------------------------------------ | ------------------- |
371
- | 500-542 | Authentication, tokens, permissions, client apps | `AuthError` |
371
+ | 500-546 | Authentication, tokens, permissions, client apps | `AuthError` |
372
372
  | 601-612 | Users | `UserError` |
373
373
  | 700-715 | Social accounts — disconnected, revoked, no slot left | `AccountError` |
374
374
  | 800-810 | Files | `FileError` |
375
- | 900-960 | Publications, including every per-network limit | `PublicationError` |
375
+ | 900-979 | Publications, every per-network limit and the two rate brakes | `PublicationError` |
376
376
  | 1000-1003 | General | `PlanVortexError` |
377
377
  | 1100-1111 | Organizations | `OrganizationError` |
378
378
  | 1200-1207 | Roles | `PlanVortexError` |
379
- | 1300-1307, 1400-1408 | Plan quota exhausted, at client and organization level | `PlanLimitError` |
379
+ | 1300-1308, 1400-1408 | Plan quota exhausted, at client and organization level | `PlanLimitError` |
380
380
  | 1500-1512 | Messaging | `MessagingError` |
381
381
  | 1600-1601 | Contacts | `ContactError` |
382
382
  | 1900-1906 | Payments | `PlanVortexError` |
@@ -1,14 +1,21 @@
1
1
  // src/core/errors.ts
2
2
  var PLANVORTEX_ERROR_RANGES = [
3
- { from: 500, to: 544, family: "auth" },
3
+ //Hasta 546, no 544: la API publica se abrio a todos los planes y trajo dos codigos nuevos
4
+ //—545 (ritmo por plan, que sale 429) y 546 (correo sin verificar al crear una app)—.
5
+ { from: 500, to: 546, family: "auth" },
4
6
  { from: 601, to: 612, family: "user" },
5
7
  { from: 700, to: 715, family: "account" },
6
8
  { from: 800, to: 810, family: "file" },
7
- { from: 900, to: 960, family: "publication" },
9
+ //El techo sube con el catalogo del servidor, y subir tarde no da un error: da un consejo
10
+ //equivocado. Los codigos de Bluesky, Discord, Telegram y Threads (961-977) y los dos frenos
11
+ //de ritmo de la fase de publicaciones ilimitadas (978, 979) nacieron por encima de 960 y
12
+ //caian fuera de toda familia.
13
+ { from: 900, to: 979, family: "publication" },
8
14
  { from: 1e3, to: 1003, family: "general" },
9
15
  { from: 1100, to: 1111, family: "organization" },
10
16
  { from: 1200, to: 1207, family: "role" },
11
- { from: 1300, to: 1307, family: "plan_limit" },
17
+ //1308 es el tope de APPS del plan, que nacio al quitar el candado de precio de la API.
18
+ { from: 1300, to: 1308, family: "plan_limit" },
12
19
  { from: 1400, to: 1408, family: "plan_limit" },
13
20
  { from: 1500, to: 1512, family: "messaging" },
14
21
  { from: 1600, to: 1601, family: "contact" },
@@ -136,5 +143,5 @@ function isTokenError(error) {
136
143
  }
137
144
 
138
145
  export { AccountError, AiPlanError, AuthError, ContactError, FileError, IntegrationError, MessagingError, NO_ERROR_CODE, OrganizationError, PLANVORTEX_ERROR_RANGES, PlanLimitError, PlanVortexAuthenticationError, PlanVortexConfigError, PlanVortexConnectionError, PlanVortexError, ProductError, PublicationError, TOKEN_ERROR_CODES, UserError, createErrorFromResponse, errorFamilyForCode, isPlanVortexError, isTokenError };
139
- //# sourceMappingURL=chunk-GUYS6XTO.js.map
140
- //# sourceMappingURL=chunk-GUYS6XTO.js.map
146
+ //# sourceMappingURL=chunk-IIAKKH3S.js.map
147
+ //# sourceMappingURL=chunk-IIAKKH3S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/errors.ts"],"names":[],"mappings":";AAuBO,IAAM,uBAAA,GAA2D;AAAA;AAAA;AAAA,EAGpE,EAAE,IAAA,EAAM,GAAA,EAAK,EAAA,EAAI,GAAA,EAAK,QAAQ,MAAA,EAAO;AAAA,EACrC,EAAE,IAAA,EAAM,GAAA,EAAK,EAAA,EAAI,GAAA,EAAK,QAAQ,MAAA,EAAO;AAAA,EACrC,EAAE,IAAA,EAAM,GAAA,EAAK,EAAA,EAAI,GAAA,EAAK,QAAQ,SAAA,EAA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A,EACL;AAEA,EAAA,OAAO,IAAI,eAAA,CAAgB,aAAA,EAAe,CAAA,KAAA,EAAQ,KAAA,CAAM,MAAM,CAAA,CAAA,EAAI;AAAA,IAC9D,GAAG,OAAA;AAAA,IACH,MAAA,EAAQ,MAAA;AAAA,IACR,IAAA,EACI,OAAO,KAAA,CAAM,IAAA,KAAS,QAAA,IAAY,KAAA,CAAM,IAAA,KAAS,IAAA,GAC1C,KAAA,CAAM,IAAA,GACP,EAAE,IAAA,EAAM,MAAM,IAAA;AAAK,GAChC,CAAA;AACL;AAGO,SAAS,kBAAkB,KAAA,EAA0C;AACxE,EAAA,OAAO,KAAA,YAAiB,eAAA;AAC5B;AAOO,SAAS,aAAa,KAAA,EAAyB;AAClD,EAAA,OAAO,kBAAkB,KAAK,CAAA,IAAK,iBAAA,CAAkB,QAAA,CAAS,MAAM,IAAI,CAAA;AAC5E","file":"chunk-IIAKKH3S.js","sourcesContent":["/**\n * El catálogo de errores de PlanVortex, por rangos, y las clases que salen de él.\n *\n * LA REGLA, y no es negociable: **los errores se clasifican por `body.code`, nunca por el status\n * HTTP.** Todo error de dominio viaja con un 400 — un token caducado, una cuenta desconectada, el\n * cupo del plan agotado y un texto demasiado largo son los cuatro un 400. Sólo el 520 (permisos)\n * sale 401 y un fallo inesperado sale 500. Un `if (response.status === 401) refreshToken()` sería\n * un bug silencioso: los códigos de token, 501 y 522, viajan dentro de un 400.\n *\n * El catálogo del servidor crece cada mes, así que un código fuera de estos rangos NO es un error\n * del cliente: cae en la clase base con su `code` y su `message` intactos. Nunca se traga y nunca\n * se renombra.\n */\n\nexport type PlanVortexErrorRange = {\n /** Primer código del rango, incluido */\n from: number;\n /** Último código del rango, incluido */\n to: number;\n /** Qué familia de problemas es */\n family: string;\n};\n\nexport const PLANVORTEX_ERROR_RANGES: readonly PlanVortexErrorRange[] = [\n //Hasta 546, no 544: la API publica se abrio a todos los planes y trajo dos codigos nuevos\n //—545 (ritmo por plan, que sale 429) y 546 (correo sin verificar al crear una app)—.\n { from: 500, to: 546, family: \"auth\" },\n { from: 601, to: 612, family: \"user\" },\n { from: 700, to: 715, family: \"account\" },\n { from: 800, to: 810, family: \"file\" },\n //El techo sube con el catalogo del servidor, y subir tarde no da un error: da un consejo\n //equivocado. Los codigos de Bluesky, Discord, Telegram y Threads (961-977) y los dos frenos\n //de ritmo de la fase de publicaciones ilimitadas (978, 979) nacieron por encima de 960 y\n //caian fuera de toda familia.\n { from: 900, to: 979, family: \"publication\" },\n { from: 1000, to: 1003, family: \"general\" },\n { from: 1100, to: 1111, family: \"organization\" },\n { from: 1200, to: 1207, family: \"role\" },\n //1308 es el tope de APPS del plan, que nacio al quitar el candado de precio de la API.\n { from: 1300, to: 1308, family: \"plan_limit\" },\n { from: 1400, to: 1408, family: \"plan_limit\" },\n { from: 1500, to: 1512, family: \"messaging\" },\n { from: 1600, to: 1601, family: \"contact\" },\n { from: 1900, to: 1906, family: \"payment\" },\n { from: 2000, to: 2099, family: \"product\" },\n { from: 2100, to: 2199, family: \"ai_plan\" },\n { from: 2200, to: 2299, family: \"integration\" },\n] as const;\n\n/**\n * El `code` que lleva un error que **no** trae código del servidor: un fallo de red, un timeout, un\n * 502 de un proxy con cuerpo HTML, o el propio constructor quejándose de la configuración.\n *\n * El servidor no emite nunca el 0, así que sirve de centinela sin pisar el catálogo. Cuál de esos\n * casos es se distingue por `family`: `connection`, `http`, `oauth`, `config` o `webhook`.\n */\nexport const NO_ERROR_CODE = 0;\n\n/**\n * Los dos códigos que significan \"tu token ya no sirve\". Los dos llegan **dentro de un 400**, que es\n * justo por lo que existe esta constante: quien mire el status no los va a encontrar.\n *\n * El 520 (permisos) NO está aquí a propósito: sale 401, pero pedir un token nuevo no lo arregla — a\n * la app le faltan permisos, y con un token recién emitido le seguirán faltando.\n */\nexport const TOKEN_ERROR_CODES: readonly number[] = [501, 522];\n\n/** Opciones de construcción de un error. Todas opcionales: un error siempre se puede construir. */\nexport interface PlanVortexErrorOptions {\n /** El `data` del cuerpo — lo que el servidor adjuntó con `.withData({...})`. `{}` si no vino nada. */\n data?: Record<string, unknown>;\n /** Status HTTP. `undefined` cuando la petición no llegó a tener respuesta. */\n status?: number;\n /** `x-request-id` de la respuesta, si el despliegue lo pone delante. */\n requestId?: string;\n /** Segundos de la cabecera `Retry-After`, cuando la hay. */\n retryAfter?: number;\n /** El error original (un `TypeError` de `fetch`, por ejemplo). */\n cause?: unknown;\n /**\n * Familia, sólo para los errores que NO salen del catálogo: `connection`, `http`, `oauth`,\n * `config` y `webhook`. Los de dominio la deducen de su `code` y no la pasan nunca.\n */\n family?: string;\n}\n\n/**\n * La base de todo lo que lanza esta librería.\n *\n * Un `catch (e) { if (e instanceof PlanVortexError) }` los coge todos: los de dominio, los de red y\n * los de configuración. Para afinar están las subclases y el `code`.\n */\nexport class PlanVortexError extends Error {\n /** El `code` del cuerpo, tal cual. {@link NO_ERROR_CODE} si el error no viene del catálogo. */\n readonly code: number;\n /** La familia del rango: `auth`, `publication`, `plan_limit`... Ver {@link PLANVORTEX_ERROR_RANGES}. */\n readonly family: string;\n /** El `data` del cuerpo. */\n readonly data: Record<string, unknown>;\n /** Status HTTP, o `undefined` si nunca hubo respuesta. */\n readonly status: number | undefined;\n /** `x-request-id`, si el despliegue lo pone. Hoy el servidor no lo emite; un proxy delante sí. */\n readonly requestId: string | undefined;\n /** Segundos que pidió esperar la cabecera `Retry-After`, si llegó. */\n readonly retryAfter: number | undefined;\n\n constructor(code: number, message: string, options: PlanVortexErrorOptions = {}) {\n super(message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = new.target.name;\n this.code = code;\n this.family = options.family ?? errorFamilyForCode(code) ?? \"unknown\";\n this.data = options.data ?? {};\n this.status = options.status;\n this.requestId = options.requestId;\n this.retryAfter = options.retryAfter;\n }\n}\n\n/** 500-546 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */\nexport class AuthError extends PlanVortexError {}\n/** 601-612 — el usuario final. */\nexport class UserError extends PlanVortexError {}\n/** 700-715 — cuentas sociales: desconectada, sin permisos en la red, sin refrescar. */\nexport class AccountError extends PlanVortexError {}\n/** 800-810 — ficheros: formato no admitido, demasiado grande, conversión fallida. */\nexport class FileError extends PlanVortexError {}\n/** 900-979 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración) y los\n * dos frenos de ritmo: 978 (demasiado rápido en esta cuenta) y 979 (tope diario de esa red). */\nexport class PublicationError extends PlanVortexError {}\n/** 1100-1111 — organizaciones, y el token temporal atado a una sola de ellas (1101). */\nexport class OrganizationError extends PlanVortexError {}\n/**\n * 1300-1308 y 1400-1408 — el cupo del plan, del cliente o de la organización.\n *\n * Es el error que un integrador **sí** quiere distinguir: no se arregla reintentando, se arregla\n * cambiando de plan. Por eso los dos rangos comparten clase.\n */\nexport class PlanLimitError extends PlanVortexError {}\n/** 1500-1512 — conversaciones, mensajes y plantillas. Exige plan de pago. */\nexport class MessagingError extends PlanVortexError {}\n/** 1600-1601 — contactos. */\nexport class ContactError extends PlanVortexError {}\n/** 2000-2099 — catálogos y productos (sólo Facebook e Instagram). */\nexport class ProductError extends PlanVortexError {}\n/** 2100-2199 — planes de publicaciones generados con IA. */\nexport class AiPlanError extends PlanVortexError {}\n/** 2200-2299 — integraciones: Google Drive, RSS. */\nexport class IntegrationError extends PlanVortexError {}\n\n/**\n * La petición no llegó a tener respuesta: DNS, conexión rechazada, socket cortado o timeout.\n *\n * No lleva código del catálogo porque el servidor nunca llegó a opinar.\n */\nexport class PlanVortexConnectionError extends PlanVortexError {\n /** `true` si lo que se agotó fue nuestro propio timeout, no la red. */\n readonly timeout: boolean;\n\n constructor(message: string, options: PlanVortexErrorOptions & { timeout?: boolean } = {}) {\n super(NO_ERROR_CODE, message, { ...options, family: \"connection\" });\n this.timeout = options.timeout ?? false;\n }\n}\n\n/**\n * `POST /oauth/token` rechazó las credenciales.\n *\n * Es el ÚNICO sitio del API con forma de error distinta: `{error, error_description}` de OAuth2, no\n * el `{code, message, data}` de todo lo demás. Y por eso el `code` es {@link NO_ERROR_CODE}: el\n * servidor tiene códigos para esto (538-541) pero **no los manda en el cuerpo**, así que ponerlos\n * aquí sería inventarse algo que nadie dijo. Lo que sí viaja es `oauthError`.\n */\nexport class PlanVortexAuthenticationError extends PlanVortexError {\n /** `invalid_client`, `invalid_request`, `unsupported_grant_type`, `slow_down` o `server_error`. */\n readonly oauthError: string;\n\n constructor(oauthError: string, description: string, options: PlanVortexErrorOptions = {}) {\n super(NO_ERROR_CODE, description, { ...options, family: \"oauth\" });\n this.oauthError = oauthError;\n }\n}\n\n/**\n * La librería está mal configurada y no ha llegado a salir de casa: sin credenciales, o instanciada\n * en un navegador (§ trampa 9 del roadmap).\n */\nexport class PlanVortexConfigError extends PlanVortexError {\n constructor(message: string) {\n super(NO_ERROR_CODE, message, { family: \"config\" });\n }\n}\n\n/** La familia a la que pertenece un código, o `undefined` si cae fuera del catálogo conocido. */\nexport function errorFamilyForCode(code: number): string | undefined {\n return PLANVORTEX_ERROR_RANGES.find((range) => code >= range.from && code <= range.to)?.family;\n}\n\n/**\n * Familia -> clase. Las que faltan —`general`, `role`, `payment` y cualquier rango nuevo— caen a\n * propósito en la clase base: existen en el servidor pero no son superficie de integración, y darles\n * clase propia sería prometer un `instanceof` que luego habría que mantener.\n */\nconst FAMILY_CLASSES: Record<string, typeof PlanVortexError> = {\n auth: AuthError,\n user: UserError,\n account: AccountError,\n file: FileError,\n publication: PublicationError,\n organization: OrganizationError,\n plan_limit: PlanLimitError,\n messaging: MessagingError,\n contact: ContactError,\n product: ProductError,\n ai_plan: AiPlanError,\n integration: IntegrationError,\n};\n\n/** El cuerpo de error del API: `{code, message, data}`. */\nexport interface ApiErrorBody {\n code: number;\n message?: string;\n data?: Record<string, unknown>;\n}\n\nfunction isApiErrorBody(body: unknown): body is ApiErrorBody {\n return typeof body === \"object\" && body !== null && typeof (body as ApiErrorBody).code === \"number\";\n}\n\n/**\n * Convierte una respuesta de error en la clase que le toca.\n *\n * Un cuerpo sin `code` —un 502 de un proxy, la página HTML de un balanceador— no es un error de\n * dominio: sale como clase base con `family: \"http\"` y el cuerpo entero en `data`, que es además lo\n * que necesita `auth.ts` para reconocer el `{error, error_description}` de OAuth2.\n */\nexport function createErrorFromResponse(input: {\n body: unknown;\n status: number;\n requestId?: string | undefined;\n retryAfter?: number | undefined;\n}): PlanVortexError {\n const options: PlanVortexErrorOptions = {\n status: input.status,\n ...(input.requestId === undefined ? {} : { requestId: input.requestId }),\n ...(input.retryAfter === undefined ? {} : { retryAfter: input.retryAfter }),\n };\n\n if (isApiErrorBody(input.body)) {\n const family = errorFamilyForCode(input.body.code);\n const ErrorClass = (family === undefined ? undefined : FAMILY_CLASSES[family]) ?? PlanVortexError;\n return new ErrorClass(input.body.code, input.body.message ?? \"PlanVortex error\", {\n ...options,\n data: input.body.data ?? {},\n });\n }\n\n return new PlanVortexError(NO_ERROR_CODE, `HTTP ${input.status}`, {\n ...options,\n family: \"http\",\n data:\n typeof input.body === \"object\" && input.body !== null\n ? (input.body as Record<string, unknown>)\n : { body: input.body },\n });\n}\n\n/** ¿Es un error de esta librería? Útil en un `catch` donde no apetece importar la clase. */\nexport function isPlanVortexError(error: unknown): error is PlanVortexError {\n return error instanceof PlanVortexError;\n}\n\n/**\n * ¿Dice este error que el token ya no sirve? (los códigos 501 y 522, los dos dentro de un 400).\n *\n * Es lo que dispara el único reintento con token nuevo del cliente.\n */\nexport function isTokenError(error: unknown): boolean {\n return isPlanVortexError(error) && TOKEN_ERROR_CODES.includes(error.code);\n}\n"]}
@@ -1231,7 +1231,7 @@ interface paths {
1231
1231
  * The inbox: first-level comments across the whole organization
1232
1232
  * @description Served from PlanVortex's database, so it costs nothing and calls no social network. It is a **snapshot**: `collected_date` says when each row was last read. Open a thread to see what the network says right now.
1233
1233
  *
1234
- * Ordered by `creation_date` descending — the date on the network, not the date we collected it — so rows from nine networks interleave correctly.
1234
+ * Ordered by `creation_date` descending — the date on the network, not the date we collected it — so rows from ten networks interleave correctly.
1235
1235
  *
1236
1236
  * **On `telegram` the inbox starts the day the channel was connected.** The Bot API has no way to read the past: a bot only learns what happens while it is inside, so nothing written before the connection exists here and never will. Say so in your UI — an inbox that opens empty on a busy channel reads like a failure.
1237
1237
  *
@@ -1358,7 +1358,7 @@ interface paths {
1358
1358
  *
1359
1359
  * **An app cannot call this.** Connecting a social account is an OAuth flow with a person in front of it, so this endpoint only accepts a user token or a temporal connect token; with app credentials it answers error 519. The way an integration does it is to issue a temporal connect token with `GET /organizations/{id_organization}/temporal_connect_token` and hand it to its end user.
1360
1360
  *
1361
- * **Read `authorization`, not `link`.** Nine of the eleven networks are `redirect` and you send the person to `link`. Two are not, and neither of them fails visibly if you treat it as one:
1361
+ * **Read `authorization`, not `link`.** Ten of the twelve networks are `redirect` and you send the person to `link`. Two are not, and neither of them fails visibly if you treat it as one:
1362
1362
  *
1363
1363
  * • **WhatsApp is not a URL at all.** Its sign-up is Meta's Embedded Signup, a popup you raise with the Facebook JavaScript SDK, so its `link` is an empty string and everything you need to open that popup travels in `authorization`. A client that loops over the list and redirects to `link` sends its user to its own page.
1364
1364
  * • **Telegram has a link and still is not a redirect.** It opens a chat with the PlanVortex bot, and nobody comes back from it: the account is born minutes later, from the bot being added to a channel, and it is announced over the WebSocket. Open it in another tab and keep listening; redirect to it and there is nobody left to tell.
@@ -2348,7 +2348,7 @@ interface paths {
2348
2348
  *
2349
2349
  * `comments` is the coarse gate — whether the network has comments at all. Which *actions* it allows on one is a finer question and lives in `GET /social_comment_actions`, because the shape here is `{[capability]: boolean}` and nesting an object inside would break it.
2350
2350
  *
2351
- * Today nine networks answer `comments: true`: Facebook, Instagram, LinkedIn, X, YouTube, Google Business, Bluesky, Discord and Telegram. TikTok and WhatsApp answer `false`, for reasons of theirs and not ours.
2351
+ * Today ten networks answer `comments: true`: Facebook, Instagram, Threads, LinkedIn, X, YouTube, Google Business, Bluesky, Discord and Telegram. TikTok and WhatsApp answer `false`, for reasons of theirs and not ours.
2352
2352
  *
2353
2353
  * A `true` here is about the **network**, not about one account of it: a Telegram channel with no linked discussion group answers 965 on its comments even though the network has them.
2354
2354
  *
@@ -2387,6 +2387,7 @@ interface paths {
2387
2387
  * | `bluesky` | yes | yes — through the post's `threadgate` | yes | **no** — the reply lives in somebody else's repository |
2388
2388
  * | `discord` | yes | **no** — Discord has no hide, only delete | yes | yes |
2389
2389
  * | `telegram` | yes | **no** — Telegram has no hide either | yes | yes — with the bot as an admin of the discussion group, otherwise error 969 |
2390
+ * | `threads` | yes | yes | yes | **no** — deleting somebody else's reply is not a permission you lack, it is a call that does not exist in the API |
2390
2391
  * | `tiktok`, `whatsapp` | no | no | no | no |
2391
2392
  *
2392
2393
  * Only needs authentication.
@@ -2580,7 +2581,7 @@ interface components {
2580
2581
  /**
2581
2582
  * @description **How** an account of this network is authorized, which is not always "send the user to this URL".
2582
2583
  *
2583
- * Nine of the eleven networks are `redirect`: open `link` and the network sends the person back to PlanVortex with a code. Two are not:
2584
+ * Ten of the twelve networks are `redirect`: open `link` and the network sends the person back to PlanVortex with a code. Two are not:
2584
2585
  *
2585
2586
  * • **WhatsApp.** Its sign-up is Meta's *Embedded Signup*: a popup raised by the Facebook JavaScript SDK from your own page, which returns — over `postMessage` — session data (`waba_id`, `phone_number_id`) that no query string carries. Its `link` is therefore an empty string.
2586
2587
  * • **Telegram.** There is no OAuth here: no consent screen, no `code`, no account token. `link` opens a private chat with the PlanVortex bot, the person then adds that bot to their channel, and **the account is created from that event**, not from any request of yours. Which means the connection cannot be finished by calling `GET /organizations/{id_organization}/account-connect/telegram` — see that endpoint.
@@ -3040,7 +3041,7 @@ interface components {
3040
3041
  };
3041
3042
  CatalogSocialLimits: {
3042
3043
  /**
3043
- * @description Maximum length of a publication's text. Bluesky counts graphemes, everyone else counts characters — Telegram included, where `String.length` is exactly the right unit.
3044
+ * @description Maximum length of a publication's text. **Bluesky and Threads count GRAPHEMES**, everyone else counts characters — Telegram included, where `String.length` is exactly the right unit. The difference is not academic: an emoji is one grapheme and two `String.length` units, so counting a Threads post with `.length` rejects at 250 emojis what the network publishes happily at 500.
3044
3045
  *
3045
3046
  * On Telegram there are **two numbers for the same field**: `telegram` (4.096) while the publication is text only, and `telegram_media` (1.024) the moment it carries an image or a video, because then the text is a media caption and not a message. Switch the counter when the file is attached, not when publish is pressed.
3046
3047
  */
@@ -3097,7 +3098,7 @@ interface components {
3097
3098
  actual_asigned?: components["schemas"]["PlanData"];
3098
3099
  actual_plan: components["schemas"]["ClientsPlan"];
3099
3100
  /** @description Current consumption across every organization of the client. **Only present with `getUse=true`.** `twitter_credits` and `ai_credits` are what has been spent this calendar month. */
3100
- actual_use?: components["schemas"]["PlanData"];
3101
+ actual_use?: components["schemas"]["PlanUseData"];
3101
3102
  /** @description Read-only view of the client's own AI provider configuration (BYOK). Written via `PUT /clients/{id_client}/ai-settings`. API keys are stored encrypted and are NEVER returned: each scope only exposes provider, model and has_api_key. */
3102
3103
  ai_settings?: components["schemas"]["ClientsAiSettings"];
3103
3104
  /** @enum {string} */
@@ -3284,7 +3285,7 @@ interface components {
3284
3285
  * @description A network that has comments. Treat it as an open list: a new one is added before your integration hears about it.
3285
3286
  * @enum {string}
3286
3287
  */
3287
- CommentsCommentNetworkName: "facebook" | "instagram" | "twitter" | "linkedin" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram";
3288
+ CommentsCommentNetworkName: "facebook" | "instagram" | "twitter" | "linkedin" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram" | "threads";
3288
3289
  /** @description A live read: asked of the network and reconciled with what was stored. */
3289
3290
  CommentsCommentThread: {
3290
3291
  comments: components["schemas"]["CommentsComment"][];
@@ -3575,7 +3576,7 @@ interface components {
3575
3576
  /** @description What has been handed down to child organizations out of this organization's plan. */
3576
3577
  actual_asigned: components["schemas"]["PlanData"];
3577
3578
  /** @description What the organization and its children are consuming right now. */
3578
- actual_use: components["schemas"]["PlanData"];
3579
+ actual_use: components["schemas"]["PlanUseData"];
3579
3580
  /** @description The plan in force. An organization with no plan of its own inherits the closest parent that has one. */
3580
3581
  limits: components["schemas"]["PlanData"];
3581
3582
  };
@@ -3644,7 +3645,7 @@ interface components {
3644
3645
  * The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
3645
3646
  */
3646
3647
  Error: {
3647
- /** @description PlanVortex error code. Ranges: 500-544 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-960 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1307 client plan · 1400-1408 organization plan · 1500-1512 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations. */
3648
+ /** @description PlanVortex error code. Ranges: 500-546 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-979 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1308 client plan · 1400-1408 organization plan · 1500-1512 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations. */
3648
3649
  code: number;
3649
3650
  /** @description Extra context attached to the error, when there is any. */
3650
3651
  data?: {
@@ -3908,7 +3909,7 @@ interface components {
3908
3909
  /** @description The slice of the client's plan assigned to this organization. **Absent when nothing was assigned**, and then the organization shares whatever its nearest parent with a plan has — or, failing that, the client's unassigned remainder. Ask `GET /organizations/{id_organization}/limits` for the effective numbers instead of reading this. */
3909
3910
  actual_plan?: components["schemas"]["PlanData"];
3910
3911
  /** @description Current consumption. **Only present with `getUse=true`.** `twitter_credits` and `ai_credits` are what has been spent in the current calendar month; the rest is what exists right now. */
3911
- actual_use?: components["schemas"]["PlanData"];
3912
+ actual_use?: components["schemas"]["PlanUseData"];
3912
3913
  ai_context?: components["schemas"]["AiContext"];
3913
3914
  /** Format: date-time */
3914
3915
  creation_date: string;
@@ -4035,12 +4036,12 @@ interface components {
4035
4036
  accounts: number;
4036
4037
  /** @description Monthly AI credits (1 credit = $0.001 of provider cost): 15 per plan orchestration pass, 2 per generated text, 70 per generated image. Resets monthly and does not roll over. A client using its own provider key (BYOK) does not consume them in that scope. */
4037
4038
  ai_credits?: number;
4039
+ /** @description Apps this plan allows: 1 on Free, 2 on Basic, 5 on Pro, 10 on Custom. Each one is a `client_id` with a secret, so each one is a key to the whole public API — which every plan has, Free included. Unlike accounts, users or storage this is NOT split between organizations: an app belongs to the client. On a use payload it is how many exist right now. */
4040
+ apps?: number;
4038
4041
  /** @description Whether AI generation is enabled. */
4039
4042
  artificial_inteligence?: boolean;
4040
- /** @description Connections to a third-party tool material is pulled from (Google Drive, an RSS feed). Not the same thing as an app: an app is API access, and it is a Custom-plan feature of its own. */
4043
+ /** @description Connections to a third-party tool material is pulled from (Google Drive, an RSS feed). Not the same thing as an app: an app is API access, and it has its own allowance in `apps`. */
4041
4044
  integrations: number;
4042
- /** @description Publications that may be sent per month. */
4043
- publications: number;
4044
4045
  /** @description Storage, in GB. */
4045
4046
  space: number;
4046
4047
  /** @description Whether statistics collection is enabled. */
@@ -4052,6 +4053,11 @@ interface components {
4052
4053
  /** @description Whether WhatsApp may be connected. */
4053
4054
  whatsapp?: boolean;
4054
4055
  };
4056
+ /** @description What is being consumed right now. Same shape as PlanData plus `publications`, which is counted but neither charged nor split between organizations. */
4057
+ PlanUseData: {
4058
+ /** @description Publications created in the current calendar month. A METRIC, not a quota: publications are unlimited on every plan, so there is no limit to compare it against. What throttles publishing is rate, not plan — see the per-hour and per-network daily caps. */
4059
+ publications?: number;
4060
+ } & components["schemas"]["PlanData"];
4055
4061
  /** @description A product as the network returns it. `id` is always present here. */
4056
4062
  ProductsProduct: components["schemas"]["ProductsProductInput"];
4057
4063
  /** @description A Meta commerce catalogue, as the network returns it. */
@@ -4187,7 +4193,7 @@ interface components {
4187
4193
  * Not every connectable network publishes — a local business listing receives reviews, not posts — so this list is shorter than the one in `GET /social_networks`. Ask `GET /allowed_social_publications` rather than hardcoding it, because it grows.
4188
4194
  * @enum {string}
4189
4195
  */
4190
- social_network?: "facebook" | "instagram" | "twitter" | "linkedin" | "tiktok" | "whatsapp" | "youtube" | "bluesky" | "discord" | "telegram";
4196
+ social_network?: "facebook" | "instagram" | "twitter" | "linkedin" | "tiktok" | "whatsapp" | "youtube" | "bluesky" | "discord" | "telegram" | "threads";
4191
4197
  /**
4192
4198
  * @description Send `draft` to store the publication without publishing it. If omitted, the state is resolved automatically: `ready` when everything validates, `withErrors` otherwise. Forcing `sended` marks it as published without actually sending it.
4193
4199
  * @enum {string}
@@ -4299,6 +4305,8 @@ interface components {
4299
4305
  *
4300
4306
  * On `bluesky` there are no impressions and no reach either — only the public counters — so engagement is computed over followers.
4301
4307
  *
4308
+ * On `threads` there are six, and the one that matters is `views`: it is the only one of the four newest networks with something like impressions, so its engagement rate is computed over a real base and not over followers. Sharing arrives split in three — `reposts`, `quotes` and `shares` (outside Threads) — and the three are added into one figure, the same criterion as on X; the breakdown stays in `raw`. A reply is what every other network calls a comment.
4309
+ *
4302
4310
  * On `telegram` there are two as well, and **neither of them is asked for**: the Bot API has no method that returns a message's metrics, so `reactions` arrives on its own through the bot and `comments` is counted in PlanVortex's own inbox. There are no impressions, no reach, no views and no forwards to be had anywhere in it, so engagement is computed over followers.
4303
4311
  */
4304
4312
  PublicationStats: {
@@ -4384,7 +4392,7 @@ interface components {
4384
4392
  * **This list grows.** Treat it as an open enumeration: a client that rejects an unknown value breaks the day a network is added, which happens several times a year. Not every network does everything — ask `GET /social_capabilities`.
4385
4393
  * @enum {string}
4386
4394
  */
4387
- SocialNetwork: "facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "whatsapp" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram";
4395
+ SocialNetwork: "facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "whatsapp" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram" | "threads";
4388
4396
  /** @description Statistics collection settings. Only `auto_refresh_twitter` is read; any other key is ignored. */
4389
4397
  StatsSettings: {
4390
4398
  /**
@@ -10887,7 +10895,8 @@ interface operations {
10887
10895
  * "google_business",
10888
10896
  * "bluesky",
10889
10897
  * "discord",
10890
- * "telegram"
10898
+ * "telegram",
10899
+ * "threads"
10891
10900
  * ]
10892
10901
  */
10893
10902
  "application/json": components["schemas"]["SocialNetwork"][];
@@ -11141,6 +11150,18 @@ type PlannerTemplateFieldType = OpenEnum<NonNullable<PlannerTemplateField["type"
11141
11150
  * cliente tiene contratado — pedir mas devuelve un 1400-1408.
11142
11151
  */
11143
11152
  type PlanData = Schemas["PlanData"];
11153
+ /**
11154
+ * Lo que se esta CONSUMIENDO ahora mismo: un {@link PlanData} mas `publications`.
11155
+ *
11156
+ * `publications` es una METRICA, no un cupo —las publicaciones son ilimitadas en todos los
11157
+ * planes—, asi que no hay ningun limite contra el que compararla: no la pintes como una barra.
11158
+ * Lo que frena al que publica de mas es el RITMO (tope por hora y cuenta, y tope diario por red,
11159
+ * los dos en `GET /social_limits`), no el plan.
11160
+ *
11161
+ * No confundir con {@link PlanUse}, que es el bloque entero del panel: consumo, repartido y
11162
+ * limites juntos.
11163
+ */
11164
+ type PlanUseData = Schemas["PlanUseData"];
11144
11165
  /**
11145
11166
  * La SUSCRIPCION de un cliente, que no es lo mismo que los recursos que da: los numeros estan en
11146
11167
  * `plan_data`. Leer `plan_identifier` para saber los limites es el error clasico — un plan
@@ -11835,7 +11856,7 @@ declare class PlanVortexError extends Error {
11835
11856
  readonly retryAfter: number | undefined;
11836
11857
  constructor(code: number, message: string, options?: PlanVortexErrorOptions);
11837
11858
  }
11838
- /** 500-544 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11859
+ /** 500-546 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11839
11860
  declare class AuthError extends PlanVortexError {
11840
11861
  }
11841
11862
  /** 601-612 — el usuario final. */
@@ -11847,14 +11868,15 @@ declare class AccountError extends PlanVortexError {
11847
11868
  /** 800-810 — ficheros: formato no admitido, demasiado grande, conversión fallida. */
11848
11869
  declare class FileError extends PlanVortexError {
11849
11870
  }
11850
- /** 900-960 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración). */
11871
+ /** 900-979 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración) y los
11872
+ * dos frenos de ritmo: 978 (demasiado rápido en esta cuenta) y 979 (tope diario de esa red). */
11851
11873
  declare class PublicationError extends PlanVortexError {
11852
11874
  }
11853
11875
  /** 1100-1111 — organizaciones, y el token temporal atado a una sola de ellas (1101). */
11854
11876
  declare class OrganizationError extends PlanVortexError {
11855
11877
  }
11856
11878
  /**
11857
- * 1300-1307 y 1400-1408 — el cupo del plan, del cliente o de la organización.
11879
+ * 1300-1308 y 1400-1408 — el cupo del plan, del cliente o de la organización.
11858
11880
  *
11859
11881
  * Es el error que un integrador **sí** quiere distinguir: no se arregla reintentando, se arregla
11860
11882
  * cambiando de plan. Por eso los dos rangos comparten clase.
@@ -12177,4 +12199,4 @@ interface PlanVortexWebhooksOptions {
12177
12199
  */
12178
12200
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
12179
12201
 
12180
- export { type SocialCredentialsInput as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type ConnectToken as Z, type AiContext as _, type ConnectResult as a, type PlannerTemplateFieldType as a$, type Product as a0, type ProductInput as a1, type ProductCatalog as a2, type ProductCatalogInput as a3, type PublicationInput as a4, type PublicationState as a5, type PublicationStats as a6, type PublicationStatsHistory as a7, type Upload as a8, AccountError as a9, FileError as aA, type FileFormat as aB, type FileProperties as aC, type FileType as aD, IntegrationError as aE, type IntegrationErrorChange as aF, type MessageChange as aG, type MessageOptions as aH, type MessageType as aI, MessagingError as aJ, type MetricRow as aK, NO_ERROR_CODE as aL, type components as aM, type operations as aN, type paths as aO, type webhooks as aP, type OpenEnum as aQ, OrganizationError as aR, PLANVORTEX_ERROR_RANGES as aS, PlanLimitError as aT, PlanVortexAuthenticationError as aU, PlanVortexConfigError as aV, PlanVortexConnectionError as aW, PlanVortexError as aX, type PlanVortexErrorOptions as aY, type PlanVortexErrorRange as aZ, type PlannerTemplateField as a_, type AccountMetricRow as aa, type AccountStateChange as ab, type AccountWebhookChangeBase as ac, type AccountWithError as ad, type AiPlanCostEstimate as ae, AiPlanError as af, type AiPlanNotice as ag, type AiPlanOptions as ah, type AiPlanOptionsInput as ai, type AiPlanSource as aj, type AiPlanSourceImageInput as ak, type AiPlanSourceInput as al, type AiPlanSourceProduct as am, type AiPlanState as an, type ApiErrorBody as ao, type AspectRatios as ap, AuthError as aq, type ClientPlan as ar, type CommentAuthor as as, type CommentChange as at, type ContactChannel as au, ContactError as av, type DashboardAiPlanRef as aw, type DashboardPublicationRef as ax, type DashboardRange as ay, type EngagementBase as az, type AccountMetrics as b, type PlannerTemplateName as b0, ProductError as b1, PublicationError as b2, type PublicationErrorDetail as b3, type PublicationMetrics as b4, type PublicationStatsPoint as b5, type PublicationType as b6, type PublicationsSummary as b7, type RssConfig as b8, type SocialAuthorizationMethod as b9, type PlanVortexWebhooksOptions as bA, type RawWebhookBody as bB, type VerifyWebhookSignatureOptions as bC, WEBHOOK_EVENTS as bD, WEBHOOK_SIGNATURE_HEADERS as bE, WebhookBodyError as bF, type WebhookHeaders as bG, type WebhookRequestLike as bH, type WebhookResponseLike as bI, WebhookSignatureError as bJ, handleWebhookRequest as bK, isAccountStateChange as bL, isCommentChange as bM, isIntegrationErrorChange as bN, isMessageChange as bO, parseWebhookPayload as bP, planvortexWebhooks as bQ, verifyWebhookSignature as bR, type SocialCredentials as ba, type SocialIdentifier as bb, type SocialIdentifierInput as bc, type SocialLimitsMap as bd, TOKEN_ERROR_CODES as be, type TopPublication as bf, type UnknownWebhookChange as bg, UserError as bh, type WebhookAlgorithm as bi, type WebhookChange as bj, type WebhookEvent as bk, type WithAccount as bl, type WithPublication as bm, account as bn, accountId as bo, errorFamilyForCode as bp, isPlanVortexError as bq, isTokenError as br, messageContact as bs, messageContactId as bt, messageDirection as bu, messageFileIds as bv, messageFiles as bw, publication as bx, publicationId as by, type HandleWebhookRequestOptions as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };
12202
+ export { type AiContext as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type PlanUseData as Z, type ConnectToken as _, type ConnectResult as a, type PlannerTemplateField as a$, type SocialCredentialsInput as a0, type Product as a1, type ProductInput as a2, type ProductCatalog as a3, type ProductCatalogInput as a4, type PublicationInput as a5, type PublicationState as a6, type PublicationStats as a7, type PublicationStatsHistory as a8, type Upload as a9, type EngagementBase as aA, FileError as aB, type FileFormat as aC, type FileProperties as aD, type FileType as aE, IntegrationError as aF, type IntegrationErrorChange as aG, type MessageChange as aH, type MessageOptions as aI, type MessageType as aJ, MessagingError as aK, type MetricRow as aL, NO_ERROR_CODE as aM, type components as aN, type operations as aO, type paths as aP, type webhooks as aQ, type OpenEnum as aR, OrganizationError as aS, PLANVORTEX_ERROR_RANGES as aT, PlanLimitError as aU, PlanVortexAuthenticationError as aV, PlanVortexConfigError as aW, PlanVortexConnectionError as aX, PlanVortexError as aY, type PlanVortexErrorOptions as aZ, type PlanVortexErrorRange as a_, AccountError as aa, type AccountMetricRow as ab, type AccountStateChange as ac, type AccountWebhookChangeBase as ad, type AccountWithError as ae, type AiPlanCostEstimate as af, AiPlanError as ag, type AiPlanNotice as ah, type AiPlanOptions as ai, type AiPlanOptionsInput as aj, type AiPlanSource as ak, type AiPlanSourceImageInput as al, type AiPlanSourceInput as am, type AiPlanSourceProduct as an, type AiPlanState as ao, type ApiErrorBody as ap, type AspectRatios as aq, AuthError as ar, type ClientPlan as as, type CommentAuthor as at, type CommentChange as au, type ContactChannel as av, ContactError as aw, type DashboardAiPlanRef as ax, type DashboardPublicationRef as ay, type DashboardRange as az, type AccountMetrics as b, type PlannerTemplateFieldType as b0, type PlannerTemplateName as b1, ProductError as b2, PublicationError as b3, type PublicationErrorDetail as b4, type PublicationMetrics as b5, type PublicationStatsPoint as b6, type PublicationType as b7, type PublicationsSummary as b8, type RssConfig as b9, type HandleWebhookRequestOptions as bA, type PlanVortexWebhooksOptions as bB, type RawWebhookBody as bC, type VerifyWebhookSignatureOptions as bD, WEBHOOK_EVENTS as bE, WEBHOOK_SIGNATURE_HEADERS as bF, WebhookBodyError as bG, type WebhookHeaders as bH, type WebhookRequestLike as bI, type WebhookResponseLike as bJ, WebhookSignatureError as bK, handleWebhookRequest as bL, isAccountStateChange as bM, isCommentChange as bN, isIntegrationErrorChange as bO, isMessageChange as bP, parseWebhookPayload as bQ, planvortexWebhooks as bR, verifyWebhookSignature as bS, type SocialAuthorizationMethod as ba, type SocialCredentials as bb, type SocialIdentifier as bc, type SocialIdentifierInput as bd, type SocialLimitsMap as be, TOKEN_ERROR_CODES as bf, type TopPublication as bg, type UnknownWebhookChange as bh, UserError as bi, type WebhookAlgorithm as bj, type WebhookChange as bk, type WebhookEvent as bl, type WithAccount as bm, type WithPublication as bn, account as bo, accountId as bp, errorFamilyForCode as bq, isPlanVortexError as br, isTokenError as bs, messageContact as bt, messageContactId as bu, messageDirection as bv, messageFileIds as bw, messageFiles as bx, publication as by, publicationId as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };
@@ -1231,7 +1231,7 @@ interface paths {
1231
1231
  * The inbox: first-level comments across the whole organization
1232
1232
  * @description Served from PlanVortex's database, so it costs nothing and calls no social network. It is a **snapshot**: `collected_date` says when each row was last read. Open a thread to see what the network says right now.
1233
1233
  *
1234
- * Ordered by `creation_date` descending — the date on the network, not the date we collected it — so rows from nine networks interleave correctly.
1234
+ * Ordered by `creation_date` descending — the date on the network, not the date we collected it — so rows from ten networks interleave correctly.
1235
1235
  *
1236
1236
  * **On `telegram` the inbox starts the day the channel was connected.** The Bot API has no way to read the past: a bot only learns what happens while it is inside, so nothing written before the connection exists here and never will. Say so in your UI — an inbox that opens empty on a busy channel reads like a failure.
1237
1237
  *
@@ -1358,7 +1358,7 @@ interface paths {
1358
1358
  *
1359
1359
  * **An app cannot call this.** Connecting a social account is an OAuth flow with a person in front of it, so this endpoint only accepts a user token or a temporal connect token; with app credentials it answers error 519. The way an integration does it is to issue a temporal connect token with `GET /organizations/{id_organization}/temporal_connect_token` and hand it to its end user.
1360
1360
  *
1361
- * **Read `authorization`, not `link`.** Nine of the eleven networks are `redirect` and you send the person to `link`. Two are not, and neither of them fails visibly if you treat it as one:
1361
+ * **Read `authorization`, not `link`.** Ten of the twelve networks are `redirect` and you send the person to `link`. Two are not, and neither of them fails visibly if you treat it as one:
1362
1362
  *
1363
1363
  * • **WhatsApp is not a URL at all.** Its sign-up is Meta's Embedded Signup, a popup you raise with the Facebook JavaScript SDK, so its `link` is an empty string and everything you need to open that popup travels in `authorization`. A client that loops over the list and redirects to `link` sends its user to its own page.
1364
1364
  * • **Telegram has a link and still is not a redirect.** It opens a chat with the PlanVortex bot, and nobody comes back from it: the account is born minutes later, from the bot being added to a channel, and it is announced over the WebSocket. Open it in another tab and keep listening; redirect to it and there is nobody left to tell.
@@ -2348,7 +2348,7 @@ interface paths {
2348
2348
  *
2349
2349
  * `comments` is the coarse gate — whether the network has comments at all. Which *actions* it allows on one is a finer question and lives in `GET /social_comment_actions`, because the shape here is `{[capability]: boolean}` and nesting an object inside would break it.
2350
2350
  *
2351
- * Today nine networks answer `comments: true`: Facebook, Instagram, LinkedIn, X, YouTube, Google Business, Bluesky, Discord and Telegram. TikTok and WhatsApp answer `false`, for reasons of theirs and not ours.
2351
+ * Today ten networks answer `comments: true`: Facebook, Instagram, Threads, LinkedIn, X, YouTube, Google Business, Bluesky, Discord and Telegram. TikTok and WhatsApp answer `false`, for reasons of theirs and not ours.
2352
2352
  *
2353
2353
  * A `true` here is about the **network**, not about one account of it: a Telegram channel with no linked discussion group answers 965 on its comments even though the network has them.
2354
2354
  *
@@ -2387,6 +2387,7 @@ interface paths {
2387
2387
  * | `bluesky` | yes | yes — through the post's `threadgate` | yes | **no** — the reply lives in somebody else's repository |
2388
2388
  * | `discord` | yes | **no** — Discord has no hide, only delete | yes | yes |
2389
2389
  * | `telegram` | yes | **no** — Telegram has no hide either | yes | yes — with the bot as an admin of the discussion group, otherwise error 969 |
2390
+ * | `threads` | yes | yes | yes | **no** — deleting somebody else's reply is not a permission you lack, it is a call that does not exist in the API |
2390
2391
  * | `tiktok`, `whatsapp` | no | no | no | no |
2391
2392
  *
2392
2393
  * Only needs authentication.
@@ -2580,7 +2581,7 @@ interface components {
2580
2581
  /**
2581
2582
  * @description **How** an account of this network is authorized, which is not always "send the user to this URL".
2582
2583
  *
2583
- * Nine of the eleven networks are `redirect`: open `link` and the network sends the person back to PlanVortex with a code. Two are not:
2584
+ * Ten of the twelve networks are `redirect`: open `link` and the network sends the person back to PlanVortex with a code. Two are not:
2584
2585
  *
2585
2586
  * • **WhatsApp.** Its sign-up is Meta's *Embedded Signup*: a popup raised by the Facebook JavaScript SDK from your own page, which returns — over `postMessage` — session data (`waba_id`, `phone_number_id`) that no query string carries. Its `link` is therefore an empty string.
2586
2587
  * • **Telegram.** There is no OAuth here: no consent screen, no `code`, no account token. `link` opens a private chat with the PlanVortex bot, the person then adds that bot to their channel, and **the account is created from that event**, not from any request of yours. Which means the connection cannot be finished by calling `GET /organizations/{id_organization}/account-connect/telegram` — see that endpoint.
@@ -3040,7 +3041,7 @@ interface components {
3040
3041
  };
3041
3042
  CatalogSocialLimits: {
3042
3043
  /**
3043
- * @description Maximum length of a publication's text. Bluesky counts graphemes, everyone else counts characters — Telegram included, where `String.length` is exactly the right unit.
3044
+ * @description Maximum length of a publication's text. **Bluesky and Threads count GRAPHEMES**, everyone else counts characters — Telegram included, where `String.length` is exactly the right unit. The difference is not academic: an emoji is one grapheme and two `String.length` units, so counting a Threads post with `.length` rejects at 250 emojis what the network publishes happily at 500.
3044
3045
  *
3045
3046
  * On Telegram there are **two numbers for the same field**: `telegram` (4.096) while the publication is text only, and `telegram_media` (1.024) the moment it carries an image or a video, because then the text is a media caption and not a message. Switch the counter when the file is attached, not when publish is pressed.
3046
3047
  */
@@ -3097,7 +3098,7 @@ interface components {
3097
3098
  actual_asigned?: components["schemas"]["PlanData"];
3098
3099
  actual_plan: components["schemas"]["ClientsPlan"];
3099
3100
  /** @description Current consumption across every organization of the client. **Only present with `getUse=true`.** `twitter_credits` and `ai_credits` are what has been spent this calendar month. */
3100
- actual_use?: components["schemas"]["PlanData"];
3101
+ actual_use?: components["schemas"]["PlanUseData"];
3101
3102
  /** @description Read-only view of the client's own AI provider configuration (BYOK). Written via `PUT /clients/{id_client}/ai-settings`. API keys are stored encrypted and are NEVER returned: each scope only exposes provider, model and has_api_key. */
3102
3103
  ai_settings?: components["schemas"]["ClientsAiSettings"];
3103
3104
  /** @enum {string} */
@@ -3284,7 +3285,7 @@ interface components {
3284
3285
  * @description A network that has comments. Treat it as an open list: a new one is added before your integration hears about it.
3285
3286
  * @enum {string}
3286
3287
  */
3287
- CommentsCommentNetworkName: "facebook" | "instagram" | "twitter" | "linkedin" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram";
3288
+ CommentsCommentNetworkName: "facebook" | "instagram" | "twitter" | "linkedin" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram" | "threads";
3288
3289
  /** @description A live read: asked of the network and reconciled with what was stored. */
3289
3290
  CommentsCommentThread: {
3290
3291
  comments: components["schemas"]["CommentsComment"][];
@@ -3575,7 +3576,7 @@ interface components {
3575
3576
  /** @description What has been handed down to child organizations out of this organization's plan. */
3576
3577
  actual_asigned: components["schemas"]["PlanData"];
3577
3578
  /** @description What the organization and its children are consuming right now. */
3578
- actual_use: components["schemas"]["PlanData"];
3579
+ actual_use: components["schemas"]["PlanUseData"];
3579
3580
  /** @description The plan in force. An organization with no plan of its own inherits the closest parent that has one. */
3580
3581
  limits: components["schemas"]["PlanData"];
3581
3582
  };
@@ -3644,7 +3645,7 @@ interface components {
3644
3645
  * The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
3645
3646
  */
3646
3647
  Error: {
3647
- /** @description PlanVortex error code. Ranges: 500-544 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-960 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1307 client plan · 1400-1408 organization plan · 1500-1512 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations. */
3648
+ /** @description PlanVortex error code. Ranges: 500-546 auth, tokens and client apps · 601-612 user · 700-715 social accounts · 800-810 files · 900-979 publications · 1000-1003 general · 1100-1111 organizations · 1200-1207 roles · 1300-1308 client plan · 1400-1408 organization plan · 1500-1512 messaging · 1600-1601 contacts · 1900-1906 payments · 2000-2099 products · 2100-2199 AI plans · 2200-2299 integrations. */
3648
3649
  code: number;
3649
3650
  /** @description Extra context attached to the error, when there is any. */
3650
3651
  data?: {
@@ -3908,7 +3909,7 @@ interface components {
3908
3909
  /** @description The slice of the client's plan assigned to this organization. **Absent when nothing was assigned**, and then the organization shares whatever its nearest parent with a plan has — or, failing that, the client's unassigned remainder. Ask `GET /organizations/{id_organization}/limits` for the effective numbers instead of reading this. */
3909
3910
  actual_plan?: components["schemas"]["PlanData"];
3910
3911
  /** @description Current consumption. **Only present with `getUse=true`.** `twitter_credits` and `ai_credits` are what has been spent in the current calendar month; the rest is what exists right now. */
3911
- actual_use?: components["schemas"]["PlanData"];
3912
+ actual_use?: components["schemas"]["PlanUseData"];
3912
3913
  ai_context?: components["schemas"]["AiContext"];
3913
3914
  /** Format: date-time */
3914
3915
  creation_date: string;
@@ -4035,12 +4036,12 @@ interface components {
4035
4036
  accounts: number;
4036
4037
  /** @description Monthly AI credits (1 credit = $0.001 of provider cost): 15 per plan orchestration pass, 2 per generated text, 70 per generated image. Resets monthly and does not roll over. A client using its own provider key (BYOK) does not consume them in that scope. */
4037
4038
  ai_credits?: number;
4039
+ /** @description Apps this plan allows: 1 on Free, 2 on Basic, 5 on Pro, 10 on Custom. Each one is a `client_id` with a secret, so each one is a key to the whole public API — which every plan has, Free included. Unlike accounts, users or storage this is NOT split between organizations: an app belongs to the client. On a use payload it is how many exist right now. */
4040
+ apps?: number;
4038
4041
  /** @description Whether AI generation is enabled. */
4039
4042
  artificial_inteligence?: boolean;
4040
- /** @description Connections to a third-party tool material is pulled from (Google Drive, an RSS feed). Not the same thing as an app: an app is API access, and it is a Custom-plan feature of its own. */
4043
+ /** @description Connections to a third-party tool material is pulled from (Google Drive, an RSS feed). Not the same thing as an app: an app is API access, and it has its own allowance in `apps`. */
4041
4044
  integrations: number;
4042
- /** @description Publications that may be sent per month. */
4043
- publications: number;
4044
4045
  /** @description Storage, in GB. */
4045
4046
  space: number;
4046
4047
  /** @description Whether statistics collection is enabled. */
@@ -4052,6 +4053,11 @@ interface components {
4052
4053
  /** @description Whether WhatsApp may be connected. */
4053
4054
  whatsapp?: boolean;
4054
4055
  };
4056
+ /** @description What is being consumed right now. Same shape as PlanData plus `publications`, which is counted but neither charged nor split between organizations. */
4057
+ PlanUseData: {
4058
+ /** @description Publications created in the current calendar month. A METRIC, not a quota: publications are unlimited on every plan, so there is no limit to compare it against. What throttles publishing is rate, not plan — see the per-hour and per-network daily caps. */
4059
+ publications?: number;
4060
+ } & components["schemas"]["PlanData"];
4055
4061
  /** @description A product as the network returns it. `id` is always present here. */
4056
4062
  ProductsProduct: components["schemas"]["ProductsProductInput"];
4057
4063
  /** @description A Meta commerce catalogue, as the network returns it. */
@@ -4187,7 +4193,7 @@ interface components {
4187
4193
  * Not every connectable network publishes — a local business listing receives reviews, not posts — so this list is shorter than the one in `GET /social_networks`. Ask `GET /allowed_social_publications` rather than hardcoding it, because it grows.
4188
4194
  * @enum {string}
4189
4195
  */
4190
- social_network?: "facebook" | "instagram" | "twitter" | "linkedin" | "tiktok" | "whatsapp" | "youtube" | "bluesky" | "discord" | "telegram";
4196
+ social_network?: "facebook" | "instagram" | "twitter" | "linkedin" | "tiktok" | "whatsapp" | "youtube" | "bluesky" | "discord" | "telegram" | "threads";
4191
4197
  /**
4192
4198
  * @description Send `draft` to store the publication without publishing it. If omitted, the state is resolved automatically: `ready` when everything validates, `withErrors` otherwise. Forcing `sended` marks it as published without actually sending it.
4193
4199
  * @enum {string}
@@ -4299,6 +4305,8 @@ interface components {
4299
4305
  *
4300
4306
  * On `bluesky` there are no impressions and no reach either — only the public counters — so engagement is computed over followers.
4301
4307
  *
4308
+ * On `threads` there are six, and the one that matters is `views`: it is the only one of the four newest networks with something like impressions, so its engagement rate is computed over a real base and not over followers. Sharing arrives split in three — `reposts`, `quotes` and `shares` (outside Threads) — and the three are added into one figure, the same criterion as on X; the breakdown stays in `raw`. A reply is what every other network calls a comment.
4309
+ *
4302
4310
  * On `telegram` there are two as well, and **neither of them is asked for**: the Bot API has no method that returns a message's metrics, so `reactions` arrives on its own through the bot and `comments` is counted in PlanVortex's own inbox. There are no impressions, no reach, no views and no forwards to be had anywhere in it, so engagement is computed over followers.
4303
4311
  */
4304
4312
  PublicationStats: {
@@ -4384,7 +4392,7 @@ interface components {
4384
4392
  * **This list grows.** Treat it as an open enumeration: a client that rejects an unknown value breaks the day a network is added, which happens several times a year. Not every network does everything — ask `GET /social_capabilities`.
4385
4393
  * @enum {string}
4386
4394
  */
4387
- SocialNetwork: "facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "whatsapp" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram";
4395
+ SocialNetwork: "facebook" | "instagram" | "linkedin" | "tiktok" | "twitter" | "whatsapp" | "youtube" | "google_business" | "bluesky" | "discord" | "telegram" | "threads";
4388
4396
  /** @description Statistics collection settings. Only `auto_refresh_twitter` is read; any other key is ignored. */
4389
4397
  StatsSettings: {
4390
4398
  /**
@@ -10887,7 +10895,8 @@ interface operations {
10887
10895
  * "google_business",
10888
10896
  * "bluesky",
10889
10897
  * "discord",
10890
- * "telegram"
10898
+ * "telegram",
10899
+ * "threads"
10891
10900
  * ]
10892
10901
  */
10893
10902
  "application/json": components["schemas"]["SocialNetwork"][];
@@ -11141,6 +11150,18 @@ type PlannerTemplateFieldType = OpenEnum<NonNullable<PlannerTemplateField["type"
11141
11150
  * cliente tiene contratado — pedir mas devuelve un 1400-1408.
11142
11151
  */
11143
11152
  type PlanData = Schemas["PlanData"];
11153
+ /**
11154
+ * Lo que se esta CONSUMIENDO ahora mismo: un {@link PlanData} mas `publications`.
11155
+ *
11156
+ * `publications` es una METRICA, no un cupo —las publicaciones son ilimitadas en todos los
11157
+ * planes—, asi que no hay ningun limite contra el que compararla: no la pintes como una barra.
11158
+ * Lo que frena al que publica de mas es el RITMO (tope por hora y cuenta, y tope diario por red,
11159
+ * los dos en `GET /social_limits`), no el plan.
11160
+ *
11161
+ * No confundir con {@link PlanUse}, que es el bloque entero del panel: consumo, repartido y
11162
+ * limites juntos.
11163
+ */
11164
+ type PlanUseData = Schemas["PlanUseData"];
11144
11165
  /**
11145
11166
  * La SUSCRIPCION de un cliente, que no es lo mismo que los recursos que da: los numeros estan en
11146
11167
  * `plan_data`. Leer `plan_identifier` para saber los limites es el error clasico — un plan
@@ -11835,7 +11856,7 @@ declare class PlanVortexError extends Error {
11835
11856
  readonly retryAfter: number | undefined;
11836
11857
  constructor(code: number, message: string, options?: PlanVortexErrorOptions);
11837
11858
  }
11838
- /** 500-544 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11859
+ /** 500-546 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11839
11860
  declare class AuthError extends PlanVortexError {
11840
11861
  }
11841
11862
  /** 601-612 — el usuario final. */
@@ -11847,14 +11868,15 @@ declare class AccountError extends PlanVortexError {
11847
11868
  /** 800-810 — ficheros: formato no admitido, demasiado grande, conversión fallida. */
11848
11869
  declare class FileError extends PlanVortexError {
11849
11870
  }
11850
- /** 900-960 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración). */
11871
+ /** 900-979 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración) y los
11872
+ * dos frenos de ritmo: 978 (demasiado rápido en esta cuenta) y 979 (tope diario de esa red). */
11851
11873
  declare class PublicationError extends PlanVortexError {
11852
11874
  }
11853
11875
  /** 1100-1111 — organizaciones, y el token temporal atado a una sola de ellas (1101). */
11854
11876
  declare class OrganizationError extends PlanVortexError {
11855
11877
  }
11856
11878
  /**
11857
- * 1300-1307 y 1400-1408 — el cupo del plan, del cliente o de la organización.
11879
+ * 1300-1308 y 1400-1408 — el cupo del plan, del cliente o de la organización.
11858
11880
  *
11859
11881
  * Es el error que un integrador **sí** quiere distinguir: no se arregla reintentando, se arregla
11860
11882
  * cambiando de plan. Por eso los dos rangos comparten clase.
@@ -12177,4 +12199,4 @@ interface PlanVortexWebhooksOptions {
12177
12199
  */
12178
12200
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
12179
12201
 
12180
- export { type SocialCredentialsInput as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type ConnectToken as Z, type AiContext as _, type ConnectResult as a, type PlannerTemplateFieldType as a$, type Product as a0, type ProductInput as a1, type ProductCatalog as a2, type ProductCatalogInput as a3, type PublicationInput as a4, type PublicationState as a5, type PublicationStats as a6, type PublicationStatsHistory as a7, type Upload as a8, AccountError as a9, FileError as aA, type FileFormat as aB, type FileProperties as aC, type FileType as aD, IntegrationError as aE, type IntegrationErrorChange as aF, type MessageChange as aG, type MessageOptions as aH, type MessageType as aI, MessagingError as aJ, type MetricRow as aK, NO_ERROR_CODE as aL, type components as aM, type operations as aN, type paths as aO, type webhooks as aP, type OpenEnum as aQ, OrganizationError as aR, PLANVORTEX_ERROR_RANGES as aS, PlanLimitError as aT, PlanVortexAuthenticationError as aU, PlanVortexConfigError as aV, PlanVortexConnectionError as aW, PlanVortexError as aX, type PlanVortexErrorOptions as aY, type PlanVortexErrorRange as aZ, type PlannerTemplateField as a_, type AccountMetricRow as aa, type AccountStateChange as ab, type AccountWebhookChangeBase as ac, type AccountWithError as ad, type AiPlanCostEstimate as ae, AiPlanError as af, type AiPlanNotice as ag, type AiPlanOptions as ah, type AiPlanOptionsInput as ai, type AiPlanSource as aj, type AiPlanSourceImageInput as ak, type AiPlanSourceInput as al, type AiPlanSourceProduct as am, type AiPlanState as an, type ApiErrorBody as ao, type AspectRatios as ap, AuthError as aq, type ClientPlan as ar, type CommentAuthor as as, type CommentChange as at, type ContactChannel as au, ContactError as av, type DashboardAiPlanRef as aw, type DashboardPublicationRef as ax, type DashboardRange as ay, type EngagementBase as az, type AccountMetrics as b, type PlannerTemplateName as b0, ProductError as b1, PublicationError as b2, type PublicationErrorDetail as b3, type PublicationMetrics as b4, type PublicationStatsPoint as b5, type PublicationType as b6, type PublicationsSummary as b7, type RssConfig as b8, type SocialAuthorizationMethod as b9, type PlanVortexWebhooksOptions as bA, type RawWebhookBody as bB, type VerifyWebhookSignatureOptions as bC, WEBHOOK_EVENTS as bD, WEBHOOK_SIGNATURE_HEADERS as bE, WebhookBodyError as bF, type WebhookHeaders as bG, type WebhookRequestLike as bH, type WebhookResponseLike as bI, WebhookSignatureError as bJ, handleWebhookRequest as bK, isAccountStateChange as bL, isCommentChange as bM, isIntegrationErrorChange as bN, isMessageChange as bO, parseWebhookPayload as bP, planvortexWebhooks as bQ, verifyWebhookSignature as bR, type SocialCredentials as ba, type SocialIdentifier as bb, type SocialIdentifierInput as bc, type SocialLimitsMap as bd, TOKEN_ERROR_CODES as be, type TopPublication as bf, type UnknownWebhookChange as bg, UserError as bh, type WebhookAlgorithm as bi, type WebhookChange as bj, type WebhookEvent as bk, type WithAccount as bl, type WithPublication as bm, account as bn, accountId as bo, errorFamilyForCode as bp, isPlanVortexError as bq, isTokenError as br, messageContact as bs, messageContactId as bt, messageDirection as bu, messageFileIds as bv, messageFiles as bw, publication as bx, publicationId as by, type HandleWebhookRequestOptions as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };
12202
+ export { type AiContext as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type PlanUseData as Z, type ConnectToken as _, type ConnectResult as a, type PlannerTemplateField as a$, type SocialCredentialsInput as a0, type Product as a1, type ProductInput as a2, type ProductCatalog as a3, type ProductCatalogInput as a4, type PublicationInput as a5, type PublicationState as a6, type PublicationStats as a7, type PublicationStatsHistory as a8, type Upload as a9, type EngagementBase as aA, FileError as aB, type FileFormat as aC, type FileProperties as aD, type FileType as aE, IntegrationError as aF, type IntegrationErrorChange as aG, type MessageChange as aH, type MessageOptions as aI, type MessageType as aJ, MessagingError as aK, type MetricRow as aL, NO_ERROR_CODE as aM, type components as aN, type operations as aO, type paths as aP, type webhooks as aQ, type OpenEnum as aR, OrganizationError as aS, PLANVORTEX_ERROR_RANGES as aT, PlanLimitError as aU, PlanVortexAuthenticationError as aV, PlanVortexConfigError as aW, PlanVortexConnectionError as aX, PlanVortexError as aY, type PlanVortexErrorOptions as aZ, type PlanVortexErrorRange as a_, AccountError as aa, type AccountMetricRow as ab, type AccountStateChange as ac, type AccountWebhookChangeBase as ad, type AccountWithError as ae, type AiPlanCostEstimate as af, AiPlanError as ag, type AiPlanNotice as ah, type AiPlanOptions as ai, type AiPlanOptionsInput as aj, type AiPlanSource as ak, type AiPlanSourceImageInput as al, type AiPlanSourceInput as am, type AiPlanSourceProduct as an, type AiPlanState as ao, type ApiErrorBody as ap, type AspectRatios as aq, AuthError as ar, type ClientPlan as as, type CommentAuthor as at, type CommentChange as au, type ContactChannel as av, ContactError as aw, type DashboardAiPlanRef as ax, type DashboardPublicationRef as ay, type DashboardRange as az, type AccountMetrics as b, type PlannerTemplateFieldType as b0, type PlannerTemplateName as b1, ProductError as b2, PublicationError as b3, type PublicationErrorDetail as b4, type PublicationMetrics as b5, type PublicationStatsPoint as b6, type PublicationType as b7, type PublicationsSummary as b8, type RssConfig as b9, type HandleWebhookRequestOptions as bA, type PlanVortexWebhooksOptions as bB, type RawWebhookBody as bC, type VerifyWebhookSignatureOptions as bD, WEBHOOK_EVENTS as bE, WEBHOOK_SIGNATURE_HEADERS as bF, WebhookBodyError as bG, type WebhookHeaders as bH, type WebhookRequestLike as bI, type WebhookResponseLike as bJ, WebhookSignatureError as bK, handleWebhookRequest as bL, isAccountStateChange as bM, isCommentChange as bN, isIntegrationErrorChange as bO, isMessageChange as bP, parseWebhookPayload as bQ, planvortexWebhooks as bR, verifyWebhookSignature as bS, type SocialAuthorizationMethod as ba, type SocialCredentials as bb, type SocialIdentifier as bc, type SocialIdentifierInput as bd, type SocialLimitsMap as be, TOKEN_ERROR_CODES as bf, type TopPublication as bg, type UnknownWebhookChange as bh, UserError as bi, type WebhookAlgorithm as bj, type WebhookChange as bk, type WebhookEvent as bl, type WithAccount as bm, type WithPublication as bn, account as bo, accountId as bp, errorFamilyForCode as bq, isPlanVortexError as br, isTokenError as bs, messageContact as bt, messageContactId as bu, messageDirection as bv, messageFileIds as bw, messageFiles as bx, publication as by, publicationId as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };