planvortex 0.4.0 → 0.6.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 +50 -2
- package/dist/{index-DvnKrGy_.d.cts → index-B7gbjlNe.d.cts} +496 -22
- package/dist/{index-DvnKrGy_.d.ts → index-B7gbjlNe.d.ts} +496 -22
- package/dist/index.cjs +114 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -13
- package/dist/index.d.ts +142 -13
- package/dist/index.js +114 -7
- 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
|
@@ -341,7 +341,9 @@ interface paths {
|
|
|
341
341
|
* List AI publication plans
|
|
342
342
|
* @description Return the organization's AI plans ordered by creation date (desc), paginated. Requires the ai_plans:read permission.
|
|
343
343
|
*
|
|
344
|
-
* **
|
|
344
|
+
* **Active plans by default, archived ones with `archived=true`** — never both at once. Archiving is visibility only (see `POST .../archive`): the plan leaves this listing and keeps every publication it had.
|
|
345
|
+
*
|
|
346
|
+
* **Cancelled plans are not listed either.** Deleting a plan sets it to `cancelled` rather than removing it, and this listing filters those out — so a plan you deleted simply stops appearing, while `GET` by id still returns it.
|
|
345
347
|
*
|
|
346
348
|
* Without `limit` the whole list comes back.
|
|
347
349
|
*/
|
|
@@ -349,7 +351,7 @@ interface paths {
|
|
|
349
351
|
put?: never;
|
|
350
352
|
/**
|
|
351
353
|
* 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.
|
|
354
|
+
* @description Create a weekly AI publication plan. The plan is queued in state 'pending' and generated asynchronously by the generate-ai-plans job; poll GET by id while state is pending or generating. Validations at creation: the client plan allows AI (artificial_inteligence), the accounts belong to the organization, there are enough AI credits for the deterministic base cost (orchestration + target texts), and there is room in the organization's monthly publication limit. Returns the created plan together with the deterministic cost estimate. Requires the ai_plans:create permission. Since the plan can be generated from a SOURCE (`template` + `source`), part of that validation is the source itself: the article is downloaded, the catalogue is read live and the product pictures are copied — all of it inside this request, so what does not work fails with the user in front of it. A plan whose source did not fit in the week is still created, and says so in ai_plan.warnings (2117).
|
|
353
355
|
*/
|
|
354
356
|
post: operations["addAiPlan"];
|
|
355
357
|
delete?: never;
|
|
@@ -373,8 +375,12 @@ interface paths {
|
|
|
373
375
|
put?: never;
|
|
374
376
|
post?: never;
|
|
375
377
|
/**
|
|
376
|
-
*
|
|
377
|
-
* @description
|
|
378
|
+
* Delete an AI publication plan and its pending publications
|
|
379
|
+
* @description Delete the plan **and every publication of it that has not gone out yet**: the generated drafts and, if the plan was already validated, whatever was still scheduled. Two states are deliberately left alone: `sended`, because it is already live on the network and deleting it here would only lose its history while the post stays up, and `publishing`, which the publishing job holds at that very moment.
|
|
380
|
+
*
|
|
381
|
+
* AI credits already spent on generation are NOT refunded (same criterion as X: if the provider charged, we charge). A plan being generated cannot be deleted (state `generating`, error 2102): wait for the job to finish.
|
|
382
|
+
*
|
|
383
|
+
* To keep the plan and its publications and only take it out of the listing, archive it instead (`POST .../archive`). Requires the ai_plans:delete permission.
|
|
378
384
|
*/
|
|
379
385
|
delete: operations["deleteAiPlan"];
|
|
380
386
|
options?: never;
|
|
@@ -382,6 +388,28 @@ interface paths {
|
|
|
382
388
|
patch?: never;
|
|
383
389
|
trace?: never;
|
|
384
390
|
};
|
|
391
|
+
"/clients/{id_client}/organizations/{id_organization}/ai_plans/{id_ai_plan}/archive": {
|
|
392
|
+
parameters: {
|
|
393
|
+
query?: never;
|
|
394
|
+
header?: never;
|
|
395
|
+
path?: never;
|
|
396
|
+
cookie?: never;
|
|
397
|
+
};
|
|
398
|
+
get?: never;
|
|
399
|
+
put?: never;
|
|
400
|
+
/**
|
|
401
|
+
* Archive an AI publication plan
|
|
402
|
+
* @description Take the plan out of the default listing and move it to the archived one (`GET .../ai_plans?archived=true`). It is **visibility only**: no publication is touched — anything scheduled keeps publishing — no credits are refunded, and nothing is cancelled. It is reversible with `POST .../unarchive` and valid in **any state**, `generating` included, because it does not interrupt the generation job.
|
|
403
|
+
*
|
|
404
|
+
* Archiving an already archived plan just refreshes `archived_date`. Requires the ai_plans:update permission.
|
|
405
|
+
*/
|
|
406
|
+
post: operations["archiveAiPlan"];
|
|
407
|
+
delete?: never;
|
|
408
|
+
options?: never;
|
|
409
|
+
head?: never;
|
|
410
|
+
patch?: never;
|
|
411
|
+
trace?: never;
|
|
412
|
+
};
|
|
385
413
|
"/clients/{id_client}/organizations/{id_organization}/ai_plans/{id_ai_plan}/publications/{id_publication}/regenerate": {
|
|
386
414
|
parameters: {
|
|
387
415
|
query?: never;
|
|
@@ -398,6 +426,8 @@ interface paths {
|
|
|
398
426
|
* **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
427
|
*
|
|
400
428
|
* 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.
|
|
429
|
+
*
|
|
430
|
+
* **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
431
|
*/
|
|
402
432
|
post: operations["regenerateAiPlanPublication"];
|
|
403
433
|
delete?: never;
|
|
@@ -426,6 +456,26 @@ interface paths {
|
|
|
426
456
|
patch?: never;
|
|
427
457
|
trace?: never;
|
|
428
458
|
};
|
|
459
|
+
"/clients/{id_client}/organizations/{id_organization}/ai_plans/{id_ai_plan}/unarchive": {
|
|
460
|
+
parameters: {
|
|
461
|
+
query?: never;
|
|
462
|
+
header?: never;
|
|
463
|
+
path?: never;
|
|
464
|
+
cookie?: never;
|
|
465
|
+
};
|
|
466
|
+
get?: never;
|
|
467
|
+
put?: never;
|
|
468
|
+
/**
|
|
469
|
+
* Unarchive an AI publication plan
|
|
470
|
+
* @description Return the plan to the default listing: `archived_date` is cleared. Unarchiving a plan that was not archived does nothing and answers 200. Requires the ai_plans:update permission.
|
|
471
|
+
*/
|
|
472
|
+
post: operations["unarchiveAiPlan"];
|
|
473
|
+
delete?: never;
|
|
474
|
+
options?: never;
|
|
475
|
+
head?: never;
|
|
476
|
+
patch?: never;
|
|
477
|
+
trace?: never;
|
|
478
|
+
};
|
|
429
479
|
"/clients/{id_client}/organizations/{id_organization}/ai_plans/{id_ai_plan}/validate": {
|
|
430
480
|
parameters: {
|
|
431
481
|
query?: never;
|
|
@@ -2234,6 +2284,35 @@ interface paths {
|
|
|
2234
2284
|
patch?: never;
|
|
2235
2285
|
trace?: never;
|
|
2236
2286
|
};
|
|
2287
|
+
"/planner_templates": {
|
|
2288
|
+
parameters: {
|
|
2289
|
+
query?: never;
|
|
2290
|
+
header?: never;
|
|
2291
|
+
path?: never;
|
|
2292
|
+
cookie?: never;
|
|
2293
|
+
};
|
|
2294
|
+
/**
|
|
2295
|
+
* AI planner templates
|
|
2296
|
+
* @description What an AI plan can be generated FROM, and what each source allows.
|
|
2297
|
+
*
|
|
2298
|
+
* 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`.
|
|
2299
|
+
*
|
|
2300
|
+
* • **`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.
|
|
2301
|
+
* • **`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.
|
|
2302
|
+
* • **`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.
|
|
2303
|
+
* • **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.
|
|
2304
|
+
* • **`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.
|
|
2305
|
+
* • **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.
|
|
2306
|
+
*/
|
|
2307
|
+
get: operations["getPlannerTemplates"];
|
|
2308
|
+
put?: never;
|
|
2309
|
+
post?: never;
|
|
2310
|
+
delete?: never;
|
|
2311
|
+
options?: never;
|
|
2312
|
+
head?: never;
|
|
2313
|
+
patch?: never;
|
|
2314
|
+
trace?: never;
|
|
2315
|
+
};
|
|
2237
2316
|
"/publication_limits": {
|
|
2238
2317
|
parameters: {
|
|
2239
2318
|
query?: never;
|
|
@@ -2573,20 +2652,23 @@ interface components {
|
|
|
2573
2652
|
_id: string;
|
|
2574
2653
|
/** @description Accounts the plan was generated for. */
|
|
2575
2654
|
accounts: string[];
|
|
2655
|
+
/**
|
|
2656
|
+
* Format: date-time
|
|
2657
|
+
* @description When the plan was archived. Absent means it is active, which is how every plan created before archiving existed comes back.
|
|
2658
|
+
*
|
|
2659
|
+
* It is a field of its own and NOT a value of `state` on purpose: `state` is the generation lifecycle and archiving is orthogonal to it — a `validated` plan that already published gets archived just like a `failed` one. Inside the enum you would have to decide which state it returns to when unarchived, and that question has no answer.
|
|
2660
|
+
*
|
|
2661
|
+
* Archiving is visibility only: it takes the plan out of the default listing and touches no publication. Anything it had scheduled keeps publishing.
|
|
2662
|
+
*/
|
|
2663
|
+
archived_date?: string;
|
|
2576
2664
|
/** @description Generation attempts consumed (transient failures are retried, max 2). */
|
|
2577
2665
|
attempts: number;
|
|
2578
2666
|
/** Format: date-time */
|
|
2579
2667
|
creation_date: string;
|
|
2580
2668
|
/** @description AI credits actually consumed by the generation. */
|
|
2581
2669
|
credits_spent: number;
|
|
2582
|
-
/** @description Last generation error
|
|
2583
|
-
error?:
|
|
2584
|
-
code: number;
|
|
2585
|
-
data?: {
|
|
2586
|
-
[key: string]: unknown;
|
|
2587
|
-
};
|
|
2588
|
-
message: string;
|
|
2589
|
-
};
|
|
2670
|
+
/** @description Last generation error. Present only in state `failed`. */
|
|
2671
|
+
error?: components["schemas"]["AiPlansAiPlanNotice"];
|
|
2590
2672
|
/** Format: date-time */
|
|
2591
2673
|
generation_end_date?: string;
|
|
2592
2674
|
id_client: string;
|
|
@@ -2605,19 +2687,33 @@ interface components {
|
|
|
2605
2687
|
* **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
2688
|
*/
|
|
2607
2689
|
publications: (string | components["schemas"]["Publication"])[];
|
|
2690
|
+
/** @description The source snapshot. Absent on a `standard` plan, which has no source. */
|
|
2691
|
+
source?: components["schemas"]["AiPlansAiPlanSource"];
|
|
2608
2692
|
/**
|
|
2609
2693
|
* @description State machine: pending -> generating -> generated -> validated | failed | cancelled. Poll the plan while state is pending or generating.
|
|
2610
2694
|
* @enum {string}
|
|
2611
2695
|
*/
|
|
2612
2696
|
state: "pending" | "generating" | "generated" | "validated" | "failed" | "cancelled";
|
|
2697
|
+
/**
|
|
2698
|
+
* @description What this plan was generated from. Always present: a plan created before templates existed reads `standard`.
|
|
2699
|
+
* @enum {string}
|
|
2700
|
+
*/
|
|
2701
|
+
template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
2702
|
+
/**
|
|
2703
|
+
* @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.
|
|
2704
|
+
*
|
|
2705
|
+
* 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.
|
|
2706
|
+
*/
|
|
2707
|
+
warnings?: components["schemas"]["AiPlansAiPlanNotice"][];
|
|
2613
2708
|
};
|
|
2614
2709
|
/** @description Deterministic cost estimate computed by the backend (never by the model). BYOK scopes cost 0 credits. */
|
|
2615
2710
|
AiPlansAiPlanCostEstimate: {
|
|
2616
2711
|
available_credits: number;
|
|
2617
|
-
/** @description Mandatory cost (orchestration + target texts). The plan is rejected if this exceeds the available credits. */
|
|
2712
|
+
/** @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
2713
|
base_cost: number;
|
|
2619
2714
|
/** @description Total estimated cost including the financeable images (upper bound). */
|
|
2620
2715
|
estimated_cost: number;
|
|
2716
|
+
/** @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
2717
|
images_target: number;
|
|
2622
2718
|
texts_target: number;
|
|
2623
2719
|
};
|
|
@@ -2627,6 +2723,17 @@ interface components {
|
|
|
2627
2723
|
options?: components["schemas"]["AiPlansAiPlanOptionsInput"];
|
|
2628
2724
|
/** @description Theme prompt written by the user. */
|
|
2629
2725
|
prompt: string;
|
|
2726
|
+
/** @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. */
|
|
2727
|
+
source?: components["schemas"]["AiPlansAiPlanSourceInput"];
|
|
2728
|
+
/**
|
|
2729
|
+
* @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.
|
|
2730
|
+
*
|
|
2731
|
+
* 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.
|
|
2732
|
+
*
|
|
2733
|
+
* Read the list, the costs and the fields from `GET /planner_templates`; do not hardcode them.
|
|
2734
|
+
* @enum {string}
|
|
2735
|
+
*/
|
|
2736
|
+
template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
2630
2737
|
};
|
|
2631
2738
|
AiPlansAiPlanCreateResponse: {
|
|
2632
2739
|
ai_plan: components["schemas"]["AiPlansAiPlan"];
|
|
@@ -2638,6 +2745,14 @@ interface components {
|
|
|
2638
2745
|
ai_plans: components["schemas"]["AiPlansAiPlan"][];
|
|
2639
2746
|
total: number;
|
|
2640
2747
|
};
|
|
2748
|
+
/** @description Something the plan has to say about itself, in the same shape as an API error. */
|
|
2749
|
+
AiPlansAiPlanNotice: {
|
|
2750
|
+
code: number;
|
|
2751
|
+
data?: {
|
|
2752
|
+
[key: string]: unknown;
|
|
2753
|
+
};
|
|
2754
|
+
message: string;
|
|
2755
|
+
};
|
|
2641
2756
|
AiPlansAiPlanOne: {
|
|
2642
2757
|
ai_plan: components["schemas"]["AiPlansAiPlan"];
|
|
2643
2758
|
};
|
|
@@ -2695,9 +2810,9 @@ interface components {
|
|
|
2695
2810
|
};
|
|
2696
2811
|
/** @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
2812
|
AiPlansAiPlanOptionsInput: {
|
|
2698
|
-
/** @description Whether images may be generated. Each image costs 70 AI credits. Optional; defaults to `true`. */
|
|
2813
|
+
/** @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
2814
|
allow_images?: boolean;
|
|
2700
|
-
/** @description Upload ids from the organization's gallery used as visual reference for the generated images. */
|
|
2815
|
+
/** @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
2816
|
gallery_uploads?: string[];
|
|
2702
2817
|
/** @description Language of the generated texts. Optional; defaults to `"es"`. */
|
|
2703
2818
|
language?: string;
|
|
@@ -2705,7 +2820,7 @@ interface components {
|
|
|
2705
2820
|
max_images?: number;
|
|
2706
2821
|
/** @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
2822
|
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`. */
|
|
2823
|
+
/** @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
2824
|
shared?: boolean;
|
|
2710
2825
|
/** @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
2826
|
timezone?: string;
|
|
@@ -2719,6 +2834,83 @@ interface components {
|
|
|
2719
2834
|
*/
|
|
2720
2835
|
week_start?: string;
|
|
2721
2836
|
};
|
|
2837
|
+
/** @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`. */
|
|
2838
|
+
AiPlansAiPlanSource: {
|
|
2839
|
+
/** @description `campaign`. The event and its date, already normalised to the start of ITS day in the plan timezone. */
|
|
2840
|
+
event?: {
|
|
2841
|
+
/** Format: date-time */
|
|
2842
|
+
date?: string;
|
|
2843
|
+
name?: string;
|
|
2844
|
+
};
|
|
2845
|
+
/** @description `from_catalog`. The account whose catalogue was read. */
|
|
2846
|
+
id_account_catalog?: string;
|
|
2847
|
+
/** @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. */
|
|
2848
|
+
images?: {
|
|
2849
|
+
description?: string;
|
|
2850
|
+
id_upload?: string;
|
|
2851
|
+
}[];
|
|
2852
|
+
/** @description `from_catalog`. Snapshot of the chosen products. */
|
|
2853
|
+
products?: components["schemas"]["AiPlansAiPlanSourceProduct"][];
|
|
2854
|
+
/** @description `from_text`. The article, already downloaded and truncated. It is never downloaded again. */
|
|
2855
|
+
text?: string;
|
|
2856
|
+
/** @description `from_text`. The original address, kept for the record and to show where the plan came from. */
|
|
2857
|
+
url?: string;
|
|
2858
|
+
};
|
|
2859
|
+
/** @description One photo of `from_images`. */
|
|
2860
|
+
AiPlansAiPlanSourceImageInput: {
|
|
2861
|
+
/** @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. */
|
|
2862
|
+
description: string;
|
|
2863
|
+
/** @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. */
|
|
2864
|
+
id_upload: string;
|
|
2865
|
+
};
|
|
2866
|
+
/**
|
|
2867
|
+
* @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.
|
|
2868
|
+
*
|
|
2869
|
+
* 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.
|
|
2870
|
+
*
|
|
2871
|
+
* | Template | Fields |
|
|
2872
|
+
* | --- | --- |
|
|
2873
|
+
* | `standard` | none — no source |
|
|
2874
|
+
* | `from_images` | `images` |
|
|
2875
|
+
* | `from_text` | `url` **or** `text` |
|
|
2876
|
+
* | `from_catalog` | `id_account_catalog`, `product_catalog_id`, `products` |
|
|
2877
|
+
* | `campaign` | `event_name`, `event_date` |
|
|
2878
|
+
*/
|
|
2879
|
+
AiPlansAiPlanSourceInput: {
|
|
2880
|
+
/**
|
|
2881
|
+
* Format: date
|
|
2882
|
+
* @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.
|
|
2883
|
+
*/
|
|
2884
|
+
event_date?: string;
|
|
2885
|
+
/** @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`. */
|
|
2886
|
+
event_name?: string;
|
|
2887
|
+
/** @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. */
|
|
2888
|
+
id_account_catalog?: string;
|
|
2889
|
+
/** @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). */
|
|
2890
|
+
images?: components["schemas"]["AiPlansAiPlanSourceImageInput"][];
|
|
2891
|
+
/** @description `from_catalog`. The catalogue itself, as the network identifies it. */
|
|
2892
|
+
product_catalog_id?: string;
|
|
2893
|
+
/** @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. */
|
|
2894
|
+
products?: string[];
|
|
2895
|
+
/** @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). */
|
|
2896
|
+
text?: string;
|
|
2897
|
+
/**
|
|
2898
|
+
* Format: uri
|
|
2899
|
+
* @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.
|
|
2900
|
+
*/
|
|
2901
|
+
url?: string;
|
|
2902
|
+
};
|
|
2903
|
+
/** @description A product of the catalogue, copied when the plan was created. */
|
|
2904
|
+
AiPlansAiPlanSourceProduct: {
|
|
2905
|
+
description?: string;
|
|
2906
|
+
/** @description The id it has in the network catalogue. */
|
|
2907
|
+
external_id?: string;
|
|
2908
|
+
/** @description The product picture, copied into an upload of the organization. The network CDN URL expires; this one does not. */
|
|
2909
|
+
id_upload?: string;
|
|
2910
|
+
name?: string;
|
|
2911
|
+
/** @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. */
|
|
2912
|
+
price?: string;
|
|
2913
|
+
};
|
|
2722
2914
|
/**
|
|
2723
2915
|
* @description An app: the credentials a third-party integration authenticates with.
|
|
2724
2916
|
*
|
|
@@ -2796,6 +2988,56 @@ interface components {
|
|
|
2796
2988
|
/** @description The ratio as a number (width divided by height), which is what validation compares against. */
|
|
2797
2989
|
values: number[];
|
|
2798
2990
|
};
|
|
2991
|
+
CatalogPlannerTemplate: {
|
|
2992
|
+
/** @description Does it accept `options.gallery_uploads` (visual references for the generated images)? */
|
|
2993
|
+
allows_gallery?: boolean;
|
|
2994
|
+
/** @description Does it accept `options.shared` (one content replicated across every account)? */
|
|
2995
|
+
allows_shared?: boolean;
|
|
2996
|
+
/** @description false = the pictures come from the source, and the plan spends no image credits. */
|
|
2997
|
+
generates_images?: boolean;
|
|
2998
|
+
/** @description Hard cap of source units accepted. 0 = this template has no unit-based source. */
|
|
2999
|
+
max_source_items?: number;
|
|
3000
|
+
/** @description Estimated credits for this template's orchestration pass. The real charge is per use. */
|
|
3001
|
+
orchestration_cost?: number;
|
|
3002
|
+
/** @description Extra estimated credits per unit of source (per image, in `from_images`). 0 when the source does not scale the prompt. */
|
|
3003
|
+
orchestration_cost_per_source_item?: number;
|
|
3004
|
+
/** @description What can be regenerated on a publication of this plan. */
|
|
3005
|
+
regenerate?: {
|
|
3006
|
+
image?: boolean;
|
|
3007
|
+
text?: boolean;
|
|
3008
|
+
};
|
|
3009
|
+
source_fields?: components["schemas"]["CatalogPlannerTemplateField"][];
|
|
3010
|
+
/**
|
|
3011
|
+
* @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).
|
|
3012
|
+
*
|
|
3013
|
+
* 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.
|
|
3014
|
+
*/
|
|
3015
|
+
source_requires_any?: string[];
|
|
3016
|
+
/**
|
|
3017
|
+
* @description What the plan is generated FROM, and what you send as `template` when creating it:
|
|
3018
|
+
*
|
|
3019
|
+
* • **`standard`** — a theme prompt, images generated by the model. What every plan was before templates existed.
|
|
3020
|
+
* • **`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.
|
|
3021
|
+
* • **`from_text`** — an article: a URL that is downloaded at creation, or the text pasted by hand.
|
|
3022
|
+
* • **`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.
|
|
3023
|
+
* • **`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.
|
|
3024
|
+
* @enum {string}
|
|
3025
|
+
*/
|
|
3026
|
+
template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
|
|
3027
|
+
};
|
|
3028
|
+
/** @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. */
|
|
3029
|
+
CatalogPlannerTemplateField: {
|
|
3030
|
+
default?: unknown;
|
|
3031
|
+
/** @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. */
|
|
3032
|
+
max?: number;
|
|
3033
|
+
/** @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. */
|
|
3034
|
+
min?: number;
|
|
3035
|
+
name?: string;
|
|
3036
|
+
options?: string[];
|
|
3037
|
+
required?: boolean;
|
|
3038
|
+
/** @enum {string} */
|
|
3039
|
+
type?: "text" | "textarea" | "url" | "boolean" | "select" | "date" | "uploads_with_description" | "catalog_products";
|
|
3040
|
+
};
|
|
2799
3041
|
CatalogSocialLimits: {
|
|
2800
3042
|
/**
|
|
2801
3043
|
* @description Maximum length of a publication's text. Bluesky counts graphemes, everyone else counts characters — Telegram included, where `String.length` is exactly the right unit.
|
|
@@ -5172,6 +5414,8 @@ interface operations {
|
|
|
5172
5414
|
getAiPlans: {
|
|
5173
5415
|
parameters: {
|
|
5174
5416
|
query?: {
|
|
5417
|
+
/** @description `true` returns the archived plans instead of the active ones. Anything other than the literal string `true` is read as false. */
|
|
5418
|
+
archived?: boolean;
|
|
5175
5419
|
/** @description Maximum number of records to return (pagination) */
|
|
5176
5420
|
limit?: number;
|
|
5177
5421
|
/** @description Number of records to skip (pagination) */
|
|
@@ -5255,14 +5499,20 @@ interface operations {
|
|
|
5255
5499
|
* | Code | Meaning |
|
|
5256
5500
|
* | --- | --- |
|
|
5257
5501
|
* | `1101` | Invalid organization |
|
|
5258
|
-
* | `806` | Invalid upload identifier. One of the gallery_uploads does not belong to the organization. |
|
|
5502
|
+
* | `806` | Invalid upload identifier. One of the gallery_uploads, or one of the `source.images`, does not belong to the organization. |
|
|
5259
5503
|
* | `924` | Max publications reached per month. There is no room in the organization's monthly publication limit for the generated posts. |
|
|
5260
5504
|
* | `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
5505
|
* | `2101` | This functionality requires a plan with artificial intelligence (available from the basic plan). |
|
|
5262
|
-
* | `2103` | All accounts must belong to the organization. |
|
|
5506
|
+
* | `2103` | All accounts must belong to the organization. Also when `source.id_account_catalog` is not one of them. |
|
|
5263
5507
|
* | `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). |
|
|
5508
|
+
* | `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
5509
|
* | `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 }. |
|
|
5510
|
+
* | `2111` | Invalid planner template: `template` is not one of the ones published by `GET /planner_templates`. |
|
|
5511
|
+
* | `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. |
|
|
5512
|
+
* | `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. |
|
|
5513
|
+
* | `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. |
|
|
5514
|
+
* | `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. |
|
|
5515
|
+
* | `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
5516
|
* | `521` | Invalid client. The identifier is invalid or doesn't exist |
|
|
5267
5517
|
*/
|
|
5268
5518
|
400: {
|
|
@@ -5385,6 +5635,57 @@ interface operations {
|
|
|
5385
5635
|
};
|
|
5386
5636
|
};
|
|
5387
5637
|
};
|
|
5638
|
+
archiveAiPlan: {
|
|
5639
|
+
parameters: {
|
|
5640
|
+
query?: never;
|
|
5641
|
+
header?: never;
|
|
5642
|
+
path: {
|
|
5643
|
+
/** @description AI plan identifier */
|
|
5644
|
+
id_ai_plan: components["parameters"]["AiPlansidAiPlan"];
|
|
5645
|
+
/** @description Client identifier */
|
|
5646
|
+
id_client: components["parameters"]["AiPlansidClient"];
|
|
5647
|
+
/** @description Organization identifier */
|
|
5648
|
+
id_organization: components["parameters"]["AiPlansidOrganization"];
|
|
5649
|
+
};
|
|
5650
|
+
cookie?: never;
|
|
5651
|
+
};
|
|
5652
|
+
requestBody?: never;
|
|
5653
|
+
responses: {
|
|
5654
|
+
/** @description Successful operation. Returns the plan with `archived_date` set. */
|
|
5655
|
+
200: {
|
|
5656
|
+
headers: {
|
|
5657
|
+
[name: string]: unknown;
|
|
5658
|
+
};
|
|
5659
|
+
content: {
|
|
5660
|
+
"application/json": components["schemas"]["AiPlansAiPlanOne"];
|
|
5661
|
+
};
|
|
5662
|
+
};
|
|
5663
|
+
/**
|
|
5664
|
+
* @description The request failed. The body carries the PlanVortex error code in `code`:
|
|
5665
|
+
*
|
|
5666
|
+
* | Code | Meaning |
|
|
5667
|
+
* | --- | --- |
|
|
5668
|
+
* | `1101` | Invalid organization |
|
|
5669
|
+
* | `2100` | AI plan doesn't exist. The identifier is invalid or doesn't exist. |
|
|
5670
|
+
* | `521` | Invalid client. The identifier is invalid or doesn't exist |
|
|
5671
|
+
*/
|
|
5672
|
+
400: {
|
|
5673
|
+
headers: {
|
|
5674
|
+
[name: string]: unknown;
|
|
5675
|
+
};
|
|
5676
|
+
content: {
|
|
5677
|
+
"application/json": components["schemas"]["Error"];
|
|
5678
|
+
};
|
|
5679
|
+
};
|
|
5680
|
+
/** @description Unhandled error by the server */
|
|
5681
|
+
500: {
|
|
5682
|
+
headers: {
|
|
5683
|
+
[name: string]: unknown;
|
|
5684
|
+
};
|
|
5685
|
+
content?: never;
|
|
5686
|
+
};
|
|
5687
|
+
};
|
|
5688
|
+
};
|
|
5388
5689
|
regenerateAiPlanPublication: {
|
|
5389
5690
|
parameters: {
|
|
5390
5691
|
query?: never;
|
|
@@ -5431,7 +5732,7 @@ interface operations {
|
|
|
5431
5732
|
*
|
|
5432
5733
|
* | Code | Meaning |
|
|
5433
5734
|
* | --- | --- |
|
|
5434
|
-
* | `2102` | The plan is not under review
|
|
5735
|
+
* | `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
5736
|
* | `2106` | Invalid `target`: it has to be `text` or `image` |
|
|
5436
5737
|
* | `935` | That publication does not belong to this plan, or is no longer a draft |
|
|
5437
5738
|
* | `941` | AI credits exhausted for this month |
|
|
@@ -5507,6 +5808,57 @@ interface operations {
|
|
|
5507
5808
|
};
|
|
5508
5809
|
};
|
|
5509
5810
|
};
|
|
5811
|
+
unarchiveAiPlan: {
|
|
5812
|
+
parameters: {
|
|
5813
|
+
query?: never;
|
|
5814
|
+
header?: never;
|
|
5815
|
+
path: {
|
|
5816
|
+
/** @description AI plan identifier */
|
|
5817
|
+
id_ai_plan: components["parameters"]["AiPlansidAiPlan"];
|
|
5818
|
+
/** @description Client identifier */
|
|
5819
|
+
id_client: components["parameters"]["AiPlansidClient"];
|
|
5820
|
+
/** @description Organization identifier */
|
|
5821
|
+
id_organization: components["parameters"]["AiPlansidOrganization"];
|
|
5822
|
+
};
|
|
5823
|
+
cookie?: never;
|
|
5824
|
+
};
|
|
5825
|
+
requestBody?: never;
|
|
5826
|
+
responses: {
|
|
5827
|
+
/** @description Successful operation. Returns the plan without `archived_date`. */
|
|
5828
|
+
200: {
|
|
5829
|
+
headers: {
|
|
5830
|
+
[name: string]: unknown;
|
|
5831
|
+
};
|
|
5832
|
+
content: {
|
|
5833
|
+
"application/json": components["schemas"]["AiPlansAiPlanOne"];
|
|
5834
|
+
};
|
|
5835
|
+
};
|
|
5836
|
+
/**
|
|
5837
|
+
* @description The request failed. The body carries the PlanVortex error code in `code`:
|
|
5838
|
+
*
|
|
5839
|
+
* | Code | Meaning |
|
|
5840
|
+
* | --- | --- |
|
|
5841
|
+
* | `1101` | Invalid organization |
|
|
5842
|
+
* | `2100` | AI plan doesn't exist. The identifier is invalid or doesn't exist. |
|
|
5843
|
+
* | `521` | Invalid client. The identifier is invalid or doesn't exist |
|
|
5844
|
+
*/
|
|
5845
|
+
400: {
|
|
5846
|
+
headers: {
|
|
5847
|
+
[name: string]: unknown;
|
|
5848
|
+
};
|
|
5849
|
+
content: {
|
|
5850
|
+
"application/json": components["schemas"]["Error"];
|
|
5851
|
+
};
|
|
5852
|
+
};
|
|
5853
|
+
/** @description Unhandled error by the server */
|
|
5854
|
+
500: {
|
|
5855
|
+
headers: {
|
|
5856
|
+
[name: string]: unknown;
|
|
5857
|
+
};
|
|
5858
|
+
content?: never;
|
|
5859
|
+
};
|
|
5860
|
+
};
|
|
5861
|
+
};
|
|
5510
5862
|
validateAiPlan: {
|
|
5511
5863
|
parameters: {
|
|
5512
5864
|
query?: never;
|
|
@@ -10313,6 +10665,37 @@ interface operations {
|
|
|
10313
10665
|
};
|
|
10314
10666
|
};
|
|
10315
10667
|
};
|
|
10668
|
+
getPlannerTemplates: {
|
|
10669
|
+
parameters: {
|
|
10670
|
+
query?: never;
|
|
10671
|
+
header?: never;
|
|
10672
|
+
path?: never;
|
|
10673
|
+
cookie?: never;
|
|
10674
|
+
};
|
|
10675
|
+
requestBody?: never;
|
|
10676
|
+
responses: {
|
|
10677
|
+
/** @description Available planner templates */
|
|
10678
|
+
200: {
|
|
10679
|
+
headers: {
|
|
10680
|
+
[name: string]: unknown;
|
|
10681
|
+
};
|
|
10682
|
+
content: {
|
|
10683
|
+
"application/json": {
|
|
10684
|
+
templates?: components["schemas"]["CatalogPlannerTemplate"][];
|
|
10685
|
+
};
|
|
10686
|
+
};
|
|
10687
|
+
};
|
|
10688
|
+
/** @description Error */
|
|
10689
|
+
400: {
|
|
10690
|
+
headers: {
|
|
10691
|
+
[name: string]: unknown;
|
|
10692
|
+
};
|
|
10693
|
+
content: {
|
|
10694
|
+
"application/json": components["schemas"]["Error"];
|
|
10695
|
+
};
|
|
10696
|
+
};
|
|
10697
|
+
};
|
|
10698
|
+
};
|
|
10316
10699
|
getPublicationLimits: {
|
|
10317
10700
|
parameters: {
|
|
10318
10701
|
query?: never;
|
|
@@ -10718,6 +11101,38 @@ type SocialCapabilities = Schemas["CommentsSocialCapabilities"];
|
|
|
10718
11101
|
* administrador de ese grupo (error 969 si no).
|
|
10719
11102
|
*/
|
|
10720
11103
|
type CommentActions = Schemas["CommentsCommentActions"];
|
|
11104
|
+
/**
|
|
11105
|
+
* De QUE se genera un plan: la fuente del contenido, no un flujo distinto del asistente.
|
|
11106
|
+
*
|
|
11107
|
+
* `shared`, `publish_days`, `language`, `tone` y las imagenes siguen siendo opciones transversales,
|
|
11108
|
+
* y cada plantilla declara cuales admite. Es una enumeracion ABIERTA por lo mismo que las redes: la
|
|
11109
|
+
* lista crece, y una plantilla nueva en el servidor no puede dejar de compilar el codigo de quien
|
|
11110
|
+
* no ha actualizado el paquete.
|
|
11111
|
+
*/
|
|
11112
|
+
type PlannerTemplateName = OpenEnum<NonNullable<Schemas["CatalogPlannerTemplate"]["template"]>>;
|
|
11113
|
+
/**
|
|
11114
|
+
* Una plantilla del planificador, tal y como la publica `GET /planner_templates`.
|
|
11115
|
+
*
|
|
11116
|
+
* **`generates_images: false` significa que las fotos las pone la FUENTE** —las del usuario, las
|
|
11117
|
+
* del catalogo— y el plan no gasta ni un credito de imagen: la misma semana de 7 publicaciones con
|
|
11118
|
+
* foto pasa de 519 creditos a 48. Es lo que hay que decir ANTES de crear el plan, no despues.
|
|
11119
|
+
*
|
|
11120
|
+
* Y `regenerate` es por plantilla: la que no genero la imagen tampoco puede regenerarla. Ofrecer
|
|
11121
|
+
* ese boton igualmente es cobrarle al usuario 70 creditos por sustituir su propia foto por una
|
|
11122
|
+
* inventada.
|
|
11123
|
+
*/
|
|
11124
|
+
type PlannerTemplate = Schemas["CatalogPlannerTemplate"];
|
|
11125
|
+
/**
|
|
11126
|
+
* Un campo del paso de fuente.
|
|
11127
|
+
*
|
|
11128
|
+
* `max` y `min` van en las unidades DEL CAMPO: caracteres de un texto, elementos de una lista y
|
|
11129
|
+
* **dias** de una fecha —los 60 de `event_date` son cuanto puede alejarse el evento de la semana
|
|
11130
|
+
* del plan—. `uploads_with_description` y `catalog_products` son la senal de que ese campo
|
|
11131
|
+
* necesita un componente propio; los demas son controles corrientes.
|
|
11132
|
+
*/
|
|
11133
|
+
type PlannerTemplateField = Schemas["CatalogPlannerTemplateField"];
|
|
11134
|
+
/** El control de un campo de fuente. Abierto: el catalogo de tipos ya se ha ampliado antes. */
|
|
11135
|
+
type PlannerTemplateFieldType = OpenEnum<NonNullable<PlannerTemplateField["type"]>>;
|
|
10721
11136
|
/**
|
|
10722
11137
|
* Los recursos que reparte un plan. En un cliente es lo contratado; en una organizacion, la
|
|
10723
11138
|
* porcion que se le asigno.
|
|
@@ -11135,6 +11550,13 @@ type IntegrationPickerConfig = Operations["getIntegrationPickerConfig"]["respons
|
|
|
11135
11550
|
* plan lo devuelve con las publicaciones enteras y sus ficheros, y el LISTADO devuelve sus
|
|
11136
11551
|
* identificadores. `organization_context` es una FOTO del contexto de marca de la organizacion en
|
|
11137
11552
|
* el momento de crear el plan, no el de ahora: es lo que hace que un reintento sea reproducible.
|
|
11553
|
+
*
|
|
11554
|
+
* `template` viene SIEMPRE —un plan anterior a las plantillas se lee `standard`— y `source` es la
|
|
11555
|
+
* misma clase de foto que `organization_context`: el articulo ya descargado, las fotos elegidas o
|
|
11556
|
+
* los productos copiados, no una referencia viva. Por eso un reintento tres dias despues no depende
|
|
11557
|
+
* de que el articulo siga en linea ni de que el producto siga en el catalogo.
|
|
11558
|
+
*
|
|
11559
|
+
* Y `warnings` no es un error: son avisos del ULTIMO intento sobre un plan que se genero bien.
|
|
11138
11560
|
*/
|
|
11139
11561
|
type AiPlan = Schemas["AiPlansAiPlan"];
|
|
11140
11562
|
/** El estado de un plan. `pending` y `generating` son los dos que hay que sondear. */
|
|
@@ -11143,8 +11565,60 @@ type AiPlanState = OpenEnum<AiPlan["state"]>;
|
|
|
11143
11565
|
type AiPlanOptions = Schemas["AiPlansAiPlanOptions"];
|
|
11144
11566
|
/** Las opciones tal y como se MANDAN: todas opcionales, los defaults los pone el servidor. */
|
|
11145
11567
|
type AiPlanOptionsInput = Schemas["AiPlansAiPlanOptionsInput"];
|
|
11146
|
-
/**
|
|
11568
|
+
/**
|
|
11569
|
+
* Lo que se manda para encolar un plan.
|
|
11570
|
+
*
|
|
11571
|
+
* `template` y `source` son OPCIONALES: sin ellos el plan es `standard`, que es exactamente lo que
|
|
11572
|
+
* hacia cualquier plan antes de que existieran las plantillas. Mandar una opcion que la plantilla
|
|
11573
|
+
* elegida no admite —un `shared` en `from_images`— es un 2106, no un silencio.
|
|
11574
|
+
*/
|
|
11147
11575
|
type AiPlanCreateRequest = Schemas["AiPlansAiPlanCreateRequest"];
|
|
11576
|
+
/**
|
|
11577
|
+
* La fuente del plan, tal y como se MANDA. **Una forma por plantilla**: manda solo los campos de la
|
|
11578
|
+
* que elegiste —lo que no lee se ignora, y lo que necesita y no recibe es un 2112—.
|
|
11579
|
+
*
|
|
11580
|
+
* | Plantilla | Campos |
|
|
11581
|
+
* | --- | --- |
|
|
11582
|
+
* | `standard` | ninguno: no tiene fuente |
|
|
11583
|
+
* | `from_images` | `images` |
|
|
11584
|
+
* | `from_text` | `url` **o** `text` |
|
|
11585
|
+
* | `from_catalog` | `id_account_catalog`, `product_catalog_id`, `products` |
|
|
11586
|
+
* | `campaign` | `event_name`, `event_date` |
|
|
11587
|
+
*
|
|
11588
|
+
* Se valida al CREAR el plan, no al generarlo: el articulo se descarga, el catalogo se lee en vivo
|
|
11589
|
+
* y las fotos de los productos se copian, asi que una fuente que no funciona falla mientras el
|
|
11590
|
+
* usuario sigue delante. Dos trampas que el tipo no puede decir: `text` GANA sobre `url` cuando
|
|
11591
|
+
* llegan los dos —pegar el texto es lo que hace quien no consiguio que se descargara—, y
|
|
11592
|
+
* `event_date` es un DIA DE CALENDARIO (`YYYY-MM-DD`), nunca un instante ISO.
|
|
11593
|
+
*/
|
|
11594
|
+
type AiPlanSourceInput = Schemas["AiPlansAiPlanSourceInput"];
|
|
11595
|
+
/** Una foto de `from_images`. La descripcion es obligatoria a proposito: sin ella el modelo escribe sobre lo que cree ver. */
|
|
11596
|
+
type AiPlanSourceImageInput = Schemas["AiPlansAiPlanSourceImageInput"];
|
|
11597
|
+
/**
|
|
11598
|
+
* La fuente tal y como quedo GUARDADA: una foto del momento de crear el plan, no una referencia
|
|
11599
|
+
* viva. Es lo que hace que un reintento reproduzca el mismo plan.
|
|
11600
|
+
*/
|
|
11601
|
+
type AiPlanSource = Schemas["AiPlansAiPlanSource"];
|
|
11602
|
+
/**
|
|
11603
|
+
* Un producto del catalogo, copiado al crear el plan.
|
|
11604
|
+
*
|
|
11605
|
+
* `price` viene **exactamente como lo devolvio la red** (`"9,99 €"`) y no se convierte nunca: el
|
|
11606
|
+
* mismo campo es un numero en otros caminos de la API de Meta y no hay forma de saber si son
|
|
11607
|
+
* unidades o centimos. Dividir por 100 "por si acaso" es como se anuncia un producto de 10 € a
|
|
11608
|
+
* 0,10 €. Y `id_upload` es la foto ya copiada a un fichero de la organizacion, porque la URL del
|
|
11609
|
+
* CDN de la red caduca.
|
|
11610
|
+
*/
|
|
11611
|
+
type AiPlanSourceProduct = Schemas["AiPlansAiPlanSourceProduct"];
|
|
11612
|
+
/**
|
|
11613
|
+
* Algo que el plan tiene que decir de si mismo, con la forma de un error de la API. Lo comparten
|
|
11614
|
+
* `error` (solo en estado `failed`) y `warnings` (en un plan que se genero bien).
|
|
11615
|
+
*
|
|
11616
|
+
* Hoy hay un aviso: **2117 — parte de la fuente no cabia en la semana del plan**. Un plan es
|
|
11617
|
+
* SEMANAL y la fuente no lo alarga, asi que 12 fotos con 6 huecos libres publican 6 y las demas se
|
|
11618
|
+
* quedan fuera; `data` trae `{source_items, capacity}`. Se dice mejor ANTES de crear el plan —los
|
|
11619
|
+
* huecos son los dias de publicacion por las cuentas— que despues de haberlo cobrado.
|
|
11620
|
+
*/
|
|
11621
|
+
type AiPlanNotice = Schemas["AiPlansAiPlanNotice"];
|
|
11148
11622
|
/**
|
|
11149
11623
|
* El presupuesto DETERMINISTA de un plan, calculado por el servidor y nunca por el modelo.
|
|
11150
11624
|
*
|
|
@@ -11703,4 +12177,4 @@ interface PlanVortexWebhooksOptions {
|
|
|
11703
12177
|
*/
|
|
11704
12178
|
declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
|
|
11705
12179
|
|
|
11706
|
-
export { type
|
|
12180
|
+
export { type SocialCredentialsInput as $, type Account as A, type PlanUse as B, type ConnectLink as C, type Dashboard as D, type EnableResult as E, type IntegrationProvider as F, type Integration as G, type IntegrationConnectRequest as H, type IntegrationProviderName as I, type IntegrationUpdate as J, type IntegrationPickerConfig as K, type MessageTemplate as L, type MetricName as M, type Conversation as N, type ConversationTotals as O, type Paginated as P, type Message as Q, type MessageInput as R, type SocialNetwork as S, type TopPublicationsResult as T, type Client as U, type Organization as V, type AiSettings as W, type ClientWithOrganizations as X, type PlanData as Y, type ConnectToken as Z, type AiContext as _, type ConnectResult as a, type PlannerTemplateFieldType as a$, type Product as a0, type ProductInput as a1, type ProductCatalog as a2, type ProductCatalogInput as a3, type PublicationInput as a4, type PublicationState as a5, type PublicationStats as a6, type PublicationStatsHistory as a7, type Upload as a8, AccountError as a9, FileError as aA, type FileFormat as aB, type FileProperties as aC, type FileType as aD, IntegrationError as aE, type IntegrationErrorChange as aF, type MessageChange as aG, type MessageOptions as aH, type MessageType as aI, MessagingError as aJ, type MetricRow as aK, NO_ERROR_CODE as aL, type components as aM, type operations as aN, type paths as aO, type webhooks as aP, type OpenEnum as aQ, OrganizationError as aR, PLANVORTEX_ERROR_RANGES as aS, PlanLimitError as aT, PlanVortexAuthenticationError as aU, PlanVortexConfigError as aV, PlanVortexConnectionError as aW, PlanVortexError as aX, type PlanVortexErrorOptions as aY, type PlanVortexErrorRange as aZ, type PlannerTemplateField as a_, type AccountMetricRow as aa, type AccountStateChange as ab, type AccountWebhookChangeBase as ac, type AccountWithError as ad, type AiPlanCostEstimate as ae, AiPlanError as af, type AiPlanNotice as ag, type AiPlanOptions as ah, type AiPlanOptionsInput as ai, type AiPlanSource as aj, type AiPlanSourceImageInput as ak, type AiPlanSourceInput as al, type AiPlanSourceProduct as am, type AiPlanState as an, type ApiErrorBody as ao, type AspectRatios as ap, AuthError as aq, type ClientPlan as ar, type CommentAuthor as as, type CommentChange as at, type ContactChannel as au, ContactError as av, type DashboardAiPlanRef as aw, type DashboardPublicationRef as ax, type DashboardRange as ay, type EngagementBase as az, type AccountMetrics as b, type PlannerTemplateName as b0, ProductError as b1, PublicationError as b2, type PublicationErrorDetail as b3, type PublicationMetrics as b4, type PublicationStatsPoint as b5, type PublicationType as b6, type PublicationsSummary as b7, type RssConfig as b8, type SocialAuthorizationMethod as b9, type PlanVortexWebhooksOptions as bA, type RawWebhookBody as bB, type VerifyWebhookSignatureOptions as bC, WEBHOOK_EVENTS as bD, WEBHOOK_SIGNATURE_HEADERS as bE, WebhookBodyError as bF, type WebhookHeaders as bG, type WebhookRequestLike as bH, type WebhookResponseLike as bI, WebhookSignatureError as bJ, handleWebhookRequest as bK, isAccountStateChange as bL, isCommentChange as bM, isIntegrationErrorChange as bN, isMessageChange as bO, parseWebhookPayload as bP, planvortexWebhooks as bQ, verifyWebhookSignature as bR, type SocialCredentials as ba, type SocialIdentifier as bb, type SocialIdentifierInput as bc, type SocialLimitsMap as bd, TOKEN_ERROR_CODES as be, type TopPublication as bf, type UnknownWebhookChange as bg, UserError as bh, type WebhookAlgorithm as bi, type WebhookChange as bj, type WebhookEvent as bk, type WithAccount as bl, type WithPublication as bm, account as bn, accountId as bo, errorFamilyForCode as bp, isPlanVortexError as bq, isTokenError as br, messageContact as bs, messageContactId as bt, messageDirection as bu, messageFileIds as bv, messageFiles as bw, publication as bx, publicationId as by, type HandleWebhookRequestOptions as bz, type PersistentMenu as c, type Publication as d, type AiPlanCreateRequest as e, type AiPlanCreateResult as f, type AiPlan as g, type ClientApp as h, type ClientAppInput as i, type SocialCapabilities as j, type CommentActions as k, type SocialLimits as l, type PublicationLimits as m, type AspectRatiosByNetwork as n, type PlannerTemplate as o, type CommentNetwork as p, type Comment as q, type CommentThread as r, type CommentReplyResult as s, type ContactExtraData as t, type Contact as u, type ContactCreate as v, type ContactUpdate as w, type DashboardMetricsResult as x, type PublicationsSummaryResult as y, type PublicationsStatsResult as z };
|