planvortex 0.12.0 → 0.13.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.
@@ -681,7 +681,7 @@ interface paths {
681
681
  };
682
682
  /**
683
683
  * Catalogue of available integration providers
684
- * @description What every provider is and what it can do: whether it connects through OAuth or a form, whether it contributes files to the library, whether it is polled for content, which file formats it accepts and which fields its configuration form takes.
684
+ * @description What every provider is and what it can do: whether it has an OAuth token behind it, whether it connects with a link (and what that link needs first), whether it contributes files to the library, whether it is polled for content, whether it has a product catalogue, which file formats it accepts and which fields its configuration form takes.
685
685
  *
686
686
  * Consume this instead of hardcoding a provider list: a new provider shows up here without any client change.
687
687
  */
@@ -1595,6 +1595,7 @@ interface paths {
1595
1595
  *
1596
1596
  * - `google_drive`: `{ provider, code }`, where `code` is the OAuth code returned to the redirect of `connect_link`. It is single-use, so the plan allowance is checked **before** the exchange.
1597
1597
  * - `rss`: `{ provider, url, id_accounts, template?, publication_type?, auto_publish?, import_image? }`. The feed is read once to validate it and to take its title, and every item it already has is recorded as seen — connecting a blog never publishes its back catalogue.
1598
+ * - `woocommerce`: `{ provider, url, consumer_key, consumer_secret }`, a **read** key created by hand in the store. The keys are tried against the store before anything is saved, and an organization can connect several stores: each one takes one integration of the allowance. The approval button (`connect_link`) does the same without anyone copying a key, and is the better way whenever the store allows it.
1598
1599
  *
1599
1600
  * Requires the `integrations:create` permission.
1600
1601
  */
@@ -1621,6 +1622,8 @@ interface paths {
1621
1622
  * Update an integration
1622
1623
  * @description Only what the user owns: its name, whether it is enabled and its `config` (merged, not replaced — `seen_guids` and `last_checked` belong to the job). Credentials are never updated here; for that, `POST .../reconnect`. Changing a feed's `url` here keeps the items it had already seen, so the new feed's back catalogue would be published on the next sweep — change a feed's URL through `/reconnect`, which revalidates it and marks its current items as seen.
1623
1624
  *
1625
+ * **A store's `config` cannot be edited at all** (`2220`, and nothing of the request is applied): its `url` decides which server receives the stored key, so whoever could change it could send the key, which also reads the store's orders and customers, anywhere. Changing store is reconnecting, which tries the key against the new URL.
1626
+ *
1624
1627
  * A disabled integration stops consuming plan allowance. Enabling one or changing its config clears `error_code`, so the job retries it.
1625
1628
  *
1626
1629
  * Requires the `integrations:update` permission.
@@ -1629,7 +1632,9 @@ interface paths {
1629
1632
  post?: never;
1630
1633
  /**
1631
1634
  * Disconnect an integration
1632
- * @description Revokes the credentials at the provider and deletes the connection.
1635
+ * @description Revokes the credentials at the provider, when the provider allows it, and deletes the connection.
1636
+ *
1637
+ * **A WooCommerce key cannot be revoked from outside**: WooCommerce does not let an app delete its own key. Tell the user to delete it in WooCommerce → Settings → Advanced → REST API; it is the one whose description starts with "PlanVortex - API" (when it was created with the button) and whose key ends in `config.key_ending`. Until then the key stays alive in their WordPress, unused.
1633
1638
  *
1634
1639
  * Files already imported are **not** touched: they are your files, in your library, counting against your storage. Disconnecting Drive never empties anyone's library.
1635
1640
  *
@@ -1665,6 +1670,34 @@ interface paths {
1665
1670
  patch?: never;
1666
1671
  trace?: never;
1667
1672
  };
1673
+ "/organizations/{id_organization}/integrations/{id_integration}/products": {
1674
+ parameters: {
1675
+ query?: never;
1676
+ header?: never;
1677
+ path?: never;
1678
+ cookie?: never;
1679
+ };
1680
+ /**
1681
+ * Products of a connected store
1682
+ * @description One page of the catalogue of an integration whose provider has `catalog: true` (a WooCommerce store), to choose the products of a `from_catalog` AI plan. Read **live** from the store on every call.
1683
+ *
1684
+ * - **Paginated by an opaque `cursor`**, not by page number: send back `next_cursor` as it came, and stop when it is absent.
1685
+ * - **What the public cannot see does not come**: drafts, private products and products hidden from the catalogue. **What is out of stock DOES come, with `available: false`**: show it marked and do not let it be chosen.
1686
+ * - `price` is text to copy verbatim, as the store displays it. Absent means no price, and it is also absent on taxable products while the store's `config.tax_location_missing` is true.
1687
+ *
1688
+ * A store that rejects its key (`2211`) is marked with that `error_code` until it is reconnected, and shows up as `connected: false`. A firewall (`2212`) or a store that does not answer (`2213`) does not mark it: that fixes itself, or on the store's side.
1689
+ *
1690
+ * Requires the `integrations:read` permission.
1691
+ */
1692
+ get: operations["getIntegrationProducts"];
1693
+ put?: never;
1694
+ post?: never;
1695
+ delete?: never;
1696
+ options?: never;
1697
+ head?: never;
1698
+ patch?: never;
1699
+ trace?: never;
1700
+ };
1668
1701
  "/organizations/{id_organization}/integrations/{id_integration}/reconnect": {
1669
1702
  parameters: {
1670
1703
  query?: never;
@@ -1678,11 +1711,11 @@ interface paths {
1678
1711
  * Reconnect an integration
1679
1712
  * @description Renews the credentials of an integration that already exists — the OAuth token expired or the provider revoked it (`2203`) — or revalidates a feed's configuration, **on the same document**.
1680
1713
  *
1681
- * The body is the same one you would send to connect: `{ provider, code }` for an OAuth provider, or the form fields for a feed. It is handled by the same provider logic, so a feed that still cannot be read is still a `2205`.
1714
+ * The body is the same one you would send to connect: `{ provider, code }` for an OAuth provider, or the form fields for a feed or a store. A store can also be reconnected with its approval button: `connect_link` with `id_integration`, and no call here. It is handled by the same provider logic, so a feed that still cannot be read is still a `2205`.
1682
1715
  *
1683
1716
  * Use this instead of deleting and connecting again. Reconnecting keeps the `_id` (publications created by a feed reference it), the connection date and the feed's seen items — deleting and reconnecting a feed would republish the blog's whole back catalogue on the next sweep.
1684
1717
  *
1685
- * What it does not touch: `enabled` (reconnecting never switches on a disabled integration, because that consumes plan allowance) and the creation date. `error_code` is cleared, so the background jobs pick it up again. `name` is kept unless the connection now points somewhere else (another Google account, another feed URL), in which case the new one is taken.
1718
+ * What it does not touch: `enabled` (reconnecting never switches on a disabled integration, because that consumes plan allowance) and the creation date. `error_code` is cleared, so the background jobs pick it up again. `name` is kept unless the connection now points somewhere else (another Google account, another feed URL, another store), in which case the new one is taken.
1686
1719
  *
1687
1720
  * No allowance check: nothing new is created, so it works even with the plan full.
1688
1721
  *
@@ -1703,10 +1736,15 @@ interface paths {
1703
1736
  cookie?: never;
1704
1737
  };
1705
1738
  /**
1706
- * Authorization URL of an OAuth provider
1707
- * @description Only for providers whose `requires_oauth` is true; anything else returns `2201`. Send the user to the returned URL; the provider will come back to `{FRONT_APP}/connect/integration/{provider}` with a `code` to post to `POST /organizations/{id_organization}/integrations`.
1739
+ * Connection link of a provider (OAuth or a store's approval page)
1740
+ * @description The link to send the user to, for providers whose `connect_link` is true; anything else returns `2201`.
1741
+ *
1742
+ * - `google_drive`: Google's consent screen. The user comes back to `{FRONT_APP}/connect/integration/google_drive` with a `code` to post to `POST /organizations/{id_organization}/integrations`.
1743
+ * - `woocommerce`: the store's own approval page (`/wc-auth/v1/authorize`), so the store `url` is required (`connect_link_fields`). The store is checked **now, without credentials** (https, a firewall in front, whether WooCommerce is there), so what is going to fail fails while the user is still in your app. The person approving must be able to manage WooCommerce in that WordPress (an administrator or a shop manager). After approving, the store sends a read-only key straight to PlanVortex, and the user comes back to `{FRONT_APP}/connect/integration/woocommerce?id_integration=…&success=…&user_id=…`.
1744
+ *
1745
+ * **After a store's link, do not trust `success`: read `GET .../integrations/{id_integration}`.** A `2200` means the key never arrived (the user cancelled, or the store's call failed); `error_code` `2219` means it is still being checked (a few seconds; poll, and if it stays there, reconnect); any other `error_code` is what failed; none means connected. The link lasts 15 minutes and works once. The allowance is checked here (`1404`) so nobody approves a key that would be refused, and again when the key arrives.
1708
1746
  *
1709
- * Requires the `integrations:create` **or** `integrations:update` permission: the consent link is needed both to connect a new integration and to reconnect one that already exists (`POST /organizations/{id_organization}/integrations/{id_integration}/reconnect`).
1747
+ * Requires the `integrations:create` **or** `integrations:update` permission: the consent link is needed both to connect a new integration and to reconnect one that already exists (`POST /organizations/{id_organization}/integrations/{id_integration}/reconnect`). Reconnecting a store with `id_integration` requires `integrations:update`.
1710
1748
  */
1711
1749
  get: operations["getIntegrationConnectLink"];
1712
1750
  put?: never;
@@ -2402,7 +2440,8 @@ interface paths {
2402
2440
  * • **`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.
2403
2441
  * • **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.
2404
2442
  * • **`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.
2405
- * • **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.
2443
+ * • **Not every network fits every template.** `unsupported_networks` lists the ones whose accounts a plan of that template cannot carry (2120): offer only the rest, instead of letting the user pick a YouTube account for a week of product photos.
2444
+ * • **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; `from_catalog`: a Meta catalogue account or a connected store). Read them from here; hardcoding them is how a wizard ends up rejecting at a number the server does not use.
2406
2445
  */
2407
2446
  get: operations["getPlannerTemplates"];
2408
2447
  put?: never;
@@ -2922,7 +2961,7 @@ interface components {
2922
2961
  texts_target: number;
2923
2962
  };
2924
2963
  AiPlansAiPlanCreateRequest: {
2925
- /** @description Account ids (belonging to the organization) to generate the plan for. */
2964
+ /** @description Account ids (belonging to the organization) to generate the plan for. **Not every network fits every template**: leave out the ones in the template's `unsupported_networks` (`GET /planner_templates`), or the plan is refused with 2120. */
2926
2965
  accounts: string[];
2927
2966
  /**
2928
2967
  * @description Where each account publishes, for the networks that answer `destinations: true` in `GET /social_capabilities` — today `pinterest` alone, where it is the board of every pin of that account.
@@ -2935,7 +2974,7 @@ interface components {
2935
2974
  options?: components["schemas"]["AiPlansAiPlanOptionsInput"];
2936
2975
  /** @description Theme prompt written by the user. */
2937
2976
  prompt: string;
2938
- /** @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. */
2977
+ /** @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, 2116 or a store's own errors (2200, 2207-2214) come back while the user is still there. */
2939
2978
  source?: components["schemas"]["AiPlansAiPlanSourceInput"];
2940
2979
  /**
2941
2980
  * @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.
@@ -3043,7 +3082,7 @@ interface components {
3043
3082
  /** @description Language of the generated texts. Optional; defaults to `"es"`. */
3044
3083
  language?: string;
3045
3084
  /**
3046
- * @description **The destination link** of the plan's publications — the pin's `link`, the same for every publication of the plan. Optional: a pin without a link is legitimate, it just takes nobody anywhere.
3085
+ * @description **The destination link** of the plan's publications — the pin's `link`, the same for every publication of the plan. Optional: a pin without a link is legitimate, it just takes nobody anywhere. On `from_catalog`, each pin leads to **its product's page** (`permalink`) when this is absent; when it is present, it wins.
3047
3086
  *
3048
3087
  * It only reaches the publications of the networks that answer `link: true` in `GET /social_capabilities` (today `pinterest`); with none of them in the plan it is dropped. With one, it is validated **at creation**: a URL Pinterest would reject is a **994** now (`data.reason` `invalid_url` or `too_long`), not a week of pins failing at publish time.
3049
3088
  */
@@ -3100,8 +3139,10 @@ interface components {
3100
3139
  date?: string;
3101
3140
  name?: string;
3102
3141
  };
3103
- /** @description `from_catalog`. The account whose catalogue was read. */
3142
+ /** @description `from_catalog`. The account whose Meta catalogue was read. */
3104
3143
  id_account_catalog?: string;
3144
+ /** @description `from_catalog`. The connected store (an integration) whose catalogue was read. Only one of the two is present. */
3145
+ id_integration_catalog?: string;
3105
3146
  /** @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. */
3106
3147
  images?: {
3107
3148
  description?: string;
@@ -3124,14 +3165,14 @@ interface components {
3124
3165
  /**
3125
3166
  * @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.
3126
3167
  *
3127
- * 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.
3168
+ * It is validated when the plan is **created**, not when it is generated: the article is downloaded, the catalogue or the store 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.
3128
3169
  *
3129
3170
  * | Template | Fields |
3130
3171
  * | --- | --- |
3131
3172
  * | `standard` | none — no source |
3132
3173
  * | `from_images` | `images` |
3133
3174
  * | `from_text` | `url` **or** `text` |
3134
- * | `from_catalog` | `id_account_catalog`, `product_catalog_id`, `products` |
3175
+ * | `from_catalog` | `id_account_catalog` + `product_catalog_id` (a Meta catalogue) **or** `id_integration_catalog` (a connected store), and `products` |
3135
3176
  * | `campaign` | `event_name`, `event_date` |
3136
3177
  */
3137
3178
  AiPlansAiPlanSourceInput: {
@@ -3142,13 +3183,15 @@ interface components {
3142
3183
  event_date?: string;
3143
3184
  /** @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`. */
3144
3185
  event_name?: string;
3145
- /** @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. */
3186
+ /** @description `from_catalog`, from a **Meta catalogue**. 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. **Exclusive with `id_integration_catalog`** (both at once is a 2112). */
3146
3187
  id_account_catalog?: string;
3188
+ /** @description `from_catalog`, from a **connected store**. An integration of the organization whose provider has `catalog: true` (a WooCommerce store), enabled; another organization's is a 2200, without confirming it exists. The products are its `external_id`s, from `GET .../integrations/{id_integration}/products`. Like the account, it only chooses the catalogue: the publications go to every account in `accounts`. **Exclusive with `id_account_catalog`.** */
3189
+ id_integration_catalog?: string;
3147
3190
  /** @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). */
3148
3191
  images?: components["schemas"]["AiPlansAiPlanSourceImageInput"][];
3149
- /** @description `from_catalog`. The catalogue itself, as the network identifies it. */
3192
+ /** @description `from_catalog` with `id_account_catalog` only. The catalogue itself, as the network identifies it: an account can have several catalogues, a store is one. */
3150
3193
  product_catalog_id?: string;
3151
- /** @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. */
3194
+ /** @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, or the one that is out of stock), and each picture is copied into an upload of the organization: a catalogue's picture URL expires or changes, and a plan published weeks later would carry a broken file. Those uploads count against the storage quota. */
3152
3195
  products?: string[];
3153
3196
  /** @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). */
3154
3197
  text?: string;
@@ -3161,12 +3204,14 @@ interface components {
3161
3204
  /** @description A product of the catalogue, copied when the plan was created. */
3162
3205
  AiPlansAiPlanSourceProduct: {
3163
3206
  description?: string;
3164
- /** @description The id it has in the network catalogue. */
3207
+ /** @description The id it has in the catalogue: the network's, or the store's. */
3165
3208
  external_id?: string;
3166
3209
  /** @description The product picture, copied into an upload of the organization. The network CDN URL expires; this one does not. */
3167
3210
  id_upload?: string;
3168
3211
  name?: string;
3169
- /** @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. */
3212
+ /** @description The product's public page (a store's product page, or the `url` of the Meta catalogue item), kept only when it is an http(s) address. The texts use it on the networks where a link in the text can be clicked, never on Instagram or TikTok; and a Pinterest pin leads there unless the plan has its own `options.link`. Absent on plans created before the field existed. */
3213
+ permalink?: string;
3214
+ /** @description The price **exactly as the source gave it**: Meta's formatted price ("9,99 €"), or a store's displayed price with its tax, symbol and range ("14,52 € IVA incluido"). 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. Absent when the product has no price, and on a store's taxable products while its `config.tax_location_missing` is true. */
3170
3215
  price?: string;
3171
3216
  };
3172
3217
  /**
@@ -3273,7 +3318,7 @@ interface components {
3273
3318
  };
3274
3319
  source_fields?: components["schemas"]["CatalogPlannerTemplateField"][];
3275
3320
  /**
3276
- * @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).
3321
+ * @description Fields of which AT LEAST ONE is needed, even though none of them is required on its own: `from_text` takes the URL or the pasted text, never both empty (2116); `from_catalog` takes `id_account_catalog` or `id_integration_catalog`, and exactly one (2112 with both).
3277
3322
  *
3278
3323
  * 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.
3279
3324
  */
@@ -3284,11 +3329,22 @@ interface components {
3284
3329
  * • **`standard`** — a theme prompt, images generated by the model. What every plan was before templates existed.
3285
3330
  * • **`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.
3286
3331
  * • **`from_text`** — an article: a URL that is downloaded at creation, or the text pasted by hand.
3287
- * • **`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.
3332
+ * • **`from_catalog`** — products read LIVE from a connected catalogue (a Meta catalogue through a connected account, or a connected store such as WooCommerce), with their name, their description, their price, their picture and the link to their page. The one template that cannot be copied by a generic AI tool, because it needs the catalogue connection.
3288
3333
  * • **`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.
3289
3334
  * @enum {string}
3290
3335
  */
3291
3336
  template?: "standard" | "from_images" | "from_text" | "from_catalog" | "campaign";
3337
+ /**
3338
+ * @description Networks whose accounts cannot be in a plan of this template: creating one is refused with 2120, before anything is read or charged. The ones that do not publish (`whatsapp`, `google_business`) on every template; and on the templates where every publication is the photo of its source (`from_images`, `from_catalog`), also the ones that do not publish images: `youtube`, which only uploads video.
3339
+ *
3340
+ * It is computed from the same data that validates publishing, not from a list: a new network that does not publish photos drops out on its own. Filter the accounts you offer with it.
3341
+ * @example [
3342
+ * "whatsapp",
3343
+ * "google_business",
3344
+ * "youtube"
3345
+ * ]
3346
+ */
3347
+ unsupported_networks?: components["schemas"]["SocialNetwork"][];
3292
3348
  };
3293
3349
  /** @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. */
3294
3350
  CatalogPlannerTemplateField: {
@@ -3980,18 +4036,18 @@ interface components {
3980
4036
  /** @description Credentials are never returned. `connected` is the summary the panel paints: false means the connection failed and needs attention. */
3981
4037
  IntegrationsIntegration: {
3982
4038
  _id: string;
3983
- /** @description Provider-specific configuration. **Empty object for `google_drive`** — the Picker supplies everything — so every field here is optional and only an `rss` integration fills them in. */
3984
- config: components["schemas"]["IntegrationsRssConfig"];
4039
+ /** @description Provider-specific configuration, built by the server. **Empty object for `google_drive`** (the Picker supplies everything), the feed settings for `rss` and the store connection for `woocommerce`, so every field here is optional. It never carries a secret. */
4040
+ config: components["schemas"]["IntegrationsIntegrationConfig"];
3985
4041
  /** @description `error_code` is empty. It is computed on the way out, not stored: the panel needs to know whether the connection is alive, not with which credentials. */
3986
4042
  connected: boolean;
3987
4043
  /** Format: date-time */
3988
4044
  creation_date: string;
3989
4045
  /** @description Only enabled integrations consume plan allowance. */
3990
4046
  enabled: boolean;
3991
- /** @description PlanVortex error code of the last failure (2203 token revoked, 2205 feed unreachable, 924 no publication allowance left…). */
4047
+ /** @description PlanVortex error code of the last failure (2203 token revoked, 2205 feed unreachable, 2211 the store rejected its key, 924 no publication allowance left…). **2219 is not a failure**: a store connected with the button is being checked, for a few seconds; if it stays there, the check never finished and the store has to be reconnected. */
3992
4048
  error_code?: number | null;
3993
4049
  /**
3994
- * @description The Google account email, or the feed URL.
4050
+ * @description The Google account email, the feed URL, or the store URL.
3995
4051
  * @example ana@empresa.com
3996
4052
  */
3997
4053
  external_identifier?: string;
@@ -3999,10 +4055,97 @@ interface components {
3999
4055
  id_organization: string;
4000
4056
  /** Format: date-time */
4001
4057
  last_used_date?: string;
4002
- /** @example Drive de ana@empresa.com */
4058
+ /**
4059
+ * @description The Google account, the feed title, or the store's site name.
4060
+ * @example Drive de ana@empresa.com
4061
+ */
4003
4062
  name: string;
4004
4063
  provider: components["schemas"]["IntegrationsIntegrationProviderName"];
4005
4064
  };
4065
+ IntegrationsIntegrationCatalogPage: {
4066
+ items: components["schemas"]["IntegrationsIntegrationCatalogProduct"][];
4067
+ /** @description Absent on the last page. **Opaque**: send it back as `cursor` exactly as it came, and never build or parse one. A cursor the server did not issue is a `2208`. */
4068
+ next_cursor?: string;
4069
+ };
4070
+ /** @description A product of a connected store, already normalised: the same shape whatever the store is. */
4071
+ IntegrationsIntegrationCatalogProduct: {
4072
+ /** @description Can it be chosen? **false for what is out of stock**: show it, marked, but do not let it be picked. Advertising what cannot be bought is worse than not advertising, and a plan with one is rejected (`2112`). A product on backorder is available. */
4073
+ available: boolean;
4074
+ /** @description Plain text, already stripped of HTML, entities and page-builder shortcodes, cut at 400 characters without splitting a word. */
4075
+ description?: string;
4076
+ /**
4077
+ * @description The id it has in the store. **Always a string**, even where the store uses numbers. It is what goes into `source.products` of a `from_catalog` plan.
4078
+ * @example 68
4079
+ */
4080
+ external_id: string;
4081
+ /** @description The first image of the product. It is the store's own URL: it can be slow, or blocked when loaded from another domain. */
4082
+ image_url?: string;
4083
+ /** @example Taza de cerámica */
4084
+ name: string;
4085
+ /** @description The product's public page in the store. */
4086
+ permalink?: string;
4087
+ /**
4088
+ * @description Text ready to be copied **verbatim**, as the store displays it: with its tax suffix, its currency symbol and the range of a variable product ("36,30 € - 48,40 € IVA incluido"); for a product on sale, the sale price alone. Never a number to do arithmetic with. **Absent = no price**: the product has none, or it is taxable and the store's `config.tax_location_missing` is true.
4089
+ * @example 14,52 € IVA incluido
4090
+ */
4091
+ price?: string;
4092
+ };
4093
+ /** @description What `config` holds, per provider. `google_drive`: nothing. `rss`: the feed settings. `woocommerce`: how to reach the store, which the server detects when connecting. None of it is a secret. */
4094
+ IntegrationsIntegrationConfig: {
4095
+ /**
4096
+ * @description `woocommerce`. Where the store's REST API answers: `wp-json` (`/wp-json/wc/v3/…`) or `rest_route` (`/?rest_route=/wc/v3/…`), the fallback for stores with plain permalinks. A `rest_route` store cannot use the approval button (`2216`).
4097
+ * @enum {string}
4098
+ */
4099
+ api_base?: "wp-json" | "rest_route";
4100
+ /**
4101
+ * @description `woocommerce`. How the key travels: `basic` (the `Authorization` header) or `query` (in the URL, only for hostings that drop that header). Detected when connecting.
4102
+ * @enum {string}
4103
+ */
4104
+ auth_mode?: "basic" | "query";
4105
+ /** @description `rss`. */
4106
+ auto_publish?: boolean;
4107
+ /**
4108
+ * @description `woocommerce`. The store currency, when the key could read it (it needs a shop manager's key). Only used for a product that comes without `price_html`.
4109
+ * @example EUR
4110
+ */
4111
+ currency?: string;
4112
+ /** @description `rss`. */
4113
+ id_accounts?: string[];
4114
+ /** @description `rss`. */
4115
+ import_image?: boolean;
4116
+ /**
4117
+ * @description `woocommerce`. The last 7 characters of the consumer key, which is what WooCommerce shows in its key list (WooCommerce → Settings → Advanced → REST API). Disconnecting cannot revoke the key: this is how the user finds which one to delete there.
4118
+ * @example 3f9a2c1
4119
+ */
4120
+ key_ending?: string;
4121
+ /**
4122
+ * Format: date-time
4123
+ * @description `rss`.
4124
+ */
4125
+ last_checked?: string;
4126
+ /** @description `rss`. */
4127
+ publication_type?: string;
4128
+ /** @description `rss`. Entries already processed (last 200, FIFO). Owned by the job: filled at connection time with everything the feed already had, so the back catalogue is never published. */
4129
+ seen_guids?: string[];
4130
+ /** @description `woocommerce`. **true when the store's API gives prices WITHOUT tax, labelled as tax included.** It happens with the default customer location set to geolocate (or to no location), prices entered without tax and tax based on the customer's address: an API request has no customer, so WooCommerce has nowhere to charge tax, and `price_html` reads "20,00 € IVA incluido" where the shop charges 24,20 €. While it is true, the store's **taxable products come back without a price** rather than with a wrong one; products with no tax keep theirs. It is checked when connecting, so after fixing the setting (WooCommerce → Settings → General → Default customer location → Shop country/region) the store has to be reconnected. Always present on a store, also as `false`. */
4131
+ tax_location_missing?: boolean;
4132
+ /** @description `rss`. */
4133
+ template?: string;
4134
+ /** @description `rss`: the feed. `woocommerce`: the store, as it was resolved when connecting (after its own redirects, which from then on are never followed). **A store's `url` cannot be changed with `PUT`** (`2220`): it decides which server receives the stored key. Changing store is reconnecting. */
4135
+ url?: string;
4136
+ };
4137
+ /** @description One field of a provider's form. Build the form from these, not from a copy of your own: the server that validates the field is the one that announces it. */
4138
+ IntegrationsIntegrationFormField: {
4139
+ default?: unknown;
4140
+ name: string;
4141
+ options?: string[];
4142
+ required: boolean;
4143
+ /**
4144
+ * @description `accounts` is a picker of the organization's accounts. `secret` is a credential (WooCommerce's consumer secret): mask it, never prefill it when editing, and mark the input as a new password (`autocomplete="new-password"`), or the browser's password manager fills it with the user's own PlanVortex password and the store answers `2211`.
4145
+ * @enum {string}
4146
+ */
4147
+ type: "url" | "text" | "textarea" | "boolean" | "accounts" | "select" | "secret";
4148
+ };
4006
4149
  IntegrationsIntegrationProvider: {
4007
4150
  /**
4008
4151
  * @description File formats accepted at the door. **Empty when `file_import` is false** — that is what `rss` returns, and it does not mean "anything goes". heic/heif are accepted and converted to JPEG on ingestion, so what ends up stored is always jpeg.
@@ -4017,24 +4160,24 @@ interface components {
4017
4160
  * ]
4018
4161
  */
4019
4162
  accepted_formats: string[];
4020
- config_fields: {
4021
- default?: unknown;
4022
- name: string;
4023
- options?: string[];
4024
- required?: boolean;
4025
- /** @enum {string} */
4026
- type: "url" | "text" | "textarea" | "boolean" | "accounts" | "select";
4027
- }[];
4163
+ /** @description Has a product catalogue: `GET .../integrations/{id_integration}/products`, and a source for the `from_catalog` planner template (`source.id_integration_catalog`). WooCommerce. */
4164
+ catalog: boolean;
4165
+ /** @description The connection form. Empty when the provider connects through OAuth alone. */
4166
+ config_fields: components["schemas"]["IntegrationsIntegrationFormField"][];
4167
+ /** @description Can be connected by sending the user to `GET .../integrations/{provider}/connect_link`: Google Drive (its OAuth) and WooCommerce (the store's approval button, which creates the key without anyone copying it). A provider with a link can ALSO have `config_fields`: a WooCommerce store accepts API keys by hand too. */
4168
+ connect_link: boolean;
4169
+ /** @description What `connect_link` needs in its query before it can build the link: the store `url` on WooCommerce, because the link points at the store's own WordPress. Empty on Google Drive. */
4170
+ connect_link_fields: components["schemas"]["IntegrationsIntegrationFormField"][];
4028
4171
  /** @description Polled by the poll-feeds job, which turns new entries into publications. */
4029
4172
  content_feed: boolean;
4030
4173
  /** @description Contributes files to the library through POST /uploads/import. */
4031
4174
  file_import: boolean;
4032
4175
  provider: components["schemas"]["IntegrationsIntegrationProviderName"];
4033
- /** @description true = connect with connect_link + code. false = connect with a form built from config_fields. */
4176
+ /** @description true = there is an OAuth token behind the connection (Google Drive): connect with `connect_link` + `code`, one per organization and provider. false = no token to renew. **Having a link is not being OAuth**: read `connect_link` for that. */
4034
4177
  requires_oauth: boolean;
4035
4178
  };
4036
4179
  /** @enum {string} */
4037
- IntegrationsIntegrationProviderName: "google_drive" | "rss";
4180
+ IntegrationsIntegrationProviderName: "google_drive" | "rss" | "woocommerce";
4038
4181
  /** @description Provider-specific configuration. Empty for google_drive. */
4039
4182
  IntegrationsRssConfig: {
4040
4183
  auto_publish?: boolean;
@@ -4067,6 +4210,19 @@ interface components {
4067
4210
  */
4068
4211
  url: string;
4069
4212
  };
4213
+ IntegrationsWooCommerceConnectRequest: {
4214
+ /** @description Starts with `ck_`. Created in WooCommerce → Settings → Advanced → REST API with **Read** permission. */
4215
+ consumer_key: string;
4216
+ /** @description Starts with `cs_`. Stored encrypted and never returned by any endpoint. */
4217
+ consumer_secret: string;
4218
+ /** @enum {string} */
4219
+ provider: "woocommerce";
4220
+ /**
4221
+ * @description The store address. **https only**: a store that only answers on http is not connected, because the key would travel in the clear. Its redirects (http to https, bare domain to www) are resolved now, without credentials, and the final URL is what gets stored.
4222
+ * @example https://tienda.example.com
4223
+ */
4224
+ url: string;
4225
+ };
4070
4226
  /**
4071
4227
  * @description A message exchanged with a contact.
4072
4228
  *
@@ -5934,14 +6090,19 @@ interface operations {
5934
6090
  * | `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. |
5935
6091
  * | `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 }. |
5936
6092
  * | `2111` | Invalid planner template: `template` is not one of the ones published by `GET /planner_templates`. |
5937
- * | `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. |
6093
+ * | `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 is out of stock, both `id_account_catalog` and `id_integration_catalog` were sent (the catalogue comes from one of them), or the event date falls before the plan week or more than 60 days after it. `data` says which one and why. |
5938
6094
  * | `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. |
5939
6095
  * | `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. |
5940
- * | `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. |
6096
+ * | `2115` | The selected account has no usable product catalogue (`from_catalog` with `id_account_catalog`): its network has no products, or the catalogue could not be read — expired token, deleted catalogue, missing permission — or came back empty. |
5941
6097
  * | `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). |
5942
6098
  * | `994` | Invalid `options.link` with a network that uses it (`pinterest`) in the plan. `data.reason` is `invalid_url` or `too_long`. |
5943
6099
  * | `2118` | A Pinterest account of the plan has no valid board in `destinations`. `data.accounts[]` lists every one that fails, as `{ _id, social_network, reason }`, with `reason` `missing`, `invalid_id` or `invalid_section_id`. |
5944
6100
  * | `2119` | The plan would leave pins without an image: a pin is never text-only. Only checked with Pinterest in the plan and a template that GENERATES images (`from_images` and `from_catalog` bring their own photo). `data.reason` is `images_disabled` (`allow_images: false`), `max_images` (a cap below what is needed) or `credits` (not enough credits for that many images); `data` also carries `{ required, images_target, social_networks }`. The images needed are one per day and per account of a network that requires one — Instagram included, because both networks draw on the same image budget. |
6101
+ * | `2120` | An account of the plan is on a network this template cannot publish to: the networks in the template's `unsupported_networks` (`GET /planner_templates`). Today that is `youtube` on `from_images` and `from_catalog`, whose every publication is the photo of its source, while YouTube only uploads video. Checked before the store is read or a picture downloaded, and `data.accounts[]` lists every account that does not fit, as `{ _id, social_network }`. |
6102
+ * | `2200` | `source.id_integration_catalog` is not an integration of this organization. |
6103
+ * | `2207` | `source.id_integration_catalog` has no product catalogue (a Google Drive or a feed). |
6104
+ * | `2209` | `source.id_integration_catalog` is disabled. |
6105
+ * | `2208`, `2210`-`2214` | The store could not be read. They are the same errors as `GET .../integrations/{id_integration}/products`, and a `2211` (the store rejected its key) also marks the integration until it is reconnected. |
5945
6106
  * | `521` | Invalid client. The identifier is invalid or doesn't exist |
5946
6107
  */
5947
6108
  400: {
@@ -9130,7 +9291,7 @@ interface operations {
9130
9291
  };
9131
9292
  requestBody: {
9132
9293
  content: {
9133
- "application/json": components["schemas"]["IntegrationsGoogleDriveConnectRequest"] | components["schemas"]["IntegrationsRssConnectRequest"];
9294
+ "application/json": components["schemas"]["IntegrationsGoogleDriveConnectRequest"] | components["schemas"]["IntegrationsRssConnectRequest"] | components["schemas"]["IntegrationsWooCommerceConnectRequest"];
9134
9295
  };
9135
9296
  };
9136
9297
  responses: {
@@ -9156,6 +9317,12 @@ interface operations {
9156
9317
  * | `2203` | Integration token expired or revoked, reconnect required. |
9157
9318
  * | `2205` | Feed URL unreachable or not a valid feed. |
9158
9319
  * | `2206` | Feed has no target accounts configured. |
9320
+ * | `2210` | The store URL cannot be used. `data.reason`: `invalid_url`, `not_https` (the store only answers on http, and a key never travels in the clear), `non_public_address`, `redirect` (the store redirected a request carrying credentials, which is never followed) or `too_many_redirects`. |
9321
+ * | `2211` | The store rejected the API key: it does not exist, it was deleted in WordPress, the secret does not match, or it has no read permission. `data` carries what the store said. |
9322
+ * | `2212` | A firewall or a security plugin in front of the store answered instead of WooCommerce (an HTML challenge from Cloudflare, Wordfence…). **It is not the keys**: the store's hosting has to let PlanVortex's server through. |
9323
+ * | `2213` | The store could not be reached, timed out or failed on its side (a 5xx). |
9324
+ * | `2214` | There is no WooCommerce REST API at this URL: not a WordPress, WooCommerce not active, or the REST API disabled. |
9325
+ * | `2215` | The keys are missing or do not have WooCommerce's shape: the consumer key starts with `ck_` and the secret with `cs_`. Pasting them the other way round is the usual mistake. |
9159
9326
  */
9160
9327
  400: {
9161
9328
  headers: {
@@ -9236,7 +9403,14 @@ interface operations {
9236
9403
  };
9237
9404
  };
9238
9405
  };
9239
- /** @description Error. Classify by `code` in the body, never by the HTTP status: every domain error travels with HTTP 400. */
9406
+ /**
9407
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
9408
+ *
9409
+ * | Code | Meaning |
9410
+ * | --- | --- |
9411
+ * | `2200` | Integration not found. |
9412
+ * | `2220` | This `config` key cannot be edited on this provider (on WooCommerce, none can): reconnect the integration to change it. `data.keys` lists the ones that were refused. |
9413
+ */
9240
9414
  400: {
9241
9415
  headers: {
9242
9416
  [name: string]: unknown;
@@ -9324,6 +9498,61 @@ interface operations {
9324
9498
  };
9325
9499
  };
9326
9500
  };
9501
+ getIntegrationProducts: {
9502
+ parameters: {
9503
+ query?: {
9504
+ /** @description The `next_cursor` of the previous page, as it came. Absent = the first page. */
9505
+ cursor?: string;
9506
+ /** @description Products per page. A value outside 1-100 is clamped, not refused. */
9507
+ limit?: number;
9508
+ /** @description Text to look for, with the store's own product search. A store's catalogue is not something to walk through 50 at a time. */
9509
+ search?: string;
9510
+ };
9511
+ header?: never;
9512
+ path: {
9513
+ /** @description Integration identifier */
9514
+ id_integration: components["parameters"]["IntegrationsidIntegration"];
9515
+ /** @description Organization identifier */
9516
+ id_organization: components["parameters"]["IntegrationsidOrganization"];
9517
+ };
9518
+ cookie?: never;
9519
+ };
9520
+ requestBody?: never;
9521
+ responses: {
9522
+ /** @description Successful operation */
9523
+ 200: {
9524
+ headers: {
9525
+ [name: string]: unknown;
9526
+ };
9527
+ content: {
9528
+ "application/json": components["schemas"]["IntegrationsIntegrationCatalogPage"];
9529
+ };
9530
+ };
9531
+ /**
9532
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
9533
+ *
9534
+ * | Code | Meaning |
9535
+ * | --- | --- |
9536
+ * | `2200` | Integration not found (`1102` if it belongs to another organization). |
9537
+ * | `2207` | This integration has no product catalogue (a Google Drive or a feed). |
9538
+ * | `2208` | The catalogue could not be read and the store gave nothing more specific, or `cursor` is not one this API issued. `data.error` carries the cause. |
9539
+ * | `2209` | The integration is disabled. Enable it first: a disabled one does not take allowance, so it cannot be read either. |
9540
+ * | `2210` | The store URL cannot be used. `data.reason`: `invalid_url`, `not_https` (the store only answers on http, and a key never travels in the clear), `non_public_address`, `redirect` (the store redirected a request carrying credentials, which is never followed) or `too_many_redirects`. |
9541
+ * | `2211` | The store rejected the API key: it does not exist, it was deleted in WordPress, the secret does not match, or it has no read permission. `data` carries what the store said. |
9542
+ * | `2212` | A firewall or a security plugin in front of the store answered instead of WooCommerce (an HTML challenge from Cloudflare, Wordfence…). **It is not the keys**: the store's hosting has to let PlanVortex's server through. |
9543
+ * | `2213` | The store could not be reached, timed out or failed on its side (a 5xx). |
9544
+ * | `2214` | There is no WooCommerce REST API at this URL: not a WordPress, WooCommerce not active, or the REST API disabled. |
9545
+ */
9546
+ 400: {
9547
+ headers: {
9548
+ [name: string]: unknown;
9549
+ };
9550
+ content: {
9551
+ "application/json": components["schemas"]["Error"];
9552
+ };
9553
+ };
9554
+ };
9555
+ };
9327
9556
  reconnectIntegration: {
9328
9557
  parameters: {
9329
9558
  query?: never;
@@ -9338,7 +9567,7 @@ interface operations {
9338
9567
  };
9339
9568
  requestBody: {
9340
9569
  content: {
9341
- "application/json": components["schemas"]["IntegrationsGoogleDriveConnectRequest"] | components["schemas"]["IntegrationsRssConnectRequest"];
9570
+ "application/json": components["schemas"]["IntegrationsGoogleDriveConnectRequest"] | components["schemas"]["IntegrationsRssConnectRequest"] | components["schemas"]["IntegrationsWooCommerceConnectRequest"];
9342
9571
  };
9343
9572
  };
9344
9573
  responses: {
@@ -9363,6 +9592,12 @@ interface operations {
9363
9592
  * | `2203` | The provider refused the new credentials. |
9364
9593
  * | `2205` | Feed URL unreachable or not a valid feed. |
9365
9594
  * | `2206` | Feed has no target accounts configured. |
9595
+ * | `2210` | The store URL cannot be used. `data.reason`: `invalid_url`, `not_https` (the store only answers on http, and a key never travels in the clear), `non_public_address`, `redirect` (the store redirected a request carrying credentials, which is never followed) or `too_many_redirects`. |
9596
+ * | `2211` | The store rejected the API key: it does not exist, it was deleted in WordPress, the secret does not match, or it has no read permission. `data` carries what the store said. |
9597
+ * | `2212` | A firewall or a security plugin in front of the store answered instead of WooCommerce (an HTML challenge from Cloudflare, Wordfence…). **It is not the keys**: the store's hosting has to let PlanVortex's server through. |
9598
+ * | `2213` | The store could not be reached, timed out or failed on its side (a 5xx). |
9599
+ * | `2214` | There is no WooCommerce REST API at this URL: not a WordPress, WooCommerce not active, or the REST API disabled. |
9600
+ * | `2215` | The keys are missing or do not have WooCommerce's shape: the consumer key starts with `ck_` and the secret with `cs_`. Pasting them the other way round is the usual mistake. |
9366
9601
  */
9367
9602
  400: {
9368
9603
  headers: {
@@ -9377,8 +9612,12 @@ interface operations {
9377
9612
  getIntegrationConnectLink: {
9378
9613
  parameters: {
9379
9614
  query?: {
9615
+ /** @description `woocommerce`: reconnect THIS store with the button instead of connecting a new one. The key is renewed on the same document and no allowance is taken. Requires `integrations:update`. */
9616
+ id_integration?: string;
9380
9617
  /** @description Alternative return URL. It must be one of the redirects allowed for the installation, otherwise the request fails with `532`. */
9381
9618
  redirect_uri?: string;
9619
+ /** @description `woocommerce`: the store address. Required for that provider, ignored by the rest. */
9620
+ url?: string;
9382
9621
  };
9383
9622
  header?: never;
9384
9623
  path: {
@@ -9402,7 +9641,21 @@ interface operations {
9402
9641
  };
9403
9642
  };
9404
9643
  };
9405
- /** @description Error. Classify by `code` in the body, never by the HTTP status: every domain error travels with HTTP 400. */
9644
+ /**
9645
+ * @description The request failed. The body carries the PlanVortex error code in `code`:
9646
+ *
9647
+ * | Code | Meaning |
9648
+ * | --- | --- |
9649
+ * | `1404` | Integrations limit reached for the organization plan. On the free plan the allowance is 0, so this always fires. |
9650
+ * | `2201` | The provider does not connect with a link (`rss`), or `id_integration` is of another provider. |
9651
+ * | `2200` | `id_integration` does not exist (`1102` if it belongs to another organization). |
9652
+ * | `2210` | The store URL cannot be used. `data.reason`: `invalid_url`, `not_https` (the store only answers on http, and a key never travels in the clear), `non_public_address`, `redirect` (the store redirected a request carrying credentials, which is never followed) or `too_many_redirects`. |
9653
+ * | `2212` | A firewall or a security plugin in front of the store answered instead of WooCommerce (an HTML challenge from Cloudflare, Wordfence…). **It is not the keys**: the store's hosting has to let PlanVortex's server through. |
9654
+ * | `2213` | The store could not be reached, timed out or failed on its side (a 5xx). |
9655
+ * | `2214` | There is no WooCommerce REST API at this URL: not a WordPress, WooCommerce not active, or the REST API disabled. |
9656
+ * | `2216` | This store cannot use the approval button: connect it with API keys instead. `data.reason`: `plain_permalinks` (the store uses plain permalinks, and without rewrite rules WooCommerce's approval page does not exist) or `callback_not_https` (this PlanVortex deployment has no public https address for the store to send the key to). |
9657
+ * | `532` | `redirect_uri` is not one of the allowed redirects. |
9658
+ */
9406
9659
  400: {
9407
9660
  headers: {
9408
9661
  [name: string]: unknown;
@@ -11811,6 +12064,10 @@ type PlannerTemplateName = OpenEnum<NonNullable<Schemas["CatalogPlannerTemplate"
11811
12064
  * Y `regenerate` es por plantilla: la que no genero la imagen tampoco puede regenerarla. Ofrecer
11812
12065
  * ese boton igualmente es cobrarle al usuario 70 creditos por sustituir su propia foto por una
11813
12066
  * inventada.
12067
+ *
12068
+ * `unsupported_networks` son las redes cuyas cuentas no caben en un plan de esa plantilla (2120):
12069
+ * filtra con eso las cuentas que ofreces, en vez de dejar elegir una de YouTube para una semana de
12070
+ * fotos de producto.
11814
12071
  */
11815
12072
  type PlannerTemplate = Schemas["CatalogPlannerTemplate"];
11816
12073
  /**
@@ -12261,26 +12518,78 @@ type ProductCatalog = Schemas["ProductsProductCatalog"];
12261
12518
  type ProductCatalogInput = Schemas["ProductsProductCatalogInput"];
12262
12519
  /**
12263
12520
  * Una conexion de una ORGANIZACION con una herramienta de la que se trae material: Google Drive,
12264
- * un feed RSS.
12521
+ * un feed RSS, una tienda WooCommerce.
12265
12522
  *
12266
12523
  * No confundir con una **app** ({@link ClientApp}), que es el acceso al API de PlanVortex. Son dos
12267
12524
  * cosas distintas que media web ha llamado igual.
12268
12525
  *
12269
12526
  * Las credenciales no salen nunca: para saber si la conexion esta viva esta `connected`, y el
12270
- * motivo cuando no lo esta, en `error_code`.
12527
+ * motivo cuando no lo esta, en `error_code`. **El 2219 no es un fallo**: una tienda conectada con el
12528
+ * boton se esta comprobando, unos segundos; si se queda ahi, hay que reconectarla.
12271
12529
  */
12272
12530
  type Integration = Schemas["IntegrationsIntegration"];
12273
- /** Que sabe hacer un proveedor y que campos lleva su formulario. Es lo que decide como conectar. */
12531
+ /**
12532
+ * Que sabe hacer un proveedor y que campos lleva su formulario. Es lo que decide como conectar, y
12533
+ * se ramifica por sus puertas, nunca por el nombre del proveedor:
12534
+ *
12535
+ * - `requires_oauth`: hay un token detras (Google Drive). **Tener enlace no es ser OAuth.**
12536
+ * - `connect_link`: se conecta mandando al usuario a {@link IntegrationsResource.connectLink}.
12537
+ * Drive (su OAuth) y WooCommerce (el boton de aprobar de la tienda), que ademas pide antes lo que
12538
+ * diga `connect_link_fields` (la `url` de la tienda).
12539
+ * - `catalog`: tiene catalogo de productos ({@link IntegrationsResource.products}) y sirve de fuente
12540
+ * a la plantilla `from_catalog`.
12541
+ */
12274
12542
  type IntegrationProvider = Schemas["IntegrationsIntegrationProvider"];
12543
+ /**
12544
+ * Un campo del formulario de un proveedor. **`secret` es una credencial** (la consumer secret de
12545
+ * WooCommerce): se oculta, no se rellena nunca al editar y va con `autocomplete="new-password"`, o
12546
+ * el gestor de contrasenas del navegador la rellena con la contrasena de PlanVortex del usuario y la
12547
+ * tienda contesta 2211.
12548
+ */
12549
+ type IntegrationFormField = Schemas["IntegrationsIntegrationFormField"];
12275
12550
  /** Un proveedor soportado. Abierto porque la lista crece. */
12276
12551
  type IntegrationProviderName = OpenEnum<Schemas["IntegrationsIntegrationProviderName"]>;
12277
- /** La configuracion de un feed RSS. En Google Drive el `config` es un objeto vacio. */
12552
+ /** La configuracion de un feed RSS: lo que se puede mandar en el `config` de un `update`. */
12278
12553
  type RssConfig = Schemas["IntegrationsRssConfig"];
12279
12554
  /**
12280
- * Lo que se manda para conectar o reconectar. Son dos formas y las distingue `provider`: con OAuth
12281
- * viaja el `code`, y sin el, el formulario de `config_fields`.
12555
+ * Lo que guarda el `config` de una integracion, segun el proveedor. Google Drive: nada. RSS: el feed.
12556
+ * WooCommerce: como llegar a la tienda, que lo detecta el servidor al conectar. Nunca un secreto.
12557
+ *
12558
+ * Dos claves de la tienda que hay que ENSENAR, no solo guardar:
12559
+ *
12560
+ * - **`key_ending`**: desconectar no revoca la clave (WooCommerce no deja que una app borre la
12561
+ * suya), y es lo que dice cual borrar en WooCommerce → Ajustes → Avanzado → API REST.
12562
+ * - **`tax_location_missing`**: la API de esa tienda da los precios SIN impuesto con la etiqueta de
12563
+ * "IVA incluido", asi que sus productos con impuesto vienen sin `price`. Se arregla en su
12564
+ * WordPress (ubicacion del cliente por defecto → pais de la tienda) y reconectando.
12282
12565
  */
12283
- type IntegrationConnectRequest = Schemas["IntegrationsGoogleDriveConnectRequest"] | Schemas["IntegrationsRssConnectRequest"];
12566
+ type IntegrationConfig = Schemas["IntegrationsIntegrationConfig"];
12567
+ /**
12568
+ * Conectar una tienda con claves creadas a mano (con permiso de **lectura**). El boton
12569
+ * ({@link IntegrationsResource.connectLink}) hace lo mismo sin copiar ninguna clave, y es mejor
12570
+ * siempre que la tienda lo permita: con enlaces permanentes "simples" no puede (2216).
12571
+ */
12572
+ type WooCommerceConnectRequest = Schemas["IntegrationsWooCommerceConnectRequest"];
12573
+ /**
12574
+ * Lo que se manda para conectar o reconectar. Tres formas y las distingue `provider`: con OAuth
12575
+ * viaja el `code`; sin el, el formulario de `config_fields` PLANO (el feed, o la tienda con sus
12576
+ * claves).
12577
+ */
12578
+ type IntegrationConnectRequest = Schemas["IntegrationsGoogleDriveConnectRequest"] | Schemas["IntegrationsRssConnectRequest"] | WooCommerceConnectRequest;
12579
+ /**
12580
+ * Un producto de una tienda conectada, ya normalizado: la misma forma sea cual sea la tienda.
12581
+ *
12582
+ * `external_id` es SIEMPRE una cadena, y es lo que va en `source.products` de un plan
12583
+ * `from_catalog`. `price` es TEXTO para copiar literal, como lo ensena la tienda (impuesto, simbolo,
12584
+ * rango): nunca un numero sobre el que hacer cuentas, y ausente es "sin precio". **`available: false`
12585
+ * es lo agotado**: se ensena marcado pero no se deja elegir, y un plan con uno se rechaza (2112).
12586
+ */
12587
+ type IntegrationCatalogProduct = Schemas["IntegrationsIntegrationCatalogProduct"];
12588
+ /**
12589
+ * Una pagina del catalogo de una tienda. Sin `next_cursor`, es la ultima. El cursor es OPACO: se
12590
+ * devuelve tal cual llego y no se construye ni se interpreta nunca.
12591
+ */
12592
+ type IntegrationCatalogPage = Schemas["IntegrationsIntegrationCatalogPage"];
12284
12593
  /** Lo que se puede cambiar de una integracion ya conectada. */
12285
12594
  type IntegrationUpdate = Operations["updateIntegration"]["requestBody"]["content"]["application/json"];
12286
12595
  /**
@@ -12331,6 +12640,11 @@ type AiPlanOptionsInput = Schemas["AiPlansAiPlanOptionsInput"];
12331
12640
  *
12332
12641
  * Y `options.link` es el enlace de destino de todos los pins del plan: se valida al crear (994) y
12333
12642
  * se tira si el plan no tiene ninguna red con `link`.
12643
+ *
12644
+ * **No toda red cabe en toda plantilla.** Las de `unsupported_networks` de la plantilla
12645
+ * ({@link PlannerTemplate}) se quedan fuera de `accounts`, o el plan se rechaza con el **2120**
12646
+ * antes de leer nada ni cobrar nada: hoy es YouTube en `from_images` y `from_catalog`, donde toda
12647
+ * publicacion es la foto de su fuente y YouTube solo sube video.
12334
12648
  */
12335
12649
  type AiPlanCreateRequest = Schemas["AiPlansAiPlanCreateRequest"];
12336
12650
  /**
@@ -12348,14 +12662,15 @@ type AiPlanDestination = Schemas["AiPlansAiPlanDestination"];
12348
12662
  * | `standard` | ninguno: no tiene fuente |
12349
12663
  * | `from_images` | `images` |
12350
12664
  * | `from_text` | `url` **o** `text` |
12351
- * | `from_catalog` | `id_account_catalog`, `product_catalog_id`, `products` |
12665
+ * | `from_catalog` | `id_account_catalog` + `product_catalog_id` (un catalogo de Meta) **o** `id_integration_catalog` (una tienda conectada), y `products` |
12352
12666
  * | `campaign` | `event_name`, `event_date` |
12353
12667
  *
12354
- * Se valida al CREAR el plan, no al generarlo: el articulo se descarga, el catalogo se lee en vivo
12355
- * y las fotos de los productos se copian, asi que una fuente que no funciona falla mientras el
12356
- * usuario sigue delante. Dos trampas que el tipo no puede decir: `text` GANA sobre `url` cuando
12357
- * llegan los dos —pegar el texto es lo que hace quien no consiguio que se descargara—, y
12358
- * `event_date` es un DIA DE CALENDARIO (`YYYY-MM-DD`), nunca un instante ISO.
12668
+ * Se valida al CREAR el plan, no al generarlo: el articulo se descarga, el catalogo o la tienda se
12669
+ * leen en vivo y las fotos de los productos se copian, asi que una fuente que no funciona falla
12670
+ * mientras el usuario sigue delante. Tres trampas que el tipo no puede decir: `text` GANA sobre
12671
+ * `url` cuando llegan los dos —pegar el texto es lo que hace quien no consiguio que se descargara—,
12672
+ * `event_date` es un DIA DE CALENDARIO (`YYYY-MM-DD`), nunca un instante ISO, y las dos fuentes de
12673
+ * `from_catalog` son EXCLUYENTES: mandar las dos es un 2112, no una mezcla.
12359
12674
  */
12360
12675
  type AiPlanSourceInput = Schemas["AiPlansAiPlanSourceInput"];
12361
12676
  /** Una foto de `from_images`. La descripcion es obligatoria a proposito: sin ella el modelo escribe sobre lo que cree ver. */
@@ -12368,11 +12683,12 @@ type AiPlanSource = Schemas["AiPlansAiPlanSource"];
12368
12683
  /**
12369
12684
  * Un producto del catalogo, copiado al crear el plan.
12370
12685
  *
12371
- * `price` viene **exactamente como lo devolvio la red** (`"9,99 €"`) y no se convierte nunca: el
12372
- * mismo campo es un numero en otros caminos de la API de Meta y no hay forma de saber si son
12373
- * unidades o centimos. Dividir por 100 "por si acaso" es como se anuncia un producto de 10 € a
12374
- * 0,10 €. Y `id_upload` es la foto ya copiada a un fichero de la organizacion, porque la URL del
12375
- * CDN de la red caduca.
12686
+ * `price` viene **exactamente como lo dio la fuente** (`"9,99 €"` de Meta, `"14,52 € IVA incluido"`
12687
+ * de una tienda) y no se convierte nunca: el mismo campo es un numero en otros caminos de la API de
12688
+ * Meta y no hay forma de saber si son unidades o centimos. Dividir por 100 "por si acaso" es como se
12689
+ * anuncia un producto de 10 € a 0,10 €. `permalink` es la ficha publica del producto: el texto la
12690
+ * pone donde un enlace se puede pulsar, y un pin lleva ahi si el plan no trae su `options.link`. Y
12691
+ * `id_upload` es la foto ya copiada a un fichero de la organizacion, porque la URL del catalogo caduca.
12376
12692
  */
12377
12693
  type AiPlanSourceProduct = Schemas["AiPlansAiPlanSourceProduct"];
12378
12694
  /**
@@ -12982,4 +13298,4 @@ interface PlanVortexWebhooksOptions {
12982
13298
  */
12983
13299
  declare function planvortexWebhooks(options: PlanVortexWebhooksOptions): (request: WebhookRequestLike, response: WebhookResponseLike, next: (error?: unknown) => void) => void;
12984
13300
 
12985
- export { type ClientWithOrganizations as $, type Account as A, type CommentReplyResult as B, type ConnectLink as C, type Destination as D, type EnableResult as E, type ContactExtraData as F, type Contact as G, type ContactCreate as H, type ContactUpdate as I, type IntegrationProviderName as J, type IntegrationProvider as K, type Integration as L, type MetricName as M, type IntegrationConnectRequest as N, type IntegrationUpdate as O, type Paginated as P, type IntegrationPickerConfig as Q, type MessageTemplate as R, type SocialNetwork as S, type TopPublicationsResult as T, type Conversation as U, type ConversationTotals as V, type Message as W, type MessageInput as X, type Client as Y, type Organization as Z, type AiSettings as _, type ConnectResult as a, PLANVORTEX_ERROR_RANGES as a$, type PlanData as a0, type PlanUseData as a1, type ConnectToken as a2, type AiContext as a3, type SocialCredentialsInput as a4, type Product as a5, type ProductInput as a6, type ProductCatalog as a7, type ProductCatalogInput as a8, type PublicationInput as a9, type ClientPlan as aA, type CommentAuthor as aB, type CommentChange as aC, type ContactChannel as aD, ContactError as aE, type DashboardAiPlanRef as aF, type DashboardPublicationRef as aG, type DashboardRange as aH, type EngagementBase as aI, FileError as aJ, type FileFormat as aK, type FileProperties as aL, type FileType as aM, IntegrationError as aN, type IntegrationErrorChange as aO, type MessageChange as aP, type MessageOptions as aQ, type MessageType as aR, MessagingError as aS, type MetricRow as aT, NO_ERROR_CODE as aU, type components as aV, type operations as aW, type paths as aX, type webhooks as aY, type OpenEnum as aZ, OrganizationError as a_, type PublicationState as aa, type PublicationStats as ab, type PublicationStatsHistory as ac, type Upload as ad, AccountError as ae, type AccountMetricRow as af, type AccountStateChange as ag, type AccountWebhookChangeBase as ah, type AccountWithError as ai, type AiPlanCostEstimate as aj, type AiPlanDestination as ak, AiPlanError as al, type AiPlanNotice as am, type AiPlanOptions as an, type AiPlanOptionsInput as ao, type AiPlanResult as ap, type AiPlanResultsGroup as aq, type AiPlanResultsTemplateGroup as ar, type AiPlanSource as as, type AiPlanSourceImageInput as at, type AiPlanSourceInput as au, type AiPlanSourceProduct as av, type AiPlanState as aw, type ApiErrorBody as ax, type AspectRatios as ay, AuthError as az, type AccountMetrics as b, PlanLimitError as b0, PlanVortexAuthenticationError as b1, PlanVortexConfigError as b2, PlanVortexConnectionError as b3, PlanVortexError as b4, type PlanVortexErrorOptions as b5, type PlanVortexErrorRange as b6, type PlannerTemplateField as b7, type PlannerTemplateFieldType as b8, ProductError as b9, isTokenError as bA, messageContact as bB, messageContactId as bC, messageDirection as bD, messageFileIds as bE, messageFiles as bF, publication as bG, publicationId as bH, type HandleWebhookRequestOptions as bI, type PlanVortexWebhooksOptions as bJ, type RawWebhookBody as bK, type VerifyWebhookSignatureOptions as bL, WEBHOOK_EVENTS as bM, WEBHOOK_SIGNATURE_HEADERS as bN, WebhookBodyError as bO, type WebhookHeaders as bP, type WebhookRequestLike as bQ, type WebhookResponseLike as bR, WebhookSignatureError as bS, handleWebhookRequest as bT, isAccountStateChange as bU, isCommentChange as bV, isIntegrationErrorChange as bW, isMessageChange as bX, parseWebhookPayload as bY, planvortexWebhooks as bZ, verifyWebhookSignature as b_, type PublicationDestination as ba, PublicationError as bb, type PublicationErrorDetail as bc, type PublicationMetrics as bd, type PublicationStatsPoint as be, type PublicationType as bf, type PublicationsSummary as bg, type RssConfig as bh, type SocialAuthorizationMethod as bi, type SocialCredentials as bj, type SocialIdentifier as bk, type SocialIdentifierInput as bl, type SocialLimitsMap as bm, TOKEN_ERROR_CODES as bn, type TopPublication as bo, type UnknownWebhookChange as bp, UserError as bq, type WebhookAlgorithm as br, type WebhookChange as bs, type WebhookEvent as bt, type WithAccount as bu, type WithPublication as bv, account as bw, accountId as bx, errorFamilyForCode as by, isPlanVortexError as bz, type PersistentMenu as c, type Dashboard as d, type DashboardMetricsResult as e, type PublicationsSummaryResult as f, type PublicationsStatsResult as g, type PlanUse as h, type Publication as i, type AiPlanResultsSort as j, type PlannerTemplateName as k, type AiPlanCreateRequest as l, type AiPlanCreateResult as m, type AiPlan as n, type AiPlanResults as o, type ClientApp as p, type ClientAppInput as q, type SocialCapabilities as r, type CommentActions as s, type SocialLimits as t, type PublicationLimits as u, type AspectRatiosByNetwork as v, type PlannerTemplate as w, type CommentNetwork as x, type Comment as y, type CommentThread as z };
13301
+ export { type AiSettings as $, type Account as A, type CommentReplyResult as B, type ConnectLink as C, type Destination as D, type EnableResult as E, type ContactExtraData as F, type Contact as G, type ContactCreate as H, type ContactUpdate as I, type IntegrationProviderName as J, type IntegrationProvider as K, type Integration as L, type MetricName as M, type IntegrationConnectRequest as N, type IntegrationUpdate as O, type Paginated as P, type IntegrationPickerConfig as Q, type IntegrationCatalogPage as R, type SocialNetwork as S, type TopPublicationsResult as T, type MessageTemplate as U, type Conversation as V, type ConversationTotals as W, type Message as X, type MessageInput as Y, type Client as Z, type Organization as _, type ConnectResult as a, type paths as a$, type ClientWithOrganizations as a0, type PlanData as a1, type PlanUseData as a2, type ConnectToken as a3, type AiContext as a4, type SocialCredentialsInput as a5, type Product as a6, type ProductInput as a7, type ProductCatalog as a8, type ProductCatalogInput as a9, AuthError as aA, type ClientPlan as aB, type CommentAuthor as aC, type CommentChange as aD, type ContactChannel as aE, ContactError as aF, type DashboardAiPlanRef as aG, type DashboardPublicationRef as aH, type DashboardRange as aI, type EngagementBase as aJ, FileError as aK, type FileFormat as aL, type FileProperties as aM, type FileType as aN, type IntegrationCatalogProduct as aO, type IntegrationConfig as aP, IntegrationError as aQ, type IntegrationErrorChange as aR, type IntegrationFormField as aS, type MessageChange as aT, type MessageOptions as aU, type MessageType as aV, MessagingError as aW, type MetricRow as aX, NO_ERROR_CODE as aY, type components as aZ, type operations as a_, type PublicationInput as aa, type PublicationState as ab, type PublicationStats as ac, type PublicationStatsHistory as ad, type Upload as ae, AccountError as af, type AccountMetricRow as ag, type AccountStateChange as ah, type AccountWebhookChangeBase as ai, type AccountWithError as aj, type AiPlanCostEstimate as ak, type AiPlanDestination as al, AiPlanError as am, type AiPlanNotice as an, type AiPlanOptions as ao, type AiPlanOptionsInput as ap, type AiPlanResult as aq, type AiPlanResultsGroup as ar, type AiPlanResultsTemplateGroup as as, type AiPlanSource as at, type AiPlanSourceImageInput as au, type AiPlanSourceInput as av, type AiPlanSourceProduct as aw, type AiPlanState as ax, type ApiErrorBody as ay, type AspectRatios as az, type AccountMetrics as b, isIntegrationErrorChange as b$, type webhooks as b0, type OpenEnum as b1, OrganizationError as b2, PLANVORTEX_ERROR_RANGES as b3, PlanLimitError as b4, PlanVortexAuthenticationError as b5, PlanVortexConfigError as b6, PlanVortexConnectionError as b7, PlanVortexError as b8, type PlanVortexErrorOptions as b9, type WooCommerceConnectRequest as bA, account as bB, accountId as bC, errorFamilyForCode as bD, isPlanVortexError as bE, isTokenError as bF, messageContact as bG, messageContactId as bH, messageDirection as bI, messageFileIds as bJ, messageFiles as bK, publication as bL, publicationId as bM, type HandleWebhookRequestOptions as bN, type PlanVortexWebhooksOptions as bO, type RawWebhookBody as bP, type VerifyWebhookSignatureOptions as bQ, WEBHOOK_EVENTS as bR, WEBHOOK_SIGNATURE_HEADERS as bS, WebhookBodyError as bT, type WebhookHeaders as bU, type WebhookRequestLike as bV, type WebhookResponseLike as bW, WebhookSignatureError as bX, handleWebhookRequest as bY, isAccountStateChange as bZ, isCommentChange as b_, type PlanVortexErrorRange as ba, type PlannerTemplateField as bb, type PlannerTemplateFieldType as bc, ProductError as bd, type PublicationDestination as be, PublicationError as bf, type PublicationErrorDetail as bg, type PublicationMetrics as bh, type PublicationStatsPoint as bi, type PublicationType as bj, type PublicationsSummary as bk, type RssConfig as bl, type SocialAuthorizationMethod as bm, type SocialCredentials as bn, type SocialIdentifier as bo, type SocialIdentifierInput as bp, type SocialLimitsMap as bq, TOKEN_ERROR_CODES as br, type TopPublication as bs, type UnknownWebhookChange as bt, UserError as bu, type WebhookAlgorithm as bv, type WebhookChange as bw, type WebhookEvent as bx, type WithAccount as by, type WithPublication as bz, type PersistentMenu as c, isMessageChange as c0, parseWebhookPayload as c1, planvortexWebhooks as c2, verifyWebhookSignature as c3, type Dashboard as d, type DashboardMetricsResult as e, type PublicationsSummaryResult as f, type PublicationsStatsResult as g, type PlanUse as h, type Publication as i, type AiPlanResultsSort as j, type PlannerTemplateName as k, type AiPlanCreateRequest as l, type AiPlanCreateResult as m, type AiPlan as n, type AiPlanResults as o, type ClientApp as p, type ClientAppInput as q, type SocialCapabilities as r, type CommentActions as s, type SocialLimits as t, type PublicationLimits as u, type AspectRatiosByNetwork as v, type PlannerTemplate as w, type CommentNetwork as x, type Comment as y, type CommentThread as z };