planvortex 0.14.0 → 0.16.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 +14 -5
- package/dist/{chunk-4EPTOW4H.js → chunk-CXCJAVXQ.js} +7 -3
- package/dist/chunk-CXCJAVXQ.js.map +1 -0
- package/dist/{index-C6-SJxzP.d.cts → index-DgRGeYRl.d.cts} +248 -26
- package/dist/{index-C6-SJxzP.d.ts → index-DgRGeYRl.d.ts} +248 -26
- package/dist/index.cjs +11 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -10
- package/dist/index.d.ts +20 -10
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/webhooks/index.cjs +13 -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 +9 -3
- package/dist/webhooks/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4EPTOW4H.js.map +0 -1
|
@@ -367,7 +367,7 @@ interface paths {
|
|
|
367
367
|
put?: never;
|
|
368
368
|
/**
|
|
369
369
|
* Create an AI publication plan
|
|
370
|
-
* @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). With a Pinterest account in the plan, two more checks run at creation: every Pinterest account needs its board in `destinations` (2118), and a configuration that would leave pins without an image is refused (2119).
|
|
370
|
+
* @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job. When it finishes, your app's `webhook_url` receives `ai_plan_generated` or `ai_plan_failed` (the payload is in the comments specification, `AiPlanWebhookChange`); without a webhook, poll GET by id while state is pending or generating. The webhook is best effort and not retried, so the GET is still the source of truth. 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). With a Pinterest account in the plan, two more checks run at creation: every Pinterest account needs its board in `destinations` (2118), and a configuration that would leave pins without an image is refused (2119).
|
|
371
371
|
*/
|
|
372
372
|
post: operations["addAiPlan"];
|
|
373
373
|
delete?: never;
|
|
@@ -385,7 +385,7 @@ interface paths {
|
|
|
385
385
|
};
|
|
386
386
|
/**
|
|
387
387
|
* Get an AI publication plan by id
|
|
388
|
-
* @description Return a single AI plan with its generated publications populated.
|
|
388
|
+
* @description Return a single AI plan with its generated publications populated. Read it when your app receives `ai_plan_generated` or `ai_plan_failed`. Without a webhook, this is the endpoint to poll while state is pending or generating. The webhook is not retried, so if your endpoint was down when the plan finished, this GET still tells you how it ended. Requires the ai_plans:read permission.
|
|
389
389
|
*/
|
|
390
390
|
get: operations["getAiPlan"];
|
|
391
391
|
put?: never;
|
|
@@ -463,7 +463,7 @@ interface paths {
|
|
|
463
463
|
put?: never;
|
|
464
464
|
/**
|
|
465
465
|
* Retry a failed AI publication plan
|
|
466
|
-
* @description Re-queue a failed plan: it goes back to state 'pending' (attempts and error reset) and the background job regenerates it with the SAME data (prompt, accounts, options).
|
|
466
|
+
* @description Re-queue a failed plan: it goes back to state 'pending' (attempts and error reset) and the background job regenerates it with the SAME data (prompt, accounts, options). As after creation, the end arrives on your webhook as `ai_plan_generated` or `ai_plan_failed`; without one, poll the plan while state is pending or generating. Only valid from state 'failed'. Already-spent credits are NOT refunded and a new generation spends again; drafts left over from the failed attempt are discarded by the generation itself. If the failure was a business error (no AI credits, no monthly publication slots), retrying will fail the same way. Requires the ai_plans:update permission.
|
|
467
467
|
*/
|
|
468
468
|
post: operations["retryAiPlan"];
|
|
469
469
|
delete?: never;
|
|
@@ -1242,7 +1242,9 @@ interface paths {
|
|
|
1242
1242
|
put?: never;
|
|
1243
1243
|
/**
|
|
1244
1244
|
* Create new publications
|
|
1245
|
-
* @description Create new publications. For X (Twitter) accounts, paid actions consume the client's monthly X credit pool (shared across organizations). When a publication is sent immediately, the required credits are checked before publishing and only charged on success. A tweet costs 15 credits, or 200 credits if its text contains a link. Link detection uses the same rule the backend applies: an http(s):// URL, a www. host, or a bare domain with a recognized TLD (regex TWITTER_LINK_REGEX). A scheduled publication does not consume credits when created; it is charged when the background job publishes it. If there are not enough credits at publish time the scheduled publication is left in state 'withErrors' with publication_errors.code = 940 and
|
|
1245
|
+
* @description Create new publications. For X (Twitter) accounts, paid actions consume the client's monthly X credit pool (shared across organizations). When a publication is sent immediately, the required credits are checked before publishing and only charged on success. A tweet costs 15 credits, or 200 credits if its text contains a link. Link detection uses the same rule the backend applies: an http(s):// URL, a www. host, or a bare domain with a recognized TLD (regex TWITTER_LINK_REGEX). A scheduled publication does not consume credits when created; it is charged when the background job publishes it. If there are not enough credits at publish time the scheduled publication is left in state 'withErrors' with publication_errors.code = 940 (it is never thrown, and no webhook announces it: read the publication to find out). Publishing immediately without enough credits returns error 940.
|
|
1246
|
+
*
|
|
1247
|
+
* **An Instagram video can come back in state `publishing`, and that is not an error.** Instagram processes a video before it can be published, and the request waits about 30 seconds for it. If Meta has not finished by then, the response carries `state: "publishing"` and a `pending_publish` object, and PlanVortex keeps asking Instagram about once a minute in the background, for up to 10 minutes. Read the publication again (`GET /organizations/{id_organization}/publish/{id_publication}`) after `pending_publish.next_check` until it is `sended` or `withErrors`. **Do not retry it or create it again**: the first one is still on its way, and a second one would publish the video twice.
|
|
1246
1248
|
*/
|
|
1247
1249
|
post: operations["addPublication"];
|
|
1248
1250
|
delete?: never;
|
|
@@ -1992,6 +1994,8 @@ interface paths {
|
|
|
1992
1994
|
* @description Delete publication by identifier. It stops being readable by identifier afterwards, so deleting twice answers error 917. For an already-sent X (Twitter) publication, removing the tweet on X is a paid action that consumes 15 X credits; it is only removed on X when there are enough credits. Returns error 940 when the X credit pool is exhausted.
|
|
1993
1995
|
*
|
|
1994
1996
|
* **On Telegram there is a 48-hour window.** Past it the Bot API refuses to delete a message whatever the bot's role is, and the answer is error 966 with `published_date` and `max_hours` in `data` — so the sensible thing is to grey the button out rather than offer it and fail. Error 969 is the other case: the bot is no longer allowed to delete there. And an album is several messages: all of them go, or the post would be left half-published in the channel.
|
|
1997
|
+
*
|
|
1998
|
+
* **Deleting a publication that is still `publishing` with `pending_publish` stops it**: PlanVortex stops asking Instagram and never publishes it, unless the check running at that very moment has already done so.
|
|
1995
1999
|
*/
|
|
1996
2000
|
delete: operations["deletePublication"];
|
|
1997
2001
|
options?: never;
|
|
@@ -2062,7 +2066,9 @@ interface paths {
|
|
|
2062
2066
|
* Retry a failed publication
|
|
2063
2067
|
* @description Sends a publication that ended in state `withErrors` to its social network again, WITHOUT changing its content.
|
|
2064
2068
|
*
|
|
2065
|
-
* The publication is sent during the request, so the response already carries the outcome: `state: "sended"` if it went out, or `state: "withErrors"` with the errors of THIS attempt if it failed again.
|
|
2069
|
+
* The publication is sent during the request, so the response already carries the outcome: `state: "sended"` if it went out, or `state: "withErrors"` with the errors of THIS attempt if it failed again. An Instagram video can also come back in `publishing` with `pending_publish`: the attempt goes on in the background, and the retry is already spent (see `pending_publish` in `Publication`).
|
|
2070
|
+
*
|
|
2071
|
+
* On Instagram, a retry is worth it after a **999** (Meta ran out of time) and pointless after a **998** (Meta rejected the file): change the file with a `PUT` first. A scheduled publication whose date has not arrived yet goes back to `ready` and the scheduler picks it up at its time.
|
|
2066
2072
|
*
|
|
2067
2073
|
* Every accepted call spends one retry, even when the publication fails again — what the endpoint promises is an attempt, not a success. The limit is `max_retries`, also served by `GET /publication_limits`. Once it is spent the way to try again is to update the publication (`PUT`), which resets the counter to 0, or to create a new one.
|
|
2068
2074
|
*/
|
|
@@ -2670,9 +2676,9 @@ interface webhooks {
|
|
|
2670
2676
|
* A change happened (notification to your app)
|
|
2671
2677
|
* @description PlanVortex `POST`s to the `webhook_url` of your client app when something happens. **The body is an array of changes**, and each one carries `field` telling you what it is — switch on it and ignore what you do not handle, because the list grows with the product.
|
|
2672
2678
|
*
|
|
2673
|
-
*
|
|
2679
|
+
* Three shapes travel in that array. A change on an **account** (`WebhookChange`) always carries `id_account`, `id_organization` and `social_network`. A change on an **integration** (`IntegrationWebhookChange`) and the end of an **AI plan** (`AiPlanWebhookChange`) carry none of those, because they hang off the organization and not off any account.
|
|
2674
2680
|
*
|
|
2675
|
-
* The events delivered today are `new_account`, `change_state_account`, `messages`, `messaging_postbacks`, `messaging_seen`, `messaging_error`, `comments` and `
|
|
2681
|
+
* The events delivered today are `new_account`, `change_state_account`, `messages`, `messaging_postbacks`, `messaging_seen`, `messaging_error`, `comments`, `integration_error`, `ai_plan_generated` and `ai_plan_failed`.
|
|
2676
2682
|
*
|
|
2677
2683
|
* ### Comments
|
|
2678
2684
|
*
|
|
@@ -2682,6 +2688,14 @@ interface webhooks {
|
|
|
2682
2688
|
*
|
|
2683
2689
|
* **Meta repeats deliveries.** The same comment can arrive more than once; the backend is idempotent about it and so should you be — deduplicate on `commentObj.external_id`.
|
|
2684
2690
|
*
|
|
2691
|
+
* ### AI plans
|
|
2692
|
+
*
|
|
2693
|
+
* `ai_plan_generated` and `ai_plan_failed` say that a plan has **finished**: it was generated, or it gave up. Instead of polling the plan every few seconds, wait for one of these and then read it once with `GET /clients/{id_client}/organizations/{id_organization}/ai_plans/{id_ai_plan}`. The change carries ids and numbers only, never the prompt or the generated text, so the publications are in that `GET`.
|
|
2694
|
+
*
|
|
2695
|
+
* A plan that hits a transient error goes back to the queue and is retried. That is not an end and sends nothing, so each plan sends **one** of these two events, never a `failed` followed by a `generated`. A plan generated with notices (`warnings` above zero) is still `ai_plan_generated`: it is usable, and the notices are in the plan.
|
|
2696
|
+
*
|
|
2697
|
+
* The event goes to **every** app of the client that has a `webhook_url`, not only to the one that created the plan. And it is not retried: if your endpoint was down when the plan finished, the `GET` still tells you how it ended, so on startup read the plans you were waiting for.
|
|
2698
|
+
*
|
|
2685
2699
|
* ### Verifying the signature
|
|
2686
2700
|
*
|
|
2687
2701
|
* Every delivery carries the body signed with your app's secret, twice:
|
|
@@ -2708,6 +2722,8 @@ interface components {
|
|
|
2708
2722
|
*
|
|
2709
2723
|
* On `discord`, on `telegram` and on `slack` an account is a **channel**, not a profile: publishing to two Discord channels of the same server — or to two Telegram channels of the same brand, or to `#anuncios` and `#general` of the same Slack workspace — costs two accounts of the plan.
|
|
2710
2724
|
*
|
|
2725
|
+
* On `linkedin` one authorization brings two kinds of account: the **personal profile** of whoever authorizes and each **page** they manage. Both publish and both have statistics, but only pages have a comment inbox: LinkedIn does not let any app read the comments on a member's posts, so on a profile every comment endpoint returns error `2600`. `extra_data.is_personal_profile` tells them apart.
|
|
2726
|
+
*
|
|
2711
2727
|
* `error_code` other than `0` means the connection is broken — an expired token, a permission taken away — and the account has to be connected again. On `telegram` nothing expires, because there is no account token: what breaks the connection is the bot being removed from the channel or losing its permission to post there (error 968). On `slack` the bot token does not expire either: what breaks it is the app being removed from the channel (error 980) or the channel being archived or deleted (error 985).
|
|
2712
2728
|
*/
|
|
2713
2729
|
Account: {
|
|
@@ -2716,6 +2732,13 @@ interface components {
|
|
|
2716
2732
|
creation_date: string;
|
|
2717
2733
|
/** @description `0` is a healthy account. Anything else is a PlanVortex error code explaining why the connection stopped working; the account keeps its data but cannot be used until it is reconnected. */
|
|
2718
2734
|
error_code: number;
|
|
2735
|
+
/** @description What only makes sense on this account's network. Only the keys documented here are part of the contract: anything else in the object can change without notice. */
|
|
2736
|
+
extra_data?: {
|
|
2737
|
+
/** @description `linkedin` only. `true` on the personal profile of whoever authorized, `false` on a page. A profile publishes and has statistics but no comment inbox (error `2600`). Pages connected before personal profiles existed do not carry it, so treat absent as a page. */
|
|
2738
|
+
is_personal_profile?: boolean;
|
|
2739
|
+
} & {
|
|
2740
|
+
[key: string]: unknown;
|
|
2741
|
+
};
|
|
2719
2742
|
/** @description Followers the network reports. Absent on an account that has never been measured. On `telegram` and on `slack` it is the channel's member count, and it is the **only** audience figure either network publishes: there are no views, no impressions and no reach anywhere in the Bot API nor in the Slack Web API. */
|
|
2720
2743
|
followers_count?: number;
|
|
2721
2744
|
/** @description The client the organization hangs from. Denormalized here for the plan checks. */
|
|
@@ -3044,7 +3067,7 @@ interface components {
|
|
|
3044
3067
|
/** @description The source snapshot. Absent on a `standard` plan, which has no source. */
|
|
3045
3068
|
source?: components["schemas"]["AiPlansAiPlanSource"];
|
|
3046
3069
|
/**
|
|
3047
|
-
* @description State machine: pending -> generating -> generated -> validated | failed | cancelled.
|
|
3070
|
+
* @description State machine: pending -> generating -> generated -> validated | failed | cancelled. Reaching `generated` or `failed` is announced to your app's webhook (`ai_plan_generated`, `ai_plan_failed`); without one, poll the plan while state is pending or generating.
|
|
3048
3071
|
* @enum {string}
|
|
3049
3072
|
*/
|
|
3050
3073
|
state: "pending" | "generating" | "generated" | "validated" | "failed" | "cancelled";
|
|
@@ -3355,7 +3378,7 @@ interface components {
|
|
|
3355
3378
|
*
|
|
3356
3379
|
* **The body is an array of changes, not a single object**, and it carries two signature headers computed with this app's secret over the **raw** body: `x-hub-signature` (`sha1=<hex>`) and `x-hub-signature-256` (`sha256=<hex>`). Verify against the bytes you received — parsing the JSON and re-serialising it changes them and the signature will not match.
|
|
3357
3380
|
*
|
|
3358
|
-
* The events delivered today are `new_account`, `change_state_account`, `messages`, `messaging_postbacks`, `messaging_seen`, `messaging_error`, `comments` and `
|
|
3381
|
+
* The events delivered today are `new_account`, `change_state_account`, `messages`, `messaging_postbacks`, `messaging_seen`, `messaging_error`, `comments`, `integration_error`, `ai_plan_generated` and `ai_plan_failed`. The payload is documented in the `comments` specification. **Every** app of the client that has a `webhook_url` receives every event, not only the app whose call caused it: with two apps, each event arrives twice. Delivery is best effort: PlanVortex does not retry a webhook that fails.
|
|
3359
3382
|
*/
|
|
3360
3383
|
webhook_url?: string;
|
|
3361
3384
|
};
|
|
@@ -3645,6 +3668,40 @@ interface components {
|
|
|
3645
3668
|
total?: number;
|
|
3646
3669
|
users?: components["schemas"]["ClientsRolesUser"][];
|
|
3647
3670
|
};
|
|
3671
|
+
/**
|
|
3672
|
+
* @description One change in the array PlanVortex posts to your app's `webhook_url`, when an **AI plan finished**: `ai_plan_generated` when it came out, `ai_plan_failed` when it gave up.
|
|
3673
|
+
*
|
|
3674
|
+
* Like `IntegrationWebhookChange`, it carries no `id_account` and no `social_network`: a plan can span several networks, and it hangs off the organization. It carries ids and numbers only. Read the plan itself with `GET /clients/{id_client}/organizations/{id_organization}/ai_plans/{id_ai_plan}`.
|
|
3675
|
+
*/
|
|
3676
|
+
CommentsAiPlanWebhookChange: {
|
|
3677
|
+
/** @description AI credits the generation consumed, the same figure as `AiPlan.credits_spent`. A failed plan can have spent credits too, and they are not refunded. */
|
|
3678
|
+
credits_spent: number;
|
|
3679
|
+
/** @description Only on `ai_plan_failed`: why the plan failed, the same `code` and `message` as `AiPlan.error`. Its `data` does not travel here; read the plan for it. */
|
|
3680
|
+
error?: components["schemas"]["CommentsAiPlanWebhookError"];
|
|
3681
|
+
/** @enum {string} */
|
|
3682
|
+
field: "ai_plan_generated" | "ai_plan_failed";
|
|
3683
|
+
id_ai_plan: string;
|
|
3684
|
+
id_organization: string;
|
|
3685
|
+
/**
|
|
3686
|
+
* @description The state the plan finished in. It always matches `field`: `generated` with `ai_plan_generated`, `failed` with `ai_plan_failed`.
|
|
3687
|
+
* @enum {string}
|
|
3688
|
+
*/
|
|
3689
|
+
state: "generated" | "failed";
|
|
3690
|
+
/**
|
|
3691
|
+
* @description What the plan was generated from, the same value as `AiPlan.template`.
|
|
3692
|
+
* @enum {string}
|
|
3693
|
+
*/
|
|
3694
|
+
template: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
3695
|
+
/** @description How many draft publications the plan holds. A failed plan can still hold the drafts of its failed attempt; retrying it discards them. */
|
|
3696
|
+
total_publications: number;
|
|
3697
|
+
/** @description **How many** non-blocking notices the plan has, not the notices themselves: those are in `AiPlan.warnings`. Above zero the plan is still generated and usable. */
|
|
3698
|
+
warnings: number;
|
|
3699
|
+
};
|
|
3700
|
+
/** @description Why an AI plan failed, inside `AiPlanWebhookChange.error`: the same `code` and `message` as `AiPlan.error`. Its `data` is left out, because it can carry what the AI provider answered; read the plan for it. */
|
|
3701
|
+
CommentsAiPlanWebhookError: {
|
|
3702
|
+
code: number;
|
|
3703
|
+
message: string;
|
|
3704
|
+
};
|
|
3648
3705
|
/** @description A comment — or a review — as PlanVortex stores it. Remember it is a **snapshot** of what the network said at `collected_date`; the live thread endpoints return the same shape reconciled against the network. */
|
|
3649
3706
|
CommentsComment: {
|
|
3650
3707
|
_id: string;
|
|
@@ -3765,18 +3822,22 @@ interface components {
|
|
|
3765
3822
|
destinations: boolean;
|
|
3766
3823
|
/** @description The publication carries a **destination link of its own** (`link`), separate from its text: where a pin takes whoever clicks it. On a network that answers `false` the field is deleted on save, so do not offer it. Today only `pinterest`. */
|
|
3767
3824
|
link: boolean;
|
|
3825
|
+
/** @description The publication can say whether it is **made for kids** (`made_for_kids`, COPPA). On a network that answers `false` the field is deleted on save, so do not offer it. Today only `youtube`. */
|
|
3826
|
+
made_for_kids: boolean;
|
|
3768
3827
|
messages: boolean;
|
|
3769
3828
|
persistent_menu: boolean;
|
|
3770
3829
|
products: boolean;
|
|
3771
3830
|
publications: boolean;
|
|
3772
3831
|
/** @description The publication can say **who can reply** to it (`reply_control`): anyone, the account's followers, the profiles it follows or the profiles mentioned in the text. It is set when the publication goes out and cannot be changed afterwards. On a network that answers `false` the field is deleted on save, so do not offer it. Today only `threads`. */
|
|
3773
3832
|
reply_control: boolean;
|
|
3833
|
+
/** @description The publication can say **who can see it** when it goes out (`visibility`): public, unlisted or private. On a network that answers `false` the field is deleted on save, so do not offer it. Today only `youtube`. */
|
|
3834
|
+
visibility: boolean;
|
|
3774
3835
|
webhooks: boolean;
|
|
3775
3836
|
};
|
|
3776
3837
|
/**
|
|
3777
3838
|
* @description One change in the array PlanVortex posts to your app's `webhook_url`, when the change concerns a social **account**.
|
|
3778
3839
|
*
|
|
3779
|
-
* An integration that stopped working has a shape of its own
|
|
3840
|
+
* An integration that stopped working has a shape of its own (`IntegrationWebhookChange`), and so does an AI plan that finished (`AiPlanWebhookChange`). One delivery can mix them. Switch on `field`, and ignore what you do not handle.
|
|
3780
3841
|
*/
|
|
3781
3842
|
CommentsWebhookChange: {
|
|
3782
3843
|
/** @description The comment. Present only when `field` is `comments`, and absent even then if the author deleted a comment we had never seen. */
|
|
@@ -4017,6 +4078,20 @@ interface components {
|
|
|
4017
4078
|
};
|
|
4018
4079
|
message: string;
|
|
4019
4080
|
}[];
|
|
4081
|
+
/**
|
|
4082
|
+
* @description What still has to be done **by hand on the network** for a publication that DID go out. Same shape as `publication_errors`, and an empty array when there is nothing to do.
|
|
4083
|
+
*
|
|
4084
|
+
* It is a separate field because these are not failures: the publication stays in state `sended` and must **not** be retried, because retrying would publish it twice. Like `publication_errors`, it belongs to the last attempt.
|
|
4085
|
+
*
|
|
4086
|
+
* Today there is one code. **2400** (YouTube): YouTube accepted the upload but did not make the video public, so YouTube Studio shows it as a draft or private until someone sets its audience and visibility there. The upload does not fail when this happens; PlanVortex reads the video back right after uploading it to find out. `data` carries `requested_privacy_status`, `privacy_status` (what YouTube actually left), `upload_status`, `made_for_kids` and `studio_url`, the YouTube Studio page where it is finished.
|
|
4087
|
+
*/
|
|
4088
|
+
publication_warnings?: {
|
|
4089
|
+
code: number;
|
|
4090
|
+
data?: {
|
|
4091
|
+
[key: string]: unknown;
|
|
4092
|
+
};
|
|
4093
|
+
message: string;
|
|
4094
|
+
}[];
|
|
4020
4095
|
/** Format: date-time */
|
|
4021
4096
|
publish_date?: string;
|
|
4022
4097
|
social_network: components["schemas"]["SocialNetwork"];
|
|
@@ -4117,7 +4192,7 @@ interface components {
|
|
|
4117
4192
|
* The catalogue grows with the product, so treat an unknown `code` as a generic failure instead of rejecting it.
|
|
4118
4193
|
*/
|
|
4119
4194
|
Error: {
|
|
4120
|
-
/** @description PlanVortex error code. Ranges: 500-554 auth, tokens, client apps and connect sessions · 601-612 user · 700-716 social accounts · 800-810 files · 900-996 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. */
|
|
4195
|
+
/** @description PlanVortex error code. Ranges: 500-554 auth, tokens, client apps and connect sessions · 601-612 user · 700-716 social accounts · 800-810 files · 900-996 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 · 2600-2699 comments, the ones that no longer fit in 945-948. */
|
|
4121
4196
|
code: number;
|
|
4122
4197
|
/** @description Extra context attached to the error, when there is any. */
|
|
4123
4198
|
data?: {
|
|
@@ -4714,16 +4789,25 @@ interface components {
|
|
|
4714
4789
|
* **On every other network the field is deleted on save**, like `destination`.
|
|
4715
4790
|
*/
|
|
4716
4791
|
link?: string;
|
|
4792
|
+
/**
|
|
4793
|
+
* @description Whether the video is **made for kids** (COPPA), on the networks that answer `made_for_kids: true` in `GET /social_capabilities` (today `youtube`). Absent means `false`.
|
|
4794
|
+
*
|
|
4795
|
+
* **On every other network the field is deleted on save**, like `reply_control`.
|
|
4796
|
+
*/
|
|
4797
|
+
made_for_kids?: boolean;
|
|
4717
4798
|
/** @description Last known measurement, in the common vocabulary. Absent until it is measured. */
|
|
4718
4799
|
metrics?: components["schemas"]["NormalizedMetrics"];
|
|
4719
4800
|
/** @description Internal name. Never shown on the social network. */
|
|
4720
4801
|
name?: string;
|
|
4721
4802
|
/** Format: date-time */
|
|
4722
4803
|
next_stats_update?: string;
|
|
4804
|
+
pending_publish?: components["schemas"]["PublicationPending"];
|
|
4723
4805
|
/**
|
|
4724
4806
|
* @description Why the publication failed, one entry per problem. **It is an array**, and it is empty on a publication that has not failed.
|
|
4725
4807
|
*
|
|
4726
|
-
* For a scheduled X (Twitter) publication that runs out of credits at publish time, `code` is 940 and `data` is `{ used, limit }`; the publication stays in state `withErrors
|
|
4808
|
+
* For a scheduled X (Twitter) publication that runs out of credits at publish time, `code` is 940 and `data` is `{ used, limit }`; the publication stays in state `withErrors`. No webhook announces it: read the publication to find out.
|
|
4809
|
+
*
|
|
4810
|
+
* On Instagram, two codes tell you whether a retry makes sense. **998**: Meta rejected the media while processing it (a codec, a duration, a URL it could not download). `data` carries `container_id`, `status_code` and, when Meta gives one, its reason in `status`. Retrying the same file fails the same way: change it first. **999**: Meta had not finished processing the media 10 minutes after it was sent. `data` carries `container_ids` and `minutes`. The file is not the problem, and a retry usually works.
|
|
4727
4811
|
*/
|
|
4728
4812
|
publication_errors: {
|
|
4729
4813
|
code: number;
|
|
@@ -4734,6 +4818,20 @@ interface components {
|
|
|
4734
4818
|
}[];
|
|
4735
4819
|
/** @enum {string} */
|
|
4736
4820
|
publication_type: "profile" | "page" | "group" | "reels" | "stories" | "message";
|
|
4821
|
+
/**
|
|
4822
|
+
* @description What still has to be done **by hand on the network** for a publication that DID go out. Same shape as `publication_errors`, and an empty array when there is nothing to do.
|
|
4823
|
+
*
|
|
4824
|
+
* It is a separate field because these are not failures: the publication stays in state `sended` and must **not** be retried, because retrying would publish it twice. Like `publication_errors`, it belongs to the last attempt.
|
|
4825
|
+
*
|
|
4826
|
+
* Today there is one code. **2400** (YouTube): YouTube accepted the upload but did not make the video public, so YouTube Studio shows it as a draft or private until someone sets its audience and visibility there. The upload does not fail when this happens; PlanVortex reads the video back right after uploading it to find out. `data` carries `requested_privacy_status`, `privacy_status` (what YouTube actually left), `upload_status`, `made_for_kids` and `studio_url`, the YouTube Studio page where it is finished.
|
|
4827
|
+
*/
|
|
4828
|
+
publication_warnings?: {
|
|
4829
|
+
code: number;
|
|
4830
|
+
data?: {
|
|
4831
|
+
[key: string]: unknown;
|
|
4832
|
+
};
|
|
4833
|
+
message: string;
|
|
4834
|
+
}[];
|
|
4737
4835
|
/** Format: date-time */
|
|
4738
4836
|
publish_date?: string;
|
|
4739
4837
|
/**
|
|
@@ -4749,6 +4847,8 @@ interface components {
|
|
|
4749
4847
|
social_network: components["schemas"]["SocialNetwork"];
|
|
4750
4848
|
/**
|
|
4751
4849
|
* @description `draft` is never sent; `ready` is scheduled; `publishing` is in the network's hands right now; `sended` went out; `withErrors` failed and carries the reason in `publication_errors`.
|
|
4850
|
+
*
|
|
4851
|
+
* `publishing` usually lasts a few seconds, but it can last **up to 10 minutes** when the network is still processing a video (today, Instagram). Then `pending_publish` is present: wait and read the publication again, do not retry it.
|
|
4752
4852
|
* @enum {string}
|
|
4753
4853
|
*/
|
|
4754
4854
|
state: "ready" | "withErrors" | "sended" | "draft" | "publishing";
|
|
@@ -4760,6 +4860,13 @@ interface components {
|
|
|
4760
4860
|
title?: string;
|
|
4761
4861
|
/** @description Link to the publication on the network, when there is one. A **private** Telegram channel has no public URL, so it comes back empty even though the post went out. */
|
|
4762
4862
|
url?: string;
|
|
4863
|
+
/**
|
|
4864
|
+
* @description **Who can see the publication** when it goes out, on the networks that answer `visibility: true` in `GET /social_capabilities` (today `youtube`). Absent means `public`. It is set when the publication goes out.
|
|
4865
|
+
*
|
|
4866
|
+
* **On every other network the field is deleted on save**, like `reply_control`.
|
|
4867
|
+
* @enum {string}
|
|
4868
|
+
*/
|
|
4869
|
+
visibility?: "public" | "unlisted" | "private";
|
|
4763
4870
|
};
|
|
4764
4871
|
/**
|
|
4765
4872
|
* @description Which part of a publication was generated by AI. **Absent means nothing was.**
|
|
@@ -4793,6 +4900,31 @@ interface components {
|
|
|
4793
4900
|
/** @description The section's label, for display. Decides nothing. */
|
|
4794
4901
|
section_name?: string;
|
|
4795
4902
|
};
|
|
4903
|
+
/**
|
|
4904
|
+
* @description Present only while the network is still **processing** what was sent, and PlanVortex is waiting to publish it. Today that happens on Instagram alone, when Meta takes longer than the ~30 seconds the request waits to process the media. In practice, that means videos.
|
|
4905
|
+
*
|
|
4906
|
+
* The publication stays in state `publishing`, and the background job asks Instagram again about once a minute until it goes out (`sended`) or fails (`withErrors`). It gives up 10 minutes after the media was sent to Instagram, and then the publication ends in `withErrors` with code 999. The object disappears as soon as the publication is resolved.
|
|
4907
|
+
*
|
|
4908
|
+
* **Wait for it. Do not retry it and do not create it again**: it has not failed, and a second publication would put the same video out twice. There is no webhook for the outcome: read the publication again after `next_check`. While this object is present the publication **cannot be updated** (error 921), for the same reason.
|
|
4909
|
+
*/
|
|
4910
|
+
PublicationPending: {
|
|
4911
|
+
/** @description PlanVortex's own bookkeeping to resume the publication (on Instagram, the ids of Meta's containers). Its content may change without notice. */
|
|
4912
|
+
data?: {
|
|
4913
|
+
[key: string]: unknown;
|
|
4914
|
+
};
|
|
4915
|
+
/**
|
|
4916
|
+
* Format: date-time
|
|
4917
|
+
* @description When PlanVortex stops waiting. If the network has not finished by then, the publication ends in `withErrors` (999 on Instagram).
|
|
4918
|
+
*/
|
|
4919
|
+
deadline?: string;
|
|
4920
|
+
/**
|
|
4921
|
+
* Format: date-time
|
|
4922
|
+
* @description When PlanVortex will ask the network again. A good moment to read the publication again: asking before it changes nothing.
|
|
4923
|
+
*/
|
|
4924
|
+
next_check?: string;
|
|
4925
|
+
/** @description PlanVortex's own bookkeeping: the temporary cropped files the network may still be downloading. Do not rely on it. */
|
|
4926
|
+
temp_keys?: string[];
|
|
4927
|
+
};
|
|
4796
4928
|
/** @description A place inside the account a publication can be sent to: on Pinterest, a board. */
|
|
4797
4929
|
PublicationsDestination: {
|
|
4798
4930
|
/** @description The destination's own description, when the network has one. */
|
|
@@ -4837,6 +4969,16 @@ interface components {
|
|
|
4837
4969
|
* On an update: omit it to keep what was there, send `null` or `""` to remove it.
|
|
4838
4970
|
*/
|
|
4839
4971
|
link?: string;
|
|
4972
|
+
/**
|
|
4973
|
+
* @description Whether the video is **made for kids**. Only on the networks that answer `made_for_kids: true` in `GET /social_capabilities` (today `youtube`), and **deleted** on every other one. Absent means `false`.
|
|
4974
|
+
*
|
|
4975
|
+
* The law (COPPA) and YouTube's policies require a video directed at children to be uploaded with `true`, and it is the **user's** call: if your software publishes on behalf of someone, ask them. YouTube then turns off features such as comments and personalised ads on that video.
|
|
4976
|
+
*
|
|
4977
|
+
* It must be a JSON boolean. Anything else (`"yes"`, `"no"`, `1`) is not guessed: the publication is still created, in state `withErrors` with `publication_errors[].code = 2501`.
|
|
4978
|
+
*
|
|
4979
|
+
* On an update: omit it to keep what was there, send `null` or `""` to go back to `false`.
|
|
4980
|
+
*/
|
|
4981
|
+
made_for_kids?: boolean;
|
|
4840
4982
|
/** @description Internal name for the publication. Useful for grouping; never shown on the social network. */
|
|
4841
4983
|
name?: string;
|
|
4842
4984
|
/**
|
|
@@ -4891,6 +5033,21 @@ interface components {
|
|
|
4891
5033
|
* **On Pinterest it is the pin's title**, optional and at most 100 characters; over it the publication is created in state `withErrors` with `publication_errors[].code = 995` and `data.field = "title"`.
|
|
4892
5034
|
*/
|
|
4893
5035
|
title?: string;
|
|
5036
|
+
/**
|
|
5037
|
+
* @description **Who can see the publication** when it goes out. Only on the networks that answer `visibility: true` in `GET /social_capabilities` (today `youtube`), and **deleted** on every other one.
|
|
5038
|
+
*
|
|
5039
|
+
* - `public`: anyone. It is what applies when the field is omitted.
|
|
5040
|
+
* - `unlisted`: only people with the link. It does not show on the channel or in search.
|
|
5041
|
+
* - `private`: only the channel owner and the people they invite from YouTube Studio.
|
|
5042
|
+
*
|
|
5043
|
+
* YouTube's policies require this to be **the user's choice**: if your software publishes on behalf of someone, ask them. A value the network does not accept does not fail the request: the publication is still created, in state `withErrors` with `publication_errors[].code = 2500`, whose `data` carries the `allowed` values. It is checked when the publication is **created**, so a scheduled video does not fail at 3 a.m. over a value that was already wrong.
|
|
5044
|
+
*
|
|
5045
|
+
* If YouTube does not leave the video with the visibility that was asked for, the publication still ends up `sended` (the video is on the channel) and carries a warning in `publication_warnings` with `code = 2400`.
|
|
5046
|
+
*
|
|
5047
|
+
* On an update: omit it to keep what was there, send `null` or `""` to go back to `public`.
|
|
5048
|
+
* @enum {string}
|
|
5049
|
+
*/
|
|
5050
|
+
visibility?: "public" | "unlisted" | "private";
|
|
4894
5051
|
};
|
|
4895
5052
|
PublicationsPublicationList: {
|
|
4896
5053
|
publications: components["schemas"]["Publication"][];
|
|
@@ -5176,6 +5333,7 @@ interface components {
|
|
|
5176
5333
|
* | `970` | Telegram is rate limiting the bot and the wait was longer than PlanVortex is willing to hold the request for. Carries `retry_after_seconds` in `data`: retry after it. |
|
|
5177
5334
|
* | `1101` | Invalid organization. |
|
|
5178
5335
|
* | `1501` | The comment's account could not be resolved. |
|
|
5336
|
+
* | `2600` | The network has comments but **this account** has none: a LinkedIn personal profile. LinkedIn does not let any app read a member's comments, so only pages have an inbox. Carries `social_network` and `id_account` in `data`. |
|
|
5179
5337
|
*/
|
|
5180
5338
|
CommentsCommentError: {
|
|
5181
5339
|
headers: {
|
|
@@ -7538,7 +7696,11 @@ interface operations {
|
|
|
7538
7696
|
query?: {
|
|
7539
7697
|
/** @description Only these accounts, by identifier. Repeat the parameter for more than one. */
|
|
7540
7698
|
accounts?: string[];
|
|
7541
|
-
/**
|
|
7699
|
+
/**
|
|
7700
|
+
* @description Only accounts whose network can do this. It is the same matrix `GET /social_capabilities` publishes, applied server-side: the way to ask for 'the accounts I can publish with' without keeping your own table of which network does what.
|
|
7701
|
+
*
|
|
7702
|
+
* `comments` also looks at each account, not only at its network: a LinkedIn **personal profile** is left out, because only LinkedIn pages have a comment inbox. `total` counts the same way.
|
|
7703
|
+
*/
|
|
7542
7704
|
capability?: "publications" | "messages" | "products" | "webhooks" | "persistent_menu" | "comments";
|
|
7543
7705
|
/** @description The limit of records will be retrieved (pagination) */
|
|
7544
7706
|
limit?: number;
|
|
@@ -8791,7 +8953,7 @@ interface operations {
|
|
|
8791
8953
|
* | `1101` | Invalid organization |
|
|
8792
8954
|
* | `917` | Publication doesn't exists |
|
|
8793
8955
|
* | `935` | Invalid publication |
|
|
8794
|
-
* | `921` | Can't update a publication already sended |
|
|
8956
|
+
* | `921` | Can't update a publication already sended, **or one the network is still processing** (state `publishing` with `pending_publish`; then `data.state` is `publishing`). Editing it would publish it twice. It can be edited again if it fails. |
|
|
8795
8957
|
* | `940` | X (Twitter) credits exhausted. Not enough monthly credits to publish this tweet (same link detection and 15/200 tariff as on create). Response data: { used, limit }. |
|
|
8796
8958
|
* | `523` | Invalid application |
|
|
8797
8959
|
*/
|
|
@@ -10423,7 +10585,7 @@ interface operations {
|
|
|
10423
10585
|
* | `1101` | Invalid organization |
|
|
10424
10586
|
* | `917` | Publication doesn't exists |
|
|
10425
10587
|
* | `935` | Invalid publication |
|
|
10426
|
-
* | `921` | Can't update a publication already sended |
|
|
10588
|
+
* | `921` | Can't update a publication already sended, **or one the network is still processing** (state `publishing` with `pending_publish`; then `data.state` is `publishing`). Editing it would publish it twice. It can be edited again if it fails. |
|
|
10427
10589
|
* | `940` | X (Twitter) credits exhausted. Not enough monthly credits to publish this tweet (same link detection and 15/200 tariff as on create). Response data: { used, limit }. |
|
|
10428
10590
|
* | `523` | Invalid application |
|
|
10429
10591
|
*/
|
|
@@ -11952,7 +12114,9 @@ interface operations {
|
|
|
11952
12114
|
* "comments": true,
|
|
11953
12115
|
* "destinations": false,
|
|
11954
12116
|
* "link": false,
|
|
11955
|
-
* "reply_control": false
|
|
12117
|
+
* "reply_control": false,
|
|
12118
|
+
* "visibility": false,
|
|
12119
|
+
* "made_for_kids": false
|
|
11956
12120
|
* },
|
|
11957
12121
|
* "google_business": {
|
|
11958
12122
|
* "publications": false,
|
|
@@ -11963,7 +12127,9 @@ interface operations {
|
|
|
11963
12127
|
* "comments": true,
|
|
11964
12128
|
* "destinations": false,
|
|
11965
12129
|
* "link": false,
|
|
11966
|
-
* "reply_control": false
|
|
12130
|
+
* "reply_control": false,
|
|
12131
|
+
* "visibility": false,
|
|
12132
|
+
* "made_for_kids": false
|
|
11967
12133
|
* },
|
|
11968
12134
|
* "pinterest": {
|
|
11969
12135
|
* "publications": true,
|
|
@@ -11974,7 +12140,9 @@ interface operations {
|
|
|
11974
12140
|
* "comments": false,
|
|
11975
12141
|
* "destinations": true,
|
|
11976
12142
|
* "link": true,
|
|
11977
|
-
* "reply_control": false
|
|
12143
|
+
* "reply_control": false,
|
|
12144
|
+
* "visibility": false,
|
|
12145
|
+
* "made_for_kids": false
|
|
11978
12146
|
* },
|
|
11979
12147
|
* "threads": {
|
|
11980
12148
|
* "publications": true,
|
|
@@ -11985,7 +12153,9 @@ interface operations {
|
|
|
11985
12153
|
* "comments": true,
|
|
11986
12154
|
* "destinations": false,
|
|
11987
12155
|
* "link": false,
|
|
11988
|
-
* "reply_control": true
|
|
12156
|
+
* "reply_control": true,
|
|
12157
|
+
* "visibility": false,
|
|
12158
|
+
* "made_for_kids": false
|
|
11989
12159
|
* }
|
|
11990
12160
|
* }
|
|
11991
12161
|
*/
|
|
@@ -12167,7 +12337,7 @@ interface operations {
|
|
|
12167
12337
|
* }
|
|
12168
12338
|
* ]
|
|
12169
12339
|
*/
|
|
12170
|
-
"application/json": (components["schemas"]["CommentsWebhookChange"] | components["schemas"]["CommentsIntegrationWebhookChange"])[];
|
|
12340
|
+
"application/json": (components["schemas"]["CommentsWebhookChange"] | components["schemas"]["CommentsIntegrationWebhookChange"] | components["schemas"]["CommentsAiPlanWebhookChange"])[];
|
|
12171
12341
|
};
|
|
12172
12342
|
};
|
|
12173
12343
|
responses: {
|
|
@@ -12434,6 +12604,12 @@ type ClientWithOrganizations = Operations["getClientsWithOrganizations"]["respon
|
|
|
12434
12604
|
*
|
|
12435
12605
|
* Y un canal de Telegram **privado** no trae `username`: solo los publicos tienen `@nombre`, que es
|
|
12436
12606
|
* tambien por lo que sus publicaciones vuelven sin `url`.
|
|
12607
|
+
*
|
|
12608
|
+
* En LinkedIn una misma autorizacion trae dos clases de cuenta: el **perfil personal** de quien
|
|
12609
|
+
* autoriza y cada **pagina** que administra. Las dos publican y tienen estadisticas, pero solo las
|
|
12610
|
+
* paginas tienen bandeja de comentarios: LinkedIn no deja a ninguna app leer los comentarios de un
|
|
12611
|
+
* perfil, y ahi todo `comments.*` devuelve el error 2600. Se distinguen por
|
|
12612
|
+
* `extra_data.is_personal_profile`; ausente es pagina (las conectadas antes de que hubiera perfiles).
|
|
12437
12613
|
*/
|
|
12438
12614
|
type Account = Override<Schemas["Account"], {
|
|
12439
12615
|
social_network: SocialNetwork;
|
|
@@ -12591,6 +12767,16 @@ type AiImageOrigin = Schemas["AiImageOrigin"];
|
|
|
12591
12767
|
* guarda: cambiar la imagen generada por una foto propia lo apaga.
|
|
12592
12768
|
*/
|
|
12593
12769
|
type PublicationAiGenerated = Schemas["PublicationAiGenerated"];
|
|
12770
|
+
/**
|
|
12771
|
+
* La red aun esta PROCESANDO lo que se le mando y PlanVortex espera para publicarlo: hoy, un video
|
|
12772
|
+
* de Instagram que Meta tarda mas de ~30 s en procesar. La {@link Publication} sigue en
|
|
12773
|
+
* `publishing` hasta 10 minutos, y PlanVortex vuelve a preguntar solo una vez por minuto.
|
|
12774
|
+
*
|
|
12775
|
+
* **Hay que esperar, no reintentar ni volver a crearla**: saldria el video dos veces. No hay webhook
|
|
12776
|
+
* del resultado: vuelve a leer la publicacion despues de `next_check`. Mientras esta puesto no se
|
|
12777
|
+
* puede editar (error 921). `temp_keys` y `data` son contabilidad interna de PlanVortex.
|
|
12778
|
+
*/
|
|
12779
|
+
type PublicationPending = Schemas["PublicationPending"];
|
|
12594
12780
|
/**
|
|
12595
12781
|
* Una publicacion: programada, enviada o fallida.
|
|
12596
12782
|
*
|
|
@@ -13393,11 +13579,12 @@ type WebhookAlgorithm = keyof typeof WEBHOOK_SIGNATURE_HEADERS;
|
|
|
13393
13579
|
* Los eventos que hoy se entregan de verdad, comprobados uno a uno contra el servidor.
|
|
13394
13580
|
*
|
|
13395
13581
|
* Salen de dos sitios: `ALLOWED_WEBHOOKS_NOTIFICATIONS` para los que levanta PlanVortex
|
|
13396
|
-
* (`new_account`, `change_state_account`, `integration_error
|
|
13397
|
-
* llegan de la red y sobreviven al filtro.
|
|
13398
|
-
* ignora en vez de romper: para eso está
|
|
13582
|
+
* (`new_account`, `change_state_account`, `integration_error`, `ai_plan_generated`,
|
|
13583
|
+
* `ai_plan_failed`) y `WEBHOOKS_TO_HANDLE` para los que llegan de la red y sobreviven al filtro.
|
|
13584
|
+
* **La lista crece**, así que un `field` desconocido se ignora en vez de romper: para eso está
|
|
13585
|
+
* {@link UnknownWebhookChange}.
|
|
13399
13586
|
*/
|
|
13400
|
-
declare const WEBHOOK_EVENTS: readonly ["new_account", "change_state_account", "messages", "messaging_postbacks", "messaging_seen", "messaging_error", "comments", "integration_error"];
|
|
13587
|
+
declare const WEBHOOK_EVENTS: readonly ["new_account", "change_state_account", "messages", "messaging_postbacks", "messaging_seen", "messaging_error", "comments", "integration_error", "ai_plan_generated", "ai_plan_failed"];
|
|
13401
13588
|
type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
|
|
13402
13589
|
/** Lo que trae todo cambio que cuelga de una CUENTA, pase lo que pase. */
|
|
13403
13590
|
interface AccountWebhookChangeBase {
|
|
@@ -13459,6 +13646,39 @@ interface IntegrationErrorChange {
|
|
|
13459
13646
|
/** El código del catálogo de PlanVortex que dice qué pasó. Los de integraciones van del 2200 al 2299. */
|
|
13460
13647
|
error_code: number;
|
|
13461
13648
|
}
|
|
13649
|
+
/**
|
|
13650
|
+
* Un plan de IA TERMINÓ: salió (`ai_plan_generated`) o se rindió (`ai_plan_failed`).
|
|
13651
|
+
*
|
|
13652
|
+
* Es lo que te ahorra preguntar por el plan cada pocos segundos: espera a este evento y lee el plan
|
|
13653
|
+
* una vez con `pv.aiPlans.get()`. Sólo trae ids y números, nunca el prompt ni lo generado.
|
|
13654
|
+
*
|
|
13655
|
+
* **No trae `id_account` ni `social_network`**, igual que {@link IntegrationErrorChange}: un plan
|
|
13656
|
+
* puede abarcar varias redes y cuelga de la organización.
|
|
13657
|
+
*
|
|
13658
|
+
* Un fallo transitorio devuelve el plan a la cola y no manda nada, así que cada plan manda **uno**
|
|
13659
|
+
* de los dos, nunca un `failed` seguido de un `generated`. Y no se reintenta: si tu endpoint estaba
|
|
13660
|
+
* caído cuando terminó, `pv.aiPlans.get()` sigue diciendo cómo acabó.
|
|
13661
|
+
*/
|
|
13662
|
+
interface AiPlanChange {
|
|
13663
|
+
field: "ai_plan_generated" | "ai_plan_failed";
|
|
13664
|
+
id_ai_plan: string;
|
|
13665
|
+
id_organization: string;
|
|
13666
|
+
/** El estado en que terminó. Siempre cuadra con `field`: `generated` o `failed`. */
|
|
13667
|
+
state: "generated" | "failed";
|
|
13668
|
+
/** De qué salió el plan: el mismo valor que `AiPlan.template`. La lista crece. */
|
|
13669
|
+
template: PlannerTemplateName;
|
|
13670
|
+
/** Cuántas publicaciones en borrador tiene. Uno `failed` puede conservar las del intento fallido. */
|
|
13671
|
+
total_publications: number;
|
|
13672
|
+
/** Los créditos de IA que gastó. Uno `failed` también puede haber gastado, y no se devuelven. */
|
|
13673
|
+
credits_spent: number;
|
|
13674
|
+
/** CUÁNTOS avisos dejó, no los avisos: ésos están en `AiPlan.warnings`. Con avisos sigue siendo usable. */
|
|
13675
|
+
warnings: number;
|
|
13676
|
+
/** Sólo en `ai_plan_failed`: el mismo `code` y `message` que `AiPlan.error`. Su `data`, en el plan. */
|
|
13677
|
+
error?: {
|
|
13678
|
+
code: number;
|
|
13679
|
+
message: string;
|
|
13680
|
+
};
|
|
13681
|
+
}
|
|
13462
13682
|
/**
|
|
13463
13683
|
* Un `field` que esta versión del paquete todavía no conoce.
|
|
13464
13684
|
*
|
|
@@ -13477,7 +13697,7 @@ interface UnknownWebhookChange {
|
|
|
13477
13697
|
* `CommentChange | UnknownWebhookChange`. Para estrechar de verdad están los predicados
|
|
13478
13698
|
* {@link isCommentChange} y compañía, que es la forma recomendada.
|
|
13479
13699
|
*/
|
|
13480
|
-
type WebhookChange = AccountStateChange | MessageChange | CommentChange | IntegrationErrorChange | UnknownWebhookChange;
|
|
13700
|
+
type WebhookChange = AccountStateChange | MessageChange | CommentChange | IntegrationErrorChange | AiPlanChange | UnknownWebhookChange;
|
|
13481
13701
|
/** Una cuenta se conectó o cambió de estado. */
|
|
13482
13702
|
declare function isAccountStateChange(change: WebhookChange): change is AccountStateChange;
|
|
13483
13703
|
/** Algo pasó en la mensajería. Incluye el visto y el rechazo de la red, no sólo el mensaje nuevo. */
|
|
@@ -13486,6 +13706,8 @@ declare function isMessageChange(change: WebhookChange): change is MessageChange
|
|
|
13486
13706
|
declare function isCommentChange(change: WebhookChange): change is CommentChange;
|
|
13487
13707
|
/** Una integración dejó de funcionar. */
|
|
13488
13708
|
declare function isIntegrationErrorChange(change: WebhookChange): change is IntegrationErrorChange;
|
|
13709
|
+
/** Un plan de IA terminó, bien o mal. Mira `field` (o `state`) para saber cuál. */
|
|
13710
|
+
declare function isAiPlanChange(change: WebhookChange): change is AiPlanChange;
|
|
13489
13711
|
/**
|
|
13490
13712
|
* La firma no cuadra, o no venía ninguna.
|
|
13491
13713
|
*
|
|
@@ -13628,4 +13850,4 @@ interface PlanVortexWebhooksOptions {
|
|
|
13628
13850
|
*/
|
|
13629
13851
|
declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
|
|
13630
13852
|
|
|
13631
|
-
export { type Organization as $, type Account as A, type CommentThread as B, type ConnectLink as C, type Destination as D, type EnableResult as E, type CommentReplyResult as F, type ContactExtraData as G, type Contact as H, type ContactCreate as I, type ContactUpdate as J, type IntegrationProviderName as K, type IntegrationProvider as L, type MetricName as M, type Integration as N, type IntegrationConnectRequest as O, type Paginated as P, type IntegrationUpdate as Q, type IntegrationPickerConfig as R, type SocialNetwork as S, type TopPublicationsResult as T, type IntegrationCatalogPage as U, type MessageTemplate as V, type Conversation as W, type ConversationTotals as X, type Message as Y, type MessageInput as Z, type Client as _, type ConnectResult as a, type MetricRow as a$, type AiSettings as a0, type ClientWithOrganizations as a1, type AccountSelection as a2, type PlanData as a3, type PlanUseData as a4, type ConnectToken as a5, type AiContext as a6, type SocialCredentialsInput as a7, type Product as a8, type ProductInput as a9, type AiPlanState as aA, type ApiErrorBody as aB, type AspectRatios as aC, AuthError as aD, type ClientPlan as aE, type CommentAuthor as aF, type CommentChange as aG, type ConnectSessionAccount as aH, type ContactChannel as aI, ContactError as aJ, type DashboardAiPlanRef as aK, type DashboardPublicationRef as aL, type DashboardRange as aM, type EngagementBase as aN, FileError as aO, type FileFormat as aP, type FileProperties as aQ, type FileType as aR, type IntegrationCatalogProduct as aS, type IntegrationConfig as aT, IntegrationError as aU, type IntegrationErrorChange as aV, type IntegrationFormField as aW, type MessageChange as aX, type MessageOptions as aY, type MessageType as aZ, MessagingError as a_, type ProductCatalog as aa, type ProductCatalogInput as ab, type PublicationInput as ac, type PublicationState as ad, type PublicationStats as ae, type PublicationStatsHistory as af, type Upload as ag, AccountError as ah, type AccountMetricRow as ai, type AccountStateChange as aj, type AccountWebhookChangeBase as ak, type AccountWithError as al, type AiImageOrigin as am, type AiPlanCostEstimate as an, type AiPlanDestination as ao, AiPlanError as ap, type AiPlanNotice as aq, type AiPlanOptions as ar, type AiPlanOptionsInput as as, type AiPlanResult as at, type AiPlanResultsGroup as au, type AiPlanResultsTemplateGroup as av, type AiPlanSource as aw, type AiPlanSourceImageInput as ax, type AiPlanSourceInput as ay, type AiPlanSourceProduct as az, type ConnectSession as b, type
|
|
13853
|
+
export { type Organization as $, type Account as A, type CommentThread as B, type ConnectLink as C, type Destination as D, type EnableResult as E, type CommentReplyResult as F, type ContactExtraData as G, type Contact as H, type ContactCreate as I, type ContactUpdate as J, type IntegrationProviderName as K, type IntegrationProvider as L, type MetricName as M, type Integration as N, type IntegrationConnectRequest as O, type Paginated as P, type IntegrationUpdate as Q, type IntegrationPickerConfig as R, type SocialNetwork as S, type TopPublicationsResult as T, type IntegrationCatalogPage as U, type MessageTemplate as V, type Conversation as W, type ConversationTotals as X, type Message as Y, type MessageInput as Z, type Client as _, type ConnectResult as a, type MetricRow as a$, type AiSettings as a0, type ClientWithOrganizations as a1, type AccountSelection as a2, type PlanData as a3, type PlanUseData as a4, type ConnectToken as a5, type AiContext as a6, type SocialCredentialsInput as a7, type Product as a8, type ProductInput as a9, type AiPlanState as aA, type ApiErrorBody as aB, type AspectRatios as aC, AuthError as aD, type ClientPlan as aE, type CommentAuthor as aF, type CommentChange as aG, type ConnectSessionAccount as aH, type ContactChannel as aI, ContactError as aJ, type DashboardAiPlanRef as aK, type DashboardPublicationRef as aL, type DashboardRange as aM, type EngagementBase as aN, FileError as aO, type FileFormat as aP, type FileProperties as aQ, type FileType as aR, type IntegrationCatalogProduct as aS, type IntegrationConfig as aT, IntegrationError as aU, type IntegrationErrorChange as aV, type IntegrationFormField as aW, type MessageChange as aX, type MessageOptions as aY, type MessageType as aZ, MessagingError as a_, type ProductCatalog as aa, type ProductCatalogInput as ab, type PublicationInput as ac, type PublicationState as ad, type PublicationStats as ae, type PublicationStatsHistory as af, type Upload as ag, AccountError as ah, type AccountMetricRow as ai, type AccountStateChange as aj, type AccountWebhookChangeBase as ak, type AccountWithError as al, type AiImageOrigin as am, type AiPlanCostEstimate as an, type AiPlanDestination as ao, AiPlanError as ap, type AiPlanNotice as aq, type AiPlanOptions as ar, type AiPlanOptionsInput as as, type AiPlanResult as at, type AiPlanResultsGroup as au, type AiPlanResultsTemplateGroup as av, type AiPlanSource as aw, type AiPlanSourceImageInput as ax, type AiPlanSourceInput as ay, type AiPlanSourceProduct as az, type ConnectSession as b, type WebhookHeaders as b$, NO_ERROR_CODE as b0, type components as b1, type operations as b2, type paths as b3, type webhooks as b4, type OpenEnum as b5, OrganizationError as b6, PLANVORTEX_ERROR_RANGES as b7, PlanLimitError as b8, PlanVortexAuthenticationError as b9, UserError as bA, type WebhookAlgorithm as bB, type WebhookChange as bC, type WebhookEvent as bD, type WithAccount as bE, type WithPublication as bF, type WooCommerceConnectRequest as bG, account as bH, accountId as bI, errorFamilyForCode as bJ, isPlanVortexError as bK, isTokenError as bL, messageContact as bM, messageContactId as bN, messageDirection as bO, messageFileIds as bP, messageFiles as bQ, publication as bR, publicationId as bS, type AiPlanChange as bT, type HandleWebhookRequestOptions as bU, type PlanVortexWebhooksOptions as bV, type RawWebhookBody as bW, type VerifyWebhookSignatureOptions as bX, WEBHOOK_EVENTS as bY, WEBHOOK_SIGNATURE_HEADERS as bZ, WebhookBodyError as b_, PlanVortexConfigError as ba, PlanVortexConnectionError as bb, PlanVortexError as bc, type PlanVortexErrorOptions as bd, type PlanVortexErrorRange as be, type PlannerTemplateField as bf, type PlannerTemplateFieldType as bg, ProductError as bh, type PublicationAiGenerated as bi, type PublicationDestination as bj, PublicationError as bk, type PublicationErrorDetail as bl, type PublicationMetrics as bm, type PublicationPending as bn, type PublicationStatsPoint as bo, type PublicationType as bp, type PublicationsSummary as bq, type RssConfig as br, type SocialAuthorizationMethod as bs, type SocialCredentials as bt, type SocialIdentifier as bu, type SocialIdentifierInput as bv, type SocialLimitsMap as bw, TOKEN_ERROR_CODES as bx, type TopPublication as by, type UnknownWebhookChange as bz, type AccountMetrics as c, type WebhookRequestLike as c0, type WebhookResponseLike as c1, WebhookSignatureError as c2, handleWebhookRequest as c3, isAccountStateChange as c4, isAiPlanChange as c5, isCommentChange as c6, isIntegrationErrorChange as c7, isMessageChange as c8, parseWebhookPayload as c9, planvortexWebhooks as ca, verifyWebhookSignature as cb, type PersistentMenu as d, type Dashboard as e, type DashboardMetricsResult as f, type PublicationsSummaryResult as g, type PublicationsStatsResult as h, type PlanUse as i, type Publication as j, type AiPlanResultsSort as k, type PlannerTemplateName as l, type AiPlanCreateRequest as m, type AiPlanCreateResult as n, type AiPlan as o, type AiPlanResults as p, type ClientApp as q, type ClientAppInput as r, type SocialCapabilities as s, type CommentActions as t, type SocialLimits as u, type PublicationLimits as v, type AspectRatiosByNetwork as w, type PlannerTemplate as x, type CommentNetwork as y, type Comment as z };
|