planvortex 0.20.0 → 0.22.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 +1 -1
- package/dist/{chunk-DRVCK5JO.js → chunk-A77VAAQH.js} +5 -4
- package/dist/chunk-A77VAAQH.js.map +1 -0
- package/dist/{index-BQPQczjR.d.cts → index-BS-kMRg2.d.cts} +142 -30
- package/dist/{index-BQPQczjR.d.ts → index-BS-kMRg2.d.ts} +142 -30
- package/dist/index.cjs +17 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -12
- package/dist/index.d.ts +34 -12
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/webhooks/index.cjs +3 -2
- package/dist/webhooks/index.cjs.map +1 -1
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DRVCK5JO.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as Client, a0 as Organization, a1 as AiSettings, a2 as ClientWithOrganizations, a3 as AccountSelection, a4 as PlanData, a5 as PlanUseData, a6 as ConnectToken, a7 as AiContext, a8 as SocialCredentialsInput, a9 as Product, aa as ProductInput, ab as ProductCatalog, ac as ProductCatalogInput, ad as PublicationInput, ae as PublicationState, af as PublicationStats, ag as PublicationStatsHistory, ah as Upload } from './index-
|
|
2
|
-
export { ai as AccountError, aj as AccountMetricRow, ak as AccountStateChange, al as AccountWebhookChangeBase, am as AccountWithError, an as AiImageOrigin, ao as AiPlanCostEstimate, ap as AiPlanDestination, aq as AiPlanError, ar as AiPlanNotice, as as AiPlanOptions, at as AiPlanOptionsInput, au as AiPlanResult, av as AiPlanResultsGroup, aw as AiPlanResultsTemplateGroup, ax as AiPlanSource, ay as AiPlanSourceImageInput, az as AiPlanSourceInput, aA as AiPlanSourceProduct, aB as AiPlanState, aC as ApiErrorBody, aD as AspectRatios, aE as AuthError, aF as ClientPlan, aG as CommentAuthor, aH as CommentChange, aI as ConnectSessionAccount, aJ as ContactChannel, aK as ContactError, aL as DashboardAiPlanRef, aM as DashboardPublicationRef, aN as DashboardRange, aO as EngagementBase, aP as FileError, aQ as FileFormat, aR as FileProperties, aS as FileType, aT as IntegrationCatalogProduct, aU as IntegrationConfig, aV as IntegrationError, aW as IntegrationErrorChange, aX as IntegrationFormField, aY as MessageChange, aZ as MessageEchoChange, a_ as MessageOptions, a$ as MessageType, b0 as MessagingError, b1 as MetricRow, b2 as NO_ERROR_CODE, b3 as OpenApiComponents, b4 as OpenApiOperations, b5 as OpenApiPaths, b6 as OpenApiWebhooks, b7 as OpenEnum, b8 as OrganizationError, b9 as PLANVORTEX_ERROR_RANGES, ba as PlanLimitError, bb as PlanVortexAuthenticationError, bc as PlanVortexConfigError, bd as PlanVortexConnectionError, be as PlanVortexError, bf as PlanVortexErrorOptions, bg as PlanVortexErrorRange, bh as PlannerTemplateField, bi as PlannerTemplateFieldType, bj as ProductError, bk as PublicationAiGenerated, bl as PublicationDestination, bm as PublicationError, bn as PublicationErrorDetail, bo as PublicationMetrics, bp as PublicationPending, bq as PublicationStatsPoint, br as PublicationType, bs as PublicationsSummary, bt as RssConfig, bu as SocialAuthorizationMethod, bv as SocialCredentials, bw as SocialIdentifier, bx as SocialIdentifierInput, by as SocialLimitsMap, bz as TOKEN_ERROR_CODES, bA as TopPublication, bB as UnknownWebhookChange, bC as UserError, bD as WebhookAlgorithm, bE as WebhookChange, bF as WebhookEvent, bG as WithAccount, bH as WithPublication, bI as WooCommerceConnectRequest, bJ as account, bK as accountId, bL as errorFamilyForCode, bM as isPlanVortexError, bN as isTokenError, bO as messageContact, bP as messageContactId, bQ as messageDirection, bR as messageFileIds, bS as messageFiles, bT as publication, bU as publicationId } from './index-
|
|
1
|
+
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as Client, a0 as Organization, a1 as AiSettings, a2 as ClientWithOrganizations, a3 as AccountSelection, a4 as PlanData, a5 as PlanUseData, a6 as ConnectToken, a7 as AiContext, a8 as SocialCredentialsInput, a9 as Product, aa as ProductInput, ab as ProductCatalog, ac as ProductCatalogInput, ad as PublicationInput, ae as PublicationState, af as PublicationStats, ag as PublicationStatsHistory, ah as Upload } from './index-BS-kMRg2.cjs';
|
|
2
|
+
export { ai as AccountError, aj as AccountMetricRow, ak as AccountStateChange, al as AccountWebhookChangeBase, am as AccountWithError, an as AiImageOrigin, ao as AiPlanCostEstimate, ap as AiPlanDestination, aq as AiPlanError, ar as AiPlanNotice, as as AiPlanOptions, at as AiPlanOptionsInput, au as AiPlanResult, av as AiPlanResultsGroup, aw as AiPlanResultsTemplateGroup, ax as AiPlanSource, ay as AiPlanSourceImageInput, az as AiPlanSourceInput, aA as AiPlanSourceProduct, aB as AiPlanState, aC as ApiErrorBody, aD as AspectRatios, aE as AuthError, aF as ClientPlan, aG as CommentAuthor, aH as CommentChange, aI as ConnectSessionAccount, aJ as ContactChannel, aK as ContactError, aL as DashboardAiPlanRef, aM as DashboardPublicationRef, aN as DashboardRange, aO as EngagementBase, aP as FileError, aQ as FileFormat, aR as FileProperties, aS as FileType, aT as IntegrationCatalogProduct, aU as IntegrationConfig, aV as IntegrationError, aW as IntegrationErrorChange, aX as IntegrationFormField, aY as MessageChange, aZ as MessageEchoChange, a_ as MessageOptions, a$ as MessageType, b0 as MessagingError, b1 as MetricRow, b2 as NO_ERROR_CODE, b3 as OpenApiComponents, b4 as OpenApiOperations, b5 as OpenApiPaths, b6 as OpenApiWebhooks, b7 as OpenEnum, b8 as OrganizationError, b9 as PLANVORTEX_ERROR_RANGES, ba as PlanLimitError, bb as PlanVortexAuthenticationError, bc as PlanVortexConfigError, bd as PlanVortexConnectionError, be as PlanVortexError, bf as PlanVortexErrorOptions, bg as PlanVortexErrorRange, bh as PlannerTemplateField, bi as PlannerTemplateFieldType, bj as ProductError, bk as PublicationAiGenerated, bl as PublicationDestination, bm as PublicationError, bn as PublicationErrorDetail, bo as PublicationMetrics, bp as PublicationPending, bq as PublicationStatsPoint, br as PublicationType, bs as PublicationsSummary, bt as RssConfig, bu as SocialAuthorizationMethod, bv as SocialCredentials, bw as SocialIdentifier, bx as SocialIdentifierInput, by as SocialLimitsMap, bz as TOKEN_ERROR_CODES, bA as TopPublication, bB as UnknownWebhookChange, bC as UserError, bD as WebhookAlgorithm, bE as WebhookChange, bF as WebhookEvent, bG as WithAccount, bH as WithPublication, bI as WooCommerceConnectRequest, bJ as account, bK as accountId, bL as errorFamilyForCode, bM as isPlanVortexError, bN as isTokenError, bO as messageContact, bP as messageContactId, bQ as messageDirection, bR as messageFileIds, bS as messageFiles, bT as publication, bU as publicationId } from './index-BS-kMRg2.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Las dos constantes que todo lo demás necesita. Viven aparte de `index.ts` para que `client.ts`
|
|
@@ -15,7 +15,7 @@ declare const PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
|
|
|
15
15
|
* de ejecución obliga a empaquetarlo y se rompe distinto en ESM y en CJS. La mantiene sincronizada
|
|
16
16
|
* un test.
|
|
17
17
|
*/
|
|
18
|
-
declare const VERSION = "0.
|
|
18
|
+
declare const VERSION = "0.22.0";
|
|
19
19
|
|
|
20
20
|
/** `fetch` con la firma que usamos. Se puede sustituir en tests o para meter un proxy. */
|
|
21
21
|
type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
|
|
@@ -198,7 +198,7 @@ declare const MAX_PAGES = 10000;
|
|
|
198
198
|
* `catalog.socialCapabilities()`, aplicadas en el servidor: es la forma de pedir "las cuentas con
|
|
199
199
|
* las que puedo publicar" sin mantener tu propia tabla de qué red hace qué.
|
|
200
200
|
*/
|
|
201
|
-
type AccountCapability = "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments";
|
|
201
|
+
type AccountCapability = "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments" | "statistics";
|
|
202
202
|
interface AccountListOptions extends PageOptions {
|
|
203
203
|
/** Búsqueda libre sobre el nombre y el usuario de la cuenta. */
|
|
204
204
|
name?: string | undefined;
|
|
@@ -208,7 +208,9 @@ interface AccountListOptions extends PageOptions {
|
|
|
208
208
|
accounts?: readonly string[] | undefined;
|
|
209
209
|
/**
|
|
210
210
|
* Sólo las cuentas cuya red sabe hacer esto. `comments` mira además la cuenta: deja fuera los
|
|
211
|
-
* perfiles personales de LinkedIn, que no tienen bandeja aunque las páginas sí.
|
|
211
|
+
* perfiles personales de LinkedIn, que no tienen bandeja aunque las páginas sí. `statistics`
|
|
212
|
+
* deja fuera las redes de las que PlanVortex no lee ninguna métrica (hoy WhatsApp): son las
|
|
213
|
+
* cuentas que tiene sentido ofrecer en una pantalla de estadísticas.
|
|
212
214
|
*/
|
|
213
215
|
capability?: AccountCapability | undefined;
|
|
214
216
|
}
|
|
@@ -916,8 +918,8 @@ declare class CatalogResource extends Resource {
|
|
|
916
918
|
*/
|
|
917
919
|
allowedSocialMessages(options?: RequestOptions): Promise<SocialNetwork[]>;
|
|
918
920
|
/**
|
|
919
|
-
* La matriz red → qué sabe hacer: publicar, mensajes, productos, webhooks, menú persistente
|
|
920
|
-
* comentarios.
|
|
921
|
+
* La matriz red → qué sabe hacer: publicar, mensajes, productos, webhooks, menú persistente,
|
|
922
|
+
* comentarios y estadísticas (`statistics`, hoy todas menos WhatsApp).
|
|
921
923
|
*
|
|
922
924
|
* Es lo que evita ofrecer una cuenta en una pantalla que su red no soporta — WhatsApp en el
|
|
923
925
|
* compositor, LinkedIn en el chat.
|
|
@@ -1215,6 +1217,9 @@ declare class CommentsResource extends Resource {
|
|
|
1215
1217
|
* lo explica y {@link ContactsResource.merge} lo evita.
|
|
1216
1218
|
* - **Borrar un contacto borra también sus mensajes**, y borrar los de la organización los borra
|
|
1217
1219
|
* todos. No hay papelera.
|
|
1220
|
+
* - **En WhatsApp un contacto puede no tener teléfono.** Quien usa nombre de usuario puede no
|
|
1221
|
+
* darnos su número: su `external_identifier` es entonces su BSUID (`ES.1349...`, el mismo valor
|
|
1222
|
+
* que `user_id`), que no se enseña como si fuera un teléfono. Ver el tipo `SocialIdentifier`.
|
|
1218
1223
|
* - **Exige plan de pago** (error 516).
|
|
1219
1224
|
*/
|
|
1220
1225
|
|
|
@@ -1675,12 +1680,20 @@ declare class MessagesResource extends Resource {
|
|
|
1675
1680
|
* es, cuándo acaba el periodo), y los números están dentro, en `actual_plan.plan_data`. Mirar
|
|
1676
1681
|
* `plan_identifier` para saber los límites es el error clásico: un plan `custom` lleva los suyos.
|
|
1677
1682
|
*
|
|
1678
|
-
* Y el CONSUMO no viaja si no se pide: `actual_use` y `actual_asigned` sólo aparecen
|
|
1679
|
-
* `getUse: true`, porque contarlos es una agregación sobre todas las organizaciones del cliente.
|
|
1683
|
+
* Y el CONSUMO no viaja si no se pide: `actual_use`, `pool_use` y `actual_asigned` sólo aparecen
|
|
1684
|
+
* con `getUse: true`, porque contarlos es una agregación sobre todas las organizaciones del cliente.
|
|
1685
|
+
* Entre los tres parten el plan: `actual_use` es lo gastado en TODAS las organizaciones (lo que se
|
|
1686
|
+
* factura), `pool_use` lo gastado en la bolsa común (las organizaciones sin plan propio que tiran
|
|
1687
|
+
* del cliente) y `actual_asigned` lo cedido a las que tienen plan propio. Lo libre en la bolsa es
|
|
1688
|
+
* el plan menos los dos últimos.
|
|
1680
1689
|
*/
|
|
1681
1690
|
|
|
1682
1691
|
interface ClientListOptions extends PageOptions {
|
|
1683
|
-
/**
|
|
1692
|
+
/**
|
|
1693
|
+
* Trae también el consumo (`actual_use`, `pool_use` y `actual_asigned` en un cliente;
|
|
1694
|
+
* `actual_use`, `own_use` y `actual_asigned` en una organización). Cuesta una agregación: no lo
|
|
1695
|
+
* pidas por costumbre.
|
|
1696
|
+
*/
|
|
1684
1697
|
getUse?: boolean | undefined;
|
|
1685
1698
|
}
|
|
1686
1699
|
interface OrganizationListOptions extends ClientListOptions {
|
|
@@ -1749,7 +1762,10 @@ declare class ClientsResource extends Resource {
|
|
|
1749
1762
|
*/
|
|
1750
1763
|
|
|
1751
1764
|
interface OrganizationOptions extends RequestOptions {
|
|
1752
|
-
/**
|
|
1765
|
+
/**
|
|
1766
|
+
* Trae también `actual_use`, `own_use` y `actual_asigned`. Cuesta una agregación: no lo pidas
|
|
1767
|
+
* por costumbre.
|
|
1768
|
+
*/
|
|
1753
1769
|
getUse?: boolean | undefined;
|
|
1754
1770
|
}
|
|
1755
1771
|
interface ChildOrganizationListOptions extends OrganizationOptions, PageOptions {
|
|
@@ -1810,12 +1826,18 @@ declare class OrganizationsResource extends Resource {
|
|
|
1810
1826
|
/**
|
|
1811
1827
|
* El consumo de esta organización y lo que ya tiene repartido a sus hijas.
|
|
1812
1828
|
*
|
|
1813
|
-
* Es un atajo de `get(id, {getUse: true})` que devuelve sólo
|
|
1829
|
+
* Es un atajo de `get(id, {getUse: true})` que devuelve sólo esas cifras, que es lo que se
|
|
1814
1830
|
* quiere cuando se está pintando una barra de "3 de 5 cuentas".
|
|
1831
|
+
*
|
|
1832
|
+
* Ojo con cuál se pinta: `actual_use` es el de la BOLSA de la que tira la organización (ella
|
|
1833
|
+
* más las carpetas sin plan que gastan de ella), el mismo con el que el servidor decide si
|
|
1834
|
+
* cabe una cuenta más, así que todas las que comparten bolsa dan la misma cifra. Lo de ésta
|
|
1835
|
+
* sola es `own_use`, ausente con un servidor anterior a noviembre de 2026.
|
|
1815
1836
|
*/
|
|
1816
1837
|
use(idOrganization: string, options?: RequestOptions): Promise<{
|
|
1817
1838
|
actual_use: PlanUseData | undefined;
|
|
1818
1839
|
actual_asigned: PlanData | undefined;
|
|
1840
|
+
own_use: PlanUseData | undefined;
|
|
1819
1841
|
}>;
|
|
1820
1842
|
/**
|
|
1821
1843
|
* Emite el token temporal con el que **una persona** conecta una cuenta social a esta
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as Client, a0 as Organization, a1 as AiSettings, a2 as ClientWithOrganizations, a3 as AccountSelection, a4 as PlanData, a5 as PlanUseData, a6 as ConnectToken, a7 as AiContext, a8 as SocialCredentialsInput, a9 as Product, aa as ProductInput, ab as ProductCatalog, ac as ProductCatalogInput, ad as PublicationInput, ae as PublicationState, af as PublicationStats, ag as PublicationStatsHistory, ah as Upload } from './index-
|
|
2
|
-
export { ai as AccountError, aj as AccountMetricRow, ak as AccountStateChange, al as AccountWebhookChangeBase, am as AccountWithError, an as AiImageOrigin, ao as AiPlanCostEstimate, ap as AiPlanDestination, aq as AiPlanError, ar as AiPlanNotice, as as AiPlanOptions, at as AiPlanOptionsInput, au as AiPlanResult, av as AiPlanResultsGroup, aw as AiPlanResultsTemplateGroup, ax as AiPlanSource, ay as AiPlanSourceImageInput, az as AiPlanSourceInput, aA as AiPlanSourceProduct, aB as AiPlanState, aC as ApiErrorBody, aD as AspectRatios, aE as AuthError, aF as ClientPlan, aG as CommentAuthor, aH as CommentChange, aI as ConnectSessionAccount, aJ as ContactChannel, aK as ContactError, aL as DashboardAiPlanRef, aM as DashboardPublicationRef, aN as DashboardRange, aO as EngagementBase, aP as FileError, aQ as FileFormat, aR as FileProperties, aS as FileType, aT as IntegrationCatalogProduct, aU as IntegrationConfig, aV as IntegrationError, aW as IntegrationErrorChange, aX as IntegrationFormField, aY as MessageChange, aZ as MessageEchoChange, a_ as MessageOptions, a$ as MessageType, b0 as MessagingError, b1 as MetricRow, b2 as NO_ERROR_CODE, b3 as OpenApiComponents, b4 as OpenApiOperations, b5 as OpenApiPaths, b6 as OpenApiWebhooks, b7 as OpenEnum, b8 as OrganizationError, b9 as PLANVORTEX_ERROR_RANGES, ba as PlanLimitError, bb as PlanVortexAuthenticationError, bc as PlanVortexConfigError, bd as PlanVortexConnectionError, be as PlanVortexError, bf as PlanVortexErrorOptions, bg as PlanVortexErrorRange, bh as PlannerTemplateField, bi as PlannerTemplateFieldType, bj as ProductError, bk as PublicationAiGenerated, bl as PublicationDestination, bm as PublicationError, bn as PublicationErrorDetail, bo as PublicationMetrics, bp as PublicationPending, bq as PublicationStatsPoint, br as PublicationType, bs as PublicationsSummary, bt as RssConfig, bu as SocialAuthorizationMethod, bv as SocialCredentials, bw as SocialIdentifier, bx as SocialIdentifierInput, by as SocialLimitsMap, bz as TOKEN_ERROR_CODES, bA as TopPublication, bB as UnknownWebhookChange, bC as UserError, bD as WebhookAlgorithm, bE as WebhookChange, bF as WebhookEvent, bG as WithAccount, bH as WithPublication, bI as WooCommerceConnectRequest, bJ as account, bK as accountId, bL as errorFamilyForCode, bM as isPlanVortexError, bN as isTokenError, bO as messageContact, bP as messageContactId, bQ as messageDirection, bR as messageFileIds, bS as messageFiles, bT as publication, bU as publicationId } from './index-
|
|
1
|
+
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as Client, a0 as Organization, a1 as AiSettings, a2 as ClientWithOrganizations, a3 as AccountSelection, a4 as PlanData, a5 as PlanUseData, a6 as ConnectToken, a7 as AiContext, a8 as SocialCredentialsInput, a9 as Product, aa as ProductInput, ab as ProductCatalog, ac as ProductCatalogInput, ad as PublicationInput, ae as PublicationState, af as PublicationStats, ag as PublicationStatsHistory, ah as Upload } from './index-BS-kMRg2.js';
|
|
2
|
+
export { ai as AccountError, aj as AccountMetricRow, ak as AccountStateChange, al as AccountWebhookChangeBase, am as AccountWithError, an as AiImageOrigin, ao as AiPlanCostEstimate, ap as AiPlanDestination, aq as AiPlanError, ar as AiPlanNotice, as as AiPlanOptions, at as AiPlanOptionsInput, au as AiPlanResult, av as AiPlanResultsGroup, aw as AiPlanResultsTemplateGroup, ax as AiPlanSource, ay as AiPlanSourceImageInput, az as AiPlanSourceInput, aA as AiPlanSourceProduct, aB as AiPlanState, aC as ApiErrorBody, aD as AspectRatios, aE as AuthError, aF as ClientPlan, aG as CommentAuthor, aH as CommentChange, aI as ConnectSessionAccount, aJ as ContactChannel, aK as ContactError, aL as DashboardAiPlanRef, aM as DashboardPublicationRef, aN as DashboardRange, aO as EngagementBase, aP as FileError, aQ as FileFormat, aR as FileProperties, aS as FileType, aT as IntegrationCatalogProduct, aU as IntegrationConfig, aV as IntegrationError, aW as IntegrationErrorChange, aX as IntegrationFormField, aY as MessageChange, aZ as MessageEchoChange, a_ as MessageOptions, a$ as MessageType, b0 as MessagingError, b1 as MetricRow, b2 as NO_ERROR_CODE, b3 as OpenApiComponents, b4 as OpenApiOperations, b5 as OpenApiPaths, b6 as OpenApiWebhooks, b7 as OpenEnum, b8 as OrganizationError, b9 as PLANVORTEX_ERROR_RANGES, ba as PlanLimitError, bb as PlanVortexAuthenticationError, bc as PlanVortexConfigError, bd as PlanVortexConnectionError, be as PlanVortexError, bf as PlanVortexErrorOptions, bg as PlanVortexErrorRange, bh as PlannerTemplateField, bi as PlannerTemplateFieldType, bj as ProductError, bk as PublicationAiGenerated, bl as PublicationDestination, bm as PublicationError, bn as PublicationErrorDetail, bo as PublicationMetrics, bp as PublicationPending, bq as PublicationStatsPoint, br as PublicationType, bs as PublicationsSummary, bt as RssConfig, bu as SocialAuthorizationMethod, bv as SocialCredentials, bw as SocialIdentifier, bx as SocialIdentifierInput, by as SocialLimitsMap, bz as TOKEN_ERROR_CODES, bA as TopPublication, bB as UnknownWebhookChange, bC as UserError, bD as WebhookAlgorithm, bE as WebhookChange, bF as WebhookEvent, bG as WithAccount, bH as WithPublication, bI as WooCommerceConnectRequest, bJ as account, bK as accountId, bL as errorFamilyForCode, bM as isPlanVortexError, bN as isTokenError, bO as messageContact, bP as messageContactId, bQ as messageDirection, bR as messageFileIds, bS as messageFiles, bT as publication, bU as publicationId } from './index-BS-kMRg2.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Las dos constantes que todo lo demás necesita. Viven aparte de `index.ts` para que `client.ts`
|
|
@@ -15,7 +15,7 @@ declare const PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
|
|
|
15
15
|
* de ejecución obliga a empaquetarlo y se rompe distinto en ESM y en CJS. La mantiene sincronizada
|
|
16
16
|
* un test.
|
|
17
17
|
*/
|
|
18
|
-
declare const VERSION = "0.
|
|
18
|
+
declare const VERSION = "0.22.0";
|
|
19
19
|
|
|
20
20
|
/** `fetch` con la firma que usamos. Se puede sustituir en tests o para meter un proxy. */
|
|
21
21
|
type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
|
|
@@ -198,7 +198,7 @@ declare const MAX_PAGES = 10000;
|
|
|
198
198
|
* `catalog.socialCapabilities()`, aplicadas en el servidor: es la forma de pedir "las cuentas con
|
|
199
199
|
* las que puedo publicar" sin mantener tu propia tabla de qué red hace qué.
|
|
200
200
|
*/
|
|
201
|
-
type AccountCapability = "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments";
|
|
201
|
+
type AccountCapability = "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments" | "statistics";
|
|
202
202
|
interface AccountListOptions extends PageOptions {
|
|
203
203
|
/** Búsqueda libre sobre el nombre y el usuario de la cuenta. */
|
|
204
204
|
name?: string | undefined;
|
|
@@ -208,7 +208,9 @@ interface AccountListOptions extends PageOptions {
|
|
|
208
208
|
accounts?: readonly string[] | undefined;
|
|
209
209
|
/**
|
|
210
210
|
* Sólo las cuentas cuya red sabe hacer esto. `comments` mira además la cuenta: deja fuera los
|
|
211
|
-
* perfiles personales de LinkedIn, que no tienen bandeja aunque las páginas sí.
|
|
211
|
+
* perfiles personales de LinkedIn, que no tienen bandeja aunque las páginas sí. `statistics`
|
|
212
|
+
* deja fuera las redes de las que PlanVortex no lee ninguna métrica (hoy WhatsApp): son las
|
|
213
|
+
* cuentas que tiene sentido ofrecer en una pantalla de estadísticas.
|
|
212
214
|
*/
|
|
213
215
|
capability?: AccountCapability | undefined;
|
|
214
216
|
}
|
|
@@ -916,8 +918,8 @@ declare class CatalogResource extends Resource {
|
|
|
916
918
|
*/
|
|
917
919
|
allowedSocialMessages(options?: RequestOptions): Promise<SocialNetwork[]>;
|
|
918
920
|
/**
|
|
919
|
-
* La matriz red → qué sabe hacer: publicar, mensajes, productos, webhooks, menú persistente
|
|
920
|
-
* comentarios.
|
|
921
|
+
* La matriz red → qué sabe hacer: publicar, mensajes, productos, webhooks, menú persistente,
|
|
922
|
+
* comentarios y estadísticas (`statistics`, hoy todas menos WhatsApp).
|
|
921
923
|
*
|
|
922
924
|
* Es lo que evita ofrecer una cuenta en una pantalla que su red no soporta — WhatsApp en el
|
|
923
925
|
* compositor, LinkedIn en el chat.
|
|
@@ -1215,6 +1217,9 @@ declare class CommentsResource extends Resource {
|
|
|
1215
1217
|
* lo explica y {@link ContactsResource.merge} lo evita.
|
|
1216
1218
|
* - **Borrar un contacto borra también sus mensajes**, y borrar los de la organización los borra
|
|
1217
1219
|
* todos. No hay papelera.
|
|
1220
|
+
* - **En WhatsApp un contacto puede no tener teléfono.** Quien usa nombre de usuario puede no
|
|
1221
|
+
* darnos su número: su `external_identifier` es entonces su BSUID (`ES.1349...`, el mismo valor
|
|
1222
|
+
* que `user_id`), que no se enseña como si fuera un teléfono. Ver el tipo `SocialIdentifier`.
|
|
1218
1223
|
* - **Exige plan de pago** (error 516).
|
|
1219
1224
|
*/
|
|
1220
1225
|
|
|
@@ -1675,12 +1680,20 @@ declare class MessagesResource extends Resource {
|
|
|
1675
1680
|
* es, cuándo acaba el periodo), y los números están dentro, en `actual_plan.plan_data`. Mirar
|
|
1676
1681
|
* `plan_identifier` para saber los límites es el error clásico: un plan `custom` lleva los suyos.
|
|
1677
1682
|
*
|
|
1678
|
-
* Y el CONSUMO no viaja si no se pide: `actual_use` y `actual_asigned` sólo aparecen
|
|
1679
|
-
* `getUse: true`, porque contarlos es una agregación sobre todas las organizaciones del cliente.
|
|
1683
|
+
* Y el CONSUMO no viaja si no se pide: `actual_use`, `pool_use` y `actual_asigned` sólo aparecen
|
|
1684
|
+
* con `getUse: true`, porque contarlos es una agregación sobre todas las organizaciones del cliente.
|
|
1685
|
+
* Entre los tres parten el plan: `actual_use` es lo gastado en TODAS las organizaciones (lo que se
|
|
1686
|
+
* factura), `pool_use` lo gastado en la bolsa común (las organizaciones sin plan propio que tiran
|
|
1687
|
+
* del cliente) y `actual_asigned` lo cedido a las que tienen plan propio. Lo libre en la bolsa es
|
|
1688
|
+
* el plan menos los dos últimos.
|
|
1680
1689
|
*/
|
|
1681
1690
|
|
|
1682
1691
|
interface ClientListOptions extends PageOptions {
|
|
1683
|
-
/**
|
|
1692
|
+
/**
|
|
1693
|
+
* Trae también el consumo (`actual_use`, `pool_use` y `actual_asigned` en un cliente;
|
|
1694
|
+
* `actual_use`, `own_use` y `actual_asigned` en una organización). Cuesta una agregación: no lo
|
|
1695
|
+
* pidas por costumbre.
|
|
1696
|
+
*/
|
|
1684
1697
|
getUse?: boolean | undefined;
|
|
1685
1698
|
}
|
|
1686
1699
|
interface OrganizationListOptions extends ClientListOptions {
|
|
@@ -1749,7 +1762,10 @@ declare class ClientsResource extends Resource {
|
|
|
1749
1762
|
*/
|
|
1750
1763
|
|
|
1751
1764
|
interface OrganizationOptions extends RequestOptions {
|
|
1752
|
-
/**
|
|
1765
|
+
/**
|
|
1766
|
+
* Trae también `actual_use`, `own_use` y `actual_asigned`. Cuesta una agregación: no lo pidas
|
|
1767
|
+
* por costumbre.
|
|
1768
|
+
*/
|
|
1753
1769
|
getUse?: boolean | undefined;
|
|
1754
1770
|
}
|
|
1755
1771
|
interface ChildOrganizationListOptions extends OrganizationOptions, PageOptions {
|
|
@@ -1810,12 +1826,18 @@ declare class OrganizationsResource extends Resource {
|
|
|
1810
1826
|
/**
|
|
1811
1827
|
* El consumo de esta organización y lo que ya tiene repartido a sus hijas.
|
|
1812
1828
|
*
|
|
1813
|
-
* Es un atajo de `get(id, {getUse: true})` que devuelve sólo
|
|
1829
|
+
* Es un atajo de `get(id, {getUse: true})` que devuelve sólo esas cifras, que es lo que se
|
|
1814
1830
|
* quiere cuando se está pintando una barra de "3 de 5 cuentas".
|
|
1831
|
+
*
|
|
1832
|
+
* Ojo con cuál se pinta: `actual_use` es el de la BOLSA de la que tira la organización (ella
|
|
1833
|
+
* más las carpetas sin plan que gastan de ella), el mismo con el que el servidor decide si
|
|
1834
|
+
* cabe una cuenta más, así que todas las que comparten bolsa dan la misma cifra. Lo de ésta
|
|
1835
|
+
* sola es `own_use`, ausente con un servidor anterior a noviembre de 2026.
|
|
1815
1836
|
*/
|
|
1816
1837
|
use(idOrganization: string, options?: RequestOptions): Promise<{
|
|
1817
1838
|
actual_use: PlanUseData | undefined;
|
|
1818
1839
|
actual_asigned: PlanData | undefined;
|
|
1840
|
+
own_use: PlanUseData | undefined;
|
|
1819
1841
|
}>;
|
|
1820
1842
|
/**
|
|
1821
1843
|
* Emite el token temporal con el que **una persona** conecta una cuenta social a esta
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createErrorFromResponse, NO_ERROR_CODE, PlanVortexError, PlanVortexConfigError, isTokenError, PlanVortexConnectionError, PlanVortexAuthenticationError, isPlanVortexError } from './chunk-
|
|
2
|
-
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, errorFamilyForCode, isPlanVortexError, isTokenError } from './chunk-
|
|
1
|
+
import { createErrorFromResponse, NO_ERROR_CODE, PlanVortexError, PlanVortexConfigError, isTokenError, PlanVortexConnectionError, PlanVortexAuthenticationError, isPlanVortexError } from './chunk-A77VAAQH.js';
|
|
2
|
+
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, errorFamilyForCode, isPlanVortexError, isTokenError } from './chunk-A77VAAQH.js';
|
|
3
3
|
import { basename } from 'path';
|
|
4
4
|
|
|
5
5
|
// src/version.ts
|
|
6
6
|
var PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
|
|
7
|
-
var VERSION = "0.
|
|
7
|
+
var VERSION = "0.22.0";
|
|
8
8
|
|
|
9
9
|
// src/core/auth.ts
|
|
10
10
|
var TOKEN_REFRESH_MARGIN_MS = 6e4;
|
|
@@ -1174,8 +1174,8 @@ var CatalogResource = class extends Resource {
|
|
|
1174
1174
|
);
|
|
1175
1175
|
}
|
|
1176
1176
|
/**
|
|
1177
|
-
* La matriz red → qué sabe hacer: publicar, mensajes, productos, webhooks, menú persistente
|
|
1178
|
-
* comentarios.
|
|
1177
|
+
* La matriz red → qué sabe hacer: publicar, mensajes, productos, webhooks, menú persistente,
|
|
1178
|
+
* comentarios y estadísticas (`statistics`, hoy todas menos WhatsApp).
|
|
1179
1179
|
*
|
|
1180
1180
|
* Es lo que evita ofrecer una cuenta en una pantalla que su red no soporta — WhatsApp en el
|
|
1181
1181
|
* compositor, LinkedIn en el chat.
|
|
@@ -2325,12 +2325,21 @@ var OrganizationsResource = class extends Resource {
|
|
|
2325
2325
|
/**
|
|
2326
2326
|
* El consumo de esta organización y lo que ya tiene repartido a sus hijas.
|
|
2327
2327
|
*
|
|
2328
|
-
* Es un atajo de `get(id, {getUse: true})` que devuelve sólo
|
|
2328
|
+
* Es un atajo de `get(id, {getUse: true})` que devuelve sólo esas cifras, que es lo que se
|
|
2329
2329
|
* quiere cuando se está pintando una barra de "3 de 5 cuentas".
|
|
2330
|
+
*
|
|
2331
|
+
* Ojo con cuál se pinta: `actual_use` es el de la BOLSA de la que tira la organización (ella
|
|
2332
|
+
* más las carpetas sin plan que gastan de ella), el mismo con el que el servidor decide si
|
|
2333
|
+
* cabe una cuenta más, así que todas las que comparten bolsa dan la misma cifra. Lo de ésta
|
|
2334
|
+
* sola es `own_use`, ausente con un servidor anterior a noviembre de 2026.
|
|
2330
2335
|
*/
|
|
2331
2336
|
async use(idOrganization, options = {}) {
|
|
2332
2337
|
const organization = await this.get(idOrganization, { ...options, getUse: true });
|
|
2333
|
-
return {
|
|
2338
|
+
return {
|
|
2339
|
+
actual_use: organization.actual_use,
|
|
2340
|
+
actual_asigned: organization.actual_asigned,
|
|
2341
|
+
own_use: organization.own_use
|
|
2342
|
+
};
|
|
2334
2343
|
}
|
|
2335
2344
|
/**
|
|
2336
2345
|
* Emite el token temporal con el que **una persona** conecta una cuenta social a esta
|