planvortex 0.4.0 → 0.5.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 +49 -1
- package/dist/{index-DvnKrGy_.d.cts → index-CnTr9naC.d.cts} +332 -19
- package/dist/{index-DvnKrGy_.d.ts → index-CnTr9naC.d.ts} +332 -19
- package/dist/index.cjs +61 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -5
- package/dist/index.d.ts +93 -5
- package/dist/index.js +61 -1
- package/dist/index.js.map +1 -1
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -349,7 +349,7 @@ interface paths {
|
|
|
349
349
|
put?: never;
|
|
350
350
|
/**
|
|
351
351
|
* Create an AI publication plan
|
|
352
|
-
* @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (artificial_inteligence), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission.
|
|
352
|
+
* @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (artificial_inteligence), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission. Since the plan can be generated from a SOURCE (`template` + `source`), part of that validation is the source itself: the article is downloaded, the catalogue is read live and the product pictures are copied — all of it inside this request, so what does not work fails with the user in front of it. A plan whose source did not fit in the week is still created, and says so in ai_plan.warnings (2117).
|
|
353
353
|
*/
|
|
354
354
|
post: operations["addAiPlan"];
|
|
355
355
|
delete?: never;
|
|
@@ -398,6 +398,8 @@ interface paths {
|
|
|
398
398
|
* **It costs credits, and they are charged per use.** The balance is checked before the call and the real cost is charged afterwards, accumulating in the plan's `credits_spent`. As a reference: regenerating a text is billed around 2 credits and an image around 70, but what is actually charged is the provider's real cost.
|
|
399
399
|
*
|
|
400
400
|
* It only works **while the plan is under review** (state `generated`) and on its drafts: a publication already validated or published is not a draft any more.
|
|
401
|
+
*
|
|
402
|
+
* **What can be regenerated depends on the plan template**, and it is published in `regenerate` (`GET /planner_templates`). `from_images` and `from_catalog` cannot regenerate the image: nobody regenerates the photo they took themselves, and offering the button anyway charges the user 70 credits to replace their own photo with an invented one. Asking for it anyway is a 2102.
|
|
401
403
|
*/
|
|
402
404
|
post: operations["regenerateAiPlanPublication"];
|
|
403
405
|
delete?: never;
|
|
@@ -2234,6 +2236,35 @@ interface paths {
|
|
|
2234
2236
|
patch?: never;
|
|
2235
2237
|
trace?: never;
|
|
2236
2238
|
};
|
|
2239
|
+
"/planner_templates": {
|
|
2240
|
+
parameters: {
|
|
2241
|
+
query?: never;
|
|
2242
|
+
header?: never;
|
|
2243
|
+
path?: never;
|
|
2244
|
+
cookie?: never;
|
|
2245
|
+
};
|
|
2246
|
+
/**
|
|
2247
|
+
* AI planner templates
|
|
2248
|
+
* @description What an AI plan can be generated FROM, and what each source allows.
|
|
2249
|
+
*
|
|
2250
|
+
* A template is the **source** of the content, not the wizard's flow: sharing, publish days, language, tone and images stay cross-cutting options, and every template declares which of them it accepts. Send the chosen one as `template` when creating a plan (`POST /ai_plans`), together with its `source`.
|
|
2251
|
+
*
|
|
2252
|
+
* • **`generates_images: false` means the pictures come from the source** — your own photos, your catalogue — so the plan spends **no image credits at all**. A week of 7 publications with a picture on each goes from 519 credits to 48, and it is worth saying out loud before the plan is created.
|
|
2253
|
+
* • **`regenerate` is per template.** A template that did not generate the image cannot regenerate it: offer that button anyway and the user pays 70 credits to replace their own photo with an invented one.
|
|
2254
|
+
* • **`orchestration_cost` is an ESTIMATE, not the bill.** The real charge is per use (what the provider reports). `orchestration_cost_per_source_item` is what each unit of the source adds on top — one vision pass per image.
|
|
2255
|
+
* • **A plan is WEEKLY, and the source does not extend it.** With `max_source_items` photos but fewer slots left in the week, the extra ones are dropped and the plan carries warning 2117 in `ai_plan.warnings`. Say it in your UI *before* creating the plan, not after charging for it.
|
|
2256
|
+
* • **`source_fields` is what the source step is made of.** The simple types are ordinary controls; `uploads_with_description` and `catalog_products` are the signal that the step needs a component of its own.
|
|
2257
|
+
* • **The fields carry their own limits.** `max` and `min` are in the field's own units — characters of a text, items of a list, **days** for a date — and `source_requires_any` names the fields of which at least one is needed (`from_text`: the URL or the pasted text). Read them from here; hardcoding them is how a wizard ends up rejecting at a number the server does not use.
|
|
2258
|
+
*/
|
|
2259
|
+
get: operations["getPlannerTemplates"];
|
|
2260
|
+
put?: never;
|
|
2261
|
+
post?: never;
|
|
2262
|
+
delete?: never;
|
|
2263
|
+
options?: never;
|
|
2264
|
+
head?: never;
|
|
2265
|
+
patch?: never;
|
|
2266
|
+
trace?: never;
|
|
2267
|
+
};
|
|
2237
2268
|
"/publication_limits": {
|
|
2238
2269
|
parameters: {
|
|
2239
2270
|
query?: never;
|
|
@@ -2579,14 +2610,8 @@ interface components {
|
|
|
2579
2610
|
creation_date: string;
|
|
2580
2611
|
/** @description AI credits actually consumed by the generation. */
|
|
2581
2612
|
credits_spent: number;
|
|
2582
|
-
/** @description Last generation error
|
|
2583
|
-
error?:
|
|
2584
|
-
code: number;
|
|
2585
|
-
data?: {
|
|
2586
|
-
[key: string]: unknown;
|
|
2587
|
-
};
|
|
2588
|
-
message: string;
|
|
2589
|
-
};
|
|
2613
|
+
/** @description Last generation error. Present only in state `failed`. */
|
|
2614
|
+
error?: components["schemas"]["AiPlansAiPlanNotice"];
|
|
2590
2615
|
/** Format: date-time */
|
|
2591
2616
|
generation_end_date?: string;
|
|
2592
2617
|
id_client: string;
|
|
@@ -2605,19 +2630,33 @@ interface components {
|
|
|
2605
2630
|
* **It is not always the same shape.** Reading one plan (`GET`, `validate`, `retry`) returns whole publications with their files resolved; the LISTING returns their identifiers as strings. Check before using them.
|
|
2606
2631
|
*/
|
|
2607
2632
|
publications: (string | components["schemas"]["Publication"])[];
|
|
2633
|
+
/** @description The source snapshot. Absent on a `standard` plan, which has no source. */
|
|
2634
|
+
source?: components["schemas"]["AiPlansAiPlanSource"];
|
|
2608
2635
|
/**
|
|
2609
2636
|
* @description State machine: pending -> generating -> generated -> validated | failed | cancelled. Poll the plan while state is pending or generating.
|
|
2610
2637
|
* @enum {string}
|
|
2611
2638
|
*/
|
|
2612
2639
|
state: "pending" | "generating" | "generated" | "validated" | "failed" | "cancelled";
|
|
2640
|
+
/**
|
|
2641
|
+
* @description What this plan was generated from. Always present: a plan created before templates existed reads `standard`.
|
|
2642
|
+
* @enum {string}
|
|
2643
|
+
*/
|
|
2644
|
+
template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
2645
|
+
/**
|
|
2646
|
+
* @description Non-blocking notices about the LAST attempt (they are cleared when a new one starts). The plan is generated and perfectly usable; your UI just has to say what happened.
|
|
2647
|
+
*
|
|
2648
|
+
* Today there is one: **2117 — some source items did not fit in the plan week.** A plan is weekly and the source does not extend it, so 12 photos with 6 slots left publish 6 and the rest are dropped. `data` carries `{ source_items, capacity }`. Better said BEFORE creating the plan (the slots are the publish days x the accounts) than after charging for it.
|
|
2649
|
+
*/
|
|
2650
|
+
warnings?: components["schemas"]["AiPlansAiPlanNotice"][];
|
|
2613
2651
|
};
|
|
2614
2652
|
/** @description Deterministic cost estimate computed by the backend (never by the model). BYOK scopes cost 0 credits. */
|
|
2615
2653
|
AiPlansAiPlanCostEstimate: {
|
|
2616
2654
|
available_credits: number;
|
|
2617
|
-
/** @description Mandatory cost (orchestration + target texts). The plan is rejected if this exceeds the available credits. */
|
|
2655
|
+
/** @description Mandatory cost (orchestration + target texts). The orchestration half depends on the TEMPLATE and on the size of its source: `orchestration_cost` + `orchestration_cost_per_source_item` x units, both published in `GET /planner_templates`. The plan is rejected if this exceeds the available credits. */
|
|
2618
2656
|
base_cost: number;
|
|
2619
2657
|
/** @description Total estimated cost including the financeable images (upper bound). */
|
|
2620
2658
|
estimated_cost: number;
|
|
2659
|
+
/** @description How many images the plan will generate. **0 when the template does not generate them** (`from_images`, `from_catalog`): the pictures come from the source, so the plan spends no image credits at all — a week of 7 publications with a picture on each goes from 519 credits to 48. That is worth saying out loud before the plan is created. */
|
|
2621
2660
|
images_target: number;
|
|
2622
2661
|
texts_target: number;
|
|
2623
2662
|
};
|
|
@@ -2627,6 +2666,17 @@ interface components {
|
|
|
2627
2666
|
options?: components["schemas"]["AiPlansAiPlanOptionsInput"];
|
|
2628
2667
|
/** @description Theme prompt written by the user. */
|
|
2629
2668
|
prompt: string;
|
|
2669
|
+
/** @description The source itself. Which fields it carries depends on `template`. Required for every template except `standard`, and validated at creation — 2112, 2113, 2114, 2115 or 2116 come back while the user is still there. */
|
|
2670
|
+
source?: components["schemas"]["AiPlansAiPlanSourceInput"];
|
|
2671
|
+
/**
|
|
2672
|
+
* @description What the plan is generated FROM. Optional; defaults to `standard`, which is exactly what every plan did before templates existed — send nothing and nothing changes.
|
|
2673
|
+
*
|
|
2674
|
+
* A template is the **source** of the content, not a different flow: `shared`, `publish_days`, `language`, `tone` and the images stay cross-cutting options, and each template declares which of them it accepts. Sending one it does not accept is a 2106, not a silent ignore.
|
|
2675
|
+
*
|
|
2676
|
+
* Read the list, the costs and the fields from `GET /planner_templates`; do not hardcode them.
|
|
2677
|
+
* @enum {string}
|
|
2678
|
+
*/
|
|
2679
|
+
template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
2630
2680
|
};
|
|
2631
2681
|
AiPlansAiPlanCreateResponse: {
|
|
2632
2682
|
ai_plan: components["schemas"]["AiPlansAiPlan"];
|
|
@@ -2638,6 +2688,14 @@ interface components {
|
|
|
2638
2688
|
ai_plans: components["schemas"]["AiPlansAiPlan"][];
|
|
2639
2689
|
total: number;
|
|
2640
2690
|
};
|
|
2691
|
+
/** @description Something the plan has to say about itself, in the same shape as an API error. */
|
|
2692
|
+
AiPlansAiPlanNotice: {
|
|
2693
|
+
code: number;
|
|
2694
|
+
data?: {
|
|
2695
|
+
[key: string]: unknown;
|
|
2696
|
+
};
|
|
2697
|
+
message: string;
|
|
2698
|
+
};
|
|
2641
2699
|
AiPlansAiPlanOne: {
|
|
2642
2700
|
ai_plan: components["schemas"]["AiPlansAiPlan"];
|
|
2643
2701
|
};
|
|
@@ -2695,9 +2753,9 @@ interface components {
|
|
|
2695
2753
|
};
|
|
2696
2754
|
/** @description Generation options, as you SEND them: every one is optional and the server fills in its default. Optimal publish slots are chosen deterministically by the backend from a fixed table per network, converted to this timezone; the model never invents times. */
|
|
2697
2755
|
AiPlansAiPlanOptionsInput: {
|
|
2698
|
-
/** @description Whether images may be generated. Each image costs 70 AI credits. Optional; defaults to `true`. */
|
|
2756
|
+
/** @description Whether images may be generated. Each image costs 70 AI credits. Optional; defaults to `true`. Forced to `false` when the template does not generate images (`generates_images: false`), where the picture comes from the source and costs nothing. */
|
|
2699
2757
|
allow_images?: boolean;
|
|
2700
|
-
/** @description Upload ids from the organization's gallery used as visual reference for the generated images. */
|
|
2758
|
+
/** @description Upload ids from the organization's gallery used as visual reference for the generated images. They are references for the images the model GENERATES, so a template that does not generate them does not accept them either (`allows_gallery`): sending them to `from_images` or `from_catalog` is a 2106. */
|
|
2701
2759
|
gallery_uploads?: string[];
|
|
2702
2760
|
/** @description Language of the generated texts. Optional; defaults to `"es"`. */
|
|
2703
2761
|
language?: string;
|
|
@@ -2705,7 +2763,7 @@ interface components {
|
|
|
2705
2763
|
max_images?: number;
|
|
2706
2764
|
/** @description Days of the week the plan publishes on, in ISO 8601 numbering (1 = Monday ... 7 = Sunday). Defaults to the whole week. There is still at most ONE publication per day and account, so this is what bounds the size and the cost of the plan: the number of generated posts is (selected days x accounts). Must be a non-empty array of unique integers between 1 and 7, or the request is rejected with 2106. The 7-day window starts at week_start, so each ISO day appears exactly once: with a week_start in mid-week, day 1 (Monday) is the FOLLOWING Monday. If the selected days leave no future slot at all, the request is rejected with 2108. Optional; defaults to `[1,2,3,4,5,6,7]`. */
|
|
2707
2765
|
publish_days?: number[];
|
|
2708
|
-
/** @description Generate ONE piece of content per day and replicate it across every account, each scheduled at the best hour for ITS network, instead of one publication per account and day. Cheaper — one text and one image per day — and it caps images at 7. Optional; defaults to `false`. */
|
|
2766
|
+
/** @description Generate ONE piece of content per day and replicate it across every account, each scheduled at the best hour for ITS network, instead of one publication per account and day. Cheaper — one text and one image per day — and it caps images at 7. Optional; defaults to `false`. **Not every template accepts it** (`allows_shared` in `GET /planner_templates`): `from_images` and `from_catalog` do not, because each of their publications carries a photo of its own, and sending `true` to them is rejected with 2106. */
|
|
2709
2767
|
shared?: boolean;
|
|
2710
2768
|
/** @description IANA timezone for the optimal publish slots (typically the user's browser timezone). publish_date is stored in UTC. Optional; defaults to `"Europe/Madrid"`. */
|
|
2711
2769
|
timezone?: string;
|
|
@@ -2719,6 +2777,83 @@ interface components {
|
|
|
2719
2777
|
*/
|
|
2720
2778
|
week_start?: string;
|
|
2721
2779
|
};
|
|
2780
|
+
/** @description The plan source as it was STORED: a snapshot taken when the plan was created, not a live reference. It is what makes a retry reproduce the same plan even if the article went offline or the product left the catalogue — same reason as `organization_context`. */
|
|
2781
|
+
AiPlansAiPlanSource: {
|
|
2782
|
+
/** @description `campaign`. The event and its date, already normalised to the start of ITS day in the plan timezone. */
|
|
2783
|
+
event?: {
|
|
2784
|
+
/** Format: date-time */
|
|
2785
|
+
date?: string;
|
|
2786
|
+
name?: string;
|
|
2787
|
+
};
|
|
2788
|
+
/** @description `from_catalog`. The account whose catalogue was read. */
|
|
2789
|
+
id_account_catalog?: string;
|
|
2790
|
+
/** @description `from_images`. The chosen photos with their descriptions, in the order they were sent — the position IS the `source_index` of the publication that uses it. */
|
|
2791
|
+
images?: {
|
|
2792
|
+
description?: string;
|
|
2793
|
+
id_upload?: string;
|
|
2794
|
+
}[];
|
|
2795
|
+
/** @description `from_catalog`. Snapshot of the chosen products. */
|
|
2796
|
+
products?: components["schemas"]["AiPlansAiPlanSourceProduct"][];
|
|
2797
|
+
/** @description `from_text`. The article, already downloaded and truncated. It is never downloaded again. */
|
|
2798
|
+
text?: string;
|
|
2799
|
+
/** @description `from_text`. The original address, kept for the record and to show where the plan came from. */
|
|
2800
|
+
url?: string;
|
|
2801
|
+
};
|
|
2802
|
+
/** @description One photo of `from_images`. */
|
|
2803
|
+
AiPlansAiPlanSourceImageInput: {
|
|
2804
|
+
/** @description What is in the photo. **Mandatory on purpose**: without it the model writes about what it believes it sees, and with a product photo it gets the product wrong about half the time. */
|
|
2805
|
+
description: string;
|
|
2806
|
+
/** @description An upload of the organization. It has to be an image: a video or an audio is rejected here, not later at publish time. */
|
|
2807
|
+
id_upload: string;
|
|
2808
|
+
};
|
|
2809
|
+
/**
|
|
2810
|
+
* @description The plan's source, as you SEND it. **One shape per template**: send only the fields of the template you chose — what it does not read is ignored, and what it needs and does not get is a 2112.
|
|
2811
|
+
*
|
|
2812
|
+
* It is validated when the plan is **created**, not when it is generated: the article is downloaded, the catalogue is read live and the product pictures are copied. So a source that does not work fails while the user is still there and can fix it, and what gets stored is a SNAPSHOT — a retry three days later does not depend on the article still being online or the product still being in the catalogue.
|
|
2813
|
+
*
|
|
2814
|
+
* | Template | Fields |
|
|
2815
|
+
* | --- | --- |
|
|
2816
|
+
* | `standard` | none — no source |
|
|
2817
|
+
* | `from_images` | `images` |
|
|
2818
|
+
* | `from_text` | `url` **or** `text` |
|
|
2819
|
+
* | `from_catalog` | `id_account_catalog`, `product_catalog_id`, `products` |
|
|
2820
|
+
* | `campaign` | `event_name`, `event_date` |
|
|
2821
|
+
*/
|
|
2822
|
+
AiPlansAiPlanSourceInput: {
|
|
2823
|
+
/**
|
|
2824
|
+
* Format: date
|
|
2825
|
+
* @description `campaign`. The day of the event. **Send a calendar day, `YYYY-MM-DD` — never an ISO instant.** A bare date is read in the plan's `options.timezone`, which is the whole point: `2026-09-15T00:00:00Z` is midnight UTC, that is the 14th in the afternoon in New York — a whole day off in a countdown, for half of America, with no error anywhere. It cannot fall before the plan week (`options.week_start`) nor more than 60 days after it (2112). And it does **not** move `publish_days`: if the event lands on a day you did not choose, the plan respects your choice and it is up to you to say so.
|
|
2826
|
+
*/
|
|
2827
|
+
event_date?: string;
|
|
2828
|
+
/** @description `campaign`. What the countdown is towards ("Rebajas de verano", "Apertura del local"). Over 120 characters it is **rejected, not truncated**: a name cut mid-word would come out that way in all seven publications, and whatever else needs saying goes in `prompt`. */
|
|
2829
|
+
event_name?: string;
|
|
2830
|
+
/** @description `from_catalog`. Which account's catalogue the products come from. It has to belong to the organization (2103) and be on a network that supports products (2115). It only chooses the catalogue: the publications still go to every account in `accounts` — a LinkedIn account can publish a product from a Facebook catalogue. */
|
|
2831
|
+
id_account_catalog?: string;
|
|
2832
|
+
/** @description `from_images`. Your own photos, each with its own description, **in the order that tells the story**: the orchestrator picks one per publication and keeps its position in `source_index`, so photo 3 can be the "before" and photo 7 the "after". Up to 20 (`max_source_items`), and each one has to be an image upload of this organization (806 otherwise). */
|
|
2833
|
+
images?: components["schemas"]["AiPlansAiPlanSourceImageInput"][];
|
|
2834
|
+
/** @description `from_catalog`. The catalogue itself, as the network identifies it. */
|
|
2835
|
+
product_catalog_id?: string;
|
|
2836
|
+
/** @description `from_catalog`. Ids of the chosen products, **in the order they should tell the week**. Up to 12 — a unit here is not an id already in the database: it is a live read plus a real download inside this request, with the user waiting. Repeated ids are deduplicated. They are ALL checked against the catalogue before a single picture is downloaded (2112 naming the missing one), and each picture is copied into an upload of the organization: the network CDN URL expires, and a plan published weeks later would carry a broken file. Those uploads count against the storage quota. */
|
|
2837
|
+
products?: string[];
|
|
2838
|
+
/** @description `from_text`. The article pasted by hand. **It wins over `url`** when both come: pasting is what a user does when the download did not work (a paywall, a page that needs JavaScript), so re-downloading to ignore what they wrote would take away their only way out. Truncated to 12.000 characters — the cap is what keeps the estimate honest, since the real charge is per use. Under 200 characters it is not an article, it is the theme, which is `prompt` and another field (2116). */
|
|
2839
|
+
text?: string;
|
|
2840
|
+
/**
|
|
2841
|
+
* Format: uri
|
|
2842
|
+
* @description `from_text`. The article the plan is written from. It is downloaded at creation, and only `http`/`https` addresses that resolve to a **public** IP are accepted — checked again before every redirect (2114). A page that answers something that is not text or HTML, or that carries no usable text once stripped, is a 2113: paste the text in `text` instead.
|
|
2843
|
+
*/
|
|
2844
|
+
url?: string;
|
|
2845
|
+
};
|
|
2846
|
+
/** @description A product of the catalogue, copied when the plan was created. */
|
|
2847
|
+
AiPlansAiPlanSourceProduct: {
|
|
2848
|
+
description?: string;
|
|
2849
|
+
/** @description The id it has in the network catalogue. */
|
|
2850
|
+
external_id?: string;
|
|
2851
|
+
/** @description The product picture, copied into an upload of the organization. The network CDN URL expires; this one does not. */
|
|
2852
|
+
id_upload?: string;
|
|
2853
|
+
name?: string;
|
|
2854
|
+
/** @description The price **exactly as the network returned it** ("9,99 €"). It is never converted: the same field is a number in other paths of Meta's API and there is no way to tell units from cents, and dividing by 100 "just in case" is precisely how a 10 € product gets advertised at 0,10 €. The prompt is told to copy it verbatim or to say nothing. */
|
|
2855
|
+
price?: string;
|
|
2856
|
+
};
|
|
2722
2857
|
/**
|
|
2723
2858
|
* @description An app: the credentials a third-party integration authenticates with.
|
|
2724
2859
|
*
|
|
@@ -2796,6 +2931,56 @@ interface components {
|
|
|
2796
2931
|
/** @description The ratio as a number (width divided by height), which is what validation compares against. */
|
|
2797
2932
|
values: number[];
|
|
2798
2933
|
};
|
|
2934
|
+
CatalogPlannerTemplate: {
|
|
2935
|
+
/** @description Does it accept `options.gallery_uploads` (visual references for the generated images)? */
|
|
2936
|
+
allows_gallery?: boolean;
|
|
2937
|
+
/** @description Does it accept `options.shared` (one content replicated across every account)? */
|
|
2938
|
+
allows_shared?: boolean;
|
|
2939
|
+
/** @description false = the pictures come from the source, and the plan spends no image credits. */
|
|
2940
|
+
generates_images?: boolean;
|
|
2941
|
+
/** @description Hard cap of source units accepted. 0 = this template has no unit-based source. */
|
|
2942
|
+
max_source_items?: number;
|
|
2943
|
+
/** @description Estimated credits for this template's orchestration pass. The real charge is per use. */
|
|
2944
|
+
orchestration_cost?: number;
|
|
2945
|
+
/** @description Extra estimated credits per unit of source (per image, in `from_images`). 0 when the source does not scale the prompt. */
|
|
2946
|
+
orchestration_cost_per_source_item?: number;
|
|
2947
|
+
/** @description What can be regenerated on a publication of this plan. */
|
|
2948
|
+
regenerate?: {
|
|
2949
|
+
image?: boolean;
|
|
2950
|
+
text?: boolean;
|
|
2951
|
+
};
|
|
2952
|
+
source_fields?: components["schemas"]["CatalogPlannerTemplateField"][];
|
|
2953
|
+
/**
|
|
2954
|
+
* @description Fields of which AT LEAST ONE is needed, even though none of them is required on its own. Today it is `from_text`: either the URL or the pasted text, never both empty (2116).
|
|
2955
|
+
*
|
|
2956
|
+
* It exists because a field's `required` cannot say "one or the other", and without it your UI would have to hardcode that rule — exactly the copy this catalogue exists to avoid. Absent = there is nothing of the sort to resolve.
|
|
2957
|
+
*/
|
|
2958
|
+
source_requires_any?: string[];
|
|
2959
|
+
/**
|
|
2960
|
+
* @description What the plan is generated FROM, and what you send as `template` when creating it:
|
|
2961
|
+
*
|
|
2962
|
+
* • **`standard`** — a theme prompt, images generated by the model. What every plan was before templates existed.
|
|
2963
|
+
* • **`from_images`** — the user's own photos, each with its own description. One vision pass over ALL of them at once, so the model can sequence a narrative (photo 3 the "before", photo 7 the "after") instead of writing seven independent posts. It generates no images.
|
|
2964
|
+
* • **`from_text`** — an article: a URL that is downloaded at creation, or the text pasted by hand.
|
|
2965
|
+
* • **`from_catalog`** — products read LIVE from a connected catalogue, with their name, their price and their picture. The one template that cannot be copied by a generic AI tool, because it needs the catalogue connection.
|
|
2966
|
+
* • **`campaign`** — a countdown towards a date, with a narrative arc: teaser, announcement, reminder, today, thank you. The only plan that is a story instead of seven loose posts.
|
|
2967
|
+
* @enum {string}
|
|
2968
|
+
*/
|
|
2969
|
+
template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
2970
|
+
};
|
|
2971
|
+
/** @description One field of the source step. `uploads_with_description` (photos, each with its own description) and `catalog_products` (products read live from a connected catalogue) need a dedicated component; the rest are ordinary controls. */
|
|
2972
|
+
CatalogPlannerTemplateField: {
|
|
2973
|
+
default?: unknown;
|
|
2974
|
+
/** @description Cap in the field's **own units**: characters of a text, items of a list, and **days** of a `date` — the `event_date` of `campaign` carries 60, which is how far ahead of the plan week the countdown may point. */
|
|
2975
|
+
max?: number;
|
|
2976
|
+
/** @description Floor in the field's own units. Today only `from_text`: under 200 characters it is not an article, it is the theme, which is `prompt` and another field. Published for the same reason as `max` — without it your UI hardcodes the 200 and the user gets a 2116 AFTER pasting the text instead of while pasting it. */
|
|
2977
|
+
min?: number;
|
|
2978
|
+
name?: string;
|
|
2979
|
+
options?: string[];
|
|
2980
|
+
required?: boolean;
|
|
2981
|
+
/** @enum {string} */
|
|
2982
|
+
type?: "text" | "textarea" | "url" | "boolean" | "select" | "date" | "uploads_with_description" | "catalog_products";
|
|
2983
|
+
};
|
|
2799
2984
|
CatalogSocialLimits: {
|
|
2800
2985
|
/**
|
|
2801
2986
|
* @description Maximum length of a publication's text. Bluesky counts graphemes, everyone else counts characters — Telegram included, where `String.length` is exactly the right unit.
|
|
@@ -5255,14 +5440,20 @@ interface operations {
|
|
|
5255
5440
|
* | Code | Meaning |
|
|
5256
5441
|
* | --- | --- |
|
|
5257
5442
|
* | `1101` | Invalid organization |
|
|
5258
|
-
* | `806` | Invalid upload identifier. One of the gallery_uploads does not belong to the organization. |
|
|
5443
|
+
* | `806` | Invalid upload identifier. One of the gallery_uploads, or one of the `source.images`, does not belong to the organization. |
|
|
5259
5444
|
* | `924` | Max publications reached per month. There is no room in the organization's monthly publication limit for the generated posts. |
|
|
5260
5445
|
* | `941` | AI credits exhausted for this month. The base cost of the plan exceeds the remaining AI credits. The response data carries { used, limit, cost }. |
|
|
5261
5446
|
* | `2101` | This functionality requires a plan with artificial intelligence (available from the basic plan). |
|
|
5262
|
-
* | `2103` | All accounts must belong to the organization. |
|
|
5447
|
+
* | `2103` | All accounts must belong to the organization. Also when `source.id_account_catalog` is not one of them. |
|
|
5263
5448
|
* | `2105` | AI plan requires at least one account. |
|
|
5264
|
-
* | `2106` | Invalid AI plan options (missing prompt, invalid timezone, invalid week_start, invalid max_images or invalid publish_days). |
|
|
5449
|
+
* | `2106` | Invalid AI plan options (missing prompt, invalid timezone, invalid week_start, invalid max_images or invalid publish_days). Also when an option is not accepted by the chosen template: `shared` on one whose `allows_shared` is false, or `gallery_uploads` on one whose `allows_gallery` is false. |
|
|
5265
5450
|
* | `2108` | The selected publish days leave no available slot in the plan week: every slot of the chosen days is already in the past. Pick more days or a later week_start. The response data carries { publish_days, week_start, timezone }. |
|
|
5451
|
+
* | `2111` | Invalid planner template: `template` is not one of the ones published by `GET /planner_templates`. |
|
|
5452
|
+
* | `2112` | Invalid or missing `source` for the chosen template: a field is missing, an id is not valid, there are more units than `max_source_items`, an image has no description, a product is no longer in the catalogue, or the event date falls before the plan week or more than 60 days after it. `data` says which one and why. |
|
|
5453
|
+
* | `2113` | Could not read the source URL (`from_text`): the download failed, answered something that is not text or HTML, or the page carried no usable text. Paste the article in `source.text` instead. |
|
|
5454
|
+
* | `2114` | The source URL points to a non-public address (`from_text`): loopback, private, link-local or CGNAT. Checked before every redirect and again when the socket opens. |
|
|
5455
|
+
* | `2115` | The selected account has no usable product catalogue (`from_catalog`): its network has no products, or the catalogue could not be read — expired token, deleted catalogue, missing permission — or came back empty. |
|
|
5456
|
+
* | `2116` | The source has no usable items: no images, no products, or no text at all (neither `url` nor `text`, or a pasted text under 200 characters). |
|
|
5266
5457
|
* | `521` | Invalid client. The identifier is invalid or doesn't exist |
|
|
5267
5458
|
*/
|
|
5268
5459
|
400: {
|
|
@@ -5431,7 +5622,7 @@ interface operations {
|
|
|
5431
5622
|
*
|
|
5432
5623
|
* | Code | Meaning |
|
|
5433
5624
|
* | --- | --- |
|
|
5434
|
-
* | `2102` | The plan is not under review
|
|
5625
|
+
* | `2102` | The plan is not under review (only a `generated` plan can be regenerated), or this plan template does not allow regenerating that target — read `regenerate` in `GET /planner_templates` |
|
|
5435
5626
|
* | `2106` | Invalid `target`: it has to be `text` or `image` |
|
|
5436
5627
|
* | `935` | That publication does not belong to this plan, or is no longer a draft |
|
|
5437
5628
|
* | `941` | AI credits exhausted for this month |
|
|
@@ -10313,6 +10504,37 @@ interface operations {
|
|
|
10313
10504
|
};
|
|
10314
10505
|
};
|
|
10315
10506
|
};
|
|
10507
|
+
getPlannerTemplates: {
|
|
10508
|
+
parameters: {
|
|
10509
|
+
query?: never;
|
|
10510
|
+
header?: never;
|
|
10511
|
+
path?: never;
|
|
10512
|
+
cookie?: never;
|
|
10513
|
+
};
|
|
10514
|
+
requestBody?: never;
|
|
10515
|
+
responses: {
|
|
10516
|
+
/** @description Available planner templates */
|
|
10517
|
+
200: {
|
|
10518
|
+
headers: {
|
|
10519
|
+
[name: string]: unknown;
|
|
10520
|
+
};
|
|
10521
|
+
content: {
|
|
10522
|
+
"application/json": {
|
|
10523
|
+
templates?: components["schemas"]["CatalogPlannerTemplate"][];
|
|
10524
|
+
};
|
|
10525
|
+
};
|
|
10526
|
+
};
|
|
10527
|
+
/** @description Error */
|
|
10528
|
+
400: {
|
|
10529
|
+
headers: {
|
|
10530
|
+
[name: string]: unknown;
|
|
10531
|
+
};
|
|
10532
|
+
content: {
|
|
10533
|
+
"application/json": components["schemas"]["Error"];
|
|
10534
|
+
};
|
|
10535
|
+
};
|
|
10536
|
+
};
|
|
10537
|
+
};
|
|
10316
10538
|
getPublicationLimits: {
|
|
10317
10539
|
parameters: {
|
|
10318
10540
|
query?: never;
|
|
@@ -10718,6 +10940,38 @@ type SocialCapabilities = Schemas["CommentsSocialCapabilities"];
|
|
|
10718
10940
|
* administrador de ese grupo (error 969 si no).
|
|
10719
10941
|
*/
|
|
10720
10942
|
type CommentActions = Schemas["CommentsCommentActions"];
|
|
10943
|
+
/**
|
|
10944
|
+
* De QUE se genera un plan: la fuente del contenido, no un flujo distinto del asistente.
|
|
10945
|
+
*
|
|
10946
|
+
* `shared`, `publish_days`, `language`, `tone` y las imagenes siguen siendo opciones transversales,
|
|
10947
|
+
* y cada plantilla declara cuales admite. Es una enumeracion ABIERTA por lo mismo que las redes: la
|
|
10948
|
+
* lista crece, y una plantilla nueva en el servidor no puede dejar de compilar el codigo de quien
|
|
10949
|
+
* no ha actualizado el paquete.
|
|
10950
|
+
*/
|
|
10951
|
+
type PlannerTemplateName = OpenEnum<NonNullable<Schemas["CatalogPlannerTemplate"]["template"]>>;
|
|
10952
|
+
/**
|
|
10953
|
+
* Una plantilla del planificador, tal y como la publica `GET /planner_templates`.
|
|
10954
|
+
*
|
|
10955
|
+
* **`generates_images: false` significa que las fotos las pone la FUENTE** —las del usuario, las
|
|
10956
|
+
* del catalogo— y el plan no gasta ni un credito de imagen: la misma semana de 7 publicaciones con
|
|
10957
|
+
* foto pasa de 519 creditos a 48. Es lo que hay que decir ANTES de crear el plan, no despues.
|
|
10958
|
+
*
|
|
10959
|
+
* Y `regenerate` es por plantilla: la que no genero la imagen tampoco puede regenerarla. Ofrecer
|
|
10960
|
+
* ese boton igualmente es cobrarle al usuario 70 creditos por sustituir su propia foto por una
|
|
10961
|
+
* inventada.
|
|
10962
|
+
*/
|
|
10963
|
+
type PlannerTemplate = Schemas["CatalogPlannerTemplate"];
|
|
10964
|
+
/**
|
|
10965
|
+
* Un campo del paso de fuente.
|
|
10966
|
+
*
|
|
10967
|
+
* `max` y `min` van en las unidades DEL CAMPO: caracteres de un texto, elementos de una lista y
|
|
10968
|
+
* **dias** de una fecha —los 60 de `event_date` son cuanto puede alejarse el evento de la semana
|
|
10969
|
+
* del plan—. `uploads_with_description` y `catalog_products` son la senal de que ese campo
|
|
10970
|
+
* necesita un componente propio; los demas son controles corrientes.
|
|
10971
|
+
*/
|
|
10972
|
+
type PlannerTemplateField = Schemas["CatalogPlannerTemplateField"];
|
|
10973
|
+
/** El control de un campo de fuente. Abierto: el catalogo de tipos ya se ha ampliado antes. */
|
|
10974
|
+
type PlannerTemplateFieldType = OpenEnum<NonNullable<PlannerTemplateField["type"]>>;
|
|
10721
10975
|
/**
|
|
10722
10976
|
* Los recursos que reparte un plan. En un cliente es lo contratado; en una organizacion, la
|
|
10723
10977
|
* porcion que se le asigno.
|
|
@@ -11135,6 +11389,13 @@ type IntegrationPickerConfig = Operations["getIntegrationPickerConfig"]["respons
|
|
|
11135
11389
|
* plan lo devuelve con las publicaciones enteras y sus ficheros, y el LISTADO devuelve sus
|
|
11136
11390
|
* identificadores. `organization_context` es una FOTO del contexto de marca de la organizacion en
|
|
11137
11391
|
* el momento de crear el plan, no el de ahora: es lo que hace que un reintento sea reproducible.
|
|
11392
|
+
*
|
|
11393
|
+
* `template` viene SIEMPRE —un plan anterior a las plantillas se lee `standard`— y `source` es la
|
|
11394
|
+
* misma clase de foto que `organization_context`: el articulo ya descargado, las fotos elegidas o
|
|
11395
|
+
* los productos copiados, no una referencia viva. Por eso un reintento tres dias despues no depende
|
|
11396
|
+
* de que el articulo siga en linea ni de que el producto siga en el catalogo.
|
|
11397
|
+
*
|
|
11398
|
+
* Y `warnings` no es un error: son avisos del ULTIMO intento sobre un plan que se genero bien.
|
|
11138
11399
|
*/
|
|
11139
11400
|
type AiPlan = Schemas["AiPlansAiPlan"];
|
|
11140
11401
|
/** El estado de un plan. `pending` y `generating` son los dos que hay que sondear. */
|
|
@@ -11143,8 +11404,60 @@ type AiPlanState = OpenEnum<AiPlan["state"]>;
|
|
|
11143
11404
|
type AiPlanOptions = Schemas["AiPlansAiPlanOptions"];
|
|
11144
11405
|
/** Las opciones tal y como se MANDAN: todas opcionales, los defaults los pone el servidor. */
|
|
11145
11406
|
type AiPlanOptionsInput = Schemas["AiPlansAiPlanOptionsInput"];
|
|
11146
|
-
/**
|
|
11407
|
+
/**
|
|
11408
|
+
* Lo que se manda para encolar un plan.
|
|
11409
|
+
*
|
|
11410
|
+
* `template` y `source` son OPCIONALES: sin ellos el plan es `standard`, que es exactamente lo que
|
|
11411
|
+
* hacia cualquier plan antes de que existieran las plantillas. Mandar una opcion que la plantilla
|
|
11412
|
+
* elegida no admite —un `shared` en `from_images`— es un 2106, no un silencio.
|
|
11413
|
+
*/
|
|
11147
11414
|
type AiPlanCreateRequest = Schemas["AiPlansAiPlanCreateRequest"];
|
|
11415
|
+
/**
|
|
11416
|
+
* La fuente del plan, tal y como se MANDA. **Una forma por plantilla**: manda solo los campos de la
|
|
11417
|
+
* que elegiste —lo que no lee se ignora, y lo que necesita y no recibe es un 2112—.
|
|
11418
|
+
*
|
|
11419
|
+
* | Plantilla | Campos |
|
|
11420
|
+
* | --- | --- |
|
|
11421
|
+
* | `standard` | ninguno: no tiene fuente |
|
|
11422
|
+
* | `from_images` | `images` |
|
|
11423
|
+
* | `from_text` | `url` **o** `text` |
|
|
11424
|
+
* | `from_catalog` | `id_account_catalog`, `product_catalog_id`, `products` |
|
|
11425
|
+
* | `campaign` | `event_name`, `event_date` |
|
|
11426
|
+
*
|
|
11427
|
+
* Se valida al CREAR el plan, no al generarlo: el articulo se descarga, el catalogo se lee en vivo
|
|
11428
|
+
* y las fotos de los productos se copian, asi que una fuente que no funciona falla mientras el
|
|
11429
|
+
* usuario sigue delante. Dos trampas que el tipo no puede decir: `text` GANA sobre `url` cuando
|
|
11430
|
+
* llegan los dos —pegar el texto es lo que hace quien no consiguio que se descargara—, y
|
|
11431
|
+
* `event_date` es un DIA DE CALENDARIO (`YYYY-MM-DD`), nunca un instante ISO.
|
|
11432
|
+
*/
|
|
11433
|
+
type AiPlanSourceInput = Schemas["AiPlansAiPlanSourceInput"];
|
|
11434
|
+
/** Una foto de `from_images`. La descripcion es obligatoria a proposito: sin ella el modelo escribe sobre lo que cree ver. */
|
|
11435
|
+
type AiPlanSourceImageInput = Schemas["AiPlansAiPlanSourceImageInput"];
|
|
11436
|
+
/**
|
|
11437
|
+
* La fuente tal y como quedo GUARDADA: una foto del momento de crear el plan, no una referencia
|
|
11438
|
+
* viva. Es lo que hace que un reintento reproduzca el mismo plan.
|
|
11439
|
+
*/
|
|
11440
|
+
type AiPlanSource = Schemas["AiPlansAiPlanSource"];
|
|
11441
|
+
/**
|
|
11442
|
+
* Un producto del catalogo, copiado al crear el plan.
|
|
11443
|
+
*
|
|
11444
|
+
* `price` viene **exactamente como lo devolvio la red** (`"9,99 €"`) y no se convierte nunca: el
|
|
11445
|
+
* mismo campo es un numero en otros caminos de la API de Meta y no hay forma de saber si son
|
|
11446
|
+
* unidades o centimos. Dividir por 100 "por si acaso" es como se anuncia un producto de 10 € a
|
|
11447
|
+
* 0,10 €. Y `id_upload` es la foto ya copiada a un fichero de la organizacion, porque la URL del
|
|
11448
|
+
* CDN de la red caduca.
|
|
11449
|
+
*/
|
|
11450
|
+
type AiPlanSourceProduct = Schemas["AiPlansAiPlanSourceProduct"];
|
|
11451
|
+
/**
|
|
11452
|
+
* Algo que el plan tiene que decir de si mismo, con la forma de un error de la API. Lo comparten
|
|
11453
|
+
* `error` (solo en estado `failed`) y `warnings` (en un plan que se genero bien).
|
|
11454
|
+
*
|
|
11455
|
+
* Hoy hay un aviso: **2117 — parte de la fuente no cabia en la semana del plan**. Un plan es
|
|
11456
|
+
* SEMANAL y la fuente no lo alarga, asi que 12 fotos con 6 huecos libres publican 6 y las demas se
|
|
11457
|
+
* quedan fuera; `data` trae `{source_items, capacity}`. Se dice mejor ANTES de crear el plan —los
|
|
11458
|
+
* huecos son los dias de publicacion por las cuentas— que despues de haberlo cobrado.
|
|
11459
|
+
*/
|
|
11460
|
+
type AiPlanNotice = Schemas["AiPlansAiPlanNotice"];
|
|
11148
11461
|
/**
|
|
11149
11462
|
* El presupuesto DETERMINISTA de un plan, calculado por el servidor y nunca por el modelo.
|
|
11150
11463
|
*
|
|
@@ -11703,4 +12016,4 @@ interface PlanVortexWebhooksOptions {
|
|
|
11703
12016
|
*/
|
|
11704
12017
|
declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
|
|
11705
12018
|
|
|
11706
|
-
export { type
|
|
12019
|
+
export { type SocialCredentialsInput as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type ConnectToken as Z, type AiContext as _, type ConnectResult as a, type PlannerTemplateFieldType as a$, type Product as a0, type ProductInput as a1, type ProductCatalog as a2, type ProductCatalogInput as a3, type PublicationInput as a4, type PublicationState as a5, type PublicationStats as a6, type PublicationStatsHistory as a7, type Upload as a8, AccountError as a9, FileError as aA, type FileFormat as aB, type FileProperties as aC, type FileType as aD, IntegrationError as aE, type IntegrationErrorChange as aF, type MessageChange as aG, type MessageOptions as aH, type MessageType as aI, MessagingError as aJ, type MetricRow as aK, NO_ERROR_CODE as aL, type components as aM, type operations as aN, type paths as aO, type webhooks as aP, type OpenEnum as aQ, OrganizationError as aR, PLANVORTEX_ERROR_RANGES as aS, PlanLimitError as aT, PlanVortexAuthenticationError as aU, PlanVortexConfigError as aV, PlanVortexConnectionError as aW, PlanVortexError as aX, type PlanVortexErrorOptions as aY, type PlanVortexErrorRange as aZ, type PlannerTemplateField as a_, type AccountMetricRow as aa, type AccountStateChange as ab, type AccountWebhookChangeBase as ac, type AccountWithError as ad, type AiPlanCostEstimate as ae, AiPlanError as af, type AiPlanNotice as ag, type AiPlanOptions as ah, type AiPlanOptionsInput as ai, type AiPlanSource as aj, type AiPlanSourceImageInput as ak, type AiPlanSourceInput as al, type AiPlanSourceProduct as am, type AiPlanState as an, type ApiErrorBody as ao, type AspectRatios as ap, AuthError as aq, type ClientPlan as ar, type CommentAuthor as as, type CommentChange as at, type ContactChannel as au, ContactError as av, type DashboardAiPlanRef as aw, type DashboardPublicationRef as ax, type DashboardRange as ay, type EngagementBase as az, type AccountMetrics as b, type PlannerTemplateName as b0, ProductError as b1, PublicationError as b2, type PublicationErrorDetail as b3, type PublicationMetrics as b4, type PublicationStatsPoint as b5, type PublicationType as b6, type PublicationsSummary as b7, type RssConfig as b8, type SocialAuthorizationMethod as b9, type PlanVortexWebhooksOptions as bA, type RawWebhookBody as bB, type VerifyWebhookSignatureOptions as bC, WEBHOOK_EVENTS as bD, WEBHOOK_SIGNATURE_HEADERS as bE, WebhookBodyError as bF, type WebhookHeaders as bG, type WebhookRequestLike as bH, type WebhookResponseLike as bI, WebhookSignatureError as bJ, handleWebhookRequest as bK, isAccountStateChange as bL, isCommentChange as bM, isIntegrationErrorChange as bN, isMessageChange as bO, parseWebhookPayload as bP, planvortexWebhooks as bQ, verifyWebhookSignature as bR, type SocialCredentials as ba, type SocialIdentifier as bb, type SocialIdentifierInput as bc, type SocialLimitsMap as bd, TOKEN_ERROR_CODES as be, type TopPublication as bf, type UnknownWebhookChange as bg, UserError as bh, type WebhookAlgorithm as bi, type WebhookChange as bj, type WebhookEvent as bk, type WithAccount as bl, type WithPublication as bm, account as bn, accountId as bo, errorFamilyForCode as bp, isPlanVortexError as bq, isTokenError as br, messageContact as bs, messageContactId as bt, messageDirection as bu, messageFileIds as bv, messageFiles as bw, publication as bx, publicationId as by, type HandleWebhookRequestOptions as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };
|
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var path = require('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.5.0";
|
|
8
8
|
|
|
9
9
|
// src/core/errors.ts
|
|
10
10
|
var PLANVORTEX_ERROR_RANGES = [
|
|
@@ -809,6 +809,29 @@ var AiPlansResource = class extends Resource {
|
|
|
809
809
|
* options: { publish_days: [1, 3, 5], timezone: "Europe/Madrid" },
|
|
810
810
|
* });
|
|
811
811
|
* ```
|
|
812
|
+
*
|
|
813
|
+
* Con plantilla van además `template` y su `source`, que **se valida aquí**: la URL se descarga
|
|
814
|
+
* y el catálogo se lee dentro de esta llamada, así que sus errores llegan mientras el usuario
|
|
815
|
+
* sigue delante — 2111 (plantilla que no existe), 2112 (fuente que no cuadra con la plantilla),
|
|
816
|
+
* 2113 (la URL no se pudo leer), 2114 (la URL apunta a una dirección no pública), 2115 (la
|
|
817
|
+
* cuenta no tiene un catálogo utilizable) y 2116 (la fuente se quedó sin unidades).
|
|
818
|
+
*
|
|
819
|
+
* ```ts
|
|
820
|
+
* await pv.aiPlans.create(clientId, orgId, {
|
|
821
|
+
* prompt: "Nuestra carta de otoño",
|
|
822
|
+
* accounts: [accountId],
|
|
823
|
+
* template: "from_images",
|
|
824
|
+
* source: {
|
|
825
|
+
* images: [
|
|
826
|
+
* { id_upload: primera, description: "Masa reposando en el banco" },
|
|
827
|
+
* { id_upload: segunda, description: "La hogaza saliendo del horno" },
|
|
828
|
+
* ],
|
|
829
|
+
* },
|
|
830
|
+
* });
|
|
831
|
+
* ```
|
|
832
|
+
*
|
|
833
|
+
* **El orden de `images` y de `products` es la historia**: el orquestador se queda con la
|
|
834
|
+
* posición de cada uno, así que la foto 3 puede ser el "antes" y la 7 el "después".
|
|
812
835
|
*/
|
|
813
836
|
async create(idClient, idOrganization, body, options = {}) {
|
|
814
837
|
return this.httpPost(this.path(idClient, idOrganization), body, options);
|
|
@@ -882,6 +905,12 @@ var AiPlansResource = class extends Resource {
|
|
|
882
905
|
* Regenera con IA el texto o la imagen de UNA publicación del plan. **Cuesta créditos** cada vez.
|
|
883
906
|
*
|
|
884
907
|
* `credits_spent` de la respuesta es el total del plan, no lo que costó esta llamada.
|
|
908
|
+
*
|
|
909
|
+
* **`"image"` depende de la plantilla del plan**, no sólo de que el plan permitiera imágenes:
|
|
910
|
+
* la que no generó la imagen tampoco la regenera. Míralo en `regenerate.image` de
|
|
911
|
+
* {@link CatalogResource.plannerTemplates} antes de ofrecer el botón — en `from_images` y en
|
|
912
|
+
* `from_catalog` sería cobrarle 70 créditos al usuario por sustituir su propia foto por una
|
|
913
|
+
* inventada.
|
|
885
914
|
*/
|
|
886
915
|
async regenerate(idClient, idOrganization, idAiPlan, idPublication, target, options = {}) {
|
|
887
916
|
return this.httpPost(
|
|
@@ -1085,6 +1114,37 @@ var CatalogResource = class extends Resource {
|
|
|
1085
1114
|
() => this.httpGet("/allowed_aspect_ratios", void 0, options)
|
|
1086
1115
|
);
|
|
1087
1116
|
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Las plantillas del planificador de IA: de QUÉ se puede generar un plan y qué admite cada
|
|
1119
|
+
* fuente. Se manda la elegida como `template` al crear el plan, junto con su `source`.
|
|
1120
|
+
*
|
|
1121
|
+
* Es catálogo por la misma razón que los límites —quien valida es quien anuncia—, y aquí la
|
|
1122
|
+
* copia sale especialmente cara porque son **precios**: una tabla escrita a mano en tu interfaz
|
|
1123
|
+
* enseñaría un coste que el servidor ya no cobra.
|
|
1124
|
+
*
|
|
1125
|
+
* Lo que hay que leer de aquí y no dar por sabido:
|
|
1126
|
+
*
|
|
1127
|
+
* - **`generates_images: false` es que las fotos las pone la fuente**, y entonces el plan no
|
|
1128
|
+
* gasta ni un crédito de imagen. La misma semana de 7 publicaciones con foto pasa de 519
|
|
1129
|
+
* créditos a 48, y eso se dice ANTES de crear el plan.
|
|
1130
|
+
* - **`regenerate` es por plantilla.** La que no generó la imagen tampoco la regenera: pintar
|
|
1131
|
+
* ese botón igualmente le cuesta al usuario 70 créditos por cambiar su propia foto por una
|
|
1132
|
+
* inventada.
|
|
1133
|
+
* - **`orchestration_cost` es una ESTIMACIÓN**, no la factura: se cobra por uso.
|
|
1134
|
+
* `orchestration_cost_per_source_item` es lo que añade cada unidad de la fuente.
|
|
1135
|
+
* - **Un plan es SEMANAL y la fuente no lo alarga.** Con más unidades que huecos quedan en la
|
|
1136
|
+
* semana, las de más se descartan y el plan trae el aviso 2117 en `warnings`.
|
|
1137
|
+
* - **`source_fields` es de lo que está hecho el paso de fuente**, con sus propios `max` y
|
|
1138
|
+
* `min` —en las unidades del campo: caracteres, elementos, o **días** en una fecha— y
|
|
1139
|
+
* `source_requires_any` nombrando los campos de los que hace falta al menos uno (en
|
|
1140
|
+
* `from_text`, la URL o el texto pegado).
|
|
1141
|
+
*/
|
|
1142
|
+
async plannerTemplates(options) {
|
|
1143
|
+
return this.cached(
|
|
1144
|
+
"/planner_templates",
|
|
1145
|
+
() => this.getOne("/planner_templates", "templates", void 0, options)
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1088
1148
|
/** Tira la caché. Para un proceso largo que quiera enterarse de una red nueva sin reiniciar. */
|
|
1089
1149
|
clearCache() {
|
|
1090
1150
|
this.cache.clear();
|