@vitrina/api 11.10.0 → 11.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -71831,7 +71831,13 @@ interface paths {
71831
71831
  * Open a conversation from the platform side
71832
71832
  * @description The outbound counterpart to an inbound provider message — everything else in the inbox is created BY the provider webhook when a customer writes. Because nothing arrived from a provider, the caller supplies the channel and the contact identity.
71833
71833
  *
71834
- * ⚠ The contact is matched on `external_id` ONLY, never on email or phone. Send `contact.external_id` and the call reuses that contact; omit it and a NEW contact is created every time, because the id it falls back to is a fresh `manual:<uuid>` that by construction matches nothing. Calling this twice for the same person without an `external_id` leaves two contacts. Carry your own stable id for anyone you may open a second thread with.
71834
+ * The contact is RESOLVED before it is created, in this order: `contact.external_id`, then `contact.email`, then `contact.phone`. The first one that finds somebody wins and that contact is reused; only a miss on all three creates a new one. So calling this twice for the same person no longer leaves two contacts, and a 201 may well carry a contact that already existed — read `contact.id` rather than assuming the response describes a new record.
71835
+ *
71836
+ * ⚠ A BLANK FIELD NEVER MATCHES. An email or phone you omit, send empty, or send in a shape we cannot parse is skipped entirely — it is not compared against contacts that have none, because fusing two unrelated people onto one record is worse than the duplicate it would avoid. Send only the identifiers you actually hold.
71837
+ *
71838
+ * Matching is deliberately tolerant of spelling: email is compared case-insensitively, and a phone is normalised first, so `+56 9 1234 5678`, `56912345678` and `912345678` all resolve to the same person. An identity recorded on the contact’s channels counts as much as the one stored on the contact itself, so a number captured during an earlier WhatsApp thread is found here too.
71839
+ *
71840
+ * Carry your own `contact.external_id` for anyone you may open a second thread with: it is the only key that cannot drift. An email address and a phone number can both be reassigned to a different person, which is exactly why they are consulted after it and not before.
71835
71841
  *
71836
71842
  * ⚠ The thread is addressable only if the channel can work out where to send. On `web` the address IS the visitor session, so a conversation opened here gets a synthetic `manual:<uuid>` external id and sending on it answers 422 `no_channel_identity` — open a web thread from the widget instead. On `whatsapp` and `email` the contact's phone or address is the address, and the thread is sendable as soon as `messaging_account_id` names a connected account.
71837
71843
  */
@@ -91904,11 +91910,14 @@ interface paths {
91904
91910
  *
91905
91911
  * When the per-key read is unavailable the answer falls back to the health read's daily UTM scan: `source: health`, `installed` = the refreshed scan counted events, `last_seen_at` / `events_24h` / `domain` = `null`. `events_24h` is `null` (never `0`) whenever the count could not be read.
91906
91912
  *
91907
- * Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
91913
+ * Same entitlement gate as `GET /ads/tracking/key`, except that `sample=1` (or a sandbox workspace) answers a fixed sample status (`installed: true`, seen minutes ago, `source: tracker`) without the entitlement and without reading the real tag — like every other Ads read. Admin-scoped (`ads:read`).
91908
91914
  */
91909
91915
  get: {
91910
91916
  parameters: {
91911
- query?: never;
91917
+ query?: {
91918
+ /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
91919
+ sample?: "1" | "true";
91920
+ };
91912
91921
  header?: never;
91913
91922
  path?: never;
91914
91923
  cookie?: never;
package/dist/index.d.ts CHANGED
@@ -71831,7 +71831,13 @@ interface paths {
71831
71831
  * Open a conversation from the platform side
71832
71832
  * @description The outbound counterpart to an inbound provider message — everything else in the inbox is created BY the provider webhook when a customer writes. Because nothing arrived from a provider, the caller supplies the channel and the contact identity.
71833
71833
  *
71834
- * ⚠ The contact is matched on `external_id` ONLY, never on email or phone. Send `contact.external_id` and the call reuses that contact; omit it and a NEW contact is created every time, because the id it falls back to is a fresh `manual:<uuid>` that by construction matches nothing. Calling this twice for the same person without an `external_id` leaves two contacts. Carry your own stable id for anyone you may open a second thread with.
71834
+ * The contact is RESOLVED before it is created, in this order: `contact.external_id`, then `contact.email`, then `contact.phone`. The first one that finds somebody wins and that contact is reused; only a miss on all three creates a new one. So calling this twice for the same person no longer leaves two contacts, and a 201 may well carry a contact that already existed — read `contact.id` rather than assuming the response describes a new record.
71835
+ *
71836
+ * ⚠ A BLANK FIELD NEVER MATCHES. An email or phone you omit, send empty, or send in a shape we cannot parse is skipped entirely — it is not compared against contacts that have none, because fusing two unrelated people onto one record is worse than the duplicate it would avoid. Send only the identifiers you actually hold.
71837
+ *
71838
+ * Matching is deliberately tolerant of spelling: email is compared case-insensitively, and a phone is normalised first, so `+56 9 1234 5678`, `56912345678` and `912345678` all resolve to the same person. An identity recorded on the contact’s channels counts as much as the one stored on the contact itself, so a number captured during an earlier WhatsApp thread is found here too.
71839
+ *
71840
+ * Carry your own `contact.external_id` for anyone you may open a second thread with: it is the only key that cannot drift. An email address and a phone number can both be reassigned to a different person, which is exactly why they are consulted after it and not before.
71835
71841
  *
71836
71842
  * ⚠ The thread is addressable only if the channel can work out where to send. On `web` the address IS the visitor session, so a conversation opened here gets a synthetic `manual:<uuid>` external id and sending on it answers 422 `no_channel_identity` — open a web thread from the widget instead. On `whatsapp` and `email` the contact's phone or address is the address, and the thread is sendable as soon as `messaging_account_id` names a connected account.
71837
71843
  */
@@ -91904,11 +91910,14 @@ interface paths {
91904
91910
  *
91905
91911
  * When the per-key read is unavailable the answer falls back to the health read's daily UTM scan: `source: health`, `installed` = the refreshed scan counted events, `last_seen_at` / `events_24h` / `domain` = `null`. `events_24h` is `null` (never `0`) whenever the count could not be read.
91906
91912
  *
91907
- * Same entitlement gate as `GET /ads/tracking/key`. Admin-scoped (`ads:read`).
91913
+ * Same entitlement gate as `GET /ads/tracking/key`, except that `sample=1` (or a sandbox workspace) answers a fixed sample status (`installed: true`, seen minutes ago, `source: tracker`) without the entitlement and without reading the real tag — like every other Ads read. Admin-scoped (`ads:read`).
91908
91914
  */
91909
91915
  get: {
91910
91916
  parameters: {
91911
- query?: never;
91917
+ query?: {
91918
+ /** @description `1` serves the deterministic sample dataset («Ver con datos de ejemplo»): same shapes, invented but internally consistent figures, no entitlement required (the scope still is). A sandbox workspace is always served the sample, with or without this parameter. */
91919
+ sample?: "1" | "true";
91920
+ };
91912
91921
  header?: never;
91913
91922
  path?: never;
91914
91923
  cookie?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "11.10.0",
3
+ "version": "11.12.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",