planvortex 0.7.0 → 0.9.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"]}
@@ -172,7 +172,7 @@ interface paths {
172
172
  get?: never;
173
173
  /**
174
174
  * Configure the client's own AI models (BYOK)
175
- * @description Set the client's Bring-Your-Own-Key AI provider configuration per scope. The request body is an object keyed by scope (orchestrator, text, image); a scope set to null clears it. Providers and capabilities are validated against a fixed catalogue. When a scope uses BYOK, its calls are billed to the client's own provider and do NOT consume PlanVortex AI credits, but the artificial_inteligence plan flag is still required to use the feature. API keys are stored encrypted and never returned; the response client only exposes provider, model and has_api_key per scope. Requires the client:update permission.
175
+ * @description Set the client's Bring-Your-Own-Key AI provider configuration per scope. The request body is an object keyed by scope (orchestrator, text, image); a scope set to null clears it. Providers and capabilities are validated against a fixed catalogue. When a scope uses BYOK, its calls are billed to the client's own provider and do NOT consume PlanVortex AI credits, but the plan still has to include AI credits to use the feature. API keys are stored encrypted and never returned; the response client only exposes provider, model and has_api_key per scope. Requires the client:update permission.
176
176
  */
177
177
  put: operations["updateAiSettings"];
178
178
  post?: never;
@@ -193,7 +193,7 @@ interface paths {
193
193
  * List the client's apps
194
194
  * @description The apps of a client. Secrets never travel here: to read one, ask for it explicitly with the `secret` endpoint.
195
195
  *
196
- * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
196
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. **No plan is required**: apps are on all four plans, the free one included — what the plan decides is how many you can hold at once and how fast you can call.
197
197
  */
198
198
  get: operations["getClientApps"];
199
199
  put?: never;
@@ -201,15 +201,15 @@ interface paths {
201
201
  * Create an app
202
202
  * @description Creates the app and its credentials.
203
203
  *
204
- * **A client can have one app.** Creating a second answers error 536. If you need to rotate credentials, update the existing app rather than creating another.
204
+ * **How many apps fit is decided by the plan**, not by a fixed limit of one: 1 on free, 2 on basic, 5 on pro and 10 on custom. Going over answers `ERROR_CODE_1308`, which carries `limit` and `used` in its `data`. Deleting an app frees its slot immediately, because only live apps count. If you just need to rotate credentials, update the existing app rather than creating another.
205
+ *
206
+ * **The user's email must be verified** (`ERROR_CODE_546`). This is the only route in `/apps` that asks for it: an app is a key to the whole public API, and this is what stops a throwaway address from minting them in bulk. Reading, updating and deleting an app you already own do not check it.
205
207
  *
206
208
  * Every URL is validated: a bad entry in `allowed_domains` answers 531, in `redirect_urls` 532, and a bad `webhook_url` answers 535.
207
209
  *
208
210
  * **The secret is not in the response.** Read it with `GET /clients/{id_client}/apps/{id_app}/secret`.
209
211
  *
210
- * **A client can only have ONE app.** Creating a second one is rejected with `ERROR_CODE_536`: delete or update the one that exists. The listing is paginated because every listing in this API is, not because there can be more than one.
211
- *
212
- * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
212
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. **No plan is required**: apps are on all four plans, the free one included — what the plan decides is how many you can hold at once and how fast you can call.
213
213
  */
214
214
  post: operations["createClientApp"];
215
215
  delete?: never;
@@ -229,7 +229,7 @@ interface paths {
229
229
  * Get one app
230
230
  * @description The app's record, without its secret. Note the envelope: `{client_app}` here, `{client_apps, total}` in the list.
231
231
  *
232
- * **An app token works here.** This is the one part of `/apps` that does: an app can read and update its own record, but it cannot list, create, delete, or read the secret. The **Custom plan** is still required (`ERROR_CODE_542`).
232
+ * **An app token works here.** This is the one part of `/apps` that does: an app can read and update its own record, but it cannot list, create, delete, or read the secret. **No plan is required**: apps are on all four plans, the free one included.
233
233
  */
234
234
  get: operations["getClientApp"];
235
235
  /**
@@ -240,7 +240,7 @@ interface paths {
240
240
  *
241
241
  * **It replaces every field with what the body carries.** `name`, `keycloak_client_idenfifier`, `allowed_domains`, `redirect_urls` and `webhook_url` are all written as sent, so omitting one erases it — sending an update without `webhook_url` turns the webhook off. Read the app first and send it back whole.
242
242
  *
243
- * **An app token works here.** This is the one part of `/apps` that does: an app can read and update its own record, but it cannot list, create, delete, or read the secret. The **Custom plan** is still required (`ERROR_CODE_542`).
243
+ * **An app token works here.** This is the one part of `/apps` that does: an app can read and update its own record, but it cannot list, create, delete, or read the secret. **No plan is required**: apps are on all four plans, the free one included.
244
244
  */
245
245
  put: operations["updateClientApp"];
246
246
  post?: never;
@@ -248,7 +248,7 @@ interface paths {
248
248
  * Delete an app
249
249
  * @description Revokes the credentials and marks the app as deleted. **Tokens already issued stop working**: the token endpoint checks that the app still exists before answering, and requests carrying an old token no longer resolve to an app.
250
250
  *
251
- * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
251
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. **No plan is required**: apps are on all four plans, the free one included — what the plan decides is how many you can hold at once and how fast you can call.
252
252
  */
253
253
  delete: operations["deleteClientApp"];
254
254
  options?: never;
@@ -269,7 +269,7 @@ interface paths {
269
269
  *
270
270
  * The same secret is what signs the outgoing webhooks (`x-hub-signature`, `x-hub-signature-256`).
271
271
  *
272
- * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. It also needs the **Custom plan** (`ERROR_CODE_542`): apps are what that plan adds, and they are the door to this whole API.
272
+ * **Needs a USER token, not an app token.** With client credentials it answers `ERROR_CODE_512`. **No plan is required**: apps are on all four plans, the free one included — what the plan decides is how many you can hold at once and how fast you can call.
273
273
  *
274
274
  * It comes straight from Keycloak, so it is the live secret and not a copy: treat the response as a credential and never log it.
275
275
  */
@@ -351,7 +351,7 @@ interface paths {
351
351
  put?: never;
352
352
  /**
353
353
  * Create an AI publication plan
354
- * @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (artificial_inteligence), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission. Since the plan can be generated from a SOURCE (`template` + `source`), part of that validation is the source itself: the article is downloaded, the catalogue is read live and the product pictures are copied — all of it inside this request, so what does not work fails with the user in front of it. A plan whose source did not fit in the week is still created, and says so in ai_plan.warnings (2117).
354
+ * @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (it contracts AI credits; Free does not), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission. Since the plan can be generated from a SOURCE (`template` + `source`), part of that validation is the source itself: the article is downloaded, the catalogue is read live and the product pictures are copied — all of it inside this request, so what does not work fails with the user in front of it. A plan whose source did not fit in the week is still created, and says so in ai_plan.warnings (2117).
355
355
  */
356
356
  post: operations["addAiPlan"];
357
357
  delete?: never;
@@ -752,6 +752,8 @@ interface paths {
752
752
  * **A temporal connect token is spent here.** Once this call succeeds, that token cannot connect anything else and answers error 543; the `enable` calls that finish the same connection still work until it expires. And if the token was issued for one network, calling this for another answers error 544.
753
753
  *
754
754
  * **Telegram does not come through here, and cannot be made to.** That network has no callback: the account is created by PlanVortex when the bot is added to a channel, and what authorizes it is a single-use voucher minted at that moment and spent in the same breath — it never leaves the server, so calling this endpoint for `telegram` answers error 700. It is deliberate: the bot is shared, so without it anyone could hang any channel where that bot is an admin off their own organization by passing a chat id by hand. What an integration listens for instead is the `new_account` webhook notification.
755
+ *
756
+ * **And a Telegram account arrives already active.** In the other eleven networks this endpoint hands you accounts that are still off, and you pick which ones spend a plan slot with `POST .../accounts/{id_account}/enable`. Here there is nothing to call: one channel arrives — the one the person picked in Telegram — and PlanVortex takes the slot for it right then. If the plan has no free slot the account is still created, off, and the person is told so in the bot chat; `GET /organizations/{id_organization}/accounts` will not list it, because that listing only returns active accounts, but naming it in the `accounts` filter does return it.
755
757
  */
756
758
  get: operations["connectAccount"];
757
759
  put?: never;
@@ -896,6 +898,8 @@ interface paths {
896
898
  * @description Brings back an account that was removed, without going through the authorization again — as long as its stored token still works.
897
899
  *
898
900
  * It takes a **slot of the plan**, so it fails with error 706 when the organization is already at its account limit. It also turns the network's webhooks back on, on any plan but the free one.
901
+ *
902
+ * **On `telegram` you normally never call this.** That network's accounts are born active — there is no authorization return in which to choose them, so PlanVortex takes the slot when the bot is added to the channel. The one case left is a channel that arrived while the plan was full: it stays off until a slot frees up, and this is what turns it on.
899
903
  */
900
904
  post: operations["enableAccount"];
901
905
  delete?: never;
@@ -3098,7 +3102,7 @@ interface components {
3098
3102
  actual_asigned?: components["schemas"]["PlanData"];
3099
3103
  actual_plan: components["schemas"]["ClientsPlan"];
3100
3104
  /** @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. */
3101
- actual_use?: components["schemas"]["PlanData"];
3105
+ actual_use?: components["schemas"]["PlanUseData"];
3102
3106
  /** @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. */
3103
3107
  ai_settings?: components["schemas"]["ClientsAiSettings"];
3104
3108
  /** @enum {string} */
@@ -3576,7 +3580,7 @@ interface components {
3576
3580
  /** @description What has been handed down to child organizations out of this organization's plan. */
3577
3581
  actual_asigned: components["schemas"]["PlanData"];
3578
3582
  /** @description What the organization and its children are consuming right now. */
3579
- actual_use: components["schemas"]["PlanData"];
3583
+ actual_use: components["schemas"]["PlanUseData"];
3580
3584
  /** @description The plan in force. An organization with no plan of its own inherits the closest parent that has one. */
3581
3585
  limits: components["schemas"]["PlanData"];
3582
3586
  };
@@ -3645,7 +3649,7 @@ interface components {
3645
3649
  * The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
3646
3650
  */
3647
3651
  Error: {
3648
- /** @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. */
3652
+ /** @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. */
3649
3653
  code: number;
3650
3654
  /** @description Extra context attached to the error, when there is any. */
3651
3655
  data?: {
@@ -3909,7 +3913,7 @@ interface components {
3909
3913
  /** @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. */
3910
3914
  actual_plan?: components["schemas"]["PlanData"];
3911
3915
  /** @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. */
3912
- actual_use?: components["schemas"]["PlanData"];
3916
+ actual_use?: components["schemas"]["PlanUseData"];
3913
3917
  ai_context?: components["schemas"]["AiContext"];
3914
3918
  /** Format: date-time */
3915
3919
  creation_date: string;
@@ -4030,29 +4034,32 @@ interface components {
4030
4034
  total?: number;
4031
4035
  users?: components["schemas"]["OrganizationsUser"][];
4032
4036
  };
4033
- /** @description The resources a plan grants. On a client it is what was contracted; on an organization, the slice of it that was assigned. The sum across all the organizations of a client can never exceed what the client has contracted. */
4037
+ /**
4038
+ * @description The resources a plan grants. On a client it is what was contracted; on an organization, the slice of it that was assigned. The sum across all the organizations of a client can never exceed what the client has contracted.
4039
+ *
4040
+ * Users are NOT here: every plan has unlimited users, so they are neither charged nor split between organizations. They are still counted, in `PlanUseData.users`. There are no `artificial_inteligence`, `whatsapp` or `stats` flags either: statistics and WhatsApp are on every plan, and what gates AI is `ai_credits` — a plan with credits has AI, and Free has zero.
4041
+ */
4034
4042
  PlanData: {
4035
4043
  /** @description Social accounts that may be connected. */
4036
4044
  accounts: number;
4037
4045
  /** @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. */
4038
4046
  ai_credits?: number;
4039
- /** @description Whether AI generation is enabled. */
4040
- artificial_inteligence?: boolean;
4041
- /** @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. */
4047
+ /** @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 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. */
4048
+ apps?: number;
4049
+ /** @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`. */
4042
4050
  integrations: number;
4043
- /** @description Publications that may be sent per month. */
4044
- publications: number;
4045
4051
  /** @description Storage, in GB. */
4046
4052
  space: number;
4047
- /** @description Whether statistics collection is enabled. */
4048
- stats?: boolean;
4049
4053
  /** @description Monthly X (Twitter) credits. X bills per use: 15 per post, 200 if the text contains a link, 15 per deletion, 1 per stat read, 1 per timeline item. The pool resets on the 1st of each calendar month and does not roll over. */
4050
4054
  twitter_credits?: number;
4051
- /** @description Users with access. */
4052
- users: number;
4053
- /** @description Whether WhatsApp may be connected. */
4054
- whatsapp?: boolean;
4055
4055
  };
4056
+ /** @description What is being consumed right now. Same shape as PlanData plus `publications` and `users`, which are 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
+ /** @description Users with access right now. A METRIC, not a quota: users are unlimited on every plan, so there is no limit to compare it against. */
4061
+ users?: number;
4062
+ } & components["schemas"]["PlanData"];
4056
4063
  /** @description A product as the network returns it. `id` is always present here. */
4057
4064
  ProductsProduct: components["schemas"]["ProductsProductInput"];
4058
4065
  /** @description A Meta commerce catalogue, as the network returns it. */
@@ -11145,6 +11152,18 @@ type PlannerTemplateFieldType = OpenEnum<NonNullable<PlannerTemplateField["type"
11145
11152
  * cliente tiene contratado — pedir mas devuelve un 1400-1408.
11146
11153
  */
11147
11154
  type PlanData = Schemas["PlanData"];
11155
+ /**
11156
+ * Lo que se esta CONSUMIENDO ahora mismo: un {@link PlanData} mas `publications`.
11157
+ *
11158
+ * `publications` es una METRICA, no un cupo —las publicaciones son ilimitadas en todos los
11159
+ * planes—, asi que no hay ningun limite contra el que compararla: no la pintes como una barra.
11160
+ * Lo que frena al que publica de mas es el RITMO (tope por hora y cuenta, y tope diario por red,
11161
+ * los dos en `GET /social_limits`), no el plan.
11162
+ *
11163
+ * No confundir con {@link PlanUse}, que es el bloque entero del panel: consumo, repartido y
11164
+ * limites juntos.
11165
+ */
11166
+ type PlanUseData = Schemas["PlanUseData"];
11148
11167
  /**
11149
11168
  * La SUSCRIPCION de un cliente, que no es lo mismo que los recursos que da: los numeros estan en
11150
11169
  * `plan_data`. Leer `plan_identifier` para saber los limites es el error clasico — un plan
@@ -11839,7 +11858,7 @@ declare class PlanVortexError extends Error {
11839
11858
  readonly retryAfter: number | undefined;
11840
11859
  constructor(code: number, message: string, options?: PlanVortexErrorOptions);
11841
11860
  }
11842
- /** 500-544 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11861
+ /** 500-546 — tokens, apps de cliente, permisos. Incluye el 501 y el 522, los de token caducado. */
11843
11862
  declare class AuthError extends PlanVortexError {
11844
11863
  }
11845
11864
  /** 601-612 — el usuario final. */
@@ -11851,14 +11870,15 @@ declare class AccountError extends PlanVortexError {
11851
11870
  /** 800-810 — ficheros: formato no admitido, demasiado grande, conversión fallida. */
11852
11871
  declare class FileError extends PlanVortexError {
11853
11872
  }
11854
- /** 900-960 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración). */
11873
+ /** 900-979 — publicaciones, incluidos los límites por red (caracteres, imágenes, duración) y los
11874
+ * dos frenos de ritmo: 978 (demasiado rápido en esta cuenta) y 979 (tope diario de esa red). */
11855
11875
  declare class PublicationError extends PlanVortexError {
11856
11876
  }
11857
11877
  /** 1100-1111 — organizaciones, y el token temporal atado a una sola de ellas (1101). */
11858
11878
  declare class OrganizationError extends PlanVortexError {
11859
11879
  }
11860
11880
  /**
11861
- * 1300-1307 y 1400-1408 — el cupo del plan, del cliente o de la organización.
11881
+ * 1300-1308 y 1400-1408 — el cupo del plan, del cliente o de la organización.
11862
11882
  *
11863
11883
  * Es el error que un integrador **sí** quiere distinguir: no se arregla reintentando, se arregla
11864
11884
  * cambiando de plan. Por eso los dos rangos comparten clase.
@@ -12181,4 +12201,4 @@ interface PlanVortexWebhooksOptions {
12181
12201
  */
12182
12202
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
12183
12203
 
12184
- 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 };
12204
+ 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 };