planvortex 0.23.0 → 0.24.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.
@@ -869,9 +869,9 @@ interface paths {
869
869
  * The thread of an account, read live
870
870
  * @description The twin of the publication endpoint, for networks whose comments **do not hang off a publication of yours**.
871
871
  *
872
- * Today that is Google Business: a review hangs off the **listing**, so the account has no publication to ask about. Its `publication_external_id` is the listing itself (`locations/{id}`) and `id_publication` is always absent.
872
+ * There are two. On **Google Business** a review hangs off the **listing**, so the account has no publication to ask about: its `publication_external_id` is the listing itself (`locations/{id}`) and `id_publication` is always absent. On **Discord** this is what people tell the brand in the channel itself, outside the threads of your posts: `publication_external_id` is the id of the channel, and `id_publication` is there when the message answers one of your posts.
873
873
  *
874
- * Same reconciliation, same permissions, same shape of response as the publication thread. Pick between the two by looking at the comment: if it has an `id_publication`, use that one; if it does not, use this.
874
+ * Same reconciliation, same permissions, same shape of response as the publication thread. Pick between the two by looking at the comment: if it hangs off a publication of yours (its `publication_external_id` is that publication's `external_identifier`), use that one; if it does not, use this.
875
875
  *
876
876
  * One behaviour differs underneath, and it matters if you are reasoning about deletions: **reviews are exempt from the deletion sweep**. Google's review listing cannot be ordered by creation date (only by last update or by rating), so the rule that says "newer than the oldest row on this page and missing from it means it is gone" does not hold, and applying it would empty most of a busy listing's inbox in one pass. The trade is deliberate: a review Google removes may linger, which is rare, rather than good rows disappearing, which is not recoverable.
877
877
  *
@@ -1541,6 +1541,8 @@ interface paths {
1541
1541
  *
1542
1542
  * Your own replies written in the last few minutes are injected into the first page even when the network does not list them yet: networks index what you just wrote with a delay, and without this you would post a reply, refresh, and see nothing.
1543
1543
  *
1544
+ * On Discord, the replies to a comment from the channel come from PlanVortex's own inbox and not from a live read: your replies go out through a webhook, and Discord does not say which message they answered. The channel is read every five minutes.
1545
+ *
1544
1546
  * On Google Business a review has **at most one** reply — yours — so this returns zero or one row and there is no tree to walk.
1545
1547
  *
1546
1548
  * Requires the `comments:read` permission (`client_organization_comments:read` for apps) and a paid plan.
@@ -1575,6 +1577,8 @@ interface paths {
1575
1577
  *
1576
1578
  * **On X this costs credits**: 15, or 200 if the text contains a link, charged only on success.
1577
1579
  *
1580
+ * **On `discord` the reply goes where the comment is.** To a comment in a thread, inside the thread. To a comment from the channel, in the channel and mentioning its author, who is the only person notified.
1581
+ *
1578
1582
  * **On `telegram` the reply is signed by the PlanVortex bot**, not by the channel. It is written in the channel's linked discussion group, which is where Telegram keeps the comments on a channel post — and a channel with no discussion group has no comments at all, which is error 965. Publishing is not affected: a channel post is signed by the channel.
1579
1583
  *
1580
1584
  * Requires the `comments:create` permission (`client_organization_comments:create` for apps) and a paid plan.
@@ -2885,6 +2889,11 @@ interface components {
2885
2889
  */
2886
2890
  Account: {
2887
2891
  _id: string;
2892
+ /** @description What goes into this account's comment inbox. Only `discord` uses it, and its absence means the defaults. */
2893
+ comments_settings?: {
2894
+ /** @description Discord only. `false` (the default): the inbox gets what is addressed to the brand, that is, replies to your posts in the channel and mentions of your bot. `true`: it gets every message a person writes in the channel, which is meant for a support or questions channel where nobody mentions the bot. Turning it off later keeps what already came in. */
2895
+ all_channel_messages?: boolean;
2896
+ };
2888
2897
  /** Format: date-time */
2889
2898
  creation_date: string;
2890
2899
  /** @description `0` is a healthy account. Anything else is a PlanVortex error code explaining why the connection stopped working; the account keeps its data but cannot be used until it is reconnected. */
@@ -3931,6 +3940,8 @@ interface components {
3931
3940
  /**
3932
3941
  * @description **Your** publication, when there is one — and there often is not: a video uploaded to the channel by hand, a post that predates PlanVortex, and every Google Business review have comments with no publication of ours behind them. What always identifies the target is `publication_external_id`.
3933
3942
  *
3943
+ * On Discord, a comment written in the channel itself hangs off the channel and not off this publication: here it says which of your posts it answers.
3944
+ *
3934
3945
  * Same asymmetry as `id_account`: the inbox listing resolves it into the whole publication, every other operation returns the identifier as a string.
3935
3946
  */
3936
3947
  id_publication?: string | components["schemas"]["Publication"];
@@ -3940,7 +3951,7 @@ interface components {
3940
3951
  our_reply_external_id?: string;
3941
3952
  /** @description Present only when this is a reply to another comment */
3942
3953
  parent_external_id?: string;
3943
- /** @description What the comment hangs off, on the network: the post/video id in most networks, the **listing** (`locations/{id}`) for a Google Business review, and the published message's id on Telegram — where the thread that holds the comments *is* the forwarded post. */
3954
+ /** @description What the comment hangs off, on the network: the post/video id in most networks, the **listing** (`locations/{id}`) for a Google Business review, the **channel** for what is written in a Discord channel outside the threads of your posts, and the published message's id on Telegram — where the thread that holds the comments *is* the forwarded post. */
3944
3955
  publication_external_id: string;
3945
3956
  /**
3946
3957
  * @description Star rating of a **review**. Present only on review networks — today Google Business. Its absence means "this network has no such thing", never zero.
@@ -8188,6 +8199,11 @@ interface operations {
8188
8199
  requestBody: {
8189
8200
  content: {
8190
8201
  "application/json": {
8202
+ /** @description What goes into this account's comment inbox. Only `discord` uses it: on any other network it is ignored, and the account comes back without it. */
8203
+ comments_settings?: {
8204
+ /** @description Discord only. `false` (the default): the inbox gets what is addressed to the brand, that is, replies to your posts in the channel and mentions of your bot. `true`: it gets every message a person writes in the channel, which is meant for a support or questions channel where nobody mentions the bot. Turning it off later keeps what already came in. */
8205
+ all_channel_messages?: boolean;
8206
+ };
8191
8207
  /** @description Display name for the connected account inside PlanVortex. It does not rename anything on the social network. If omitted, the current name is kept. */
8192
8208
  name?: string;
8193
8209
  };
@@ -13507,7 +13523,9 @@ type PublicationStatsPoint = Override<Schemas["PublicationsPublicationStatsPoint
13507
13523
  * - **`id_publication` falta** cuando el comentario no cuelga de una publicacion nuestra, y eso
13508
13524
  * no es raro: la resena de Google Business cuelga de la FICHA (ahi `publication_external_id`
13509
13525
  * es `locations/{id}`), y un video subido a mano al canal o un post anterior a PlanVortex
13510
- * tambien reciben comentarios. Lo que identifica siempre es `publication_external_id`.
13526
+ * tambien reciben comentarios. Lo que identifica siempre es `publication_external_id`. Y al
13527
+ * reves en Discord: lo que se escribe en el propio canal cuelga del CANAL, y ahi
13528
+ * `id_publication`, si esta, dice a que publicacion contesta y no de que cuelga.
13511
13529
  * - **`id_account` e `id_publication` cambian de forma segun la operacion**: LA BANDEJA los
13512
13530
  * devuelve poblados —el objeto entero— y todo lo demas —los hilos en vivo, responder,
13513
13531
  * actualizar— como cadena. Es la misma asimetria que `Publication.id_account` y se tapa igual,
@@ -869,9 +869,9 @@ interface paths {
869
869
  * The thread of an account, read live
870
870
  * @description The twin of the publication endpoint, for networks whose comments **do not hang off a publication of yours**.
871
871
  *
872
- * Today that is Google Business: a review hangs off the **listing**, so the account has no publication to ask about. Its `publication_external_id` is the listing itself (`locations/{id}`) and `id_publication` is always absent.
872
+ * There are two. On **Google Business** a review hangs off the **listing**, so the account has no publication to ask about: its `publication_external_id` is the listing itself (`locations/{id}`) and `id_publication` is always absent. On **Discord** this is what people tell the brand in the channel itself, outside the threads of your posts: `publication_external_id` is the id of the channel, and `id_publication` is there when the message answers one of your posts.
873
873
  *
874
- * Same reconciliation, same permissions, same shape of response as the publication thread. Pick between the two by looking at the comment: if it has an `id_publication`, use that one; if it does not, use this.
874
+ * Same reconciliation, same permissions, same shape of response as the publication thread. Pick between the two by looking at the comment: if it hangs off a publication of yours (its `publication_external_id` is that publication's `external_identifier`), use that one; if it does not, use this.
875
875
  *
876
876
  * One behaviour differs underneath, and it matters if you are reasoning about deletions: **reviews are exempt from the deletion sweep**. Google's review listing cannot be ordered by creation date (only by last update or by rating), so the rule that says "newer than the oldest row on this page and missing from it means it is gone" does not hold, and applying it would empty most of a busy listing's inbox in one pass. The trade is deliberate: a review Google removes may linger, which is rare, rather than good rows disappearing, which is not recoverable.
877
877
  *
@@ -1541,6 +1541,8 @@ interface paths {
1541
1541
  *
1542
1542
  * Your own replies written in the last few minutes are injected into the first page even when the network does not list them yet: networks index what you just wrote with a delay, and without this you would post a reply, refresh, and see nothing.
1543
1543
  *
1544
+ * On Discord, the replies to a comment from the channel come from PlanVortex's own inbox and not from a live read: your replies go out through a webhook, and Discord does not say which message they answered. The channel is read every five minutes.
1545
+ *
1544
1546
  * On Google Business a review has **at most one** reply — yours — so this returns zero or one row and there is no tree to walk.
1545
1547
  *
1546
1548
  * Requires the `comments:read` permission (`client_organization_comments:read` for apps) and a paid plan.
@@ -1575,6 +1577,8 @@ interface paths {
1575
1577
  *
1576
1578
  * **On X this costs credits**: 15, or 200 if the text contains a link, charged only on success.
1577
1579
  *
1580
+ * **On `discord` the reply goes where the comment is.** To a comment in a thread, inside the thread. To a comment from the channel, in the channel and mentioning its author, who is the only person notified.
1581
+ *
1578
1582
  * **On `telegram` the reply is signed by the PlanVortex bot**, not by the channel. It is written in the channel's linked discussion group, which is where Telegram keeps the comments on a channel post — and a channel with no discussion group has no comments at all, which is error 965. Publishing is not affected: a channel post is signed by the channel.
1579
1583
  *
1580
1584
  * Requires the `comments:create` permission (`client_organization_comments:create` for apps) and a paid plan.
@@ -2885,6 +2889,11 @@ interface components {
2885
2889
  */
2886
2890
  Account: {
2887
2891
  _id: string;
2892
+ /** @description What goes into this account's comment inbox. Only `discord` uses it, and its absence means the defaults. */
2893
+ comments_settings?: {
2894
+ /** @description Discord only. `false` (the default): the inbox gets what is addressed to the brand, that is, replies to your posts in the channel and mentions of your bot. `true`: it gets every message a person writes in the channel, which is meant for a support or questions channel where nobody mentions the bot. Turning it off later keeps what already came in. */
2895
+ all_channel_messages?: boolean;
2896
+ };
2888
2897
  /** Format: date-time */
2889
2898
  creation_date: string;
2890
2899
  /** @description `0` is a healthy account. Anything else is a PlanVortex error code explaining why the connection stopped working; the account keeps its data but cannot be used until it is reconnected. */
@@ -3931,6 +3940,8 @@ interface components {
3931
3940
  /**
3932
3941
  * @description **Your** publication, when there is one — and there often is not: a video uploaded to the channel by hand, a post that predates PlanVortex, and every Google Business review have comments with no publication of ours behind them. What always identifies the target is `publication_external_id`.
3933
3942
  *
3943
+ * On Discord, a comment written in the channel itself hangs off the channel and not off this publication: here it says which of your posts it answers.
3944
+ *
3934
3945
  * Same asymmetry as `id_account`: the inbox listing resolves it into the whole publication, every other operation returns the identifier as a string.
3935
3946
  */
3936
3947
  id_publication?: string | components["schemas"]["Publication"];
@@ -3940,7 +3951,7 @@ interface components {
3940
3951
  our_reply_external_id?: string;
3941
3952
  /** @description Present only when this is a reply to another comment */
3942
3953
  parent_external_id?: string;
3943
- /** @description What the comment hangs off, on the network: the post/video id in most networks, the **listing** (`locations/{id}`) for a Google Business review, and the published message's id on Telegram — where the thread that holds the comments *is* the forwarded post. */
3954
+ /** @description What the comment hangs off, on the network: the post/video id in most networks, the **listing** (`locations/{id}`) for a Google Business review, the **channel** for what is written in a Discord channel outside the threads of your posts, and the published message's id on Telegram — where the thread that holds the comments *is* the forwarded post. */
3944
3955
  publication_external_id: string;
3945
3956
  /**
3946
3957
  * @description Star rating of a **review**. Present only on review networks — today Google Business. Its absence means "this network has no such thing", never zero.
@@ -8188,6 +8199,11 @@ interface operations {
8188
8199
  requestBody: {
8189
8200
  content: {
8190
8201
  "application/json": {
8202
+ /** @description What goes into this account's comment inbox. Only `discord` uses it: on any other network it is ignored, and the account comes back without it. */
8203
+ comments_settings?: {
8204
+ /** @description Discord only. `false` (the default): the inbox gets what is addressed to the brand, that is, replies to your posts in the channel and mentions of your bot. `true`: it gets every message a person writes in the channel, which is meant for a support or questions channel where nobody mentions the bot. Turning it off later keeps what already came in. */
8205
+ all_channel_messages?: boolean;
8206
+ };
8191
8207
  /** @description Display name for the connected account inside PlanVortex. It does not rename anything on the social network. If omitted, the current name is kept. */
8192
8208
  name?: string;
8193
8209
  };
@@ -13507,7 +13523,9 @@ type PublicationStatsPoint = Override<Schemas["PublicationsPublicationStatsPoint
13507
13523
  * - **`id_publication` falta** cuando el comentario no cuelga de una publicacion nuestra, y eso
13508
13524
  * no es raro: la resena de Google Business cuelga de la FICHA (ahi `publication_external_id`
13509
13525
  * es `locations/{id}`), y un video subido a mano al canal o un post anterior a PlanVortex
13510
- * tambien reciben comentarios. Lo que identifica siempre es `publication_external_id`.
13526
+ * tambien reciben comentarios. Lo que identifica siempre es `publication_external_id`. Y al
13527
+ * reves en Discord: lo que se escribe en el propio canal cuelga del CANAL, y ahi
13528
+ * `id_publication`, si esta, dice a que publicacion contesta y no de que cuelga.
13511
13529
  * - **`id_account` e `id_publication` cambian de forma segun la operacion**: LA BANDEJA los
13512
13530
  * devuelve poblados —el objeto entero— y todo lo demas —los hilos en vivo, responder,
13513
13531
  * actualizar— como cadena. Es la misma asimetria que `Publication.id_account` y se tapa igual,
package/dist/index.cjs CHANGED
@@ -4,7 +4,7 @@ var path = require('path');
4
4
 
5
5
  // src/version.ts
6
6
  var PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
7
- var VERSION = "0.23.0";
7
+ var VERSION = "0.24.0";
8
8
 
9
9
  // src/core/errors.ts
10
10
  var PLANVORTEX_ERROR_RANGES = [
@@ -825,7 +825,12 @@ var AccountsResource = class extends Resource {
825
825
  async get(idOrganization, idAccount, options = {}) {
826
826
  return this.getOne(this.path(idOrganization, idAccount), "account", void 0, options);
827
827
  }
828
- /** Cambia el nombre con el que la cuenta se ve en PlanVortex. Es lo único editable. */
828
+ /**
829
+ * Cambia el nombre con el que la cuenta se ve en PlanVortex y, en **Discord**, qué se trae del
830
+ * canal a la bandeja de comentarios (`comments_settings.all_channel_messages`: `true` es todo lo
831
+ * que se escribe; por defecto, sólo las respuestas a tus publicaciones y las menciones a tu bot).
832
+ * En las demás redes `comments_settings` se ignora.
833
+ */
829
834
  async update(idOrganization, idAccount, body, options = {}) {
830
835
  return this.putOne(this.path(idOrganization, idAccount), "account", body, options);
831
836
  }
@@ -1548,10 +1553,13 @@ var CommentsResource = class extends Resource {
1548
1553
  * EL HILO de una CUENTA, gemelo del anterior, para las redes cuyos comentarios no cuelgan de
1549
1554
  * una publicación nuestra.
1550
1555
  *
1551
- * Hoy es Google Business: una reseña cuelga de la FICHA, no de un post, así que esa cuenta no
1556
+ * Son dos. En Google Business una reseña cuelga de la FICHA, no de un post, así que esa cuenta no
1552
1557
  * tiene ninguna publicación con la que llamar a {@link thread}. Ojo con `total`: es el número
1553
1558
  * de RESEÑAS, que no es la longitud de `comments` — nuestras respuestas viajan en el mismo
1554
1559
  * array, colgando de la reseña que contestan.
1560
+ *
1561
+ * En Discord es lo que le dicen a la marca en el propio CANAL: las respuestas a sus publicaciones
1562
+ * y las menciones a su bot. Los hilos de las publicaciones siguen en {@link thread}.
1555
1563
  */
1556
1564
  async threadByAccount(idOrganization, idAccount, options = {}) {
1557
1565
  return this.httpGet(